fleetlens 0.15.2 → 0.15.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (222) hide show
  1. package/app/apps/web/.next/BUILD_ID +1 -1
  2. package/app/apps/web/.next/app-path-routes-manifest.json +3 -0
  3. package/app/apps/web/.next/build-manifest.json +3 -3
  4. package/app/apps/web/.next/prerender-manifest.json +3 -3
  5. package/app/apps/web/.next/routes-manifest.json +18 -0
  6. package/app/apps/web/.next/server/app/_global-error.html +1 -1
  7. package/app/apps/web/.next/server/app/_global-error.rsc +1 -1
  8. package/app/apps/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  9. package/app/apps/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  10. package/app/apps/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  11. package/app/apps/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  12. package/app/apps/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  13. package/app/apps/web/.next/server/app/_not-found/page.js +1 -1
  14. package/app/apps/web/.next/server/app/_not-found/page.js.nft.json +1 -1
  15. package/app/apps/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  16. package/app/apps/web/.next/server/app/api/ask/route.js.nft.json +1 -1
  17. package/app/apps/web/.next/server/app/api/digest/day/[date]/route.js.nft.json +1 -1
  18. package/app/apps/web/.next/server/app/api/digest/month/[yearMonth]/route.js.nft.json +1 -1
  19. package/app/apps/web/.next/server/app/api/digest/month-index/route.js.nft.json +1 -1
  20. package/app/apps/web/.next/server/app/api/digest/week/[startDate]/route.js.nft.json +1 -1
  21. package/app/apps/web/.next/server/app/api/digest/week-index/route.js.nft.json +1 -1
  22. package/app/apps/web/.next/server/app/api/menubar/route/app-paths-manifest.json +3 -0
  23. package/app/apps/web/.next/server/app/api/menubar/route/build-manifest.json +9 -0
  24. package/app/apps/web/.next/server/app/api/menubar/route/server-reference-manifest.json +4 -0
  25. package/app/apps/web/.next/server/app/api/menubar/route.js +6 -0
  26. package/app/apps/web/.next/server/app/api/menubar/route.js.map +5 -0
  27. package/app/apps/web/.next/server/app/api/menubar/route.js.nft.json +1 -0
  28. package/app/apps/web/.next/server/app/api/menubar/route_client-reference-manifest.js +3 -0
  29. package/app/apps/web/.next/server/app/api/pdf/[key]/route.js +1 -1
  30. package/app/apps/web/.next/server/app/api/pdf/[key]/route.js.nft.json +1 -1
  31. package/app/apps/web/.next/server/app/api/projects/open-folder/route/app-paths-manifest.json +3 -0
  32. package/app/apps/web/.next/server/app/api/projects/open-folder/route/build-manifest.json +9 -0
  33. package/app/apps/web/.next/server/app/api/projects/open-folder/route/server-reference-manifest.json +4 -0
  34. package/app/apps/web/.next/server/app/api/projects/open-folder/route.js +7 -0
  35. package/app/apps/web/.next/server/app/api/projects/open-folder/route.js.map +5 -0
  36. package/app/apps/web/.next/server/app/api/projects/open-folder/route.js.nft.json +1 -0
  37. package/app/apps/web/.next/server/app/api/projects/open-folder/route_client-reference-manifest.js +3 -0
  38. package/app/apps/web/.next/server/app/api/runs/[runId]/route.js.nft.json +1 -1
  39. package/app/apps/web/.next/server/app/api/runs/[runId]/stream/route.js.nft.json +1 -1
  40. package/app/apps/web/.next/server/app/api/settings/credentials/route/app-paths-manifest.json +3 -0
  41. package/app/apps/web/.next/server/app/api/settings/credentials/route/build-manifest.json +9 -0
  42. package/app/apps/web/.next/server/app/api/settings/credentials/route/server-reference-manifest.json +4 -0
  43. package/app/apps/web/.next/server/app/api/settings/credentials/route.js +10 -0
  44. package/app/apps/web/.next/server/app/api/settings/credentials/route.js.map +5 -0
  45. package/app/apps/web/.next/server/app/api/settings/credentials/route.js.nft.json +1 -0
  46. package/app/apps/web/.next/server/app/api/settings/credentials/route_client-reference-manifest.js +3 -0
  47. package/app/apps/web/.next/server/app/api/settings/route.js +4 -4
  48. package/app/apps/web/.next/server/app/api/settings/route.js.nft.json +1 -1
  49. package/app/apps/web/.next/server/app/changelog/page.js +1 -1
  50. package/app/apps/web/.next/server/app/changelog/page.js.nft.json +1 -1
  51. package/app/apps/web/.next/server/app/changelog/page_client-reference-manifest.js +1 -1
  52. package/app/apps/web/.next/server/app/day/[date]/page.js +1 -1
  53. package/app/apps/web/.next/server/app/day/[date]/page.js.nft.json +1 -1
  54. package/app/apps/web/.next/server/app/day/[date]/page_client-reference-manifest.js +1 -1
  55. package/app/apps/web/.next/server/app/day/page.js +1 -1
  56. package/app/apps/web/.next/server/app/day/page.js.nft.json +1 -1
  57. package/app/apps/web/.next/server/app/day/page_client-reference-manifest.js +1 -1
  58. package/app/apps/web/.next/server/app/digest/[date]/page.js +1 -1
  59. package/app/apps/web/.next/server/app/digest/[date]/page.js.nft.json +1 -1
  60. package/app/apps/web/.next/server/app/digest/[date]/page_client-reference-manifest.js +1 -1
  61. package/app/apps/web/.next/server/app/digest/page.js +1 -1
  62. package/app/apps/web/.next/server/app/digest/page.js.nft.json +1 -1
  63. package/app/apps/web/.next/server/app/digest/page_client-reference-manifest.js +1 -1
  64. package/app/apps/web/.next/server/app/insights/[key]/page.js +1 -1
  65. package/app/apps/web/.next/server/app/insights/[key]/page.js.nft.json +1 -1
  66. package/app/apps/web/.next/server/app/insights/[key]/page_client-reference-manifest.js +1 -1
  67. package/app/apps/web/.next/server/app/insights/page.js +1 -1
  68. package/app/apps/web/.next/server/app/insights/page.js.nft.json +1 -1
  69. package/app/apps/web/.next/server/app/insights/page_client-reference-manifest.js +1 -1
  70. package/app/apps/web/.next/server/app/page.js +1 -1
  71. package/app/apps/web/.next/server/app/page.js.nft.json +1 -1
  72. package/app/apps/web/.next/server/app/page_client-reference-manifest.js +1 -1
  73. package/app/apps/web/.next/server/app/parallelism/page.js +1 -1
  74. package/app/apps/web/.next/server/app/parallelism/page.js.nft.json +1 -1
  75. package/app/apps/web/.next/server/app/parallelism/page_client-reference-manifest.js +1 -1
  76. package/app/apps/web/.next/server/app/print/[key]/page.js +1 -1
  77. package/app/apps/web/.next/server/app/print/[key]/page.js.nft.json +1 -1
  78. package/app/apps/web/.next/server/app/print/[key]/page_client-reference-manifest.js +1 -1
  79. package/app/apps/web/.next/server/app/projects/[slug]/page.js +2 -2
  80. package/app/apps/web/.next/server/app/projects/[slug]/page.js.nft.json +1 -1
  81. package/app/apps/web/.next/server/app/projects/[slug]/page_client-reference-manifest.js +1 -1
  82. package/app/apps/web/.next/server/app/projects/page.js +1 -1
  83. package/app/apps/web/.next/server/app/projects/page.js.nft.json +1 -1
  84. package/app/apps/web/.next/server/app/projects/page_client-reference-manifest.js +1 -1
  85. package/app/apps/web/.next/server/app/runs/page.js +1 -1
  86. package/app/apps/web/.next/server/app/runs/page.js.nft.json +1 -1
  87. package/app/apps/web/.next/server/app/runs/page_client-reference-manifest.js +1 -1
  88. package/app/apps/web/.next/server/app/sessions/[id]/page.js +1 -1
  89. package/app/apps/web/.next/server/app/sessions/[id]/page.js.nft.json +1 -1
  90. package/app/apps/web/.next/server/app/sessions/[id]/page_client-reference-manifest.js +1 -1
  91. package/app/apps/web/.next/server/app/sessions/page.js +1 -1
  92. package/app/apps/web/.next/server/app/sessions/page.js.nft.json +1 -1
  93. package/app/apps/web/.next/server/app/sessions/page_client-reference-manifest.js +1 -1
  94. package/app/apps/web/.next/server/app/settings/page.js +2 -2
  95. package/app/apps/web/.next/server/app/settings/page.js.nft.json +1 -1
  96. package/app/apps/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  97. package/app/apps/web/.next/server/app/team/onboarding/page.js +1 -1
  98. package/app/apps/web/.next/server/app/team/onboarding/page.js.nft.json +1 -1
  99. package/app/apps/web/.next/server/app/team/onboarding/page_client-reference-manifest.js +1 -1
  100. package/app/apps/web/.next/server/app/team/page.js +1 -1
  101. package/app/apps/web/.next/server/app/team/page.js.nft.json +1 -1
  102. package/app/apps/web/.next/server/app/team/page_client-reference-manifest.js +1 -1
  103. package/app/apps/web/.next/server/app/usage/page.js +1 -1
  104. package/app/apps/web/.next/server/app/usage/page.js.nft.json +1 -1
  105. package/app/apps/web/.next/server/app/usage/page_client-reference-manifest.js +1 -1
  106. package/app/apps/web/.next/server/app-paths-manifest.json +3 -0
  107. package/app/apps/web/.next/server/chunks/02dz_web__next-internal_server_app_api_projects_open-folder_route_actions_0m~419c.js +3 -0
  108. package/app/apps/web/.next/server/chunks/02dz_web__next-internal_server_app_api_settings_credentials_route_actions_04an_i2.js +3 -0
  109. package/app/apps/web/.next/server/chunks/[root-of-the-server]__05z0pcw._.js +3 -0
  110. package/app/apps/web/.next/server/chunks/[root-of-the-server]__0_nle98._.js +3 -0
  111. package/app/apps/web/.next/server/chunks/[root-of-the-server]__0b5r~-1._.js +3 -0
  112. package/app/apps/web/.next/server/chunks/{[root-of-the-server]__0a0~7d6._.js → [root-of-the-server]__0t7i-hy._.js} +2 -2
  113. package/app/apps/web/.next/server/chunks/[root-of-the-server]__12iid50._.js +3 -0
  114. package/app/apps/web/.next/server/chunks/apps_web__next-internal_server_app_api_menubar_route_actions_0xep8_i.js +3 -0
  115. package/app/apps/web/.next/server/chunks/{node_modules_next_036my~r._.js → node_modules_next_04~_e52._.js} +5 -5
  116. package/app/apps/web/.next/server/chunks/packages_entries_dist_node_0bckr7-.js +14 -14
  117. package/app/apps/web/.next/server/chunks/packages_parser_dist_06d9se1._.js +1 -1
  118. package/app/apps/web/.next/server/chunks/packages_parser_dist_10ihc3~._.js +1 -1
  119. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0.zquoa._.js +1 -1
  120. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__03svi~4._.js +8 -0
  121. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__04eq6z2._.js +1 -1
  122. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__04il6m2._.js +1 -1
  123. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__08l86e-._.js +1 -1
  124. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__09rjz7_._.js +1 -1
  125. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0ar_8wr._.js +1 -1
  126. package/app/apps/web/.next/server/chunks/ssr/{[root-of-the-server]__10~b4bf._.js → [root-of-the-server]__0blm9gz._.js} +3 -3
  127. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0e.gxk3._.js +1 -1
  128. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0g-tomj._.js +3 -0
  129. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0i.q-1h._.js +1 -1
  130. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0k1x-c9._.js +1 -1
  131. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0lz4a~g._.js +1 -1
  132. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0nr2~y1._.js +3 -0
  133. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0o1_g.~._.js +1 -1
  134. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0p1x6v2._.js +1 -1
  135. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0r4tks8._.js +1 -1
  136. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0rvzdnx._.js +1 -1
  137. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0stu~~r._.js +1 -1
  138. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0tejjy_._.js +1 -1
  139. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0u39afl._.js +1 -1
  140. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0ufi3.w._.js +1 -1
  141. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0xy1qim._.js +1 -1
  142. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0~.f_3z._.js +3 -3
  143. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__10srpu0._.js +1 -1
  144. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__10xgshr._.js +1 -1
  145. package/app/apps/web/.next/server/chunks/ssr/_02r-a1a._.js +8 -0
  146. package/app/apps/web/.next/server/chunks/ssr/_0k62ejd._.js +8 -0
  147. package/app/apps/web/.next/server/chunks/ssr/{_0xu2pvc._.js → _0k8yioi._.js} +2 -2
  148. package/app/apps/web/.next/server/chunks/ssr/{_0wj750k._.js → _0t~mx7w._.js} +2 -2
  149. package/app/apps/web/.next/server/chunks/ssr/{_0kajk31._.js → _0whg~r-._.js} +2 -2
  150. package/app/apps/web/.next/server/chunks/ssr/_13jdm1g._.js +3 -0
  151. package/app/apps/web/.next/server/chunks/ssr/apps_web_0~aj0~u._.js +3 -0
  152. package/app/apps/web/.next/server/chunks/ssr/apps_web_app_sessions_sessions-grid_tsx_0bri5x.._.js +1 -1
  153. package/app/apps/web/.next/server/chunks/ssr/apps_web_components_0x014hn._.js +16 -0
  154. package/app/apps/web/.next/server/chunks/ssr/apps_web_lib_changelog_ts_0n7_p1d._.js +1 -1
  155. package/app/apps/web/.next/server/chunks/ssr/apps_web_lib_changelog_ts_0nb5_-s._.js +1 -1
  156. package/app/apps/web/.next/server/chunks/ssr/node_modules_lucide-react_dist_esm_icons_12vc-v-._.js +3 -0
  157. package/app/apps/web/.next/server/chunks/ssr/packages_entries_dist_node_0_271yr.js +1 -1
  158. package/app/apps/web/.next/server/chunks/ssr/packages_parser_dist_0mx_509._.js +1 -1
  159. package/app/apps/web/.next/server/functions-config-manifest.json +3 -0
  160. package/app/apps/web/.next/server/middleware-build-manifest.js +3 -3
  161. package/app/apps/web/.next/server/middleware-manifest.json +5 -5
  162. package/app/apps/web/.next/server/pages/500.html +1 -1
  163. package/app/apps/web/.next/server/server-reference-manifest.js +1 -1
  164. package/app/apps/web/.next/server/server-reference-manifest.json +1 -1
  165. package/app/apps/web/.next/static/chunks/0-z49mtd-zwgv.js +1 -0
  166. package/app/apps/web/.next/static/chunks/043slkg3juwck.js +1 -0
  167. package/app/apps/web/.next/static/chunks/{0~qdw1b2uz._5.js → 044mtrzh7d7va.js} +3 -3
  168. package/app/apps/web/.next/static/chunks/05b0dn.r00hq1.js +1 -0
  169. package/app/apps/web/.next/static/chunks/{14vx702c32kn6.js → 0_0~~ipv90vm3.js} +1 -1
  170. package/app/apps/web/.next/static/chunks/0awkd5df28gvj.js +6 -0
  171. package/app/apps/web/.next/static/chunks/{0m7dd-2zd9vl2.js → 0eoc4yy0s0gpe.js} +1 -1
  172. package/app/apps/web/.next/static/chunks/0g0hv.dt-de9g.js +14 -0
  173. package/app/apps/web/.next/static/chunks/0rsp61c8wb.sx.js +6 -0
  174. package/app/apps/web/.next/static/chunks/{03rd.3cc_t~yf.js → 0s~0-8l~_kqnf.js} +1 -1
  175. package/app/apps/web/.next/static/chunks/0t2on1dhydyb2.css +1 -0
  176. package/app/apps/web/.next/static/chunks/0y3448zrint0k.js +6 -0
  177. package/app/apps/web/app/api/menubar/route.ts +66 -0
  178. package/app/apps/web/app/api/projects/open-folder/route.ts +60 -0
  179. package/app/apps/web/app/api/settings/credentials/route.ts +45 -0
  180. package/app/apps/web/app/layout.tsx +2 -0
  181. package/app/apps/web/app/projects/[slug]/local-folders-button.tsx +406 -0
  182. package/app/apps/web/app/projects/[slug]/page.tsx +155 -20
  183. package/app/apps/web/app/projects/page.tsx +2 -2
  184. package/app/apps/web/app/sessions/[id]/page.tsx +4 -1
  185. package/app/apps/web/app/sessions/[id]/session-view/header-stats.tsx +81 -0
  186. package/app/apps/web/app/sessions/[id]/session-view.tsx +11 -0
  187. package/app/apps/web/app/sessions/sessions-grid.tsx +56 -25
  188. package/app/apps/web/app/settings/page.tsx +26 -0
  189. package/app/apps/web/app/usage/page.tsx +80 -0
  190. package/app/apps/web/components/menubar-install-banner.tsx +117 -0
  191. package/app/apps/web/components/menubar-install.tsx +107 -0
  192. package/app/apps/web/components/zai-credentials-form.tsx +116 -0
  193. package/app/apps/web/lib/changelog-data.generated.ts +1 -1
  194. package/app/apps/web/lib/entries-index.ts +4 -4
  195. package/app/apps/web/lib/menubar-data.ts +50 -0
  196. package/app/apps/web/lib/usage-data.ts +4 -0
  197. package/app/apps/web/package.json +1 -1
  198. package/app/apps/web/tsconfig.tsbuildinfo +1 -1
  199. package/dist/daemon-worker.js +640 -240
  200. package/dist/index.js +938 -283
  201. package/package.json +3 -2
  202. package/app/apps/web/.next/server/chunks/[root-of-the-server]__065lib8._.js +0 -3
  203. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0a7n44-._.js +0 -3
  204. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0c00i76._.js +0 -3
  205. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0lhwp-k._.js +0 -8
  206. package/app/apps/web/.next/server/chunks/ssr/_0s3n5mz._.js +0 -8
  207. package/app/apps/web/.next/server/chunks/ssr/_12mbgs5._.js +0 -3
  208. package/app/apps/web/.next/server/chunks/ssr/apps_web_0q2x4a~._.js +0 -3
  209. package/app/apps/web/.next/server/chunks/ssr/apps_web_components_0b-4-4j._.js +0 -8
  210. package/app/apps/web/.next/server/chunks/ssr/apps_web_components_0txtsv5._.js +0 -16
  211. package/app/apps/web/.next/server/chunks/ssr/node_modules_lucide-react_dist_esm_icons_0cepfi8._.js +0 -3
  212. package/app/apps/web/.next/static/chunks/00a9oyw~h5i1p.js +0 -1
  213. package/app/apps/web/.next/static/chunks/03gy1evbn94qu.js +0 -6
  214. package/app/apps/web/.next/static/chunks/040s42ypidk7s.css +0 -1
  215. package/app/apps/web/.next/static/chunks/0d2x-wfu.m0-z.js +0 -6
  216. package/app/apps/web/.next/static/chunks/0i77er85v.rj..js +0 -1
  217. package/app/apps/web/.next/static/chunks/0nqklmbs5s3ax.js +0 -6
  218. package/app/apps/web/.next/static/chunks/0tirv_vo6q8uc.js +0 -1
  219. package/app/apps/web/.next/static/chunks/0u6gxpqhl0gc7.js +0 -14
  220. /package/app/apps/web/.next/static/{mTj8nKiazosAKJec15dLe → nmAGY0LiBgXuibWTKZ1RD}/_buildManifest.js +0 -0
  221. /package/app/apps/web/.next/static/{mTj8nKiazosAKJec15dLe → nmAGY0LiBgXuibWTKZ1RD}/_clientMiddlewareManifest.js +0 -0
  222. /package/app/apps/web/.next/static/{mTj8nKiazosAKJec15dLe → nmAGY0LiBgXuibWTKZ1RD}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,63059,e=>{"use strict";let t=(0,e.i(75254).default)("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);e.s(["ChevronRight",0,t],63059)},40484,e=>{"use strict";var t=e.i(18050);let r={build:"var(--af-accent)",plan:"#9f7aea",debug:"#ed8936",review:"#4299e1",refactor:"#38b2ac",test:"#48bb78",release:"#ed64a6",research:"#a0aec0",steer:"#f6ad55",meta:"#718096",warmup_minimal:"#cbd5e0"};e.s(["GoalBar",0,function({goals:e,total:n,height:a=12}){return 0===n||0===e.length?(0,t.jsx)("p",{style:{fontSize:12,color:"var(--af-text-tertiary)",margin:0},children:"No goal data."}):(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{style:{display:"flex",gap:2,height:a,borderRadius:3,overflow:"hidden"},children:e.map(e=>{let a=e.minutes/n*100;return(0,t.jsx)("div",{style:{width:`${a}%`,background:r[e.category]??"#888"},title:`${e.category}: ${Math.round(e.minutes)}m (${a.toFixed(0)}%)`},e.category)})}),(0,t.jsx)("div",{style:{display:"flex",gap:14,marginTop:8,flexWrap:"wrap",fontSize:11,color:"var(--af-text-tertiary)"},children:e.map(e=>(0,t.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:5},children:[(0,t.jsx)("span",{style:{width:8,height:8,borderRadius:2,background:r[e.category]??"#888"}}),e.category," ",Math.round(e.minutes),"m"]},e.category))})]})}])},64659,e=>{"use strict";let t=(0,e.i(75254).default)("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);e.s(["ChevronDown",0,t],64659)},98572,e=>{"use strict";let t=["/.claude/worktrees/","/.worktrees/","/claude/worktrees/"],r=/\/conductor\/workspaces\/[^/]+\/([^/]+)(?:\/|$)/,n="/.superset/worktrees/",a=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function i(e){let i=e.replace(/\/{2,}/g,"/"),l=function(e){for(let r of t){let t=e.lastIndexOf(r);if(t>=0)return{idx:t,marker:r}}return null}(i);if(l)return i.slice(0,l.idx);let o=function(e){let t=r.exec(e);if(!t)return null;let n=t[1],a=+!!t[0].endsWith("/");return{canonicalEndIdx:t.index+t[0].length-n.length-1-a,workspaceName:n}}(i);if(o)return i.slice(0,o.canonicalEndIdx);let s=function(e){let t=e.indexOf(n);if(t<0)return null;let r=e.slice(t+n.length).split("/").filter(Boolean);if(0===r.length)return null;let i=a.test(r[0])?r[1]??r[0]:r[0];return{canonical:e.slice(0,t)+n+i,workspaceName:i}}(i);return s?s.canonical:i}function l(e){let t=i(e),r=t.replace(/\/+$/,"").split("/").filter(Boolean);return r[r.length-1]||t}let o=/gh\s+pr\s+create\b/i,s=/#(\d+)/,c=/--title\s+["']([^"']+)["']/;e.s(["buildProjectKeyResolver",0,function(e){let t=new Map;for(let r of e)r.repoName&&t.set(l(r.projectName),r.repoName);return e=>e.repoName??t.get(l(e.projectName))??l(e.projectName)},"canonicalProjectName",0,i,"detectPrMarkers",0,function(e){let t=[],r=e.durationMs??0;for(let n of e.events){if("tool-call"!==n.role||"Bash"!==n.toolName)continue;let a=n.blocks.find(e=>e&&"type"in e&&"tool_use"===e.type);if(!a||"tool_use"!==a.type)continue;let i=a.input,l="string"==typeof i?.command?i.command:"";if(!o.test(l))continue;let u=l.match(c),d=l.match(s);t.push({sessionId:e.id,timestamp:n.timestamp??e.firstTimestamp??"",tOffsetMs:n.tOffsetMs,positionInSession:r>0&&void 0!==n.tOffsetMs?Math.min(1,Math.max(0,n.tOffsetMs/r)):void 0,command:l.slice(0,300),prNumber:d?Number(d[1]):void 0,title:u?.[1]})}return t},"projectKey",0,l])}]);
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,64659,e=>{"use strict";let t=(0,e.i(75254).default)("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);e.s(["ChevronDown",0,t],64659)},63059,e=>{"use strict";let t=(0,e.i(75254).default)("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);e.s(["ChevronRight",0,t],63059)},37727,e=>{"use strict";let t=(0,e.i(75254).default)("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);e.s(["X",0,t],37727)},36373,e=>{"use strict";var t=e.i(18050),r=e.i(71645),a=e.i(37727);let n=(0,e.i(75254).default)("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);var i=e.i(88137);function s({snapshots:e,seriesKey:a,windowMs:d,colorVar:c,predictedSeries:x,onExpand:u}){let p=(0,r.useMemo)(()=>{let t=e.map(e=>({capturedAt:new Date(e.captured_at).getTime(),window:e[a]})).filter(e=>null!==e.window&&null!==e.window.utilization);if(0===t.length)return null;let r=t[t.length-1],n=r.window.resets_at?new Date(r.window.resets_at).getTime():null;if(!n)return null;let i=n-d,s=Date.now(),l=100-(r.window.utilization??0);return{points:t.filter(e=>e.capturedAt>=i&&e.capturedAt<=n).map(e=>[e.capturedAt,100-(e.window.utilization??0)]),predicted:(x??[]).filter(e=>e.capturedAt>=i&&e.capturedAt<=n).map(e=>[e.capturedAt,100-Math.max(0,Math.min(100,e.util))]).sort((e,t)=>e[0]-t[0]),windowStart:i,windowEnd:n,now:s,currentRemaining:l,latest:r}},[e,a,d,x]),f=1190,h=148,[y,g]=(0,r.useState)(null),[v,m]=(0,r.useState)(!1);if((0,r.useEffect)(()=>m(!0),[]),!p)return(0,t.jsx)("div",{className:"af-card",style:{padding:"14px 18px",textAlign:"center",fontSize:12,color:"var(--af-text-tertiary)"},children:"No data for this window yet."});let{points:b,predicted:j,windowStart:k,windowEnd:w,now:M,currentRemaining:S,latest:$}=p,D=e=>64+(e-k)/(w-k)*f,z=e=>20+h-e/100*h,A=e=>Math.max(0,Math.min(100,100-(e-k)/(w-k)*100)),W=S-A(M),F=(0,i.paceLabel)(W),L=(0,i.toneVar)(F.tone),C=F.label,T=b.length>0?b.map(([e,t],r)=>`${0===r?"M":"L"} ${D(e).toFixed(1)} ${z(t).toFixed(1)}`).join(" "):"",N=j.length>1?j.map(([e,t],r)=>`${0===r?"M":"L"} ${D(e).toFixed(1)} ${z(t).toFixed(1)}`).join(" "):"",R=b.length>0?`${T} L ${D(b[b.length-1][0]).toFixed(1)} ${z(0).toFixed(1)} L ${D(b[0][0]).toFixed(1)} ${z(0).toFixed(1)} Z`:"";return(0,t.jsxs)("div",{className:"af-card",style:{padding:"14px 18px"},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:14,flexWrap:"wrap",marginBottom:8},children:[(0,t.jsxs)("div",{style:{fontSize:18,fontWeight:700,letterSpacing:"-0.01em",color:c,fontVariantNumeric:"tabular-nums"},children:[S.toFixed(1),"%",(0,t.jsx)("span",{style:{fontSize:11,fontWeight:500,color:"var(--af-text-tertiary)",marginLeft:4,letterSpacing:0},children:"remaining"})]}),(0,t.jsx)("div",{suppressHydrationWarning:!0,style:{fontSize:11,color:L,fontWeight:500},children:v&&(0,t.jsxs)(t.Fragment,{children:[C," (",W>=0?"+":"",W.toFixed(1),"pp)"]})}),(0,t.jsxs)("div",{suppressHydrationWarning:!0,style:{fontSize:11,color:"var(--af-text-tertiary)",marginLeft:"auto"},children:[function(e){let t=e/36e5;if(t<24)return`${t} hour${1===t?"":"s"}`;let r=t/24;return`${r} day${1===r?"":"s"}`}(d)," · resets"," ",o(new Date(w).toISOString())]}),u&&(0,t.jsx)("button",{type:"button",onClick:u,"aria-label":"Expand chart",title:"Expand",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:5,background:"transparent",border:"1px solid var(--af-border-subtle)",color:"var(--af-text-tertiary)",cursor:"pointer",marginLeft:4},children:(0,t.jsx)(n,{size:12})})]}),(0,t.jsxs)("div",{style:{position:"relative"},children:[(0,t.jsxs)("svg",{viewBox:"0 0 1280 200",style:{width:"100%",aspectRatio:"1280 / 200",display:"block"},onMouseMove:e=>{let t=e.currentTarget.getBoundingClientRect(),r=(e.clientX-t.left)/t.width*1280;if(r<64||r>1254)return void g(null);let a=k+(r-64)/f*(w-k),n=b[0],i=Math.abs(n[0]-a);for(let e of b){let t=Math.abs(e[0]-a);t<i&&(n=e,i=t)}let s=null;if(j.length>0){let e=j[0],t=Math.abs(e[0]-n[0]);for(let r of j){let a=Math.abs(r[0]-n[0]);a<t&&(e=r,t=a)}s=e[1]}g({x:D(n[0]),t:n[0],actual:n[1],ideal:A(n[0]),predicted:s})},onMouseLeave:()=>g(null),children:[[0,25,50,75,100].map(e=>{let r=z(e);return(0,t.jsxs)("g",{children:[(0,t.jsx)("line",{x1:64,x2:1254,y1:r,y2:r,stroke:"var(--af-border-subtle)",strokeWidth:"1"}),(0,t.jsxs)("text",{x:56,y:r+4,textAnchor:"end",fontSize:"13",fill:"var(--af-text-tertiary)",children:[e,"%"]})]},e)}),(0,t.jsx)("text",{x:14,y:20+h/2,textAnchor:"middle",transform:`rotate(-90, 14, ${20+h/2})`,fontSize:"12",fill:"var(--af-text-tertiary)",children:"Remaining budget (%)"}),(0,t.jsx)("text",{x:64,y:180,textAnchor:"start",fontSize:"12",fill:"var(--af-text-tertiary)",suppressHydrationWarning:!0,children:l(k)}),(0,t.jsx)("text",{x:1254,y:180,textAnchor:"end",fontSize:"12",fill:"var(--af-text-tertiary)",suppressHydrationWarning:!0,children:l(w)}),(0,t.jsx)("path",{d:R,fill:c,fillOpacity:"0.1"}),(0,t.jsx)("line",{x1:D(k),y1:z(100),x2:D(w),y2:z(0),stroke:"var(--af-text-tertiary)",strokeOpacity:"0.5",strokeWidth:"1.5",strokeDasharray:"4 3"}),v&&M>=k&&M<=w&&(0,t.jsxs)("g",{children:[(0,t.jsx)("line",{x1:D(M),y1:20,x2:D(M),y2:20+h,stroke:"var(--af-text-secondary)",strokeOpacity:"0.5",strokeWidth:"1"}),(0,t.jsx)("text",{x:D(M),y:14,textAnchor:"middle",fontSize:"12",fontWeight:"600",fill:"var(--af-text-secondary)",children:"now"})]}),(0,t.jsx)("path",{d:T,fill:"none",stroke:c,strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"}),b.map(([e,r],a)=>(0,t.jsx)("circle",{cx:D(e),cy:z(r),r:"3",fill:c},a)),N&&(0,t.jsx)("path",{d:N,fill:"none",stroke:"#ff7a00",strokeOpacity:"0.9",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",strokeDasharray:"5 4"}),y&&(0,t.jsxs)("g",{children:[(0,t.jsx)("line",{x1:y.x,y1:20,x2:y.x,y2:20+h,stroke:"var(--af-text-secondary)",strokeOpacity:"0.7",strokeWidth:"1",strokeDasharray:"2 2"}),(0,t.jsx)("circle",{cx:y.x,cy:z(y.actual),r:"5",fill:c,stroke:"var(--af-surface)",strokeWidth:"1.5"})]})]}),y&&(0,t.jsxs)("div",{style:{pointerEvents:"none",position:"absolute",left:`${y.x/1280*100}%`,top:4,transform:"translateX(-50%)",background:"var(--af-surface-elevated)",border:"1px solid var(--af-border-subtle)",borderRadius:8,padding:"8px 12px",fontSize:11,boxShadow:"0 6px 24px rgba(0, 0, 0, 0.24)",whiteSpace:"nowrap",color:"var(--af-text)"},children:[(0,t.jsx)("div",{style:{fontWeight:600},children:new Date(y.t).toLocaleString()}),(0,t.jsxs)("div",{style:{marginTop:4,display:"flex",gap:12},children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{style:{color:"var(--af-text-tertiary)"},children:"Actual"})," ",(0,t.jsxs)("span",{style:{fontWeight:600,fontVariantNumeric:"tabular-nums",color:c},children:[y.actual.toFixed(1),"%"]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{style:{color:"var(--af-text-tertiary)"},children:"Ideal"})," ",(0,t.jsxs)("span",{style:{fontWeight:600,fontVariantNumeric:"tabular-nums"},children:[y.ideal.toFixed(1),"%"]})]}),null!==y.predicted&&(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{style:{color:"var(--af-text-tertiary)"},children:"Estimated"})," ",(0,t.jsxs)("span",{style:{fontWeight:600,fontVariantNumeric:"tabular-nums",color:"#b58400"},children:[y.predicted.toFixed(1),"%"]})]})]}),(0,t.jsxs)("div",{style:{marginTop:2,color:"var(--af-text-tertiary)"},children:["Δ ",y.actual-y.ideal>=0?"+":"",(y.actual-y.ideal).toFixed(1),"%",null!==y.predicted&&(0,t.jsxs)("span",{style:{marginLeft:8},children:["· estimate ",y.predicted>=y.actual?"+":"",(y.predicted-y.actual).toFixed(1),"pp vs actual"]})]})]})]}),(0,t.jsxs)("div",{style:{marginTop:4,fontSize:9,color:"var(--af-text-tertiary)",fontFamily:"var(--font-mono)",textAlign:"right"},suppressHydrationWarning:!0,children:[b.length," snapshot",1===b.length?"":"s"," · last"," ",o(new Date($.capturedAt).toISOString()),j.length>0&&(0,t.jsxs)("span",{style:{marginLeft:8,color:"#ff7a00"},children:["· ",j.length," estimate",1===j.length?"":"s"," overlaid"]})]})]})}function l(e){return new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function o(e){let t,r=Math.round((new Date(e).getTime()-Date.now())/1e3),a=Math.abs(r);if(a<60)t=`${a}s`;else if(a<3600)t=`${Math.floor(a/60)}m`;else if(a<86400){let e=Math.floor(a/3600),r=Math.floor(a%3600/60);t=r>0?`${e}h${r}m`:`${e}h`}else{let e=Math.floor(a/86400),r=Math.floor(a%86400/3600);t=r>0?`${e}d${r}h`:`${e}d`}return r<0?`${t} ago`:`in ${t}`}function d({snapshots:e,seriesKey:a,startMs:n,endMs:i,windowMs:s,colorVar:l,predictedSeries:o}){var u,p;let f,h,y,g,v=(0,r.useMemo)(()=>{let t=[];for(let r of e){let e=new Date(r.captured_at).getTime(),n=r[a];n&&null!==n.utilization&&t.push({t:e,u:n.utilization,resetsAt:n.resets_at})}if(0===t.length)return null;let r=new Map;for(let e of t){if(!e.resetsAt)continue;let t=new Date(e.resetsAt).getTime();if(Number.isNaN(t))continue;let a=36e5*Math.round(t/36e5),n=r.get(a);n||(n=[],r.set(a,n)),n.push(e)}let l=[];for(let[e,t]of r){let r=e-s;t.sort((e,t)=>e.t-t.t);let a=t.map(e=>({t:e.t,u:e.u,remaining:100-e.u})),n=0;for(let e=1;e<a.length;e++)a[e].u>a[n].u&&(n=e);l.push({resetsAtMs:e,startMs:r,points:a,peak:a[n].u,peakT:a[n].t})}let o=l.filter(e=>e.resetsAtMs>=n&&e.startMs<=i).sort((e,t)=>e.resetsAtMs-t.resetsAtMs);if(0===o.length)return null;let d=o.flatMap(e=>e.points),c=Math.max(...d.map(e=>e.u)),x=o.filter(e=>e.resetsAtMs<=i&&e.resetsAtMs<Date.now()).length,u=o.length>0?o.reduce((e,t)=>e+t.peak,0)/o.length:0;return{cycles:o,allPoints:d,peakOverall:c,avgPeak:u,completeCycles:x}},[e,a,n,i,s]),[m,b]=(0,r.useState)(null);if(!v)return(0,t.jsx)("div",{className:"af-card",style:{padding:"40px 32px",textAlign:"center",fontSize:12,color:"var(--af-text-tertiary)"},children:"No usage data in the selected range."});let{cycles:j,allPoints:k,peakOverall:w,avgPeak:M,completeCycles:S}=v,$=1188,D=252,z=e=>60+(e-n)/(i-n)*$,A=e=>24+D-e/100*D,W=e=>n+(e-60)/$*(i-n),F=e=>{let t=z(e);return t<60?60:t>1248?1248:t};return(0,t.jsxs)("div",{className:"af-card",style:{padding:"14px 18px",display:"flex",flexDirection:"column",gap:10},children:[(0,t.jsx)("div",{suppressHydrationWarning:!0,style:{fontSize:11,color:"var(--af-text-tertiary)",fontFamily:"var(--font-mono)"},children:(u=n,p=i,h=new Date(u).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}),y=new Date(p).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}),f=(g=p-u)<36e5?`${Math.round(g/6e4)}m`:g<864e5?`${(g/36e5).toFixed(1).replace(/\.0$/,"")}h`:`${(g/864e5).toFixed(1).replace(/\.0$/,"")}d`,`${h} → ${y} (${f})`)}),(0,t.jsxs)("div",{style:{display:"flex",gap:28,fontSize:11,color:"var(--af-text-tertiary)",flexWrap:"wrap"},children:[(0,t.jsx)(c,{label:"Peak utilization",value:`${w.toFixed(1)}%`,color:l}),(0,t.jsx)(c,{label:"Avg peak / cycle",value:j.length>0?`${M.toFixed(1)}%`:"—",color:l}),(0,t.jsx)(c,{label:"Complete cycles",value:String(S),color:"var(--af-text)"}),(0,t.jsx)(c,{label:"Data points",value:String(k.length),color:"var(--af-text)"})]}),(0,t.jsxs)("div",{style:{position:"relative"},children:[(0,t.jsxs)("svg",{viewBox:"0 0 1280 320",style:{width:"100%",aspectRatio:"1280 / 320",display:"block"},onMouseMove:e=>{let t=e.currentTarget.getBoundingClientRect(),r=(e.clientX-t.left)/t.width*1280;if(r<60||r>1248)return void b(null);let a=W(r),n=k[0],i=Math.abs(n.t-a);for(let e of k){let t=Math.abs(e.t-a);t<i&&(n=e,i=t)}b({x:z(n.t),t:n.t,u:n.u,remaining:n.remaining})},onMouseLeave:()=>b(null),children:[[0,25,50,75,100].map(e=>{let r=A(e);return(0,t.jsxs)("g",{children:[(0,t.jsx)("line",{x1:60,x2:1248,y1:r,y2:r,stroke:"var(--af-border-subtle)",strokeWidth:"1"}),(0,t.jsxs)("text",{x:50,y:r+4,textAnchor:"end",fontSize:"12",fill:"var(--af-text-tertiary)",children:[e,"%"]})]},e)}),(0,t.jsx)("text",{x:16,y:24+D/2,textAnchor:"middle",transform:`rotate(-90, 16, ${24+D/2})`,fontSize:"12",fill:"var(--af-text-tertiary)",children:"Remaining budget (%)"}),(0,t.jsx)("rect",{x:60,y:A(10),width:$,height:A(0)-A(10),fill:"var(--af-danger)",fillOpacity:"0.07"}),(0,t.jsx)("rect",{x:60,y:A(30),width:$,height:A(10)-A(30),fill:"var(--af-warning)",fillOpacity:"0.05"}),j.map((e,r)=>{let a=F(e.startMs),o=F(e.resetsAtMs),d=A(100-100*(W(a)-e.startMs)/s),c=A(100-100*(W(o)-e.startMs)/s),x=e.points.filter(e=>e.t>=n&&e.t<=i),u=function(e,t,r){if(0===e.length)return"";let a=[],n=!1;for(let i=0;i<e.length;i++){let s=e[i],l=i>0?e[i-1]:null,o=!!l&&s.t-l.t>9e5,d=!n||o?"M":"L";a.push(`${d} ${t(s.t).toFixed(1)} ${r(s.remaining).toFixed(1)}`),n=!0}return a.join(" ")}(x,z,A),p=e.resetsAtMs>=n&&e.resetsAtMs<=i&&e.resetsAtMs<=Date.now();return(0,t.jsxs)("g",{children:[(0,t.jsx)("line",{x1:a,y1:d,x2:o,y2:c,stroke:"var(--af-text-tertiary)",strokeOpacity:"0.35",strokeWidth:"1",strokeDasharray:"3 3"}),u&&(0,t.jsx)("path",{d:u,fill:"none",stroke:l,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),x.map((e,a)=>(0,t.jsx)("circle",{cx:z(e.t),cy:A(e.remaining),r:"1.8",fill:l,fillOpacity:"0.9"},`${r}-${a}`)),e.peakT>=n&&e.peakT<=i&&(0,t.jsx)("circle",{cx:z(e.peakT),cy:A(100-e.peak),r:"3",fill:l,stroke:"var(--background)",strokeWidth:"1.5"}),p&&(0,t.jsx)("line",{x1:z(e.resetsAtMs),y1:24,x2:z(e.resetsAtMs),y2:24+D,stroke:"var(--af-text-tertiary)",strokeOpacity:"0.25",strokeWidth:"1",strokeDasharray:"1 3"})]},`cycle-${r}`)}),(()=>{let e=(o??[]).filter(e=>e.capturedAt>=n&&e.capturedAt<=i).sort((e,t)=>e.capturedAt-t.capturedAt);if(e.length<2)return null;let r=[],a=!1,s=e[0].util;for(let t=0;t<e.length;t++){let n=e[t],i=Math.max(0,Math.min(100,n.util)),l=100-i,o=s-i,d=t>0&&o>=50,c=t>0&&n.capturedAt-e[t-1].capturedAt>36e5,x=!a||d||c?"M":"L";r.push(`${x} ${z(n.capturedAt).toFixed(1)} ${A(l).toFixed(1)}`),a=!0,s=i}return(0,t.jsx)("path",{d:r.join(" "),fill:"none",stroke:"#ff7a00",strokeOpacity:"0.85",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",strokeDasharray:"5 4"})})(),Date.now()>=n&&Date.now()<=i&&(0,t.jsx)("line",{x1:z(Date.now()),y1:24,x2:z(Date.now()),y2:24+D,stroke:"var(--af-text-secondary)",strokeOpacity:"0.5",strokeWidth:"1"}),m&&(0,t.jsxs)("g",{children:[(0,t.jsx)("line",{x1:m.x,y1:24,x2:m.x,y2:24+D,stroke:"var(--af-text-secondary)",strokeOpacity:"0.6",strokeWidth:"1",strokeDasharray:"2 2"}),(0,t.jsx)("circle",{cx:m.x,cy:A(m.remaining),r:"5",fill:l,stroke:"var(--background)",strokeWidth:"2"})]}),(0,t.jsx)("text",{x:60,y:300,textAnchor:"start",fontSize:"11",fill:"var(--af-text-tertiary)",suppressHydrationWarning:!0,children:x(n,i-n)}),(0,t.jsx)("text",{x:1248,y:300,textAnchor:"end",fontSize:"11",fill:"var(--af-text-tertiary)",suppressHydrationWarning:!0,children:x(i,i-n)}),(0,t.jsxs)("text",{x:60+$/2,y:314,textAnchor:"middle",fontSize:"11",fill:"var(--af-text-tertiary)",children:["Time · ",j.length," cycle",1===j.length?"":"s"," in view"]})]}),m&&(0,t.jsxs)("div",{suppressHydrationWarning:!0,style:{pointerEvents:"none",position:"absolute",left:`${m.x/1280*100}%`,top:6,transform:"translateX(-50%)",background:"var(--af-surface-elevated)",border:"1px solid var(--af-border-subtle)",borderRadius:8,padding:"8px 12px",fontSize:11,boxShadow:"0 6px 24px rgba(0, 0, 0, 0.24)",whiteSpace:"nowrap",color:"var(--af-text)"},children:[(0,t.jsx)("div",{style:{fontWeight:600},children:new Date(m.t).toLocaleString()}),(0,t.jsxs)("div",{style:{marginTop:2,display:"flex",gap:10},children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{style:{color:"var(--af-text-tertiary)"},children:"Remaining"})," ",(0,t.jsxs)("span",{style:{fontWeight:600,fontVariantNumeric:"tabular-nums",color:l},children:[m.remaining.toFixed(1),"%"]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{style:{color:"var(--af-text-tertiary)"},children:"Used"})," ",(0,t.jsxs)("span",{style:{fontWeight:600,fontVariantNumeric:"tabular-nums"},children:[m.u.toFixed(1),"%"]})]})]})]})]})]})}function c({label:e,value:r,color:a}){return(0,t.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[(0,t.jsx)("span",{style:{fontSize:9,textTransform:"uppercase",letterSpacing:"0.06em",color:"var(--af-text-tertiary)",fontWeight:600},children:e}),(0,t.jsx)("span",{style:{fontSize:18,fontWeight:700,letterSpacing:"-0.01em",color:a,fontVariantNumeric:"tabular-nums"},children:r})]})}function x(e,t){let r=new Date(e);return t<=12096e5?r.toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):r.toLocaleDateString(void 0,{month:"short",day:"numeric"})}var u=e.i(64659),p=e.i(63059),f=e.i(86619);function h({storageKey:e,label:r,children:a}){let[n,i,s]=(0,f.usePersistentBoolean)(e,!1);return(0,t.jsxs)("div",{children:[(0,t.jsxs)("button",{type:"button",onClick:()=>i(!n),style:{display:"inline-flex",alignItems:"center",gap:6,padding:"6px 10px",marginBottom:12*!!n,background:"transparent",border:"1px solid var(--af-border-subtle)",borderRadius:6,fontSize:11,fontWeight:600,color:"var(--af-text-secondary)",textTransform:"uppercase",letterSpacing:"0.04em",cursor:"pointer",transition:"background 0.12s, border-color 0.12s"},children:[n?(0,t.jsx)(u.ChevronDown,{size:12}):(0,t.jsx)(p.ChevronRight,{size:12}),n?`Hide ${r}`:`Show ${r}`]}),s&&n&&a]})}let y=[{key:"current",label:"Current cycle"},{key:"24h",label:"24H"},{key:"7d",label:"7D"},{key:"30d",label:"30D"},{key:"90d",label:"90D"},{key:"custom",label:"Custom"}];function g({value:e,onChange:a,windowType:n="short"}){let i="long"===n?y.filter(e=>"24h"!==e.key):y,[s,l]=(0,r.useState)(()=>m(e.startMs??Date.now()-6048e5)),[o,d]=(0,r.useState)(()=>m(e.endMs??Date.now()));return(0,r.useEffect)(()=>{if("custom"!==e.preset)return;let t=b(s),r=b(o);Number.isNaN(t)||Number.isNaN(r)||t>=r||(t!==e.startMs||r!==e.endMs)&&a({preset:"custom",startMs:t,endMs:r})},[s,o,e.preset]),(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,flexWrap:"wrap"},children:[(0,t.jsx)("div",{style:{display:"inline-flex",borderRadius:6,border:"1px solid var(--af-border-subtle)",overflow:"hidden"},children:i.map((r,n)=>(0,t.jsx)("button",{type:"button",onClick:()=>{var e;"custom"===(e=r.key)?a({preset:e,startMs:b(s),endMs:b(o)}):a({preset:e})},style:{padding:"6px 12px",fontSize:11,fontWeight:500,background:e.preset===r.key?"var(--af-accent-subtle)":"transparent",color:e.preset===r.key?"var(--af-accent)":"var(--af-text-secondary)",border:"none",borderRight:n<i.length-1?"1px solid var(--af-border-subtle)":"none",cursor:"pointer",letterSpacing:"0.02em"},children:r.label},r.key))}),"custom"===e.preset&&(0,t.jsxs)("div",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[(0,t.jsx)("input",{type:"datetime-local",value:s,onChange:e=>l(e.target.value),style:v}),(0,t.jsx)("span",{style:{fontSize:11,color:"var(--af-text-tertiary)"},children:"→"}),(0,t.jsx)("input",{type:"datetime-local",value:o,onChange:e=>d(e.target.value),style:v})]})]})}let v={padding:"5px 8px",fontSize:11,background:"var(--background)",color:"var(--af-text)",border:"1px solid var(--af-border-subtle)",borderRadius:5,fontFamily:"var(--font-mono)"};function m(e){let t=new Date(e),r=t.getFullYear(),a=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0"),i=String(t.getHours()).padStart(2,"0"),s=String(t.getMinutes()).padStart(2,"0");return`${r}-${a}-${n}T${i}:${s}`}function b(e){return new Date(e).getTime()}let j=[{key:"seven_day",label:"7d utilization",windowMs:6048e5,colorVar:"var(--af-accent)"},{key:"five_hour",label:"5h utilization",windowMs:18e6,colorVar:"var(--af-success)"}],k={key:"seven_day_sonnet",label:"7d utilization (Sonnet)",windowMs:6048e5,colorVar:"var(--af-warning)"};function w({config:e,snapshots:n,predictedSeries:i,onClose:s}){let[l,o]=(0,r.useState)({preset:"current"}),c=(0,r.useMemo)(()=>{for(let t=n.length-1;t>=0;t--){let r=n[t][e.key];if(r&&r.resets_at){let t=new Date(r.resets_at).getTime();return{startMs:t-e.windowMs,endMs:t}}}return null},[n,e.key,e.windowMs]),x=function(e){let t=Date.now();switch(e.preset){case"current":return{};case"24h":return{startMs:t-864e5,endMs:t};case"7d":return{startMs:t-6048e5,endMs:t};case"30d":return{startMs:t-2592e6,endMs:t};case"90d":return{startMs:t-7776e6,endMs:t};case"custom":return{startMs:e.startMs,endMs:e.endMs}}}(l),u="current"===l.preset&&c?c:x;return(0,t.jsx)("div",{onClick:s,style:{position:"fixed",inset:0,background:"rgba(0, 0, 0, 0.55)",backdropFilter:"blur(4px)",zIndex:100,display:"flex",alignItems:"center",justifyContent:"center",padding:32},children:(0,t.jsxs)("div",{onClick:e=>e.stopPropagation(),style:{width:"100%",maxWidth:1600,maxHeight:"calc(100vh - 64px)",background:"var(--background)",border:"1px solid var(--af-border-subtle)",borderRadius:12,boxShadow:"0 24px 64px rgba(0, 0, 0, 0.4)",display:"flex",flexDirection:"column",overflow:"hidden"},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:16,padding:"14px 20px",borderBottom:"1px solid var(--af-border-subtle)",flexWrap:"wrap"},children:[(0,t.jsx)("div",{style:{fontSize:14,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.04em",color:"var(--af-text)"},children:e.label}),(0,t.jsx)(g,{value:l,onChange:o,windowType:e.windowMs>=864e5?"long":"short"}),(0,t.jsx)("button",{type:"button",onClick:s,"aria-label":"Close",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:28,height:28,borderRadius:6,background:"transparent",border:"1px solid var(--af-border-subtle)",color:"var(--af-text-secondary)",cursor:"pointer"},children:(0,t.jsx)(a.X,{size:14})})]}),(0,t.jsx)("div",{style:{padding:20,overflow:"auto",flex:1},children:u.startMs&&u.endMs?(0,t.jsx)(d,{snapshots:n,seriesKey:e.key,startMs:u.startMs,endMs:u.endMs,windowMs:e.windowMs,colorVar:e.colorVar,predictedSeries:i}):(0,t.jsx)("div",{className:"af-card",style:{padding:"40px 32px",textAlign:"center",fontSize:12,color:"var(--af-text-tertiary)"},children:"No data available for this window."})})]})})}function M({children:e}){return(0,t.jsx)("div",{style:{fontSize:11,fontWeight:600,color:"var(--af-text)",textTransform:"uppercase",letterSpacing:"0.04em"},children:e})}e.s(["UsageChartsDashboard",0,function({snapshots:e,predicted:a}){let[n,i]=(0,r.useState)(null),l=a??{five_hour:[],seven_day:[],seven_day_sonnet:[]};return(0,r.useEffect)(()=>{if(!n)return;let e=e=>{"Escape"===e.key&&i(null)};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[n]),(0,r.useEffect)(()=>{if(!n)return;let e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[n]),(0,t.jsxs)(t.Fragment,{children:[j.map(r=>(0,t.jsxs)("section",{style:{display:"flex",flexDirection:"column",gap:6},children:[(0,t.jsx)(M,{children:r.label}),(0,t.jsx)(s,{snapshots:e,seriesKey:r.key,windowMs:r.windowMs,colorVar:r.colorVar,predictedSeries:l[r.key],onExpand:()=>i(r)})]},r.key)),(0,t.jsx)(h,{storageKey:"cclens:usage:show-sonnet",label:"Sonnet 7d utilization",children:(0,t.jsxs)("section",{style:{display:"flex",flexDirection:"column",gap:6},children:[(0,t.jsx)(M,{children:k.label}),(0,t.jsx)(s,{snapshots:e,seriesKey:k.key,windowMs:k.windowMs,colorVar:k.colorVar,predictedSeries:l[k.key],onExpand:()=>i(k)})]})}),n&&(0,t.jsx)(w,{config:n,snapshots:e,predictedSeries:l[n.key],onClose:()=>i(null)})]})}],36373)}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,64659,e=>{"use strict";let t=(0,e.i(75254).default)("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);e.s(["ChevronDown",0,t],64659)},37727,e=>{"use strict";let t=(0,e.i(75254).default)("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);e.s(["X",0,t],37727)},63059,e=>{"use strict";let t=(0,e.i(75254).default)("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);e.s(["ChevronRight",0,t],63059)},36373,e=>{"use strict";var t=e.i(18050),r=e.i(71645),a=e.i(37727);let n=(0,e.i(75254).default)("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);var i=e.i(88137);function s({snapshots:e,seriesKey:a,windowMs:d,colorVar:c,predictedSeries:x,onExpand:u}){let p=(0,r.useMemo)(()=>{let t=e.map(e=>({capturedAt:new Date(e.captured_at).getTime(),window:e[a]})).filter(e=>null!==e.window&&null!==e.window.utilization);if(0===t.length)return null;let r=t[t.length-1],n=r.window.resets_at?new Date(r.window.resets_at).getTime():null;if(!n)return null;let i=n-d,s=Date.now(),l=100-(r.window.utilization??0);return{points:t.filter(e=>e.capturedAt>=i&&e.capturedAt<=n).map(e=>[e.capturedAt,100-(e.window.utilization??0)]),predicted:(x??[]).filter(e=>e.capturedAt>=i&&e.capturedAt<=n).map(e=>[e.capturedAt,100-Math.max(0,Math.min(100,e.util))]).sort((e,t)=>e[0]-t[0]),windowStart:i,windowEnd:n,now:s,currentRemaining:l,latest:r}},[e,a,d,x]),f=1190,h=148,[y,g]=(0,r.useState)(null),[v,m]=(0,r.useState)(!1);if((0,r.useEffect)(()=>m(!0),[]),!p)return(0,t.jsx)("div",{className:"af-card",style:{padding:"14px 18px",textAlign:"center",fontSize:12,color:"var(--af-text-tertiary)"},children:"No data for this window yet."});let{points:b,predicted:j,windowStart:k,windowEnd:w,now:M,currentRemaining:S,latest:$}=p,D=e=>64+(e-k)/(w-k)*f,z=e=>20+h-e/100*h,A=e=>Math.max(0,Math.min(100,100-(e-k)/(w-k)*100)),W=S-A(M),F=(0,i.paceLabel)(W),L=(0,i.toneVar)(F.tone),C=F.label,T=b.length>0?b.map(([e,t],r)=>`${0===r?"M":"L"} ${D(e).toFixed(1)} ${z(t).toFixed(1)}`).join(" "):"",N=j.length>1?j.map(([e,t],r)=>`${0===r?"M":"L"} ${D(e).toFixed(1)} ${z(t).toFixed(1)}`).join(" "):"",R=b.length>0?`${T} L ${D(b[b.length-1][0]).toFixed(1)} ${z(0).toFixed(1)} L ${D(b[0][0]).toFixed(1)} ${z(0).toFixed(1)} Z`:"";return(0,t.jsxs)("div",{className:"af-card",style:{padding:"14px 18px"},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:14,flexWrap:"wrap",marginBottom:8},children:[(0,t.jsxs)("div",{style:{fontSize:18,fontWeight:700,letterSpacing:"-0.01em",color:c,fontVariantNumeric:"tabular-nums"},children:[S.toFixed(1),"%",(0,t.jsx)("span",{style:{fontSize:11,fontWeight:500,color:"var(--af-text-tertiary)",marginLeft:4,letterSpacing:0},children:"remaining"})]}),(0,t.jsx)("div",{suppressHydrationWarning:!0,style:{fontSize:11,color:L,fontWeight:500},children:v&&(0,t.jsxs)(t.Fragment,{children:[C," (",W>=0?"+":"",W.toFixed(1),"pp)"]})}),(0,t.jsxs)("div",{suppressHydrationWarning:!0,style:{fontSize:11,color:"var(--af-text-tertiary)",marginLeft:"auto"},children:[function(e){let t=e/36e5;if(t<24)return`${t} hour${1===t?"":"s"}`;let r=t/24;return`${r} day${1===r?"":"s"}`}(d)," · resets"," ",o(new Date(w).toISOString())]}),u&&(0,t.jsx)("button",{type:"button",onClick:u,"aria-label":"Expand chart",title:"Expand",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:5,background:"transparent",border:"1px solid var(--af-border-subtle)",color:"var(--af-text-tertiary)",cursor:"pointer",marginLeft:4},children:(0,t.jsx)(n,{size:12})})]}),(0,t.jsxs)("div",{style:{position:"relative"},children:[(0,t.jsxs)("svg",{viewBox:"0 0 1280 200",style:{width:"100%",aspectRatio:"1280 / 200",display:"block"},onMouseMove:e=>{let t=e.currentTarget.getBoundingClientRect(),r=(e.clientX-t.left)/t.width*1280;if(r<64||r>1254)return void g(null);let a=k+(r-64)/f*(w-k),n=b[0],i=Math.abs(n[0]-a);for(let e of b){let t=Math.abs(e[0]-a);t<i&&(n=e,i=t)}let s=null;if(j.length>0){let e=j[0],t=Math.abs(e[0]-n[0]);for(let r of j){let a=Math.abs(r[0]-n[0]);a<t&&(e=r,t=a)}s=e[1]}g({x:D(n[0]),t:n[0],actual:n[1],ideal:A(n[0]),predicted:s})},onMouseLeave:()=>g(null),children:[[0,25,50,75,100].map(e=>{let r=z(e);return(0,t.jsxs)("g",{children:[(0,t.jsx)("line",{x1:64,x2:1254,y1:r,y2:r,stroke:"var(--af-border-subtle)",strokeWidth:"1"}),(0,t.jsxs)("text",{x:56,y:r+4,textAnchor:"end",fontSize:"13",fill:"var(--af-text-tertiary)",children:[e,"%"]})]},e)}),(0,t.jsx)("text",{x:14,y:20+h/2,textAnchor:"middle",transform:`rotate(-90, 14, ${20+h/2})`,fontSize:"12",fill:"var(--af-text-tertiary)",children:"Remaining budget (%)"}),(0,t.jsx)("text",{x:64,y:180,textAnchor:"start",fontSize:"12",fill:"var(--af-text-tertiary)",suppressHydrationWarning:!0,children:l(k)}),(0,t.jsx)("text",{x:1254,y:180,textAnchor:"end",fontSize:"12",fill:"var(--af-text-tertiary)",suppressHydrationWarning:!0,children:l(w)}),(0,t.jsx)("path",{d:R,fill:c,fillOpacity:"0.1"}),(0,t.jsx)("line",{x1:D(k),y1:z(100),x2:D(w),y2:z(0),stroke:"var(--af-text-tertiary)",strokeOpacity:"0.5",strokeWidth:"1.5",strokeDasharray:"4 3"}),v&&M>=k&&M<=w&&(0,t.jsxs)("g",{children:[(0,t.jsx)("line",{x1:D(M),y1:20,x2:D(M),y2:20+h,stroke:"var(--af-text-secondary)",strokeOpacity:"0.5",strokeWidth:"1"}),(0,t.jsx)("text",{x:D(M),y:14,textAnchor:"middle",fontSize:"12",fontWeight:"600",fill:"var(--af-text-secondary)",children:"now"})]}),(0,t.jsx)("path",{d:T,fill:"none",stroke:c,strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"}),b.map(([e,r],a)=>(0,t.jsx)("circle",{cx:D(e),cy:z(r),r:"3",fill:c},a)),N&&(0,t.jsx)("path",{d:N,fill:"none",stroke:"#ff7a00",strokeOpacity:"0.9",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",strokeDasharray:"5 4"}),y&&(0,t.jsxs)("g",{children:[(0,t.jsx)("line",{x1:y.x,y1:20,x2:y.x,y2:20+h,stroke:"var(--af-text-secondary)",strokeOpacity:"0.7",strokeWidth:"1",strokeDasharray:"2 2"}),(0,t.jsx)("circle",{cx:y.x,cy:z(y.actual),r:"5",fill:c,stroke:"var(--af-surface)",strokeWidth:"1.5"})]})]}),y&&(0,t.jsxs)("div",{style:{pointerEvents:"none",position:"absolute",left:`${y.x/1280*100}%`,top:4,transform:"translateX(-50%)",background:"var(--af-surface-elevated)",border:"1px solid var(--af-border-subtle)",borderRadius:8,padding:"8px 12px",fontSize:11,boxShadow:"0 6px 24px rgba(0, 0, 0, 0.24)",whiteSpace:"nowrap",color:"var(--af-text)"},children:[(0,t.jsx)("div",{style:{fontWeight:600},children:new Date(y.t).toLocaleString()}),(0,t.jsxs)("div",{style:{marginTop:4,display:"flex",gap:12},children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{style:{color:"var(--af-text-tertiary)"},children:"Actual"})," ",(0,t.jsxs)("span",{style:{fontWeight:600,fontVariantNumeric:"tabular-nums",color:c},children:[y.actual.toFixed(1),"%"]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{style:{color:"var(--af-text-tertiary)"},children:"Ideal"})," ",(0,t.jsxs)("span",{style:{fontWeight:600,fontVariantNumeric:"tabular-nums"},children:[y.ideal.toFixed(1),"%"]})]}),null!==y.predicted&&(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{style:{color:"var(--af-text-tertiary)"},children:"Estimated"})," ",(0,t.jsxs)("span",{style:{fontWeight:600,fontVariantNumeric:"tabular-nums",color:"#b58400"},children:[y.predicted.toFixed(1),"%"]})]})]}),(0,t.jsxs)("div",{style:{marginTop:2,color:"var(--af-text-tertiary)"},children:["Δ ",y.actual-y.ideal>=0?"+":"",(y.actual-y.ideal).toFixed(1),"%",null!==y.predicted&&(0,t.jsxs)("span",{style:{marginLeft:8},children:["· estimate ",y.predicted>=y.actual?"+":"",(y.predicted-y.actual).toFixed(1),"pp vs actual"]})]})]})]}),(0,t.jsxs)("div",{style:{marginTop:4,fontSize:9,color:"var(--af-text-tertiary)",fontFamily:"var(--font-mono)",textAlign:"right"},suppressHydrationWarning:!0,children:[b.length," snapshot",1===b.length?"":"s"," · last"," ",o(new Date($.capturedAt).toISOString()),j.length>0&&(0,t.jsxs)("span",{style:{marginLeft:8,color:"#ff7a00"},children:["· ",j.length," estimate",1===j.length?"":"s"," overlaid"]})]})]})}function l(e){return new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function o(e){let t,r=Math.round((new Date(e).getTime()-Date.now())/1e3),a=Math.abs(r);if(a<60)t=`${a}s`;else if(a<3600)t=`${Math.floor(a/60)}m`;else if(a<86400){let e=Math.floor(a/3600),r=Math.floor(a%3600/60);t=r>0?`${e}h${r}m`:`${e}h`}else{let e=Math.floor(a/86400),r=Math.floor(a%86400/3600);t=r>0?`${e}d${r}h`:`${e}d`}return r<0?`${t} ago`:`in ${t}`}function d({snapshots:e,seriesKey:a,startMs:n,endMs:i,windowMs:s,colorVar:l,predictedSeries:o}){var u,p;let f,h,y,g,v=(0,r.useMemo)(()=>{let t=[];for(let r of e){let e=new Date(r.captured_at).getTime(),n=r[a];n&&null!==n.utilization&&t.push({t:e,u:n.utilization,resetsAt:n.resets_at})}if(0===t.length)return null;let r=new Map;for(let e of t){if(!e.resetsAt)continue;let t=new Date(e.resetsAt).getTime();if(Number.isNaN(t))continue;let a=36e5*Math.round(t/36e5),n=r.get(a);n||(n=[],r.set(a,n)),n.push(e)}let l=[];for(let[e,t]of r){let r=e-s;t.sort((e,t)=>e.t-t.t);let a=t.map(e=>({t:e.t,u:e.u,remaining:100-e.u})),n=0;for(let e=1;e<a.length;e++)a[e].u>a[n].u&&(n=e);l.push({resetsAtMs:e,startMs:r,points:a,peak:a[n].u,peakT:a[n].t})}let o=l.filter(e=>e.resetsAtMs>=n&&e.startMs<=i).sort((e,t)=>e.resetsAtMs-t.resetsAtMs);if(0===o.length)return null;let d=o.flatMap(e=>e.points),c=Math.max(...d.map(e=>e.u)),x=o.filter(e=>e.resetsAtMs<=i&&e.resetsAtMs<Date.now()).length,u=o.length>0?o.reduce((e,t)=>e+t.peak,0)/o.length:0;return{cycles:o,allPoints:d,peakOverall:c,avgPeak:u,completeCycles:x}},[e,a,n,i,s]),[m,b]=(0,r.useState)(null);if(!v)return(0,t.jsx)("div",{className:"af-card",style:{padding:"40px 32px",textAlign:"center",fontSize:12,color:"var(--af-text-tertiary)"},children:"No usage data in the selected range."});let{cycles:j,allPoints:k,peakOverall:w,avgPeak:M,completeCycles:S}=v,$=1188,D=252,z=e=>60+(e-n)/(i-n)*$,A=e=>24+D-e/100*D,W=e=>n+(e-60)/$*(i-n),F=e=>{let t=z(e);return t<60?60:t>1248?1248:t};return(0,t.jsxs)("div",{className:"af-card",style:{padding:"14px 18px",display:"flex",flexDirection:"column",gap:10},children:[(0,t.jsx)("div",{suppressHydrationWarning:!0,style:{fontSize:11,color:"var(--af-text-tertiary)",fontFamily:"var(--font-mono)"},children:(u=n,p=i,h=new Date(u).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}),y=new Date(p).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}),f=(g=p-u)<36e5?`${Math.round(g/6e4)}m`:g<864e5?`${(g/36e5).toFixed(1).replace(/\.0$/,"")}h`:`${(g/864e5).toFixed(1).replace(/\.0$/,"")}d`,`${h} → ${y} (${f})`)}),(0,t.jsxs)("div",{style:{display:"flex",gap:28,fontSize:11,color:"var(--af-text-tertiary)",flexWrap:"wrap"},children:[(0,t.jsx)(c,{label:"Peak utilization",value:`${w.toFixed(1)}%`,color:l}),(0,t.jsx)(c,{label:"Avg peak / cycle",value:j.length>0?`${M.toFixed(1)}%`:"—",color:l}),(0,t.jsx)(c,{label:"Complete cycles",value:String(S),color:"var(--af-text)"}),(0,t.jsx)(c,{label:"Data points",value:String(k.length),color:"var(--af-text)"})]}),(0,t.jsxs)("div",{style:{position:"relative"},children:[(0,t.jsxs)("svg",{viewBox:"0 0 1280 320",style:{width:"100%",aspectRatio:"1280 / 320",display:"block"},onMouseMove:e=>{let t=e.currentTarget.getBoundingClientRect(),r=(e.clientX-t.left)/t.width*1280;if(r<60||r>1248)return void b(null);let a=W(r),n=k[0],i=Math.abs(n.t-a);for(let e of k){let t=Math.abs(e.t-a);t<i&&(n=e,i=t)}b({x:z(n.t),t:n.t,u:n.u,remaining:n.remaining})},onMouseLeave:()=>b(null),children:[[0,25,50,75,100].map(e=>{let r=A(e);return(0,t.jsxs)("g",{children:[(0,t.jsx)("line",{x1:60,x2:1248,y1:r,y2:r,stroke:"var(--af-border-subtle)",strokeWidth:"1"}),(0,t.jsxs)("text",{x:50,y:r+4,textAnchor:"end",fontSize:"12",fill:"var(--af-text-tertiary)",children:[e,"%"]})]},e)}),(0,t.jsx)("text",{x:16,y:24+D/2,textAnchor:"middle",transform:`rotate(-90, 16, ${24+D/2})`,fontSize:"12",fill:"var(--af-text-tertiary)",children:"Remaining budget (%)"}),(0,t.jsx)("rect",{x:60,y:A(10),width:$,height:A(0)-A(10),fill:"var(--af-danger)",fillOpacity:"0.07"}),(0,t.jsx)("rect",{x:60,y:A(30),width:$,height:A(10)-A(30),fill:"var(--af-warning)",fillOpacity:"0.05"}),j.map((e,r)=>{let a=F(e.startMs),o=F(e.resetsAtMs),d=A(100-100*(W(a)-e.startMs)/s),c=A(100-100*(W(o)-e.startMs)/s),x=e.points.filter(e=>e.t>=n&&e.t<=i),u=function(e,t,r){if(0===e.length)return"";let a=[],n=!1;for(let i=0;i<e.length;i++){let s=e[i],l=i>0?e[i-1]:null,o=!!l&&s.t-l.t>9e5,d=!n||o?"M":"L";a.push(`${d} ${t(s.t).toFixed(1)} ${r(s.remaining).toFixed(1)}`),n=!0}return a.join(" ")}(x,z,A),p=e.resetsAtMs>=n&&e.resetsAtMs<=i&&e.resetsAtMs<=Date.now();return(0,t.jsxs)("g",{children:[(0,t.jsx)("line",{x1:a,y1:d,x2:o,y2:c,stroke:"var(--af-text-tertiary)",strokeOpacity:"0.35",strokeWidth:"1",strokeDasharray:"3 3"}),u&&(0,t.jsx)("path",{d:u,fill:"none",stroke:l,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),x.map((e,a)=>(0,t.jsx)("circle",{cx:z(e.t),cy:A(e.remaining),r:"1.8",fill:l,fillOpacity:"0.9"},`${r}-${a}`)),e.peakT>=n&&e.peakT<=i&&(0,t.jsx)("circle",{cx:z(e.peakT),cy:A(100-e.peak),r:"3",fill:l,stroke:"var(--background)",strokeWidth:"1.5"}),p&&(0,t.jsx)("line",{x1:z(e.resetsAtMs),y1:24,x2:z(e.resetsAtMs),y2:24+D,stroke:"var(--af-text-tertiary)",strokeOpacity:"0.25",strokeWidth:"1",strokeDasharray:"1 3"})]},`cycle-${r}`)}),(()=>{let e=(o??[]).filter(e=>e.capturedAt>=n&&e.capturedAt<=i).sort((e,t)=>e.capturedAt-t.capturedAt);if(e.length<2)return null;let r=[],a=!1,s=e[0].util;for(let t=0;t<e.length;t++){let n=e[t],i=Math.max(0,Math.min(100,n.util)),l=100-i,o=s-i,d=t>0&&o>=50,c=t>0&&n.capturedAt-e[t-1].capturedAt>36e5,x=!a||d||c?"M":"L";r.push(`${x} ${z(n.capturedAt).toFixed(1)} ${A(l).toFixed(1)}`),a=!0,s=i}return(0,t.jsx)("path",{d:r.join(" "),fill:"none",stroke:"#ff7a00",strokeOpacity:"0.85",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",strokeDasharray:"5 4"})})(),Date.now()>=n&&Date.now()<=i&&(0,t.jsx)("line",{x1:z(Date.now()),y1:24,x2:z(Date.now()),y2:24+D,stroke:"var(--af-text-secondary)",strokeOpacity:"0.5",strokeWidth:"1"}),m&&(0,t.jsxs)("g",{children:[(0,t.jsx)("line",{x1:m.x,y1:24,x2:m.x,y2:24+D,stroke:"var(--af-text-secondary)",strokeOpacity:"0.6",strokeWidth:"1",strokeDasharray:"2 2"}),(0,t.jsx)("circle",{cx:m.x,cy:A(m.remaining),r:"5",fill:l,stroke:"var(--background)",strokeWidth:"2"})]}),(0,t.jsx)("text",{x:60,y:300,textAnchor:"start",fontSize:"11",fill:"var(--af-text-tertiary)",suppressHydrationWarning:!0,children:x(n,i-n)}),(0,t.jsx)("text",{x:1248,y:300,textAnchor:"end",fontSize:"11",fill:"var(--af-text-tertiary)",suppressHydrationWarning:!0,children:x(i,i-n)}),(0,t.jsxs)("text",{x:60+$/2,y:314,textAnchor:"middle",fontSize:"11",fill:"var(--af-text-tertiary)",children:["Time · ",j.length," cycle",1===j.length?"":"s"," in view"]})]}),m&&(0,t.jsxs)("div",{suppressHydrationWarning:!0,style:{pointerEvents:"none",position:"absolute",left:`${m.x/1280*100}%`,top:6,transform:"translateX(-50%)",background:"var(--af-surface-elevated)",border:"1px solid var(--af-border-subtle)",borderRadius:8,padding:"8px 12px",fontSize:11,boxShadow:"0 6px 24px rgba(0, 0, 0, 0.24)",whiteSpace:"nowrap",color:"var(--af-text)"},children:[(0,t.jsx)("div",{style:{fontWeight:600},children:new Date(m.t).toLocaleString()}),(0,t.jsxs)("div",{style:{marginTop:2,display:"flex",gap:10},children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{style:{color:"var(--af-text-tertiary)"},children:"Remaining"})," ",(0,t.jsxs)("span",{style:{fontWeight:600,fontVariantNumeric:"tabular-nums",color:l},children:[m.remaining.toFixed(1),"%"]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{style:{color:"var(--af-text-tertiary)"},children:"Used"})," ",(0,t.jsxs)("span",{style:{fontWeight:600,fontVariantNumeric:"tabular-nums"},children:[m.u.toFixed(1),"%"]})]})]})]})]})]})}function c({label:e,value:r,color:a}){return(0,t.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[(0,t.jsx)("span",{style:{fontSize:9,textTransform:"uppercase",letterSpacing:"0.06em",color:"var(--af-text-tertiary)",fontWeight:600},children:e}),(0,t.jsx)("span",{style:{fontSize:18,fontWeight:700,letterSpacing:"-0.01em",color:a,fontVariantNumeric:"tabular-nums"},children:r})]})}function x(e,t){let r=new Date(e);return t<=12096e5?r.toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):r.toLocaleDateString(void 0,{month:"short",day:"numeric"})}var u=e.i(64659),p=e.i(63059),f=e.i(86619);function h({storageKey:e,label:r,children:a}){let[n,i,s]=(0,f.usePersistentBoolean)(e,!1);return(0,t.jsxs)("div",{children:[(0,t.jsxs)("button",{type:"button",onClick:()=>i(!n),style:{display:"inline-flex",alignItems:"center",gap:6,padding:"6px 10px",marginBottom:12*!!n,background:"transparent",border:"1px solid var(--af-border-subtle)",borderRadius:6,fontSize:11,fontWeight:600,color:"var(--af-text-secondary)",textTransform:"uppercase",letterSpacing:"0.04em",cursor:"pointer",transition:"background 0.12s, border-color 0.12s"},children:[n?(0,t.jsx)(u.ChevronDown,{size:12}):(0,t.jsx)(p.ChevronRight,{size:12}),n?`Hide ${r}`:`Show ${r}`]}),s&&n&&a]})}let y=[{key:"current",label:"Current cycle"},{key:"24h",label:"24H"},{key:"7d",label:"7D"},{key:"30d",label:"30D"},{key:"90d",label:"90D"},{key:"custom",label:"Custom"}];function g({value:e,onChange:a,windowType:n="short"}){let i="long"===n?y.filter(e=>"24h"!==e.key):y,[s,l]=(0,r.useState)(()=>m(e.startMs??Date.now()-6048e5)),[o,d]=(0,r.useState)(()=>m(e.endMs??Date.now()));return(0,r.useEffect)(()=>{if("custom"!==e.preset)return;let t=b(s),r=b(o);Number.isNaN(t)||Number.isNaN(r)||t>=r||(t!==e.startMs||r!==e.endMs)&&a({preset:"custom",startMs:t,endMs:r})},[s,o,e.preset]),(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,flexWrap:"wrap"},children:[(0,t.jsx)("div",{style:{display:"inline-flex",borderRadius:6,border:"1px solid var(--af-border-subtle)",overflow:"hidden"},children:i.map((r,n)=>(0,t.jsx)("button",{type:"button",onClick:()=>{var e;"custom"===(e=r.key)?a({preset:e,startMs:b(s),endMs:b(o)}):a({preset:e})},style:{padding:"6px 12px",fontSize:11,fontWeight:500,background:e.preset===r.key?"var(--af-accent-subtle)":"transparent",color:e.preset===r.key?"var(--af-accent)":"var(--af-text-secondary)",border:"none",borderRight:n<i.length-1?"1px solid var(--af-border-subtle)":"none",cursor:"pointer",letterSpacing:"0.02em"},children:r.label},r.key))}),"custom"===e.preset&&(0,t.jsxs)("div",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[(0,t.jsx)("input",{type:"datetime-local",value:s,onChange:e=>l(e.target.value),style:v}),(0,t.jsx)("span",{style:{fontSize:11,color:"var(--af-text-tertiary)"},children:"→"}),(0,t.jsx)("input",{type:"datetime-local",value:o,onChange:e=>d(e.target.value),style:v})]})]})}let v={padding:"5px 8px",fontSize:11,background:"var(--background)",color:"var(--af-text)",border:"1px solid var(--af-border-subtle)",borderRadius:5,fontFamily:"var(--font-mono)"};function m(e){let t=new Date(e),r=t.getFullYear(),a=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0"),i=String(t.getHours()).padStart(2,"0"),s=String(t.getMinutes()).padStart(2,"0");return`${r}-${a}-${n}T${i}:${s}`}function b(e){return new Date(e).getTime()}let j=[{key:"seven_day",label:"7d utilization",windowMs:6048e5,colorVar:"var(--af-accent)"},{key:"five_hour",label:"5h utilization",windowMs:18e6,colorVar:"var(--af-success)"}],k={key:"seven_day_sonnet",label:"7d utilization (Sonnet)",windowMs:6048e5,colorVar:"var(--af-warning)"};function w({config:e,snapshots:n,predictedSeries:i,onClose:s}){let[l,o]=(0,r.useState)({preset:"current"}),c=(0,r.useMemo)(()=>{for(let t=n.length-1;t>=0;t--){let r=n[t][e.key];if(r&&r.resets_at){let t=new Date(r.resets_at).getTime();return{startMs:t-e.windowMs,endMs:t}}}return null},[n,e.key,e.windowMs]),x=function(e){let t=Date.now();switch(e.preset){case"current":return{};case"24h":return{startMs:t-864e5,endMs:t};case"7d":return{startMs:t-6048e5,endMs:t};case"30d":return{startMs:t-2592e6,endMs:t};case"90d":return{startMs:t-7776e6,endMs:t};case"custom":return{startMs:e.startMs,endMs:e.endMs}}}(l),u="current"===l.preset&&c?c:x;return(0,t.jsx)("div",{onClick:s,style:{position:"fixed",inset:0,background:"rgba(0, 0, 0, 0.55)",backdropFilter:"blur(4px)",zIndex:100,display:"flex",alignItems:"center",justifyContent:"center",padding:32},children:(0,t.jsxs)("div",{onClick:e=>e.stopPropagation(),style:{width:"100%",maxWidth:1600,maxHeight:"calc(100vh - 64px)",background:"var(--background)",border:"1px solid var(--af-border-subtle)",borderRadius:12,boxShadow:"0 24px 64px rgba(0, 0, 0, 0.4)",display:"flex",flexDirection:"column",overflow:"hidden"},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:16,padding:"14px 20px",borderBottom:"1px solid var(--af-border-subtle)",flexWrap:"wrap"},children:[(0,t.jsx)("div",{style:{fontSize:14,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.04em",color:"var(--af-text)"},children:e.label}),(0,t.jsx)(g,{value:l,onChange:o,windowType:e.windowMs>=864e5?"long":"short"}),(0,t.jsx)("button",{type:"button",onClick:s,"aria-label":"Close",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:28,height:28,borderRadius:6,background:"transparent",border:"1px solid var(--af-border-subtle)",color:"var(--af-text-secondary)",cursor:"pointer"},children:(0,t.jsx)(a.X,{size:14})})]}),(0,t.jsx)("div",{style:{padding:20,overflow:"auto",flex:1},children:u.startMs&&u.endMs?(0,t.jsx)(d,{snapshots:n,seriesKey:e.key,startMs:u.startMs,endMs:u.endMs,windowMs:e.windowMs,colorVar:e.colorVar,predictedSeries:i}):(0,t.jsx)("div",{className:"af-card",style:{padding:"40px 32px",textAlign:"center",fontSize:12,color:"var(--af-text-tertiary)"},children:"No data available for this window."})})]})})}function M({children:e}){return(0,t.jsx)("div",{style:{fontSize:11,fontWeight:600,color:"var(--af-text)",textTransform:"uppercase",letterSpacing:"0.04em"},children:e})}e.s(["UsageChartsDashboard",0,function({snapshots:e,predicted:a}){let[n,i]=(0,r.useState)(null),l=a??{five_hour:[],seven_day:[],seven_day_sonnet:[]};return(0,r.useEffect)(()=>{if(!n)return;let e=e=>{"Escape"===e.key&&i(null)};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[n]),(0,r.useEffect)(()=>{if(!n)return;let e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[n]),(0,t.jsxs)(t.Fragment,{children:[j.map(r=>(0,t.jsxs)("section",{style:{display:"flex",flexDirection:"column",gap:6},children:[(0,t.jsx)(M,{children:r.label}),(0,t.jsx)(s,{snapshots:e,seriesKey:r.key,windowMs:r.windowMs,colorVar:r.colorVar,predictedSeries:l[r.key],onExpand:()=>i(r)})]},r.key)),(0,t.jsx)(h,{storageKey:"cclens:usage:show-sonnet",label:"Sonnet 7d utilization",children:(0,t.jsxs)("section",{style:{display:"flex",flexDirection:"column",gap:6},children:[(0,t.jsx)(M,{children:k.label}),(0,t.jsx)(s,{snapshots:e,seriesKey:k.key,windowMs:k.windowMs,colorVar:k.colorVar,predictedSeries:l[k.key],onExpand:()=>i(k)})]})}),n&&(0,t.jsx)(w,{config:n,snapshots:e,predictedSeries:l[n.key],onClose:()=>i(null)})]})}],36373)}]);
@@ -0,0 +1,6 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,52535,e=>{"use strict";var t=e.i(18050),s=e.i(71645);e.s(["LiveBadge",0,function({mtimeIso:e,activityMs:r,size:a="sm"}){let[i,o]=(0,s.useState)(()=>Date.now());(0,s.useEffect)(()=>{let e=setInterval(()=>o(Date.now()),1e4);return()=>clearInterval(e)},[]);let n=e?Date.parse(e):NaN,l=Math.max(Number.isNaN(n)?0:n,r&&Number.isFinite(r)?r:0);if(l<=0||i-l>45e3)return null;let d="md"===a?8:6;return(0,t.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:5,fontSize:"md"===a?10:9,fontWeight:700,letterSpacing:"0.04em",padding:"md"===a?"3px 9px":"2px 7px",borderRadius:100,background:"rgba(239, 68, 68, 0.12)",color:"#ef4444",textTransform:"uppercase"},title:`Last updated ${new Date(l).toLocaleTimeString()}`,children:[(0,t.jsx)("span",{style:{display:"inline-block",width:d,height:d,borderRadius:"50%",background:"#ef4444",animation:"cs-live-pulse 1.6s ease-in-out infinite"}}),"LIVE",(0,t.jsx)("style",{children:`
2
+ @keyframes cs-live-pulse {
3
+ 0%, 100% { opacity: 1; transform: scale(1); }
4
+ 50% { opacity: 0.4; transform: scale(0.85); }
5
+ }
6
+ `})]})}])},55898,78360,e=>{"use strict";var t=e.i(18050),s=e.i(71645),r=e.i(75254);let a=(0,r.default)("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);var i=e.i(25063);let o=(0,r.default)("ArrowUpDown",[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]);e.s(["DataTable",0,function({rows:e,columns:r,getRowKey:n,onRowClick:l,defaultSortKey:d,defaultSortDir:c="desc"}){let[u,p]=(0,s.useState)(d??null),[f,h]=(0,s.useState)(c),m=(0,s.useMemo)(()=>{if(!u)return e;let t=r.find(e=>e.key===u);if(!t||!t.sortValue)return e;let s="asc"===f?1:-1;return[...e].sort((e,r)=>{let a=t.sortValue(e),i=t.sortValue(r);return"number"==typeof a&&"number"==typeof i?(a-i)*s:String(a).localeCompare(String(i))*s})},[e,r,u,f]);return(0,t.jsx)("div",{style:{overflowX:"auto",border:"1px solid var(--af-border-subtle)",borderRadius:8,background:"var(--af-surface)"},children:(0,t.jsxs)("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:12,color:"var(--af-text)"},children:[(0,t.jsx)("thead",{children:(0,t.jsx)("tr",{children:r.map(e=>{let s=u===e.key,r=!1!==e.sortable&&!!e.sortValue;return(0,t.jsx)("th",{onClick:()=>{!1!==e.sortable&&e.sortValue&&(u===e.key?h(e=>"asc"===e?"desc":"asc"):(p(e.key),h("desc")))},style:{textAlign:e.align??"left",fontSize:10,fontWeight:600,color:s?"var(--af-accent)":"var(--af-text-tertiary)",textTransform:"uppercase",letterSpacing:"0.05em",padding:"10px 12px",borderBottom:"1px solid var(--af-border-subtle)",cursor:r?"pointer":"default",userSelect:"none",whiteSpace:"nowrap",width:e.width,background:"var(--af-surface)",position:"sticky",top:0},children:(0,t.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:4,verticalAlign:"middle"},children:[e.header,r&&(0,t.jsx)("span",{style:{display:"inline-flex",opacity:s?1:.35},children:s?"asc"===f?(0,t.jsx)(a,{size:10}):(0,t.jsx)(i.ArrowDown,{size:10}):(0,t.jsx)(o,{size:10})})]})},e.key)})})}),(0,t.jsxs)("tbody",{children:[m.map(e=>(0,t.jsx)("tr",{onClick:()=>l?.(e),style:{cursor:l?"pointer":"default",borderBottom:"1px solid var(--af-border-subtle)",transition:"background 0.1s"},onMouseEnter:e=>{e.currentTarget.style.background="var(--af-surface-hover)"},onMouseLeave:e=>{e.currentTarget.style.background=""},children:r.map(s=>(0,t.jsx)("td",{style:{padding:"10px 12px",textAlign:s.align??"left",whiteSpace:"right"===s.align?"nowrap":void 0,verticalAlign:"top"},children:s.render(e)},s.key))},n(e))),0===m.length&&(0,t.jsx)("tr",{children:(0,t.jsx)("td",{colSpan:r.length,style:{padding:"32px 16px",textAlign:"center",fontSize:12,color:"var(--af-text-tertiary)"},children:"No rows to display."})})]})]})})}],55898);let n=(0,r.default)("LayoutGrid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]),l=(0,r.default)("Table",[["path",{d:"M12 3v18",key:"108xh3"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}]]);var d=e.i(86619);function c({active:e,onClick:s,label:r,icon:a,rightEdge:i}){return(0,t.jsxs)("button",{type:"button",onClick:s,style:{display:"inline-flex",alignItems:"center",gap:5,padding:"6px 12px",fontSize:11,fontWeight:500,background:e?"var(--af-accent-subtle)":"transparent",color:e?"var(--af-accent)":"var(--af-text-secondary)",border:"none",borderRight:i?"none":"1px solid var(--af-border-subtle)",cursor:"pointer",letterSpacing:"0.02em"},children:[a,r]})}e.s(["useViewToggle",0,function(e,s="cards"){let[r,a,i]=(0,d.usePersistentBoolean)(e,"table"===s);return{mode:r?"table":"cards",toggle:(0,t.jsxs)("div",{style:{display:"inline-flex",border:"1px solid var(--af-border-subtle)",borderRadius:6,overflow:"hidden"},children:[(0,t.jsx)(c,{active:!r,onClick:()=>a(!1),label:"Cards",icon:(0,t.jsx)(n,{size:12})}),(0,t.jsx)(c,{active:r,onClick:()=>a(!0),label:"Table",icon:(0,t.jsx)(l,{size:12}),rightEdge:!0})]}),hydrated:i}}],78360)},64659,e=>{"use strict";let t=(0,e.i(75254).default)("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);e.s(["ChevronDown",0,t],64659)},98572,e=>{"use strict";let t=["/.claude/worktrees/","/.worktrees/","/claude/worktrees/"],s=/\/conductor\/workspaces\/[^/]+\/([^/]+)(?:\/|$)/,r="/.superset/worktrees/",a=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function i(e){let i=e.replace(/\/{2,}/g,"/"),o=function(e){for(let s of t){let t=e.lastIndexOf(s);if(t>=0)return{idx:t,marker:s}}return null}(i);if(o)return i.slice(0,o.idx);let n=function(e){let t=s.exec(e);if(!t)return null;let r=t[1],a=+!!t[0].endsWith("/");return{canonicalEndIdx:t.index+t[0].length-r.length-1-a,workspaceName:r}}(i);if(n)return i.slice(0,n.canonicalEndIdx);let l=function(e){let t=e.indexOf(r);if(t<0)return null;let s=e.slice(t+r.length).split("/").filter(Boolean);if(0===s.length)return null;let i=a.test(s[0])?s[1]??s[0]:s[0];return{canonical:e.slice(0,t)+r+i,workspaceName:i}}(i);return l?l.canonical:i}function o(e){let t=i(e),s=t.replace(/\/+$/,"").split("/").filter(Boolean);return s[s.length-1]||t}let n=/gh\s+pr\s+create\b/i,l=/#(\d+)/,d=/--title\s+["']([^"']+)["']/;e.s(["buildProjectKeyResolver",0,function(e){let t=new Map;for(let s of e)s.repoName&&t.set(o(s.projectName),s.repoName);return e=>e.repoName??t.get(o(e.projectName))??o(e.projectName)},"canonicalProjectName",0,i,"detectPrMarkers",0,function(e){let t=[],s=e.durationMs??0;for(let r of e.events){if("tool-call"!==r.role||"Bash"!==r.toolName)continue;let a=r.blocks.find(e=>e&&"type"in e&&"tool_use"===e.type);if(!a||"tool_use"!==a.type)continue;let i=a.input,o="string"==typeof i?.command?i.command:"";if(!n.test(o))continue;let c=o.match(d),u=o.match(l);t.push({sessionId:e.id,timestamp:r.timestamp??e.firstTimestamp??"",tOffsetMs:r.tOffsetMs,positionInSession:s>0&&void 0!==r.tOffsetMs?Math.min(1,Math.max(0,r.tOffsetMs/s)):void 0,command:o.slice(0,300),prNumber:u?Number(u[1]):void 0,title:c?.[1]})}return t},"projectKey",0,o])},25063,e=>{"use strict";let t=(0,e.i(75254).default)("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);e.s(["ArrowDown",0,t],25063)},95116,e=>{"use strict";let t=(0,e.i(75254).default)("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);e.s(["Wrench",0,t],95116)},40524,e=>{"use strict";let t=(0,e.i(75254).default)("Workflow",[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]]);e.s(["Workflow",0,t],40524)},86333,e=>{"use strict";var t=e.i(18050),s=e.i(22016),r=e.i(71645),a=e.i(18566);e.i(74472);var i=e.i(98572),o=e.i(33815),n=e.i(56324),l=e.i(55436),d=e.i(95116);let c=(0,e.i(75254).default)("MessagesSquare",[["path",{d:"M14 9a2 2 0 0 1-2 2H6l-4 4V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2z",key:"p1xzt8"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v11l-4-4h-6a2 2 0 0 1-2-2v-1",key:"1cx29u"}]]);var u=e.i(3116),p=e.i(40524),f=e.i(52535),h=e.i(56004),m=e.i(69198),x=e.i(55898),g=e.i(78360),y=e.i(64659);function v({value:e,onChange:s,options:a,placeholder:i="Select…",searchPlaceholder:o="Type to filter…",maxWidth:n=260,title:d}){let[c,u]=(0,r.useState)(!1),[p,f]=(0,r.useState)(""),[h,m]=(0,r.useState)(0),x=(0,r.useRef)(null),g=(0,r.useRef)(null),j=(0,r.useRef)(null),w=(0,r.useId)(),b=`${w}-listbox`,k=e=>`${w}-opt-${e}`,S=a.find(t=>t.value===e),C=(0,r.useMemo)(()=>{let e=p.trim().toLowerCase();return e?a.filter(t=>t.label.toLowerCase().includes(e)):a},[p,a]);(0,r.useEffect)(()=>{if(!c)return;f(""),m(Math.max(0,a.findIndex(t=>t.value===e)));let t=requestAnimationFrame(()=>g.current?.focus());return()=>cancelAnimationFrame(t)},[c]),(0,r.useEffect)(()=>{let e=j.current?.children[h];e?.scrollIntoView({block:"nearest"})},[h]);let M=()=>{u(!1),x.current?.focus()},T=e=>{s(e),M()},z=C[h]?k(h):void 0;return(0,t.jsxs)("div",{style:{position:"relative",maxWidth:n},children:[(0,t.jsxs)("button",{ref:x,type:"button",onClick:()=>u(e=>!e),title:d,"aria-haspopup":"listbox","aria-expanded":c,style:{display:"flex",alignItems:"center",gap:6,width:"100%",background:"var(--background)",border:`1px solid ${c?"var(--af-accent)":"var(--af-border-subtle)"}`,borderRadius:8,padding:"9px 12px",color:"var(--af-text)",fontSize:13,cursor:"pointer",textAlign:"left"},children:[(0,t.jsx)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:S?"var(--af-text)":"var(--af-text-tertiary)"},children:S?.label??i}),(0,t.jsx)(y.ChevronDown,{size:13,style:{marginLeft:"auto",flexShrink:0,color:"var(--af-text-tertiary)"}})]}),c&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{onClick:()=>u(!1),style:{position:"fixed",inset:0,zIndex:40}}),(0,t.jsxs)("div",{style:{position:"absolute",top:"calc(100% + 4px)",left:0,minWidth:"100%",width:"max-content",maxWidth:380,zIndex:41,background:"var(--af-surface)",border:"1px solid var(--af-border-subtle)",borderRadius:8,boxShadow:"0 8px 24px rgba(0,0,0,0.28)",overflow:"hidden"},children:[(0,t.jsxs)("div",{style:{position:"relative",padding:6,borderBottom:"1px solid var(--af-border-subtle)"},children:[(0,t.jsx)(l.Search,{size:12,style:{position:"absolute",left:15,top:"50%",transform:"translateY(-50%)",color:"var(--af-text-tertiary)"}}),(0,t.jsx)("input",{ref:g,type:"text",role:"combobox","aria-expanded":c,"aria-controls":b,"aria-activedescendant":z,"aria-autocomplete":"list",value:p,onChange:e=>{f(e.target.value),m(0)},placeholder:o,onKeyDown:e=>{if("ArrowDown"===e.key)e.preventDefault(),m(e=>Math.min(e+1,Math.max(0,C.length-1)));else if("ArrowUp"===e.key)e.preventDefault(),m(e=>Math.max(e-1,0));else if("Enter"===e.key){e.preventDefault();let t=C[h];t&&T(t.value)}else"Escape"===e.key?(e.preventDefault(),M()):"Tab"===e.key&&u(!1)},style:{width:"100%",paddingLeft:30,fontSize:12}})]}),(0,t.jsx)("div",{ref:j,role:"listbox",id:b,style:{maxHeight:300,overflowY:"auto",padding:4},children:0===C.length?(0,t.jsx)("div",{style:{padding:"8px 10px",fontSize:12,color:"var(--af-text-tertiary)"},children:"No matches"}):C.map((s,r)=>(0,t.jsx)("button",{id:k(r),type:"button",role:"option","aria-selected":s.value===e,onClick:()=>T(s.value),onMouseEnter:()=>m(r),style:{display:"block",width:"100%",textAlign:"left",padding:"6px 10px",fontSize:12,border:"none",borderRadius:4,cursor:"pointer",background:r===h?"var(--af-surface-hover)":"transparent",color:s.value===e?"var(--af-accent)":"var(--af-text)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:s.label},s.value))})]})]})]})}var j=e.i(23614);let w=["newest","longest","most-tokens","outcome"];function b(e){return e.totalUsage.input+e.totalUsage.output+e.totalUsage.cacheRead+e.totalUsage.cacheWrite}let k=[{key:"outcome",header:"Outcome",sortValue:e=>(0,j.outcomePriority)(e.outcome),render:e=>(0,t.jsx)(S,{row:e})},{key:"project",header:"Project",sortValue:e=>e.projectKey,render:e=>(0,t.jsxs)("div",{style:{maxWidth:180,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:`${e.projectKey} (${e.session.projectName})`,children:[(0,t.jsxs)("div",{style:{fontWeight:500,display:"flex",alignItems:"center",gap:6},children:[(0,t.jsx)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0},children:(0,n.prettyProjectName)(e.projectKey)}),(0,t.jsx)(h.TeamBadge,{session:e.session}),(0,t.jsx)(m.AgentBadge,{agent:e.session.agent})]}),(0,t.jsx)("div",{style:{fontSize:10,color:"var(--af-text-tertiary)",fontFamily:"var(--font-mono)"},children:(0,n.shortId)(e.session.id)})]})},{key:"preview",header:"Summary",sortable:!1,render:e=>{let s=e.briefSummary??e.session.firstUserPreview??"",r=!e.briefSummary;return(0,t.jsx)("div",{style:{maxWidth:360,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:r?"var(--af-text-tertiary)":"var(--af-text-secondary)",fontStyle:r?"italic":"normal"},title:r?`(raw user message) ${s}`:s,children:s||"—"})}},{key:"created",header:"Created",sortValue:e=>e.session.firstTimestamp?Date.parse(e.session.firstTimestamp):0,align:"right",render:e=>(0,t.jsx)("span",{suppressHydrationWarning:!0,style:{fontFamily:"var(--font-mono)",fontSize:11},children:e.session.firstTimestamp?(0,n.formatRelative)(e.session.firstTimestamp):"—"})},{key:"lastActive",header:"Last active",sortValue:e=>e.session.lastTimestamp?Date.parse(e.session.lastTimestamp):0,align:"right",render:e=>(0,t.jsx)("span",{suppressHydrationWarning:!0,style:{fontFamily:"var(--font-mono)",fontSize:11},children:e.session.lastTimestamp?(0,n.formatRelative)(e.session.lastTimestamp):"—"})},{key:"airtime",header:"Agent time",sortValue:e=>e.session.airTimeMs??e.session.durationMs??0,align:"right",render:e=>(0,t.jsx)("span",{style:{fontFamily:"var(--font-mono)",fontSize:11},children:(0,n.formatDuration)(e.session.airTimeMs??e.session.durationMs??0)})},{key:"turns",header:"Turns",sortValue:e=>e.session.turnCount??0,align:"right",render:e=>(0,t.jsx)("span",{style:{fontFamily:"var(--font-mono)",fontSize:11},children:(e.session.turnCount??0).toLocaleString()})},{key:"tools",header:"Tool calls",sortValue:e=>e.session.toolCallCount??0,align:"right",render:e=>(0,t.jsx)("span",{style:{fontFamily:"var(--font-mono)",fontSize:11},children:(e.session.toolCallCount??0).toLocaleString()})},{key:"tokens",header:"Tokens",sortValue:e=>e.session.totalUsage.input+e.session.totalUsage.output+e.session.totalUsage.cacheRead+e.session.totalUsage.cacheWrite,align:"right",render:e=>(0,t.jsx)("span",{style:{fontFamily:"var(--font-mono)",fontSize:11},children:(0,n.formatTokens)(e.session.totalUsage.input+e.session.totalUsage.output+e.session.totalUsage.cacheRead+e.session.totalUsage.cacheWrite)})},{key:"status",header:"Status",sortValue:e=>+("running"===e.session.status),align:"center",render:e=>"running"===e.session.status?(0,t.jsx)(f.LiveBadge,{}):(0,t.jsx)("span",{style:{opacity:.4},children:"—"})}];function S({row:e}){return e.outcome?(0,t.jsx)(j.OutcomePill,{outcome:e.outcome,size:"sm",label:"text",agent:e.session.agent}):e.enrichmentStatus&&e.latestLocalDay&&"skipped_trivial"!==e.enrichmentStatus?(0,t.jsx)(j.OutcomePill,{outcome:null,pending:!0,sessionId:e.session.id,localDay:e.latestLocalDay,size:"sm",agent:e.session.agent}):(0,t.jsx)("span",{style:{color:"var(--af-text-tertiary)",fontSize:10},children:"—"})}function C({row:e}){let r=(0,a.useRouter)(),{session:i,briefSummary:o,outcome:l,latestLocalDay:x,enrichmentStatus:g}=e,y=i.totalUsage.input+i.totalUsage.output+i.totalUsage.cacheRead+i.totalUsage.cacheWrite,v=!l&&g&&"skipped_trivial"!==g&&x,w=o??i.firstUserPreview??"",b=!o;return(0,t.jsxs)(s.default,{href:`/sessions/${i.id}`,className:"af-card",style:{display:"flex",flexDirection:"column",gap:10,padding:"14px 16px"},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8},children:[(0,t.jsxs)("div",{style:{fontSize:11,color:"var(--af-text-tertiary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"flex",alignItems:"center",gap:6,minWidth:0},title:`${e.projectKey} (${i.projectName})`,children:[(0,t.jsx)(f.LiveBadge,{mtimeIso:i.lastTimestamp,activityMs:i.lastActivityMs}),(0,t.jsx)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:(0,n.prettyProjectName)(e.projectKey)}),(0,t.jsx)(h.TeamBadge,{session:i,linkable:!1}),(0,t.jsx)(m.AgentBadge,{agent:i.agent})]}),(0,t.jsx)("div",{style:{fontSize:10,color:"var(--af-text-tertiary)",fontFamily:"var(--font-mono)",flexShrink:0},suppressHydrationWarning:!0,children:i.firstTimestamp?(0,n.formatRelative)(i.firstTimestamp):"—"})]}),(l||v)&&(0,t.jsx)("div",{onClick:e=>e.stopPropagation(),children:l?(0,t.jsx)(j.OutcomePill,{outcome:l,size:"md",agent:i.agent}):v?(0,t.jsx)("span",{role:"link",tabIndex:0,title:`Generate ${x} digest →`,onClick:e=>{e.preventDefault(),e.stopPropagation(),r.push(`/digest/${x}`)},onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),e.stopPropagation(),r.push(`/digest/${x}`))},style:{cursor:"pointer",display:"inline-flex"},children:(0,t.jsx)(j.OutcomePill,{outcome:null,pending:!0,sessionId:i.id,localDay:x,size:"md",agent:i.agent,noLink:!0})}):null}),(0,t.jsx)("div",{style:{fontSize:13,color:b?"var(--af-text-secondary)":"var(--af-text)",fontStyle:b?"italic":"normal",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:2,overflow:"hidden",minHeight:36,lineHeight:1.4},title:b?`(raw user message) ${w}`:w,children:w||(0,t.jsx)("em",{style:{color:"var(--af-text-tertiary)"},children:"(no user message)"})}),b&&(0,t.jsx)("div",{style:{fontSize:11.5,color:"var(--af-text-secondary)",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:2,overflow:"hidden",lineHeight:1.4,paddingLeft:10,borderLeft:"2px solid var(--af-accent-subtle)"},title:i.lastAgentPreview,children:i.lastAgentPreview||(0,t.jsx)("em",{style:{color:"var(--af-text-tertiary)"},children:"—"})}),(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:14,fontSize:10.5,color:"var(--af-text-tertiary)",paddingTop:8,borderTop:"1px solid var(--af-border-subtle)",fontFamily:"var(--font-mono)"},children:[(0,t.jsx)(M,{icon:(0,t.jsx)(c,{size:11}),label:`${i.turnCount??0} turn${1===i.turnCount?"":"s"}`}),(0,t.jsx)(M,{icon:(0,t.jsx)(d.Wrench,{size:11}),label:`${i.toolCallCount??0} tools`}),(i.spawnedAgentCount??0)>0&&(0,t.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:4,color:"#EA580C",fontWeight:600},title:`${i.workflowCount} workflow${1===i.workflowCount?"":"s"} spawned ${i.spawnedAgentCount} agents`,children:[(0,t.jsx)(p.Workflow,{size:11}),i.spawnedAgentCount," agents"]}),(0,t.jsx)(M,{icon:(0,t.jsx)(u.Clock,{size:11}),label:(0,n.formatDuration)(i.airTimeMs??i.durationMs)}),(0,t.jsx)("span",{style:{marginLeft:"auto"},children:(0,n.formatTokens)(y)})]})]})}function M({icon:e,label:s}){return(0,t.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:4},children:[e,s]})}e.s(["SessionsGrid",0,function({rows:e}){var s;let d=(0,a.useRouter)(),c=(0,a.usePathname)(),u=(0,a.useSearchParams)(),p=u.get("q")??"",f=(0,r.useMemo)(()=>(0,i.buildProjectKeyResolver)(e.map(e=>e.session)),[e]),h=(0,r.useMemo)(()=>e.map(e=>({...e,projectKey:f(e.session)})),[e,f]),m=(0,r.useMemo)(()=>{let t=u.get("project")??"all";if("all"===t||!t.startsWith("/"))return t;let s=e.find(e=>e.session.projectName===t);return s?f(s.session):(0,i.projectKey)(t)},[u,e,f]),y=u.get("agent"),S=(0,o.isAgentKind)(y)?y:"all",M=null!=(s=u.get("sort"))&&w.includes(s)?u.get("sort"):"newest",{mode:T,toggle:z}=(0,g.useViewToggle)("cclens:sessions:view"),A=(0,r.useCallback)((e,t,s)=>{let r=new URLSearchParams(u.toString());t&&t!==s?r.set(e,t):r.delete(e);let a=r.toString();d.replace(a?`${c}?${a}`:c,{scroll:!1})},[c,d,u]),D=(0,r.useMemo)(()=>{let e=new Map;for(let t of h){let s=e.get(t.projectKey)??{tokens:0,sessions:0};s.tokens+=b(t.session),s.sessions+=1,e.set(t.projectKey,s)}return["all",...Array.from(e.entries()).sort(([e,t],[s,r])=>r.tokens!==t.tokens?r.tokens-t.tokens:r.sessions!==t.sessions?r.sessions-t.sessions:e.localeCompare(s)).map(([e])=>e)]},[h]),L=(0,r.useMemo)(()=>{let t=new Map;for(let s of e){let e=s.session.agent??"claude-code";t.set(e,(t.get(e)??0)+1)}return Array.from(t.entries()).sort((e,t)=>t[1]-e[1])},[e]),W=(0,r.useMemo)(()=>{let e=h.slice();if("all"!==m&&(e=e.filter(e=>e.projectKey===m)),"all"!==S&&(e=e.filter(e=>(e.session.agent??"claude-code")===S)),p){let t=p.toLowerCase();e=e.filter(({session:e,briefSummary:s,projectKey:r})=>e.id.toLowerCase().includes(t)||(s??"").toLowerCase().includes(t)||(e.firstUserPreview??"").toLowerCase().includes(t)||(e.lastAgentPreview??"").toLowerCase().includes(t)||e.projectName.toLowerCase().includes(t)||r.toLowerCase().includes(t))}return"newest"===M?e.sort((e,t)=>(t.session.firstTimestamp?Date.parse(t.session.firstTimestamp):0)-(e.session.firstTimestamp?Date.parse(e.session.firstTimestamp):0)):"longest"===M?e.sort((e,t)=>(t.session.airTimeMs??t.session.durationMs??0)-(e.session.airTimeMs??e.session.durationMs??0)):"most-tokens"===M?e.sort((e,t)=>b(t.session)-b(e.session)):"outcome"===M&&e.sort((e,t)=>(0,j.outcomePriority)(t.outcome)-(0,j.outcomePriority)(e.outcome)),e},[h,m,S,p,M]);return(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{style:{display:"flex",gap:10,marginBottom:16,flexWrap:"wrap",alignItems:"center"},children:[(0,t.jsxs)("div",{style:{position:"relative",flex:1,minWidth:260,maxWidth:480},children:[(0,t.jsx)(l.Search,{size:13,color:"var(--af-text-tertiary)",style:{position:"absolute",left:12,top:"50%",transform:"translateY(-50%)"}}),(0,t.jsx)("input",{type:"text",placeholder:"Search by message, project, or ID",value:p,onChange:e=>A("q",e.target.value,""),style:{width:"100%",paddingLeft:32}})]}),(0,t.jsx)(v,{value:m,onChange:e=>A("project",e,"all"),title:"Filter by project",searchPlaceholder:"Filter projects…",options:D.map(e=>({value:e,label:"all"===e?"All projects":(0,n.prettyProjectName)(e)}))}),L.length>1&&(0,t.jsxs)("select",{value:S,onChange:e=>A("agent",e.target.value,"all"),title:"Filter by source agent",children:[(0,t.jsx)("option",{value:"all",children:"All agents"}),L.map(([e,s])=>{var r;return(0,t.jsxs)("option",{value:e,children:[(r=e,(0,o.getAgentMetadata)(r)?.displayName??r)," (",s,")"]},e)})]}),(0,t.jsxs)("select",{value:M,onChange:e=>A("sort",e.target.value,"newest"),children:[(0,t.jsx)("option",{value:"newest",children:"Newest"}),(0,t.jsx)("option",{value:"longest",children:"Longest"}),(0,t.jsx)("option",{value:"most-tokens",children:"Most tokens"}),(0,t.jsx)("option",{value:"outcome",children:"Outcome"})]}),(0,t.jsx)("span",{style:{marginLeft:"auto",fontSize:11,color:"var(--af-text-tertiary)",fontFamily:"var(--font-mono)"},children:W.length}),z]}),0===W.length?(0,t.jsx)("div",{className:"af-empty",children:"No sessions found."}):"table"===T?(0,t.jsx)(x.DataTable,{rows:W,getRowKey:e=>`${e.session.projectDir}/${e.session.id}`,onRowClick:e=>d.push(`/sessions/${e.session.id}`),defaultSortKey:"lastActive",defaultSortDir:"desc",columns:k}):(0,t.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(360px, 1fr))",gap:14},children:W.map(e=>(0,t.jsx)(C,{row:e},`${e.session.projectDir}/${e.session.id}`))})]})}],86333)}]);
@@ -1,4 +1,4 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,40484,e=>{"use strict";var t=e.i(18050);let r={build:"var(--af-accent)",plan:"#9f7aea",debug:"#ed8936",review:"#4299e1",refactor:"#38b2ac",test:"#48bb78",release:"#ed64a6",research:"#a0aec0",steer:"#f6ad55",meta:"#718096",warmup_minimal:"#cbd5e0"};e.s(["GoalBar",0,function({goals:e,total:a,height:i=12}){return 0===a||0===e.length?(0,t.jsx)("p",{style:{fontSize:12,color:"var(--af-text-tertiary)",margin:0},children:"No goal data."}):(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{style:{display:"flex",gap:2,height:i,borderRadius:3,overflow:"hidden"},children:e.map(e=>{let i=e.minutes/a*100;return(0,t.jsx)("div",{style:{width:`${i}%`,background:r[e.category]??"#888"},title:`${e.category}: ${Math.round(e.minutes)}m (${i.toFixed(0)}%)`},e.category)})}),(0,t.jsx)("div",{style:{display:"flex",gap:14,marginTop:8,flexWrap:"wrap",fontSize:11,color:"var(--af-text-tertiary)"},children:e.map(e=>(0,t.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:5},children:[(0,t.jsx)("span",{style:{width:8,height:8,borderRadius:2,background:r[e.category]??"#888"}}),e.category," ",Math.round(e.minutes),"m"]},e.category))})]})}])},63059,e=>{"use strict";let t=(0,e.i(75254).default)("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);e.s(["ChevronRight",0,t],63059)},37727,e=>{"use strict";let t=(0,e.i(75254).default)("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);e.s(["X",0,t],37727)},74886,e=>{"use strict";let t=(0,e.i(75254).default)("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);e.s(["Copy",0,t],74886)},73375,e=>{"use strict";let t=(0,e.i(75254).default)("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);e.s(["ChevronLeft",0,t],73375)},21886,e=>{"use strict";var t=e.i(18050),r=e.i(71645);let a=(0,e.i(75254).default)("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);function i({digestKey:e}){let[n,s]=(0,r.useState)("idle"),[o,l]=(0,r.useState)(null);async function d(){s("loading"),l(null);try{var t,r;let a,i,n=await fetch(`/api/pdf/${e}`,{method:"POST"});if(!n.ok){let e=await n.json().catch(()=>({error:`HTTP ${n.status}`}));throw Error(e.error??`HTTP ${n.status}`)}let o=await n.blob(),l=function(e){if(!e)return null;let t=/filename="([^"]+)"/.exec(e)??/filename=([^;]+)/.exec(e);return t?t[1].trim():null}(n.headers.get("content-disposition"))??`fleetlens-${e}.pdf`;t=o,r=l,a=URL.createObjectURL(t),(i=document.createElement("a")).href=a,i.download=r,document.body.appendChild(i),i.click(),i.remove(),setTimeout(()=>URL.revokeObjectURL(a),1e3),s("idle")}catch(e){l(e instanceof Error?e.message:String(e)),s("error")}}let c="loading"===n;return(0,t.jsx)("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:(0,t.jsxs)("button",{onClick:d,disabled:c,title:o??"Download as PDF",style:{padding:"2px 8px",background:"transparent",border:"1px solid var(--af-border-subtle)",borderRadius:4,fontSize:10,color:"error"===n?"#f56565":"var(--af-text-secondary)",cursor:c?"default":"pointer",opacity:c?.6:1,display:"inline-flex",alignItems:"center",gap:4},children:[(0,t.jsx)(a,{size:11}),"loading"===n?"Exporting…":"error"===n?"Retry PDF":"PDF"]})})}e.s(["DigestActions",0,function({digestKey:e,period:r,hasDigest:a,narrativeFresh:n,isStreaming:s,aiEnabled:o,progress:l,onGenerate:d,onReroll:c,rerollTitle:f}){var p,g;let h=`Re-roll the narrative for this ${r}`,x=a?(0,t.jsx)(i,{digestKey:`${r}-${e}`}):null,y=null;return!n&&o?y=(0,t.jsx)("button",{onClick:d,disabled:s,style:{padding:"4px 10px",background:"var(--af-accent)",color:"white",border:"none",borderRadius:5,cursor:(p=s)?"default":"pointer",fontSize:11,fontWeight:600,opacity:p?.6:1},children:s?"Generating...":a?"Generate":"Generate digest"}):o&&(y=(0,t.jsxs)("span",{style:{fontSize:10,color:"var(--af-text-tertiary)",display:"inline-flex",gap:6,alignItems:"center"},children:["✓ Up to date",(0,t.jsx)("button",{onClick:c,disabled:s,title:f??h,style:{padding:"2px 7px",background:"transparent",border:"1px solid var(--af-border-subtle)",borderRadius:4,fontSize:10,color:"var(--af-text-secondary)",cursor:(g=s)?"default":"pointer",opacity:g?.6:1},children:s?"...":"Re-roll"})]})),l&&(y=(0,t.jsxs)(t.Fragment,{children:[y,(0,t.jsx)("span",{style:{fontSize:10,color:"var(--af-text-tertiary)"},children:l})]})),x&&(y=(0,t.jsxs)(t.Fragment,{children:[y,x]})),y}],21886)},1033,e=>{"use strict";var t=e.i(18050),r=e.i(71645),a=e.i(95419),i=e.i(21886);function n({monday:e,isStreaming:r,aiEnabled:a,progress:i,onGenerate:s}){let o=new Date(`${e}T12:00:00`),l=new Date(o);l.setDate(o.getDate()+6);let d=e=>e.toLocaleDateString("en-US",{month:"short",day:"numeric"}),c=`${d(o)} — ${d(l)}`;return(0,t.jsx)("div",{style:{maxWidth:980,margin:"0 auto",padding:"60px 40px"},children:(0,t.jsxs)("div",{style:{margin:"0 auto",maxWidth:480,padding:"32px 28px",borderRadius:14,background:"var(--af-surface)",border:"1px dashed var(--af-border-subtle)",textAlign:"center"},children:[(0,t.jsx)("div",{style:{width:44,height:44,borderRadius:12,margin:"0 auto 16px",background:"var(--af-accent-subtle)",display:"flex",alignItems:"center",justifyContent:"center",color:"var(--af-accent)",fontSize:20},children:"✦"}),(0,t.jsx)("h2",{style:{fontSize:16,fontWeight:600,margin:"0 0 6px",color:"var(--af-text)",letterSpacing:"-0.01em"},children:r?"Generating digest…":"No digest yet for this week"}),(0,t.jsx)("p",{style:{fontSize:12.5,lineHeight:1.55,margin:"0 0 18px",color:"var(--af-text-secondary)"},children:r?`Synthesizing ${c} from this week's day digests. This usually takes 5–10 minutes.`:a?`Once generated, this view shows top sessions, trajectory, findings, and project areas for ${c}.`:`Enable AI features in Settings to synthesize a weekly narrative for ${c}. Deterministic stats are still available below in the live digest as soon as data lands.`}),a&&(0,t.jsx)("button",{onClick:s,disabled:r,style:{padding:"9px 18px",borderRadius:8,background:r?"var(--af-border-subtle)":"var(--af-accent)",color:r?"var(--af-text-tertiary)":"white",border:"none",cursor:r?"default":"pointer",fontSize:13,fontWeight:600,letterSpacing:"-0.005em"},children:r?"Generating…":"Generate digest"}),i&&(0,t.jsx)("div",{style:{marginTop:12,fontSize:10.5,color:"var(--af-text-tertiary)",fontFamily:"var(--font-mono)"},children:i})]})})}e.s(["WeekDigestView",0,function({initial:e,monday:s,aiEnabled:o,autoFire:l=!1,prior:d}){let[c,f]=(0,r.useState)(e),[p,g]=(0,r.useState)("idle"),[h,x]=(0,r.useState)(""),y=(0,r.useRef)(!1),u=(0,r.useCallback)(async(e=!1)=>{g("streaming"),x("Starting...");let t=`/api/digest/week/${s}${e?"?force=1":""}`,r=await fetch(t,{method:"POST"});if(!r.ok||!r.body){g("error"),x(`Error ${r.status}`);return}let a=r.body.getReader(),i=new TextDecoder,n="";for(;;){let{done:e,value:t}=await a.read();if(e)break;let r=(n+=i.decode(t,{stream:!0})).split("\n\n");for(let e of(n=r.pop()??"",r)){let t=e.split("\n").find(e=>e.startsWith("data: "));if(t)try{let e=JSON.parse(t.slice(6));if("status"===e.type)x(e.text);else if("dependency"===e.type)x(`${"day"===e.kind?"Day":"Week"} ${e.key} ${e.status}`);else if("entry"===e.type)x(`Enriching ${e.index}/${e.total}...`);else if("progress"===e.type){let t=Math.round(e.elapsed_ms/1e3);x(`Claude composing… ${e.bytes.toLocaleString()} chars (${t}s)`)}else if("digest"===e.type)e.digest&&"week"===e.digest.scope&&f(e.digest),x("Rendering...");else if("saved"===e.type)x("Saved.");else if("error"===e.type){g("error"),x(e.message);return}}catch{}}}g("done"),x("")},[s]);(0,r.useEffect)(()=>{l&&!y.current&&"idle"===p&&(y.current=!0,u(!1))},[l,p,u]);let v="streaming"===p,b=!!c?.headline,m=(0,t.jsx)(i.DigestActions,{digestKey:s,period:"week",hasDigest:!!c,narrativeFresh:b,isStreaming:v,aiEnabled:o,progress:h,onGenerate:()=>u(!1),onReroll:()=>u(!0),rerollTitle:"Re-roll the narrative for this week"});return c?(0,t.jsx)(a.WeekDigest,{digest:c,aiEnabled:o,actions:m,priorDigest:d??null}):(0,t.jsx)(n,{monday:s,isStreaming:v,aiEnabled:o,progress:h,onGenerate:()=>u(!1)})}])},57143,e=>{"use strict";var t=e.i(18050),r=e.i(22016),a=e.i(71645),i=e.i(73375),n=e.i(63059);let s=(0,e.i(75254).default)("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);var o=e.i(37727);function l({inDrawer:e=!1}={}){let[r,i]=(0,a.useState)("weeks"),[n,s]=(0,a.useState)(null),[o,x]=(0,a.useState)(null);return(0,a.useEffect)(()=>{fetch("/api/digest/week-index?count=12").then(e=>e.json()).then(e=>s(e.weeks)).catch(()=>s([])),fetch("/api/digest/month-index?count=6").then(e=>e.json()).then(e=>x(e.months)).catch(()=>x([]))},[]),(0,t.jsxs)("div",{style:e?{padding:"0 18px"}:{maxWidth:980,margin:"0 auto",padding:"28px 40px 0"},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:e?14:18},children:[!e&&(0,t.jsx)("h2",{style:{fontSize:11,fontWeight:700,letterSpacing:"0.08em",textTransform:"uppercase",color:"var(--af-text-tertiary)",margin:0,marginRight:4},children:"History"}),(0,t.jsx)("div",{style:p,children:["weeks","months"].map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>i(e),style:{...g,background:r===e?"var(--af-accent)":"transparent",color:r===e?"white":"var(--af-text-secondary)"},children:"weeks"===e?"Weeks":"Months"},e))})]}),"weeks"===r?null===n?(0,t.jsx)(f,{children:"Loading weeks…"}):0===n.length?(0,t.jsx)(f,{children:"No history yet."}):(0,t.jsx)("ul",{style:h,children:n.map(e=>(0,t.jsx)(d,{w:e},e.start))}):null===o?(0,t.jsx)(f,{children:"Loading months…"}):0===o.length?(0,t.jsx)(f,{children:"No history yet."}):(0,t.jsx)("ul",{style:h,children:o.map(e=>(0,t.jsx)(c,{m:e},e.start))})]})}function d({w:e}){let a=0===e.active_days&&!e.in_progress&&!e.saved_key,i=e.saved_key?`/insights/${e.saved_key}`:`/insights/week-${e.start}`,n=e.saved_key&&e.headline?e.headline:a?"no data":e.in_progress?"in progress · click to view":`${e.active_days} active day${1===e.active_days?"":"s"} \xb7 click to generate`;return(0,t.jsx)("li",{style:x(!!e.saved_key),children:(0,t.jsxs)(r.default,{href:i,style:{display:"flex",flexDirection:"column",gap:4,textDecoration:"none",flex:1,minWidth:0},children:[(0,t.jsxs)("div",{style:y,children:[(0,t.jsxs)("span",{style:{fontSize:13,fontWeight:600,color:"var(--af-text)",letterSpacing:"-0.01em"},children:["W",String(e.iso_week).padStart(2,"0")," · ",e.label]}),e.in_progress&&(0,t.jsx)("span",{style:v,children:"in progress"}),e.saved_key&&(0,t.jsxs)("span",{style:{fontSize:10,fontWeight:600,color:"var(--af-accent)",marginLeft:"auto"},children:[e.shipped_count," PR · ",e.agent_min,"m"]})]}),(0,t.jsx)("span",{style:u,children:n})]})})}function c({m:e}){let a=0===e.active_days&&!e.in_progress&&!e.saved_key,i=e.saved_key?`/insights/${e.saved_key}`:`/insights/month-${e.start.slice(0,7)}`,n=e.saved_key&&e.headline?e.headline:a?"no data":e.in_progress?"in progress · click to view":`${e.active_days} active day${1===e.active_days?"":"s"} \xb7 click to generate`;return(0,t.jsx)("li",{style:x(!!e.saved_key),children:(0,t.jsxs)(r.default,{href:i,style:{display:"flex",flexDirection:"column",gap:4,textDecoration:"none",flex:1,minWidth:0},children:[(0,t.jsxs)("div",{style:y,children:[(0,t.jsx)("span",{style:{fontSize:13,fontWeight:600,color:"var(--af-text)",letterSpacing:"-0.01em"},children:e.label}),e.in_progress&&(0,t.jsx)("span",{style:v,children:"in progress"}),e.saved_key&&(0,t.jsxs)("span",{style:{fontSize:10,fontWeight:600,color:"var(--af-accent)",marginLeft:"auto"},children:[e.shipped_count," PR · ",e.agent_min,"m"]})]}),(0,t.jsx)("span",{style:u,children:n})]})})}function f({children:e}){return(0,t.jsx)("div",{style:{padding:"20px 18px",borderRadius:10,border:"1px dashed var(--af-border)",background:"var(--af-surface)",fontSize:13,color:"var(--af-text-tertiary)",lineHeight:1.55},children:e})}let p={display:"inline-flex",gap:3,border:"1px solid var(--af-border)",borderRadius:8,padding:2},g={padding:"5px 14px",fontSize:12,fontWeight:600,border:"none",borderRadius:6,cursor:"pointer"},h={listStyle:"none",padding:0,margin:0,display:"flex",flexDirection:"column",gap:4};function x(e){return{display:"flex",alignItems:"stretch",gap:14,padding:"10px 14px",borderRadius:10,border:`1px solid ${e?"color-mix(in srgb, var(--af-accent) 24%, var(--af-border))":"var(--af-border-subtle)"}`,background:e?"color-mix(in srgb, var(--af-accent) 6%, var(--af-surface))":"var(--af-surface)",transition:"border-color 0.15s"}}let y={display:"flex",alignItems:"center",gap:8,minWidth:0},u={fontSize:11,color:"var(--af-text-tertiary)",lineHeight:1.5,fontFamily:"var(--font-mono)"},v={fontSize:10,fontWeight:500,padding:"2px 6px",borderRadius:4,background:"color-mix(in srgb, #f5b445 18%, transparent)",color:"#c08a1f",letterSpacing:"0.02em"};function b({target:e,dir:a}){var s;let o="prev"===a?i.ChevronLeft:n.ChevronRight;return e?(0,t.jsxs)(r.default,{href:`/insights/${e.key}`,style:(s=e.cached,{display:"inline-flex",alignItems:"center",gap:4,padding:"5px 9px",borderRadius:6,border:`1px solid ${s?"color-mix(in srgb, var(--af-accent) 28%, var(--af-border))":"var(--af-border-subtle)"}`,background:s?"color-mix(in srgb, var(--af-accent) 6%, var(--af-surface))":"var(--af-surface)",color:s?"var(--af-accent)":"var(--af-text-secondary)",fontSize:11,fontWeight:500,fontFamily:"var(--font-mono)",textDecoration:"none"}),title:e.cached?`Saved digest \xb7 ${e.label}`:`${e.label} (no saved digest yet — will prompt to Generate)`,children:[(0,t.jsx)(o,{size:14}),(0,t.jsx)("span",{children:e.label})]}):(0,t.jsx)("span",{style:j,title:`No ${"prev"===a?"earlier":"later"} period`,children:(0,t.jsx)(o,{size:14})})}function m({onClose:e}){return(0,t.jsxs)("div",{role:"dialog","aria-modal":"true","aria-label":"Insights history",style:{position:"fixed",inset:0,zIndex:200,display:"flex",justifyContent:"flex-end"},children:[(0,t.jsx)("div",{onClick:e,style:{position:"absolute",inset:0,background:"rgba(0,0,0,0.32)",animation:"fade-in 120ms ease-out"}}),(0,t.jsxs)("aside",{style:{position:"relative",width:"min(440px, 92vw)",height:"100vh",background:"var(--background)",borderLeft:"1px solid var(--af-border-subtle)",boxShadow:"-12px 0 40px rgba(0,0,0,0.32)",display:"flex",flexDirection:"column",animation:"slide-in 160ms cubic-bezier(0.2, 0.9, 0.3, 1)"},children:[(0,t.jsxs)("header",{style:{display:"flex",alignItems:"center",gap:10,padding:"14px 18px",borderBottom:"1px solid var(--af-border-subtle)"},children:[(0,t.jsx)("h2",{style:{fontSize:13,fontWeight:600,margin:0,color:"var(--af-text)"},children:"Browse insights history"}),(0,t.jsx)("button",{type:"button",onClick:e,"aria-label":"Close history",style:{marginLeft:"auto",width:26,height:26,display:"inline-flex",alignItems:"center",justifyContent:"center",border:"1px solid var(--af-border-subtle)",borderRadius:6,background:"transparent",color:"var(--af-text-secondary)",cursor:"pointer"},children:(0,t.jsx)(o.X,{size:14})})]}),(0,t.jsx)("div",{style:{flex:1,overflowY:"auto",padding:"18px 0"},children:(0,t.jsx)(l,{inDrawer:!0})})]}),(0,t.jsx)("style",{children:`
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,40484,e=>{"use strict";var t=e.i(18050);let r={build:"var(--af-accent)",plan:"#9f7aea",debug:"#ed8936",review:"#4299e1",refactor:"#38b2ac",test:"#48bb78",release:"#ed64a6",research:"#a0aec0",steer:"#f6ad55",meta:"#718096",warmup_minimal:"#cbd5e0"};e.s(["GoalBar",0,function({goals:e,total:a,height:i=12}){return 0===a||0===e.length?(0,t.jsx)("p",{style:{fontSize:12,color:"var(--af-text-tertiary)",margin:0},children:"No goal data."}):(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{style:{display:"flex",gap:2,height:i,borderRadius:3,overflow:"hidden"},children:e.map(e=>{let i=e.minutes/a*100;return(0,t.jsx)("div",{style:{width:`${i}%`,background:r[e.category]??"#888"},title:`${e.category}: ${Math.round(e.minutes)}m (${i.toFixed(0)}%)`},e.category)})}),(0,t.jsx)("div",{style:{display:"flex",gap:14,marginTop:8,flexWrap:"wrap",fontSize:11,color:"var(--af-text-tertiary)"},children:e.map(e=>(0,t.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:5},children:[(0,t.jsx)("span",{style:{width:8,height:8,borderRadius:2,background:r[e.category]??"#888"}}),e.category," ",Math.round(e.minutes),"m"]},e.category))})]})}])},37727,e=>{"use strict";let t=(0,e.i(75254).default)("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);e.s(["X",0,t],37727)},63059,e=>{"use strict";let t=(0,e.i(75254).default)("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);e.s(["ChevronRight",0,t],63059)},74886,e=>{"use strict";let t=(0,e.i(75254).default)("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);e.s(["Copy",0,t],74886)},73375,e=>{"use strict";let t=(0,e.i(75254).default)("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);e.s(["ChevronLeft",0,t],73375)},21886,e=>{"use strict";var t=e.i(18050),r=e.i(71645);let a=(0,e.i(75254).default)("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);function i({digestKey:e}){let[n,s]=(0,r.useState)("idle"),[o,l]=(0,r.useState)(null);async function d(){s("loading"),l(null);try{var t,r;let a,i,n=await fetch(`/api/pdf/${e}`,{method:"POST"});if(!n.ok){let e=await n.json().catch(()=>({error:`HTTP ${n.status}`}));throw Error(e.error??`HTTP ${n.status}`)}let o=await n.blob(),l=function(e){if(!e)return null;let t=/filename="([^"]+)"/.exec(e)??/filename=([^;]+)/.exec(e);return t?t[1].trim():null}(n.headers.get("content-disposition"))??`fleetlens-${e}.pdf`;t=o,r=l,a=URL.createObjectURL(t),(i=document.createElement("a")).href=a,i.download=r,document.body.appendChild(i),i.click(),i.remove(),setTimeout(()=>URL.revokeObjectURL(a),1e3),s("idle")}catch(e){l(e instanceof Error?e.message:String(e)),s("error")}}let c="loading"===n;return(0,t.jsx)("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:(0,t.jsxs)("button",{onClick:d,disabled:c,title:o??"Download as PDF",style:{padding:"2px 8px",background:"transparent",border:"1px solid var(--af-border-subtle)",borderRadius:4,fontSize:10,color:"error"===n?"#f56565":"var(--af-text-secondary)",cursor:c?"default":"pointer",opacity:c?.6:1,display:"inline-flex",alignItems:"center",gap:4},children:[(0,t.jsx)(a,{size:11}),"loading"===n?"Exporting…":"error"===n?"Retry PDF":"PDF"]})})}e.s(["DigestActions",0,function({digestKey:e,period:r,hasDigest:a,narrativeFresh:n,isStreaming:s,aiEnabled:o,progress:l,onGenerate:d,onReroll:c,rerollTitle:f}){var p,g;let h=`Re-roll the narrative for this ${r}`,x=a?(0,t.jsx)(i,{digestKey:`${r}-${e}`}):null,y=null;return!n&&o?y=(0,t.jsx)("button",{onClick:d,disabled:s,style:{padding:"4px 10px",background:"var(--af-accent)",color:"white",border:"none",borderRadius:5,cursor:(p=s)?"default":"pointer",fontSize:11,fontWeight:600,opacity:p?.6:1},children:s?"Generating...":a?"Generate":"Generate digest"}):o&&(y=(0,t.jsxs)("span",{style:{fontSize:10,color:"var(--af-text-tertiary)",display:"inline-flex",gap:6,alignItems:"center"},children:["✓ Up to date",(0,t.jsx)("button",{onClick:c,disabled:s,title:f??h,style:{padding:"2px 7px",background:"transparent",border:"1px solid var(--af-border-subtle)",borderRadius:4,fontSize:10,color:"var(--af-text-secondary)",cursor:(g=s)?"default":"pointer",opacity:g?.6:1},children:s?"...":"Re-roll"})]})),l&&(y=(0,t.jsxs)(t.Fragment,{children:[y,(0,t.jsx)("span",{style:{fontSize:10,color:"var(--af-text-tertiary)"},children:l})]})),x&&(y=(0,t.jsxs)(t.Fragment,{children:[y,x]})),y}],21886)},1033,e=>{"use strict";var t=e.i(18050),r=e.i(71645),a=e.i(95419),i=e.i(21886);function n({monday:e,isStreaming:r,aiEnabled:a,progress:i,onGenerate:s}){let o=new Date(`${e}T12:00:00`),l=new Date(o);l.setDate(o.getDate()+6);let d=e=>e.toLocaleDateString("en-US",{month:"short",day:"numeric"}),c=`${d(o)} — ${d(l)}`;return(0,t.jsx)("div",{style:{maxWidth:980,margin:"0 auto",padding:"60px 40px"},children:(0,t.jsxs)("div",{style:{margin:"0 auto",maxWidth:480,padding:"32px 28px",borderRadius:14,background:"var(--af-surface)",border:"1px dashed var(--af-border-subtle)",textAlign:"center"},children:[(0,t.jsx)("div",{style:{width:44,height:44,borderRadius:12,margin:"0 auto 16px",background:"var(--af-accent-subtle)",display:"flex",alignItems:"center",justifyContent:"center",color:"var(--af-accent)",fontSize:20},children:"✦"}),(0,t.jsx)("h2",{style:{fontSize:16,fontWeight:600,margin:"0 0 6px",color:"var(--af-text)",letterSpacing:"-0.01em"},children:r?"Generating digest…":"No digest yet for this week"}),(0,t.jsx)("p",{style:{fontSize:12.5,lineHeight:1.55,margin:"0 0 18px",color:"var(--af-text-secondary)"},children:r?`Synthesizing ${c} from this week's day digests. This usually takes 5–10 minutes.`:a?`Once generated, this view shows top sessions, trajectory, findings, and project areas for ${c}.`:`Enable AI features in Settings to synthesize a weekly narrative for ${c}. Deterministic stats are still available below in the live digest as soon as data lands.`}),a&&(0,t.jsx)("button",{onClick:s,disabled:r,style:{padding:"9px 18px",borderRadius:8,background:r?"var(--af-border-subtle)":"var(--af-accent)",color:r?"var(--af-text-tertiary)":"white",border:"none",cursor:r?"default":"pointer",fontSize:13,fontWeight:600,letterSpacing:"-0.005em"},children:r?"Generating…":"Generate digest"}),i&&(0,t.jsx)("div",{style:{marginTop:12,fontSize:10.5,color:"var(--af-text-tertiary)",fontFamily:"var(--font-mono)"},children:i})]})})}e.s(["WeekDigestView",0,function({initial:e,monday:s,aiEnabled:o,autoFire:l=!1,prior:d}){let[c,f]=(0,r.useState)(e),[p,g]=(0,r.useState)("idle"),[h,x]=(0,r.useState)(""),y=(0,r.useRef)(!1),u=(0,r.useCallback)(async(e=!1)=>{g("streaming"),x("Starting...");let t=`/api/digest/week/${s}${e?"?force=1":""}`,r=await fetch(t,{method:"POST"});if(!r.ok||!r.body){g("error"),x(`Error ${r.status}`);return}let a=r.body.getReader(),i=new TextDecoder,n="";for(;;){let{done:e,value:t}=await a.read();if(e)break;let r=(n+=i.decode(t,{stream:!0})).split("\n\n");for(let e of(n=r.pop()??"",r)){let t=e.split("\n").find(e=>e.startsWith("data: "));if(t)try{let e=JSON.parse(t.slice(6));if("status"===e.type)x(e.text);else if("dependency"===e.type)x(`${"day"===e.kind?"Day":"Week"} ${e.key} ${e.status}`);else if("entry"===e.type)x(`Enriching ${e.index}/${e.total}...`);else if("progress"===e.type){let t=Math.round(e.elapsed_ms/1e3);x(`Claude composing… ${e.bytes.toLocaleString()} chars (${t}s)`)}else if("digest"===e.type)e.digest&&"week"===e.digest.scope&&f(e.digest),x("Rendering...");else if("saved"===e.type)x("Saved.");else if("error"===e.type){g("error"),x(e.message);return}}catch{}}}g("done"),x("")},[s]);(0,r.useEffect)(()=>{l&&!y.current&&"idle"===p&&(y.current=!0,u(!1))},[l,p,u]);let v="streaming"===p,b=!!c?.headline,m=(0,t.jsx)(i.DigestActions,{digestKey:s,period:"week",hasDigest:!!c,narrativeFresh:b,isStreaming:v,aiEnabled:o,progress:h,onGenerate:()=>u(!1),onReroll:()=>u(!0),rerollTitle:"Re-roll the narrative for this week"});return c?(0,t.jsx)(a.WeekDigest,{digest:c,aiEnabled:o,actions:m,priorDigest:d??null}):(0,t.jsx)(n,{monday:s,isStreaming:v,aiEnabled:o,progress:h,onGenerate:()=>u(!1)})}])},57143,e=>{"use strict";var t=e.i(18050),r=e.i(22016),a=e.i(71645),i=e.i(73375),n=e.i(63059);let s=(0,e.i(75254).default)("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);var o=e.i(37727);function l({inDrawer:e=!1}={}){let[r,i]=(0,a.useState)("weeks"),[n,s]=(0,a.useState)(null),[o,x]=(0,a.useState)(null);return(0,a.useEffect)(()=>{fetch("/api/digest/week-index?count=12").then(e=>e.json()).then(e=>s(e.weeks)).catch(()=>s([])),fetch("/api/digest/month-index?count=6").then(e=>e.json()).then(e=>x(e.months)).catch(()=>x([]))},[]),(0,t.jsxs)("div",{style:e?{padding:"0 18px"}:{maxWidth:980,margin:"0 auto",padding:"28px 40px 0"},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:e?14:18},children:[!e&&(0,t.jsx)("h2",{style:{fontSize:11,fontWeight:700,letterSpacing:"0.08em",textTransform:"uppercase",color:"var(--af-text-tertiary)",margin:0,marginRight:4},children:"History"}),(0,t.jsx)("div",{style:p,children:["weeks","months"].map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>i(e),style:{...g,background:r===e?"var(--af-accent)":"transparent",color:r===e?"white":"var(--af-text-secondary)"},children:"weeks"===e?"Weeks":"Months"},e))})]}),"weeks"===r?null===n?(0,t.jsx)(f,{children:"Loading weeks…"}):0===n.length?(0,t.jsx)(f,{children:"No history yet."}):(0,t.jsx)("ul",{style:h,children:n.map(e=>(0,t.jsx)(d,{w:e},e.start))}):null===o?(0,t.jsx)(f,{children:"Loading months…"}):0===o.length?(0,t.jsx)(f,{children:"No history yet."}):(0,t.jsx)("ul",{style:h,children:o.map(e=>(0,t.jsx)(c,{m:e},e.start))})]})}function d({w:e}){let a=0===e.active_days&&!e.in_progress&&!e.saved_key,i=e.saved_key?`/insights/${e.saved_key}`:`/insights/week-${e.start}`,n=e.saved_key&&e.headline?e.headline:a?"no data":e.in_progress?"in progress · click to view":`${e.active_days} active day${1===e.active_days?"":"s"} \xb7 click to generate`;return(0,t.jsx)("li",{style:x(!!e.saved_key),children:(0,t.jsxs)(r.default,{href:i,style:{display:"flex",flexDirection:"column",gap:4,textDecoration:"none",flex:1,minWidth:0},children:[(0,t.jsxs)("div",{style:y,children:[(0,t.jsxs)("span",{style:{fontSize:13,fontWeight:600,color:"var(--af-text)",letterSpacing:"-0.01em"},children:["W",String(e.iso_week).padStart(2,"0")," · ",e.label]}),e.in_progress&&(0,t.jsx)("span",{style:v,children:"in progress"}),e.saved_key&&(0,t.jsxs)("span",{style:{fontSize:10,fontWeight:600,color:"var(--af-accent)",marginLeft:"auto"},children:[e.shipped_count," PR · ",e.agent_min,"m"]})]}),(0,t.jsx)("span",{style:u,children:n})]})})}function c({m:e}){let a=0===e.active_days&&!e.in_progress&&!e.saved_key,i=e.saved_key?`/insights/${e.saved_key}`:`/insights/month-${e.start.slice(0,7)}`,n=e.saved_key&&e.headline?e.headline:a?"no data":e.in_progress?"in progress · click to view":`${e.active_days} active day${1===e.active_days?"":"s"} \xb7 click to generate`;return(0,t.jsx)("li",{style:x(!!e.saved_key),children:(0,t.jsxs)(r.default,{href:i,style:{display:"flex",flexDirection:"column",gap:4,textDecoration:"none",flex:1,minWidth:0},children:[(0,t.jsxs)("div",{style:y,children:[(0,t.jsx)("span",{style:{fontSize:13,fontWeight:600,color:"var(--af-text)",letterSpacing:"-0.01em"},children:e.label}),e.in_progress&&(0,t.jsx)("span",{style:v,children:"in progress"}),e.saved_key&&(0,t.jsxs)("span",{style:{fontSize:10,fontWeight:600,color:"var(--af-accent)",marginLeft:"auto"},children:[e.shipped_count," PR · ",e.agent_min,"m"]})]}),(0,t.jsx)("span",{style:u,children:n})]})})}function f({children:e}){return(0,t.jsx)("div",{style:{padding:"20px 18px",borderRadius:10,border:"1px dashed var(--af-border)",background:"var(--af-surface)",fontSize:13,color:"var(--af-text-tertiary)",lineHeight:1.55},children:e})}let p={display:"inline-flex",gap:3,border:"1px solid var(--af-border)",borderRadius:8,padding:2},g={padding:"5px 14px",fontSize:12,fontWeight:600,border:"none",borderRadius:6,cursor:"pointer"},h={listStyle:"none",padding:0,margin:0,display:"flex",flexDirection:"column",gap:4};function x(e){return{display:"flex",alignItems:"stretch",gap:14,padding:"10px 14px",borderRadius:10,border:`1px solid ${e?"color-mix(in srgb, var(--af-accent) 24%, var(--af-border))":"var(--af-border-subtle)"}`,background:e?"color-mix(in srgb, var(--af-accent) 6%, var(--af-surface))":"var(--af-surface)",transition:"border-color 0.15s"}}let y={display:"flex",alignItems:"center",gap:8,minWidth:0},u={fontSize:11,color:"var(--af-text-tertiary)",lineHeight:1.5,fontFamily:"var(--font-mono)"},v={fontSize:10,fontWeight:500,padding:"2px 6px",borderRadius:4,background:"color-mix(in srgb, #f5b445 18%, transparent)",color:"#c08a1f",letterSpacing:"0.02em"};function b({target:e,dir:a}){var s;let o="prev"===a?i.ChevronLeft:n.ChevronRight;return e?(0,t.jsxs)(r.default,{href:`/insights/${e.key}`,style:(s=e.cached,{display:"inline-flex",alignItems:"center",gap:4,padding:"5px 9px",borderRadius:6,border:`1px solid ${s?"color-mix(in srgb, var(--af-accent) 28%, var(--af-border))":"var(--af-border-subtle)"}`,background:s?"color-mix(in srgb, var(--af-accent) 6%, var(--af-surface))":"var(--af-surface)",color:s?"var(--af-accent)":"var(--af-text-secondary)",fontSize:11,fontWeight:500,fontFamily:"var(--font-mono)",textDecoration:"none"}),title:e.cached?`Saved digest \xb7 ${e.label}`:`${e.label} (no saved digest yet — will prompt to Generate)`,children:[(0,t.jsx)(o,{size:14}),(0,t.jsx)("span",{children:e.label})]}):(0,t.jsx)("span",{style:j,title:`No ${"prev"===a?"earlier":"later"} period`,children:(0,t.jsx)(o,{size:14})})}function m({onClose:e}){return(0,t.jsxs)("div",{role:"dialog","aria-modal":"true","aria-label":"Insights history",style:{position:"fixed",inset:0,zIndex:200,display:"flex",justifyContent:"flex-end"},children:[(0,t.jsx)("div",{onClick:e,style:{position:"absolute",inset:0,background:"rgba(0,0,0,0.32)",animation:"fade-in 120ms ease-out"}}),(0,t.jsxs)("aside",{style:{position:"relative",width:"min(440px, 92vw)",height:"100vh",background:"var(--background)",borderLeft:"1px solid var(--af-border-subtle)",boxShadow:"-12px 0 40px rgba(0,0,0,0.32)",display:"flex",flexDirection:"column",animation:"slide-in 160ms cubic-bezier(0.2, 0.9, 0.3, 1)"},children:[(0,t.jsxs)("header",{style:{display:"flex",alignItems:"center",gap:10,padding:"14px 18px",borderBottom:"1px solid var(--af-border-subtle)"},children:[(0,t.jsx)("h2",{style:{fontSize:13,fontWeight:600,margin:0,color:"var(--af-text)"},children:"Browse insights history"}),(0,t.jsx)("button",{type:"button",onClick:e,"aria-label":"Close history",style:{marginLeft:"auto",width:26,height:26,display:"inline-flex",alignItems:"center",justifyContent:"center",border:"1px solid var(--af-border-subtle)",borderRadius:6,background:"transparent",color:"var(--af-text-secondary)",cursor:"pointer"},children:(0,t.jsx)(o.X,{size:14})})]}),(0,t.jsx)("div",{style:{flex:1,overflowY:"auto",padding:"18px 0"},children:(0,t.jsx)(l,{inDrawer:!0})})]}),(0,t.jsx)("style",{children:`
2
2
  @keyframes slide-in { from { transform: translateX(20px); opacity: 0 } to { transform: translateX(0); opacity: 1 } }
3
3
  @keyframes fade-in { from { opacity: 0 } to { opacity: 1 } }
4
4
  `})]})}let k={display:"inline-flex",alignItems:"center",gap:6,padding:"5px 11px",borderRadius:6,border:"1px solid var(--af-border-subtle)",background:"var(--af-surface)",color:"var(--af-text)",fontSize:11,fontWeight:500,cursor:"pointer",fontFamily:"inherit"},j={display:"inline-flex",alignItems:"center",gap:4,padding:"5px 9px",borderRadius:6,border:"1px solid var(--af-border-subtle)",background:"var(--af-surface)",color:"var(--af-text-tertiary)",fontSize:11,fontWeight:500,fontFamily:"var(--font-mono)",opacity:.45,cursor:"default"};e.s(["InsightsTopBar",0,function({scope:e,currentLabel:i,rangeLabel:n,prev:o,next:l}){let[d,c]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{if(!d)return;let e=e=>{"Escape"===e.key&&c(!1)};return window.addEventListener("keydown",e),document.body.style.overflow="hidden",()=>{window.removeEventListener("keydown",e),document.body.style.overflow=""}},[d]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("header",{style:{position:"sticky",top:0,zIndex:50,background:"color-mix(in srgb, var(--background) 90%, transparent)",backdropFilter:"blur(10px)",WebkitBackdropFilter:"blur(10px)",borderBottom:"1px solid var(--af-border-subtle)"},className:"no-print",children:(0,t.jsxs)("div",{style:{maxWidth:980,margin:"0 auto",padding:"12px 40px",display:"flex",alignItems:"center",gap:14,minHeight:44},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:10,minWidth:0},children:[(0,t.jsx)(r.default,{href:"/insights",style:{fontSize:10,fontWeight:700,color:"var(--af-text-tertiary)",textDecoration:"none",textTransform:"uppercase",letterSpacing:"0.08em",flexShrink:0},title:"Latest week digest",children:"Insights"}),(0,t.jsx)("span",{style:{color:"var(--af-text-tertiary)",fontSize:11,flexShrink:0},children:"›"}),(0,t.jsx)("span",{style:{fontSize:14,fontWeight:600,color:"var(--af-text)",letterSpacing:"-0.01em",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:i}),n&&(0,t.jsx)("span",{style:{fontSize:11,fontFamily:"var(--font-mono)",color:"var(--af-text-tertiary)",flexShrink:0},children:n})]}),(0,t.jsxs)("div",{style:{marginLeft:"auto",display:"inline-flex",alignItems:"center",gap:6},children:[(0,t.jsx)(b,{target:o,dir:"prev"}),(0,t.jsx)(b,{target:l,dir:"next"}),(0,t.jsxs)("button",{type:"button",onClick:()=>c(!0),style:k,title:`Browse ${"week"===e?"weekly":"monthly"} history`,children:[(0,t.jsx)(s,{size:13}),(0,t.jsx)("span",{children:"Browse"})]})]})]})}),d&&(0,t.jsx)(m,{onClose:()=>c(!1)})]})}],57143)}]);
@@ -0,0 +1,14 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,86566,e=>{"use strict";var t=e.i(18050),r=e.i(22016),a=e.i(18566),i=e.i(71645),n=e.i(75254);let s=(0,n.default)("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]),l=(0,n.default)("ListTree",[["path",{d:"M21 12h-8",key:"1bmf0i"}],["path",{d:"M21 6H8",key:"1pqkrb"}],["path",{d:"M21 18h-8",key:"1tm79t"}],["path",{d:"M3 6v4c0 1.1.9 2 2 2h3",key:"1ywdgy"}],["path",{d:"M3 10v6c0 1.1.9 2 2 2h3",key:"2wc746"}]]);var o=e.i(75505);let d=(0,n.default)("Pin",[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]]),c=(0,n.default)("PinOff",[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89",key:"znwnzq"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11",key:"c9qhm2"}]]);var p=e.i(55436);let u=(0,n.default)("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]),h=(0,n.default)("Gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]);var f=e.i(41240),x=e.i(63639);let g=(0,n.default)("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),y=(0,n.default)("CalendarDays",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]]),m=(0,n.default)("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);var v=e.i(56324);let b=(0,n.default)("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]),j=(0,n.default)("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]),w="claude-lens:theme";function k(e){if("u">typeof document){document.documentElement.setAttribute("data-theme",e);try{document.cookie=`claude-lens-theme=${e};path=/;max-age=31536000;samesite=lax`}catch{}}}function S(){let[e,r]=(0,i.useState)("dark"),[a,n]=(0,i.useState)(!1);return(0,i.useEffect)(()=>{let e=document.documentElement.getAttribute("data-theme");if("light"===e||"dark"===e)r(e);else{let e=function(){try{let e=window.localStorage.getItem(w);if("light"===e||"dark"===e)return e}catch{}return null}()??(window.matchMedia("(prefers-color-scheme: light)").matches?"light":"dark");r(e),k(e)}n(!0)},[]),(0,t.jsx)("button",{type:"button",onClick:()=>{let t="dark"===e?"light":"dark";r(t),k(t);try{window.localStorage.setItem(w,t)}catch{}},"aria-label":"dark"===e?"Switch to light mode":"Switch to dark mode",title:"dark"===e?"Switch to light mode":"Switch to dark mode",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:28,height:28,borderRadius:6,background:"transparent",border:"1px solid var(--af-border-subtle)",color:"var(--af-text-secondary)",cursor:"pointer",transition:"all 0.12s"},onMouseEnter:e=>{e.currentTarget.style.background="var(--af-surface-hover)",e.currentTarget.style.color="var(--af-text)"},onMouseLeave:e=>{e.currentTarget.style.background="transparent",e.currentTarget.style.color="var(--af-text-secondary)"},children:a?"dark"===e?(0,t.jsx)(j,{size:14}):(0,t.jsx)(b,{size:14}):null})}var z=e.i(86619),M=e.i(88137);function T({snapshot:e}){let a,i,[n,,s]=(0,z.usePersistentBoolean)("cclens:usage:show-sonnet",!1);if(!e)return(0,t.jsxs)("div",{style:{padding:"10px 16px 12px",borderTop:"1px solid var(--af-border-subtle)",fontSize:10,color:"var(--af-text-tertiary)",lineHeight:1.4},children:[(0,t.jsx)("div",{style:{textTransform:"uppercase",letterSpacing:"0.06em",fontWeight:600,marginBottom:4},children:"Usage"}),(0,t.jsxs)("div",{children:["Run ",(0,t.jsx)("code",{style:{fontFamily:"var(--font-mono)"},children:"cclens daemon start"})," to collect metrics."]})]});let l=[{label:"5h",window:e.five_hour,windowMs:18e6},{label:"7d",window:e.seven_day,windowMs:6048e5}];return s&&n&&l.push({label:"Sonnet 7d",window:e.seven_day_sonnet,windowMs:6048e5}),(0,t.jsxs)(r.default,{href:"/usage",style:{display:"block",padding:"10px 16px 12px",borderTop:"1px solid var(--af-border-subtle)",textDecoration:"none",color:"inherit"},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",fontSize:10,fontWeight:600,color:"var(--af-text-tertiary)",textTransform:"uppercase",letterSpacing:"0.06em",marginBottom:8},children:[(0,t.jsx)("span",{children:"Current usage"}),(0,t.jsx)("span",{suppressHydrationWarning:!0,style:{fontWeight:500,textTransform:"none",letterSpacing:0},children:(a=new Date(e.captured_at).getTime(),(i=Math.round((Date.now()-a)/1e3))<60?`${i}s ago`:i<3600?`${Math.floor(i/60)}m ago`:i<86400?`${Math.floor(i/3600)}h ago`:`${Math.floor(i/86400)}d ago`)})]}),(0,t.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:6},children:l.map(e=>(0,t.jsx)(W,{...e},e.label))})]})}function W({label:e,window:r,windowMs:a}){let i=r?.utilization??null,n=null!==i,s=n?Math.max(0,Math.min(100,i)):0,l=r?.resets_at?new Date(r.resets_at).getTime():null,o=n&&l?(0,M.toneVar)((0,M.paceToneForCycle)(s,l,a)):"var(--af-border-subtle)";return(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:6,fontSize:10,color:"var(--af-text-secondary)",marginBottom:2,fontVariantNumeric:"tabular-nums"},children:[(0,t.jsx)("span",{children:e}),r?.resets_at&&(0,t.jsxs)("span",{suppressHydrationWarning:!0,style:{fontSize:9,color:"var(--af-text-tertiary)",flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:["resets ",function(e){let t,r=Math.round((new Date(e).getTime()-Date.now())/1e3),a=Math.abs(r);if(a<60)t=`${a}s`;else if(a<3600)t=`${Math.floor(a/60)}m`;else if(a<86400){let e=Math.floor(a/3600),r=Math.floor(a%3600/60);t=r>0?`${e}h${r}m`:`${e}h`}else{let e=Math.floor(a/86400),r=Math.floor(a%86400/3600);t=r>0?`${e}d${r}h`:`${e}d`}return r<0?`${t} ago`:`in ${t}`}(r.resets_at)]}),(0,t.jsx)("span",{style:{fontWeight:600,color:"var(--af-text)",marginLeft:"auto"},children:n?`${s.toFixed(0)}%`:"—"})]}),(0,t.jsx)("div",{style:{height:4,background:"var(--af-border-subtle)",borderRadius:999,overflow:"hidden"},children:(0,t.jsx)("div",{style:{height:"100%",width:n?`${s}%`:"0%",background:o,borderRadius:999,transition:"width 0.24s ease"}})})]})}let D=(0,n.default)("Megaphone",[["path",{d:"m3 11 18-5v12L3 14v-3z",key:"n962bs"}],["path",{d:"M11.6 16.8a3 3 0 1 1-5.8-1.6",key:"1yl0tm"}]]);var I=e.i(54611);function $({latestVersion:e,active:a}){let[n,s]=(0,i.useState)(!1);return(0,i.useEffect)(()=>{if(!e)return void s(!1);try{let t=window.localStorage.getItem(I.STORAGE_KEY);s(t!==e)}catch{s(!1)}},[e]),(0,t.jsxs)(r.default,{href:"/changelog","aria-label":n?"Changelog (new entries)":"Changelog",title:n?`What's new in v${e}`:"Changelog",style:{position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:6,color:a?"var(--af-text)":"var(--af-text-tertiary)",background:a?"var(--af-surface-hover)":"transparent",textDecoration:"none"},children:[(0,t.jsx)(D,{size:14}),n&&(0,t.jsx)("span",{"aria-hidden":!0,style:{position:"absolute",top:3,right:3,width:7,height:7,borderRadius:"50%",background:"#ef4444",border:"1.5px solid var(--af-surface)"}})]})}let C={green:"var(--af-success, #10b981)",amber:"var(--af-warning, #f59e0b)",red:"var(--af-error, #ef4444)"};function R({connection:e}){let a,n,[s,l]=(0,i.useState)(()=>Date.now());if((0,i.useEffect)(()=>{if(!e.paired)return;let t=setInterval(()=>l(Date.now()),3e4);return()=>clearInterval(t)},[e.paired]),!e.paired)return null;let{team:o,lastPush:d}=e,c=C[function(e,t=Date.now()){if("none"===e.kind)return"amber";if("error"===e.kind)return"red";let r=t-Date.parse(e.at);return Number.isNaN(r)||r>36e5?"red":r>9e5?"amber":"green"}(d,s)];"none"===d.kind?(a="waiting…",n="Daemon pushes every 5 minutes"):(a="error"===d.kind?`failed ${(0,v.formatRelative)(d.at)}`:`synced ${(0,v.formatRelative)(d.at)}`,n=new Date(d.at).toLocaleString());let p=[`Team: ${o.name}`,n,"error"===d.kind?`Error: ${d.error}`:"Click to inspect what's synced."];return(0,t.jsxs)(r.default,{href:"/team",title:p.join("\n"),style:{display:"flex",alignItems:"center",gap:8,padding:"8px 16px 8px 20px",borderTop:"1px solid var(--af-border-subtle)",fontSize:11,color:"var(--af-text-secondary)",textDecoration:"none",minWidth:0},children:[(0,t.jsx)("span",{"aria-hidden":!0,suppressHydrationWarning:!0,style:{width:7,height:7,borderRadius:"50%",background:c,flexShrink:0,boxShadow:`0 0 0 2px color-mix(in srgb, ${c} 25%, transparent)`}}),(0,t.jsx)("span",{style:{flexShrink:0,fontWeight:500},children:"Team:"}),(0,t.jsx)("span",{style:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:o.name}),(0,t.jsx)("span",{style:{fontSize:10,color:"var(--af-text-tertiary)",fontFamily:"var(--font-mono)",flexShrink:0},suppressHydrationWarning:!0,children:a})]})}let P="claude-lens:pinned-projects:v1";function A({href:e,active:a,icon:i,trailing:n,children:s}){return(0,t.jsxs)(r.default,{href:e,style:{display:"flex",alignItems:"center",gap:10,padding:"8px 12px",borderRadius:7,fontSize:13,fontWeight:500,color:a?"var(--af-accent)":"var(--af-text-secondary)",background:a?"var(--af-accent-subtle)":"transparent",transition:"all 0.12s"},children:[i,(0,t.jsx)("span",{style:{flex:1},children:s}),n&&(0,t.jsx)("span",{style:{fontSize:10,color:a?"var(--af-accent)":"var(--af-text-tertiary)",fontFamily:"var(--font-mono)"},children:n})]})}function N({label:e,items:a,pathname:i,isPinned:n,onTogglePin:s}){return 0===a.length?null:(0,t.jsxs)("div",{style:{marginTop:10},children:[(0,t.jsx)("div",{style:{fontSize:10,color:"var(--af-text-tertiary)",textTransform:"uppercase",letterSpacing:"0.06em",padding:"0 10px 6px",fontWeight:600},children:e}),(0,t.jsx)("div",{style:{display:"flex",flexDirection:"column"},children:a.map(e=>{let a=`/projects/${encodeURIComponent(e.projectDir)}`,l=i===a,o=(0,v.prettyProjectName)(e.projectName);return(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:4,padding:"5px 6px 5px 10px",borderRadius:6,background:l?"var(--af-accent-subtle)":"transparent",color:l?"var(--af-accent)":"var(--af-text-secondary)"},children:[(0,t.jsxs)(r.default,{href:a,style:{flex:1,minWidth:0,fontSize:12,color:"inherit",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"flex",alignItems:"center",gap:5},title:(e.worktreeCount??0)>0?`${e.projectName} — ${e.worktreeCount} worktree${1===e.worktreeCount?"":"s"}`:e.projectName,children:[(0,t.jsx)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0},children:o}),(e.worktreeCount??0)>0&&(0,t.jsxs)("span",{style:{fontSize:9,fontWeight:600,padding:"1px 5px",borderRadius:100,background:"rgba(167, 139, 250, 0.15)",color:"rgba(167, 139, 250, 1)",flexShrink:0},children:["+",e.worktreeCount," wt"]})]}),(0,t.jsx)("span",{style:{fontSize:10,color:"var(--af-text-tertiary)",fontFamily:"var(--font-mono)",marginLeft:4},children:e.sessionCount}),(0,t.jsx)("button",{type:"button",onClick:t=>{t.preventDefault(),t.stopPropagation(),s(e.projectDir)},"aria-label":n(e.projectDir)?"Unpin project":"Pin project",title:n(e.projectDir)?"Unpin":"Pin",style:{background:"transparent",border:"none",padding:3,borderRadius:4,color:n(e.projectDir)?"var(--af-accent)":"var(--af-text-tertiary)",display:"flex",alignItems:"center"},children:n(e.projectDir)?(0,t.jsx)(c,{size:12}):(0,t.jsx)(d,{size:12})}),e.lastActiveMs&&(0,t.jsx)("span",{style:{fontSize:9,color:"var(--af-text-tertiary)",marginLeft:2,minWidth:32,textAlign:"right"},title:new Date(e.lastActiveMs).toISOString(),suppressHydrationWarning:!0,children:(0,v.formatRelative)(new Date(e.lastActiveMs).toISOString())})]},e.projectDir)})})]})}e.s(["Sidebar",0,function({projects:e,totalSessions:n,currentUsage:d,version:c,latestChangelogVersion:v,teamConnection:b}){let j=(0,a.usePathname)(),[w,k]=(0,i.useState)(new Set),[z,M]=(0,i.useState)(!1),[W,D]=(0,i.useState)("");(0,i.useEffect)(()=>{k(function(){try{let e=window.localStorage.getItem(P);if(!e)return new Set;let t=JSON.parse(e);return new Set(Array.isArray(t)?t:[])}catch{return new Set}}()),M(!0)},[]);let I=e=>{k(t=>{let r=new Set(t);r.has(e)?r.delete(e):r.add(e);try{window.localStorage.setItem(P,JSON.stringify(Array.from(r)))}catch{}return r})},C=(0,i.useMemo)(()=>{if(!W.trim())return e;let t=W.toLowerCase();return e.filter(e=>e.projectName.toLowerCase().includes(t))},[e,W]),F=C.filter(e=>w.has(e.projectDir)),O=C.filter(e=>!w.has(e.projectDir));return(0,t.jsxs)("aside",{style:{width:260,flexShrink:0,borderRight:"1px solid var(--af-border-subtle)",background:"var(--af-surface)",display:"flex",flexDirection:"column",position:"sticky",top:0,height:"100vh"},children:[(0,t.jsx)("div",{style:{padding:"18px 20px 12px",borderBottom:"1px solid var(--af-border-subtle)"},children:(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10},children:[(0,t.jsx)("div",{style:{width:28,height:28,borderRadius:7,background:"var(--af-accent-subtle)",display:"flex",alignItems:"center",justifyContent:"center",color:"var(--af-accent)"},children:(0,t.jsx)(u,{size:16,strokeWidth:2.25})}),(0,t.jsxs)("div",{style:{minWidth:0,flex:1},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:6},children:[(0,t.jsx)("span",{style:{fontSize:14,fontWeight:700,letterSpacing:"-0.01em"},children:"Fleetlens"}),(0,t.jsxs)("span",{style:{fontSize:10,color:"var(--af-text-tertiary)",fontFamily:"var(--font-mono)",fontWeight:500},title:`fleetlens ${c}`,children:["v",c]})]}),(0,t.jsx)("div",{style:{fontSize:11,color:"var(--af-text-tertiary)"},children:"Multi-agent fleet analytics"})]})]})}),(0,t.jsxs)("nav",{style:{padding:"10px 10px 6px",display:"flex",flexDirection:"column",gap:2},children:[(0,t.jsx)(A,{href:"/",active:"/"===j,icon:(0,t.jsx)(s,{size:15}),children:"Overview"}),(0,t.jsx)(A,{href:"/sessions",active:"/sessions"===j||j.startsWith("/sessions/"),icon:(0,t.jsx)(l,{size:15}),trailing:n>0?String(n):void 0,children:"All sessions"}),(0,t.jsx)(A,{href:"/projects",active:"/projects"===j,icon:(0,t.jsx)(o.FolderOpen,{size:15}),trailing:e.length>0?String(e.length):void 0,children:"Projects"}),(0,t.jsx)(A,{href:"/day",active:"/day"===j||j.startsWith("/day/")||"/digest"===j||j.startsWith("/digest/")||"/parallelism"===j,icon:(0,t.jsx)(y,{size:15}),children:"Day"}),(0,t.jsx)(A,{href:"/usage",active:"/usage"===j,icon:(0,t.jsx)(h,{size:15}),children:"Usage"}),(0,t.jsx)(A,{href:"/insights",active:"/insights"===j,icon:(0,t.jsx)(f.Lightbulb,{size:15}),children:"Insights"}),(0,t.jsx)(A,{href:"/runs",active:"/runs"===j||j.startsWith("/runs/"),icon:(0,t.jsx)(x.Radio,{size:15}),children:"Runs"}),(0,t.jsx)(A,{href:"/team",active:"/team"===j||j.startsWith("/team/"),icon:(0,t.jsx)(m,{size:15}),children:"Team"})]}),(0,t.jsxs)("div",{style:{margin:"0 14px",padding:"8px 0",borderTop:"1px solid var(--af-border-subtle)",borderBottom:"1px solid var(--af-border-subtle)",display:"flex",alignItems:"center",gap:6},children:[(0,t.jsx)(p.Search,{size:13,color:"var(--af-text-tertiary)"}),(0,t.jsx)("input",{type:"text",placeholder:"Search projects",value:W,onChange:e=>D(e.target.value),style:{flex:1,background:"transparent",border:"none",padding:"4px 0",fontSize:12,color:"var(--af-text)"}})]}),(0,t.jsxs)("div",{style:{flex:1,overflow:"auto",padding:"4px 8px 20px"},children:[z&&F.length>0&&(0,t.jsx)(N,{label:"Pinned",items:F,pathname:j,isPinned:e=>w.has(e),onTogglePin:I}),(0,t.jsx)(N,{label:"Projects",items:O,pathname:j,isPinned:e=>w.has(e),onTogglePin:I})]}),(0,t.jsx)(T,{snapshot:d}),(0,t.jsx)(R,{connection:b}),(0,t.jsxs)("div",{style:{padding:"10px 16px 10px 20px",fontSize:10,color:"var(--af-text-tertiary)",borderTop:"1px solid var(--af-border-subtle)",display:"flex",alignItems:"center",gap:8},children:[(0,t.jsxs)("span",{style:{flex:1,minWidth:0},children:[n," sessions · ",e.length," projects"]}),(0,t.jsx)($,{latestVersion:v,active:"/changelog"===j}),(0,t.jsx)(r.default,{href:"/settings","aria-label":"Settings",title:"Settings",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:6,color:"/settings"===j?"var(--af-text)":"var(--af-text-tertiary)",background:"/settings"===j?"var(--af-surface-hover)":"transparent",textDecoration:"none"},children:(0,t.jsx)(g,{size:14})}),(0,t.jsx)(S,{})]})]})}],86566)},51878,e=>{"use strict";var t=e.i(18566),r=e.i(71645);e.s(["LiveRefresher",0,function(){let e,a=(0,t.useRouter)(),i=(e=(0,t.usePathname)(),e?.includes("/insights/print/")??!1),n=(0,r.useRef)(null),s=(0,r.useRef)({session:0,usage:0,team:0});return!function(e,t={}){let{enabled:a=!0}=t,i=(0,r.useRef)(e);(0,r.useEffect)(()=>{i.current=e},[e]),(0,r.useEffect)(()=>{if(!a)return;let e=new EventSource("/api/events");return e.onmessage=e=>{try{let t=JSON.parse(e.data);("session-updated"===t.type||"usage-updated"===t.type||"team-push"===t.type)&&i.current(t)}catch{}},e.onerror=()=>{},()=>{e.close()}},[a])}((0,r.useCallback)(e=>{let t="usage-updated"===e.type?"usage":"team-push"===e.type?"team":"session";e.mtimeMs<=(s.current[t]??0)||(s.current[t]=e.mtimeMs,n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{a.refresh()},400))},[a]),{enabled:!i}),(0,r.useEffect)(()=>()=>{n.current&&clearTimeout(n.current)},[]),null}],51878)},23884,e=>{"use strict";var t=e.i(18050),r=e.i(71645),a=e.i(18566),i=e.i(22016),n=e.i(56324),s=e.i(56004),l=e.i(69198),o=e.i(23614);let d="cclens-live-widget-expanded";e.s(["LiveSessionsWidget",0,function({sessions:e,entrySummaries:c={}}){let p=(0,a.usePathname)(),[u,h]=(0,r.useState)(()=>Date.now()),[f,x]=(0,r.useState)(!1);if((0,r.useEffect)(()=>{try{let e=localStorage.getItem(d);null!==e&&x("true"===e)}catch{}},[]),(0,r.useEffect)(()=>{let e=setInterval(()=>h(Date.now()),1e4);return()=>clearInterval(e)},[]),p&&/^\/sessions\/[^/]+$/.test(p))return null;let g=e.filter(e=>{let t=e.lastTimestamp?Date.parse(e.lastTimestamp):NaN,r=Math.max(Number.isNaN(t)?0:t,e.lastActivityMs&&Number.isFinite(e.lastActivityMs)?e.lastActivityMs:0);return!(r<=0)&&u-r<=45e3}).slice().sort((e,t)=>{let r=e.firstTimestamp?Date.parse(e.firstTimestamp):0;return(t.firstTimestamp?Date.parse(t.firstTimestamp):0)-r});if(0===g.length)return null;let y=f?g.slice(0,5):[],m=f?g.length-y.length:0;return(0,t.jsxs)("div",{style:{position:"fixed",right:20,bottom:20,zIndex:100,display:"flex",flexDirection:"column-reverse",gap:6,maxWidth:320,pointerEvents:"auto"},children:[(0,t.jsxs)("button",{type:"button",onClick:()=>{var e;return e=e=>!e,void x(t=>{let r=e(t);try{localStorage.setItem(d,String(r))}catch{}return r})},style:{display:"inline-flex",alignItems:"center",gap:6,padding:"5px 11px 5px 9px",background:"rgba(239, 68, 68, 0.14)",border:"1px solid rgba(239, 68, 68, 0.4)",borderRadius:100,fontSize:10,fontWeight:700,color:"#ef4444",letterSpacing:"0.06em",textTransform:"uppercase",alignSelf:"flex-end",cursor:"pointer",userSelect:"none",backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)",boxShadow:"0 2px 10px rgba(239, 68, 68, 0.15)"},title:f?"Collapse":`Show ${g.length} live session${1===g.length?"":"s"}`,children:[(0,t.jsx)("span",{style:{display:"inline-block",width:6,height:6,borderRadius:"50%",background:"#ef4444",animation:"cs-live-pulse 1.6s ease-in-out infinite"}}),"Live · ",(0,t.jsx)("span",{suppressHydrationWarning:!0,children:g.length})]}),f&&m>0&&(0,t.jsxs)("div",{style:{fontSize:10,color:"var(--af-text-tertiary)",padding:"0 4px",textAlign:"right"},children:["+",m," more live"]}),y.map(e=>{let r=c[e.id];return(0,t.jsxs)(i.default,{href:`/sessions/${e.id}`,style:{display:"block",padding:"10px 12px",background:"var(--af-surface-elevated)",border:"1px solid var(--af-border-subtle)",borderLeft:"2px solid #ef4444",borderRadius:8,boxShadow:"0 4px 16px rgba(0, 0, 0, 0.12)",textDecoration:"none",color:"var(--af-text)",fontSize:11,lineHeight:1.35,backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)"},title:(e.lastUserPreview||e.firstUserPreview||e.lastAgentPreview)??(0,n.prettyProjectName)(e.projectName),children:[r&&(0,t.jsx)("div",{onClick:e=>e.stopPropagation(),style:{marginBottom:4},children:r.outcome?(0,t.jsx)(o.OutcomePill,{outcome:r.outcome,size:"sm",label:"text",agent:e.agent}):"skipped_trivial"!==r.enrichmentStatus?(0,t.jsx)(o.OutcomePill,{outcome:null,pending:!0,sessionId:e.id,localDay:r.localDay,size:"sm",agent:e.agent}):null}),(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,fontWeight:500,color:"var(--af-text)",minWidth:0},children:[(0,t.jsx)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0},children:e.lastUserPreview||e.firstUserPreview||(0,t.jsx)("em",{style:{color:"var(--af-text-tertiary)"},children:"(no user message)"})}),(0,t.jsx)(s.TeamBadge,{session:e,linkable:!1}),(0,t.jsx)(l.AgentBadge,{agent:e.agent})]}),(0,t.jsx)("div",{style:{fontSize:10,color:"var(--af-text-secondary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",marginTop:3,fontStyle:"italic"},children:e.lastAgentPreview?(0,t.jsxs)(t.Fragment,{children:["↳ ",e.lastAgentPreview]}):(0,t.jsx)("em",{style:{color:"var(--af-text-tertiary)"},children:"waiting…"})}),(0,t.jsx)("div",{style:{fontSize:9,color:"var(--af-text-tertiary)",fontFamily:"var(--font-mono)",marginTop:4,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:(0,n.prettyProjectName)(e.projectName)})]},e.id)}),(0,t.jsx)("style",{children:`
2
+ @keyframes cs-live-pulse {
3
+ 0%, 100% { opacity: 1; transform: scale(1); }
4
+ 50% { opacity: 0.4; transform: scale(0.85); }
5
+ }
6
+ `})]})}])},62887,e=>{"use strict";var t=e.i(18050),r=e.i(71645),a=e.i(43531);let i=(0,e.i(75254).default)("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);var n=e.i(31278),s=e.i(3116),l=e.i(22016);let o="cclens-jobs-widget-expanded";function d({children:e}){return(0,t.jsx)("div",{style:{padding:"6px 14px",fontSize:9,color:"var(--af-text-tertiary)",textTransform:"uppercase",letterSpacing:"0.08em",fontWeight:700,background:"var(--af-surface)"},children:e})}function c({job:e}){let r="running"===e.status?n.Loader2:"queued"===e.status?s.Clock:"error"===e.status?i:a.Check,o="running"===e.status?"#4299e1":"queued"===e.status?"var(--af-text-tertiary)":"error"===e.status?"#f56565":"#48bb78",d=e.resultUrl&&("done"===e.status||"running"===e.status),p=d?l.default:"div",u=d?{href:e.resultUrl}:{};return(0,t.jsxs)(p,{...u,style:{display:"flex",alignItems:"flex-start",gap:10,padding:"10px 14px",borderBottom:"1px solid var(--af-border-subtle)",textDecoration:"none",color:"var(--af-text)",fontSize:11.5,cursor:d?"pointer":"default"},children:[(0,t.jsx)(r,{size:13,className:"running"===e.status?"cs-job-spin":"",style:{color:o,marginTop:2,flexShrink:0}}),(0,t.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,t.jsx)("div",{style:{fontWeight:500,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.label}),e.progress&&(0,t.jsx)("div",{style:{fontSize:10,color:"var(--af-text-tertiary)",marginTop:2,fontFamily:"var(--font-mono)"},children:function(e){if(void 0!==e.index&&void 0!==e.total)return`${e.phase} ${e.index}/${e.total}`;if(void 0!==e.bytes){let t=(e.bytes/1024).toFixed(1);return`${e.phase} \xb7 ${t}k`}return e.text?`${e.phase} \xb7 ${e.text}`:e.phase}(e.progress)}),"error"===e.status&&e.error&&(0,t.jsx)("div",{style:{fontSize:10,color:"#f56565",marginTop:2},children:e.error.length>60?e.error.slice(0,60)+"…":e.error}),"done"===e.status&&e.resultUrl&&(0,t.jsx)("div",{style:{fontSize:10,color:"var(--af-accent)",marginTop:2},children:"View →"})]})]})}e.s(["JobQueueWidget",0,function(){let[e,a]=(0,r.useState)([]),[i,s]=(0,r.useState)(!1);(0,r.useEffect)(()=>{try{let e=localStorage.getItem(o);null!==e&&s("true"===e)}catch{}},[]),(0,r.useEffect)(()=>{let e=!0,t=null,r=!1,i=async()=>{try{let t=await fetch("/api/jobs",{cache:"no-store"});if(!t.ok)return;let i=await t.json();if(!e)return;a(i.jobs),r=i.jobs.some(e=>"running"===e.status||"queued"===e.status)}catch{}},n=()=>{e&&(t=setTimeout(async()=>{await i(),n()},r?1500:6e3))};return i().then(n),()=>{e=!1,t&&clearTimeout(t)}},[]);let l=e.filter(e=>"running"===e.status||"queued"===e.status),p=e.filter(e=>"done"===e.status||"error"===e.status||"cancelled"===e.status).slice(0,8);return 0===l.length?null:(0,t.jsxs)("div",{style:{position:"fixed",right:140,bottom:20,zIndex:99,display:"flex",flexDirection:"column-reverse",gap:6,maxWidth:320,alignItems:"flex-end"},children:[(0,t.jsxs)("button",{type:"button",onClick:()=>{var e;return e=e=>!e,void s(t=>{let r=e(t);try{localStorage.setItem(o,String(r))}catch{}return r})},title:`${l.length} job${1===l.length?"":"s"} running — click to ${i?"collapse":"expand"}`,style:{display:"inline-flex",alignItems:"center",gap:6,padding:"5px 11px 5px 9px",background:"rgba(66, 153, 225, 0.14)",border:"1px solid rgba(66, 153, 225, 0.4)",borderRadius:100,fontSize:10,fontWeight:700,color:"#4299e1",letterSpacing:"0.06em",textTransform:"uppercase",cursor:"pointer",userSelect:"none",backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)",boxShadow:"0 2px 10px rgba(66, 153, 225, 0.15)",alignSelf:"flex-end"},children:[(0,t.jsx)(n.Loader2,{size:11,className:"cs-job-spin",style:{flexShrink:0}}),"Jobs · ",l.length]}),i&&(0,t.jsxs)("div",{style:{width:320,maxHeight:360,overflowY:"auto",background:"var(--af-surface-elevated)",border:"1px solid var(--af-border-subtle)",borderRadius:10,boxShadow:"0 8px 24px rgba(0,0,0,0.18)",backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)"},children:[l.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)(d,{children:"Running"}),l.map(e=>(0,t.jsx)(c,{job:e},e.id))]}),p.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)(d,{children:"Recent"}),p.map(e=>(0,t.jsx)(c,{job:e},e.id))]})]}),(0,t.jsx)("style",{children:`
7
+ @keyframes cs-job-spin {
8
+ from { transform: rotate(0deg); }
9
+ to { transform: rotate(360deg); }
10
+ }
11
+ .cs-job-spin {
12
+ animation: cs-job-spin 1s linear infinite;
13
+ }
14
+ `})]})}],62887)},7879,e=>{"use strict";var t=e.i(18050),r=e.i(71645);let a="fleetlens:menubar-banner-dismissed";e.s(["MenubarInstallBanner",0,function(){let[e,i]=(0,r.useState)(!0),[n,s]=(0,r.useState)(null),[l,o]=(0,r.useState)(!1),[d,c]=(0,r.useState)(null);if((0,r.useEffect)(()=>{let e=!1;return fetch("/api/menubar",{cache:"no-store"}).then(e=>e.json()).then(t=>{if(e)return;s(t);let r=window.localStorage.getItem(a);!t.supported||t.installed||r||i(!1)}).catch(()=>{}),()=>{e=!0}},[]),(0,r.useEffect)(()=>{n?.installed&&i(!0)},[n?.installed]),e)return null;async function p(){o(!0),c(null);let e=await fetch("/api/menubar",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({action:"install"})}),t=await e.json().catch(()=>null);(o(!1),e.ok)?s(t):c(t?.error??`Error ${e.status}`)}return(0,t.jsxs)("div",{role:"status",style:{padding:"10px 24px",background:"var(--af-accent-subtle)",borderBottom:"1px solid var(--af-accent)",color:"var(--af-text)",fontSize:13,display:"flex",gap:12,alignItems:"center"},children:[(0,t.jsxs)("span",{style:{flex:1},children:["Get live Claude Code / Codex / Z.ai usage in your menu bar —"," ",(0,t.jsx)("strong",{children:"install the Fleetlens widget"}),"."]}),(0,t.jsx)("button",{type:"button",className:"af-btn af-btn-primary",disabled:l,onClick:()=>void p(),style:{fontSize:12,padding:"4px 12px"},children:l?"Installing…":"Install"}),(0,t.jsx)("button",{type:"button",onClick:()=>{window.localStorage.setItem(a,"1"),i(!0)},"aria-label":"Dismiss",style:{background:"transparent",border:"none",color:"var(--af-text-tertiary)",cursor:"pointer",fontSize:16,lineHeight:1,padding:"2px 6px"},children:"×"}),d&&(0,t.jsx)("span",{style:{color:"var(--af-danger, #dc2626)"},children:d})]})}])}]);
@@ -0,0 +1,6 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,37727,e=>{"use strict";let t=(0,e.i(75254).default)("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);e.s(["X",0,t],37727)},52535,e=>{"use strict";var t=e.i(18050),r=e.i(71645);e.s(["LiveBadge",0,function({mtimeIso:e,activityMs:a,size:n="sm"}){let[i,l]=(0,r.useState)(()=>Date.now());(0,r.useEffect)(()=>{let e=setInterval(()=>l(Date.now()),1e4);return()=>clearInterval(e)},[]);let o=e?Date.parse(e):NaN,s=Math.max(Number.isNaN(o)?0:o,a&&Number.isFinite(a)?a:0);if(s<=0||i-s>45e3)return null;let d="md"===n?8:6;return(0,t.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:5,fontSize:"md"===n?10:9,fontWeight:700,letterSpacing:"0.04em",padding:"md"===n?"3px 9px":"2px 7px",borderRadius:100,background:"rgba(239, 68, 68, 0.12)",color:"#ef4444",textTransform:"uppercase"},title:`Last updated ${new Date(s).toLocaleTimeString()}`,children:[(0,t.jsx)("span",{style:{display:"inline-block",width:d,height:d,borderRadius:"50%",background:"#ef4444",animation:"cs-live-pulse 1.6s ease-in-out infinite"}}),"LIVE",(0,t.jsx)("style",{children:`
2
+ @keyframes cs-live-pulse {
3
+ 0%, 100% { opacity: 1; transform: scale(1); }
4
+ 50% { opacity: 0.4; transform: scale(0.85); }
5
+ }
6
+ `})]})}])},50682,e=>{"use strict";let t=(0,e.i(75254).default)("Github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]);e.s(["Github",0,t],50682)},33307,e=>{"use strict";var t=e.i(18050),r=e.i(71645),a=e.i(18566),n=e.i(23614);function i(e,t){if(e<=0||t<=0)return"var(--af-heatmap-0)";let r=Math.min(1,e/t),a=0;return r>.75?a=4:r>.5?a=3:r>.25?a=2:r>0&&(a=1),`var(--af-heatmap-${a})`}function l(e){let[t,r,a]=e.split("-").map(Number);return new Date(t,r-1,a)}function o(e){let t=e.getFullYear(),r=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getDate()).padStart(2,"0");return`${t}-${r}-${a}`}function s(e){return{date:e,sessions:0,toolCalls:0,turns:0,airTimeMs:0,tokens:{input:0,output:0,cacheRead:0,cacheWrite:0},durationMs:0,peakParallelism:0}}e.s(["Heatmap",0,function({buckets:e,valueKey:d="sessions",cellSize:c=13,cellGap:p=3,daySummaries:u}){let h,x,f=(0,a.useRouter)(),[g,m]=(0,r.useState)(null),{weeks:y,max:v}=(0,r.useMemo)(()=>{if(0===e.length)return{weeks:[],max:0};let t=new Date(l(e[0].date));t.setDate(t.getDate()-t.getDay());let r=new Map(e.map(e=>[e.date,e])),a=[],n=[],i=new Date,c=l(e[e.length-1].date),p=c>i?c:i,u=0;for(let e=new Date(t);e<=p;e.setDate(e.getDate()+1)){let t=o(e),i=r.get(t)??s(t),l=i[d];l>u&&(u=l),n.push(i),7===n.length&&(a.push(n),n=[])}if(n.length>0){for(;n.length<7;)n.push(s(o(new Date)));a.push(n)}return{weeks:a,max:u}},[e,d]);if(0===e.length)return(0,t.jsx)("div",{style:{padding:"32px 12px",color:"var(--af-text-tertiary)",fontSize:12,textAlign:"center"},children:"No activity yet."});let b=y.length*(c+p)+24,j=7*(c+p)+18;return(0,t.jsxs)("div",{style:{position:"relative",overflowX:"auto"},children:[(0,t.jsxs)("svg",{width:b,height:j,style:{display:"block"},children:[(0,t.jsx)("g",{fontSize:9,fill:"var(--af-text-tertiary)",children:["Mon","Wed","Fri"].map((e,r)=>(0,t.jsx)("text",{x:0,y:18+(1+2*r)*(c+p)+c-3,children:e},e))}),(0,t.jsx)("g",{transform:"translate(24, 18)",children:y.map((e,r)=>e.map((e,a)=>{let n=e[d],l=i(n,v);return(0,t.jsx)("rect",{x:r*(c+p),y:a*(c+p),width:c,height:c,rx:2.5,ry:2.5,stroke:n>0?"rgba(255,255,255,0.04)":"transparent",onMouseEnter:t=>{let r=t.currentTarget.getBoundingClientRect();m({bucket:e,x:r.left+r.width/2,y:r.top-6})},onMouseLeave:()=>m(null),onClick:()=>{n>0&&f.push(`/digest/${e.date}`)},style:{cursor:n>0?"pointer":"default",fill:l}},`${r}-${a}`)}))})]}),(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,marginTop:6,fontSize:10,color:"var(--af-text-tertiary)",justifyContent:"flex-end"},children:[(0,t.jsx)("span",{children:"Less"}),[0,.25,.5,.75,1].map((e,r)=>(0,t.jsx)("span",{style:{width:11,height:11,borderRadius:2.5,background:i(Math.max(1,e*v),v),display:"inline-block"}},r)),(0,t.jsx)("span",{children:"More"})]}),g&&(0,t.jsxs)("div",{style:{position:"fixed",left:g.x,top:g.y,transform:"translate(-50%, -100%)",background:"var(--af-surface-elevated)",border:"1px solid var(--af-border-subtle)",borderRadius:6,padding:"6px 10px",fontSize:11,color:"var(--af-text)",whiteSpace:"nowrap",pointerEvents:"none",zIndex:100,boxShadow:"0 4px 12px rgba(0,0,0,0.3)"},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:2},children:[(0,t.jsx)("span",{style:{fontWeight:600},children:g.bucket.date}),(()=>{let e=u?.get(g.bucket.date);if(!e?.outcome)return null;let r=n.OUTCOME_STYLES[e.outcome];return(0,t.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:3,padding:"1px 6px",borderRadius:99,fontSize:9,fontWeight:600,background:r.bg,color:r.fg},children:[r.icon," ",r.label]})})()]}),(h=u?.get(g.bucket.date),h?.headline?(0,t.jsxs)("div",{style:{color:"var(--af-text)",fontSize:11,fontWeight:500,marginBottom:2,maxWidth:280,whiteSpace:"normal",lineHeight:1.35},children:["“",h.headline,"”"]}):null),(0,t.jsxs)("div",{style:{color:"var(--af-text-secondary)"},children:[g.bucket.sessions," session",1===g.bucket.sessions?"":"s",g.bucket.toolCalls>0&&` \xb7 ${g.bucket.toolCalls} tool calls`,g.bucket.peakParallelism>1&&` \xb7 peak \xd7${g.bucket.peakParallelism}`]}),(x=u?.get(g.bucket.date),x?.helpfulness?(0,t.jsxs)("div",{style:{color:"var(--af-text-tertiary)",fontSize:10,marginTop:2},children:["Claude: ",x.helpfulness]}):null)]})]})}])},15781,e=>{"use strict";var t=e.i(18050),r=e.i(71645);function a(e){if(e<1e3)return`${Math.round(e)}ms`;let t=Math.round(e/1e3);if(t<60)return`${t}s`;let r=Math.floor(t/60),a=t%60;if(r<60)return a?`${r}m ${a}s`:`${r}m`;let n=Math.floor(r/60),i=r%60;return i?`${n}h ${i}m`:`${n}h`}let n={airTime:{label:"Agent time",pluck:e=>e.airTimeMs,color:"rgba(45, 212, 191, 0.85)",unit:"ms"},sessions:{label:"Sessions",pluck:e=>e.sessions,color:"rgba(94, 234, 212, 0.85)"},toolCalls:{label:"Tool calls",pluck:e=>e.toolCalls,color:"rgba(167, 139, 250, 0.85)"},turns:{label:"Turns",pluck:e=>e.turns,color:"rgba(251, 191, 36, 0.85)"},input:{label:"Input tokens",pluck:e=>e.tokens.input,color:"rgba(52, 211, 153, 0.85)"},output:{label:"Output tokens",pluck:e=>e.tokens.output,color:"rgba(248, 113, 113, 0.85)"},cacheRead:{label:"Cache read",pluck:e=>e.tokens.cacheRead,color:"rgba(129, 104, 224, 0.85)"}};e.s(["ActivityChart",0,function({buckets:e,defaultMetric:i="sessions",height:l=160}){let[o,s]=(0,r.useState)(i),[d,c]=(0,r.useState)(null),p=n[o],{bars:u,maxVal:h}=(0,r.useMemo)(()=>{let t=0;return{bars:e.map(e=>{let r=p.pluck(e);return r>t&&(t=r),{bucket:e,value:r}}),maxVal:t}},[e,p]);if(0===e.length)return(0,t.jsx)("div",{style:{padding:"32px 12px",color:"var(--af-text-tertiary)",fontSize:12,textAlign:"center"},children:"No activity yet."});let x=Math.max(3,Math.floor((600-2*u.length)/Math.max(1,u.length))),f=48+Math.max(u.length*(x+2),600)+8,g=l-10-22;return(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{style:{display:"flex",gap:4,background:"var(--background)",borderRadius:7,padding:3,marginBottom:10},children:Object.keys(n).map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>s(e),style:{fontSize:11,padding:"5px 10px",border:"none",borderRadius:5,background:o===e?"var(--af-surface-elevated)":"transparent",color:o===e?"var(--af-text)":"var(--af-text-tertiary)",fontWeight:500},children:n[e].label},e))}),(0,t.jsxs)("div",{style:{position:"relative",overflowX:"auto"},children:[d&&(0,t.jsxs)("div",{style:{position:"absolute",left:d.x,top:0,transform:"translateX(-50%)",background:"var(--af-surface-elevated)",border:"1px solid var(--af-border-subtle)",borderRadius:6,padding:"4px 8px",fontSize:11,color:"var(--af-text-secondary)",fontFamily:"var(--font-mono)",whiteSpace:"nowrap",pointerEvents:"none",zIndex:10,boxShadow:"0 2px 8px rgba(0,0,0,0.08)"},children:[d.bucket.date," ·"," ","ms"===p.unit?a(d.value):d.value.toLocaleString()]}),(0,t.jsxs)("svg",{width:f,height:l,style:{display:"block"},children:[(0,t.jsx)("g",{fontSize:10,fill:"var(--af-text-tertiary)",children:[0,.25,.5,.75,1].map(e=>{let r=10+(1-e)*g,n=h*e,i="ms"===p.unit?a(n):n>=1e6?`${(n/1e6).toFixed(1)}M`:n>=1e3?`${(n/1e3).toFixed(1)}k`:Math.round(n).toString();return(0,t.jsxs)("g",{children:[(0,t.jsx)("line",{x1:48,x2:f-8,y1:r,y2:r,stroke:"var(--af-border-subtle)",strokeDasharray:0===e?void 0:"2 3"}),(0,t.jsx)("text",{x:42,y:r+3,textAnchor:"end",children:i})]},e)})}),u.map((e,r)=>{let a=h>0?e.value/h*g:0,n=48+r*(x+2),i=d?.bucket.date===e.bucket.date;return(0,t.jsxs)("g",{children:[(0,t.jsx)("rect",{x:n,y:10,width:x,height:g,fill:"transparent",onMouseEnter:()=>c({bucket:e.bucket,value:e.value,x:n+x/2}),onMouseLeave:()=>c(null)}),(0,t.jsx)("rect",{x:n,y:10+g-a,width:x,height:Math.max(.5,a),fill:i?"var(--af-accent)":p.color,rx:1.5*(x>=6),ry:1.5*(x>=6),style:{pointerEvents:"none"}})]},e.bucket.date)}),(0,t.jsx)("g",{fontSize:10,fill:"var(--af-text-tertiary)",children:u.map((e,r)=>{let a=e.bucket.date,n=0===r,i=r===u.length-1,o="01"===a.slice(-2),s=u.length>3&&u.length<=31&&r===Math.floor(u.length/2)&&!u.some(e=>"01"===e.bucket.date.slice(-2));if(!n&&!i&&!o&&!s)return null;let d=48+r*(x+2)+x/2,c=new Date(`${a}T00:00:00`).toLocaleDateString(void 0,{month:"short",day:"numeric"});return(0,t.jsx)("text",{x:n?48:i?f-8:d,y:l-6,textAnchor:n?"start":i?"end":"middle",children:c},a)})})]})]})]})}])},74829,e=>{"use strict";var t=e.i(18050),r=e.i(71645);let a=(0,e.i(75254).default)("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);e.s(["MetricCard",0,function({label:e,value:n,sub:i,icon:l,tooltip:o}){let[s,d]=(0,r.useState)(!1);return(0,t.jsxs)("div",{className:"af-card",style:{padding:"16px 18px",position:"relative"},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,fontSize:11,color:"var(--af-text-tertiary)",textTransform:"uppercase",letterSpacing:"0.05em",fontWeight:600},children:[l,(0,t.jsx)("span",{children:e}),o&&(0,t.jsx)("span",{style:{marginLeft:"auto",cursor:"help",display:"inline-flex",color:"var(--af-text-tertiary)",opacity:.5,transition:"opacity 0.12s"},onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),onClick:()=>d(e=>!e),children:(0,t.jsx)(a,{size:12})})]}),(0,t.jsx)("div",{style:{fontSize:22,fontWeight:700,marginTop:8,letterSpacing:"-0.02em",lineHeight:1.1},children:n}),i&&(0,t.jsx)("div",{style:{fontSize:11,color:"var(--af-text-secondary)",marginTop:4},children:i}),s&&o&&(0,t.jsx)("div",{style:{position:"absolute",top:"calc(100% + 6px)",left:0,right:0,zIndex:50,background:"#0F172A",color:"#F1F5F9",borderRadius:8,padding:"10px 12px",fontSize:11,lineHeight:1.5,boxShadow:"0 6px 24px rgba(15,23,42,0.22)",pointerEvents:"none"},children:o.split("\n").map((e,r)=>(0,t.jsx)("div",{children:e},r))})]})}],74829)},59460,e=>{"use strict";var t=e.i(18050),r=e.i(71645),a=e.i(75505),n=e.i(50682),i=e.i(37727),l=e.i(56324);let o={border:"1px solid var(--af-border-subtle)",borderRadius:999,padding:"1px 7px",fontSize:10,whiteSpace:"nowrap"};e.s(["ProjectLocalFoldersButton",0,function({projectKey:e,folders:s}){let[d,c]=(0,r.useState)(!1),[p,u]=(0,r.useState)({kind:"idle"});async function h(t){u({kind:"opening",path:t});let r=await fetch("/api/projects/open-folder",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({projectKey:e,path:t})}),a=await r.json().catch(()=>null);r.ok?u({kind:"opened",path:t}):u({kind:"error",path:t,message:a?.error??"Could not open this folder."})}return(0,r.useEffect)(()=>{if(!d)return;let e=e=>{"Escape"===e.key&&c(!1)};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[d]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("button",{type:"button",className:"af-btn",onClick:()=>c(!0),style:{display:"inline-flex",alignItems:"center",gap:7,whiteSpace:"nowrap"},children:[(0,t.jsx)(a.FolderOpen,{size:14}),"Local folders",(0,t.jsx)("span",{style:{fontFamily:"var(--font-mono)",fontSize:11,color:"var(--af-text-tertiary)"},children:s.length})]}),d&&(0,t.jsx)("div",{role:"dialog","aria-modal":"true","aria-labelledby":"local-folders-title",onClick:()=>c(!1),style:{position:"fixed",inset:0,zIndex:220,background:"rgba(0, 0, 0, 0.5)",backdropFilter:"blur(4px)",WebkitBackdropFilter:"blur(4px)",display:"flex",alignItems:"center",justifyContent:"center",padding:20},children:(0,t.jsxs)("div",{onClick:e=>e.stopPropagation(),style:{background:"var(--af-surface-elevated)",border:"1px solid var(--af-border-subtle)",borderRadius:10,width:"min(860px, 100%)",maxHeight:"86vh",display:"flex",flexDirection:"column",boxShadow:"0 18px 54px rgba(0, 0, 0, 0.35)"},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:16,padding:"16px 20px",borderBottom:"1px solid var(--af-border-subtle)"},children:[(0,t.jsxs)("div",{style:{minWidth:0},children:[(0,t.jsx)("h2",{id:"local-folders-title",style:{margin:0,fontSize:16,fontWeight:700,letterSpacing:"-0.01em"},children:"Aggregated local folders"}),(0,t.jsx)("p",{style:{margin:"4px 0 0",fontSize:12,color:"var(--af-text-tertiary)"},children:"Folders from sessions that currently roll up into this project."})]}),(0,t.jsx)("button",{type:"button",onClick:()=>c(!1),"aria-label":"Close",style:{background:"transparent",border:"none",color:"var(--af-text-tertiary)",cursor:"pointer",padding:4,lineHeight:0},children:(0,t.jsx)(i.X,{size:18})})]}),(0,t.jsx)("div",{style:{overflow:"auto",padding:14},children:0===s.length?(0,t.jsx)("div",{className:"af-empty",children:"No local folders were found for this project."}):(0,t.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:10},children:s.map(e=>{var r;let a,i="opening"===p.kind&&p.path===e.path,s="opened"===p.kind&&p.path===e.path,d="error"===p.kind&&p.path===e.path;return(0,t.jsxs)("div",{style:{border:"1px solid var(--af-border-subtle)",borderRadius:8,background:"var(--af-surface)",padding:12,display:"grid",gridTemplateColumns:"minmax(0, 1fr) auto",gap:12,alignItems:"start"},children:[(0,t.jsxs)("div",{style:{minWidth:0},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:6},children:[(0,t.jsx)("span",{style:{fontSize:12,fontWeight:700,color:"var(--af-text)"},children:(a=(r=e.path).split("/").filter(Boolean)).length>=2?`${a.at(-2)}/${a.at(-1)}`:r}),e.worktreeNames.map(e=>(0,t.jsxs)("span",{style:{...o,color:"var(--af-text-secondary)"},children:["worktree: ",e]},e)),e.branch&&(0,t.jsx)("span",{title:e.branch===e.defaultBranch?"on the default branch":`default branch is ${e.defaultBranch??"unknown"}`,style:{...o,fontFamily:"var(--font-mono)",color:e.branch===e.defaultBranch?"var(--af-text-tertiary)":"var(--af-text)"},children:e.branch}),!e.exists&&(0,t.jsx)("span",{title:"This folder is gone from disk. Its sessions still count toward the project.",style:{...o,color:"var(--af-danger)",borderColor:"var(--af-danger)"},children:"gone"})]}),(0,t.jsx)("div",{title:e.path,style:{fontFamily:"var(--font-mono)",fontSize:11,color:"var(--af-text-secondary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",marginBottom:8},children:e.path}),(0,t.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"92px minmax(0, 1fr)",rowGap:5,columnGap:10,fontSize:11,color:"var(--af-text-tertiary)"},children:[(0,t.jsx)("span",{children:"Grouped via"}),(0,t.jsx)("span",{style:{color:"var(--af-text-secondary)"},children:e.reasons.join(", ")}),(0,t.jsx)("span",{children:"Into"}),(0,t.jsx)("span",{title:e.canonicalProject,style:{fontFamily:"var(--font-mono)",color:"var(--af-text-secondary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.canonicalProject}),(0,t.jsx)("span",{children:"Sessions"}),(0,t.jsxs)("span",{style:{color:"var(--af-text-secondary)"},children:[e.sessionCount," session",1===e.sessionCount?"":"s"," | ",e.agents.join(", "),e.lastTimestamp?` | ${(0,l.formatRelative)(e.lastTimestamp)}`:""]}),e.remote&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{children:"Remote"}),(0,t.jsxs)("span",{style:{fontFamily:"var(--font-mono)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[(0,t.jsxs)("a",{href:e.remote.webUrl,target:"_blank",rel:"noreferrer",title:e.remote.url,style:{color:"var(--af-text-secondary)",display:"inline-flex",alignItems:"center",gap:5},children:["github.com"===e.remote.host&&(0,t.jsx)(n.Github,{size:11,"aria-label":"GitHub"}),e.remote.owner,"/",e.remote.name]}),"github.com"!==e.remote.host&&(0,t.jsxs)("span",{style:{color:"var(--af-text-tertiary)"},children:[" · ",e.remote.host]})]})]}),(0,t.jsx)("span",{children:"Transcript dir"}),(0,t.jsx)("span",{title:e.projectDirs.join(", "),style:{fontFamily:"var(--font-mono)",color:"var(--af-text-secondary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.projectDirs.join(", ")})]}),d&&(0,t.jsx)("div",{style:{marginTop:8,fontSize:11,color:"var(--af-danger)"},children:p.message}),s&&(0,t.jsx)("div",{style:{marginTop:8,fontSize:11,color:"var(--af-accent)"},children:"Folder opened."})]}),(0,t.jsx)("button",{type:"button",className:"af-btn",disabled:!e.canOpen||i,onClick:()=>h(e.path),style:{whiteSpace:"nowrap"},children:i?"Opening...":"Open folder"})]},e.path)})})})]})})]})}])}]);