tokentracker-cli 0.64.2 → 0.64.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/dashboard/dist/assets/ActivityHeatmap-BSA4KPkJ.js +42 -0
- package/dashboard/dist/assets/{Card-Cg-6DDbN.js → Card-BniOg7K8.js} +1 -1
- package/dashboard/dist/assets/ConfirmModal-CxThrcXK.js +1 -0
- package/dashboard/dist/assets/DashboardPage-DygQTlzO.js +19 -0
- package/dashboard/dist/assets/{DevicePage-C78nzmZm.js → DevicePage-BfRGbds7.js} +1 -1
- package/dashboard/dist/assets/DialogTitle-Cd0Nw0hW.js +1 -0
- package/dashboard/dist/assets/{FadeIn-RZKrtHup.js → FadeIn-DxDHmb9-.js} +1 -1
- package/dashboard/dist/assets/{HeaderGithubStar-B1gFlLrg.js → HeaderGithubStar-2aQXPupt.js} +1 -1
- package/dashboard/dist/assets/{IpCheckPage-RrZDmOFh.js → IpCheckPage-m_W_l5Xa.js} +1 -1
- package/dashboard/dist/assets/{LandingPage-CV9EvgTg.js → LandingPage-BkusMtg4.js} +1 -1
- package/dashboard/dist/assets/{LeaderboardAvatar-_tiTs_tT.js → LeaderboardAvatar-BmpmwHwD.js} +1 -1
- package/dashboard/dist/assets/LeaderboardPage-B6wWBsUW.js +2 -0
- package/dashboard/dist/assets/{LeaderboardProfileModal-BiQREZ6Z.js → LeaderboardProfileModal-CLlbxbZQ.js} +2 -2
- package/dashboard/dist/assets/{LeaderboardProfilePage-DU43hEuh.js → LeaderboardProfilePage-en0u_bG-.js} +2 -2
- package/dashboard/dist/assets/LimitsPage-CZXzDyPl.js +3 -0
- package/dashboard/dist/assets/{LocalOnlyNotice-Dvcf7F9s.js → LocalOnlyNotice-DNHw_KVs.js} +1 -1
- package/dashboard/dist/assets/{LoginPage-UlbsYFKJ.js → LoginPage-D38KpNMd.js} +1 -1
- package/dashboard/dist/assets/{PopoverPopup-BsBKLiJu.js → PopoverPopup-C4Ndfprc.js} +1 -1
- package/dashboard/dist/assets/{ResetPasswordPage-BuKemqhr.js → ResetPasswordPage-DYF1Iz64.js} +1 -1
- package/dashboard/dist/assets/{Select-9oplHX46.js → Select-6qFjabMe.js} +1 -1
- package/dashboard/dist/assets/{SelectItemText-CnL08w_W.js → SelectItemText-B234IuCW.js} +1 -1
- package/dashboard/dist/assets/SettingsPage-C-2m2LzE.js +1 -0
- package/dashboard/dist/assets/SkillsPage-37lQlleG.js +1 -0
- package/dashboard/dist/assets/WidgetsPage-D9ANC2dF.js +1 -0
- package/dashboard/dist/assets/{WrappedPage-DPAz_bit.js → WrappedPage-hjymf4DR.js} +1 -1
- package/dashboard/dist/assets/{agent-logos-uSGgZshc.js → agent-logos-B-NxiwlS.js} +1 -1
- package/dashboard/dist/assets/{arrow-up-right-9sot4sNP.js → arrow-up-right-B_iC7jeO.js} +1 -1
- package/dashboard/dist/assets/{download-3O0nnnqv.js → download-DSBqpgG5.js} +1 -1
- package/dashboard/dist/assets/index-BFIcLxb4.js +2 -0
- package/dashboard/dist/assets/main-CGx8BJ4O.css +1 -0
- package/dashboard/dist/assets/{main-C5qSiLnL.js → main-DEwjlMQP.js} +19 -8
- package/dashboard/dist/assets/{use-limits-display-prefs-Bh7PFn6x.js → use-limits-display-prefs-OhLCvWa8.js} +1 -1
- package/dashboard/dist/assets/{use-native-settings-MKCjJWeQ.js → use-native-settings-BOQcPSo9.js} +1 -1
- package/dashboard/dist/assets/use-ordered-list-DKOLCb2L.js +5 -0
- package/dashboard/dist/assets/{use-quality-per-dollar-pref-D-m9WqCz.js → use-quality-per-dollar-pref-EzQkuFZg.js} +1 -1
- package/dashboard/dist/assets/{use-usage-limits-CCu4bGI4.js → use-usage-limits-DD8zzK6Q.js} +1 -1
- package/dashboard/dist/assets/{useCurrency-BZmZ49MO.js → useCurrency-D1ldsRAh.js} +1 -1
- package/dashboard/dist/assets/{useScrollLock-BdBmNNmw.js → useScrollLock-eUzPJJ4w.js} +1 -1
- package/dashboard/dist/index.html +2 -2
- package/dashboard/dist/share.html +2 -2
- package/package.json +1 -1
- package/src/cli.js +7 -0
- package/src/commands/status.js +38 -0
- package/src/commands/sync.js +1 -0
- package/src/lib/pricing/curated-overrides.json +1 -0
- package/src/lib/pricing/seed-snapshot.json +1 -1
- package/src/lib/project-usage-purge.js +13 -2
- package/src/lib/rollout.js +364 -44
- package/src/lib/usage-limits.js +161 -1
- package/dashboard/dist/assets/ActivityHeatmap-CrW1u40M.js +0 -42
- package/dashboard/dist/assets/DashboardPage-Bl8jvnt-.js +0 -19
- package/dashboard/dist/assets/DialogTitle-COVyZQVB.js +0 -1
- package/dashboard/dist/assets/LeaderboardPage-2tltO9IR.js +0 -6
- package/dashboard/dist/assets/LimitsPage-C7xuyH5P.js +0 -3
- package/dashboard/dist/assets/SettingsPage-CeqgABWP.js +0 -1
- package/dashboard/dist/assets/SkillsPage-CW6aD8GD.js +0 -1
- package/dashboard/dist/assets/WidgetsPage-DtOkMdxK.js +0 -1
- package/dashboard/dist/assets/index-BeoRn2gJ.js +0 -2
- package/dashboard/dist/assets/info-CfCBZRtQ.js +0 -1
- package/dashboard/dist/assets/main-DWsITcdg.css +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e,G as o,c5 as I,a1 as P,r as u,b1 as B,R as D,V as W}from"./main-C5qSiLnL.js";import{S as E}from"./Select-9oplHX46.js";import{u as K,T as G}from"./use-native-settings-MKCjJWeQ.js";import{F as L,S as R,a as O}from"./FadeIn-RZKrtHup.js";import{A as $}from"./arrow-up-right-9sot4sNP.js";import{D as z}from"./download-3O0nnnqv.js";import"./SelectItemText-CnL08w_W.js";import"./useScrollLock-BdBmNNmw.js";import"./Card-Cg-6DDbN.js";const H=["todayTokens","todayCost"],_=[{id:"todayTokens",label:"Today Tokens",shortLabel:"Tokens",category:"tokens"},{id:"todayCost",label:"Today Cost",shortLabel:"Cost",category:"cost"},{id:"last7dTokens",label:"Last 7 Days",shortLabel:"7d",category:"tokens"},{id:"totalTokens",label:"Total Tokens",shortLabel:"Total",category:"tokens"},{id:"totalCost",label:"Total Cost",shortLabel:"All $",category:"cost"},{id:"claude5h",label:"Claude 5h Limit",shortLabel:"Cl 5h",category:"limits"},{id:"claude7d",label:"Claude 7d Limit",shortLabel:"Cl 7d",category:"limits"},{id:"codex5h",label:"Codex 5h Limit",shortLabel:"Cx 5h",category:"limits"},{id:"codex7d",label:"Codex 7d Limit",shortLabel:"Cx 7d",category:"limits"},{id:"codexSpark5h",label:"Codex Spark 5h Limit",shortLabel:"Cx Spark 5h",category:"limits"},{id:"codexSpark7d",label:"Codex Spark 7d Limit",shortLabel:"Cx Spark 7d",category:"limits"},{id:"cursorPlan",label:"Cursor Plan Limit",shortLabel:"Cu Plan",category:"limits"},{id:"cursorAuto",label:"Cursor Auto Limit",shortLabel:"Cu Auto",category:"limits"},{id:"cursorAPI",label:"Cursor API Limit",shortLabel:"Cu API",category:"limits"},{id:"geminiPro",label:"Gemini Pro Limit",shortLabel:"Gm Pro",category:"limits"},{id:"geminiFlash",label:"Gemini Flash Limit",shortLabel:"Gm Flash",category:"limits"},{id:"geminiLite",label:"Gemini Lite Limit",shortLabel:"Gm Lite",category:"limits"},{id:"kimiWeekly",label:"Kimi Weekly Limit",shortLabel:"Km Wk",category:"limits"},{id:"kimi5h",label:"Kimi 5h Limit",shortLabel:"Km 5h",category:"limits"},{id:"kimiTotal",label:"Kimi Total Limit",shortLabel:"Km Tot",category:"limits"},{id:"kiroMonth",label:"Kiro Monthly Limit",shortLabel:"Kr Mo",category:"limits"},{id:"kiroBonus",label:"Kiro Bonus Limit",shortLabel:"Kr Bn",category:"limits"},{id:"copilotPremium",label:"Copilot Premium Limit",shortLabel:"Co Prem",category:"limits"},{id:"copilotChat",label:"Copilot Chat Limit",shortLabel:"Co Chat",category:"limits"},{id:"antigravityClaudeWeekly",label:"Antigravity Claude 7d Limit",shortLabel:"Ag Cl 7d",category:"limits"},{id:"antigravityClaude5h",label:"Antigravity Claude 5h Limit",shortLabel:"Ag Cl 5h",category:"limits"},{id:"antigravityGeminiWeekly",label:"Antigravity Gemini 7d Limit",shortLabel:"Ag Gm 7d",category:"limits"},{id:"antigravityGemini5h",label:"Antigravity Gemini 5h Limit",shortLabel:"Ag Gm 5h",category:"limits"}];function C(t,a=_,r=2){const i=new Set(a.map(n=>n.id)),l=new Set,s=Array.isArray(t)?t.filter(n=>!i.has(n)||l.has(n)?!1:(l.add(n),!0)):[];return(s.length>0?s:H).slice(0,Math.max(1,Number(r)||2))}const U=264,V=124,h="ui-rounded, -apple-system, system-ui",N=["#5A8CF2","#9973E6","#4DB8A6","#E68C59"],X={claude:"#C77DFF",codex:"#34C759",cursor:"#FFCC00",gemini:"#0A84FF"};function Y(t){return t>=.9?"#E64D4D":t>=.7?"#D9A633":"#33B866"}function b({size:t="sm",children:a}){const r=t==="lg",i=r?560:264,l=r?32:22;return e.jsx("div",{className:W("flex w-full items-center justify-center rounded-xl bg-oai-gray-100 dark:bg-oai-gray-950/60",r?"py-10 sm:py-14 px-6":"py-6 px-4"),children:e.jsx("div",{className:"overflow-hidden bg-white dark:bg-oai-gray-800 shadow-oai-md dark:shadow-[0_2px_4px_rgba(0,0,0,0.4),0_8px_24px_rgba(0,0,0,0.5)]",style:{width:"100%",maxWidth:i,aspectRatio:`${U} / ${V}`,borderRadius:l},children:a})})}function Z({size:t="sm"}){const a="M0,104 L14,104 C26,98 34,100 44,96 S58,88 68,92 80,100 90,94 102,80 112,82 126,92 136,88 150,74 162,76 178,88 188,86 204,72 216,74 236,84 250,80 L264,80",r=`${a} L264,124 L0,124 Z`,i=`sparkArea-${t}`;return e.jsx(b,{size:t,children:e.jsxs("svg",{viewBox:"0 0 264 124",className:"h-full w-full","aria-hidden":"true",children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:i,x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:"#0A84FF",stopOpacity:"0.18"}),e.jsx("stop",{offset:"100%",stopColor:"#0A84FF",stopOpacity:"0"})]})}),e.jsx("text",{x:"14",y:"20",className:"fill-oai-gray-500 dark:fill-oai-gray-400",fontSize:"8",fontWeight:"700",letterSpacing:"0.6",children:"TODAY"}),e.jsx("text",{x:"14",y:"46",className:"fill-oai-black dark:fill-white",fontSize:"22",fontWeight:"700",fontFamily:h,children:"203.2M"}),e.jsx("text",{x:"14",y:"60",className:"fill-oai-gray-500 dark:fill-oai-gray-400",fontSize:"8",fontWeight:"500",fontFamily:h,children:"$129.56 ±0%"}),e.jsx("text",{x:"134",y:"20",className:"fill-oai-gray-500 dark:fill-oai-gray-400",fontSize:"8",fontWeight:"700",letterSpacing:"0.6",children:"7 DAYS"}),e.jsx("text",{x:"134",y:"46",className:"fill-oai-black dark:fill-white",fontSize:"22",fontWeight:"700",fontFamily:h,children:"880.9M"}),e.jsx("text",{x:"134",y:"60",className:"fill-oai-gray-500 dark:fill-oai-gray-400",fontSize:"8",fontWeight:"500",fontFamily:h,children:"$673.61"}),e.jsx("path",{d:r,fill:`url(#${i})`,stroke:"none"}),e.jsx("path",{d:a,fill:"none",stroke:"#0A84FF",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})]})})}const S=(()=>{const r=[];for(let i=0;i<26;i++)for(let l=0;l<7;l++){const s=Math.sin((i+1)*12.9898+(l+1)*78.233+17)*43758.5453,c=Math.floor(Math.abs(s-Math.floor(s))*100);r.push({w:i,d:l,v:c})}return r})();function A(t,a){return t<18?a?"#262626":"#e5e5e5":t<38?"rgba(10, 132, 255, 0.28)":t<58?"rgba(10, 132, 255, 0.50)":t<80?"rgba(10, 132, 255, 0.75)":"#0A84FF"}function q(){return e.jsx(b,{children:e.jsxs("svg",{viewBox:"0 0 264 124",className:"h-full w-full","aria-hidden":"true",children:[e.jsx("g",{transform:`translate(${19.5}, 10)`,className:"hidden dark:inline",children:S.map(s=>e.jsx("rect",{x:s.w*(7.5+1.2),y:s.d*(8+1.2),width:7.5,height:8,rx:"1.3",fill:A(s.v,!0)},`d-${s.w}-${s.d}`))}),e.jsx("g",{transform:`translate(${19.5}, 10)`,className:"dark:hidden",children:S.map(s=>e.jsx("rect",{x:s.w*(7.5+1.2),y:s.d*(8+1.2),width:7.5,height:8,rx:"1.3",fill:A(s.v,!1)},`l-${s.w}-${s.d}`))}),e.jsx("text",{x:19.5,y:"102",className:"fill-oai-black dark:fill-white",fontSize:"10",fontWeight:"700",fontFamily:h,children:"10.3B"}),e.jsx("text",{x:19.5+30,y:"102",className:"fill-oai-gray-500 dark:fill-oai-gray-400",fontSize:"9",fontWeight:"500",children:"tokens · 202 active days"})]})})}function J(){const t=[{name:"claude-opus-4-6",value:"586.4M",pct:59},{name:"claude-sonnet-4-5-20250929",value:"218.7M",pct:22},{name:"gpt-5.4",value:"80.6M",pct:8},{name:"composer-2-fast",value:"52.1M",pct:5}],a=22,r=28,i=14,l=236;return e.jsx(b,{children:e.jsx("svg",{viewBox:"0 0 264 124",className:"h-full w-full","aria-hidden":"true",children:t.map((s,c)=>{const n=r+c*a,g=N[c%N.length];return e.jsxs("g",{children:[e.jsx("circle",{cx:"18",cy:n-3,r:"2.5",fill:g}),e.jsx("text",{x:"26",y:n,className:"fill-oai-black dark:fill-white",fontSize:"9",fontWeight:"500",children:s.name}),e.jsx("text",{x:"218",y:n,textAnchor:"end",className:"fill-oai-gray-500 dark:fill-oai-gray-400",fontSize:"9",fontWeight:"600",fontFamily:h,children:s.value}),e.jsxs("text",{x:"250",y:n,textAnchor:"end",className:"fill-oai-gray-500 dark:fill-oai-gray-400",fontSize:"8",fontWeight:"600",fontFamily:h,children:[s.pct,"%"]}),e.jsx("rect",{x:i,y:n+4,width:l,height:"2.8",rx:"1.4",className:"fill-oai-gray-200 dark:fill-oai-gray-700"}),e.jsx("rect",{x:i,y:n+4,width:Math.max(l*(s.pct/100),4),height:"2.8",rx:"1.4",fill:g})]},s.name)})})})}function Q(){const t=[{label:"Claude · 7d",source:"claude",reset:"in 1d",pct:61},{label:"Claude · 5h",source:"claude",reset:"in 4h 28m",pct:4},{label:"Cursor",source:"cursor",reset:"in 25d",pct:51},{label:"Codex · weekly",source:"codex",reset:"in 1d",pct:32}],a=22,r=28,i=14,l=236;return e.jsx(b,{children:e.jsx("svg",{viewBox:"0 0 264 124",className:"h-full w-full","aria-hidden":"true",children:t.map((s,c)=>{const n=r+c*a,g=X[s.source],y=Y(s.pct/100);return e.jsxs("g",{children:[e.jsx("circle",{cx:"18",cy:n-3,r:"2.5",fill:g}),e.jsx("text",{x:"26",y:n,className:"fill-oai-black dark:fill-white",fontSize:"9",fontWeight:"500",children:s.label}),e.jsx("text",{x:"218",y:n,textAnchor:"end",className:"fill-oai-gray-500 dark:fill-oai-gray-400",fontSize:"8",fontWeight:"500",fontFamily:h,children:s.reset}),e.jsxs("text",{x:"250",y:n,textAnchor:"end",className:"fill-oai-black dark:fill-white",fontSize:"9",fontWeight:"700",fontFamily:h,children:[s.pct,"%"]}),e.jsx("rect",{x:i,y:n+4,width:l,height:"2.8",rx:"1.4",className:"fill-oai-gray-200 dark:fill-oai-gray-700"}),e.jsx("rect",{x:i,y:n+4,width:Math.max(l*(s.pct/100),4),height:"2.8",rx:"1.4",fill:y})]},s.label)})})})}function ee(t){switch(t.category){case"cost":return"$8.42";case"limits":return"62%";default:return t.id==="last7dTokens"?"1.8B":"203M"}}function te(t,a){switch(t){case"todayTokens":return o("menubar.metric.today_tokens");case"todayCost":return o("menubar.metric.today_cost");case"last7dTokens":return o("menubar.metric.last_7d_tokens");case"totalTokens":return o("menubar.metric.total_tokens");case"totalCost":return o("menubar.metric.total_cost");case"claude5h":return o("menubar.metric.claude_5h");case"claude7d":return o("menubar.metric.claude_7d");case"codex5h":return o("menubar.metric.codex_5h");case"codex7d":return o("menubar.metric.codex_7d");case"codexSpark5h":return o("menubar.metric.codex_spark_5h");case"codexSpark7d":return o("menubar.metric.codex_spark_7d");default:return a}}function ae(t,a){const r=new Set(a.map(l=>l.id)),i=t.filter(l=>r.has(l));for(const l of a){if(i.length>=2)break;i.includes(l.id)||i.push(l.id)}return i.slice(0,2)}function ie({slotConfigs:t,showStats:a}){return e.jsx("div",{className:"flex justify-center rounded-xl bg-gradient-to-b from-oai-gray-100 to-oai-gray-200 px-6 py-8 dark:from-oai-gray-950/80 dark:to-oai-gray-900/80",children:e.jsxs("div",{className:"inline-flex items-stretch rounded-md shadow-[0_1px_3px_rgba(0,0,0,0.18)] ring-1 ring-black/10 dark:ring-white/10 px-3",style:{background:"linear-gradient(180deg, #2c2c2e 0%, #1c1c1e 100%)"},children:[e.jsx("div",{className:"flex items-center pl-2 pr-1 py-2.5",children:e.jsx("img",{src:"/clawd/mini/idle-tight.svg",alt:"","aria-hidden":"true",className:"block shrink-0",style:{height:22,width:"auto"},draggable:"false"})}),a?t.map(({slot:r,item:i},l)=>e.jsxs(D.Fragment,{children:[l>0?e.jsx("span",{className:"my-1 w-px bg-white/20","aria-hidden":"true"}):null,e.jsxs("div",{className:W("flex min-w-[52px] flex-col items-center justify-center py-1.5",l===0?"pl-1 pr-2":"px-2"),children:[e.jsx("span",{className:"text-[13px] font-semibold leading-none tabular-nums text-white",children:i?.previewValue||"--"}),e.jsx("span",{className:"mt-[2px] text-[6px] font-semibold uppercase leading-none text-white/75",children:i?.shortLabel||"Metric"})]})]},r)):null]})})}function se({slot:t,value:a,options:r,disabled:i,onChange:l}){const s=t===0?o("menubar.slot.primary"):o("menubar.slot.secondary");return e.jsxs("div",{className:"flex min-w-0 flex-col gap-1.5",children:[e.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-[0.08em] text-oai-gray-500 dark:text-oai-gray-400",children:s}),e.jsx(E,{value:a,disabled:i,ariaLabel:s,onValueChange:c=>l(t,c),options:r.map(c=>({value:c.id,label:c.displayLabel})),matchTriggerWidth:!0,className:"w-full px-3 py-2 text-sm font-medium"})]})}function p({label:t,hint:a,checked:r,disabled:i,onChange:l}){return e.jsxs("div",{className:"flex items-center justify-between gap-3 py-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-sm font-medium text-oai-black dark:text-white",children:t}),a?e.jsx("p",{className:"mt-0.5 text-xs text-oai-gray-500 dark:text-oai-gray-400",children:a}):null]}),e.jsx(G,{checked:r,disabled:i,onChange:l,ariaLabel:t})]})}function re(){const{available:t,settings:a,setSetting:r}=K(),i=u.useMemo(()=>(Array.isArray(a?.menuBarAvailableItems)?a.menuBarAvailableItems:_).map(m=>({...m,displayLabel:te(m.id,m.label),previewValue:ee(m)})),[a?.menuBarAvailableItems]),l=Number(a?.menuBarMaxItems)||2,s=u.useMemo(()=>C(a?.menuBarItems,i,l),[i,l,a?.menuBarItems]),c=u.useMemo(()=>ae(s,i),[i,s]),n=a?.showStats!==!1,g=d=>{r("menuBarItems",C(d,i,l))},y=(d,m)=>{const x=[...c];x[d===0?1:0]!==m&&(x[d]=m,g(x))},k=[0,1].map(d=>{const m=c[d]||i[d]?.id||"",v=c[d===0?1:0],T=i.filter(f=>f.id===m||f.id!==v),F=i.find(f=>f.id===m);return{slot:d,currentValue:m,options:T,item:F}}),w=a?.animatedIcon!==!1,j=a?.confettiOnReset!==!1;return e.jsxs("article",{className:"rounded-xl border border-oai-gray-200 bg-white p-5 transition-colors duration-200 dark:border-oai-gray-800 dark:bg-oai-gray-900 sm:p-6",children:[e.jsx(ie,{slotConfigs:k,showStats:n}),e.jsx("div",{className:"mt-5 grid grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-4",children:k.map(({slot:d,currentValue:m,options:x})=>e.jsx(se,{slot:d,value:m,options:x,disabled:!t||!n,onChange:y},d))}),e.jsxs("div",{className:"mt-5 divide-y divide-oai-gray-100 border-t border-oai-gray-100 dark:divide-oai-gray-800 dark:border-oai-gray-800",children:[e.jsx(p,{label:o("settings.menubar.showStats"),hint:t?o("settings.menubar.showStatsHint"):o("menubar.native_only"),checked:n,disabled:!t,onChange:()=>r("showStats",!n)}),e.jsx(p,{label:o("settings.menubar.animatedIcon"),hint:o("settings.menubar.animatedIconHint"),checked:w,disabled:!t,onChange:()=>r("animatedIcon",!w)}),e.jsx(p,{label:o("settings.menubar.confettiOnReset"),hint:o("settings.menubar.confettiOnResetHint"),checked:j,disabled:!t,onChange:()=>r("confettiOnReset",!j)})]})]})}function le(){const[t,a]=u.useState("loading");return u.useEffect(()=>{if(typeof window>"u")return;if(B()){a("native");return}const r=(navigator.userAgent||"").toLowerCase(),i=/mac/.test(r)&&!/iphone|ipad/.test(r);a(i?"mac-web":"other")},[]),t}function oe(){const t=le();return t==="loading"?e.jsx("div",{className:"h-10 w-40","aria-hidden":"true"}):t==="native"?e.jsxs("button",{type:"button",onClick:()=>I("openWidgetGallery"),className:"inline-flex h-10 items-center gap-2 rounded-lg bg-oai-black px-4 text-sm font-medium text-white transition-colors hover:bg-oai-gray-800 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500 focus-visible:ring-offset-2 dark:bg-white dark:text-oai-black dark:hover:bg-oai-gray-200",children:[o("widgets.cta.open_gallery"),e.jsx($,{className:"h-4 w-4","aria-hidden":"true"})]}):t==="mac-web"?e.jsxs("a",{href:"https://github.com/mm7894215/TokenTracker/releases/latest",target:"_blank",rel:"noopener noreferrer",className:"inline-flex h-10 items-center gap-2 rounded-lg bg-oai-black px-4 text-sm font-medium text-white no-underline transition-colors hover:bg-oai-gray-800 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500 focus-visible:ring-offset-2 dark:bg-white dark:text-oai-black dark:hover:bg-oai-gray-200",children:[e.jsx(z,{className:"h-4 w-4","aria-hidden":"true"}),o("widgets.cta.download")]}):e.jsxs("span",{className:"inline-flex h-10 items-center gap-2 rounded-lg border border-oai-gray-200 bg-oai-gray-50 px-4 text-sm font-medium text-oai-gray-500 dark:border-oai-gray-800 dark:bg-oai-gray-900 dark:text-oai-gray-400",children:[e.jsx(P,{className:"h-4 w-4","aria-hidden":"true"}),o("widgets.cta.macos_only")]})}const ne=[{id:"summary",Preview:Z,nameKey:"widgets.summary.name",descKey:"widgets.summary.description"},{id:"heatmap",Preview:q,nameKey:"widgets.heatmap.name",descKey:"widgets.heatmap.description"},{id:"topModels",Preview:J,nameKey:"widgets.topModels.name",descKey:"widgets.topModels.description"},{id:"limits",Preview:Q,nameKey:"widgets.limits.name",descKey:"widgets.limits.description"}];function ce({Preview:t,nameKey:a,descKey:r}){return e.jsxs("article",{className:"flex h-full flex-col rounded-xl border border-oai-gray-200 bg-white p-4 transition-colors duration-200 dark:border-oai-gray-800 dark:bg-oai-gray-900 sm:p-5",children:[e.jsx(t,{}),e.jsxs("div",{className:"mt-4",children:[e.jsx("h3",{className:"text-[15px] font-semibold text-oai-black dark:text-white",children:o(a)}),e.jsx("p",{className:"mt-1.5 text-sm leading-relaxed text-oai-gray-500 dark:text-oai-gray-400",children:o(r)})]})]})}function M({titleKey:t}){return e.jsx("h2",{className:"mb-4 text-xl font-semibold tracking-tight text-oai-black dark:text-white sm:mb-5 sm:text-2xl",children:o(t)})}function pe(){return e.jsx("div",{className:"flex flex-col flex-1 text-oai-black dark:text-oai-white font-oai antialiased",children:e.jsx("main",{className:"flex-1 pt-8 sm:pt-10 pb-12 sm:pb-16",children:e.jsxs("div",{className:"mx-auto max-w-5xl px-4 sm:px-6",children:[e.jsx(L,{y:12,children:e.jsxs("header",{className:"mb-10 flex items-start justify-between gap-4 sm:mb-12",children:[e.jsx("h1",{className:"text-3xl font-semibold tracking-tight text-oai-black dark:text-white sm:text-4xl",children:o("widgets.page.title")}),e.jsx("div",{className:"shrink-0",children:e.jsx(oe,{})})]})}),e.jsx(L,{y:12,delay:.06,children:e.jsxs("section",{"aria-label":o("widgets.menubar.section.title"),className:"mb-12 sm:mb-14",children:[e.jsx(M,{titleKey:"widgets.menubar.section.title"}),e.jsx(re,{})]})}),e.jsxs("section",{"aria-label":o("widgets.gallery.section.title"),children:[e.jsx(M,{titleKey:"widgets.gallery.section.title"}),e.jsx(R,{staggerDelay:.08,initialDelay:.04,children:e.jsx("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-2 lg:gap-5",children:ne.map(({id:t,Preview:a,nameKey:r,descKey:i})=>e.jsx(O,{children:e.jsx(ce,{Preview:a,nameKey:r,descKey:i})},t))})})]})]})})})}export{pe as WidgetsPage};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
function B(t,e){if(t.match(/^[a-z]+:\/\//i))return t;if(t.match(/^\/\//))return window.location.protocol+t;if(t.match(/^[a-z]+:/i))return t;const n=document.implementation.createHTMLDocument(),r=n.createElement("base"),s=n.createElement("a");return n.head.appendChild(r),n.body.appendChild(s),e&&(r.href=e),s.href=t,s.href}const j=(()=>{let t=0;const e=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(t+=1,`u${e()}${t}`)})();function m(t){const e=[];for(let n=0,r=t.length;n<r;n++)e.push(t[n]);return e}let g=null;function v(t={}){return g||(t.includeStyleProperties?(g=t.includeStyleProperties,g):(g=m(window.getComputedStyle(document.documentElement)),g))}function y(t,e){const r=(t.ownerDocument.defaultView||window).getComputedStyle(t).getPropertyValue(e);return r?parseFloat(r.replace("px","")):0}function z(t){const e=y(t,"border-left-width"),n=y(t,"border-right-width");return t.clientWidth+e+n}function G(t){const e=y(t,"border-top-width"),n=y(t,"border-bottom-width");return t.clientHeight+e+n}function R(t,e={}){const n=e.width||z(t),r=e.height||G(t);return{width:n,height:r}}function X(){let t,e;try{e=process}catch{}const n=e&&e.env?e.env.devicePixelRatio:null;return n&&(t=parseInt(n,10),Number.isNaN(t)&&(t=1)),t||window.devicePixelRatio||1}const u=16384;function J(t){(t.width>u||t.height>u)&&(t.width>u&&t.height>u?t.width>t.height?(t.height*=u/t.width,t.width=u):(t.width*=u/t.height,t.height=u):t.width>u?(t.height*=u/t.width,t.width=u):(t.width*=u/t.height,t.height=u))}function K(t,e={}){return t.toBlob?new Promise(n=>{t.toBlob(n,e.type?e.type:"image/png",e.quality?e.quality:1)}):new Promise(n=>{const r=window.atob(t.toDataURL(e.type?e.type:void 0,e.quality?e.quality:void 0).split(",")[1]),s=r.length,i=new Uint8Array(s);for(let a=0;a<s;a+=1)i[a]=r.charCodeAt(a);n(new Blob([i],{type:e.type?e.type:"image/png"}))})}function w(t){return new Promise((e,n)=>{const r=new Image;r.onload=()=>{r.decode().then(()=>{requestAnimationFrame(()=>e(r))})},r.onerror=n,r.crossOrigin="anonymous",r.decoding="async",r.src=t})}async function Q(t){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(t)).then(encodeURIComponent).then(e=>`data:image/svg+xml;charset=utf-8,${e}`)}async function Y(t,e,n){const r="http://www.w3.org/2000/svg",s=document.createElementNS(r,"svg"),i=document.createElementNS(r,"foreignObject");return s.setAttribute("width",`${e}`),s.setAttribute("height",`${n}`),s.setAttribute("viewBox",`0 0 ${e} ${n}`),i.setAttribute("width","100%"),i.setAttribute("height","100%"),i.setAttribute("x","0"),i.setAttribute("y","0"),i.setAttribute("externalResourcesRequired","true"),s.appendChild(i),i.appendChild(t),Q(s)}const l=(t,e)=>{if(t instanceof e)return!0;const n=Object.getPrototypeOf(t);return n===null?!1:n.constructor.name===e.name||l(n,e)};function Z(t){const e=t.getPropertyValue("content");return`${t.cssText} content: '${e.replace(/'|"/g,"")}';`}function N(t,e){return v(e).map(n=>{const r=t.getPropertyValue(n),s=t.getPropertyPriority(n);return`${n}: ${r}${s?" !important":""};`}).join(" ")}function tt(t,e,n,r){const s=`.${t}:${e}`,i=n.cssText?Z(n):N(n,r);return document.createTextNode(`${s}{${i}}`)}function $(t,e,n,r){const s=window.getComputedStyle(t,n),i=s.getPropertyValue("content");if(i===""||i==="none")return;const a=j();try{e.className=`${e.className} ${a}`}catch{return}const c=document.createElement("style");c.appendChild(tt(a,n,s,r)),e.appendChild(c)}function et(t,e,n){$(t,e,":before",n),$(t,e,":after",n)}const T="application/font-woff",L="image/jpeg",nt={woff:T,woff2:T,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:L,jpeg:L,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function rt(t){const e=/\.([^./]*?)$/g.exec(t);return e?e[1]:""}function C(t){const e=rt(t).toLowerCase();return nt[e]||""}function it(t){return t.split(/,/)[1]}function x(t){return t.search(/^(data:)/)!==-1}function st(t,e){return`data:${e};base64,${t}`}async function U(t,e,n){const r=await fetch(t,e);if(r.status===404)throw new Error(`Resource "${r.url}" not found`);const s=await r.blob();return new Promise((i,a)=>{const c=new FileReader;c.onerror=a,c.onloadend=()=>{try{i(n({res:r,result:c.result}))}catch(o){a(o)}},c.readAsDataURL(s)})}const E={};function at(t,e,n){let r=t.replace(/\?.*/,"");return n&&(r=t),/ttf|otf|eot|woff2?/i.test(r)&&(r=r.replace(/.*\//,"")),e?`[${e}]${r}`:r}async function P(t,e,n){const r=at(t,e,n.includeQueryParams);if(E[r]!=null)return E[r];n.cacheBust&&(t+=(/\?/.test(t)?"&":"?")+new Date().getTime());let s;try{const i=await U(t,n.fetchRequestInit,({res:a,result:c})=>(e||(e=a.headers.get("Content-Type")||""),it(c)));s=st(i,e)}catch(i){s=n.imagePlaceholder||"";let a=`Failed to fetch resource: ${t}`;i&&(a=typeof i=="string"?i:i.message),a&&console.warn(a)}return E[r]=s,s}async function ct(t){const e=t.toDataURL();return e==="data:,"?t.cloneNode(!1):w(e)}async function ot(t,e){if(t.currentSrc){const i=document.createElement("canvas"),a=i.getContext("2d");i.width=t.clientWidth,i.height=t.clientHeight,a?.drawImage(t,0,0,i.width,i.height);const c=i.toDataURL();return w(c)}const n=t.poster,r=C(n),s=await P(n,r,e);return w(s)}async function lt(t,e){var n;try{if(!((n=t?.contentDocument)===null||n===void 0)&&n.body)return await p(t.contentDocument.body,e,!0)}catch{}return t.cloneNode(!1)}async function ut(t,e){return l(t,HTMLCanvasElement)?ct(t):l(t,HTMLVideoElement)?ot(t,e):l(t,HTMLIFrameElement)?lt(t,e):t.cloneNode(k(t))}const ft=t=>t.tagName!=null&&t.tagName.toUpperCase()==="SLOT",k=t=>t.tagName!=null&&t.tagName.toUpperCase()==="SVG";async function ht(t,e,n){var r,s;if(k(e))return e;let i=[];return ft(t)&&t.assignedNodes?i=m(t.assignedNodes()):l(t,HTMLIFrameElement)&&(!((r=t.contentDocument)===null||r===void 0)&&r.body)?i=m(t.contentDocument.body.childNodes):i=m(((s=t.shadowRoot)!==null&&s!==void 0?s:t).childNodes),i.length===0||l(t,HTMLVideoElement)||await i.reduce((a,c)=>a.then(()=>p(c,n)).then(o=>{o&&e.appendChild(o)}),Promise.resolve()),e}function mt(t,e,n){const r=e.style;if(!r)return;const s=window.getComputedStyle(t);s.cssText?(r.cssText=s.cssText,r.transformOrigin=s.transformOrigin):v(n).forEach(i=>{let a=s.getPropertyValue(i);i==="font-size"&&a.endsWith("px")&&(a=`${Math.floor(parseFloat(a.substring(0,a.length-2)))-.1}px`),l(t,HTMLIFrameElement)&&i==="display"&&a==="inline"&&(a="block"),i==="d"&&e.getAttribute("d")&&(a=`path(${e.getAttribute("d")})`),r.setProperty(i,a,s.getPropertyPriority(i))})}function gt(t,e){l(t,HTMLTextAreaElement)&&(e.innerHTML=t.value),l(t,HTMLInputElement)&&e.setAttribute("value",t.value)}function dt(t,e){if(l(t,HTMLSelectElement)){const r=Array.from(e.children).find(s=>t.value===s.getAttribute("value"));r&&r.setAttribute("selected","")}}function yt(t,e,n){return l(e,Element)&&(mt(t,e,n),et(t,e,n),gt(t,e),dt(t,e)),e}async function wt(t,e){const n=t.querySelectorAll?t.querySelectorAll("use"):[];if(n.length===0)return t;const r={};for(let i=0;i<n.length;i++){const c=n[i].getAttribute("xlink:href");if(c){const o=t.querySelector(c),f=document.querySelector(c);!o&&f&&!r[c]&&(r[c]=await p(f,e,!0))}}const s=Object.values(r);if(s.length){const i="http://www.w3.org/1999/xhtml",a=document.createElementNS(i,"svg");a.setAttribute("xmlns",i),a.style.position="absolute",a.style.width="0",a.style.height="0",a.style.overflow="hidden",a.style.display="none";const c=document.createElementNS(i,"defs");a.appendChild(c);for(let o=0;o<s.length;o++)c.appendChild(s[o]);t.appendChild(a)}return t}async function p(t,e,n){return!n&&e.filter&&!e.filter(t)?null:Promise.resolve(t).then(r=>ut(r,e)).then(r=>ht(t,r,e)).then(r=>yt(t,r,e)).then(r=>wt(r,e))}const H=/url\((['"]?)([^'"]+?)\1\)/g,pt=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,St=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function bt(t){const e=t.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${e})(['"]?\\))`,"g")}function Et(t){const e=[];return t.replace(H,(n,r,s)=>(e.push(s),n)),e.filter(n=>!x(n))}async function xt(t,e,n,r,s){try{const i=n?B(e,n):e,a=C(e);let c;return s||(c=await P(i,a,r)),t.replace(bt(e),`$1${c}$3`)}catch{}return t}function Rt(t,{preferredFontFormat:e}){return e?t.replace(St,n=>{for(;;){const[r,,s]=pt.exec(n)||[];if(!s)return"";if(s===e)return`src: ${r};`}}):t}function V(t){return t.search(H)!==-1}async function M(t,e,n){if(!V(t))return t;const r=Rt(t,n);return Et(r).reduce((i,a)=>i.then(c=>xt(c,a,e,n)),Promise.resolve(r))}async function d(t,e,n){var r;const s=(r=e.style)===null||r===void 0?void 0:r.getPropertyValue(t);if(s){const i=await M(s,null,n);return e.style.setProperty(t,i,e.style.getPropertyPriority(t)),!0}return!1}async function Ct(t,e){await d("background",t,e)||await d("background-image",t,e),await d("mask",t,e)||await d("-webkit-mask",t,e)||await d("mask-image",t,e)||await d("-webkit-mask-image",t,e)}async function Pt(t,e){const n=l(t,HTMLImageElement);if(!(n&&!x(t.src))&&!(l(t,SVGImageElement)&&!x(t.href.baseVal)))return;const r=n?t.src:t.href.baseVal,s=await P(r,C(r),e);await new Promise((i,a)=>{t.onload=i,t.onerror=e.onImageErrorHandler?(...o)=>{try{i(e.onImageErrorHandler(...o))}catch(f){a(f)}}:a;const c=t;c.decode&&(c.decode=i),c.loading==="lazy"&&(c.loading="eager"),n?(t.srcset="",t.src=s):t.href.baseVal=s})}async function $t(t,e){const r=m(t.childNodes).map(s=>O(s,e));await Promise.all(r).then(()=>t)}async function O(t,e){l(t,Element)&&(await Ct(t,e),await Pt(t,e),await $t(t,e))}function Tt(t,e){const{style:n}=t;e.backgroundColor&&(n.backgroundColor=e.backgroundColor),e.width&&(n.width=`${e.width}px`),e.height&&(n.height=`${e.height}px`);const r=e.style;return r!=null&&Object.keys(r).forEach(s=>{n[s]=r[s]}),t}const F={};async function I(t){let e=F[t];if(e!=null)return e;const r=await(await fetch(t)).text();return e={url:t,cssText:r},F[t]=e,e}async function A(t,e){let n=t.cssText;const r=/url\(["']?([^"')]+)["']?\)/g,i=(n.match(/url\([^)]+\)/g)||[]).map(async a=>{let c=a.replace(r,"$1");return c.startsWith("https://")||(c=new URL(c,t.url).href),U(c,e.fetchRequestInit,({result:o})=>(n=n.replace(a,`url(${o})`),[a,o]))});return Promise.all(i).then(()=>n)}function D(t){if(t==null)return[];const e=[],n=/(\/\*[\s\S]*?\*\/)/gi;let r=t.replace(n,"");const s=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const o=s.exec(r);if(o===null)break;e.push(o[0])}r=r.replace(s,"");const i=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,a="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",c=new RegExp(a,"gi");for(;;){let o=i.exec(r);if(o===null){if(o=c.exec(r),o===null)break;i.lastIndex=c.lastIndex}else c.lastIndex=i.lastIndex;e.push(o[0])}return e}async function Lt(t,e){const n=[],r=[];return t.forEach(s=>{if("cssRules"in s)try{m(s.cssRules||[]).forEach((i,a)=>{if(i.type===CSSRule.IMPORT_RULE){let c=a+1;const o=i.href,f=I(o).then(h=>A(h,e)).then(h=>D(h).forEach(b=>{try{s.insertRule(b,b.startsWith("@import")?c+=1:s.cssRules.length)}catch(W){console.error("Error inserting rule from remote css",{rule:b,error:W})}})).catch(h=>{console.error("Error loading remote css",h.toString())});r.push(f)}})}catch(i){const a=t.find(c=>c.href==null)||document.styleSheets[0];s.href!=null&&r.push(I(s.href).then(c=>A(c,e)).then(c=>D(c).forEach(o=>{a.insertRule(o,a.cssRules.length)})).catch(c=>{console.error("Error loading remote stylesheet",c)})),console.error("Error inlining remote css file",i)}}),Promise.all(r).then(()=>(t.forEach(s=>{if("cssRules"in s)try{m(s.cssRules||[]).forEach(i=>{n.push(i)})}catch(i){console.error(`Error while reading CSS rules from ${s.href}`,i)}}),n))}function Ft(t){return t.filter(e=>e.type===CSSRule.FONT_FACE_RULE).filter(e=>V(e.style.getPropertyValue("src")))}async function It(t,e){if(t.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=m(t.ownerDocument.styleSheets),r=await Lt(n,e);return Ft(r)}function _(t){return t.trim().replace(/["']/g,"")}function At(t){const e=new Set;function n(r){(r.style.fontFamily||getComputedStyle(r).fontFamily).split(",").forEach(i=>{e.add(_(i))}),Array.from(r.children).forEach(i=>{i instanceof HTMLElement&&n(i)})}return n(t),e}async function q(t,e){const n=await It(t,e),r=At(t);return(await Promise.all(n.filter(i=>r.has(_(i.style.fontFamily))).map(i=>{const a=i.parentStyleSheet?i.parentStyleSheet.href:null;return M(i.cssText,a,e)}))).join(`
|
|
2
|
-
`)}async function Dt(t,e){const n=e.fontEmbedCSS!=null?e.fontEmbedCSS:e.skipFonts?null:await q(t,e);if(n){const r=document.createElement("style"),s=document.createTextNode(n);r.appendChild(s),t.firstChild?t.insertBefore(r,t.firstChild):t.appendChild(r)}}async function vt(t,e={}){const{width:n,height:r}=R(t,e),s=await p(t,e,!0);return await Dt(s,e),await O(s,e),Tt(s,e),await Y(s,n,r)}async function S(t,e={}){const{width:n,height:r}=R(t,e),s=await vt(t,e),i=await w(s),a=document.createElement("canvas"),c=a.getContext("2d"),o=e.pixelRatio||X(),f=e.canvasWidth||n,h=e.canvasHeight||r;return a.width=f*o,a.height=h*o,e.skipAutoScale||J(a),a.style.width=`${f}`,a.style.height=`${h}`,e.backgroundColor&&(c.fillStyle=e.backgroundColor,c.fillRect(0,0,a.width,a.height)),c.drawImage(i,0,0,a.width,a.height),a}async function Ut(t,e={}){const{width:n,height:r}=R(t,e);return(await S(t,e)).getContext("2d").getImageData(0,0,n,r).data}async function kt(t,e={}){return(await S(t,e)).toDataURL()}async function Ht(t,e={}){return(await S(t,e)).toDataURL("image/jpeg",e.quality||1)}async function Vt(t,e={}){const n=await S(t,e);return await K(n)}async function Mt(t,e={}){return q(t,e)}export{Mt as getFontEmbedCSS,Vt as toBlob,S as toCanvas,Ht as toJpeg,Ut as toPixelData,kt as toPng,vt as toSvg};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c}from"./main-C5qSiLnL.js";const o=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],t=c("info",o);export{t as I};
|