maestro-flow 0.4.3 → 0.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (232) hide show
  1. package/dashboard/dist/assets/{ArtifactsPage-iJZtYsmR.js → ArtifactsPage-CVh0Z2I2.js} +3 -3
  2. package/dashboard/dist/assets/{ChatInput-DNnDLdQF.js → ChatInput-CBI3qHQQ.js} +2 -2
  3. package/dashboard/dist/assets/ChatPage-BjJ9CYox.js +22 -0
  4. package/dashboard/dist/assets/CollabPage-CprGGO9y.js +1 -0
  5. package/dashboard/dist/assets/{ExecutionPanel-BKV3GZ7Q.js → ExecutionPanel-CClxD7cH.js} +1 -1
  6. package/dashboard/dist/assets/KanbanPage-copqjdPg.js +16 -0
  7. package/dashboard/dist/assets/MaestroCoordinatePage-CioZjQ9N.js +4 -0
  8. package/dashboard/dist/assets/{MarkdownRenderer-cYFfe1uX.js → MarkdownRenderer-CtUhoxCT.js} +1 -1
  9. package/dashboard/dist/assets/McpPage-BcPPcJpr.js +21 -0
  10. package/dashboard/dist/assets/{MeetingRoomPage-wnvT7wlB.js → MeetingRoomPage-BgmAKxU-.js} +1 -1
  11. package/dashboard/dist/assets/{OutputPanel-DDL90Idy.js → OutputPanel-DgT3gMyp.js} +1 -1
  12. package/dashboard/dist/assets/{ProblemsPanel-zFN9IIs0.js → ProblemsPanel-BmG7rxoG.js} +1 -1
  13. package/dashboard/dist/assets/{RequirementBoardPage-DOPJoT0I.js → RequirementBoardPage-k8YoeQ0r.js} +1 -1
  14. package/dashboard/dist/assets/{RequirementPage-CEVquRgM.js → RequirementPage-Da2354px.js} +1 -1
  15. package/dashboard/dist/assets/{RoomsPage-D5USEWDh.js → RoomsPage-BtqDiYaU.js} +1 -1
  16. package/dashboard/dist/assets/SpecsPage-ByPVH_M3.js +36 -0
  17. package/dashboard/dist/assets/{TeamsPage-DlcEmr_Q.js → TeamsPage-sFDLN30L.js} +1 -1
  18. package/dashboard/dist/assets/{TreeBrowser-Y48Wz-QY.js → TreeBrowser-oEx8YJXV.js} +1 -1
  19. package/dashboard/dist/assets/WorkflowPage-JrX7CVHh.js +6 -0
  20. package/dashboard/dist/assets/{arrow-left-NCUOENvg.js → arrow-left-DYvgSdIH.js} +1 -1
  21. package/dashboard/dist/assets/{check-o7nfGNHf.js → check-jcgYBWVR.js} +1 -1
  22. package/dashboard/dist/assets/{chevron-right-BXySK2fn.js → chevron-right-DvZ5sMOg.js} +1 -1
  23. package/dashboard/dist/assets/{circle-cooAwnAR.js → circle-DYT-zoRZ.js} +1 -1
  24. package/dashboard/dist/assets/{circle-alert-DcSBokh4.js → circle-alert-Bfbv3gt4.js} +1 -1
  25. package/dashboard/dist/assets/{circle-check-Cd-jce4j.js → circle-check-D82WnpbI.js} +1 -1
  26. package/dashboard/dist/assets/{circle-check-big-BN7Mdp4i.js → circle-check-big-CPVD1GKF.js} +1 -1
  27. package/dashboard/dist/assets/{code-BQa9oL1n.js → code-B3bKFGI4.js} +1 -1
  28. package/dashboard/dist/assets/{columns-3-BzgxelGx.js → columns-3-BeMAQCix.js} +1 -1
  29. package/dashboard/dist/assets/{download-swRJnate.js → download-BCtpoWYB.js} +1 -1
  30. package/dashboard/dist/assets/en-2h6fD0j8.js +1 -0
  31. package/dashboard/dist/assets/{folder-DbGbLNFN.js → folder-CTj6SNNu.js} +1 -1
  32. package/dashboard/dist/assets/index-6-yE5Yl9.css +1 -0
  33. package/dashboard/dist/assets/{index-DIoMBMbv.js → index-BxR_3IbJ.js} +1 -1
  34. package/dashboard/dist/assets/{index-DLBN_7fb.js → index-CWBJLu42.js} +1 -1
  35. package/dashboard/dist/assets/index-DpcPd-UG.js +236 -0
  36. package/dashboard/dist/assets/{list-BTRAIvDq.js → list-BMv8pIQn.js} +1 -1
  37. package/dashboard/dist/assets/{loader-NHtB6Mdn.js → loader-DdM4VOgF.js} +1 -1
  38. package/dashboard/dist/assets/{minus-BjMxRTET.js → minus-D15s2E__.js} +1 -1
  39. package/dashboard/dist/assets/{pen-line-C4_O16H0.js → pen-line-DO6o4xWz.js} +1 -1
  40. package/dashboard/dist/assets/{pencil-DTmKhyDY.js → pencil-qGxg9jOe.js} +1 -1
  41. package/dashboard/dist/assets/{proxy-Dtx5p6IO.js → proxy-DOffTzwA.js} +1 -1
  42. package/dashboard/dist/assets/refresh-cw-C9UNdLCy.js +6 -0
  43. package/dashboard/dist/assets/{rows-2-GR1dZtRu.js → rows-2-CifAA5SL.js} +1 -1
  44. package/dashboard/dist/assets/{search-DVtgy2W7.js → search-pe7pU1YN.js} +1 -1
  45. package/dashboard/dist/assets/{shallow-BOmvDNsv.js → shallow-r7YynQYA.js} +1 -1
  46. package/dashboard/dist/assets/table-Bh772iIw.js +6 -0
  47. package/dashboard/dist/assets/{team-types-BPeOvVdA.js → team-types-C_HqX2p2.js} +1 -1
  48. package/dashboard/dist/assets/{terminal-CzogW4cl.js → terminal-EpmtGBlw.js} +1 -1
  49. package/dashboard/dist/assets/{trash-2-52LATVfW.js → trash-2-Xen46iNQ.js} +1 -1
  50. package/dashboard/dist/assets/{users-DLFE2voE.js → users-BLueDPxF.js} +1 -1
  51. package/dashboard/dist/assets/{zap-DhiYlgyZ.js → zap-DsQCPF61.js} +1 -1
  52. package/dashboard/dist/assets/zh-CN-r3AvxxOL.js +1 -0
  53. package/dashboard/dist/index.html +2 -2
  54. package/dashboard/dist-server/dashboard/src/server/routes/settings.js +70 -1
  55. package/dashboard/dist-server/dashboard/src/server/routes/settings.js.map +1 -1
  56. package/dashboard/dist-server/src/types/index.d.ts +48 -6
  57. package/dist/src/commands/coordinate.d.ts.map +1 -1
  58. package/dist/src/commands/coordinate.js +2 -0
  59. package/dist/src/commands/coordinate.js.map +1 -1
  60. package/dist/src/commands/hooks.d.ts.map +1 -1
  61. package/dist/src/commands/hooks.js +201 -6
  62. package/dist/src/commands/hooks.js.map +1 -1
  63. package/dist/src/commands/spec.d.ts.map +1 -1
  64. package/dist/src/commands/spec.js +466 -0
  65. package/dist/src/commands/spec.js.map +1 -1
  66. package/dist/src/config/index.d.ts +5 -1
  67. package/dist/src/config/index.d.ts.map +1 -1
  68. package/dist/src/config/index.js +42 -0
  69. package/dist/src/config/index.js.map +1 -1
  70. package/dist/src/hooks/keyword-spec-injector.d.ts.map +1 -1
  71. package/dist/src/hooks/keyword-spec-injector.js +63 -4
  72. package/dist/src/hooks/keyword-spec-injector.js.map +1 -1
  73. package/dist/src/hooks/plugins/spec-analytics-plugin.d.ts +13 -0
  74. package/dist/src/hooks/plugins/spec-analytics-plugin.d.ts.map +1 -0
  75. package/dist/src/hooks/plugins/spec-analytics-plugin.js +92 -0
  76. package/dist/src/hooks/plugins/spec-analytics-plugin.js.map +1 -0
  77. package/dist/src/hooks/plugins/spec-injection-plugin.d.ts.map +1 -1
  78. package/dist/src/hooks/plugins/spec-injection-plugin.js +57 -4
  79. package/dist/src/hooks/plugins/spec-injection-plugin.js.map +1 -1
  80. package/dist/src/hooks/spec-analytics.d.ts +128 -0
  81. package/dist/src/hooks/spec-analytics.d.ts.map +1 -0
  82. package/dist/src/hooks/spec-analytics.js +311 -0
  83. package/dist/src/hooks/spec-analytics.js.map +1 -0
  84. package/dist/src/hooks/spec-injector.d.ts.map +1 -1
  85. package/dist/src/hooks/spec-injector.js +127 -5
  86. package/dist/src/hooks/spec-injector.js.map +1 -1
  87. package/dist/src/tools/spec-loader.d.ts +20 -0
  88. package/dist/src/tools/spec-loader.d.ts.map +1 -1
  89. package/dist/src/tools/spec-loader.js +58 -7
  90. package/dist/src/tools/spec-loader.js.map +1 -1
  91. package/dist/src/tui/config-ui/ConfigHub.d.ts +1 -1
  92. package/dist/src/tui/config-ui/ConfigHub.d.ts.map +1 -1
  93. package/dist/src/tui/config-ui/ConfigHub.js +16 -10
  94. package/dist/src/tui/config-ui/ConfigHub.js.map +1 -1
  95. package/dist/src/tui/config-ui/ConfigSourcesView.d.ts.map +1 -1
  96. package/dist/src/tui/config-ui/ConfigSourcesView.js +3 -2
  97. package/dist/src/tui/config-ui/ConfigSourcesView.js.map +1 -1
  98. package/dist/src/tui/config-ui/HooksPanel.d.ts.map +1 -1
  99. package/dist/src/tui/config-ui/HooksPanel.js +15 -19
  100. package/dist/src/tui/config-ui/HooksPanel.js.map +1 -1
  101. package/dist/src/tui/config-ui/SkillConfigDashboard.d.ts.map +1 -1
  102. package/dist/src/tui/config-ui/SkillConfigDashboard.js +5 -9
  103. package/dist/src/tui/config-ui/SkillConfigDashboard.js.map +1 -1
  104. package/dist/src/tui/config-ui/SkillParamEditor.d.ts.map +1 -1
  105. package/dist/src/tui/config-ui/SkillParamEditor.js +1 -3
  106. package/dist/src/tui/config-ui/SkillParamEditor.js.map +1 -1
  107. package/dist/src/tui/config-ui/SkillsList.d.ts.map +1 -1
  108. package/dist/src/tui/config-ui/SkillsList.js +7 -9
  109. package/dist/src/tui/config-ui/SkillsList.js.map +1 -1
  110. package/dist/src/tui/config-ui/SpecAnalyticsPanel.d.ts +6 -0
  111. package/dist/src/tui/config-ui/SpecAnalyticsPanel.d.ts.map +1 -0
  112. package/dist/src/tui/config-ui/SpecAnalyticsPanel.js +164 -0
  113. package/dist/src/tui/config-ui/SpecAnalyticsPanel.js.map +1 -0
  114. package/dist/src/tui/config-ui/SpecPanel.d.ts.map +1 -1
  115. package/dist/src/tui/config-ui/SpecPanel.js +918 -20
  116. package/dist/src/tui/config-ui/SpecPanel.js.map +1 -1
  117. package/dist/src/tui/config-ui/index.d.ts +3 -1
  118. package/dist/src/tui/config-ui/index.d.ts.map +1 -1
  119. package/dist/src/tui/config-ui/index.js +4 -0
  120. package/dist/src/tui/config-ui/index.js.map +1 -1
  121. package/dist/src/tui/install-ui/BackupConfig.d.ts.map +1 -1
  122. package/dist/src/tui/install-ui/BackupConfig.js +3 -2
  123. package/dist/src/tui/install-ui/BackupConfig.js.map +1 -1
  124. package/dist/src/tui/install-ui/BlueprintPreview.d.ts.map +1 -1
  125. package/dist/src/tui/install-ui/BlueprintPreview.js +7 -6
  126. package/dist/src/tui/install-ui/BlueprintPreview.js.map +1 -1
  127. package/dist/src/tui/install-ui/ComponentGrid.d.ts.map +1 -1
  128. package/dist/src/tui/install-ui/ComponentGrid.js +3 -2
  129. package/dist/src/tui/install-ui/ComponentGrid.js.map +1 -1
  130. package/dist/src/tui/install-ui/ConfigPanel.d.ts.map +1 -1
  131. package/dist/src/tui/install-ui/ConfigPanel.js +4 -3
  132. package/dist/src/tui/install-ui/ConfigPanel.js.map +1 -1
  133. package/dist/src/tui/install-ui/CyberItem.d.ts.map +1 -1
  134. package/dist/src/tui/install-ui/CyberItem.js +7 -6
  135. package/dist/src/tui/install-ui/CyberItem.js.map +1 -1
  136. package/dist/src/tui/install-ui/CyberdeckBlueprint.d.ts.map +1 -1
  137. package/dist/src/tui/install-ui/CyberdeckBlueprint.js +2 -1
  138. package/dist/src/tui/install-ui/CyberdeckBlueprint.js.map +1 -1
  139. package/dist/src/tui/install-ui/ExecutionView.d.ts.map +1 -1
  140. package/dist/src/tui/install-ui/ExecutionView.js +3 -2
  141. package/dist/src/tui/install-ui/ExecutionView.js.map +1 -1
  142. package/dist/src/tui/install-ui/GradientHeader.d.ts.map +1 -1
  143. package/dist/src/tui/install-ui/GradientHeader.js +2 -1
  144. package/dist/src/tui/install-ui/GradientHeader.js.map +1 -1
  145. package/dist/src/tui/install-ui/HooksConfig.d.ts.map +1 -1
  146. package/dist/src/tui/install-ui/HooksConfig.js +8 -8
  147. package/dist/src/tui/install-ui/HooksConfig.js.map +1 -1
  148. package/dist/src/tui/install-ui/InstallConfirm.d.ts.map +1 -1
  149. package/dist/src/tui/install-ui/InstallConfirm.js +4 -3
  150. package/dist/src/tui/install-ui/InstallConfirm.js.map +1 -1
  151. package/dist/src/tui/install-ui/InstallExecution.d.ts.map +1 -1
  152. package/dist/src/tui/install-ui/InstallExecution.js +3 -2
  153. package/dist/src/tui/install-ui/InstallExecution.js.map +1 -1
  154. package/dist/src/tui/install-ui/InstallFlow.d.ts.map +1 -1
  155. package/dist/src/tui/install-ui/InstallFlow.js +3 -2
  156. package/dist/src/tui/install-ui/InstallFlow.js.map +1 -1
  157. package/dist/src/tui/install-ui/InstallHub.d.ts.map +1 -1
  158. package/dist/src/tui/install-ui/InstallHub.js +9 -8
  159. package/dist/src/tui/install-ui/InstallHub.js.map +1 -1
  160. package/dist/src/tui/install-ui/InstallResult.d.ts.map +1 -1
  161. package/dist/src/tui/install-ui/InstallResult.js +3 -2
  162. package/dist/src/tui/install-ui/InstallResult.js.map +1 -1
  163. package/dist/src/tui/install-ui/McpConfig.d.ts.map +1 -1
  164. package/dist/src/tui/install-ui/McpConfig.js +4 -3
  165. package/dist/src/tui/install-ui/McpConfig.js.map +1 -1
  166. package/dist/src/tui/install-ui/ResultDashboard.d.ts.map +1 -1
  167. package/dist/src/tui/install-ui/ResultDashboard.js +3 -2
  168. package/dist/src/tui/install-ui/ResultDashboard.js.map +1 -1
  169. package/dist/src/tui/install-ui/ReviewPanel.d.ts.map +1 -1
  170. package/dist/src/tui/install-ui/ReviewPanel.js +2 -1
  171. package/dist/src/tui/install-ui/ReviewPanel.js.map +1 -1
  172. package/dist/src/tui/install-ui/StatuslineConfig.d.ts.map +1 -1
  173. package/dist/src/tui/install-ui/StatuslineConfig.js +3 -2
  174. package/dist/src/tui/install-ui/StatuslineConfig.js.map +1 -1
  175. package/dist/src/tui/install-ui/StepSelector.d.ts.map +1 -1
  176. package/dist/src/tui/install-ui/StepSelector.js +11 -10
  177. package/dist/src/tui/install-ui/StepSelector.js.map +1 -1
  178. package/dist/src/tui/overlay-ui/OverlayList.d.ts.map +1 -1
  179. package/dist/src/tui/overlay-ui/OverlayList.js +8 -12
  180. package/dist/src/tui/overlay-ui/OverlayList.js.map +1 -1
  181. package/dist/src/tui/shared/components.d.ts +56 -0
  182. package/dist/src/tui/shared/components.d.ts.map +1 -0
  183. package/dist/src/tui/shared/components.js +55 -0
  184. package/dist/src/tui/shared/components.js.map +1 -0
  185. package/dist/src/tui/shared/helpers.d.ts +24 -0
  186. package/dist/src/tui/shared/helpers.d.ts.map +1 -0
  187. package/dist/src/tui/shared/helpers.js +49 -0
  188. package/dist/src/tui/shared/helpers.js.map +1 -0
  189. package/dist/src/tui/shared/index.d.ts +4 -0
  190. package/dist/src/tui/shared/index.d.ts.map +1 -0
  191. package/dist/src/tui/shared/index.js +7 -0
  192. package/dist/src/tui/shared/index.js.map +1 -0
  193. package/dist/src/tui/shared/tokens.d.ts +79 -0
  194. package/dist/src/tui/shared/tokens.d.ts.map +1 -0
  195. package/dist/src/tui/shared/tokens.js +81 -0
  196. package/dist/src/tui/shared/tokens.js.map +1 -0
  197. package/dist/src/tui/tools-ui/CommandReference.d.ts.map +1 -1
  198. package/dist/src/tui/tools-ui/CommandReference.js +2 -4
  199. package/dist/src/tui/tools-ui/CommandReference.js.map +1 -1
  200. package/dist/src/tui/tools-ui/ConfigSources.d.ts.map +1 -1
  201. package/dist/src/tui/tools-ui/ConfigSources.js +3 -2
  202. package/dist/src/tui/tools-ui/ConfigSources.js.map +1 -1
  203. package/dist/src/tui/tools-ui/RegisterSettings.d.ts.map +1 -1
  204. package/dist/src/tui/tools-ui/RegisterSettings.js +2 -1
  205. package/dist/src/tui/tools-ui/RegisterSettings.js.map +1 -1
  206. package/dist/src/tui/tools-ui/RoleMappings.d.ts.map +1 -1
  207. package/dist/src/tui/tools-ui/RoleMappings.js +3 -5
  208. package/dist/src/tui/tools-ui/RoleMappings.js.map +1 -1
  209. package/dist/src/tui/tools-ui/ToolsDashboard.d.ts.map +1 -1
  210. package/dist/src/tui/tools-ui/ToolsDashboard.js +3 -5
  211. package/dist/src/tui/tools-ui/ToolsDashboard.js.map +1 -1
  212. package/dist/src/tui/tools-ui/ToolsOverview.d.ts.map +1 -1
  213. package/dist/src/tui/tools-ui/ToolsOverview.js +3 -5
  214. package/dist/src/tui/tools-ui/ToolsOverview.js.map +1 -1
  215. package/dist/src/tui/uninstall-ui/UninstallFlow.d.ts.map +1 -1
  216. package/dist/src/tui/uninstall-ui/UninstallFlow.js +8 -7
  217. package/dist/src/tui/uninstall-ui/UninstallFlow.js.map +1 -1
  218. package/dist/src/types/index.d.ts +48 -6
  219. package/dist/src/types/index.d.ts.map +1 -1
  220. package/package.json +1 -1
  221. package/dashboard/dist/assets/ChatPage-BjBibfE4.js +0 -22
  222. package/dashboard/dist/assets/CollabPage-8lUMUol_.js +0 -1
  223. package/dashboard/dist/assets/KanbanPage-diY3QmGd.js +0 -21
  224. package/dashboard/dist/assets/McpPage-COjuIf7U.js +0 -21
  225. package/dashboard/dist/assets/SpecsPage-BOwBin_o.js +0 -36
  226. package/dashboard/dist/assets/SupervisorPage-5iRyMU5T.js +0 -6
  227. package/dashboard/dist/assets/WorkflowPage-CmQaRVgL.js +0 -6
  228. package/dashboard/dist/assets/en-C_BD3UCD.js +0 -1
  229. package/dashboard/dist/assets/index-BEUaOz_b.css +0 -1
  230. package/dashboard/dist/assets/index-uIqUCT8y.js +0 -236
  231. package/dashboard/dist/assets/table-DCzuJAFh.js +0 -6
  232. package/dashboard/dist/assets/zh-CN-DvQKfow3.js +0 -1
