ccgauge 0.4.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/.next/standalone/.next/BUILD_ID +1 -1
  2. package/.next/standalone/.next/app-build-manifest.json +42 -42
  3. package/.next/standalone/.next/app-path-routes-manifest.json +7 -7
  4. package/.next/standalone/.next/build-manifest.json +2 -2
  5. package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  6. package/.next/standalone/.next/server/app/api/blocks/route.js +1 -1
  7. package/.next/standalone/.next/server/app/api/blocks/route_client-reference-manifest.js +1 -1
  8. package/.next/standalone/.next/server/app/api/export/usage/route.js +1 -1
  9. package/.next/standalone/.next/server/app/api/export/usage/route.js.nft.json +1 -1
  10. package/.next/standalone/.next/server/app/api/export/usage/route_client-reference-manifest.js +1 -1
  11. package/.next/standalone/.next/server/app/api/pricing/route.js +1 -1
  12. package/.next/standalone/.next/server/app/api/pricing/route_client-reference-manifest.js +1 -1
  13. package/.next/standalone/.next/server/app/api/projects/route.js +1 -1
  14. package/.next/standalone/.next/server/app/api/projects/route_client-reference-manifest.js +1 -1
  15. package/.next/standalone/.next/server/app/api/scan/route.js +1 -1
  16. package/.next/standalone/.next/server/app/api/scan/route_client-reference-manifest.js +1 -1
  17. package/.next/standalone/.next/server/app/api/sessions/route.js +1 -1
  18. package/.next/standalone/.next/server/app/api/sessions/route_client-reference-manifest.js +1 -1
  19. package/.next/standalone/.next/server/app/api/usage/route.js +1 -1
  20. package/.next/standalone/.next/server/app/api/usage/route_client-reference-manifest.js +1 -1
  21. package/.next/standalone/.next/server/app/models/page_client-reference-manifest.js +1 -1
  22. package/.next/standalone/.next/server/app/page.js +2 -2
  23. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  24. package/.next/standalone/.next/server/app/projects/[id]/page_client-reference-manifest.js +1 -1
  25. package/.next/standalone/.next/server/app/projects/page.js +1 -1
  26. package/.next/standalone/.next/server/app/projects/page_client-reference-manifest.js +1 -1
  27. package/.next/standalone/.next/server/app/sessions/[id]/page_client-reference-manifest.js +1 -1
  28. package/.next/standalone/.next/server/app/sessions/page.js +1 -1
  29. package/.next/standalone/.next/server/app/sessions/page_client-reference-manifest.js +1 -1
  30. package/.next/standalone/.next/server/app/settings/page.js +2 -2
  31. package/.next/standalone/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  32. package/.next/standalone/.next/server/app/usage/page.js +2 -2
  33. package/.next/standalone/.next/server/app/usage/page_client-reference-manifest.js +1 -1
  34. package/.next/standalone/.next/server/app-paths-manifest.json +7 -7
  35. package/.next/standalone/.next/server/chunks/426.js +9 -4
  36. package/.next/standalone/.next/server/chunks/716.js +1 -1
  37. package/.next/standalone/.next/server/chunks/775.js +1 -1
  38. package/.next/standalone/.next/server/functions-config-manifest.json +3 -3
  39. package/.next/standalone/.next/server/pages/500.html +1 -1
  40. package/.next/standalone/.next/static/chunks/148-557ee562aff993b1.js +1 -0
  41. package/.next/standalone/.next/static/chunks/app/{error-89ee9e078058915d.js → error-3e48784f89c5ae8d.js} +1 -1
  42. package/.next/standalone/.next/static/chunks/app/layout-6c973d790f015707.js +1 -0
  43. package/.next/standalone/.next/static/chunks/app/models/page-dff43b9050382020.js +1 -0
  44. package/.next/standalone/.next/static/chunks/app/page-6d87d7a8aa752100.js +1 -0
  45. package/.next/standalone/.next/static/chunks/app/projects/[id]/page-3f812f0e20137f2b.js +1 -0
  46. package/.next/standalone/.next/static/chunks/app/sessions/[id]/page-3f812f0e20137f2b.js +1 -0
  47. package/.next/standalone/.next/static/chunks/app/settings/{page-334168b522eac1b1.js → page-d1af886a5c22af9b.js} +1 -1
  48. package/.next/standalone/.next/static/chunks/app/usage/page-26297e0641d51da8.js +1 -0
  49. package/.next/standalone/.next/static/css/b07523b7c353538d.css +3 -0
  50. package/.next/standalone/node_modules/next/node_modules/postcss/package.json +0 -0
  51. package/.next/standalone/package.json +15 -4
  52. package/CHANGELOG.md +147 -0
  53. package/README.md +41 -2
  54. package/README.zh-CN.md +39 -2
  55. package/bin/cli.mjs +83 -3
  56. package/dist/mcp/server.mjs +71 -29
  57. package/dist/report/index.mjs +2098 -0
  58. package/package.json +26 -17
  59. package/.next/standalone/.next/static/chunks/454-d0e7d0fa6f643c41.js +0 -1
  60. package/.next/standalone/.next/static/chunks/app/layout-a6e30ba3a7f39737.js +0 -1
  61. package/.next/standalone/.next/static/chunks/app/models/page-e0e1b5979547421a.js +0 -1
  62. package/.next/standalone/.next/static/chunks/app/page-9347dfa20dabb24b.js +0 -1
  63. package/.next/standalone/.next/static/chunks/app/projects/[id]/page-5804875e3dc384df.js +0 -1
  64. package/.next/standalone/.next/static/chunks/app/sessions/[id]/page-5804875e3dc384df.js +0 -1
  65. package/.next/standalone/.next/static/chunks/app/usage/page-7789fec27778df9a.js +0 -1
  66. package/.next/standalone/.next/static/css/c34cd36ce5fc39e2.css +0 -3
  67. /package/.next/standalone/.next/static/{w_l54xHgbhALYXmZcmUxC → ZPycmg0NLiIflO5NXMT75}/_buildManifest.js +0 -0
  68. /package/.next/standalone/.next/static/{w_l54xHgbhALYXmZcmUxC → ZPycmg0NLiIflO5NXMT75}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- exports.id=716,exports.ids=[716],exports.modules={31519:(a,b,c)=>{"use strict";c.d(b,{Q:()=>e,V:()=>d});let d={"claude-opus-4-7":{input:5,output:25,cacheCreation5m:6.25,cacheCreation1h:10,cacheRead:.5},"claude-opus-4-6":{input:5,output:25,cacheCreation5m:6.25,cacheCreation1h:10,cacheRead:.5},"claude-opus-4-5":{input:5,output:25,cacheCreation5m:6.25,cacheCreation1h:10,cacheRead:.5},"claude-sonnet-4-6":{input:3,output:15,cacheCreation5m:3.75,cacheCreation1h:6,cacheRead:.3},"claude-sonnet-4-5":{input:3,output:15,cacheCreation5m:3.75,cacheCreation1h:6,cacheRead:.3},"claude-haiku-4-5":{input:1,output:5,cacheCreation5m:1.25,cacheCreation1h:2,cacheRead:.1},"claude-haiku-3-5":{input:.8,output:4,cacheCreation5m:1,cacheCreation1h:1.6,cacheRead:.08},"claude-opus-4-1":{input:15,output:75,cacheCreation5m:18.75,cacheCreation1h:30,cacheRead:1.5},"claude-opus-4":{input:15,output:75,cacheCreation5m:18.75,cacheCreation1h:30,cacheRead:1.5},"claude-sonnet-4":{input:3,output:15,cacheCreation5m:3.75,cacheCreation1h:6,cacheRead:.3},"claude-sonnet-3-7":{input:3,output:15,cacheCreation5m:3.75,cacheCreation1h:6,cacheRead:.3},"claude-haiku-3":{input:.25,output:1.25,cacheCreation5m:.3,cacheCreation1h:.5,cacheRead:.03}},e={opus:d["claude-opus-4-7"],sonnet:d["claude-sonnet-4-6"],haiku:d["claude-haiku-4-5"]}},60704:(a,b,c)=>{"use strict";c.d(b,{Gr:()=>A,Fw:()=>F,sO:()=>B,rl:()=>D,R0:()=>C});var d=c(73024),e=c(76760),f=c.n(e),g=c(48161),h=c.n(g),i=c(80481),j=c.n(i);async function k(a){let b=(0,d.createReadStream)(a,{encoding:"utf8"}),c=j().createInterface({input:b,crlfDelay:1/0}),e=[],f=[],g=[];for await(let b of c){let c;if(b.trim()){try{c=JSON.parse(b)}catch{continue}if(c&&"object"==typeof c){if(c.uuid&&g.push([c.uuid,c.parentUuid??null]),"assistant"===c.type){let b=function(a,b){let c=a.message;if(!c)return null;let d=c.usage;if(!d)return null;let e=c.model??"";if(!e||"<synthetic>"===e)return null;let f=c.id??a.uuid??"";if(!f&&!a.requestId)return null;let g=d.cache_creation,h=Array.isArray(c.content)?c.content:[],i=[],j=!1,k="";for(let a of h)"tool_use"===a.type&&"string"==typeof a.name?i.push(a.name):"thinking"===a.type?j=!0:"text"!==a.type||"string"!=typeof a.text||k||(k=a.text.slice(0,200));return{type:"assistant",source:"claude",uuid:a.uuid??f,parentUuid:a.parentUuid??null,timestamp:a.timestamp??new Date().toISOString(),sessionId:a.sessionId??"",requestId:a.requestId??"",cwd:a.cwd??"",gitBranch:a.gitBranch,version:a.version,model:e,messageId:f,usage:{input_tokens:Number(d.input_tokens)||0,output_tokens:Number(d.output_tokens)||0,cache_creation_input_tokens:Number(d.cache_creation_input_tokens)||0,cache_read_input_tokens:Number(d.cache_read_input_tokens)||0,cache_creation_5m:Number(g?.ephemeral_5m_input_tokens)||0,cache_creation_1h:Number(g?.ephemeral_1h_input_tokens)||0},toolNames:i,hasThinking:j,textPreview:k,filePath:b}}(c,a);b&&e.push(b)}else if("user"===c.type){let b=function(a,b){if(!a.uuid)return null;let c=a.message,d="";if(c){let a=c.content;if("string"==typeof a)d=a.slice(0,200);else if(Array.isArray(a)){for(let b of a)if("text"===b.type&&"string"==typeof b.text){d=b.text.slice(0,200);break}}}return{type:"user",source:"claude",uuid:a.uuid,parentUuid:a.parentUuid??null,timestamp:a.timestamp??new Date().toISOString(),sessionId:a.sessionId??"",cwd:a.cwd??"",textPreview:d,filePath:b}}(c,a);b&&f.push(b)}}}}return{assistant:e,user:f,parentLinks:g}}var l=c(31519);function m(a,b){if(!b)return{input:0,output:0,cacheCreation5m:0,cacheCreation1h:0,cacheRead:0,total:0,saved:0};let c=a.input_tokens/1e6*b.input,d=a.output_tokens/1e6*b.output,e=a.cache_creation_5m/1e6*b.cacheCreation5m,f=a.cache_creation_1h/1e6*b.cacheCreation1h;e+f===0&&a.cache_creation_input_tokens>0&&(e=a.cache_creation_input_tokens/1e6*b.cacheCreation5m);let g=a.cache_read_input_tokens/1e6*b.cacheRead,h=c+d+e+f+g;return{input:c,output:d,cacheCreation5m:e,cacheCreation1h:f,cacheRead:g,total:h,saved:a.cache_read_input_tokens/1e6*(b.input-b.cacheRead)}}function n(a){return a.replace(/\b\w/g,a=>a.toUpperCase())}let o=/-\d{8}$/,p=/^(vertex_ai|bedrock|anthropic)\//;async function q(a){try{let b=await d.promises.stat(a);return new Date(b.mtimeMs).toISOString()}catch{return new Date().toISOString()}}function r(a){return"string"==typeof a?a:""}function s(a){let b=Number(a);return Number.isFinite(b)?b:0}function t(a){let b=a.message;if("string"==typeof b)return b;let c=a.content;if("string"==typeof c)return c;if(Array.isArray(c))for(let a of c){let b=a?.type;if(("input_text"===b||"output_text"===b||"text"===b)&&"string"==typeof a.text)return a.text}return""}async function u(a){let b,c=(0,d.createReadStream)(a,{encoding:"utf8"}),e=j().createInterface({input:c,crlfDelay:1/0}),f=[],g=[],h=[],i="",k="",l=0,m=0,n=null,o=await q(a),p={turnId:null,cwd:"",model:"gpt-unknown",userUuid:null,toolNames:[],hasThinking:!1,pendingTextPreview:""};for await(let c of e){let d;if(!c.trim())continue;try{d=JSON.parse(c)}catch{continue}if(!d||"object"!=typeof d||!d.type)continue;let e=d.payload??{},j=r(d.timestamp),q=j||o;if(j&&(o=j),"session_meta"===d.type){i=r(e.id),k=r(e.cwd),b=r(e.cli_version)||void 0;let a=r(e.timestamp);a&&(o=a),p.cwd||(p.cwd=k);continue}if("turn_context"===d.type){p.turnId=r(e.turn_id)||p.turnId,p.cwd=r(e.cwd)||k;let a=r(e.model);a&&(p.model=a);let b=r(e.effort);b&&(p.effort=b),p.toolNames=[],p.hasThinking=!1,p.pendingTextPreview="";continue}if("event_msg"===d.type){let c=r(e.type);if("user_message"===c){let b=t(e);if(!b)continue;let c=`${i}::u${l++}`;g.push({type:"user",source:"codex",uuid:c,parentUuid:null,timestamp:q,sessionId:i,cwd:p.cwd||k,textPreview:b.slice(0,200),filePath:a}),h.push([c,null]),p.userUuid=c;continue}if("agent_message"===c){let a=t(e);a&&!p.pendingTextPreview&&(p.pendingTextPreview=a.slice(0,200));continue}if("agent_reasoning"===c){p.hasThinking=!0;continue}if("token_count"===c){let c,d,g,j,l=e.info;if(!l)continue;let o=l.total_token_usage,r=l.last_token_usage,t=o?{input:s(o.input_tokens),cached:s(o.cached_input_tokens),output:s(o.output_tokens),reasoning:s(o.reasoning_output_tokens)}:null;if(t){if(null===n?(c=t.input,d=t.cached,g=t.output,j=t.reasoning):(c=Math.max(0,t.input-n.input),d=Math.max(0,t.cached-n.cached),g=Math.max(0,t.output-n.output),j=Math.max(0,t.reasoning-n.reasoning)),0===c&&0===d&&0===g&&0===j)continue;n=null===n?{...t}:{input:Math.max(n.input,t.input),cached:Math.max(n.cached,t.cached),output:Math.max(n.output,t.output),reasoning:Math.max(n.reasoning,t.reasoning)}}else if(!r)continue;else if(c=s(r.input_tokens),d=s(r.cached_input_tokens),g=s(r.output_tokens),j=s(r.reasoning_output_tokens),0===c&&0===d&&0===g&&0===j)continue;let u=`${i}::a${m++}`,v=p.turnId?`${p.turnId}::a${m}`:`${i}::a${m}`;f.push({type:"assistant",source:"codex",uuid:u,parentUuid:p.userUuid,timestamp:q,sessionId:i,requestId:v,cwd:p.cwd||k,version:b,model:p.model||"gpt-unknown",messageId:v,usage:{input_tokens:Math.max(0,c-d),output_tokens:g+j,cache_creation_input_tokens:0,cache_read_input_tokens:d,cache_creation_5m:0,cache_creation_1h:0,reasoning_tokens:j},toolNames:[...p.toolNames],hasThinking:p.hasThinking,textPreview:p.pendingTextPreview,filePath:a}),h.push([u,p.userUuid]),p.toolNames=[],p.hasThinking=!1,p.pendingTextPreview=""}continue}if("response_item"===d.type){let a=r(e.type);if("function_call"===a||"custom_tool_call"===a){let a=r(e.name);a&&p.toolNames.push(a);continue}if("reasoning"===a){p.hasThinking=!0;continue}if("message"===a&&"assistant"===r(e.role)){let a=t(e);a&&!p.pendingTextPreview&&(p.pendingTextPreview=a.slice(0,200))}continue}}return{assistant:f,user:g,parentLinks:h}}var v=c(71310);let w={mini:"Mini",nano:"Nano",pro:"Pro",turbo:"Turbo",preview:"Preview"},x={id:"codex",displayName:{en:"Codex",zh:"Codex"},shortLabel:"X",color:{fg:"#047857",bg:"#d1fae5"},parserVersion:"codex-v3-reasoning-detail",capabilities:{hasCacheCreation:!1,hasReasoningTokens:!0,blockWindowMs:18e6},getDirs:function(){let a=h().homedir(),b=[f().join(a,".codex","sessions"),f().join(a,".codex","archived_sessions")];return process.env.CCGAUGE_CODEX_DIR&&b.push(process.env.CCGAUGE_CODEX_DIR),process.env.CODEX_HOME&&(b.push(f().join(process.env.CODEX_HOME,"sessions")),b.push(f().join(process.env.CODEX_HOME,"archived_sessions"))),Array.from(new Set(b))},shouldSkipDir:()=>!1,parseFile:u,resolvePricing:v.E7,shortenModel:function(a){if(!a)return"(unknown)";let b=a.replace(/^openai\//,"");return b.toLowerCase().startsWith("gpt-")?"GPT-"+b.slice(4).split("-").map(a=>w[a.toLowerCase()]??a).join(" "):b.toLowerCase().startsWith("o")?b.toUpperCase():b.replace(/-/g," ").replace(/\b\w/g,a=>a.toUpperCase())},costFromUsage:m,costFootnoteKey:"cost.footnote.codex"},y={claude:{id:"claude",displayName:{en:"Claude",zh:"Claude"},shortLabel:"C",color:{fg:"#b45309",bg:"#fef3c7"},parserVersion:"claude-v1",capabilities:{hasCacheCreation:!0,hasReasoningTokens:!1,blockWindowMs:18e6},getDirs:function(){let a=h().homedir(),b=[f().join(a,".claude","projects"),f().join(a,".config","claude","projects")];return process.env.CCGAUGE_CONFIG_DIR&&b.push(f().join(process.env.CCGAUGE_CONFIG_DIR,"projects")),process.env.CLAUDE_CONFIG_DIR&&b.push(f().join(process.env.CLAUDE_CONFIG_DIR,"projects")),Array.from(new Set(b))},shouldSkipDir:a=>"tool-results"===a||"memory"===a,parseFile:async a=>await k(a),resolvePricing:function(a){if(!a)return{pricing:null,matchType:"none",matchedKey:null};if(l.V[a])return{pricing:l.V[a],matchType:"exact",matchedKey:a};let b=a.replace(o,"");if(l.V[b])return{pricing:l.V[b],matchType:"date-stripped",matchedKey:b};let c=b.replace(p,"");if(l.V[c])return{pricing:l.V[c],matchType:"prefix-stripped",matchedKey:c};for(let b of["opus","sonnet","haiku"])if(a.toLowerCase().includes(b))return{pricing:l.Q[b],matchType:"family-fallback",matchedKey:`claude-${b}-(latest)`};return{pricing:null,matchType:"none",matchedKey:null}},shortenModel:function(a){if(!a)return"(unknown)";let b=a.replace(/-(\d{8})$/,"").replace(/^(vertex_ai|bedrock|anthropic)\//,""),c=(b=b.replace(/^claude-/,"")).split("-");if(c.length>=2){let a=c[0],b=c.slice(1).join(".");return n(a)+" "+b}return n(b.replace(/-/g," "))},costFromUsage:m,costFootnoteKey:null},codex:x},z=["claude","codex"],A="claude";function B(a){return y[a]}function C(){return z.map(a=>y[a])}function D(a){return"string"==typeof a&&("claude"===a||"codex"===a)}async function E(a){try{return(await d.promises.stat(a)).isDirectory()}catch{return!1}}async function F(){let a=[];for(let b of C())for(let c of b.getDirs())if(await E(c)){a.push(b.id);break}return a}},71310:(a,b,c)=>{"use strict";c.d(b,{E7:()=>h,_G:()=>d});let d={"gpt-5":{input:1.25,output:10,cacheRead:.13,cacheCreation5m:0,cacheCreation1h:0},"gpt-5-mini":{input:.25,output:2,cacheRead:.025,cacheCreation5m:0,cacheCreation1h:0},"gpt-5-nano":{input:.05,output:.4,cacheRead:.005,cacheCreation5m:0,cacheCreation1h:0},"gpt-5.4":{input:1.25,output:10,cacheRead:.13,cacheCreation5m:0,cacheCreation1h:0},"gpt-5.5":{input:1.25,output:10,cacheRead:.13,cacheCreation5m:0,cacheCreation1h:0},"gpt-5.5-mini":{input:.25,output:2,cacheRead:.025,cacheCreation5m:0,cacheCreation1h:0},"gpt-5.5-nano":{input:.05,output:.4,cacheRead:.005,cacheCreation5m:0,cacheCreation1h:0},"gpt-4.1":{input:2,output:8,cacheRead:.5,cacheCreation5m:0,cacheCreation1h:0},"gpt-4.1-mini":{input:.4,output:1.6,cacheRead:.1,cacheCreation5m:0,cacheCreation1h:0},o3:{input:2,output:8,cacheRead:.5,cacheCreation5m:0,cacheCreation1h:0},"o4-mini":{input:1.1,output:4.4,cacheRead:.275,cacheCreation5m:0,cacheCreation1h:0}},e={gpt:d["gpt-5"],o:d.o3},f=/-\d{8}$/,g=/^(openai)\//;function h(a){if(!a)return{pricing:null,matchType:"none",matchedKey:null};if(d[a])return{pricing:d[a],matchType:"exact",matchedKey:a};let b=a.replace(f,"");if(d[b])return{pricing:d[b],matchType:"date-stripped",matchedKey:b};let c=b.replace(g,"");if(d[c])return{pricing:d[c],matchType:"prefix-stripped",matchedKey:c};let h=a.toLowerCase();return h.startsWith("gpt-")||"gpt"===h?{pricing:e.gpt,matchType:"family-fallback",matchedKey:"gpt-(latest)"}:/^o\d/.test(h)?{pricing:e.o,matchType:"family-fallback",matchedKey:"o-(latest)"}:{pricing:null,matchType:"none",matchedKey:null}}},78335:()=>{},96487:()=>{}};
1
+ exports.id=716,exports.ids=[716],exports.modules={31519:(a,b,c)=>{"use strict";c.d(b,{Q:()=>e,V:()=>d});let d={"claude-opus-4-7":{input:5,output:25,cacheCreation5m:6.25,cacheCreation1h:10,cacheRead:.5},"claude-opus-4-6":{input:5,output:25,cacheCreation5m:6.25,cacheCreation1h:10,cacheRead:.5},"claude-opus-4-5":{input:5,output:25,cacheCreation5m:6.25,cacheCreation1h:10,cacheRead:.5},"claude-sonnet-4-6":{input:3,output:15,cacheCreation5m:3.75,cacheCreation1h:6,cacheRead:.3},"claude-sonnet-4-5":{input:3,output:15,cacheCreation5m:3.75,cacheCreation1h:6,cacheRead:.3},"claude-haiku-4-5":{input:1,output:5,cacheCreation5m:1.25,cacheCreation1h:2,cacheRead:.1},"claude-haiku-3-5":{input:.8,output:4,cacheCreation5m:1,cacheCreation1h:1.6,cacheRead:.08},"claude-opus-4-1":{input:15,output:75,cacheCreation5m:18.75,cacheCreation1h:30,cacheRead:1.5},"claude-opus-4":{input:15,output:75,cacheCreation5m:18.75,cacheCreation1h:30,cacheRead:1.5},"claude-sonnet-4":{input:3,output:15,cacheCreation5m:3.75,cacheCreation1h:6,cacheRead:.3},"claude-sonnet-3-7":{input:3,output:15,cacheCreation5m:3.75,cacheCreation1h:6,cacheRead:.3},"claude-haiku-3":{input:.25,output:1.25,cacheCreation5m:.3,cacheCreation1h:.5,cacheRead:.03}},e={opus:d["claude-opus-4-7"],sonnet:d["claude-sonnet-4-6"],haiku:d["claude-haiku-4-5"]}},60704:(a,b,c)=>{"use strict";c.d(b,{Gr:()=>A,Fw:()=>F,sO:()=>B,rl:()=>D,R0:()=>C});var d=c(73024),e=c(76760),f=c.n(e),g=c(48161),h=c.n(g),i=c(80481),j=c.n(i);async function k(a){let b=(0,d.createReadStream)(a,{encoding:"utf8"}),c=j().createInterface({input:b,crlfDelay:1/0}),e=[],f=[],g=[];for await(let b of c){let c;if(b.trim()){try{c=JSON.parse(b)}catch{continue}if(c&&"object"==typeof c){if(c.uuid&&g.push([c.uuid,c.parentUuid??null]),"assistant"===c.type){let b=function(a,b){let c=a.message;if(!c)return null;let d=c.usage;if(!d)return null;let e=c.model??"";if(!e||"<synthetic>"===e)return null;let f=c.id??a.uuid??"";if(!f&&!a.requestId)return null;let g=d.cache_creation,h=Array.isArray(c.content)?c.content:[],i=[],j=!1,k="";for(let a of h)"tool_use"===a.type&&"string"==typeof a.name?i.push(a.name):"thinking"===a.type?j=!0:"text"!==a.type||"string"!=typeof a.text||k||(k=a.text.slice(0,200));return{type:"assistant",source:"claude",uuid:a.uuid??f,parentUuid:a.parentUuid??null,timestamp:a.timestamp??new Date().toISOString(),sessionId:a.sessionId??"",requestId:a.requestId??"",cwd:a.cwd??"",gitBranch:a.gitBranch,version:a.version,model:e,messageId:f,usage:{input_tokens:Number(d.input_tokens)||0,output_tokens:Number(d.output_tokens)||0,cache_creation_input_tokens:Number(d.cache_creation_input_tokens)||0,cache_read_input_tokens:Number(d.cache_read_input_tokens)||0,cache_creation_5m:Number(g?.ephemeral_5m_input_tokens)||0,cache_creation_1h:Number(g?.ephemeral_1h_input_tokens)||0},toolNames:i,hasThinking:j,textPreview:k,filePath:b}}(c,a);b&&e.push(b)}else if("user"===c.type){let b=function(a,b){if(!a.uuid)return null;let c=a.message,d="";if(c){let a=c.content;if("string"==typeof a)d=a.slice(0,200);else if(Array.isArray(a)){for(let b of a)if("text"===b.type&&"string"==typeof b.text){d=b.text.slice(0,200);break}}}let e=!!d&&function(a){let b=a.trimStart();return!!(b.startsWith("Base directory for this skill:")||b.startsWith("<system-reminder>")||b.startsWith("Caveat: The messages below were generated by"))}(d);return{type:"user",source:"claude",uuid:a.uuid,parentUuid:a.parentUuid??null,timestamp:a.timestamp??new Date().toISOString(),sessionId:a.sessionId??"",cwd:a.cwd??"",textPreview:d,isSynthetic:e,filePath:b}}(c,a);b&&f.push(b)}}}}return{assistant:e,user:f,parentLinks:g}}var l=c(31519);function m(a,b){if(!b)return{input:0,output:0,cacheCreation5m:0,cacheCreation1h:0,cacheRead:0,total:0,saved:0};let c=a.input_tokens/1e6*b.input,d=a.output_tokens/1e6*b.output,e=a.cache_creation_5m/1e6*b.cacheCreation5m,f=a.cache_creation_1h/1e6*b.cacheCreation1h;e+f===0&&a.cache_creation_input_tokens>0&&(e=a.cache_creation_input_tokens/1e6*b.cacheCreation5m);let g=a.cache_read_input_tokens/1e6*b.cacheRead,h=c+d+e+f+g;return{input:c,output:d,cacheCreation5m:e,cacheCreation1h:f,cacheRead:g,total:h,saved:a.cache_read_input_tokens/1e6*(b.input-b.cacheRead)}}function n(a){return a.replace(/\b\w/g,a=>a.toUpperCase())}let o=/-\d{8}$/,p=/^(vertex_ai|bedrock|anthropic)\//;async function q(a){try{let b=await d.promises.stat(a);return new Date(b.mtimeMs).toISOString()}catch{return new Date().toISOString()}}function r(a){return"string"==typeof a?a:""}function s(a){let b=Number(a);return Number.isFinite(b)?b:0}function t(a){let b=a.message;if("string"==typeof b)return b;let c=a.content;if("string"==typeof c)return c;if(Array.isArray(c))for(let a of c){let b=a?.type;if(("input_text"===b||"output_text"===b||"text"===b)&&"string"==typeof a.text)return a.text}return""}async function u(a){let b,c=(0,d.createReadStream)(a,{encoding:"utf8"}),e=j().createInterface({input:c,crlfDelay:1/0}),f=[],g=[],h=[],i="",k="",l=0,m=0,n=null,o=await q(a),p={turnId:null,cwd:"",model:"gpt-unknown",userUuid:null,toolNames:[],hasThinking:!1,pendingTextPreview:""};for await(let c of e){let d;if(!c.trim())continue;try{d=JSON.parse(c)}catch{continue}if(!d||"object"!=typeof d||!d.type)continue;let e=d.payload??{},j=r(d.timestamp),q=j||o;if(j&&(o=j),"session_meta"===d.type){i=r(e.id),k=r(e.cwd),b=r(e.cli_version)||void 0;let a=r(e.timestamp);a&&(o=a),p.cwd||(p.cwd=k);continue}if("turn_context"===d.type){p.turnId=r(e.turn_id)||p.turnId,p.cwd=r(e.cwd)||k;let a=r(e.model);a&&(p.model=a);let b=r(e.effort);b&&(p.effort=b),p.toolNames=[],p.hasThinking=!1,p.pendingTextPreview="";continue}if("event_msg"===d.type){let c=r(e.type);if("user_message"===c){let b=t(e);if(!b)continue;let c=`${i}::u${l++}`;g.push({type:"user",source:"codex",uuid:c,parentUuid:null,timestamp:q,sessionId:i,cwd:p.cwd||k,textPreview:b.slice(0,200),filePath:a}),h.push([c,null]),p.userUuid=c;continue}if("agent_message"===c){let a=t(e);a&&!p.pendingTextPreview&&(p.pendingTextPreview=a.slice(0,200));continue}if("agent_reasoning"===c){p.hasThinking=!0;continue}if("token_count"===c){let c,d,g,j,l=e.info;if(!l)continue;let o=l.total_token_usage,r=l.last_token_usage,t=o?{input:s(o.input_tokens),cached:s(o.cached_input_tokens),output:s(o.output_tokens),reasoning:s(o.reasoning_output_tokens)}:null;if(t){if(null===n?(c=t.input,d=t.cached,g=t.output,j=t.reasoning):(c=Math.max(0,t.input-n.input),d=Math.max(0,t.cached-n.cached),g=Math.max(0,t.output-n.output),j=Math.max(0,t.reasoning-n.reasoning)),0===c&&0===d&&0===g&&0===j)continue;n=null===n?{...t}:{input:Math.max(n.input,t.input),cached:Math.max(n.cached,t.cached),output:Math.max(n.output,t.output),reasoning:Math.max(n.reasoning,t.reasoning)}}else if(!r)continue;else if(c=s(r.input_tokens),d=s(r.cached_input_tokens),g=s(r.output_tokens),j=s(r.reasoning_output_tokens),0===c&&0===d&&0===g&&0===j)continue;let u=`${i}::a${m++}`,v=p.turnId?`${p.turnId}::a${m}`:`${i}::a${m}`;f.push({type:"assistant",source:"codex",uuid:u,parentUuid:p.userUuid,timestamp:q,sessionId:i,requestId:v,cwd:p.cwd||k,version:b,model:p.model||"gpt-unknown",messageId:v,usage:{input_tokens:Math.max(0,c-d),output_tokens:g+j,cache_creation_input_tokens:0,cache_read_input_tokens:d,cache_creation_5m:0,cache_creation_1h:0,reasoning_tokens:j},toolNames:[...p.toolNames],hasThinking:p.hasThinking,textPreview:p.pendingTextPreview,filePath:a,effort:p.effort}),h.push([u,p.userUuid]),p.toolNames=[],p.hasThinking=!1,p.pendingTextPreview=""}continue}if("response_item"===d.type){let a=r(e.type);if("function_call"===a||"custom_tool_call"===a){let a=r(e.name);a&&p.toolNames.push(a);continue}if("reasoning"===a){p.hasThinking=!0;continue}if("message"===a&&"assistant"===r(e.role)){let a=t(e);a&&!p.pendingTextPreview&&(p.pendingTextPreview=a.slice(0,200))}continue}}return{assistant:f,user:g,parentLinks:h}}var v=c(71310);let w={mini:"Mini",nano:"Nano",pro:"Pro",turbo:"Turbo",preview:"Preview"},x={id:"codex",displayName:{en:"Codex",zh:"Codex"},shortLabel:"X",color:{fg:"#047857",bg:"#d1fae5"},parserVersion:"codex-v4-effort",capabilities:{hasCacheCreation:!1,hasReasoningTokens:!0,blockWindowMs:18e6},getDirs:function(){let a=h().homedir(),b=[f().join(a,".codex","sessions"),f().join(a,".codex","archived_sessions")];return process.env.CCGAUGE_CODEX_DIR&&b.push(process.env.CCGAUGE_CODEX_DIR),process.env.CODEX_HOME&&(b.push(f().join(process.env.CODEX_HOME,"sessions")),b.push(f().join(process.env.CODEX_HOME,"archived_sessions"))),Array.from(new Set(b))},shouldSkipDir:()=>!1,parseFile:u,resolvePricing:v.E7,shortenModel:function(a){if(!a)return"(unknown)";let b=a.replace(/^openai\//,"");return b.toLowerCase().startsWith("gpt-")?"GPT-"+b.slice(4).split("-").map(a=>w[a.toLowerCase()]??a).join(" "):b.toLowerCase().startsWith("o")?b.toUpperCase():b.replace(/-/g," ").replace(/\b\w/g,a=>a.toUpperCase())},costFromUsage:m,costFootnoteKey:"cost.footnote.codex"},y={claude:{id:"claude",displayName:{en:"Claude",zh:"Claude"},shortLabel:"C",color:{fg:"#b45309",bg:"#fef3c7"},parserVersion:"claude-v3-synthetic-flag",capabilities:{hasCacheCreation:!0,hasReasoningTokens:!1,blockWindowMs:18e6},getDirs:function(){let a=h().homedir(),b=[f().join(a,".claude","projects"),f().join(a,".config","claude","projects")];return process.env.CCGAUGE_CONFIG_DIR&&b.push(f().join(process.env.CCGAUGE_CONFIG_DIR,"projects")),process.env.CLAUDE_CONFIG_DIR&&b.push(f().join(process.env.CLAUDE_CONFIG_DIR,"projects")),Array.from(new Set(b))},shouldSkipDir:a=>"tool-results"===a||"memory"===a,parseFile:async a=>await k(a),resolvePricing:function(a){if(!a)return{pricing:null,matchType:"none",matchedKey:null};if(l.V[a])return{pricing:l.V[a],matchType:"exact",matchedKey:a};let b=a.replace(o,"");if(l.V[b])return{pricing:l.V[b],matchType:"date-stripped",matchedKey:b};let c=b.replace(p,"");if(l.V[c])return{pricing:l.V[c],matchType:"prefix-stripped",matchedKey:c};for(let b of["opus","sonnet","haiku"])if(a.toLowerCase().includes(b))return{pricing:l.Q[b],matchType:"family-fallback",matchedKey:`claude-${b}-(latest)`};return{pricing:null,matchType:"none",matchedKey:null}},shortenModel:function(a){if(!a)return"(unknown)";let b=a.replace(/-(\d{8})$/,"").replace(/^(vertex_ai|bedrock|anthropic)\//,""),c=(b=b.replace(/^claude-/,"")).split("-");if(c.length>=2){let a=c[0],b=c.slice(1).join(".");return n(a)+" "+b}return n(b.replace(/-/g," "))},costFromUsage:m,costFootnoteKey:null},codex:x},z=["claude","codex"],A="claude";function B(a){return y[a]}function C(){return z.map(a=>y[a])}function D(a){return"string"==typeof a&&("claude"===a||"codex"===a)}async function E(a){try{return(await d.promises.stat(a)).isDirectory()}catch{return!1}}async function F(){let a=[];for(let b of C())for(let c of b.getDirs())if(await E(c)){a.push(b.id);break}return a}},71310:(a,b,c)=>{"use strict";c.d(b,{E7:()=>h,_G:()=>d});let d={"gpt-5":{input:1.25,output:10,cacheRead:.13,cacheCreation5m:0,cacheCreation1h:0},"gpt-5-mini":{input:.25,output:2,cacheRead:.025,cacheCreation5m:0,cacheCreation1h:0},"gpt-5-nano":{input:.05,output:.4,cacheRead:.005,cacheCreation5m:0,cacheCreation1h:0},"gpt-5.4":{input:1.25,output:10,cacheRead:.13,cacheCreation5m:0,cacheCreation1h:0},"gpt-5.5":{input:1.25,output:10,cacheRead:.13,cacheCreation5m:0,cacheCreation1h:0},"gpt-5.5-mini":{input:.25,output:2,cacheRead:.025,cacheCreation5m:0,cacheCreation1h:0},"gpt-5.5-nano":{input:.05,output:.4,cacheRead:.005,cacheCreation5m:0,cacheCreation1h:0},"gpt-4.1":{input:2,output:8,cacheRead:.5,cacheCreation5m:0,cacheCreation1h:0},"gpt-4.1-mini":{input:.4,output:1.6,cacheRead:.1,cacheCreation5m:0,cacheCreation1h:0},o3:{input:2,output:8,cacheRead:.5,cacheCreation5m:0,cacheCreation1h:0},"o4-mini":{input:1.1,output:4.4,cacheRead:.275,cacheCreation5m:0,cacheCreation1h:0}},e={gpt:d["gpt-5"],o:d.o3},f=/-\d{8}$/,g=/^(openai)\//;function h(a){if(!a)return{pricing:null,matchType:"none",matchedKey:null};if(d[a])return{pricing:d[a],matchType:"exact",matchedKey:a};let b=a.replace(f,"");if(d[b])return{pricing:d[b],matchType:"date-stripped",matchedKey:b};let c=b.replace(g,"");if(d[c])return{pricing:d[c],matchType:"prefix-stripped",matchedKey:c};let h=a.toLowerCase();return h.startsWith("gpt-")||"gpt"===h?{pricing:e.gpt,matchType:"family-fallback",matchedKey:"gpt-(latest)"}:/^o\d/.test(h)?{pricing:e.o,matchType:"family-fallback",matchedKey:"o-(latest)"}:{pricing:null,matchType:"none",matchedKey:null}}},78335:()=>{},96487:()=>{}};
@@ -1 +1 @@
1
- "use strict";exports.id=775,exports.ids=[775],exports.modules={24919:(a,b,c)=>{c.d(b,{TokenStackChart:()=>o});var d=c(21124),e=c(6077),f=c(72400),g=c(57495),h=c(59296),i=c(16803),j=c(11767),k=c(18311),l=c(15514),m=c(7475);let n={input:"rgb(var(--chart-input))",output:"rgb(var(--chart-output))",cacheRead:"rgb(var(--chart-cache-read))",cacheCreation:"rgb(var(--chart-cache-create))"};function o({data:a,height:b="h-72"}){let c=(0,m.kj)(),{locale:o}=(0,m.s9)();return a.length?(0,d.jsxs)("div",{className:`${b} w-full`,children:[(0,d.jsx)(e.u,{width:"100%",height:"100%",children:(0,d.jsxs)(f.E,{data:a,margin:{top:12,right:8,bottom:4,left:8},children:[(0,d.jsx)(g.d,{stroke:"rgb(var(--chart-grid))",strokeDasharray:"3 3",vertical:!1}),(0,d.jsx)(h.W,{dataKey:"label",tick:{fill:"rgb(var(--chart-axis))",fontSize:11},tickLine:!1,axisLine:{stroke:"rgb(var(--chart-grid))"},interval:"preserveStartEnd",minTickGap:32}),(0,d.jsx)(i.h,{tickFormatter:a=>(0,l.jh)(Number(a),o),tick:{fill:"rgb(var(--chart-axis))",fontSize:11},tickLine:!1,axisLine:{stroke:"rgb(var(--chart-grid))"},width:56}),(0,d.jsx)(j.m,{content:(0,d.jsx)(q,{}),cursor:{fill:"rgb(var(--text-primary) / 0.04)"}}),(0,d.jsx)(k.y,{dataKey:"input",stackId:"a",fill:n.input,isAnimationActive:!1}),(0,d.jsx)(k.y,{dataKey:"cacheCreation",stackId:"a",fill:n.cacheCreation,isAnimationActive:!1}),(0,d.jsx)(k.y,{dataKey:"cacheRead",stackId:"a",fill:n.cacheRead,isAnimationActive:!1}),(0,d.jsx)(k.y,{dataKey:"output",stackId:"a",fill:n.output,radius:[3,3,0,0],isAnimationActive:!1})]})}),(0,d.jsxs)("div",{className:"flex items-center flex-wrap justify-center gap-4 text-xs text-text-secondary mt-2",children:[(0,d.jsx)(p,{color:n.input,label:c("chart.legend.input")}),(0,d.jsx)(p,{color:n.cacheCreation,label:c("chart.legend.cacheWrite")}),(0,d.jsx)(p,{color:n.cacheRead,label:c("chart.legend.cacheRead")}),(0,d.jsx)(p,{color:n.output,label:c("chart.legend.output")})]})]}):(0,d.jsx)("div",{className:`${b} flex items-center justify-center text-text-tertiary text-sm`,children:c("chart.empty")})}function p({color:a,label:b}){return(0,d.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,d.jsx)("span",{className:"w-2.5 h-2.5 rounded-sm",style:{background:a}}),(0,d.jsx)("span",{children:b})]})}function q(a){let b=(0,m.kj)(),{locale:c}=(0,m.s9)();if(!a.active||!a.payload||!a.payload.length)return null;let e=a.payload[0].payload,f=e.input+e.output+e.cacheRead+e.cacheCreation;return(0,d.jsxs)("div",{className:"card border-border-hi shadow-lg p-3 text-xs min-w-[200px]",children:[(0,d.jsx)("div",{className:"font-medium text-text-primary mb-2",children:a.label}),(0,d.jsxs)("div",{className:"space-y-1",children:[(0,d.jsx)(r,{color:n.input,label:b("chart.legend.input"),value:e.input,locale:c}),(0,d.jsx)(r,{color:n.cacheCreation,label:b("chart.legend.cacheWrite"),value:e.cacheCreation,locale:c}),(0,d.jsx)(r,{color:n.cacheRead,label:b("chart.legend.cacheRead"),value:e.cacheRead,locale:c}),(0,d.jsx)(r,{color:n.output,label:b("chart.legend.output"),value:e.output,locale:c})]}),(0,d.jsxs)("div",{className:"mt-2 pt-2 border-t border-border flex items-center justify-between",children:[(0,d.jsx)("span",{className:"text-text-secondary",children:b("chart.tooltip.total")}),(0,d.jsx)("span",{className:"num-mono text-text-primary",children:(0,l.jh)(f,c)})]}),(0,d.jsxs)("div",{className:"flex items-center justify-between mt-1",children:[(0,d.jsx)("span",{className:"text-text-secondary",children:b("chart.tooltip.cost")}),(0,d.jsx)("span",{className:"num-mono text-brand",children:(0,l.az)(e.cost)})]}),(0,d.jsxs)("div",{className:"flex items-center justify-between mt-1",children:[(0,d.jsx)("span",{className:"text-text-secondary",children:b("chart.tooltip.requests")}),(0,d.jsx)("span",{className:"num-mono text-text-primary",children:e.requests})]})]})}function r({color:a,label:b,value:c,locale:e}){return(0,d.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,d.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-text-secondary",children:[(0,d.jsx)("span",{className:"w-2 h-2 rounded-sm",style:{background:a}}),b]}),(0,d.jsx)("span",{className:"num-mono text-text-primary",children:(0,l.jh)(c,e)})]})}},37583:(a,b,c)=>{c.d(b,{pp:()=>h,qK:()=>g,wn:()=>f});var d=c(75338),e=c(95012);function f({title:a,desc:b,right:c,children:f,className:g}){return(0,d.jsxs)("section",{className:(0,e.cn)("card",g),children:[(a||c)&&(0,d.jsxs)("header",{className:"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-3 sm:gap-4 px-4 sm:px-6 pt-4 sm:pt-5 pb-3 border-b border-border",children:[(0,d.jsxs)("div",{className:"min-w-0",children:[a&&(0,d.jsx)("h2",{className:"text-base font-semibold text-text-primary tracking-tight",children:a}),b&&(0,d.jsx)("p",{className:"text-xs text-text-secondary mt-1",children:b})]}),c&&(0,d.jsx)("div",{className:"flex items-center gap-2 flex-wrap",children:c})]}),(0,d.jsx)("div",{className:"p-4 sm:p-6",children:f})]})}function g({title:a,desc:b,right:c,children:e}){return(0,d.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 py-6 sm:py-8 space-y-6",children:[(0,d.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-end sm:justify-between gap-3 sm:gap-4",children:[(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsx)("h1",{className:"text-2xl font-semibold tracking-tight truncate",children:a}),b&&(0,d.jsx)("p",{className:"text-sm text-text-secondary mt-1",children:b})]}),c&&(0,d.jsx)("div",{className:"flex items-center gap-2 flex-wrap",children:c})]}),e]})}function h({title:a,desc:b}){return(0,d.jsxs)("div",{className:"card card-pad text-center py-16",children:[(0,d.jsx)("div",{className:"text-base font-medium text-text-secondary",children:a}),b&&(0,d.jsx)("div",{className:"text-sm text-text-tertiary mt-2",children:b})]})}},50160:(a,b,c)=>{c.d(b,{SI:()=>e});var d=c(60704);function e(a){let b=(0,d.sO)(a.source),{pricing:c}=b.resolvePricing(a.model);return b.costFromUsage(a.usage,c)}},67803:(a,b,c)=>{c.d(b,{$M:()=>l,OJ:()=>j,a6:()=>h,a9:()=>i,pb:()=>k});var d=c(50160),e=c(60704),f=c(95012);function g(a,b){return!(a.source!==b.source||b.from&&a.timestamp<b.from.toISOString()||b.to&&a.timestamp>b.to.toISOString())&&(!b.models||!b.models.length||!!b.models.includes(a.model))&&(!b.projects||!b.projects.length||!!b.projects.includes(a.cwd))}function h(a,b,c){let e=new Map;for(let f of a){if(!g(f,c))continue;let{key:a,label:h}=function(a,b){let c=new Date(a),d=c.getFullYear(),e=String(c.getMonth()+1).padStart(2,"0"),f=String(c.getDate()).padStart(2,"0"),g=String(c.getHours()).padStart(2,"0");if("hour"===b)return{key:`${d}-${e}-${f}T${g}`,label:`${e}/${f} ${g}:00`};if("day"===b)return{key:`${d}-${e}-${f}`,label:`${e}/${f}`};if("week"===b){let a=new Date(c),b=a.getDay()||7;a.setDate(a.getDate()-b+1);let d=String(a.getMonth()+1).padStart(2,"0"),e=String(a.getDate()).padStart(2,"0");return{key:`${a.getFullYear()}-W${d}${e}`,label:`Wk ${d}/${e}`}}return{key:`${d}-${e}`,label:`${d}-${e}`}}(f.timestamp,b),i=e.get(a);i||(i={key:a,label:h,inputTokens:0,outputTokens:0,cacheReadTokens:0,cacheCreationTokens:0,totalTokens:0,cost:0,saved:0,requests:0,models:{}},e.set(a,i)),function(a,b){let c=(0,d.SI)(b);a.inputTokens+=b.usage.input_tokens,a.outputTokens+=b.usage.output_tokens,a.cacheReadTokens+=b.usage.cache_read_input_tokens,a.cacheCreationTokens+=b.usage.cache_creation_input_tokens,a.totalTokens=a.inputTokens+a.outputTokens+a.cacheReadTokens+a.cacheCreationTokens,a.cost+=c.total,a.saved+=c.saved,a.requests+=1;let e=a.models[b.model]??{tokens:0,cost:0,requests:0};e.tokens+=b.usage.input_tokens+b.usage.output_tokens+b.usage.cache_read_input_tokens+b.usage.cache_creation_input_tokens,e.cost+=c.total,e.requests+=1,a.models[b.model]=e}(i,f)}return Array.from(e.values()).sort((a,b)=>a.key.localeCompare(b.key))}function i(a,b){let c=new Map;for(let f of a){if(!g(f,b))continue;let a=c.get(f.model);if(!a){let{pricing:b,matchType:d}=(0,e.sO)(f.source).resolvePricing(f.model);a={model:f.model,source:f.source,requests:0,inputTokens:0,outputTokens:0,cacheReadTokens:0,cacheCreationTokens:0,totalTokens:0,cost:0,saved:0,pricing:b,pricingResolved:"exact"===d||"date-stripped"===d||"prefix-stripped"===d},c.set(f.model,a)}let h=(0,d.SI)(f);a.requests+=1,a.inputTokens+=f.usage.input_tokens,a.outputTokens+=f.usage.output_tokens,a.cacheReadTokens+=f.usage.cache_read_input_tokens,a.cacheCreationTokens+=f.usage.cache_creation_input_tokens,a.totalTokens=a.inputTokens+a.outputTokens+a.cacheReadTokens+a.cacheCreationTokens,a.cost+=h.total,a.saved+=h.saved}return Array.from(c.values()).sort((a,b)=>b.cost-a.cost)}function j(a,b){let c=new Map,e=new Map;for(let h of a){if(!g(h,b))continue;let a=h.cwd||"(unknown)",i=c.get(a);i||(i={cwd:a,projectName:(0,f.PJ)(a),sessions:0,requests:0,inputTokens:0,outputTokens:0,cacheReadTokens:0,cacheCreationTokens:0,totalTokens:0,cost:0,saved:0,firstActivity:h.timestamp,lastActivity:h.timestamp,models:[]},c.set(a,i),e.set(a,new Set)),e.get(a).add(h.sessionId);let j=(0,d.SI)(h);i.requests+=1,i.inputTokens+=h.usage.input_tokens,i.outputTokens+=h.usage.output_tokens,i.cacheReadTokens+=h.usage.cache_read_input_tokens,i.cacheCreationTokens+=h.usage.cache_creation_input_tokens,i.totalTokens=i.inputTokens+i.outputTokens+i.cacheReadTokens+i.cacheCreationTokens,i.cost+=j.total,i.saved+=j.saved,h.timestamp<i.firstActivity&&(i.firstActivity=h.timestamp),h.timestamp>i.lastActivity&&(i.lastActivity=h.timestamp),i.models.includes(h.model)||i.models.push(h.model)}for(let[a,b]of e)c.get(a).sessions=b.size;return Array.from(c.values()).sort((a,b)=>b.cost-a.cost)}function k(a,b,c){let e=new Map;for(let b of a){if(!g(b,c))continue;let a=b.sessionId||b.uuid,h=e.get(a);h||(h={sessionId:a,cwd:b.cwd,projectName:(0,f.PJ)(b.cwd),startTime:b.timestamp,endTime:b.timestamp,durationMs:0,requests:0,inputTokens:0,outputTokens:0,cacheReadTokens:0,cacheCreationTokens:0,totalTokens:0,cost:0,saved:0,models:[],modelBreakdown:{}},e.set(a,h));let i=(0,d.SI)(b);h.requests+=1,h.inputTokens+=b.usage.input_tokens,h.outputTokens+=b.usage.output_tokens,h.cacheReadTokens+=b.usage.cache_read_input_tokens,h.cacheCreationTokens+=b.usage.cache_creation_input_tokens,h.totalTokens=h.inputTokens+h.outputTokens+h.cacheReadTokens+h.cacheCreationTokens,h.cost+=i.total,h.saved+=i.saved,b.timestamp<h.startTime&&(h.startTime=b.timestamp),b.timestamp>h.endTime&&(h.endTime=b.timestamp),h.models.includes(b.model)||h.models.push(b.model);let j=h.modelBreakdown[b.model]??{tokens:0,cost:0,requests:0};j.tokens+=b.usage.input_tokens+b.usage.output_tokens+b.usage.cache_read_input_tokens+b.usage.cache_creation_input_tokens,j.cost+=i.total,j.requests+=1,h.modelBreakdown[b.model]=j}let h=new Map;for(let a of b){let b=h.get(a.sessionId);(!b||a.timestamp<b.timestamp)&&h.set(a.sessionId,a)}for(let a of e.values()){a.durationMs=Math.max(0,new Date(a.endTime).getTime()-new Date(a.startTime).getTime());let b=h.get(a.sessionId);b&&b.textPreview&&(a.firstUserMessage=b.textPreview,a.title=b.textPreview.slice(0,80))}return Array.from(e.values()).sort((a,b)=>b.endTime.localeCompare(a.endTime))}function l(a,b){let c=0,e=0,f=0,h=0,i=0,j=0,k=0;for(let l of a){if(!g(l,b))continue;let a=(0,d.SI)(l);c+=l.usage.input_tokens,e+=l.usage.output_tokens,f+=l.usage.cache_read_input_tokens,h+=l.usage.cache_creation_input_tokens,i+=a.total,j+=a.saved,k+=1}return{inputTokens:c,outputTokens:e,cacheReadTokens:f,cacheCreationTokens:h,totalTokens:c+e+f+h,cost:i,saved:j,requests:k}}},89605:(a,b,c)=>{c.d(b,{TokenStackChart:()=>d});let d=(0,c(97954).registerClientReference)(function(){throw Error("Attempted to call TokenStackChart() from the server but TokenStackChart is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/zuopeng.cheng/personal/workspace/ccgauge/components/charts/token-stack-chart.tsx","TokenStackChart")}};
1
+ "use strict";exports.id=775,exports.ids=[775],exports.modules={24919:(a,b,c)=>{c.d(b,{TokenStackChart:()=>o});var d=c(21124),e=c(6077),f=c(72400),g=c(57495),h=c(59296),i=c(16803),j=c(11767),k=c(18311),l=c(15514),m=c(15519);let n={input:"rgb(var(--chart-input))",output:"rgb(var(--chart-output))",cacheRead:"rgb(var(--chart-cache-read))",cacheCreation:"rgb(var(--chart-cache-create))"};function o({data:a,height:b="h-72"}){let c=(0,m.kj)(),{locale:o}=(0,m.s9)();return a.length?(0,d.jsxs)("div",{className:`${b} w-full`,children:[(0,d.jsx)(e.u,{width:"100%",height:"100%",children:(0,d.jsxs)(f.E,{data:a,margin:{top:12,right:8,bottom:4,left:8},barCategoryGap:"22%",children:[(0,d.jsx)(g.d,{stroke:"rgb(var(--chart-grid))",strokeOpacity:.6,strokeDasharray:"3 3",vertical:!1}),(0,d.jsx)(h.W,{dataKey:"label",tick:{fill:"rgb(var(--chart-axis))",fontSize:11},tickLine:!1,axisLine:!1,interval:"preserveStartEnd",minTickGap:32,tickMargin:8}),(0,d.jsx)(i.h,{tickFormatter:a=>(0,l.jh)(Number(a),o),tick:{fill:"rgb(var(--chart-axis))",fontSize:11},tickLine:!1,axisLine:!1,width:56,tickMargin:4}),(0,d.jsx)(j.m,{content:(0,d.jsx)(q,{}),cursor:{fill:"rgb(var(--text-primary) / 0.05)",radius:4}}),(0,d.jsx)(k.y,{dataKey:"input",stackId:"a",fill:n.input,isAnimationActive:!1}),(0,d.jsx)(k.y,{dataKey:"cacheCreation",stackId:"a",fill:n.cacheCreation,isAnimationActive:!1}),(0,d.jsx)(k.y,{dataKey:"cacheRead",stackId:"a",fill:n.cacheRead,isAnimationActive:!1}),(0,d.jsx)(k.y,{dataKey:"output",stackId:"a",fill:n.output,radius:[4,4,0,0],isAnimationActive:!1})]})}),(0,d.jsxs)("div",{className:"flex items-center flex-wrap justify-center gap-4 text-xs text-text-secondary mt-2",children:[(0,d.jsx)(p,{color:n.input,label:c("chart.legend.input")}),(0,d.jsx)(p,{color:n.cacheCreation,label:c("chart.legend.cacheWrite")}),(0,d.jsx)(p,{color:n.cacheRead,label:c("chart.legend.cacheRead")}),(0,d.jsx)(p,{color:n.output,label:c("chart.legend.output")})]})]}):(0,d.jsx)("div",{className:`${b} flex items-center justify-center text-text-tertiary text-sm`,children:c("chart.empty")})}function p({color:a,label:b}){return(0,d.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,d.jsx)("span",{className:"w-2.5 h-2.5 rounded-sm",style:{background:a}}),(0,d.jsx)("span",{children:b})]})}function q(a){let b=(0,m.kj)(),{locale:c}=(0,m.s9)();if(!a.active||!a.payload||!a.payload.length)return null;let e=a.payload[0].payload,f=e.input+e.output+e.cacheRead+e.cacheCreation;return(0,d.jsxs)("div",{className:"card-elevated border border-border-hi rounded-card p-3 text-xs min-w-[200px]",children:[(0,d.jsx)("div",{className:"font-medium text-text-primary mb-2",children:a.label}),(0,d.jsxs)("div",{className:"space-y-1",children:[(0,d.jsx)(r,{color:n.input,label:b("chart.legend.input"),value:e.input,locale:c}),(0,d.jsx)(r,{color:n.cacheCreation,label:b("chart.legend.cacheWrite"),value:e.cacheCreation,locale:c}),(0,d.jsx)(r,{color:n.cacheRead,label:b("chart.legend.cacheRead"),value:e.cacheRead,locale:c}),(0,d.jsx)(r,{color:n.output,label:b("chart.legend.output"),value:e.output,locale:c})]}),(0,d.jsxs)("div",{className:"mt-2 pt-2 border-t border-border flex items-center justify-between",children:[(0,d.jsx)("span",{className:"text-text-secondary",children:b("chart.tooltip.total")}),(0,d.jsx)("span",{className:"num-mono text-text-primary",children:(0,l.jh)(f,c)})]}),(0,d.jsxs)("div",{className:"flex items-center justify-between mt-1",children:[(0,d.jsx)("span",{className:"text-text-secondary",children:b("chart.tooltip.cost")}),(0,d.jsx)("span",{className:"num-mono text-brand",children:(0,l.az)(e.cost)})]}),(0,d.jsxs)("div",{className:"flex items-center justify-between mt-1",children:[(0,d.jsx)("span",{className:"text-text-secondary",children:b("chart.tooltip.requests")}),(0,d.jsx)("span",{className:"num-mono text-text-primary",children:e.requests})]})]})}function r({color:a,label:b,value:c,locale:e}){return(0,d.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,d.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-text-secondary",children:[(0,d.jsx)("span",{className:"w-2 h-2 rounded-sm",style:{background:a}}),b]}),(0,d.jsx)("span",{className:"num-mono text-text-primary",children:(0,l.jh)(c,e)})]})}},37583:(a,b,c)=>{c.d(b,{pp:()=>h,qK:()=>g,wn:()=>f});var d=c(75338),e=c(95012);function f({title:a,desc:b,right:c,children:f,className:g,inlineDesc:h,fillBody:i}){return(0,d.jsxs)("section",{className:(0,e.cn)("card overflow-hidden mt-3",i&&"flex flex-col",g),children:[(a||c)&&(0,d.jsxs)("header",{className:(0,e.cn)("section-header","flex flex-col sm:flex-row sm:items-start sm:justify-between gap-3 sm:gap-4","px-5 sm:px-6 pt-4 sm:pt-5 pb-3 border-b border-border"),children:[(0,d.jsxs)("div",{className:(0,e.cn)("min-w-0",h&&"sm:flex sm:items-baseline sm:gap-2.5"),children:[a&&(0,d.jsx)("h2",{className:"text-[15px] font-semibold text-text-primary tracking-tight leading-tight",children:a}),b&&(0,d.jsx)("p",{className:(0,e.cn)("text-xs text-text-secondary leading-relaxed",h?"mt-1 sm:mt-0":"mt-1.5"),children:b})]}),c&&(0,d.jsx)("div",{className:"flex items-center gap-2 flex-wrap",children:c})]}),(0,d.jsx)("div",{className:(0,e.cn)("p-5 sm:p-6",i&&"flex-1 flex flex-col"),children:f})]})}function g({title:a,desc:b,right:c,children:e}){return(0,d.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 py-6 sm:py-8 space-y-5 sm:space-y-6",children:[(0,d.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-end sm:justify-between gap-3 sm:gap-4",children:[(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsx)("h1",{className:"text-2xl sm:text-[1.75rem] font-semibold tracking-tight leading-tight truncate",children:a}),b&&(0,d.jsx)("p",{className:"text-sm text-text-secondary mt-1.5 leading-relaxed",children:b})]}),c&&(0,d.jsx)("div",{className:"flex items-center gap-2 flex-wrap",children:c})]}),e]})}function h({title:a,desc:b,icon:c,action:e}){return(0,d.jsxs)("div",{className:"card text-center py-14 sm:py-16 px-6 flex flex-col items-center gap-3",children:[(0,d.jsx)("div",{className:"w-12 h-12 rounded-full bg-bg-surface-hi border border-border flex items-center justify-center text-text-tertiary",children:c??(0,d.jsx)(i,{})}),(0,d.jsx)("div",{className:"text-base font-medium text-text-primary",children:a}),b&&(0,d.jsx)("div",{className:"text-sm text-text-tertiary max-w-md leading-relaxed",children:b}),e&&(0,d.jsx)("div",{className:"mt-2",children:e})]})}function i(){return(0,d.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,d.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,d.jsx)("path",{d:"M9 9h.01M15 9h.01M9 15c1 1 2 1.5 3 1.5s2-.5 3-1.5"})]})}},50160:(a,b,c)=>{c.d(b,{SI:()=>e});var d=c(60704);function e(a){let b=(0,d.sO)(a.source),{pricing:c}=b.resolvePricing(a.model);return b.costFromUsage(a.usage,c)}},67803:(a,b,c)=>{c.d(b,{$M:()=>n,OJ:()=>l,a6:()=>j,a9:()=>k,bo:()=>h,pb:()=>m});var d=c(50160),e=c(60704),f=c(95012);let g=["hour","day","week","month"];function h(a){return"string"==typeof a&&g.includes(a)}function i(a,b){return!(a.source!==b.source||b.from&&a.timestamp<b.from.toISOString()||b.to&&a.timestamp>b.to.toISOString())&&(!b.models||!b.models.length||!!b.models.includes(a.model))&&(!b.projects||!b.projects.length||!!b.projects.includes(a.cwd))}function j(a,b,c){let e=new Map;for(let f of a){if(!i(f,c))continue;let{key:a,label:g}=function(a,b){let c=new Date(a),d=c.getFullYear(),e=String(c.getMonth()+1).padStart(2,"0"),f=String(c.getDate()).padStart(2,"0"),g=String(c.getHours()).padStart(2,"0");if("hour"===b)return{key:`${d}-${e}-${f}T${g}`,label:`${e}/${f} ${g}:00`};if("day"===b)return{key:`${d}-${e}-${f}`,label:`${e}/${f}`};if("week"===b){let a=new Date(c),b=a.getDay()||7;a.setDate(a.getDate()-b+1);let d=String(a.getMonth()+1).padStart(2,"0"),e=String(a.getDate()).padStart(2,"0");return{key:`${a.getFullYear()}-W${d}${e}`,label:`Wk ${d}/${e}`}}return{key:`${d}-${e}`,label:`${d}-${e}`}}(f.timestamp,b),h=e.get(a);h||(h={key:a,label:g,inputTokens:0,outputTokens:0,cacheReadTokens:0,cacheCreationTokens:0,totalTokens:0,cost:0,saved:0,requests:0,models:{}},e.set(a,h)),function(a,b){let c=(0,d.SI)(b);a.inputTokens+=b.usage.input_tokens,a.outputTokens+=b.usage.output_tokens,a.cacheReadTokens+=b.usage.cache_read_input_tokens,a.cacheCreationTokens+=b.usage.cache_creation_input_tokens,a.totalTokens=a.inputTokens+a.outputTokens+a.cacheReadTokens+a.cacheCreationTokens,a.cost+=c.total,a.saved+=c.saved,a.requests+=1;let e=a.models[b.model]??{tokens:0,cost:0,requests:0};e.tokens+=b.usage.input_tokens+b.usage.output_tokens+b.usage.cache_read_input_tokens+b.usage.cache_creation_input_tokens,e.cost+=c.total,e.requests+=1,a.models[b.model]=e}(h,f)}return Array.from(e.values()).sort((a,b)=>a.key.localeCompare(b.key))}function k(a,b){let c=new Map;for(let f of a){if(!i(f,b))continue;let a=c.get(f.model);if(!a){let{pricing:b,matchType:d}=(0,e.sO)(f.source).resolvePricing(f.model);a={model:f.model,source:f.source,requests:0,inputTokens:0,outputTokens:0,cacheReadTokens:0,cacheCreationTokens:0,totalTokens:0,cost:0,saved:0,pricing:b,pricingResolved:"exact"===d||"date-stripped"===d||"prefix-stripped"===d},c.set(f.model,a)}let g=(0,d.SI)(f);a.requests+=1,a.inputTokens+=f.usage.input_tokens,a.outputTokens+=f.usage.output_tokens,a.cacheReadTokens+=f.usage.cache_read_input_tokens,a.cacheCreationTokens+=f.usage.cache_creation_input_tokens,a.totalTokens=a.inputTokens+a.outputTokens+a.cacheReadTokens+a.cacheCreationTokens,a.cost+=g.total,a.saved+=g.saved}return Array.from(c.values()).sort((a,b)=>b.cost-a.cost)}function l(a,b){let c=new Map,e=new Map;for(let g of a){if(!i(g,b))continue;let a=g.cwd||"(unknown)",h=c.get(a);h||(h={cwd:a,projectName:(0,f.PJ)(a),sessions:0,requests:0,inputTokens:0,outputTokens:0,cacheReadTokens:0,cacheCreationTokens:0,totalTokens:0,cost:0,saved:0,firstActivity:g.timestamp,lastActivity:g.timestamp,models:[]},c.set(a,h),e.set(a,new Set)),e.get(a).add(g.sessionId);let j=(0,d.SI)(g);h.requests+=1,h.inputTokens+=g.usage.input_tokens,h.outputTokens+=g.usage.output_tokens,h.cacheReadTokens+=g.usage.cache_read_input_tokens,h.cacheCreationTokens+=g.usage.cache_creation_input_tokens,h.totalTokens=h.inputTokens+h.outputTokens+h.cacheReadTokens+h.cacheCreationTokens,h.cost+=j.total,h.saved+=j.saved,g.timestamp<h.firstActivity&&(h.firstActivity=g.timestamp),g.timestamp>h.lastActivity&&(h.lastActivity=g.timestamp),h.models.includes(g.model)||h.models.push(g.model)}for(let[a,b]of e)c.get(a).sessions=b.size;return Array.from(c.values()).sort((a,b)=>b.cost-a.cost)}function m(a,b,c){let e=new Map;for(let b of a){if(!i(b,c))continue;let a=b.sessionId||b.uuid,g=e.get(a);g||(g={sessionId:a,cwd:b.cwd,projectName:(0,f.PJ)(b.cwd),startTime:b.timestamp,endTime:b.timestamp,durationMs:0,requests:0,inputTokens:0,outputTokens:0,cacheReadTokens:0,cacheCreationTokens:0,totalTokens:0,cost:0,saved:0,models:[],modelBreakdown:{}},e.set(a,g));let h=(0,d.SI)(b);g.requests+=1,g.inputTokens+=b.usage.input_tokens,g.outputTokens+=b.usage.output_tokens,g.cacheReadTokens+=b.usage.cache_read_input_tokens,g.cacheCreationTokens+=b.usage.cache_creation_input_tokens,g.totalTokens=g.inputTokens+g.outputTokens+g.cacheReadTokens+g.cacheCreationTokens,g.cost+=h.total,g.saved+=h.saved,b.timestamp<g.startTime&&(g.startTime=b.timestamp),b.timestamp>g.endTime&&(g.endTime=b.timestamp),g.models.includes(b.model)||g.models.push(b.model);let j=g.modelBreakdown[b.model]??{tokens:0,cost:0,requests:0};j.tokens+=b.usage.input_tokens+b.usage.output_tokens+b.usage.cache_read_input_tokens+b.usage.cache_creation_input_tokens,j.cost+=h.total,j.requests+=1,g.modelBreakdown[b.model]=j}let g=new Map;for(let a of b){let b=g.get(a.sessionId);(!b||a.timestamp<b.timestamp)&&g.set(a.sessionId,a)}for(let a of e.values()){a.durationMs=Math.max(0,new Date(a.endTime).getTime()-new Date(a.startTime).getTime());let b=g.get(a.sessionId);b&&b.textPreview&&(a.firstUserMessage=b.textPreview,a.title=b.textPreview.slice(0,80))}return Array.from(e.values()).sort((a,b)=>b.endTime.localeCompare(a.endTime))}function n(a,b){let c=0,e=0,f=0,g=0,h=0,j=0,k=0;for(let l of a){if(!i(l,b))continue;let a=(0,d.SI)(l);c+=l.usage.input_tokens,e+=l.usage.output_tokens,f+=l.usage.cache_read_input_tokens,g+=l.usage.cache_creation_input_tokens,h+=a.total,j+=a.saved,k+=1}return{inputTokens:c,outputTokens:e,cacheReadTokens:f,cacheCreationTokens:g,totalTokens:c+e+f+g,cost:h,saved:j,requests:k}}},89605:(a,b,c)=>{c.d(b,{TokenStackChart:()=>d});let d=(0,c(97954).registerClientReference)(function(){throw Error("Attempted to call TokenStackChart() from the server but TokenStackChart is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/zuopeng.cheng/personal/workspace/ccgauge/components/charts/token-stack-chart.tsx","TokenStackChart")}};
@@ -2,11 +2,11 @@
2
2
  "version": 1,
3
3
  "functions": {
4
4
  "/api/pricing": {},
5
+ "/api/projects": {},
5
6
  "/api/scan": {},
6
- "/api/blocks": {},
7
7
  "/api/sessions": {},
8
- "/api/usage": {},
9
8
  "/api/export/usage": {},
10
- "/api/projects": {}
9
+ "/api/usage": {},
10
+ "/api/blocks": {}
11
11
  }
12
12
  }
@@ -1 +1 @@
1
- <!DOCTYPE html><html><head><meta charSet="utf-8" data-next-head=""/><meta name="viewport" content="width=device-width" data-next-head=""/><title data-next-head="">500: Internal Server Error</title><noscript data-n-css=""></noscript><script defer="" noModule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-3fcacae817f3ffab.js" defer=""></script><script src="/_next/static/chunks/framework-1a308e28e19f1a97.js" defer=""></script><script src="/_next/static/chunks/main-69f0897f4e7ce710.js" defer=""></script><script src="/_next/static/chunks/pages/_app-5addca2b3b969fde.js" defer=""></script><script src="/_next/static/chunks/pages/_error-022e4ac7bbb9914f.js" defer=""></script><script src="/_next/static/w_l54xHgbhALYXmZcmUxC/_buildManifest.js" defer=""></script><script src="/_next/static/w_l54xHgbhALYXmZcmUxC/_ssgManifest.js" defer=""></script></head><body><div id="__next"><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div style="line-height:48px"><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top">500</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:28px">Internal Server Error<!-- -->.</h2></div></div></div></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":500}},"page":"/_error","query":{},"buildId":"w_l54xHgbhALYXmZcmUxC","nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>
1
+ <!DOCTYPE html><html><head><meta charSet="utf-8" data-next-head=""/><meta name="viewport" content="width=device-width" data-next-head=""/><title data-next-head="">500: Internal Server Error</title><noscript data-n-css=""></noscript><script defer="" noModule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-3fcacae817f3ffab.js" defer=""></script><script src="/_next/static/chunks/framework-1a308e28e19f1a97.js" defer=""></script><script src="/_next/static/chunks/main-69f0897f4e7ce710.js" defer=""></script><script src="/_next/static/chunks/pages/_app-5addca2b3b969fde.js" defer=""></script><script src="/_next/static/chunks/pages/_error-022e4ac7bbb9914f.js" defer=""></script><script src="/_next/static/ZPycmg0NLiIflO5NXMT75/_buildManifest.js" defer=""></script><script src="/_next/static/ZPycmg0NLiIflO5NXMT75/_ssgManifest.js" defer=""></script></head><body><div id="__next"><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div style="line-height:48px"><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top">500</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:28px">Internal Server Error<!-- -->.</h2></div></div></div></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":500}},"page":"/_error","query":{},"buildId":"ZPycmg0NLiIflO5NXMT75","nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[148],{51148:(e,t,s)=>{s.d(t,{CY:()=>d,s9:()=>u,kj:()=>m});var o=s(95155),i=s(12115),a=s(20063),n=s(79808);let c="ccgauge_locale",r=(0,i.createContext)({locale:n.Xn,setLocale:()=>{},t:e=>e}),l="ccgauge.locale";function d(e){let{initialLocale:t,children:s}=e,d=(0,a.useRouter)();(0,i.useEffect)(()=>{try{let e=localStorage.getItem(l);e&&e!==t&&("en"===e||"zh"===e)&&(document.cookie="".concat(c,"=").concat(e,"; path=/; max-age=").concat(31536e3,"; SameSite=Lax"),d.refresh())}catch(e){}},[]);let u=(0,i.useCallback)(e=>{try{localStorage.setItem(l,e)}catch(e){}document.cookie="".concat(c,"=").concat(e,"; path=/; max-age=").concat(31536e3,"; SameSite=Lax"),d.refresh()},[d]),m=(0,i.useCallback)((e,s)=>(0,n.nA)(t,e,s),[t]),g=(0,i.useMemo)(()=>({locale:t,setLocale:u,t:m}),[t,u,m]);return(0,o.jsx)(r.Provider,{value:g,children:s})}function u(){return(0,i.useContext)(r)}function m(){return(0,i.useContext)(r).t}},79808:(e,t,s)=>{s.d(t,{Xn:()=>o,nA:()=>a});let o="en",i={en:{"brand.tagline":"usage dashboard for AI coding CLIs","nav.overview":"Overview","nav.usage":"Usage","nav.sessions":"Sessions","nav.projects":"Projects","nav.models":"Models","nav.settings":"Settings","nav.localBadge":"local","nav.source":"Data source","source.claude":"Claude","source.codex":"Codex","cost.footnote.codex":"Cost shown is the OpenAI API equivalent (subscription plans pay differently).","common.requests":"requests","common.tokens":"tokens","common.cost":"Cost","common.savedViaCache":"Saved {amount} via cache","common.savedTodayViaCache":"Saved {amount} today","common.live":"live","common.allModels":"All","common.allProjects":"All","common.unknown":"(unknown)","common.session":"Session","common.sessions":"sessions","common.projects":"projects","common.req":"req","common.day":"day","common.days":"days","common.activity":"activity","common.fallbackPrice":"fallback price","common.thinking":"thinking","common.lastActivity":"last activity","common.empty.title":"No usage data yet","common.empty.desc":"Open Claude Code, send a message, then refresh.","common.refresh":"Refresh","common.search":"Search…","common.searchPlaceholder":"Search model, project, session, tool…","common.exportCsv":"Export CSV","common.rows":"{count} rows","common.prev":"‹ Prev","common.next":"Next ›","common.first":"\xab","common.last":"\xbb","common.pageOf":"Page {page} of {total}","common.allSessions":"← All sessions","common.allProjectsLink":"← All projects","common.noMatchingRows":"No matching rows","range.label":"Date range","range.today":"Today","range.7d":"7d","range.30d":"30d","range.90d":"90d","range.all":"All","gran.label":"Granularity","gran.hour":"Hour","gran.day":"Day","gran.week":"Week","gran.month":"Month","overview.title":"Overview","overview.subtitle":"{count} requests across {files} files \xb7 scan in {ms}ms","overview.subtitle.empty":"Scanned {dirs} directory(ies). Open Claude Code, send a message, then refresh.","overview.empty.title":"No usage data yet","overview.kpi.tokensToday":"Tokens today","overview.kpi.costToday":"Cost today","overview.kpi.thisMonth":"This month","overview.kpi.cacheHit":"Cache hit rate","overview.kpi.topModel":"Top model","overview.kpi.activeSessions":"Sessions today","overview.kpi.activeSessions.hint":"{count} project(s)","overview.kpi.thisMonth.hint":"{tokens} tokens \xb7 {req} req","overview.kpi.tokensToday.hint":"{count} requests","overview.kpi.topModel.hint":"{pct} of cost this month","overview.kpi.cacheHit.hint":"Saved {amount} today","overview.delta.title":"vs yesterday","overview.delta.firstTime":"NEW","common.loading":"Loading…","common.error.title":"Something went wrong","common.error.desc":"Failed to load this page. Try again.","common.error.retry":"Retry","overview.trend.title":"Token usage trend","overview.trend.desc":"Last 30 days \xb7 stacked by token type","overview.trend.activeDays":"{n} day with activity","overview.trend.activeDays.plural":"{n} days with activity","overview.costByModel.title":"Cost by model","overview.costByModel.desc":"This month, sorted by spend","activity.title":"Activity","activity.subtitle":"Lifetime stats and when you usually code","activity.sessions":"Sessions","activity.messages":"Messages","activity.totalTokens":"Total tokens","activity.activeDays":"Active days","activity.currentStreak":"Current streak","activity.longestStreak":"Longest streak","activity.streakCombinedLabel":"Streak (cur / max)","activity.streakCombinedValue":"{current} / {longest} d","activity.peakHour":"Peak hour","activity.favoriteModel":"Favorite model","activity.streakValue":"{n}d","activity.dow.0":"Sun","activity.dow.1":"Mon","activity.dow.2":"Tue","activity.dow.3":"Wed","activity.dow.4":"Thu","activity.dow.5":"Fri","activity.dow.6":"Sat","activity.heatmap.tooltip":"{dow} \xb7 {hour} \xb7 {count} messages","activity.heatmap.messages":"Messages","activity.heatmap.tokens":"Tokens","activity.heatmap.shareLabel":"Share","activity.heatmap.intensityLabel":"Of peak","activity.heatmap.empty":"No activity","activity.comparison":"You've used ~{multiplier}\xd7 more tokens than {ref}.","activity.ref.haiku":"a haiku","activity.ref.tweet":"a tweet","activity.ref.littlePrince":"The Little Prince","activity.ref.gatsby":"The Great Gatsby","activity.ref.hobbit":"The Hobbit","activity.ref.lotrTrilogy":"the Lord of the Rings trilogy","activity.ref.warAndPeace":"War and Peace","activity.ref.harryPotterAll":"all 7 Harry Potter books","activity.ref.encyclopediaBritannica":"the Encyclopedia Britannica","activity.ref.wikipediaEn":"all of English Wikipedia","block.title":"Active 5h block","block.remaining":"remaining","block.elapsed":"Time elapsed {pct}%","block.tokensSuffix":"tokens","block.spentSoFar":"Spent so far","block.burnPerMin":"Burn / min","block.projectedTotal":"Projected total","block.requests":"Requests","block.empty":"No active block","block.emptyDesc":"Send a message in Claude Code to start one.","block.disclaimer":"Wall-clock progress of the 5h window — not your plan quota.","chart.legend.input":"Input","chart.legend.output":"Output","chart.legend.cacheRead":"Cache read","chart.legend.cacheWrite":"Cache write","chart.tooltip.total":"Total","chart.tooltip.cost":"Cost","chart.tooltip.requests":"Requests","chart.empty":"No data in this range","chart.empty.short":"No data","usage.title":"Usage","usage.subtitle":"{count} turns in selected range","usage.col.calls":"Calls","usage.col.userMessage":"Prompt","usage.overview.label":"Overview","usage.overview.show":"Show overview (KPIs + trend)","usage.overview.hide":"Hide overview (KPIs + trend)","usage.turn.expand":"Expand","usage.turn.collapse":"Collapse","usage.turn.callsCount":"{count} calls","usage.turn.noPrompt":"(no user text)","usage.requests.desc":"One row per turn (user message + tool calls); click ▸ to expand","usage.kpi.totalTokens":"Total tokens","usage.kpi.totalCost":"Total cost","usage.kpi.cacheSaved":"Cache saved","usage.kpi.cacheHit":"Cache hit","usage.trend":"Trend","usage.trend.gran":"Granularity: {gran}","usage.requests.title":"Requests","usage.col.time":"Time","usage.col.model":"Model","usage.col.project":"Project","usage.col.session":"Session","usage.col.input":"Input","usage.col.output":"Output","usage.col.cacheRead":"Cache R","usage.col.cacheWrite":"Cache W","usage.col.cost":"Cost","usage.col.tools":"Tools","usage.col.total":"Total","usage.columns.button":"Columns","usage.columns.title":"Visible columns","usage.columns.reset":"Reset","usage.breakdown.title":"Token breakdown","usage.breakdown.headerTokens":"Tokens","usage.breakdown.headerCost":"Cost","usage.breakdown.total":"Total","usage.breakdown.reasoning":"reasoning","usage.breakdown.reasoningNote":"incl. above","filter.modelLabel":"Model","filter.projectLabel":"Project","filter.modelAll":"Model: All","filter.projectAll":"Project: All","filter.modelSingle":"Model: {value}","filter.projectSingle":"Project: {value}","filter.modelMulti":"Model: {count}","filter.projectMulti":"Project: {count}","filter.clearAll":"Clear all","filter.noOptions":"No options","sessions.title":"Sessions","sessions.subtitle":"{count} sessions \xb7 sorted by most recent activity","sessions.col.session":"Session","sessions.col.project":"Project","sessions.col.models":"Model(s)","sessions.col.requests":"Requests","sessions.col.tokens":"Tokens","sessions.col.cost":"Cost","sessions.col.duration":"Duration","sessions.col.lastActivity":"Last activity","sessions.untitled":"Session {hash}","sessions.empty":"No sessions yet","session.kpi.requests":"Requests","session.kpi.totalTokens":"Total tokens","session.kpi.cost":"Cost","session.kpi.duration":"Duration","session.timeline.title":"Message timeline","session.timeline.desc":"In order; newest at the bottom","session.perMessage.title":"Per-message tokens","session.modelsInSession":"Models in this session","session.modelLine":"{requests} req \xb7 {tokens} tokens","session.token.in":"in","session.token.out":"out","session.token.cacheR":"cache r","session.token.cacheW":"cache w","projects.title":"Projects","projects.subtitle":"{count} projects \xb7 sorted by spend","projects.empty":"No projects yet","projects.stat.sessions":"Sessions","projects.stat.requests":"Requests","projects.stat.tokens":"Tokens","project.activity":"Activity (last 30 days)","project.sessions.title":"Sessions ({count})","models.title":"Models","models.subtitle":"{count} model(s) used in total","models.empty":"No model usage yet","models.share.cost":"Cost share","models.share.tokens":"Tokens share","models.share.cacheHit":"Cache hit","models.field.requests":"Requests","models.field.savedByCache":"Saved by cache","models.field.input1M":"Input / 1M","models.field.output1M":"Output / 1M","models.field.cacheRead1M":"Cache read / 1M","models.field.pctOfTotal":"{pct} of total spend \xb7 {tokens} tokens","models.eachTrend":"Combined trend (last 30 days)","settings.title":"Settings","settings.subtitle":"Data sources, pricing, and behavior","settings.dataSources.title":"Data sources","settings.dataSources.desc":"ccgauge scans these locations for JSONL files","settings.dataSources.active":"active","settings.dataSources.notPresent":"not present","settings.dataSources.envHint":"Override with {env1} or {env2} environment variables (the dashboard appends {appendix}).","settings.rescan":"Rescan now","settings.rescanning":"Rescanning…","settings.scanStats.title":"Scan stats","settings.scanStats.files":"Files scanned","settings.scanStats.records":"Records parsed","settings.scanStats.assistant":"Assistant records (deduped)","settings.scanStats.duration":"Scan duration","settings.pricing.title":"Pricing table","settings.pricing.desc":"USD per 1M tokens \xb7 built-in snapshot, fuzzy match for date-suffixed model names","settings.pricing.col.model":"Model","settings.pricing.col.input":"Input","settings.pricing.col.output":"Output","settings.pricing.col.write5m":"Cache write 5m","settings.pricing.col.write1h":"Cache write 1h","settings.pricing.col.read":"Cache read","settings.preferences.title":"Preferences","settings.preferences.language":"Language","settings.preferences.theme":"Theme","settings.theme.light":"Light","settings.theme.dark":"Dark","settings.theme.system":"System","settings.about.title":"About","settings.about.subtitle":"Version {version} \xb7 MIT licensed","settings.about.line1":"Fully local: data never leaves your machine; no telemetry, no network calls.","settings.about.line2":"Read-only: ccgauge only reads JSONL files, never writes back to ~/.claude.","settings.about.line3":'Cache: scan results are memoized for 5s; click "Rescan" to force a fresh read.',"settings.about.line4":"Stop with Ctrl+C in the terminal that started ccgauge.","settings.indexer.desc":"Background indexer keeps the cache fresh via file watchers.","settings.indexer.lastIndexedAt":"Last indexed","settings.indexer.indexDuration":"Last index time","settings.indexer.watchers":"Active watchers","settings.indexer.loadedFromDisk":"Loaded from disk","settings.indexer.status":"Status","settings.indexer.indexing":"indexing…","settings.indexer.idle":"idle","settings.indexer.recentErrors":"Recent indexer errors","common.yes":"yes","common.no":"no","lang.label":"Language","lang.en":"English","lang.zh":"中文","theme.label":"Theme"},zh:{"brand.tagline":"AI 编程 CLI 的本地用量看板","nav.overview":"概览","nav.usage":"用量","nav.sessions":"会话","nav.projects":"项目","nav.models":"模型","nav.settings":"设置","nav.localBadge":"本地","nav.source":"数据源","source.claude":"Claude","source.codex":"Codex","cost.footnote.codex":"按 OpenAI API 单价折算估值(订阅计划实际计费不同)","common.requests":"次请求","common.tokens":"tokens","common.cost":"花费","common.savedViaCache":"通过缓存节省 {amount}","common.savedTodayViaCache":"今日缓存节省 {amount}","common.live":"进行中","common.allModels":"全部","common.allProjects":"全部","common.unknown":"(未知)","common.session":"会话","common.sessions":"个会话","common.projects":"个项目","common.req":"请求","common.day":"天","common.days":"天","common.activity":"活跃","common.fallbackPrice":"使用兜底单价","common.thinking":"思考","common.lastActivity":"最近活跃","common.empty.title":"暂无用量数据","common.empty.desc":"打开 Claude Code 发送一条消息后刷新本页。","common.refresh":"刷新","common.search":"搜索…","common.searchPlaceholder":"搜索模型 / 项目 / 会话 / 工具…","common.exportCsv":"导出 CSV","common.rows":"{count} 行","common.prev":"‹ 上一页","common.next":"下一页 ›","common.first":"\xab","common.last":"\xbb","common.pageOf":"第 {page} / {total} 页","common.allSessions":"← 返回会话列表","common.allProjectsLink":"← 返回项目列表","common.noMatchingRows":"没有匹配的记录","range.label":"时间范围","range.today":"今天","range.7d":"7 天","range.30d":"30 天","range.90d":"90 天","range.all":"全部","gran.label":"粒度","gran.hour":"小时","gran.day":"天","gran.week":"周","gran.month":"月","overview.title":"概览","overview.subtitle":"{count} 次请求,覆盖 {files} 个文件 \xb7 扫描耗时 {ms}ms","overview.subtitle.empty":"已扫描 {dirs} 个目录。打开 Claude Code 发一条消息后刷新本页。","overview.empty.title":"暂无用量数据","overview.kpi.tokensToday":"今日 tokens","overview.kpi.costToday":"今日花费","overview.kpi.thisMonth":"本月累计","overview.kpi.cacheHit":"缓存命中率","overview.kpi.topModel":"主力模型","overview.kpi.activeSessions":"今日会话","overview.kpi.activeSessions.hint":"涉及 {count} 个项目","overview.kpi.thisMonth.hint":"{tokens} tokens \xb7 {req} 次请求","overview.kpi.tokensToday.hint":"{count} 次请求","overview.kpi.topModel.hint":"本月成本占比 {pct}","overview.kpi.cacheHit.hint":"今日缓存节省 {amount}","overview.delta.title":"相比昨日","overview.delta.firstTime":"首次","common.loading":"加载中…","common.error.title":"出错了","common.error.desc":"加载失败,请重试。","common.error.retry":"重试","overview.trend.title":"Token 用量趋势","overview.trend.desc":"近 30 天 \xb7 按 token 类型堆叠","overview.trend.activeDays":"{n} 天有数据","overview.trend.activeDays.plural":"{n} 天有数据","overview.costByModel.title":"按模型成本分布","overview.costByModel.desc":"本月,按花费排序","activity.title":"活动统计","activity.subtitle":"总览数据 + 每天什么时段最忙","activity.sessions":"会话","activity.messages":"消息","activity.totalTokens":"总 tokens","activity.activeDays":"活跃天数","activity.currentStreak":"当前连续","activity.longestStreak":"最长连续","activity.streakCombinedLabel":"当前 / 最长连续","activity.streakCombinedValue":"{current} / {longest} 天","activity.peakHour":"高峰小时","activity.favoriteModel":"最常用模型","activity.streakValue":"{n} 天","activity.dow.0":"周日","activity.dow.1":"周一","activity.dow.2":"周二","activity.dow.3":"周三","activity.dow.4":"周四","activity.dow.5":"周五","activity.dow.6":"周六","activity.heatmap.tooltip":"周{dow} \xb7 {hour} \xb7 {count} 条消息","activity.heatmap.messages":"消息数","activity.heatmap.tokens":"Tokens","activity.heatmap.shareLabel":"占总数","activity.heatmap.intensityLabel":"占峰值","activity.heatmap.empty":"无活动","activity.comparison":"你用掉的 token 大约是 {ref} 的 {multiplier}\xd7。","activity.ref.haiku":"一首俳句","activity.ref.tweet":"一条推文","activity.ref.littlePrince":"《小王子》","activity.ref.gatsby":"《了不起的盖茨比》","activity.ref.hobbit":"《霍比特人》","activity.ref.lotrTrilogy":"《魔戒》三部曲","activity.ref.warAndPeace":"《战争与和平》","activity.ref.harryPotterAll":"《哈利\xb7波特》全 7 册","activity.ref.encyclopediaBritannica":"《大英百科全书》","activity.ref.wikipediaEn":"英文维基百科全部","block.title":"当前 5h block","block.remaining":"剩余","block.elapsed":"时间进度 {pct}%","block.tokensSuffix":"tokens","block.spentSoFar":"已花费","block.burnPerMin":"每分钟消耗","block.projectedTotal":"预计总花费","block.requests":"请求数","block.empty":"当前无活跃 block","block.emptyDesc":"在 Claude Code 中发送消息会启动一个新 block。","block.disclaimer":"仅是 5h 窗口的钟表进度,不是你的套餐配额。","chart.legend.input":"输入","chart.legend.output":"输出","chart.legend.cacheRead":"缓存读取","chart.legend.cacheWrite":"缓存写入","chart.tooltip.total":"合计","chart.tooltip.cost":"花费","chart.tooltip.requests":"请求数","chart.empty":"区间内无数据","chart.empty.short":"暂无数据","usage.title":"用量明细","usage.subtitle":"当前筛选范围内 {count} 轮对话","usage.kpi.totalTokens":"总 tokens","usage.kpi.totalCost":"总花费","usage.kpi.cacheSaved":"缓存节省","usage.kpi.cacheHit":"缓存命中","usage.trend":"趋势","usage.trend.gran":"粒度:{gran}","usage.requests.title":"对话轮次","usage.requests.desc":"每轮对话一行(用户消息 + 工具调用),点击 ▸ 展开明细","usage.col.calls":"调用","usage.col.userMessage":"提示","usage.overview.label":"概览","usage.overview.show":"显示概览(KPI + 趋势)","usage.overview.hide":"隐藏概览(KPI + 趋势)","usage.turn.expand":"展开","usage.turn.collapse":"收起","usage.turn.callsCount":"{count} 次调用","usage.turn.noPrompt":"(无用户文本)","usage.col.time":"时间","usage.col.model":"模型","usage.col.project":"项目","usage.col.session":"会话","usage.col.input":"输入","usage.col.output":"输出","usage.col.cacheRead":"缓存读","usage.col.cacheWrite":"缓存写","usage.col.cost":"花费","usage.col.tools":"工具","usage.col.total":"总量","usage.columns.button":"列","usage.columns.title":"显示列","usage.columns.reset":"重置","usage.breakdown.title":"总量明细","usage.breakdown.headerTokens":"Token","usage.breakdown.headerCost":"花费","usage.breakdown.total":"合计","usage.breakdown.reasoning":"其中推理","usage.breakdown.reasoningNote":"已含在 output","filter.modelLabel":"模型","filter.projectLabel":"项目","filter.modelAll":"模型:全部","filter.projectAll":"项目:全部","filter.modelSingle":"模型:{value}","filter.projectSingle":"项目:{value}","filter.modelMulti":"模型:{count} 个","filter.projectMulti":"项目:{count} 个","filter.clearAll":"清除筛选","filter.noOptions":"没有可选项","sessions.title":"会话","sessions.subtitle":"共 {count} 个会话 \xb7 按最近活跃排序","sessions.col.session":"会话","sessions.col.project":"项目","sessions.col.models":"模型","sessions.col.requests":"请求数","sessions.col.tokens":"Tokens","sessions.col.cost":"花费","sessions.col.duration":"时长","sessions.col.lastActivity":"最近活跃","sessions.untitled":"会话 {hash}","sessions.empty":"暂无会话","session.kpi.requests":"请求数","session.kpi.totalTokens":"总 tokens","session.kpi.cost":"花费","session.kpi.duration":"时长","session.timeline.title":"消息时间线","session.timeline.desc":"按时间正序,最新的在最下方","session.perMessage.title":"逐条消息 tokens","session.modelsInSession":"本会话使用的模型","session.modelLine":"{requests} 次 \xb7 {tokens} tokens","session.token.in":"输入","session.token.out":"输出","session.token.cacheR":"缓存读","session.token.cacheW":"缓存写","projects.title":"项目","projects.subtitle":"共 {count} 个项目 \xb7 按花费排序","projects.empty":"暂无项目","projects.stat.sessions":"会话","projects.stat.requests":"请求","projects.stat.tokens":"Tokens","project.activity":"活跃情况(近 30 天)","project.sessions.title":"会话({count})","models.title":"模型","models.subtitle":"共使用过 {count} 个模型","models.empty":"暂无模型用量","models.share.cost":"成本占比","models.share.tokens":"Tokens 占比","models.share.cacheHit":"缓存命中","models.field.requests":"请求数","models.field.savedByCache":"缓存节省","models.field.input1M":"输入 / 1M","models.field.output1M":"输出 / 1M","models.field.cacheRead1M":"缓存读 / 1M","models.field.pctOfTotal":"占总花费 {pct} \xb7 {tokens} tokens","models.eachTrend":"整体趋势(近 30 天)","settings.title":"设置","settings.subtitle":"数据源、价格表与行为偏好","settings.dataSources.title":"数据源","settings.dataSources.desc":"ccgauge 会扫描以下路径的 JSONL 文件","settings.dataSources.active":"已启用","settings.dataSources.notPresent":"不存在","settings.dataSources.envHint":"可以通过环境变量 {env1} 或 {env2} 自定义路径(看板会自动追加 {appendix})。","settings.rescan":"立即重新扫描","settings.rescanning":"扫描中…","settings.scanStats.title":"扫描统计","settings.scanStats.files":"扫描文件数","settings.scanStats.records":"解析记录数","settings.scanStats.assistant":"去重后 assistant 记录","settings.scanStats.duration":"扫描耗时","settings.pricing.title":"价格表","settings.pricing.desc":"美元 / 1M tokens \xb7 内置快照,对带日期后缀的模型名做 fuzzy 匹配","settings.pricing.col.model":"模型","settings.pricing.col.input":"输入","settings.pricing.col.output":"输出","settings.pricing.col.write5m":"缓存写入 5 分钟","settings.pricing.col.write1h":"缓存写入 1 小时","settings.pricing.col.read":"缓存读取","settings.preferences.title":"偏好设置","settings.preferences.language":"语言","settings.preferences.theme":"主题","settings.theme.light":"亮色","settings.theme.dark":"暗色","settings.theme.system":"跟随系统","settings.about.title":"关于","settings.about.subtitle":"版本 {version} \xb7 MIT 协议","settings.about.line1":"完全本地:数据从不离开你的机器,没有任何遥测、没有任何网络调用。","settings.about.line2":"只读:ccgauge 只读取 JSONL,绝不会写回 ~/.claude。","settings.about.line3":'缓存:扫描结果会缓存 5 秒;点击"重新扫描"可强制刷新。',"settings.about.line4":"在启动 ccgauge 的终端按 Ctrl+C 即可停止。","settings.indexer.desc":"后台 indexer 通过文件监听增量维护缓存。","settings.indexer.lastIndexedAt":"最近索引时间","settings.indexer.indexDuration":"最近索引耗时","settings.indexer.watchers":"活跃 watcher 数","settings.indexer.loadedFromDisk":"从磁盘恢复","settings.indexer.status":"状态","settings.indexer.indexing":"索引中…","settings.indexer.idle":"空闲","settings.indexer.recentErrors":"最近的索引错误","common.yes":"是","common.no":"否","lang.label":"语言","lang.en":"English","lang.zh":"中文","theme.label":"主题"}};function a(e,t,s){var o;let a=null==(o=i[e])?void 0:o[t];if(void 0===a&&(a=i.en[t]),void 0===a&&(a=t),s)for(let[e,t]of Object.entries(s))a=a.replace(RegExp("\\{".concat(e,"\\}"),"g"),String(t));return a}}}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[39],{20063:(e,t,r)=>{"use strict";var s=r(47260);r.o(s,"usePathname")&&r.d(t,{usePathname:function(){return s.usePathname}}),r.o(s,"useRouter")&&r.d(t,{useRouter:function(){return s.useRouter}}),r.o(s,"useSearchParams")&&r.d(t,{useSearchParams:function(){return s.useSearchParams}})},49567:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>n});var s=r(95155),a=r(12115),c=r(19454);function n(e){let{error:t,reset:r}=e,n=(0,c.kj)();return(0,a.useEffect)(()=>{console.error("[ccgauge] page error:",t)},[t]),(0,s.jsx)("div",{className:"max-w-2xl mx-auto px-6 py-12",children:(0,s.jsxs)("div",{className:"card card-pad text-center",children:[(0,s.jsx)("div",{className:"text-base font-semibold text-text-primary",children:n("common.error.title")}),(0,s.jsx)("p",{className:"text-sm text-text-secondary mt-2",children:n("common.error.desc")}),t.message&&(0,s.jsxs)("pre",{className:"mt-4 text-xs text-text-tertiary text-left bg-bg-surface-hi rounded p-3 overflow-auto max-h-48 whitespace-pre-wrap",children:[t.message,t.digest?"\n\n#".concat(t.digest):""]}),(0,s.jsx)("button",{onClick:()=>r(),className:"btn mt-4",children:n("common.error.retry")})]})})}},49864:(e,t,r)=>{Promise.resolve().then(r.bind(r,49567))}},e=>{e.O(0,[454,441,255,358],()=>e(e.s=49864)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[39],{20063:(e,t,r)=>{"use strict";var s=r(47260);r.o(s,"usePathname")&&r.d(t,{usePathname:function(){return s.usePathname}}),r.o(s,"useRouter")&&r.d(t,{useRouter:function(){return s.useRouter}}),r.o(s,"useSearchParams")&&r.d(t,{useSearchParams:function(){return s.useSearchParams}})},49567:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>n});var s=r(95155),a=r(12115),c=r(51148);function n(e){let{error:t,reset:r}=e,n=(0,c.kj)();return(0,a.useEffect)(()=>{console.error("[ccgauge] page error:",t)},[t]),(0,s.jsx)("div",{className:"max-w-2xl mx-auto px-6 py-12",children:(0,s.jsxs)("div",{className:"card card-pad text-center",children:[(0,s.jsx)("div",{className:"text-base font-semibold text-text-primary",children:n("common.error.title")}),(0,s.jsx)("p",{className:"text-sm text-text-secondary mt-2",children:n("common.error.desc")}),t.message&&(0,s.jsxs)("pre",{className:"mt-4 text-xs text-text-tertiary text-left bg-bg-surface-hi rounded p-3 overflow-auto max-h-48 whitespace-pre-wrap",children:[t.message,t.digest?"\n\n#".concat(t.digest):""]}),(0,s.jsx)("button",{onClick:()=>r(),className:"btn mt-4",children:n("common.error.retry")})]})})}},49864:(e,t,r)=>{Promise.resolve().then(r.bind(r,49567))}},e=>{e.O(0,[148,441,255,358],()=>e(e.s=49864)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[177],{12112:(e,t,r)=>{"use strict";r.d(t,{Providers:()=>s});var n=r(95155),a=r(51148),i=r(84479);function s(e){let{locale:t,theme:r,children:s}=e;return(0,n.jsx)(a.CY,{initialLocale:t,children:(0,n.jsx)(i.N,{initialTheme:r,children:s})})}},21264:(e,t,r)=>{"use strict";r.d(t,{LanguageSwitcher:()=>c});var n=r(95155),a=r(51148);let i={en:"EN",zh:"中"},s={en:"zh",zh:"en"},o={en:"English",zh:"中文"};function c(){let{locale:e,setLocale:t,t:r}=(0,a.s9)(),c=s[e];return(0,n.jsx)("button",{onClick:()=>t(c),className:"h-7 w-9 inline-flex items-center justify-center rounded-md border border-border bg-bg-surface text-xs font-medium text-text-secondary hover:text-text-primary hover:bg-bg-surface-hi hover:border-border-hi transition-colors",title:"".concat(r("lang.label"),": ").concat(o[e]," → ").concat(o[c]),"aria-label":r("lang.label"),children:i[e]})}},25016:(e,t,r)=>{"use strict";r.d(t,{BC:()=>m,P6:()=>g,PJ:()=>u,R8:()=>d,az:()=>c,cn:()=>i,jh:()=>o,l7:()=>l,r6:()=>h});var n=r(2821),a=r(75889);function i(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return(0,a.QP)((0,n.$)(t))}function s(e,t){var r;return new Intl.NumberFormat("en-US",{maximumFractionDigits:null!=(r=null==t?void 0:t.maxFrac)?r:0}).format(e)}function o(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"en";return Number.isFinite(e)?"zh"===t?e>=1e8?(e/1e8).toFixed(2)+"亿":e>=1e4?(e/1e4).toFixed(1)+"万":s(e):e>=1e9?(e/1e9).toFixed(2)+"B":e>=1e6?(e/1e6).toFixed(2)+"M":e>=1e3?(e/1e3).toFixed(1)+"K":s(e):"0"}function c(e,t){var r,n;return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:null!=(r=null==t?void 0:t.minFrac)?r:2,maximumFractionDigits:null!=(n=null==t?void 0:t.maxFrac)?n:2}).format(e)}function l(e){return 0===e?"$0":e<.01?new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:4,maximumFractionDigits:6}).format(e):c(e)}function d(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return Number.isFinite(e)?"".concat((100*e).toFixed(t),"%"):"0%"}function h(e){let t="string"==typeof e||"number"==typeof e?new Date(e):e;if(Number.isNaN(t.getTime()))return"";let r=t.getFullYear(),n=String(t.getMonth()+1).padStart(2,"0"),a=String(t.getDate()).padStart(2,"0"),i=String(t.getHours()).padStart(2,"0"),s=String(t.getMinutes()).padStart(2,"0"),o=String(t.getSeconds()).padStart(2,"0");return"".concat(r,"-").concat(n,"-").concat(a," ").concat(i,":").concat(s,":").concat(o)}function u(e){if(!e)return"(unknown)";let t=e.replace(/[/\\]+$/,"").split(/[/\\]+/);return t[t.length-1]||e}function m(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;return e?e.replace(/-/g,"").slice(0,t):""}let x={mini:"Mini",nano:"Nano",pro:"Pro",turbo:"Turbo",preview:"Preview"};function g(e){if(!e)return"(unknown)";let t=e.replace(/^(vertex_ai|bedrock|anthropic|openai)\//,""),r=t.toLowerCase();if(r.startsWith("gpt-")||/^o\d/.test(r))return r.startsWith("gpt-")?"GPT-"+t.slice(4).split("-").map(e=>{var t;return null!=(t=x[e.toLowerCase()])?t:e}).join(" "):t.toUpperCase();let n=t.replace(/-(\d{8})$/,""),a=(n=n.replace(/^claude-/,"")).split("-");if(a.length>=2){let e=a[0],t=a.slice(1).join(".");return p(e)+" "+t}return p(n.replace(/-/g," "))}function p(e){return e.replace(/\b\w/g,e=>e.toUpperCase())}},41290:()=>{},44703:(e,t,r)=>{"use strict";r.d(t,{ThemeSwitcher:()=>o});var n=r(95155),a=r(84479),i=r(51148);let s={light:"dark",dark:"system",system:"light"};function o(){let{theme:e,resolved:t,setTheme:r}=(0,a.D)(),{t:o}=(0,i.s9)(),l=s[e];return(0,n.jsx)("button",{onClick:()=>r(l),className:"h-7 w-9 inline-flex items-center justify-center rounded-md border border-border bg-bg-surface text-text-secondary hover:text-text-primary hover:bg-bg-surface-hi hover:border-border-hi transition-colors",title:"".concat(o("theme.label"),": ").concat(o("settings.theme.".concat(e))," (").concat(t,") → ").concat(o("settings.theme.".concat(l))),"aria-label":o("theme.label"),children:(0,n.jsx)(c,{theme:e})})}function c(e){let{theme:t}=e;return"light"===t?(0,n.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[(0,n.jsx)("circle",{cx:"12",cy:"12",r:"4"}),(0,n.jsx)("path",{d:"M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M4.93 19.07l1.41-1.41M17.66 6.34l1.41-1.41"})]}):"dark"===t?(0,n.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:(0,n.jsx)("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})}):(0,n.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[(0,n.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,n.jsx)("path",{d:"M12 3v18"}),(0,n.jsx)("path",{d:"M12 3a9 9 0 0 1 0 18z",fill:"currentColor",stroke:"none"})]})}},57581:(e,t,r)=>{"use strict";r.d(t,{Nav:()=>g});var n=r(95155),a=r(52619),i=r.n(a),s=r(20063),o=r(25016),c=r(51148),l=r(21264),d=r(44703);function h(e){let{className:t,withBackground:r=!0}=e;return(0,n.jsxs)("svg",{viewBox:"0 0 64 64",fill:"none","aria-hidden":!0,className:(0,o.cn)("block",t),children:[r&&(0,n.jsx)("rect",{width:"64",height:"64",rx:"14",className:"fill-brand"}),(0,n.jsx)("path",{d:"M14 41 A18 18 0 0 1 50 41",stroke:"currentColor",strokeOpacity:r?.32:.25,strokeWidth:"4.5",strokeLinecap:"round",className:r?"text-white":""}),(0,n.jsx)("path",{d:"M14 41 A18 18 0 0 1 43.2 25.4",stroke:"currentColor",strokeWidth:"4.5",strokeLinecap:"round",className:r?"text-white":"text-brand"}),(0,n.jsx)("line",{x1:"32",y1:"41",x2:"42",y2:"27",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",className:r?"text-white":"text-brand"}),(0,n.jsx)("circle",{cx:"32",cy:"41",r:"3",className:r?"fill-white":"fill-brand"})]})}var u=r(12115);function m(e){let{available:t,initial:r,providers:a}=e,i=(0,s.useRouter)(),o=(0,s.usePathname)(),l=(0,s.useSearchParams)(),d=(0,c.kj)(),{locale:h}=(0,c.s9)(),[m,x]=(0,u.useTransition)(),g=l.get("source"),[p,f]=(0,u.useState)(null!=g?g:r);return((0,u.useEffect)(()=>{g&&g!==p&&f(g)},[g,p]),t.length<2)?null:(0,n.jsx)("div",{role:"group","aria-label":d("nav.source"),className:"inline-flex items-center rounded-md border border-border bg-bg-surface p-0.5 gap-0.5",title:d("nav.source"),children:a.filter(e=>t.includes(e.id)).map(e=>{let t=e.id===p,r="zh"===h?e.displayZh:e.displayEn;return(0,n.jsxs)("button",{type:"button",onClick:()=>(e=>{var t;if(e===p)return;f(e),t=e,"undefined"!=typeof document&&(document.cookie="".concat("ccgauge_source","=").concat(encodeURIComponent(t),"; path=/; max-age=").concat(31536e3,"; SameSite=Lax"));let r=new URLSearchParams(l.toString());r.set("source",e);let n=/^\/sessions\/[^/]+|^\/projects\/[^/]+/.test(o)?"/".concat(o.split("/")[1],"?").concat(r.toString()):"".concat(o,"?").concat(r.toString());x(()=>{i.push(n)})})(e.id),"aria-pressed":t,disabled:m,className:"px-2.5 h-6 text-xs inline-flex items-center gap-1.5 rounded transition-all ".concat(t?"bg-brand text-white font-semibold shadow-sm ring-1 ring-brand/40":"text-text-tertiary font-medium hover:text-text-primary hover:bg-bg-surface-hi"),children:[(0,n.jsx)("span",{className:"inline-flex items-center justify-center w-3.5 h-3.5 rounded-full text-[9px] font-bold leading-none ".concat(t?"ring-1 ring-white/40":""),style:{background:e.bg,color:e.fg},children:e.shortLabel}),(0,n.jsx)("span",{children:r})]},e.id)})})}let x=[{href:"/",tk:"nav.overview",exact:!0},{href:"/usage",tk:"nav.usage"},{href:"/sessions",tk:"nav.sessions"},{href:"/projects",tk:"nav.projects"},{href:"/models",tk:"nav.models"},{href:"/settings",tk:"nav.settings"}];function g(e){let{availableProviders:t,initialSource:r,providerInfos:a}=e,u=(0,s.usePathname)(),g=(0,c.kj)();return(0,n.jsx)("header",{className:"sticky top-0 z-30 border-b border-border bg-bg-base/85 backdrop-blur-md supports-[backdrop-filter]:bg-bg-base/70",children:(0,n.jsxs)("div",{className:"max-w-7xl mx-auto px-3 sm:px-6 h-14 flex items-center gap-2 sm:gap-4",children:[(0,n.jsxs)(i(),{href:"/",className:"flex items-center gap-2 font-semibold tracking-tight whitespace-nowrap shrink-0 text-text-primary hover:opacity-90 transition-opacity","aria-label":"ccgauge home",children:[(0,n.jsx)(h,{className:"w-7 h-7"}),(0,n.jsx)("span",{className:"hidden xs:inline sm:inline",children:"ccgauge"}),(0,n.jsx)("span",{className:"text-xs text-text-tertiary font-normal hidden lg:inline",children:g("brand.tagline")})]}),(0,n.jsx)("nav",{className:"flex-1 min-w-0 flex items-center gap-0.5 overflow-x-auto nav-scroller","aria-label":"Primary",children:x.map(e=>{let t=e.exact?u===e.href:u===e.href||u.startsWith(e.href+"/");return(0,n.jsxs)(i(),{href:e.href,prefetch:!1,"aria-current":t?"page":void 0,className:(0,o.cn)("relative px-2.5 sm:px-3 py-1.5 text-sm rounded-button font-medium whitespace-nowrap shrink-0","transition-colors duration-150",t?"text-text-primary":"text-text-secondary hover:text-text-primary hover:bg-bg-surface-hi/60"),children:[g(e.tk),t&&(0,n.jsx)("span",{"aria-hidden":!0,className:"pointer-events-none absolute left-2 right-2 -bottom-[12px] h-[2px] bg-brand rounded-full"})]},e.href)})}),(0,n.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[(0,n.jsx)(m,{available:t,initial:r,providers:a}),(0,n.jsx)("span",{className:"pill bg-bg-surface-hi text-text-tertiary text-[10px] uppercase tracking-wide hidden md:inline-flex",children:g("nav.localBadge")}),(0,n.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,n.jsx)(l.LanguageSwitcher,{}),(0,n.jsx)(d.ThemeSwitcher,{})]})]})]})})}},79076:(e,t,r)=>{Promise.resolve().then(r.t.bind(r,41290,23)),Promise.resolve().then(r.bind(r,57581)),Promise.resolve().then(r.bind(r,12112))},84479:(e,t,r)=>{"use strict";r.d(t,{N:()=>d,D:()=>h});var n=r(95155),a=r(12115);let i="ccgauge_theme",s=(0,a.createContext)({theme:"dark",resolved:"dark",setTheme:()=>{}}),o="ccgauge.theme";function c(e){return"light"===e?"light":"dark"===e?"dark":window.matchMedia&&window.matchMedia("(prefers-color-scheme: light)").matches?"light":"dark"}function l(e){if("undefined"==typeof document)return;let t=document.documentElement,r=c(e);t.classList.remove("theme-light","theme-dark"),t.classList.add("light"===r?"theme-light":"theme-dark"),t.setAttribute("data-theme",r)}function d(e){let{initialTheme:t,children:r}=e,[d,h]=(0,a.useState)(t),[u,m]=(0,a.useState)(()=>"system"===t?"dark":t);(0,a.useEffect)(()=>{try{let e=localStorage.getItem(o);if("light"===e||"dark"===e||"system"===e){e!==t&&(document.cookie="".concat(i,"=").concat(e,"; path=/; max-age=").concat(31536e3,"; SameSite=Lax")),h(e);let r=c(e);m(r),l(e)}else{let e=c(t);m(e),l(t)}}catch(e){m(c(t)),l(t)}},[]),(0,a.useEffect)(()=>{if("system"!==d)return;let e=window.matchMedia("(prefers-color-scheme: light)"),t=()=>{m(e.matches?"light":"dark"),l("system")};return e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[d]);let x=(0,a.useCallback)(e=>{try{localStorage.setItem(o,e)}catch(e){}document.cookie="".concat(i,"=").concat(e,"; path=/; max-age=").concat(31536e3,"; SameSite=Lax"),h(e),m(c(e)),l(e)},[]);return(0,n.jsx)(s.Provider,{value:{theme:d,resolved:u,setTheme:x},children:r})}function h(){return(0,a.useContext)(s)}}},e=>{e.O(0,[741,760,619,148,441,255,358],()=>e(e.s=79076)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[329],{25016:(e,t,a)=>{"use strict";a.d(t,{BC:()=>h,P6:()=>p,PJ:()=>m,R8:()=>u,az:()=>l,cn:()=>i,jh:()=>s,l7:()=>o,r6:()=>d});var r=a(2821),n=a(75889);function i(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];return(0,n.QP)((0,r.$)(t))}function c(e,t){var a;return new Intl.NumberFormat("en-US",{maximumFractionDigits:null!=(a=null==t?void 0:t.maxFrac)?a:0}).format(e)}function s(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"en";return Number.isFinite(e)?"zh"===t?e>=1e8?(e/1e8).toFixed(2)+"亿":e>=1e4?(e/1e4).toFixed(1)+"万":c(e):e>=1e9?(e/1e9).toFixed(2)+"B":e>=1e6?(e/1e6).toFixed(2)+"M":e>=1e3?(e/1e3).toFixed(1)+"K":c(e):"0"}function l(e,t){var a,r;return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:null!=(a=null==t?void 0:t.minFrac)?a:2,maximumFractionDigits:null!=(r=null==t?void 0:t.maxFrac)?r:2}).format(e)}function o(e){return 0===e?"$0":e<.01?new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:4,maximumFractionDigits:6}).format(e):l(e)}function u(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return Number.isFinite(e)?"".concat((100*e).toFixed(t),"%"):"0%"}function d(e){let t="string"==typeof e||"number"==typeof e?new Date(e):e;if(Number.isNaN(t.getTime()))return"";let a=t.getFullYear(),r=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0"),i=String(t.getHours()).padStart(2,"0"),c=String(t.getMinutes()).padStart(2,"0"),s=String(t.getSeconds()).padStart(2,"0");return"".concat(a,"-").concat(r,"-").concat(n," ").concat(i,":").concat(c,":").concat(s)}function m(e){if(!e)return"(unknown)";let t=e.replace(/[/\\]+$/,"").split(/[/\\]+/);return t[t.length-1]||e}function h(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;return e?e.replace(/-/g,"").slice(0,t):""}let x={mini:"Mini",nano:"Nano",pro:"Pro",turbo:"Turbo",preview:"Preview"};function p(e){if(!e)return"(unknown)";let t=e.replace(/^(vertex_ai|bedrock|anthropic|openai)\//,""),a=t.toLowerCase();if(a.startsWith("gpt-")||/^o\d/.test(a))return a.startsWith("gpt-")?"GPT-"+t.slice(4).split("-").map(e=>{var t;return null!=(t=x[e.toLowerCase()])?t:e}).join(" "):t.toUpperCase();let r=t.replace(/-(\d{8})$/,""),n=(r=r.replace(/^claude-/,"")).split("-");if(n.length>=2){let e=n[0],t=n.slice(1).join(".");return g(e)+" "+t}return g(r.replace(/-/g," "))}function g(e){return e.replace(/\b\w/g,e=>e.toUpperCase())}},38059:(e,t,a)=>{"use strict";a.d(t,{TokenStackChart:()=>x});var r=a(95155),n=a(26991),i=a(94632),c=a(68425),s=a(47734),l=a(73697),o=a(23508),u=a(26736),d=a(25016),m=a(51148);let h={input:"rgb(var(--chart-input))",output:"rgb(var(--chart-output))",cacheRead:"rgb(var(--chart-cache-read))",cacheCreation:"rgb(var(--chart-cache-create))"};function x(e){let{data:t,height:a="h-72"}=e,x=(0,m.kj)(),{locale:f}=(0,m.s9)();return t.length?(0,r.jsxs)("div",{className:"".concat(a," w-full"),children:[(0,r.jsx)(n.u,{width:"100%",height:"100%",children:(0,r.jsxs)(i.E,{data:t,margin:{top:12,right:8,bottom:4,left:8},barCategoryGap:"22%",children:[(0,r.jsx)(c.d,{stroke:"rgb(var(--chart-grid))",strokeOpacity:.6,strokeDasharray:"3 3",vertical:!1}),(0,r.jsx)(s.W,{dataKey:"label",tick:{fill:"rgb(var(--chart-axis))",fontSize:11},tickLine:!1,axisLine:!1,interval:"preserveStartEnd",minTickGap:32,tickMargin:8}),(0,r.jsx)(l.h,{tickFormatter:e=>(0,d.jh)(Number(e),f),tick:{fill:"rgb(var(--chart-axis))",fontSize:11},tickLine:!1,axisLine:!1,width:56,tickMargin:4}),(0,r.jsx)(o.m,{content:(0,r.jsx)(g,{}),cursor:{fill:"rgb(var(--text-primary) / 0.05)",radius:4}}),(0,r.jsx)(u.y,{dataKey:"input",stackId:"a",fill:h.input,isAnimationActive:!1}),(0,r.jsx)(u.y,{dataKey:"cacheCreation",stackId:"a",fill:h.cacheCreation,isAnimationActive:!1}),(0,r.jsx)(u.y,{dataKey:"cacheRead",stackId:"a",fill:h.cacheRead,isAnimationActive:!1}),(0,r.jsx)(u.y,{dataKey:"output",stackId:"a",fill:h.output,radius:[4,4,0,0],isAnimationActive:!1})]})}),(0,r.jsxs)("div",{className:"flex items-center flex-wrap justify-center gap-4 text-xs text-text-secondary mt-2",children:[(0,r.jsx)(p,{color:h.input,label:x("chart.legend.input")}),(0,r.jsx)(p,{color:h.cacheCreation,label:x("chart.legend.cacheWrite")}),(0,r.jsx)(p,{color:h.cacheRead,label:x("chart.legend.cacheRead")}),(0,r.jsx)(p,{color:h.output,label:x("chart.legend.output")})]})]}):(0,r.jsx)("div",{className:"".concat(a," flex items-center justify-center text-text-tertiary text-sm"),children:x("chart.empty")})}function p(e){let{color:t,label:a}=e;return(0,r.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,r.jsx)("span",{className:"w-2.5 h-2.5 rounded-sm",style:{background:t}}),(0,r.jsx)("span",{children:a})]})}function g(e){let t=(0,m.kj)(),{locale:a}=(0,m.s9)();if(!e.active||!e.payload||!e.payload.length)return null;let n=e.payload[0].payload,i=n.input+n.output+n.cacheRead+n.cacheCreation;return(0,r.jsxs)("div",{className:"card-elevated border border-border-hi rounded-card p-3 text-xs min-w-[200px]",children:[(0,r.jsx)("div",{className:"font-medium text-text-primary mb-2",children:e.label}),(0,r.jsxs)("div",{className:"space-y-1",children:[(0,r.jsx)(f,{color:h.input,label:t("chart.legend.input"),value:n.input,locale:a}),(0,r.jsx)(f,{color:h.cacheCreation,label:t("chart.legend.cacheWrite"),value:n.cacheCreation,locale:a}),(0,r.jsx)(f,{color:h.cacheRead,label:t("chart.legend.cacheRead"),value:n.cacheRead,locale:a}),(0,r.jsx)(f,{color:h.output,label:t("chart.legend.output"),value:n.output,locale:a})]}),(0,r.jsxs)("div",{className:"mt-2 pt-2 border-t border-border flex items-center justify-between",children:[(0,r.jsx)("span",{className:"text-text-secondary",children:t("chart.tooltip.total")}),(0,r.jsx)("span",{className:"num-mono text-text-primary",children:(0,d.jh)(i,a)})]}),(0,r.jsxs)("div",{className:"flex items-center justify-between mt-1",children:[(0,r.jsx)("span",{className:"text-text-secondary",children:t("chart.tooltip.cost")}),(0,r.jsx)("span",{className:"num-mono text-brand",children:(0,d.az)(n.cost)})]}),(0,r.jsxs)("div",{className:"flex items-center justify-between mt-1",children:[(0,r.jsx)("span",{className:"text-text-secondary",children:t("chart.tooltip.requests")}),(0,r.jsx)("span",{className:"num-mono text-text-primary",children:n.requests})]})]})}function f(e){let{color:t,label:a,value:n,locale:i}=e;return(0,r.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,r.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-text-secondary",children:[(0,r.jsx)("span",{className:"w-2 h-2 rounded-sm",style:{background:t}}),a]}),(0,r.jsx)("span",{className:"num-mono text-text-primary",children:(0,d.jh)(n,i)})]})}},85653:(e,t,a)=>{Promise.resolve().then(a.bind(a,38059))}},e=>{e.O(0,[760,930,148,441,255,358],()=>e(e.s=85653)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[974],{8608:(e,t,a)=>{"use strict";a.d(t,{ModelBarChart:()=>c});var r=a(95155),s=a(25016),n=a(51148);let i={opus:"rgb(var(--chart-output))",sonnet:"rgb(var(--chart-input))",haiku:"rgb(var(--chart-cache-read))"};function c(e){let{models:t}=e,a=(0,n.kj)(),{locale:c}=(0,n.s9)();if(!t.length)return(0,r.jsx)("div",{className:"text-sm text-text-tertiary",children:a("chart.empty")});let l=Math.max(...t.map(e=>e.cost),1e-4),o=t.reduce((e,t)=>e+t.cost,0);return(0,r.jsx)("div",{className:"space-y-3.5",children:t.map(e=>{let t=o>0?e.cost/o:0;return(0,r.jsxs)("div",{className:"space-y-1.5 group",children:[(0,r.jsxs)("div",{className:"flex items-baseline justify-between gap-3 text-sm",children:[(0,r.jsx)("span",{className:"font-medium text-text-primary truncate",children:(0,s.P6)(e.model)}),(0,r.jsxs)("span",{className:"text-xs text-text-tertiary tabular-nums flex-1 text-right",children:[(0,s.jh)(e.totalTokens,c)," \xb7 ",(0,s.R8)(t)]}),(0,r.jsx)("span",{className:"num-mono font-medium text-text-primary min-w-[80px] text-right",children:(0,s.az)(e.cost)})]}),(0,r.jsx)("div",{className:"h-2 w-full bg-bg-surface-hi rounded-full overflow-hidden",children:(0,r.jsx)("div",{className:"h-full rounded-full transition-all duration-500 ease-out-soft group-hover:brightness-110",style:{width:"".concat(e.cost/l*100,"%"),background:function(e){for(let t of Object.keys(i))if(e.toLowerCase().includes(t))return i[t];return"rgb(var(--chart-cache-create))"}(e.model)}})})]},e.model)})})}},25016:(e,t,a)=>{"use strict";a.d(t,{BC:()=>u,P6:()=>p,PJ:()=>m,R8:()=>d,az:()=>l,cn:()=>n,jh:()=>c,l7:()=>o,r6:()=>x});var r=a(2821),s=a(75889);function n(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];return(0,s.QP)((0,r.$)(t))}function i(e,t){var a;return new Intl.NumberFormat("en-US",{maximumFractionDigits:null!=(a=null==t?void 0:t.maxFrac)?a:0}).format(e)}function c(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"en";return Number.isFinite(e)?"zh"===t?e>=1e8?(e/1e8).toFixed(2)+"亿":e>=1e4?(e/1e4).toFixed(1)+"万":i(e):e>=1e9?(e/1e9).toFixed(2)+"B":e>=1e6?(e/1e6).toFixed(2)+"M":e>=1e3?(e/1e3).toFixed(1)+"K":i(e):"0"}function l(e,t){var a,r;return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:null!=(a=null==t?void 0:t.minFrac)?a:2,maximumFractionDigits:null!=(r=null==t?void 0:t.maxFrac)?r:2}).format(e)}function o(e){return 0===e?"$0":e<.01?new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:4,maximumFractionDigits:6}).format(e):l(e)}function d(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return Number.isFinite(e)?"".concat((100*e).toFixed(t),"%"):"0%"}function x(e){let t="string"==typeof e||"number"==typeof e?new Date(e):e;if(Number.isNaN(t.getTime()))return"";let a=t.getFullYear(),r=String(t.getMonth()+1).padStart(2,"0"),s=String(t.getDate()).padStart(2,"0"),n=String(t.getHours()).padStart(2,"0"),i=String(t.getMinutes()).padStart(2,"0"),c=String(t.getSeconds()).padStart(2,"0");return"".concat(a,"-").concat(r,"-").concat(s," ").concat(n,":").concat(i,":").concat(c)}function m(e){if(!e)return"(unknown)";let t=e.replace(/[/\\]+$/,"").split(/[/\\]+/);return t[t.length-1]||e}function u(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;return e?e.replace(/-/g,"").slice(0,t):""}let h={mini:"Mini",nano:"Nano",pro:"Pro",turbo:"Turbo",preview:"Preview"};function p(e){if(!e)return"(unknown)";let t=e.replace(/^(vertex_ai|bedrock|anthropic|openai)\//,""),a=t.toLowerCase();if(a.startsWith("gpt-")||/^o\d/.test(a))return a.startsWith("gpt-")?"GPT-"+t.slice(4).split("-").map(e=>{var t;return null!=(t=h[e.toLowerCase()])?t:e}).join(" "):t.toUpperCase();let r=t.replace(/-(\d{8})$/,""),s=(r=r.replace(/^claude-/,"")).split("-");if(s.length>=2){let e=s[0],t=s.slice(1).join(".");return f(e)+" "+t}return f(r.replace(/-/g," "))}function f(e){return e.replace(/\b\w/g,e=>e.toUpperCase())}},25763:(e,t,a)=>{"use strict";a.d(t,{BlockProgress:()=>c});var r=a(95155),s=a(12115),n=a(25016),i=a(51148);function c(e){let{initial:t,className:a}=e,s=(0,i.kj)(),{locale:c}=(0,i.s9)(),o=e=>(0,n.jh)(e,c);return t.hasBlock&&t.endTime&&t.startTime?(0,r.jsxs)("div",{className:(0,n.cn)("card card-pad min-h-[180px] flex flex-col",a),children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("div",{className:"label",children:s("block.title")}),(0,r.jsxs)("span",{className:"pill bg-success/10 text-success border border-success/20",children:[(0,r.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-success mr-1 animate-pulse"}),s("common.live")]})]}),(0,r.jsx)(l,{startTime:t.startTime,endTime:t.endTime,totalTokens:t.totalTokens,remainingLabel:s("block.remaining"),renderElapsed:e=>s("block.elapsed",{pct:e}),tokensSuffix:s("block.tokensSuffix"),fmtTokens:o}),(0,r.jsxs)("div",{className:"mt-4 pt-4 border-t border-border grid grid-cols-2 gap-3 text-xs",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-text-tertiary",children:s("block.spentSoFar")}),(0,r.jsx)("div",{className:"num-mono text-text-primary mt-0.5 text-base",children:(0,n.az)(t.cost)})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-text-tertiary",children:s("block.burnPerMin")}),(0,r.jsx)("div",{className:"num-mono text-text-primary mt-0.5 text-base",children:o(t.burnRatePerMin)})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-text-tertiary",children:s("block.projectedTotal")}),(0,r.jsx)("div",{className:"num-mono text-text-secondary mt-0.5",children:(0,n.az)(t.projectedCost)})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-text-tertiary",children:s("block.requests")}),(0,r.jsx)("div",{className:"num-mono text-text-secondary mt-0.5",children:t.requests})]})]}),(0,r.jsx)("div",{className:"mt-auto pt-3 text-[11px] leading-relaxed text-text-tertiary",children:s("block.disclaimer")})]}):(0,r.jsxs)("div",{className:(0,n.cn)("card card-pad min-h-[180px] flex flex-col",a),children:[(0,r.jsx)("div",{className:"label",children:s("block.title")}),(0,r.jsx)("div",{className:"text-sm text-text-tertiary mt-4",children:s("block.empty")}),(0,r.jsx)("div",{className:"text-xs text-text-tertiary mt-1",children:s("block.emptyDesc")})]})}function l(e){let{startTime:t,endTime:a,totalTokens:n,remainingLabel:i,renderElapsed:c,tokensSuffix:l,fmtTokens:o}=e,[d,x]=(0,s.useState)(()=>Date.now());(0,s.useEffect)(()=>{let e=setInterval(()=>x(Date.now()),1e3);return()=>clearInterval(e)},[]);let m=new Date(t).getTime(),u=new Date(a).getTime(),h=Math.max(0,d-m),p=Math.max(0,u-d),f=Math.min(1,h/(u-m)),v=c((100*f).toFixed(1));return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"mt-3 flex items-baseline gap-2",children:[(0,r.jsx)("div",{className:"num-hero",children:function(e){if(e<=0)return"0s";let t=Math.floor(e/1e3),a=Math.floor(t/3600),r=Math.floor(t%3600/60),s=t%60;return a>0?"".concat(a,"h ").concat(String(r).padStart(2,"0"),"m"):r>0?"".concat(r,"m ").concat(String(s).padStart(2,"0"),"s"):"".concat(s,"s")}(p)}),(0,r.jsx)("div",{className:"text-xs text-text-secondary",children:i})]}),(0,r.jsxs)("div",{className:"mt-3 space-y-2",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between text-xs text-text-secondary",children:[(0,r.jsx)("span",{children:v}),(0,r.jsxs)("span",{className:"num-mono",children:[o(n)," ",l]})]}),(0,r.jsx)("div",{className:"h-1.5 bg-bg-surface-hi rounded-full overflow-hidden",children:(0,r.jsx)("div",{className:"h-full bg-gradient-to-r from-brand to-brand-hover transition-all",style:{width:"".concat(100*f,"%")},suppressHydrationWarning:!0})})]})]})}},38059:(e,t,a)=>{"use strict";a.d(t,{TokenStackChart:()=>h});var r=a(95155),s=a(26991),n=a(94632),i=a(68425),c=a(47734),l=a(73697),o=a(23508),d=a(26736),x=a(25016),m=a(51148);let u={input:"rgb(var(--chart-input))",output:"rgb(var(--chart-output))",cacheRead:"rgb(var(--chart-cache-read))",cacheCreation:"rgb(var(--chart-cache-create))"};function h(e){let{data:t,height:a="h-72"}=e,h=(0,m.kj)(),{locale:v}=(0,m.s9)();return t.length?(0,r.jsxs)("div",{className:"".concat(a," w-full"),children:[(0,r.jsx)(s.u,{width:"100%",height:"100%",children:(0,r.jsxs)(n.E,{data:t,margin:{top:12,right:8,bottom:4,left:8},barCategoryGap:"22%",children:[(0,r.jsx)(i.d,{stroke:"rgb(var(--chart-grid))",strokeOpacity:.6,strokeDasharray:"3 3",vertical:!1}),(0,r.jsx)(c.W,{dataKey:"label",tick:{fill:"rgb(var(--chart-axis))",fontSize:11},tickLine:!1,axisLine:!1,interval:"preserveStartEnd",minTickGap:32,tickMargin:8}),(0,r.jsx)(l.h,{tickFormatter:e=>(0,x.jh)(Number(e),v),tick:{fill:"rgb(var(--chart-axis))",fontSize:11},tickLine:!1,axisLine:!1,width:56,tickMargin:4}),(0,r.jsx)(o.m,{content:(0,r.jsx)(f,{}),cursor:{fill:"rgb(var(--text-primary) / 0.05)",radius:4}}),(0,r.jsx)(d.y,{dataKey:"input",stackId:"a",fill:u.input,isAnimationActive:!1}),(0,r.jsx)(d.y,{dataKey:"cacheCreation",stackId:"a",fill:u.cacheCreation,isAnimationActive:!1}),(0,r.jsx)(d.y,{dataKey:"cacheRead",stackId:"a",fill:u.cacheRead,isAnimationActive:!1}),(0,r.jsx)(d.y,{dataKey:"output",stackId:"a",fill:u.output,radius:[4,4,0,0],isAnimationActive:!1})]})}),(0,r.jsxs)("div",{className:"flex items-center flex-wrap justify-center gap-4 text-xs text-text-secondary mt-2",children:[(0,r.jsx)(p,{color:u.input,label:h("chart.legend.input")}),(0,r.jsx)(p,{color:u.cacheCreation,label:h("chart.legend.cacheWrite")}),(0,r.jsx)(p,{color:u.cacheRead,label:h("chart.legend.cacheRead")}),(0,r.jsx)(p,{color:u.output,label:h("chart.legend.output")})]})]}):(0,r.jsx)("div",{className:"".concat(a," flex items-center justify-center text-text-tertiary text-sm"),children:h("chart.empty")})}function p(e){let{color:t,label:a}=e;return(0,r.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,r.jsx)("span",{className:"w-2.5 h-2.5 rounded-sm",style:{background:t}}),(0,r.jsx)("span",{children:a})]})}function f(e){let t=(0,m.kj)(),{locale:a}=(0,m.s9)();if(!e.active||!e.payload||!e.payload.length)return null;let s=e.payload[0].payload,n=s.input+s.output+s.cacheRead+s.cacheCreation;return(0,r.jsxs)("div",{className:"card-elevated border border-border-hi rounded-card p-3 text-xs min-w-[200px]",children:[(0,r.jsx)("div",{className:"font-medium text-text-primary mb-2",children:e.label}),(0,r.jsxs)("div",{className:"space-y-1",children:[(0,r.jsx)(v,{color:u.input,label:t("chart.legend.input"),value:s.input,locale:a}),(0,r.jsx)(v,{color:u.cacheCreation,label:t("chart.legend.cacheWrite"),value:s.cacheCreation,locale:a}),(0,r.jsx)(v,{color:u.cacheRead,label:t("chart.legend.cacheRead"),value:s.cacheRead,locale:a}),(0,r.jsx)(v,{color:u.output,label:t("chart.legend.output"),value:s.output,locale:a})]}),(0,r.jsxs)("div",{className:"mt-2 pt-2 border-t border-border flex items-center justify-between",children:[(0,r.jsx)("span",{className:"text-text-secondary",children:t("chart.tooltip.total")}),(0,r.jsx)("span",{className:"num-mono text-text-primary",children:(0,x.jh)(n,a)})]}),(0,r.jsxs)("div",{className:"flex items-center justify-between mt-1",children:[(0,r.jsx)("span",{className:"text-text-secondary",children:t("chart.tooltip.cost")}),(0,r.jsx)("span",{className:"num-mono text-brand",children:(0,x.az)(s.cost)})]}),(0,r.jsxs)("div",{className:"flex items-center justify-between mt-1",children:[(0,r.jsx)("span",{className:"text-text-secondary",children:t("chart.tooltip.requests")}),(0,r.jsx)("span",{className:"num-mono text-text-primary",children:s.requests})]})]})}function v(e){let{color:t,label:a,value:s,locale:n}=e;return(0,r.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,r.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-text-secondary",children:[(0,r.jsx)("span",{className:"w-2 h-2 rounded-sm",style:{background:t}}),a]}),(0,r.jsx)("span",{className:"num-mono text-text-primary",children:(0,x.jh)(s,n)})]})}},62764:(e,t,a)=>{Promise.resolve().then(a.bind(a,69612)),Promise.resolve().then(a.bind(a,25763)),Promise.resolve().then(a.bind(a,8608)),Promise.resolve().then(a.bind(a,38059))},69612:(e,t,a)=>{"use strict";a.d(t,{ActivityStatsSection:()=>l});var r=a(95155),s=a(12115),n=a(25016);function i(e){let{title:t,desc:a,right:s,children:i,className:c,inlineDesc:l,fillBody:o}=e;return(0,r.jsxs)("section",{className:(0,n.cn)("card overflow-hidden mt-3",o&&"flex flex-col",c),children:[(t||s)&&(0,r.jsxs)("header",{className:(0,n.cn)("section-header","flex flex-col sm:flex-row sm:items-start sm:justify-between gap-3 sm:gap-4","px-5 sm:px-6 pt-4 sm:pt-5 pb-3 border-b border-border"),children:[(0,r.jsxs)("div",{className:(0,n.cn)("min-w-0",l&&"sm:flex sm:items-baseline sm:gap-2.5"),children:[t&&(0,r.jsx)("h2",{className:"text-[15px] font-semibold text-text-primary tracking-tight leading-tight",children:t}),a&&(0,r.jsx)("p",{className:(0,n.cn)("text-xs text-text-secondary leading-relaxed",l?"mt-1 sm:mt-0":"mt-1.5"),children:a})]}),s&&(0,r.jsx)("div",{className:"flex items-center gap-2 flex-wrap",children:s})]}),(0,r.jsx)("div",{className:(0,n.cn)("p-5 sm:p-6",o&&"flex-1 flex flex-col"),children:i})]})}var c=a(79808);function l(e){var t;let{stats:a,comparison:n,locale:l,className:x}=e,m=(0,s.useCallback)((e,t)=>(0,c.nA)(l,e,t),[l]),u=[{label:m("activity.activeDays"),value:a.activeDays.toLocaleString()},{label:m("activity.streakCombinedLabel"),value:m("activity.streakCombinedValue",{current:a.currentStreak,longest:a.longestStreak})},{label:m("activity.peakHour"),value:a.peakHour<0?"—":h(a.peakHour,l)}];return(0,r.jsx)(i,{title:m("activity.title"),desc:m("activity.subtitle"),inlineDesc:!0,fillBody:!0,className:x,children:(0,r.jsxs)("div",{className:"flex flex-col md:flex-row gap-5 md:gap-8 items-stretch flex-1",children:[(0,r.jsx)("div",{className:"grid grid-cols-3 md:flex md:flex-col md:w-[170px] md:shrink-0 gap-2.5",children:u.map(e=>(0,r.jsx)(o,{label:e.label,value:e.value},e.label))}),(0,r.jsxs)("div",{className:"flex-1 min-w-0 flex flex-col",children:[(0,r.jsx)(d,{data:a.heatmap,tokens:a.tokenHeatmap,max:a.heatmapMax,locale:l}),n&&(0,r.jsx)("div",{className:"mt-auto pt-4 text-xs text-text-tertiary leading-relaxed",children:m("activity.comparison",{multiplier:(t=n.multiplier)<10?t.toFixed(1):t<1e3?Math.round(t).toString():t<1e6?(t/1e3).toFixed(1)+"K":(t/1e6).toFixed(1)+"M",ref:m("activity.ref.".concat(n.refKey))})})]})]})})}function o(e){let{label:t,value:a}=e;return(0,r.jsxs)("div",{className:"rounded-button bg-bg-surface-hi/60 border border-border px-3.5 py-3 flex-1 flex flex-col justify-center min-h-[64px]",children:[(0,r.jsx)("div",{className:"text-[11px] uppercase tracking-[0.06em] text-text-tertiary font-semibold truncate",children:t}),(0,r.jsx)("div",{className:"num-mono text-xl font-semibold text-text-primary mt-1 leading-none truncate",children:a})]})}function d(e){let{data:t,tokens:a,max:n,locale:i}=e,l=(0,s.useCallback)((e,t)=>(0,c.nA)(i,e,t),[i]),o=[0,3,6,9,12,15,18,21],[d,m]=(0,s.useState)(null),h=(0,s.useMemo)(()=>{let e=0,r=0,s=0;for(let a of t)for(let t of a)e+=t;for(let e of a)for(let t of e)r+=t,t>s&&(s=t);return{messages:e,tokens:r,maxTokens:s}},[t,a]);function p(e,r,s){let n=e.currentTarget.getBoundingClientRect();m({dow:r,hour:s,count:t[r][s],tokens:a[r][s],rect:{left:n.left,top:n.top,width:n.width,height:n.height}})}return(0,r.jsxs)("div",{className:"w-full",children:[(0,r.jsxs)("div",{className:"grid gap-y-[3px] [grid-template-columns:auto_1fr] items-center",children:[t.map((e,t)=>(0,r.jsx)(x,{dow:t,row:e,max:n,t:l,onCellHover:p,onLeave:()=>m(null)},t)),(0,r.jsx)("div",{className:"text-[10px] text-text-tertiary opacity-0 select-none pr-2",children:"."}),(0,r.jsx)("div",{className:"grid [grid-template-columns:repeat(24,minmax(0,1fr))] text-[10px] text-text-tertiary tabular-nums gap-[3px] mt-1",children:Array.from({length:24}).map((e,t)=>{var a;return(0,r.jsx)("div",{className:"text-center leading-none",children:o.includes(t)?(a=t,"zh"===i?"".concat(a):0===a?"12a":a<12?"".concat(a,"a"):12===a?"12p":"".concat(a-12,"p")):""},t)})})]}),d&&(0,r.jsx)(u,{hover:d,locale:i,totalMessages:h.messages,totalTokens:h.tokens,maxCount:n,maxTokens:h.maxTokens,t:l})]})}function x(e){let{dow:t,row:a,max:s,t:n,onCellHover:i,onLeave:c}=e,l=n("activity.dow.".concat(t));return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"text-[11px] text-text-tertiary tabular-nums pr-2.5 leading-none whitespace-nowrap",children:l}),(0,r.jsx)("div",{className:"grid [grid-template-columns:repeat(24,minmax(0,1fr))] gap-[3px]",onMouseLeave:c,children:a.map((e,a)=>(0,r.jsx)(m,{count:e,max:s,onHover:e=>i(e,t,a)},a))})]})}function m(e){let{count:t,max:a,onHover:s}=e,i=a>0&&t>0?Math.sqrt(t/a):0,c=t?{backgroundColor:"rgb(var(--brand) / ".concat((.18+.82*i).toFixed(2),")")}:{};return(0,r.jsx)("div",{onMouseEnter:s,className:(0,n.cn)("aspect-square rounded-[3px] transition-transform duration-100","hover:scale-125 hover:ring-1 hover:ring-brand/60 hover:z-10 relative",!t&&"bg-bg-surface-hi"),style:c})}function u(e){let{hover:t,locale:a,totalMessages:s,totalTokens:i,maxCount:c,maxTokens:l,t:o}=e,d=t.rect.left+t.rect.width/2,x=t.rect.top-8,m=o("activity.dow.".concat(t.dow)),u=function(e,t){let a=(e+1)%24;return"zh"===t?"".concat(e.toString().padStart(2,"0"),":00 – ").concat(a.toString().padStart(2,"0"),":00"):"".concat(h(e,t)," – ").concat(h(a,t))}(t.hour,a),p=s>0?t.count/s*100:0,f=c>0?t.count/c*100:0,v=i>0?t.tokens/i*100:0,g=l>0?t.tokens/l*100:0;return(0,r.jsx)("div",{role:"tooltip",className:"pointer-events-none fixed z-50",style:{left:d,top:x,transform:"translate(-50%, -100%)"},children:(0,r.jsxs)("div",{className:"card-elevated rounded-button px-3 py-2 text-xs whitespace-nowrap shadow-xl border border-border-hi bg-bg-elevated min-w-[180px]",children:[(0,r.jsxs)("div",{className:"font-semibold text-text-primary mb-1",children:[m," \xb7 ",u]}),t.count>0?(0,r.jsxs)("div",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5 text-text-secondary tabular-nums",children:[(0,r.jsx)("span",{className:"text-text-tertiary",children:o("activity.heatmap.messages")}),(0,r.jsxs)("span",{className:"text-right",children:[t.count.toLocaleString(),(0,r.jsxs)("span",{className:"text-text-tertiary ml-1.5",children:["\xb7 ",p.toFixed(1),"% / ",f.toFixed(0),"%"]})]}),(0,r.jsx)("span",{className:"text-text-tertiary",children:o("activity.heatmap.tokens")}),(0,r.jsxs)("span",{className:"text-right",children:[(0,n.jh)(t.tokens,a),(0,r.jsxs)("span",{className:"text-text-tertiary ml-1.5",children:["\xb7 ",v.toFixed(1),"% / ",g.toFixed(0),"%"]})]})]}):(0,r.jsx)("div",{className:"text-text-tertiary",children:o("activity.heatmap.empty")})]})})}function h(e,t){return"zh"===t?"".concat(e,":00"):0===e?"12 AM":e<12?"".concat(e," AM"):12===e?"12 PM":"".concat(e-12," PM")}}},e=>{e.O(0,[760,930,148,441,255,358],()=>e(e.s=62764)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[801,824],{25016:(e,t,a)=>{"use strict";a.d(t,{BC:()=>h,P6:()=>p,PJ:()=>m,R8:()=>u,az:()=>l,cn:()=>i,jh:()=>s,l7:()=>o,r6:()=>d});var r=a(2821),n=a(75889);function i(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];return(0,n.QP)((0,r.$)(t))}function c(e,t){var a;return new Intl.NumberFormat("en-US",{maximumFractionDigits:null!=(a=null==t?void 0:t.maxFrac)?a:0}).format(e)}function s(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"en";return Number.isFinite(e)?"zh"===t?e>=1e8?(e/1e8).toFixed(2)+"亿":e>=1e4?(e/1e4).toFixed(1)+"万":c(e):e>=1e9?(e/1e9).toFixed(2)+"B":e>=1e6?(e/1e6).toFixed(2)+"M":e>=1e3?(e/1e3).toFixed(1)+"K":c(e):"0"}function l(e,t){var a,r;return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:null!=(a=null==t?void 0:t.minFrac)?a:2,maximumFractionDigits:null!=(r=null==t?void 0:t.maxFrac)?r:2}).format(e)}function o(e){return 0===e?"$0":e<.01?new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:4,maximumFractionDigits:6}).format(e):l(e)}function u(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return Number.isFinite(e)?"".concat((100*e).toFixed(t),"%"):"0%"}function d(e){let t="string"==typeof e||"number"==typeof e?new Date(e):e;if(Number.isNaN(t.getTime()))return"";let a=t.getFullYear(),r=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0"),i=String(t.getHours()).padStart(2,"0"),c=String(t.getMinutes()).padStart(2,"0"),s=String(t.getSeconds()).padStart(2,"0");return"".concat(a,"-").concat(r,"-").concat(n," ").concat(i,":").concat(c,":").concat(s)}function m(e){if(!e)return"(unknown)";let t=e.replace(/[/\\]+$/,"").split(/[/\\]+/);return t[t.length-1]||e}function h(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;return e?e.replace(/-/g,"").slice(0,t):""}let x={mini:"Mini",nano:"Nano",pro:"Pro",turbo:"Turbo",preview:"Preview"};function p(e){if(!e)return"(unknown)";let t=e.replace(/^(vertex_ai|bedrock|anthropic|openai)\//,""),a=t.toLowerCase();if(a.startsWith("gpt-")||/^o\d/.test(a))return a.startsWith("gpt-")?"GPT-"+t.slice(4).split("-").map(e=>{var t;return null!=(t=x[e.toLowerCase()])?t:e}).join(" "):t.toUpperCase();let r=t.replace(/-(\d{8})$/,""),n=(r=r.replace(/^claude-/,"")).split("-");if(n.length>=2){let e=n[0],t=n.slice(1).join(".");return g(e)+" "+t}return g(r.replace(/-/g," "))}function g(e){return e.replace(/\b\w/g,e=>e.toUpperCase())}},38059:(e,t,a)=>{"use strict";a.d(t,{TokenStackChart:()=>x});var r=a(95155),n=a(26991),i=a(94632),c=a(68425),s=a(47734),l=a(73697),o=a(23508),u=a(26736),d=a(25016),m=a(51148);let h={input:"rgb(var(--chart-input))",output:"rgb(var(--chart-output))",cacheRead:"rgb(var(--chart-cache-read))",cacheCreation:"rgb(var(--chart-cache-create))"};function x(e){let{data:t,height:a="h-72"}=e,x=(0,m.kj)(),{locale:f}=(0,m.s9)();return t.length?(0,r.jsxs)("div",{className:"".concat(a," w-full"),children:[(0,r.jsx)(n.u,{width:"100%",height:"100%",children:(0,r.jsxs)(i.E,{data:t,margin:{top:12,right:8,bottom:4,left:8},barCategoryGap:"22%",children:[(0,r.jsx)(c.d,{stroke:"rgb(var(--chart-grid))",strokeOpacity:.6,strokeDasharray:"3 3",vertical:!1}),(0,r.jsx)(s.W,{dataKey:"label",tick:{fill:"rgb(var(--chart-axis))",fontSize:11},tickLine:!1,axisLine:!1,interval:"preserveStartEnd",minTickGap:32,tickMargin:8}),(0,r.jsx)(l.h,{tickFormatter:e=>(0,d.jh)(Number(e),f),tick:{fill:"rgb(var(--chart-axis))",fontSize:11},tickLine:!1,axisLine:!1,width:56,tickMargin:4}),(0,r.jsx)(o.m,{content:(0,r.jsx)(g,{}),cursor:{fill:"rgb(var(--text-primary) / 0.05)",radius:4}}),(0,r.jsx)(u.y,{dataKey:"input",stackId:"a",fill:h.input,isAnimationActive:!1}),(0,r.jsx)(u.y,{dataKey:"cacheCreation",stackId:"a",fill:h.cacheCreation,isAnimationActive:!1}),(0,r.jsx)(u.y,{dataKey:"cacheRead",stackId:"a",fill:h.cacheRead,isAnimationActive:!1}),(0,r.jsx)(u.y,{dataKey:"output",stackId:"a",fill:h.output,radius:[4,4,0,0],isAnimationActive:!1})]})}),(0,r.jsxs)("div",{className:"flex items-center flex-wrap justify-center gap-4 text-xs text-text-secondary mt-2",children:[(0,r.jsx)(p,{color:h.input,label:x("chart.legend.input")}),(0,r.jsx)(p,{color:h.cacheCreation,label:x("chart.legend.cacheWrite")}),(0,r.jsx)(p,{color:h.cacheRead,label:x("chart.legend.cacheRead")}),(0,r.jsx)(p,{color:h.output,label:x("chart.legend.output")})]})]}):(0,r.jsx)("div",{className:"".concat(a," flex items-center justify-center text-text-tertiary text-sm"),children:x("chart.empty")})}function p(e){let{color:t,label:a}=e;return(0,r.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,r.jsx)("span",{className:"w-2.5 h-2.5 rounded-sm",style:{background:t}}),(0,r.jsx)("span",{children:a})]})}function g(e){let t=(0,m.kj)(),{locale:a}=(0,m.s9)();if(!e.active||!e.payload||!e.payload.length)return null;let n=e.payload[0].payload,i=n.input+n.output+n.cacheRead+n.cacheCreation;return(0,r.jsxs)("div",{className:"card-elevated border border-border-hi rounded-card p-3 text-xs min-w-[200px]",children:[(0,r.jsx)("div",{className:"font-medium text-text-primary mb-2",children:e.label}),(0,r.jsxs)("div",{className:"space-y-1",children:[(0,r.jsx)(f,{color:h.input,label:t("chart.legend.input"),value:n.input,locale:a}),(0,r.jsx)(f,{color:h.cacheCreation,label:t("chart.legend.cacheWrite"),value:n.cacheCreation,locale:a}),(0,r.jsx)(f,{color:h.cacheRead,label:t("chart.legend.cacheRead"),value:n.cacheRead,locale:a}),(0,r.jsx)(f,{color:h.output,label:t("chart.legend.output"),value:n.output,locale:a})]}),(0,r.jsxs)("div",{className:"mt-2 pt-2 border-t border-border flex items-center justify-between",children:[(0,r.jsx)("span",{className:"text-text-secondary",children:t("chart.tooltip.total")}),(0,r.jsx)("span",{className:"num-mono text-text-primary",children:(0,d.jh)(i,a)})]}),(0,r.jsxs)("div",{className:"flex items-center justify-between mt-1",children:[(0,r.jsx)("span",{className:"text-text-secondary",children:t("chart.tooltip.cost")}),(0,r.jsx)("span",{className:"num-mono text-brand",children:(0,d.az)(n.cost)})]}),(0,r.jsxs)("div",{className:"flex items-center justify-between mt-1",children:[(0,r.jsx)("span",{className:"text-text-secondary",children:t("chart.tooltip.requests")}),(0,r.jsx)("span",{className:"num-mono text-text-primary",children:n.requests})]})]})}function f(e){let{color:t,label:a,value:n,locale:i}=e;return(0,r.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,r.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-text-secondary",children:[(0,r.jsx)("span",{className:"w-2 h-2 rounded-sm",style:{background:t}}),a]}),(0,r.jsx)("span",{className:"num-mono text-text-primary",children:(0,d.jh)(n,i)})]})}},62509:(e,t,a)=>{Promise.resolve().then(a.bind(a,38059)),Promise.resolve().then(a.t.bind(a,52619,23))}},e=>{e.O(0,[760,930,619,148,441,255,358],()=>e(e.s=62509)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[801,824],{25016:(e,t,a)=>{"use strict";a.d(t,{BC:()=>h,P6:()=>p,PJ:()=>m,R8:()=>u,az:()=>l,cn:()=>i,jh:()=>s,l7:()=>o,r6:()=>d});var r=a(2821),n=a(75889);function i(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];return(0,n.QP)((0,r.$)(t))}function c(e,t){var a;return new Intl.NumberFormat("en-US",{maximumFractionDigits:null!=(a=null==t?void 0:t.maxFrac)?a:0}).format(e)}function s(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"en";return Number.isFinite(e)?"zh"===t?e>=1e8?(e/1e8).toFixed(2)+"亿":e>=1e4?(e/1e4).toFixed(1)+"万":c(e):e>=1e9?(e/1e9).toFixed(2)+"B":e>=1e6?(e/1e6).toFixed(2)+"M":e>=1e3?(e/1e3).toFixed(1)+"K":c(e):"0"}function l(e,t){var a,r;return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:null!=(a=null==t?void 0:t.minFrac)?a:2,maximumFractionDigits:null!=(r=null==t?void 0:t.maxFrac)?r:2}).format(e)}function o(e){return 0===e?"$0":e<.01?new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:4,maximumFractionDigits:6}).format(e):l(e)}function u(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return Number.isFinite(e)?"".concat((100*e).toFixed(t),"%"):"0%"}function d(e){let t="string"==typeof e||"number"==typeof e?new Date(e):e;if(Number.isNaN(t.getTime()))return"";let a=t.getFullYear(),r=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0"),i=String(t.getHours()).padStart(2,"0"),c=String(t.getMinutes()).padStart(2,"0"),s=String(t.getSeconds()).padStart(2,"0");return"".concat(a,"-").concat(r,"-").concat(n," ").concat(i,":").concat(c,":").concat(s)}function m(e){if(!e)return"(unknown)";let t=e.replace(/[/\\]+$/,"").split(/[/\\]+/);return t[t.length-1]||e}function h(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;return e?e.replace(/-/g,"").slice(0,t):""}let x={mini:"Mini",nano:"Nano",pro:"Pro",turbo:"Turbo",preview:"Preview"};function p(e){if(!e)return"(unknown)";let t=e.replace(/^(vertex_ai|bedrock|anthropic|openai)\//,""),a=t.toLowerCase();if(a.startsWith("gpt-")||/^o\d/.test(a))return a.startsWith("gpt-")?"GPT-"+t.slice(4).split("-").map(e=>{var t;return null!=(t=x[e.toLowerCase()])?t:e}).join(" "):t.toUpperCase();let r=t.replace(/-(\d{8})$/,""),n=(r=r.replace(/^claude-/,"")).split("-");if(n.length>=2){let e=n[0],t=n.slice(1).join(".");return g(e)+" "+t}return g(r.replace(/-/g," "))}function g(e){return e.replace(/\b\w/g,e=>e.toUpperCase())}},38059:(e,t,a)=>{"use strict";a.d(t,{TokenStackChart:()=>x});var r=a(95155),n=a(26991),i=a(94632),c=a(68425),s=a(47734),l=a(73697),o=a(23508),u=a(26736),d=a(25016),m=a(51148);let h={input:"rgb(var(--chart-input))",output:"rgb(var(--chart-output))",cacheRead:"rgb(var(--chart-cache-read))",cacheCreation:"rgb(var(--chart-cache-create))"};function x(e){let{data:t,height:a="h-72"}=e,x=(0,m.kj)(),{locale:f}=(0,m.s9)();return t.length?(0,r.jsxs)("div",{className:"".concat(a," w-full"),children:[(0,r.jsx)(n.u,{width:"100%",height:"100%",children:(0,r.jsxs)(i.E,{data:t,margin:{top:12,right:8,bottom:4,left:8},barCategoryGap:"22%",children:[(0,r.jsx)(c.d,{stroke:"rgb(var(--chart-grid))",strokeOpacity:.6,strokeDasharray:"3 3",vertical:!1}),(0,r.jsx)(s.W,{dataKey:"label",tick:{fill:"rgb(var(--chart-axis))",fontSize:11},tickLine:!1,axisLine:!1,interval:"preserveStartEnd",minTickGap:32,tickMargin:8}),(0,r.jsx)(l.h,{tickFormatter:e=>(0,d.jh)(Number(e),f),tick:{fill:"rgb(var(--chart-axis))",fontSize:11},tickLine:!1,axisLine:!1,width:56,tickMargin:4}),(0,r.jsx)(o.m,{content:(0,r.jsx)(g,{}),cursor:{fill:"rgb(var(--text-primary) / 0.05)",radius:4}}),(0,r.jsx)(u.y,{dataKey:"input",stackId:"a",fill:h.input,isAnimationActive:!1}),(0,r.jsx)(u.y,{dataKey:"cacheCreation",stackId:"a",fill:h.cacheCreation,isAnimationActive:!1}),(0,r.jsx)(u.y,{dataKey:"cacheRead",stackId:"a",fill:h.cacheRead,isAnimationActive:!1}),(0,r.jsx)(u.y,{dataKey:"output",stackId:"a",fill:h.output,radius:[4,4,0,0],isAnimationActive:!1})]})}),(0,r.jsxs)("div",{className:"flex items-center flex-wrap justify-center gap-4 text-xs text-text-secondary mt-2",children:[(0,r.jsx)(p,{color:h.input,label:x("chart.legend.input")}),(0,r.jsx)(p,{color:h.cacheCreation,label:x("chart.legend.cacheWrite")}),(0,r.jsx)(p,{color:h.cacheRead,label:x("chart.legend.cacheRead")}),(0,r.jsx)(p,{color:h.output,label:x("chart.legend.output")})]})]}):(0,r.jsx)("div",{className:"".concat(a," flex items-center justify-center text-text-tertiary text-sm"),children:x("chart.empty")})}function p(e){let{color:t,label:a}=e;return(0,r.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,r.jsx)("span",{className:"w-2.5 h-2.5 rounded-sm",style:{background:t}}),(0,r.jsx)("span",{children:a})]})}function g(e){let t=(0,m.kj)(),{locale:a}=(0,m.s9)();if(!e.active||!e.payload||!e.payload.length)return null;let n=e.payload[0].payload,i=n.input+n.output+n.cacheRead+n.cacheCreation;return(0,r.jsxs)("div",{className:"card-elevated border border-border-hi rounded-card p-3 text-xs min-w-[200px]",children:[(0,r.jsx)("div",{className:"font-medium text-text-primary mb-2",children:e.label}),(0,r.jsxs)("div",{className:"space-y-1",children:[(0,r.jsx)(f,{color:h.input,label:t("chart.legend.input"),value:n.input,locale:a}),(0,r.jsx)(f,{color:h.cacheCreation,label:t("chart.legend.cacheWrite"),value:n.cacheCreation,locale:a}),(0,r.jsx)(f,{color:h.cacheRead,label:t("chart.legend.cacheRead"),value:n.cacheRead,locale:a}),(0,r.jsx)(f,{color:h.output,label:t("chart.legend.output"),value:n.output,locale:a})]}),(0,r.jsxs)("div",{className:"mt-2 pt-2 border-t border-border flex items-center justify-between",children:[(0,r.jsx)("span",{className:"text-text-secondary",children:t("chart.tooltip.total")}),(0,r.jsx)("span",{className:"num-mono text-text-primary",children:(0,d.jh)(i,a)})]}),(0,r.jsxs)("div",{className:"flex items-center justify-between mt-1",children:[(0,r.jsx)("span",{className:"text-text-secondary",children:t("chart.tooltip.cost")}),(0,r.jsx)("span",{className:"num-mono text-brand",children:(0,d.az)(n.cost)})]}),(0,r.jsxs)("div",{className:"flex items-center justify-between mt-1",children:[(0,r.jsx)("span",{className:"text-text-secondary",children:t("chart.tooltip.requests")}),(0,r.jsx)("span",{className:"num-mono text-text-primary",children:n.requests})]})]})}function f(e){let{color:t,label:a,value:n,locale:i}=e;return(0,r.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,r.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-text-secondary",children:[(0,r.jsx)("span",{className:"w-2 h-2 rounded-sm",style:{background:t}}),a]}),(0,r.jsx)("span",{className:"num-mono text-text-primary",children:(0,d.jh)(n,i)})]})}},62509:(e,t,a)=>{Promise.resolve().then(a.bind(a,38059)),Promise.resolve().then(a.t.bind(a,52619,23))}},e=>{e.O(0,[760,930,619,148,441,255,358],()=>e(e.s=62509)),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[662],{8783:(e,t,r)=>{"use strict";r.d(t,{PricingTable:()=>s});var n=r(95155),i=r(12115),a=r(25016),o=r(19454),c=r(20857);function s(e){let{rows:t}=e,r=(0,o.kj)(),[s,d]=(0,i.useState)(""),[u,h]=(0,i.useState)("model"),[m,x]=(0,i.useState)("asc");function g(e){e===u?x("asc"===m?"desc":"asc"):(h(e),x("model"===e?"asc":"desc"))}let p=(0,i.useMemo)(()=>{let e=s.trim().toLowerCase();return e?t.filter(t=>t.model.toLowerCase().includes(e)||(0,a.P6)(t.model).toLowerCase().includes(e)):t},[t,s]),f=(0,i.useMemo)(()=>{let e=[...p];return e.sort((e,t)=>{if("model"===u){let r=e.model.localeCompare(t.model);return"asc"===m?r:-r}let r=e[u],n=t[u];return r===n?0:"asc"===m?r<n?-1:1:r<n?1:-1}),e},[p,u,m]);return(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{className:"flex items-center justify-between gap-3 mb-3 flex-wrap",children:[(0,n.jsx)("input",{value:s,onChange:e=>d(e.target.value),placeholder:r("common.searchPlaceholder"),"aria-label":r("common.searchPlaceholder"),className:"px-3 py-1.5 text-sm rounded-button border border-border bg-bg-surface focus:outline-none focus:border-border-hi w-72 placeholder:text-text-tertiary text-text-primary"}),(0,n.jsx)("span",{className:"text-xs text-text-tertiary tabular-nums",children:r("common.rows",{count:f.length.toLocaleString()})})]}),(0,n.jsx)(c.H,{children:(0,n.jsxs)("table",{className:"w-full text-sm",children:[(0,n.jsx)("thead",{children:(0,n.jsxs)("tr",{className:"border-b border-border",children:[(0,n.jsx)(l,{sorted:"model"===u,dir:m,onClick:()=>g("model"),children:r("settings.pricing.col.model")}),(0,n.jsx)(l,{align:"right",sorted:"input"===u,dir:m,onClick:()=>g("input"),children:r("settings.pricing.col.input")}),(0,n.jsx)(l,{align:"right",sorted:"output"===u,dir:m,onClick:()=>g("output"),children:r("settings.pricing.col.output")}),(0,n.jsx)(l,{align:"right",sorted:"cacheCreation5m"===u,dir:m,onClick:()=>g("cacheCreation5m"),children:r("settings.pricing.col.write5m")}),(0,n.jsx)(l,{align:"right",sorted:"cacheCreation1h"===u,dir:m,onClick:()=>g("cacheCreation1h"),children:r("settings.pricing.col.write1h")}),(0,n.jsx)(l,{align:"right",sorted:"cacheRead"===u,dir:m,onClick:()=>g("cacheRead"),children:r("settings.pricing.col.read")})]})}),(0,n.jsxs)("tbody",{children:[f.map(e=>(0,n.jsxs)("tr",{className:"border-b border-border last:border-b-0 hover:bg-bg-surface-hi/30",children:[(0,n.jsx)("td",{className:"px-3 py-2 text-text-primary",title:e.model,children:(0,a.P6)(e.model)}),(0,n.jsx)("td",{className:"px-3 py-2 num-mono text-right",children:(0,a.az)(e.input)}),(0,n.jsx)("td",{className:"px-3 py-2 num-mono text-right",children:(0,a.az)(e.output)}),(0,n.jsx)("td",{className:"px-3 py-2 num-mono text-right text-text-secondary",children:(0,a.az)(e.cacheCreation5m)}),(0,n.jsx)("td",{className:"px-3 py-2 num-mono text-right text-text-secondary",children:(0,a.az)(e.cacheCreation1h)}),(0,n.jsx)("td",{className:"px-3 py-2 num-mono text-right text-success",children:(0,a.az)(e.cacheRead)})]},e.model)),0===f.length&&(0,n.jsx)("tr",{children:(0,n.jsx)("td",{colSpan:6,className:"px-3 py-8 text-center text-text-tertiary text-sm",children:r("common.noMatchingRows")})})]})]})})]})}function l(e){let{children:t,align:r="left",sorted:i,dir:o,onClick:c}=e;return(0,n.jsx)("th",{onClick:c,className:(0,a.cn)("px-3 py-2 text-xs font-medium text-text-tertiary uppercase tracking-wide whitespace-nowrap","right"===r?"text-right":"text-left",c&&"cursor-pointer hover:text-text-primary select-none"),children:(0,n.jsxs)("span",{className:"inline-flex items-center gap-1",children:[t,i&&(0,n.jsx)("span",{className:"text-[10px]",children:"asc"===o?"▲":"▼"})]})})}},20857:(e,t,r)=>{"use strict";r.d(t,{H:()=>o});var n=r(95155),i=r(12115),a=r(25016);function o(e){let{children:t,className:r}=e,o=(0,i.useRef)(null),[c,s]=(0,i.useState)(!1),[l,d]=(0,i.useState)(!1);return(0,i.useEffect)(()=>{let e=o.current;if(!e)return;function t(){if(!e)return;let{scrollLeft:t,scrollWidth:r,clientWidth:n}=e;s(t>4),d(t+n<r-4)}t(),e.addEventListener("scroll",t,{passive:!0});let r=new ResizeObserver(t);return r.observe(e),()=>{e.removeEventListener("scroll",t),r.disconnect()}},[]),(0,n.jsxs)("div",{className:(0,a.cn)("relative",r),children:[(0,n.jsx)("div",{ref:o,className:"overflow-x-auto",children:t}),(0,n.jsx)("div",{"aria-hidden":!0,className:(0,a.cn)("pointer-events-none absolute left-0 top-0 bottom-0 w-8 bg-gradient-to-r from-bg-surface to-transparent transition-opacity duration-150",c?"opacity-100":"opacity-0")}),(0,n.jsx)("div",{"aria-hidden":!0,className:(0,a.cn)("pointer-events-none absolute right-0 top-0 bottom-0 w-8 bg-gradient-to-l from-bg-surface to-transparent transition-opacity duration-150",l?"opacity-100":"opacity-0")})]})}},21264:(e,t,r)=>{"use strict";r.d(t,{LanguageSwitcher:()=>s});var n=r(95155),i=r(19454);let a={en:"EN",zh:"中"},o={en:"zh",zh:"en"},c={en:"English",zh:"中文"};function s(){let{locale:e,setLocale:t,t:r}=(0,i.s9)(),s=o[e];return(0,n.jsx)("button",{onClick:()=>t(s),className:"h-7 w-9 inline-flex items-center justify-center rounded-md border border-border bg-bg-surface text-xs font-medium text-text-secondary hover:text-text-primary hover:bg-bg-surface-hi hover:border-border-hi transition-colors",title:"".concat(r("lang.label"),": ").concat(c[e]," → ").concat(c[s]),"aria-label":r("lang.label"),children:a[e]})}},25016:(e,t,r)=>{"use strict";r.d(t,{BC:()=>m,P6:()=>g,PJ:()=>h,R8:()=>d,az:()=>s,cn:()=>a,jh:()=>c,l7:()=>l,r6:()=>u});var n=r(2821),i=r(75889);function a(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return(0,i.QP)((0,n.$)(t))}function o(e,t){var r;return new Intl.NumberFormat("en-US",{maximumFractionDigits:null!=(r=null==t?void 0:t.maxFrac)?r:0}).format(e)}function c(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"en";return Number.isFinite(e)?"zh"===t?e>=1e8?(e/1e8).toFixed(2)+"亿":e>=1e4?(e/1e4).toFixed(1)+"万":o(e):e>=1e9?(e/1e9).toFixed(2)+"B":e>=1e6?(e/1e6).toFixed(2)+"M":e>=1e3?(e/1e3).toFixed(1)+"K":o(e):"0"}function s(e,t){var r,n;return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:null!=(r=null==t?void 0:t.minFrac)?r:2,maximumFractionDigits:null!=(n=null==t?void 0:t.maxFrac)?n:2}).format(e)}function l(e){return 0===e?"$0":e<.01?new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:4,maximumFractionDigits:6}).format(e):s(e)}function d(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return Number.isFinite(e)?"".concat((100*e).toFixed(t),"%"):"0%"}function u(e){let t="string"==typeof e||"number"==typeof e?new Date(e):e;if(Number.isNaN(t.getTime()))return"";let r=t.getFullYear(),n=String(t.getMonth()+1).padStart(2,"0"),i=String(t.getDate()).padStart(2,"0"),a=String(t.getHours()).padStart(2,"0"),o=String(t.getMinutes()).padStart(2,"0"),c=String(t.getSeconds()).padStart(2,"0");return"".concat(r,"-").concat(n,"-").concat(i," ").concat(a,":").concat(o,":").concat(c)}function h(e){if(!e)return"(unknown)";let t=e.replace(/\/+$/,"").split("/");return t[t.length-1]||e}function m(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;return e?e.replace(/-/g,"").slice(0,t):""}let x={mini:"Mini",nano:"Nano",pro:"Pro",turbo:"Turbo",preview:"Preview"};function g(e){if(!e)return"(unknown)";let t=e.replace(/^(vertex_ai|bedrock|anthropic|openai)\//,""),r=t.toLowerCase();if(r.startsWith("gpt-")||/^o\d/.test(r))return r.startsWith("gpt-")?"GPT-"+t.slice(4).split("-").map(e=>{var t;return null!=(t=x[e.toLowerCase()])?t:e}).join(" "):t.toUpperCase();let n=t.replace(/-(\d{8})$/,""),i=(n=n.replace(/^claude-/,"")).split("-");if(i.length>=2){let e=i[0],t=i.slice(1).join(".");return p(e)+" "+t}return p(n.replace(/-/g," "))}function p(e){return e.replace(/\b\w/g,e=>e.toUpperCase())}},42361:(e,t,r)=>{Promise.resolve().then(r.bind(r,21264)),Promise.resolve().then(r.bind(r,8783)),Promise.resolve().then(r.bind(r,91107)),Promise.resolve().then(r.bind(r,44703))},44703:(e,t,r)=>{"use strict";r.d(t,{ThemeSwitcher:()=>c});var n=r(95155),i=r(84479),a=r(19454);let o={light:"dark",dark:"system",system:"light"};function c(){let{theme:e,resolved:t,setTheme:r}=(0,i.D)(),{t:c}=(0,a.s9)(),l=o[e];return(0,n.jsx)("button",{onClick:()=>r(l),className:"h-7 w-9 inline-flex items-center justify-center rounded-md border border-border bg-bg-surface text-text-secondary hover:text-text-primary hover:bg-bg-surface-hi hover:border-border-hi transition-colors",title:"".concat(c("theme.label"),": ").concat(c("settings.theme.".concat(e))," (").concat(t,") → ").concat(c("settings.theme.".concat(l))),"aria-label":c("theme.label"),children:(0,n.jsx)(s,{theme:e})})}function s(e){let{theme:t}=e;return"light"===t?(0,n.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[(0,n.jsx)("circle",{cx:"12",cy:"12",r:"4"}),(0,n.jsx)("path",{d:"M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M4.93 19.07l1.41-1.41M17.66 6.34l1.41-1.41"})]}):"dark"===t?(0,n.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:(0,n.jsx)("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})}):(0,n.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[(0,n.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,n.jsx)("path",{d:"M12 3v18"}),(0,n.jsx)("path",{d:"M12 3a9 9 0 0 1 0 18z",fill:"currentColor",stroke:"none"})]})}},84479:(e,t,r)=>{"use strict";r.d(t,{N:()=>d,D:()=>u});var n=r(95155),i=r(12115);let a="ccgauge_theme",o=(0,i.createContext)({theme:"system",resolved:"dark",setTheme:()=>{}}),c="ccgauge.theme";function s(e){return"light"===e?"light":"dark"===e?"dark":window.matchMedia&&window.matchMedia("(prefers-color-scheme: light)").matches?"light":"dark"}function l(e){if("undefined"==typeof document)return;let t=document.documentElement,r=s(e);t.classList.remove("theme-light","theme-dark"),t.classList.add("light"===r?"theme-light":"theme-dark"),t.setAttribute("data-theme",r)}function d(e){let{initialTheme:t,children:r}=e,[d,u]=(0,i.useState)(t),[h,m]=(0,i.useState)(()=>"system"===t?"dark":t);(0,i.useEffect)(()=>{try{let e=localStorage.getItem(c);if("light"===e||"dark"===e||"system"===e){e!==t&&(document.cookie="".concat(a,"=").concat(e,"; path=/; max-age=").concat(31536e3,"; SameSite=Lax")),u(e);let r=s(e);m(r),l(e)}else{let e=s(t);m(e),l(t)}}catch(e){m(s(t)),l(t)}},[]),(0,i.useEffect)(()=>{if("system"!==d)return;let e=window.matchMedia("(prefers-color-scheme: light)"),t=()=>{m(e.matches?"light":"dark"),l("system")};return e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[d]);let x=(0,i.useCallback)(e=>{try{localStorage.setItem(c,e)}catch(e){}document.cookie="".concat(a,"=").concat(e,"; path=/; max-age=").concat(31536e3,"; SameSite=Lax"),u(e),m(s(e)),l(e)},[]);return(0,n.jsx)(o.Provider,{value:{theme:d,resolved:h,setTheme:x},children:r})}function u(){return(0,i.useContext)(o)}},91107:(e,t,r)=>{"use strict";r.d(t,{ScanRefresh:()=>c});var n=r(95155),i=r(12115),a=r(20063),o=r(19454);function c(){let e=(0,o.kj)(),[t,r]=(0,i.useState)(!1),c=(0,a.useRouter)();async function s(){r(!0);try{await fetch("/api/scan",{method:"POST",cache:"no-store"}),c.refresh()}finally{r(!1)}}return(0,n.jsx)("button",{onClick:s,disabled:t,className:"btn",children:e(t?"settings.rescanning":"settings.rescan")})}}},e=>{e.O(0,[760,454,441,255,358],()=>e(e.s=42361)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[662],{8783:(e,t,r)=>{"use strict";r.d(t,{PricingTable:()=>s});var n=r(95155),i=r(12115),a=r(25016),o=r(51148),c=r(20857);function s(e){let{rows:t}=e,r=(0,o.kj)(),[s,d]=(0,i.useState)(""),[u,h]=(0,i.useState)("model"),[m,x]=(0,i.useState)("asc");function g(e){e===u?x("asc"===m?"desc":"asc"):(h(e),x("model"===e?"asc":"desc"))}let p=(0,i.useMemo)(()=>{let e=s.trim().toLowerCase();return e?t.filter(t=>t.model.toLowerCase().includes(e)||(0,a.P6)(t.model).toLowerCase().includes(e)):t},[t,s]),f=(0,i.useMemo)(()=>{let e=[...p];return e.sort((e,t)=>{if("model"===u){let r=e.model.localeCompare(t.model);return"asc"===m?r:-r}let r=e[u],n=t[u];return r===n?0:"asc"===m?r<n?-1:1:r<n?1:-1}),e},[p,u,m]);return(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{className:"flex items-center justify-between gap-3 mb-3 flex-wrap",children:[(0,n.jsx)("input",{value:s,onChange:e=>d(e.target.value),placeholder:r("common.searchPlaceholder"),"aria-label":r("common.searchPlaceholder"),className:"px-3 py-1.5 text-sm rounded-button border border-border bg-bg-surface focus:outline-none focus:border-border-hi w-72 placeholder:text-text-tertiary text-text-primary"}),(0,n.jsx)("span",{className:"text-xs text-text-tertiary tabular-nums",children:r("common.rows",{count:f.length.toLocaleString()})})]}),(0,n.jsx)(c.H,{children:(0,n.jsxs)("table",{className:"w-full text-sm",children:[(0,n.jsx)("thead",{children:(0,n.jsxs)("tr",{className:"border-b border-border",children:[(0,n.jsx)(l,{sorted:"model"===u,dir:m,onClick:()=>g("model"),children:r("settings.pricing.col.model")}),(0,n.jsx)(l,{align:"right",sorted:"input"===u,dir:m,onClick:()=>g("input"),children:r("settings.pricing.col.input")}),(0,n.jsx)(l,{align:"right",sorted:"output"===u,dir:m,onClick:()=>g("output"),children:r("settings.pricing.col.output")}),(0,n.jsx)(l,{align:"right",sorted:"cacheCreation5m"===u,dir:m,onClick:()=>g("cacheCreation5m"),children:r("settings.pricing.col.write5m")}),(0,n.jsx)(l,{align:"right",sorted:"cacheCreation1h"===u,dir:m,onClick:()=>g("cacheCreation1h"),children:r("settings.pricing.col.write1h")}),(0,n.jsx)(l,{align:"right",sorted:"cacheRead"===u,dir:m,onClick:()=>g("cacheRead"),children:r("settings.pricing.col.read")})]})}),(0,n.jsxs)("tbody",{children:[f.map(e=>(0,n.jsxs)("tr",{className:"border-b border-border last:border-b-0 hover:bg-bg-surface-hi/30",children:[(0,n.jsx)("td",{className:"px-3 py-2 text-text-primary",title:e.model,children:(0,a.P6)(e.model)}),(0,n.jsx)("td",{className:"px-3 py-2 num-mono text-right",children:(0,a.az)(e.input)}),(0,n.jsx)("td",{className:"px-3 py-2 num-mono text-right",children:(0,a.az)(e.output)}),(0,n.jsx)("td",{className:"px-3 py-2 num-mono text-right text-text-secondary",children:(0,a.az)(e.cacheCreation5m)}),(0,n.jsx)("td",{className:"px-3 py-2 num-mono text-right text-text-secondary",children:(0,a.az)(e.cacheCreation1h)}),(0,n.jsx)("td",{className:"px-3 py-2 num-mono text-right text-success",children:(0,a.az)(e.cacheRead)})]},e.model)),0===f.length&&(0,n.jsx)("tr",{children:(0,n.jsx)("td",{colSpan:6,className:"px-3 py-8 text-center text-text-tertiary text-sm",children:r("common.noMatchingRows")})})]})]})})]})}function l(e){let{children:t,align:r="left",sorted:i,dir:o,onClick:c}=e;return(0,n.jsx)("th",{onClick:c,className:(0,a.cn)("px-3 py-2 text-xs font-medium text-text-tertiary uppercase tracking-wide whitespace-nowrap","right"===r?"text-right":"text-left",c&&"cursor-pointer hover:text-text-primary select-none"),children:(0,n.jsxs)("span",{className:"inline-flex items-center gap-1",children:[t,i&&(0,n.jsx)("span",{className:"text-[10px]",children:"asc"===o?"▲":"▼"})]})})}},20857:(e,t,r)=>{"use strict";r.d(t,{H:()=>o});var n=r(95155),i=r(12115),a=r(25016);function o(e){let{children:t,className:r}=e,o=(0,i.useRef)(null),[c,s]=(0,i.useState)(!1),[l,d]=(0,i.useState)(!1);return(0,i.useEffect)(()=>{let e=o.current;if(!e)return;function t(){if(!e)return;let{scrollLeft:t,scrollWidth:r,clientWidth:n}=e;s(t>4),d(t+n<r-4)}t(),e.addEventListener("scroll",t,{passive:!0});let r=new ResizeObserver(t);return r.observe(e),()=>{e.removeEventListener("scroll",t),r.disconnect()}},[]),(0,n.jsxs)("div",{className:(0,a.cn)("relative",r),children:[(0,n.jsx)("div",{ref:o,className:"overflow-x-auto",children:t}),(0,n.jsx)("div",{"aria-hidden":!0,className:(0,a.cn)("pointer-events-none absolute left-0 top-0 bottom-0 w-8 bg-gradient-to-r from-bg-surface to-transparent transition-opacity duration-150",c?"opacity-100":"opacity-0")}),(0,n.jsx)("div",{"aria-hidden":!0,className:(0,a.cn)("pointer-events-none absolute right-0 top-0 bottom-0 w-8 bg-gradient-to-l from-bg-surface to-transparent transition-opacity duration-150",l?"opacity-100":"opacity-0")})]})}},21264:(e,t,r)=>{"use strict";r.d(t,{LanguageSwitcher:()=>s});var n=r(95155),i=r(51148);let a={en:"EN",zh:"中"},o={en:"zh",zh:"en"},c={en:"English",zh:"中文"};function s(){let{locale:e,setLocale:t,t:r}=(0,i.s9)(),s=o[e];return(0,n.jsx)("button",{onClick:()=>t(s),className:"h-7 w-9 inline-flex items-center justify-center rounded-md border border-border bg-bg-surface text-xs font-medium text-text-secondary hover:text-text-primary hover:bg-bg-surface-hi hover:border-border-hi transition-colors",title:"".concat(r("lang.label"),": ").concat(c[e]," → ").concat(c[s]),"aria-label":r("lang.label"),children:a[e]})}},25016:(e,t,r)=>{"use strict";r.d(t,{BC:()=>m,P6:()=>g,PJ:()=>h,R8:()=>d,az:()=>s,cn:()=>a,jh:()=>c,l7:()=>l,r6:()=>u});var n=r(2821),i=r(75889);function a(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return(0,i.QP)((0,n.$)(t))}function o(e,t){var r;return new Intl.NumberFormat("en-US",{maximumFractionDigits:null!=(r=null==t?void 0:t.maxFrac)?r:0}).format(e)}function c(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"en";return Number.isFinite(e)?"zh"===t?e>=1e8?(e/1e8).toFixed(2)+"亿":e>=1e4?(e/1e4).toFixed(1)+"万":o(e):e>=1e9?(e/1e9).toFixed(2)+"B":e>=1e6?(e/1e6).toFixed(2)+"M":e>=1e3?(e/1e3).toFixed(1)+"K":o(e):"0"}function s(e,t){var r,n;return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:null!=(r=null==t?void 0:t.minFrac)?r:2,maximumFractionDigits:null!=(n=null==t?void 0:t.maxFrac)?n:2}).format(e)}function l(e){return 0===e?"$0":e<.01?new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:4,maximumFractionDigits:6}).format(e):s(e)}function d(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return Number.isFinite(e)?"".concat((100*e).toFixed(t),"%"):"0%"}function u(e){let t="string"==typeof e||"number"==typeof e?new Date(e):e;if(Number.isNaN(t.getTime()))return"";let r=t.getFullYear(),n=String(t.getMonth()+1).padStart(2,"0"),i=String(t.getDate()).padStart(2,"0"),a=String(t.getHours()).padStart(2,"0"),o=String(t.getMinutes()).padStart(2,"0"),c=String(t.getSeconds()).padStart(2,"0");return"".concat(r,"-").concat(n,"-").concat(i," ").concat(a,":").concat(o,":").concat(c)}function h(e){if(!e)return"(unknown)";let t=e.replace(/[/\\]+$/,"").split(/[/\\]+/);return t[t.length-1]||e}function m(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;return e?e.replace(/-/g,"").slice(0,t):""}let x={mini:"Mini",nano:"Nano",pro:"Pro",turbo:"Turbo",preview:"Preview"};function g(e){if(!e)return"(unknown)";let t=e.replace(/^(vertex_ai|bedrock|anthropic|openai)\//,""),r=t.toLowerCase();if(r.startsWith("gpt-")||/^o\d/.test(r))return r.startsWith("gpt-")?"GPT-"+t.slice(4).split("-").map(e=>{var t;return null!=(t=x[e.toLowerCase()])?t:e}).join(" "):t.toUpperCase();let n=t.replace(/-(\d{8})$/,""),i=(n=n.replace(/^claude-/,"")).split("-");if(i.length>=2){let e=i[0],t=i.slice(1).join(".");return p(e)+" "+t}return p(n.replace(/-/g," "))}function p(e){return e.replace(/\b\w/g,e=>e.toUpperCase())}},42361:(e,t,r)=>{Promise.resolve().then(r.bind(r,21264)),Promise.resolve().then(r.bind(r,8783)),Promise.resolve().then(r.bind(r,91107)),Promise.resolve().then(r.bind(r,44703))},44703:(e,t,r)=>{"use strict";r.d(t,{ThemeSwitcher:()=>c});var n=r(95155),i=r(84479),a=r(51148);let o={light:"dark",dark:"system",system:"light"};function c(){let{theme:e,resolved:t,setTheme:r}=(0,i.D)(),{t:c}=(0,a.s9)(),l=o[e];return(0,n.jsx)("button",{onClick:()=>r(l),className:"h-7 w-9 inline-flex items-center justify-center rounded-md border border-border bg-bg-surface text-text-secondary hover:text-text-primary hover:bg-bg-surface-hi hover:border-border-hi transition-colors",title:"".concat(c("theme.label"),": ").concat(c("settings.theme.".concat(e))," (").concat(t,") → ").concat(c("settings.theme.".concat(l))),"aria-label":c("theme.label"),children:(0,n.jsx)(s,{theme:e})})}function s(e){let{theme:t}=e;return"light"===t?(0,n.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[(0,n.jsx)("circle",{cx:"12",cy:"12",r:"4"}),(0,n.jsx)("path",{d:"M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M4.93 19.07l1.41-1.41M17.66 6.34l1.41-1.41"})]}):"dark"===t?(0,n.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:(0,n.jsx)("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})}):(0,n.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[(0,n.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,n.jsx)("path",{d:"M12 3v18"}),(0,n.jsx)("path",{d:"M12 3a9 9 0 0 1 0 18z",fill:"currentColor",stroke:"none"})]})}},84479:(e,t,r)=>{"use strict";r.d(t,{N:()=>d,D:()=>u});var n=r(95155),i=r(12115);let a="ccgauge_theme",o=(0,i.createContext)({theme:"dark",resolved:"dark",setTheme:()=>{}}),c="ccgauge.theme";function s(e){return"light"===e?"light":"dark"===e?"dark":window.matchMedia&&window.matchMedia("(prefers-color-scheme: light)").matches?"light":"dark"}function l(e){if("undefined"==typeof document)return;let t=document.documentElement,r=s(e);t.classList.remove("theme-light","theme-dark"),t.classList.add("light"===r?"theme-light":"theme-dark"),t.setAttribute("data-theme",r)}function d(e){let{initialTheme:t,children:r}=e,[d,u]=(0,i.useState)(t),[h,m]=(0,i.useState)(()=>"system"===t?"dark":t);(0,i.useEffect)(()=>{try{let e=localStorage.getItem(c);if("light"===e||"dark"===e||"system"===e){e!==t&&(document.cookie="".concat(a,"=").concat(e,"; path=/; max-age=").concat(31536e3,"; SameSite=Lax")),u(e);let r=s(e);m(r),l(e)}else{let e=s(t);m(e),l(t)}}catch(e){m(s(t)),l(t)}},[]),(0,i.useEffect)(()=>{if("system"!==d)return;let e=window.matchMedia("(prefers-color-scheme: light)"),t=()=>{m(e.matches?"light":"dark"),l("system")};return e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[d]);let x=(0,i.useCallback)(e=>{try{localStorage.setItem(c,e)}catch(e){}document.cookie="".concat(a,"=").concat(e,"; path=/; max-age=").concat(31536e3,"; SameSite=Lax"),u(e),m(s(e)),l(e)},[]);return(0,n.jsx)(o.Provider,{value:{theme:d,resolved:h,setTheme:x},children:r})}function u(){return(0,i.useContext)(o)}},91107:(e,t,r)=>{"use strict";r.d(t,{ScanRefresh:()=>c});var n=r(95155),i=r(12115),a=r(20063),o=r(51148);function c(){let e=(0,o.kj)(),[t,r]=(0,i.useState)(!1),c=(0,a.useRouter)();async function s(){r(!0);try{await fetch("/api/scan",{method:"POST",cache:"no-store"}),c.refresh()}finally{r(!1)}}return(0,n.jsx)("button",{onClick:s,disabled:t,className:"btn",children:e(t?"settings.rescanning":"settings.rescan")})}}},e=>{e.O(0,[760,148,441,255,358],()=>e(e.s=42361)),_N_E=e.O()}]);