fleetlens 0.13.0 → 0.13.1

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 (205) hide show
  1. package/app/apps/web/.next/BUILD_ID +1 -1
  2. package/app/apps/web/.next/build-manifest.json +8 -8
  3. package/app/apps/web/.next/prerender-manifest.json +3 -3
  4. package/app/apps/web/.next/server/app/_global-error/page/build-manifest.json +5 -5
  5. package/app/apps/web/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  6. package/app/apps/web/.next/server/app/_global-error.html +1 -1
  7. package/app/apps/web/.next/server/app/_global-error.rsc +7 -7
  8. package/app/apps/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +2 -2
  9. package/app/apps/web/.next/server/app/_global-error.segments/_full.segment.rsc +7 -7
  10. package/app/apps/web/.next/server/app/_global-error.segments/_head.segment.rsc +3 -3
  11. package/app/apps/web/.next/server/app/_global-error.segments/_index.segment.rsc +3 -3
  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/build-manifest.json +5 -5
  14. package/app/apps/web/.next/server/app/_not-found/page.js +1 -1
  15. package/app/apps/web/.next/server/app/_not-found/page.js.nft.json +1 -1
  16. package/app/apps/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  17. package/app/apps/web/.next/server/app/api/ask/route.js.nft.json +1 -1
  18. package/app/apps/web/.next/server/app/api/digest/day/[date]/route.js +1 -1
  19. package/app/apps/web/.next/server/app/api/digest/day/[date]/route.js.nft.json +1 -1
  20. package/app/apps/web/.next/server/app/api/digest/month/[yearMonth]/route.js +1 -1
  21. package/app/apps/web/.next/server/app/api/digest/month/[yearMonth]/route.js.nft.json +1 -1
  22. package/app/apps/web/.next/server/app/api/digest/month-index/route.js.nft.json +1 -1
  23. package/app/apps/web/.next/server/app/api/digest/week/[startDate]/route.js +1 -1
  24. package/app/apps/web/.next/server/app/api/digest/week/[startDate]/route.js.nft.json +1 -1
  25. package/app/apps/web/.next/server/app/api/digest/week-index/route.js.nft.json +1 -1
  26. package/app/apps/web/.next/server/app/api/events/route.js.nft.json +1 -1
  27. package/app/apps/web/.next/server/app/api/jobs/route.js.nft.json +1 -1
  28. package/app/apps/web/.next/server/app/api/pdf/[key]/route.js.nft.json +1 -1
  29. package/app/apps/web/.next/server/app/api/runs/[runId]/route.js.nft.json +1 -1
  30. package/app/apps/web/.next/server/app/api/runs/[runId]/stream/route.js.nft.json +1 -1
  31. package/app/apps/web/.next/server/app/api/runs/route.js.nft.json +1 -1
  32. package/app/apps/web/.next/server/app/api/settings/route.js.nft.json +1 -1
  33. package/app/apps/web/.next/server/app/api/team-config/route.js.nft.json +1 -1
  34. package/app/apps/web/.next/server/app/api/workflow-agent/route.js.nft.json +1 -1
  35. package/app/apps/web/.next/server/app/changelog/page/build-manifest.json +5 -5
  36. package/app/apps/web/.next/server/app/changelog/page.js +1 -1
  37. package/app/apps/web/.next/server/app/changelog/page.js.nft.json +1 -1
  38. package/app/apps/web/.next/server/app/changelog/page_client-reference-manifest.js +1 -1
  39. package/app/apps/web/.next/server/app/day/[date]/page/build-manifest.json +5 -5
  40. package/app/apps/web/.next/server/app/day/[date]/page.js +1 -1
  41. package/app/apps/web/.next/server/app/day/[date]/page.js.nft.json +1 -1
  42. package/app/apps/web/.next/server/app/day/[date]/page_client-reference-manifest.js +1 -1
  43. package/app/apps/web/.next/server/app/day/page/build-manifest.json +5 -5
  44. package/app/apps/web/.next/server/app/day/page.js +1 -1
  45. package/app/apps/web/.next/server/app/day/page.js.nft.json +1 -1
  46. package/app/apps/web/.next/server/app/day/page_client-reference-manifest.js +1 -1
  47. package/app/apps/web/.next/server/app/digest/[date]/page/build-manifest.json +5 -5
  48. package/app/apps/web/.next/server/app/digest/[date]/page.js +1 -1
  49. package/app/apps/web/.next/server/app/digest/[date]/page.js.nft.json +1 -1
  50. package/app/apps/web/.next/server/app/digest/[date]/page_client-reference-manifest.js +1 -1
  51. package/app/apps/web/.next/server/app/digest/page/build-manifest.json +5 -5
  52. package/app/apps/web/.next/server/app/digest/page.js +1 -1
  53. package/app/apps/web/.next/server/app/digest/page.js.nft.json +1 -1
  54. package/app/apps/web/.next/server/app/digest/page_client-reference-manifest.js +1 -1
  55. package/app/apps/web/.next/server/app/insights/[key]/page/build-manifest.json +5 -5
  56. package/app/apps/web/.next/server/app/insights/[key]/page.js +1 -1
  57. package/app/apps/web/.next/server/app/insights/[key]/page.js.nft.json +1 -1
  58. package/app/apps/web/.next/server/app/insights/[key]/page_client-reference-manifest.js +1 -1
  59. package/app/apps/web/.next/server/app/insights/page/build-manifest.json +5 -5
  60. package/app/apps/web/.next/server/app/insights/page.js +3 -2
  61. package/app/apps/web/.next/server/app/insights/page.js.nft.json +1 -1
  62. package/app/apps/web/.next/server/app/insights/page_client-reference-manifest.js +1 -1
  63. package/app/apps/web/.next/server/app/page/build-manifest.json +5 -5
  64. package/app/apps/web/.next/server/app/page.js +1 -1
  65. package/app/apps/web/.next/server/app/page.js.nft.json +1 -1
  66. package/app/apps/web/.next/server/app/page_client-reference-manifest.js +1 -1
  67. package/app/apps/web/.next/server/app/parallelism/page/build-manifest.json +5 -5
  68. package/app/apps/web/.next/server/app/parallelism/page.js +1 -1
  69. package/app/apps/web/.next/server/app/parallelism/page.js.nft.json +1 -1
  70. package/app/apps/web/.next/server/app/parallelism/page_client-reference-manifest.js +1 -1
  71. package/app/apps/web/.next/server/app/print/[key]/page/build-manifest.json +5 -5
  72. package/app/apps/web/.next/server/app/print/[key]/page.js +1 -1
  73. package/app/apps/web/.next/server/app/print/[key]/page.js.nft.json +1 -1
  74. package/app/apps/web/.next/server/app/print/[key]/page_client-reference-manifest.js +1 -1
  75. package/app/apps/web/.next/server/app/projects/[slug]/page/build-manifest.json +5 -5
  76. package/app/apps/web/.next/server/app/projects/[slug]/page.js +1 -1
  77. package/app/apps/web/.next/server/app/projects/[slug]/page.js.nft.json +1 -1
  78. package/app/apps/web/.next/server/app/projects/[slug]/page_client-reference-manifest.js +1 -1
  79. package/app/apps/web/.next/server/app/projects/page/build-manifest.json +5 -5
  80. package/app/apps/web/.next/server/app/projects/page.js +1 -1
  81. package/app/apps/web/.next/server/app/projects/page.js.nft.json +1 -1
  82. package/app/apps/web/.next/server/app/projects/page_client-reference-manifest.js +1 -1
  83. package/app/apps/web/.next/server/app/runs/page/build-manifest.json +5 -5
  84. package/app/apps/web/.next/server/app/runs/page.js +1 -1
  85. package/app/apps/web/.next/server/app/runs/page.js.nft.json +1 -1
  86. package/app/apps/web/.next/server/app/runs/page_client-reference-manifest.js +1 -1
  87. package/app/apps/web/.next/server/app/sessions/[id]/page/build-manifest.json +5 -5
  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/build-manifest.json +5 -5
  92. package/app/apps/web/.next/server/app/sessions/page.js +1 -1
  93. package/app/apps/web/.next/server/app/sessions/page.js.nft.json +1 -1
  94. package/app/apps/web/.next/server/app/sessions/page_client-reference-manifest.js +1 -1
  95. package/app/apps/web/.next/server/app/settings/page/build-manifest.json +5 -5
  96. package/app/apps/web/.next/server/app/settings/page.js +1 -1
  97. package/app/apps/web/.next/server/app/settings/page.js.nft.json +1 -1
  98. package/app/apps/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  99. package/app/apps/web/.next/server/app/team/page/build-manifest.json +5 -5
  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/build-manifest.json +5 -5
  104. package/app/apps/web/.next/server/app/usage/page.js +1 -1
  105. package/app/apps/web/.next/server/app/usage/page.js.nft.json +1 -1
  106. package/app/apps/web/.next/server/app/usage/page_client-reference-manifest.js +1 -1
  107. package/app/apps/web/.next/server/chunks/[root-of-the-server]__0gril0u._.js +9 -0
  108. package/app/apps/web/.next/server/chunks/[root-of-the-server]__0n79hpm._.js +9 -0
  109. package/app/apps/web/.next/server/chunks/[root-of-the-server]__0~utv~v._.js +9 -0
  110. package/app/apps/web/.next/server/chunks/packages_parser_dist_06d9se1._.js +1 -1
  111. package/app/apps/web/.next/server/chunks/packages_parser_dist_10ihc3~._.js +1 -1
  112. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0exckd4._.js +1 -1
  113. package/app/apps/web/.next/server/chunks/ssr/{[root-of-the-server]__0-1_njm._.js → [root-of-the-server]__0k1x-c9._.js} +2 -2
  114. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0lhwp-k._.js +8 -0
  115. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0~.f_3z._.js +3 -3
  116. package/app/apps/web/.next/server/chunks/ssr/_0kajk31._.js +1 -1
  117. package/app/apps/web/.next/server/chunks/ssr/_0s3n5mz._.js +8 -0
  118. package/app/apps/web/.next/server/chunks/ssr/_0xu2pvc._.js +1 -1
  119. package/app/apps/web/.next/server/chunks/ssr/{_0jw2sm7._.js → _12mbgs5._.js} +2 -2
  120. package/app/apps/web/.next/server/chunks/ssr/apps_web_app_day_[date]_day-view_tsx_0wjoe1u._.js +1 -1
  121. package/app/apps/web/.next/server/chunks/ssr/apps_web_app_insights_page_tsx_071kwyw._.js +3 -0
  122. package/app/apps/web/.next/server/chunks/ssr/apps_web_app_sessions_sessions-grid_tsx_0bri5x.._.js +3 -0
  123. package/app/apps/web/.next/server/chunks/ssr/apps_web_components_0l6hsch._.js +6 -0
  124. package/app/apps/web/.next/server/chunks/ssr/apps_web_lib_changelog_ts_0n7_p1d._.js +1 -1
  125. package/app/apps/web/.next/server/chunks/ssr/apps_web_lib_changelog_ts_0nb5_-s._.js +1 -1
  126. package/app/apps/web/.next/server/chunks/ssr/node_modules_lucide-react_dist_esm_icons_0cepfi8._.js +3 -0
  127. package/app/apps/web/.next/server/chunks/ssr/packages_entries_dist_node_0_271yr.js +1 -1
  128. package/app/apps/web/.next/server/chunks/ssr/packages_parser_dist_0mx_509._.js +1 -1
  129. package/app/apps/web/.next/server/middleware-build-manifest.js +8 -8
  130. package/app/apps/web/.next/server/middleware-manifest.json +5 -5
  131. package/app/apps/web/.next/server/pages/500.html +1 -1
  132. package/app/apps/web/.next/server/server-reference-manifest.js +1 -1
  133. package/app/apps/web/.next/server/server-reference-manifest.json +1 -1
  134. package/app/apps/web/.next/static/chunks/{0pzt9vemtzct8.js → 02bv_ejzhhzvp.js} +3 -3
  135. package/app/apps/web/.next/static/chunks/{07lbm-sdh9c2j.js → 0389wb_f0j78j.js} +1 -1
  136. package/app/apps/web/.next/static/chunks/03gy1evbn94qu.js +6 -0
  137. package/app/apps/web/.next/static/chunks/03rd.3cc_t~yf.js +4 -0
  138. package/app/apps/web/.next/static/chunks/{0l4e3as18eexy.js → 0g223u9amib0q.js} +1 -1
  139. package/app/apps/web/.next/static/chunks/{0h3.-_s-k0mj3.js → 0i.hc~2bj0_3d.js} +1 -1
  140. package/app/apps/web/.next/static/chunks/0m7dd-2zd9vl2.js +4 -0
  141. package/app/apps/web/.next/static/chunks/0nqklmbs5s3ax.js +6 -0
  142. package/app/apps/web/.next/static/chunks/{073081qv4uyn8.js → 0p--hzrway8~3.js} +1 -1
  143. package/app/apps/web/.next/static/chunks/0q8dg4txlzno0.js +1 -0
  144. package/app/apps/web/.next/static/chunks/{0gblp_v.kiu-..js → 0qv-gw888_5nu.js} +1 -1
  145. package/app/apps/web/.next/static/chunks/{14bjditmmrn7l.js → 0tirv_vo6q8uc.js} +1 -1
  146. package/app/apps/web/.next/static/chunks/{0qmh5da6gfm56.js → 0vz4~a~~hq399.js} +1 -1
  147. package/app/apps/web/.next/static/chunks/{0n0n.0279ot6c.js → 14vx702c32kn6.js} +1 -1
  148. package/app/apps/web/.next/static/chunks/{turbopack-0lb9w090w5ezx.js → turbopack-0mxu3~9vk.brh.js} +1 -1
  149. package/app/apps/web/app/api/digest/_shared/digest-route-helpers.ts +178 -0
  150. package/app/apps/web/app/api/digest/day/[date]/route.ts +34 -128
  151. package/app/apps/web/app/api/digest/month/[yearMonth]/route.ts +36 -121
  152. package/app/apps/web/app/api/digest/week/[startDate]/route.ts +36 -123
  153. package/app/apps/web/app/insights/page.tsx +20 -5
  154. package/app/apps/web/app/parallelism/burst-detail-modal.tsx +637 -0
  155. package/app/apps/web/app/parallelism/concurrency-info-modal.tsx +228 -0
  156. package/app/apps/web/app/parallelism/gantt-chart-utils.ts +49 -0
  157. package/app/apps/web/app/parallelism/gantt-chart.tsx +16 -902
  158. package/app/apps/web/app/sessions/[id]/session-view/colors.ts +31 -0
  159. package/app/apps/web/app/sessions/[id]/session-view/debug-list.tsx +78 -0
  160. package/app/apps/web/app/sessions/[id]/session-view/drawer.tsx +414 -0
  161. package/app/apps/web/app/sessions/[id]/session-view/entry-day-strip.tsx +124 -0
  162. package/app/apps/web/app/sessions/[id]/session-view/header-stats.tsx +217 -0
  163. package/app/apps/web/app/sessions/[id]/session-view/helpers.ts +135 -0
  164. package/app/apps/web/app/sessions/[id]/session-view/subagent-drawer.tsx +339 -0
  165. package/app/apps/web/app/sessions/[id]/session-view/token-stats.tsx +111 -0
  166. package/app/apps/web/app/sessions/[id]/session-view/tooltip.tsx +63 -0
  167. package/app/apps/web/app/sessions/[id]/session-view/types.ts +46 -0
  168. package/app/apps/web/app/sessions/[id]/session-view/workflows-shared.tsx +104 -0
  169. package/app/apps/web/app/sessions/[id]/session-view.tsx +448 -1639
  170. package/app/apps/web/app/sessions/[id]/team-tab/minimap-hover-card.tsx +201 -0
  171. package/app/apps/web/app/sessions/[id]/team-tab/minimap-idle-band.tsx +53 -0
  172. package/app/apps/web/app/sessions/[id]/team-tab/minimap-shared.ts +20 -0
  173. package/app/apps/web/app/sessions/[id]/team-tab/team-minimap.tsx +10 -265
  174. package/app/apps/web/app/sessions/sessions-grid.tsx +10 -10
  175. package/app/apps/web/components/digest-actions.tsx +103 -0
  176. package/app/apps/web/components/job-queue-widget.tsx +1 -1
  177. package/app/apps/web/components/month-digest-view.tsx +19 -64
  178. package/app/apps/web/components/searchable-select.tsx +215 -0
  179. package/app/apps/web/components/tail-mode.tsx +39 -8
  180. package/app/apps/web/components/week-digest-view.tsx +16 -71
  181. package/app/apps/web/lib/changelog-data.generated.ts +1 -1
  182. package/app/apps/web/lib/entries-index.ts +7 -8
  183. package/app/apps/web/lib/entries.ts +0 -9
  184. package/app/apps/web/lib/format.test.ts +221 -0
  185. package/app/apps/web/lib/utilization-tone.test.ts +56 -0
  186. package/app/apps/web/package.json +1 -1
  187. package/app/apps/web/tsconfig.tsbuildinfo +1 -1
  188. package/dist/daemon-worker.js +35 -43
  189. package/dist/index.js +37 -49
  190. package/package.json +1 -1
  191. package/app/apps/web/.next/server/chunks/[root-of-the-server]__04j3tng._.js +0 -9
  192. package/app/apps/web/.next/server/chunks/[root-of-the-server]__0cnh3k4._.js +0 -9
  193. package/app/apps/web/.next/server/chunks/[root-of-the-server]__132eosx._.js +0 -9
  194. package/app/apps/web/.next/server/chunks/ssr/[root-of-the-server]__136-0me._.js +0 -8
  195. package/app/apps/web/.next/server/chunks/ssr/_0w.cv64._.js +0 -8
  196. package/app/apps/web/.next/server/chunks/ssr/apps_web_components_01d-iwx._.js +0 -6
  197. package/app/apps/web/.next/server/chunks/ssr/node_modules_lucide-react_dist_esm_icons_0-lmm4p._.js +0 -3
  198. package/app/apps/web/.next/static/chunks/05k84gif3ucxm.js +0 -6
  199. package/app/apps/web/.next/static/chunks/0nnjldasalwdu.js +0 -4
  200. package/app/apps/web/.next/static/chunks/0okg13phslr1..js +0 -4
  201. package/app/apps/web/.next/static/chunks/0rnay-a.-jr8-.js +0 -1
  202. package/app/apps/web/.next/static/chunks/0snv3-2ux2xvv.js +0 -6
  203. /package/app/apps/web/.next/static/{rbp9x3iPbzrz-wxS-DAU5 → VEfemGVAQ0xCHjj15orZU}/_buildManifest.js +0 -0
  204. /package/app/apps/web/.next/static/{rbp9x3iPbzrz-wxS-DAU5 → VEfemGVAQ0xCHjj15orZU}/_clientMiddlewareManifest.js +0 -0
  205. /package/app/apps/web/.next/static/{rbp9x3iPbzrz-wxS-DAU5 → VEfemGVAQ0xCHjj15orZU}/_ssgManifest.js +0 -0
