@kaitranntt/ccs 8.1.4 → 8.2.0-dev.2

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 (366) hide show
  1. package/config/base-kiro.settings.json +4 -4
  2. package/config/base-qoder.settings.json +10 -0
  3. package/dist/channels/official-channels-runtime.js +1 -1
  4. package/dist/channels/official-channels-runtime.js.map +1 -1
  5. package/dist/cliproxy/accounts/registry.d.ts.map +1 -1
  6. package/dist/cliproxy/accounts/registry.js +11 -4
  7. package/dist/cliproxy/accounts/registry.js.map +1 -1
  8. package/dist/cliproxy/ai-providers/codex-plan-compatibility.js +1 -1
  9. package/dist/cliproxy/ai-providers/codex-plan-compatibility.js.map +1 -1
  10. package/dist/cliproxy/ai-providers/codex-reasoning-proxy.d.ts.map +1 -1
  11. package/dist/cliproxy/ai-providers/codex-reasoning-proxy.js +88 -11
  12. package/dist/cliproxy/ai-providers/codex-reasoning-proxy.js.map +1 -1
  13. package/dist/cliproxy/auth/auth-types.d.ts +2 -0
  14. package/dist/cliproxy/auth/auth-types.d.ts.map +1 -1
  15. package/dist/cliproxy/auth/auth-types.js +7 -0
  16. package/dist/cliproxy/auth/auth-types.js.map +1 -1
  17. package/dist/cliproxy/auth/oauth-handler.d.ts.map +1 -1
  18. package/dist/cliproxy/auth/oauth-handler.js +19 -10
  19. package/dist/cliproxy/auth/oauth-handler.js.map +1 -1
  20. package/dist/cliproxy/auth/oauth-trace/redactor.d.ts.map +1 -1
  21. package/dist/cliproxy/auth/oauth-trace/redactor.js +1 -0
  22. package/dist/cliproxy/auth/oauth-trace/redactor.js.map +1 -1
  23. package/dist/cliproxy/auth/oauth-trace/trace-recorder.js +2 -2
  24. package/dist/cliproxy/auth/oauth-trace/trace-recorder.js.map +1 -1
  25. package/dist/cliproxy/binary/version-checker.d.ts +4 -2
  26. package/dist/cliproxy/binary/version-checker.d.ts.map +1 -1
  27. package/dist/cliproxy/binary/version-checker.js +30 -20
  28. package/dist/cliproxy/binary/version-checker.js.map +1 -1
  29. package/dist/cliproxy/executor/arg-parser.d.ts +8 -5
  30. package/dist/cliproxy/executor/arg-parser.d.ts.map +1 -1
  31. package/dist/cliproxy/executor/arg-parser.js +21 -10
  32. package/dist/cliproxy/executor/arg-parser.js.map +1 -1
  33. package/dist/cliproxy/executor/browser-launch-setup.d.ts +1 -0
  34. package/dist/cliproxy/executor/browser-launch-setup.d.ts.map +1 -1
  35. package/dist/cliproxy/executor/browser-launch-setup.js +4 -3
  36. package/dist/cliproxy/executor/browser-launch-setup.js.map +1 -1
  37. package/dist/cliproxy/executor/index.d.ts.map +1 -1
  38. package/dist/cliproxy/executor/index.js +15 -6
  39. package/dist/cliproxy/executor/index.js.map +1 -1
  40. package/dist/cliproxy/executor/proxy-resolver.d.ts +15 -9
  41. package/dist/cliproxy/executor/proxy-resolver.d.ts.map +1 -1
  42. package/dist/cliproxy/executor/proxy-resolver.js +14 -5
  43. package/dist/cliproxy/executor/proxy-resolver.js.map +1 -1
  44. package/dist/cliproxy/model-catalog.d.ts.map +1 -1
  45. package/dist/cliproxy/model-catalog.js +79 -2
  46. package/dist/cliproxy/model-catalog.js.map +1 -1
  47. package/dist/cliproxy/provider-capabilities.d.ts.map +1 -1
  48. package/dist/cliproxy/provider-capabilities.js +12 -0
  49. package/dist/cliproxy/provider-capabilities.js.map +1 -1
  50. package/dist/cliproxy/proxy/proxy-config-resolver.d.ts.map +1 -1
  51. package/dist/cliproxy/proxy/proxy-config-resolver.js +11 -1
  52. package/dist/cliproxy/proxy/proxy-config-resolver.js.map +1 -1
  53. package/dist/cliproxy/proxy/tool-sanitization-proxy.d.ts.map +1 -1
  54. package/dist/cliproxy/proxy/tool-sanitization-proxy.js +160 -8
  55. package/dist/cliproxy/proxy/tool-sanitization-proxy.js.map +1 -1
  56. package/dist/cliproxy/proxy/upstream-response-timeout.d.ts +14 -0
  57. package/dist/cliproxy/proxy/upstream-response-timeout.d.ts.map +1 -0
  58. package/dist/cliproxy/proxy/upstream-response-timeout.js +72 -0
  59. package/dist/cliproxy/proxy/upstream-response-timeout.js.map +1 -0
  60. package/dist/cliproxy/quota/quota-fetcher-claude.d.ts +9 -0
  61. package/dist/cliproxy/quota/quota-fetcher-claude.d.ts.map +1 -1
  62. package/dist/cliproxy/quota/quota-fetcher-claude.js +53 -16
  63. package/dist/cliproxy/quota/quota-fetcher-claude.js.map +1 -1
  64. package/dist/cliproxy/quota/quota-fetcher-codex.d.ts +2 -2
  65. package/dist/cliproxy/quota/quota-fetcher-codex.d.ts.map +1 -1
  66. package/dist/cliproxy/quota/quota-fetcher-codex.js +2 -4
  67. package/dist/cliproxy/quota/quota-fetcher-codex.js.map +1 -1
  68. package/dist/cliproxy/quota/quota-fetcher.d.ts.map +1 -1
  69. package/dist/cliproxy/quota/quota-fetcher.js +4 -0
  70. package/dist/cliproxy/quota/quota-fetcher.js.map +1 -1
  71. package/dist/cliproxy/quota/quota-label-sanitizer.d.ts +10 -0
  72. package/dist/cliproxy/quota/quota-label-sanitizer.d.ts.map +1 -0
  73. package/dist/cliproxy/quota/quota-label-sanitizer.js +31 -0
  74. package/dist/cliproxy/quota/quota-label-sanitizer.js.map +1 -0
  75. package/dist/cliproxy/quota/quota-manager.d.ts.map +1 -1
  76. package/dist/cliproxy/quota/quota-manager.js +32 -1
  77. package/dist/cliproxy/quota/quota-manager.js.map +1 -1
  78. package/dist/cliproxy/routing/routing-strategy-http.d.ts.map +1 -1
  79. package/dist/cliproxy/routing/routing-strategy-http.js +35 -26
  80. package/dist/cliproxy/routing/routing-strategy-http.js.map +1 -1
  81. package/dist/cliproxy/services/catalog-cache.d.ts.map +1 -1
  82. package/dist/cliproxy/services/catalog-cache.js +5 -3
  83. package/dist/cliproxy/services/catalog-cache.js.map +1 -1
  84. package/dist/cliproxy/services/stats-fetcher.d.ts +13 -0
  85. package/dist/cliproxy/services/stats-fetcher.d.ts.map +1 -1
  86. package/dist/cliproxy/services/stats-fetcher.js +25 -1
  87. package/dist/cliproxy/services/stats-fetcher.js.map +1 -1
  88. package/dist/cliproxy/types/provider-types.d.ts +1 -1
  89. package/dist/cliproxy/types/provider-types.d.ts.map +1 -1
  90. package/dist/cliproxy/types/provider-types.js +1 -0
  91. package/dist/cliproxy/types/provider-types.js.map +1 -1
  92. package/dist/codex-auth/codex-config-symlink.js +21 -4
  93. package/dist/codex-auth/codex-config-symlink.js.map +1 -1
  94. package/dist/codex-auth/commands/import-default-command.d.ts +1 -1
  95. package/dist/codex-auth/commands/import-default-command.d.ts.map +1 -1
  96. package/dist/codex-auth/commands/import-default-command.js +12 -25
  97. package/dist/codex-auth/commands/import-default-command.js.map +1 -1
  98. package/dist/commands/api-command/help.js +1 -1
  99. package/dist/commands/api-command/help.js.map +1 -1
  100. package/dist/commands/bar/index.d.ts +8 -0
  101. package/dist/commands/bar/index.d.ts.map +1 -0
  102. package/dist/commands/bar/index.js +69 -0
  103. package/dist/commands/bar/index.js.map +1 -0
  104. package/dist/commands/bar/install-subcommand.d.ts +50 -0
  105. package/dist/commands/bar/install-subcommand.d.ts.map +1 -0
  106. package/dist/commands/bar/install-subcommand.js +383 -0
  107. package/dist/commands/bar/install-subcommand.js.map +1 -0
  108. package/dist/commands/bar/launch-subcommand.d.ts +38 -0
  109. package/dist/commands/bar/launch-subcommand.d.ts.map +1 -0
  110. package/dist/commands/bar/launch-subcommand.js +144 -0
  111. package/dist/commands/bar/launch-subcommand.js.map +1 -0
  112. package/dist/commands/bar/uninstall-subcommand.d.ts +13 -0
  113. package/dist/commands/bar/uninstall-subcommand.d.ts.map +1 -0
  114. package/dist/commands/bar/uninstall-subcommand.js +78 -0
  115. package/dist/commands/bar/uninstall-subcommand.js.map +1 -0
  116. package/dist/commands/bar/version-subcommand.d.ts +8 -0
  117. package/dist/commands/bar/version-subcommand.d.ts.map +1 -0
  118. package/dist/commands/bar/version-subcommand.js +62 -0
  119. package/dist/commands/bar/version-subcommand.js.map +1 -0
  120. package/dist/commands/cleanup-command.d.ts.map +1 -1
  121. package/dist/commands/cleanup-command.js +99 -51
  122. package/dist/commands/cleanup-command.js.map +1 -1
  123. package/dist/commands/cliproxy/quota-subcommand.d.ts +10 -1
  124. package/dist/commands/cliproxy/quota-subcommand.d.ts.map +1 -1
  125. package/dist/commands/cliproxy/quota-subcommand.js +15 -6
  126. package/dist/commands/cliproxy/quota-subcommand.js.map +1 -1
  127. package/dist/commands/command-catalog.d.ts.map +1 -1
  128. package/dist/commands/command-catalog.js +7 -0
  129. package/dist/commands/command-catalog.js.map +1 -1
  130. package/dist/commands/config-channels-command.d.ts +1 -4
  131. package/dist/commands/config-channels-command.d.ts.map +1 -1
  132. package/dist/commands/config-channels-command.js +20 -24
  133. package/dist/commands/config-channels-command.js.map +1 -1
  134. package/dist/commands/root-command-router.d.ts.map +1 -1
  135. package/dist/commands/root-command-router.js +7 -0
  136. package/dist/commands/root-command-router.js.map +1 -1
  137. package/dist/config/loader/yaml-serializer.d.ts.map +1 -1
  138. package/dist/config/loader/yaml-serializer.js +13 -0
  139. package/dist/config/loader/yaml-serializer.js.map +1 -1
  140. package/dist/config/reserved-names.d.ts +1 -1
  141. package/dist/config/reserved-names.d.ts.map +1 -1
  142. package/dist/config/reserved-names.js +1 -0
  143. package/dist/config/reserved-names.js.map +1 -1
  144. package/dist/config/schemas/proxy-server.js +1 -1
  145. package/dist/config/schemas/quota.d.ts +26 -2
  146. package/dist/config/schemas/quota.d.ts.map +1 -1
  147. package/dist/config/schemas/quota.js +20 -1
  148. package/dist/config/schemas/quota.js.map +1 -1
  149. package/dist/cursor/cursor-daemon-auth.d.ts +2 -0
  150. package/dist/cursor/cursor-daemon-auth.d.ts.map +1 -0
  151. package/dist/cursor/cursor-daemon-auth.js +49 -0
  152. package/dist/cursor/cursor-daemon-auth.js.map +1 -0
  153. package/dist/cursor/cursor-daemon-entry.d.ts.map +1 -1
  154. package/dist/cursor/cursor-daemon-entry.js +44 -0
  155. package/dist/cursor/cursor-daemon-entry.js.map +1 -1
  156. package/dist/cursor/cursor-daemon.d.ts +2 -1
  157. package/dist/cursor/cursor-daemon.d.ts.map +1 -1
  158. package/dist/cursor/cursor-daemon.js +21 -5
  159. package/dist/cursor/cursor-daemon.js.map +1 -1
  160. package/dist/cursor/cursor-models.d.ts.map +1 -1
  161. package/dist/cursor/cursor-models.js +2 -1
  162. package/dist/cursor/cursor-models.js.map +1 -1
  163. package/dist/cursor/cursor-profile-executor.d.ts +1 -1
  164. package/dist/cursor/cursor-profile-executor.d.ts.map +1 -1
  165. package/dist/cursor/cursor-profile-executor.js +7 -4
  166. package/dist/cursor/cursor-profile-executor.js.map +1 -1
  167. package/dist/cursor/cursor-runtime-probe.d.ts.map +1 -1
  168. package/dist/cursor/cursor-runtime-probe.js +4 -2
  169. package/dist/cursor/cursor-runtime-probe.js.map +1 -1
  170. package/dist/cursor/types.d.ts +1 -0
  171. package/dist/cursor/types.d.ts.map +1 -1
  172. package/dist/dispatcher/profile-resolver.d.ts +16 -0
  173. package/dist/dispatcher/profile-resolver.d.ts.map +1 -1
  174. package/dist/dispatcher/profile-resolver.js +49 -3
  175. package/dist/dispatcher/profile-resolver.js.map +1 -1
  176. package/dist/docker/docker-key-rotation.d.ts +2 -0
  177. package/dist/docker/docker-key-rotation.d.ts.map +1 -1
  178. package/dist/docker/docker-key-rotation.js +9 -1
  179. package/dist/docker/docker-key-rotation.js.map +1 -1
  180. package/dist/glmt/sse-parser.d.ts +1 -0
  181. package/dist/glmt/sse-parser.d.ts.map +1 -1
  182. package/dist/glmt/sse-parser.js +13 -1
  183. package/dist/glmt/sse-parser.js.map +1 -1
  184. package/dist/management/shared-manager.d.ts.map +1 -1
  185. package/dist/management/shared-manager.js +9 -1
  186. package/dist/management/shared-manager.js.map +1 -1
  187. package/dist/proxy/profile-router.d.ts +2 -0
  188. package/dist/proxy/profile-router.d.ts.map +1 -1
  189. package/dist/proxy/profile-router.js +6 -2
  190. package/dist/proxy/profile-router.js.map +1 -1
  191. package/dist/proxy/proxy-daemon.js +1 -1
  192. package/dist/proxy/proxy-daemon.js.map +1 -1
  193. package/dist/proxy/server/messages-route.d.ts.map +1 -1
  194. package/dist/proxy/server/messages-route.js +79 -7
  195. package/dist/proxy/server/messages-route.js.map +1 -1
  196. package/dist/proxy/transformers/request-transformer.d.ts.map +1 -1
  197. package/dist/proxy/transformers/request-transformer.js +9 -2
  198. package/dist/proxy/transformers/request-transformer.js.map +1 -1
  199. package/dist/shared/claude-extension-setup.d.ts.map +1 -1
  200. package/dist/shared/claude-extension-setup.js +2 -1
  201. package/dist/shared/claude-extension-setup.js.map +1 -1
  202. package/dist/shared/cliproxy-model-routing.d.ts.map +1 -1
  203. package/dist/shared/cliproxy-model-routing.js +1 -0
  204. package/dist/shared/cliproxy-model-routing.js.map +1 -1
  205. package/dist/shared/stale-codex-translator-settings.d.ts.map +1 -1
  206. package/dist/shared/stale-codex-translator-settings.js +48 -9
  207. package/dist/shared/stale-codex-translator-settings.js.map +1 -1
  208. package/dist/targets/codex-adapter.d.ts.map +1 -1
  209. package/dist/targets/codex-adapter.js +10 -8
  210. package/dist/targets/codex-adapter.js.map +1 -1
  211. package/dist/targets/target-metadata.js +1 -1
  212. package/dist/targets/target-metadata.js.map +1 -1
  213. package/dist/ui/assets/{Trans-DyZQZ3e2.js → Trans-BkttMZOY.js} +1 -1
  214. package/dist/ui/assets/accounts-CMnafyvZ.js +1 -0
  215. package/dist/ui/assets/{alert-dialog-DWHL-dqd.js → alert-dialog-Dgbg5gJ1.js} +1 -1
  216. package/dist/ui/assets/api-VhuWZte1.js +4 -0
  217. package/dist/ui/assets/{auth-section-B4o90dwz.js → auth-section-DV1ImDLn.js} +1 -1
  218. package/dist/ui/assets/{backups-section-1AsdSIJO.js → backups-section-D7r-Huo_.js} +1 -1
  219. package/dist/ui/assets/{channels-CU4Zdsc_.js → channels-CKUk3W1L.js} +1 -1
  220. package/dist/ui/assets/{checkbox-CbCKGH8I.js → checkbox-B6j6PA4N.js} +1 -1
  221. package/dist/ui/assets/claude-extension-B9phgEGW.js +1 -0
  222. package/dist/ui/assets/cliproxy-CjZiufaQ.js +4 -0
  223. package/dist/ui/assets/{cliproxy-ai-providers-Dr4L5NRY.js → cliproxy-ai-providers-J_8Tg44E.js} +6 -6
  224. package/dist/ui/assets/cliproxy-control-panel-DOxGnabX.js +1 -0
  225. package/dist/ui/assets/codex-BJuDLXfe.js +30 -0
  226. package/dist/ui/assets/{confirm-dialog-b5Dahgnk.js → confirm-dialog-CjwyQ3AU.js} +1 -1
  227. package/dist/ui/assets/{copilot-B1Ojakbt.js → copilot-Nhs4PdOq.js} +2 -2
  228. package/dist/ui/assets/{cursor-PUtNVPx1.js → cursor-DqFROSqy.js} +1 -1
  229. package/dist/ui/assets/{droid-S2gclncb.js → droid-CBwAiZcv.js} +1 -1
  230. package/dist/ui/assets/{globalenv-section-7wKSmNSG.js → globalenv-section-D9WhcK3S.js} +1 -1
  231. package/dist/ui/assets/{health-hMLN_gyw.js → health-CE3lFqFV.js} +1 -1
  232. package/dist/ui/assets/icons-gI6odJjU.js +1 -0
  233. package/dist/ui/assets/{index-Cx0dmbiQ.js → index-Bssd99Pa.js} +1 -1
  234. package/dist/ui/assets/index-C6D81JHk.js +1 -0
  235. package/dist/ui/assets/{index-BWboJia4.js → index-D--xE6Kq.js} +1 -1
  236. package/dist/ui/assets/index-DFYK4jw3.js +56 -0
  237. package/dist/ui/assets/{index-DkR2KVhF.js → index-DGsfFqiO.js} +1 -1
  238. package/dist/ui/assets/index-UEdhhar4.css +1 -0
  239. package/dist/ui/assets/{index-Coc3_ABK.js → index-bJvDY0e2.js} +1 -1
  240. package/dist/ui/assets/{index-CxvNNHgE.js → index-vK0cF4_0.js} +1 -1
  241. package/dist/ui/assets/logs-BUA9GCN2.js +1 -0
  242. package/dist/ui/assets/{masked-input-4L9CIZGb.js → masked-input-BZdCgWmH.js} +1 -1
  243. package/dist/ui/assets/providers/qoder.svg +1 -0
  244. package/dist/ui/assets/proxy-status-widget-I35xB9u9.js +1 -0
  245. package/dist/ui/assets/{raw-json-settings-editor-panel-DXh8c8rA.js → raw-json-settings-editor-panel-DuL_4ncA.js} +1 -1
  246. package/dist/ui/assets/{searchable-select-CtvEQrMo.js → searchable-select-BleLprBy.js} +1 -1
  247. package/dist/ui/assets/{separator-E0ISp1SN.js → separator-De5-VTtx.js} +1 -1
  248. package/dist/ui/assets/{shared-BeYwHeNS.js → shared-Bu81YVUK.js} +2 -2
  249. package/dist/ui/assets/{table-BBslZvNP.js → table-DsXaM2jg.js} +1 -1
  250. package/dist/ui/assets/updates-C2bOO3Fo.js +1 -0
  251. package/dist/ui/assets/{use-accounts-BdalFsdY.js → use-accounts-C2OmaTJU.js} +1 -1
  252. package/dist/ui/index.html +3 -3
  253. package/dist/utils/browser/browser-settings.d.ts.map +1 -1
  254. package/dist/utils/browser/browser-settings.js +13 -3
  255. package/dist/utils/browser/browser-settings.js.map +1 -1
  256. package/dist/utils/glmt-deprecation.d.ts.map +1 -1
  257. package/dist/utils/glmt-deprecation.js +1 -3
  258. package/dist/utils/glmt-deprecation.js.map +1 -1
  259. package/dist/utils/retry-strategy.js +1 -1
  260. package/dist/utils/retry-strategy.js.map +1 -1
  261. package/dist/web-server/index.d.ts.map +1 -1
  262. package/dist/web-server/index.js +0 -9
  263. package/dist/web-server/index.js.map +1 -1
  264. package/dist/web-server/middleware/auth-middleware.d.ts.map +1 -1
  265. package/dist/web-server/middleware/auth-middleware.js +26 -4
  266. package/dist/web-server/middleware/auth-middleware.js.map +1 -1
  267. package/dist/web-server/model-pricing.d.ts +18 -2
  268. package/dist/web-server/model-pricing.d.ts.map +1 -1
  269. package/dist/web-server/model-pricing.js +79 -3
  270. package/dist/web-server/model-pricing.js.map +1 -1
  271. package/dist/web-server/models-dev/pricing-resolver.js +14 -14
  272. package/dist/web-server/models-dev/pricing-resolver.js.map +1 -1
  273. package/dist/web-server/routes/account-routes.d.ts.map +1 -1
  274. package/dist/web-server/routes/account-routes.js +116 -0
  275. package/dist/web-server/routes/account-routes.js.map +1 -1
  276. package/dist/web-server/routes/bar-routes.d.ts +149 -0
  277. package/dist/web-server/routes/bar-routes.d.ts.map +1 -0
  278. package/dist/web-server/routes/bar-routes.js +415 -0
  279. package/dist/web-server/routes/bar-routes.js.map +1 -0
  280. package/dist/web-server/routes/cliproxy-auth-routes.d.ts +10 -0
  281. package/dist/web-server/routes/cliproxy-auth-routes.d.ts.map +1 -1
  282. package/dist/web-server/routes/cliproxy-auth-routes.js +45 -13
  283. package/dist/web-server/routes/cliproxy-auth-routes.js.map +1 -1
  284. package/dist/web-server/routes/cliproxy-local-proxy.d.ts.map +1 -1
  285. package/dist/web-server/routes/cliproxy-local-proxy.js +25 -8
  286. package/dist/web-server/routes/cliproxy-local-proxy.js.map +1 -1
  287. package/dist/web-server/routes/cursor-routes.d.ts.map +1 -1
  288. package/dist/web-server/routes/cursor-routes.js +6 -1
  289. package/dist/web-server/routes/cursor-routes.js.map +1 -1
  290. package/dist/web-server/routes/image-analysis-routes.d.ts.map +1 -1
  291. package/dist/web-server/routes/image-analysis-routes.js +7 -0
  292. package/dist/web-server/routes/image-analysis-routes.js.map +1 -1
  293. package/dist/web-server/routes/index.d.ts.map +1 -1
  294. package/dist/web-server/routes/index.js +18 -0
  295. package/dist/web-server/routes/index.js.map +1 -1
  296. package/dist/web-server/routes/profile-routes.d.ts.map +1 -1
  297. package/dist/web-server/routes/profile-routes.js +6 -1
  298. package/dist/web-server/routes/profile-routes.js.map +1 -1
  299. package/dist/web-server/routes/settings-routes.d.ts.map +1 -1
  300. package/dist/web-server/routes/settings-routes.js +10 -1
  301. package/dist/web-server/routes/settings-routes.js.map +1 -1
  302. package/dist/web-server/services/claude-extension-settings-service.d.ts.map +1 -1
  303. package/dist/web-server/services/claude-extension-settings-service.js +5 -1
  304. package/dist/web-server/services/claude-extension-settings-service.js.map +1 -1
  305. package/dist/web-server/usage/bar-analytics.d.ts +101 -0
  306. package/dist/web-server/usage/bar-analytics.d.ts.map +1 -0
  307. package/dist/web-server/usage/bar-analytics.js +315 -0
  308. package/dist/web-server/usage/bar-analytics.js.map +1 -0
  309. package/dist/web-server/usage/claude-native-credentials.d.ts +56 -0
  310. package/dist/web-server/usage/claude-native-credentials.d.ts.map +1 -0
  311. package/dist/web-server/usage/claude-native-credentials.js +140 -0
  312. package/dist/web-server/usage/claude-native-credentials.js.map +1 -0
  313. package/dist/web-server/usage/cliproxy-snapshot-reader.d.ts +24 -0
  314. package/dist/web-server/usage/cliproxy-snapshot-reader.d.ts.map +1 -0
  315. package/dist/web-server/usage/cliproxy-snapshot-reader.js +82 -0
  316. package/dist/web-server/usage/cliproxy-snapshot-reader.js.map +1 -0
  317. package/dist/web-server/usage/cliproxy-usage-syncer.d.ts +3 -2
  318. package/dist/web-server/usage/cliproxy-usage-syncer.d.ts.map +1 -1
  319. package/dist/web-server/usage/cliproxy-usage-syncer.js +46 -13
  320. package/dist/web-server/usage/cliproxy-usage-syncer.js.map +1 -1
  321. package/dist/web-server/usage/cliproxy-usage-transformer.d.ts +9 -3
  322. package/dist/web-server/usage/cliproxy-usage-transformer.d.ts.map +1 -1
  323. package/dist/web-server/usage/cliproxy-usage-transformer.js +133 -19
  324. package/dist/web-server/usage/cliproxy-usage-transformer.js.map +1 -1
  325. package/dist/web-server/usage/codex-local-quota-collector.d.ts +74 -0
  326. package/dist/web-server/usage/codex-local-quota-collector.d.ts.map +1 -0
  327. package/dist/web-server/usage/codex-local-quota-collector.js +250 -0
  328. package/dist/web-server/usage/codex-local-quota-collector.js.map +1 -0
  329. package/dist/web-server/usage/codex-native-usage-collector.d.ts.map +1 -1
  330. package/dist/web-server/usage/codex-native-usage-collector.js +18 -2
  331. package/dist/web-server/usage/codex-native-usage-collector.js.map +1 -1
  332. package/dist/web-server/usage/data-aggregator.d.ts +11 -0
  333. package/dist/web-server/usage/data-aggregator.d.ts.map +1 -1
  334. package/dist/web-server/usage/data-aggregator.js +29 -1
  335. package/dist/web-server/usage/data-aggregator.js.map +1 -1
  336. package/dist/web-server/usage/native-quota-collector.d.ts +44 -0
  337. package/dist/web-server/usage/native-quota-collector.d.ts.map +1 -0
  338. package/dist/web-server/usage/native-quota-collector.js +378 -0
  339. package/dist/web-server/usage/native-quota-collector.js.map +1 -0
  340. package/dist/web-server/usage/profile-filter.d.ts +1 -1
  341. package/dist/web-server/usage/profile-filter.d.ts.map +1 -1
  342. package/dist/web-server/usage/profile-filter.js +6 -1
  343. package/dist/web-server/usage/profile-filter.js.map +1 -1
  344. package/dist/web-server/usage/types.d.ts +2 -0
  345. package/dist/web-server/usage/types.d.ts.map +1 -1
  346. package/lib/mcp/ccs-browser-server.cjs +31 -15
  347. package/package.json +1 -1
  348. package/scripts/completion/ccs.bash +0 -12
  349. package/scripts/completion/ccs.fish +0 -11
  350. package/scripts/completion/ccs.ps1 +0 -10
  351. package/scripts/completion/ccs.zsh +0 -13
  352. package/scripts/github/stable-release-issue-cleanup-lib.mjs +115 -0
  353. package/scripts/github/stable-release-issue-cleanup.mjs +134 -0
  354. package/dist/ui/assets/accounts-BPJltru3.js +0 -1
  355. package/dist/ui/assets/api-BxPN-zy4.js +0 -4
  356. package/dist/ui/assets/claude-extension-CWpjmIGt.js +0 -1
  357. package/dist/ui/assets/cliproxy-K6eBb5VO.js +0 -4
  358. package/dist/ui/assets/cliproxy-control-panel-Cz5r7kHP.js +0 -1
  359. package/dist/ui/assets/codex-0HdbW8NR.js +0 -30
  360. package/dist/ui/assets/icons-DzKUh8vG.js +0 -1
  361. package/dist/ui/assets/index-BMoGhs28.css +0 -1
  362. package/dist/ui/assets/index-COt1pbk-.js +0 -1
  363. package/dist/ui/assets/index-CcGVqYOy.js +0 -56
  364. package/dist/ui/assets/logs-BRFVfyLc.js +0 -1
  365. package/dist/ui/assets/proxy-status-widget-s1UWOE23.js +0 -1
  366. package/dist/ui/assets/updates-CDrm903n.js +0 -1
