agent-tower 0.7.0-beta.0 → 0.7.0-beta.2

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 (150) hide show
  1. package/dist/runtime/acp/acp-driver.d.ts.map +1 -1
  2. package/dist/runtime/acp/acp-driver.js +25 -2
  3. package/dist/runtime/acp/acp-driver.js.map +1 -1
  4. package/dist/services/__tests__/member-heartbeat-scheduler.test.js +29 -0
  5. package/dist/services/__tests__/member-heartbeat-scheduler.test.js.map +1 -1
  6. package/dist/services/__tests__/team-member-admission-barrier.test.d.ts +2 -0
  7. package/dist/services/__tests__/team-member-admission-barrier.test.d.ts.map +1 -0
  8. package/dist/services/__tests__/team-member-admission-barrier.test.js +51 -0
  9. package/dist/services/__tests__/team-member-admission-barrier.test.js.map +1 -0
  10. package/dist/services/__tests__/team-reconciler.service.test.js +115 -0
  11. package/dist/services/__tests__/team-reconciler.service.test.js.map +1 -1
  12. package/dist/services/__tests__/team-scheduler.service.test.js +87 -0
  13. package/dist/services/__tests__/team-scheduler.service.test.js.map +1 -1
  14. package/dist/services/member-heartbeat-scheduler.d.ts +11 -0
  15. package/dist/services/member-heartbeat-scheduler.d.ts.map +1 -1
  16. package/dist/services/member-heartbeat-scheduler.js +31 -2
  17. package/dist/services/member-heartbeat-scheduler.js.map +1 -1
  18. package/dist/services/session-manager.d.ts.map +1 -1
  19. package/dist/services/session-manager.js +1 -1
  20. package/dist/services/session-manager.js.map +1 -1
  21. package/dist/services/team-member-admission-barrier.d.ts +23 -1
  22. package/dist/services/team-member-admission-barrier.d.ts.map +1 -1
  23. package/dist/services/team-member-admission-barrier.js +68 -2
  24. package/dist/services/team-member-admission-barrier.js.map +1 -1
  25. package/dist/services/team-reconciler.service.d.ts +20 -2
  26. package/dist/services/team-reconciler.service.d.ts.map +1 -1
  27. package/dist/services/team-reconciler.service.js +112 -20
  28. package/dist/services/team-reconciler.service.js.map +1 -1
  29. package/dist/services/team-scheduler.service.d.ts +7 -0
  30. package/dist/services/team-scheduler.service.d.ts.map +1 -1
  31. package/dist/services/team-scheduler.service.js +15 -5
  32. package/dist/services/team-scheduler.service.js.map +1 -1
  33. package/dist/web/assets/{AgentDemoPage-Cb99MrCc.js → AgentDemoPage-DP9u0ylA.js} +1 -1
  34. package/dist/web/assets/{AgentEnvironmentSettingsPage-ebCjwkrN.js → AgentEnvironmentSettingsPage-B571SLF5.js} +1 -1
  35. package/dist/web/assets/{AgentLogo-DonTQxM9.js → AgentLogo-VGcaaJum.js} +1 -1
  36. package/dist/web/assets/ConversationPage-CbMlQ5UC.js +3 -0
  37. package/dist/web/assets/CreateTaskInput-kkWy5nmc.js +1 -0
  38. package/dist/web/assets/{DemoPage-Bgivi3Ks.js → DemoPage-CpMV8Rv7.js} +1 -1
  39. package/dist/web/assets/{GeneralSettingsPage-DvMYB2cP.js → GeneralSettingsPage-BvME4SJc.js} +1 -1
  40. package/dist/web/assets/{Icons-CjfPc49M.js → Icons-DXzgw2xT.js} +1 -1
  41. package/dist/web/assets/{LoadingPreviewPage-CYzE_rah.js → LoadingPreviewPage-D6OzaV9-.js} +1 -1
  42. package/dist/web/assets/{McpSettingsPage-D5OEjiw4.js → McpSettingsPage-CCWuZ-IU.js} +1 -1
  43. package/dist/web/assets/{MemberAvatar-CK6Kg4RE.js → MemberAvatar-DeKYSBH9.js} +1 -1
  44. package/dist/web/assets/{NotificationSettingsPage-G7b4V0bX.js → NotificationSettingsPage-BOhJqIXv.js} +1 -1
  45. package/dist/web/assets/{ProfileSettingsPage-nKzInN5R.js → ProfileSettingsPage-BEMuDjhF.js} +1 -1
  46. package/dist/web/assets/{ProjectKanbanPage-BbRguX0a.js → ProjectKanbanPage-Ka243_RU.js} +5 -5
  47. package/dist/web/assets/{ProjectSettingsPage-B_uG_eME.js → ProjectSettingsPage-sE0Thu7d.js} +1 -1
  48. package/dist/web/assets/{ProviderSettingsPage-Yhr6QSK3.js → ProviderSettingsPage-BCXTXcbc.js} +1 -1
  49. package/dist/web/assets/{SettingsMasterDetail-fY_-qGyA.js → SettingsMasterDetail-DmqYixrL.js} +1 -1
  50. package/dist/web/assets/{TeamSettingsPage-C3bS2GiK.js → TeamSettingsPage-Dxk7-1fD.js} +1 -1
  51. package/dist/web/assets/{arc-BO0W2mHj.js → arc-Bl7tPfS7.js} +1 -1
  52. package/dist/web/assets/{architectureDiagram-3BPJPVTR-C3cEkBBe.js → architectureDiagram-3BPJPVTR-CoP7qomY.js} +1 -1
  53. package/dist/web/assets/{arrow-left-KfI6LIDH.js → arrow-left-4_9exfZH.js} +1 -1
  54. package/dist/web/assets/{blockDiagram-GPEHLZMM-DWXMs31a.js → blockDiagram-GPEHLZMM-Dyj3wCtX.js} +1 -1
  55. package/dist/web/assets/{c4Diagram-AAUBKEIU-Br4Xlw_Z.js → c4Diagram-AAUBKEIU-BHpYwHH5.js} +1 -1
  56. package/dist/web/assets/channel-D6ei4By-.js +1 -0
  57. package/dist/web/assets/check-CIGH6GLr.js +1 -0
  58. package/dist/web/assets/{chevron-down-BeBVnkqU.js → chevron-down-B8PIP1yU.js} +1 -1
  59. package/dist/web/assets/{chevron-right-Q1Dgt2I3.js → chevron-right-h-JkCAHM.js} +1 -1
  60. package/dist/web/assets/{chevron-up-D2HXcF3G.js → chevron-up-C5SQd6qy.js} +1 -1
  61. package/dist/web/assets/{chunk-2J33WTMH-BX5SFZtu.js → chunk-2J33WTMH--mm3IA_q.js} +1 -1
  62. package/dist/web/assets/{chunk-4BX2VUAB-CQvYESAm.js → chunk-4BX2VUAB-DSTjg6vT.js} +1 -1
  63. package/dist/web/assets/{chunk-55IACEB6-D9YFdDf3.js → chunk-55IACEB6-BMI8DRl6.js} +1 -1
  64. package/dist/web/assets/{chunk-727SXJPM-BUCrEURW.js → chunk-727SXJPM-DB6yt8nI.js} +1 -1
  65. package/dist/web/assets/{chunk-AQP2D5EJ-C8ERMAty.js → chunk-AQP2D5EJ-BMFO2BIQ.js} +1 -1
  66. package/dist/web/assets/{chunk-FMBD7UC4-CzEZabFM.js → chunk-FMBD7UC4-BWW53Tgv.js} +1 -1
  67. package/dist/web/assets/{chunk-ND2GUHAM-Dw35tn0f.js → chunk-ND2GUHAM-3Q1rz4Rn.js} +1 -1
  68. package/dist/web/assets/{chunk-QZHKN3VN-CR7z6_1v.js → chunk-QZHKN3VN-DHZfBhTv.js} +1 -1
  69. package/dist/web/assets/{circle-alert-Dwtt3OAP.js → circle-alert-B2WJJFVc.js} +1 -1
  70. package/dist/web/assets/classDiagram-4FO5ZUOK-Dy0gEbpJ.js +1 -0
  71. package/dist/web/assets/classDiagram-v2-Q7XG4LA2-Dy0gEbpJ.js +1 -0
  72. package/dist/web/assets/{code-block-OCS4YCEC-CAzJ3mQn.js → code-block-OCS4YCEC-DAvNvPo_.js} +1 -1
  73. package/dist/web/assets/{confirm-dialog-BcfJ2Xus.js → confirm-dialog-59aNupkb.js} +1 -1
  74. package/dist/web/assets/{cose-bilkent-S5V4N54A-CUXR9dk3.js → cose-bilkent-S5V4N54A-BkBXPAOW.js} +1 -1
  75. package/dist/web/assets/{cssMode-BpC8I4Ek.js → cssMode-r4PsUEeI.js} +1 -1
  76. package/dist/web/assets/{dagre-BM42HDAG-Dhy7S5s1.js → dagre-BM42HDAG-0o3tAN58.js} +1 -1
  77. package/dist/web/assets/{diagram-2AECGRRQ-DIR5PGZF.js → diagram-2AECGRRQ-BaozWVAC.js} +1 -1
  78. package/dist/web/assets/{diagram-5GNKFQAL-DzXKfh_N.js → diagram-5GNKFQAL-BQGxsEX-.js} +1 -1
  79. package/dist/web/assets/{diagram-KO2AKTUF-us7dQ7xA.js → diagram-KO2AKTUF-BhOfCrvE.js} +1 -1
  80. package/dist/web/assets/{diagram-LMA3HP47-BjK9ExKN.js → diagram-LMA3HP47-1C0Ajian.js} +1 -1
  81. package/dist/web/assets/{diagram-OG6HWLK6-BTx88v4L.js → diagram-OG6HWLK6-BZsvylQi.js} +1 -1
  82. package/dist/web/assets/{erDiagram-TEJ5UH35-8rgd6uCk.js → erDiagram-TEJ5UH35-BODPoCQX.js} +1 -1
  83. package/dist/web/assets/{flowDiagram-I6XJVG4X-C47DsydX.js → flowDiagram-I6XJVG4X-B0BsMsro.js} +1 -1
  84. package/dist/web/assets/{folder-picker-NzVodD5j.js → folder-picker-B5RdK3CX.js} +1 -1
  85. package/dist/web/assets/{freemarker2-Gzu5EJMh.js → freemarker2-B62GnwxO.js} +1 -1
  86. package/dist/web/assets/{ganttDiagram-6RSMTGT7-B7qxtFDa.js → ganttDiagram-6RSMTGT7-BsXOoMru.js} +1 -1
  87. package/dist/web/assets/{gitGraphDiagram-PVQCEYII-DtXsV-rD.js → gitGraphDiagram-PVQCEYII-DVuq4oVA.js} +1 -1
  88. package/dist/web/assets/{handlebars-3Znn7m4J.js → handlebars-BBm4KBDp.js} +1 -1
  89. package/dist/web/assets/{html-Dgt18Ofs.js → html-BlMJourI.js} +1 -1
  90. package/dist/web/assets/{htmlMode-C2t1O0sW.js → htmlMode-vGjPTlal.js} +1 -1
  91. package/dist/web/assets/{index-BVh0eL1_.js → index-BziFEuBL.js} +4 -4
  92. package/dist/web/assets/{index--1agBpnq.js → index-DfRNL5pP.js} +4 -4
  93. package/dist/web/assets/index-KjsBZlkg.css +1 -0
  94. package/dist/web/assets/{infoDiagram-5YYISTIA-AQRMJJ6t.js → infoDiagram-5YYISTIA-CkI-s2fN.js} +1 -1
  95. package/dist/web/assets/{ishikawaDiagram-YF4QCWOH-CTcfBywF.js → ishikawaDiagram-YF4QCWOH-DExbu0jt.js} +1 -1
  96. package/dist/web/assets/javascript-CnnNs3bZ.js +1 -0
  97. package/dist/web/assets/{journeyDiagram-JHISSGLW-CRv0PNLh.js → journeyDiagram-JHISSGLW-C03_8hib.js} +1 -1
  98. package/dist/web/assets/{jsonMode-DQPoQ9kR.js → jsonMode-SxmrKu-q.js} +1 -1
  99. package/dist/web/assets/{kanban-definition-UN3LZRKU-AcoPh0xh.js → kanban-definition-UN3LZRKU-CkQ5JqTm.js} +1 -1
  100. package/dist/web/assets/{layers-DePAliGw.js → layers-DVjF8vaY.js} +1 -1
  101. package/dist/web/assets/{linear-GlxaBVoM.js → linear-VXyesiU2.js} +1 -1
  102. package/dist/web/assets/{liquid-Dr6EmgCe.js → liquid-B_CJMcDS.js} +1 -1
  103. package/dist/web/assets/{lspLanguageFeatures-DN91604C.js → lspLanguageFeatures-D46XQnYj.js} +1 -1
  104. package/dist/web/assets/{mdx-JG8OT2YG.js → mdx-B2i6poYS.js} +1 -1
  105. package/dist/web/assets/mermaid-NOHMQCX5-Cxj8y3xL.js +125 -0
  106. package/dist/web/assets/{message-square-DWgJpKCx.js → message-square-BleDaJqD.js} +1 -1
  107. package/dist/web/assets/{mindmap-definition-RKZ34NQL-DGrhHpUO.js → mindmap-definition-RKZ34NQL-OB13sryT.js} +1 -1
  108. package/dist/web/assets/{modal-CORyqdln.js → modal-DCycqy3L.js} +1 -1
  109. package/dist/web/assets/{monaco-ORn-kQwM.js → monaco-C5uCiSc1.js} +3 -3
  110. package/dist/web/assets/{pencil-B1BeYe1f.js → pencil-7Lu7CiFO.js} +1 -1
  111. package/dist/web/assets/{pieDiagram-4H26LBE5-BX2kHm8X.js → pieDiagram-4H26LBE5-CU-pnTSj.js} +1 -1
  112. package/dist/web/assets/{python-v-kAqpdQ.js → python-CdqaVxbU.js} +1 -1
  113. package/dist/web/assets/{quadrantDiagram-W4KKPZXB-D8kpdSHK.js → quadrantDiagram-W4KKPZXB-yZ7s-n8V.js} +1 -1
  114. package/dist/web/assets/{razor-1mzCjQ7_.js → razor-BZtfxDHk.js} +1 -1
  115. package/dist/web/assets/{requirementDiagram-4Y6WPE33-BeCKrFYk.js → requirementDiagram-4Y6WPE33-B0anLb96.js} +1 -1
  116. package/dist/web/assets/{sankeyDiagram-5OEKKPKP-BhppOHK-.js → sankeyDiagram-5OEKKPKP-DHcV9eve.js} +1 -1
  117. package/dist/web/assets/{select-C0_GwcaL.js → select-EnAkHFwg.js} +1 -1
  118. package/dist/web/assets/{sequenceDiagram-3UESZ5HK-kd48NbrY.js → sequenceDiagram-3UESZ5HK-DqgRRD9W.js} +1 -1
  119. package/dist/web/assets/{server-ezmEd1Bn.js → server-a_4ZRCwE.js} +1 -1
  120. package/dist/web/assets/{stateDiagram-AJRCARHV-BVEJJ862.js → stateDiagram-AJRCARHV-BM_vAe4X.js} +1 -1
  121. package/dist/web/assets/stateDiagram-v2-BHNVJYJU-DXSW0BBn.js +1 -0
  122. package/dist/web/assets/{switch-DTs2bsdf.js → switch-D_UoJD1K.js} +1 -1
  123. package/dist/web/assets/{textarea-DDugro1C.js → textarea-Cmy7-X_E.js} +1 -1
  124. package/dist/web/assets/{timeline-definition-PNZ67QCA-DSTFfNuv.js → timeline-definition-PNZ67QCA-BRstBzgi.js} +1 -1
  125. package/dist/web/assets/{trash-2-0qxC5GZF.js → trash-2-0UA8zJ8I.js} +1 -1
  126. package/dist/web/assets/{tsMode-BiIcawoi.js → tsMode-BASXySxT.js} +1 -1
  127. package/dist/web/assets/{typescript-ChINO0ge.js → typescript-DbOfWuuq.js} +1 -1
  128. package/dist/web/assets/{upload-Bvn4pVZf.js → upload-CfzBeWxL.js} +1 -1
  129. package/dist/web/assets/{use-profiles-DQpUUzXs.js → use-profiles-MVQfFrhT.js} +1 -1
  130. package/dist/web/assets/{use-projects-BQB2BPEN.js → use-projects-CJ8Wn6Xl.js} +1 -1
  131. package/dist/web/assets/{use-providers--I6m_J5h.js → use-providers-DvV0mdqo.js} +1 -1
  132. package/dist/web/assets/{useNormalizedLogs-BB31QSMo.js → useNormalizedLogs-D8-yjxOI.js} +1 -1
  133. package/dist/web/assets/{vennDiagram-CIIHVFJN-CQ8tm8nY.js → vennDiagram-CIIHVFJN-DzhupKpF.js} +1 -1
  134. package/dist/web/assets/{wardley-L42UT6IY-DKg1J16d.js → wardley-L42UT6IY-BwWhS3dk.js} +1 -1
  135. package/dist/web/assets/{wardleyDiagram-YWT4CUSO-DnqGz1sa.js → wardleyDiagram-YWT4CUSO-iG6xXnIJ.js} +1 -1
  136. package/dist/web/assets/{xml-YFMD1O7m.js → xml-Dn2Ep0JI.js} +1 -1
  137. package/dist/web/assets/{xychartDiagram-2RQKCTM6-BTCVgq8k.js → xychartDiagram-2RQKCTM6-hgKK9aU8.js} +1 -1
  138. package/dist/web/assets/{yaml-pAIxoEG3.js → yaml-CA2Cgl3R.js} +1 -1
  139. package/dist/web/index.html +2 -2
  140. package/package.json +1 -1
  141. package/dist/web/assets/ConversationPage-Bd1WHiCB.js +0 -3
  142. package/dist/web/assets/CreateTaskInput-C9aO7QVE.js +0 -1
  143. package/dist/web/assets/channel-TREDjZBM.js +0 -1
  144. package/dist/web/assets/check-VbbiSgv8.js +0 -1
  145. package/dist/web/assets/classDiagram-4FO5ZUOK-C8tJPglt.js +0 -1
  146. package/dist/web/assets/classDiagram-v2-Q7XG4LA2-C8tJPglt.js +0 -1
  147. package/dist/web/assets/index-CVgeXPf_.css +0 -1
  148. package/dist/web/assets/javascript-BfysNn1k.js +0 -1
  149. package/dist/web/assets/mermaid-NOHMQCX5-Cc97ICqZ.js +0 -122
  150. package/dist/web/assets/stateDiagram-v2-BHNVJYJU-aOH6_7W_.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--1agBpnq.js";import{p as Bt}from"./chunk-4BX2VUAB-CQvYESAm.js";import{p as Rt}from"./wardley-L42UT6IY-DKg1J16d.js";import"./index-BVh0eL1_.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-DfRNL5pP.js";import{p as Bt}from"./chunk-4BX2VUAB-DSTjg6vT.js";import{p as Rt}from"./wardley-L42UT6IY-BwWhS3dk.js";import"./index-BziFEuBL.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-ORn-kQwM.js";import"./ProjectKanbanPage-BbRguX0a.js";import"./index-BVh0eL1_.js";import"./mermaid-NOHMQCX5-Cc97ICqZ.js";import"./chevron-right-Q1Dgt2I3.js";import"./chevron-down-BeBVnkqU.js";import"./confirm-dialog-BcfJ2Xus.js";import"./modal-CORyqdln.js";import"./Icons-CjfPc49M.js";import"./CreateTaskInput-C9aO7QVE.js";import"./AgentLogo-DonTQxM9.js";import"./check-VbbiSgv8.js";import"./use-projects-BQB2BPEN.js";import"./MemberAvatar-CK6Kg4RE.js";import"./use-providers--I6m_J5h.js";import"./trash-2-0qxC5GZF.js";import"./useNormalizedLogs-BB31QSMo.js";import"./folder-picker-NzVodD5j.js";import"./circle-alert-Dwtt3OAP.js";import"./message-square-DWgJpKCx.js";import"./layers-DePAliGw.js";import"./chevron-up-D2HXcF3G.js";import"./select-C0_GwcaL.js";import"./textarea-DDugro1C.js";import"./server-ezmEd1Bn.js";import"./upload-Bvn4pVZf.js";import"./arrow-left-KfI6LIDH.js";import"./pencil-B1BeYe1f.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-C5uCiSc1.js";import"./ProjectKanbanPage-Ka243_RU.js";import"./index-BziFEuBL.js";import"./mermaid-NOHMQCX5-Cxj8y3xL.js";import"./chevron-right-h-JkCAHM.js";import"./chevron-down-B8PIP1yU.js";import"./confirm-dialog-59aNupkb.js";import"./modal-DCycqy3L.js";import"./Icons-DXzgw2xT.js";import"./CreateTaskInput-kkWy5nmc.js";import"./AgentLogo-VGcaaJum.js";import"./check-CIGH6GLr.js";import"./use-projects-CJ8Wn6Xl.js";import"./MemberAvatar-DeKYSBH9.js";import"./use-providers-DvV0mdqo.js";import"./trash-2-0UA8zJ8I.js";import"./useNormalizedLogs-D8-yjxOI.js";import"./folder-picker-B5RdK3CX.js";import"./circle-alert-B2WJJFVc.js";import"./message-square-BleDaJqD.js";import"./layers-DVjF8vaY.js";import"./chevron-up-C5SQd6qy.js";import"./select-EnAkHFwg.js";import"./textarea-Cmy7-X_E.js";import"./server-a_4ZRCwE.js";import"./upload-CfzBeWxL.js";import"./arrow-left-4_9exfZH.js";import"./pencil-7Lu7CiFO.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--1agBpnq.js";import{i as _i}from"./init-Gi6I4Gst.js";import{o as ki}from"./ordinal-Cboi1Yqb.js";import{l as zt}from"./linear-GlxaBVoM.js";import"./index-BVh0eL1_.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-DfRNL5pP.js";import{i as _i}from"./init-Gi6I4Gst.js";import{o as ki}from"./ordinal-Cboi1Yqb.js";import{l as zt}from"./linear-VXyesiU2.js";import"./index-BziFEuBL.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-ORn-kQwM.js";import"./ProjectKanbanPage-BbRguX0a.js";import"./index-BVh0eL1_.js";import"./mermaid-NOHMQCX5-Cc97ICqZ.js";import"./chevron-right-Q1Dgt2I3.js";import"./chevron-down-BeBVnkqU.js";import"./confirm-dialog-BcfJ2Xus.js";import"./modal-CORyqdln.js";import"./Icons-CjfPc49M.js";import"./CreateTaskInput-C9aO7QVE.js";import"./AgentLogo-DonTQxM9.js";import"./check-VbbiSgv8.js";import"./use-projects-BQB2BPEN.js";import"./MemberAvatar-CK6Kg4RE.js";import"./use-providers--I6m_J5h.js";import"./trash-2-0qxC5GZF.js";import"./useNormalizedLogs-BB31QSMo.js";import"./folder-picker-NzVodD5j.js";import"./circle-alert-Dwtt3OAP.js";import"./message-square-DWgJpKCx.js";import"./layers-DePAliGw.js";import"./chevron-up-D2HXcF3G.js";import"./select-C0_GwcaL.js";import"./textarea-DDugro1C.js";import"./server-ezmEd1Bn.js";import"./upload-Bvn4pVZf.js";import"./arrow-left-KfI6LIDH.js";import"./pencil-B1BeYe1f.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-C5uCiSc1.js";import"./ProjectKanbanPage-Ka243_RU.js";import"./index-BziFEuBL.js";import"./mermaid-NOHMQCX5-Cxj8y3xL.js";import"./chevron-right-h-JkCAHM.js";import"./chevron-down-B8PIP1yU.js";import"./confirm-dialog-59aNupkb.js";import"./modal-DCycqy3L.js";import"./Icons-DXzgw2xT.js";import"./CreateTaskInput-kkWy5nmc.js";import"./AgentLogo-VGcaaJum.js";import"./check-CIGH6GLr.js";import"./use-projects-CJ8Wn6Xl.js";import"./MemberAvatar-DeKYSBH9.js";import"./use-providers-DvV0mdqo.js";import"./trash-2-0UA8zJ8I.js";import"./useNormalizedLogs-D8-yjxOI.js";import"./folder-picker-B5RdK3CX.js";import"./circle-alert-B2WJJFVc.js";import"./message-square-BleDaJqD.js";import"./layers-DVjF8vaY.js";import"./chevron-up-C5SQd6qy.js";import"./select-EnAkHFwg.js";import"./textarea-Cmy7-X_E.js";import"./server-a_4ZRCwE.js";import"./upload-CfzBeWxL.js";import"./arrow-left-4_9exfZH.js";import"./pencil-7Lu7CiFO.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,8 +5,8 @@
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-BVh0eL1_.js"></script>
9
- <link rel="stylesheet" crossorigin href="/assets/index-CVgeXPf_.css">
8
+ <script type="module" crossorigin src="/assets/index-BziFEuBL.js"></script>
9
+ <link rel="stylesheet" crossorigin href="/assets/index-KjsBZlkg.css">
10
10
  </head>
