agent-tower 0.6.0-beta.13 → 0.6.0-beta.15

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 (142) hide show
  1. package/dist/executors/default-providers.json +1 -0
  2. package/dist/runtime/__tests__/acp-driver-lifecycle.test.js +232 -6
  3. package/dist/runtime/__tests__/acp-driver-lifecycle.test.js.map +1 -1
  4. package/dist/runtime/__tests__/acp-driver.test.js +24 -0
  5. package/dist/runtime/__tests__/acp-driver.test.js.map +1 -1
  6. package/dist/runtime/__tests__/runtime-coordinator.test.js +205 -7
  7. package/dist/runtime/__tests__/runtime-coordinator.test.js.map +1 -1
  8. package/dist/runtime/acp/acp-driver.d.ts.map +1 -1
  9. package/dist/runtime/acp/acp-driver.js +188 -61
  10. package/dist/runtime/acp/acp-driver.js.map +1 -1
  11. package/dist/runtime/acp/codex-provider-config.d.ts.map +1 -1
  12. package/dist/runtime/acp/codex-provider-config.js +4 -0
  13. package/dist/runtime/acp/codex-provider-config.js.map +1 -1
  14. package/dist/runtime/contracts.d.ts +12 -0
  15. package/dist/runtime/contracts.d.ts.map +1 -1
  16. package/dist/runtime/runtime-coordinator.d.ts +22 -1
  17. package/dist/runtime/runtime-coordinator.d.ts.map +1 -1
  18. package/dist/runtime/runtime-coordinator.js +214 -26
  19. package/dist/runtime/runtime-coordinator.js.map +1 -1
  20. package/dist/services/__tests__/session-manager.lifecycle.test.js +578 -68
  21. package/dist/services/__tests__/session-manager.lifecycle.test.js.map +1 -1
  22. package/dist/services/__tests__/session-manager.team-run.test.js +2 -1
  23. package/dist/services/__tests__/session-manager.team-run.test.js.map +1 -1
  24. package/dist/services/session-manager.d.ts +14 -8
  25. package/dist/services/session-manager.d.ts.map +1 -1
  26. package/dist/services/session-manager.js +359 -176
  27. package/dist/services/session-manager.js.map +1 -1
  28. package/dist/web/assets/{AgentDemoPage-aLGw8pYk.js → AgentDemoPage-04hKRdNk.js} +1 -1
  29. package/dist/web/assets/{AgentEnvironmentSettingsPage-BYcH_wMz.js → AgentEnvironmentSettingsPage-TnYB_gn_.js} +1 -1
  30. package/dist/web/assets/{AgentLogo-Dyqxcj5s.js → AgentLogo-BQ4AhPCM.js} +1 -1
  31. package/dist/web/assets/ConversationPage-GSAFcHuX.js +3 -0
  32. package/dist/web/assets/CreateTaskInput-DSl73Wwc.js +1 -0
  33. package/dist/web/assets/{DemoPage-m92AArTk.js → DemoPage-BKlcChAw.js} +1 -1
  34. package/dist/web/assets/{GeneralSettingsPage-P5HcwCXo.js → GeneralSettingsPage-sVFvK9Oe.js} +1 -1
  35. package/dist/web/assets/{Icons-BFOphLw-.js → Icons-DGahMuvC.js} +1 -1
  36. package/dist/web/assets/{LoadingPreviewPage-CfT4FIyb.js → LoadingPreviewPage-CZ2N3qZc.js} +1 -1
  37. package/dist/web/assets/{McpSettingsPage-BI_b78L_.js → McpSettingsPage-KZFzkxCs.js} +1 -1
  38. package/dist/web/assets/{MemberAvatar-1UlgMZMM.js → MemberAvatar-5bEbGww5.js} +1 -1
  39. package/dist/web/assets/{NotificationSettingsPage-CQCyq9QZ.js → NotificationSettingsPage-hVClKCOc.js} +1 -1
  40. package/dist/web/assets/{ProfileSettingsPage-ojhJXLWb.js → ProfileSettingsPage-BICdSvU4.js} +1 -1
  41. package/dist/web/assets/{ProjectKanbanPage-DK3rZJzY.js → ProjectKanbanPage-D62MacD4.js} +27 -27
  42. package/dist/web/assets/{ProjectSettingsPage-MGB631ia.js → ProjectSettingsPage-aMerK2A7.js} +1 -1
  43. package/dist/web/assets/{ProviderSettingsPage-CMZvEWMa.js → ProviderSettingsPage-Djd3iQfB.js} +1 -1
  44. package/dist/web/assets/{SettingsMasterDetail-9CnCBuNZ.js → SettingsMasterDetail-Czojx5vD.js} +1 -1
  45. package/dist/web/assets/{TeamSettingsPage-BUXKd5UF.js → TeamSettingsPage-B3-4MXXx.js} +1 -1
  46. package/dist/web/assets/{arc-2leUEhVa.js → arc-DzPiJSKL.js} +1 -1
  47. package/dist/web/assets/{architectureDiagram-3BPJPVTR-CDgYR44L.js → architectureDiagram-3BPJPVTR-EhKxHp4t.js} +1 -1
  48. package/dist/web/assets/{arrow-left-Jn-v17JF.js → arrow-left-2dTz1a0q.js} +1 -1
  49. package/dist/web/assets/{blockDiagram-GPEHLZMM-CzfIh31g.js → blockDiagram-GPEHLZMM-BHcWmA7M.js} +1 -1
  50. package/dist/web/assets/{c4Diagram-AAUBKEIU-BzzBXKEF.js → c4Diagram-AAUBKEIU-D59zNlIS.js} +1 -1
  51. package/dist/web/assets/channel-BpGJqMDu.js +1 -0
  52. package/dist/web/assets/check-CYQXIceH.js +1 -0
  53. package/dist/web/assets/{chevron-down-CpKODb7Y.js → chevron-down-BTGC8Sed.js} +1 -1
  54. package/dist/web/assets/{chevron-right-CBoUSXVq.js → chevron-right-BEw6jjbJ.js} +1 -1
  55. package/dist/web/assets/{chevron-up-KZ1hsL8y.js → chevron-up-D_Hmx6ug.js} +1 -1
  56. package/dist/web/assets/{chunk-2J33WTMH-GJE6LCGS.js → chunk-2J33WTMH-nk1Ieiq7.js} +1 -1
  57. package/dist/web/assets/{chunk-4BX2VUAB-Bw_ITp1Q.js → chunk-4BX2VUAB-xl3tQkpA.js} +1 -1
  58. package/dist/web/assets/{chunk-55IACEB6-DQ-XuWbD.js → chunk-55IACEB6-Bj12k-M-.js} +1 -1
  59. package/dist/web/assets/{chunk-727SXJPM-BgL49Dtw.js → chunk-727SXJPM-DeL4hVho.js} +1 -1
  60. package/dist/web/assets/{chunk-AQP2D5EJ-dRTVohoy.js → chunk-AQP2D5EJ-xyt_hZ7N.js} +1 -1
  61. package/dist/web/assets/{chunk-FMBD7UC4-BZtRjoH7.js → chunk-FMBD7UC4-DMpougEb.js} +1 -1
  62. package/dist/web/assets/{chunk-ND2GUHAM-CN3wND6y.js → chunk-ND2GUHAM-D2qjylxW.js} +1 -1
  63. package/dist/web/assets/{chunk-QZHKN3VN-CMwbobMj.js → chunk-QZHKN3VN-BjCtAePb.js} +1 -1
  64. package/dist/web/assets/{circle-alert-kELlE07n.js → circle-alert-BGbIBYEs.js} +1 -1
  65. package/dist/web/assets/classDiagram-4FO5ZUOK-M-OAZSzx.js +1 -0
  66. package/dist/web/assets/classDiagram-v2-Q7XG4LA2-M-OAZSzx.js +1 -0
  67. package/dist/web/assets/{code-block-OCS4YCEC-B1YC7dLa.js → code-block-OCS4YCEC-DnfSnuHM.js} +1 -1
  68. package/dist/web/assets/{confirm-dialog-DDWlvtJs.js → confirm-dialog-C8rPqdFE.js} +1 -1
  69. package/dist/web/assets/{cose-bilkent-S5V4N54A-C6xD7kmY.js → cose-bilkent-S5V4N54A-DD3H-OxN.js} +1 -1
  70. package/dist/web/assets/{cssMode-lB5vNGvS.js → cssMode-DR6Jf3-g.js} +1 -1
  71. package/dist/web/assets/{dagre-BM42HDAG-BqTCYMO6.js → dagre-BM42HDAG-Bw6aZrG9.js} +1 -1
  72. package/dist/web/assets/{diagram-2AECGRRQ-BsMq3s5l.js → diagram-2AECGRRQ-Bm8oLz0N.js} +1 -1
  73. package/dist/web/assets/{diagram-5GNKFQAL-l4izpv7Z.js → diagram-5GNKFQAL-CL9Xaz3k.js} +1 -1
  74. package/dist/web/assets/{diagram-KO2AKTUF-uWDq6Yzo.js → diagram-KO2AKTUF-KbdYV5XJ.js} +1 -1
  75. package/dist/web/assets/{diagram-LMA3HP47-Dbd4fnFa.js → diagram-LMA3HP47-CYo7CoGp.js} +1 -1
  76. package/dist/web/assets/{diagram-OG6HWLK6-BC-27mkr.js → diagram-OG6HWLK6-CFPSh1Sm.js} +1 -1
  77. package/dist/web/assets/{erDiagram-TEJ5UH35-DrCP0Xt8.js → erDiagram-TEJ5UH35-Dh9qfvJz.js} +1 -1
  78. package/dist/web/assets/{flowDiagram-I6XJVG4X-BqNsQuUr.js → flowDiagram-I6XJVG4X-8EMyvj0V.js} +1 -1
  79. package/dist/web/assets/{folder-picker-CBVEWiuS.js → folder-picker-iHGLWmJF.js} +1 -1
  80. package/dist/web/assets/{freemarker2-Bos_2jdw.js → freemarker2-Dhyh-DXo.js} +1 -1
  81. package/dist/web/assets/{ganttDiagram-6RSMTGT7-CZOrG-5M.js → ganttDiagram-6RSMTGT7-BE5FBwwf.js} +1 -1
  82. package/dist/web/assets/{gitGraphDiagram-PVQCEYII-Dp3i5ehs.js → gitGraphDiagram-PVQCEYII-Dx2x_Y6A.js} +1 -1
  83. package/dist/web/assets/{handlebars-C7Elz3nH.js → handlebars-BB4WaAAq.js} +1 -1
  84. package/dist/web/assets/{html-EvsHOk5n.js → html-BluMUCI1.js} +1 -1
  85. package/dist/web/assets/{htmlMode-CTlhNZgJ.js → htmlMode-Dk0meNHs.js} +1 -1
  86. package/dist/web/assets/{index-hPp73HMS.js → index-9oo7US_J.js} +4 -4
  87. package/dist/web/assets/{index-BGajgi5H.js → index-B0gHfTIK.js} +3 -3
  88. package/dist/web/assets/{infoDiagram-5YYISTIA-C6NnR_Zb.js → infoDiagram-5YYISTIA-0BPLGHMf.js} +1 -1
  89. package/dist/web/assets/{ishikawaDiagram-YF4QCWOH-C1SOf-Ko.js → ishikawaDiagram-YF4QCWOH-BnoV5etH.js} +1 -1
  90. package/dist/web/assets/javascript-Cwz9LBET.js +1 -0
  91. package/dist/web/assets/{journeyDiagram-JHISSGLW--GKMSbPz.js → journeyDiagram-JHISSGLW-D8_dQMoV.js} +1 -1
  92. package/dist/web/assets/{jsonMode-Bbh3Gbb8.js → jsonMode-DWAIY3Zm.js} +1 -1
  93. package/dist/web/assets/{kanban-definition-UN3LZRKU-Car5iy0R.js → kanban-definition-UN3LZRKU-CcP-UBWq.js} +1 -1
  94. package/dist/web/assets/{layers-WOwm63Fo.js → layers-B4Hb2k1E.js} +1 -1
  95. package/dist/web/assets/{linear-ChUj9SvT.js → linear-CFeIj_93.js} +1 -1
  96. package/dist/web/assets/{liquid-BXFWITFq.js → liquid-DszhNRew.js} +1 -1
  97. package/dist/web/assets/{lspLanguageFeatures-DQ2CrOBI.js → lspLanguageFeatures-DyajWL04.js} +1 -1
  98. package/dist/web/assets/{mdx-vHLpslzI.js → mdx-D3Dg3IU3.js} +1 -1
  99. package/dist/web/assets/{mermaid-NOHMQCX5-CzwPLFrI.js → mermaid-NOHMQCX5-De7jApSL.js} +4 -4
  100. package/dist/web/assets/{message-square-DgdFa1Kc.js → message-square-Dly_bein.js} +1 -1
  101. package/dist/web/assets/{mindmap-definition-RKZ34NQL-CfzbnHY_.js → mindmap-definition-RKZ34NQL-BBl0Q2SW.js} +1 -1
  102. package/dist/web/assets/{modal-QnCJhV9P.js → modal-CyT9BpRm.js} +1 -1
  103. package/dist/web/assets/{monaco-CbFQByO7.js → monaco-DBlH7Gvr.js} +3 -3
  104. package/dist/web/assets/{pencil-CNVU3zfM.js → pencil-BLlfV3fH.js} +1 -1
  105. package/dist/web/assets/{pieDiagram-4H26LBE5-CDqYJneU.js → pieDiagram-4H26LBE5-BVrsUXUt.js} +1 -1
  106. package/dist/web/assets/{python-BhFSY_J2.js → python-C1GF9JX6.js} +1 -1
  107. package/dist/web/assets/{quadrantDiagram-W4KKPZXB-B6ChDIx2.js → quadrantDiagram-W4KKPZXB-Brnd7Z-x.js} +1 -1
  108. package/dist/web/assets/{razor-Cx_DrE-V.js → razor-CNwR1Ppb.js} +1 -1
  109. package/dist/web/assets/{requirementDiagram-4Y6WPE33-DefLT9NZ.js → requirementDiagram-4Y6WPE33-BEL5JUv5.js} +1 -1
  110. package/dist/web/assets/{sankeyDiagram-5OEKKPKP-CQHnovPz.js → sankeyDiagram-5OEKKPKP-Dg3pq8MF.js} +1 -1
  111. package/dist/web/assets/{select-CmbeAAVh.js → select-BQuOHpgx.js} +1 -1
  112. package/dist/web/assets/{sequenceDiagram-3UESZ5HK-DZuaKm7C.js → sequenceDiagram-3UESZ5HK-DvXxqwal.js} +1 -1
  113. package/dist/web/assets/{server-BUivqMYo.js → server-DmNZ4TcQ.js} +1 -1
  114. package/dist/web/assets/{stateDiagram-AJRCARHV-DvxpChEC.js → stateDiagram-AJRCARHV-BSXeM4wR.js} +1 -1
  115. package/dist/web/assets/stateDiagram-v2-BHNVJYJU-Cjr-lS2a.js +1 -0
  116. package/dist/web/assets/{switch-CiOyM13e.js → switch-BDzVWx67.js} +1 -1
  117. package/dist/web/assets/{textarea-D4HkYa3u.js → textarea-D4CrProF.js} +1 -1
  118. package/dist/web/assets/{timeline-definition-PNZ67QCA-BRu-tS-p.js → timeline-definition-PNZ67QCA-3rH0QWp7.js} +1 -1
  119. package/dist/web/assets/{trash-2-DPxBnxJM.js → trash-2-DHu1aC-u.js} +1 -1
  120. package/dist/web/assets/{tsMode-CHcZwUmC.js → tsMode-Z5KzKNgl.js} +1 -1
  121. package/dist/web/assets/{typescript-CvtjMxoq.js → typescript-Cg8IFK7o.js} +1 -1
  122. package/dist/web/assets/{upload-YmLtnZsU.js → upload-DQPwfdPh.js} +1 -1
  123. package/dist/web/assets/{use-profiles-OJAwfc90.js → use-profiles-DI5-xqHU.js} +1 -1
  124. package/dist/web/assets/{use-projects-iob5C7Xk.js → use-projects-Cs0-FMed.js} +1 -1
  125. package/dist/web/assets/{use-providers-Cj9S9_2q.js → use-providers-BoVFTPYO.js} +1 -1
  126. package/dist/web/assets/{useNormalizedLogs-BhN4AN4f.js → useNormalizedLogs-DhoOmBJo.js} +1 -1
  127. package/dist/web/assets/{vennDiagram-CIIHVFJN-CtZ_3Ld0.js → vennDiagram-CIIHVFJN-DAjUhsg9.js} +1 -1
  128. package/dist/web/assets/{wardley-L42UT6IY-h9yfTmIn.js → wardley-L42UT6IY-Db8PSpCZ.js} +1 -1
  129. package/dist/web/assets/{wardleyDiagram-YWT4CUSO-CWXtZtix.js → wardleyDiagram-YWT4CUSO-DfXfIOXM.js} +1 -1
  130. package/dist/web/assets/{xml-DhyGRwiG.js → xml-UOLWFxtD.js} +1 -1
  131. package/dist/web/assets/{xychartDiagram-2RQKCTM6-BLuWVWlL.js → xychartDiagram-2RQKCTM6-C41mtVgh.js} +1 -1
  132. package/dist/web/assets/{yaml-Cpi6SvoR.js → yaml-CeY5SySy.js} +1 -1
  133. package/dist/web/index.html +1 -1
  134. package/package.json +2 -2
  135. package/dist/web/assets/ConversationPage-BBnK1qA_.js +0 -3
  136. package/dist/web/assets/CreateTaskInput-B11wGhDW.js +0 -1
  137. package/dist/web/assets/channel-XuYe6lH7.js +0 -1
  138. package/dist/web/assets/check-FwR4dMNY.js +0 -1
  139. package/dist/web/assets/classDiagram-4FO5ZUOK-DWSNJHiT.js +0 -1
  140. package/dist/web/assets/classDiagram-v2-Q7XG4LA2-DWSNJHiT.js +0 -1
  141. package/dist/web/assets/javascript-Desq1P0G.js +0 -1
  142. package/dist/web/assets/stateDiagram-v2-BHNVJYJU-BbrRYMxK.js +0 -1
