forge-openclaw-plugin 0.3.2 → 0.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (214) hide show
  1. package/dist/assets/action-bar-CMGr_Uv_.js +1 -0
  2. package/dist/assets/activity-page-DwGKkJtr.js +1 -0
  3. package/dist/assets/ai-surface-workspace-UtnoNmjq.js +1 -0
  4. package/dist/assets/{atlas-panel-G3wGxjYf.js → atlas-panel-f1kc-LkD.js} +1 -1
  5. package/dist/assets/{board-dIX6etHh.js → board-CLOHbg6t.js} +1 -1
  6. package/dist/assets/calendar-page-C4YqeVrC.js +1 -0
  7. package/dist/assets/calendar-rules-BQppCPiN.js +1 -0
  8. package/dist/assets/{calendar-week-toolbar-CWSK5hJl.js → calendar-week-toolbar-DdPuHUwd.js} +1 -1
  9. package/dist/assets/{charts-DFnEuIMB.js → charts-DwTguE_x.js} +1 -1
  10. package/dist/assets/companion-sync-lab-page-N3cR33GS.js +1 -0
  11. package/dist/assets/daily-metrics-dashboard-CXnAtN2T.js +1 -0
  12. package/dist/assets/define-workbench-box-DkffygDU.js +1 -0
  13. package/dist/assets/entity-link-multiselect-wuyJ8BbW.js +1 -0
  14. package/dist/assets/{entity-note-count-link-ef3ZOpKM.js → entity-note-count-link-CEtKyMAl.js} +1 -1
  15. package/dist/assets/entity-notes-surface-iKNiierJ.js +1 -0
  16. package/dist/assets/execution-board-DesFZ1f5.js +1 -0
  17. package/dist/assets/{faceted-token-search-CZmtyJTT.js → faceted-token-search-D4Okr-Kr.js} +1 -1
  18. package/dist/assets/{flagship-signal-deck-DxRfmfpN.js → flagship-signal-deck-CW91n6u9.js} +1 -1
  19. package/dist/assets/{floating-action-menu-cKjNsPYD.js → floating-action-menu-GCeuOdYZ.js} +1 -1
  20. package/dist/assets/{forms-hB0SqEh-.js → forms-C5d5hTf2.js} +1 -1
  21. package/dist/assets/generic-node-view-COhU_Wm3.js +10 -0
  22. package/dist/assets/goal-detail-page-Bd8JU3IK.js +1 -0
  23. package/dist/assets/goal-dialog-CLz5fYhO.js +1 -0
  24. package/dist/assets/goals-page-CZHNVyY-.js +1 -0
  25. package/dist/assets/{graph-DDUZNRsO.js → graph-Cd5WF3lw.js} +1 -1
  26. package/dist/assets/habits-page-CXiBB7_N.js +1 -0
  27. package/dist/assets/health-boxes-BUcsxDLh.js +1 -0
  28. package/dist/assets/index-BejvcRGb.js +2 -0
  29. package/dist/assets/{index-Bcem7l5u.css → index-CEgIwgk9.css} +1 -1
  30. package/dist/assets/inline-note-fields-CcRDO3pd.js +1 -0
  31. package/dist/assets/insight-flow-dialog-DUBk2MR8.js +1 -0
  32. package/dist/assets/{insights-page-DHG-o9P_.js → insights-page-8fLhCYsM.js} +3 -3
  33. package/dist/assets/kanban-boxes-CH7plRk1.js +1 -0
  34. package/dist/assets/kanban-page-Bq-aYwUL.js +1 -0
  35. package/dist/assets/knowledge-graph-page-DYFfWh4Y.js +1 -0
  36. package/dist/assets/life-force-page-D80rgBBR.js +1 -0
  37. package/dist/assets/{life-force-workspace-sszLD-Yn.js → life-force-workspace-CcmZRRfU.js} +1 -1
  38. package/dist/assets/{maps-C-yOWiDN.js → maps-D0Mm6WPG.js} +1 -1
  39. package/dist/assets/{metric-tile-B-tDTcBt.js → metric-tile-DysHMgM3.js} +1 -1
  40. package/dist/assets/{motion-Lt5B1XuE.js → motion-DwjmC9aq.js} +1 -1
  41. package/dist/assets/movement-boxes-BH3botKt.js +1 -0
  42. package/dist/assets/movement-page-D5KLMKS9.js +1 -0
  43. package/dist/assets/{note-markdown-CCyyE85h.js → note-markdown-Byd_vNkS.js} +1 -1
  44. package/dist/assets/note-tags-input-DYAFDq8Q.js +1 -0
  45. package/dist/assets/notes-boxes-CPiPps1e.js +1 -0
  46. package/dist/assets/notes-page-DehVrOOb.js +1 -0
  47. package/dist/assets/{open-in-graph-button-CMjJZX7G.js → open-in-graph-button-L21MKsb5.js} +1 -1
  48. package/dist/assets/{orbit-map-v2Pv9RU_.js → orbit-map-ChJOQ8CN.js} +1 -1
  49. package/dist/assets/overview-page-D_ewyeWF.js +1 -0
  50. package/dist/assets/page-hero-DlHEJ0Yt.js +1 -0
  51. package/dist/assets/pill-cluster-DhOR4m7X.js +1 -0
  52. package/dist/assets/{preference-entity-handoff-button-CKDxCnbl.js → preference-entity-handoff-button-ugHU2us9.js} +1 -1
  53. package/dist/assets/preferences-page-BTTXeSDR.js +1 -0
  54. package/dist/assets/{project-collections-NBwk6yV-.js → project-collections-USb6PUe0.js} +1 -1
  55. package/dist/assets/project-detail-page-1tD6tUsB.js +1 -0
  56. package/dist/assets/project-dialog-BaHhJqP6.js +1 -0
  57. package/dist/assets/project-management-hierarchy-page-D4HV8QXs.js +1 -0
  58. package/dist/assets/project-management-section-nav-9OV6_ifH.js +1 -0
  59. package/dist/assets/projects-boxes-AyudWls3.js +1 -0
  60. package/dist/assets/projects-page-DizVVzbt.js +1 -0
  61. package/dist/assets/psyche-behaviors-page-CX5MJjWj.js +5 -0
  62. package/dist/assets/psyche-flashcards-page-DzCGy-FV.js +1 -0
  63. package/dist/assets/psyche-goal-map-page-BcKR792E.js +1 -0
  64. package/dist/assets/psyche-graph-BNllZR67.js +1 -0
  65. package/dist/assets/psyche-metrics-page-CpEKlZLO.js +1 -0
  66. package/dist/assets/psyche-mode-guide-page-DXKSE2o7.js +1 -0
  67. package/dist/assets/psyche-modes-page-Bh6eeNm1.js +1 -0
  68. package/dist/assets/psyche-page-B44RJrrC.js +1 -0
  69. package/dist/assets/psyche-patterns-page-Bm7T5FMJ.js +5 -0
  70. package/dist/assets/psyche-questionnaire-builder-page-BNtMNjY8.js +1 -0
  71. package/dist/assets/psyche-questionnaire-detail-page-BnMXErRK.js +1 -0
  72. package/dist/assets/psyche-questionnaire-run-detail-page-CWKxbdwZ.js +1 -0
  73. package/dist/assets/psyche-questionnaire-run-page-DwH7Sk52.js +1 -0
  74. package/dist/assets/psyche-questionnaires-page-B1t_a8QU.js +1 -0
  75. package/dist/assets/{psyche-report-detail-page-Ci14mNUK.js → psyche-report-detail-page-x2AtC99e.js} +3 -3
  76. package/dist/assets/psyche-reports-page-KiwCgWPa.js +1 -0
  77. package/dist/assets/{psyche-schemas-Dxj554nU.js → psyche-schemas-Dtskzvv1.js} +1 -1
  78. package/dist/assets/psyche-schemas-beliefs-page-CIEoAJAp.js +9 -0
  79. package/dist/assets/psyche-screen-time-page-DO6UycL9.js +1 -0
  80. package/dist/assets/psyche-self-observation-page-CPcpUSdm.js +1 -0
  81. package/dist/assets/psyche-values-page-BAgNeo4L.js +5 -0
  82. package/dist/assets/question-flow-dialog-BByFV8Yw.js +2 -0
  83. package/dist/assets/{report-chain-fields-CbkT7WOO.js → report-chain-fields-BpRWMp7h.js} +1 -1
  84. package/dist/assets/rewards-page-kIiX8SHn.js +1 -0
  85. package/dist/assets/{scheduling-rules-editor-BUGnZJ0g.js → scheduling-rules-editor-oQXGcL5l.js} +1 -1
  86. package/dist/assets/{schema-badge-CLAA4p-b.js → schema-badge-BoNjw3h4.js} +1 -1
  87. package/dist/assets/schemas-IBbtdPzn.js +1 -0
  88. package/dist/assets/{select-menu-Cqs5t3ng.js → select-menu-U-YryCwP.js} +1 -1
  89. package/dist/assets/{settings-agents-page-pmkVrOO8.js → settings-agents-page-CbHeMq3e.js} +4 -4
  90. package/dist/assets/settings-bin-page-LxS2YPsA.js +1 -0
  91. package/dist/assets/{settings-calendar-page-BBjAMOCf.js → settings-calendar-page-CZc-I-HK.js} +3 -3
  92. package/dist/assets/settings-data-page-m-aBRMR9.js +1 -0
  93. package/dist/assets/settings-logs-page-BUEGWlQu.js +1 -0
  94. package/dist/assets/settings-mobile-page-C_5CHjHl.js +1 -0
  95. package/dist/assets/settings-models-page-B4HQu8kL.js +1 -0
  96. package/dist/assets/settings-page-CY8N-fNV.js +1 -0
  97. package/dist/assets/settings-rewards-page-C0XQoWjb.js +1 -0
  98. package/dist/assets/{settings-section-nav-Co0AaDG-.js → settings-section-nav-CkqqtM0F.js} +1 -1
  99. package/dist/assets/settings-users-page-COCBOq7d.js +1 -0
  100. package/dist/assets/settings-wiki-page-Dy1d7-z-.js +1 -0
  101. package/dist/assets/sleep-page-1kKicdFq.js +1 -0
  102. package/dist/assets/sports-page-DJErRii_.js +1 -0
  103. package/dist/assets/{state-vCcAT5Hq.js → state-BtwEvpO6.js} +1 -1
  104. package/dist/assets/strategies-page-CWNFb9vv.js +1 -0
  105. package/dist/assets/strategy-detail-page-D9rFVXRS.js +1 -0
  106. package/dist/assets/strategy-dialog-BIVHfUR6.js +1 -0
  107. package/dist/assets/{surface-CyWI7e1R.js → surface-B3oXO1No.js} +1 -1
  108. package/dist/assets/{table-BNqMG3_S.js → table-BuONJH1s.js} +1 -1
  109. package/dist/assets/task-detail-page-r8ipOpAF.js +1 -0
  110. package/dist/assets/task-dialog-C3kkWtcT.js +6 -0
  111. package/dist/assets/timebox-planning-dialog-BadS5tEr.js +1 -0
  112. package/dist/assets/today-boxes-CiccN0Gw.js +1 -0
  113. package/dist/assets/today-page-DvQredbl.js +1 -0
  114. package/dist/assets/training-load-page-CkX-nSoe.js +1 -0
  115. package/dist/assets/{ui-C1iwpj2-.js → ui-B9O-eUim.js} +1 -1
  116. package/dist/assets/use-anchored-overlay-position-BrQ4cqKn.js +1 -0
  117. package/dist/assets/{use-psyche-focus-target-Ct-acS9G.js → use-psyche-focus-target-Cuxni3SK.js} +1 -1
  118. package/dist/assets/user-badge-BKzwGZDd.js +1 -0
  119. package/dist/assets/user-ownership-DJGl4rAj.js +1 -0
  120. package/dist/assets/user-select-field-BNqv8-wd.js +1 -0
  121. package/dist/assets/utility-widgets-DvxKA6dI.js +3 -0
  122. package/dist/assets/{vendor-Dnkkx2co.js → vendor-Cpmju3nw.js} +1 -1
  123. package/dist/assets/vitals-page-CRIsr_C7.js +1 -0
  124. package/dist/assets/weekly-review-page-CNqxLRCd.js +1 -0
  125. package/dist/assets/weight-loss-page-SSsCp1Yw.js +5 -0
  126. package/dist/assets/{wiki-article-markdown-Bi02AsVt.js → wiki-article-markdown-C9VKineE.js} +2 -2
  127. package/dist/assets/{wiki-editor-page-OZf9l4Tg.js → wiki-editor-page-DxGsKvF7.js} +5 -5
  128. package/dist/assets/wiki-ingest-history-page-CFmP7K1F.js +1 -0
  129. package/dist/assets/wiki-ingest-modal-BLw2PSWP.js +1 -0
  130. package/dist/assets/wiki-page-BiQ-jAuz.js +1 -0
  131. package/dist/assets/workbench-flow-page-D960hXu_.js +5 -0
  132. package/dist/assets/workbench-page-BWlY-FiL.js +1 -0
  133. package/dist/assets/workout-detail-page-G32yJoE9.js +2 -0
  134. package/dist/index.html +8 -10
  135. package/dist/server/server/src/app.js +10 -0
  136. package/dist/server/server/src/health-weight-loss.js +11 -3
  137. package/dist/server/server/src/services/dashboard.js +4 -4
  138. package/dist/server/server/src/services/gamification.js +71 -32
  139. package/openclaw.plugin.json +1 -1
  140. package/package.json +1 -1
  141. package/dist/assets/activity-page-DRRbpVK-.js +0 -1
  142. package/dist/assets/ai-surface-workspace-DJPt-OaW.js +0 -1
  143. package/dist/assets/calendar-page-y8G1ige8.js +0 -1
  144. package/dist/assets/calendar-rules-CRhXqGQu.js +0 -1
  145. package/dist/assets/companion-sync-lab-page-kEgOF3c6.js +0 -1
  146. package/dist/assets/daily-metrics-dashboard-BJjUIZVA.js +0 -1
  147. package/dist/assets/entity-notes-surface-CaCjjUaq.js +0 -1
  148. package/dist/assets/execution-board-RRWm2srb.js +0 -1
  149. package/dist/assets/goal-detail-page-BgQlK7yT.js +0 -1
  150. package/dist/assets/goals-page-Cz2i3pVy.js +0 -1
  151. package/dist/assets/habits-page-BmEmWCGv.js +0 -1
  152. package/dist/assets/index-QJkjKYzZ.js +0 -19
  153. package/dist/assets/insight-flow-dialog-CdYMHwMP.js +0 -1
  154. package/dist/assets/kanban-page-C6S_fJRc.js +0 -1
  155. package/dist/assets/knowledge-graph-page-juA9QCy0.js +0 -1
  156. package/dist/assets/life-force-page-ChTIA4mV.js +0 -1
  157. package/dist/assets/movement-page-Dx3T3HrG.js +0 -1
  158. package/dist/assets/note-tags-input-BS14YXHn.js +0 -1
  159. package/dist/assets/notes-page-D3yGl8TN.js +0 -1
  160. package/dist/assets/overview-page-DSOpBpHf.js +0 -1
  161. package/dist/assets/page-hero-CONuJu5J.js +0 -1
  162. package/dist/assets/pill-cluster-W2fY48OM.js +0 -1
  163. package/dist/assets/preferences-page-Br3zrLlH.js +0 -1
  164. package/dist/assets/project-detail-page-BIU9_TRN.js +0 -1
  165. package/dist/assets/project-management-hierarchy-page-C2H620xD.js +0 -1
  166. package/dist/assets/project-management-section-nav-DRPVS1Eh.js +0 -1
  167. package/dist/assets/projects-page-w7a_L2-z.js +0 -1
  168. package/dist/assets/psyche-behaviors-page-Dt4CMC-q.js +0 -5
  169. package/dist/assets/psyche-flashcards-page-rXz06dqO.js +0 -1
  170. package/dist/assets/psyche-goal-map-page-BCcD6Jkl.js +0 -1
  171. package/dist/assets/psyche-graph-CXlAj4ED.js +0 -1
  172. package/dist/assets/psyche-metrics-page-B1otiir6.js +0 -1
  173. package/dist/assets/psyche-mode-guide-page-C6AdVIAv.js +0 -1
  174. package/dist/assets/psyche-modes-page-DoUqz2mR.js +0 -1
  175. package/dist/assets/psyche-page-BJNLQn8W.js +0 -1
  176. package/dist/assets/psyche-patterns-page-CzpMSAPu.js +0 -5
  177. package/dist/assets/psyche-questionnaire-builder-page-DjzatGVZ.js +0 -1
  178. package/dist/assets/psyche-questionnaire-detail-page-B0Qfowfg.js +0 -1
  179. package/dist/assets/psyche-questionnaire-run-detail-page-B2dNj4jJ.js +0 -1
  180. package/dist/assets/psyche-questionnaire-run-page-DyD9Ui-g.js +0 -1
  181. package/dist/assets/psyche-questionnaires-page-BxfKcoi3.js +0 -1
  182. package/dist/assets/psyche-reports-page-ALhNueiV.js +0 -1
  183. package/dist/assets/psyche-schemas-beliefs-page-C0P2Vw6-.js +0 -9
  184. package/dist/assets/psyche-screen-time-page-BYnaT3cb.js +0 -1
  185. package/dist/assets/psyche-self-observation-page-eM9vpwIB.js +0 -1
  186. package/dist/assets/psyche-values-page-BqrGIDok.js +0 -5
  187. package/dist/assets/rewards-page-DpAJ8IxE.js +0 -1
  188. package/dist/assets/settings-bin-page-BwtLrweW.js +0 -1
  189. package/dist/assets/settings-data-page-Bqy5SukM.js +0 -1
  190. package/dist/assets/settings-logs-page-8khtrf4T.js +0 -1
  191. package/dist/assets/settings-mobile-page-BcyRjEU_.js +0 -1
  192. package/dist/assets/settings-models-page-DlSnO9WX.js +0 -1
  193. package/dist/assets/settings-page-CyBQ2qcB.js +0 -1
  194. package/dist/assets/settings-rewards-page-BBX2WtVM.js +0 -1
  195. package/dist/assets/settings-users-page-JSnfFFPu.js +0 -1
  196. package/dist/assets/settings-wiki-page--nT23Fdy.js +0 -1
  197. package/dist/assets/sleep-page-CGMi3MtV.js +0 -1
  198. package/dist/assets/sports-page-Kv5bBoLr.js +0 -1
  199. package/dist/assets/strategies-page-Br7RdUJO.js +0 -1
  200. package/dist/assets/strategy-detail-page-CBWXjUhC.js +0 -1
  201. package/dist/assets/strategy-dialog-BTwkaSxI.js +0 -1
  202. package/dist/assets/task-detail-page-Qis9354n.js +0 -1
  203. package/dist/assets/timebox-planning-dialog-DB8snOBD.js +0 -1
  204. package/dist/assets/today-page-D9A5PU0S.js +0 -1
  205. package/dist/assets/training-load-page-Bpd4DQAh.js +0 -1
  206. package/dist/assets/vitals-page-CVYC-4RG.js +0 -1
  207. package/dist/assets/weekly-review-page-BP7N3fNB.js +0 -1
  208. package/dist/assets/weight-loss-page-_fX3N1UK.js +0 -5
  209. package/dist/assets/wiki-ingest-history-page-CzeNSL7N.js +0 -1
  210. package/dist/assets/wiki-ingest-modal-Ig_xnyc6.js +0 -1
  211. package/dist/assets/wiki-page-B4xuNgY4.js +0 -1
  212. package/dist/assets/workbench-flow-page-BhRJCALC.js +0 -5
  213. package/dist/assets/workbench-page-DxVs2AOY.js +0 -1
  214. package/dist/assets/workout-detail-page-D4wfkE98.js +0 -2