@@ -0,0 +1,16 @@
1
+ import{j as e,u as Z,a as ce,S as L,r as p,b as D,c as O,s as R,L as Pe,g as P,I as $,C as ee,d as te,e as K,R as fe,P as be,O as ye,f as je,T as Ne,h as we,i as ke,k as Oe,l as $e,m as de,V as Re,n as Ie}from"./index-DpcPd-UG.js";import{u as q}from"./shallow-r7YynQYA.js";import{S as Me,P as Ke,L as Ue,a as U,u as Fe,T as He,b as We,D as Ve,K as Ye}from"./table-Bh772iIw.js";import{C as qe}from"./circle-check-big-CPVD1GKF.js";import{M as Ge,C as Xe}from"./ChatInput-CBI3qHQQ.js";import{R as Qe}from"./refresh-cw-C9UNdLCy.js";import{D as Je}from"./download-BCtpoWYB.js";import"./index-CWBJLu42.js";import"./zap-DsQCPF61.js";import"./MarkdownRenderer-CtUhoxCT.js";import"./chevron-right-DvZ5sMOg.js";import"./terminal-EpmtGBlw.js";import"./circle-alert-Bfbv3gt4.js";function Ze({chips:t,active:a,onSelect:r}){return e.jsx("div",{className:"flex items-center gap-[var(--spacing-1-5)] overflow-x-auto shrink-0",children:t.map(o=>{const n=o===a;return e.jsx("button",{type:"button",onClick:()=>r(o),className:["px-[var(--spacing-3)] py-[var(--spacing-1)]","text-[length:var(--font-size-xs)] font-[var(--font-weight-medium)] whitespace-nowrap","transition-all duration-[var(--duration-fast)] ease-[var(--ease-notion)]","focus-visible:outline-none focus-visible:shadow-[var(--shadow-focus-ring)]",n?"":"hover:text-text-primary"].join(" "),style:n?{borderRadius:"var(--style-chip-radius)",border:"var(--style-chip-border)",backgroundColor:"var(--style-chip-active-bg)",color:"var(--style-chip-active-color)"}:{borderRadius:"var(--style-chip-radius)",border:"var(--style-chip-border)",backgroundColor:"var(--color-bg-card)",color:"var(--color-text-secondary)"},children:o},o)})})}const et={not_started:"var(--color-tint-pending)",planning:"var(--color-tint-planning)",executing:"var(--color-tint-executing)",verifying:"var(--color-tint-verifying)",reviewing:"var(--color-tint-reviewing)",completed:"var(--color-tint-completed)",blocked:"var(--color-tint-blocked)"};function tt({phase:t}){const{t:a}=Z(),r=ce(g=>g.setSelectedPhase),n=ce(g=>g.selectedPhase)===t.phase;function d(){r(n?null:t.phase)}function c(g){(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),d())}const{tasks_completed:i,tasks_total:l,current_wave:x}=t.execution,h=a("kanban.wave");return e.jsx("article",{role:"listitem",children:e.jsxs("div",{role:"button",tabIndex:0,"aria-label":a("kanban.phase_aria",{phase:t.phase,title:t.title,status:t.status,completed:i,total:l}),"aria-pressed":n,onClick:d,onKeyDown:c,className:["rounded-[10px] px-[var(--spacing-4)] py-[var(--spacing-3)] space-y-[var(--spacing-2)] cursor-pointer","transition-all duration-[var(--duration-normal)] ease-[var(--ease-spring)]","hover:shadow-[0_4px_12px_rgba(0,0,0,0.08)] hover:-translate-y-0.5","focus-visible:outline-none focus-visible:shadow-[var(--shadow-focus-ring)]","active:scale-[0.98] active:shadow-sm active:duration-[var(--duration-fast)]",n?"shadow-[inset_0_0_0_2px_var(--color-accent-blue)]":""].join(" "),style:{backgroundColor:et[t.status]??"var(--color-tint-pending)"},children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(Me,{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("h4",{className:"text-[length:var(--font-size-base)] font-[var(--font-weight-semibold)] text-text-primary leading-[var(--line-height-tight)]",children:t.title}),t.goal&&e.jsx("p",{className:"text-[length:var(--font-size-sm)] text-text-secondary leading-[var(--line-height-normal)] line-clamp-2",children:t.goal}),l>0&&e.jsx(Ke,{completed:i,total:l,color:L[t.status]}),t.status==="executing"&&x>0&&e.jsxs("div",{className:"flex items-center gap-[var(--spacing-1-5)] text-[length:var(--font-size-xs)] text-status-executing",children:[e.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full bg-status-executing animate-pulse motion-reduce:animate-none"}),e.jsxs("span",{children:[h," ",x]})]})]})})}function rt({issue:t,selected:a,onSelect:r}){const o=Ue[t.priority];function n(d){(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),r())}return e.jsx("article",{role:"listitem",children:e.jsxs("div",{role:"button",tabIndex:0,"aria-label":`${t.identifier}: ${t.title}. Priority: ${U[t.priority]}`,"aria-pressed":a,onClick:r,onKeyDown:n,className:["rounded-[10px] px-[var(--spacing-4)] py-[var(--spacing-3)] space-y-[var(--spacing-2)] cursor-pointer","transition-all duration-[var(--duration-normal)] ease-[var(--ease-spring)]","hover:shadow-[0_4px_12px_rgba(0,0,0,0.08)] hover:-translate-y-0.5","focus-visible:outline-none focus-visible:shadow-[var(--shadow-focus-ring)]","active:scale-[0.98] active:shadow-sm active:duration-[var(--duration-fast)]","bg-bg-card",a?"shadow-[inset_0_0_0_2px_var(--color-accent-blue)]":""].join(" "),children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-[var(--spacing-1-5)]",children:[e.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:`#${t.state.color}`},"aria-hidden":"true"}),e.jsx("span",{className:"text-[length:var(--font-size-xs)] font-mono font-[var(--font-weight-medium)] text-text-tertiary",children:t.identifier})]}),e.jsx("span",{className:"text-[length:var(--font-size-xs)] font-[var(--font-weight-medium)] px-2 py-[var(--spacing-0-5)] rounded-full",style:{backgroundColor:`${o}20`,color:o},children:U[t.priority]})]}),e.jsx("h4",{className:"text-[length:var(--font-size-sm)] font-[var(--font-weight-medium)] text-text-primary leading-snug line-clamp-2",children:t.title}),e.jsxs("div",{className:"flex items-center justify-between gap-[var(--spacing-2)]",children:[e.jsx("div",{className:"flex gap-[var(--spacing-1)] flex-wrap min-w-0",children:t.labels.slice(0,3).map(d=>e.jsx("span",{className:"text-[length:10px] px-1.5 py-0.5 rounded-full truncate max-w-[80px]",style:{backgroundColor:`#${d.color}20`,color:`#${d.color}`},title:d.name,children:d.name},d.id))}),t.assignee&&e.jsx("span",{className:"w-5 h-5 rounded-full bg-bg-hover shrink-0 flex items-center justify-center text-[length:10px] font-[var(--font-weight-semibold)] text-text-secondary",title:t.assignee.displayName,children:t.assignee.displayName.charAt(0).toUpperCase()})]})]})})}const at={bug:"#C46555",feature:"#5B8DB8",improvement:"#9178B5",task:"#A09D97"},st={urgent:"#C46555",high:"#B89540",medium:"#5B8DB8",low:"#A09D97"},ot=[{value:"claude-code",label:"Claude"},{value:"codex",label:"Codex"},{value:"gemini",label:"Gemini"},{value:"agent-sdk",label:"Agent SDK"}],nt={running:{icon:"●",color:"#B89540",animate:!0},queued:{icon:"◷",color:"#5B8DB8"},completed:{icon:"✓",color:"#5A9E78"},failed:{icon:"✕",color:"#C46555"},retrying:{icon:"↻",color:"#B89540",animate:!0}};function lt({issue:t,selected:a,onSelect:r,batchMode:o,isChecked:n,onToggleCheck:d}){var z;const c=at[t.type]??"#A09D97",i=st[t.priority]??"#A09D97",[l,x]=p.useState(!1),[h,g]=p.useState(t.executor??"claude-code"),m=D(j=>j.isIssueRunning(t.id)),y=D(j=>j.openCliPanel),k=O(j=>j.updateIssue),N=(z=t.execution)==null?void 0:z.status,u=N?nt[N]:null,b=p.useCallback(j=>{j.stopPropagation(),R({action:"execute:issue",issueId:t.id,executor:h})},[t.id,h]),C=p.useCallback(j=>{j.stopPropagation();const T=j.target.value;g(T),k(t.id,{executor:T})},[t.id,k]),v=p.useCallback(j=>{j.stopPropagation(),d==null||d(t.id)},[t.id,d]),s=p.useCallback(j=>{j.stopPropagation(),y(t.id)},[t.id,y]);function S(j){(j.key==="Enter"||j.key===" ")&&(j.preventDefault(),r())}return e.jsx("article",{role:"listitem",children:e.jsxs("div",{role:"button",tabIndex:0,"aria-label":`${t.title}. Type: ${t.type}. Priority: ${t.priority}`,"aria-pressed":a,onClick:r,onKeyDown:S,onMouseEnter:()=>x(!0),onMouseLeave:()=>x(!1),className:["group/card relative rounded-[10px] px-[var(--spacing-4)] py-[var(--spacing-3)] space-y-[var(--spacing-2)] cursor-pointer","transition-all duration-[var(--duration-normal)] ease-[var(--ease-spring)]","hover:shadow-[0_4px_12px_rgba(0,0,0,0.08)] hover:-translate-y-0.5","focus-visible:outline-none focus-visible:shadow-[var(--shadow-focus-ring)]","active:scale-[0.98] active:shadow-sm active:duration-[var(--duration-fast)]","bg-bg-card motion-safe:animate-[card-enter_200ms_ease-out_both]",a?"shadow-[inset_0_0_0_2px_var(--color-accent-blue)]":"shadow-[var(--shadow-sm)]"].join(" "),children:[e.jsxs("div",{className:"flex items-center gap-[var(--spacing-1)]",children:[(o||l)&&e.jsx("div",{onClick:v,className:["shrink-0 w-4 h-4 rounded border-[1.5px] flex items-center justify-center text-[9px] transition-all duration-100 cursor-pointer",n?"bg-accent-blue border-accent-blue text-white scale-100":"border-border hover:border-text-secondary"].join(" "),style:n?{backgroundColor:"var(--color-accent-blue)",borderColor:"var(--color-accent-blue)"}:{},children:n&&"✓"}),e.jsx("span",{className:"text-[length:var(--font-size-xs)] font-[var(--font-weight-medium)] px-2 py-[var(--spacing-0-5)] rounded-full",style:{backgroundColor:`${c}20`,color:c},children:t.type}),t.path&&e.jsx("span",{className:"text-[10px] font-medium px-1.5 py-[var(--spacing-0-5)] rounded-full",style:{backgroundColor:"var(--color-bg-secondary)",color:"var(--color-text-tertiary)",border:"1px solid var(--color-border)"},children:t.path}),t.solution&&e.jsxs("span",{className:"text-[10px] font-medium px-1.5 py-[var(--spacing-0-5)] rounded-full",style:{backgroundColor:"#9178B520",color:"#9178B5"},children:[t.solution.steps.length," steps"]}),t.phase_id!=null&&e.jsxs(Pe,{to:`/workflow?phase=${t.phase_id}`,onClick:j=>j.stopPropagation(),className:"text-[10px] font-medium px-1.5 py-[var(--spacing-0-5)] rounded-full no-underline transition-colors",style:{backgroundColor:"rgba(91, 141, 184, 0.1)",color:"#5B8DB8"},title:`Go to Phase ${t.phase_id}`,children:["P-",String(t.phase_id).padStart(2,"0")]}),u&&e.jsx("span",{className:["text-[length:var(--font-size-xs)] font-[var(--font-weight-medium)]",u.animate?"animate-pulse":""].join(" "),style:{color:u.color},title:`Execution: ${N}`,onClick:m?s:void 0,children:u.icon}),e.jsx("span",{className:"text-[length:var(--font-size-xs)] font-[var(--font-weight-medium)] px-2 py-[var(--spacing-0-5)] rounded-full ml-auto",style:{backgroundColor:`${i}20`,color:i},children:t.priority})]}),e.jsx("h4",{className:"text-[length:var(--font-size-sm)] font-[var(--font-weight-medium)] text-text-primary leading-snug line-clamp-2",children:t.title}),e.jsxs("div",{className:"flex items-center justify-between",children:[(()=>{const j=P(t),T=$[j];return e.jsx("span",{className:"text-[length:10px]",style:{color:T},children:j.replace("_"," ")})})(),e.jsxs("div",{className:"flex items-center gap-[var(--spacing-1)]",children:[e.jsx("select",{value:h,onChange:C,onClick:j=>j.stopPropagation(),className:["text-[length:10px] bg-transparent border border-border rounded px-1 py-0.5 text-text-secondary cursor-pointer","transition-opacity",l||a?"opacity-100":"opacity-0"].join(" "),"aria-label":"Select executor",children:ot.map(j=>e.jsx("option",{value:j.value,children:j.label},j.value))}),!m&&t.status!=="resolved"&&t.status!=="closed"&&e.jsx("button",{type:"button",onClick:b,className:["w-5 h-5 flex items-center justify-center rounded-[var(--radius-sm)] text-text-tertiary hover:text-accent-blue hover:bg-bg-hover transition-all",l||a?"opacity-100":"opacity-0"].join(" "),"aria-label":"Execute issue",title:"Execute issue",children:e.jsx("svg",{className:"w-3 h-3",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("polygon",{points:"5,3 19,12 5,21"})})}),m&&e.jsx("button",{type:"button",onClick:s,className:"w-5 h-5 flex items-center justify-center rounded-[var(--radius-sm)] text-[#B89540] hover:bg-bg-hover transition-all","aria-label":"View execution output",title:"View execution output",children:e.jsx("svg",{className:"w-3 h-3 animate-spin",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:e.jsx("path",{d:"M12 2a10 10 0 0 1 10 10",strokeLinecap:"round"})})})]})]})]})})}const it=[{value:"task",label:"Task",color:"#A09D97"},{value:"bug",label:"Bug",color:"#C46555"},{value:"feature",label:"Feature",color:"#5B8DB8"},{value:"improvement",label:"Improve",color:"#9178B5"}],ct=[{value:"urgent",label:"Urgent",color:"#C46555"},{value:"high",label:"High",color:"#B89540"},{value:"medium",label:"Medium",color:"#5B8DB8"},{value:"low",label:"Low",color:"#A09D97"}];function dt({columnId:t,onClose:a,onCreated:r}){const[o,n]=p.useState(""),[d,c]=p.useState("task"),[i,l]=p.useState("medium"),[x,h]=p.useState(!1),g=p.useRef(null),m=p.useRef(null),y=O(u=>u.createIssue);p.useEffect(()=>{requestAnimationFrame(()=>{var u;return(u=g.current)==null?void 0:u.focus()})},[]),p.useEffect(()=>{function u(b){m.current&&!m.current.contains(b.target)&&a()}return document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)},[a]);async function k(){const u=o.trim();!u||x||(h(!0),await y({title:u,description:"",type:d,priority:i}),h(!1),n(""),r==null||r(),a())}function N(u){u.key==="Enter"&&!u.shiftKey?(u.preventDefault(),k()):u.key==="Escape"&&(u.preventDefault(),a())}return e.jsxs("div",{ref:m,className:"rounded-[10px] border-2 border-dashed border-accent-blue/40 bg-bg-card px-[var(--spacing-3)] py-[var(--spacing-2-5)] space-y-[var(--spacing-2)] motion-safe:animate-[fade-in_100ms_ease-out]",children:[e.jsx("input",{ref:g,type:"text",value:o,onChange:u=>n(u.target.value),onKeyDown:N,placeholder:"Issue title...",disabled:x,className:"w-full bg-transparent text-[length:var(--font-size-sm)] font-[var(--font-weight-medium)] text-text-primary placeholder:text-text-tertiary outline-none"}),e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)]",children:[e.jsx("div",{className:"flex gap-[var(--spacing-0-5)]",children:it.map(u=>e.jsx("button",{type:"button",onClick:()=>c(u.value),className:["text-[length:10px] font-[var(--font-weight-medium)] px-[var(--spacing-1-5)] py-[1px] rounded-full transition-all duration-[var(--duration-fast)]",d===u.value?"ring-1 ring-current":"opacity-50 hover:opacity-80"].join(" "),style:{backgroundColor:`${u.color}20`,color:u.color},children:u.label},u.value))}),e.jsx("div",{className:"w-px h-3 bg-border-divider"}),e.jsx("div",{className:"flex gap-[var(--spacing-0-5)]",children:ct.map(u=>e.jsx("button",{type:"button",onClick:()=>l(u.value),className:["text-[length:10px] font-[var(--font-weight-medium)] px-[var(--spacing-1-5)] py-[1px] rounded-full transition-all duration-[var(--duration-fast)]",i===u.value?"ring-1 ring-current":"opacity-50 hover:opacity-80"].join(" "),style:{backgroundColor:`${u.color}20`,color:u.color},children:u.label},u.value))})]}),e.jsxs("div",{className:"flex items-center justify-between text-[length:10px] text-text-tertiary",children:[e.jsxs("span",{children:[e.jsx("kbd",{className:"px-1 py-[1px] rounded bg-bg-hover font-mono text-[9px]",children:"Enter"})," create"," ",e.jsx("kbd",{className:"px-1 py-[1px] rounded bg-bg-hover font-mono text-[9px]",children:"Esc"})," cancel"]}),x&&e.jsx("span",{children:"Creating..."})]})]})}function xt({columnId:t,title:a,phases:r,color:o,animationDelay:n=0,onSelectPhase:d,linearIssues:c,localIssues:i,selectedItem:l,onSelectItem:x,composingColumnId:h,onStartCompose:g,onStopCompose:m,onIssueCreated:y,batchMode:k,selectedIssueIds:N,onToggleIssueCheck:u}){const{t:b}=Z(),C=b("kanban.no_phases"),v=r.length===0&&(!i||i.length===0)&&(!c||c.length===0);return e.jsxs("section",{className:"group/col flex flex-col min-w-[var(--size-card-min-width)] flex-1 bg-bg-secondary rounded-[var(--radius-lg)] overflow-hidden motion-safe:animate-[column-enter_200ms_ease-out_both]",style:{animationDelay:`${n}ms`},"aria-label":`${a} column, ${r.length} phases`,children:[e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] px-[var(--spacing-3)] py-[var(--spacing-2-5)]",children:[e.jsx("span",{className:"w-2.5 h-2.5 rounded-full shrink-0",style:{backgroundColor:o},"aria-hidden":"true"}),e.jsx("h3",{className:"text-[length:var(--font-size-sm)] 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 rounded-full px-[var(--spacing-1-5)] tabular-nums",children:r.length+((i==null?void 0:i.length)??0)+((c==null?void 0:c.length)??0)}),e.jsx("button",{type:"button",onClick:()=>g==null?void 0:g(t),className:"ml-auto w-5 h-5 flex items-center justify-center rounded-[var(--radius-sm)] text-text-tertiary hover:text-text-primary hover:bg-bg-hover transition-colors opacity-0 group-hover/col:opacity-100 focus-visible:opacity-100","aria-label":"Create issue in this column",children:e.jsxs("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),e.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})})]}),e.jsxs("div",{className:"flex flex-col gap-[var(--spacing-2)] px-[var(--spacing-2)] pb-[var(--spacing-2)] overflow-y-auto flex-1",role:"list",children:[h===t&&m&&e.jsx(dt,{columnId:t,onClose:m,onCreated:y}),v?e.jsx("div",{className:"text-[length:var(--font-size-xs)] text-text-secondary text-center py-[var(--spacing-6)] italic",children:C}):e.jsxs(e.Fragment,{children:[r.map(s=>e.jsx(tt,{phase:s},s.phase)),i&&i.length>0&&e.jsxs(e.Fragment,{children:[r.length>0&&e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] py-[var(--spacing-1)]",children:[e.jsx("div",{className:"flex-1 h-px bg-border-divider"}),e.jsx("span",{className:"text-[length:10px] text-text-tertiary font-[var(--font-weight-medium)] uppercase tracking-wider",children:"Issues"}),e.jsx("div",{className:"flex-1 h-px bg-border-divider"})]}),i.map(s=>e.jsx(lt,{issue:s,selected:(l==null?void 0:l.type)==="issue"&&l.issue.id===s.id,onSelect:()=>x==null?void 0:x({type:"issue",issue:s}),batchMode:k,isChecked:N==null?void 0:N.has(s.id),onToggleCheck:u},s.id))]}),c&&c.length>0&&e.jsxs(e.Fragment,{children:[(r.length>0||i&&i.length>0)&&e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] py-[var(--spacing-1)]",children:[e.jsx("div",{className:"flex-1 h-px bg-border-divider"}),e.jsx("span",{className:"text-[length:10px] text-text-tertiary font-[var(--font-weight-medium)] uppercase tracking-wider",children:"Linear"}),e.jsx("div",{className:"flex-1 h-px bg-border-divider"})]}),c.map(s=>e.jsx(rt,{issue:s,selected:(l==null?void 0:l.type)==="linearIssue"&&l.issue.id===s.id,onSelect:()=>x==null?void 0:x({type:"linearIssue",issue:s})},s.id))]})]})]})]})}const pt={backlog:L.not_started,triage:"#C8863A","in-progress":L.executing,review:L.verifying,done:L.completed,deferred:"#8B8685"},ut={backlog:"columns.backlog",triage:"columns.triage","in-progress":"columns.in_progress",review:"columns.review",done:"columns.done",deferred:"columns.deferred"},ht={backlog:"backlog",unstarted:"backlog",started:"in-progress",completed:"done"},vt={open:"backlog",registered:"triage",in_progress:"in-progress",resolved:"review",closed:"done",deferred:"deferred"};function mt(t){var r;const a=new Map;for(const o of ee)a.set(o.id,[]);for(const o of t){const n=vt[o.status]??"backlog";(r=a.get(n))==null||r.push(o)}return a}function gt(t){var r;const a=new Map;for(const o of ee)a.set(o.id,[]);for(const o of t){const n=ht[o.state.type]??"backlog";(r=a.get(n))==null||r.push(o)}return a}function ft({linearIssues:t,localIssues:a,selectedItem:r,onSelectItem:o,composingColumnId:n,onStartCompose:d,onStopCompose:c,onIssueCreated:i,showDone:l=!0,batchMode:x,selectedIssueIds:h,onToggleIssueCheck:g}){const{t:m}=Z(),y=p.useRef(null),k=p.useCallback(b=>{const C=y.current;if(!C)return;const v=Array.from(C.querySelectorAll('[role="button"][tabindex="0"]')),s=document.activeElement,S=s?v.indexOf(s):-1;let z=-1;b.key==="ArrowDown"||b.key==="ArrowRight"?(b.preventDefault(),z=S<v.length-1?S+1:0):b.key==="ArrowUp"||b.key==="ArrowLeft"?(b.preventDefault(),z=S>0?S-1:v.length-1):b.key==="Home"?(b.preventDefault(),z=0):b.key==="End"&&(b.preventDefault(),z=v.length-1),z>=0&&v[z]&&v[z].focus()},[]);p.useEffect(()=>{const b=y.current;if(b)return b.addEventListener("keydown",k),()=>b.removeEventListener("keydown",k)},[k]);const N=p.useMemo(()=>gt(t??[]),[t]),u=p.useMemo(()=>mt(a??[]),[a]);return e.jsx("div",{ref:y,className:"flex gap-[var(--spacing-3)] h-full overflow-x-auto p-[var(--spacing-3)] scroll-smooth",children:ee.filter(b=>l||b.id!=="done").map((b,C)=>e.jsx(xt,{columnId:b.id,title:m(ut[b.id]),phases:[],color:pt[b.id]??L.not_started,animationDelay:C*50,onSelectPhase:()=>{},linearIssues:N.get(b.id),localIssues:u.get(b.id),selectedItem:r,onSelectItem:o,composingColumnId:n,onStartCompose:d,onStopCompose:c,onIssueCreated:i,batchMode:x,selectedIssueIds:h,onToggleIssueCheck:g},b.id))})}const bt={bug:"#C46555",feature:"#5B8DB8",improvement:"#9178B5",task:"#A09D97"},yt={urgent:"#C46555",high:"#B89540",medium:"#5B8DB8",low:"#A09D97"},jt={open:"Open",registered:"Registered",in_progress:"In Progress",resolved:"Resolved",closed:"Closed",deferred:"Deferred"},A="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";function Nt({localIssues:t,linearIssues:a,selectedItem:r,onSelectItem:o}){const n=((t==null?void 0:t.length)??0)>0,d=((a==null?void 0:a.length)??0)>0;return!n&&!d?e.jsx("div",{className:"flex items-center justify-center h-full text-text-secondary text-[length:var(--font-size-sm)]",children:"No data available"}):e.jsxs("div",{className:"flex flex-col gap-[var(--spacing-4)] h-full overflow-auto p-[var(--spacing-3)]",children:[n&&e.jsxs("section",{children:[e.jsx(pe,{label:"Issues",count:t.length}),e.jsx("div",{className:"rounded-[var(--radius-lg)] overflow-hidden border border-border-divider",children:e.jsxs("table",{className:"w-full border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-bg-secondary",children:[e.jsx("th",{className:`${A} w-[80px]`,children:"Type"}),e.jsx("th",{className:A,children:"Title"}),e.jsx("th",{className:`${A} w-[90px]`,children:"Priority"}),e.jsx("th",{className:`${A} w-[100px]`,children:"Status"})]})}),e.jsx("tbody",{children:t.map((c,i)=>{const l=bt[c.type]??"#A09D97",x=yt[c.priority]??"#A09D97",h=(r==null?void 0:r.type)==="issue"&&r.issue.id===c.id;return e.jsxs("tr",{onClick:()=>o==null?void 0:o({type:"issue",issue:c}),className:xe(i,h),children:[e.jsx("td",{className:"px-[var(--spacing-3)] py-[var(--spacing-2-5)]",children:e.jsx(ue,{label:c.type,color:l})}),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:c.title}),e.jsx("td",{className:"px-[var(--spacing-3)] py-[var(--spacing-2-5)]",children:e.jsx(ue,{label:c.priority,color:x})}),e.jsx("td",{className:"px-[var(--spacing-3)] py-[var(--spacing-2-5)] text-[length:var(--font-size-xs)] text-text-secondary whitespace-nowrap",children:jt[c.status]??c.status})]},c.id)})})]})})]}),d&&e.jsxs("section",{children:[e.jsx(pe,{label:"Linear",count:a.length}),e.jsx("div",{className:"rounded-[var(--radius-lg)] overflow-hidden border border-border-divider",children:e.jsxs("table",{className:"w-full border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-bg-secondary",children:[e.jsx("th",{className:`${A} w-[80px]`,children:"ID"}),e.jsx("th",{className:A,children:"Title"}),e.jsx("th",{className:`${A} w-[110px]`,children:"State"}),e.jsx("th",{className:`${A} w-[90px]`,children:"Priority"})]})}),e.jsx("tbody",{children:a.map((c,i)=>{const l=(r==null?void 0:r.type)==="linearIssue"&&r.issue.id===c.id;return e.jsxs("tr",{onClick:()=>o==null?void 0:o({type:"linearIssue",issue:c}),className:xe(i,l),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",children:c.identifier}),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:c.title}),e.jsx("td",{className:"px-[var(--spacing-3)] py-[var(--spacing-2-5)] text-[length:var(--font-size-xs)] text-text-secondary",children:c.state.name}),e.jsx("td",{className:"px-[var(--spacing-3)] py-[var(--spacing-2-5)] text-[length:var(--font-size-xs)] text-text-secondary",children:U[c.priority]})]},c.id)})})]})})]})]})}function xe(t,a){return["cursor-pointer transition-colors border-t border-border-divider",a?"bg-[rgba(90,130,200,0.08)]":t%2===0?"bg-bg-primary hover:bg-bg-hover":"bg-[rgba(0,0,0,0.015)] hover:bg-bg-hover"].join(" ")}function pe({label:t,count:a}){return e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] mb-[var(--spacing-2)]",children:[e.jsx("h3",{className:"text-[length:var(--font-size-xs)] font-[var(--font-weight-semibold)] uppercase tracking-wider text-text-tertiary",children:t}),e.jsx("span",{className:"text-[length:var(--font-size-xs)] text-text-tertiary bg-bg-secondary rounded-full px-[var(--spacing-1-5)] tabular-nums",children:a})]})}function ue({label:t,color:a}){return e.jsx("span",{className:"text-[length:var(--font-size-xs)] font-[var(--font-weight-medium)] px-2 py-[var(--spacing-0-5)] rounded-full whitespace-nowrap",style:{backgroundColor:`${a}20`,color:a},children:t})}/**
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 wt=[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]],kt=te("inbox",wt),Ct={bug:"#C46555",feature:"#5B8DB8",improvement:"#9178B5",task:"#A09D97"},St={urgent:"#C46555",high:"#B89540",medium:"#5B8DB8",low:"#A09D97"};function zt({localIssues:t,linearIssues:a,selectedItem:r,onSelectItem:o}){const n=p.useMemo(()=>(t??[]).filter(i=>i.status==="open"||i.status==="registered"||i.status==="in_progress"),[t]),d=p.useMemo(()=>(t??[]).filter(i=>i.status==="resolved"||i.status==="closed"||i.status==="deferred"),[t]),c=((t==null?void 0:t.length)??0)+((a==null?void 0:a.length)??0);return e.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[e.jsxs("div",{className:"flex items-center gap-[var(--spacing-4)] px-[var(--spacing-4)] py-[var(--spacing-2-5)] border-b border-border-divider shrink-0 bg-bg-secondary",children:[e.jsx(G,{label:"Issues",value:c,sub:`${n.length} open`,color:L.not_started}),e.jsx("div",{className:"w-px h-6 bg-border-divider"}),e.jsx(G,{label:"In Progress",value:(t??[]).filter(i=>i.status==="in_progress").length,sub:"active",color:L.executing}),e.jsx("div",{className:"w-px h-6 bg-border-divider"}),e.jsx(G,{label:"Resolved",value:d.length,sub:"done",color:L.completed})]}),e.jsxs("div",{className:"flex-1 grid grid-cols-[1fr_280px] overflow-hidden",children:[e.jsxs("div",{className:"flex flex-col overflow-hidden border-r border-border-divider",children:[e.jsx(he,{icon:e.jsx(kt,{size:14,strokeWidth:2}),label:"Issue Queue",children: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:[n.length," open"]})}),e.jsx("div",{className:"flex-1 overflow-y-auto py-[var(--spacing-1)]",children:n.length===0?e.jsx(_t,{message:"No open issues"}):n.map(i=>{const l=Ct[i.type]??"#A09D97",x=St[i.priority]??"#A09D97",h=(r==null?void 0:r.type)==="issue"&&r.issue.id===i.id;return e.jsxs("button",{type:"button",onClick:()=>o==null?void 0:o({type:"issue",issue:i}),className:["flex items-center gap-[var(--spacing-2)] px-[var(--spacing-4)] py-[var(--spacing-2)] w-full text-left transition-colors",h?"bg-[rgba(90,130,200,0.08)]":"hover:bg-bg-hover"].join(" "),children:[e.jsx("span",{className:"text-[length:9px] font-[var(--font-weight-semibold)] px-[6px] py-[2px] rounded-full shrink-0",style:{backgroundColor:`${l}20`,color:l},children:i.type}),e.jsx("span",{className:"flex-1 text-[length:var(--font-size-xs)] text-text-primary line-clamp-1",children:i.title}),e.jsx("span",{className:"text-[length:9px] font-[var(--font-weight-semibold)] px-[6px] py-[2px] rounded-full shrink-0",style:{backgroundColor:`${x}20`,color:x},children:i.priority})]},i.id)})})]}),e.jsxs("div",{className:"flex flex-col overflow-hidden",children:[e.jsx(he,{icon:e.jsx(qe,{size:14,strokeWidth:2}),label:"Summary"}),e.jsxs("div",{className:"flex-1 overflow-y-auto px-[var(--spacing-4)] py-[var(--spacing-3)] flex flex-col gap-[var(--spacing-4)]",children:[((t==null?void 0:t.length)??0)>0&&e.jsxs("div",{children:[e.jsx("span",{className:"text-[length:10px] text-text-tertiary uppercase tracking-wider font-[var(--font-weight-semibold)]",children:"Issues"}),e.jsxs("div",{className:"mt-[var(--spacing-2)] flex flex-col gap-[var(--spacing-1-5)]",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-[length:var(--font-size-xs)] text-text-secondary",children:"Open"}),e.jsx("span",{className:"text-[length:var(--font-size-xs)] font-[var(--font-weight-semibold)] text-text-primary tabular-nums",children:n.length})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-[length:var(--font-size-xs)] text-text-secondary",children:"In Progress"}),e.jsx("span",{className:"text-[length:var(--font-size-xs)] font-[var(--font-weight-semibold)] text-text-primary tabular-nums",children:(t??[]).filter(i=>i.status==="in_progress").length})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-[length:var(--font-size-xs)] text-text-secondary",children:"Resolved"}),e.jsx("span",{className:"text-[length:var(--font-size-xs)] font-[var(--font-weight-semibold)] text-text-primary tabular-nums",children:d.length})]})]})]}),((a==null?void 0:a.length)??0)>0&&e.jsxs("div",{children:[e.jsx("span",{className:"text-[length:10px] text-text-tertiary uppercase tracking-wider font-[var(--font-weight-semibold)]",children:"Linear"}),e.jsx("div",{className:"mt-[var(--spacing-2)]",children:e.jsxs("span",{className:"text-[length:var(--font-size-xs)] text-text-secondary",children:[a.length," issues"]})})]})]})]})]})]})}function G({label:t,value:a,sub:r,color:o}){return e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"text-[length:var(--font-size-xs)] text-text-tertiary",children:t}),e.jsxs("div",{className:"flex items-baseline gap-[var(--spacing-1-5)]",children:[e.jsx("span",{className:"text-[length:var(--font-size-base)] font-[var(--font-weight-semibold)]",style:{color:o},children:a}),e.jsx("span",{className:"text-[length:10px] text-text-tertiary",children:r})]})]})}function he({icon:t,label:a,children:r}){return 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("span",{className:"text-text-tertiary",children:t}),e.jsx("span",{className:"text-[length:var(--font-size-xs)] font-[var(--font-weight-semibold)] uppercase tracking-wider text-text-tertiary",children:a}),r]})}function _t({message:t}){return e.jsx("div",{className:"text-[length:var(--font-size-xs)] text-text-tertiary text-center py-[var(--spacing-6)] italic",children:t})}function Et({issues:t,onClose:a}){const[r,o]=p.useState(new Set),[n,d]=p.useState(!1),[c,i]=p.useState(null),l=K(m=>m.importIssues);function x(){r.size===t.length?o(new Set):o(new Set(t.map(m=>m.id)))}function h(m){const y=new Set(r);y.has(m)?y.delete(m):y.add(m),o(y)}async function g(){const m=t.filter(y=>r.has(y.id));if(m.length!==0){d(!0);try{const y=await l(m);i(y)}catch(y){i({imported:0,errors:[String(y)]})}finally{d(!1)}}}return e.jsx(fe,{open:!0,onOpenChange:m=>!m&&a(),children:e.jsxs(be,{children:[e.jsx(ye,{className:"fixed inset-0 z-50 bg-black/50 backdrop-blur-sm"}),e.jsxs(je,{className:ke("fixed left-1/2 top-1/2 z-50 -translate-x-1/2 -translate-y-1/2","w-[600px] max-w-[95vw] max-h-[80vh]","rounded-[var(--radius-lg)] border border-border bg-bg-primary shadow-lg","flex flex-col overflow-hidden focus:outline-none"),children:[e.jsxs("div",{className:"flex items-center justify-between px-[var(--spacing-4)] py-[var(--spacing-3)] border-b border-border",children:[e.jsx(Ne,{className:"text-[length:var(--font-size-base)] font-[var(--font-weight-semibold)] text-text-primary",children:"Import from Linear"}),e.jsx(we,{className:"w-7 h-7 flex items-center justify-center rounded-[var(--radius-sm)] text-text-secondary hover:text-text-primary hover:bg-bg-hover",children:e.jsxs("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),c?e.jsxs("div",{className:"p-[var(--spacing-4)] space-y-[var(--spacing-3)]",children:[e.jsxs("p",{className:"text-[length:var(--font-size-sm)] text-text-primary",children:["Imported ",c.imported," issue(s)."]}),c.errors.length>0&&e.jsx("div",{className:"text-[length:var(--font-size-xs)] text-status-blocked",children:c.errors.map((m,y)=>e.jsx("div",{children:m},y))}),e.jsx("button",{type:"button",onClick:a,className:"px-[var(--spacing-3)] py-[var(--spacing-1-5)] rounded-[var(--radius-sm)] bg-accent-blue text-white text-[length:var(--font-size-sm)] hover:opacity-90",children:"Done"})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"px-[var(--spacing-4)] py-[var(--spacing-2)] bg-bg-secondary border-b border-border",children:e.jsxs("p",{className:"text-[length:var(--font-size-xs)] text-text-secondary",children:["Linear issues will be mapped: ",e.jsx("span",{className:"font-mono",children:"identifier"})," → title prefix, ",e.jsx("span",{className:"font-mono",children:"priority"})," → local priority, ",e.jsx("span",{className:"font-mono",children:"state.type"})," → local status"]})}),e.jsx("div",{className:"flex-1 overflow-y-auto",children:t.length===0?e.jsx("div",{className:"p-[var(--spacing-4)] text-[length:var(--font-size-sm)] text-text-secondary text-center",children:"No Linear issues available"}):e.jsxs("table",{className:"w-full text-[length:var(--font-size-xs)]",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border text-text-tertiary",children:[e.jsx("th",{className:"w-8 p-[var(--spacing-2)]",children:e.jsx("input",{type:"checkbox",checked:r.size===t.length,onChange:x})}),e.jsx("th",{className:"text-left p-[var(--spacing-2)]",children:"Issue"}),e.jsx("th",{className:"text-left p-[var(--spacing-2)]",children:"Status"}),e.jsx("th",{className:"text-left p-[var(--spacing-2)]",children:"Priority"})]})}),e.jsx("tbody",{children:t.map(m=>e.jsxs("tr",{className:"border-b border-border-divider hover:bg-bg-hover cursor-pointer",onClick:()=>h(m.id),children:[e.jsx("td",{className:"p-[var(--spacing-2)]",children:e.jsx("input",{type:"checkbox",checked:r.has(m.id),onChange:()=>h(m.id)})}),e.jsxs("td",{className:"p-[var(--spacing-2)]",children:[e.jsx("span",{className:"font-mono text-text-tertiary",children:m.identifier})," ",e.jsx("span",{className:"text-text-primary",children:m.title})]}),e.jsx("td",{className:"p-[var(--spacing-2)] text-text-secondary",children:m.state.name}),e.jsx("td",{className:"p-[var(--spacing-2)] text-text-secondary",children:U[m.priority]})]},m.id))})]})}),e.jsxs("div",{className:"flex items-center justify-between px-[var(--spacing-4)] py-[var(--spacing-3)] border-t border-border",children:[e.jsxs("span",{className:"text-[length:var(--font-size-xs)] text-text-secondary",children:[r.size," of ",t.length," selected"]}),e.jsxs("div",{className:"flex gap-[var(--spacing-2)]",children:[e.jsx("button",{type:"button",onClick:a,className:"px-[var(--spacing-3)] py-[var(--spacing-1-5)] rounded-[var(--radius-sm)] border border-border text-text-secondary text-[length:var(--font-size-sm)] hover:bg-bg-hover",children:"Cancel"}),e.jsx("button",{type:"button",onClick:()=>void g(),disabled:r.size===0||n,className:"px-[var(--spacing-3)] py-[var(--spacing-1-5)] rounded-[var(--radius-sm)] bg-accent-blue text-white text-[length:var(--font-size-sm)] hover:opacity-90 disabled:opacity-50",children:n?"Importing...":`Import ${r.size} issue(s)`})]})]})]})]})]})})}function Lt({teams:t,selectedTeamId:a,onClose:r}){var C;const[o,n]=p.useState(a??((C=t[0])==null?void 0:C.id)??""),[d,c]=p.useState(new Set),[i,l]=p.useState(!1),[x,h]=p.useState(null),g=O(v=>v.issues),m=O(v=>v.fetchIssues),y=K(v=>v.exportIssues),k=K(v=>v.refresh);p.useEffect(()=>{m()},[m]);function N(){d.size===g.length?c(new Set):c(new Set(g.map(v=>v.id)))}function u(v){const s=new Set(d);s.has(v)?s.delete(v):s.add(v),c(s)}async function b(){const v=g.filter(s=>d.has(s.id));if(!(v.length===0||!o)){l(!0);try{const s=await y(v,o);h(s),await k()}catch(s){h({exported:0,errors:[String(s)]})}finally{l(!1)}}}return e.jsx(fe,{open:!0,onOpenChange:v=>!v&&r(),children:e.jsxs(be,{children:[e.jsx(ye,{className:"fixed inset-0 z-50 bg-black/50 backdrop-blur-sm"}),e.jsxs(je,{className:ke("fixed left-1/2 top-1/2 z-50 -translate-x-1/2 -translate-y-1/2","w-[600px] max-w-[95vw] max-h-[80vh]","rounded-[var(--radius-lg)] border border-border bg-bg-primary shadow-lg","flex flex-col overflow-hidden focus:outline-none"),children:[e.jsxs("div",{className:"flex items-center justify-between px-[var(--spacing-4)] py-[var(--spacing-3)] border-b border-border",children:[e.jsx(Ne,{className:"text-[length:var(--font-size-base)] font-[var(--font-weight-semibold)] text-text-primary",children:"Export to Linear"}),e.jsx(we,{className:"w-7 h-7 flex items-center justify-center rounded-[var(--radius-sm)] text-text-secondary hover:text-text-primary hover:bg-bg-hover",children:e.jsxs("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),x?e.jsxs("div",{className:"p-[var(--spacing-4)] space-y-[var(--spacing-3)]",children:[e.jsxs("p",{className:"text-[length:var(--font-size-sm)] text-text-primary",children:["Exported ",x.exported," issue(s) to Linear."]}),x.errors.length>0&&e.jsx("div",{className:"text-[length:var(--font-size-xs)] text-status-blocked",children:x.errors.map((v,s)=>e.jsx("div",{children:v},s))}),e.jsx("button",{type:"button",onClick:r,className:"px-[var(--spacing-3)] py-[var(--spacing-1-5)] rounded-[var(--radius-sm)] bg-accent-blue text-white text-[length:var(--font-size-sm)] hover:opacity-90",children:"Done"})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"px-[var(--spacing-4)] py-[var(--spacing-2)] bg-bg-secondary border-b border-border space-y-[var(--spacing-2)]",children:[e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)]",children:[e.jsx("label",{className:"text-[length:var(--font-size-xs)] text-text-secondary shrink-0",children:"Target team:"}),e.jsx("select",{value:o,onChange:v=>n(v.target.value),className:"px-[var(--spacing-2)] py-[var(--spacing-1)] rounded-[var(--radius-sm)] border border-border bg-bg-primary text-text-primary text-[length:var(--font-size-xs)]",children:t.map(v=>e.jsxs("option",{value:v.id,children:[v.key," — ",v.name]},v.id))})]}),e.jsxs("p",{className:"text-[length:var(--font-size-xs)] text-text-secondary",children:["Local issues will be created in Linear: ",e.jsx("span",{className:"font-mono",children:"title"})," → title, ",e.jsx("span",{className:"font-mono",children:"priority"})," → Linear priority, ",e.jsx("span",{className:"font-mono",children:"description"})," → description"]})]}),e.jsx("div",{className:"flex-1 overflow-y-auto",children:g.length===0?e.jsx("div",{className:"p-[var(--spacing-4)] text-[length:var(--font-size-sm)] text-text-secondary text-center",children:"No local issues available"}):e.jsxs("table",{className:"w-full text-[length:var(--font-size-xs)]",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border text-text-tertiary",children:[e.jsx("th",{className:"w-8 p-[var(--spacing-2)]",children:e.jsx("input",{type:"checkbox",checked:d.size===g.length&&g.length>0,onChange:N})}),e.jsx("th",{className:"text-left p-[var(--spacing-2)]",children:"Title"}),e.jsx("th",{className:"text-left p-[var(--spacing-2)]",children:"Status"}),e.jsx("th",{className:"text-left p-[var(--spacing-2)]",children:"Priority"})]})}),e.jsx("tbody",{children:g.map(v=>e.jsxs("tr",{className:"border-b border-border-divider hover:bg-bg-hover cursor-pointer",onClick:()=>u(v.id),children:[e.jsx("td",{className:"p-[var(--spacing-2)]",children:e.jsx("input",{type:"checkbox",checked:d.has(v.id),onChange:()=>u(v.id)})}),e.jsx("td",{className:"p-[var(--spacing-2)] text-text-primary",children:v.title}),e.jsx("td",{className:"p-[var(--spacing-2)] text-text-secondary",children:v.status}),e.jsx("td",{className:"p-[var(--spacing-2)] text-text-secondary",children:v.priority})]},v.id))})]})}),e.jsxs("div",{className:"flex items-center justify-between px-[var(--spacing-4)] py-[var(--spacing-3)] border-t border-border",children:[e.jsxs("span",{className:"text-[length:var(--font-size-xs)] text-text-secondary",children:[d.size," of ",g.length," selected"]}),e.jsxs("div",{className:"flex gap-[var(--spacing-2)]",children:[e.jsx("button",{type:"button",onClick:r,className:"px-[var(--spacing-3)] py-[var(--spacing-1-5)] rounded-[var(--radius-sm)] border border-border text-text-secondary text-[length:var(--font-size-sm)] hover:bg-bg-hover",children:"Cancel"}),e.jsx("button",{type:"button",onClick:()=>void b(),disabled:d.size===0||!o||i,className:"px-[var(--spacing-3)] py-[var(--spacing-1-5)] rounded-[var(--radius-sm)] bg-accent-blue text-white text-[length:var(--font-size-sm)] hover:opacity-90 disabled:opacity-50",children:i?"Exporting...":`Export ${d.size} issue(s)`})]})]})]})]})]})})}/**
7
+ * @license lucide-react v0.577.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */const Dt=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],Tt=te("layout-dashboard",Dt);/**
12
+ * @license lucide-react v0.577.0 - ISC
13
+ *
14
+ * This source code is licensed under the ISC license.
15
+ * See the LICENSE file in the root directory of this source tree.
16
+ */const Bt=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],At=te("upload",Bt),Pt={"claude-code":"Claude Code",codex:"Codex",gemini:"Gemini",qwen:"Qwen",opencode:"OpenCode"};function Ot(){var k,N;const t=D(u=>u.cliPanelIssueId),a=D(u=>u.closeCliPanel),r=D(u=>u.getSlotForIssue),n=O(u=>u.issues).find(u=>u.id===t),d=t?r(t):void 0,c=(d==null?void 0:d.processId)??((k=n==null?void 0:n.execution)==null?void 0:k.processId)??null,i=Oe(u=>u.processes),l=c?i[c]:void 0,x=p.useCallback(()=>{c&&R({action:"stop",processId:c})},[c]);if(!t||!n)return null;const h=(l==null?void 0:l.status)==="running"||(l==null?void 0:l.status)==="spawning",g=((N=n.execution)==null?void 0:N.status)??"idle",m=(d==null?void 0:d.executor)??n.executor??"claude-code",y=Pt[m]??"Agent";return e.jsxs("div",{className:"flex flex-col h-full border-l border-border-divider bg-bg-primary w-[480px] shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] px-[var(--spacing-3)] py-[var(--spacing-2)] border-b border-border-divider shrink-0",children:[e.jsx("h3",{className:"text-[length:var(--font-size-sm)] font-[var(--font-weight-semibold)] text-text-primary truncate flex-1",children:n.title}),e.jsx("span",{className:"text-[length:10px] font-[var(--font-weight-medium)] px-2 py-[2px] rounded-full bg-bg-hover text-text-secondary shrink-0",children:y}),e.jsx("span",{className:["text-[length:10px] font-[var(--font-weight-medium)] px-2 py-[2px] rounded-full shrink-0",g==="running"?"bg-[#B8954020] text-[#B89540]":g==="completed"?"bg-[#5A9E7820] text-[#5A9E78]":g==="failed"?"bg-[#C4655520] text-[#C46555]":"bg-bg-hover text-text-secondary"].join(" "),children:g}),h&&e.jsx("button",{type:"button",onClick:x,className:"text-[length:var(--font-size-xs)] px-2 py-1 rounded-[var(--radius-sm)] border border-[#C46555] text-[#C46555] hover:bg-[#C4655510] transition-colors shrink-0",children:"Stop"}),e.jsx("button",{type:"button",onClick:a,className:"w-6 h-6 flex items-center justify-center rounded-[var(--radius-sm)] text-text-tertiary hover:text-text-primary hover:bg-bg-hover transition-colors shrink-0","aria-label":"Close panel",children:e.jsxs("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),e.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:e.jsx(Ge,{processId:c})}),e.jsx(Xe,{processId:c,executor:m})]})}const $t=[{value:"claude-code",label:"Claude Code"},{value:"codex",label:"Codex"},{value:"gemini",label:"Gemini"}];function Rt(){const t=D(c=>c.selectedIssueIds),a=D(c=>c.clearSelection),[r,o]=p.useState("claude-code"),n=t.size,d=p.useCallback(()=>{n!==0&&(R({action:"execute:batch",issueIds:Array.from(t),executor:r}),a())},[t,r,n,a]);return n===0?null:e.jsxs("div",{className:"fixed bottom-6 left-1/2 -translate-x-1/2 z-50 flex items-center gap-[var(--spacing-2)] px-[var(--spacing-4)] py-[var(--spacing-2)] rounded-full bg-bg-card border border-border shadow-[0_8px_32px_rgba(0,0,0,0.12)] backdrop-blur-sm",children:[e.jsxs("span",{className:"text-[length:var(--font-size-sm)] font-[var(--font-weight-semibold)] text-text-primary",children:[n," selected"]}),e.jsx("div",{className:"w-px h-5 bg-border-divider"}),e.jsx("select",{value:r,onChange:c=>o(c.target.value),className:"px-[var(--spacing-2)] py-[var(--spacing-1)] rounded-[var(--radius-sm)] border border-border bg-bg-primary text-text-primary text-[length:var(--font-size-xs)] cursor-pointer",children:$t.map(c=>e.jsx("option",{value:c.value,children:c.label},c.value))}),e.jsxs("button",{type:"button",onClick:d,className:"flex items-center gap-[var(--spacing-1)] px-[var(--spacing-3)] py-[var(--spacing-1)] rounded-full bg-accent-blue text-white text-[length:var(--font-size-sm)] font-[var(--font-weight-medium)] hover:opacity-90 transition-opacity",children:[e.jsx("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("polygon",{points:"5,3 19,12 5,21"})}),"Execute"]}),e.jsx("button",{type:"button",onClick:a,className:"w-6 h-6 flex items-center justify-center rounded-full text-text-tertiary hover:text-text-primary hover:bg-bg-hover transition-colors","aria-label":"Clear selection",children:e.jsxs("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})}const It={create_issue:{bg:"rgba(91, 141, 184, 0.1)",text:"#5B8DB8"},execute_issue:{bg:"rgba(90, 158, 120, 0.1)",text:"#5A9E78"},analyze_issue:{bg:"rgba(145, 120, 181, 0.1)",text:"#9178B5"},plan_issue:{bg:"rgba(145, 120, 181, 0.1)",text:"#9178B5"},advance_phase:{bg:"rgba(184, 149, 64, 0.1)",text:"#B89540"},flag_blocker:{bg:"rgba(196, 101, 85, 0.1)",text:"#C46555"}};function Mt(){const t=D(l=>l.recentDecisions),[a,r]=p.useState(new Set),[o,n]=p.useState(!1),d=p.useMemo(()=>{const l=[];for(const x of t)for(const h of x.deferred){const g=`${x.id}-${h.type}-${h.target}`;a.has(g)||l.push({decisionId:x.id,action:h,timestamp:x.timestamp})}return l.slice(-5)},[t,a]),c=p.useCallback(l=>{l.action.type==="execute_issue"&&R({action:"execute:issue",issueId:l.action.target,executor:l.action.executor??"claude-code"}),r(x=>{const h=new Set(x);return h.add(`${l.decisionId}-${l.action.type}-${l.action.target}`),h})},[]),i=p.useCallback(l=>{r(x=>{const h=new Set(x);return h.add(`${l.decisionId}-${l.action.type}-${l.action.target}`),h})},[]);return d.length===0?null:e.jsxs("div",{className:"border-b border-border-divider bg-bg-secondary",children:[e.jsx("div",{className:"flex items-center justify-between px-[var(--spacing-4)] py-[var(--spacing-1-5)]",children:e.jsxs("button",{type:"button",onClick:()=>n(!o),className:"flex items-center gap-[var(--spacing-1-5)] text-[length:var(--font-size-xs)] font-[var(--font-weight-medium)] text-text-secondary hover:text-text-primary transition-colors",children:[e.jsx("span",{className:"inline-block w-[5px] h-[5px] rounded-full bg-accent-blue animate-pulse"}),"Commander Recommendations (",d.length,")",e.jsx("svg",{className:`w-3 h-3 transition-transform duration-150 ${o?"":"rotate-180"}`,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("polyline",{points:"6 9 12 15 18 9"})})]})}),!o&&e.jsx("div",{className:"flex flex-wrap gap-[var(--spacing-2)] px-[var(--spacing-4)] pb-[var(--spacing-2)]",children:d.map(l=>{const x=It[l.action.type]??{bg:"var(--color-bg-secondary)",text:"var(--color-text-secondary)"};return e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] px-[var(--spacing-3)] py-[var(--spacing-1-5)] rounded-[var(--radius-md)] text-[length:var(--font-size-xs)]",style:{backgroundColor:x.bg},children:[e.jsx("span",{className:"font-[var(--font-weight-medium)]",style:{color:x.text},children:l.action.type.replace("_"," ")}),e.jsx("span",{className:"text-text-secondary truncate max-w-[200px]",title:l.action.target,children:l.action.target}),l.action.reason&&e.jsxs("span",{className:"text-text-tertiary truncate max-w-[150px]",title:l.action.reason,children:["— ",l.action.reason]}),e.jsxs("div",{className:"flex items-center gap-[var(--spacing-1)] ml-auto",children:[l.action.type==="execute_issue"&&e.jsx("button",{type:"button",onClick:()=>c(l),className:"text-[10px] font-[var(--font-weight-medium)] px-[var(--spacing-2)] py-[var(--spacing-0-5)] rounded-full transition-colors",style:{backgroundColor:"rgba(90, 158, 120, 0.15)",color:"#5A9E78"},children:"Approve"}),e.jsx("button",{type:"button",onClick:()=>i(l),className:"text-[10px] text-text-tertiary hover:text-text-secondary transition-colors px-1",children:"x"})]})]},`${l.decisionId}-${l.action.type}-${l.action.target}`)})})]})}const Ce=[{value:"bug",label:"Bug",color:"#C46555"},{value:"feature",label:"Feature",color:"#5B8DB8"},{value:"improvement",label:"Improve",color:"#9178B5"},{value:"task",label:"Task",color:"#A09D97"}],Se=[{value:"urgent",label:"Urgent",color:"#C46555"},{value:"high",label:"High",color:"#B89540"},{value:"medium",label:"Medium",color:"#5B8DB8"},{value:"low",label:"Low",color:"#A09D97"}];function ve({type:t,setType:a,priority:r,setPriority:o,dark:n}){const d=n?"20":"18",c=n?"35":"28";return e.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[Ce.map(i=>e.jsx("button",{type:"button",onClick:()=>a(i.value),className:"text-[10px] font-medium px-2 py-[2px] rounded-full transition-all duration-100",style:{background:`${i.color}${t===i.value?c:d}`,color:i.color,outline:t===i.value?`1.5px solid ${i.color}70`:"none"},children:i.label},i.value)),e.jsx("div",{className:"w-px h-3",style:{backgroundColor:n?"rgba(255,255,255,0.12)":"var(--color-border-divider)"}}),Se.map(i=>e.jsx("button",{type:"button",onClick:()=>o(i.value),className:"text-[10px] font-medium px-2 py-[2px] rounded-full transition-all duration-100",style:{background:`${i.color}${r===i.value?c:d}`,color:i.color,outline:r===i.value?`1.5px solid ${i.color}70`:"none"},children:i.label},i.value))]})}function Kt({open:t,columnId:a,style:r,onClose:o,onCreated:n}){const[d,c]=p.useState(""),[i,l]=p.useState(""),[x,h]=p.useState("task"),[g,m]=p.useState("medium"),[y,k]=p.useState(!1),N=p.useRef(null),u=p.useRef(null),b=O(s=>s.createIssue);p.useEffect(()=>{t&&(c(""),l(""),h("task"),m("medium"),requestAnimationFrame(()=>{var s;return(s=N.current)==null?void 0:s.focus()}))},[t]),p.useEffect(()=>{function s(S){S.key==="Escape"&&o()}return t&&window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[t,o]);const C=p.useCallback(async()=>{const s=d.trim();!s||y||(k(!0),await b({title:s,description:i.trim(),type:x,priority:g}),k(!1),n==null||n(),o())},[d,i,x,g,y,b,n,o]);function v(s){s.key==="Enter"&&(s.metaKey||s.ctrlKey)&&C()}return t?r===1?e.jsx("div",{className:"fixed inset-0 z-50 flex items-start justify-center pt-[13vh]",style:{backgroundColor:"rgba(0,0,0,0.75)",backdropFilter:"blur(3px)"},onClick:o,children:e.jsxs("div",{className:"w-full max-w-[540px] mx-4 rounded-[14px] overflow-hidden motion-safe:animate-[modal-enter_150ms_ease-out_both]",style:{backgroundColor:"#1D1B18",boxShadow:"0 28px 90px rgba(0,0,0,0.55), 0 0 0 1px rgba(255,255,255,0.07)",borderTop:"2.5px solid var(--color-accent-orange)"},onClick:s=>s.stopPropagation(),children:[e.jsx("div",{className:"px-5 pt-5 pb-3",children:e.jsx("input",{ref:N,value:d,onChange:s=>c(s.target.value),onKeyDown:s=>{s.key==="Enter"&&!s.shiftKey&&(s.preventDefault(),C()),v(s)},placeholder:"What needs to be done?",className:"w-full bg-transparent text-[length:var(--font-size-base)] font-medium outline-none",style:{color:"rgba(255,255,255,0.88)",caretColor:"var(--color-accent-orange)"}})}),e.jsx("div",{className:"px-5 pb-4 pt-3 border-t",style:{borderColor:"rgba(255,255,255,0.07)"},children:e.jsx(ve,{type:x,setType:h,priority:g,setPriority:m,dark:!0})}),e.jsxs("div",{className:"flex items-center justify-between px-5 py-2.5 border-t text-[10px]",style:{borderColor:"rgba(255,255,255,0.07)",color:"rgba(255,255,255,0.3)"},children:[e.jsxs("span",{children:[e.jsx("kbd",{className:"px-1 py-0.5 rounded font-mono text-[9px]",style:{backgroundColor:"rgba(255,255,255,0.08)"},children:"↵"})," ","create · "," ",e.jsx("kbd",{className:"px-1 py-0.5 rounded font-mono text-[9px]",style:{backgroundColor:"rgba(255,255,255,0.08)"},children:"Esc"})," ","cancel"]}),e.jsx("span",{className:"opacity-60",children:a})]})]})}):r===2?e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",style:{backgroundColor:"rgba(0,0,0,0.44)"},onClick:o,children:e.jsxs("div",{className:"w-full max-w-[540px] rounded-[var(--radius-xl)] border overflow-hidden motion-safe:animate-[modal-enter_160ms_ease-out_both]",style:{backgroundColor:"var(--color-bg-card)",borderColor:"var(--color-border)",boxShadow:"var(--shadow-lg)"},onClick:s=>s.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center justify-between px-5 py-3.5 border-b",style:{borderColor:"var(--color-border-divider)"},children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-[length:var(--font-size-sm)] font-semibold text-text-primary",children:"New Issue"}),e.jsx("span",{className:"text-[10px] font-medium px-2 py-0.5 rounded-full capitalize",style:{backgroundColor:"var(--color-bg-secondary)",color:"var(--color-text-tertiary)"},children:a.replace("-"," ")})]}),e.jsx("button",{type:"button",onClick:o,className:"w-6 h-6 flex items-center justify-center rounded text-text-tertiary hover:text-text-primary hover:bg-bg-hover transition-colors",children:e.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),e.jsxs("div",{className:"px-5 py-4 space-y-4",children:[e.jsxs("div",{children:[e.jsxs("label",{className:"block text-[10px] font-semibold uppercase tracking-wider mb-1.5",style:{color:"var(--color-text-tertiary)"},children:["Title ",e.jsx("span",{style:{color:"var(--color-accent-red)"},children:"*"})]}),e.jsx("input",{ref:N,value:d,onChange:s=>c(s.target.value),onKeyDown:v,placeholder:"Issue title...",className:"w-full px-3 py-2 rounded-[var(--radius-default)] border text-[length:var(--font-size-sm)] text-text-primary placeholder:text-text-placeholder bg-transparent outline-none transition-colors",style:{borderColor:"var(--color-border)"},onFocus:s=>{s.target.style.borderColor="var(--color-accent-blue)"},onBlur:s=>{s.target.style.borderColor="var(--color-border)"}})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[10px] font-semibold uppercase tracking-wider mb-1.5",style:{color:"var(--color-text-tertiary)"},children:"Description"}),e.jsx("textarea",{ref:u,value:i,onChange:s=>l(s.target.value),onKeyDown:v,placeholder:"Optional description...",rows:3,className:"w-full px-3 py-2 rounded-[var(--radius-default)] border text-[length:var(--font-size-sm)] text-text-primary placeholder:text-text-placeholder bg-transparent outline-none resize-none transition-colors",style:{borderColor:"var(--color-border)"},onFocus:s=>{s.target.style.borderColor="var(--color-accent-blue)"},onBlur:s=>{s.target.style.borderColor="var(--color-border)"}})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[10px] font-semibold uppercase tracking-wider mb-2",style:{color:"var(--color-text-tertiary)"},children:"Type"}),e.jsx("div",{className:"flex gap-2 flex-wrap",children:Ce.map(s=>e.jsx("button",{type:"button",onClick:()=>h(s.value),className:"text-[11px] font-medium px-3 py-1 rounded-[var(--radius-default)] transition-all",style:{background:x===s.value?`${s.color}25`:"var(--color-bg-secondary)",color:x===s.value?s.color:"var(--color-text-secondary)",outline:x===s.value?`1.5px solid ${s.color}55`:"none"},children:s.label},s.value))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[10px] font-semibold uppercase tracking-wider mb-2",style:{color:"var(--color-text-tertiary)"},children:"Priority"}),e.jsx("div",{className:"flex gap-2 flex-wrap",children:Se.map(s=>e.jsx("button",{type:"button",onClick:()=>m(s.value),className:"text-[11px] font-medium px-3 py-1 rounded-[var(--radius-default)] transition-all",style:{background:g===s.value?`${s.color}25`:"var(--color-bg-secondary)",color:g===s.value?s.color:"var(--color-text-secondary)",outline:g===s.value?`1.5px solid ${s.color}55`:"none"},children:s.label},s.value))})]})]}),e.jsxs("div",{className:"flex items-center justify-between px-5 py-3.5 border-t",style:{borderColor:"var(--color-border-divider)"},children:[e.jsxs("span",{className:"text-[10px]",style:{color:"var(--color-text-tertiary)"},children:[e.jsx("kbd",{className:"px-1 py-0.5 rounded font-mono text-[9px]",style:{backgroundColor:"var(--color-bg-secondary)"},children:"⌘↵"})," ","to create"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{type:"button",onClick:o,className:"px-4 py-1.5 rounded-[var(--radius-default)] text-[length:var(--font-size-xs)] border transition-colors hover:bg-bg-hover",style:{borderColor:"var(--color-border)",color:"var(--color-text-secondary)"},children:"Cancel"}),e.jsx("button",{type:"button",onClick:()=>void C(),disabled:!d.trim()||y,className:"px-4 py-1.5 rounded-[var(--radius-default)] text-[length:var(--font-size-xs)] text-white font-medium transition-all disabled:opacity-40",style:{backgroundColor:"var(--color-accent-orange)"},children:y?"Creating…":"Create Issue"})]})]})]})}):e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",style:{backgroundColor:"var(--color-bg-primary)"},onClick:o,children:[e.jsxs("div",{className:"absolute top-5 right-6 flex items-center gap-2",children:[e.jsx("button",{type:"button",onClick:()=>void C(),disabled:!d.trim()||y,className:"px-4 py-1.5 rounded-[var(--radius-default)] text-[length:var(--font-size-xs)] text-white font-medium transition-all disabled:opacity-40",style:{backgroundColor:"var(--color-accent-orange)"},children:y?"Creating…":"Create"}),e.jsx("button",{type:"button",onClick:o,className:"w-8 h-8 flex items-center justify-center rounded text-text-tertiary hover:text-text-primary hover:bg-bg-hover transition-colors",children:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),e.jsxs("div",{className:"w-full max-w-[720px] px-8 motion-safe:animate-[modal-enter_180ms_ease-out_both]",onClick:s=>s.stopPropagation(),children:[e.jsxs("div",{className:"text-[10px] font-semibold uppercase tracking-widest mb-4",style:{color:"var(--color-text-tertiary)"},children:["New Issue · ",a.replace("-"," ")]}),e.jsx("input",{ref:N,value:d,onChange:s=>c(s.target.value),onKeyDown:s=>{var S;s.key==="Enter"&&!s.shiftKey&&(s.preventDefault(),(S=u.current)==null||S.focus()),v(s)},placeholder:"Untitled issue",className:"w-full bg-transparent outline-none mb-5 leading-tight",style:{fontSize:"var(--font-size-2xl)",fontWeight:700,color:"var(--color-text-primary)",caretColor:"var(--color-accent-orange)"}}),e.jsx("textarea",{ref:u,value:i,onChange:s=>l(s.target.value),onKeyDown:v,placeholder:"Add a description… (optional)",rows:7,className:"w-full bg-transparent outline-none resize-none leading-relaxed mb-8",style:{fontSize:"var(--font-size-base)",color:"var(--color-text-secondary)",caretColor:"var(--color-accent-orange)"}}),e.jsxs("div",{className:"flex items-center gap-4 pt-4 border-t flex-wrap",style:{borderColor:"var(--color-border-divider)"},children:[e.jsx(ve,{type:x,setType:h,priority:g,setPriority:m}),e.jsxs("div",{className:"ml-auto text-[10px]",style:{color:"var(--color-text-tertiary)"},children:[e.jsx("kbd",{className:"px-1 py-0.5 rounded font-mono text-[9px]",style:{backgroundColor:"var(--color-bg-secondary)"},children:"⌘↵"})," ","to create"]})]})]})]}):null}const me={high:{color:"#5A9E78",bg:"#5A9E7820"},medium:{color:"#B89540",bg:"#B8954020"},low:{color:"#C46555",bg:"#C4655520"}};function Ut(t){return t>=.7?"high":t>=.4?"medium":"low"}function Ft({analysis:t}){const a=Ut(t.confidence),r=me[a]??me.low;return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider mb-1",style:{color:"var(--color-text-tertiary)"},children:"Root Cause"}),e.jsx("p",{className:"leading-relaxed whitespace-pre-wrap",style:{fontSize:"var(--font-size-sm)",color:"var(--color-text-secondary)"},children:t.root_cause})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider mb-1",style:{color:"var(--color-text-tertiary)"},children:"Impact"}),e.jsx("p",{className:"leading-relaxed whitespace-pre-wrap",style:{fontSize:"var(--font-size-sm)",color:"var(--color-text-secondary)"},children:t.impact})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--color-text-tertiary)"},children:"Confidence"}),e.jsxs("span",{className:"text-[10px] font-medium px-2 py-0.5 rounded-full",style:{backgroundColor:r.bg,color:r.color},children:[a," (",Math.round(t.confidence*100),"%)"]})]}),t.related_files.length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider mb-1",style:{color:"var(--color-text-tertiary)"},children:"Related Files"}),e.jsx("ul",{className:"space-y-0.5",children:t.related_files.map((o,n)=>e.jsx("li",{className:"font-mono text-[11px] truncate",style:{color:"var(--color-text-secondary)"},children:o},n))})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider mb-1",style:{color:"var(--color-text-tertiary)"},children:"Suggested Approach"}),e.jsx("p",{className:"leading-relaxed whitespace-pre-wrap",style:{fontSize:"var(--font-size-sm)",color:"var(--color-text-secondary)"},children:t.suggested_approach})]}),e.jsxs("div",{className:"text-[10px] pt-1",style:{color:"var(--color-text-tertiary)"},children:["Analyzed by ",t.analyzed_by," at ",new Date(t.analyzed_at).toLocaleString()]})]})}function Ht({solution:t}){return e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-left",style:{fontSize:"var(--font-size-xs)"},children:[e.jsx("thead",{children:e.jsxs("tr",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--color-text-tertiary)"},children:[e.jsx("th",{className:"py-1 pr-2 w-6",children:"#"}),e.jsx("th",{className:"py-1 pr-2",children:"Target"}),e.jsx("th",{className:"py-1 pr-2",children:"Description"}),e.jsx("th",{className:"py-1",children:"Verification"})]})}),e.jsx("tbody",{children:t.steps.map((a,r)=>e.jsxs("tr",{className:"border-t",style:{borderColor:"var(--color-border-divider)"},children:[e.jsx("td",{className:"py-1.5 pr-2 font-mono",style:{color:"var(--color-text-tertiary)"},children:r+1}),e.jsx("td",{className:"py-1.5 pr-2 font-mono truncate max-w-[120px]",style:{color:"var(--color-text-secondary)"},title:a.target,children:a.target??"-"}),e.jsx("td",{className:"py-1.5 pr-2",style:{color:"var(--color-text-secondary)"},children:a.description}),e.jsx("td",{className:"py-1.5",style:{color:"var(--color-text-tertiary)"},children:a.verification??"-"})]},r))})]})}),t.context&&e.jsxs("div",{children:[e.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider mb-1",style:{color:"var(--color-text-tertiary)"},children:"Context"}),e.jsx("p",{className:"leading-relaxed whitespace-pre-wrap",style:{fontSize:"var(--font-size-sm)",color:"var(--color-text-secondary)"},children:t.context})]}),t.planned_by&&e.jsxs("div",{className:"text-[10px] pt-1",style:{color:"var(--color-text-tertiary)"},children:["Planned by ",t.planned_by,t.planned_at&&` at ${new Date(t.planned_at).toLocaleString()}`]})]})}const Wt={idle:"#A09D97",queued:"#5B8DB8",running:"#B89540",completed:"#5A9E78",failed:"#C46555",retrying:"#B89540"};function Vt({execution:t}){const a=Wt[t.status]??"#A09D97",r=t.result;return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:a}}),e.jsx("span",{className:"text-[11px] font-medium capitalize",style:{color:"var(--color-text-primary)"},children:t.status})]}),r&&e.jsxs(e.Fragment,{children:[r.summary&&e.jsx("p",{className:"leading-relaxed whitespace-pre-wrap",style:{fontSize:"var(--font-size-sm)",color:"var(--color-text-secondary)"},children:r.summary}),e.jsxs("div",{className:"flex flex-wrap gap-3",style:{fontSize:"var(--font-size-xs)"},children:[r.commitHash&&e.jsxs("div",{style:{color:"var(--color-text-secondary)"},children:[e.jsx("span",{style:{color:"var(--color-text-tertiary)"},children:"Commit: "}),e.jsx("span",{className:"font-mono",children:r.commitHash.slice(0,8)})]}),r.prUrl&&e.jsxs("div",{children:[e.jsx("span",{style:{color:"var(--color-text-tertiary)"},children:"PR: "}),e.jsx("a",{href:r.prUrl,target:"_blank",rel:"noopener noreferrer",className:"underline",style:{color:"var(--color-accent-blue)"},children:r.prUrl.replace(/^https?:\/\/[^/]+/,"")})]}),r.filesChanged!=null&&e.jsxs("div",{style:{color:"var(--color-text-secondary)"},children:[e.jsx("span",{style:{color:"var(--color-text-tertiary)"},children:"Files: "}),r.filesChanged]})]})]})]})}const Yt={bug:"#C46555",feature:"#5B8DB8",improvement:"#9178B5",task:"#A09D97"},qt={urgent:"#C46555",high:"#B89540",medium:"#5B8DB8",low:"#A09D97"},Gt={idle:"#A09D97",queued:"#5B8DB8",running:"#B89540",completed:"#5A9E78",failed:"#C46555",retrying:"#B89540"};function X(){return e.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}function _({label:t,color:a,bg:r}){return e.jsx("span",{className:"text-[10px] font-medium px-2 py-0.5 rounded-full",style:{backgroundColor:r,color:a},children:t})}function w({label:t,children:a}){return e.jsxs("div",{children:[e.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider mb-1.5",style:{color:"var(--color-text-tertiary)"},children:t}),a]})}const Xt=[{value:"gemini",label:"Gemini"},{value:"qwen",label:"Qwen"}],Qt=[{value:"standard",label:"Standard"},{value:"deep",label:"Deep"}];function Jt({issue:t}){var r;const a=[{label:"Analyze",done:!!t.analysis},{label:"Plan",done:!!t.solution&&t.solution.steps.length>0},{label:"Execute",done:!!((r=t.execution)!=null&&r.result)}];return e.jsx("div",{className:"flex items-center gap-1 mb-2.5",children:a.map((o,n)=>e.jsxs("div",{className:"flex items-center gap-1",children:[n>0&&e.jsx("div",{className:"w-6 h-px",style:{backgroundColor:o.done||a[n-1].done?"var(--color-accent-blue)":"var(--color-border)"}}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"w-2.5 h-2.5 rounded-full flex items-center justify-center text-[7px]",style:{backgroundColor:o.done?"var(--color-accent-blue)":"transparent",border:o.done?"none":"1.5px solid var(--color-border)",color:o.done?"white":"var(--color-text-tertiary)"},children:o.done?"✓":""}),e.jsx("span",{className:"text-[9px]",style:{color:o.done?"var(--color-text-primary)":"var(--color-text-tertiary)"},children:o.label})]})]},o.label))})}function Q({issue:t}){const a=$e(),[r,o]=p.useState("gemini"),[n,d]=p.useState("standard"),c=P(t);if(c!=="open"&&c!=="analyzing"&&c!=="planned")return null;const i=h=>{R(h),a("/chat")},l=t.solution&&t.solution.steps.length>0?"Execute":t.analysis?"Continue":"Run Pipeline",x=t.analysis?t.solution?{label:"Execute",onClick:()=>i({action:"execute:issue",issueId:t.id})}:{label:"Plan",onClick:()=>i({action:"issue:plan",issueId:t.id,tool:r})}:{label:"Analyze",onClick:()=>i({action:"issue:analyze",issueId:t.id,tool:r,depth:n})};return e.jsxs("div",{children:[e.jsx(Jt,{issue:t}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("select",{value:r,onChange:h=>o(h.target.value),className:"text-[10px] px-1.5 py-1 rounded border cursor-pointer",style:{borderColor:"var(--color-border)",backgroundColor:"var(--color-bg-primary)",color:"var(--color-text-tertiary)"},children:Xt.map(h=>e.jsx("option",{value:h.value,children:h.label},h.value))}),e.jsx("select",{value:n,onChange:h=>d(h.target.value),className:"text-[10px] px-1.5 py-1 rounded border cursor-pointer",style:{borderColor:"var(--color-border)",backgroundColor:"var(--color-bg-primary)",color:"var(--color-text-tertiary)"},children:Qt.map(h=>e.jsx("option",{value:h.value,children:h.label},h.value))}),e.jsx("div",{className:"flex-1"}),e.jsx("button",{type:"button",onClick:x.onClick,className:"text-[11px] font-medium px-3.5 py-1.5 rounded-md transition-colors hover:opacity-90 border",style:{borderColor:"var(--color-border)",color:"var(--color-text-secondary)",backgroundColor:"transparent"},children:x.label}),e.jsx("button",{type:"button",onClick:()=>i({action:"issue:pipeline",issueId:t.id,tool:r}),className:"text-[11px] font-medium px-3.5 py-1.5 rounded-md transition-colors hover:opacity-90",style:{backgroundColor:"var(--color-accent-blue)",color:"white"},children:l})]})]})}function J({issue:t}){var o;const{tasks:a,loading:r}=Fe((o=t.task_refs)!=null&&o.length?t.id:null);return e.jsxs(e.Fragment,{children:[t.analysis&&e.jsx(w,{label:"Analysis",children:e.jsx(Ft,{analysis:t.analysis})}),a.length>0&&e.jsx(w,{label:`Execution Plan (${a.length})`,children:e.jsx(He,{tasks:a})}),r&&e.jsx(w,{label:"Execution Plan",children:e.jsx("span",{style:{fontSize:"var(--font-size-xs)",color:"var(--color-text-tertiary)"},children:"Loading…"})}),!a.length&&!r&&t.solution&&e.jsx(w,{label:"Solution",children:e.jsx(Ht,{solution:t.solution})}),t.execution&&t.execution.result&&e.jsx(w,{label:"Execution Result",children:e.jsx(Vt,{execution:t.execution})})]})}function Zt({issue:t,style:a,onClose:r}){var c,i;const o=Yt[t.type]??"#A09D97",n=qt[t.priority]??"#A09D97",d=t.execution?Gt[t.execution.status]??"#A09D97":"#A09D97";return p.useEffect(()=>{function l(x){x.key==="Escape"&&r()}return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[r]),a===1?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 z-[60]",style:{backgroundColor:"rgba(0,0,0,0.22)"},onClick:r}),e.jsxs("div",{className:"fixed right-0 top-0 bottom-0 z-[70] w-[400px] flex flex-col overflow-hidden motion-safe:animate-[slide-in-right_180ms_ease-out_both]",style:{backgroundColor:"var(--color-bg-card)",borderLeft:"1px solid var(--color-border)",boxShadow:"var(--shadow-lg)"},children:[e.jsxs("div",{className:"shrink-0 flex items-center justify-between px-5 py-3 border-b",style:{borderColor:"var(--color-border-divider)"},children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-[10px] font-mono",style:{color:"var(--color-text-tertiary)"},children:t.id.slice(0,14)}),e.jsx(_,{label:t.type,color:o,bg:`${o}20`}),e.jsx(_,{label:t.priority,color:n,bg:`${n}20`})]}),e.jsx("button",{type:"button",onClick:r,className:"w-7 h-7 flex items-center justify-center rounded text-text-tertiary hover:text-text-primary hover:bg-bg-hover transition-colors",children:e.jsx(X,{})})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto px-5 py-5 space-y-5",children:[e.jsx("h2",{className:"font-bold leading-snug",style:{fontSize:"var(--font-size-lg)",color:"var(--color-text-primary)"},children:t.title}),e.jsx(w,{label:"Status",children:(()=>{const l=P(t),x=$[l];return e.jsx("span",{className:"text-[11px] font-medium px-2.5 py-1 rounded-full",style:{backgroundColor:`${x}20`,color:x},children:l.replace("_"," ")})})()}),t.executor&&e.jsx(w,{label:"Executor",children:e.jsx("span",{style:{fontSize:"var(--font-size-sm)",color:"var(--color-text-secondary)"},children:t.executor})}),t.description&&e.jsx(w,{label:"Description",children:e.jsx("p",{className:"leading-relaxed whitespace-pre-wrap",style:{fontSize:"var(--font-size-sm)",color:"var(--color-text-secondary)"},children:t.description})}),e.jsx(J,{issue:t}),t.execution&&t.execution.status!=="idle"&&e.jsx(w,{label:"Execution",children:e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:d}}),e.jsx("span",{style:{fontSize:"var(--font-size-sm)",color:"var(--color-text-primary)"},children:t.execution.status}),t.execution.retryCount>0&&e.jsxs("span",{style:{fontSize:"var(--font-size-xs)",color:"var(--color-text-tertiary)"},children:["(x",t.execution.retryCount,")"]})]}),t.execution.lastError&&e.jsx("div",{className:"rounded px-2.5 py-2",style:{fontSize:"var(--font-size-xs)",color:"#C46555",backgroundColor:"#C4655510",border:"1px solid #C4655530"},children:t.execution.lastError})]})}),e.jsx(w,{label:"Activity",children:e.jsxs("div",{className:"space-y-1",style:{fontSize:"var(--font-size-xs)",color:"var(--color-text-secondary)"},children:[e.jsxs("div",{children:["Created ",E(t.created_at)]}),e.jsxs("div",{children:["Updated ",E(t.updated_at)]})]})})]}),e.jsx("div",{className:"shrink-0 px-5 py-3",style:{borderTop:"1px solid var(--color-border-divider)"},children:e.jsx(Q,{issue:t})})]})]}):a===2?e.jsx("div",{className:"fixed inset-0 z-[60] flex items-center justify-center p-6",style:{backgroundColor:"rgba(0,0,0,0.52)"},onClick:r,children:e.jsxs("div",{className:"w-full max-w-[880px] rounded-[var(--radius-xl)] border overflow-hidden flex max-h-[86vh] motion-safe:animate-[modal-enter_180ms_ease-out_both]",style:{backgroundColor:"var(--color-bg-card)",borderColor:"var(--color-border)",boxShadow:"var(--shadow-lg)"},onClick:l=>l.stopPropagation(),children:[e.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden border-r",style:{borderColor:"var(--color-border-divider)"},children:[e.jsxs("div",{className:"shrink-0 flex items-center justify-between px-6 py-3.5 border-b",style:{borderColor:"var(--color-border-divider)"},children:[e.jsx("span",{className:"text-[10px] font-mono",style:{color:"var(--color-text-tertiary)"},children:t.id}),e.jsx("button",{type:"button",onClick:r,className:"w-7 h-7 flex items-center justify-center rounded text-text-tertiary hover:text-text-primary hover:bg-bg-hover transition-colors",children:e.jsx(X,{})})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto px-6 py-6",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx(_,{label:t.type,color:o,bg:`${o}20`}),e.jsx(_,{label:t.priority,color:n,bg:`${n}20`}),(()=>{const l=P(t),x=$[l];return e.jsx(_,{label:l.replace("_"," "),color:x,bg:`${x}20`})})()]}),e.jsx("h2",{className:"font-bold leading-snug mb-5",style:{fontSize:"var(--font-size-xl)",color:"var(--color-text-primary)"},children:t.title}),t.description?e.jsx("p",{className:"leading-relaxed whitespace-pre-wrap",style:{fontSize:"var(--font-size-sm)",color:"var(--color-text-secondary)"},children:t.description}):e.jsx("p",{className:"italic",style:{fontSize:"var(--font-size-sm)",color:"var(--color-text-placeholder)"},children:"No description provided."}),((c=t.execution)==null?void 0:c.lastError)&&e.jsxs("div",{className:"mt-5 rounded-[var(--radius-md)] p-3",style:{backgroundColor:"#C4655510",border:"1px solid #C4655330"},children:[e.jsx("div",{className:"font-semibold mb-1",style:{fontSize:"var(--font-size-xs)",color:"#C46555"},children:"Execution Error"}),e.jsx("div",{className:"whitespace-pre-wrap",style:{fontSize:"var(--font-size-xs)",color:"var(--color-text-secondary)"},children:t.execution.lastError})]}),e.jsx("div",{className:"mt-5 space-y-5",children:e.jsx(J,{issue:t})})]})]}),e.jsx("div",{className:"shrink-0 px-6 py-3",style:{borderTop:"1px solid var(--color-border-divider)"},children:e.jsx(Q,{issue:t})}),e.jsxs("div",{className:"w-[270px] shrink-0 overflow-y-auto px-5 py-5 space-y-5",style:{backgroundColor:"var(--color-bg-secondary)"},children:[e.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--color-text-tertiary)"},children:"Properties"}),e.jsx(w,{label:"Type",children:e.jsx(_,{label:t.type,color:o,bg:`${o}25`})}),e.jsx(w,{label:"Priority",children:e.jsx(_,{label:t.priority,color:n,bg:`${n}25`})}),e.jsx(w,{label:"Status",children:(()=>{const l=P(t),x=$[l];return e.jsx("span",{className:"text-[11px] font-medium px-2.5 py-1 rounded-full",style:{backgroundColor:`${x}20`,color:x},children:l.replace("_"," ")})})()}),t.executor&&e.jsx(w,{label:"Executor",children:e.jsx("span",{style:{fontSize:"var(--font-size-sm)",color:"var(--color-text-secondary)"},children:t.executor})}),t.execution&&t.execution.status!=="idle"&&e.jsxs(w,{label:"Execution",children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[e.jsx("span",{className:"w-2 h-2 rounded-full",style:{backgroundColor:d}}),e.jsxs("span",{style:{fontSize:"var(--font-size-xs)",color:"var(--color-text-secondary)"},children:[t.execution.status,t.execution.retryCount>0&&` (x${t.execution.retryCount})`]})]}),t.execution.startedAt&&e.jsxs("div",{style:{fontSize:"10px",color:"var(--color-text-tertiary)"},children:["Started ",E(t.execution.startedAt)]})]}),e.jsxs("div",{className:"pt-3 border-t space-y-3",style:{borderColor:"var(--color-border-divider)"},children:[e.jsx(w,{label:"Created",children:e.jsx("span",{style:{fontSize:"11px",color:"var(--color-text-secondary)"},children:E(t.created_at)})}),e.jsx(w,{label:"Updated",children:e.jsx("span",{style:{fontSize:"11px",color:"var(--color-text-secondary)"},children:E(t.updated_at)})})]})]})]})}):e.jsxs("div",{className:"fixed inset-0 z-[60] flex flex-col motion-safe:animate-[slide-up_220ms_ease-out_both]",style:{backgroundColor:"var(--color-bg-primary)"},children:[e.jsxs("div",{className:"shrink-0 flex items-center justify-between px-6 py-2.5 border-b",style:{borderColor:"var(--color-border-divider)",backgroundColor:"var(--color-bg-card)"},children:[e.jsxs("nav",{className:"flex items-center gap-1.5",style:{fontSize:"var(--font-size-xs)",color:"var(--color-text-tertiary)"},children:[e.jsx("span",{children:"Kanban"}),e.jsx("span",{children:"›"}),e.jsx("span",{children:"Issues"}),e.jsx("span",{children:"›"}),e.jsx("span",{className:"font-medium truncate max-w-[360px]",style:{color:"var(--color-text-primary)"},children:t.title})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(_,{label:t.type,color:o,bg:`${o}20`}),e.jsx(_,{label:t.priority,color:n,bg:`${n}20`}),(()=>{const l=P(t),x=$[l];return e.jsx(_,{label:l.replace("_"," "),color:x,bg:`${x}20`})})(),e.jsxs("button",{type:"button",onClick:r,className:"ml-2 flex items-center gap-1.5 px-3 py-1.5 rounded-[var(--radius-default)] border text-text-secondary hover:text-text-primary hover:bg-bg-hover transition-colors",style:{borderColor:"var(--color-border)",fontSize:"var(--font-size-xs)"},children:[e.jsx(X,{}),"Close"]})]})]}),e.jsxs("div",{className:"flex-1 overflow-hidden flex",children:[e.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[e.jsx("div",{className:"flex-1 overflow-y-auto px-12 py-10",children:e.jsxs("div",{className:"max-w-[740px] mx-auto",children:[e.jsx("div",{className:"font-mono mb-4",style:{fontSize:"10px",color:"var(--color-text-tertiary)"},children:t.id}),e.jsx("h1",{className:"font-bold leading-tight mb-6",style:{fontSize:"var(--font-size-2xl)",color:"var(--color-text-primary)"},children:t.title}),t.description?e.jsx("div",{className:"leading-relaxed whitespace-pre-wrap",style:{fontSize:"var(--font-size-base)",color:"var(--color-text-secondary)"},children:t.description}):e.jsx("div",{className:"italic",style:{fontSize:"var(--font-size-base)",color:"var(--color-text-placeholder)"},children:"No description provided."}),((i=t.execution)==null?void 0:i.lastError)&&e.jsxs("div",{className:"mt-8 rounded-[var(--radius-md)] p-5",style:{backgroundColor:"#C4655510",border:"1px solid #C4655330"},children:[e.jsx("div",{className:"font-semibold mb-2",style:{fontSize:"var(--font-size-sm)",color:"#C46555"},children:"Execution Error"}),e.jsx("pre",{className:"whitespace-pre-wrap leading-relaxed",style:{fontSize:"var(--font-size-xs)",color:"var(--color-text-secondary)",fontFamily:"var(--font-mono)"},children:t.execution.lastError})]}),e.jsx("div",{className:"mt-8 space-y-6",children:e.jsx(J,{issue:t})})]})}),e.jsx("div",{className:"shrink-0 px-12 py-3",style:{borderTop:"1px solid var(--color-border-divider)"},children:e.jsx("div",{className:"max-w-[740px] mx-auto",children:e.jsx(Q,{issue:t})})})]}),e.jsxs("div",{className:"w-[280px] shrink-0 border-l overflow-y-auto px-6 py-8 space-y-6",style:{borderColor:"var(--color-border)",backgroundColor:"var(--color-bg-secondary)"},children:[e.jsx(w,{label:"Type",children:e.jsx(_,{label:t.type,color:o,bg:`${o}20`})}),e.jsx(w,{label:"Priority",children:e.jsx(_,{label:t.priority,color:n,bg:`${n}20`})}),e.jsx(w,{label:"Status",children:(()=>{const l=P(t),x=$[l];return e.jsx("span",{className:"text-[11px] font-medium px-2.5 py-1 rounded-full",style:{backgroundColor:`${x}20`,color:x},children:l.replace("_"," ")})})()}),t.executor&&e.jsx(w,{label:"Executor",children:e.jsx("span",{style:{fontSize:"var(--font-size-sm)",color:"var(--color-text-primary)"},children:t.executor})}),t.execution&&t.execution.status!=="idle"&&e.jsx(w,{label:"Execution",children:e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:d}}),e.jsx("span",{style:{fontSize:"var(--font-size-sm)",color:"var(--color-text-primary)"},children:t.execution.status})]}),t.execution.retryCount>0&&e.jsxs("div",{style:{fontSize:"10px",color:"var(--color-text-tertiary)"},children:[t.execution.retryCount," retry attempt",t.execution.retryCount>1?"s":""]}),t.execution.startedAt&&e.jsxs("div",{style:{fontSize:"10px",color:"var(--color-text-tertiary)"},children:["Started ",E(t.execution.startedAt)]}),t.execution.completedAt&&e.jsxs("div",{style:{fontSize:"10px",color:"var(--color-text-tertiary)"},children:["Completed ",E(t.execution.completedAt)]})]})}),e.jsxs("div",{className:"pt-4 border-t space-y-4",style:{borderColor:"var(--color-border-divider)"},children:[e.jsx(w,{label:"Created",children:e.jsx("span",{style:{fontSize:"11px",color:"var(--color-text-secondary)"},children:E(t.created_at)})}),e.jsx(w,{label:"Updated",children:e.jsx("span",{style:{fontSize:"11px",color:"var(--color-text-secondary)"},children:E(t.updated_at)})})]})]})]})]})}function E(t){const a=Date.now(),r=new Date(t).getTime(),o=a-r;if(o<0)return"just now";const n=Math.floor(o/6e4);if(n<1)return"just now";if(n<60)return`${n}m ago`;const d=Math.floor(n/60);return d<24?`${d}h ago`:`${Math.floor(d/24)}d ago`}const er=["All","Open","Registered","In Progress","Resolved","Deferred"],ge=["kanban","table","center"];function vr(){const[t,a]=p.useState("kanban"),[r,o]=p.useState("All"),[n,d]=p.useState(null),[c,i]=p.useState(!1),[l,x]=p.useState(!1),[h,g]=p.useState(!1),[m,y]=p.useState(null),[k,N]=p.useState(!1),[u,b]=p.useState("backlog"),[C,v]=p.useState(null),s=de(f=>f.createModalStyle),S=de(f=>f.detailModalStyle),{register:z,unregister:j}=p.useContext(Re),{issues:T,fetchIssues:F}=O(q(f=>({issues:f.issues,fetchIssues:f.fetchIssues}))),{selectedIssueIds:re,toggleSelect:ze,cliPanelIssueId:I,supervisorStatus:tr}=D(q(f=>({selectedIssueIds:f.selectedIssueIds,toggleSelect:f.toggleSelect,cliPanelIssueId:f.cliPanelIssueId,supervisorStatus:f.supervisorStatus}))),_e=re.size>0,{configured:H,board:W,teams:V,selectedTeamId:ae,loading:se,checkStatus:oe,fetchTeams:ne,selectTeam:Ee,refresh:Le}=K(q(f=>({configured:f.configured,board:f.board,teams:f.teams,selectedTeamId:f.selectedTeamId,loading:f.loading,checkStatus:f.checkStatus,fetchTeams:f.fetchTeams,selectTeam:f.selectTeam,refresh:f.refresh})));p.useEffect(()=>{F()},[F]),p.useEffect(()=>{oe()},[oe]),p.useEffect(()=>{H&&ne()},[H,ne]);const M=p.useMemo(()=>W?W.columns.flatMap(f=>f.issues):[],[W]),De=n!==null&&!I,le=p.useCallback(f=>{a(ge[f]??"kanban")},[]);p.useEffect(()=>{z({items:[{label:"Kanban",icon:e.jsx(Ie,{size:14}),shortcut:"K"},{label:"Table",icon:e.jsx(We,{size:14}),shortcut:"L"},{label:"Center",icon:e.jsx(Tt,{size:14}),shortcut:"C"}],activeIndex:ge.indexOf(t),onSwitch:le})},[z,t,le]),p.useEffect(()=>()=>j(),[j]),p.useEffect(()=>{function f(B){B.target instanceof HTMLInputElement||B.target instanceof HTMLTextAreaElement||B.target instanceof HTMLSelectElement||B.key==="c"&&!B.metaKey&&!B.ctrlKey&&(b("backlog"),N(!0))}return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[]);function Y(f){if(f.type==="issue"){v(f.issue),d(null);return}const B=(n==null?void 0:n.type)===f.type&&f.type==="linearIssue"&&n.issue.id===f.issue.id;d(B?null:f)}function Te(f){b(f),N(!0)}function Be(){d(null)}function ie(){F()}const Ae=(n==null?void 0:n.type)==="linearIssue"?"Linear Issue":"Issue Detail";return e.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[e.jsx(Mt,{}),e.jsx("div",{className:"px-[var(--spacing-4)] py-[var(--spacing-2)] border-b border-border-divider shrink-0",children:e.jsxs("div",{className:"flex items-center justify-between gap-[var(--spacing-3)]",children:[e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)]",children:[e.jsx(Ze,{chips:[...er],active:r,onSelect:o}),e.jsxs("button",{type:"button",onClick:()=>g(!h),className:["flex items-center gap-[var(--spacing-1)] px-[var(--spacing-2)] py-[var(--spacing-1)] rounded-[var(--radius-sm)] text-[length:var(--font-size-xs)] transition-colors",h?"border-accent-blue text-accent-blue bg-[var(--color-accent-blue-10,rgba(90,130,200,0.1))]":"text-text-secondary hover:text-text-primary"].join(" "),style:h?void 0:{border:"var(--style-btn-secondary-border)",background:"var(--style-btn-secondary-bg)"},title:h?"Hide Done column":"Show Done column",children:[e.jsx("svg",{className:"w-3 h-3",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("polyline",{points:"20 6 9 17 4 12"})}),"Done"]})]}),H&&e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] shrink-0",children:[V.length>0&&e.jsx("select",{value:ae??"",onChange:f=>Ee(f.target.value),className:"px-[var(--spacing-2)] py-[var(--spacing-1)] rounded-[var(--radius-sm)] text-text-primary text-[length:var(--font-size-xs)]",style:{border:"var(--style-btn-secondary-border)",background:"var(--style-btn-secondary-bg)"},children:V.map(f=>e.jsxs("option",{value:f.id,children:[f.key," — ",f.name]},f.id))}),e.jsxs("button",{type:"button",onClick:()=>i(!0),className:"flex items-center gap-[var(--spacing-1)] px-[var(--spacing-2)] py-[var(--spacing-1)] rounded-[var(--radius-sm)] text-text-secondary hover:text-text-primary text-[length:var(--font-size-xs)] transition-colors",style:{border:"var(--style-btn-secondary-border)",background:"var(--style-btn-secondary-bg)"},title:"Import from Linear",children:[e.jsx(Je,{size:12}),e.jsx("span",{children:"Import"})]}),e.jsxs("button",{type:"button",onClick:()=>x(!0),className:"flex items-center gap-[var(--spacing-1)] px-[var(--spacing-2)] py-[var(--spacing-1)] rounded-[var(--radius-sm)] text-text-secondary hover:text-text-primary text-[length:var(--font-size-xs)] transition-colors",style:{border:"var(--style-btn-secondary-border)",background:"var(--style-btn-secondary-bg)"},title:"Export to Linear",children:[e.jsx(At,{size:12}),e.jsx("span",{children:"Export"})]}),e.jsx("button",{type:"button",onClick:()=>void Le(),disabled:se,className:"flex items-center justify-center w-7 h-7 rounded-[var(--radius-sm)] text-text-secondary hover:text-text-primary transition-colors disabled:opacity-50",style:{border:"var(--style-btn-secondary-border)",background:"var(--style-btn-secondary-bg)"},title:"Refresh Linear board",children:e.jsx(Qe,{size:12,className:se?"animate-spin":""})})]})]})}),e.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[e.jsxs("div",{className:"flex-1 overflow-auto min-w-0",children:[t==="kanban"&&e.jsx(ft,{linearIssues:M,localIssues:T,selectedItem:n,onSelectItem:Y,composingColumnId:m,onStartCompose:Te,onStopCompose:()=>y(null),onIssueCreated:ie,showDone:h,batchMode:_e,selectedIssueIds:re,onToggleIssueCheck:ze}),t==="table"&&e.jsx(Nt,{localIssues:T,linearIssues:M,selectedItem:n,onSelectItem:Y}),t==="center"&&e.jsx(zt,{localIssues:T,linearIssues:M,selectedItem:n,onSelectItem:Y})]}),I&&e.jsx(Ot,{}),!I&&e.jsx(Ve,{open:De,onClose:Be,title:Ae,children:n&&e.jsx(Ye,{selectedItem:n})})]}),e.jsx(Rt,{}),c&&e.jsx(Et,{issues:M,onClose:()=>i(!1)}),l&&e.jsx(Lt,{teams:V,selectedTeamId:ae,onClose:()=>x(!1)}),e.jsx(Kt,{open:k,columnId:u,style:s,onClose:()=>N(!1),onCreated:ie}),C&&!I&&e.jsx(Zt,{issue:C,style:S,onClose:()=>v(null)})]})}export{vr as KanbanPage};
@@ -0,0 +1,4 @@
1
+ import{j as e,r as x,u as C,ah as d}from"./index-DpcPd-UG.js";import{R as _}from"./refresh-cw-C9UNdLCy.js";const g={ralph:"#8B6BBF",maestro:"#4A90D9",coordinate:"#3D9B6F"},w={running:"#4A90D9",in_progress:"#4A90D9",completed:"#5A9E78",failed:"#C46555",pending:"#A09D97",idle:"#A09D97",verifying:"#D4832E",paused:"#A09D97"},j={completed:"#5A9E78",running:"#4A90D9",in_progress:"#4A90D9",pending:"#A09D97",failed:"#C46555",skipped:"#D1CEC8"},v={completed:"rgba(90,158,120,0.12)",running:"rgba(74,144,217,0.12)",in_progress:"rgba(74,144,217,0.12)",pending:"transparent",failed:"rgba(196,101,85,0.12)",skipped:"transparent"};function D(s){try{const t=Date.now()-new Date(s).getTime(),r=Math.floor(t/1e3);if(r<60)return`${r}s ago`;const n=Math.floor(r/60);if(n<60)return`${n}m ago`;const a=Math.floor(n/60);return a<24?`${a}h ago`:`${Math.floor(a/24)}d ago`}catch{return""}}function k(s){try{return new Date(s).toLocaleString()}catch{return s}}function p(s,t){if(!s)return"";const r=new Date(s).getTime(),n=t?new Date(t).getTime():Date.now(),a=Math.floor((n-r)/1e3);if(a<0)return"";const i=Math.floor(a/60);return i>0?`${i}m ${a%60}s`:`${a}s`}const u=`@keyframes mcPulse {
2
+ 0%, 100% { opacity: 1; }
3
+ 50% { opacity: 0.4; }
4
+ }`;function A({session:s,isSelected:t,onClick:r}){const n=g[s.source]??"#A09D97",a=w[s.status]??"#A09D97";return e.jsxs("button",{type:"button",onClick:()=>r(s.dirName),className:["flex items-start gap-2.5 w-full px-[14px] py-[10px] text-left","transition-colors duration-[var(--duration-fast)] ease-[var(--ease-notion)]","border-b border-border-divider",t?"bg-bg-active":"hover:bg-bg-hover"].join(" "),style:t?{borderLeft:`2px solid ${n}`}:void 0,children:[e.jsx("div",{className:"w-[6px] h-[6px] rounded-full shrink-0 mt-[6px]",style:{background:n}}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-[length:var(--font-size-sm)] font-medium text-text-primary truncate",children:s.intent||s.dirName}),e.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[e.jsx("span",{className:"text-[10px] font-semibold px-2 py-0.5 rounded-full",style:{background:`${a}18`,color:a},children:s.status}),e.jsxs("span",{className:"text-[10px] text-text-tertiary font-mono",children:[s.currentStep,"/",s.totalSteps]})]}),e.jsx("div",{className:"text-[10px] text-text-tertiary mt-0.5",children:D(s.updatedAt)})]})]})}function T({sessions:s,selectedDir:t,onSelect:r}){return e.jsxs("aside",{className:"w-[272px] shrink-0 flex flex-col border-r border-border bg-bg-secondary",children:[e.jsxs("div",{className:"flex items-center justify-between px-[14px] py-[10px] border-b border-border-divider",children:[e.jsx("span",{className:"text-[9px] font-semibold uppercase tracking-widest text-text-placeholder",children:"Sessions"}),e.jsx("span",{className:"bg-bg-hover px-1.5 rounded-full text-[9px] text-text-tertiary font-mono",children:s.length})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto",children:[s.length===0&&e.jsxs("div",{className:"px-[14px] py-6 text-center",children:[e.jsx("div",{className:"text-[length:var(--font-size-sm)] font-semibold text-text-secondary mb-1",children:"No sessions"}),e.jsx("div",{className:"text-[10px] text-text-tertiary leading-relaxed",children:"Run a maestro command to create sessions"})]}),s.map(n=>e.jsx(A,{session:n,isSelected:n.dirName===t,onClick:r},n.dirName))]})]})}function l({label:s,value:t}){return e.jsxs("div",{children:[e.jsx("div",{className:"text-[9px] font-semibold uppercase tracking-widest text-text-placeholder mb-[2px]",children:s}),e.jsx("div",{className:"text-[length:var(--font-size-sm)] font-medium text-text-primary",children:t})]})}function E({detail:s}){return s.source==="ralph"?e.jsx(L,{steps:s.data.steps}):s.source==="maestro"?e.jsx(R,{steps:s.data.steps}):e.jsx(O,{history:s.data.history})}function h({isLast:s,dotColor:t,dotBg:r,isRunning:n,children:a}){return e.jsxs("div",{className:"flex gap-3 py-2 relative",children:[!s&&e.jsx("div",{className:"absolute left-[11px] top-[30px] bottom-[-8px] w-px",style:{background:t,opacity:.3}}),e.jsx("div",{className:"w-[22px] h-[22px] rounded-full flex items-center justify-center shrink-0 border-2 border-bg-primary",style:{background:r},children:e.jsx("div",{className:"w-2 h-2 rounded-full",style:{background:t,animation:n?"mcPulse 2s infinite":void 0}})}),e.jsx("div",{className:"flex-1 min-w-0",children:a})]})}function L({steps:s}){return s.length===0?e.jsx("div",{className:"text-[11px] text-text-tertiary text-center py-6",children:"No steps recorded"}):e.jsxs("div",{children:[s.map((t,r)=>{const n=t.status??"pending",a=j[n]??"#A09D97",i=v[n]??"transparent";return e.jsxs(h,{isLast:r===s.length-1,dotColor:a,dotBg:i,isRunning:n==="in_progress"||n==="running",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-[length:var(--font-size-sm)] font-semibold text-text-primary",children:t.skill}),e.jsx(f,{status:n})]}),t.args&&e.jsx("div",{className:"text-[10px] text-text-tertiary mt-0.5 truncate",children:t.args}),e.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[e.jsx("span",{className:"text-[9px] font-mono text-text-tertiary",children:t.type}),(t.started_at||t.completed_at)&&e.jsx("span",{className:"text-[9px] font-mono text-text-tertiary",children:p(t.started_at,t.completed_at)}),t.retried&&e.jsx("span",{className:"text-[9px] text-accent-orange",children:"retried"})]}),t.error&&e.jsx("div",{className:"text-[10px] text-accent-red mt-1 leading-snug",children:t.error})]},t.index)}),e.jsx("style",{children:u})]})}function R({steps:s}){return s.length===0?e.jsx("div",{className:"text-[11px] text-text-tertiary text-center py-6",children:"No steps recorded"}):e.jsxs("div",{children:[s.map((t,r)=>{const n=t.status??"pending",a=j[n]??"#A09D97",i=v[n]??"transparent";return e.jsxs(h,{isLast:r===s.length-1,dotColor:a,dotBg:i,isRunning:n==="in_progress"||n==="running",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-[length:var(--font-size-sm)] font-semibold text-text-primary",children:t.skill}),e.jsx(f,{status:n})]}),t.args&&e.jsx("div",{className:"text-[10px] text-text-tertiary mt-0.5 truncate",children:t.args}),e.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[e.jsx("span",{className:"text-[9px] font-mono text-text-tertiary",children:t.type}),(t.started_at||t.completed_at)&&e.jsx("span",{className:"text-[9px] font-mono text-text-tertiary",children:p(t.started_at,t.completed_at)})]}),t.error&&e.jsx("div",{className:"text-[10px] text-accent-red mt-1 leading-snug",children:t.error})]},t.index)}),e.jsx("style",{children:u})]})}function O({history:s}){return s.length===0?e.jsx("div",{className:"text-[11px] text-text-tertiary text-center py-6",children:"No history entries"}):e.jsxs("div",{children:[s.map((t,r)=>{const n=t.outcome==="success"?"#5A9E78":t.outcome==="failed"?"#C46555":"#4A90D9";return e.jsxs(h,{isLast:r===s.length-1,dotColor:n,dotBg:"transparent",isRunning:!t.outcome&&!t.exited_at,children:[e.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[e.jsx("span",{className:"text-[length:var(--font-size-sm)] font-semibold text-text-primary",children:t.node_id}),e.jsx("span",{className:"text-[9px] text-text-tertiary",children:t.node_type}),t.outcome&&e.jsx(f,{status:t.outcome==="success"?"completed":t.outcome}),t.quality_score!=null&&e.jsx($,{score:t.quality_score})]}),t.summary&&e.jsx("div",{className:"text-[10px] text-text-secondary mt-1 leading-relaxed",children:t.summary}),t.entered_at&&e.jsx("div",{className:"mt-1",children:e.jsx("span",{className:"text-[9px] font-mono text-text-tertiary",children:p(t.entered_at,t.exited_at)})})]},`${t.node_id}-${r}`)}),e.jsx("style",{children:u})]})}function f({status:s}){const r={completed:"#5A9E78",running:"#4A90D9",in_progress:"#4A90D9",pending:"#A09D97",failed:"#C46555",success:"#5A9E78",approved:"#5A9E78"}[s]??"#A09D97";return e.jsx("span",{className:"text-[9px] font-semibold px-1.5 py-[1px] rounded-full",style:{background:`${r}18`,color:r},children:s})}function $({score:s}){const t=s>=.7?"#5A9E78":s>=.4?"#D4832E":"#C46555";return e.jsx("span",{className:"text-[9px] font-semibold px-1.5 py-[1px] rounded-full",style:{background:`${t}18`,color:t},children:s.toFixed(2)})}function M({detail:s}){return s.source==="ralph"?e.jsx(P,{data:s.data}):s.source==="coordinate"&&s.data.context?e.jsx(I,{data:s.data}):null}function P({data:s}){const t=s;return e.jsxs("div",{children:[t.passed_gates.length>0&&e.jsxs("div",{className:"mb-3",children:[e.jsx("div",{className:"text-[9px] font-semibold uppercase tracking-widest text-text-placeholder mb-1.5",children:"Passed Gates"}),e.jsx("div",{className:"flex flex-wrap gap-1",children:t.passed_gates.map((r,n)=>e.jsx("span",{className:"text-[9px] font-semibold px-2 py-0.5 rounded-full",style:{background:"var(--color-status-bg-completed)",color:"var(--color-status-completed)"},children:r},n))})]}),e.jsxs("div",{className:"flex gap-4 mb-3 flex-wrap",children:[e.jsx(l,{label:"Quality Mode",value:t.quality_mode||"--"}),e.jsx(l,{label:"Auto Mode",value:t.auto_mode?"Yes":"No"}),e.jsx(l,{label:"CLI Tool",value:t.cli_tool||"--"}),e.jsx(l,{label:"Task Type",value:t.task_type||"--"})]}),t.target&&e.jsx(l,{label:"Target",value:t.target}),t.context.issue_id&&e.jsx("div",{className:"mt-2",children:e.jsx(l,{label:"Issue",value:t.context.issue_id})})]})}function I({data:s}){var r;const t=s.context;return e.jsxs("div",{className:"flex flex-wrap gap-4",children:[e.jsx(l,{label:"Graph ID",value:s.graph_id}),e.jsx(l,{label:"Current Node",value:s.current_node}),s.tool&&e.jsx(l,{label:"Tool",value:s.tool}),s.auto_mode!=null&&e.jsx(l,{label:"Auto Mode",value:s.auto_mode?"Yes":"No"}),((r=t==null?void 0:t.project)==null?void 0:r.current_phase)!=null&&e.jsx(l,{label:"Phase",value:String(t.project.current_phase)}),(t==null?void 0:t.inputs)&&Object.keys(t.inputs).length>0&&e.jsxs("div",{className:"w-full",children:[e.jsx("div",{className:"text-[9px] font-semibold uppercase tracking-widest text-text-placeholder mb-1",children:"Inputs"}),e.jsx("pre",{className:"m-0 px-3 py-2 text-[10px] leading-relaxed bg-bg-secondary rounded-[var(--radius-md)] text-text-secondary overflow-auto max-h-[120px]",children:JSON.stringify(t.inputs,null,2)})]})]})}function B({session:s,detail:t}){const r=g[s.source]??"#A09D97";return e.jsxs("div",{className:"p-5 overflow-y-auto h-full",children:[e.jsxs("div",{className:"bg-bg-card border border-border-divider rounded-[10px] overflow-hidden",children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-[10px] border-b border-border-divider",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-[10px] h-[10px] rounded-full",style:{background:r}}),e.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider text-text-tertiary",children:s.source})]}),e.jsx(z,{status:s.status})]}),e.jsxs("div",{className:"p-4",children:[e.jsx("div",{className:"text-[14px] font-semibold text-text-primary leading-snug mb-3",children:s.intent}),e.jsx(F,{source:s.source,sessionId:s.sessionId,intent:s.intent,status:s.status}),e.jsxs("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(120px,1fr))] gap-4",children:[s.chainName&&e.jsx(l,{label:"Chain",value:s.chainName}),s.lifecyclePosition&&e.jsx(l,{label:"Lifecycle",value:s.lifecyclePosition}),s.phase!=null&&e.jsx(l,{label:"Phase",value:String(s.phase)}),s.milestone&&e.jsx(l,{label:"Milestone",value:s.milestone}),e.jsx(l,{label:"Progress",value:`${s.currentStep}/${s.totalSteps}`}),e.jsx(l,{label:"Updated",value:k(s.updatedAt)})]})]})]}),e.jsxs("div",{className:"bg-bg-card border border-border-divider rounded-[10px] overflow-hidden mt-4",children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-[10px] border-b border-border-divider",children:[e.jsx("span",{className:"text-[length:var(--font-size-sm)] font-semibold text-text-primary",children:"Steps"}),t.source==="coordinate"&&e.jsxs("span",{className:"text-[10px] text-text-tertiary",children:["Node: ",e.jsx("span",{className:"font-mono",children:t.data.current_node})]})]}),e.jsx("div",{className:"p-4",children:e.jsx(E,{detail:t})})]}),t.source==="ralph"&&e.jsxs("div",{className:"bg-bg-card border border-border-divider rounded-[10px] overflow-hidden mt-4",children:[e.jsx("div",{className:"px-4 py-[10px] border-b border-border-divider",children:e.jsx("span",{className:"text-[length:var(--font-size-sm)] font-semibold text-text-primary",children:"Context"})}),e.jsx("div",{className:"p-4",children:e.jsx(M,{detail:t})})]})]})}function z({status:s}){const r={running:"#4A90D9",in_progress:"#4A90D9",completed:"#5A9E78",failed:"#C46555",pending:"#A09D97",idle:"#A09D97",verifying:"#D4832E",paused:"#A09D97"}[s]??"#A09D97";return e.jsx("span",{className:"text-[10px] font-semibold px-2 py-0.5 rounded-full",style:{background:`${r}18`,color:r},children:s})}function U(s,t,r,n){return s==="ralph"?"/maestro-ralph continue":s==="maestro"?`/maestro "${r}"`:s==="coordinate"?"/maestro-execute":null}function F({source:s,sessionId:t,intent:r,status:n}){const a=U(s,t,r,n),[i,c]=x.useState(!1),m=x.useCallback(()=>{a&&navigator.clipboard.writeText(a).then(()=>{c(!0),setTimeout(()=>c(!1),1500)})},[a]);return a?e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx("code",{className:"flex-1 px-3 py-1.5 text-[11px] font-mono text-text-secondary bg-bg-secondary rounded-[var(--radius-md)] border border-border-divider select-all truncate",children:a}),e.jsx("button",{type:"button",onClick:m,className:["shrink-0 px-2 py-1 text-[10px] font-semibold rounded-[var(--radius-md)]","border border-border-divider transition-colors duration-150",i?"bg-[rgba(90,158,120,0.12)] text-[#5A9E78] border-[#5A9E78]":"bg-bg-card text-text-tertiary hover:bg-bg-hover hover:text-text-primary"].join(" "),children:i?"Copied":"Copy"})]}):null}function Y(){const{t:s}=C(),t=d(o=>o.sessions),r=d(o=>o.selectedDir),n=d(o=>o.sessionDetail),a=d(o=>o.isLoading),i=d(o=>o.error),c=d(o=>o.fetchSessions),m=d(o=>o.selectSession),y=d(o=>o.clearError);x.useEffect(()=>{c()},[c]);const b=x.useMemo(()=>r?t.find(o=>o.dirName===r)??null:null,[t,r]),N=x.useCallback(()=>{c()},[c]),S=x.useCallback(o=>{m(o===r?null:o)},[m,r]);return e.jsxs("div",{className:"flex flex-col h-full overflow-hidden bg-bg-primary",children:[e.jsxs("header",{className:"flex items-center justify-between px-4 h-[44px] shrink-0 bg-bg-secondary border-b border-border",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("span",{className:"text-[13px] font-bold text-text-primary",children:s("maestro_coordinate.title")}),a&&e.jsx("span",{className:"text-[10px] text-text-tertiary",children:"Loading..."})]}),e.jsx("button",{type:"button",onClick:N,className:"flex items-center justify-center w-7 h-7 p-0 border border-border rounded-[var(--radius-md)] bg-transparent text-text-secondary cursor-pointer transition-colors duration-150 hover:bg-bg-hover hover:text-text-primary",children:e.jsx(_,{size:14})})]}),i&&e.jsxs("div",{className:"flex items-center px-4 py-2 text-[11px] text-accent-red bg-[rgba(196,101,85,0.08)] border-b border-border-divider shrink-0",children:[e.jsx("span",{className:"flex-1",children:i}),e.jsx("button",{type:"button",onClick:y,className:"px-1.5 border-none rounded bg-transparent text-accent-red cursor-pointer text-[11px] font-semibold",children:"x"})]}),e.jsxs("div",{className:"flex flex-1 min-h-0 overflow-hidden",children:[e.jsx(T,{sessions:t,selectedDir:r,onSelect:S}),e.jsx("main",{className:"flex-1 min-w-0 overflow-y-auto bg-bg-primary",children:b&&n?e.jsx(B,{session:b,detail:n}):e.jsx(q,{})})]}),e.jsxs("footer",{className:"flex items-center justify-between h-7 px-4 bg-bg-secondary border-t border-border text-[10px] shrink-0",children:[e.jsxs("span",{className:"text-text-secondary",children:[t.length," sessions"]}),e.jsxs("span",{className:"text-text-tertiary",children:["Last refresh: ",new Date().toLocaleTimeString()]})]})]})}function q(){return e.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-text-tertiary px-5 py-12",children:[e.jsxs("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1",strokeLinecap:"round",strokeLinejoin:"round",className:"opacity-15 mb-3",children:[e.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),e.jsx("line",{x1:"9",y1:"3",x2:"9",y2:"21"})]}),e.jsx("div",{className:"text-[13px] font-semibold text-text-secondary",children:"Select a session to view details"})]})}export{Y as MaestroCoordinatePage};