maestro-flow 0.3.7 → 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 (104) hide show
  1. package/.claude/commands/learn-retro.md +303 -0
  2. package/.claude/commands/maestro-execute.md +3 -2
  3. package/.claude/commands/maestro-learn.md +74 -298
  4. package/.claude/commands/manage-learn.md +21 -15
  5. package/.claude/commands/manage-memory-capture.md +13 -15
  6. package/.claude/commands/manage-memory.md +1 -1
  7. package/.claude/commands/quality-retrospective.md +5 -5
  8. package/.claude/commands/spec-load.md +7 -2
  9. package/.claude/commands/wiki-digest.md +27 -2
  10. package/README.md +103 -220
  11. package/README.zh-CN.md +159 -181
  12. package/dashboard/dist/assets/{ArtifactsPage-A9yzYtpj.js → ArtifactsPage-BmPOu8sO.js} +1 -1
  13. package/dashboard/dist/assets/{ChatInput-PuCvZZ3y.js → ChatInput-CL8YDfOU.js} +1 -1
  14. package/dashboard/dist/assets/ChatPage-CT-ozBK2.js +8 -0
  15. package/dashboard/dist/assets/{CollabPage-I5k_mCbG.js → CollabPage-C0rWMden.js} +1 -1
  16. package/dashboard/dist/assets/{KanbanPage-PDDBv5-9.js → KanbanPage-C6WbAlwI.js} +1 -1
  17. package/dashboard/dist/assets/{MarkdownRenderer-CCXHaut3.js → MarkdownRenderer-BjZ43aSa.js} +1 -1
  18. package/dashboard/dist/assets/{McpPage-CiqXpCHg.js → McpPage-BPIXADQi.js} +1 -1
  19. package/dashboard/dist/assets/{RequirementBoardPage-CEOvppGn.js → RequirementBoardPage-B7yRL0s_.js} +1 -1
  20. package/dashboard/dist/assets/{RequirementPage-DpnbTEqY.js → RequirementPage-D8J_-b6O.js} +1 -1
  21. package/dashboard/dist/assets/{SpecsPage-CYqOfFkB.js → SpecsPage-6lO8v8_C.js} +1 -1
  22. package/dashboard/dist/assets/{SupervisorPage-B2sZwkq8.js → SupervisorPage-Ds5N378a.js} +1 -1
  23. package/dashboard/dist/assets/{TeamsPage-CkZdCAVZ.js → TeamsPage-DrkKr17T.js} +1 -1
  24. package/dashboard/dist/assets/{TreeBrowser-0VIMWclo.js → TreeBrowser-g_QUKemL.js} +1 -1
  25. package/dashboard/dist/assets/WorkflowPage-X8aNkDEr.js +6 -0
  26. package/dashboard/dist/assets/{arrow-left-6fktHyjN.js → arrow-left-CadP5YgU.js} +1 -1
  27. package/dashboard/dist/assets/{check-Cbxq2l1-.js → check-5xufDzS8.js} +1 -1
  28. package/dashboard/dist/assets/{chevron-right-Yts3bi8p.js → chevron-right-CYbpR4ev.js} +1 -1
  29. package/dashboard/dist/assets/{circle-4Ci4Xolf.js → circle-Bm-5Q-Yh.js} +1 -1
  30. package/dashboard/dist/assets/{circle-alert-B25g9BTL.js → circle-alert-BqcYuT7x.js} +1 -1
  31. package/dashboard/dist/assets/{circle-check-BA5_XqeV.js → circle-check-DEVzW_lm.js} +1 -1
  32. package/dashboard/dist/assets/{circle-check-big-DzO2BlL7.js → circle-check-big-yyzAFysU.js} +1 -1
  33. package/dashboard/dist/assets/{code-zxwuybO8.js → code-BBdC8Wmw.js} +1 -1
  34. package/dashboard/dist/assets/{columns-3-DV4oeCfU.js → columns-3-CQ9Trztr.js} +1 -1
  35. package/dashboard/dist/assets/{download-CXCyQw8M.js → download-DayuF-sn.js} +1 -1
  36. package/dashboard/dist/assets/{folder-Bvjj8Vn9.js → folder-CqXeSKeC.js} +1 -1
  37. package/dashboard/dist/assets/{git-branch-DL8p9kVC.js → git-branch-SqFf4Ru5.js} +1 -1
  38. package/dashboard/dist/assets/{index-BvScJmJM.js → index-Dru5HYy0.js} +1 -1
  39. package/dashboard/dist/assets/{index-11DuhKhc.js → index-nufWop4p.js} +18 -18
  40. package/dashboard/dist/assets/{list-Dj4i9N75.js → list-DBOD6IUt.js} +1 -1
  41. package/dashboard/dist/assets/{minus-DwlFabsT.js → minus-fQI1Syn2.js} +1 -1
  42. package/dashboard/dist/assets/{pen-line-D7UzECt6.js → pen-line-Bkbbngl5.js} +1 -1
  43. package/dashboard/dist/assets/{proxy-B9XRqHD9.js → proxy-teW12DdZ.js} +1 -1
  44. package/dashboard/dist/assets/{search-BQbBTIYl.js → search-Bq3ygFUW.js} +1 -1
  45. package/dashboard/dist/assets/{shallow-Clb1Lyd_.js → shallow-22ZN8sFt.js} +1 -1
  46. package/dashboard/dist/assets/{table-BqxCXid2.js → table-BEYtdWc4.js} +1 -1
  47. package/dashboard/dist/assets/{trash-2-6rN9B-EQ.js → trash-2-DMqGBgcF.js} +1 -1
  48. package/dashboard/dist/assets/{wrench-BScEJFqC.js → wrench-B84-zdLI.js} +1 -1
  49. package/dashboard/dist/assets/{zap-DxUhG-gk.js → zap-9DVkGVtt.js} +1 -1
  50. package/dashboard/dist/index.html +1 -1
  51. package/dashboard/dist-server/dashboard/src/server/agents/agent-sdk-adapter.d.ts +1 -1
  52. package/dashboard/dist-server/dashboard/src/server/agents/agent-sdk-adapter.js +5 -4
  53. package/dashboard/dist-server/dashboard/src/server/agents/agent-sdk-adapter.js.map +1 -1
  54. package/dashboard/dist-server/dashboard/src/server/agents/tools/issue-mcp-server.d.ts +1 -1
  55. package/dashboard/dist-server/dashboard/src/server/agents/tools/issue-mcp-server.js +3 -4
  56. package/dashboard/dist-server/dashboard/src/server/agents/tools/issue-mcp-server.js.map +1 -1
  57. package/dashboard/dist-server/dashboard/src/server/agents/tools/issue-mcp-server.test.js +4 -4
  58. package/dashboard/dist-server/dashboard/src/server/agents/tools/issue-mcp-server.test.js.map +1 -1
  59. package/dashboard/dist-server/dashboard/src/server/commander/commander-agent.js +4 -3
  60. package/dashboard/dist-server/dashboard/src/server/commander/commander-agent.js.map +1 -1
  61. package/dashboard/dist-server/dashboard/src/server/commander/commander-agent.test.js +20 -7
  62. package/dashboard/dist-server/dashboard/src/server/commander/commander-agent.test.js.map +1 -1
  63. package/dashboard/dist-server/dashboard/src/server/execution/wave-executor.d.ts +1 -1
  64. package/dashboard/dist-server/dashboard/src/server/execution/wave-executor.js +4 -4
  65. package/dashboard/dist-server/dashboard/src/server/execution/wave-executor.js.map +1 -1
  66. package/dashboard/dist-server/dashboard/src/server/index.js +2 -1
  67. package/dashboard/dist-server/dashboard/src/server/index.js.map +1 -1
  68. package/dashboard/dist-server/dashboard/src/server/routes/issues.js +14 -14
  69. package/dashboard/dist-server/dashboard/src/server/routes/issues.js.map +1 -1
  70. package/dashboard/dist-server/dashboard/src/server/routes/linear.js +7 -5
  71. package/dashboard/dist-server/dashboard/src/server/routes/linear.js.map +1 -1
  72. package/dashboard/dist-server/dashboard/src/server/state/state-manager.js +144 -23
  73. package/dashboard/dist-server/dashboard/src/server/state/state-manager.js.map +1 -1
  74. package/dashboard/dist-server/dashboard/src/server/utils/issue-store.d.ts +6 -0
  75. package/dashboard/dist-server/dashboard/src/server/utils/issue-store.js +24 -2
  76. package/dashboard/dist-server/dashboard/src/server/utils/issue-store.js.map +1 -1
  77. package/dashboard/dist-server/dashboard/src/server/ws/handlers/execution-handler.js +4 -7
  78. package/dashboard/dist-server/dashboard/src/server/ws/handlers/execution-handler.js.map +1 -1
  79. package/dashboard/dist-server/dashboard/src/shared/constants.js +2 -1
  80. package/dashboard/dist-server/dashboard/src/shared/constants.js.map +1 -1
  81. package/dashboard/dist-server/dashboard/src/shared/constants.test.js +5 -5
  82. package/dashboard/dist-server/dashboard/src/shared/constants.test.js.map +1 -1
  83. package/dashboard/dist-server/dashboard/src/shared/issue-types.test.js +4 -4
  84. package/dashboard/dist-server/dashboard/src/shared/issue-types.test.js.map +1 -1
  85. package/dashboard/dist-server/src/commands/delegate.js +7 -1
  86. package/dashboard/dist-server/src/commands/delegate.js.map +1 -1
  87. package/dist/src/commands/delegate.d.ts.map +1 -1
  88. package/dist/src/commands/delegate.js +7 -1
  89. package/dist/src/commands/delegate.js.map +1 -1
  90. package/package.json +1 -1
  91. package/workflows/delegate-usage.md +39 -41
  92. package/workflows/execute.md +154 -34
  93. package/workflows/init.md +1 -1
  94. package/workflows/maestro-coordinate.codex.md +1 -1
  95. package/workflows/maestro-coordinate.md +1 -1
  96. package/workflows/maestro.md +2 -2
  97. package/workflows/memory.md +2 -1
  98. package/workflows/plan.md +9 -2
  99. package/workflows/retrospective.md +2 -2
  100. package/workflows/roadmap.md +1 -1
  101. package/.claude/commands/learn-retro-decision.md +0 -198
  102. package/.claude/commands/learn-retro-git.md +0 -160
  103. package/dashboard/dist/assets/ChatPage-v19GURYH.js +0 -8
  104. package/dashboard/dist/assets/WorkflowPage-Csm23wUS.js +0 -6
