forge-openclaw-plugin 0.3.6 → 0.3.8

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 (126) hide show
  1. package/dist/assets/{action-bar-CsDQF9d4.js → action-bar-BFjWjRIM.js} +1 -1
  2. package/dist/assets/{activity-page-CACf1Sd5.js → activity-page-D-6yBWuZ.js} +1 -1
  3. package/dist/assets/{ai-surface-workspace-Vn5fqCAT.js → ai-surface-workspace-BEfo9bRO.js} +1 -1
  4. package/dist/assets/{atlas-panel-GdK1oyxo.js → atlas-panel-BfMyJXxQ.js} +1 -1
  5. package/dist/assets/{calendar-page-CcVGbvfY.js → calendar-page-D4tQNJ2V.js} +1 -1
  6. package/dist/assets/{calendar-rules-Dlq0KT93.js → calendar-rules-C-6O_uGU.js} +1 -1
  7. package/dist/assets/{calendar-week-toolbar-BVFb1_2G.js → calendar-week-toolbar-_NzeKsYx.js} +1 -1
  8. package/dist/assets/{companion-sync-lab-page-Dgvtdc4i.js → companion-sync-lab-page-D1Oqsf6M.js} +1 -1
  9. package/dist/assets/{daily-metrics-dashboard-ChQVbNJI.js → daily-metrics-dashboard-DtE3pVOl.js} +1 -1
  10. package/dist/assets/{define-workbench-box-DWAqqjvH.js → define-workbench-box-D-32C8nM.js} +1 -1
  11. package/dist/assets/{entity-link-multiselect-Do5DTju7.js → entity-link-multiselect-DcCvkesQ.js} +1 -1
  12. package/dist/assets/{entity-note-count-link-CV3eOv66.js → entity-note-count-link-Cjsk5oT2.js} +1 -1
  13. package/dist/assets/{entity-notes-surface-CiUgAVl7.js → entity-notes-surface-DQQPLjxd.js} +1 -1
  14. package/dist/assets/{execution-board-ClaXVQ0H.js → execution-board-agWQbN-y.js} +1 -1
  15. package/dist/assets/{faceted-token-search-DoSsb7qT.js → faceted-token-search-DldM3-ru.js} +1 -1
  16. package/dist/assets/{flagship-signal-deck-B2s7TrIN.js → flagship-signal-deck-BlLYW9Kz.js} +1 -1
  17. package/dist/assets/{floating-action-menu-DGkHCmvI.js → floating-action-menu-D9-psbha.js} +1 -1
  18. package/dist/assets/{generic-node-view-CgLkbts-.js → generic-node-view-CcepUVhP.js} +1 -1
  19. package/dist/assets/{goal-detail-page-JRcEYpeA.js → goal-detail-page-DP1n5-Hk.js} +1 -1
  20. package/dist/assets/{goal-dialog-6R2uYWPQ.js → goal-dialog-Oxx8WqbZ.js} +1 -1
  21. package/dist/assets/{goals-page-CYestXkp.js → goals-page-CUt1a4Y2.js} +1 -1
  22. package/dist/assets/{habits-page-B27lnyKu.js → habits-page-5REbWAlo.js} +1 -1
  23. package/dist/assets/{health-boxes-CeqSGyZ3.js → health-boxes-sHNML3tm.js} +1 -1
  24. package/dist/assets/{index-DGYIFHgo.js → index-CQ5r7ZUz.js} +2 -2
  25. package/dist/assets/index-FxgNSuZX.css +1 -0
  26. package/dist/assets/{inline-note-fields-CJ9ukqFp.js → inline-note-fields-Bql_KfR9.js} +1 -1
  27. package/dist/assets/{insight-flow-dialog-BgaJRYGX.js → insight-flow-dialog-CN-CMSB7.js} +1 -1
  28. package/dist/assets/{insights-page-Dc5bilGE.js → insights-page-B1u6ONtQ.js} +1 -1
  29. package/dist/assets/{kanban-boxes-qIwmQlRq.js → kanban-boxes-DB1kuUlY.js} +1 -1
  30. package/dist/assets/{kanban-page-BGnVLHeN.js → kanban-page-BBW9_vMu.js} +1 -1
  31. package/dist/assets/{knowledge-graph-page-B7IsVVO_.js → knowledge-graph-page-CoJaydZb.js} +1 -1
  32. package/dist/assets/{life-force-page-B5N4DknK.js → life-force-page-DBYbA1GF.js} +1 -1
  33. package/dist/assets/{life-force-workspace-Da-dmoRX.js → life-force-workspace-BiD9xOEt.js} +1 -1
  34. package/dist/assets/{metric-tile-BVuj7mc3.js → metric-tile-CuP9DOYm.js} +1 -1
  35. package/dist/assets/{movement-boxes-BZrdIh8b.js → movement-boxes-DZg_qPPg.js} +1 -1
  36. package/dist/assets/{movement-page-CY2XLgp_.js → movement-page-CmwsQGR_.js} +1 -1
  37. package/dist/assets/{note-markdown-BZHBOkEd.js → note-markdown-B82ncnFt.js} +1 -1
  38. package/dist/assets/{note-tags-input-DucocvNH.js → note-tags-input-C_x5WdK5.js} +1 -1
  39. package/dist/assets/{notes-boxes-DAQ6KBkJ.js → notes-boxes-BEFlp9yd.js} +1 -1
  40. package/dist/assets/{notes-page-CSCfdDJl.js → notes-page-B6Vl-GPf.js} +1 -1
  41. package/dist/assets/{open-in-graph-button-ObO3m8yd.js → open-in-graph-button-C-bJekoH.js} +1 -1
  42. package/dist/assets/{orbit-map-Bteg-ola.js → orbit-map-DHeTM15g.js} +1 -1
  43. package/dist/assets/{overview-page-ckfN_sLZ.js → overview-page-BRWje1F9.js} +1 -1
  44. package/dist/assets/{page-hero-BkrRTu-t.js → page-hero-8bITsx_x.js} +1 -1
  45. package/dist/assets/{pill-cluster-COzv8VgR.js → pill-cluster-XQjm-wPc.js} +1 -1
  46. package/dist/assets/{preference-entity-handoff-button-BpVAeFmY.js → preference-entity-handoff-button-DwYF_5i3.js} +1 -1
  47. package/dist/assets/{preferences-page-DseOh9AP.js → preferences-page-C7DBPpNb.js} +1 -1
  48. package/dist/assets/{project-collections-C7yU5PSi.js → project-collections-mtxanSMf.js} +1 -1
  49. package/dist/assets/{project-detail-page-Crt46y_7.js → project-detail-page-BT87Goqc.js} +1 -1
  50. package/dist/assets/{project-dialog-YYxtlqg8.js → project-dialog-DnZe757y.js} +1 -1
  51. package/dist/assets/{project-management-hierarchy-page-DnojKHzy.js → project-management-hierarchy-page-B3R2lNFI.js} +1 -1
  52. package/dist/assets/{project-management-section-nav-Ctjd348W.js → project-management-section-nav-DyBWxHbe.js} +1 -1
  53. package/dist/assets/{projects-boxes-D8lLFGBC.js → projects-boxes-CxZj3P29.js} +1 -1
  54. package/dist/assets/{projects-page-CV_2em8d.js → projects-page-Bec11c0x.js} +1 -1
  55. package/dist/assets/{psyche-behaviors-page-CYCNk0rz.js → psyche-behaviors-page-DWRpYvl1.js} +1 -1
  56. package/dist/assets/{psyche-flashcards-page-DwmjBixN.js → psyche-flashcards-page-CX4rcsXZ.js} +1 -1
  57. package/dist/assets/{psyche-goal-map-page-CdMhyBKh.js → psyche-goal-map-page-Y6b3lCvV.js} +1 -1
  58. package/dist/assets/{psyche-graph-BcrZcJrq.js → psyche-graph-CQuCWKIp.js} +1 -1
  59. package/dist/assets/{psyche-metrics-page-D5bX1mNX.js → psyche-metrics-page-DadDJOnm.js} +1 -1
  60. package/dist/assets/{psyche-mode-guide-page-BmX9EOOB.js → psyche-mode-guide-page-B1nz0uCg.js} +1 -1
  61. package/dist/assets/{psyche-modes-page-CTHFDyLE.js → psyche-modes-page-i3uSuhKA.js} +1 -1
  62. package/dist/assets/{psyche-page-DRR3Fjv-.js → psyche-page-Y_s-BE2m.js} +1 -1
  63. package/dist/assets/{psyche-patterns-page-BAS38xYf.js → psyche-patterns-page-DaaOLIlN.js} +1 -1
  64. package/dist/assets/{psyche-questionnaire-builder-page-DpSi-zg3.js → psyche-questionnaire-builder-page-CuF7rXOv.js} +1 -1
  65. package/dist/assets/{psyche-questionnaire-detail-page-BcXIiV4E.js → psyche-questionnaire-detail-page-BfFEMkRY.js} +1 -1
  66. package/dist/assets/{psyche-questionnaire-run-detail-page-DvccwzWO.js → psyche-questionnaire-run-detail-page-BoQTvd7Q.js} +1 -1
  67. package/dist/assets/{psyche-questionnaire-run-page-vcyon8IZ.js → psyche-questionnaire-run-page-C0qKiNZN.js} +1 -1
  68. package/dist/assets/{psyche-questionnaires-page-B0DDTner.js → psyche-questionnaires-page-B6hfD448.js} +1 -1
  69. package/dist/assets/{psyche-report-detail-page-BgBA3xIO.js → psyche-report-detail-page-BlFL8moM.js} +1 -1
  70. package/dist/assets/{psyche-reports-page-Ce1vEEqW.js → psyche-reports-page-DAAcYENp.js} +1 -1
  71. package/dist/assets/{psyche-schemas-beliefs-page-D-IHHohY.js → psyche-schemas-beliefs-page-CsxKSrKM.js} +1 -1
  72. package/dist/assets/{psyche-screen-time-page-DOKW3m8B.js → psyche-screen-time-page-n4b0e58x.js} +1 -1
  73. package/dist/assets/{psyche-self-observation-page-j7Sk6Ns1.js → psyche-self-observation-page-BaxEQ2-3.js} +1 -1
  74. package/dist/assets/{psyche-values-page-NfzdWUyb.js → psyche-values-page-DTv5NMSU.js} +1 -1
  75. package/dist/assets/{question-flow-dialog-CLHVmFON.js → question-flow-dialog-CskCt5NZ.js} +1 -1
  76. package/dist/assets/{report-chain-fields-C9MuyBha.js → report-chain-fields-D132-EMh.js} +1 -1
  77. package/dist/assets/{rewards-page-CVxOBP6m.js → rewards-page-C533lVP-.js} +1 -1
  78. package/dist/assets/{scheduling-rules-editor-BmbOHH_R.js → scheduling-rules-editor-CDpontGp.js} +1 -1
  79. package/dist/assets/{schema-badge-BAiS_OAp.js → schema-badge-B3DiMnjB.js} +1 -1
  80. package/dist/assets/{schemas-B0AXfuOr.js → schemas-CH1_ngUX.js} +1 -1
  81. package/dist/assets/{select-menu-Bl5MILOj.js → select-menu-BOF-k4Ln.js} +1 -1
  82. package/dist/assets/{settings-agents-page-BIRP02mt.js → settings-agents-page-B5OQtlZX.js} +1 -1
  83. package/dist/assets/{settings-bin-page-DxJKeM28.js → settings-bin-page-D_bk3Kcu.js} +1 -1
  84. package/dist/assets/{settings-calendar-page-aMBtwvO_.js → settings-calendar-page-PuSj9_kM.js} +1 -1
  85. package/dist/assets/{settings-data-page-nHNergsh.js → settings-data-page-EwFMaeq6.js} +1 -1
  86. package/dist/assets/{settings-logs-page-CFotPoFy.js → settings-logs-page-BKkse0DX.js} +1 -1
  87. package/dist/assets/{settings-mobile-page-Bf_1D-bN.js → settings-mobile-page-BrIVmdeB.js} +1 -1
  88. package/dist/assets/{settings-models-page-BbFNmnik.js → settings-models-page-Mg84D_0K.js} +1 -1
  89. package/dist/assets/{settings-page-CalbNbcg.js → settings-page-D-kul92f.js} +1 -1
  90. package/dist/assets/{settings-rewards-page-ByDfCzP5.js → settings-rewards-page-waNyCcX_.js} +1 -1
  91. package/dist/assets/{settings-section-nav-x_JXfzL9.js → settings-section-nav-BmJWnrYk.js} +1 -1
  92. package/dist/assets/{settings-users-page-N1jl9hWV.js → settings-users-page-DBgC6y56.js} +1 -1
  93. package/dist/assets/{settings-wiki-page-Bn2Qr94L.js → settings-wiki-page-CM0te9dI.js} +1 -1
  94. package/dist/assets/sleep-page-C_krRE59.js +1 -0
  95. package/dist/assets/{sports-page-DbK4yGrR.js → sports-page-eg5Rfc_E.js} +1 -1
  96. package/dist/assets/{strategies-page-AUBlFCZ9.js → strategies-page-D4AqvFNW.js} +1 -1
  97. package/dist/assets/{strategy-detail-page-DCF8mVaL.js → strategy-detail-page-BlYVkXaW.js} +1 -1
  98. package/dist/assets/{strategy-dialog-50xKlqcz.js → strategy-dialog-FO9Oa0dB.js} +1 -1
  99. package/dist/assets/{surface-BjT1dIAF.js → surface-MVeeZGKB.js} +1 -1
  100. package/dist/assets/{task-detail-page-Dsll2LCX.js → task-detail-page-Dy-aRyY6.js} +1 -1
  101. package/dist/assets/{task-dialog-BfPkbIPE.js → task-dialog-DrA9pba7.js} +1 -1
  102. package/dist/assets/{timebox-planning-dialog-BTKUS6Jj.js → timebox-planning-dialog-C_gnfxFx.js} +1 -1
  103. package/dist/assets/{today-boxes-BPi9bDHM.js → today-boxes-BFOws_iC.js} +1 -1
  104. package/dist/assets/{today-page-BSXSA-Ts.js → today-page-BoPj6a6q.js} +1 -1
  105. package/dist/assets/{training-load-page-BD0s8-Zm.js → training-load-page-DGU40Zfl.js} +1 -1
  106. package/dist/assets/{user-badge-ap1PvOxd.js → user-badge-CZWtYeMw.js} +1 -1
  107. package/dist/assets/{utility-widgets-Cq508sqJ.js → utility-widgets-B3wWGxQc.js} +1 -1
  108. package/dist/assets/{vitals-page-BnXk8OzN.js → vitals-page-BXRZEP_8.js} +1 -1
  109. package/dist/assets/{weekly-review-page-CnmSGnEC.js → weekly-review-page-D5cebA5x.js} +1 -1
  110. package/dist/assets/{weight-loss-page-Bn6lAXNf.js → weight-loss-page-BuUdFh9z.js} +1 -1
  111. package/dist/assets/{wiki-article-markdown-BDnkdNDC.js → wiki-article-markdown-CvaCjg_t.js} +1 -1
  112. package/dist/assets/{wiki-editor-page-CHEETB0G.js → wiki-editor-page-Dco79SLY.js} +1 -1
  113. package/dist/assets/{wiki-ingest-history-page-CisvtAzm.js → wiki-ingest-history-page-uvKRkRDF.js} +1 -1
  114. package/dist/assets/{wiki-ingest-modal-C2faIjzj.js → wiki-ingest-modal-BW6AJPea.js} +1 -1
  115. package/dist/assets/{wiki-page-CELe_6qL.js → wiki-page-BIL5zMqv.js} +1 -1
  116. package/dist/assets/{workbench-flow-page-JBVim3L0.js → workbench-flow-page-Dx_nq8R_.js} +1 -1
  117. package/dist/assets/{workbench-page-q7Z3sQtz.js → workbench-page-BJnt_Zzf.js} +1 -1
  118. package/dist/assets/{workout-detail-page-9I_3DPYU.js → workout-detail-page-CKgqyB-y.js} +1 -1
  119. package/dist/index.html +2 -2
  120. package/dist/server/server/src/app.js +4 -0
  121. package/dist/server/server/src/health.js +44 -3
  122. package/dist/server/server/src/openapi.js +31 -0
  123. package/openclaw.plugin.json +1 -1
  124. package/package.json +1 -1
  125. package/dist/assets/index-UzsVTD1W.css +0 -1
  126. package/dist/assets/sleep-page-DyU635jb.js +0 -1
