tokentracker-cli 0.5.88 → 0.5.90

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 (32) hide show
  1. package/README.md +2 -0
  2. package/README.zh-CN.md +9 -0
  3. package/dashboard/dist/assets/{Card-Cwz-PEn8.js → Card-DmEuggKt.js} +1 -1
  4. package/dashboard/dist/assets/{DashboardPage-qwG6gudg.js → DashboardPage-y-23SkNx.js} +1 -1
  5. package/dashboard/dist/assets/{FadeIn-CKfrd1Vn.js → FadeIn-CIKEJ1mC.js} +1 -1
  6. package/dashboard/dist/assets/{IpCheckPage-D0qJYbXD.js → IpCheckPage-gySQmJPU.js} +1 -1
  7. package/dashboard/dist/assets/{LeaderboardPage-Dkpcb_0Q.js → LeaderboardPage-NXXlBlrm.js} +1 -1
  8. package/dashboard/dist/assets/{LeaderboardProfilePage-DHxne8i3.js → LeaderboardProfilePage-DzLc0enb.js} +1 -1
  9. package/dashboard/dist/assets/{LimitsPage-Dvo_YUik.js → LimitsPage-DuFEVRFB.js} +1 -1
  10. package/dashboard/dist/assets/{PopoverPopup-CAeHe-sn.js → PopoverPopup-RgvO6hnU.js} +2 -2
  11. package/dashboard/dist/assets/ProviderIcon-C4FxGWlI.js +1 -0
  12. package/dashboard/dist/assets/SettingsPage-CmdNVChM.js +1 -0
  13. package/dashboard/dist/assets/SkillsPage-Dkv9LvM1.js +1 -0
  14. package/dashboard/dist/assets/WidgetsPage-C8SSZ3VZ.js +1 -0
  15. package/dashboard/dist/assets/{chevron-down-Bj2POypL.js → chevron-down-BS4d25ie.js} +1 -1
  16. package/dashboard/dist/assets/{download-1Kz0otkw.js → download-Cs4or3vN.js} +1 -1
  17. package/dashboard/dist/assets/{leaderboard-columns-DRc_1zw2.js → leaderboard-columns-5fNRo700.js} +1 -1
  18. package/dashboard/dist/assets/{main-jua4nv-E.js → main-Dirgz7qK.js} +53 -34
  19. package/dashboard/dist/assets/main-HVmSQFS6.css +1 -0
  20. package/dashboard/dist/assets/{refresh-cw-Dpw9ponb.js → refresh-cw-oESlYWjZ.js} +1 -1
  21. package/dashboard/dist/assets/{use-limits-display-prefs-CtpaNbnl.js → use-limits-display-prefs-LMbFljwt.js} +1 -1
  22. package/dashboard/dist/assets/use-native-settings-B9dgqLeX.js +1 -0
  23. package/dashboard/dist/assets/{use-usage-limits-B0OYz2eA.js → use-usage-limits-Z6xWV0y7.js} +1 -1
  24. package/dashboard/dist/clawd/mini/idle-tight.svg +15 -0
  25. package/dashboard/dist/index.html +2 -2
  26. package/dashboard/dist/share.html +2 -2
  27. package/package.json +1 -1
  28. package/dashboard/dist/assets/ProviderIcon-Bz-JlVCc.js +0 -1
  29. package/dashboard/dist/assets/SettingsPage-M4ONOKBT.js +0 -1
  30. package/dashboard/dist/assets/SkillsPage-QB4a2NKJ.js +0 -1
  31. package/dashboard/dist/assets/WidgetsPage-Dqd4z_tl.js +0 -1
  32. package/dashboard/dist/assets/main-PEflgXnj.css +0 -1
