tokentracker-cli 0.96.1 → 0.96.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.de.md +34 -25
- package/README.ja.md +38 -27
- package/README.ko.md +39 -28
- package/README.md +36 -28
- package/README.zh-CN.md +36 -25
- package/dashboard/dist/assets/{AchievementBadge-DKyElm0T.js → AchievementBadge-BX4iBBYM.js} +1 -1
- package/dashboard/dist/assets/{AchievementsPage-BvCx3wND.js → AchievementsPage-DRYRuCbh.js} +2 -2
- package/dashboard/dist/assets/{AchievementsSection-DN69LzXX.js → AchievementsSection-BM_JWWhJ.js} +1 -1
- package/dashboard/dist/assets/{BadgeDetailModal-DGiKdZfz.js → BadgeDetailModal-DxoxXst2.js} +1 -1
- package/dashboard/dist/assets/{BotAnimated-zN8rH7_K.js → BotAnimated-BVpFxG8u.js} +1 -1
- package/dashboard/dist/assets/{Card-COWo-ClV.js → Card-BJJs701t.js} +1 -1
- package/dashboard/dist/assets/{ClawdAnimated-BWsB7Eat.js → ClawdAnimated-46wPZ_Tc.js} +2 -2
- package/dashboard/dist/assets/{CommandPalette-BfvIwuoJ.js → CommandPalette-B_zkc7IU.js} +1 -1
- package/dashboard/dist/assets/{CommunityStatsModal-BQWg7R_y.js → CommunityStatsModal-M2k5rIf1.js} +1 -1
- package/dashboard/dist/assets/{ConfirmModal-C7ABSI-O.js → ConfirmModal-DBvOTcAQ.js} +1 -1
- package/dashboard/dist/assets/{Controls-vMzEZzej.js → Controls-BCkjPMSH.js} +1 -1
- package/dashboard/dist/assets/DashboardPage-3bHhou09.js +1 -0
- package/dashboard/dist/assets/{DevicePage-3ejUBLWM.js → DevicePage-DFBUce8C.js} +1 -1
- package/dashboard/dist/assets/DialogClose-kvDd8h3V.js +1 -0
- package/dashboard/dist/assets/DialogDescription-BMyOicfz.js +1 -0
- package/dashboard/dist/assets/DialogTitle-DL5nvD31.js +1 -0
- package/dashboard/dist/assets/{FadeIn-D7Jcfz1N.js → FadeIn-B-Bg6SEy.js} +1 -1
- package/dashboard/dist/assets/{HeaderGithubStar-D--Rx5BS.js → HeaderGithubStar-BExz0hh4.js} +1 -1
- package/dashboard/dist/assets/{HoverTooltip-n1W0z3Wr.js → HoverTooltip-Dj5zemYT.js} +1 -1
- package/dashboard/dist/assets/{IpCheckPage-D202tl9B.js → IpCheckPage-DN7FuJ_v.js} +1 -1
- package/dashboard/dist/assets/{LandingPage-D6yL2EZo.js → LandingPage-9dKgSBRy.js} +2 -2
- package/dashboard/dist/assets/{LeaderboardAvatar-ChFg2mtA.js → LeaderboardAvatar-00V95XIg.js} +1 -1
- package/dashboard/dist/assets/{LeaderboardPage-BXHwGs8r.js → LeaderboardPage-DkKfUt0Z.js} +2 -2
- package/dashboard/dist/assets/{LeaderboardProfileModal-B5LoOpCk.js → LeaderboardProfileModal-C9sIHBgN.js} +4 -4
- package/dashboard/dist/assets/{LeaderboardProfilePage-jsukhRz8.js → LeaderboardProfilePage-BAiLMsEb.js} +1 -1
- package/dashboard/dist/assets/LimitsPage-BuenTaHa.js +8 -0
- package/dashboard/dist/assets/{LocalOnlyNotice-Du0lz657.js → LocalOnlyNotice-CKhY27Lr.js} +1 -1
- package/dashboard/dist/assets/{LoginCard-BFEX9x7-.js → LoginCard-BbvoBx5N.js} +1 -1
- package/dashboard/dist/assets/{LoginModal-DqC7_d35.js → LoginModal-P7zIkBhO.js} +1 -1
- package/dashboard/dist/assets/{LoginPage-Dzx8N7HE.js → LoginPage-Bo0bR26x.js} +1 -1
- package/dashboard/dist/assets/PetPage-C6i9bSSl.js +1 -0
- package/dashboard/dist/assets/PopoverPopup-h0gf36vg.js +1 -0
- package/dashboard/dist/assets/ProviderIcon-Dm8fwPdj.js +1 -0
- package/dashboard/dist/assets/{ResetPasswordPage-x_GR79sR.js → ResetPasswordPage-DvSJ8kg0.js} +1 -1
- package/dashboard/dist/assets/{SegmentedControl-BxDiDV4R.js → SegmentedControl-CP7oiGZE.js} +1 -1
- package/dashboard/dist/assets/Select-iwP92x9C.js +1 -0
- package/dashboard/dist/assets/SelectItemText-DzljA15_.js +1 -0
- package/dashboard/dist/assets/{ServiceStatusPage-BVQuVdjg.js → ServiceStatusPage-uD4D0Tid.js} +1 -1
- package/dashboard/dist/assets/{SessionsPage-DE39wNIO.js → SessionsPage-Cmb1ssNP.js} +2 -2
- package/dashboard/dist/assets/SettingsPage-D8ryg1Pv.js +2 -0
- package/dashboard/dist/assets/SkillsPage-eXI09q03.js +1 -0
- package/dashboard/dist/assets/{TokenGalaxy-BPM779Wb.js → TokenGalaxy-f2djrlUv.js} +1 -1
- package/dashboard/dist/assets/ToolbarRootContext-CDxCPYLv.js +1 -0
- package/dashboard/dist/assets/{TrendMonitor-BkNy-o1D.js → TrendMonitor-C419X22G.js} +1 -1
- package/dashboard/dist/assets/{WidgetsPage-Bpg6H-ZB.js → WidgetsPage-AYq__pOO.js} +1 -1
- package/dashboard/dist/assets/{WrappedPage-C6-NM-RO.js → WrappedPage-Bsm9k5XI.js} +1 -1
- package/dashboard/dist/assets/{__vite-browser-external-CvMMIjhi.css → __vite-browser-external-5P7me0Qq.css} +1 -1
- package/dashboard/dist/assets/__vite-browser-external-BDkeh90N.js +45 -0
- package/dashboard/dist/assets/{agent-logos-DpbkRqXT.js → agent-logos-B6Vg-4_1.js} +1 -1
- package/dashboard/dist/assets/{arrow-up-right-BjOtWUVs.js → arrow-up-right-DIQXwaOD.js} +1 -1
- package/dashboard/dist/assets/{check-BlxnX5jZ.js → check-CgD_bV39.js} +1 -1
- package/dashboard/dist/assets/composite-BIgEqWZD.js +1 -0
- package/dashboard/dist/assets/{copy-CIsWjLY5.js → copy-DlM1BHdp.js} +1 -1
- package/dashboard/dist/assets/{download-QDaQbQdd.js → download-CQFG-VIY.js} +1 -1
- package/dashboard/dist/assets/{external-link-DPV4VU3m.js → external-link-BQyDqGxz.js} +1 -1
- package/dashboard/dist/assets/{flame-B_X-7VNp.js → flame-BamzyXzF.js} +1 -1
- package/dashboard/dist/assets/{format-tokens-DEx2TJj8.js → format-tokens-C4G-_xYt.js} +1 -1
- package/dashboard/dist/assets/{icons-983RyGSl.js → icons-Ntscvl1a.js} +1 -1
- package/dashboard/dist/assets/{index-qtonw_x4.js → index-CUrcPqgp.js} +1 -1
- package/dashboard/dist/assets/{index-BONYA8HZ.js → index-DGxgsNoQ.js} +1 -1
- package/dashboard/dist/assets/{index-Cjs5stC0.js → index-FRIt5mlv.js} +1 -1
- package/dashboard/dist/assets/{info-DpVOhXZI.js → info-CXytWcZi.js} +1 -1
- package/dashboard/dist/assets/{link-2-CBro-upz.js → link-2-Dexoo_jO.js} +1 -1
- package/dashboard/dist/assets/{loader-circle-wYFdSyOd.js → loader-circle-Cn0JHc8t.js} +1 -1
- package/dashboard/dist/assets/{maximize-2-DhTyQ4ly.js → maximize-2-DLh7gYuP.js} +1 -1
- package/dashboard/dist/assets/{modifiers.esm-CPljwVhN.js → modifiers.esm-DOh_xtyt.js} +1 -1
- package/dashboard/dist/assets/module-DUSXqJtA.js +3 -0
- package/dashboard/dist/assets/{monitor-smartphone-D_wr-HOR.js → monitor-smartphone-CpqS9Ior.js} +1 -1
- package/dashboard/dist/assets/{plus-BNjfkBEF.js → plus-bfQV7nyv.js} +1 -1
- package/dashboard/dist/assets/provider-display-Bf9pW06U.js +42 -0
- package/dashboard/dist/assets/{react-yHv9MTUA.js → react-BmFZKA_b.js} +1 -1
- package/dashboard/dist/assets/{search-Dfak92ZA.js → search-l3jJ2fzC.js} +1 -1
- package/dashboard/dist/assets/{skills-api-By2PdNa1.js → skills-api-CWmLnaxn.js} +1 -1
- package/dashboard/dist/assets/{sortable.esm-B9xy66_v.js → sortable.esm-DLgyXLHM.js} +1 -1
- package/dashboard/dist/assets/store-JM-a8ElZ.js +1 -0
- package/dashboard/dist/assets/{terminal-pbXWBmZM.js → terminal-6aY2Sn8P.js} +1 -1
- package/dashboard/dist/assets/{trash-2-CboDPwbW.js → trash-D5oon5pT.js} +1 -1
- package/dashboard/dist/assets/{use-community-stats-D6HTdnHq.js → use-community-stats-ZWUMFwzc.js} +1 -1
- package/dashboard/dist/assets/{use-latest-request-guard-hwSr9Cam.js → use-latest-request-guard-BDaXr4gK.js} +1 -1
- package/dashboard/dist/assets/use-limits-display-prefs-yXXToNIc.js +1 -0
- package/dashboard/dist/assets/{use-ordered-list-OtfOqrNb.js → use-ordered-list-C6RG8N6c.js} +1 -1
- package/dashboard/dist/assets/use-reduced-motion-BqDKim_3.js +1 -0
- package/dashboard/dist/assets/{use-session-efficiency-pref-BScvtS8F.js → use-session-efficiency-pref-DpgZO_Lx.js} +1 -1
- package/dashboard/dist/assets/{use-transform-Cy1ykjEs.js → use-transform-D42P7jkd.js} +1 -1
- package/dashboard/dist/assets/use-usage-limits-CV6puFwq.js +1 -0
- package/dashboard/dist/assets/{useCurrency-VqF3cy1C.js → useCurrency-GWBmOrCR.js} +1 -1
- package/dashboard/dist/assets/{useTokenFormat-Cgub4MXu.js → useTokenFormat-Beybkb0v.js} +1 -1
- package/dashboard/dist/assets/{zap-DStzvQJI.js → zap-CEq2616W.js} +1 -1
- package/dashboard/dist/brand-logos/acode-dark.png +0 -0
- package/dashboard/dist/brand-logos/acode.png +0 -0
- package/dashboard/dist/brand-logos/commandcode.svg +1 -0
- package/dashboard/dist/brand-logos/devin.svg +6 -0
- package/dashboard/dist/index.html +20 -16
- package/dashboard/dist/ip-check.html +2 -2
- package/dashboard/dist/leaderboard.html +2 -2
- package/dashboard/dist/llms.txt +4 -2
- package/dashboard/dist/share.html +2 -2
- package/package.json +2 -2
- package/src/commands/init.js +114 -4
- package/src/commands/status.js +37 -0
- package/src/commands/sync.js +92 -10
- package/src/commands/uninstall.js +23 -0
- package/src/lib/codex-config.js +42 -0
- package/src/lib/codex-rollout-parser.js +2 -2
- package/src/lib/commandcode-limits.js +317 -0
- package/src/lib/devin-limits.js +249 -0
- package/src/lib/devin-usage.js +212 -0
- package/src/lib/local-api.js +14 -0
- package/src/lib/passive-mode.js +13 -1
- package/src/lib/pricing/curated-overrides.json +78 -1
- package/src/lib/pricing/index.js +11 -9
- package/src/lib/pricing/matcher.js +28 -0
- package/src/lib/pricing/seed-snapshot.json +1 -1
- package/src/lib/rollout.js +1473 -147
- package/src/lib/session-analytics.js +2 -2
- package/src/lib/skills-manager.js +5 -0
- package/src/lib/subscriptions.js +70 -16
- package/src/lib/usage-limits.js +240 -49
- package/dashboard/dist/assets/DashboardPage-QBhbCMZF.js +0 -1
- package/dashboard/dist/assets/DialogClose-D_dvtfGV.js +0 -1
- package/dashboard/dist/assets/DialogDescription-ryGYdQjX.js +0 -1
- package/dashboard/dist/assets/DialogTitle-_ahf0z8b.js +0 -1
- package/dashboard/dist/assets/LimitsPage-PvqkOOwp.js +0 -6
- package/dashboard/dist/assets/PetPage-CNlWHF4z.js +0 -1
- package/dashboard/dist/assets/PopoverPopup-D9jadD3j.js +0 -1
- package/dashboard/dist/assets/ProviderIcon-Caz5PuAm.js +0 -1
- package/dashboard/dist/assets/Select-B5o-1sEl.js +0 -1
- package/dashboard/dist/assets/SelectItemText-CiA6L7Wk.js +0 -1
- package/dashboard/dist/assets/SettingsPage-DJrb_fsK.js +0 -2
- package/dashboard/dist/assets/SkillsPage-COk-YQQ5.js +0 -1
- package/dashboard/dist/assets/ToolbarRootContext-CozJT6Vs.js +0 -1
- package/dashboard/dist/assets/__vite-browser-external-BGnq8Ebm.js +0 -45
- package/dashboard/dist/assets/composite-Dxmivlk4.js +0 -1
- package/dashboard/dist/assets/limits-providers-BUoquSA-.js +0 -1
- package/dashboard/dist/assets/module-xpSFyNBK.js +0 -3
- package/dashboard/dist/assets/provider-display-BOBtUyFi.js +0 -42
- package/dashboard/dist/assets/store-oQZR4d9M.js +0 -1
- package/dashboard/dist/assets/use-limits-display-prefs-B-pbwUS8.js +0 -1
- package/dashboard/dist/assets/use-reduced-motion-DGXcZBX3.js +0 -1
- package/dashboard/dist/assets/use-usage-limits-CSMb2zYW.js +0 -1
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import{m as Ne,r as i,j as e,c as o,a0 as Oe,aa as He,a4 as Ge,X as qe,a3 as Ke,n as Ve}from"./__vite-browser-external-BGnq8Ebm.js";import{u as Ze}from"./useCurrency-VqF3cy1C.js";import{u as Se}from"./useTokenFormat-Cgub4MXu.js";import{M as Je}from"./maximize-2-DhTyQ4ly.js";import{T as Qe}from"./terminal-pbXWBmZM.js";import{I as et}from"./info-DpVOhXZI.js";const tt=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],at=Ne("pause",tt);const rt=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],ot=Ne("play",rt);const nt=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],st=Ne("rotate-ccw",nt),ae={emerald:{light:["#ebedf0","#a7f3d0","#6ee7b7","#34d399","#10b981"],dark:["#2d333b","#065f46","#059669","#10b981","#34d399"],gridColor:{light:"rgba(16, 185, 129, 0.12)",dark:"rgba(52, 211, 153, 0.08)"}},ocean:{light:["#f1f5f9","#93c5fd","#60a5fa","#3b82f6","#1d4ed8"],dark:["#1e293b","#1e3a8a","#2563eb","#3b82f6","#60a5fa"],gridColor:{light:"rgba(59, 130, 246, 0.12)",dark:"rgba(96, 165, 250, 0.08)"}},neon:{light:["#faf5ff","#ebd5ff","#c084fc","#a855f7","#7e22ce"],dark:["#2e1065","#581c87","#8b5cf6","#a855f7","#c084fc"],gridColor:{light:"rgba(168, 85, 247, 0.12)",dark:"rgba(192, 132, 252, 0.08)"}},amber:{light:["#fffbeb","#fde68a","#f59e0b","#d97706","#b45309"],dark:["#451a03","#78350f","#b45309","#d97706","#f59e0b"],gridColor:{light:"rgba(245, 158, 11, 0.12)",dark:"rgba(245, 158, 11, 0.08)"}}};function lt(s,d){const p=/^#([0-9a-f]{6})$/i.exec(s);if(!p)return s;const c=parseInt(p[1],16),f=c>>16&255,$=c>>8&255,Y=c&255,P=A=>Math.max(0,Math.min(255,Math.round(A*d)));return`rgb(${P(f)}, ${P($)}, ${P(Y)})`}function q(s,d,p,c,f){const $=Math.cos(c),Y=Math.sin(c),P=s*$-d*Y,A=s*Y+d*$,R=p,S=Math.cos(f),E=Math.sin(f),K=P,h=A*S-R*E,v=A*E+R*S;return{x:K,y:h,z:v}}function it(s,d,p,c,f){return q(s,d,p,c,f)}function Re(s,d,p=c=>Number(c).toLocaleString()){const c=p(d);if(s>=4){const f=Math.floor(Math.random()*3)+1;return o(`heatmap.3d.voxel.joke.${f}`,{value:c})}else return s===3?o("heatmap.3d.voxel.level3",{value:c}):s===2?o("heatmap.3d.voxel.level2",{value:c}):s===1?o("heatmap.3d.voxel.level1",{value:c}):o("heatmap.3d.voxel.level0")}function Ae({weeks:s,palette:d="auto",isDark:p=!1,interactive:c=!1,autoRotateInit:f=!1,onResetViewRef:$=null}){const{formatTokens:Y,formatTokensTooltip:P}=Se(),A=ae[d]||(d==="auto"?ae.emerald:null),R=A?p?A.dark:A.light:Array.isArray(d)?d:p?ae.emerald.dark:ae.emerald.light,S=A?p?A.gridColor.dark:A.gridColor.light:p?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.06)",E=-.2,K=.88,[h,v]=i.useState({yaw:E,pitch:K}),[le,V]=i.useState(f),[he,L]=i.useState(1),j=c?13:10.5,fe=i.useMemo(()=>{const t=[],r=s.length;if(r===0||!c)return[];for(let n=0;n<=7;n++){const l=(n-3.5)*j,m=q(-r/2*j,l,0,h.yaw,h.pitch),x=q(r/2*j,l,0,h.yaw,h.pitch);t.push({d:`M${m.x},${m.y} L${x.x},${x.y}`,key:`horiz-${n}`})}for(let n=0;n<=r;n+=4){const l=(n-r/2)*j,m=q(l,-3.5*j,0,h.yaw,h.pitch),x=q(l,3.5*j,0,h.yaw,h.pitch);t.push({d:`M${m.x},${m.y} L${x.x},${x.y}`,key:`vert-${n}`})}if(r%4!==0){const n=(r-r/2)*j,l=q(n,-3.5*j,0,h.yaw,h.pitch),m=q(n,3.5*j,0,h.yaw,h.pitch);t.push({d:`M${l.x},${l.y} L${m.x},${m.y}`,key:"vert-last"})}return t},[s.length,h,j,c]);i.useEffect(()=>{$&&($.current={reset:()=>{v({yaw:E,pitch:K}),V(!1),L(1),be()},toggleAutoRotate:t=>{V(t)}})},[$]);const Z=i.useRef(null),F=i.useRef(null),B=i.useRef(!1),ie=i.useRef({x:0,y:0}),J=i.useRef({yaw:E,pitch:K}),U=i.useRef({x:0,y:0}),oe=i.useRef({x:0,y:0,time:0}),ne=i.useRef(null),[ge,ye]=i.useState(0),Q=i.useRef(null),se=i.useRef(!0);i.useEffect(()=>(se.current=!0,()=>{se.current=!1}),[]);const be=()=>{Q.current&&cancelAnimationFrame(Q.current),ye(0);const t=performance.now(),r=1200,n=l=>{if(!se.current)return;const m=l-t,x=Math.min(1,m/r),C=1-Math.pow(1-x,3);ye(C),x<1?Q.current=requestAnimationFrame(n):Q.current=null};Q.current=requestAnimationFrame(n)};i.useEffect(()=>(be(),()=>{Q.current&&cancelAnimationFrame(Q.current)}),[c]),i.useEffect(()=>{if(!le||B.current||typeof window>"u"||typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches)return;let r;const n=()=>{if(typeof document<"u"&&document.visibilityState==="hidden"){r=requestAnimationFrame(n);return}v(l=>({yaw:l.yaw+.002,pitch:l.pitch})),r=requestAnimationFrame(n)};return r=requestAnimationFrame(n),()=>cancelAnimationFrame(r)},[le]);const ce=(t,r)=>{c&&(B.current=!0,ie.current={x:t,y:r},J.current={yaw:h.yaw,pitch:h.pitch},U.current={x:0,y:0},oe.current={x:t,y:r,time:performance.now()},ne.current&&cancelAnimationFrame(ne.current))},I=(t,r)=>{if(!B.current)return;const n=t-ie.current.x,l=r-ie.current.y,m=performance.now(),x=m-oe.current.time;x>0&&(U.current={x:(t-oe.current.x)/x,y:(r-oe.current.y)/x}),oe.current={x:t,y:r,time:m};const C=.005,M=J.current.yaw-n*C,k=Math.PI/2.3,b=Math.max(-k,Math.min(k,J.current.pitch-l*C));v({yaw:M,pitch:b})},ve=()=>{if(!B.current)return;B.current=!1;let t=-U.current.x*12,r=-U.current.y*12;const n=.95,l=()=>{B.current||(t*=n,r*=n,!(Math.abs(t)<.01&&Math.abs(r)<.01)&&(v(m=>{const x=m.yaw+t*.005,C=Math.PI/2.3,M=Math.max(-C,Math.min(C,m.pitch+r*.005));return{yaw:x,pitch:M}}),ne.current=requestAnimationFrame(l)))};ne.current=requestAnimationFrame(l)},[g,de]=i.useState(null),[ee,xe]=i.useState({x:0,y:0,shiftX:0}),y=i.useRef(null);i.useEffect(()=>()=>{y.current&&clearTimeout(y.current)},[]),i.useEffect(()=>{if(!c||!F.current)return;const t=n=>{n.preventDefault();const l=-n.deltaY*.0025;L(m=>{const x=m+l;return Math.max(.5,Math.min(3,x))})},r=F.current;return r.addEventListener("wheel",t,{passive:!1}),()=>{r.removeEventListener("wheel",t)}},[c]);const T=i.useMemo(()=>{const t=[];return s.forEach((r,n)=>{(Array.isArray(r)?r:[]).forEach((l,m)=>{l&&t.push({key:l.day||`${n}-${m}`,col:n,row:m,level:l.level||0,value:l.value||0,day:l.day,models:l.models||null})})}),t},[s]),pe=j-(c?1.8:1.5),ke=c?38:28,we=t=>Math.max(1.8,Number(t)/4*ke),te=i.useMemo(()=>{if(T.length===0)return[];const t=s.length;return T.map(r=>{const n=we(r.level),l=Math.sqrt(Math.pow(r.col-t/2,2)+Math.pow(r.row-3.5,2)),m=Math.sqrt(Math.pow(t/2,2)+Math.pow(3.5,2)),x=l/m*.4,C=Math.min(1,Math.max(0,(ge-x)*(1/.6))),M=n*C,k=(r.col-t/2)*j,b=(r.row-3.5)*j,w=pe/2,H=[{x:k-w,y:b-w,z:0},{x:k+w,y:b-w,z:0},{x:k+w,y:b+w,z:0},{x:k-w,y:b+w,z:0},{x:k-w,y:b-w,z:M},{x:k+w,y:b-w,z:M},{x:k+w,y:b+w,z:M},{x:k-w,y:b+w,z:M}].map(X=>q(X.x,X.y,X.z,h.yaw,h.pitch)),ue=q(k,b,M/2,h.yaw,h.pitch),Le=[{name:"top",indices:[4,5,6,7],scale:1,normal:[0,0,1]},{name:"bottom",indices:[3,2,1,0],scale:.4,normal:[0,0,-1]},{name:"left",indices:[3,0,4,7],scale:.55,normal:[-1,0,0]},{name:"right",indices:[1,2,6,5],scale:.75,normal:[1,0,0]},{name:"front",indices:[0,1,5,4],scale:.85,normal:[0,-1,0]},{name:"back",indices:[2,3,7,6],scale:.65,normal:[0,1,0]}],De=R[Math.min(4,Math.max(0,Number(r.level)||0))],ze=[],Ye=.35,Ue=-.4,Ie=.83;return Le.forEach(X=>{const je=it(X.normal[0],X.normal[1],X.normal[2],h.yaw,h.pitch);if(je.z>.001){const _e=H[X.indices[0]],Me=H[X.indices[1]],Te=H[X.indices[2]],$e=H[X.indices[3]],We=`M${_e.x},${_e.y} L${Me.x},${Me.y} L${Te.x},${Te.y} L${$e.x},${$e.y} Z`,Xe=je.x*Ye+je.y*Ue+je.z*Ie,Be=p?.18:0,Fe=X.scale*(.82+.28*Math.max(0,Xe))+Be;ze.push({name:X.name,d:We,fill:lt(De,Fe)})}}),{...r,centerProj:ue,renderedFaces:ze}})},[T,h,R,s.length,ge,j,pe,ke]),G=i.useMemo(()=>[...te].sort((t,r)=>t.centerProj.z-r.centerProj.z),[te]),_=i.useMemo(()=>{if(G.length===0)return{minX:-100,minY:-100,maxX:100,maxY:100};let t=1/0,r=1/0,n=-1/0,l=-1/0;return G.forEach(m=>{const x=j*2,C=m.centerProj.x,M=m.centerProj.y;C-x<t&&(t=C-x),C+x>n&&(n=C+x),M-x<r&&(r=M-x),M+x>l&&(l=M+x)}),{minX:t,minY:r,maxX:n,maxY:l}},[G,j]),D=12,me=_.maxX-_.minX+D*2,a=_.maxY-_.minY+D*2,u=me/he,z=a/he,N=_.minX-D+(me-u)/2,W=_.minY-D+(a-z)/2,O=`${N} ${W} ${u} ${z}`;return T.length===0?e.jsx("div",{className:"py-8 text-center text-sm text-oai-gray-500",children:o("heatmap.empty")}):e.jsxs("div",{ref:F,className:`relative select-none outline-none ${c?"cursor-grab active:cursor-grabbing w-full h-full flex items-center justify-center":"w-full overflow-hidden flex justify-center"}`,onMouseDown:t=>{if(!c)return;ce(t.clientX,t.clientY);const r=l=>I(l.clientX,l.clientY),n=()=>{ve(),window.removeEventListener("mousemove",r),window.removeEventListener("mouseup",n)};window.addEventListener("mousemove",r),window.addEventListener("mouseup",n)},onTouchStart:t=>{!c||t.touches.length===0||ce(t.touches[0].clientX,t.touches[0].clientY)},onTouchMove:t=>{!c||t.touches.length===0||I(t.touches[0].clientX,t.touches[0].clientY)},onTouchEnd:()=>{c&&ve()},children:[e.jsxs("svg",{ref:Z,viewBox:O,width:c?"95%":"100%",height:c?"95%":"auto",role:"img","aria-label":o("heatmap.iso.aria")||"3D interactive activity heatmap",style:{display:"block",width:"100%",height:"auto",maxWidth:c?"none":`${me}px`,maxHeight:c?"78vh":"none"},className:"transition-transform duration-300 ease-out",children:[c&&fe.map(t=>e.jsx("path",{d:t.d,fill:"none",stroke:S,strokeWidth:.25,strokeDasharray:"1.5 2.5",strokeLinecap:"round"},t.key)),G.map(t=>{const r=g&&g.key===t.key;return e.jsxs("g",{onMouseEnter:n=>{if(y.current&&(clearTimeout(y.current),y.current=null),de(t),c&&Z.current){const l=q((t.col-s.length/2)*j,(t.row-3.5)*j,we(t.level),h.yaw,h.pitch);let m=0,x=0;const C=Z.current;if(F.current&&typeof C.createSVGPoint=="function"&&typeof C.getScreenCTM=="function")try{const w=C.createSVGPoint();w.x=l.x,w.y=l.y;const re=C.getScreenCTM();if(re){const H=w.matrixTransform(re),ue=F.current.getBoundingClientRect();m=H.x-ue.left,x=H.y-ue.top}}catch{const re=C.getBoundingClientRect(),H=_.maxX-_.minX+D*2,ue=_.maxY-_.minY+D*2;m=(l.x-(_.minX-D))/H*re.width,x=(l.y-(_.minY-D))/ue*re.height}else{const w=C.getBoundingClientRect(),re=_.maxX-_.minX+D*2,H=_.maxY-_.minY+D*2;m=(l.x-(_.minX-D))/re*w.width,x=(l.y-(_.minY-D))/H*w.height}const M=140;let k=0;const b=F.current?F.current.getBoundingClientRect().width:C.getBoundingClientRect().width;m<M?k=M-m:m>b-M&&(k=b-M-m),xe({x:m,y:x,shiftX:k})}},onMouseLeave:()=>{y.current&&clearTimeout(y.current),y.current=setTimeout(()=>{de(null)},150)},className:"transition-all duration-200",style:{filter:r?"brightness(1.15) drop-shadow(0 4px 6px rgba(0,0,0,0.15))":"none",cursor:c?"pointer":"default"},children:[!c&&t.day&&e.jsx("title",{children:o("heatmap.tooltip.tokens",{day:t.day,value:P(t.value)})}),t.renderedFaces.map((n,l)=>e.jsx("path",{d:n.d,fill:n.fill,stroke:n.fill,strokeWidth:.25,strokeLinejoin:"round"},l))]},t.key)})]}),c&&g&&e.jsxs("div",{onMouseEnter:()=>{y.current&&(clearTimeout(y.current),y.current=null)},onMouseLeave:()=>{y.current&&clearTimeout(y.current),y.current=setTimeout(()=>{de(null)},150)},className:"absolute z-[9999] w-0 h-0 transition-all duration-100 ease-out",style:{left:`${ee.x}px`,top:`${ee.y}px`},children:[e.jsxs("div",{className:"absolute left-0 bottom-[10px] backdrop-blur-md bg-white/90 dark:bg-oai-gray-900/90 border border-oai-gray-200/50 dark:border-oai-gray-800/50 shadow-xl rounded-xl p-3.5 max-w-[280px] min-w-[200px] flex flex-col gap-2 animate-in fade-in zoom-in-95 duration-100",style:{transform:`translateX(calc(-50% + ${ee.shiftX}px))`},children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-oai-gray-100 dark:border-oai-gray-800/80 pb-1.5",children:[e.jsx("span",{className:"text-[11px] font-semibold text-oai-gray-500 dark:text-oai-gray-400",children:g.day}),(()=>{const t=g.level===0?p?"#9ca3af":"#6b7280":R[g.level];return e.jsx("span",{className:"text-[10px] px-2 py-0.5 rounded-full font-medium",style:{backgroundColor:t+"22",color:t,border:`1px solid ${t}44`},children:o("heatmap.tooltip.level",{level:g.level})})})()]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex items-baseline gap-1",children:[e.jsx("span",{title:P(g.value),className:"text-lg font-bold text-oai-gray-900 dark:text-white leading-none",children:Y(g.value)}),e.jsx("span",{className:"text-[10px] text-oai-gray-400 uppercase tracking-wider font-semibold",children:o("heatmap.unit.tokens")})]}),g.models&&Object.keys(g.models).length>0?e.jsxs("div",{className:"mt-1.5 border-t border-oai-gray-100 dark:border-oai-gray-800/60 pt-2 flex flex-col gap-1.5",children:[e.jsx("div",{className:"text-[10px] font-semibold text-oai-gray-400 dark:text-oai-gray-500 uppercase tracking-wider",children:o("heatmap.tooltip.model_breakdown")}),e.jsx("div",{className:"flex flex-col gap-2 max-h-[150px] overflow-y-auto pr-1.5 scrollbar-thin",children:Object.entries(g.models).map(([t,r])=>({name:t,val:Number(r)})).sort((t,r)=>r.val-t.val).map(({name:t,val:r})=>{const n=Number(g.value)||1,l=Math.round(r/n*100);return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center justify-between text-[11px] gap-3",children:[e.jsx("span",{className:"font-medium text-oai-gray-750 dark:text-oai-gray-200 truncate max-w-[120px]",title:t,children:t}),e.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[e.jsx("span",{title:P(r),className:"font-mono text-oai-gray-900 dark:text-oai-gray-100 font-semibold",children:Y(r)}),e.jsxs("span",{className:"text-[9px] text-oai-gray-450 dark:text-oai-gray-500 min-w-[28px] text-right font-medium",children:[l,"%"]})]})]}),e.jsx("div",{className:"w-full h-1 bg-oai-gray-100 dark:bg-oai-gray-800/85 rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full rounded-full transition-all duration-300",style:{width:`${l}%`,backgroundColor:R[4],boxShadow:`0 0 4px ${R[4]}55`}})})]},t)})})]}):e.jsx("p",{className:"text-[11px] text-oai-gray-600 dark:text-oai-gray-300 leading-relaxed font-normal mt-1 border-t border-dashed border-oai-gray-100 dark:border-oai-gray-800/60 pt-1.5",children:Re(g.level,g.value,Y)})]})]}),e.jsx("div",{className:"absolute bottom-[6px] left-0 -translate-x-1/2 w-2.5 h-2.5 rotate-45 bg-white dark:bg-oai-gray-900 border-r border-b border-oai-gray-200/50 dark:border-oai-gray-800/50 shadow-sm",style:{marginBottom:"1px"}})]})]})}const ct=12,dt=3,mt=26,ut=["#ebedf0","#a7f3d0","#6ee7b7","#34d399","#10b981"],xt=["#121212","#065f46","#059669","#10b981","#34d399"];function pt(s){if(typeof s!="string")return null;const d=/^(\d{4})-(\d{2})-(\d{2})$/.exec(s.trim());if(!d)return null;const p=new Date(Date.UTC(Number(d[1]),Number(d[2])-1,Number(d[3])));return Number.isFinite(p.getTime())?p:null}function Pe(s,d){return new Date(Date.UTC(s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate()+d))}function ht(s,d){return Math.floor((Date.UTC(d.getUTCFullYear(),d.getUTCMonth(),d.getUTCDate())-Date.UTC(s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate()))/864e5)}function ft(s,d){const p=d==="mon"?1:0,c=s.getUTCDay();return Pe(s,-((c-p+7)%7))}function gt(s,d,p,c){if(!s)return[];const f=pt(d)||new Date,$=[];for(let S=11;S>=0;S-=1)$.push(new Date(Date.UTC(f.getUTCFullYear(),f.getUTCMonth()-S,1)));const Y=ft(f,p),P=Pe(Y,-(s-1)*7),A=[],R=new Set;for(const S of $){const E=Math.floor(ht(P,S)/7);E<0||E>=s||R.has(E)||(R.add(E),A.push({label:c[S.getUTCMonth()],index:E}))}return A}function Mt({heatmap:s,timeZoneLabel:d,timeZoneShortLabel:p,hideLegend:c=!1,embedded:f=!1}){const{resolvedTheme:$}=Oe(),{currency:Y,rate:P}=Ze(),{formatTokens:A,formatTokensTooltip:R}=Se(),S=$==="dark",E=S?xt:ut,K=i.useRef(null),h=i.useRef(null),[v,le]=i.useState(null),[V,he]=i.useState({x:0,y:0,shiftX:0,flipY:!1}),L=i.useRef(null);i.useEffect(()=>()=>{L.current&&clearTimeout(L.current)},[]);const[j,fe]=i.useState(!1),[Z,F]=i.useState(!1),[B,ie]=i.useState(!1),J=i.useRef(null),[U,oe]=i.useState("emerald"),ne=[o("heatmap.month.jan"),o("heatmap.month.feb"),o("heatmap.month.mar"),o("heatmap.month.apr"),o("heatmap.month.may"),o("heatmap.month.jun"),o("heatmap.month.jul"),o("heatmap.month.aug"),o("heatmap.month.sep"),o("heatmap.month.oct"),o("heatmap.month.nov"),o("heatmap.month.dec")],ge=(a,u)=>{if(!u||!u.day)return;L.current&&(clearTimeout(L.current),L.current=null),le(u);const z=a.currentTarget.getBoundingClientRect(),N=typeof window<"u"?window.innerWidth:1024,W=z.left+z.width/2,O=z.top<300,t=O?z.bottom:z.top,r=140;let n=0;W<r?n=r-W:W>N-r&&(n=N-r-W),he({x:W,y:t,shiftX:n,flipY:O})},ye=()=>{L.current&&clearTimeout(L.current),L.current=setTimeout(()=>{le(null)},150)},Q=()=>{F(!1),fe(!0)},se=()=>{F(!0)},be=a=>{a.target===a.currentTarget&&Z&&(fe(!1),F(!1))};i.useEffect(()=>{if(!j||Z)return;const a=u=>{u.key==="Escape"&&se()};return window.addEventListener("keydown",a),()=>{window.removeEventListener("keydown",a)}},[j,Z]);const ce=i.useMemo(()=>({emerald:{accentText:"text-emerald-500 dark:text-emerald-400",accentBg:"bg-emerald-500/10 dark:bg-emerald-400/10",accentBorder:"border-emerald-500/20 dark:border-emerald-400/15",hoverBorder:"hover:border-emerald-500/30 dark:hover:border-emerald-400/30",hoverGlow:"hover:shadow-[0_0_20px_-3px_rgba(16,185,129,0.15)] hover:dark:shadow-[0_0_20px_-3px_rgba(52,211,153,0.25)]",rawColor:"#10b981"},ocean:{accentText:"text-blue-500 dark:text-blue-400",accentBg:"bg-blue-500/10 dark:bg-blue-400/10",accentBorder:"border-blue-500/20 dark:border-blue-400/15",hoverBorder:"hover:border-blue-500/30 dark:hover:border-blue-400/30",hoverGlow:"hover:shadow-[0_0_20px_-3px_rgba(59,130,246,0.15)] hover:dark:shadow-[0_0_20px_-3px_rgba(96,165,250,0.25)]",rawColor:"#3b82f6"},neon:{accentText:"text-purple-500 dark:text-purple-400",accentBg:"bg-purple-500/10 dark:bg-purple-400/10",accentBorder:"border-purple-500/20 dark:border-purple-400/15",hoverBorder:"hover:border-purple-500/30 dark:hover:border-purple-400/30",hoverGlow:"hover:shadow-[0_0_20px_-3px_rgba(168,85,247,0.15)] hover:dark:shadow-[0_0_20px_-3px_rgba(192,132,252,0.25)]",rawColor:"#a855f7"},amber:{accentText:"text-amber-500 dark:text-amber-400",accentBg:"bg-amber-500/10 dark:bg-amber-400/10",accentBorder:"border-amber-500/20 dark:border-amber-400/15",hoverBorder:"hover:border-amber-500/30 dark:hover:border-amber-400/30",hoverGlow:"hover:shadow-[0_0_20px_-3px_rgba(245,158,11,0.15)] hover:dark:shadow-[0_0_20px_-3px_rgba(245,158,11,0.25)]",rawColor:"#f59e0b"}}),[]),I=ce[U]||ce.emerald,ve=ae[U]?S?ae[U].dark:ae[U].light:S?ae.emerald.dark:ae.emerald.light,[g,de]=i.useState(()=>{if(f)return"2d";try{return window.localStorage?.getItem("tt:heatmap-view")==="3d"?"3d":"2d"}catch{return"2d"}});i.useEffect(()=>{if(!f)try{window.localStorage?.setItem("tt:heatmap-view",g)}catch{}},[g,f]),i.useEffect(()=>{if(g!=="2d")return;const a=K.current;a&&(a.scrollLeft=a.scrollWidth)},[s?.weeks,g]),i.useEffect(()=>{const a=K.current;if(!a)return;const u=()=>{L.current&&(clearTimeout(L.current),L.current=null),le(null)};return a.addEventListener("scroll",u),()=>a.removeEventListener("scroll",u)},[]);const ee=s?.week_starts_on==="mon"?"mon":"sun",xe=i.useMemo(()=>{const a=Array.isArray(s?.weeks)?s.weeks:[];if(!a.length)return{weeks:[]};const u=[];for(const z of a)for(const N of Array.isArray(z)?z:[])N?.day&&u.push({day:N.day,total_tokens:N.total_tokens??N.value??0,billable_total_tokens:N.billable_total_tokens??N.value??N.total_tokens??0,models:N.models??null});return He({dailyRows:u,weeks:Math.max(52,a.length),to:s?.to,weekStartsOn:ee})},[s?.to,s?.weeks,ee]),y=xe?.weeks||[],T=i.useMemo(()=>{let a=0,u=0,z={day:null,value:0},N=0,W=0;const O=[];y.forEach(k=>{(Array.isArray(k)?k:[]).forEach(b=>{b&&b.day&&O.push(b)})}),O.sort((k,b)=>k.day.localeCompare(b.day)),O.forEach(k=>{const b=Number(k.value)||0;a+=b,b>0?(u++,N++,N>W&&(W=N)):N=0,b>z.value&&(z={day:k.day,value:b})});const t=O.length||365,r=(u/t*100).toFixed(1);let n="heatmap.3d.modal.ai.eval.default",l="heatmap.3d.modal.ai.title.default";a>=15e6?(l="heatmap.3d.modal.ai.title.peak",n="heatmap.3d.modal.ai.eval.peak"):a>=5e6?(l="heatmap.3d.modal.ai.title.heavy",n="heatmap.3d.modal.ai.eval.heavy"):a>=1e6?(l="heatmap.3d.modal.ai.title.core",n="heatmap.3d.modal.ai.eval.core"):a>=2e4&&(l="heatmap.3d.modal.ai.title.steady",n="heatmap.3d.modal.ai.eval.steady");const m=s?.total_cost_usd,x=Number(m),M=m!=null&&(typeof m!="string"||m.trim()!=="")&&Number.isFinite(x)?x:a/15e5;return{totalTokens:a,activeDays:u,activeRate:r,maxSingleDay:z,maxStreak:W,aiEvaluationTitleKey:l,aiEvaluationKey:n,totalCostUsd:M}},[y,s?.total_cost_usd]),Ce=i.useMemo(()=>Ge(T.totalCostUsd,{currency:Y,rate:P}),[T.totalCostUsd,Y,P]),pe=a=>A(a,{mode:Ve.COMPACT,decimals:2}),ke=ee==="mon"?["Mon","Tue","Wed","Thu","Fri","Sat","Sun"].map(a=>o(`heatmap.day.${a.toLowerCase()}`)):["Sun","Mon","Tue","Wed","Thu","Fri","Sat"].map(a=>o(`heatmap.day.${a.toLowerCase()}`)),we=i.useMemo(()=>gt(y.length,xe?.to,ee,ne),[xe?.to,y.length,ee,ne]);if(!y.length)return e.jsx("div",{className:"py-8 text-center text-sm text-oai-gray-500",children:o("heatmap.empty")});const te=f?10:ct,G=f?2:dt,_=f?22:mt,D=_+y.length*te+Math.max(0,y.length-1)*G,me=`${_}px repeat(${y.length}, ${te}px)`;return e.jsxs("div",{ref:h,className:f?"relative":"relative rounded-xl border border-oai-gray-200 dark:border-oai-gray-800 bg-white dark:bg-oai-gray-900 p-5",children:[!f&&e.jsxs("div",{className:"flex items-baseline justify-between mb-3",children:[e.jsx("h3",{className:"text-sm font-medium text-oai-gray-500 dark:text-oai-gray-300 uppercase tracking-wide",children:o("heatmap.title")}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{role:"tablist","aria-label":"Heatmap view",className:"flex rounded-md border border-oai-gray-200 dark:border-oai-gray-800 p-0.5 text-[10px]",children:[e.jsx("button",{type:"button",role:"tab","aria-selected":g==="2d",onClick:()=>de("2d"),className:g==="2d"?"px-2 py-0.5 rounded bg-oai-gray-100 text-oai-black dark:bg-oai-gray-800 dark:text-oai-white font-medium":"px-2 py-0.5 rounded text-oai-gray-500 dark:text-oai-gray-400 hover:text-oai-gray-700 dark:hover:text-oai-gray-200",children:o("heatmap.view.2d")}),e.jsx("button",{type:"button",role:"tab","aria-selected":g==="3d",onClick:()=>de("3d"),className:g==="3d"?"px-2 py-0.5 rounded bg-oai-gray-100 text-oai-black dark:bg-oai-gray-800 dark:text-oai-white font-medium":"px-2 py-0.5 rounded text-oai-gray-500 dark:text-oai-gray-400 hover:text-oai-gray-700 dark:hover:text-oai-gray-200",children:o("heatmap.view.3d")})]}),e.jsx("span",{className:"text-xs text-oai-gray-400 dark:text-oai-gray-450",children:p||o("heatmap.legend.utc")})]})]}),g==="3d"&&e.jsxs("div",{onClick:Q,className:"cursor-pointer group relative overflow-hidden rounded-lg hover:border-oai-gray-350 dark:hover:border-oai-gray-700 border border-transparent transition-all",title:o("heatmap.3d.hover_tip"),children:[e.jsx(Ae,{weeks:y,isDark:S,palette:U}),e.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-oai-gray-900/5 to-transparent pointer-events-none opacity-0 group-hover:opacity-100 transition-opacity flex items-end justify-center pb-2",children:e.jsxs("span",{className:"text-[10px] bg-white/95 dark:bg-oai-gray-900/95 shadow border border-oai-gray-200/60 dark:border-oai-gray-800/80 px-2.5 py-1 rounded-full font-medium text-oai-gray-500 dark:text-oai-gray-400 flex items-center gap-1 transform translate-y-2 group-hover:translate-y-0 transition-transform duration-200",children:[e.jsx(Je,{size:9}),o("heatmap.3d.hover_tip")]})})]}),g==="2d"&&e.jsx("div",{ref:K,className:`overflow-x-auto overflow-y-hidden heatmap-scroll-thin${f?"":" pb-1"}`,children:e.jsxs("div",{style:{minWidth:D},children:[e.jsxs("div",{className:"grid text-[10px] uppercase text-oai-gray-400 dark:text-oai-gray-400 mb-1",style:{gridTemplateColumns:me,columnGap:G},children:[e.jsx("span",{}),we.map(a=>e.jsx("span",{style:{gridColumnStart:a.index+2},className:"whitespace-nowrap",children:a.label},`${a.label}-${a.index}`))]}),e.jsxs("div",{className:"grid",style:{gridTemplateColumns:me,columnGap:G},children:[e.jsx("div",{className:"grid text-[10px] text-oai-gray-400 dark:text-oai-gray-400 sticky left-0 bg-white dark:bg-oai-gray-900 pr-2",style:{gridTemplateRows:`repeat(7, ${te}px)`,rowGap:G},children:ke.map(a=>e.jsx("span",{className:"leading-none",children:a},a))}),e.jsx("div",{className:"grid",style:{gridAutoFlow:"column",gridTemplateRows:`repeat(7, ${te}px)`,gap:G},children:y.map((a,u)=>(Array.isArray(a)?a:[]).map((z,N)=>{if(!z)return null;const W=z.day||`e-${u}-${N}`,O=Number(z.level)||0,t=E[O]||E[0];return e.jsx("span",{onMouseEnter:r=>ge(r,z),onMouseLeave:ye,className:"rounded-[2px] transition-transform hover:scale-125 hover:z-10 cursor-pointer",style:{width:te,height:te,background:t}},W)}))})]})]})}),!c&&e.jsxs("div",{className:"flex items-center justify-center gap-2 mt-3",children:[e.jsx("span",{className:"text-[10px] text-oai-gray-400 dark:text-oai-gray-400",children:o("heatmap.legend.less")}),e.jsx("div",{className:"flex gap-0.5",children:E.map((a,u)=>e.jsx("span",{className:"rounded-[1px]",style:{width:10,height:10,background:a}},u))}),e.jsx("span",{className:"text-[10px] text-oai-gray-400 dark:text-oai-gray-400",children:o("heatmap.legend.more")})]}),j&&e.jsx("div",{onAnimationEnd:be,onClick:a=>{a.target===a.currentTarget&&se()},className:`fixed inset-0 z-50 flex items-center justify-center p-3 md:p-6 backdrop-blur-md bg-black/15 dark:bg-black/40 ${Z?"animate-tt-fade-out":"animate-tt-fade-in"}`,children:e.jsxs("div",{className:`relative w-full max-w-6xl h-[88vh] backdrop-blur-2xl bg-white/90 dark:bg-oai-gray-900/90 border border-oai-gray-200/50 dark:border-white/10 shadow-2xl rounded-2xl flex flex-col md:flex-row overflow-hidden ${Z?"animate-tt-modal-exit":"animate-tt-modal"}`,children:[e.jsx("button",{type:"button",onClick:se,className:"absolute top-4 right-4 z-50 p-2 rounded-full border border-oai-gray-200/60 dark:border-oai-gray-800/60 bg-white/50 dark:bg-oai-gray-900/50 text-oai-gray-500 dark:text-oai-gray-400 hover:text-oai-gray-900 dark:hover:text-white hover:rotate-90 hover:scale-105 active:scale-95 transition-all duration-300",children:e.jsx(qe,{size:16})}),e.jsxs("div",{className:"w-full md:w-[340px] border-b md:border-b-0 md:border-r border-zinc-200/50 dark:border-zinc-800/40 p-5 md:p-6 flex flex-col gap-6 overflow-y-auto backdrop-blur-md bg-zinc-50/50 dark:bg-zinc-950/50",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1.5 select-none",children:[e.jsxs("span",{className:"relative flex h-1.5 w-1.5",children:[e.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full opacity-75",style:{backgroundColor:I.rawColor}}),e.jsx("span",{className:"relative inline-flex rounded-full h-1.5 w-1.5",style:{backgroundColor:I.rawColor}})]}),e.jsx("span",{className:"text-[9px] font-extrabold uppercase tracking-widest font-mono text-zinc-400 dark:text-zinc-500",children:o("heatmap.3d.modal.eyebrow")})]}),e.jsx("h4",{className:"text-xl font-black text-zinc-900 dark:text-zinc-50 tracking-tight leading-none mt-2 select-none",children:o("heatmap.3d.modal.title")}),e.jsx("p",{className:"text-[11px] leading-relaxed text-zinc-400 dark:text-zinc-500 mt-2 font-normal select-none",children:o("heatmap.3d.modal.desc")})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-x-5 gap-y-5 border-y border-zinc-200/50 dark:border-zinc-800/50 py-5 select-none",children:[e.jsxs("div",{className:"flex flex-col gap-1 relative group cursor-help",children:[e.jsx("div",{className:"absolute left-0 bottom-full mb-2 pointer-events-none opacity-0 translate-y-1 group-hover:opacity-100 group-hover:translate-y-0 transition-all duration-200 z-50",children:e.jsxs("div",{className:"bg-white dark:bg-zinc-950 text-zinc-900 dark:text-zinc-50 text-[10px] font-semibold font-mono rounded-lg px-2.5 py-1.5 shadow-xl border border-zinc-200 dark:border-zinc-800/80 whitespace-nowrap flex flex-col",children:[e.jsx("span",{className:"text-[9px] text-zinc-400 dark:text-zinc-500",children:o("heatmap.3d.modal.stats.precision_total_tokens")}),e.jsxs("span",{className:"mt-0.5 font-bold text-zinc-900 dark:text-zinc-50",children:[R(T.totalTokens)," ",o("heatmap.unit.tokens")]})]})}),e.jsx("span",{className:"text-[9px] font-bold text-zinc-400 dark:text-zinc-500 uppercase tracking-widest font-mono",children:o("heatmap.3d.modal.stats.total_tokens")}),e.jsxs("div",{className:"flex items-baseline gap-1.5",children:[e.jsx("span",{className:"text-xl font-black text-zinc-900 dark:text-zinc-50 tracking-tight font-mono transition-transform duration-200 group-hover:-translate-y-[1px]",children:pe(T.totalTokens)}),e.jsx("div",{className:"opacity-30 group-hover:opacity-60 transition-opacity",children:e.jsx("svg",{width:"24",height:"10",viewBox:"0 0 24 10",fill:"none",children:e.jsx("path",{d:"M1 9C3 7 5 7 7 4C9 1 11 0 13 2C15 4 17 0 23 0",stroke:I.rawColor,strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})})})]})]}),e.jsxs("div",{className:"flex flex-col gap-1 group cursor-default",children:[e.jsx("span",{className:"text-[9px] font-bold text-zinc-400 dark:text-zinc-500 uppercase tracking-widest font-mono",children:o("heatmap.3d.modal.stats.estimated_cost")}),e.jsx("span",{className:"text-xl font-black text-zinc-900 dark:text-zinc-50 tracking-tight font-mono transition-transform duration-200 group-hover:-translate-y-[1px]",children:Ce})]}),e.jsxs("div",{className:"flex flex-col gap-1 group cursor-default",children:[e.jsx("span",{className:"text-[9px] font-bold text-zinc-400 dark:text-zinc-500 uppercase tracking-widest font-mono",children:o("heatmap.3d.modal.stats.active_rate_days")}),e.jsxs("span",{className:"text-xl font-black text-zinc-900 dark:text-zinc-50 tracking-tight font-mono transition-transform duration-200 group-hover:-translate-y-[1px]",children:[T.activeRate,"%"," ",e.jsxs("span",{className:"text-[10px] font-bold text-zinc-400 dark:text-zinc-500 font-mono",children:["(",T.activeDays,o("heatmap.3d.modal.stats.days_suffix"),")"]})]})]}),e.jsxs("div",{className:"flex flex-col gap-1 group cursor-default",children:[e.jsx("span",{className:"text-[9px] font-bold text-zinc-400 dark:text-zinc-500 uppercase tracking-widest font-mono",children:o("heatmap.3d.modal.stats.max_streak")}),e.jsxs("span",{className:"text-xl font-black text-amber-500 tracking-tight font-mono transition-transform duration-200 group-hover:-translate-y-[1px]",children:[T.maxStreak," ",e.jsx("span",{className:"text-[10px] font-bold text-amber-500/80 font-mono",children:o("heatmap.3d.modal.stats.days_suffix")})]})]}),e.jsxs("div",{className:"flex flex-col gap-1 col-span-2 relative group cursor-help",children:[e.jsx("div",{className:"absolute left-0 bottom-full mb-2 pointer-events-none opacity-0 translate-y-1 group-hover:opacity-100 group-hover:translate-y-0 transition-all duration-200 z-50",children:e.jsxs("div",{className:"bg-white dark:bg-zinc-950 text-zinc-900 dark:text-zinc-50 text-[10px] font-semibold font-mono rounded-lg px-2.5 py-1.5 shadow-xl border border-zinc-200 dark:border-zinc-800/80 whitespace-nowrap flex flex-col",children:[e.jsx("span",{className:"text-[9px] text-zinc-400 dark:text-zinc-500",children:o("heatmap.3d.modal.stats.precision_peak_value")}),e.jsx("span",{className:"mt-0.5 font-bold text-zinc-900 dark:text-zinc-50",children:T.maxSingleDay.value>0?`${R(T.maxSingleDay.value)} ${o("heatmap.unit.tokens")}`:o("heatmap.3d.modal.stats.no_data")}),e.jsx("span",{className:"text-[8px] text-zinc-400 dark:text-zinc-500 mt-0.5",children:T.maxSingleDay.day||o("heatmap.3d.modal.stats.no_data")})]})}),e.jsx("span",{className:"text-[9px] font-bold text-zinc-400 dark:text-zinc-500 uppercase tracking-widest font-mono",children:o("heatmap.3d.modal.stats.peak_day")}),e.jsxs("span",{className:"text-xl font-black text-zinc-900 dark:text-zinc-50 tracking-tight font-mono transition-transform duration-200 group-hover:-translate-y-[1px]",children:[T.maxSingleDay.value>0?pe(T.maxSingleDay.value):o("heatmap.3d.modal.stats.no_data")," ",e.jsxs("span",{className:"text-[10px] font-bold text-zinc-400 dark:text-zinc-500 font-mono",children:["(",T.maxSingleDay.day||o("heatmap.3d.modal.stats.no_data"),")"]})]})]})]}),e.jsxs("div",{className:"flex flex-col gap-2.5 py-1",children:[e.jsxs("div",{className:"flex items-center gap-1.5 select-none",children:[e.jsx(Qe,{size:11,style:{color:I.rawColor}}),e.jsx("span",{className:"text-[9px] font-extrabold uppercase tracking-widest font-mono",style:{color:I.rawColor},children:o(T.aiEvaluationTitleKey)})]}),e.jsxs("div",{className:"pl-3.5 border-l-2 relative transition-all duration-300 group",style:{borderColor:I.rawColor},children:[e.jsx("div",{className:"absolute inset-y-0 left-0 w-[3px] blur-[2px] opacity-15 pointer-events-none rounded-full",style:{backgroundColor:I.rawColor}}),e.jsx("p",{className:"text-[11px] leading-relaxed text-zinc-600 dark:text-zinc-400 font-normal",children:o(T.aiEvaluationKey)})]})]}),e.jsx("div",{className:"mt-auto border-t border-zinc-200/50 dark:border-zinc-800/50 pt-4 select-none",children:e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-[9px] font-bold text-zinc-400 dark:text-zinc-500 uppercase tracking-widest font-mono",children:o("heatmap.3d.modal.legend.title")}),e.jsx("span",{className:"text-[10px] font-medium text-zinc-500 dark:text-zinc-400",children:o(`heatmap.3d.modal.palette.${U}`)})]}),e.jsx("div",{className:"flex gap-1",children:ve.map((a,u)=>e.jsx("div",{className:"flex-1 h-1 rounded-[2px]",style:{backgroundColor:a},title:o("heatmap.tooltip.level",{level:u})},u))})]})})]}),e.jsxs("div",{className:"flex-1 h-full relative flex items-center justify-center overflow-hidden p-4",children:[e.jsx("div",{className:"absolute top-1/4 left-1/3 w-96 h-96 rounded-full blur-[130px] pointer-events-none -translate-x-1/2 -translate-y-1/2 transition-all duration-500",style:{backgroundColor:I.rawColor+"15"}}),e.jsx("div",{className:"absolute bottom-1/4 right-1/3 w-80 h-80 rounded-full blur-[120px] pointer-events-none translate-x-1/2 translate-y-1/2 bg-purple-500/[0.04] dark:bg-purple-500/[0.08]"}),e.jsxs("div",{className:"absolute top-4 left-1/2 -translate-x-1/2 flex items-center gap-3 p-1.5 backdrop-blur-md bg-white/70 dark:bg-oai-gray-900/75 border border-oai-gray-200/60 dark:border-oai-gray-800/80 rounded-full shadow-lg z-30 select-none",children:[e.jsx("div",{className:"flex items-center gap-1.5 px-2",children:Object.keys(ce).map(a=>{const u=U===a;return e.jsx("button",{type:"button",onClick:()=>oe(a),title:o(`heatmap.3d.modal.palette.${a}`),className:`w-3.5 h-3.5 rounded-full transition-all duration-200 relative hover:scale-125 ${a==="emerald"?"bg-[#10b981]":a==="ocean"?"bg-[#3b82f6]":a==="neon"?"bg-[#a855f7]":"bg-[#f59e0b]"}`,children:u&&e.jsx("span",{className:"absolute inset-0 rounded-full ring-2 ring-offset-1 ring-offset-white dark:ring-offset-oai-gray-900 ring-oai-gray-900 dark:ring-white scale-110"})},a)})}),e.jsx("div",{className:"w-[1px] h-4 bg-oai-gray-200 dark:bg-oai-gray-800"}),e.jsxs("div",{className:"flex items-center gap-1 pr-1",children:[e.jsx("button",{type:"button",onClick:()=>{const a=!B;ie(a),J.current&&J.current.toggleAutoRotate(a)},title:B?o("heatmap.3d.modal.control.pause"):o("heatmap.3d.modal.control.play"),className:`p-1.5 rounded-full transition-all duration-200 hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 ${B?I.accentText:"text-oai-gray-400 hover:text-oai-gray-600 dark:hover:text-oai-gray-250"}`,children:B?e.jsx(at,{size:12}):e.jsx(ot,{size:12})}),e.jsx("button",{type:"button",onClick:()=>{ie(!1),J.current&&J.current.reset()},title:o("heatmap.3d.modal.control.reset"),className:"p-1.5 rounded-full text-oai-gray-400 hover:text-oai-gray-600 dark:hover:text-oai-gray-250 hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 transition-all duration-200",children:e.jsx(st,{size:12})})]})]}),e.jsx(Ae,{weeks:y,isDark:S,interactive:!0,palette:U,autoRotateInit:B,onResetViewRef:J}),e.jsxs("div",{className:"absolute bottom-4 right-4 flex items-center gap-1.5 text-[9px] font-bold text-oai-gray-400 bg-white/80 dark:bg-oai-gray-900/80 border border-oai-gray-200/50 dark:border-oai-gray-800/80 rounded-md px-2.5 py-1.5 select-none pointer-events-none backdrop-blur-md shadow-sm",children:[e.jsx(et,{size:10,className:I.accentText}),e.jsx("span",{children:o("heatmap.3d.modal.footer.tip")})]})]})]})}),v&&!j&&typeof document<"u"&&Ke.createPortal(e.jsxs("div",{className:"fixed z-[9999] w-0 h-0 transition-all duration-100 ease-out pointer-events-none",style:{position:"fixed",left:`${V.x}px`,top:`${V.y}px`},children:[e.jsxs("div",{className:`absolute left-0 ${V.flipY?"top-[10px]":"bottom-[10px]"} backdrop-blur-md bg-white/95 dark:bg-oai-gray-900/95 border border-oai-gray-200/50 dark:border-oai-gray-800/50 shadow-xl rounded-xl p-3.5 max-w-[280px] min-w-[200px] flex flex-col gap-2 animate-in fade-in zoom-in-95 duration-100`,style:{transform:`translateX(calc(-50% + ${V.shiftX}px))`},children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-oai-gray-100 dark:border-oai-gray-800/80 pb-1.5",children:[e.jsx("span",{className:"text-[11px] font-semibold text-oai-gray-500 dark:text-oai-gray-400",children:v.day}),(()=>{const a=v.level===0?S?"#9ca3af":"#6b7280":E[v.level];return e.jsx("span",{className:"text-[10px] px-2 py-0.5 rounded-full font-medium",style:{backgroundColor:a+"22",color:a,border:`1px solid ${a}44`},children:o("heatmap.tooltip.level",{level:v.level})})})()]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex items-baseline gap-1",children:[e.jsx("span",{title:R(v.total_tokens??v.value),className:"text-lg font-bold text-oai-gray-900 dark:text-white leading-none",children:A(v.total_tokens??v.value)}),e.jsx("span",{className:"text-[10px] text-oai-gray-400 uppercase tracking-wider font-semibold",children:o("heatmap.unit.tokens")})]}),v.models&&Object.keys(v.models).length>0?e.jsxs("div",{className:"mt-1.5 border-t border-oai-gray-100 dark:border-oai-gray-800/60 pt-2 flex flex-col gap-1.5",children:[e.jsx("div",{className:"text-[10px] font-semibold text-oai-gray-400 dark:text-oai-gray-500 uppercase tracking-wider",children:o("heatmap.tooltip.model_breakdown")}),e.jsx("div",{className:"flex flex-col gap-2 max-h-[150px] overflow-y-auto pr-1.5 oai-scrollbar",children:Object.entries(v.models).map(([a,u])=>({name:a,val:Number(u)})).sort((a,u)=>u.val-a.val).map(({name:a,val:u})=>{const z=Number(v.total_tokens??v.value)||1,N=Math.round(u/z*100);return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center justify-between text-[11px] gap-3",children:[e.jsx("span",{className:"font-medium text-oai-gray-750 dark:text-oai-gray-200 truncate max-w-[120px]",title:a,children:a}),e.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[e.jsx("span",{title:R(u),className:"font-mono text-oai-gray-900 dark:text-oai-gray-100 font-semibold",children:A(u)}),e.jsxs("span",{className:"text-[9px] text-oai-gray-450 dark:text-oai-gray-500 min-w-[28px] text-right font-medium",children:[N,"%"]})]})]}),e.jsx("div",{className:"w-full h-1 bg-oai-gray-100 dark:bg-oai-gray-800/85 rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full rounded-full transition-all duration-300",style:{width:`${N}%`,backgroundColor:E[4],boxShadow:`0 0 4px ${E[4]}55`}})})]},a)})})]}):e.jsx("p",{className:"text-[11px] text-oai-gray-600 dark:text-oai-gray-300 leading-relaxed font-normal mt-1 border-t border-dashed border-oai-gray-100 dark:border-oai-gray-800/60 pt-1.5",children:Re(v.level,v.total_tokens??v.value,A)})]})]}),e.jsx("div",{className:`absolute left-0 -translate-x-1/2 w-2.5 h-2.5 rotate-45 bg-white dark:bg-oai-gray-900 shadow-sm ${V.flipY?"top-[6px] border-l border-t":"bottom-[6px] border-r border-b"} border-oai-gray-200/50 dark:border-oai-gray-800/50`,style:V.flipY?{marginTop:"1px"}:{marginBottom:"1px"}})]}),document.body),e.jsx("style",{children:`
|
|
2
|
-
@keyframes tt-fade-in {
|
|
3
|
-
from { opacity: 0; }
|
|
4
|
-
to { opacity: 1; }
|
|
5
|
-
}
|
|
6
|
-
@keyframes tt-fade-out {
|
|
7
|
-
from { opacity: 1; }
|
|
8
|
-
to { opacity: 0; }
|
|
9
|
-
}
|
|
10
|
-
@keyframes tt-modal-entrance {
|
|
11
|
-
from {
|
|
12
|
-
opacity: 0;
|
|
13
|
-
transform: scale(0.96) translateY(10px);
|
|
14
|
-
}
|
|
15
|
-
to {
|
|
16
|
-
opacity: 1;
|
|
17
|
-
transform: scale(1) translateY(0);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
@keyframes tt-modal-exit {
|
|
21
|
-
from {
|
|
22
|
-
opacity: 1;
|
|
23
|
-
transform: scale(1) translateY(0);
|
|
24
|
-
}
|
|
25
|
-
to {
|
|
26
|
-
opacity: 0;
|
|
27
|
-
transform: scale(0.96) translateY(10px);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
.animate-tt-fade-in {
|
|
31
|
-
animation: tt-fade-in 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
|
|
32
|
-
}
|
|
33
|
-
.animate-tt-fade-out {
|
|
34
|
-
animation: tt-fade-out 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
|
|
35
|
-
}
|
|
36
|
-
.animate-tt-modal {
|
|
37
|
-
animation: tt-modal-entrance 0.3s cubic-bezier(0.34, 1.3, 0.64, 1) forwards;
|
|
38
|
-
}
|
|
39
|
-
.animate-tt-modal-exit {
|
|
40
|
-
animation: tt-modal-exit 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
|
|
41
|
-
}
|
|
42
|
-
`})]})}const yt={anythingllm:"AnythingLLM",claudescience:"Claude Science",pianthropic:"Pi · Anthropic",pigithubcopilot:"Pi · GitHub Copilot",picopilot:"Pi · Copilot",dots:"Dots",pidots:"Pi · Dots",lmstudio:"LM Studio",unsloth:"Unsloth Studio"},bt={deepseek:"provider.display.deepseek_harness",dsh:"provider.display.deepseek_harness",omp:"provider.display.omp",traecn:"provider.display.trae_work_cn",traeworkcn:"provider.display.trae_work_cn"};function vt(s){return String(s||"").trim().toLowerCase().replace(/[\s_-]+/g,"")}const kt={ai:"AI",api:"API",cli:"CLI",github:"GitHub",openai:"OpenAI",opencode:"OpenCode",xai:"xAI"};function Ee(s){return s.split(/[-_ ]+/).filter(Boolean).map(d=>kt[d.toLowerCase()]??d.charAt(0).toUpperCase()+d.slice(1).toLowerCase()).join(" ")}function Tt(s){const d=String(s||"").trim();if(!d)return"";const p=vt(d);if(p==="primeagent")return"Prime Agent";if(p.startsWith("primeagent")&&p.length>10){const $=Ee(d.replace(/^prime[-_ ]?agent[-_ ]?/i,""));return $?`Prime Agent · ${$}`:"Prime Agent"}const c=bt[p];if(c)return o(c);const f=yt[p];if(f)return f;if(/^pi[-_ ]/i.test(d)){const $=Ee(d.slice(3));if($)return`Pi · ${$}`}return d.charAt(0).toUpperCase()+d.slice(1)}export{Mt as A,Tt as f};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Z as t}from"./__vite-browser-external-BGnq8Ebm.js";import{F as p,P as g}from"./composite-Dxmivlk4.js";function d(){return new p({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new g,floatingId:void 0,syncOnly:!1,nested:!1,onOpenChange:void 0})}function c(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:d(),floatingId:void 0,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:t,inactiveTriggerProps:t,popupProps:t}}function m(e,n,l=!1){return new p({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:n,syncOnly:!0,nested:l,onOpenChange:void 0})}const o=e=>e.triggerIdProp??e.activeTriggerId,r=e=>e.openProp??e.open,i=e=>(e.popupElement?.id??e.floatingId)||void 0;function u(e,n){return n!==void 0&&r(e)&&o(e)===n}function a(e,n){return u(e,n)?!0:n!==void 0&&r(e)&&o(e)==null&&e.triggerCount===1}const P={open:r,mounted:e=>e.mounted,transitionStatus:e=>e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:o,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:i,isTriggerActive:(e,n)=>n!==void 0&&o(e)===n,isOpenedByTrigger:(e,n)=>u(e,n),isMountedByTrigger:(e,n)=>n!==void 0&&o(e)===n&&e.mounted,triggerProps:(e,n)=>n?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,n)=>a(e,n)?i(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};export{m as a,c,P as p};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as a,q as M,t as B,v as q,w as G}from"./__vite-browser-external-BGnq8Ebm.js";import{L as F}from"./limits-providers-BUoquSA-.js";const l=F,g="tt.limits.providerOrder",A="tt.limits.providerVisibility",E="tt.limits.displayMode",I="tt.limits.showSubscriptions",m="tt.limits.updatedAt",V="limitsPreferences",H="limitsDisplayMode",S=Object.freeze({USED:"used",REMAINING:"remaining"}),O=new Set(Object.values(S)),_=new Set([g,A,E,I,m]);function v(){return[...l]}function h(){return Object.fromEntries(l.map(e=>[e,!0]))}function N(e){const t=[];if(Array.isArray(e))for(const o of e)l.includes(o)&&!t.includes(o)&&t.push(o);for(const o of l)t.includes(o)||t.push(o);return t}function k(e){const t=h();if(!e||typeof e!="object"||Array.isArray(e))return t;for(const o of l)typeof e[o]=="boolean"&&(t[o]=e[o]);return t}function W(e){return O.has(e)?e:S.USED}function P(e){return typeof e=="boolean"?e:!0}function w(e){if(e!=null){if(typeof e=="number")return Number.isSafeInteger(e)?e:void 0;if(typeof e=="string"){const t=e.trim();if(t==="")return;const o=Number(t);return Number.isSafeInteger(o)?o:void 0}}}function y(e={}){const t=e&&typeof e=="object"?e:{};return{displayMode:W(t.displayMode),providerOrder:N(t.providerOrder),providerVisibility:k(t.providerVisibility),showSubscriptions:P(t.showSubscriptions),updatedAt:w(t.updatedAt)}}function Q(){if(typeof window>"u")return v();try{const e=window.localStorage.getItem(g);return N(e?JSON.parse(e):void 0)}catch{return v()}}function X(){if(typeof window>"u")return h();try{const e=window.localStorage.getItem(A);return k(e?JSON.parse(e):void 0)}catch{return h()}}function Z(){if(typeof window>"u")return S.USED;try{const e=window.localStorage.getItem(E);return O.has(e)?e:S.USED}catch{return S.USED}}function $(){if(typeof window>"u")return!0;try{const e=window.localStorage.getItem(I);return e===null?!0:P(JSON.parse(e))}catch{return!0}}function ee(){if(!(typeof window>"u"))try{return w(window.localStorage.getItem(m))}catch{return}}function te(){if(typeof window>"u")return!1;try{for(const e of _)if(window.localStorage.getItem(e)!==null)return!0}catch{return!1}return!1}function b(){return y({displayMode:Z(),providerOrder:Q(),providerVisibility:X(),showSubscriptions:$(),updatedAt:ee()})}function re(e){if(typeof window>"u")return;const t=y(e);try{window.localStorage.setItem(g,JSON.stringify(t.providerOrder)),window.localStorage.setItem(A,JSON.stringify(t.providerVisibility)),window.localStorage.setItem(E,t.displayMode),window.localStorage.setItem(I,JSON.stringify(t.showSubscriptions)),t.updatedAt===void 0?window.localStorage.removeItem(m):window.localStorage.setItem(m,String(t.updatedAt))}catch(o){console.warn("[tokentracker] limits preferences localStorage write failed:",o)}}function ie(e){const t=y(e);return{displayMode:t.displayMode,providerOrder:[...t.providerOrder],providerVisibility:{...t.providerVisibility},showSubscriptions:t.showSubscriptions,updatedAt:t.updatedAt??null}}function ne(...e){let t;for(const d of e){const c=w(d);c!==void 0&&(t=t===void 0?c:Math.max(t,c))}const o=Date.now();return t!==void 0&&o<=t?t+1:o}function oe(e,t){return e.length===t.length&&e.every((o,d)=>o===t[d])}function se(e,t){return l.every(o=>e[o]===t[o])}function U(e,t){return e.displayMode===t.displayMode&&oe(e.providerOrder,t.providerOrder)&&se(e.providerVisibility,t.providerVisibility)&&e.showSubscriptions===t.showSubscriptions}function de(e,t){return U(e,t)&&w(e.updatedAt)===w(t.updatedAt)}function L(e,t){const o=w(e.updatedAt),d=w(t.updatedAt);return o!==void 0&&(d===void 0||o>d)}function ce(){const[e,t]=a.useState(b),o=a.useRef(e),d=a.useCallback((i,r={})=>{const n=y(i);return o.current=n,t(n),r.writeLocal&&re(n),n},[]),c=a.useCallback(i=>{M()&&B(V,ie(i))},[]),u=a.useCallback(i=>{const r=b(),n=L(r,o.current)?d(r):o.current,s=y(i(n));if(U(n,s))return;const f=ne(r.updatedAt,n.updatedAt),p=d({...s,updatedAt:f},{writeLocal:!0});c(p)},[d,c]),C=a.useCallback(i=>{O.has(i)&&u(r=>({...r,displayMode:i}))},[u]),x=a.useCallback(i=>{u(r=>({...r,showSubscriptions:!!i}))},[u]),D=a.useCallback(i=>{if(!O.has(i))return;const r=b();if(r.updatedAt!==void 0){d(r);return}d({...r,displayMode:i,updatedAt:void 0},{writeLocal:!0})},[d]);a.useEffect(()=>{if(!M())return;const i=q(r=>{const n=r?.[V];if(n&&typeof n=="object"){const s=y(n);if(!te()){d(s,{writeLocal:!0});return}const f=b();if(L(s,f))d(s,{writeLocal:!0});else{const p=d(f);de(s,f)||c(p)}return}D(r?.[H])});return G(),i},[D,d,c]),a.useEffect(()=>{if(typeof window>"u")return;const i=r=>{(r.key===null||_.has(r.key))&&d(b())};return window.addEventListener("storage",i),()=>window.removeEventListener("storage",i)},[d]);const R=a.useCallback(i=>{l.includes(i)&&u(r=>({...r,providerVisibility:{...r.providerVisibility,[i]:!r.providerVisibility[i]}}))},[u]),Y=a.useCallback(i=>{u(r=>{const n=r.providerOrder.indexOf(i);if(n<=0)return r;const s=[...r.providerOrder];return[s[n-1],s[n]]=[s[n],s[n-1]],{...r,providerOrder:s}})},[u]),T=a.useCallback(i=>{u(r=>{const n=r.providerOrder.indexOf(i);if(n<0||n>=r.providerOrder.length-1)return r;const s=[...r.providerOrder];return[s[n],s[n+1]]=[s[n+1],s[n]],{...r,providerOrder:s}})},[u]),z=a.useCallback((i,r)=>{i!==r&&u(n=>{const s=n.providerOrder.indexOf(i),f=n.providerOrder.indexOf(r);if(s<0||f<0)return n;const p=[...n.providerOrder],[J]=p.splice(s,1);return p.splice(f,0,J),{...n,providerOrder:p}})},[u]),K=a.useCallback(()=>{u(()=>({displayMode:S.USED,providerOrder:v(),providerVisibility:h(),showSubscriptions:!0}))},[u]),j=a.useMemo(()=>e.providerOrder.filter(i=>e.providerVisibility[i]!==!1),[e.providerOrder,e.providerVisibility]);return{order:e.providerOrder,visibility:e.providerVisibility,displayMode:e.displayMode,showSubscriptions:e.showSubscriptions,setDisplayMode:C,setShowSubscriptions:x,visibleOrdered:j,toggle:R,moveUp:Y,moveDown:T,moveToward:z,reset:K}}export{S as L,ce as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as o}from"./__vite-browser-external-BGnq8Ebm.js";import{h as r,i as t,p as s}from"./react-yHv9MTUA.js";function i(){!r.current&&t();const[e]=o.useState(s.current);return e}export{i as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{q as b,ac as v,r as y,c as g,ad as x,ae as M,af as f}from"./__vite-browser-external-BGnq8Ebm.js";import{l as L}from"./limits-providers-BUoquSA-.js";import{u as I}from"./use-latest-request-guard-hwSr9Cam.js";const S="native:notificationPermission";let E=null;function N(){return typeof window<"u"&&!!window.chrome?.webview}function K(){return b()?E||"unknown":N()?"granted":typeof Notification>"u"?"unsupported":Notification.permission}function O(e){if(typeof window>"u")return()=>{};const i=n=>{const a=n?.detail?.status;typeof a=="string"&&(E=a),e(K())};return window.addEventListener(S,i),e(K()),b()&&v({type:"getNotificationStatus"}),()=>window.removeEventListener(S,i)}async function q(){if(b()){v({type:"requestNotificationPermission"});return}N()||typeof Notification<"u"&&Notification.permission==="default"&&await Notification.requestPermission().catch(()=>"denied")}const p="tt.limitAlerts.enabled";function A(){try{return window.localStorage.getItem(p)==="1"}catch{return!1}}function H(){const[e,i]=y.useState(A),[n,a]=y.useState("unknown");y.useEffect(()=>O(a),[]);const _=y.useCallback(async t=>{const r=!!t;r&&await q();try{window.localStorage.setItem(p,r?"1":"0")}catch{}i(r)},[]);return{enabled:e,setEnabled:_,permissionBlocked:n==="denied"}}function C(e,i){if(!(e>0))return null;const n=(e-i)/e;return Number.isFinite(n)?Math.min(Math.max(n,0),1):null}function z(e,i,n=.03){return e>i+n}function D(e){const i=Math.max(0,Math.floor(e)),n=Math.floor(i/3600);return n>24?`${Math.floor(n/24)}d`:n>0?`${n}h`:`${Math.floor(i/60)}m`}function R(e,i){if(typeof e.windowSeconds=="number")return e.windowSeconds;if(e.windowSecondsField&&i){const n=i[e.windowSecondsField];return typeof n=="number"&&n>0?n:null}return null}function j(e){return e==null?NaN:typeof e=="number"?e*1e3:Date.parse(e)}function T({usedPercent:e,windowSeconds:i,resetMs:n,mode:a,now:_=Date.now()}){const t=Math.min(Math.max(Number(e)||0,0),100)/100,r={pacePercent:null,paceOver:!1,expectedPercent:null,runsOutEta:null,projectedEnd:null};if(!(i>0)||!Number.isFinite(n))return r;const o=Math.max(0,(n-_)/1e3),s=C(i,o);if(s==null)return r;if(r.expectedPercent=Math.round(s*100),r.paceOver=z(t,s),t>=.05){const m=a==="remaining"?1-s:s;r.pacePercent=m*100}if(s>.02&&t>0){const m=i*s,w=t/m,c=t/s;c>=1&&w>0?r.runsOutEta=D((1-t)/w):r.projectedEnd=Math.round(Math.min(c,1)*100)}return r}const $={claude:{windows(e){const i=Array.isArray(e.weekly_scoped)?e.weekly_scoped.map(n=>({key:`scoped-${n.label}`,label:n.label,window:n,pctField:"utilization",resetField:"resets_at",windowSeconds:604800})):[];return[{key:"5h",labelKey:"limits.label.claude_5h",window:e.five_hour,pctField:"utilization",resetField:"resets_at",windowSeconds:5*3600},{key:"7d",labelKey:"limits.label.claude_7d",window:e.seven_day,pctField:"utilization",resetField:"resets_at",windowSeconds:7*86400},{key:"opus",labelKey:"limits.label.claude_opus",window:e.seven_day_opus,pctField:"utilization",resetField:"resets_at",windowSeconds:7*86400},...i]}},codex:{extra:"codex_meta",windows(e){return[{key:"5h",labelKey:"limits.label.codex_5h",window:e.primary_window,windowSecondsField:"limit_window_seconds"},{key:"7d",labelKey:"limits.label.codex_7d",window:e.secondary_window,windowSecondsField:"limit_window_seconds"},{key:"credits",labelKey:"limits.label.codex_credits",window:e.credit_window},{key:"spark-5h",labelKey:"limits.label.codex_spark_5h",window:e.spark_primary_window,windowSecondsField:"limit_window_seconds"},{key:"spark-7d",labelKey:"limits.label.codex_spark_7d",window:e.spark_secondary_window,windowSecondsField:"limit_window_seconds"}]}},cursor:{windows(e){return[{key:"plan",labelKey:"limits.label.cursor_plan",window:e.primary_window,windowSecondsField:"limit_window_seconds"},{key:"auto",labelKey:"limits.label.cursor_auto",window:e.secondary_window,windowSecondsField:"limit_window_seconds"},{key:"api",labelKey:"limits.label.cursor_api",window:e.tertiary_window,windowSecondsField:"limit_window_seconds"},{key:"grok-bot",labelKey:"limits.label.cursor_grok_bot",window:e.quaternary_window,windowSecondsField:"limit_window_seconds"}]}},gemini:{windows(e){return[{key:"pro",labelKey:"limits.label.gemini_pro",window:e.primary_window},{key:"flash",labelKey:"limits.label.gemini_flash",window:e.secondary_window},{key:"lite",labelKey:"limits.label.gemini_lite",window:e.tertiary_window}]}},kimi:{extra:"kimi_parallel",windows(e){return[{key:"weekly",labelKey:"limits.label.kimi_weekly",window:e.primary_window,windowSeconds:7*86400},{key:"5h",labelKey:"limits.label.kimi_5h",window:e.secondary_window,windowSeconds:5*3600},{key:"total",labelKey:"limits.label.kimi_total",window:e.tertiary_window}]}},kiro:{extra:"kiro_credits",windows(e){return[{key:"month",labelKey:"limits.label.kiro_month",window:e.primary_window},{key:"bonus",labelKey:"limits.label.kiro_bonus",window:e.secondary_window}]}},grok:{windows(e){const i=typeof e.period_type=="string"?e.period_type:null,n=i==="weekly"?"limits.label.grok_week":i==="daily"?"limits.label.grok_day":"limits.label.grok_month",a=i==="weekly"?7*86400:i==="daily"?86400:void 0;return[{key:i==="weekly"?"week":i==="daily"?"day":"month",labelKey:n,window:e.primary_window,windowSeconds:a},{key:"ondemand",labelKey:"limits.label.grok_ondemand",window:e.secondary_window}]}},antigravity:{windows(e){return[{key:"claude-weekly",labelKey:"limits.label.antigravity_claude_weekly",window:e.primary_window},{key:"claude-5h",labelKey:"limits.label.antigravity_claude_5h",window:e.secondary_window},{key:"gemini-weekly",labelKey:"limits.label.antigravity_gemini_weekly",window:e.tertiary_window},{key:"gemini-5h",labelKey:"limits.label.antigravity_gemini_5h",window:e.quaternary_window}]}},copilot:{extra:"copilot_otel",windows(e){return[{key:"premium",labelKey:"limits.label.copilot_premium",window:e.primary_window},{key:"chat",labelKey:"limits.label.copilot_chat",window:e.secondary_window}]}},zcode:{windows(e){return e.plan_kind==="coding-plan"?[{key:"5h",labelKey:"limits.label.zcode_5h",window:e.primary_window},{key:"weekly",labelKey:"limits.label.zcode_weekly",window:e.secondary_window},{key:"tools",labelKey:"limits.label.zcode_tools",window:e.tertiary_window}]:[{key:"glm52",labelKey:"limits.label.zcode_glm52",window:e.primary_window},{key:"glm5t",labelKey:"limits.label.zcode_glm5t",window:e.secondary_window}]}},opencodeGo:{windows(e){return[{key:"5h",labelKey:"limits.label.opencode_go_5h",window:e.primary_window},{key:"weekly",labelKey:"limits.label.opencode_go_weekly",window:e.secondary_window},{key:"monthly",labelKey:"limits.label.opencode_go_monthly",window:e.tertiary_window}]}},qoder:{windows(e){return[{key:"credits",labelKey:"limits.label.qoder_credits",window:e.primary_window},{key:"ultimate",labelKey:"limits.label.qoder_ultimate",window:e.secondary_window,timeKind:"expiry"}]}},qoderCn:{windows(e){return[{key:"credits",labelKey:"limits.label.qoder_cn_credits",window:e.primary_window},{key:"ultimate",labelKey:"limits.label.qoder_cn_ultimate",window:e.secondary_window,timeKind:"expiry"}]}},codingPlan:{windows(e){return[{key:"5h",labelKey:"limits.label.ark_coding_plan_5h",window:e.primary_window},{key:"weekly",labelKey:"limits.label.ark_coding_plan_weekly",window:e.secondary_window},{key:"monthly",labelKey:"limits.label.ark_coding_plan_monthly",window:e.tertiary_window}]}},agentPlan:{windows(e){return[{key:"5h",labelKey:"limits.label.ark_agent_plan_5h",window:e.primary_window},{key:"weekly",labelKey:"limits.label.ark_agent_plan_weekly",window:e.secondary_window},{key:"monthly",labelKey:"limits.label.ark_agent_plan_monthly",window:e.tertiary_window}]}}},P="tt.limitAlerts.cycles.v1";function B(){try{return JSON.parse(window.localStorage.getItem(P)||"{}")}catch{return{}}}function G(e){try{window.localStorage.setItem(P,JSON.stringify(e))}catch{}}function V(e,{now:i=Date.now()}={}){const n=[],a=$;for(const[_,t]of Object.entries(e||{})){const r=a[_];if(!(!t?.configured||t.error||!r))for(const o of r.windows(t)){if(!o.window)continue;const s=Number(o.pctField==="utilization"?o.window.utilization:o.window.used_percent),m=o.resetField==="resets_at"?o.window.resets_at:o.window.reset_at,w=j(m),c=T({usedPercent:s,windowSeconds:R(o,o.window),resetMs:w,mode:"used",now:i});!c.runsOutEta||!c.paceOver||s<20||!(w>i)||n.push({id:`${_}:${o.key}:${w}`,providerId:_,windowKey:o.key,resetMs:w,usedPercent:s,runsOutEta:c.runsOutEta})}}return n}function J(e){const i=B(),n=V(e);for(const t of n){if(i[t.id])continue;const r=L(t.providerId),o=g("limits.alert.title",{provider:r}),s=g("limits.alert.body",{eta:t.runsOutEta,percent:Math.round(t.usedPercent)});let m=x({title:o,body:s,id:t.id});!m&&typeof Notification<"u"&&Notification.permission==="granted"&&(new Notification(o,{body:s,tag:t.id}),m=!0),m&&(i[t.id]=Date.now())}const a=Date.now()-864e5,_=Object.fromEntries(Object.entries(i).filter(([t,r])=>{const o=Number(t.split(":").at(-1));return Number.isFinite(o)?o>=a:Number(r)>=a}).slice(-100));return G(_),n.length}function Q(e){const i=!!e?.initialState,[n,a]=y.useState(()=>i?e?.initialState?.data??null:null),[_,t]=y.useState(()=>i?e?.initialState?.error??null:null),[r,o]=y.useState(!i),s=!!e?.initialRefresh,m=!!e?.publishToPreloadCache,w=I([]);y.useEffect(()=>{if(!(!n||typeof window>"u"))try{window.localStorage.getItem(p)==="1"&&J(n)}catch{}},[n]);const c=y.useCallback((d,l)=>{!m||!d||typeof d!="object"||M(d,{source:l})},[m]),F=y.useCallback(async()=>{const d=w();try{const l=await f({refresh:!0});if(!d())return;const u=l&&typeof l=="object"?l:null;a(u),t(null),o(!1),c(u,"manual-refresh")}catch(l){if(!d())return;t(l?.message||String(l)),o(!1)}},[w,c]),k=y.useCallback(async()=>{const d=w();try{const l=await f();if(!d())return;const u=l&&typeof l=="object"?l:null;a(u),t(null),o(!1),c(u,"page-load")}catch(l){if(!d())return;t(l?.message||String(l)),o(!1)}},[w,c]);return y.useEffect(()=>{if(typeof window>"u"||typeof document>"u")return;const d=15e3;let l=Date.now();const u=()=>{if(document.visibilityState!=="visible")return;const h=Date.now();h-l<d||(l=h,k())};return window.addEventListener("focus",u),document.addEventListener("visibilitychange",u),()=>{window.removeEventListener("focus",u),document.removeEventListener("visibilitychange",u)}},[k]),y.useEffect(()=>{if(i&&!s)return;const d=w();(async()=>{try{const l=await f();if(!d())return;const u=l&&typeof l=="object"?l:null;a(u),t(null),c(u,"page-load")}catch(l){if(!d())return;t(l?.message||String(l))}finally{d()&&o(!1)}})()},[w,i,s,c]),{data:n,error:_,isLoading:r,refresh:F}}export{$ as P,R as a,H as b,T as c,j as r,J as s,Q as u};
|