@@ -0,0 +1,6 @@
1
+ import{d as K,j as e,S as m,a as w,r as f,c as H,L as S,V as J,b as X,p as Y}from"./index-nufWop4p.js";import{u as Z}from"./shallow-22ZN8sFt.js";import{u as T,S as I,P as E,T as ee,D as te,K as se}from"./table-BEYtdWc4.js";import{C as $}from"./check-5xufDzS8.js";import{L as U}from"./list-DBOD6IUt.js";import{C as L}from"./circle-check-DEVzW_lm.js";import{C as ae}from"./circle-alert-BqcYuT7x.js";import{C as re}from"./columns-3-CQ9Trztr.js";/**
2
+ * @license lucide-react v0.577.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const ne=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],ie=K("play",ne),W=[{status:"pending",label:"Pending"},{status:"exploring",label:"Exploring"},{status:"planning",label:"Planning"},{status:"executing",label:"Executing"},{status:"verifying",label:"Verifying"},{status:"completed",label:"Complete"}];function oe(t,s){return s==="completed"?t.filter(a=>a.status==="completed").length:s==="verifying"?t.filter(a=>a.status==="verifying"||a.status==="testing").length:s==="pending"?t.filter(a=>a.status==="pending"||a.status==="not_started").length:t.filter(a=>a.status===s).length}function le({phases:t}){return e.jsx("div",{className:"flex items-center px-[var(--spacing-4)] py-[var(--spacing-3)] border-b border-border-divider bg-bg-primary shrink-0 gap-0 overflow-x-auto",children:W.map((s,a)=>{const r=oe(t,s.status),n=m[s.status];return e.jsxs("div",{className:"contents",children:[e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] px-[var(--spacing-3-5)] py-[var(--spacing-1-5)] text-[length:var(--font-size-xs)] font-[var(--font-weight-semibold)] text-text-tertiary",children:[e.jsx("span",{className:"inline-block w-2 h-2 rounded-full shrink-0",style:{backgroundColor:n}}),s.label,e.jsx("span",{className:"text-[10px] font-[var(--font-weight-semibold)] px-[var(--spacing-1-5)] py-px rounded-full bg-bg-secondary text-text-tertiary font-mono",children:r})]}),a<W.length-1&&e.jsx("div",{className:"relative w-5 h-px bg-border shrink-0",children:e.jsx("div",{className:"absolute -right-px -top-[3px] border-[3px] border-transparent border-l-[4px] border-l-border"})})]},s.status)})})}const _={feat:{bg:"rgba(74,144,217,0.12)",text:"var(--color-status-exploring)"},feature:{bg:"rgba(74,144,217,0.12)",text:"var(--color-status-exploring)"},fix:{bg:"rgba(208,84,84,0.12)",text:"var(--color-status-blocked)"},refac:{bg:"rgba(139,107,191,0.12)",text:"var(--color-status-planning)"},refactor:{bg:"rgba(139,107,191,0.12)",text:"var(--color-status-planning)"},docs:{bg:"rgba(160,157,151,0.12)",text:"var(--color-status-pending)"},test:{bg:"rgba(91,141,184,0.12)",text:"var(--color-status-testing)"}},O={in_progress:{bg:"rgba(201,155,45,0.1)",text:"var(--color-status-executing)"},running:{bg:"rgba(201,155,45,0.1)",text:"var(--color-status-executing)"},pending:{bg:"rgba(160,157,151,0.1)",text:"var(--color-status-pending)"},queued:{bg:"rgba(160,157,151,0.1)",text:"var(--color-status-pending)"},completed:{bg:"rgba(61,155,111,0.1)",text:"var(--color-status-completed)"},done:{bg:"rgba(61,155,111,0.1)",text:"var(--color-status-completed)"},failed:{bg:"rgba(208,84,84,0.1)",text:"var(--color-status-blocked)"}},ce={in_progress:"Running",running:"Running",pending:"Queued",queued:"Queued",completed:"Done",done:"Done",failed:"Failed"};function B(t){return{feature:"feat",refactor:"refac"}[t]??t}function de({task:t}){const s=_[t.type]??_[B(t.type)]??_.feat,a=O[t.status]??O.pending,r=ce[t.status]??t.status;return e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] px-[var(--spacing-2-5)] py-[var(--spacing-1-5)] rounded-[var(--radius-default)] bg-bg-card text-[length:var(--font-size-xs)] cursor-pointer transition-colors duration-[var(--duration-fast)] hover:bg-bg-hover",children:[e.jsx("span",{className:"font-mono text-[length:10px] text-text-tertiary min-w-[60px] shrink-0",children:t.id}),e.jsx("span",{className:"text-[length:9px] font-[var(--font-weight-semibold)] uppercase px-[7px] py-[2px] rounded-full shrink-0",style:{backgroundColor:s.bg,color:s.text},children:B(t.type)}),e.jsx("span",{className:"flex-1 text-text-primary whitespace-nowrap overflow-hidden text-ellipsis",children:t.title}),e.jsx("span",{className:"text-[length:10px] font-[var(--font-weight-semibold)] px-[7px] py-[2px] rounded-full shrink-0",style:{backgroundColor:a.bg,color:a.text},children:r})]})}const xe={not_started:"var(--color-tint-pending)",pending:"var(--color-tint-pending)",exploring:"var(--color-tint-exploring)",planning:"var(--color-tint-planning)",executing:"var(--color-tint-executing)",verifying:"var(--color-tint-verifying)",testing:"var(--color-tint-testing)",completed:"var(--color-tint-completed)",blocked:"var(--color-tint-blocked)"};function pe({phase:t,onSelectTask:s,recommendedAdvance:a}){const r=w(g=>g.setSelectedPhase),[n,x]=f.useState(!1),{tasks:i,loading:d}=T(n?t.phase:null),{tasks_completed:p,tasks_total:o,current_wave:c}=t.execution,u=m[t.status],j=t.verification.gaps.length>0,y=t.plan.task_count>0,l=H(g=>g.issues),h=f.useMemo(()=>l.filter(g=>g.phase_id===t.phase),[l,t.phase]),b=h.filter(g=>{var v;return((v=g.execution)==null?void 0:v.status)==="running"}).length;return e.jsxs("div",{children:[e.jsxs("div",{role:"button",tabIndex:0,onClick:()=>r(t.phase),onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),r(t.phase))},className:"rounded-[10px] px-[var(--spacing-3-5)] py-[var(--spacing-3)] cursor-pointer transition-all duration-[var(--duration-normal)] ease-[var(--ease-spring)] hover:-translate-y-0.5 hover:shadow-[0_4px_12px_rgba(0,0,0,0.06)] focus-visible:outline-none focus-visible:shadow-[var(--shadow-focus-ring)]",style:{backgroundColor:xe[t.status]??"var(--color-tint-pending)"},children:[e.jsxs("div",{className:"flex items-center justify-between mb-[var(--spacing-1-5)]",children:[e.jsxs("div",{className:"flex items-center gap-[var(--spacing-1-5)]",children:[y&&e.jsx("button",{type:"button",onClick:g=>{g.stopPropagation(),x(!n)},className:"w-4 h-4 flex items-center justify-center text-text-tertiary hover:text-text-primary transition-colors","aria-label":n?"Collapse tasks":"Expand tasks",children:e.jsx("svg",{className:`w-3 h-3 transition-transform duration-150 ${n?"rotate-90":""}`,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("polyline",{points:"9 18 15 12 9 6"})})}),e.jsx(I,{status:t.status,cardVariant:!0})]}),e.jsxs("span",{className:"text-[length:var(--font-size-xs)] font-mono text-text-tertiary",children:["P-",String(t.phase).padStart(2,"0")]})]}),e.jsx("div",{className:"text-[length:var(--font-size-base)] font-[var(--font-weight-semibold)] text-text-primary mb-[var(--spacing-0-5)]",children:t.title}),t.goal&&e.jsx("p",{className:"text-[12px] text-text-secondary leading-[var(--line-height-normal)] line-clamp-2 mb-[var(--spacing-2)]",children:t.goal}),o>0&&e.jsx(E,{completed:p,total:o,color:u}),t.status==="executing"&&c>0&&e.jsxs("div",{className:"flex items-center gap-[var(--spacing-1-5)] text-[length:var(--font-size-xs)] font-[var(--font-weight-medium)] mt-[var(--spacing-1-5)]",style:{color:u},children:[e.jsx("span",{className:"inline-block w-[5px] h-[5px] rounded-full animate-pulse motion-reduce:animate-none",style:{backgroundColor:u}}),"Wave ",c," active"]}),j&&e.jsxs("div",{className:"inline-flex items-center gap-[var(--spacing-1)] mt-[var(--spacing-1-5)] text-[length:var(--font-size-xs)] font-[var(--font-weight-semibold)] px-[var(--spacing-2)] py-[var(--spacing-0-5)] rounded-full",style:{backgroundColor:"rgba(196, 101, 85, 0.1)",color:"var(--color-status-blocked)"},children:[t.verification.gaps.length," Gap",t.verification.gaps.length>1?"s":""]}),a&&e.jsxs("div",{className:"inline-flex items-center gap-[var(--spacing-1)] mt-[var(--spacing-1-5)] text-[length:var(--font-size-xs)] font-[var(--font-weight-semibold)] px-[var(--spacing-2)] py-[var(--spacing-0-5)] rounded-full",style:{backgroundColor:"rgba(91, 141, 184, 0.1)",color:"var(--color-accent-blue)"},children:[e.jsx("span",{className:"inline-block w-[5px] h-[5px] rounded-full animate-pulse",style:{backgroundColor:"var(--color-accent-blue)"}}),"Advance recommended"]}),b>0&&e.jsxs(S,{to:`/kanban?phase=${t.phase}`,onClick:g=>g.stopPropagation(),className:"inline-flex items-center gap-[var(--spacing-1)] mt-[var(--spacing-1-5)] text-[length:var(--font-size-xs)] font-[var(--font-weight-medium)] px-[var(--spacing-2)] py-[var(--spacing-0-5)] rounded-full no-underline transition-colors hover:opacity-80",style:{backgroundColor:"rgba(184, 149, 64, 0.1)",color:"#B89540"},title:`${b} issue(s) running — view in Kanban`,children:[e.jsx("span",{className:"inline-block w-[5px] h-[5px] rounded-full animate-pulse",style:{backgroundColor:"#B89540"}}),b," running"]}),h.length>0&&b===0&&e.jsxs(S,{to:`/kanban?phase=${t.phase}`,onClick:g=>g.stopPropagation(),className:"inline-flex items-center gap-[var(--spacing-1)] mt-[var(--spacing-1-5)] text-[length:var(--font-size-xs)] font-[var(--font-weight-medium)] px-[var(--spacing-2)] py-[var(--spacing-0-5)] rounded-full no-underline transition-colors hover:opacity-80",style:{backgroundColor:"var(--color-bg-secondary)",color:"var(--color-text-tertiary)",border:"1px solid var(--color-border)"},children:[h.length," issue",h.length>1?"s":""]})]}),n&&e.jsx("div",{className:"mt-[var(--spacing-1)] flex flex-col gap-[var(--spacing-1)]",children:d?e.jsx("div",{className:"text-[length:var(--font-size-xs)] text-text-tertiary px-[var(--spacing-3)] py-[var(--spacing-2)]",children:"Loading tasks..."}):i.length===0?e.jsx("div",{className:"text-[length:var(--font-size-xs)] text-text-tertiary px-[var(--spacing-3)] py-[var(--spacing-2)]",children:"No tasks"}):i.map(g=>e.jsx("div",{onClick:()=>s==null?void 0:s({type:"task",task:g,phaseId:t.phase}),children:e.jsx(de,{task:{id:g.id,title:g.title,type:g.type,status:g.meta.status}})},g.id))})]})}function ge({color:t,phases:s,label:a,onSelectTask:r}){return e.jsxs("div",{className:"flex flex-col min-w-[220px] flex-1 bg-bg-secondary rounded-[12px] overflow-hidden",children:[e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] px-[var(--spacing-3-5)] py-[var(--spacing-2-5)]",children:[e.jsx("span",{className:"inline-block w-2.5 h-2.5 rounded-full shrink-0",style:{backgroundColor:t}}),e.jsx("span",{className:"text-[12px] font-[var(--font-weight-semibold)] text-text-primary",children:a}),e.jsx("span",{className:"text-[length:var(--font-size-xs)] text-text-tertiary bg-bg-card px-[var(--spacing-1-5)] rounded-full",children:s.length})]}),e.jsx("div",{className:"flex-1 overflow-y-auto px-[var(--spacing-2)] pb-[var(--spacing-2)] flex flex-col gap-[var(--spacing-2)]",children:s.map(n=>e.jsx(pe,{phase:n,onSelectTask:r},n.phase))})]})}function ue(){var p;const t=w(o=>o.board),s=(t==null?void 0:t.phases)??[],a=s.filter(o=>o.status==="completed").length,r=s.length,n=s.reduce((o,c)=>o+c.execution.tasks_completed,0),x=s.reduce((o,c)=>o+c.execution.tasks_total,0),i=x>0?Math.round(n/x*100):0,d=((p=t==null?void 0:t.project)==null?void 0:p.current_milestone)??"";return e.jsxs("div",{className:"flex items-center gap-[var(--spacing-5)] px-[var(--spacing-5)] py-[var(--spacing-2)] border-t border-border bg-bg-secondary text-[12px] shrink-0",children:[d&&e.jsx("span",{className:"font-[var(--font-weight-semibold)] text-text-primary",children:d}),e.jsxs("span",{className:"text-text-secondary",children:["Phases: ",e.jsxs("strong",{className:"font-[var(--font-weight-semibold)] text-text-primary",children:[a,"/",r]})," complete"]}),e.jsxs("span",{className:"text-text-secondary",children:["Tasks: ",e.jsxs("strong",{className:"font-[var(--font-weight-semibold)] text-text-primary",children:[n,"/",x]})]}),e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] w-36",children:[e.jsx("div",{className:"flex-1 h-1 rounded-full bg-border overflow-hidden",children:e.jsx("div",{className:"h-full rounded-full transition-[width] duration-500 ease-out",style:{width:`${i}%`,backgroundColor:"var(--color-status-completed)"}})}),e.jsxs("span",{className:"text-[length:var(--font-size-xs)] font-[var(--font-weight-medium)] text-text-secondary font-mono tabular-nums",children:[i,"%"]})]})]})}const P=[{status:"pending",label:"Pending",match:["not_started","pending"]},{status:"exploring",label:"Exploring",match:["exploring"]},{status:"planning",label:"Planning",match:["planning"]},{status:"executing",label:"Executing",match:["executing"]},{status:"verifying",label:"Verifying",match:["verifying","testing"]},{status:"completed",label:"Complete",match:["completed"]}];function me(t){const s=new Map;for(const a of P)s.set(a.status,[]);for(const a of t){const r=P.find(n=>n.match.includes(a.status));r&&s.get(r.status).push(a)}return s}function ve({onSelectTask:t}){const s=w(r=>{var n;return((n=r.board)==null?void 0:n.phases)??[]}),a=f.useMemo(()=>me(s),[s]);return e.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[e.jsx(le,{phases:s}),e.jsx("div",{className:"flex gap-[var(--spacing-2-5)] flex-1 overflow-x-auto px-[var(--spacing-3)] py-[var(--spacing-3)]",children:P.map(r=>e.jsx(ge,{status:r.status,color:m[r.status],label:r.label,phases:a.get(r.status)??[],onSelectTask:t},r.status))}),e.jsx(ue,{})]})}const he=6,fe=Array.from({length:he},(t,s)=>`Week ${s+1}`),R={pending:"var(--color-status-pending)",in_progress:"var(--color-status-executing)",completed:"var(--color-status-completed)",failed:"var(--color-status-blocked)"},be={pending:"Queued",in_progress:"Running",completed:"Done",failed:"Failed"};function je({phaseId:t,onSelectTask:s}){const{tasks:a,loading:r}=T(t);return r?e.jsxs("div",{className:"grid items-center py-[var(--spacing-1)] border-b border-border-divider",style:{gridTemplateColumns:"180px 1fr"},children:[e.jsx("div",{className:"pl-[var(--spacing-6)] text-[length:var(--font-size-xs)] text-text-tertiary",children:"Loading..."}),e.jsx("div",{})]}):a.length===0?null:e.jsx(e.Fragment,{children:a.map(n=>e.jsxs("div",{className:"grid items-center py-[var(--spacing-1)] border-b border-border-divider bg-[rgba(0,0,0,0.02)] cursor-pointer hover:bg-bg-hover transition-colors duration-[var(--duration-fast)]",style:{gridTemplateColumns:"180px 1fr"},onClick:()=>s==null?void 0:s({type:"task",task:n,phaseId:t}),children:[e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] pl-[var(--spacing-6)] text-[length:var(--font-size-xs)]",children:[e.jsx("span",{className:"w-[6px] h-[6px] rounded-full shrink-0",style:{backgroundColor:R[n.meta.status]??"var(--color-status-pending)"}}),e.jsx("span",{className:"font-mono text-[length:10px] text-text-tertiary shrink-0",children:n.id}),e.jsx("span",{className:"text-text-secondary truncate",children:n.title}),e.jsx("span",{className:"ml-auto pr-[var(--spacing-3)] text-[length:10px] font-[var(--font-weight-medium)] shrink-0",style:{color:R[n.meta.status]??"var(--color-text-tertiary)"},children:be[n.meta.status]??n.meta.status})]}),e.jsx("div",{})]},n.id))})}function ye({onSelectPhase:t,onSelectTask:s}){const a=w(l=>l.board),[r,n]=f.useState(new Set);if(!a||a.phases.length===0)return e.jsx("div",{className:"flex items-center justify-center h-full text-text-secondary text-[length:var(--font-size-sm)]",children:"No phases to display"});const x=a.phases,i=x.length,d=x.reduce((l,h)=>l+h.execution.tasks_total,0),p=x.reduce((l,h)=>l+h.execution.tasks_completed,0),o=d>0?Math.round(p/d*100):0,c=x.find(l=>l.status==="executing"),u=c?x.indexOf(c):-1,j=u>=0&&c?(()=>{const l=u/i*100,h=1/i*100,b=c.execution.tasks_total>0?c.execution.tasks_completed/c.execution.tasks_total:0;return l+h*b})():-1;function y(l){n(h=>{const b=new Set(h);return b.has(l)?b.delete(l):b.add(l),b})}return e.jsxs("div",{className:"p-[var(--spacing-4)] h-full overflow-auto",children:[e.jsxs("div",{className:"grid border-b border-border pb-[var(--spacing-2)] mb-[var(--spacing-1)]",style:{gridTemplateColumns:"180px 1fr"},children:[e.jsx("span",{className:"text-[length:11px] font-[var(--font-weight-semibold)] text-text-tertiary uppercase tracking-[0.04em]",children:"Phase"}),e.jsx("div",{className:"flex justify-between",children:fe.map(l=>e.jsx("span",{className:"text-[length:10px] text-text-tertiary",children:l},l))})]}),x.map((l,h)=>{const b=m[l.status],g=h/i*100,v=1/i*100,N=l.execution.tasks_total>0?l.execution.tasks_completed/l.execution.tasks_total:0,G=l.status==="pending"?.5:l.status==="completed"?1:.85,A=l.plan.task_count>0,z=r.has(l.phase);return e.jsxs("div",{children:[e.jsxs("div",{className:"grid items-center py-[var(--spacing-1-5)] border-b border-border-divider cursor-pointer hover:bg-bg-hover transition-colors duration-[var(--duration-fast)]",style:{gridTemplateColumns:"180px 1fr"},onClick:()=>t(l.phase),children:[e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] text-[length:var(--font-size-xs)]",children:[A&&e.jsx("button",{type:"button",onClick:Q=>{Q.stopPropagation(),y(l.phase)},className:"w-4 h-4 flex items-center justify-center text-text-tertiary hover:text-text-primary transition-colors shrink-0","aria-label":z?"Collapse tasks":"Expand tasks",children:e.jsx("svg",{className:`w-3 h-3 transition-transform duration-150 ${z?"rotate-90":""}`,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("polyline",{points:"9 18 15 12 9 6"})})}),!A&&e.jsx("span",{className:"w-4 shrink-0"}),e.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:b}}),e.jsx("span",{className:"font-[var(--font-weight-medium)] text-text-primary truncate",children:l.title}),e.jsxs("span",{className:"ml-auto pr-[var(--spacing-3)] font-mono text-[length:10px] text-text-tertiary",children:[l.execution.tasks_completed,"/",l.execution.tasks_total]})]}),e.jsxs("div",{className:"relative h-7 bg-bg-secondary rounded-[var(--radius-default)] overflow-visible",children:[e.jsxs("div",{className:"absolute top-1 h-5 rounded-[var(--radius-default)] flex items-center px-[var(--spacing-2)] text-[length:10px] font-[var(--font-weight-semibold)] text-white transition-[width] duration-300 ease-[var(--ease-out)]",style:{left:`${g}%`,width:`${v}%`,backgroundColor:b,opacity:G},children:[N>0&&N<1&&e.jsx("div",{className:"absolute top-0 left-0 h-full rounded-[var(--radius-default)] opacity-30 bg-white",style:{width:`${N*100}%`}}),e.jsxs("span",{className:"relative z-[1] whitespace-nowrap",children:["P-",String(l.phase).padStart(2,"0"),N>0&&N<1?` (${Math.round(N*100)}%)`:""]})]}),j>=0&&(c==null?void 0:c.phase)===l.phase&&e.jsx("div",{className:"absolute top-0 bottom-0 w-0.5 bg-[var(--color-status-blocked)] z-[5] rounded-sm",style:{left:`${j}%`},children:e.jsx("span",{className:"absolute -top-[18px] -left-3 text-[length:9px] font-[var(--font-weight-semibold)] text-[var(--color-status-blocked)]",children:"Today"})})]})]}),z&&e.jsx(je,{phaseId:l.phase,onSelectTask:s})]},l.phase)}),e.jsxs("div",{className:"mt-[var(--spacing-5)] pt-[var(--spacing-3)] border-t border-border flex items-center gap-[var(--spacing-5)]",children:[e.jsxs("span",{className:"text-[length:var(--font-size-xs)] text-text-secondary",children:[e.jsx("strong",{className:"font-[var(--font-weight-semibold)] text-text-primary",children:"Overall:"})," ",p,"/",d," tasks complete (",o,"%)"]}),e.jsx("div",{className:"w-[200px]",children:e.jsx(E,{completed:p,total:d})})]})]})}const Ne={not_started:"Pending",pending:"Pending",exploring:"Explore",planning:"Plan",executing:"Execute",verifying:"Verify",testing:"Test",completed:"Done",blocked:"Blocked"};function F(t){return t==="completed"}function q(t){return t==="executing"}function we(t){return F(t)||q(t)?1:t==="verifying"||t==="testing"||t==="planning"?.7:t==="exploring"?.5:.4}function ke({phases:t}){return e.jsx("div",{className:"flex items-center gap-0 px-[var(--spacing-6)] py-[var(--spacing-4)] border-b border-border bg-bg-primary overflow-x-auto shrink-0",children:t.map((s,a)=>{const r=m[s.status],n=F(s.status),x=q(s.status),i=we(s.status);return e.jsxs("div",{className:"contents",children:[e.jsxs("div",{className:"flex flex-col items-center gap-1 shrink-0 cursor-pointer group",children:[e.jsxs("div",{className:"relative w-[42px] h-[42px] rounded-[12px] flex items-center justify-center text-[length:var(--font-size-sm)] font-bold text-white transition-transform duration-200 group-hover:scale-110",style:{backgroundColor:r,opacity:i},children:[n?e.jsx($,{size:18,strokeWidth:2.5}):s.phase,x&&e.jsx("span",{className:"absolute -inset-1 rounded-[14px] border-2 animate-pulse opacity-30",style:{borderColor:r}})]}),e.jsx("span",{className:"text-[10px] font-[var(--font-weight-semibold)] max-w-[80px] text-center truncate text-text-tertiary",style:x?{color:r,fontWeight:700}:void 0,children:s.title}),e.jsx("span",{className:"text-[8px] font-[var(--font-weight-semibold)] uppercase tracking-wide px-[5px] py-px rounded-full",style:{backgroundColor:`color-mix(in srgb, ${r} 12%, transparent)`,color:r},children:Ne[s.status]})]}),a<t.length-1&&e.jsxs("div",{className:"relative w-10 h-0.5 shrink-0 mb-[22px]",children:[e.jsx("div",{className:"absolute inset-0 bg-border"}),n&&e.jsx("div",{className:"absolute top-0 left-0 h-full rounded-sm",style:{width:"100%",backgroundColor:"var(--color-status-completed)"}}),!n&&e.jsx("div",{className:"absolute -right-px -top-[3px] border-[3px] border-transparent border-l-[5px] border-l-border"})]})]},s.phase)})})}const Ce={not_started:"/maestro-analyze {N}",pending:"/maestro-analyze {N}",exploring:"/maestro-plan {N}",planning:"/maestro-execute {N}",executing:"/maestro-execute {N}",verifying:"/quality-review {N}",testing:"/quality-test {N}",completed:"/maestro-phase-transition",blocked:"/quality-debug"};function ze(t){const s=t.filter(a=>a.status!=="completed"&&a.status!=="blocked");return s.length===0?null:s.reduce((a,r)=>r.phase<a.phase?r:a,s[0])}function _e({phase:t}){const[s,a]=f.useState(!1),r=f.useRef(null);if(f.useEffect(()=>()=>{r.current&&clearTimeout(r.current)},[]),!t)return e.jsx("div",{className:"text-[length:var(--font-size-sm)] text-text-tertiary italic text-center py-[var(--spacing-6)]",children:"All phases complete"});const x=(Ce[t.status]??"").replace("{N}",String(t.phase)),i=m[t.status];function d(){navigator.clipboard.writeText(x).then(()=>{a(!0),r.current&&clearTimeout(r.current),r.current=setTimeout(()=>a(!1),2e3)})}return e.jsxs("div",{className:"flex flex-col gap-[var(--spacing-2)]",children:[e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2-5)] mb-[var(--spacing-2)]",children:[e.jsx("div",{className:"w-8 h-8 rounded-[10px] flex items-center justify-center text-[length:var(--font-size-base)] font-bold text-white shrink-0",style:{backgroundColor:i},children:t.phase}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-[length:var(--font-size-sm)] font-bold text-text-primary truncate",children:t.title}),e.jsx("span",{className:"inline-block text-[length:var(--font-size-xs)] font-[var(--font-weight-semibold)] px-[var(--spacing-1-5)] py-px rounded-full mt-px",style:{backgroundColor:`${i}1a`,color:i},children:t.status.replace(/_/g," ").replace(/\b\w/g,p=>p.toUpperCase())})]})]}),e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)]",children:[e.jsx("code",{className:"flex-1 font-mono bg-bg-primary border border-border-divider rounded px-[var(--spacing-1-5)] py-[var(--spacing-0-5)] text-[length:var(--font-size-xs)] text-text-primary truncate",children:x}),e.jsx("button",{type:"button",onClick:d,className:"shrink-0 cursor-pointer text-text-tertiary hover:text-text-primary transition-colors text-[length:var(--font-size-xs)]",children:s?"Copied!":"Copy"})]})]})}function Se(){const t=w(a=>{var r;return((r=a.board)==null?void 0:r.phases)??[]}),s=t.find(a=>a.status==="executing")??null;return e.jsxs("div",{className:"flex flex-col overflow-hidden border-r border-r-border-divider border-b border-b-border-divider",children:[e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] px-[var(--spacing-4)] py-[var(--spacing-2-5)] border-b border-border-divider shrink-0",children:[e.jsx(ie,{size:14,strokeWidth:2,className:"text-text-tertiary"}),e.jsx("span",{className:"text-[length:var(--font-size-xs)] font-[var(--font-weight-semibold)] uppercase tracking-wider text-text-tertiary",children:"Active Execution"}),s&&s.execution.current_wave>0&&e.jsxs("span",{className:"ml-auto text-[length:var(--font-size-xs)] font-[var(--font-weight-semibold)] px-[var(--spacing-1-5)] py-px rounded-full",style:{backgroundColor:"rgba(184, 149, 64, 0.12)",color:m.executing},children:["Wave ",s.execution.current_wave]})]}),e.jsx("div",{className:"flex-1 overflow-y-auto px-[var(--spacing-4)] py-[var(--spacing-3)]",children:s?e.jsx(Pe,{phase:s}):e.jsx(_e,{phase:ze(t)})})]})}function Pe({phase:t}){const{tasks_completed:s,tasks_total:a,current_wave:r}=t.execution,n=a>0?Math.round(s/a*100):0,x=m[t.status];return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2-5)] mb-[var(--spacing-3)]",children:[e.jsx("div",{className:"w-8 h-8 rounded-[10px] flex items-center justify-center text-[length:var(--font-size-base)] font-bold text-white",style:{backgroundColor:x},children:t.phase}),e.jsxs("div",{children:[e.jsx("div",{className:"text-[length:var(--font-size-base)] font-bold text-text-primary",children:t.title}),t.goal&&e.jsx("div",{className:"text-[length:var(--font-size-xs)] text-text-tertiary",children:t.goal})]})]}),e.jsxs("div",{className:"mb-[var(--spacing-3-5)]",children:[e.jsx("div",{className:"h-1.5 bg-border rounded-full overflow-hidden mb-1",children:e.jsx("div",{className:"h-full rounded-full transition-[width] duration-500 ease-out",style:{width:`${n}%`,backgroundColor:"var(--color-status-completed)"}})}),e.jsxs("div",{className:"flex justify-between text-[length:var(--font-size-xs)] text-text-tertiary",children:[e.jsxs("span",{children:[s," of ",a," tasks complete"]}),e.jsxs("span",{children:[n,"%"]})]})]}),r>0&&e.jsxs("div",{className:"text-[length:var(--font-size-xs)] font-[var(--font-weight-semibold)] text-text-secondary mb-[var(--spacing-1-5)]",children:["Wave ",r]}),t.plan.task_ids.length>0&&e.jsx("div",{className:"flex flex-col gap-1",children:t.plan.task_ids.map(i=>e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] px-[var(--spacing-2-5)] py-[var(--spacing-1-5)] rounded-[var(--radius-md)] bg-bg-primary border border-border-divider text-[length:var(--font-size-sm)]",children:[e.jsx("span",{className:"inline-block w-2 h-2 rounded-full shrink-0 bg-text-quaternary"}),e.jsx("span",{className:"flex-1 text-text-primary font-[var(--font-weight-medium)] truncate",children:i}),e.jsx("span",{className:"text-[length:var(--font-size-xs)] font-mono text-text-quaternary",children:i})]},i))})]})}const Te={not_started:"Not Started",pending:"Pending",exploring:"Exploring",planning:"Planning",executing:"Executing",verifying:"Verifying",testing:"Testing",completed:"Completed",blocked:"Blocked"};function Ee(){const t=w(s=>{var a;return((a=s.board)==null?void 0:a.phases)??[]});return e.jsxs("div",{className:"flex flex-col overflow-hidden border-r border-r-border-divider border-b border-border-divider",children:[e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] px-[var(--spacing-4)] py-[var(--spacing-2-5)] border-b border-border-divider shrink-0",children:[e.jsx(U,{size:14,strokeWidth:2,className:"text-text-tertiary"}),e.jsx("span",{className:"text-[length:var(--font-size-xs)] font-[var(--font-weight-semibold)] uppercase tracking-wider text-text-tertiary",children:"Phase Queue"}),e.jsxs("span",{className:"ml-auto text-[length:var(--font-size-xs)] font-[var(--font-weight-semibold)] px-[var(--spacing-1-5)] py-px rounded-full bg-border-subtle text-text-secondary",children:[t.length," phases"]})]}),e.jsx("div",{className:"flex-1 overflow-y-auto px-[var(--spacing-4)] py-[var(--spacing-3)]",children:t.map(s=>{const a=m[s.status],{tasks_completed:r,tasks_total:n,current_wave:x}=s.execution,i=n>0?Math.round(r/n*100):0,d=s.status==="executing",p=s.status==="completed";let o=Te[s.status];return d&&x>0&&(o+=` -- Wave ${x}`),s.verification.gaps.length>0&&(o+=` -- ${s.verification.gaps.length} gap(s)`),e.jsxs("div",{className:["flex items-center gap-[var(--spacing-2-5)] px-[var(--spacing-2-5)] py-[var(--spacing-2)] rounded-[var(--radius-md)] cursor-pointer transition-all duration-150 mb-0.5",d?"bg-[var(--color-tint-executing)]":"hover:bg-bg-primary"].join(" "),children:[e.jsx("div",{className:"w-6 h-6 rounded-[7px] flex items-center justify-center text-[length:var(--font-size-xs)] font-bold text-white shrink-0",style:{backgroundColor:a},children:p?e.jsx($,{size:12,strokeWidth:2.5}):s.phase}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-[length:var(--font-size-sm)] font-[var(--font-weight-semibold)] text-text-primary truncate",children:s.title}),e.jsx("div",{className:"text-[length:var(--font-size-xs)] text-text-tertiary",style:d?{color:a}:void 0,children:o})]}),e.jsxs("div",{className:"text-right shrink-0",children:[e.jsxs("div",{className:"text-[length:var(--font-size-xs)] font-[var(--font-weight-semibold)] font-mono text-text-tertiary",style:p?{color:a}:void 0,children:[r,"/",n]}),e.jsx("div",{className:"w-10 h-[3px] bg-border rounded-full overflow-hidden mt-0.5",children:e.jsx("div",{className:"h-full rounded-full",style:{width:`${i}%`,backgroundColor:a}})})]})]},s.phase)})})]})}function $e(){const t=w(o=>o.board),s=(t==null?void 0:t.phases)??[],a=s.reduce((o,c)=>o+c.execution.tasks_completed,0),r=s.reduce((o,c)=>o+c.execution.tasks_total,0),n=s.filter(o=>o.status==="completed").length,x=s.length,i=s.reduce((o,c)=>o+c.execution.commits.length,0),d=s.filter(o=>o.status==="verifying"||o.status==="testing"),p=s.flatMap(o=>o.verification.gaps.map(c=>({phase:o.phase,text:typeof c=="string"?c:c.description??c.id??JSON.stringify(c)})));return e.jsxs("div",{className:"flex flex-col overflow-hidden border-b border-border-divider",children:[e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] px-[var(--spacing-4)] py-[var(--spacing-2-5)] border-b border-border-divider shrink-0",children:[e.jsx(L,{size:14,strokeWidth:2,className:"text-text-tertiary"}),e.jsx("span",{className:"text-[length:var(--font-size-xs)] font-[var(--font-weight-semibold)] uppercase tracking-wider text-text-tertiary",children:"Quality"})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto px-[var(--spacing-4)] py-[var(--spacing-3)]",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-[var(--spacing-2)] mb-[var(--spacing-3-5)]",children:[e.jsx(C,{label:"Tasks",value:a,sub:`/${r}`,detail:`${r>0?Math.round(a/r*100):0}% complete`}),e.jsx(C,{label:"Phases",value:n,sub:`/${x}`,detail:`${x>0?Math.round(n/x*100):0}% complete`}),e.jsx(C,{label:"Gaps",value:p.length,color:p.length>0?m.blocked:void 0,detail:"active"}),e.jsx(C,{label:"Commits",value:i,detail:"this milestone"})]}),d.length>0&&e.jsx("div",{className:"mb-[var(--spacing-3-5)]",children:d.map(o=>e.jsxs("div",{className:"mb-[var(--spacing-3)]",children:[e.jsxs("div",{className:"flex items-center gap-[var(--spacing-1-5)] text-[length:var(--font-size-xs)] font-[var(--font-weight-semibold)] text-text-secondary mb-[var(--spacing-1-5)]",children:[e.jsx(L,{size:12,strokeWidth:2,style:{color:m[o.status]}}),"Verification (P-",String(o.phase).padStart(2,"0"),")"]}),o.verification.must_haves.map((c,u)=>{const y=o.verification.gaps.map(l=>typeof l=="string"?l:l.description??l.id??"").includes(c);return e.jsxs("div",{className:"flex items-center gap-[var(--spacing-1-5)] py-1 border-b border-border-divider text-[length:var(--font-size-sm)]",children:[y?e.jsx(ae,{size:12,strokeWidth:2.5,style:{color:m.blocked}}):e.jsx($,{size:12,strokeWidth:2.5,style:{color:m.completed}}),e.jsx("span",{className:"flex-1 text-text-secondary",children:c}),e.jsx("span",{className:"text-[length:var(--font-size-xs)] font-[var(--font-weight-semibold)]",style:{color:y?m.blocked:m.completed},children:y?"Gap":"Verified"})]},u)})]},o.phase))}),s.some(o=>o.validation.test_coverage!==null)&&e.jsxs("div",{children:[e.jsx("div",{className:"flex items-center gap-[var(--spacing-1-5)] text-[length:var(--font-size-xs)] font-[var(--font-weight-semibold)] text-text-secondary mb-[var(--spacing-1-5)]",children:"Test Coverage"}),s.filter(o=>o.validation.test_coverage!==null).map(o=>{const c=o.validation.test_coverage,u=typeof c=="number"?c:typeof c=="object"&&c!==null?c.statements??0:0,j=u>=80?m.completed:u>=60?m.executing:m.verifying;return e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] text-[length:var(--font-size-xs)] mb-1",children:[e.jsxs("span",{className:"w-[70px] text-text-tertiary font-[var(--font-weight-medium)]",children:["P-",String(o.phase).padStart(2,"0")]}),e.jsx("div",{className:"flex-1 h-1.5 bg-border rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full rounded-full",style:{width:`${u}%`,backgroundColor:j}})}),e.jsxs("span",{className:"w-9 text-right font-mono font-[var(--font-weight-semibold)] text-text-secondary",children:[u.toFixed(1),"%"]})]},o.phase)})]})]})]})}function C({label:t,value:s,sub:a,detail:r,color:n}){return e.jsxs("div",{className:"px-[var(--spacing-3)] py-[var(--spacing-2-5)] rounded-[10px] bg-bg-primary border border-border-divider",children:[e.jsx("div",{className:"text-[length:var(--font-size-xs)] font-[var(--font-weight-semibold)] uppercase tracking-wide text-text-tertiary mb-1",children:t}),e.jsxs("div",{className:"text-[length:var(--font-size-xl)] font-bold text-text-primary",style:n?{color:n}:void 0,children:[s,a&&e.jsx("span",{className:"text-[length:var(--font-size-sm)] font-[var(--font-weight-medium)] text-text-tertiary",children:a})]}),e.jsx("div",{className:"text-[length:var(--font-size-xs)] text-text-tertiary mt-0.5",children:r})]})}function Ae(t){const s=[];for(const a of t){const r=m[a.status],n=`P-${String(a.phase).padStart(2,"0")} ${a.title}`;a.status==="executing"&&a.execution.current_wave>0&&s.push({color:r,time:"",text:`Wave ${a.execution.current_wave} active -- ${n}`}),a.status==="verifying"&&a.verification.gaps.length>0&&s.push({color:m.blocked,time:"",text:`${a.verification.gaps.length} gap(s) -- ${n}`}),a.status==="completed"&&s.push({color:r,time:"",text:`Completed -- ${n}`})}return s.slice(0,6)}function Le(){const t=w(a=>{var r;return((r=a.board)==null?void 0:r.phases)??[]}),s=Ae(t);return s.length===0?null:e.jsxs("div",{className:"col-span-full flex items-center gap-[var(--spacing-4)] px-[var(--spacing-4)] py-[var(--spacing-2)] border-t border-border bg-bg-secondary overflow-x-auto shrink-0",children:[e.jsx("span",{className:"text-[length:var(--font-size-xs)] font-[var(--font-weight-semibold)] uppercase tracking-wider text-text-quaternary whitespace-nowrap",children:"Activity"}),s.map((a,r)=>e.jsxs("span",{className:"flex items-center gap-[var(--spacing-1-5)] text-[length:var(--font-size-xs)] text-text-secondary whitespace-nowrap shrink-0",children:[e.jsx("span",{className:"inline-block w-[5px] h-[5px] rounded-full shrink-0",style:{backgroundColor:a.color}}),a.text,r<s.length-1&&e.jsx("span",{className:"inline-block w-px h-3.5 bg-border-divider ml-[var(--spacing-4)]"})]},r))]})}function We(){const t=w(s=>{var a;return((a=s.board)==null?void 0:a.phases)??[]});return e.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[e.jsx(ke,{phases:t}),e.jsxs("div",{className:"flex-1 grid grid-cols-[1fr_1fr_320px] grid-rows-[1fr_auto] overflow-hidden",children:[e.jsx(Se,{}),e.jsx(Ee,{}),e.jsx($e,{}),e.jsx(Le,{})]})]})}const k="text-left px-[var(--spacing-3)] py-[var(--spacing-2)] text-[length:var(--font-size-xs)] font-[var(--font-weight-semibold)] text-text-tertiary uppercase tracking-wide",M={pending:"var(--color-status-pending)",in_progress:"var(--color-status-executing)",completed:"var(--color-status-completed)",failed:"var(--color-status-blocked)"},Oe={pending:"Queued",in_progress:"Running",completed:"Done",failed:"Failed"};function Be({phaseId:t,onSelectTask:s}){const{tasks:a,loading:r}=T(t);return r?e.jsx("tr",{children:e.jsx("td",{colSpan:6,className:"px-[var(--spacing-6)] py-[var(--spacing-2)] text-[length:var(--font-size-xs)] text-text-tertiary",children:"Loading tasks..."})}):a.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:6,className:"px-[var(--spacing-6)] py-[var(--spacing-2)] text-[length:var(--font-size-xs)] text-text-tertiary",children:"No tasks"})}):e.jsx(e.Fragment,{children:a.map(n=>e.jsxs("tr",{className:"bg-[rgba(0,0,0,0.03)] border-t border-border-divider cursor-pointer hover:bg-bg-hover transition-colors",onClick:()=>s==null?void 0:s({type:"task",task:n,phaseId:t}),children:[e.jsx("td",{className:"px-[var(--spacing-3)] py-[var(--spacing-2)] pl-[var(--spacing-6)]",children:e.jsx("span",{className:"inline-block w-2 h-2 rounded-full",style:{backgroundColor:M[n.meta.status]??"var(--color-status-pending)"}})}),e.jsx("td",{className:"px-[var(--spacing-3)] py-[var(--spacing-2)] text-[length:var(--font-size-xs)] font-mono text-text-tertiary",children:n.id}),e.jsx("td",{colSpan:2,className:"px-[var(--spacing-3)] py-[var(--spacing-2)] text-[length:var(--font-size-xs)] text-text-primary",children:n.title}),e.jsx("td",{className:"px-[var(--spacing-3)] py-[var(--spacing-2)] text-center hidden sm:table-cell",children:e.jsxs("span",{className:"text-[length:10px] text-text-tertiary tabular-nums",children:["W",n.meta.wave]})}),e.jsx("td",{className:"px-[var(--spacing-3)] py-[var(--spacing-2)] text-right hidden sm:table-cell",children:e.jsx("span",{className:"text-[length:10px] font-[var(--font-weight-medium)]",style:{color:M[n.meta.status]??"var(--color-text-tertiary)"},children:Oe[n.meta.status]??n.meta.status})})]},n.id))})}function Re({onSelectTask:t}){const s=w(i=>{var d;return((d=i.board)==null?void 0:d.phases)??[]}),[a,r]=f.useState(new Set),n=f.useMemo(()=>[...s].sort((i,d)=>i.phase-d.phase),[s]);function x(i){r(d=>{const p=new Set(d);return p.has(i)?p.delete(i):p.add(i),p})}return n.length===0?e.jsx("div",{className:"flex items-center justify-center h-full text-text-secondary text-[length:var(--font-size-sm)]",children:"No phases available"}):e.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[e.jsxs("div",{className:"flex items-center gap-[var(--spacing-3)] px-[var(--spacing-4)] py-[var(--spacing-2-5)] border-b border-border-divider shrink-0 bg-bg-secondary",children:[e.jsx("span",{className:"text-[length:var(--font-size-xs)] font-[var(--font-weight-semibold)] text-text-primary",children:"All Phases"}),e.jsx("span",{className:"text-[length:var(--font-size-xs)] text-text-tertiary bg-bg-card rounded-full px-[var(--spacing-1-5)] tabular-nums",children:n.length}),e.jsx("div",{className:"ml-auto flex items-center gap-[var(--spacing-3)]",children:["executing","verifying","planning","completed"].map(i=>{const d=n.filter(p=>p.status===i||i==="verifying"&&p.status==="testing").length;return d===0?null:e.jsxs("div",{className:"flex items-center gap-[var(--spacing-1)]",children:[e.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:m[i]}}),e.jsx("span",{className:"text-[length:10px] text-text-secondary tabular-nums",children:d})]},i)})})]}),e.jsx("div",{className:"flex-1 overflow-auto",children:e.jsxs("table",{className:"w-full border-collapse",children:[e.jsx("thead",{className:"sticky top-0 z-10",children:e.jsxs("tr",{className:"bg-bg-secondary border-b border-border-divider",children:[e.jsx("th",{className:`${k} w-[60px]`,children:"#"}),e.jsx("th",{className:`${k} w-[120px]`,children:"Status"}),e.jsx("th",{className:k,children:"Title"}),e.jsx("th",{className:`${k} hidden lg:table-cell`,children:"Goal"}),e.jsx("th",{className:`${k} w-[60px] text-center hidden sm:table-cell`,children:"Wave"}),e.jsx("th",{className:`${k} text-right w-[130px] hidden sm:table-cell`,children:"Progress"})]})}),e.jsx("tbody",{children:n.map((i,d)=>{const{tasks_completed:p,tasks_total:o,current_wave:c}=i.execution,u=a.has(i.phase),j=i.plan.task_count>0;return e.jsxs(f.Fragment,{children:[e.jsxs("tr",{className:["border-t border-border-divider transition-colors",d%2===0?"bg-bg-primary":"bg-[rgba(0,0,0,0.015)]"].join(" "),children:[e.jsx("td",{className:"px-[var(--spacing-3)] py-[var(--spacing-2-5)] text-[length:var(--font-size-xs)] font-mono text-text-tertiary whitespace-nowrap",children:e.jsxs("div",{className:"flex items-center gap-[var(--spacing-1)]",children:[j&&e.jsx("button",{type:"button",onClick:()=>x(i.phase),className:"w-4 h-4 flex items-center justify-center text-text-tertiary hover:text-text-primary transition-colors","aria-label":u?"Collapse tasks":"Expand tasks",children:e.jsx("svg",{className:`w-3 h-3 transition-transform duration-150 ${u?"rotate-90":""}`,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("polyline",{points:"9 18 15 12 9 6"})})}),"P-",String(i.phase).padStart(2,"0")]})}),e.jsx("td",{className:"px-[var(--spacing-3)] py-[var(--spacing-2-5)]",children:e.jsx(I,{status:i.status,cardVariant:!0})}),e.jsx("td",{className:"px-[var(--spacing-3)] py-[var(--spacing-2-5)] text-[length:var(--font-size-sm)] font-[var(--font-weight-medium)] text-text-primary",children:i.title}),e.jsx("td",{className:"px-[var(--spacing-3)] py-[var(--spacing-2-5)] text-[length:var(--font-size-xs)] text-text-secondary hidden lg:table-cell max-w-[320px]",children:e.jsx("span",{className:"line-clamp-1",children:i.goal})}),e.jsx("td",{className:"px-[var(--spacing-3)] py-[var(--spacing-2-5)] text-center hidden sm:table-cell",children:i.status==="executing"&&c>0?e.jsxs("span",{className:"text-[length:10px] font-[var(--font-weight-semibold)] tabular-nums",style:{color:m.executing},children:["W",c]}):e.jsx("span",{className:"text-[length:var(--font-size-xs)] text-text-tertiary",children:"—"})}),e.jsx("td",{className:"px-[var(--spacing-3)] py-[var(--spacing-2-5)] hidden sm:table-cell",children:o>0?e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] justify-end",children:[e.jsx("div",{className:"w-[56px]",children:e.jsx(E,{completed:p,total:o,color:m[i.status]})}),e.jsxs("span",{className:"text-[length:10px] text-text-tertiary tabular-nums w-[32px] text-right shrink-0",children:[p,"/",o]})]}):e.jsx("span",{className:"text-[length:var(--font-size-xs)] text-text-tertiary block text-right",children:"—"})})]}),u&&e.jsx(Be,{phaseId:i.phase,onSelectTask:t})]},i.phase)})})]})})]})}const D=[{id:"init",label:"Initialize Project",command:"/maestro-init",description:"Set up project configuration and workspace",done:t=>!!(t!=null&&t.project_name&&t.project_name!=="")},{id:"roadmap",label:"Create Roadmap",command:"/maestro-roadmap",description:"Define phases and milestones for your project",done:t=>!1},{id:"plan",label:"Plan Phase 1",command:"/maestro-plan 1",description:"Create execution plan for the first phase",done:t=>!1}];function Me({project:t}){var x;const[s,a]=f.useState(null),r=((x=D.find(i=>!i.done(t)))==null?void 0:x.id)??null;function n(i){navigator.clipboard.writeText(i.command).catch(()=>{}),a(i.id),setTimeout(()=>a(d=>d===i.id?null:d),2e3)}return e.jsxs("div",{className:"flex flex-col gap-[var(--spacing-4)] px-[var(--spacing-6)] py-[var(--spacing-6)] h-full overflow-y-auto",children:[e.jsxs("div",{className:"flex flex-col gap-[var(--spacing-1)]",children:[e.jsx("h2",{className:"text-[length:var(--font-size-lg)] font-bold text-text-primary",children:"Project Setup"}),e.jsx("p",{className:"text-[length:var(--font-size-sm)] text-text-tertiary",children:"Run these commands to initialize your project"})]}),e.jsx("div",{className:"flex flex-col gap-[var(--spacing-3)]",children:D.map(i=>{const d=i.done(t),p=i.id===r,o=d?"rounded-[var(--radius-lg)] border border-border-divider bg-bg-primary p-[var(--spacing-4)] opacity-60":p?"rounded-[var(--radius-lg)] border border-border-focus bg-bg-secondary p-[var(--spacing-4)]":"rounded-[var(--radius-lg)] border border-border-divider bg-bg-primary p-[var(--spacing-4)]";return e.jsx("div",{className:o,children:e.jsxs("div",{className:"flex items-start gap-[var(--spacing-3)]",children:[e.jsx("div",{className:"flex-shrink-0 mt-[var(--spacing-0-5)]",children:d?e.jsx("span",{className:"text-[#5A9E78] text-[length:var(--font-size-base)] font-bold leading-none",children:"✓"}):e.jsx("span",{className:"text-text-tertiary text-[length:var(--font-size-base)] leading-none",children:"○"})}),e.jsxs("div",{className:"flex-1 min-w-0 flex flex-col gap-[var(--spacing-1-5)]",children:[e.jsx("span",{className:"text-[length:var(--font-size-base)] font-[var(--font-weight-semibold)] text-text-primary",children:i.label}),e.jsx("p",{className:"text-[length:var(--font-size-sm)] text-text-tertiary",children:i.description}),e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)]",children:[e.jsx("code",{className:"font-mono text-[length:var(--font-size-sm)] bg-bg-primary border border-border-divider rounded px-[var(--spacing-2)] py-[var(--spacing-0-5)] text-text-primary",children:i.command}),e.jsx("button",{type:"button",onClick:()=>n(i),className:"cursor-pointer text-text-tertiary hover:text-text-primary text-[length:var(--font-size-sm)] transition-colors",children:s===i.id?"Copied!":"Copy"})]})]})]})},i.id)})})]})}const V=["board","timeline","center","table"];function Ke(){const[t,s]=f.useState("board"),[a,r]=f.useState(null),{register:n,unregister:x}=f.useContext(J),i=X(v=>v.recentDecisions),d=f.useMemo(()=>i.flatMap(v=>v.actions.filter(N=>N.type==="advance_phase")).slice(-3),[i]),{phases:p,board:o,selectedPhase:c,setSelectedPhase:u}=w(Z(v=>{var N;return{phases:((N=v.board)==null?void 0:N.phases)??[],board:v.board,selectedPhase:v.selectedPhase,setSelectedPhase:v.setSelectedPhase}})),j=f.useCallback(v=>{s(V[v]),u(null),r(null)},[u]),y=f.useCallback(v=>{r(v),u(null)},[u]),l=f.useMemo(()=>({items:[{label:"Board",icon:e.jsx(re,{size:14,strokeWidth:2}),shortcut:"1"},{label:"Timeline",icon:e.jsx(U,{size:14,strokeWidth:2}),shortcut:"2"},{label:"Center",icon:e.jsx(Y,{size:14,strokeWidth:2}),shortcut:"3"},{label:"Table",icon:e.jsx(ee,{size:14,strokeWidth:2}),shortcut:"4"}],activeIndex:V.indexOf(t),onSwitch:j}),[t,j]);f.useEffect(()=>{n(l)},[l,n]),f.useEffect(()=>()=>x(),[x]);const h=a??(c!==null?{type:"phase",phaseId:c}:null),b=h!==null,g=(h==null?void 0:h.type)==="task"?"Task Detail":"Phase Detail";return e.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[e.jsxs("div",{className:"flex items-center justify-end px-[var(--spacing-4)] py-[var(--spacing-1)] border-b border-border-divider bg-bg-secondary text-[length:var(--font-size-xs)]",children:[d.length>0&&e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] mr-auto",children:[e.jsx("span",{className:"inline-block w-[5px] h-[5px] rounded-full bg-accent-blue animate-pulse"}),e.jsxs("span",{className:"text-text-secondary",children:["Commander recommends advancing: ",d.map(v=>v.target).join(", ")]})]}),e.jsx(S,{to:"/supervisor",className:"text-text-secondary hover:text-text-primary transition-colors font-[var(--font-weight-medium)]",children:"Supervisor →"})]}),e.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[e.jsx("div",{className:"flex-1 min-w-0 overflow-hidden",children:p.length===0?e.jsx(Me,{project:o==null?void 0:o.project}):e.jsxs(e.Fragment,{children:[t==="board"&&e.jsx(ve,{onSelectTask:y}),t==="timeline"&&e.jsx(ye,{onSelectPhase:v=>{r(null),u(c===v?null:v)},onSelectTask:y}),t==="center"&&e.jsx(We,{}),t==="table"&&e.jsx(Re,{onSelectTask:y})]})}),e.jsx(te,{open:b,onClose:()=>{u(null),r(null)},title:g,children:h!==null&&e.jsx(se,{selectedItem:h})})]})]})}export{Ke as WorkflowPage};
@@ -1,4 +1,4 @@
1
- import{d as o}from"./index-11DuhKhc.js";/**
1
+ import{d as o}from"./index-nufWop4p.js";/**
2
2
  * @license lucide-react v0.577.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{d as c}from"./index-11DuhKhc.js";/**
1
+ import{d as c}from"./index-nufWop4p.js";/**
2
2
  * @license lucide-react v0.577.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{d as o}from"./index-11DuhKhc.js";/**
1
+ import{d as o}from"./index-nufWop4p.js";/**
2
2
  * @license lucide-react v0.577.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{d as c}from"./index-11DuhKhc.js";/**
1
+ import{d as c}from"./index-nufWop4p.js";/**
2
2
  * @license lucide-react v0.577.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{d as e}from"./index-11DuhKhc.js";/**
1
+ import{d as e}from"./index-nufWop4p.js";/**
2
2
  * @license lucide-react v0.577.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{d as c}from"./index-11DuhKhc.js";/**
1
+ import{d as c}from"./index-nufWop4p.js";/**
2
2
  * @license lucide-react v0.577.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{d as c}from"./index-11DuhKhc.js";/**
1
+ import{d as c}from"./index-nufWop4p.js";/**
2
2
  * @license lucide-react v0.577.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{d as o}from"./index-11DuhKhc.js";/**
1
+ import{d as o}from"./index-nufWop4p.js";/**
2
2
  * @license lucide-react v0.577.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{d as t}from"./index-11DuhKhc.js";/**
1
+ import{d as t}from"./index-nufWop4p.js";/**
2
2
  * @license lucide-react v0.577.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{d as o}from"./index-11DuhKhc.js";/**
1
+ import{d as o}from"./index-nufWop4p.js";/**
2
2
  * @license lucide-react v0.577.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{d as a}from"./index-11DuhKhc.js";/**
1
+ import{d as a}from"./index-nufWop4p.js";/**
2
2
  * @license lucide-react v0.577.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{d as c}from"./index-11DuhKhc.js";/**
1
+ import{d as c}from"./index-nufWop4p.js";/**
2
2
  * @license lucide-react v0.577.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{r as n,j as b}from"./index-11DuhKhc.js";import{M as D,i as k,u as F,P as K,a as U,b as W,L as B}from"./proxy-B9XRqHD9.js";function I(e,r){if(typeof e=="function")return e(r);e!=null&&(e.current=r)}function G(...e){return r=>{let t=!1;const o=e.map(f=>{const u=I(f,r);return!t&&typeof u=="function"&&(t=!0),u});if(t)return()=>{for(let f=0;f<o.length;f++){const u=o[f];typeof u=="function"?u():I(e[f],null)}}}}function T(...e){return n.useCallback(G(...e),e)}class V extends n.Component{getSnapshotBeforeUpdate(r){const t=this.props.childRef.current;if(k(t)&&r.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const o=t.offsetParent,f=k(o)&&o.offsetWidth||0,u=k(o)&&o.offsetHeight||0,a=getComputedStyle(t),s=this.props.sizeRef.current;s.height=parseFloat(a.height),s.width=parseFloat(a.width),s.top=t.offsetTop,s.left=t.offsetLeft,s.right=f-s.width-s.left,s.bottom=u-s.height-s.top}return null}componentDidUpdate(){}render(){return this.props.children}}function X({children:e,isPresent:r,anchorX:t,anchorY:o,root:f,pop:u}){var c;const a=n.useId(),s=n.useRef(null),E=n.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:w}=n.useContext(D),l=((c=e.props)==null?void 0:c.ref)??(e==null?void 0:e.ref),y=T(s,l);return n.useInsertionEffect(()=>{const{width:p,height:d,top:x,left:g,right:$,bottom:v}=E.current;if(r||u===!1||!s.current||!p||!d)return;const L=t==="left"?`left: ${g}`:`right: ${$}`,m=o==="bottom"?`bottom: ${v}`:`top: ${x}`;s.current.dataset.motionPopId=a;const C=document.createElement("style");w&&(C.nonce=w);const R=f??document.head;return R.appendChild(C),C.sheet&&C.sheet.insertRule(`
1
+ import{r as n,j as b}from"./index-nufWop4p.js";import{M as D,i as k,u as F,P as K,a as U,b as W,L as B}from"./proxy-teW12DdZ.js";function I(e,r){if(typeof e=="function")return e(r);e!=null&&(e.current=r)}function G(...e){return r=>{let t=!1;const o=e.map(f=>{const u=I(f,r);return!t&&typeof u=="function"&&(t=!0),u});if(t)return()=>{for(let f=0;f<o.length;f++){const u=o[f];typeof u=="function"?u():I(e[f],null)}}}}function T(...e){return n.useCallback(G(...e),e)}class V extends n.Component{getSnapshotBeforeUpdate(r){const t=this.props.childRef.current;if(k(t)&&r.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const o=t.offsetParent,f=k(o)&&o.offsetWidth||0,u=k(o)&&o.offsetHeight||0,a=getComputedStyle(t),s=this.props.sizeRef.current;s.height=parseFloat(a.height),s.width=parseFloat(a.width),s.top=t.offsetTop,s.left=t.offsetLeft,s.right=f-s.width-s.left,s.bottom=u-s.height-s.top}return null}componentDidUpdate(){}render(){return this.props.children}}function X({children:e,isPresent:r,anchorX:t,anchorY:o,root:f,pop:u}){var c;const a=n.useId(),s=n.useRef(null),E=n.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:w}=n.useContext(D),l=((c=e.props)==null?void 0:c.ref)??(e==null?void 0:e.ref),y=T(s,l);return n.useInsertionEffect(()=>{const{width:p,height:d,top:x,left:g,right:$,bottom:v}=E.current;if(r||u===!1||!s.current||!p||!d)return;const L=t==="left"?`left: ${g}`:`right: ${$}`,m=o==="bottom"?`bottom: ${v}`:`top: ${x}`;s.current.dataset.motionPopId=a;const C=document.createElement("style");w&&(C.nonce=w);const R=f??document.head;return R.appendChild(C),C.sheet&&C.sheet.insertRule(`
2
2
  [data-motion-pop-id="${a}"] {
3
3
  position: absolute !important;
4
4
  width: ${p}px !important;