@@ -1 +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-BwL6m4SE.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-CuxQRKPJ.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-DGYIFHgo.js";import{U as we}from"./user-badge-ap1PvOxd.js";import{E as zt}from"./entity-note-count-link-CV3eOv66.js";import{F as Dt}from"./floating-action-menu-DGkHCmvI.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
+ 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-BwL6m4SE.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-CuxQRKPJ.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-CQ5r7ZUz.js";import{U as we}from"./user-badge-CZWtYeMw.js";import{E as zt}from"./entity-note-count-link-Cjsk5oT2.js";import{F as Dt}from"./floating-action-menu-D9-psbha.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,b7 as M}from"./vendor-BwL6m4SE.js";import{c as a}from"./index-DGYIFHgo.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-BwL6m4SE.js";import{c as a}from"./index-CQ5r7ZUz.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,bW as x}from"./vendor-BwL6m4SE.js";import{c as s,k as v}from"./index-DGYIFHgo.js";import{m as g}from"./motion-DcgUnXhY.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-BwL6m4SE.js";import{c as s,k as v}from"./index-CQ5r7ZUz.js";import{m as g}from"./motion-DcgUnXhY.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-BwL6m4SE.js";import{c as l}from"./index-DGYIFHgo.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-BwL6m4SE.js";import{c as l}from"./index-CQ5r7ZUz.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,4 +1,4 @@
1
- import{r as W,j as l}from"./vendor-BwL6m4SE.js";import{H as P,P as w}from"./graph-BF4IsheG.js";import{a4 as j,c as S}from"./index-DGYIFHgo.js";function u(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:null}function E(...e){for(const r of e)if(typeof r=="string")return r;return""}function O(...e){for(const r of e){if(typeof r=="number"&&Number.isFinite(r))return r;if(typeof r=="string"){const t=Number(r);if(Number.isFinite(t))return t}}return null}function A(...e){for(const r of e){if(Array.isArray(r)){const t=r.filter(a=>typeof a=="string"&&a.trim().length>0);if(t.length>0)return t;continue}if(typeof r=="string"){const t=r.trim();if(!t)continue;try{const a=JSON.parse(t);if(Array.isArray(a)){const i=a.filter(s=>typeof s=="string"&&s.trim().length>0);if(i.length>0)return i}}catch{const a=t.split(",").map(i=>i.trim()).filter(i=>i.length>0);if(a.length>0)return a}}}return[]}function _(e,r,t){const a={};return(t.length>0?t:[{key:"summary"}]).forEach((s,o)=>{const n=r&&s.key in r?r[s.key]:o===0||s.key==="summary"?e:null;a[s.key]={text:typeof n=="string"?n:Array.isArray(n)||u(n)?JSON.stringify(n,null,2):String(n??""),json:u(n)}}),a}function $(e,r,t){var s;const a=e.output??[];if(!r&&a.length===0)return null;const i=r?{...r}:{};if(a.length>0){const o=(s=a[0])==null?void 0:s.key;o&&!(o in i)&&(i[o]=t),a.some(n=>n.key==="summary")&&!("summary"in i)&&(i.summary=t)}return i}function d(e,r){const t=$(e.definition,r.output,r.primaryText);return{primaryText:r.primaryText,payload:t,logs:r.logs??[],outputMap:_(r.primaryText,t,e.definition.output)}}function G(e,r,t,a){return d(e,{primaryText:t??`${e.definition.title}
1
+ import{r as W,j as l}from"./vendor-BwL6m4SE.js";import{H as P,P as w}from"./graph-BF4IsheG.js";import{a4 as j,c as S}from"./index-CQ5r7ZUz.js";function u(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:null}function E(...e){for(const r of e)if(typeof r=="string")return r;return""}function O(...e){for(const r of e){if(typeof r=="number"&&Number.isFinite(r))return r;if(typeof r=="string"){const t=Number(r);if(Number.isFinite(t))return t}}return null}function A(...e){for(const r of e){if(Array.isArray(r)){const t=r.filter(a=>typeof a=="string"&&a.trim().length>0);if(t.length>0)return t;continue}if(typeof r=="string"){const t=r.trim();if(!t)continue;try{const a=JSON.parse(t);if(Array.isArray(a)){const i=a.filter(s=>typeof s=="string"&&s.trim().length>0);if(i.length>0)return i}}catch{const a=t.split(",").map(i=>i.trim()).filter(i=>i.length>0);if(a.length>0)return a}}}return[]}function _(e,r,t){const a={};return(t.length>0?t:[{key:"summary"}]).forEach((s,o)=>{const n=r&&s.key in r?r[s.key]:o===0||s.key==="summary"?e:null;a[s.key]={text:typeof n=="string"?n:Array.isArray(n)||u(n)?JSON.stringify(n,null,2):String(n??""),json:u(n)}}),a}function $(e,r,t){var s;const a=e.output??[];if(!r&&a.length===0)return null;const i=r?{...r}:{};if(a.length>0){const o=(s=a[0])==null?void 0:s.key;o&&!(o in i)&&(i[o]=t),a.some(n=>n.key==="summary")&&!("summary"in i)&&(i.summary=t)}return i}function d(e,r){const t=$(e.definition,r.output,r.primaryText);return{primaryText:r.primaryText,payload:t,logs:r.logs??[],outputMap:_(r.primaryText,t,e.definition.output)}}function G(e,r,t,a){return d(e,{primaryText:t??`${e.definition.title}
2
2
  ${e.definition.description}
3
3
  Route: ${e.definition.routePath??"n/a"}`,output:r,logs:a})}function C(e,r,t){const a=Math.max(1,Math.min(50,Math.round(t.limit??12))),i=e.services.entities.search({searches:[{query:t.query,entityTypes:t.entityTypes,limit:a}]}).results[0],s=i!=null&&i.ok?i.matches??[]:[],o=s.slice(0,a).map(n=>{const c=typeof n.title=="string"?n.title:typeof n.name=="string"?n.name:typeof n.id=="string"?n.id:"Untitled";return`${typeof n.entityType=="string"?n.entityType:"entity"}: ${c}`});return{title:r.title,matches:s,summaryText:o.length>0?o.join(`
4
4
  `):`No ${r.title.toLowerCase()} matches found.`,limit:a,query:t.query}}function J(e,r){const t=E(e.inputs.query,e.params.query,r.query).trim(),a=A(e.inputs.entityTypes,e.params.entityTypes,r.entityTypes),i=O(e.inputs.limit,e.params.limit,r.limit)??r.limit??12,s=C(e.context,e.definition,{query:t,entityTypes:a,limit:i});return d(e,{primaryText:s.summaryText,output:{summary:s.summaryText,matches:s.matches,matchCount:s.matches.length}})}function X(e){var t,a;const r=((a=(t=e.context.services.movement).listPlaces)==null?void 0:a.call(t))??[];return d(e,{primaryText:r.length>0?r.slice(0,24).map(i=>typeof i.label=="string"?i.label:typeof i.name=="string"?i.name:typeof i.id=="string"?i.id:"Place").join(`
@@ -1 +1 @@
1
- import{c6 as F,b6 as q,r as l,j as e,aC as p}from"./vendor-BwL6m4SE.js";import{j as A,k as H}from"./state-Bpe5dF3T.js";import{GoalDialog as L}from"./goal-dialog-6R2uYWPQ.js";import{O as Q}from"./open-in-graph-button-ObO3m8yd.js";import{N as z}from"./note-markdown-BZHBOkEd.js";import{ProjectDialog as K}from"./project-dialog-YYxtlqg8.js";import{E as $}from"./entity-notes-surface-CiUgAVl7.js";import{P as _}from"./preference-entity-handoff-button-BpVAeFmY.js";import{b as X,f as J,P as V}from"./project-collections-C7yU5PSi.js";import{P as W}from"./page-hero-BkrRTu-t.js";import{u as Y,d as Z,h as ee,E as T,B as x,C as j,b as k,k as u,P as te,i as ae,Q as se}from"./index-DGYIFHgo.js";import{U as C}from"./user-badge-ap1PvOxd.js";import{g as ie,a as ne}from"./activity-copy-Bj4h9OcF.js";import{g as oe}from"./entity-links-DwpxhW2H.js";import{g as le}from"./user-ownership-DJGl4rAj.js";import"./question-flow-dialog-CLHVmFON.js";import"./ui-B9TWEtCx.js";import"./motion-DcgUnXhY.js";import"./inline-note-fields-CJ9ukqFp.js";import"./user-select-field-fx129Uh6.js";import"./schemas-B0AXfuOr.js";import"./forms-D1qJ3oOP.js";import"./note-tags-input-DucocvNH.js";import"./entity-link-multiselect-Do5DTju7.js";import"./use-anchored-overlay-position-BY4kNzPj.js";import"./board-CuxQRKPJ.js";function Ee(){const{t:a}=Y(),i=Z(),d=F(),G=q(),f=A(),[O,N]=l.useState(!1),[S,y]=l.useState(!1),[m,B]=l.useState("active"),v=le(i.selectedUserIds),[E,b]=l.useState(null),D=H({mutationFn:()=>se(d.goalId),onSuccess:async()=>{await Promise.all([ae(f),f.invalidateQueries({queryKey:["project-board"]}),f.invalidateQueries({queryKey:["task-context"]})]),G("/goals")}}),s=i.snapshot.dashboard.goals.find(t=>t.id===d.goalId)??null,g=l.useMemo(()=>i.snapshot.dashboard.projects.filter(t=>t.goalId===d.goalId),[d.goalId,i.snapshot.dashboard.projects]),R=l.useMemo(()=>X(g),[g]),o=l.useMemo(()=>J(g,m),[g,m]),w=new Set(g.map(t=>t.id)),I=new Set(i.snapshot.tasks.filter(t=>w.has(t.projectId??"")).map(t=>t.id)),h=i.snapshot.activity.filter(t=>t.entityId===d.goalId||w.has(t.entityId)||I.has(t.entityId)||t.entityType==="task_run"&&typeof t.metadata.taskId=="string"&&I.has(t.metadata.taskId));if(!s)return e.jsx(ee,{eyebrow:a("common.goalDetail.eyebrow"),title:a("common.goalDetail.missingTitle"),description:a("common.goalDetail.missingDescription"),action:e.jsx(p,{to:"/goals",className:"inline-flex min-h-10 min-w-0 max-w-full items-center justify-center whitespace-nowrap rounded-full bg-[var(--primary)] px-4 py-2 text-sm font-medium text-[var(--ui-ink-on-accent)] transition hover:opacity-90",children:a("common.goalDetail.backToGoals")})});const n=o.find(t=>t.nextTaskTitle)??o[0]??null,r=i.snapshot.overview.neglectedGoals.find(t=>t.goalId===s.id)??null,c=h[0]??null,M=async t=>{b(t);try{await i.patchProject(t,{status:"active"})}finally{b(null)}},U=async()=>{window.confirm(a("common.goalDetail.deleteGoalConfirm",{title:s.title}))&&await D.mutateAsync()};return e.jsxs("div",{className:"grid min-w-0 gap-5",children:[e.jsx(W,{entityKind:"goal",title:e.jsx(T,{kind:"goal",label:s.title,variant:"heading",size:"lg"}),titleText:s.title,description:s.description?e.jsx(z,{markdown:s.description,className:"[&>p]:text-[13px] [&>p]:leading-6 [&>blockquote]:text-[13px] [&>ul]:text-[13px] [&>ol]:text-[13px]"}):"No strategic description yet.",badge:a(o.length===1?"common.goalDetail.heroBadgeOne":"common.goalDetail.heroBadgeOther",{count:o.length}),actions:e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(_,{userId:v,domain:"projects",entityType:"goal",entityId:s.id,label:s.title,description:s.description}),e.jsx(Q,{entityType:"goal",entityId:s.id})]})}),s.user?e.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-sm text-[var(--ui-ink-soft)]",children:[e.jsx("span",{className:"text-[var(--ui-ink-faint)]",children:"Owned by"}),e.jsx(C,{user:s.user})]}):null,e.jsxs("div",{className:"flex flex-wrap gap-3",children:[e.jsx(x,{onClick:()=>N(!0),children:a("common.goalDetail.edit")}),e.jsx(x,{variant:"secondary",onClick:()=>y(!0),children:a("common.goalDetail.addProject")}),e.jsx(x,{variant:"ghost",className:"text-[var(--danger)] hover:bg-[var(--ui-danger-soft)]",pending:D.isPending,pendingLabel:a("common.goalDetail.deleting"),onClick:()=>void U(),children:a("common.goalDetail.deleteGoal")})]}),e.jsxs("section",{className:"grid min-w-0 gap-5 xl:grid-cols-[minmax(0,1.15fr)_minmax(0,0.85fr)]",children:[e.jsxs(j,{children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsx("div",{className:"font-label text-[11px] uppercase tracking-[0.18em] text-[var(--ui-ink-faint)]",children:a("common.goalDetail.sectionProjects")}),e.jsx(V,{value:m,counts:R,onChange:B,className:"justify-end"})]}),o.length===0?e.jsx("div",{className:"mt-4 rounded-[20px] bg-[var(--ui-surface-2)] p-4 text-sm text-[var(--ui-ink-soft)]",children:m==="active"?a("common.goalDetail.noProjects"):"No projects match this lifecycle filter yet. Switch filters or restart one to make it active again."}):e.jsx("div",{className:"mt-4 grid gap-4 lg:grid-cols-2",children:o.map(t=>e.jsxs("div",{className:"rounded-[22px] bg-[var(--ui-surface-2)] p-5 transition hover:bg-[var(--ui-surface-2)]",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(k,{kind:"project",compact:!0,gradient:!1}),t.user?e.jsx(C,{user:t.user,compact:!0}):null]}),e.jsx(u,{children:t.status})]}),e.jsx("div",{className:"mt-4",children:e.jsx(p,{to:`/projects/${t.id}`,className:"transition hover:opacity-90",children:e.jsx(T,{kind:"project",label:t.title,variant:"heading",size:"lg"})})}),e.jsx("p",{className:"mt-3 text-sm leading-6 text-[var(--ui-ink-soft)]",children:t.description}),e.jsx("div",{className:"mt-4",children:e.jsx(te,{value:t.progress})}),e.jsx("div",{className:"mt-4 text-[11px] uppercase tracking-[0.16em] text-[var(--ui-ink-faint)]",children:t.nextTaskTitle?a("common.goalDetail.nextMove",{value:t.nextTaskTitle}):a("common.goalDetail.addNextTask")}),e.jsxs("div",{className:"mt-4 flex flex-wrap justify-between gap-3",children:[e.jsx(p,{to:`/projects/${t.id}`,children:e.jsx(x,{variant:"ghost",children:"Open project"})}),m!=="active"&&t.status!=="active"?e.jsx(x,{variant:"secondary",size:"sm",pending:E===t.id,pendingLabel:"Restarting…",onClick:()=>void M(t.id),children:"Restart"}):null]})]},t.id))})]}),e.jsx("div",{className:"grid min-w-0 gap-5",children:e.jsxs(j,{children:[e.jsx("div",{className:"font-label text-[11px] uppercase tracking-[0.18em] text-[var(--ui-ink-faint)]",children:a("common.goalDetail.sectionHealth")}),e.jsxs("div",{className:"mt-4 flex flex-wrap items-center gap-2",children:[e.jsx(k,{kind:"goal",compact:!0,gradient:!1}),e.jsx(u,{className:"bg-[var(--ui-surface-2)] text-[var(--ui-ink-soft)]",children:a("common.goalDetail.progressTitle",{progress:s.progress,count:s.completedTasks})}),e.jsx(u,{className:"bg-[var(--ui-surface-2)] text-[var(--ui-ink-soft)]",children:a("common.goalDetail.progressDetail",{xp:s.earnedPoints})}),e.jsx(u,{className:"bg-[var(--ui-surface-2)] text-[var(--ui-ink-soft)]",children:a(o.length===1?"common.goalDetail.heroBadgeOne":"common.goalDetail.heroBadgeOther",{count:o.length})})]}),e.jsxs("div",{className:"mt-4 grid gap-3 sm:grid-cols-3",children:[e.jsxs("div",{className:"rounded-[18px] bg-[var(--ui-surface-2)] px-4 py-3",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.16em] text-[var(--ui-ink-faint)]",children:a("common.goalDetail.fieldProgress")}),e.jsxs("div",{className:"mt-2 font-display text-xl text-[var(--ui-ink-strong)]",children:[s.progress,"%"]})]}),e.jsxs("div",{className:"rounded-[18px] bg-[var(--ui-surface-2)] px-4 py-3",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.16em] text-[var(--ui-ink-faint)]",children:a("common.goalDetail.fieldCompletedTasks")}),e.jsx("div",{className:"mt-2 font-display text-xl text-[var(--ui-ink-strong)]",children:s.completedTasks})]}),e.jsxs("div",{className:"rounded-[18px] bg-[var(--ui-surface-2)] px-4 py-3",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.16em] text-[var(--ui-ink-faint)]",children:a("common.goalDetail.fieldXpBanked")}),e.jsx("div",{className:"mt-2 font-display text-xl text-[var(--ui-ink-strong)]",children:s.earnedPoints})]})]}),e.jsxs("div",{className:"mt-4 grid gap-3",children:[e.jsxs("div",{className:"rounded-[18px] bg-[var(--ui-surface-2)] p-4",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("div",{className:"font-label text-[11px] uppercase tracking-[0.18em] text-[var(--ui-ink-faint)]",children:a("common.goalDetail.signalNext")}),n?e.jsx(k,{kind:"project",compact:!0,gradient:!1}):null]}),e.jsx("div",{className:"mt-2 font-medium text-[var(--ui-ink-strong)]",children:(n==null?void 0:n.title)??a("common.goalDetail.noProject")}),e.jsx("div",{className:"mt-2 text-sm leading-6 text-[var(--ui-ink-soft)]",children:n!=null&&n.nextTaskTitle?a("common.goalDetail.nextMove",{value:n.nextTaskTitle}):(n==null?void 0:n.description)||a("common.goalDetail.noProjectDetail")})]}),e.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[e.jsxs("div",{className:"rounded-[18px] bg-[var(--ui-surface-2)] p-4",children:[e.jsx("div",{className:"font-label text-[11px] uppercase tracking-[0.18em] text-[var(--ui-ink-faint)]",children:a("common.goalDetail.signalRisk")}),e.jsx("div",{className:"mt-2 font-medium text-[var(--ui-ink-strong)]",children:(r==null?void 0:r.title)??a("common.goalDetail.noRisk")}),e.jsx("div",{className:"mt-2 text-sm leading-6 text-[var(--ui-ink-soft)]",children:(r==null?void 0:r.summary)||a("common.goalDetail.noRiskDetail")})]}),e.jsxs("div",{className:"rounded-[18px] bg-[var(--ui-surface-2)] p-4",children:[e.jsx("div",{className:"font-label text-[11px] uppercase tracking-[0.18em] text-[var(--ui-ink-faint)]",children:a("common.goalDetail.signalEvidence")}),e.jsx("div",{className:"mt-2 font-medium text-[var(--ui-ink-strong)]",children:(c==null?void 0:c.title)??a("common.goalDetail.noEvidence")}),e.jsx("div",{className:"mt-2 text-sm leading-6 text-[var(--ui-ink-soft)]",children:(c==null?void 0:c.description)||a("common.goalDetail.noEvidenceDetail")})]})]})]})]})})]}),e.jsx($,{entityType:"goal",entityId:s.id,title:"Goal notes",description:"Use notes to capture strategy changes, meaning shifts, and progress context that belongs at the goal level."}),e.jsxs(j,{children:[e.jsx("div",{className:"font-label text-[11px] uppercase tracking-[0.18em] text-[var(--ui-ink-faint)]",children:a("common.goalDetail.sectionEvidence")}),h.length===0?e.jsx("div",{className:"mt-4 rounded-[20px] bg-[var(--ui-surface-2)] p-4 text-sm text-[var(--ui-ink-soft)]",children:a("common.goalDetail.noEvidenceLogged")}):e.jsx("div",{className:"mt-4 grid gap-3 lg:grid-cols-2",children:h.slice(0,6).map(t=>e.jsxs(p,{to:oe(t)??`/activity?eventId=${t.id}`,className:"rounded-[18px] bg-[var(--ui-surface-2)] p-4 transition hover:bg-[var(--ui-surface-2)]",children:[e.jsx("div",{className:"font-medium text-[var(--ui-ink-strong)]",children:ie(t)}),e.jsx("div",{className:"mt-2 text-sm leading-6 text-[var(--ui-ink-soft)]",children:ne(t)})]},t.id))})]}),e.jsx(L,{open:O,editingGoal:s,tags:i.snapshot.tags,users:i.snapshot.users,defaultUserId:s.userId??v,onOpenChange:N,onSubmit:async(t,P)=>{P&&await i.patchGoal(P,t)}}),e.jsx(K,{open:S,goals:i.snapshot.goals,users:i.snapshot.users,editingProject:null,initialGoalId:s.id,defaultUserId:s.userId??v,onOpenChange:y,onSubmit:async t=>{await i.createProject(t)}})]})}export{Ee as GoalDetailPage};
1
+ import{c6 as F,b6 as q,r as l,j as e,aC as p}from"./vendor-BwL6m4SE.js";import{j as A,k as H}from"./state-Bpe5dF3T.js";import{GoalDialog as L}from"./goal-dialog-Oxx8WqbZ.js";import{O as Q}from"./open-in-graph-button-C-bJekoH.js";import{N as z}from"./note-markdown-B82ncnFt.js";import{ProjectDialog as K}from"./project-dialog-DnZe757y.js";import{E as $}from"./entity-notes-surface-DQQPLjxd.js";import{P as _}from"./preference-entity-handoff-button-DwYF_5i3.js";import{b as X,f as J,P as V}from"./project-collections-mtxanSMf.js";import{P as W}from"./page-hero-8bITsx_x.js";import{u as Y,d as Z,h as ee,E as T,B as x,C as j,b as k,k as u,P as te,i as ae,Q as se}from"./index-CQ5r7ZUz.js";import{U as C}from"./user-badge-CZWtYeMw.js";import{g as ie,a as ne}from"./activity-copy-Bj4h9OcF.js";import{g as oe}from"./entity-links-DwpxhW2H.js";import{g as le}from"./user-ownership-DJGl4rAj.js";import"./question-flow-dialog-CskCt5NZ.js";import"./ui-B9TWEtCx.js";import"./motion-DcgUnXhY.js";import"./inline-note-fields-Bql_KfR9.js";import"./user-select-field-fx129Uh6.js";import"./schemas-CH1_ngUX.js";import"./forms-D1qJ3oOP.js";import"./note-tags-input-C_x5WdK5.js";import"./entity-link-multiselect-DcCvkesQ.js";import"./use-anchored-overlay-position-BY4kNzPj.js";import"./board-CuxQRKPJ.js";function Ee(){const{t:a}=Y(),i=Z(),d=F(),G=q(),f=A(),[O,N]=l.useState(!1),[S,y]=l.useState(!1),[m,B]=l.useState("active"),v=le(i.selectedUserIds),[E,b]=l.useState(null),D=H({mutationFn:()=>se(d.goalId),onSuccess:async()=>{await Promise.all([ae(f),f.invalidateQueries({queryKey:["project-board"]}),f.invalidateQueries({queryKey:["task-context"]})]),G("/goals")}}),s=i.snapshot.dashboard.goals.find(t=>t.id===d.goalId)??null,g=l.useMemo(()=>i.snapshot.dashboard.projects.filter(t=>t.goalId===d.goalId),[d.goalId,i.snapshot.dashboard.projects]),R=l.useMemo(()=>X(g),[g]),o=l.useMemo(()=>J(g,m),[g,m]),w=new Set(g.map(t=>t.id)),I=new Set(i.snapshot.tasks.filter(t=>w.has(t.projectId??"")).map(t=>t.id)),h=i.snapshot.activity.filter(t=>t.entityId===d.goalId||w.has(t.entityId)||I.has(t.entityId)||t.entityType==="task_run"&&typeof t.metadata.taskId=="string"&&I.has(t.metadata.taskId));if(!s)return e.jsx(ee,{eyebrow:a("common.goalDetail.eyebrow"),title:a("common.goalDetail.missingTitle"),description:a("common.goalDetail.missingDescription"),action:e.jsx(p,{to:"/goals",className:"inline-flex min-h-10 min-w-0 max-w-full items-center justify-center whitespace-nowrap rounded-full bg-[var(--primary)] px-4 py-2 text-sm font-medium text-[var(--ui-ink-on-accent)] transition hover:opacity-90",children:a("common.goalDetail.backToGoals")})});const n=o.find(t=>t.nextTaskTitle)??o[0]??null,r=i.snapshot.overview.neglectedGoals.find(t=>t.goalId===s.id)??null,c=h[0]??null,M=async t=>{b(t);try{await i.patchProject(t,{status:"active"})}finally{b(null)}},U=async()=>{window.confirm(a("common.goalDetail.deleteGoalConfirm",{title:s.title}))&&await D.mutateAsync()};return e.jsxs("div",{className:"grid min-w-0 gap-5",children:[e.jsx(W,{entityKind:"goal",title:e.jsx(T,{kind:"goal",label:s.title,variant:"heading",size:"lg"}),titleText:s.title,description:s.description?e.jsx(z,{markdown:s.description,className:"[&>p]:text-[13px] [&>p]:leading-6 [&>blockquote]:text-[13px] [&>ul]:text-[13px] [&>ol]:text-[13px]"}):"No strategic description yet.",badge:a(o.length===1?"common.goalDetail.heroBadgeOne":"common.goalDetail.heroBadgeOther",{count:o.length}),actions:e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(_,{userId:v,domain:"projects",entityType:"goal",entityId:s.id,label:s.title,description:s.description}),e.jsx(Q,{entityType:"goal",entityId:s.id})]})}),s.user?e.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-sm text-[var(--ui-ink-soft)]",children:[e.jsx("span",{className:"text-[var(--ui-ink-faint)]",children:"Owned by"}),e.jsx(C,{user:s.user})]}):null,e.jsxs("div",{className:"flex flex-wrap gap-3",children:[e.jsx(x,{onClick:()=>N(!0),children:a("common.goalDetail.edit")}),e.jsx(x,{variant:"secondary",onClick:()=>y(!0),children:a("common.goalDetail.addProject")}),e.jsx(x,{variant:"ghost",className:"text-[var(--danger)] hover:bg-[var(--ui-danger-soft)]",pending:D.isPending,pendingLabel:a("common.goalDetail.deleting"),onClick:()=>void U(),children:a("common.goalDetail.deleteGoal")})]}),e.jsxs("section",{className:"grid min-w-0 gap-5 xl:grid-cols-[minmax(0,1.15fr)_minmax(0,0.85fr)]",children:[e.jsxs(j,{children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsx("div",{className:"font-label text-[11px] uppercase tracking-[0.18em] text-[var(--ui-ink-faint)]",children:a("common.goalDetail.sectionProjects")}),e.jsx(V,{value:m,counts:R,onChange:B,className:"justify-end"})]}),o.length===0?e.jsx("div",{className:"mt-4 rounded-[20px] bg-[var(--ui-surface-2)] p-4 text-sm text-[var(--ui-ink-soft)]",children:m==="active"?a("common.goalDetail.noProjects"):"No projects match this lifecycle filter yet. Switch filters or restart one to make it active again."}):e.jsx("div",{className:"mt-4 grid gap-4 lg:grid-cols-2",children:o.map(t=>e.jsxs("div",{className:"rounded-[22px] bg-[var(--ui-surface-2)] p-5 transition hover:bg-[var(--ui-surface-2)]",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(k,{kind:"project",compact:!0,gradient:!1}),t.user?e.jsx(C,{user:t.user,compact:!0}):null]}),e.jsx(u,{children:t.status})]}),e.jsx("div",{className:"mt-4",children:e.jsx(p,{to:`/projects/${t.id}`,className:"transition hover:opacity-90",children:e.jsx(T,{kind:"project",label:t.title,variant:"heading",size:"lg"})})}),e.jsx("p",{className:"mt-3 text-sm leading-6 text-[var(--ui-ink-soft)]",children:t.description}),e.jsx("div",{className:"mt-4",children:e.jsx(te,{value:t.progress})}),e.jsx("div",{className:"mt-4 text-[11px] uppercase tracking-[0.16em] text-[var(--ui-ink-faint)]",children:t.nextTaskTitle?a("common.goalDetail.nextMove",{value:t.nextTaskTitle}):a("common.goalDetail.addNextTask")}),e.jsxs("div",{className:"mt-4 flex flex-wrap justify-between gap-3",children:[e.jsx(p,{to:`/projects/${t.id}`,children:e.jsx(x,{variant:"ghost",children:"Open project"})}),m!=="active"&&t.status!=="active"?e.jsx(x,{variant:"secondary",size:"sm",pending:E===t.id,pendingLabel:"Restarting…",onClick:()=>void M(t.id),children:"Restart"}):null]})]},t.id))})]}),e.jsx("div",{className:"grid min-w-0 gap-5",children:e.jsxs(j,{children:[e.jsx("div",{className:"font-label text-[11px] uppercase tracking-[0.18em] text-[var(--ui-ink-faint)]",children:a("common.goalDetail.sectionHealth")}),e.jsxs("div",{className:"mt-4 flex flex-wrap items-center gap-2",children:[e.jsx(k,{kind:"goal",compact:!0,gradient:!1}),e.jsx(u,{className:"bg-[var(--ui-surface-2)] text-[var(--ui-ink-soft)]",children:a("common.goalDetail.progressTitle",{progress:s.progress,count:s.completedTasks})}),e.jsx(u,{className:"bg-[var(--ui-surface-2)] text-[var(--ui-ink-soft)]",children:a("common.goalDetail.progressDetail",{xp:s.earnedPoints})}),e.jsx(u,{className:"bg-[var(--ui-surface-2)] text-[var(--ui-ink-soft)]",children:a(o.length===1?"common.goalDetail.heroBadgeOne":"common.goalDetail.heroBadgeOther",{count:o.length})})]}),e.jsxs("div",{className:"mt-4 grid gap-3 sm:grid-cols-3",children:[e.jsxs("div",{className:"rounded-[18px] bg-[var(--ui-surface-2)] px-4 py-3",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.16em] text-[var(--ui-ink-faint)]",children:a("common.goalDetail.fieldProgress")}),e.jsxs("div",{className:"mt-2 font-display text-xl text-[var(--ui-ink-strong)]",children:[s.progress,"%"]})]}),e.jsxs("div",{className:"rounded-[18px] bg-[var(--ui-surface-2)] px-4 py-3",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.16em] text-[var(--ui-ink-faint)]",children:a("common.goalDetail.fieldCompletedTasks")}),e.jsx("div",{className:"mt-2 font-display text-xl text-[var(--ui-ink-strong)]",children:s.completedTasks})]}),e.jsxs("div",{className:"rounded-[18px] bg-[var(--ui-surface-2)] px-4 py-3",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.16em] text-[var(--ui-ink-faint)]",children:a("common.goalDetail.fieldXpBanked")}),e.jsx("div",{className:"mt-2 font-display text-xl text-[var(--ui-ink-strong)]",children:s.earnedPoints})]})]}),e.jsxs("div",{className:"mt-4 grid gap-3",children:[e.jsxs("div",{className:"rounded-[18px] bg-[var(--ui-surface-2)] p-4",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("div",{className:"font-label text-[11px] uppercase tracking-[0.18em] text-[var(--ui-ink-faint)]",children:a("common.goalDetail.signalNext")}),n?e.jsx(k,{kind:"project",compact:!0,gradient:!1}):null]}),e.jsx("div",{className:"mt-2 font-medium text-[var(--ui-ink-strong)]",children:(n==null?void 0:n.title)??a("common.goalDetail.noProject")}),e.jsx("div",{className:"mt-2 text-sm leading-6 text-[var(--ui-ink-soft)]",children:n!=null&&n.nextTaskTitle?a("common.goalDetail.nextMove",{value:n.nextTaskTitle}):(n==null?void 0:n.description)||a("common.goalDetail.noProjectDetail")})]}),e.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[e.jsxs("div",{className:"rounded-[18px] bg-[var(--ui-surface-2)] p-4",children:[e.jsx("div",{className:"font-label text-[11px] uppercase tracking-[0.18em] text-[var(--ui-ink-faint)]",children:a("common.goalDetail.signalRisk")}),e.jsx("div",{className:"mt-2 font-medium text-[var(--ui-ink-strong)]",children:(r==null?void 0:r.title)??a("common.goalDetail.noRisk")}),e.jsx("div",{className:"mt-2 text-sm leading-6 text-[var(--ui-ink-soft)]",children:(r==null?void 0:r.summary)||a("common.goalDetail.noRiskDetail")})]}),e.jsxs("div",{className:"rounded-[18px] bg-[var(--ui-surface-2)] p-4",children:[e.jsx("div",{className:"font-label text-[11px] uppercase tracking-[0.18em] text-[var(--ui-ink-faint)]",children:a("common.goalDetail.signalEvidence")}),e.jsx("div",{className:"mt-2 font-medium text-[var(--ui-ink-strong)]",children:(c==null?void 0:c.title)??a("common.goalDetail.noEvidence")}),e.jsx("div",{className:"mt-2 text-sm leading-6 text-[var(--ui-ink-soft)]",children:(c==null?void 0:c.description)||a("common.goalDetail.noEvidenceDetail")})]})]})]})]})})]}),e.jsx($,{entityType:"goal",entityId:s.id,title:"Goal notes",description:"Use notes to capture strategy changes, meaning shifts, and progress context that belongs at the goal level."}),e.jsxs(j,{children:[e.jsx("div",{className:"font-label text-[11px] uppercase tracking-[0.18em] text-[var(--ui-ink-faint)]",children:a("common.goalDetail.sectionEvidence")}),h.length===0?e.jsx("div",{className:"mt-4 rounded-[20px] bg-[var(--ui-surface-2)] p-4 text-sm text-[var(--ui-ink-soft)]",children:a("common.goalDetail.noEvidenceLogged")}):e.jsx("div",{className:"mt-4 grid gap-3 lg:grid-cols-2",children:h.slice(0,6).map(t=>e.jsxs(p,{to:oe(t)??`/activity?eventId=${t.id}`,className:"rounded-[18px] bg-[var(--ui-surface-2)] p-4 transition hover:bg-[var(--ui-surface-2)]",children:[e.jsx("div",{className:"font-medium text-[var(--ui-ink-strong)]",children:ie(t)}),e.jsx("div",{className:"mt-2 text-sm leading-6 text-[var(--ui-ink-soft)]",children:ne(t)})]},t.id))})]}),e.jsx(L,{open:O,editingGoal:s,tags:i.snapshot.tags,users:i.snapshot.users,defaultUserId:s.userId??v,onOpenChange:N,onSubmit:async(t,P)=>{P&&await i.patchGoal(P,t)}}),e.jsx(K,{open:S,goals:i.snapshot.goals,users:i.snapshot.users,editingProject:null,initialGoalId:s.id,defaultUserId:s.userId??v,onOpenChange:y,onSubmit:async t=>{await i.createProject(t)}})]})}export{Ee as GoalDetailPage};
@@ -1 +1 @@
1
- import{r as c,j as t}from"./vendor-BwL6m4SE.js";import{Q as T,F as i,a as j}from"./question-flow-dialog-CLHVmFON.js";import{I as N}from"./inline-note-fields-CJ9ukqFp.js";import{u as P,I as h,T as L}from"./index-DGYIFHgo.js";import{U as D}from"./user-select-field-fx129Uh6.js";import{g as A}from"./schemas-B0AXfuOr.js";import{a as H}from"./user-ownership-DJGl4rAj.js";import"./ui-B9TWEtCx.js";import"./motion-DcgUnXhY.js";import"./state-Bpe5dF3T.js";import"./board-CuxQRKPJ.js";import"./forms-D1qJ3oOP.js";const p={title:"",description:"",horizon:"year",status:"active",userId:null,targetPoints:400,themeColor:"#c8a46b",tagIds:[],notes:[]};function K(a){return{title:a.title,description:a.description,horizon:a.horizon,status:a.status,userId:a.userId??null,targetPoints:a.targetPoints,themeColor:a.themeColor,tagIds:a.tagIds,notes:[]}}function Z({open:a,pending:y=!1,editingGoal:n,tags:w,users:C,defaultUserId:d=null,onOpenChange:b,onSubmit:I}){const{t:r}=P(),f=C??[],S=f.find(o=>o.id===d)??null,[x,m]=c.useState(p),[F,l]=c.useState(null),[u,g]=c.useState({}),E=o=>{g(Object.fromEntries(Object.entries(o).map(([s,e])=>[s,e==null?void 0:e[0]])))};c.useEffect(()=>{a&&(l(null),g({}),m(n?K(n):{...p,userId:d}))},[d,n,a]);const z=[{id:"intent",eyebrow:"Direction",title:"Name the arc and why it matters",description:"Start with the long-horizon direction itself. We can refine cadence, tags, and visual tone after the intent is clear.",render:(o,s)=>t.jsxs(t.Fragment,{children:[t.jsx(i,{label:r("common.dialogs.goal.title"),error:u.title??null,children:t.jsx(h,{value:o.title,onChange:e=>s({title:e.target.value}),placeholder:"Build a durable body and calm energy"})}),t.jsx(i,{label:r("common.dialogs.goal.descriptionLabel"),children:t.jsx(L,{value:o.description,onChange:e=>s({description:e.target.value}),placeholder:"Write the goal description in Markdown. This can stay short or grow into a long strategic page."})}),t.jsx(D,{value:o.userId,users:f,onChange:e=>s({userId:e}),label:"Owner user",defaultLabel:H(S),help:"Goals can belong to a human or bot user. The current single-user scope becomes the default when one user is selected."})]})},{id:"cadence",eyebrow:"Cadence",title:"Choose the horizon and current posture",description:"Keep this simple: how long does this arc run, and is it currently active, paused, or already complete?",render:(o,s)=>t.jsxs(t.Fragment,{children:[t.jsx(i,{label:r("common.dialogs.goal.horizon"),children:t.jsx(j,{value:o.horizon,onChange:e=>s({horizon:e}),options:[{value:"quarter",label:r("common.enums.goalHorizon.quarter"),description:"Tight strategic push for the coming months."},{value:"year",label:r("common.enums.goalHorizon.year"),description:"A full-cycle objective for this year."},{value:"lifetime",label:r("common.enums.goalHorizon.lifetime"),description:"A long-running life arc that projects can keep serving."}],columns:3})}),t.jsx(i,{label:r("common.dialogs.goal.status"),children:t.jsx(j,{value:o.status,onChange:e=>s({status:e}),options:[{value:"active",label:r("common.enums.projectStatus.active"),description:"This is live right now."},{value:"paused",label:r("common.enums.projectStatus.paused"),description:"Keep it visible, but do not push it right now."},{value:"completed",label:r("common.enums.projectStatus.completed"),description:"You have already fulfilled this arc."}]})})]})},{id:"signal",eyebrow:"Signal",title:"Set the target and visual signature",description:"Give Forge enough signal to show progress and make this arc recognizable throughout the app.",render:(o,s)=>t.jsxs(t.Fragment,{children:[t.jsx(i,{label:r("common.dialogs.goal.targetXp"),error:u.targetPoints??null,children:t.jsx(h,{type:"number",value:o.targetPoints,onChange:e=>s({targetPoints:Number(e.target.value)||0})})}),t.jsx(i,{label:r("common.dialogs.goal.themeColor"),error:u.themeColor??null,children:t.jsxs("div",{className:"flex items-center gap-3 rounded-[22px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-2)] px-4 py-3",children:[t.jsx("input",{className:"h-10 w-12 rounded-lg border border-[var(--ui-border-subtle)] bg-transparent",type:"color",value:o.themeColor,onChange:e=>s({themeColor:e.target.value})}),t.jsx(h,{className:"border-none bg-transparent px-0 py-0",value:o.themeColor,onChange:e=>s({themeColor:e.target.value})})]})}),t.jsx(i,{label:r("common.dialogs.goal.tags"),children:t.jsx("div",{className:"flex flex-wrap gap-2",children:w.map(e=>{const v=o.tagIds.includes(e.id);return t.jsx("button",{type:"button",className:`rounded-full px-3 py-2 text-sm transition ${v?"bg-[var(--ui-surface-active)] text-[var(--ui-ink-strong)]":"bg-[var(--ui-surface-2)] text-[var(--ui-ink-soft)] hover:bg-[var(--ui-surface-hover)] hover:text-[var(--ui-ink-strong)]"}`,onClick:()=>s({tagIds:v?o.tagIds.filter(k=>k!==e.id):[...o.tagIds,e.id]}),children:e.name},e.id)})})})]})},{id:"notes",eyebrow:"Evidence",title:"Attach any creation context that should live with this goal",description:"Creation notes become real linked Markdown notes, so strategic context does not vanish into the form flow.",render:(o,s)=>t.jsx(i,{label:"Creation notes",children:t.jsx(N,{notes:o.notes,onChange:e=>s({notes:e}),entityLabel:"goal"})})}];return t.jsx(T,{open:a,onOpenChange:b,eyebrow:r("common.dialogs.goal.eyebrow"),title:r(n?"common.dialogs.goal.editTitle":"common.dialogs.goal.createTitle"),description:r("common.dialogs.goal.description"),value:x,onChange:m,draftPersistenceKey:n?`goal.${n.id}`:"goal.new",steps:z,pending:y,pendingLabel:r(n?"common.dialogs.goal.save":"common.dialogs.goal.create"),submitLabel:r(n?"common.dialogs.goal.save":"common.dialogs.goal.create"),error:F,onSubmit:async()=>{l(null);const o=A.safeParse(x);if(!o.success){E(o.error.flatten().fieldErrors),l("Some answers still need attention before this goal arc can be saved.");return}g({});try{await I(o.data,n==null?void 0:n.id),m(p),b(!1)}catch(s){l(s instanceof Error?s.message:r("common.dialogs.goal.submitError"))}}})}export{Z as GoalDialog,p as defaultGoalValues,K as goalToFormValues};
1
+ import{r as c,j as t}from"./vendor-BwL6m4SE.js";import{Q as T,F as i,a as j}from"./question-flow-dialog-CskCt5NZ.js";import{I as N}from"./inline-note-fields-Bql_KfR9.js";import{u as P,I as h,T as L}from"./index-CQ5r7ZUz.js";import{U as D}from"./user-select-field-fx129Uh6.js";import{g as A}from"./schemas-CH1_ngUX.js";import{a as H}from"./user-ownership-DJGl4rAj.js";import"./ui-B9TWEtCx.js";import"./motion-DcgUnXhY.js";import"./state-Bpe5dF3T.js";import"./board-CuxQRKPJ.js";import"./forms-D1qJ3oOP.js";const p={title:"",description:"",horizon:"year",status:"active",userId:null,targetPoints:400,themeColor:"#c8a46b",tagIds:[],notes:[]};function K(a){return{title:a.title,description:a.description,horizon:a.horizon,status:a.status,userId:a.userId??null,targetPoints:a.targetPoints,themeColor:a.themeColor,tagIds:a.tagIds,notes:[]}}function Z({open:a,pending:y=!1,editingGoal:n,tags:w,users:C,defaultUserId:d=null,onOpenChange:b,onSubmit:I}){const{t:r}=P(),f=C??[],S=f.find(o=>o.id===d)??null,[x,m]=c.useState(p),[F,l]=c.useState(null),[u,g]=c.useState({}),E=o=>{g(Object.fromEntries(Object.entries(o).map(([s,e])=>[s,e==null?void 0:e[0]])))};c.useEffect(()=>{a&&(l(null),g({}),m(n?K(n):{...p,userId:d}))},[d,n,a]);const z=[{id:"intent",eyebrow:"Direction",title:"Name the arc and why it matters",description:"Start with the long-horizon direction itself. We can refine cadence, tags, and visual tone after the intent is clear.",render:(o,s)=>t.jsxs(t.Fragment,{children:[t.jsx(i,{label:r("common.dialogs.goal.title"),error:u.title??null,children:t.jsx(h,{value:o.title,onChange:e=>s({title:e.target.value}),placeholder:"Build a durable body and calm energy"})}),t.jsx(i,{label:r("common.dialogs.goal.descriptionLabel"),children:t.jsx(L,{value:o.description,onChange:e=>s({description:e.target.value}),placeholder:"Write the goal description in Markdown. This can stay short or grow into a long strategic page."})}),t.jsx(D,{value:o.userId,users:f,onChange:e=>s({userId:e}),label:"Owner user",defaultLabel:H(S),help:"Goals can belong to a human or bot user. The current single-user scope becomes the default when one user is selected."})]})},{id:"cadence",eyebrow:"Cadence",title:"Choose the horizon and current posture",description:"Keep this simple: how long does this arc run, and is it currently active, paused, or already complete?",render:(o,s)=>t.jsxs(t.Fragment,{children:[t.jsx(i,{label:r("common.dialogs.goal.horizon"),children:t.jsx(j,{value:o.horizon,onChange:e=>s({horizon:e}),options:[{value:"quarter",label:r("common.enums.goalHorizon.quarter"),description:"Tight strategic push for the coming months."},{value:"year",label:r("common.enums.goalHorizon.year"),description:"A full-cycle objective for this year."},{value:"lifetime",label:r("common.enums.goalHorizon.lifetime"),description:"A long-running life arc that projects can keep serving."}],columns:3})}),t.jsx(i,{label:r("common.dialogs.goal.status"),children:t.jsx(j,{value:o.status,onChange:e=>s({status:e}),options:[{value:"active",label:r("common.enums.projectStatus.active"),description:"This is live right now."},{value:"paused",label:r("common.enums.projectStatus.paused"),description:"Keep it visible, but do not push it right now."},{value:"completed",label:r("common.enums.projectStatus.completed"),description:"You have already fulfilled this arc."}]})})]})},{id:"signal",eyebrow:"Signal",title:"Set the target and visual signature",description:"Give Forge enough signal to show progress and make this arc recognizable throughout the app.",render:(o,s)=>t.jsxs(t.Fragment,{children:[t.jsx(i,{label:r("common.dialogs.goal.targetXp"),error:u.targetPoints??null,children:t.jsx(h,{type:"number",value:o.targetPoints,onChange:e=>s({targetPoints:Number(e.target.value)||0})})}),t.jsx(i,{label:r("common.dialogs.goal.themeColor"),error:u.themeColor??null,children:t.jsxs("div",{className:"flex items-center gap-3 rounded-[22px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-2)] px-4 py-3",children:[t.jsx("input",{className:"h-10 w-12 rounded-lg border border-[var(--ui-border-subtle)] bg-transparent",type:"color",value:o.themeColor,onChange:e=>s({themeColor:e.target.value})}),t.jsx(h,{className:"border-none bg-transparent px-0 py-0",value:o.themeColor,onChange:e=>s({themeColor:e.target.value})})]})}),t.jsx(i,{label:r("common.dialogs.goal.tags"),children:t.jsx("div",{className:"flex flex-wrap gap-2",children:w.map(e=>{const v=o.tagIds.includes(e.id);return t.jsx("button",{type:"button",className:`rounded-full px-3 py-2 text-sm transition ${v?"bg-[var(--ui-surface-active)] text-[var(--ui-ink-strong)]":"bg-[var(--ui-surface-2)] text-[var(--ui-ink-soft)] hover:bg-[var(--ui-surface-hover)] hover:text-[var(--ui-ink-strong)]"}`,onClick:()=>s({tagIds:v?o.tagIds.filter(k=>k!==e.id):[...o.tagIds,e.id]}),children:e.name},e.id)})})})]})},{id:"notes",eyebrow:"Evidence",title:"Attach any creation context that should live with this goal",description:"Creation notes become real linked Markdown notes, so strategic context does not vanish into the form flow.",render:(o,s)=>t.jsx(i,{label:"Creation notes",children:t.jsx(N,{notes:o.notes,onChange:e=>s({notes:e}),entityLabel:"goal"})})}];return t.jsx(T,{open:a,onOpenChange:b,eyebrow:r("common.dialogs.goal.eyebrow"),title:r(n?"common.dialogs.goal.editTitle":"common.dialogs.goal.createTitle"),description:r("common.dialogs.goal.description"),value:x,onChange:m,draftPersistenceKey:n?`goal.${n.id}`:"goal.new",steps:z,pending:y,pendingLabel:r(n?"common.dialogs.goal.save":"common.dialogs.goal.create"),submitLabel:r(n?"common.dialogs.goal.save":"common.dialogs.goal.create"),error:F,onSubmit:async()=>{l(null);const o=A.safeParse(x);if(!o.success){E(o.error.flatten().fieldErrors),l("Some answers still need attention before this goal arc can be saved.");return}g({});try{await I(o.data,n==null?void 0:n.id),m(p),b(!1)}catch(s){l(s instanceof Error?s.message:r("common.dialogs.goal.submitError"))}}})}export{Z as GoalDialog,p as defaultGoalValues,K as goalToFormValues};
@@ -1 +1 @@
1
- import{r as p,j as e,aC as b,b_ as P,bW as C}from"./vendor-BwL6m4SE.js";import{P as S}from"./page-hero-BkrRTu-t.js";import{E as G}from"./entity-note-count-link-CV3eOv66.js";import{C as k,B as y,b as w,E as h,k as l,c as N,d as E,h as z,R as L,P as T}from"./index-DGYIFHgo.js";import{GoalDialog as B}from"./goal-dialog-6R2uYWPQ.js";import{P as I}from"./pill-cluster-COzv8VgR.js";import{b as R,f as D,P as F}from"./project-collections-C7yU5PSi.js";import{U}from"./user-badge-ap1PvOxd.js";import{g as M}from"./user-ownership-DJGl4rAj.js";import"./state-Bpe5dF3T.js";import"./motion-DcgUnXhY.js";import"./ui-B9TWEtCx.js";import"./board-CuxQRKPJ.js";import"./forms-D1qJ3oOP.js";import"./question-flow-dialog-CLHVmFON.js";import"./inline-note-fields-CJ9ukqFp.js";import"./user-select-field-fx129Uh6.js";import"./schemas-B0AXfuOr.js";function O({goals:t,tags:r,users:o,defaultUserId:d=null,pending:c=!1,onCreate:n,onUpdate:v}){const[f,m]=p.useState(!1),[g,u]=p.useState(null),a=t.find(s=>s.id===g)??null;return e.jsxs(e.Fragment,{children:[e.jsxs(k,{children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"font-label text-[11px] uppercase tracking-[0.18em] text-[var(--ui-ink-faint)]",children:"Goal arcs"}),e.jsx("h3",{className:"mt-2 font-display text-3xl text-[var(--ui-ink-strong)]",children:"Strategic arcs before tickets"}),e.jsx("p",{className:"mt-3 max-w-3xl text-sm leading-7 text-[var(--ui-ink-soft)]",children:"This is the long-horizon map. Each arc shows why it matters, how much ground has been covered, and which project should move next."})]}),e.jsx(y,{onClick:()=>{u(null),m(!0)},children:"Create goal"})]}),e.jsxs("div",{className:"mt-5 grid gap-3 xl:grid-cols-2",children:[t.length===0?e.jsx("div",{className:"rounded-[24px] bg-[var(--ui-surface-2)] p-5 text-sm leading-7 text-[var(--ui-ink-soft)] xl:col-span-2",children:"Start with a life goal. Once the destination is clear, you can attach projects and then fill those projects with tasks."}):null,t.map(s=>{const x=`${Math.max(6,Math.min(100,s.progress))}%`;return e.jsxs(b,{to:`/goals/${s.id}`,className:"rounded-[24px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-1)] p-4 transition hover:bg-[var(--ui-surface-hover)]",children:[e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx(w,{kind:"goal",compact:!0,gradient:!1}),e.jsx("div",{className:"mt-2",children:e.jsx(h,{kind:"goal",label:s.title,variant:"heading",size:"lg",showKind:!1,lines:2})}),e.jsx("p",{className:"mt-2 text-sm leading-6 text-[var(--ui-ink-soft)]",children:s.description||"No strategic note attached yet."})]}),e.jsx("button",{className:"rounded-full bg-[var(--ui-surface-2)] p-2 text-[var(--ui-ink-soft)] transition hover:bg-[var(--ui-surface-hover)] hover:text-[var(--ui-ink-strong)]",type:"button",onClick:i=>{i.preventDefault(),i.stopPropagation(),u(s.id),m(!0)},children:e.jsx(P,{className:"size-4"})})]}),e.jsxs("div",{className:"mt-4 flex flex-wrap gap-2",children:[e.jsx(l,{className:"bg-[var(--ui-surface-2)] text-[var(--ui-ink-soft)]",children:s.horizon}),e.jsx(l,{className:s.status==="active"?"text-[var(--success)]":s.status==="paused"?"text-[var(--warning)]":"text-[var(--tertiary)]",children:s.status}),e.jsxs(l,{className:"bg-[var(--ui-surface-2)] text-[var(--ui-ink-soft)]",children:[s.earnedPoints," / ",s.targetPoints," xp"]}),e.jsxs(l,{className:"bg-[var(--ui-surface-2)] text-[var(--ui-ink-soft)]",children:[s.totalTasks," tasks"]})]}),e.jsx("div",{className:"mt-4 h-1.5 rounded-full bg-[var(--ui-surface-2)]",children:e.jsx("div",{className:"h-full rounded-full bg-[var(--primary)]",style:{width:x}})}),e.jsx("div",{className:"mt-3 flex flex-wrap gap-2",children:s.tags.map(i=>e.jsx(l,{className:"bg-[var(--ui-surface-2)] text-[var(--ui-ink-soft)]",children:i.name},i.id))}),e.jsxs("div",{className:"mt-3 flex items-center justify-between gap-3 text-[11px] uppercase tracking-[0.16em] text-[var(--ui-ink-faint)]",children:[e.jsx("span",{className:"min-w-0 flex-1 truncate",children:s.momentumLabel}),e.jsxs("span",{className:"inline-flex shrink-0 items-center gap-2",style:{color:s.themeColor},children:["Open arc",e.jsx(C,{className:"size-3.5"})]})]})]},s.id)})]})]}),e.jsx(B,{open:f,pending:c,editingGoal:a,tags:r,users:o,defaultUserId:d,onOpenChange:s=>{m(s),s||u(null)},onSubmit:async(s,x)=>{if(x){await v(x,s);return}await n(s)}})]})}function $({eyebrow:t,title:r,description:o,meta:d,actions:c,className:n}){return e.jsxs("div",{className:N("flex flex-wrap items-start justify-between gap-3",n),children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[t?e.jsx("div",{className:"font-label text-[11px] uppercase tracking-[0.18em] text-[var(--ui-ink-faint)]",children:t}):null,e.jsxs("div",{className:N("min-w-0",t&&"mt-2"),children:[e.jsx("div",{className:"min-w-0 text-lg text-[var(--ui-ink-strong)]",children:r}),o?e.jsx("div",{className:"mt-2 text-sm leading-6 text-[var(--ui-ink-soft)]",children:o}):null]})]}),d||c?e.jsxs("div",{className:"flex shrink-0 flex-wrap items-center justify-end gap-2",children:[d,c]}):null]})}function ne(){const t=E(),[r,o]=p.useState("active"),[d,c]=p.useState(null),n=t.snapshot.dashboard.goals.length>0,v=R(t.snapshot.dashboard.projects),f=D(t.snapshot.dashboard.projects,r),m=M(t.selectedUserIds),g=new Map(t.snapshot.dashboard.goals.map(a=>[a.id,f.filter(s=>s.goalId===a.id)])),u=async a=>{c(a);try{await t.patchProject(a,{status:"active"})}finally{c(null)}};return e.jsxs("div",{className:"grid gap-5",children:[e.jsx(S,{entityKind:"goal",title:e.jsx(h,{kind:"goal",label:"Life Goals",variant:"heading",size:"lg"}),titleText:"Life Goals",description:"Life goals are the destinations you care about over the long run. Each one can hold several projects, and those projects turn direction into real work.",badge:`${t.snapshot.dashboard.goals.length} active goals`,actions:n?e.jsxs("div",{className:"inline-flex min-h-10 items-center rounded-full border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-2)] px-4 py-2 text-sm whitespace-nowrap text-[var(--ui-ink-soft)]",children:[t.snapshot.dashboard.projects.length," live project",t.snapshot.dashboard.projects.length===1?"":"s"," ","attached"]}):null}),e.jsx(O,{goals:t.snapshot.dashboard.goals,tags:t.snapshot.tags,users:t.snapshot.users,defaultUserId:m,onCreate:t.createGoal,onUpdate:t.patchGoal}),n?e.jsx(F,{value:r,counts:v,onChange:o}):null,n?null:e.jsx(z,{eyebrow:"Life goals",title:"No life goals yet",description:"Define the first long-horizon direction above so Forge can attach projects, tasks, momentum, and evidence to something meaningful."}),n?e.jsx("div",{className:"grid gap-4",children:t.snapshot.dashboard.goals.map(a=>{const s=g.get(a.id)??[],x=L(t.snapshot.dashboard.notesSummaryByEntity,"goal",a.id);return e.jsx(b,{to:`/goals/${a.id}`,className:"min-w-0 overflow-hidden rounded-[28px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-1)] p-4 transition hover:bg-[var(--ui-surface-hover)] sm:p-5",children:e.jsxs("div",{className:"grid gap-4 xl:grid-cols-[minmax(0,1.15fr)_minmax(0,0.85fr)] xl:gap-5",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs(I,{children:[a.tags.slice(0,3).map(i=>e.jsx(l,{className:"bg-[var(--ui-surface-2)]",style:{color:i.color},children:i.name},i.id)),e.jsx(l,{className:"bg-[var(--ui-surface-2)] text-[var(--ui-ink-soft)]",children:a.horizon}),e.jsx(U,{user:a.user,compact:!0})]}),e.jsx("div",{className:"mt-4",children:e.jsx(h,{kind:"goal",label:a.title,variant:"heading",size:"xl",lines:2})}),e.jsx("p",{className:"mt-3 max-w-2xl text-sm leading-7 text-[var(--ui-ink-soft)]",children:a.description}),e.jsxs("div",{className:"mt-4 grid gap-3 sm:grid-cols-3",children:[e.jsxs("div",{className:"rounded-[18px] bg-[var(--ui-surface-2)] px-3.5 py-3",children:[e.jsx("div",{className:"font-label text-[11px] uppercase tracking-[0.16em] text-[var(--ui-ink-faint)]",children:"Progress"}),e.jsxs("div",{className:"mt-2 text-xl text-[var(--ui-ink-strong)]",children:[a.progress,"%"]})]}),e.jsxs("div",{className:"rounded-[18px] bg-[var(--ui-surface-2)] px-3.5 py-3",children:[e.jsx("div",{className:"font-label text-[11px] uppercase tracking-[0.16em] text-[var(--ui-ink-faint)]",children:"Tasks done"}),e.jsxs("div",{className:"mt-2 text-xl text-[var(--ui-ink-strong)]",children:[a.completedTasks,"/",Math.max(a.totalTasks,1)]})]}),e.jsxs("div",{className:"rounded-[18px] bg-[var(--ui-surface-2)] px-3.5 py-3",children:[e.jsx("div",{className:"font-label text-[11px] uppercase tracking-[0.16em] text-[var(--ui-ink-faint)]",children:"XP banked"}),e.jsx("div",{className:"mt-2 text-xl text-[var(--ui-ink-strong)]",children:a.earnedPoints})]})]}),e.jsx("div",{className:"mt-4",children:e.jsx(T,{value:a.progress})}),e.jsx("div",{className:"mt-4",children:e.jsx(G,{entityType:"goal",entityId:a.id,count:x.count})})]}),e.jsxs("div",{className:"min-w-0 rounded-[24px] bg-[var(--ui-surface-2)] p-4",children:[e.jsx($,{title:"Projects carrying this direction",meta:e.jsx("div",{className:"shrink-0 text-sm text-[var(--ui-ink-faint)]",children:s.length}),className:"gap-2"}),s.length===0?e.jsx("div",{className:"mt-4 text-sm leading-6 text-[var(--ui-ink-soft)]",children:r==="active"?"No active project is attached yet. Create one so this direction starts producing visible work.":"No projects in this lifecycle view are attached yet. Switch filters or restart one to bring it back into active motion."}):e.jsx("div",{className:"mt-4 grid gap-3",children:s.slice(0,3).map(i=>e.jsxs("div",{className:"rounded-[18px] bg-[var(--ui-surface-hover)] px-4 py-4",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[e.jsx(w,{kind:"project",compact:!0,gradient:!1}),e.jsx(h,{kind:"project",label:i.title,className:"min-w-0",showIcon:!1,lines:2})]}),e.jsx(l,{className:"shrink-0",children:i.status})]}),e.jsx("div",{className:"mt-2 text-sm leading-6 text-[var(--ui-ink-soft)]",children:i.description}),e.jsxs("div",{className:"mt-3 text-sm text-[var(--ui-ink-faint)]",children:["Next move:"," ",i.nextTaskTitle??"Define the first attached task"]}),r!=="active"&&i.status!=="active"?e.jsx("div",{className:"mt-4 flex justify-end",children:e.jsx(y,{variant:"secondary",size:"sm",pending:d===i.id,pendingLabel:"Restarting…",onClick:j=>{j.preventDefault(),j.stopPropagation(),u(i.id)},children:"Restart"})}):null]},i.id))})]})]})},a.id)})}):e.jsx(k,{children:e.jsx("div",{className:"rounded-[20px] bg-[var(--ui-surface-2)] p-4 text-sm text-[var(--ui-ink-soft)]",children:"Goal cards will appear here once the first long-horizon direction is created."})})]})}export{ne as GoalsPage};
1
+ import{r as p,j as e,aC as b,b_ as P,bW as C}from"./vendor-BwL6m4SE.js";import{P as S}from"./page-hero-8bITsx_x.js";import{E as G}from"./entity-note-count-link-Cjsk5oT2.js";import{C as k,B as y,b as w,E as h,k as l,c as N,d as E,h as z,R as L,P as T}from"./index-CQ5r7ZUz.js";import{GoalDialog as B}from"./goal-dialog-Oxx8WqbZ.js";import{P as I}from"./pill-cluster-XQjm-wPc.js";import{b as R,f as D,P as F}from"./project-collections-mtxanSMf.js";import{U}from"./user-badge-CZWtYeMw.js";import{g as M}from"./user-ownership-DJGl4rAj.js";import"./state-Bpe5dF3T.js";import"./motion-DcgUnXhY.js";import"./ui-B9TWEtCx.js";import"./board-CuxQRKPJ.js";import"./forms-D1qJ3oOP.js";import"./question-flow-dialog-CskCt5NZ.js";import"./inline-note-fields-Bql_KfR9.js";import"./user-select-field-fx129Uh6.js";import"./schemas-CH1_ngUX.js";function O({goals:t,tags:r,users:o,defaultUserId:d=null,pending:c=!1,onCreate:n,onUpdate:v}){const[f,m]=p.useState(!1),[g,u]=p.useState(null),a=t.find(s=>s.id===g)??null;return e.jsxs(e.Fragment,{children:[e.jsxs(k,{children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"font-label text-[11px] uppercase tracking-[0.18em] text-[var(--ui-ink-faint)]",children:"Goal arcs"}),e.jsx("h3",{className:"mt-2 font-display text-3xl text-[var(--ui-ink-strong)]",children:"Strategic arcs before tickets"}),e.jsx("p",{className:"mt-3 max-w-3xl text-sm leading-7 text-[var(--ui-ink-soft)]",children:"This is the long-horizon map. Each arc shows why it matters, how much ground has been covered, and which project should move next."})]}),e.jsx(y,{onClick:()=>{u(null),m(!0)},children:"Create goal"})]}),e.jsxs("div",{className:"mt-5 grid gap-3 xl:grid-cols-2",children:[t.length===0?e.jsx("div",{className:"rounded-[24px] bg-[var(--ui-surface-2)] p-5 text-sm leading-7 text-[var(--ui-ink-soft)] xl:col-span-2",children:"Start with a life goal. Once the destination is clear, you can attach projects and then fill those projects with tasks."}):null,t.map(s=>{const x=`${Math.max(6,Math.min(100,s.progress))}%`;return e.jsxs(b,{to:`/goals/${s.id}`,className:"rounded-[24px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-1)] p-4 transition hover:bg-[var(--ui-surface-hover)]",children:[e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx(w,{kind:"goal",compact:!0,gradient:!1}),e.jsx("div",{className:"mt-2",children:e.jsx(h,{kind:"goal",label:s.title,variant:"heading",size:"lg",showKind:!1,lines:2})}),e.jsx("p",{className:"mt-2 text-sm leading-6 text-[var(--ui-ink-soft)]",children:s.description||"No strategic note attached yet."})]}),e.jsx("button",{className:"rounded-full bg-[var(--ui-surface-2)] p-2 text-[var(--ui-ink-soft)] transition hover:bg-[var(--ui-surface-hover)] hover:text-[var(--ui-ink-strong)]",type:"button",onClick:i=>{i.preventDefault(),i.stopPropagation(),u(s.id),m(!0)},children:e.jsx(P,{className:"size-4"})})]}),e.jsxs("div",{className:"mt-4 flex flex-wrap gap-2",children:[e.jsx(l,{className:"bg-[var(--ui-surface-2)] text-[var(--ui-ink-soft)]",children:s.horizon}),e.jsx(l,{className:s.status==="active"?"text-[var(--success)]":s.status==="paused"?"text-[var(--warning)]":"text-[var(--tertiary)]",children:s.status}),e.jsxs(l,{className:"bg-[var(--ui-surface-2)] text-[var(--ui-ink-soft)]",children:[s.earnedPoints," / ",s.targetPoints," xp"]}),e.jsxs(l,{className:"bg-[var(--ui-surface-2)] text-[var(--ui-ink-soft)]",children:[s.totalTasks," tasks"]})]}),e.jsx("div",{className:"mt-4 h-1.5 rounded-full bg-[var(--ui-surface-2)]",children:e.jsx("div",{className:"h-full rounded-full bg-[var(--primary)]",style:{width:x}})}),e.jsx("div",{className:"mt-3 flex flex-wrap gap-2",children:s.tags.map(i=>e.jsx(l,{className:"bg-[var(--ui-surface-2)] text-[var(--ui-ink-soft)]",children:i.name},i.id))}),e.jsxs("div",{className:"mt-3 flex items-center justify-between gap-3 text-[11px] uppercase tracking-[0.16em] text-[var(--ui-ink-faint)]",children:[e.jsx("span",{className:"min-w-0 flex-1 truncate",children:s.momentumLabel}),e.jsxs("span",{className:"inline-flex shrink-0 items-center gap-2",style:{color:s.themeColor},children:["Open arc",e.jsx(C,{className:"size-3.5"})]})]})]},s.id)})]})]}),e.jsx(B,{open:f,pending:c,editingGoal:a,tags:r,users:o,defaultUserId:d,onOpenChange:s=>{m(s),s||u(null)},onSubmit:async(s,x)=>{if(x){await v(x,s);return}await n(s)}})]})}function $({eyebrow:t,title:r,description:o,meta:d,actions:c,className:n}){return e.jsxs("div",{className:N("flex flex-wrap items-start justify-between gap-3",n),children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[t?e.jsx("div",{className:"font-label text-[11px] uppercase tracking-[0.18em] text-[var(--ui-ink-faint)]",children:t}):null,e.jsxs("div",{className:N("min-w-0",t&&"mt-2"),children:[e.jsx("div",{className:"min-w-0 text-lg text-[var(--ui-ink-strong)]",children:r}),o?e.jsx("div",{className:"mt-2 text-sm leading-6 text-[var(--ui-ink-soft)]",children:o}):null]})]}),d||c?e.jsxs("div",{className:"flex shrink-0 flex-wrap items-center justify-end gap-2",children:[d,c]}):null]})}function ne(){const t=E(),[r,o]=p.useState("active"),[d,c]=p.useState(null),n=t.snapshot.dashboard.goals.length>0,v=R(t.snapshot.dashboard.projects),f=D(t.snapshot.dashboard.projects,r),m=M(t.selectedUserIds),g=new Map(t.snapshot.dashboard.goals.map(a=>[a.id,f.filter(s=>s.goalId===a.id)])),u=async a=>{c(a);try{await t.patchProject(a,{status:"active"})}finally{c(null)}};return e.jsxs("div",{className:"grid gap-5",children:[e.jsx(S,{entityKind:"goal",title:e.jsx(h,{kind:"goal",label:"Life Goals",variant:"heading",size:"lg"}),titleText:"Life Goals",description:"Life goals are the destinations you care about over the long run. Each one can hold several projects, and those projects turn direction into real work.",badge:`${t.snapshot.dashboard.goals.length} active goals`,actions:n?e.jsxs("div",{className:"inline-flex min-h-10 items-center rounded-full border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-2)] px-4 py-2 text-sm whitespace-nowrap text-[var(--ui-ink-soft)]",children:[t.snapshot.dashboard.projects.length," live project",t.snapshot.dashboard.projects.length===1?"":"s"," ","attached"]}):null}),e.jsx(O,{goals:t.snapshot.dashboard.goals,tags:t.snapshot.tags,users:t.snapshot.users,defaultUserId:m,onCreate:t.createGoal,onUpdate:t.patchGoal}),n?e.jsx(F,{value:r,counts:v,onChange:o}):null,n?null:e.jsx(z,{eyebrow:"Life goals",title:"No life goals yet",description:"Define the first long-horizon direction above so Forge can attach projects, tasks, momentum, and evidence to something meaningful."}),n?e.jsx("div",{className:"grid gap-4",children:t.snapshot.dashboard.goals.map(a=>{const s=g.get(a.id)??[],x=L(t.snapshot.dashboard.notesSummaryByEntity,"goal",a.id);return e.jsx(b,{to:`/goals/${a.id}`,className:"min-w-0 overflow-hidden rounded-[28px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-1)] p-4 transition hover:bg-[var(--ui-surface-hover)] sm:p-5",children:e.jsxs("div",{className:"grid gap-4 xl:grid-cols-[minmax(0,1.15fr)_minmax(0,0.85fr)] xl:gap-5",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs(I,{children:[a.tags.slice(0,3).map(i=>e.jsx(l,{className:"bg-[var(--ui-surface-2)]",style:{color:i.color},children:i.name},i.id)),e.jsx(l,{className:"bg-[var(--ui-surface-2)] text-[var(--ui-ink-soft)]",children:a.horizon}),e.jsx(U,{user:a.user,compact:!0})]}),e.jsx("div",{className:"mt-4",children:e.jsx(h,{kind:"goal",label:a.title,variant:"heading",size:"xl",lines:2})}),e.jsx("p",{className:"mt-3 max-w-2xl text-sm leading-7 text-[var(--ui-ink-soft)]",children:a.description}),e.jsxs("div",{className:"mt-4 grid gap-3 sm:grid-cols-3",children:[e.jsxs("div",{className:"rounded-[18px] bg-[var(--ui-surface-2)] px-3.5 py-3",children:[e.jsx("div",{className:"font-label text-[11px] uppercase tracking-[0.16em] text-[var(--ui-ink-faint)]",children:"Progress"}),e.jsxs("div",{className:"mt-2 text-xl text-[var(--ui-ink-strong)]",children:[a.progress,"%"]})]}),e.jsxs("div",{className:"rounded-[18px] bg-[var(--ui-surface-2)] px-3.5 py-3",children:[e.jsx("div",{className:"font-label text-[11px] uppercase tracking-[0.16em] text-[var(--ui-ink-faint)]",children:"Tasks done"}),e.jsxs("div",{className:"mt-2 text-xl text-[var(--ui-ink-strong)]",children:[a.completedTasks,"/",Math.max(a.totalTasks,1)]})]}),e.jsxs("div",{className:"rounded-[18px] bg-[var(--ui-surface-2)] px-3.5 py-3",children:[e.jsx("div",{className:"font-label text-[11px] uppercase tracking-[0.16em] text-[var(--ui-ink-faint)]",children:"XP banked"}),e.jsx("div",{className:"mt-2 text-xl text-[var(--ui-ink-strong)]",children:a.earnedPoints})]})]}),e.jsx("div",{className:"mt-4",children:e.jsx(T,{value:a.progress})}),e.jsx("div",{className:"mt-4",children:e.jsx(G,{entityType:"goal",entityId:a.id,count:x.count})})]}),e.jsxs("div",{className:"min-w-0 rounded-[24px] bg-[var(--ui-surface-2)] p-4",children:[e.jsx($,{title:"Projects carrying this direction",meta:e.jsx("div",{className:"shrink-0 text-sm text-[var(--ui-ink-faint)]",children:s.length}),className:"gap-2"}),s.length===0?e.jsx("div",{className:"mt-4 text-sm leading-6 text-[var(--ui-ink-soft)]",children:r==="active"?"No active project is attached yet. Create one so this direction starts producing visible work.":"No projects in this lifecycle view are attached yet. Switch filters or restart one to bring it back into active motion."}):e.jsx("div",{className:"mt-4 grid gap-3",children:s.slice(0,3).map(i=>e.jsxs("div",{className:"rounded-[18px] bg-[var(--ui-surface-hover)] px-4 py-4",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[e.jsx(w,{kind:"project",compact:!0,gradient:!1}),e.jsx(h,{kind:"project",label:i.title,className:"min-w-0",showIcon:!1,lines:2})]}),e.jsx(l,{className:"shrink-0",children:i.status})]}),e.jsx("div",{className:"mt-2 text-sm leading-6 text-[var(--ui-ink-soft)]",children:i.description}),e.jsxs("div",{className:"mt-3 text-sm text-[var(--ui-ink-faint)]",children:["Next move:"," ",i.nextTaskTitle??"Define the first attached task"]}),r!=="active"&&i.status!=="active"?e.jsx("div",{className:"mt-4 flex justify-end",children:e.jsx(y,{variant:"secondary",size:"sm",pending:d===i.id,pendingLabel:"Restarting…",onClick:j=>{j.preventDefault(),j.stopPropagation(),u(i.id)},children:"Restart"})}):null]},i.id))})]})]})},a.id)})}):e.jsx(k,{children:e.jsx("div",{className:"rounded-[20px] bg-[var(--ui-surface-2)] p-4 text-sm text-[var(--ui-ink-soft)]",children:"Goal cards will appear here once the first long-horizon direction is created."})})]})}export{ne as GoalsPage};