@@ -1,4 +1,4 @@
1
- import{s as Mt,g as Nt,q as zt,p as Lt,a as Tt,b as At,_ as u,K as Xt,D as Et,F as U,l as Q,I as Yt,e as It,z as Ft,c as V}from"./index-hPp73HMS.js";import{p as Bt}from"./chunk-4BX2VUAB-Bw_ITp1Q.js";import{p as Rt}from"./wardley-L42UT6IY-h9yfTmIn.js";import"./index-BGajgi5H.js";var G=u((o,r)=>{const e=o<=1?o*100:o;if(e<0||e>100)throw new Error(`${r} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${o}`);return e},"toPercent"),A=u((o,r,e)=>({x:G(r,`${e} evolution`),y:G(o,`${e} visibility`)}),"toCoordinates"),J=u(o=>{if(o){if(o==="+<>")return"bidirectional";if(o==="+<")return"backward";if(o==="+>")return"forward"}},"getFlowFromPort"),Ot=u(o=>{if(!o?.startsWith("+"))return{};const e=/^\+'([^']*)'/.exec(o)?.[1];return o.includes("<>")?{flow:"bidirectional",label:e}:o.includes("<")?{flow:"backward",label:e}:o.includes(">")?{flow:"forward",label:e}:{label:e}},"extractFlowFromArrow"),Wt=u((o,r)=>{if(Bt(o,r),o.size&&r.setSize(o.size.width,o.size.height),o.evolution){const e=o.evolution.stages.map(a=>a.secondName?`${a.name.trim()} / ${a.secondName.trim()}`:a.name.trim()),h=o.evolution.stages.filter(a=>a.boundary!==void 0).map(a=>a.boundary);r.updateAxes({stages:e,stageBoundaries:h})}if(o.anchors.forEach(e=>{const h=A(e.visibility,e.evolution,`Anchor "${e.name}"`);r.addNode(e.name,e.name,h.x,h.y,"anchor")}),o.components.forEach(e=>{const h=A(e.visibility,e.evolution,`Component "${e.name}"`),a=e.label?(e.label.negX?-1:1)*e.label.offsetX:void 0,d=e.label?(e.label.negY?-1:1)*e.label.offsetY:void 0,w=e.decorator?.strategy;r.addNode(e.name,e.name,h.x,h.y,"component",a,d,e.inertia,w)}),o.notes.forEach(e=>{const h=A(e.visibility,e.evolution,`Note "${e.text}"`);r.addNote(e.text,h.x,h.y)}),o.pipelines.forEach(e=>{const h=r.getNode(e.parent);if(!h||typeof h.y!="number")throw new Error(`Pipeline "${e.parent}" must reference an existing component with coordinates.`);const a=h.y;r.startPipeline(e.parent),e.components.forEach(d=>{const w=`${e.parent}_${d.name}`,C=d.label?(d.label.negX?-1:1)*d.label.offsetX:void 0,g=d.label?(d.label.negY?-1:1)*d.label.offsetY:void 0,R=G(d.evolution,`Pipeline component "${d.name}" evolution`);r.addNode(w,d.name,R,a,"pipeline-component",C,g),r.addPipelineComponent(e.parent,w)})}),o.links.forEach(e=>{const h=!!e.arrow&&(e.arrow.includes("-.->")||e.arrow.includes(".-."));let a=J(e.fromPort)??J(e.toPort);const{flow:d,label:w}=Ot(e.arrow);!a&&d&&(a=d);const C=e.linkLabel,g=w??C;r.addLink(r.resolveNodeId(e.from),r.resolveNodeId(e.to),h,g,a)}),o.evolves.forEach(e=>{const h=r.getNode(e.component);if(h?.y!==void 0){const a=G(e.target,`Evolve target for "${e.component}"`);r.addTrend(e.component,a,h.y)}}),o.annotations.length>0){const e=o.annotations[0],h=A(e.x,e.y,"Annotations box");r.setAnnotationsBox(h.x,h.y)}o.annotation.forEach(e=>{const h=A(e.x,e.y,`Annotation ${e.number}`);r.addAnnotation(e.number,[{x:h.x,y:h.y}],e.text)}),o.accelerators.forEach(e=>{const h=A(e.x,e.y,`Accelerator "${e.name}"`);r.addAccelerator(e.name,h.x,h.y)}),o.deaccelerators.forEach(e=>{const h=A(e.x,e.y,`Deaccelerator "${e.name}"`);r.addDeaccelerator(e.name,h.x,h.y)})},"populateDb"),tt={parser:{yy:void 0},parse:u(async o=>{const r=await Rt("wardley",o);Q.debug(r);const e=tt.parser?.yy;if(!e||typeof e.addNode!="function")throw new Error("parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Wt(r,e)},"parse")},E,Dt=(E=class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}addNode(r){const e=this.nodes.get(r.id)??{id:r.id,label:r.label},h={...e,...r,className:r.className??e.className,labelOffsetX:r.labelOffsetX??e.labelOffsetX,labelOffsetY:r.labelOffsetY??e.labelOffsetY};this.nodes.set(r.id,h)}addLink(r){this.links.push(r)}addTrend(r){this.trends.set(r.nodeId,r)}startPipeline(r){this.pipelines.set(r,{nodeId:r,componentIds:[]});const e=this.nodes.get(r);e&&(e.isPipelineParent=!0)}addPipelineComponent(r,e){const h=this.pipelines.get(r);h&&h.componentIds.push(e);const a=this.nodes.get(e);a&&(a.inPipeline=!0)}addAnnotation(r){this.annotations.push(r)}addNote(r){this.notes.push(r)}addAccelerator(r){this.accelerators.push(r)}addDeaccelerator(r){this.deaccelerators.push(r)}setAnnotationsBox(r,e){this.annotationsBox={x:r,y:e}}setAxes(r){this.axes={...this.axes,...r}}setSize(r,e){this.size={width:r,height:e}}getNode(r){return this.nodes.get(r)}resolveNodeId(r){if(this.nodes.has(r))return r;for(const[e,h]of this.nodes)if(h.label===r)return e;return r}build(){const r=[];for(const e of this.nodes.values()){if(typeof e.x!="number"||typeof e.y!="number")throw new Error(`Node "${e.label}" is missing coordinates`);r.push(e)}return{nodes:r,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}},u(E,"WardleyBuilder"),E),k=new Dt;function et(){return V()["wardley-beta"]}u(et,"getConfig");function at(o,r,e,h,a,d,w,C,g){k.addNode({id:o,label:r,x:e,y:h,className:a,labelOffsetX:d,labelOffsetY:w,inertia:C,sourceStrategy:g})}u(at,"addNode");function rt(o,r,e=!1,h,a){k.addLink({source:o,target:r,dashed:e,label:h,flow:a})}u(rt,"addLink");function ot(o,r,e){k.addTrend({nodeId:o,targetX:r,targetY:e})}u(ot,"addTrend");function nt(o,r,e){k.addAnnotation({number:o,coordinates:r,text:e})}u(nt,"addAnnotation");function st(o,r,e){k.addNote({text:o,x:r,y:e})}u(st,"addNote");function it(o,r,e){k.addAccelerator({name:o,x:r,y:e})}u(it,"addAccelerator");function dt(o,r,e){k.addDeaccelerator({name:o,x:r,y:e})}u(dt,"addDeaccelerator");function lt(o,r){k.setAnnotationsBox(o,r)}u(lt,"setAnnotationsBox");function ct(o,r){k.setSize(o,r)}u(ct,"setSize");function pt(o){k.startPipeline(o)}u(pt,"startPipeline");function ft(o,r){k.addPipelineComponent(o,r)}u(ft,"addPipelineComponent");function ht(o){k.setAxes(o)}u(ht,"updateAxes");function xt(o){return k.getNode(o)}u(xt,"getNode");function gt(o){return k.resolveNodeId(o)}u(gt,"resolveNodeId");function yt(){return k.build()}u(yt,"getWardleyData");function ut(){k.clear(),Ft()}u(ut,"clear");var Gt={getConfig:et,addNode:at,addLink:rt,addTrend:ot,addAnnotation:nt,addNote:st,addAccelerator:it,addDeaccelerator:dt,setAnnotationsBox:lt,setSize:ct,startPipeline:pt,addPipelineComponent:ft,updateAxes:ht,getNode:xt,resolveNodeId:gt,getWardleyData:yt,clear:ut,setAccTitle:At,getAccTitle:Tt,setDiagramTitle:Lt,getDiagramTitle:zt,getAccDescription:Nt,setAccDescription:Mt},qt=["Genesis","Custom Built","Product","Commodity"],Ht=u(()=>{const{themeVariables:o}=V();return{backgroundColor:o.wardley?.backgroundColor??o.background??"#fff",axisColor:o.wardley?.axisColor??"#000",axisTextColor:o.wardley?.axisTextColor??o.primaryTextColor??"#222",gridColor:o.wardley?.gridColor??"rgba(100, 100, 100, 0.2)",componentFill:o.wardley?.componentFill??"#fff",componentStroke:o.wardley?.componentStroke??"#000",componentLabelColor:o.wardley?.componentLabelColor??o.primaryTextColor??"#222",linkStroke:o.wardley?.linkStroke??"#000",evolutionStroke:o.wardley?.evolutionStroke??"#dc3545",annotationStroke:o.wardley?.annotationStroke??"#000",annotationTextColor:o.wardley?.annotationTextColor??o.primaryTextColor??"#222",annotationFill:o.wardley?.annotationFill??o.background??"#fff"}},"getTheme"),jt=u(()=>{const o=V()["wardley-beta"];return{width:o?.width??900,height:o?.height??600,padding:o?.padding??48,nodeRadius:o?.nodeRadius??6,nodeLabelOffset:o?.nodeLabelOffset??8,axisFontSize:o?.axisFontSize??12,labelFontSize:o?.labelFontSize??10,showGrid:o?.showGrid??!1,useMaxWidth:o?.useMaxWidth??!0}},"getConfigValues"),Vt=u((o,r,e,h)=>{Q.debug(`Rendering Wardley map
1
+ import{s as Mt,g as Nt,q as zt,p as Lt,a as Tt,b as At,_ as u,K as Xt,D as Et,F as U,l as Q,I as Yt,e as It,z as Ft,c as V}from"./index-9oo7US_J.js";import{p as Bt}from"./chunk-4BX2VUAB-xl3tQkpA.js";import{p as Rt}from"./wardley-L42UT6IY-Db8PSpCZ.js";import"./index-B0gHfTIK.js";var G=u((o,r)=>{const e=o<=1?o*100:o;if(e<0||e>100)throw new Error(`${r} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${o}`);return e},"toPercent"),A=u((o,r,e)=>({x:G(r,`${e} evolution`),y:G(o,`${e} visibility`)}),"toCoordinates"),J=u(o=>{if(o){if(o==="+<>")return"bidirectional";if(o==="+<")return"backward";if(o==="+>")return"forward"}},"getFlowFromPort"),Ot=u(o=>{if(!o?.startsWith("+"))return{};const e=/^\+'([^']*)'/.exec(o)?.[1];return o.includes("<>")?{flow:"bidirectional",label:e}:o.includes("<")?{flow:"backward",label:e}:o.includes(">")?{flow:"forward",label:e}:{label:e}},"extractFlowFromArrow"),Wt=u((o,r)=>{if(Bt(o,r),o.size&&r.setSize(o.size.width,o.size.height),o.evolution){const e=o.evolution.stages.map(a=>a.secondName?`${a.name.trim()} / ${a.secondName.trim()}`:a.name.trim()),h=o.evolution.stages.filter(a=>a.boundary!==void 0).map(a=>a.boundary);r.updateAxes({stages:e,stageBoundaries:h})}if(o.anchors.forEach(e=>{const h=A(e.visibility,e.evolution,`Anchor "${e.name}"`);r.addNode(e.name,e.name,h.x,h.y,"anchor")}),o.components.forEach(e=>{const h=A(e.visibility,e.evolution,`Component "${e.name}"`),a=e.label?(e.label.negX?-1:1)*e.label.offsetX:void 0,d=e.label?(e.label.negY?-1:1)*e.label.offsetY:void 0,w=e.decorator?.strategy;r.addNode(e.name,e.name,h.x,h.y,"component",a,d,e.inertia,w)}),o.notes.forEach(e=>{const h=A(e.visibility,e.evolution,`Note "${e.text}"`);r.addNote(e.text,h.x,h.y)}),o.pipelines.forEach(e=>{const h=r.getNode(e.parent);if(!h||typeof h.y!="number")throw new Error(`Pipeline "${e.parent}" must reference an existing component with coordinates.`);const a=h.y;r.startPipeline(e.parent),e.components.forEach(d=>{const w=`${e.parent}_${d.name}`,C=d.label?(d.label.negX?-1:1)*d.label.offsetX:void 0,g=d.label?(d.label.negY?-1:1)*d.label.offsetY:void 0,R=G(d.evolution,`Pipeline component "${d.name}" evolution`);r.addNode(w,d.name,R,a,"pipeline-component",C,g),r.addPipelineComponent(e.parent,w)})}),o.links.forEach(e=>{const h=!!e.arrow&&(e.arrow.includes("-.->")||e.arrow.includes(".-."));let a=J(e.fromPort)??J(e.toPort);const{flow:d,label:w}=Ot(e.arrow);!a&&d&&(a=d);const C=e.linkLabel,g=w??C;r.addLink(r.resolveNodeId(e.from),r.resolveNodeId(e.to),h,g,a)}),o.evolves.forEach(e=>{const h=r.getNode(e.component);if(h?.y!==void 0){const a=G(e.target,`Evolve target for "${e.component}"`);r.addTrend(e.component,a,h.y)}}),o.annotations.length>0){const e=o.annotations[0],h=A(e.x,e.y,"Annotations box");r.setAnnotationsBox(h.x,h.y)}o.annotation.forEach(e=>{const h=A(e.x,e.y,`Annotation ${e.number}`);r.addAnnotation(e.number,[{x:h.x,y:h.y}],e.text)}),o.accelerators.forEach(e=>{const h=A(e.x,e.y,`Accelerator "${e.name}"`);r.addAccelerator(e.name,h.x,h.y)}),o.deaccelerators.forEach(e=>{const h=A(e.x,e.y,`Deaccelerator "${e.name}"`);r.addDeaccelerator(e.name,h.x,h.y)})},"populateDb"),tt={parser:{yy:void 0},parse:u(async o=>{const r=await Rt("wardley",o);Q.debug(r);const e=tt.parser?.yy;if(!e||typeof e.addNode!="function")throw new Error("parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Wt(r,e)},"parse")},E,Dt=(E=class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}addNode(r){const e=this.nodes.get(r.id)??{id:r.id,label:r.label},h={...e,...r,className:r.className??e.className,labelOffsetX:r.labelOffsetX??e.labelOffsetX,labelOffsetY:r.labelOffsetY??e.labelOffsetY};this.nodes.set(r.id,h)}addLink(r){this.links.push(r)}addTrend(r){this.trends.set(r.nodeId,r)}startPipeline(r){this.pipelines.set(r,{nodeId:r,componentIds:[]});const e=this.nodes.get(r);e&&(e.isPipelineParent=!0)}addPipelineComponent(r,e){const h=this.pipelines.get(r);h&&h.componentIds.push(e);const a=this.nodes.get(e);a&&(a.inPipeline=!0)}addAnnotation(r){this.annotations.push(r)}addNote(r){this.notes.push(r)}addAccelerator(r){this.accelerators.push(r)}addDeaccelerator(r){this.deaccelerators.push(r)}setAnnotationsBox(r,e){this.annotationsBox={x:r,y:e}}setAxes(r){this.axes={...this.axes,...r}}setSize(r,e){this.size={width:r,height:e}}getNode(r){return this.nodes.get(r)}resolveNodeId(r){if(this.nodes.has(r))return r;for(const[e,h]of this.nodes)if(h.label===r)return e;return r}build(){const r=[];for(const e of this.nodes.values()){if(typeof e.x!="number"||typeof e.y!="number")throw new Error(`Node "${e.label}" is missing coordinates`);r.push(e)}return{nodes:r,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}},u(E,"WardleyBuilder"),E),k=new Dt;function et(){return V()["wardley-beta"]}u(et,"getConfig");function at(o,r,e,h,a,d,w,C,g){k.addNode({id:o,label:r,x:e,y:h,className:a,labelOffsetX:d,labelOffsetY:w,inertia:C,sourceStrategy:g})}u(at,"addNode");function rt(o,r,e=!1,h,a){k.addLink({source:o,target:r,dashed:e,label:h,flow:a})}u(rt,"addLink");function ot(o,r,e){k.addTrend({nodeId:o,targetX:r,targetY:e})}u(ot,"addTrend");function nt(o,r,e){k.addAnnotation({number:o,coordinates:r,text:e})}u(nt,"addAnnotation");function st(o,r,e){k.addNote({text:o,x:r,y:e})}u(st,"addNote");function it(o,r,e){k.addAccelerator({name:o,x:r,y:e})}u(it,"addAccelerator");function dt(o,r,e){k.addDeaccelerator({name:o,x:r,y:e})}u(dt,"addDeaccelerator");function lt(o,r){k.setAnnotationsBox(o,r)}u(lt,"setAnnotationsBox");function ct(o,r){k.setSize(o,r)}u(ct,"setSize");function pt(o){k.startPipeline(o)}u(pt,"startPipeline");function ft(o,r){k.addPipelineComponent(o,r)}u(ft,"addPipelineComponent");function ht(o){k.setAxes(o)}u(ht,"updateAxes");function xt(o){return k.getNode(o)}u(xt,"getNode");function gt(o){return k.resolveNodeId(o)}u(gt,"resolveNodeId");function yt(){return k.build()}u(yt,"getWardleyData");function ut(){k.clear(),Ft()}u(ut,"clear");var Gt={getConfig:et,addNode:at,addLink:rt,addTrend:ot,addAnnotation:nt,addNote:st,addAccelerator:it,addDeaccelerator:dt,setAnnotationsBox:lt,setSize:ct,startPipeline:pt,addPipelineComponent:ft,updateAxes:ht,getNode:xt,resolveNodeId:gt,getWardleyData:yt,clear:ut,setAccTitle:At,getAccTitle:Tt,setDiagramTitle:Lt,getDiagramTitle:zt,getAccDescription:Nt,setAccDescription:Mt},qt=["Genesis","Custom Built","Product","Commodity"],Ht=u(()=>{const{themeVariables:o}=V();return{backgroundColor:o.wardley?.backgroundColor??o.background??"#fff",axisColor:o.wardley?.axisColor??"#000",axisTextColor:o.wardley?.axisTextColor??o.primaryTextColor??"#222",gridColor:o.wardley?.gridColor??"rgba(100, 100, 100, 0.2)",componentFill:o.wardley?.componentFill??"#fff",componentStroke:o.wardley?.componentStroke??"#000",componentLabelColor:o.wardley?.componentLabelColor??o.primaryTextColor??"#222",linkStroke:o.wardley?.linkStroke??"#000",evolutionStroke:o.wardley?.evolutionStroke??"#dc3545",annotationStroke:o.wardley?.annotationStroke??"#000",annotationTextColor:o.wardley?.annotationTextColor??o.primaryTextColor??"#222",annotationFill:o.wardley?.annotationFill??o.background??"#fff"}},"getTheme"),jt=u(()=>{const o=V()["wardley-beta"];return{width:o?.width??900,height:o?.height??600,padding:o?.padding??48,nodeRadius:o?.nodeRadius??6,nodeLabelOffset:o?.nodeLabelOffset??8,axisFontSize:o?.axisFontSize??12,labelFontSize:o?.labelFontSize??10,showGrid:o?.showGrid??!1,useMaxWidth:o?.useMaxWidth??!0}},"getConfigValues"),Vt=u((o,r,e,h)=>{Q.debug(`Rendering Wardley map
2
2
  `+o);const a=jt(),d=Ht(),w=a.nodeRadius*1.6,C=h.db,g=C.getWardleyData(),R=C.getDiagramTitle(),S=g.size?.width??a.width,b=g.size?.height??a.height,Y=Yt(r);Y.selectAll("*").remove(),It(Y,b,S,a.useMaxWidth),Y.attr("viewBox",`0 0 ${S} ${b}`);const v=Y.append("g").attr("class","wardley-map"),q=Y.append("defs");q.append("marker").attr("id",`arrow-${r}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",d.evolutionStroke).attr("stroke","none"),q.append("marker").attr("id",`link-arrow-end-${r}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",d.linkStroke).attr("stroke","none"),q.append("marker").attr("id",`link-arrow-start-${r}`).attr("viewBox","0 0 10 10").attr("refX",1).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z").attr("fill",d.linkStroke).attr("stroke","none"),v.append("rect").attr("class","wardley-background").attr("width",S).attr("height",b).attr("fill",d.backgroundColor);const I=S-a.padding*2,F=b-a.padding*2;R&&v.append("text").attr("class","wardley-title").attr("x",S/2).attr("y",a.padding/2).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize*1.05).attr("font-weight","bold").attr("text-anchor","middle").attr("dominant-baseline","middle").text(R);const z=u(t=>a.padding+t/100*I,"projectX"),L=u(t=>b-a.padding-t/100*F,"projectY"),O=v.append("g").attr("class","wardley-axes");O.append("line").attr("x1",a.padding).attr("x2",S-a.padding).attr("y1",b-a.padding).attr("y2",b-a.padding).attr("stroke",d.axisColor).attr("stroke-width",1),O.append("line").attr("x1",a.padding).attr("x2",a.padding).attr("y1",a.padding).attr("y2",b-a.padding).attr("stroke",d.axisColor).attr("stroke-width",1);const wt=g.axes.xLabel??"Evolution",mt=g.axes.yLabel??"Visibility";O.append("text").attr("class","wardley-axis-label wardley-axis-label-x").attr("x",a.padding+I/2).attr("y",b-a.padding/4).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").text(wt),O.append("text").attr("class","wardley-axis-label wardley-axis-label-y").attr("x",a.padding/3).attr("y",a.padding+F/2).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").attr("transform",`rotate(-90 ${a.padding/3} ${a.padding+F/2})`).text(mt);const B=g.axes.stages&&g.axes.stages.length>0?g.axes.stages:qt;if(B.length>0){const t=v.append("g").attr("class","wardley-stages"),s=g.axes.stageBoundaries,n=[];if(s&&s.length===B.length){let i=0;s.forEach(p=>{n.push({start:i,end:p}),i=p})}else{const i=1/B.length;B.forEach((p,l)=>{n.push({start:l*i,end:(l+1)*i})})}B.forEach((i,p)=>{const l=n[p],f=a.padding+l.start*I,x=a.padding+l.end*I,y=(f+x)/2;p>0&&t.append("line").attr("x1",f).attr("x2",f).attr("y1",a.padding).attr("y2",b-a.padding).attr("stroke","#000").attr("stroke-width",1).attr("stroke-dasharray","5 5").attr("opacity",.8),t.append("text").attr("class","wardley-stage-label").attr("x",y).attr("y",b-a.padding/1.5).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize-2).attr("text-anchor","middle").text(i)})}if(a.showGrid){const t=v.append("g").attr("class","wardley-grid");for(let s=1;s<4;s++){const n=s/4,i=a.padding+I*n;t.append("line").attr("x1",i).attr("x2",i).attr("y1",a.padding).attr("y2",b-a.padding).attr("stroke",d.gridColor).attr("stroke-dasharray","2 6"),t.append("line").attr("x1",a.padding).attr("x2",S-a.padding).attr("y1",b-a.padding-F*n).attr("y2",b-a.padding-F*n).attr("stroke",d.gridColor).attr("stroke-dasharray","2 6")}}const c=new Map;if(g.nodes.forEach(t=>{c.set(t.id,{x:z(t.x),y:L(t.y),node:t})}),g.pipelines.length>0){const t=v.append("g").attr("class","wardley-pipelines"),s=v.append("g").attr("class","wardley-pipeline-links");g.pipelines.forEach(n=>{if(n.componentIds.length===0)return;const i=n.componentIds.map(x=>({id:x,pos:c.get(x),node:g.nodes.find(y=>y.id===x)})).filter(x=>x.pos&&x.node).sort((x,y)=>x.node.x-y.node.x);for(let x=0;x<i.length-1;x++){const y=i[x],m=i[x+1];s.append("line").attr("class","wardley-pipeline-evolution-link").attr("x1",y.pos.x).attr("y1",y.pos.y).attr("x2",m.pos.x).attr("y2",m.pos.y).attr("stroke",d.linkStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4")}let p=1/0,l=-1/0,f=0;if(n.componentIds.forEach(x=>{const y=c.get(x);y&&(p=Math.min(p,y.x),l=Math.max(l,y.x),f=y.y)}),p!==1/0&&l!==-1/0){const y=a.nodeRadius*4,m=f-y/2,P=c.get(n.nodeId);if(P){const N=(p+l)/2;P.x=N,P.y=m-w/6}t.append("rect").attr("class","wardley-pipeline-box").attr("x",p-15).attr("y",m).attr("width",l-p+30).attr("height",y).attr("fill","none").attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}})}const _=v.append("g").attr("class","wardley-links"),Z=new Map;g.pipelines.forEach(t=>{Z.set(t.nodeId,new Set(t.componentIds))});const K=g.links.filter(t=>!(!c.has(t.source)||!c.has(t.target)||Z.get(t.target)?.has(t.source)));_.selectAll("line").data(K).enter().append("line").attr("class",t=>`wardley-link${t.dashed?" wardley-link--dashed":""}`).attr("x1",t=>{const s=c.get(t.source),n=c.get(t.target),p=g.nodes.find(y=>y.id===t.source).isPipelineParent?w/Math.sqrt(2):a.nodeRadius,l=n.x-s.x,f=n.y-s.y,x=Math.sqrt(l*l+f*f);return s.x+l/x*p}).attr("y1",t=>{const s=c.get(t.source),n=c.get(t.target),p=g.nodes.find(y=>y.id===t.source).isPipelineParent?w/Math.sqrt(2):a.nodeRadius,l=n.x-s.x,f=n.y-s.y,x=Math.sqrt(l*l+f*f);return s.y+f/x*p}).attr("x2",t=>{const s=c.get(t.source),n=c.get(t.target),p=g.nodes.find(y=>y.id===t.target).isPipelineParent?w/Math.sqrt(2):a.nodeRadius,l=s.x-n.x,f=s.y-n.y,x=Math.sqrt(l*l+f*f);return n.x+l/x*p}).attr("y2",t=>{const s=c.get(t.source),n=c.get(t.target),p=g.nodes.find(y=>y.id===t.target).isPipelineParent?w/Math.sqrt(2):a.nodeRadius,l=s.x-n.x,f=s.y-n.y,x=Math.sqrt(l*l+f*f);return n.y+f/x*p}).attr("stroke",d.linkStroke).attr("stroke-width",1).attr("stroke-dasharray",t=>t.dashed?"6 6":null).attr("marker-end",t=>t.flow==="forward"||t.flow==="bidirectional"?`url(#link-arrow-end-${r})`:null).attr("marker-start",t=>t.flow==="backward"||t.flow==="bidirectional"?`url(#link-arrow-start-${r})`:null),_.selectAll("text").data(K.filter(t=>t.label)).enter().append("text").attr("class","wardley-link-label").attr("x",t=>{const s=c.get(t.source),n=c.get(t.target),i=(s.x+n.x)/2,p=n.y-s.y,l=n.x-s.x,f=Math.sqrt(l*l+p*p),x=8,y=p/f;return i+y*x}).attr("y",t=>{const s=c.get(t.source),n=c.get(t.target),i=(s.y+n.y)/2,p=n.x-s.x,l=n.y-s.y,f=Math.sqrt(p*p+l*l),x=8,y=-p/f;return i+y*x}).attr("fill",d.axisTextColor).attr("font-size",a.labelFontSize).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("transform",t=>{const s=c.get(t.source),n=c.get(t.target),i=(s.x+n.x)/2,p=(s.y+n.y)/2,l=n.x-s.x,f=n.y-s.y,x=Math.sqrt(l*l+f*f),y=8,m=f/x,P=-l/x,N=i+m*y,W=p+P*y;let X=Math.atan2(f,l)*180/Math.PI;return(X>90||X<-90)&&(X+=180),`rotate(${X} ${N} ${W})`}).text(t=>t.label);const kt=v.append("g").attr("class","wardley-trends"),bt=g.trends.map(t=>{const s=c.get(t.nodeId);if(!s)return null;const n=z(t.targetX),i=L(t.targetY),p=n-s.x,l=i-s.y,f=Math.sqrt(p*p+l*l),x=a.nodeRadius+2,y=f>x?n-p/f*x:n,m=f>x?i-l/f*x:i;return{origin:s,targetX:n,targetY:i,adjustedX2:y,adjustedY2:m}}).filter(t=>t!==null);kt.selectAll("line").data(bt).enter().append("line").attr("class","wardley-trend").attr("x1",t=>t.origin.x).attr("y1",t=>t.origin.y).attr("x2",t=>t.adjustedX2).attr("y2",t=>t.adjustedY2).attr("stroke",d.evolutionStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4").attr("marker-end",`url(#arrow-${r})`);const M=v.append("g").attr("class","wardley-nodes").selectAll("g").data(g.nodes).enter().append("g").attr("class",t=>["wardley-node",t.className?`wardley-node--${t.className}`:""].filter(Boolean).join(" "));M.filter(t=>t.sourceStrategy==="outsource").append("circle").attr("class","wardley-outsource-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","#666").attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>t.sourceStrategy==="buy").append("circle").attr("class","wardley-buy-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","#ccc").attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>t.sourceStrategy==="build").append("circle").attr("class","wardley-build-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","#eee").attr("stroke","#000").attr("stroke-width",1);const T=M.filter(t=>t.sourceStrategy==="market");T.append("circle").attr("class","wardley-market-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>!t.isPipelineParent&&t.sourceStrategy!=="market"&&t.className!=="anchor").append("circle").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius).attr("fill",d.componentFill).attr("stroke",d.componentStroke).attr("stroke-width",1);const H=a.nodeRadius*.7,$=a.nodeRadius*1.2;if(T.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x).attr("y1",t=>c.get(t.id).y-$).attr("x2",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("y2",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("stroke",d.componentStroke).attr("stroke-width",1),T.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("y1",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("x2",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("y2",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("stroke",d.componentStroke).attr("stroke-width",1),T.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("y1",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("x2",t=>c.get(t.id).x).attr("y2",t=>c.get(t.id).y-$).attr("stroke",d.componentStroke).attr("stroke-width",1),T.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y-$).attr("r",H).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),T.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("cy",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("r",H).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),T.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("cy",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("r",H).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),M.filter(t=>t.isPipelineParent===!0).append("rect").attr("x",t=>c.get(t.id).x-w/2).attr("y",t=>c.get(t.id).y-w/2).attr("width",w).attr("height",w).attr("fill",d.componentFill).attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>t.inertia===!0).append("line").attr("class","wardley-inertia").attr("x1",t=>{const s=c.get(t.id);let n=t.isPipelineParent?w/2+15:a.nodeRadius+15;return t.sourceStrategy&&(n+=a.nodeRadius+10),s.x+n}).attr("y1",t=>{const s=c.get(t.id),n=t.isPipelineParent?w:a.nodeRadius*2;return s.y-n/2}).attr("x2",t=>{const s=c.get(t.id);let n=t.isPipelineParent?w/2+15:a.nodeRadius+15;return t.sourceStrategy&&(n+=a.nodeRadius+10),s.x+n}).attr("y2",t=>{const s=c.get(t.id),n=t.isPipelineParent?w:a.nodeRadius*2;return s.y+n/2}).attr("stroke",d.componentStroke).attr("stroke-width",6),M.append("text").attr("x",t=>{const s=c.get(t.id);if(t.className==="anchor")return t.labelOffsetX!==void 0?s.x+t.labelOffsetX:s.x;let n=a.nodeLabelOffset;t.sourceStrategy&&t.labelOffsetX===void 0&&(n+=10);const i=t.labelOffsetX??n;return s.x+i}).attr("y",t=>{const s=c.get(t.id);if(t.className==="anchor")return t.labelOffsetY!==void 0?s.y+t.labelOffsetY:s.y-3;let n=-a.nodeLabelOffset;t.sourceStrategy&&t.labelOffsetY===void 0&&(n-=10);const i=t.labelOffsetY??n;return s.y+i}).attr("class","wardley-node-label").attr("fill",t=>t.className==="evolved"?d.evolutionStroke:t.className==="anchor"?"#000":d.componentLabelColor).attr("font-size",a.labelFontSize).attr("font-weight",t=>t.className==="anchor"?"bold":"normal").attr("text-anchor",t=>t.className==="anchor"?"middle":"start").attr("dominant-baseline",t=>t.className==="anchor"?"middle":"auto").text(t=>t.label),g.annotations.length>0){const t=v.append("g").attr("class","wardley-annotations");if(g.annotations.forEach(s=>{const n=s.coordinates.map(i=>({x:z(i.x),y:L(i.y)}));if(n.length>1)for(let i=0;i<n.length-1;i++)t.append("line").attr("class","wardley-annotation-line").attr("x1",n[i].x).attr("y1",n[i].y).attr("x2",n[i+1].x).attr("y2",n[i+1].y).attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("stroke-dasharray","4 4");n.forEach(i=>{const p=t.append("g").attr("class","wardley-annotation");p.append("circle").attr("cx",i.x).attr("cy",i.y).attr("r",10).attr("fill","white").attr("stroke",d.axisColor).attr("stroke-width",1.5),p.append("text").attr("x",i.x).attr("y",i.y).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",10).attr("fill",d.axisTextColor).attr("font-weight","bold").text(s.number)})}),g.annotationsBox){let s=z(g.annotationsBox.x),n=L(g.annotationsBox.y);const i=10,p=16,l=11,f=t.append("g").attr("class","wardley-annotations-box"),x=[...g.annotations].filter(m=>m.text).sort((m,P)=>m.number-P.number),y=[];if(x.forEach((m,P)=>{const N=f.append("text").attr("x",s+i).attr("y",n+i+(P+1)*p).attr("font-size",l).attr("fill",d.axisTextColor).attr("text-anchor","start").attr("dominant-baseline","middle").text(`${m.number}. ${m.text}`);y.push(N)}),y.length>0){let m=0,P=0;y.forEach(j=>{const D=j.node(),Ct=D.getComputedTextLength();m=Math.max(m,Ct);const St=D.getBBox();P=Math.max(P,St.height)});const N=m+i*2+105,W=x.length*p+i*2+P/2,X=a.padding,$t=S-a.padding-N,vt=a.padding,Pt=b-a.padding-W;s=Math.max(X,Math.min(s,$t)),n=Math.max(vt,Math.min(n,Pt)),y.forEach((j,D)=>{j.attr("x",s+i).attr("y",n+i+(D+1)*p)}),f.insert("rect","text").attr("x",s).attr("y",n).attr("width",N).attr("height",W).attr("fill","white").attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}}}if(g.notes.length>0){const t=v.append("g").attr("class","wardley-notes");g.notes.forEach(s=>{const n=z(s.x),i=L(s.y);t.append("text").attr("x",n).attr("y",i).attr("text-anchor","start").attr("font-size",11).attr("fill",d.axisTextColor).attr("font-weight","bold").text(s.text)})}if(g.accelerators.length>0){const t=v.append("g").attr("class","wardley-accelerators");g.accelerators.forEach(s=>{const n=z(s.x),i=L(s.y),p=60,l=30,f=20,x=`
