tokentracker-cli 0.22.0 → 0.22.1

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.
Files changed (35) hide show
  1. package/README.ja.md +6 -4
  2. package/README.ko.md +6 -4
  3. package/README.md +6 -4
  4. package/README.zh-CN.md +6 -4
  5. package/dashboard/dist/assets/{Card-CD18G4Ge.js → Card-DdDoM-Gd.js} +1 -1
  6. package/dashboard/dist/assets/{DashboardPage-DKY_Mi9v.js → DashboardPage-DqsLRhn6.js} +1 -1
  7. package/dashboard/dist/assets/{DevicePage-BkavlAal.js → DevicePage-Dz2WacAK.js} +1 -1
  8. package/dashboard/dist/assets/{FadeIn-CVNJ4aZy.js → FadeIn-CoY8tCtI.js} +1 -1
  9. package/dashboard/dist/assets/{HeaderGithubStar-COu1Xy3I.js → HeaderGithubStar-hr5WjsdY.js} +1 -1
  10. package/dashboard/dist/assets/{IpCheckPage-B2HjZ3vY.js → IpCheckPage-Dkp3KLz5.js} +1 -1
  11. package/dashboard/dist/assets/{LandingPage-9PSLFnys.js → LandingPage-BrXJJj3l.js} +1 -1
  12. package/dashboard/dist/assets/{LeaderboardPage-CQT5dBHU.js → LeaderboardPage-DvrAcWn2.js} +1 -1
  13. package/dashboard/dist/assets/{LeaderboardProfilePage-aPP-Raey.js → LeaderboardProfilePage-KRQhdatN.js} +1 -1
  14. package/dashboard/dist/assets/{LimitsPage-eFrAHmoA.js → LimitsPage-Ds-pKbQw.js} +1 -1
  15. package/dashboard/dist/assets/{LoginPage-CczTNZ_P.js → LoginPage-t-VKaIRw.js} +1 -1
  16. package/dashboard/dist/assets/{PopoverPopup-CEvWSWgZ.js → PopoverPopup-Cyf_sjKX.js} +1 -1
  17. package/dashboard/dist/assets/{ProviderIcon-ewev19y3.js → ProviderIcon-Dqb9ThUH.js} +1 -1
  18. package/dashboard/dist/assets/{SettingsPage-taBxq6ux.js → SettingsPage-DhiG9bbD.js} +1 -1
  19. package/dashboard/dist/assets/{SkillsPage-cqHO3rMB.js → SkillsPage-BdtuTu9f.js} +1 -1
  20. package/dashboard/dist/assets/{WidgetsPage-B53b1hwG.js → WidgetsPage--n-BUbXK.js} +1 -1
  21. package/dashboard/dist/assets/{WrappedPage-DwAhprTa.js → WrappedPage-DRoff4y0.js} +1 -1
  22. package/dashboard/dist/assets/check-BuIsQw1B.js +1 -0
  23. package/dashboard/dist/assets/{chevron-down-zOKEzHdv.js → chevron-down-DvuPNrFG.js} +1 -1
  24. package/dashboard/dist/assets/{download-BZZ4vKc1.js → download-LwtMKzsl.js} +1 -1
  25. package/dashboard/dist/assets/{leaderboard-columns-BNGlMUsD.js → leaderboard-columns-C01mJBwn.js} +1 -1
  26. package/dashboard/dist/assets/{main-D0Irg9xR.js → main-Csid8osN.js} +2 -2
  27. package/dashboard/dist/assets/{use-limits-display-prefs-BTuSZo27.js → use-limits-display-prefs-BP17xuqs.js} +1 -1
  28. package/dashboard/dist/assets/{use-native-settings-BPXVZrWe.js → use-native-settings-C-RMuUxI.js} +1 -1
  29. package/dashboard/dist/assets/{use-reduced-motion-HUOV_JD1.js → use-reduced-motion-CPJKbom2.js} +1 -1
  30. package/dashboard/dist/assets/{use-usage-limits-G6-vCBcN.js → use-usage-limits-DIE-GP0H.js} +1 -1
  31. package/dashboard/dist/index.html +1 -1
  32. package/dashboard/dist/share.html +1 -1
  33. package/package.json +1 -1
  34. package/src/lib/pricing/seed-snapshot.json +1 -1
  35. package/dashboard/dist/assets/check-JnFJsHgI.js +0 -1
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardPage-DKY_Mi9v.js","assets/use-usage-limits-G6-vCBcN.js","assets/PopoverPopup-CEvWSWgZ.js","assets/Card-CD18G4Ge.js","assets/use-reduced-motion-HUOV_JD1.js","assets/ProviderIcon-ewev19y3.js","assets/FadeIn-CVNJ4aZy.js","assets/LandingPage-9PSLFnys.js","assets/HeaderGithubStar-COu1Xy3I.js","assets/LeaderboardPage-CQT5dBHU.js","assets/leaderboard-columns-BNGlMUsD.js","assets/chevron-down-zOKEzHdv.js","assets/LeaderboardProfilePage-aPP-Raey.js","assets/LimitsPage-eFrAHmoA.js","assets/use-limits-display-prefs-BTuSZo27.js","assets/SettingsPage-taBxq6ux.js","assets/use-native-settings-BPXVZrWe.js","assets/check-JnFJsHgI.js","assets/download-BZZ4vKc1.js","assets/SkillsPage-cqHO3rMB.js","assets/WidgetsPage-B53b1hwG.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardPage-DqsLRhn6.js","assets/use-usage-limits-DIE-GP0H.js","assets/PopoverPopup-Cyf_sjKX.js","assets/Card-DdDoM-Gd.js","assets/use-reduced-motion-CPJKbom2.js","assets/ProviderIcon-Dqb9ThUH.js","assets/FadeIn-CoY8tCtI.js","assets/LandingPage-BrXJJj3l.js","assets/HeaderGithubStar-hr5WjsdY.js","assets/LeaderboardPage-DvrAcWn2.js","assets/leaderboard-columns-C01mJBwn.js","assets/chevron-down-DvuPNrFG.js","assets/LeaderboardProfilePage-KRQhdatN.js","assets/LimitsPage-Ds-pKbQw.js","assets/use-limits-display-prefs-BP17xuqs.js","assets/SettingsPage-DhiG9bbD.js","assets/use-native-settings-C-RMuUxI.js","assets/check-BuIsQw1B.js","assets/download-LwtMKzsl.js","assets/SkillsPage-BdtuTu9f.js","assets/WidgetsPage--n-BUbXK.js"])))=>i.map(i=>d[i]);
2
2
  function iP(e,t){for(var n=0;n<t.length;n++){const a=t[n];if(typeof a!="string"&&!Array.isArray(a)){for(const s in a)if(s!=="default"&&!(s in e)){const o=Object.getOwnPropertyDescriptor(a,s);o&&Object.defineProperty(e,s,o.get?o:{enumerable:!0,get:()=>a[s]})}}}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 s of document.querySelectorAll('link[rel="modulepreload"]'))a(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const u of o.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&a(u)}).observe(document,{childList:!0,subtree:!0});function n(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function a(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();function _b(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function sP(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function a(){var s=!1;try{s=this instanceof a}catch{}return s?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 s=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(n,a,s.get?s:{enumerable:!0,get:function(){return e[a]}})}),n}var lh={exports:{}},lo={},uh={exports:{}},Ze={};var Py;function oP(){if(Py)return Ze;Py=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),u=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),y=Symbol.iterator;function b(N){return N===null||typeof N!="object"?null:(N=y&&N[y]||N["@@iterator"],typeof N=="function"?N:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,T={};function P(N,G,xe){this.props=N,this.context=G,this.refs=T,this.updater=xe||w}P.prototype.isReactComponent={},P.prototype.setState=function(N,G){if(typeof N!="object"&&typeof N!="function"&&N!=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,N,G,"setState")},P.prototype.forceUpdate=function(N){this.updater.enqueueForceUpdate(this,N,"forceUpdate")};function L(){}L.prototype=P.prototype;function D(N,G,xe){this.props=N,this.context=G,this.refs=T,this.updater=xe||w}var M=D.prototype=new L;M.constructor=D,S(M,P.prototype),M.isPureReactComponent=!0;var j=Array.isArray,q=Object.prototype.hasOwnProperty,K={current:null},H={key:!0,ref:!0,__self:!0,__source:!0};function x(N,G,xe){var Re,Se={},Ce=null,qe=null;if(G!=null)for(Re in G.ref!==void 0&&(qe=G.ref),G.key!==void 0&&(Ce=""+G.key),G)q.call(G,Re)&&!H.hasOwnProperty(Re)&&(Se[Re]=G[Re]);var Xe=arguments.length-2;if(Xe===1)Se.children=xe;else if(1<Xe){for(var Ue=Array(Xe),jt=0;jt<Xe;jt++)Ue[jt]=arguments[jt+2];Se.children=Ue}if(N&&N.defaultProps)for(Re in Xe=N.defaultProps,Xe)Se[Re]===void 0&&(Se[Re]=Xe[Re]);return{$$typeof:e,type:N,key:Ce,ref:qe,props:Se,_owner:K.current}}function Z(N,G){return{$$typeof:e,type:N.type,key:G,ref:N.ref,props:N.props,_owner:N._owner}}function Q(N){return typeof N=="object"&&N!==null&&N.$$typeof===e}function me(N){var G={"=":"=0",":":"=2"};return"$"+N.replace(/[=:]/g,function(xe){return G[xe]})}var oe=/\/+/g;function Ae(N,G){return typeof N=="object"&&N!==null&&N.key!=null?me(""+N.key):G.toString(36)}function fe(N,G,xe,Re,Se){var Ce=typeof N;(Ce==="undefined"||Ce==="boolean")&&(N=null);var qe=!1;if(N===null)qe=!0;else switch(Ce){case"string":case"number":qe=!0;break;case"object":switch(N.$$typeof){case e:case t:qe=!0}}if(qe)return qe=N,Se=Se(qe),N=Re===""?"."+Ae(qe,0):Re,j(Se)?(xe="",N!=null&&(xe=N.replace(oe,"$&/")+"/"),fe(Se,G,xe,"",function(jt){return jt})):Se!=null&&(Q(Se)&&(Se=Z(Se,xe+(!Se.key||qe&&qe.key===Se.key?"":(""+Se.key).replace(oe,"$&/")+"/")+N)),G.push(Se)),1;if(qe=0,Re=Re===""?".":Re+":",j(N))for(var Xe=0;Xe<N.length;Xe++){Ce=N[Xe];var Ue=Re+Ae(Ce,Xe);qe+=fe(Ce,G,xe,Ue,Se)}else if(Ue=b(N),typeof Ue=="function")for(N=Ue.call(N),Xe=0;!(Ce=N.next()).done;)Ce=Ce.value,Ue=Re+Ae(Ce,Xe++),qe+=fe(Ce,G,xe,Ue,Se);else if(Ce==="object")throw G=String(N),Error("Objects are not valid as a React child (found: "+(G==="[object Object]"?"object with keys {"+Object.keys(N).join(", ")+"}":G)+"). If you meant to render a collection of children, use an array instead.");return qe}function ce(N,G,xe){if(N==null)return N;var Re=[],Se=0;return fe(N,Re,"","",function(Ce){return G.call(xe,Ce,Se++)}),Re}function le(N){if(N._status===-1){var G=N._result;G=G(),G.then(function(xe){(N._status===0||N._status===-1)&&(N._status=1,N._result=xe)},function(xe){(N._status===0||N._status===-1)&&(N._status=2,N._result=xe)}),N._status===-1&&(N._status=0,N._result=G)}if(N._status===1)return N._result.default;throw N._result}var Me={current:null},W={transition:null},Y={ReactCurrentDispatcher:Me,ReactCurrentBatchConfig:W,ReactCurrentOwner:K};function $(){throw Error("act(...) is not supported in production builds of React.")}return Ze.Children={map:ce,forEach:function(N,G,xe){ce(N,function(){G.apply(this,arguments)},xe)},count:function(N){var G=0;return ce(N,function(){G++}),G},toArray:function(N){return ce(N,function(G){return G})||[]},only:function(N){if(!Q(N))throw Error("React.Children.only expected to receive a single React element child.");return N}},Ze.Component=P,Ze.Fragment=n,Ze.Profiler=s,Ze.PureComponent=D,Ze.StrictMode=a,Ze.Suspense=h,Ze.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Y,Ze.act=$,Ze.cloneElement=function(N,G,xe){if(N==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+N+".");var Re=S({},N.props),Se=N.key,Ce=N.ref,qe=N._owner;if(G!=null){if(G.ref!==void 0&&(Ce=G.ref,qe=K.current),G.key!==void 0&&(Se=""+G.key),N.type&&N.type.defaultProps)var Xe=N.type.defaultProps;for(Ue in G)q.call(G,Ue)&&!H.hasOwnProperty(Ue)&&(Re[Ue]=G[Ue]===void 0&&Xe!==void 0?Xe[Ue]:G[Ue])}var Ue=arguments.length-2;if(Ue===1)Re.children=xe;else if(1<Ue){Xe=Array(Ue);for(var jt=0;jt<Ue;jt++)Xe[jt]=arguments[jt+2];Re.children=Xe}return{$$typeof:e,type:N.type,key:Se,ref:Ce,props:Re,_owner:qe}},Ze.createContext=function(N){return N={$$typeof:u,_currentValue:N,_currentValue2:N,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},N.Provider={$$typeof:o,_context:N},N.Consumer=N},Ze.createElement=x,Ze.createFactory=function(N){var G=x.bind(null,N);return G.type=N,G},Ze.createRef=function(){return{current:null}},Ze.forwardRef=function(N){return{$$typeof:c,render:N}},Ze.isValidElement=Q,Ze.lazy=function(N){return{$$typeof:m,_payload:{_status:-1,_result:N},_init:le}},Ze.memo=function(N,G){return{$$typeof:f,type:N,compare:G===void 0?null:G}},Ze.startTransition=function(N){var G=W.transition;W.transition={};try{N()}finally{W.transition=G}},Ze.unstable_act=$,Ze.useCallback=function(N,G){return Me.current.useCallback(N,G)},Ze.useContext=function(N){return Me.current.useContext(N)},Ze.useDebugValue=function(){},Ze.useDeferredValue=function(N){return Me.current.useDeferredValue(N)},Ze.useEffect=function(N,G){return Me.current.useEffect(N,G)},Ze.useId=function(){return Me.current.useId()},Ze.useImperativeHandle=function(N,G,xe){return Me.current.useImperativeHandle(N,G,xe)},Ze.useInsertionEffect=function(N,G){return Me.current.useInsertionEffect(N,G)},Ze.useLayoutEffect=function(N,G){return Me.current.useLayoutEffect(N,G)},Ze.useMemo=function(N,G){return Me.current.useMemo(N,G)},Ze.useReducer=function(N,G,xe){return Me.current.useReducer(N,G,xe)},Ze.useRef=function(N){return Me.current.useRef(N)},Ze.useState=function(N){return Me.current.useState(N)},Ze.useSyncExternalStore=function(N,G,xe){return Me.current.useSyncExternalStore(N,G,xe)},Ze.useTransition=function(){return Me.current.useTransition()},Ze.version="18.3.1",Ze}var Ty;function $f(){return Ty||(Ty=1,uh.exports=oP()),uh.exports}var Cy;function lP(){if(Cy)return lo;Cy=1;var e=$f(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,s=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function u(c,h,f){var m,y={},b=null,w=null;f!==void 0&&(b=""+f),h.key!==void 0&&(b=""+h.key),h.ref!==void 0&&(w=h.ref);for(m in h)a.call(h,m)&&!o.hasOwnProperty(m)&&(y[m]=h[m]);if(c&&c.defaultProps)for(m in h=c.defaultProps,h)y[m]===void 0&&(y[m]=h[m]);return{$$typeof:t,type:c,key:b,ref:w,props:y,_owner:s.current}}return lo.Fragment=n,lo.jsx=u,lo.jsxs=u,lo}var Ey;function uP(){return Ey||(Ey=1,lh.exports=lP()),lh.exports}var I=uP(),k=$f();const Hf=_b(k),cP=iP({__proto__:null,default:Hf},[k]);var au={},ch={exports:{}},yn={},dh={exports:{}},hh={};var Ay;function dP(){return Ay||(Ay=1,(function(e){function t(W,Y){var $=W.length;W.push(Y);e:for(;0<$;){var N=$-1>>>1,G=W[N];if(0<s(G,Y))W[N]=Y,W[$]=G,$=N;else break e}}function n(W){return W.length===0?null:W[0]}function a(W){if(W.length===0)return null;var Y=W[0],$=W.pop();if($!==Y){W[0]=$;e:for(var N=0,G=W.length,xe=G>>>1;N<xe;){var Re=2*(N+1)-1,Se=W[Re],Ce=Re+1,qe=W[Ce];if(0>s(Se,$))Ce<G&&0>s(qe,Se)?(W[N]=qe,W[Ce]=$,N=Ce):(W[N]=Se,W[Re]=$,N=Re);else if(Ce<G&&0>s(qe,$))W[N]=qe,W[Ce]=$,N=Ce;else break e}}return Y}function s(W,Y){var $=W.sortIndex-Y.sortIndex;return $!==0?$:W.id-Y.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var u=Date,c=u.now();e.unstable_now=function(){return u.now()-c}}var h=[],f=[],m=1,y=null,b=3,w=!1,S=!1,T=!1,P=typeof setTimeout=="function"?setTimeout:null,L=typeof clearTimeout=="function"?clearTimeout:null,D=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function M(W){for(var Y=n(f);Y!==null;){if(Y.callback===null)a(f);else if(Y.startTime<=W)a(f),Y.sortIndex=Y.expirationTime,t(h,Y);else break;Y=n(f)}}function j(W){if(T=!1,M(W),!S)if(n(h)!==null)S=!0,le(q);else{var Y=n(f);Y!==null&&Me(j,Y.startTime-W)}}function q(W,Y){S=!1,T&&(T=!1,L(x),x=-1),w=!0;var $=b;try{for(M(Y),y=n(h);y!==null&&(!(y.expirationTime>Y)||W&&!me());){var N=y.callback;if(typeof N=="function"){y.callback=null,b=y.priorityLevel;var G=N(y.expirationTime<=Y);Y=e.unstable_now(),typeof G=="function"?y.callback=G:y===n(h)&&a(h),M(Y)}else a(h);y=n(h)}if(y!==null)var xe=!0;else{var Re=n(f);Re!==null&&Me(j,Re.startTime-Y),xe=!1}return xe}finally{y=null,b=$,w=!1}}var K=!1,H=null,x=-1,Z=5,Q=-1;function me(){return!(e.unstable_now()-Q<Z)}function oe(){if(H!==null){var W=e.unstable_now();Q=W;var Y=!0;try{Y=H(!0,W)}finally{Y?Ae():(K=!1,H=null)}}else K=!1}var Ae;if(typeof D=="function")Ae=function(){D(oe)};else if(typeof MessageChannel<"u"){var fe=new MessageChannel,ce=fe.port2;fe.port1.onmessage=oe,Ae=function(){ce.postMessage(null)}}else Ae=function(){P(oe,0)};function le(W){H=W,K||(K=!0,Ae())}function Me(W,Y){x=P(function(){W(e.unstable_now())},Y)}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(W){W.callback=null},e.unstable_continueExecution=function(){S||w||(S=!0,le(q))},e.unstable_forceFrameRate=function(W){0>W||125<W?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Z=0<W?Math.floor(1e3/W):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_getFirstCallbackNode=function(){return n(h)},e.unstable_next=function(W){switch(b){case 1:case 2:case 3:var Y=3;break;default:Y=b}var $=b;b=Y;try{return W()}finally{b=$}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(W,Y){switch(W){case 1:case 2:case 3:case 4:case 5:break;default:W=3}var $=b;b=W;try{return Y()}finally{b=$}},e.unstable_scheduleCallback=function(W,Y,$){var N=e.unstable_now();switch(typeof $=="object"&&$!==null?($=$.delay,$=typeof $=="number"&&0<$?N+$:N):$=N,W){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=$+G,W={id:m++,callback:Y,priorityLevel:W,startTime:$,expirationTime:G,sortIndex:-1},$>N?(W.sortIndex=$,t(f,W),n(h)===null&&W===n(f)&&(T?(L(x),x=-1):T=!0,Me(j,$-N))):(W.sortIndex=G,t(h,W),S||w||(S=!0,le(q))),W},e.unstable_shouldYield=me,e.unstable_wrapCallback=function(W){var Y=b;return function(){var $=b;b=Y;try{return W.apply(this,arguments)}finally{b=$}}}})(hh)),hh}var Ry;function hP(){return Ry||(Ry=1,dh.exports=dP()),dh.exports}var Ly;function fP(){if(Ly)return yn;Ly=1;var e=$f(),t=hP();function n(r){for(var i="https://reactjs.org/docs/error-decoder.html?invariant="+r,l=1;l<arguments.length;l++)i+="&args[]="+encodeURIComponent(arguments[l]);return"Minified React error #"+r+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var a=new Set,s={};function o(r,i){u(r,i),u(r+"Capture",i)}function u(r,i){for(s[r]=i,r=0;r<i.length;r++)a.add(i[r])}var c=!(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]*$/,m={},y={};function b(r){return h.call(y,r)?!0:h.call(m,r)?!1:f.test(r)?y[r]=!0:(m[r]=!0,!1)}function w(r,i,l,d){if(l!==null&&l.type===0)return!1;switch(typeof i){case"function":case"symbol":return!0;case"boolean":return d?!1:l!==null?!l.acceptsBooleans:(r=r.toLowerCase().slice(0,5),r!=="data-"&&r!=="aria-");default:return!1}}function S(r,i,l,d){if(i===null||typeof i>"u"||w(r,i,l,d))return!0;if(d)return!1;if(l!==null)switch(l.type){case 3:return!i;case 4:return i===!1;case 5:return isNaN(i);case 6:return isNaN(i)||1>i}return!1}function T(r,i,l,d,p,g,_){this.acceptsBooleans=i===2||i===3||i===4,this.attributeName=d,this.attributeNamespace=p,this.mustUseProperty=l,this.propertyName=r,this.type=i,this.sanitizeURL=g,this.removeEmptyString=_}var P={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(r){P[r]=new T(r,0,!1,r,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(r){var i=r[0];P[i]=new T(i,1,!1,r[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(r){P[r]=new T(r,2,!1,r.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(r){P[r]=new T(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 T(r,3,!1,r.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(r){P[r]=new T(r,3,!0,r,null,!1,!1)}),["capture","download"].forEach(function(r){P[r]=new T(r,4,!1,r,null,!1,!1)}),["cols","rows","size","span"].forEach(function(r){P[r]=new T(r,6,!1,r,null,!1,!1)}),["rowSpan","start"].forEach(function(r){P[r]=new T(r,5,!1,r.toLowerCase(),null,!1,!1)});var L=/[\-:]([a-z])/g;function D(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 i=r.replace(L,D);P[i]=new T(i,1,!1,r,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(r){var i=r.replace(L,D);P[i]=new T(i,1,!1,r,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(r){var i=r.replace(L,D);P[i]=new T(i,1,!1,r,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(r){P[r]=new T(r,1,!1,r.toLowerCase(),null,!1,!1)}),P.xlinkHref=new T("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(r){P[r]=new T(r,1,!1,r.toLowerCase(),null,!0,!0)});function M(r,i,l,d){var p=P.hasOwnProperty(i)?P[i]:null;(p!==null?p.type!==0:d||!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(S(i,l,p,d)&&(l=null),d||p===null?b(i)&&(l===null?r.removeAttribute(i):r.setAttribute(i,""+l)):p.mustUseProperty?r[p.propertyName]=l===null?p.type===3?!1:"":l:(i=p.attributeName,d=p.attributeNamespace,l===null?r.removeAttribute(i):(p=p.type,l=p===3||p===4&&l===!0?"":""+l,d?r.setAttributeNS(d,i,l):r.setAttribute(i,l))))}var j=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,q=Symbol.for("react.element"),K=Symbol.for("react.portal"),H=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),Z=Symbol.for("react.profiler"),Q=Symbol.for("react.provider"),me=Symbol.for("react.context"),oe=Symbol.for("react.forward_ref"),Ae=Symbol.for("react.suspense"),fe=Symbol.for("react.suspense_list"),ce=Symbol.for("react.memo"),le=Symbol.for("react.lazy"),Me=Symbol.for("react.offscreen"),W=Symbol.iterator;function Y(r){return r===null||typeof r!="object"?null:(r=W&&r[W]||r["@@iterator"],typeof r=="function"?r:null)}var $=Object.assign,N;function G(r){if(N===void 0)try{throw Error()}catch(l){var i=l.stack.trim().match(/\n( *(at )?)/);N=i&&i[1]||""}return`
3
3
  `+N+r}var xe=!1;function Re(r,i){if(!r||xe)return"";xe=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(i)if(i=function(){throw Error()},Object.defineProperty(i.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(i,[])}catch(z){var d=z}Reflect.construct(r,[],i)}else{try{i.call()}catch(z){d=z}r.call(i.prototype)}else{try{throw Error()}catch(z){d=z}r()}}catch(z){if(z&&d&&typeof z.stack=="string"){for(var p=z.stack.split(`
4
4
  `),g=d.stack.split(`
@@ -673,4 +673,4 @@ heatmap.3d.voxel.level0,ui,ActivityHeatmap3D,ActivityHeatmap3D,voxel_level0,"
673
673
  ${D}px !important;
674
674
  ${M}px !important;
675
675
  }
676
- `),()=>{c.current?.removeAttribute("data-motion-pop-id"),q.contains(j)&&q.removeChild(j)}},[t]),I.jsx(EO,{isPresent:t,childRef:c,sizeRef:h,pop:o,children:o===!1?e:k.cloneElement(e,{ref:y})})}const RO=({children:e,initial:t,isPresent:n,onExitComplete:a,custom:s,presenceAffectsLayout:o,mode:u,anchorX:c,anchorY:h,root:f})=>{const m=Pp(LO),y=k.useId();let b=!0,w=k.useMemo(()=>(b=!1,{id:y,initial:t,isPresent:n,custom:s,onExitComplete:S=>{m.set(S,!0);for(const T of m.values())if(!T)return;a&&a()},register:S=>(m.set(S,!1),()=>m.delete(S))}),[n,m,a]);return o&&b&&(w={...w}),k.useMemo(()=>{m.forEach((S,T)=>m.set(T,!1))},[n]),k.useEffect(()=>{!n&&!m.size&&a&&a()},[n]),e=I.jsx(AO,{pop:u==="popLayout",isPresent:n,anchorX:c,anchorY:h,root:f,children:e}),I.jsx(xc.Provider,{value:w,children:e})};function LO(){return new Map}function qw(e=!0){const t=k.useContext(xc);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:a,register:s}=t,o=k.useId();k.useEffect(()=>{if(e)return s(o)},[e]);const u=k.useCallback(()=>e&&a&&a(o),[o,a,e]);return!n&&a?[!1,u]:[!0]}const pu=e=>e.key||"";function Y0(e){const t=[];return k.Children.forEach(e,n=>{k.isValidElement(n)&&t.push(n)}),t}const DO=({children:e,custom:t,initial:n=!0,onExitComplete:a,presenceAffectsLayout:s=!0,mode:o="sync",propagate:u=!1,anchorX:c="left",anchorY:h="top",root:f})=>{const[m,y]=qw(u),b=k.useMemo(()=>Y0(e),[e]),w=u&&!m?[]:b.map(pu),S=k.useRef(!0),T=k.useRef(b),P=Pp(()=>new Map),L=k.useRef(new Set),[D,M]=k.useState(b),[j,q]=k.useState(b);_k(()=>{S.current=!1,T.current=b;for(let x=0;x<j.length;x++){const Z=pu(j[x]);w.includes(Z)?(P.delete(Z),L.current.delete(Z)):P.get(Z)!==!0&&P.set(Z,!1)}},[j,w.length,w.join("-")]);const K=[];if(b!==D){let x=[...b];for(let Z=0;Z<j.length;Z++){const Q=j[Z],me=pu(Q);w.includes(me)||(x.splice(Z,0,Q),K.push(Q))}return o==="wait"&&K.length&&(x=K),q(Y0(x)),M(b),null}const{forceRender:H}=k.useContext(Sp);return I.jsx(I.Fragment,{children:j.map(x=>{const Z=pu(x),Q=u&&!m?!1:b===j||w.includes(Z),me=()=>{if(L.current.has(Z))return;if(P.has(Z))L.current.add(Z),P.set(Z,!0);else return;let oe=!0;P.forEach(Ae=>{Ae||(oe=!1)}),oe&&(H?.(),q(T.current),u&&y?.(),a&&a())};return I.jsx(RO,{isPresent:Q,initial:!S.current||n?void 0:!1,custom:t,presenceAffectsLayout:s,mode:o,root:f,onExitComplete:Q?void 0:me,anchorX:c,anchorY:h,children:x},Z)})})},Gw=k.createContext({strict:!1}),Z0={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 Q0=!1;function MO(){if(Q0)return;const e={};for(const t in Z0)e[t]={isEnabled:n=>Z0[t].some(a=>!!n[a])};xw(e),Q0=!0}function Yw(){return MO(),gN()}function NO(e){const t=Yw();for(const n in e)t[n]={...t[n],...e[n]};xw(t)}const OO=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 uc(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||OO.has(e)}let Zw=e=>!uc(e);function IO(e){typeof e=="function"&&(Zw=t=>t.startsWith("on")?!uc(t):e(t))}try{IO(require("@emotion/is-prop-valid").default)}catch{}function jO(e,t,n){const a={};for(const s in e)s==="values"&&typeof e.values=="object"||qt(e[s])||(Zw(s)||n===!0&&uc(s)||!t&&!uc(s)||e.draggable&&s.startsWith("onDrag"))&&(a[s]=e[s]);return a}const Cc=k.createContext({});function UO(e,t){if(Tc(e)){const{initial:n,animate:a}=e;return{initial:n===!1||No(n)?n:void 0,animate:No(a)?a:void 0}}return e.inherit!==!1?t:{}}function BO(e){const{initial:t,animate:n}=UO(e,k.useContext(Cc));return k.useMemo(()=>({initial:t,animate:n}),[X0(t),X0(n)])}function X0(e){return Array.isArray(e)?e.join(" "):e}const Qp=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Qw(e,t,n){for(const a in t)!qt(t[a])&&!Rw(a,n)&&(e[a]=t[a])}function FO({transformTemplate:e},t){return k.useMemo(()=>{const n=Qp();return Gp(n,t,e),Object.assign({},n.vars,n.style)},[t])}function VO(e,t){const n=e.style||{},a={};return Qw(a,n,e),Object.assign(a,FO(e,t)),a}function zO(e,t){const n={},a=VO(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 Xw=()=>({...Qp(),attrs:{}});function $O(e,t,n,a){const s=k.useMemo(()=>{const o=Xw();return Lw(o,t,Mw(a),e.transformTemplate,e.style),{...o.attrs,style:{...o.style}}},[t]);if(e.style){const o={};Qw(o,e.style,e),s.style={...o,...s.style}}return s}const HO=["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 Xp(e){return typeof e!="string"||e.includes("-")?!1:!!(HO.indexOf(e)>-1||/[A-Z]/u.test(e))}function WO(e,t,n,{latestValues:a},s,o=!1,u){const h=(u??Xp(e)?$O:zO)(t,a,s,e),f=jO(t,typeof e=="string",o),m=e!==k.Fragment?{...f,...h,ref:n}:{},{children:y}=t,b=k.useMemo(()=>qt(y)?y.get():y,[y]);return k.createElement(e,{...m,children:b})}function KO({scrapeMotionValuesFromProps:e,createRenderState:t},n,a,s){return{latestValues:qO(n,a,s,e),renderState:t()}}function qO(e,t,n,a){const s={},o=a(e,{});for(const b in o)s[b]=Iu(o[b]);let{initial:u,animate:c}=e;const h=Tc(e),f=kw(e);t&&f&&!h&&e.inherit!==!1&&(u===void 0&&(u=t.initial),c===void 0&&(c=t.animate));let m=n?n.initial===!1:!1;m=m||u===!1;const y=m?c:u;if(y&&typeof y!="boolean"&&!Pc(y)){const b=Array.isArray(y)?y:[y];for(let w=0;w<b.length;w++){const S=Fp(e,b[w]);if(S){const{transitionEnd:T,transition:P,...L}=S;for(const D in L){let M=L[D];if(Array.isArray(M)){const j=m?M.length-1:0;M=M[j]}M!==null&&(s[D]=M)}for(const D in T)s[D]=T[D]}}}return s}const Jw=e=>(t,n)=>{const a=k.useContext(Cc),s=k.useContext(xc),o=()=>KO(e,t,a,s);return n?o():Pp(o)},GO=Jw({scrapeMotionValuesFromProps:Yp,createRenderState:Qp}),YO=Jw({scrapeMotionValuesFromProps:Nw,createRenderState:Xw}),ZO=Symbol.for("motionComponentSymbol");function QO(e,t,n){const a=k.useRef(n);k.useInsertionEffect(()=>{a.current=n});const s=k.useRef(null);return k.useCallback(o=>{o&&e.onMount?.(o);const u=a.current;if(typeof u=="function")if(o){const c=u(o);typeof c=="function"&&(s.current=c)}else s.current?(s.current(),s.current=null):u(o);else u&&(u.current=o);t&&(o?t.mount(o):t.unmount())},[t])}const ex=k.createContext({});function ts(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function XO(e,t,n,a,s,o){const{visualElement:u}=k.useContext(Cc),c=k.useContext(Gw),h=k.useContext(xc),f=k.useContext(Zp),m=f.reducedMotion,y=f.skipAnimations,b=k.useRef(null),w=k.useRef(!1);a=a||c.renderer,!b.current&&a&&(b.current=a(e,{visualState:t,parent:u,props:n,presenceContext:h,blockInitialAnimation:h?h.initial===!1:!1,reducedMotionConfig:m,skipAnimations:y,isSVG:o}),w.current&&b.current&&(b.current.manuallyAnimateOnMount=!0));const S=b.current,T=k.useContext(ex);S&&!S.projection&&s&&(S.type==="html"||S.type==="svg")&&JO(b.current,n,s,T);const P=k.useRef(!1);k.useInsertionEffect(()=>{S&&P.current&&S.update(n,h)});const L=n[lw],D=k.useRef(!!L&&typeof window<"u"&&!window.MotionHandoffIsComplete?.(L)&&window.MotionHasOptimisedAnimation?.(L));return _k(()=>{w.current=!0,S&&(P.current=!0,window.MotionIsMounted=!0,S.updateFeatures(),S.scheduleRenderMicrotask(),D.current&&S.animationState&&S.animationState.animateChanges())}),k.useEffect(()=>{S&&(!D.current&&S.animationState&&S.animationState.animateChanges(),D.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(L)}),D.current=!1),S.enteringChildren=void 0)}),S}function JO(e,t,n,a){const{layoutId:s,layout:o,drag:u,dragConstraints:c,layoutScroll:h,layoutRoot:f,layoutAnchor:m,layoutCrossfade:y}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:tx(e.parent)),e.projection.setOptions({layoutId:s,layout:o,alwaysMeasureLayout:!!u||c&&ts(c),visualElement:e,animationType:typeof o=="string"?o:"both",initialPromotionConfig:a,crossfade:y,layoutScroll:h,layoutRoot:f,layoutAnchor:m})}function tx(e){if(e)return e.options.allowProjection!==!1?e.projection:tx(e.parent)}function Fh(e,{forwardMotionProps:t=!1,type:n}={},a,s){a&&NO(a);const o=n?n==="svg":Xp(e),u=o?YO:GO;function c(f,m){let y;const b={...k.useContext(Zp),...f,layoutId:eI(f)},{isStatic:w}=b,S=BO(f),T=u(f,w);if(!w&&typeof window<"u"){tI();const P=nI(b);y=P.MeasureLayout,S.visualElement=XO(e,T,b,s,P.ProjectionNode,o)}return I.jsxs(Cc.Provider,{value:S,children:[y&&S.visualElement?I.jsx(y,{visualElement:S.visualElement,...b}):null,WO(e,f,QO(T,S.visualElement,m),T,w,t,o)]})}c.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const h=k.forwardRef(c);return h[ZO]=e,h}function eI({layoutId:e}){const t=k.useContext(Sp).id;return t&&e!==void 0?t+"-"+e:e}function tI(e,t){k.useContext(Gw).strict}function nI(e){const t=Yw(),{drag:n,layout:a}=t;if(!n&&!a)return{};const s={...n,...a};return{MeasureLayout:n?.isEnabled(e)||a?.isEnabled(e)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}function rI(e,t){if(typeof Proxy>"u")return Fh;const n=new Map,a=(o,u)=>Fh(o,u,e,t),s=(o,u)=>a(o,u);return new Proxy(s,{get:(o,u)=>u==="create"?a:(n.has(u)||n.set(u,Fh(u,void 0,e,t)),n.get(u))})}const aI=(e,t)=>t.isSVG??Xp(e)?new MN(t):new CN(t,{allowProjection:e!==k.Fragment});class iI extends Ia{constructor(t){super(t),t.animationState||(t.animationState=UN(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Pc(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 sI=0;class oI extends Ia{constructor(){super(...arguments),this.id=sI++,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:o,custom:u}=this.node.getProps();if(typeof o=="string"){const c=si(this.node,o,u);if(c){const{transition:h,transitionEnd:f,...m}=c;for(const y in m)this.node.getValue(y)?.jump(m[y])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const s=this.node.animationState.setActive("exit",!t);n&&!t&&s.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 lI={animation:{Feature:iI},exit:{Feature:oI}};function Zo(e){return{point:{x:e.pageX,y:e.pageY}}}const uI=e=>t=>Hp(t)&&e(t,Zo(t));function To(e,t,n,a){return Oo(e,t,uI(n),a)}const nx=({current:e})=>e?e.ownerDocument.defaultView:null,J0=(e,t)=>Math.abs(e-t);function cI(e,t){const n=J0(e.x,t.x),a=J0(e.y,t.y);return Math.sqrt(n**2+a**2)}const eb=new Set(["auto","scroll"]);class rx{constructor(t,n,{transformPagePoint:a,contextWindow:s=window,dragSnapToOrigin:o=!1,distanceThreshold:u=3,element:c}={}){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=w=>{this.handleScroll(w.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=mu(this.lastRawMoveEventInfo,this.transformPagePoint));const w=Vh(this.lastMoveEventInfo,this.history),S=this.startEvent!==null,T=cI(w.offset,{x:0,y:0})>=this.distanceThreshold;if(!S&&!T)return;const{point:P}=w,{timestamp:L}=Kt;this.history.push({...P,timestamp:L});const{onStart:D,onMove:M}=this.handlers;S||(D&&D(this.lastMoveEvent,w),this.startEvent=this.lastMoveEvent),M&&M(this.lastMoveEvent,w)},this.handlePointerMove=(w,S)=>{this.lastMoveEvent=w,this.lastRawMoveEventInfo=S,this.lastMoveEventInfo=mu(S,this.transformPagePoint),dt.update(this.updatePoint,!0)},this.handlePointerUp=(w,S)=>{this.end();const{onEnd:T,onSessionEnd:P,resumeAnimation:L}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&L&&L(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const D=Vh(w.type==="pointercancel"?this.lastMoveEventInfo:mu(S,this.transformPagePoint),this.history);this.startEvent&&T&&T(w,D),P&&P(w,D)},!Hp(t))return;this.dragSnapToOrigin=o,this.handlers=n,this.transformPagePoint=a,this.distanceThreshold=u,this.contextWindow=s||window;const h=Zo(t),f=mu(h,this.transformPagePoint),{point:m}=f,{timestamp:y}=Kt;this.history=[{...m,timestamp:y}];const{onSessionStart:b}=n;b&&b(t,Vh(f,this.history)),this.removeListeners=qo(To(this.contextWindow,"pointermove",this.handlePointerMove),To(this.contextWindow,"pointerup",this.handlePointerUp),To(this.contextWindow,"pointercancel",this.handlePointerUp)),c&&this.startScrollTracking(c)}startScrollTracking(t){let n=t.parentElement;for(;n;){const a=getComputedStyle(n);(eb.has(a.overflowX)||eb.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,s=a?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},o={x:s.x-n.x,y:s.y-n.y};o.x===0&&o.y===0||(a?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=o.x,this.lastMoveEventInfo.point.y+=o.y):this.history.length>0&&(this.history[0].x-=o.x,this.history[0].y-=o.y),this.scrollPositions.set(t,s),dt.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Na(this.updatePoint)}}function mu(e,t){return t?{point:t(e.point)}:e}function tb(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Vh({point:e},t){return{point:e,delta:tb(e,ax(t)),offset:tb(e,dI(t)),velocity:hI(t,.1)}}function dI(e){return e[0]}function ax(e){return e[e.length-1]}function hI(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,a=null;const s=ax(e);for(;n>=0&&(a=e[n],!(s.timestamp-a.timestamp>Sn(t)));)n--;if(!a)return{x:0,y:0};a===e[0]&&e.length>2&&s.timestamp-a.timestamp>Sn(t)*2&&(a=e[1]);const o=In(s.timestamp-a.timestamp);if(o===0)return{x:0,y:0};const u={x:(s.x-a.x)/o,y:(s.y-a.y)/o};return u.x===1/0&&(u.x=0),u.y===1/0&&(u.y=0),u}function fI(e,{min:t,max:n},a){return t!==void 0&&e<t?e=a?vt(t,e,a.min):Math.max(e,t):n!==void 0&&e>n&&(e=a?vt(n,e,a.max):Math.min(e,n)),e}function nb(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 pI(e,{top:t,left:n,bottom:a,right:s}){return{x:nb(e.x,n,s),y:nb(e.y,t,a)}}function rb(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 mI(e,t){return{x:rb(e.x,t.x),y:rb(e.y,t.y)}}function gI(e,t){let n=.5;const a=ln(e),s=ln(t);return s>a?n=Do(t.min,t.max-a,e.min):a>s&&(n=Do(e.min,e.max-s,t.min)),xr(0,1,n)}function yI(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 Bf=.35;function vI(e=Bf){return e===!1?e=0:e===!0&&(e=Bf),{x:ab(e,"left","right"),y:ab(e,"top","bottom")}}function ab(e,t,n){return{min:ib(e,t),max:ib(e,n)}}function ib(e,t){return typeof e=="number"?e:e[t]||0}const bI=new WeakMap;class _I{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=It(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:a}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const o=y=>{n&&this.snapToCursor(Zo(y).point),this.stopAnimation()},u=(y,b)=>{const{drag:w,dragPropagation:S,onDragStart:T}=this.getProps();if(w&&!S&&(this.openDragLock&&this.openDragLock(),this.openDragLock=K2(w),!this.openDragLock))return;this.latestPointerEvent=y,this.latestPanInfo=b,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),fr(L=>{let D=this.getAxisMotionValue(L).get()||0;if(vr.test(D)){const{projection:M}=this.visualElement;if(M&&M.layout){const j=M.layout.layoutBox[L];j&&(D=ln(j)*(parseFloat(D)/100))}}this.originPoint[L]=D}),T&&dt.update(()=>T(y,b),!1,!0),Rf(this.visualElement,"transform");const{animationState:P}=this.visualElement;P&&P.setActive("whileDrag",!0)},c=(y,b)=>{this.latestPointerEvent=y,this.latestPanInfo=b;const{dragPropagation:w,dragDirectionLock:S,onDirectionLock:T,onDrag:P}=this.getProps();if(!w&&!this.openDragLock)return;const{offset:L}=b;if(S&&this.currentDirection===null){this.currentDirection=wI(L),this.currentDirection!==null&&T&&T(this.currentDirection);return}this.updateAxis("x",b.point,L),this.updateAxis("y",b.point,L),this.visualElement.render(),P&&dt.update(()=>P(y,b),!1,!0)},h=(y,b)=>{this.latestPointerEvent=y,this.latestPanInfo=b,this.stop(y,b),this.latestPointerEvent=null,this.latestPanInfo=null},f=()=>{const{dragSnapToOrigin:y}=this.getProps();(y||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:m}=this.getProps();this.panSession=new rx(t,{onSessionStart:o,onStart:u,onMove:c,onSessionEnd:h,resumeAnimation:f},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:m,distanceThreshold:a,contextWindow:nx(this.visualElement),element:this.visualElement.current})}stop(t,n){const a=t||this.latestPointerEvent,s=n||this.latestPanInfo,o=this.isDragging;if(this.cancel(),!o||!s||!a)return;const{velocity:u}=s;this.startAnimation(u);const{onDragEnd:c}=this.getProps();c&&dt.postRender(()=>c(a,s))}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:s}=this.getProps();if(!a||!gu(t,s,this.currentDirection))return;const o=this.getAxisMotionValue(t);let u=this.originPoint[t]+a[t];this.constraints&&this.constraints[t]&&(u=fI(u,this.constraints[t],this.elastic[t])),o.set(u)}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,s=this.constraints;t&&ts(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&a?this.constraints=pI(a.layoutBox,t):this.constraints=!1,this.elastic=vI(n),s!==this.constraints&&!ts(t)&&a&&this.constraints&&!this.hasMutatedConstraints&&fr(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=yI(a.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!ts(t))return!1;const a=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const o=kN(a,s.root,this.visualElement.getTransformPagePoint());let u=mI(s.layout.layoutBox,o);if(n){const c=n(vN(u));this.hasMutatedConstraints=!!c,c&&(u=Pw(c))}return u}startAnimation(t){const{drag:n,dragMomentum:a,dragElastic:s,dragTransition:o,dragSnapToOrigin:u,onDragTransitionEnd:c}=this.getProps(),h=this.constraints||{},f=fr(m=>{if(!gu(m,n,this.currentDirection))return;let y=h&&h[m]||{};(u===!0||u===m)&&(y={min:0,max:0});const b=s?200:1e6,w=s?40:1e7,S={type:"inertia",velocity:a?t[m]:0,bounceStiffness:b,bounceDamping:w,timeConstant:750,restDelta:1,restSpeed:10,...o,...y};return this.startAxisValueAnimation(m,S)});return Promise.all(f).then(c)}startAxisValueAnimation(t,n){const a=this.getAxisMotionValue(t);return Rf(this.visualElement,t),a.start(Bp(t,a,0,n,this.visualElement,!1))}stopAnimation(){fr(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,a=this.visualElement.getProps(),s=a[n];return s||this.visualElement.getValue(t,(a.initial?a.initial[t]:void 0)||0)}snapToCursor(t){fr(n=>{const{drag:a}=this.getProps();if(!gu(n,a,this.currentDirection))return;const{projection:s}=this.visualElement,o=this.getAxisMotionValue(n);if(s&&s.layout){const{min:u,max:c}=s.layout.layoutBox[n],h=o.get()||0;o.set(t[n]-vt(u,c,.5)+h)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:a}=this.visualElement;if(!ts(n)||!a||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};fr(u=>{const c=this.getAxisMotionValue(u);if(c&&this.constraints!==!1){const h=c.get();s[u]=gI({min:h,max:h},this.constraints[u])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",a.root&&a.root.updateScroll(),a.updateLayout(),this.constraints=!1,this.resolveConstraints(),fr(u=>{if(!gu(u,t,null))return;const c=this.getAxisMotionValue(u),{min:h,max:f}=this.constraints[u];c.set(vt(h,f,s[u]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;bI.set(this.visualElement,this);const t=this.visualElement.current,n=To(t,"pointerdown",f=>{const{drag:m,dragListener:y=!0}=this.getProps(),b=f.target,w=b!==t&&X2(b);m&&y&&!w&&this.start(f)});let a;const s=()=>{const{dragConstraints:f}=this.getProps();ts(f)&&f.current&&(this.constraints=this.resolveRefConstraints(),a||(a=kI(t,f.current,()=>this.scalePositionWithinConstraints())))},{projection:o}=this.visualElement,u=o.addEventListener("measure",s);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),dt.read(s);const c=Oo(window,"resize",()=>this.scalePositionWithinConstraints()),h=o.addEventListener("didUpdate",(({delta:f,hasLayoutChanged:m})=>{this.isDragging&&m&&(fr(y=>{const b=this.getAxisMotionValue(y);b&&(this.originPoint[y]+=f[y].translate,b.set(b.get()+f[y].translate))}),this.visualElement.render())}));return()=>{c(),n(),u(),h&&h(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:a=!1,dragPropagation:s=!1,dragConstraints:o=!1,dragElastic:u=Bf,dragMomentum:c=!0}=t;return{...t,drag:n,dragDirectionLock:a,dragPropagation:s,dragConstraints:o,dragElastic:u,dragMomentum:c}}}function sb(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function kI(e,t,n){const a=f0(e,sb(n)),s=f0(t,sb(n));return()=>{a(),s()}}function gu(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function wI(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class xI extends Ia{constructor(t){super(t),this.removeGroupControls=jn,this.removeListeners=jn,this.controls=new _I(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||jn}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 zh=e=>(t,n)=>{e&&dt.update(()=>e(t,n),!1,!0)};class SI extends Ia{constructor(){super(...arguments),this.removePointerDownListener=jn}onPointerDown(t){this.session=new rx(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:nx(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:a,onPanEnd:s}=this.node.getProps();return{onSessionStart:zh(t),onStart:zh(n),onMove:zh(a),onEnd:(o,u)=>{delete this.session,s&&dt.postRender(()=>s(o,u))}}}mount(){this.removePointerDownListener=To(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 $h=!1;class PI extends k.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:a,layoutId:s}=this.props,{projection:o}=t;o&&(n.group&&n.group.add(o),a&&a.register&&s&&a.register(o),$h&&o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),ju.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:a,drag:s,isPresent:o}=this.props,{projection:u}=a;return u&&(u.isPresent=o,t.layoutDependency!==n&&u.setOptions({...u.options,layoutDependency:n}),$h=!0,s||t.layoutDependency!==n||n===void 0||t.isPresent!==o?u.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?u.promote():u.relegate()||dt.postRender(()=>{const c=u.getStack();(!c||!c.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:t,layoutAnchor:n}=this.props,{projection:a}=t;a&&(a.options.layoutAnchor=n,a.root.didUpdate(),$p.postRender(()=>{!a.currentAnimation&&a.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:a}=this.props,{projection:s}=t;$h=!0,s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),a&&a.deregister&&a.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function ix(e){const[t,n]=qw(),a=k.useContext(Sp);return I.jsx(PI,{...e,layoutGroup:a,switchLayoutGroup:k.useContext(ex),isPresent:t,safeToRemove:n})}const TI={pan:{Feature:SI},drag:{Feature:xI,ProjectionNode:Kw,MeasureLayout:ix}};function ob(e,t,n){const{props:a}=e;e.animationState&&a.whileHover&&e.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,o=a[s];o&&dt.postRender(()=>o(t,Zo(t)))}class CI extends Ia{mount(){const{current:t}=this.node;t&&(this.unmount=G2(t,(n,a)=>(ob(this.node,a,"Start"),s=>ob(this.node,s,"End"))))}unmount(){}}class EI extends Ia{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=qo(Oo(this.node.current,"focus",()=>this.onFocus()),Oo(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function lb(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 s="onTap"+(n==="End"?"":n),o=a[s];o&&dt.postRender(()=>o(t,Zo(t)))}class AI extends Ia{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:a}=this.node.props;this.unmount=eN(t,(s,o)=>(lb(this.node,o,"Start"),(u,{success:c})=>lb(this.node,u,c?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:a?.tap===!1})}unmount(){}}const Ff=new WeakMap,Hh=new WeakMap,RI=e=>{const t=Ff.get(e.target);t&&t(e)},LI=e=>{e.forEach(RI)};function DI({root:e,...t}){const n=e||document;Hh.has(n)||Hh.set(n,{});const a=Hh.get(n),s=JSON.stringify(t);return a[s]||(a[s]=new IntersectionObserver(LI,{root:e,...t})),a[s]}function MI(e,t,n){const a=DI(t);return Ff.set(e,n),a.observe(e),()=>{Ff.delete(e),a.unobserve(e)}}const NI={some:0,all:1};class OI extends Ia{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();const{viewport:t={}}=this.node.getProps(),{root:n,margin:a,amount:s="some",once:o}=t,u={root:n?n.current:void 0,rootMargin:a,threshold:typeof s=="number"?s:NI[s]},c=h=>{const{isIntersecting:f}=h;if(this.isInView===f||(this.isInView=f,o&&!f&&this.hasEnteredView))return;f&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",f);const{onViewportEnter:m,onViewportLeave:y}=this.node.getProps(),b=f?m:y;b&&b(h)};this.stopObserver=MI(this.node.current,u,c)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(II(t,n))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}function II({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const jI={inView:{Feature:OI},tap:{Feature:AI},focus:{Feature:EI},hover:{Feature:CI}},UI={layout:{ProjectionNode:Kw,MeasureLayout:ix}},BI={...lI,...jI,...TI,...UI},Wh=rI(BI,aI);function sx(e){var t,n,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=sx(e[t]))&&(a&&(a+=" "),a+=n)}else for(n in e)e[n]&&(a&&(a+=" "),a+=n);return a}function FI(){for(var e,t,n=0,a="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=sx(e))&&(a&&(a+=" "),a+=t);return a}const VI=(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},zI=(e,t)=>({classGroupId:e,validator:t}),ox=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),cc="-",ub=[],$I="arbitrary..",HI=e=>{const t=KI(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:u=>{if(u.startsWith("[")&&u.endsWith("]"))return WI(u);const c=u.split(cc),h=c[0]===""&&c.length>1?1:0;return lx(c,h,t)},getConflictingClassGroupIds:(u,c)=>{if(c){const h=a[u],f=n[u];return h?f?VI(f,h):h:f||ub}return n[u]||ub}}},lx=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const s=e[t],o=n.nextPart.get(s);if(o){const f=lx(e,t+1,o);if(f)return f}const u=n.validators;if(u===null)return;const c=t===0?e.join(cc):e.slice(t).join(cc),h=u.length;for(let f=0;f<h;f++){const m=u[f];if(m.validator(c))return m.classGroupId}},WI=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?$I+a:void 0})(),KI=e=>{const{theme:t,classGroups:n}=e;return qI(n,t)},qI=(e,t)=>{const n=ox();for(const a in e){const s=e[a];Jp(s,n,a,t)}return n},Jp=(e,t,n,a)=>{const s=e.length;for(let o=0;o<s;o++){const u=e[o];GI(u,t,n,a)}},GI=(e,t,n,a)=>{if(typeof e=="string"){YI(e,t,n);return}if(typeof e=="function"){ZI(e,t,n,a);return}QI(e,t,n,a)},YI=(e,t,n)=>{const a=e===""?t:ux(t,e);a.classGroupId=n},ZI=(e,t,n,a)=>{if(XI(e)){Jp(e(a),t,n,a);return}t.validators===null&&(t.validators=[]),t.validators.push(zI(n,e))},QI=(e,t,n,a)=>{const s=Object.entries(e),o=s.length;for(let u=0;u<o;u++){const[c,h]=s[u];Jp(h,ux(t,c),n,a)}},ux=(e,t)=>{let n=e;const a=t.split(cc),s=a.length;for(let o=0;o<s;o++){const u=a[o];let c=n.nextPart.get(u);c||(c=ox(),n.nextPart.set(u,c)),n=c}return n},XI=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,JI=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),a=Object.create(null);const s=(o,u)=>{n[o]=u,t++,t>e&&(t=0,a=n,n=Object.create(null))};return{get(o){let u=n[o];if(u!==void 0)return u;if((u=a[o])!==void 0)return s(o,u),u},set(o,u){o in n?n[o]=u:s(o,u)}}},Vf="!",cb=":",e3=[],db=(e,t,n,a,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:a,isExternal:s}),t3=e=>{const{prefix:t,experimentalParseClassName:n}=e;let a=s=>{const o=[];let u=0,c=0,h=0,f;const m=s.length;for(let T=0;T<m;T++){const P=s[T];if(u===0&&c===0){if(P===cb){o.push(s.slice(h,T)),h=T+1;continue}if(P==="/"){f=T;continue}}P==="["?u++:P==="]"?u--:P==="("?c++:P===")"&&c--}const y=o.length===0?s:s.slice(h);let b=y,w=!1;y.endsWith(Vf)?(b=y.slice(0,-1),w=!0):y.startsWith(Vf)&&(b=y.slice(1),w=!0);const S=f&&f>h?f-h:void 0;return db(o,w,b,S)};if(t){const s=t+cb,o=a;a=u=>u.startsWith(s)?o(u.slice(s.length)):db(e3,!1,u,void 0,!0)}if(n){const s=a;a=o=>n({className:o,parseClassName:s})}return a},n3=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,a)=>{t.set(n,1e6+a)}),n=>{const a=[];let s=[];for(let o=0;o<n.length;o++){const u=n[o],c=u[0]==="[",h=t.has(u);c||h?(s.length>0&&(s.sort(),a.push(...s),s=[]),a.push(u)):s.push(u)}return s.length>0&&(s.sort(),a.push(...s)),a}},r3=e=>({cache:JI(e.cacheSize),parseClassName:t3(e),sortModifiers:n3(e),...HI(e)}),a3=/\s+/,i3=(e,t)=>{const{parseClassName:n,getClassGroupId:a,getConflictingClassGroupIds:s,sortModifiers:o}=t,u=[],c=e.trim().split(a3);let h="";for(let f=c.length-1;f>=0;f-=1){const m=c[f],{isExternal:y,modifiers:b,hasImportantModifier:w,baseClassName:S,maybePostfixModifierPosition:T}=n(m);if(y){h=m+(h.length>0?" "+h:h);continue}let P=!!T,L=a(P?S.substring(0,T):S);if(!L){if(!P){h=m+(h.length>0?" "+h:h);continue}if(L=a(S),!L){h=m+(h.length>0?" "+h:h);continue}P=!1}const D=b.length===0?"":b.length===1?b[0]:o(b).join(":"),M=w?D+Vf:D,j=M+L;if(u.indexOf(j)>-1)continue;u.push(j);const q=s(L,P);for(let K=0;K<q.length;++K){const H=q[K];u.push(M+H)}h=m+(h.length>0?" "+h:h)}return h},s3=(...e)=>{let t=0,n,a,s="";for(;t<e.length;)(n=e[t++])&&(a=cx(n))&&(s&&(s+=" "),s+=a);return s},cx=e=>{if(typeof e=="string")return e;let t,n="";for(let a=0;a<e.length;a++)e[a]&&(t=cx(e[a]))&&(n&&(n+=" "),n+=t);return n},o3=(e,...t)=>{let n,a,s,o;const u=h=>{const f=t.reduce((m,y)=>y(m),e());return n=r3(f),a=n.cache.get,s=n.cache.set,o=c,c(h)},c=h=>{const f=a(h);if(f)return f;const m=i3(h,n);return s(h,m),m};return o=u,(...h)=>o(s3(...h))},l3=[],Ot=e=>{const t=n=>n[e]||l3;return t.isThemeGetter=!0,t},dx=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,hx=/^\((?:(\w[\w-]*):)?(.+)\)$/i,u3=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,c3=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,d3=/\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$/,h3=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,f3=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,p3=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,wa=e=>u3.test(e),Ge=e=>!!e&&!Number.isNaN(Number(e)),xa=e=>!!e&&Number.isInteger(Number(e)),Kh=e=>e.endsWith("%")&&Ge(e.slice(0,-1)),Fr=e=>c3.test(e),fx=()=>!0,m3=e=>d3.test(e)&&!h3.test(e),em=()=>!1,g3=e=>f3.test(e),y3=e=>p3.test(e),v3=e=>!be(e)&&!ke(e),b3=e=>ja(e,gx,em),be=e=>dx.test(e),Ja=e=>ja(e,yx,m3),hb=e=>ja(e,C3,Ge),_3=e=>ja(e,bx,fx),k3=e=>ja(e,vx,em),fb=e=>ja(e,px,em),w3=e=>ja(e,mx,y3),yu=e=>ja(e,_x,g3),ke=e=>hx.test(e),mo=e=>gi(e,yx),x3=e=>gi(e,vx),pb=e=>gi(e,px),S3=e=>gi(e,gx),P3=e=>gi(e,mx),vu=e=>gi(e,_x,!0),T3=e=>gi(e,bx,!0),ja=(e,t,n)=>{const a=dx.exec(e);return a?a[1]?t(a[1]):n(a[2]):!1},gi=(e,t,n=!1)=>{const a=hx.exec(e);return a?a[1]?t(a[1]):n:!1},px=e=>e==="position"||e==="percentage",mx=e=>e==="image"||e==="url",gx=e=>e==="length"||e==="size"||e==="bg-size",yx=e=>e==="length",C3=e=>e==="number",vx=e=>e==="family-name",bx=e=>e==="number"||e==="weight",_x=e=>e==="shadow",E3=()=>{const e=Ot("color"),t=Ot("font"),n=Ot("text"),a=Ot("font-weight"),s=Ot("tracking"),o=Ot("leading"),u=Ot("breakpoint"),c=Ot("container"),h=Ot("spacing"),f=Ot("radius"),m=Ot("shadow"),y=Ot("inset-shadow"),b=Ot("text-shadow"),w=Ot("drop-shadow"),S=Ot("blur"),T=Ot("perspective"),P=Ot("aspect"),L=Ot("ease"),D=Ot("animate"),M=()=>["auto","avoid","all","avoid-page","page","left","right","column"],j=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],q=()=>[...j(),ke,be],K=()=>["auto","hidden","clip","visible","scroll"],H=()=>["auto","contain","none"],x=()=>[ke,be,h],Z=()=>[wa,"full","auto",...x()],Q=()=>[xa,"none","subgrid",ke,be],me=()=>["auto",{span:["full",xa,ke,be]},xa,ke,be],oe=()=>[xa,"auto",ke,be],Ae=()=>["auto","min","max","fr",ke,be],fe=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ce=()=>["start","end","center","stretch","center-safe","end-safe"],le=()=>["auto",...x()],Me=()=>[wa,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...x()],W=()=>[wa,"screen","full","dvw","lvw","svw","min","max","fit",...x()],Y=()=>[wa,"screen","full","lh","dvh","lvh","svh","min","max","fit",...x()],$=()=>[e,ke,be],N=()=>[...j(),pb,fb,{position:[ke,be]}],G=()=>["no-repeat",{repeat:["","x","y","space","round"]}],xe=()=>["auto","cover","contain",S3,b3,{size:[ke,be]}],Re=()=>[Kh,mo,Ja],Se=()=>["","none","full",f,ke,be],Ce=()=>["",Ge,mo,Ja],qe=()=>["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=()=>[Ge,Kh,pb,fb],jt=()=>["","none",S,ke,be],Hn=()=>["none",Ge,ke,be],Tr=()=>["none",Ge,ke,be],pt=()=>[Ge,ke,be],en=()=>[wa,"full",...x()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Fr],breakpoint:[Fr],color:[fx],container:[Fr],"drop-shadow":[Fr],ease:["in","out","in-out"],font:[v3],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Fr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Fr],shadow:[Fr],spacing:["px",Ge],text:[Fr],"text-shadow":[Fr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",wa,be,ke,P]}],container:["container"],columns:[{columns:[Ge,be,ke,c]}],"break-after":[{"break-after":M()}],"break-before":[{"break-before":M()}],"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:q()}],overflow:[{overflow:K()}],"overflow-x":[{"overflow-x":K()}],"overflow-y":[{"overflow-y":K()}],overscroll:[{overscroll:H()}],"overscroll-x":[{"overscroll-x":H()}],"overscroll-y":[{"overscroll-y":H()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:Z()}],"inset-x":[{"inset-x":Z()}],"inset-y":[{"inset-y":Z()}],start:[{"inset-s":Z(),start:Z()}],end:[{"inset-e":Z(),end:Z()}],"inset-bs":[{"inset-bs":Z()}],"inset-be":[{"inset-be":Z()}],top:[{top:Z()}],right:[{right:Z()}],bottom:[{bottom:Z()}],left:[{left:Z()}],visibility:["visible","invisible","collapse"],z:[{z:[xa,"auto",ke,be]}],basis:[{basis:[wa,"full","auto",c,...x()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ge,wa,"auto","initial","none",be]}],grow:[{grow:["",Ge,ke,be]}],shrink:[{shrink:["",Ge,ke,be]}],order:[{order:[xa,"first","last","none",ke,be]}],"grid-cols":[{"grid-cols":Q()}],"col-start-end":[{col:me()}],"col-start":[{"col-start":oe()}],"col-end":[{"col-end":oe()}],"grid-rows":[{"grid-rows":Q()}],"row-start-end":[{row:me()}],"row-start":[{"row-start":oe()}],"row-end":[{"row-end":oe()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Ae()}],"auto-rows":[{"auto-rows":Ae()}],gap:[{gap:x()}],"gap-x":[{"gap-x":x()}],"gap-y":[{"gap-y":x()}],"justify-content":[{justify:[...fe(),"normal"]}],"justify-items":[{"justify-items":[...ce(),"normal"]}],"justify-self":[{"justify-self":["auto",...ce()]}],"align-content":[{content:["normal",...fe()]}],"align-items":[{items:[...ce(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ce(),{baseline:["","last"]}]}],"place-content":[{"place-content":fe()}],"place-items":[{"place-items":[...ce(),"baseline"]}],"place-self":[{"place-self":["auto",...ce()]}],p:[{p:x()}],px:[{px:x()}],py:[{py:x()}],ps:[{ps:x()}],pe:[{pe:x()}],pbs:[{pbs:x()}],pbe:[{pbe:x()}],pt:[{pt:x()}],pr:[{pr:x()}],pb:[{pb:x()}],pl:[{pl:x()}],m:[{m:le()}],mx:[{mx:le()}],my:[{my:le()}],ms:[{ms:le()}],me:[{me:le()}],mbs:[{mbs:le()}],mbe:[{mbe:le()}],mt:[{mt:le()}],mr:[{mr:le()}],mb:[{mb:le()}],ml:[{ml:le()}],"space-x":[{"space-x":x()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":x()}],"space-y-reverse":["space-y-reverse"],size:[{size:Me()}],"inline-size":[{inline:["auto",...W()]}],"min-inline-size":[{"min-inline":["auto",...W()]}],"max-inline-size":[{"max-inline":["none",...W()]}],"block-size":[{block:["auto",...Y()]}],"min-block-size":[{"min-block":["auto",...Y()]}],"max-block-size":[{"max-block":["none",...Y()]}],w:[{w:[c,"screen",...Me()]}],"min-w":[{"min-w":[c,"screen","none",...Me()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[u]},...Me()]}],h:[{h:["screen","lh",...Me()]}],"min-h":[{"min-h":["screen","lh","none",...Me()]}],"max-h":[{"max-h":["screen","lh",...Me()]}],"font-size":[{text:["base",n,mo,Ja]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,T3,_3]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Kh,be]}],"font-family":[{font:[x3,k3,t]}],"font-features":[{"font-features":[be]}],"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:[s,ke,be]}],"line-clamp":[{"line-clamp":[Ge,"none",ke,hb]}],leading:[{leading:[o,...x()]}],"list-image":[{"list-image":["none",ke,be]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ke,be]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:$()}],"text-color":[{text:$()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...qe(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ge,"from-font","auto",ke,Ja]}],"text-decoration-color":[{decoration:$()}],"underline-offset":[{"underline-offset":[Ge,"auto",ke,be]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:x()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ke,be]}],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",ke,be]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:N()}],"bg-repeat":[{bg:G()}],"bg-size":[{bg:xe()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},xa,ke,be],radial:["",ke,be],conic:[xa,ke,be]},P3,w3]}],"bg-color":[{bg:$()}],"gradient-from-pos":[{from:Re()}],"gradient-via-pos":[{via:Re()}],"gradient-to-pos":[{to:Re()}],"gradient-from":[{from:$()}],"gradient-via":[{via:$()}],"gradient-to":[{to:$()}],rounded:[{rounded:Se()}],"rounded-s":[{"rounded-s":Se()}],"rounded-e":[{"rounded-e":Se()}],"rounded-t":[{"rounded-t":Se()}],"rounded-r":[{"rounded-r":Se()}],"rounded-b":[{"rounded-b":Se()}],"rounded-l":[{"rounded-l":Se()}],"rounded-ss":[{"rounded-ss":Se()}],"rounded-se":[{"rounded-se":Se()}],"rounded-ee":[{"rounded-ee":Se()}],"rounded-es":[{"rounded-es":Se()}],"rounded-tl":[{"rounded-tl":Se()}],"rounded-tr":[{"rounded-tr":Se()}],"rounded-br":[{"rounded-br":Se()}],"rounded-bl":[{"rounded-bl":Se()}],"border-w":[{border:Ce()}],"border-w-x":[{"border-x":Ce()}],"border-w-y":[{"border-y":Ce()}],"border-w-s":[{"border-s":Ce()}],"border-w-e":[{"border-e":Ce()}],"border-w-bs":[{"border-bs":Ce()}],"border-w-be":[{"border-be":Ce()}],"border-w-t":[{"border-t":Ce()}],"border-w-r":[{"border-r":Ce()}],"border-w-b":[{"border-b":Ce()}],"border-w-l":[{"border-l":Ce()}],"divide-x":[{"divide-x":Ce()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Ce()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...qe(),"hidden","none"]}],"divide-style":[{divide:[...qe(),"hidden","none"]}],"border-color":[{border:$()}],"border-color-x":[{"border-x":$()}],"border-color-y":[{"border-y":$()}],"border-color-s":[{"border-s":$()}],"border-color-e":[{"border-e":$()}],"border-color-bs":[{"border-bs":$()}],"border-color-be":[{"border-be":$()}],"border-color-t":[{"border-t":$()}],"border-color-r":[{"border-r":$()}],"border-color-b":[{"border-b":$()}],"border-color-l":[{"border-l":$()}],"divide-color":[{divide:$()}],"outline-style":[{outline:[...qe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ge,ke,be]}],"outline-w":[{outline:["",Ge,mo,Ja]}],"outline-color":[{outline:$()}],shadow:[{shadow:["","none",m,vu,yu]}],"shadow-color":[{shadow:$()}],"inset-shadow":[{"inset-shadow":["none",y,vu,yu]}],"inset-shadow-color":[{"inset-shadow":$()}],"ring-w":[{ring:Ce()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:$()}],"ring-offset-w":[{"ring-offset":[Ge,Ja]}],"ring-offset-color":[{"ring-offset":$()}],"inset-ring-w":[{"inset-ring":Ce()}],"inset-ring-color":[{"inset-ring":$()}],"text-shadow":[{"text-shadow":["none",b,vu,yu]}],"text-shadow-color":[{"text-shadow":$()}],opacity:[{opacity:[Ge,ke,be]}],"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":[Ge]}],"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":$()}],"mask-image-linear-to-color":[{"mask-linear-to":$()}],"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":$()}],"mask-image-t-to-color":[{"mask-t-to":$()}],"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":$()}],"mask-image-r-to-color":[{"mask-r-to":$()}],"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":$()}],"mask-image-b-to-color":[{"mask-b-to":$()}],"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":$()}],"mask-image-l-to-color":[{"mask-l-to":$()}],"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":$()}],"mask-image-x-to-color":[{"mask-x-to":$()}],"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":$()}],"mask-image-y-to-color":[{"mask-y-to":$()}],"mask-image-radial":[{"mask-radial":[ke,be]}],"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":$()}],"mask-image-radial-to-color":[{"mask-radial-to":$()}],"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":j()}],"mask-image-conic-pos":[{"mask-conic":[Ge]}],"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":$()}],"mask-image-conic-to-color":[{"mask-conic-to":$()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:N()}],"mask-repeat":[{mask:G()}],"mask-size":[{mask:xe()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ke,be]}],filter:[{filter:["","none",ke,be]}],blur:[{blur:jt()}],brightness:[{brightness:[Ge,ke,be]}],contrast:[{contrast:[Ge,ke,be]}],"drop-shadow":[{"drop-shadow":["","none",w,vu,yu]}],"drop-shadow-color":[{"drop-shadow":$()}],grayscale:[{grayscale:["",Ge,ke,be]}],"hue-rotate":[{"hue-rotate":[Ge,ke,be]}],invert:[{invert:["",Ge,ke,be]}],saturate:[{saturate:[Ge,ke,be]}],sepia:[{sepia:["",Ge,ke,be]}],"backdrop-filter":[{"backdrop-filter":["","none",ke,be]}],"backdrop-blur":[{"backdrop-blur":jt()}],"backdrop-brightness":[{"backdrop-brightness":[Ge,ke,be]}],"backdrop-contrast":[{"backdrop-contrast":[Ge,ke,be]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ge,ke,be]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ge,ke,be]}],"backdrop-invert":[{"backdrop-invert":["",Ge,ke,be]}],"backdrop-opacity":[{"backdrop-opacity":[Ge,ke,be]}],"backdrop-saturate":[{"backdrop-saturate":[Ge,ke,be]}],"backdrop-sepia":[{"backdrop-sepia":["",Ge,ke,be]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":x()}],"border-spacing-x":[{"border-spacing-x":x()}],"border-spacing-y":[{"border-spacing-y":x()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ke,be]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ge,"initial",ke,be]}],ease:[{ease:["linear","initial",L,ke,be]}],delay:[{delay:[Ge,ke,be]}],animate:[{animate:["none",D,ke,be]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[T,ke,be]}],"perspective-origin":[{"perspective-origin":q()}],rotate:[{rotate:Hn()}],"rotate-x":[{"rotate-x":Hn()}],"rotate-y":[{"rotate-y":Hn()}],"rotate-z":[{"rotate-z":Hn()}],scale:[{scale:Tr()}],"scale-x":[{"scale-x":Tr()}],"scale-y":[{"scale-y":Tr()}],"scale-z":[{"scale-z":Tr()}],"scale-3d":["scale-3d"],skew:[{skew:pt()}],"skew-x":[{"skew-x":pt()}],"skew-y":[{"skew-y":pt()}],transform:[{transform:[ke,be,"","none","gpu","cpu"]}],"transform-origin":[{origin:q()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:en()}],"translate-x":[{"translate-x":en()}],"translate-y":[{"translate-y":en()}],"translate-z":[{"translate-z":en()}],"translate-none":["translate-none"],accent:[{accent:$()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:$()}],"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",ke,be]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":x()}],"scroll-mx":[{"scroll-mx":x()}],"scroll-my":[{"scroll-my":x()}],"scroll-ms":[{"scroll-ms":x()}],"scroll-me":[{"scroll-me":x()}],"scroll-mbs":[{"scroll-mbs":x()}],"scroll-mbe":[{"scroll-mbe":x()}],"scroll-mt":[{"scroll-mt":x()}],"scroll-mr":[{"scroll-mr":x()}],"scroll-mb":[{"scroll-mb":x()}],"scroll-ml":[{"scroll-ml":x()}],"scroll-p":[{"scroll-p":x()}],"scroll-px":[{"scroll-px":x()}],"scroll-py":[{"scroll-py":x()}],"scroll-ps":[{"scroll-ps":x()}],"scroll-pe":[{"scroll-pe":x()}],"scroll-pbs":[{"scroll-pbs":x()}],"scroll-pbe":[{"scroll-pbe":x()}],"scroll-pt":[{"scroll-pt":x()}],"scroll-pr":[{"scroll-pr":x()}],"scroll-pb":[{"scroll-pb":x()}],"scroll-pl":[{"scroll-pl":x()}],"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",ke,be]}],fill:[{fill:["none",...$()]}],"stroke-w":[{stroke:[Ge,mo,Ja,hb]}],stroke:[{stroke:["none",...$()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{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"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},A3=o3(E3);function Ct(...e){return A3(FI(e))}const R3=I.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",children:[I.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"}),I.jsx("path",{d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23Z",fill:"#34A853"}),I.jsx("path",{d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18A10.96 10.96 0 0 0 1 12c0 1.77.42 3.44 1.18 4.93l3.66-2.84Z",fill:"#FBBC05"}),I.jsx("path",{d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53Z",fill:"#EA4335"})]}),L3=I.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor",children:I.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"})}),D3={google:R3,github:L3},M3={google:"Google",github:"GitHub",microsoft:"Microsoft",discord:"Discord",apple:"Apple"};function N3(e){return M3[e]||String(e||"").replace(/-/g," ")}function O3(){Ko();const{isOpen:e,closeLoginModal:t}=bk(),{enabled:n,signedIn:a,refreshUser:s,signInWithPassword:o,signUp:u,signInWithOAuth:c,getPublicAuthConfig:h}=Ho(),[f,m]=k.useState("signin"),[y,b]=k.useState(""),[w,S]=k.useState(""),[T,P]=k.useState(""),[L,D]=k.useState(!1),[M,j]=k.useState(null),[q,K]=k.useState(null),[H,x]=k.useState(!1),[Z,Q]=k.useState(!0),[me,oe]=k.useState([]),[Ae,fe]=k.useState(8);k.useEffect(()=>{e&&(j(null),K(null),m("signin"),b(""),S(""),P(""),x(!1))},[e]),k.useEffect(()=>{if(!e||!n){Q(!1);return}let W=!0;return(async()=>{const{data:Y,error:$}=await h();if(W){if($||!Y)oe(["google","github"]);else{const N=Array.isArray(Y.oAuthProviders)?Y.oAuthProviders:[],G=Array.isArray(Y.customOAuthProviders)?Y.customOAuthProviders:[];oe([...N,...G]),typeof Y.passwordMinLength=="number"&&Y.passwordMinLength>0&&fe(Y.passwordMinLength)}Q(!1)}})(),()=>{W=!1}},[e,n,h]),k.useEffect(()=>{e&&a&&t()},[e,a,t]);const ce=k.useMemo(()=>typeof window>"u"?"":!!window.webkit?.messageHandlers?.nativeOAuth?`${window.location.origin}/auth/callback`:`${window.location.origin}/`,[]),le=k.useCallback(async W=>{j(null),D(!0);try{const{error:Y}=await c(W,ce);Y&&j(Y.message||String(Y))}finally{D(!1)}},[c,ce]),Me=k.useCallback(async W=>{W.preventDefault(),j(null),D(!0);try{if(f==="signup"){const{data:$,error:N}=await u({email:y.trim(),password:w,name:T.trim()||void 0});if(N){j(N.message||String(N));return}if($?.requireEmailVerification){K(Fe("login.verify_email_pending")),m("signin");return}await s();return}const{error:Y}=await o({email:y.trim(),password:w});if(Y){j(Y.message||String(Y));return}await s()}finally{D(!1)}},[f,y,w,T,u,o,s]);return k.useEffect(()=>{if(!e)return;const W=Y=>{Y.key==="Escape"&&t()};return document.addEventListener("keydown",W),()=>document.removeEventListener("keydown",W)},[e,t]),n?I.jsx(DO,{children:e&&I.jsxs(Wh.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:[I.jsx(Wh.div,{className:"absolute inset-0 bg-black/40 dark:bg-black/60 ",onClick:t,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}}),I.jsxs(Wh.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 p-6 shadow-2xl",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:W=>W.stopPropagation(),children:[I.jsx("button",{type:"button",onClick:t,className:"absolute right-4 top-4 text-oai-gray-400 dark:text-oai-gray-500 hover:text-oai-black dark:hover:text-white transition-colors",children:I.jsx(gk,{className:"h-5 w-5"})}),I.jsxs("div",{className:"text-center mb-6",children:[I.jsxs("div",{className:"flex items-center justify-center gap-2 mb-2",children:[I.jsx("img",{src:"/app-icon.png",alt:"",width:28,height:28,className:"rounded-md"}),I.jsx("span",{className:"text-lg font-semibold text-oai-black dark:text-white",children:"Token Tracker"})]}),I.jsx("p",{className:"text-sm text-oai-gray-500",children:Fe("login_modal.subtitle")})]}),q&&I.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:q}),M&&I.jsx("p",{className:"mb-4 text-sm text-red-500 dark:text-red-400",role:"alert",children:M}),I.jsx("div",{className:"space-y-2.5 mb-5",children:Z?I.jsx("div",{className:"h-10 rounded-lg bg-oai-gray-100 dark:bg-oai-gray-900 animate-pulse"}):me.map(W=>I.jsxs("button",{type:"button",disabled:L,onClick:()=>le(W),className:Ct("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:[D3[W]||null,Fe("login.oauth.continue",{provider:N3(W)})]},W))}),H?I.jsxs(I.Fragment,{children:[I.jsxs("div",{className:"relative mb-5",children:[I.jsx("div",{className:"absolute inset-0 flex items-center",children:I.jsx("span",{className:"w-full border-t border-oai-gray-200 dark:border-oai-gray-800"})}),I.jsx("div",{className:"relative flex justify-center text-xs uppercase tracking-wider",children:I.jsx("span",{className:"bg-white dark:bg-oai-gray-950 px-3 text-oai-gray-400 dark:text-oai-gray-600",children:Fe("login_modal.divider_email")})})]}),I.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:[I.jsx("button",{type:"button",className:Ct("flex-1 py-1.5 text-xs font-medium rounded-md transition-colors",f==="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:()=>{m("signin"),j(null)},children:Fe("login.tab.sign_in")}),I.jsx("button",{type:"button",className:Ct("flex-1 py-1.5 text-xs font-medium rounded-md transition-colors",f==="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:()=>{m("signup"),j(null)},children:Fe("login.tab.sign_up")})]}),I.jsxs("form",{onSubmit:Me,className:"space-y-3",children:[f==="signup"&&I.jsxs("div",{children:[I.jsx("label",{htmlFor:"modal-name",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:Fe("login.field.name")}),I.jsx("input",{id:"modal-name",type:"text",autoComplete:"name",value:T,onChange:W=>P(W.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:Fe("login.field.name_placeholder")})]}),I.jsxs("div",{children:[I.jsx("label",{htmlFor:"modal-email",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:Fe("login.field.email")}),I.jsx("input",{id:"modal-email",type:"email",autoComplete:"email",required:!0,value:y,onChange:W=>b(W.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"})]}),I.jsxs("div",{children:[I.jsx("label",{htmlFor:"modal-password",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:Fe("login.field.password")}),I.jsx("input",{id:"modal-password",type:"password",autoComplete:f==="signup"?"new-password":"current-password",required:!0,minLength:f==="signup"?Ae:void 0,value:w,onChange:W=>S(W.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"}),f==="signup"&&I.jsx("p",{className:"mt-1 text-xs text-oai-gray-400 dark:text-oai-gray-600",children:Fe("login.password_hint",{min:String(Ae)})})]}),I.jsx("button",{type:"submit",disabled:L,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:Fe(f==="signup"?"login.submit.sign_up":"login.submit.sign_in")})]})]}):I.jsxs(I.Fragment,{children:[I.jsxs("div",{className:"relative mb-5",children:[I.jsx("div",{className:"absolute inset-0 flex items-center",children:I.jsx("span",{className:"w-full border-t border-oai-gray-200 dark:border-oai-gray-800"})}),I.jsx("div",{className:"relative flex justify-center text-xs uppercase tracking-wider",children:I.jsx("span",{className:"bg-white dark:bg-oai-gray-950 px-3 text-oai-gray-400 dark:text-oai-gray-600",children:Fe("login.divider")})})]}),I.jsxs("button",{type:"button",onClick:()=>x(!0),className:Ct("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:[I.jsx(yD,{className:"h-[18px] w-[18px] text-oai-gray-500 dark:text-oai-gray-400",strokeWidth:1.75}),Fe("login_modal.continue_email")]})]})]})]})}):null}const I3={VITE_INSFORGE_BASE_URL:"https://srctyff5.us-east.insforge.app"};function j3(){if(typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"))return"";const t=typeof import.meta<"u"?I3:void 0;return(t?.VITE_TOKENTRACKER_BACKEND_BASE_URL||t?.VITE_INSFORGE_BASE_URL||"").trim()}function p4(){return fi()}function U3(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 B3=300*1e3,F3=720*60*1e3;function tm(e){return typeof e=="string"&&/^https?:\/\//i.test(e.trim())}function V3(e,t=Date.now()){if(!e?.token||!e?.deviceId||!e?.issuedAt)return!0;const n=Date.parse(e.issuedAt);return Number.isFinite(n)?n+F3<=t:!0}async function kx(e,t){const n=fi();if(!tm(n)||!e)return;const a=n.replace(/\/$/,""),s=_c(),o={Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${e}`};s&&(o.apikey=s);try{await fetch(`${a}/functions/tokentracker-leaderboard-refresh`,{method:"POST",headers:o,body:JSON.stringify({period:"week",source:t})})}catch{}}async function z3(e){const t=fi();if(!tm(t)||!e)return null;const n=t.replace(/\/$/,""),a=_c(),s={Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${e}`};a&&(s.apikey=a);const o=typeof navigator<"u"&&typeof navigator.platform=="string"?navigator.platform:"web",u=await fetch(`${n}/functions/tokentracker-device-token-issue`,{method:"POST",headers:s,body:JSON.stringify({device_name:"Token Tracker (dashboard)",platform:o})});if(!u.ok)return null;const c=await u.json().catch(()=>null),h=typeof c?.token=="string"?c.token:null,f=typeof c?.device_id=="string"?c.device_id:null;return!h||!f?null:{token:h,deviceId:f,issuedAt:typeof c?.created_at=="string"?c.created_at:new Date().toISOString()}}async function mb(e){const{deviceToken:t,insforgeBaseUrl:n}=e,a={deviceToken:t},s=n||fi();tm(s)&&(a.insforgeBaseUrl=s.trim());const o=await _p(),u=await fetch("/functions/tokentracker-local-sync",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",...o},body:JSON.stringify(a)}),c=await u.json().catch(()=>({}));if(!u.ok){const h=typeof c.error=="string"?c.error:`HTTP ${u.status}`;throw new Error(h)}return c}async function gb(e){const t=await e();if(!t)return null;const n=W_();if(n&&!V3(n))return n;const a=await z3(t);return a?(_R(a),a):null}async function wx(e){let t=await e();if(!t)return null;let n=await gb(async()=>t);if(!n)return t;try{return await mb({deviceToken:n.token,insforgeBaseUrl:fi()}),t}catch(a){if(!W_()||(K_(),t=await e(),!t)||(n=await gb(async()=>t),!n))throw a;return await mb({deviceToken:n.token,insforgeBaseUrl:fi()}),t}}async function $3(e){const t=kR();if(Date.now()-t<B3)return;const n=await wx(e);n&&(q_(Date.now()),await kx(n,"cloud-sync-auto"))}async function m4(e){const t=await wx(e);t&&(q_(Date.now()),await kx(t,"cloud-sync-now"))}function H3(e){const t=e.replace(/\/+$/,"")||"/";return t==="/share"||t==="/share.html"||t.startsWith("/share/")}function W3(e){const t=e.replace(/\/+$/,"")||"/";return t==="/login"||t==="/landing"||H3(t)?!1:t==="/"||t==="/dashboard"||t.startsWith("/leaderboard")}function K3(){const e=Fn(),t=Ho(),n=k.useRef(!1);k.useEffect(()=>{if(!vR()||!W3(e.pathname||"/")||!t.enabled||!t.signedIn||t.loading||!bR())return;let a=!1;const s=window.setTimeout(()=>{(async()=>{if(!(a||n.current)){n.current=!0;try{await $3(()=>t.getAccessToken())}catch(o){console.warn("[tokentracker] cloud usage sync:",o)}finally{n.current=!1}}})()},2500);return()=>{a=!0,window.clearTimeout(s)}},[e.pathname,t.enabled,t.signedIn,t.loading,t.getAccessToken])}function q3(){const e=k.useContext(yk);if(e===null)throw new Error("useTheme must be used within a ThemeProvider");return e}function G3({prefersReducedMotion:e,screenshotCapture:t}){return!(t||e)}function Y3(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 yb(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 vb({className:e,variant:t="header",collapsed:n=!1,onAfterAction:a}){Ko();const s=t==="sidebar",{enabled:o,loading:u,signedIn:c,user:h,displayName:f}=Ho(),{openLoginModal:m}=bk(),y=fc(),b=k.useMemo(()=>Y3(h),[h]);if(!o)return null;if(u)return I.jsx("div",{className:Ct("h-9 w-9 shrink-0 rounded-full bg-oai-gray-200 dark:bg-oai-gray-800 animate-pulse",e),"aria-hidden":!0});if(!c)return s?I.jsxs("button",{type:"button",onClick:()=>{m(),a?.()},className:Ct("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":Fe("header.auth.sign_in_aria"),title:n?Fe("header.auth.sign_in_aria"):void 0,children:[I.jsx("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center",children:I.jsx("img",{src:"/app-icon.png",alt:"",width:18,height:18,className:"h-[18px] w-[18px] rounded"})}),!n&&I.jsx("span",{className:"truncate flex-1 text-left",children:Fe("header.auth.sign_in_aria")})]}):I.jsx("button",{type:"button",onClick:m,className:Ct("shrink-0 inline-flex h-9 items-center justify-center gap-1.5 rounded-full px-5 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":Fe("header.auth.sign_in_aria"),children:Fe("header.auth.sign_in_aria")});const w=()=>{y("/settings"),a?.()};return I.jsx("div",{className:Ct(s?"relative flex w-full shrink-0 items-center":"relative flex shrink-0 items-center",e),children:I.jsxs("button",{type:"button",onClick:w,className:Ct(s?Ct("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-full 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":Fe("header.auth.open_settings"),title:s&&n?f:void 0,children:[s?I.jsx("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center",children:b?I.jsx("img",{src:b,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"}):I.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:yb(f)})}):b?I.jsx("img",{src:b,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"}):I.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:yb(f)}),s?!n&&I.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}):I.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 zf="tt.sidebarCollapsed";function Z3(){return[{id:"general",label:Fe("nav.group.general"),items:[{id:"usage",to:"/dashboard",icon:uD,label:Fe("nav.usage")},{id:"limits",to:"/limits",icon:dD,label:Fe("nav.limits")},{id:"leaderboard",to:"/leaderboard",icon:MD,label:Fe("nav.leaderboard")}]},{id:"tools",label:Fe("nav.group.tools"),items:[{id:"widgets",to:"/widgets",icon:mD,label:Fe("nav.widgets")},{id:"skills",to:"/skills",icon:SD,label:Fe("nav.skills")},{id:"ip-check",to:"/ip-check",icon:fD,label:Fe("nav.ip_check")}]},{id:"account",label:Fe("nav.group.account"),items:[{id:"settings",to:"/settings",icon:ED,label:Fe("nav.settings")}]}]}function Q3(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(zf)==="1"}catch{return!1}}function X3(){const[e,t]=k.useState(Q3),n=k.useCallback(()=>{t(a=>{const s=!a;try{typeof window<"u"&&window.localStorage.setItem(zf,s?"1":"0")}catch{}return s})},[]);return k.useEffect(()=>{if(typeof window>"u")return;const a=s=>{s.key===zf&&t(s.newValue==="1")};return window.addEventListener("storage",a),()=>window.removeEventListener("storage",a)},[]),{collapsed:e,toggle:n}}function J3(e,t){const n=e.replace(/\/+$/,"")||"/";return t==="/dashboard"?n==="/dashboard"||n==="/":t==="/leaderboard"?n==="/leaderboard"||n.startsWith("/leaderboard/"):n===t}function ej({label:e,collapsed:t,first:n}){return t?n?null:I.jsx("div",{className:"mx-2 my-2 h-px bg-oai-gray-200/70 dark:bg-oai-gray-800/70","aria-hidden":!0}):I.jsx("div",{className:Ct("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 tj({item:e,collapsed:t,active:n,onClick:a}){const s=e.icon;return I.jsxs(mc,{to:e.to,onClick:a,title:t?e.label:void 0,"aria-current":n?"page":void 0,className:Ct("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:[I.jsx("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center",children:I.jsx(s,{className:"h-[15px] w-[15px]","aria-hidden":!0})}),!t&&I.jsx("span",{className:"truncate",children:e.label})]})}function nj({as:e="button",title:t,onClick:n,href:a,children:s,className:o,...u}){const c=Ct("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",o);return e==="a"?I.jsx("a",{href:a,target:"_blank",rel:"noopener noreferrer",title:t,"aria-label":t,className:c,...u,children:s}):I.jsx("button",{type:"button",title:t,"aria-label":t,onClick:n,className:c,...u,children:s})}function rj({repo:e="mm7894215/TokenTracker",glassChrome:t=!1}){const[n,a]=k.useState(null);return k.useEffect(()=>{if(typeof window>"u")return;const s=typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;G3({prefersReducedMotion:s,screenshotCapture:!1})&&fetch(`https://api.github.com/repos/${e}`).then(o=>o.json()).then(o=>{o&&typeof o.stargazers_count=="number"&&a(o.stargazers_count)}).catch(()=>{})},[e]),I.jsxs("a",{href:`https://github.com/${e}`,target:"_blank",rel:"noopener noreferrer","aria-label":n!==null?`Star on GitHub (${n})`:"Star on GitHub",className:Ct("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:[I.jsx("svg",{height:"12",viewBox:"0 0 16 16",width:"12",className:"shrink-0 fill-current",children:I.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"})}),I.jsx("span",{children:"Star"}),n!==null&&I.jsx("span",{className:"text-[10px] text-oai-gray-500 dark:text-oai-gray-500 tabular-nums",children:n})]})}const aj=[{value:"light",label:"Light",Icon:mk},{value:"dark",label:"Dark",Icon:pk},{value:"system",label:"System",Icon:kD}];function ij({theme:e,resolvedTheme:t,onSetTheme:n,glassChrome:a=!1}){const[s,o]=k.useState(!1),u=k.useRef(null),c=t==="dark"?pk:mk;return k.useEffect(()=>{if(!s)return;const h=m=>{u.current&&!u.current.contains(m.target)&&o(!1)},f=m=>{m.key==="Escape"&&o(!1)};return document.addEventListener("mousedown",h),document.addEventListener("keydown",f),()=>{document.removeEventListener("mousedown",h),document.removeEventListener("keydown",f)}},[s]),I.jsxs("div",{ref:u,className:"relative",children:[I.jsx("button",{type:"button","aria-label":"Theme","aria-expanded":s,"aria-haspopup":"menu",title:"Theme",onClick:()=>o(h=>!h),className:Ct("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:I.jsx(c,{className:"h-3.5 w-3.5","aria-hidden":!0})}),s&&I.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:aj.map(({value:h,label:f,Icon:m})=>{const y=e===h;return I.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{n(h),o(!1)},className:Ct("flex w-full items-center gap-2.5 px-3 py-1.5 text-[13px] transition-colors",y?"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:[I.jsx(m,{className:"h-3.5 w-3.5 shrink-0","aria-hidden":!0}),I.jsx("span",{children:f})]},h)})})]})}function xx({collapsed:e,onToggleCollapsed:t,onItemClick:n,showCloseButton:a=!1,onClose:s,glassChrome:o=!1}){const c=Fn()?.pathname||"/",{theme:h,resolvedTheme:f,setTheme:m}=q3(),{resolvedLocale:y}=Ko(),b=k.useMemo(()=>Z3(),[y]);return I.jsxs(I.Fragment,{children:[I.jsx("div",{className:Ct("px-2 pt-2 pb-2",e&&"flex justify-center"),children:a?I.jsxs("div",{className:"flex items-center gap-2",children:[I.jsx("div",{className:"flex-1 min-w-0",children:I.jsx(vb,{variant:"sidebar",collapsed:e,onAfterAction:n})}),I.jsx("button",{type:"button",onClick:s,"aria-label":Fe("nav.close_menu"),title:Fe("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:I.jsx(gk,{className:"h-4 w-4",strokeWidth:1.75,"aria-hidden":!0})})]}):I.jsx(vb,{variant:"sidebar",collapsed:e,onAfterAction:n})}),I.jsx("nav",{"aria-label":Fe("nav.nav_label"),className:"flex-1 px-2 pb-2 flex flex-col overflow-y-auto",children:b.map((w,S)=>I.jsxs("div",{className:"flex flex-col",children:[I.jsx(ej,{label:w.label,collapsed:e,first:S===0}),I.jsx("div",{className:"flex flex-col gap-0.5",children:w.items.map(T=>I.jsx(tj,{item:T,collapsed:e,active:J3(c,T.to),onClick:n},T.id))})]},w.id))}),I.jsxs("div",{className:Ct("flex items-center px-2 py-3",e?"flex-col justify-center gap-2":"justify-between gap-2"),children:[I.jsx(ij,{theme:h,resolvedTheme:f,onSetTheme:m,glassChrome:o}),I.jsx("div",{className:"flex items-center gap-1.5",children:!e&&I.jsx(rj,{glassChrome:o})})]})]})}function sj({collapsed:e,onToggleCollapsed:t}){const n=k.useMemo(()=>typeof window>"u"?!1:mr()||ok(),[]);return I.jsx("aside",{"aria-label":Fe("nav.aside_label"),className:Ct("hidden lg:flex flex-col shrink-0 h-full min-h-0 transition-[width] duration-200",e?"w-[72px]":"w-[220px]"),children:I.jsx(xx,{collapsed:e,onToggleCollapsed:t,glassChrome:n})})}function oj({open:e,onClose:t}){return k.useEffect(()=>{if(!e)return;const n=a=>{a.key==="Escape"&&t()};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[e,t]),k.useEffect(()=>{if(!e)return;const n=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=n}},[e]),e?I.jsxs("div",{className:"lg:hidden fixed inset-0 z-[80] flex",children:[I.jsx("div",{className:"absolute inset-0 bg-black/40 backdrop-blur-sm",onClick:t,"aria-hidden":!0}),I.jsx("aside",{"aria-label":Fe("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:I.jsx(xx,{collapsed:!1,showCloseButton:!0,onClose:t,onItemClick:t})})]}):null}function lj({onOpenDrawer:e}){return I.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:[I.jsx(nj,{title:Fe("nav.menu"),onClick:e,children:I.jsx(bD,{className:"h-5 w-5","aria-hidden":!0})}),I.jsxs(mc,{to:"/landing",className:"flex items-center gap-2 no-underline hover:opacity-80 transition-opacity","aria-label":"Token Tracker",children:[I.jsx("img",{src:"/app-icon.png",alt:"",width:24,height:24,className:"rounded-md"}),I.jsx("span",{className:"text-sm font-semibold text-oai-black dark:text-oai-white",children:"Token Tracker"})]}),I.jsx("div",{className:"w-10 shrink-0","aria-hidden":!0})]})}function uj({children:e}){const{collapsed:t,toggle:n}=X3(),[a,s]=k.useState(!1),o=k.useCallback(()=>s(!0),[]),u=k.useCallback(()=>s(!1),[]),c=k.useMemo(()=>typeof window>"u"?!1:mr()||ok(),[]);return I.jsxs("div",{className:Ct("fixed inset-0 flex flex-col text-oai-black dark:text-oai-white font-sans overflow-hidden",c?"bg-transparent":"bg-oai-gray-100 dark:bg-oai-gray-950"),children:[c&&I.jsx("div",{className:"h-7 shrink-0",style:{WebkitAppRegion:"drag"},"aria-hidden":!0}),I.jsxs("div",{className:"flex-1 min-h-0 flex",children:[I.jsx(sj,{collapsed:t,onToggleCollapsed:n}),I.jsx(oj,{open:a,onClose:u}),I.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:I.jsxs("div",{className:Ct("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",c?"tt-native-main-card":"rounded-2xl",!c&&"shadow-sm"),children:[I.jsx(lj,{onOpenDrawer:o}),I.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto",children:e})]})})]})]})}const cj=typeof window<"u"?window.location.search:"",bb=new URLSearchParams(cj),bu=bb.get("insforge_code")||bb.get("code")||null;function dj(){Ko();const{loading:e,signedIn:t}=Ho(),n=fc(),[a,s]=k.useState("processing"),[o,u]=k.useState(null),c=k.useRef(!1);k.useEffect(()=>{!bu||c.current||(c.current=!0,(async()=>{try{const m=await(await fetch("/api/auth-bridge/verifier")).json();u(!!m?.native)}catch{u(!1)}})())},[]),k.useEffect(()=>{if(o!==!0||!bu)return;s("redirecting");const f=setTimeout(()=>{window.location.href=`tokentracker://auth/callback?insforge_code=${encodeURIComponent(bu)}`},200);return()=>clearTimeout(f)},[o]),k.useEffect(()=>{if(o!==!1||e)return;if(t){n("/dashboard",{replace:!0});return}const f=setTimeout(()=>{t||s("failed")},5e3);return()=>clearTimeout(f)},[o,e,t,n]),k.useEffect(()=>{if(!bu&&o===null){const f=setTimeout(()=>s("failed"),3e3);return()=>clearTimeout(f)}},[o]);const h=()=>{n("/dashboard",{replace:!0})};return a==="processing"&&o!==!0&&(o===null||o===!1&&e)?I.jsx("div",{className:"min-h-screen bg-oai-gray-950"}):I.jsx("div",{className:"min-h-screen bg-oai-gray-950 text-white font-oai antialiased dark flex items-center justify-center",children:I.jsxs("div",{className:"text-center space-y-4 max-w-sm px-4",children:[a==="processing"&&I.jsxs(I.Fragment,{children:[I.jsx("div",{className:"w-8 h-8 border-2 border-oai-gray-600 border-t-white rounded-full animate-spin mx-auto"}),I.jsx("p",{className:"text-oai-gray-400 text-sm",children:Fe("auth.callback.processing")})]}),a==="redirecting"&&I.jsxs(I.Fragment,{children:[I.jsx("div",{className:"w-12 h-12 mx-auto rounded-full bg-green-500/15 flex items-center justify-center",children:I.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:I.jsx("path",{d:"M20 6 9 17l-5-5"})})}),I.jsx("p",{className:"text-white text-sm font-medium",children:Fe("auth.callback.success")}),I.jsx("p",{className:"text-oai-gray-500 text-xs",children:Fe("auth.callback.redirecting")})]}),a==="failed"&&I.jsxs("div",{className:"space-y-3",children:[I.jsx("p",{className:"text-oai-gray-300 text-sm",children:Fe("auth.callback.failed")}),I.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:Fe("auth.callback.close")})]})]})})}const hj=k.lazy(()=>$n(()=>import("./DashboardPage-DKY_Mi9v.js"),__vite__mapDeps([0,1,2,3,4,5,6])).then(e=>({default:e.DashboardPage}))),fj=k.lazy(()=>$n(()=>import("./IpCheckPage-B2HjZ3vY.js"),[])),pj=k.lazy(()=>$n(()=>import("./LandingPage-9PSLFnys.js"),__vite__mapDeps([7,8,4])).then(e=>({default:e.LandingPage}))),mj=k.lazy(()=>$n(()=>import("./LeaderboardPage-CQT5dBHU.js"),__vite__mapDeps([9,5,10,11])).then(e=>({default:e.LeaderboardPage}))),gj=k.lazy(()=>$n(()=>import("./LeaderboardProfilePage-aPP-Raey.js"),__vite__mapDeps([12,8,10])).then(e=>({default:e.LeaderboardProfilePage}))),yj=k.lazy(()=>$n(()=>import("./LimitsPage-eFrAHmoA.js"),__vite__mapDeps([13,1,14,3,6,4])).then(e=>({default:e.LimitsPage}))),vj=k.lazy(()=>$n(()=>import("./LoginPage-CczTNZ_P.js"),[]).then(e=>({default:e.LoginPage}))),bj=k.lazy(()=>$n(()=>import("./DevicePage-BkavlAal.js"),[])),_j=k.lazy(()=>$n(()=>import("./WrappedPage-DwAhprTa.js"),[])),kj=k.lazy(()=>$n(()=>import("./SettingsPage-taBxq6ux.js"),__vite__mapDeps([15,14,16,3,17,18])).then(e=>({default:e.SettingsPage}))),wj=k.lazy(()=>$n(()=>import("./SkillsPage-cqHO3rMB.js"),__vite__mapDeps([19,3,2,5,17,4,11,18])).then(e=>({default:e.SkillsPage}))),xj=k.lazy(()=>$n(()=>import("./WidgetsPage-B53b1hwG.js"),__vite__mapDeps([20,16,3,6,4,18,11])).then(e=>({default:e.WidgetsPage})));function Sj(){const{resolvedLocale:e}=Ko(),t=Fn(),n=Ho();K3();const a=Pn(),s=k.useMemo(()=>typeof window>"u"?!1:U3(window.location.search),[]),o=t?.pathname||"/",u=new URL(window.location.href),c=u.pathname.replace(/\/+$/,"")||"/",f=c.match(/^\/share\/([^/?#]+)$/i)?.[1]||null,m=u.searchParams.get("token")||null,y=f||m,b=c==="/share"||c==="/share.html"||c.startsWith("/share/"),w=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"),S=o.replace(/\/+$/,"")||"/",T=S.match(/^\/leaderboard\/u\/([^/]+)$/i),P=T?T[1]:null,L=S==="/leaderboard"||!!P,D=!!(n.enabled&&n.signedIn),M=w||D,j=!1,q=j3(),K=k.useMemo(()=>!n.enabled||!D?null:{getAccessToken:()=>n.getAccessToken(),name:n.displayName||"",userId:n.user?.id||null},[D,n]);let H=w||a||s?"dashboard":"landing";S==="/landing"&&(H="landing"),S==="/dashboard"&&(H="dashboard"),L&&(H="dashboard");const x=S==="/limits",Z=S==="/settings",Q=S==="/skills",me=S==="/widgets",oe=S==="/ip-check";(x||Z||Q||me||oe)&&(H="dashboard");let Ae=hj;P?Ae=gj:S==="/leaderboard"?Ae=mj:x?Ae=yj:Z?Ae=kj:Q?Ae=wj:me?Ae=xj:oe&&(Ae=fj);const ce=!b&&(S==="/dashboard"||S==="/"||S==="/leaderboard"||x||Z||Q||me||oe);let le=null;if(S==="/auth/callback"||S==="/auth/native-callback")le=I.jsx(dj,{});else if(S==="/login")le=I.jsx(vj,{});else if(S==="/device")le=I.jsx(bj,{});else if(S==="/wrapped")le=I.jsx(_j,{});else if(H==="landing")le=I.jsx(pj,{signInUrl:"/login",signUpUrl:"/login"});else{const Me=I.jsx(Ae,{baseUrl:q,auth:K,signedIn:M,sessionSoftExpired:j,signOut:()=>n.enabled?n.signOut():Promise.resolve(),publicMode:b,publicToken:y,userId:P,signInUrl:"/login",signUpUrl:"/login"},e);ce?le=I.jsx(uj,{children:Me}):le=Me}return I.jsx(ID,{children:I.jsx(BD,{children:I.jsxs(FD,{children:[I.jsx(k.Suspense,{fallback:null,children:le}),I.jsx(O3,{}),I.jsx(HL,{}),I.jsx(tD,{})]})})})}const Pj=CT([{path:"*",element:I.jsx(Sj,{})}]);mP.createRoot(document.getElementById("root")).render(I.jsx(Hf.StrictMode,{children:I.jsx(RL,{children:I.jsx(aL,{children:I.jsx(FT,{router:Pj})})})}));export{LR as $,Y_ as A,Fe as B,I as C,q3 as D,$j as E,Wh as F,Hj as G,OD as H,t4 as I,ic as J,jj as K,mc as L,Zp as M,Ij as N,DO as O,bk as P,Ho as Q,Hf as R,l4 as S,Gj as T,Ko as U,U3 as V,Ea as W,gk as X,Xj as Y,Wj as Z,$n as _,qt as a,Uj as a0,Bj as a1,Jj as a2,zj as a3,o4 as a4,Ct as a5,vb as a6,BT as a7,Fn as a8,fc as a9,d4 as aA,mr as aB,ok as aC,u4 as aD,h4 as aE,c4 as aF,zv as aG,ww as aH,mN as aI,Nf as aJ,p4 as aa,bR as ab,Mj as ac,m4 as ad,Nj as ae,Zj as af,Qj as ag,G3 as ah,ED as ai,i4 as aj,Tj as ak,gR as al,Sp as am,vR as an,Uv as ao,Yj as ap,mk as aq,pk as ar,kD as as,ps as at,Zu as au,kp as av,TD as aw,_p as ax,cP as ay,$f as az,_k as b,dn as c,Na as d,o0 as e,dt as f,Z_ as g,Pn as h,IM as i,Oj as j,PR as k,s4 as l,gs as m,NR as n,OR as o,n4 as p,Vj as q,k as r,qj as s,r4 as t,Pp as u,a4 as v,Fj as w,yt as x,Kj as y,e4 as z};
676
+ `),()=>{c.current?.removeAttribute("data-motion-pop-id"),q.contains(j)&&q.removeChild(j)}},[t]),I.jsx(EO,{isPresent:t,childRef:c,sizeRef:h,pop:o,children:o===!1?e:k.cloneElement(e,{ref:y})})}const RO=({children:e,initial:t,isPresent:n,onExitComplete:a,custom:s,presenceAffectsLayout:o,mode:u,anchorX:c,anchorY:h,root:f})=>{const m=Pp(LO),y=k.useId();let b=!0,w=k.useMemo(()=>(b=!1,{id:y,initial:t,isPresent:n,custom:s,onExitComplete:S=>{m.set(S,!0);for(const T of m.values())if(!T)return;a&&a()},register:S=>(m.set(S,!1),()=>m.delete(S))}),[n,m,a]);return o&&b&&(w={...w}),k.useMemo(()=>{m.forEach((S,T)=>m.set(T,!1))},[n]),k.useEffect(()=>{!n&&!m.size&&a&&a()},[n]),e=I.jsx(AO,{pop:u==="popLayout",isPresent:n,anchorX:c,anchorY:h,root:f,children:e}),I.jsx(xc.Provider,{value:w,children:e})};function LO(){return new Map}function qw(e=!0){const t=k.useContext(xc);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:a,register:s}=t,o=k.useId();k.useEffect(()=>{if(e)return s(o)},[e]);const u=k.useCallback(()=>e&&a&&a(o),[o,a,e]);return!n&&a?[!1,u]:[!0]}const pu=e=>e.key||"";function Y0(e){const t=[];return k.Children.forEach(e,n=>{k.isValidElement(n)&&t.push(n)}),t}const DO=({children:e,custom:t,initial:n=!0,onExitComplete:a,presenceAffectsLayout:s=!0,mode:o="sync",propagate:u=!1,anchorX:c="left",anchorY:h="top",root:f})=>{const[m,y]=qw(u),b=k.useMemo(()=>Y0(e),[e]),w=u&&!m?[]:b.map(pu),S=k.useRef(!0),T=k.useRef(b),P=Pp(()=>new Map),L=k.useRef(new Set),[D,M]=k.useState(b),[j,q]=k.useState(b);_k(()=>{S.current=!1,T.current=b;for(let x=0;x<j.length;x++){const Z=pu(j[x]);w.includes(Z)?(P.delete(Z),L.current.delete(Z)):P.get(Z)!==!0&&P.set(Z,!1)}},[j,w.length,w.join("-")]);const K=[];if(b!==D){let x=[...b];for(let Z=0;Z<j.length;Z++){const Q=j[Z],me=pu(Q);w.includes(me)||(x.splice(Z,0,Q),K.push(Q))}return o==="wait"&&K.length&&(x=K),q(Y0(x)),M(b),null}const{forceRender:H}=k.useContext(Sp);return I.jsx(I.Fragment,{children:j.map(x=>{const Z=pu(x),Q=u&&!m?!1:b===j||w.includes(Z),me=()=>{if(L.current.has(Z))return;if(P.has(Z))L.current.add(Z),P.set(Z,!0);else return;let oe=!0;P.forEach(Ae=>{Ae||(oe=!1)}),oe&&(H?.(),q(T.current),u&&y?.(),a&&a())};return I.jsx(RO,{isPresent:Q,initial:!S.current||n?void 0:!1,custom:t,presenceAffectsLayout:s,mode:o,root:f,onExitComplete:Q?void 0:me,anchorX:c,anchorY:h,children:x},Z)})})},Gw=k.createContext({strict:!1}),Z0={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 Q0=!1;function MO(){if(Q0)return;const e={};for(const t in Z0)e[t]={isEnabled:n=>Z0[t].some(a=>!!n[a])};xw(e),Q0=!0}function Yw(){return MO(),gN()}function NO(e){const t=Yw();for(const n in e)t[n]={...t[n],...e[n]};xw(t)}const OO=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 uc(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||OO.has(e)}let Zw=e=>!uc(e);function IO(e){typeof e=="function"&&(Zw=t=>t.startsWith("on")?!uc(t):e(t))}try{IO(require("@emotion/is-prop-valid").default)}catch{}function jO(e,t,n){const a={};for(const s in e)s==="values"&&typeof e.values=="object"||qt(e[s])||(Zw(s)||n===!0&&uc(s)||!t&&!uc(s)||e.draggable&&s.startsWith("onDrag"))&&(a[s]=e[s]);return a}const Cc=k.createContext({});function UO(e,t){if(Tc(e)){const{initial:n,animate:a}=e;return{initial:n===!1||No(n)?n:void 0,animate:No(a)?a:void 0}}return e.inherit!==!1?t:{}}function BO(e){const{initial:t,animate:n}=UO(e,k.useContext(Cc));return k.useMemo(()=>({initial:t,animate:n}),[X0(t),X0(n)])}function X0(e){return Array.isArray(e)?e.join(" "):e}const Qp=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Qw(e,t,n){for(const a in t)!qt(t[a])&&!Rw(a,n)&&(e[a]=t[a])}function FO({transformTemplate:e},t){return k.useMemo(()=>{const n=Qp();return Gp(n,t,e),Object.assign({},n.vars,n.style)},[t])}function VO(e,t){const n=e.style||{},a={};return Qw(a,n,e),Object.assign(a,FO(e,t)),a}function zO(e,t){const n={},a=VO(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 Xw=()=>({...Qp(),attrs:{}});function $O(e,t,n,a){const s=k.useMemo(()=>{const o=Xw();return Lw(o,t,Mw(a),e.transformTemplate,e.style),{...o.attrs,style:{...o.style}}},[t]);if(e.style){const o={};Qw(o,e.style,e),s.style={...o,...s.style}}return s}const HO=["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 Xp(e){return typeof e!="string"||e.includes("-")?!1:!!(HO.indexOf(e)>-1||/[A-Z]/u.test(e))}function WO(e,t,n,{latestValues:a},s,o=!1,u){const h=(u??Xp(e)?$O:zO)(t,a,s,e),f=jO(t,typeof e=="string",o),m=e!==k.Fragment?{...f,...h,ref:n}:{},{children:y}=t,b=k.useMemo(()=>qt(y)?y.get():y,[y]);return k.createElement(e,{...m,children:b})}function KO({scrapeMotionValuesFromProps:e,createRenderState:t},n,a,s){return{latestValues:qO(n,a,s,e),renderState:t()}}function qO(e,t,n,a){const s={},o=a(e,{});for(const b in o)s[b]=Iu(o[b]);let{initial:u,animate:c}=e;const h=Tc(e),f=kw(e);t&&f&&!h&&e.inherit!==!1&&(u===void 0&&(u=t.initial),c===void 0&&(c=t.animate));let m=n?n.initial===!1:!1;m=m||u===!1;const y=m?c:u;if(y&&typeof y!="boolean"&&!Pc(y)){const b=Array.isArray(y)?y:[y];for(let w=0;w<b.length;w++){const S=Fp(e,b[w]);if(S){const{transitionEnd:T,transition:P,...L}=S;for(const D in L){let M=L[D];if(Array.isArray(M)){const j=m?M.length-1:0;M=M[j]}M!==null&&(s[D]=M)}for(const D in T)s[D]=T[D]}}}return s}const Jw=e=>(t,n)=>{const a=k.useContext(Cc),s=k.useContext(xc),o=()=>KO(e,t,a,s);return n?o():Pp(o)},GO=Jw({scrapeMotionValuesFromProps:Yp,createRenderState:Qp}),YO=Jw({scrapeMotionValuesFromProps:Nw,createRenderState:Xw}),ZO=Symbol.for("motionComponentSymbol");function QO(e,t,n){const a=k.useRef(n);k.useInsertionEffect(()=>{a.current=n});const s=k.useRef(null);return k.useCallback(o=>{o&&e.onMount?.(o);const u=a.current;if(typeof u=="function")if(o){const c=u(o);typeof c=="function"&&(s.current=c)}else s.current?(s.current(),s.current=null):u(o);else u&&(u.current=o);t&&(o?t.mount(o):t.unmount())},[t])}const ex=k.createContext({});function ts(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function XO(e,t,n,a,s,o){const{visualElement:u}=k.useContext(Cc),c=k.useContext(Gw),h=k.useContext(xc),f=k.useContext(Zp),m=f.reducedMotion,y=f.skipAnimations,b=k.useRef(null),w=k.useRef(!1);a=a||c.renderer,!b.current&&a&&(b.current=a(e,{visualState:t,parent:u,props:n,presenceContext:h,blockInitialAnimation:h?h.initial===!1:!1,reducedMotionConfig:m,skipAnimations:y,isSVG:o}),w.current&&b.current&&(b.current.manuallyAnimateOnMount=!0));const S=b.current,T=k.useContext(ex);S&&!S.projection&&s&&(S.type==="html"||S.type==="svg")&&JO(b.current,n,s,T);const P=k.useRef(!1);k.useInsertionEffect(()=>{S&&P.current&&S.update(n,h)});const L=n[lw],D=k.useRef(!!L&&typeof window<"u"&&!window.MotionHandoffIsComplete?.(L)&&window.MotionHasOptimisedAnimation?.(L));return _k(()=>{w.current=!0,S&&(P.current=!0,window.MotionIsMounted=!0,S.updateFeatures(),S.scheduleRenderMicrotask(),D.current&&S.animationState&&S.animationState.animateChanges())}),k.useEffect(()=>{S&&(!D.current&&S.animationState&&S.animationState.animateChanges(),D.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(L)}),D.current=!1),S.enteringChildren=void 0)}),S}function JO(e,t,n,a){const{layoutId:s,layout:o,drag:u,dragConstraints:c,layoutScroll:h,layoutRoot:f,layoutAnchor:m,layoutCrossfade:y}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:tx(e.parent)),e.projection.setOptions({layoutId:s,layout:o,alwaysMeasureLayout:!!u||c&&ts(c),visualElement:e,animationType:typeof o=="string"?o:"both",initialPromotionConfig:a,crossfade:y,layoutScroll:h,layoutRoot:f,layoutAnchor:m})}function tx(e){if(e)return e.options.allowProjection!==!1?e.projection:tx(e.parent)}function Fh(e,{forwardMotionProps:t=!1,type:n}={},a,s){a&&NO(a);const o=n?n==="svg":Xp(e),u=o?YO:GO;function c(f,m){let y;const b={...k.useContext(Zp),...f,layoutId:eI(f)},{isStatic:w}=b,S=BO(f),T=u(f,w);if(!w&&typeof window<"u"){tI();const P=nI(b);y=P.MeasureLayout,S.visualElement=XO(e,T,b,s,P.ProjectionNode,o)}return I.jsxs(Cc.Provider,{value:S,children:[y&&S.visualElement?I.jsx(y,{visualElement:S.visualElement,...b}):null,WO(e,f,QO(T,S.visualElement,m),T,w,t,o)]})}c.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const h=k.forwardRef(c);return h[ZO]=e,h}function eI({layoutId:e}){const t=k.useContext(Sp).id;return t&&e!==void 0?t+"-"+e:e}function tI(e,t){k.useContext(Gw).strict}function nI(e){const t=Yw(),{drag:n,layout:a}=t;if(!n&&!a)return{};const s={...n,...a};return{MeasureLayout:n?.isEnabled(e)||a?.isEnabled(e)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}function rI(e,t){if(typeof Proxy>"u")return Fh;const n=new Map,a=(o,u)=>Fh(o,u,e,t),s=(o,u)=>a(o,u);return new Proxy(s,{get:(o,u)=>u==="create"?a:(n.has(u)||n.set(u,Fh(u,void 0,e,t)),n.get(u))})}const aI=(e,t)=>t.isSVG??Xp(e)?new MN(t):new CN(t,{allowProjection:e!==k.Fragment});class iI extends Ia{constructor(t){super(t),t.animationState||(t.animationState=UN(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Pc(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 sI=0;class oI extends Ia{constructor(){super(...arguments),this.id=sI++,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:o,custom:u}=this.node.getProps();if(typeof o=="string"){const c=si(this.node,o,u);if(c){const{transition:h,transitionEnd:f,...m}=c;for(const y in m)this.node.getValue(y)?.jump(m[y])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const s=this.node.animationState.setActive("exit",!t);n&&!t&&s.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 lI={animation:{Feature:iI},exit:{Feature:oI}};function Zo(e){return{point:{x:e.pageX,y:e.pageY}}}const uI=e=>t=>Hp(t)&&e(t,Zo(t));function To(e,t,n,a){return Oo(e,t,uI(n),a)}const nx=({current:e})=>e?e.ownerDocument.defaultView:null,J0=(e,t)=>Math.abs(e-t);function cI(e,t){const n=J0(e.x,t.x),a=J0(e.y,t.y);return Math.sqrt(n**2+a**2)}const eb=new Set(["auto","scroll"]);class rx{constructor(t,n,{transformPagePoint:a,contextWindow:s=window,dragSnapToOrigin:o=!1,distanceThreshold:u=3,element:c}={}){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=w=>{this.handleScroll(w.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=mu(this.lastRawMoveEventInfo,this.transformPagePoint));const w=Vh(this.lastMoveEventInfo,this.history),S=this.startEvent!==null,T=cI(w.offset,{x:0,y:0})>=this.distanceThreshold;if(!S&&!T)return;const{point:P}=w,{timestamp:L}=Kt;this.history.push({...P,timestamp:L});const{onStart:D,onMove:M}=this.handlers;S||(D&&D(this.lastMoveEvent,w),this.startEvent=this.lastMoveEvent),M&&M(this.lastMoveEvent,w)},this.handlePointerMove=(w,S)=>{this.lastMoveEvent=w,this.lastRawMoveEventInfo=S,this.lastMoveEventInfo=mu(S,this.transformPagePoint),dt.update(this.updatePoint,!0)},this.handlePointerUp=(w,S)=>{this.end();const{onEnd:T,onSessionEnd:P,resumeAnimation:L}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&L&&L(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const D=Vh(w.type==="pointercancel"?this.lastMoveEventInfo:mu(S,this.transformPagePoint),this.history);this.startEvent&&T&&T(w,D),P&&P(w,D)},!Hp(t))return;this.dragSnapToOrigin=o,this.handlers=n,this.transformPagePoint=a,this.distanceThreshold=u,this.contextWindow=s||window;const h=Zo(t),f=mu(h,this.transformPagePoint),{point:m}=f,{timestamp:y}=Kt;this.history=[{...m,timestamp:y}];const{onSessionStart:b}=n;b&&b(t,Vh(f,this.history)),this.removeListeners=qo(To(this.contextWindow,"pointermove",this.handlePointerMove),To(this.contextWindow,"pointerup",this.handlePointerUp),To(this.contextWindow,"pointercancel",this.handlePointerUp)),c&&this.startScrollTracking(c)}startScrollTracking(t){let n=t.parentElement;for(;n;){const a=getComputedStyle(n);(eb.has(a.overflowX)||eb.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,s=a?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},o={x:s.x-n.x,y:s.y-n.y};o.x===0&&o.y===0||(a?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=o.x,this.lastMoveEventInfo.point.y+=o.y):this.history.length>0&&(this.history[0].x-=o.x,this.history[0].y-=o.y),this.scrollPositions.set(t,s),dt.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Na(this.updatePoint)}}function mu(e,t){return t?{point:t(e.point)}:e}function tb(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Vh({point:e},t){return{point:e,delta:tb(e,ax(t)),offset:tb(e,dI(t)),velocity:hI(t,.1)}}function dI(e){return e[0]}function ax(e){return e[e.length-1]}function hI(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,a=null;const s=ax(e);for(;n>=0&&(a=e[n],!(s.timestamp-a.timestamp>Sn(t)));)n--;if(!a)return{x:0,y:0};a===e[0]&&e.length>2&&s.timestamp-a.timestamp>Sn(t)*2&&(a=e[1]);const o=In(s.timestamp-a.timestamp);if(o===0)return{x:0,y:0};const u={x:(s.x-a.x)/o,y:(s.y-a.y)/o};return u.x===1/0&&(u.x=0),u.y===1/0&&(u.y=0),u}function fI(e,{min:t,max:n},a){return t!==void 0&&e<t?e=a?vt(t,e,a.min):Math.max(e,t):n!==void 0&&e>n&&(e=a?vt(n,e,a.max):Math.min(e,n)),e}function nb(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 pI(e,{top:t,left:n,bottom:a,right:s}){return{x:nb(e.x,n,s),y:nb(e.y,t,a)}}function rb(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 mI(e,t){return{x:rb(e.x,t.x),y:rb(e.y,t.y)}}function gI(e,t){let n=.5;const a=ln(e),s=ln(t);return s>a?n=Do(t.min,t.max-a,e.min):a>s&&(n=Do(e.min,e.max-s,t.min)),xr(0,1,n)}function yI(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 Bf=.35;function vI(e=Bf){return e===!1?e=0:e===!0&&(e=Bf),{x:ab(e,"left","right"),y:ab(e,"top","bottom")}}function ab(e,t,n){return{min:ib(e,t),max:ib(e,n)}}function ib(e,t){return typeof e=="number"?e:e[t]||0}const bI=new WeakMap;class _I{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=It(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:a}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const o=y=>{n&&this.snapToCursor(Zo(y).point),this.stopAnimation()},u=(y,b)=>{const{drag:w,dragPropagation:S,onDragStart:T}=this.getProps();if(w&&!S&&(this.openDragLock&&this.openDragLock(),this.openDragLock=K2(w),!this.openDragLock))return;this.latestPointerEvent=y,this.latestPanInfo=b,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),fr(L=>{let D=this.getAxisMotionValue(L).get()||0;if(vr.test(D)){const{projection:M}=this.visualElement;if(M&&M.layout){const j=M.layout.layoutBox[L];j&&(D=ln(j)*(parseFloat(D)/100))}}this.originPoint[L]=D}),T&&dt.update(()=>T(y,b),!1,!0),Rf(this.visualElement,"transform");const{animationState:P}=this.visualElement;P&&P.setActive("whileDrag",!0)},c=(y,b)=>{this.latestPointerEvent=y,this.latestPanInfo=b;const{dragPropagation:w,dragDirectionLock:S,onDirectionLock:T,onDrag:P}=this.getProps();if(!w&&!this.openDragLock)return;const{offset:L}=b;if(S&&this.currentDirection===null){this.currentDirection=wI(L),this.currentDirection!==null&&T&&T(this.currentDirection);return}this.updateAxis("x",b.point,L),this.updateAxis("y",b.point,L),this.visualElement.render(),P&&dt.update(()=>P(y,b),!1,!0)},h=(y,b)=>{this.latestPointerEvent=y,this.latestPanInfo=b,this.stop(y,b),this.latestPointerEvent=null,this.latestPanInfo=null},f=()=>{const{dragSnapToOrigin:y}=this.getProps();(y||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:m}=this.getProps();this.panSession=new rx(t,{onSessionStart:o,onStart:u,onMove:c,onSessionEnd:h,resumeAnimation:f},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:m,distanceThreshold:a,contextWindow:nx(this.visualElement),element:this.visualElement.current})}stop(t,n){const a=t||this.latestPointerEvent,s=n||this.latestPanInfo,o=this.isDragging;if(this.cancel(),!o||!s||!a)return;const{velocity:u}=s;this.startAnimation(u);const{onDragEnd:c}=this.getProps();c&&dt.postRender(()=>c(a,s))}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:s}=this.getProps();if(!a||!gu(t,s,this.currentDirection))return;const o=this.getAxisMotionValue(t);let u=this.originPoint[t]+a[t];this.constraints&&this.constraints[t]&&(u=fI(u,this.constraints[t],this.elastic[t])),o.set(u)}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,s=this.constraints;t&&ts(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&a?this.constraints=pI(a.layoutBox,t):this.constraints=!1,this.elastic=vI(n),s!==this.constraints&&!ts(t)&&a&&this.constraints&&!this.hasMutatedConstraints&&fr(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=yI(a.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!ts(t))return!1;const a=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const o=kN(a,s.root,this.visualElement.getTransformPagePoint());let u=mI(s.layout.layoutBox,o);if(n){const c=n(vN(u));this.hasMutatedConstraints=!!c,c&&(u=Pw(c))}return u}startAnimation(t){const{drag:n,dragMomentum:a,dragElastic:s,dragTransition:o,dragSnapToOrigin:u,onDragTransitionEnd:c}=this.getProps(),h=this.constraints||{},f=fr(m=>{if(!gu(m,n,this.currentDirection))return;let y=h&&h[m]||{};(u===!0||u===m)&&(y={min:0,max:0});const b=s?200:1e6,w=s?40:1e7,S={type:"inertia",velocity:a?t[m]:0,bounceStiffness:b,bounceDamping:w,timeConstant:750,restDelta:1,restSpeed:10,...o,...y};return this.startAxisValueAnimation(m,S)});return Promise.all(f).then(c)}startAxisValueAnimation(t,n){const a=this.getAxisMotionValue(t);return Rf(this.visualElement,t),a.start(Bp(t,a,0,n,this.visualElement,!1))}stopAnimation(){fr(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,a=this.visualElement.getProps(),s=a[n];return s||this.visualElement.getValue(t,(a.initial?a.initial[t]:void 0)||0)}snapToCursor(t){fr(n=>{const{drag:a}=this.getProps();if(!gu(n,a,this.currentDirection))return;const{projection:s}=this.visualElement,o=this.getAxisMotionValue(n);if(s&&s.layout){const{min:u,max:c}=s.layout.layoutBox[n],h=o.get()||0;o.set(t[n]-vt(u,c,.5)+h)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:a}=this.visualElement;if(!ts(n)||!a||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};fr(u=>{const c=this.getAxisMotionValue(u);if(c&&this.constraints!==!1){const h=c.get();s[u]=gI({min:h,max:h},this.constraints[u])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",a.root&&a.root.updateScroll(),a.updateLayout(),this.constraints=!1,this.resolveConstraints(),fr(u=>{if(!gu(u,t,null))return;const c=this.getAxisMotionValue(u),{min:h,max:f}=this.constraints[u];c.set(vt(h,f,s[u]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;bI.set(this.visualElement,this);const t=this.visualElement.current,n=To(t,"pointerdown",f=>{const{drag:m,dragListener:y=!0}=this.getProps(),b=f.target,w=b!==t&&X2(b);m&&y&&!w&&this.start(f)});let a;const s=()=>{const{dragConstraints:f}=this.getProps();ts(f)&&f.current&&(this.constraints=this.resolveRefConstraints(),a||(a=kI(t,f.current,()=>this.scalePositionWithinConstraints())))},{projection:o}=this.visualElement,u=o.addEventListener("measure",s);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),dt.read(s);const c=Oo(window,"resize",()=>this.scalePositionWithinConstraints()),h=o.addEventListener("didUpdate",(({delta:f,hasLayoutChanged:m})=>{this.isDragging&&m&&(fr(y=>{const b=this.getAxisMotionValue(y);b&&(this.originPoint[y]+=f[y].translate,b.set(b.get()+f[y].translate))}),this.visualElement.render())}));return()=>{c(),n(),u(),h&&h(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:a=!1,dragPropagation:s=!1,dragConstraints:o=!1,dragElastic:u=Bf,dragMomentum:c=!0}=t;return{...t,drag:n,dragDirectionLock:a,dragPropagation:s,dragConstraints:o,dragElastic:u,dragMomentum:c}}}function sb(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function kI(e,t,n){const a=f0(e,sb(n)),s=f0(t,sb(n));return()=>{a(),s()}}function gu(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function wI(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class xI extends Ia{constructor(t){super(t),this.removeGroupControls=jn,this.removeListeners=jn,this.controls=new _I(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||jn}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 zh=e=>(t,n)=>{e&&dt.update(()=>e(t,n),!1,!0)};class SI extends Ia{constructor(){super(...arguments),this.removePointerDownListener=jn}onPointerDown(t){this.session=new rx(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:nx(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:a,onPanEnd:s}=this.node.getProps();return{onSessionStart:zh(t),onStart:zh(n),onMove:zh(a),onEnd:(o,u)=>{delete this.session,s&&dt.postRender(()=>s(o,u))}}}mount(){this.removePointerDownListener=To(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 $h=!1;class PI extends k.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:a,layoutId:s}=this.props,{projection:o}=t;o&&(n.group&&n.group.add(o),a&&a.register&&s&&a.register(o),$h&&o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),ju.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:a,drag:s,isPresent:o}=this.props,{projection:u}=a;return u&&(u.isPresent=o,t.layoutDependency!==n&&u.setOptions({...u.options,layoutDependency:n}),$h=!0,s||t.layoutDependency!==n||n===void 0||t.isPresent!==o?u.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?u.promote():u.relegate()||dt.postRender(()=>{const c=u.getStack();(!c||!c.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:t,layoutAnchor:n}=this.props,{projection:a}=t;a&&(a.options.layoutAnchor=n,a.root.didUpdate(),$p.postRender(()=>{!a.currentAnimation&&a.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:a}=this.props,{projection:s}=t;$h=!0,s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),a&&a.deregister&&a.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function ix(e){const[t,n]=qw(),a=k.useContext(Sp);return I.jsx(PI,{...e,layoutGroup:a,switchLayoutGroup:k.useContext(ex),isPresent:t,safeToRemove:n})}const TI={pan:{Feature:SI},drag:{Feature:xI,ProjectionNode:Kw,MeasureLayout:ix}};function ob(e,t,n){const{props:a}=e;e.animationState&&a.whileHover&&e.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,o=a[s];o&&dt.postRender(()=>o(t,Zo(t)))}class CI extends Ia{mount(){const{current:t}=this.node;t&&(this.unmount=G2(t,(n,a)=>(ob(this.node,a,"Start"),s=>ob(this.node,s,"End"))))}unmount(){}}class EI extends Ia{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=qo(Oo(this.node.current,"focus",()=>this.onFocus()),Oo(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function lb(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 s="onTap"+(n==="End"?"":n),o=a[s];o&&dt.postRender(()=>o(t,Zo(t)))}class AI extends Ia{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:a}=this.node.props;this.unmount=eN(t,(s,o)=>(lb(this.node,o,"Start"),(u,{success:c})=>lb(this.node,u,c?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:a?.tap===!1})}unmount(){}}const Ff=new WeakMap,Hh=new WeakMap,RI=e=>{const t=Ff.get(e.target);t&&t(e)},LI=e=>{e.forEach(RI)};function DI({root:e,...t}){const n=e||document;Hh.has(n)||Hh.set(n,{});const a=Hh.get(n),s=JSON.stringify(t);return a[s]||(a[s]=new IntersectionObserver(LI,{root:e,...t})),a[s]}function MI(e,t,n){const a=DI(t);return Ff.set(e,n),a.observe(e),()=>{Ff.delete(e),a.unobserve(e)}}const NI={some:0,all:1};class OI extends Ia{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();const{viewport:t={}}=this.node.getProps(),{root:n,margin:a,amount:s="some",once:o}=t,u={root:n?n.current:void 0,rootMargin:a,threshold:typeof s=="number"?s:NI[s]},c=h=>{const{isIntersecting:f}=h;if(this.isInView===f||(this.isInView=f,o&&!f&&this.hasEnteredView))return;f&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",f);const{onViewportEnter:m,onViewportLeave:y}=this.node.getProps(),b=f?m:y;b&&b(h)};this.stopObserver=MI(this.node.current,u,c)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(II(t,n))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}function II({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const jI={inView:{Feature:OI},tap:{Feature:AI},focus:{Feature:EI},hover:{Feature:CI}},UI={layout:{ProjectionNode:Kw,MeasureLayout:ix}},BI={...lI,...jI,...TI,...UI},Wh=rI(BI,aI);function sx(e){var t,n,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=sx(e[t]))&&(a&&(a+=" "),a+=n)}else for(n in e)e[n]&&(a&&(a+=" "),a+=n);return a}function FI(){for(var e,t,n=0,a="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=sx(e))&&(a&&(a+=" "),a+=t);return a}const VI=(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},zI=(e,t)=>({classGroupId:e,validator:t}),ox=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),cc="-",ub=[],$I="arbitrary..",HI=e=>{const t=KI(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:u=>{if(u.startsWith("[")&&u.endsWith("]"))return WI(u);const c=u.split(cc),h=c[0]===""&&c.length>1?1:0;return lx(c,h,t)},getConflictingClassGroupIds:(u,c)=>{if(c){const h=a[u],f=n[u];return h?f?VI(f,h):h:f||ub}return n[u]||ub}}},lx=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const s=e[t],o=n.nextPart.get(s);if(o){const f=lx(e,t+1,o);if(f)return f}const u=n.validators;if(u===null)return;const c=t===0?e.join(cc):e.slice(t).join(cc),h=u.length;for(let f=0;f<h;f++){const m=u[f];if(m.validator(c))return m.classGroupId}},WI=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?$I+a:void 0})(),KI=e=>{const{theme:t,classGroups:n}=e;return qI(n,t)},qI=(e,t)=>{const n=ox();for(const a in e){const s=e[a];Jp(s,n,a,t)}return n},Jp=(e,t,n,a)=>{const s=e.length;for(let o=0;o<s;o++){const u=e[o];GI(u,t,n,a)}},GI=(e,t,n,a)=>{if(typeof e=="string"){YI(e,t,n);return}if(typeof e=="function"){ZI(e,t,n,a);return}QI(e,t,n,a)},YI=(e,t,n)=>{const a=e===""?t:ux(t,e);a.classGroupId=n},ZI=(e,t,n,a)=>{if(XI(e)){Jp(e(a),t,n,a);return}t.validators===null&&(t.validators=[]),t.validators.push(zI(n,e))},QI=(e,t,n,a)=>{const s=Object.entries(e),o=s.length;for(let u=0;u<o;u++){const[c,h]=s[u];Jp(h,ux(t,c),n,a)}},ux=(e,t)=>{let n=e;const a=t.split(cc),s=a.length;for(let o=0;o<s;o++){const u=a[o];let c=n.nextPart.get(u);c||(c=ox(),n.nextPart.set(u,c)),n=c}return n},XI=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,JI=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),a=Object.create(null);const s=(o,u)=>{n[o]=u,t++,t>e&&(t=0,a=n,n=Object.create(null))};return{get(o){let u=n[o];if(u!==void 0)return u;if((u=a[o])!==void 0)return s(o,u),u},set(o,u){o in n?n[o]=u:s(o,u)}}},Vf="!",cb=":",e3=[],db=(e,t,n,a,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:a,isExternal:s}),t3=e=>{const{prefix:t,experimentalParseClassName:n}=e;let a=s=>{const o=[];let u=0,c=0,h=0,f;const m=s.length;for(let T=0;T<m;T++){const P=s[T];if(u===0&&c===0){if(P===cb){o.push(s.slice(h,T)),h=T+1;continue}if(P==="/"){f=T;continue}}P==="["?u++:P==="]"?u--:P==="("?c++:P===")"&&c--}const y=o.length===0?s:s.slice(h);let b=y,w=!1;y.endsWith(Vf)?(b=y.slice(0,-1),w=!0):y.startsWith(Vf)&&(b=y.slice(1),w=!0);const S=f&&f>h?f-h:void 0;return db(o,w,b,S)};if(t){const s=t+cb,o=a;a=u=>u.startsWith(s)?o(u.slice(s.length)):db(e3,!1,u,void 0,!0)}if(n){const s=a;a=o=>n({className:o,parseClassName:s})}return a},n3=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,a)=>{t.set(n,1e6+a)}),n=>{const a=[];let s=[];for(let o=0;o<n.length;o++){const u=n[o],c=u[0]==="[",h=t.has(u);c||h?(s.length>0&&(s.sort(),a.push(...s),s=[]),a.push(u)):s.push(u)}return s.length>0&&(s.sort(),a.push(...s)),a}},r3=e=>({cache:JI(e.cacheSize),parseClassName:t3(e),sortModifiers:n3(e),...HI(e)}),a3=/\s+/,i3=(e,t)=>{const{parseClassName:n,getClassGroupId:a,getConflictingClassGroupIds:s,sortModifiers:o}=t,u=[],c=e.trim().split(a3);let h="";for(let f=c.length-1;f>=0;f-=1){const m=c[f],{isExternal:y,modifiers:b,hasImportantModifier:w,baseClassName:S,maybePostfixModifierPosition:T}=n(m);if(y){h=m+(h.length>0?" "+h:h);continue}let P=!!T,L=a(P?S.substring(0,T):S);if(!L){if(!P){h=m+(h.length>0?" "+h:h);continue}if(L=a(S),!L){h=m+(h.length>0?" "+h:h);continue}P=!1}const D=b.length===0?"":b.length===1?b[0]:o(b).join(":"),M=w?D+Vf:D,j=M+L;if(u.indexOf(j)>-1)continue;u.push(j);const q=s(L,P);for(let K=0;K<q.length;++K){const H=q[K];u.push(M+H)}h=m+(h.length>0?" "+h:h)}return h},s3=(...e)=>{let t=0,n,a,s="";for(;t<e.length;)(n=e[t++])&&(a=cx(n))&&(s&&(s+=" "),s+=a);return s},cx=e=>{if(typeof e=="string")return e;let t,n="";for(let a=0;a<e.length;a++)e[a]&&(t=cx(e[a]))&&(n&&(n+=" "),n+=t);return n},o3=(e,...t)=>{let n,a,s,o;const u=h=>{const f=t.reduce((m,y)=>y(m),e());return n=r3(f),a=n.cache.get,s=n.cache.set,o=c,c(h)},c=h=>{const f=a(h);if(f)return f;const m=i3(h,n);return s(h,m),m};return o=u,(...h)=>o(s3(...h))},l3=[],Ot=e=>{const t=n=>n[e]||l3;return t.isThemeGetter=!0,t},dx=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,hx=/^\((?:(\w[\w-]*):)?(.+)\)$/i,u3=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,c3=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,d3=/\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$/,h3=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,f3=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,p3=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,wa=e=>u3.test(e),Ge=e=>!!e&&!Number.isNaN(Number(e)),xa=e=>!!e&&Number.isInteger(Number(e)),Kh=e=>e.endsWith("%")&&Ge(e.slice(0,-1)),Fr=e=>c3.test(e),fx=()=>!0,m3=e=>d3.test(e)&&!h3.test(e),em=()=>!1,g3=e=>f3.test(e),y3=e=>p3.test(e),v3=e=>!be(e)&&!ke(e),b3=e=>ja(e,gx,em),be=e=>dx.test(e),Ja=e=>ja(e,yx,m3),hb=e=>ja(e,C3,Ge),_3=e=>ja(e,bx,fx),k3=e=>ja(e,vx,em),fb=e=>ja(e,px,em),w3=e=>ja(e,mx,y3),yu=e=>ja(e,_x,g3),ke=e=>hx.test(e),mo=e=>gi(e,yx),x3=e=>gi(e,vx),pb=e=>gi(e,px),S3=e=>gi(e,gx),P3=e=>gi(e,mx),vu=e=>gi(e,_x,!0),T3=e=>gi(e,bx,!0),ja=(e,t,n)=>{const a=dx.exec(e);return a?a[1]?t(a[1]):n(a[2]):!1},gi=(e,t,n=!1)=>{const a=hx.exec(e);return a?a[1]?t(a[1]):n:!1},px=e=>e==="position"||e==="percentage",mx=e=>e==="image"||e==="url",gx=e=>e==="length"||e==="size"||e==="bg-size",yx=e=>e==="length",C3=e=>e==="number",vx=e=>e==="family-name",bx=e=>e==="number"||e==="weight",_x=e=>e==="shadow",E3=()=>{const e=Ot("color"),t=Ot("font"),n=Ot("text"),a=Ot("font-weight"),s=Ot("tracking"),o=Ot("leading"),u=Ot("breakpoint"),c=Ot("container"),h=Ot("spacing"),f=Ot("radius"),m=Ot("shadow"),y=Ot("inset-shadow"),b=Ot("text-shadow"),w=Ot("drop-shadow"),S=Ot("blur"),T=Ot("perspective"),P=Ot("aspect"),L=Ot("ease"),D=Ot("animate"),M=()=>["auto","avoid","all","avoid-page","page","left","right","column"],j=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],q=()=>[...j(),ke,be],K=()=>["auto","hidden","clip","visible","scroll"],H=()=>["auto","contain","none"],x=()=>[ke,be,h],Z=()=>[wa,"full","auto",...x()],Q=()=>[xa,"none","subgrid",ke,be],me=()=>["auto",{span:["full",xa,ke,be]},xa,ke,be],oe=()=>[xa,"auto",ke,be],Ae=()=>["auto","min","max","fr",ke,be],fe=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ce=()=>["start","end","center","stretch","center-safe","end-safe"],le=()=>["auto",...x()],Me=()=>[wa,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...x()],W=()=>[wa,"screen","full","dvw","lvw","svw","min","max","fit",...x()],Y=()=>[wa,"screen","full","lh","dvh","lvh","svh","min","max","fit",...x()],$=()=>[e,ke,be],N=()=>[...j(),pb,fb,{position:[ke,be]}],G=()=>["no-repeat",{repeat:["","x","y","space","round"]}],xe=()=>["auto","cover","contain",S3,b3,{size:[ke,be]}],Re=()=>[Kh,mo,Ja],Se=()=>["","none","full",f,ke,be],Ce=()=>["",Ge,mo,Ja],qe=()=>["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=()=>[Ge,Kh,pb,fb],jt=()=>["","none",S,ke,be],Hn=()=>["none",Ge,ke,be],Tr=()=>["none",Ge,ke,be],pt=()=>[Ge,ke,be],en=()=>[wa,"full",...x()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Fr],breakpoint:[Fr],color:[fx],container:[Fr],"drop-shadow":[Fr],ease:["in","out","in-out"],font:[v3],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Fr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Fr],shadow:[Fr],spacing:["px",Ge],text:[Fr],"text-shadow":[Fr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",wa,be,ke,P]}],container:["container"],columns:[{columns:[Ge,be,ke,c]}],"break-after":[{"break-after":M()}],"break-before":[{"break-before":M()}],"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:q()}],overflow:[{overflow:K()}],"overflow-x":[{"overflow-x":K()}],"overflow-y":[{"overflow-y":K()}],overscroll:[{overscroll:H()}],"overscroll-x":[{"overscroll-x":H()}],"overscroll-y":[{"overscroll-y":H()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:Z()}],"inset-x":[{"inset-x":Z()}],"inset-y":[{"inset-y":Z()}],start:[{"inset-s":Z(),start:Z()}],end:[{"inset-e":Z(),end:Z()}],"inset-bs":[{"inset-bs":Z()}],"inset-be":[{"inset-be":Z()}],top:[{top:Z()}],right:[{right:Z()}],bottom:[{bottom:Z()}],left:[{left:Z()}],visibility:["visible","invisible","collapse"],z:[{z:[xa,"auto",ke,be]}],basis:[{basis:[wa,"full","auto",c,...x()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ge,wa,"auto","initial","none",be]}],grow:[{grow:["",Ge,ke,be]}],shrink:[{shrink:["",Ge,ke,be]}],order:[{order:[xa,"first","last","none",ke,be]}],"grid-cols":[{"grid-cols":Q()}],"col-start-end":[{col:me()}],"col-start":[{"col-start":oe()}],"col-end":[{"col-end":oe()}],"grid-rows":[{"grid-rows":Q()}],"row-start-end":[{row:me()}],"row-start":[{"row-start":oe()}],"row-end":[{"row-end":oe()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Ae()}],"auto-rows":[{"auto-rows":Ae()}],gap:[{gap:x()}],"gap-x":[{"gap-x":x()}],"gap-y":[{"gap-y":x()}],"justify-content":[{justify:[...fe(),"normal"]}],"justify-items":[{"justify-items":[...ce(),"normal"]}],"justify-self":[{"justify-self":["auto",...ce()]}],"align-content":[{content:["normal",...fe()]}],"align-items":[{items:[...ce(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ce(),{baseline:["","last"]}]}],"place-content":[{"place-content":fe()}],"place-items":[{"place-items":[...ce(),"baseline"]}],"place-self":[{"place-self":["auto",...ce()]}],p:[{p:x()}],px:[{px:x()}],py:[{py:x()}],ps:[{ps:x()}],pe:[{pe:x()}],pbs:[{pbs:x()}],pbe:[{pbe:x()}],pt:[{pt:x()}],pr:[{pr:x()}],pb:[{pb:x()}],pl:[{pl:x()}],m:[{m:le()}],mx:[{mx:le()}],my:[{my:le()}],ms:[{ms:le()}],me:[{me:le()}],mbs:[{mbs:le()}],mbe:[{mbe:le()}],mt:[{mt:le()}],mr:[{mr:le()}],mb:[{mb:le()}],ml:[{ml:le()}],"space-x":[{"space-x":x()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":x()}],"space-y-reverse":["space-y-reverse"],size:[{size:Me()}],"inline-size":[{inline:["auto",...W()]}],"min-inline-size":[{"min-inline":["auto",...W()]}],"max-inline-size":[{"max-inline":["none",...W()]}],"block-size":[{block:["auto",...Y()]}],"min-block-size":[{"min-block":["auto",...Y()]}],"max-block-size":[{"max-block":["none",...Y()]}],w:[{w:[c,"screen",...Me()]}],"min-w":[{"min-w":[c,"screen","none",...Me()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[u]},...Me()]}],h:[{h:["screen","lh",...Me()]}],"min-h":[{"min-h":["screen","lh","none",...Me()]}],"max-h":[{"max-h":["screen","lh",...Me()]}],"font-size":[{text:["base",n,mo,Ja]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,T3,_3]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Kh,be]}],"font-family":[{font:[x3,k3,t]}],"font-features":[{"font-features":[be]}],"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:[s,ke,be]}],"line-clamp":[{"line-clamp":[Ge,"none",ke,hb]}],leading:[{leading:[o,...x()]}],"list-image":[{"list-image":["none",ke,be]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ke,be]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:$()}],"text-color":[{text:$()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...qe(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ge,"from-font","auto",ke,Ja]}],"text-decoration-color":[{decoration:$()}],"underline-offset":[{"underline-offset":[Ge,"auto",ke,be]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:x()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ke,be]}],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",ke,be]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:N()}],"bg-repeat":[{bg:G()}],"bg-size":[{bg:xe()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},xa,ke,be],radial:["",ke,be],conic:[xa,ke,be]},P3,w3]}],"bg-color":[{bg:$()}],"gradient-from-pos":[{from:Re()}],"gradient-via-pos":[{via:Re()}],"gradient-to-pos":[{to:Re()}],"gradient-from":[{from:$()}],"gradient-via":[{via:$()}],"gradient-to":[{to:$()}],rounded:[{rounded:Se()}],"rounded-s":[{"rounded-s":Se()}],"rounded-e":[{"rounded-e":Se()}],"rounded-t":[{"rounded-t":Se()}],"rounded-r":[{"rounded-r":Se()}],"rounded-b":[{"rounded-b":Se()}],"rounded-l":[{"rounded-l":Se()}],"rounded-ss":[{"rounded-ss":Se()}],"rounded-se":[{"rounded-se":Se()}],"rounded-ee":[{"rounded-ee":Se()}],"rounded-es":[{"rounded-es":Se()}],"rounded-tl":[{"rounded-tl":Se()}],"rounded-tr":[{"rounded-tr":Se()}],"rounded-br":[{"rounded-br":Se()}],"rounded-bl":[{"rounded-bl":Se()}],"border-w":[{border:Ce()}],"border-w-x":[{"border-x":Ce()}],"border-w-y":[{"border-y":Ce()}],"border-w-s":[{"border-s":Ce()}],"border-w-e":[{"border-e":Ce()}],"border-w-bs":[{"border-bs":Ce()}],"border-w-be":[{"border-be":Ce()}],"border-w-t":[{"border-t":Ce()}],"border-w-r":[{"border-r":Ce()}],"border-w-b":[{"border-b":Ce()}],"border-w-l":[{"border-l":Ce()}],"divide-x":[{"divide-x":Ce()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Ce()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...qe(),"hidden","none"]}],"divide-style":[{divide:[...qe(),"hidden","none"]}],"border-color":[{border:$()}],"border-color-x":[{"border-x":$()}],"border-color-y":[{"border-y":$()}],"border-color-s":[{"border-s":$()}],"border-color-e":[{"border-e":$()}],"border-color-bs":[{"border-bs":$()}],"border-color-be":[{"border-be":$()}],"border-color-t":[{"border-t":$()}],"border-color-r":[{"border-r":$()}],"border-color-b":[{"border-b":$()}],"border-color-l":[{"border-l":$()}],"divide-color":[{divide:$()}],"outline-style":[{outline:[...qe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ge,ke,be]}],"outline-w":[{outline:["",Ge,mo,Ja]}],"outline-color":[{outline:$()}],shadow:[{shadow:["","none",m,vu,yu]}],"shadow-color":[{shadow:$()}],"inset-shadow":[{"inset-shadow":["none",y,vu,yu]}],"inset-shadow-color":[{"inset-shadow":$()}],"ring-w":[{ring:Ce()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:$()}],"ring-offset-w":[{"ring-offset":[Ge,Ja]}],"ring-offset-color":[{"ring-offset":$()}],"inset-ring-w":[{"inset-ring":Ce()}],"inset-ring-color":[{"inset-ring":$()}],"text-shadow":[{"text-shadow":["none",b,vu,yu]}],"text-shadow-color":[{"text-shadow":$()}],opacity:[{opacity:[Ge,ke,be]}],"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":[Ge]}],"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":$()}],"mask-image-linear-to-color":[{"mask-linear-to":$()}],"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":$()}],"mask-image-t-to-color":[{"mask-t-to":$()}],"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":$()}],"mask-image-r-to-color":[{"mask-r-to":$()}],"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":$()}],"mask-image-b-to-color":[{"mask-b-to":$()}],"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":$()}],"mask-image-l-to-color":[{"mask-l-to":$()}],"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":$()}],"mask-image-x-to-color":[{"mask-x-to":$()}],"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":$()}],"mask-image-y-to-color":[{"mask-y-to":$()}],"mask-image-radial":[{"mask-radial":[ke,be]}],"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":$()}],"mask-image-radial-to-color":[{"mask-radial-to":$()}],"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":j()}],"mask-image-conic-pos":[{"mask-conic":[Ge]}],"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":$()}],"mask-image-conic-to-color":[{"mask-conic-to":$()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:N()}],"mask-repeat":[{mask:G()}],"mask-size":[{mask:xe()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ke,be]}],filter:[{filter:["","none",ke,be]}],blur:[{blur:jt()}],brightness:[{brightness:[Ge,ke,be]}],contrast:[{contrast:[Ge,ke,be]}],"drop-shadow":[{"drop-shadow":["","none",w,vu,yu]}],"drop-shadow-color":[{"drop-shadow":$()}],grayscale:[{grayscale:["",Ge,ke,be]}],"hue-rotate":[{"hue-rotate":[Ge,ke,be]}],invert:[{invert:["",Ge,ke,be]}],saturate:[{saturate:[Ge,ke,be]}],sepia:[{sepia:["",Ge,ke,be]}],"backdrop-filter":[{"backdrop-filter":["","none",ke,be]}],"backdrop-blur":[{"backdrop-blur":jt()}],"backdrop-brightness":[{"backdrop-brightness":[Ge,ke,be]}],"backdrop-contrast":[{"backdrop-contrast":[Ge,ke,be]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ge,ke,be]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ge,ke,be]}],"backdrop-invert":[{"backdrop-invert":["",Ge,ke,be]}],"backdrop-opacity":[{"backdrop-opacity":[Ge,ke,be]}],"backdrop-saturate":[{"backdrop-saturate":[Ge,ke,be]}],"backdrop-sepia":[{"backdrop-sepia":["",Ge,ke,be]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":x()}],"border-spacing-x":[{"border-spacing-x":x()}],"border-spacing-y":[{"border-spacing-y":x()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ke,be]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ge,"initial",ke,be]}],ease:[{ease:["linear","initial",L,ke,be]}],delay:[{delay:[Ge,ke,be]}],animate:[{animate:["none",D,ke,be]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[T,ke,be]}],"perspective-origin":[{"perspective-origin":q()}],rotate:[{rotate:Hn()}],"rotate-x":[{"rotate-x":Hn()}],"rotate-y":[{"rotate-y":Hn()}],"rotate-z":[{"rotate-z":Hn()}],scale:[{scale:Tr()}],"scale-x":[{"scale-x":Tr()}],"scale-y":[{"scale-y":Tr()}],"scale-z":[{"scale-z":Tr()}],"scale-3d":["scale-3d"],skew:[{skew:pt()}],"skew-x":[{"skew-x":pt()}],"skew-y":[{"skew-y":pt()}],transform:[{transform:[ke,be,"","none","gpu","cpu"]}],"transform-origin":[{origin:q()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:en()}],"translate-x":[{"translate-x":en()}],"translate-y":[{"translate-y":en()}],"translate-z":[{"translate-z":en()}],"translate-none":["translate-none"],accent:[{accent:$()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:$()}],"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",ke,be]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":x()}],"scroll-mx":[{"scroll-mx":x()}],"scroll-my":[{"scroll-my":x()}],"scroll-ms":[{"scroll-ms":x()}],"scroll-me":[{"scroll-me":x()}],"scroll-mbs":[{"scroll-mbs":x()}],"scroll-mbe":[{"scroll-mbe":x()}],"scroll-mt":[{"scroll-mt":x()}],"scroll-mr":[{"scroll-mr":x()}],"scroll-mb":[{"scroll-mb":x()}],"scroll-ml":[{"scroll-ml":x()}],"scroll-p":[{"scroll-p":x()}],"scroll-px":[{"scroll-px":x()}],"scroll-py":[{"scroll-py":x()}],"scroll-ps":[{"scroll-ps":x()}],"scroll-pe":[{"scroll-pe":x()}],"scroll-pbs":[{"scroll-pbs":x()}],"scroll-pbe":[{"scroll-pbe":x()}],"scroll-pt":[{"scroll-pt":x()}],"scroll-pr":[{"scroll-pr":x()}],"scroll-pb":[{"scroll-pb":x()}],"scroll-pl":[{"scroll-pl":x()}],"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",ke,be]}],fill:[{fill:["none",...$()]}],"stroke-w":[{stroke:[Ge,mo,Ja,hb]}],stroke:[{stroke:["none",...$()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{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"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},A3=o3(E3);function Ct(...e){return A3(FI(e))}const R3=I.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",children:[I.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"}),I.jsx("path",{d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23Z",fill:"#34A853"}),I.jsx("path",{d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18A10.96 10.96 0 0 0 1 12c0 1.77.42 3.44 1.18 4.93l3.66-2.84Z",fill:"#FBBC05"}),I.jsx("path",{d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53Z",fill:"#EA4335"})]}),L3=I.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor",children:I.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"})}),D3={google:R3,github:L3},M3={google:"Google",github:"GitHub",microsoft:"Microsoft",discord:"Discord",apple:"Apple"};function N3(e){return M3[e]||String(e||"").replace(/-/g," ")}function O3(){Ko();const{isOpen:e,closeLoginModal:t}=bk(),{enabled:n,signedIn:a,refreshUser:s,signInWithPassword:o,signUp:u,signInWithOAuth:c,getPublicAuthConfig:h}=Ho(),[f,m]=k.useState("signin"),[y,b]=k.useState(""),[w,S]=k.useState(""),[T,P]=k.useState(""),[L,D]=k.useState(!1),[M,j]=k.useState(null),[q,K]=k.useState(null),[H,x]=k.useState(!1),[Z,Q]=k.useState(!0),[me,oe]=k.useState([]),[Ae,fe]=k.useState(8);k.useEffect(()=>{e&&(j(null),K(null),m("signin"),b(""),S(""),P(""),x(!1))},[e]),k.useEffect(()=>{if(!e||!n){Q(!1);return}let W=!0;return(async()=>{const{data:Y,error:$}=await h();if(W){if($||!Y)oe(["google","github"]);else{const N=Array.isArray(Y.oAuthProviders)?Y.oAuthProviders:[],G=Array.isArray(Y.customOAuthProviders)?Y.customOAuthProviders:[];oe([...N,...G]),typeof Y.passwordMinLength=="number"&&Y.passwordMinLength>0&&fe(Y.passwordMinLength)}Q(!1)}})(),()=>{W=!1}},[e,n,h]),k.useEffect(()=>{e&&a&&t()},[e,a,t]);const ce=k.useMemo(()=>typeof window>"u"?"":!!window.webkit?.messageHandlers?.nativeOAuth?`${window.location.origin}/auth/callback`:`${window.location.origin}/`,[]),le=k.useCallback(async W=>{j(null),D(!0);try{const{error:Y}=await c(W,ce);Y&&j(Y.message||String(Y))}finally{D(!1)}},[c,ce]),Me=k.useCallback(async W=>{W.preventDefault(),j(null),D(!0);try{if(f==="signup"){const{data:$,error:N}=await u({email:y.trim(),password:w,name:T.trim()||void 0});if(N){j(N.message||String(N));return}if($?.requireEmailVerification){K(Fe("login.verify_email_pending")),m("signin");return}await s();return}const{error:Y}=await o({email:y.trim(),password:w});if(Y){j(Y.message||String(Y));return}await s()}finally{D(!1)}},[f,y,w,T,u,o,s]);return k.useEffect(()=>{if(!e)return;const W=Y=>{Y.key==="Escape"&&t()};return document.addEventListener("keydown",W),()=>document.removeEventListener("keydown",W)},[e,t]),n?I.jsx(DO,{children:e&&I.jsxs(Wh.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:[I.jsx(Wh.div,{className:"absolute inset-0 bg-black/40 dark:bg-black/60 ",onClick:t,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}}),I.jsxs(Wh.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 p-6 shadow-2xl",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:W=>W.stopPropagation(),children:[I.jsx("button",{type:"button",onClick:t,className:"absolute right-4 top-4 text-oai-gray-400 dark:text-oai-gray-500 hover:text-oai-black dark:hover:text-white transition-colors",children:I.jsx(gk,{className:"h-5 w-5"})}),I.jsxs("div",{className:"text-center mb-6",children:[I.jsxs("div",{className:"flex items-center justify-center gap-2 mb-2",children:[I.jsx("img",{src:"/app-icon.png",alt:"",width:28,height:28,className:"rounded-md"}),I.jsx("span",{className:"text-lg font-semibold text-oai-black dark:text-white",children:"Token Tracker"})]}),I.jsx("p",{className:"text-sm text-oai-gray-500",children:Fe("login_modal.subtitle")})]}),q&&I.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:q}),M&&I.jsx("p",{className:"mb-4 text-sm text-red-500 dark:text-red-400",role:"alert",children:M}),I.jsx("div",{className:"space-y-2.5 mb-5",children:Z?I.jsx("div",{className:"h-10 rounded-lg bg-oai-gray-100 dark:bg-oai-gray-900 animate-pulse"}):me.map(W=>I.jsxs("button",{type:"button",disabled:L,onClick:()=>le(W),className:Ct("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:[D3[W]||null,Fe("login.oauth.continue",{provider:N3(W)})]},W))}),H?I.jsxs(I.Fragment,{children:[I.jsxs("div",{className:"relative mb-5",children:[I.jsx("div",{className:"absolute inset-0 flex items-center",children:I.jsx("span",{className:"w-full border-t border-oai-gray-200 dark:border-oai-gray-800"})}),I.jsx("div",{className:"relative flex justify-center text-xs uppercase tracking-wider",children:I.jsx("span",{className:"bg-white dark:bg-oai-gray-950 px-3 text-oai-gray-400 dark:text-oai-gray-600",children:Fe("login_modal.divider_email")})})]}),I.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:[I.jsx("button",{type:"button",className:Ct("flex-1 py-1.5 text-xs font-medium rounded-md transition-colors",f==="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:()=>{m("signin"),j(null)},children:Fe("login.tab.sign_in")}),I.jsx("button",{type:"button",className:Ct("flex-1 py-1.5 text-xs font-medium rounded-md transition-colors",f==="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:()=>{m("signup"),j(null)},children:Fe("login.tab.sign_up")})]}),I.jsxs("form",{onSubmit:Me,className:"space-y-3",children:[f==="signup"&&I.jsxs("div",{children:[I.jsx("label",{htmlFor:"modal-name",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:Fe("login.field.name")}),I.jsx("input",{id:"modal-name",type:"text",autoComplete:"name",value:T,onChange:W=>P(W.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:Fe("login.field.name_placeholder")})]}),I.jsxs("div",{children:[I.jsx("label",{htmlFor:"modal-email",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:Fe("login.field.email")}),I.jsx("input",{id:"modal-email",type:"email",autoComplete:"email",required:!0,value:y,onChange:W=>b(W.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"})]}),I.jsxs("div",{children:[I.jsx("label",{htmlFor:"modal-password",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:Fe("login.field.password")}),I.jsx("input",{id:"modal-password",type:"password",autoComplete:f==="signup"?"new-password":"current-password",required:!0,minLength:f==="signup"?Ae:void 0,value:w,onChange:W=>S(W.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"}),f==="signup"&&I.jsx("p",{className:"mt-1 text-xs text-oai-gray-400 dark:text-oai-gray-600",children:Fe("login.password_hint",{min:String(Ae)})})]}),I.jsx("button",{type:"submit",disabled:L,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:Fe(f==="signup"?"login.submit.sign_up":"login.submit.sign_in")})]})]}):I.jsxs(I.Fragment,{children:[I.jsxs("div",{className:"relative mb-5",children:[I.jsx("div",{className:"absolute inset-0 flex items-center",children:I.jsx("span",{className:"w-full border-t border-oai-gray-200 dark:border-oai-gray-800"})}),I.jsx("div",{className:"relative flex justify-center text-xs uppercase tracking-wider",children:I.jsx("span",{className:"bg-white dark:bg-oai-gray-950 px-3 text-oai-gray-400 dark:text-oai-gray-600",children:Fe("login.divider")})})]}),I.jsxs("button",{type:"button",onClick:()=>x(!0),className:Ct("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:[I.jsx(yD,{className:"h-[18px] w-[18px] text-oai-gray-500 dark:text-oai-gray-400",strokeWidth:1.75}),Fe("login_modal.continue_email")]})]})]})]})}):null}const I3={VITE_INSFORGE_BASE_URL:"https://srctyff5.us-east.insforge.app"};function j3(){if(typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"))return"";const t=typeof import.meta<"u"?I3:void 0;return(t?.VITE_TOKENTRACKER_BACKEND_BASE_URL||t?.VITE_INSFORGE_BASE_URL||"").trim()}function p4(){return fi()}function U3(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 B3=300*1e3,F3=720*60*1e3;function tm(e){return typeof e=="string"&&/^https?:\/\//i.test(e.trim())}function V3(e,t=Date.now()){if(!e?.token||!e?.deviceId||!e?.issuedAt)return!0;const n=Date.parse(e.issuedAt);return Number.isFinite(n)?n+F3<=t:!0}async function kx(e,t){const n=fi();if(!tm(n)||!e)return;const a=n.replace(/\/$/,""),s=_c(),o={Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${e}`};s&&(o.apikey=s);try{await fetch(`${a}/functions/tokentracker-leaderboard-refresh`,{method:"POST",headers:o,body:JSON.stringify({period:"week",source:t})})}catch{}}async function z3(e){const t=fi();if(!tm(t)||!e)return null;const n=t.replace(/\/$/,""),a=_c(),s={Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${e}`};a&&(s.apikey=a);const o=typeof navigator<"u"&&typeof navigator.platform=="string"?navigator.platform:"web",u=await fetch(`${n}/functions/tokentracker-device-token-issue`,{method:"POST",headers:s,body:JSON.stringify({device_name:"Token Tracker (dashboard)",platform:o})});if(!u.ok)return null;const c=await u.json().catch(()=>null),h=typeof c?.token=="string"?c.token:null,f=typeof c?.device_id=="string"?c.device_id:null;return!h||!f?null:{token:h,deviceId:f,issuedAt:typeof c?.created_at=="string"?c.created_at:new Date().toISOString()}}async function mb(e){const{deviceToken:t,insforgeBaseUrl:n}=e,a={deviceToken:t},s=n||fi();tm(s)&&(a.insforgeBaseUrl=s.trim());const o=await _p(),u=await fetch("/functions/tokentracker-local-sync",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",...o},body:JSON.stringify(a)}),c=await u.json().catch(()=>({}));if(!u.ok){const h=typeof c.error=="string"?c.error:`HTTP ${u.status}`;throw new Error(h)}return c}async function gb(e){const t=await e();if(!t)return null;const n=W_();if(n&&!V3(n))return n;const a=await z3(t);return a?(_R(a),a):null}async function wx(e){let t=await e();if(!t)return null;let n=await gb(async()=>t);if(!n)return t;try{return await mb({deviceToken:n.token,insforgeBaseUrl:fi()}),t}catch(a){if(!W_()||(K_(),t=await e(),!t)||(n=await gb(async()=>t),!n))throw a;return await mb({deviceToken:n.token,insforgeBaseUrl:fi()}),t}}async function $3(e){const t=kR();if(Date.now()-t<B3)return;const n=await wx(e);n&&(q_(Date.now()),await kx(n,"cloud-sync-auto"))}async function m4(e){const t=await wx(e);t&&(q_(Date.now()),await kx(t,"cloud-sync-now"))}function H3(e){const t=e.replace(/\/+$/,"")||"/";return t==="/share"||t==="/share.html"||t.startsWith("/share/")}function W3(e){const t=e.replace(/\/+$/,"")||"/";return t==="/login"||t==="/landing"||H3(t)?!1:t==="/"||t==="/dashboard"||t.startsWith("/leaderboard")}function K3(){const e=Fn(),t=Ho(),n=k.useRef(!1);k.useEffect(()=>{if(!vR()||!W3(e.pathname||"/")||!t.enabled||!t.signedIn||t.loading||!bR())return;let a=!1;const s=window.setTimeout(()=>{(async()=>{if(!(a||n.current)){n.current=!0;try{await $3(()=>t.getAccessToken())}catch(o){console.warn("[tokentracker] cloud usage sync:",o)}finally{n.current=!1}}})()},2500);return()=>{a=!0,window.clearTimeout(s)}},[e.pathname,t.enabled,t.signedIn,t.loading,t.getAccessToken])}function q3(){const e=k.useContext(yk);if(e===null)throw new Error("useTheme must be used within a ThemeProvider");return e}function G3({prefersReducedMotion:e,screenshotCapture:t}){return!(t||e)}function Y3(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 yb(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 vb({className:e,variant:t="header",collapsed:n=!1,onAfterAction:a}){Ko();const s=t==="sidebar",{enabled:o,loading:u,signedIn:c,user:h,displayName:f}=Ho(),{openLoginModal:m}=bk(),y=fc(),b=k.useMemo(()=>Y3(h),[h]);if(!o)return null;if(u)return I.jsx("div",{className:Ct("h-9 w-9 shrink-0 rounded-full bg-oai-gray-200 dark:bg-oai-gray-800 animate-pulse",e),"aria-hidden":!0});if(!c)return s?I.jsxs("button",{type:"button",onClick:()=>{m(),a?.()},className:Ct("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":Fe("header.auth.sign_in_aria"),title:n?Fe("header.auth.sign_in_aria"):void 0,children:[I.jsx("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center",children:I.jsx("img",{src:"/app-icon.png",alt:"",width:18,height:18,className:"h-[18px] w-[18px] rounded"})}),!n&&I.jsx("span",{className:"truncate flex-1 text-left",children:Fe("header.auth.sign_in_aria")})]}):I.jsx("button",{type:"button",onClick:m,className:Ct("shrink-0 inline-flex h-9 items-center justify-center gap-1.5 rounded-full px-5 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":Fe("header.auth.sign_in_aria"),children:Fe("header.auth.sign_in_aria")});const w=()=>{y("/settings"),a?.()};return I.jsx("div",{className:Ct(s?"relative flex w-full shrink-0 items-center":"relative flex shrink-0 items-center",e),children:I.jsxs("button",{type:"button",onClick:w,className:Ct(s?Ct("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-full 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":Fe("header.auth.open_settings"),title:s&&n?f:void 0,children:[s?I.jsx("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center",children:b?I.jsx("img",{src:b,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"}):I.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:yb(f)})}):b?I.jsx("img",{src:b,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"}):I.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:yb(f)}),s?!n&&I.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}):I.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 zf="tt.sidebarCollapsed";function Z3(){return[{id:"general",label:Fe("nav.group.general"),items:[{id:"usage",to:"/dashboard",icon:uD,label:Fe("nav.usage")},{id:"limits",to:"/limits",icon:dD,label:Fe("nav.limits")},{id:"leaderboard",to:"/leaderboard",icon:MD,label:Fe("nav.leaderboard")}]},{id:"tools",label:Fe("nav.group.tools"),items:[{id:"widgets",to:"/widgets",icon:mD,label:Fe("nav.widgets")},{id:"skills",to:"/skills",icon:SD,label:Fe("nav.skills")},{id:"ip-check",to:"/ip-check",icon:fD,label:Fe("nav.ip_check")}]},{id:"account",label:Fe("nav.group.account"),items:[{id:"settings",to:"/settings",icon:ED,label:Fe("nav.settings")}]}]}function Q3(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(zf)==="1"}catch{return!1}}function X3(){const[e,t]=k.useState(Q3),n=k.useCallback(()=>{t(a=>{const s=!a;try{typeof window<"u"&&window.localStorage.setItem(zf,s?"1":"0")}catch{}return s})},[]);return k.useEffect(()=>{if(typeof window>"u")return;const a=s=>{s.key===zf&&t(s.newValue==="1")};return window.addEventListener("storage",a),()=>window.removeEventListener("storage",a)},[]),{collapsed:e,toggle:n}}function J3(e,t){const n=e.replace(/\/+$/,"")||"/";return t==="/dashboard"?n==="/dashboard"||n==="/":t==="/leaderboard"?n==="/leaderboard"||n.startsWith("/leaderboard/"):n===t}function ej({label:e,collapsed:t,first:n}){return t?n?null:I.jsx("div",{className:"mx-2 my-2 h-px bg-oai-gray-200/70 dark:bg-oai-gray-800/70","aria-hidden":!0}):I.jsx("div",{className:Ct("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 tj({item:e,collapsed:t,active:n,onClick:a}){const s=e.icon;return I.jsxs(mc,{to:e.to,onClick:a,title:t?e.label:void 0,"aria-current":n?"page":void 0,className:Ct("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:[I.jsx("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center",children:I.jsx(s,{className:"h-[15px] w-[15px]","aria-hidden":!0})}),!t&&I.jsx("span",{className:"truncate",children:e.label})]})}function nj({as:e="button",title:t,onClick:n,href:a,children:s,className:o,...u}){const c=Ct("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",o);return e==="a"?I.jsx("a",{href:a,target:"_blank",rel:"noopener noreferrer",title:t,"aria-label":t,className:c,...u,children:s}):I.jsx("button",{type:"button",title:t,"aria-label":t,onClick:n,className:c,...u,children:s})}function rj({repo:e="mm7894215/TokenTracker",glassChrome:t=!1}){const[n,a]=k.useState(null);return k.useEffect(()=>{if(typeof window>"u")return;const s=typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;G3({prefersReducedMotion:s,screenshotCapture:!1})&&fetch(`https://api.github.com/repos/${e}`).then(o=>o.json()).then(o=>{o&&typeof o.stargazers_count=="number"&&a(o.stargazers_count)}).catch(()=>{})},[e]),I.jsxs("a",{href:`https://github.com/${e}`,target:"_blank",rel:"noopener noreferrer","aria-label":n!==null?`Star on GitHub (${n})`:"Star on GitHub",className:Ct("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:[I.jsx("svg",{height:"12",viewBox:"0 0 16 16",width:"12",className:"shrink-0 fill-current",children:I.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"})}),I.jsx("span",{children:"Star"}),n!==null&&I.jsx("span",{className:"text-[10px] text-oai-gray-500 dark:text-oai-gray-500 tabular-nums",children:n})]})}const aj=[{value:"light",label:"Light",Icon:mk},{value:"dark",label:"Dark",Icon:pk},{value:"system",label:"System",Icon:kD}];function ij({theme:e,resolvedTheme:t,onSetTheme:n,glassChrome:a=!1}){const[s,o]=k.useState(!1),u=k.useRef(null),c=t==="dark"?pk:mk;return k.useEffect(()=>{if(!s)return;const h=m=>{u.current&&!u.current.contains(m.target)&&o(!1)},f=m=>{m.key==="Escape"&&o(!1)};return document.addEventListener("mousedown",h),document.addEventListener("keydown",f),()=>{document.removeEventListener("mousedown",h),document.removeEventListener("keydown",f)}},[s]),I.jsxs("div",{ref:u,className:"relative",children:[I.jsx("button",{type:"button","aria-label":"Theme","aria-expanded":s,"aria-haspopup":"menu",title:"Theme",onClick:()=>o(h=>!h),className:Ct("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:I.jsx(c,{className:"h-3.5 w-3.5","aria-hidden":!0})}),s&&I.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:aj.map(({value:h,label:f,Icon:m})=>{const y=e===h;return I.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{n(h),o(!1)},className:Ct("flex w-full items-center gap-2.5 px-3 py-1.5 text-[13px] transition-colors",y?"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:[I.jsx(m,{className:"h-3.5 w-3.5 shrink-0","aria-hidden":!0}),I.jsx("span",{children:f})]},h)})})]})}function xx({collapsed:e,onToggleCollapsed:t,onItemClick:n,showCloseButton:a=!1,onClose:s,glassChrome:o=!1}){const c=Fn()?.pathname||"/",{theme:h,resolvedTheme:f,setTheme:m}=q3(),{resolvedLocale:y}=Ko(),b=k.useMemo(()=>Z3(),[y]);return I.jsxs(I.Fragment,{children:[I.jsx("div",{className:Ct("px-2 pt-2 pb-2",e&&"flex justify-center"),children:a?I.jsxs("div",{className:"flex items-center gap-2",children:[I.jsx("div",{className:"flex-1 min-w-0",children:I.jsx(vb,{variant:"sidebar",collapsed:e,onAfterAction:n})}),I.jsx("button",{type:"button",onClick:s,"aria-label":Fe("nav.close_menu"),title:Fe("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:I.jsx(gk,{className:"h-4 w-4",strokeWidth:1.75,"aria-hidden":!0})})]}):I.jsx(vb,{variant:"sidebar",collapsed:e,onAfterAction:n})}),I.jsx("nav",{"aria-label":Fe("nav.nav_label"),className:"flex-1 px-2 pb-2 flex flex-col overflow-y-auto",children:b.map((w,S)=>I.jsxs("div",{className:"flex flex-col",children:[I.jsx(ej,{label:w.label,collapsed:e,first:S===0}),I.jsx("div",{className:"flex flex-col gap-0.5",children:w.items.map(T=>I.jsx(tj,{item:T,collapsed:e,active:J3(c,T.to),onClick:n},T.id))})]},w.id))}),I.jsxs("div",{className:Ct("flex items-center px-2 py-3",e?"flex-col justify-center gap-2":"justify-between gap-2"),children:[I.jsx(ij,{theme:h,resolvedTheme:f,onSetTheme:m,glassChrome:o}),I.jsx("div",{className:"flex items-center gap-1.5",children:!e&&I.jsx(rj,{glassChrome:o})})]})]})}function sj({collapsed:e,onToggleCollapsed:t}){const n=k.useMemo(()=>typeof window>"u"?!1:mr()||ok(),[]);return I.jsx("aside",{"aria-label":Fe("nav.aside_label"),className:Ct("hidden lg:flex flex-col shrink-0 h-full min-h-0 transition-[width] duration-200",e?"w-[72px]":"w-[220px]"),children:I.jsx(xx,{collapsed:e,onToggleCollapsed:t,glassChrome:n})})}function oj({open:e,onClose:t}){return k.useEffect(()=>{if(!e)return;const n=a=>{a.key==="Escape"&&t()};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[e,t]),k.useEffect(()=>{if(!e)return;const n=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=n}},[e]),e?I.jsxs("div",{className:"lg:hidden fixed inset-0 z-[80] flex",children:[I.jsx("div",{className:"absolute inset-0 bg-black/40 backdrop-blur-sm",onClick:t,"aria-hidden":!0}),I.jsx("aside",{"aria-label":Fe("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:I.jsx(xx,{collapsed:!1,showCloseButton:!0,onClose:t,onItemClick:t})})]}):null}function lj({onOpenDrawer:e}){return I.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:[I.jsx(nj,{title:Fe("nav.menu"),onClick:e,children:I.jsx(bD,{className:"h-5 w-5","aria-hidden":!0})}),I.jsxs(mc,{to:"/landing",className:"flex items-center gap-2 no-underline hover:opacity-80 transition-opacity","aria-label":"Token Tracker",children:[I.jsx("img",{src:"/app-icon.png",alt:"",width:24,height:24,className:"rounded-md"}),I.jsx("span",{className:"text-sm font-semibold text-oai-black dark:text-oai-white",children:"Token Tracker"})]}),I.jsx("div",{className:"w-10 shrink-0","aria-hidden":!0})]})}function uj({children:e}){const{collapsed:t,toggle:n}=X3(),[a,s]=k.useState(!1),o=k.useCallback(()=>s(!0),[]),u=k.useCallback(()=>s(!1),[]),c=k.useMemo(()=>typeof window>"u"?!1:mr()||ok(),[]);return I.jsxs("div",{className:Ct("fixed inset-0 flex flex-col text-oai-black dark:text-oai-white font-sans overflow-hidden",c?"bg-transparent":"bg-oai-gray-100 dark:bg-oai-gray-950"),children:[c&&I.jsx("div",{className:"h-7 shrink-0",style:{WebkitAppRegion:"drag"},"aria-hidden":!0}),I.jsxs("div",{className:"flex-1 min-h-0 flex",children:[I.jsx(sj,{collapsed:t,onToggleCollapsed:n}),I.jsx(oj,{open:a,onClose:u}),I.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:I.jsxs("div",{className:Ct("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",c?"tt-native-main-card":"rounded-2xl",!c&&"shadow-sm"),children:[I.jsx(lj,{onOpenDrawer:o}),I.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto",children:e})]})})]})]})}const cj=typeof window<"u"?window.location.search:"",bb=new URLSearchParams(cj),bu=bb.get("insforge_code")||bb.get("code")||null;function dj(){Ko();const{loading:e,signedIn:t}=Ho(),n=fc(),[a,s]=k.useState("processing"),[o,u]=k.useState(null),c=k.useRef(!1);k.useEffect(()=>{!bu||c.current||(c.current=!0,(async()=>{try{const m=await(await fetch("/api/auth-bridge/verifier")).json();u(!!m?.native)}catch{u(!1)}})())},[]),k.useEffect(()=>{if(o!==!0||!bu)return;s("redirecting");const f=setTimeout(()=>{window.location.href=`tokentracker://auth/callback?insforge_code=${encodeURIComponent(bu)}`},200);return()=>clearTimeout(f)},[o]),k.useEffect(()=>{if(o!==!1||e)return;if(t){n("/dashboard",{replace:!0});return}const f=setTimeout(()=>{t||s("failed")},5e3);return()=>clearTimeout(f)},[o,e,t,n]),k.useEffect(()=>{if(!bu&&o===null){const f=setTimeout(()=>s("failed"),3e3);return()=>clearTimeout(f)}},[o]);const h=()=>{n("/dashboard",{replace:!0})};return a==="processing"&&o!==!0&&(o===null||o===!1&&e)?I.jsx("div",{className:"min-h-screen bg-oai-gray-950"}):I.jsx("div",{className:"min-h-screen bg-oai-gray-950 text-white font-oai antialiased dark flex items-center justify-center",children:I.jsxs("div",{className:"text-center space-y-4 max-w-sm px-4",children:[a==="processing"&&I.jsxs(I.Fragment,{children:[I.jsx("div",{className:"w-8 h-8 border-2 border-oai-gray-600 border-t-white rounded-full animate-spin mx-auto"}),I.jsx("p",{className:"text-oai-gray-400 text-sm",children:Fe("auth.callback.processing")})]}),a==="redirecting"&&I.jsxs(I.Fragment,{children:[I.jsx("div",{className:"w-12 h-12 mx-auto rounded-full bg-green-500/15 flex items-center justify-center",children:I.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:I.jsx("path",{d:"M20 6 9 17l-5-5"})})}),I.jsx("p",{className:"text-white text-sm font-medium",children:Fe("auth.callback.success")}),I.jsx("p",{className:"text-oai-gray-500 text-xs",children:Fe("auth.callback.redirecting")})]}),a==="failed"&&I.jsxs("div",{className:"space-y-3",children:[I.jsx("p",{className:"text-oai-gray-300 text-sm",children:Fe("auth.callback.failed")}),I.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:Fe("auth.callback.close")})]})]})})}const hj=k.lazy(()=>$n(()=>import("./DashboardPage-DqsLRhn6.js"),__vite__mapDeps([0,1,2,3,4,5,6])).then(e=>({default:e.DashboardPage}))),fj=k.lazy(()=>$n(()=>import("./IpCheckPage-Dkp3KLz5.js"),[])),pj=k.lazy(()=>$n(()=>import("./LandingPage-BrXJJj3l.js"),__vite__mapDeps([7,8,4])).then(e=>({default:e.LandingPage}))),mj=k.lazy(()=>$n(()=>import("./LeaderboardPage-DvrAcWn2.js"),__vite__mapDeps([9,5,10,11])).then(e=>({default:e.LeaderboardPage}))),gj=k.lazy(()=>$n(()=>import("./LeaderboardProfilePage-KRQhdatN.js"),__vite__mapDeps([12,8,10])).then(e=>({default:e.LeaderboardProfilePage}))),yj=k.lazy(()=>$n(()=>import("./LimitsPage-Ds-pKbQw.js"),__vite__mapDeps([13,1,14,3,6,4])).then(e=>({default:e.LimitsPage}))),vj=k.lazy(()=>$n(()=>import("./LoginPage-t-VKaIRw.js"),[]).then(e=>({default:e.LoginPage}))),bj=k.lazy(()=>$n(()=>import("./DevicePage-Dz2WacAK.js"),[])),_j=k.lazy(()=>$n(()=>import("./WrappedPage-DRoff4y0.js"),[])),kj=k.lazy(()=>$n(()=>import("./SettingsPage-DhiG9bbD.js"),__vite__mapDeps([15,14,16,3,17,18])).then(e=>({default:e.SettingsPage}))),wj=k.lazy(()=>$n(()=>import("./SkillsPage-BdtuTu9f.js"),__vite__mapDeps([19,3,2,5,17,4,11,18])).then(e=>({default:e.SkillsPage}))),xj=k.lazy(()=>$n(()=>import("./WidgetsPage--n-BUbXK.js"),__vite__mapDeps([20,16,3,6,4,18,11])).then(e=>({default:e.WidgetsPage})));function Sj(){const{resolvedLocale:e}=Ko(),t=Fn(),n=Ho();K3();const a=Pn(),s=k.useMemo(()=>typeof window>"u"?!1:U3(window.location.search),[]),o=t?.pathname||"/",u=new URL(window.location.href),c=u.pathname.replace(/\/+$/,"")||"/",f=c.match(/^\/share\/([^/?#]+)$/i)?.[1]||null,m=u.searchParams.get("token")||null,y=f||m,b=c==="/share"||c==="/share.html"||c.startsWith("/share/"),w=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"),S=o.replace(/\/+$/,"")||"/",T=S.match(/^\/leaderboard\/u\/([^/]+)$/i),P=T?T[1]:null,L=S==="/leaderboard"||!!P,D=!!(n.enabled&&n.signedIn),M=w||D,j=!1,q=j3(),K=k.useMemo(()=>!n.enabled||!D?null:{getAccessToken:()=>n.getAccessToken(),name:n.displayName||"",userId:n.user?.id||null},[D,n]);let H=w||a||s?"dashboard":"landing";S==="/landing"&&(H="landing"),S==="/dashboard"&&(H="dashboard"),L&&(H="dashboard");const x=S==="/limits",Z=S==="/settings",Q=S==="/skills",me=S==="/widgets",oe=S==="/ip-check";(x||Z||Q||me||oe)&&(H="dashboard");let Ae=hj;P?Ae=gj:S==="/leaderboard"?Ae=mj:x?Ae=yj:Z?Ae=kj:Q?Ae=wj:me?Ae=xj:oe&&(Ae=fj);const ce=!b&&(S==="/dashboard"||S==="/"||S==="/leaderboard"||x||Z||Q||me||oe);let le=null;if(S==="/auth/callback"||S==="/auth/native-callback")le=I.jsx(dj,{});else if(S==="/login")le=I.jsx(vj,{});else if(S==="/device")le=I.jsx(bj,{});else if(S==="/wrapped")le=I.jsx(_j,{});else if(H==="landing")le=I.jsx(pj,{signInUrl:"/login",signUpUrl:"/login"});else{const Me=I.jsx(Ae,{baseUrl:q,auth:K,signedIn:M,sessionSoftExpired:j,signOut:()=>n.enabled?n.signOut():Promise.resolve(),publicMode:b,publicToken:y,userId:P,signInUrl:"/login",signUpUrl:"/login"},e);ce?le=I.jsx(uj,{children:Me}):le=Me}return I.jsx(ID,{children:I.jsx(BD,{children:I.jsxs(FD,{children:[I.jsx(k.Suspense,{fallback:null,children:le}),I.jsx(O3,{}),I.jsx(HL,{}),I.jsx(tD,{})]})})})}const Pj=CT([{path:"*",element:I.jsx(Sj,{})}]);mP.createRoot(document.getElementById("root")).render(I.jsx(Hf.StrictMode,{children:I.jsx(RL,{children:I.jsx(aL,{children:I.jsx(FT,{router:Pj})})})}));export{LR as $,Y_ as A,Fe as B,I as C,q3 as D,$j as E,Wh as F,Hj as G,OD as H,t4 as I,ic as J,jj as K,mc as L,Zp as M,Ij as N,DO as O,bk as P,Ho as Q,Hf as R,l4 as S,Gj as T,Ko as U,U3 as V,Ea as W,gk as X,Xj as Y,Wj as Z,$n as _,qt as a,Uj as a0,Bj as a1,Jj as a2,zj as a3,o4 as a4,Ct as a5,vb as a6,BT as a7,Fn as a8,fc as a9,d4 as aA,mr as aB,ok as aC,u4 as aD,h4 as aE,c4 as aF,zv as aG,ww as aH,mN as aI,Nf as aJ,p4 as aa,bR as ab,Mj as ac,m4 as ad,Nj as ae,Zj as af,Qj as ag,G3 as ah,ED as ai,i4 as aj,Tj as ak,gR as al,Sp as am,vR as an,Uv as ao,Yj as ap,mk as aq,pk as ar,kD as as,ps as at,Zu as au,kp as av,TD as aw,_p as ax,cP as ay,$f as az,_k as b,dn as c,Na as d,o0 as e,dt as f,Z_ as g,Pn as h,IM as i,Oj as j,PR as k,s4 as l,gs as m,NR as n,OR as o,n4 as p,Vj as q,k as r,qj as s,r4 as t,Pp as u,a4 as v,Fj as w,yt as x,Kj as y,e4 as z};