@@ -0,0 +1 @@
1
+ import{r as w,j as e,bB as A,d0 as re,d1 as te,aI as ie,d2 as ne,d3 as le,d4 as oe,aG as de,aX as ue,cU as ce,aK as xe}from"./vendor-Cpmju3nw.js";import{R as ge,P as ve,O as me,C as fe,T as pe,D as he,a as be}from"./ui-B9O-eUim.js";import{C as N,k as c,a4 as D,c as h}from"./index-BejvcRGb.js";import{R as _,d as O,C as B,X as I,Y as $,T as z,B as G,a as W,c as T,b as je}from"./charts-DwTguE_x.js";function C(a){return a?new Date(`${a}T12:00:00`).toLocaleDateString(void 0,{month:"short",day:"numeric"}):"No date yet"}function E(a,s){return s==="cumulative"?a.total??a.latest??a.maximum??a.average:a.latest??a.average??a.maximum??a.minimum}function x(a,s){if(s==null)return"No reading";const r=a.unit==="steps"||a.unit==="flights"||a.unit==="kcal"||a.unit==="min"||a.unit==="swears"||a.unit==="conversations"||a.unit==="messages"?0:(a.unit==="%",1);return`${s.toLocaleString(void 0,{maximumFractionDigits:r,minimumFractionDigits:r===0||s>=100?0:1})} ${a.unit}`}function K(a){return a.deltaValue==null?"No baseline yet":`${a.deltaValue>0?"+":""}${x(a,a.deltaValue)}`}function S(a){const s="Baseline is the average of the previous up to seven stored daily readings for this metric, excluding the latest day. Delta is latest reading minus that previous-window average.";return a.category!=="conversationTone"?s:a.metric==="devrageSwearCount"?`${s} For devrage swears, days with scanned conversations and zero swears count as 0, but days with no stored scanner rows are not invented into the average.`:a.metric==="devrageAverageMaxCumulativeRage"||a.metric==="devrageMaxCumulativeRage"?`${s} For cumulative rage, each swear-bearing user message adds its swear count and each clean user message cools the running score by 1, floored at 0. The baseline is the previous tracked-days average of that daily peak metric.`:a.metric==="swearingMessagePercent"?`${s} For swearing rate, the daily value is swear-bearing user messages divided by scanned user messages for that day.`:s}function we(a){return Math.round(a*10)/10}const j={fill:"var(--ui-ink-faint)",fontSize:11},H={stroke:"var(--ui-border-subtle)"},X="var(--ui-border-subtle)",Y={stroke:"var(--ui-border-strong)",strokeWidth:1};function U(a,s){return E(a,s)}function L(a){const s=a.days.map(r=>U(r,a.aggregation)).filter(r=>r!=null);return s.length===0?{minimum:null,average:null,maximum:null,count:0}:{minimum:Math.min(...s),average:s.reduce((r,t)=>r+t,0)/s.length,maximum:Math.max(...s),count:s.length}}function V(a){return new Date(`${a}T12:00:00`).toLocaleDateString(void 0,{month:"short",day:"numeric"})}function ke({active:a,payload:s,label:r,metric:t}){var i;if(!a||!(s!=null&&s.length)||typeof r!="string")return null;const n=((i=s.find(l=>typeof l.value=="number"))==null?void 0:i.value)??null;return e.jsxs("div",{className:"rounded-[18px] border border-[var(--ui-border-subtle)] bg-[var(--surface-glass)] px-3 py-2 text-[var(--ui-ink-medium)] shadow-[var(--ui-shadow-floating)] backdrop-blur-xl",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.16em] text-[var(--ui-ink-faint)]",children:V(r)}),e.jsx("div",{className:"mt-1 text-sm font-semibold text-[var(--ui-ink-strong)]",children:x(t,n)})]})}function q({metric:a,height:s=180,detailed:r=!1}){const t=w.useMemo(()=>L(a),[a]),n=w.useMemo(()=>a.days.map(d=>({dateKey:d.dateKey,value:U(d,a.aggregation),sampleCount:d.sampleCount})),[a]),i=n.map(d=>d.value).filter(d=>d!=null),l=i.length>0?Math.min(...i):0,v=i.length>0?Math.max(...i):1,p=Math.max((v-l)*.12,a.unit==="%"?2:1),u=f(a.category),m=`metric-gradient-${a.metric.replace(/[^a-z0-9]/gi,"-")}`;return i.length===0?e.jsx("div",{className:"flex items-center justify-center rounded-[22px] border border-dashed border-[var(--ui-border-subtle)] bg-[var(--ui-surface-1)] px-3 text-center text-sm text-[var(--ui-ink-faint)]",style:{height:s},children:"Waiting for chart data"}):e.jsx("div",{className:h("overflow-hidden rounded-[22px] border bg-[var(--ui-surface-1)] p-3",u.ring),style:{height:s},children:e.jsx(_,{width:"100%",height:"100%",children:e.jsxs(O,{data:n,margin:{top:r?18:8,right:r?18:4,bottom:r?12:0,left:r?8:0},children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:m,x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:"var(--primary)",stopOpacity:.55}),e.jsx("stop",{offset:"56%",stopColor:"var(--warning)",stopOpacity:.22}),e.jsx("stop",{offset:"100%",stopColor:"var(--warning)",stopOpacity:.02})]})}),e.jsx(B,{stroke:X,vertical:r}),e.jsx(I,{dataKey:"dateKey",tickFormatter:V,minTickGap:r?22:34,tick:j,axisLine:H,tickLine:!1}),e.jsx($,{width:r?62:36,domain:[Math.max(0,l-p),v+p],tickFormatter:d=>x(a,Number(d)).replace(` ${a.unit}`,""),tick:j,axisLine:!1,tickLine:!1}),t.average!=null?e.jsx(je,{y:we(t.average),stroke:"var(--ui-ink-faint)",strokeDasharray:"5 5",ifOverflow:"extendDomain"}):null,e.jsx(z,{cursor:Y,content:e.jsx(ke,{metric:a})}),a.aggregation==="cumulative"?e.jsx(G,{dataKey:"value",radius:[8,8,2,2],fill:`url(#${m})`,maxBarSize:r?34:20}):e.jsx(W,{type:"monotone",dataKey:"value",stroke:"var(--primary)",strokeWidth:r?3:2,fill:`url(#${m})`,dot:r?{r:3,fill:"var(--warning)"}:!1,activeDot:{r:5,fill:"var(--warning)"}})]})})})}function ye({metric:a,open:s,onOpenChange:r}){const t=L(a),n=f(a.category);return e.jsx(ge,{open:s,onOpenChange:r,children:e.jsxs(ve,{children:[e.jsx(me,{className:"fixed inset-0 z-50 bg-[var(--overlay)] backdrop-blur-xl"}),e.jsxs(fe,{className:"fixed inset-3 z-[51] grid min-h-0 overflow-hidden rounded-[32px] border border-[var(--ui-border-subtle)] bg-[image:var(--ui-surface-modal)] shadow-[var(--ui-shadow-floating)] sm:inset-5",children:[e.jsxs(pe,{className:"sr-only",children:[a.label," chart"]}),e.jsx(he,{className:"sr-only",children:"Full-screen time-series chart for the selected daily metric."}),e.jsxs("div",{className:"grid min-h-0 grid-rows-[auto_minmax(0,1fr)]",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4 border-b border-[var(--ui-border-subtle)] px-5 py-4 sm:px-6",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"text-[11px] uppercase tracking-[0.18em] text-[var(--ui-ink-faint)]",children:[a.category," time series"]}),e.jsx("div",{className:"mt-1 break-words text-2xl font-semibold text-[var(--ui-ink-strong)] sm:text-3xl",children:a.label}),e.jsxs("div",{className:"mt-2 flex flex-wrap gap-2 text-xs text-[var(--ui-ink-soft)]",children:[e.jsx(c,{className:n.badge,children:a.aggregation}),e.jsxs(c,{tone:"meta",children:[a.coverageDays," tracked days"]}),e.jsxs(c,{tone:"meta",children:["latest ",C(a.latestDateKey)]})]})]}),e.jsx(be,{asChild:!0,children:e.jsx("button",{type:"button",className:"inline-flex size-11 items-center justify-center rounded-full border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-1)] text-[var(--ui-ink-soft)] transition hover:bg-[var(--ui-surface-hover)] hover:text-[var(--ui-ink-strong)]","aria-label":"Close metric chart",children:e.jsx(xe,{className:"size-5"})})})]}),e.jsxs("div",{className:"grid min-h-0 gap-4 overflow-y-auto p-4 sm:p-6 lg:grid-cols-[minmax(0,1fr)_18rem]",children:[e.jsx(q,{metric:a,height:560,detailed:!0}),e.jsx("div",{className:"grid content-start gap-3",children:[["Latest",a.latestValue],["Period min",t.minimum],["Period average",t.average],["Period max",t.maximum],["Baseline",a.baselineValue],["Delta",a.deltaValue]].map(([i,l])=>e.jsxs("div",{className:"rounded-[22px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-1)] px-4 py-3",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.16em] text-[var(--ui-ink-faint)]",children:e.jsxs("span",{className:"inline-flex min-w-0 items-center gap-1.5",children:[e.jsx("span",{children:i}),i==="Baseline"?e.jsx(D,{label:`Explain ${a.label} baseline`,title:"Baseline calculation",content:S(a)}):null]})}),e.jsx("div",{className:"mt-1 break-words text-xl font-semibold text-[var(--ui-ink-strong)]",children:x(a,typeof l=="number"?l:null)})]},String(i)))})]})]})]})]})})}function Ne(a){return a.deltaValue==null||a.deltaValue===0?"steady":a.deltaValue>0?"up":"down"}function f(a){switch(a){case"recovery":return{ring:"border-[var(--danger)]/20",badge:"bg-[var(--ui-danger-soft)] text-[var(--danger)]",glow:"from-[var(--ui-danger-soft)] via-[var(--ui-surface-2)] to-transparent"};case"cardio":return{ring:"border-[var(--info)]/24",badge:"bg-[var(--ui-info-soft)] text-[var(--info)]",glow:"from-[var(--ui-info-soft)] via-[var(--ui-surface-2)] to-transparent"};case"breathing":return{ring:"border-[var(--success)]/22",badge:"bg-[var(--ui-success-soft)] text-[var(--success)]",glow:"from-[var(--ui-success-soft)] via-[var(--ui-surface-2)] to-transparent"};case"composition":return{ring:"border-[var(--warning)]/22",badge:"bg-[var(--ui-warning-soft)] text-[var(--warning)]",glow:"from-[var(--ui-warning-soft)] via-[var(--ui-surface-2)] to-transparent"};case"temperature":return{ring:"border-[var(--warning)]/22",badge:"bg-[var(--ui-warning-soft)] text-[var(--warning)]",glow:"from-[var(--ui-warning-soft)] via-[var(--ui-surface-2)] to-transparent"};case"conversationTone":return{ring:"border-[var(--warning)]/22",badge:"bg-[var(--ui-warning-soft)] text-[var(--warning)]",glow:"from-[var(--ui-warning-soft)] via-[var(--ui-surface-2)] to-transparent"};default:return{ring:"border-[var(--ui-border-subtle)]",badge:"bg-[var(--ui-accent-soft)] text-[var(--primary)]",glow:"from-[var(--ui-accent-soft)] via-[var(--ui-surface-2)] to-transparent"}}}function J(a){switch(a){case"restingHeartRate":case"walkingHeartRateAverage":case"heartRateRecoveryOneMinute":return ue;case"heartRateVariabilitySDNN":case"vo2Max":return de;case"oxygenSaturation":case"respiratoryRate":return oe;case"bodyMass":case"bodyFatPercentage":case"leanBodyMass":return le;case"stepCount":case"flightsClimbed":case"appleExerciseTime":return ne;case"basalEnergyBurned":return ie;case"swearingMessagePercent":return te;case"devrageSwearCount":case"devrageAverageMaxCumulativeRage":case"devrageMaxCumulativeRage":return re;default:return A}}function k(a,s){if(!a)return null;const r=a.aggregation,t=a.days.find(n=>n.dateKey===s);return t?E(t,r):null}function Q(a,s){return a?x(a,s):"No signal"}function De({active:a,payload:s,label:r,swearMetric:t,percentMetric:n,averageRageMetric:i,maxRageMetric:l}){if(!a||!(s!=null&&s.length)||typeof r!="string")return null;const v=new Map(s.filter(u=>typeof u.dataKey=="string").map(u=>[String(u.dataKey),u.value??null])),p=[["Max rage peak",l,v.get("maxPeak")??null],["Average rage peak",i,v.get("averagePeak")??null],["Swears",t,v.get("swears")??null],["Swearing rate",n,v.get("rate")??null]];return e.jsxs("div",{className:"min-w-56 rounded-[20px] border border-[var(--ui-border-subtle)] bg-[var(--surface-glass)] p-3 shadow-[var(--ui-shadow-floating)] backdrop-blur-xl",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.16em] text-[var(--ui-ink-faint)]",children:V(r)}),e.jsx("div",{className:"mt-2 grid gap-2",children:p.map(([u,m,d])=>e.jsxs("div",{className:"flex min-w-0 items-center justify-between gap-3 text-xs",children:[e.jsx("span",{className:"min-w-0 text-[var(--ui-ink-soft)]",children:u}),e.jsx("span",{className:"min-w-0 break-words text-right font-semibold text-[var(--ui-ink-strong)]",children:Q(m,d)})]},u))})]})}function y({label:a,metric:s,fallback:r="No signal"}){const t=f("conversationTone");return e.jsxs("div",{className:"min-w-0 rounded-[20px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-1)] px-4 py-3",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.16em] text-[var(--ui-ink-faint)]",children:a}),e.jsx("div",{className:"mt-1 break-words text-2xl font-semibold text-[var(--ui-ink-strong)]",children:s?x(s,s.latestValue):r}),s?e.jsxs("div",{className:"mt-2 flex min-w-0 flex-wrap gap-2 text-xs",children:[e.jsx(c,{className:t.badge,children:K(s)}),e.jsxs(c,{tone:"meta",children:[s.coverageDays," days"]})]}):null]})}function Ke({swearMetric:a,percentMetric:s,averageRageMetric:r,maxRageMetric:t,compact:n=!1}){var F;const i=w.useId().replace(/:/g,""),l=`devrage-rage-${i}`,v=`devrage-swears-${i}`,p=`devrage-panel-${i}`,u=w.useMemo(()=>Array.from(new Set([a,s,r,t].flatMap(g=>(g==null?void 0:g.days.map(se=>se.dateKey))??[]))).sort().slice(n?-14:-28).map(g=>({dateKey:g,swears:k(a,g),rate:k(s,g),averagePeak:k(r,g),maxPeak:k(t,g)})),[r,n,t,s,a]),m=u.flatMap(o=>[o.swears,o.averagePeak,o.maxPeak]).filter(o=>o!=null),d=u.map(o=>o.rate).filter(o=>o!=null),Z=m.length>0||d.length>0,M=Math.max(1,...m),R=Math.max(10,...d),ee=(t==null?void 0:t.latestDateKey)??(r==null?void 0:r.latestDateKey)??(a==null?void 0:a.latestDateKey)??(s==null?void 0:s.latestDateKey)??null,b=t??r??a??s,P=(b==null?void 0:b.deltaValue)??null,ae=P==null?"Baseline forming":P>0?"Rage pressure rising":P<0?"Rage pressure cooling":"Rage pressure steady";return Z?e.jsxs(N,{className:"relative overflow-hidden rounded-[30px] border border-[color-mix(in_srgb,var(--warning)_22%,var(--ui-border-subtle)_78%)] bg-[linear-gradient(135deg,color-mix(in_srgb,var(--ui-warning-soft)_30%,var(--ui-surface-section)_70%),var(--ui-surface-section)_48%,color-mix(in_srgb,var(--ui-info-soft)_18%,var(--ui-surface-section)_82%))] p-0 shadow-[var(--card-shadow)]",children:[e.jsx("div",{className:"pointer-events-none absolute inset-0 opacity-55 [background-image:linear-gradient(rgba(255,255,255,0.055)_1px,transparent_1px),linear-gradient(90deg,rgba(255,255,255,0.04)_1px,transparent_1px)] [background-size:32px_32px]"}),e.jsxs("div",{className:"relative grid gap-5 p-5 sm:p-6 lg:grid-cols-[minmax(0,1.45fr)_minmax(280px,0.75fr)]",children:[e.jsxs("div",{className:"grid min-w-0 gap-4",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.18em] text-[var(--warning)]",children:"Conversation tone figure"}),e.jsx("div",{className:"mt-1 break-words text-3xl font-semibold leading-tight text-[var(--ui-ink-strong)] sm:text-4xl",children:"Cumulative rage profile"}),e.jsx("div",{className:"mt-2 max-w-2xl text-sm leading-6 text-[var(--ui-ink-soft)]",children:"Swear volume, swearing-message rate, average thread peak, and maximum thread peak on one daily surface."})]}),e.jsxs("div",{className:"flex min-w-0 flex-wrap gap-2",children:[e.jsx(c,{className:"bg-[var(--ui-warning-soft)] text-[var(--warning)]",children:ae}),b?e.jsx(D,{label:"Explain devrage baseline",title:"Baseline calculation",content:S(b)}):null,e.jsxs(c,{tone:"meta",children:["Latest ",C(ee)]})]})]}),e.jsx("div",{className:"overflow-hidden rounded-[26px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-1)] p-3",style:{height:n?280:340},children:e.jsx(_,{width:"100%",height:"100%",children:e.jsxs(O,{data:u,margin:{top:18,right:12,bottom:0,left:0},children:[e.jsxs("defs",{children:[e.jsxs("linearGradient",{id:p,x1:"0",y1:"0",x2:"1",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:"var(--warning)",stopOpacity:.36}),e.jsx("stop",{offset:"52%",stopColor:"var(--primary)",stopOpacity:.12}),e.jsx("stop",{offset:"100%",stopColor:"var(--info)",stopOpacity:.18})]}),e.jsxs("linearGradient",{id:l,x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:"var(--warning)",stopOpacity:.62}),e.jsx("stop",{offset:"58%",stopColor:"var(--danger)",stopOpacity:.2}),e.jsx("stop",{offset:"100%",stopColor:"var(--danger)",stopOpacity:.02})]}),e.jsxs("linearGradient",{id:v,x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:"var(--ui-ink-strong)",stopOpacity:.34}),e.jsx("stop",{offset:"100%",stopColor:"var(--ui-ink-faint)",stopOpacity:.06})]})]}),e.jsx(B,{stroke:X,strokeDasharray:"4 10",vertical:!1}),e.jsx(I,{dataKey:"dateKey",tickFormatter:V,minTickGap:n?36:24,tick:j,axisLine:H,tickLine:!1}),e.jsx($,{yAxisId:"rage",width:42,domain:[0,Math.ceil(M*1.18)],tickFormatter:o=>Number(o).toFixed(0),tick:j,axisLine:!1,tickLine:!1}),e.jsx($,{yAxisId:"rate",orientation:"right",width:42,domain:[0,Math.min(100,Math.ceil(R*1.22))],tickFormatter:o=>`${Number(o).toFixed(0)}%`,tick:j,axisLine:!1,tickLine:!1}),e.jsx(z,{cursor:Y,content:e.jsx(De,{swearMetric:a,percentMetric:s,averageRageMetric:r,maxRageMetric:t})}),e.jsx(G,{yAxisId:"rage",dataKey:"swears",radius:[10,10,3,3],fill:`url(#${v})`,maxBarSize:n?16:22}),e.jsx(W,{yAxisId:"rage",type:"monotone",dataKey:"averagePeak",stroke:"var(--warning)",strokeWidth:2,fill:`url(#${l})`,dot:!1,activeDot:{r:5,fill:"var(--warning)"}}),e.jsx(T,{yAxisId:"rage",type:"monotone",dataKey:"maxPeak",stroke:"var(--danger)",strokeWidth:3,dot:{r:3,fill:"var(--danger)"},activeDot:{r:6,fill:"var(--danger)"}}),e.jsx(T,{yAxisId:"rate",type:"monotone",dataKey:"rate",stroke:"var(--info)",strokeWidth:2,strokeDasharray:"6 6",dot:!1,activeDot:{r:5,fill:"var(--info)"}})]})})}),e.jsx("div",{className:"flex min-w-0 flex-wrap gap-2 text-xs text-[var(--ui-ink-soft)]",children:[["Swears","bg-[var(--ui-surface-2)] text-[var(--ui-ink-medium)]"],["Average peak","bg-[var(--ui-warning-soft)] text-[var(--warning)]"],["Max peak","bg-[var(--ui-danger-soft)] text-[var(--danger)]"],["Swearing rate","bg-[var(--ui-info-soft)] text-[var(--info)]"]].map(([o,g])=>e.jsx(c,{className:g,children:o},o))})]}),e.jsxs("div",{className:"grid min-w-0 content-start gap-3",children:[e.jsxs("div",{className:"rounded-[24px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-1)] p-5",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.18em] text-[var(--ui-ink-faint)]",children:"Latest peak"}),e.jsx("div",{className:"mt-2 break-words text-5xl font-semibold leading-none text-[var(--ui-ink-strong)]",children:Q(t??r,((F=t??r)==null?void 0:F.latestValue)??null)}),e.jsx("div",{className:"mt-3 text-sm leading-6 text-[var(--ui-ink-soft)]",children:"Peak score is the highest cumulative swear streak pressure reached inside any scanned thread for the day."})]}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-1 xl:grid-cols-2",children:[e.jsx(y,{label:"Average thread peak",metric:r}),e.jsx(y,{label:"Swearing rate",metric:s}),e.jsx(y,{label:"Swears",metric:a}),e.jsx(y,{label:"Max thread peak",metric:t})]})]})]})]}):e.jsxs(N,{className:"rounded-[30px] border border-dashed border-[var(--ui-border-subtle)] bg-[var(--ui-surface-section)] p-6",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.18em] text-[var(--ui-ink-faint)]",children:"Cumulative rage profile"}),e.jsx("div",{className:"mt-2 text-2xl font-semibold text-[var(--ui-ink-strong)]",children:"Waiting for devrage history"}),e.jsx("p",{className:"mt-2 max-w-3xl text-sm leading-6 text-[var(--ui-ink-soft)]",children:"Forge will draw the rage profile after the local scanner stores daily conversation-tone rows."})]})}function Le({title:a,description:s,metric:r,emptyDescription:t}){const n=r?J(r.metric):A,i=f(r?r.category:"default"),l=r?Ne(r):"steady";return e.jsxs(N,{className:h("relative overflow-hidden rounded-[28px] border bg-[var(--ui-surface-section)] p-5 shadow-[var(--card-shadow)]",i.ring),children:[e.jsx("div",{className:h("pointer-events-none absolute inset-0 bg-gradient-to-br opacity-90",i.glow)}),e.jsxs("div",{className:"relative grid gap-4",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"grid min-w-0 gap-1",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.18em] text-[var(--ui-ink-faint)]",children:a}),e.jsx("div",{className:"break-words text-sm leading-6 text-[var(--ui-ink-soft)]",children:s})]}),e.jsx("div",{className:"shrink-0 rounded-[18px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-1)] p-3 text-[var(--ui-ink-medium)]",children:e.jsx(n,{className:"size-5"})})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx("div",{className:"break-words text-xl font-semibold text-[var(--ui-ink-strong)]",children:r?x(r,r.latestValue):"No signal yet"}),e.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2 text-xs text-[var(--ui-ink-soft)]",children:[r?e.jsx(c,{className:i.badge,children:r.label}):null,r?e.jsx(c,{className:h("border-none",l==="up"?"bg-[var(--ui-success-soft)] text-[var(--success)]":l==="down"?"bg-[var(--ui-danger-soft)] text-[var(--danger)]":"bg-[var(--ui-surface-2)] text-[var(--ui-ink-medium)]"),children:K(r)}):null,r?e.jsx(D,{label:`Explain ${r.label} delta`,title:"Delta calculation",content:S(r)}):null,r?e.jsxs(c,{tone:"meta",children:[r.coverageDays," days tracked"]}):null]}),e.jsx("div",{className:"break-words text-xs text-[var(--ui-ink-faint)]",children:r?`Latest reading on ${C(r.latestDateKey)}`:t??"Forge will populate this card as soon as daily readings are available."})]})]})]})}function Ce({metric:a}){const[s,r]=w.useState(!1),t=J(a.metric),n=f(a.category),i=a.days.at(-1),l=L(a);return e.jsxs(N,{className:h("overflow-hidden rounded-[28px] border bg-[var(--ui-surface-section)] p-5",n.ring),children:[e.jsxs("div",{className:"flex min-w-0 flex-col gap-4 sm:flex-row sm:items-start sm:justify-between",children:[e.jsxs("div",{className:"flex min-w-0 items-start gap-4",children:[e.jsx("div",{className:"shrink-0 rounded-[18px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-1)] p-3 text-[var(--ui-ink-medium)]",children:e.jsx(t,{className:"size-5"})}),e.jsxs("div",{className:"grid min-w-0 gap-1",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.16em] text-[var(--ui-ink-faint)]",children:a.category}),e.jsx("div",{className:"break-words text-xl font-semibold text-[var(--ui-ink-strong)]",children:a.label}),e.jsxs("div",{className:"text-sm text-[var(--ui-ink-soft)]",children:[a.coverageDays," tracked day",a.coverageDays===1?"":"s"]})]})]}),e.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2 sm:shrink-0 sm:justify-end",children:[e.jsx(c,{className:n.badge,children:a.aggregation}),e.jsxs("button",{type:"button",className:"inline-flex min-h-9 min-w-0 max-w-full items-center gap-2 rounded-full border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-1)] px-3 py-1.5 text-xs font-medium text-[var(--ui-ink-medium)] transition hover:bg-[var(--ui-surface-hover)] hover:text-[var(--ui-ink-strong)]",onClick:()=>r(!0),children:[e.jsx(ce,{className:"size-3.5"}),"Full screen"]})]})]}),e.jsxs("div",{className:"mt-5 grid gap-4 md:grid-cols-[minmax(0,0.95fr)_minmax(220px,1.05fr)]",children:[e.jsxs("div",{className:"grid gap-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.16em] text-[var(--ui-ink-faint)]",children:"Latest"}),e.jsx("div",{className:"mt-1 break-words text-3xl font-semibold text-[var(--ui-ink-strong)]",children:x(a,a.latestValue)}),e.jsx("div",{className:"mt-1 text-sm text-[var(--ui-ink-soft)]",children:a.latestDateKey?`Latest reading on ${C(a.latestDateKey)}`:"Waiting for the first successful reading"})]}),e.jsxs("div",{className:"grid gap-2 rounded-[22px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-1)] p-4 text-sm text-[var(--ui-ink-medium)]",children:[e.jsxs("div",{className:"flex min-w-0 items-center justify-between gap-2",children:[e.jsxs("span",{className:"inline-flex min-w-0 items-center gap-1.5",children:[e.jsx("span",{className:"min-w-0",children:"Baseline"}),e.jsx(D,{label:`Explain ${a.label} baseline`,title:"Baseline calculation",content:S(a)})]}),e.jsx("span",{className:"min-w-0 break-words text-right font-medium text-[var(--ui-ink-strong)]",children:x(a,a.baselineValue)})]}),e.jsxs("div",{className:"flex min-w-0 items-center justify-between gap-2",children:[e.jsx("span",{className:"min-w-0",children:"Delta"}),e.jsx("span",{className:h("min-w-0 break-words text-right font-medium",a.deltaValue==null?"text-[var(--ui-ink-soft)]":a.deltaValue>0?"text-[var(--success)]":a.deltaValue<0?"text-[var(--danger)]":"text-[var(--ui-ink-strong)]"),children:K(a)})]}),e.jsxs("div",{className:"flex min-w-0 items-center justify-between gap-2",children:[e.jsx("span",{className:"min-w-0",children:"Latest samples"}),e.jsx("span",{className:"min-w-0 break-words text-right font-medium text-[var(--ui-ink-strong)]",children:(i==null?void 0:i.sampleCount)??0})]})]})]}),e.jsxs("div",{className:"grid gap-3",children:[e.jsx(q,{metric:a}),e.jsxs("div",{className:"grid gap-2 text-xs text-[var(--ui-ink-faint)] sm:grid-cols-3",children:[e.jsxs("div",{className:"min-w-0 rounded-[16px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-1)] px-3 py-2",children:[e.jsx("div",{children:"Period min"}),e.jsx("div",{className:"mt-1 break-words font-medium text-[var(--ui-ink-medium)]",children:x(a,l.minimum)})]}),e.jsxs("div",{className:"min-w-0 rounded-[16px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-1)] px-3 py-2",children:[e.jsx("div",{children:"Period avg"}),e.jsx("div",{className:"mt-1 break-words font-medium text-[var(--ui-ink-medium)]",children:x(a,l.average)})]}),e.jsxs("div",{className:"min-w-0 rounded-[16px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-1)] px-3 py-2",children:[e.jsx("div",{children:"Period max"}),e.jsx("div",{className:"mt-1 break-words font-medium text-[var(--ui-ink-medium)]",children:x(a,l.maximum)})]})]})]})]}),e.jsx(ye,{metric:a,open:s,onOpenChange:r})]})}function Fe({groups:a}){return e.jsx("section",{className:"grid gap-5",children:a.map(s=>e.jsxs("div",{className:"grid gap-4",children:[e.jsxs("div",{className:"flex flex-wrap items-end justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.18em] text-[var(--ui-ink-faint)]",children:s.category}),e.jsxs("div",{className:"mt-1 break-words text-2xl font-semibold text-[var(--ui-ink-strong)]",children:[s.metrics.length," signals in this lane"]})]}),e.jsxs(c,{className:f(s.category).badge,children:[s.coverageDays," days of coverage"]})]}),e.jsx("div",{className:"grid gap-4 xl:grid-cols-2",children:s.metrics.map(r=>e.jsx(Ce,{metric:r},r.metric))})]},s.category))})}export{Ke as D,Fe as M,Le as S,C as f,f as m};
@@ -0,0 +1 @@
1
+ import{i as t}from"./generic-node-view-COhU_Wm3.js";function p(n,e){const o=r=>n(r);return o.displayName=e.title.replace(/\s+/g,""),t(o,e)}export{p as d};
@@ -0,0 +1 @@
1
+ import{r as n,j as r,aK as X,b7 as T,F as G,bX as J}from"./vendor-Cpmju3nw.js";import{b as A,c as i}from"./index-BejvcRGb.js";import{u as W}from"./use-anchored-overlay-position-BrQ4cqKn.js";function E(c){return c.trim().toLowerCase()}function H(c,b){return c.includes(b)?c:[...c,b]}function te({options:c,selectedValues:b,onChange:w,placeholder:K="Search or create…",emptyMessage:U="No matching entries yet.",createLabel:q="Create",onCreate:h,className:F,variant:I="default"}){const[v,y]=n.useState(""),[g,o]=n.useState(!1),[D,f]=n.useState(0),[M,S]=n.useState(!1),[_,p]=n.useState(null),[O,Q]=n.useState([]),j=n.useRef(null),C=n.useRef(null),L=c??[],l=b??[],s=I==="action-bar",P=W(j,g,{offset:6,preferredMaxHeight:320,minHeight:160}),m=n.useMemo(()=>{const e=new Map;return[...O,...L].forEach(t=>{e.set(t.value,t)}),Array.from(e.values())},[O,L]),z=n.useMemo(()=>l.map(e=>m.find(t=>t.value===e)??{value:e,label:e}),[m,l]),d=E(v),x=n.useMemo(()=>{const e=m.filter(t=>!l.includes(t.value));return d?e.filter(t=>`${t.label} ${t.description??""} ${t.searchText??""}`.toLowerCase().includes(d)).slice(0,8):e.slice(0,8)},[m,d,l]),R=m.some(e=>E(e.label)===d);n.useEffect(()=>{if(!g)return;const e=a=>{var $,B;const u=a.target;($=j.current)!=null&&$.contains(u)||(B=C.current)!=null&&B.contains(u)||o(!1)},t=a=>{a.key==="Escape"&&o(!1)};return document.addEventListener("pointerdown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("pointerdown",e),document.removeEventListener("keydown",t)}},[g]);const k=e=>{w(H(l,e)),y(""),p(null),f(0),o(!1)},V=e=>{w(l.filter(t=>t!==e))},N=async()=>{const e=v.trim();if(!(!h||!e)){S(!0);try{const t=await h(e);Q(a=>a.some(u=>u.value===t.value)?a:[t,...a]),w(H(l,t.value)),y(""),p(null),f(0),o(!1)}catch(t){p(t instanceof Error?t.message:"Unable to create that link right now.")}finally{S(!1)}}};return r.jsxs("div",{className:i("relative grid gap-2",F),ref:j,children:[r.jsxs("div",{className:i("rounded-[22px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-1)]",s?"rounded-[20px] border-[var(--ui-border-subtle)] bg-[var(--ui-surface-1)] px-3.5 py-3 shadow-[inset_0_1px_0_var(--ui-border-subtle)]":"px-3 py-3"),children:[z.length>0?r.jsx("div",{className:i("flex flex-wrap gap-2",s?"mb-2.5":"mb-2"),children:z.map(e=>r.jsxs("span",{className:"inline-flex min-w-0 max-w-full items-center gap-2",children:[e.kind?r.jsx(A,{kind:e.kind,label:e.label,compact:!0,wrap:!0,gradient:!1,className:"max-w-full"}):e.badge?e.badge:r.jsx("span",{className:i("inline-flex items-center gap-2 rounded-full px-3 py-1.5 text-sm","border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-2)] text-[var(--ui-ink-medium)]"),children:r.jsx("span",{className:"max-w-full break-words whitespace-normal [overflow-wrap:anywhere]",children:e.label})}),r.jsx("button",{type:"button",className:i("rounded-full transition","text-[var(--ui-ink-faint)] hover:text-[var(--ui-ink-strong)]"),"aria-label":`Remove ${e.label}`,onClick:()=>V(e.value),children:r.jsx(X,{className:"size-3.5"})})]},e.value))}):null,r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(T,{className:i("size-4","text-[var(--ui-ink-faint)]")}),r.jsx("input",{type:"text",value:v,onChange:e=>{y(e.target.value),p(null),o(!0),f(0)},onFocus:()=>o(!0),onKeyDown:e=>{if(e.key==="Backspace"&&!v&&l.length>0){V(l[l.length-1]);return}if(e.key==="ArrowDown"){e.preventDefault(),o(!0),f(u=>x.length===0?0:Math.min(x.length-1,u+1));return}if(e.key==="ArrowUp"){e.preventDefault(),f(u=>Math.max(0,u-1));return}if(e.key==="Escape"){o(!1);return}if(e.key!=="Enter")return;e.preventDefault();const t=x[D];if(t){k(t.value);return}const a=m.find(u=>E(u.label)===d);if(a&&!l.includes(a.value)){k(a.value);return}N()},placeholder:K,className:i("min-w-0 flex-1 bg-transparent text-sm focus:outline-none","text-[var(--ui-ink-strong)] placeholder:text-[var(--ui-ink-faint)]")})]})]}),g&&P&&typeof document<"u"?G.createPortal(r.jsxs("div",{ref:C,role:"listbox","aria-multiselectable":"true",className:i("z-[80] overflow-y-auto overscroll-contain rounded-[22px] p-2 [webkit-overflow-scrolling:touch]",s?"border border-[var(--ui-border-subtle)] bg-[color-mix(in_srgb,var(--ui-surface-1)_94%,transparent)] shadow-[var(--ui-shadow-floating)]":"border border-[var(--ui-border-subtle)] bg-[color-mix(in_srgb,var(--ui-surface-1)_96%,transparent)] shadow-[var(--ui-shadow-floating)]","backdrop-blur-xl"),style:P,children:[x.map((e,t)=>r.jsx("button",{type:"button",role:"option","aria-selected":!1,className:i("flex w-full items-start justify-between gap-3 rounded-[18px] px-3 py-2.5 text-left transition",t===D?"bg-[var(--ui-surface-3)] text-[var(--ui-ink-strong)]":"text-[var(--ui-ink-medium)] hover:bg-[var(--ui-surface-hover)] hover:text-[var(--ui-ink-strong)]"),onMouseEnter:()=>f(t),onMouseDown:a=>a.preventDefault(),onPointerDown:a=>{a.preventDefault(),k(e.value)},onClick:()=>k(e.value),children:r.jsxs("div",{className:"min-w-0",children:[r.jsx("div",{className:"truncate text-sm font-medium",children:e.kind?r.jsx(A,{kind:e.kind,label:e.label,compact:!0,gradient:!1}):e.menuBadge?e.menuBadge:e.badge?e.badge:e.label}),e.description?r.jsx("div",{className:i("mt-1 text-xs leading-5","text-[var(--ui-ink-soft)]"),children:e.description}):null]})},e.value)),!R&&d&&h?r.jsxs("button",{type:"button",disabled:M,className:i("mt-1 flex w-full items-center gap-2 rounded-[18px] px-3 py-2.5 text-left text-sm transition disabled:opacity-50","text-[var(--secondary)] hover:bg-[var(--ui-surface-hover)]"),onMouseDown:e=>e.preventDefault(),onPointerDown:e=>{e.preventDefault(),N()},onClick:()=>void N(),children:[r.jsx(J,{className:"size-4"}),r.jsx("span",{className:"truncate",children:M?"Creating…":`${q} "${v.trim()}"`})]}):null,x.length===0&&(!d||R||!h)?r.jsx("div",{className:i("px-3 py-2.5 text-sm","text-[var(--ui-ink-soft)]"),children:U}):null]}),document.body):null,_?r.jsx("div",{className:"text-sm text-[color-mix(in_srgb,var(--danger)_74%,var(--ui-ink-strong)_26%)]",children:_}):null]})}export{te as E};
@@ -1 +1 @@
1
- import{b5 as p,j as o,aS as l}from"./vendor-Dnkkx2co.js";import{ap as x,cN as f}from"./index-QJkjKYzZ.js";function g({entityType:n,entityId:i,count:s,compact:r=!1,className:u=""}){const a=p(),t=x(n,i);return t?o.jsxs("span",{role:"link",tabIndex:0,className:`inline-flex items-center rounded-full border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-2)] text-[var(--ui-ink-medium)] transition hover:bg-[var(--ui-surface-2)] hover:text-[var(--ui-ink-strong)] ${r?"min-h-5 gap-1 px-2 py-0.5 text-[10px]":"min-h-10 gap-2 px-3 py-2 text-xs"} ${u}`,onClick:e=>{e.stopPropagation(),a(t)},onKeyDown:e=>{(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),e.stopPropagation(),a(t))},children:[o.jsx(l,{className:r?"size-3":"size-3.5"}),f(s)]}):null}export{g as E};
1
+ import{b6 as l,j as o,aS as p}from"./vendor-Cpmju3nw.js";import{ca as x,ab as f}from"./index-BejvcRGb.js";function g({entityType:n,entityId:i,count:s,compact:r=!1,className:u=""}){const a=l(),t=f(n,i);return t?o.jsxs("span",{role:"link",tabIndex:0,className:`inline-flex items-center rounded-full border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-2)] text-[var(--ui-ink-medium)] transition hover:bg-[var(--ui-surface-2)] hover:text-[var(--ui-ink-strong)] ${r?"min-h-5 gap-1 px-2 py-0.5 text-[10px]":"min-h-10 gap-2 px-3 py-2 text-xs"} ${u}`,onClick:e=>{e.stopPropagation(),a(t)},onKeyDown:e=>{(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),e.stopPropagation(),a(t))},children:[o.jsx(p,{className:r?"size-3":"size-3.5"}),x(s)]}):null}export{g as E};
@@ -0,0 +1 @@
1
+ import{r as l,j as e,bX as qe,b7 as Je,cM as Ke,c8 as We,c1 as Pe}from"./vendor-Cpmju3nw.js";import{j as Ye,i as y,k as W}from"./state-BtwEvpO6.js";import{d as Ze,b0 as Y,c9 as es,aa as ss,b2 as ts,b1 as as,C as rs,a4 as is,k as b,ca as ns,B as v,I as j,T as Me,a$ as N,i as ls,ba as os,b3 as ds,b4 as cs,b5 as us,b6 as ms,b7 as ps,b8 as xs,b9 as ys}from"./index-BejvcRGb.js";import{N as Z}from"./note-markdown-Byd_vNkS.js";import{n as ee,N as ze,f as vs,p as gs,b as hs}from"./note-tags-input-DYAFDq8Q.js";import{e as u}from"./user-ownership-DJGl4rAj.js";function fs(o,d,c){return o.links.filter(p=>!(p.entityType===d&&p.entityId===c))}function bs(o,d){return o.entityType===d.entityType&&o.entityId===d.entityId&&(o.anchorKey??null)===(d.anchorKey??null)}function se(o){const d=new Set;return o.filter(c=>{const p=`${c.entityType}:${c.entityId}:${c.anchorKey??""}`;return d.has(p)?!1:(d.add(p),!0)})}function Fe(o,d,c){return gs(o)??hs(d,c)}function Ss({entityType:o,entityId:d,anchorKey:c,includeAnchorlessWhenAnchored:p=!1,title:Qe="Notes",description:Ve="Markdown notes linked to this entity stay searchable, editable, and visible alongside the work.",invalidateQueryKeys:Be=[],compact:te=!1}){var Ce,Se,De,Te,Le,Ie,Ee,$e,Ae;const m=Ze(),L=Ye(),[I,Oe]=l.useState(""),[ae,E]=l.useState(!1),[h,$]=l.useState(""),[re,A]=l.useState(!1),[Ue,q]=l.useState({entityType:"goal",entityId:""}),[ie,K]=l.useState([]),[ne,P]=l.useState([]),[le,M]=l.useState(""),[oe,z]=l.useState(""),[de,F]=l.useState("days"),[He,Q]=l.useState(null),[f,V]=l.useState(""),[ce,k]=l.useState(!1),[B,O]=l.useState([]),[Re,U]=l.useState({entityType:"goal",entityId:""}),[ue,w]=l.useState([]),[me,_]=l.useState(""),[pe,C]=l.useState(""),[xe,S]=l.useState("days"),H=Y(c),ye=es(o,c),g=y({queryKey:["notes",o,d],queryFn:()=>os({linkedEntityType:o,linkedEntityId:d,limit:100})}),ve=y({queryKey:["forge-psyche-values"],queryFn:ds}),ge=y({queryKey:["forge-psyche-patterns"],queryFn:cs}),he=y({queryKey:["forge-psyche-behaviors"],queryFn:us}),fe=y({queryKey:["forge-psyche-beliefs"],queryFn:ms}),be=y({queryKey:["forge-psyche-modes"],queryFn:ps}),je=y({queryKey:["forge-psyche-flashcards"],queryFn:xs}),Ne=y({queryKey:["forge-psyche-reports"],queryFn:ys}),R=l.useMemo(()=>{var s,n,r,a,x,i,D,T;return{goal:m.snapshot.goals.map(t=>({id:t.id,label:u(t.title,t.user)})),project:m.snapshot.dashboard.projects.map(t=>({id:t.id,label:u(t.title,t.user)})),task:m.snapshot.tasks.map(t=>({id:t.id,label:u(t.title,t.user)})),strategy:m.snapshot.strategies.map(t=>({id:t.id,label:u(t.title,t.user)})),habit:m.snapshot.habits.map(t=>({id:t.id,label:u(t.title,t.user)})),tag:m.snapshot.tags.map(t=>({id:t.id,label:u(t.name,t.user)})),note:(((s=g.data)==null?void 0:s.notes)??[]).map(t=>({id:t.id,label:t.contentPlain||t.contentMarkdown})),insight:[],psyche_value:(((n=ve.data)==null?void 0:n.values)??[]).map(t=>({id:t.id,label:u(t.title,t.user)})),behavior_pattern:(((r=ge.data)==null?void 0:r.patterns)??[]).map(t=>({id:t.id,label:u(t.title,t.user)})),behavior:(((a=he.data)==null?void 0:a.behaviors)??[]).map(t=>({id:t.id,label:u(t.title,t.user)})),belief_entry:(((x=fe.data)==null?void 0:x.beliefs)??[]).map(t=>({id:t.id,label:u(t.statement,t.user)})),mode_profile:(((i=be.data)==null?void 0:i.modes)??[]).map(t=>({id:t.id,label:u(t.title,t.user)})),flashcard:(((D=je.data)==null?void 0:D.flashcards)??[]).map(t=>({id:t.id,label:u(t.title||t.message,t.user)})),mode_guide_session:[],event_type:[],emotion_definition:[],trigger_report:(((T=Ne.data)==null?void 0:T.reports)??[]).map(t=>({id:t.id,label:u(t.title,t.user)})),calendar_event:[],work_block_template:[],task_timebox:[],preference_catalog:[],preference_catalog_item:[],preference_context:[],preference_item:[],questionnaire_instrument:[],sleep_session:[],workout_session:[]}},[(Ce=he.data)==null?void 0:Ce.behaviors,(Se=fe.data)==null?void 0:Se.beliefs,(De=je.data)==null?void 0:De.flashcards,(Te=be.data)==null?void 0:Te.modes,(Le=g.data)==null?void 0:Le.notes,(Ie=ge.data)==null?void 0:Ie.patterns,(Ee=Ne.data)==null?void 0:Ee.reports,m.snapshot.dashboard.projects,m.snapshot.goals,m.snapshot.habits,m.snapshot.strategies,m.snapshot.tags,m.snapshot.tasks,($e=ve.data)==null?void 0:$e.values]),X=async()=>{await Promise.all([L.invalidateQueries({queryKey:["notes",o,d]}),ls(L),...Be.map(s=>L.invalidateQueries({queryKey:s}))])},ke=W({mutationFn:async s=>ss({contentMarkdown:s,tags:ee(ne),destroyAt:Fe(le,oe,de),links:se([{entityType:o,entityId:d,anchorKey:c??null},...ie])}),onSuccess:async()=>{$(""),A(!1),K([]),q({entityType:"goal",entityId:""}),P([]),M(""),z(""),F("days"),await X()}}),we=W({mutationFn:async({noteId:s,contentMarkdown:n,links:r,tags:a,destroyAt:x})=>ts(s,{contentMarkdown:n,links:r,tags:a,destroyAt:x}),onSuccess:async()=>{Q(null),V(""),k(!1),O([]),U({entityType:"goal",entityId:""}),w([]),_(""),C(""),S("days"),await X()}}),Xe=W({mutationFn:async s=>as(s),onSuccess:X}),G=l.useMemo(()=>{var n;return(((n=g.data)==null?void 0:n.notes)??[]).filter(r=>c===void 0?!0:r.links.some(a=>a.entityType===o&&a.entityId===d&&((a.anchorKey??null)===c||p&&(a.anchorKey??null)===null))).filter(r=>{const a=I.trim().toLowerCase();return a?`${r.contentPlain} ${r.author??""} ${(r.tags??[]).join(" ")}`.toLowerCase().includes(a):!0})},[c,d,o,p,(Ae=g.data)==null?void 0:Ae.notes,I]),Ge=(s,n,r)=>{const a=s.entityId.trim();return a?(n(se([...r,{entityType:s.entityType,entityId:a,anchorKey:null}])),!0):!1},J=s=>{var r,a;const n=(r=R[s.entityType])==null?void 0:r.find(x=>x.id===s.entityId);return(a=n==null?void 0:n.label)!=null&&a.trim()?n.label.trim():`Deleted ${N(s.entityType)}`},_e=(s,n,r,a,x)=>e.jsxs("div",{className:"min-w-0 rounded-[20px] bg-[var(--ui-surface-1)] p-4",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.16em] text-[var(--ui-ink-faint)]",children:"Linked entities"}),e.jsxs(b,{className:"bg-[var(--ui-surface-2)] text-[var(--ui-ink-medium)]",children:[s.length," linked"]})]}),e.jsx("div",{className:"mt-3 flex flex-wrap gap-2",children:s.map(i=>{const D=s.length>1;return e.jsxs("div",{className:"inline-flex max-w-full items-center gap-2 rounded-full bg-[var(--ui-surface-2)] px-3 py-2 text-sm text-[var(--ui-ink-medium)]",children:[e.jsxs("span",{className:"min-w-0 break-words [overflow-wrap:anywhere]",children:[N(i.entityType)," · ",J(i)]}),i.anchorKey?e.jsx("span",{className:"shrink-0 rounded-full bg-[var(--ui-surface-3)] px-2 py-0.5 text-[11px] text-[var(--ui-ink-soft)]",children:Y(i.anchorKey)}):null,e.jsx("button",{type:"button",disabled:!D,className:"shrink-0 text-[var(--ui-ink-faint)] transition hover:text-[var(--ui-ink-strong)] disabled:cursor-not-allowed disabled:opacity-30",onClick:()=>n(s.filter(T=>!bs(T,i))),"aria-label":`Remove ${N(i.entityType)} link to ${J(i)}`,children:e.jsx(Pe,{className:"size-3.5"})})]},`${x}-${i.entityType}-${i.entityId}-${i.anchorKey??""}`)})}),e.jsxs("div",{className:"mt-4 grid gap-3 md:grid-cols-[minmax(0,11rem)_minmax(0,1fr)_auto]",children:[e.jsx("select",{className:"rounded-[14px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-2)] px-3 py-3 text-[var(--ui-ink-strong)] outline-none transition focus:border-[var(--ui-border-strong)]",value:r.entityType,onChange:i=>a({...r,entityType:i.target.value,entityId:""}),children:["goal","project","task","strategy","habit","tag","note","psyche_value","behavior_pattern","behavior","belief_entry","mode_profile","mode_guide_session","flashcard","event_type","emotion_definition","trigger_report"].map(i=>e.jsx("option",{value:i,children:N(i)},i))}),e.jsxs("select",{className:"min-w-0 rounded-[14px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-2)] px-3 py-3 text-[var(--ui-ink-strong)] outline-none transition focus:border-[var(--ui-border-strong)]",value:r.entityId,onChange:i=>a({...r,entityId:i.target.value}),children:[e.jsx("option",{value:"",children:(R[r.entityType]??[]).length>0?"Choose linked item":"No linked items available"}),(R[r.entityType]??[]).map(i=>e.jsx("option",{value:i.id,children:i.label},i.id))]}),e.jsx(v,{variant:"secondary",disabled:!r.entityId,onClick:()=>{Ge(r,n,s)&&a({...r,entityId:""})},children:"Add link"})]})]});return e.jsx(rs,{id:"notes",className:te?"min-w-0 overflow-hidden p-0":"min-w-0 overflow-hidden",children:e.jsxs("div",{className:te?"p-4":void 0,children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"font-label text-[11px] uppercase tracking-[0.18em] text-[var(--ui-ink-faint)]",children:Qe}),e.jsx("div",{className:"mt-2 text-sm leading-6 text-[var(--ui-ink-soft)]",children:Ve}),H?e.jsxs("div",{className:"mt-3 inline-flex max-w-full items-center gap-2 rounded-full bg-[var(--ui-surface-1)] px-3 py-2 text-xs text-[var(--ui-ink-soft)]",children:[e.jsxs("span",{children:["Pinned to ",H]}),ye?e.jsx(is,{content:ye,label:`Explain ${H}`}):null]}):null]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(b,{className:"bg-[var(--ui-surface-2)] text-[var(--ui-ink-medium)]",children:ns(G.length)}),ae?null:e.jsxs(v,{type:"button",size:"sm",onClick:()=>E(!0),children:[e.jsx(qe,{className:"size-4"}),"Add note"]})]})]}),e.jsxs("div",{className:"mt-4 flex items-center gap-2 rounded-[22px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-1)] px-3 py-3",children:[e.jsx(Je,{className:"size-4 text-[var(--ui-ink-faint)]"}),e.jsx(j,{value:I,onChange:s=>Oe(s.target.value),placeholder:"Search notes by content, author, or note tag",className:"border-0 bg-transparent px-0 py-0"})]}),ae?e.jsxs("div",{className:"mt-4 rounded-[24px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-1)] p-4",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-[var(--ui-ink-medium)]",children:[e.jsx(qe,{className:"size-4 text-[var(--secondary)]"}),"Add note"]}),e.jsxs(v,{type:"button",variant:"secondary",size:"sm",className:"gap-2",onClick:()=>A(s=>!s),children:[e.jsx(Ke,{className:"size-4"}),re?"Back to editor":"Preview"]})]}),e.jsx("div",{className:"mt-3",children:re?e.jsxs("div",{className:"rounded-[20px] bg-[var(--ui-surface-2)] p-4",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.16em] text-[var(--ui-ink-faint)]",children:"Preview"}),e.jsx("div",{className:"mt-3",children:h.trim()?e.jsx(Z,{markdown:h}):e.jsx("div",{className:"text-sm leading-6 text-[var(--ui-ink-faint)]",children:"Markdown preview appears here once you have note content."})})]}):e.jsx(Me,{value:h,onChange:s=>$(s.target.value),placeholder:"Write in Markdown. Summaries, blockers, what changed, and why all work well here.",className:"min-h-[12rem]"})}),e.jsx("div",{className:"mt-3",children:_e(se([{entityType:o,entityId:d,anchorKey:c??null},...ie]),s=>K(s.filter(n=>!(n.entityType===o&&n.entityId===d&&(n.anchorKey??null)===(c??null)))),Ue,q,"composer-note-links")}),e.jsxs("div",{className:"mt-3 grid gap-3 lg:grid-cols-[minmax(0,1.15fr)_minmax(0,0.85fr)]",children:[e.jsx(ze,{value:ne,onChange:P}),e.jsxs("div",{className:"grid gap-3 rounded-[20px] bg-[var(--ui-surface-1)] p-4",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.16em] text-[var(--ui-ink-faint)]",children:"Ephemeral auto-destroy"}),e.jsx("div",{className:"mt-2 text-xs leading-5 text-[var(--ui-ink-faint)]",children:"Set an exact destroy time or a relative delay. Leaving both blank keeps the note durable."})]}),e.jsx(j,{type:"datetime-local",value:le,onChange:s=>M(s.target.value)}),e.jsxs("div",{className:"grid gap-3 md:grid-cols-[minmax(0,1fr)_10rem]",children:[e.jsx(j,{type:"number",min:"1",value:oe,onChange:s=>z(s.target.value),placeholder:"Destroy after"}),e.jsxs("select",{className:"rounded-[14px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-1)] px-3 py-3 text-sm text-[var(--ui-ink-strong)] outline-none transition focus:border-[var(--ui-border-strong)]",value:de,onChange:s=>F(s.target.value),children:[e.jsx("option",{value:"hours",children:"Hours"}),e.jsx("option",{value:"days",children:"Days"})]})]})]})]}),e.jsxs("div",{className:"mt-3 flex flex-wrap justify-end gap-2",children:[e.jsx(v,{type:"button",variant:"secondary",onClick:()=>{E(!1),A(!1),$(""),K([]),q({entityType:"goal",entityId:""}),P([]),M(""),z(""),F("days")},children:"Cancel"}),e.jsx(v,{pending:ke.isPending,pendingLabel:"Saving",disabled:h.trim().length===0,onClick:async()=>{await ke.mutateAsync(h.trim()),E(!1)},children:"Save note"})]})]}):null,e.jsxs("div",{className:"mt-4 grid gap-3",children:[g.isLoading?e.jsx("div",{className:"rounded-[20px] bg-[var(--ui-surface-1)] p-4 text-sm text-[var(--ui-ink-soft)]",children:"Loading notes…"}):null,!g.isLoading&&G.length===0?e.jsx("div",{className:"rounded-[20px] bg-[var(--ui-surface-1)] p-4 text-sm text-[var(--ui-ink-soft)]",children:"No notes are linked here yet."}):null,G.map(s=>{const n=He===s.id,r=fs(s,o,d);return e.jsxs("article",{className:"min-w-0 rounded-[24px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-1)] p-4",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"break-words text-xs uppercase tracking-[0.16em] text-[var(--ui-ink-faint)] [overflow-wrap:anywhere]",children:[(s.author??"Unknown author").toString()," •"," ",new Date(s.updatedAt).toLocaleString()]}),e.jsxs("div",{className:"mt-2 flex flex-wrap gap-2",children:[r.map(a=>e.jsxs(b,{className:"bg-[var(--ui-surface-2)] text-[var(--ui-ink-medium)]",wrap:!0,children:[N(a.entityType)," ·"," ",J(a),a.anchorKey?` · ${Y(a.anchorKey)}`:""]},`${s.id}-${a.entityType}-${a.entityId}-${a.anchorKey??""}`)),(s.tags??[]).map(a=>e.jsx(b,{className:"bg-[var(--ui-info-soft)] text-[color-mix(in_srgb,var(--info)_78%,var(--ui-ink-strong)_22%)]",wrap:!0,children:a},`${s.id}-tag-${a}`)),s.destroyAt?e.jsxs(b,{className:"bg-[var(--ui-warning-soft)] text-[color-mix(in_srgb,var(--warning)_78%,var(--ui-ink-strong)_22%)]",wrap:!0,children:["Ephemeral · deletes"," ",new Date(s.destroyAt).toLocaleString()]}):null]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{type:"button",className:"inline-flex size-9 items-center justify-center rounded-full bg-[var(--ui-surface-2)] text-[var(--ui-ink-soft)] transition hover:bg-[var(--ui-surface-hover)] hover:text-[var(--ui-ink-strong)]",onClick:()=>{Q(s.id),V(s.contentMarkdown),k(!1),O(s.links),U({entityType:"goal",entityId:""}),w(ee(s.tags??[])),_(vs(s.destroyAt??null)),C(""),S("days")},children:e.jsx(We,{className:"size-4"})}),e.jsx("button",{type:"button",className:"inline-flex size-9 items-center justify-center rounded-full bg-[var(--ui-danger-soft)] text-[color-mix(in_srgb,var(--danger)_76%,var(--ui-ink-strong)_24%)] transition hover:bg-[color-mix(in_srgb,var(--danger)_18%,var(--ui-surface-hover)_82%)]",onClick:()=>{Xe.mutateAsync(s.id)},children:e.jsx(Pe,{className:"size-4"})})]})]}),n?e.jsxs("div",{className:"mt-4",children:[e.jsx("div",{className:"flex flex-wrap items-center justify-end gap-2",children:e.jsxs(v,{type:"button",variant:"secondary",size:"sm",className:"gap-2",onClick:()=>k(a=>!a),children:[e.jsx(Ke,{className:"size-4"}),ce?"Back to editor":"Preview"]})}),e.jsx("div",{className:"mt-3",children:ce?e.jsxs("div",{className:"rounded-[20px] bg-[var(--ui-surface-2)] p-4",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.16em] text-[var(--ui-ink-faint)]",children:"Preview"}),e.jsx("div",{className:"mt-3",children:f.trim()?e.jsx(Z,{markdown:f}):e.jsx("div",{className:"text-sm text-[var(--ui-ink-faint)]",children:"No content yet."})})]}):e.jsx(Me,{value:f,onChange:a=>V(a.target.value),className:"min-h-[12rem]"})}),e.jsxs("div",{className:"mt-3 grid gap-3 lg:grid-cols-[minmax(0,1.15fr)_minmax(0,0.85fr)]",children:[e.jsx(ze,{value:ue,onChange:w}),e.jsxs("div",{className:"grid gap-3 rounded-[20px] bg-[var(--ui-surface-1)] p-4",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.16em] text-[var(--ui-ink-faint)]",children:"Ephemeral auto-destroy"}),e.jsx("div",{className:"mt-2 text-xs leading-5 text-[var(--ui-ink-faint)]",children:"Set an exact destroy time or a relative delay. Leaving both blank keeps the note durable."})]}),e.jsx(j,{type:"datetime-local",value:me,onChange:a=>_(a.target.value)}),e.jsxs("div",{className:"grid gap-3 md:grid-cols-[minmax(0,1fr)_10rem]",children:[e.jsx(j,{type:"number",min:"1",value:pe,onChange:a=>C(a.target.value),placeholder:"Destroy after"}),e.jsxs("select",{className:"rounded-[14px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-1)] px-3 py-3 text-sm text-[var(--ui-ink-strong)] outline-none transition focus:border-[var(--ui-border-strong)]",value:xe,onChange:a=>S(a.target.value),children:[e.jsx("option",{value:"hours",children:"Hours"}),e.jsx("option",{value:"days",children:"Days"})]})]})]})]}),e.jsx("div",{className:"mt-3",children:_e(B,O,Re,U,`edit-note-links-${s.id}`)}),e.jsxs("div",{className:"mt-3 flex flex-wrap justify-end gap-2",children:[e.jsx(v,{variant:"secondary",onClick:()=>{Q(null),k(!1),w([]),_(""),C(""),S("days")},children:"Cancel"}),e.jsx(v,{pending:we.isPending,pendingLabel:"Saving",disabled:f.trim().length===0||B.length===0,onClick:async()=>{await we.mutateAsync({noteId:s.id,contentMarkdown:f.trim(),links:B,tags:ee(ue),destroyAt:Fe(me,pe,xe)})},children:"Save changes"})]})]}):e.jsx("div",{className:"mt-4",children:e.jsx(Z,{markdown:s.contentMarkdown})})]},s.id)})]})]})})}export{Ss as E};
@@ -0,0 +1 @@
1
+ import{r as N,b3 as Je,c8 as Fe,c5 as Qe,cq as he,j as t,c1 as je,b2 as pt,c4 as Xe,cr as Ye,cs as Ze,bC as xt,b9 as gt,c3 as bt,aO as ht,aP as ve,bD as Ue,ct as vt}from"./vendor-Cpmju3nw.js";import{u as wt,a as jt,D as yt,S as Pe,v as qe,e as Nt,p as kt,f as St,P as It,g as Te,b as et,C as tt}from"./board-CLOHbg6t.js";import{u as ye,C as it,B as Ve,c as W,R as Ct,a as rt,b as le,k as S,E as at}from"./index-BejvcRGb.js";import{U as we}from"./user-badge-BKzwGZDd.js";import{E as zt}from"./entity-note-count-link-CEtKyMAl.js";import{F as Dt}from"./floating-action-menu-GCeuOdYZ.js";function $t(e){if(typeof e=="number"&&Number.isInteger(e)&&e>0)return e;if(typeof e=="string"){const r=e.match(/(\d+)/);if(r){const l=Number.parseInt(r[1]??"",10);return Number.isInteger(l)&&l>0?l:null}}return null}function Ge(e){return e.split(/\r?\n/).map(r=>r.trim()).reduce((r,l)=>{const o=l.match(/^[-*+]\s+\[([ xX])\]\s+(.+)$/);if(o)return r.push({label:o[2].trim(),completed:o[1].toLowerCase()==="x"}),r;const c=l.match(/^(?:[-*+]|\d+\.)\s+(.+)$/);return c&&r.push({label:c[1].trim(),completed:null}),r},[]).filter(r=>r.label.length>0)}function _t(e){if(e.acceptanceCriteria.length>0)return{total:e.acceptanceCriteria.length,completed:e.status==="done"?e.acceptanceCriteria.length:0,source:"acceptance_criteria",items:e.acceptanceCriteria};const r=Ge(e.aiInstructions);if(r.length>0){const o=e.status==="done"?r.length:r.filter(c=>c.completed===!0).length;return{total:r.length,completed:o,source:"ai_instructions",items:r.map(c=>c.label)}}const l=Ge(e.description);if(l.length>0){const o=e.status==="done"?l.length:l.filter(c=>c.completed===!0).length;return{total:l.length,completed:o,source:"description",items:l.map(c=>c.label)}}return null}function He(e,r){return e.find(l=>l.refType===r)??null}function nt(e,r=null){var f,x,w,D,k,C,$,U,_,B,R;const l=new Set(((f=e.completionReport)==null?void 0:f.linkedGitRefIds)??[]),o=He(e.gitRefs,"branch"),c=He(e.gitRefs,"pull_request"),u=(r==null?void 0:r.gitContext)??null,m=(u==null?void 0:u.pullRequestNumber)??$t((c==null?void 0:c.refValue)??(c==null?void 0:c.displayTitle)??null);return{actor:(r==null?void 0:r.actor)??null,activeRun:r,stepSummary:_t(e),changedFileCount:((x=e.completionReport)==null?void 0:x.modifiedFiles.length)??0,changedFilesPreview:(((w=e.completionReport)==null?void 0:w.modifiedFiles)??[]).slice(0,2),git:{provider:((D=u==null?void 0:u.provider)==null?void 0:D.trim())||((k=o==null?void 0:o.provider)==null?void 0:k.trim())||((C=c==null?void 0:c.provider)==null?void 0:C.trim())||null,repository:(($=u==null?void 0:u.repository)==null?void 0:$.trim())||((U=o==null?void 0:o.repository)==null?void 0:U.trim())||((_=c==null?void 0:c.repository)==null?void 0:_.trim())||null,branch:((B=u==null?void 0:u.branch)==null?void 0:B.trim())||((R=o==null?void 0:o.refValue)==null?void 0:R.trim())||null,branchUrl:(u==null?void 0:u.branchUrl)??(o==null?void 0:o.url)??null,pullRequestNumber:m,pullRequestUrl:(u==null?void 0:u.pullRequestUrl)??(c==null?void 0:c.url)??null,compareUrl:(u==null?void 0:u.compareUrl)??null,linkedRefCount:l.size}}}const I=["backlog","focus","in_progress","blocked","done"];function Bt(e){if(!e)return null;const r=Date.parse(e);return Number.isNaN(r)?null:new Date(r).toISOString().slice(0,10)}function Mt({task:e,onOpenTask:r,onEditTask:l,onLinkTask:o,onCreateTaskForIssue:c,onCreateSubtaskForTask:u,onMove:m,onDeleteTask:f,deletePendingTaskId:x,onRequestDelete:w}){const D=e.level==="issue"?{id:"create-task",label:"Create task",description:"Add a focused execution task under this issue.",icon:he,onSelect:()=>c==null?void 0:c(e.id)}:e.level==="task"?{id:"create-subtask",label:"Create subtask",description:"Add a granular child step under this task.",icon:he,onSelect:()=>u==null?void 0:u(e.id)}:null;return[{id:"open-task",label:"Open",description:"Jump to the work-item detail view.",icon:Je,onSelect:()=>r==null?void 0:r(e.id)},{id:"edit-task",label:"Edit",description:"Open the guided work-item editor.",icon:Fe,onSelect:()=>l==null?void 0:l(e.id)},{id:"link-task",label:"Link",description:"Open the placement step to relink this work item.",icon:Qe,onSelect:()=>o==null?void 0:o(e.id)},...D?[D]:[],{id:"delete-task",label:e.level==="issue"?"Delete issue":e.level==="subtask"?"Delete subtask":"Delete task",description:"Remove this work item directly from the board menu.",icon:je,tone:"danger",disabled:!f||x===e.id,onSelect:()=>w(e)},...I.filter(k=>k!==e.status).map(k=>({id:`move-task-${k}`,label:`Move to ${k.replaceAll("_"," ")}`,description:"Update the workflow lane for this work item.",onSelect:()=>void m(e.id,k)}))]}function st(e){return e.startsWith("lane:")||e.includes(":lane:")}function At(e){var r,l;return((l=(r=e.data)==null?void 0:r.current)==null?void 0:l.type)==="lane"||st(String(e.id))}function Lt(e){var r,l;return((l=(r=e.data)==null?void 0:r.current)==null?void 0:l.type)==="trash"}function Et(e,r){const l=Math.max(0,Math.min(e.right,r.right)-Math.max(e.left,r.left)),o=Math.max(0,Math.min(e.bottom,r.bottom)-Math.max(e.top,r.top));return l*o}const Rt=e=>{const r=kt(e),l=r.find(m=>{const f=e.droppableContainers.find(x=>x.id===m.id);return f?Lt(f):!1});if(l)return[l];const o=r.find(m=>st(String(m.id)));if(o)return[o];const u=e.droppableContainers.filter(m=>At(m)).map(m=>{const f=e.droppableRects.get(m.id);if(!f)return null;const x=Et(e.collisionRect,f);return x<=0?null:{id:m.id,data:{droppableContainer:m,value:x}}}).filter(Boolean).sort((m,f)=>{var x,w;return(((x=f==null?void 0:f.data)==null?void 0:x.value)??0)-(((w=m==null?void 0:m.data)==null?void 0:w.value)??0)});return u.length>0?u:r.length>0?r:St(e)};function Ot(e,r){return r&&r.trim().length>0?r:e!=null&&e.actor?`${e.actor} session`:"Active work"}function Ut(e,r){return[(e==null?void 0:e.actor)??null,r].filter(Boolean).join(" · ")}function Ke(e){e.preventDefault(),e.stopPropagation()}function lt({task:e,goal:r,tags:l,activeRun:o,isSelected:c,isDragging:u=!1,isOverlay:m=!1,style:f,setNodeRef:x,dragAttributes:w,dragListeners:D,isMobile:k=!1,onSelect:C,onStartTask:$,onStopTask:U,onQuickReopen:_,onStepTask:B,onSplitTask:R,onOpenMenu:P,notesSummaryByEntity:q}){var X;const{t:M,formatDate:ae}=ye(),j=nt(e,o??null),z=j.stepSummary,h=I[I.indexOf(e.status)-1]??null,A=I[I.indexOf(e.status)+1]??null,oe=Ct(q,"task",e.id).count,L=e.level==="issue"?"issue":"task",ce=rt(L),te=e.level==="subtask"?"136,146,255":ce.colorToken.rgb.join(", "),V=e.dueDate&&!Number.isNaN(Date.parse(e.dueDate))?ae(e.dueDate):"No due date",J=z&&z.total>0?Math.max(8,Math.round(z.completed/z.total*100)):null,b=j.git.branch,F=j.git.branchUrl,G=j.git.pullRequestNumber?`PR #${j.git.pullRequestNumber}`:null,Q=j.git.pullRequestUrl;return t.jsxs("article",{ref:x,style:{...f,"--board-card-accent":te},className:W("w-full max-w-full min-w-0 overflow-hidden rounded-[18px] p-3 shadow-[inset_0_0_0_1px_rgba(var(--board-card-accent),0.12)] transition cursor-grab active:cursor-grabbing",k&&"touch-none select-none",m&&"rotate-[0.5deg] bg-[linear-gradient(180deg,rgba(var(--board-card-accent),0.22),rgba(var(--board-card-accent),0.08))] shadow-[var(--ui-shadow-floating)]",u&&!m&&"opacity-35 shadow-[inset_0_0_0_1px_rgba(var(--board-card-accent),0.08)]",c?"bg-[linear-gradient(180deg,rgba(var(--board-card-accent),0.18),rgba(var(--board-card-accent),0.06))] shadow-[var(--ui-shadow-soft)]":"bg-[linear-gradient(180deg,rgba(var(--board-card-accent),0.08),color-mix(in_srgb,var(--ui-surface-1)_72%,transparent))]"),"data-dragging":u?"true":"false","data-testid":`task-card-${e.id}`,onClick:()=>C(e.id),...w,...D,children:[t.jsx("div",{className:"mb-3 h-px w-full rounded-full",style:{background:`linear-gradient(90deg, rgba(${te}, 0.96), rgba(${te}, 0.18))`}}),t.jsxs("div",{className:"mb-3 flex items-start justify-between gap-3",children:[t.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[t.jsx(le,{kind:L,label:e.level,compact:!0,size:"xs",gradient:!1,className:"shrink-0"}),t.jsx(S,{size:"xs",className:"shrink-0 text-[10px] text-[var(--tertiary)]",children:e.priority}),j.actor?t.jsxs(S,{size:"xs",className:"shrink-0 bg-cyan-400/12 text-[var(--info)]",children:[t.jsx(pt,{className:"mr-1 size-3"}),j.actor]}):null]}),t.jsxs("div",{className:"flex shrink-0 flex-wrap items-center justify-end gap-1.5",children:[P?t.jsx("button",{type:"button","aria-label":`Open ${e.title} actions`,className:"inline-flex size-8 items-center justify-center rounded-full bg-[var(--ui-surface-2)] text-[var(--ui-ink-soft)] transition hover:bg-[var(--ui-surface-3)] hover:text-[var(--ui-ink-strong)]",onClick:g=>{g.preventDefault(),g.stopPropagation(),P(g,e)},children:t.jsx(Xe,{className:"size-3.5"})}):null,k?t.jsxs("div",{className:"flex items-center gap-1",onClick:g=>g.stopPropagation(),children:[t.jsx("button",{type:"button","aria-label":`Move ${e.title} to the previous lane`,className:"inline-flex size-7 items-center justify-center rounded-full bg-[var(--ui-surface-2)] text-[var(--ui-ink-soft)] transition hover:bg-[var(--ui-surface-3)] hover:text-[var(--ui-ink-strong)] disabled:opacity-35",disabled:!h,onClick:()=>{h&&(B==null||B(e.id,"previous"))},children:t.jsx(Ye,{className:"size-3.5"})}),t.jsx("button",{type:"button","aria-label":`Move ${e.title} to the next lane`,className:"inline-flex size-7 items-center justify-center rounded-full bg-[var(--ui-surface-2)] text-[var(--ui-ink-soft)] transition hover:bg-[var(--ui-surface-3)] hover:text-[var(--ui-ink-strong)] disabled:opacity-35",disabled:!A,onClick:()=>{A&&(B==null||B(e.id,"next"))},children:t.jsx(Ze,{className:"size-3.5"})})]}):null,o?t.jsx("button",{type:"button","aria-label":`Stop work on ${e.title}`,className:"inline-flex size-8 items-center justify-center rounded-full bg-rose-500/16 text-[var(--danger)] transition hover:bg-rose-500/24",onClick:g=>{g.preventDefault(),g.stopPropagation(),U==null||U(o)},children:t.jsx(xt,{className:"size-3.5 fill-current"})}):e.status!=="done"?t.jsx("button",{type:"button","aria-label":`Start work on ${e.title}`,className:"inline-flex size-8 items-center justify-center rounded-full bg-[var(--primary)]/16 text-[var(--primary)] transition hover:bg-[var(--primary)]/24",onClick:g=>{g.preventDefault(),g.stopPropagation(),$==null||$(e.id)},children:t.jsx(gt,{className:"size-4 fill-current"})}):null,(X=e.splitSuggestion)!=null&&X.shouldSplit&&R?t.jsxs("button",{type:"button","aria-label":`Split ${e.title}`,className:"inline-flex items-center gap-1 rounded-full bg-amber-400/12 px-2.5 py-1 text-[10px] font-medium tracking-[0.14em] text-[var(--warning)] transition hover:bg-amber-400/18",onClick:g=>{g.preventDefault(),g.stopPropagation(),R(e.id)},children:[t.jsx(bt,{className:"size-3.5"}),"Split it"]}):null,t.jsxs("span",{className:"shrink-0 text-[11px] text-[var(--ui-ink-faint)]",children:[e.points," xp"]})]})]}),t.jsx(at,{kind:L,label:e.title,className:"max-w-full",lines:3,labelClassName:"[overflow-wrap:anywhere]"}),t.jsx("p",{className:"mt-1.5 line-clamp-3 [overflow-wrap:anywhere] text-[12px] leading-5 text-[var(--ui-ink-soft)]",children:e.description||M("common.executionBoard.noExecutionNote")}),z?t.jsxs("div",{className:"mt-3 rounded-[16px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-1)] p-3",children:[t.jsxs("div",{className:"flex items-center justify-between gap-3 text-[11px] text-[var(--ui-ink-soft)]",children:[t.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[t.jsx(ht,{className:"size-3.5 text-[var(--info)]"}),z.total," step",z.total===1?"":"s"]}),t.jsxs("span",{className:"tabular-nums text-[var(--ui-ink-soft)]",children:[z.completed,"/",z.total]})]}),t.jsx("div",{className:"mt-2 h-1.5 overflow-hidden rounded-full bg-[var(--ui-surface-2)]",children:t.jsx("div",{className:"h-full rounded-full bg-[linear-gradient(90deg,rgba(56,189,248,0.96),rgba(125,211,252,0.62))]",style:{width:`${J??0}%`}})}),t.jsx("div",{className:"mt-2 grid gap-1.5",children:z.items.slice(0,2).map(g=>t.jsx("div",{className:"truncate text-[11px] text-[var(--ui-ink-soft)]",children:g},`${e.id}-${g}`))})]}):null,t.jsxs("div",{className:"mt-2.5 flex min-w-0 flex-wrap gap-1.5",children:[b?F?t.jsxs("a",{href:F,target:"_blank",rel:"noreferrer",className:"inline-flex min-w-0 max-w-full items-center gap-1 rounded-full border border-sky-300/18 bg-sky-400/12 px-2.5 py-1 text-[11px] text-[var(--info)] transition hover:bg-sky-400/18",onClick:Ke,children:[t.jsx(ve,{className:"size-3.5 shrink-0"}),t.jsx("span",{className:"truncate",children:b})]}):t.jsxs(S,{size:"xs",className:"min-w-0 max-w-full bg-sky-400/12 text-[var(--info)]",children:[t.jsx(ve,{className:"mr-1 size-3"}),t.jsx("span",{className:"truncate",children:b})]}):null,G?Q?t.jsxs("a",{href:Q,target:"_blank",rel:"noreferrer",className:"inline-flex min-w-0 max-w-full items-center gap-1 rounded-full border border-fuchsia-300/18 bg-fuchsia-400/12 px-2.5 py-1 text-[11px] text-[var(--primary)] transition hover:bg-fuchsia-400/18",onClick:Ke,children:[t.jsx(Ue,{className:"size-3.5 shrink-0"}),t.jsx("span",{className:"truncate",children:G})]}):t.jsxs(S,{size:"xs",className:"bg-fuchsia-400/12 text-[var(--primary)]",children:[t.jsx(Ue,{className:"mr-1 size-3"}),G]}):null,j.changedFileCount>0?t.jsxs(S,{size:"xs",className:"bg-amber-400/12 text-[var(--warning)]",children:[t.jsx(vt,{className:"mr-1 size-3"}),j.changedFileCount," file",j.changedFileCount===1?"":"s"]}):null,j.git.repository?t.jsx(S,{size:"xs",className:"bg-[var(--ui-surface-2)] text-[var(--ui-ink-soft)]",children:j.git.repository}):null]}),j.changedFilesPreview.length>0?t.jsx("div",{className:"mt-2 flex min-w-0 flex-wrap gap-1.5",children:j.changedFilesPreview.map(g=>t.jsx(S,{size:"xs",wrap:!0,className:"min-w-0 max-w-full bg-[var(--ui-surface-2)] font-mono text-[10px] text-[var(--ui-ink-soft)]",children:g},g))}):null,t.jsxs("div",{className:"mt-2.5 flex min-w-0 flex-wrap gap-1.5",children:[r?t.jsx(le,{kind:"goal",label:r.title,compact:!0,size:"xs",wrap:!0,className:"min-w-0 max-w-full"}):null,t.jsx(we,{user:e.user,compact:!0,size:"xs"}),t.jsx(zt,{entityType:"task",entityId:e.id,count:oe,compact:!0}),e.actionPointSummary?t.jsxs(S,{size:"xs",className:"bg-[var(--primary)]/12 text-[var(--primary)]",children:[Math.round(e.actionPointSummary.totalCostAp)," AP"]}):null,e.actionPointSummary?t.jsx(S,{size:"xs",className:"bg-[var(--ui-surface-2)] text-[var(--ui-ink-soft)]",children:e.actionPointSummary.costBand}):null,e.actionPointSummary?t.jsxs(S,{size:"xs",className:"bg-[var(--ui-surface-2)] text-[var(--ui-ink-soft)]",children:[Math.round(e.actionPointSummary.expectedDurationSeconds/3600)," ","h target"]}):null,e.time.totalCreditedSeconds>0?t.jsxs(S,{size:"xs",className:"bg-[var(--ui-surface-2)] text-[var(--ui-ink-soft)]",children:[Math.floor(e.time.totalCreditedSeconds/60)," min"]}):null,e.time.activeRunCount>0?t.jsxs(S,{size:"xs",className:"bg-emerald-500/12 text-[var(--success)]",children:[e.time.activeRunCount," live"]}):null,l.slice(0,2).map(g=>t.jsx(S,{size:"xs",className:"bg-[var(--ui-surface-2)]",style:{color:g.color},children:g.name},g.id))]}),t.jsxs("div",{className:"mt-2.5 flex min-w-0 items-center justify-between gap-2 text-[11px] text-[var(--ui-ink-faint)]",children:[t.jsxs("span",{className:"min-w-0 truncate",children:[e.effort," / ",e.energy]}),t.jsxs("div",{className:"flex min-w-0 shrink-0 items-center gap-2 text-right",children:[e.status==="done"&&_?t.jsx("button",{type:"button",className:"rounded-full bg-[var(--ui-surface-2)] px-3 py-1 text-[10px] tracking-[0.16em] text-[var(--ui-ink-strong)] transition hover:bg-[var(--ui-surface-3)]",onClick:g=>{g.preventDefault(),g.stopPropagation(),_(e.id)},children:M("common.executionBoard.reopen")}):null,t.jsx("span",{children:V})]})]})]})}function ge(e){const{task:r,sortableId:l}=e,{attributes:o,listeners:c,setNodeRef:u,transform:m,transition:f,isDragging:x}=et({id:l,data:{type:"task",taskId:r.id,status:r.status}});return t.jsx(lt,{...e,setNodeRef:u,dragAttributes:o,dragListeners:c,isDragging:x,isMobile:e.isMobile,onStartTask:e.onStartTask,onStopTask:e.onStopTask,onStepTask:e.onStepTask,onSplitTask:e.onSplitTask,notesSummaryByEntity:e.notesSummaryByEntity,style:{transform:tt.Transform.toString(m),transition:f}})}function ot({project:e,goal:r,isDragging:l=!1,isOverlay:o=!1,style:c,setNodeRef:u,dragAttributes:m,dragListeners:f,isMobile:x=!1,onStepProject:w,onOpenMenu:D}){const{formatDate:k}=ye(),C=I[I.indexOf(e.workflowStatus)-1]??null,$=I[I.indexOf(e.workflowStatus)+1]??null,_=rt("project").colorToken.rgb.join(", "),B=e.workflowStatus.replaceAll("_"," "),R=e.status.replaceAll("_"," "),P=Bt(e.updatedAt),q=P?k(P):"No recent update";return t.jsxs("article",{ref:u,style:{...c,"--board-card-accent":_},className:W("w-full max-w-full min-w-0 overflow-hidden rounded-[18px] p-3 shadow-[inset_0_0_0_1px_rgba(var(--board-card-accent),0.12)] transition cursor-grab active:cursor-grabbing",x&&"touch-none select-none",o&&"rotate-[0.5deg] bg-[linear-gradient(180deg,rgba(var(--board-card-accent),0.22),rgba(var(--board-card-accent),0.08))] shadow-[var(--ui-shadow-floating)]",l&&!o&&"opacity-35 shadow-[inset_0_0_0_1px_rgba(var(--board-card-accent),0.08)]",!l&&!o&&"bg-[linear-gradient(180deg,rgba(var(--board-card-accent),0.08),color-mix(in_srgb,var(--ui-surface-1)_72%,transparent))]"),"data-testid":`project-card-${e.id}`,...m,...f,children:[t.jsx("div",{className:"mb-3 h-px w-full rounded-full",style:{background:`linear-gradient(90deg, rgba(${_}, 0.96), rgba(${_}, 0.18))`}}),t.jsxs("div",{className:"mb-3 flex items-start justify-between gap-3",children:[t.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[t.jsx(le,{kind:"project",label:"project",compact:!0,size:"xs",gradient:!1,className:"shrink-0"}),t.jsx(S,{size:"xs",className:"shrink-0 bg-[var(--primary)]/12 text-[var(--primary)]",children:B}),t.jsx(S,{size:"xs",className:"shrink-0 bg-[var(--ui-surface-2)] text-[var(--ui-ink-soft)]",children:R})]}),t.jsxs("div",{className:"flex shrink-0 flex-wrap items-center justify-end gap-1.5",children:[D?t.jsx("button",{type:"button","aria-label":`Open ${e.title} actions`,className:"inline-flex size-8 items-center justify-center rounded-full bg-[var(--ui-surface-2)] text-[var(--ui-ink-soft)] transition hover:bg-[var(--ui-surface-3)] hover:text-[var(--ui-ink-strong)]",onClick:M=>{M.preventDefault(),M.stopPropagation(),D(M,e)},children:t.jsx(Xe,{className:"size-3.5"})}):null,x?t.jsxs("div",{className:"flex items-center gap-1",onClick:M=>M.stopPropagation(),children:[t.jsx("button",{type:"button","aria-label":`Move ${e.title} to the previous lane`,className:"inline-flex size-7 items-center justify-center rounded-full bg-[var(--ui-surface-2)] text-[var(--ui-ink-soft)] transition hover:bg-[var(--ui-surface-3)] hover:text-[var(--ui-ink-strong)] disabled:opacity-35",disabled:!C,onClick:()=>{C&&(w==null||w(e.id,"previous"))},children:t.jsx(Ye,{className:"size-3.5"})}),t.jsx("button",{type:"button","aria-label":`Move ${e.title} to the next lane`,className:"inline-flex size-7 items-center justify-center rounded-full bg-[var(--ui-surface-2)] text-[var(--ui-ink-soft)] transition hover:bg-[var(--ui-surface-3)] hover:text-[var(--ui-ink-strong)] disabled:opacity-35",disabled:!$,onClick:()=>{$&&(w==null||w(e.id,"next"))},children:t.jsx(Ze,{className:"size-3.5"})})]}):null]})]}),t.jsx(at,{kind:"project",label:e.title,className:"max-w-full",lines:3,labelClassName:"[overflow-wrap:anywhere]"}),t.jsx("p",{className:"mt-1.5 line-clamp-3 [overflow-wrap:anywhere] text-[12px] leading-5 text-[var(--ui-ink-soft)]",children:e.description||"PRD-backed initiative spanning multiple work items."}),t.jsxs("div",{className:"mt-2.5 flex min-w-0 flex-wrap gap-1.5",children:[r?t.jsx(le,{kind:"goal",label:r.title,compact:!0,size:"xs",wrap:!0,className:"min-w-0 max-w-full"}):null,t.jsx(we,{user:e.user,compact:!0,size:"xs"}),(e.assignees??[]).slice(0,2).map(M=>t.jsx(we,{user:M,compact:!0,size:"xs"},M.id)),t.jsxs(S,{size:"xs",className:"bg-[var(--primary)]/12 text-[var(--primary)]",children:[e.progress,"% progress"]}),t.jsxs(S,{size:"xs",className:"bg-[var(--ui-surface-2)] text-[var(--ui-ink-soft)]",children:[e.totalTasks," linked tasks"]})]}),t.jsxs("div",{className:"mt-2.5 flex min-w-0 items-center justify-between gap-2 text-[11px] text-[var(--ui-ink-faint)]",children:[t.jsx("span",{className:"min-w-0 truncate",children:e.goalTitle}),t.jsx("span",{children:q})]})]})}function be(e){const{project:r,sortableId:l}=e,{attributes:o,listeners:c,setNodeRef:u,transform:m,transition:f,isDragging:x}=et({id:l,data:{type:"project",projectId:r.id,status:r.workflowStatus}});return t.jsx(ot,{...e,setNodeRef:u,dragAttributes:o,dragListeners:c,isDragging:x,style:{transform:tt.Transform.toString(m),transition:f}})}function We({droppableId:e,status:r,title:l,detail:o,count:c,dragging:u,children:m}){const{setNodeRef:f,isOver:x}=Te({id:e,data:{type:"lane",status:r}});return t.jsx("div",{ref:f,className:W("w-full max-w-full min-w-0 overflow-hidden rounded-[24px] transition",x&&"scale-[1.005]"),"data-lane-id":r,"data-testid":`kanban-lane-${r}`,"data-lane-hover":x?"true":"false",children:t.jsxs(it,{className:W("h-full w-full max-w-full min-w-0 overflow-hidden p-3 transition-[background-color,box-shadow,border-color,transform]",u&&"border border-[var(--ui-border-subtle)]",x?"border border-[color-mix(in_srgb,var(--info)_38%,transparent)] bg-[var(--ui-info-soft)] shadow-[var(--ui-shadow-soft)]":"border border-transparent"),children:[t.jsxs("div",{className:"mb-3 flex items-start justify-between gap-3",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsx("div",{className:"type-label text-[var(--ui-ink-faint)]",children:o}),t.jsx("h3",{className:"mt-1 break-words text-[1.45rem] leading-[1] text-[var(--ui-ink-strong)]",children:l})]}),t.jsx("div",{className:"shrink-0 font-display text-[1.45rem] text-[var(--primary)]",children:c})]}),t.jsx("div",{className:W("grid w-full max-w-full min-w-0 min-h-48 content-start gap-2 rounded-[18px] p-2 transition",x?"bg-[var(--ui-info-soft)]":"bg-[var(--ui-surface-1)]"),children:m})]})})}function Pt({title:e,detail:r,children:l}){return t.jsxs("div",{className:"rounded-[20px] border border-[color-mix(in_srgb,var(--info)_24%,transparent)] bg-[var(--ui-info-soft)] p-2.5 shadow-[inset_0_0_0_1px_var(--ui-border-subtle)]",children:[t.jsx("div",{className:"mb-2 flex items-start justify-between gap-3 px-1",children:t.jsxs("div",{className:"min-w-0",children:[t.jsxs("div",{className:"inline-flex items-center gap-2 text-[11px] uppercase tracking-[0.16em] text-[var(--info)]/86",children:[t.jsx(ve,{className:"size-3.5"}),t.jsx("span",{className:"truncate",children:e})]}),r?t.jsx("div",{className:"mt-1 text-[11px] text-[var(--ui-ink-faint)]",children:r}):null]})}),t.jsx("div",{className:"grid gap-2",children:l})]})}function qt({droppableId:e,title:r,detail:l}){const{setNodeRef:o,isOver:c}=Te({id:e,data:{type:"trash"}});return t.jsx("div",{ref:o,className:W("pointer-events-auto fixed right-4 top-4 z-50 w-[min(18rem,calc(100vw-2rem))] rounded-[28px] border px-5 py-4 shadow-[var(--ui-shadow-floating)] backdrop-blur-2xl transition lg:right-6 lg:top-6",c?"border-[color-mix(in_srgb,var(--danger)_38%,transparent)] bg-[var(--ui-danger-soft)] text-[var(--ui-ink-strong)] scale-[1.02]":"border-[var(--ui-border-subtle)] bg-[var(--ui-surface-popover)] text-[var(--ui-ink-medium)]"),"data-testid":"kanban-trash-dropzone","data-trash-hover":c?"true":"false",children:t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("div",{className:W("flex size-12 items-center justify-center rounded-full border transition",c?"border-[var(--ui-border-strong)] bg-[var(--ui-surface-3)]":"border-[var(--ui-border-subtle)] bg-[var(--ui-surface-1)]"),children:t.jsx(je,{className:"size-5"})}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("div",{className:"font-label text-[11px] uppercase tracking-[0.2em] text-[var(--ui-ink-soft)]",children:"Bin"}),t.jsx("div",{className:"mt-1 text-base font-medium text-[var(--ui-ink-strong)]",children:r}),t.jsx("div",{className:"mt-1 text-sm leading-5 text-[var(--ui-ink-soft)]",children:l})]})]})})}function Ft({tasks:e,projects:r=[],activeRuns:l=[],goals:o,tags:c,selectedTaskId:u,onMove:m,onMoveProject:f,onSelectTask:x,onStartTask:w,onStopTask:D,onQuickReopenTask:k,onDeleteTask:C,onOpenProject:$,onOpenTask:U,onEditProject:_,onEditTask:B,onLinkProject:R,onLinkTask:P,onCreateIssueForProject:q,onCreateTaskForIssue:M,onCreateSubtaskForTask:ae,onSplitTask:j,notesSummaryByEntity:z}){var _e,Be;const{t:h}=ye(),A=N.useId(),oe=`${A}:trash`,[L,ce]=N.useState(()=>typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia("(max-width: 1023px)").matches),te=wt(jt(It,{activationConstraint:{distance:6}})),[V,J]=N.useState(null),[b,F]=N.useState(null),[G,Q]=N.useState(null),[X,g]=N.useState(null),[Ne,ct]=N.useState(()=>typeof window>"u"?!1:window.localStorage.getItem("forge.kanban-skip-delete-confirmation")==="true"),[ke,ne]=N.useState(!1),[Se,Y]=N.useState({}),[Ie,ie]=N.useState({}),se={backlog:{title:h("common.executionBoard.laneBacklogTitle"),detail:h("common.executionBoard.laneBacklogDetail")},focus:{title:h("common.executionBoard.laneFocusTitle"),detail:h("common.executionBoard.laneFocusDetail")},in_progress:{title:h("common.executionBoard.laneProgressTitle"),detail:h("common.executionBoard.laneProgressDetail")},blocked:{title:h("common.executionBoard.laneBlockedTitle"),detail:h("common.executionBoard.laneBlockedDetail")},done:{title:h("common.executionBoard.laneDoneTitle"),detail:h("common.executionBoard.laneDoneDetail")}},Z=N.useMemo(()=>e.map(i=>{const a=Se[i.id];return a?{...i,status:a}:i}),[Se,e]),T=N.useMemo(()=>r.map(i=>{const a=Ie[i.id];return a?{...i,workflowStatus:a}:i}),[Ie,r]),Ce=N.useMemo(()=>{const i=new Map;for(const a of l){if(a.status!=="active")continue;const n=i.get(a.taskId);(!n||a.isCurrent||a.updatedAt>n.updatedAt)&&i.set(a.taskId,a)}return i},[l]),K=N.useMemo(()=>[...T.map(i=>({kind:"project",id:i.id,status:i.workflowStatus,project:i,goal:o.find(a=>a.id===i.goalId)})),...Z.map(i=>({kind:"task",id:i.id,status:i.status,task:i,goal:o.find(a=>a.id===i.goalId),tags:i.tagIds.map(a=>c.find(n=>n.id===a)).filter(Boolean),activeRun:Ce.get(i.id)??null}))],[Ce,T,Z,o,c]),O=V?K.find(i=>i.id===V)??null:null,dt=N.useMemo(()=>{if(!b)return[];if(b.kind==="project"){const a=T.find(n=>n.id===b.entityId);return a?[{id:"open-project",label:"Open",description:"Jump to the project detail view.",icon:Je,onSelect:()=>$==null?void 0:$(a.id)},{id:"edit-project",label:"Edit",description:"Open the guided project editor.",icon:Fe,onSelect:()=>_==null?void 0:_(a.id)},{id:"link-project",label:"Link",description:"Open the anchor step to relink the project to its goal.",icon:Qe,onSelect:()=>R==null?void 0:R(a.id)},{id:"create-issue",label:"Create issue",description:"Break this project into a new vertical slice issue.",icon:he,onSelect:()=>q==null?void 0:q(a.id)},...I.filter(n=>n!==a.workflowStatus).map(n=>({id:`move-project-${n}`,label:`Move to ${n.replaceAll("_"," ")}`,description:"Update the project workflow lane without leaving the board.",onSelect:()=>void(f==null?void 0:f(a.id,n))}))]:[]}const i=Z.find(a=>a.id===b.entityId);return i?Mt({task:i,onOpenTask:U,onEditTask:B,onLinkTask:P,onCreateTaskForIssue:M,onCreateSubtaskForTask:ae,onMove:m,onDeleteTask:C,deletePendingTaskId:X,onRequestDelete:$e}):[]},[T,Z,b,q,ae,M,_,B,R,P,m,f,C,$,U,X,Ne]);function ze(i){var n;if(i.length===0)return t.jsx("div",{className:"w-full max-w-full rounded-[18px] border border-dashed border-[var(--ui-border-subtle)] px-4 py-8 text-center text-sm text-[var(--ui-ink-faint)]",children:h("common.executionBoard.emptyLane")});if(((n=i[0])==null?void 0:n.status)!=="in_progress")return i.map(d=>d.kind==="task"?t.jsx(ge,{sortableId:`${A}:task:${d.task.id}`,task:d.task,goal:d.goal,tags:d.tags,activeRun:d.activeRun,isSelected:u===d.task.id,isMobile:L,onSelect:x,onStartTask:w,onStopTask:D,onQuickReopen:k,onStepTask:de,onOpenMenu:me,onSplitTask:j,notesSummaryByEntity:z},d.task.id):t.jsx(be,{sortableId:`${A}:project:${d.project.id}`,project:d.project,goal:d.goal,isMobile:L,onStepProject:ue,onOpenMenu:fe},d.project.id));const a=new Map;for(const d of i){if(d.kind!=="task"||!d.activeRun){const E=a.get("ungrouped");E?E.items.push(d):a.set("ungrouped",{title:"Active work",detail:"Tasks in progress without a tracked branch",items:[d]});continue}const p=nt(d.task,d.activeRun),s=[d.activeRun.actor,p.git.repository??"",p.git.branch??""].join("::"),v=a.get(s);if(v){v.items.push(d);continue}a.set(s,{title:Ot(d.activeRun,p.git.branch),detail:Ut(d.activeRun,p.git.repository),items:[d]})}return Array.from(a.entries()).map(([d,p])=>d==="ungrouped"?p.items.map(s=>s.kind==="task"?t.jsx(ge,{sortableId:`${A}:task:${s.task.id}`,task:s.task,goal:s.goal,tags:s.tags,activeRun:s.activeRun,isSelected:u===s.task.id,isMobile:L,onSelect:x,onStartTask:w,onStopTask:D,onQuickReopen:k,onStepTask:de,onOpenMenu:me,onSplitTask:j,notesSummaryByEntity:z},s.task.id):t.jsx(be,{sortableId:`${A}:project:${s.project.id}`,project:s.project,goal:s.goal,isMobile:L,onStepProject:ue,onOpenMenu:fe},s.project.id)):t.jsx(Pt,{title:p.title,detail:p.detail,children:p.items.map(s=>s.kind==="task"?t.jsx(ge,{sortableId:`${A}:task:${s.task.id}`,task:s.task,goal:s.goal,tags:s.tags,activeRun:s.activeRun,isSelected:u===s.task.id,isMobile:L,onSelect:x,onStartTask:w,onStopTask:D,onQuickReopen:k,onStepTask:de,onOpenMenu:me,onSplitTask:j,notesSummaryByEntity:z},s.task.id):t.jsx(be,{sortableId:`${A}:project:${s.project.id}`,project:s.project,goal:s.goal,isMobile:L,onStepProject:ue,onOpenMenu:fe},s.project.id))},d))}N.useEffect(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;const i=window.matchMedia("(max-width: 1023px)"),a=n=>{ce(n?n.matches:i.matches)};return a(),typeof i.addEventListener=="function"?(i.addEventListener("change",a),()=>i.removeEventListener("change",a)):(i.addListener(a),()=>i.removeListener(a))},[]),N.useEffect(()=>{if(!V){document.body.style.cursor="";return}return document.body.style.cursor="grabbing",()=>{document.body.style.cursor=""}},[V]),N.useEffect(()=>{Y(i=>{const a=new Set(e.map(p=>p.id));let n=!1;const d={};for(const[p,s]of Object.entries(i)){const v=e.find(E=>E.id===p);if(!a.has(p)||!v||v.status===s){n=!0;continue}d[p]=s}return n?d:i})},[e]),N.useEffect(()=>{ie(i=>{const a=new Set(r.map(p=>p.id));let n=!1;const d={};for(const[p,s]of Object.entries(i)){const v=r.find(E=>E.id===p);if(!a.has(p)||!v||v.workflowStatus===s){n=!0;continue}d[p]=s}return n?d:i})},[r]);function ut(i){var d,p;const a=(d=i.active.data.current)==null?void 0:d.taskId,n=(p=i.active.data.current)==null?void 0:p.projectId;typeof a=="string"?J(a):typeof n=="string"&&J(n)}const mt=i=>{ct(i),typeof window<"u"&&window.localStorage.setItem("forge.kanban-skip-delete-confirmation","true")},De=async(i,a)=>{if(C){g(i.id);try{a&&mt(!0),await C(i.id),Q(null),ne(!1),Y(n=>{const d={...n};return delete d[i.id],d})}finally{g(null)}}};function $e(i){if(C){if(Ne){De(i,!1);return}ne(!1),Q(i)}}async function ft(i){var Me,Ae,Le,Ee,Re,Oe;const{active:a,over:n}=i;if(J(null),!n||a.id===n.id)return;const d=typeof((Me=a.data.current)==null?void 0:Me.taskId)=="string"?a.data.current.taskId:null,p=typeof((Ae=a.data.current)==null?void 0:Ae.projectId)=="string"?a.data.current.projectId:null,s=(d?K.find(y=>y.kind==="task"&&y.id===d):null)??(p?K.find(y=>y.kind==="project"&&y.id===p):null);if(!s)return;if(((Le=n.data.current)==null?void 0:Le.type)==="trash"){if(s.kind!=="task"||!C)return;$e(s.task);return}const v=typeof((Ee=n.data.current)==null?void 0:Ee.status)=="string"?n.data.current.status:null,E=typeof((Re=n.data.current)==null?void 0:Re.taskId)=="string"?n.data.current.taskId:null,H=typeof((Oe=n.data.current)==null?void 0:Oe.projectId)=="string"?n.data.current.projectId:null,pe=(E?K.find(y=>y.kind==="task"&&y.id===E):null)??(H?K.find(y=>y.kind==="project"&&y.id===H):null),ee=v??(pe==null?void 0:pe.status)??s.status;if(!(ee===s.status||!I.includes(ee))){if(s.kind==="task"){Y(y=>({...y,[s.task.id]:ee}));try{await m(s.task.id,ee)}catch(y){throw Y(xe=>{const re={...xe};return delete re[s.task.id],re}),y}return}if(f){ie(y=>({...y,[s.project.id]:ee}));try{await f(s.project.id,ee)}catch(y){throw ie(xe=>{const re={...xe};return delete re[s.project.id],re}),y}}}}async function de(i,a){const n=Z.find(v=>v.id===i);if(!n)return;const d=I.indexOf(n.status),p=a==="previous"?d-1:d+1,s=I[p]??null;if(!(!s||s===n.status)){Y(v=>({...v,[n.id]:s}));try{await m(n.id,s)}catch(v){throw Y(E=>{const H={...E};return delete H[n.id],H}),v}}}async function ue(i,a){const n=T.find(v=>v.id===i);if(!n||!f)return;const d=I.indexOf(n.workflowStatus),p=a==="previous"?d-1:d+1,s=I[p]??null;if(!(!s||s===n.workflowStatus)){ie(v=>({...v,[n.id]:s}));try{await f(n.id,s)}catch(v){throw ie(E=>{const H={...E};return delete H[n.id],H}),v}}}function me(i,a){const n=i.currentTarget.getBoundingClientRect();F({kind:"task",entityId:a.id,position:{x:n.right-8,y:n.bottom+8}})}function fe(i,a){const n=i.currentTarget.getBoundingClientRect();F({kind:"project",entityId:a.id,position:{x:n.right-8,y:n.bottom+8}})}return t.jsxs(yt,{sensors:te,collisionDetection:Rt,onDragStart:ut,onDragCancel:()=>J(null),onDragEnd:i=>void ft(i),children:[(O==null?void 0:O.kind)==="task"&&C?t.jsx(qt,{droppableId:oe,title:h("common.executionBoard.deleteDropTitle"),detail:h("common.executionBoard.deleteDropDetail")}):null,t.jsx("div",{className:"w-full max-w-full min-w-0 pb-2",children:L?t.jsx("div",{className:"grid w-full max-w-full min-w-0 gap-2",children:I.map(i=>{const a=K.filter(n=>n.status===i);return t.jsx(Pe,{items:a.map(n=>`${A}:${n.kind}:${n.id}`),strategy:qe,children:t.jsx(We,{droppableId:`${A}:lane:${i}`,status:i,title:se[i].title,detail:se[i].detail,count:a.length,dragging:V!==null,children:ze(a)})},i)})}):t.jsx("div",{className:"grid w-full min-w-0 gap-0.5 xl:grid-cols-[repeat(5,minmax(0,1fr))]",children:I.map(i=>{const a=K.filter(n=>n.status===i);return t.jsx(Pe,{items:a.map(n=>`${A}:${n.kind}:${n.id}`),strategy:qe,children:t.jsx(We,{droppableId:`${A}:lane:${i}`,status:i,title:se[i].title,detail:se[i].detail,count:a.length,dragging:V!==null,children:ze(a)})},i)})})}),t.jsx(Nt,{adjustScale:!1,dropAnimation:null,children:O?t.jsx("div",{className:"w-[20rem] max-w-[calc(100vw-2rem)]",children:O.kind==="task"?t.jsx(lt,{task:O.task,goal:O.goal,tags:O.tags,activeRun:O.activeRun,isSelected:u===O.task.id,isDragging:!0,isOverlay:!0,isMobile:L,onSelect:()=>{},onStartTask:w,onSplitTask:j,notesSummaryByEntity:z}):t.jsx(ot,{project:O.project,goal:O.goal,isDragging:!0,isOverlay:!0,isMobile:L})}):null}),t.jsx(Dt,{open:b!==null,title:(b==null?void 0:b.kind)==="project"?((_e=T.find(i=>i.id===b.entityId))==null?void 0:_e.title)??"Project actions":((Be=Z.find(i=>i.id===(b==null?void 0:b.entityId)))==null?void 0:Be.title)??"Work item actions",subtitle:(b==null?void 0:b.kind)==="project"?"Edit, relink, move, or break this project into issues.":"Edit, relink, move, or create the next child work item.",items:dt,position:(b==null?void 0:b.position)??null,onClose:()=>F(null)}),G?t.jsx("div",{className:"surface-overlay fixed inset-0 z-[60] flex items-center justify-center p-4 backdrop-blur-xl",children:t.jsxs(it,{className:"surface-modal-panel w-full max-w-md",children:[t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx("div",{className:"mt-1 flex size-11 shrink-0 items-center justify-center rounded-full bg-[var(--ui-danger-soft)] text-[var(--danger)]",children:t.jsx(je,{className:"size-5"})}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("div",{className:"font-display text-[1.35rem] leading-tight text-[var(--ui-ink-strong)]",children:h("common.executionBoard.deleteConfirmTitle")}),t.jsx("div",{className:"mt-2 text-sm leading-6 text-[var(--ui-ink-soft)]",children:h("common.executionBoard.deleteConfirmDescription",{title:G.title})})]})]}),t.jsxs("label",{className:"mt-5 flex items-center gap-3 rounded-[18px] bg-[var(--ui-surface-2)] px-4 py-3 text-sm text-[var(--ui-ink-medium)]",children:[t.jsx("input",{type:"checkbox",checked:ke,onChange:i=>ne(i.target.checked),className:"size-4 rounded border-[var(--ui-border-strong)] bg-transparent text-[var(--primary)]"}),t.jsx("span",{children:h("common.executionBoard.deleteConfirmCheckbox")})]}),t.jsxs("div",{className:"mt-5 flex flex-wrap justify-end gap-3",children:[t.jsx(Ve,{variant:"secondary",onClick:()=>{Q(null),ne(!1)},children:h("common.executionBoard.deleteConfirmCancel")}),t.jsx(Ve,{className:"bg-[var(--ui-danger-soft)] text-[var(--danger)] shadow-[var(--ui-shadow-soft)]",pending:X===G.id,pendingLabel:h("common.executionBoard.deletingTask"),onClick:()=>void De(G,ke),children:h("common.executionBoard.deleteConfirmSubmit")})]})]})}):null]})}export{Ft as E};
@@ -1 +1 @@
1
- import{r as h,j as r,aK as D,b3 as M}from"./vendor-Dnkkx2co.js";import{Z as a}from"./index-QJkjKYzZ.js";function B(f){return f.trim().toLowerCase()}function A({title:f,description:m,query:u,onQueryChange:c,onQuerySubmit:b,options:v,selectedOptionIds:i,onSelectedOptionIdsChange:p,resultSummary:E,clearLabel:g="Clear filters",submitLabel:k="Search",placeholder:C="Search title, alias, domain, source, or filter chip",emptyStateMessage:F="Keep typing to search the library or pick one of the suggested filter chips.",compact:t=!1,minimal:l=!1,hideSummary:_=!1}){const[$,n]=h.useState(!1),[w,d]=h.useState(0),j=h.useMemo(()=>i.map(e=>v.find(s=>s.id===e)).filter(Boolean),[v,i]),x=h.useMemo(()=>{const e=B(u),s=v.filter(o=>!i.includes(o.id));return e?s.filter(o=>`${o.label} ${o.description??""} ${o.searchText??""}`.toLowerCase().includes(e)).slice(0,12):s.slice(0,12)},[v,u,i]),y=e=>{i.includes(e)||(p([...i,e]),c(""),n(!1),d(0))},N=e=>{p(i.filter(s=>s!==e))},z=()=>{c(""),p([]),d(0),n(!1)};return r.jsxs("div",{className:a("rounded-[28px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-section)] shadow-[var(--card-shadow)]",l?"overflow-hidden rounded-full border-[var(--ui-border-subtle)] bg-[color-mix(in_srgb,var(--ui-surface-1)_88%,transparent)] px-3 py-1.5 shadow-[var(--ui-shadow-soft)] backdrop-blur":t?"rounded-[24px] p-2.5":"p-4 sm:p-5"),children:[r.jsxs("div",{className:a("flex flex-wrap items-start justify-between gap-3",l&&"hidden"),children:[r.jsxs("div",{className:"min-w-0",children:[f.trim().length>0?r.jsx("div",{className:"break-words font-label text-[11px] uppercase tracking-[0.2em] text-[var(--ui-ink-faint)] [overflow-wrap:anywhere]",children:f}):null,m.trim().length>0?r.jsx("div",{className:"mt-2 max-w-3xl break-words text-sm leading-6 text-[var(--ui-ink-soft)] [overflow-wrap:anywhere]",children:m}):null]}),i.length>0||u.trim().length>0?r.jsx("button",{type:"button",onClick:z,className:a("rounded-full border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-1)] text-[var(--ui-ink-soft)] transition hover:bg-[var(--ui-surface-hover)] hover:text-[var(--ui-ink-strong)]",t?"px-2.5 py-1.5 text-[11px]":"px-3 py-2 text-sm"),children:g}):null]}),r.jsxs("div",{className:a("rounded-[24px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-1)]",l?"rounded-full border-0 bg-transparent px-0 py-0":t?"mt-1.5 rounded-[18px] px-2.5 py-2":"mt-4 px-4 py-3"),children:[j.length>0?r.jsx("div",{className:a("flex flex-wrap gap-2",l?"mb-0 mr-2 inline-flex max-w-[38%] flex-nowrap items-center gap-1 overflow-hidden":t?"mb-2":"mb-3"),children:j.map(e=>r.jsxs("span",{className:a("inline-flex min-w-0 items-center gap-2 rounded-full border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-2)]",l?"max-w-full shrink-0 px-2 py-0.5":t?"px-2 py-0.5":"px-2.5 py-1.5"),children:[e.badge??r.jsx("span",{className:"min-w-0 break-words text-sm text-[var(--ui-ink-medium)] [overflow-wrap:anywhere]",children:e.label}),r.jsx("button",{type:"button",className:"shrink-0 rounded-full text-[var(--ui-ink-faint)] transition hover:text-[var(--ui-ink-strong)]",onClick:()=>N(e.id),"aria-label":`Remove ${e.label}`,children:r.jsx(D,{className:"size-3.5"})})]},e.id))}):null,r.jsxs("div",{className:"relative",children:[r.jsxs("div",{className:a("flex items-center",l?"gap-2 whitespace-nowrap":t?"gap-2":"gap-3"),children:[r.jsx(M,{className:a("text-[var(--ui-ink-faint)]",t?"size-3.5":"size-4")}),r.jsx("input",{value:u,onChange:e=>{c(e.target.value),n(!0),d(0)},onFocus:()=>n(!0),onBlur:()=>window.setTimeout(()=>n(!1),120),onKeyDown:e=>{if(e.key==="Backspace"&&!u&&i.length>0){N(i[i.length-1]);return}if(e.key==="ArrowDown"){e.preventDefault(),n(!0),d(s=>x.length===0?0:Math.min(x.length-1,s+1));return}if(e.key==="ArrowUp"){e.preventDefault(),d(s=>Math.max(0,s-1));return}if(e.key==="Escape"){n(!1);return}if(e.key==="Enter"&&b){e.preventDefault(),b(u),n(!1);return}e.key==="Enter"&&x[w]&&(e.preventDefault(),y(x[w].id))},placeholder:C,className:a("min-w-0 flex-1 bg-transparent text-[var(--ui-ink-strong)] placeholder:text-[var(--ui-ink-faint)] focus:outline-none",l||t?"text-[12px]":"text-sm")}),l&&(i.length>0||u.trim().length>0)?r.jsx("button",{type:"button",onClick:z,className:"inline-flex size-6 items-center justify-center rounded-full border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-2)] text-[var(--ui-ink-soft)] transition hover:text-[var(--ui-ink-strong)]","aria-label":g,children:r.jsx(D,{className:"size-3.5"})}):null,b?r.jsx("button",{type:"button",onMouseDown:e=>e.preventDefault(),onClick:()=>{b(u),n(!1)},className:a("inline-flex items-center justify-center rounded-full border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-2)] text-[var(--ui-ink-soft)] transition hover:bg-[var(--ui-surface-hover)] hover:text-[var(--ui-ink-strong)]",l?"size-6":t?"size-7":"size-8"),"aria-label":k,title:k,children:r.jsx(M,{className:a(t?"size-3.5":"size-4")})}):null]}),$?r.jsx("div",{className:a("absolute top-full z-20 w-full border border-[var(--ui-border-subtle)] bg-[color-mix(in_srgb,var(--ui-surface-1)_96%,transparent)] shadow-[var(--ui-shadow-floating)] backdrop-blur-xl",t?"mt-1.5 rounded-[18px] p-1.5":"mt-2 rounded-[22px] p-2"),children:x.length>0?x.map((e,s)=>r.jsx("button",{type:"button",className:a("flex w-full items-start justify-between gap-3 text-left transition",t?"rounded-[14px] px-2.5 py-2":"rounded-[18px] px-3 py-2.5",s===w?"bg-[var(--ui-surface-3)] text-[var(--ui-ink-strong)]":"text-[var(--ui-ink-medium)] hover:bg-[var(--ui-surface-hover)] hover:text-[var(--ui-ink-strong)]"),onMouseEnter:()=>d(s),onMouseDown:o=>o.preventDefault(),onClick:()=>y(e.id),children:r.jsxs("div",{className:"min-w-0",children:[r.jsx("div",{className:a("break-words font-medium [overflow-wrap:anywhere]",t?"text-[12px]":"text-sm"),children:e.badge??e.label}),e.description?r.jsx("div",{className:a("mt-1 break-words text-[var(--ui-ink-faint)] [overflow-wrap:anywhere]",t?"text-[11px] leading-[1.125rem]":"text-xs leading-5"),children:e.description}):null]})},e.id)):r.jsx("div",{className:a("break-words text-[var(--ui-ink-faint)] [overflow-wrap:anywhere]",t?"px-2.5 py-2 text-[12px]":"px-3 py-2.5 text-sm"),children:F})}):null]})]}),_?null:r.jsx("div",{className:a("break-words text-[var(--ui-ink-soft)] [overflow-wrap:anywhere]",t?"mt-2 text-xs":"mt-3 text-sm"),children:E})]})}export{A as F};
1
+ import{r as h,j as r,aK as D,b7 as M}from"./vendor-Cpmju3nw.js";import{c as a}from"./index-BejvcRGb.js";function B(f){return f.trim().toLowerCase()}function A({title:f,description:m,query:u,onQueryChange:c,onQuerySubmit:b,options:v,selectedOptionIds:i,onSelectedOptionIdsChange:p,resultSummary:E,clearLabel:g="Clear filters",submitLabel:k="Search",placeholder:C="Search title, alias, domain, source, or filter chip",emptyStateMessage:F="Keep typing to search the library or pick one of the suggested filter chips.",compact:t=!1,minimal:l=!1,hideSummary:_=!1}){const[$,n]=h.useState(!1),[w,d]=h.useState(0),j=h.useMemo(()=>i.map(e=>v.find(s=>s.id===e)).filter(Boolean),[v,i]),x=h.useMemo(()=>{const e=B(u),s=v.filter(o=>!i.includes(o.id));return e?s.filter(o=>`${o.label} ${o.description??""} ${o.searchText??""}`.toLowerCase().includes(e)).slice(0,12):s.slice(0,12)},[v,u,i]),y=e=>{i.includes(e)||(p([...i,e]),c(""),n(!1),d(0))},N=e=>{p(i.filter(s=>s!==e))},z=()=>{c(""),p([]),d(0),n(!1)};return r.jsxs("div",{className:a("rounded-[28px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-section)] shadow-[var(--card-shadow)]",l?"overflow-hidden rounded-full border-[var(--ui-border-subtle)] bg-[color-mix(in_srgb,var(--ui-surface-1)_88%,transparent)] px-3 py-1.5 shadow-[var(--ui-shadow-soft)] backdrop-blur":t?"rounded-[24px] p-2.5":"p-4 sm:p-5"),children:[r.jsxs("div",{className:a("flex flex-wrap items-start justify-between gap-3",l&&"hidden"),children:[r.jsxs("div",{className:"min-w-0",children:[f.trim().length>0?r.jsx("div",{className:"break-words font-label text-[11px] uppercase tracking-[0.2em] text-[var(--ui-ink-faint)] [overflow-wrap:anywhere]",children:f}):null,m.trim().length>0?r.jsx("div",{className:"mt-2 max-w-3xl break-words text-sm leading-6 text-[var(--ui-ink-soft)] [overflow-wrap:anywhere]",children:m}):null]}),i.length>0||u.trim().length>0?r.jsx("button",{type:"button",onClick:z,className:a("rounded-full border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-1)] text-[var(--ui-ink-soft)] transition hover:bg-[var(--ui-surface-hover)] hover:text-[var(--ui-ink-strong)]",t?"px-2.5 py-1.5 text-[11px]":"px-3 py-2 text-sm"),children:g}):null]}),r.jsxs("div",{className:a("rounded-[24px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-1)]",l?"rounded-full border-0 bg-transparent px-0 py-0":t?"mt-1.5 rounded-[18px] px-2.5 py-2":"mt-4 px-4 py-3"),children:[j.length>0?r.jsx("div",{className:a("flex flex-wrap gap-2",l?"mb-0 mr-2 inline-flex max-w-[38%] flex-nowrap items-center gap-1 overflow-hidden":t?"mb-2":"mb-3"),children:j.map(e=>r.jsxs("span",{className:a("inline-flex min-w-0 items-center gap-2 rounded-full border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-2)]",l?"max-w-full shrink-0 px-2 py-0.5":t?"px-2 py-0.5":"px-2.5 py-1.5"),children:[e.badge??r.jsx("span",{className:"min-w-0 break-words text-sm text-[var(--ui-ink-medium)] [overflow-wrap:anywhere]",children:e.label}),r.jsx("button",{type:"button",className:"shrink-0 rounded-full text-[var(--ui-ink-faint)] transition hover:text-[var(--ui-ink-strong)]",onClick:()=>N(e.id),"aria-label":`Remove ${e.label}`,children:r.jsx(D,{className:"size-3.5"})})]},e.id))}):null,r.jsxs("div",{className:"relative",children:[r.jsxs("div",{className:a("flex items-center",l?"gap-2 whitespace-nowrap":t?"gap-2":"gap-3"),children:[r.jsx(M,{className:a("text-[var(--ui-ink-faint)]",t?"size-3.5":"size-4")}),r.jsx("input",{value:u,onChange:e=>{c(e.target.value),n(!0),d(0)},onFocus:()=>n(!0),onBlur:()=>window.setTimeout(()=>n(!1),120),onKeyDown:e=>{if(e.key==="Backspace"&&!u&&i.length>0){N(i[i.length-1]);return}if(e.key==="ArrowDown"){e.preventDefault(),n(!0),d(s=>x.length===0?0:Math.min(x.length-1,s+1));return}if(e.key==="ArrowUp"){e.preventDefault(),d(s=>Math.max(0,s-1));return}if(e.key==="Escape"){n(!1);return}if(e.key==="Enter"&&b){e.preventDefault(),b(u),n(!1);return}e.key==="Enter"&&x[w]&&(e.preventDefault(),y(x[w].id))},placeholder:C,className:a("min-w-0 flex-1 bg-transparent text-[var(--ui-ink-strong)] placeholder:text-[var(--ui-ink-faint)] focus:outline-none",l||t?"text-[12px]":"text-sm")}),l&&(i.length>0||u.trim().length>0)?r.jsx("button",{type:"button",onClick:z,className:"inline-flex size-6 items-center justify-center rounded-full border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-2)] text-[var(--ui-ink-soft)] transition hover:text-[var(--ui-ink-strong)]","aria-label":g,children:r.jsx(D,{className:"size-3.5"})}):null,b?r.jsx("button",{type:"button",onMouseDown:e=>e.preventDefault(),onClick:()=>{b(u),n(!1)},className:a("inline-flex items-center justify-center rounded-full border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-2)] text-[var(--ui-ink-soft)] transition hover:bg-[var(--ui-surface-hover)] hover:text-[var(--ui-ink-strong)]",l?"size-6":t?"size-7":"size-8"),"aria-label":k,title:k,children:r.jsx(M,{className:a(t?"size-3.5":"size-4")})}):null]}),$?r.jsx("div",{className:a("absolute top-full z-20 w-full border border-[var(--ui-border-subtle)] bg-[color-mix(in_srgb,var(--ui-surface-1)_96%,transparent)] shadow-[var(--ui-shadow-floating)] backdrop-blur-xl",t?"mt-1.5 rounded-[18px] p-1.5":"mt-2 rounded-[22px] p-2"),children:x.length>0?x.map((e,s)=>r.jsx("button",{type:"button",className:a("flex w-full items-start justify-between gap-3 text-left transition",t?"rounded-[14px] px-2.5 py-2":"rounded-[18px] px-3 py-2.5",s===w?"bg-[var(--ui-surface-3)] text-[var(--ui-ink-strong)]":"text-[var(--ui-ink-medium)] hover:bg-[var(--ui-surface-hover)] hover:text-[var(--ui-ink-strong)]"),onMouseEnter:()=>d(s),onMouseDown:o=>o.preventDefault(),onClick:()=>y(e.id),children:r.jsxs("div",{className:"min-w-0",children:[r.jsx("div",{className:a("break-words font-medium [overflow-wrap:anywhere]",t?"text-[12px]":"text-sm"),children:e.badge??e.label}),e.description?r.jsx("div",{className:a("mt-1 break-words text-[var(--ui-ink-faint)] [overflow-wrap:anywhere]",t?"text-[11px] leading-[1.125rem]":"text-xs leading-5"),children:e.description}):null]})},e.id)):r.jsx("div",{className:a("break-words text-[var(--ui-ink-faint)] [overflow-wrap:anywhere]",t?"px-2.5 py-2 text-[12px]":"px-3 py-2.5 text-sm"),children:F})}):null]})]}),_?null:r.jsx("div",{className:a("break-words text-[var(--ui-ink-soft)] [overflow-wrap:anywhere]",t?"mt-2 text-xs":"mt-3 text-sm"),children:E})]})}export{A as F};
@@ -1 +1 @@
1
- import{j as r,aC as l,b8 as x}from"./vendor-Dnkkx2co.js";import{Z as s,c as v}from"./index-QJkjKYzZ.js";import{m as g}from"./motion-Lt5B1XuE.js";function f({eyebrow:c,title:o,description:d,items:i,tone:a="core",className:m}){return r.jsxs("section",{className:s("min-w-0 overflow-hidden rounded-[28px] border border-[var(--ui-border-subtle)] shadow-[var(--ui-shadow-soft)]",a==="core"?"bg-[var(--ui-surface-section)]":"bg-[color-mix(in_srgb,var(--success)_6%,var(--ui-surface-section)_94%)]",m),children:[r.jsxs("div",{className:s("grid min-w-0 gap-3 px-4 py-4 lg:grid-cols-[minmax(0,1fr)_minmax(0,26rem)] lg:px-5",a==="core"?"bg-[radial-gradient(circle_at_top_right,color-mix(in_srgb,var(--primary)_12%,transparent),transparent_36%)]":"bg-[radial-gradient(circle_at_top_right,color-mix(in_srgb,var(--success)_12%,transparent),transparent_36%)]"),children:[r.jsxs("div",{className:"min-w-0",children:[r.jsx("div",{className:s("font-label text-[11px] uppercase tracking-[0.2em]",a==="core"?"text-[var(--secondary)]":"text-[color-mix(in_srgb,var(--success)_74%,var(--ui-ink-strong)_26%)]"),children:c}),r.jsx("h2",{className:"mt-2 max-w-3xl font-display text-[clamp(1.35rem,2vw,1.9rem)] leading-none text-[var(--ui-ink-strong)]",children:o}),r.jsx("p",{className:"mt-2 max-w-3xl text-sm leading-6 text-[var(--ui-ink-soft)]",children:d})]}),r.jsx("div",{className:"grid min-w-0 gap-2 sm:grid-cols-3",children:i.slice(0,3).map(e=>e.href?r.jsxs(l,{to:e.href,className:s("min-w-0 rounded-[20px] border border-[var(--ui-border-subtle)] px-3 py-3 backdrop-blur-sm transition hover:border-[var(--ui-border-strong)] hover:bg-[var(--ui-surface-hover)]",a==="core"?"bg-[var(--ui-surface-1)]":"bg-[color-mix(in_srgb,var(--success)_6%,var(--ui-surface-1)_94%)]"),children:[r.jsx("div",{className:"text-[11px] uppercase tracking-[0.16em] text-[var(--ui-ink-faint)]",children:e.label}),r.jsx("div",{className:"mt-1.5 min-w-0 font-medium text-[var(--ui-ink-strong)]",children:e.title})]},e.id):r.jsxs("div",{className:s("min-w-0 rounded-[20px] border border-[var(--ui-border-subtle)] px-3 py-3 backdrop-blur-sm",a==="core"?"bg-[var(--ui-surface-1)]":"bg-[color-mix(in_srgb,var(--success)_6%,var(--ui-surface-1)_94%)]"),children:[r.jsx("div",{className:"text-[11px] uppercase tracking-[0.16em] text-[var(--ui-ink-faint)]",children:e.label}),r.jsx("div",{className:"mt-1.5 min-w-0 font-medium text-[var(--ui-ink-strong)]",children:e.title})]},e.id))})]}),r.jsx("div",{className:"grid min-w-0 gap-3 px-4 py-4 lg:grid-cols-2 lg:px-5",children:i.map((e,u)=>{const n=s("group flex min-h-[13.5rem] min-w-0 flex-col overflow-hidden rounded-[24px] border border-[var(--ui-border-subtle)] p-0 transition hover:-translate-y-0.5 hover:border-[var(--ui-border-strong)] hover:shadow-[var(--ui-shadow-floating)] sm:min-h-[15.5rem]",a==="core"?"bg-[var(--ui-surface-1)] hover:bg-[var(--ui-surface-hover)]":"bg-[color-mix(in_srgb,var(--success)_6%,var(--ui-surface-1)_94%)] hover:bg-[color-mix(in_srgb,var(--success)_10%,var(--ui-surface-hover)_90%)]"),t=r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:s("flex min-w-0 flex-1 flex-col p-4",a==="core"?"bg-[radial-gradient(circle_at_top_left,color-mix(in_srgb,var(--primary)_10%,transparent),transparent_28%)]":"bg-[radial-gradient(circle_at_top_left,color-mix(in_srgb,var(--success)_10%,transparent),transparent_28%)]"),children:[r.jsxs("div",{className:"flex min-w-0 items-start justify-between gap-3",children:[r.jsxs("div",{className:"min-w-0 flex-1",children:[r.jsx("div",{className:"font-label text-[11px] uppercase tracking-[0.18em] text-[var(--ui-ink-faint)]",children:e.label}),r.jsx("div",{className:"mt-2.5 min-w-0 font-display text-[1.25rem] leading-tight text-[var(--ui-ink-strong)] sm:text-[1.4rem]",children:e.title})]}),e.badge?r.jsx(v,{wrap:!0,className:"max-w-[10rem] shrink-0 self-start bg-[var(--ui-surface-2)] text-[var(--ui-ink-medium)]",children:e.badge}):null]}),r.jsx("div",{className:"mt-2.5 text-sm leading-6 text-[var(--ui-ink-soft)]",children:e.detail}),r.jsx("div",{className:"flex-1"})]}),e.href?r.jsx("div",{className:"border-t border-[var(--ui-border-subtle)] bg-[var(--ui-surface-2)] px-4 py-3",children:r.jsxs("div",{className:"inline-flex min-h-10 min-w-0 max-w-full items-center gap-2 rounded-full border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-1)] px-4 text-sm text-[var(--ui-ink-medium)] transition group-hover:border-[var(--ui-border-strong)] group-hover:bg-[var(--ui-surface-hover)] group-hover:text-[var(--ui-ink-strong)]",children:[e.actionLabel??"Open",r.jsx(x,{className:"size-3.5"})]})}):null]});return r.jsx(g.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.22,delay:.04*u,ease:"easeOut"},children:e.href?r.jsx(l,{to:e.href,className:n,children:t}):r.jsx("div",{className:n,children:t})},e.id)})})]})}export{f as F};
1
+ import{j as r,aC as l,bW as x}from"./vendor-Cpmju3nw.js";import{c as s,k as v}from"./index-BejvcRGb.js";import{m as g}from"./motion-DwjmC9aq.js";function f({eyebrow:c,title:o,description:d,items:i,tone:a="core",className:m}){return r.jsxs("section",{className:s("min-w-0 overflow-hidden rounded-[28px] border border-[var(--ui-border-subtle)] shadow-[var(--ui-shadow-soft)]",a==="core"?"bg-[var(--ui-surface-section)]":"bg-[color-mix(in_srgb,var(--success)_6%,var(--ui-surface-section)_94%)]",m),children:[r.jsxs("div",{className:s("grid min-w-0 gap-3 px-4 py-4 lg:grid-cols-[minmax(0,1fr)_minmax(0,26rem)] lg:px-5",a==="core"?"bg-[radial-gradient(circle_at_top_right,color-mix(in_srgb,var(--primary)_12%,transparent),transparent_36%)]":"bg-[radial-gradient(circle_at_top_right,color-mix(in_srgb,var(--success)_12%,transparent),transparent_36%)]"),children:[r.jsxs("div",{className:"min-w-0",children:[r.jsx("div",{className:s("font-label text-[11px] uppercase tracking-[0.2em]",a==="core"?"text-[var(--secondary)]":"text-[color-mix(in_srgb,var(--success)_74%,var(--ui-ink-strong)_26%)]"),children:c}),r.jsx("h2",{className:"mt-2 max-w-3xl font-display text-[clamp(1.35rem,2vw,1.9rem)] leading-none text-[var(--ui-ink-strong)]",children:o}),r.jsx("p",{className:"mt-2 max-w-3xl text-sm leading-6 text-[var(--ui-ink-soft)]",children:d})]}),r.jsx("div",{className:"grid min-w-0 gap-2 sm:grid-cols-3",children:i.slice(0,3).map(e=>e.href?r.jsxs(l,{to:e.href,className:s("min-w-0 rounded-[20px] border border-[var(--ui-border-subtle)] px-3 py-3 backdrop-blur-sm transition hover:border-[var(--ui-border-strong)] hover:bg-[var(--ui-surface-hover)]",a==="core"?"bg-[var(--ui-surface-1)]":"bg-[color-mix(in_srgb,var(--success)_6%,var(--ui-surface-1)_94%)]"),children:[r.jsx("div",{className:"text-[11px] uppercase tracking-[0.16em] text-[var(--ui-ink-faint)]",children:e.label}),r.jsx("div",{className:"mt-1.5 min-w-0 font-medium text-[var(--ui-ink-strong)]",children:e.title})]},e.id):r.jsxs("div",{className:s("min-w-0 rounded-[20px] border border-[var(--ui-border-subtle)] px-3 py-3 backdrop-blur-sm",a==="core"?"bg-[var(--ui-surface-1)]":"bg-[color-mix(in_srgb,var(--success)_6%,var(--ui-surface-1)_94%)]"),children:[r.jsx("div",{className:"text-[11px] uppercase tracking-[0.16em] text-[var(--ui-ink-faint)]",children:e.label}),r.jsx("div",{className:"mt-1.5 min-w-0 font-medium text-[var(--ui-ink-strong)]",children:e.title})]},e.id))})]}),r.jsx("div",{className:"grid min-w-0 gap-3 px-4 py-4 lg:grid-cols-2 lg:px-5",children:i.map((e,u)=>{const n=s("group flex min-h-[13.5rem] min-w-0 flex-col overflow-hidden rounded-[24px] border border-[var(--ui-border-subtle)] p-0 transition hover:-translate-y-0.5 hover:border-[var(--ui-border-strong)] hover:shadow-[var(--ui-shadow-floating)] sm:min-h-[15.5rem]",a==="core"?"bg-[var(--ui-surface-1)] hover:bg-[var(--ui-surface-hover)]":"bg-[color-mix(in_srgb,var(--success)_6%,var(--ui-surface-1)_94%)] hover:bg-[color-mix(in_srgb,var(--success)_10%,var(--ui-surface-hover)_90%)]"),t=r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:s("flex min-w-0 flex-1 flex-col p-4",a==="core"?"bg-[radial-gradient(circle_at_top_left,color-mix(in_srgb,var(--primary)_10%,transparent),transparent_28%)]":"bg-[radial-gradient(circle_at_top_left,color-mix(in_srgb,var(--success)_10%,transparent),transparent_28%)]"),children:[r.jsxs("div",{className:"flex min-w-0 items-start justify-between gap-3",children:[r.jsxs("div",{className:"min-w-0 flex-1",children:[r.jsx("div",{className:"font-label text-[11px] uppercase tracking-[0.18em] text-[var(--ui-ink-faint)]",children:e.label}),r.jsx("div",{className:"mt-2.5 min-w-0 font-display text-[1.25rem] leading-tight text-[var(--ui-ink-strong)] sm:text-[1.4rem]",children:e.title})]}),e.badge?r.jsx(v,{wrap:!0,className:"max-w-[10rem] shrink-0 self-start bg-[var(--ui-surface-2)] text-[var(--ui-ink-medium)]",children:e.badge}):null]}),r.jsx("div",{className:"mt-2.5 text-sm leading-6 text-[var(--ui-ink-soft)]",children:e.detail}),r.jsx("div",{className:"flex-1"})]}),e.href?r.jsx("div",{className:"border-t border-[var(--ui-border-subtle)] bg-[var(--ui-surface-2)] px-4 py-3",children:r.jsxs("div",{className:"inline-flex min-h-10 min-w-0 max-w-full items-center gap-2 rounded-full border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-1)] px-4 text-sm text-[var(--ui-ink-medium)] transition group-hover:border-[var(--ui-border-strong)] group-hover:bg-[var(--ui-surface-hover)] group-hover:text-[var(--ui-ink-strong)]",children:[e.actionLabel??"Open",r.jsx(x,{className:"size-3.5"})]})}):null]});return r.jsx(g.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.22,delay:.04*u,ease:"easeOut"},children:e.href?r.jsx(l,{to:e.href,className:n,children:t}):r.jsx("div",{className:n,children:t})},e.id)})})]})}export{f as F};
@@ -1 +1 @@
1
- import{r as v,F as m,j as r,aK as f}from"./vendor-Dnkkx2co.js";import{Z as l}from"./index-QJkjKYzZ.js";function b({open:i,title:c,subtitle:s,items:u,position:t,onClose:n}){return v.useEffect(()=>{if(!i)return;let e=!1;const a=window.setTimeout(()=>{e=!0},0),o=x=>{x.key==="Escape"&&n()},d=()=>{e&&n()};return window.addEventListener("keydown",o),window.addEventListener("pointerdown",d),()=>{window.clearTimeout(a),window.removeEventListener("keydown",o),window.removeEventListener("pointerdown",d)}},[n,i]),!i||!t||typeof document>"u"?null:m.createPortal(r.jsx("div",{className:"fixed inset-0 z-[70]","aria-hidden":"true",children:r.jsxs("div",{className:"fixed z-[71] flex max-h-[min(34rem,calc(100dvh-1.5rem))] w-[min(22rem,calc(100vw-1.5rem))] flex-col overflow-hidden rounded-[26px] border border-[var(--ui-border-subtle)] bg-[image:var(--ui-surface-modal)] p-2 shadow-[var(--ui-shadow-floating)] backdrop-blur-xl",style:{left:Math.min(t.x,window.innerWidth-24-352),top:Math.min(t.y,window.innerHeight-24-544)},onPointerDown:e=>e.stopPropagation(),children:[r.jsxs("div",{className:"flex items-start justify-between gap-3 rounded-[20px] bg-[var(--ui-surface-1)] px-4 py-3",children:[r.jsxs("div",{className:"min-w-0",children:[r.jsx("div",{className:"text-sm font-medium text-[var(--ui-ink-strong)]",children:c}),s?r.jsx("div",{className:"mt-1 text-xs leading-5 text-[var(--ui-ink-soft)]",children:s}):null]}),r.jsx("button",{type:"button",className:"rounded-full bg-[var(--ui-surface-2)] p-2 text-[var(--ui-ink-medium)] transition hover:bg-[var(--ui-surface-hover)] hover:text-[var(--ui-ink-strong)]",onClick:n,children:r.jsx(f,{className:"size-4"})})]}),r.jsx("div",{className:"mt-2 min-h-0 overflow-y-auto overscroll-contain pr-1",children:r.jsx("div",{className:"grid gap-1",children:u.map(e=>{const a=e.icon;return r.jsxs("button",{type:"button",disabled:e.disabled,onClick:()=>{e.disabled||(e.onSelect(),n())},className:l("flex w-full items-start gap-3 rounded-[20px] px-4 py-3 text-left transition",e.disabled?"cursor-not-allowed bg-[var(--ui-surface-1)] text-[var(--ui-ink-faint)] opacity-55":e.tone==="danger"?"bg-[var(--ui-danger-soft)] text-[color-mix(in_srgb,var(--danger)_76%,var(--ui-ink-strong)_24%)] hover:bg-[color-mix(in_srgb,var(--danger)_22%,var(--ui-surface-hover)_78%)]":"bg-[var(--ui-surface-1)] text-[var(--ui-ink-medium)] hover:bg-[var(--ui-surface-hover)] hover:text-[var(--ui-ink-strong)]"),children:[a?r.jsx("span",{className:l("mt-0.5 rounded-[14px] p-2",e.disabled?"bg-[var(--ui-surface-2)] text-[var(--ui-ink-faint)]":e.tone==="danger"?"bg-[color-mix(in_srgb,var(--danger)_18%,var(--ui-surface-1)_82%)] text-[color-mix(in_srgb,var(--danger)_76%,var(--ui-ink-strong)_24%)]":"bg-[var(--primary)]/12 text-[var(--primary)]"),children:r.jsx(a,{className:"size-4"})}):null,r.jsxs("span",{className:"min-w-0",children:[r.jsx("span",{className:"block text-sm font-medium",children:e.label}),e.description?r.jsx("span",{className:"mt-1 block text-xs leading-5 text-[var(--ui-ink-soft)]",children:e.description}):null]})]},e.id)})})})]})}),document.body)}export{b as F};
1
+ import{r as v,F as m,j as r,aK as f}from"./vendor-Cpmju3nw.js";import{c as l}from"./index-BejvcRGb.js";function b({open:i,title:c,subtitle:s,items:u,position:t,onClose:n}){return v.useEffect(()=>{if(!i)return;let e=!1;const a=window.setTimeout(()=>{e=!0},0),o=x=>{x.key==="Escape"&&n()},d=()=>{e&&n()};return window.addEventListener("keydown",o),window.addEventListener("pointerdown",d),()=>{window.clearTimeout(a),window.removeEventListener("keydown",o),window.removeEventListener("pointerdown",d)}},[n,i]),!i||!t||typeof document>"u"?null:m.createPortal(r.jsx("div",{className:"fixed inset-0 z-[70]","aria-hidden":"true",children:r.jsxs("div",{className:"fixed z-[71] flex max-h-[min(34rem,calc(100dvh-1.5rem))] w-[min(22rem,calc(100vw-1.5rem))] flex-col overflow-hidden rounded-[26px] border border-[var(--ui-border-subtle)] bg-[image:var(--ui-surface-modal)] p-2 shadow-[var(--ui-shadow-floating)] backdrop-blur-xl",style:{left:Math.min(t.x,window.innerWidth-24-352),top:Math.min(t.y,window.innerHeight-24-544)},onPointerDown:e=>e.stopPropagation(),children:[r.jsxs("div",{className:"flex items-start justify-between gap-3 rounded-[20px] bg-[var(--ui-surface-1)] px-4 py-3",children:[r.jsxs("div",{className:"min-w-0",children:[r.jsx("div",{className:"text-sm font-medium text-[var(--ui-ink-strong)]",children:c}),s?r.jsx("div",{className:"mt-1 text-xs leading-5 text-[var(--ui-ink-soft)]",children:s}):null]}),r.jsx("button",{type:"button",className:"rounded-full bg-[var(--ui-surface-2)] p-2 text-[var(--ui-ink-medium)] transition hover:bg-[var(--ui-surface-hover)] hover:text-[var(--ui-ink-strong)]",onClick:n,children:r.jsx(f,{className:"size-4"})})]}),r.jsx("div",{className:"mt-2 min-h-0 overflow-y-auto overscroll-contain pr-1",children:r.jsx("div",{className:"grid gap-1",children:u.map(e=>{const a=e.icon;return r.jsxs("button",{type:"button",disabled:e.disabled,onClick:()=>{e.disabled||(e.onSelect(),n())},className:l("flex w-full items-start gap-3 rounded-[20px] px-4 py-3 text-left transition",e.disabled?"cursor-not-allowed bg-[var(--ui-surface-1)] text-[var(--ui-ink-faint)] opacity-55":e.tone==="danger"?"bg-[var(--ui-danger-soft)] text-[color-mix(in_srgb,var(--danger)_76%,var(--ui-ink-strong)_24%)] hover:bg-[color-mix(in_srgb,var(--danger)_22%,var(--ui-surface-hover)_78%)]":"bg-[var(--ui-surface-1)] text-[var(--ui-ink-medium)] hover:bg-[var(--ui-surface-hover)] hover:text-[var(--ui-ink-strong)]"),children:[a?r.jsx("span",{className:l("mt-0.5 rounded-[14px] p-2",e.disabled?"bg-[var(--ui-surface-2)] text-[var(--ui-ink-faint)]":e.tone==="danger"?"bg-[color-mix(in_srgb,var(--danger)_18%,var(--ui-surface-1)_82%)] text-[color-mix(in_srgb,var(--danger)_76%,var(--ui-ink-strong)_24%)]":"bg-[var(--primary)]/12 text-[var(--primary)]"),children:r.jsx(a,{className:"size-4"})}):null,r.jsxs("span",{className:"min-w-0",children:[r.jsx("span",{className:"block text-sm font-medium",children:e.label}),e.description?r.jsx("span",{className:"mt-1 block text-xs leading-5 text-[var(--ui-ink-soft)]",children:e.description}):null]})]},e.id)})})})]})}),document.body)}export{b as F};