tokentracker-cli 0.42.0 → 0.43.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/dashboard/dist/assets/{ActivityHeatmap-CImSj13A.js → ActivityHeatmap-0IDxIr7i.js} +1 -1
- package/dashboard/dist/assets/{Card-DpjFlMHF.js → Card-hVCKEGdC.js} +1 -1
- package/dashboard/dist/assets/DashboardPage-C3QvJSI2.js +19 -0
- package/dashboard/dist/assets/{DevicePage-BIBlmBPl.js → DevicePage-UVSutySl.js} +1 -1
- package/dashboard/dist/assets/{DialogTitle-BMKzpys0.js → DialogTitle-D0S8c1BO.js} +1 -1
- package/dashboard/dist/assets/{FadeIn-B5-cy4YN.js → FadeIn-anio8NgI.js} +1 -1
- package/dashboard/dist/assets/{HeaderGithubStar-BM-sbvJG.js → HeaderGithubStar-wRjA_Fvu.js} +1 -1
- package/dashboard/dist/assets/{IpCheckPage-C7-NXbFK.js → IpCheckPage-vl0aIVv0.js} +1 -1
- package/dashboard/dist/assets/{LandingPage-ouOFlABY.js → LandingPage-CJO4q92s.js} +1 -1
- package/dashboard/dist/assets/{LeaderboardAvatar-DMXPtCkx.js → LeaderboardAvatar-CjPVgiDo.js} +1 -1
- package/dashboard/dist/assets/{LeaderboardPage-CC4CFYAe.js → LeaderboardPage-DiQn0DqL.js} +3 -3
- package/dashboard/dist/assets/{LeaderboardProfileModal-D-ncIr24.js → LeaderboardProfileModal-yovVjgnB.js} +1 -1
- package/dashboard/dist/assets/{LeaderboardProfilePage-DtDMfVuQ.js → LeaderboardProfilePage-C0vqt4m5.js} +1 -1
- package/dashboard/dist/assets/{LimitsPage-qaD7Reti.js → LimitsPage-8o294HKr.js} +1 -1
- package/dashboard/dist/assets/{LocalOnlyNotice-BCy18fW4.js → LocalOnlyNotice-BQsPhRvE.js} +1 -1
- package/dashboard/dist/assets/{LoginPage-BLPY2ZI-.js → LoginPage-D8hQf3xT.js} +1 -1
- package/dashboard/dist/assets/{PopoverPopup-CpIlpO0j.js → PopoverPopup-rhSAh0x6.js} +1 -1
- package/dashboard/dist/assets/{Select-BOxMknxo.js → Select-ByLRQqzg.js} +1 -1
- package/dashboard/dist/assets/{SelectItemText-B0SL3Wb5.js → SelectItemText-CHHy8UA1.js} +1 -1
- package/dashboard/dist/assets/{SettingsPage-De7GbtPf.js → SettingsPage-DGyuX3ua.js} +1 -1
- package/dashboard/dist/assets/SkillsPage-CMsfSZar.js +1 -0
- package/dashboard/dist/assets/{WidgetsPage-BaEYiZZH.js → WidgetsPage-DavgYHA1.js} +1 -1
- package/dashboard/dist/assets/{WrappedPage-BYhKuiTb.js → WrappedPage-BARpWxxH.js} +1 -1
- package/dashboard/dist/assets/{agent-logos-DSQgCNll.js → agent-logos-BsEMlmFc.js} +1 -1
- package/dashboard/dist/assets/{arrow-up-right-Brwh94cN.js → arrow-up-right-Nh5NXsRd.js} +1 -1
- package/dashboard/dist/assets/{download-kFiot71R.js → download-Bz-ad2Zi.js} +1 -1
- package/dashboard/dist/assets/{info-CGx4zWQF.js → info-Edlzr0qR.js} +1 -1
- package/dashboard/dist/assets/main-BfK9LoKV.css +1 -0
- package/dashboard/dist/assets/{main-9Ze1SUIZ.js → main-CGYVeoRd.js} +2 -2
- package/dashboard/dist/assets/{use-limits-display-prefs-Ehri95OP.js → use-limits-display-prefs-Cc82ZSkQ.js} +1 -1
- package/dashboard/dist/assets/{use-native-settings-BWqG5RDr.js → use-native-settings-rTdpowec.js} +1 -1
- package/dashboard/dist/assets/{use-usage-limits-2ZxmPfoP.js → use-usage-limits-DFjNciSe.js} +1 -1
- package/dashboard/dist/assets/{useCurrency-DQmyhw3i.js → useCurrency-BY5HnhWy.js} +1 -1
- package/dashboard/dist/assets/{useScrollLock-BcLeWqWK.js → useScrollLock-oNpe5Ufe.js} +1 -1
- package/dashboard/dist/index.html +2 -2
- package/dashboard/dist/share.html +2 -2
- package/package.json +1 -1
- package/src/lib/local-api.js +31 -10
- package/src/lib/pricing/seed-snapshot.json +1 -1
- package/src/lib/skills-manager.js +134 -41
- package/dashboard/dist/assets/DashboardPage-CZkSRYE8.js +0 -19
- package/dashboard/dist/assets/SkillsPage-jpoYzUBQ.js +0 -1
- package/dashboard/dist/assets/main-DMJJVAOH.css +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/LimitsPage-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/LimitsPage-8o294HKr.js","assets/use-usage-limits-DFjNciSe.js","assets/use-limits-display-prefs-Cc82ZSkQ.js","assets/Card-hVCKEGdC.js","assets/FadeIn-anio8NgI.js","assets/LocalOnlyNotice-BQsPhRvE.js","assets/arrow-up-right-Nh5NXsRd.js","assets/download-Bz-ad2Zi.js","assets/LeaderboardPage-DiQn0DqL.js","assets/Select-ByLRQqzg.js","assets/SelectItemText-CHHy8UA1.js","assets/useScrollLock-oNpe5Ufe.js","assets/useCurrency-BY5HnhWy.js","assets/LeaderboardAvatar-CjPVgiDo.js","assets/DashboardPage-C3QvJSI2.js","assets/ActivityHeatmap-0IDxIr7i.js","assets/info-Edlzr0qR.js","assets/DialogTitle-D0S8c1BO.js","assets/agent-logos-BsEMlmFc.js","assets/PopoverPopup-rhSAh0x6.js","assets/LandingPage-CJO4q92s.js","assets/HeaderGithubStar-wRjA_Fvu.js","assets/LeaderboardProfilePage-C0vqt4m5.js","assets/LeaderboardProfileModal-yovVjgnB.js","assets/SettingsPage-DGyuX3ua.js","assets/use-native-settings-rTdpowec.js","assets/SkillsPage-CMsfSZar.js","assets/WidgetsPage-DavgYHA1.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
function $T(e,t){for(var n=0;n<t.length;n++){const a=t[n];if(typeof a!="string"&&!Array.isArray(a)){for(const i in a)if(i!=="default"&&!(i in e)){const s=Object.getOwnPropertyDescriptor(a,i);s&&Object.defineProperty(e,i,s.get?s:{enumerable:!0,get:()=>a[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))a(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const l of s.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&a(l)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function a(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();function Q0(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function HT(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function a(){var i=!1;try{i=this instanceof a}catch{}return i?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(a){var i=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(n,a,i.get?i:{enumerable:!0,get:function(){return e[a]}})}),n}var Sf={exports:{}},nl={},Cf={exports:{}},et={};var Ib;function WT(){if(Ib)return et;Ib=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),p=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 _={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,S={};function P(I,G,ye){this.props=I,this.context=G,this.refs=S,this.updater=ye||_}P.prototype.isReactComponent={},P.prototype.setState=function(I,G){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,G,"setState")},P.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function D(){}D.prototype=P.prototype;function R(I,G,ye){this.props=I,this.context=G,this.refs=S,this.updater=ye||_}var E=R.prototype=new D;E.constructor=R,w(E,P.prototype),E.isPureReactComponent=!0;var A=Array.isArray,U=Object.prototype.hasOwnProperty,z={current:null},j={key:!0,ref:!0,__self:!0,__source:!0};function C(I,G,ye){var me,pe={},ke=null,We=null;if(G!=null)for(me in G.ref!==void 0&&(We=G.ref),G.key!==void 0&&(ke=""+G.key),G)U.call(G,me)&&!j.hasOwnProperty(me)&&(pe[me]=G[me]);var Xe=arguments.length-2;if(Xe===1)pe.children=ye;else if(1<Xe){for(var Ue=Array(Xe),Dt=0;Dt<Xe;Dt++)Ue[Dt]=arguments[Dt+2];pe.children=Ue}if(I&&I.defaultProps)for(me in Xe=I.defaultProps,Xe)pe[me]===void 0&&(pe[me]=Xe[me]);return{$$typeof:e,type:I,key:ke,ref:We,props:pe,_owner:z.current}}function K(I,G){return{$$typeof:e,type:I.type,key:G,ref:I.ref,props:I.props,_owner:I._owner}}function Y(I){return typeof I=="object"&&I!==null&&I.$$typeof===e}function ce(I){var G={"=":"=0",":":"=2"};return"$"+I.replace(/[=:]/g,function(ye){return G[ye]})}var re=/\/+/g;function fe(I,G){return typeof I=="object"&&I!==null&&I.key!=null?ce(""+I.key):G.toString(36)}function de(I,G,ye,me,pe){var ke=typeof I;(ke==="undefined"||ke==="boolean")&&(I=null);var We=!1;if(I===null)We=!0;else switch(ke){case"string":case"number":We=!0;break;case"object":switch(I.$$typeof){case e:case t:We=!0}}if(We)return We=I,pe=pe(We),I=me===""?"."+fe(We,0):me,A(pe)?(ye="",I!=null&&(ye=I.replace(re,"$&/")+"/"),de(pe,G,ye,"",function(Dt){return Dt})):pe!=null&&(Y(pe)&&(pe=K(pe,ye+(!pe.key||We&&We.key===pe.key?"":(""+pe.key).replace(re,"$&/")+"/")+I)),G.push(pe)),1;if(We=0,me=me===""?".":me+":",A(I))for(var Xe=0;Xe<I.length;Xe++){ke=I[Xe];var Ue=me+fe(ke,Xe);We+=de(ke,G,ye,Ue,pe)}else if(Ue=v(I),typeof Ue=="function")for(I=Ue.call(I),Xe=0;!(ke=I.next()).done;)ke=ke.value,Ue=me+fe(ke,Xe++),We+=de(ke,G,ye,Ue,pe);else if(ke==="object")throw G=String(I),Error("Objects are not valid as a React child (found: "+(G==="[object Object]"?"object with keys {"+Object.keys(I).join(", ")+"}":G)+"). If you meant to render a collection of children, use an array instead.");return We}function he(I,G,ye){if(I==null)return I;var me=[],pe=0;return de(I,me,"","",function(ke){return G.call(ye,ke,pe++)}),me}function oe(I){if(I._status===-1){var G=I._result;G=G(),G.then(function(ye){(I._status===0||I._status===-1)&&(I._status=1,I._result=ye)},function(ye){(I._status===0||I._status===-1)&&(I._status=2,I._result=ye)}),I._status===-1&&(I._status=0,I._result=G)}if(I._status===1)return I._result.default;throw I._result}var X={current:null},Z={transition:null},Q={ReactCurrentDispatcher:X,ReactCurrentBatchConfig:Z,ReactCurrentOwner:z};function V(){throw Error("act(...) is not supported in production builds of React.")}return et.Children={map:he,forEach:function(I,G,ye){he(I,function(){G.apply(this,arguments)},ye)},count:function(I){var G=0;return he(I,function(){G++}),G},toArray:function(I){return he(I,function(G){return G})||[]},only:function(I){if(!Y(I))throw Error("React.Children.only expected to receive a single React element child.");return I}},et.Component=P,et.Fragment=n,et.Profiler=i,et.PureComponent=R,et.StrictMode=a,et.Suspense=h,et.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Q,et.act=V,et.cloneElement=function(I,G,ye){if(I==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+I+".");var me=w({},I.props),pe=I.key,ke=I.ref,We=I._owner;if(G!=null){if(G.ref!==void 0&&(ke=G.ref,We=z.current),G.key!==void 0&&(pe=""+G.key),I.type&&I.type.defaultProps)var Xe=I.type.defaultProps;for(Ue in G)U.call(G,Ue)&&!j.hasOwnProperty(Ue)&&(me[Ue]=G[Ue]===void 0&&Xe!==void 0?Xe[Ue]:G[Ue])}var Ue=arguments.length-2;if(Ue===1)me.children=ye;else if(1<Ue){Xe=Array(Ue);for(var Dt=0;Dt<Ue;Dt++)Xe[Dt]=arguments[Dt+2];me.children=Xe}return{$$typeof:e,type:I.type,key:pe,ref:ke,props:me,_owner:We}},et.createContext=function(I){return I={$$typeof:l,_currentValue:I,_currentValue2:I,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},I.Provider={$$typeof:s,_context:I},I.Consumer=I},et.createElement=C,et.createFactory=function(I){var G=C.bind(null,I);return G.type=I,G},et.createRef=function(){return{current:null}},et.forwardRef=function(I){return{$$typeof:u,render:I}},et.isValidElement=Y,et.lazy=function(I){return{$$typeof:p,_payload:{_status:-1,_result:I},_init:oe}},et.memo=function(I,G){return{$$typeof:f,type:I,compare:G===void 0?null:G}},et.startTransition=function(I){var G=Z.transition;Z.transition={};try{I()}finally{Z.transition=G}},et.unstable_act=V,et.useCallback=function(I,G){return X.current.useCallback(I,G)},et.useContext=function(I){return X.current.useContext(I)},et.useDebugValue=function(){},et.useDeferredValue=function(I){return X.current.useDeferredValue(I)},et.useEffect=function(I,G){return X.current.useEffect(I,G)},et.useId=function(){return X.current.useId()},et.useImperativeHandle=function(I,G,ye){return X.current.useImperativeHandle(I,G,ye)},et.useInsertionEffect=function(I,G){return X.current.useInsertionEffect(I,G)},et.useLayoutEffect=function(I,G){return X.current.useLayoutEffect(I,G)},et.useMemo=function(I,G){return X.current.useMemo(I,G)},et.useReducer=function(I,G,ye){return X.current.useReducer(I,G,ye)},et.useRef=function(I){return X.current.useRef(I)},et.useState=function(I){return X.current.useState(I)},et.useSyncExternalStore=function(I,G,ye){return X.current.useSyncExternalStore(I,G,ye)},et.useTransition=function(){return X.current.useTransition()},et.version="18.3.1",et}var Nb;function Bl(){return Nb||(Nb=1,Cf.exports=WT()),Cf.exports}var Ob;function GT(){if(Ob)return nl;Ob=1;var e=Bl(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function l(u,h,f){var p,g={},v=null,_=null;f!==void 0&&(v=""+f),h.key!==void 0&&(v=""+h.key),h.ref!==void 0&&(_=h.ref);for(p in h)a.call(h,p)&&!s.hasOwnProperty(p)&&(g[p]=h[p]);if(u&&u.defaultProps)for(p in h=u.defaultProps,h)g[p]===void 0&&(g[p]=h[p]);return{$$typeof:t,type:u,key:v,ref:_,props:g,_owner:i.current}}return nl.Fragment=n,nl.jsx=l,nl.jsxs=l,nl}var jb;function KT(){return jb||(jb=1,Sf.exports=GT()),Sf.exports}var T=KT(),b=Bl();const Xo=Q0(b),J0=$T({__proto__:null,default:Xo},[b]);var ru={},Tf={exports:{}},Ln={},Ef={exports:{}},Af={};var Ub;function qT(){return Ub||(Ub=1,(function(e){function t(Z,Q){var V=Z.length;Z.push(Q);e:for(;0<V;){var I=V-1>>>1,G=Z[I];if(0<i(G,Q))Z[I]=Q,Z[V]=G,V=I;else break e}}function n(Z){return Z.length===0?null:Z[0]}function a(Z){if(Z.length===0)return null;var Q=Z[0],V=Z.pop();if(V!==Q){Z[0]=V;e:for(var I=0,G=Z.length,ye=G>>>1;I<ye;){var me=2*(I+1)-1,pe=Z[me],ke=me+1,We=Z[ke];if(0>i(pe,V))ke<G&&0>i(We,pe)?(Z[I]=We,Z[ke]=V,I=ke):(Z[I]=pe,Z[me]=V,I=me);else if(ke<G&&0>i(We,V))Z[I]=We,Z[ke]=V,I=ke;else break e}}return Q}function i(Z,Q){var V=Z.sortIndex-Q.sortIndex;return V!==0?V:Z.id-Q.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var l=Date,u=l.now();e.unstable_now=function(){return l.now()-u}}var h=[],f=[],p=1,g=null,v=3,_=!1,w=!1,S=!1,P=typeof setTimeout=="function"?setTimeout:null,D=typeof clearTimeout=="function"?clearTimeout:null,R=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function E(Z){for(var Q=n(f);Q!==null;){if(Q.callback===null)a(f);else if(Q.startTime<=Z)a(f),Q.sortIndex=Q.expirationTime,t(h,Q);else break;Q=n(f)}}function A(Z){if(S=!1,E(Z),!w)if(n(h)!==null)w=!0,oe(U);else{var Q=n(f);Q!==null&&X(A,Q.startTime-Z)}}function U(Z,Q){w=!1,S&&(S=!1,D(C),C=-1),_=!0;var V=v;try{for(E(Q),g=n(h);g!==null&&(!(g.expirationTime>Q)||Z&&!ce());){var I=g.callback;if(typeof I=="function"){g.callback=null,v=g.priorityLevel;var G=I(g.expirationTime<=Q);Q=e.unstable_now(),typeof G=="function"?g.callback=G:g===n(h)&&a(h),E(Q)}else a(h);g=n(h)}if(g!==null)var ye=!0;else{var me=n(f);me!==null&&X(A,me.startTime-Q),ye=!1}return ye}finally{g=null,v=V,_=!1}}var z=!1,j=null,C=-1,K=5,Y=-1;function ce(){return!(e.unstable_now()-Y<K)}function re(){if(j!==null){var Z=e.unstable_now();Y=Z;var Q=!0;try{Q=j(!0,Z)}finally{Q?fe():(z=!1,j=null)}}else z=!1}var fe;if(typeof R=="function")fe=function(){R(re)};else if(typeof MessageChannel<"u"){var de=new MessageChannel,he=de.port2;de.port1.onmessage=re,fe=function(){he.postMessage(null)}}else fe=function(){P(re,0)};function oe(Z){j=Z,z||(z=!0,fe())}function X(Z,Q){C=P(function(){Z(e.unstable_now())},Q)}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(Z){Z.callback=null},e.unstable_continueExecution=function(){w||_||(w=!0,oe(U))},e.unstable_forceFrameRate=function(Z){0>Z||125<Z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):K=0<Z?Math.floor(1e3/Z):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_getFirstCallbackNode=function(){return n(h)},e.unstable_next=function(Z){switch(v){case 1:case 2:case 3:var Q=3;break;default:Q=v}var V=v;v=Q;try{return Z()}finally{v=V}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(Z,Q){switch(Z){case 1:case 2:case 3:case 4:case 5:break;default:Z=3}var V=v;v=Z;try{return Q()}finally{v=V}},e.unstable_scheduleCallback=function(Z,Q,V){var I=e.unstable_now();switch(typeof V=="object"&&V!==null?(V=V.delay,V=typeof V=="number"&&0<V?I+V:I):V=I,Z){case 1:var G=-1;break;case 2:G=250;break;case 5:G=1073741823;break;case 4:G=1e4;break;default:G=5e3}return G=V+G,Z={id:p++,callback:Q,priorityLevel:Z,startTime:V,expirationTime:G,sortIndex:-1},V>I?(Z.sortIndex=V,t(f,Z),n(h)===null&&Z===n(f)&&(S?(D(C),C=-1):S=!0,X(A,V-I))):(Z.sortIndex=G,t(h,Z),w||_||(w=!0,oe(U))),Z},e.unstable_shouldYield=ce,e.unstable_wrapCallback=function(Z){var Q=v;return function(){var V=v;v=Q;try{return Z.apply(this,arguments)}finally{v=V}}}})(Af)),Af}var Bb;function YT(){return Bb||(Bb=1,Ef.exports=qT()),Ef.exports}var Fb;function ZT(){if(Fb)return Ln;Fb=1;var e=Bl(),t=YT();function n(r){for(var o="https://reactjs.org/docs/error-decoder.html?invariant="+r,c=1;c<arguments.length;c++)o+="&args[]="+encodeURIComponent(arguments[c]);return"Minified React error #"+r+"; visit "+o+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var a=new Set,i={};function s(r,o){l(r,o),l(r+"Capture",o)}function l(r,o){for(i[r]=o,r=0;r<o.length;r++)a.add(o[r])}var u=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),h=Object.prototype.hasOwnProperty,f=/^[: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]*$/,p={},g={};function v(r){return h.call(g,r)?!0:h.call(p,r)?!1:f.test(r)?g[r]=!0:(p[r]=!0,!1)}function _(r,o,c,d){if(c!==null&&c.type===0)return!1;switch(typeof o){case"function":case"symbol":return!0;case"boolean":return d?!1:c!==null?!c.acceptsBooleans:(r=r.toLowerCase().slice(0,5),r!=="data-"&&r!=="aria-");default:return!1}}function w(r,o,c,d){if(o===null||typeof o>"u"||_(r,o,c,d))return!0;if(d)return!1;if(c!==null)switch(c.type){case 3:return!o;case 4:return o===!1;case 5:return isNaN(o);case 6:return isNaN(o)||1>o}return!1}function S(r,o,c,d,m,y,x){this.acceptsBooleans=o===2||o===3||o===4,this.attributeName=d,this.attributeNamespace=m,this.mustUseProperty=c,this.propertyName=r,this.type=o,this.sanitizeURL=y,this.removeEmptyString=x}var P={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(r){P[r]=new S(r,0,!1,r,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(r){var o=r[0];P[o]=new S(o,1,!1,r[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(r){P[r]=new S(r,2,!1,r.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(r){P[r]=new S(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){P[r]=new S(r,3,!1,r.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(r){P[r]=new S(r,3,!0,r,null,!1,!1)}),["capture","download"].forEach(function(r){P[r]=new S(r,4,!1,r,null,!1,!1)}),["cols","rows","size","span"].forEach(function(r){P[r]=new S(r,6,!1,r,null,!1,!1)}),["rowSpan","start"].forEach(function(r){P[r]=new S(r,5,!1,r.toLowerCase(),null,!1,!1)});var D=/[\-:]([a-z])/g;function R(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 o=r.replace(D,R);P[o]=new S(o,1,!1,r,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(r){var o=r.replace(D,R);P[o]=new S(o,1,!1,r,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(r){var o=r.replace(D,R);P[o]=new S(o,1,!1,r,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(r){P[r]=new S(r,1,!1,r.toLowerCase(),null,!1,!1)}),P.xlinkHref=new S("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(r){P[r]=new S(r,1,!1,r.toLowerCase(),null,!0,!0)});function E(r,o,c,d){var m=P.hasOwnProperty(o)?P[o]:null;(m!==null?m.type!==0:d||!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N")&&(w(o,c,m,d)&&(c=null),d||m===null?v(o)&&(c===null?r.removeAttribute(o):r.setAttribute(o,""+c)):m.mustUseProperty?r[m.propertyName]=c===null?m.type===3?!1:"":c:(o=m.attributeName,d=m.attributeNamespace,c===null?r.removeAttribute(o):(m=m.type,c=m===3||m===4&&c===!0?"":""+c,d?r.setAttributeNS(d,o,c):r.setAttribute(o,c))))}var A=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,U=Symbol.for("react.element"),z=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),K=Symbol.for("react.profiler"),Y=Symbol.for("react.provider"),ce=Symbol.for("react.context"),re=Symbol.for("react.forward_ref"),fe=Symbol.for("react.suspense"),de=Symbol.for("react.suspense_list"),he=Symbol.for("react.memo"),oe=Symbol.for("react.lazy"),X=Symbol.for("react.offscreen"),Z=Symbol.iterator;function Q(r){return r===null||typeof r!="object"?null:(r=Z&&r[Z]||r["@@iterator"],typeof r=="function"?r:null)}var V=Object.assign,I;function G(r){if(I===void 0)try{throw Error()}catch(c){var o=c.stack.trim().match(/\n( *(at )?)/);I=o&&o[1]||""}return`
|
|
3
3
|
`+I+r}var ye=!1;function me(r,o){if(!r||ye)return"";ye=!0;var c=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(o)if(o=function(){throw Error()},Object.defineProperty(o.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(o,[])}catch(q){var d=q}Reflect.construct(r,[],o)}else{try{o.call()}catch(q){d=q}r.call(o.prototype)}else{try{throw Error()}catch(q){d=q}r()}}catch(q){if(q&&d&&typeof q.stack=="string"){for(var m=q.stack.split(`
|
|
4
4
|
`),y=d.stack.split(`
|
|
@@ -992,4 +992,4 @@ skills.usage.disclaimer,ui,SkillsPage,SkillDetailPanel,usage_disclaimer,"Counts
|
|
|
992
992
|
${A}px !important;
|
|
993
993
|
${U}px !important;
|
|
994
994
|
}
|
|
995
|
-
`),()=>{u.current?.removeAttribute("data-motion-pop-id"),j.contains(z)&&j.removeChild(z)}},[t]),T.jsx(IO,{isPresent:t,childRef:u,sizeRef:h,pop:s,children:s===!1?e:b.cloneElement(e,{ref:g})})}const OO=({children:e,initial:t,isPresent:n,onExitComplete:a,custom:i,presenceAffectsLayout:s,mode:l,anchorX:u,anchorY:h,root:f})=>{const p=vg(jO),g=b.useId();let v=!0,_=b.useMemo(()=>(v=!1,{id:g,initial:t,isPresent:n,custom:i,onExitComplete:w=>{p.set(w,!0);for(const S of p.values())if(!S)return;a&&a()},register:w=>(p.set(w,!1),()=>p.delete(w))}),[n,p,a]);return s&&v&&(_={..._}),b.useMemo(()=>{p.forEach((w,S)=>p.set(S,!1))},[n]),b.useEffect(()=>{!n&&!p.size&&a&&a()},[n]),e=T.jsx(NO,{pop:l==="popLayout",isPresent:n,anchorX:u,anchorY:h,root:f,children:e}),T.jsx(Bd.Provider,{value:_,children:e})};function jO(){return new Map}function BP(e=!0){const t=b.useContext(Bd);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:a,register:i}=t,s=b.useId();b.useEffect(()=>{if(e)return i(s)},[e]);const l=b.useCallback(()=>e&&a&&a(s),[s,a,e]);return!n&&a?[!1,l]:[!0]}const pu=e=>e.key||"";function o0(e){const t=[];return b.Children.forEach(e,n=>{b.isValidElement(n)&&t.push(n)}),t}const FP=({children:e,custom:t,initial:n=!0,onExitComplete:a,presenceAffectsLayout:i=!0,mode:s="sync",propagate:l=!1,anchorX:u="left",anchorY:h="top",root:f})=>{const[p,g]=BP(l),v=b.useMemo(()=>o0(e),[e]),_=l&&!p?[]:v.map(pu),w=b.useRef(!0),S=b.useRef(v),P=vg(()=>new Map),D=b.useRef(new Set),[R,E]=b.useState(v),[A,U]=b.useState(v);f1(()=>{w.current=!1,S.current=v;for(let C=0;C<A.length;C++){const K=pu(A[C]);_.includes(K)?(P.delete(K),D.current.delete(K)):P.get(K)!==!0&&P.set(K,!1)}},[A,_.length,_.join("-")]);const z=[];if(v!==R){let C=[...v];for(let K=0;K<A.length;K++){const Y=A[K],ce=pu(Y);_.includes(ce)||(C.splice(K,0,Y),z.push(Y))}return s==="wait"&&z.length&&(C=z),U(o0(C)),E(v),null}const{forceRender:j}=b.useContext(yg);return T.jsx(T.Fragment,{children:A.map(C=>{const K=pu(C),Y=l&&!p?!1:v===A||_.includes(K),ce=()=>{if(D.current.has(K))return;if(P.has(K))D.current.add(K),P.set(K,!0);else return;let re=!0;P.forEach(fe=>{fe||(re=!1)}),re&&(j?.(),U(S.current),l&&g?.(),a&&a())};return T.jsx(OO,{isPresent:Y,initial:!w.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:s,root:f,onExitComplete:Y?void 0:ce,anchorX:u,anchorY:h,children:C},K)})})},zP=b.createContext({strict:!1}),s0={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let l0=!1;function UO(){if(l0)return;const e={};for(const t in s0)e[t]={isEnabled:n=>s0[t].some(a=>!!n[a])};mP(e),l0=!0}function VP(){return UO(),wN()}function BO(e){const t=VP();for(const n in e)t[n]={...t[n],...e[n]};mP(t)}const FO=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function wd(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||FO.has(e)}let $P=e=>!wd(e);function zO(e){typeof e=="function"&&($P=t=>t.startsWith("on")?!wd(t):e(t))}try{zO(require("@emotion/is-prop-valid").default)}catch{}function VO(e,t,n){const a={};for(const i in e)i==="values"&&typeof e.values=="object"||nn(e[i])||($P(i)||n===!0&&wd(i)||!t&&!wd(i)||e.draggable&&i.startsWith("onDrag"))&&(a[i]=e[i]);return a}const $d=b.createContext({});function $O(e,t){if(Vd(e)){const{initial:n,animate:a}=e;return{initial:n===!1||Ol(n)?n:void 0,animate:Ol(a)?a:void 0}}return e.inherit!==!1?t:{}}function HO(e){const{initial:t,animate:n}=$O(e,b.useContext($d));return b.useMemo(()=>({initial:t,animate:n}),[c0(t),c0(n)])}function c0(e){return Array.isArray(e)?e.join(" "):e}const Hg=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function HP(e,t,n){for(const a in t)!nn(t[a])&&!wP(a,n)&&(e[a]=t[a])}function WO({transformTemplate:e},t){return b.useMemo(()=>{const n=Hg();return zg(n,t,e),Object.assign({},n.vars,n.style)},[t])}function GO(e,t){const n=e.style||{},a={};return HP(a,n,e),Object.assign(a,WO(e,t)),a}function KO(e,t){const n={},a=GO(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,a.userSelect=a.WebkitUserSelect=a.WebkitTouchCallout="none",a.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=a,n}const WP=()=>({...Hg(),attrs:{}});function qO(e,t,n,a){const i=b.useMemo(()=>{const s=WP();return xP(s,t,SP(a),e.transformTemplate,e.style),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};HP(s,e.style,e),i.style={...s,...i.style}}return i}const YO=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Wg(e){return typeof e!="string"||e.includes("-")?!1:!!(YO.indexOf(e)>-1||/[A-Z]/u.test(e))}function ZO(e,t,n,{latestValues:a},i,s=!1,l){const h=(l??Wg(e)?qO:KO)(t,a,i,e),f=VO(t,typeof e=="string",s),p=e!==b.Fragment?{...f,...h,ref:n}:{},{children:g}=t,v=b.useMemo(()=>nn(g)?g.get():g,[g]);return b.createElement(e,{...p,children:v})}function XO({scrapeMotionValuesFromProps:e,createRenderState:t},n,a,i){return{latestValues:QO(n,a,i,e),renderState:t()}}function QO(e,t,n,a){const i={},s=a(e,{});for(const v in s)i[v]=Hu(s[v]);let{initial:l,animate:u}=e;const h=Vd(e),f=fP(e);t&&f&&!h&&e.inherit!==!1&&(l===void 0&&(l=t.initial),u===void 0&&(u=t.animate));let p=n?n.initial===!1:!1;p=p||l===!1;const g=p?u:l;if(g&&typeof g!="boolean"&&!zd(g)){const v=Array.isArray(g)?g:[g];for(let _=0;_<v.length;_++){const w=Mg(e,v[_]);if(w){const{transitionEnd:S,transition:P,...D}=w;for(const R in D){let E=D[R];if(Array.isArray(E)){const A=p?E.length-1:0;E=E[A]}E!==null&&(i[R]=E)}for(const R in S)i[R]=S[R]}}}return i}const GP=e=>(t,n)=>{const a=b.useContext($d),i=b.useContext(Bd),s=()=>XO(e,t,a,i);return n?s():vg(s)},JO=GP({scrapeMotionValuesFromProps:Vg,createRenderState:Hg}),e6=GP({scrapeMotionValuesFromProps:CP,createRenderState:WP}),t6=Symbol.for("motionComponentSymbol");function n6(e,t,n){const a=b.useRef(n);b.useInsertionEffect(()=>{a.current=n});const i=b.useRef(null);return b.useCallback(s=>{s&&e.onMount?.(s),t&&(s?t.mount(s):t.unmount());const l=a.current;if(typeof l=="function")if(s){const u=l(s);typeof u=="function"&&(i.current=u)}else i.current?(i.current(),i.current=null):l(s);else l&&(l.current=s)},[t])}const KP=b.createContext({});function Vo(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function a6(e,t,n,a,i,s){const{visualElement:l}=b.useContext($d),u=b.useContext(zP),h=b.useContext(Bd),f=b.useContext($g),p=f.reducedMotion,g=f.skipAnimations,v=b.useRef(null),_=b.useRef(!1);a=a||u.renderer,!v.current&&a&&(v.current=a(e,{visualState:t,parent:l,props:n,presenceContext:h,blockInitialAnimation:h?h.initial===!1:!1,reducedMotionConfig:p,skipAnimations:g,isSVG:s}),_.current&&v.current&&(v.current.manuallyAnimateOnMount=!0));const w=v.current,S=b.useContext(KP);w&&!w.projection&&i&&(w.type==="html"||w.type==="svg")&&r6(v.current,n,i,S);const P=b.useRef(!1);b.useInsertionEffect(()=>{w&&P.current&&w.update(n,h)});const D=n[tP],R=b.useRef(!!D&&typeof window<"u"&&!window.MotionHandoffIsComplete?.(D)&&window.MotionHasOptimisedAnimation?.(D));return f1(()=>{_.current=!0,w&&(P.current=!0,window.MotionIsMounted=!0,w.updateFeatures(),w.scheduleRenderMicrotask(),R.current&&w.animationState&&w.animationState.animateChanges())}),b.useEffect(()=>{w&&(!R.current&&w.animationState&&w.animationState.animateChanges(),R.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(D)}),R.current=!1),w.enteringChildren=void 0)}),w}function r6(e,t,n,a){const{layoutId:i,layout:s,drag:l,dragConstraints:u,layoutScroll:h,layoutRoot:f,layoutAnchor:p,layoutCrossfade:g}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:qP(e.parent)),e.projection.setOptions({layoutId:i,layout:s,alwaysMeasureLayout:!!l||u&&Vo(u),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:a,crossfade:g,layoutScroll:h,layoutRoot:f,layoutAnchor:p})}function qP(e){if(e)return e.options.allowProjection!==!1?e.projection:qP(e.parent)}function ap(e,{forwardMotionProps:t=!1,type:n}={},a,i){a&&BO(a);const s=n?n==="svg":Wg(e),l=s?e6:JO;function u(f,p){let g;const v={...b.useContext($g),...f,layoutId:i6(f)},{isStatic:_}=v,w=HO(f),S=l(f,_);if(!_&&typeof window<"u"){o6();const P=s6(v);g=P.MeasureLayout,w.visualElement=a6(e,S,v,i,P.ProjectionNode,s)}return T.jsxs($d.Provider,{value:w,children:[g&&w.visualElement?T.jsx(g,{visualElement:w.visualElement,...v}):null,ZO(e,f,n6(S,w.visualElement,p),S,_,t,s)]})}u.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const h=b.forwardRef(u);return h[t6]=e,h}function i6({layoutId:e}){const t=b.useContext(yg).id;return t&&e!==void 0?t+"-"+e:e}function o6(e,t){b.useContext(zP).strict}function s6(e){const t=VP(),{drag:n,layout:a}=t;if(!n&&!a)return{};const i={...n,...a};return{MeasureLayout:n?.isEnabled(e)||a?.isEnabled(e)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}function l6(e,t){if(typeof Proxy>"u")return ap;const n=new Map,a=(s,l)=>ap(s,l,e,t),i=(s,l)=>a(s,l);return new Proxy(i,{get:(s,l)=>l==="create"?a:(n.has(l)||n.set(l,ap(l,void 0,e,t)),n.get(l))})}const c6=(e,t)=>t.isSVG??Wg(e)?new BN(t):new MN(t,{allowProjection:e!==b.Fragment});class u6 extends ui{constructor(t){super(t),t.animationState||(t.animationState=HN(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();zd(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let d6=0;class h6 extends ui{constructor(){super(...arguments),this.id=d6++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:a}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===a)return;if(t&&a===!1){if(this.isExitComplete){const{initial:s,custom:l}=this.node.getProps();if(typeof s=="string"||typeof s=="object"&&s!==null&&!Array.isArray(s)){const u=Hi(this.node,s,l);if(u){const{transition:h,transitionEnd:f,...p}=u;for(const g in p)this.node.getValue(g)?.jump(p[g])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const i=this.node.animationState.setActive("exit",!t);n&&!t&&i.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const f6={animation:{Feature:u6},exit:{Feature:h6}};function Ql(e){return{point:{x:e.pageX,y:e.pageY}}}const p6=e=>t=>Og(t)&&e(t,Ql(t));function Sl(e,t,n,a){return jl(e,t,p6(n),a)}const YP=({current:e})=>e?e.ownerDocument.defaultView:null,u0=(e,t)=>Math.abs(e-t);function m6(e,t){const n=u0(e.x,t.x),a=u0(e.y,t.y);return Math.sqrt(n**2+a**2)}const d0=new Set(["auto","scroll"]);class ZP{constructor(t,n,{transformPagePoint:a,contextWindow:i=window,dragSnapToOrigin:s=!1,distanceThreshold:l=3,element:u}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=_=>{this.handleScroll(_.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=mu(this.lastRawMoveEventInfo,this.transformPagePoint));const _=rp(this.lastMoveEventInfo,this.history),w=this.startEvent!==null,S=m6(_.offset,{x:0,y:0})>=this.distanceThreshold;if(!w&&!S)return;const{point:P}=_,{timestamp:D}=tn;this.history.push({...P,timestamp:D});const{onStart:R,onMove:E}=this.handlers;w||(R&&R(this.lastMoveEvent,_),this.startEvent=this.lastMoveEvent),E&&E(this.lastMoveEvent,_)},this.handlePointerMove=(_,w)=>{this.lastMoveEvent=_,this.lastRawMoveEventInfo=w,this.lastMoveEventInfo=mu(w,this.transformPagePoint),vt.update(this.updatePoint,!0)},this.handlePointerUp=(_,w)=>{this.end();const{onEnd:S,onSessionEnd:P,resumeAnimation:D}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&D&&D(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const R=rp(_.type==="pointercancel"?this.lastMoveEventInfo:mu(w,this.transformPagePoint),this.history);this.startEvent&&S&&S(_,R),P&&P(_,R)},!Og(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=a,this.distanceThreshold=l,this.contextWindow=i||window;const h=Ql(t),f=mu(h,this.transformPagePoint),{point:p}=f,{timestamp:g}=tn;this.history=[{...p,timestamp:g}];const{onSessionStart:v}=n;v&&v(t,rp(f,this.history)),this.removeListeners=Yl(Sl(this.contextWindow,"pointermove",this.handlePointerMove),Sl(this.contextWindow,"pointerup",this.handlePointerUp),Sl(this.contextWindow,"pointercancel",this.handlePointerUp)),u&&this.startScrollTracking(u)}startScrollTracking(t){let n=t.parentElement;for(;n;){const a=getComputedStyle(n);(d0.has(a.overflowX)||d0.has(a.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const n=this.scrollPositions.get(t);if(!n)return;const a=t===window,i=a?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},s={x:i.x-n.x,y:i.y-n.y};s.x===0&&s.y===0||(a?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=s.x,this.lastMoveEventInfo.point.y+=s.y):this.history.length>0&&(this.history[0].x-=s.x,this.history[0].y-=s.y),this.scrollPositions.set(t,i),vt.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),li(this.updatePoint)}}function mu(e,t){return t?{point:t(e.point)}:e}function h0(e,t){return{x:e.x-t.x,y:e.y-t.y}}function rp({point:e},t){return{point:e,delta:h0(e,XP(t)),offset:h0(e,g6(t)),velocity:y6(t,.1)}}function g6(e){return e[0]}function XP(e){return e[e.length-1]}function y6(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,a=null;const i=XP(e);for(;n>=0&&(a=e[n],!(i.timestamp-a.timestamp>Wn(t)));)n--;if(!a)return{x:0,y:0};a===e[0]&&e.length>2&&i.timestamp-a.timestamp>Wn(t)*2&&(a=e[1]);const s=aa(i.timestamp-a.timestamp);if(s===0)return{x:0,y:0};const l={x:(i.x-a.x)/s,y:(i.y-a.y)/s};return l.x===1/0&&(l.x=0),l.y===1/0&&(l.y=0),l}function v6(e,{min:t,max:n},a){return t!==void 0&&e<t?e=a?yt(t,e,a.min):Math.max(e,t):n!==void 0&&e>n&&(e=a?yt(n,e,a.max):Math.min(e,n)),e}function f0(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function b6(e,{top:t,left:n,bottom:a,right:i}){return{x:f0(e.x,n,i),y:f0(e.y,t,a)}}function p0(e,t){let n=t.min-e.min,a=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,a]=[a,n]),{min:n,max:a}}function k6(e,t){return{x:p0(e.x,t.x),y:p0(e.y,t.y)}}function _6(e,t){let n=.5;const a=kn(e),i=kn(t);return i>a?n=Il(t.min,t.max-a,e.min):a>i&&(n=Il(e.min,e.max-i,t.min)),tr(0,1,n)}function w6(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const vm=.35;function x6(e=vm){return e===!1?e=0:e===!0&&(e=vm),{x:m0(e,"left","right"),y:m0(e,"top","bottom")}}function m0(e,t,n){return{min:g0(e,t),max:g0(e,n)}}function g0(e,t){return typeof e=="number"?e:e[t]||0}const P6=new WeakMap;class S6{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Kt(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:a}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const s=g=>{n&&this.snapToCursor(Ql(g).point),this.stopAnimation()},l=(g,v)=>{const{drag:_,dragPropagation:w,onDragStart:S}=this.getProps();if(_&&!w&&(this.openDragLock&&this.openDragLock(),this.openDragLock=J5(_),!this.openDragLock))return;this.latestPointerEvent=g,this.latestPanInfo=v,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Ha(D=>{let R=this.getAxisMotionValue(D).get()||0;if(Ya.test(R)){const{projection:E}=this.visualElement;if(E&&E.layout){const A=E.layout.layoutBox[D];A&&(R=kn(A)*(parseFloat(R)/100))}}this.originPoint[D]=R}),S&&vt.update(()=>S(g,v),!1,!0),cm(this.visualElement,"transform");const{animationState:P}=this.visualElement;P&&P.setActive("whileDrag",!0)},u=(g,v)=>{this.latestPointerEvent=g,this.latestPanInfo=v;const{dragPropagation:_,dragDirectionLock:w,onDirectionLock:S,onDrag:P}=this.getProps();if(!_&&!this.openDragLock)return;const{offset:D}=v;if(w&&this.currentDirection===null){this.currentDirection=T6(D),this.currentDirection!==null&&S&&S(this.currentDirection);return}this.updateAxis("x",v.point,D),this.updateAxis("y",v.point,D),this.visualElement.render(),P&&vt.update(()=>P(g,v),!1,!0)},h=(g,v)=>{this.latestPointerEvent=g,this.latestPanInfo=v,this.stop(g,v),this.latestPointerEvent=null,this.latestPanInfo=null},f=()=>{const{dragSnapToOrigin:g}=this.getProps();(g||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:p}=this.getProps();this.panSession=new ZP(t,{onSessionStart:s,onStart:l,onMove:u,onSessionEnd:h,resumeAnimation:f},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:p,distanceThreshold:a,contextWindow:YP(this.visualElement),element:this.visualElement.current})}stop(t,n){const a=t||this.latestPointerEvent,i=n||this.latestPanInfo,s=this.isDragging;if(this.cancel(),!s||!i||!a)return;const{velocity:l}=i;this.startAnimation(l);const{onDragEnd:u}=this.getProps();u&&vt.postRender(()=>u(a,i))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:a}=this.getProps();!a&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,n,a){const{drag:i}=this.getProps();if(!a||!gu(t,i,this.currentDirection))return;const s=this.getAxisMotionValue(t);let l=this.originPoint[t]+a[t];this.constraints&&this.constraints[t]&&(l=v6(l,this.constraints[t],this.elastic[t])),s.set(l)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),a=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,i=this.constraints;t&&Vo(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&a?this.constraints=b6(a.layoutBox,t):this.constraints=!1,this.elastic=x6(n),i!==this.constraints&&!Vo(t)&&a&&this.constraints&&!this.hasMutatedConstraints&&Ha(s=>{this.constraints!==!1&&this.getAxisMotionValue(s)&&(this.constraints[s]=w6(a.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Vo(t))return!1;const a=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;i.root&&(i.root.scroll=void 0,i.root.updateScroll());const s=TN(a,i.root,this.visualElement.getTransformPagePoint());let l=k6(i.layout.layoutBox,s);if(n){const u=n(PN(l));this.hasMutatedConstraints=!!u,u&&(l=yP(u))}return l}startAnimation(t){const{drag:n,dragMomentum:a,dragElastic:i,dragTransition:s,dragSnapToOrigin:l,onDragTransitionEnd:u}=this.getProps(),h=this.constraints||{},f=Ha(p=>{if(!gu(p,n,this.currentDirection))return;let g=h&&h[p]||{};(l===!0||l===p)&&(g={min:0,max:0});const v=i?200:1e6,_=i?40:1e7,w={type:"inertia",velocity:a?t[p]:0,bounceStiffness:v,bounceDamping:_,timeConstant:750,restDelta:1,restSpeed:10,...s,...g};return this.startAxisValueAnimation(p,w)});return Promise.all(f).then(u)}startAxisValueAnimation(t,n){const a=this.getAxisMotionValue(t);return cm(this.visualElement,t),a.start(Dg(t,a,0,n,this.visualElement,!1))}stopAnimation(){Ha(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,i=this.visualElement.getProps()[n];return i||this.visualElement.getValue(t,this.visualElement.latestValues[t]??0)}snapToCursor(t){Ha(n=>{const{drag:a}=this.getProps();if(!gu(n,a,this.currentDirection))return;const{projection:i}=this.visualElement,s=this.getAxisMotionValue(n);if(i&&i.layout){const{min:l,max:u}=i.layout.layoutBox[n],h=s.get()||0;s.set(t[n]-yt(l,u,.5)+h)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:a}=this.visualElement;if(!Vo(n)||!a||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Ha(l=>{const u=this.getAxisMotionValue(l);if(u&&this.constraints!==!1){const h=u.get();i[l]=_6({min:h,max:h},this.constraints[l])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",a.root&&a.root.updateScroll(),a.updateLayout(),this.constraints=!1,this.resolveConstraints(),Ha(l=>{if(!gu(l,t,null))return;const u=this.getAxisMotionValue(l),{min:h,max:f}=this.constraints[l];u.set(yt(h,f,i[l]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;P6.set(this.visualElement,this);const t=this.visualElement.current,n=Sl(t,"pointerdown",f=>{const{drag:p,dragListener:g=!0}=this.getProps(),v=f.target,_=v!==t&&iN(v);p&&g&&!_&&this.start(f)});let a;const i=()=>{const{dragConstraints:f}=this.getProps();Vo(f)&&f.current&&(this.constraints=this.resolveRefConstraints(),a||(a=C6(t,f.current,()=>this.scalePositionWithinConstraints())))},{projection:s}=this.visualElement,l=s.addEventListener("measure",i);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),vt.read(i);const u=jl(window,"resize",()=>this.scalePositionWithinConstraints()),h=s.addEventListener("didUpdate",(({delta:f,hasLayoutChanged:p})=>{this.isDragging&&p&&(Ha(g=>{const v=this.getAxisMotionValue(g);v&&(this.originPoint[g]+=f[g].translate,v.set(v.get()+f[g].translate))}),this.visualElement.render())}));return()=>{u(),n(),l(),h&&h(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:a=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:l=vm,dragMomentum:u=!0}=t;return{...t,drag:n,dragDirectionLock:a,dragPropagation:i,dragConstraints:s,dragElastic:l,dragMomentum:u}}}function y0(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function C6(e,t,n){const a=P_(e,y0(n)),i=P_(t,y0(n));return()=>{a(),i()}}function gu(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function T6(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class E6 extends ui{constructor(t){super(t),this.removeGroupControls=ia,this.removeListeners=ia,this.controls=new S6(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ia}update(){const{dragControls:t}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};t!==n&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const ip=e=>(t,n)=>{e&&vt.update(()=>e(t,n),!1,!0)};class A6 extends ui{constructor(){super(...arguments),this.removePointerDownListener=ia}onPointerDown(t){this.session=new ZP(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:YP(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:a,onPanEnd:i}=this.node.getProps();return{onSessionStart:ip(t),onStart:ip(n),onMove:ip(a),onEnd:(s,l)=>{delete this.session,i&&vt.postRender(()=>i(s,l))}}}mount(){this.removePointerDownListener=Sl(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let op=!1;class R6 extends b.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:a,layoutId:i}=this.props,{projection:s}=t;s&&(n.group&&n.group.add(s),a&&a.register&&i&&a.register(s),op&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Wu.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:a,drag:i,isPresent:s}=this.props,{projection:l}=a;return l&&(l.isPresent=s,t.layoutDependency!==n&&l.setOptions({...l.options,layoutDependency:n}),op=!0,i||t.layoutDependency!==n||n===void 0||t.isPresent!==s?l.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?l.promote():l.relegate()||vt.postRender(()=>{const u=l.getStack();(!u||!u.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:t,layoutAnchor:n}=this.props,{projection:a}=t;a&&(a.options.layoutAnchor=n,a.root.didUpdate(),Ng.postRender(()=>{!a.currentAnimation&&a.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:a}=this.props,{projection:i}=t;op=!0,i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),a&&a.deregister&&a.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function QP(e){const[t,n]=BP(),a=b.useContext(yg);return T.jsx(R6,{...e,layoutGroup:a,switchLayoutGroup:b.useContext(KP),isPresent:t,safeToRemove:n})}const L6={pan:{Feature:A6},drag:{Feature:E6,ProjectionNode:UP,MeasureLayout:QP}};function v0(e,t,n){const{props:a}=e;e.animationState&&a.whileHover&&e.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,s=a[i];s&&vt.postRender(()=>s(t,Ql(t)))}class D6 extends ui{mount(){const{current:t}=this.node;t&&(this.unmount=tN(t,(n,a)=>(v0(this.node,a,"Start"),i=>v0(this.node,i,"End"))))}unmount(){}}class M6 extends ui{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Yl(jl(this.node.current,"focus",()=>this.onFocus()),jl(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function b0(e,t,n){const{props:a}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&a.whileTap&&e.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),s=a[i];s&&vt.postRender(()=>s(t,Ql(t)))}class I6 extends ui{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:a}=this.node.props;this.unmount=sN(t,(i,s)=>(b0(this.node,s,"Start"),(l,{success:u})=>b0(this.node,l,u?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:a?.tap===!1})}unmount(){}}const bm=new WeakMap,sp=new WeakMap,N6=e=>{const t=bm.get(e.target);t&&t(e)},O6=e=>{e.forEach(N6)};function j6({root:e,...t}){const n=e||document;sp.has(n)||sp.set(n,{});const a=sp.get(n),i=JSON.stringify(t);return a[i]||(a[i]=new IntersectionObserver(O6,{root:e,...t})),a[i]}function U6(e,t,n){const a=j6(t);return bm.set(e,n),a.observe(e),()=>{bm.delete(e),a.unobserve(e)}}const B6={some:0,all:1};class F6 extends ui{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();const{viewport:t={}}=this.node.getProps(),{root:n,margin:a,amount:i="some",once:s}=t,l={root:n?n.current:void 0,rootMargin:a,threshold:typeof i=="number"?i:B6[i]},u=h=>{const{isIntersecting:f}=h;if(this.isInView===f||(this.isInView=f,s&&!f&&this.hasEnteredView))return;f&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",f);const{onViewportEnter:p,onViewportLeave:g}=this.node.getProps(),v=f?p:g;v&&v(h)};this.stopObserver=U6(this.node.current,l,u)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(z6(t,n))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}function z6({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const V6={inView:{Feature:F6},tap:{Feature:I6},focus:{Feature:M6},hover:{Feature:D6}},$6={layout:{ProjectionNode:UP,MeasureLayout:QP}},H6={...f6,...V6,...L6,...$6},Cl=l6(H6,c6);function W6(){!Fg.current&&pP();const[e]=b.useState(vd.current);return e}function JP(e){var t,n,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=JP(e[t]))&&(a&&(a+=" "),a+=n)}else for(n in e)e[n]&&(a&&(a+=" "),a+=n);return a}function G6(){for(var e,t,n=0,a="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=JP(e))&&(a&&(a+=" "),a+=t);return a}const K6=(e,t)=>{const n=new Array(e.length+t.length);for(let a=0;a<e.length;a++)n[a]=e[a];for(let a=0;a<t.length;a++)n[e.length+a]=t[a];return n},q6=(e,t)=>({classGroupId:e,validator:t}),eS=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),xd="-",k0=[],Y6="arbitrary..",Z6=e=>{const t=Q6(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return X6(l);const u=l.split(xd),h=u[0]===""&&u.length>1?1:0;return tS(u,h,t)},getConflictingClassGroupIds:(l,u)=>{if(u){const h=a[l],f=n[l];return h?f?K6(f,h):h:f||k0}return n[l]||k0}}},tS=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const i=e[t],s=n.nextPart.get(i);if(s){const f=tS(e,t+1,s);if(f)return f}const l=n.validators;if(l===null)return;const u=t===0?e.join(xd):e.slice(t).join(xd),h=l.length;for(let f=0;f<h;f++){const p=l[f];if(p.validator(u))return p.classGroupId}},X6=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),a=t.slice(0,n);return a?Y6+a:void 0})(),Q6=e=>{const{theme:t,classGroups:n}=e;return J6(n,t)},J6=(e,t)=>{const n=eS();for(const a in e){const i=e[a];Gg(i,n,a,t)}return n},Gg=(e,t,n,a)=>{const i=e.length;for(let s=0;s<i;s++){const l=e[s];ej(l,t,n,a)}},ej=(e,t,n,a)=>{if(typeof e=="string"){tj(e,t,n);return}if(typeof e=="function"){nj(e,t,n,a);return}aj(e,t,n,a)},tj=(e,t,n)=>{const a=e===""?t:nS(t,e);a.classGroupId=n},nj=(e,t,n,a)=>{if(rj(e)){Gg(e(a),t,n,a);return}t.validators===null&&(t.validators=[]),t.validators.push(q6(n,e))},aj=(e,t,n,a)=>{const i=Object.entries(e),s=i.length;for(let l=0;l<s;l++){const[u,h]=i[l];Gg(h,nS(t,u),n,a)}},nS=(e,t)=>{let n=e;const a=t.split(xd),i=a.length;for(let s=0;s<i;s++){const l=a[s];let u=n.nextPart.get(l);u||(u=eS(),n.nextPart.set(l,u)),n=u}return n},rj=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,ij=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),a=Object.create(null);const i=(s,l)=>{n[s]=l,t++,t>e&&(t=0,a=n,n=Object.create(null))};return{get(s){let l=n[s];if(l!==void 0)return l;if((l=a[s])!==void 0)return i(s,l),l},set(s,l){s in n?n[s]=l:i(s,l)}}},km="!",_0=":",oj=[],w0=(e,t,n,a,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:a,isExternal:i}),sj=e=>{const{prefix:t,experimentalParseClassName:n}=e;let a=i=>{const s=[];let l=0,u=0,h=0,f;const p=i.length;for(let S=0;S<p;S++){const P=i[S];if(l===0&&u===0){if(P===_0){s.push(i.slice(h,S)),h=S+1;continue}if(P==="/"){f=S;continue}}P==="["?l++:P==="]"?l--:P==="("?u++:P===")"&&u--}const g=s.length===0?i:i.slice(h);let v=g,_=!1;g.endsWith(km)?(v=g.slice(0,-1),_=!0):g.startsWith(km)&&(v=g.slice(1),_=!0);const w=f&&f>h?f-h:void 0;return w0(s,_,v,w)};if(t){const i=t+_0,s=a;a=l=>l.startsWith(i)?s(l.slice(i.length)):w0(oj,!1,l,void 0,!0)}if(n){const i=a;a=s=>n({className:s,parseClassName:i})}return a},lj=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,a)=>{t.set(n,1e6+a)}),n=>{const a=[];let i=[];for(let s=0;s<n.length;s++){const l=n[s],u=l[0]==="[",h=t.has(l);u||h?(i.length>0&&(i.sort(),a.push(...i),i=[]),a.push(l)):i.push(l)}return i.length>0&&(i.sort(),a.push(...i)),a}},cj=e=>({cache:ij(e.cacheSize),parseClassName:sj(e),sortModifiers:lj(e),postfixLookupClassGroupIds:uj(e),...Z6(e)}),uj=e=>{const t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let a=0;a<n.length;a++)t[n[a]]=!0;return t},dj=/\s+/,hj=(e,t)=>{const{parseClassName:n,getClassGroupId:a,getConflictingClassGroupIds:i,sortModifiers:s,postfixLookupClassGroupIds:l}=t,u=[],h=e.trim().split(dj);let f="";for(let p=h.length-1;p>=0;p-=1){const g=h[p],{isExternal:v,modifiers:_,hasImportantModifier:w,baseClassName:S,maybePostfixModifierPosition:P}=n(g);if(v){f=g+(f.length>0?" "+f:f);continue}let D=!!P,R;if(D){const j=S.substring(0,P);R=a(j);const C=R&&l[R]?a(S):void 0;C&&C!==R&&(R=C,D=!1)}else R=a(S);if(!R){if(!D){f=g+(f.length>0?" "+f:f);continue}if(R=a(S),!R){f=g+(f.length>0?" "+f:f);continue}D=!1}const E=_.length===0?"":_.length===1?_[0]:s(_).join(":"),A=w?E+km:E,U=A+R;if(u.indexOf(U)>-1)continue;u.push(U);const z=i(R,D);for(let j=0;j<z.length;++j){const C=z[j];u.push(A+C)}f=g+(f.length>0?" "+f:f)}return f},fj=(...e)=>{let t=0,n,a,i="";for(;t<e.length;)(n=e[t++])&&(a=aS(n))&&(i&&(i+=" "),i+=a);return i},aS=e=>{if(typeof e=="string")return e;let t,n="";for(let a=0;a<e.length;a++)e[a]&&(t=aS(e[a]))&&(n&&(n+=" "),n+=t);return n},pj=(e,...t)=>{let n,a,i,s;const l=h=>{const f=t.reduce((p,g)=>g(p),e());return n=cj(f),a=n.cache.get,i=n.cache.set,s=u,u(h)},u=h=>{const f=a(h);if(f)return f;const p=hj(h,n);return i(h,p),p};return s=l,(...h)=>s(fj(...h))},mj=[],Gt=e=>{const t=n=>n[e]||mj;return t.isThemeGetter=!0,t},rS=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,iS=/^\((?:(\w[\w-]*):)?(.+)\)$/i,gj=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,yj=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,vj=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,bj=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,kj=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,_j=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Xr=e=>gj.test(e),Qe=e=>!!e&&!Number.isNaN(Number(e)),Fa=e=>!!e&&Number.isInteger(Number(e)),lp=e=>e.endsWith("%")&&Qe(e.slice(0,-1)),vr=e=>yj.test(e),oS=()=>!0,wj=e=>vj.test(e)&&!bj.test(e),Kg=()=>!1,xj=e=>kj.test(e),Pj=e=>_j.test(e),Sj=e=>!_e(e)&&!xe(e),Cj=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),Tj=e=>di(e,cS,Kg),_e=e=>rS.test(e),Li=e=>di(e,uS,wj),x0=e=>di(e,Nj,Qe),Ej=e=>di(e,hS,oS),Aj=e=>di(e,dS,Kg),P0=e=>di(e,sS,Kg),Rj=e=>di(e,lS,Pj),yu=e=>di(e,fS,xj),xe=e=>iS.test(e),ll=e=>to(e,uS),Lj=e=>to(e,dS),S0=e=>to(e,sS),Dj=e=>to(e,cS),Mj=e=>to(e,lS),vu=e=>to(e,fS,!0),Ij=e=>to(e,hS,!0),di=(e,t,n)=>{const a=rS.exec(e);return a?a[1]?t(a[1]):n(a[2]):!1},to=(e,t,n=!1)=>{const a=iS.exec(e);return a?a[1]?t(a[1]):n:!1},sS=e=>e==="position"||e==="percentage",lS=e=>e==="image"||e==="url",cS=e=>e==="length"||e==="size"||e==="bg-size",uS=e=>e==="length",Nj=e=>e==="number",dS=e=>e==="family-name",hS=e=>e==="number"||e==="weight",fS=e=>e==="shadow",Oj=()=>{const e=Gt("color"),t=Gt("font"),n=Gt("text"),a=Gt("font-weight"),i=Gt("tracking"),s=Gt("leading"),l=Gt("breakpoint"),u=Gt("container"),h=Gt("spacing"),f=Gt("radius"),p=Gt("shadow"),g=Gt("inset-shadow"),v=Gt("text-shadow"),_=Gt("drop-shadow"),w=Gt("blur"),S=Gt("perspective"),P=Gt("aspect"),D=Gt("ease"),R=Gt("animate"),E=()=>["auto","avoid","all","avoid-page","page","left","right","column"],A=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],U=()=>[...A(),xe,_e],z=()=>["auto","hidden","clip","visible","scroll"],j=()=>["auto","contain","none"],C=()=>[xe,_e,h],K=()=>[Xr,"full","auto",...C()],Y=()=>[Fa,"none","subgrid",xe,_e],ce=()=>["auto",{span:["full",Fa,xe,_e]},Fa,xe,_e],re=()=>[Fa,"auto",xe,_e],fe=()=>["auto","min","max","fr",xe,_e],de=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],he=()=>["start","end","center","stretch","center-safe","end-safe"],oe=()=>["auto",...C()],X=()=>[Xr,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...C()],Z=()=>[Xr,"screen","full","dvw","lvw","svw","min","max","fit",...C()],Q=()=>[Xr,"screen","full","lh","dvh","lvh","svh","min","max","fit",...C()],V=()=>[e,xe,_e],I=()=>[...A(),S0,P0,{position:[xe,_e]}],G=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ye=()=>["auto","cover","contain",Dj,Tj,{size:[xe,_e]}],me=()=>[lp,ll,Li],pe=()=>["","none","full",f,xe,_e],ke=()=>["",Qe,ll,Li],We=()=>["solid","dashed","dotted","double"],Xe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Ue=()=>[Qe,lp,S0,P0],Dt=()=>["","none",w,xe,_e],rn=()=>["none",Qe,xe,_e],Pn=()=>["none",Qe,xe,_e],gt=()=>[Qe,xe,_e],Ut=()=>[Xr,"full",...C()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[vr],breakpoint:[vr],color:[oS],container:[vr],"drop-shadow":[vr],ease:["in","out","in-out"],font:[Sj],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[vr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[vr],shadow:[vr],spacing:["px",Qe],text:[vr],"text-shadow":[vr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Xr,_e,xe,P]}],container:["container"],"container-type":[{"@container":["","normal","size",xe,_e]}],"container-named":[Cj],columns:[{columns:[Qe,_e,xe,u]}],"break-after":[{"break-after":E()}],"break-before":[{"break-before":E()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:U()}],overflow:[{overflow:z()}],"overflow-x":[{"overflow-x":z()}],"overflow-y":[{"overflow-y":z()}],overscroll:[{overscroll:j()}],"overscroll-x":[{"overscroll-x":j()}],"overscroll-y":[{"overscroll-y":j()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:K()}],"inset-x":[{"inset-x":K()}],"inset-y":[{"inset-y":K()}],start:[{"inset-s":K(),start:K()}],end:[{"inset-e":K(),end:K()}],"inset-bs":[{"inset-bs":K()}],"inset-be":[{"inset-be":K()}],top:[{top:K()}],right:[{right:K()}],bottom:[{bottom:K()}],left:[{left:K()}],visibility:["visible","invisible","collapse"],z:[{z:[Fa,"auto",xe,_e]}],basis:[{basis:[Xr,"full","auto",u,...C()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Qe,Xr,"auto","initial","none",_e]}],grow:[{grow:["",Qe,xe,_e]}],shrink:[{shrink:["",Qe,xe,_e]}],order:[{order:[Fa,"first","last","none",xe,_e]}],"grid-cols":[{"grid-cols":Y()}],"col-start-end":[{col:ce()}],"col-start":[{"col-start":re()}],"col-end":[{"col-end":re()}],"grid-rows":[{"grid-rows":Y()}],"row-start-end":[{row:ce()}],"row-start":[{"row-start":re()}],"row-end":[{"row-end":re()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":fe()}],"auto-rows":[{"auto-rows":fe()}],gap:[{gap:C()}],"gap-x":[{"gap-x":C()}],"gap-y":[{"gap-y":C()}],"justify-content":[{justify:[...de(),"normal"]}],"justify-items":[{"justify-items":[...he(),"normal"]}],"justify-self":[{"justify-self":["auto",...he()]}],"align-content":[{content:["normal",...de()]}],"align-items":[{items:[...he(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...he(),{baseline:["","last"]}]}],"place-content":[{"place-content":de()}],"place-items":[{"place-items":[...he(),"baseline"]}],"place-self":[{"place-self":["auto",...he()]}],p:[{p:C()}],px:[{px:C()}],py:[{py:C()}],ps:[{ps:C()}],pe:[{pe:C()}],pbs:[{pbs:C()}],pbe:[{pbe:C()}],pt:[{pt:C()}],pr:[{pr:C()}],pb:[{pb:C()}],pl:[{pl:C()}],m:[{m:oe()}],mx:[{mx:oe()}],my:[{my:oe()}],ms:[{ms:oe()}],me:[{me:oe()}],mbs:[{mbs:oe()}],mbe:[{mbe:oe()}],mt:[{mt:oe()}],mr:[{mr:oe()}],mb:[{mb:oe()}],ml:[{ml:oe()}],"space-x":[{"space-x":C()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":C()}],"space-y-reverse":["space-y-reverse"],size:[{size:X()}],"inline-size":[{inline:["auto",...Z()]}],"min-inline-size":[{"min-inline":["auto",...Z()]}],"max-inline-size":[{"max-inline":["none",...Z()]}],"block-size":[{block:["auto",...Q()]}],"min-block-size":[{"min-block":["auto",...Q()]}],"max-block-size":[{"max-block":["none",...Q()]}],w:[{w:[u,"screen",...X()]}],"min-w":[{"min-w":[u,"screen","none",...X()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[l]},...X()]}],h:[{h:["screen","lh",...X()]}],"min-h":[{"min-h":["screen","lh","none",...X()]}],"max-h":[{"max-h":["screen","lh",...X()]}],"font-size":[{text:["base",n,ll,Li]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,Ij,Ej]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",lp,_e]}],"font-family":[{font:[Lj,Aj,t]}],"font-features":[{"font-features":[_e]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,xe,_e]}],"line-clamp":[{"line-clamp":[Qe,"none",xe,x0]}],leading:[{leading:[s,...C()]}],"list-image":[{"list-image":["none",xe,_e]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",xe,_e]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:V()}],"text-color":[{text:V()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...We(),"wavy"]}],"text-decoration-thickness":[{decoration:[Qe,"from-font","auto",xe,Li]}],"text-decoration-color":[{decoration:V()}],"underline-offset":[{"underline-offset":[Qe,"auto",xe,_e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:C()}],"tab-size":[{tab:[Fa,xe,_e]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",xe,_e]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",xe,_e]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:I()}],"bg-repeat":[{bg:G()}],"bg-size":[{bg:ye()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Fa,xe,_e],radial:["",xe,_e],conic:[Fa,xe,_e]},Mj,Rj]}],"bg-color":[{bg:V()}],"gradient-from-pos":[{from:me()}],"gradient-via-pos":[{via:me()}],"gradient-to-pos":[{to:me()}],"gradient-from":[{from:V()}],"gradient-via":[{via:V()}],"gradient-to":[{to:V()}],rounded:[{rounded:pe()}],"rounded-s":[{"rounded-s":pe()}],"rounded-e":[{"rounded-e":pe()}],"rounded-t":[{"rounded-t":pe()}],"rounded-r":[{"rounded-r":pe()}],"rounded-b":[{"rounded-b":pe()}],"rounded-l":[{"rounded-l":pe()}],"rounded-ss":[{"rounded-ss":pe()}],"rounded-se":[{"rounded-se":pe()}],"rounded-ee":[{"rounded-ee":pe()}],"rounded-es":[{"rounded-es":pe()}],"rounded-tl":[{"rounded-tl":pe()}],"rounded-tr":[{"rounded-tr":pe()}],"rounded-br":[{"rounded-br":pe()}],"rounded-bl":[{"rounded-bl":pe()}],"border-w":[{border:ke()}],"border-w-x":[{"border-x":ke()}],"border-w-y":[{"border-y":ke()}],"border-w-s":[{"border-s":ke()}],"border-w-e":[{"border-e":ke()}],"border-w-bs":[{"border-bs":ke()}],"border-w-be":[{"border-be":ke()}],"border-w-t":[{"border-t":ke()}],"border-w-r":[{"border-r":ke()}],"border-w-b":[{"border-b":ke()}],"border-w-l":[{"border-l":ke()}],"divide-x":[{"divide-x":ke()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ke()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...We(),"hidden","none"]}],"divide-style":[{divide:[...We(),"hidden","none"]}],"border-color":[{border:V()}],"border-color-x":[{"border-x":V()}],"border-color-y":[{"border-y":V()}],"border-color-s":[{"border-s":V()}],"border-color-e":[{"border-e":V()}],"border-color-bs":[{"border-bs":V()}],"border-color-be":[{"border-be":V()}],"border-color-t":[{"border-t":V()}],"border-color-r":[{"border-r":V()}],"border-color-b":[{"border-b":V()}],"border-color-l":[{"border-l":V()}],"divide-color":[{divide:V()}],"outline-style":[{outline:[...We(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Qe,xe,_e]}],"outline-w":[{outline:["",Qe,ll,Li]}],"outline-color":[{outline:V()}],shadow:[{shadow:["","none",p,vu,yu]}],"shadow-color":[{shadow:V()}],"inset-shadow":[{"inset-shadow":["none",g,vu,yu]}],"inset-shadow-color":[{"inset-shadow":V()}],"ring-w":[{ring:ke()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:V()}],"ring-offset-w":[{"ring-offset":[Qe,Li]}],"ring-offset-color":[{"ring-offset":V()}],"inset-ring-w":[{"inset-ring":ke()}],"inset-ring-color":[{"inset-ring":V()}],"text-shadow":[{"text-shadow":["none",v,vu,yu]}],"text-shadow-color":[{"text-shadow":V()}],opacity:[{opacity:[Qe,xe,_e]}],"mix-blend":[{"mix-blend":[...Xe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Xe()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Qe]}],"mask-image-linear-from-pos":[{"mask-linear-from":Ue()}],"mask-image-linear-to-pos":[{"mask-linear-to":Ue()}],"mask-image-linear-from-color":[{"mask-linear-from":V()}],"mask-image-linear-to-color":[{"mask-linear-to":V()}],"mask-image-t-from-pos":[{"mask-t-from":Ue()}],"mask-image-t-to-pos":[{"mask-t-to":Ue()}],"mask-image-t-from-color":[{"mask-t-from":V()}],"mask-image-t-to-color":[{"mask-t-to":V()}],"mask-image-r-from-pos":[{"mask-r-from":Ue()}],"mask-image-r-to-pos":[{"mask-r-to":Ue()}],"mask-image-r-from-color":[{"mask-r-from":V()}],"mask-image-r-to-color":[{"mask-r-to":V()}],"mask-image-b-from-pos":[{"mask-b-from":Ue()}],"mask-image-b-to-pos":[{"mask-b-to":Ue()}],"mask-image-b-from-color":[{"mask-b-from":V()}],"mask-image-b-to-color":[{"mask-b-to":V()}],"mask-image-l-from-pos":[{"mask-l-from":Ue()}],"mask-image-l-to-pos":[{"mask-l-to":Ue()}],"mask-image-l-from-color":[{"mask-l-from":V()}],"mask-image-l-to-color":[{"mask-l-to":V()}],"mask-image-x-from-pos":[{"mask-x-from":Ue()}],"mask-image-x-to-pos":[{"mask-x-to":Ue()}],"mask-image-x-from-color":[{"mask-x-from":V()}],"mask-image-x-to-color":[{"mask-x-to":V()}],"mask-image-y-from-pos":[{"mask-y-from":Ue()}],"mask-image-y-to-pos":[{"mask-y-to":Ue()}],"mask-image-y-from-color":[{"mask-y-from":V()}],"mask-image-y-to-color":[{"mask-y-to":V()}],"mask-image-radial":[{"mask-radial":[xe,_e]}],"mask-image-radial-from-pos":[{"mask-radial-from":Ue()}],"mask-image-radial-to-pos":[{"mask-radial-to":Ue()}],"mask-image-radial-from-color":[{"mask-radial-from":V()}],"mask-image-radial-to-color":[{"mask-radial-to":V()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":A()}],"mask-image-conic-pos":[{"mask-conic":[Qe]}],"mask-image-conic-from-pos":[{"mask-conic-from":Ue()}],"mask-image-conic-to-pos":[{"mask-conic-to":Ue()}],"mask-image-conic-from-color":[{"mask-conic-from":V()}],"mask-image-conic-to-color":[{"mask-conic-to":V()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:I()}],"mask-repeat":[{mask:G()}],"mask-size":[{mask:ye()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",xe,_e]}],filter:[{filter:["","none",xe,_e]}],blur:[{blur:Dt()}],brightness:[{brightness:[Qe,xe,_e]}],contrast:[{contrast:[Qe,xe,_e]}],"drop-shadow":[{"drop-shadow":["","none",_,vu,yu]}],"drop-shadow-color":[{"drop-shadow":V()}],grayscale:[{grayscale:["",Qe,xe,_e]}],"hue-rotate":[{"hue-rotate":[Qe,xe,_e]}],invert:[{invert:["",Qe,xe,_e]}],saturate:[{saturate:[Qe,xe,_e]}],sepia:[{sepia:["",Qe,xe,_e]}],"backdrop-filter":[{"backdrop-filter":["","none",xe,_e]}],"backdrop-blur":[{"backdrop-blur":Dt()}],"backdrop-brightness":[{"backdrop-brightness":[Qe,xe,_e]}],"backdrop-contrast":[{"backdrop-contrast":[Qe,xe,_e]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Qe,xe,_e]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Qe,xe,_e]}],"backdrop-invert":[{"backdrop-invert":["",Qe,xe,_e]}],"backdrop-opacity":[{"backdrop-opacity":[Qe,xe,_e]}],"backdrop-saturate":[{"backdrop-saturate":[Qe,xe,_e]}],"backdrop-sepia":[{"backdrop-sepia":["",Qe,xe,_e]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":C()}],"border-spacing-x":[{"border-spacing-x":C()}],"border-spacing-y":[{"border-spacing-y":C()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",xe,_e]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Qe,"initial",xe,_e]}],ease:[{ease:["linear","initial",D,xe,_e]}],delay:[{delay:[Qe,xe,_e]}],animate:[{animate:["none",R,xe,_e]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,xe,_e]}],"perspective-origin":[{"perspective-origin":U()}],rotate:[{rotate:rn()}],"rotate-x":[{"rotate-x":rn()}],"rotate-y":[{"rotate-y":rn()}],"rotate-z":[{"rotate-z":rn()}],scale:[{scale:Pn()}],"scale-x":[{"scale-x":Pn()}],"scale-y":[{"scale-y":Pn()}],"scale-z":[{"scale-z":Pn()}],"scale-3d":["scale-3d"],skew:[{skew:gt()}],"skew-x":[{"skew-x":gt()}],"skew-y":[{"skew-y":gt()}],transform:[{transform:[xe,_e,"","none","gpu","cpu"]}],"transform-origin":[{origin:U()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ut()}],"translate-x":[{"translate-x":Ut()}],"translate-y":[{"translate-y":Ut()}],"translate-z":[{"translate-z":Ut()}],"translate-none":["translate-none"],zoom:[{zoom:[Fa,xe,_e]}],accent:[{accent:V()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:V()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",xe,_e]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":V()}],"scrollbar-track-color":[{"scrollbar-track":V()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":C()}],"scroll-mx":[{"scroll-mx":C()}],"scroll-my":[{"scroll-my":C()}],"scroll-ms":[{"scroll-ms":C()}],"scroll-me":[{"scroll-me":C()}],"scroll-mbs":[{"scroll-mbs":C()}],"scroll-mbe":[{"scroll-mbe":C()}],"scroll-mt":[{"scroll-mt":C()}],"scroll-mr":[{"scroll-mr":C()}],"scroll-mb":[{"scroll-mb":C()}],"scroll-ml":[{"scroll-ml":C()}],"scroll-p":[{"scroll-p":C()}],"scroll-px":[{"scroll-px":C()}],"scroll-py":[{"scroll-py":C()}],"scroll-ps":[{"scroll-ps":C()}],"scroll-pe":[{"scroll-pe":C()}],"scroll-pbs":[{"scroll-pbs":C()}],"scroll-pbe":[{"scroll-pbe":C()}],"scroll-pt":[{"scroll-pt":C()}],"scroll-pr":[{"scroll-pr":C()}],"scroll-pb":[{"scroll-pb":C()}],"scroll-pl":[{"scroll-pl":C()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",xe,_e]}],fill:[{fill:["none",...V()]}],"stroke-w":[{stroke:[Qe,ll,Li,x0]}],stroke:[{stroke:["none",...V()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},jj=pj(Oj);function St(...e){return jj(G6(e))}const Uj=T.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",children:[T.jsx("path",{d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92a5.06 5.06 0 0 1-2.2 3.32v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.1Z",fill:"#4285F4"}),T.jsx("path",{d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23Z",fill:"#34A853"}),T.jsx("path",{d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18A10.96 10.96 0 0 0 1 12c0 1.77.42 3.44 1.18 4.93l3.66-2.84Z",fill:"#FBBC05"}),T.jsx("path",{d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53Z",fill:"#EA4335"})]}),Bj=T.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor",children:T.jsx("path",{d:"M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0 0 24 12c0-6.63-5.37-12-12-12Z"})}),Fj={google:Uj,github:Bj},zj={google:"Google",github:"GitHub",microsoft:"Microsoft",discord:"Discord",apple:"Apple"};function Vj(e){return zj[e]||String(e||"").replace(/-/g," ")}function $j({title:e,subtitle:t,className:n="",onSuccess:a,hideLogo:i=!1}){ql();const{enabled:s,signedIn:l,refreshUser:u,signInWithPassword:h,signUp:f,signInWithOAuth:p,getPublicAuthConfig:g}=eo(),[v,_]=b.useState("signin"),[w,S]=b.useState(""),[P,D]=b.useState(""),[R,E]=b.useState(""),[A,U]=b.useState(!1),[z,j]=b.useState(null),[C,K]=b.useState(null),[Y,ce]=b.useState(!1),[re,fe]=b.useState(!0),[de,he]=b.useState([]),[oe,X]=b.useState(8);b.useEffect(()=>{if(!s)return;let I=!0;return fe(!0),(async()=>{const{data:G,error:ye}=await g();if(I){if(ye||!G)he(["google","github"]);else{const me=Array.isArray(G.oAuthProviders)?G.oAuthProviders:[],pe=Array.isArray(G.customOAuthProviders)?G.customOAuthProviders:[];he([...me,...pe]),typeof G.passwordMinLength=="number"&&G.passwordMinLength>0&&X(G.passwordMinLength)}fe(!1)}})(),()=>{I=!1}},[s,g]),b.useEffect(()=>{l&&a&&a()},[l,a]);const Z=b.useMemo(()=>typeof window>"u"?"":!!window.webkit?.messageHandlers?.nativeOAuth?`${window.location.origin}/auth/callback`:`${window.location.origin}/`,[]),Q=b.useCallback(async I=>{j(null),U(!0);try{const{error:G}=await p(I,Z);G&&j(G.message||String(G))}finally{U(!1)}},[p,Z]),V=b.useCallback(async I=>{I.preventDefault(),j(null),U(!0);try{if(v==="signup"){const{data:ye,error:me}=await f({email:w.trim(),password:P,name:R.trim()||void 0});if(me){j(me.message||String(me));return}if(ye?.requireEmailVerification){K(De("login.verify_email_pending")),_("signin");return}await u();return}const{error:G}=await h({email:w.trim(),password:P});if(G){j(G.message||String(G));return}await u()}finally{U(!1)}},[v,w,P,R,f,h,u]);return s?T.jsxs("div",{className:St("w-full bg-white dark:bg-oai-gray-950 p-6 transition-colors duration-200",n),children:[T.jsxs("div",{className:"text-center mb-6",children:[!i&&T.jsxs("div",{className:"flex items-center justify-center gap-2 mb-2",children:[T.jsx("img",{src:"/app-icon.png",alt:"",width:28,height:28,className:"rounded-md"}),T.jsx("span",{className:"text-lg font-semibold text-oai-black dark:text-white font-oai tracking-tight",children:De("shared.app_name")})]}),T.jsx("h2",{className:St("text-sm font-semibold text-oai-black dark:text-white tracking-tight mb-1",i&&"text-base font-bold md:text-lg"),children:e||De("login_modal.subtitle")}),t&&T.jsx("p",{className:"text-xs text-oai-gray-500 dark:text-oai-gray-400 mt-1.5 leading-relaxed max-w-[320px] mx-auto",children:t})]}),C&&T.jsx("div",{className:"mb-4 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-oai-gray-50 dark:bg-oai-gray-900/50 px-3 py-2 text-xs text-oai-gray-700 dark:text-oai-gray-300",children:C}),z&&T.jsx("p",{className:"mb-4 text-sm text-red-500 dark:text-red-400 text-center",role:"alert",children:z}),T.jsx("div",{className:"space-y-2.5 mb-5",children:re?T.jsxs("div",{className:"space-y-2.5",children:[T.jsx("div",{className:"h-10 rounded-lg bg-oai-gray-100 dark:bg-oai-gray-900/50 animate-pulse"}),T.jsx("div",{className:"h-10 rounded-lg bg-oai-gray-100 dark:bg-oai-gray-900/50 animate-pulse"})]}):de.map(I=>T.jsxs("button",{type:"button",disabled:A,onClick:()=>Q(I),className:St("w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-700 bg-oai-gray-50 dark:bg-oai-gray-900 text-sm font-medium text-oai-black dark:text-white","hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 hover:border-oai-gray-300 dark:hover:border-oai-gray-600 transition-colors disabled:opacity-50","flex items-center justify-center gap-2.5"),children:[Fj[I]||null,De("login.oauth.continue",{provider:Vj(I)})]},I))}),Y?T.jsxs(T.Fragment,{children:[T.jsxs("div",{className:"relative mb-5",children:[T.jsx("div",{className:"absolute inset-0 flex items-center",children:T.jsx("span",{className:"w-full border-t border-oai-gray-200 dark:border-oai-gray-800"})}),T.jsx("div",{className:"relative flex justify-center text-xs uppercase tracking-wider",children:T.jsx("span",{className:"bg-white dark:bg-oai-gray-950 px-3 text-oai-gray-400 dark:text-oai-gray-600",children:De("login_modal.divider_email")})})]}),T.jsxs("div",{className:"flex rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 p-0.5 bg-oai-gray-50 dark:bg-oai-gray-900/50 mb-4",children:[T.jsx("button",{type:"button",className:St("flex-1 py-1.5 text-xs font-medium rounded-md transition-colors",v==="signin"?"bg-white dark:bg-oai-gray-800 text-oai-black dark:text-white shadow-sm":"text-oai-gray-500 hover:text-oai-gray-700 dark:hover:text-oai-gray-300"),onClick:()=>{_("signin"),j(null)},children:De("login.tab.sign_in")}),T.jsx("button",{type:"button",className:St("flex-1 py-1.5 text-xs font-medium rounded-md transition-colors",v==="signup"?"bg-white dark:bg-oai-gray-800 text-oai-black dark:text-white shadow-sm":"text-oai-gray-500 hover:text-oai-gray-700 dark:hover:text-oai-gray-300"),onClick:()=>{_("signup"),j(null)},children:De("login.tab.sign_up")})]}),T.jsxs("form",{onSubmit:V,className:"space-y-3",children:[v==="signup"&&T.jsxs("div",{children:[T.jsx("label",{htmlFor:"card-name",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:De("login.field.name")}),T.jsx("input",{id:"card-name",type:"text",autoComplete:"name",value:R,onChange:I=>E(I.target.value),className:"w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-oai-gray-50 dark:bg-oai-gray-900 px-3 text-sm text-oai-black dark:text-white placeholder-oai-gray-400 dark:placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500",placeholder:De("login.field.name_placeholder")})]}),T.jsxs("div",{children:[T.jsx("label",{htmlFor:"card-email",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:De("login.field.email")}),T.jsx("input",{id:"card-email",type:"email",autoComplete:"email",required:!0,value:w,onChange:I=>S(I.target.value),className:"w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-oai-gray-50 dark:bg-oai-gray-900 px-3 text-sm text-oai-black dark:text-white placeholder-oai-gray-400 dark:placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500"})]}),T.jsxs("div",{children:[T.jsx("label",{htmlFor:"card-password",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:De("login.field.password")}),T.jsx("input",{id:"card-password",type:"password",autoComplete:v==="signup"?"new-password":"current-password",required:!0,minLength:v==="signup"?oe:void 0,value:P,onChange:I=>D(I.target.value),className:"w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-oai-gray-50 dark:bg-oai-gray-900 px-3 text-sm text-oai-black dark:text-white placeholder-oai-gray-400 dark:placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500"}),v==="signup"&&T.jsx("p",{className:"mt-1 text-xs text-oai-gray-400 dark:text-oai-gray-600",children:De("login.password_hint",{min:String(oe)})})]}),T.jsx("button",{type:"submit",disabled:A,className:"w-full h-10 rounded-lg bg-oai-gray-900 dark:bg-white text-white dark:text-oai-gray-950 text-sm font-semibold hover:bg-oai-gray-800 dark:hover:bg-oai-gray-100 transition-colors disabled:opacity-50",children:De(v==="signup"?"login.submit.sign_up":"login.submit.sign_in")})]})]}):T.jsxs(T.Fragment,{children:[T.jsxs("div",{className:"relative mb-5",children:[T.jsx("div",{className:"absolute inset-0 flex items-center",children:T.jsx("span",{className:"w-full border-t border-oai-gray-200 dark:border-oai-gray-800"})}),T.jsx("div",{className:"relative flex justify-center text-xs uppercase tracking-wider",children:T.jsx("span",{className:"bg-white dark:bg-oai-gray-950 px-3 text-oai-gray-400 dark:text-oai-gray-600",children:De("login.divider")})})]}),T.jsxs("button",{type:"button",onClick:()=>ce(!0),className:St("w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-700 bg-oai-gray-50 dark:bg-oai-gray-900 text-sm font-medium text-oai-black dark:text-white","hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 hover:border-oai-gray-300 dark:hover:border-oai-gray-600 transition-colors","flex items-center justify-center gap-2.5"),children:[T.jsx(xI,{className:"h-[18px] w-[18px] text-oai-gray-500 dark:text-oai-gray-400",strokeWidth:1.75}),De("login_modal.continue_email")]})]})]}):null}function Hj(){const{isOpen:e,closeLoginModal:t}=h1(),{enabled:n}=eo();return b.useEffect(()=>{if(!e)return;const a=i=>{i.key==="Escape"&&t()};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[e,t]),n?T.jsx(FP,{children:e&&T.jsxs(Cl.div,{className:"fixed inset-0 z-[100] flex items-center justify-center p-4",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},children:[T.jsx(Cl.div,{className:"absolute inset-0 bg-black/40 dark:bg-black/60",onClick:t,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}}),T.jsxs(Cl.div,{className:"relative w-full max-w-[420px] rounded-2xl border border-oai-gray-200 dark:border-oai-gray-800 bg-white dark:bg-oai-gray-950 shadow-2xl overflow-hidden",initial:{opacity:0,scale:.95,y:10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:10},transition:{duration:.2},onClick:a=>a.stopPropagation(),children:[T.jsx("button",{type:"button",onClick:t,className:"absolute right-4 top-4 z-10 text-oai-gray-400 dark:text-oai-gray-500 hover:text-oai-black dark:hover:text-white transition-colors",children:T.jsx(gg,{className:"h-5 w-5"})}),T.jsx($j,{onSuccess:t,className:"p-6 bg-transparent"})]})]})}):null}const Wj={VITE_INSFORGE_BASE_URL:"https://srctyff5.us-east.insforge.app"},EB="https://tokentracker.statuspage.io/";function Gj(){if(typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"))return"";const t=typeof import.meta<"u"?Wj:void 0;return(t?.VITE_TOKENTRACKER_BACKEND_BASE_URL||t?.VITE_INSFORGE_BASE_URL||er()).trim()}function Kj(){return er()}function qj(e=""){if(typeof e!="string"||e.length===0)return!1;const t=new URLSearchParams(e),n=String(t.get("screenshot")||"").toLowerCase();return n==="1"||n==="true"}const Yj=300*1e3,Zj=720*60*1e3;function qg(e){return typeof e=="string"&&/^https?:\/\//i.test(e.trim())}function Xj(e,t=Date.now()){if(!e?.token||!e?.deviceId||!e?.issuedAt)return!0;const n=Date.parse(e.issuedAt);return Number.isFinite(n)?n+Zj<=t:!0}async function pS(e,t){const n=er();if(!qg(n)||!e)return;const a=n.replace(/\/$/,""),i=ds(),s={Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${e}`};i&&(s.apikey=i);try{await fetch(`${a}/functions/tokentracker-leaderboard-refresh`,{method:"POST",headers:s,body:JSON.stringify({period:"week",source:t})})}catch{}}const C0="tokentracker_client_id_v1";function Qj(){if(typeof window>"u")return"ssr";try{const e=window.localStorage.getItem(C0);if(e&&e.length>=8)return e;const t=typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`;return window.localStorage.setItem(C0,t),t}catch{return`eph-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`}}async function Jj(){try{const e=await fetch("/functions/tokentracker-machine-id",{headers:{Accept:"application/json"},cache:"no-store"});if(e.ok){const t=await e.json().catch(()=>null),n=typeof t?.machineId=="string"?t.machineId:null;if(n&&n.length>=8)return n.slice(0,8)}}catch{}return Qj().slice(0,8)}async function e8(e){const t=er();if(!qg(t)||!e)return null;const n=t.replace(/\/$/,""),a=ds(),i={Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${e}`};a&&(i.apikey=a);const s=typeof navigator<"u"&&typeof navigator.platform=="string"?navigator.platform:"web",u=`Token Tracker (dashboard) #${await Jj()}`,h=await fetch(`${n}/functions/tokentracker-device-token-issue`,{method:"POST",headers:i,body:JSON.stringify({device_name:u,platform:s})});if(!h.ok)return null;const f=await h.json().catch(()=>null),p=typeof f?.token=="string"?f.token:null,g=typeof f?.device_id=="string"?f.device_id:null;return!p||!g?null:{token:p,deviceId:g,issuedAt:typeof f?.created_at=="string"?f.created_at:new Date().toISOString()}}async function T0(e){const{deviceToken:t,insforgeBaseUrl:n}=e,a={deviceToken:t},i=n||er();qg(i)&&(a.insforgeBaseUrl=i.trim());const s=await Od(),l=await fetch("/functions/tokentracker-local-sync",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",...s},body:JSON.stringify(a)}),u=await l.json().catch(()=>({}));if(!l.ok){const h=typeof u.error=="string"?u.error:`HTTP ${l.status}`;throw new Error(h)}return u}async function E0(e){const t=await e();if(!t)return null;const n=Ex();if(n&&!Xj(n))return n;const a=await e8(t);return a?(tD(a),a):null}async function mS(e){let t=await e();if(!t)return null;let n=await E0(async()=>t);if(!n)return t;try{return await T0({deviceToken:n.token,insforgeBaseUrl:er()}),t}catch(a){if(!Ex()||(Ax(),t=await e(),!t)||(n=await E0(async()=>t),!n))throw a;return await T0({deviceToken:n.token,insforgeBaseUrl:er()}),t}}async function t8(e){const t=nD();if(Date.now()-t<Yj)return;const n=await mS(e);n&&(Rx(Date.now()),await pS(n,"cloud-sync-auto"))}async function AB(e){const t=await mS(e);t&&(Rx(Date.now()),await pS(t,"cloud-sync-now"))}function n8(e){const t=e.replace(/\/+$/,"")||"/";return t==="/share"||t==="/share.html"||t.startsWith("/share/")}function a8(e){const t=e.replace(/\/+$/,"")||"/";return t==="/login"||t==="/landing"||n8(t)?!1:t==="/"||t==="/dashboard"||t.startsWith("/leaderboard")}function r8(){const e=Mn(),t=eo(),n=b.useRef(!1);b.useEffect(()=>{if(!Wp()||!a8(e.pathname||"/")||!t.enabled||!t.signedIn||t.loading||!Gp())return;let a=!1;const i=window.setTimeout(()=>{(async()=>{if(!(a||n.current)){n.current=!0;try{await t8(()=>t.getAccessToken())}catch(s){console.warn("[tokentracker] cloud usage sync:",s)}finally{n.current=!1}}})()},2500);return()=>{a=!0,window.clearTimeout(i)}},[e.pathname,t.enabled,t.signedIn,t.loading,t.getAccessToken])}function i8(){const e=b.useContext(u1);if(e===null)throw new Error("useTheme must be used within a ThemeProvider");return e}function o8({prefersReducedMotion:e,screenshotCapture:t}){return!(t||e)}function s8(e){if(!e||typeof e!="object")return null;const t=e.user_metadata&&typeof e.user_metadata=="object"?e.user_metadata:{},n=e.profile&&typeof e.profile=="object"?e.profile:{},a=t.avatar_url||t.picture||n.avatar_url||e.avatar_url;return typeof a=="string"&&a.trim()?a.trim():null}function l8(e){return e?jd()?`/api/avatar-proxy?url=${encodeURIComponent(e)}`:e:null}function bu(e){const t=String(e||"").trim();if(!t)return"?";const n=t.split(/\s+/).filter(Boolean);return n.length>=2?(n[0][0]+n[n.length-1][0]).toUpperCase():t.slice(0,2).toUpperCase()}function A0({className:e,variant:t="header",collapsed:n=!1,onAfterAction:a}){ql();const i=t==="sidebar",{enabled:s,loading:l,signedIn:u,user:h,displayName:f}=eo(),{openLoginModal:p}=h1(),g=ss(),v=b.useMemo(()=>s8(h),[h]),_=b.useMemo(()=>l8(v),[v]),[w,S]=Xo.useState(!1);if(Xo.useEffect(()=>{S(!1)},[_]),!s)return null;if(l)return T.jsx("div",{className:St("h-9 w-9 shrink-0 rounded-full bg-oai-gray-200 dark:bg-oai-gray-800 animate-pulse",e),"aria-hidden":!0});if(!u)return i?T.jsxs("button",{type:"button",onClick:()=>{p(),a?.()},className:St("flex items-center gap-2 rounded-md px-2 py-1.5 text-[13px] font-medium text-oai-gray-700 dark:text-oai-gray-300 hover:bg-oai-gray-200/60 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500 min-w-0",n?"h-8 w-8 justify-center px-0":"w-full",e),"aria-label":De("header.auth.sign_in_aria"),title:n?De("header.auth.sign_in_aria"):void 0,children:[T.jsx("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center",children:T.jsx("img",{src:"/app-icon.png",alt:"",width:18,height:18,className:"h-[18px] w-[18px] rounded"})}),!n&&T.jsx("span",{className:"truncate flex-1 text-left",children:De("header.auth.sign_in_aria")})]}):T.jsx("button",{type:"button",onClick:p,className:St("shrink-0 inline-flex h-9 items-center justify-center gap-1.5 rounded-md px-4 text-sm font-medium transition-colors duration-200 ease-out shadow-sm ring-1 ring-oai-gray-200 dark:ring-white/10 bg-oai-gray-900 text-white hover:bg-oai-gray-800 active:bg-oai-gray-950 dark:bg-white dark:text-oai-gray-900 dark:hover:bg-oai-gray-100 dark:active:bg-oai-gray-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500 focus-visible:ring-offset-2 dark:focus-visible:ring-offset-oai-gray-950",e),"aria-label":De("header.auth.sign_in_aria"),children:De("header.auth.sign_in_aria")});const P=()=>{g("/settings"),a?.()};return T.jsx("div",{className:St(i?"relative flex w-full shrink-0 items-center":"relative flex shrink-0 items-center",e),children:T.jsxs("button",{type:"button",onClick:P,className:St(i?St("flex w-full items-center gap-2 rounded-md px-2 py-1.5 hover:bg-oai-gray-200/60 dark:hover:bg-oai-gray-800 transition-colors min-w-0",n&&"justify-center px-0 py-0 h-9 w-9"):"flex items-center gap-2 rounded-md pl-1 pr-2 py-1 border border-transparent hover:bg-oai-gray-100 dark:hover:bg-oai-gray-900/80 hover:border-oai-gray-200 dark:hover:border-oai-gray-800 transition-colors"),"aria-label":De("header.auth.open_settings"),title:i&&n?f:void 0,children:[i?T.jsx("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center",children:_&&!w?T.jsx("img",{src:_,alt:"",width:20,height:20,className:"h-5 w-5 rounded-full object-cover ring-1 ring-oai-gray-300 dark:ring-oai-gray-700",referrerPolicy:"no-referrer",onError:()=>S(!0)}):bu(f)==="?"?T.jsx("span",{className:"flex h-5 w-5 items-center justify-center rounded-full bg-oai-brand-600/30 text-white ring-1 ring-oai-brand-500/50",children:T.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",className:"w-3 h-3 opacity-80",children:T.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z"})})}):T.jsx("span",{className:"flex h-5 w-5 items-center justify-center rounded-full bg-oai-brand-600 text-[9px] font-semibold text-white ring-1 ring-oai-brand-500/50",children:bu(f)})}):_&&!w?T.jsx("img",{src:_,alt:"",width:32,height:32,className:"h-8 w-8 rounded-full object-cover ring-1 ring-oai-gray-300 dark:ring-oai-gray-700 shrink-0",referrerPolicy:"no-referrer",onError:()=>S(!0)}):bu(f)==="?"?T.jsx("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-oai-brand-600/30 text-white ring-1 ring-oai-brand-500/50",children:T.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",className:"w-4 h-4 opacity-80",children:T.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z"})})}):T.jsx("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-oai-brand-600 text-xs font-semibold text-white ring-1 ring-oai-brand-500/50",children:bu(f)}),i?!n&&T.jsx("span",{className:"truncate text-[13px] font-medium text-oai-gray-900 dark:text-oai-gray-200 flex-1 text-left min-w-0",children:f}):T.jsx("span",{className:"hidden sm:inline truncate text-sm font-medium text-oai-gray-900 dark:text-oai-gray-200 max-w-[120px]",children:f})]})})}const _m="tt.sidebarCollapsed";function gS(){return[{id:"general",label:De("nav.group.general"),items:[{id:"usage",to:"/dashboard",icon:fI,label:De("nav.usage")},{id:"limits",to:"/limits",icon:yI,label:De("nav.limits")},{id:"leaderboard",to:"/leaderboard",icon:zI,label:De("nav.leaderboard")}]},{id:"tools",label:De("nav.group.tools"),items:[{id:"widgets",to:"/widgets",icon:_I,label:De("nav.widgets")},{id:"skills",to:"/skills",icon:RI,label:De("nav.skills")},{id:"ip-check",to:"/ip-check",icon:bI,label:De("nav.ip_check")}]},{id:"account",label:De("nav.group.account"),items:[{id:"settings",to:"/settings",icon:OI,label:De("nav.settings")}]}]}function c8(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(_m)==="1"}catch{return!1}}function u8(){const[e,t]=b.useState(c8),n=b.useCallback(()=>{t(a=>{const i=!a;try{typeof window<"u"&&window.localStorage.setItem(_m,i?"1":"0")}catch{}return i})},[]);return b.useEffect(()=>{if(typeof window>"u")return;const a=i=>{i.key===_m&&t(i.newValue==="1")};return window.addEventListener("storage",a),()=>window.removeEventListener("storage",a)},[]),{collapsed:e,toggle:n}}function d8(e,t){const n=e.replace(/\/+$/,"")||"/";return t==="/dashboard"?n==="/dashboard"||n==="/":t==="/leaderboard"?n==="/leaderboard"||n.startsWith("/leaderboard/"):n===t}function h8({label:e,collapsed:t,first:n}){return t?n?null:T.jsx("div",{className:"mx-2 my-2 h-px bg-oai-gray-200/70 dark:bg-oai-gray-800/70","aria-hidden":!0}):T.jsx("div",{className:St("px-3 pb-1 text-[10px] uppercase tracking-wider text-oai-gray-500 dark:text-oai-gray-500",n?"pt-2":"pt-4"),children:e})}function f8({item:e,collapsed:t,active:n,onClick:a}){const i=e.icon;return T.jsxs(Rd,{to:e.to,onClick:a,title:t?e.label:void 0,"aria-current":n?"page":void 0,className:St("flex items-center gap-2 rounded-md px-2 py-1.5 text-[13px] no-underline transition-colors",t&&"justify-center px-0 py-2",n?"bg-oai-gray-200/70 text-oai-black font-medium dark:bg-oai-gray-800 dark:text-white":"text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-200/50 hover:text-oai-black dark:hover:bg-oai-gray-800/60 dark:hover:text-white"),children:[T.jsx("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center",children:T.jsx(i,{className:"h-[15px] w-[15px]","aria-hidden":!0})}),!t&&T.jsx("span",{className:"truncate",children:e.label})]})}function p8({as:e="button",title:t,onClick:n,href:a,children:i,className:s,...l}){const u=St("flex h-10 w-10 items-center justify-center rounded-lg text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-200/60 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white transition-colors no-underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500",s);return e==="a"?T.jsx("a",{href:a,target:"_blank",rel:"noopener noreferrer",title:t,"aria-label":t,className:u,...l,children:i}):T.jsx("button",{type:"button",title:t,"aria-label":t,onClick:n,className:u,...l,children:i})}function m8({repo:e="mm7894215/TokenTracker",glassChrome:t=!1}){const[n,a]=b.useState(null);return b.useEffect(()=>{if(typeof window>"u")return;const i=typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;o8({prefersReducedMotion:i,screenshotCapture:!1})&&fetch(`https://api.github.com/repos/${e}`).then(s=>s.json()).then(s=>{s&&typeof s.stargazers_count=="number"&&a(s.stargazers_count)}).catch(()=>{})},[e]),T.jsxs("a",{href:`https://github.com/${e}`,target:"_blank",rel:"noopener noreferrer","aria-label":n!==null?`Star on GitHub (${n})`:"Star on GitHub",className:St("inline-flex h-7 items-center gap-1.5 rounded-full px-2.5 text-xs font-medium transition-colors no-underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500",t?"border border-gray-500/20 dark:border-gray-500/30 bg-gray-500/[0.04] dark:bg-gray-500/[0.06] backdrop-blur-[2px] text-oai-gray-700 dark:text-oai-gray-300 hover:bg-gray-500/10 dark:hover:bg-gray-500/12 hover:border-gray-500/30 dark:hover:border-gray-500/40 hover:text-oai-black dark:hover:text-white":"border border-oai-gray-200 dark:border-oai-gray-700 text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-200/60 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white hover:border-oai-gray-300 dark:hover:border-oai-gray-600"),children:[T.jsx("svg",{height:"12",viewBox:"0 0 16 16",width:"12",className:"shrink-0 fill-current",children:T.jsx("path",{d:"M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z"})}),T.jsx("span",{children:"Star"}),n!==null&&T.jsx("span",{className:"text-[10px] text-oai-gray-500 dark:text-oai-gray-500 tabular-nums",children:n})]})}const g8=[{value:"light",label:"Light",Icon:c1},{value:"dark",label:"Dark",Icon:l1},{value:"system",label:"System",Icon:TI}];function y8({theme:e,resolvedTheme:t,onSetTheme:n,glassChrome:a=!1}){const[i,s]=b.useState(!1),l=b.useRef(null),u=t==="dark"?l1:c1;return b.useEffect(()=>{if(!i)return;const h=p=>{l.current&&!l.current.contains(p.target)&&s(!1)},f=p=>{p.key==="Escape"&&s(!1)};return document.addEventListener("mousedown",h),document.addEventListener("keydown",f),()=>{document.removeEventListener("mousedown",h),document.removeEventListener("keydown",f)}},[i]),T.jsxs("div",{ref:l,className:"relative",children:[T.jsx("button",{type:"button","aria-label":"Theme","aria-expanded":i,"aria-haspopup":"menu",title:"Theme",onClick:()=>s(h=>!h),className:St("inline-flex h-7 w-7 items-center justify-center rounded-full transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500",a?"border border-gray-500/20 dark:border-gray-500/30 bg-gray-500/[0.04] dark:bg-gray-500/[0.06] backdrop-blur-[2px] text-oai-gray-700 dark:text-oai-gray-300 hover:bg-gray-500/10 dark:hover:bg-gray-500/12 hover:border-gray-500/30 dark:hover:border-gray-500/40 hover:text-oai-black dark:hover:text-white":"border border-oai-gray-200 dark:border-oai-gray-700 text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-200/60 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white hover:border-oai-gray-300 dark:hover:border-oai-gray-600"),children:T.jsx(u,{className:"h-3.5 w-3.5","aria-hidden":!0})}),i&&T.jsx("div",{role:"menu",className:"absolute bottom-full left-0 mb-2 z-50 min-w-[140px] py-1 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-white dark:bg-oai-gray-900 shadow-lg",children:g8.map(({value:h,label:f,Icon:p})=>{const g=e===h;return T.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{n(h),s(!1)},className:St("flex w-full items-center gap-2.5 px-3 py-1.5 text-[13px] transition-colors",g?"text-oai-black dark:text-white bg-oai-gray-100 dark:bg-oai-gray-800":"text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-50 dark:hover:bg-oai-gray-800/60 hover:text-oai-black dark:hover:text-white"),children:[T.jsx(p,{className:"h-3.5 w-3.5 shrink-0","aria-hidden":!0}),T.jsx("span",{children:f})]},h)})})]})}function yS({collapsed:e,onToggleCollapsed:t,onItemClick:n,showCloseButton:a=!1,onClose:i,glassChrome:s=!1}){const u=Mn()?.pathname||"/",{theme:h,resolvedTheme:f,setTheme:p}=i8(),{resolvedLocale:g}=ql(),v=b.useMemo(()=>gS(),[g]);return T.jsxs(T.Fragment,{children:[T.jsx("div",{className:St("px-2 pt-2 pb-2",e&&"flex justify-center"),children:a?T.jsxs("div",{className:"flex items-center gap-2",children:[T.jsx("div",{className:"flex-1 min-w-0",children:T.jsx(A0,{variant:"sidebar",collapsed:e,onAfterAction:n})}),T.jsx("button",{type:"button",onClick:i,"aria-label":De("nav.close_menu"),title:De("nav.close_menu"),className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-oai-gray-500 dark:text-oai-gray-500 hover:bg-oai-gray-200/60 dark:hover:bg-oai-gray-800 hover:text-oai-gray-900 dark:hover:text-oai-gray-200 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500",children:T.jsx(gg,{className:"h-4 w-4",strokeWidth:1.75,"aria-hidden":!0})})]}):T.jsx(A0,{variant:"sidebar",collapsed:e,onAfterAction:n})}),T.jsx("nav",{"aria-label":De("nav.nav_label"),className:"flex-1 px-2 pb-2 flex flex-col overflow-y-auto",children:v.map((_,w)=>T.jsxs("div",{className:"flex flex-col",children:[T.jsx(h8,{label:_.label,collapsed:e,first:w===0}),T.jsx("div",{className:"flex flex-col gap-0.5",children:_.items.filter(S=>!(S.to==="/widgets"&&hg())).map(S=>T.jsx(f8,{item:S,collapsed:e,active:d8(u,S.to),onClick:n},S.id))})]},_.id))}),T.jsxs("div",{className:St("flex items-center px-2 py-3",e?"flex-col justify-center gap-2":"justify-between gap-2"),children:[T.jsx(y8,{theme:h,resolvedTheme:f,onSetTheme:p,glassChrome:s}),T.jsx("div",{className:"flex items-center gap-1.5",children:!e&&T.jsx(m8,{glassChrome:s})})]})]})}function v8({collapsed:e,onToggleCollapsed:t}){const n=b.useMemo(()=>typeof window>"u"?!1:Ca()||jd(),[]);return T.jsx("aside",{"aria-label":De("nav.aside_label"),className:St("hidden lg:flex flex-col shrink-0 h-full min-h-0 transition-[width] duration-200",e?"w-[72px]":"w-[220px]"),children:T.jsx(yS,{collapsed:e,onToggleCollapsed:t,glassChrome:n})})}function b8({open:e,onClose:t}){return b.useEffect(()=>{if(!e)return;const n=a=>{a.key==="Escape"&&t()};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[e,t]),b.useEffect(()=>{if(!e)return;const n=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=n}},[e]),e?T.jsxs("div",{className:"lg:hidden fixed inset-0 z-[80] flex",children:[T.jsx("div",{className:"absolute inset-0 bg-black/40 backdrop-blur-sm",onClick:t,"aria-hidden":!0}),T.jsx("aside",{"aria-label":De("nav.aside_label"),className:"relative w-[260px] max-w-[80vw] flex flex-col bg-oai-white dark:bg-oai-gray-900 border-r border-oai-gray-200 dark:border-oai-gray-800 shadow-2xl",children:T.jsx(yS,{collapsed:!1,showCloseButton:!0,onClose:t,onItemClick:t})})]}):null}function k8({onOpenDrawer:e}){return T.jsxs("div",{className:"lg:hidden flex items-center justify-between gap-2 px-3 h-14 border-b border-oai-gray-200 dark:border-oai-gray-800",children:[T.jsx(p8,{title:De("nav.menu"),onClick:e,children:T.jsx(SI,{className:"h-5 w-5","aria-hidden":!0})}),T.jsxs(Rd,{to:"/landing",className:"flex items-center gap-2 no-underline hover:opacity-80 transition-opacity","aria-label":"Token Tracker",children:[T.jsx("img",{src:"/app-icon.png",alt:"",width:24,height:24,className:"rounded-md"}),T.jsx("span",{className:"text-sm font-semibold text-oai-black dark:text-oai-white",children:"Token Tracker"})]}),T.jsx("div",{className:"w-10 shrink-0","aria-hidden":!0})]})}function _8({children:e}){const{collapsed:t,toggle:n}=u8(),[a,i]=b.useState(!1),s=b.useCallback(()=>i(!0),[]),l=b.useCallback(()=>i(!1),[]),u=b.useMemo(()=>typeof window>"u"?!1:Ca()||jd(),[]);return T.jsxs("div",{className:St("fixed inset-0 flex flex-col text-oai-black dark:text-oai-white font-sans overflow-hidden",hg()&&"tt-native-glass-shell",u?"bg-transparent":"bg-oai-gray-100 dark:bg-oai-gray-950"),children:[u&&T.jsx("div",{className:"h-7 shrink-0",style:{WebkitAppRegion:"drag"},"aria-hidden":!0}),T.jsxs("div",{className:"flex-1 min-h-0 flex",children:[T.jsx(v8,{collapsed:t,onToggleCollapsed:n}),T.jsx(b8,{open:a,onClose:l}),T.jsx("div",{className:"flex-1 min-w-0 min-h-0 p-2 lg:pl-0 lg:pr-3 lg:pb-3 flex flex-col",children:T.jsxs("div",{className:St("flex-1 min-h-0 flex flex-col bg-oai-white dark:bg-oai-gray-900 border border-oai-gray-200 dark:border-oai-gray-800 overflow-hidden",u?"tt-native-main-card":"rounded-2xl",!u&&"shadow-sm"),children:[T.jsx(k8,{onOpenDrawer:s}),T.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto",children:e})]})})]})]})}function w8({size:e=16,className:t=""}){return T.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:t,children:T.jsx("path",{d:"M4.709 15.955l4.72-2.647.08-.23-.08-.128H9.2l-.79-.048-2.698-.073-2.339-.097-2.266-.122-.571-.121L0 11.784l.055-.352.48-.321.686.06 1.52.103 2.278.158 1.652.097 2.449.255h.389l.055-.157-.134-.098-.103-.097-2.358-1.596-2.552-1.688-1.336-.972-.724-.491-.364-.462-.158-1.008.656-.722.881.06.225.061.893.686 1.908 1.476 2.491 1.833.365.304.145-.103.019-.073-.164-.274-1.355-2.446-1.446-2.49-.644-1.032-.17-.619a2.97 2.97 0 01-.104-.729L6.283.134 6.696 0l.996.134.42.364.62 1.414 1.002 2.229 1.555 3.03.456.898.243.832.091.255h.158V9.01l.128-1.706.237-2.095.23-2.695.08-.76.376-.91.747-.492.584.28.48.685-.067.444-.286 1.851-.559 2.903-.364 1.942h.212l.243-.242.985-1.306 1.652-2.064.73-.82.85-.904.547-.431h1.033l.76 1.129-.34 1.166-1.064 1.347-.881 1.142-1.264 1.7-.79 1.36.073.11.188-.02 2.856-.606 1.543-.28 1.841-.315.833.388.091.395-.328.807-1.969.486-2.309.462-3.439.813-.042.03.049.061 1.549.146.662.036h1.622l3.02.225.79.522.474.638-.079.485-1.215.62-1.64-.389-3.829-.91-1.312-.329h-.182v.11l1.093 1.068 2.006 1.81 2.509 2.33.127.578-.322.455-.34-.049-2.205-1.657-.851-.747-1.926-1.62h-.128v.17l.444.649 2.345 3.521.122 1.08-.17.353-.608.213-.668-.122-1.374-1.925-1.415-2.167-1.143-1.943-.14.08-.674 7.254-.316.37-.729.28-.607-.461-.322-.747.322-1.476.389-1.924.315-1.53.286-1.9.17-.632-.012-.042-.14.018-1.434 1.967-2.18 2.945-1.726 1.845-.414.164-.717-.37.067-.662.401-.589 2.388-3.036 1.44-1.882.93-1.086-.006-.158h-.055L4.132 18.56l-1.13.146-.487-.456.061-.746.231-.243 1.908-1.312-.006.006z"})})}function x8({size:e=16,className:t=""}){return T.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",className:t,children:T.jsx("path",{d:"M8.086.457a6.105 6.105 0 013.046-.415c1.333.153 2.521.72 3.564 1.7a.117.117 0 00.107.029c1.408-.346 2.762-.224 4.061.366l.063.03.154.076c1.357.703 2.33 1.77 2.918 3.198.278.679.418 1.388.421 2.126a5.655 5.655 0 01-.18 1.631.167.167 0 00.04.155 5.982 5.982 0 011.578 2.891c.385 1.901-.01 3.615-1.183 5.14l-.182.22a6.063 6.063 0 01-2.934 1.851.162.162 0 00-.108.102c-.255.736-.511 1.364-.987 1.992-1.199 1.582-2.962 2.462-4.948 2.451-1.583-.008-2.986-.587-4.21-1.736a.145.145 0 00-.14-.032c-.518.167-1.04.191-1.604.185a5.924 5.924 0 01-2.595-.622 6.058 6.058 0 01-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74 7.74 0 01-.495-1.283 6.11 6.11 0 01-.017-3.064.166.166 0 00.008-.074.115.115 0 00-.037-.064 5.958 5.958 0 01-1.38-2.202 5.196 5.196 0 01-.333-1.589 6.915 6.915 0 01.188-2.132c.45-1.484 1.309-2.648 2.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129 0 00.087-.087A6.016 6.016 0 015.635 2.31C6.315 1.464 7.132.846 8.086.457zm-.804 7.85a.848.848 0 00-1.473.842l1.694 2.965-1.688 2.848a.849.849 0 001.46.864l1.94-3.272a.849.849 0 00.007-.854l-1.94-3.393zm5.446 6.24a.849.849 0 000 1.695h4.848a.849.849 0 000-1.696h-4.848z"})})}function P8({size:e=16,className:t=""}){return T.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:t,children:T.jsx("path",{d:"M22.106 5.68L12.5.135a.998.998 0 00-.998 0L1.893 5.68a.84.84 0 00-.419.726v11.186c0 .3.16.577.42.727l9.607 5.547a.999.999 0 00.998 0l9.608-5.547a.84.84 0 00.42-.727V6.407a.84.84 0 00-.42-.726zm-.603 1.176L12.228 22.92c-.063.108-.228.064-.228-.061V12.34a.59.59 0 00-.295-.51l-9.11-5.26c-.107-.062-.063-.228.062-.228h18.55c.264 0 .428.286.296.514z"})})}function S8({size:e=16,className:t=""}){return T.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:t,children:T.jsx("path",{d:"M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z"})})}function C8({size:e=16,className:t=""}){return T.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:t,children:T.jsx("path",{d:"M9.27 15.29l7.978-5.897c.391-.29.95-.177 1.137.272.98 2.369.542 5.215-1.41 7.169-1.951 1.954-4.667 2.382-7.149 1.406l-2.711 1.257c3.889 2.661 8.611 2.003 11.562-.953 2.341-2.344 3.066-5.539 2.388-8.42l.006.007c-.983-4.232.242-5.924 2.75-9.383.06-.082.12-.164.179-.248l-3.301 3.305v-.01L9.267 15.292M7.623 16.723c-2.792-2.67-2.31-6.801.071-9.184 1.761-1.763 4.647-2.483 7.166-1.425l2.705-1.25a7.808 7.808 0 00-1.829-1A8.975 8.975 0 005.984 5.83c-2.533 2.536-3.33 6.436-1.962 9.764 1.022 2.487-.653 4.246-2.34 6.022-.599.63-1.199 1.259-1.682 1.925l7.62-6.815"})})}function T8({size:e=16,className:t=""}){return T.jsx("svg",{width:e,height:e,viewBox:"0 -1 22 28",fill:"currentColor",fillRule:"evenodd",className:t,children:T.jsx("path",{d:"M4.125 20.149c-2.69 5.959 3.036 7.453 7.26 3.966 1.24 3.91 5.898.993 7.569-2.036 3.682-6.678 2.195-13.49 1.813-14.895-2.617-9.582-15.699-9.592-17.95.049-.526 1.687-.535 3.606-.833 5.598-.15 1.005-.256 1.646-.645 2.703-.223.607-.53 1.147-1.014 2.056-.75 1.412-.434 4.138 3.434 2.724v.001ZM11.895 11.332c-1.073 0-1.234-1.283-1.234-2.048 0-.69.124-1.239.358-1.586a1 1 0 0 1 .876-.462c.375 0 .697.158.924.47.259.354.395.9.395 1.578 0 1.283-.493 2.048-1.319 2.048Zm4.416 0c-1.073 0-1.234-1.283-1.234-2.048 0-.69.124-1.239.358-1.586a1 1 0 0 1 .876-.462c.375 0 .697.158.924.47.259.354.396.9.396 1.578 0 1.283-.494 2.048-1.32 2.048Z"})})}function E8({size:e=16,className:t=""}){return T.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:t,children:T.jsx("path",{d:"M16 6H8v12h8V6zm4 16H4V2h16v20z"})})}function A8({size:e=16,className:t=""}){return T.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:t,children:[T.jsx("path",{d:"M21.846 0a1.923 1.923 0 110 3.846H20.15a.226.226 0 01-.227-.226V1.923C19.923.861 20.784 0 21.846 0z"}),T.jsx("path",{d:"M11.065 11.199l7.257-7.2c.137-.136.06-.41-.116-.41H14.3a.164.164 0 00-.117.051l-7.82 7.756c-.122.12-.302.013-.302-.179V3.82c0-.127-.083-.23-.185-.23H3.186c-.103 0-.186.103-.186.23V19.77c0 .128.083.23.186.23h2.69c.103 0 .186-.102.186-.23v-3.25c0-.069.025-.135.069-.178l2.424-2.406a.158.158 0 01.205-.023l6.484 4.772a7.677 7.677 0 003.453 1.283c.108.012.2-.095.2-.23v-3.06c0-.117-.07-.212-.164-.227a5.028 5.028 0 01-2.027-.807l-5.613-4.064c-.117-.078-.132-.279-.028-.381z"})]})}function R8({size:e=16,className:t=""}){return T.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:t,children:T.jsx("path",{d:"M19.245 5.364c1.322 1.36 1.877 3.216 2.11 5.817.622 0 1.2.135 1.592.654l.73.964c.21.278.323.61.323.955v2.62c0 .339-.173.669-.453.868C20.239 19.602 16.157 21.5 12 21.5c-4.6 0-9.205-2.583-11.547-4.258-.28-.2-.452-.53-.453-.868v-2.62c0-.345.113-.679.321-.956l.73-.963c.392-.517.974-.654 1.593-.654l.029-.297c.25-2.446.81-4.213 2.082-5.52 2.461-2.54 5.71-2.851 7.146-2.864h.198c1.436.013 4.685.323 7.146 2.864zm-7.244 4.328c-.284 0-.613.016-.962.05-.123.447-.305.85-.57 1.108-1.05 1.023-2.316 1.18-2.994 1.18-.638 0-1.306-.13-1.851-.464-.516.165-1.012.403-1.044.996a65.882 65.882 0 00-.063 2.884l-.002.48c-.002.563-.005 1.126-.013 1.69.002.326.204.63.51.765 2.482 1.102 4.83 1.657 6.99 1.657 2.156 0 4.504-.555 6.985-1.657a.854.854 0 00.51-.766c.03-1.682.006-3.372-.076-5.053-.031-.596-.528-.83-1.046-.996-.546.333-1.212.464-1.85.464-.677 0-1.942-.157-2.993-1.18-.266-.258-.447-.661-.57-1.108-.32-.032-.64-.049-.96-.05zm-2.525 4.013c.539 0 .976.426.976.95v1.753c0 .525-.437.95-.976.95a.964.964 0 01-.976-.95v-1.752c0-.525.437-.951.976-.951zm5 0c.539 0 .976.426.976.95v1.753c0 .525-.437.95-.976.95a.964.964 0 01-.976-.95v-1.752c0-.525.437-.951.976-.951zM7.635 5.087c-1.05.102-1.935.438-2.385.906-.975 1.037-.765 3.668-.21 4.224.405.394 1.17.657 1.995.657h.09c.649-.013 1.785-.176 2.73-1.11.435-.41.705-1.433.675-2.47-.03-.834-.27-1.52-.63-1.813-.39-.336-1.275-.482-2.265-.394zm6.465.394c-.36.292-.6.98-.63 1.813-.03 1.037.24 2.06.675 2.47.968.957 2.136 1.104 2.776 1.11h.044c.825 0 1.59-.263 1.995-.657.555-.556.765-3.187-.21-4.224-.45-.468-1.335-.804-2.385-.906-.99-.088-1.875.058-2.265.394zM12 7.615c-.24 0-.525.015-.84.044.03.16.045.336.06.526l-.001.159a2.94 2.94 0 01-.014.25c.225-.022.425-.027.612-.028h.366c.187 0 .387.006.612.028-.015-.146-.015-.277-.015-.409.015-.19.03-.365.06-.526a9.29 9.29 0 00-.84-.044z"})})}function L8({size:e=16,className:t=""}){return T.jsxs("svg",{width:e,height:e,viewBox:"0 0 64 60",fill:"none",className:t,"aria-hidden":"true",children:[T.jsx("path",{fill:"currentColor",d:"M37.2114 3.75318C37.6821 3.33106 37.7106 3.31457 38.0558 3.29385C38.6149 3.2531 39.1272 3.52199 39.9989 4.31564C42.0356 6.16652 44.8714 9.97183 46.6346 13.2212L47.3163 14.4819L48.2782 14.9605C49.2072 15.4299 50.7308 16.3923 51.3672 16.9085C51.655 17.1464 51.6956 17.1508 51.9947 17.0344C53.3454 16.5084 55.2803 17.206 56.9869 18.8432C58.5231 20.3155 59.9943 22.8312 60.558 24.9308C60.6403 25.2687 60.7493 25.9952 60.7891 26.5362C60.9177 28.4358 60.3092 29.9532 59.1362 30.64C58.8965 30.7784 58.8801 30.8158 58.8868 31.4132C58.9409 34.2583 58.1741 37.0985 56.6335 39.8679C54.8946 42.9773 51.7981 46.1938 47.6074 49.2243C45.357 50.8619 40.0323 53.964 37.6248 55.0532C31.8578 57.6496 27.2346 58.646 23.2188 58.154C20.8236 57.8638 18.1124 56.9287 16.5082 55.8433C16.086 55.5515 16.0191 55.5329 15.6966 55.6251C13.9793 56.1185 11.73 55.1053 9.81931 52.9844C9.05725 52.1366 7.82714 50.0548 7.42839 48.9409C6.50606 46.3339 6.68976 43.9816 7.91836 42.5767C8.23573 42.2149 8.2453 42.1995 8.17598 41.5912C8.06148 40.5951 8.00971 39.1206 8.06202 38.1692L8.10361 37.2803L6.76977 34.9212C4.70378 31.2451 3.3912 28.1582 2.88489 25.7998C2.61762 24.5066 2.63385 23.9324 2.96214 23.5078C3.16198 23.2515 3.81796 22.9866 4.60785 22.8407C6.59665 22.4917 10.9334 22.8076 15.7581 23.6595L16.259 23.7458L17.3608 22.7713C19.1891 21.1519 20.4038 20.244 22.6429 18.8478C24.9768 17.3876 27.6108 16.1858 30.577 15.2346L31.5295 14.9294L32.0526 13.5561C33.9257 8.61146 35.8437 4.96584 37.2114 3.75318ZM21.5208 29.0919C19.404 30.314 18.3453 30.9251 17.5676 31.6099C14.4179 34.3835 13.2414 38.777 14.5823 42.7537C14.9135 43.7357 15.5247 44.7942 16.7469 46.9111C17.9691 49.0279 18.5801 50.0865 19.2649 50.8643C22.0385 54.014 26.4316 55.1918 30.4084 53.8509C31.3904 53.5198 32.4489 52.9085 34.5657 51.6863L46.7442 44.6551C48.8613 43.4328 49.9205 42.8214 50.6983 42.1365C53.8479 39.363 55.0245 34.9695 53.6835 30.9927C53.3524 30.0107 52.7412 28.9522 51.519 26.8354C50.2968 24.7185 49.6858 23.66 49.0009 22.8822C46.2274 19.7325 41.8342 18.5547 37.8575 19.8956C36.8754 20.2267 35.8163 20.8383 33.6993 22.0606L21.5208 29.0919Z"}),T.jsx("g",{transform:"rotate(-30 22.6953 37.6011)",children:T.jsx("rect",{x:"22.6953",y:"37.6011",width:"4.81084",height:"9.99175",rx:"2.40542",fill:"currentColor"})}),T.jsx("g",{transform:"rotate(-30 35.6748 30.1074)",children:T.jsx("rect",{x:"35.6748",y:"30.1074",width:"4.81084",height:"9.99175",rx:"2.40542",fill:"currentColor"})})]})}function D8({size:e=16,className:t=""}){return T.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",className:t,children:T.jsx("path",{d:"M7 2h10a5 5 0 015 5v10a5 5 0 01-5 5H7a5 5 0 01-5-5V7a5 5 0 015-5zm0 4.5v11h2.35v-4.55h5.3V17.5H17v-11h-2.35v4.1h-5.3V6.5H7z"})})}function M8({size:e=16,className:t=""}){return T.jsx("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"currentColor",className:t,children:T.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8z"})})}function I8({size:e=16,className:t=""}){return T.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,"aria-hidden":"true",children:T.jsx("g",{transform:"translate(3.4502, 3)",fill:"#9570BE",children:T.jsx("path",{d:"M3.17890888,3.6 L3.17890888,0 L16,0 L16,3.6 L3.17890888,3.6 Z M9.642,7.2 L9.64218223,10.8 L0,10.8 L0,3.6 L16,3.6 L16,7.2 L9.642,7.2 Z M3.17890888,18 L3.178,14.4 L0,14.4 L0,10.8 L16,10.8 L16,18 L3.17890888,18 Z",fillRule:"nonzero"})})})}function N8({size:e=16,className:t=""}){return T.jsxs("svg",{width:e,height:e,viewBox:"0 0 120 90",fill:"currentColor",className:t,children:[T.jsx("rect",{x:"10",y:"8",width:"100",height:"12",rx:"2"}),T.jsx("rect",{x:"25",y:"20",width:"12",height:"62",rx:"2"}),T.jsx("rect",{x:"75",y:"20",width:"12",height:"45",rx:"2"}),T.jsx("rect",{x:"71",y:"55",width:"20",height:"16",rx:"3"}),T.jsx("rect",{x:"76",y:"71",width:"3",height:"8",rx:"1"}),T.jsx("rect",{x:"82",y:"71",width:"3",height:"8",rx:"1"})]})}function O8({size:e=16,className:t=""}){return T.jsxs("svg",{width:e,height:e,viewBox:"0 0 120 90",fill:"currentColor",className:t,children:[T.jsx("rect",{x:"10",y:"8",width:"100",height:"12",rx:"2"}),T.jsx("rect",{x:"25",y:"20",width:"12",height:"62",rx:"2"}),T.jsx("rect",{x:"83",y:"20",width:"12",height:"62",rx:"2"})]})}function j8({size:e=16,className:t=""}){return T.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[T.jsx("path",{d:"M9 3v2"}),T.jsx("path",{d:"M15 3v2"}),T.jsx("rect",{x:"4",y:"6",width:"16",height:"13",rx:"3"}),T.jsx("circle",{cx:"9",cy:"13",r:"1.4",fill:"currentColor",stroke:"none"}),T.jsx("circle",{cx:"15",cy:"13",r:"1.4",fill:"currentColor",stroke:"none"}),T.jsx("path",{d:"M9 16h6"})]})}const U8={CLAUDE:w8,CODEBUDDY:L8,CODEX:x8,COPILOT:R8,CRAFT:I8,CURSOR:P8,DROID:j8,GEMINI:S8,GITHUB:M8,GROK:C8,HERMES:D8,KIMI:A8,KIRO:T8,OPENCODE:E8,OMP:N8,PI:O8},B8={ANTIGRAVITY:"/brand-logos/antigravity.svg",CLAUDE:"/brand-logos/claude-code.svg",CODEX:"/brand-logos/codex.svg",GEMINI:"/brand-logos/gemini.svg",HERMES:"/brand-logos/hermes.svg","KILO-CLI":"/brand-logos/kilo.svg","KILO-CODE":"/brand-logos/kilo.svg",OPENCLAW:"/brand-logos/openclaw.svg",OPENCODE:"/brand-logos/opencode.svg"};function F8({size:e=16,className:t=""}){return T.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:T.jsx("circle",{cx:"12",cy:"12",r:"7.5",strokeDasharray:"3 3"})})}function z8({provider:e,size:t=16,color:n,className:a=""}){const i=e?.toUpperCase?.()||"",s=B8[i];if(s)return T.jsx("img",{src:s,alt:"",width:t,height:t,className:a,style:{width:t,height:t,objectFit:"contain"},"aria-hidden":!0});const l=U8[i];return l?T.jsx(l,{size:t,className:a}):T.jsx(F8,{size:t,className:`text-oai-gray-400 dark:text-oai-gray-500 shrink-0 ${a}`})}const vS="tokentracker-skills";async function no(e){const t=new URL(`/functions/${vS}`,window.location.origin);if(e)for(const[i,s]of Object.entries(e))s!=null&&s!==""&&t.searchParams.set(i,String(s));const n=await fetch(t.toString(),{headers:{Accept:"application/json"},cache:"no-store"}),a=await n.json().catch(()=>null);if(!n.ok)throw new Error(a?.error||`Request failed with HTTP ${n.status}`);return a}async function hi(e){const t=await Od(),n=await fetch(`/functions/${vS}`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json",...t},cache:"no-store",body:JSON.stringify(e)}),a=await n.json().catch(()=>null);if(!n.ok||a?.ok===!1)throw new Error(a?.error||`Request failed with HTTP ${n.status}`);return a}function V8(){return no({mode:"installed"})}function RB(e={}){return no({mode:"discover",...e.force?{force:1}:{}})}function LB(e,t=0,n=20){return no({mode:"search",q:e,offset:t,limit:n})}function DB(){return no({mode:"repos"})}function MB(e,t){return hi({action:"install",skill:e,targets:t})}function IB(e){return hi({action:"uninstall",id:e})}function NB(e){return hi({action:"restore",id:e})}function OB(e,t){return hi({action:"set_targets",id:e,targets:t})}function jB(e,t){return hi({action:"import_local",directory:e,targets:t})}function UB(e,t){return hi({action:"delete_local",directory:e,targets:t||[]})}function BB(e){return hi({action:"add_repo",repo:e})}function FB(e,t){return hi({action:"remove_repo",owner:e,name:t})}function zB(e={}){return no({mode:"popular",...e.force?{force:1}:{}})}function VB(e={}){return no({mode:"updates",...e.force?{force:1}:{}})}function $B(e={}){return no({mode:"skill_usage",...e.force?{force:1}:{}})}const $8=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1");function H8(){const e=ss(),t=W6(),[n,a]=b.useState(!1),[i,s]=b.useState(""),[l,u]=b.useState(0),[h,f]=b.useState([]),p=b.useRef(null),g=b.useRef(null);b.useEffect(()=>{const E=A=>{(A.metaKey||A.ctrlKey)&&(A.key==="k"||A.key==="K")&&(A.preventDefault(),a(z=>!z))};return window.addEventListener("keydown",E),()=>window.removeEventListener("keydown",E)},[]),b.useEffect(()=>{if(!n)return;s(""),u(0);const E=requestAnimationFrame(()=>p.current?.focus());return $8&&!h.length&&V8().then(A=>f(A?.skills||[])).catch(()=>f([])),()=>cancelAnimationFrame(E)},[n,h.length]);const v=b.useMemo(()=>{const E=gS().flatMap(U=>U.items.map(z=>({kind:"page",id:`page:${z.id}`,label:z.label,sub:De("cmdk.group.pages"),Icon:z.icon,run:()=>e(z.to)}))),A=(h||[]).map(U=>({kind:"skill",id:`skill:${U.id||U.directory}`,label:U.name||U.directory,sub:U.repoOwner&&U.repoName?`${U.repoOwner}/${U.repoName}`:De("cmdk.group.skills"),provider:(U.targets||[])[0]||"claude",run:()=>e(`/skills?skill=${encodeURIComponent(U.directory||U.id)}`)}));return[...E,...A]},[e,h]),_=b.useMemo(()=>{const E=i.trim().toLowerCase();return E?v.filter(A=>A.label.toLowerCase().includes(E)||String(A.sub||"").toLowerCase().includes(E)):v},[v,i]);b.useEffect(()=>{l>=_.length&&u(_.length?_.length-1:0)},[l,_.length]),b.useEffect(()=>{if(!n)return;g.current?.querySelector(`[data-cmdk-index="${l}"]`)?.scrollIntoView({block:"nearest"})},[l,n]);const w=b.useCallback(()=>a(!1),[]),S=b.useCallback(E=>{E&&(w(),E.run())},[w]),P=E=>{E.key==="ArrowDown"?(E.preventDefault(),u(A=>Math.min(A+1,Math.max(0,_.length-1)))):E.key==="ArrowUp"?(E.preventDefault(),u(A=>Math.max(A-1,0))):E.key==="Enter"?(E.preventDefault(),S(_[l])):E.key==="Escape"&&(E.preventDefault(),w())},D={duration:t?0:.12},R=t?{duration:0}:{type:"spring",stiffness:460,damping:34,mass:.6};return T.jsx(FP,{children:n?T.jsxs(Cl.div,{className:"fixed inset-0 z-[120] flex items-start justify-center px-4 pt-[16vh]",initial:t?!1:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:D,children:[T.jsx("button",{type:"button","aria-label":De("cmdk.close"),onClick:w,className:"absolute inset-0 cursor-default bg-oai-black/40"}),T.jsxs(Cl.div,{role:"dialog","aria-modal":"true","aria-label":De("cmdk.open_aria"),initial:t?!1:{opacity:0,y:-8,scale:.985},animate:{opacity:1,y:0,scale:1},exit:t?{opacity:0}:{opacity:0,y:-8,scale:.985},transition:R,className:"relative w-full max-w-xl overflow-hidden rounded-2xl border border-oai-gray-200 bg-oai-white shadow-2xl dark:border-oai-gray-800 dark:bg-oai-gray-950",children:[T.jsxs("div",{className:"flex items-center gap-2.5 border-b border-oai-gray-200 px-4 dark:border-oai-gray-800",children:[T.jsx(II,{className:"h-4 w-4 shrink-0 text-oai-gray-400","aria-hidden":!0}),T.jsx("input",{ref:p,type:"text",value:i,onChange:E=>{s(E.target.value),u(0)},onKeyDown:P,"aria-label":De("cmdk.placeholder"),"aria-controls":"cmdk-listbox","aria-activedescendant":_[l]?`cmdk-opt-${l}`:void 0,role:"combobox","aria-expanded":"true",placeholder:De("cmdk.placeholder"),className:"h-12 w-full bg-transparent text-sm text-oai-black placeholder:text-oai-gray-400 focus:outline-none dark:text-white"})]}),T.jsx("div",{ref:g,id:"cmdk-listbox",role:"listbox",className:"max-h-[min(56vh,22rem)] overflow-y-auto p-1.5",children:_.length===0?T.jsx("div",{className:"px-3 py-8 text-center text-sm text-oai-gray-500 dark:text-oai-gray-400",children:De("cmdk.empty")}):_.map((E,A)=>{const U=A===l;return T.jsxs("button",{type:"button",role:"option",id:`cmdk-opt-${A}`,"data-cmdk-index":A,"aria-selected":U,onMouseMove:()=>u(A),onClick:()=>S(E),className:St("flex w-full items-center gap-3 rounded-lg px-3 py-2 text-left text-sm transition-colors",U?"bg-oai-gray-100 text-oai-black dark:bg-oai-gray-800/70 dark:text-white":"text-oai-gray-700 dark:text-oai-gray-200"),children:[T.jsx("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center text-oai-gray-500 dark:text-oai-gray-400",children:E.kind==="skill"?T.jsx(z8,{provider:E.provider,size:16}):T.jsx(E.Icon,{className:"h-4 w-4","aria-hidden":!0})}),T.jsx("span",{className:"min-w-0 flex-1 truncate font-medium",children:E.label}),T.jsx("span",{className:"shrink-0 truncate text-xs text-oai-gray-400 dark:text-oai-gray-500",children:E.sub}),U?T.jsx(mI,{className:"h-3.5 w-3.5 shrink-0 text-oai-gray-400","aria-hidden":!0}):null]},E.id)})})]})]}):null})}const W8=[];function Yg(e){b.useEffect(e,W8)}const R0={};function ys(e,t){const n=b.useRef(R0);return n.current===R0&&(n.current=e(t)),n}function G8(e,t){return function(a,...i){const s=new URL(e);return s.searchParams.set("code",a.toString()),i.forEach(l=>s.searchParams.append("args[]",l)),`${t} error #${a}; visit ${s} for the full message.`}}const vs=G8("https://base-ui.com/production-error","Base UI"),Zg=b.createContext(void 0);function Xg(){const e=b.useContext(Zg);if(!e)throw new Error(vs(73));return e}const _a=(e,t,n,a,i,s,...l)=>{if(l.length>0)throw new Error(vs(1));let u;if(e&&t&&n&&a&&i&&s)u=(h,f,p,g)=>{const v=e(h,f,p,g),_=t(h,f,p,g),w=n(h,f,p,g),S=a(h,f,p,g),P=i(h,f,p,g);return s(v,_,w,S,P,f,p,g)};else if(e&&t&&n&&a&&i)u=(h,f,p,g)=>{const v=e(h,f,p,g),_=t(h,f,p,g),w=n(h,f,p,g),S=a(h,f,p,g);return i(v,_,w,S,f,p,g)};else if(e&&t&&n&&a)u=(h,f,p,g)=>{const v=e(h,f,p,g),_=t(h,f,p,g),w=n(h,f,p,g);return a(v,_,w,f,p,g)};else if(e&&t&&n)u=(h,f,p,g)=>{const v=e(h,f,p,g),_=t(h,f,p,g);return n(v,_,f,p,g)};else if(e&&t)u=(h,f,p,g)=>{const v=e(h,f,p,g);return t(v,f,p,g)};else if(e)u=e;else throw new Error("Missing arguments");return u};var cp={exports:{}},up={};var L0;function K8(){if(L0)return up;L0=1;var e=Bl();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,a=e.useState,i=e.useEffect,s=e.useLayoutEffect,l=e.useDebugValue;function u(g,v){var _=v(),w=a({inst:{value:_,getSnapshot:v}}),S=w[0].inst,P=w[1];return s(function(){S.value=_,S.getSnapshot=v,h(S)&&P({inst:S})},[g,_,v]),i(function(){return h(S)&&P({inst:S}),g(function(){h(S)&&P({inst:S})})},[g]),l(_),_}function h(g){var v=g.getSnapshot;g=g.value;try{var _=v();return!n(g,_)}catch{return!0}}function f(g,v){return v()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:u;return up.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,up}var D0;function bS(){return D0||(D0=1,cp.exports=K8()),cp.exports}var q8=bS(),dp={exports:{}},hp={};var M0;function Y8(){if(M0)return hp;M0=1;var e=Bl(),t=bS();function n(f,p){return f===p&&(f!==0||1/f===1/p)||f!==f&&p!==p}var a=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,s=e.useRef,l=e.useEffect,u=e.useMemo,h=e.useDebugValue;return hp.useSyncExternalStoreWithSelector=function(f,p,g,v,_){var w=s(null);if(w.current===null){var S={hasValue:!1,value:null};w.current=S}else S=w.current;w=u(function(){function D(z){if(!R){if(R=!0,E=z,z=v(z),_!==void 0&&S.hasValue){var j=S.value;if(_(j,z))return A=j}return A=z}if(j=A,a(E,z))return j;var C=v(z);return _!==void 0&&_(j,C)?(E=z,j):(E=z,A=C)}var R=!1,E,A,U=g===void 0?null:g;return[function(){return D(p())},U===null?void 0:function(){return D(U())}]},[p,g,v,_]);var P=i(f,w[0],w[1]);return l(function(){S.hasValue=!0,S.value=P},[P]),h(P),P},hp}var I0;function Z8(){return I0||(I0=1,dp.exports=Y8()),dp.exports}var X8=Z8();const Q8=parseInt(b.version,10);function Qg(e){return Q8>=e}const J8=Qg(19),eU=J8?nU:aU;function kS(e,t,n,a,i){return eU(e,t,n,a,i)}function tU(e,t,n,a,i){const s=b.useCallback(()=>t(e.getSnapshot(),n,a,i),[e,t,n,a,i]);return q8.useSyncExternalStore(e.subscribe,s,s)}function nU(e,t,n,a,i){return tU(e,t,n,a,i)}function aU(e,t,n,a,i){return X8.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,s=>t(s,n,a,i))}class rU{constructor(t){this.state=t,this.listeners=new Set,this.updateTick=0}subscribe=t=>(this.listeners.add(t),()=>{this.listeners.delete(t)});getSnapshot=()=>this.state;setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const a of this.listeners){if(n!==this.updateTick)return;a(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){this.setState({...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||this.setState({...this.state,[t]:n})}notifyAll(){const t={...this.state};this.setState(t)}use(t,n,a,i){return kS(this,t,n,a,i)}}const Jg={...J0},fp=Jg.useInsertionEffect,iU=fp&&fp!==Jg.useLayoutEffect?fp:e=>e();function Xi(e){const t=ys(oU).current;return t.next=e,iU(t.effect),t.trampoline}function oU(){const e={next:void 0,callback:sU,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function sU(){}const lU=()=>{},Ka=typeof document<"u"?b.useLayoutEffect:lU;function cU(){}const HB=Object.freeze([]),Fi=Object.freeze({});class uU extends rU{constructor(t,n={},a){super(t),this.context=n,this.selectors=a}useSyncedValue(t,n){b.useDebugValue(t);const a=this;Ka(()=>{a.state[t]!==n&&a.set(t,n)},[a,t,n])}useSyncedValueWithCleanup(t,n){const a=this;Ka(()=>(a.state[t]!==n&&a.set(t,n),()=>{a.set(t,void 0)}),[a,t,n])}useSyncedValues(t){const n=this,a=Object.values(t);Ka(()=>{n.update(t)},[n,...a])}useControlledProp(t,n){b.useDebugValue(t);const a=this,i=n!==void 0;Ka(()=>{i&&!Object.is(a.state[t],n)&&a.setState({...a.state,[t]:n})},[a,t,n,i])}select(t,n,a,i){const s=this.selectors[t];return s(this.state,n,a,i)}useState(t,n,a,i){return b.useDebugValue(t),kS(this,this.selectors[t],n,a,i)}useContextCallback(t,n){b.useDebugValue(t);const a=Xi(n??cU);this.context[t]=a}useStateSetter(t){const n=b.useRef(void 0);return n.current===void 0&&(n.current=a=>{this.set(t,a)}),n.current}observe(t,n){let a;typeof t=="function"?a=t:a=this.selectors[t];let i=a(this.state);return n(i,i,this),this.subscribe(s=>{const l=a(s);if(!Object.is(i,l)){const u=i;i=l,n(l,u,this)}})}}function Hd(){return typeof window<"u"}function Aa(e){return ey(e)?(e.nodeName||"").toLowerCase():"#document"}function xr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function dU(e){var t;return(t=(ey(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ey(e){return Hd()?e instanceof Node||e instanceof xr(e).Node:!1}function ty(e){return Hd()?e instanceof Element||e instanceof xr(e).Element:!1}function ci(e){return Hd()?e instanceof HTMLElement||e instanceof xr(e).HTMLElement:!1}function Pd(e){return!Hd()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof xr(e).ShadowRoot}function _S(e){const{overflow:t,overflowX:n,overflowY:a,display:i}=Wd(e);return/auto|scroll|overlay|hidden|clip/.test(t+a+n)&&i!=="inline"&&i!=="contents"}function WB(e){return/^(table|td|th)$/.test(Aa(e))}function hU(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const fU=/transform|translate|scale|rotate|perspective|filter/,pU=/paint|layout|strict|content/,Di=e=>!!e&&e!=="none";let pp;function mU(e){const t=ty(e)?Wd(e):e;return Di(t.transform)||Di(t.translate)||Di(t.scale)||Di(t.rotate)||Di(t.perspective)||!gU()&&(Di(t.backdropFilter)||Di(t.filter))||fU.test(t.willChange||"")||pU.test(t.contain||"")}function GB(e){let t=wm(e);for(;ci(t)&&!wS(t);){if(mU(t))return t;if(hU(t))return null;t=wm(t)}return null}function gU(){return pp==null&&(pp=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),pp}function wS(e){return/^(html|body|#document)$/.test(Aa(e))}function Wd(e){return xr(e).getComputedStyle(e)}function KB(e){return ty(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function wm(e){if(Aa(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Pd(e)&&e.host||dU(e);return Pd(t)?t.host:t}function xS(e){const t=wm(e);return wS(t)?e.ownerDocument?e.ownerDocument.body:e.body:ci(t)&&_S(t)?t:xS(t)}function N0(e,t,n){var a;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=xS(e),s=i===((a=e.ownerDocument)==null?void 0:a.body),l=xr(i);if(s){const u=yU(l);return t.concat(l,l.visualViewport||[],_S(i)?i:[],u&&n?N0(u):[])}else return t.concat(i,N0(i,[],n))}function yU(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function PS(...e){return()=>{for(let t=0;t<e.length;t+=1){const n=e[t];n&&n()}}}function Ta(e){return e?.ownerDocument||document}function zi(e,t,n,a){return e.addEventListener(t,n,a),()=>{e.removeEventListener(t,n,a)}}const ku=null;class vU{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=t=>{this.isScheduled=!1;const n=this.callbacks,a=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,a>0)for(let i=0;i<n.length;i+=1)n[i]?.(t)};request(t){const n=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,!this.isScheduled&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(t){const n=t-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}const _u=new vU;class ny{static create(){return new ny}static request(t){return _u.request(t)}static cancel(t){return _u.cancel(t)}currentId=ku;request(t){this.cancel(),this.currentId=_u.request(()=>{this.currentId=ku,t()})}cancel=()=>{this.currentId!==ku&&(_u.cancel(this.currentId),this.currentId=ku)};disposeEffect=()=>this.cancel}function bU(){const e=ys(ny.create).current;return Yg(e.disposeEffect),e}const cl=0;class Ul{static create(){return new Ul}currentId=cl;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=cl,n()},t)}isStarted(){return this.currentId!==cl}clear=()=>{this.currentId!==cl&&(clearTimeout(this.currentId),this.currentId=cl)};disposeEffect=()=>this.clear}function kU(){const e=ys(Ul.create).current;return Yg(e.disposeEffect),e}let O0=0;function SS(e){return O0+=1,`${e}-${Math.random().toString(36).slice(2,6)}-${O0}`}function mp(e,t){if(typeof e=="string")return{description:e};if(typeof e=="function"){const n=e(t);return typeof n=="string"?{description:n}:n}return e}const bs=typeof navigator<"u",gp=wU(),CS=PU(),TS=xU(),qB=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),YB=gp.platform==="MacIntel"&&gp.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(gp.platform),_U=bs&&/apple/i.test(navigator.vendor),xm=bs&&/android/i.test(CS)||/android/i.test(TS);bs&&CS.toLowerCase().startsWith("mac")&&navigator.maxTouchPoints;const ES=TS.includes("jsdom/");function wU(){if(!bs)return{platform:"",maxTouchPoints:-1};const e=navigator.userAgentData;return e?.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function xU(){if(!bs)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}function PU(){if(!bs)return"";const e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??""}const j0="data-base-ui-focusable",AS="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",yp="ArrowLeft",vp="ArrowRight",SU="ArrowUp",CU="ArrowDown";function Zo(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function Pr(e,t){if(!e||!t)return!1;const n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&Pd(n)){let a=t;for(;a;){if(e===a)return!0;a=a.parentNode||a.host}}return!1}function Vi(e){return"composedPath"in e?e.composedPath()[0]:e.target}function ZB(e,t){if(!ty(e))return!1;const n=e;if(t.hasElement(n))return!n.hasAttribute("data-trigger-disabled");for(const[,a]of t.entries())if(Pr(a,n))return!a.hasAttribute("data-trigger-disabled");return!1}function XB(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function QB(e){return e.matches("html,body")}function TU(e){return ci(e)&&e.matches(AS)}function JB(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${AS}`)!=null}function eF(e){return e?e.getAttribute("role")==="combobox"&&TU(e):!1}function Pm(e){if(!e||ES)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function tF(e){return e?e.hasAttribute(j0)?e:e.querySelector(`[${j0}]`)||e:null}function bp(e){e.preventDefault(),e.stopPropagation()}function nF(e){return"nativeEvent"in e}function aF(e){return e.pointerType===""&&e.isTrusted?!0:xm&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function rF(e){return ES?!1:!xm&&e.width===0&&e.height===0||xm&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function iF(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function oF(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const sF=["top","right","bottom","left"],EU=Math.min,AU=Math.max,lF=Math.round,kp=Math.floor,cF=e=>({x:e,y:e}),RU={left:"right",right:"left",bottom:"top",top:"bottom"};function uF(e,t,n){return AU(e,EU(t,n))}function dF(e,t){return typeof e=="function"?e(t):e}function RS(e){return e.split("-")[0]}function LS(e){return e.split("-")[1]}function LU(e){return e==="x"?"y":"x"}function DU(e){return e==="y"?"height":"width"}function MU(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function IU(e){return LU(MU(e))}function hF(e,t,n){n===void 0&&(n=!1);const a=LS(e),i=IU(e),s=DU(i);let l=i==="x"?a===(n?"end":"start")?"right":"left":a==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(l=Cm(l)),[l,Cm(l)]}function fF(e){const t=Cm(e);return[Sm(e),t,Sm(t)]}function Sm(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const U0=["left","right"],B0=["right","left"],NU=["top","bottom"],OU=["bottom","top"];function jU(e,t,n){switch(e){case"top":case"bottom":return n?t?B0:U0:t?U0:B0;case"left":case"right":return t?NU:OU;default:return[]}}function pF(e,t,n,a){const i=LS(e);let s=jU(RS(e),n==="start",a);return i&&(s=s.map(l=>l+"-"+i),t&&(s=s.concat(s.map(Sm)))),s}function Cm(e){const t=RS(e);return RU[t]+e.slice(t.length)}function UU(e){return{top:0,right:0,bottom:0,left:0,...e}}function mF(e){return typeof e!="number"?UU(e):{top:e,right:e,bottom:e,left:e}}function gF(e){const{x:t,y:n,width:a,height:i}=e;return{width:a,height:i,top:n,left:t,right:t+a,bottom:n+i,x:t,y:n}}function wu(e,t,n){return Math.floor(e/t)!==n}function F0(e,t){return t<0||t>=e.length}function yF(e,t){return Pa(e.current,{disabledIndices:t})}function vF(e,t){return Pa(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Pa(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:a,amount:i=1}={}){let s=t;do s+=n?-i:i;while(s>=0&&s<=e.length-1&&Tm(e,s,a));return s}function bF(e,{event:t,orientation:n,loopFocus:a,onLoop:i,rtl:s,cols:l,disabledIndices:u,minIndex:h,maxIndex:f,prevIndex:p,stopEvent:g=!1}){let v=p,_;if(t.key===SU?_="up":t.key===CU&&(_="down"),_){const w=[],S=[];let P=!1,D=0;{let K=null,Y=-1;e.forEach((ce,re)=>{if(ce==null)return;D+=1;const fe=ce.closest('[role="row"]');fe&&(P=!0),(fe!==K||Y===-1)&&(K=fe,Y+=1,w[Y]=[]),w[Y].push(re),S[re]=Y})}let R=!1,E=0;if(P)for(const K of w){const Y=K.length;Y>E&&(E=Y),Y!==l&&(R=!0)}const A=R&&D<e.length,U=E||l,z=K=>{if(!R||p===-1)return;const Y=S[p];if(Y==null)return;const ce=w[Y].indexOf(p),re=K==="up"?-1:1;for(let fe=Y+re,de=0;de<w.length;de+=1,fe+=re){if(fe<0||fe>=w.length){if(!a||A)return;if(fe=fe<0?w.length-1:0,i){const oe=Math.min(ce,w[fe].length-1),X=w[fe][oe]??w[fe][0],Z=i(t,p,X);fe=S[Z]??fe}}const he=w[fe];for(let oe=Math.min(ce,he.length-1);oe>=0;oe-=1){const X=he[oe];if(!Tm(e,X,u))return X}}},j=K=>{if(!A||p===-1)return;const Y=p%U,ce=K==="up"?-U:U,re=f-f%U,fe=kp(f/U)+1;for(let de=p-Y+ce,he=0;he<fe;he+=1,de+=ce){if(de<0||de>f){if(!a)return;de=de<0?re:0}const oe=Math.min(de+U-1,f);for(let X=Math.min(de+Y,oe);X>=de;X-=1)if(!Tm(e,X,u))return X}};g&&bp(t);const C=z(_)??j(_);if(C!==void 0)v=C;else if(p===-1)v=_==="up"?f:h;else if(v=Pa(e,{startingIndex:p,amount:U,decrement:_==="up",disabledIndices:u}),a){if(_==="up"&&(p-U<h||v<0)){const K=p%U,Y=f%U,ce=f-(Y-K);Y===K?v=f:v=Y>K?ce:ce-U,i&&(v=i(t,p,v))}_==="down"&&p+U>f&&(v=Pa(e,{startingIndex:p%U-U,amount:U,disabledIndices:u}),i&&(v=i(t,p,v)))}F0(e,v)&&(v=p)}if(n==="both"){const w=kp(p/l);t.key===(s?yp:vp)&&(g&&bp(t),p%l!==l-1?(v=Pa(e,{startingIndex:p,disabledIndices:u}),a&&wu(v,l,w)&&(v=Pa(e,{startingIndex:p-p%l-1,disabledIndices:u}),i&&(v=i(t,p,v)))):a&&(v=Pa(e,{startingIndex:p-p%l-1,disabledIndices:u}),i&&(v=i(t,p,v))),wu(v,l,w)&&(v=p)),t.key===(s?vp:yp)&&(g&&bp(t),p%l!==0?(v=Pa(e,{startingIndex:p,decrement:!0,disabledIndices:u}),a&&wu(v,l,w)&&(v=Pa(e,{startingIndex:p+(l-p%l),decrement:!0,disabledIndices:u}),i&&(v=i(t,p,v)))):a&&(v=Pa(e,{startingIndex:p+(l-p%l),decrement:!0,disabledIndices:u}),i&&(v=i(t,p,v))),wu(v,l,w)&&(v=p));const S=kp(f/l)===w;F0(e,v)&&(a&&S?(v=t.key===(s?vp:yp)?f:Pa(e,{startingIndex:p-p%l-1,disabledIndices:u}),i&&(v=i(t,p,v))):v=p)}return v}function kF(e,t,n){const a=[];let i=0;return e.forEach(({width:s,height:l},u)=>{let h=!1;for(;!h;){const f=[];for(let p=0;p<s;p+=1)for(let g=0;g<l;g+=1)f.push(i+p+g*t);i%t+s<=t&&f.every(p=>a[p]==null)?(f.forEach(p=>{a[p]=u}),h=!0):i+=1}}),[...a]}function _F(e,t,n,a,i){if(e===-1)return-1;const s=n.indexOf(e),l=t[e];switch(i){case"tl":return s;case"tr":return l?s+l.width-1:s;case"bl":return l?s+(l.height-1)*a:s;case"br":return n.lastIndexOf(e);default:return-1}}function wF(e,t){return t.flatMap((n,a)=>e.includes(n)?[a]:[])}function Tm(e,t,n){if(typeof n=="function"?n(t):n?.includes(t)??!1)return!0;const i=e[t];return i?DS(i)?!n&&(i.hasAttribute("disabled")||i.getAttribute("aria-disabled")==="true"):!0:!1}function BU(e){return e.visibility==="hidden"||e.visibility==="collapse"}function DS(e,t=e?Wd(e):null){return!e||!e.isConnected||!t||BU(t)?!1:typeof e.checkVisibility=="function"?e.checkVisibility():t.display!=="none"&&t.display!=="contents"}const FU='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function zU(e){const t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;const n=e.getRootNode();return Pd(n)?n.host:null}function Em(e){for(const t of Array.from(e.children))if(Aa(t)==="summary")return t;return null}function VU(e,t){const n=Em(t);return!!n&&(e===n||Pr(n,e))}function MS(e){const t=e?Aa(e):"";return e!=null&&e.matches(FU)&&(t!=="summary"||e.parentElement!=null&&Aa(e.parentElement)==="details"&&Em(e.parentElement)===e)&&(t!=="details"||Em(e)==null)&&(t!=="input"||e.type!=="hidden")}function IS(e){if(!MS(e)||!e.isConnected||e.matches(":disabled"))return!1;for(let t=e;t;t=zU(t)){const n=t!==e,a=Aa(t)==="slot";if(t.hasAttribute("inert")||n&&Aa(t)==="details"&&!t.open&&!VU(e,t)||t.hasAttribute("hidden")||!a&&!$U(t,n))return!1}return!0}function $U(e,t){const n=Wd(e);return t?n.display!=="none":DS(e,n)}function NS(e){const t=e.tabIndex;if(t<0){const n=Aa(e);if(n==="details"||n==="audio"||n==="video"||ci(e)&&e.isContentEditable)return 0}return t}function _p(e){if(Aa(e)!=="input")return null;const t=e;return t.type==="radio"&&t.name!==""?t:null}function HU(e,t){const n=_p(e);if(!n)return!0;const a=t.find(i=>{const s=_p(i);return s?.name===n.name&&s.form===n.form&&s.checked});return a?a===n:t.find(i=>{const s=_p(i);return s?.name===n.name&&s.form===n.form})===n}function OS(e){if(ci(e)&&Aa(e)==="slot"){const t=e.assignedElements({flatten:!0});if(t.length>0)return t}return ci(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function jS(e,t){OS(e).forEach(n=>{MS(n)&&t.push(n),jS(n,t)})}function US(e,t,n){OS(e).forEach(a=>{ci(a)&&a.matches(t)&&n.push(a),US(a,t,n)})}function xF(e){return IS(e)&&NS(e)>=0}function WU(e){const t=[];return jS(e,t),t.filter(IS)}function ay(e){const t=WU(e);return t.filter(n=>NS(n)>=0&&HU(n,t))}function BS(e,t){const n=ay(e),a=n.length;if(a===0)return;const i=Zo(Ta(e)),s=n.indexOf(i),l=s===-1?t===1?0:a-1:s+t;return n[l]}function GU(e){return BS(Ta(e).body,1)||e}function KU(e){return BS(Ta(e).body,-1)||e}function FS(e,t){if(!e)return null;const n=ay(Ta(e).body),a=n.length;if(a===0)return null;const i=n.indexOf(e);if(i===-1)return null;const s=(i+t+a)%a;return n[s]}function PF(e){return FS(e,1)}function SF(e){return FS(e,-1)}function wp(e,t){const n=t||e.currentTarget,a=e.relatedTarget;return!a||!Pr(n,a)}function qU(e){ay(e).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function z0(e){const t=[];US(e,"[data-tabindex]",t),t.forEach(n=>{const a=n.dataset.tabindex;delete n.dataset.tabindex,a?n.setAttribute("tabindex",a):n.removeAttribute("tabindex")})}function xp(e){const t=new Map;let n=0,a=0;return e.forEach((i,s)=>{const l=i.transitionStatus==="ending";t.set(i.id,{value:i,domIndex:s,visibleIndex:l?-1:n,offsetY:a}),a+=i.height||0,l||(n+=1)}),t}const xu=e=>e.toastMetadata,za={toasts:_a(e=>e.toasts),isEmpty:_a(e=>e.toasts.length===0),toast:_a(xu,(e,t)=>e.get(t)?.value),toastIndex:_a(xu,(e,t)=>e.get(t)?.domIndex??-1),toastOffsetY:_a(xu,(e,t)=>e.get(t)?.offsetY??0),toastVisibleIndex:_a(xu,(e,t)=>e.get(t)?.visibleIndex??-1),hovering:_a(e=>e.hovering),focused:_a(e=>e.focused),expanded:_a(e=>e.hovering||e.focused),expandedOrOutOfFocus:_a(e=>e.hovering||e.focused||!e.isWindowFocused),prevFocusElement:_a(e=>e.prevFocusElement)};class YU extends uU{timers=new Map;areTimersPaused=!1;constructor(t){super({...t,toastMetadata:xp(t.toasts)},{},za)}setFocused(t){this.set("focused",t)}setHovering(t){this.set("hovering",t)}setIsWindowFocused(t){this.set("isWindowFocused",t)}setPrevFocusElement(t){this.set("prevFocusElement",t)}setViewport=t=>{this.set("viewport",t)};disposeEffect=()=>()=>{this.timers.forEach(t=>{t.timeout?.clear()}),this.timers.clear()};removeToast(t,n={}){const a=za.toastIndex(this.state,t);if(a===-1)return;const i=this.state.toasts[a];n.skipOnRemove||i?.onRemove?.();const s=[...this.state.toasts];s.splice(a,1),this.setToasts(s)}addToast=t=>{const{timeout:n,limit:a}=this.state,i=t.id||SS("toast");if(t.id){const f=za.toast(this.state,t.id);if(f)if(f.transitionStatus==="ending")this.removeToast(t.id,{skipOnRemove:!0});else{const{id:p,transitionStatus:g,...v}=t;return this.updateToastInternal(t.id,v,{resetTimer:!0,markUpdated:!0}),t.id}}const s={...t,id:i,updateKey:0,transitionStatus:"starting"},l=[s,...this.state.toasts],u=l.filter(f=>f.transitionStatus!=="ending");if(u.length>a){const f=u.length-a,p=u.slice(-f),g=new Set(p.map(v=>v.id));this.setToasts(l.map(v=>{const _=g.has(v.id);return v.limited!==_?{...v,limited:_}:v}))}else this.setToasts(l.map(f=>f.limited?{...f,limited:!1}:f));const h=s.timeout??n;return s.type!=="loading"&&h>0&&this.scheduleTimer(i,h,()=>this.closeToast(i)),za.expandedOrOutOfFocus(this.state)&&this.pauseTimers(),i};updateToast=(t,n)=>{this.updateToastInternal(t,n,{markUpdated:!0})};updateToastInternal=(t,n,a={})=>{const{timeout:i,toasts:s}=this.state,l=za.toast(this.state,t)??null;if(!l||l.transitionStatus==="ending")return;const u={...l,...n,...a.markUpdated&&{updateKey:(l.updateKey??0)+1}};this.setToasts(s.map(S=>S.id===t?u:S));const h=u.timeout??i,f=l?.timeout??i,p=Object.hasOwn(n,"timeout"),g=u.transitionStatus!=="ending"&&u.type!=="loading"&&h>0,v=this.timers.has(t),_=f!==h,w=l?.type==="loading";if(!g&&v){this.timers.get(t)?.timeout?.clear(),this.timers.delete(t);return}if(g&&(!v||_||p||w||a.resetTimer)){const S=this.timers.get(t);S&&(S.timeout?.clear(),this.timers.delete(t)),this.scheduleTimer(t,h,()=>this.closeToast(t)),za.expandedOrOutOfFocus(this.state)&&this.pauseTimers()}};closeToast=t=>{const n=t===void 0,{limit:a,toasts:i}=this.state;let s;if(n)s=i,this.timers.forEach(f=>{f.timeout?.clear()}),this.timers.clear();else{const f=za.toast(this.state,t);if(!f)return;s=[f];const p=this.timers.get(t);p?.timeout&&(p.timeout.clear(),this.timers.delete(t))}let l=0;const u=i.map(f=>{if(n||f.id===t)return{...f,transitionStatus:"ending",height:0};if(f.transitionStatus==="ending")return f;const p=l>=a;return l+=1,f.limited!==p?{...f,limited:p}:f}),h={toasts:u,toastMetadata:xp(u)};(n||i.length===1)&&(h.hovering=!1,h.focused=!1),this.update(h),s.forEach(f=>{f.transitionStatus!=="ending"&&f.onClose?.()}),this.handleFocusManagement(t)};promiseToast=(t,n)=>{const a=mp(n.loading),i=this.addToast({...a,type:"loading"}),s=t.then(l=>{const u=mp(n.success,l);return this.updateToast(i,{...u,type:"success",timeout:u.timeout}),l}).catch(l=>{const u=mp(n.error,l);return this.updateToast(i,{...u,type:"error",timeout:u.timeout}),Promise.reject(l)});return{}.hasOwnProperty.call(n,"setPromise")&&n.setPromise(s),s};pauseTimers(){this.areTimersPaused||(this.areTimersPaused=!0,this.timers.forEach(t=>{if(t.timeout){t.timeout.clear();const n=Date.now()-t.start,a=t.delay-n;t.remaining=a>0?a:0}}))}resumeTimers(){this.areTimersPaused&&(this.areTimersPaused=!1,this.timers.forEach((t,n)=>{t.remaining=t.remaining>0?t.remaining:t.delay,t.timeout??=Ul.create(),t.timeout.start(t.remaining,()=>{this.timers.delete(n),t.callback()}),t.start=Date.now()}))}restoreFocusToPrevElement(){this.state.prevFocusElement?.focus({preventScroll:!0})}handleDocumentPointerDown=t=>{if(t.pointerType!=="touch")return;const n=Vi(t);Pr(this.state.viewport,n)||(this.resumeTimers(),this.update({hovering:!1,focused:!1}))};scheduleTimer(t,n,a){const i=Date.now(),s=!za.expandedOrOutOfFocus(this.state),l=s?Ul.create():void 0;l?.start(n,()=>{this.timers.delete(t),a()}),this.timers.set(t,{timeout:l,start:s?i:0,delay:n,remaining:n,callback:a})}setToasts(t){const n={toasts:t,toastMetadata:xp(t)};t.length===0&&(n.hovering=!1,n.focused=!1),this.update(n)}handleFocusManagement(t){const n=Zo(Ta(this.state.viewport));if(!this.state.viewport||!Pr(this.state.viewport,n)||!Pm(n))return;if(t===void 0){this.restoreFocusToPrevElement();return}const a=za.toasts(this.state),i=za.toastIndex(this.state,t);let s=null,l=i+1;for(;l<a.length;){if(a[l].transitionStatus!=="ending"){s=a[l];break}l+=1}if(!s)for(l=i-1;l>=0;){if(a[l].transitionStatus!=="ending"){s=a[l];break}l-=1}s?s.ref?.current?.focus():this.restoreFocusToPrevElement()}}const ZU=function(t){const{children:n,timeout:a=5e3,limit:i=3,toastManager:s}=t,l=ys(()=>new YU({timeout:a,limit:i,viewport:null,toasts:[],hovering:!1,focused:!1,isWindowFocused:!0,prevFocusElement:null})).current;return Yg(l.disposeEffect),b.useEffect(function(){return s?s[" subscribe"](({action:f,options:p})=>{const g=p.id;f==="promise"&&p.promise?l.promiseToast(p.promise,p):f==="update"&&g?l.updateToast(g,p):f==="close"?l.closeToast(g):l.addToast(p)}):void 0},[l,s]),l.useSyncedValues({timeout:a,limit:i}),T.jsx(Zg.Provider,{value:l,children:n})},zS={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},VS={...zS,position:"fixed",top:0,left:0},CF={...zS,position:"absolute"},Tl=b.forwardRef(function(t,n){const[a,i]=b.useState();Ka(()=>{_U&&i("button")},[]);const s={tabIndex:0,role:a};return T.jsx("span",{...t,ref:n,style:VS,"aria-hidden":a?void 0:!0,...s,"data-base-ui-focus-guard":""})});function V0(e,t,n,a){const i=ys($S).current;return QU(i,e,t,n,a)&&HS(i,[e,t,n,a]),i.callback}function XU(e){const t=ys($S).current;return JU(t,e)&&HS(t,e),t.callback}function $S(){return{callback:null,cleanup:null,refs:[]}}function QU(e,t,n,a,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==a||e.refs[3]!==i}function JU(e,t){return e.refs.length!==t.length||e.refs.some((n,a)=>n!==t[a])}function HS(e,t){if(e.refs=t,t.every(n=>n==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){const a=Array(t.length).fill(null);for(let i=0;i<t.length;i+=1){const s=t[i];if(s!=null)switch(typeof s){case"function":{const l=s(n);typeof l=="function"&&(a[i]=l);break}case"object":{s.current=n;break}}}e.cleanup=()=>{for(let i=0;i<t.length;i+=1){const s=t[i];if(s!=null)switch(typeof s){case"function":{const l=a[i];typeof l=="function"?l():s(null);break}case"object":{s.current=null;break}}}}}}}function $0(e){if(!b.isValidElement(e))return null;const t=e,n=t.props;return(Qg(19)?n?.ref:t.ref)??null}function Am(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function e9(e,t){const n={};for(const a in e){const i=e[a];if(t?.hasOwnProperty(a)){const s=t[a](i);s!=null&&Object.assign(n,s);continue}i===!0?n[`data-${a.toLowerCase()}`]="":i&&(n[`data-${a.toLowerCase()}`]=i.toString())}return n}function t9(e,t){return typeof e=="function"?e(t):e}function n9(e,t){return typeof e=="function"?e(t):e}const ry={};function iy(e,t,n,a,i){if(!n&&!a&&!i&&!e)return Sd(t);let s=Sd(e);return t&&(s=gl(s,t)),n&&(s=gl(s,n)),a&&(s=gl(s,a)),i&&(s=gl(s,i)),s}function a9(e){if(e.length===0)return ry;if(e.length===1)return Sd(e[0]);let t=Sd(e[0]);for(let n=1;n<e.length;n+=1)t=gl(t,e[n]);return t}function Sd(e){return oy(e)?{...GS(e,ry)}:r9(e)}function gl(e,t){return oy(t)?GS(t,e):i9(e,t)}function r9(e){const t={...e};for(const n in t){const a=t[n];WS(n,a)&&(t[n]=KS(a))}return t}function i9(e,t){if(!t)return e;for(const n in t){const a=t[n];switch(n){case"style":{e[n]=Am(e.style,a);break}case"className":{e[n]=qS(e.className,a);break}default:WS(n,a)?e[n]=o9(e[n],a):e[n]=a}}return e}function WS(e,t){const n=e.charCodeAt(0),a=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&a===110&&i>=65&&i<=90&&(typeof t=="function"||typeof t>"u")}function oy(e){return typeof e=="function"}function GS(e,t){return oy(e)?e(t):e??ry}function o9(e,t){return t?e?(...n)=>{const a=n[0];if(YS(a)){const s=a;Cd(s);const l=t(...n);return s.baseUIHandlerPrevented||e?.(...n),l}const i=t(...n);return e?.(...n),i}:KS(t):e}function KS(e){return e&&((...t)=>{const n=t[0];return YS(n)&&Cd(n),e(...t)})}function Cd(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function qS(e,t){return t?e?t+" "+e:t:e}function YS(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function Jl(e,t,n={}){const a=t.render,i=s9(t,n);if(n.enabled===!1)return null;const s=n.state??Fi;return u9(e,a,i,s)}function s9(e,t={}){const{className:n,style:a,render:i}=e,{state:s=Fi,ref:l,props:u,stateAttributesMapping:h,enabled:f=!0}=t,p=f?t9(n,s):void 0,g=f?n9(a,s):void 0,v=f?e9(s,h):Fi,_=f&&u?l9(u):void 0,w=f?Am(v,_)??{}:Fi;return typeof document<"u"&&(f?Array.isArray(l)?w.ref=XU([w.ref,$0(i),...l]):w.ref=V0(w.ref,$0(i),l):V0(null,null)),f?(p!==void 0&&(w.className=qS(w.className,p)),g!==void 0&&(w.style=Am(w.style,g)),w):Fi}function l9(e){return Array.isArray(e)?a9(e):iy(void 0,e)}const c9=Symbol.for("react.lazy");function u9(e,t,n,a){if(t){if(typeof t=="function")return t(n,a);const i=iy(n,t.props);i.ref=n.ref;let s=t;return s?.$$typeof===c9&&(s=b.Children.toArray(t)[0]),b.cloneElement(s,i)}if(e&&typeof e=="string")return d9(e,n);throw new Error(vs(8))}function d9(e,t){return e==="button"?b.createElement("button",{type:"button",...t,key:t.key}):e==="img"?b.createElement("img",{alt:"",...t,key:t.key}):b.createElement(e,t)}let h9=(function(e){return e.frontmostHeight="--toast-frontmost-height",e})({});const f9=b.forwardRef(function(t,n){const{render:a,className:i,style:s,children:l,...u}=t,h=Xg(),f=kU(),p=b.useRef(!1),g=b.useRef(!1),v=b.useRef(!1),_=h.useState("isEmpty"),w=h.useState("toasts"),S=h.useState("focused"),P=h.useState("expanded"),D=h.useState("prevFocusElement"),R=w[0]?.height??0,E=b.useMemo(()=>w.some(X=>X.transitionStatus==="ending"),[w]),A=b.useMemo(()=>w.filter(X=>X.priority==="high"),[w]);b.useEffect(()=>{const X=h.state.viewport;if(!X)return;function Z(V){_||V.key==="F6"&&Vi(V)!==X&&(V.preventDefault(),h.setPrevFocusElement(Zo(Ta(X))),X?.focus({preventScroll:!0}),h.pauseTimers(),h.setFocused(!0))}const Q=xr(X);return zi(Q,"keydown",Z)},[h,_]),b.useEffect(()=>{const X=h.state.viewport;if(!X||_)return;const Z=xr(X);function Q(I){Vi(I)===Z&&(h.setIsWindowFocused(!1),h.pauseTimers())}function V(I){if(I.relatedTarget)return;const G=Vi(I),ye=Zo(Ta(X));(G===Z||!Pr(X,G)||!Pm(ye))&&h.resumeTimers(),f.start(0,()=>h.setIsWindowFocused(!0))}return PS(zi(Z,"blur",Q,!0),zi(Z,"focus",V,!0))},[h,f,_]),b.useEffect(()=>{const X=h.state.viewport;if(!X||_)return;const Z=Ta(X);return zi(Z,"pointerdown",h.handleDocumentPointerDown,!0)},[_,h]);function U(X){const Z=h.state.viewport;Z&&(p.current=!0,X.relatedTarget===Z?w[0]?.ref?.current?.focus():h.restoreFocusToPrevElement())}function z(X){X.key==="Tab"&&X.shiftKey&&Vi(X.nativeEvent)===h.state.viewport&&(X.preventDefault(),h.restoreFocusToPrevElement(),h.resumeTimers())}function j(){const X=h.state.toasts.some(Z=>Z.transitionStatus==="ending");!h.state.isWindowFocused||X||v.current||!g.current||(h.resumeTimers(),h.setHovering(!1),g.current=!1)}b.useEffect(j,[E,h]);function C(){h.pauseTimers(),h.setHovering(!0),g.current=!1}function K(){E||v.current?g.current=!0:(h.resumeTimers(),h.setHovering(!1))}function Y(X){X.pointerType==="touch"&&(v.current=!0)}function ce(X){X.pointerType==="touch"&&(v.current=!1,j())}function re(){if(p.current){p.current=!1;return}S||Pm(Zo(Ta(h.state.viewport)))&&(h.setFocused(!0),h.pauseTimers())}function fe(X){!S||Pr(h.state.viewport,X.relatedTarget)||(h.setFocused(!1),h.resumeTimers())}const de={tabIndex:-1,role:"region","aria-live":"polite","aria-atomic":!1,"aria-relevant":"additions text","aria-label":"Notifications",onMouseEnter:C,onMouseMove:C,onMouseLeave:K,onFocus:re,onBlur:fe,onKeyDown:z,onClick:re,onPointerDown:Y,onPointerUp:ce,onPointerCancel:ce},he={expanded:P},oe=Jl("div",t,{ref:[n,h.setViewport],state:he,props:[de,{style:{[h9.frontmostHeight]:R?`${R}px`:void 0}},u,{children:T.jsxs(b.Fragment,{children:[!_&&D&&T.jsx(Tl,{onFocus:U}),l,!_&&D&&T.jsx(Tl,{onFocus:U})]})}]});return T.jsxs(b.Fragment,{children:[!_&&D&&T.jsx(Tl,{onFocus:U}),oe,!S&&A.length>0&&T.jsx("div",{style:VS,children:A.map(X=>T.jsxs("div",{role:"alert","aria-atomic":!0,children:[T.jsx("div",{children:X.title}),T.jsx("div",{children:X.description})]},X.id))})]})});function p9(e){return Qg(19)?e:e?"true":void 0}const ZS=b.createContext(void 0);function XS(){const e=b.useContext(ZS);if(!e)throw new Error(vs(66));return e}let sy=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const m9={[sy.startingStyle]:""},g9={[sy.endingStyle]:""},y9={transitionStatus(e){return e==="starting"?m9:e==="ending"?g9:null}};function v9(e){return e==null?e:"current"in e?e.current:e}function b9(e,t=!1,n=!0){const a=bU();return Xi((i,s=null)=>{a.cancel();const l=v9(e);if(l==null)return;const u=l,h=()=>{ls.flushSync(i)};if(typeof u.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function f(){Promise.all(u.getAnimations().map(p=>p.finished)).then(()=>{s?.aborted||h()}).catch(()=>{if(n){s?.aborted||h();return}const p=u.getAnimations();!s?.aborted&&p.length>0&&p.some(g=>g.pending||g.playState!=="finished")&&f()})}if(t){const p=sy.startingStyle;if(!u.hasAttribute(p)){a.request(f);return}const g=new MutationObserver(()=>{u.hasAttribute(p)||(g.disconnect(),f())});g.observe(u,{attributes:!0,attributeFilter:[p]}),s?.addEventListener("abort",()=>g.disconnect(),{once:!0});return}a.request(f)})}function k9(e){const{enabled:t=!0,open:n,ref:a,onComplete:i}=e,s=Xi(i),l=b9(a,n,!1);b.useEffect(()=>{if(!t)return;const u=new AbortController;return l(s,u.signal),()=>{u.abort()}},[t,n,s,l])}let Mi=(function(e){return e.index="--toast-index",e.offsetY="--toast-offset-y",e.height="--toast-height",e.swipeMovementX="--toast-swipe-movement-x",e.swipeMovementY="--toast-swipe-movement-y",e})({});const TF=500,EF={style:{transition:"none"}},AF="data-base-ui-click-trigger",_9="data-base-ui-swipe-ignore",w9="data-swipe-ignore",x9=`[${_9}]`,P9=`[${w9}]`,RF={fallbackAxisSide:"none"},LF={fallbackAxisSide:"end"},S9={clipPath:"inset(50%)",position:"fixed",top:0,left:0};function H0(e,t,n){switch(e){case"up":return-n;case"down":return n;case"left":return-t;case"right":return t;default:return 0}}function C9(e){const n=xr(e).getComputedStyle(e).transform;let a=0,i=0,s=1;if(n&&n!=="none"){const l=n.match(/matrix(?:3d)?\(([^)]+)\)/);if(l){const u=l[1].split(", ").map(parseFloat);u.length===6?(a=u[4],i=u[5],s=Math.sqrt(u[0]*u[0]+u[1]*u[1])):u.length===16&&(a=u[12],i=u[13],s=u[0])}}return{x:a,y:i,scale:s}}const T9={...y9,swipeDirection(e){return e?{"data-swipe-direction":e}:null}},ul=40,E9=10,Qr=.5,A9=1,R9=`${x9},${P9}`,L9=b.forwardRef(function(t,n){const{toast:a,render:i,className:s,swipeDirection:l=["down","right"],style:u,...h}=t,f=a.positionerProps?.anchor!==void 0;let p=[];f||(p=Array.isArray(l)?l:[l]);const g=p.length>0,v=Xg(),[_,w]=b.useState(void 0),[S,P]=b.useState(!1),[D,R]=b.useState(!1),[E,A]=b.useState(!1),[U,z]=b.useState({x:0,y:0}),[j,C]=b.useState({x:0,y:0,scale:1}),[K,Y]=b.useState(),[ce,re]=b.useState(),[fe,de]=b.useState(null),he=b.useRef(null),oe=b.useRef({x:0,y:0}),X=b.useRef({x:0,y:0,scale:1}),Z=b.useRef(void 0),Q=b.useRef(0),V=b.useRef(!1),I=b.useRef({x:0,y:0}),G=b.useRef(!1),ye=b.useRef({x:0,y:0}),me=b.useRef(null),pe=b.useRef(null),ke=v.useState("toastIndex",a.id),We=v.useState("toastVisibleIndex",a.id),Xe=v.useState("toastOffsetY",a.id),Ue=v.useState("focused"),Dt=v.useState("expanded");k9({open:a.transitionStatus!=="ending",ref:he,onComplete(){a.transitionStatus==="ending"&&v.removeToast(a.id)}});const rn=Xi((Ge=!1)=>{const He=he.current;if(!He)return;const ct=He.style.height;He.style.height="auto";const At=He.offsetHeight;He.style.height=ct;function bt(){v.updateToastInternal(a.id,{ref:he,height:At,...a.transitionStatus==="starting"?{transitionStatus:void 0}:{}})}Ge?ls.flushSync(bt):bt()});Ka(rn,[rn]);function Pn(Ge){ye.current=Ge,z(Ge)}Ka(()=>()=>{pe.current?.abort()},[]);function gt(Ge,He){let ct=Ge,At=He;return!p.includes("left")&&!p.includes("right")?ct=Ge>0?Ge**Qr:-(Math.abs(Ge)**Qr):(!p.includes("right")&&Ge>0&&(ct=Ge**Qr),!p.includes("left")&&Ge<0&&(ct=-(Math.abs(Ge)**Qr))),!p.includes("up")&&!p.includes("down")?At=He>0?He**Qr:-(Math.abs(He)**Qr):(!p.includes("down")&&He>0&&(At=He**Qr),!p.includes("up")&&He<0&&(At=-(Math.abs(He)**Qr))),{x:ct,y:At}}const Ut=Xi(Ge=>{if(Ge.pointerId!==me.current)return;me.current=null,pe.current?.abort(),pe.current=null,P(!1),R(!1),de(null);const He=X.current;if(Ge.type==="pointercancel"||V.current){Pn({x:He.x,y:He.y}),w(void 0);return}let ct=!1;const At=ye.current,bt=At.x-He.x,mt=At.y-He.y;let dt;for(const ua of p){switch(ua){case"right":bt>ul&&(ct=!0,dt="right");break;case"left":bt<-ul&&(ct=!0,dt="left");break;case"down":mt>ul&&(ct=!0,dt="down");break;case"up":mt<-ul&&(ct=!0,dt="up");break}if(ct)break}ct?(w(dt),A(!0),v.closeToast(a.id)):(Pn({x:He.x,y:He.y}),w(void 0))});function fi(Ge){if(Ge.button!==0)return;Ge.pointerType==="touch"&&v.pauseTimers();const He=Vi(Ge.nativeEvent);if(He?He.closest(`button,a,input,textarea,[role="button"],${R9}`):!1)return;if(V.current=!1,Z.current=void 0,Q.current=0,me.current=Ge.pointerId,oe.current={x:Ge.clientX,y:Ge.clientY},I.current=oe.current,he.current){const bt=C9(he.current);X.current=bt,C(bt),Pn({x:bt.x,y:bt.y})}v.setHovering(!0),P(!0),R(!1),de(null),G.current=!0;const At=he.current;if(At){pe.current?.abort();const bt=new AbortController;pe.current=bt;const mt=Ta(At);mt.addEventListener("pointerup",Ut,{signal:bt.signal}),mt.addEventListener("pointercancel",Ut,{signal:bt.signal}),At.setPointerCapture?.(Ge.pointerId)}}function ao(Ge){if(Ge.pointerId!==me.current)return;Ge.preventDefault(),G.current&&(oe.current={x:Ge.clientX,y:Ge.clientY},G.current=!1);const{clientY:He,clientX:ct,movementX:At,movementY:bt}=Ge;(bt<0&&He>I.current.y||bt>0&&He<I.current.y)&&(I.current={x:I.current.x,y:He}),(At<0&&ct>I.current.x||At>0&&ct<I.current.x)&&(I.current={x:ct,y:I.current.y});const mt=ct-oe.current.x,dt=He-oe.current.y,ua=He-I.current.y,ks=ct-I.current.x;if(!D&&Math.sqrt(mt*mt+dt*dt)>=A9&&(R(!0),fe===null)){const da=p.includes("left")||p.includes("right"),mi=p.includes("up")||p.includes("down");if(da&&mi){const Cr=Math.abs(mt),jn=Math.abs(dt);de(Cr>jn?"horizontal":"vertical")}}let qt;if(!Z.current)fe==="vertical"?dt>0?qt="down":dt<0&&(qt="up"):fe==="horizontal"?mt>0?qt="right":mt<0&&(qt="left"):Math.abs(mt)>=Math.abs(dt)?qt=mt>0?"right":"left":qt=dt>0?"down":"up",qt&&p.includes(qt)&&(Z.current=qt,Q.current=H0(qt,mt,dt),w(qt));else{const Ma=Z.current,da=H0(Ma,ks,ua);da>ul?(V.current=!1,w(Ma)):!(p.includes("left")&&p.includes("right"))&&!(p.includes("up")&&p.includes("down"))&&Q.current-da>=E9&&(V.current=!0)}const or=gt(mt,dt);let mn=X.current.x,Da=X.current.y;fe==="horizontal"?(p.includes("left")||p.includes("right"))&&(mn+=or.x):(fe==="vertical"||(p.includes("left")||p.includes("right"))&&(mn+=or.x),(p.includes("up")||p.includes("down"))&&(Da+=or.y)),Pn({x:mn,y:Da})}function Nn(Ge){if(Ge.key==="Escape"){if(!he.current||!Pr(he.current,Zo(Ta(he.current))))return;v.closeToast(a.id)}}b.useEffect(()=>{if(!g)return;const Ge=he.current;if(!Ge)return;function He(ct){Pr(Ge,Vi(ct))&&ct.preventDefault()}return zi(Ge,"touchmove",He,{passive:!1})},[g]);function ro(){if(!S&&U.x===j.x&&U.y===j.y&&!E)return{[Mi.swipeMovementX]:"0px",[Mi.swipeMovementY]:"0px"};const Ge=U.x-j.x,He=U.y-j.y;return{transition:S?"none":void 0,transform:S?`translateX(${U.x}px) translateY(${U.y}px) scale(${j.scale})`:void 0,[Mi.swipeMovementX]:`${Ge}px`,[Mi.swipeMovementY]:`${He}px`}}const Sr=a.priority==="high",La={role:Sr?"alertdialog":"dialog",tabIndex:0,"aria-modal":!1,"aria-labelledby":K,"aria-describedby":ce,"aria-hidden":Sr&&!Ue?!0:void 0,onPointerDown:g?fi:void 0,onPointerMove:g?ao:void 0,onPointerUp:g?Ut:void 0,onPointerCancel:g?Ut:void 0,onKeyDown:Nn,inert:p9(a.limited),style:{...ro(),[Mi.index]:a.transitionStatus==="ending"?ke:We,[Mi.offsetY]:`${Xe}px`,[Mi.height]:a.height?`${a.height}px`:void 0}},On=b.useMemo(()=>({rootRef:he,toast:a,titleId:K,setTitleId:Y,descriptionId:ce,setDescriptionId:re,swiping:S,swipeDirection:_,recalculateHeight:rn,index:ke,visibleIndex:We,expanded:Dt}),[a,K,ce,S,_,rn,ke,We,Dt]),pi={transitionStatus:a.transitionStatus,expanded:Dt,limited:a.limited||!1,type:a.type,swiping:On.swiping,swipeDirection:On.swipeDirection},io=Jl("div",t,{ref:[n,On.rootRef],state:pi,stateAttributesMapping:T9,props:[La,h]});return T.jsx(ZS.Provider,{value:On,children:io})});let W0=0;function D9(e,t="mui"){const[n,a]=b.useState(e),i=e||n;return b.useEffect(()=>{n==null&&(W0+=1,a(`${t}-${W0}`))},[n,t]),i}const G0=Jg.useId;function QS(e,t){if(G0!==void 0){const n=G0();return e??(t?`${t}-${n}`:n)}return D9(e,t)}const M9=b.forwardRef(function(t,n){const{render:a,className:i,style:s,id:l,children:u,...h}=t,{toast:f,setTitleId:p}=XS(),g=u??f.title,v=!!g,_=QS(l);Ka(()=>{if(v)return p(_),()=>{p(void 0)}},[v,_,p]);const w={type:f.type},S=Jl("h2",t,{ref:n,state:w,props:{...h,id:_,children:g}});return v?S:null}),I9=b.createContext(void 0);function N9(e=!1){const t=b.useContext(I9);if(t===void 0&&!e)throw new Error(vs(16));return t}function O9(e){const{focusableWhenDisabled:t,disabled:n,composite:a=!1,tabIndex:i=0,isNativeButton:s}=e,l=a&&t!==!1,u=a&&t===!1;return{props:b.useMemo(()=>{const f={onKeyDown(p){n&&t&&p.key!=="Tab"&&p.preventDefault()}};return a||(f.tabIndex=i,!s&&n&&(f.tabIndex=t?i:-1)),(s&&(t||l)||!s&&n)&&(f["aria-disabled"]=n),s&&(!t||u)&&(f.disabled=n),f},[a,n,t,l,u,s,i])}}function j9(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:a=0,native:i=!0,composite:s}=e,l=b.useRef(null),u=N9(!0),h=s??u!==void 0,{props:f}=O9({focusableWhenDisabled:n,disabled:t,composite:h,tabIndex:a,isNativeButton:i}),p=b.useCallback(()=>{const _=l.current;Pp(_)&&h&&t&&f.disabled===void 0&&_.disabled&&(_.disabled=!1)},[t,f.disabled,h]);Ka(p,[p]);const g=b.useCallback((_={})=>{const{onClick:w,onMouseDown:S,onKeyUp:P,onKeyDown:D,onPointerDown:R,...E}=_;return iy({onClick(A){if(t){A.preventDefault();return}w?.(A)},onMouseDown(A){t||S?.(A)},onKeyDown(A){if(t||(Cd(A),D?.(A),A.baseUIHandlerPrevented))return;const U=A.target===A.currentTarget,z=A.currentTarget,j=Pp(z),C=!i&&U9(z),K=U&&(i?j:!C),Y=A.key==="Enter",ce=A.key===" ",re=z.getAttribute("role"),fe=re?.startsWith("menuitem")||re==="option"||re==="gridcell";if(U&&h&&ce){if(A.defaultPrevented&&fe)return;A.preventDefault(),C||i&&j?(z.click(),A.preventBaseUIHandler()):K&&(w?.(A),A.preventBaseUIHandler());return}K&&(!i&&(ce||Y)&&A.preventDefault(),!i&&Y&&w?.(A))},onKeyUp(A){if(!t){if(Cd(A),P?.(A),A.target===A.currentTarget&&i&&h&&Pp(A.currentTarget)&&A.key===" "){A.preventDefault();return}A.baseUIHandlerPrevented||A.target===A.currentTarget&&!i&&!h&&A.key===" "&&w?.(A)}},onPointerDown(A){if(t){A.preventDefault();return}R?.(A)}},i?{type:"button"}:{role:"button"},f,E)},[t,f,h,i]),v=Xi(_=>{l.current=_,p()});return{getButtonProps:g,buttonRef:v}}function Pp(e){return ci(e)&&e.tagName==="BUTTON"}function U9(e){return!!(e?.tagName==="A"&&e?.href)}const B9=b.forwardRef(function(t,n){const{render:a,className:i,style:s,disabled:l,nativeButton:u=!0,...h}=t,f=Xg(),{toast:p}=XS(),g=f.useState("expanded"),[v,_]=b.useState(!1),{getButtonProps:w,buttonRef:S}=j9({disabled:l,native:u}),P={type:p.type};return Jl("button",t,{ref:[n,S],state:P,props:[{"aria-hidden":!g&&!v,onClick(){f.closeToast(p.id)},onFocus(){_(!0)},onBlur(){_(!1)}},h,w]})}),DF="none",MF="trigger-press",IF="trigger-hover",NF="outside-press",OF="item-press",jF="close-press",F9="focus-out",UF="escape-key",BF="list-navigation",FF="cancel-open",zF="imperative-action",VF="window-resize";function z9(e,t,n,a){let i=!1,s=!1;const l=Fi;return{reason:e,event:t??new Event("base-ui"),cancel(){i=!0},allowPropagation(){s=!0},get isCanceled(){return i},get isPropagationAllowed(){return s},trigger:n,...l}}function V9(e){return`data-base-ui-${e}`}const JS=b.createContext(null),$9=()=>b.useContext(JS),H9=V9("portal");function eC(e={}){const{ref:t,container:n,componentProps:a=Fi,elementProps:i}=e,s=QS(),u=$9()?.portalNode,[h,f]=b.useState(null),[p,g]=b.useState(null),v=Xi(P=>{P!==null&&g(P)}),_=b.useRef(null);Ka(()=>{if(n===null){_.current&&(_.current=null,g(null),f(null));return}if(s==null)return;const P=(n&&(ey(n)?n:n.current))??u??document.body;if(P==null){_.current&&(_.current=null,g(null),f(null));return}_.current!==P&&(_.current=P,g(null),f(P))},[n,u,s]);const w=Jl("div",a,{ref:[t,v],props:[{id:s,[H9]:""},i]});return{portalNode:p,portalSubtree:h&&w?ls.createPortal(w,h):null}}const $F=b.forwardRef(function(t,n){const{render:a,className:i,style:s,children:l,container:u,renderGuards:h,...f}=t,{portalNode:p,portalSubtree:g}=eC({container:u,ref:n,componentProps:t,elementProps:f}),v=b.useRef(null),_=b.useRef(null),w=b.useRef(null),S=b.useRef(null),[P,D]=b.useState(null),R=b.useRef(!1),E=P?.modal,A=P?.open,U=typeof h=="boolean"?h:!!P&&!P.modal&&P.open&&!!p;b.useEffect(()=>{if(!p||E)return;function j(C){p&&C.relatedTarget&&wp(C)&&(C.type==="focusin"?R.current&&(z0(p),R.current=!1):(qU(p),R.current=!0))}return PS(zi(p,"focusin",j,!0),zi(p,"focusout",j,!0))},[p,E]),b.useEffect(()=>{!p||A!==!1||(z0(p),R.current=!1)},[A,p]);const z=b.useMemo(()=>({beforeOutsideRef:v,afterOutsideRef:_,beforeInsideRef:w,afterInsideRef:S,portalNode:p,setFocusManagerState:D}),[p]);return T.jsxs(b.Fragment,{children:[g,T.jsxs(JS.Provider,{value:z,children:[U&&p&&T.jsx(Tl,{"data-type":"outside",ref:v,onFocus:j=>{if(wp(j,p))w.current?.focus();else{const C=P?P.domReference:null;KU(C)?.focus()}}}),U&&p&&T.jsx("span",{"aria-owns":p.id,style:S9}),p&&ls.createPortal(l,p),U&&p&&T.jsx(Tl,{"data-type":"outside",ref:_,onFocus:j=>{if(wp(j,p))S.current?.focus();else{const C=P?P.domReference:null;GU(C)?.focus(),P?.closeOnFocusOut&&P?.onOpenChange(!1,z9(F9,j.nativeEvent))}}})]})]})}),W9=b.forwardRef(function(t,n){const{children:a,container:i,className:s,render:l,style:u,...h}=t,{portalNode:f,portalSubtree:p}=eC({container:i,ref:n,componentProps:t,elementProps:h});return!p&&!f?null:T.jsxs(b.Fragment,{children:[p,f&&ls.createPortal(a,f)]})}),G9=W9;function K9(){const e=b.useContext(Zg);if(!e)throw new Error(vs(73));const t=e.useState("toasts");return b.useMemo(()=>({toasts:t,add:e.addToast,close:e.closeToast,update:e.updateToast,promise:e.promiseToast}),[t,e])}function q9(){const e=new Set;function t(n){e.forEach(a=>a(n))}return{" subscribe":function(a){return e.add(a),()=>{e.delete(a)}},add(n){const a=n.id||SS("toast"),i={...n,id:a,transitionStatus:"starting"};return t({action:"add",options:i}),a},close(n){t({action:"close",options:{id:n}})},update(n,a){t({action:"update",options:{...a,id:n}})},promise(n,a){let i=n;return t({action:"promise",options:{...a,promise:n,setPromise(s){i=s}}}),i}}}const ly=q9();function HF(e){return ly.add(e)}function Y9({children:e}){return T.jsxs(ZU,{toastManager:ly,children:[e,T.jsx(G9,{children:T.jsx(f9,{className:"fixed inset-x-0 top-6 z-[100] mx-auto flex w-full max-w-sm flex-col items-center gap-2 px-4 outline-none",children:T.jsx(Z9,{})})})]})}function Z9(){const{toasts:e}=K9();return e.map(t=>{const n=t.data?.onUndo;return T.jsxs(L9,{toast:t,className:St("pointer-events-auto flex w-full items-center gap-3 rounded-xl border border-oai-gray-200 bg-oai-white px-4 py-3 shadow-xl transition-all duration-200 ease-out","data-[starting-style]:-translate-y-3 data-[starting-style]:opacity-0","data-[ending-style]:-translate-y-3 data-[ending-style]:opacity-0","dark:border-oai-gray-800 dark:bg-oai-gray-900"),children:[T.jsx(M9,{className:"min-w-0 flex-1 text-sm font-medium text-oai-black dark:text-white"}),n?T.jsx("button",{type:"button",onClick:()=>{n(),ly.close(t.id)},className:"shrink-0 rounded-md px-2 py-1 text-xs font-semibold text-oai-gray-600 transition-colors hover:bg-oai-gray-100 hover:text-oai-black focus:outline-none focus:ring-2 focus:ring-oai-gray-400/30 dark:text-oai-gray-300 dark:hover:bg-oai-gray-800 dark:hover:text-white",children:De("shared.action.undo")}):null,T.jsx(B9,{"aria-label":De("shared.action.dismiss"),className:"-mr-1 inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-md text-oai-gray-400 transition-colors hover:bg-oai-gray-100 hover:text-oai-black focus:outline-none focus:ring-2 focus:ring-oai-gray-400/30 dark:hover:bg-oai-gray-800 dark:hover:text-white",children:T.jsx(gg,{className:"h-3.5 w-3.5","aria-hidden":!0})})]},t.id)})}const cy=Object.freeze(["limits","leaderboard"]),X9=Object.freeze({limits:"/limits",leaderboard:"/leaderboard"}),Q9=Object.freeze({limits:()=>Dn(()=>import("./LimitsPage-qaD7Reti.js"),__vite__mapDeps([0,1,2,3,4,5,6,7])),leaderboard:()=>Dn(()=>import("./LeaderboardPage-CC4CFYAe.js"),__vite__mapDeps([8,9,10,11,12,13]))}),tC="total",nC=0,K0=20,J9=Object.freeze([10,20,50,100]),e7="tokentracker:leaderboard:pageSize",t7=20,n7=Object.freeze(["dashboard-existing","silent-preload","page-load","manual-refresh"]);let q0=0,oa;class a7{constructor(t={}){this.limits=null,this.leaderboard=new Map,this.leaderboardMaxEntries=o7(t.leaderboardMaxEntries)}read(t,n){return ec(t),t==="limits"?!this.limits||this.limits.contextKey!==n?null:Gu(this.limits):n?Gu(this.leaderboard.get(n)):null}write(t,n={}){if(t.targetKey==="limits"){this.limits=t;return}this.leaderboard.has(t.contextKey)&&this.leaderboard.delete(t.contextKey),this.leaderboard.set(t.contextKey,t),this.evictLeaderboardEntries(n.activeContextKey||t.contextKey)}evictLeaderboardEntries(t=null){for(;this.leaderboard.size>this.leaderboardMaxEntries;){const n=Array.from(this.leaderboard.keys()).find(a=>a!==t)||this.leaderboard.keys().next().value;this.leaderboard.delete(n)}}snapshot(){return{limits:Gu(this.limits),leaderboard:{maxEntries:this.leaderboardMaxEntries,size:this.leaderboard.size,keys:Array.from(this.leaderboard.keys())}}}}class r7{constructor(t={}){q0+=1,this.sessionId=`dashboard-preload-${q0}`,this.createdAt=Date.now(),this.completedAt=null,this.startedAfterMainContentVisible=!1,this.cache=new a7(t),this.targets={limits:Y0("limits"),leaderboard:Y0("leaderboard")}}}function Y0(e){return{key:e,route:X9[e],resourceStatus:"idle",stateStatus:"idle",error:null,resourcePromise:null,resourceModule:null,resourceRequestId:0,statePromise:null,stateRequestId:0,pendingStateContextKey:null}}function i7(e={}){return new r7(e)}function o7(e){const t=Number(e);return!Number.isInteger(t)||t<1?t7:t}oa=i7();function ec(e){if(!cy.includes(e))throw new Error(`Unknown dashboard preload target: ${e}`)}function aC(e){return e?typeof e=="string"?e:e.message||String(e):null}function s7(e,t){return n7.includes(e)?e:t}function l7(e){const t=Number(e);return Number.isFinite(t)?t:Date.now()}function Gu(e){return e?{...e}:null}function Z0(){const e=cy.every(t=>{const n=oa.targets[t];return n.resourceStatus==="fulfilled"||n.resourceStatus==="rejected"});oa.completedAt=e?Date.now():null}function c7(){oa.startedAfterMainContentVisible=!0}function uy(e,t={}){ec(e);const n=Object.entries(t).filter(([,a])=>a!==void 0).sort(([a],[i])=>a.localeCompare(i)).map(([a,i])=>`${a}=${i===null?"null":String(i)}`);return`${e}:${n.join("|")}`}function u7(e,t={}){ec(e);const n=oa.targets[e];if(n.resourceStatus==="fulfilled")return Promise.resolve(n.resourceModule);if(n.resourceStatus==="pending"&&n.resourcePromise)return n.resourcePromise;const a=t.loader||Q9[e],i=n.resourceRequestId+1;n.resourceRequestId=i,n.resourceStatus="pending",n.error=null;const s=Promise.resolve().then(()=>a()).then(l=>n.resourceRequestId!==i||n.resourcePromise!==s?null:(n.resourceStatus="fulfilled",n.resourceModule=l,n.error=null,Z0(),l)).catch(l=>(n.resourceRequestId!==i||n.resourcePromise!==s||(n.resourceStatus="rejected",n.error=aC(l),Z0()),null));return n.resourcePromise=s,s}function d7(e={}){const t=e.loaders||{};return Promise.all(cy.map(n=>u7(n,{loader:t[n]})))}function rC(e,t){ec(e);const n=oa.targets[e],a=t?.status||"fulfilled",i={targetKey:e,status:a,data:t?.data??null,error:aC(t?.error),source:s7(t?.source,"silent-preload"),generatedAt:l7(t?.generatedAt),updatedAt:Date.now(),contextKey:t?.contextKey||uy(e,t?.context||{})};return n.stateStatus=a,a==="rejected"||a==="skipped"?n.error=i.error:a==="fulfilled"&&(n.error=null,oa.cache.write(i,{activeContextKey:t?.activeContextKey})),Gu(i)}function iC(e,t){return ec(e),oa.cache.read(e,t)}function WF(e,t={}){return rC("limits",{data:e,source:t.source||"dashboard-existing",contextKey:t.contextKey||oC(t.context||{}),generatedAt:t.generatedAt,status:t.status||"fulfilled",error:t.error})}function oC(e={}){return uy("limits",{state:"current",...e})}function GF(e=oC()){return iC("limits",e)}function Rm(e,t={}){return rC("leaderboard",{activeContextKey:t.activeContextKey,data:e,source:t.source||"silent-preload",contextKey:t.contextKey||dy(t.context||{}),generatedAt:t.generatedAt,status:t.status||"fulfilled",error:t.error})}function h7(e){return iC("leaderboard",e)}function sC(){if(typeof window>"u")return K0;try{const e=window.localStorage.getItem(e7),t=Number(e);if(J9.includes(t))return t}catch{}return K0}function lC(e={}){const t=e.userId;return t!==void 0?t||null:e.cloudUser?.id||null}function cC(e={}){return typeof e.accessMode=="string"&&e.accessMode.trim()?e.accessMode.trim():e.mockEnabled?"mock":e.baseUrl?"cloud":"unavailable"}function dy(e={}){const t=!!e.mockEnabled,n=e.baseUrl??"";return uy("leaderboard",{accessMode:cC({...e,baseUrl:n,mockEnabled:t}),baseUrl:n,mockEnabled:t,offset:e.offset??nC,pageSize:e.pageSize??sC(),period:e.period||tC,userId:lC(e)})}function Pu(e,t){const n=oa.targets.leaderboard;return n.stateRequestId+=1,n.statePromise=null,n.pendingStateContextKey=null,Rm(null,{contextKey:t,status:"skipped",error:e})}function f7(e={}){const t=oa,n=!!e.mockEnabled,a=e.baseUrl??"",i=cC({...e,baseUrl:a,mockEnabled:n}),s=e.period||tC,l=e.pageSize??sC(),u=e.offset??nC,h=lC(e),f=dy({accessMode:i,baseUrl:a,mockEnabled:n,offset:u,pageSize:l,period:s,userId:h});if(!n&&e.authLoading)return Promise.resolve(Pu("auth-loading",f));if(!n&&!e.signedIn&&i!=="public")return Promise.resolve(Pu("not-signed-in",f));if(!n&&!a)return Promise.resolve(Pu("missing-base-url",f));if(!n&&i==="unavailable")return Promise.resolve(Pu("access-unavailable",f));const p=t.targets.leaderboard,g=h7(f);if(g)return Promise.resolve(g);if(p.stateStatus==="pending"&&p.statePromise&&p.pendingStateContextKey===f)return p.statePromise;const v=p.stateRequestId+1;p.stateRequestId=v,p.stateStatus="pending",p.pendingStateContextKey=f,p.error=null;const _=Promise.resolve().then(()=>WD({userId:h,period:s,limit:l,offset:u})).then(w=>oa!==t||p.stateRequestId!==v||p.statePromise!==_?null:(p.pendingStateContextKey=null,Rm(w,{contextKey:f}))).catch(w=>(oa!==t||p.stateRequestId!==v||p.statePromise!==_||(p.pendingStateContextKey=null,Rm(null,{contextKey:f,status:"rejected",error:w})),null));return p.statePromise=_,_}const p7=typeof window<"u"?window.location.search:"",X0=new URLSearchParams(p7),Su=X0.get("insforge_code")||X0.get("code")||null,m7=typeof window<"u"&&!!window.webkit?.messageHandlers?.nativeOAuth;function g7(){ql();const{loading:e,signedIn:t}=eo(),n=ss(),[a,i]=b.useState("processing"),[s,l]=b.useState(null),u=b.useRef(!1);b.useEffect(()=>{if(!(!Su||u.current)){if(u.current=!0,m7){l(!1);return}(async()=>{try{const p=await(await fetch("/api/auth-bridge/verifier")).json();l(!!p?.native)}catch{l(!1)}})()}},[]),b.useEffect(()=>{if(s!==!0||!Su)return;i("redirecting");const f=setTimeout(()=>{window.location.href=`tokentracker://auth/callback?insforge_code=${encodeURIComponent(Su)}`},200);return()=>clearTimeout(f)},[s]),b.useEffect(()=>{if(s!==!1||e)return;if(t){n("/dashboard",{replace:!0});return}const f=setTimeout(()=>{t||i("failed")},12e3);return()=>clearTimeout(f)},[s,e,t,n]),b.useEffect(()=>{if(!Su&&s===null){const f=setTimeout(()=>i("failed"),3e3);return()=>clearTimeout(f)}},[s]);const h=()=>{n("/dashboard",{replace:!0})};return a==="processing"&&s!==!0&&(s===null||s===!1&&e)?T.jsx("div",{className:"min-h-screen bg-oai-gray-950"}):T.jsx("div",{className:"min-h-screen bg-oai-gray-950 text-white font-oai antialiased dark flex items-center justify-center",children:T.jsxs("div",{className:"text-center space-y-4 max-w-sm px-4",children:[a==="processing"&&T.jsxs(T.Fragment,{children:[T.jsx("div",{className:"w-8 h-8 border-2 border-oai-gray-600 border-t-white rounded-full animate-spin mx-auto"}),T.jsx("p",{className:"text-oai-gray-400 text-sm",children:De("auth.callback.processing")})]}),a==="redirecting"&&T.jsxs(T.Fragment,{children:[T.jsx("div",{className:"w-12 h-12 mx-auto rounded-full bg-green-500/15 flex items-center justify-center",children:T.jsx("svg",{className:"w-6 h-6 text-green-400",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:T.jsx("path",{d:"M20 6 9 17l-5-5"})})}),T.jsx("p",{className:"text-white text-sm font-medium",children:De("auth.callback.success")}),T.jsx("p",{className:"text-oai-gray-500 text-xs",children:De("auth.callback.redirecting")})]}),a==="failed"&&T.jsxs("div",{className:"space-y-3",children:[T.jsx("p",{className:"text-oai-gray-300 text-sm",children:De("auth.callback.failed")}),T.jsx("button",{type:"button",onClick:h,className:"px-4 py-2 rounded-lg bg-oai-gray-800 text-sm text-white hover:bg-oai-gray-700 transition-colors",children:De("auth.callback.close")})]})]})})}const y7=b.lazy(()=>Dn(()=>import("./DashboardPage-CZkSRYE8.js"),__vite__mapDeps([14,1,12,15,16,17,11,3,9,10,18,19,4])).then(e=>({default:e.DashboardPage}))),v7=b.lazy(()=>Dn(()=>import("./IpCheckPage-C7-NXbFK.js"),[])),b7=b.lazy(()=>Dn(()=>import("./LandingPage-ouOFlABY.js"),__vite__mapDeps([20,21,18])).then(e=>({default:e.LandingPage}))),k7=b.lazy(()=>Dn(()=>import("./LeaderboardPage-CC4CFYAe.js"),__vite__mapDeps([8,9,10,11,12,13])).then(e=>({default:e.LeaderboardPage}))),_7=b.lazy(()=>Dn(()=>import("./LeaderboardProfilePage-DtDMfVuQ.js"),__vite__mapDeps([22,12,21,23,13,15,16,6,11,17,7])).then(e=>({default:e.LeaderboardProfilePage}))),w7=b.lazy(()=>Dn(()=>import("./LimitsPage-qaD7Reti.js"),__vite__mapDeps([0,1,2,3,4,5,6,7])).then(e=>({default:e.LimitsPage}))),x7=b.lazy(()=>Dn(()=>import("./LoginPage-BLPY2ZI-.js"),[]).then(e=>({default:e.LoginPage}))),P7=b.lazy(()=>Dn(()=>import("./DevicePage-BIBlmBPl.js"),[])),S7=b.lazy(()=>Dn(()=>import("./WrappedPage-BYhKuiTb.js"),[])),C7=b.lazy(()=>Dn(()=>import("./SettingsPage-De7GbtPf.js"),__vite__mapDeps([24,2,25,3,11,12,9,10,16,7])).then(e=>({default:e.SettingsPage}))),T7=b.lazy(()=>Dn(()=>import("./SkillsPage-jpoYzUBQ.js"),__vite__mapDeps([26,5,6,7,3,17,11,16,12,19,10])).then(e=>({default:e.SkillsPage}))),E7=b.lazy(()=>Dn(()=>import("./WidgetsPage-BaEYiZZH.js"),__vite__mapDeps([27,9,10,11,25,3,4,6,7])).then(e=>({default:e.WidgetsPage})));function A7(){const{resolvedLocale:e}=ql(),t=Mn(),n=eo();r8();const a=b.useRef(!1),i=b.useRef(!1),s=b.useRef(new Set),l=xn(),u=b.useMemo(()=>typeof window>"u"?!1:qj(window.location.search),[]),h=t?.pathname||"/",f=new URL(window.location.href),p=f.pathname.replace(/\/+$/,"")||"/",v=p.match(/^\/share\/([^/?#]+)$/i)?.[1]||null,_=f.searchParams.get("token")||null,w=v||_,S=p==="/share"||p==="/share.html"||p.startsWith("/share/"),P=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"),D=h.replace(/\/+$/,"")||"/",R=D==="/"||D==="/dashboard",E=D==="/leaderboard",A=D.match(/^\/u\/([^/]+)$/i),U=A?A[1]:null,z=!!(n.enabled&&n.signedIn),j=P||z,C=!1,K=Gj(),Y=!j&&!l&&!P,ce=l?"mock":n.loading?"unavailable":z?"cloud":j?"local":"unavailable",re=b.useCallback(()=>{if(!a.current||!l&&n.loading||!l&&!j)return;const pe={accessMode:ce,baseUrl:Kj(),mockEnabled:l,signedIn:j,authLoading:!!n.loading,userId:z&&n.user?.id||null},ke=dy(pe);s.current.has(ke)||(s.current.add(ke),f7(pe))},[z,n.loading,n.user?.id,ce,l,j]),fe=b.useCallback(()=>{R&&(a.current||(a.current=!0,c7()),i.current||(i.current=!0,d7()),re())},[R,re]);b.useEffect(()=>{re()},[re]);const de=b.useMemo(()=>!n.enabled||!z?null:{getAccessToken:()=>n.getAccessToken(),name:n.displayName||"",userId:n.user?.id||null},[z,n]);let he=P||l||u?"dashboard":"landing";D==="/landing"&&(he="landing"),D==="/dashboard"&&(he="dashboard"),E&&(he="dashboard"),U&&(he="dashboard");const oe=D==="/limits",X=D==="/settings",Z=D==="/skills",Q=D==="/widgets",V=D==="/ip-check";(oe||X||Z||Q||V)&&(he="dashboard");let I=y7;U?I=_7:D==="/leaderboard"?I=k7:oe?I=w7:X?I=C7:Z?I=T7:Q?I=E7:V&&(I=v7);const G=!S&&!Y&&(D==="/dashboard"||D==="/"||E||oe||X||Z||Q||V);if(!P&&!z&&!S&&!n.loading&&he==="dashboard"&&!E&&!U&&D!=="/login"&&D!=="/landing"&&D!=="/auth/callback"&&D!=="/auth/native-callback")return T.jsx(jE,{to:"/login",replace:!0});let me=null;if(D==="/auth/callback"||D==="/auth/native-callback")me=T.jsx(g7,{});else if(D==="/login")me=T.jsx(x7,{});else if(D==="/device")me=T.jsx(P7,{});else if(D==="/wrapped")me=T.jsx(S7,{});else if(he==="landing")me=T.jsx(b7,{signInUrl:"/login",signUpUrl:"/login"});else{const pe=T.jsx(I,{baseUrl:K,auth:de,signedIn:j,sessionSoftExpired:C,signOut:()=>n.enabled?n.signOut():Promise.resolve(),publicMode:S,publicToken:w,userId:U,signInUrl:"/login",signUpUrl:"/login",onMainContentVisible:fe},e);G?me=T.jsx(_8,{children:pe}):me=pe}return T.jsx(HI,{children:T.jsx(KI,{children:T.jsx(Y9,{children:T.jsxs(qI,{children:[T.jsx(b.Suspense,{fallback:null,children:me}),G?T.jsx(H8,{}):null,T.jsx(Hj,{}),T.jsx(qM,{}),T.jsx(iI,{})]})})})})}const R7=cA([{path:"*",element:T.jsx(A7,{})}]);QT.createRoot(document.getElementById("root")).render(T.jsx(Xo.StrictMode,{children:T.jsx(TM,{children:T.jsx(IM,{children:T.jsx(ZD,{children:T.jsx(XD,{children:T.jsx(_A,{router:R7})})})})})}));export{Dn as $,Ct as A,mB as B,J7 as C,kB as D,lB as E,Fx as F,De as G,Nu as H,X7 as I,Z7 as J,Dl as K,Rd as L,$I as M,CB as N,cB as O,z7 as P,F7 as Q,Xo as R,FP as S,i8 as T,z8 as U,St as V,h1 as W,gg as X,eo as Y,hg as Z,$j as _,Jl as a,_l as a$,K7 as a0,WD as a1,ql as a2,qj as a3,ni as a4,SB as a5,oB as a6,Q7 as a7,dD as a8,V7 as a9,AB as aA,U7 as aB,nB as aC,jd as aD,zI as aE,o8 as aF,GF as aG,OI as aH,fB as aI,L7 as aJ,QL as aK,yg as aL,Wp as aM,qk as aN,tB as aO,c1 as aP,l1 as aQ,TI as aR,q7 as aS,as as aT,sd as aU,Xx as aV,Qx as aW,Jx as aX,e1 as aY,DI as aZ,Ca as a_,$7 as aa,WF as ab,sB as ac,Y7 as ad,G7 as ae,A0 as af,EB as ag,$4 as ah,vt as ai,nn as aj,gd as ak,vg as al,is as am,$g as an,f1 as ao,li as ap,y_ as aq,ls as ar,Mn as as,ss as at,Kj as au,Gp as av,dy as aw,h7 as ax,Rm as ay,eD as az,z9 as b,p9 as b$,PB as b0,wB as b1,kS as b2,Ka as b3,vs as b4,ys as b5,cU as b6,V0 as b7,iy as b8,Fi as b9,kU as bA,Xi as bB,ty as bC,Ta as bD,PS as bE,zi as bF,Vi as bG,JB as bH,ZB as bI,Pr as bJ,IF as bK,uU as bL,MF as bM,UF as bN,TF as bO,F9 as bP,_a as bQ,zF as bR,wp as bS,PF as bT,GU as bU,SF as bV,AF as bW,Tl as bX,$F as bY,LF as bZ,b9 as b_,xr as ba,CF as bb,VS as bc,DF as bd,k9 as be,y9 as bf,V8 as bg,DB as bh,RB as bi,zB as bj,VB as bk,$B as bl,II as bm,LB as bn,MB as bo,HF as bp,IB as bq,UB as br,NB as bs,OB as bt,jB as bu,FB as bv,BB as bw,iF as bx,Yg as by,Ul as bz,an as c,EF as c$,ci as c0,MM as c1,cg as c2,xB as c3,_B as c4,bU as c5,TU as c6,dF as c7,RS as c8,MU as c9,_S as cA,KB as cB,yU as cC,kp as cD,gU as cE,QS as cF,tF as cG,eF as cH,F0 as cI,yF as cJ,vF as cK,Zo as cL,bp as cM,BF as cN,kF as cO,Tm as cP,bF as cQ,_F as cR,CU as cS,yp as cT,vp as cU,wF as cV,Pa as cW,aF as cX,rF as cY,SU as cZ,DS as c_,Cm as ca,fF as cb,pF as cc,hF as cd,LS as ce,EU as cf,AU as cg,IU as ch,mF as ci,gF as cj,sF as ck,DU as cl,uF as cm,LU as cn,dU as co,N0 as cp,cF as cq,lF as cr,Wd as cs,hU as ct,wm as cu,wS as cv,WB as cw,mU as cx,GB as cy,Aa as cz,jF as d,YB as d0,HB as d1,rU as d2,NF as d3,FF as d4,RF as d5,qB as d6,VF as d7,OF as d8,Pd as d9,$9 as da,ay as db,V9 as dc,v9 as dd,KU as de,xF as df,WU as dg,XB as dh,nF as di,QB as dj,oF as dk,ny as dl,j0 as dm,sy as dn,rB as dp,iB as dq,aB as dr,er as ds,W6 as e,B7 as f,zx as g,iD as h,xn as i,T as j,bB as k,pB as l,Cl as m,kD as n,_D as o,gB as p,uB as q,b as r,W7 as s,eB as t,j9 as u,yB as v,dB as w,vB as x,hB as y,H7 as z};
|
|
995
|
+
`),()=>{u.current?.removeAttribute("data-motion-pop-id"),j.contains(z)&&j.removeChild(z)}},[t]),T.jsx(IO,{isPresent:t,childRef:u,sizeRef:h,pop:s,children:s===!1?e:b.cloneElement(e,{ref:g})})}const OO=({children:e,initial:t,isPresent:n,onExitComplete:a,custom:i,presenceAffectsLayout:s,mode:l,anchorX:u,anchorY:h,root:f})=>{const p=vg(jO),g=b.useId();let v=!0,_=b.useMemo(()=>(v=!1,{id:g,initial:t,isPresent:n,custom:i,onExitComplete:w=>{p.set(w,!0);for(const S of p.values())if(!S)return;a&&a()},register:w=>(p.set(w,!1),()=>p.delete(w))}),[n,p,a]);return s&&v&&(_={..._}),b.useMemo(()=>{p.forEach((w,S)=>p.set(S,!1))},[n]),b.useEffect(()=>{!n&&!p.size&&a&&a()},[n]),e=T.jsx(NO,{pop:l==="popLayout",isPresent:n,anchorX:u,anchorY:h,root:f,children:e}),T.jsx(Bd.Provider,{value:_,children:e})};function jO(){return new Map}function BP(e=!0){const t=b.useContext(Bd);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:a,register:i}=t,s=b.useId();b.useEffect(()=>{if(e)return i(s)},[e]);const l=b.useCallback(()=>e&&a&&a(s),[s,a,e]);return!n&&a?[!1,l]:[!0]}const pu=e=>e.key||"";function o0(e){const t=[];return b.Children.forEach(e,n=>{b.isValidElement(n)&&t.push(n)}),t}const FP=({children:e,custom:t,initial:n=!0,onExitComplete:a,presenceAffectsLayout:i=!0,mode:s="sync",propagate:l=!1,anchorX:u="left",anchorY:h="top",root:f})=>{const[p,g]=BP(l),v=b.useMemo(()=>o0(e),[e]),_=l&&!p?[]:v.map(pu),w=b.useRef(!0),S=b.useRef(v),P=vg(()=>new Map),D=b.useRef(new Set),[R,E]=b.useState(v),[A,U]=b.useState(v);f1(()=>{w.current=!1,S.current=v;for(let C=0;C<A.length;C++){const K=pu(A[C]);_.includes(K)?(P.delete(K),D.current.delete(K)):P.get(K)!==!0&&P.set(K,!1)}},[A,_.length,_.join("-")]);const z=[];if(v!==R){let C=[...v];for(let K=0;K<A.length;K++){const Y=A[K],ce=pu(Y);_.includes(ce)||(C.splice(K,0,Y),z.push(Y))}return s==="wait"&&z.length&&(C=z),U(o0(C)),E(v),null}const{forceRender:j}=b.useContext(yg);return T.jsx(T.Fragment,{children:A.map(C=>{const K=pu(C),Y=l&&!p?!1:v===A||_.includes(K),ce=()=>{if(D.current.has(K))return;if(P.has(K))D.current.add(K),P.set(K,!0);else return;let re=!0;P.forEach(fe=>{fe||(re=!1)}),re&&(j?.(),U(S.current),l&&g?.(),a&&a())};return T.jsx(OO,{isPresent:Y,initial:!w.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:s,root:f,onExitComplete:Y?void 0:ce,anchorX:u,anchorY:h,children:C},K)})})},zP=b.createContext({strict:!1}),s0={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let l0=!1;function UO(){if(l0)return;const e={};for(const t in s0)e[t]={isEnabled:n=>s0[t].some(a=>!!n[a])};mP(e),l0=!0}function VP(){return UO(),wN()}function BO(e){const t=VP();for(const n in e)t[n]={...t[n],...e[n]};mP(t)}const FO=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function wd(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||FO.has(e)}let $P=e=>!wd(e);function zO(e){typeof e=="function"&&($P=t=>t.startsWith("on")?!wd(t):e(t))}try{zO(require("@emotion/is-prop-valid").default)}catch{}function VO(e,t,n){const a={};for(const i in e)i==="values"&&typeof e.values=="object"||nn(e[i])||($P(i)||n===!0&&wd(i)||!t&&!wd(i)||e.draggable&&i.startsWith("onDrag"))&&(a[i]=e[i]);return a}const $d=b.createContext({});function $O(e,t){if(Vd(e)){const{initial:n,animate:a}=e;return{initial:n===!1||Ol(n)?n:void 0,animate:Ol(a)?a:void 0}}return e.inherit!==!1?t:{}}function HO(e){const{initial:t,animate:n}=$O(e,b.useContext($d));return b.useMemo(()=>({initial:t,animate:n}),[c0(t),c0(n)])}function c0(e){return Array.isArray(e)?e.join(" "):e}const Hg=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function HP(e,t,n){for(const a in t)!nn(t[a])&&!wP(a,n)&&(e[a]=t[a])}function WO({transformTemplate:e},t){return b.useMemo(()=>{const n=Hg();return zg(n,t,e),Object.assign({},n.vars,n.style)},[t])}function GO(e,t){const n=e.style||{},a={};return HP(a,n,e),Object.assign(a,WO(e,t)),a}function KO(e,t){const n={},a=GO(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,a.userSelect=a.WebkitUserSelect=a.WebkitTouchCallout="none",a.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=a,n}const WP=()=>({...Hg(),attrs:{}});function qO(e,t,n,a){const i=b.useMemo(()=>{const s=WP();return xP(s,t,SP(a),e.transformTemplate,e.style),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};HP(s,e.style,e),i.style={...s,...i.style}}return i}const YO=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Wg(e){return typeof e!="string"||e.includes("-")?!1:!!(YO.indexOf(e)>-1||/[A-Z]/u.test(e))}function ZO(e,t,n,{latestValues:a},i,s=!1,l){const h=(l??Wg(e)?qO:KO)(t,a,i,e),f=VO(t,typeof e=="string",s),p=e!==b.Fragment?{...f,...h,ref:n}:{},{children:g}=t,v=b.useMemo(()=>nn(g)?g.get():g,[g]);return b.createElement(e,{...p,children:v})}function XO({scrapeMotionValuesFromProps:e,createRenderState:t},n,a,i){return{latestValues:QO(n,a,i,e),renderState:t()}}function QO(e,t,n,a){const i={},s=a(e,{});for(const v in s)i[v]=Hu(s[v]);let{initial:l,animate:u}=e;const h=Vd(e),f=fP(e);t&&f&&!h&&e.inherit!==!1&&(l===void 0&&(l=t.initial),u===void 0&&(u=t.animate));let p=n?n.initial===!1:!1;p=p||l===!1;const g=p?u:l;if(g&&typeof g!="boolean"&&!zd(g)){const v=Array.isArray(g)?g:[g];for(let _=0;_<v.length;_++){const w=Mg(e,v[_]);if(w){const{transitionEnd:S,transition:P,...D}=w;for(const R in D){let E=D[R];if(Array.isArray(E)){const A=p?E.length-1:0;E=E[A]}E!==null&&(i[R]=E)}for(const R in S)i[R]=S[R]}}}return i}const GP=e=>(t,n)=>{const a=b.useContext($d),i=b.useContext(Bd),s=()=>XO(e,t,a,i);return n?s():vg(s)},JO=GP({scrapeMotionValuesFromProps:Vg,createRenderState:Hg}),e6=GP({scrapeMotionValuesFromProps:CP,createRenderState:WP}),t6=Symbol.for("motionComponentSymbol");function n6(e,t,n){const a=b.useRef(n);b.useInsertionEffect(()=>{a.current=n});const i=b.useRef(null);return b.useCallback(s=>{s&&e.onMount?.(s),t&&(s?t.mount(s):t.unmount());const l=a.current;if(typeof l=="function")if(s){const u=l(s);typeof u=="function"&&(i.current=u)}else i.current?(i.current(),i.current=null):l(s);else l&&(l.current=s)},[t])}const KP=b.createContext({});function Vo(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function a6(e,t,n,a,i,s){const{visualElement:l}=b.useContext($d),u=b.useContext(zP),h=b.useContext(Bd),f=b.useContext($g),p=f.reducedMotion,g=f.skipAnimations,v=b.useRef(null),_=b.useRef(!1);a=a||u.renderer,!v.current&&a&&(v.current=a(e,{visualState:t,parent:l,props:n,presenceContext:h,blockInitialAnimation:h?h.initial===!1:!1,reducedMotionConfig:p,skipAnimations:g,isSVG:s}),_.current&&v.current&&(v.current.manuallyAnimateOnMount=!0));const w=v.current,S=b.useContext(KP);w&&!w.projection&&i&&(w.type==="html"||w.type==="svg")&&r6(v.current,n,i,S);const P=b.useRef(!1);b.useInsertionEffect(()=>{w&&P.current&&w.update(n,h)});const D=n[tP],R=b.useRef(!!D&&typeof window<"u"&&!window.MotionHandoffIsComplete?.(D)&&window.MotionHasOptimisedAnimation?.(D));return f1(()=>{_.current=!0,w&&(P.current=!0,window.MotionIsMounted=!0,w.updateFeatures(),w.scheduleRenderMicrotask(),R.current&&w.animationState&&w.animationState.animateChanges())}),b.useEffect(()=>{w&&(!R.current&&w.animationState&&w.animationState.animateChanges(),R.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(D)}),R.current=!1),w.enteringChildren=void 0)}),w}function r6(e,t,n,a){const{layoutId:i,layout:s,drag:l,dragConstraints:u,layoutScroll:h,layoutRoot:f,layoutAnchor:p,layoutCrossfade:g}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:qP(e.parent)),e.projection.setOptions({layoutId:i,layout:s,alwaysMeasureLayout:!!l||u&&Vo(u),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:a,crossfade:g,layoutScroll:h,layoutRoot:f,layoutAnchor:p})}function qP(e){if(e)return e.options.allowProjection!==!1?e.projection:qP(e.parent)}function ap(e,{forwardMotionProps:t=!1,type:n}={},a,i){a&&BO(a);const s=n?n==="svg":Wg(e),l=s?e6:JO;function u(f,p){let g;const v={...b.useContext($g),...f,layoutId:i6(f)},{isStatic:_}=v,w=HO(f),S=l(f,_);if(!_&&typeof window<"u"){o6();const P=s6(v);g=P.MeasureLayout,w.visualElement=a6(e,S,v,i,P.ProjectionNode,s)}return T.jsxs($d.Provider,{value:w,children:[g&&w.visualElement?T.jsx(g,{visualElement:w.visualElement,...v}):null,ZO(e,f,n6(S,w.visualElement,p),S,_,t,s)]})}u.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const h=b.forwardRef(u);return h[t6]=e,h}function i6({layoutId:e}){const t=b.useContext(yg).id;return t&&e!==void 0?t+"-"+e:e}function o6(e,t){b.useContext(zP).strict}function s6(e){const t=VP(),{drag:n,layout:a}=t;if(!n&&!a)return{};const i={...n,...a};return{MeasureLayout:n?.isEnabled(e)||a?.isEnabled(e)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}function l6(e,t){if(typeof Proxy>"u")return ap;const n=new Map,a=(s,l)=>ap(s,l,e,t),i=(s,l)=>a(s,l);return new Proxy(i,{get:(s,l)=>l==="create"?a:(n.has(l)||n.set(l,ap(l,void 0,e,t)),n.get(l))})}const c6=(e,t)=>t.isSVG??Wg(e)?new BN(t):new MN(t,{allowProjection:e!==b.Fragment});class u6 extends ui{constructor(t){super(t),t.animationState||(t.animationState=HN(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();zd(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let d6=0;class h6 extends ui{constructor(){super(...arguments),this.id=d6++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:a}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===a)return;if(t&&a===!1){if(this.isExitComplete){const{initial:s,custom:l}=this.node.getProps();if(typeof s=="string"||typeof s=="object"&&s!==null&&!Array.isArray(s)){const u=Hi(this.node,s,l);if(u){const{transition:h,transitionEnd:f,...p}=u;for(const g in p)this.node.getValue(g)?.jump(p[g])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const i=this.node.animationState.setActive("exit",!t);n&&!t&&i.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const f6={animation:{Feature:u6},exit:{Feature:h6}};function Ql(e){return{point:{x:e.pageX,y:e.pageY}}}const p6=e=>t=>Og(t)&&e(t,Ql(t));function Sl(e,t,n,a){return jl(e,t,p6(n),a)}const YP=({current:e})=>e?e.ownerDocument.defaultView:null,u0=(e,t)=>Math.abs(e-t);function m6(e,t){const n=u0(e.x,t.x),a=u0(e.y,t.y);return Math.sqrt(n**2+a**2)}const d0=new Set(["auto","scroll"]);class ZP{constructor(t,n,{transformPagePoint:a,contextWindow:i=window,dragSnapToOrigin:s=!1,distanceThreshold:l=3,element:u}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=_=>{this.handleScroll(_.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=mu(this.lastRawMoveEventInfo,this.transformPagePoint));const _=rp(this.lastMoveEventInfo,this.history),w=this.startEvent!==null,S=m6(_.offset,{x:0,y:0})>=this.distanceThreshold;if(!w&&!S)return;const{point:P}=_,{timestamp:D}=tn;this.history.push({...P,timestamp:D});const{onStart:R,onMove:E}=this.handlers;w||(R&&R(this.lastMoveEvent,_),this.startEvent=this.lastMoveEvent),E&&E(this.lastMoveEvent,_)},this.handlePointerMove=(_,w)=>{this.lastMoveEvent=_,this.lastRawMoveEventInfo=w,this.lastMoveEventInfo=mu(w,this.transformPagePoint),vt.update(this.updatePoint,!0)},this.handlePointerUp=(_,w)=>{this.end();const{onEnd:S,onSessionEnd:P,resumeAnimation:D}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&D&&D(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const R=rp(_.type==="pointercancel"?this.lastMoveEventInfo:mu(w,this.transformPagePoint),this.history);this.startEvent&&S&&S(_,R),P&&P(_,R)},!Og(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=a,this.distanceThreshold=l,this.contextWindow=i||window;const h=Ql(t),f=mu(h,this.transformPagePoint),{point:p}=f,{timestamp:g}=tn;this.history=[{...p,timestamp:g}];const{onSessionStart:v}=n;v&&v(t,rp(f,this.history)),this.removeListeners=Yl(Sl(this.contextWindow,"pointermove",this.handlePointerMove),Sl(this.contextWindow,"pointerup",this.handlePointerUp),Sl(this.contextWindow,"pointercancel",this.handlePointerUp)),u&&this.startScrollTracking(u)}startScrollTracking(t){let n=t.parentElement;for(;n;){const a=getComputedStyle(n);(d0.has(a.overflowX)||d0.has(a.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const n=this.scrollPositions.get(t);if(!n)return;const a=t===window,i=a?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},s={x:i.x-n.x,y:i.y-n.y};s.x===0&&s.y===0||(a?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=s.x,this.lastMoveEventInfo.point.y+=s.y):this.history.length>0&&(this.history[0].x-=s.x,this.history[0].y-=s.y),this.scrollPositions.set(t,i),vt.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),li(this.updatePoint)}}function mu(e,t){return t?{point:t(e.point)}:e}function h0(e,t){return{x:e.x-t.x,y:e.y-t.y}}function rp({point:e},t){return{point:e,delta:h0(e,XP(t)),offset:h0(e,g6(t)),velocity:y6(t,.1)}}function g6(e){return e[0]}function XP(e){return e[e.length-1]}function y6(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,a=null;const i=XP(e);for(;n>=0&&(a=e[n],!(i.timestamp-a.timestamp>Wn(t)));)n--;if(!a)return{x:0,y:0};a===e[0]&&e.length>2&&i.timestamp-a.timestamp>Wn(t)*2&&(a=e[1]);const s=aa(i.timestamp-a.timestamp);if(s===0)return{x:0,y:0};const l={x:(i.x-a.x)/s,y:(i.y-a.y)/s};return l.x===1/0&&(l.x=0),l.y===1/0&&(l.y=0),l}function v6(e,{min:t,max:n},a){return t!==void 0&&e<t?e=a?yt(t,e,a.min):Math.max(e,t):n!==void 0&&e>n&&(e=a?yt(n,e,a.max):Math.min(e,n)),e}function f0(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function b6(e,{top:t,left:n,bottom:a,right:i}){return{x:f0(e.x,n,i),y:f0(e.y,t,a)}}function p0(e,t){let n=t.min-e.min,a=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,a]=[a,n]),{min:n,max:a}}function k6(e,t){return{x:p0(e.x,t.x),y:p0(e.y,t.y)}}function _6(e,t){let n=.5;const a=kn(e),i=kn(t);return i>a?n=Il(t.min,t.max-a,e.min):a>i&&(n=Il(e.min,e.max-i,t.min)),tr(0,1,n)}function w6(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const vm=.35;function x6(e=vm){return e===!1?e=0:e===!0&&(e=vm),{x:m0(e,"left","right"),y:m0(e,"top","bottom")}}function m0(e,t,n){return{min:g0(e,t),max:g0(e,n)}}function g0(e,t){return typeof e=="number"?e:e[t]||0}const P6=new WeakMap;class S6{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Kt(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:a}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const s=g=>{n&&this.snapToCursor(Ql(g).point),this.stopAnimation()},l=(g,v)=>{const{drag:_,dragPropagation:w,onDragStart:S}=this.getProps();if(_&&!w&&(this.openDragLock&&this.openDragLock(),this.openDragLock=J5(_),!this.openDragLock))return;this.latestPointerEvent=g,this.latestPanInfo=v,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Ha(D=>{let R=this.getAxisMotionValue(D).get()||0;if(Ya.test(R)){const{projection:E}=this.visualElement;if(E&&E.layout){const A=E.layout.layoutBox[D];A&&(R=kn(A)*(parseFloat(R)/100))}}this.originPoint[D]=R}),S&&vt.update(()=>S(g,v),!1,!0),cm(this.visualElement,"transform");const{animationState:P}=this.visualElement;P&&P.setActive("whileDrag",!0)},u=(g,v)=>{this.latestPointerEvent=g,this.latestPanInfo=v;const{dragPropagation:_,dragDirectionLock:w,onDirectionLock:S,onDrag:P}=this.getProps();if(!_&&!this.openDragLock)return;const{offset:D}=v;if(w&&this.currentDirection===null){this.currentDirection=T6(D),this.currentDirection!==null&&S&&S(this.currentDirection);return}this.updateAxis("x",v.point,D),this.updateAxis("y",v.point,D),this.visualElement.render(),P&&vt.update(()=>P(g,v),!1,!0)},h=(g,v)=>{this.latestPointerEvent=g,this.latestPanInfo=v,this.stop(g,v),this.latestPointerEvent=null,this.latestPanInfo=null},f=()=>{const{dragSnapToOrigin:g}=this.getProps();(g||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:p}=this.getProps();this.panSession=new ZP(t,{onSessionStart:s,onStart:l,onMove:u,onSessionEnd:h,resumeAnimation:f},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:p,distanceThreshold:a,contextWindow:YP(this.visualElement),element:this.visualElement.current})}stop(t,n){const a=t||this.latestPointerEvent,i=n||this.latestPanInfo,s=this.isDragging;if(this.cancel(),!s||!i||!a)return;const{velocity:l}=i;this.startAnimation(l);const{onDragEnd:u}=this.getProps();u&&vt.postRender(()=>u(a,i))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:a}=this.getProps();!a&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,n,a){const{drag:i}=this.getProps();if(!a||!gu(t,i,this.currentDirection))return;const s=this.getAxisMotionValue(t);let l=this.originPoint[t]+a[t];this.constraints&&this.constraints[t]&&(l=v6(l,this.constraints[t],this.elastic[t])),s.set(l)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),a=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,i=this.constraints;t&&Vo(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&a?this.constraints=b6(a.layoutBox,t):this.constraints=!1,this.elastic=x6(n),i!==this.constraints&&!Vo(t)&&a&&this.constraints&&!this.hasMutatedConstraints&&Ha(s=>{this.constraints!==!1&&this.getAxisMotionValue(s)&&(this.constraints[s]=w6(a.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Vo(t))return!1;const a=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;i.root&&(i.root.scroll=void 0,i.root.updateScroll());const s=TN(a,i.root,this.visualElement.getTransformPagePoint());let l=k6(i.layout.layoutBox,s);if(n){const u=n(PN(l));this.hasMutatedConstraints=!!u,u&&(l=yP(u))}return l}startAnimation(t){const{drag:n,dragMomentum:a,dragElastic:i,dragTransition:s,dragSnapToOrigin:l,onDragTransitionEnd:u}=this.getProps(),h=this.constraints||{},f=Ha(p=>{if(!gu(p,n,this.currentDirection))return;let g=h&&h[p]||{};(l===!0||l===p)&&(g={min:0,max:0});const v=i?200:1e6,_=i?40:1e7,w={type:"inertia",velocity:a?t[p]:0,bounceStiffness:v,bounceDamping:_,timeConstant:750,restDelta:1,restSpeed:10,...s,...g};return this.startAxisValueAnimation(p,w)});return Promise.all(f).then(u)}startAxisValueAnimation(t,n){const a=this.getAxisMotionValue(t);return cm(this.visualElement,t),a.start(Dg(t,a,0,n,this.visualElement,!1))}stopAnimation(){Ha(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,i=this.visualElement.getProps()[n];return i||this.visualElement.getValue(t,this.visualElement.latestValues[t]??0)}snapToCursor(t){Ha(n=>{const{drag:a}=this.getProps();if(!gu(n,a,this.currentDirection))return;const{projection:i}=this.visualElement,s=this.getAxisMotionValue(n);if(i&&i.layout){const{min:l,max:u}=i.layout.layoutBox[n],h=s.get()||0;s.set(t[n]-yt(l,u,.5)+h)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:a}=this.visualElement;if(!Vo(n)||!a||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Ha(l=>{const u=this.getAxisMotionValue(l);if(u&&this.constraints!==!1){const h=u.get();i[l]=_6({min:h,max:h},this.constraints[l])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",a.root&&a.root.updateScroll(),a.updateLayout(),this.constraints=!1,this.resolveConstraints(),Ha(l=>{if(!gu(l,t,null))return;const u=this.getAxisMotionValue(l),{min:h,max:f}=this.constraints[l];u.set(yt(h,f,i[l]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;P6.set(this.visualElement,this);const t=this.visualElement.current,n=Sl(t,"pointerdown",f=>{const{drag:p,dragListener:g=!0}=this.getProps(),v=f.target,_=v!==t&&iN(v);p&&g&&!_&&this.start(f)});let a;const i=()=>{const{dragConstraints:f}=this.getProps();Vo(f)&&f.current&&(this.constraints=this.resolveRefConstraints(),a||(a=C6(t,f.current,()=>this.scalePositionWithinConstraints())))},{projection:s}=this.visualElement,l=s.addEventListener("measure",i);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),vt.read(i);const u=jl(window,"resize",()=>this.scalePositionWithinConstraints()),h=s.addEventListener("didUpdate",(({delta:f,hasLayoutChanged:p})=>{this.isDragging&&p&&(Ha(g=>{const v=this.getAxisMotionValue(g);v&&(this.originPoint[g]+=f[g].translate,v.set(v.get()+f[g].translate))}),this.visualElement.render())}));return()=>{u(),n(),l(),h&&h(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:a=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:l=vm,dragMomentum:u=!0}=t;return{...t,drag:n,dragDirectionLock:a,dragPropagation:i,dragConstraints:s,dragElastic:l,dragMomentum:u}}}function y0(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function C6(e,t,n){const a=P_(e,y0(n)),i=P_(t,y0(n));return()=>{a(),i()}}function gu(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function T6(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class E6 extends ui{constructor(t){super(t),this.removeGroupControls=ia,this.removeListeners=ia,this.controls=new S6(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ia}update(){const{dragControls:t}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};t!==n&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const ip=e=>(t,n)=>{e&&vt.update(()=>e(t,n),!1,!0)};class A6 extends ui{constructor(){super(...arguments),this.removePointerDownListener=ia}onPointerDown(t){this.session=new ZP(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:YP(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:a,onPanEnd:i}=this.node.getProps();return{onSessionStart:ip(t),onStart:ip(n),onMove:ip(a),onEnd:(s,l)=>{delete this.session,i&&vt.postRender(()=>i(s,l))}}}mount(){this.removePointerDownListener=Sl(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let op=!1;class R6 extends b.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:a,layoutId:i}=this.props,{projection:s}=t;s&&(n.group&&n.group.add(s),a&&a.register&&i&&a.register(s),op&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Wu.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:a,drag:i,isPresent:s}=this.props,{projection:l}=a;return l&&(l.isPresent=s,t.layoutDependency!==n&&l.setOptions({...l.options,layoutDependency:n}),op=!0,i||t.layoutDependency!==n||n===void 0||t.isPresent!==s?l.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?l.promote():l.relegate()||vt.postRender(()=>{const u=l.getStack();(!u||!u.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:t,layoutAnchor:n}=this.props,{projection:a}=t;a&&(a.options.layoutAnchor=n,a.root.didUpdate(),Ng.postRender(()=>{!a.currentAnimation&&a.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:a}=this.props,{projection:i}=t;op=!0,i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),a&&a.deregister&&a.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function QP(e){const[t,n]=BP(),a=b.useContext(yg);return T.jsx(R6,{...e,layoutGroup:a,switchLayoutGroup:b.useContext(KP),isPresent:t,safeToRemove:n})}const L6={pan:{Feature:A6},drag:{Feature:E6,ProjectionNode:UP,MeasureLayout:QP}};function v0(e,t,n){const{props:a}=e;e.animationState&&a.whileHover&&e.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,s=a[i];s&&vt.postRender(()=>s(t,Ql(t)))}class D6 extends ui{mount(){const{current:t}=this.node;t&&(this.unmount=tN(t,(n,a)=>(v0(this.node,a,"Start"),i=>v0(this.node,i,"End"))))}unmount(){}}class M6 extends ui{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Yl(jl(this.node.current,"focus",()=>this.onFocus()),jl(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function b0(e,t,n){const{props:a}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&a.whileTap&&e.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),s=a[i];s&&vt.postRender(()=>s(t,Ql(t)))}class I6 extends ui{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:a}=this.node.props;this.unmount=sN(t,(i,s)=>(b0(this.node,s,"Start"),(l,{success:u})=>b0(this.node,l,u?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:a?.tap===!1})}unmount(){}}const bm=new WeakMap,sp=new WeakMap,N6=e=>{const t=bm.get(e.target);t&&t(e)},O6=e=>{e.forEach(N6)};function j6({root:e,...t}){const n=e||document;sp.has(n)||sp.set(n,{});const a=sp.get(n),i=JSON.stringify(t);return a[i]||(a[i]=new IntersectionObserver(O6,{root:e,...t})),a[i]}function U6(e,t,n){const a=j6(t);return bm.set(e,n),a.observe(e),()=>{bm.delete(e),a.unobserve(e)}}const B6={some:0,all:1};class F6 extends ui{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();const{viewport:t={}}=this.node.getProps(),{root:n,margin:a,amount:i="some",once:s}=t,l={root:n?n.current:void 0,rootMargin:a,threshold:typeof i=="number"?i:B6[i]},u=h=>{const{isIntersecting:f}=h;if(this.isInView===f||(this.isInView=f,s&&!f&&this.hasEnteredView))return;f&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",f);const{onViewportEnter:p,onViewportLeave:g}=this.node.getProps(),v=f?p:g;v&&v(h)};this.stopObserver=U6(this.node.current,l,u)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(z6(t,n))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}function z6({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const V6={inView:{Feature:F6},tap:{Feature:I6},focus:{Feature:M6},hover:{Feature:D6}},$6={layout:{ProjectionNode:UP,MeasureLayout:QP}},H6={...f6,...V6,...L6,...$6},Cl=l6(H6,c6);function W6(){!Fg.current&&pP();const[e]=b.useState(vd.current);return e}function JP(e){var t,n,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=JP(e[t]))&&(a&&(a+=" "),a+=n)}else for(n in e)e[n]&&(a&&(a+=" "),a+=n);return a}function G6(){for(var e,t,n=0,a="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=JP(e))&&(a&&(a+=" "),a+=t);return a}const K6=(e,t)=>{const n=new Array(e.length+t.length);for(let a=0;a<e.length;a++)n[a]=e[a];for(let a=0;a<t.length;a++)n[e.length+a]=t[a];return n},q6=(e,t)=>({classGroupId:e,validator:t}),eS=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),xd="-",k0=[],Y6="arbitrary..",Z6=e=>{const t=Q6(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return X6(l);const u=l.split(xd),h=u[0]===""&&u.length>1?1:0;return tS(u,h,t)},getConflictingClassGroupIds:(l,u)=>{if(u){const h=a[l],f=n[l];return h?f?K6(f,h):h:f||k0}return n[l]||k0}}},tS=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const i=e[t],s=n.nextPart.get(i);if(s){const f=tS(e,t+1,s);if(f)return f}const l=n.validators;if(l===null)return;const u=t===0?e.join(xd):e.slice(t).join(xd),h=l.length;for(let f=0;f<h;f++){const p=l[f];if(p.validator(u))return p.classGroupId}},X6=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),a=t.slice(0,n);return a?Y6+a:void 0})(),Q6=e=>{const{theme:t,classGroups:n}=e;return J6(n,t)},J6=(e,t)=>{const n=eS();for(const a in e){const i=e[a];Gg(i,n,a,t)}return n},Gg=(e,t,n,a)=>{const i=e.length;for(let s=0;s<i;s++){const l=e[s];ej(l,t,n,a)}},ej=(e,t,n,a)=>{if(typeof e=="string"){tj(e,t,n);return}if(typeof e=="function"){nj(e,t,n,a);return}aj(e,t,n,a)},tj=(e,t,n)=>{const a=e===""?t:nS(t,e);a.classGroupId=n},nj=(e,t,n,a)=>{if(rj(e)){Gg(e(a),t,n,a);return}t.validators===null&&(t.validators=[]),t.validators.push(q6(n,e))},aj=(e,t,n,a)=>{const i=Object.entries(e),s=i.length;for(let l=0;l<s;l++){const[u,h]=i[l];Gg(h,nS(t,u),n,a)}},nS=(e,t)=>{let n=e;const a=t.split(xd),i=a.length;for(let s=0;s<i;s++){const l=a[s];let u=n.nextPart.get(l);u||(u=eS(),n.nextPart.set(l,u)),n=u}return n},rj=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,ij=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),a=Object.create(null);const i=(s,l)=>{n[s]=l,t++,t>e&&(t=0,a=n,n=Object.create(null))};return{get(s){let l=n[s];if(l!==void 0)return l;if((l=a[s])!==void 0)return i(s,l),l},set(s,l){s in n?n[s]=l:i(s,l)}}},km="!",_0=":",oj=[],w0=(e,t,n,a,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:a,isExternal:i}),sj=e=>{const{prefix:t,experimentalParseClassName:n}=e;let a=i=>{const s=[];let l=0,u=0,h=0,f;const p=i.length;for(let S=0;S<p;S++){const P=i[S];if(l===0&&u===0){if(P===_0){s.push(i.slice(h,S)),h=S+1;continue}if(P==="/"){f=S;continue}}P==="["?l++:P==="]"?l--:P==="("?u++:P===")"&&u--}const g=s.length===0?i:i.slice(h);let v=g,_=!1;g.endsWith(km)?(v=g.slice(0,-1),_=!0):g.startsWith(km)&&(v=g.slice(1),_=!0);const w=f&&f>h?f-h:void 0;return w0(s,_,v,w)};if(t){const i=t+_0,s=a;a=l=>l.startsWith(i)?s(l.slice(i.length)):w0(oj,!1,l,void 0,!0)}if(n){const i=a;a=s=>n({className:s,parseClassName:i})}return a},lj=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,a)=>{t.set(n,1e6+a)}),n=>{const a=[];let i=[];for(let s=0;s<n.length;s++){const l=n[s],u=l[0]==="[",h=t.has(l);u||h?(i.length>0&&(i.sort(),a.push(...i),i=[]),a.push(l)):i.push(l)}return i.length>0&&(i.sort(),a.push(...i)),a}},cj=e=>({cache:ij(e.cacheSize),parseClassName:sj(e),sortModifiers:lj(e),postfixLookupClassGroupIds:uj(e),...Z6(e)}),uj=e=>{const t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let a=0;a<n.length;a++)t[n[a]]=!0;return t},dj=/\s+/,hj=(e,t)=>{const{parseClassName:n,getClassGroupId:a,getConflictingClassGroupIds:i,sortModifiers:s,postfixLookupClassGroupIds:l}=t,u=[],h=e.trim().split(dj);let f="";for(let p=h.length-1;p>=0;p-=1){const g=h[p],{isExternal:v,modifiers:_,hasImportantModifier:w,baseClassName:S,maybePostfixModifierPosition:P}=n(g);if(v){f=g+(f.length>0?" "+f:f);continue}let D=!!P,R;if(D){const j=S.substring(0,P);R=a(j);const C=R&&l[R]?a(S):void 0;C&&C!==R&&(R=C,D=!1)}else R=a(S);if(!R){if(!D){f=g+(f.length>0?" "+f:f);continue}if(R=a(S),!R){f=g+(f.length>0?" "+f:f);continue}D=!1}const E=_.length===0?"":_.length===1?_[0]:s(_).join(":"),A=w?E+km:E,U=A+R;if(u.indexOf(U)>-1)continue;u.push(U);const z=i(R,D);for(let j=0;j<z.length;++j){const C=z[j];u.push(A+C)}f=g+(f.length>0?" "+f:f)}return f},fj=(...e)=>{let t=0,n,a,i="";for(;t<e.length;)(n=e[t++])&&(a=aS(n))&&(i&&(i+=" "),i+=a);return i},aS=e=>{if(typeof e=="string")return e;let t,n="";for(let a=0;a<e.length;a++)e[a]&&(t=aS(e[a]))&&(n&&(n+=" "),n+=t);return n},pj=(e,...t)=>{let n,a,i,s;const l=h=>{const f=t.reduce((p,g)=>g(p),e());return n=cj(f),a=n.cache.get,i=n.cache.set,s=u,u(h)},u=h=>{const f=a(h);if(f)return f;const p=hj(h,n);return i(h,p),p};return s=l,(...h)=>s(fj(...h))},mj=[],Gt=e=>{const t=n=>n[e]||mj;return t.isThemeGetter=!0,t},rS=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,iS=/^\((?:(\w[\w-]*):)?(.+)\)$/i,gj=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,yj=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,vj=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,bj=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,kj=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,_j=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Xr=e=>gj.test(e),Qe=e=>!!e&&!Number.isNaN(Number(e)),Fa=e=>!!e&&Number.isInteger(Number(e)),lp=e=>e.endsWith("%")&&Qe(e.slice(0,-1)),vr=e=>yj.test(e),oS=()=>!0,wj=e=>vj.test(e)&&!bj.test(e),Kg=()=>!1,xj=e=>kj.test(e),Pj=e=>_j.test(e),Sj=e=>!_e(e)&&!xe(e),Cj=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),Tj=e=>di(e,cS,Kg),_e=e=>rS.test(e),Li=e=>di(e,uS,wj),x0=e=>di(e,Nj,Qe),Ej=e=>di(e,hS,oS),Aj=e=>di(e,dS,Kg),P0=e=>di(e,sS,Kg),Rj=e=>di(e,lS,Pj),yu=e=>di(e,fS,xj),xe=e=>iS.test(e),ll=e=>to(e,uS),Lj=e=>to(e,dS),S0=e=>to(e,sS),Dj=e=>to(e,cS),Mj=e=>to(e,lS),vu=e=>to(e,fS,!0),Ij=e=>to(e,hS,!0),di=(e,t,n)=>{const a=rS.exec(e);return a?a[1]?t(a[1]):n(a[2]):!1},to=(e,t,n=!1)=>{const a=iS.exec(e);return a?a[1]?t(a[1]):n:!1},sS=e=>e==="position"||e==="percentage",lS=e=>e==="image"||e==="url",cS=e=>e==="length"||e==="size"||e==="bg-size",uS=e=>e==="length",Nj=e=>e==="number",dS=e=>e==="family-name",hS=e=>e==="number"||e==="weight",fS=e=>e==="shadow",Oj=()=>{const e=Gt("color"),t=Gt("font"),n=Gt("text"),a=Gt("font-weight"),i=Gt("tracking"),s=Gt("leading"),l=Gt("breakpoint"),u=Gt("container"),h=Gt("spacing"),f=Gt("radius"),p=Gt("shadow"),g=Gt("inset-shadow"),v=Gt("text-shadow"),_=Gt("drop-shadow"),w=Gt("blur"),S=Gt("perspective"),P=Gt("aspect"),D=Gt("ease"),R=Gt("animate"),E=()=>["auto","avoid","all","avoid-page","page","left","right","column"],A=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],U=()=>[...A(),xe,_e],z=()=>["auto","hidden","clip","visible","scroll"],j=()=>["auto","contain","none"],C=()=>[xe,_e,h],K=()=>[Xr,"full","auto",...C()],Y=()=>[Fa,"none","subgrid",xe,_e],ce=()=>["auto",{span:["full",Fa,xe,_e]},Fa,xe,_e],re=()=>[Fa,"auto",xe,_e],fe=()=>["auto","min","max","fr",xe,_e],de=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],he=()=>["start","end","center","stretch","center-safe","end-safe"],oe=()=>["auto",...C()],X=()=>[Xr,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...C()],Z=()=>[Xr,"screen","full","dvw","lvw","svw","min","max","fit",...C()],Q=()=>[Xr,"screen","full","lh","dvh","lvh","svh","min","max","fit",...C()],V=()=>[e,xe,_e],I=()=>[...A(),S0,P0,{position:[xe,_e]}],G=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ye=()=>["auto","cover","contain",Dj,Tj,{size:[xe,_e]}],me=()=>[lp,ll,Li],pe=()=>["","none","full",f,xe,_e],ke=()=>["",Qe,ll,Li],We=()=>["solid","dashed","dotted","double"],Xe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Ue=()=>[Qe,lp,S0,P0],Dt=()=>["","none",w,xe,_e],rn=()=>["none",Qe,xe,_e],Pn=()=>["none",Qe,xe,_e],gt=()=>[Qe,xe,_e],Ut=()=>[Xr,"full",...C()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[vr],breakpoint:[vr],color:[oS],container:[vr],"drop-shadow":[vr],ease:["in","out","in-out"],font:[Sj],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[vr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[vr],shadow:[vr],spacing:["px",Qe],text:[vr],"text-shadow":[vr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Xr,_e,xe,P]}],container:["container"],"container-type":[{"@container":["","normal","size",xe,_e]}],"container-named":[Cj],columns:[{columns:[Qe,_e,xe,u]}],"break-after":[{"break-after":E()}],"break-before":[{"break-before":E()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:U()}],overflow:[{overflow:z()}],"overflow-x":[{"overflow-x":z()}],"overflow-y":[{"overflow-y":z()}],overscroll:[{overscroll:j()}],"overscroll-x":[{"overscroll-x":j()}],"overscroll-y":[{"overscroll-y":j()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:K()}],"inset-x":[{"inset-x":K()}],"inset-y":[{"inset-y":K()}],start:[{"inset-s":K(),start:K()}],end:[{"inset-e":K(),end:K()}],"inset-bs":[{"inset-bs":K()}],"inset-be":[{"inset-be":K()}],top:[{top:K()}],right:[{right:K()}],bottom:[{bottom:K()}],left:[{left:K()}],visibility:["visible","invisible","collapse"],z:[{z:[Fa,"auto",xe,_e]}],basis:[{basis:[Xr,"full","auto",u,...C()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Qe,Xr,"auto","initial","none",_e]}],grow:[{grow:["",Qe,xe,_e]}],shrink:[{shrink:["",Qe,xe,_e]}],order:[{order:[Fa,"first","last","none",xe,_e]}],"grid-cols":[{"grid-cols":Y()}],"col-start-end":[{col:ce()}],"col-start":[{"col-start":re()}],"col-end":[{"col-end":re()}],"grid-rows":[{"grid-rows":Y()}],"row-start-end":[{row:ce()}],"row-start":[{"row-start":re()}],"row-end":[{"row-end":re()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":fe()}],"auto-rows":[{"auto-rows":fe()}],gap:[{gap:C()}],"gap-x":[{"gap-x":C()}],"gap-y":[{"gap-y":C()}],"justify-content":[{justify:[...de(),"normal"]}],"justify-items":[{"justify-items":[...he(),"normal"]}],"justify-self":[{"justify-self":["auto",...he()]}],"align-content":[{content:["normal",...de()]}],"align-items":[{items:[...he(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...he(),{baseline:["","last"]}]}],"place-content":[{"place-content":de()}],"place-items":[{"place-items":[...he(),"baseline"]}],"place-self":[{"place-self":["auto",...he()]}],p:[{p:C()}],px:[{px:C()}],py:[{py:C()}],ps:[{ps:C()}],pe:[{pe:C()}],pbs:[{pbs:C()}],pbe:[{pbe:C()}],pt:[{pt:C()}],pr:[{pr:C()}],pb:[{pb:C()}],pl:[{pl:C()}],m:[{m:oe()}],mx:[{mx:oe()}],my:[{my:oe()}],ms:[{ms:oe()}],me:[{me:oe()}],mbs:[{mbs:oe()}],mbe:[{mbe:oe()}],mt:[{mt:oe()}],mr:[{mr:oe()}],mb:[{mb:oe()}],ml:[{ml:oe()}],"space-x":[{"space-x":C()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":C()}],"space-y-reverse":["space-y-reverse"],size:[{size:X()}],"inline-size":[{inline:["auto",...Z()]}],"min-inline-size":[{"min-inline":["auto",...Z()]}],"max-inline-size":[{"max-inline":["none",...Z()]}],"block-size":[{block:["auto",...Q()]}],"min-block-size":[{"min-block":["auto",...Q()]}],"max-block-size":[{"max-block":["none",...Q()]}],w:[{w:[u,"screen",...X()]}],"min-w":[{"min-w":[u,"screen","none",...X()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[l]},...X()]}],h:[{h:["screen","lh",...X()]}],"min-h":[{"min-h":["screen","lh","none",...X()]}],"max-h":[{"max-h":["screen","lh",...X()]}],"font-size":[{text:["base",n,ll,Li]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,Ij,Ej]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",lp,_e]}],"font-family":[{font:[Lj,Aj,t]}],"font-features":[{"font-features":[_e]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,xe,_e]}],"line-clamp":[{"line-clamp":[Qe,"none",xe,x0]}],leading:[{leading:[s,...C()]}],"list-image":[{"list-image":["none",xe,_e]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",xe,_e]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:V()}],"text-color":[{text:V()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...We(),"wavy"]}],"text-decoration-thickness":[{decoration:[Qe,"from-font","auto",xe,Li]}],"text-decoration-color":[{decoration:V()}],"underline-offset":[{"underline-offset":[Qe,"auto",xe,_e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:C()}],"tab-size":[{tab:[Fa,xe,_e]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",xe,_e]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",xe,_e]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:I()}],"bg-repeat":[{bg:G()}],"bg-size":[{bg:ye()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Fa,xe,_e],radial:["",xe,_e],conic:[Fa,xe,_e]},Mj,Rj]}],"bg-color":[{bg:V()}],"gradient-from-pos":[{from:me()}],"gradient-via-pos":[{via:me()}],"gradient-to-pos":[{to:me()}],"gradient-from":[{from:V()}],"gradient-via":[{via:V()}],"gradient-to":[{to:V()}],rounded:[{rounded:pe()}],"rounded-s":[{"rounded-s":pe()}],"rounded-e":[{"rounded-e":pe()}],"rounded-t":[{"rounded-t":pe()}],"rounded-r":[{"rounded-r":pe()}],"rounded-b":[{"rounded-b":pe()}],"rounded-l":[{"rounded-l":pe()}],"rounded-ss":[{"rounded-ss":pe()}],"rounded-se":[{"rounded-se":pe()}],"rounded-ee":[{"rounded-ee":pe()}],"rounded-es":[{"rounded-es":pe()}],"rounded-tl":[{"rounded-tl":pe()}],"rounded-tr":[{"rounded-tr":pe()}],"rounded-br":[{"rounded-br":pe()}],"rounded-bl":[{"rounded-bl":pe()}],"border-w":[{border:ke()}],"border-w-x":[{"border-x":ke()}],"border-w-y":[{"border-y":ke()}],"border-w-s":[{"border-s":ke()}],"border-w-e":[{"border-e":ke()}],"border-w-bs":[{"border-bs":ke()}],"border-w-be":[{"border-be":ke()}],"border-w-t":[{"border-t":ke()}],"border-w-r":[{"border-r":ke()}],"border-w-b":[{"border-b":ke()}],"border-w-l":[{"border-l":ke()}],"divide-x":[{"divide-x":ke()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ke()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...We(),"hidden","none"]}],"divide-style":[{divide:[...We(),"hidden","none"]}],"border-color":[{border:V()}],"border-color-x":[{"border-x":V()}],"border-color-y":[{"border-y":V()}],"border-color-s":[{"border-s":V()}],"border-color-e":[{"border-e":V()}],"border-color-bs":[{"border-bs":V()}],"border-color-be":[{"border-be":V()}],"border-color-t":[{"border-t":V()}],"border-color-r":[{"border-r":V()}],"border-color-b":[{"border-b":V()}],"border-color-l":[{"border-l":V()}],"divide-color":[{divide:V()}],"outline-style":[{outline:[...We(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Qe,xe,_e]}],"outline-w":[{outline:["",Qe,ll,Li]}],"outline-color":[{outline:V()}],shadow:[{shadow:["","none",p,vu,yu]}],"shadow-color":[{shadow:V()}],"inset-shadow":[{"inset-shadow":["none",g,vu,yu]}],"inset-shadow-color":[{"inset-shadow":V()}],"ring-w":[{ring:ke()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:V()}],"ring-offset-w":[{"ring-offset":[Qe,Li]}],"ring-offset-color":[{"ring-offset":V()}],"inset-ring-w":[{"inset-ring":ke()}],"inset-ring-color":[{"inset-ring":V()}],"text-shadow":[{"text-shadow":["none",v,vu,yu]}],"text-shadow-color":[{"text-shadow":V()}],opacity:[{opacity:[Qe,xe,_e]}],"mix-blend":[{"mix-blend":[...Xe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Xe()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Qe]}],"mask-image-linear-from-pos":[{"mask-linear-from":Ue()}],"mask-image-linear-to-pos":[{"mask-linear-to":Ue()}],"mask-image-linear-from-color":[{"mask-linear-from":V()}],"mask-image-linear-to-color":[{"mask-linear-to":V()}],"mask-image-t-from-pos":[{"mask-t-from":Ue()}],"mask-image-t-to-pos":[{"mask-t-to":Ue()}],"mask-image-t-from-color":[{"mask-t-from":V()}],"mask-image-t-to-color":[{"mask-t-to":V()}],"mask-image-r-from-pos":[{"mask-r-from":Ue()}],"mask-image-r-to-pos":[{"mask-r-to":Ue()}],"mask-image-r-from-color":[{"mask-r-from":V()}],"mask-image-r-to-color":[{"mask-r-to":V()}],"mask-image-b-from-pos":[{"mask-b-from":Ue()}],"mask-image-b-to-pos":[{"mask-b-to":Ue()}],"mask-image-b-from-color":[{"mask-b-from":V()}],"mask-image-b-to-color":[{"mask-b-to":V()}],"mask-image-l-from-pos":[{"mask-l-from":Ue()}],"mask-image-l-to-pos":[{"mask-l-to":Ue()}],"mask-image-l-from-color":[{"mask-l-from":V()}],"mask-image-l-to-color":[{"mask-l-to":V()}],"mask-image-x-from-pos":[{"mask-x-from":Ue()}],"mask-image-x-to-pos":[{"mask-x-to":Ue()}],"mask-image-x-from-color":[{"mask-x-from":V()}],"mask-image-x-to-color":[{"mask-x-to":V()}],"mask-image-y-from-pos":[{"mask-y-from":Ue()}],"mask-image-y-to-pos":[{"mask-y-to":Ue()}],"mask-image-y-from-color":[{"mask-y-from":V()}],"mask-image-y-to-color":[{"mask-y-to":V()}],"mask-image-radial":[{"mask-radial":[xe,_e]}],"mask-image-radial-from-pos":[{"mask-radial-from":Ue()}],"mask-image-radial-to-pos":[{"mask-radial-to":Ue()}],"mask-image-radial-from-color":[{"mask-radial-from":V()}],"mask-image-radial-to-color":[{"mask-radial-to":V()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":A()}],"mask-image-conic-pos":[{"mask-conic":[Qe]}],"mask-image-conic-from-pos":[{"mask-conic-from":Ue()}],"mask-image-conic-to-pos":[{"mask-conic-to":Ue()}],"mask-image-conic-from-color":[{"mask-conic-from":V()}],"mask-image-conic-to-color":[{"mask-conic-to":V()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:I()}],"mask-repeat":[{mask:G()}],"mask-size":[{mask:ye()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",xe,_e]}],filter:[{filter:["","none",xe,_e]}],blur:[{blur:Dt()}],brightness:[{brightness:[Qe,xe,_e]}],contrast:[{contrast:[Qe,xe,_e]}],"drop-shadow":[{"drop-shadow":["","none",_,vu,yu]}],"drop-shadow-color":[{"drop-shadow":V()}],grayscale:[{grayscale:["",Qe,xe,_e]}],"hue-rotate":[{"hue-rotate":[Qe,xe,_e]}],invert:[{invert:["",Qe,xe,_e]}],saturate:[{saturate:[Qe,xe,_e]}],sepia:[{sepia:["",Qe,xe,_e]}],"backdrop-filter":[{"backdrop-filter":["","none",xe,_e]}],"backdrop-blur":[{"backdrop-blur":Dt()}],"backdrop-brightness":[{"backdrop-brightness":[Qe,xe,_e]}],"backdrop-contrast":[{"backdrop-contrast":[Qe,xe,_e]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Qe,xe,_e]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Qe,xe,_e]}],"backdrop-invert":[{"backdrop-invert":["",Qe,xe,_e]}],"backdrop-opacity":[{"backdrop-opacity":[Qe,xe,_e]}],"backdrop-saturate":[{"backdrop-saturate":[Qe,xe,_e]}],"backdrop-sepia":[{"backdrop-sepia":["",Qe,xe,_e]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":C()}],"border-spacing-x":[{"border-spacing-x":C()}],"border-spacing-y":[{"border-spacing-y":C()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",xe,_e]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Qe,"initial",xe,_e]}],ease:[{ease:["linear","initial",D,xe,_e]}],delay:[{delay:[Qe,xe,_e]}],animate:[{animate:["none",R,xe,_e]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,xe,_e]}],"perspective-origin":[{"perspective-origin":U()}],rotate:[{rotate:rn()}],"rotate-x":[{"rotate-x":rn()}],"rotate-y":[{"rotate-y":rn()}],"rotate-z":[{"rotate-z":rn()}],scale:[{scale:Pn()}],"scale-x":[{"scale-x":Pn()}],"scale-y":[{"scale-y":Pn()}],"scale-z":[{"scale-z":Pn()}],"scale-3d":["scale-3d"],skew:[{skew:gt()}],"skew-x":[{"skew-x":gt()}],"skew-y":[{"skew-y":gt()}],transform:[{transform:[xe,_e,"","none","gpu","cpu"]}],"transform-origin":[{origin:U()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ut()}],"translate-x":[{"translate-x":Ut()}],"translate-y":[{"translate-y":Ut()}],"translate-z":[{"translate-z":Ut()}],"translate-none":["translate-none"],zoom:[{zoom:[Fa,xe,_e]}],accent:[{accent:V()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:V()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",xe,_e]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":V()}],"scrollbar-track-color":[{"scrollbar-track":V()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":C()}],"scroll-mx":[{"scroll-mx":C()}],"scroll-my":[{"scroll-my":C()}],"scroll-ms":[{"scroll-ms":C()}],"scroll-me":[{"scroll-me":C()}],"scroll-mbs":[{"scroll-mbs":C()}],"scroll-mbe":[{"scroll-mbe":C()}],"scroll-mt":[{"scroll-mt":C()}],"scroll-mr":[{"scroll-mr":C()}],"scroll-mb":[{"scroll-mb":C()}],"scroll-ml":[{"scroll-ml":C()}],"scroll-p":[{"scroll-p":C()}],"scroll-px":[{"scroll-px":C()}],"scroll-py":[{"scroll-py":C()}],"scroll-ps":[{"scroll-ps":C()}],"scroll-pe":[{"scroll-pe":C()}],"scroll-pbs":[{"scroll-pbs":C()}],"scroll-pbe":[{"scroll-pbe":C()}],"scroll-pt":[{"scroll-pt":C()}],"scroll-pr":[{"scroll-pr":C()}],"scroll-pb":[{"scroll-pb":C()}],"scroll-pl":[{"scroll-pl":C()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",xe,_e]}],fill:[{fill:["none",...V()]}],"stroke-w":[{stroke:[Qe,ll,Li,x0]}],stroke:[{stroke:["none",...V()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},jj=pj(Oj);function St(...e){return jj(G6(e))}const Uj=T.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",children:[T.jsx("path",{d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92a5.06 5.06 0 0 1-2.2 3.32v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.1Z",fill:"#4285F4"}),T.jsx("path",{d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23Z",fill:"#34A853"}),T.jsx("path",{d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18A10.96 10.96 0 0 0 1 12c0 1.77.42 3.44 1.18 4.93l3.66-2.84Z",fill:"#FBBC05"}),T.jsx("path",{d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53Z",fill:"#EA4335"})]}),Bj=T.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor",children:T.jsx("path",{d:"M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0 0 24 12c0-6.63-5.37-12-12-12Z"})}),Fj={google:Uj,github:Bj},zj={google:"Google",github:"GitHub",microsoft:"Microsoft",discord:"Discord",apple:"Apple"};function Vj(e){return zj[e]||String(e||"").replace(/-/g," ")}function $j({title:e,subtitle:t,className:n="",onSuccess:a,hideLogo:i=!1}){ql();const{enabled:s,signedIn:l,refreshUser:u,signInWithPassword:h,signUp:f,signInWithOAuth:p,getPublicAuthConfig:g}=eo(),[v,_]=b.useState("signin"),[w,S]=b.useState(""),[P,D]=b.useState(""),[R,E]=b.useState(""),[A,U]=b.useState(!1),[z,j]=b.useState(null),[C,K]=b.useState(null),[Y,ce]=b.useState(!1),[re,fe]=b.useState(!0),[de,he]=b.useState([]),[oe,X]=b.useState(8);b.useEffect(()=>{if(!s)return;let I=!0;return fe(!0),(async()=>{const{data:G,error:ye}=await g();if(I){if(ye||!G)he(["google","github"]);else{const me=Array.isArray(G.oAuthProviders)?G.oAuthProviders:[],pe=Array.isArray(G.customOAuthProviders)?G.customOAuthProviders:[];he([...me,...pe]),typeof G.passwordMinLength=="number"&&G.passwordMinLength>0&&X(G.passwordMinLength)}fe(!1)}})(),()=>{I=!1}},[s,g]),b.useEffect(()=>{l&&a&&a()},[l,a]);const Z=b.useMemo(()=>typeof window>"u"?"":!!window.webkit?.messageHandlers?.nativeOAuth?`${window.location.origin}/auth/callback`:`${window.location.origin}/`,[]),Q=b.useCallback(async I=>{j(null),U(!0);try{const{error:G}=await p(I,Z);G&&j(G.message||String(G))}finally{U(!1)}},[p,Z]),V=b.useCallback(async I=>{I.preventDefault(),j(null),U(!0);try{if(v==="signup"){const{data:ye,error:me}=await f({email:w.trim(),password:P,name:R.trim()||void 0});if(me){j(me.message||String(me));return}if(ye?.requireEmailVerification){K(De("login.verify_email_pending")),_("signin");return}await u();return}const{error:G}=await h({email:w.trim(),password:P});if(G){j(G.message||String(G));return}await u()}finally{U(!1)}},[v,w,P,R,f,h,u]);return s?T.jsxs("div",{className:St("w-full bg-white dark:bg-oai-gray-950 p-6 transition-colors duration-200",n),children:[T.jsxs("div",{className:"text-center mb-6",children:[!i&&T.jsxs("div",{className:"flex items-center justify-center gap-2 mb-2",children:[T.jsx("img",{src:"/app-icon.png",alt:"",width:28,height:28,className:"rounded-md"}),T.jsx("span",{className:"text-lg font-semibold text-oai-black dark:text-white font-oai tracking-tight",children:De("shared.app_name")})]}),T.jsx("h2",{className:St("text-sm font-semibold text-oai-black dark:text-white tracking-tight mb-1",i&&"text-base font-bold md:text-lg"),children:e||De("login_modal.subtitle")}),t&&T.jsx("p",{className:"text-xs text-oai-gray-500 dark:text-oai-gray-400 mt-1.5 leading-relaxed max-w-[320px] mx-auto",children:t})]}),C&&T.jsx("div",{className:"mb-4 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-oai-gray-50 dark:bg-oai-gray-900/50 px-3 py-2 text-xs text-oai-gray-700 dark:text-oai-gray-300",children:C}),z&&T.jsx("p",{className:"mb-4 text-sm text-red-500 dark:text-red-400 text-center",role:"alert",children:z}),T.jsx("div",{className:"space-y-2.5 mb-5",children:re?T.jsxs("div",{className:"space-y-2.5",children:[T.jsx("div",{className:"h-10 rounded-lg bg-oai-gray-100 dark:bg-oai-gray-900/50 animate-pulse"}),T.jsx("div",{className:"h-10 rounded-lg bg-oai-gray-100 dark:bg-oai-gray-900/50 animate-pulse"})]}):de.map(I=>T.jsxs("button",{type:"button",disabled:A,onClick:()=>Q(I),className:St("w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-700 bg-oai-gray-50 dark:bg-oai-gray-900 text-sm font-medium text-oai-black dark:text-white","hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 hover:border-oai-gray-300 dark:hover:border-oai-gray-600 transition-colors disabled:opacity-50","flex items-center justify-center gap-2.5"),children:[Fj[I]||null,De("login.oauth.continue",{provider:Vj(I)})]},I))}),Y?T.jsxs(T.Fragment,{children:[T.jsxs("div",{className:"relative mb-5",children:[T.jsx("div",{className:"absolute inset-0 flex items-center",children:T.jsx("span",{className:"w-full border-t border-oai-gray-200 dark:border-oai-gray-800"})}),T.jsx("div",{className:"relative flex justify-center text-xs uppercase tracking-wider",children:T.jsx("span",{className:"bg-white dark:bg-oai-gray-950 px-3 text-oai-gray-400 dark:text-oai-gray-600",children:De("login_modal.divider_email")})})]}),T.jsxs("div",{className:"flex rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 p-0.5 bg-oai-gray-50 dark:bg-oai-gray-900/50 mb-4",children:[T.jsx("button",{type:"button",className:St("flex-1 py-1.5 text-xs font-medium rounded-md transition-colors",v==="signin"?"bg-white dark:bg-oai-gray-800 text-oai-black dark:text-white shadow-sm":"text-oai-gray-500 hover:text-oai-gray-700 dark:hover:text-oai-gray-300"),onClick:()=>{_("signin"),j(null)},children:De("login.tab.sign_in")}),T.jsx("button",{type:"button",className:St("flex-1 py-1.5 text-xs font-medium rounded-md transition-colors",v==="signup"?"bg-white dark:bg-oai-gray-800 text-oai-black dark:text-white shadow-sm":"text-oai-gray-500 hover:text-oai-gray-700 dark:hover:text-oai-gray-300"),onClick:()=>{_("signup"),j(null)},children:De("login.tab.sign_up")})]}),T.jsxs("form",{onSubmit:V,className:"space-y-3",children:[v==="signup"&&T.jsxs("div",{children:[T.jsx("label",{htmlFor:"card-name",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:De("login.field.name")}),T.jsx("input",{id:"card-name",type:"text",autoComplete:"name",value:R,onChange:I=>E(I.target.value),className:"w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-oai-gray-50 dark:bg-oai-gray-900 px-3 text-sm text-oai-black dark:text-white placeholder-oai-gray-400 dark:placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500",placeholder:De("login.field.name_placeholder")})]}),T.jsxs("div",{children:[T.jsx("label",{htmlFor:"card-email",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:De("login.field.email")}),T.jsx("input",{id:"card-email",type:"email",autoComplete:"email",required:!0,value:w,onChange:I=>S(I.target.value),className:"w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-oai-gray-50 dark:bg-oai-gray-900 px-3 text-sm text-oai-black dark:text-white placeholder-oai-gray-400 dark:placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500"})]}),T.jsxs("div",{children:[T.jsx("label",{htmlFor:"card-password",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:De("login.field.password")}),T.jsx("input",{id:"card-password",type:"password",autoComplete:v==="signup"?"new-password":"current-password",required:!0,minLength:v==="signup"?oe:void 0,value:P,onChange:I=>D(I.target.value),className:"w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-oai-gray-50 dark:bg-oai-gray-900 px-3 text-sm text-oai-black dark:text-white placeholder-oai-gray-400 dark:placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500"}),v==="signup"&&T.jsx("p",{className:"mt-1 text-xs text-oai-gray-400 dark:text-oai-gray-600",children:De("login.password_hint",{min:String(oe)})})]}),T.jsx("button",{type:"submit",disabled:A,className:"w-full h-10 rounded-lg bg-oai-gray-900 dark:bg-white text-white dark:text-oai-gray-950 text-sm font-semibold hover:bg-oai-gray-800 dark:hover:bg-oai-gray-100 transition-colors disabled:opacity-50",children:De(v==="signup"?"login.submit.sign_up":"login.submit.sign_in")})]})]}):T.jsxs(T.Fragment,{children:[T.jsxs("div",{className:"relative mb-5",children:[T.jsx("div",{className:"absolute inset-0 flex items-center",children:T.jsx("span",{className:"w-full border-t border-oai-gray-200 dark:border-oai-gray-800"})}),T.jsx("div",{className:"relative flex justify-center text-xs uppercase tracking-wider",children:T.jsx("span",{className:"bg-white dark:bg-oai-gray-950 px-3 text-oai-gray-400 dark:text-oai-gray-600",children:De("login.divider")})})]}),T.jsxs("button",{type:"button",onClick:()=>ce(!0),className:St("w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-700 bg-oai-gray-50 dark:bg-oai-gray-900 text-sm font-medium text-oai-black dark:text-white","hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 hover:border-oai-gray-300 dark:hover:border-oai-gray-600 transition-colors","flex items-center justify-center gap-2.5"),children:[T.jsx(xI,{className:"h-[18px] w-[18px] text-oai-gray-500 dark:text-oai-gray-400",strokeWidth:1.75}),De("login_modal.continue_email")]})]})]}):null}function Hj(){const{isOpen:e,closeLoginModal:t}=h1(),{enabled:n}=eo();return b.useEffect(()=>{if(!e)return;const a=i=>{i.key==="Escape"&&t()};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[e,t]),n?T.jsx(FP,{children:e&&T.jsxs(Cl.div,{className:"fixed inset-0 z-[100] flex items-center justify-center p-4",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},children:[T.jsx(Cl.div,{className:"absolute inset-0 bg-black/40 dark:bg-black/60",onClick:t,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}}),T.jsxs(Cl.div,{className:"relative w-full max-w-[420px] rounded-2xl border border-oai-gray-200 dark:border-oai-gray-800 bg-white dark:bg-oai-gray-950 shadow-2xl overflow-hidden",initial:{opacity:0,scale:.95,y:10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:10},transition:{duration:.2},onClick:a=>a.stopPropagation(),children:[T.jsx("button",{type:"button",onClick:t,className:"absolute right-4 top-4 z-10 text-oai-gray-400 dark:text-oai-gray-500 hover:text-oai-black dark:hover:text-white transition-colors",children:T.jsx(gg,{className:"h-5 w-5"})}),T.jsx($j,{onSuccess:t,className:"p-6 bg-transparent"})]})]})}):null}const Wj={VITE_INSFORGE_BASE_URL:"https://srctyff5.us-east.insforge.app"},EB="https://tokentracker.statuspage.io/";function Gj(){if(typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"))return"";const t=typeof import.meta<"u"?Wj:void 0;return(t?.VITE_TOKENTRACKER_BACKEND_BASE_URL||t?.VITE_INSFORGE_BASE_URL||er()).trim()}function Kj(){return er()}function qj(e=""){if(typeof e!="string"||e.length===0)return!1;const t=new URLSearchParams(e),n=String(t.get("screenshot")||"").toLowerCase();return n==="1"||n==="true"}const Yj=300*1e3,Zj=720*60*1e3;function qg(e){return typeof e=="string"&&/^https?:\/\//i.test(e.trim())}function Xj(e,t=Date.now()){if(!e?.token||!e?.deviceId||!e?.issuedAt)return!0;const n=Date.parse(e.issuedAt);return Number.isFinite(n)?n+Zj<=t:!0}async function pS(e,t){const n=er();if(!qg(n)||!e)return;const a=n.replace(/\/$/,""),i=ds(),s={Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${e}`};i&&(s.apikey=i);try{await fetch(`${a}/functions/tokentracker-leaderboard-refresh`,{method:"POST",headers:s,body:JSON.stringify({period:"week",source:t})})}catch{}}const C0="tokentracker_client_id_v1";function Qj(){if(typeof window>"u")return"ssr";try{const e=window.localStorage.getItem(C0);if(e&&e.length>=8)return e;const t=typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`;return window.localStorage.setItem(C0,t),t}catch{return`eph-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`}}async function Jj(){try{const e=await fetch("/functions/tokentracker-machine-id",{headers:{Accept:"application/json"},cache:"no-store"});if(e.ok){const t=await e.json().catch(()=>null),n=typeof t?.machineId=="string"?t.machineId:null;if(n&&n.length>=8)return n.slice(0,8)}}catch{}return Qj().slice(0,8)}async function e8(e){const t=er();if(!qg(t)||!e)return null;const n=t.replace(/\/$/,""),a=ds(),i={Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${e}`};a&&(i.apikey=a);const s=typeof navigator<"u"&&typeof navigator.platform=="string"?navigator.platform:"web",u=`Token Tracker (dashboard) #${await Jj()}`,h=await fetch(`${n}/functions/tokentracker-device-token-issue`,{method:"POST",headers:i,body:JSON.stringify({device_name:u,platform:s})});if(!h.ok)return null;const f=await h.json().catch(()=>null),p=typeof f?.token=="string"?f.token:null,g=typeof f?.device_id=="string"?f.device_id:null;return!p||!g?null:{token:p,deviceId:g,issuedAt:typeof f?.created_at=="string"?f.created_at:new Date().toISOString()}}async function T0(e){const{deviceToken:t,insforgeBaseUrl:n}=e,a={deviceToken:t},i=n||er();qg(i)&&(a.insforgeBaseUrl=i.trim());const s=await Od(),l=await fetch("/functions/tokentracker-local-sync",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",...s},body:JSON.stringify(a)}),u=await l.json().catch(()=>({}));if(!l.ok){const h=typeof u.error=="string"?u.error:`HTTP ${l.status}`;throw new Error(h)}return u}async function E0(e){const t=await e();if(!t)return null;const n=Ex();if(n&&!Xj(n))return n;const a=await e8(t);return a?(tD(a),a):null}async function mS(e){let t=await e();if(!t)return null;let n=await E0(async()=>t);if(!n)return t;try{return await T0({deviceToken:n.token,insforgeBaseUrl:er()}),t}catch(a){if(!Ex()||(Ax(),t=await e(),!t)||(n=await E0(async()=>t),!n))throw a;return await T0({deviceToken:n.token,insforgeBaseUrl:er()}),t}}async function t8(e){const t=nD();if(Date.now()-t<Yj)return;const n=await mS(e);n&&(Rx(Date.now()),await pS(n,"cloud-sync-auto"))}async function AB(e){const t=await mS(e);t&&(Rx(Date.now()),await pS(t,"cloud-sync-now"))}function n8(e){const t=e.replace(/\/+$/,"")||"/";return t==="/share"||t==="/share.html"||t.startsWith("/share/")}function a8(e){const t=e.replace(/\/+$/,"")||"/";return t==="/login"||t==="/landing"||n8(t)?!1:t==="/"||t==="/dashboard"||t.startsWith("/leaderboard")}function r8(){const e=Mn(),t=eo(),n=b.useRef(!1);b.useEffect(()=>{if(!Wp()||!a8(e.pathname||"/")||!t.enabled||!t.signedIn||t.loading||!Gp())return;let a=!1;const i=window.setTimeout(()=>{(async()=>{if(!(a||n.current)){n.current=!0;try{await t8(()=>t.getAccessToken())}catch(s){console.warn("[tokentracker] cloud usage sync:",s)}finally{n.current=!1}}})()},2500);return()=>{a=!0,window.clearTimeout(i)}},[e.pathname,t.enabled,t.signedIn,t.loading,t.getAccessToken])}function i8(){const e=b.useContext(u1);if(e===null)throw new Error("useTheme must be used within a ThemeProvider");return e}function o8({prefersReducedMotion:e,screenshotCapture:t}){return!(t||e)}function s8(e){if(!e||typeof e!="object")return null;const t=e.user_metadata&&typeof e.user_metadata=="object"?e.user_metadata:{},n=e.profile&&typeof e.profile=="object"?e.profile:{},a=t.avatar_url||t.picture||n.avatar_url||e.avatar_url;return typeof a=="string"&&a.trim()?a.trim():null}function l8(e){return e?jd()?`/api/avatar-proxy?url=${encodeURIComponent(e)}`:e:null}function bu(e){const t=String(e||"").trim();if(!t)return"?";const n=t.split(/\s+/).filter(Boolean);return n.length>=2?(n[0][0]+n[n.length-1][0]).toUpperCase():t.slice(0,2).toUpperCase()}function A0({className:e,variant:t="header",collapsed:n=!1,onAfterAction:a}){ql();const i=t==="sidebar",{enabled:s,loading:l,signedIn:u,user:h,displayName:f}=eo(),{openLoginModal:p}=h1(),g=ss(),v=b.useMemo(()=>s8(h),[h]),_=b.useMemo(()=>l8(v),[v]),[w,S]=Xo.useState(!1);if(Xo.useEffect(()=>{S(!1)},[_]),!s)return null;if(l)return T.jsx("div",{className:St("h-9 w-9 shrink-0 rounded-full bg-oai-gray-200 dark:bg-oai-gray-800 animate-pulse",e),"aria-hidden":!0});if(!u)return i?T.jsxs("button",{type:"button",onClick:()=>{p(),a?.()},className:St("flex items-center gap-2 rounded-md px-2 py-1.5 text-[13px] font-medium text-oai-gray-700 dark:text-oai-gray-300 hover:bg-oai-gray-200/60 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500 min-w-0",n?"h-8 w-8 justify-center px-0":"w-full",e),"aria-label":De("header.auth.sign_in_aria"),title:n?De("header.auth.sign_in_aria"):void 0,children:[T.jsx("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center",children:T.jsx("img",{src:"/app-icon.png",alt:"",width:18,height:18,className:"h-[18px] w-[18px] rounded"})}),!n&&T.jsx("span",{className:"truncate flex-1 text-left",children:De("header.auth.sign_in_aria")})]}):T.jsx("button",{type:"button",onClick:p,className:St("shrink-0 inline-flex h-9 items-center justify-center gap-1.5 rounded-md px-4 text-sm font-medium transition-colors duration-200 ease-out shadow-sm ring-1 ring-oai-gray-200 dark:ring-white/10 bg-oai-gray-900 text-white hover:bg-oai-gray-800 active:bg-oai-gray-950 dark:bg-white dark:text-oai-gray-900 dark:hover:bg-oai-gray-100 dark:active:bg-oai-gray-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500 focus-visible:ring-offset-2 dark:focus-visible:ring-offset-oai-gray-950",e),"aria-label":De("header.auth.sign_in_aria"),children:De("header.auth.sign_in_aria")});const P=()=>{g("/settings"),a?.()};return T.jsx("div",{className:St(i?"relative flex w-full shrink-0 items-center":"relative flex shrink-0 items-center",e),children:T.jsxs("button",{type:"button",onClick:P,className:St(i?St("flex w-full items-center gap-2 rounded-md px-2 py-1.5 hover:bg-oai-gray-200/60 dark:hover:bg-oai-gray-800 transition-colors min-w-0",n&&"justify-center px-0 py-0 h-9 w-9"):"flex items-center gap-2 rounded-md pl-1 pr-2 py-1 border border-transparent hover:bg-oai-gray-100 dark:hover:bg-oai-gray-900/80 hover:border-oai-gray-200 dark:hover:border-oai-gray-800 transition-colors"),"aria-label":De("header.auth.open_settings"),title:i&&n?f:void 0,children:[i?T.jsx("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center",children:_&&!w?T.jsx("img",{src:_,alt:"",width:20,height:20,className:"h-5 w-5 rounded-full object-cover ring-1 ring-oai-gray-300 dark:ring-oai-gray-700",referrerPolicy:"no-referrer",onError:()=>S(!0)}):bu(f)==="?"?T.jsx("span",{className:"flex h-5 w-5 items-center justify-center rounded-full bg-oai-brand-600/30 text-white ring-1 ring-oai-brand-500/50",children:T.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",className:"w-3 h-3 opacity-80",children:T.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z"})})}):T.jsx("span",{className:"flex h-5 w-5 items-center justify-center rounded-full bg-oai-brand-600 text-[9px] font-semibold text-white ring-1 ring-oai-brand-500/50",children:bu(f)})}):_&&!w?T.jsx("img",{src:_,alt:"",width:32,height:32,className:"h-8 w-8 rounded-full object-cover ring-1 ring-oai-gray-300 dark:ring-oai-gray-700 shrink-0",referrerPolicy:"no-referrer",onError:()=>S(!0)}):bu(f)==="?"?T.jsx("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-oai-brand-600/30 text-white ring-1 ring-oai-brand-500/50",children:T.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",className:"w-4 h-4 opacity-80",children:T.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z"})})}):T.jsx("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-oai-brand-600 text-xs font-semibold text-white ring-1 ring-oai-brand-500/50",children:bu(f)}),i?!n&&T.jsx("span",{className:"truncate text-[13px] font-medium text-oai-gray-900 dark:text-oai-gray-200 flex-1 text-left min-w-0",children:f}):T.jsx("span",{className:"hidden sm:inline truncate text-sm font-medium text-oai-gray-900 dark:text-oai-gray-200 max-w-[120px]",children:f})]})})}const _m="tt.sidebarCollapsed";function gS(){return[{id:"general",label:De("nav.group.general"),items:[{id:"usage",to:"/dashboard",icon:fI,label:De("nav.usage")},{id:"limits",to:"/limits",icon:yI,label:De("nav.limits")},{id:"leaderboard",to:"/leaderboard",icon:zI,label:De("nav.leaderboard")}]},{id:"tools",label:De("nav.group.tools"),items:[{id:"widgets",to:"/widgets",icon:_I,label:De("nav.widgets")},{id:"skills",to:"/skills",icon:RI,label:De("nav.skills")},{id:"ip-check",to:"/ip-check",icon:bI,label:De("nav.ip_check")}]},{id:"account",label:De("nav.group.account"),items:[{id:"settings",to:"/settings",icon:OI,label:De("nav.settings")}]}]}function c8(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(_m)==="1"}catch{return!1}}function u8(){const[e,t]=b.useState(c8),n=b.useCallback(()=>{t(a=>{const i=!a;try{typeof window<"u"&&window.localStorage.setItem(_m,i?"1":"0")}catch{}return i})},[]);return b.useEffect(()=>{if(typeof window>"u")return;const a=i=>{i.key===_m&&t(i.newValue==="1")};return window.addEventListener("storage",a),()=>window.removeEventListener("storage",a)},[]),{collapsed:e,toggle:n}}function d8(e,t){const n=e.replace(/\/+$/,"")||"/";return t==="/dashboard"?n==="/dashboard"||n==="/":t==="/leaderboard"?n==="/leaderboard"||n.startsWith("/leaderboard/"):n===t}function h8({label:e,collapsed:t,first:n}){return t?n?null:T.jsx("div",{className:"mx-2 my-2 h-px bg-oai-gray-200/70 dark:bg-oai-gray-800/70","aria-hidden":!0}):T.jsx("div",{className:St("px-3 pb-1 text-[10px] uppercase tracking-wider text-oai-gray-500 dark:text-oai-gray-500",n?"pt-2":"pt-4"),children:e})}function f8({item:e,collapsed:t,active:n,onClick:a}){const i=e.icon;return T.jsxs(Rd,{to:e.to,onClick:a,title:t?e.label:void 0,"aria-current":n?"page":void 0,className:St("flex items-center gap-2 rounded-md px-2 py-1.5 text-[13px] no-underline transition-colors",t&&"justify-center px-0 py-2",n?"bg-oai-gray-200/70 text-oai-black font-medium dark:bg-oai-gray-800 dark:text-white":"text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-200/50 hover:text-oai-black dark:hover:bg-oai-gray-800/60 dark:hover:text-white"),children:[T.jsx("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center",children:T.jsx(i,{className:"h-[15px] w-[15px]","aria-hidden":!0})}),!t&&T.jsx("span",{className:"truncate",children:e.label})]})}function p8({as:e="button",title:t,onClick:n,href:a,children:i,className:s,...l}){const u=St("flex h-10 w-10 items-center justify-center rounded-lg text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-200/60 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white transition-colors no-underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500",s);return e==="a"?T.jsx("a",{href:a,target:"_blank",rel:"noopener noreferrer",title:t,"aria-label":t,className:u,...l,children:i}):T.jsx("button",{type:"button",title:t,"aria-label":t,onClick:n,className:u,...l,children:i})}function m8({repo:e="mm7894215/TokenTracker",glassChrome:t=!1}){const[n,a]=b.useState(null);return b.useEffect(()=>{if(typeof window>"u")return;const i=typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;o8({prefersReducedMotion:i,screenshotCapture:!1})&&fetch(`https://api.github.com/repos/${e}`).then(s=>s.json()).then(s=>{s&&typeof s.stargazers_count=="number"&&a(s.stargazers_count)}).catch(()=>{})},[e]),T.jsxs("a",{href:`https://github.com/${e}`,target:"_blank",rel:"noopener noreferrer","aria-label":n!==null?`Star on GitHub (${n})`:"Star on GitHub",className:St("inline-flex h-7 items-center gap-1.5 rounded-full px-2.5 text-xs font-medium transition-colors no-underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500",t?"border border-gray-500/20 dark:border-gray-500/30 bg-gray-500/[0.04] dark:bg-gray-500/[0.06] backdrop-blur-[2px] text-oai-gray-700 dark:text-oai-gray-300 hover:bg-gray-500/10 dark:hover:bg-gray-500/12 hover:border-gray-500/30 dark:hover:border-gray-500/40 hover:text-oai-black dark:hover:text-white":"border border-oai-gray-200 dark:border-oai-gray-700 text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-200/60 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white hover:border-oai-gray-300 dark:hover:border-oai-gray-600"),children:[T.jsx("svg",{height:"12",viewBox:"0 0 16 16",width:"12",className:"shrink-0 fill-current",children:T.jsx("path",{d:"M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z"})}),T.jsx("span",{children:"Star"}),n!==null&&T.jsx("span",{className:"text-[10px] text-oai-gray-500 dark:text-oai-gray-500 tabular-nums",children:n})]})}const g8=[{value:"light",label:"Light",Icon:c1},{value:"dark",label:"Dark",Icon:l1},{value:"system",label:"System",Icon:TI}];function y8({theme:e,resolvedTheme:t,onSetTheme:n,glassChrome:a=!1}){const[i,s]=b.useState(!1),l=b.useRef(null),u=t==="dark"?l1:c1;return b.useEffect(()=>{if(!i)return;const h=p=>{l.current&&!l.current.contains(p.target)&&s(!1)},f=p=>{p.key==="Escape"&&s(!1)};return document.addEventListener("mousedown",h),document.addEventListener("keydown",f),()=>{document.removeEventListener("mousedown",h),document.removeEventListener("keydown",f)}},[i]),T.jsxs("div",{ref:l,className:"relative",children:[T.jsx("button",{type:"button","aria-label":"Theme","aria-expanded":i,"aria-haspopup":"menu",title:"Theme",onClick:()=>s(h=>!h),className:St("inline-flex h-7 w-7 items-center justify-center rounded-full transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500",a?"border border-gray-500/20 dark:border-gray-500/30 bg-gray-500/[0.04] dark:bg-gray-500/[0.06] backdrop-blur-[2px] text-oai-gray-700 dark:text-oai-gray-300 hover:bg-gray-500/10 dark:hover:bg-gray-500/12 hover:border-gray-500/30 dark:hover:border-gray-500/40 hover:text-oai-black dark:hover:text-white":"border border-oai-gray-200 dark:border-oai-gray-700 text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-200/60 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white hover:border-oai-gray-300 dark:hover:border-oai-gray-600"),children:T.jsx(u,{className:"h-3.5 w-3.5","aria-hidden":!0})}),i&&T.jsx("div",{role:"menu",className:"absolute bottom-full left-0 mb-2 z-50 min-w-[140px] py-1 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-white dark:bg-oai-gray-900 shadow-lg",children:g8.map(({value:h,label:f,Icon:p})=>{const g=e===h;return T.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{n(h),s(!1)},className:St("flex w-full items-center gap-2.5 px-3 py-1.5 text-[13px] transition-colors",g?"text-oai-black dark:text-white bg-oai-gray-100 dark:bg-oai-gray-800":"text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-50 dark:hover:bg-oai-gray-800/60 hover:text-oai-black dark:hover:text-white"),children:[T.jsx(p,{className:"h-3.5 w-3.5 shrink-0","aria-hidden":!0}),T.jsx("span",{children:f})]},h)})})]})}function yS({collapsed:e,onToggleCollapsed:t,onItemClick:n,showCloseButton:a=!1,onClose:i,glassChrome:s=!1}){const u=Mn()?.pathname||"/",{theme:h,resolvedTheme:f,setTheme:p}=i8(),{resolvedLocale:g}=ql(),v=b.useMemo(()=>gS(),[g]);return T.jsxs(T.Fragment,{children:[T.jsx("div",{className:St("px-2 pt-2 pb-2",e&&"flex justify-center"),children:a?T.jsxs("div",{className:"flex items-center gap-2",children:[T.jsx("div",{className:"flex-1 min-w-0",children:T.jsx(A0,{variant:"sidebar",collapsed:e,onAfterAction:n})}),T.jsx("button",{type:"button",onClick:i,"aria-label":De("nav.close_menu"),title:De("nav.close_menu"),className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-oai-gray-500 dark:text-oai-gray-500 hover:bg-oai-gray-200/60 dark:hover:bg-oai-gray-800 hover:text-oai-gray-900 dark:hover:text-oai-gray-200 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500",children:T.jsx(gg,{className:"h-4 w-4",strokeWidth:1.75,"aria-hidden":!0})})]}):T.jsx(A0,{variant:"sidebar",collapsed:e,onAfterAction:n})}),T.jsx("nav",{"aria-label":De("nav.nav_label"),className:"flex-1 px-2 pb-2 flex flex-col overflow-y-auto",children:v.map((_,w)=>T.jsxs("div",{className:"flex flex-col",children:[T.jsx(h8,{label:_.label,collapsed:e,first:w===0}),T.jsx("div",{className:"flex flex-col gap-0.5",children:_.items.filter(S=>!(S.to==="/widgets"&&hg())).map(S=>T.jsx(f8,{item:S,collapsed:e,active:d8(u,S.to),onClick:n},S.id))})]},_.id))}),T.jsxs("div",{className:St("flex items-center px-2 py-3",e?"flex-col justify-center gap-2":"justify-between gap-2"),children:[T.jsx(y8,{theme:h,resolvedTheme:f,onSetTheme:p,glassChrome:s}),T.jsx("div",{className:"flex items-center gap-1.5",children:!e&&T.jsx(m8,{glassChrome:s})})]})]})}function v8({collapsed:e,onToggleCollapsed:t}){const n=b.useMemo(()=>typeof window>"u"?!1:Ca()||jd(),[]);return T.jsx("aside",{"aria-label":De("nav.aside_label"),className:St("hidden lg:flex flex-col shrink-0 h-full min-h-0 transition-[width] duration-200",e?"w-[72px]":"w-[220px]"),children:T.jsx(yS,{collapsed:e,onToggleCollapsed:t,glassChrome:n})})}function b8({open:e,onClose:t}){return b.useEffect(()=>{if(!e)return;const n=a=>{a.key==="Escape"&&t()};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[e,t]),b.useEffect(()=>{if(!e)return;const n=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=n}},[e]),e?T.jsxs("div",{className:"lg:hidden fixed inset-0 z-[80] flex",children:[T.jsx("div",{className:"absolute inset-0 bg-black/40 backdrop-blur-sm",onClick:t,"aria-hidden":!0}),T.jsx("aside",{"aria-label":De("nav.aside_label"),className:"relative w-[260px] max-w-[80vw] flex flex-col bg-oai-white dark:bg-oai-gray-900 border-r border-oai-gray-200 dark:border-oai-gray-800 shadow-2xl",children:T.jsx(yS,{collapsed:!1,showCloseButton:!0,onClose:t,onItemClick:t})})]}):null}function k8({onOpenDrawer:e}){return T.jsxs("div",{className:"lg:hidden flex items-center justify-between gap-2 px-3 h-14 border-b border-oai-gray-200 dark:border-oai-gray-800",children:[T.jsx(p8,{title:De("nav.menu"),onClick:e,children:T.jsx(SI,{className:"h-5 w-5","aria-hidden":!0})}),T.jsxs(Rd,{to:"/landing",className:"flex items-center gap-2 no-underline hover:opacity-80 transition-opacity","aria-label":"Token Tracker",children:[T.jsx("img",{src:"/app-icon.png",alt:"",width:24,height:24,className:"rounded-md"}),T.jsx("span",{className:"text-sm font-semibold text-oai-black dark:text-oai-white",children:"Token Tracker"})]}),T.jsx("div",{className:"w-10 shrink-0","aria-hidden":!0})]})}function _8({children:e}){const{collapsed:t,toggle:n}=u8(),[a,i]=b.useState(!1),s=b.useCallback(()=>i(!0),[]),l=b.useCallback(()=>i(!1),[]),u=b.useMemo(()=>typeof window>"u"?!1:Ca()||jd(),[]);return T.jsxs("div",{className:St("fixed inset-0 flex flex-col text-oai-black dark:text-oai-white font-sans overflow-hidden",hg()&&"tt-native-glass-shell",u?"bg-transparent":"bg-oai-gray-100 dark:bg-oai-gray-950"),children:[u&&T.jsx("div",{className:"h-7 shrink-0",style:{WebkitAppRegion:"drag"},"aria-hidden":!0}),T.jsxs("div",{className:"flex-1 min-h-0 flex",children:[T.jsx(v8,{collapsed:t,onToggleCollapsed:n}),T.jsx(b8,{open:a,onClose:l}),T.jsx("div",{className:"flex-1 min-w-0 min-h-0 p-2 lg:pl-0 lg:pr-3 lg:pb-3 flex flex-col",children:T.jsxs("div",{className:St("flex-1 min-h-0 flex flex-col bg-oai-white dark:bg-oai-gray-900 border border-oai-gray-200 dark:border-oai-gray-800 overflow-hidden",u?"tt-native-main-card":"rounded-2xl",!u&&"shadow-sm"),children:[T.jsx(k8,{onOpenDrawer:s}),T.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto",children:e})]})})]})]})}function w8({size:e=16,className:t=""}){return T.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:t,children:T.jsx("path",{d:"M4.709 15.955l4.72-2.647.08-.23-.08-.128H9.2l-.79-.048-2.698-.073-2.339-.097-2.266-.122-.571-.121L0 11.784l.055-.352.48-.321.686.06 1.52.103 2.278.158 1.652.097 2.449.255h.389l.055-.157-.134-.098-.103-.097-2.358-1.596-2.552-1.688-1.336-.972-.724-.491-.364-.462-.158-1.008.656-.722.881.06.225.061.893.686 1.908 1.476 2.491 1.833.365.304.145-.103.019-.073-.164-.274-1.355-2.446-1.446-2.49-.644-1.032-.17-.619a2.97 2.97 0 01-.104-.729L6.283.134 6.696 0l.996.134.42.364.62 1.414 1.002 2.229 1.555 3.03.456.898.243.832.091.255h.158V9.01l.128-1.706.237-2.095.23-2.695.08-.76.376-.91.747-.492.584.28.48.685-.067.444-.286 1.851-.559 2.903-.364 1.942h.212l.243-.242.985-1.306 1.652-2.064.73-.82.85-.904.547-.431h1.033l.76 1.129-.34 1.166-1.064 1.347-.881 1.142-1.264 1.7-.79 1.36.073.11.188-.02 2.856-.606 1.543-.28 1.841-.315.833.388.091.395-.328.807-1.969.486-2.309.462-3.439.813-.042.03.049.061 1.549.146.662.036h1.622l3.02.225.79.522.474.638-.079.485-1.215.62-1.64-.389-3.829-.91-1.312-.329h-.182v.11l1.093 1.068 2.006 1.81 2.509 2.33.127.578-.322.455-.34-.049-2.205-1.657-.851-.747-1.926-1.62h-.128v.17l.444.649 2.345 3.521.122 1.08-.17.353-.608.213-.668-.122-1.374-1.925-1.415-2.167-1.143-1.943-.14.08-.674 7.254-.316.37-.729.28-.607-.461-.322-.747.322-1.476.389-1.924.315-1.53.286-1.9.17-.632-.012-.042-.14.018-1.434 1.967-2.18 2.945-1.726 1.845-.414.164-.717-.37.067-.662.401-.589 2.388-3.036 1.44-1.882.93-1.086-.006-.158h-.055L4.132 18.56l-1.13.146-.487-.456.061-.746.231-.243 1.908-1.312-.006.006z"})})}function x8({size:e=16,className:t=""}){return T.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",className:t,children:T.jsx("path",{d:"M8.086.457a6.105 6.105 0 013.046-.415c1.333.153 2.521.72 3.564 1.7a.117.117 0 00.107.029c1.408-.346 2.762-.224 4.061.366l.063.03.154.076c1.357.703 2.33 1.77 2.918 3.198.278.679.418 1.388.421 2.126a5.655 5.655 0 01-.18 1.631.167.167 0 00.04.155 5.982 5.982 0 011.578 2.891c.385 1.901-.01 3.615-1.183 5.14l-.182.22a6.063 6.063 0 01-2.934 1.851.162.162 0 00-.108.102c-.255.736-.511 1.364-.987 1.992-1.199 1.582-2.962 2.462-4.948 2.451-1.583-.008-2.986-.587-4.21-1.736a.145.145 0 00-.14-.032c-.518.167-1.04.191-1.604.185a5.924 5.924 0 01-2.595-.622 6.058 6.058 0 01-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74 7.74 0 01-.495-1.283 6.11 6.11 0 01-.017-3.064.166.166 0 00.008-.074.115.115 0 00-.037-.064 5.958 5.958 0 01-1.38-2.202 5.196 5.196 0 01-.333-1.589 6.915 6.915 0 01.188-2.132c.45-1.484 1.309-2.648 2.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129 0 00.087-.087A6.016 6.016 0 015.635 2.31C6.315 1.464 7.132.846 8.086.457zm-.804 7.85a.848.848 0 00-1.473.842l1.694 2.965-1.688 2.848a.849.849 0 001.46.864l1.94-3.272a.849.849 0 00.007-.854l-1.94-3.393zm5.446 6.24a.849.849 0 000 1.695h4.848a.849.849 0 000-1.696h-4.848z"})})}function P8({size:e=16,className:t=""}){return T.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:t,children:T.jsx("path",{d:"M22.106 5.68L12.5.135a.998.998 0 00-.998 0L1.893 5.68a.84.84 0 00-.419.726v11.186c0 .3.16.577.42.727l9.607 5.547a.999.999 0 00.998 0l9.608-5.547a.84.84 0 00.42-.727V6.407a.84.84 0 00-.42-.726zm-.603 1.176L12.228 22.92c-.063.108-.228.064-.228-.061V12.34a.59.59 0 00-.295-.51l-9.11-5.26c-.107-.062-.063-.228.062-.228h18.55c.264 0 .428.286.296.514z"})})}function S8({size:e=16,className:t=""}){return T.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:t,children:T.jsx("path",{d:"M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z"})})}function C8({size:e=16,className:t=""}){return T.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:t,children:T.jsx("path",{d:"M9.27 15.29l7.978-5.897c.391-.29.95-.177 1.137.272.98 2.369.542 5.215-1.41 7.169-1.951 1.954-4.667 2.382-7.149 1.406l-2.711 1.257c3.889 2.661 8.611 2.003 11.562-.953 2.341-2.344 3.066-5.539 2.388-8.42l.006.007c-.983-4.232.242-5.924 2.75-9.383.06-.082.12-.164.179-.248l-3.301 3.305v-.01L9.267 15.292M7.623 16.723c-2.792-2.67-2.31-6.801.071-9.184 1.761-1.763 4.647-2.483 7.166-1.425l2.705-1.25a7.808 7.808 0 00-1.829-1A8.975 8.975 0 005.984 5.83c-2.533 2.536-3.33 6.436-1.962 9.764 1.022 2.487-.653 4.246-2.34 6.022-.599.63-1.199 1.259-1.682 1.925l7.62-6.815"})})}function T8({size:e=16,className:t=""}){return T.jsx("svg",{width:e,height:e,viewBox:"0 -1 22 28",fill:"currentColor",fillRule:"evenodd",className:t,children:T.jsx("path",{d:"M4.125 20.149c-2.69 5.959 3.036 7.453 7.26 3.966 1.24 3.91 5.898.993 7.569-2.036 3.682-6.678 2.195-13.49 1.813-14.895-2.617-9.582-15.699-9.592-17.95.049-.526 1.687-.535 3.606-.833 5.598-.15 1.005-.256 1.646-.645 2.703-.223.607-.53 1.147-1.014 2.056-.75 1.412-.434 4.138 3.434 2.724v.001ZM11.895 11.332c-1.073 0-1.234-1.283-1.234-2.048 0-.69.124-1.239.358-1.586a1 1 0 0 1 .876-.462c.375 0 .697.158.924.47.259.354.395.9.395 1.578 0 1.283-.493 2.048-1.319 2.048Zm4.416 0c-1.073 0-1.234-1.283-1.234-2.048 0-.69.124-1.239.358-1.586a1 1 0 0 1 .876-.462c.375 0 .697.158.924.47.259.354.396.9.396 1.578 0 1.283-.494 2.048-1.32 2.048Z"})})}function E8({size:e=16,className:t=""}){return T.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:t,children:T.jsx("path",{d:"M16 6H8v12h8V6zm4 16H4V2h16v20z"})})}function A8({size:e=16,className:t=""}){return T.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:t,children:[T.jsx("path",{d:"M21.846 0a1.923 1.923 0 110 3.846H20.15a.226.226 0 01-.227-.226V1.923C19.923.861 20.784 0 21.846 0z"}),T.jsx("path",{d:"M11.065 11.199l7.257-7.2c.137-.136.06-.41-.116-.41H14.3a.164.164 0 00-.117.051l-7.82 7.756c-.122.12-.302.013-.302-.179V3.82c0-.127-.083-.23-.185-.23H3.186c-.103 0-.186.103-.186.23V19.77c0 .128.083.23.186.23h2.69c.103 0 .186-.102.186-.23v-3.25c0-.069.025-.135.069-.178l2.424-2.406a.158.158 0 01.205-.023l6.484 4.772a7.677 7.677 0 003.453 1.283c.108.012.2-.095.2-.23v-3.06c0-.117-.07-.212-.164-.227a5.028 5.028 0 01-2.027-.807l-5.613-4.064c-.117-.078-.132-.279-.028-.381z"})]})}function R8({size:e=16,className:t=""}){return T.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:t,children:T.jsx("path",{d:"M19.245 5.364c1.322 1.36 1.877 3.216 2.11 5.817.622 0 1.2.135 1.592.654l.73.964c.21.278.323.61.323.955v2.62c0 .339-.173.669-.453.868C20.239 19.602 16.157 21.5 12 21.5c-4.6 0-9.205-2.583-11.547-4.258-.28-.2-.452-.53-.453-.868v-2.62c0-.345.113-.679.321-.956l.73-.963c.392-.517.974-.654 1.593-.654l.029-.297c.25-2.446.81-4.213 2.082-5.52 2.461-2.54 5.71-2.851 7.146-2.864h.198c1.436.013 4.685.323 7.146 2.864zm-7.244 4.328c-.284 0-.613.016-.962.05-.123.447-.305.85-.57 1.108-1.05 1.023-2.316 1.18-2.994 1.18-.638 0-1.306-.13-1.851-.464-.516.165-1.012.403-1.044.996a65.882 65.882 0 00-.063 2.884l-.002.48c-.002.563-.005 1.126-.013 1.69.002.326.204.63.51.765 2.482 1.102 4.83 1.657 6.99 1.657 2.156 0 4.504-.555 6.985-1.657a.854.854 0 00.51-.766c.03-1.682.006-3.372-.076-5.053-.031-.596-.528-.83-1.046-.996-.546.333-1.212.464-1.85.464-.677 0-1.942-.157-2.993-1.18-.266-.258-.447-.661-.57-1.108-.32-.032-.64-.049-.96-.05zm-2.525 4.013c.539 0 .976.426.976.95v1.753c0 .525-.437.95-.976.95a.964.964 0 01-.976-.95v-1.752c0-.525.437-.951.976-.951zm5 0c.539 0 .976.426.976.95v1.753c0 .525-.437.95-.976.95a.964.964 0 01-.976-.95v-1.752c0-.525.437-.951.976-.951zM7.635 5.087c-1.05.102-1.935.438-2.385.906-.975 1.037-.765 3.668-.21 4.224.405.394 1.17.657 1.995.657h.09c.649-.013 1.785-.176 2.73-1.11.435-.41.705-1.433.675-2.47-.03-.834-.27-1.52-.63-1.813-.39-.336-1.275-.482-2.265-.394zm6.465.394c-.36.292-.6.98-.63 1.813-.03 1.037.24 2.06.675 2.47.968.957 2.136 1.104 2.776 1.11h.044c.825 0 1.59-.263 1.995-.657.555-.556.765-3.187-.21-4.224-.45-.468-1.335-.804-2.385-.906-.99-.088-1.875.058-2.265.394zM12 7.615c-.24 0-.525.015-.84.044.03.16.045.336.06.526l-.001.159a2.94 2.94 0 01-.014.25c.225-.022.425-.027.612-.028h.366c.187 0 .387.006.612.028-.015-.146-.015-.277-.015-.409.015-.19.03-.365.06-.526a9.29 9.29 0 00-.84-.044z"})})}function L8({size:e=16,className:t=""}){return T.jsxs("svg",{width:e,height:e,viewBox:"0 0 64 60",fill:"none",className:t,"aria-hidden":"true",children:[T.jsx("path",{fill:"currentColor",d:"M37.2114 3.75318C37.6821 3.33106 37.7106 3.31457 38.0558 3.29385C38.6149 3.2531 39.1272 3.52199 39.9989 4.31564C42.0356 6.16652 44.8714 9.97183 46.6346 13.2212L47.3163 14.4819L48.2782 14.9605C49.2072 15.4299 50.7308 16.3923 51.3672 16.9085C51.655 17.1464 51.6956 17.1508 51.9947 17.0344C53.3454 16.5084 55.2803 17.206 56.9869 18.8432C58.5231 20.3155 59.9943 22.8312 60.558 24.9308C60.6403 25.2687 60.7493 25.9952 60.7891 26.5362C60.9177 28.4358 60.3092 29.9532 59.1362 30.64C58.8965 30.7784 58.8801 30.8158 58.8868 31.4132C58.9409 34.2583 58.1741 37.0985 56.6335 39.8679C54.8946 42.9773 51.7981 46.1938 47.6074 49.2243C45.357 50.8619 40.0323 53.964 37.6248 55.0532C31.8578 57.6496 27.2346 58.646 23.2188 58.154C20.8236 57.8638 18.1124 56.9287 16.5082 55.8433C16.086 55.5515 16.0191 55.5329 15.6966 55.6251C13.9793 56.1185 11.73 55.1053 9.81931 52.9844C9.05725 52.1366 7.82714 50.0548 7.42839 48.9409C6.50606 46.3339 6.68976 43.9816 7.91836 42.5767C8.23573 42.2149 8.2453 42.1995 8.17598 41.5912C8.06148 40.5951 8.00971 39.1206 8.06202 38.1692L8.10361 37.2803L6.76977 34.9212C4.70378 31.2451 3.3912 28.1582 2.88489 25.7998C2.61762 24.5066 2.63385 23.9324 2.96214 23.5078C3.16198 23.2515 3.81796 22.9866 4.60785 22.8407C6.59665 22.4917 10.9334 22.8076 15.7581 23.6595L16.259 23.7458L17.3608 22.7713C19.1891 21.1519 20.4038 20.244 22.6429 18.8478C24.9768 17.3876 27.6108 16.1858 30.577 15.2346L31.5295 14.9294L32.0526 13.5561C33.9257 8.61146 35.8437 4.96584 37.2114 3.75318ZM21.5208 29.0919C19.404 30.314 18.3453 30.9251 17.5676 31.6099C14.4179 34.3835 13.2414 38.777 14.5823 42.7537C14.9135 43.7357 15.5247 44.7942 16.7469 46.9111C17.9691 49.0279 18.5801 50.0865 19.2649 50.8643C22.0385 54.014 26.4316 55.1918 30.4084 53.8509C31.3904 53.5198 32.4489 52.9085 34.5657 51.6863L46.7442 44.6551C48.8613 43.4328 49.9205 42.8214 50.6983 42.1365C53.8479 39.363 55.0245 34.9695 53.6835 30.9927C53.3524 30.0107 52.7412 28.9522 51.519 26.8354C50.2968 24.7185 49.6858 23.66 49.0009 22.8822C46.2274 19.7325 41.8342 18.5547 37.8575 19.8956C36.8754 20.2267 35.8163 20.8383 33.6993 22.0606L21.5208 29.0919Z"}),T.jsx("g",{transform:"rotate(-30 22.6953 37.6011)",children:T.jsx("rect",{x:"22.6953",y:"37.6011",width:"4.81084",height:"9.99175",rx:"2.40542",fill:"currentColor"})}),T.jsx("g",{transform:"rotate(-30 35.6748 30.1074)",children:T.jsx("rect",{x:"35.6748",y:"30.1074",width:"4.81084",height:"9.99175",rx:"2.40542",fill:"currentColor"})})]})}function D8({size:e=16,className:t=""}){return T.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",className:t,children:T.jsx("path",{d:"M7 2h10a5 5 0 015 5v10a5 5 0 01-5 5H7a5 5 0 01-5-5V7a5 5 0 015-5zm0 4.5v11h2.35v-4.55h5.3V17.5H17v-11h-2.35v4.1h-5.3V6.5H7z"})})}function M8({size:e=16,className:t=""}){return T.jsx("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"currentColor",className:t,children:T.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8z"})})}function I8({size:e=16,className:t=""}){return T.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,"aria-hidden":"true",children:T.jsx("g",{transform:"translate(3.4502, 3)",fill:"#9570BE",children:T.jsx("path",{d:"M3.17890888,3.6 L3.17890888,0 L16,0 L16,3.6 L3.17890888,3.6 Z M9.642,7.2 L9.64218223,10.8 L0,10.8 L0,3.6 L16,3.6 L16,7.2 L9.642,7.2 Z M3.17890888,18 L3.178,14.4 L0,14.4 L0,10.8 L16,10.8 L16,18 L3.17890888,18 Z",fillRule:"nonzero"})})})}function N8({size:e=16,className:t=""}){return T.jsxs("svg",{width:e,height:e,viewBox:"0 0 120 90",fill:"currentColor",className:t,children:[T.jsx("rect",{x:"10",y:"8",width:"100",height:"12",rx:"2"}),T.jsx("rect",{x:"25",y:"20",width:"12",height:"62",rx:"2"}),T.jsx("rect",{x:"75",y:"20",width:"12",height:"45",rx:"2"}),T.jsx("rect",{x:"71",y:"55",width:"20",height:"16",rx:"3"}),T.jsx("rect",{x:"76",y:"71",width:"3",height:"8",rx:"1"}),T.jsx("rect",{x:"82",y:"71",width:"3",height:"8",rx:"1"})]})}function O8({size:e=16,className:t=""}){return T.jsxs("svg",{width:e,height:e,viewBox:"0 0 120 90",fill:"currentColor",className:t,children:[T.jsx("rect",{x:"10",y:"8",width:"100",height:"12",rx:"2"}),T.jsx("rect",{x:"25",y:"20",width:"12",height:"62",rx:"2"}),T.jsx("rect",{x:"83",y:"20",width:"12",height:"62",rx:"2"})]})}function j8({size:e=16,className:t=""}){return T.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[T.jsx("path",{d:"M9 3v2"}),T.jsx("path",{d:"M15 3v2"}),T.jsx("rect",{x:"4",y:"6",width:"16",height:"13",rx:"3"}),T.jsx("circle",{cx:"9",cy:"13",r:"1.4",fill:"currentColor",stroke:"none"}),T.jsx("circle",{cx:"15",cy:"13",r:"1.4",fill:"currentColor",stroke:"none"}),T.jsx("path",{d:"M9 16h6"})]})}const U8={CLAUDE:w8,CODEBUDDY:L8,CODEX:x8,COPILOT:R8,CRAFT:I8,CURSOR:P8,DROID:j8,GEMINI:S8,GITHUB:M8,GROK:C8,HERMES:D8,KIMI:A8,KIRO:T8,OPENCODE:E8,OMP:N8,PI:O8},B8={ANTIGRAVITY:"/brand-logos/antigravity.svg",CLAUDE:"/brand-logos/claude-code.svg",CODEX:"/brand-logos/codex.svg",GEMINI:"/brand-logos/gemini.svg",HERMES:"/brand-logos/hermes.svg","KILO-CLI":"/brand-logos/kilo.svg","KILO-CODE":"/brand-logos/kilo.svg",OPENCLAW:"/brand-logos/openclaw.svg",OPENCODE:"/brand-logos/opencode.svg"};function F8({size:e=16,className:t=""}){return T.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:T.jsx("circle",{cx:"12",cy:"12",r:"7.5",strokeDasharray:"3 3"})})}function z8({provider:e,size:t=16,color:n,className:a=""}){const i=e?.toUpperCase?.()||"",s=B8[i];if(s)return T.jsx("img",{src:s,alt:"",width:t,height:t,className:a,style:{width:t,height:t,objectFit:"contain"},"aria-hidden":!0});const l=U8[i];return l?T.jsx(l,{size:t,className:a}):T.jsx(F8,{size:t,className:`text-oai-gray-400 dark:text-oai-gray-500 shrink-0 ${a}`})}const vS="tokentracker-skills";async function no(e){const t=new URL(`/functions/${vS}`,window.location.origin);if(e)for(const[i,s]of Object.entries(e))s!=null&&s!==""&&t.searchParams.set(i,String(s));const n=await fetch(t.toString(),{headers:{Accept:"application/json"},cache:"no-store"}),a=await n.json().catch(()=>null);if(!n.ok)throw new Error(a?.error||`Request failed with HTTP ${n.status}`);return a}async function hi(e){const t=await Od(),n=await fetch(`/functions/${vS}`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json",...t},cache:"no-store",body:JSON.stringify(e)}),a=await n.json().catch(()=>null);if(!n.ok||a?.ok===!1)throw new Error(a?.error||`Request failed with HTTP ${n.status}`);return a}function V8(){return no({mode:"installed"})}function RB(e={}){return no({mode:"discover",...e.force?{force:1}:{}})}function LB(e,t=0,n=20){return no({mode:"search",q:e,offset:t,limit:n})}function DB(){return no({mode:"repos"})}function MB(e,t){return hi({action:"install",skill:e,targets:t})}function IB(e){return hi({action:"uninstall",id:e})}function NB(e){return hi({action:"restore",id:e})}function OB(e,t){return hi({action:"set_targets",id:e,targets:t})}function jB(e,t){return hi({action:"import_local",directory:e,targets:t})}function UB(e,t){return hi({action:"delete_local",directory:e,targets:t||[]})}function BB(e){return hi({action:"add_repo",repo:e})}function FB(e,t){return hi({action:"remove_repo",owner:e,name:t})}function zB(e={}){return no({mode:"popular",...e.force?{force:1}:{}})}function VB(e={}){return no({mode:"updates",...e.force?{force:1}:{}})}function $B(e={}){return no({mode:"skill_usage",...e.force?{force:1}:{}})}const $8=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1");function H8(){const e=ss(),t=W6(),[n,a]=b.useState(!1),[i,s]=b.useState(""),[l,u]=b.useState(0),[h,f]=b.useState([]),p=b.useRef(null),g=b.useRef(null);b.useEffect(()=>{const E=A=>{(A.metaKey||A.ctrlKey)&&(A.key==="k"||A.key==="K")&&(A.preventDefault(),a(z=>!z))};return window.addEventListener("keydown",E),()=>window.removeEventListener("keydown",E)},[]),b.useEffect(()=>{if(!n)return;s(""),u(0);const E=requestAnimationFrame(()=>p.current?.focus());return $8&&!h.length&&V8().then(A=>f(A?.skills||[])).catch(()=>f([])),()=>cancelAnimationFrame(E)},[n,h.length]);const v=b.useMemo(()=>{const E=gS().flatMap(U=>U.items.map(z=>({kind:"page",id:`page:${z.id}`,label:z.label,sub:De("cmdk.group.pages"),Icon:z.icon,run:()=>e(z.to)}))),A=(h||[]).map(U=>({kind:"skill",id:`skill:${U.id||U.directory}`,label:U.name||U.directory,sub:U.repoOwner&&U.repoName?`${U.repoOwner}/${U.repoName}`:De("cmdk.group.skills"),provider:(U.targets||[])[0]||"claude",run:()=>e(`/skills?skill=${encodeURIComponent(U.directory||U.id)}`)}));return[...E,...A]},[e,h]),_=b.useMemo(()=>{const E=i.trim().toLowerCase();return E?v.filter(A=>A.label.toLowerCase().includes(E)||String(A.sub||"").toLowerCase().includes(E)):v},[v,i]);b.useEffect(()=>{l>=_.length&&u(_.length?_.length-1:0)},[l,_.length]),b.useEffect(()=>{if(!n)return;g.current?.querySelector(`[data-cmdk-index="${l}"]`)?.scrollIntoView({block:"nearest"})},[l,n]);const w=b.useCallback(()=>a(!1),[]),S=b.useCallback(E=>{E&&(w(),E.run())},[w]),P=E=>{E.key==="ArrowDown"?(E.preventDefault(),u(A=>Math.min(A+1,Math.max(0,_.length-1)))):E.key==="ArrowUp"?(E.preventDefault(),u(A=>Math.max(A-1,0))):E.key==="Enter"?(E.preventDefault(),S(_[l])):E.key==="Escape"&&(E.preventDefault(),w())},D={duration:t?0:.12},R=t?{duration:0}:{type:"spring",stiffness:460,damping:34,mass:.6};return T.jsx(FP,{children:n?T.jsxs(Cl.div,{className:"fixed inset-0 z-[120] flex items-start justify-center px-4 pt-[16vh]",initial:t?!1:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:D,children:[T.jsx("button",{type:"button","aria-label":De("cmdk.close"),onClick:w,className:"absolute inset-0 cursor-default bg-oai-black/40"}),T.jsxs(Cl.div,{role:"dialog","aria-modal":"true","aria-label":De("cmdk.open_aria"),initial:t?!1:{opacity:0,y:-8,scale:.985},animate:{opacity:1,y:0,scale:1},exit:t?{opacity:0}:{opacity:0,y:-8,scale:.985},transition:R,className:"relative w-full max-w-xl overflow-hidden rounded-2xl border border-oai-gray-200 bg-oai-white shadow-2xl dark:border-oai-gray-800 dark:bg-oai-gray-950",children:[T.jsxs("div",{className:"flex items-center gap-2.5 border-b border-oai-gray-200 px-4 dark:border-oai-gray-800",children:[T.jsx(II,{className:"h-4 w-4 shrink-0 text-oai-gray-400","aria-hidden":!0}),T.jsx("input",{ref:p,type:"text",value:i,onChange:E=>{s(E.target.value),u(0)},onKeyDown:P,"aria-label":De("cmdk.placeholder"),"aria-controls":"cmdk-listbox","aria-activedescendant":_[l]?`cmdk-opt-${l}`:void 0,role:"combobox","aria-expanded":"true",placeholder:De("cmdk.placeholder"),className:"h-12 w-full bg-transparent text-sm text-oai-black placeholder:text-oai-gray-400 focus:outline-none dark:text-white"})]}),T.jsx("div",{ref:g,id:"cmdk-listbox",role:"listbox",className:"max-h-[min(56vh,22rem)] overflow-y-auto p-1.5",children:_.length===0?T.jsx("div",{className:"px-3 py-8 text-center text-sm text-oai-gray-500 dark:text-oai-gray-400",children:De("cmdk.empty")}):_.map((E,A)=>{const U=A===l;return T.jsxs("button",{type:"button",role:"option",id:`cmdk-opt-${A}`,"data-cmdk-index":A,"aria-selected":U,onMouseMove:()=>u(A),onClick:()=>S(E),className:St("flex w-full items-center gap-3 rounded-lg px-3 py-2 text-left text-sm transition-colors",U?"bg-oai-gray-100 text-oai-black dark:bg-oai-gray-800/70 dark:text-white":"text-oai-gray-700 dark:text-oai-gray-200"),children:[T.jsx("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center text-oai-gray-500 dark:text-oai-gray-400",children:E.kind==="skill"?T.jsx(z8,{provider:E.provider,size:16}):T.jsx(E.Icon,{className:"h-4 w-4","aria-hidden":!0})}),T.jsx("span",{className:"min-w-0 flex-1 truncate font-medium",children:E.label}),T.jsx("span",{className:"shrink-0 truncate text-xs text-oai-gray-400 dark:text-oai-gray-500",children:E.sub}),U?T.jsx(mI,{className:"h-3.5 w-3.5 shrink-0 text-oai-gray-400","aria-hidden":!0}):null]},E.id)})})]})]}):null})}const W8=[];function Yg(e){b.useEffect(e,W8)}const R0={};function ys(e,t){const n=b.useRef(R0);return n.current===R0&&(n.current=e(t)),n}function G8(e,t){return function(a,...i){const s=new URL(e);return s.searchParams.set("code",a.toString()),i.forEach(l=>s.searchParams.append("args[]",l)),`${t} error #${a}; visit ${s} for the full message.`}}const vs=G8("https://base-ui.com/production-error","Base UI"),Zg=b.createContext(void 0);function Xg(){const e=b.useContext(Zg);if(!e)throw new Error(vs(73));return e}const _a=(e,t,n,a,i,s,...l)=>{if(l.length>0)throw new Error(vs(1));let u;if(e&&t&&n&&a&&i&&s)u=(h,f,p,g)=>{const v=e(h,f,p,g),_=t(h,f,p,g),w=n(h,f,p,g),S=a(h,f,p,g),P=i(h,f,p,g);return s(v,_,w,S,P,f,p,g)};else if(e&&t&&n&&a&&i)u=(h,f,p,g)=>{const v=e(h,f,p,g),_=t(h,f,p,g),w=n(h,f,p,g),S=a(h,f,p,g);return i(v,_,w,S,f,p,g)};else if(e&&t&&n&&a)u=(h,f,p,g)=>{const v=e(h,f,p,g),_=t(h,f,p,g),w=n(h,f,p,g);return a(v,_,w,f,p,g)};else if(e&&t&&n)u=(h,f,p,g)=>{const v=e(h,f,p,g),_=t(h,f,p,g);return n(v,_,f,p,g)};else if(e&&t)u=(h,f,p,g)=>{const v=e(h,f,p,g);return t(v,f,p,g)};else if(e)u=e;else throw new Error("Missing arguments");return u};var cp={exports:{}},up={};var L0;function K8(){if(L0)return up;L0=1;var e=Bl();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,a=e.useState,i=e.useEffect,s=e.useLayoutEffect,l=e.useDebugValue;function u(g,v){var _=v(),w=a({inst:{value:_,getSnapshot:v}}),S=w[0].inst,P=w[1];return s(function(){S.value=_,S.getSnapshot=v,h(S)&&P({inst:S})},[g,_,v]),i(function(){return h(S)&&P({inst:S}),g(function(){h(S)&&P({inst:S})})},[g]),l(_),_}function h(g){var v=g.getSnapshot;g=g.value;try{var _=v();return!n(g,_)}catch{return!0}}function f(g,v){return v()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:u;return up.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,up}var D0;function bS(){return D0||(D0=1,cp.exports=K8()),cp.exports}var q8=bS(),dp={exports:{}},hp={};var M0;function Y8(){if(M0)return hp;M0=1;var e=Bl(),t=bS();function n(f,p){return f===p&&(f!==0||1/f===1/p)||f!==f&&p!==p}var a=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,s=e.useRef,l=e.useEffect,u=e.useMemo,h=e.useDebugValue;return hp.useSyncExternalStoreWithSelector=function(f,p,g,v,_){var w=s(null);if(w.current===null){var S={hasValue:!1,value:null};w.current=S}else S=w.current;w=u(function(){function D(z){if(!R){if(R=!0,E=z,z=v(z),_!==void 0&&S.hasValue){var j=S.value;if(_(j,z))return A=j}return A=z}if(j=A,a(E,z))return j;var C=v(z);return _!==void 0&&_(j,C)?(E=z,j):(E=z,A=C)}var R=!1,E,A,U=g===void 0?null:g;return[function(){return D(p())},U===null?void 0:function(){return D(U())}]},[p,g,v,_]);var P=i(f,w[0],w[1]);return l(function(){S.hasValue=!0,S.value=P},[P]),h(P),P},hp}var I0;function Z8(){return I0||(I0=1,dp.exports=Y8()),dp.exports}var X8=Z8();const Q8=parseInt(b.version,10);function Qg(e){return Q8>=e}const J8=Qg(19),eU=J8?nU:aU;function kS(e,t,n,a,i){return eU(e,t,n,a,i)}function tU(e,t,n,a,i){const s=b.useCallback(()=>t(e.getSnapshot(),n,a,i),[e,t,n,a,i]);return q8.useSyncExternalStore(e.subscribe,s,s)}function nU(e,t,n,a,i){return tU(e,t,n,a,i)}function aU(e,t,n,a,i){return X8.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,s=>t(s,n,a,i))}class rU{constructor(t){this.state=t,this.listeners=new Set,this.updateTick=0}subscribe=t=>(this.listeners.add(t),()=>{this.listeners.delete(t)});getSnapshot=()=>this.state;setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const a of this.listeners){if(n!==this.updateTick)return;a(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){this.setState({...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||this.setState({...this.state,[t]:n})}notifyAll(){const t={...this.state};this.setState(t)}use(t,n,a,i){return kS(this,t,n,a,i)}}const Jg={...J0},fp=Jg.useInsertionEffect,iU=fp&&fp!==Jg.useLayoutEffect?fp:e=>e();function Xi(e){const t=ys(oU).current;return t.next=e,iU(t.effect),t.trampoline}function oU(){const e={next:void 0,callback:sU,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function sU(){}const lU=()=>{},Ka=typeof document<"u"?b.useLayoutEffect:lU;function cU(){}const HB=Object.freeze([]),Fi=Object.freeze({});class uU extends rU{constructor(t,n={},a){super(t),this.context=n,this.selectors=a}useSyncedValue(t,n){b.useDebugValue(t);const a=this;Ka(()=>{a.state[t]!==n&&a.set(t,n)},[a,t,n])}useSyncedValueWithCleanup(t,n){const a=this;Ka(()=>(a.state[t]!==n&&a.set(t,n),()=>{a.set(t,void 0)}),[a,t,n])}useSyncedValues(t){const n=this,a=Object.values(t);Ka(()=>{n.update(t)},[n,...a])}useControlledProp(t,n){b.useDebugValue(t);const a=this,i=n!==void 0;Ka(()=>{i&&!Object.is(a.state[t],n)&&a.setState({...a.state,[t]:n})},[a,t,n,i])}select(t,n,a,i){const s=this.selectors[t];return s(this.state,n,a,i)}useState(t,n,a,i){return b.useDebugValue(t),kS(this,this.selectors[t],n,a,i)}useContextCallback(t,n){b.useDebugValue(t);const a=Xi(n??cU);this.context[t]=a}useStateSetter(t){const n=b.useRef(void 0);return n.current===void 0&&(n.current=a=>{this.set(t,a)}),n.current}observe(t,n){let a;typeof t=="function"?a=t:a=this.selectors[t];let i=a(this.state);return n(i,i,this),this.subscribe(s=>{const l=a(s);if(!Object.is(i,l)){const u=i;i=l,n(l,u,this)}})}}function Hd(){return typeof window<"u"}function Aa(e){return ey(e)?(e.nodeName||"").toLowerCase():"#document"}function xr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function dU(e){var t;return(t=(ey(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ey(e){return Hd()?e instanceof Node||e instanceof xr(e).Node:!1}function ty(e){return Hd()?e instanceof Element||e instanceof xr(e).Element:!1}function ci(e){return Hd()?e instanceof HTMLElement||e instanceof xr(e).HTMLElement:!1}function Pd(e){return!Hd()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof xr(e).ShadowRoot}function _S(e){const{overflow:t,overflowX:n,overflowY:a,display:i}=Wd(e);return/auto|scroll|overlay|hidden|clip/.test(t+a+n)&&i!=="inline"&&i!=="contents"}function WB(e){return/^(table|td|th)$/.test(Aa(e))}function hU(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const fU=/transform|translate|scale|rotate|perspective|filter/,pU=/paint|layout|strict|content/,Di=e=>!!e&&e!=="none";let pp;function mU(e){const t=ty(e)?Wd(e):e;return Di(t.transform)||Di(t.translate)||Di(t.scale)||Di(t.rotate)||Di(t.perspective)||!gU()&&(Di(t.backdropFilter)||Di(t.filter))||fU.test(t.willChange||"")||pU.test(t.contain||"")}function GB(e){let t=wm(e);for(;ci(t)&&!wS(t);){if(mU(t))return t;if(hU(t))return null;t=wm(t)}return null}function gU(){return pp==null&&(pp=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),pp}function wS(e){return/^(html|body|#document)$/.test(Aa(e))}function Wd(e){return xr(e).getComputedStyle(e)}function KB(e){return ty(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function wm(e){if(Aa(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Pd(e)&&e.host||dU(e);return Pd(t)?t.host:t}function xS(e){const t=wm(e);return wS(t)?e.ownerDocument?e.ownerDocument.body:e.body:ci(t)&&_S(t)?t:xS(t)}function N0(e,t,n){var a;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=xS(e),s=i===((a=e.ownerDocument)==null?void 0:a.body),l=xr(i);if(s){const u=yU(l);return t.concat(l,l.visualViewport||[],_S(i)?i:[],u&&n?N0(u):[])}else return t.concat(i,N0(i,[],n))}function yU(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function PS(...e){return()=>{for(let t=0;t<e.length;t+=1){const n=e[t];n&&n()}}}function Ta(e){return e?.ownerDocument||document}function zi(e,t,n,a){return e.addEventListener(t,n,a),()=>{e.removeEventListener(t,n,a)}}const ku=null;class vU{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=t=>{this.isScheduled=!1;const n=this.callbacks,a=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,a>0)for(let i=0;i<n.length;i+=1)n[i]?.(t)};request(t){const n=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,!this.isScheduled&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(t){const n=t-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}const _u=new vU;class ny{static create(){return new ny}static request(t){return _u.request(t)}static cancel(t){return _u.cancel(t)}currentId=ku;request(t){this.cancel(),this.currentId=_u.request(()=>{this.currentId=ku,t()})}cancel=()=>{this.currentId!==ku&&(_u.cancel(this.currentId),this.currentId=ku)};disposeEffect=()=>this.cancel}function bU(){const e=ys(ny.create).current;return Yg(e.disposeEffect),e}const cl=0;class Ul{static create(){return new Ul}currentId=cl;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=cl,n()},t)}isStarted(){return this.currentId!==cl}clear=()=>{this.currentId!==cl&&(clearTimeout(this.currentId),this.currentId=cl)};disposeEffect=()=>this.clear}function kU(){const e=ys(Ul.create).current;return Yg(e.disposeEffect),e}let O0=0;function SS(e){return O0+=1,`${e}-${Math.random().toString(36).slice(2,6)}-${O0}`}function mp(e,t){if(typeof e=="string")return{description:e};if(typeof e=="function"){const n=e(t);return typeof n=="string"?{description:n}:n}return e}const bs=typeof navigator<"u",gp=wU(),CS=PU(),TS=xU(),qB=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),YB=gp.platform==="MacIntel"&&gp.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(gp.platform),_U=bs&&/apple/i.test(navigator.vendor),xm=bs&&/android/i.test(CS)||/android/i.test(TS);bs&&CS.toLowerCase().startsWith("mac")&&navigator.maxTouchPoints;const ES=TS.includes("jsdom/");function wU(){if(!bs)return{platform:"",maxTouchPoints:-1};const e=navigator.userAgentData;return e?.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function xU(){if(!bs)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}function PU(){if(!bs)return"";const e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??""}const j0="data-base-ui-focusable",AS="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",yp="ArrowLeft",vp="ArrowRight",SU="ArrowUp",CU="ArrowDown";function Zo(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function Pr(e,t){if(!e||!t)return!1;const n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&Pd(n)){let a=t;for(;a;){if(e===a)return!0;a=a.parentNode||a.host}}return!1}function Vi(e){return"composedPath"in e?e.composedPath()[0]:e.target}function ZB(e,t){if(!ty(e))return!1;const n=e;if(t.hasElement(n))return!n.hasAttribute("data-trigger-disabled");for(const[,a]of t.entries())if(Pr(a,n))return!a.hasAttribute("data-trigger-disabled");return!1}function XB(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function QB(e){return e.matches("html,body")}function TU(e){return ci(e)&&e.matches(AS)}function JB(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${AS}`)!=null}function eF(e){return e?e.getAttribute("role")==="combobox"&&TU(e):!1}function Pm(e){if(!e||ES)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function tF(e){return e?e.hasAttribute(j0)?e:e.querySelector(`[${j0}]`)||e:null}function bp(e){e.preventDefault(),e.stopPropagation()}function nF(e){return"nativeEvent"in e}function aF(e){return e.pointerType===""&&e.isTrusted?!0:xm&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function rF(e){return ES?!1:!xm&&e.width===0&&e.height===0||xm&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function iF(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function oF(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const sF=["top","right","bottom","left"],EU=Math.min,AU=Math.max,lF=Math.round,kp=Math.floor,cF=e=>({x:e,y:e}),RU={left:"right",right:"left",bottom:"top",top:"bottom"};function uF(e,t,n){return AU(e,EU(t,n))}function dF(e,t){return typeof e=="function"?e(t):e}function RS(e){return e.split("-")[0]}function LS(e){return e.split("-")[1]}function LU(e){return e==="x"?"y":"x"}function DU(e){return e==="y"?"height":"width"}function MU(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function IU(e){return LU(MU(e))}function hF(e,t,n){n===void 0&&(n=!1);const a=LS(e),i=IU(e),s=DU(i);let l=i==="x"?a===(n?"end":"start")?"right":"left":a==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(l=Cm(l)),[l,Cm(l)]}function fF(e){const t=Cm(e);return[Sm(e),t,Sm(t)]}function Sm(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const U0=["left","right"],B0=["right","left"],NU=["top","bottom"],OU=["bottom","top"];function jU(e,t,n){switch(e){case"top":case"bottom":return n?t?B0:U0:t?U0:B0;case"left":case"right":return t?NU:OU;default:return[]}}function pF(e,t,n,a){const i=LS(e);let s=jU(RS(e),n==="start",a);return i&&(s=s.map(l=>l+"-"+i),t&&(s=s.concat(s.map(Sm)))),s}function Cm(e){const t=RS(e);return RU[t]+e.slice(t.length)}function UU(e){return{top:0,right:0,bottom:0,left:0,...e}}function mF(e){return typeof e!="number"?UU(e):{top:e,right:e,bottom:e,left:e}}function gF(e){const{x:t,y:n,width:a,height:i}=e;return{width:a,height:i,top:n,left:t,right:t+a,bottom:n+i,x:t,y:n}}function wu(e,t,n){return Math.floor(e/t)!==n}function F0(e,t){return t<0||t>=e.length}function yF(e,t){return Pa(e.current,{disabledIndices:t})}function vF(e,t){return Pa(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Pa(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:a,amount:i=1}={}){let s=t;do s+=n?-i:i;while(s>=0&&s<=e.length-1&&Tm(e,s,a));return s}function bF(e,{event:t,orientation:n,loopFocus:a,onLoop:i,rtl:s,cols:l,disabledIndices:u,minIndex:h,maxIndex:f,prevIndex:p,stopEvent:g=!1}){let v=p,_;if(t.key===SU?_="up":t.key===CU&&(_="down"),_){const w=[],S=[];let P=!1,D=0;{let K=null,Y=-1;e.forEach((ce,re)=>{if(ce==null)return;D+=1;const fe=ce.closest('[role="row"]');fe&&(P=!0),(fe!==K||Y===-1)&&(K=fe,Y+=1,w[Y]=[]),w[Y].push(re),S[re]=Y})}let R=!1,E=0;if(P)for(const K of w){const Y=K.length;Y>E&&(E=Y),Y!==l&&(R=!0)}const A=R&&D<e.length,U=E||l,z=K=>{if(!R||p===-1)return;const Y=S[p];if(Y==null)return;const ce=w[Y].indexOf(p),re=K==="up"?-1:1;for(let fe=Y+re,de=0;de<w.length;de+=1,fe+=re){if(fe<0||fe>=w.length){if(!a||A)return;if(fe=fe<0?w.length-1:0,i){const oe=Math.min(ce,w[fe].length-1),X=w[fe][oe]??w[fe][0],Z=i(t,p,X);fe=S[Z]??fe}}const he=w[fe];for(let oe=Math.min(ce,he.length-1);oe>=0;oe-=1){const X=he[oe];if(!Tm(e,X,u))return X}}},j=K=>{if(!A||p===-1)return;const Y=p%U,ce=K==="up"?-U:U,re=f-f%U,fe=kp(f/U)+1;for(let de=p-Y+ce,he=0;he<fe;he+=1,de+=ce){if(de<0||de>f){if(!a)return;de=de<0?re:0}const oe=Math.min(de+U-1,f);for(let X=Math.min(de+Y,oe);X>=de;X-=1)if(!Tm(e,X,u))return X}};g&&bp(t);const C=z(_)??j(_);if(C!==void 0)v=C;else if(p===-1)v=_==="up"?f:h;else if(v=Pa(e,{startingIndex:p,amount:U,decrement:_==="up",disabledIndices:u}),a){if(_==="up"&&(p-U<h||v<0)){const K=p%U,Y=f%U,ce=f-(Y-K);Y===K?v=f:v=Y>K?ce:ce-U,i&&(v=i(t,p,v))}_==="down"&&p+U>f&&(v=Pa(e,{startingIndex:p%U-U,amount:U,disabledIndices:u}),i&&(v=i(t,p,v)))}F0(e,v)&&(v=p)}if(n==="both"){const w=kp(p/l);t.key===(s?yp:vp)&&(g&&bp(t),p%l!==l-1?(v=Pa(e,{startingIndex:p,disabledIndices:u}),a&&wu(v,l,w)&&(v=Pa(e,{startingIndex:p-p%l-1,disabledIndices:u}),i&&(v=i(t,p,v)))):a&&(v=Pa(e,{startingIndex:p-p%l-1,disabledIndices:u}),i&&(v=i(t,p,v))),wu(v,l,w)&&(v=p)),t.key===(s?vp:yp)&&(g&&bp(t),p%l!==0?(v=Pa(e,{startingIndex:p,decrement:!0,disabledIndices:u}),a&&wu(v,l,w)&&(v=Pa(e,{startingIndex:p+(l-p%l),decrement:!0,disabledIndices:u}),i&&(v=i(t,p,v)))):a&&(v=Pa(e,{startingIndex:p+(l-p%l),decrement:!0,disabledIndices:u}),i&&(v=i(t,p,v))),wu(v,l,w)&&(v=p));const S=kp(f/l)===w;F0(e,v)&&(a&&S?(v=t.key===(s?vp:yp)?f:Pa(e,{startingIndex:p-p%l-1,disabledIndices:u}),i&&(v=i(t,p,v))):v=p)}return v}function kF(e,t,n){const a=[];let i=0;return e.forEach(({width:s,height:l},u)=>{let h=!1;for(;!h;){const f=[];for(let p=0;p<s;p+=1)for(let g=0;g<l;g+=1)f.push(i+p+g*t);i%t+s<=t&&f.every(p=>a[p]==null)?(f.forEach(p=>{a[p]=u}),h=!0):i+=1}}),[...a]}function _F(e,t,n,a,i){if(e===-1)return-1;const s=n.indexOf(e),l=t[e];switch(i){case"tl":return s;case"tr":return l?s+l.width-1:s;case"bl":return l?s+(l.height-1)*a:s;case"br":return n.lastIndexOf(e);default:return-1}}function wF(e,t){return t.flatMap((n,a)=>e.includes(n)?[a]:[])}function Tm(e,t,n){if(typeof n=="function"?n(t):n?.includes(t)??!1)return!0;const i=e[t];return i?DS(i)?!n&&(i.hasAttribute("disabled")||i.getAttribute("aria-disabled")==="true"):!0:!1}function BU(e){return e.visibility==="hidden"||e.visibility==="collapse"}function DS(e,t=e?Wd(e):null){return!e||!e.isConnected||!t||BU(t)?!1:typeof e.checkVisibility=="function"?e.checkVisibility():t.display!=="none"&&t.display!=="contents"}const FU='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function zU(e){const t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;const n=e.getRootNode();return Pd(n)?n.host:null}function Em(e){for(const t of Array.from(e.children))if(Aa(t)==="summary")return t;return null}function VU(e,t){const n=Em(t);return!!n&&(e===n||Pr(n,e))}function MS(e){const t=e?Aa(e):"";return e!=null&&e.matches(FU)&&(t!=="summary"||e.parentElement!=null&&Aa(e.parentElement)==="details"&&Em(e.parentElement)===e)&&(t!=="details"||Em(e)==null)&&(t!=="input"||e.type!=="hidden")}function IS(e){if(!MS(e)||!e.isConnected||e.matches(":disabled"))return!1;for(let t=e;t;t=zU(t)){const n=t!==e,a=Aa(t)==="slot";if(t.hasAttribute("inert")||n&&Aa(t)==="details"&&!t.open&&!VU(e,t)||t.hasAttribute("hidden")||!a&&!$U(t,n))return!1}return!0}function $U(e,t){const n=Wd(e);return t?n.display!=="none":DS(e,n)}function NS(e){const t=e.tabIndex;if(t<0){const n=Aa(e);if(n==="details"||n==="audio"||n==="video"||ci(e)&&e.isContentEditable)return 0}return t}function _p(e){if(Aa(e)!=="input")return null;const t=e;return t.type==="radio"&&t.name!==""?t:null}function HU(e,t){const n=_p(e);if(!n)return!0;const a=t.find(i=>{const s=_p(i);return s?.name===n.name&&s.form===n.form&&s.checked});return a?a===n:t.find(i=>{const s=_p(i);return s?.name===n.name&&s.form===n.form})===n}function OS(e){if(ci(e)&&Aa(e)==="slot"){const t=e.assignedElements({flatten:!0});if(t.length>0)return t}return ci(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function jS(e,t){OS(e).forEach(n=>{MS(n)&&t.push(n),jS(n,t)})}function US(e,t,n){OS(e).forEach(a=>{ci(a)&&a.matches(t)&&n.push(a),US(a,t,n)})}function xF(e){return IS(e)&&NS(e)>=0}function WU(e){const t=[];return jS(e,t),t.filter(IS)}function ay(e){const t=WU(e);return t.filter(n=>NS(n)>=0&&HU(n,t))}function BS(e,t){const n=ay(e),a=n.length;if(a===0)return;const i=Zo(Ta(e)),s=n.indexOf(i),l=s===-1?t===1?0:a-1:s+t;return n[l]}function GU(e){return BS(Ta(e).body,1)||e}function KU(e){return BS(Ta(e).body,-1)||e}function FS(e,t){if(!e)return null;const n=ay(Ta(e).body),a=n.length;if(a===0)return null;const i=n.indexOf(e);if(i===-1)return null;const s=(i+t+a)%a;return n[s]}function PF(e){return FS(e,1)}function SF(e){return FS(e,-1)}function wp(e,t){const n=t||e.currentTarget,a=e.relatedTarget;return!a||!Pr(n,a)}function qU(e){ay(e).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function z0(e){const t=[];US(e,"[data-tabindex]",t),t.forEach(n=>{const a=n.dataset.tabindex;delete n.dataset.tabindex,a?n.setAttribute("tabindex",a):n.removeAttribute("tabindex")})}function xp(e){const t=new Map;let n=0,a=0;return e.forEach((i,s)=>{const l=i.transitionStatus==="ending";t.set(i.id,{value:i,domIndex:s,visibleIndex:l?-1:n,offsetY:a}),a+=i.height||0,l||(n+=1)}),t}const xu=e=>e.toastMetadata,za={toasts:_a(e=>e.toasts),isEmpty:_a(e=>e.toasts.length===0),toast:_a(xu,(e,t)=>e.get(t)?.value),toastIndex:_a(xu,(e,t)=>e.get(t)?.domIndex??-1),toastOffsetY:_a(xu,(e,t)=>e.get(t)?.offsetY??0),toastVisibleIndex:_a(xu,(e,t)=>e.get(t)?.visibleIndex??-1),hovering:_a(e=>e.hovering),focused:_a(e=>e.focused),expanded:_a(e=>e.hovering||e.focused),expandedOrOutOfFocus:_a(e=>e.hovering||e.focused||!e.isWindowFocused),prevFocusElement:_a(e=>e.prevFocusElement)};class YU extends uU{timers=new Map;areTimersPaused=!1;constructor(t){super({...t,toastMetadata:xp(t.toasts)},{},za)}setFocused(t){this.set("focused",t)}setHovering(t){this.set("hovering",t)}setIsWindowFocused(t){this.set("isWindowFocused",t)}setPrevFocusElement(t){this.set("prevFocusElement",t)}setViewport=t=>{this.set("viewport",t)};disposeEffect=()=>()=>{this.timers.forEach(t=>{t.timeout?.clear()}),this.timers.clear()};removeToast(t,n={}){const a=za.toastIndex(this.state,t);if(a===-1)return;const i=this.state.toasts[a];n.skipOnRemove||i?.onRemove?.();const s=[...this.state.toasts];s.splice(a,1),this.setToasts(s)}addToast=t=>{const{timeout:n,limit:a}=this.state,i=t.id||SS("toast");if(t.id){const f=za.toast(this.state,t.id);if(f)if(f.transitionStatus==="ending")this.removeToast(t.id,{skipOnRemove:!0});else{const{id:p,transitionStatus:g,...v}=t;return this.updateToastInternal(t.id,v,{resetTimer:!0,markUpdated:!0}),t.id}}const s={...t,id:i,updateKey:0,transitionStatus:"starting"},l=[s,...this.state.toasts],u=l.filter(f=>f.transitionStatus!=="ending");if(u.length>a){const f=u.length-a,p=u.slice(-f),g=new Set(p.map(v=>v.id));this.setToasts(l.map(v=>{const _=g.has(v.id);return v.limited!==_?{...v,limited:_}:v}))}else this.setToasts(l.map(f=>f.limited?{...f,limited:!1}:f));const h=s.timeout??n;return s.type!=="loading"&&h>0&&this.scheduleTimer(i,h,()=>this.closeToast(i)),za.expandedOrOutOfFocus(this.state)&&this.pauseTimers(),i};updateToast=(t,n)=>{this.updateToastInternal(t,n,{markUpdated:!0})};updateToastInternal=(t,n,a={})=>{const{timeout:i,toasts:s}=this.state,l=za.toast(this.state,t)??null;if(!l||l.transitionStatus==="ending")return;const u={...l,...n,...a.markUpdated&&{updateKey:(l.updateKey??0)+1}};this.setToasts(s.map(S=>S.id===t?u:S));const h=u.timeout??i,f=l?.timeout??i,p=Object.hasOwn(n,"timeout"),g=u.transitionStatus!=="ending"&&u.type!=="loading"&&h>0,v=this.timers.has(t),_=f!==h,w=l?.type==="loading";if(!g&&v){this.timers.get(t)?.timeout?.clear(),this.timers.delete(t);return}if(g&&(!v||_||p||w||a.resetTimer)){const S=this.timers.get(t);S&&(S.timeout?.clear(),this.timers.delete(t)),this.scheduleTimer(t,h,()=>this.closeToast(t)),za.expandedOrOutOfFocus(this.state)&&this.pauseTimers()}};closeToast=t=>{const n=t===void 0,{limit:a,toasts:i}=this.state;let s;if(n)s=i,this.timers.forEach(f=>{f.timeout?.clear()}),this.timers.clear();else{const f=za.toast(this.state,t);if(!f)return;s=[f];const p=this.timers.get(t);p?.timeout&&(p.timeout.clear(),this.timers.delete(t))}let l=0;const u=i.map(f=>{if(n||f.id===t)return{...f,transitionStatus:"ending",height:0};if(f.transitionStatus==="ending")return f;const p=l>=a;return l+=1,f.limited!==p?{...f,limited:p}:f}),h={toasts:u,toastMetadata:xp(u)};(n||i.length===1)&&(h.hovering=!1,h.focused=!1),this.update(h),s.forEach(f=>{f.transitionStatus!=="ending"&&f.onClose?.()}),this.handleFocusManagement(t)};promiseToast=(t,n)=>{const a=mp(n.loading),i=this.addToast({...a,type:"loading"}),s=t.then(l=>{const u=mp(n.success,l);return this.updateToast(i,{...u,type:"success",timeout:u.timeout}),l}).catch(l=>{const u=mp(n.error,l);return this.updateToast(i,{...u,type:"error",timeout:u.timeout}),Promise.reject(l)});return{}.hasOwnProperty.call(n,"setPromise")&&n.setPromise(s),s};pauseTimers(){this.areTimersPaused||(this.areTimersPaused=!0,this.timers.forEach(t=>{if(t.timeout){t.timeout.clear();const n=Date.now()-t.start,a=t.delay-n;t.remaining=a>0?a:0}}))}resumeTimers(){this.areTimersPaused&&(this.areTimersPaused=!1,this.timers.forEach((t,n)=>{t.remaining=t.remaining>0?t.remaining:t.delay,t.timeout??=Ul.create(),t.timeout.start(t.remaining,()=>{this.timers.delete(n),t.callback()}),t.start=Date.now()}))}restoreFocusToPrevElement(){this.state.prevFocusElement?.focus({preventScroll:!0})}handleDocumentPointerDown=t=>{if(t.pointerType!=="touch")return;const n=Vi(t);Pr(this.state.viewport,n)||(this.resumeTimers(),this.update({hovering:!1,focused:!1}))};scheduleTimer(t,n,a){const i=Date.now(),s=!za.expandedOrOutOfFocus(this.state),l=s?Ul.create():void 0;l?.start(n,()=>{this.timers.delete(t),a()}),this.timers.set(t,{timeout:l,start:s?i:0,delay:n,remaining:n,callback:a})}setToasts(t){const n={toasts:t,toastMetadata:xp(t)};t.length===0&&(n.hovering=!1,n.focused=!1),this.update(n)}handleFocusManagement(t){const n=Zo(Ta(this.state.viewport));if(!this.state.viewport||!Pr(this.state.viewport,n)||!Pm(n))return;if(t===void 0){this.restoreFocusToPrevElement();return}const a=za.toasts(this.state),i=za.toastIndex(this.state,t);let s=null,l=i+1;for(;l<a.length;){if(a[l].transitionStatus!=="ending"){s=a[l];break}l+=1}if(!s)for(l=i-1;l>=0;){if(a[l].transitionStatus!=="ending"){s=a[l];break}l-=1}s?s.ref?.current?.focus():this.restoreFocusToPrevElement()}}const ZU=function(t){const{children:n,timeout:a=5e3,limit:i=3,toastManager:s}=t,l=ys(()=>new YU({timeout:a,limit:i,viewport:null,toasts:[],hovering:!1,focused:!1,isWindowFocused:!0,prevFocusElement:null})).current;return Yg(l.disposeEffect),b.useEffect(function(){return s?s[" subscribe"](({action:f,options:p})=>{const g=p.id;f==="promise"&&p.promise?l.promiseToast(p.promise,p):f==="update"&&g?l.updateToast(g,p):f==="close"?l.closeToast(g):l.addToast(p)}):void 0},[l,s]),l.useSyncedValues({timeout:a,limit:i}),T.jsx(Zg.Provider,{value:l,children:n})},zS={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},VS={...zS,position:"fixed",top:0,left:0},CF={...zS,position:"absolute"},Tl=b.forwardRef(function(t,n){const[a,i]=b.useState();Ka(()=>{_U&&i("button")},[]);const s={tabIndex:0,role:a};return T.jsx("span",{...t,ref:n,style:VS,"aria-hidden":a?void 0:!0,...s,"data-base-ui-focus-guard":""})});function V0(e,t,n,a){const i=ys($S).current;return QU(i,e,t,n,a)&&HS(i,[e,t,n,a]),i.callback}function XU(e){const t=ys($S).current;return JU(t,e)&&HS(t,e),t.callback}function $S(){return{callback:null,cleanup:null,refs:[]}}function QU(e,t,n,a,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==a||e.refs[3]!==i}function JU(e,t){return e.refs.length!==t.length||e.refs.some((n,a)=>n!==t[a])}function HS(e,t){if(e.refs=t,t.every(n=>n==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){const a=Array(t.length).fill(null);for(let i=0;i<t.length;i+=1){const s=t[i];if(s!=null)switch(typeof s){case"function":{const l=s(n);typeof l=="function"&&(a[i]=l);break}case"object":{s.current=n;break}}}e.cleanup=()=>{for(let i=0;i<t.length;i+=1){const s=t[i];if(s!=null)switch(typeof s){case"function":{const l=a[i];typeof l=="function"?l():s(null);break}case"object":{s.current=null;break}}}}}}}function $0(e){if(!b.isValidElement(e))return null;const t=e,n=t.props;return(Qg(19)?n?.ref:t.ref)??null}function Am(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function e9(e,t){const n={};for(const a in e){const i=e[a];if(t?.hasOwnProperty(a)){const s=t[a](i);s!=null&&Object.assign(n,s);continue}i===!0?n[`data-${a.toLowerCase()}`]="":i&&(n[`data-${a.toLowerCase()}`]=i.toString())}return n}function t9(e,t){return typeof e=="function"?e(t):e}function n9(e,t){return typeof e=="function"?e(t):e}const ry={};function iy(e,t,n,a,i){if(!n&&!a&&!i&&!e)return Sd(t);let s=Sd(e);return t&&(s=gl(s,t)),n&&(s=gl(s,n)),a&&(s=gl(s,a)),i&&(s=gl(s,i)),s}function a9(e){if(e.length===0)return ry;if(e.length===1)return Sd(e[0]);let t=Sd(e[0]);for(let n=1;n<e.length;n+=1)t=gl(t,e[n]);return t}function Sd(e){return oy(e)?{...GS(e,ry)}:r9(e)}function gl(e,t){return oy(t)?GS(t,e):i9(e,t)}function r9(e){const t={...e};for(const n in t){const a=t[n];WS(n,a)&&(t[n]=KS(a))}return t}function i9(e,t){if(!t)return e;for(const n in t){const a=t[n];switch(n){case"style":{e[n]=Am(e.style,a);break}case"className":{e[n]=qS(e.className,a);break}default:WS(n,a)?e[n]=o9(e[n],a):e[n]=a}}return e}function WS(e,t){const n=e.charCodeAt(0),a=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&a===110&&i>=65&&i<=90&&(typeof t=="function"||typeof t>"u")}function oy(e){return typeof e=="function"}function GS(e,t){return oy(e)?e(t):e??ry}function o9(e,t){return t?e?(...n)=>{const a=n[0];if(YS(a)){const s=a;Cd(s);const l=t(...n);return s.baseUIHandlerPrevented||e?.(...n),l}const i=t(...n);return e?.(...n),i}:KS(t):e}function KS(e){return e&&((...t)=>{const n=t[0];return YS(n)&&Cd(n),e(...t)})}function Cd(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function qS(e,t){return t?e?t+" "+e:t:e}function YS(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function Jl(e,t,n={}){const a=t.render,i=s9(t,n);if(n.enabled===!1)return null;const s=n.state??Fi;return u9(e,a,i,s)}function s9(e,t={}){const{className:n,style:a,render:i}=e,{state:s=Fi,ref:l,props:u,stateAttributesMapping:h,enabled:f=!0}=t,p=f?t9(n,s):void 0,g=f?n9(a,s):void 0,v=f?e9(s,h):Fi,_=f&&u?l9(u):void 0,w=f?Am(v,_)??{}:Fi;return typeof document<"u"&&(f?Array.isArray(l)?w.ref=XU([w.ref,$0(i),...l]):w.ref=V0(w.ref,$0(i),l):V0(null,null)),f?(p!==void 0&&(w.className=qS(w.className,p)),g!==void 0&&(w.style=Am(w.style,g)),w):Fi}function l9(e){return Array.isArray(e)?a9(e):iy(void 0,e)}const c9=Symbol.for("react.lazy");function u9(e,t,n,a){if(t){if(typeof t=="function")return t(n,a);const i=iy(n,t.props);i.ref=n.ref;let s=t;return s?.$$typeof===c9&&(s=b.Children.toArray(t)[0]),b.cloneElement(s,i)}if(e&&typeof e=="string")return d9(e,n);throw new Error(vs(8))}function d9(e,t){return e==="button"?b.createElement("button",{type:"button",...t,key:t.key}):e==="img"?b.createElement("img",{alt:"",...t,key:t.key}):b.createElement(e,t)}let h9=(function(e){return e.frontmostHeight="--toast-frontmost-height",e})({});const f9=b.forwardRef(function(t,n){const{render:a,className:i,style:s,children:l,...u}=t,h=Xg(),f=kU(),p=b.useRef(!1),g=b.useRef(!1),v=b.useRef(!1),_=h.useState("isEmpty"),w=h.useState("toasts"),S=h.useState("focused"),P=h.useState("expanded"),D=h.useState("prevFocusElement"),R=w[0]?.height??0,E=b.useMemo(()=>w.some(X=>X.transitionStatus==="ending"),[w]),A=b.useMemo(()=>w.filter(X=>X.priority==="high"),[w]);b.useEffect(()=>{const X=h.state.viewport;if(!X)return;function Z(V){_||V.key==="F6"&&Vi(V)!==X&&(V.preventDefault(),h.setPrevFocusElement(Zo(Ta(X))),X?.focus({preventScroll:!0}),h.pauseTimers(),h.setFocused(!0))}const Q=xr(X);return zi(Q,"keydown",Z)},[h,_]),b.useEffect(()=>{const X=h.state.viewport;if(!X||_)return;const Z=xr(X);function Q(I){Vi(I)===Z&&(h.setIsWindowFocused(!1),h.pauseTimers())}function V(I){if(I.relatedTarget)return;const G=Vi(I),ye=Zo(Ta(X));(G===Z||!Pr(X,G)||!Pm(ye))&&h.resumeTimers(),f.start(0,()=>h.setIsWindowFocused(!0))}return PS(zi(Z,"blur",Q,!0),zi(Z,"focus",V,!0))},[h,f,_]),b.useEffect(()=>{const X=h.state.viewport;if(!X||_)return;const Z=Ta(X);return zi(Z,"pointerdown",h.handleDocumentPointerDown,!0)},[_,h]);function U(X){const Z=h.state.viewport;Z&&(p.current=!0,X.relatedTarget===Z?w[0]?.ref?.current?.focus():h.restoreFocusToPrevElement())}function z(X){X.key==="Tab"&&X.shiftKey&&Vi(X.nativeEvent)===h.state.viewport&&(X.preventDefault(),h.restoreFocusToPrevElement(),h.resumeTimers())}function j(){const X=h.state.toasts.some(Z=>Z.transitionStatus==="ending");!h.state.isWindowFocused||X||v.current||!g.current||(h.resumeTimers(),h.setHovering(!1),g.current=!1)}b.useEffect(j,[E,h]);function C(){h.pauseTimers(),h.setHovering(!0),g.current=!1}function K(){E||v.current?g.current=!0:(h.resumeTimers(),h.setHovering(!1))}function Y(X){X.pointerType==="touch"&&(v.current=!0)}function ce(X){X.pointerType==="touch"&&(v.current=!1,j())}function re(){if(p.current){p.current=!1;return}S||Pm(Zo(Ta(h.state.viewport)))&&(h.setFocused(!0),h.pauseTimers())}function fe(X){!S||Pr(h.state.viewport,X.relatedTarget)||(h.setFocused(!1),h.resumeTimers())}const de={tabIndex:-1,role:"region","aria-live":"polite","aria-atomic":!1,"aria-relevant":"additions text","aria-label":"Notifications",onMouseEnter:C,onMouseMove:C,onMouseLeave:K,onFocus:re,onBlur:fe,onKeyDown:z,onClick:re,onPointerDown:Y,onPointerUp:ce,onPointerCancel:ce},he={expanded:P},oe=Jl("div",t,{ref:[n,h.setViewport],state:he,props:[de,{style:{[h9.frontmostHeight]:R?`${R}px`:void 0}},u,{children:T.jsxs(b.Fragment,{children:[!_&&D&&T.jsx(Tl,{onFocus:U}),l,!_&&D&&T.jsx(Tl,{onFocus:U})]})}]});return T.jsxs(b.Fragment,{children:[!_&&D&&T.jsx(Tl,{onFocus:U}),oe,!S&&A.length>0&&T.jsx("div",{style:VS,children:A.map(X=>T.jsxs("div",{role:"alert","aria-atomic":!0,children:[T.jsx("div",{children:X.title}),T.jsx("div",{children:X.description})]},X.id))})]})});function p9(e){return Qg(19)?e:e?"true":void 0}const ZS=b.createContext(void 0);function XS(){const e=b.useContext(ZS);if(!e)throw new Error(vs(66));return e}let sy=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const m9={[sy.startingStyle]:""},g9={[sy.endingStyle]:""},y9={transitionStatus(e){return e==="starting"?m9:e==="ending"?g9:null}};function v9(e){return e==null?e:"current"in e?e.current:e}function b9(e,t=!1,n=!0){const a=bU();return Xi((i,s=null)=>{a.cancel();const l=v9(e);if(l==null)return;const u=l,h=()=>{ls.flushSync(i)};if(typeof u.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function f(){Promise.all(u.getAnimations().map(p=>p.finished)).then(()=>{s?.aborted||h()}).catch(()=>{if(n){s?.aborted||h();return}const p=u.getAnimations();!s?.aborted&&p.length>0&&p.some(g=>g.pending||g.playState!=="finished")&&f()})}if(t){const p=sy.startingStyle;if(!u.hasAttribute(p)){a.request(f);return}const g=new MutationObserver(()=>{u.hasAttribute(p)||(g.disconnect(),f())});g.observe(u,{attributes:!0,attributeFilter:[p]}),s?.addEventListener("abort",()=>g.disconnect(),{once:!0});return}a.request(f)})}function k9(e){const{enabled:t=!0,open:n,ref:a,onComplete:i}=e,s=Xi(i),l=b9(a,n,!1);b.useEffect(()=>{if(!t)return;const u=new AbortController;return l(s,u.signal),()=>{u.abort()}},[t,n,s,l])}let Mi=(function(e){return e.index="--toast-index",e.offsetY="--toast-offset-y",e.height="--toast-height",e.swipeMovementX="--toast-swipe-movement-x",e.swipeMovementY="--toast-swipe-movement-y",e})({});const TF=500,EF={style:{transition:"none"}},AF="data-base-ui-click-trigger",_9="data-base-ui-swipe-ignore",w9="data-swipe-ignore",x9=`[${_9}]`,P9=`[${w9}]`,RF={fallbackAxisSide:"none"},LF={fallbackAxisSide:"end"},S9={clipPath:"inset(50%)",position:"fixed",top:0,left:0};function H0(e,t,n){switch(e){case"up":return-n;case"down":return n;case"left":return-t;case"right":return t;default:return 0}}function C9(e){const n=xr(e).getComputedStyle(e).transform;let a=0,i=0,s=1;if(n&&n!=="none"){const l=n.match(/matrix(?:3d)?\(([^)]+)\)/);if(l){const u=l[1].split(", ").map(parseFloat);u.length===6?(a=u[4],i=u[5],s=Math.sqrt(u[0]*u[0]+u[1]*u[1])):u.length===16&&(a=u[12],i=u[13],s=u[0])}}return{x:a,y:i,scale:s}}const T9={...y9,swipeDirection(e){return e?{"data-swipe-direction":e}:null}},ul=40,E9=10,Qr=.5,A9=1,R9=`${x9},${P9}`,L9=b.forwardRef(function(t,n){const{toast:a,render:i,className:s,swipeDirection:l=["down","right"],style:u,...h}=t,f=a.positionerProps?.anchor!==void 0;let p=[];f||(p=Array.isArray(l)?l:[l]);const g=p.length>0,v=Xg(),[_,w]=b.useState(void 0),[S,P]=b.useState(!1),[D,R]=b.useState(!1),[E,A]=b.useState(!1),[U,z]=b.useState({x:0,y:0}),[j,C]=b.useState({x:0,y:0,scale:1}),[K,Y]=b.useState(),[ce,re]=b.useState(),[fe,de]=b.useState(null),he=b.useRef(null),oe=b.useRef({x:0,y:0}),X=b.useRef({x:0,y:0,scale:1}),Z=b.useRef(void 0),Q=b.useRef(0),V=b.useRef(!1),I=b.useRef({x:0,y:0}),G=b.useRef(!1),ye=b.useRef({x:0,y:0}),me=b.useRef(null),pe=b.useRef(null),ke=v.useState("toastIndex",a.id),We=v.useState("toastVisibleIndex",a.id),Xe=v.useState("toastOffsetY",a.id),Ue=v.useState("focused"),Dt=v.useState("expanded");k9({open:a.transitionStatus!=="ending",ref:he,onComplete(){a.transitionStatus==="ending"&&v.removeToast(a.id)}});const rn=Xi((Ge=!1)=>{const He=he.current;if(!He)return;const ct=He.style.height;He.style.height="auto";const At=He.offsetHeight;He.style.height=ct;function bt(){v.updateToastInternal(a.id,{ref:he,height:At,...a.transitionStatus==="starting"?{transitionStatus:void 0}:{}})}Ge?ls.flushSync(bt):bt()});Ka(rn,[rn]);function Pn(Ge){ye.current=Ge,z(Ge)}Ka(()=>()=>{pe.current?.abort()},[]);function gt(Ge,He){let ct=Ge,At=He;return!p.includes("left")&&!p.includes("right")?ct=Ge>0?Ge**Qr:-(Math.abs(Ge)**Qr):(!p.includes("right")&&Ge>0&&(ct=Ge**Qr),!p.includes("left")&&Ge<0&&(ct=-(Math.abs(Ge)**Qr))),!p.includes("up")&&!p.includes("down")?At=He>0?He**Qr:-(Math.abs(He)**Qr):(!p.includes("down")&&He>0&&(At=He**Qr),!p.includes("up")&&He<0&&(At=-(Math.abs(He)**Qr))),{x:ct,y:At}}const Ut=Xi(Ge=>{if(Ge.pointerId!==me.current)return;me.current=null,pe.current?.abort(),pe.current=null,P(!1),R(!1),de(null);const He=X.current;if(Ge.type==="pointercancel"||V.current){Pn({x:He.x,y:He.y}),w(void 0);return}let ct=!1;const At=ye.current,bt=At.x-He.x,mt=At.y-He.y;let dt;for(const ua of p){switch(ua){case"right":bt>ul&&(ct=!0,dt="right");break;case"left":bt<-ul&&(ct=!0,dt="left");break;case"down":mt>ul&&(ct=!0,dt="down");break;case"up":mt<-ul&&(ct=!0,dt="up");break}if(ct)break}ct?(w(dt),A(!0),v.closeToast(a.id)):(Pn({x:He.x,y:He.y}),w(void 0))});function fi(Ge){if(Ge.button!==0)return;Ge.pointerType==="touch"&&v.pauseTimers();const He=Vi(Ge.nativeEvent);if(He?He.closest(`button,a,input,textarea,[role="button"],${R9}`):!1)return;if(V.current=!1,Z.current=void 0,Q.current=0,me.current=Ge.pointerId,oe.current={x:Ge.clientX,y:Ge.clientY},I.current=oe.current,he.current){const bt=C9(he.current);X.current=bt,C(bt),Pn({x:bt.x,y:bt.y})}v.setHovering(!0),P(!0),R(!1),de(null),G.current=!0;const At=he.current;if(At){pe.current?.abort();const bt=new AbortController;pe.current=bt;const mt=Ta(At);mt.addEventListener("pointerup",Ut,{signal:bt.signal}),mt.addEventListener("pointercancel",Ut,{signal:bt.signal}),At.setPointerCapture?.(Ge.pointerId)}}function ao(Ge){if(Ge.pointerId!==me.current)return;Ge.preventDefault(),G.current&&(oe.current={x:Ge.clientX,y:Ge.clientY},G.current=!1);const{clientY:He,clientX:ct,movementX:At,movementY:bt}=Ge;(bt<0&&He>I.current.y||bt>0&&He<I.current.y)&&(I.current={x:I.current.x,y:He}),(At<0&&ct>I.current.x||At>0&&ct<I.current.x)&&(I.current={x:ct,y:I.current.y});const mt=ct-oe.current.x,dt=He-oe.current.y,ua=He-I.current.y,ks=ct-I.current.x;if(!D&&Math.sqrt(mt*mt+dt*dt)>=A9&&(R(!0),fe===null)){const da=p.includes("left")||p.includes("right"),mi=p.includes("up")||p.includes("down");if(da&&mi){const Cr=Math.abs(mt),jn=Math.abs(dt);de(Cr>jn?"horizontal":"vertical")}}let qt;if(!Z.current)fe==="vertical"?dt>0?qt="down":dt<0&&(qt="up"):fe==="horizontal"?mt>0?qt="right":mt<0&&(qt="left"):Math.abs(mt)>=Math.abs(dt)?qt=mt>0?"right":"left":qt=dt>0?"down":"up",qt&&p.includes(qt)&&(Z.current=qt,Q.current=H0(qt,mt,dt),w(qt));else{const Ma=Z.current,da=H0(Ma,ks,ua);da>ul?(V.current=!1,w(Ma)):!(p.includes("left")&&p.includes("right"))&&!(p.includes("up")&&p.includes("down"))&&Q.current-da>=E9&&(V.current=!0)}const or=gt(mt,dt);let mn=X.current.x,Da=X.current.y;fe==="horizontal"?(p.includes("left")||p.includes("right"))&&(mn+=or.x):(fe==="vertical"||(p.includes("left")||p.includes("right"))&&(mn+=or.x),(p.includes("up")||p.includes("down"))&&(Da+=or.y)),Pn({x:mn,y:Da})}function Nn(Ge){if(Ge.key==="Escape"){if(!he.current||!Pr(he.current,Zo(Ta(he.current))))return;v.closeToast(a.id)}}b.useEffect(()=>{if(!g)return;const Ge=he.current;if(!Ge)return;function He(ct){Pr(Ge,Vi(ct))&&ct.preventDefault()}return zi(Ge,"touchmove",He,{passive:!1})},[g]);function ro(){if(!S&&U.x===j.x&&U.y===j.y&&!E)return{[Mi.swipeMovementX]:"0px",[Mi.swipeMovementY]:"0px"};const Ge=U.x-j.x,He=U.y-j.y;return{transition:S?"none":void 0,transform:S?`translateX(${U.x}px) translateY(${U.y}px) scale(${j.scale})`:void 0,[Mi.swipeMovementX]:`${Ge}px`,[Mi.swipeMovementY]:`${He}px`}}const Sr=a.priority==="high",La={role:Sr?"alertdialog":"dialog",tabIndex:0,"aria-modal":!1,"aria-labelledby":K,"aria-describedby":ce,"aria-hidden":Sr&&!Ue?!0:void 0,onPointerDown:g?fi:void 0,onPointerMove:g?ao:void 0,onPointerUp:g?Ut:void 0,onPointerCancel:g?Ut:void 0,onKeyDown:Nn,inert:p9(a.limited),style:{...ro(),[Mi.index]:a.transitionStatus==="ending"?ke:We,[Mi.offsetY]:`${Xe}px`,[Mi.height]:a.height?`${a.height}px`:void 0}},On=b.useMemo(()=>({rootRef:he,toast:a,titleId:K,setTitleId:Y,descriptionId:ce,setDescriptionId:re,swiping:S,swipeDirection:_,recalculateHeight:rn,index:ke,visibleIndex:We,expanded:Dt}),[a,K,ce,S,_,rn,ke,We,Dt]),pi={transitionStatus:a.transitionStatus,expanded:Dt,limited:a.limited||!1,type:a.type,swiping:On.swiping,swipeDirection:On.swipeDirection},io=Jl("div",t,{ref:[n,On.rootRef],state:pi,stateAttributesMapping:T9,props:[La,h]});return T.jsx(ZS.Provider,{value:On,children:io})});let W0=0;function D9(e,t="mui"){const[n,a]=b.useState(e),i=e||n;return b.useEffect(()=>{n==null&&(W0+=1,a(`${t}-${W0}`))},[n,t]),i}const G0=Jg.useId;function QS(e,t){if(G0!==void 0){const n=G0();return e??(t?`${t}-${n}`:n)}return D9(e,t)}const M9=b.forwardRef(function(t,n){const{render:a,className:i,style:s,id:l,children:u,...h}=t,{toast:f,setTitleId:p}=XS(),g=u??f.title,v=!!g,_=QS(l);Ka(()=>{if(v)return p(_),()=>{p(void 0)}},[v,_,p]);const w={type:f.type},S=Jl("h2",t,{ref:n,state:w,props:{...h,id:_,children:g}});return v?S:null}),I9=b.createContext(void 0);function N9(e=!1){const t=b.useContext(I9);if(t===void 0&&!e)throw new Error(vs(16));return t}function O9(e){const{focusableWhenDisabled:t,disabled:n,composite:a=!1,tabIndex:i=0,isNativeButton:s}=e,l=a&&t!==!1,u=a&&t===!1;return{props:b.useMemo(()=>{const f={onKeyDown(p){n&&t&&p.key!=="Tab"&&p.preventDefault()}};return a||(f.tabIndex=i,!s&&n&&(f.tabIndex=t?i:-1)),(s&&(t||l)||!s&&n)&&(f["aria-disabled"]=n),s&&(!t||u)&&(f.disabled=n),f},[a,n,t,l,u,s,i])}}function j9(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:a=0,native:i=!0,composite:s}=e,l=b.useRef(null),u=N9(!0),h=s??u!==void 0,{props:f}=O9({focusableWhenDisabled:n,disabled:t,composite:h,tabIndex:a,isNativeButton:i}),p=b.useCallback(()=>{const _=l.current;Pp(_)&&h&&t&&f.disabled===void 0&&_.disabled&&(_.disabled=!1)},[t,f.disabled,h]);Ka(p,[p]);const g=b.useCallback((_={})=>{const{onClick:w,onMouseDown:S,onKeyUp:P,onKeyDown:D,onPointerDown:R,...E}=_;return iy({onClick(A){if(t){A.preventDefault();return}w?.(A)},onMouseDown(A){t||S?.(A)},onKeyDown(A){if(t||(Cd(A),D?.(A),A.baseUIHandlerPrevented))return;const U=A.target===A.currentTarget,z=A.currentTarget,j=Pp(z),C=!i&&U9(z),K=U&&(i?j:!C),Y=A.key==="Enter",ce=A.key===" ",re=z.getAttribute("role"),fe=re?.startsWith("menuitem")||re==="option"||re==="gridcell";if(U&&h&&ce){if(A.defaultPrevented&&fe)return;A.preventDefault(),C||i&&j?(z.click(),A.preventBaseUIHandler()):K&&(w?.(A),A.preventBaseUIHandler());return}K&&(!i&&(ce||Y)&&A.preventDefault(),!i&&Y&&w?.(A))},onKeyUp(A){if(!t){if(Cd(A),P?.(A),A.target===A.currentTarget&&i&&h&&Pp(A.currentTarget)&&A.key===" "){A.preventDefault();return}A.baseUIHandlerPrevented||A.target===A.currentTarget&&!i&&!h&&A.key===" "&&w?.(A)}},onPointerDown(A){if(t){A.preventDefault();return}R?.(A)}},i?{type:"button"}:{role:"button"},f,E)},[t,f,h,i]),v=Xi(_=>{l.current=_,p()});return{getButtonProps:g,buttonRef:v}}function Pp(e){return ci(e)&&e.tagName==="BUTTON"}function U9(e){return!!(e?.tagName==="A"&&e?.href)}const B9=b.forwardRef(function(t,n){const{render:a,className:i,style:s,disabled:l,nativeButton:u=!0,...h}=t,f=Xg(),{toast:p}=XS(),g=f.useState("expanded"),[v,_]=b.useState(!1),{getButtonProps:w,buttonRef:S}=j9({disabled:l,native:u}),P={type:p.type};return Jl("button",t,{ref:[n,S],state:P,props:[{"aria-hidden":!g&&!v,onClick(){f.closeToast(p.id)},onFocus(){_(!0)},onBlur(){_(!1)}},h,w]})}),DF="none",MF="trigger-press",IF="trigger-hover",NF="outside-press",OF="item-press",jF="close-press",F9="focus-out",UF="escape-key",BF="list-navigation",FF="cancel-open",zF="imperative-action",VF="window-resize";function z9(e,t,n,a){let i=!1,s=!1;const l=Fi;return{reason:e,event:t??new Event("base-ui"),cancel(){i=!0},allowPropagation(){s=!0},get isCanceled(){return i},get isPropagationAllowed(){return s},trigger:n,...l}}function V9(e){return`data-base-ui-${e}`}const JS=b.createContext(null),$9=()=>b.useContext(JS),H9=V9("portal");function eC(e={}){const{ref:t,container:n,componentProps:a=Fi,elementProps:i}=e,s=QS(),u=$9()?.portalNode,[h,f]=b.useState(null),[p,g]=b.useState(null),v=Xi(P=>{P!==null&&g(P)}),_=b.useRef(null);Ka(()=>{if(n===null){_.current&&(_.current=null,g(null),f(null));return}if(s==null)return;const P=(n&&(ey(n)?n:n.current))??u??document.body;if(P==null){_.current&&(_.current=null,g(null),f(null));return}_.current!==P&&(_.current=P,g(null),f(P))},[n,u,s]);const w=Jl("div",a,{ref:[t,v],props:[{id:s,[H9]:""},i]});return{portalNode:p,portalSubtree:h&&w?ls.createPortal(w,h):null}}const $F=b.forwardRef(function(t,n){const{render:a,className:i,style:s,children:l,container:u,renderGuards:h,...f}=t,{portalNode:p,portalSubtree:g}=eC({container:u,ref:n,componentProps:t,elementProps:f}),v=b.useRef(null),_=b.useRef(null),w=b.useRef(null),S=b.useRef(null),[P,D]=b.useState(null),R=b.useRef(!1),E=P?.modal,A=P?.open,U=typeof h=="boolean"?h:!!P&&!P.modal&&P.open&&!!p;b.useEffect(()=>{if(!p||E)return;function j(C){p&&C.relatedTarget&&wp(C)&&(C.type==="focusin"?R.current&&(z0(p),R.current=!1):(qU(p),R.current=!0))}return PS(zi(p,"focusin",j,!0),zi(p,"focusout",j,!0))},[p,E]),b.useEffect(()=>{!p||A!==!1||(z0(p),R.current=!1)},[A,p]);const z=b.useMemo(()=>({beforeOutsideRef:v,afterOutsideRef:_,beforeInsideRef:w,afterInsideRef:S,portalNode:p,setFocusManagerState:D}),[p]);return T.jsxs(b.Fragment,{children:[g,T.jsxs(JS.Provider,{value:z,children:[U&&p&&T.jsx(Tl,{"data-type":"outside",ref:v,onFocus:j=>{if(wp(j,p))w.current?.focus();else{const C=P?P.domReference:null;KU(C)?.focus()}}}),U&&p&&T.jsx("span",{"aria-owns":p.id,style:S9}),p&&ls.createPortal(l,p),U&&p&&T.jsx(Tl,{"data-type":"outside",ref:_,onFocus:j=>{if(wp(j,p))S.current?.focus();else{const C=P?P.domReference:null;GU(C)?.focus(),P?.closeOnFocusOut&&P?.onOpenChange(!1,z9(F9,j.nativeEvent))}}})]})]})}),W9=b.forwardRef(function(t,n){const{children:a,container:i,className:s,render:l,style:u,...h}=t,{portalNode:f,portalSubtree:p}=eC({container:i,ref:n,componentProps:t,elementProps:h});return!p&&!f?null:T.jsxs(b.Fragment,{children:[p,f&&ls.createPortal(a,f)]})}),G9=W9;function K9(){const e=b.useContext(Zg);if(!e)throw new Error(vs(73));const t=e.useState("toasts");return b.useMemo(()=>({toasts:t,add:e.addToast,close:e.closeToast,update:e.updateToast,promise:e.promiseToast}),[t,e])}function q9(){const e=new Set;function t(n){e.forEach(a=>a(n))}return{" subscribe":function(a){return e.add(a),()=>{e.delete(a)}},add(n){const a=n.id||SS("toast"),i={...n,id:a,transitionStatus:"starting"};return t({action:"add",options:i}),a},close(n){t({action:"close",options:{id:n}})},update(n,a){t({action:"update",options:{...a,id:n}})},promise(n,a){let i=n;return t({action:"promise",options:{...a,promise:n,setPromise(s){i=s}}}),i}}}const ly=q9();function HF(e){return ly.add(e)}function Y9({children:e}){return T.jsxs(ZU,{toastManager:ly,children:[e,T.jsx(G9,{children:T.jsx(f9,{className:"fixed inset-x-0 top-6 z-[100] mx-auto flex w-full max-w-sm flex-col items-center gap-2 px-4 outline-none",children:T.jsx(Z9,{})})})]})}function Z9(){const{toasts:e}=K9();return e.map(t=>{const n=t.data?.onUndo;return T.jsxs(L9,{toast:t,className:St("pointer-events-auto flex w-full items-center gap-3 rounded-xl border border-oai-gray-200 bg-oai-white px-4 py-3 shadow-xl transition-all duration-200 ease-out","data-[starting-style]:-translate-y-3 data-[starting-style]:opacity-0","data-[ending-style]:-translate-y-3 data-[ending-style]:opacity-0","dark:border-oai-gray-800 dark:bg-oai-gray-900"),children:[T.jsx(M9,{className:"min-w-0 flex-1 text-sm font-medium text-oai-black dark:text-white"}),n?T.jsx("button",{type:"button",onClick:()=>{n(),ly.close(t.id)},className:"shrink-0 rounded-md px-2 py-1 text-xs font-semibold text-oai-gray-600 transition-colors hover:bg-oai-gray-100 hover:text-oai-black focus:outline-none focus:ring-2 focus:ring-oai-gray-400/30 dark:text-oai-gray-300 dark:hover:bg-oai-gray-800 dark:hover:text-white",children:De("shared.action.undo")}):null,T.jsx(B9,{"aria-label":De("shared.action.dismiss"),className:"-mr-1 inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-md text-oai-gray-400 transition-colors hover:bg-oai-gray-100 hover:text-oai-black focus:outline-none focus:ring-2 focus:ring-oai-gray-400/30 dark:hover:bg-oai-gray-800 dark:hover:text-white",children:T.jsx(gg,{className:"h-3.5 w-3.5","aria-hidden":!0})})]},t.id)})}const cy=Object.freeze(["limits","leaderboard"]),X9=Object.freeze({limits:"/limits",leaderboard:"/leaderboard"}),Q9=Object.freeze({limits:()=>Dn(()=>import("./LimitsPage-8o294HKr.js"),__vite__mapDeps([0,1,2,3,4,5,6,7])),leaderboard:()=>Dn(()=>import("./LeaderboardPage-DiQn0DqL.js"),__vite__mapDeps([8,9,10,11,12,13]))}),tC="total",nC=0,K0=20,J9=Object.freeze([10,20,50,100]),e7="tokentracker:leaderboard:pageSize",t7=20,n7=Object.freeze(["dashboard-existing","silent-preload","page-load","manual-refresh"]);let q0=0,oa;class a7{constructor(t={}){this.limits=null,this.leaderboard=new Map,this.leaderboardMaxEntries=o7(t.leaderboardMaxEntries)}read(t,n){return ec(t),t==="limits"?!this.limits||this.limits.contextKey!==n?null:Gu(this.limits):n?Gu(this.leaderboard.get(n)):null}write(t,n={}){if(t.targetKey==="limits"){this.limits=t;return}this.leaderboard.has(t.contextKey)&&this.leaderboard.delete(t.contextKey),this.leaderboard.set(t.contextKey,t),this.evictLeaderboardEntries(n.activeContextKey||t.contextKey)}evictLeaderboardEntries(t=null){for(;this.leaderboard.size>this.leaderboardMaxEntries;){const n=Array.from(this.leaderboard.keys()).find(a=>a!==t)||this.leaderboard.keys().next().value;this.leaderboard.delete(n)}}snapshot(){return{limits:Gu(this.limits),leaderboard:{maxEntries:this.leaderboardMaxEntries,size:this.leaderboard.size,keys:Array.from(this.leaderboard.keys())}}}}class r7{constructor(t={}){q0+=1,this.sessionId=`dashboard-preload-${q0}`,this.createdAt=Date.now(),this.completedAt=null,this.startedAfterMainContentVisible=!1,this.cache=new a7(t),this.targets={limits:Y0("limits"),leaderboard:Y0("leaderboard")}}}function Y0(e){return{key:e,route:X9[e],resourceStatus:"idle",stateStatus:"idle",error:null,resourcePromise:null,resourceModule:null,resourceRequestId:0,statePromise:null,stateRequestId:0,pendingStateContextKey:null}}function i7(e={}){return new r7(e)}function o7(e){const t=Number(e);return!Number.isInteger(t)||t<1?t7:t}oa=i7();function ec(e){if(!cy.includes(e))throw new Error(`Unknown dashboard preload target: ${e}`)}function aC(e){return e?typeof e=="string"?e:e.message||String(e):null}function s7(e,t){return n7.includes(e)?e:t}function l7(e){const t=Number(e);return Number.isFinite(t)?t:Date.now()}function Gu(e){return e?{...e}:null}function Z0(){const e=cy.every(t=>{const n=oa.targets[t];return n.resourceStatus==="fulfilled"||n.resourceStatus==="rejected"});oa.completedAt=e?Date.now():null}function c7(){oa.startedAfterMainContentVisible=!0}function uy(e,t={}){ec(e);const n=Object.entries(t).filter(([,a])=>a!==void 0).sort(([a],[i])=>a.localeCompare(i)).map(([a,i])=>`${a}=${i===null?"null":String(i)}`);return`${e}:${n.join("|")}`}function u7(e,t={}){ec(e);const n=oa.targets[e];if(n.resourceStatus==="fulfilled")return Promise.resolve(n.resourceModule);if(n.resourceStatus==="pending"&&n.resourcePromise)return n.resourcePromise;const a=t.loader||Q9[e],i=n.resourceRequestId+1;n.resourceRequestId=i,n.resourceStatus="pending",n.error=null;const s=Promise.resolve().then(()=>a()).then(l=>n.resourceRequestId!==i||n.resourcePromise!==s?null:(n.resourceStatus="fulfilled",n.resourceModule=l,n.error=null,Z0(),l)).catch(l=>(n.resourceRequestId!==i||n.resourcePromise!==s||(n.resourceStatus="rejected",n.error=aC(l),Z0()),null));return n.resourcePromise=s,s}function d7(e={}){const t=e.loaders||{};return Promise.all(cy.map(n=>u7(n,{loader:t[n]})))}function rC(e,t){ec(e);const n=oa.targets[e],a=t?.status||"fulfilled",i={targetKey:e,status:a,data:t?.data??null,error:aC(t?.error),source:s7(t?.source,"silent-preload"),generatedAt:l7(t?.generatedAt),updatedAt:Date.now(),contextKey:t?.contextKey||uy(e,t?.context||{})};return n.stateStatus=a,a==="rejected"||a==="skipped"?n.error=i.error:a==="fulfilled"&&(n.error=null,oa.cache.write(i,{activeContextKey:t?.activeContextKey})),Gu(i)}function iC(e,t){return ec(e),oa.cache.read(e,t)}function WF(e,t={}){return rC("limits",{data:e,source:t.source||"dashboard-existing",contextKey:t.contextKey||oC(t.context||{}),generatedAt:t.generatedAt,status:t.status||"fulfilled",error:t.error})}function oC(e={}){return uy("limits",{state:"current",...e})}function GF(e=oC()){return iC("limits",e)}function Rm(e,t={}){return rC("leaderboard",{activeContextKey:t.activeContextKey,data:e,source:t.source||"silent-preload",contextKey:t.contextKey||dy(t.context||{}),generatedAt:t.generatedAt,status:t.status||"fulfilled",error:t.error})}function h7(e){return iC("leaderboard",e)}function sC(){if(typeof window>"u")return K0;try{const e=window.localStorage.getItem(e7),t=Number(e);if(J9.includes(t))return t}catch{}return K0}function lC(e={}){const t=e.userId;return t!==void 0?t||null:e.cloudUser?.id||null}function cC(e={}){return typeof e.accessMode=="string"&&e.accessMode.trim()?e.accessMode.trim():e.mockEnabled?"mock":e.baseUrl?"cloud":"unavailable"}function dy(e={}){const t=!!e.mockEnabled,n=e.baseUrl??"";return uy("leaderboard",{accessMode:cC({...e,baseUrl:n,mockEnabled:t}),baseUrl:n,mockEnabled:t,offset:e.offset??nC,pageSize:e.pageSize??sC(),period:e.period||tC,userId:lC(e)})}function Pu(e,t){const n=oa.targets.leaderboard;return n.stateRequestId+=1,n.statePromise=null,n.pendingStateContextKey=null,Rm(null,{contextKey:t,status:"skipped",error:e})}function f7(e={}){const t=oa,n=!!e.mockEnabled,a=e.baseUrl??"",i=cC({...e,baseUrl:a,mockEnabled:n}),s=e.period||tC,l=e.pageSize??sC(),u=e.offset??nC,h=lC(e),f=dy({accessMode:i,baseUrl:a,mockEnabled:n,offset:u,pageSize:l,period:s,userId:h});if(!n&&e.authLoading)return Promise.resolve(Pu("auth-loading",f));if(!n&&!e.signedIn&&i!=="public")return Promise.resolve(Pu("not-signed-in",f));if(!n&&!a)return Promise.resolve(Pu("missing-base-url",f));if(!n&&i==="unavailable")return Promise.resolve(Pu("access-unavailable",f));const p=t.targets.leaderboard,g=h7(f);if(g)return Promise.resolve(g);if(p.stateStatus==="pending"&&p.statePromise&&p.pendingStateContextKey===f)return p.statePromise;const v=p.stateRequestId+1;p.stateRequestId=v,p.stateStatus="pending",p.pendingStateContextKey=f,p.error=null;const _=Promise.resolve().then(()=>WD({userId:h,period:s,limit:l,offset:u})).then(w=>oa!==t||p.stateRequestId!==v||p.statePromise!==_?null:(p.pendingStateContextKey=null,Rm(w,{contextKey:f}))).catch(w=>(oa!==t||p.stateRequestId!==v||p.statePromise!==_||(p.pendingStateContextKey=null,Rm(null,{contextKey:f,status:"rejected",error:w})),null));return p.statePromise=_,_}const p7=typeof window<"u"?window.location.search:"",X0=new URLSearchParams(p7),Su=X0.get("insforge_code")||X0.get("code")||null,m7=typeof window<"u"&&!!window.webkit?.messageHandlers?.nativeOAuth;function g7(){ql();const{loading:e,signedIn:t}=eo(),n=ss(),[a,i]=b.useState("processing"),[s,l]=b.useState(null),u=b.useRef(!1);b.useEffect(()=>{if(!(!Su||u.current)){if(u.current=!0,m7){l(!1);return}(async()=>{try{const p=await(await fetch("/api/auth-bridge/verifier")).json();l(!!p?.native)}catch{l(!1)}})()}},[]),b.useEffect(()=>{if(s!==!0||!Su)return;i("redirecting");const f=setTimeout(()=>{window.location.href=`tokentracker://auth/callback?insforge_code=${encodeURIComponent(Su)}`},200);return()=>clearTimeout(f)},[s]),b.useEffect(()=>{if(s!==!1||e)return;if(t){n("/dashboard",{replace:!0});return}const f=setTimeout(()=>{t||i("failed")},12e3);return()=>clearTimeout(f)},[s,e,t,n]),b.useEffect(()=>{if(!Su&&s===null){const f=setTimeout(()=>i("failed"),3e3);return()=>clearTimeout(f)}},[s]);const h=()=>{n("/dashboard",{replace:!0})};return a==="processing"&&s!==!0&&(s===null||s===!1&&e)?T.jsx("div",{className:"min-h-screen bg-oai-gray-950"}):T.jsx("div",{className:"min-h-screen bg-oai-gray-950 text-white font-oai antialiased dark flex items-center justify-center",children:T.jsxs("div",{className:"text-center space-y-4 max-w-sm px-4",children:[a==="processing"&&T.jsxs(T.Fragment,{children:[T.jsx("div",{className:"w-8 h-8 border-2 border-oai-gray-600 border-t-white rounded-full animate-spin mx-auto"}),T.jsx("p",{className:"text-oai-gray-400 text-sm",children:De("auth.callback.processing")})]}),a==="redirecting"&&T.jsxs(T.Fragment,{children:[T.jsx("div",{className:"w-12 h-12 mx-auto rounded-full bg-green-500/15 flex items-center justify-center",children:T.jsx("svg",{className:"w-6 h-6 text-green-400",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:T.jsx("path",{d:"M20 6 9 17l-5-5"})})}),T.jsx("p",{className:"text-white text-sm font-medium",children:De("auth.callback.success")}),T.jsx("p",{className:"text-oai-gray-500 text-xs",children:De("auth.callback.redirecting")})]}),a==="failed"&&T.jsxs("div",{className:"space-y-3",children:[T.jsx("p",{className:"text-oai-gray-300 text-sm",children:De("auth.callback.failed")}),T.jsx("button",{type:"button",onClick:h,className:"px-4 py-2 rounded-lg bg-oai-gray-800 text-sm text-white hover:bg-oai-gray-700 transition-colors",children:De("auth.callback.close")})]})]})})}const y7=b.lazy(()=>Dn(()=>import("./DashboardPage-C3QvJSI2.js"),__vite__mapDeps([14,1,12,15,16,17,11,3,9,10,18,19,4])).then(e=>({default:e.DashboardPage}))),v7=b.lazy(()=>Dn(()=>import("./IpCheckPage-vl0aIVv0.js"),[])),b7=b.lazy(()=>Dn(()=>import("./LandingPage-CJO4q92s.js"),__vite__mapDeps([20,21,18])).then(e=>({default:e.LandingPage}))),k7=b.lazy(()=>Dn(()=>import("./LeaderboardPage-DiQn0DqL.js"),__vite__mapDeps([8,9,10,11,12,13])).then(e=>({default:e.LeaderboardPage}))),_7=b.lazy(()=>Dn(()=>import("./LeaderboardProfilePage-C0vqt4m5.js"),__vite__mapDeps([22,12,21,23,13,15,16,6,11,17,7])).then(e=>({default:e.LeaderboardProfilePage}))),w7=b.lazy(()=>Dn(()=>import("./LimitsPage-8o294HKr.js"),__vite__mapDeps([0,1,2,3,4,5,6,7])).then(e=>({default:e.LimitsPage}))),x7=b.lazy(()=>Dn(()=>import("./LoginPage-D8hQf3xT.js"),[]).then(e=>({default:e.LoginPage}))),P7=b.lazy(()=>Dn(()=>import("./DevicePage-UVSutySl.js"),[])),S7=b.lazy(()=>Dn(()=>import("./WrappedPage-BARpWxxH.js"),[])),C7=b.lazy(()=>Dn(()=>import("./SettingsPage-DGyuX3ua.js"),__vite__mapDeps([24,2,25,3,11,12,9,10,16,7])).then(e=>({default:e.SettingsPage}))),T7=b.lazy(()=>Dn(()=>import("./SkillsPage-CMsfSZar.js"),__vite__mapDeps([26,5,6,7,3,17,11,16,12,19,10])).then(e=>({default:e.SkillsPage}))),E7=b.lazy(()=>Dn(()=>import("./WidgetsPage-DavgYHA1.js"),__vite__mapDeps([27,9,10,11,25,3,4,6,7])).then(e=>({default:e.WidgetsPage})));function A7(){const{resolvedLocale:e}=ql(),t=Mn(),n=eo();r8();const a=b.useRef(!1),i=b.useRef(!1),s=b.useRef(new Set),l=xn(),u=b.useMemo(()=>typeof window>"u"?!1:qj(window.location.search),[]),h=t?.pathname||"/",f=new URL(window.location.href),p=f.pathname.replace(/\/+$/,"")||"/",v=p.match(/^\/share\/([^/?#]+)$/i)?.[1]||null,_=f.searchParams.get("token")||null,w=v||_,S=p==="/share"||p==="/share.html"||p.startsWith("/share/"),P=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"),D=h.replace(/\/+$/,"")||"/",R=D==="/"||D==="/dashboard",E=D==="/leaderboard",A=D.match(/^\/u\/([^/]+)$/i),U=A?A[1]:null,z=!!(n.enabled&&n.signedIn),j=P||z,C=!1,K=Gj(),Y=!j&&!l&&!P,ce=l?"mock":n.loading?"unavailable":z?"cloud":j?"local":"unavailable",re=b.useCallback(()=>{if(!a.current||!l&&n.loading||!l&&!j)return;const pe={accessMode:ce,baseUrl:Kj(),mockEnabled:l,signedIn:j,authLoading:!!n.loading,userId:z&&n.user?.id||null},ke=dy(pe);s.current.has(ke)||(s.current.add(ke),f7(pe))},[z,n.loading,n.user?.id,ce,l,j]),fe=b.useCallback(()=>{R&&(a.current||(a.current=!0,c7()),i.current||(i.current=!0,d7()),re())},[R,re]);b.useEffect(()=>{re()},[re]);const de=b.useMemo(()=>!n.enabled||!z?null:{getAccessToken:()=>n.getAccessToken(),name:n.displayName||"",userId:n.user?.id||null},[z,n]);let he=P||l||u?"dashboard":"landing";D==="/landing"&&(he="landing"),D==="/dashboard"&&(he="dashboard"),E&&(he="dashboard"),U&&(he="dashboard");const oe=D==="/limits",X=D==="/settings",Z=D==="/skills",Q=D==="/widgets",V=D==="/ip-check";(oe||X||Z||Q||V)&&(he="dashboard");let I=y7;U?I=_7:D==="/leaderboard"?I=k7:oe?I=w7:X?I=C7:Z?I=T7:Q?I=E7:V&&(I=v7);const G=!S&&!Y&&(D==="/dashboard"||D==="/"||E||oe||X||Z||Q||V);if(!P&&!z&&!S&&!n.loading&&he==="dashboard"&&!E&&!U&&D!=="/login"&&D!=="/landing"&&D!=="/auth/callback"&&D!=="/auth/native-callback")return T.jsx(jE,{to:"/login",replace:!0});let me=null;if(D==="/auth/callback"||D==="/auth/native-callback")me=T.jsx(g7,{});else if(D==="/login")me=T.jsx(x7,{});else if(D==="/device")me=T.jsx(P7,{});else if(D==="/wrapped")me=T.jsx(S7,{});else if(he==="landing")me=T.jsx(b7,{signInUrl:"/login",signUpUrl:"/login"});else{const pe=T.jsx(I,{baseUrl:K,auth:de,signedIn:j,sessionSoftExpired:C,signOut:()=>n.enabled?n.signOut():Promise.resolve(),publicMode:S,publicToken:w,userId:U,signInUrl:"/login",signUpUrl:"/login",onMainContentVisible:fe},e);G?me=T.jsx(_8,{children:pe}):me=pe}return T.jsx(HI,{children:T.jsx(KI,{children:T.jsx(Y9,{children:T.jsxs(qI,{children:[T.jsx(b.Suspense,{fallback:null,children:me}),G?T.jsx(H8,{}):null,T.jsx(Hj,{}),T.jsx(qM,{}),T.jsx(iI,{})]})})})})}const R7=cA([{path:"*",element:T.jsx(A7,{})}]);QT.createRoot(document.getElementById("root")).render(T.jsx(Xo.StrictMode,{children:T.jsx(TM,{children:T.jsx(IM,{children:T.jsx(ZD,{children:T.jsx(XD,{children:T.jsx(_A,{router:R7})})})})})}));export{Dn as $,Ct as A,mB as B,J7 as C,kB as D,lB as E,Fx as F,De as G,Nu as H,X7 as I,Z7 as J,Dl as K,Rd as L,$I as M,CB as N,cB as O,z7 as P,F7 as Q,Xo as R,FP as S,i8 as T,z8 as U,St as V,h1 as W,gg as X,eo as Y,hg as Z,$j as _,Jl as a,_l as a$,K7 as a0,WD as a1,ql as a2,qj as a3,ni as a4,SB as a5,oB as a6,Q7 as a7,dD as a8,V7 as a9,AB as aA,U7 as aB,nB as aC,jd as aD,zI as aE,o8 as aF,GF as aG,OI as aH,fB as aI,L7 as aJ,QL as aK,yg as aL,Wp as aM,qk as aN,tB as aO,c1 as aP,l1 as aQ,TI as aR,q7 as aS,as as aT,sd as aU,Xx as aV,Qx as aW,Jx as aX,e1 as aY,DI as aZ,Ca as a_,$7 as aa,WF as ab,sB as ac,Y7 as ad,G7 as ae,A0 as af,EB as ag,$4 as ah,vt as ai,nn as aj,gd as ak,vg as al,is as am,$g as an,f1 as ao,li as ap,y_ as aq,ls as ar,Mn as as,ss as at,Kj as au,Gp as av,dy as aw,h7 as ax,Rm as ay,eD as az,z9 as b,p9 as b$,PB as b0,wB as b1,kS as b2,Ka as b3,vs as b4,ys as b5,cU as b6,V0 as b7,iy as b8,Fi as b9,kU as bA,Xi as bB,ty as bC,Ta as bD,PS as bE,zi as bF,Vi as bG,JB as bH,ZB as bI,Pr as bJ,IF as bK,uU as bL,MF as bM,UF as bN,TF as bO,F9 as bP,_a as bQ,zF as bR,wp as bS,PF as bT,GU as bU,SF as bV,AF as bW,Tl as bX,$F as bY,LF as bZ,b9 as b_,xr as ba,CF as bb,VS as bc,DF as bd,k9 as be,y9 as bf,V8 as bg,DB as bh,RB as bi,zB as bj,VB as bk,$B as bl,II as bm,LB as bn,MB as bo,HF as bp,IB as bq,UB as br,NB as bs,OB as bt,jB as bu,FB as bv,BB as bw,iF as bx,Yg as by,Ul as bz,an as c,EF as c$,ci as c0,MM as c1,cg as c2,xB as c3,_B as c4,bU as c5,TU as c6,dF as c7,RS as c8,MU as c9,_S as cA,KB as cB,yU as cC,kp as cD,gU as cE,QS as cF,tF as cG,eF as cH,F0 as cI,yF as cJ,vF as cK,Zo as cL,bp as cM,BF as cN,kF as cO,Tm as cP,bF as cQ,_F as cR,CU as cS,yp as cT,vp as cU,wF as cV,Pa as cW,aF as cX,rF as cY,SU as cZ,DS as c_,Cm as ca,fF as cb,pF as cc,hF as cd,LS as ce,EU as cf,AU as cg,IU as ch,mF as ci,gF as cj,sF as ck,DU as cl,uF as cm,LU as cn,dU as co,N0 as cp,cF as cq,lF as cr,Wd as cs,hU as ct,wm as cu,wS as cv,WB as cw,mU as cx,GB as cy,Aa as cz,jF as d,YB as d0,HB as d1,rU as d2,NF as d3,FF as d4,RF as d5,qB as d6,VF as d7,OF as d8,Pd as d9,$9 as da,ay as db,V9 as dc,v9 as dd,KU as de,xF as df,WU as dg,XB as dh,nF as di,QB as dj,oF as dk,ny as dl,j0 as dm,sy as dn,rB as dp,iB as dq,aB as dr,er as ds,W6 as e,B7 as f,zx as g,iD as h,xn as i,T as j,bB as k,pB as l,Cl as m,kD as n,_D as o,gB as p,uB as q,b as r,W7 as s,eB as t,j9 as u,yB as v,dB as w,vB as x,hB as y,H7 as z};
|