3
3
  M ${n} ${i-l/2}
4
4
  L ${n+p-f} ${i-l/2}
@@ -1 +1 @@
1
- import{l as t}from"./monaco-CbFQByO7.js";import"./ProjectKanbanPage-DK3rZJzY.js";import"./index-BGajgi5H.js";import"./mermaid-NOHMQCX5-CzwPLFrI.js";import"./chevron-right-CBoUSXVq.js";import"./chevron-down-CpKODb7Y.js";import"./confirm-dialog-DDWlvtJs.js";import"./modal-QnCJhV9P.js";import"./Icons-BFOphLw-.js";import"./CreateTaskInput-B11wGhDW.js";import"./AgentLogo-Dyqxcj5s.js";import"./check-FwR4dMNY.js";import"./use-projects-iob5C7Xk.js";import"./MemberAvatar-1UlgMZMM.js";import"./use-providers-Cj9S9_2q.js";import"./trash-2-DPxBnxJM.js";import"./useNormalizedLogs-BhN4AN4f.js";import"./folder-picker-CBVEWiuS.js";import"./circle-alert-kELlE07n.js";import"./message-square-DgdFa1Kc.js";import"./layers-WOwm63Fo.js";import"./chevron-up-KZ1hsL8y.js";import"./select-CmbeAAVh.js";import"./textarea-D4HkYa3u.js";import"./server-BUivqMYo.js";import"./upload-YmLtnZsU.js";import"./arrow-left-Jn-v17JF.js";import"./pencil-CNVU3zfM.js";const P={comments:{blockComment:["<!--","-->"]},brackets:[["<",">"]],autoClosingPairs:[{open:"<",close:">"},{open:"'",close:"'"},{open:'"',close:'"'}],surroundingPairs:[{open:"<",close:">"},{open:"'",close:"'"},{open:'"',close:'"'}],onEnterRules:[{beforeText:new RegExp("<([_:\\w][_:\\w-.\\d]*)([^/>]*(?!/)>)[^<]*$","i"),afterText:/^<\/([_:\w][_:\w-.\d]*)\s*>$/i,action:{indentAction:t.IndentAction.IndentOutdent}},{beforeText:new RegExp("<(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$","i"),action:{indentAction:t.IndentAction.Indent}}]},R={defaultToken:"",tokenPostfix:".xml",ignoreCase:!0,qualifiedName:/(?:[\w\.\-]+:)?[\w\.\-]+/,tokenizer:{root:[[/[^<&]+/,""],{include:"@whitespace"},[/(<)(@qualifiedName)/,[{token:"delimiter"},{token:"tag",next:"@tag"}]],[/(<\/)(@qualifiedName)(\s*)(>)/,[{token:"delimiter"},{token:"tag"},"",{token:"delimiter"}]],[/(<\?)(@qualifiedName)/,[{token:"delimiter"},{token:"metatag",next:"@tag"}]],[/(<\!)(@qualifiedName)/,[{token:"delimiter"},{token:"metatag",next:"@tag"}]],[/<\!\[CDATA\[/,{token:"delimiter.cdata",next:"@cdata"}],[/&\w+;/,"string.escape"]],cdata:[[/[^\]]+/,""],[/\]\]>/,{token:"delimiter.cdata",next:"@pop"}],[/\]/,""]],tag:[[/[ \t\r\n]+/,""],[/(@qualifiedName)(\s*=\s*)("[^"]*"|'[^']*')/,["attribute.name","","attribute.value"]],[/(@qualifiedName)(\s*=\s*)("[^">?\/]*|'[^'>?\/]*)(?=[\?\/]\>)/,["attribute.name","","attribute.value"]],[/(@qualifiedName)(\s*=\s*)("[^">]*|'[^'>]*)/,["attribute.name","","attribute.value"]],[/@qualifiedName/,"attribute.name"],[/\?>/,{token:"delimiter",next:"@pop"}],[/(\/)(>)/,[{token:"tag"},{token:"delimiter",next:"@pop"}]],[/>/,{token:"delimiter",next:"@pop"}]],whitespace:[[/[ \t\r\n]+/,""],[/<!--/,{token:"comment",next:"@comment"}]],comment:[[/[^<\-]+/,"comment.content"],[/-->/,{token:"comment",next:"@pop"}],[/<!--/,"comment.content.invalid"],[/[<\-]/,"comment.content"]]}};export{P as conf,R as language};
1
+ import{l as t}from"./monaco-DBlH7Gvr.js";import"./ProjectKanbanPage-D62MacD4.js";import"./index-B0gHfTIK.js";import"./mermaid-NOHMQCX5-De7jApSL.js";import"./chevron-right-BEw6jjbJ.js";import"./chevron-down-BTGC8Sed.js";import"./confirm-dialog-C8rPqdFE.js";import"./modal-CyT9BpRm.js";import"./Icons-DGahMuvC.js";import"./CreateTaskInput-DSl73Wwc.js";import"./AgentLogo-BQ4AhPCM.js";import"./check-CYQXIceH.js";import"./use-projects-Cs0-FMed.js";import"./MemberAvatar-5bEbGww5.js";import"./use-providers-BoVFTPYO.js";import"./trash-2-DHu1aC-u.js";import"./useNormalizedLogs-DhoOmBJo.js";import"./folder-picker-iHGLWmJF.js";import"./circle-alert-BGbIBYEs.js";import"./message-square-Dly_bein.js";import"./layers-B4Hb2k1E.js";import"./chevron-up-D_Hmx6ug.js";import"./select-BQuOHpgx.js";import"./textarea-D4CrProF.js";import"./server-DmNZ4TcQ.js";import"./upload-DQPwfdPh.js";import"./arrow-left-2dTz1a0q.js";import"./pencil-BLlfV3fH.js";const P={comments:{blockComment:["<!--","-->"]},brackets:[["<",">"]],autoClosingPairs:[{open:"<",close:">"},{open:"'",close:"'"},{open:'"',close:'"'}],surroundingPairs:[{open:"<",close:">"},{open:"'",close:"'"},{open:'"',close:'"'}],onEnterRules:[{beforeText:new RegExp("<([_:\\w][_:\\w-.\\d]*)([^/>]*(?!/)>)[^<]*$","i"),afterText:/^<\/([_:\w][_:\w-.\d]*)\s*>$/i,action:{indentAction:t.IndentAction.IndentOutdent}},{beforeText:new RegExp("<(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$","i"),action:{indentAction:t.IndentAction.Indent}}]},R={defaultToken:"",tokenPostfix:".xml",ignoreCase:!0,qualifiedName:/(?:[\w\.\-]+:)?[\w\.\-]+/,tokenizer:{root:[[/[^<&]+/,""],{include:"@whitespace"},[/(<)(@qualifiedName)/,[{token:"delimiter"},{token:"tag",next:"@tag"}]],[/(<\/)(@qualifiedName)(\s*)(>)/,[{token:"delimiter"},{token:"tag"},"",{token:"delimiter"}]],[/(<\?)(@qualifiedName)/,[{token:"delimiter"},{token:"metatag",next:"@tag"}]],[/(<\!)(@qualifiedName)/,[{token:"delimiter"},{token:"metatag",next:"@tag"}]],[/<\!\[CDATA\[/,{token:"delimiter.cdata",next:"@cdata"}],[/&\w+;/,"string.escape"]],cdata:[[/[^\]]+/,""],[/\]\]>/,{token:"delimiter.cdata",next:"@pop"}],[/\]/,""]],tag:[[/[ \t\r\n]+/,""],[/(@qualifiedName)(\s*=\s*)("[^"]*"|'[^']*')/,["attribute.name","","attribute.value"]],[/(@qualifiedName)(\s*=\s*)("[^">?\/]*|'[^'>?\/]*)(?=[\?\/]\>)/,["attribute.name","","attribute.value"]],[/(@qualifiedName)(\s*=\s*)("[^">]*|'[^'>]*)/,["attribute.name","","attribute.value"]],[/@qualifiedName/,"attribute.name"],[/\?>/,{token:"delimiter",next:"@pop"}],[/(\/)(>)/,[{token:"tag"},{token:"delimiter",next:"@pop"}]],[/>/,{token:"delimiter",next:"@pop"}]],whitespace:[[/[ \t\r\n]+/,""],[/<!--/,{token:"comment",next:"@comment"}]],comment:[[/[^<\-]+/,"comment.content"],[/-->/,{token:"comment",next:"@pop"}],[/<!--/,"comment.content.invalid"],[/[<\-]/,"comment.content"]]}};export{P as conf,R as language};
@@ -1,4 +1,4 @@
1
- import{s as gi,g as xi,q as Xt,p as di,a as fi,b as pi,_ as a,l as Yt,I as mi,e as yi,z as bi,D as _t,i as Ai,F as Nt,G as wi,K as Ci,am as Si,R as Wt}from"./index-hPp73HMS.js";import{i as _i}from"./init-Gi6I4Gst.js";import{o as ki}from"./ordinal-Cboi1Yqb.js";import{l as zt}from"./linear-ChUj9SvT.js";import"./index-BGajgi5H.js";import"./defaultLocale-DX6XiGOO.js";function Ri(e,t,i){e=+e,t=+t,i=(n=arguments.length)<2?(t=e,e=0,1):n<3?1:+i;for(var s=-1,n=Math.max(0,Math.ceil((t-e)/i))|0,o=new Array(n);++s<n;)o[s]=e+s*i;return o}function bt(){var e=ki().unknown(void 0),t=e.domain,i=e.range,s=0,n=1,o,u,p=!1,f=0,T=0,P=.5;delete e.unknown;function _(){var y=t().length,E=n<s,v=E?n:s,L=E?s:n;o=(L-v)/Math.max(1,y-f+T*2),p&&(o=Math.floor(o)),v+=(L-v-o*(y-f))*P,u=o*(1-f),p&&(v=Math.round(v),u=Math.round(u));var I=Ri(y).map(function(m){return v+o*m});return i(E?I.reverse():I)}return e.domain=function(y){return arguments.length?(t(y),_()):t()},e.range=function(y){return arguments.length?([s,n]=y,s=+s,n=+n,_()):[s,n]},e.rangeRound=function(y){return[s,n]=y,s=+s,n=+n,p=!0,_()},e.bandwidth=function(){return u},e.step=function(){return o},e.round=function(y){return arguments.length?(p=!!y,_()):p},e.padding=function(y){return arguments.length?(f=Math.min(1,T=+y),_()):f},e.paddingInner=function(y){return arguments.length?(f=Math.min(1,y),_()):f},e.paddingOuter=function(y){return arguments.length?(T=+y,_()):T},e.align=function(y){return arguments.length?(P=Math.max(0,Math.min(1,y)),_()):P},e.copy=function(){return bt(t(),[s,n]).round(p).paddingInner(f).paddingOuter(T).align(P)},_i.apply(_(),arguments)}var At=(function(){var e=a(function(F,h,c,g){for(c=c||{},g=F.length;g--;c[F[g]]=h);return c},"o"),t=[1,10,12,14,16,18,19,21,23],i=[2,6],s=[1,3],n=[1,5],o=[1,6],u=[1,7],p=[1,5,10,12,14,16,18,19,21,23,34,35,36],f=[1,25],T=[1,26],P=[1,28],_=[1,29],y=[1,30],E=[1,31],v=[1,32],L=[1,33],I=[1,34],m=[1,35],R=[1,36],l=[1,37],W=[1,43],O=[1,42],X=[1,47],Y=[1,50],S=[1,10,12,14,16,18,19,21,23,34,35,36],U=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36],b=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36,41,42,43,44,45,46,47,48,49,50],w=[1,64],V={trace:a(function(){},"trace"),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,commaSeparatedNumbers:25,SQUARE_BRACES_END:26,NUMBER_WITH_DECIMAL:27,COMMA:28,xAxisData:29,bandData:30,ARROW_DELIMITER:31,commaSeparatedTexts:32,yAxisData:33,NEWLINE:34,SEMI:35,EOF:36,alphaNum:37,STR:38,MD_STR:39,alphaNumToken:40,AMP:41,NUM:42,ALPHA:43,PLUS:44,EQUALS:45,MULT:46,DOT:47,BRKT:48,MINUS:49,UNDERSCORE:50,$accept:0,$end:1},terminals_:{2:"error",5:"XYCHART",8:"CHART_ORIENTATION",10:"title",12:"X_AXIS",14:"Y_AXIS",16:"LINE",18:"BAR",19:"acc_title",20:"acc_title_value",21:"acc_descr",22:"acc_descr_value",23:"acc_descr_multiline_value",24:"SQUARE_BRACES_START",26:"SQUARE_BRACES_END",27:"NUMBER_WITH_DECIMAL",28:"COMMA",31:"ARROW_DELIMITER",34:"NEWLINE",35:"SEMI",36:"EOF",38:"STR",39:"MD_STR",41:"AMP",42:"NUM",43:"ALPHA",44:"PLUS",45:"EQUALS",46:"MULT",47:"DOT",48:"BRKT",49:"MINUS",50:"UNDERSCORE"},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[13,1],[13,2],[13,1],[29,1],[29,3],[30,3],[32,3],[32,1],[15,1],[15,2],[15,1],[33,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[37,1],[37,2],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1]],performAction:a(function(h,c,g,x,C,r,rt){var d=r.length-1;switch(C){case 5:x.setOrientation(r[d]);break;case 9:x.setDiagramTitle(r[d].text.trim());break;case 12:x.setLineData({text:"",type:"text"},r[d]);break;case 13:x.setLineData(r[d-1],r[d]);break;case 14:x.setBarData({text:"",type:"text"},r[d]);break;case 15:x.setBarData(r[d-1],r[d]);break;case 16:this.$=r[d].trim(),x.setAccTitle(this.$);break;case 17:case 18:this.$=r[d].trim(),x.setAccDescription(this.$);break;case 19:this.$=r[d-1];break;case 20:this.$=[Number(r[d-2]),...r[d]];break;case 21:this.$=[Number(r[d])];break;case 22:x.setXAxisTitle(r[d]);break;case 23:x.setXAxisTitle(r[d-1]);break;case 24:x.setXAxisTitle({type:"text",text:""});break;case 25:x.setXAxisBand(r[d]);break;case 26:x.setXAxisRangeData(Number(r[d-2]),Number(r[d]));break;case 27:this.$=r[d-1];break;case 28:this.$=[r[d-2],...r[d]];break;case 29:this.$=[r[d]];break;case 30:x.setYAxisTitle(r[d]);break;case 31:x.setYAxisTitle(r[d-1]);break;case 32:x.setYAxisTitle({type:"text",text:""});break;case 33:x.setYAxisRangeData(Number(r[d-2]),Number(r[d]));break;case 37:this.$={text:r[d],type:"text"};break;case 38:this.$={text:r[d],type:"text"};break;case 39:this.$={text:r[d],type:"markdown"};break;case 40:this.$=r[d];break;case 41:this.$=r[d-1]+""+r[d];break}},"anonymous"),table:[e(t,i,{3:1,4:2,7:4,5:s,34:n,35:o,36:u}),{1:[3]},e(t,i,{4:2,7:4,3:8,5:s,34:n,35:o,36:u}),e(t,i,{4:2,7:4,6:9,3:10,5:s,8:[1,11],34:n,35:o,36:u}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},e(p,[2,34]),e(p,[2,35]),e(p,[2,36]),{1:[2,1]},e(t,i,{4:2,7:4,3:21,5:s,34:n,35:o,36:u}),{1:[2,3]},e(p,[2,5]),e(t,[2,7],{4:22,34:n,35:o,36:u}),{11:23,37:24,38:f,39:T,40:27,41:P,42:_,43:y,44:E,45:v,46:L,47:I,48:m,49:R,50:l},{11:39,13:38,24:W,27:O,29:40,30:41,37:24,38:f,39:T,40:27,41:P,42:_,43:y,44:E,45:v,46:L,47:I,48:m,49:R,50:l},{11:45,15:44,27:X,33:46,37:24,38:f,39:T,40:27,41:P,42:_,43:y,44:E,45:v,46:L,47:I,48:m,49:R,50:l},{11:49,17:48,24:Y,37:24,38:f,39:T,40:27,41:P,42:_,43:y,44:E,45:v,46:L,47:I,48:m,49:R,50:l},{11:52,17:51,24:Y,37:24,38:f,39:T,40:27,41:P,42:_,43:y,44:E,45:v,46:L,47:I,48:m,49:R,50:l},{20:[1,53]},{22:[1,54]},e(S,[2,18]),{1:[2,2]},e(S,[2,8]),e(S,[2,9]),e(U,[2,37],{40:55,41:P,42:_,43:y,44:E,45:v,46:L,47:I,48:m,49:R,50:l}),e(U,[2,38]),e(U,[2,39]),e(b,[2,40]),e(b,[2,42]),e(b,[2,43]),e(b,[2,44]),e(b,[2,45]),e(b,[2,46]),e(b,[2,47]),e(b,[2,48]),e(b,[2,49]),e(b,[2,50]),e(b,[2,51]),e(S,[2,10]),e(S,[2,22],{30:41,29:56,24:W,27:O}),e(S,[2,24]),e(S,[2,25]),{31:[1,57]},{11:59,32:58,37:24,38:f,39:T,40:27,41:P,42:_,43:y,44:E,45:v,46:L,47:I,48:m,49:R,50:l},e(S,[2,11]),e(S,[2,30],{33:60,27:X}),e(S,[2,32]),{31:[1,61]},e(S,[2,12]),{17:62,24:Y},{25:63,27:w},e(S,[2,14]),{17:65,24:Y},e(S,[2,16]),e(S,[2,17]),e(b,[2,41]),e(S,[2,23]),{27:[1,66]},{26:[1,67]},{26:[2,29],28:[1,68]},e(S,[2,31]),{27:[1,69]},e(S,[2,13]),{26:[1,70]},{26:[2,21],28:[1,71]},e(S,[2,15]),e(S,[2,26]),e(S,[2,27]),{11:59,32:72,37:24,38:f,39:T,40:27,41:P,42:_,43:y,44:E,45:v,46:L,47:I,48:m,49:R,50:l},e(S,[2,33]),e(S,[2,19]),{25:73,27:w},{26:[2,28]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],72:[2,28],73:[2,20]},parseError:a(function(h,c){if(c.recoverable)this.trace(h);else{var g=new Error(h);throw g.hash=c,g}},"parseError"),parse:a(function(h){var c=this,g=[0],x=[],C=[null],r=[],rt=this.table,d="",ct=0,It=0,hi=2,Mt=1,li=r.slice.call(arguments,1),D=Object.create(this.lexer),$={yy:{}};for(var ft in this.yy)Object.prototype.hasOwnProperty.call(this.yy,ft)&&($.yy[ft]=this.yy[ft]);D.setInput(h,$.yy),$.yy.lexer=D,$.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var pt=D.yylloc;r.push(pt);var ci=D.options&&D.options.ranges;typeof $.yy.parseError=="function"?this.parseError=$.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ui(B){g.length=g.length-2*B,C.length=C.length-B,r.length=r.length-B}a(ui,"popStack");function Vt(){var B;return B=x.pop()||D.lex()||Mt,typeof B!="number"&&(B instanceof Array&&(x=B,B=x.pop()),B=c.symbols_[B]||B),B}a(Vt,"lex");for(var M,q,z,mt,G={},ut,N,Bt,gt;;){if(q=g[g.length-1],this.defaultActions[q]?z=this.defaultActions[q]:((M===null||typeof M>"u")&&(M=Vt()),z=rt[q]&&rt[q][M]),typeof z>"u"||!z.length||!z[0]){var yt="";gt=[];for(ut in rt[q])this.terminals_[ut]&&ut>hi&&gt.push("'"+this.terminals_[ut]+"'");D.showPosition?yt="Parse error on line "+(ct+1)+`:
1
+ import{s as gi,g as xi,q as Xt,p as di,a as fi,b as pi,_ as a,l as Yt,I as mi,e as yi,z as bi,D as _t,i as Ai,F as Nt,G as wi,K as Ci,am as Si,R as Wt}from"./index-9oo7US_J.js";import{i as _i}from"./init-Gi6I4Gst.js";import{o as ki}from"./ordinal-Cboi1Yqb.js";import{l as zt}from"./linear-CFeIj_93.js";import"./index-B0gHfTIK.js";import"./defaultLocale-DX6XiGOO.js";function Ri(e,t,i){e=+e,t=+t,i=(n=arguments.length)<2?(t=e,e=0,1):n<3?1:+i;for(var s=-1,n=Math.max(0,Math.ceil((t-e)/i))|0,o=new Array(n);++s<n;)o[s]=e+s*i;return o}function bt(){var e=ki().unknown(void 0),t=e.domain,i=e.range,s=0,n=1,o,u,p=!1,f=0,T=0,P=.5;delete e.unknown;function _(){var y=t().length,E=n<s,v=E?n:s,L=E?s:n;o=(L-v)/Math.max(1,y-f+T*2),p&&(o=Math.floor(o)),v+=(L-v-o*(y-f))*P,u=o*(1-f),p&&(v=Math.round(v),u=Math.round(u));var I=Ri(y).map(function(m){return v+o*m});return i(E?I.reverse():I)}return e.domain=function(y){return arguments.length?(t(y),_()):t()},e.range=function(y){return arguments.length?([s,n]=y,s=+s,n=+n,_()):[s,n]},e.rangeRound=function(y){return[s,n]=y,s=+s,n=+n,p=!0,_()},e.bandwidth=function(){return u},e.step=function(){return o},e.round=function(y){return arguments.length?(p=!!y,_()):p},e.padding=function(y){return arguments.length?(f=Math.min(1,T=+y),_()):f},e.paddingInner=function(y){return arguments.length?(f=Math.min(1,y),_()):f},e.paddingOuter=function(y){return arguments.length?(T=+y,_()):T},e.align=function(y){return arguments.length?(P=Math.max(0,Math.min(1,y)),_()):P},e.copy=function(){return bt(t(),[s,n]).round(p).paddingInner(f).paddingOuter(T).align(P)},_i.apply(_(),arguments)}var At=(function(){var e=a(function(F,h,c,g){for(c=c||{},g=F.length;g--;c[F[g]]=h);return c},"o"),t=[1,10,12,14,16,18,19,21,23],i=[2,6],s=[1,3],n=[1,5],o=[1,6],u=[1,7],p=[1,5,10,12,14,16,18,19,21,23,34,35,36],f=[1,25],T=[1,26],P=[1,28],_=[1,29],y=[1,30],E=[1,31],v=[1,32],L=[1,33],I=[1,34],m=[1,35],R=[1,36],l=[1,37],W=[1,43],O=[1,42],X=[1,47],Y=[1,50],S=[1,10,12,14,16,18,19,21,23,34,35,36],U=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36],b=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36,41,42,43,44,45,46,47,48,49,50],w=[1,64],V={trace:a(function(){},"trace"),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,commaSeparatedNumbers:25,SQUARE_BRACES_END:26,NUMBER_WITH_DECIMAL:27,COMMA:28,xAxisData:29,bandData:30,ARROW_DELIMITER:31,commaSeparatedTexts:32,yAxisData:33,NEWLINE:34,SEMI:35,EOF:36,alphaNum:37,STR:38,MD_STR:39,alphaNumToken:40,AMP:41,NUM:42,ALPHA:43,PLUS:44,EQUALS:45,MULT:46,DOT:47,BRKT:48,MINUS:49,UNDERSCORE:50,$accept:0,$end:1},terminals_:{2:"error",5:"XYCHART",8:"CHART_ORIENTATION",10:"title",12:"X_AXIS",14:"Y_AXIS",16:"LINE",18:"BAR",19:"acc_title",20:"acc_title_value",21:"acc_descr",22:"acc_descr_value",23:"acc_descr_multiline_value",24:"SQUARE_BRACES_START",26:"SQUARE_BRACES_END",27:"NUMBER_WITH_DECIMAL",28:"COMMA",31:"ARROW_DELIMITER",34:"NEWLINE",35:"SEMI",36:"EOF",38:"STR",39:"MD_STR",41:"AMP",42:"NUM",43:"ALPHA",44:"PLUS",45:"EQUALS",46:"MULT",47:"DOT",48:"BRKT",49:"MINUS",50:"UNDERSCORE"},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[13,1],[13,2],[13,1],[29,1],[29,3],[30,3],[32,3],[32,1],[15,1],[15,2],[15,1],[33,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[37,1],[37,2],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1]],performAction:a(function(h,c,g,x,C,r,rt){var d=r.length-1;switch(C){case 5:x.setOrientation(r[d]);break;case 9:x.setDiagramTitle(r[d].text.trim());break;case 12:x.setLineData({text:"",type:"text"},r[d]);break;case 13:x.setLineData(r[d-1],r[d]);break;case 14:x.setBarData({text:"",type:"text"},r[d]);break;case 15:x.setBarData(r[d-1],r[d]);break;case 16:this.$=r[d].trim(),x.setAccTitle(this.$);break;case 17:case 18:this.$=r[d].trim(),x.setAccDescription(this.$);break;case 19:this.$=r[d-1];break;case 20:this.$=[Number(r[d-2]),...r[d]];break;case 21:this.$=[Number(r[d])];break;case 22:x.setXAxisTitle(r[d]);break;case 23:x.setXAxisTitle(r[d-1]);break;case 24:x.setXAxisTitle({type:"text",text:""});break;case 25:x.setXAxisBand(r[d]);break;case 26:x.setXAxisRangeData(Number(r[d-2]),Number(r[d]));break;case 27:this.$=r[d-1];break;case 28:this.$=[r[d-2],...r[d]];break;case 29:this.$=[r[d]];break;case 30:x.setYAxisTitle(r[d]);break;case 31:x.setYAxisTitle(r[d-1]);break;case 32:x.setYAxisTitle({type:"text",text:""});break;case 33:x.setYAxisRangeData(Number(r[d-2]),Number(r[d]));break;case 37:this.$={text:r[d],type:"text"};break;case 38:this.$={text:r[d],type:"text"};break;case 39:this.$={text:r[d],type:"markdown"};break;case 40:this.$=r[d];break;case 41:this.$=r[d-1]+""+r[d];break}},"anonymous"),table:[e(t,i,{3:1,4:2,7:4,5:s,34:n,35:o,36:u}),{1:[3]},e(t,i,{4:2,7:4,3:8,5:s,34:n,35:o,36:u}),e(t,i,{4:2,7:4,6:9,3:10,5:s,8:[1,11],34:n,35:o,36:u}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},e(p,[2,34]),e(p,[2,35]),e(p,[2,36]),{1:[2,1]},e(t,i,{4:2,7:4,3:21,5:s,34:n,35:o,36:u}),{1:[2,3]},e(p,[2,5]),e(t,[2,7],{4:22,34:n,35:o,36:u}),{11:23,37:24,38:f,39:T,40:27,41:P,42:_,43:y,44:E,45:v,46:L,47:I,48:m,49:R,50:l},{11:39,13:38,24:W,27:O,29:40,30:41,37:24,38:f,39:T,40:27,41:P,42:_,43:y,44:E,45:v,46:L,47:I,48:m,49:R,50:l},{11:45,15:44,27:X,33:46,37:24,38:f,39:T,40:27,41:P,42:_,43:y,44:E,45:v,46:L,47:I,48:m,49:R,50:l},{11:49,17:48,24:Y,37:24,38:f,39:T,40:27,41:P,42:_,43:y,44:E,45:v,46:L,47:I,48:m,49:R,50:l},{11:52,17:51,24:Y,37:24,38:f,39:T,40:27,41:P,42:_,43:y,44:E,45:v,46:L,47:I,48:m,49:R,50:l},{20:[1,53]},{22:[1,54]},e(S,[2,18]),{1:[2,2]},e(S,[2,8]),e(S,[2,9]),e(U,[2,37],{40:55,41:P,42:_,43:y,44:E,45:v,46:L,47:I,48:m,49:R,50:l}),e(U,[2,38]),e(U,[2,39]),e(b,[2,40]),e(b,[2,42]),e(b,[2,43]),e(b,[2,44]),e(b,[2,45]),e(b,[2,46]),e(b,[2,47]),e(b,[2,48]),e(b,[2,49]),e(b,[2,50]),e(b,[2,51]),e(S,[2,10]),e(S,[2,22],{30:41,29:56,24:W,27:O}),e(S,[2,24]),e(S,[2,25]),{31:[1,57]},{11:59,32:58,37:24,38:f,39:T,40:27,41:P,42:_,43:y,44:E,45:v,46:L,47:I,48:m,49:R,50:l},e(S,[2,11]),e(S,[2,30],{33:60,27:X}),e(S,[2,32]),{31:[1,61]},e(S,[2,12]),{17:62,24:Y},{25:63,27:w},e(S,[2,14]),{17:65,24:Y},e(S,[2,16]),e(S,[2,17]),e(b,[2,41]),e(S,[2,23]),{27:[1,66]},{26:[1,67]},{26:[2,29],28:[1,68]},e(S,[2,31]),{27:[1,69]},e(S,[2,13]),{26:[1,70]},{26:[2,21],28:[1,71]},e(S,[2,15]),e(S,[2,26]),e(S,[2,27]),{11:59,32:72,37:24,38:f,39:T,40:27,41:P,42:_,43:y,44:E,45:v,46:L,47:I,48:m,49:R,50:l},e(S,[2,33]),e(S,[2,19]),{25:73,27:w},{26:[2,28]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],72:[2,28],73:[2,20]},parseError:a(function(h,c){if(c.recoverable)this.trace(h);else{var g=new Error(h);throw g.hash=c,g}},"parseError"),parse:a(function(h){var c=this,g=[0],x=[],C=[null],r=[],rt=this.table,d="",ct=0,It=0,hi=2,Mt=1,li=r.slice.call(arguments,1),D=Object.create(this.lexer),$={yy:{}};for(var ft in this.yy)Object.prototype.hasOwnProperty.call(this.yy,ft)&&($.yy[ft]=this.yy[ft]);D.setInput(h,$.yy),$.yy.lexer=D,$.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var pt=D.yylloc;r.push(pt);var ci=D.options&&D.options.ranges;typeof $.yy.parseError=="function"?this.parseError=$.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ui(B){g.length=g.length-2*B,C.length=C.length-B,r.length=r.length-B}a(ui,"popStack");function Vt(){var B;return B=x.pop()||D.lex()||Mt,typeof B!="number"&&(B instanceof Array&&(x=B,B=x.pop()),B=c.symbols_[B]||B),B}a(Vt,"lex");for(var M,q,z,mt,G={},ut,N,Bt,gt;;){if(q=g[g.length-1],this.defaultActions[q]?z=this.defaultActions[q]:((M===null||typeof M>"u")&&(M=Vt()),z=rt[q]&&rt[q][M]),typeof z>"u"||!z.length||!z[0]){var yt="";gt=[];for(ut in rt[q])this.terminals_[ut]&&ut>hi&&gt.push("'"+this.terminals_[ut]+"'");D.showPosition?yt="Parse error on line "+(ct+1)+`:
2
2
  `+D.showPosition()+`
3
3
  Expecting `+gt.join(", ")+", got '"+(this.terminals_[M]||M)+"'":yt="Parse error on line "+(ct+1)+": Unexpected "+(M==Mt?"end of input":"'"+(this.terminals_[M]||M)+"'"),this.parseError(yt,{text:D.match,token:this.terminals_[M]||M,line:D.yylineno,loc:pt,expected:gt})}if(z[0]instanceof Array&&z.length>1)throw new Error("Parse Error: multiple actions possible at state: "+q+", token: "+M);switch(z[0]){case 1:g.push(M),C.push(D.yytext),r.push(D.yylloc),g.push(z[1]),M=null,It=D.yyleng,d=D.yytext,ct=D.yylineno,pt=D.yylloc;break;case 2:if(N=this.productions_[z[1]][1],G.$=C[C.length-N],G._$={first_line:r[r.length-(N||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(N||1)].first_column,last_column:r[r.length-1].last_column},ci&&(G._$.range=[r[r.length-(N||1)].range[0],r[r.length-1].range[1]]),mt=this.performAction.apply(G,[d,It,ct,$.yy,z[1],C,r].concat(li)),typeof mt<"u")return mt;N&&(g=g.slice(0,-1*N*2),C=C.slice(0,-1*N),r=r.slice(0,-1*N)),g.push(this.productions_[z[1]][0]),C.push(G.$),r.push(G._$),Bt=rt[g[g.length-2]][g[g.length-1]],g.push(Bt);break;case 3:return!0}}return!0},"parse")},k=(function(){var F={EOF:1,parseError:a(function(c,g){if(this.yy.parser)this.yy.parser.parseError(c,g);else throw new Error(c)},"parseError"),setInput:a(function(h,c){return this.yy=c||this.yy||{},this._input=h,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:a(function(){var h=this._input[0];this.yytext+=h,this.yyleng++,this.offset++,this.match+=h,this.matched+=h;var c=h.match(/(?:\r\n?|\n).*/g);return c?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),h},"input"),unput:a(function(h){var c=h.length,g=h.split(/(?:\r\n?|\n)/g);this._input=h+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-c),this.offset-=c;var x=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),g.length-1&&(this.yylineno-=g.length-1);var C=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:g?(g.length===x.length?this.yylloc.first_column:0)+x[x.length-g.length].length-g[0].length:this.yylloc.first_column-c},this.options.ranges&&(this.yylloc.range=[C[0],C[0]+this.yyleng-c]),this.yyleng=this.yytext.length,this},"unput"),more:a(function(){return this._more=!0,this},"more"),reject:a(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:a(function(h){this.unput(this.match.slice(h))},"less"),pastInput:a(function(){var h=this.matched.substr(0,this.matched.length-this.match.length);return(h.length>20?"...":"")+h.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:a(function(){var h=this.match;return h.length<20&&(h+=this._input.substr(0,20-h.length)),(h.substr(0,20)+(h.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:a(function(){var h=this.pastInput(),c=new Array(h.length+1).join("-");return h+this.upcomingInput()+`
@@ -1 +1 @@
1
- import{l as e}from"./monaco-CbFQByO7.js";import"./ProjectKanbanPage-DK3rZJzY.js";import"./index-BGajgi5H.js";import"./mermaid-NOHMQCX5-CzwPLFrI.js";import"./chevron-right-CBoUSXVq.js";import"./chevron-down-CpKODb7Y.js";import"./confirm-dialog-DDWlvtJs.js";import"./modal-QnCJhV9P.js";import"./Icons-BFOphLw-.js";import"./CreateTaskInput-B11wGhDW.js";import"./AgentLogo-Dyqxcj5s.js";import"./check-FwR4dMNY.js";import"./use-projects-iob5C7Xk.js";import"./MemberAvatar-1UlgMZMM.js";import"./use-providers-Cj9S9_2q.js";import"./trash-2-DPxBnxJM.js";import"./useNormalizedLogs-BhN4AN4f.js";import"./folder-picker-CBVEWiuS.js";import"./circle-alert-kELlE07n.js";import"./message-square-DgdFa1Kc.js";import"./layers-WOwm63Fo.js";import"./chevron-up-KZ1hsL8y.js";import"./select-CmbeAAVh.js";import"./textarea-D4HkYa3u.js";import"./server-BUivqMYo.js";import"./upload-YmLtnZsU.js";import"./arrow-left-Jn-v17JF.js";import"./pencil-CNVU3zfM.js";const v={comments:{lineComment:"#"},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],folding:{offSide:!0},onEnterRules:[{beforeText:/:\s*$/,action:{indentAction:e.IndentAction.Indent}}]},A={tokenPostfix:".yaml",brackets:[{token:"delimiter.bracket",open:"{",close:"}"},{token:"delimiter.square",open:"[",close:"]"}],keywords:["true","True","TRUE","false","False","FALSE","null","Null","Null","~"],numberInteger:/(?:0|[+-]?[0-9]+)/,numberFloat:/(?:0|[+-]?[0-9]+)(?:\.[0-9]+)?(?:e[-+][1-9][0-9]*)?/,numberOctal:/0o[0-7]+/,numberHex:/0x[0-9a-fA-F]+/,numberInfinity:/[+-]?\.(?:inf|Inf|INF)/,numberNaN:/\.(?:nan|Nan|NAN)/,numberDate:/\d{4}-\d\d-\d\d([Tt ]\d\d:\d\d:\d\d(\.\d+)?(( ?[+-]\d\d?(:\d\d)?)|Z)?)?/,escapes:/\\(?:[btnfr\\"']|[0-7][0-7]?|[0-3][0-7]{2})/,tokenizer:{root:[{include:"@whitespace"},{include:"@comment"},[/%[^ ]+.*$/,"meta.directive"],[/---/,"operators.directivesEnd"],[/\.{3}/,"operators.documentEnd"],[/[-?:](?= )/,"operators"],{include:"@anchor"},{include:"@tagHandle"},{include:"@flowCollections"},{include:"@blockStyle"},[/@numberInteger(?![ \t]*\S+)/,"number"],[/@numberFloat(?![ \t]*\S+)/,"number.float"],[/@numberOctal(?![ \t]*\S+)/,"number.octal"],[/@numberHex(?![ \t]*\S+)/,"number.hex"],[/@numberInfinity(?![ \t]*\S+)/,"number.infinity"],[/@numberNaN(?![ \t]*\S+)/,"number.nan"],[/@numberDate(?![ \t]*\S+)/,"number.date"],[/(".*?"|'.*?'|[^#'"]*?)([ \t]*)(:)( |$)/,["type","white","operators","white"]],{include:"@flowScalars"},[/.+?(?=(\s+#|$))/,{cases:{"@keywords":"keyword","@default":"string"}}]],object:[{include:"@whitespace"},{include:"@comment"},[/\}/,"@brackets","@pop"],[/,/,"delimiter.comma"],[/:(?= )/,"operators"],[/(?:".*?"|'.*?'|[^,\{\[]+?)(?=: )/,"type"],{include:"@flowCollections"},{include:"@flowScalars"},{include:"@tagHandle"},{include:"@anchor"},{include:"@flowNumber"},[/[^\},]+/,{cases:{"@keywords":"keyword","@default":"string"}}]],array:[{include:"@whitespace"},{include:"@comment"},[/\]/,"@brackets","@pop"],[/,/,"delimiter.comma"],{include:"@flowCollections"},{include:"@flowScalars"},{include:"@tagHandle"},{include:"@anchor"},{include:"@flowNumber"},[/[^\],]+/,{cases:{"@keywords":"keyword","@default":"string"}}]],multiString:[[/^( +).+$/,"string","@multiStringContinued.$1"]],multiStringContinued:[[/^( *).+$/,{cases:{"$1==$S2":"string","@default":{token:"@rematch",next:"@popall"}}}]],whitespace:[[/[ \t\r\n]+/,"white"]],comment:[[/#.*$/,"comment"]],flowCollections:[[/\[/,"@brackets","@array"],[/\{/,"@brackets","@object"]],flowScalars:[[/"([^"\\]|\\.)*$/,"string.invalid"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/'[^']*'/,"string"],[/"/,"string","@doubleQuotedString"]],doubleQuotedString:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@pop"]],blockStyle:[[/[>|][0-9]*[+-]?$/,"operators","@multiString"]],flowNumber:[[/@numberInteger(?=[ \t]*[,\]\}])/,"number"],[/@numberFloat(?=[ \t]*[,\]\}])/,"number.float"],[/@numberOctal(?=[ \t]*[,\]\}])/,"number.octal"],[/@numberHex(?=[ \t]*[,\]\}])/,"number.hex"],[/@numberInfinity(?=[ \t]*[,\]\}])/,"number.infinity"],[/@numberNaN(?=[ \t]*[,\]\}])/,"number.nan"],[/@numberDate(?=[ \t]*[,\]\}])/,"number.date"]],tagHandle:[[/\![^ ]*/,"tag"]],anchor:[[/[&*][^ ]+/,"namespace"]]}};export{v as conf,A as language};
1
+ import{l as e}from"./monaco-DBlH7Gvr.js";import"./ProjectKanbanPage-D62MacD4.js";import"./index-B0gHfTIK.js";import"./mermaid-NOHMQCX5-De7jApSL.js";import"./chevron-right-BEw6jjbJ.js";import"./chevron-down-BTGC8Sed.js";import"./confirm-dialog-C8rPqdFE.js";import"./modal-CyT9BpRm.js";import"./Icons-DGahMuvC.js";import"./CreateTaskInput-DSl73Wwc.js";import"./AgentLogo-BQ4AhPCM.js";import"./check-CYQXIceH.js";import"./use-projects-Cs0-FMed.js";import"./MemberAvatar-5bEbGww5.js";import"./use-providers-BoVFTPYO.js";import"./trash-2-DHu1aC-u.js";import"./useNormalizedLogs-DhoOmBJo.js";import"./folder-picker-iHGLWmJF.js";import"./circle-alert-BGbIBYEs.js";import"./message-square-Dly_bein.js";import"./layers-B4Hb2k1E.js";import"./chevron-up-D_Hmx6ug.js";import"./select-BQuOHpgx.js";import"./textarea-D4CrProF.js";import"./server-DmNZ4TcQ.js";import"./upload-DQPwfdPh.js";import"./arrow-left-2dTz1a0q.js";import"./pencil-BLlfV3fH.js";const v={comments:{lineComment:"#"},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],folding:{offSide:!0},onEnterRules:[{beforeText:/:\s*$/,action:{indentAction:e.IndentAction.Indent}}]},A={tokenPostfix:".yaml",brackets:[{token:"delimiter.bracket",open:"{",close:"}"},{token:"delimiter.square",open:"[",close:"]"}],keywords:["true","True","TRUE","false","False","FALSE","null","Null","Null","~"],numberInteger:/(?:0|[+-]?[0-9]+)/,numberFloat:/(?:0|[+-]?[0-9]+)(?:\.[0-9]+)?(?:e[-+][1-9][0-9]*)?/,numberOctal:/0o[0-7]+/,numberHex:/0x[0-9a-fA-F]+/,numberInfinity:/[+-]?\.(?:inf|Inf|INF)/,numberNaN:/\.(?:nan|Nan|NAN)/,numberDate:/\d{4}-\d\d-\d\d([Tt ]\d\d:\d\d:\d\d(\.\d+)?(( ?[+-]\d\d?(:\d\d)?)|Z)?)?/,escapes:/\\(?:[btnfr\\"']|[0-7][0-7]?|[0-3][0-7]{2})/,tokenizer:{root:[{include:"@whitespace"},{include:"@comment"},[/%[^ ]+.*$/,"meta.directive"],[/---/,"operators.directivesEnd"],[/\.{3}/,"operators.documentEnd"],[/[-?:](?= )/,"operators"],{include:"@anchor"},{include:"@tagHandle"},{include:"@flowCollections"},{include:"@blockStyle"},[/@numberInteger(?![ \t]*\S+)/,"number"],[/@numberFloat(?![ \t]*\S+)/,"number.float"],[/@numberOctal(?![ \t]*\S+)/,"number.octal"],[/@numberHex(?![ \t]*\S+)/,"number.hex"],[/@numberInfinity(?![ \t]*\S+)/,"number.infinity"],[/@numberNaN(?![ \t]*\S+)/,"number.nan"],[/@numberDate(?![ \t]*\S+)/,"number.date"],[/(".*?"|'.*?'|[^#'"]*?)([ \t]*)(:)( |$)/,["type","white","operators","white"]],{include:"@flowScalars"},[/.+?(?=(\s+#|$))/,{cases:{"@keywords":"keyword","@default":"string"}}]],object:[{include:"@whitespace"},{include:"@comment"},[/\}/,"@brackets","@pop"],[/,/,"delimiter.comma"],[/:(?= )/,"operators"],[/(?:".*?"|'.*?'|[^,\{\[]+?)(?=: )/,"type"],{include:"@flowCollections"},{include:"@flowScalars"},{include:"@tagHandle"},{include:"@anchor"},{include:"@flowNumber"},[/[^\},]+/,{cases:{"@keywords":"keyword","@default":"string"}}]],array:[{include:"@whitespace"},{include:"@comment"},[/\]/,"@brackets","@pop"],[/,/,"delimiter.comma"],{include:"@flowCollections"},{include:"@flowScalars"},{include:"@tagHandle"},{include:"@anchor"},{include:"@flowNumber"},[/[^\],]+/,{cases:{"@keywords":"keyword","@default":"string"}}]],multiString:[[/^( +).+$/,"string","@multiStringContinued.$1"]],multiStringContinued:[[/^( *).+$/,{cases:{"$1==$S2":"string","@default":{token:"@rematch",next:"@popall"}}}]],whitespace:[[/[ \t\r\n]+/,"white"]],comment:[[/#.*$/,"comment"]],flowCollections:[[/\[/,"@brackets","@array"],[/\{/,"@brackets","@object"]],flowScalars:[[/"([^"\\]|\\.)*$/,"string.invalid"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/'[^']*'/,"string"],[/"/,"string","@doubleQuotedString"]],doubleQuotedString:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@pop"]],blockStyle:[[/[>|][0-9]*[+-]?$/,"operators","@multiString"]],flowNumber:[[/@numberInteger(?=[ \t]*[,\]\}])/,"number"],[/@numberFloat(?=[ \t]*[,\]\}])/,"number.float"],[/@numberOctal(?=[ \t]*[,\]\}])/,"number.octal"],[/@numberHex(?=[ \t]*[,\]\}])/,"number.hex"],[/@numberInfinity(?=[ \t]*[,\]\}])/,"number.infinity"],[/@numberNaN(?=[ \t]*[,\]\}])/,"number.nan"],[/@numberDate(?=[ \t]*[,\]\}])/,"number.date"]],tagHandle:[[/\![^ ]*/,"tag"]],anchor:[[/[&*][^ ]+/,"namespace"]]}};export{v as conf,A as language};
@@ -5,7 +5,7 @@
5
5
  <link rel="icon" type="image/x-icon" href="/favicon.ico?v=20260720" sizes="any" />
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover" />
7
7
  <title>Agent Tower</title>
8
- <script type="module" crossorigin src="/assets/index-BGajgi5H.js"></script>
8
+ <script type="module" crossorigin src="/assets/index-B0gHfTIK.js"></script>
9
9
  <link rel="stylesheet" crossorigin href="/assets/index-CVgeXPf_.css">
10
10
  </head>
11
11
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-tower",
3
- "version": "0.6.0-beta.13",
3
+ "version": "0.6.0-beta.15",
4
4
  "description": "AI Agent Task Management Dashboard",
5
5
  "repository": {
6
6
  "type": "git",
@@ -33,7 +33,7 @@
33
33
  "dependencies": {
34
34
  "@agent-tower/shared": "0.1.0",
35
35
  "@agentclientprotocol/claude-agent-acp": "0.59.0",
36
- "@agentclientprotocol/codex-acp": "1.1.2",
36
+ "@agentclientprotocol/codex-acp": "1.7.0",
37
37
  "@agentclientprotocol/sdk": "1.2.1",
38
38
  "@earendil-works/pi-coding-agent": "0.82.1",
39
39
  "@fastify/cookie": "^9.4.0",
@@ -1,3 +0,0 @@
1
- import{k as qe,u as ce,r,j as e,$ as Oe,l as v,m as Ce,o as W,n as de,q as h,p as $,a6 as ze,Y as Fe,a7 as Ke,U as Ue,V as ye,_ as Qe,a8 as Be,a9 as ie}from"./index-BGajgi5H.js";import{u as _e,b as $e,A as Ve,S as D}from"./mermaid-NOHMQCX5-CzwPLFrI.js";import{u as Ge,a as He,T as We,P as Je}from"./useNormalizedLogs-BhN4AN4f.js";import{u as Ye,a as Xe,b as Ze,A as et,R as tt,P as st,T as nt,c as rt,B as at,S as ot,d as ke,C as it}from"./CreateTaskInput-B11wGhDW.js";import{u as lt}from"./use-providers-Cj9S9_2q.js";import{M as he}from"./message-square-DgdFa1Kc.js";import{A as ct}from"./arrow-left-Jn-v17JF.js";import{T as dt}from"./trash-2-DPxBnxJM.js";import"./chevron-right-CBoUSXVq.js";import"./chevron-down-CpKODb7Y.js";import"./check-FwR4dMNY.js";import"./AgentLogo-Dyqxcj5s.js";import"./use-projects-iob5C7Xk.js";import"./MemberAvatar-1UlgMZMM.js";const ut=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}],["path",{d:"M14 4h7",key:"3xa0d5"}],["path",{d:"M14 9h7",key:"1icrd9"}],["path",{d:"M14 15h7",key:"1mj8o2"}],["path",{d:"M14 20h7",key:"11slyb"}]],mt=qe("layout-list",ut);function ft({sessionId:t,sessionStatus:n,sessionStartedAt:a,sessionEndedAt:g,agentType:S,runtimeType:j,providerId:u,providers:y,initialTokenUsage:p,onProviderChange:N,onSend:w,onStop:E,onExit:O,isSending:A=!1,isStopping:l=!1,canStop:m,className:ue}){const{t:f}=ce(),[I,z]=r.useState(""),[F,K]=r.useState(u??""),[C,V]=r.useState(!1),[J,Y]=r.useState(null),P=r.useRef(null),X=r.useRef(null),me=r.useRef(null),M=r.useRef(!1),{scrollRef:G,contentRef:Z,isAtBottom:o,scrollToBottom:T,stopScroll:fe}=Ye({initial:"instant",resize:"smooth"}),{isConnected:U,isLoadingSnapshot:ee,isOutputActive:Q,lastExitAt:xe,logs:k,entries:te,attach:B}=Ge({sessionId:t,sessionStatus:n,sessionStartedAt:a,sessionEndedAt:g,onExit:O}),{todos:H}=He(te),pe=Xe(k,p),{files:se,addFiles:L,removeFile:ne,clear:re,buildMarkdownLinks:ae,getDoneAttachments:oe,hasFiles:R,isUploading:s}=_e(),{isActive:i,isCancelling:c}=Ze(t,n),x=m??i;r.useEffect(()=>{K(u??"")},[u]),r.useEffect(()=>{t&&U&&B()},[t,U,B]);const Ie=r.useCallback(d=>{K(d),N?.(d)},[N]),ge=r.useCallback(()=>{P.current&&(P.current.style.height="60px")},[]),De=r.useCallback(d=>{z(d.target.value);const b=d.target;b.style.height="auto",b.style.height=`${Math.max(60,Math.min(b.scrollHeight,300))}px`},[]),be=r.useCallback(async()=>{if(!I.trim()&&!R||M.current||A||s)return;M.current=!0;const d=ae(),b=oe().map(q=>q.id),_=[I.trim(),d].filter(Boolean).join(`
2
-
3
- `);z(""),re(),ge(),Y(null);try{await w({message:_,providerId:F||void 0,attachmentIds:b}),await B(),requestAnimationFrame(()=>T("smooth"))}catch(q){Y(q instanceof Error?q.message:f("Send failed. Please try again.")),z(_)}finally{M.current=!1}},[I,R,A,s,ae,oe,re,ge,w,F,B,T,f]),Ee=r.useCallback(async()=>{!x||l||c||await E()},[x,l,c,E]),Te=r.useCallback(d=>{const b=d.target.files;b&&b.length>0&&L(Array.from(b)),d.target.value=""},[L]),Le=r.useCallback(d=>{const b=d.clipboardData.items,_=[];for(const q of b)if(q.kind==="file"){const ve=q.getAsFile();ve&&_.push(ve)}_.length>0&&(d.preventDefault(),L(_))},[L]),Pe=r.useCallback(d=>{d.preventDefault(),V(!0)},[]),Me=r.useCallback(d=>{d.preventDefault(),V(!1)},[]),Re=r.useCallback(d=>{d.preventDefault(),V(!1);const b=d.dataTransfer.files;b.length>0&&L(Array.from(b))},[L]);return e.jsxs("div",{className:v("relative flex min-h-0 flex-1 flex-col bg-background",ue),children:[e.jsxs("div",{className:"relative min-h-0 flex-1",children:[e.jsx("div",{ref:G,className:"h-full overflow-y-auto scrollbar-app-thin px-6 pb-4 pt-6",children:e.jsx("div",{ref:Z,className:"mx-auto w-full min-w-0 max-w-4xl",children:ee?e.jsxs("div",{className:"flex items-center justify-center gap-3 py-12 text-muted-foreground/70",children:[e.jsxs("svg",{className:"h-5 w-5 animate-spin",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),e.jsx("span",{className:"text-sm",children:f("Loading logs...")})]}):k.length===0?e.jsx("div",{className:"py-8 text-center text-muted-foreground/70",children:f(i?"Waiting for agent output...":"No logs recorded for this session.")}):e.jsx($e,{logs:k,downloadSessionId:t,isOutputActive:Q,lastExitAt:xe,onUserToggleDetails:fe})})}),!o&&e.jsxs("button",{type:"button",onClick:()=>T(),className:"absolute bottom-3 left-1/2 z-10 flex -translate-x-1/2 items-center gap-1.5 rounded-full border border-border bg-background/90 px-3 py-1.5 text-xs text-muted-foreground shadow-md backdrop-blur-sm transition-all hover:bg-background hover:text-foreground","aria-label":f("Scroll to bottom"),children:[e.jsx(et,{size:14}),e.jsx("span",{children:f("Back to bottom")})]})]}),H.length>0&&e.jsx("div",{className:"shrink-0 border-t border-border/60 bg-background px-6 pb-1 pt-2",children:e.jsx("div",{className:"mx-auto max-w-4xl",children:e.jsx(We,{todos:H})})}),e.jsx("div",{className:"z-10 w-full shrink-0 border-t border-transparent bg-background p-6 pb-6 pt-2",onDragOver:Pe,onDragLeave:Me,onDrop:Re,children:e.jsxs("div",{className:"mx-auto max-w-4xl",children:[e.jsx(tt,{sessionId:t}),J?e.jsx("div",{className:"mb-2 text-sm text-destructive",children:J}):null,e.jsxs("div",{ref:me,className:v("relative rounded-xl border bg-background transition-colors duration-200 hover:border-ring/40 focus-within:border-ring/60",C?"border-info bg-info/5":"border-border"),children:[e.jsx(Ve,{files:se,onRemove:ne}),e.jsx("textarea",{ref:P,value:I,onChange:De,onPaste:Le,onKeyDown:d=>{d.key==="Enter"&&!d.shiftKey&&!d.repeat&&!d.nativeEvent.isComposing&&d.nativeEvent.keyCode!==229&&(d.preventDefault(),be())},rows:1,placeholder:f(C?"Drop files here...":t&&!i?"Continue conversation...":"Message Agent..."),className:"w-full resize-none border-none bg-transparent px-4 pb-2 pt-4 text-sm leading-relaxed text-foreground placeholder-muted-foreground/70 focus:outline-none",style:{minHeight:"60px",maxHeight:"300px"}}),e.jsx("input",{ref:X,type:"file",multiple:!0,className:"hidden",onChange:Te}),e.jsxs("div",{className:"flex items-center justify-between px-2 pb-2 pt-1",children:[e.jsx("div",{className:"flex items-center gap-1",children:e.jsx("button",{type:"button",onClick:()=>X.current?.click(),disabled:s,className:"rounded-lg p-2 text-muted-foreground/70 transition-colors hover:bg-muted hover:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",title:f("Upload file"),children:e.jsx(Je,{size:18})})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(st,{providers:y,currentProviderId:F,agentType:S,runtimeType:j,onSelect:Ie}),e.jsx(nt,{usage:pe}),x&&i&&!I.trim()&&!R?e.jsx("button",{type:"button",onClick:Ee,disabled:l||c,className:"rounded-lg bg-destructive p-2 text-white transition-all duration-200 hover:bg-destructive/90 disabled:opacity-50",title:f("Stop"),children:e.jsx(Oe,{size:14})}):e.jsx("button",{type:"button",onClick:be,disabled:!I.trim()&&!R||s||A,className:v("rounded-lg p-2 transition-all duration-200",(I.trim()||R)&&!s&&!A?"bg-primary text-primary-foreground hover:bg-primary/90":"cursor-not-allowed bg-transparent text-muted-foreground/50"),title:f("Send"),children:e.jsx(rt,{size:18})})]})]})]})]})})]})}function xt(t=50){return Ce({queryKey:h.conversations.list({limit:t}),queryFn:()=>$.get("/conversations",{params:{limit:String(t)}})})}function pt(t){return Ce({queryKey:h.conversations.detail(t??""),queryFn:()=>$.get(`/conversations/${t}`),enabled:!!t})}function ht(){const t=W();return de({mutationFn:n=>$.post("/conversations",n),onSuccess:n=>{t.setQueryData(h.conversations.detail(n.id),n),t.invalidateQueries({queryKey:h.conversations.all}),t.invalidateQueries({queryKey:h.sessions.detail(n.sessionId)})}})}function gt(){const t=W();return de({mutationFn:({id:n,...a})=>$.post(`/conversations/${n}/message`,a),onSuccess:n=>{t.setQueryData(h.conversations.detail(n.id),n),t.invalidateQueries({queryKey:h.conversations.all}),t.invalidateQueries({queryKey:h.sessions.detail(n.sessionId)})}})}function bt(){const t=W();return de({mutationFn:n=>$.post(`/conversations/${n}/stop`),onSuccess:n=>{t.setQueryData(h.conversations.detail(n.id),n),t.invalidateQueries({queryKey:h.conversations.all}),t.invalidateQueries({queryKey:h.sessions.detail(n.sessionId)})}})}function vt(){const t=W();return de({mutationFn:n=>$.delete(`/conversations/${n}`),onSuccess:(n,a)=>{t.removeQueries({queryKey:h.conversations.detail(a)}),t.invalidateQueries({queryKey:h.conversations.all})}})}const yt=3e4,Se="agent-tower:conversation-read-times";function jt(){try{const t=window.localStorage.getItem(Se);if(!t)return{};const n=JSON.parse(t);return!n||typeof n!="object"||Array.isArray(n)?{}:Object.fromEntries(Object.entries(n).map(([a,g])=>[a,typeof g=="number"?g:Number(g)]).filter(a=>Number.isFinite(a[1])))}catch{return{}}}function je(t){try{window.localStorage.setItem(Se,JSON.stringify(t))}catch{}}function Ne(t){const n=t.lastActiveAt??t.updatedAt??t.createdAt;if(!n)return 0;const a=new Date(n).getTime();return Number.isFinite(a)?a:0}function Nt(t=yt){const[,n]=r.useState(0);r.useEffect(()=>{const a=setInterval(()=>n(g=>g+1),t);return()=>clearInterval(a)},[t])}function le(t){return t===D.RUNNING||t===D.PENDING}function Ae(t){if(!t)return"";const n=new Date(t);if(Number.isNaN(n.getTime()))return"";const a=Math.max(0,Math.floor((Date.now()-n.getTime())/1e3));return a<60?ie("{count}s ago",{count:a}):a<3600?ie("{count}m ago",{count:Math.floor(a/60)}):a<86400?ie("{count}h ago",{count:Math.floor(a/3600)}):ie("{count}d ago",{count:Math.floor(a/86400)})}function wt(t,n){switch(t){case D.RUNNING:return n("Running");case D.PENDING:return n("Starting");case D.COMPLETED:return n("Completed");case D.FAILED:return n("Failed");case D.CANCELLED:return n("Stopped");default:return t}}function we({className:t,pulseClassName:n}){return e.jsxs("span",{className:"relative inline-flex h-2 w-2",children:[e.jsx("span",{className:v("absolute inline-flex h-full w-full animate-ping rounded-full",n)}),e.jsx("span",{className:v("relative inline-flex h-2 w-2 rounded-full",t)})]})}function Ct({status:t,unread:n}){return le(t)?e.jsx(we,{className:"bg-success",pulseClassName:"bg-success/70"}):n?e.jsx(we,{className:"bg-warning",pulseClassName:"bg-warning/70"}):null}function kt({conversation:t,selected:n,onSelect:a,onDelete:g,disabled:S,unread:j}){const{t:u}=ce(),y=Ae(t.lastActiveAt??t.createdAt),p=le(t.status)||j;return e.jsxs("div",{className:v("group ml-4 mr-2 flex items-center rounded-md transition-colors",n?"bg-accent":"hover:bg-accent/50"),children:[e.jsxs("button",{type:"button",onClick:a,title:t.title,className:"flex min-w-0 flex-1 animate-task-enter items-center gap-2.5 rounded-md px-2 py-2 text-left text-sm",children:[e.jsx("span",{className:"flex h-3.5 w-3.5 shrink-0 items-center justify-center",children:e.jsx(he,{size:14,className:"text-muted-foreground"})}),e.jsx("span",{className:v("min-w-0 flex-1 truncate",n?"font-medium text-foreground":"text-foreground/90"),children:t.title}),p?e.jsx("span",{className:"flex h-3.5 w-3.5 shrink-0 items-center justify-center",children:e.jsx(Ct,{status:t.status,unread:j})}):e.jsx("span",{className:"flex w-14 shrink-0 items-center justify-end text-[11px] tabular-nums text-muted-foreground/50",children:e.jsx("span",{className:"truncate group-hover:hidden",children:y})})]}),e.jsx("button",{type:"button",onClick:N=>{N.stopPropagation(),g()},disabled:S,className:"mr-1 hidden shrink-0 rounded-md p-1.5 text-muted-foreground hover:bg-background hover:text-destructive disabled:opacity-50 group-hover:flex",title:u("Delete"),children:e.jsx(dt,{size:14})})]})}function St({isOpen:t,conversations:n,onClose:a,onSelectConversation:g}){const{t:S}=ce(),[j,u]=r.useState(""),[y,p]=r.useState(0),N=r.useRef(null);r.useEffect(()=>{t&&(u(""),p(0))},[t]);const w=r.useMemo(()=>{const l=j.trim().toLowerCase();return l?n.filter(m=>m.title.toLowerCase().includes(l)).slice(0,50):n.slice(0,12)},[n,j]);r.useEffect(()=>{p(0)},[j]),r.useEffect(()=>{N.current?.children[y]?.scrollIntoView({block:"nearest"})},[y]);const E=r.useCallback(l=>{g(l),a()},[a,g]),O=r.useCallback(l=>{if(l.key==="Escape"){l.preventDefault(),a();return}if(l.key==="ArrowDown"){l.preventDefault(),p(m=>Math.min(m+1,w.length-1));return}if(l.key==="ArrowUp"){l.preventDefault(),p(m=>Math.max(m-1,0));return}if(l.key==="Enter"&&!l.nativeEvent.isComposing){l.preventDefault();const m=w[y];m&&E(m)}},[y,E,a,w]);if(!t)return null;const A=j.trim().length>0;return e.jsxs("div",{className:"fixed inset-0 z-90",role:"dialog","aria-modal":"true",children:[e.jsx("div",{className:"absolute inset-0 bg-black/20",onClick:a}),e.jsxs("div",{className:"absolute left-1/2 top-[18vh] w-[min(560px,calc(100vw-2rem))] -translate-x-1/2 overflow-hidden rounded-xl border border-border bg-popover shadow-lg animate-in fade-in zoom-in-95 duration-100",children:[e.jsxs("div",{className:"flex items-center gap-2.5 border-b border-border/60 px-4",children:[e.jsx(ke,{size:15,className:"shrink-0 text-muted-foreground/70"}),e.jsx("input",{value:j,onChange:l=>u(l.target.value),onKeyDown:O,placeholder:S("Search conversations..."),"aria-label":S("Search conversations..."),autoFocus:!0,className:"flex-1 border-none bg-transparent py-3 text-sm text-foreground placeholder-muted-foreground/60 focus:outline-none"})]}),w.length>0?e.jsxs(e.Fragment,{children:[A?null:e.jsx("div",{className:"px-4 pb-1 pt-2.5 text-[11px] font-medium text-muted-foreground/70",children:S("Recent conversations")}),e.jsx("div",{ref:N,className:"max-h-[46vh] overflow-y-auto pb-1.5 pt-0.5 scrollbar-app-thin",children:w.map((l,m)=>e.jsxs("button",{type:"button",onClick:()=>E(l),onMouseEnter:()=>p(m),className:v("flex w-full items-center gap-2.5 px-4 py-2 text-left transition-colors",m===y&&"bg-accent"),children:[e.jsx(he,{size:14,className:"shrink-0 text-muted-foreground"}),e.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-foreground/90",title:l.title,children:l.title}),e.jsx("span",{className:"shrink-0 text-xs tabular-nums text-muted-foreground/60",children:Ae(l.lastActiveAt??l.createdAt)})]},l.id))})]}):e.jsx("div",{className:"px-4 py-8 text-center text-sm text-muted-foreground/70",children:S("No matching conversations")})]})]})}function Ut(){const{t}=ce();Nt();const n=ze(),{usesIntegratedTitlebar:a,desktopPlatform:g,hasMacTrafficLights:S}=Fe(),j=a&&g==="win32",{conversationId:u}=Ke(),y=W(),[p,N]=r.useState(""),[w,E]=r.useState("idle"),[O,A]=r.useState(null),[l,m]=r.useState(!1),[ue,f]=r.useState(!1),[I,z]=r.useState(jt),[F,K]=r.useState(()=>new Set),{data:C=[],isLoading:V}=xt(),{data:J,isLoading:Y}=pt(u),{data:P=[],isLoading:X}=lt(),me=ht(),M=gt(),G=bt(),Z=vt(),o=J??C.find(s=>s.id===u)??null,T=r.useMemo(()=>P.filter(({availability:s})=>s.type!=="NOT_FOUND"),[P]),fe=T.map(({provider:s})=>({id:s.id,name:s.name,agentType:s.agentType,available:!0})),U=!!u,ee=U||l,Q=r.useCallback(s=>{y.invalidateQueries({queryKey:h.conversations.all}),s&&y.invalidateQueries({queryKey:h.conversations.detail(s)})},[y]),xe=r.useCallback(()=>{Q(u)},[u,Q]),k=r.useCallback(s=>{if(K(c=>{if(!c.has(s.id))return c;const x=new Set(c);return x.delete(s.id),x}),s.status!==D.COMPLETED)return;const i=Math.max(Date.now(),Ne(s));z(c=>{if(c[s.id]&&c[s.id]>=i)return c;const x={...c,[s.id]:i};return je(x),x})},[]),te=r.useCallback(s=>{K(i=>{if(i.has(s))return i;const c=new Set(i);return c.add(s),c})},[]),B=r.useCallback(s=>{K(i=>{if(!i.has(s))return i;const c=new Set(i);return c.delete(s),c}),z(i=>{if(!(s in i))return i;const c={...i};return delete c[s],je(c),c})},[]),H=r.useMemo(()=>{const s=new Map;for(const i of C)s.set(i.sessionId,i);return o&&s.set(o.sessionId,o),s},[o,C]),pe=r.useCallback(s=>s.status!==D.COMPLETED?!1:F.has(s.id)?!0:Ne(s)>(I[s.id]??0),[I,F]);r.useEffect(()=>{!p&&T.length>0&&N(T[0].provider.id)},[T,p]),r.useEffect(()=>{o?.providerId&&N(o.providerId)},[o?.providerId]),r.useEffect(()=>{u&&m(!1)},[u]),r.useEffect(()=>{o&&k(o)},[o,k]),r.useEffect(()=>{const s=Ue.connect(),i=c=>{const x=H.get(c.sessionId);if(x){if(Q(x.id),c.status!==D.COMPLETED){k(x);return}if(x.id===u){k(x);return}te(x.id)}};return s.on(ye.SESSION_COMPLETED,i),()=>{s.off(ye.SESSION_COMPLETED,i)}},[u,H,Q,k,te]);const se=()=>{A(null),m(!0),n("/conversations")},L=()=>{m(!1),n("/conversations")},ne=r.useCallback(s=>{k(s),m(!1),n(`/conversations/${s.id}`)},[k,n]),re=async s=>{if(!(!s.providerId||!s.title.trim()||w!=="idle")){E("starting-session"),A(null);try{const i=await me.mutateAsync({prompt:s.title.trim(),providerId:s.providerId,attachmentIds:s.attachmentIds});N(s.providerId),m(!1),n(`/conversations/${i.id}`)}catch(i){A(i instanceof Error?i.message:t("Failed to start. Please try again."))}finally{E("idle")}}},ae=async s=>{!o||!s.message.trim()||M.isPending||await M.mutateAsync({id:o.id,message:s.message,providerId:s.providerId||p||void 0,attachmentIds:s.attachmentIds})},oe=async()=>{!o||!le(o.status)||G.isPending||await G.mutateAsync(o.id)},R=async s=>{window.confirm(t("Delete this conversation?"))&&(await Z.mutateAsync(s),B(s),u===s&&(m(!1),n("/conversations")))};return e.jsxs("div",{className:"flex h-dvh flex-col overflow-hidden bg-sidebar text-sm text-foreground",children:[e.jsxs("header",{className:v("flex h-12 shrink-0 items-center justify-between bg-sidebar px-4",a&&"app-region-drag",j&&"pr-[150px]"),children:[e.jsxs("div",{className:v("flex min-w-0 items-center gap-2",S&&"pl-[72px]"),children:[e.jsx(at,{}),e.jsx("span",{className:"mx-1.5 select-none text-muted-foreground/40",children:"/"}),e.jsx("span",{className:"truncate text-sm font-medium text-foreground/90",children:t("Conversation")})]}),e.jsx("button",{type:"button",onClick:()=>Be.getState().openSettings(),className:v("rounded-md p-1.5 text-muted-foreground/70 transition-colors hover:bg-accent hover:text-foreground",a&&"app-region-no-drag"),title:t("Settings"),children:e.jsx(Qe,{size:16})})]}),e.jsxs("div",{className:"flex min-h-0 flex-1 overflow-hidden",children:[e.jsxs("aside",{className:v("h-full w-full shrink-0 flex-col bg-sidebar md:flex md:w-[320px]",ee?"hidden md:flex":"flex"),children:[e.jsxs("div",{className:"shrink-0 px-2 pb-1 pt-2",children:[e.jsxs("button",{type:"button",onClick:se,className:v("flex w-full items-center gap-2.5 rounded-md px-2 py-2 text-sm transition-colors",l?"bg-accent text-foreground":"text-foreground/80 hover:bg-accent/50"),title:t("New Conversation"),children:[e.jsx(ot,{size:16,className:"text-muted-foreground"}),e.jsx("span",{children:t("New Conversation")})]}),e.jsxs("button",{type:"button",onClick:()=>n("/"),className:"flex w-full items-center gap-2.5 rounded-md px-2 py-2 text-sm text-foreground/80 transition-colors hover:bg-accent/50",title:t("Tasks"),children:[e.jsx(mt,{size:16,className:"text-muted-foreground"}),e.jsx("span",{children:t("Tasks")})]}),e.jsxs("button",{type:"button",onClick:()=>f(!0),className:"flex w-full items-center gap-2.5 rounded-md px-2 py-2 text-sm text-foreground/80 transition-colors hover:bg-accent/50",title:t("Search"),children:[e.jsx(ke,{size:16,className:"text-muted-foreground"}),e.jsx("span",{children:t("Search")})]})]}),e.jsx("div",{className:"relative min-h-0 flex-1 overflow-y-auto scrollbar-app-thin pb-4 pt-3",children:V?e.jsx("div",{className:"px-4 py-4 text-sm text-muted-foreground",children:t("Loading...")}):C.length===0?e.jsxs("div",{className:"flex h-full select-none flex-col items-center justify-center px-6 text-center",children:[e.jsx(he,{size:36,className:"mb-3 text-muted-foreground/40",strokeWidth:1.5}),e.jsx("p",{className:"mb-4 text-sm text-muted-foreground",children:t("No conversations")}),e.jsx("button",{type:"button",onClick:se,className:"rounded-md bg-brand px-3.5 py-1.5 text-xs font-medium text-brand-foreground transition-colors hover:bg-brand/90",children:t("New Conversation")})]}):e.jsxs("div",{className:"mb-2",children:[e.jsxs("div",{className:"flex w-full items-center gap-1.5 px-4 py-1.5 text-xs font-medium text-muted-foreground",children:[e.jsx("span",{className:"flex-1 text-left",children:t("History")}),e.jsx("span",{className:"text-[11px] font-normal tabular-nums text-muted-foreground/50",children:C.length})]}),e.jsx("div",{className:"mt-0.5 flex min-h-[40px] flex-col rounded-md",children:C.map(s=>e.jsx(kt,{conversation:s,selected:s.id===u,disabled:Z.isPending,unread:s.id!==u&&pe(s),onSelect:()=>ne(s),onDelete:()=>R(s.id)},s.id))})]})}),e.jsx("div",{className:"flex items-center justify-between border-t border-border/60 px-4 py-3 text-xs text-muted-foreground/70",children:e.jsxs("span",{children:[t("Conversations")," · ",C.length]})})]}),e.jsxs("main",{className:v("min-w-0 flex-1 flex-col bg-background md:mb-2 md:mr-2 md:overflow-hidden md:rounded-xl md:border md:border-border/50",ee?"flex":"hidden md:flex"),children:[e.jsx("header",{className:"flex h-12 shrink-0 items-center justify-between border-b border-border/60 px-4 md:px-5",children:e.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[U||l?e.jsx("button",{type:"button",className:"rounded-md p-1.5 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground md:hidden",onClick:L,title:t("Back"),children:e.jsx(ct,{size:17})}):null,e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"truncate text-sm font-semibold",children:o?.title??t("New Conversation")}),o?e.jsxs("div",{className:"mt-0.5 truncate text-xs text-muted-foreground",children:[wt(o.status,t),o.directoryName?` · ${o.directoryName}`:""]}):null]})]})}),!o&&U?e.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center px-4 text-sm text-muted-foreground",children:t(Y?"Loading...":"Conversation not found")}):o?e.jsx(ft,{sessionId:o.sessionId,sessionStatus:o.status,sessionStartedAt:o.createdAt,sessionEndedAt:le(o.status)?null:o.lastActiveAt??o.updatedAt,agentType:o.agentType,runtimeType:o.runtimeType,providerId:p||o.providerId,providers:P,initialTokenUsage:o.tokenUsage,onProviderChange:N,onSend:ae,onStop:oe,onExit:xe,isSending:M.isPending,isStopping:G.isPending}):e.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center overflow-y-auto px-4 pb-[10vh] md:px-8",children:e.jsxs("div",{className:"w-full max-w-2xl animate-[fadeInUp_0.5s_cubic-bezier(0.16,1,0.3,1)]",children:[e.jsx("h1",{className:"mb-8 max-w-full break-words text-center text-3xl leading-tight tracking-tight text-foreground",children:t("需要我帮你做点什么?")}),e.jsx(it,{variant:"conversation",projects:[],providers:fe,isProvidersLoading:X,defaultProviderId:p,createStep:w,placeholder:"Ask a question...",submitLabel:"Start",pendingLabel:"Starting...",submitTitle:"Start",onSubmit:async({title:s,providerId:i,attachmentIds:c})=>{await re({title:s,providerId:i,attachmentIds:c})}}),O?e.jsx("div",{className:"mt-3 rounded-lg border border-destructive/15 bg-destructive/5 px-3 py-2 text-sm text-destructive",children:O}):null]})})]})]}),e.jsx(St,{isOpen:ue,conversations:C,onClose:()=>f(!1),onSelectConversation:ne})]})}export{Ut as ConversationPage};
@@ -1 +0,0 @@
1
- import{k as X,o as he,n as ke,q as W,p as ce,m as Je,r,U as gt,V as ae,u as ge,j as e,P as xe,l as k,ae as He,Y as bt,D as vt,E as yt,Z as Qe,X as Nt,z as wt,af as kt,ag as Ct}from"./index-BGajgi5H.js";import{S as Ve,T as Ae,R as ie,h as ye,W as L,u as jt,A as St}from"./mermaid-NOHMQCX5-CzwPLFrI.js";import{A as pe}from"./AgentLogo-Dyqxcj5s.js";import{C as fe}from"./chevron-down-CpKODb7Y.js";import{C as se}from"./check-FwR4dMNY.js";import{d as Tt,F as Et}from"./use-projects-iob5C7Xk.js";import{M as Ye}from"./MemberAvatar-1UlgMZMM.js";import{u as Mt}from"./use-providers-Cj9S9_2q.js";import{P as It}from"./trash-2-DPxBnxJM.js";import{P as Rt}from"./useNormalizedLogs-BhN4AN4f.js";const At=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],_n=X("arrow-down",At);const Lt=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],_t=X("arrow-up",Lt);const Dt=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],Ot=X("gauge",Dt);const Pt=[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]],zt=X("git-branch",Pt);const $t=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Dn=X("search",$t);const Ft=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],qt=X("shield-alert",Ft);const Gt=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],Wt=X("shield",Gt);const Bt=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],On=X("square-pen",Bt);const Ut=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],Kt=X("zap",Ut);function et(t){const s=he(),a=Je({queryKey:W.sessions.runtime(t),queryFn:()=>ce.get(`/sessions/${t}/runtime`),enabled:!!t});return r.useEffect(()=>{if(!t)return;const o=gt.connect(),l=g=>{g.sessionId===t&&s.invalidateQueries({queryKey:W.sessions.runtime(t)})},u=g=>{g.sessionId===t&&s.setQueryData(W.sessions.runtime(t),g.state)},f=()=>{s.invalidateQueries({queryKey:W.sessions.runtime(t)})};return o.on(ae.SESSION_PERMISSION_REQUESTED,l),o.on(ae.SESSION_PERMISSION_INVALIDATED,l),o.on(ae.SESSION_RUNTIME_STATE_CHANGED,u),o.on("connect",f),()=>{o.off(ae.SESSION_PERMISSION_REQUESTED,l),o.off(ae.SESSION_PERMISSION_INVALIDATED,l),o.off(ae.SESSION_RUNTIME_STATE_CHANGED,u),o.off("connect",f)}},[t,s]),a}function Ht(t){return t==="RUNNING"||t==="AWAITING_PERMISSION"||t==="CANCELLING"}function Qt(t){return t===Ve.RUNNING||t===Ve.PENDING}function Pn(t,s){const{data:a}=et(t);return{runtimeState:a,isActive:Qt(s)||Ht(a?.turnState),isCancelling:a?.turnState==="CANCELLING"}}function Vt(){const t=he();return ke({mutationFn:({sessionId:s,requestId:a,optionId:o})=>ce.post(`/sessions/${s}/permissions/${a}/resolve`,{optionId:o}),onSettled:(s,a,o)=>{t.invalidateQueries({queryKey:W.sessions.runtime(o.sessionId)})}})}function zn(){const t=he();return ke({mutationFn:s=>ce.post(`/sessions/${s}/start`),onSuccess:(s,a)=>{t.invalidateQueries({queryKey:W.sessions.detail(a)}),t.invalidateQueries({queryKey:W.tasks.all})}})}function $n(){const t=he();return ke({mutationFn:s=>ce.post(`/sessions/${s}/stop`),onSuccess:(s,a)=>{t.invalidateQueries({queryKey:W.sessions.detail(a)})}})}function Fn(){const t=he();return ke({mutationFn:({id:s,message:a,providerId:o})=>ce.post(`/sessions/${s}/message`,{message:a,providerId:o}),onSuccess:()=>{t.invalidateQueries({queryKey:W.workspaces.all}),t.invalidateQueries({queryKey:W.tasks.all})}})}function qn({sessionId:t,compact:s=!1}){const{t:a}=ge(),{data:o}=et(t),l=Vt(),u=o?.pendingPermissions[0],f=u?.requestId,g=l.reset;return r.useEffect(()=>{g()},[f,g]),u?e.jsx("div",{className:k("mb-2 border-l-2 border-warning bg-warning/5 px-3 py-2.5",s&&"px-2.5 py-2"),children:e.jsxs("div",{className:"flex min-w-0 items-start gap-2",children:[e.jsx(qt,{className:"mt-0.5 h-4 w-4 shrink-0 text-warning","aria-hidden":"true"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"text-sm font-medium text-foreground",children:a("Permission required")}),e.jsx("div",{className:"mt-0.5 break-words text-xs text-muted-foreground",children:u.toolSummary||u.toolName||a("The agent needs approval to continue.")}),e.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:u.options.map(x=>e.jsxs("button",{type:"button",disabled:l.isPending,onClick:()=>l.mutate({sessionId:t,requestId:u.requestId,optionId:x.optionId}),className:k("inline-flex min-h-8 items-center gap-1.5 border px-3 text-xs font-medium transition-colors disabled:opacity-50",x.kind.startsWith("reject")?"border-destructive/30 text-destructive hover:bg-destructive/10":"border-border bg-background text-foreground hover:bg-muted"),children:[l.isPending&&l.variables?.requestId===u.requestId&&l.variables.optionId===x.optionId?e.jsx(xe,{className:"h-3.5 w-3.5 animate-spin","aria-hidden":"true"}):null,x.name]},x.optionId))}),l.error?e.jsx("div",{className:"mt-1.5 text-xs text-destructive",role:"alert",children:l.error.message}):null]})]})}):null}function Ne(t){return t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(1)}K`:t.toString()}function Yt(t){return t>=.9?"text-red-500":t>=.7?"text-amber-500":"text-neutral-400"}function Gn({usage:t,tooltipSide:s="top"}){const{t:a}=ge();if(!t)return null;const o=t.modelContextWindow,l=o?t.totalTokens/o:0,u=o?Math.min(Math.round(l*100),100):null,f=o?Yt(l):"text-neutral-400",g=o?e.jsx("span",{children:a("上下文: {used} / {max} tokens",{used:Ne(t.totalTokens),max:Ne(o)})}):e.jsx("span",{children:a("已使用: {used} tokens",{used:Ne(t.totalTokens)})});return e.jsx(Ae,{content:g,side:s,children:e.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1.5 text-xs rounded-lg hover:bg-neutral-100 transition-colors cursor-default select-none",children:[e.jsx(Ot,{size:14,className:f}),e.jsxs("span",{className:`tabular-nums ${f}`,children:[Ne(t.totalTokens),u!==null&&e.jsxs("span",{className:"text-neutral-300 ml-0.5",children:["/ ",u,"%"]})]})]})})}const Xt={damping:.7,stiffness:.05,mass:1.25},Zt=70,Jt=1e3/60,en=350;let Ce=!1;globalThis.document?.addEventListener("mousedown",()=>{Ce=!0});globalThis.document?.addEventListener("mouseup",()=>{Ce=!1});globalThis.document?.addEventListener("click",()=>{Ce=!1});const Wn=(t={})=>{const[s,a]=r.useState(!1),[o,l]=r.useState(t.initial!==!1),[u,f]=r.useState(!1),g=r.useRef(null);g.current=t;const x=r.useCallback(()=>{if(!Ce)return!1;const d=window.getSelection();if(!d||!d.rangeCount)return!1;const h=d.getRangeAt(0);return h.commonAncestorContainer.contains(p.current)||p.current?.contains(h.commonAncestorContainer)},[]),y=r.useCallback(d=>{n.isAtBottom=d,l(d)},[]),C=r.useCallback(d=>{n.escapedFromLock=d,a(d)},[]),n=r.useMemo(()=>{let d;return{escapedFromLock:s,isAtBottom:o,resizeDifference:0,accumulated:0,velocity:0,listeners:new Set,get scrollTop(){return p.current?.scrollTop??0},set scrollTop(h){p.current&&(p.current.scrollTop=h,n.ignoreScrollToTop=p.current.scrollTop)},get targetScrollTop(){return!p.current||!I.current?0:p.current.scrollHeight-1-p.current.clientHeight},get calculatedTargetScrollTop(){if(!p.current||!I.current)return 0;const{targetScrollTop:h}=this;if(!t.targetScrollTop)return h;if(d?.targetScrollTop===h)return d.calculatedScrollTop;const v=Math.max(Math.min(t.targetScrollTop(h,{scrollElement:p.current,contentElement:I.current}),h),0);return d={targetScrollTop:h,calculatedScrollTop:v},requestAnimationFrame(()=>{d=void 0}),v},get scrollDifference(){return this.calculatedTargetScrollTop-this.scrollTop},get isNearBottom(){return this.scrollDifference<=Zt}}},[]),b=r.useCallback((d={})=>{typeof d=="string"&&(d={animation:d}),d.preserveScrollPosition||y(!0);const h=Date.now()+(Number(d.wait)||0),v=Re(g.current,d.animation),{ignoreEscapes:j=!1}=d;let S,M=n.calculatedTargetScrollTop;d.duration instanceof Promise?d.duration.finally(()=>{S=Date.now()}):S=h+(d.duration??0);const A=async()=>{const B=new Promise(requestAnimationFrame).then(()=>{if(!n.isAtBottom)return n.animation=void 0,!1;const{scrollTop:D}=n,U=performance.now(),K=(U-(n.lastTick??U))/Jt;if(n.animation||(n.animation={behavior:v,promise:B,ignoreEscapes:j}),n.animation.behavior===v&&(n.lastTick=U),x()||h>Date.now())return A();if(D<Math.min(M,n.calculatedTargetScrollTop)){if(n.animation?.behavior===v){if(v==="instant")return n.scrollTop=n.calculatedTargetScrollTop,A();n.velocity=(v.damping*n.velocity+v.stiffness*n.scrollDifference)/v.mass,n.accumulated+=n.velocity*K,n.scrollTop+=n.accumulated,n.scrollTop!==D&&(n.accumulated=0)}return A()}return S>Date.now()?(M=n.calculatedTargetScrollTop,A()):(n.animation=void 0,n.scrollTop<n.calculatedTargetScrollTop?b({animation:Re(g.current,g.current.resize),ignoreEscapes:j,duration:Math.max(0,S-Date.now())||void 0}):n.isAtBottom)});return B.then(D=>(requestAnimationFrame(()=>{n.animation||(n.lastTick=void 0,n.velocity=0)}),D))};return d.wait!==!0&&(n.animation=void 0),n.animation?.behavior===v?n.animation.promise:A()},[y,x,n]),m=r.useCallback(()=>{C(!0),y(!1)},[C,y]),N=r.useCallback(({target:d})=>{if(d!==p.current)return;const{scrollTop:h,ignoreScrollToTop:v}=n;let{lastScrollTop:j=h}=n;n.lastScrollTop=h,n.ignoreScrollToTop=void 0,v&&v>h&&(j=v),f(n.isNearBottom),setTimeout(()=>{if(n.resizeDifference||h===v)return;if(x()){C(!0),y(!1);return}const S=h>j,M=h<j;if(n.animation?.ignoreEscapes){n.scrollTop=j;return}M&&(C(!0),y(!1)),S&&C(!1),!n.escapedFromLock&&n.isNearBottom&&y(!0)},1)},[C,y,x,n]),_=r.useCallback(({target:d,deltaY:h})=>{let v=d;for(;!["scroll","auto"].includes(getComputedStyle(v).overflow);){if(!v.parentElement)return;v=v.parentElement}v===p.current&&h<0&&p.current.scrollHeight>p.current.clientHeight&&!n.animation?.ignoreEscapes&&(C(!0),y(!1))},[C,y,n]),p=Xe(d=>{p.current?.removeEventListener("scroll",N),p.current?.removeEventListener("wheel",_),d?.addEventListener("scroll",N,{passive:!0}),d?.addEventListener("wheel",_,{passive:!0})},[]),I=Xe(d=>{if(n.resizeObserver?.disconnect(),!d)return;let h;n.resizeObserver=new ResizeObserver(([v])=>{const{height:j}=v.contentRect,S=j-(h??j);if(n.resizeDifference=S,n.scrollTop>n.targetScrollTop&&(n.scrollTop=n.targetScrollTop),f(n.isNearBottom),S>=0){const M=Re(g.current,h?g.current.resize:g.current.initial);b({animation:M,wait:!0,preserveScrollPosition:!0,duration:M==="instant"?void 0:en})}else n.isNearBottom&&(C(!1),y(!0));h=j,requestAnimationFrame(()=>{setTimeout(()=>{n.resizeDifference===S&&(n.resizeDifference=0)},1)})}),n.resizeObserver?.observe(d)},[]);return{contentRef:I,scrollRef:p,scrollToBottom:b,stopScroll:m,isAtBottom:o||u,isNearBottom:u,escapedFromLock:s,state:n}};function Xe(t,s){const a=r.useCallback(o=>(a.current=o,t(o)),s);return a}const Ie=new Map;function Re(...t){const s={...Xt};let a=!1;for(const l of t){if(l==="instant"){a=!0;continue}typeof l=="object"&&(a=!1,s.damping=l.damping??s.damping,s.stiffness=l.stiffness??s.stiffness,s.mass=l.mass??s.mass)}const o=JSON.stringify(s);return Ie.has(o)||Ie.set(o,Object.freeze(s)),a?"instant":Ie.get(o)}function Bn({providers:t,currentProviderId:s,agentType:a,runtimeType:o,onSelect:l}){const{t:u}=ge(),[f,g]=r.useState(!1),x=r.useRef(null),y=o===ie.ACP?ie.ACP:ie.CLI,C=t.filter(b=>String(b.provider.agentType)===a&&(b.provider.runtimeType===ie.ACP?ie.ACP:ie.CLI)===y),n=t.find(b=>b.provider.id===s);return r.useEffect(()=>{function b(m){x.current&&!x.current.contains(m.target)&&g(!1)}if(f)return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[f]),C.length<=1?e.jsxs("div",{className:"flex items-center gap-1 text-xs text-neutral-400 px-2 py-1.5 select-none cursor-default",children:[e.jsx(pe,{agentType:n?.provider.agentType??a,className:"size-3.5"}),e.jsx("span",{className:"min-w-0 truncate",children:n?.provider.name?He(n.provider.name,12):a})]}):e.jsxs("div",{className:"relative",ref:x,children:[e.jsxs("button",{onClick:()=>g(!f),className:"flex items-center gap-1 text-xs px-2 py-1.5 rounded-lg transition-colors cursor-pointer hover:bg-neutral-100 text-neutral-400 hover:text-neutral-600",title:`Provider: ${n?.provider.name??a} (click to change)`,children:[e.jsx(pe,{agentType:n?.provider.agentType??a,className:"size-3.5"}),e.jsx("span",{className:"min-w-0 truncate",children:n?.provider.name?He(n.provider.name,12):a}),e.jsx(fe,{size:12,className:`shrink-0 transition-transform ${f?"rotate-180":""}`})]}),f&&e.jsxs("div",{className:"absolute bottom-full right-0 mb-1 bg-white rounded-lg border border-neutral-200 shadow-lg py-1 min-w-[160px] z-50",children:[e.jsx("div",{className:"px-2 py-1 text-xs text-neutral-400 border-b border-neutral-100",children:u("切换渠道")}),C.map(b=>e.jsxs("button",{onClick:()=>{l(b.provider.id),g(!1)},className:`w-full flex items-center justify-between px-3 py-2 text-sm text-left hover:bg-neutral-50 transition-colors ${b.provider.id===s?"bg-blue-50 text-blue-600":"text-neutral-700"}`,children:[e.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[e.jsx(pe,{agentType:b.provider.agentType,className:"size-4"}),e.jsx("span",{className:"truncate max-w-[120px]",children:b.provider.name}),b.provider.isDefault&&e.jsx("span",{className:"text-xs text-neutral-400",children:u("(默认)")})]}),b.provider.id===s&&e.jsx(se,{size:14,className:"shrink-0"})]},b.provider.id))]})]})}function Un(t,s){return r.useMemo(()=>{for(let a=t.length-1;a>=0;a--){const o=t[a];if(o.tokenUsage&&typeof o.tokenUsage.totalTokens=="number"&&o.tokenUsage.totalTokens>0)return{totalTokens:o.tokenUsage.totalTokens,modelContextWindow:o.tokenUsage.modelContextWindow}}return s??null},[t,s])}function Ze(t,s,a,o){if(a.filter(f=>f===o).length<=1)return t;const u=a.slice(0,s+1).filter(f=>f===o).length;return`${t} #${u}`}function tn(t){return Object.values(t).filter(Boolean).length}function nn({mode:t,setMode:s,selectedTemplateId:a,setSelectedTemplateId:o,selectedMemberPresetIds:l,setSelectedMemberPresetIds:u,disabled:f=!1,compact:g=!1}){const{t:x}=ge(),{preserveDesktopSearch:y}=bt(),[C,n]=r.useState(!1),{data:b}=Mt(),{data:m,isError:N,isFetching:_,isLoading:p,refetch:I}=vt(),{data:d,isError:h,isFetching:v,isLoading:j,refetch:S}=yt(),M=r.useMemo(()=>new Map((b??[]).map(({provider:c,availability:w})=>[c.id,c.name+(w.type==="NOT_FOUND"?x(" (不可用)"):"")])),[b,x]),A=r.useMemo(()=>new Map((m??[]).map(c=>[c.id,c])),[m]),B=r.useMemo(()=>new Map((d??[]).map(c=>[c.id,c])),[d]),D=r.useMemo(()=>l.map(c=>A.get(c)).filter(c=>!!c),[A,l]);r.useEffect(()=>{m!==void 0&&u(c=>{const w=c.filter(z=>A.has(z));return w.length===c.length&&w.every((z,F)=>z===c[F])?c:w})},[m,A,u]),r.useEffect(()=>{d!==void 0&&o(c=>!c||B.has(c)?c:null)},[o,B,d]);const U=c=>{f||o(w=>w===c?null:c)},K=c=>{f||u(w=>[...w,c])},te=c=>{f||u(w=>w.filter((z,F)=>F!==c))},H=e.jsxs("section",{className:"min-w-0",children:[e.jsx("div",{className:"text-[11px] font-medium text-muted-foreground mb-1.5",children:x("团队模板")}),h?e.jsxs("div",{className:"rounded-lg bg-destructive/10 px-3 py-2.5 text-xs text-destructive",children:[e.jsx("span",{children:x("团队模板加载失败")}),e.jsx("button",{type:"button",onClick:()=>{S()},disabled:f||v,className:"ml-2 underline hover:no-underline",children:x("重试")})]}):j?e.jsxs("div",{className:"flex items-center gap-2 py-3 text-xs text-muted-foreground",children:[e.jsx(xe,{size:12,className:"animate-spin"}),x("加载中...")]}):(d??[]).length===0?e.jsxs("div",{className:"rounded-lg border border-dashed border-border bg-background px-3 py-3 text-xs text-muted-foreground",children:[x("当前没有团队模板"),e.jsx(Qe,{to:y("/settings/team"),className:"ml-1.5 text-info hover:underline",children:x("去创建")})]}):e.jsx("div",{className:k("space-y-1.5",g&&"sm:grid sm:grid-cols-2 sm:gap-1.5 sm:space-y-0"),children:(d??[]).map(c=>{const w=c.id===a,z=c.members?.length??0,F=c.members?.map(V=>V.memberPresetId)??[],q=c.members?.slice(0,3).map((V,le)=>Ze(V.memberPreset?.name??V.memberPresetId,le,F,V.memberPresetId)).join(", ");return e.jsx("button",{type:"button",onClick:()=>U(c.id),disabled:f,className:k("w-full rounded-lg px-3 py-2 text-left border transition-all disabled:cursor-not-allowed disabled:opacity-60",w?"bg-background border-foreground/20 shadow-sm":"bg-background border-border/60 hover:border-border hover:bg-accent"),children:e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:k("text-xs truncate",w?"font-medium text-foreground":"text-foreground"),children:c.name}),e.jsxs("span",{className:"text-[10px] text-muted-foreground shrink-0",children:[z,x("人")]})]}),q&&e.jsx("div",{className:"mt-0.5 text-[10px] text-muted-foreground truncate",children:q})]}),w&&e.jsx(se,{size:13,className:"shrink-0 text-foreground"})]})},c.id)})})]}),ne=D.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1 mb-2",children:D.map((c,w)=>{const z=Ze(c.name,w,l,c.id);return e.jsxs("div",{className:"inline-flex items-center gap-1 pl-1 pr-0.5 py-0.5 rounded-md border border-border/60 bg-background text-[10px] text-foreground",children:[e.jsx(Ye,{name:c.name,avatar:c.avatar,className:"h-3.5 w-3.5 text-[7px]"}),e.jsx("span",{className:"max-w-[80px] truncate",children:z}),e.jsx("button",{type:"button",onClick:()=>te(w),disabled:f,className:"p-0.5 text-muted-foreground hover:text-destructive disabled:opacity-30 rounded transition-colors",children:e.jsx(Nt,{size:9})})]},`${c.id}-${w}`)})}),re=N?e.jsxs("div",{className:"rounded-lg bg-destructive/10 px-3 py-2.5 text-xs text-destructive",children:[e.jsx("span",{children:x("成员预设加载失败")}),e.jsx("button",{type:"button",onClick:()=>{I()},disabled:f||_,className:"ml-2 underline hover:no-underline",children:x("重试")})]}):p?e.jsxs("div",{className:"flex items-center gap-2 py-3 text-xs text-muted-foreground",children:[e.jsx(xe,{size:12,className:"animate-spin"}),x("加载中...")]}):(m??[]).length===0?e.jsxs("div",{className:"rounded-lg border border-dashed border-border bg-background px-3 py-3 text-xs text-muted-foreground",children:[x("当前没有成员预设"),e.jsx(Qe,{to:y("/settings/team"),className:"ml-1.5 text-info hover:underline",children:x("去创建")})]}):e.jsx("div",{className:"space-y-1 max-h-[180px] overflow-y-auto pr-1",children:(m??[]).map(c=>{const w=l.filter(q=>q===c.id).length,z=M.get(c.providerId)??c.providerId,F=tn(c.capabilities);return e.jsxs("button",{type:"button",onClick:()=>K(c.id),disabled:f,className:k("flex items-center gap-2 w-full px-2 py-1.5 rounded-lg text-left border border-transparent transition-all",f&&"cursor-not-allowed opacity-60","bg-background hover:bg-accent hover:border-border/60"),children:[e.jsx(Ye,{name:c.name,avatar:c.avatar,className:"h-6 w-6 text-[9px] shrink-0"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"text-xs text-foreground truncate",children:c.name}),e.jsxs("div",{className:"text-[10px] text-muted-foreground truncate",children:[z," · ",F,"/10"]})]}),e.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[w>0&&e.jsxs("span",{className:"text-[10px] text-foreground font-semibold",children:["×",w]}),e.jsx(It,{size:12,className:"text-muted-foreground"})]})]},c.id)})}),Q=D.length>0&&e.jsx("span",{className:"inline-flex items-center justify-center min-w-[16px] h-4 rounded-full bg-primary text-[10px] font-semibold text-primary-foreground px-1.5",children:D.length}),Z=e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-[11px] font-medium text-muted-foreground shrink-0",children:x("执行模式")}),e.jsxs("div",{className:"inline-flex items-center h-7 rounded-md border border-border/70 bg-background p-0.5",children:[e.jsxs("button",{type:"button",onClick:()=>!f&&s("AUTO"),disabled:f,className:k("flex items-center gap-1.5 rounded h-full px-2.5 text-xs transition-all disabled:cursor-not-allowed disabled:opacity-50",t==="AUTO"?"bg-primary text-primary-foreground font-medium shadow-sm":"text-muted-foreground hover:text-foreground"),children:[e.jsx(Kt,{size:11}),x("自动模式")]}),e.jsxs("button",{type:"button",onClick:()=>!f&&s("CONFIRM"),disabled:f,className:k("flex items-center gap-1.5 rounded h-full px-2.5 text-xs transition-all disabled:cursor-not-allowed disabled:opacity-50",t==="CONFIRM"?"bg-primary text-primary-foreground font-medium shadow-sm":"text-muted-foreground hover:text-foreground"),children:[e.jsx(Wt,{size:11}),x("确认模式")]})]})]});return g?e.jsxs("div",{className:"space-y-3",children:[Z,H,e.jsxs("div",{className:"border-t border-border/50 pt-2.5",children:[e.jsxs("button",{type:"button",onClick:()=>!f&&n(c=>!c),disabled:f,"aria-expanded":C,className:"flex items-center gap-1.5 text-[11px] font-medium text-muted-foreground hover:text-foreground transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:[e.jsx(fe,{size:12,className:k("transition-transform",C?"":"-rotate-90")}),x("追加独立成员"),Q]}),C&&e.jsxs("div",{className:"mt-2",children:[ne,re]})]})]}):e.jsxs("div",{className:"space-y-3.5",children:[Z,e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[H,e.jsxs("section",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[e.jsx("span",{className:"text-[11px] font-medium text-muted-foreground",children:x("追加成员")}),Q]}),ne,re]})]})]})}function sn({commands:t,selectedIndex:s,query:a,hasCatalog:o,title:l="Slash Commands",queryPrefix:u="/",emptyCatalogMessage:f="No slash commands catalog for this agent yet.",emptyQueryMessage:g,insertionHint:x="Enter / Tab to insert",compact:y=!1,onSelect:C}){const n=y?"px-1.5 pb-1.5":"px-2 pb-2",b=y?"px-2 py-1.5":"px-2.5 py-2",m=y?"max-h-36":"max-h-48";return e.jsxs("div",{className:y?"pt-1.5":"pt-2",children:[e.jsxs("div",{className:`mb-1 flex items-center justify-between ${y?"px-2 pt-0.5":"px-3 pt-1"}`,children:[e.jsx("span",{className:"text-[10px] font-medium uppercase tracking-[0.14em] text-neutral-400",children:l}),e.jsx("span",{className:"text-[10px] text-neutral-400",children:x})]}),t.length===0?e.jsx("div",{className:`${y?"px-2 pb-2 pt-1.5 text-[11px]":"px-3 pb-3 pt-2 text-xs"} text-neutral-400`,children:o?g??`No matches for ${u}${a}`:f}):e.jsx("div",{className:`${n} ${m} overflow-y-auto`,children:t.map((N,_)=>e.jsxs("button",{type:"button",onMouseDown:p=>p.preventDefault(),onClick:()=>C(N),className:`w-full rounded-lg border text-left transition-colors ${_===s?"border-neutral-300 bg-neutral-50":"border-transparent hover:border-neutral-200 hover:bg-neutral-50/80"} ${b}`,children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"font-mono text-[13px] text-neutral-900",children:N.command}),N.kind&&N.kind!=="builtin"?e.jsx("span",{className:"rounded-full border border-neutral-200 px-1.5 py-0.5 text-[9px] uppercase tracking-[0.12em] text-neutral-500",children:N.scope?`${N.scope} ${N.kind}`:N.kind}):null]}),e.jsx("div",{className:`${y?"mt-0.5 text-[11px]":"mt-1 text-xs"} text-neutral-500`,children:N.description})]},N.command))})]})}const ee=12,we=8;function rn({open:t,anchorRef:s,commands:a,selectedIndex:o,query:l,hasCatalog:u,title:f,queryPrefix:g,emptyCatalogMessage:x,emptyQueryMessage:y,insertionHint:C,compact:n=!1,onSelect:b}){const m=r.useRef(null),[N,_]=r.useState(null);return r.useLayoutEffect(()=>{if(!t){_(null);return}const p=s.current;if(!p)return;let I=0;const d=()=>{const j=s.current;if(!j)return;const S=j.getBoundingClientRect(),M=window.innerWidth,A=window.innerHeight,B=n?260:320,D=n?M-ee*2:560,U=Math.min(Math.max(S.width,B),Math.max(B,D)),K=Math.min(Math.max(ee,S.left),Math.max(ee,M-ee-U)),te=A-S.bottom-we-ee,H=S.top-we-ee,ne=m.current?.offsetHeight??(n?220:280),re=n?240:320,Q=te<180&&H>te,c=Math.max(120,Math.min(re,Q?H:te)),w=Q?Math.max(ee,S.top-we-Math.min(ne,c)):Math.min(A-ee-Math.min(ne,c),S.bottom+we);_({top:w,left:K,width:U,maxHeight:c})},h=()=>{cancelAnimationFrame(I),I=requestAnimationFrame(d)};h();const v=new ResizeObserver(h);return v.observe(p),m.current&&v.observe(m.current),window.addEventListener("resize",h),window.addEventListener("scroll",h,!0),window.visualViewport?.addEventListener("resize",h),window.visualViewport?.addEventListener("scroll",h),()=>{cancelAnimationFrame(I),v.disconnect(),window.removeEventListener("resize",h),window.removeEventListener("scroll",h,!0),window.visualViewport?.removeEventListener("resize",h),window.visualViewport?.removeEventListener("scroll",h)}},[s,a.length,n,t,l,o]),!t||!N||typeof document>"u"?null:wt.createPortal(e.jsx("div",{className:"pointer-events-none fixed inset-0 z-[120]",children:e.jsx("div",{ref:m,className:"pointer-events-auto fixed overflow-hidden rounded-xl border border-neutral-200 bg-white shadow-lg shadow-neutral-200/70",style:{top:N.top,left:N.left,width:N.width,maxHeight:N.maxHeight},children:e.jsx(sn,{commands:a,selectedIndex:o,query:l,hasCatalog:u,title:f,queryPrefix:g,emptyCatalogMessage:x,emptyQueryMessage:y,insertionHint:C,compact:n,onSelect:b})})}),document.body)}function on({agentType:t,workingDir:s}){return Je({queryKey:W.system.slashCommandCatalog(t,s),queryFn:async()=>(await ce.get("/system/slash-command-catalog",{params:{agentType:String(t),...s?{workingDir:s}:{}}})).commands,enabled:!!t,staleTime:3e4})}function an(t,s){const a=new Set,o=[];for(const l of[...t,...s]){const u=l.command.trim().toLowerCase();!u||a.has(u)||(a.add(u),o.push(l.kind?l:{...l,kind:"builtin"}))}return o}function je(t){return t.trim().toLowerCase().replace(/^[/$]/,"")}function cn(t){return je(t.command)}function ln(t,s){if(!s)return 1e3;const a=cn(t),o=t.aliases?.map(je)??[],l=[a,...o];let u=0;for(const g of l)g===s?u=Math.max(u,500):g.startsWith(s)?u=Math.max(u,400-(g.length-s.length)):g.includes(s)&&(u=Math.max(u,250-g.indexOf(s)));return u>0?u:`${a} ${o.join(" ")} ${t.description}`.toLowerCase().includes(s)?100:0}function Kn(t){const s=/(^|[\s])\$([^\s]*)$/.exec(t);if(!s||s.index===void 0)return null;const a=s.index+s[1].length;return{query:je(s[2]),replaceStart:a}}function dn(t,s){const a=je(s);return a?t.map((o,l)=>({command:o,index:l,score:ln(o,a)})).filter(o=>o.score>0).sort((o,l)=>l.score-o.score||o.index-l.index||o.command.command.localeCompare(l.command.command)).map(o=>o.command):t.slice()}const mn=[{command:"/permissions",description:"Manage what Codex can do without approval"},{command:"/sandbox-add-read-dir",description:"Grant read access to another directory"},{command:"/agent",description:"Switch between built-in agent personas"},{command:"/apps",description:"Manage connected apps"},{command:"/clear",description:"Start a fresh conversation"},{command:"/compact",description:"Replace chat context with a summary"},{command:"/copy",description:"Copy the last assistant message to your clipboard"},{command:"/diff",description:"Show the current git diff"},{command:"/experimental",description:"Toggle experimental features"},{command:"/feedback",description:"Share feedback on Codex CLI"},{command:"/init",description:"Create or update AGENTS.md for the repo"},{command:"/logout",description:"Sign out of Codex"},{command:"/mcp",description:"Manage MCP servers"},{command:"/mention",description:"Add files or directories to the conversation context"},{command:"/model",description:"Change the active model"},{command:"/fast",description:"Toggle low reasoning mode"},{command:"/plan",description:"Toggle plan mode for code changes"},{command:"/personality",description:"Select how Codex communicates"},{command:"/ps",description:"List running background tasks"},{command:"/fork",description:"Fork the current conversation state"},{command:"/resume",description:"Resume a previous conversation"},{command:"/new",description:"Open a conversation picker to start or resume"},{command:"/quit",description:"Exit Codex CLI",aliases:["exit"]},{command:"/review",description:"Run a code review"},{command:"/status",description:"Show session and configuration status"},{command:"/debug-config",description:"Inspect the effective configuration"},{command:"/statusline",description:"Configure the custom status line"},{command:"/skills",description:"Browse available skills and insert a $skill mention"}],un=[{command:"/clear",description:"Clear the conversation history"},{command:"/compact",description:"Compact the conversation context",aliases:["compact focus"]},{command:"/config",description:"Open the configuration panel"},{command:"/cost",description:"Show token usage and cost"},{command:"/doctor",description:"Check Claude Code installation health"},{command:"/help",description:"Show help and available commands"},{command:"/init",description:"Initialize project instructions"},{command:"/login",description:"Sign in to Claude Code"},{command:"/logout",description:"Sign out of Claude Code"},{command:"/mcp",description:"Manage MCP servers"},{command:"/memory",description:"Edit project memory files"},{command:"/model",description:"Change the active model"},{command:"/permissions",description:"Review or update tool permissions"},{command:"/pr_comments",description:"Read pull request review comments"},{command:"/review",description:"Run a code review"},{command:"/status",description:"Show account and system status"},{command:"/terminal-setup",description:"Configure terminal newline shortcuts"},{command:"/vim",description:"Toggle vim mode"}],pn=[{command:"/bug",description:"File an issue about Gemini CLI"},{command:"/chat",description:"Manage chat checkpoints and exports"},{command:"/clear",description:"Clear the terminal display"},{command:"/compress",description:"Replace chat context with a summary"},{command:"/copy",description:"Copy the last Gemini CLI output"},{command:"/directory",description:"Manage additional workspace directories",aliases:["dir"]},{command:"/editor",description:"Choose the preferred editor"},{command:"/extensions",description:"List active Gemini CLI extensions"},{command:"/help",description:"Show help and command usage",aliases:["?"]},{command:"/mcp",description:"Show MCP servers and tools"},{command:"/memory",description:"Manage loaded GEMINI.md memory"},{command:"/restore",description:"Restore files from a tool checkpoint"},{command:"/settings",description:"Open the Gemini CLI settings editor"},{command:"/stats",description:"Show session statistics and token usage"},{command:"/theme",description:"Change the Gemini CLI theme"},{command:"/auth",description:"Change the authentication method"},{command:"/about",description:"Show version information"},{command:"/tools",description:"List currently available tools"},{command:"/privacy",description:"Review privacy and data collection settings"},{command:"/quit",description:"Exit Gemini CLI",aliases:["exit"]},{command:"/vim",description:"Toggle vim mode"},{command:"/init",description:"Generate a tailored GEMINI.md file"}],fn=[{command:"/model",description:"Change the active model"},{command:"/plan",description:"Create or reopen a plan"},{command:"/ask",description:"Toggle ask mode (read-only Q&A)"},{command:"/debug",description:"Toggle debug mode"},{command:"/clear",description:"Start a new chat session",aliases:["new","new-chat","newchat"]},{command:"/compress",description:"Summarize the conversation to reduce context"},{command:"/vim",description:"Toggle vim mode"},{command:"/shell",description:"Enter shell mode"},{command:"/about",description:"Show CLI, system, and account information"},{command:"/setup-terminal",description:"Configure terminal newline shortcuts"},{command:"/feedback",description:"Share feedback with the Cursor team"},{command:"/open",description:"Open the repository git root in Cursor"},{command:"/cursor",description:"Alias for /open",aliases:["open"]},{command:"/resume-chat",description:"Resume a previous chat by folder name",aliases:["resume"]},{command:"/copy-request-id",description:"Copy the last request ID"},{command:"/copy-conversation-id",description:"Copy the current conversation ID"},{command:"/logout",description:"Sign out from Cursor"},{command:"/quit",description:"Exit Cursor Agent",aliases:["exit"]},{command:"/mcp",description:"Manage MCP servers"}],xn={[ye.CODEX]:mn,[ye.CLAUDE_CODE]:un,[ye.GEMINI_CLI]:pn,[ye.CURSOR_AGENT]:fn};function tt(t){return t.trim().toLowerCase().replace(/^\//,"")}function hn(t){return t?(xn[t]??[]).map(s=>({...s,kind:s.kind??"builtin"})):[]}function gn(t){const s=t.match(/^\s*\/([^\s]*)$/);return s?tt(s[1]):null}function bn(t,s){return dn(t,tt(s))}function vn(t){const s=t.key==="Enter"&&!t.shiftKey&&!t.repeat&&!t.nativeEvent.isComposing&&t.nativeEvent.keyCode!==229,a=t.key==="Tab"&&!t.shiftKey;return s||a}function yn({agentType:t,workingDir:s,input:a,setInput:o,textareaRef:l,minHeight:u,maxHeight:f}){const[g,x]=r.useState(0),{data:y=[]}=on({agentType:t,workingDir:s}),C=r.useMemo(()=>an(hn(t),y),[t,y]),n=r.useMemo(()=>gn(a),[a]),b=r.useMemo(()=>n===null?[]:bn(C,n),[C,n]),m=r.useCallback(()=>{const p=l.current;p&&(p.style.height="auto",p.style.height=`${Math.max(u,Math.min(p.scrollHeight,f))}px`)},[f,u,l]);r.useEffect(()=>{x(0)},[t,n]),r.useEffect(()=>{g<b.length||x(0)},[b.length,g]);const N=r.useCallback(p=>{const d=`${a.match(/^(\s*)\/[^\s]*$/)?.[1]??""}${p.command} `;o(d),requestAnimationFrame(()=>{const h=l.current;h&&(m(),h.focus(),h.setSelectionRange(d.length,d.length))})},[a,m,o,l]),_=r.useCallback(p=>n===null||b.length===0?!1:p.key==="ArrowDown"?(p.preventDefault(),x(I=>(I+1)%b.length),!0):p.key==="ArrowUp"?(p.preventDefault(),x(I=>(I-1+b.length)%b.length),!0):vn(p)?(p.preventDefault(),N(b[g]??b[0]),!0):!1,[N,b,n,g]);return{allCommands:C,query:n,filteredCommands:b,selectedIndex:g,setSelectedIndex:x,applyCommand:N,handleKeyDown:_}}const Nn="/assets/agent-tower-lockup-DPAcheCt.png";function Hn({className:t="h-6 w-auto max-[359px]:h-[22px]"}){return e.jsx("img",{src:Nn,alt:"Agent Tower",className:`block shrink-0 select-none object-contain ${t}`})}const wn={idle:"","creating-task":"Creating Task...","creating-teamrun":"Creating TeamRun...","creating-workspace":"Creating Workspace...","creating-session":"Creating Session...","starting-session":"Starting Agent..."};function Qn({variant:t="task",projects:s,providers:a,isProvidersLoading:o,onSubmit:l,defaultProjectId:u="",defaultProviderId:f="",onProjectChange:g,createStep:x,placeholder:y,submitLabel:C,pendingLabel:n,submitTitle:b}){const{t:m}=ge(),[N,_]=r.useState(""),[p,I]=r.useState(u),[d,h]=r.useState(f),[v,j]=r.useState("SOLO"),[S,M]=r.useState(L.WORKTREE),[A,B]=r.useState({}),[D,U]=r.useState("AUTO"),[K,te]=r.useState(null),[H,ne]=r.useState([]),[re,Q]=r.useState(!1),[Z,c]=r.useState(!1),[w,z]=r.useState(!1),[F,q]=r.useState(!1),V=r.useRef(null),le=r.useRef(null),Se=r.useRef(null),Le=r.useRef(null),_e=r.useRef(null),De=r.useRef(null),{files:Oe,addFiles:oe,removeFile:nt,clear:Pe,buildMarkdownLinks:ze,getDoneAttachments:$e,isUploading:be}=jt(),de=Tt(),T=t==="conversation",E=t==="task"||t==="conversation",st=C??m(T?"开始":"创建");r.useEffect(()=>{I(u),g?.(u)},[u,g]),r.useEffect(()=>{h(f)},[f]),r.useEffect(()=>{if(!Z)return;const i=R=>{V.current&&!V.current.contains(R.target)&&c(!1)};return document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[Z]),r.useEffect(()=>{if(!w)return;const i=R=>{le.current&&!le.current.contains(R.target)&&z(!1)};return document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[w]),r.useEffect(()=>{if(!F)return;const i=R=>{Se.current&&!Se.current.contains(R.target)&&q(!1)};return document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[F]);const G=r.useMemo(()=>s.find(i=>i.id===p),[s,p]),ve=r.useMemo(()=>a.find(i=>i.id===d),[a,d]),Te=p?A[p]:void 0,rt=(Te?.isGitRepo??G?.isGitRepo)!==!1,ot=(Te?.worktreeReady??G?.worktreeReady)!==!1,$=!T&&!(rt&&ot),O=$?"SOLO":v,Y=$?L.MAIN_DIRECTORY:S,at=Y===L.MAIN_DIRECTORY?m("本地模式"):m("工作树模式"),Fe=m("工作树隔离改动,支持 TeamRun、Merge、Rebase 和冲突解决。"),it=m("本地模式会直接修改项目主目录,不会自动提交,也不能使用 Merge、Rebase 或冲突解决。"),ct=Te?.reason??G?.reason,qe=m(ct==="NO_HEAD"?"已检测到 Git,但需要先提交一次才能使用工作树模式。":"初始化 Git 后可使用工作树模式。"),Ge=T||O==="SOLO"?ve?.agentType:null,J=yn({agentType:Ge,workingDir:T?void 0:G?.repoPath,input:N,setInput:_,textareaRef:_e,minHeight:76,maxHeight:220}),P=x!=="idle",We=!!K||H.length>0,me=!P&&!be&&N.trim().length>0&&(T?!!d:!!p&&(O==="SOLO"?!!d:We));r.useEffect(()=>{$&&(j("SOLO"),M(L.MAIN_DIRECTORY),Q(!1),q(!1))},[$]),r.useEffect(()=>{$||T||M(L.WORKTREE)},[T,$,G?.id]);const lt=r.useCallback(async()=>{if(!G||de.isPending)return;const i=await de.mutateAsync({id:G.id});B(R=>({...R,[G.id]:i})),i.worktreeReady&&(j("SOLO"),M(L.WORKTREE),q(!1))},[de,G]),Ee=r.useCallback(async()=>{if(!me)return;const i=E?ze():"",R=E?$e().map(ue=>ue.id):[];try{await l({title:N.trim(),description:"",projectId:T?"":p,providerId:d,mode:T?"SOLO":O,workspaceMode:!T&&O==="SOLO"?Y:L.WORKTREE,teamRunMode:T?"AUTO":D,teamTemplateId:T||$?null:K,memberPresetIds:T||$?[]:H,attachmentLinks:i,attachmentIds:R}),_(""),E&&Pe()}catch{}},[me,E,ze,$e,l,N,T,p,d,O,Y,D,$,K,H,Pe]),dt=r.useCallback(i=>{J.handleKeyDown(i)||i.key==="Enter"&&!i.shiftKey&&!i.nativeEvent.isComposing&&i.nativeEvent.keyCode!==229&&(i.preventDefault(),Ee())},[Ee,J]),mt=r.useCallback(i=>{const R=i.target.files;R&&R.length>0&&oe(Array.from(R)),i.target.value=""},[oe]),ut=r.useCallback(i=>{I(i),g?.(i),c(!1)},[g]),pt=r.useCallback(i=>{if(!E)return;const R=i.clipboardData.items,ue=[];for(const Ue of R)if(Ue.kind==="file"){const Ke=Ue.getAsFile();Ke&&ue.push(Ke)}ue.length>0&&(i.preventDefault(),oe(ue))},[oe,E]),[Be,Me]=r.useState(!1),ft=r.useCallback(i=>{E&&(i.preventDefault(),Me(!0))},[E]),xt=r.useCallback(i=>{E&&(i.preventDefault(),Me(!1))},[E]),ht=r.useCallback(i=>{if(!E)return;i.preventDefault(),Me(!1);const R=i.dataTransfer.files;R.length>0&&oe(Array.from(R))},[oe,E]);return e.jsxs("div",{className:"w-full",children:[e.jsxs("div",{ref:Le,className:k("relative bg-background rounded-xl border transition-colors duration-200","shadow-[0_1px_2px_rgba(0,0,0,0.05)]","hover:border-ring/40 focus-within:border-ring/60",Be?"border-info bg-info/5":"border-border",P&&"opacity-80"),onDragOver:E?ft:void 0,onDragLeave:E?xt:void 0,onDrop:E?ht:void 0,children:[E&&Oe.length>0&&e.jsx("div",{className:"px-4 pt-3",children:e.jsx(St,{files:Oe,onRemove:nt})}),e.jsx("textarea",{ref:_e,value:N,onChange:i=>_(i.target.value),onKeyDown:dt,onPaste:E?pt:void 0,placeholder:m(y||"Describe your task..."),disabled:P,autoFocus:!0,rows:1,className:"w-full px-4 pt-4 pb-2 bg-transparent border-none focus:outline-none resize-none text-[15px] text-foreground placeholder:text-muted-foreground/80 leading-relaxed",style:{minHeight:"76px",maxHeight:"220px",fieldSizing:"content"}}),E&&Be&&e.jsx("div",{className:"px-4 pb-2",children:e.jsx("div",{className:"flex items-center justify-center py-3 border border-dashed border-info/40 rounded-lg text-xs font-medium text-info",children:m("Drop files here")})}),e.jsxs("div",{className:"flex items-center justify-between px-2 pb-2 pt-1",children:[e.jsx("div",{className:"flex items-center gap-1",children:E?e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",onClick:()=>De.current?.click(),disabled:P||be,className:"p-2 text-muted-foreground hover:text-foreground hover:bg-accent rounded-lg transition-colors disabled:opacity-40 disabled:cursor-not-allowed",title:m("Attach files"),children:e.jsx(Rt,{size:18})}),e.jsx("input",{ref:De,type:"file",multiple:!0,onChange:mt,className:"hidden"})]}):null}),e.jsxs("div",{className:"flex items-center gap-2",children:[E&&be&&e.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[e.jsx(xe,{size:14,className:"animate-spin"}),m("Uploading...")]}),P&&e.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[e.jsx(xe,{size:14,className:"animate-spin"}),m(n??wn[x])]}),!T&&!P&&!be&&O==="TEAM"&&!We&&N.trim().length>0&&e.jsx("span",{className:"text-[11px] text-warning",children:m("请选择团队模板或追加成员")}),me&&e.jsxs("span",{className:"hidden sm:inline-flex items-center gap-1 text-[11px] text-muted-foreground/80 select-none",children:[e.jsx("kbd",{className:"inline-flex items-center justify-center min-w-[18px] h-[18px] px-1 rounded border border-border bg-muted/60 text-[10px] font-medium text-muted-foreground leading-none",children:"⏎"}),st]}),e.jsx("button",{type:"button",onClick:Ee,disabled:!me,className:k("flex items-center justify-center size-8 rounded-lg transition-all duration-200",me?"bg-primary text-primary-foreground hover:bg-primary/90 shadow-sm":"bg-muted text-muted-foreground/40 cursor-not-allowed"),title:m(b||"Create & Start"),children:e.jsx(_t,{size:16,strokeWidth:2.5})})]})]})]}),e.jsx(rn,{open:!!Ge&&J.query!==null,anchorRef:Le,commands:J.filteredCommands,selectedIndex:J.selectedIndex,query:J.query??"",hasCatalog:J.allCommands.length>0,compact:!0,onSelect:J.applyCommand}),e.jsxs("div",{className:"flex items-center flex-wrap gap-1.5 mt-2.5 px-0.5",children:[!T&&e.jsxs("div",{className:"relative",ref:V,children:[e.jsxs("button",{type:"button",onClick:()=>{P||c(i=>!i)},disabled:P,className:k("flex items-center gap-1.5 px-2 h-7 rounded-md text-xs font-medium transition-colors","hover:bg-accent disabled:opacity-40 disabled:cursor-not-allowed",G?"text-foreground/80":"text-muted-foreground"),children:[e.jsx(Et,{size:14,className:"shrink-0",style:{color:G?.color??"var(--muted-foreground)"}}),e.jsx("span",{className:"max-w-[120px] truncate",children:G?.name??m("Project")}),e.jsx(fe,{size:12,className:k("text-muted-foreground transition-transform",Z&&"rotate-180")})]}),Z&&e.jsx("div",{className:"absolute top-full left-0 mt-1.5 w-56 bg-popover border border-border rounded-lg shadow-[0_4px_12px_rgba(0,0,0,0.06)] py-1 max-h-[240px] overflow-y-auto z-50",children:s.map(i=>e.jsxs("button",{type:"button",onClick:()=>ut(i.id),className:"flex items-center w-full px-3 py-2 text-xs text-left hover:bg-accent transition-colors",children:[e.jsx("span",{className:"size-2 rounded-full shrink-0 mr-2",style:{backgroundColor:i.color??"var(--muted-foreground)"}}),e.jsx("span",{className:k("truncate flex-1",i.id===p?"text-foreground font-medium":"text-muted-foreground"),children:i.name}),e.jsx(se,{size:14,className:k("ml-2 shrink-0 text-foreground",i.id===p?"opacity-100":"opacity-0")})]},i.id))})]}),(T||O==="SOLO")&&e.jsxs("div",{className:"relative",ref:le,children:[e.jsxs("button",{type:"button",onClick:()=>{P||z(i=>!i)},disabled:P,className:k("flex items-center gap-1.5 px-2 h-7 rounded-md text-xs font-medium transition-colors","hover:bg-accent disabled:opacity-40 disabled:cursor-not-allowed",ve?"text-foreground/80":"text-muted-foreground"),children:[e.jsx(pe,{agentType:ve?.agentType,className:"size-3.5"}),e.jsx("span",{className:"max-w-[120px] truncate",children:ve?.name??m(o?"Loading...":"Agent")}),e.jsx(fe,{size:12,className:k("text-muted-foreground transition-transform",w&&"rotate-180")})]}),w&&e.jsx("div",{className:"absolute top-full left-0 mt-1.5 w-56 bg-popover border border-border rounded-lg shadow-[0_4px_12px_rgba(0,0,0,0.06)] py-1 max-h-[240px] overflow-y-auto z-50",children:a.map(i=>e.jsxs("button",{type:"button",disabled:!i.available,onClick:()=>{h(i.id),z(!1)},className:k("flex items-center w-full px-3 py-2 text-xs text-left hover:bg-accent transition-colors",!i.available&&"opacity-40 cursor-not-allowed"),children:[e.jsx(se,{size:14,className:k("mr-2 shrink-0 text-foreground",i.id===d?"opacity-100":"opacity-0")}),e.jsx(pe,{agentType:i.agentType,className:"mr-2 size-3.5"}),e.jsxs("span",{className:k("min-w-0 truncate",i.id===d?"text-foreground font-medium":"text-muted-foreground"),children:[i.name,i.available?"":m(" (unavailable)")]})]},i.id))})]}),!T&&O==="SOLO"&&e.jsxs("div",{className:"relative",ref:Se,children:[e.jsxs("button",{type:"button",onClick:()=>{P||q(i=>!i)},disabled:P,className:k("flex items-center gap-1.5 px-2 h-7 rounded-md text-xs font-medium transition-colors","hover:bg-accent disabled:opacity-40 disabled:cursor-not-allowed text-foreground/80"),children:[e.jsx(zt,{size:14,className:"text-muted-foreground"}),e.jsx("span",{className:"max-w-[96px] truncate",children:at}),e.jsx(fe,{size:12,className:k("text-muted-foreground transition-transform",F&&"rotate-180")})]}),F&&e.jsxs("div",{className:"absolute top-full left-0 mt-1.5 w-72 max-w-[calc(100vw-2rem)] bg-popover border border-border rounded-lg shadow-[0_4px_12px_rgba(0,0,0,0.06)] py-1 z-50",children:[$?e.jsx(Ae,{side:"bottom",className:"block w-full",content:qe,children:e.jsxs("div",{tabIndex:0,"aria-label":qe,className:"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/60",children:[e.jsxs("button",{type:"button",disabled:!0,className:"flex w-full cursor-not-allowed items-center px-3 py-2 text-left text-xs opacity-40 transition-colors",children:[e.jsx(se,{size:14,className:"mr-2 mt-0.5 shrink-0 text-foreground opacity-0"}),e.jsxs("span",{className:"min-w-0 flex-1",children:[e.jsx("span",{className:"block truncate text-muted-foreground",children:m("工作树模式")}),e.jsx("span",{className:"mt-0.5 block whitespace-normal text-[11px] leading-snug text-muted-foreground/80",children:Fe})]})]}),e.jsx("button",{type:"button",onClick:lt,disabled:de.isPending,className:"flex w-full items-center px-3 py-2 text-left text-xs text-muted-foreground transition-colors hover:bg-accent disabled:cursor-not-allowed disabled:opacity-50",children:de.isPending?m("检测中..."):m("重新检测 Git 状态")})]})}):e.jsxs("button",{type:"button",onClick:()=>{M(L.WORKTREE),q(!1)},className:"flex w-full items-center px-3 py-2 text-left text-xs transition-colors hover:bg-accent",children:[e.jsx(se,{size:14,className:k("mr-2 mt-0.5 shrink-0 text-foreground",Y===L.WORKTREE?"opacity-100":"opacity-0")}),e.jsxs("span",{className:"min-w-0 flex-1",children:[e.jsx("span",{className:k("block truncate",Y===L.WORKTREE?"text-foreground font-medium":"text-muted-foreground"),children:m("工作树模式")}),e.jsx("span",{className:"mt-0.5 block whitespace-normal text-[11px] leading-snug text-muted-foreground/80",children:Fe})]})]}),e.jsxs("button",{type:"button",onClick:()=>{M(L.MAIN_DIRECTORY),q(!1)},className:"flex items-start w-full px-3 py-2 text-xs text-left hover:bg-accent transition-colors",children:[e.jsx(se,{size:14,className:k("mr-2 mt-0.5 shrink-0 text-foreground",Y===L.MAIN_DIRECTORY?"opacity-100":"opacity-0")}),e.jsxs("span",{className:"min-w-0 flex-1",children:[e.jsx("span",{className:k("block truncate",Y===L.MAIN_DIRECTORY?"text-foreground font-medium":"text-muted-foreground"),children:m("本地模式")}),e.jsx("span",{className:"mt-0.5 block whitespace-normal text-[11px] leading-snug text-muted-foreground/80",children:it})]})]})]})]}),!T&&e.jsx(Ae,{side:"bottom",className:"ml-auto",content:$?m("Local projects only support local Solo tasks. Initialize Git to use worktrees and TeamRun."):Y===L.MAIN_DIRECTORY?m("TeamRun 需要工作树模式。开启团队模式时会自动切换为工作树模式。"):m("启用 TeamRun 后可选择团队模板或成员。"),children:e.jsxs("button",{type:"button",role:"switch","aria-checked":O==="TEAM",onClick:()=>{P||$||(v==="TEAM"?(j("SOLO"),Q(!1)):(j("TEAM"),q(!1),M(L.WORKTREE),Q(!0)))},disabled:P||$,className:k("flex items-center gap-2 h-7 pl-2 pr-2 rounded-md text-xs font-medium transition-colors","hover:bg-accent disabled:opacity-40 disabled:cursor-not-allowed","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",O==="TEAM"?"text-foreground/80":"text-muted-foreground"),"aria-label":m("启用团队模式"),children:[e.jsx(kt,{size:14,className:O==="TEAM"?"text-foreground/80":"text-muted-foreground"}),e.jsx("span",{children:m("团队模式")}),($||Y===L.MAIN_DIRECTORY)&&O!=="TEAM"?e.jsx(Ct,{size:12,className:"text-muted-foreground/70","aria-hidden":"true"}):null,e.jsx("span",{className:k("relative inline-flex h-4 w-7 shrink-0 items-center rounded-full transition-colors",O==="TEAM"?"bg-primary":"bg-border"),children:e.jsx("span",{className:k("inline-block size-3 rounded-full bg-background shadow-sm transition-transform",O==="TEAM"?"translate-x-3.5":"translate-x-0.5")})})]})})]}),!T&&O==="TEAM"&&re&&e.jsx("div",{className:"mt-2.5 rounded-xl border border-border/60 bg-muted/40 p-3 animate-[fadeInUp_0.25s_cubic-bezier(0.16,1,0.3,1)]",children:e.jsx(nn,{mode:D,setMode:U,selectedTemplateId:K,setSelectedTemplateId:te,selectedMemberPresetIds:H,setSelectedMemberPresetIds:ne,disabled:P,compact:!0})})]})}export{_n as A,Hn as B,Qn as C,zt as G,Bn as P,qn as R,On as S,Gn as T,Kt as Z,Un as a,Pn as b,_t as c,Dn as d,zn as e,nn as f,Fn as g,Kn as h,dn as i,yn as j,$n as k,rn as l,Wt as m,Wn as u};
@@ -1 +0,0 @@
1
- import{U as a,V as n}from"./index-hPp73HMS.js";const t=(r,o)=>a.lang.round(n.parse(r)[o]);export{t as c};
@@ -1 +0,0 @@
1
- import{k as c}from"./index-BGajgi5H.js";const e=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],t=c("check",e);export{t as C};
@@ -1 +0,0 @@
1
- import{s as a,c as s,a as e,C as t}from"./chunk-727SXJPM-BgL49Dtw.js";import{_ as i}from"./index-hPp73HMS.js";import"./chunk-FMBD7UC4-BZtRjoH7.js";import"./chunk-ND2GUHAM-CN3wND6y.js";import"./chunk-55IACEB6-DQ-XuWbD.js";import"./chunk-2J33WTMH-GJE6LCGS.js";import"./index-BGajgi5H.js";var n={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{n as diagram};
@@ -1 +0,0 @@
1
- import{s as a,c as s,a as e,C as t}from"./chunk-727SXJPM-BgL49Dtw.js";import{_ as i}from"./index-hPp73HMS.js";import"./chunk-FMBD7UC4-BZtRjoH7.js";import"./chunk-ND2GUHAM-CN3wND6y.js";import"./chunk-55IACEB6-DQ-XuWbD.js";import"./chunk-2J33WTMH-GJE6LCGS.js";import"./index-BGajgi5H.js";var n={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{n as diagram};
@@ -1 +0,0 @@
1
- import{conf as i,language as t}from"./typescript-CvtjMxoq.js";import"./monaco-CbFQByO7.js";import"./ProjectKanbanPage-DK3rZJzY.js";import"./index-BGajgi5H.js";import"./mermaid-NOHMQCX5-CzwPLFrI.js";import"./chevron-right-CBoUSXVq.js";import"./chevron-down-CpKODb7Y.js";import"./confirm-dialog-DDWlvtJs.js";import"./modal-QnCJhV9P.js";import"./Icons-BFOphLw-.js";import"./CreateTaskInput-B11wGhDW.js";import"./AgentLogo-Dyqxcj5s.js";import"./check-FwR4dMNY.js";import"./use-projects-iob5C7Xk.js";import"./MemberAvatar-1UlgMZMM.js";import"./use-providers-Cj9S9_2q.js";import"./trash-2-DPxBnxJM.js";import"./useNormalizedLogs-BhN4AN4f.js";import"./folder-picker-CBVEWiuS.js";import"./circle-alert-kELlE07n.js";import"./message-square-DgdFa1Kc.js";import"./layers-WOwm63Fo.js";import"./chevron-up-KZ1hsL8y.js";import"./select-CmbeAAVh.js";import"./textarea-D4HkYa3u.js";import"./server-BUivqMYo.js";import"./upload-YmLtnZsU.js";import"./arrow-left-Jn-v17JF.js";import"./pencil-CNVU3zfM.js";const B=i,C={defaultToken:"invalid",tokenPostfix:".js",keywords:["break","case","catch","class","continue","const","constructor","debugger","default","delete","do","else","export","extends","false","finally","for","from","function","get","if","import","in","instanceof","let","new","null","return","set","static","super","switch","symbol","this","throw","true","try","typeof","undefined","var","void","while","with","yield","async","await","of"],typeKeywords:[],operators:t.operators,symbols:t.symbols,escapes:t.escapes,digits:t.digits,octaldigits:t.octaldigits,binarydigits:t.binarydigits,hexdigits:t.hexdigits,regexpctl:t.regexpctl,regexpesc:t.regexpesc,tokenizer:t.tokenizer};export{B as conf,C as language};
@@ -1 +0,0 @@
1
- import{s as e,b as r,a,S as s}from"./chunk-AQP2D5EJ-dRTVohoy.js";import{_ as i}from"./index-hPp73HMS.js";import"./chunk-55IACEB6-DQ-XuWbD.js";import"./chunk-2J33WTMH-GJE6LCGS.js";import"./index-BGajgi5H.js";var p={parser:a,get db(){return new s(2)},renderer:r,styles:e,init:i(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};export{p as diagram};