11
11
  <body>
12
12
  <div id="root"></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-tower",
3
- "version": "0.7.0-beta.0",
3
+ "version": "0.7.0-beta.2",
4
4
  "description": "AI Agent Task Management Dashboard",
5
5
  "repository": {
6
6
  "type": "git",
@@ -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 p,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-BVh0eL1_.js";import{u as _e,b as $e,A as Ve,S as D}from"./mermaid-NOHMQCX5-Cc97ICqZ.js";import{u as Ge,a as He,T as We,P as Je}from"./useNormalizedLogs-BB31QSMo.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-C9aO7QVE.js";import{u as lt}from"./use-providers--I6m_J5h.js";import{M as pe}from"./message-square-DWgJpKCx.js";import{A as ct}from"./arrow-left-KfI6LIDH.js";import{T as dt}from"./trash-2-0qxC5GZF.js";import"./chevron-right-Q1Dgt2I3.js";import"./chevron-down-BeBVnkqU.js";import"./check-VbbiSgv8.js";import"./AgentLogo-DonTQxM9.js";import"./use-projects-BQB2BPEN.js";import"./MemberAvatar-CK6Kg4RE.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:o,sessionEndedAt:g,agentType:S,runtimeType:j,providerId:u,providers:y,initialTokenUsage:h,onProviderChange:N,onSend:w,onStop:E,onExit:O,isSending:A=!1,isStopping:a=!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:i,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:o,sessionEndedAt:g,onExit:O}),{todos:H}=He(te),he=Xe(k,h),{files:se,addFiles:L,removeFile:ne,clear:re,buildMarkdownLinks:ae,getDoneAttachments:oe,hasFiles:R,isUploading:s}=_e(),{isActive:l,isCancelling:c}=Ze(t,n),x=m??l;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||a||c||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,a,c,s,ae,oe,re,ge,w,F,B,T,f]),Ee=r.useCallback(async()=>{!x||a||c||await E()},[x,a,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(l?"Waiting for agent output...":"No logs recorded for this session.")}):e.jsx($e,{logs:k,downloadSessionId:t,isOutputActive:Q,lastExitAt:xe,onUserToggleDetails:fe})})}),!i&&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&&!l?"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:he}),x&&l&&!I.trim()&&!R?e.jsx("button",{type:"button",onClick:Ee,disabled:a||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||a||c,className:v("rounded-lg p-2 transition-all duration-200",(I.trim()||R)&&!s&&!A&&!a&&!c?"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:p.conversations.list({limit:t}),queryFn:()=>$.get("/conversations",{params:{limit:String(t)}})})}function ht(t){return Ce({queryKey:p.conversations.detail(t??""),queryFn:()=>$.get(`/conversations/${t}`),enabled:!!t})}function pt(){const t=W();return de({mutationFn:n=>$.post("/conversations",n),onSuccess:n=>{t.setQueryData(p.conversations.detail(n.id),n),t.invalidateQueries({queryKey:p.conversations.all}),t.invalidateQueries({queryKey:p.sessions.detail(n.sessionId)})}})}function gt(){const t=W();return de({mutationFn:({id:n,...o})=>$.post(`/conversations/${n}/message`,o),onSuccess:n=>{t.setQueryData(p.conversations.detail(n.id),n),t.invalidateQueries({queryKey:p.conversations.all}),t.invalidateQueries({queryKey:p.sessions.detail(n.sessionId)})}})}function bt(){const t=W();return de({mutationFn:n=>$.post(`/conversations/${n}/stop`),onSuccess:n=>{t.setQueryData(p.conversations.detail(n.id),n),t.invalidateQueries({queryKey:p.conversations.all}),t.invalidateQueries({queryKey:p.sessions.detail(n.sessionId)})}})}function vt(){const t=W();return de({mutationFn:n=>$.delete(`/conversations/${n}`),onSuccess:(n,o)=>{t.removeQueries({queryKey:p.conversations.detail(o)}),t.invalidateQueries({queryKey:p.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(([o,g])=>[o,typeof g=="number"?g:Number(g)]).filter(o=>Number.isFinite(o[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 o=new Date(n).getTime();return Number.isFinite(o)?o:0}function Nt(t=yt){const[,n]=r.useState(0);r.useEffect(()=>{const o=setInterval(()=>n(g=>g+1),t);return()=>clearInterval(o)},[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 o=Math.max(0,Math.floor((Date.now()-n.getTime())/1e3));return o<60?ie("{count}s ago",{count:o}):o<3600?ie("{count}m ago",{count:Math.floor(o/60)}):o<86400?ie("{count}h ago",{count:Math.floor(o/3600)}):ie("{count}d ago",{count:Math.floor(o/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:o,onDelete:g,disabled:S,unread:j}){const{t:u}=ce(),y=Ae(t.lastActiveAt??t.createdAt),h=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:o,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(pe,{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}),h?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:o,onSelectConversation:g}){const{t:S}=ce(),[j,u]=r.useState(""),[y,h]=r.useState(0),N=r.useRef(null);r.useEffect(()=>{t&&(u(""),h(0))},[t]);const w=r.useMemo(()=>{const a=j.trim().toLowerCase();return a?n.filter(m=>m.title.toLowerCase().includes(a)).slice(0,50):n.slice(0,12)},[n,j]);r.useEffect(()=>{h(0)},[j]),r.useEffect(()=>{N.current?.children[y]?.scrollIntoView({block:"nearest"})},[y]);const E=r.useCallback(a=>{g(a),o()},[o,g]),O=r.useCallback(a=>{if(a.key==="Escape"){a.preventDefault(),o();return}if(a.key==="ArrowDown"){a.preventDefault(),h(m=>Math.min(m+1,w.length-1));return}if(a.key==="ArrowUp"){a.preventDefault(),h(m=>Math.max(m-1,0));return}if(a.key==="Enter"&&!a.nativeEvent.isComposing){a.preventDefault();const m=w[y];m&&E(m)}},[y,E,o,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:o}),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:a=>u(a.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((a,m)=>e.jsxs("button",{type:"button",onClick:()=>E(a),onMouseEnter:()=>h(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(pe,{size:14,className:"shrink-0 text-muted-foreground"}),e.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-foreground/90",title:a.title,children:a.title}),e.jsx("span",{className:"shrink-0 text-xs tabular-nums text-muted-foreground/60",children:Ae(a.lastActiveAt??a.createdAt)})]},a.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:o,desktopPlatform:g,hasMacTrafficLights:S}=Fe(),j=o&&g==="win32",{conversationId:u}=Ke(),y=W(),[h,N]=r.useState(""),[w,E]=r.useState("idle"),[O,A]=r.useState(null),[a,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}=ht(u),{data:P=[],isLoading:X}=lt(),me=pt(),M=gt(),G=bt(),Z=vt(),i=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||a,Q=r.useCallback(s=>{y.invalidateQueries({queryKey:p.conversations.all}),s&&y.invalidateQueries({queryKey:p.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 l=Math.max(Date.now(),Ne(s));z(c=>{if(c[s.id]&&c[s.id]>=l)return c;const x={...c,[s.id]:l};return je(x),x})},[]),te=r.useCallback(s=>{K(l=>{if(l.has(s))return l;const c=new Set(l);return c.add(s),c})},[]),B=r.useCallback(s=>{K(l=>{if(!l.has(s))return l;const c=new Set(l);return c.delete(s),c}),z(l=>{if(!(s in l))return l;const c={...l};return delete c[s],je(c),c})},[]),H=r.useMemo(()=>{const s=new Map;for(const l of C)s.set(l.sessionId,l);return i&&s.set(i.sessionId,i),s},[i,C]),he=r.useCallback(s=>s.status!==D.COMPLETED?!1:F.has(s.id)?!0:Ne(s)>(I[s.id]??0),[I,F]);r.useEffect(()=>{!h&&T.length>0&&N(T[0].provider.id)},[T,h]),r.useEffect(()=>{i?.providerId&&N(i.providerId)},[i?.providerId]),r.useEffect(()=>{u&&m(!1)},[u]),r.useEffect(()=>{i&&k(i)},[i,k]),r.useEffect(()=>{const s=Ue.connect(),l=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,l),()=>{s.off(ye.SESSION_COMPLETED,l)}},[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 l=await me.mutateAsync({prompt:s.title.trim(),providerId:s.providerId,attachmentIds:s.attachmentIds});N(s.providerId),m(!1),n(`/conversations/${l.id}`)}catch(l){A(l instanceof Error?l.message:t("Failed to start. Please try again."))}finally{E("idle")}}},ae=async s=>{!i||!s.message.trim()||M.isPending||await M.mutateAsync({id:i.id,message:s.message,providerId:s.providerId||h||void 0,attachmentIds:s.attachmentIds})},oe=async()=>{!i||!le(i.status)||G.isPending||await G.mutateAsync(i.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",o&&"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",o&&"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",a?"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(pe,{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&&he(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||a?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:i?.title??t("New Conversation")}),i?e.jsxs("div",{className:"mt-0.5 truncate text-xs text-muted-foreground",children:[wt(i.status,t),i.directoryName?` · ${i.directoryName}`:""]}):null]})]})}),!i&&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")}):i?e.jsx(ft,{sessionId:i.sessionId,sessionStatus:i.status,sessionStartedAt:i.createdAt,sessionEndedAt:le(i.status)?null:i.lastActiveAt??i.updatedAt,agentType:i.agentType,runtimeType:i.runtimeType,providerId:h||i.providerId,providers:P,initialTokenUsage:i.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:h,createStep:w,placeholder:"Ask a question...",submitLabel:"Start",pendingLabel:"Starting...",submitTitle:"Start",onSubmit:async({title:s,providerId:l,attachmentIds:c})=>{await re({title:s,providerId:l,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 z,p as ce,t as gt,a9 as bt,m as Je,r as o,U as vt,V as ae,u as ge,j as e,P as xe,l as k,ae as He,Y as yt,D as Nt,E as wt,Z as Qe,X as kt,z as Ct,af as jt,ag as St}from"./index-BVh0eL1_.js";import{S as Ve,T as Ae,R as ie,h as ye,W as L,u as Tt,A as Et}from"./mermaid-NOHMQCX5-Cc97ICqZ.js";import{A as pe}from"./AgentLogo-DonTQxM9.js";import{C as fe}from"./chevron-down-BeBVnkqU.js";import{C as se}from"./check-VbbiSgv8.js";import{d as Mt,F as It}from"./use-projects-BQB2BPEN.js";import{M as Ye}from"./MemberAvatar-CK6Kg4RE.js";import{u as Rt}from"./use-providers--I6m_J5h.js";import{P as At}from"./trash-2-0qxC5GZF.js";import{P as Lt}from"./useNormalizedLogs-BB31QSMo.js";const _t=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],On=X("arrow-down",_t);const Dt=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],Ot=X("arrow-up",Dt);const Pt=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],zt=X("gauge",Pt);const qt=[["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"}]],$t=X("git-branch",qt);const Ft=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Pn=X("search",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"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],Wt=X("shield-alert",Gt);const Bt=[["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"}]],Ut=X("shield",Bt);const Kt=[["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"}]],zn=X("square-pen",Kt);const Ht=[["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"}]],Qt=X("zap",Ht);function et(t){const n=he(),a=Je({queryKey:z.sessions.runtime(t),queryFn:()=>ce.get(`/sessions/${t}/runtime`),enabled:!!t});return o.useEffect(()=>{if(!t)return;const r=vt.connect(),c=g=>{g.sessionId===t&&n.invalidateQueries({queryKey:z.sessions.runtime(t)})},u=g=>{g.sessionId===t&&n.setQueryData(z.sessions.runtime(t),g.state)},f=()=>{n.invalidateQueries({queryKey:z.sessions.runtime(t)})};return r.on(ae.SESSION_PERMISSION_REQUESTED,c),r.on(ae.SESSION_PERMISSION_INVALIDATED,c),r.on(ae.SESSION_RUNTIME_STATE_CHANGED,u),r.on("connect",f),()=>{r.off(ae.SESSION_PERMISSION_REQUESTED,c),r.off(ae.SESSION_PERMISSION_INVALIDATED,c),r.off(ae.SESSION_RUNTIME_STATE_CHANGED,u),r.off("connect",f)}},[t,n]),a}function Vt(t){return t==="RUNNING"||t==="AWAITING_PERMISSION"||t==="CANCELLING"}function Yt(t){return t===Ve.RUNNING||t===Ve.PENDING}function qn(t,n){const{data:a}=et(t);return{runtimeState:a,isActive:Yt(n)||Vt(a?.turnState),isCancelling:a?.turnState==="CANCELLING"}}function Xt(){const t=he();return ke({mutationFn:({sessionId:n,requestId:a,optionId:r})=>ce.post(`/sessions/${n}/permissions/${a}/resolve`,{optionId:r}),onSettled:(n,a,r)=>{t.invalidateQueries({queryKey:z.sessions.runtime(r.sessionId)})}})}function $n(){const t=he();return ke({mutationFn:n=>ce.post(`/sessions/${n}/start`),onSuccess:(n,a)=>{t.invalidateQueries({queryKey:z.sessions.detail(a)}),t.invalidateQueries({queryKey:z.tasks.all})}})}function Fn(){const t=he();return ke({mutationFn:n=>ce.post(`/sessions/${n}/stop`),onError:n=>{gt.error(bt("Failed to stop session. Refreshing status; check it and try again."),{description:n instanceof Error?n.message:void 0})},onSettled:(n,a,r)=>{t.setQueryData(z.sessions.runtime(r),c=>c?.turnState==="CANCELLING"?{...c,turnState:"IDLE"}:c),Promise.allSettled([t.invalidateQueries({queryKey:z.sessions.detail(r)}),t.invalidateQueries({queryKey:z.sessions.runtime(r)}),t.invalidateQueries({queryKey:z.workspaces.all}),t.invalidateQueries({queryKey:z.tasks.all})])}})}function Gn(){const t=he();return ke({mutationFn:({id:n,message:a,providerId:r})=>ce.post(`/sessions/${n}/message`,{message:a,providerId:r}),onSuccess:()=>{t.invalidateQueries({queryKey:z.workspaces.all}),t.invalidateQueries({queryKey:z.tasks.all})}})}function Wn({sessionId:t,compact:n=!1}){const{t:a}=ge(),{data:r}=et(t),c=Xt(),u=r?.pendingPermissions[0],f=u?.requestId,g=c.reset;return o.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",n&&"px-2.5 py-2"),children:e.jsxs("div",{className:"flex min-w-0 items-start gap-2",children:[e.jsx(Wt,{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:c.isPending,onClick:()=>c.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:[c.isPending&&c.variables?.requestId===u.requestId&&c.variables.optionId===x.optionId?e.jsx(xe,{className:"h-3.5 w-3.5 animate-spin","aria-hidden":"true"}):null,x.name]},x.optionId))}),c.error?e.jsx("div",{className:"mt-1.5 text-xs text-destructive",role:"alert",children:c.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 Zt(t){return t>=.9?"text-red-500":t>=.7?"text-amber-500":"text-neutral-400"}function Bn({usage:t,tooltipSide:n="top"}){const{t:a}=ge();if(!t)return null;const r=t.modelContextWindow,c=r?t.totalTokens/r:0,u=r?Math.min(Math.round(c*100),100):null,f=r?Zt(c):"text-neutral-400",g=r?e.jsx("span",{children:a("上下文: {used} / {max} tokens",{used:Ne(t.totalTokens),max:Ne(r)})}):e.jsx("span",{children:a("已使用: {used} tokens",{used:Ne(t.totalTokens)})});return e.jsx(Ae,{content:g,side:n,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(zt,{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 Jt={damping:.7,stiffness:.05,mass:1.25},en=70,tn=1e3/60,nn=350;let Ce=!1;globalThis.document?.addEventListener("mousedown",()=>{Ce=!0});globalThis.document?.addEventListener("mouseup",()=>{Ce=!1});globalThis.document?.addEventListener("click",()=>{Ce=!1});const Un=(t={})=>{const[n,a]=o.useState(!1),[r,c]=o.useState(t.initial!==!1),[u,f]=o.useState(!1),g=o.useRef(null);g.current=t;const x=o.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=o.useCallback(d=>{s.isAtBottom=d,c(d)},[]),C=o.useCallback(d=>{s.escapedFromLock=d,a(d)},[]),s=o.useMemo(()=>{let d;return{escapedFromLock:n,isAtBottom:r,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,s.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<=en}}},[]),b=o.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=s.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(!s.isAtBottom)return s.animation=void 0,!1;const{scrollTop:D}=s,U=performance.now(),K=(U-(s.lastTick??U))/tn;if(s.animation||(s.animation={behavior:v,promise:B,ignoreEscapes:j}),s.animation.behavior===v&&(s.lastTick=U),x()||h>Date.now())return A();if(D<Math.min(M,s.calculatedTargetScrollTop)){if(s.animation?.behavior===v){if(v==="instant")return s.scrollTop=s.calculatedTargetScrollTop,A();s.velocity=(v.damping*s.velocity+v.stiffness*s.scrollDifference)/v.mass,s.accumulated+=s.velocity*K,s.scrollTop+=s.accumulated,s.scrollTop!==D&&(s.accumulated=0)}return A()}return S>Date.now()?(M=s.calculatedTargetScrollTop,A()):(s.animation=void 0,s.scrollTop<s.calculatedTargetScrollTop?b({animation:Re(g.current,g.current.resize),ignoreEscapes:j,duration:Math.max(0,S-Date.now())||void 0}):s.isAtBottom)});return B.then(D=>(requestAnimationFrame(()=>{s.animation||(s.lastTick=void 0,s.velocity=0)}),D))};return d.wait!==!0&&(s.animation=void 0),s.animation?.behavior===v?s.animation.promise:A()},[y,x,s]),m=o.useCallback(()=>{C(!0),y(!1)},[C,y]),N=o.useCallback(({target:d})=>{if(d!==p.current)return;const{scrollTop:h,ignoreScrollToTop:v}=s;let{lastScrollTop:j=h}=s;s.lastScrollTop=h,s.ignoreScrollToTop=void 0,v&&v>h&&(j=v),f(s.isNearBottom),setTimeout(()=>{if(s.resizeDifference||h===v)return;if(x()){C(!0),y(!1);return}const S=h>j,M=h<j;if(s.animation?.ignoreEscapes){s.scrollTop=j;return}M&&(C(!0),y(!1)),S&&C(!1),!s.escapedFromLock&&s.isNearBottom&&y(!0)},1)},[C,y,x,s]),_=o.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&&!s.animation?.ignoreEscapes&&(C(!0),y(!1))},[C,y,s]),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(s.resizeObserver?.disconnect(),!d)return;let h;s.resizeObserver=new ResizeObserver(([v])=>{const{height:j}=v.contentRect,S=j-(h??j);if(s.resizeDifference=S,s.scrollTop>s.targetScrollTop&&(s.scrollTop=s.targetScrollTop),f(s.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:nn})}else s.isNearBottom&&(C(!1),y(!0));h=j,requestAnimationFrame(()=>{setTimeout(()=>{s.resizeDifference===S&&(s.resizeDifference=0)},1)})}),s.resizeObserver?.observe(d)},[]);return{contentRef:I,scrollRef:p,scrollToBottom:b,stopScroll:m,isAtBottom:r||u,isNearBottom:u,escapedFromLock:n,state:s}};function Xe(t,n){const a=o.useCallback(r=>(a.current=r,t(r)),n);return a}const Ie=new Map;function Re(...t){const n={...Jt};let a=!1;for(const c of t){if(c==="instant"){a=!0;continue}typeof c=="object"&&(a=!1,n.damping=c.damping??n.damping,n.stiffness=c.stiffness??n.stiffness,n.mass=c.mass??n.mass)}const r=JSON.stringify(n);return Ie.has(r)||Ie.set(r,Object.freeze(n)),a?"instant":Ie.get(r)}function Kn({providers:t,currentProviderId:n,agentType:a,runtimeType:r,onSelect:c}){const{t:u}=ge(),[f,g]=o.useState(!1),x=o.useRef(null),y=r===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),s=t.find(b=>b.provider.id===n);return o.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:s?.provider.agentType??a,className:"size-3.5"}),e.jsx("span",{className:"min-w-0 truncate",children:s?.provider.name?He(s.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: ${s?.provider.name??a} (click to change)`,children:[e.jsx(pe,{agentType:s?.provider.agentType??a,className:"size-3.5"}),e.jsx("span",{className:"min-w-0 truncate",children:s?.provider.name?He(s.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:()=>{c(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===n?"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===n&&e.jsx(se,{size:14,className:"shrink-0"})]},b.provider.id))]})]})}function Hn(t,n){return o.useMemo(()=>{for(let a=t.length-1;a>=0;a--){const r=t[a];if(r.tokenUsage&&typeof r.tokenUsage.totalTokens=="number"&&r.tokenUsage.totalTokens>0)return{totalTokens:r.tokenUsage.totalTokens,modelContextWindow:r.tokenUsage.modelContextWindow}}return n??null},[t,n])}function Ze(t,n,a,r){if(a.filter(f=>f===r).length<=1)return t;const u=a.slice(0,n+1).filter(f=>f===r).length;return`${t} #${u}`}function sn(t){return Object.values(t).filter(Boolean).length}function rn({mode:t,setMode:n,selectedTemplateId:a,setSelectedTemplateId:r,selectedMemberPresetIds:c,setSelectedMemberPresetIds:u,disabled:f=!1,compact:g=!1}){const{t:x}=ge(),{preserveDesktopSearch:y}=yt(),[C,s]=o.useState(!1),{data:b}=Rt(),{data:m,isError:N,isFetching:_,isLoading:p,refetch:I}=Nt(),{data:d,isError:h,isFetching:v,isLoading:j,refetch:S}=wt(),M=o.useMemo(()=>new Map((b??[]).map(({provider:l,availability:w})=>[l.id,l.name+(w.type==="NOT_FOUND"?x(" (不可用)"):"")])),[b,x]),A=o.useMemo(()=>new Map((m??[]).map(l=>[l.id,l])),[m]),B=o.useMemo(()=>new Map((d??[]).map(l=>[l.id,l])),[d]),D=o.useMemo(()=>c.map(l=>A.get(l)).filter(l=>!!l),[A,c]);o.useEffect(()=>{m!==void 0&&u(l=>{const w=l.filter(q=>A.has(q));return w.length===l.length&&w.every((q,F)=>q===l[F])?l:w})},[m,A,u]),o.useEffect(()=>{d!==void 0&&r(l=>!l||B.has(l)?l:null)},[r,B,d]);const U=l=>{f||r(w=>w===l?null:l)},K=l=>{f||u(w=>[...w,l])},te=l=>{f||u(w=>w.filter((q,F)=>F!==l))},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(l=>{const w=l.id===a,q=l.members?.length??0,F=l.members?.map(V=>V.memberPresetId)??[],G=l.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(l.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:l.name}),e.jsxs("span",{className:"text-[10px] text-muted-foreground shrink-0",children:[q,x("人")]})]}),G&&e.jsx("div",{className:"mt-0.5 text-[10px] text-muted-foreground truncate",children:G})]}),w&&e.jsx(se,{size:13,className:"shrink-0 text-foreground"})]})},l.id)})})]}),ne=D.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1 mb-2",children:D.map((l,w)=>{const q=Ze(l.name,w,c,l.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:l.name,avatar:l.avatar,className:"h-3.5 w-3.5 text-[7px]"}),e.jsx("span",{className:"max-w-[80px] truncate",children:q}),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(kt,{size:9})})]},`${l.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(l=>{const w=c.filter(G=>G===l.id).length,q=M.get(l.providerId)??l.providerId,F=sn(l.capabilities);return e.jsxs("button",{type:"button",onClick:()=>K(l.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:l.name,avatar:l.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:l.name}),e.jsxs("div",{className:"text-[10px] text-muted-foreground truncate",children:[q," · ",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(At,{size:12,className:"text-muted-foreground"})]})]},l.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&&n("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(Qt,{size:11}),x("自动模式")]}),e.jsxs("button",{type:"button",onClick:()=>!f&&n("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(Ut,{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&&s(l=>!l),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 on({commands:t,selectedIndex:n,query:a,hasCatalog:r,title:c="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 s=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:c}),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:r?g??`No matches for ${u}${a}`:f}):e.jsx("div",{className:`${s} ${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 ${_===n?"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 an({open:t,anchorRef:n,commands:a,selectedIndex:r,query:c,hasCatalog:u,title:f,queryPrefix:g,emptyCatalogMessage:x,emptyQueryMessage:y,insertionHint:C,compact:s=!1,onSelect:b}){const m=o.useRef(null),[N,_]=o.useState(null);return o.useLayoutEffect(()=>{if(!t){_(null);return}const p=n.current;if(!p)return;let I=0;const d=()=>{const j=n.current;if(!j)return;const S=j.getBoundingClientRect(),M=window.innerWidth,A=window.innerHeight,B=s?260:320,D=s?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??(s?220:280),re=s?240:320,Q=te<180&&H>te,l=Math.max(120,Math.min(re,Q?H:te)),w=Q?Math.max(ee,S.top-we-Math.min(ne,l)):Math.min(A-ee-Math.min(ne,l),S.bottom+we);_({top:w,left:K,width:U,maxHeight:l})},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)}},[n,a.length,s,t,c,r]),!t||!N||typeof document>"u"?null:Ct.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(on,{commands:a,selectedIndex:r,query:c,hasCatalog:u,title:f,queryPrefix:g,emptyCatalogMessage:x,emptyQueryMessage:y,insertionHint:C,compact:s,onSelect:b})})}),document.body)}function cn({agentType:t,workingDir:n}){return Je({queryKey:z.system.slashCommandCatalog(t,n),queryFn:async()=>(await ce.get("/system/slash-command-catalog",{params:{agentType:String(t),...n?{workingDir:n}:{}}})).commands,enabled:!!t,staleTime:3e4})}function ln(t,n){const a=new Set,r=[];for(const c of[...t,...n]){const u=c.command.trim().toLowerCase();!u||a.has(u)||(a.add(u),r.push(c.kind?c:{...c,kind:"builtin"}))}return r}function je(t){return t.trim().toLowerCase().replace(/^[/$]/,"")}function dn(t){return je(t.command)}function mn(t,n){if(!n)return 1e3;const a=dn(t),r=t.aliases?.map(je)??[],c=[a,...r];let u=0;for(const g of c)g===n?u=Math.max(u,500):g.startsWith(n)?u=Math.max(u,400-(g.length-n.length)):g.includes(n)&&(u=Math.max(u,250-g.indexOf(n)));return u>0?u:`${a} ${r.join(" ")} ${t.description}`.toLowerCase().includes(n)?100:0}function Qn(t){const n=/(^|[\s])\$([^\s]*)$/.exec(t);if(!n||n.index===void 0)return null;const a=n.index+n[1].length;return{query:je(n[2]),replaceStart:a}}function un(t,n){const a=je(n);return a?t.map((r,c)=>({command:r,index:c,score:mn(r,a)})).filter(r=>r.score>0).sort((r,c)=>c.score-r.score||r.index-c.index||r.command.command.localeCompare(c.command.command)).map(r=>r.command):t.slice()}const pn=[{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"}],fn=[{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"}],xn=[{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"}],hn=[{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"}],gn={[ye.CODEX]:pn,[ye.CLAUDE_CODE]:fn,[ye.GEMINI_CLI]:xn,[ye.CURSOR_AGENT]:hn};function tt(t){return t.trim().toLowerCase().replace(/^\//,"")}function bn(t){return t?(gn[t]??[]).map(n=>({...n,kind:n.kind??"builtin"})):[]}function vn(t){const n=t.match(/^\s*\/([^\s]*)$/);return n?tt(n[1]):null}function yn(t,n){return un(t,tt(n))}function Nn(t){const n=t.key==="Enter"&&!t.shiftKey&&!t.repeat&&!t.nativeEvent.isComposing&&t.nativeEvent.keyCode!==229,a=t.key==="Tab"&&!t.shiftKey;return n||a}function wn({agentType:t,workingDir:n,input:a,setInput:r,textareaRef:c,minHeight:u,maxHeight:f}){const[g,x]=o.useState(0),{data:y=[]}=cn({agentType:t,workingDir:n}),C=o.useMemo(()=>ln(bn(t),y),[t,y]),s=o.useMemo(()=>vn(a),[a]),b=o.useMemo(()=>s===null?[]:yn(C,s),[C,s]),m=o.useCallback(()=>{const p=c.current;p&&(p.style.height="auto",p.style.height=`${Math.max(u,Math.min(p.scrollHeight,f))}px`)},[f,u,c]);o.useEffect(()=>{x(0)},[t,s]),o.useEffect(()=>{g<b.length||x(0)},[b.length,g]);const N=o.useCallback(p=>{const d=`${a.match(/^(\s*)\/[^\s]*$/)?.[1]??""}${p.command} `;r(d),requestAnimationFrame(()=>{const h=c.current;h&&(m(),h.focus(),h.setSelectionRange(d.length,d.length))})},[a,m,r,c]),_=o.useCallback(p=>s===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):Nn(p)?(p.preventDefault(),N(b[g]??b[0]),!0):!1,[N,b,s,g]);return{allCommands:C,query:s,filteredCommands:b,selectedIndex:g,setSelectedIndex:x,applyCommand:N,handleKeyDown:_}}const kn="/assets/agent-tower-lockup-DPAcheCt.png";function Vn({className:t="h-6 w-auto max-[359px]:h-[22px]"}){return e.jsx("img",{src:kn,alt:"Agent Tower",className:`block shrink-0 select-none object-contain ${t}`})}const Cn={idle:"","creating-task":"Creating Task...","creating-teamrun":"Creating TeamRun...","creating-workspace":"Creating Workspace...","creating-session":"Creating Session...","starting-session":"Starting Agent..."};function Yn({variant:t="task",projects:n,providers:a,isProvidersLoading:r,onSubmit:c,defaultProjectId:u="",defaultProviderId:f="",onProjectChange:g,createStep:x,placeholder:y,submitLabel:C,pendingLabel:s,submitTitle:b}){const{t:m}=ge(),[N,_]=o.useState(""),[p,I]=o.useState(u),[d,h]=o.useState(f),[v,j]=o.useState("SOLO"),[S,M]=o.useState(L.WORKTREE),[A,B]=o.useState({}),[D,U]=o.useState("AUTO"),[K,te]=o.useState(null),[H,ne]=o.useState([]),[re,Q]=o.useState(!1),[Z,l]=o.useState(!1),[w,q]=o.useState(!1),[F,G]=o.useState(!1),V=o.useRef(null),le=o.useRef(null),Se=o.useRef(null),Le=o.useRef(null),_e=o.useRef(null),De=o.useRef(null),{files:Oe,addFiles:oe,removeFile:nt,clear:Pe,buildMarkdownLinks:ze,getDoneAttachments:qe,isUploading:be}=Tt(),de=Mt(),T=t==="conversation",E=t==="task"||t==="conversation",st=C??m(T?"开始":"创建");o.useEffect(()=>{I(u),g?.(u)},[u,g]),o.useEffect(()=>{h(f)},[f]),o.useEffect(()=>{if(!Z)return;const i=R=>{V.current&&!V.current.contains(R.target)&&l(!1)};return document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[Z]),o.useEffect(()=>{if(!w)return;const i=R=>{le.current&&!le.current.contains(R.target)&&q(!1)};return document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[w]),o.useEffect(()=>{if(!F)return;const i=R=>{Se.current&&!Se.current.contains(R.target)&&G(!1)};return document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[F]);const W=o.useMemo(()=>n.find(i=>i.id===p),[n,p]),ve=o.useMemo(()=>a.find(i=>i.id===d),[a,d]),Te=p?A[p]:void 0,rt=(Te?.isGitRepo??W?.isGitRepo)!==!1,ot=(Te?.worktreeReady??W?.worktreeReady)!==!1,$=!T&&!(rt&&ot),O=$?"SOLO":v,Y=$?L.MAIN_DIRECTORY:S,at=Y===L.MAIN_DIRECTORY?m("本地模式"):m("工作树模式"),$e=m("工作树隔离改动,支持 TeamRun、Merge、Rebase 和冲突解决。"),it=m("本地模式会直接修改项目主目录,不会自动提交,也不能使用 Merge、Rebase 或冲突解决。"),ct=Te?.reason??W?.reason,Fe=m(ct==="NO_HEAD"?"已检测到 Git,但需要先提交一次才能使用工作树模式。":"初始化 Git 后可使用工作树模式。"),Ge=T||O==="SOLO"?ve?.agentType:null,J=wn({agentType:Ge,workingDir:T?void 0:W?.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));o.useEffect(()=>{$&&(j("SOLO"),M(L.MAIN_DIRECTORY),Q(!1),G(!1))},[$]),o.useEffect(()=>{$||T||M(L.WORKTREE)},[T,$,W?.id]);const lt=o.useCallback(async()=>{if(!W||de.isPending)return;const i=await de.mutateAsync({id:W.id});B(R=>({...R,[W.id]:i})),i.worktreeReady&&(j("SOLO"),M(L.WORKTREE),G(!1))},[de,W]),Ee=o.useCallback(async()=>{if(!me)return;const i=E?ze():"",R=E?qe().map(ue=>ue.id):[];try{await c({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,qe,c,N,T,p,d,O,Y,D,$,K,H,Pe]),dt=o.useCallback(i=>{J.handleKeyDown(i)||i.key==="Enter"&&!i.shiftKey&&!i.nativeEvent.isComposing&&i.nativeEvent.keyCode!==229&&(i.preventDefault(),Ee())},[Ee,J]),mt=o.useCallback(i=>{const R=i.target.files;R&&R.length>0&&oe(Array.from(R)),i.target.value=""},[oe]),ut=o.useCallback(i=>{I(i),g?.(i),l(!1)},[g]),pt=o.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]=o.useState(!1),ft=o.useCallback(i=>{E&&(i.preventDefault(),Me(!0))},[E]),xt=o.useCallback(i=>{E&&(i.preventDefault(),Me(!1))},[E]),ht=o.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(Et,{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(Lt,{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(s??Cn[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(Ot,{size:16,strokeWidth:2.5})})]})]})]}),e.jsx(an,{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||l(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",W?"text-foreground/80":"text-muted-foreground"),children:[e.jsx(It,{size:14,className:"shrink-0",style:{color:W?.color??"var(--muted-foreground)"}}),e.jsx("span",{className:"max-w-[120px] truncate",children:W?.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:n.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||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",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(r?"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),q(!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||G(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($t,{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:Fe,children:e.jsxs("div",{tabIndex:0,"aria-label":Fe,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:$e})]})]}),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),G(!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:$e})]})]}),e.jsxs("button",{type:"button",onClick:()=>{M(L.MAIN_DIRECTORY),G(!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"),G(!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(jt,{size:14,className:O==="TEAM"?"text-foreground/80":"text-muted-foreground"}),e.jsx("span",{children:m("团队模式")}),($||Y===L.MAIN_DIRECTORY)&&O!=="TEAM"?e.jsx(St,{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(rn,{mode:D,setMode:U,selectedTemplateId:K,setSelectedTemplateId:te,selectedMemberPresetIds:H,setSelectedMemberPresetIds:ne,disabled:P,compact:!0})})]})}export{On as A,Vn as B,Yn as C,$t as G,Kn as P,Wn as R,zn as S,Bn as T,Qt as Z,Hn as a,qn as b,Ot as c,Pn as d,$n as e,rn as f,Gn as g,Qn as h,un as i,wn as j,Fn as k,an as l,Ut as m,Un as u};
@@ -1 +0,0 @@
1
- import{U as a,V as n}from"./index--1agBpnq.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-BVh0eL1_.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-BUCrEURW.js";import{_ as i}from"./index--1agBpnq.js";import"./chunk-FMBD7UC4-CzEZabFM.js";import"./chunk-ND2GUHAM-Dw35tn0f.js";import"./chunk-55IACEB6-D9YFdDf3.js";import"./chunk-2J33WTMH-BX5SFZtu.js";import"./index-BVh0eL1_.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-BUCrEURW.js";import{_ as i}from"./index--1agBpnq.js";import"./chunk-FMBD7UC4-CzEZabFM.js";import"./chunk-ND2GUHAM-Dw35tn0f.js";import"./chunk-55IACEB6-D9YFdDf3.js";import"./chunk-2J33WTMH-BX5SFZtu.js";import"./index-BVh0eL1_.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};