@@ -1 +1 @@
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:n,height:i=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:i,borderRadius:3,overflow:"hidden"},children:e.map(e=>{let i=e.minutes/n*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)},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/",i=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/,a=/gh\s+pr\s+create\b/i,l=/#(\d+)/,s=/--title\s+["']([^"']+)["']/;e.s(["canonicalProjectName",0,function(e){let a=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}(a);if(l)return a.slice(0,l.idx);let s=function(e){let t=r.exec(e);if(!t)return null;let n=t[1],i=+!!t[0].endsWith("/");return{canonicalEndIdx:t.index+t[0].length-n.length-1-i,workspaceName:n}}(a);if(s)return a.slice(0,s.canonicalEndIdx);let o=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 a=i.test(r[0])?r[1]??r[0]:r[0];return{canonical:e.slice(0,t)+n+a,workspaceName:a}}(a);return o?o.canonical:a},"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 i=n.blocks.find(e=>e&&"type"in e&&"tool_use"===e.type);if(!i||"tool_use"!==i.type)continue;let o=i.input,c="string"==typeof o?.command?o.command:"";if(!a.test(c))continue;let d=c.match(s),u=c.match(l);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:c.slice(0,300),prNumber:u?Number(u[1]):void 0,title:d?.[1]})}return t}])}]);
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)},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)},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:i=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:i,borderRadius:3,overflow:"hidden"},children:e.map(e=>{let i=e.minutes/n*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))})]})}])},98572,e=>{"use strict";let t=["/.claude/worktrees/","/.worktrees/","/claude/worktrees/"],r=/\/conductor\/workspaces\/[^/]+\/([^/]+)(?:\/|$)/,n="/.superset/worktrees/",i=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/,a=/gh\s+pr\s+create\b/i,l=/#(\d+)/,s=/--title\s+["']([^"']+)["']/;e.s(["canonicalProjectName",0,function(e){let a=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}(a);if(l)return a.slice(0,l.idx);let s=function(e){let t=r.exec(e);if(!t)return null;let n=t[1],i=+!!t[0].endsWith("/");return{canonicalEndIdx:t.index+t[0].length-n.length-1-i,workspaceName:n}}(a);if(s)return a.slice(0,s.canonicalEndIdx);let o=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 a=i.test(r[0])?r[1]??r[0]:r[0];return{canonical:e.slice(0,t)+n+a,workspaceName:a}}(a);return o?o.canonical:a},"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 i=n.blocks.find(e=>e&&"type"in e&&"tool_use"===e.type);if(!i||"tool_use"!==i.type)continue;let o=i.input,c="string"==typeof o?.command?o.command:"";if(!a.test(c))continue;let d=c.match(s),u=c.match(l);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:c.slice(0,300),prNumber:u?Number(u[1]):void 0,title:d?.[1]})}return t}])}]);
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,92566,e=>{"use strict";var t=e.i(18050),r=e.i(71645),n=e.i(64659),s=e.i(63059);let i=(0,e.i(75254).default)("Layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]);var a=e.i(23614),o=e.i(40484);let l={"spec-review-loop":"Spec-review loop","chunk-implementation":"Chunk implementation","research-then-build":"Research-then-build","reviewer-triad":"Reviewer triad","background-coordinated":"Background-coordinated","solo-continuation":"Solo continuation","solo-design":"Solo design","solo-build":"Solo build",mixed:"Mixed"},d={teammate:"<teammate-message>","task-notification":"<task-notification>","local-command-caveat":"<local-command-caveat>","image-attached":"[Image #N]","slash-command":"/command","handoff-prose":"Handoff prose"};function c({digest:e,entries:i,aiEnabled:l,actions:d}){let[u,g]=(0,r.useState)(!1),m=new Date(`${e.key}T12:00:00`).toLocaleDateString("en-US",{weekday:"long",month:"short",day:"numeric",year:"numeric"}),b=e.agent_min/60,v=b>=1?`${b.toFixed(1)}h`:`${Math.round(e.agent_min)}m`,j=[...i].sort((e,t)=>Date.parse(t.start_iso)-Date.parse(e.start_iso));return(0,t.jsxs)("div",{style:{maxWidth:980,margin:"0 auto",padding:"24px 40px"},children:[(0,t.jsxs)("header",{style:{marginBottom:28},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:8,fontSize:12,color:"var(--af-text-tertiary)",fontWeight:500,flexWrap:"wrap"},children:[(0,t.jsx)("span",{children:m}),(0,t.jsx)(a.OutcomePill,{outcome:e.outcome_day,size:"lg"}),(0,t.jsx)("span",{style:{color:"var(--af-text-tertiary)"},children:"·"}),(0,t.jsxs)("span",{style:{fontFamily:"var(--font-mono)",color:"var(--af-text-secondary)"},children:[v," agent time · ",e.projects.length," project",1===e.projects.length?"":"s"," · ",e.shipped.length," PR",1===e.shipped.length?"":"s"," shipped",e.concurrency_peak>1&&` \xb7 peak concurrency \xd7${e.concurrency_peak}`]}),d&&(0,t.jsx)("div",{style:{marginLeft:"auto",display:"inline-flex",alignItems:"center",gap:8},children:d})]}),e.headline?(0,t.jsx)("h1",{style:{fontSize:26,fontWeight:700,lineHeight:1.3,letterSpacing:"-0.02em",margin:"0 0 8px",maxWidth:820,color:"var(--af-text)"},children:e.headline}):(0,t.jsx)("h1",{style:{fontSize:20,color:"var(--af-text-secondary)",margin:"0 0 14px"},children:l?"No narrative yet — click Regenerate.":`Worked ${v} across ${e.projects.length} project${1===e.projects.length?"":"s"}.`}),e.day_signature&&(0,t.jsx)("p",{style:{margin:"0 0 14px",fontSize:14,fontStyle:"italic",color:"var(--af-text-secondary)",maxWidth:820,lineHeight:1.5},children:e.day_signature})]}),!l&&(0,t.jsxs)("div",{style:{padding:14,marginBottom:24,background:"var(--af-accent-subtle)",borderRadius:8,fontSize:13,color:"var(--af-text)"},children:["Enable AI features in ",(0,t.jsx)("a",{href:"/settings",style:{color:"var(--af-accent)"},children:"Settings"})," to see daily narratives."]}),e.day_signals&&(0,t.jsx)(h,{signals:e.day_signals}),(e.what_went_well||e.what_hit_friction)&&(0,t.jsxs)("section",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:24,marginBottom:28},children:[(0,t.jsx)(x,{glyph:"✓",color:"#48bb78",text:e.what_went_well,emptyLabel:"(smooth)"}),(0,t.jsx)(x,{glyph:"⚠",color:"#ed8936",text:e.what_hit_friction,emptyLabel:"(no friction)"})]}),e.narrative&&(0,t.jsx)("section",{style:{marginBottom:28,padding:"4px 0",fontSize:15,lineHeight:1.6,color:"var(--af-text)",maxWidth:760},children:e.narrative}),(0,t.jsx)("div",{style:{marginBottom:18},children:(0,t.jsxs)("button",{type:"button",onClick:()=>g(e=>!e),style:{display:"inline-flex",alignItems:"center",gap:6,padding:"5px 10px",background:"transparent",border:"1px solid var(--af-border-subtle)",borderRadius:6,fontSize:11,color:"var(--af-text-secondary)",cursor:"pointer"},children:[u?(0,t.jsx)(n.ChevronDown,{size:12}):(0,t.jsx)(s.ChevronRight,{size:12}),u?"Hide details":"Show more details"]})}),u&&(0,t.jsxs)(t.Fragment,{children:[e.suggestion&&(0,t.jsxs)("section",{style:{borderLeft:"3px solid var(--af-accent)",paddingLeft:16,marginBottom:32},children:[(0,t.jsx)("div",{style:{fontSize:11,color:"var(--af-text-tertiary)",textTransform:"uppercase",letterSpacing:"0.06em",fontWeight:600,marginBottom:6},children:"Tomorrow"}),(0,t.jsx)("div",{style:{fontSize:15,fontWeight:600,marginBottom:4,color:"var(--af-text)"},children:e.suggestion.headline}),(0,t.jsx)("div",{style:{fontSize:13,color:"var(--af-text-secondary)",lineHeight:1.5,maxWidth:760},children:e.suggestion.body})]}),e.projects.length>0&&(0,t.jsxs)("section",{style:{marginBottom:32},children:[(0,t.jsx)(p,{children:"Work breakdown"}),(0,t.jsx)("div",{style:{display:"grid",gap:6},children:e.projects.map(r=>{let n=e.shipped.filter(e=>e.project===r.display_name);return(0,t.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"140px 1fr 56px 72px",gap:12,alignItems:"center",padding:"6px 0",borderBottom:"1px solid var(--af-border-subtle)",fontSize:13},children:[(0,t.jsx)("span",{title:r.name,style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:r.display_name}),(0,t.jsx)(f,{pct:r.share_pct}),(0,t.jsxs)("span",{style:{fontFamily:"var(--font-mono)",fontSize:11,color:"var(--af-text-tertiary)",textAlign:"right"},children:[r.share_pct.toFixed(0),"%"]}),(0,t.jsx)("span",{style:{fontSize:11,color:"var(--af-text-tertiary)",textAlign:"right"},children:n.length>0?`${n.length} PR${1===n.length?"":"s"}`:"—"})]},r.name)})})]}),e.shipped.length>0&&(0,t.jsxs)("section",{style:{marginBottom:32},children:[(0,t.jsx)(p,{children:"Shipped"}),(0,t.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none"},children:e.shipped.map((e,r)=>(0,t.jsxs)("li",{style:{padding:"6px 0",fontSize:13,borderBottom:"1px solid var(--af-border-subtle)",display:"flex",gap:10,alignItems:"baseline"},children:[(0,t.jsx)("span",{style:{color:"#48bb78",fontSize:12},children:"✓"}),(0,t.jsx)("span",{style:{flex:1},children:e.title}),(0,t.jsx)("span",{style:{fontSize:11,color:"var(--af-text-tertiary)"},children:e.project})]},r))})]}),j.length>0&&(0,t.jsxs)("section",{style:{marginBottom:32},children:[(0,t.jsxs)(p,{children:["Sessions · ",j.length]}),(0,t.jsx)("div",{style:{display:"flex",flexDirection:"column"},children:j.map(e=>(0,t.jsx)(y,{entry:e},e.session_id))})]}),e.top_goal_categories.length>0&&(0,t.jsxs)("section",{style:{marginTop:40,paddingTop:20,borderTop:"1px solid var(--af-border-subtle)"},children:[(0,t.jsx)("div",{style:{fontSize:11,color:"var(--af-text-tertiary)",marginBottom:6},children:"Goal mix"}),(0,t.jsx)(o.GoalBar,{goals:e.top_goal_categories,total:e.agent_min})]})]})]})}function p({children:e}){return(0,t.jsx)("div",{style:{fontSize:10,color:"var(--af-text-tertiary)",textTransform:"uppercase",letterSpacing:"0.08em",fontWeight:600,marginBottom:10},children:e})}function x({glyph:e,color:r,text:n,emptyLabel:s}){return(0,t.jsxs)("div",{style:{fontSize:14,lineHeight:1.55,display:"flex",gap:8,alignItems:"flex-start"},children:[(0,t.jsx)("span",{style:{fontSize:16,color:r,lineHeight:1.4,flexShrink:0},children:e}),n?(0,t.jsx)("span",{style:{color:"var(--af-text)"},children:n}):(0,t.jsx)("span",{style:{color:"var(--af-text-tertiary)",fontStyle:"italic"},children:s})]})}function f({pct:e}){return(0,t.jsx)("div",{style:{height:6,background:"var(--af-border-subtle)",borderRadius:99,overflow:"hidden"},children:(0,t.jsx)("div",{style:{width:`${Math.min(100,Math.max(0,e))}%`,height:"100%",background:"var(--af-accent)",transition:"width 0.2s"}})})}function h({signals:e}){let r=null!==e.dominant_shape,n=Object.keys(e.shape_distribution).length>0,s=e.user_authored_subagents_used.length>0||Object.keys(e.shape_distribution).length>0,i=e.skills_loaded.filter(e=>"stock"===e.origin),a=e.skills_loaded.filter(e=>"user"===e.origin),o=e.prompt_frames.filter(e=>"claude-feature"===e.origin),c=e.prompt_frames.filter(e=>"personal-habit"===e.origin),p=e.comm_style,x=p.verbosity_distribution.short+p.verbosity_distribution.medium+p.verbosity_distribution.long+p.verbosity_distribution.very_long,f=p.steering.interrupts+p.steering.frustrated+p.steering.dissatisfied;return r||n||0!==i.length||0!==a.length||0!==e.user_authored_subagents_used.length||0!==o.length||0!==c.length||0!==x||0!==p.external_refs.length||0!==f||0!==e.brainstorm_warmup_session_count||0!==e.todo_ops_total||e.plan_mode_used?(0,t.jsxs)("section",{style:{marginBottom:28,padding:"14px 16px",borderRadius:8,background:"var(--af-surface)",border:"1px solid var(--af-border-subtle)"},children:[(0,t.jsx)("div",{style:{fontSize:10,color:"var(--af-text-tertiary)",textTransform:"uppercase",letterSpacing:"0.08em",fontWeight:600,marginBottom:10},children:"How today worked"}),r&&(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,flexWrap:"wrap",marginBottom:8},children:[(0,t.jsx)("span",{style:{display:"inline-flex",alignItems:"center",padding:"3px 10px",borderRadius:999,fontSize:12,fontWeight:600,background:"var(--af-accent-subtle)",color:"var(--af-accent)"},children:l[e.dominant_shape]??e.dominant_shape}),n&&(0,t.jsx)("span",{style:{fontSize:12,color:"var(--af-text-secondary)",fontFamily:"var(--font-mono)"},children:Object.entries(e.shape_distribution).sort((e,t)=>t[1]-e[1]).map(([e,t])=>`${t} ${e}`).join(" · ")})]}),s&&e.user_authored_subagents_used.length>0&&(0,t.jsx)(u,{label:"Your subagents",children:e.user_authored_subagents_used.slice(0,4).map(e=>(0,t.jsxs)(g,{title:e.sample_prompt_preview,children:[e.type,e.count>1?` \xd7${e.count}`:""]},e.type))}),(i.length>0||a.length>0)&&(0,t.jsxs)(u,{label:"Skills loaded",children:[a.slice(0,4).map(e=>(0,t.jsxs)(g,{tone:"user",children:[e.skill,e.count>1?` \xd7${e.count}`:""]},e.skill)),i.slice(0,4).map(e=>(0,t.jsxs)(g,{tone:"stock",children:[e.skill,e.count>1?` \xd7${e.count}`:""]},e.skill))]}),(o.length>0||c.length>0)&&(0,t.jsxs)(u,{label:"Prompt frames",children:[c.map(e=>(0,t.jsxs)(g,{tone:"user",children:[d[e.frame]??e.frame,e.count>1?` \xd7${e.count}`:""]},e.frame)),o.map(e=>(0,t.jsxs)(g,{tone:"stock",children:[d[e.frame]??e.frame,e.count>1?` \xd7${e.count}`:""]},e.frame))]}),(x>0||p.external_refs.length>0||f>0)&&(0,t.jsxs)(u,{label:"Comm style",children:[x>0&&(0,t.jsx)("span",{style:{fontSize:12,color:"var(--af-text-secondary)",fontFamily:"var(--font-mono)"},children:[p.verbosity_distribution.short&&`${p.verbosity_distribution.short} short`,p.verbosity_distribution.medium&&`${p.verbosity_distribution.medium} med`,p.verbosity_distribution.long&&`${p.verbosity_distribution.long} long`,p.verbosity_distribution.very_long&&`${p.verbosity_distribution.very_long} v.long`].filter(Boolean).join(" · ")}),p.external_refs.length>0&&(0,t.jsxs)(g,{children:[p.external_refs.length," external ref",1===p.external_refs.length?"":"s"]}),p.steering.interrupts>0&&(0,t.jsxs)(g,{children:[p.steering.interrupts," interrupts"]}),p.steering.sessions_with_mid_run_redirect>0&&(0,t.jsxs)(g,{children:[p.steering.sessions_with_mid_run_redirect," mid-run redirect",1===p.steering.sessions_with_mid_run_redirect?"":"s"]})]}),(e.brainstorm_warmup_session_count>0||e.todo_ops_total>0||e.plan_mode_used)&&(0,t.jsxs)(u,{label:"Discipline",children:[e.brainstorm_warmup_session_count>0&&(0,t.jsxs)(g,{children:["brainstorm warmup ×",e.brainstorm_warmup_session_count]}),e.todo_ops_total>0&&(0,t.jsxs)(g,{children:[e.todo_ops_total," TodoWrite ops"]}),e.plan_mode_used&&(0,t.jsx)(g,{tone:"user",children:"Plan Mode used"})]})]}):null}function u({label:e,children:r}){return(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,flexWrap:"wrap",padding:"4px 0",fontSize:12},children:[(0,t.jsx)("span",{style:{minWidth:100,color:"var(--af-text-tertiary)",fontWeight:500,fontSize:11,textTransform:"uppercase",letterSpacing:"0.04em"},children:e}),(0,t.jsx)("div",{style:{display:"flex",gap:6,flexWrap:"wrap",flex:1},children:r})]})}function g({children:e,tone:r,title:n}){return(0,t.jsx)("span",{title:n,style:{display:"inline-flex",alignItems:"center",padding:"2px 8px",borderRadius:999,fontSize:11,fontFamily:"var(--font-mono)",background:"user"===r?"var(--af-accent-subtle)":"var(--af-border-subtle)",color:"user"===r?"var(--af-accent)":"var(--af-text-secondary)",whiteSpace:"nowrap",maxWidth:280,overflow:"hidden",textOverflow:"ellipsis"},children:e})}function y({entry:e}){let r=new Date(e.start_iso).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!1}),n=Math.round(e.numbers.active_min),s=e.project.split("/").filter(Boolean).slice(-1)[0]??e.project,i=e.enrichment.outcome,o=e.enrichment.brief_summary;return(0,t.jsxs)("a",{href:`/sessions/${e.session_id}`,style:{display:"block",padding:"8px 0",borderBottom:"1px solid var(--af-border-subtle)",fontSize:13,color:"var(--af-text)",textDecoration:"none"},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:10},children:[(0,t.jsx)("span",{style:{fontFamily:"var(--font-mono)",fontSize:11,color:"var(--af-text-tertiary)",width:48},children:r}),(0,t.jsx)("span",{style:{fontSize:11,color:"var(--af-text-tertiary)",minWidth:110,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:s}),(0,t.jsxs)("span",{style:{fontSize:11,fontFamily:"var(--font-mono)",color:"var(--af-text-tertiary)",width:40,textAlign:"right"},children:[n,"m"]}),i&&(0,t.jsx)(a.OutcomePill,{outcome:i,size:"sm",label:"text",agent:e.agent})]}),o&&(0,t.jsx)("div",{style:{marginTop:3,marginLeft:58,fontSize:13,color:"var(--af-text-secondary)",lineHeight:1.45,maxWidth:820},children:o})]})}function m({initial:e,entries:n,date:s,aiEnabled:i}){let[a,o]=(0,r.useState)(e),[l,d]=(0,r.useState)("idle"),[p,x]=(0,r.useState)(""),f=(0,r.useCallback)(async(e=!1)=>{d("streaming"),x("Starting...");let t=`/api/digest/day/${s}${e?"?force=1":""}`,r=await fetch(t,{method:"POST"});if(!r.ok||!r.body){d("error"),x(`Error ${r.status}`);return}let n=r.body.getReader(),i=new TextDecoder,a="";for(;;){let{done:e,value:t}=await n.read();if(e)break;let r=(a+=i.decode(t,{stream:!0})).split("\n\n");for(let e of(a=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("entry"===e.type)x(`Enriching ${e.index}/${e.total}${e.cost_usd?` \xb7 $${e.cost_usd.toFixed(4)}`:""}...`);else if("progress"===e.type){let t=Math.round(e.elapsed_ms/1e3),r=(e.bytes/1024).toFixed(1);x(`Claude composing… ${e.bytes.toLocaleString()} chars (${r} KB \xb7 ${t}s)`)}else if("digest"===e.type)o(e.digest),x("Rendering...");else if("saved"===e.type)x("Saved.");else if("error"===e.type){d("error"),x(e.message);return}}catch{}}}d("done"),x("")},[s]),h="streaming"===l,u=!!a?.headline,g=(0,r.useMemo)(()=>0!==n.length&&n.every(e=>"skipped_trivial"===e.enrichment.status),[n]),y=0===n.length,b=null;return(y||g||(b=y||g||u?(0,t.jsxs)("span",{style:{fontSize:10,color:"var(--af-text-tertiary)",display:"inline-flex",alignItems:"center",gap:6},children:["✓ Up to date",(0,t.jsx)("button",{onClick:()=>f(!0),disabled:h,title:"Re-roll the narrative without re-enriching capsules",style:{padding:"2px 7px",background:"transparent",border:"1px solid var(--af-border-subtle)",borderRadius:4,fontSize:10,color:"var(--af-text-secondary)",cursor:h?"default":"pointer",opacity:h?.6:1},children:h?"...":"Re-roll"})]}):(0,t.jsx)("button",{onClick:()=>f(!1),disabled:h,style:{padding:"4px 10px",background:"var(--af-accent)",color:"white",border:"none",borderRadius:5,cursor:h?"default":"pointer",fontSize:11,fontWeight:600,opacity:h?.6:1},children:h?"Generating...":a?"Generate (catch up)":"Generate digest"}),p&&(b=(0,t.jsxs)(t.Fragment,{children:[b,(0,t.jsx)("span",{style:{fontSize:10,color:"var(--af-text-tertiary)"},children:p})]}))),a)?(0,t.jsx)(c,{digest:a,entries:n,aiEnabled:i,actions:b}):(0,t.jsxs)(t.Fragment,{children:[b&&(0,t.jsx)("div",{style:{display:"flex",gap:10,padding:"14px 40px 0",alignItems:"center",flexWrap:"wrap"},children:b}),y?(0,t.jsx)("div",{style:{padding:28,textAlign:"center",color:"var(--af-text-tertiary)",fontSize:13},children:"No entries on this day."}):g?(0,t.jsx)("div",{style:{padding:28,textAlign:"center",color:"var(--af-text-tertiary)",fontSize:13},children:"💤 Warm-up only — every session was under a minute. No narrative needed."}):(0,t.jsx)("div",{style:{padding:28,textAlign:"center",color:"var(--af-text-secondary)",fontSize:13},children:"No digest generated yet — click Generate above."})]})}var b=e.i(22016);e.i(74472);var v=e.i(98572),j=e.i(56324),w=e.i(41783);let S=["rgba(45, 212, 191, 0.75)","rgba(167, 139, 250, 0.75)","rgba(248, 113, 113, 0.75)","rgba(52, 211, 153, 0.75)","rgba(251, 191, 36, 0.75)","rgba(236, 72, 153, 0.75)","rgba(34, 211, 238, 0.75)","rgba(168, 85, 247, 0.75)","rgba(244, 114, 82, 0.75)","rgba(96, 165, 250, 0.75)"];function k(e){let t=0;for(let r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r)|0;return S[Math.abs(t)%S.length]}function z(e){return k((0,v.canonicalProjectName)(e.projectName))}function _(e){return e.replace(/<[^>]+>/g,"").replace(/\s+/g," ").trim()}function M(e){let t=new Date(e);return`${t.getHours().toString().padStart(2,"0")}:${t.getMinutes().toString().padStart(2,"0")}`}function W({gantt:e,bursts:n=[],sessionEntries:s={}}){let i,[o,l]=(0,r.useState)(null),[d,c]=(0,r.useState)(null),[p,x]=(0,r.useState)(null),[f,h]=(0,r.useState)(!1),[u,g]=(0,r.useState)(null),[y,m]=(0,r.useState)(!1),S=(0,r.useRef)(null),T=p??d,I=(0,r.useMemo)(()=>{if(null===T)return null;let e=n[T];return e?new Set(e.sessionIds):null},[T,n]),R=(0,r.useMemo)(()=>{let t=new Map;for(let r of e.sessions){let e=(0,v.canonicalProjectName)(r.projectName),n=t.get(e);n?n.count++:t.set(e,{name:(0,j.prettyProjectName)(e),color:k(e),count:1})}return Array.from(t.values()).sort((e,t)=>t.count-e.count)},[e.sessions]),{rangeStartMs:B,rangeEndMs:D,hourMarks:P}=(0,r.useMemo)(()=>{if(0===e.sessions.length)return{rangeStartMs:e.dayStartMs,rangeEndMs:e.dayEndMs,hourMarks:[]};let t=1/0,r=-1/0;for(let n of e.sessions)for(let e of n.segments)e.startMs<t&&(t=e.startMs),e.endMs>r&&(r=e.endMs);let n=r+18e5,s=new Date(t-18e5);s.setMinutes(0,0,0);let i=new Date(n);i.setMinutes(0,0,0),i.setHours(i.getHours()+1);let a=Math.max(s.getTime(),e.dayStartMs),o=Math.min(i.getTime(),e.dayEndMs),l=[],d=new Date(a);for(d.setMinutes(0,0,0),d.getTime()<a&&d.setHours(d.getHours()+1);d.getTime()<=o;)l.push(d.getTime()),d.setHours(d.getHours()+1);return{rangeStartMs:a,rangeEndMs:o,hourMarks:l}},[e]),H=D-B,A=Math.max(700,Math.ceil(H/36e5*80)),F=33*e.sessions.length+3+8,E=e=>(e-B)/H*A,N="var(--af-surface)",L=y?n:n.slice(0,3),O=n.length-L.length;return(0,t.jsxs)(t.Fragment,{children:[n.length>0&&(0,t.jsxs)("div",{className:"af-panel",style:{marginBottom:16},children:[(0,t.jsxs)("div",{className:"af-panel-header",children:[(0,t.jsx)("span",{children:"Concurrency"}),(0,t.jsx)("span",{style:{fontSize:11,color:"var(--af-text-tertiary)",fontWeight:400},children:"periods when ≥2 agents were actively working at once"}),(0,t.jsxs)("button",{type:"button",onClick:()=>h(!0),"aria-label":"How concurrency is detected",style:{marginLeft:"auto",display:"inline-flex",alignItems:"center",gap:5,padding:"3px 9px",background:"transparent",border:"1px solid var(--af-border-subtle)",borderRadius:100,fontSize:10,color:"var(--af-text-tertiary)",cursor:"pointer",fontWeight:500},children:[(0,t.jsx)("span",{style:{fontSize:11,lineHeight:1},children:"ⓘ"}),"How this is measured"]})]}),(0,t.jsxs)("div",{children:[L.map((r,n)=>{let s=p===n,i=d===n,a=r.projectDirs.map(t=>{let r=e.sessions.find(e=>e.projectDir===t);return r?(0,j.prettyProjectName)(r.projectName):t}).map(e=>{let t=e.split("/").filter(Boolean);return t.length>2?"…/"+t.slice(-2).join("/"):e});return(0,t.jsxs)("div",{onMouseEnter:()=>c(n),onMouseLeave:()=>c(null),onClick:()=>g(n),style:{display:"grid",gridTemplateColumns:"auto auto auto 1fr auto",gap:14,padding:"10px 18px",fontSize:12,borderBottom:"1px solid var(--af-border-subtle)",cursor:"pointer",background:s||i?"var(--af-surface-hover)":"transparent",alignItems:"center",transition:"background 0.12s"},title:"Open burst detail",children:[(0,t.jsxs)("span",{style:{fontFamily:"var(--font-mono)",fontSize:11,color:"var(--af-text-secondary)",minWidth:110},children:[M(r.startMs),"–",M(r.endMs)]}),(0,t.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",padding:"2px 8px",borderRadius:10,fontFamily:"var(--font-mono)",fontSize:10,fontWeight:700,color:"white",background:r.crossProject?"rgba(167, 139, 250, 0.9)":"rgba(45, 212, 191, 0.9)",minWidth:28,justifyContent:"center"},children:["×",r.peak]}),r.crossProject?(0,t.jsx)("span",{style:{fontSize:9,color:"rgba(167, 139, 250, 1)",textTransform:"uppercase",letterSpacing:"0.04em",fontWeight:600},children:"cross-project"}):(0,t.jsx)("span",{}),(0,t.jsx)("span",{style:{fontSize:11,color:"var(--af-text-tertiary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:a.join(", "),children:a.join(" · ")}),(0,t.jsx)("span",{style:{fontFamily:"var(--font-mono)",fontSize:11,color:"var(--af-text-secondary)",minWidth:60,textAlign:"right"},children:(0,j.formatDuration)(r.endMs-r.startMs)})]},`burst-row-${n}`)}),n.length>3&&(0,t.jsx)("button",{type:"button",onClick:()=>m(e=>!e),style:{width:"100%",padding:"10px 18px",background:"transparent",border:"none",borderTop:"1px solid var(--af-border-subtle)",fontSize:11,color:"var(--af-text-secondary)",cursor:"pointer",fontWeight:500,textAlign:"center"},children:y?"Show fewer (first 3) ↑":`Show all ${n.length} bursts (+${O} more) ↓`})]})]}),(0,t.jsxs)("div",{className:"af-panel",style:{overflow:"hidden"},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:14,padding:"10px 16px",borderBottom:"1px solid var(--af-border-subtle)",fontSize:11,color:"var(--af-text-secondary)",flexWrap:"wrap"},children:[R.map(e=>{let r=e.name.split("/").filter(Boolean),n=r.length>2?"…/"+r.slice(-2).join("/"):e.name;return(0,t.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:5,cursor:"default"},title:`${e.name} — ${e.count} session${1===e.count?"":"s"} on this day`,children:[(0,t.jsx)("span",{style:{width:8,height:8,borderRadius:2,background:e.color,flexShrink:0}}),(0,t.jsx)("span",{style:{maxWidth:160,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n}),(0,t.jsxs)("span",{style:{color:"var(--af-text-tertiary)",fontSize:10},children:["(",e.count,")"]})]},e.name)}),(0,t.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:5,marginLeft:8,color:"var(--af-text-tertiary)",cursor:"default"},title:"Idle gap — the session was open but the agent was not actively working (gap > 3 minutes between events)",children:[(0,t.jsx)("span",{style:{width:16,height:8,borderRadius:2,background:"repeating-linear-gradient(45deg, var(--af-surface-hover), var(--af-surface-hover) 2px, var(--af-border-subtle) 2px, var(--af-border-subtle) 4px)",flexShrink:0}}),"idle"]})]}),(0,t.jsxs)("div",{ref:S,style:{overflow:"auto",maxHeight:"calc(100vh - 240px)",position:"relative"},onMouseLeave:()=>l(null),children:[(0,t.jsxs)("div",{style:{display:"grid",gridTemplateColumns:`220px ${A}px`,gridTemplateRows:`50px ${F}px`,width:220+A},children:[(0,t.jsxs)("div",{style:{position:"sticky",top:0,left:0,zIndex:3,background:N,borderBottom:"1px solid var(--af-border-subtle)",borderRight:"1px solid var(--af-border-subtle)",display:"flex",flexDirection:"column"},children:[(0,t.jsx)("div",{style:{height:24,display:"flex",alignItems:"center",justifyContent:"flex-end",padding:"0 10px",fontSize:9,color:"var(--af-text-tertiary)",letterSpacing:"0.04em",textTransform:"uppercase",fontWeight:600},children:n.length>0?"Concurrency":""}),(0,t.jsx)("div",{style:{height:26}})]}),(0,t.jsxs)("div",{style:{position:"sticky",top:0,zIndex:2,background:N,borderBottom:"1px solid var(--af-border-subtle)"},children:[(0,t.jsx)("svg",{width:A,height:24,style:{display:"block"},children:n.map((e,r)=>{let n=E(e.startMs),s=E(e.endMs)-n,i=Math.max(s,26),a=s<26?n+s/2-13:n,o=T===r,l=null!==T&&!o,x=e.crossProject?"rgba(167, 139, 250, 0.9)":"rgba(45, 212, 191, 0.9)";return(0,t.jsxs)("g",{children:[(0,t.jsx)("rect",{x:a,y:4,width:i,height:14,fill:x,rx:4,opacity:l?.3:1,stroke:p===r?"var(--af-text)":d===r?"var(--af-text-secondary)":"none",strokeWidth:p===r?1.5:1,style:{cursor:"pointer",transition:"opacity 0.12s"},onMouseEnter:()=>c(r),onMouseLeave:()=>c(null),onClick:()=>g(r),children:(0,t.jsx)("title",{children:`\xd7${e.peak} ${e.crossProject?"cross-project":"same-project"} \xb7 ${M(e.startMs)}–${M(e.endMs)} \xb7 ${(0,j.formatDuration)(e.endMs-e.startMs)} — click for detail`})}),(0,t.jsxs)("text",{x:a+i/2,y:15,textAnchor:"middle",fontSize:9,fontWeight:700,fill:"white",opacity:l?.3:1,style:{pointerEvents:"none"},children:["×",e.peak]})]},`burst-${r}`)})}),(0,t.jsx)("svg",{width:A,height:26,style:{display:"block"},children:P.map(e=>{let r=E(e),n=new Date(e).getHours()%3==0;return(0,t.jsx)("text",{x:r,y:18,textAnchor:"middle",fontSize:10,fill:n?"var(--af-text-secondary)":"var(--af-text-tertiary)",fontWeight:n?600:400,children:M(e)},e)})})]}),(0,t.jsx)("div",{style:{position:"sticky",left:0,zIndex:1,background:N,borderRight:"1px solid var(--af-border-subtle)"},children:(0,t.jsx)("div",{style:{paddingTop:3},children:e.sessions.map((e,r)=>{let n=z(e),s=e.firstUserPreview?_(e.firstUserPreview).slice(0,45):(0,j.prettyProjectName)(e.projectName),i=(0,j.prettyProjectName)(e.projectName),a=null!==I&&!I.has(e.id);return(0,t.jsxs)("div",{style:{height:30,marginBottom:3,display:"flex",alignItems:"center",gap:6,padding:"0 8px 0 6px",background:r%2==1?"var(--af-surface-hover)":"transparent",opacity:a?.3:1,transition:"opacity 0.12s"},children:[(0,t.jsx)("span",{style:{width:6,height:6,borderRadius:2,background:n,flexShrink:0}}),(0,t.jsx)(w.AgentIcon,{agent:e.agent,size:11}),(0,t.jsx)(b.default,{href:`/sessions/${e.id}`,style:{fontSize:10.5,color:"var(--af-text)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",lineHeight:1.2,textDecoration:"none"},title:`${_(e.firstUserPreview??"")} — ${i}`,children:s})]},`label-${e.id}-${r}`)})})}),(0,t.jsx)("div",{children:(0,t.jsxs)("svg",{width:A,height:F,style:{display:"block"},children:[(0,t.jsx)("defs",{children:(0,t.jsxs)("pattern",{id:"gantt-idle-stripes",patternUnits:"userSpaceOnUse",width:"6",height:"6",patternTransform:"rotate(45)",children:[(0,t.jsx)("rect",{width:"6",height:"6",fill:"var(--af-surface-hover)"}),(0,t.jsx)("line",{x1:"0",y1:"0",x2:"0",y2:"6",stroke:"var(--af-border-subtle)",strokeWidth:"1.5"})]})}),P.map(e=>{let r=E(e),n=new Date(e).getHours()%3==0;return(0,t.jsx)("line",{x1:r,y1:0,x2:r,y2:F,stroke:"var(--af-border-subtle)",strokeWidth:n?.8:.4,strokeDasharray:n?void 0:"2 4"},e)}),e.sessions.map((e,r)=>{let n=33*r+3,s=z(e),i=null!==I&&!I.has(e.id);return(0,t.jsxs)("g",{opacity:i?.25:1,style:{transition:"opacity 0.12s"},children:[r%2==1&&(0,t.jsx)("rect",{x:0,y:n,width:A,height:30,fill:"var(--af-surface-hover)",opacity:.25}),e.segments.map((r,i)=>{let a=E(r.startMs),o=Math.max(E(r.endMs)-a,4);return(0,t.jsx)("rect",{x:a,y:n+5,width:o,height:20,fill:s,rx:3,style:{cursor:"pointer"},onMouseEnter:t=>{let r=t.currentTarget.closest("svg").getBoundingClientRect();l({session:e,x:t.clientX-r.left+220,y:n+30+24+26+4})}},i)}),e.segments.length>1&&e.segments.slice(0,-1).map((r,s)=>{let i=e.segments[s+1],a=E(r.endMs),o=E(i.startMs);return o-a<4?null:(0,t.jsx)("rect",{x:a+1,y:n+7,width:o-a-2,height:16,fill:"url(#gantt-idle-stripes)",rx:2,opacity:.7},`idle-${s}`)}),(0,t.jsxs)("text",{x:Math.min(E(e.endMs)+8,A-100),y:n+15+3.5,fontSize:9,fill:"var(--af-text-tertiary)",fontFamily:"var(--font-mono)",children:[(0,j.formatDuration)(e.activeMs)," · ",M(e.startMs),"–",M(e.endMs)]})]},`row-${e.id}-${r}`)})]})})]}),o&&(0,t.jsxs)("div",{style:{position:"absolute",left:Math.max(8,Math.min(o.x,220+A-340)),top:Math.min(o.y,50+F-100),zIndex:50,background:"var(--af-surface-elevated)",border:"1px solid var(--af-border-subtle)",borderRadius:8,padding:"10px 14px",fontSize:11,color:"var(--af-text)",pointerEvents:"none",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",maxWidth:340,lineHeight:1.45},children:[(i=s[o.session.id])?i.outcome?(0,t.jsx)("div",{style:{marginBottom:6},children:(0,t.jsx)(a.OutcomePill,{outcome:i.outcome,size:"sm",agent:o.session.agent})}):"done"!==i.enrichmentStatus&&"skipped_trivial"!==i.enrichmentStatus?(0,t.jsx)("div",{style:{marginBottom:6},children:(0,t.jsx)(a.OutcomePill,{outcome:null,pending:!0,sessionId:o.session.id,localDay:i.localDay,size:"sm",agent:o.session.agent})}):null:null,(0,t.jsx)("div",{style:{fontWeight:600,marginBottom:4},children:s[o.session.id]?.briefSummary||_(o.session.firstUserPreview??"").slice(0,100)||(0,j.prettyProjectName)(o.session.projectName)}),(0,t.jsxs)("div",{style:{fontSize:10,color:"var(--af-text-secondary)",marginBottom:6,fontFamily:"var(--font-mono)"},children:[(0,j.prettyProjectName)(o.session.projectName),o.session.model&&` \xb7 ${o.session.model}`]}),(0,t.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"3px 12px",fontSize:10,color:"var(--af-text-secondary)"},children:[(0,t.jsxs)("span",{children:["Active: ",(0,t.jsx)("strong",{children:(0,j.formatDuration)(o.session.activeMs)})]}),(0,t.jsxs)("span",{children:["Segments: ",o.session.segments.length]}),(0,t.jsxs)("span",{children:["Range: ",M(o.session.startMs),"–",M(o.session.endMs)]}),(0,t.jsxs)("span",{children:["Tokens:"," ",(0,j.formatTokens)(o.session.totalUsage.input+o.session.totalUsage.cacheRead+o.session.totalUsage.cacheWrite),"/",(0,j.formatTokens)(o.session.totalUsage.output)]})]})]})]})]}),f&&(0,t.jsx)($,{onClose:()=>h(!1)}),null!==u&&n[u]&&(0,t.jsx)(C,{burst:n[u],gantt:e,sessionEntries:s,onClose:()=>g(null),onShowInTimeline:()=>{g(null),null!==u&&(e=>{x(t=>t===e?null:e);let t=n[e],r=S.current;if(!t||!r)return;let s=220+(E(t.startMs)+E(t.endMs))/2-r.clientWidth/2;r.scrollTo({left:Math.max(0,s),behavior:"smooth"})})(u)}})]})}function $({onClose:e}){return(0,r.useEffect)(()=>{let t=t=>{"Escape"===t.key&&e()};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[e]),(0,t.jsx)("div",{role:"dialog","aria-modal":"true","aria-labelledby":"concurrency-modal-title",onClick:e,style:{position:"fixed",inset:0,zIndex:200,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:12,maxWidth:560,width:"100%",maxHeight:"85vh",overflow:"auto",boxShadow:"0 16px 48px rgba(0, 0, 0, 0.3)"},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"18px 22px",borderBottom:"1px solid var(--af-border-subtle)"},children:[(0,t.jsx)("h2",{id:"concurrency-modal-title",style:{margin:0,fontSize:16,fontWeight:700,letterSpacing:"-0.01em"},children:"How concurrency is measured"}),(0,t.jsx)("button",{type:"button",onClick:e,"aria-label":"Close",style:{background:"transparent",border:"none",color:"var(--af-text-tertiary)",fontSize:22,lineHeight:1,cursor:"pointer",padding:0,width:28,height:28},children:"×"})]}),(0,t.jsxs)("div",{style:{padding:"18px 22px",fontSize:13,color:"var(--af-text-secondary)",lineHeight:1.55},children:[(0,t.jsxs)("p",{style:{margin:"0 0 14px"},children:["A ",(0,t.jsx)("strong",{style:{color:"var(--af-text)"},children:"concurrency burst"})," ","is a window of time when two or more Claude Code sessions were actively working in parallel. The goal is to surface moments when you were running a multi-agent fleet — not every accidental tab overlap."]}),(0,t.jsx)("h3",{style:{margin:"18px 0 8px",fontSize:12,fontWeight:700,color:"var(--af-text)",textTransform:"uppercase",letterSpacing:"0.04em"},children:'1. What counts as "active"'}),(0,t.jsxs)("p",{style:{margin:"0 0 6px"},children:["Each session's events are split into"," ",(0,t.jsx)("strong",{style:{color:"var(--af-text)"},children:"active segments"})," — stretches of time where no gap between consecutive events exceeds"," ",(0,t.jsx)("strong",{style:{color:"var(--af-text)"},children:"3 minutes"}),". Any longer gap (walked away, laptop closed, thinking) splits the session into separate segments."]}),(0,t.jsx)("p",{style:{margin:"0 0 6px",fontSize:12,color:"var(--af-text-tertiary)"},children:'This is the same definition used for the "active time" metric on the dashboard, so numbers stay consistent.'}),(0,t.jsx)("h3",{style:{margin:"18px 0 8px",fontSize:12,fontWeight:700,color:"var(--af-text)",textTransform:"uppercase",letterSpacing:"0.04em"},children:"2. Detecting overlap"}),(0,t.jsxs)("p",{style:{margin:"0 0 6px"},children:["A sweep-line walks every segment start/end across all sessions. Whenever the active count is ≥2, that stretch becomes a raw overlap. The ",(0,t.jsx)("strong",{style:{color:"var(--af-text)"},children:"peak"})," ","reported on each burst is the maximum active count reached anywhere inside it."]}),(0,t.jsx)("h3",{style:{margin:"18px 0 8px",fontSize:12,fontWeight:700,color:"var(--af-text)",textTransform:"uppercase",letterSpacing:"0.04em"},children:"3. Cleaning up noise"}),(0,t.jsx)("p",{style:{margin:"0 0 6px"},children:"Raw overlaps are noisy — a typical day produces dozens of sub-minute artifacts from switching between sessions. Two rules collapse them into human-readable bursts:"}),(0,t.jsxs)("ul",{style:{margin:"6px 0 0 0",paddingLeft:22},children:[(0,t.jsxs)("li",{style:{marginBottom:4},children:[(0,t.jsx)("strong",{style:{color:"var(--af-text)"},children:"Drop under 1 minute"})," — overlaps shorter than that are almost always tab-switch artifacts, not real parallel work."]}),(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{style:{color:"var(--af-text)"},children:"Merge within 10 minutes"})," — two overlaps separated by less than 10 minutes of idle time fuse into a single burst. A morning of back-and-forth agent work becomes one burst, not forty."]})]}),(0,t.jsx)("h3",{style:{margin:"18px 0 8px",fontSize:12,fontWeight:700,color:"var(--af-text)",textTransform:"uppercase",letterSpacing:"0.04em"},children:"4. Same-project vs cross-project"}),(0,t.jsxs)("p",{style:{margin:"0 0 6px"},children:["Bursts are colored by whether the involved sessions span more than one project directory."," ",(0,t.jsx)("span",{style:{color:"rgba(167, 139, 250, 1)",fontWeight:600},children:"Purple = cross-project"})," ","— different repos running at once, usually genuine fleet work."," ",(0,t.jsx)("span",{style:{color:"rgba(45, 212, 191, 1)",fontWeight:600},children:"Teal = same-project"})," ","— multiple sessions in one repo, usually context-switching inside a single task."]}),(0,t.jsx)("h3",{style:{margin:"18px 0 8px",fontSize:12,fontWeight:700,color:"var(--af-text)",textTransform:"uppercase",letterSpacing:"0.04em"},children:"Why bursts, not runs"}),(0,t.jsx)("p",{style:{margin:"0 0 6px"},children:'An earlier version reported every raw overlap as a separate "parallel run". On a busy day that produced 40–80 entries, most of them seconds long, most of them meaningless. Bursts are the unit humans actually think in: "this morning I was running 3 agents at once for about 20 minutes."'})]})]})})}function C({burst:e,gantt:n,sessionEntries:s,onClose:i,onShowInTimeline:o}){(0,r.useEffect)(()=>{let e=e=>{"Escape"===e.key&&i()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[i]);let[l,d]=(0,r.useState)(null),c=(0,r.useRef)(new Map),p=(0,r.useMemo)(()=>{let e=new Map;for(let t of n.sessions)e.set(t.id,t);return e},[n]),x=e.sessionIds.map(e=>p.get(e)).filter(e=>!!e);x.sort((e,t)=>e.startMs-t.startMs);let f=e=>{d(e);let t=c.current.get(e);t&&t.scrollIntoView({behavior:"smooth",block:"center"})},h=Math.min(e.startMs,...x.map(e=>e.startMs)),u=Math.max(e.endMs,...x.map(e=>e.endMs)),g=h-9e5,y=u+9e5,m=y-g,v=22+(25*x.length-3)+6,w=e=>(e-g)/m*510,S=[];{let e=new Date(g);for(e.setMinutes(0,0,0),e.getTime()<g&&e.setHours(e.getHours()+1);e.getTime()<=y;)S.push(e.getTime()),e.setHours(e.getHours()+1)}let k=w(e.startMs),W=w(e.endMs),$=e.endMs-e.startMs;return(0,t.jsx)("div",{role:"dialog","aria-modal":"true","aria-labelledby":"burst-detail-title",onClick:i,style:{position:"fixed",inset:0,zIndex:200,background:"rgba(0, 0, 0, 0.55)",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:12,width:"min(720px, 100%)",maxHeight:"90vh",display:"flex",flexDirection:"column",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.4)"},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:14,padding:"16px 22px",borderBottom:"1px solid var(--af-border-subtle)"},children:[(0,t.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:4},children:[(0,t.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",padding:"3px 10px",borderRadius:10,fontFamily:"var(--font-mono)",fontSize:11,fontWeight:700,color:"white",background:e.crossProject?"rgba(167, 139, 250, 0.95)":"rgba(45, 212, 191, 0.95)"},children:["×",e.peak," peak"]}),e.crossProject&&(0,t.jsx)("span",{style:{fontSize:9,color:"rgba(167, 139, 250, 1)",textTransform:"uppercase",letterSpacing:"0.05em",fontWeight:700},children:"cross-project"})]}),(0,t.jsxs)("h2",{id:"burst-detail-title",style:{margin:0,fontSize:16,fontWeight:700,letterSpacing:"-0.01em",display:"flex",alignItems:"center",gap:10,flexWrap:"wrap"},children:[(0,t.jsxs)("span",{style:{fontFamily:"var(--font-mono)"},children:[M(e.startMs),"–",M(e.endMs)]}),(0,t.jsx)("span",{style:{fontSize:12,fontWeight:400,color:"var(--af-text-tertiary)",fontFamily:"var(--font-mono)"},children:(0,j.formatDuration)($)}),(0,t.jsxs)("span",{style:{fontSize:12,fontWeight:400,color:"var(--af-text-tertiary)"},children:["· ",x.length," session",1===x.length?"":"s"]})]})]}),(0,t.jsx)("button",{type:"button",onClick:o,style:{padding:"6px 12px",background:"transparent",border:"1px solid var(--af-border-subtle)",borderRadius:6,fontSize:11,color:"var(--af-text-secondary)",cursor:"pointer",fontWeight:500,whiteSpace:"nowrap"},title:"Pin this burst on the main timeline and close",children:"Show in timeline →"}),(0,t.jsx)("button",{type:"button",onClick:i,"aria-label":"Close",style:{background:"transparent",border:"none",color:"var(--af-text-tertiary)",fontSize:24,lineHeight:1,cursor:"pointer",padding:0,width:28,height:28},children:"×"})]}),(0,t.jsxs)("div",{style:{overflow:"auto",padding:"18px 22px"},children:[(0,t.jsx)("div",{style:{fontSize:10,color:"var(--af-text-tertiary)",textTransform:"uppercase",letterSpacing:"0.05em",marginBottom:8,fontWeight:600},children:"Timeline (shaded = burst window)"}),(0,t.jsx)("div",{style:{background:"var(--af-surface)",border:"1px solid var(--af-border-subtle)",borderRadius:8,padding:"8px 10px",overflow:"auto"},children:(0,t.jsxs)("svg",{width:534,height:v,style:{display:"block"},children:[x.map((e,r)=>{let n=22+25*r+11,s=z(e),i=l===e.id;return(0,t.jsxs)("g",{onClick:()=>f(e.id),style:{cursor:"pointer"},children:[(0,t.jsx)("title",{children:`Track ${r+1} — click to focus in list below`}),(0,t.jsx)("circle",{cx:12,cy:n,r:9,fill:i?s:"var(--af-surface-elevated)",stroke:s,strokeWidth:i?2:1.5}),(0,t.jsx)("text",{x:12,y:n+3.5,textAnchor:"middle",fontSize:10,fontWeight:700,fill:i?"#fff":"var(--af-text)",style:{pointerEvents:"none"},children:r+1})]},`num-${e.id}`)}),(0,t.jsxs)("g",{transform:"translate(24, 0)",children:[(0,t.jsx)("rect",{x:k,y:0,width:Math.max(W-k,2),height:v,fill:e.crossProject?"rgba(167, 139, 250, 0.14)":"rgba(45, 212, 191, 0.14)"}),(0,t.jsx)("line",{x1:k,x2:k,y1:0,y2:v,stroke:e.crossProject?"rgba(167, 139, 250, 0.7)":"rgba(45, 212, 191, 0.7)",strokeWidth:1,strokeDasharray:"3 2"}),(0,t.jsx)("line",{x1:W,x2:W,y1:0,y2:v,stroke:e.crossProject?"rgba(167, 139, 250, 0.7)":"rgba(45, 212, 191, 0.7)",strokeWidth:1,strokeDasharray:"3 2"}),S.map(e=>{let r=w(e);return(0,t.jsxs)("g",{children:[(0,t.jsx)("line",{x1:r,x2:r,y1:22,y2:v,stroke:"var(--af-border-subtle)",strokeWidth:.5,strokeDasharray:"2 3"}),(0,t.jsx)("text",{x:r,y:16,textAnchor:"middle",fontSize:9,fill:"var(--af-text-tertiary)",children:M(e)})]},`mini-hm-${e}`)}),x.map((e,r)=>{let n=22+25*r,s=z(e),i=l===e.id;return(0,t.jsxs)("g",{children:[(0,t.jsx)("rect",{x:0,y:n,width:510,height:22,fill:i?"rgba(255,255,255,0.05)":"transparent",onClick:()=>f(e.id),style:{cursor:"pointer"}}),e.segments.map((e,r)=>{let a=w(e.startMs),o=Math.max(w(e.endMs)-a,2);return(0,t.jsx)("rect",{x:a,y:n+3,width:o,height:16,fill:s,rx:2,stroke:i?"var(--af-text)":"none",strokeWidth:+!!i,style:{pointerEvents:"none"}},`mini-seg-${r}`)})]},`mini-row-${e.id}`)})]})]})}),(0,t.jsx)("div",{style:{fontSize:10,color:"var(--af-text-tertiary)",textTransform:"uppercase",letterSpacing:"0.05em",margin:"18px 0 8px",fontWeight:600},children:"Sessions in this burst"}),(0,t.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:8},children:x.map((r,n)=>{let i,o,d,p=z(r),x=(t=>{let r=0;for(let n of t.segments){let t=Math.max(n.startMs,e.startMs),s=Math.min(n.endMs,e.endMs);s>t&&(r+=s-t)}return r})(r),f=$>0?Math.round(x/$*100):0,h=l===r.id;return(0,t.jsx)(b.default,{href:`/sessions/${r.id}`,ref:e=>{e?c.current.set(r.id,e):c.current.delete(r.id)},style:{display:"block",padding:"11px 14px",background:h?"var(--af-surface-hover)":"var(--af-surface)",border:h?"1px solid var(--af-text-tertiary)":"1px solid var(--af-border-subtle)",borderLeft:`3px solid ${p}`,borderRadius:8,textDecoration:"none",color:"var(--af-text)",fontSize:12,lineHeight:1.45,transition:"background 0.15s, border-color 0.15s",boxShadow:h?`0 0 0 2px ${p}`:"none"},children:(0,t.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:10},children:[(0,t.jsx)("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:20,height:20,borderRadius:"50%",background:h?p:"transparent",border:`1.5px solid ${p}`,color:h?"#fff":"var(--af-text)",fontSize:10,fontWeight:700,flexShrink:0,marginTop:2},"aria-label":`Track ${n+1}`,children:n+1}),(0,t.jsxs)("div",{style:{minWidth:0,flex:1},children:[(0,t.jsx)("div",{style:{fontSize:11,color:"var(--af-text-tertiary)",fontFamily:"var(--font-mono)",marginBottom:3,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:(0,j.prettyProjectName)(r.projectName),children:(o=(i=(0,j.prettyProjectName)(r.projectName)).split("/").filter(Boolean)).length>2?"…/"+o.slice(-2).join("/"):i}),(0,t.jsx)("div",{style:{fontWeight:500,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:_(r.firstUserPreview??""),children:_(r.firstUserPreview??"")||(0,t.jsx)("em",{style:{color:"var(--af-text-tertiary)"},children:"(no user message)"})}),r.lastAgentPreview&&(0,t.jsxs)("div",{style:{fontSize:11,color:"var(--af-text-secondary)",marginTop:3,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontStyle:"italic"},title:_(r.lastAgentPreview),children:["↳ ",_(r.lastAgentPreview)]})]}),(0,t.jsxs)("div",{style:{fontFamily:"var(--font-mono)",fontSize:10,color:"var(--af-text-tertiary)",textAlign:"right",whiteSpace:"nowrap",flexShrink:0,display:"flex",flexDirection:"column",alignItems:"flex-end",gap:4},children:[(d=s[r.id],d?.outcome?(0,t.jsx)(a.OutcomePill,{outcome:d.outcome,size:"sm",label:"text",agent:r.agent}):null),(0,t.jsxs)("div",{style:{color:"var(--af-text-secondary)"},children:[(0,j.formatDuration)(x)," ",(0,t.jsxs)("span",{style:{opacity:.6},children:["(",f,"%)"]})]}),(0,t.jsx)("div",{style:{fontSize:9,marginTop:2},children:"in burst"})]})]})},`burst-session-${r.id}`)})})]})]})})}function T({open:e,onClose:n,rows:s,aiEnabled:i}){let[a,o]=(0,r.useState)(new Set),[l,d]=(0,r.useState)(!1),[c,p]=(0,r.useState)(!1);(0,r.useEffect)(()=>{if(!e)return;let t=e=>{"Escape"===e.key&&n()};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[e,n]);let x=async()=>{if(0===a.size)return;d(!0);let e=Array.from(a).sort().reverse();try{for(let t of e){let e=`/api/digest/day/${t}${c?"?force=1":""}`,r=await fetch(e,{method:"POST"});if(r.body){let e=r.body.getReader();for(;!(await e.read()).done;);}}}finally{d(!1),o(new Set)}};return e?(0,t.jsx)("div",{style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.4)",zIndex:200,display:"flex",justifyContent:"flex-end"},onClick:n,children:(0,t.jsxs)("div",{onClick:e=>e.stopPropagation(),style:{width:"min(440px, 100%)",height:"100%",background:"var(--af-surface-elevated)",borderLeft:"1px solid var(--af-border-subtle)",display:"flex",flexDirection:"column",boxShadow:"-12px 0 32px rgba(0,0,0,0.25)"},children:[(0,t.jsxs)("header",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"14px 18px",borderBottom:"1px solid var(--af-border-subtle)"},children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{style:{fontSize:15,fontWeight:700,margin:0},children:"Backfill digests"}),(0,t.jsx)("p",{style:{fontSize:11,color:"var(--af-text-tertiary)",margin:"2px 0 0"},children:"Each selected day enqueues a job. You can close this drawer."})]}),(0,t.jsx)("button",{type:"button",onClick:n,"aria-label":"Close",style:{background:"transparent",border:"none",color:"var(--af-text-tertiary)",fontSize:22,cursor:"pointer"},children:"×"})]}),!i&&(0,t.jsx)("div",{style:{padding:12,margin:18,background:"rgba(237,137,54,0.1)",borderRadius:6,fontSize:12,color:"var(--af-text)"},children:"AI features are off — only deterministic digests will be written. Enable AI in Settings to generate narratives."}),(0,t.jsxs)("div",{style:{display:"flex",gap:6,padding:"10px 18px",borderBottom:"1px solid var(--af-border-subtle)",flexWrap:"wrap",fontSize:11},children:[(0,t.jsx)(I,{onClick:()=>o(new Set(s.filter(e=>"pending"===e.status).map(e=>e.date))),children:"Select pending"}),(0,t.jsx)(I,{onClick:()=>o(new Set(s.filter(e=>"empty"!==e.status).map(e=>e.date))),children:"Select all with entries"}),(0,t.jsx)(I,{onClick:()=>o(new Set),children:"Clear"}),(0,t.jsxs)("label",{style:{marginLeft:"auto",display:"inline-flex",alignItems:"center",gap:4,fontSize:11,color:"var(--af-text-secondary)",cursor:"pointer"},children:[(0,t.jsx)("input",{type:"checkbox",checked:c,onChange:e=>p(e.target.checked)}),"force regen"]})]}),(0,t.jsx)("div",{style:{flex:1,overflowY:"auto"},children:s.map(e=>(0,t.jsxs)("label",{style:{display:"grid",gridTemplateColumns:"auto 110px 80px 1fr",gap:10,alignItems:"center",padding:"8px 18px",borderBottom:"1px solid var(--af-border-subtle)",fontSize:12,cursor:"empty"===e.status?"default":"pointer",opacity:"empty"===e.status?.5:1},children:[(0,t.jsx)("input",{type:"checkbox",disabled:"empty"===e.status,checked:a.has(e.date),onChange:()=>{var t;return t=e.date,void o(e=>{let r=new Set(e);return r.has(t)?r.delete(t):r.add(t),r})}}),(0,t.jsx)("span",{children:e.day_label}),(0,t.jsx)("span",{style:{fontSize:10,color:"generated"===e.status?"#48bb78":"pending"===e.status?"#ed8936":"var(--af-text-tertiary)"},children:"generated"===e.status?"✓ ready":"pending"===e.status?"• pending":"—"}),(0,t.jsxs)("span",{style:{fontFamily:"var(--font-mono)",fontSize:10,color:"var(--af-text-tertiary)",textAlign:"right"},children:[e.entry_count>0?`${e.entry_count} sess`:"",e.pr_count>0?` \xb7 ${e.pr_count} PR`:""]})]},e.date))}),(0,t.jsxs)("footer",{style:{padding:"12px 18px",borderTop:"1px solid var(--af-border-subtle)",display:"flex",gap:10,alignItems:"center"},children:[(0,t.jsxs)("span",{style:{fontSize:12,color:"var(--af-text-secondary)",flex:1},children:[a.size," day",1===a.size?"":"s"," selected"]}),(0,t.jsx)("button",{type:"button",onClick:n,style:{padding:"6px 12px",background:"transparent",border:"1px solid var(--af-border-subtle)",borderRadius:6,fontSize:12,cursor:"pointer"},children:"Cancel"}),(0,t.jsx)("button",{type:"button",onClick:x,disabled:l||0===a.size,style:{padding:"6px 14px",background:"var(--af-accent)",color:"white",border:"none",borderRadius:6,fontSize:12,fontWeight:600,cursor:l||0===a.size?"default":"pointer",opacity:l||0===a.size?.6:1},children:l?`Enqueueing… (${a.size})`:`Generate ${a.size}`})]})]})}):null}function I({onClick:e,children:r}){return(0,t.jsx)("button",{type:"button",onClick:e,style:{padding:"3px 10px",background:"transparent",border:"1px solid var(--af-border-subtle)",borderRadius:5,fontSize:11,color:"var(--af-text-secondary)",cursor:"pointer"},children:r})}var R=e.i(18566);function B(e){if(e<6e4)return`${Math.round(e/1e3)}s`;let t=Math.round(e/6e4);if(t<60)return`${t}m`;let r=Math.floor(t/60),n=t%60;return n?`${r}h ${n}m`:`${r}h`}function D({date:e,today:n,prevDay:s,nextDay:i,dayStats:a,hrefForDate:o=e=>`/day/${e}`}){let l,d,c,p,x,f,h=(0,R.useRouter)(),[u,g]=(0,r.useState)(!1),[y,m]=(0,r.useMemo)(()=>{let[t,r]=e.split("-").map(Number);return[t,r]},[e]),[v,j]=(0,r.useState)(y),[w,S]=(0,r.useState)(m),[k,z]=(0,r.useState)(null),[_,M]=(0,r.useState)(null),W=(0,r.useMemo)(()=>{let e=new Map;for(let t of a)e.set(t.date,t);return e},[a]),$=(0,r.useMemo)(()=>{let e=new Date(v,w-1,1).getDay(),t=new Date(v,w,0).getDate(),r=[];for(let t=0;t<e;t++)r.push(null);for(let e=1;e<=t;e++){let t=String(w).padStart(2,"0"),n=String(e).padStart(2,"0");r.push(`${v}-${t}-${n}`)}return r},[v,w]),C=(0,r.useMemo)(()=>{let e=0;for(let t of a)t.airTimeMs>e&&(e=t.airTimeMs);return e},[a]),T=new Date(v,w-1).toLocaleString(void 0,{month:"long",year:"numeric"}),I=e=>{let t=w+e,r=v;t<1&&(t=12,r--),t>12&&(t=1,r++),S(t),j(r)};return(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap",position:"relative"},children:[s?(0,t.jsx)(b.default,{href:o(s),style:{padding:"5px 10px",border:"1px solid var(--af-border-subtle)",borderRadius:6,fontSize:11,color:"var(--af-text-secondary)"},children:"←"}):(0,t.jsx)("span",{style:{padding:"5px 10px",opacity:.3,fontSize:11,color:"var(--af-text-tertiary)"},children:"←"}),(0,t.jsx)("button",{type:"button",onClick:()=>{j(y),S(m),g(e=>!e)},style:{padding:"5px 12px",fontSize:12,fontFamily:"var(--font-mono)",border:"1px solid var(--af-border-subtle)",borderRadius:6,background:u?"var(--af-accent-subtle)":"transparent",color:u?"var(--af-accent)":"var(--af-text)",cursor:"pointer",fontWeight:500,minWidth:120,textAlign:"center"},children:e}),i?(0,t.jsx)(b.default,{href:o(i),style:{padding:"5px 10px",border:"1px solid var(--af-border-subtle)",borderRadius:6,fontSize:11,color:"var(--af-text-secondary)"},children:"→"}):(0,t.jsx)("span",{style:{padding:"5px 10px",opacity:.3,fontSize:11,color:"var(--af-text-tertiary)"},children:"→"}),(0,t.jsx)(b.default,{href:o(n),style:{padding:"5px 12px",border:"1px solid var(--af-border-subtle)",borderRadius:6,fontSize:11,color:e===n?"var(--af-accent)":"var(--af-text-secondary)",background:e===n?"var(--af-accent-subtle)":"transparent",fontWeight:500},children:"Today"}),u&&(0,t.jsxs)("div",{style:{position:"absolute",top:"calc(100% + 8px)",left:0,zIndex:60,background:"var(--af-surface)",border:"1px solid var(--af-border-subtle)",borderRadius:10,padding:"12px 14px",boxShadow:"0 8px 28px rgba(0,0,0,0.18)",minWidth:300},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:10},children:[(0,t.jsx)("button",{type:"button",onClick:()=>I(-1),style:{background:"transparent",border:"none",cursor:"pointer",color:"var(--af-text-secondary)",fontSize:14,padding:"2px 8px",borderRadius:4},children:"‹"}),(0,t.jsx)("span",{style:{fontSize:13,fontWeight:600,color:"var(--af-text)"},children:T}),(0,t.jsx)("button",{type:"button",onClick:()=>I(1),style:{background:"transparent",border:"none",cursor:"pointer",color:"var(--af-text-secondary)",fontSize:14,padding:"2px 8px",borderRadius:4},children:"›"})]}),(0,t.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:2,marginBottom:4},children:["Su","Mo","Tu","We","Th","Fr","Sa"].map(e=>(0,t.jsx)("div",{style:{textAlign:"center",fontSize:9,color:"var(--af-text-tertiary)",fontWeight:600,padding:"2px 0"},children:e},e))}),(0,t.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:2},children:$.map((r,s)=>{if(!r)return(0,t.jsx)("div",{},`blank-${s}`);let i=W.get(r),a=i?.airTimeMs??0,l=i?.burstCount??0,d=r===e,c=r===n,p=r>n,x=a>0&&C>0?Math.min(1,a/C):0,f=parseInt(r.split("-")[2],10);return(0,t.jsxs)("button",{type:"button",onClick:()=>{g(!1),h.push(o(r))},disabled:p,onMouseEnter:e=>{if(p)return;let t=e.currentTarget.getBoundingClientRect(),n=e.currentTarget.offsetParent?.getBoundingClientRect()??t;z(r),M({x:t.left-n.left+t.width/2,y:t.bottom-n.top+6})},onMouseLeave:()=>{z(null),M(null)},style:{position:"relative",width:40,height:40,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:1,border:d?"2px solid var(--af-accent)":c?"1px solid var(--af-text-tertiary)":"1px solid transparent",borderRadius:6,background:x>0?`rgba(45, 212, 191, ${.08+.35*x})`:"transparent",color:p?"var(--af-text-tertiary)":d?"var(--af-accent)":"var(--af-text)",cursor:p?"not-allowed":"pointer",fontSize:11,fontWeight:d?700:400,fontFamily:"var(--font-mono)",padding:0,opacity:p?.4:1},children:[(0,t.jsx)("span",{style:{lineHeight:1},children:f}),a>0&&(0,t.jsx)("span",{style:{fontSize:8,color:d?"var(--af-accent)":"var(--af-text-tertiary)",lineHeight:1,fontWeight:600,marginTop:2},children:B(a)}),l>0&&(0,t.jsx)("span",{style:{position:"absolute",top:3,right:3,width:5,height:5,borderRadius:"50%",background:"rgba(167, 139, 250, 0.95)",boxShadow:"0 0 0 1px var(--af-surface)"}})]},r)})}),(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:10,marginTop:10,paddingTop:8,borderTop:"1px solid var(--af-border-subtle)",fontSize:9,color:"var(--af-text-tertiary)"},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:5},children:[(0,t.jsx)("span",{children:"less"}),(0,t.jsx)("div",{style:{display:"flex",gap:2},children:[0,.15,.3,.5,.8].map((e,r)=>(0,t.jsx)("span",{style:{width:10,height:10,borderRadius:2,background:0===e?"var(--af-border-subtle)":`rgba(45, 212, 191, ${.08+.35*e})`}},r))}),(0,t.jsx)("span",{children:"more active"})]}),(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:5},title:"Days with at least one concurrency burst",children:[(0,t.jsx)("span",{style:{width:5,height:5,borderRadius:"50%",background:"rgba(167, 139, 250, 0.95)"}}),"parallel"]})]}),k&&_&&(l=W.get(k),d=l?.sessions??0,c=l?.airTimeMs??0,p=l?.parallelMs??0,x=l?.burstCount??0,f=l?.peakConcurrency??0,(0,t.jsxs)("div",{style:{position:"absolute",left:Math.max(10,Math.min(_.x-110,290)),top:_.y,width:220,pointerEvents:"none",background:"var(--af-surface-elevated)",border:"1px solid var(--af-border-subtle)",borderRadius:8,padding:"9px 12px",boxShadow:"0 6px 22px rgba(0,0,0,0.22)",fontSize:11,color:"var(--af-text)",zIndex:65,lineHeight:1.5},children:[(0,t.jsx)("div",{style:{fontFamily:"var(--font-mono)",fontWeight:700,fontSize:11,marginBottom:4},children:k}),0===d&&0===c&&0===p?(0,t.jsx)("div",{style:{color:"var(--af-text-tertiary)",fontSize:10},children:"no activity"}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(P,{label:"sessions",value:String(d)}),(0,t.jsx)(P,{label:"active time",value:c>0?B(c):"—"}),p>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{style:{marginTop:4,paddingTop:4,borderTop:"1px dashed var(--af-border-subtle)"}}),(0,t.jsx)(P,{label:"parallel time",value:B(p)}),(0,t.jsx)(P,{label:"peak concurrency",value:`\xd7${f}`,accent:!0}),(0,t.jsx)(P,{label:"bursts",value:String(x)})]})]})]}))]})]})}function P({label:e,value:r,accent:n}){return(0,t.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",color:"var(--af-text-secondary)",fontSize:10},children:[(0,t.jsx)("span",{children:e}),(0,t.jsx)("strong",{style:{color:n?"rgba(167, 139, 250, 1)":"var(--af-text)"},children:r})]})}function H({label:e,defaultOpen:i=!0,children:a}){let[o,l]=(0,r.useState)(i);return(0,t.jsxs)("div",{style:{borderBottom:"1px solid var(--af-border-subtle)"},children:[(0,t.jsxs)("button",{type:"button",onClick:()=>l(e=>!e),style:{width:"100%",padding:"12px 40px",background:"transparent",border:"none",textAlign:"left",display:"flex",alignItems:"center",gap:8,cursor:"pointer",fontSize:11,fontWeight:700,color:"var(--af-text-tertiary)",textTransform:"uppercase",letterSpacing:"0.08em"},children:[o?(0,t.jsx)(n.ChevronDown,{size:13}):(0,t.jsx)(s.ChevronRight,{size:13}),e]}),o&&(0,t.jsx)("div",{children:a})]})}e.s(["DayView",0,function({date:e,today:n,prev:s,next:a,initial:o,entries:l,aiEnabled:d,gantt:c,bursts:p,sessionEntries:x,backfillRows:f,dayStats:h}){let[u,g]=(0,r.useState)(!1),y=l.length>0&&l.every(e=>"skipped_trivial"===e.enrichment.status),b=l.length>0&&!y,v=c.sessions.length>0,j=new Date(`${e}T12:00:00`).toLocaleDateString("en-US",{weekday:"long",month:"long",day:"numeric",year:"numeric"}),w=f.filter(e=>"pending"===e.status).length;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("nav",{style:{padding:"14px 40px",display:"flex",gap:12,fontSize:12,borderBottom:"1px solid var(--af-border-subtle)",alignItems:"center",flexWrap:"wrap"},children:[(0,t.jsx)(D,{date:e,today:n,prevDay:s,nextDay:a??void 0,dayStats:h}),(0,t.jsxs)("button",{type:"button",onClick:()=>g(!0),style:{marginLeft:"auto",display:"inline-flex",alignItems:"center",gap:5,padding:"5px 10px",background:"transparent",border:"1px solid var(--af-border-subtle)",borderRadius:6,fontSize:11,color:"var(--af-text-secondary)",cursor:"pointer"},title:"Open the backfill multi-select drawer",children:[(0,t.jsx)(i,{size:12}),"Backfill digests",w>0&&(0,t.jsx)("span",{style:{fontSize:10,color:"#ed8936",fontWeight:700},children:w})]})]}),b||v?(0,t.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:0},children:[b&&(0,t.jsx)(H,{label:"Narrative",defaultOpen:!0,children:(0,t.jsx)(m,{initial:o,entries:l,date:e,aiEnabled:d})}),v&&(0,t.jsx)(H,{label:"Timeline & concurrency",defaultOpen:!0,children:(0,t.jsx)("div",{style:{padding:"8px 40px 40px"},children:(0,t.jsx)(W,{gantt:c,bursts:p,sessionEntries:x})})})]}):(0,t.jsxs)("div",{style:{padding:"60px 40px",textAlign:"center",color:"var(--af-text-secondary)"},children:[(0,t.jsx)("div",{style:{fontSize:14,marginBottom:6},children:j}),(0,t.jsx)("div",{style:{fontSize:13,color:"var(--af-text-tertiary)"},children:"No Claude Code activity on this day."})]}),(0,t.jsx)(T,{open:u,onClose:()=>g(!1),rows:f,aiEnabled:d})]})}],92566)}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,92566,e=>{"use strict";var t=e.i(18050),r=e.i(71645),n=e.i(64659),s=e.i(63059);let i=(0,e.i(75254).default)("Layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]);var a=e.i(23614),o=e.i(40484);let l={"spec-review-loop":"Spec-review loop","chunk-implementation":"Chunk implementation","research-then-build":"Research-then-build","reviewer-triad":"Reviewer triad","background-coordinated":"Background-coordinated","solo-continuation":"Solo continuation","solo-design":"Solo design","solo-build":"Solo build",mixed:"Mixed"},d={teammate:"<teammate-message>","task-notification":"<task-notification>","local-command-caveat":"<local-command-caveat>","image-attached":"[Image #N]","slash-command":"/command","handoff-prose":"Handoff prose"};function c({digest:e,entries:i,aiEnabled:l,actions:d}){let[u,g]=(0,r.useState)(!1),m=new Date(`${e.key}T12:00:00`).toLocaleDateString("en-US",{weekday:"long",month:"short",day:"numeric",year:"numeric"}),b=e.agent_min/60,v=b>=1?`${b.toFixed(1)}h`:`${Math.round(e.agent_min)}m`,j=[...i].sort((e,t)=>Date.parse(t.start_iso)-Date.parse(e.start_iso));return(0,t.jsxs)("div",{style:{maxWidth:980,margin:"0 auto",padding:"24px 40px"},children:[(0,t.jsxs)("header",{style:{marginBottom:28},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:8,fontSize:12,color:"var(--af-text-tertiary)",fontWeight:500,flexWrap:"wrap"},children:[(0,t.jsx)("span",{children:m}),(0,t.jsx)(a.OutcomePill,{outcome:e.outcome_day,size:"lg"}),(0,t.jsx)("span",{style:{color:"var(--af-text-tertiary)"},children:"·"}),(0,t.jsxs)("span",{style:{fontFamily:"var(--font-mono)",color:"var(--af-text-secondary)"},children:[v," agent time · ",e.projects.length," project",1===e.projects.length?"":"s"," · ",e.shipped.length," PR",1===e.shipped.length?"":"s"," shipped",e.concurrency_peak>1&&` \xb7 peak concurrency \xd7${e.concurrency_peak}`]}),d&&(0,t.jsx)("div",{style:{marginLeft:"auto",display:"inline-flex",alignItems:"center",gap:8},children:d})]}),e.headline?(0,t.jsx)("h1",{style:{fontSize:26,fontWeight:700,lineHeight:1.3,letterSpacing:"-0.02em",margin:"0 0 8px",maxWidth:820,color:"var(--af-text)"},children:e.headline}):(0,t.jsx)("h1",{style:{fontSize:20,color:"var(--af-text-secondary)",margin:"0 0 14px"},children:l?"No narrative yet — click Regenerate.":`Worked ${v} across ${e.projects.length} project${1===e.projects.length?"":"s"}.`}),e.day_signature&&(0,t.jsx)("p",{style:{margin:"0 0 14px",fontSize:14,fontStyle:"italic",color:"var(--af-text-secondary)",maxWidth:820,lineHeight:1.5},children:e.day_signature})]}),!l&&(0,t.jsxs)("div",{style:{padding:14,marginBottom:24,background:"var(--af-accent-subtle)",borderRadius:8,fontSize:13,color:"var(--af-text)"},children:["Enable AI features in ",(0,t.jsx)("a",{href:"/settings",style:{color:"var(--af-accent)"},children:"Settings"})," to see daily narratives."]}),e.day_signals&&(0,t.jsx)(h,{signals:e.day_signals}),(e.what_went_well||e.what_hit_friction)&&(0,t.jsxs)("section",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:24,marginBottom:28},children:[(0,t.jsx)(x,{glyph:"✓",color:"#48bb78",text:e.what_went_well,emptyLabel:"(smooth)"}),(0,t.jsx)(x,{glyph:"⚠",color:"#ed8936",text:e.what_hit_friction,emptyLabel:"(no friction)"})]}),e.narrative&&(0,t.jsx)("section",{style:{marginBottom:28,padding:"4px 0",fontSize:15,lineHeight:1.6,color:"var(--af-text)",maxWidth:760},children:e.narrative}),(0,t.jsx)("div",{style:{marginBottom:18},children:(0,t.jsxs)("button",{type:"button",onClick:()=>g(e=>!e),style:{display:"inline-flex",alignItems:"center",gap:6,padding:"5px 10px",background:"transparent",border:"1px solid var(--af-border-subtle)",borderRadius:6,fontSize:11,color:"var(--af-text-secondary)",cursor:"pointer"},children:[u?(0,t.jsx)(n.ChevronDown,{size:12}):(0,t.jsx)(s.ChevronRight,{size:12}),u?"Hide details":"Show more details"]})}),u&&(0,t.jsxs)(t.Fragment,{children:[e.suggestion&&(0,t.jsxs)("section",{style:{borderLeft:"3px solid var(--af-accent)",paddingLeft:16,marginBottom:32},children:[(0,t.jsx)("div",{style:{fontSize:11,color:"var(--af-text-tertiary)",textTransform:"uppercase",letterSpacing:"0.06em",fontWeight:600,marginBottom:6},children:"Tomorrow"}),(0,t.jsx)("div",{style:{fontSize:15,fontWeight:600,marginBottom:4,color:"var(--af-text)"},children:e.suggestion.headline}),(0,t.jsx)("div",{style:{fontSize:13,color:"var(--af-text-secondary)",lineHeight:1.5,maxWidth:760},children:e.suggestion.body})]}),e.projects.length>0&&(0,t.jsxs)("section",{style:{marginBottom:32},children:[(0,t.jsx)(p,{children:"Work breakdown"}),(0,t.jsx)("div",{style:{display:"grid",gap:6},children:e.projects.map(r=>{let n=e.shipped.filter(e=>e.project===r.display_name);return(0,t.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"140px 1fr 56px 72px",gap:12,alignItems:"center",padding:"6px 0",borderBottom:"1px solid var(--af-border-subtle)",fontSize:13},children:[(0,t.jsx)("span",{title:r.name,style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:r.display_name}),(0,t.jsx)(f,{pct:r.share_pct}),(0,t.jsxs)("span",{style:{fontFamily:"var(--font-mono)",fontSize:11,color:"var(--af-text-tertiary)",textAlign:"right"},children:[r.share_pct.toFixed(0),"%"]}),(0,t.jsx)("span",{style:{fontSize:11,color:"var(--af-text-tertiary)",textAlign:"right"},children:n.length>0?`${n.length} PR${1===n.length?"":"s"}`:"—"})]},r.name)})})]}),e.shipped.length>0&&(0,t.jsxs)("section",{style:{marginBottom:32},children:[(0,t.jsx)(p,{children:"Shipped"}),(0,t.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none"},children:e.shipped.map((e,r)=>(0,t.jsxs)("li",{style:{padding:"6px 0",fontSize:13,borderBottom:"1px solid var(--af-border-subtle)",display:"flex",gap:10,alignItems:"baseline"},children:[(0,t.jsx)("span",{style:{color:"#48bb78",fontSize:12},children:"✓"}),(0,t.jsx)("span",{style:{flex:1},children:e.title}),(0,t.jsx)("span",{style:{fontSize:11,color:"var(--af-text-tertiary)"},children:e.project})]},r))})]}),j.length>0&&(0,t.jsxs)("section",{style:{marginBottom:32},children:[(0,t.jsxs)(p,{children:["Sessions · ",j.length]}),(0,t.jsx)("div",{style:{display:"flex",flexDirection:"column"},children:j.map(e=>(0,t.jsx)(y,{entry:e},e.session_id))})]}),e.top_goal_categories.length>0&&(0,t.jsxs)("section",{style:{marginTop:40,paddingTop:20,borderTop:"1px solid var(--af-border-subtle)"},children:[(0,t.jsx)("div",{style:{fontSize:11,color:"var(--af-text-tertiary)",marginBottom:6},children:"Goal mix"}),(0,t.jsx)(o.GoalBar,{goals:e.top_goal_categories,total:e.agent_min})]})]})]})}function p({children:e}){return(0,t.jsx)("div",{style:{fontSize:10,color:"var(--af-text-tertiary)",textTransform:"uppercase",letterSpacing:"0.08em",fontWeight:600,marginBottom:10},children:e})}function x({glyph:e,color:r,text:n,emptyLabel:s}){return(0,t.jsxs)("div",{style:{fontSize:14,lineHeight:1.55,display:"flex",gap:8,alignItems:"flex-start"},children:[(0,t.jsx)("span",{style:{fontSize:16,color:r,lineHeight:1.4,flexShrink:0},children:e}),n?(0,t.jsx)("span",{style:{color:"var(--af-text)"},children:n}):(0,t.jsx)("span",{style:{color:"var(--af-text-tertiary)",fontStyle:"italic"},children:s})]})}function f({pct:e}){return(0,t.jsx)("div",{style:{height:6,background:"var(--af-border-subtle)",borderRadius:99,overflow:"hidden"},children:(0,t.jsx)("div",{style:{width:`${Math.min(100,Math.max(0,e))}%`,height:"100%",background:"var(--af-accent)",transition:"width 0.2s"}})})}function h({signals:e}){let r=null!==e.dominant_shape,n=Object.keys(e.shape_distribution).length>0,s=e.user_authored_subagents_used.length>0||Object.keys(e.shape_distribution).length>0,i=e.skills_loaded.filter(e=>"stock"===e.origin),a=e.skills_loaded.filter(e=>"user"===e.origin),o=e.prompt_frames.filter(e=>"claude-feature"===e.origin),c=e.prompt_frames.filter(e=>"personal-habit"===e.origin),p=e.comm_style,x=p.verbosity_distribution.short+p.verbosity_distribution.medium+p.verbosity_distribution.long+p.verbosity_distribution.very_long,f=p.steering.interrupts+p.steering.frustrated+p.steering.dissatisfied;return r||n||0!==i.length||0!==a.length||0!==e.user_authored_subagents_used.length||0!==o.length||0!==c.length||0!==x||0!==p.external_refs.length||0!==f||0!==e.brainstorm_warmup_session_count||0!==e.todo_ops_total||e.plan_mode_used?(0,t.jsxs)("section",{style:{marginBottom:28,padding:"14px 16px",borderRadius:8,background:"var(--af-surface)",border:"1px solid var(--af-border-subtle)"},children:[(0,t.jsx)("div",{style:{fontSize:10,color:"var(--af-text-tertiary)",textTransform:"uppercase",letterSpacing:"0.08em",fontWeight:600,marginBottom:10},children:"How today worked"}),r&&(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,flexWrap:"wrap",marginBottom:8},children:[(0,t.jsx)("span",{style:{display:"inline-flex",alignItems:"center",padding:"3px 10px",borderRadius:999,fontSize:12,fontWeight:600,background:"var(--af-accent-subtle)",color:"var(--af-accent)"},children:l[e.dominant_shape]??e.dominant_shape}),n&&(0,t.jsx)("span",{style:{fontSize:12,color:"var(--af-text-secondary)",fontFamily:"var(--font-mono)"},children:Object.entries(e.shape_distribution).sort((e,t)=>t[1]-e[1]).map(([e,t])=>`${t} ${e}`).join(" · ")})]}),s&&e.user_authored_subagents_used.length>0&&(0,t.jsx)(u,{label:"Your subagents",children:e.user_authored_subagents_used.slice(0,4).map(e=>(0,t.jsxs)(g,{title:e.sample_prompt_preview,children:[e.type,e.count>1?` \xd7${e.count}`:""]},e.type))}),(i.length>0||a.length>0)&&(0,t.jsxs)(u,{label:"Skills loaded",children:[a.slice(0,4).map(e=>(0,t.jsxs)(g,{tone:"user",children:[e.skill,e.count>1?` \xd7${e.count}`:""]},e.skill)),i.slice(0,4).map(e=>(0,t.jsxs)(g,{tone:"stock",children:[e.skill,e.count>1?` \xd7${e.count}`:""]},e.skill))]}),(o.length>0||c.length>0)&&(0,t.jsxs)(u,{label:"Prompt frames",children:[c.map(e=>(0,t.jsxs)(g,{tone:"user",children:[d[e.frame]??e.frame,e.count>1?` \xd7${e.count}`:""]},e.frame)),o.map(e=>(0,t.jsxs)(g,{tone:"stock",children:[d[e.frame]??e.frame,e.count>1?` \xd7${e.count}`:""]},e.frame))]}),(x>0||p.external_refs.length>0||f>0)&&(0,t.jsxs)(u,{label:"Comm style",children:[x>0&&(0,t.jsx)("span",{style:{fontSize:12,color:"var(--af-text-secondary)",fontFamily:"var(--font-mono)"},children:[p.verbosity_distribution.short&&`${p.verbosity_distribution.short} short`,p.verbosity_distribution.medium&&`${p.verbosity_distribution.medium} med`,p.verbosity_distribution.long&&`${p.verbosity_distribution.long} long`,p.verbosity_distribution.very_long&&`${p.verbosity_distribution.very_long} v.long`].filter(Boolean).join(" · ")}),p.external_refs.length>0&&(0,t.jsxs)(g,{children:[p.external_refs.length," external ref",1===p.external_refs.length?"":"s"]}),p.steering.interrupts>0&&(0,t.jsxs)(g,{children:[p.steering.interrupts," interrupts"]}),p.steering.sessions_with_mid_run_redirect>0&&(0,t.jsxs)(g,{children:[p.steering.sessions_with_mid_run_redirect," mid-run redirect",1===p.steering.sessions_with_mid_run_redirect?"":"s"]})]}),(e.brainstorm_warmup_session_count>0||e.todo_ops_total>0||e.plan_mode_used)&&(0,t.jsxs)(u,{label:"Discipline",children:[e.brainstorm_warmup_session_count>0&&(0,t.jsxs)(g,{children:["brainstorm warmup ×",e.brainstorm_warmup_session_count]}),e.todo_ops_total>0&&(0,t.jsxs)(g,{children:[e.todo_ops_total," TodoWrite ops"]}),e.plan_mode_used&&(0,t.jsx)(g,{tone:"user",children:"Plan Mode used"})]})]}):null}function u({label:e,children:r}){return(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,flexWrap:"wrap",padding:"4px 0",fontSize:12},children:[(0,t.jsx)("span",{style:{minWidth:100,color:"var(--af-text-tertiary)",fontWeight:500,fontSize:11,textTransform:"uppercase",letterSpacing:"0.04em"},children:e}),(0,t.jsx)("div",{style:{display:"flex",gap:6,flexWrap:"wrap",flex:1},children:r})]})}function g({children:e,tone:r,title:n}){return(0,t.jsx)("span",{title:n,style:{display:"inline-flex",alignItems:"center",padding:"2px 8px",borderRadius:999,fontSize:11,fontFamily:"var(--font-mono)",background:"user"===r?"var(--af-accent-subtle)":"var(--af-border-subtle)",color:"user"===r?"var(--af-accent)":"var(--af-text-secondary)",whiteSpace:"nowrap",maxWidth:280,overflow:"hidden",textOverflow:"ellipsis"},children:e})}function y({entry:e}){let r=new Date(e.start_iso).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!1}),n=Math.round(e.numbers.active_min),s=e.project.split("/").filter(Boolean).slice(-1)[0]??e.project,i=e.enrichment.outcome,o=e.enrichment.brief_summary;return(0,t.jsxs)("a",{href:`/sessions/${e.session_id}`,style:{display:"block",padding:"8px 0",borderBottom:"1px solid var(--af-border-subtle)",fontSize:13,color:"var(--af-text)",textDecoration:"none"},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:10},children:[(0,t.jsx)("span",{style:{fontFamily:"var(--font-mono)",fontSize:11,color:"var(--af-text-tertiary)",width:48},children:r}),(0,t.jsx)("span",{style:{fontSize:11,color:"var(--af-text-tertiary)",minWidth:110,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:s}),(0,t.jsxs)("span",{style:{fontSize:11,fontFamily:"var(--font-mono)",color:"var(--af-text-tertiary)",width:40,textAlign:"right"},children:[n,"m"]}),i&&(0,t.jsx)(a.OutcomePill,{outcome:i,size:"sm",label:"text",agent:e.agent})]}),o&&(0,t.jsx)("div",{style:{marginTop:3,marginLeft:58,fontSize:13,color:"var(--af-text-secondary)",lineHeight:1.45,maxWidth:820},children:o})]})}function m({initial:e,entries:n,date:s,aiEnabled:i}){let[a,o]=(0,r.useState)(e),[l,d]=(0,r.useState)("idle"),[p,x]=(0,r.useState)(""),f=(0,r.useCallback)(async(e=!1)=>{d("streaming"),x("Starting...");let t=`/api/digest/day/${s}${e?"?force=1":""}`,r=await fetch(t,{method:"POST"});if(!r.ok||!r.body){d("error"),x(`Error ${r.status}`);return}let n=r.body.getReader(),i=new TextDecoder,a="";for(;;){let{done:e,value:t}=await n.read();if(e)break;let r=(a+=i.decode(t,{stream:!0})).split("\n\n");for(let e of(a=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("entry"===e.type)x(`Enriching ${e.index}/${e.total}${e.cost_usd?` \xb7 $${e.cost_usd.toFixed(4)}`:""}...`);else if("progress"===e.type){let t=Math.round(e.elapsed_ms/1e3),r=(e.bytes/1024).toFixed(1);x(`Claude composing… ${e.bytes.toLocaleString()} chars (${r} KB \xb7 ${t}s)`)}else if("digest"===e.type)o(e.digest),x("Rendering...");else if("saved"===e.type)x("Saved.");else if("error"===e.type){d("error"),x(e.message);return}}catch{}}}d("done"),x("")},[s]),h="streaming"===l,u=!!a?.headline,g=(0,r.useMemo)(()=>0!==n.length&&n.every(e=>"skipped_trivial"===e.enrichment.status),[n]),y=0===n.length,b=null;return(y||g||(b=y||g||u?(0,t.jsxs)("span",{style:{fontSize:10,color:"var(--af-text-tertiary)",display:"inline-flex",alignItems:"center",gap:6},children:["✓ Up to date",(0,t.jsx)("button",{onClick:()=>f(!0),disabled:h,title:"Re-roll the narrative without re-enriching capsules",style:{padding:"2px 7px",background:"transparent",border:"1px solid var(--af-border-subtle)",borderRadius:4,fontSize:10,color:"var(--af-text-secondary)",cursor:h?"default":"pointer",opacity:h?.6:1},children:h?"...":"Re-roll"})]}):(0,t.jsx)("button",{onClick:()=>f(!1),disabled:h,style:{padding:"4px 10px",background:"var(--af-accent)",color:"white",border:"none",borderRadius:5,cursor:h?"default":"pointer",fontSize:11,fontWeight:600,opacity:h?.6:1},children:h?"Generating...":a?"Generate (catch up)":"Generate digest"}),p&&(b=(0,t.jsxs)(t.Fragment,{children:[b,(0,t.jsx)("span",{style:{fontSize:10,color:"var(--af-text-tertiary)"},children:p})]}))),a)?(0,t.jsx)(c,{digest:a,entries:n,aiEnabled:i,actions:b}):(0,t.jsxs)(t.Fragment,{children:[b&&(0,t.jsx)("div",{style:{display:"flex",gap:10,padding:"14px 40px 0",alignItems:"center",flexWrap:"wrap"},children:b}),y?(0,t.jsx)("div",{style:{padding:28,textAlign:"center",color:"var(--af-text-tertiary)",fontSize:13},children:"No entries on this day."}):g?(0,t.jsx)("div",{style:{padding:28,textAlign:"center",color:"var(--af-text-tertiary)",fontSize:13},children:"💤 Warm-up only — every session was under a minute. No narrative needed."}):(0,t.jsx)("div",{style:{padding:28,textAlign:"center",color:"var(--af-text-secondary)",fontSize:13},children:"No digest generated yet — click Generate above."})]})}var b=e.i(22016);e.i(74472);var v=e.i(98572),j=e.i(56324),w=e.i(41783);let S=["rgba(45, 212, 191, 0.75)","rgba(167, 139, 250, 0.75)","rgba(248, 113, 113, 0.75)","rgba(52, 211, 153, 0.75)","rgba(251, 191, 36, 0.75)","rgba(236, 72, 153, 0.75)","rgba(34, 211, 238, 0.75)","rgba(168, 85, 247, 0.75)","rgba(244, 114, 82, 0.75)","rgba(96, 165, 250, 0.75)"];function k(e){let t=0;for(let r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r)|0;return S[Math.abs(t)%S.length]}function z(e){return k((0,v.canonicalProjectName)(e.projectName))}function _(e){return e.replace(/<[^>]+>/g,"").replace(/\s+/g," ").trim()}function M(e){let t=new Date(e);return`${t.getHours().toString().padStart(2,"0")}:${t.getMinutes().toString().padStart(2,"0")}`}function W({onClose:e}){return(0,r.useEffect)(()=>{let t=t=>{"Escape"===t.key&&e()};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[e]),(0,t.jsx)("div",{role:"dialog","aria-modal":"true","aria-labelledby":"concurrency-modal-title",onClick:e,style:{position:"fixed",inset:0,zIndex:200,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:12,maxWidth:560,width:"100%",maxHeight:"85vh",overflow:"auto",boxShadow:"0 16px 48px rgba(0, 0, 0, 0.3)"},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"18px 22px",borderBottom:"1px solid var(--af-border-subtle)"},children:[(0,t.jsx)("h2",{id:"concurrency-modal-title",style:{margin:0,fontSize:16,fontWeight:700,letterSpacing:"-0.01em"},children:"How concurrency is measured"}),(0,t.jsx)("button",{type:"button",onClick:e,"aria-label":"Close",style:{background:"transparent",border:"none",color:"var(--af-text-tertiary)",fontSize:22,lineHeight:1,cursor:"pointer",padding:0,width:28,height:28},children:"×"})]}),(0,t.jsxs)("div",{style:{padding:"18px 22px",fontSize:13,color:"var(--af-text-secondary)",lineHeight:1.55},children:[(0,t.jsxs)("p",{style:{margin:"0 0 14px"},children:["A ",(0,t.jsx)("strong",{style:{color:"var(--af-text)"},children:"concurrency burst"})," ","is a window of time when two or more Claude Code sessions were actively working in parallel. The goal is to surface moments when you were running a multi-agent fleet — not every accidental tab overlap."]}),(0,t.jsx)("h3",{style:{margin:"18px 0 8px",fontSize:12,fontWeight:700,color:"var(--af-text)",textTransform:"uppercase",letterSpacing:"0.04em"},children:'1. What counts as "active"'}),(0,t.jsxs)("p",{style:{margin:"0 0 6px"},children:["Each session's events are split into"," ",(0,t.jsx)("strong",{style:{color:"var(--af-text)"},children:"active segments"})," — stretches of time where no gap between consecutive events exceeds"," ",(0,t.jsx)("strong",{style:{color:"var(--af-text)"},children:"3 minutes"}),". Any longer gap (walked away, laptop closed, thinking) splits the session into separate segments."]}),(0,t.jsx)("p",{style:{margin:"0 0 6px",fontSize:12,color:"var(--af-text-tertiary)"},children:'This is the same definition used for the "active time" metric on the dashboard, so numbers stay consistent.'}),(0,t.jsx)("h3",{style:{margin:"18px 0 8px",fontSize:12,fontWeight:700,color:"var(--af-text)",textTransform:"uppercase",letterSpacing:"0.04em"},children:"2. Detecting overlap"}),(0,t.jsxs)("p",{style:{margin:"0 0 6px"},children:["A sweep-line walks every segment start/end across all sessions. Whenever the active count is ≥2, that stretch becomes a raw overlap. The ",(0,t.jsx)("strong",{style:{color:"var(--af-text)"},children:"peak"})," ","reported on each burst is the maximum active count reached anywhere inside it."]}),(0,t.jsx)("h3",{style:{margin:"18px 0 8px",fontSize:12,fontWeight:700,color:"var(--af-text)",textTransform:"uppercase",letterSpacing:"0.04em"},children:"3. Cleaning up noise"}),(0,t.jsx)("p",{style:{margin:"0 0 6px"},children:"Raw overlaps are noisy — a typical day produces dozens of sub-minute artifacts from switching between sessions. Two rules collapse them into human-readable bursts:"}),(0,t.jsxs)("ul",{style:{margin:"6px 0 0 0",paddingLeft:22},children:[(0,t.jsxs)("li",{style:{marginBottom:4},children:[(0,t.jsx)("strong",{style:{color:"var(--af-text)"},children:"Drop under 1 minute"})," — overlaps shorter than that are almost always tab-switch artifacts, not real parallel work."]}),(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{style:{color:"var(--af-text)"},children:"Merge within 10 minutes"})," — two overlaps separated by less than 10 minutes of idle time fuse into a single burst. A morning of back-and-forth agent work becomes one burst, not forty."]})]}),(0,t.jsx)("h3",{style:{margin:"18px 0 8px",fontSize:12,fontWeight:700,color:"var(--af-text)",textTransform:"uppercase",letterSpacing:"0.04em"},children:"4. Same-project vs cross-project"}),(0,t.jsxs)("p",{style:{margin:"0 0 6px"},children:["Bursts are colored by whether the involved sessions span more than one project directory."," ",(0,t.jsx)("span",{style:{color:"rgba(167, 139, 250, 1)",fontWeight:600},children:"Purple = cross-project"})," ","— different repos running at once, usually genuine fleet work."," ",(0,t.jsx)("span",{style:{color:"rgba(45, 212, 191, 1)",fontWeight:600},children:"Teal = same-project"})," ","— multiple sessions in one repo, usually context-switching inside a single task."]}),(0,t.jsx)("h3",{style:{margin:"18px 0 8px",fontSize:12,fontWeight:700,color:"var(--af-text)",textTransform:"uppercase",letterSpacing:"0.04em"},children:"Why bursts, not runs"}),(0,t.jsx)("p",{style:{margin:"0 0 6px"},children:'An earlier version reported every raw overlap as a separate "parallel run". On a busy day that produced 40–80 entries, most of them seconds long, most of them meaningless. Bursts are the unit humans actually think in: "this morning I was running 3 agents at once for about 20 minutes."'})]})]})})}function $({burst:e,gantt:n,sessionEntries:s,onClose:i,onShowInTimeline:o}){(0,r.useEffect)(()=>{let e=e=>{"Escape"===e.key&&i()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[i]);let[l,d]=(0,r.useState)(null),c=(0,r.useRef)(new Map),p=(0,r.useMemo)(()=>{let e=new Map;for(let t of n.sessions)e.set(t.id,t);return e},[n]),x=e.sessionIds.map(e=>p.get(e)).filter(e=>!!e);x.sort((e,t)=>e.startMs-t.startMs);let f=e=>{d(e);let t=c.current.get(e);t&&t.scrollIntoView({behavior:"smooth",block:"center"})},h=Math.min(e.startMs,...x.map(e=>e.startMs)),u=Math.max(e.endMs,...x.map(e=>e.endMs)),g=h-9e5,y=u+9e5,m=y-g,v=22+(25*x.length-3)+6,w=e=>(e-g)/m*510,S=[];{let e=new Date(g);for(e.setMinutes(0,0,0),e.getTime()<g&&e.setHours(e.getHours()+1);e.getTime()<=y;)S.push(e.getTime()),e.setHours(e.getHours()+1)}let k=w(e.startMs),W=w(e.endMs),C=e.endMs-e.startMs;return(0,t.jsx)("div",{role:"dialog","aria-modal":"true","aria-labelledby":"burst-detail-title",onClick:i,style:{position:"fixed",inset:0,zIndex:200,background:"rgba(0, 0, 0, 0.55)",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:12,width:"min(720px, 100%)",maxHeight:"90vh",display:"flex",flexDirection:"column",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.4)"},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:14,padding:"16px 22px",borderBottom:"1px solid var(--af-border-subtle)"},children:[(0,t.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:4},children:[(0,t.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",padding:"3px 10px",borderRadius:10,fontFamily:"var(--font-mono)",fontSize:11,fontWeight:700,color:"white",background:e.crossProject?"rgba(167, 139, 250, 0.95)":"rgba(45, 212, 191, 0.95)"},children:["×",e.peak," peak"]}),e.crossProject&&(0,t.jsx)("span",{style:{fontSize:9,color:"rgba(167, 139, 250, 1)",textTransform:"uppercase",letterSpacing:"0.05em",fontWeight:700},children:"cross-project"})]}),(0,t.jsxs)("h2",{id:"burst-detail-title",style:{margin:0,fontSize:16,fontWeight:700,letterSpacing:"-0.01em",display:"flex",alignItems:"center",gap:10,flexWrap:"wrap"},children:[(0,t.jsxs)("span",{style:{fontFamily:"var(--font-mono)"},children:[M(e.startMs),"–",M(e.endMs)]}),(0,t.jsx)("span",{style:{fontSize:12,fontWeight:400,color:"var(--af-text-tertiary)",fontFamily:"var(--font-mono)"},children:(0,j.formatDuration)(C)}),(0,t.jsxs)("span",{style:{fontSize:12,fontWeight:400,color:"var(--af-text-tertiary)"},children:["· ",x.length," session",1===x.length?"":"s"]})]})]}),(0,t.jsx)("button",{type:"button",onClick:o,style:{padding:"6px 12px",background:"transparent",border:"1px solid var(--af-border-subtle)",borderRadius:6,fontSize:11,color:"var(--af-text-secondary)",cursor:"pointer",fontWeight:500,whiteSpace:"nowrap"},title:"Pin this burst on the main timeline and close",children:"Show in timeline →"}),(0,t.jsx)("button",{type:"button",onClick:i,"aria-label":"Close",style:{background:"transparent",border:"none",color:"var(--af-text-tertiary)",fontSize:24,lineHeight:1,cursor:"pointer",padding:0,width:28,height:28},children:"×"})]}),(0,t.jsxs)("div",{style:{overflow:"auto",padding:"18px 22px"},children:[(0,t.jsx)("div",{style:{fontSize:10,color:"var(--af-text-tertiary)",textTransform:"uppercase",letterSpacing:"0.05em",marginBottom:8,fontWeight:600},children:"Timeline (shaded = burst window)"}),(0,t.jsx)("div",{style:{background:"var(--af-surface)",border:"1px solid var(--af-border-subtle)",borderRadius:8,padding:"8px 10px",overflow:"auto"},children:(0,t.jsxs)("svg",{width:534,height:v,style:{display:"block"},children:[x.map((e,r)=>{let n=22+25*r+11,s=z(e),i=l===e.id;return(0,t.jsxs)("g",{onClick:()=>f(e.id),style:{cursor:"pointer"},children:[(0,t.jsx)("title",{children:`Track ${r+1} — click to focus in list below`}),(0,t.jsx)("circle",{cx:12,cy:n,r:9,fill:i?s:"var(--af-surface-elevated)",stroke:s,strokeWidth:i?2:1.5}),(0,t.jsx)("text",{x:12,y:n+3.5,textAnchor:"middle",fontSize:10,fontWeight:700,fill:i?"#fff":"var(--af-text)",style:{pointerEvents:"none"},children:r+1})]},`num-${e.id}`)}),(0,t.jsxs)("g",{transform:"translate(24, 0)",children:[(0,t.jsx)("rect",{x:k,y:0,width:Math.max(W-k,2),height:v,fill:e.crossProject?"rgba(167, 139, 250, 0.14)":"rgba(45, 212, 191, 0.14)"}),(0,t.jsx)("line",{x1:k,x2:k,y1:0,y2:v,stroke:e.crossProject?"rgba(167, 139, 250, 0.7)":"rgba(45, 212, 191, 0.7)",strokeWidth:1,strokeDasharray:"3 2"}),(0,t.jsx)("line",{x1:W,x2:W,y1:0,y2:v,stroke:e.crossProject?"rgba(167, 139, 250, 0.7)":"rgba(45, 212, 191, 0.7)",strokeWidth:1,strokeDasharray:"3 2"}),S.map(e=>{let r=w(e);return(0,t.jsxs)("g",{children:[(0,t.jsx)("line",{x1:r,x2:r,y1:22,y2:v,stroke:"var(--af-border-subtle)",strokeWidth:.5,strokeDasharray:"2 3"}),(0,t.jsx)("text",{x:r,y:16,textAnchor:"middle",fontSize:9,fill:"var(--af-text-tertiary)",children:M(e)})]},`mini-hm-${e}`)}),x.map((e,r)=>{let n=22+25*r,s=z(e),i=l===e.id;return(0,t.jsxs)("g",{children:[(0,t.jsx)("rect",{x:0,y:n,width:510,height:22,fill:i?"rgba(255,255,255,0.05)":"transparent",onClick:()=>f(e.id),style:{cursor:"pointer"}}),e.segments.map((e,r)=>{let a=w(e.startMs),o=Math.max(w(e.endMs)-a,2);return(0,t.jsx)("rect",{x:a,y:n+3,width:o,height:16,fill:s,rx:2,stroke:i?"var(--af-text)":"none",strokeWidth:+!!i,style:{pointerEvents:"none"}},`mini-seg-${r}`)})]},`mini-row-${e.id}`)})]})]})}),(0,t.jsx)("div",{style:{fontSize:10,color:"var(--af-text-tertiary)",textTransform:"uppercase",letterSpacing:"0.05em",margin:"18px 0 8px",fontWeight:600},children:"Sessions in this burst"}),(0,t.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:8},children:x.map((r,n)=>{let i,o,d,p=z(r),x=(t=>{let r=0;for(let n of t.segments){let t=Math.max(n.startMs,e.startMs),s=Math.min(n.endMs,e.endMs);s>t&&(r+=s-t)}return r})(r),f=C>0?Math.round(x/C*100):0,h=l===r.id;return(0,t.jsx)(b.default,{href:`/sessions/${r.id}`,ref:e=>{e?c.current.set(r.id,e):c.current.delete(r.id)},style:{display:"block",padding:"11px 14px",background:h?"var(--af-surface-hover)":"var(--af-surface)",border:h?"1px solid var(--af-text-tertiary)":"1px solid var(--af-border-subtle)",borderLeft:`3px solid ${p}`,borderRadius:8,textDecoration:"none",color:"var(--af-text)",fontSize:12,lineHeight:1.45,transition:"background 0.15s, border-color 0.15s",boxShadow:h?`0 0 0 2px ${p}`:"none"},children:(0,t.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:10},children:[(0,t.jsx)("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:20,height:20,borderRadius:"50%",background:h?p:"transparent",border:`1.5px solid ${p}`,color:h?"#fff":"var(--af-text)",fontSize:10,fontWeight:700,flexShrink:0,marginTop:2},"aria-label":`Track ${n+1}`,children:n+1}),(0,t.jsxs)("div",{style:{minWidth:0,flex:1},children:[(0,t.jsx)("div",{style:{fontSize:11,color:"var(--af-text-tertiary)",fontFamily:"var(--font-mono)",marginBottom:3,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:(0,j.prettyProjectName)(r.projectName),children:(o=(i=(0,j.prettyProjectName)(r.projectName)).split("/").filter(Boolean)).length>2?"…/"+o.slice(-2).join("/"):i}),(0,t.jsx)("div",{style:{fontWeight:500,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:_(r.firstUserPreview??""),children:_(r.firstUserPreview??"")||(0,t.jsx)("em",{style:{color:"var(--af-text-tertiary)"},children:"(no user message)"})}),r.lastAgentPreview&&(0,t.jsxs)("div",{style:{fontSize:11,color:"var(--af-text-secondary)",marginTop:3,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontStyle:"italic"},title:_(r.lastAgentPreview),children:["↳ ",_(r.lastAgentPreview)]})]}),(0,t.jsxs)("div",{style:{fontFamily:"var(--font-mono)",fontSize:10,color:"var(--af-text-tertiary)",textAlign:"right",whiteSpace:"nowrap",flexShrink:0,display:"flex",flexDirection:"column",alignItems:"flex-end",gap:4},children:[(d=s[r.id],d?.outcome?(0,t.jsx)(a.OutcomePill,{outcome:d.outcome,size:"sm",label:"text",agent:r.agent}):null),(0,t.jsxs)("div",{style:{color:"var(--af-text-secondary)"},children:[(0,j.formatDuration)(x)," ",(0,t.jsxs)("span",{style:{opacity:.6},children:["(",f,"%)"]})]}),(0,t.jsx)("div",{style:{fontSize:9,marginTop:2},children:"in burst"})]})]})},`burst-session-${r.id}`)})})]})]})})}function C({gantt:e,bursts:n=[],sessionEntries:s={}}){let i,[o,l]=(0,r.useState)(null),[d,c]=(0,r.useState)(null),[p,x]=(0,r.useState)(null),[f,h]=(0,r.useState)(!1),[u,g]=(0,r.useState)(null),[y,m]=(0,r.useState)(!1),S=(0,r.useRef)(null),T=p??d,I=(0,r.useMemo)(()=>{if(null===T)return null;let e=n[T];return e?new Set(e.sessionIds):null},[T,n]),R=(0,r.useMemo)(()=>{let t=new Map;for(let r of e.sessions){let e=(0,v.canonicalProjectName)(r.projectName),n=t.get(e);n?n.count++:t.set(e,{name:(0,j.prettyProjectName)(e),color:k(e),count:1})}return Array.from(t.values()).sort((e,t)=>t.count-e.count)},[e.sessions]),{rangeStartMs:B,rangeEndMs:D,hourMarks:P}=(0,r.useMemo)(()=>{if(0===e.sessions.length)return{rangeStartMs:e.dayStartMs,rangeEndMs:e.dayEndMs,hourMarks:[]};let t=1/0,r=-1/0;for(let n of e.sessions)for(let e of n.segments)e.startMs<t&&(t=e.startMs),e.endMs>r&&(r=e.endMs);let n=r+18e5,s=new Date(t-18e5);s.setMinutes(0,0,0);let i=new Date(n);i.setMinutes(0,0,0),i.setHours(i.getHours()+1);let a=Math.max(s.getTime(),e.dayStartMs),o=Math.min(i.getTime(),e.dayEndMs),l=[],d=new Date(a);for(d.setMinutes(0,0,0),d.getTime()<a&&d.setHours(d.getHours()+1);d.getTime()<=o;)l.push(d.getTime()),d.setHours(d.getHours()+1);return{rangeStartMs:a,rangeEndMs:o,hourMarks:l}},[e]),H=D-B,A=Math.max(700,Math.ceil(H/36e5*80)),F=33*e.sessions.length+3+8,E=e=>(e-B)/H*A,N="var(--af-surface)",L=y?n:n.slice(0,3),O=n.length-L.length;return(0,t.jsxs)(t.Fragment,{children:[n.length>0&&(0,t.jsxs)("div",{className:"af-panel",style:{marginBottom:16},children:[(0,t.jsxs)("div",{className:"af-panel-header",children:[(0,t.jsx)("span",{children:"Concurrency"}),(0,t.jsx)("span",{style:{fontSize:11,color:"var(--af-text-tertiary)",fontWeight:400},children:"periods when ≥2 agents were actively working at once"}),(0,t.jsxs)("button",{type:"button",onClick:()=>h(!0),"aria-label":"How concurrency is detected",style:{marginLeft:"auto",display:"inline-flex",alignItems:"center",gap:5,padding:"3px 9px",background:"transparent",border:"1px solid var(--af-border-subtle)",borderRadius:100,fontSize:10,color:"var(--af-text-tertiary)",cursor:"pointer",fontWeight:500},children:[(0,t.jsx)("span",{style:{fontSize:11,lineHeight:1},children:"ⓘ"}),"How this is measured"]})]}),(0,t.jsxs)("div",{children:[L.map((r,n)=>{let s=p===n,i=d===n,a=r.projectDirs.map(t=>{let r=e.sessions.find(e=>e.projectDir===t);return r?(0,j.prettyProjectName)(r.projectName):t}).map(e=>{let t=e.split("/").filter(Boolean);return t.length>2?"…/"+t.slice(-2).join("/"):e});return(0,t.jsxs)("div",{onMouseEnter:()=>c(n),onMouseLeave:()=>c(null),onClick:()=>g(n),style:{display:"grid",gridTemplateColumns:"auto auto auto 1fr auto",gap:14,padding:"10px 18px",fontSize:12,borderBottom:"1px solid var(--af-border-subtle)",cursor:"pointer",background:s||i?"var(--af-surface-hover)":"transparent",alignItems:"center",transition:"background 0.12s"},title:"Open burst detail",children:[(0,t.jsxs)("span",{style:{fontFamily:"var(--font-mono)",fontSize:11,color:"var(--af-text-secondary)",minWidth:110},children:[M(r.startMs),"–",M(r.endMs)]}),(0,t.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",padding:"2px 8px",borderRadius:10,fontFamily:"var(--font-mono)",fontSize:10,fontWeight:700,color:"white",background:r.crossProject?"rgba(167, 139, 250, 0.9)":"rgba(45, 212, 191, 0.9)",minWidth:28,justifyContent:"center"},children:["×",r.peak]}),r.crossProject?(0,t.jsx)("span",{style:{fontSize:9,color:"rgba(167, 139, 250, 1)",textTransform:"uppercase",letterSpacing:"0.04em",fontWeight:600},children:"cross-project"}):(0,t.jsx)("span",{}),(0,t.jsx)("span",{style:{fontSize:11,color:"var(--af-text-tertiary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:a.join(", "),children:a.join(" · ")}),(0,t.jsx)("span",{style:{fontFamily:"var(--font-mono)",fontSize:11,color:"var(--af-text-secondary)",minWidth:60,textAlign:"right"},children:(0,j.formatDuration)(r.endMs-r.startMs)})]},`burst-row-${n}`)}),n.length>3&&(0,t.jsx)("button",{type:"button",onClick:()=>m(e=>!e),style:{width:"100%",padding:"10px 18px",background:"transparent",border:"none",borderTop:"1px solid var(--af-border-subtle)",fontSize:11,color:"var(--af-text-secondary)",cursor:"pointer",fontWeight:500,textAlign:"center"},children:y?"Show fewer (first 3) ↑":`Show all ${n.length} bursts (+${O} more) ↓`})]})]}),(0,t.jsxs)("div",{className:"af-panel",style:{overflow:"hidden"},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:14,padding:"10px 16px",borderBottom:"1px solid var(--af-border-subtle)",fontSize:11,color:"var(--af-text-secondary)",flexWrap:"wrap"},children:[R.map(e=>{let r=e.name.split("/").filter(Boolean),n=r.length>2?"…/"+r.slice(-2).join("/"):e.name;return(0,t.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:5,cursor:"default"},title:`${e.name} — ${e.count} session${1===e.count?"":"s"} on this day`,children:[(0,t.jsx)("span",{style:{width:8,height:8,borderRadius:2,background:e.color,flexShrink:0}}),(0,t.jsx)("span",{style:{maxWidth:160,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n}),(0,t.jsxs)("span",{style:{color:"var(--af-text-tertiary)",fontSize:10},children:["(",e.count,")"]})]},e.name)}),(0,t.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:5,marginLeft:8,color:"var(--af-text-tertiary)",cursor:"default"},title:"Idle gap — the session was open but the agent was not actively working (gap > 3 minutes between events)",children:[(0,t.jsx)("span",{style:{width:16,height:8,borderRadius:2,background:"repeating-linear-gradient(45deg, var(--af-surface-hover), var(--af-surface-hover) 2px, var(--af-border-subtle) 2px, var(--af-border-subtle) 4px)",flexShrink:0}}),"idle"]})]}),(0,t.jsxs)("div",{ref:S,style:{overflow:"auto",maxHeight:"calc(100vh - 240px)",position:"relative"},onMouseLeave:()=>l(null),children:[(0,t.jsxs)("div",{style:{display:"grid",gridTemplateColumns:`220px ${A}px`,gridTemplateRows:`50px ${F}px`,width:220+A},children:[(0,t.jsxs)("div",{style:{position:"sticky",top:0,left:0,zIndex:3,background:N,borderBottom:"1px solid var(--af-border-subtle)",borderRight:"1px solid var(--af-border-subtle)",display:"flex",flexDirection:"column"},children:[(0,t.jsx)("div",{style:{height:24,display:"flex",alignItems:"center",justifyContent:"flex-end",padding:"0 10px",fontSize:9,color:"var(--af-text-tertiary)",letterSpacing:"0.04em",textTransform:"uppercase",fontWeight:600},children:n.length>0?"Concurrency":""}),(0,t.jsx)("div",{style:{height:26}})]}),(0,t.jsxs)("div",{style:{position:"sticky",top:0,zIndex:2,background:N,borderBottom:"1px solid var(--af-border-subtle)"},children:[(0,t.jsx)("svg",{width:A,height:24,style:{display:"block"},children:n.map((e,r)=>{let n=E(e.startMs),s=E(e.endMs)-n,i=Math.max(s,26),a=s<26?n+s/2-13:n,o=T===r,l=null!==T&&!o,x=e.crossProject?"rgba(167, 139, 250, 0.9)":"rgba(45, 212, 191, 0.9)";return(0,t.jsxs)("g",{children:[(0,t.jsx)("rect",{x:a,y:4,width:i,height:14,fill:x,rx:4,opacity:l?.3:1,stroke:p===r?"var(--af-text)":d===r?"var(--af-text-secondary)":"none",strokeWidth:p===r?1.5:1,style:{cursor:"pointer",transition:"opacity 0.12s"},onMouseEnter:()=>c(r),onMouseLeave:()=>c(null),onClick:()=>g(r),children:(0,t.jsx)("title",{children:`\xd7${e.peak} ${e.crossProject?"cross-project":"same-project"} \xb7 ${M(e.startMs)}–${M(e.endMs)} \xb7 ${(0,j.formatDuration)(e.endMs-e.startMs)} — click for detail`})}),(0,t.jsxs)("text",{x:a+i/2,y:15,textAnchor:"middle",fontSize:9,fontWeight:700,fill:"white",opacity:l?.3:1,style:{pointerEvents:"none"},children:["×",e.peak]})]},`burst-${r}`)})}),(0,t.jsx)("svg",{width:A,height:26,style:{display:"block"},children:P.map(e=>{let r=E(e),n=new Date(e).getHours()%3==0;return(0,t.jsx)("text",{x:r,y:18,textAnchor:"middle",fontSize:10,fill:n?"var(--af-text-secondary)":"var(--af-text-tertiary)",fontWeight:n?600:400,children:M(e)},e)})})]}),(0,t.jsx)("div",{style:{position:"sticky",left:0,zIndex:1,background:N,borderRight:"1px solid var(--af-border-subtle)"},children:(0,t.jsx)("div",{style:{paddingTop:3},children:e.sessions.map((e,r)=>{let n=z(e),s=e.firstUserPreview?_(e.firstUserPreview).slice(0,45):(0,j.prettyProjectName)(e.projectName),i=(0,j.prettyProjectName)(e.projectName),a=null!==I&&!I.has(e.id);return(0,t.jsxs)("div",{style:{height:30,marginBottom:3,display:"flex",alignItems:"center",gap:6,padding:"0 8px 0 6px",background:r%2==1?"var(--af-surface-hover)":"transparent",opacity:a?.3:1,transition:"opacity 0.12s"},children:[(0,t.jsx)("span",{style:{width:6,height:6,borderRadius:2,background:n,flexShrink:0}}),(0,t.jsx)(w.AgentIcon,{agent:e.agent,size:11}),(0,t.jsx)(b.default,{href:`/sessions/${e.id}`,style:{fontSize:10.5,color:"var(--af-text)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",lineHeight:1.2,textDecoration:"none"},title:`${_(e.firstUserPreview??"")} — ${i}`,children:s})]},`label-${e.id}-${r}`)})})}),(0,t.jsx)("div",{children:(0,t.jsxs)("svg",{width:A,height:F,style:{display:"block"},children:[(0,t.jsx)("defs",{children:(0,t.jsxs)("pattern",{id:"gantt-idle-stripes",patternUnits:"userSpaceOnUse",width:"6",height:"6",patternTransform:"rotate(45)",children:[(0,t.jsx)("rect",{width:"6",height:"6",fill:"var(--af-surface-hover)"}),(0,t.jsx)("line",{x1:"0",y1:"0",x2:"0",y2:"6",stroke:"var(--af-border-subtle)",strokeWidth:"1.5"})]})}),P.map(e=>{let r=E(e),n=new Date(e).getHours()%3==0;return(0,t.jsx)("line",{x1:r,y1:0,x2:r,y2:F,stroke:"var(--af-border-subtle)",strokeWidth:n?.8:.4,strokeDasharray:n?void 0:"2 4"},e)}),e.sessions.map((e,r)=>{let n=33*r+3,s=z(e),i=null!==I&&!I.has(e.id);return(0,t.jsxs)("g",{opacity:i?.25:1,style:{transition:"opacity 0.12s"},children:[r%2==1&&(0,t.jsx)("rect",{x:0,y:n,width:A,height:30,fill:"var(--af-surface-hover)",opacity:.25}),e.segments.map((r,i)=>{let a=E(r.startMs),o=Math.max(E(r.endMs)-a,4);return(0,t.jsx)("rect",{x:a,y:n+5,width:o,height:20,fill:s,rx:3,style:{cursor:"pointer"},onMouseEnter:t=>{let r=t.currentTarget.closest("svg").getBoundingClientRect();l({session:e,x:t.clientX-r.left+220,y:n+30+24+26+4})}},i)}),e.segments.length>1&&e.segments.slice(0,-1).map((r,s)=>{let i=e.segments[s+1],a=E(r.endMs),o=E(i.startMs);return o-a<4?null:(0,t.jsx)("rect",{x:a+1,y:n+7,width:o-a-2,height:16,fill:"url(#gantt-idle-stripes)",rx:2,opacity:.7},`idle-${s}`)}),(0,t.jsxs)("text",{x:Math.min(E(e.endMs)+8,A-100),y:n+15+3.5,fontSize:9,fill:"var(--af-text-tertiary)",fontFamily:"var(--font-mono)",children:[(0,j.formatDuration)(e.activeMs)," · ",M(e.startMs),"–",M(e.endMs)]})]},`row-${e.id}-${r}`)})]})})]}),o&&(0,t.jsxs)("div",{style:{position:"absolute",left:Math.max(8,Math.min(o.x,220+A-340)),top:Math.min(o.y,50+F-100),zIndex:50,background:"var(--af-surface-elevated)",border:"1px solid var(--af-border-subtle)",borderRadius:8,padding:"10px 14px",fontSize:11,color:"var(--af-text)",pointerEvents:"none",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",maxWidth:340,lineHeight:1.45},children:[(i=s[o.session.id])?i.outcome?(0,t.jsx)("div",{style:{marginBottom:6},children:(0,t.jsx)(a.OutcomePill,{outcome:i.outcome,size:"sm",agent:o.session.agent})}):"done"!==i.enrichmentStatus&&"skipped_trivial"!==i.enrichmentStatus?(0,t.jsx)("div",{style:{marginBottom:6},children:(0,t.jsx)(a.OutcomePill,{outcome:null,pending:!0,sessionId:o.session.id,localDay:i.localDay,size:"sm",agent:o.session.agent})}):null:null,(0,t.jsx)("div",{style:{fontWeight:600,marginBottom:4},children:s[o.session.id]?.briefSummary||_(o.session.firstUserPreview??"").slice(0,100)||(0,j.prettyProjectName)(o.session.projectName)}),(0,t.jsxs)("div",{style:{fontSize:10,color:"var(--af-text-secondary)",marginBottom:6,fontFamily:"var(--font-mono)"},children:[(0,j.prettyProjectName)(o.session.projectName),o.session.model&&` \xb7 ${o.session.model}`]}),(0,t.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"3px 12px",fontSize:10,color:"var(--af-text-secondary)"},children:[(0,t.jsxs)("span",{children:["Active: ",(0,t.jsx)("strong",{children:(0,j.formatDuration)(o.session.activeMs)})]}),(0,t.jsxs)("span",{children:["Segments: ",o.session.segments.length]}),(0,t.jsxs)("span",{children:["Range: ",M(o.session.startMs),"–",M(o.session.endMs)]}),(0,t.jsxs)("span",{children:["Tokens:"," ",(0,j.formatTokens)(o.session.totalUsage.input+o.session.totalUsage.cacheRead+o.session.totalUsage.cacheWrite),"/",(0,j.formatTokens)(o.session.totalUsage.output)]})]})]})]})]}),f&&(0,t.jsx)(W,{onClose:()=>h(!1)}),null!==u&&n[u]&&(0,t.jsx)($,{burst:n[u],gantt:e,sessionEntries:s,onClose:()=>g(null),onShowInTimeline:()=>{g(null),null!==u&&(e=>{x(t=>t===e?null:e);let t=n[e],r=S.current;if(!t||!r)return;let s=220+(E(t.startMs)+E(t.endMs))/2-r.clientWidth/2;r.scrollTo({left:Math.max(0,s),behavior:"smooth"})})(u)}})]})}function T({open:e,onClose:n,rows:s,aiEnabled:i}){let[a,o]=(0,r.useState)(new Set),[l,d]=(0,r.useState)(!1),[c,p]=(0,r.useState)(!1);(0,r.useEffect)(()=>{if(!e)return;let t=e=>{"Escape"===e.key&&n()};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[e,n]);let x=async()=>{if(0===a.size)return;d(!0);let e=Array.from(a).sort().reverse();try{for(let t of e){let e=`/api/digest/day/${t}${c?"?force=1":""}`,r=await fetch(e,{method:"POST"});if(r.body){let e=r.body.getReader();for(;!(await e.read()).done;);}}}finally{d(!1),o(new Set)}};return e?(0,t.jsx)("div",{style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.4)",zIndex:200,display:"flex",justifyContent:"flex-end"},onClick:n,children:(0,t.jsxs)("div",{onClick:e=>e.stopPropagation(),style:{width:"min(440px, 100%)",height:"100%",background:"var(--af-surface-elevated)",borderLeft:"1px solid var(--af-border-subtle)",display:"flex",flexDirection:"column",boxShadow:"-12px 0 32px rgba(0,0,0,0.25)"},children:[(0,t.jsxs)("header",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"14px 18px",borderBottom:"1px solid var(--af-border-subtle)"},children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{style:{fontSize:15,fontWeight:700,margin:0},children:"Backfill digests"}),(0,t.jsx)("p",{style:{fontSize:11,color:"var(--af-text-tertiary)",margin:"2px 0 0"},children:"Each selected day enqueues a job. You can close this drawer."})]}),(0,t.jsx)("button",{type:"button",onClick:n,"aria-label":"Close",style:{background:"transparent",border:"none",color:"var(--af-text-tertiary)",fontSize:22,cursor:"pointer"},children:"×"})]}),!i&&(0,t.jsx)("div",{style:{padding:12,margin:18,background:"rgba(237,137,54,0.1)",borderRadius:6,fontSize:12,color:"var(--af-text)"},children:"AI features are off — only deterministic digests will be written. Enable AI in Settings to generate narratives."}),(0,t.jsxs)("div",{style:{display:"flex",gap:6,padding:"10px 18px",borderBottom:"1px solid var(--af-border-subtle)",flexWrap:"wrap",fontSize:11},children:[(0,t.jsx)(I,{onClick:()=>o(new Set(s.filter(e=>"pending"===e.status).map(e=>e.date))),children:"Select pending"}),(0,t.jsx)(I,{onClick:()=>o(new Set(s.filter(e=>"empty"!==e.status).map(e=>e.date))),children:"Select all with entries"}),(0,t.jsx)(I,{onClick:()=>o(new Set),children:"Clear"}),(0,t.jsxs)("label",{style:{marginLeft:"auto",display:"inline-flex",alignItems:"center",gap:4,fontSize:11,color:"var(--af-text-secondary)",cursor:"pointer"},children:[(0,t.jsx)("input",{type:"checkbox",checked:c,onChange:e=>p(e.target.checked)}),"force regen"]})]}),(0,t.jsx)("div",{style:{flex:1,overflowY:"auto"},children:s.map(e=>(0,t.jsxs)("label",{style:{display:"grid",gridTemplateColumns:"auto 110px 80px 1fr",gap:10,alignItems:"center",padding:"8px 18px",borderBottom:"1px solid var(--af-border-subtle)",fontSize:12,cursor:"empty"===e.status?"default":"pointer",opacity:"empty"===e.status?.5:1},children:[(0,t.jsx)("input",{type:"checkbox",disabled:"empty"===e.status,checked:a.has(e.date),onChange:()=>{var t;return t=e.date,void o(e=>{let r=new Set(e);return r.has(t)?r.delete(t):r.add(t),r})}}),(0,t.jsx)("span",{children:e.day_label}),(0,t.jsx)("span",{style:{fontSize:10,color:"generated"===e.status?"#48bb78":"pending"===e.status?"#ed8936":"var(--af-text-tertiary)"},children:"generated"===e.status?"✓ ready":"pending"===e.status?"• pending":"—"}),(0,t.jsxs)("span",{style:{fontFamily:"var(--font-mono)",fontSize:10,color:"var(--af-text-tertiary)",textAlign:"right"},children:[e.entry_count>0?`${e.entry_count} sess`:"",e.pr_count>0?` \xb7 ${e.pr_count} PR`:""]})]},e.date))}),(0,t.jsxs)("footer",{style:{padding:"12px 18px",borderTop:"1px solid var(--af-border-subtle)",display:"flex",gap:10,alignItems:"center"},children:[(0,t.jsxs)("span",{style:{fontSize:12,color:"var(--af-text-secondary)",flex:1},children:[a.size," day",1===a.size?"":"s"," selected"]}),(0,t.jsx)("button",{type:"button",onClick:n,style:{padding:"6px 12px",background:"transparent",border:"1px solid var(--af-border-subtle)",borderRadius:6,fontSize:12,cursor:"pointer"},children:"Cancel"}),(0,t.jsx)("button",{type:"button",onClick:x,disabled:l||0===a.size,style:{padding:"6px 14px",background:"var(--af-accent)",color:"white",border:"none",borderRadius:6,fontSize:12,fontWeight:600,cursor:l||0===a.size?"default":"pointer",opacity:l||0===a.size?.6:1},children:l?`Enqueueing… (${a.size})`:`Generate ${a.size}`})]})]})}):null}function I({onClick:e,children:r}){return(0,t.jsx)("button",{type:"button",onClick:e,style:{padding:"3px 10px",background:"transparent",border:"1px solid var(--af-border-subtle)",borderRadius:5,fontSize:11,color:"var(--af-text-secondary)",cursor:"pointer"},children:r})}var R=e.i(18566);function B(e){if(e<6e4)return`${Math.round(e/1e3)}s`;let t=Math.round(e/6e4);if(t<60)return`${t}m`;let r=Math.floor(t/60),n=t%60;return n?`${r}h ${n}m`:`${r}h`}function D({date:e,today:n,prevDay:s,nextDay:i,dayStats:a,hrefForDate:o=e=>`/day/${e}`}){let l,d,c,p,x,f,h=(0,R.useRouter)(),[u,g]=(0,r.useState)(!1),[y,m]=(0,r.useMemo)(()=>{let[t,r]=e.split("-").map(Number);return[t,r]},[e]),[v,j]=(0,r.useState)(y),[w,S]=(0,r.useState)(m),[k,z]=(0,r.useState)(null),[_,M]=(0,r.useState)(null),W=(0,r.useMemo)(()=>{let e=new Map;for(let t of a)e.set(t.date,t);return e},[a]),$=(0,r.useMemo)(()=>{let e=new Date(v,w-1,1).getDay(),t=new Date(v,w,0).getDate(),r=[];for(let t=0;t<e;t++)r.push(null);for(let e=1;e<=t;e++){let t=String(w).padStart(2,"0"),n=String(e).padStart(2,"0");r.push(`${v}-${t}-${n}`)}return r},[v,w]),C=(0,r.useMemo)(()=>{let e=0;for(let t of a)t.airTimeMs>e&&(e=t.airTimeMs);return e},[a]),T=new Date(v,w-1).toLocaleString(void 0,{month:"long",year:"numeric"}),I=e=>{let t=w+e,r=v;t<1&&(t=12,r--),t>12&&(t=1,r++),S(t),j(r)};return(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap",position:"relative"},children:[s?(0,t.jsx)(b.default,{href:o(s),style:{padding:"5px 10px",border:"1px solid var(--af-border-subtle)",borderRadius:6,fontSize:11,color:"var(--af-text-secondary)"},children:"←"}):(0,t.jsx)("span",{style:{padding:"5px 10px",opacity:.3,fontSize:11,color:"var(--af-text-tertiary)"},children:"←"}),(0,t.jsx)("button",{type:"button",onClick:()=>{j(y),S(m),g(e=>!e)},style:{padding:"5px 12px",fontSize:12,fontFamily:"var(--font-mono)",border:"1px solid var(--af-border-subtle)",borderRadius:6,background:u?"var(--af-accent-subtle)":"transparent",color:u?"var(--af-accent)":"var(--af-text)",cursor:"pointer",fontWeight:500,minWidth:120,textAlign:"center"},children:e}),i?(0,t.jsx)(b.default,{href:o(i),style:{padding:"5px 10px",border:"1px solid var(--af-border-subtle)",borderRadius:6,fontSize:11,color:"var(--af-text-secondary)"},children:"→"}):(0,t.jsx)("span",{style:{padding:"5px 10px",opacity:.3,fontSize:11,color:"var(--af-text-tertiary)"},children:"→"}),(0,t.jsx)(b.default,{href:o(n),style:{padding:"5px 12px",border:"1px solid var(--af-border-subtle)",borderRadius:6,fontSize:11,color:e===n?"var(--af-accent)":"var(--af-text-secondary)",background:e===n?"var(--af-accent-subtle)":"transparent",fontWeight:500},children:"Today"}),u&&(0,t.jsxs)("div",{style:{position:"absolute",top:"calc(100% + 8px)",left:0,zIndex:60,background:"var(--af-surface)",border:"1px solid var(--af-border-subtle)",borderRadius:10,padding:"12px 14px",boxShadow:"0 8px 28px rgba(0,0,0,0.18)",minWidth:300},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:10},children:[(0,t.jsx)("button",{type:"button",onClick:()=>I(-1),style:{background:"transparent",border:"none",cursor:"pointer",color:"var(--af-text-secondary)",fontSize:14,padding:"2px 8px",borderRadius:4},children:"‹"}),(0,t.jsx)("span",{style:{fontSize:13,fontWeight:600,color:"var(--af-text)"},children:T}),(0,t.jsx)("button",{type:"button",onClick:()=>I(1),style:{background:"transparent",border:"none",cursor:"pointer",color:"var(--af-text-secondary)",fontSize:14,padding:"2px 8px",borderRadius:4},children:"›"})]}),(0,t.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:2,marginBottom:4},children:["Su","Mo","Tu","We","Th","Fr","Sa"].map(e=>(0,t.jsx)("div",{style:{textAlign:"center",fontSize:9,color:"var(--af-text-tertiary)",fontWeight:600,padding:"2px 0"},children:e},e))}),(0,t.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:2},children:$.map((r,s)=>{if(!r)return(0,t.jsx)("div",{},`blank-${s}`);let i=W.get(r),a=i?.airTimeMs??0,l=i?.burstCount??0,d=r===e,c=r===n,p=r>n,x=a>0&&C>0?Math.min(1,a/C):0,f=parseInt(r.split("-")[2],10);return(0,t.jsxs)("button",{type:"button",onClick:()=>{g(!1),h.push(o(r))},disabled:p,onMouseEnter:e=>{if(p)return;let t=e.currentTarget.getBoundingClientRect(),n=e.currentTarget.offsetParent?.getBoundingClientRect()??t;z(r),M({x:t.left-n.left+t.width/2,y:t.bottom-n.top+6})},onMouseLeave:()=>{z(null),M(null)},style:{position:"relative",width:40,height:40,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:1,border:d?"2px solid var(--af-accent)":c?"1px solid var(--af-text-tertiary)":"1px solid transparent",borderRadius:6,background:x>0?`rgba(45, 212, 191, ${.08+.35*x})`:"transparent",color:p?"var(--af-text-tertiary)":d?"var(--af-accent)":"var(--af-text)",cursor:p?"not-allowed":"pointer",fontSize:11,fontWeight:d?700:400,fontFamily:"var(--font-mono)",padding:0,opacity:p?.4:1},children:[(0,t.jsx)("span",{style:{lineHeight:1},children:f}),a>0&&(0,t.jsx)("span",{style:{fontSize:8,color:d?"var(--af-accent)":"var(--af-text-tertiary)",lineHeight:1,fontWeight:600,marginTop:2},children:B(a)}),l>0&&(0,t.jsx)("span",{style:{position:"absolute",top:3,right:3,width:5,height:5,borderRadius:"50%",background:"rgba(167, 139, 250, 0.95)",boxShadow:"0 0 0 1px var(--af-surface)"}})]},r)})}),(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:10,marginTop:10,paddingTop:8,borderTop:"1px solid var(--af-border-subtle)",fontSize:9,color:"var(--af-text-tertiary)"},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:5},children:[(0,t.jsx)("span",{children:"less"}),(0,t.jsx)("div",{style:{display:"flex",gap:2},children:[0,.15,.3,.5,.8].map((e,r)=>(0,t.jsx)("span",{style:{width:10,height:10,borderRadius:2,background:0===e?"var(--af-border-subtle)":`rgba(45, 212, 191, ${.08+.35*e})`}},r))}),(0,t.jsx)("span",{children:"more active"})]}),(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:5},title:"Days with at least one concurrency burst",children:[(0,t.jsx)("span",{style:{width:5,height:5,borderRadius:"50%",background:"rgba(167, 139, 250, 0.95)"}}),"parallel"]})]}),k&&_&&(l=W.get(k),d=l?.sessions??0,c=l?.airTimeMs??0,p=l?.parallelMs??0,x=l?.burstCount??0,f=l?.peakConcurrency??0,(0,t.jsxs)("div",{style:{position:"absolute",left:Math.max(10,Math.min(_.x-110,290)),top:_.y,width:220,pointerEvents:"none",background:"var(--af-surface-elevated)",border:"1px solid var(--af-border-subtle)",borderRadius:8,padding:"9px 12px",boxShadow:"0 6px 22px rgba(0,0,0,0.22)",fontSize:11,color:"var(--af-text)",zIndex:65,lineHeight:1.5},children:[(0,t.jsx)("div",{style:{fontFamily:"var(--font-mono)",fontWeight:700,fontSize:11,marginBottom:4},children:k}),0===d&&0===c&&0===p?(0,t.jsx)("div",{style:{color:"var(--af-text-tertiary)",fontSize:10},children:"no activity"}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(P,{label:"sessions",value:String(d)}),(0,t.jsx)(P,{label:"active time",value:c>0?B(c):"—"}),p>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{style:{marginTop:4,paddingTop:4,borderTop:"1px dashed var(--af-border-subtle)"}}),(0,t.jsx)(P,{label:"parallel time",value:B(p)}),(0,t.jsx)(P,{label:"peak concurrency",value:`\xd7${f}`,accent:!0}),(0,t.jsx)(P,{label:"bursts",value:String(x)})]})]})]}))]})]})}function P({label:e,value:r,accent:n}){return(0,t.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",color:"var(--af-text-secondary)",fontSize:10},children:[(0,t.jsx)("span",{children:e}),(0,t.jsx)("strong",{style:{color:n?"rgba(167, 139, 250, 1)":"var(--af-text)"},children:r})]})}function H({label:e,defaultOpen:i=!0,children:a}){let[o,l]=(0,r.useState)(i);return(0,t.jsxs)("div",{style:{borderBottom:"1px solid var(--af-border-subtle)"},children:[(0,t.jsxs)("button",{type:"button",onClick:()=>l(e=>!e),style:{width:"100%",padding:"12px 40px",background:"transparent",border:"none",textAlign:"left",display:"flex",alignItems:"center",gap:8,cursor:"pointer",fontSize:11,fontWeight:700,color:"var(--af-text-tertiary)",textTransform:"uppercase",letterSpacing:"0.08em"},children:[o?(0,t.jsx)(n.ChevronDown,{size:13}):(0,t.jsx)(s.ChevronRight,{size:13}),e]}),o&&(0,t.jsx)("div",{children:a})]})}e.s(["DayView",0,function({date:e,today:n,prev:s,next:a,initial:o,entries:l,aiEnabled:d,gantt:c,bursts:p,sessionEntries:x,backfillRows:f,dayStats:h}){let[u,g]=(0,r.useState)(!1),y=l.length>0&&l.every(e=>"skipped_trivial"===e.enrichment.status),b=l.length>0&&!y,v=c.sessions.length>0,j=new Date(`${e}T12:00:00`).toLocaleDateString("en-US",{weekday:"long",month:"long",day:"numeric",year:"numeric"}),w=f.filter(e=>"pending"===e.status).length;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("nav",{style:{padding:"14px 40px",display:"flex",gap:12,fontSize:12,borderBottom:"1px solid var(--af-border-subtle)",alignItems:"center",flexWrap:"wrap"},children:[(0,t.jsx)(D,{date:e,today:n,prevDay:s,nextDay:a??void 0,dayStats:h}),(0,t.jsxs)("button",{type:"button",onClick:()=>g(!0),style:{marginLeft:"auto",display:"inline-flex",alignItems:"center",gap:5,padding:"5px 10px",background:"transparent",border:"1px solid var(--af-border-subtle)",borderRadius:6,fontSize:11,color:"var(--af-text-secondary)",cursor:"pointer"},title:"Open the backfill multi-select drawer",children:[(0,t.jsx)(i,{size:12}),"Backfill digests",w>0&&(0,t.jsx)("span",{style:{fontSize:10,color:"#ed8936",fontWeight:700},children:w})]})]}),b||v?(0,t.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:0},children:[b&&(0,t.jsx)(H,{label:"Narrative",defaultOpen:!0,children:(0,t.jsx)(m,{initial:o,entries:l,date:e,aiEnabled:d})}),v&&(0,t.jsx)(H,{label:"Timeline & concurrency",defaultOpen:!0,children:(0,t.jsx)("div",{style:{padding:"8px 40px 40px"},children:(0,t.jsx)(C,{gantt:c,bursts:p,sessionEntries:x})})})]}):(0,t.jsxs)("div",{style:{padding:"60px 40px",textAlign:"center",color:"var(--af-text-secondary)"},children:[(0,t.jsx)("div",{style:{fontSize:14,marginBottom:6},children:j}),(0,t.jsx)("div",{style:{fontSize:13,color:"var(--af-text-tertiary)"},children:"No Claude Code activity on this day."})]}),(0,t.jsx)(T,{open:u,onClose:()=>g(!1),rows:f,aiEnabled:d})]})}],92566)}]);
@@ -1 +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)},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)},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)},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)},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 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,{otherChunks:["static/chunks/0h3.-_s-k0mj3.js","static/chunks/073081qv4uyn8.js","static/chunks/0l4e3as18eexy.js","static/chunks/0gblp_v.kiu-..js"],runtimeModuleIds:[94553]}]),(()=>{let e;if(!Array.isArray(globalThis.TURBOPACK))return;let t="/_next/",r=function(){if(null!=self.TURBOPACK_ASSET_SUFFIX)return self.TURBOPACK_ASSET_SUFFIX;let e=document?.currentScript?.getAttribute?.("src")??"",t=e.indexOf("?");return t>=0?e.slice(t):""}(),n=["NEXT_DEPLOYMENT_ID","NEXT_CLIENT_ASSET_SUFFIX"];var o,i=((o=i||{})[o.Runtime=0]="Runtime",o[o.Parent=1]="Parent",o[o.Update=2]="Update",o);let l=new WeakMap;function s(e,t){this.m=e,this.e=t}let u=s.prototype,a=Object.prototype.hasOwnProperty,c="u">typeof Symbol&&Symbol.toStringTag;function f(e,t,r){a.call(e,t)||Object.defineProperty(e,t,r)}function p(e,t){let r=e[t];return r||(r=h(t),e[t]=r),r}function h(e){return{exports:{},error:void 0,id:e,namespaceObject:void 0}}function d(e,t){f(e,"__esModule",{value:!0}),c&&f(e,c,{value:"Module"});let r=0;for(;r<t.length;){let n=t[r++],o=t[r++];if("number"==typeof o)if(0===o)f(e,n,{value:t[r++],enumerable:!0,writable:!1});else throw Error(`unexpected tag: ${o}`);else"function"==typeof t[r]?f(e,n,{get:o,set:t[r++],enumerable:!0}):f(e,n,{get:o,enumerable:!0})}Object.seal(e)}function m(e,t){(null!=t?p(this.c,t):this.m).exports=e}u.s=function(e,t){let r,n;null!=t?n=(r=p(this.c,t)).exports:(r=this.m,n=this.e),r.namespaceObject=n,d(n,e)},u.j=function(e,t){var r,n;let o,i,s;null!=t?i=(o=p(this.c,t)).exports:(o=this.m,i=this.e);let u=(r=o,n=i,(s=l.get(r))||(l.set(r,s=[]),r.exports=r.namespaceObject=new Proxy(n,{get(e,t){if(a.call(e,t)||"default"===t||"__esModule"===t)return Reflect.get(e,t);for(let e of s){let r=Reflect.get(e,t);if(void 0!==r)return r}},ownKeys(e){let t=Reflect.ownKeys(e);for(let e of s)for(let r of Reflect.ownKeys(e))"default"===r||t.includes(r)||t.push(r);return t}})),s);"object"==typeof e&&null!==e&&u.push(e)},u.v=m,u.n=function(e,t){let r;(r=null!=t?p(this.c,t):this.m).exports=r.namespaceObject=e};let b=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,y=[null,b({}),b([]),b(b)];function g(e,t,r){let n=[],o=-1;for(let t=e;("object"==typeof t||"function"==typeof t)&&!y.includes(t);t=b(t))for(let r of Object.getOwnPropertyNames(t))n.push(r,function(e,t){return()=>e[t]}(e,r)),-1===o&&"default"===r&&(o=n.length-1);return r&&o>=0||(o>=0?n.splice(o,1,0,e):n.push("default",0,e)),d(t,n),t}function O(e){let t=B(e,this.m);if(t.namespaceObject)return t.namespaceObject;let r=t.exports;return t.namespaceObject=g(r,"function"==typeof r?function(...e){return r.apply(this,e)}:Object.create(null),r&&r.__esModule)}function w(e){let t=e.indexOf("#");-1!==t&&(e=e.substring(0,t));let r=e.indexOf("?");return -1!==r&&(e=e.substring(0,r)),e}function k(){let e,t;return{promise:new Promise((r,n)=>{t=n,e=r}),resolve:e,reject:t}}u.i=O,u.A=function(e){return this.r(e)(O.bind(this))},u.t="function"==typeof require?require:function(){throw Error("Unexpected use of runtime require")},u.r=function(e){return B(e,this.m).exports},u.f=function(e){function t(t){if(t=w(t),a.call(e,t))return e[t].module();let r=Error(`Cannot find module '${t}'`);throw r.code="MODULE_NOT_FOUND",r}return t.keys=()=>Object.keys(e),t.resolve=t=>{if(t=w(t),a.call(e,t))return e[t].id();let r=Error(`Cannot find module '${t}'`);throw r.code="MODULE_NOT_FOUND",r},t.import=async e=>await t(e),t};let j=Symbol("turbopack queues"),v=Symbol("turbopack exports"),U=Symbol("turbopack error");function C(e){e&&1!==e.status&&(e.status=1,e.forEach(e=>e.queueCount--),e.forEach(e=>e.queueCount--?e.queueCount++:e()))}u.a=function(e,t){let r=this.m,n=t?Object.assign([],{status:-1}):void 0,o=new Set,{resolve:i,reject:l,promise:s}=k(),u=Object.assign(s,{[v]:r.exports,[j]:e=>{n&&e(n),o.forEach(e),u.catch(()=>{})}}),a={get:()=>u,set(e){e!==u&&(u[v]=e)}};Object.defineProperty(r,"exports",a),Object.defineProperty(r,"namespaceObject",a),e(function(e){let t=e.map(e=>{if(null!==e&&"object"==typeof e){if(j in e)return e;if(null!=e&&"object"==typeof e&&"then"in e&&"function"==typeof e.then){let t=Object.assign([],{status:0}),r={[v]:{},[j]:e=>e(t)};return e.then(e=>{r[v]=e,C(t)},e=>{r[U]=e,C(t)}),r}}return{[v]:e,[j]:()=>{}}}),r=()=>t.map(e=>{if(e[U])throw e[U];return e[v]}),{promise:i,resolve:l}=k(),s=Object.assign(()=>l(r),{queueCount:0});function u(e){e!==n&&!o.has(e)&&(o.add(e),e&&0===e.status&&(s.queueCount++,e.push(s)))}return t.map(e=>e[j](u)),s.queueCount?i:r()},function(e){e?l(u[U]=e):i(u[v]),C(n)}),n&&-1===n.status&&(n.status=0)};let P=function(e){let t=new URL(e,"x:/"),r={};for(let e in t)r[e]=t[e];for(let t in r.href=e,r.pathname=e.replace(/[?#].*/,""),r.origin=r.protocol="",r.toString=r.toJSON=(...t)=>e,r)Object.defineProperty(this,t,{enumerable:!0,configurable:!0,value:r[t]})};function R(e,t){throw Error(`Invariant: ${t(e)}`)}P.prototype=URL.prototype,u.U=P,u.z=function(e){throw Error("dynamic usage of require is not supported")},u.g=globalThis;let S=s.prototype,$=new Map;u.M=$;let _=new Map,E=new Map;async function T(e,t,r){let n;if("string"==typeof r)return M(e,t,N(r));let o=r.included||[],i=o.map(e=>!!$.has(e)||_.get(e));if(i.length>0&&i.every(e=>e))return void await Promise.all(i);let l=r.moduleChunks||[],s=l.map(e=>E.get(e)).filter(e=>e);if(s.length>0){if(s.length===l.length)return void await Promise.all(s);let r=new Set;for(let e of l)E.has(e)||r.add(e);for(let n of r){let r=M(e,t,N(n));E.set(n,r),s.push(r)}n=Promise.all(s)}else{for(let o of(n=M(e,t,N(r.path)),l))E.has(o)||E.set(o,n)}for(let e of o)_.has(e)||_.set(e,n);await n}S.l=function(e){return T(i.Parent,this.m.id,e)};let A=Promise.resolve(void 0),x=new WeakMap;function M(t,r,n){let o=e.loadChunkCached(t,n),l=x.get(o);if(void 0===l){let e=x.set.bind(x,o,A);l=o.then(e).catch(e=>{let o;switch(t){case i.Runtime:o=`as a runtime dependency of chunk ${r}`;break;case i.Parent:o=`from module ${r}`;break;case i.Update:o="from an HMR update";break;default:R(t,e=>`Unknown source type: ${e}`)}let l=Error(`Failed to load chunk ${n} ${o}${e?`: ${e}`:""}`,e?{cause:e}:void 0);throw l.name="ChunkLoadError",l}),x.set(o,l)}return l}function N(e){return`${t}${e.split("/").map(e=>encodeURIComponent(e)).join("/")}${r}`}S.L=function(e){return M(i.Parent,this.m.id,e)},S.R=function(e){let t=this.r(e);return t?.default??t},S.P=function(e){return`/ROOT/${e??""}`},S.q=function(e,t){m.call(this,`${e}${r}`,t)},S.b=function(e,t,o,i){let l="SharedWorker"===e.name,s=[o.map(e=>N(e)).reverse(),r];for(let e of n)s.push(globalThis[e]);let u=new URL(N(t),location.origin),a=JSON.stringify(s);return l?u.searchParams.set("params",a):u.hash="#params="+encodeURIComponent(a),new e(u,i?{...i,type:void 0}:void 0)};let q=/\.js(?:\?[^#]*)?(?:#.*)?$/,K=/\.css(?:\?[^#]*)?(?:#.*)?$/;function L(e){return K.test(e)}u.w=function(t,r,n){return e.loadWebAssembly(i.Parent,this.m.id,t,r,n)},u.u=function(t,r){return e.loadWebAssemblyModule(i.Parent,this.m.id,t,r)};let I={};u.c=I;let B=(e,t)=>{let r=I[e];if(r){if(r.error)throw r.error;return r}return W(e,i.Parent,t.id)};function W(e,t,r){let n=$.get(e);if("function"!=typeof n)throw Error(function(e,t,r){let n;switch(t){case 0:n=`as a runtime entry of chunk ${r}`;break;case 1:n=`because it was required from module ${r}`;break;case 2:n="because of an HMR update";break;default:R(t,e=>`Unknown source type: ${e}`)}return`Module ${e} was instantiated ${n}, but the module factory is not available.`}(e,t,r));let o=h(e),i=o.exports;I[e]=o;let l=new s(o,i);try{n(l,o,i)}catch(e){throw o.error=e,e}return o.namespaceObject&&o.exports!==o.namespaceObject&&g(o.exports,o.namespaceObject),o}function F(t){let r,n=function(e){if("string"==typeof e)return e;if(e)return{src:e.getAttribute("src")};if("u">typeof TURBOPACK_NEXT_CHUNK_URLS)return{src:TURBOPACK_NEXT_CHUNK_URLS.pop()};throw Error("chunk path empty but not in a worker")}(t[0]);return 2===t.length?r=t[1]:(r=void 0,!function(e,t){let r=1;for(;r<e.length;){let n,o=r+1;for(;o<e.length&&"function"!=typeof e[o];)o++;if(o===e.length)throw Error("malformed chunk format, expected a factory function");let i=e[o];for(let i=r;i<o;i++){let r=e[i],o=t.get(r);if(o){n=o;break}}let l=n??i,s=!1;for(let n=r;n<o;n++){let r=e[n];t.has(r)||(s||(l===i&&Object.defineProperty(i,"name",{value:"module evaluation"}),s=!0),t.set(r,l))}r=o+1}}(t,$)),e.registerChunk(n,r)}let X=new Map;function D(e){let t=X.get(e);if(!t){let r,n;t={resolved:!1,loadingStarted:!1,promise:new Promise((e,t)=>{r=e,n=t}),resolve:()=>{t.resolved=!0,r()},reject:n},X.set(e,t)}return t}e={async registerChunk(e,r){let n=function(e){if("string"==typeof e)return e;let r=decodeURIComponent(e.src.replace(/[?#].*$/,""));return r.startsWith(t)?r.slice(t.length):r}(e);if(D("string"==typeof e?N(e):e.src).resolve(),null!=r){for(let e of r.otherChunks)D(N("string"==typeof e?e:e.path));if(await Promise.all(r.otherChunks.map(e=>T(i.Runtime,n,e))),r.runtimeModuleIds.length>0)for(let e of r.runtimeModuleIds)!function(e,t){let r=I[t];if(r){if(r.error)throw r.error;return}W(t,i.Runtime,e)}(n,e)}},loadChunkCached:(e,t)=>(function(e,t){let r=D(t);if(r.loadingStarted)return r.promise;if(e===i.Runtime)return r.loadingStarted=!0,L(t)&&r.resolve(),r.promise;if("function"==typeof importScripts)if(L(t));else if(q.test(t))self.TURBOPACK_NEXT_CHUNK_URLS.push(t),importScripts(t);else throw Error(`can't infer type of chunk from URL ${t} in worker`);else{let e=decodeURI(t);if(L(t))if(document.querySelectorAll(`link[rel=stylesheet][href="${t}"],link[rel=stylesheet][href^="${t}?"],link[rel=stylesheet][href="${e}"],link[rel=stylesheet][href^="${e}?"]`).length>0)r.resolve();else{let e=document.createElement("link");e.rel="stylesheet",e.href=t,e.onerror=()=>{r.reject()},e.onload=()=>{r.resolve()},document.head.appendChild(e)}else if(q.test(t)){let n=document.querySelectorAll(`script[src="${t}"],script[src^="${t}?"],script[src="${e}"],script[src^="${e}?"]`);if(n.length>0)for(let e of Array.from(n))e.addEventListener("error",()=>{r.reject()});else{let e=document.createElement("script");e.src=t,e.onerror=()=>{r.reject()},document.head.appendChild(e)}}else throw Error(`can't infer type of chunk from URL ${t}`)}return r.loadingStarted=!0,r.promise})(e,t),async loadWebAssembly(e,t,r,n,o){let i=fetch(N(r)),{instance:l}=await WebAssembly.instantiateStreaming(i,o);return l.exports},async loadWebAssemblyModule(e,t,r,n){let o=fetch(N(r));return await WebAssembly.compileStreaming(o)}};let H=globalThis.TURBOPACK;globalThis.TURBOPACK={push:F},H.forEach(F)})();
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,{otherChunks:["static/chunks/0i.hc~2bj0_3d.js","static/chunks/0p--hzrway8~3.js","static/chunks/0g223u9amib0q.js","static/chunks/0qv-gw888_5nu.js"],runtimeModuleIds:[94553]}]),(()=>{let e;if(!Array.isArray(globalThis.TURBOPACK))return;let t="/_next/",r=function(){if(null!=self.TURBOPACK_ASSET_SUFFIX)return self.TURBOPACK_ASSET_SUFFIX;let e=document?.currentScript?.getAttribute?.("src")??"",t=e.indexOf("?");return t>=0?e.slice(t):""}(),n=["NEXT_DEPLOYMENT_ID","NEXT_CLIENT_ASSET_SUFFIX"];var o,i=((o=i||{})[o.Runtime=0]="Runtime",o[o.Parent=1]="Parent",o[o.Update=2]="Update",o);let l=new WeakMap;function s(e,t){this.m=e,this.e=t}let u=s.prototype,a=Object.prototype.hasOwnProperty,c="u">typeof Symbol&&Symbol.toStringTag;function f(e,t,r){a.call(e,t)||Object.defineProperty(e,t,r)}function p(e,t){let r=e[t];return r||(r=h(t),e[t]=r),r}function h(e){return{exports:{},error:void 0,id:e,namespaceObject:void 0}}function d(e,t){f(e,"__esModule",{value:!0}),c&&f(e,c,{value:"Module"});let r=0;for(;r<t.length;){let n=t[r++],o=t[r++];if("number"==typeof o)if(0===o)f(e,n,{value:t[r++],enumerable:!0,writable:!1});else throw Error(`unexpected tag: ${o}`);else"function"==typeof t[r]?f(e,n,{get:o,set:t[r++],enumerable:!0}):f(e,n,{get:o,enumerable:!0})}Object.seal(e)}function m(e,t){(null!=t?p(this.c,t):this.m).exports=e}u.s=function(e,t){let r,n;null!=t?n=(r=p(this.c,t)).exports:(r=this.m,n=this.e),r.namespaceObject=n,d(n,e)},u.j=function(e,t){var r,n;let o,i,s;null!=t?i=(o=p(this.c,t)).exports:(o=this.m,i=this.e);let u=(r=o,n=i,(s=l.get(r))||(l.set(r,s=[]),r.exports=r.namespaceObject=new Proxy(n,{get(e,t){if(a.call(e,t)||"default"===t||"__esModule"===t)return Reflect.get(e,t);for(let e of s){let r=Reflect.get(e,t);if(void 0!==r)return r}},ownKeys(e){let t=Reflect.ownKeys(e);for(let e of s)for(let r of Reflect.ownKeys(e))"default"===r||t.includes(r)||t.push(r);return t}})),s);"object"==typeof e&&null!==e&&u.push(e)},u.v=m,u.n=function(e,t){let r;(r=null!=t?p(this.c,t):this.m).exports=r.namespaceObject=e};let b=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,y=[null,b({}),b([]),b(b)];function g(e,t,r){let n=[],o=-1;for(let t=e;("object"==typeof t||"function"==typeof t)&&!y.includes(t);t=b(t))for(let r of Object.getOwnPropertyNames(t))n.push(r,function(e,t){return()=>e[t]}(e,r)),-1===o&&"default"===r&&(o=n.length-1);return r&&o>=0||(o>=0?n.splice(o,1,0,e):n.push("default",0,e)),d(t,n),t}function w(e){let t=B(e,this.m);if(t.namespaceObject)return t.namespaceObject;let r=t.exports;return t.namespaceObject=g(r,"function"==typeof r?function(...e){return r.apply(this,e)}:Object.create(null),r&&r.__esModule)}function O(e){let t=e.indexOf("#");-1!==t&&(e=e.substring(0,t));let r=e.indexOf("?");return -1!==r&&(e=e.substring(0,r)),e}function j(){let e,t;return{promise:new Promise((r,n)=>{t=n,e=r}),resolve:e,reject:t}}u.i=w,u.A=function(e){return this.r(e)(w.bind(this))},u.t="function"==typeof require?require:function(){throw Error("Unexpected use of runtime require")},u.r=function(e){return B(e,this.m).exports},u.f=function(e){function t(t){if(t=O(t),a.call(e,t))return e[t].module();let r=Error(`Cannot find module '${t}'`);throw r.code="MODULE_NOT_FOUND",r}return t.keys=()=>Object.keys(e),t.resolve=t=>{if(t=O(t),a.call(e,t))return e[t].id();let r=Error(`Cannot find module '${t}'`);throw r.code="MODULE_NOT_FOUND",r},t.import=async e=>await t(e),t};let k=Symbol("turbopack queues"),U=Symbol("turbopack exports"),v=Symbol("turbopack error");function C(e){e&&1!==e.status&&(e.status=1,e.forEach(e=>e.queueCount--),e.forEach(e=>e.queueCount--?e.queueCount++:e()))}u.a=function(e,t){let r=this.m,n=t?Object.assign([],{status:-1}):void 0,o=new Set,{resolve:i,reject:l,promise:s}=j(),u=Object.assign(s,{[U]:r.exports,[k]:e=>{n&&e(n),o.forEach(e),u.catch(()=>{})}}),a={get:()=>u,set(e){e!==u&&(u[U]=e)}};Object.defineProperty(r,"exports",a),Object.defineProperty(r,"namespaceObject",a),e(function(e){let t=e.map(e=>{if(null!==e&&"object"==typeof e){if(k in e)return e;if(null!=e&&"object"==typeof e&&"then"in e&&"function"==typeof e.then){let t=Object.assign([],{status:0}),r={[U]:{},[k]:e=>e(t)};return e.then(e=>{r[U]=e,C(t)},e=>{r[v]=e,C(t)}),r}}return{[U]:e,[k]:()=>{}}}),r=()=>t.map(e=>{if(e[v])throw e[v];return e[U]}),{promise:i,resolve:l}=j(),s=Object.assign(()=>l(r),{queueCount:0});function u(e){e!==n&&!o.has(e)&&(o.add(e),e&&0===e.status&&(s.queueCount++,e.push(s)))}return t.map(e=>e[k](u)),s.queueCount?i:r()},function(e){e?l(u[v]=e):i(u[U]),C(n)}),n&&-1===n.status&&(n.status=0)};let P=function(e){let t=new URL(e,"x:/"),r={};for(let e in t)r[e]=t[e];for(let t in r.href=e,r.pathname=e.replace(/[?#].*/,""),r.origin=r.protocol="",r.toString=r.toJSON=(...t)=>e,r)Object.defineProperty(this,t,{enumerable:!0,configurable:!0,value:r[t]})};function R(e,t){throw Error(`Invariant: ${t(e)}`)}P.prototype=URL.prototype,u.U=P,u.z=function(e){throw Error("dynamic usage of require is not supported")},u.g=globalThis;let S=s.prototype,$=new Map;u.M=$;let _=new Map,E=new Map;async function T(e,t,r){let n;if("string"==typeof r)return M(e,t,q(r));let o=r.included||[],i=o.map(e=>!!$.has(e)||_.get(e));if(i.length>0&&i.every(e=>e))return void await Promise.all(i);let l=r.moduleChunks||[],s=l.map(e=>E.get(e)).filter(e=>e);if(s.length>0){if(s.length===l.length)return void await Promise.all(s);let r=new Set;for(let e of l)E.has(e)||r.add(e);for(let n of r){let r=M(e,t,q(n));E.set(n,r),s.push(r)}n=Promise.all(s)}else{for(let o of(n=M(e,t,q(r.path)),l))E.has(o)||E.set(o,n)}for(let e of o)_.has(e)||_.set(e,n);await n}S.l=function(e){return T(i.Parent,this.m.id,e)};let A=Promise.resolve(void 0),x=new WeakMap;function M(t,r,n){let o=e.loadChunkCached(t,n),l=x.get(o);if(void 0===l){let e=x.set.bind(x,o,A);l=o.then(e).catch(e=>{let o;switch(t){case i.Runtime:o=`as a runtime dependency of chunk ${r}`;break;case i.Parent:o=`from module ${r}`;break;case i.Update:o="from an HMR update";break;default:R(t,e=>`Unknown source type: ${e}`)}let l=Error(`Failed to load chunk ${n} ${o}${e?`: ${e}`:""}`,e?{cause:e}:void 0);throw l.name="ChunkLoadError",l}),x.set(o,l)}return l}function q(e){return`${t}${e.split("/").map(e=>encodeURIComponent(e)).join("/")}${r}`}S.L=function(e){return M(i.Parent,this.m.id,e)},S.R=function(e){let t=this.r(e);return t?.default??t},S.P=function(e){return`/ROOT/${e??""}`},S.q=function(e,t){m.call(this,`${e}${r}`,t)},S.b=function(e,t,o,i){let l="SharedWorker"===e.name,s=[o.map(e=>q(e)).reverse(),r];for(let e of n)s.push(globalThis[e]);let u=new URL(q(t),location.origin),a=JSON.stringify(s);return l?u.searchParams.set("params",a):u.hash="#params="+encodeURIComponent(a),new e(u,i?{...i,type:void 0}:void 0)};let N=/\.js(?:\?[^#]*)?(?:#.*)?$/,K=/\.css(?:\?[^#]*)?(?:#.*)?$/;function L(e){return K.test(e)}u.w=function(t,r,n){return e.loadWebAssembly(i.Parent,this.m.id,t,r,n)},u.u=function(t,r){return e.loadWebAssemblyModule(i.Parent,this.m.id,t,r)};let I={};u.c=I;let B=(e,t)=>{let r=I[e];if(r){if(r.error)throw r.error;return r}return W(e,i.Parent,t.id)};function W(e,t,r){let n=$.get(e);if("function"!=typeof n)throw Error(function(e,t,r){let n;switch(t){case 0:n=`as a runtime entry of chunk ${r}`;break;case 1:n=`because it was required from module ${r}`;break;case 2:n="because of an HMR update";break;default:R(t,e=>`Unknown source type: ${e}`)}return`Module ${e} was instantiated ${n}, but the module factory is not available.`}(e,t,r));let o=h(e),i=o.exports;I[e]=o;let l=new s(o,i);try{n(l,o,i)}catch(e){throw o.error=e,e}return o.namespaceObject&&o.exports!==o.namespaceObject&&g(o.exports,o.namespaceObject),o}function F(t){let r,n=function(e){if("string"==typeof e)return e;if(e)return{src:e.getAttribute("src")};if("u">typeof TURBOPACK_NEXT_CHUNK_URLS)return{src:TURBOPACK_NEXT_CHUNK_URLS.pop()};throw Error("chunk path empty but not in a worker")}(t[0]);return 2===t.length?r=t[1]:(r=void 0,!function(e,t){let r=1;for(;r<e.length;){let n,o=r+1;for(;o<e.length&&"function"!=typeof e[o];)o++;if(o===e.length)throw Error("malformed chunk format, expected a factory function");let i=e[o];for(let i=r;i<o;i++){let r=e[i],o=t.get(r);if(o){n=o;break}}let l=n??i,s=!1;for(let n=r;n<o;n++){let r=e[n];t.has(r)||(s||(l===i&&Object.defineProperty(i,"name",{value:"module evaluation"}),s=!0),t.set(r,l))}r=o+1}}(t,$)),e.registerChunk(n,r)}let X=new Map;function D(e){let t=X.get(e);if(!t){let r,n;t={resolved:!1,loadingStarted:!1,promise:new Promise((e,t)=>{r=e,n=t}),resolve:()=>{t.resolved=!0,r()},reject:n},X.set(e,t)}return t}e={async registerChunk(e,r){let n=function(e){if("string"==typeof e)return e;let r=decodeURIComponent(e.src.replace(/[?#].*$/,""));return r.startsWith(t)?r.slice(t.length):r}(e);if(D("string"==typeof e?q(e):e.src).resolve(),null!=r){for(let e of r.otherChunks)D(q("string"==typeof e?e:e.path));if(await Promise.all(r.otherChunks.map(e=>T(i.Runtime,n,e))),r.runtimeModuleIds.length>0)for(let e of r.runtimeModuleIds)!function(e,t){let r=I[t];if(r){if(r.error)throw r.error;return}W(t,i.Runtime,e)}(n,e)}},loadChunkCached:(e,t)=>(function(e,t){let r=D(t);if(r.loadingStarted)return r.promise;if(e===i.Runtime)return r.loadingStarted=!0,L(t)&&r.resolve(),r.promise;if("function"==typeof importScripts)if(L(t));else if(N.test(t))self.TURBOPACK_NEXT_CHUNK_URLS.push(t),importScripts(t);else throw Error(`can't infer type of chunk from URL ${t} in worker`);else{let e=decodeURI(t);if(L(t))if(document.querySelectorAll(`link[rel=stylesheet][href="${t}"],link[rel=stylesheet][href^="${t}?"],link[rel=stylesheet][href="${e}"],link[rel=stylesheet][href^="${e}?"]`).length>0)r.resolve();else{let e=document.createElement("link");e.rel="stylesheet",e.href=t,e.onerror=()=>{r.reject()},e.onload=()=>{r.resolve()},document.head.appendChild(e)}else if(N.test(t)){let n=document.querySelectorAll(`script[src="${t}"],script[src^="${t}?"],script[src="${e}"],script[src^="${e}?"]`);if(n.length>0)for(let e of Array.from(n))e.addEventListener("error",()=>{r.reject()});else{let e=document.createElement("script");e.src=t,e.onerror=()=>{r.reject()},document.head.appendChild(e)}}else throw Error(`can't infer type of chunk from URL ${t}`)}return r.loadingStarted=!0,r.promise})(e,t),async loadWebAssembly(e,t,r,n,o){let i=fetch(q(r)),{instance:l}=await WebAssembly.instantiateStreaming(i,o);return l.exports},async loadWebAssemblyModule(e,t,r,n){let o=fetch(q(r));return await WebAssembly.compileStreaming(o)}};let H=globalThis.TURBOPACK;globalThis.TURBOPACK={push:F},H.forEach(F)})();