@kabmo-labs/kabmo 0.42.0 → 0.42.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 (195) hide show
  1. package/dist/client/index.html +1 -1
  2. package/dist/client/index.js +592 -593
  3. package/dist/client/static/js/{CsvGrid-20k047ht.js → CsvGrid-g6rek8y9.js} +1 -1
  4. package/dist/client/static/js/{DocxView-qpvhfcmg.js → DocxView-41t9ryws.js} +2 -2
  5. package/dist/client/static/js/{DrawioView-178skky8.js → DrawioView-mfxhfz1h.js} +1 -1
  6. package/dist/client/static/js/{ImageView-460th5qa.js → ImageView-bxqw3t4k.js} +1 -1
  7. package/dist/client/static/js/{LayoutWrapper-5cv0dty8.js → LayoutWrapper-zt14rv9m.js} +2 -2
  8. package/dist/client/static/js/{Modal-wks6p4r5.js → Modal-cm35g20x.js} +10 -10
  9. package/dist/client/static/js/{PdfView-y51g03nr.js → PdfView-bek8k888.js} +1 -1
  10. package/dist/client/static/js/{SessionsView-rsmvn7ks.js → SessionsView-gn53zyn7.js} +1 -1
  11. package/dist/client/static/js/{SheetView-z7yvb05v.js → SheetView-vezssf6b.js} +1 -1
  12. package/dist/client/static/js/{SvgPreview-yehgzhem.js → SvgPreview-f1qaw73k.js} +1 -1
  13. package/dist/client/static/js/{abnfDiagram-O67JEVCF-6zxpcy8b.js → abnfDiagram-O67JEVCF-4qn94h52.js} +1 -1
  14. package/dist/client/static/js/architecture-7GRP2DOG-cagtcfhk.js +1 -0
  15. package/dist/client/static/js/{architectureDiagram-NJMV4G6O-m98sgh3c.js → architectureDiagram-NJMV4G6O-tbewzdya.js} +3 -3
  16. package/dist/client/static/js/{blockDiagram-BEXU5L5S-cp7rervg.js → blockDiagram-BEXU5L5S-njgnwckz.js} +2 -2
  17. package/dist/client/static/js/{c4Diagram-YGBWAQC7-t31recqm.js → c4Diagram-YGBWAQC7-f58pcvbk.js} +1 -1
  18. package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-fy8x3dkx.js → classDiagram-v2-NBCMYWYE-52g73vyw.js} +3 -3
  19. package/dist/client/static/js/{cose-bilkent-JH36ORCC-va7ybm9e.js → cose-bilkent-JH36ORCC-ptdnshzh.js} +1 -1
  20. package/dist/client/static/js/cynefin-OW5HDTMX-6g2ydrss.js +1 -0
  21. package/dist/client/static/js/{cynefinDiagram-VND7K2PF-4k0k429c.js → cynefinDiagram-VND7K2PF-qabfdkzr.js} +1 -1
  22. package/dist/client/static/js/{dagre-6A5THRUB-ykdhxq6t.js → dagre-6A5THRUB-kyf5jetf.js} +2 -2
  23. package/dist/client/static/js/{diagram-22UHCM2B-5nvwx7b6.js → diagram-22UHCM2B-bxrsjtv9.js} +4 -4
  24. package/dist/client/static/js/{diagram-3UASUU5V-hc7zsjgw.js → diagram-3UASUU5V-0f41s00j.js} +1 -1
  25. package/dist/client/static/js/{diagram-ATOU4E4O-97ae07y7.js → diagram-ATOU4E4O-0z1zx9h1.js} +1 -1
  26. package/dist/client/static/js/{diagram-CDSNMT55-b56nnbbs.js → diagram-CDSNMT55-znrmr6bk.js} +3 -3
  27. package/dist/client/static/js/{diagram-MLGK6HIB-37rygr9k.js → diagram-MLGK6HIB-jfe2jhk0.js} +1 -1
  28. package/dist/client/static/js/{diagram-MPIPVDR6-wv3vhhfk.js → diagram-MPIPVDR6-2kaawmwa.js} +1 -1
  29. package/dist/client/static/js/{dockerfile-0efb1z6e.js → dockerfile-12exatm9.js} +1 -1
  30. package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-13fv7vxg.js → ebnfDiagram-ZINNZB2B-s5n37rfp.js} +1 -1
  31. package/dist/client/static/js/{elixir-mabagxwa.js → elixir-szk51ehr.js} +1 -1
  32. package/dist/client/static/js/{elk-276RUBZZ-xam60ktz.js → elk-276RUBZZ-433rd9fp.js} +1 -1
  33. package/dist/client/static/js/{erDiagram-OPXOYQCR-24ctv2ee.js → erDiagram-OPXOYQCR-key6ah0b.js} +2 -2
  34. package/dist/client/static/js/eventmodeling-NTZA5JFV-b774qbn2.js +1 -0
  35. package/dist/client/static/js/flowDiagram-KWPJA3E3-nznq0n36.js +1 -0
  36. package/dist/client/static/js/{ganttDiagram-FUAMR5RP-766a8fqw.js → ganttDiagram-FUAMR5RP-4efkhmca.js} +2 -2
  37. package/dist/client/static/js/gitGraph-4MIJSDKK-b047d6vk.js +1 -0
  38. package/dist/client/static/js/{gitGraphDiagram-X574FWY7-fmwjkgh6.js → gitGraphDiagram-X574FWY7-ac376y2k.js} +1 -1
  39. package/dist/client/static/js/html-tbz83eke.js +1 -0
  40. package/dist/client/static/js/{index-13xbwcbz.js → index-02543wk3.js} +1 -1
  41. package/dist/client/static/js/{index-sx809d6d.js → index-0e9nkc0g.js} +1 -1
  42. package/dist/client/static/js/{index-1c0pnsjd.js → index-0gbj4270.js} +1 -1
  43. package/dist/client/static/js/{index-z6kpc98a.js → index-0pabfaac.js} +1 -1
  44. package/dist/client/static/js/{index-4mstdh41.js → index-1t5ybx9v.js} +1 -1
  45. package/dist/client/static/js/{index-9vdbnvmk.js → index-1y3rzw6b.js} +1 -1
  46. package/dist/client/static/js/{index-qj34r6d0.js → index-38xv8h4t.js} +1 -1
  47. package/dist/client/static/js/{index-4j8rgr4p.js → index-50mdqev0.js} +1 -1
  48. package/dist/client/static/js/{index-zvazj4va.js → index-5jnvz9hw.js} +1 -1
  49. package/dist/client/static/js/{index-97qst4k9.js → index-77t0nvt1.js} +1 -1
  50. package/dist/client/static/js/{index-x7f5ysch.js → index-7a2efrbj.js} +1 -1
  51. package/dist/client/static/js/{index-yvxa7hd8.js → index-82vk27q1.js} +1 -1
  52. package/dist/client/static/js/{index-nbexks3x.js → index-8k7vjp8b.js} +1 -1
  53. package/dist/client/static/js/{index-sq3r1xhf.js → index-8kbp24xg.js} +1 -1
  54. package/dist/client/static/js/{index-zjydzxhm.js → index-b0v6gwym.js} +2 -2
  55. package/dist/client/static/js/{index-grczkttn.js → index-b42t14wk.js} +7 -7
  56. package/dist/client/static/js/{index-13dr1t1r.js → index-cz50ha6x.js} +23 -23
  57. package/dist/client/static/js/{index-8jqawh3r.js → index-dtj73vs1.js} +1 -1
  58. package/dist/client/static/js/{index-7t63akyt.js → index-dzmar8jr.js} +1 -1
  59. package/dist/client/static/js/{index-2x9eqztp.js → index-f33c4paw.js} +1 -1
  60. package/dist/client/static/js/{index-xxe52zrm.js → index-fb6pw9xb.js} +1 -1
  61. package/dist/client/static/js/{index-6ge6gk9w.js → index-gp57dx2v.js} +1 -1
  62. package/dist/client/static/js/{index-2hpy58d0.js → index-gsxebrq9.js} +2 -2
  63. package/dist/client/static/js/{index-czagykbq.js → index-pxtff3ez.js} +2 -2
  64. package/dist/client/static/js/{index-8hgm0abr.js → index-pzvr1699.js} +187 -183
  65. package/dist/client/static/js/{index-dydwcp3n.js → index-r9db1gsf.js} +1 -1
  66. package/dist/client/static/js/{index-b4y5g48d.js → index-raca8tsh.js} +1 -1
  67. package/dist/client/static/js/{index-95en3p3g.js → index-rf29f3fq.js} +4 -4
  68. package/dist/client/static/js/{index-sz3mxjvy.js → index-s4gv0rpk.js} +1 -1
  69. package/dist/client/static/js/{index-a9t9gdew.js → index-v3f7we4n.js} +4 -4
  70. package/dist/client/static/js/{index-ejdnjh5c.js → index-yjmm73jm.js} +1 -1
  71. package/dist/client/static/js/{index-1rxa9zxp.js → index-ykfd2fyj.js} +1 -1
  72. package/dist/client/static/js/{index-4z4ax55k.js → index-yzda8j2d.js} +6 -6
  73. package/dist/client/static/js/{index-vcn1kcpy.js → index-z78bzryw.js} +3 -3
  74. package/dist/client/static/js/{index-tqycj126.js → index-zndbhb9w.js} +1 -1
  75. package/dist/client/static/js/{index-ka2rc2cr.js → index-zs73zwjz.js} +3 -3
  76. package/dist/client/static/js/{index-xe5cqwnf.js → index-zs7sjv6x.js} +1 -1
  77. package/dist/client/static/js/{index-hzwr5fm9.js → index-zw621xez.js} +3 -3
  78. package/dist/client/static/js/info-A6RAGUB7-n495k952.js +1 -0
  79. package/dist/client/static/js/{infoDiagram-VRGFBTTK-tqytmzp1.js → infoDiagram-VRGFBTTK-4e7ej63f.js} +2 -2
  80. package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-rp77ff6m.js → ishikawaDiagram-OU5B5YK6-k3yet1ec.js} +2 -2
  81. package/dist/client/static/js/{journeyDiagram-ZHPQQLJL-c7bxrhf1.js → journeyDiagram-ZHPQQLJL-qe352kyd.js} +2 -2
  82. package/dist/client/static/js/{kanban-definition-PNTS6WVX-j2pxewqq.js → kanban-definition-PNTS6WVX-58hag75n.js} +4 -4
  83. package/dist/client/static/js/{mermaid.core-cqqe1krg.js → mermaid.core-6e89h6vm.js} +2 -2
  84. package/dist/client/static/js/{mindmap-definition-NLK3R4M7-s03k32p9.js → mindmap-definition-NLK3R4M7-ncsam2fm.js} +1 -1
  85. package/dist/client/static/js/one-dark-pro-qmyne0tn.js +1 -0
  86. package/dist/client/static/js/one-light-dj0ecjcj.js +1 -0
  87. package/dist/client/static/js/packet-AYTQ26CC-zajj62z6.js +1 -0
  88. package/dist/client/static/js/{pegDiagram-GJSIUBJH-dfg2j0zc.js → pegDiagram-GJSIUBJH-b5ckc39d.js} +1 -1
  89. package/dist/client/static/js/{perl-5vxax0nr.js → perl-dtn1fccw.js} +1 -1
  90. package/dist/client/static/js/{php-hgrgdq63.js → php-7av78hch.js} +1 -1
  91. package/dist/client/static/js/pie-WAS4IAKB-1ve78y5f.js +1 -0
  92. package/dist/client/static/js/{pieDiagram-5QR66LMP-pshd1j79.js → pieDiagram-5QR66LMP-s4d47ve8.js} +2 -2
  93. package/dist/client/static/js/{quadrantDiagram-O4NWA36T-cvvvmtk2.js → quadrantDiagram-O4NWA36T-zm0ekvjz.js} +1 -1
  94. package/dist/client/static/js/radar-RG4KPBEZ-8rqadb58.js +1 -0
  95. package/dist/client/static/js/railroad-74A4TZTK-v6ppm8dy.js +1 -0
  96. package/dist/client/static/js/railroad-abnf-HS5TGJTU-9j6bae14.js +1 -0
  97. package/dist/client/static/js/railroad-ebnf-LZEXJU2U-56cpyt0g.js +1 -0
  98. package/dist/client/static/js/railroad-peg-WCYAUIDC-yfdmspf4.js +1 -0
  99. package/dist/client/static/js/{railroadDiagram-XR7U4H2S-h53p3sha.js → railroadDiagram-XR7U4H2S-52vdqf53.js} +1 -1
  100. package/dist/client/static/js/{requirementDiagram-PLB6GJNP-bdv2fkxd.js → requirementDiagram-PLB6GJNP-7kf8bmk9.js} +1 -1
  101. package/dist/client/static/js/{ruby-8pxcn21w.js → ruby-s2bqr910.js} +1 -1
  102. package/dist/client/static/js/{rust-j80dxgjg.js → rust-q98kssv3.js} +1 -1
  103. package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-xqnnvmhy.js → sankeyDiagram-IPEJSGJF-bcb9f54a.js} +1 -1
  104. package/dist/client/static/js/{sequenceDiagram-PO4LG4MO-3p67305f.js → sequenceDiagram-PO4LG4MO-76ywvj7g.js} +3 -3
  105. package/dist/client/static/js/{sizeCapture-INFHLROL-f87525h7.js → sizeCapture-INFHLROL-p9bsf5dc.js} +1 -1
  106. package/dist/client/static/js/{stateDiagram-v2-GCMORJYK-e5st1fy3.js → stateDiagram-v2-GCMORJYK-1ecfb3fs.js} +1 -1
  107. package/dist/client/static/js/{swimlanes-2SLR337P-ceghkbez.js → swimlanes-2SLR337P-2pyjr946.js} +1 -1
  108. package/dist/client/static/js/{swimlanesDiagram-TC7HE7FX-vc8hvfya.js → swimlanesDiagram-TC7HE7FX-qr5hdxm4.js} +1 -1
  109. package/dist/client/static/js/{timeline-definition-EJHVYXUP-f7evs443.js → timeline-definition-EJHVYXUP-4csxwmn2.js} +3 -3
  110. package/dist/client/static/js/treeView-Q6P3EWNA-vwpg3wp8.js +1 -0
  111. package/dist/client/static/js/treemap-WGGIJYW6-htfxwd32.js +1 -0
  112. package/dist/client/static/js/{usecaseDiagram-POWQR4AR-0gpn21p7.js → usecaseDiagram-POWQR4AR-0p1jnbsn.js} +7 -7
  113. package/dist/client/static/js/{vennDiagram-UO4OBE2U-4spzy428.js → vennDiagram-UO4OBE2U-y1hgdet4.js} +2 -2
  114. package/dist/client/static/js/{vue-xm1dxpmy.js → vue-cbqm4bed.js} +1 -1
  115. package/dist/client/static/js/wardley-WFR3VGLG-hapfjkzq.js +1 -0
  116. package/dist/client/static/js/{wardleyDiagram-VNRHLVJA-745xr2pa.js → wardleyDiagram-VNRHLVJA-p578yrgm.js} +2 -2
  117. package/dist/client/static/js/{xychartDiagram-PMCCYNJV-7dr9qwx5.js → xychartDiagram-PMCCYNJV-b08b4ah0.js} +3 -3
  118. package/package.json +1 -1
  119. package/src/cli/lib/commands/session.js +12 -1
  120. package/src/client/components/workspace/chat-timeline/MessageItem.tsx +14 -123
  121. package/src/client/components/workspace/chat-timeline/OrchestrationNotice.tsx +214 -0
  122. package/src/client/components/workspace/chat-timeline/UserTurn.test.tsx +126 -0
  123. package/src/client/components/workspace/chat-timeline/UserTurn.tsx +183 -0
  124. package/src/client/components/workspace/chat-timeline/tool-renderers/shared/ToolBody.tsx +3 -3
  125. package/src/client/components/workspace/chat-timeline/tool-renderers/shared/ToolRowActions.tsx +45 -0
  126. package/src/client/components/workspace/chat-timeline/tool-renderers/shared/tool-view.ts +14 -4
  127. package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Card.tsx +2 -12
  128. package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Compact.tsx +42 -38
  129. package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Minimal.tsx +25 -21
  130. package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Trace.tsx +41 -29
  131. package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Tui.tsx +47 -43
  132. package/src/client/components/workspace/chat-timeline/tool-renderers/styles/parity.test.tsx +136 -0
  133. package/src/client/hooks/chat/timeline/composer-modes.ts +10 -7
  134. package/src/client/hooks/chat/timeline/plan-review-republish.test.ts +121 -0
  135. package/src/client/hooks/chat/timeline/plan-review.ts +12 -3
  136. package/src/server/lib/harness/acp/acp-audit.server.ts +1 -1
  137. package/src/server/lib/harness/acp/session-exit.ts +39 -5
  138. package/src/server/lib/harness/acp/session-turns.ts +67 -12
  139. package/src/server/lib/harness/acp/session.test.ts +61 -0
  140. package/src/server/lib/harness/acp/session.ts +15 -25
  141. package/src/server/lib/harness/acp/turn-outcome.server.test.ts +97 -0
  142. package/src/server/lib/harness/acp/turn-outcome.server.ts +71 -0
  143. package/src/server/lib/harness/acp/turn-silence.ts +52 -0
  144. package/src/server/lib/harness/acp/turn.test.ts +85 -3
  145. package/src/server/lib/harness/acp/turn.ts +62 -4
  146. package/src/server/lib/lifecycle/after-listen.ts +10 -0
  147. package/src/server/lib/omp/rpc/frame-fold-contract.ts +21 -0
  148. package/src/server/lib/omp/rpc/frame-fold-host.test-util.ts +4 -0
  149. package/src/server/lib/omp/rpc/frame-fold.ts +25 -2
  150. package/src/server/lib/omp/rpc/manager.ts +9 -8
  151. package/src/server/lib/omp/rpc/retry-saga.ts +54 -0
  152. package/src/server/lib/omp/rpc/run-settle.server.ts +38 -5
  153. package/src/server/lib/omp/rpc/run-settle.test.ts +5 -2
  154. package/src/server/lib/omp/rpc/session-commands-dialog.test.ts +6 -20
  155. package/src/server/lib/omp/rpc/session-commands-mapping.test.ts +131 -0
  156. package/src/server/lib/omp/rpc/session-commands.test.ts +95 -116
  157. package/src/server/lib/omp/rpc/session-commands.ts +38 -17
  158. package/src/server/lib/omp/rpc/terminal-settle.test.ts +223 -0
  159. package/src/server/lib/omp/rpc/terminal-settle.ts +127 -29
  160. package/src/server/lib/omp/session/scan.ts +15 -2
  161. package/src/server/lib/omp/session/session-discovery.test.ts +21 -0
  162. package/src/server/lib/sessions/notify.server.test.ts +11 -3
  163. package/src/server/lib/sessions/notify.server.ts +67 -42
  164. package/src/server/lib/sessions/spawn.server.test.ts +5 -1
  165. package/src/server/lib/sessions/spawn.server.ts +8 -3
  166. package/src/server/routes/sessions/answer.test.ts +62 -0
  167. package/src/server/routes/sessions/answer.ts +13 -2
  168. package/src/shared/lib/chat/composer/delegation.ts +11 -7
  169. package/src/shared/lib/chat/export-markdown.ts +19 -0
  170. package/src/shared/lib/chat/orchestration/notice.test.ts +118 -0
  171. package/src/shared/lib/chat/orchestration/notice.ts +183 -0
  172. package/src/shared/lib/chat/timeline/omp-callbacks.ts +6 -1
  173. package/src/shared/lib/chat/timeline/tool-render-mode.ts +3 -3
  174. package/src/shared/lib/icons/tint-hues.generated.ts +36 -36
  175. package/src/shared/lib/omp/session/operator-title.test.ts +21 -0
  176. package/src/shared/lib/omp/session/operator-title.ts +28 -0
  177. package/dist/client/static/js/architecture-7GRP2DOG-9q06651f.js +0 -1
  178. package/dist/client/static/js/cynefin-OW5HDTMX-w7a38g4g.js +0 -1
  179. package/dist/client/static/js/eventmodeling-NTZA5JFV-6wrjccyw.js +0 -1
  180. package/dist/client/static/js/flowDiagram-KWPJA3E3-19vjkg84.js +0 -1
  181. package/dist/client/static/js/gitGraph-4MIJSDKK-4je2p50v.js +0 -1
  182. package/dist/client/static/js/html-bwyt0ayy.js +0 -1
  183. package/dist/client/static/js/info-A6RAGUB7-k0z5qdew.js +0 -1
  184. package/dist/client/static/js/one-dark-pro-9tt0a020.js +0 -1
  185. package/dist/client/static/js/one-light-5fg4r0ra.js +0 -1
  186. package/dist/client/static/js/packet-AYTQ26CC-6cnvmb2z.js +0 -1
  187. package/dist/client/static/js/pie-WAS4IAKB-m9z1mztn.js +0 -1
  188. package/dist/client/static/js/radar-RG4KPBEZ-8m9rkex6.js +0 -1
  189. package/dist/client/static/js/railroad-74A4TZTK-wc55emj8.js +0 -1
  190. package/dist/client/static/js/railroad-abnf-HS5TGJTU-2y2rnrzq.js +0 -1
  191. package/dist/client/static/js/railroad-ebnf-LZEXJU2U-zzcc9x0v.js +0 -1
  192. package/dist/client/static/js/railroad-peg-WCYAUIDC-z82na5nb.js +0 -1
  193. package/dist/client/static/js/treeView-Q6P3EWNA-kzh6cm3f.js +0 -1
  194. package/dist/client/static/js/treemap-WGGIJYW6-wz5ed560.js +0 -1
  195. package/dist/client/static/js/wardley-WFR3VGLG-zewbfccz.js +0 -1