@@ -1 +1 @@
1
- import{G as d,D as n,H as a}from"./main-jua4nv-E.js";function v({children:i,delay:t=0,duration:o=.4,y:e=20,className:s="",once:r=!0}){return d()?n.jsx("div",{className:s,children:i}):n.jsx(a.div,{initial:{opacity:0,y:e},animate:{opacity:1,y:0},transition:{duration:o,delay:t,ease:[.25,.1,.25,1]},className:s,children:i})}function x({children:i,staggerDelay:t=.1,initialDelay:o=0,className:e=""}){return d()?n.jsx("div",{className:e,children:i}):n.jsx(a.div,{initial:"hidden",animate:"visible",variants:{hidden:{},visible:{transition:{staggerChildren:t,delayChildren:o}}},className:e,children:i})}function h({children:i,className:t="",y:o=20}){return d()?n.jsx("div",{className:t,children:i}):n.jsx(a.div,{variants:{hidden:{opacity:0,y:o},visible:{opacity:1,y:0,transition:{duration:.4,ease:[.25,.1,.25,1]}}},className:t,children:i})}export{v as F,x as S,h as a};
1
+ import{G as d,D as n,H as a}from"./main-Dirgz7qK.js";function v({children:i,delay:t=0,duration:o=.4,y:e=20,className:s="",once:r=!0}){return d()?n.jsx("div",{className:s,children:i}):n.jsx(a.div,{initial:{opacity:0,y:e},animate:{opacity:1,y:0},transition:{duration:o,delay:t,ease:[.25,.1,.25,1]},className:s,children:i})}function x({children:i,staggerDelay:t=.1,initialDelay:o=0,className:e=""}){return d()?n.jsx("div",{className:e,children:i}):n.jsx(a.div,{initial:"hidden",animate:"visible",variants:{hidden:{},visible:{transition:{staggerChildren:t,delayChildren:o}}},className:e,children:i})}function h({children:i,className:t="",y:o=20}){return d()?n.jsx("div",{className:t,children:i}):n.jsx(a.div,{variants:{hidden:{opacity:0,y:o},visible:{opacity:1,y:0,transition:{duration:.4,ease:[.25,.1,.25,1]}}},className:t,children:i})}export{v as F,x as S,h as a};
@@ -1 +1 @@
1
- import{r as i,D as a}from"./main-jua4nv-E.js";function o(){const[s,d]=i.useState(!1);return a.jsxs("div",{className:"h-full relative dark:bg-[#050505]",children:[!s&&a.jsxs("div",{className:"absolute inset-0 p-6 space-y-5 animate-pulse",children:[a.jsx("div",{className:"flex gap-4 justify-center",children:Array.from({length:6}).map((e,r)=>a.jsx("div",{className:"h-4 w-20 rounded bg-oai-gray-200 dark:bg-oai-gray-800"},r))}),a.jsxs("div",{className:"space-y-2 pt-2",children:[a.jsx("div",{className:"h-7 w-72 rounded bg-oai-gray-200 dark:bg-oai-gray-800"}),a.jsx("div",{className:"h-4 w-96 rounded bg-oai-gray-200 dark:bg-oai-gray-800"})]}),a.jsx("div",{className:"grid grid-cols-3 gap-4",children:Array.from({length:3}).map((e,r)=>a.jsx("div",{className:"h-24 rounded-xl bg-oai-gray-200 dark:bg-oai-gray-800"},r))}),a.jsx("div",{className:"grid grid-cols-3 gap-4",children:Array.from({length:3}).map((e,r)=>a.jsx("div",{className:"h-40 rounded-xl bg-oai-gray-200 dark:bg-oai-gray-800"},r))}),a.jsx("div",{className:"grid grid-cols-3 gap-4",children:Array.from({length:3}).map((e,r)=>a.jsx("div",{className:"h-32 rounded-xl bg-oai-gray-200 dark:bg-oai-gray-800"},r))})]}),a.jsx("iframe",{src:"https://ip.net.coffee/claude/",title:"Cloud AI IP Check",className:`w-full h-full dark:invert dark:hue-rotate-180 transition-opacity duration-300 ${s?"opacity-100":"opacity-0"}`,style:{border:"none"},onLoad:()=>d(!0)})]})}export{o as default};
1
+ import{r as i,D as a}from"./main-Dirgz7qK.js";function o(){const[s,d]=i.useState(!1);return a.jsxs("div",{className:"h-full relative dark:bg-[#050505]",children:[!s&&a.jsxs("div",{className:"absolute inset-0 p-6 space-y-5 animate-pulse",children:[a.jsx("div",{className:"flex gap-4 justify-center",children:Array.from({length:6}).map((e,r)=>a.jsx("div",{className:"h-4 w-20 rounded bg-oai-gray-200 dark:bg-oai-gray-800"},r))}),a.jsxs("div",{className:"space-y-2 pt-2",children:[a.jsx("div",{className:"h-7 w-72 rounded bg-oai-gray-200 dark:bg-oai-gray-800"}),a.jsx("div",{className:"h-4 w-96 rounded bg-oai-gray-200 dark:bg-oai-gray-800"})]}),a.jsx("div",{className:"grid grid-cols-3 gap-4",children:Array.from({length:3}).map((e,r)=>a.jsx("div",{className:"h-24 rounded-xl bg-oai-gray-200 dark:bg-oai-gray-800"},r))}),a.jsx("div",{className:"grid grid-cols-3 gap-4",children:Array.from({length:3}).map((e,r)=>a.jsx("div",{className:"h-40 rounded-xl bg-oai-gray-200 dark:bg-oai-gray-800"},r))}),a.jsx("div",{className:"grid grid-cols-3 gap-4",children:Array.from({length:3}).map((e,r)=>a.jsx("div",{className:"h-32 rounded-xl bg-oai-gray-200 dark:bg-oai-gray-800"},r))})]}),a.jsx("iframe",{src:"https://ip.net.coffee/claude/",title:"Cloud AI IP Check",className:`w-full h-full dark:invert dark:hue-rotate-180 transition-opacity duration-300 ${s?"opacity-100":"opacity-0"}`,style:{border:"none"},onLoad:()=>d(!0)})]})}export{o as default};
@@ -1,4 +1,4 @@
1
- import{r as s,R as V,a6 as Ge,D as d,a7 as P,a8 as Jn,a9 as Zn,N as Qn,O as er,aa as tr,h as nr,j as rr,B as C,ab as or,S as ar,a4 as Dt,L as ir,ac as sr,ad as lr,ae as Gt,af as cr}from"./main-jua4nv-E.js";import{P as dr}from"./ProviderIcon-Bz-JlVCc.js";import{L as mn,a as xn,b as ct,l as Et,c as jt,d as ur,e as Vt}from"./leaderboard-columns-DRc_1zw2.js";import{C as fr}from"./chevron-down-Bj2POypL.js";function gr(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return s.useMemo(()=>r=>{t.forEach(o=>o(r))},t)}const ht=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function $e(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function zt(e){return"nodeType"in e}function q(e){var t,n;return e?$e(e)?e:zt(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function Bt(e){const{Document:t}=q(e);return e instanceof t}function nt(e){return $e(e)?!1:e instanceof q(e).HTMLElement}function vn(e){return e instanceof q(e).SVGElement}function Fe(e){return e?$e(e)?e.document:zt(e)?Bt(e)?e:nt(e)||vn(e)?e.ownerDocument:document:document:document}const pe=ht?s.useLayoutEffect:s.useEffect;function $t(e){const t=s.useRef(e);return pe(()=>{t.current=e}),s.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}function hr(){const e=s.useRef(null),t=s.useCallback((r,o)=>{e.current=setInterval(r,o)},[]),n=s.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function Ze(e,t){t===void 0&&(t=[e]);const n=s.useRef(e);return pe(()=>{n.current!==e&&(n.current=e)},t),n}function rt(e,t){const n=s.useRef();return s.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function dt(e){const t=$t(e),n=s.useRef(null),r=s.useCallback(o=>{o!==n.current&&t?.(o,n.current),n.current=o},[]);return[n,r]}function At(e){const t=s.useRef();return s.useEffect(()=>{t.current=e},[e]),t.current}let kt={};function ot(e,t){return s.useMemo(()=>{if(t)return t;const n=kt[e]==null?0:kt[e]+1;return kt[e]=n,e+"-"+n},[e,t])}function yn(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((a,i)=>{const l=Object.entries(i);for(const[c,u]of l){const g=a[c];g!=null&&(a[c]=g+e*u)}return a},{...t})}}const ze=yn(1),Qe=yn(-1);function pr(e){return"clientX"in e&&"clientY"in e}function Ft(e){if(!e)return!1;const{KeyboardEvent:t}=q(e.target);return t&&e instanceof t}function br(e){if(!e)return!1;const{TouchEvent:t}=q(e.target);return t&&e instanceof t}function It(e){if(br(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return pr(e)?{x:e.clientX,y:e.clientY}:null}const et=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[et.Translate.toString(e),et.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),qt="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function mr(e){return e.matches(qt)?e:e.querySelector(qt)}const xr={display:"none"};function vr(e){let{id:t,value:n}=e;return V.createElement("div",{id:t,style:xr},n)}function yr(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return V.createElement("div",{id:t,style:o,role:"status","aria-live":r,"aria-atomic":!0},n)}function wr(){const[e,t]=s.useState("");return{announce:s.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const wn=s.createContext(null);function kr(e){const t=s.useContext(wn);s.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function Sr(){const[e]=s.useState(()=>new Set),t=s.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[s.useCallback(r=>{let{type:o,event:a}=r;e.forEach(i=>{var l;return(l=i[o])==null?void 0:l.call(i,a)})},[e]),t]}const Cr={draggable:`
1
+ import{r as s,R as V,a6 as Ge,D as d,a7 as P,a8 as Jn,a9 as Zn,N as Qn,O as er,aa as tr,h as nr,j as rr,B as C,ab as or,S as ar,a4 as Dt,L as ir,ac as sr,ad as lr,ae as Gt,af as cr}from"./main-Dirgz7qK.js";import{P as dr}from"./ProviderIcon-C4FxGWlI.js";import{L as mn,a as xn,b as ct,l as Et,c as jt,d as ur,e as Vt}from"./leaderboard-columns-5fNRo700.js";import{C as fr}from"./chevron-down-BS4d25ie.js";function gr(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return s.useMemo(()=>r=>{t.forEach(o=>o(r))},t)}const ht=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function $e(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function zt(e){return"nodeType"in e}function q(e){var t,n;return e?$e(e)?e:zt(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function Bt(e){const{Document:t}=q(e);return e instanceof t}function nt(e){return $e(e)?!1:e instanceof q(e).HTMLElement}function vn(e){return e instanceof q(e).SVGElement}function Fe(e){return e?$e(e)?e.document:zt(e)?Bt(e)?e:nt(e)||vn(e)?e.ownerDocument:document:document:document}const pe=ht?s.useLayoutEffect:s.useEffect;function $t(e){const t=s.useRef(e);return pe(()=>{t.current=e}),s.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}function hr(){const e=s.useRef(null),t=s.useCallback((r,o)=>{e.current=setInterval(r,o)},[]),n=s.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function Ze(e,t){t===void 0&&(t=[e]);const n=s.useRef(e);return pe(()=>{n.current!==e&&(n.current=e)},t),n}function rt(e,t){const n=s.useRef();return s.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function dt(e){const t=$t(e),n=s.useRef(null),r=s.useCallback(o=>{o!==n.current&&t?.(o,n.current),n.current=o},[]);return[n,r]}function At(e){const t=s.useRef();return s.useEffect(()=>{t.current=e},[e]),t.current}let kt={};function ot(e,t){return s.useMemo(()=>{if(t)return t;const n=kt[e]==null?0:kt[e]+1;return kt[e]=n,e+"-"+n},[e,t])}function yn(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((a,i)=>{const l=Object.entries(i);for(const[c,u]of l){const g=a[c];g!=null&&(a[c]=g+e*u)}return a},{...t})}}const ze=yn(1),Qe=yn(-1);function pr(e){return"clientX"in e&&"clientY"in e}function Ft(e){if(!e)return!1;const{KeyboardEvent:t}=q(e.target);return t&&e instanceof t}function br(e){if(!e)return!1;const{TouchEvent:t}=q(e.target);return t&&e instanceof t}function It(e){if(br(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return pr(e)?{x:e.clientX,y:e.clientY}:null}const et=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[et.Translate.toString(e),et.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),qt="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function mr(e){return e.matches(qt)?e:e.querySelector(qt)}const xr={display:"none"};function vr(e){let{id:t,value:n}=e;return V.createElement("div",{id:t,style:xr},n)}function yr(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return V.createElement("div",{id:t,style:o,role:"status","aria-live":r,"aria-atomic":!0},n)}function wr(){const[e,t]=s.useState("");return{announce:s.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const wn=s.createContext(null);function kr(e){const t=s.useContext(wn);s.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function Sr(){const[e]=s.useState(()=>new Set),t=s.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[s.useCallback(r=>{let{type:o,event:a}=r;e.forEach(i=>{var l;return(l=i[o])==null?void 0:l.call(i,a)})},[e]),t]}const Cr={draggable:`
2
2
  To pick up a draggable item, press the space bar.
3
3
  While dragging, use the arrow keys to move the item.
4
4
  Press space again to drop the item in its new position, or press escape to cancel.
@@ -1 +1 @@
1
- import{r as n,D as e,a8 as H,C as K,aa as W,h as Y,j as Z,ae as G,ag as q,B as a,a7 as L,a4 as B,L as E,ah as F,ai as J}from"./main-jua4nv-E.js";import{b as I,d as Q,l as V,f as X,e as ee,L as re,g as ae}from"./leaderboard-columns-DRc_1zw2.js";const y=18;function O(){return e.jsxs("svg",{"aria-hidden":!0,width:y,height:y,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"12",cy:"12",r:"4"}),e.jsx("path",{d:"M12 2v2"}),e.jsx("path",{d:"M12 20v2"}),e.jsx("path",{d:"m4.93 4.93 1.41 1.41"}),e.jsx("path",{d:"m17.66 17.66 1.41 1.41"}),e.jsx("path",{d:"M2 12h2"}),e.jsx("path",{d:"M20 12h2"}),e.jsx("path",{d:"m6.34 17.66-1.41 1.41"}),e.jsx("path",{d:"m19.07 4.93-1.41 1.41"})]})}function P(){return e.jsx("svg",{"aria-hidden":!0,width:y,height:y,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z"})})}function te(){return e.jsxs("svg",{"aria-hidden":!0,width:y,height:y,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"2",y:"3",width:"20",height:"14",rx:"2"}),e.jsx("path",{d:"M8 21h8"}),e.jsx("path",{d:"M12 17v4"})]})}const oe=[{value:"light",label:"Light",Icon:O},{value:"dark",label:"Dark",Icon:P},{value:"system",label:"System",Icon:te}];function se(r){return r==="dark"?P:O}function ne({theme:r,resolvedTheme:s,onSetTheme:b,className:d="",direction:p="down",align:T="right"}){const[c,k]=n.useState(!1),h=n.useRef(null),x=n.useCallback(()=>k(!1),[]);n.useEffect(()=>{if(!c)return;const t=l=>{h.current&&!h.current.contains(l.target)&&x()};return document.addEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t)},[c,x]),n.useEffect(()=>{if(!c)return;const t=l=>{l.key==="Escape"&&x()};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[c,x]);const i=se(s);return e.jsxs("div",{ref:h,className:`relative ${d}`,children:[e.jsx("button",{type:"button","aria-label":"Theme","aria-expanded":c,onClick:()=>k(t=>!t),className:"flex items-center justify-center w-9 h-9 rounded-lg text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white transition-colors",children:e.jsx(i,{})}),c&&e.jsx("div",{className:`absolute 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 ${p==="up"?"bottom-full mb-1":"top-full mt-1"} ${T==="left"?"left-0":"right-0"}`,children:oe.map(({value:t,label:l,Icon:j})=>{const m=r===t;return e.jsxs("button",{type:"button",onClick:()=>{b(t),x()},className:`flex w-full items-center gap-2.5 px-3 py-2 text-sm transition-colors ${m?"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:[e.jsx(j,{}),e.jsx("span",{children:l})]},t)})})]})}function ie(r){if(!r)return a("shared.error.prefix",{error:a("leaderboard.error.unknown")});const s=r?.message||String(r),b=String(s||"").trim()||a("leaderboard.error.unknown");return a("shared.error.prefix",{error:b})}function le(r){return typeof r!="string"?"":r.trim()}function de(r){if(typeof r!="string")return null;const s=r.trim().toLowerCase();return s==="week"||s==="month"||s==="total"?s:null}function me({auth:r,signedIn:s,sessionSoftExpired:b,userId:d}){const p=H(),{theme:T,resolvedTheme:c,setTheme:k}=K(),h=n.useMemo(()=>W(),[]),x=Y(),i=s&&!b,t=n.useMemo(()=>i&&(typeof r=="function"||typeof r=="string"||r&&typeof r=="object")?r:null,[r,i]),l=i?t:null,j=i&&Z(l),m=n.useMemo(()=>{const o=new URLSearchParams(p?.search||"");return de(o.get("period"))||"week"},[p?.search]),_=p?.search||"",[v,w]=n.useState(()=>({loading:!1,error:null,data:null}));n.useEffect(()=>{if(!h&&!x||!d||i&&!j)return;let o=!0;return w(f=>({...f,loading:!0,error:null})),(async()=>{const f=i?await G(l):null;if(!o)return;const D=await q({accessToken:f,userId:d,period:m});o&&w({loading:!1,error:null,data:D})})().catch(f=>{if(o){if(f?.status===404){w({loading:!1,error:null,data:null});return}w({loading:!1,error:ie(f),data:null})}}),()=>{o=!1}},[i,j,h,l,x,m,d]);const N=v.data,C=N?.from||null,M=N?.to||null,A=N?.generated_at||null,g=N?.entry||null,S=le(g?.display_name)||a("leaderboard.anon_label"),z=a("leaderboard.period.week"),U=a("leaderboard.period.month"),$=a("leaderboard.period.total"),R=m==="month"?U:m==="total"?$:z;let u=null;return d?v.loading?u=e.jsx("div",{className:"px-6 py-12 text-center",children:e.jsx("p",{className:"text-sm text-oai-gray-500 dark:text-oai-gray-400",children:a("leaderboard.loading")})}):v.error?u=e.jsx("div",{className:"px-6 py-12 text-center",children:e.jsx("p",{className:"text-sm text-red-500 dark:text-red-400",children:v.error})}):g?u=e.jsx("div",{className:"w-full overflow-x-auto",children:e.jsxs("table",{className:"min-w-max w-full text-left text-sm",children:[e.jsx("thead",{className:"border-b border-oai-gray-200 dark:border-oai-gray-800",children:e.jsxs("tr",{children:[e.jsx("th",{className:L(re,"font-medium text-oai-gray-500 dark:text-oai-gray-400"),children:a("leaderboard.column.rank")}),e.jsx("th",{className:L(ae,"font-medium text-oai-gray-500 dark:text-oai-gray-400 whitespace-nowrap"),children:a("leaderboard.column.total")}),I.map(o=>e.jsx("th",{className:"px-4 py-4 font-medium text-oai-gray-500 dark:text-oai-gray-400 whitespace-nowrap",children:e.jsx(Q,{iconSrc:o.icon,label:a(o.copyKey)})},o.key))]})}),e.jsx("tbody",{className:"divide-y divide-oai-gray-100 dark:divide-oai-gray-800/50",children:e.jsxs("tr",{className:"transition-colors hover:bg-oai-gray-50 dark:hover:bg-oai-gray-900/60",children:[e.jsx("td",{className:L(V(!1),"font-medium text-oai-gray-500 dark:text-oai-gray-400"),children:g?.rank??a("shared.placeholder.short")}),e.jsx("td",{className:L(X(),"text-oai-gray-700 dark:text-oai-gray-300"),children:B(g?.total_tokens)}),I.map(o=>e.jsx("td",{className:"px-4 py-4 text-oai-gray-500 dark:text-oai-gray-400 whitespace-nowrap",children:B(g?.[o.key])},o.key))]})})]})}):u=e.jsx("div",{className:"px-6 py-12 text-center",children:e.jsx("p",{className:"text-sm text-oai-gray-500 dark:text-oai-gray-400",children:a("leaderboard.empty")})}):u=e.jsx("div",{className:"px-6 py-12 text-center",children:e.jsx("p",{className:"text-sm text-oai-gray-500 dark:text-oai-gray-400",children:a("leaderboard.empty")})}),e.jsxs("div",{className:"flex flex-col min-h-screen bg-oai-white dark:bg-oai-gray-950 text-oai-black dark:text-oai-white font-oai antialiased transition-colors duration-200",children:[e.jsx("header",{className:"sticky top-0 z-50 bg-white/80 dark:bg-oai-gray-950/80 backdrop-blur-md border-b border-oai-gray-200 dark:border-oai-gray-900 transition-colors duration-200",children:e.jsxs("div",{className:"mx-auto flex h-14 max-w-6xl items-center justify-between px-4 sm:px-6",children:[e.jsxs("div",{className:"flex items-center gap-5",children:[e.jsxs(E,{to:"/",className:"flex items-center gap-3 no-underline outline-none rounded focus-visible:ring-2 focus-visible:ring-oai-brand-500 focus-visible:ring-offset-2 dark:ring-offset-oai-gray-950 transition-opacity hover:opacity-80",children:[e.jsx("img",{src:"/app-icon.png",alt:"",width:24,height:24,className:"rounded-md"}),e.jsx("span",{className:"text-sm font-semibold tracking-wide text-oai-black dark:text-white uppercase",children:"Token Tracker"})]}),e.jsx("div",{className:"hidden sm:block",children:e.jsx(F,{})})]}),e.jsxs("div",{className:"flex items-center gap-2 sm:gap-3",children:[e.jsx(E,{to:`/leaderboard${_}`,className:"no-underline inline-flex items-center justify-center h-9 px-5 text-sm font-medium rounded-full shadow-sm ring-1 ring-oai-gray-200 dark:ring-white/10 bg-oai-gray-900 dark:bg-white text-white dark:text-oai-gray-900 hover:bg-oai-gray-800 dark:hover:bg-oai-gray-100 transition-colors",children:a("leaderboard.profile.nav.back")}),e.jsx(ne,{theme:T,resolvedTheme:c,onSetTheme:k}),e.jsx(J,{})]})]})}),e.jsx("main",{className:"flex-1 py-12 sm:py-16",children:e.jsxs("div",{className:"mx-auto max-w-6xl px-4 sm:px-6",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center gap-6 mb-10",children:[e.jsx(ee,{avatarUrl:g?.avatar_url,displayName:S,seed:typeof d=="string"?d:S,size:"lg",className:"shrink-0 ring-2 ring-oai-gray-200 dark:ring-oai-gray-800"}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h1",{className:"text-3xl sm:text-4xl font-semibold tracking-tight text-oai-black dark:text-white mb-3",children:S}),e.jsxs("p",{className:"text-oai-gray-500 dark:text-oai-gray-400 text-sm sm:text-base",children:[m==="total"?a("leaderboard.range.total"):C&&M?a("leaderboard.range",{period:R,from:C,to:M}):a("leaderboard.range_loading",{period:R}),A&&e.jsx("span",{className:"ml-2 pl-2 border-l border-oai-gray-200 dark:border-oai-gray-800 inline-block text-oai-gray-400 dark:text-oai-gray-500 text-xs",children:a("leaderboard.generated_at",{ts:A})})]})]})]}),e.jsx("div",{className:"rounded-xl border border-oai-gray-200 dark:border-oai-gray-800 overflow-hidden",children:u})]})}),e.jsx("footer",{className:"border-t border-oai-gray-200 dark:border-oai-gray-900 py-8 transition-colors duration-200",children:e.jsxs("div",{className:"mx-auto flex max-w-6xl items-center justify-between px-4 sm:px-6 text-sm text-oai-gray-400 dark:text-oai-gray-500",children:[e.jsx("p",{children:a("landing.v2.footer.line")}),e.jsx(E,{to:`/leaderboard${_}`,className:"text-oai-gray-400 dark:text-oai-gray-500 hover:text-oai-black dark:hover:text-white transition-colors",children:a("leaderboard.profile.nav.back")})]})})]})}export{me as LeaderboardProfilePage};
1
+ import{r as n,D as e,a8 as H,C as K,aa as W,h as Y,j as Z,ae as G,ag as q,B as a,a7 as L,a4 as B,L as E,ah as F,ai as J}from"./main-Dirgz7qK.js";import{b as I,d as Q,l as V,f as X,e as ee,L as re,g as ae}from"./leaderboard-columns-5fNRo700.js";const y=18;function O(){return e.jsxs("svg",{"aria-hidden":!0,width:y,height:y,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"12",cy:"12",r:"4"}),e.jsx("path",{d:"M12 2v2"}),e.jsx("path",{d:"M12 20v2"}),e.jsx("path",{d:"m4.93 4.93 1.41 1.41"}),e.jsx("path",{d:"m17.66 17.66 1.41 1.41"}),e.jsx("path",{d:"M2 12h2"}),e.jsx("path",{d:"M20 12h2"}),e.jsx("path",{d:"m6.34 17.66-1.41 1.41"}),e.jsx("path",{d:"m19.07 4.93-1.41 1.41"})]})}function P(){return e.jsx("svg",{"aria-hidden":!0,width:y,height:y,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z"})})}function te(){return e.jsxs("svg",{"aria-hidden":!0,width:y,height:y,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"2",y:"3",width:"20",height:"14",rx:"2"}),e.jsx("path",{d:"M8 21h8"}),e.jsx("path",{d:"M12 17v4"})]})}const oe=[{value:"light",label:"Light",Icon:O},{value:"dark",label:"Dark",Icon:P},{value:"system",label:"System",Icon:te}];function se(r){return r==="dark"?P:O}function ne({theme:r,resolvedTheme:s,onSetTheme:b,className:d="",direction:p="down",align:T="right"}){const[c,k]=n.useState(!1),h=n.useRef(null),x=n.useCallback(()=>k(!1),[]);n.useEffect(()=>{if(!c)return;const t=l=>{h.current&&!h.current.contains(l.target)&&x()};return document.addEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t)},[c,x]),n.useEffect(()=>{if(!c)return;const t=l=>{l.key==="Escape"&&x()};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[c,x]);const i=se(s);return e.jsxs("div",{ref:h,className:`relative ${d}`,children:[e.jsx("button",{type:"button","aria-label":"Theme","aria-expanded":c,onClick:()=>k(t=>!t),className:"flex items-center justify-center w-9 h-9 rounded-lg text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white transition-colors",children:e.jsx(i,{})}),c&&e.jsx("div",{className:`absolute 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 ${p==="up"?"bottom-full mb-1":"top-full mt-1"} ${T==="left"?"left-0":"right-0"}`,children:oe.map(({value:t,label:l,Icon:j})=>{const m=r===t;return e.jsxs("button",{type:"button",onClick:()=>{b(t),x()},className:`flex w-full items-center gap-2.5 px-3 py-2 text-sm transition-colors ${m?"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:[e.jsx(j,{}),e.jsx("span",{children:l})]},t)})})]})}function ie(r){if(!r)return a("shared.error.prefix",{error:a("leaderboard.error.unknown")});const s=r?.message||String(r),b=String(s||"").trim()||a("leaderboard.error.unknown");return a("shared.error.prefix",{error:b})}function le(r){return typeof r!="string"?"":r.trim()}function de(r){if(typeof r!="string")return null;const s=r.trim().toLowerCase();return s==="week"||s==="month"||s==="total"?s:null}function me({auth:r,signedIn:s,sessionSoftExpired:b,userId:d}){const p=H(),{theme:T,resolvedTheme:c,setTheme:k}=K(),h=n.useMemo(()=>W(),[]),x=Y(),i=s&&!b,t=n.useMemo(()=>i&&(typeof r=="function"||typeof r=="string"||r&&typeof r=="object")?r:null,[r,i]),l=i?t:null,j=i&&Z(l),m=n.useMemo(()=>{const o=new URLSearchParams(p?.search||"");return de(o.get("period"))||"week"},[p?.search]),_=p?.search||"",[v,w]=n.useState(()=>({loading:!1,error:null,data:null}));n.useEffect(()=>{if(!h&&!x||!d||i&&!j)return;let o=!0;return w(f=>({...f,loading:!0,error:null})),(async()=>{const f=i?await G(l):null;if(!o)return;const D=await q({accessToken:f,userId:d,period:m});o&&w({loading:!1,error:null,data:D})})().catch(f=>{if(o){if(f?.status===404){w({loading:!1,error:null,data:null});return}w({loading:!1,error:ie(f),data:null})}}),()=>{o=!1}},[i,j,h,l,x,m,d]);const N=v.data,C=N?.from||null,M=N?.to||null,A=N?.generated_at||null,g=N?.entry||null,S=le(g?.display_name)||a("leaderboard.anon_label"),z=a("leaderboard.period.week"),U=a("leaderboard.period.month"),$=a("leaderboard.period.total"),R=m==="month"?U:m==="total"?$:z;let u=null;return d?v.loading?u=e.jsx("div",{className:"px-6 py-12 text-center",children:e.jsx("p",{className:"text-sm text-oai-gray-500 dark:text-oai-gray-400",children:a("leaderboard.loading")})}):v.error?u=e.jsx("div",{className:"px-6 py-12 text-center",children:e.jsx("p",{className:"text-sm text-red-500 dark:text-red-400",children:v.error})}):g?u=e.jsx("div",{className:"w-full overflow-x-auto",children:e.jsxs("table",{className:"min-w-max w-full text-left text-sm",children:[e.jsx("thead",{className:"border-b border-oai-gray-200 dark:border-oai-gray-800",children:e.jsxs("tr",{children:[e.jsx("th",{className:L(re,"font-medium text-oai-gray-500 dark:text-oai-gray-400"),children:a("leaderboard.column.rank")}),e.jsx("th",{className:L(ae,"font-medium text-oai-gray-500 dark:text-oai-gray-400 whitespace-nowrap"),children:a("leaderboard.column.total")}),I.map(o=>e.jsx("th",{className:"px-4 py-4 font-medium text-oai-gray-500 dark:text-oai-gray-400 whitespace-nowrap",children:e.jsx(Q,{iconSrc:o.icon,label:a(o.copyKey)})},o.key))]})}),e.jsx("tbody",{className:"divide-y divide-oai-gray-100 dark:divide-oai-gray-800/50",children:e.jsxs("tr",{className:"transition-colors hover:bg-oai-gray-50 dark:hover:bg-oai-gray-900/60",children:[e.jsx("td",{className:L(V(!1),"font-medium text-oai-gray-500 dark:text-oai-gray-400"),children:g?.rank??a("shared.placeholder.short")}),e.jsx("td",{className:L(X(),"text-oai-gray-700 dark:text-oai-gray-300"),children:B(g?.total_tokens)}),I.map(o=>e.jsx("td",{className:"px-4 py-4 text-oai-gray-500 dark:text-oai-gray-400 whitespace-nowrap",children:B(g?.[o.key])},o.key))]})})]})}):u=e.jsx("div",{className:"px-6 py-12 text-center",children:e.jsx("p",{className:"text-sm text-oai-gray-500 dark:text-oai-gray-400",children:a("leaderboard.empty")})}):u=e.jsx("div",{className:"px-6 py-12 text-center",children:e.jsx("p",{className:"text-sm text-oai-gray-500 dark:text-oai-gray-400",children:a("leaderboard.empty")})}),e.jsxs("div",{className:"flex flex-col min-h-screen bg-oai-white dark:bg-oai-gray-950 text-oai-black dark:text-oai-white font-oai antialiased transition-colors duration-200",children:[e.jsx("header",{className:"sticky top-0 z-50 bg-white/80 dark:bg-oai-gray-950/80 backdrop-blur-md border-b border-oai-gray-200 dark:border-oai-gray-900 transition-colors duration-200",children:e.jsxs("div",{className:"mx-auto flex h-14 max-w-6xl items-center justify-between px-4 sm:px-6",children:[e.jsxs("div",{className:"flex items-center gap-5",children:[e.jsxs(E,{to:"/",className:"flex items-center gap-3 no-underline outline-none rounded focus-visible:ring-2 focus-visible:ring-oai-brand-500 focus-visible:ring-offset-2 dark:ring-offset-oai-gray-950 transition-opacity hover:opacity-80",children:[e.jsx("img",{src:"/app-icon.png",alt:"",width:24,height:24,className:"rounded-md"}),e.jsx("span",{className:"text-sm font-semibold tracking-wide text-oai-black dark:text-white uppercase",children:"Token Tracker"})]}),e.jsx("div",{className:"hidden sm:block",children:e.jsx(F,{})})]}),e.jsxs("div",{className:"flex items-center gap-2 sm:gap-3",children:[e.jsx(E,{to:`/leaderboard${_}`,className:"no-underline inline-flex items-center justify-center h-9 px-5 text-sm font-medium rounded-full shadow-sm ring-1 ring-oai-gray-200 dark:ring-white/10 bg-oai-gray-900 dark:bg-white text-white dark:text-oai-gray-900 hover:bg-oai-gray-800 dark:hover:bg-oai-gray-100 transition-colors",children:a("leaderboard.profile.nav.back")}),e.jsx(ne,{theme:T,resolvedTheme:c,onSetTheme:k}),e.jsx(J,{})]})]})}),e.jsx("main",{className:"flex-1 py-12 sm:py-16",children:e.jsxs("div",{className:"mx-auto max-w-6xl px-4 sm:px-6",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center gap-6 mb-10",children:[e.jsx(ee,{avatarUrl:g?.avatar_url,displayName:S,seed:typeof d=="string"?d:S,size:"lg",className:"shrink-0 ring-2 ring-oai-gray-200 dark:ring-oai-gray-800"}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h1",{className:"text-3xl sm:text-4xl font-semibold tracking-tight text-oai-black dark:text-white mb-3",children:S}),e.jsxs("p",{className:"text-oai-gray-500 dark:text-oai-gray-400 text-sm sm:text-base",children:[m==="total"?a("leaderboard.range.total"):C&&M?a("leaderboard.range",{period:R,from:C,to:M}):a("leaderboard.range_loading",{period:R}),A&&e.jsx("span",{className:"ml-2 pl-2 border-l border-oai-gray-200 dark:border-oai-gray-800 inline-block text-oai-gray-400 dark:text-oai-gray-500 text-xs",children:a("leaderboard.generated_at",{ts:A})})]})]})]}),e.jsx("div",{className:"rounded-xl border border-oai-gray-200 dark:border-oai-gray-800 overflow-hidden",children:u})]})}),e.jsx("footer",{className:"border-t border-oai-gray-200 dark:border-oai-gray-900 py-8 transition-colors duration-200",children:e.jsxs("div",{className:"mx-auto flex max-w-6xl items-center justify-between px-4 sm:px-6 text-sm text-oai-gray-400 dark:text-oai-gray-500",children:[e.jsx("p",{children:a("landing.v2.footer.line")}),e.jsx(E,{to:`/leaderboard${_}`,className:"text-oai-gray-400 dark:text-oai-gray-500 hover:text-oai-black dark:hover:text-white transition-colors",children:a("leaderboard.profile.nav.back")})]})})]})}export{me as LeaderboardProfilePage};
@@ -1,2 +1,2 @@
1
- import{D as r,a7 as _,B as o,r as b,L as f,aj as j}from"./main-jua4nv-E.js";import{u as v}from"./use-usage-limits-B0OYz2eA.js";import{u as k}from"./use-limits-display-prefs-CtpaNbnl.js";import{C as y}from"./Card-Cwz-PEn8.js";import{F as N}from"./FadeIn-CKfrd1Vn.js";const L=[3,2,3,3,2,2,3];function d({className:s}){return r.jsx("div",{className:_("rounded bg-oai-gray-200/70 dark:bg-oai-gray-800/70 animate-pulse",s)})}function P(){return r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(d,{className:"h-3 w-12 shrink-0"}),r.jsx(d,{className:"flex-1 h-1.5 rounded-full min-w-0"}),r.jsx(d,{className:"h-3 w-[30px] shrink-0"}),r.jsx(d,{className:"h-3 w-6 shrink-0"})]})}function C({bars:s,index:e}){const l=e%3===0?"w-24":e%3===1?"w-20":"w-[4.5rem]";return r.jsxs("div",{className:"flex flex-col gap-1.5",children:[r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx(d,{className:"h-[14px] w-[14px] rounded shrink-0"}),r.jsx(d,{className:_("h-4",l)})]}),Array.from({length:s},(i,a)=>r.jsx(P,{},a))]})}function E(){return r.jsx(y,{children:r.jsxs("div",{className:"flex flex-col gap-3",children:[r.jsx(d,{className:"h-3.5 w-28"}),L.map((s,e)=>r.jsx(C,{bars:s,index:e},e))]})})}function t(s){if(!s)return null;const e=typeof s=="number"?s*1e3:Date.parse(s);if(!Number.isFinite(e))return null;const l=e-Date.now();if(l<=0)return o("shared.time.now");const i=Math.floor(l/6e4);if(i<60)return`${i}m`;const a=Math.floor(i/60);return a<24?`${a}h`:`${Math.floor(a/24)}d`}function O(s){return s>=90?"bg-red-500":s>=70?"bg-amber-500":"bg-emerald-500"}function n({label:s,pct:e,reset:l}){const i=Math.max(0,Math.min(100,Number(e)||0)),a=Math.round(i),x=i>0&&a===0?Math.max(i,.35):i,u=i>0&&a===0?"<1":String(a);return r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-[11px] text-oai-gray-500 dark:text-oai-gray-400 w-12 shrink-0",children:s}),r.jsx("div",{className:"flex-1 bg-oai-gray-100 dark:bg-oai-gray-700/50 rounded-full h-1.5 overflow-hidden",children:r.jsx("div",{className:`${O(a)} rounded-full h-full transition-[width] duration-500 ease-out`,style:{width:`${x}%`,minWidth:i>0?"3px":0}})}),r.jsxs("span",{className:"text-[11px] tabular-nums text-oai-gray-500 dark:text-oai-gray-400 w-[30px] text-right shrink-0",children:[u,"%"]}),l?r.jsx("span",{className:"text-[10px] text-oai-gray-400 dark:text-oai-gray-500 w-6 text-right shrink-0",children:l}):null]})}function c({name:s,icon:e,children:l}){const a=e==="/brand-logos/cursor.svg"||e==="/brand-logos/kiro.svg"||e==="/brand-logos/copilot.svg"?"w-[14px] h-[14px] dark:invert":"w-[14px] h-[14px]";return r.jsxs("div",{className:"flex flex-col gap-1.5",children:[r.jsxs("div",{className:"flex items-center gap-1.5",children:[e?r.jsx("img",{src:e,alt:"",className:a}):null,r.jsx("span",{className:"text-sm font-medium text-oai-black dark:text-oai-white",children:s})]}),l]})}const T=["claude","codex","cursor","gemini","kiro","copilot","antigravity"];function R(s,e){if(!(i=>i?.configured&&!i.error)(e))return null;switch(s){case"claude":return r.jsxs(c,{name:"Claude",icon:"/brand-logos/claude-code.svg",children:[e.five_hour?r.jsx(n,{label:"5h",pct:e.five_hour.utilization,reset:t(e.five_hour.resets_at)}):null,e.seven_day?r.jsx(n,{label:"7d",pct:e.seven_day.utilization,reset:t(e.seven_day.resets_at)}):null,e.seven_day_opus?r.jsx(n,{label:"Opus",pct:e.seven_day_opus.utilization,reset:t(e.seven_day_opus.resets_at)}):null]},"claude");case"codex":return r.jsxs(c,{name:"Codex",icon:"/brand-logos/codex.svg",children:[e.primary_window?r.jsx(n,{label:"5h",pct:e.primary_window.used_percent,reset:t(e.primary_window.reset_at)}):null,e.secondary_window?r.jsx(n,{label:"7d",pct:e.secondary_window.used_percent,reset:t(e.secondary_window.reset_at)}):null]},"codex");case"cursor":return r.jsxs(c,{name:"Cursor",icon:"/brand-logos/cursor.svg",children:[e.primary_window?r.jsx(n,{label:o("limits.label.cursor_plan"),pct:e.primary_window.used_percent,reset:t(e.primary_window.reset_at)}):null,e.secondary_window?r.jsx(n,{label:o("limits.label.cursor_auto"),pct:e.secondary_window.used_percent,reset:t(e.secondary_window.reset_at)}):null,e.tertiary_window?r.jsx(n,{label:o("limits.label.cursor_api"),pct:e.tertiary_window.used_percent,reset:t(e.tertiary_window.reset_at)}):null]},"cursor");case"gemini":return r.jsxs(c,{name:"Gemini",icon:"/brand-logos/gemini.svg",children:[e.primary_window?r.jsx(n,{label:"Pro",pct:e.primary_window.used_percent,reset:t(e.primary_window.reset_at)}):null,e.secondary_window?r.jsx(n,{label:"Flash",pct:e.secondary_window.used_percent,reset:t(e.secondary_window.reset_at)}):null,e.tertiary_window?r.jsx(n,{label:"Lite",pct:e.tertiary_window.used_percent,reset:t(e.tertiary_window.reset_at)}):null]},"gemini");case"kiro":return r.jsxs(c,{name:"Kiro",icon:"/brand-logos/kiro.svg",children:[e.primary_window?r.jsx(n,{label:o("limits.label.kiro_month"),pct:e.primary_window.used_percent,reset:t(e.primary_window.reset_at)}):null,e.secondary_window?r.jsx(n,{label:o("limits.label.kiro_bonus"),pct:e.secondary_window.used_percent,reset:t(e.secondary_window.reset_at)}):null]},"kiro");case"antigravity":return r.jsxs(c,{name:"Antigravity",icon:"/brand-logos/antigravity.svg",children:[e.primary_window?r.jsx(n,{label:"Claude",pct:e.primary_window.used_percent,reset:t(e.primary_window.reset_at)}):null,e.secondary_window?r.jsx(n,{label:"G Pro",pct:e.secondary_window.used_percent,reset:t(e.secondary_window.reset_at)}):null,e.tertiary_window?r.jsx(n,{label:"Flash",pct:e.tertiary_window.used_percent,reset:t(e.tertiary_window.reset_at)}):null]},"antigravity");case"copilot":return r.jsxs(c,{name:"GitHub Copilot",icon:"/brand-logos/copilot.svg",children:[e.primary_window?r.jsx(n,{label:o("limits.label.copilot_premium"),pct:e.primary_window.used_percent,reset:t(e.primary_window.reset_at)}):null,e.secondary_window?r.jsx(n,{label:o("limits.label.copilot_chat"),pct:e.secondary_window.used_percent,reset:t(e.secondary_window.reset_at)}):null,e.otel_has_files||e.otel_enabled?null:r.jsx(D,{defaultDir:e.otel_default_dir})]},"copilot");default:return null}}function D({defaultDir:s}){const[e,l]=b.useState(!1),a=["export COPILOT_OTEL_ENABLED=true","export COPILOT_OTEL_EXPORTER_TYPE=file",`export COPILOT_OTEL_FILE_EXPORTER_PATH="${s||"$HOME/.copilot/otel"}/copilot-otel-$(date +%Y%m%d).jsonl"`].join(`
1
+ import{D as r,a7 as _,B as o,r as b,L as f,aj as j}from"./main-Dirgz7qK.js";import{u as v}from"./use-usage-limits-Z6xWV0y7.js";import{u as k}from"./use-limits-display-prefs-LMbFljwt.js";import{C as y}from"./Card-DmEuggKt.js";import{F as N}from"./FadeIn-CIKEJ1mC.js";const L=[3,2,3,3,2,2,3];function d({className:s}){return r.jsx("div",{className:_("rounded bg-oai-gray-200/70 dark:bg-oai-gray-800/70 animate-pulse",s)})}function P(){return r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(d,{className:"h-3 w-12 shrink-0"}),r.jsx(d,{className:"flex-1 h-1.5 rounded-full min-w-0"}),r.jsx(d,{className:"h-3 w-[30px] shrink-0"}),r.jsx(d,{className:"h-3 w-6 shrink-0"})]})}function C({bars:s,index:e}){const l=e%3===0?"w-24":e%3===1?"w-20":"w-[4.5rem]";return r.jsxs("div",{className:"flex flex-col gap-1.5",children:[r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx(d,{className:"h-[14px] w-[14px] rounded shrink-0"}),r.jsx(d,{className:_("h-4",l)})]}),Array.from({length:s},(i,a)=>r.jsx(P,{},a))]})}function E(){return r.jsx(y,{children:r.jsxs("div",{className:"flex flex-col gap-3",children:[r.jsx(d,{className:"h-3.5 w-28"}),L.map((s,e)=>r.jsx(C,{bars:s,index:e},e))]})})}function t(s){if(!s)return null;const e=typeof s=="number"?s*1e3:Date.parse(s);if(!Number.isFinite(e))return null;const l=e-Date.now();if(l<=0)return o("shared.time.now");const i=Math.floor(l/6e4);if(i<60)return`${i}m`;const a=Math.floor(i/60);return a<24?`${a}h`:`${Math.floor(a/24)}d`}function O(s){return s>=90?"bg-red-500":s>=70?"bg-amber-500":"bg-emerald-500"}function n({label:s,pct:e,reset:l}){const i=Math.max(0,Math.min(100,Number(e)||0)),a=Math.round(i),x=i>0&&a===0?Math.max(i,.35):i,u=i>0&&a===0?"<1":String(a);return r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-[11px] text-oai-gray-500 dark:text-oai-gray-400 w-12 shrink-0",children:s}),r.jsx("div",{className:"flex-1 bg-oai-gray-100 dark:bg-oai-gray-700/50 rounded-full h-1.5 overflow-hidden",children:r.jsx("div",{className:`${O(a)} rounded-full h-full transition-[width] duration-500 ease-out`,style:{width:`${x}%`,minWidth:i>0?"3px":0}})}),r.jsxs("span",{className:"text-[11px] tabular-nums text-oai-gray-500 dark:text-oai-gray-400 w-[30px] text-right shrink-0",children:[u,"%"]}),l?r.jsx("span",{className:"text-[10px] text-oai-gray-400 dark:text-oai-gray-500 w-6 text-right shrink-0",children:l}):null]})}function c({name:s,icon:e,children:l}){const a=e==="/brand-logos/cursor.svg"||e==="/brand-logos/kiro.svg"||e==="/brand-logos/copilot.svg"?"w-[14px] h-[14px] dark:invert":"w-[14px] h-[14px]";return r.jsxs("div",{className:"flex flex-col gap-1.5",children:[r.jsxs("div",{className:"flex items-center gap-1.5",children:[e?r.jsx("img",{src:e,alt:"",className:a}):null,r.jsx("span",{className:"text-sm font-medium text-oai-black dark:text-oai-white",children:s})]}),l]})}const T=["claude","codex","cursor","gemini","kiro","copilot","antigravity"];function R(s,e){if(!(i=>i?.configured&&!i.error)(e))return null;switch(s){case"claude":return r.jsxs(c,{name:"Claude",icon:"/brand-logos/claude-code.svg",children:[e.five_hour?r.jsx(n,{label:"5h",pct:e.five_hour.utilization,reset:t(e.five_hour.resets_at)}):null,e.seven_day?r.jsx(n,{label:"7d",pct:e.seven_day.utilization,reset:t(e.seven_day.resets_at)}):null,e.seven_day_opus?r.jsx(n,{label:"Opus",pct:e.seven_day_opus.utilization,reset:t(e.seven_day_opus.resets_at)}):null]},"claude");case"codex":return r.jsxs(c,{name:"Codex",icon:"/brand-logos/codex.svg",children:[e.primary_window?r.jsx(n,{label:"5h",pct:e.primary_window.used_percent,reset:t(e.primary_window.reset_at)}):null,e.secondary_window?r.jsx(n,{label:"7d",pct:e.secondary_window.used_percent,reset:t(e.secondary_window.reset_at)}):null]},"codex");case"cursor":return r.jsxs(c,{name:"Cursor",icon:"/brand-logos/cursor.svg",children:[e.primary_window?r.jsx(n,{label:o("limits.label.cursor_plan"),pct:e.primary_window.used_percent,reset:t(e.primary_window.reset_at)}):null,e.secondary_window?r.jsx(n,{label:o("limits.label.cursor_auto"),pct:e.secondary_window.used_percent,reset:t(e.secondary_window.reset_at)}):null,e.tertiary_window?r.jsx(n,{label:o("limits.label.cursor_api"),pct:e.tertiary_window.used_percent,reset:t(e.tertiary_window.reset_at)}):null]},"cursor");case"gemini":return r.jsxs(c,{name:"Gemini",icon:"/brand-logos/gemini.svg",children:[e.primary_window?r.jsx(n,{label:"Pro",pct:e.primary_window.used_percent,reset:t(e.primary_window.reset_at)}):null,e.secondary_window?r.jsx(n,{label:"Flash",pct:e.secondary_window.used_percent,reset:t(e.secondary_window.reset_at)}):null,e.tertiary_window?r.jsx(n,{label:"Lite",pct:e.tertiary_window.used_percent,reset:t(e.tertiary_window.reset_at)}):null]},"gemini");case"kiro":return r.jsxs(c,{name:"Kiro",icon:"/brand-logos/kiro.svg",children:[e.primary_window?r.jsx(n,{label:o("limits.label.kiro_month"),pct:e.primary_window.used_percent,reset:t(e.primary_window.reset_at)}):null,e.secondary_window?r.jsx(n,{label:o("limits.label.kiro_bonus"),pct:e.secondary_window.used_percent,reset:t(e.secondary_window.reset_at)}):null]},"kiro");case"antigravity":return r.jsxs(c,{name:"Antigravity",icon:"/brand-logos/antigravity.svg",children:[e.primary_window?r.jsx(n,{label:"Claude",pct:e.primary_window.used_percent,reset:t(e.primary_window.reset_at)}):null,e.secondary_window?r.jsx(n,{label:"G Pro",pct:e.secondary_window.used_percent,reset:t(e.secondary_window.reset_at)}):null,e.tertiary_window?r.jsx(n,{label:"Flash",pct:e.tertiary_window.used_percent,reset:t(e.tertiary_window.reset_at)}):null]},"antigravity");case"copilot":return r.jsxs(c,{name:"GitHub Copilot",icon:"/brand-logos/copilot.svg",children:[e.primary_window?r.jsx(n,{label:o("limits.label.copilot_premium"),pct:e.primary_window.used_percent,reset:t(e.primary_window.reset_at)}):null,e.secondary_window?r.jsx(n,{label:o("limits.label.copilot_chat"),pct:e.secondary_window.used_percent,reset:t(e.secondary_window.reset_at)}):null,e.otel_has_files||e.otel_enabled?null:r.jsx(D,{defaultDir:e.otel_default_dir})]},"copilot");default:return null}}function D({defaultDir:s}){const[e,l]=b.useState(!1),a=["export COPILOT_OTEL_ENABLED=true","export COPILOT_OTEL_EXPORTER_TYPE=file",`export COPILOT_OTEL_FILE_EXPORTER_PATH="${s||"$HOME/.copilot/otel"}/copilot-otel-$(date +%Y%m%d).jsonl"`].join(`
2
2
  `),x=async()=>{try{await navigator.clipboard.writeText(a),l(!0),setTimeout(()=>l(!1),1600)}catch{}};return r.jsxs("div",{className:"mt-1 rounded-md border border-amber-300/60 dark:border-amber-700/40 bg-amber-50/50 dark:bg-amber-900/10 px-2.5 py-2 text-[11px] text-oai-gray-600 dark:text-oai-gray-300",children:[r.jsx("div",{className:"font-medium text-oai-gray-700 dark:text-oai-gray-200",children:o("limits.copilot.otelHint.title")}),r.jsx("div",{className:"mt-0.5 leading-snug",children:o("limits.copilot.otelHint.body")}),r.jsx("pre",{className:"mt-1.5 overflow-x-auto rounded bg-oai-gray-100 dark:bg-oai-gray-900/60 px-2 py-1.5 font-mono text-[10.5px] leading-tight whitespace-pre",children:a}),r.jsx("button",{type:"button",onClick:x,className:"mt-1 inline-flex items-center gap-1 rounded border border-oai-gray-300 dark:border-oai-gray-700 px-1.5 py-0.5 text-[10.5px] text-oai-gray-700 dark:text-oai-gray-200 hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 transition-colors",children:e?o("limits.copilot.otelHint.copied"):o("limits.copilot.otelHint.copy")})]})}function I({claude:s,codex:e,cursor:l,gemini:i,kiro:a,antigravity:x,copilot:u,order:p,visibility:w}){const h={claude:s,codex:e,cursor:l,gemini:i,kiro:a,antigravity:x,copilot:u},g=(Array.isArray(p)&&p.length>0?p:T).filter(m=>!w||w[m]!==!1).map(m=>R(m,h[m])).filter(Boolean);return g.length===0?null:r.jsx(N,{delay:.15,children:r.jsx(y,{children:r.jsxs("div",{className:"flex flex-col gap-3",children:[r.jsx("h3",{className:"text-sm font-medium text-oai-gray-500 dark:text-oai-gray-300 uppercase tracking-wide",children:o("limits.panel.title")}),g]})})})}function $(){const{data:s,error:e,isLoading:l}=v({initialRefresh:!0}),i=k();return r.jsx("div",{className:"flex flex-col flex-1 text-oai-black dark:text-oai-white font-oai antialiased",children:r.jsx("main",{className:"flex-1 pt-8 sm:pt-10 pb-12 sm:pb-16",children:r.jsxs("div",{className:"mx-auto max-w-6xl px-4 sm:px-6",children:[r.jsxs("div",{className:"flex flex-row items-start justify-between gap-4 mb-8",children:[r.jsxs("div",{className:"min-w-0",children:[r.jsx("h1",{className:"text-3xl sm:text-4xl font-semibold tracking-tight text-oai-black dark:text-white mb-3",children:o("nav.limits")}),r.jsx("p",{className:"text-oai-gray-500 dark:text-oai-gray-400 text-sm sm:text-base",children:o("limits.page.subtitle")})]}),r.jsx(f,{to:"/settings","aria-label":o("limits.page.openSettings"),title:o("limits.page.openSettings"),className:"shrink-0 inline-flex h-9 w-9 items-center justify-center rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-100 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",children:r.jsx(j,{className:"h-4 w-4","aria-hidden":!0})})]}),l?r.jsx(E,{}):r.jsxs(r.Fragment,{children:[e?r.jsx("p",{className:"mb-4 text-sm text-red-500 dark:text-red-400",children:o("shared.error.prefix",{error:e})}):null,r.jsx(I,{claude:s?.claude,codex:s?.codex,cursor:s?.cursor,gemini:s?.gemini,kiro:s?.kiro,antigravity:s?.antigravity,copilot:s?.copilot,order:i.order,visibility:i.visibility})]})]})})})}export{$ as LimitsPage};