tokentracker-cli 0.83.2 → 0.83.4
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/{AchievementBadge-BrSr5pjk.js → AchievementBadge-Cj42BYfJ.js} +1 -1
- package/dashboard/dist/assets/{AchievementsPage-za-wqAO2.js → AchievementsPage-B41jhL7x.js} +2 -2
- package/dashboard/dist/assets/{AchievementsSection-CGRVm1uS.js → AchievementsSection-Lp1iynwg.js} +1 -1
- package/dashboard/dist/assets/{BadgeDetailModal-D1XDT2dG.js → BadgeDetailModal-DuaMzaGW.js} +1 -1
- package/dashboard/dist/assets/{Card-DX2Wwm9U.js → Card-CBJAS2Mp.js} +1 -1
- package/dashboard/dist/assets/{ClawdAnimated-D6JzFu8y.js → ClawdAnimated-C-Hry4YB.js} +1 -1
- package/dashboard/dist/assets/{CommandPalette-NWiETwtS.js → CommandPalette-CTJBaWpw.js} +1 -1
- package/dashboard/dist/assets/{CommunityStatsModal-D4FdxAWd.js → CommunityStatsModal-qSclg4Bj.js} +1 -1
- package/dashboard/dist/assets/{ConfirmModal-SAheZUAv.js → ConfirmModal-Dh3VzEaA.js} +1 -1
- package/dashboard/dist/assets/DashboardPage-BYnPMlX8.js +1 -0
- package/dashboard/dist/assets/{DevicePage-Cf-PHRlL.js → DevicePage-BrH5YYqa.js} +1 -1
- package/dashboard/dist/assets/{DialogClose-pg5pVOeD.js → DialogClose-CH61tv1C.js} +1 -1
- package/dashboard/dist/assets/DialogDescription-DqSqTcXg.js +1 -0
- package/dashboard/dist/assets/{DialogTitle-Im7ESzoS.js → DialogTitle-D945fBHg.js} +1 -1
- package/dashboard/dist/assets/{FadeIn-CGGFraHR.js → FadeIn-PByY-20e.js} +1 -1
- package/dashboard/dist/assets/{HeaderGithubStar-DRTZXRsx.js → HeaderGithubStar-JqnF9WrS.js} +1 -1
- package/dashboard/dist/assets/{IpCheckPage-Dn62HUZu.js → IpCheckPage-BL8s0rdr.js} +1 -1
- package/dashboard/dist/assets/{LandingPage-CLsljoir.js → LandingPage-Dq0YMelT.js} +2 -2
- package/dashboard/dist/assets/{LeaderboardAvatar-DktI_89h.js → LeaderboardAvatar-BV85AG35.js} +1 -1
- package/dashboard/dist/assets/{LeaderboardPage-t87ElnDI.js → LeaderboardPage-CW9nMYRr.js} +2 -2
- package/dashboard/dist/assets/{LeaderboardProfileModal-DN7HurS3.js → LeaderboardProfileModal-DF5nu051.js} +3 -3
- package/dashboard/dist/assets/{LeaderboardProfilePage-CprOXLXX.js → LeaderboardProfilePage-Cid2lIXh.js} +1 -1
- package/dashboard/dist/assets/{LimitsPage-DRX3XMYx.js → LimitsPage-D_SjLBQb.js} +1 -1
- package/dashboard/dist/assets/{LocalOnlyNotice-B8BtIdAA.js → LocalOnlyNotice-BgjVuk6t.js} +1 -1
- package/dashboard/dist/assets/{LoginCard-OoduGJmK.js → LoginCard-DcOOJ7F4.js} +1 -1
- package/dashboard/dist/assets/{LoginModal-DoDoCpr6.js → LoginModal-BmbXCQpU.js} +1 -1
- package/dashboard/dist/assets/{LoginPage-Dn2KMisI.js → LoginPage-BReX-hIM.js} +1 -1
- package/dashboard/dist/assets/{PetPage-CVaG5H3O.js → PetPage-cKhD5kRw.js} +1 -1
- package/dashboard/dist/assets/{PopoverPopup-B2HqJNaq.js → PopoverPopup-BL8WWGQD.js} +1 -1
- package/dashboard/dist/assets/{ProviderIcon-BYl1Yyf3.js → ProviderIcon-Dv8LjXBc.js} +1 -1
- package/dashboard/dist/assets/{ResetPasswordPage-DWfgvuvR.js → ResetPasswordPage-BggDvUTE.js} +1 -1
- package/dashboard/dist/assets/{Select-ClnnGJY1.js → Select-DFLOEvtQ.js} +1 -1
- package/dashboard/dist/assets/{SelectItemText-iaFWq7GD.js → SelectItemText-l_IytZ1x.js} +1 -1
- package/dashboard/dist/assets/{SettingsPage-zwAOWRur.js → SettingsPage-DD6EiVg7.js} +1 -1
- package/dashboard/dist/assets/{SkillsPage-BB96nB2i.js → SkillsPage-DJeX_hFu.js} +1 -1
- package/dashboard/dist/assets/{TokenGalaxy-9_VJKdPr.js → TokenGalaxy-CvtOZNXz.js} +1 -1
- package/dashboard/dist/assets/TrendMonitor-CbFaoSZx.js +19 -0
- package/dashboard/dist/assets/{WidgetsPage-CjAT6p0C.js → WidgetsPage-Dj37UajB.js} +1 -1
- package/dashboard/dist/assets/{WrappedPage-ba6teG1N.js → WrappedPage-BbRezT_v.js} +1 -1
- package/dashboard/dist/assets/{__vite-browser-external-DWKjPxnU.js → __vite-browser-external-BRzJpYc1.js} +2 -2
- package/dashboard/dist/assets/__vite-browser-external-C44tPAD-.css +1 -0
- package/dashboard/dist/assets/{agent-logos-HCzl7U8i.js → agent-logos-C2WjBjZi.js} +1 -1
- package/dashboard/dist/assets/{arrow-up-right-TvEj8NTT.js → arrow-up-right-_bkVN_-t.js} +1 -1
- package/dashboard/dist/assets/{check-Cz3lYRiR.js → check-QQtC-jGr.js} +1 -1
- package/dashboard/dist/assets/{copy-CTtF84H9.js → copy-tnrXJIlX.js} +1 -1
- package/dashboard/dist/assets/{download-B5WAY6Nh.js → download-DJgEaI-n.js} +1 -1
- package/dashboard/dist/assets/{flame-Cja4F8Mj.js → flame-D7el_0f3.js} +1 -1
- package/dashboard/dist/assets/{format-tokens-UavRPN4W.js → format-tokens-CmFsnNFY.js} +1 -1
- package/dashboard/dist/assets/{icons-BW2vjmu_.js → icons-D__mI241.js} +1 -1
- package/dashboard/dist/assets/{index-0w19KMWl.js → index-1pzviHs-.js} +1 -1
- package/dashboard/dist/assets/{index-Bfxr6erc.js → index-CKS8Swvi.js} +1 -1
- package/dashboard/dist/assets/{index-BnzrUY9J.js → index-DG0NZ_W7.js} +1 -1
- package/dashboard/dist/assets/{info-F-75j15K.js → info-7xyGxNal.js} +1 -1
- package/dashboard/dist/assets/{limits-providers-8NsMiLNP.js → limits-providers-D8LfR6Om.js} +1 -1
- package/dashboard/dist/assets/{link-2-C_eJlLvb.js → link-2-DRYdgDC2.js} +1 -1
- package/dashboard/dist/assets/{loader-circle-BjzQhjhO.js → loader-circle-CX24zxqF.js} +1 -1
- package/dashboard/dist/assets/{provider-display-D1zp03ID.js → provider-display-DPIFKw3O.js} +1 -1
- package/dashboard/dist/assets/{react-Nv3-bJyw.js → react-D9H9IC9r.js} +1 -1
- package/dashboard/dist/assets/{skills-api-DazKXxME.js → skills-api-BVQc9owa.js} +1 -1
- package/dashboard/dist/assets/{terminal-DBXjwlTm.js → terminal-4058d4_A.js} +1 -1
- package/dashboard/dist/assets/{trash-2-DLG8hKJm.js → trash-2-D3cJG7LG.js} +1 -1
- package/dashboard/dist/assets/{use-community-stats-BQB72xAN.js → use-community-stats-MKJhkjxa.js} +1 -1
- package/dashboard/dist/assets/{use-limits-display-prefs-CH8MmjYf.js → use-limits-display-prefs-FXO2f5fy.js} +1 -1
- package/dashboard/dist/assets/{use-native-settings-__RhxrW5.js → use-native-settings-BeED1BpH.js} +1 -1
- package/dashboard/dist/assets/{use-ordered-list-AhnqpdnT.js → use-ordered-list-D1Ts8ut3.js} +1 -1
- package/dashboard/dist/assets/use-reduced-motion-8J-IDPSQ.js +1 -0
- package/dashboard/dist/assets/{use-session-efficiency-pref-CCYtJ_cN.js → use-session-efficiency-pref-CtzlSied.js} +1 -1
- package/dashboard/dist/assets/{use-transform-BhcppNI4.js → use-transform-CO582voD.js} +1 -1
- package/dashboard/dist/assets/{use-usage-limits-CbA095lv.js → use-usage-limits-Ca15KPkK.js} +1 -1
- package/dashboard/dist/assets/{useCurrency-Dt2GqkDm.js → useCurrency-CKFbWGkT.js} +1 -1
- package/dashboard/dist/assets/{useScrollLock-C5d53j7C.js → useScrollLock-DNdxd1UW.js} +1 -1
- package/dashboard/dist/assets/{useTokenFormat-dnqZK7Z-.js → useTokenFormat-DTK4cojM.js} +1 -1
- package/dashboard/dist/assets/{zap-Bw5OO91s.js → zap-DDCrktFO.js} +1 -1
- package/dashboard/dist/index.html +2 -2
- package/dashboard/dist/share.html +2 -2
- package/package.json +1 -1
- package/src/lib/pricing/seed-snapshot.json +1 -1
- package/dashboard/dist/assets/DashboardPage-CjnBsm3Q.js +0 -1
- package/dashboard/dist/assets/DialogDescription-CVuGFYFU.js +0 -1
- package/dashboard/dist/assets/TrendMonitor-D9RHcQgH.js +0 -19
- package/dashboard/dist/assets/__vite-browser-external-D_0JUhT7.css +0 -1
- package/dashboard/dist/assets/use-reduced-motion-CA2IXeeO.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{k as o}from"./__vite-browser-external-
|
|
1
|
+
import{k as o}from"./__vite-browser-external-BRzJpYc1.js";const t=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],a=o("arrow-up-right",t);export{a as A};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{k as c}from"./__vite-browser-external-
|
|
1
|
+
import{k as c}from"./__vite-browser-external-BRzJpYc1.js";const e=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],t=c("check",e);export{t as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{k as c}from"./__vite-browser-external-
|
|
1
|
+
import{k as c}from"./__vite-browser-external-BRzJpYc1.js";const e=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],t=c("copy",e);export{t as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{k as o}from"./__vite-browser-external-
|
|
1
|
+
import{k as o}from"./__vite-browser-external-BRzJpYc1.js";const a=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],e=o("download",a);export{e as D};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{k as c}from"./__vite-browser-external-
|
|
1
|
+
import{k as c}from"./__vite-browser-external-BRzJpYc1.js";const e=[["path",{d:"M12 3q1 4 4 6.5t3 5.5a1 1 0 0 1-14 0 5 5 0 0 1 1-3 1 1 0 0 0 5 0c0-2-1.5-3-1.5-5q0-2 2.5-4",key:"1slcih"}]],a=c("flame",e);export{a as F};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as r}from"./__vite-browser-external-
|
|
1
|
+
import{i as r}from"./__vite-browser-external-BRzJpYc1.js";function n(o){const t=Number(o)||0;return t>=1e12?`${Number((t/1e12).toFixed(2)).toString()}T`:r(t)}export{n as f};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as r}from"./__vite-browser-external-
|
|
1
|
+
import{j as r}from"./__vite-browser-external-BRzJpYc1.js";function e({className:n}){return r.jsx("svg",{viewBox:"0 0 384 512",className:n,fill:"currentColor","aria-hidden":"true",children:r.jsx("path",{d:"M318.7 268.7c-.2-36.7 16.4-64.4 50-84.8-18.8-26.9-47.2-41.7-84.7-44.6-35.5-2.8-74.3 20.7-88.5 20.7-15 0-49.4-19.7-76.4-19.7C63.3 141.2 4 184.8 4 273.5q0 39.3 14.4 81.2c12.8 36.7 59 126.7 107.2 125.2 25.2-.6 43-17.9 75.8-17.9 31.8 0 48.3 17.9 76.4 17.9 48.6-.7 90.4-82.5 102.6-119.3-65.2-30.7-61.7-90-61.7-91.9zm-56.6-164.2c27.3-32.4 24.8-61.9 24-72.5-24.1 1.4-52 16.4-67.9 34.9-17.5 19.8-27.8 44.3-25.6 71.9 26.1 2 49.9-11.4 69.5-34.3z"})})}function o({className:n}){return r.jsx("svg",{viewBox:"0 0 16 16",className:n,fill:"currentColor","aria-hidden":"true",children:r.jsx("path",{d:"M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z"})})}function t({className:n}){return r.jsx("svg",{viewBox:"0 0 24 24",className:n,fill:"currentColor","aria-hidden":"true",children:r.jsx("path",{d:"M3 5.46 10.2 4.5v6.92H3V5.46Zm0 13.08 7.2.96v-6.84H3v5.88Zm8.04 1.08L21 21V12.46h-9.96v7.16ZM11.04 4.38 21 3v8.46h-9.96V4.38Z"})})}export{e as A,o as G,t as W};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as n,j as $}from"./__vite-browser-external-
|
|
1
|
+
import{r as n,j as $}from"./__vite-browser-external-BRzJpYc1.js";import{M as D,a as S,u as A,b as F,P as K,c as U,L as W}from"./react-D9H9IC9r.js";function I(e,r){if(typeof e=="function")return e(r);e!=null&&(e.current=r)}function B(...e){return r=>{let t=!1;const o=e.map(l=>{const c=I(l,r);return!t&&typeof c=="function"&&(t=!0),c});if(t)return()=>{for(let l=0;l<o.length;l++){const c=o[l];typeof c=="function"?c():I(e[l],null)}}}}function G(...e){return n.useCallback(B(...e),e)}class V extends n.Component{getSnapshotBeforeUpdate(r){const t=this.props.childRef.current;if(S(t)&&r.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const o=t.offsetParent,l=S(o)&&o.offsetWidth||0,c=S(o)&&o.offsetHeight||0,p=getComputedStyle(t),s=this.props.sizeRef.current;s.height=parseFloat(p.height),s.width=parseFloat(p.width),s.top=t.offsetTop,s.left=t.offsetLeft,s.right=l-s.width-s.left,s.bottom=c-s.height-s.top,s.direction=p.direction}return null}componentDidUpdate(){}render(){return this.props.children}}function X({children:e,isPresent:r,anchorX:t,anchorY:o,root:l,pop:c}){const p=n.useId(),s=n.useRef(null),y=n.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:E}=n.useContext(D),a=e.props?.ref??e?.ref,M=G(s,a);return n.useInsertionEffect(()=>{const{width:u,height:d,top:x,left:C,right:f,bottom:R,direction:L}=y.current;if(r||c===!1||!s.current||!u||!d)return;const b=L==="rtl",g=t==="left"?b?`right: ${f}`:`left: ${C}`:b?`left: ${C}`:`right: ${f}`,j=o==="bottom"?`bottom: ${R}`:`top: ${x}`;s.current.dataset.motionPopId=p;const h=document.createElement("style");E&&(h.nonce=E);const P=l??document.head;return P.appendChild(h),h.sheet&&h.sheet.insertRule(`
|
|
2
2
|
[data-motion-pop-id="${p}"] {
|
|
3
3
|
position: absolute !important;
|
|
4
4
|
width: ${u}px !important;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as u}from"./__vite-browser-external-
|
|
1
|
+
import{r as u}from"./__vite-browser-external-BRzJpYc1.js";var c={},p=()=>{window.va||(window.va=function(...r){window.vaq||(window.vaq=[]),window.vaq.push(r)})},m="@vercel/analytics",E="2.0.1";function l(){return typeof window<"u"}function w(){try{const e="production"}catch{}return"production"}function y(e="auto"){if(e==="auto"){window.vam=w();return}window.vam=e}function h(){return(l()?window.vam:w())||"production"}function v(){return h()==="production"}function d(){return h()==="development"}function g(e,{[e]:r,...i}){return i}function _(e,r){if(!e)return;let i=e;const n=[];for(const[t,o]of Object.entries(e))typeof o=="object"&&o!==null&&(r.strip?i=g(t,i):n.push(t));if(n.length>0&&!r.strip)throw Error(`The following properties are not valid: ${n.join(", ")}. Only strings, numbers, booleans, and null are allowed.`);return i}function S(e){return e.scriptSrc?a(e.scriptSrc):d()?"https://va.vercel-scripts.com/v1/script.debug.js":e.basePath?a(`${e.basePath}/insights/script.js`):"/_vercel/insights/script.js"}function k(e,r){var i;let n=e;if(r)try{n={...(i=JSON.parse(r))==null?void 0:i.analytics,...e}}catch{}y(n.mode);const t={sdkn:m+(n.framework?`/${n.framework}`:""),sdkv:E};return n.disableAutoTrack&&(t.disableAutoTrack="1"),n.viewEndpoint&&(t.viewEndpoint=a(n.viewEndpoint)),n.eventEndpoint&&(t.eventEndpoint=a(n.eventEndpoint)),n.sessionEndpoint&&(t.sessionEndpoint=a(n.sessionEndpoint)),d()&&n.debug===!1&&(t.debug="false"),n.dsn&&(t.dsn=n.dsn),n.endpoint?t.endpoint=n.endpoint:n.basePath&&(t.endpoint=a(`${n.basePath}/insights`)),{beforeSend:n.beforeSend,src:S(n),dataset:t}}function a(e){return e.startsWith("http://")||e.startsWith("https://")||e.startsWith("/")?e:`/${e}`}function P(e={debug:!0},r){var i;if(!l())return;const{beforeSend:n,src:t,dataset:o}=k(e,r);if(p(),n&&((i=window.va)==null||i.call(window,"beforeSend",n)),document.head.querySelector(`script[src*="${t}"]`))return;const s=document.createElement("script");s.src=t;for(const[f,b]of Object.entries(o))s.dataset[f]=b;s.defer=!0,s.onerror=()=>{const f=d()?"Please check if any ad blockers are enabled and try again.":"Be sure to enable Web Analytics for your project and deploy again. See https://vercel.com/docs/analytics/quickstart for more information.";console.log(`[Vercel Web Analytics] Failed to load script from ${t}. ${f}`)},document.head.appendChild(s)}function C(e,r,i){var n,t;if(!l()){const o="[Vercel Web Analytics] Please import `track` from `@vercel/analytics/server` when using this function in a server environment";if(v())console.warn(o);else throw new Error(o);return}if(!r){(n=window.va)==null||n.call(window,"event",{name:e,options:i});return}try{const o=_(r,{strip:v()});(t=window.va)==null||t.call(window,"event",{name:e,data:o,options:i})}catch(o){o instanceof Error&&d()&&console.error(o)}}function A({route:e,path:r}){var i;(i=window.va)==null||i.call(window,"pageview",{route:e,path:r})}function T(){if(!(typeof process>"u"||typeof c>"u"))return c.REACT_APP_VERCEL_OBSERVABILITY_BASEPATH}function j(){if(!(typeof process>"u"||typeof c>"u"))return c.REACT_APP_VERCEL_OBSERVABILITY_CLIENT_CONFIG}function $(e){return u.useEffect(()=>{var r;e.beforeSend&&((r=window.va)==null||r.call(window,"beforeSend",e.beforeSend))},[e.beforeSend]),u.useEffect(()=>{P({framework:e.framework||"react",basePath:e.basePath??T(),...e.route!==void 0&&{disableAutoTrack:!0},...e},e.configString??j())},[]),u.useEffect(()=>{e.route&&e.path&&A({route:e.route,path:e.path})},[e.route,e.path]),null}export{$ as Analytics,C as track};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as c}from"./__vite-browser-external-
|
|
1
|
+
import{r as c}from"./__vite-browser-external-BRzJpYc1.js";var u={},p=()=>{window.si||(window.si=function(...i){window.siq=window.siq||[],window.siq.push(i)})},h="@vercel/speed-insights",g="2.0.0";function w(){return typeof window<"u"}function S(){try{const e="production"}catch{}return"production"}function l(){return S()==="development"}function k(e,i){if(!e||!i)return e;let n=e;try{const t=Object.entries(i);for(const[r,o]of t)if(!Array.isArray(o)){const s=d(o);s.test(n)&&(n=n.replace(s,`/[${r}]`))}for(const[r,o]of t)if(Array.isArray(o)){const s=d(o.join("/"));s.test(n)&&(n=n.replace(s,`/[...${r}]`))}return n}catch{return e}}function d(e){return new RegExp(`/${b(e)}(?=[/?#]|$)`)}function b(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function m(e){return e.scriptSrc?f(e.scriptSrc):l()?"https://va.vercel-scripts.com/v1/speed-insights/script.debug.js":e.dsn?"https://va.vercel-scripts.com/v1/speed-insights/script.js":e.basePath?f(`${e.basePath}/speed-insights/script.js`):"/_vercel/speed-insights/script.js"}function E(e,i){var n;let t=e;if(i)try{t={...(n=JSON.parse(i))==null?void 0:n.speedInsights,...e}}catch{}const r={sdkn:h+(t.framework?`/${t.framework}`:""),sdkv:g};return t.sampleRate&&(r.sampleRate=t.sampleRate.toString()),t.route&&(r.route=t.route),l()&&t.debug===!1&&(r.debug="false"),t.dsn&&(r.dsn=t.dsn),t.endpoint?r.endpoint=f(t.endpoint):t.basePath&&(r.endpoint=f(`${t.basePath}/speed-insights/vitals`)),{src:m(t),beforeSend:t.beforeSend,dataset:r}}function f(e){return e.startsWith("http://")||e.startsWith("https://")||e.startsWith("/")?e:`/${e}`}function y(e={},i){var n;if(!w()||e.route===null)return null;p();const{beforeSend:t,src:r,dataset:o}=E(e,i);if(document.head.querySelector(`script[src*="${r}"]`))return null;t&&((n=window.si)==null||n.call(window,"beforeSend",t));const s=document.createElement("script");s.src=r,s.defer=!0;for(const[a,v]of Object.entries(o))s.dataset[a]=v;return s.onerror=()=>{console.log(`[Vercel Speed Insights] Failed to load script from ${r}. Please check if any content blockers are enabled and try again.`)},document.head.appendChild(s),{setRoute:a=>{s.dataset.route=a??void 0}}}function R(){if(!(typeof process>"u"||typeof u>"u"))return u.REACT_APP_VERCEL_OBSERVABILITY_BASEPATH}function _(){if(!(typeof process>"u"||typeof u>"u"))return u.REACT_APP_VERCEL_OBSERVABILITY_CLIENT_CONFIG}function P(e){c.useEffect(()=>{var n;e.beforeSend&&((n=window.si)==null||n.call(window,"beforeSend",e.beforeSend))},[e.beforeSend]);const i=c.useRef(null);return c.useEffect(()=>{if(!i.current){const n=y({framework:e.framework??"react",basePath:e.basePath??R(),...e},e.configString??_());n&&(i.current=n.setRoute)}},[e]),c.useEffect(()=>{i.current&&e.route&&i.current(e.route)},[e.route]),null}export{P as SpeedInsights,k as computeRoute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{k as o}from"./__vite-browser-external-
|
|
1
|
+
import{k as o}from"./__vite-browser-external-BRzJpYc1.js";const c=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],t=o("info",c);export{t as I};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as r}from"./__vite-browser-external-
|
|
1
|
+
import{c as r}from"./__vite-browser-external-BRzJpYc1.js";const t=["claude","codex","cursor","gemini","kimi","kiro","grok","copilot","antigravity","zcode","opencodeGo"],e={claude:"CLAUDE",codex:"CODEX",cursor:"CURSOR",gemini:"GEMINI",kimi:"KIMI",kiro:"KIRO",grok:"GROK",copilot:"COPILOT",antigravity:"ANTIGRAVITY",zcode:"ZCODE",opencodeGo:"OPENCODE"};function c(i){return e[i]||null}function n(i){switch(i){case"claude":return r("limits.provider.claude");case"codex":return r("limits.provider.codex");case"cursor":return r("limits.provider.cursor");case"gemini":return r("limits.provider.gemini");case"kimi":return r("limits.provider.kimi");case"kiro":return r("limits.provider.kiro");case"grok":return r("limits.provider.grok");case"copilot":return r("limits.provider.copilot");case"antigravity":return r("limits.provider.antigravity");case"zcode":return r("limits.provider.zcode");case"opencodeGo":return r("limits.provider.opencode_go");default:return String(i||"")}}export{t as L,c as a,n as l};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{k as e}from"./__vite-browser-external-
|
|
1
|
+
import{k as e}from"./__vite-browser-external-BRzJpYc1.js";const o=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],t=e("link-2",o);export{t as L};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{k as e}from"./__vite-browser-external-
|
|
1
|
+
import{k as e}from"./__vite-browser-external-BRzJpYc1.js";const o=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],a=e("loader-circle",o);export{a as L};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{k as Ne,r as i,j as e,c as n,U as Ie,a4 as He,a5 as Ge,X as Oe,Z as qe}from"./__vite-browser-external-DWKjPxnU.js";import{u as Ze}from"./useCurrency-Dt2GqkDm.js";import{u as Ae}from"./useTokenFormat-dnqZK7Z-.js";import{M as Ke,T as Ve}from"./terminal-DBXjwlTm.js";import{I as Je}from"./info-F-75j15K.js";const Qe=[["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"}]],et=Ne("pause",Qe);const tt=[["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"}]],at=Ne("play",tt);const rt=[["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"}]],ot=Ne("rotate-ccw",rt),te={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 nt(s,x){const h=/^#([0-9a-f]{6})$/i.exec(s);if(!h)return s;const c=parseInt(h[1],16),v=c>>16&255,D=c>>8&255,Y=c&255,R=T=>Math.max(0,Math.min(255,Math.round(T*x)));return`rgb(${R(v)}, ${R(D)}, ${R(Y)})`}function O(s,x,h,c,v){const D=Math.cos(c),Y=Math.sin(c),R=s*D-x*Y,T=s*Y+x*D,A=h,S=Math.cos(v),$=Math.sin(v),q=R,p=T*S-A*$,k=T*$+A*S;return{x:q,y:p,z:k}}function st(s,x,h,c,v){return O(s,x,h,c,v)}function Ee(s,x,h=c=>Number(c).toLocaleString()){const c=h(x);if(s>=4){const v=Math.floor(Math.random()*3)+1;return n(`heatmap.3d.voxel.joke.${v}`,{value:c})}else return s===3?n("heatmap.3d.voxel.level3",{value:c}):s===2?n("heatmap.3d.voxel.level2",{value:c}):s===1?n("heatmap.3d.voxel.level1",{value:c}):n("heatmap.3d.voxel.level0")}function Se({weeks:s,palette:x="auto",isDark:h=!1,interactive:c=!1,autoRotateInit:v=!1,onResetViewRef:D=null}){const{formatTokens:Y,formatTokensTooltip:R}=Ae(),T=te[x]||(x==="auto"?te.emerald:null),A=T?h?T.dark:T.light:Array.isArray(x)?x:h?te.emerald.dark:te.emerald.light,S=T?h?T.gridColor.dark:T.gridColor.light:h?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.06)",$=-.2,q=.88,[p,k]=i.useState({yaw:$,pitch:q}),[ce,Z]=i.useState(v),[he,L]=i.useState(1),C=c?13:10.5,fe=i.useMemo(()=>{const t=[],r=s.length;if(r===0||!c)return[];for(let l=0;l<=7;l++){const o=(l-3.5)*C,d=O(-r/2*C,o,0,p.yaw,p.pitch),u=O(r/2*C,o,0,p.yaw,p.pitch);t.push({d:`M${d.x},${d.y} L${u.x},${u.y}`,key:`horiz-${l}`})}for(let l=0;l<=r;l+=4){const o=(l-r/2)*C,d=O(o,-3.5*C,0,p.yaw,p.pitch),u=O(o,3.5*C,0,p.yaw,p.pitch);t.push({d:`M${d.x},${d.y} L${u.x},${u.y}`,key:`vert-${l}`})}if(r%4!==0){const l=(r-r/2)*C,o=O(l,-3.5*C,0,p.yaw,p.pitch),d=O(l,3.5*C,0,p.yaw,p.pitch);t.push({d:`M${o.x},${o.y} L${d.x},${d.y}`,key:"vert-last"})}return t},[s.length,p,C,c]);i.useEffect(()=>{D&&(D.current={reset:()=>{k({yaw:$,pitch:q}),Z(!1),L(1),be()},toggleAutoRotate:t=>{Z(t)}})},[D]);const K=i.useRef(null),I=i.useRef(null),F=i.useRef(!1),de=i.useRef({x:0,y:0}),V=i.useRef({yaw:$,pitch:q}),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),J=i.useRef(null),se=i.useRef(!0);i.useEffect(()=>(se.current=!0,()=>{se.current=!1}),[]);const be=()=>{J.current&&cancelAnimationFrame(J.current),ye(0);const t=performance.now(),r=1200,l=o=>{if(!se.current)return;const d=o-t,u=Math.min(1,d/r),j=1-Math.pow(1-u,3);ye(j),u<1?J.current=requestAnimationFrame(l):J.current=null};J.current=requestAnimationFrame(l)};i.useEffect(()=>(be(),()=>{J.current&&cancelAnimationFrame(J.current)}),[c]),i.useEffect(()=>{if(!ce||F.current||typeof window>"u"||typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches)return;let r;const l=()=>{if(typeof document<"u"&&document.visibilityState==="hidden"){r=requestAnimationFrame(l);return}k(o=>({yaw:o.yaw+.002,pitch:o.pitch})),r=requestAnimationFrame(l)};return r=requestAnimationFrame(l),()=>cancelAnimationFrame(r)},[ce]);const me=(t,r)=>{c&&(F.current=!0,de.current={x:t,y:r},V.current={yaw:p.yaw,pitch:p.pitch},U.current={x:0,y:0},oe.current={x:t,y:r,time:performance.now()},ne.current&&cancelAnimationFrame(ne.current))},X=(t,r)=>{if(!F.current)return;const l=t-de.current.x,o=r-de.current.y,d=performance.now(),u=d-oe.current.time;u>0&&(U.current={x:(t-oe.current.x)/u,y:(r-oe.current.y)/u}),oe.current={x:t,y:r,time:d};const j=.005,f=V.current.yaw-l*j,g=Math.PI/2.3,P=Math.max(-g,Math.min(g,V.current.pitch-o*j));k({yaw:f,pitch:P})},ve=()=>{if(!F.current)return;F.current=!1;let t=-U.current.x*12,r=-U.current.y*12;const l=.95,o=()=>{F.current||(t*=l,r*=l,!(Math.abs(t)<.01&&Math.abs(r)<.01)&&(k(d=>{const u=d.yaw+t*.005,j=Math.PI/2.3,f=Math.max(-j,Math.min(j,d.pitch+r*.005));return{yaw:u,pitch:f}}),ne.current=requestAnimationFrame(o)))};ne.current=requestAnimationFrame(o)},[y,xe]=i.useState(null),[Q,pe]=i.useState({x:0,y:0,shiftX:0}),b=i.useRef(null);i.useEffect(()=>()=>{b.current&&clearTimeout(b.current)},[]),i.useEffect(()=>{if(!c||!I.current)return;const t=l=>{l.preventDefault();const o=-l.deltaY*.0025;L(d=>{const u=d+o;return Math.max(.5,Math.min(3,u))})},r=I.current;return r.addEventListener("wheel",t,{passive:!1}),()=>{r.removeEventListener("wheel",t)}},[c]);const z=i.useMemo(()=>{const t=[];return s.forEach((r,l)=>{(Array.isArray(r)?r:[]).forEach((o,d)=>{o&&t.push({key:o.day||`${l}-${d}`,col:l,row:d,level:o.level||0,value:o.value||0,day:o.day,models:o.models||null})})}),t},[s]),ke=C-(c?1.8:1.5),we=c?38:28,ee=t=>Math.max(1.8,Number(t)/4*we),ae=i.useMemo(()=>{if(z.length===0)return[];const t=s.length;return z.map(r=>{const l=ee(r.level),o=Math.sqrt(Math.pow(r.col-t/2,2)+Math.pow(r.row-3.5,2)),d=Math.sqrt(Math.pow(t/2,2)+Math.pow(3.5,2)),u=o/d*.4,j=Math.min(1,Math.max(0,(ge-u)*(1/.6))),f=l*j,g=(r.col-t/2)*C,P=(r.row-3.5)*C,N=ke/2,G=[{x:g-N,y:P-N,z:0},{x:g+N,y:P-N,z:0},{x:g+N,y:P+N,z:0},{x:g-N,y:P+N,z:0},{x:g-N,y:P-N,z:f},{x:g+N,y:P-N,z:f},{x:g+N,y:P+N,z:f},{x:g-N,y:P+N,z:f}].map(W=>O(W.x,W.y,W.z,p.yaw,p.pitch)),ue=O(g,P,f/2,p.yaw,p.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]}],Pe=A[Math.min(4,Math.max(0,Number(r.level)||0))],ze=[],De=.35,Ye=-.4,Ue=.83;return Le.forEach(W=>{const je=st(W.normal[0],W.normal[1],W.normal[2],p.yaw,p.pitch);if(je.z>.001){const Me=G[W.indices[0]],Te=G[W.indices[1]],_e=G[W.indices[2]],$e=G[W.indices[3]],Xe=`M${Me.x},${Me.y} L${Te.x},${Te.y} L${_e.x},${_e.y} L${$e.x},${$e.y} Z`,Be=je.x*De+je.y*Ye+je.z*Ue,We=h?.18:0,Fe=W.scale*(.82+.28*Math.max(0,Be))+We;ze.push({name:W.name,d:Xe,fill:nt(Pe,Fe)})}}),{...r,centerProj:ue,renderedFaces:ze}})},[z,p,A,s.length,ge,C,ke,we]),le=i.useMemo(()=>[...ae].sort((t,r)=>t.centerProj.z-r.centerProj.z),[ae]),_=i.useMemo(()=>{if(le.length===0)return{minX:-100,minY:-100,maxX:100,maxY:100};let t=1/0,r=1/0,l=-1/0,o=-1/0;return le.forEach(d=>{const u=C*2,j=d.centerProj.x,f=d.centerProj.y;j-u<t&&(t=j-u),j+u>l&&(l=j+u),f-u<r&&(r=f-u),f+u>o&&(o=f+u)}),{minX:t,minY:r,maxX:l,maxY:o}},[le,C]),E=12,a=_.maxX-_.minX+E*2,m=_.maxY-_.minY+E*2,M=a/he,w=m/he,B=_.minX-E+(a-M)/2,H=_.minY-E+(m-w)/2,ie=`${B} ${H} ${M} ${w}`;return z.length===0?e.jsx("div",{className:"py-8 text-center text-sm text-oai-gray-500",children:n("heatmap.empty")}):e.jsxs("div",{ref:I,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;me(t.clientX,t.clientY);const r=o=>X(o.clientX,o.clientY),l=()=>{ve(),window.removeEventListener("mousemove",r),window.removeEventListener("mouseup",l)};window.addEventListener("mousemove",r),window.addEventListener("mouseup",l)},onTouchStart:t=>{!c||t.touches.length===0||me(t.touches[0].clientX,t.touches[0].clientY)},onTouchMove:t=>{!c||t.touches.length===0||X(t.touches[0].clientX,t.touches[0].clientY)},onTouchEnd:()=>{c&&ve()},children:[e.jsxs("svg",{ref:K,viewBox:ie,width:c?"95%":"100%",height:c?"95%":"auto",role:"img","aria-label":n("heatmap.iso.aria")||"3D interactive activity heatmap",style:{display:"block",width:"100%",height:"auto",maxWidth:c?"none":`${a}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)),le.map(t=>{const r=y&&y.key===t.key;return e.jsxs("g",{onMouseEnter:l=>{if(b.current&&(clearTimeout(b.current),b.current=null),xe(t),c&&K.current){const o=O((t.col-s.length/2)*C,(t.row-3.5)*C,ee(t.level),p.yaw,p.pitch);let d=0,u=0;const j=K.current;if(I.current&&typeof j.createSVGPoint=="function"&&typeof j.getScreenCTM=="function")try{const N=j.createSVGPoint();N.x=o.x,N.y=o.y;const re=j.getScreenCTM();if(re){const G=N.matrixTransform(re),ue=I.current.getBoundingClientRect();d=G.x-ue.left,u=G.y-ue.top}}catch{const re=j.getBoundingClientRect(),G=_.maxX-_.minX+E*2,ue=_.maxY-_.minY+E*2;d=(o.x-(_.minX-E))/G*re.width,u=(o.y-(_.minY-E))/ue*re.height}else{const N=j.getBoundingClientRect(),re=_.maxX-_.minX+E*2,G=_.maxY-_.minY+E*2;d=(o.x-(_.minX-E))/re*N.width,u=(o.y-(_.minY-E))/G*N.height}const f=140;let g=0;const P=I.current?I.current.getBoundingClientRect().width:j.getBoundingClientRect().width;d<f?g=f-d:d>P-f&&(g=P-f-d),pe({x:d,y:u,shiftX:g})}},onMouseLeave:()=>{b.current&&clearTimeout(b.current),b.current=setTimeout(()=>{xe(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:`${t.day}: ${R(t.value)} tokens`}),t.renderedFaces.map((l,o)=>e.jsx("path",{d:l.d,fill:l.fill,stroke:l.fill,strokeWidth:.25,strokeLinejoin:"round"},o))]},t.key)})]}),c&&y&&e.jsxs("div",{onMouseEnter:()=>{b.current&&(clearTimeout(b.current),b.current=null)},onMouseLeave:()=>{b.current&&clearTimeout(b.current),b.current=setTimeout(()=>{xe(null)},150)},className:"absolute z-[9999] w-0 h-0 transition-all duration-100 ease-out",style:{left:`${Q.x}px`,top:`${Q.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% + ${Q.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:y.day}),(()=>{const t=y.level===0?h?"#9ca3af":"#6b7280":A[y.level];return e.jsxs("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:["Level ",y.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(y.value),className:"text-lg font-bold text-oai-gray-900 dark:text-white leading-none",children:Y(y.value)}),e.jsx("span",{className:"text-[10px] text-oai-gray-400 uppercase tracking-wider font-semibold",children:"Tokens"})]}),y.models&&Object.keys(y.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:"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(y.models).map(([t,r])=>({name:t,val:Number(r)})).sort((t,r)=>r.val-t.val).map(({name:t,val:r})=>{const l=Number(y.value)||1,o=Math.round(r/l*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:R(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:[o,"%"]})]})]}),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:`${o}%`,backgroundColor:A[4],boxShadow:`0 0 4px ${A[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:Ee(y.level,y.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 lt=12,it=3,ct=26,dt=["#ebedf0","#a7f3d0","#6ee7b7","#34d399","#10b981"],mt=["#121212","#065f46","#059669","#10b981","#34d399"];function xt(s){if(typeof s!="string")return null;const x=/^(\d{4})-(\d{2})-(\d{2})$/.exec(s.trim());if(!x)return null;const h=new Date(Date.UTC(Number(x[1]),Number(x[2])-1,Number(x[3])));return Number.isFinite(h.getTime())?h:null}function Re(s,x){return new Date(Date.UTC(s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate()+x))}function ut(s,x){return Math.floor((Date.UTC(x.getUTCFullYear(),x.getUTCMonth(),x.getUTCDate())-Date.UTC(s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate()))/864e5)}function pt(s,x){const h=x==="mon"?1:0,c=s.getUTCDay();return Re(s,-((c-h+7)%7))}function ht(s,x,h,c){if(!s)return[];const v=xt(x)||new Date,D=[];for(let S=11;S>=0;S-=1)D.push(new Date(Date.UTC(v.getUTCFullYear(),v.getUTCMonth()-S,1)));const Y=pt(v,h),R=Re(Y,-(s-1)*7),T=[],A=new Set;for(const S of D){const $=Math.floor(ut(R,S)/7);$<0||$>=s||A.has($)||(A.add($),T.push({label:c[S.getUTCMonth()],index:$}))}return T}function jt({heatmap:s,timeZoneLabel:x,timeZoneShortLabel:h,hideLegend:c=!1,embedded:v=!1}){const{resolvedTheme:D}=Ie(),{currency:Y,rate:R}=Ze(),{formatTokens:T,formatTokensTooltip:A}=Ae(),S=D==="dark",$=S?mt:dt,q=i.useRef(null),p=i.useRef(null),[k,ce]=i.useState(null),[Z,he]=i.useState({x:0,y:0,shiftX:0,flipY:!1}),L=i.useRef(null);i.useEffect(()=>()=>{L.current&&clearTimeout(L.current)},[]);const[C,fe]=i.useState(!1),[K,I]=i.useState(!1),[F,de]=i.useState(!1),V=i.useRef(null),[U,oe]=i.useState("emerald"),ne=[n("heatmap.month.jan"),n("heatmap.month.feb"),n("heatmap.month.mar"),n("heatmap.month.apr"),n("heatmap.month.may"),n("heatmap.month.jun"),n("heatmap.month.jul"),n("heatmap.month.aug"),n("heatmap.month.sep"),n("heatmap.month.oct"),n("heatmap.month.nov"),n("heatmap.month.dec")],ge=(a,m)=>{if(!m||!m.day)return;L.current&&(clearTimeout(L.current),L.current=null),ce(m);const M=a.currentTarget.getBoundingClientRect(),w=typeof window<"u"?window.innerWidth:1024,B=M.left+M.width/2,H=M.top<300,ie=H?M.bottom:M.top,t=140;let r=0;B<t?r=t-B:B>w-t&&(r=w-t-B),he({x:B,y:ie,shiftX:r,flipY:H})},ye=()=>{L.current&&clearTimeout(L.current),L.current=setTimeout(()=>{ce(null)},150)},J=()=>{I(!1),fe(!0)},se=()=>{I(!0)},be=a=>{a.target===a.currentTarget&&K&&(fe(!1),I(!1))};i.useEffect(()=>{if(!C||K)return;const a=m=>{m.key==="Escape"&&se()};return window.addEventListener("keydown",a),()=>{window.removeEventListener("keydown",a)}},[C,K]);const me=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"}}),[]),X=me[U]||me.emerald,ve=te[U]?S?te[U].dark:te[U].light:S?te.emerald.dark:te.emerald.light,[y,xe]=i.useState(()=>{if(v)return"2d";try{return window.localStorage?.getItem("tt:heatmap-view")==="3d"?"3d":"2d"}catch{return"2d"}});i.useEffect(()=>{if(!v)try{window.localStorage?.setItem("tt:heatmap-view",y)}catch{}},[y,v]),i.useEffect(()=>{if(y!=="2d")return;const a=q.current;a&&(a.scrollLeft=a.scrollWidth)},[s?.weeks,y]),i.useEffect(()=>{const a=q.current;if(!a)return;const m=()=>{L.current&&(clearTimeout(L.current),L.current=null),ce(null)};return a.addEventListener("scroll",m),()=>a.removeEventListener("scroll",m)},[]);const Q=s?.week_starts_on==="mon"?"mon":"sun",pe=i.useMemo(()=>{const a=Array.isArray(s?.weeks)?s.weeks:[];if(!a.length)return{weeks:[]};const m=[];for(const M of a)for(const w of Array.isArray(M)?M:[])w?.day&&m.push({day:w.day,total_tokens:w.total_tokens??w.value??0,billable_total_tokens:w.billable_total_tokens??w.value??w.total_tokens??0,models:w.models??null});return He({dailyRows:m,weeks:Math.max(52,a.length),to:s?.to,weekStartsOn:Q})},[s?.to,s?.weeks,Q]),b=pe?.weeks||[],z=i.useMemo(()=>{let a=0,m=0,M={day:"无数据",value:0},w=0,B=0;const H=[];b.forEach(f=>{(Array.isArray(f)?f:[]).forEach(g=>{g&&g.day&&H.push(g)})}),H.sort((f,g)=>f.day.localeCompare(g.day)),H.forEach(f=>{const g=Number(f.value)||0;a+=g,g>0?(m++,w++,w>B&&(B=w)):w=0,g>M.value&&(M={day:f.day,value:g})});const ie=H.length||365,t=(m/ie*100).toFixed(1);let r="heatmap.3d.modal.ai.eval.default",l="heatmap.3d.modal.ai.title.default";a>=15e6?(l="heatmap.3d.modal.ai.title.peak",r="heatmap.3d.modal.ai.eval.peak"):a>=5e6?(l="heatmap.3d.modal.ai.title.heavy",r="heatmap.3d.modal.ai.eval.heavy"):a>=1e6?(l="heatmap.3d.modal.ai.title.core",r="heatmap.3d.modal.ai.eval.core"):a>=2e4&&(l="heatmap.3d.modal.ai.title.steady",r="heatmap.3d.modal.ai.eval.steady");const o=s?.total_cost_usd,d=Number(o),j=o!=null&&(typeof o!="string"||o.trim()!=="")&&Number.isFinite(d)?d:a/15e5;return{totalTokens:a,activeDays:m,activeRate:t,maxSingleDay:M,maxStreak:B,aiEvaluationTitleKey:l,aiEvaluationKey:r,totalCostUsd:j}},[b,s?.total_cost_usd]),Ce=i.useMemo(()=>Ge(z.totalCostUsd,{currency:Y,rate:R}),[z.totalCostUsd,Y,R]),ke=Q==="mon"?["Mon","Tue","Wed","Thu","Fri","Sat","Sun"].map(a=>n(`heatmap.day.${a.toLowerCase()}`)):["Sun","Mon","Tue","Wed","Thu","Fri","Sat"].map(a=>n(`heatmap.day.${a.toLowerCase()}`)),we=i.useMemo(()=>ht(b.length,pe?.to,Q,ne),[pe?.to,b.length,Q,ne]);if(!b.length)return e.jsx("div",{className:"py-8 text-center text-sm text-oai-gray-500",children:n("heatmap.empty")});const ee=v?10:lt,ae=v?2:it,le=v?22:ct,_=le+b.length*ee+Math.max(0,b.length-1)*ae,E=`${le}px repeat(${b.length}, ${ee}px)`;return e.jsxs("div",{ref:p,className:v?"relative":"relative rounded-xl border border-oai-gray-200 dark:border-oai-gray-800 bg-white dark:bg-oai-gray-900 p-5",children:[!v&&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:n("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":y==="2d",onClick:()=>xe("2d"),className:y==="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:n("heatmap.view.2d")}),e.jsx("button",{type:"button",role:"tab","aria-selected":y==="3d",onClick:()=>xe("3d"),className:y==="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:n("heatmap.view.3d")})]}),e.jsx("span",{className:"text-xs text-oai-gray-400 dark:text-oai-gray-450",children:h||n("heatmap.legend.utc")})]})]}),y==="3d"&&e.jsxs("div",{onClick:J,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:n("heatmap.3d.hover_tip"),children:[e.jsx(Se,{weeks:b,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(Ke,{size:9}),n("heatmap.3d.hover_tip")]})})]}),y==="2d"&&e.jsx("div",{ref:q,className:`overflow-x-auto overflow-y-hidden heatmap-scroll-thin${v?"":" pb-1"}`,children:e.jsxs("div",{style:{minWidth:_},children:[e.jsxs("div",{className:"grid text-[10px] uppercase text-oai-gray-400 dark:text-oai-gray-400 mb-1",style:{gridTemplateColumns:E,columnGap:ae},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:E,columnGap:ae},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, ${ee}px)`,rowGap:ae},children:ke.map(a=>e.jsx("span",{className:"leading-none",children:a},a))}),e.jsx("div",{className:"grid",style:{gridAutoFlow:"column",gridTemplateRows:`repeat(7, ${ee}px)`,gap:ae},children:b.map((a,m)=>(Array.isArray(a)?a:[]).map((M,w)=>{if(!M)return null;const B=M.day||`e-${m}-${w}`,H=Number(M.level)||0,ie=$[H]||$[0];return e.jsx("span",{onMouseEnter:t=>ge(t,M),onMouseLeave:ye,className:"rounded-[2px] transition-transform hover:scale-125 hover:z-10 cursor-pointer",style:{width:ee,height:ee,background:ie}},B)}))})]})]})}),!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:n("heatmap.legend.less")}),e.jsx("div",{className:"flex gap-0.5",children:$.map((a,m)=>e.jsx("span",{className:"rounded-[1px]",style:{width:10,height:10,background:a}},m))}),e.jsx("span",{className:"text-[10px] text-oai-gray-400 dark:text-oai-gray-400",children:n("heatmap.legend.more")})]}),C&&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 ${K?"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 ${K?"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(Oe,{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:X.rawColor}}),e.jsx("span",{className:"relative inline-flex rounded-full h-1.5 w-1.5",style:{backgroundColor:X.rawColor}})]}),e.jsx("span",{className:"text-[9px] font-extrabold uppercase tracking-widest font-mono text-zinc-400 dark:text-zinc-500",children:"3D Insight"})]}),e.jsx("h4",{className:"text-xl font-black text-zinc-900 dark:text-zinc-50 tracking-tight leading-none mt-2 select-none",children:n("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:n("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:n("heatmap.3d.modal.stats.precision_total_tokens")}),e.jsxs("span",{className:"mt-0.5 font-bold text-zinc-900 dark:text-zinc-50",children:[A(z.totalTokens)," Tokens"]})]})}),e.jsx("span",{className:"text-[9px] font-bold text-zinc-400 dark:text-zinc-500 uppercase tracking-widest font-mono",children:n("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:T(z.totalTokens,{decimals:2})}),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:X.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:n("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:n("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:[z.activeRate,"% ",e.jsxs("span",{className:"text-[10px] font-bold text-zinc-400 dark:text-zinc-500 font-mono",children:["(",z.activeDays,"D)"]})]})]}),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:n("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:[z.maxStreak," ",e.jsx("span",{className:"text-[10px] font-bold text-amber-500/80 font-mono",children:n("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:n("heatmap.3d.modal.stats.precision_peak_value")}),e.jsxs("span",{className:"mt-0.5 font-bold text-zinc-900 dark:text-zinc-50",children:[z.maxSingleDay.value>0?A(z.maxSingleDay.value):n("heatmap.3d.modal.stats.no_data")," Tokens"]}),e.jsx("span",{className:"text-[8px] text-zinc-400 dark:text-zinc-500 mt-0.5",children:z.maxSingleDay.day!=="无数据"?z.maxSingleDay.day:n("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:n("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:[z.maxSingleDay.value>0?T(z.maxSingleDay.value,{decimals:2}):n("heatmap.3d.modal.stats.no_data")," ",e.jsxs("span",{className:"text-[10px] font-bold text-zinc-400 dark:text-zinc-500 font-mono",children:["(",z.maxSingleDay.day!=="无数据"?z.maxSingleDay.day:n("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(Ve,{size:11,style:{color:X.rawColor}}),e.jsx("span",{className:"text-[9px] font-extrabold uppercase tracking-widest font-mono",style:{color:X.rawColor},children:n(z.aiEvaluationTitleKey)})]}),e.jsxs("div",{className:"pl-3.5 border-l-2 relative transition-all duration-300 group",style:{borderColor:X.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:X.rawColor}}),e.jsx("p",{className:"text-[11px] leading-relaxed text-zinc-600 dark:text-zinc-400 font-normal",children:n(z.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:n("heatmap.3d.modal.legend.title")}),e.jsx("span",{className:"text-[10px] font-medium text-zinc-500 dark:text-zinc-400",children:n(`heatmap.3d.modal.palette.${U}`)})]}),e.jsx("div",{className:"flex gap-1",children:ve.map((a,m)=>e.jsx("div",{className:"flex-1 h-1 rounded-[2px]",style:{backgroundColor:a},title:`Level ${m}`},m))})]})})]}),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:X.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(me).map(a=>{const m=U===a;return e.jsx("button",{type:"button",onClick:()=>oe(a),title:n(`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:m&&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=!F;de(a),V.current&&V.current.toggleAutoRotate(a)},title:F?n("heatmap.3d.modal.control.pause"):n("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 ${F?X.accentText:"text-oai-gray-400 hover:text-oai-gray-600 dark:hover:text-oai-gray-250"}`,children:F?e.jsx(et,{size:12}):e.jsx(at,{size:12})}),e.jsx("button",{type:"button",onClick:()=>{de(!1),V.current&&V.current.reset()},title:n("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(ot,{size:12})})]})]}),e.jsx(Se,{weeks:b,isDark:S,interactive:!0,palette:U,autoRotateInit:F,onResetViewRef:V}),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(Je,{size:10,className:X.accentText}),e.jsx("span",{children:n("heatmap.3d.modal.footer.tip")})]})]})]})}),k&&!C&&typeof document<"u"&&qe.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:`${Z.x}px`,top:`${Z.y}px`},children:[e.jsxs("div",{className:`absolute left-0 ${Z.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% + ${Z.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:k.day}),(()=>{const a=k.level===0?S?"#9ca3af":"#6b7280":$[k.level];return e.jsxs("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:["Level ",k.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:A(k.total_tokens??k.value),className:"text-lg font-bold text-oai-gray-900 dark:text-white leading-none",children:T(k.total_tokens??k.value)}),e.jsx("span",{className:"text-[10px] text-oai-gray-400 uppercase tracking-wider font-semibold",children:"Tokens"})]}),k.models&&Object.keys(k.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:"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(k.models).map(([a,m])=>({name:a,val:Number(m)})).sort((a,m)=>m.val-a.val).map(({name:a,val:m})=>{const M=Number(k.total_tokens??k.value)||1,w=Math.round(m/M*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:A(m),className:"font-mono text-oai-gray-900 dark:text-oai-gray-100 font-semibold",children:T(m)}),e.jsxs("span",{className:"text-[9px] text-oai-gray-450 dark:text-oai-gray-500 min-w-[28px] text-right font-medium",children:[w,"%"]})]})]}),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:`${w}%`,backgroundColor:$[4],boxShadow:`0 0 4px ${$[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:Ee(k.level,k.total_tokens??k.value,T)})]})]}),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 ${Z.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:Z.flipY?{marginTop:"1px"}:{marginBottom:"1px"}})]}),document.body),e.jsx("style",{children:`
|
|
1
|
+
import{k as Ne,r as i,j as e,c as n,U as Ie,a4 as He,a5 as Ge,X as Oe,Z as qe}from"./__vite-browser-external-BRzJpYc1.js";import{u as Ze}from"./useCurrency-CKFbWGkT.js";import{u as Ae}from"./useTokenFormat-DTK4cojM.js";import{M as Ke,T as Ve}from"./terminal-4058d4_A.js";import{I as Je}from"./info-7xyGxNal.js";const Qe=[["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"}]],et=Ne("pause",Qe);const tt=[["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"}]],at=Ne("play",tt);const rt=[["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"}]],ot=Ne("rotate-ccw",rt),te={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 nt(s,x){const h=/^#([0-9a-f]{6})$/i.exec(s);if(!h)return s;const c=parseInt(h[1],16),v=c>>16&255,D=c>>8&255,Y=c&255,R=T=>Math.max(0,Math.min(255,Math.round(T*x)));return`rgb(${R(v)}, ${R(D)}, ${R(Y)})`}function O(s,x,h,c,v){const D=Math.cos(c),Y=Math.sin(c),R=s*D-x*Y,T=s*Y+x*D,A=h,S=Math.cos(v),$=Math.sin(v),q=R,p=T*S-A*$,k=T*$+A*S;return{x:q,y:p,z:k}}function st(s,x,h,c,v){return O(s,x,h,c,v)}function Ee(s,x,h=c=>Number(c).toLocaleString()){const c=h(x);if(s>=4){const v=Math.floor(Math.random()*3)+1;return n(`heatmap.3d.voxel.joke.${v}`,{value:c})}else return s===3?n("heatmap.3d.voxel.level3",{value:c}):s===2?n("heatmap.3d.voxel.level2",{value:c}):s===1?n("heatmap.3d.voxel.level1",{value:c}):n("heatmap.3d.voxel.level0")}function Se({weeks:s,palette:x="auto",isDark:h=!1,interactive:c=!1,autoRotateInit:v=!1,onResetViewRef:D=null}){const{formatTokens:Y,formatTokensTooltip:R}=Ae(),T=te[x]||(x==="auto"?te.emerald:null),A=T?h?T.dark:T.light:Array.isArray(x)?x:h?te.emerald.dark:te.emerald.light,S=T?h?T.gridColor.dark:T.gridColor.light:h?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.06)",$=-.2,q=.88,[p,k]=i.useState({yaw:$,pitch:q}),[ce,Z]=i.useState(v),[he,L]=i.useState(1),C=c?13:10.5,fe=i.useMemo(()=>{const t=[],r=s.length;if(r===0||!c)return[];for(let l=0;l<=7;l++){const o=(l-3.5)*C,d=O(-r/2*C,o,0,p.yaw,p.pitch),u=O(r/2*C,o,0,p.yaw,p.pitch);t.push({d:`M${d.x},${d.y} L${u.x},${u.y}`,key:`horiz-${l}`})}for(let l=0;l<=r;l+=4){const o=(l-r/2)*C,d=O(o,-3.5*C,0,p.yaw,p.pitch),u=O(o,3.5*C,0,p.yaw,p.pitch);t.push({d:`M${d.x},${d.y} L${u.x},${u.y}`,key:`vert-${l}`})}if(r%4!==0){const l=(r-r/2)*C,o=O(l,-3.5*C,0,p.yaw,p.pitch),d=O(l,3.5*C,0,p.yaw,p.pitch);t.push({d:`M${o.x},${o.y} L${d.x},${d.y}`,key:"vert-last"})}return t},[s.length,p,C,c]);i.useEffect(()=>{D&&(D.current={reset:()=>{k({yaw:$,pitch:q}),Z(!1),L(1),be()},toggleAutoRotate:t=>{Z(t)}})},[D]);const K=i.useRef(null),I=i.useRef(null),F=i.useRef(!1),de=i.useRef({x:0,y:0}),V=i.useRef({yaw:$,pitch:q}),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),J=i.useRef(null),se=i.useRef(!0);i.useEffect(()=>(se.current=!0,()=>{se.current=!1}),[]);const be=()=>{J.current&&cancelAnimationFrame(J.current),ye(0);const t=performance.now(),r=1200,l=o=>{if(!se.current)return;const d=o-t,u=Math.min(1,d/r),j=1-Math.pow(1-u,3);ye(j),u<1?J.current=requestAnimationFrame(l):J.current=null};J.current=requestAnimationFrame(l)};i.useEffect(()=>(be(),()=>{J.current&&cancelAnimationFrame(J.current)}),[c]),i.useEffect(()=>{if(!ce||F.current||typeof window>"u"||typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches)return;let r;const l=()=>{if(typeof document<"u"&&document.visibilityState==="hidden"){r=requestAnimationFrame(l);return}k(o=>({yaw:o.yaw+.002,pitch:o.pitch})),r=requestAnimationFrame(l)};return r=requestAnimationFrame(l),()=>cancelAnimationFrame(r)},[ce]);const me=(t,r)=>{c&&(F.current=!0,de.current={x:t,y:r},V.current={yaw:p.yaw,pitch:p.pitch},U.current={x:0,y:0},oe.current={x:t,y:r,time:performance.now()},ne.current&&cancelAnimationFrame(ne.current))},X=(t,r)=>{if(!F.current)return;const l=t-de.current.x,o=r-de.current.y,d=performance.now(),u=d-oe.current.time;u>0&&(U.current={x:(t-oe.current.x)/u,y:(r-oe.current.y)/u}),oe.current={x:t,y:r,time:d};const j=.005,f=V.current.yaw-l*j,g=Math.PI/2.3,P=Math.max(-g,Math.min(g,V.current.pitch-o*j));k({yaw:f,pitch:P})},ve=()=>{if(!F.current)return;F.current=!1;let t=-U.current.x*12,r=-U.current.y*12;const l=.95,o=()=>{F.current||(t*=l,r*=l,!(Math.abs(t)<.01&&Math.abs(r)<.01)&&(k(d=>{const u=d.yaw+t*.005,j=Math.PI/2.3,f=Math.max(-j,Math.min(j,d.pitch+r*.005));return{yaw:u,pitch:f}}),ne.current=requestAnimationFrame(o)))};ne.current=requestAnimationFrame(o)},[y,xe]=i.useState(null),[Q,pe]=i.useState({x:0,y:0,shiftX:0}),b=i.useRef(null);i.useEffect(()=>()=>{b.current&&clearTimeout(b.current)},[]),i.useEffect(()=>{if(!c||!I.current)return;const t=l=>{l.preventDefault();const o=-l.deltaY*.0025;L(d=>{const u=d+o;return Math.max(.5,Math.min(3,u))})},r=I.current;return r.addEventListener("wheel",t,{passive:!1}),()=>{r.removeEventListener("wheel",t)}},[c]);const z=i.useMemo(()=>{const t=[];return s.forEach((r,l)=>{(Array.isArray(r)?r:[]).forEach((o,d)=>{o&&t.push({key:o.day||`${l}-${d}`,col:l,row:d,level:o.level||0,value:o.value||0,day:o.day,models:o.models||null})})}),t},[s]),ke=C-(c?1.8:1.5),we=c?38:28,ee=t=>Math.max(1.8,Number(t)/4*we),ae=i.useMemo(()=>{if(z.length===0)return[];const t=s.length;return z.map(r=>{const l=ee(r.level),o=Math.sqrt(Math.pow(r.col-t/2,2)+Math.pow(r.row-3.5,2)),d=Math.sqrt(Math.pow(t/2,2)+Math.pow(3.5,2)),u=o/d*.4,j=Math.min(1,Math.max(0,(ge-u)*(1/.6))),f=l*j,g=(r.col-t/2)*C,P=(r.row-3.5)*C,N=ke/2,G=[{x:g-N,y:P-N,z:0},{x:g+N,y:P-N,z:0},{x:g+N,y:P+N,z:0},{x:g-N,y:P+N,z:0},{x:g-N,y:P-N,z:f},{x:g+N,y:P-N,z:f},{x:g+N,y:P+N,z:f},{x:g-N,y:P+N,z:f}].map(W=>O(W.x,W.y,W.z,p.yaw,p.pitch)),ue=O(g,P,f/2,p.yaw,p.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]}],Pe=A[Math.min(4,Math.max(0,Number(r.level)||0))],ze=[],De=.35,Ye=-.4,Ue=.83;return Le.forEach(W=>{const je=st(W.normal[0],W.normal[1],W.normal[2],p.yaw,p.pitch);if(je.z>.001){const Me=G[W.indices[0]],Te=G[W.indices[1]],_e=G[W.indices[2]],$e=G[W.indices[3]],Xe=`M${Me.x},${Me.y} L${Te.x},${Te.y} L${_e.x},${_e.y} L${$e.x},${$e.y} Z`,Be=je.x*De+je.y*Ye+je.z*Ue,We=h?.18:0,Fe=W.scale*(.82+.28*Math.max(0,Be))+We;ze.push({name:W.name,d:Xe,fill:nt(Pe,Fe)})}}),{...r,centerProj:ue,renderedFaces:ze}})},[z,p,A,s.length,ge,C,ke,we]),le=i.useMemo(()=>[...ae].sort((t,r)=>t.centerProj.z-r.centerProj.z),[ae]),_=i.useMemo(()=>{if(le.length===0)return{minX:-100,minY:-100,maxX:100,maxY:100};let t=1/0,r=1/0,l=-1/0,o=-1/0;return le.forEach(d=>{const u=C*2,j=d.centerProj.x,f=d.centerProj.y;j-u<t&&(t=j-u),j+u>l&&(l=j+u),f-u<r&&(r=f-u),f+u>o&&(o=f+u)}),{minX:t,minY:r,maxX:l,maxY:o}},[le,C]),E=12,a=_.maxX-_.minX+E*2,m=_.maxY-_.minY+E*2,M=a/he,w=m/he,B=_.minX-E+(a-M)/2,H=_.minY-E+(m-w)/2,ie=`${B} ${H} ${M} ${w}`;return z.length===0?e.jsx("div",{className:"py-8 text-center text-sm text-oai-gray-500",children:n("heatmap.empty")}):e.jsxs("div",{ref:I,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;me(t.clientX,t.clientY);const r=o=>X(o.clientX,o.clientY),l=()=>{ve(),window.removeEventListener("mousemove",r),window.removeEventListener("mouseup",l)};window.addEventListener("mousemove",r),window.addEventListener("mouseup",l)},onTouchStart:t=>{!c||t.touches.length===0||me(t.touches[0].clientX,t.touches[0].clientY)},onTouchMove:t=>{!c||t.touches.length===0||X(t.touches[0].clientX,t.touches[0].clientY)},onTouchEnd:()=>{c&&ve()},children:[e.jsxs("svg",{ref:K,viewBox:ie,width:c?"95%":"100%",height:c?"95%":"auto",role:"img","aria-label":n("heatmap.iso.aria")||"3D interactive activity heatmap",style:{display:"block",width:"100%",height:"auto",maxWidth:c?"none":`${a}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)),le.map(t=>{const r=y&&y.key===t.key;return e.jsxs("g",{onMouseEnter:l=>{if(b.current&&(clearTimeout(b.current),b.current=null),xe(t),c&&K.current){const o=O((t.col-s.length/2)*C,(t.row-3.5)*C,ee(t.level),p.yaw,p.pitch);let d=0,u=0;const j=K.current;if(I.current&&typeof j.createSVGPoint=="function"&&typeof j.getScreenCTM=="function")try{const N=j.createSVGPoint();N.x=o.x,N.y=o.y;const re=j.getScreenCTM();if(re){const G=N.matrixTransform(re),ue=I.current.getBoundingClientRect();d=G.x-ue.left,u=G.y-ue.top}}catch{const re=j.getBoundingClientRect(),G=_.maxX-_.minX+E*2,ue=_.maxY-_.minY+E*2;d=(o.x-(_.minX-E))/G*re.width,u=(o.y-(_.minY-E))/ue*re.height}else{const N=j.getBoundingClientRect(),re=_.maxX-_.minX+E*2,G=_.maxY-_.minY+E*2;d=(o.x-(_.minX-E))/re*N.width,u=(o.y-(_.minY-E))/G*N.height}const f=140;let g=0;const P=I.current?I.current.getBoundingClientRect().width:j.getBoundingClientRect().width;d<f?g=f-d:d>P-f&&(g=P-f-d),pe({x:d,y:u,shiftX:g})}},onMouseLeave:()=>{b.current&&clearTimeout(b.current),b.current=setTimeout(()=>{xe(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:`${t.day}: ${R(t.value)} tokens`}),t.renderedFaces.map((l,o)=>e.jsx("path",{d:l.d,fill:l.fill,stroke:l.fill,strokeWidth:.25,strokeLinejoin:"round"},o))]},t.key)})]}),c&&y&&e.jsxs("div",{onMouseEnter:()=>{b.current&&(clearTimeout(b.current),b.current=null)},onMouseLeave:()=>{b.current&&clearTimeout(b.current),b.current=setTimeout(()=>{xe(null)},150)},className:"absolute z-[9999] w-0 h-0 transition-all duration-100 ease-out",style:{left:`${Q.x}px`,top:`${Q.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% + ${Q.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:y.day}),(()=>{const t=y.level===0?h?"#9ca3af":"#6b7280":A[y.level];return e.jsxs("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:["Level ",y.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(y.value),className:"text-lg font-bold text-oai-gray-900 dark:text-white leading-none",children:Y(y.value)}),e.jsx("span",{className:"text-[10px] text-oai-gray-400 uppercase tracking-wider font-semibold",children:"Tokens"})]}),y.models&&Object.keys(y.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:"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(y.models).map(([t,r])=>({name:t,val:Number(r)})).sort((t,r)=>r.val-t.val).map(({name:t,val:r})=>{const l=Number(y.value)||1,o=Math.round(r/l*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:R(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:[o,"%"]})]})]}),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:`${o}%`,backgroundColor:A[4],boxShadow:`0 0 4px ${A[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:Ee(y.level,y.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 lt=12,it=3,ct=26,dt=["#ebedf0","#a7f3d0","#6ee7b7","#34d399","#10b981"],mt=["#121212","#065f46","#059669","#10b981","#34d399"];function xt(s){if(typeof s!="string")return null;const x=/^(\d{4})-(\d{2})-(\d{2})$/.exec(s.trim());if(!x)return null;const h=new Date(Date.UTC(Number(x[1]),Number(x[2])-1,Number(x[3])));return Number.isFinite(h.getTime())?h:null}function Re(s,x){return new Date(Date.UTC(s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate()+x))}function ut(s,x){return Math.floor((Date.UTC(x.getUTCFullYear(),x.getUTCMonth(),x.getUTCDate())-Date.UTC(s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate()))/864e5)}function pt(s,x){const h=x==="mon"?1:0,c=s.getUTCDay();return Re(s,-((c-h+7)%7))}function ht(s,x,h,c){if(!s)return[];const v=xt(x)||new Date,D=[];for(let S=11;S>=0;S-=1)D.push(new Date(Date.UTC(v.getUTCFullYear(),v.getUTCMonth()-S,1)));const Y=pt(v,h),R=Re(Y,-(s-1)*7),T=[],A=new Set;for(const S of D){const $=Math.floor(ut(R,S)/7);$<0||$>=s||A.has($)||(A.add($),T.push({label:c[S.getUTCMonth()],index:$}))}return T}function jt({heatmap:s,timeZoneLabel:x,timeZoneShortLabel:h,hideLegend:c=!1,embedded:v=!1}){const{resolvedTheme:D}=Ie(),{currency:Y,rate:R}=Ze(),{formatTokens:T,formatTokensTooltip:A}=Ae(),S=D==="dark",$=S?mt:dt,q=i.useRef(null),p=i.useRef(null),[k,ce]=i.useState(null),[Z,he]=i.useState({x:0,y:0,shiftX:0,flipY:!1}),L=i.useRef(null);i.useEffect(()=>()=>{L.current&&clearTimeout(L.current)},[]);const[C,fe]=i.useState(!1),[K,I]=i.useState(!1),[F,de]=i.useState(!1),V=i.useRef(null),[U,oe]=i.useState("emerald"),ne=[n("heatmap.month.jan"),n("heatmap.month.feb"),n("heatmap.month.mar"),n("heatmap.month.apr"),n("heatmap.month.may"),n("heatmap.month.jun"),n("heatmap.month.jul"),n("heatmap.month.aug"),n("heatmap.month.sep"),n("heatmap.month.oct"),n("heatmap.month.nov"),n("heatmap.month.dec")],ge=(a,m)=>{if(!m||!m.day)return;L.current&&(clearTimeout(L.current),L.current=null),ce(m);const M=a.currentTarget.getBoundingClientRect(),w=typeof window<"u"?window.innerWidth:1024,B=M.left+M.width/2,H=M.top<300,ie=H?M.bottom:M.top,t=140;let r=0;B<t?r=t-B:B>w-t&&(r=w-t-B),he({x:B,y:ie,shiftX:r,flipY:H})},ye=()=>{L.current&&clearTimeout(L.current),L.current=setTimeout(()=>{ce(null)},150)},J=()=>{I(!1),fe(!0)},se=()=>{I(!0)},be=a=>{a.target===a.currentTarget&&K&&(fe(!1),I(!1))};i.useEffect(()=>{if(!C||K)return;const a=m=>{m.key==="Escape"&&se()};return window.addEventListener("keydown",a),()=>{window.removeEventListener("keydown",a)}},[C,K]);const me=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"}}),[]),X=me[U]||me.emerald,ve=te[U]?S?te[U].dark:te[U].light:S?te.emerald.dark:te.emerald.light,[y,xe]=i.useState(()=>{if(v)return"2d";try{return window.localStorage?.getItem("tt:heatmap-view")==="3d"?"3d":"2d"}catch{return"2d"}});i.useEffect(()=>{if(!v)try{window.localStorage?.setItem("tt:heatmap-view",y)}catch{}},[y,v]),i.useEffect(()=>{if(y!=="2d")return;const a=q.current;a&&(a.scrollLeft=a.scrollWidth)},[s?.weeks,y]),i.useEffect(()=>{const a=q.current;if(!a)return;const m=()=>{L.current&&(clearTimeout(L.current),L.current=null),ce(null)};return a.addEventListener("scroll",m),()=>a.removeEventListener("scroll",m)},[]);const Q=s?.week_starts_on==="mon"?"mon":"sun",pe=i.useMemo(()=>{const a=Array.isArray(s?.weeks)?s.weeks:[];if(!a.length)return{weeks:[]};const m=[];for(const M of a)for(const w of Array.isArray(M)?M:[])w?.day&&m.push({day:w.day,total_tokens:w.total_tokens??w.value??0,billable_total_tokens:w.billable_total_tokens??w.value??w.total_tokens??0,models:w.models??null});return He({dailyRows:m,weeks:Math.max(52,a.length),to:s?.to,weekStartsOn:Q})},[s?.to,s?.weeks,Q]),b=pe?.weeks||[],z=i.useMemo(()=>{let a=0,m=0,M={day:"无数据",value:0},w=0,B=0;const H=[];b.forEach(f=>{(Array.isArray(f)?f:[]).forEach(g=>{g&&g.day&&H.push(g)})}),H.sort((f,g)=>f.day.localeCompare(g.day)),H.forEach(f=>{const g=Number(f.value)||0;a+=g,g>0?(m++,w++,w>B&&(B=w)):w=0,g>M.value&&(M={day:f.day,value:g})});const ie=H.length||365,t=(m/ie*100).toFixed(1);let r="heatmap.3d.modal.ai.eval.default",l="heatmap.3d.modal.ai.title.default";a>=15e6?(l="heatmap.3d.modal.ai.title.peak",r="heatmap.3d.modal.ai.eval.peak"):a>=5e6?(l="heatmap.3d.modal.ai.title.heavy",r="heatmap.3d.modal.ai.eval.heavy"):a>=1e6?(l="heatmap.3d.modal.ai.title.core",r="heatmap.3d.modal.ai.eval.core"):a>=2e4&&(l="heatmap.3d.modal.ai.title.steady",r="heatmap.3d.modal.ai.eval.steady");const o=s?.total_cost_usd,d=Number(o),j=o!=null&&(typeof o!="string"||o.trim()!=="")&&Number.isFinite(d)?d:a/15e5;return{totalTokens:a,activeDays:m,activeRate:t,maxSingleDay:M,maxStreak:B,aiEvaluationTitleKey:l,aiEvaluationKey:r,totalCostUsd:j}},[b,s?.total_cost_usd]),Ce=i.useMemo(()=>Ge(z.totalCostUsd,{currency:Y,rate:R}),[z.totalCostUsd,Y,R]),ke=Q==="mon"?["Mon","Tue","Wed","Thu","Fri","Sat","Sun"].map(a=>n(`heatmap.day.${a.toLowerCase()}`)):["Sun","Mon","Tue","Wed","Thu","Fri","Sat"].map(a=>n(`heatmap.day.${a.toLowerCase()}`)),we=i.useMemo(()=>ht(b.length,pe?.to,Q,ne),[pe?.to,b.length,Q,ne]);if(!b.length)return e.jsx("div",{className:"py-8 text-center text-sm text-oai-gray-500",children:n("heatmap.empty")});const ee=v?10:lt,ae=v?2:it,le=v?22:ct,_=le+b.length*ee+Math.max(0,b.length-1)*ae,E=`${le}px repeat(${b.length}, ${ee}px)`;return e.jsxs("div",{ref:p,className:v?"relative":"relative rounded-xl border border-oai-gray-200 dark:border-oai-gray-800 bg-white dark:bg-oai-gray-900 p-5",children:[!v&&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:n("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":y==="2d",onClick:()=>xe("2d"),className:y==="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:n("heatmap.view.2d")}),e.jsx("button",{type:"button",role:"tab","aria-selected":y==="3d",onClick:()=>xe("3d"),className:y==="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:n("heatmap.view.3d")})]}),e.jsx("span",{className:"text-xs text-oai-gray-400 dark:text-oai-gray-450",children:h||n("heatmap.legend.utc")})]})]}),y==="3d"&&e.jsxs("div",{onClick:J,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:n("heatmap.3d.hover_tip"),children:[e.jsx(Se,{weeks:b,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(Ke,{size:9}),n("heatmap.3d.hover_tip")]})})]}),y==="2d"&&e.jsx("div",{ref:q,className:`overflow-x-auto overflow-y-hidden heatmap-scroll-thin${v?"":" pb-1"}`,children:e.jsxs("div",{style:{minWidth:_},children:[e.jsxs("div",{className:"grid text-[10px] uppercase text-oai-gray-400 dark:text-oai-gray-400 mb-1",style:{gridTemplateColumns:E,columnGap:ae},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:E,columnGap:ae},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, ${ee}px)`,rowGap:ae},children:ke.map(a=>e.jsx("span",{className:"leading-none",children:a},a))}),e.jsx("div",{className:"grid",style:{gridAutoFlow:"column",gridTemplateRows:`repeat(7, ${ee}px)`,gap:ae},children:b.map((a,m)=>(Array.isArray(a)?a:[]).map((M,w)=>{if(!M)return null;const B=M.day||`e-${m}-${w}`,H=Number(M.level)||0,ie=$[H]||$[0];return e.jsx("span",{onMouseEnter:t=>ge(t,M),onMouseLeave:ye,className:"rounded-[2px] transition-transform hover:scale-125 hover:z-10 cursor-pointer",style:{width:ee,height:ee,background:ie}},B)}))})]})]})}),!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:n("heatmap.legend.less")}),e.jsx("div",{className:"flex gap-0.5",children:$.map((a,m)=>e.jsx("span",{className:"rounded-[1px]",style:{width:10,height:10,background:a}},m))}),e.jsx("span",{className:"text-[10px] text-oai-gray-400 dark:text-oai-gray-400",children:n("heatmap.legend.more")})]}),C&&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 ${K?"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 ${K?"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(Oe,{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:X.rawColor}}),e.jsx("span",{className:"relative inline-flex rounded-full h-1.5 w-1.5",style:{backgroundColor:X.rawColor}})]}),e.jsx("span",{className:"text-[9px] font-extrabold uppercase tracking-widest font-mono text-zinc-400 dark:text-zinc-500",children:"3D Insight"})]}),e.jsx("h4",{className:"text-xl font-black text-zinc-900 dark:text-zinc-50 tracking-tight leading-none mt-2 select-none",children:n("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:n("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:n("heatmap.3d.modal.stats.precision_total_tokens")}),e.jsxs("span",{className:"mt-0.5 font-bold text-zinc-900 dark:text-zinc-50",children:[A(z.totalTokens)," Tokens"]})]})}),e.jsx("span",{className:"text-[9px] font-bold text-zinc-400 dark:text-zinc-500 uppercase tracking-widest font-mono",children:n("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:T(z.totalTokens,{decimals:2})}),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:X.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:n("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:n("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:[z.activeRate,"% ",e.jsxs("span",{className:"text-[10px] font-bold text-zinc-400 dark:text-zinc-500 font-mono",children:["(",z.activeDays,"D)"]})]})]}),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:n("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:[z.maxStreak," ",e.jsx("span",{className:"text-[10px] font-bold text-amber-500/80 font-mono",children:n("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:n("heatmap.3d.modal.stats.precision_peak_value")}),e.jsxs("span",{className:"mt-0.5 font-bold text-zinc-900 dark:text-zinc-50",children:[z.maxSingleDay.value>0?A(z.maxSingleDay.value):n("heatmap.3d.modal.stats.no_data")," Tokens"]}),e.jsx("span",{className:"text-[8px] text-zinc-400 dark:text-zinc-500 mt-0.5",children:z.maxSingleDay.day!=="无数据"?z.maxSingleDay.day:n("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:n("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:[z.maxSingleDay.value>0?T(z.maxSingleDay.value,{decimals:2}):n("heatmap.3d.modal.stats.no_data")," ",e.jsxs("span",{className:"text-[10px] font-bold text-zinc-400 dark:text-zinc-500 font-mono",children:["(",z.maxSingleDay.day!=="无数据"?z.maxSingleDay.day:n("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(Ve,{size:11,style:{color:X.rawColor}}),e.jsx("span",{className:"text-[9px] font-extrabold uppercase tracking-widest font-mono",style:{color:X.rawColor},children:n(z.aiEvaluationTitleKey)})]}),e.jsxs("div",{className:"pl-3.5 border-l-2 relative transition-all duration-300 group",style:{borderColor:X.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:X.rawColor}}),e.jsx("p",{className:"text-[11px] leading-relaxed text-zinc-600 dark:text-zinc-400 font-normal",children:n(z.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:n("heatmap.3d.modal.legend.title")}),e.jsx("span",{className:"text-[10px] font-medium text-zinc-500 dark:text-zinc-400",children:n(`heatmap.3d.modal.palette.${U}`)})]}),e.jsx("div",{className:"flex gap-1",children:ve.map((a,m)=>e.jsx("div",{className:"flex-1 h-1 rounded-[2px]",style:{backgroundColor:a},title:`Level ${m}`},m))})]})})]}),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:X.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(me).map(a=>{const m=U===a;return e.jsx("button",{type:"button",onClick:()=>oe(a),title:n(`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:m&&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=!F;de(a),V.current&&V.current.toggleAutoRotate(a)},title:F?n("heatmap.3d.modal.control.pause"):n("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 ${F?X.accentText:"text-oai-gray-400 hover:text-oai-gray-600 dark:hover:text-oai-gray-250"}`,children:F?e.jsx(et,{size:12}):e.jsx(at,{size:12})}),e.jsx("button",{type:"button",onClick:()=>{de(!1),V.current&&V.current.reset()},title:n("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(ot,{size:12})})]})]}),e.jsx(Se,{weeks:b,isDark:S,interactive:!0,palette:U,autoRotateInit:F,onResetViewRef:V}),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(Je,{size:10,className:X.accentText}),e.jsx("span",{children:n("heatmap.3d.modal.footer.tip")})]})]})]})}),k&&!C&&typeof document<"u"&&qe.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:`${Z.x}px`,top:`${Z.y}px`},children:[e.jsxs("div",{className:`absolute left-0 ${Z.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% + ${Z.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:k.day}),(()=>{const a=k.level===0?S?"#9ca3af":"#6b7280":$[k.level];return e.jsxs("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:["Level ",k.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:A(k.total_tokens??k.value),className:"text-lg font-bold text-oai-gray-900 dark:text-white leading-none",children:T(k.total_tokens??k.value)}),e.jsx("span",{className:"text-[10px] text-oai-gray-400 uppercase tracking-wider font-semibold",children:"Tokens"})]}),k.models&&Object.keys(k.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:"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(k.models).map(([a,m])=>({name:a,val:Number(m)})).sort((a,m)=>m.val-a.val).map(({name:a,val:m})=>{const M=Number(k.total_tokens??k.value)||1,w=Math.round(m/M*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:A(m),className:"font-mono text-oai-gray-900 dark:text-oai-gray-100 font-semibold",children:T(m)}),e.jsxs("span",{className:"text-[9px] text-oai-gray-450 dark:text-oai-gray-500 min-w-[28px] text-right font-medium",children:[w,"%"]})]})]}),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:`${w}%`,backgroundColor:$[4],boxShadow:`0 0 4px ${$[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:Ee(k.level,k.total_tokens??k.value,T)})]})]}),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 ${Z.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:Z.flipY?{marginTop:"1px"}:{marginBottom:"1px"}})]}),document.body),e.jsx("style",{children:`
|
|
2
2
|
@keyframes tt-fade-in {
|
|
3
3
|
from { opacity: 0; }
|
|
4
4
|
to { opacity: 1; }
|