@@ -1 +0,0 @@
1
- import{j as e}from"./radix-ui-nu4wz29m.js";import{r as f,E as Le}from"./react-vendor-Bjx91N7w.js";import{u as U,a as R,C as N,b,S as p,c as u,P as k,B as _,d as $e,e as X,f as de,g as Pe,h as ue,i as Re,j as Fe,k as Me,l as De,m as Ae,n as Be,o as xe,p as v,q as P,r as Ie,s as Oe,t as Ue,v as qe}from"./index-CcGVqYOy.js";import{a3 as Ee,am as me,an as se,ao as he,a1 as fe,aa as Ke,G as _e,ap as We,R as Ge,$ as ne,U as He,Z as pe,v as Ve,ae as Q,aq as Ye,Y as ze,C as Qe,ar as Ze,as as Xe}from"./icons-DzKUh8vG.js";import{a as Je,u as q}from"./tanstack-bhJxV1h8.js";import{u as es}from"./use-accounts-BdalFsdY.js";import{K as B,L as ge,f as L,H as ss}from"./utils-CzKF5WmX.js";import{R as je,A as ts,C as as,X as ns,Y as re,T as ye,b as le,P as rs,c as ls,d as os}from"./charts-eIPy2oG6.js";import"./notifications-B4_o8bcr.js";import"./form-utils-CuHzLhJZ.js";function is({data:s,isLoading:t}){const{privacyMode:a}=U(),{t:n}=R(),c=s?.totalTokens??0,r=s?.totalInputTokens??0,o=s?.totalOutputTokens??0,x=s?.totalCacheTokens??0,l=r+o;if(t)return e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-5 gap-4",children:[1,2,3,4,5].map(h=>e.jsx(N,{children:e.jsx(b,{className:"p-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(p,{className:"h-4 w-[100px]"}),e.jsx(p,{className:"h-8 w-[80px]"})]}),e.jsx(p,{className:"h-8 w-8 rounded-lg"})]})})},h))});const i=(s?.tokenBreakdown?.cacheCreation?.cost??0)+(s?.tokenBreakdown?.cacheRead?.cost??0),m=s?.totalCost?Math.round(i/s.totalCost*100):0,d=x>0&&c>l,g=x>0&&!d?"Total Tokens (I/O)":n("analyticsSummary.totalTokens"),S=d?`${$(r)} in / ${$(o)} out / ${$(x)} cache`:n("analyticsSummary.totalTokensSubtitle",{input:$(r),output:$(o)}),C=[{title:g,value:c,icon:Ee,format:h=>$(h),color:"text-blue-600",bgColor:"bg-blue-100 dark:bg-blue-900/20",subtitle:S},{title:n("analyticsSummary.totalCost"),value:s?.totalCost??0,icon:me,format:h=>`$${h.toFixed(2)}`,color:"text-green-600",bgColor:"bg-green-100 dark:bg-green-900/20",subtitle:n("analyticsSummary.totalCostSubtitle",{value:s?.averageCostPerDay?.toFixed(2)??"0.00"})},{title:n("analyticsSummary.cacheTokens"),value:s?.totalCacheTokens??0,icon:se,format:h=>$(h),color:"text-cyan-600",bgColor:"bg-cyan-100 dark:bg-cyan-900/20",subtitle:n("analyticsSummary.cacheTokensSubtitle",{cost:i.toFixed(2),percent:m})},{title:n("analyticsSummary.inputCost"),value:s?.tokenBreakdown?.input?.cost??0,icon:he,format:h=>`$${h.toFixed(2)}`,color:"text-purple-600",bgColor:"bg-purple-100 dark:bg-purple-900/20",subtitle:n("analyticsSummary.tokensSubtitle",{value:$(s?.tokenBreakdown?.input?.tokens??0)})},{title:n("analyticsSummary.outputCost"),value:s?.tokenBreakdown?.output?.cost??0,icon:fe,format:h=>`$${h.toFixed(2)}`,color:"text-orange-600",bgColor:"bg-orange-100 dark:bg-orange-900/20",subtitle:n("analyticsSummary.tokensSubtitle",{value:$(s?.tokenBreakdown?.output?.tokens??0)})}];return e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-5 gap-4",children:C.map((h,y)=>{const T=h.icon;return e.jsx(N,{className:"hover:shadow-md transition-shadow",children:e.jsx(b,{className:"p-4",children:e.jsxs("div",{className:"flex items-center justify-between space-x-2",children:[e.jsxs("div",{className:"space-y-1 min-w-0",children:[e.jsx("p",{className:"text-xs font-medium text-muted-foreground truncate",children:h.title}),e.jsx("p",{className:u("text-xl font-bold truncate",a&&k),children:h.format(h.value)}),h.subtitle&&e.jsx("p",{className:u("text-[10px] text-muted-foreground truncate",a&&k),children:h.subtitle})]}),e.jsx("div",{className:u("p-2 rounded-lg shrink-0",h.bgColor),children:e.jsx(T,{className:u("h-4 w-4",h.color)})})]})})},y)})})}function $(s){return s>=1e6?`${(s/1e6).toFixed(1)}M`:s>=1e3?`${(s/1e3).toFixed(1)}K`:s.toLocaleString()}function cs({model:s}){const{privacyMode:t}=U(),{t:a}=R(),n=ds(s.ioRatio),r=s.cacheCreationTokens+s.cacheReadTokens>0?"All Tokens":a("analyticsCards.totalTokens");return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ke,{className:"h-4 w-4 text-primary shrink-0"}),e.jsx("h4",{className:"font-semibold leading-none truncate",title:s.model,children:s.model})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs(_,{variant:"secondary",className:"text-[10px] h-5 px-1.5",children:[s.percentage.toFixed(1),"% usage"]}),e.jsxs(_,{variant:n.variant,className:"text-[10px] h-5 px-1.5",children:[s.ioRatio.toFixed(0),":1 I/O"]})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsxs("div",{className:"p-2 rounded-md bg-muted/50 border text-center",children:[e.jsxs("p",{className:u("text-lg font-bold",t&&k),children:["$",s.cost.toFixed(2)]}),e.jsx("p",{className:"text-[10px] text-muted-foreground uppercase tracking-wider",children:a("analyticsCards.totalCost")})]}),e.jsxs("div",{className:"p-2 rounded-md bg-muted/50 border text-center",children:[e.jsx("p",{className:u("text-lg font-bold",t&&k),children:xs(s.tokens)}),e.jsx("p",{className:"text-[10px] text-muted-foreground uppercase tracking-wider",children:r})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h5",{className:"text-[11px] font-medium text-muted-foreground uppercase tracking-wider",children:"Token Breakdown"}),e.jsxs("div",{className:u("space-y-1",t&&k),children:[e.jsx(Z,{label:"Input",tokens:s.inputTokens,cost:s.costBreakdown.input.cost,color:"#335c67",icon:he}),e.jsx(Z,{label:"Output",tokens:s.outputTokens,cost:s.costBreakdown.output.cost,color:"#fff3b0",icon:fe}),e.jsx(Z,{label:"Cache Write",tokens:s.cacheCreationTokens,cost:s.costBreakdown.cacheCreation.cost,color:"#e09f3e",icon:se}),e.jsx(Z,{label:"Cache Read",tokens:s.cacheReadTokens,cost:s.costBreakdown.cacheRead.cost,color:"#9e2a2b",icon:se})]})]}),e.jsxs("div",{className:"p-2.5 rounded-md border bg-muted/20 space-y-1.5",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(_e,{className:"h-3.5 w-3.5 text-muted-foreground"}),e.jsx("span",{className:"text-xs font-medium",children:a("analyticsCards.inputOutputRatio")})]}),e.jsx("p",{className:"text-[11px] text-muted-foreground leading-snug",children:n.description})]})]})}function Z({label:s,tokens:t,cost:a,color:n,icon:c}){return t===0?null:e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsx("div",{className:"w-1 h-6 rounded-full shrink-0",style:{backgroundColor:n}}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"font-medium truncate",children:s}),e.jsxs("span",{className:"font-mono text-muted-foreground",children:["$",a.toFixed(3)]})]}),e.jsxs("div",{className:"flex items-center gap-1.5 text-muted-foreground",children:[e.jsx(c,{className:"h-3 w-3 shrink-0"}),e.jsx("span",{children:us(t)})]})]})]})}function ds(s){return s>=200?{variant:"destructive",description:"Extended thinking or large context loading. Expected for reasoning models."}:s>=50?{variant:"secondary",description:"More input than output. Typical for analysis tasks."}:s>=5?{variant:"outline",description:"Balanced input/output ratio for typical coding tasks."}:{variant:"default",description:"More output than input. Generation-heavy workload."}}function us(s){return s.toLocaleString()}function xs(s){return s>=1e9?`${(s/1e9).toFixed(1)}B`:s>=1e6?`${(s/1e6).toFixed(1)}M`:s>=1e3?`${(s/1e3).toFixed(1)}K`:s.toString()}const ms="/api";function oe(s){const t=s.getFullYear(),a=String(s.getMonth()+1).padStart(2,"0"),n=String(s.getDate()).padStart(2,"0");return`${t}${a}${n}`}function M(s,t){const a=t.toString();return a?`${s}?${a}`:s}function D(s,t){t?.startDate&&s.append("since",oe(t.startDate)),t?.endDate&&s.append("until",oe(t.endDate))}function A(s,t){t?.profile&&s.append("profile",t.profile)}const I={summary:s=>{const t=new URLSearchParams;return D(t,s),A(t,s),F(M("/usage/summary",t))},trends:s=>{const t=new URLSearchParams;return D(t,s),A(t,s),F(M("/usage/daily",t))},hourly:s=>{const t=new URLSearchParams;return D(t,s),A(t,s),F(M("/usage/hourly",t))},models:s=>{const t=new URLSearchParams;return D(t,s),A(t,s),F(M("/usage/models",t))},sessions:s=>{const t=new URLSearchParams;return D(t,s),s?.limit&&t.append("limit",s.limit.toString()),s?.offset&&t.append("offset",s.offset.toString()),A(t,s),F(M("/usage/sessions",t))},monthly:s=>{const t=new URLSearchParams;return D(t,s),A(t,s),F(M("/usage/monthly",t))},refresh:async()=>{if(!(await fetch(`${ms}/usage/refresh`,{method:"POST",headers:{"Content-Type":"application/json"}})).ok)throw new Error("Failed to refresh usage cache")},status:()=>F("/usage/status"),insights:s=>{const t=new URLSearchParams;return D(t,s),A(t,s),F(M("/usage/insights",t))}};async function F(s){const a=await fetch(`/api${s}`,{headers:{"Content-Type":"application/json"}});if(!a.ok){const c=await a.json().catch(()=>({error:"Unknown error"}));throw new Error(c.error||a.statusText)}const n=await a.json();return n.data||n}function hs(s){return q({queryKey:["usage","summary",s],queryFn:()=>I.summary(s),staleTime:60*1e3})}function fs(s){return q({queryKey:["usage","trends",s],queryFn:()=>I.trends(s),staleTime:60*1e3})}function ps(s){return q({queryKey:["usage","hourly",s],queryFn:()=>I.hourly(s),staleTime:60*1e3})}function gs(s){return q({queryKey:["usage","models",s],queryFn:()=>I.models(s),staleTime:60*1e3})}function js(){const s=Je();return f.useCallback(async()=>{await I.refresh(),await s.invalidateQueries({queryKey:["usage"]})},[s])}function ys(){return q({queryKey:["usage","status"],queryFn:()=>I.status(),staleTime:10*1e3,refetchInterval:30*1e3})}function Ns(s){return q({queryKey:["usage","sessions",s],queryFn:()=>I.sessions(s),staleTime:60*1e3})}const bs=50,te="ccs.analytics.selectedProfile",W="all";function ws(){if(typeof globalThis.localStorage>"u")return W;const s=globalThis.localStorage.getItem(te);return!s||s.startsWith("unsupported:")?W:s}function vs(s){if(!(typeof globalThis.localStorage>"u")){if(s===W){globalThis.localStorage.removeItem(te);return}globalThis.localStorage.setItem(te,s)}}function ks(){const[s,t]=f.useState({from:B(new Date,30),to:new Date}),[a,n]=f.useState(!1),[c,r]=f.useState(null),[o,x]=f.useState(ws),[l,i]=f.useState(null),[m,d]=f.useState("daily"),{data:g}=es(),{data:S}=$e(),C=js(),h=f.useCallback(async()=>{n(!0);try{await C()}finally{n(!1)}},[C]),y=f.useMemo(()=>({startDate:s?.from,endDate:s?.to,profile:o===W?void 0:o}),[s?.from,s?.to,o]),T=f.useMemo(()=>{const w=new Set(g?.accounts.map(j=>j.name)??[]),z=[{value:W,label:"All profiles",description:"Includes all analytics sources.",supported:!0},{value:"default",label:"Default Claude",description:"Profile-scoped Claude JSONL data.",supported:!0},...Array.from(w).sort((j,Te)=>j.localeCompare(Te)).map(j=>({value:j,label:j,description:"Profile-scoped account data.",supported:!0}))];for(const j of S?.profiles??[])w.has(j.name)||j.name==="default"||z.push({value:`unsupported:${j.name}`,label:j.name,description:"API profile usage is not yet attributed by stable profile.",supported:!1});return z},[g?.accounts,S?.profiles]),{data:E,isLoading:O}=hs(y),{data:J,isLoading:G}=fs(y),{data:K,isLoading:H}=ps(y),{data:ee,isLoading:V}=gs(y),{data:Ne,isLoading:ae}=Ns({...y,limit:bs}),{data:Y}=ys(),be=f.useCallback(()=>{const w=new Date;t({from:B(w,1),to:w}),d("hourly")},[]),we=f.useCallback(w=>{t(w),d("daily")},[]),ve=f.useCallback(w=>{w.startsWith("unsupported:")||(x(w),vs(w))},[]),ke=f.useMemo(()=>Y?.lastFetch?ge(new Date(Y.lastFetch),{addSuffix:!0}):null,[Y?.lastFetch]),Ce=f.useCallback((w,z)=>{const j=z.currentTarget.getBoundingClientRect();i({x:j.left+j.width/2,y:j.top+j.height/2}),r(w)},[]),Se=f.useCallback(()=>{r(null),i(null)},[]);return{dateRange:s,isRefreshing:a,viewMode:m,selectedProfile:o,profileOptions:T,selectedModel:c,popoverPosition:l,summary:E,trends:J,hourlyData:K,models:ee,sessions:Ne,status:Y,isSummaryLoading:O,isTrendsLoading:G,isHourlyLoading:H,isModelsLoading:V,isSessionsLoading:ae,isLoading:O||G||V||ae,handleRefresh:h,handleTodayClick:be,handleDateRangeChange:we,handleProfileChange:ve,handleModelClick:Ce,handlePopoverClose:Se,lastUpdatedText:ke}}function Cs({value:s,onChange:t,presets:a=[{label:"Last 7 days",range:{from:B(new Date,7),to:new Date}},{label:"Last 30 days",range:{from:B(new Date,30),to:new Date}},{label:"Last 90 days",range:{from:B(new Date,90),to:new Date}}],className:n}){const[c,r]=Le.useState(!1),{t:o}=R(),x=l=>!s||!s.from||!s.to||!l.from||!l.to?!1:L(s.from,"yyyy-MM-dd")===L(l.from,"yyyy-MM-dd")&&L(s.to,"yyyy-MM-dd")===L(l.to,"yyyy-MM-dd");return e.jsxs("div",{className:u("flex flex-wrap items-center gap-2",n),children:[a.map(l=>e.jsx(X,{variant:x(l.range)?"default":"outline",size:"sm",onClick:()=>t(l.range),children:l.label},l.label)),e.jsxs(de,{open:c,onOpenChange:r,children:[e.jsx(Pe,{asChild:!0,children:e.jsxs(X,{id:"date",variant:"outline",className:u("w-auto min-w-[200px] sm:min-w-[240px] justify-start text-left font-normal",!s&&"text-muted-foreground"),children:[e.jsx(We,{className:"mr-2 h-4 w-4"}),s?.from?s.to?e.jsxs(e.Fragment,{children:[L(s.from,"LLL dd, y")," - ",L(s.to,"LLL dd, y")]}):L(s.from,"LLL dd, y"):e.jsx("span",{children:o("dateRangeFilter.pickADate")})]})}),e.jsx(ue,{className:"w-auto p-0",align:"end",children:e.jsx(Re,{initialFocus:!0,mode:"range",defaultMonth:s?.from,selected:s,onSelect:t,numberOfMonths:2})})]})]})}function Ss({dateRange:s,onDateRangeChange:t,onTodayClick:a,onRefresh:n,isRefreshing:c,lastUpdatedText:r,viewMode:o,selectedProfile:x,profileOptions:l,onProfileChange:i}){const{t:m}=R();return e.jsxs("div",{className:"flex flex-col gap-3 shrink-0 xl:flex-row xl:items-center xl:justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-xl font-semibold",children:m("analytics.title")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:m("analytics.subtitle")})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2 xl:justify-end",children:[e.jsxs(Fe,{value:x,onValueChange:i,children:[e.jsx(Me,{className:"h-8 w-[190px]","aria-label":"Analytics profile",children:e.jsx(De,{placeholder:"All profiles"})}),e.jsx(Ae,{children:l.map(d=>e.jsx(Be,{value:d.value,disabled:!d.supported,children:e.jsxs("span",{className:"flex flex-col",children:[e.jsx("span",{children:d.label}),e.jsx("span",{className:"text-xs text-muted-foreground",children:d.description})]})},d.value))})]}),e.jsx(X,{variant:o==="hourly"?"default":"outline",size:"sm",className:"h-8",onClick:a,children:"24H"}),e.jsx(Cs,{className:"flex-wrap",value:s,onChange:t,presets:[{label:"7D",range:{from:B(new Date,7),to:new Date}},{label:"30D",range:{from:B(new Date,30),to:new Date}},{label:m("analytics.month"),range:{from:ss(new Date),to:new Date}},{label:m("analytics.allTime"),range:{from:void 0,to:new Date}}]}),r&&e.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:m("analytics.updated",{value:r})}),e.jsx(X,{variant:"outline",size:"sm",className:"gap-2 h-8",onClick:n,disabled:c,children:e.jsx(Ge,{className:`w-3.5 h-3.5 ${c?"animate-spin":""}`})})]}),x!=="all"&&e.jsx("p",{className:"text-xs text-muted-foreground xl:text-right",children:"Selected-profile analytics include only default/account data with stable profile attribution. CLIProxy and native runtime snapshots remain in All profiles."})]})}function Ts({data:s,isLoading:t,granularity:a="daily",className:n}){const{privacyMode:c}=U(),{t:r}=R(),o=f.useMemo(()=>!s||s.length===0?[]:s.map(i=>{const m="hour"in i?i.hour:i.date;return{...i,dateFormatted:Ls(m,a),costRounded:Number(i.cost.toFixed(4))}}),[s,a]);if(t)return e.jsx(p,{className:u("h-full w-full",n)});if(!s||s.length===0)return e.jsx("div",{className:u("h-full flex items-center justify-center",n),children:e.jsx("p",{className:"text-muted-foreground",children:r(a==="hourly"?"analytics.noDailyUsage":"analytics.noUsageData")})});const x=({x:l,y:i,payload:m,isRight:d})=>{const g=d?`$${m.value}`:ie(Number(m.value));return e.jsx("text",{x:l,y:i,dy:4,textAnchor:d?"start":"end",fontSize:12,fill:"currentColor",className:u("fill-muted-foreground",c&&"blur-[4px]"),children:g})};return e.jsx("div",{className:u("w-full h-full",n),children:e.jsx(je,{width:"100%",height:"100%",children:e.jsxs(ts,{data:o,margin:{top:5,right:30,left:20,bottom:5},children:[e.jsxs("defs",{children:[e.jsxs("linearGradient",{id:"tokenGradient",x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"5%",stopColor:"#0080FF",stopOpacity:.8}),e.jsx("stop",{offset:"95%",stopColor:"#0080FF",stopOpacity:.1})]}),e.jsxs("linearGradient",{id:"costGradient",x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"5%",stopColor:"#00C49F",stopOpacity:.8}),e.jsx("stop",{offset:"95%",stopColor:"#00C49F",stopOpacity:.1})]})]}),e.jsx(as,{strokeDasharray:"3 3",className:"stroke-muted"}),e.jsx(ns,{dataKey:"dateFormatted",tick:{fontSize:12},tickLine:!1,axisLine:{className:"stroke-muted"}}),e.jsx(re,{yAxisId:"left",orientation:"left",tick:l=>e.jsx(x,{...l,isRight:!1}),tickLine:!1,axisLine:{className:"stroke-muted"}}),e.jsx(re,{yAxisId:"right",orientation:"right",tick:l=>e.jsx(x,{...l,isRight:!0}),tickLine:!1,axisLine:{className:"stroke-muted"}}),e.jsx(ye,{content:({active:l,payload:i,label:m})=>!l||!i||!i.length?null:e.jsxs("div",{className:"rounded-lg border bg-background p-3 shadow-lg",children:[e.jsx("p",{className:"font-medium mb-2",children:m}),i.map((d,g)=>e.jsxs("p",{className:u("text-sm",c&&k),style:{color:d.color},children:[d.name,":"," ",d.name==="Tokens"?ie(Number(d.value)||0):`$${d.value}`]},g))]})}),e.jsx(le,{yAxisId:"left",type:"monotone",dataKey:"tokens",stroke:"#0080FF",strokeWidth:2,fillOpacity:1,fill:"url(#tokenGradient)",name:"Tokens"}),e.jsx(le,{yAxisId:"right",type:"monotone",dataKey:"costRounded",stroke:"#00C49F",strokeWidth:2,fillOpacity:1,fill:"url(#costGradient)",name:"Cost"})]})})})}function Ls(s,t){if(t==="hourly"){const[n,c]=s.split(" ");if(n&&c){const r=new Date(`${n}T${c}:00Z`);return L(r,"HH:mm")}return s}const a=new Date(s);return t==="monthly"?L(a,"MMM yyyy"):L(a,"MMM dd")}function ie(s){return s>=1e6?`${(s/1e6).toFixed(1)}M`:s>=1e3?`${(s/1e3).toFixed(1)}K`:s.toLocaleString()}function $s({data:s,isLoading:t,className:a}){const{privacyMode:n}=U(),{t:c}=R(),r=f.useMemo(()=>!s||s.length===0?[]:s.map(l=>({name:l.model,value:l.tokens,cost:l.cost,percentage:l.percentage,fill:xe(l.model)})),[s]);if(t)return e.jsx(p,{className:u("h-full min-h-[100px] w-full",a)});if(!s||s.length===0)return e.jsx("div",{className:u("h-full min-h-[100px] flex items-center justify-center",a),children:e.jsx("p",{className:"text-muted-foreground",children:c("analyticsCards.noModelData")})});const o=({active:l,payload:i})=>{if(!l||!i)return null;const m=i;if(!m.length)return null;const d=m[0].payload;return e.jsxs("div",{className:"rounded-lg border bg-background p-2 shadow-lg text-xs",children:[e.jsx("p",{className:"font-medium mb-1",children:d.name}),e.jsxs("p",{className:u("text-muted-foreground",n&&k),children:[Ps(d.value)," (",d.percentage.toFixed(1),"%)"]}),e.jsxs("p",{className:u("text-muted-foreground",n&&k),children:["$",d.cost.toFixed(4)]})]})},x=l=>l.percentage>5?`${l.percentage.toFixed(1)}%`:"";return e.jsx("div",{className:u("w-full h-full min-h-[100px]",a),children:e.jsx(je,{width:"100%",height:"100%",children:e.jsxs(rs,{children:[e.jsx(ls,{data:r,cx:"50%",cy:"50%",labelLine:!1,label:x,innerRadius:50,outerRadius:70,paddingAngle:2,dataKey:"value",children:r.map((l,i)=>e.jsx(os,{fill:l.fill,strokeWidth:1},`cell-${i}`))}),e.jsx(ye,{content:o})]})})})}function Ps(s){return s>=1e6?`${(s/1e6).toFixed(1)}M`:s>=1e3?`${(s/1e3).toFixed(1)}K`:s.toLocaleString()}function Rs(s){if(!s)return"";const a=s.replace(/^\/|\/$/g,"").split("/").filter(n=>n.length>0);return a[a.length-1]||""}function Fs({data:s,isLoading:t,className:a}){const{privacyMode:n}=U(),{t:c}=R(),r=f.useMemo(()=>{if(!s?.sessions||s.sessions.length===0)return null;const o=s.sessions,x=s.total,l=o.length,i=s.hasMore||s.offset>0,d=o.reduce((g,S)=>g+S.cost,0)/o.length;return{displayedSessions:i?l:x,totalSessions:x,avgCost:d,hasPartialSample:i,recentSessions:o.slice(0,3)}},[s]);return t?e.jsxs(N,{className:u("flex flex-col h-full min-h-0 overflow-hidden gap-0 py-0",a),children:[e.jsx(v,{className:"px-3 py-2",children:e.jsx(p,{className:"h-5 w-32"})}),e.jsx(b,{className:"px-3 pb-3 pt-0 flex-1",children:e.jsx(p,{className:"h-full w-full"})})]}):r?e.jsxs(N,{className:u("flex flex-col h-full min-h-0 overflow-hidden gap-0 py-0 shadow-sm",a),children:[e.jsx(v,{className:"px-3 py-2",children:e.jsxs(P,{className:"text-base font-semibold flex items-center gap-2",children:[e.jsx(ne,{className:"w-4 h-4"}),"Session Stats"]})}),e.jsxs(b,{className:"px-3 pb-3 pt-0 flex-1 min-h-0 flex flex-col gap-3",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsxs("div",{className:"p-2 rounded-md bg-muted/50 border text-center",children:[e.jsxs("div",{className:"flex items-center justify-center gap-1.5 text-blue-600 dark:text-blue-400",children:[e.jsx(He,{className:"w-4 h-4"}),e.jsx("span",{className:"text-xl font-bold",children:r.displayedSessions})]}),e.jsx("p",{className:"text-[10px] text-muted-foreground uppercase tracking-wider mt-0.5",children:r.hasPartialSample?"Sampled Sessions":"Total Sessions"}),r.hasPartialSample&&e.jsxs("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:[r.totalSessions," total"]})]}),e.jsxs("div",{className:"p-2 rounded-md bg-muted/50 border text-center",children:[e.jsxs("div",{className:"flex items-center justify-center gap-1.5 text-green-600 dark:text-green-400",children:[e.jsx(pe,{className:"w-4 h-4"}),e.jsxs("span",{className:u("text-xl font-bold",n&&k),children:["$",r.avgCost.toFixed(2)]})]}),e.jsx("p",{className:"text-[10px] text-muted-foreground uppercase tracking-wider mt-0.5",children:r.hasPartialSample?"Recent Avg Cost":"Avg Cost/Session"})]})]}),e.jsxs("div",{className:"flex-1 min-h-0 space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground font-medium mb-1",children:[e.jsx(Ve,{className:"w-3 h-3"}),"Recent Activity"]}),e.jsx("div",{className:"space-y-1.5 max-h-full overflow-y-auto pr-1",children:r.recentSessions.map(o=>e.jsxs("div",{className:"flex items-center justify-between text-xs p-1.5 rounded bg-muted/30 hover:bg-muted/50 transition-colors",children:[e.jsxs("div",{className:"flex flex-col min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"font-medium truncate",title:o.projectPath,children:Rs(o.projectPath)}),(o.target??"claude")!=="claude"&&e.jsx("span",{className:"shrink-0 px-1 py-0 text-[9px] font-medium rounded bg-purple-100 text-purple-700 dark:bg-purple-900/30 dark:text-purple-300 uppercase",children:o.target})]}),e.jsx("span",{className:"text-[10px] text-muted-foreground",children:ge(new Date(o.lastActivity),{addSuffix:!0})})]}),e.jsxs("div",{className:u("text-right shrink-0 ml-2",n&&k),children:[e.jsxs("div",{className:"font-mono",children:["$",o.cost.toFixed(2)]}),e.jsxs("div",{className:"text-[10px] text-muted-foreground",children:[Ms(o.tokens??o.inputTokens+o.outputTokens)," ","toks"]})]})]},o.sessionId))})]})]})]}):e.jsxs(N,{className:u("flex flex-col h-full min-h-0 overflow-hidden gap-0 py-0",a),children:[e.jsx(v,{className:"px-3 py-2",children:e.jsxs(P,{className:"text-base font-semibold flex items-center gap-2",children:[e.jsx(ne,{className:"w-4 h-4"}),"Session Stats"]})}),e.jsx(b,{className:"px-3 pb-3 pt-0 flex-1 flex items-center justify-center",children:e.jsx("p",{className:"text-sm text-muted-foreground text-center",children:c("analyticsCards.noSessionData")})})]})}function Ms(s){return s>=1e9?`${(s/1e9).toFixed(1)}B`:s>=1e6?`${(s/1e6).toFixed(1)}M`:s>=1e3?`${(s/1e3).toFixed(1)}K`:s.toString()}function Ds({className:s,isLoading:t}){const{data:a,isLoading:n}=Ie(),{data:c,isLoading:r,error:o}=Oe(a?.running),{t:x}=R();if(t||n||a?.running&&r)return e.jsxs(N,{className:u("flex flex-col h-full min-h-0 overflow-hidden gap-0 py-0",s),children:[e.jsx(v,{className:"px-3 py-2",children:e.jsxs(P,{className:"text-base font-semibold flex items-center gap-2",children:[e.jsx(Q,{className:"h-4 w-4"}),"CLIProxy Stats"]})}),e.jsx(b,{className:"px-3 pb-3 pt-0 flex-1",children:e.jsxs("div",{className:"space-y-3",children:[e.jsx(p,{className:"h-4 w-[100px]"}),e.jsx(p,{className:"h-16 w-full"})]})})]});if(!a?.running)return e.jsxs(N,{className:u("flex flex-col h-full min-h-0 overflow-hidden gap-0 py-0 border-dashed",s),children:[e.jsx(v,{className:"px-3 py-2",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(P,{className:"text-base font-semibold flex items-center gap-2",children:[e.jsx(Q,{className:"h-4 w-4 text-muted-foreground"}),"CLIProxy Stats"]}),e.jsx(_,{variant:"secondary",className:"text-[10px] h-5",children:x("cliproxyStatsOverview.offline")})]})}),e.jsx(b,{className:"px-3 pb-3 pt-0 flex-1 flex items-center justify-center",children:e.jsx("p",{className:"text-xs text-muted-foreground text-center",children:x("cliproxyStatsOverview.noActiveSessionHint")})})]});if(o)return e.jsxs(N,{className:u("flex flex-col h-full min-h-0 overflow-hidden gap-0 py-0 border-destructive/50",s),children:[e.jsx(v,{className:"px-3 py-2",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(P,{className:"text-base font-semibold flex items-center gap-2",children:[e.jsx(Q,{className:"h-4 w-4"}),"CLIProxy Stats"]}),e.jsx(_,{variant:"destructive",className:"text-[10px] h-5",children:"Error"})]})}),e.jsx(b,{className:"px-3 pb-3 pt-0 flex-1",children:e.jsx("p",{className:"text-xs text-destructive",children:o.message})})]});const i=c?.totalRequests??0,m=c?.quotaExceededCount??0,d=i-m,g=i>0?Math.round(d/i*100):100,S=c?.tokens?.total??0,C=Object.entries(c?.requestsByModel??{}).sort((y,T)=>T[1]-y[1]).slice(0,4),h=C.length>0?C[0][1]:1;return e.jsxs(N,{className:u("flex flex-col h-full min-h-0 overflow-hidden gap-0 py-0",s),children:[e.jsx(v,{className:"px-3 py-2 border-b bg-muted/5",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(P,{className:"text-base font-semibold flex items-center gap-2",children:[e.jsx(Q,{className:"h-4 w-4"}),"CLIProxy Stats"]}),e.jsxs(_,{variant:"outline",className:"text-[10px] h-5 text-green-600 border-green-200 bg-green-50 dark:bg-green-900/10 dark:border-green-800",children:[e.jsx(pe,{className:"h-3 w-3 mr-0.5"}),x("cliproxyStatsOverview.running")]})]})}),e.jsx(b,{className:"p-0 flex-1 min-h-0",children:e.jsx(Ue,{className:"h-full",children:e.jsxs("div",{className:"p-3 space-y-3",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2 p-2 rounded-lg bg-muted/30",children:[e.jsxs("div",{className:"relative",children:[e.jsxs("svg",{className:"w-10 h-10 -rotate-90",viewBox:"0 0 36 36",children:[e.jsx("circle",{cx:"18",cy:"18",r:"14",fill:"none",stroke:"currentColor",strokeWidth:"3",className:"text-muted/30"}),e.jsx("circle",{cx:"18",cy:"18",r:"14",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeDasharray:`${g*.88} 88`,strokeLinecap:"round",className:g>=90?"text-green-500":"text-amber-500"})]}),e.jsxs("span",{className:"absolute inset-0 flex items-center justify-center text-[8px] font-bold",children:[g,"%"]})]}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-lg font-bold leading-none",children:ce(i)}),e.jsx("div",{className:"text-[9px] text-muted-foreground mt-0.5",children:m>0?`${m} failed`:"All success"})]})]}),e.jsxs("div",{className:"flex items-center gap-2 p-2 rounded-lg bg-muted/30",children:[e.jsx("div",{className:"p-1.5 rounded-md bg-purple-100 dark:bg-purple-900/20",children:e.jsx(Ye,{className:"h-4 w-4 text-purple-600"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-lg font-bold leading-none",children:ce(S)}),e.jsx("div",{className:"text-[9px] text-muted-foreground mt-0.5",children:x("cliproxyStatsOverview.totalTokens")})]})]})]}),C.length>0&&e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-[10px] font-medium text-muted-foreground",children:[e.jsx(ze,{className:"h-3 w-3"}),x("cliproxyStatsOverview.modelsUsed")]}),e.jsx("div",{className:"space-y-1",children:C.map(([y,T])=>{const E=Math.round(T/h*100),O=As(y);return e.jsxs("div",{className:"group",children:[e.jsxs("div",{className:"flex items-center justify-between text-[10px] mb-0.5",children:[e.jsx("span",{className:"truncate font-medium",title:y,children:O}),e.jsx("span",{className:"text-muted-foreground shrink-0 ml-2",children:T})]}),e.jsx("div",{className:"h-1 bg-muted/50 rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full bg-accent/70 rounded-full transition-all",style:{width:`${E}%`}})})]},y)})})]})]})})})]})}function ce(s){return s>=1e6?`${(s/1e6).toFixed(1)}M`:s>=1e3?`${(s/1e3).toFixed(1)}K`:s.toLocaleString()}function As(s){let t=s.replace(/^gemini-claude-/,"").replace(/^gemini-/,"").replace(/^claude-/,"").replace(/^anthropic\./,"").replace(/-thinking$/," Thinking");return t=t.split(/[-_]/).map(a=>a.charAt(0).toUpperCase()+a.slice(1)).join(" "),t.length>20&&(t=t.slice(0,18)+"..."),t}function Bs(s){return s>=1e9?`${(s/1e9).toFixed(1)}B`:s>=1e6?`${(s/1e6).toFixed(1)}M`:s>=1e3?`${(s/1e3).toFixed(0)}K`:s.toString()}function Is({models:s,isLoading:t,onModelClick:a,privacyMode:n}){const{t:c}=R();return e.jsxs(N,{className:"flex flex-col h-full min-h-0 overflow-hidden gap-0 py-0 shadow-sm lg:col-span-4",children:[e.jsx(v,{className:"px-3 py-2",children:e.jsxs(P,{className:"text-base font-semibold flex items-center gap-2",children:[e.jsx(me,{className:"w-4 h-4"}),c("analyticsPages.costByModel")]})}),e.jsx(b,{className:"px-2 pb-2 pt-0 flex-1 min-h-0 overflow-y-auto",children:t?e.jsx(p,{className:"h-full w-full"}):e.jsxs("div",{className:"space-y-0.5",children:[[...s||[]].sort((r,o)=>o.cost-r.cost).map(r=>e.jsxs("button",{className:"group flex items-center text-xs w-full hover:bg-muted/50 rounded px-2 py-1.5 transition-colors cursor-pointer gap-3",onClick:o=>a(r,o),title:"Click for details",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0 w-[180px] shrink-0",children:[e.jsx("div",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:xe(r.model)}}),e.jsx("span",{className:"font-medium truncate group-hover:underline underline-offset-2",children:r.model})]}),e.jsx(Os,{model:r}),e.jsx("span",{className:u("text-[10px] text-muted-foreground w-14 text-right shrink-0",n&&k),children:Bs(r.tokens)}),e.jsxs("span",{className:u("font-mono font-medium w-16 text-right shrink-0",n&&k),children:["$",r.cost.toFixed(2)]}),e.jsx(Qe,{className:"w-3 h-3 opacity-0 group-hover:opacity-50 transition-opacity shrink-0"})]},r.model)),e.jsx(Us,{})]})})]})}function Os({model:s}){const t={input:"#335c67",output:"#fff3b0",cacheWrite:"#e09f3e",cacheRead:"#9e2a2b"},a=n=>s.cost>0?n/s.cost*100:0;return e.jsx("div",{className:"flex-1 flex items-center gap-1 min-w-0",children:e.jsxs("div",{className:"flex-1 h-2 bg-muted rounded-full overflow-hidden flex",children:[e.jsx("div",{className:"h-full",style:{backgroundColor:t.input,width:`${a(s.costBreakdown.input.cost)}%`},title:`Input: $${s.costBreakdown.input.cost.toFixed(2)}`}),e.jsx("div",{className:"h-full",style:{backgroundColor:t.output,width:`${a(s.costBreakdown.output.cost)}%`},title:`Output: $${s.costBreakdown.output.cost.toFixed(2)}`}),e.jsx("div",{className:"h-full",style:{backgroundColor:t.cacheWrite,width:`${a(s.costBreakdown.cacheCreation.cost)}%`},title:`Cache Write: $${s.costBreakdown.cacheCreation.cost.toFixed(2)}`}),e.jsx("div",{className:"h-full",style:{backgroundColor:t.cacheRead,width:`${a(s.costBreakdown.cacheRead.cost)}%`},title:`Cache Read: $${s.costBreakdown.cacheRead.cost.toFixed(2)}`})]})})}function Us(){const s=[{color:"#335c67",label:"Input"},{color:"#fff3b0",label:"Output",hasBorder:!0},{color:"#e09f3e",label:"Cache Write"},{color:"#9e2a2b",label:"Cache Read"}];return e.jsx("div",{className:"flex items-center gap-3 pt-2 px-2 text-[10px] text-muted-foreground border-t mt-2",children:s.map(({color:t,label:a,hasBorder:n})=>e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("div",{className:u("w-2 h-2 rounded-full",n&&"border border-muted-foreground/30"),style:{backgroundColor:t}}),a]},a))})}function qs({viewMode:s,trends:t,hourlyData:a,models:n,sessions:c,isTrendsLoading:r,isHourlyLoading:o,isModelsLoading:x,isSessionsLoading:l,isSummaryLoading:i,onModelClick:m}){const{privacyMode:d}=U();return e.jsxs("div",{className:"min-h-0 grid gap-4 lg:grid-rows-[minmax(260px,1.2fr)_minmax(220px,0.9fr)]",children:[e.jsxs(N,{className:"flex flex-col h-full min-h-[220px] lg:min-h-[240px] overflow-hidden gap-0 py-0 shadow-sm",children:[e.jsx(v,{className:"px-3 py-2 shrink-0",children:e.jsxs(P,{className:"text-base font-semibold flex items-center gap-2",children:[e.jsx(Ze,{className:"w-4 h-4"}),s==="hourly"?"Last 24 Hours":"Usage Trends"]})}),e.jsx(b,{className:"px-3 pb-3 pt-0 flex-1 min-h-0",children:e.jsx(Ts,{data:s==="hourly"?a||[]:t||[],isLoading:s==="hourly"?o:r,granularity:s==="hourly"?"hourly":"daily"})})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-10 gap-4 h-auto min-h-[220px] lg:h-full lg:min-h-[220px] lg:grid-rows-[minmax(0,1fr)] lg:[&>*]:min-h-0",children:[e.jsx(Is,{models:n,isLoading:x,onModelClick:m,privacyMode:d}),e.jsxs(N,{className:"flex flex-col h-full min-h-0 overflow-hidden gap-0 py-0 shadow-sm lg:col-span-2",children:[e.jsx(v,{className:"px-3 py-2",children:e.jsxs(P,{className:"text-base font-semibold flex items-center gap-2",children:[e.jsx(Xe,{className:"w-4 h-4"}),"Model Usage"]})}),e.jsx(b,{className:"px-2 pb-2 pt-0 flex-1 min-h-0 flex items-center justify-center",children:e.jsx($s,{data:n||[],isLoading:x,className:"h-full w-full"})})]}),e.jsx(Fs,{data:c,isLoading:l,className:"lg:col-span-2"}),e.jsx(Ds,{isLoading:i,className:"lg:col-span-2"})]})]})}function Zs(){return e.jsxs("div",{className:"space-y-4 h-full overflow-hidden",children:[e.jsxs(N,{className:"flex flex-col min-h-[300px]",children:[e.jsx(v,{className:"p-4 pb-2",children:e.jsx(p,{className:"h-4 w-32"})}),e.jsx(b,{className:"p-4 pt-0 flex-1",children:e.jsx(p,{className:"h-full w-full"})})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[e.jsxs(N,{className:"flex flex-col min-h-[250px]",children:[e.jsx(v,{className:"p-4 pb-2",children:e.jsx(p,{className:"h-4 w-28"})}),e.jsx(b,{className:"p-4 pt-2",children:e.jsx("div",{className:"space-y-3",children:[1,2,3,4,5].map(s=>e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(p,{className:"w-2.5 h-2.5 rounded-full"}),e.jsx(p,{className:"h-3 w-24"})]}),e.jsx(p,{className:"h-3 w-16"})]},s))})})]}),e.jsxs(N,{className:"flex flex-col min-h-[250px]",children:[e.jsx(v,{className:"p-4 pb-2",children:e.jsx(p,{className:"h-4 w-28"})}),e.jsx(b,{className:"p-4 pt-0 flex-1",children:e.jsxs("div",{className:"flex w-full h-full items-center",children:[e.jsx("div",{className:"flex-1 flex justify-center",children:e.jsx(p,{className:"h-[180px] w-[180px] rounded-full"})}),e.jsx("div",{className:"w-[140px] shrink-0 pl-2 space-y-2",children:[1,2,3,4].map(s=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(p,{className:"w-2 h-2 rounded-full"}),e.jsx(p,{className:"h-3 w-20"})]},s))})]})})]})]})]})}function Xs(){const s=f.useRef(null),{dateRange:t,handleDateRangeChange:a,handleTodayClick:n,handleRefresh:c,isRefreshing:r,lastUpdatedText:o,viewMode:x,selectedProfile:l,profileOptions:i,summary:m,isSummaryLoading:d,trends:g,hourlyData:S,models:C,sessions:h,isTrendsLoading:y,isHourlyLoading:T,isModelsLoading:E,isSessionsLoading:O,handleModelClick:J,handleProfileChange:G,selectedModel:K,popoverPosition:H,handlePopoverClose:ee}=ks();return e.jsxs("div",{className:"grid h-full min-h-0 grid-rows-[auto_auto_minmax(0,1fr)] gap-4 overflow-y-auto px-4 py-4",children:[e.jsx(Ss,{dateRange:t,onDateRangeChange:a,onTodayClick:n,onRefresh:c,isRefreshing:r,lastUpdatedText:o,viewMode:x,selectedProfile:l,profileOptions:i,onProfileChange:G}),e.jsx(is,{data:m,isLoading:d}),e.jsx(qs,{viewMode:x,trends:g,hourlyData:S,models:C,sessions:h,isTrendsLoading:y,isHourlyLoading:T,isModelsLoading:E,isSessionsLoading:O,isSummaryLoading:d,onModelClick:J}),e.jsxs(de,{open:!!K,onOpenChange:V=>!V&&ee(),children:[e.jsx(qe,{asChild:!0,children:e.jsx("div",{ref:s,className:"fixed pointer-events-none",style:{left:H?.x??0,top:H?.y??0,width:1,height:1}})}),e.jsx(ue,{className:"w-80 p-3",side:"top",align:"center",children:K&&e.jsx(cs,{model:K})})]})]})}export{Xs as AnalyticsPage,Zs as AnalyticsSkeleton};