@@ -1,2 +1,2 @@
1
- import{d,n,W,i,e,s,f,B,re,Ee,Ha,xa,Pt,Ea,fr,xt,Dt}from"./index-8hgm0abr.js";import{Qa,Ra,ki}from"./index-sx809d6d.js";var J={name:"square-pen",size:24,node:[["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"}]],aliases:["pen-box","edit","pen-square"]},y=s(J);var K={name:"laptop",size:24,node:[["path",{d:"M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z",key:"1pdavp"}],["path",{d:"M20.054 15.987H3.946",key:"14rxg9"}]]},Z=s(K);var Q={name:"ratio",size:24,node:[["rect",{width:"12",height:"20",x:"6",y:"2",rx:"2",key:"1oxtiu"}],["rect",{width:"20",height:"12",x:"2",y:"6",rx:"2",key:"9lu3g6"}]]},w=s(Q);var Y={name:"tablet",size:24,node:[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",ry:"2",key:"76otgf"}],["line",{x1:"12",x2:"12.01",y1:"18",y2:"18",key:"1dp563"}]]},C=s(Y);var k=[{id:"responsive",label:"Responsive (100% Fluid)",category:"responsive",icon:xa},{id:"desktop-16-9",label:"Desktop 16:9 (Auto H:W)",category:"responsive",icon:w},{id:"laptop",label:"Laptop (1024 × 768)",category:"responsive",icon:Z},{id:"tablet",label:"Tablet (768 × 1024)",category:"mobile",icon:C},{id:"mobile",label:"Mobile Phone (375 × 667)",category:"mobile",icon:fr},{id:"mobile-lg",label:"Mobile Large (414 × 896)",category:"mobile",icon:fr}];function j(t){switch(t){case"desktop-16-9":return"Desktop 16:9";case"laptop":return"Laptop 1024p";case"tablet":return"Tablet 768p";case"mobile":return"Mobile 375p";case"mobile-lg":return"Mobile Lg 414p";case"responsive":default:return"Responsive"}}function z({viewportMode:t,onChangeViewport:r,zoomLevel:a=100,onSetZoom:l}){let[p,c]=n(null);return e("div",{className:"flex items-center space-x-1.5 flex-shrink-0",children:[e("div",{className:"hidden sm:flex items-center bg-canvas border border-ink/10 rounded-md p-0.5",children:[e("button",{type:"button",onClick:()=>r("responsive"),className:`p-1 rounded text-xs transition-colors cursor-pointer ${t==="responsive"?"bg-ink text-canvas font-medium":"text-ink/50 hover:text-ink"}`,title:"Responsive (100% Fluid)",children:e(xa,{size:12})}),e("button",{type:"button",onClick:()=>r("desktop-16-9"),className:`p-1 rounded text-xs transition-colors cursor-pointer ${t==="desktop-16-9"?"bg-ink text-canvas font-medium":"text-ink/50 hover:text-ink"}`,title:"Desktop 16:9 (Auto Height following Width)",children:e(w,{size:12})}),e("button",{type:"button",onClick:()=>r("tablet"),className:`p-1 rounded text-xs transition-colors cursor-pointer ${t==="tablet"?"bg-ink text-canvas font-medium":"text-ink/50 hover:text-ink"}`,title:"Tablet (768px)",children:e(C,{size:12})}),e("button",{type:"button",onClick:()=>r("mobile"),className:`p-1 rounded text-xs transition-colors cursor-pointer ${t==="mobile"?"bg-ink text-canvas font-medium":"text-ink/50 hover:text-ink"}`,title:"Mobile (375px)",children:e(fr,{size:12})})]}),e("button",{type:"button","aria-haspopup":"menu","aria-expanded":p!==null,onClick:(o)=>c(p?null:xt(o.currentTarget)),className:"flex items-center space-x-1 px-2 py-1 rounded bg-canvas border border-ink/15 hover:border-ink/30 text-ink text-[11px] font-mono transition-colors cursor-pointer",title:"Device & Responsive Testing Menu",children:[e("span",{className:"hidden md:inline text-[10px] font-medium",children:j(t)}),e(B,{size:11,className:"text-ink/60"})]}),e(Dt,{anchor:p,ariaLabel:"Device & Responsive Testing Menu",className:"w-56 bg-paper border border-ink/15 rounded-lg shadow-xl py-1 text-xs font-mono",onClose:()=>c(null),children:[e("div",{className:"px-2.5 py-1 text-[10px] text-ink/40 uppercase tracking-wider font-semibold",children:"Responsive Testing"}),k.filter((o)=>o.category==="responsive").map((o)=>{let u=o.icon,b=t===o.id;return e("button",{type:"button",onClick:()=>{r(o.id),c(null)},className:`w-full px-2.5 py-1.5 flex items-center justify-between text-left hover:bg-ink/5 cursor-pointer ${b?"bg-ink/10 font-semibold text-ink":"text-ink/75"}`,children:[e("div",{className:"flex items-center space-x-2",children:[e(u,{size:13,className:"text-ink/60"}),e("span",{children:o.label})]}),b&&e(f,{size:12,className:"text-success"})]},o.id)}),e("div",{className:"mt-1 pt-1 border-t border-ink/10 px-2.5 py-1 text-[10px] text-ink/40 uppercase tracking-wider font-semibold",children:"Mobile Testing"}),k.filter((o)=>o.category==="mobile").map((o)=>{let u=o.icon,b=t===o.id;return e("button",{type:"button",onClick:()=>{r(o.id),c(null)},className:`w-full px-2.5 py-1.5 flex items-center justify-between text-left hover:bg-ink/5 cursor-pointer ${b?"bg-ink/10 font-semibold text-ink":"text-ink/75"}`,children:[e("div",{className:"flex items-center space-x-2",children:[e(u,{size:13,className:"text-ink/60"}),e("span",{children:o.label})]}),b&&e(f,{size:12,className:"text-success"})]},o.id)}),l&&e(d,{children:[e("div",{className:"mt-1 pt-1 border-t border-ink/10 px-2.5 py-1 text-[10px] text-ink/40 uppercase tracking-wider font-semibold",children:["Zoom Scale (",a,"%)"]}),e("div",{className:"grid grid-cols-3 gap-1 px-2 py-1",children:[50,75,100,125,150,200].map((o)=>e("button",{type:"button",onClick:()=>{l(o),c(null)},className:`px-1.5 py-1 text-center rounded text-[11px] font-mono cursor-pointer transition-colors ${a===o?"bg-ink text-canvas font-semibold":"bg-canvas border border-ink/10 text-ink/75 hover:bg-ink/5"}`,children:[o,"%"]},o))})]})]})]})}function L({zoomLevel:t,onZoomIn:r,onZoomOut:a,onResetZoom:l}){return e("div",{className:"flex items-center bg-canvas border border-ink/10 rounded-md p-0.5 space-x-0.5 text-xs font-mono",children:[e("button",{type:"button",onClick:a,disabled:t<=50,"aria-label":"Perkecil tampilan",title:"Zoom Out (-10%)",className:"p-1 rounded hover:bg-ink/5 disabled:opacity-25 disabled:hover:bg-transparent text-ink/70 hover:text-ink cursor-pointer disabled:cursor-not-allowed transition-colors",children:e(Ra,{size:12})}),e("button",{type:"button",onClick:l,className:"px-1 text-[10px] font-medium text-ink/75 hover:text-ink hover:underline cursor-pointer select-none",title:"Reset Zoom (100%)",children:[t,"%"]}),e("button",{type:"button",onClick:r,disabled:t>=200,"aria-label":"Perbesar tampilan",title:"Zoom In (+10%)",className:"p-1 rounded hover:bg-ink/5 disabled:opacity-25 disabled:hover:bg-transparent text-ink/70 hover:text-ink cursor-pointer disabled:cursor-not-allowed transition-colors",children:e(Qa,{size:12})})]})}var h="p-1.5 rounded hover:bg-ink/5 disabled:opacity-25 disabled:hover:bg-transparent text-ink/70 hover:text-ink transition-colors cursor-pointer disabled:cursor-not-allowed";function O(t){let r=[],{url:a,zoomLevel:l,copied:p,included:c}=t;if(t.viewportMode&&t.onChangeViewport){let{viewportMode:o,onChangeViewport:u,onSetZoom:b}=t;r.push({id:"viewport",actions:k.map((m)=>({label:m.label,icon:m.icon,onSelect:()=>u(m.id),active:o===m.id})),children:e(z,{viewportMode:o,onChangeViewport:u,zoomLevel:l,onSetZoom:b})})}if(r.push({id:"zoom",actions:[{label:"Zoom in (+10%)",icon:Qa,onSelect:t.onZoomIn,disabled:l>=200},{label:"Zoom out (-10%)",icon:Ra,onSelect:t.onZoomOut,disabled:l<=50},{label:"Reset zoom (100%)",icon:Pt,onSelect:t.onResetZoom,active:l===100}],children:e(L,{zoomLevel:l,onZoomIn:t.onZoomIn,onZoomOut:t.onZoomOut,onResetZoom:t.onResetZoom})}),r.push({id:"include",actions:[{label:c?"Page context added to the draft":"Include this page in the chat draft",icon:Ha,onSelect:t.onIncludeInChat,disabled:!a}],children:e("button",{type:"button",onClick:t.onIncludeInChat,disabled:!a,"aria-label":"Include this page in the chat draft",title:c?"Page context added to the draft":"Include this page in the chat draft",className:h,children:c?e(f,{size:14,className:"text-success"}):e(Ha,{size:14})})}),t.annotate){let o=t.annotate;r.push({id:"annotate",actions:[{label:o.count>0?`${o.active?"Tutup mode anotasi":"Buka mode anotasi"} (${o.count})`:"Mark a part of the page, then send it to the chat",icon:y,onSelect:o.onToggle,active:o.active,disabled:!a}],children:e("button",{type:"button",onClick:o.onToggle,disabled:!a,"aria-label":"Page annotation mode","aria-pressed":o.active,title:o.active?"Tutup mode anotasi":o.count>0?`Anotasi (${o.count}) — buka lagi`:"Mark a part of the page, then send it to the chat",className:`${h} relative ${o.active?"bg-ink/10 text-ink":""}`,children:[e(y,{size:14}),o.count>0&&e("span",{className:"absolute -top-0.5 -right-0.5 min-w-[13px] h-[13px] px-0.5 rounded-full bg-error text-paper text-[10px] leading-[13px] font-mono text-center",children:o.count})]})})}if(r.push({id:"copy",actions:[{label:p?"Copied URL!":"Copy URL",icon:re,onSelect:t.onCopy,disabled:!a}],children:e("button",{type:"button",onClick:t.onCopy,disabled:!a,"aria-label":"Salin URL",title:p?"Copied URL!":"Copy URL",className:h,children:p?e(f,{size:14,className:"text-success"}):e(re,{size:14})})}),t.onReconnect){let o=t.onReconnect;r.push({id:"reconnect",actions:[{label:"Sambungkan ulang live view",icon:Ea,onSelect:o}],children:e("button",{type:"button",onClick:o,"aria-label":"Sambungkan ulang live view",title:"Reconnect live view",className:h,children:e(Ea,{size:14})})})}return r.push({id:"open-external",actions:[{label:t.openExternalLabel,icon:Ee,onSelect:t.onOpenExternal,disabled:!a}],children:e("button",{type:"button",onClick:t.onOpenExternal,disabled:!a,"aria-label":t.openExternalLabel,title:t.openExternalTitle,className:h,children:e(Ee,{size:14})})}),r}var P=108,ee=280,oe=18,te=140,ne=36;function Cu({url:t,statusDotClass:r,statusLabel:a,viewportMode:l,zoomLevel:p,onChangeViewport:c,onZoomIn:o,onZoomOut:u,onResetZoom:b,onSetZoom:m,annotate:A,onIncludeInChat:V,onOpenExternal:E,onReconnect:D,openExternalLabel:_,openExternalTitle:U,children:H}){let[X,T]=n(!1),[q,N]=n(!1),g=i(null),[x,R]=n(0),F=O({url:t,zoomLevel:p,copied:X,included:q,viewportMode:l,onChangeViewport:c,annotate:A,onReconnect:D,onIncludeInChat:()=>{V(),N(!0),setTimeout(()=>N(!1),2500)},onCopy:()=>{if(!t)return;navigator.clipboard.writeText(t).then(()=>{T(!0),setTimeout(()=>T(!1),2000)}).catch(()=>{})},onOpenExternal:E,onZoomIn:o,onZoomOut:u,onResetZoom:b,onSetZoom:m,openExternalLabel:_,openExternalTitle:U});W(()=>{let v=g.current;if(!v)return;R(v.clientWidth)}),W(()=>{let v=g.current;if(!v||typeof ResizeObserver>"u")return;let M=new ResizeObserver(()=>R(v.clientWidth));return M.observe(v),()=>M.disconnect()},[]);let I=x===0||x>=ee,S=I?x>0?Math.min(P,x*0.25):P:oe,G=x>0?Math.max(0,x-S-te-ne):void 0;return e("div",{ref:g,"data-browser-toolbar":"",className:"h-10 px-2.5 border-b border-ink/10 bg-paper flex items-center gap-x-2 flex-shrink-0 select-none",children:[e("div",{className:"flex items-center space-x-1.5 flex-shrink-0 min-w-0",style:{maxWidth:`${S}px`},title:a,children:[e("span",{className:`w-1.5 h-1.5 rounded-full flex-shrink-0 ${r}`}),I&&e("span",{className:"text-[10px] font-mono uppercase tracking-wide text-ink/60 truncate",children:a})]}),e("div",{className:"flex flex-1 min-w-0 items-center",children:H}),e(ki,{clusters:F,available:G})]})}
1
+ import{d,n,W,i,e,s,f,B,re,Ee,Ha,xa,Pt,Ea,fr,xt,Dt}from"./index-pzvr1699.js";import{Qa,Ra,ki}from"./index-0e9nkc0g.js";var J={name:"square-pen",size:24,node:[["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"}]],aliases:["pen-box","edit","pen-square"]},y=s(J);var K={name:"laptop",size:24,node:[["path",{d:"M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z",key:"1pdavp"}],["path",{d:"M20.054 15.987H3.946",key:"14rxg9"}]]},Z=s(K);var Q={name:"ratio",size:24,node:[["rect",{width:"12",height:"20",x:"6",y:"2",rx:"2",key:"1oxtiu"}],["rect",{width:"20",height:"12",x:"2",y:"6",rx:"2",key:"9lu3g6"}]]},w=s(Q);var Y={name:"tablet",size:24,node:[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",ry:"2",key:"76otgf"}],["line",{x1:"12",x2:"12.01",y1:"18",y2:"18",key:"1dp563"}]]},C=s(Y);var k=[{id:"responsive",label:"Responsive (100% Fluid)",category:"responsive",icon:xa},{id:"desktop-16-9",label:"Desktop 16:9 (Auto H:W)",category:"responsive",icon:w},{id:"laptop",label:"Laptop (1024 × 768)",category:"responsive",icon:Z},{id:"tablet",label:"Tablet (768 × 1024)",category:"mobile",icon:C},{id:"mobile",label:"Mobile Phone (375 × 667)",category:"mobile",icon:fr},{id:"mobile-lg",label:"Mobile Large (414 × 896)",category:"mobile",icon:fr}];function j(t){switch(t){case"desktop-16-9":return"Desktop 16:9";case"laptop":return"Laptop 1024p";case"tablet":return"Tablet 768p";case"mobile":return"Mobile 375p";case"mobile-lg":return"Mobile Lg 414p";case"responsive":default:return"Responsive"}}function z({viewportMode:t,onChangeViewport:r,zoomLevel:a=100,onSetZoom:l}){let[p,c]=n(null);return e("div",{className:"flex items-center space-x-1.5 flex-shrink-0",children:[e("div",{className:"hidden sm:flex items-center bg-canvas border border-ink/10 rounded-md p-0.5",children:[e("button",{type:"button",onClick:()=>r("responsive"),className:`p-1 rounded text-xs transition-colors cursor-pointer ${t==="responsive"?"bg-ink text-canvas font-medium":"text-ink/50 hover:text-ink"}`,title:"Responsive (100% Fluid)",children:e(xa,{size:12})}),e("button",{type:"button",onClick:()=>r("desktop-16-9"),className:`p-1 rounded text-xs transition-colors cursor-pointer ${t==="desktop-16-9"?"bg-ink text-canvas font-medium":"text-ink/50 hover:text-ink"}`,title:"Desktop 16:9 (Auto Height following Width)",children:e(w,{size:12})}),e("button",{type:"button",onClick:()=>r("tablet"),className:`p-1 rounded text-xs transition-colors cursor-pointer ${t==="tablet"?"bg-ink text-canvas font-medium":"text-ink/50 hover:text-ink"}`,title:"Tablet (768px)",children:e(C,{size:12})}),e("button",{type:"button",onClick:()=>r("mobile"),className:`p-1 rounded text-xs transition-colors cursor-pointer ${t==="mobile"?"bg-ink text-canvas font-medium":"text-ink/50 hover:text-ink"}`,title:"Mobile (375px)",children:e(fr,{size:12})})]}),e("button",{type:"button","aria-haspopup":"menu","aria-expanded":p!==null,onClick:(o)=>c(p?null:xt(o.currentTarget)),className:"flex items-center space-x-1 px-2 py-1 rounded bg-canvas border border-ink/15 hover:border-ink/30 text-ink text-[11px] font-mono transition-colors cursor-pointer",title:"Device & Responsive Testing Menu",children:[e("span",{className:"hidden md:inline text-[10px] font-medium",children:j(t)}),e(B,{size:11,className:"text-ink/60"})]}),e(Dt,{anchor:p,ariaLabel:"Device & Responsive Testing Menu",className:"w-56 bg-paper border border-ink/15 rounded-lg shadow-xl py-1 text-xs font-mono",onClose:()=>c(null),children:[e("div",{className:"px-2.5 py-1 text-[10px] text-ink/40 uppercase tracking-wider font-semibold",children:"Responsive Testing"}),k.filter((o)=>o.category==="responsive").map((o)=>{let u=o.icon,b=t===o.id;return e("button",{type:"button",onClick:()=>{r(o.id),c(null)},className:`w-full px-2.5 py-1.5 flex items-center justify-between text-left hover:bg-ink/5 cursor-pointer ${b?"bg-ink/10 font-semibold text-ink":"text-ink/75"}`,children:[e("div",{className:"flex items-center space-x-2",children:[e(u,{size:13,className:"text-ink/60"}),e("span",{children:o.label})]}),b&&e(f,{size:12,className:"text-success"})]},o.id)}),e("div",{className:"mt-1 pt-1 border-t border-ink/10 px-2.5 py-1 text-[10px] text-ink/40 uppercase tracking-wider font-semibold",children:"Mobile Testing"}),k.filter((o)=>o.category==="mobile").map((o)=>{let u=o.icon,b=t===o.id;return e("button",{type:"button",onClick:()=>{r(o.id),c(null)},className:`w-full px-2.5 py-1.5 flex items-center justify-between text-left hover:bg-ink/5 cursor-pointer ${b?"bg-ink/10 font-semibold text-ink":"text-ink/75"}`,children:[e("div",{className:"flex items-center space-x-2",children:[e(u,{size:13,className:"text-ink/60"}),e("span",{children:o.label})]}),b&&e(f,{size:12,className:"text-success"})]},o.id)}),l&&e(d,{children:[e("div",{className:"mt-1 pt-1 border-t border-ink/10 px-2.5 py-1 text-[10px] text-ink/40 uppercase tracking-wider font-semibold",children:["Zoom Scale (",a,"%)"]}),e("div",{className:"grid grid-cols-3 gap-1 px-2 py-1",children:[50,75,100,125,150,200].map((o)=>e("button",{type:"button",onClick:()=>{l(o),c(null)},className:`px-1.5 py-1 text-center rounded text-[11px] font-mono cursor-pointer transition-colors ${a===o?"bg-ink text-canvas font-semibold":"bg-canvas border border-ink/10 text-ink/75 hover:bg-ink/5"}`,children:[o,"%"]},o))})]})]})]})}function L({zoomLevel:t,onZoomIn:r,onZoomOut:a,onResetZoom:l}){return e("div",{className:"flex items-center bg-canvas border border-ink/10 rounded-md p-0.5 space-x-0.5 text-xs font-mono",children:[e("button",{type:"button",onClick:a,disabled:t<=50,"aria-label":"Perkecil tampilan",title:"Zoom Out (-10%)",className:"p-1 rounded hover:bg-ink/5 disabled:opacity-25 disabled:hover:bg-transparent text-ink/70 hover:text-ink cursor-pointer disabled:cursor-not-allowed transition-colors",children:e(Ra,{size:12})}),e("button",{type:"button",onClick:l,className:"px-1 text-[10px] font-medium text-ink/75 hover:text-ink hover:underline cursor-pointer select-none",title:"Reset Zoom (100%)",children:[t,"%"]}),e("button",{type:"button",onClick:r,disabled:t>=200,"aria-label":"Perbesar tampilan",title:"Zoom In (+10%)",className:"p-1 rounded hover:bg-ink/5 disabled:opacity-25 disabled:hover:bg-transparent text-ink/70 hover:text-ink cursor-pointer disabled:cursor-not-allowed transition-colors",children:e(Qa,{size:12})})]})}var h="p-1.5 rounded hover:bg-ink/5 disabled:opacity-25 disabled:hover:bg-transparent text-ink/70 hover:text-ink transition-colors cursor-pointer disabled:cursor-not-allowed";function O(t){let r=[],{url:a,zoomLevel:l,copied:p,included:c}=t;if(t.viewportMode&&t.onChangeViewport){let{viewportMode:o,onChangeViewport:u,onSetZoom:b}=t;r.push({id:"viewport",actions:k.map((m)=>({label:m.label,icon:m.icon,onSelect:()=>u(m.id),active:o===m.id})),children:e(z,{viewportMode:o,onChangeViewport:u,zoomLevel:l,onSetZoom:b})})}if(r.push({id:"zoom",actions:[{label:"Zoom in (+10%)",icon:Qa,onSelect:t.onZoomIn,disabled:l>=200},{label:"Zoom out (-10%)",icon:Ra,onSelect:t.onZoomOut,disabled:l<=50},{label:"Reset zoom (100%)",icon:Pt,onSelect:t.onResetZoom,active:l===100}],children:e(L,{zoomLevel:l,onZoomIn:t.onZoomIn,onZoomOut:t.onZoomOut,onResetZoom:t.onResetZoom})}),r.push({id:"include",actions:[{label:c?"Page context added to the draft":"Include this page in the chat draft",icon:Ha,onSelect:t.onIncludeInChat,disabled:!a}],children:e("button",{type:"button",onClick:t.onIncludeInChat,disabled:!a,"aria-label":"Include this page in the chat draft",title:c?"Page context added to the draft":"Include this page in the chat draft",className:h,children:c?e(f,{size:14,className:"text-success"}):e(Ha,{size:14})})}),t.annotate){let o=t.annotate;r.push({id:"annotate",actions:[{label:o.count>0?`${o.active?"Tutup mode anotasi":"Buka mode anotasi"} (${o.count})`:"Mark a part of the page, then send it to the chat",icon:y,onSelect:o.onToggle,active:o.active,disabled:!a}],children:e("button",{type:"button",onClick:o.onToggle,disabled:!a,"aria-label":"Page annotation mode","aria-pressed":o.active,title:o.active?"Tutup mode anotasi":o.count>0?`Anotasi (${o.count}) — buka lagi`:"Mark a part of the page, then send it to the chat",className:`${h} relative ${o.active?"bg-ink/10 text-ink":""}`,children:[e(y,{size:14}),o.count>0&&e("span",{className:"absolute -top-0.5 -right-0.5 min-w-[13px] h-[13px] px-0.5 rounded-full bg-error text-paper text-[10px] leading-[13px] font-mono text-center",children:o.count})]})})}if(r.push({id:"copy",actions:[{label:p?"Copied URL!":"Copy URL",icon:re,onSelect:t.onCopy,disabled:!a}],children:e("button",{type:"button",onClick:t.onCopy,disabled:!a,"aria-label":"Salin URL",title:p?"Copied URL!":"Copy URL",className:h,children:p?e(f,{size:14,className:"text-success"}):e(re,{size:14})})}),t.onReconnect){let o=t.onReconnect;r.push({id:"reconnect",actions:[{label:"Sambungkan ulang live view",icon:Ea,onSelect:o}],children:e("button",{type:"button",onClick:o,"aria-label":"Sambungkan ulang live view",title:"Reconnect live view",className:h,children:e(Ea,{size:14})})})}return r.push({id:"open-external",actions:[{label:t.openExternalLabel,icon:Ee,onSelect:t.onOpenExternal,disabled:!a}],children:e("button",{type:"button",onClick:t.onOpenExternal,disabled:!a,"aria-label":t.openExternalLabel,title:t.openExternalTitle,className:h,children:e(Ee,{size:14})})}),r}var P=108,ee=280,oe=18,te=140,ne=36;function Cu({url:t,statusDotClass:r,statusLabel:a,viewportMode:l,zoomLevel:p,onChangeViewport:c,onZoomIn:o,onZoomOut:u,onResetZoom:b,onSetZoom:m,annotate:A,onIncludeInChat:V,onOpenExternal:E,onReconnect:D,openExternalLabel:_,openExternalTitle:U,children:H}){let[X,T]=n(!1),[q,N]=n(!1),g=i(null),[x,R]=n(0),F=O({url:t,zoomLevel:p,copied:X,included:q,viewportMode:l,onChangeViewport:c,annotate:A,onReconnect:D,onIncludeInChat:()=>{V(),N(!0),setTimeout(()=>N(!1),2500)},onCopy:()=>{if(!t)return;navigator.clipboard.writeText(t).then(()=>{T(!0),setTimeout(()=>T(!1),2000)}).catch(()=>{})},onOpenExternal:E,onZoomIn:o,onZoomOut:u,onResetZoom:b,onSetZoom:m,openExternalLabel:_,openExternalTitle:U});W(()=>{let v=g.current;if(!v)return;R(v.clientWidth)}),W(()=>{let v=g.current;if(!v||typeof ResizeObserver>"u")return;let M=new ResizeObserver(()=>R(v.clientWidth));return M.observe(v),()=>M.disconnect()},[]);let I=x===0||x>=ee,S=I?x>0?Math.min(P,x*0.25):P:oe,G=x>0?Math.max(0,x-S-te-ne):void 0;return e("div",{ref:g,"data-browser-toolbar":"",className:"h-10 px-2.5 border-b border-ink/10 bg-paper flex items-center gap-x-2 flex-shrink-0 select-none",children:[e("div",{className:"flex items-center space-x-1.5 flex-shrink-0 min-w-0",style:{maxWidth:`${S}px`},title:a,children:[e("span",{className:`w-1.5 h-1.5 rounded-full flex-shrink-0 ${r}`}),I&&e("span",{className:"text-[10px] font-mono uppercase tracking-wide text-ink/60 truncate",children:a})]}),e("div",{className:"flex flex-1 min-w-0 items-center",children:H}),e(ki,{clusters:F,available:G})]})}
2
2
  export{Cu};
@@ -1,2 +1,2 @@
1
- import{d,n,o,i,u,a,e,ho,s,m,_,qr,Oi,f,re,Mt,ge,D,O,$p,J,kt,tc,Up,Wu}from"./index-8hgm0abr.js";var U={name:"folder-git-2",size:24,node:[["path",{d:"M18 19a5 5 0 0 1-5-5v8",key:"sz5oeg"}],["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]]},Dp=s(U);function H({row:t,active:r,name:l,loading:h,onSelect:p,onCopyPath:g,onReveal:C}){return e("div",{className:"grid grid-cols-[1rem_minmax(0,1fr)_3.5rem] items-start gap-x-2 px-4 py-2 border-b border-ink/5 last:border-b-0 hover:bg-ink/[0.02] group/row transition-colors",children:[e("div",{className:"h-5 flex items-center justify-center",children:r&&e(f,{size:12,className:"text-ink","aria-label":"Selected repository"})}),e("button",{type:"button",onClick:p,disabled:r||!t.isRepo,title:!t.isRepo?t.error??"Not a git repository":r?"Already showing this repository":`Show ${t.path}`,className:"min-w-0 text-left cursor-pointer disabled:cursor-default",children:e("div",{className:"h-5 flex items-center gap-1.5 min-w-0",children:[e(ge,{size:11,className:r?"text-ink/60 flex-shrink-0":"text-ink/40 flex-shrink-0"}),e("span",{className:`truncate text-xs ${r?"font-semibold text-ink":"text-ink/90"}`,children:l})]})}),e("div",{className:"h-5 flex items-center justify-end gap-0.5 touch-visible opacity-0 group-hover/row:opacity-100",children:[e("button",{type:"button",onClick:g,disabled:h,title:`Copy the absolute path of ${t.path}`,"aria-label":`Copy path of ${t.path}`,className:"w-5 h-5 flex items-center justify-center rounded text-ink/40 hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors disabled:opacity-30 disabled:cursor-default",children:e(re,{size:11})}),e("button",{type:"button",onClick:C,title:`Reveal ${t.path} in the file manager`,"aria-label":`Reveal ${t.path}`,className:"w-5 h-5 flex items-center justify-center rounded text-ink/40 hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors",children:e(Mt,{size:11})})]}),e("div",{className:"col-start-2 col-span-2 flex flex-wrap items-center gap-x-2 gap-y-0.5 min-w-0 mt-0.5",children:[t.isRepo?e(d,{children:[e("span",{className:`text-[10px] font-mono truncate ${t.detached?"text-warning":"text-ink/50"}`,title:t.detached?`Detached HEAD at ${t.branch}`:`On branch ${t.branch}`,children:t.branch}),e("span",{className:"text-[10px] text-ink/25","aria-hidden":!0,children:"·"}),e(Q,{row:t})]}):e("span",{className:"text-[10px] text-ink/40 truncate",children:t.error??"Not a git repository"}),t.isRepo&&t.subject&&e(d,{children:[e("span",{className:"text-[10px] text-ink/25","aria-hidden":!0,children:"·"}),e("span",{className:"text-[10px] text-ink/40 truncate min-w-0",title:t.subject,children:t.subject})]})]})]})}function Q({row:t}){let r=[];if(t.operation)r.push(e("span",{className:"flex flex-shrink-0 items-center gap-0.5 rounded border border-warning/30 px-1 text-[10px] font-mono text-warning",title:t.operation==="stash-pop"?`A stash pop stopped on ${t.conflicts} conflict(s)`:`A ${ho[t.operation]} is in progress, stopped on ${t.conflicts} conflict(s)`,children:[e(_,{size:9}),ho[t.operation]]},"operation"));else if(t.conflicts>0)r.push(e("span",{className:"flex flex-shrink-0 items-center gap-0.5 rounded border border-warning/30 px-1 text-[10px] font-mono text-warning",title:`${t.conflicts} conflicted path(s)`,children:[e(_,{size:9}),t.conflicts]},"conflicts"));if(t.changed>0||t.untracked>0)r.push(e("span",{className:"flex-shrink-0 rounded border border-info/30 px-1 text-[10px] font-mono tabular-nums text-info",title:`${t.changed} changed, ${t.untracked} untracked`,children:[t.changed>0?`${t.changed}±`:"",t.changed>0&&t.untracked>0?" ":"",t.untracked>0?`${t.untracked}?`:""]},"dirty"));if(t.gone)r.push(e("span",{className:"flex-shrink-0 rounded border border-warning/30 px-1 text-[10px] font-mono text-warning",title:`${t.upstream} no longer exists on the remote — fetch --prune to drop it`,children:"gone"},"gone"));else if(t.upstream&&(t.ahead>0||t.behind>0))r.push(e("span",{className:"flex flex-shrink-0 items-center gap-0.5 text-[10px] font-mono tabular-nums text-ink/60",title:`${t.ahead} ahead of, ${t.behind} behind ${t.upstream}`,children:[t.ahead>0&&e("span",{className:"flex items-center",children:[e(Oi,{size:9}),t.ahead]}),t.behind>0&&e("span",{className:"flex items-center",children:[e(qr,{size:9}),t.behind]})]},"track"));if(r.length===0)return e("span",{className:"text-[10px] font-mono text-ink/30",title:"Nothing to report: clean and in sync",children:"clean, in sync"});return e(d,{children:r})}function B(t){let{open:r,rootPath:l,scanning:h}=t,[p,g]=n([]),[C,y]=n(!1),[G,z]=n(!1),[k,v]=n(null),[A,E]=n(0),L=t.repos.join("\x00"),S=i(!0),b=i(null);o(()=>(S.current=!0,()=>{S.current=!1,b.current?.abort(),b.current=null}),[]);let P=a(async()=>{b.current?.abort();let R=new AbortController;b.current=R,z(!0),y(!0);try{let N=new URLSearchParams({repoDetails:"1"});if(l)N.set("root",l);let j=await fetch(`/api/fs/git?${N.toString()}`,{signal:R.signal}),F=await j.json();if(!S.current||b.current!==R)return;if(!j.ok||!Array.isArray(F.details)){v(F.error||`Failed to read repositories (HTTP ${j.status})`);return}g(F.details),v(null)}catch(N){if(!S.current||b.current!==R)return;if(N instanceof Error&&N.name==="AbortError")return;v(N instanceof Error?N.message:"Failed to read repositories")}finally{if(S.current&&b.current===R)b.current=null,z(!1),y(!1)}},[l]);o(()=>{if(!r){g([]),v(null),y(!1);return}P()},[r,P,L,h,A]);let w=a(()=>E((R)=>R+1),[]);return{details:p,loading:C,reading:G,error:k,refresh:w}}function W(t){let r=new Map;for(let l of t){if(!l||l==="."){if(!r.has(""))r.set("",{key:"",label:null,paths:[]});r.get("").paths.push(".");continue}let h=l.indexOf("/"),p=h===-1?"":l.slice(0,h),g=r.get(p);if(!g)g={key:p,label:p===""?null:p,paths:[]},r.set(p,g);g.paths.push(l)}for(let l of r.values())l.paths.sort((h,p)=>h==="."?-1:p==="."?1:h.localeCompare(p));return[...r.values()].sort((l,h)=>{if(l.key==="")return-1;if(h.key==="")return 1;return l.key.localeCompare(h.key)})}function q(t,r){if(t===".")return"workspace root";if(r==="")return t;return t.slice(r.length+1)}function I({isOpen:t,rootPath:r,activeRepo:l,repos:h,scanning:p,onSelectRepo:g,onRefreshRepos:C,onClose:y}){let[G,z]=n(""),[k,v]=n(null),{details:A,loading:E,reading:L,error:S,refresh:b}=B({open:t,rootPath:r,repos:h,scanning:p});o(()=>{if(!t)z(""),v(null)},[t]);let P=u(()=>{let x=G.trim().toLowerCase();if(!x)return A;return A.filter((c)=>c.path.toLowerCase().includes(x))},[A,G]),w=u(()=>W(P.map((x)=>x.path)),[P]),R=u(()=>{let x=new Map;for(let c of A)x.set(c.path,c);return x},[A]),N=a(()=>{C(),b()},[C,b]),j=a(async(x)=>{let c=r?Wu(r,x==="."?"":x):x,M=await kt(c);v(M?{text:`Copied ${c}`,kind:"success"}:{text:"Clipboard unavailable",kind:"error"})},[r]),F=a(async(x)=>{let c=new FormData;if(c.append("actionType","open_explorer"),c.append("path","."),c.append("repo",x),r)c.append("root",r);try{let M=await fetch("/api/fs/action",{method:"POST",body:c}),T=await M.json();if(!M.ok||T.error)v({text:T.error||"Could not open the file manager",kind:"error"})}catch{v({text:"Could not open the file manager",kind:"error"})}},[r]);if(!t)return null;return e(J,{onClose:y,maxWidthClass:"max-w-[min(96vw,720px)]",header:e("div",{className:"flex items-center gap-2 min-w-0",children:[e(Dp,{size:14,className:"text-ink/60 flex-shrink-0"}),e("h2",{className:"text-sm font-semibold text-ink",children:"Repositories"}),e("span",{className:"text-[10px] font-mono text-ink/50 truncate",children:[h.length," in this workspace"]})]}),children:[e("div",{className:"px-5 py-3 flex items-center gap-2 border-b border-ink/10",children:[e(O,{size:12,className:"text-ink/40 flex-shrink-0"}),e("input",{type:"text",value:G,onChange:(x)=>z(x.currentTarget.value),placeholder:"Filter repositories…","aria-label":"Filter repositories",className:"flex-1 min-w-0 bg-transparent outline-none text-xs text-ink placeholder-ink/40",autoFocus:!0}),e("button",{type:"button",onClick:N,disabled:L||p,title:"Re-discover repositories and re-read their state","aria-label":"Refresh repositories",className:"text-ink/40 hover:text-ink transition-colors cursor-pointer disabled:opacity-40 flex-shrink-0",children:e(D,{size:12,className:L||p?"animate-spin":""})})]}),p&&e("div",{className:"px-5 py-1.5 border-b border-ink/10 text-[10px] font-mono text-ink/50 flex items-center gap-1.5",children:[e(m,{size:10,className:"animate-spin"}),"Still discovering repositories in this workspace…"]}),k&&e("div",{className:`px-5 py-1.5 border-b border-ink/10 text-[10px] font-mono truncate ${k.kind==="error"?"text-error":"text-ink/60"}`,title:k.text,role:"status",children:k.text}),e("div",{className:"min-h-[40vh] max-h-[60vh] overflow-y-auto scrollbar-overlay-container",children:E&&A.length===0?e("div",{className:"flex items-center justify-center gap-2 py-12 text-xs text-ink/50 font-mono",children:[e(m,{size:14,className:"animate-spin text-info"}),"Reading repositories…"]}):S?e("div",{className:"py-12 px-6 text-center text-xs text-error font-mono",children:S}):P.length===0?e("div",{className:"py-12 text-center text-xs text-ink/40 font-mono",children:G.trim()?"No matching repositories.":"No repositories in this workspace."}):w.map((x)=>e("div",{children:[e("div",{className:"px-4 py-1 text-[10px] uppercase tracking-wider text-ink/40 font-semibold bg-canvas/40 border-b border-ink/5 sticky top-0",children:x.label??tc(".",r)}),x.paths.map((c)=>{let M=R.get(c);if(!M)return null;return e(H,{row:M,active:c===l,name:q(c,x.key),loading:L,onSelect:()=>{g(c),y()},onCopyPath:()=>void j(c),onReveal:()=>void F(c)},c)})]},x.key))})]})}function br({rootPath:t,activeRepo:r,onSelectRepo:l,repos:h,scanning:p,onRefreshRepos:g}){let[C,y]=n(!1),G=u(()=>({root:t??null,repo:r,rows:h.map((k)=>({repo:k,label:tc(k,t),short:Up(k,t)})),scanning:p,ready:!0,setRepo:l,refresh:g}),[t,r,h,p,l,g]),z=a(()=>y(!0),[]);return e("div",{className:"relative",children:[e($p,{scope:G,onManage:z}),e(I,{isOpen:C,rootPath:t,activeRepo:r,repos:h,scanning:p,onSelectRepo:l,onRefreshRepos:g,onClose:()=>y(!1)})]})}
1
+ import{d,n,o,i,u,a,e,ho,s,m,_,qr,Oi,f,re,Mt,ge,D,O,$p,Z,kt,tc,Up,Wu}from"./index-pzvr1699.js";var U={name:"folder-git-2",size:24,node:[["path",{d:"M18 19a5 5 0 0 1-5-5v8",key:"sz5oeg"}],["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]]},Dp=s(U);function H({row:t,active:r,name:l,loading:h,onSelect:p,onCopyPath:g,onReveal:C}){return e("div",{className:"grid grid-cols-[1rem_minmax(0,1fr)_3.5rem] items-start gap-x-2 px-4 py-2 border-b border-ink/5 last:border-b-0 hover:bg-ink/[0.02] group/row transition-colors",children:[e("div",{className:"h-5 flex items-center justify-center",children:r&&e(f,{size:12,className:"text-ink","aria-label":"Selected repository"})}),e("button",{type:"button",onClick:p,disabled:r||!t.isRepo,title:!t.isRepo?t.error??"Not a git repository":r?"Already showing this repository":`Show ${t.path}`,className:"min-w-0 text-left cursor-pointer disabled:cursor-default",children:e("div",{className:"h-5 flex items-center gap-1.5 min-w-0",children:[e(ge,{size:11,className:r?"text-ink/60 flex-shrink-0":"text-ink/40 flex-shrink-0"}),e("span",{className:`truncate text-xs ${r?"font-semibold text-ink":"text-ink/90"}`,children:l})]})}),e("div",{className:"h-5 flex items-center justify-end gap-0.5 touch-visible opacity-0 group-hover/row:opacity-100",children:[e("button",{type:"button",onClick:g,disabled:h,title:`Copy the absolute path of ${t.path}`,"aria-label":`Copy path of ${t.path}`,className:"w-5 h-5 flex items-center justify-center rounded text-ink/40 hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors disabled:opacity-30 disabled:cursor-default",children:e(re,{size:11})}),e("button",{type:"button",onClick:C,title:`Reveal ${t.path} in the file manager`,"aria-label":`Reveal ${t.path}`,className:"w-5 h-5 flex items-center justify-center rounded text-ink/40 hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors",children:e(Mt,{size:11})})]}),e("div",{className:"col-start-2 col-span-2 flex flex-wrap items-center gap-x-2 gap-y-0.5 min-w-0 mt-0.5",children:[t.isRepo?e(d,{children:[e("span",{className:`text-[10px] font-mono truncate ${t.detached?"text-warning":"text-ink/50"}`,title:t.detached?`Detached HEAD at ${t.branch}`:`On branch ${t.branch}`,children:t.branch}),e("span",{className:"text-[10px] text-ink/25","aria-hidden":!0,children:"·"}),e(Q,{row:t})]}):e("span",{className:"text-[10px] text-ink/40 truncate",children:t.error??"Not a git repository"}),t.isRepo&&t.subject&&e(d,{children:[e("span",{className:"text-[10px] text-ink/25","aria-hidden":!0,children:"·"}),e("span",{className:"text-[10px] text-ink/40 truncate min-w-0",title:t.subject,children:t.subject})]})]})]})}function Q({row:t}){let r=[];if(t.operation)r.push(e("span",{className:"flex flex-shrink-0 items-center gap-0.5 rounded border border-warning/30 px-1 text-[10px] font-mono text-warning",title:t.operation==="stash-pop"?`A stash pop stopped on ${t.conflicts} conflict(s)`:`A ${ho[t.operation]} is in progress, stopped on ${t.conflicts} conflict(s)`,children:[e(_,{size:9}),ho[t.operation]]},"operation"));else if(t.conflicts>0)r.push(e("span",{className:"flex flex-shrink-0 items-center gap-0.5 rounded border border-warning/30 px-1 text-[10px] font-mono text-warning",title:`${t.conflicts} conflicted path(s)`,children:[e(_,{size:9}),t.conflicts]},"conflicts"));if(t.changed>0||t.untracked>0)r.push(e("span",{className:"flex-shrink-0 rounded border border-info/30 px-1 text-[10px] font-mono tabular-nums text-info",title:`${t.changed} changed, ${t.untracked} untracked`,children:[t.changed>0?`${t.changed}±`:"",t.changed>0&&t.untracked>0?" ":"",t.untracked>0?`${t.untracked}?`:""]},"dirty"));if(t.gone)r.push(e("span",{className:"flex-shrink-0 rounded border border-warning/30 px-1 text-[10px] font-mono text-warning",title:`${t.upstream} no longer exists on the remote — fetch --prune to drop it`,children:"gone"},"gone"));else if(t.upstream&&(t.ahead>0||t.behind>0))r.push(e("span",{className:"flex flex-shrink-0 items-center gap-0.5 text-[10px] font-mono tabular-nums text-ink/60",title:`${t.ahead} ahead of, ${t.behind} behind ${t.upstream}`,children:[t.ahead>0&&e("span",{className:"flex items-center",children:[e(Oi,{size:9}),t.ahead]}),t.behind>0&&e("span",{className:"flex items-center",children:[e(qr,{size:9}),t.behind]})]},"track"));if(r.length===0)return e("span",{className:"text-[10px] font-mono text-ink/30",title:"Nothing to report: clean and in sync",children:"clean, in sync"});return e(d,{children:r})}function B(t){let{open:r,rootPath:l,scanning:h}=t,[p,g]=n([]),[C,y]=n(!1),[G,z]=n(!1),[k,v]=n(null),[A,E]=n(0),L=t.repos.join("\x00"),S=i(!0),b=i(null);o(()=>(S.current=!0,()=>{S.current=!1,b.current?.abort(),b.current=null}),[]);let P=a(async()=>{b.current?.abort();let R=new AbortController;b.current=R,z(!0),y(!0);try{let N=new URLSearchParams({repoDetails:"1"});if(l)N.set("root",l);let j=await fetch(`/api/fs/git?${N.toString()}`,{signal:R.signal}),F=await j.json();if(!S.current||b.current!==R)return;if(!j.ok||!Array.isArray(F.details)){v(F.error||`Failed to read repositories (HTTP ${j.status})`);return}g(F.details),v(null)}catch(N){if(!S.current||b.current!==R)return;if(N instanceof Error&&N.name==="AbortError")return;v(N instanceof Error?N.message:"Failed to read repositories")}finally{if(S.current&&b.current===R)b.current=null,z(!1),y(!1)}},[l]);o(()=>{if(!r){g([]),v(null),y(!1);return}P()},[r,P,L,h,A]);let w=a(()=>E((R)=>R+1),[]);return{details:p,loading:C,reading:G,error:k,refresh:w}}function W(t){let r=new Map;for(let l of t){if(!l||l==="."){if(!r.has(""))r.set("",{key:"",label:null,paths:[]});r.get("").paths.push(".");continue}let h=l.indexOf("/"),p=h===-1?"":l.slice(0,h),g=r.get(p);if(!g)g={key:p,label:p===""?null:p,paths:[]},r.set(p,g);g.paths.push(l)}for(let l of r.values())l.paths.sort((h,p)=>h==="."?-1:p==="."?1:h.localeCompare(p));return[...r.values()].sort((l,h)=>{if(l.key==="")return-1;if(h.key==="")return 1;return l.key.localeCompare(h.key)})}function q(t,r){if(t===".")return"workspace root";if(r==="")return t;return t.slice(r.length+1)}function I({isOpen:t,rootPath:r,activeRepo:l,repos:h,scanning:p,onSelectRepo:g,onRefreshRepos:C,onClose:y}){let[G,z]=n(""),[k,v]=n(null),{details:A,loading:E,reading:L,error:S,refresh:b}=B({open:t,rootPath:r,repos:h,scanning:p});o(()=>{if(!t)z(""),v(null)},[t]);let P=u(()=>{let x=G.trim().toLowerCase();if(!x)return A;return A.filter((c)=>c.path.toLowerCase().includes(x))},[A,G]),w=u(()=>W(P.map((x)=>x.path)),[P]),R=u(()=>{let x=new Map;for(let c of A)x.set(c.path,c);return x},[A]),N=a(()=>{C(),b()},[C,b]),j=a(async(x)=>{let c=r?Wu(r,x==="."?"":x):x,M=await kt(c);v(M?{text:`Copied ${c}`,kind:"success"}:{text:"Clipboard unavailable",kind:"error"})},[r]),F=a(async(x)=>{let c=new FormData;if(c.append("actionType","open_explorer"),c.append("path","."),c.append("repo",x),r)c.append("root",r);try{let M=await fetch("/api/fs/action",{method:"POST",body:c}),T=await M.json();if(!M.ok||T.error)v({text:T.error||"Could not open the file manager",kind:"error"})}catch{v({text:"Could not open the file manager",kind:"error"})}},[r]);if(!t)return null;return e(Z,{onClose:y,maxWidthClass:"max-w-[min(96vw,720px)]",header:e("div",{className:"flex items-center gap-2 min-w-0",children:[e(Dp,{size:14,className:"text-ink/60 flex-shrink-0"}),e("h2",{className:"text-sm font-semibold text-ink",children:"Repositories"}),e("span",{className:"text-[10px] font-mono text-ink/50 truncate",children:[h.length," in this workspace"]})]}),children:[e("div",{className:"px-5 py-3 flex items-center gap-2 border-b border-ink/10",children:[e(O,{size:12,className:"text-ink/40 flex-shrink-0"}),e("input",{type:"text",value:G,onChange:(x)=>z(x.currentTarget.value),placeholder:"Filter repositories…","aria-label":"Filter repositories",className:"flex-1 min-w-0 bg-transparent outline-none text-xs text-ink placeholder-ink/40",autoFocus:!0}),e("button",{type:"button",onClick:N,disabled:L||p,title:"Re-discover repositories and re-read their state","aria-label":"Refresh repositories",className:"text-ink/40 hover:text-ink transition-colors cursor-pointer disabled:opacity-40 flex-shrink-0",children:e(D,{size:12,className:L||p?"animate-spin":""})})]}),p&&e("div",{className:"px-5 py-1.5 border-b border-ink/10 text-[10px] font-mono text-ink/50 flex items-center gap-1.5",children:[e(m,{size:10,className:"animate-spin"}),"Still discovering repositories in this workspace…"]}),k&&e("div",{className:`px-5 py-1.5 border-b border-ink/10 text-[10px] font-mono truncate ${k.kind==="error"?"text-error":"text-ink/60"}`,title:k.text,role:"status",children:k.text}),e("div",{className:"min-h-[40vh] max-h-[60vh] overflow-y-auto scrollbar-overlay-container",children:E&&A.length===0?e("div",{className:"flex items-center justify-center gap-2 py-12 text-xs text-ink/50 font-mono",children:[e(m,{size:14,className:"animate-spin text-info"}),"Reading repositories…"]}):S?e("div",{className:"py-12 px-6 text-center text-xs text-error font-mono",children:S}):P.length===0?e("div",{className:"py-12 text-center text-xs text-ink/40 font-mono",children:G.trim()?"No matching repositories.":"No repositories in this workspace."}):w.map((x)=>e("div",{children:[e("div",{className:"px-4 py-1 text-[10px] uppercase tracking-wider text-ink/40 font-semibold bg-canvas/40 border-b border-ink/5 sticky top-0",children:x.label??tc(".",r)}),x.paths.map((c)=>{let M=R.get(c);if(!M)return null;return e(H,{row:M,active:c===l,name:q(c,x.key),loading:L,onSelect:()=>{g(c),y()},onCopyPath:()=>void j(c),onReveal:()=>void F(c)},c)})]},x.key))})]})}function br({rootPath:t,activeRepo:r,onSelectRepo:l,repos:h,scanning:p,onRefreshRepos:g}){let[C,y]=n(!1),G=u(()=>({root:t??null,repo:r,rows:h.map((k)=>({repo:k,label:tc(k,t),short:Up(k,t)})),scanning:p,ready:!0,setRepo:l,refresh:g}),[t,r,h,p,l,g]),z=a(()=>y(!0),[]);return e("div",{className:"relative",children:[e($p,{scope:G,onManage:z}),e(I,{isOpen:C,rootPath:t,activeRepo:r,repos:h,scanning:p,onSelectRepo:l,onRefreshRepos:g,onClose:()=>y(!1)})]})}
2
2
  export{Dp,br};
@@ -1,2 +1,2 @@
1
- import{t,l,C,p,K,Z,ma,fa,Wg,Gr,mo,Kg,Ms,Wt,Vg,Wf,ga,fo,Os}from"./index-13dr1t1r.js";import{ze}from"./index-2hpy58d0.js";function Rd(e,{edgePathsClass:r="edges edgePaths"}={}){let n=e.insert("g").attr("class","root"),i=n.insert("g").attr("class","clusters"),s=n.insert("g").attr("class",r),o=n.insert("g").attr("class","edgeLabels"),c=n.insert("g").attr("class","nodes");return{clusters:i,edgePaths:s,edgeLabels:o,nodes:c,rootGroups:n}}t(Rd,"createLayoutElementGroups");async function L(e,r,n){if(r.label){let{shapeSvg:i,bbox:s}=await Z(e,n===void 0?r:{...r,width:n});r.labelBBox={width:s.width,height:s.height},i.remove()}else r.labelBBox={width:0,height:0}}t(L,"measureGroupLabel");async function Fd(e,r,n){let i=await fa(e,r,n),s=i.node()?.getBBox()??{width:0,height:0};return r.width=s.width,r.height=s.height,i}t(Fd,"insertMeasuredNode");function D(e,r,n){let i=e,s=new Set;while(i){if(i.dir)return i.dir;if(!i.parentId||s.has(i.parentId))break;s.add(i.parentId),i=r.get(i.parentId)}return n}t(D,"resolveNodeDir");async function S(e,r,n={}){let i=new ze({multigraph:!0,compound:!0}),s=[...r.edges],o=p(),c=Rd(e),{edgeLabels:f,nodes:a}=c,d=new Map,m=new Map(r.nodes.map((u)=>[u.id,u])),y=r.direction,b=e.node()!=null;await Promise.all(r.nodes.map(async(u)=>{if(u.isGroup){if(b){let h=n.unwrapGroupLabels&&u.labelType!=="markdown";await L(a,u,h?Number.POSITIVE_INFINITY:void 0)}i.setNode(u.id,{...u})}else{if(b){let h=await Fd(a,u,{config:o,dir:D(u,m,y)});d.set(u.id,h)}i.setNode(u.id,{...u})}}));for(let u of s){if(b&&Wf(u))await ga(f,u);if(i.setEdge(u.start,u.end,{...u},u.id),!r.edges.some((v)=>v.id===u.id))r.edges.push(u)}if(globalThis.mermaidCaptureSizes){let{captureNodeSizes:u}=await import("./sizeCapture-INFHLROL-f87525h7.js");u(e,r)}return{graph:i,groups:c,nodeElements:d}}t(S,"createGraphWithElements");var Ae=new Map,g=new Map,P=new Map,V=t(()=>{g.clear(),P.clear(),Ae.clear()},"clear"),w=t((e,r)=>{let n=g.get(r)||[];return l.trace("In isDescendant",r," ",e," = ",n.includes(e)),n.includes(e)},"isDescendant"),W=t((e,r)=>{let n=g.get(r)||[];if(l.info("Descendants of ",r," is ",n),l.info("Edge is ",e),e.v===r||e.w===r)return!1;if(!n)return l.debug("Tilt, ",r,",not in descendants"),!1;return n.includes(e.v)||w(e.v,r)||w(e.w,r)||n.includes(e.w)},"edgeInCluster"),k=t((e,r,n,i)=>{l.debug("Copying children of ",e,"root",i,"data",r.node(e),i);let s=r.children(e)||[];if(e!==i)s.push(e);l.debug("Copying (nodes) clusterId",e,"nodes",s),s.forEach((o)=>{if(r.children(o).length>0)k(o,r,n,i);else{let c=r.node(o);if(l.info("cp ",o," to ",i," with parent ",e),n.setNode(o,c),i!==r.parent(o))l.debug("Setting parent",o,r.parent(o)),n.setParent(o,r.parent(o));if(e!==i&&o!==e)l.debug("Setting parent",o,e),n.setParent(o,e);else l.info("In copy ",e,"root",i,"data",r.node(e),i),l.debug("Not Setting parent for node=",o,"cluster!==rootId",e!==i,"node!==clusterId",o!==e);let f=r.edges(o);l.debug("Copying Edges",f),f.forEach((a)=>{l.info("Edge",a);let d=r.edge(a.v,a.w,a.name);l.info("Edge data",d,i);try{if(W(a,i))l.info("Copying as ",a.v,a.w,d,a.name),n.setEdge(a.v,a.w,d,a.name),l.info("newGraph edges ",n.edges(),n.edge(n.edges()[0]));else l.info("Skipping copy of edge ",a.v,"-->",a.w," rootId: ",i," clusterId:",e)}catch(m){l.error(m)}})}l.debug("Removing node",o),r.removeNode(o)})},"copy"),T=t((e,r)=>{let n=r.children(e),i=[...n];for(let s of n)P.set(s,e),i=[...i,...T(s,r)];return i},"extractDescendants"),Y=t((e,r,n)=>{let i=e.edges().filter((a)=>a.v===r||a.w===r),s=e.edges().filter((a)=>a.v===n||a.w===n),o=i.map((a)=>({v:a.v===r?n:a.v,w:a.w===r?r:a.w})),c=s.map((a)=>({v:a.v,w:a.w}));return o.filter((a)=>c.some((d)=>a.v===d.v&&a.w===d.w))},"findCommonEdges"),Ns=t((e,r,n)=>{let i=r.children(e);if(l.trace("Searching children of id ",e,i),i.length<1)return e;let s;for(let o of i){let c=Ns(o,r,n),f=Y(r,n,c);if(c)if(f.length>0)s=c;else return c}return s},"findNonClusterChild"),N=t((e)=>{if(!Ae.has(e))return e;if(!Ae.get(e).externalConnections)return e;if(Ae.has(e))return Ae.get(e).id;return e},"getAnchorId"),Rg=t((e,r)=>{if(!e||r>10){l.debug("Opting out, no graph ");return}else l.debug("Opting in, graph ");e.nodes().forEach(function(n){if(e.children(n).length>0)l.debug("Cluster identified",n," Replacement id in edges: ",Ns(n,e,n)),g.set(n,T(n,e)),Ae.set(n,{id:Ns(n,e,n),clusterData:e.node(n)})}),e.nodes().forEach(function(n){let i=e.children(n),s=e.edges();if(i.length>0)l.debug("Cluster identified",n,g),s.forEach((o)=>{let c=w(o.v,n),f=w(o.w,n);if(c^f)l.debug("Edge: ",o," leaves cluster ",n),l.debug("Descendants of XXX ",n,": ",g.get(n)),Ae.get(n).externalConnections=!0});else l.debug("Not a cluster ",n,g)});for(let n of Ae.keys()){let i=Ae.get(n).id,s=e.parent(i);if(s!==n&&Ae.has(s)&&!Ae.get(s).externalConnections)Ae.get(n).id=s;let o=e.edges().some((c)=>c.v===n);if(i&&Ae.get(n)?.externalConnections&&o&&M(e,i,n)){let c=q(e,n,e.parent(i));if(c)Ae.get(n).id=c}}e.edges().forEach(function(n){let i=e.edge(n);l.debug("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(n)),l.debug("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(e.edge(n)));let{v:s,w:o}=n;if(l.debug("Fix XXX",Ae,"ids:",n.v,n.w,"Translating: ",Ae.get(n.v)," --- ",Ae.get(n.w)),Ae.get(n.v)||Ae.get(n.w)){if(l.debug("Fixing and trying - removing XXX",n.v,n.w,n.name),s=N(n.v),o=N(n.w),e.removeEdge(n.v,n.w,n.name),s!==n.v){let c=e.parent(s);Ae.get(c).externalConnections=!0,i.fromCluster=n.v}if(o!==n.w){let c=e.parent(o);Ae.get(c).externalConnections=!0,i.toCluster=n.w}l.debug("Fix Replacing with XXX",s,o,n.name),e.setEdge(s,o,i,n.name)}}),R(e,0),l.trace(Ae)},"adjustClustersAndEdges"),R=t((e,r)=>{if(r>10){l.error("Bailing out");return}let n=e.nodes(),i=!1;for(let s of n){let o=e.children(s);i=i||o.length>0}if(!i){l.debug("Done, no node has children",e.nodes());return}l.debug("Nodes = ",n,r);for(let s of n)if(l.debug("Extracting node",s,Ae,Ae.has(s)&&!Ae.get(s).externalConnections,!e.parent(s),e.node(s),e.children("D")," Depth ",r),!Ae.has(s))l.debug("Not a cluster",s,r);else if(!Ae.get(s).externalConnections&&e.children(s)&&e.children(s).length>0){l.debug("Cluster without external connections, without a parent and with children",s,r);let c=e.graph().rankdir==="TB"?"LR":"TB";if(Ae.get(s)?.clusterData?.dir)c=Ae.get(s).clusterData.dir,l.debug("Fixing dir",Ae.get(s).clusterData.dir,c);let f=new ze({multigraph:!0,compound:!0}).setGraph({rankdir:c,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});k(s,e,f,s),e.setNode(s,{clusterNode:!0,id:s,clusterData:Ae.get(s).clusterData,label:Ae.get(s).label,graph:f})}else l.debug("Cluster ** ",s," **not meeting the criteria !externalConnections:",!Ae.get(s).externalConnections," no parent: ",!e.parent(s)," children ",e.children(s)&&e.children(s).length>0,e.children("D"),r),l.debug(Ae);n=e.nodes(),l.debug("New list of nodes",n);for(let s of n){let o=e.node(s);if(l.debug(" Now next level",s,o),o?.clusterNode)R(o.graph,r+1)}},"extractor"),B=t((e,r)=>{if(r.length===0)return[];let n=Object.assign([],r);return r.forEach((i)=>{let s=e.children(i),o=B(e,s);n=[...n,...o]}),n},"sorter"),Ld=t((e)=>B(e,e.children()),"sortNodesByHierarchy"),M=t((e,r,n)=>{let i=e.parent(r);while(i&&i!==n){let s=Ae.get(i);if(s&&!s.externalConnections)return!0;i=e.parent(i)}return!1},"isNodeInExtractableCluster"),q=t((e,r,n)=>{let i=e.children(r)??[];for(let s of i){if(s===n||w(s,n))continue;let o=Ns(s,e,r);if(!o)continue;if(!M(e,o,r))return o}return null},"findSafeAnchorNode");function Ho({prepareLayout:e,measureLayout:r,runLayoutCore:n,paintLayout:i,afterPaint:s,paintOptions:o}){let c=r??Md;return t(async function(a,d,m,y){let b=d.select("g");(m?.insertMarkers??Os)(b,a.markers,a.type,a.diagramId),X();let u={element:b,helpers:m,options:y};u.preparedLayout=await e?.(a,u);let h=await c(a,u),v=await n(a,u),E={...u,measure:h};if(i)await i(a,E,v);else await G(a,E,o);await s?.(a,E,v)},"render")}t(Ho,"createCommonLayoutRenderer");function X(){Wg(),Vg(),Kg(),V()}t(X,"clearLayoutRenderState");async function Md(e,{element:r},n){return await S(r,e,n)}t(Md,"defaultMeasureLayout");async function G(e,r,n={}){let{measure:i}=r,{groups:s}=i;for(let c of n.getNodes?.(e,r)??e.nodes){if(n.skipNode?.(c,r))continue;await _(s,c,r,n)}let o=O(e.nodes);for(let c of e.edges){if(F(c,n))continue;await j(s,c,o,e,n,r)}}t(G,"paintLayoutData");async function _(e,r,n,i){if(r.clusterNode)Gr(r);else if(A(r,n,i))await mo(e.clusters,r);else Gr(r)}t(_,"paintLayoutNode");function A(e,r,n){return e.isGroup===!0&&(n.isCluster?.(e,r)??!0)}t(A,"shouldPaintAsCluster");function O(e){let r=new Map;for(let n of e)if(n?.id)r.set(n.id,n);return r}t(O,"buildNodeLookup");function F(e,r){return e.isLayoutOnly||Boolean(r.skipEdge?.(e))}t(F,"shouldSkipPaintEdge");async function j(e,r,n,i,s,o){let c=fo(e.edgePaths,{...r},s.clusterDb??new Map,i.type,x(r.start,r,n,o,s),x(r.end,r,n,o,s),i.diagramId,H(r,s));if(Wf(r)){if(!Ms.has(r.id))await ga(e.edgeLabels,r);z(r,c)}}t(j,"paintLayoutEdge");function x(e,r,n,i,s){return s.getEdgeNode?.(e,r,i)??(e?n.get(e)??{}:{})}t(x,"getRenderedNode");function H(e,r){return typeof r.skipIntersect==="function"?r.skipIntersect(e):r.skipIntersect??!1}t(H,"shouldSkipIntersect");function z(e,r){let n=r?.updatedPath??r?.originalPath,i=C(),{subGraphTitleTotalMargin:s}=ma({flowchart:i.flowchart??{}});if(e.label){let o=Ms.get(e.id),{x:c,y:f}=e;if(n){let a=K.calcLabelPosition(n);if(l.debug("Moving label "+e.label+" from (",c,",",f,") to (",a.x,",",a.y,") abc88"),r?.updatedPath)c=a.x,f=a.y}o.attr("transform",`translate(${c}, ${f+s/2})`)}if(e?.startLabelLeft){let o=Wt.get(e.id).startLeft,c=e?.x,f=e?.y;if(n){let a=K.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_left",n);c=a.x,f=a.y}o.attr("transform",`translate(${c}, ${f})`)}if(e.startLabelRight){let o=Wt.get(e.id).startRight,{x:c,y:f}=e;if(n){let a=K.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_right",n);c=a.x,f=a.y}o.attr("transform",`translate(${c}, ${f})`)}if(e.endLabelLeft){let o=Wt.get(e.id).endLeft,{x:c,y:f}=e;if(n){let a=K.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_left",n);c=a.x,f=a.y}o.attr("transform",`translate(${c}, ${f})`)}if(e.endLabelRight){let o=Wt.get(e.id).endRight,{x:c,y:f}=e;if(n){let a=K.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_right",n);c=a.x,f=a.y}o.attr("transform",`translate(${c}, ${f})`)}}t(z,"positionRenderedEdgeLabel");
1
+ import{t,l,C,p,K,X,ma,fa,Wg,Gr,mo,Kg,Ms,Wt,Vg,Wf,ga,fo,Os}from"./index-cz50ha6x.js";import{ze}from"./index-gsxebrq9.js";function Rd(e,{edgePathsClass:r="edges edgePaths"}={}){let n=e.insert("g").attr("class","root"),i=n.insert("g").attr("class","clusters"),s=n.insert("g").attr("class",r),o=n.insert("g").attr("class","edgeLabels"),c=n.insert("g").attr("class","nodes");return{clusters:i,edgePaths:s,edgeLabels:o,nodes:c,rootGroups:n}}t(Rd,"createLayoutElementGroups");async function L(e,r,n){if(r.label){let{shapeSvg:i,bbox:s}=await X(e,n===void 0?r:{...r,width:n});r.labelBBox={width:s.width,height:s.height},i.remove()}else r.labelBBox={width:0,height:0}}t(L,"measureGroupLabel");async function Fd(e,r,n){let i=await fa(e,r,n),s=i.node()?.getBBox()??{width:0,height:0};return r.width=s.width,r.height=s.height,i}t(Fd,"insertMeasuredNode");function D(e,r,n){let i=e,s=new Set;while(i){if(i.dir)return i.dir;if(!i.parentId||s.has(i.parentId))break;s.add(i.parentId),i=r.get(i.parentId)}return n}t(D,"resolveNodeDir");async function S(e,r,n={}){let i=new ze({multigraph:!0,compound:!0}),s=[...r.edges],o=p(),c=Rd(e),{edgeLabels:f,nodes:a}=c,d=new Map,m=new Map(r.nodes.map((u)=>[u.id,u])),y=r.direction,b=e.node()!=null;await Promise.all(r.nodes.map(async(u)=>{if(u.isGroup){if(b){let h=n.unwrapGroupLabels&&u.labelType!=="markdown";await L(a,u,h?Number.POSITIVE_INFINITY:void 0)}i.setNode(u.id,{...u})}else{if(b){let h=await Fd(a,u,{config:o,dir:D(u,m,y)});d.set(u.id,h)}i.setNode(u.id,{...u})}}));for(let u of s){if(b&&Wf(u))await ga(f,u);if(i.setEdge(u.start,u.end,{...u},u.id),!r.edges.some((v)=>v.id===u.id))r.edges.push(u)}if(globalThis.mermaidCaptureSizes){let{captureNodeSizes:u}=await import("./sizeCapture-INFHLROL-p9bsf5dc.js");u(e,r)}return{graph:i,groups:c,nodeElements:d}}t(S,"createGraphWithElements");var Ae=new Map,g=new Map,P=new Map,W=t(()=>{g.clear(),P.clear(),Ae.clear()},"clear"),w=t((e,r)=>{let n=g.get(r)||[];return l.trace("In isDescendant",r," ",e," = ",n.includes(e)),n.includes(e)},"isDescendant"),Y=t((e,r)=>{let n=g.get(r)||[];if(l.info("Descendants of ",r," is ",n),l.info("Edge is ",e),e.v===r||e.w===r)return!1;if(!n)return l.debug("Tilt, ",r,",not in descendants"),!1;return n.includes(e.v)||w(e.v,r)||w(e.w,r)||n.includes(e.w)},"edgeInCluster"),k=t((e,r,n,i)=>{l.debug("Copying children of ",e,"root",i,"data",r.node(e),i);let s=r.children(e)||[];if(e!==i)s.push(e);l.debug("Copying (nodes) clusterId",e,"nodes",s),s.forEach((o)=>{if(r.children(o).length>0)k(o,r,n,i);else{let c=r.node(o);if(l.info("cp ",o," to ",i," with parent ",e),n.setNode(o,c),i!==r.parent(o))l.debug("Setting parent",o,r.parent(o)),n.setParent(o,r.parent(o));if(e!==i&&o!==e)l.debug("Setting parent",o,e),n.setParent(o,e);else l.info("In copy ",e,"root",i,"data",r.node(e),i),l.debug("Not Setting parent for node=",o,"cluster!==rootId",e!==i,"node!==clusterId",o!==e);let f=r.edges(o);l.debug("Copying Edges",f),f.forEach((a)=>{l.info("Edge",a);let d=r.edge(a.v,a.w,a.name);l.info("Edge data",d,i);try{if(Y(a,i))l.info("Copying as ",a.v,a.w,d,a.name),n.setEdge(a.v,a.w,d,a.name),l.info("newGraph edges ",n.edges(),n.edge(n.edges()[0]));else l.info("Skipping copy of edge ",a.v,"-->",a.w," rootId: ",i," clusterId:",e)}catch(m){l.error(m)}})}l.debug("Removing node",o),r.removeNode(o)})},"copy"),T=t((e,r)=>{let n=r.children(e),i=[...n];for(let s of n)P.set(s,e),i=[...i,...T(s,r)];return i},"extractDescendants"),q=t((e,r,n)=>{let i=e.edges().filter((a)=>a.v===r||a.w===r),s=e.edges().filter((a)=>a.v===n||a.w===n),o=i.map((a)=>({v:a.v===r?n:a.v,w:a.w===r?r:a.w})),c=s.map((a)=>({v:a.v,w:a.w}));return o.filter((a)=>c.some((d)=>a.v===d.v&&a.w===d.w))},"findCommonEdges"),Ns=t((e,r,n)=>{let i=r.children(e);if(l.trace("Searching children of id ",e,i),i.length<1)return e;let s;for(let o of i){let c=Ns(o,r,n),f=q(r,n,c);if(c)if(f.length>0)s=c;else return c}return s},"findNonClusterChild"),N=t((e)=>{if(!Ae.has(e))return e;if(!Ae.get(e).externalConnections)return e;if(Ae.has(e))return Ae.get(e).id;return e},"getAnchorId"),Rg=t((e,r)=>{if(!e||r>10){l.debug("Opting out, no graph ");return}else l.debug("Opting in, graph ");e.nodes().forEach(function(n){if(e.children(n).length>0)l.debug("Cluster identified",n," Replacement id in edges: ",Ns(n,e,n)),g.set(n,T(n,e)),Ae.set(n,{id:Ns(n,e,n),clusterData:e.node(n)})}),e.nodes().forEach(function(n){let i=e.children(n),s=e.edges();if(i.length>0)l.debug("Cluster identified",n,g),s.forEach((o)=>{let c=w(o.v,n),f=w(o.w,n);if(c^f)l.debug("Edge: ",o," leaves cluster ",n),l.debug("Descendants of XXX ",n,": ",g.get(n)),Ae.get(n).externalConnections=!0});else l.debug("Not a cluster ",n,g)});for(let n of Ae.keys()){let i=Ae.get(n).id,s=e.parent(i);if(s!==n&&Ae.has(s)&&!Ae.get(s).externalConnections)Ae.get(n).id=s;let o=e.edges().some((c)=>c.v===n);if(i&&Ae.get(n)?.externalConnections&&o&&M(e,i,n)){let c=Q(e,n,e.parent(i));if(c)Ae.get(n).id=c}}e.edges().forEach(function(n){let i=e.edge(n);l.debug("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(n)),l.debug("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(e.edge(n)));let{v:s,w:o}=n;if(l.debug("Fix XXX",Ae,"ids:",n.v,n.w,"Translating: ",Ae.get(n.v)," --- ",Ae.get(n.w)),Ae.get(n.v)||Ae.get(n.w)){if(l.debug("Fixing and trying - removing XXX",n.v,n.w,n.name),s=N(n.v),o=N(n.w),e.removeEdge(n.v,n.w,n.name),s!==n.v){let c=e.parent(s);Ae.get(c).externalConnections=!0,i.fromCluster=n.v}if(o!==n.w){let c=e.parent(o);Ae.get(c).externalConnections=!0,i.toCluster=n.w}l.debug("Fix Replacing with XXX",s,o,n.name),e.setEdge(s,o,i,n.name)}}),R(e,0),l.trace(Ae)},"adjustClustersAndEdges"),R=t((e,r)=>{if(r>10){l.error("Bailing out");return}let n=e.nodes(),i=!1;for(let s of n){let o=e.children(s);i=i||o.length>0}if(!i){l.debug("Done, no node has children",e.nodes());return}l.debug("Nodes = ",n,r);for(let s of n)if(l.debug("Extracting node",s,Ae,Ae.has(s)&&!Ae.get(s).externalConnections,!e.parent(s),e.node(s),e.children("D")," Depth ",r),!Ae.has(s))l.debug("Not a cluster",s,r);else if(!Ae.get(s).externalConnections&&e.children(s)&&e.children(s).length>0){l.debug("Cluster without external connections, without a parent and with children",s,r);let c=e.graph().rankdir==="TB"?"LR":"TB";if(Ae.get(s)?.clusterData?.dir)c=Ae.get(s).clusterData.dir,l.debug("Fixing dir",Ae.get(s).clusterData.dir,c);let f=new ze({multigraph:!0,compound:!0}).setGraph({rankdir:c,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});k(s,e,f,s),e.setNode(s,{clusterNode:!0,id:s,clusterData:Ae.get(s).clusterData,label:Ae.get(s).label,graph:f})}else l.debug("Cluster ** ",s," **not meeting the criteria !externalConnections:",!Ae.get(s).externalConnections," no parent: ",!e.parent(s)," children ",e.children(s)&&e.children(s).length>0,e.children("D"),r),l.debug(Ae);n=e.nodes(),l.debug("New list of nodes",n);for(let s of n){let o=e.node(s);if(l.debug(" Now next level",s,o),o?.clusterNode)R(o.graph,r+1)}},"extractor"),B=t((e,r)=>{if(r.length===0)return[];let n=Object.assign([],r);return r.forEach((i)=>{let s=e.children(i),o=B(e,s);n=[...n,...o]}),n},"sorter"),Ld=t((e)=>B(e,e.children()),"sortNodesByHierarchy"),M=t((e,r,n)=>{let i=e.parent(r);while(i&&i!==n){let s=Ae.get(i);if(s&&!s.externalConnections)return!0;i=e.parent(i)}return!1},"isNodeInExtractableCluster"),Q=t((e,r,n)=>{let i=e.children(r)??[];for(let s of i){if(s===n||w(s,n))continue;let o=Ns(s,e,r);if(!o)continue;if(!M(e,o,r))return o}return null},"findSafeAnchorNode");function Ho({prepareLayout:e,measureLayout:r,runLayoutCore:n,paintLayout:i,afterPaint:s,paintOptions:o}){let c=r??Md;return t(async function(a,d,m,y){let b=d.select("g");(m?.insertMarkers??Os)(b,a.markers,a.type,a.diagramId),G();let u={element:b,helpers:m,options:y};u.preparedLayout=await e?.(a,u);let h=await c(a,u),v=await n(a,u),E={...u,measure:h};if(i)await i(a,E,v);else await _(a,E,o);await s?.(a,E,v)},"render")}t(Ho,"createCommonLayoutRenderer");function G(){Wg(),Vg(),Kg(),W()}t(G,"clearLayoutRenderState");async function Md(e,{element:r},n){return await S(r,e,n)}t(Md,"defaultMeasureLayout");async function _(e,r,n={}){let{measure:i}=r,{groups:s}=i;for(let c of n.getNodes?.(e,r)??e.nodes){if(n.skipNode?.(c,r))continue;await A(s,c,r,n)}let o=F(e.nodes);for(let c of e.edges){if(j(c,n))continue;await H(s,c,o,e,n,r)}}t(_,"paintLayoutData");async function A(e,r,n,i){if(r.clusterNode)Gr(r);else if(O(r,n,i))await mo(e.clusters,r);else Gr(r)}t(A,"paintLayoutNode");function O(e,r,n){return e.isGroup===!0&&(n.isCluster?.(e,r)??!0)}t(O,"shouldPaintAsCluster");function F(e){let r=new Map;for(let n of e)if(n?.id)r.set(n.id,n);return r}t(F,"buildNodeLookup");function j(e,r){return e.isLayoutOnly||Boolean(r.skipEdge?.(e))}t(j,"shouldSkipPaintEdge");async function H(e,r,n,i,s,o){let c=fo(e.edgePaths,{...r},s.clusterDb??new Map,i.type,x(r.start,r,n,o,s),x(r.end,r,n,o,s),i.diagramId,z(r,s));if(Wf(r)){if(!Ms.has(r.id))await ga(e.edgeLabels,r);J(r,c)}}t(H,"paintLayoutEdge");function x(e,r,n,i,s){return s.getEdgeNode?.(e,r,i)??(e?n.get(e)??{}:{})}t(x,"getRenderedNode");function z(e,r){return typeof r.skipIntersect==="function"?r.skipIntersect(e):r.skipIntersect??!1}t(z,"shouldSkipIntersect");function J(e,r){let n=r?.updatedPath??r?.originalPath,i=C(),{subGraphTitleTotalMargin:s}=ma({flowchart:i.flowchart??{}});if(e.label){let o=Ms.get(e.id),{x:c,y:f}=e;if(n){let a=K.calcLabelPosition(n);if(l.debug("Moving label "+e.label+" from (",c,",",f,") to (",a.x,",",a.y,") abc88"),r?.updatedPath)c=a.x,f=a.y}o.attr("transform",`translate(${c}, ${f+s/2})`)}if(e?.startLabelLeft){let o=Wt.get(e.id).startLeft,c=e?.x,f=e?.y;if(n){let a=K.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_left",n);c=a.x,f=a.y}o.attr("transform",`translate(${c}, ${f})`)}if(e.startLabelRight){let o=Wt.get(e.id).startRight,{x:c,y:f}=e;if(n){let a=K.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_right",n);c=a.x,f=a.y}o.attr("transform",`translate(${c}, ${f})`)}if(e.endLabelLeft){let o=Wt.get(e.id).endLeft,{x:c,y:f}=e;if(n){let a=K.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_left",n);c=a.x,f=a.y}o.attr("transform",`translate(${c}, ${f})`)}if(e.endLabelRight){let o=Wt.get(e.id).endRight,{x:c,y:f}=e;if(n){let a=K.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_right",n);c=a.x,f=a.y}o.attr("transform",`translate(${c}, ${f})`)}}t(J,"positionRenderedEdgeLabel");
2
2
  export{Rd,Fd,Ae,Ns,Rg,Ld,Ho,Md};
@@ -1 +1 @@
1
- import{d,e,nA,Ce,E,ht,it}from"./index-8hgm0abr.js";import{oa,ku,Ds,xu,wu}from"./index-dydwcp3n.js";function u(t,r){if(!t)return r;if(!r)return t;let n=Date.parse(t.generatedAt),s=Date.parse(r.generatedAt);if(Number.isNaN(n)||Number.isNaN(s))return t;return s>n?r:t}function R({className:t="",active:r=!0}){let{report:n,isLoading:s,error:o,reload:i}=wu(),l=Ce(nA,{enabled:r}),a=u(l.data,n),p=a?Ds(a):[];if(o&&!a)return e("div",{className:`flex h-full w-full flex-col items-center justify-center gap-2 p-8 text-center text-xs ${t}`,children:[e(E,{size:16,className:"text-error"}),e("p",{className:"text-error text-xs",children:o}),e("button",{type:"button",onClick:()=>i(),className:"text-[11px] font-semibold text-ink/70 hover:text-ink underline underline-offset-2",children:"Try again"})]});if(!a)return e("div",{className:`flex h-full w-full items-center justify-center text-ink/40 text-xs ${t}`,children:"Loading provider usage..."});return e("div",{className:`flex h-full w-full min-w-0 min-h-0 flex-col overflow-hidden bg-paper text-xs text-ink ${t}`,children:[e(ht,{left:e(d,{children:[e("h2",{className:"text-xs font-semibold text-ink uppercase tracking-wider",children:"Usage"}),e("span",{className:"text-[11px] text-ink/50 truncate",children:["Updated ",oa(a.generatedAt)]}),a.isMock&&e("span",{className:"text-[10px] font-mono uppercase tracking-wider bg-ink/5 border border-ink/15 rounded px-1.5 py-0.5 text-ink/60",children:"Mock"})]}),right:e(it,{label:"Refresh usage",onClick:()=>i({force:!0}),busy:s||l.refreshing,disabled:s})}),e("div",{className:"flex-1 min-w-0 min-h-0 w-full overflow-y-auto scrollbar-overlay-container p-3.5 space-y-4",children:[o&&e("p",{className:"text-error text-xs",children:o}),p.length>0?p.map((m)=>e(ku,{summary:m.summary},m.id)):e("p",{className:"text-[11px] text-ink/50 leading-relaxed",children:"No provider credentials detected. Add an API key in Settings → Providers and it will appear here."}),e(xu,{})]})]})}export{R as UsagePanel};
1
+ import{d,e,nA,Ce,E,ht,it}from"./index-pzvr1699.js";import{oa,ku,Ds,xu,wu}from"./index-r9db1gsf.js";function u(t,r){if(!t)return r;if(!r)return t;let n=Date.parse(t.generatedAt),s=Date.parse(r.generatedAt);if(Number.isNaN(n)||Number.isNaN(s))return t;return s>n?r:t}function R({className:t="",active:r=!0}){let{report:n,isLoading:s,error:o,reload:i}=wu(),l=Ce(nA,{enabled:r}),a=u(l.data,n),p=a?Ds(a):[];if(o&&!a)return e("div",{className:`flex h-full w-full flex-col items-center justify-center gap-2 p-8 text-center text-xs ${t}`,children:[e(E,{size:16,className:"text-error"}),e("p",{className:"text-error text-xs",children:o}),e("button",{type:"button",onClick:()=>i(),className:"text-[11px] font-semibold text-ink/70 hover:text-ink underline underline-offset-2",children:"Try again"})]});if(!a)return e("div",{className:`flex h-full w-full items-center justify-center text-ink/40 text-xs ${t}`,children:"Loading provider usage..."});return e("div",{className:`flex h-full w-full min-w-0 min-h-0 flex-col overflow-hidden bg-paper text-xs text-ink ${t}`,children:[e(ht,{left:e(d,{children:[e("h2",{className:"text-xs font-semibold text-ink uppercase tracking-wider",children:"Usage"}),e("span",{className:"text-[11px] text-ink/50 truncate",children:["Updated ",oa(a.generatedAt)]}),a.isMock&&e("span",{className:"text-[10px] font-mono uppercase tracking-wider bg-ink/5 border border-ink/15 rounded px-1.5 py-0.5 text-ink/60",children:"Mock"})]}),right:e(it,{label:"Refresh usage",onClick:()=>i({force:!0}),busy:s||l.refreshing,disabled:s})}),e("div",{className:"flex-1 min-w-0 min-h-0 w-full overflow-y-auto scrollbar-overlay-container p-3.5 space-y-4",children:[o&&e("p",{className:"text-error text-xs",children:o}),p.length>0?p.map((m)=>e(ku,{summary:m.summary},m.id)):e("p",{className:"text-[11px] text-ink/50 leading-relaxed",children:"No provider credentials detected. Add an API key in Settings → Providers and it will appear here."}),e(xu,{})]})]})}export{R as UsagePanel};
@@ -1,2 +1,2 @@
1
- import{t,Ht}from"./index-13dr1t1r.js";var N=5,R=0.00001,X=2,Y=0.6,w=0.000001;function P(n){let o=[];for(let r=0;r<n.length-1;r++)o.push({a:n[r],b:n[r+1]});return o}t(P,"buildSegmentList");function T(n,o,r,a){let c=o.x-n.x,s=o.y-n.y,u=a.x-r.x,f=a.y-r.y,d=c*f-s*u;if(d===0)return null;let e=r.x-n.x,i=r.y-n.y,h=(e*f-i*u)/d,p=(e*s-i*c)/d;if(h<=w||h>=1-w||p<=w||p>=1-w)return null;return{point:{x:n.x+h*c,y:n.y+h*s},tA:h,tB:p}}t(T,"segmentIntersection");function v(n){return Math.abs(n.b.x-n.a.x)>=Math.abs(n.b.y-n.a.y)}t(v,"isHorizontalSeg");function B(n,o,r){if(n.curve!=="rounded")return!1;let a=n.points,c=a[o],s=a[o+1];if(!c||!s)return!1;let u=Math.hypot(s.x-c.x,s.y-c.y),f=r*u,d=o>0?L(a[o-1],c,s,N):null;if(d&&f<d.cutLen)return!0;let e=o+2<a.length?L(c,s,a[o+2],N):null;return e!==null&&u-f<e.cutLen}t(B,"crossingSitsInRoundedCorner");function C(n){let o=[];for(let r=0;r<n.length;r++){let a=n[r],c=P(a.points);for(let s=r+1;s<n.length;s++){let u=n[s],f=P(u.points);for(let[d,e]of c.entries())for(let[i,h]of f.entries()){let p=T(e.a,e.b,h.a,h.b);if(!p)continue;if(B(a,d,p.tA)||B(u,i,p.tB))continue;let g=v(e),S=v(h);if(g!==S?g:!1)o.push({jumpEdgeId:a.id,otherEdgeId:u.id,segIndex:d,t:p.tA,point:p.point});else o.push({jumpEdgeId:u.id,otherEdgeId:a.id,segIndex:i,t:p.tB,point:p.point})}}}return o}t(C,"findEdgeIntersections");function M(n){let o=Math.round(n*1000)/1000;return Number.isInteger(o)?`${o}`:`${o}`}t(M,"fmt");function A(n){return`${M(n.x)},${M(n.y)}`}t(A,"pointToString");function D(n){let o=n.b.x-n.a.x,r=n.b.y-n.a.y;if(Math.abs(o)>=Math.abs(r))return o>=0?1:0;return r>=0?1:0}t(D,"getArcSweepFlag");function _(n,o){if(n.length<2)return n.map((s)=>({...s}));let r=n.map((s)=>({...s})),a=o.arrowTypeStart&&Ht[o.arrowTypeStart];if(a){let s=n[0],u=n[1],f=Math.atan2(u.y-s.y,u.x-s.x);r[0].x=s.x+a*Math.cos(f),r[0].y=s.y+a*Math.sin(f)}let c=o.arrowTypeEnd&&Ht[o.arrowTypeEnd];if(c){let s=n.length,u=n[s-2],f=n[s-1],d=Math.atan2(f.y-u.y,f.x-u.x);r[s-1].x=f.x-c*Math.cos(d),r[s-1].y=f.y-c*Math.sin(d)}return r}t(_,"applyMarkerOffsets");function k(n,o,r,a,c){let s=n.point.x,u=n.point.y,f={x:s-o*n.r,y:u-r*n.r},d={x:s+o*n.r,y:u+r*n.r},e=[`L${A(f)}`];if(c==="arc")e.push(`A${M(n.r)},${M(n.r)} 0 0 ${a} ${A(d)}`);else e.push(`M${A(d)}`);return e}t(k,"emitJump");function L(n,o,r,a){let c=o.x-n.x,s=o.y-n.y,u=r.x-o.x,f=r.y-o.y,d=Math.hypot(c,s),e=Math.hypot(u,f);if(d<R||e<R)return null;let i=c/d,h=s/d,p=u/e,g=f/e,S=i*p+h*g,b=Math.max(-1,Math.min(1,S)),x=Math.acos(b);if(x<R||Math.abs(Math.PI-x)<R)return null;let y=Math.min(a/Math.sin(x/2),d/2,e/2);return{startX:o.x-i*y,startY:o.y-h*y,endX:o.x+p*y,endY:o.y+g*y,ctrlX:o.x,ctrlY:o.y,cutLen:y}}t(L,"computeRoundedCorner");function H(n,o,r){let a=n.points;if(a.length<2)return"";let c=_(a,n),s=n.curve==="rounded",u=P(c),f=new Map;for(let e of o){let i=u[e.segIndex];if(!i)continue;let h=Math.hypot(i.b.x-i.a.x,i.b.y-i.a.y),p=f.get(e.segIndex)??[];p.push({t:e.t,point:e.point,d:e.t*h,r:r.jumpRadius}),f.set(e.segIndex,p)}let d=[`M${A(c[0])}`];for(let e=0;e<u.length;e++){let i=u[e],h=Math.hypot(i.b.x-i.a.x,i.b.y-i.a.y),p=h===0?0:(i.b.x-i.a.x)/h,g=h===0?0:(i.b.y-i.a.y)/h,S=D(i),b=0;if(s&&e>0){let l=L(c[e-1],c[e],c[e+1]??c[e],N);if(l)b=l.cutLen}let x=h,y=null;if(s&&e<u.length-1){if(y=L(c[e],c[e+1],c[e+2]??c[e+1],N),y)x=h-y.cutLen}let I=r.jumpRadius*Y,m=[...f.get(e)??[]].sort((l,E)=>l.t-E.t).filter((l)=>{let E=Math.min(l.d-b,x-l.d)-X;return l.r=Math.min(l.r,E),l.r>=I});for(let l=0;l<m.length-1;l++){let E=m[l+1].d-m[l].d;if(m[l].r+m[l+1].r>E){let O=E/2;m[l].r=Math.min(m[l].r,O),m[l+1].r=Math.min(m[l+1].r,O)}}for(let l of m){if(l.r<I)continue;d.push(...k(l,p,g,S,r.jumpStyle))}if(s&&y)d.push(`L${M(y.startX)},${M(y.startY)}`),d.push(`Q${M(y.ctrlX)},${M(y.ctrlY)} ${M(y.endX)},${M(y.endY)}`);else d.push(`L${A(i.b)}`)}return d.join(" ")}t(H,"rewriteEdgePath");function J(n){return/^[\d\s+,.LMelm-]*$/.test(n)}t(J,"isStraightPath");function U(n){if(!n)return!0;return n==="linear"||n==="rounded"||n==="step"||n==="stepBefore"||n==="stepAfter"}t(U,"curveSupportsLineHops");function j(n){if(!n)return null;try{let o=typeof atob==="function"?atob(n):Buffer.from(n,"base64").toString(),r=JSON.parse(o);if(!Array.isArray(r))return null;let a=[];for(let c of r)if(c&&typeof c.x==="number"&&typeof c.y==="number")a.push({x:c.x,y:c.y});return a.length>=2?a:null}catch{return null}}t(j,"decodeDataPoints");function Il(n,o,r){if(!r.enabled)return;let a=n.node();if(!a)return;let c=new Map;for(let e of o)c.set(e.id,e);let s=new Map;for(let e of a.querySelectorAll("path[data-id]")){let i=e.getAttribute("data-id");if(i!==null&&!s.has(i))s.set(i,e)}let u=[];for(let e of o){let i=s.get(e.id);if(!i)continue;let p=j(i.getAttribute("data-points"))??e.points;u.push({...e,points:p})}let f=C(u);if(f.length===0)return;let d=new Map;for(let e of f){let i=d.get(e.jumpEdgeId)??[];i.push(e),d.set(e.jumpEdgeId,i)}for(let e of u){let i=d.get(e.id);if(!i||i.length===0)continue;let p=c.get(e.id)?.curve;if(p!==void 0&&!U(p))continue;let g=s.get(e.id);if(!g)continue;if(p===void 0){let m=g.getAttribute("d")??"";if(!J(m))continue}let S=g.getAttribute("style")??"",b=/stroke-dasharray\s*:\s*0\s+([\d.]+)\s+[\d.]+\s+([\d.]+)/.exec(S),x=b?Number.parseFloat(b[1]):null,y=b?Number.parseFloat(b[2]):null,I=H(e,i,r);if(g.setAttribute("d",I),x!==null&&y!==null&&typeof g.getTotalLength==="function"){let m=g.getTotalLength(),l=Math.max(0,m-x-y),E=`0 ${x} ${l} ${y}`,O=S.replace(/stroke-dasharray\s*:[^;]*;?/g,`stroke-dasharray: ${E};`).replace(/;\s*;+/g,";");g.setAttribute("style",O)}}}t(Il,"applyLineJumpsToSvg");
1
+ import{t,Ht}from"./index-cz50ha6x.js";var N=5,R=0.00001,X=2,Y=0.6,w=0.000001;function P(n){let o=[];for(let r=0;r<n.length-1;r++)o.push({a:n[r],b:n[r+1]});return o}t(P,"buildSegmentList");function T(n,o,r,a){let c=o.x-n.x,s=o.y-n.y,u=a.x-r.x,f=a.y-r.y,d=c*f-s*u;if(d===0)return null;let e=r.x-n.x,i=r.y-n.y,h=(e*f-i*u)/d,p=(e*s-i*c)/d;if(h<=w||h>=1-w||p<=w||p>=1-w)return null;return{point:{x:n.x+h*c,y:n.y+h*s},tA:h,tB:p}}t(T,"segmentIntersection");function v(n){return Math.abs(n.b.x-n.a.x)>=Math.abs(n.b.y-n.a.y)}t(v,"isHorizontalSeg");function B(n,o,r){if(n.curve!=="rounded")return!1;let a=n.points,c=a[o],s=a[o+1];if(!c||!s)return!1;let u=Math.hypot(s.x-c.x,s.y-c.y),f=r*u,d=o>0?L(a[o-1],c,s,N):null;if(d&&f<d.cutLen)return!0;let e=o+2<a.length?L(c,s,a[o+2],N):null;return e!==null&&u-f<e.cutLen}t(B,"crossingSitsInRoundedCorner");function C(n){let o=[];for(let r=0;r<n.length;r++){let a=n[r],c=P(a.points);for(let s=r+1;s<n.length;s++){let u=n[s],f=P(u.points);for(let[d,e]of c.entries())for(let[i,h]of f.entries()){let p=T(e.a,e.b,h.a,h.b);if(!p)continue;if(B(a,d,p.tA)||B(u,i,p.tB))continue;let g=v(e),S=v(h);if(g!==S?g:!1)o.push({jumpEdgeId:a.id,otherEdgeId:u.id,segIndex:d,t:p.tA,point:p.point});else o.push({jumpEdgeId:u.id,otherEdgeId:a.id,segIndex:i,t:p.tB,point:p.point})}}}return o}t(C,"findEdgeIntersections");function M(n){let o=Math.round(n*1000)/1000;return Number.isInteger(o)?`${o}`:`${o}`}t(M,"fmt");function A(n){return`${M(n.x)},${M(n.y)}`}t(A,"pointToString");function D(n){let o=n.b.x-n.a.x,r=n.b.y-n.a.y;if(Math.abs(o)>=Math.abs(r))return o>=0?1:0;return r>=0?1:0}t(D,"getArcSweepFlag");function _(n,o){if(n.length<2)return n.map((s)=>({...s}));let r=n.map((s)=>({...s})),a=o.arrowTypeStart&&Ht[o.arrowTypeStart];if(a){let s=n[0],u=n[1],f=Math.atan2(u.y-s.y,u.x-s.x);r[0].x=s.x+a*Math.cos(f),r[0].y=s.y+a*Math.sin(f)}let c=o.arrowTypeEnd&&Ht[o.arrowTypeEnd];if(c){let s=n.length,u=n[s-2],f=n[s-1],d=Math.atan2(f.y-u.y,f.x-u.x);r[s-1].x=f.x-c*Math.cos(d),r[s-1].y=f.y-c*Math.sin(d)}return r}t(_,"applyMarkerOffsets");function k(n,o,r,a,c){let s=n.point.x,u=n.point.y,f={x:s-o*n.r,y:u-r*n.r},d={x:s+o*n.r,y:u+r*n.r},e=[`L${A(f)}`];if(c==="arc")e.push(`A${M(n.r)},${M(n.r)} 0 0 ${a} ${A(d)}`);else e.push(`M${A(d)}`);return e}t(k,"emitJump");function L(n,o,r,a){let c=o.x-n.x,s=o.y-n.y,u=r.x-o.x,f=r.y-o.y,d=Math.hypot(c,s),e=Math.hypot(u,f);if(d<R||e<R)return null;let i=c/d,h=s/d,p=u/e,g=f/e,S=i*p+h*g,b=Math.max(-1,Math.min(1,S)),x=Math.acos(b);if(x<R||Math.abs(Math.PI-x)<R)return null;let y=Math.min(a/Math.sin(x/2),d/2,e/2);return{startX:o.x-i*y,startY:o.y-h*y,endX:o.x+p*y,endY:o.y+g*y,ctrlX:o.x,ctrlY:o.y,cutLen:y}}t(L,"computeRoundedCorner");function H(n,o,r){let a=n.points;if(a.length<2)return"";let c=_(a,n),s=n.curve==="rounded",u=P(c),f=new Map;for(let e of o){let i=u[e.segIndex];if(!i)continue;let h=Math.hypot(i.b.x-i.a.x,i.b.y-i.a.y),p=f.get(e.segIndex)??[];p.push({t:e.t,point:e.point,d:e.t*h,r:r.jumpRadius}),f.set(e.segIndex,p)}let d=[`M${A(c[0])}`];for(let e=0;e<u.length;e++){let i=u[e],h=Math.hypot(i.b.x-i.a.x,i.b.y-i.a.y),p=h===0?0:(i.b.x-i.a.x)/h,g=h===0?0:(i.b.y-i.a.y)/h,S=D(i),b=0;if(s&&e>0){let l=L(c[e-1],c[e],c[e+1]??c[e],N);if(l)b=l.cutLen}let x=h,y=null;if(s&&e<u.length-1){if(y=L(c[e],c[e+1],c[e+2]??c[e+1],N),y)x=h-y.cutLen}let I=r.jumpRadius*Y,m=[...f.get(e)??[]].sort((l,E)=>l.t-E.t).filter((l)=>{let E=Math.min(l.d-b,x-l.d)-X;return l.r=Math.min(l.r,E),l.r>=I});for(let l=0;l<m.length-1;l++){let E=m[l+1].d-m[l].d;if(m[l].r+m[l+1].r>E){let O=E/2;m[l].r=Math.min(m[l].r,O),m[l+1].r=Math.min(m[l+1].r,O)}}for(let l of m){if(l.r<I)continue;d.push(...k(l,p,g,S,r.jumpStyle))}if(s&&y)d.push(`L${M(y.startX)},${M(y.startY)}`),d.push(`Q${M(y.ctrlX)},${M(y.ctrlY)} ${M(y.endX)},${M(y.endY)}`);else d.push(`L${A(i.b)}`)}return d.join(" ")}t(H,"rewriteEdgePath");function J(n){return/^[\d\s+,.LMelm-]*$/.test(n)}t(J,"isStraightPath");function U(n){if(!n)return!0;return n==="linear"||n==="rounded"||n==="step"||n==="stepBefore"||n==="stepAfter"}t(U,"curveSupportsLineHops");function j(n){if(!n)return null;try{let o=typeof atob==="function"?atob(n):Buffer.from(n,"base64").toString(),r=JSON.parse(o);if(!Array.isArray(r))return null;let a=[];for(let c of r)if(c&&typeof c.x==="number"&&typeof c.y==="number")a.push({x:c.x,y:c.y});return a.length>=2?a:null}catch{return null}}t(j,"decodeDataPoints");function Il(n,o,r){if(!r.enabled)return;let a=n.node();if(!a)return;let c=new Map;for(let e of o)c.set(e.id,e);let s=new Map;for(let e of a.querySelectorAll("path[data-id]")){let i=e.getAttribute("data-id");if(i!==null&&!s.has(i))s.set(i,e)}let u=[];for(let e of o){let i=s.get(e.id);if(!i)continue;let p=j(i.getAttribute("data-points"))??e.points;u.push({...e,points:p})}let f=C(u);if(f.length===0)return;let d=new Map;for(let e of f){let i=d.get(e.jumpEdgeId)??[];i.push(e),d.set(e.jumpEdgeId,i)}for(let e of u){let i=d.get(e.id);if(!i||i.length===0)continue;let p=c.get(e.id)?.curve;if(p!==void 0&&!U(p))continue;let g=s.get(e.id);if(!g)continue;if(p===void 0){let m=g.getAttribute("d")??"";if(!J(m))continue}let S=g.getAttribute("style")??"",b=/stroke-dasharray\s*:\s*0\s+([\d.]+)\s+[\d.]+\s+([\d.]+)/.exec(S),x=b?Number.parseFloat(b[1]):null,y=b?Number.parseFloat(b[2]):null,I=H(e,i,r);if(g.setAttribute("d",I),x!==null&&y!==null&&typeof g.getTotalLength==="function"){let m=g.getTotalLength(),l=Math.max(0,m-x-y),E=`0 ${x} ${l} ${y}`,O=S.replace(/stroke-dasharray\s*:[^;]*;?/g,`stroke-dasharray: ${E};`).replace(/;\s*;+/g,";");g.setAttribute("style",O)}}}t(Il,"applyLineJumpsToSvg");
2
2
  export{Il};