@kabmo-labs/kabmo 0.33.0 → 0.34.0
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.
- package/dist/client/index.html +1 -1
- package/dist/client/index.js +785 -624
- package/dist/client/static/js/{CsvGrid-fncjbg6j.js → CsvGrid-vze4m5ag.js} +1 -1
- package/dist/client/static/js/{DocxView-c9v2vr3r.js → DocxView-jbf21gmh.js} +5 -5
- package/dist/client/static/js/{DrawioView-vxjksm12.js → DrawioView-b52qybx5.js} +2 -2
- package/dist/client/static/js/{ImageView-a3g5k226.js → ImageView-mdgzj8px.js} +1 -1
- package/dist/client/static/js/{LayoutWrapper-hnjfwsjh.js → LayoutWrapper-3c49dvtt.js} +2 -2
- package/dist/client/static/js/Modal-sqp864vd.js +38 -0
- package/dist/client/static/js/{PdfView-ksaes53y.js → PdfView-g06rxqb1.js} +1 -1
- package/dist/client/static/js/{SessionsView-30vcr95v.js → SessionsView-521adxyr.js} +1 -1
- package/dist/client/static/js/{SheetView-vc484scg.js → SheetView-h8xmsz7q.js} +22 -22
- package/dist/client/static/js/{SvgPreview-tph89jet.js → SvgPreview-1j4jvcvz.js} +1 -1
- package/dist/client/static/js/{abnfDiagram-O67JEVCF-xbar278c.js → abnfDiagram-O67JEVCF-pasxh4b6.js} +1 -1
- package/dist/client/static/js/architecture-7GRP2DOG-fc9kmq1w.js +1 -0
- package/dist/client/static/js/{architectureDiagram-NJMV4G6O-s171n2z6.js → architectureDiagram-NJMV4G6O-ms14g0bm.js} +4 -4
- package/dist/client/static/js/{blockDiagram-BEXU5L5S-gzx6rv9n.js → blockDiagram-BEXU5L5S-ycn78fcq.js} +4 -4
- package/dist/client/static/js/{c4Diagram-YGBWAQC7-7f00skch.js → c4Diagram-YGBWAQC7-vn2gpjfm.js} +5 -5
- package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-j79v95nc.js → classDiagram-v2-NBCMYWYE-fyrm1pr5.js} +4 -4
- package/dist/client/static/js/{cose-bilkent-JH36ORCC-5fkn7ee5.js → cose-bilkent-JH36ORCC-ea5nwvgq.js} +1 -1
- package/dist/client/static/js/cynefin-OW5HDTMX-a4t8992q.js +1 -0
- package/dist/client/static/js/{cynefinDiagram-VND7K2PF-cfs1yvrd.js → cynefinDiagram-VND7K2PF-j6bsjpre.js} +1 -1
- package/dist/client/static/js/{dagre-6A5THRUB-44bgc48p.js → dagre-6A5THRUB-4smdkwv8.js} +2 -2
- package/dist/client/static/js/{diagram-22UHCM2B-a4g4x83k.js → diagram-22UHCM2B-9sm4kqwc.js} +11 -11
- package/dist/client/static/js/{diagram-3UASUU5V-gm4rg5na.js → diagram-3UASUU5V-2h3qxaed.js} +1 -1
- package/dist/client/static/js/{diagram-ATOU4E4O-a95y41vk.js → diagram-ATOU4E4O-1981bc94.js} +3 -3
- package/dist/client/static/js/{diagram-CDSNMT55-t3j93mmc.js → diagram-CDSNMT55-3vgsxavc.js} +4 -4
- package/dist/client/static/js/{diagram-MLGK6HIB-c2wdez02.js → diagram-MLGK6HIB-c9gf2r3f.js} +2 -2
- package/dist/client/static/js/{diagram-MPIPVDR6-gya9jhs5.js → diagram-MPIPVDR6-gjqeq92d.js} +2 -2
- package/dist/client/static/js/{dockerfile-a7q6174s.js → dockerfile-8v935dkn.js} +1 -1
- package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-jjhkza6t.js → ebnfDiagram-ZINNZB2B-4vbsgh99.js} +1 -1
- package/dist/client/static/js/{elixir-rpa1g4gy.js → elixir-vcbg60wv.js} +1 -1
- package/dist/client/static/js/{elk-276RUBZZ-f7re45mw.js → elk-276RUBZZ-nca3t891.js} +1 -1
- package/dist/client/static/js/{erDiagram-OPXOYQCR-tpm9g5te.js → erDiagram-OPXOYQCR-5kfkev03.js} +2 -2
- package/dist/client/static/js/eventmodeling-NTZA5JFV-18bdrkv5.js +1 -0
- package/dist/client/static/js/flowDiagram-KWPJA3E3-fg0yqx0h.js +1 -0
- package/dist/client/static/js/{ganttDiagram-FUAMR5RP-fz43n12d.js → ganttDiagram-FUAMR5RP-mxc73wmq.js} +3 -3
- package/dist/client/static/js/gitGraph-4MIJSDKK-8fa6y40p.js +1 -0
- package/dist/client/static/js/{gitGraphDiagram-X574FWY7-f61hgbn6.js → gitGraphDiagram-X574FWY7-7en3ag0e.js} +12 -12
- package/dist/client/static/js/html-dbrwss36.js +1 -0
- package/dist/client/static/js/{index-m73za75e.js → index-0vm41je9.js} +3 -3
- package/dist/client/static/js/{index-eyzeya95.js → index-1b0t1428.js} +5 -5
- package/dist/client/static/js/{index-2x5f66t6.js → index-1ksg88qf.js} +1 -1
- package/dist/client/static/js/{index-sffjtm5w.js → index-231241f4.js} +9 -9
- package/dist/client/static/js/index-2mx9ej4k.css +1 -0
- package/dist/client/static/js/{index-8239j2v1.js → index-4g46wbdw.js} +1 -1
- package/dist/client/static/js/{index-1xqs14fr.js → index-4qwzxj81.js} +1 -1
- package/dist/client/static/js/{index-gcs49f3p.js → index-52rqxgya.js} +1 -1
- package/dist/client/static/js/{index-at6bhjyf.js → index-6sf2vsp2.js} +1 -1
- package/dist/client/static/js/{index-q2w6s8n7.js → index-7a64yjrm.js} +4 -4
- package/dist/client/static/js/{index-rg8jpbsw.js → index-8acv5b77.js} +2 -2
- package/dist/client/static/js/{index-js7t1vb1.js → index-a0fmsv1d.js} +5 -5
- package/dist/client/static/js/{index-w0fwb80e.js → index-ag2rmtas.js} +1 -1
- package/dist/client/static/js/{index-djmg1d7h.js → index-b29afsjh.js} +1 -1
- package/dist/client/static/js/{index-e4p4cd3r.js → index-c3ek61zv.js} +1 -1
- package/dist/client/static/js/{index-0e40xskg.js → index-cd65zqba.js} +1 -1
- package/dist/client/static/js/{index-zt75xpq0.js → index-cgzrpvzj.js} +204 -204
- package/dist/client/static/js/{index-0n5wwe60.js → index-ev3yt353.js} +2 -2
- package/dist/client/static/js/{index-9y3gjdj7.js → index-eyfcm0cy.js} +1 -1
- package/dist/client/static/js/{index-qsm2z36d.js → index-f7jhhqtk.js} +1 -1
- package/dist/client/static/js/{index-vw5k8csz.js → index-fta1y9pc.js} +50 -50
- package/dist/client/static/js/{index-ajs3jj6j.js → index-fvmfge3p.js} +1 -1
- package/dist/client/static/js/{index-pxv2nw9w.js → index-g2dyfze9.js} +1 -1
- package/dist/client/static/js/{index-bkye8mz4.js → index-h5bn97p6.js} +1 -1
- package/dist/client/static/js/{index-trm9x02n.js → index-j51d5a5m.js} +6 -6
- package/dist/client/static/js/{index-pbe4yed4.js → index-jsyekbx9.js} +2 -2
- package/dist/client/static/js/{index-gs6f0qwa.js → index-nccwxv0s.js} +2 -2
- package/dist/client/static/js/{index-d495kfm0.js → index-p0nz38bm.js} +1 -1
- package/dist/client/static/js/{index-sdtye3jy.js → index-pm6xxwz1.js} +2 -2
- package/dist/client/static/js/{index-3rcjx70v.js → index-ptcrwswj.js} +1 -1
- package/dist/client/static/js/{index-14vndmcr.js → index-ptcwae2n.js} +1 -1
- package/dist/client/static/js/{index-5tgq7aqx.js → index-r014brzs.js} +2 -2
- package/dist/client/static/js/{index-xj9649ac.js → index-ray2czf6.js} +7 -7
- package/dist/client/static/js/{index-apvkd37e.js → index-rs80cwsv.js} +3 -3
- package/dist/client/static/js/{index-vw4brsdx.js → index-rzxcj7cg.js} +1 -1
- package/dist/client/static/js/{index-a293pdg7.js → index-s7gkkkyz.js} +2 -2
- package/dist/client/static/js/{index-1a0zkj8h.js → index-sd66wv26.js} +2 -2
- package/dist/client/static/js/{index-ypx3qmhq.js → index-vhqe0y82.js} +1 -1
- package/dist/client/static/js/{index-9fjt5anh.js → index-vy6termr.js} +1 -1
- package/dist/client/static/js/{index-0tf0arsp.js → index-xx6mqpxm.js} +3 -3
- package/dist/client/static/js/{index-03h3bkcf.js → index-ybm2x4vh.js} +1 -1
- package/dist/client/static/js/info-A6RAGUB7-3hk844f7.js +1 -0
- package/dist/client/static/js/{infoDiagram-VRGFBTTK-1qj804sn.js → infoDiagram-VRGFBTTK-sef80132.js} +2 -2
- package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-4j4qsnzw.js → ishikawaDiagram-OU5B5YK6-yhvepp1q.js} +6 -6
- package/dist/client/static/js/{journeyDiagram-ZHPQQLJL-j0brnfft.js → journeyDiagram-ZHPQQLJL-5w77y95w.js} +5 -5
- package/dist/client/static/js/{julia-4ghmfy3e.js → julia-d4j6wgvf.js} +1 -1
- package/dist/client/static/js/{kanban-definition-PNTS6WVX-qqc22br0.js → kanban-definition-PNTS6WVX-02znqtna.js} +6 -6
- package/dist/client/static/js/{mermaid.core-vv3wbe65.js → mermaid.core-a6e6vck4.js} +5 -5
- package/dist/client/static/js/{mindmap-definition-NLK3R4M7-y5b2z8zp.js → mindmap-definition-NLK3R4M7-y4n74q9x.js} +8 -8
- package/dist/client/static/js/one-dark-pro-vwhfpzr8.js +1 -0
- package/dist/client/static/js/one-light-y5t9x6zh.js +1 -0
- package/dist/client/static/js/packet-AYTQ26CC-4nj2yy10.js +1 -0
- package/dist/client/static/js/{pegDiagram-GJSIUBJH-0be07mqs.js → pegDiagram-GJSIUBJH-pr7ehgzb.js} +1 -1
- package/dist/client/static/js/{perl-sd00t4b4.js → perl-srptw5vm.js} +1 -1
- package/dist/client/static/js/{php-2zfyqa61.js → php-n89g3fk7.js} +1 -1
- package/dist/client/static/js/pie-WAS4IAKB-k7rde3f9.js +1 -0
- package/dist/client/static/js/{pieDiagram-5QR66LMP-544w86jk.js → pieDiagram-5QR66LMP-39wpsk08.js} +2 -2
- package/dist/client/static/js/{quadrantDiagram-O4NWA36T-p09e7z5s.js → quadrantDiagram-O4NWA36T-esm913km.js} +5 -5
- package/dist/client/static/js/radar-RG4KPBEZ-513dpw4f.js +1 -0
- package/dist/client/static/js/railroad-74A4TZTK-9bqnst9c.js +1 -0
- package/dist/client/static/js/railroad-abnf-HS5TGJTU-7367d5bv.js +1 -0
- package/dist/client/static/js/railroad-ebnf-LZEXJU2U-b806b1mj.js +1 -0
- package/dist/client/static/js/railroad-peg-WCYAUIDC-5a67rwf8.js +1 -0
- package/dist/client/static/js/{railroadDiagram-XR7U4H2S-de830ed2.js → railroadDiagram-XR7U4H2S-wy2mgya6.js} +1 -1
- package/dist/client/static/js/{requirementDiagram-PLB6GJNP-b47d74p1.js → requirementDiagram-PLB6GJNP-6z9xdgbq.js} +2 -2
- package/dist/client/static/js/{ruby-v9qaqhby.js → ruby-r81ytgcm.js} +1 -1
- package/dist/client/static/js/{rust-fkt0qyrs.js → rust-frn3szvc.js} +1 -1
- package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-6ezc2fpj.js → sankeyDiagram-IPEJSGJF-rtmxk3ys.js} +4 -4
- package/dist/client/static/js/{sequenceDiagram-PO4LG4MO-by5zqj6w.js → sequenceDiagram-PO4LG4MO-awzcrafg.js} +18 -18
- package/dist/client/static/js/{sizeCapture-INFHLROL-q85r06j6.js → sizeCapture-INFHLROL-03gy196j.js} +1 -1
- package/dist/client/static/js/sql-0e9mnrda.js +1 -0
- package/dist/client/static/js/{stateDiagram-v2-GCMORJYK-ep5pyexs.js → stateDiagram-v2-GCMORJYK-an8v3q5n.js} +3 -3
- package/dist/client/static/js/{swimlanes-2SLR337P-95fcqkh8.js → swimlanes-2SLR337P-n9yb4wcs.js} +1 -1
- package/dist/client/static/js/{swimlanesDiagram-TC7HE7FX-xs2en5dv.js → swimlanesDiagram-TC7HE7FX-nx5nfnf0.js} +1 -1
- package/dist/client/static/js/{timeline-definition-EJHVYXUP-461e615g.js → timeline-definition-EJHVYXUP-jceb575g.js} +4 -4
- package/dist/client/static/js/treeView-Q6P3EWNA-kcy40evb.js +1 -0
- package/dist/client/static/js/treemap-WGGIJYW6-fsrvqxf4.js +1 -0
- package/dist/client/static/js/{usecaseDiagram-POWQR4AR-ftqfnvhg.js → usecaseDiagram-POWQR4AR-888h3100.js} +13 -13
- package/dist/client/static/js/{vennDiagram-UO4OBE2U-7t96h6ez.js → vennDiagram-UO4OBE2U-wbfz0rzv.js} +7 -7
- package/dist/client/static/js/{vue-j8vb9d7r.js → vue-c0rtg1wf.js} +1 -1
- package/dist/client/static/js/wardley-WFR3VGLG-36dmxww4.js +1 -0
- package/dist/client/static/js/{wardleyDiagram-VNRHLVJA-0de8w8c6.js → wardleyDiagram-VNRHLVJA-rn8c5qf9.js} +4 -4
- package/dist/client/static/js/{xychartDiagram-PMCCYNJV-dez9phkf.js → xychartDiagram-PMCCYNJV-8sn1apt6.js} +5 -5
- package/package.json +4 -1
- package/src/client/components/auth/login-screen/index.tsx +1 -0
- package/src/client/components/common/MarkdownRenderer.tsx +9 -12
- package/src/client/components/settings/Modal.tsx +14 -84
- package/src/client/components/settings/Sidebar.tsx +3 -1
- package/src/client/components/settings/categories/ConnectSettings.tsx +105 -0
- package/src/client/components/settings/categories/connect-settings/DeviceTable.tsx +145 -0
- package/src/client/components/settings/categories/connect-settings/PairDialog.tsx +160 -0
- package/src/client/components/settings/categories/connect-settings/QrCode.tsx +73 -0
- package/src/client/components/settings/categories/connect-settings/ServerCard.tsx +94 -0
- package/src/client/components/settings/categories/connect-settings/TunnelRow.tsx +127 -0
- package/src/client/components/settings/category-content.tsx +116 -0
- package/src/client/components/workspace/chat-timeline/ChangedFilesSummary.test.tsx +120 -0
- package/src/client/components/workspace/chat-timeline/ChangedFilesSummary.tsx +56 -20
- package/src/client/components/workspace/chat-timeline/RunFooter.tsx +1 -0
- package/src/client/hooks/chat/timeline/change-stats.ts +57 -0
- package/src/client/hooks/connect/use-connect-status.ts +116 -0
- package/src/client/hooks/connect/use-pairing.ts +100 -0
- package/src/client/hooks/ui/clipboard.ts +26 -0
- package/src/client/tailwind.css +5 -0
- package/src/server/index.ts +2 -0
- package/src/server/lib/assets/font-css.server.test.ts +19 -0
- package/src/server/lib/auth/client-address.test.ts +58 -0
- package/src/server/lib/auth/client-address.ts +37 -3
- package/src/server/lib/auth/guard.ts +31 -4
- package/src/server/lib/auth/rate-limit.test.ts +25 -8
- package/src/server/lib/auth/rate-limit.ts +8 -5
- package/src/server/lib/connect/cloudflared.lifecycle.test.ts +88 -0
- package/src/server/lib/connect/cloudflared.server.test.ts +65 -0
- package/src/server/lib/connect/cloudflared.server.ts +206 -0
- package/src/server/lib/connect/devices.server.ts +192 -0
- package/src/server/lib/connect/identity.server.ts +81 -0
- package/src/server/lib/connect/pairing.server.test.ts +56 -0
- package/src/server/lib/connect/pairing.server.ts +113 -0
- package/src/server/lib/connect/qr.roundtrip.test.ts +106 -0
- package/src/server/lib/connect/qr.server.ts +36 -0
- package/src/server/lib/connect/run.server.ts +101 -0
- package/src/server/lib/connect/status.server.ts +177 -0
- package/src/server/lib/connect/tailscale.server.test.ts +117 -0
- package/src/server/lib/connect/tailscale.server.ts +172 -0
- package/src/server/lib/db/schema.ts +4 -0
- package/src/server/lib/omp/session/changes.test.ts +64 -1
- package/src/server/lib/omp/session/changes.ts +94 -1
- package/src/server/routes/connect/devices.ts +56 -0
- package/src/server/routes/connect/index.ts +15 -0
- package/src/server/routes/connect/pair-page.ts +177 -0
- package/src/server/routes/connect/pair.ts +158 -0
- package/src/server/routes/connect/status.ts +19 -0
- package/src/server/routes/connect/tunnels.ts +76 -0
- package/src/server/routes/health/probe.ts +5 -0
- package/src/server/routes/index.ts +2 -0
- package/src/server/routes/sessions/changes.test.ts +12 -3
- package/src/server/routes/sessions/changes.ts +27 -3
- package/src/server/routes/sessions/index.ts +2 -1
- package/src/shared/lib/connect/payload.test.ts +144 -0
- package/src/shared/lib/connect/payload.ts +229 -0
- package/src/shared/lib/connect/tier.test.ts +73 -0
- package/src/shared/lib/connect/tier.ts +105 -0
- package/src/shared/lib/connect/types.ts +99 -0
- package/src/shared/lib/markdown/fira-code-fonts.css +65 -6
- package/src/shared/lib/markdown/marked.ts +7 -4
- package/src/shared/lib/markdown/mermaid-actions.test.ts +78 -0
- package/src/shared/lib/markdown/mermaid-actions.ts +45 -0
- package/src/shared/lib/markdown/mermaid.ts +41 -7
- package/src/shared/lib/settings/sections.ts +6 -1
- package/src/shared/types/session-changes.ts +6 -0
- package/src/shared/types/settings/state.ts +2 -0
- package/dist/client/static/js/Modal-qtftcp2t.js +0 -38
- package/dist/client/static/js/architecture-7GRP2DOG-tavtgb8a.js +0 -1
- package/dist/client/static/js/cynefin-OW5HDTMX-cdh3n2z2.js +0 -1
- package/dist/client/static/js/eventmodeling-NTZA5JFV-as97tpyp.js +0 -1
- package/dist/client/static/js/flowDiagram-KWPJA3E3-ggm06d12.js +0 -1
- package/dist/client/static/js/gitGraph-4MIJSDKK-eqz7p9ng.js +0 -1
- package/dist/client/static/js/html-pv88ny12.js +0 -1
- package/dist/client/static/js/index-e94a1en0.css +0 -1
- package/dist/client/static/js/info-A6RAGUB7-4pkzh1qx.js +0 -1
- package/dist/client/static/js/one-dark-pro-hm3f56n1.js +0 -1
- package/dist/client/static/js/one-light-xrz49rct.js +0 -1
- package/dist/client/static/js/packet-AYTQ26CC-yg71sp88.js +0 -1
- package/dist/client/static/js/pie-WAS4IAKB-89wd6np0.js +0 -1
- package/dist/client/static/js/radar-RG4KPBEZ-avn0b8r9.js +0 -1
- package/dist/client/static/js/railroad-74A4TZTK-de27xv5w.js +0 -1
- package/dist/client/static/js/railroad-abnf-HS5TGJTU-rg4zzj7x.js +0 -1
- package/dist/client/static/js/railroad-ebnf-LZEXJU2U-d84fhj8v.js +0 -1
- package/dist/client/static/js/railroad-peg-WCYAUIDC-dvf8xrmc.js +0 -1
- package/dist/client/static/js/sql-g8wcshpc.js +0 -1
- package/dist/client/static/js/treeView-Q6P3EWNA-mham0bh6.js +0 -1
- package/dist/client/static/js/treemap-WGGIJYW6-mxrxax86.js +0 -1
- package/dist/client/static/js/wardley-WFR3VGLG-8vrvh9p3.js +0 -1
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import{t,l,ot,
|
|
1
|
+
import{t,l,ot,ia,x,R,L,z,O,U,j,G,p,oa,Bo,h,nr,rr,W,An,st,Ye,Je,zn,Ol,_t,St,kn,Tt,lt}from"./index-fta1y9pc.js";import{Nt}from"./index-cgzrpvzj.js";import{Na}from"./index-1ksg88qf.js";var bt={SHAPE_UNSUPPORTED:"SHAPE_UNSUPPORTED",SHAPE_REMOVED:"SHAPE_REMOVED",EDGE_OPERATOR_UNSUPPORTED:"EDGE_OPERATOR_UNSUPPORTED",REFERENCE_EDGE_LABEL_REJECTED:"REFERENCE_EDGE_LABEL_REJECTED",CONNECTOR_REF_UNRESOLVED:"CONNECTOR_REF_UNRESOLVED",CONNECTOR_REF_NOT_A_CONNECTOR:"CONNECTOR_REF_NOT_A_CONNECTOR",METADATA_KEY_MISAPPLIED:"METADATA_KEY_MISAPPLIED",DUPLICATE_ID_NODE:"DUPLICATE_ID_NODE",RESERVED_SYNTHETIC_ID:"RESERVED_SYNTHETIC_ID",CONTAINMENT_VIOLATION:"CONTAINMENT_VIOLATION",EDGE_SEMANTIC_CONTRADICTION:"EDGE_SEMANTIC_CONTRADICTION",FLOW_NO_INPUT:"FLOW_NO_INPUT"},y1=new Set([bt.SHAPE_UNSUPPORTED,bt.SHAPE_REMOVED,bt.CONTAINMENT_VIOLATION]),ms=new Set(Object.values(bt).filter((e)=>!y1.has(e))),w1=new Map([["task","roundedRect"],["tool","subroutine"],["input","lean-right"],["decision","diamond"],["refdoc","lin-doc"],["action","hexagon"],["round","rect"]]),N1=new Set(["doc","stadium","terminal","circle","trapezoid","inv_trapezoid","inv-trapezoid","doublecircle","double-circle","typeDeclaration","procs","lean_left","lean-left","in-out","cylinder","ellipse","odd","tag-rect","tagged-rectangle","delay","half-rounded-rectangle","lin-rect","lined-rectangle","win-pane","window-pane","curv-trap","curved-trapezoid"]),R1=new Set(["roundedRect","subroutine","subprocess","subproc","framed-rectangle","lean-right","diamond","lin-doc","lined-document","hexagon","hex","connector","collapsedGroup"]),ft="roundedRect";function gt(e){if(!e)return e;return w1.get(e)??e}t(gt,"resolveShapeAlias");function E1(e,r){for(let n of e){if(n.isGroup)continue;if(!n.shape||n.shape==="squareRect"||n.shape==="rect")n.shape=ft;if(N1.has(n.shape)){let a=`shape "${n.shape}" was removed in v0.8.1, using "${ft}"`;if(r?.emitError)r.emitError("SHAPE_REMOVED",a,{nodeId:n.id});else l.warn(`agentflow: ${a}`);n.shape=ft;continue}if(!R1.has(n.shape)){let a=`shape "${n.shape}" is not supported, using "${ft}"`;if(r?.emitWarning)r.emitWarning("SHAPE_UNSUPPORTED",a,{nodeId:n.id});else l.warn(`agentflow: ${a}`);n.shape=ft}}}t(E1,"normaliseNodeShapes");var Qt=new Map([["tool",0],["task",1],["decision",2],["input",3],["refdoc",4],["connector",5],["action",6]]),C1=Qt.size,S1=t((e)=>`af-kind-${e}`,"kindClass"),O1=[...Qt.keys()],x1=t((e)=>Math.max(1,e-C1),"containerSlotCount"),T1=t((e,r)=>{let n=C1+e%x1(r);return r>0?n%r:n},"containerSlot");function D1(e,r,n){let a=p().themeVariables?.borderColorArray,c=Array.isArray(a)?a.length:0,d=n.size;for(let o of e??[]){if(o.isGroup||o.shape==="collapsedGroup"){let m=n.get(String(o.id))??d++;o.colorIndex=T1(m,c);continue}let f=r(String(o.id));if(f&&Qt.has(f))o.cssClasses=`${o.cssClasses??""} ${S1(f)}`.replace(/\s+/g," ").trim()}}t(D1,"assignColorSlots");var A1="agentflow-",i1=new Set(["shape","view","icon","img","form","pos","w","h","class","style","labelType"]),P1=new Set(["subroutine","subprocess","subproc","framed-rectangle","tool"]),G1={flow:"flowGroup"};function Xt(e){if(Array.isArray(e))return e.map((n)=>Xt(n));if(e===null||typeof e!=="object")return e;let r={};for(let n of Object.keys(e)){if(n==="__proto__"||n==="constructor"||n==="prototype")continue;r[n]=Xt(e[n])}return r}t(Xt,"stripPrototypeKeys");function _1(e){let r=!1,n=!1,a=0,c,d=[];for(let o of e.split(`
|
|
2
2
|
`)){if(c!==void 0){let A=o.length-o.trimStart().length;if(o.trim()===""||A>c){d.push(o);continue}c=void 0}let f=-1;for(let A=0;A<o.length;A++){let C=o[A];if(n){if(C==="\\")A++;else if(C==='"')n=!1}else if(r){if(C==="'")r=!1}else if(C==='"')n=!0;else if(C==="'")r=!0;else if(C==="#"&&(A===0||o[A-1]===" "||o[A-1]==="\t")){f=A;break}else if(C==="["||C==="{")a++;else if(C==="]"||C==="}")a=Math.max(0,a-1)}if(r||n||a>0){d.push(o);continue}let m=f>=0?o.slice(0,f):o,k=f>=0?o.slice(f):"";if(/:\s*[>|][\d+-]*\s*$/.test(m)){c=o.length-o.trimStart().length,d.push(o);continue}d.push(m.replace(/,([\t ]*)$/,"$1")+k)}return d.join(`
|
|
3
|
-
`)}t(_1,"stripLineTrailingCommas");var U1=class{constructor(){this.vertexCounter=0,this.config=p(),this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.globalNodes=new Set,this.connectors=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.diagramId="",this.preserveCommentsWhenParsing=!0,this.frontmatterLineOffset=0,this.elementMappings=[],this.bareVertexMappings=new WeakSet,this.diagnostics=[],this.postParseValidationRun=!1,this.funs=[],this.setAccTitle=L,this.setAccDescription=
|
|
3
|
+
`)}t(_1,"stripLineTrailingCommas");var U1=class{constructor(){this.vertexCounter=0,this.config=p(),this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.globalNodes=new Set,this.connectors=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.diagramId="",this.preserveCommentsWhenParsing=!0,this.frontmatterLineOffset=0,this.elementMappings=[],this.bareVertexMappings=new WeakSet,this.diagnostics=[],this.postParseValidationRun=!1,this.funs=[],this.setAccTitle=L,this.setAccDescription=O,this.setDiagramTitle=j,this.getAccTitle=z,this.getAccDescription=U,this.getDiagramTitle=G,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addGlobal=this.addGlobal.bind(this),this.addConnector=this.addConnector.bind(this),this.addConnectorMapping=this.addConnectorMapping.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.setFrontmatterLineOffset=this.setFrontmatterLineOffset.bind(this),this.addVertexMapping=this.addVertexMapping.bind(this),this.extendVertexMapping=this.extendVertexMapping.bind(this),this.addEdgeMapping=this.addEdgeMapping.bind(this),this.addSubgraphMapping=this.addSubgraphMapping.bind(this),this.emitWarning=this.emitWarning.bind(this),this.emitError=this.emitError.bind(this),this.getDiagnostics=this.getDiagnostics.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}static{t(this,"AgentFlowDB")}sanitizeText(e){return x.sanitizeText(e,this.config)}sanitizeNodeLabelType(e){switch(e){case"markdown":case"string":case"text":return e;default:return"markdown"}}setDiagramId(e){this.diagramId=e}lookUpDomId(e){for(let r of this.vertices.values())if(r.id===e)return this.diagramId?`${this.diagramId}-${r.domId}`:r.domId;return this.diagramId?`${this.diagramId}-${e}`:e}addVertex(e,r,n,a,c,d,o={},f,m){if(!e||e.trim().length===0)return;let k;if(f!==void 0){let E;if(!f.includes(`
|
|
4
4
|
`))E=`{
|
|
5
5
|
`+f+`
|
|
6
6
|
}`;else E=f+`
|
|
7
7
|
`;try{k=rr(E,{schema:nr})??{}}catch(g){let b=f.includes(`
|
|
8
8
|
`)?_1(f):f;if(b!==f)try{k=rr(b+`
|
|
9
|
-
`,{schema:nr})??{}}catch{this.rethrowMetadataYamlError(g,f,m)}else this.rethrowMetadataYamlError(g,f,m)}k=Xt(k)}let A;if(k&&typeof k.shape==="string"){let E=k;A=E.shape;let g=gt(A);if(g&&g!==A)E.shape=g}let C=this.subGraphLookup.get(e);if(C&&k){C.metadata={...C.metadata,...k};return}let B=this.connectors.get(e);if(B&&k){B.metadata={...B.metadata,...k};return}if(e==="connectors")return;let _=this.edges.find((E)=>E.id===e);if(_){let E=k;if(E?.animate!==void 0)_.animate=E.animate;if(E?.animation!==void 0)_.animation=E.animation;if(E?.curve!==void 0)_.interpolate=E.curve;if(k)_.metadata={..._.metadata,...k};return}let
|
|
9
|
+
`,{schema:nr})??{}}catch{this.rethrowMetadataYamlError(g,f,m)}else this.rethrowMetadataYamlError(g,f,m)}k=Xt(k)}let A;if(k&&typeof k.shape==="string"){let E=k;A=E.shape;let g=gt(A);if(g&&g!==A)E.shape=g}let C=this.subGraphLookup.get(e);if(C&&k){C.metadata={...C.metadata,...k};return}let B=this.connectors.get(e);if(B&&k){B.metadata={...B.metadata,...k};return}if(e==="connectors")return;let _=this.edges.find((E)=>E.id===e);if(_){let E=k;if(E?.animate!==void 0)_.animate=E.animate;if(E?.animation!==void 0)_.animation=E.animation;if(E?.curve!==void 0)_.interpolate=E.curve;if(k)_.metadata={..._.metadata,...k};return}let P,F=this.vertices.get(e);if(F===void 0)F={id:e,labelType:"text",domId:A1+e+"-"+this.vertexCounter,styles:[],classes:[]},this.vertices.set(e,F);if(this.vertexCounter++,r!==void 0){if(this.config=p(),P=this.sanitizeText(r.text.trim()),F.labelType=r.type,P.startsWith('"')&&P.endsWith('"'))P=P.substring(1,P.length-1);F.text=P}else if(F.text===void 0)F.text=e;if(n!==void 0)F.type=n;if(a!==void 0&&a!==null)a.forEach((E)=>{F.styles.push(E)});if(c!==void 0&&c!==null)c.forEach((E)=>{F.classes.push(E)});if(d!==void 0)F.dir=d;if(F.props===void 0)F.props=o;else if(o!==void 0)Object.assign(F.props,o);if(k){if(F.metadata={...F.metadata,...k},k.shape){let E=A??k.shape;if(typeof E!=="string")throw this.positionedShapeError(`No such shape: ${JSON.stringify(E)}.`,m);if(E!==E.toLowerCase()||E.includes("_"))throw this.positionedShapeError(`No such shape: ${E}. Shape names should be lowercase.`,m);else if(!Ol(k.shape))throw this.positionedShapeError(`No such shape: ${k.shape}.`,m);F.type=k?.shape}if(k?.label)F.text=this.sanitizeText(k.label),F.labelType=this.sanitizeNodeLabelType(k?.labelType)}}positionedShapeError(e,r){let n=Error(e);if(!r)return n;let a=r.first_line+this.frontmatterLineOffset;return Object.assign(n,{hash:{text:"",token:null,line:a-1,loc:{first_line:a,last_line:r.last_line+this.frontmatterLineOffset,first_column:r.first_column,last_column:r.last_column},expected:[]}}),n}rethrowMetadataYamlError(e,r,n){let a=e;if(!a||a.name!=="YAMLException"||!a.mark||!n)throw e;let c;try{let d=!r.includes(`
|
|
10
10
|
`),o=d?`{
|
|
11
11
|
`+r+`
|
|
12
12
|
}`:r+`
|
|
13
13
|
`,f=n.first_line+this.frontmatterLineOffset,m=n.first_column+2,k=t((E,g)=>{if(d)return{line:f,column:m+(E===1?g:0)};return{line:f+E,column:E===0?m+g:g}},"toSource"),A=k(a.mark.line,a.mark.column),C=a.reason??(a.message??"").split(`
|
|
14
14
|
`)[0].replace(/\s*\(\d+:\d+\)\s*$/,""),B=o.split(`
|
|
15
|
-
`),_=[];if(d)_.push(1);else for(let E=a.mark.line-1;E<=a.mark.line+1;E++){if(E<0||E>=B.length)continue;if(E===B.length-1&&B[E]===""&&E!==a.mark.line)continue;_.push(E)}let
|
|
15
|
+
`),_=[];if(d)_.push(1);else for(let E=a.mark.line-1;E<=a.mark.line+1;E++){if(E<0||E>=B.length)continue;if(E===B.length-1&&B[E]===""&&E!==a.mark.line)continue;_.push(E)}let P=Math.max(..._.map((E)=>String(k(E,0).line).length)),F=[];for(let E of _){let g=k(E,0).line,b=` ${String(g).padStart(P)} | `;if(F.push(b+B[E].replace(/\t/g,"→")),E===a.mark.line)F.push("-".repeat(b.length+a.mark.column)+"^")}c={message:`${C} (${A.line}:${A.column+1})
|
|
16
16
|
|
|
17
17
|
${F.join(`
|
|
18
18
|
`)}`,markLine:A.line-1,markColumn:A.column,hash:{text:"",token:null,line:A.line-1,loc:{first_line:A.line,last_line:A.line,first_column:A.column,last_column:A.column+1},expected:[]}}}catch{}if(c)a.message=c.message,a.mark.line=c.markLine,a.mark.column=c.markColumn,a.hash=c.hash;throw a}addSingleLink(e,r,n,a){let o={start:e,end:r,type:void 0,text:"",labelType:"text",classes:[],isUserDefinedId:!1,interpolate:this.edges.defaultInterpolate};l.info("abc78 Got edge...",o);let f=n.text;if(f!==void 0){if(o.text=this.sanitizeText(f.text.trim()),o.text.startsWith('"')&&o.text.endsWith('"'))o.text=o.text.substring(1,o.text.length-1);o.labelType=this.sanitizeNodeLabelType(f.type)}if(n!==void 0){if(o.type=n.type,o.stroke=n.stroke,o.length=n.length>10?10:n.length,n.edgeSemantic)o.edgeSemantic=n.edgeSemantic}if(a&&!this.edges.some((m)=>m.id===a))o.id=a,o.isUserDefinedId=!0;else{let m=this.edges.filter((k)=>k.start===o.start&&k.end===o.end);if(m.length===0)o.id=An(o.start,o.end,{counter:0,prefix:"L"});else o.id=An(o.start,o.end,{counter:m.length+1,prefix:"L"})}if(this.edges.length<(this.config.maxEdges??500))l.info("Pushing edge..."),this.edges.push(o);else throw Error(`Edge limit exceeded. ${this.edges.length} edges found, but the limit is ${this.config.maxEdges}.
|
|
19
19
|
|
|
20
20
|
Initialize mermaid with maxEdges set to a higher number to allow more edges.
|
|
21
21
|
You cannot set this config via configuration inside the diagram as it is a secure config.
|
|
22
|
-
You have to call mermaid.initialize.`)}isLinkData(e){return e!==null&&typeof e==="object"&&"id"in e&&typeof e.id==="string"}addLink(e,r,n){let a=this.isLinkData(n)?n.id.replace("@",""):void 0;l.info("addLink",e,r,a);for(let c of e)for(let d of r){let o=c===e[e.length-1],f=d===r[0];if(o&&f)this.addSingleLink(c,d,n,a);else this.addSingleLink(c,d,n,void 0)}}updateLinkInterpolate(e,r){e.forEach((n)=>{if(n==="default"){this.edges.defaultInterpolate=r;return}if(typeof n==="number"&&n>=this.edges.length)throw Error(`The index ${n} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);this.edges[n].interpolate=r})}updateLink(e,r){e.forEach((n)=>{if(typeof n==="number"&&n>=this.edges.length)throw Error(`The index ${n} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);if(n==="default")this.edges.defaultStyle=r;else if(this.edges[n].style=r,(this.edges[n]?.style?.length??0)>0&&!this.edges[n]?.style?.some((a)=>a?.startsWith("fill")))this.edges[n]?.style?.push("fill:none")})}addClass(e,r){let n=r.join().replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");e.split(",").forEach((a)=>{let c=this.classes.get(a);if(c===void 0)c={id:a,styles:[],textStyles:[]},this.classes.set(a,c);if(n!==void 0&&n!==null)n.forEach((d)=>{if(/color/.exec(d)){let o=d.replace("fill","bgFill");c.textStyles.push(o)}c.styles.push(d)})})}setDirection(e){if(this.direction=e.trim(),/.*</.exec(this.direction))this.direction="RL";if(/.*\^/.exec(this.direction))this.direction="BT";if(/.*>/.exec(this.direction))this.direction="LR";if(/.*v/.exec(this.direction))this.direction="TB";if(this.direction==="TD")this.direction="TB"}setClass(e,r){for(let n of e.split(",")){let a=this.vertices.get(n);if(a)a.classes.push(r);let c=this.edges.find((o)=>o.id===n);if(c)c.classes.push(r);let d=this.subGraphLookup.get(n);if(d)d.classes.push(r)}}setTooltip(e,r){if(r===void 0)return;r=this.sanitizeText(r);for(let n of e.split(","))this.tooltips.set(this.version==="gen-1"?this.lookUpDomId(n):n,r)}setClickFun(e,r,n){if(p().securityLevel!=="loose")return;if(r===void 0)return;let a=[];if(typeof n==="string"){a=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let d=0;d<a.length;d++){let o=a[d].trim();if(o.startsWith('"')&&o.endsWith('"'))o=o.substr(1,o.length-2);a[d]=o}}if(a.length===0)a.push(e);let c=this.vertices.get(e);if(c)c.haveCallback=!0,this.funs.push(()=>{let d=this.lookUpDomId(e),o=document.querySelector(`[id="${d}"]`);if(o!==null)o.addEventListener("click",()=>{W.runFunc(r,...a)},!1)})}setLink(e,r,n){e.split(",").forEach((a)=>{let c=this.vertices.get(a);if(c!==void 0)c.link=W.formatUrl(r,this.config),c.linkTarget=n}),this.setClass(e,"clickable")}getTooltip(e){return this.tooltips.get(e)}setClickEvent(e,r,n){e.split(",").forEach((a)=>{this.setClickFun(a,r,n)}),this.setClass(e,"clickable")}bindFunctions(e){this.funs.forEach((r)=>{r(e)})}getDirection(){return this.direction?.trim()}getVertices(){return this.vertices}getEdges(){return this.edges}isToolDefinition(e){return P1.has(e.type)}getTools(){let e=[];for(let r of this.vertices.values())if(this.isToolDefinition(r))e.push(r);return e}getClasses(){return this.classes}setupToolTips(e){let r=Na();h(e).select("svg").selectAll("g.node").on("mouseover",(c)=>{let d=h(c.currentTarget),o=d.attr("title");if(o===null)return;let f=c.currentTarget?.getBoundingClientRect();r.transition().duration(200).style("opacity",".9"),r.text(d.attr("title")).style("left",window.scrollX+f.left+(f.right-f.left)/2+"px").style("top",window.scrollY+f.bottom+"px"),r.html(Nt.sanitize(o)),d.classed("hover",!0)}).on("mouseout",(c)=>{r.transition().duration(500).style("opacity",0),h(c.currentTarget).classed("hover",!1)})}clear(e="gen-2"){this.vertices=new Map,this.classes=new Map,this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.subGraphs=[],this.subGraphLookup=new Map,this.globalNodes=new Set,this.connectors=new Map,this.subCount=0,this.tooltips=new Map,this.firstGraphFlag=!0,this.version=e,this.config=p(),this.diagramId="",this.vertexCounter=0,this.direction=void 0,this.secCount=-1,this.posCrossRef=[],this.frontmatterLineOffset=0,this.elementMappings=[],this.bareVertexMappings=new WeakSet,this.diagnostics=[],this.postParseValidationRun=!1,R()}setGen(e){this.version=e||"gen-2"}defaultStyle(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"}addSubGraph(e,r,n,a){let c=e?.text?.trim(),d=n?.text;if(e===n&&n?.text&&/\s/.exec(n.text))c=void 0;let f=t((_)=>{let U={boolean:{},number:{},string:{}},F=[],E;return{nodeList:_.filter(function(b){let v=typeof b;if(b.stmt&&b.stmt==="dir")return E=b.value,!1;if(b.trim()==="")return!1;if(v in U)return U[v].hasOwnProperty(b)?!1:U[v][b]=!0;else return F.includes(b)?!1:F.push(b)}),dir:E}},"uniq")(r.flat()),{nodeList:m,dir:k}=f,A=p().flowchart??{};if(k=k??(A.inheritDir?this.getDirection()??p().direction??void 0:void 0),this.version==="gen-1")for(let _=0;_<m.length;_++)m[_]=this.lookUpDomId(m[_]);c=c??"subGraph"+this.subCount,d=d||"",d=this.sanitizeText(d),this.subCount=this.subCount+1;let C={id:c,nodes:m.filter((_)=>_!==c&&!this.globalNodes.has(_)),title:d.trim(),classes:[],dir:k,labelType:this.sanitizeNodeLabelType(n?.type),type:a??"flow"};l.info("Adding",C.id,C.nodes,C.dir),C.nodes=this.makeUniq(C,this.subGraphs).nodes;let B=this.getPosForId(c);if(B!==-1){let _=this.subGraphs[B];for(let U of C.nodes)if(!_.nodes.includes(U))_.nodes.push(U);if(C.title)_.title=C.title;if(C.dir)_.dir=C.dir;if(C.type)_.type=C.type;this.subGraphLookup.set(c,_)}else this.subGraphs.push(C),this.subGraphLookup.set(c,C);return c}addGlobal(e){for(let r of e.flat()){if(typeof r!=="string")continue;let n=r.trim();if(n!=="")this.globalNodes.add(n)}for(let r of this.subGraphs)r.nodes=r.nodes.filter((n)=>!this.globalNodes.has(n))}getPosForId(e){for(let[r,n]of this.subGraphs.entries())if(n.id===e)return r;return-1}indexNodes2(e,r){let n=this.subGraphs[r].nodes;if(this.secCount=this.secCount+1,this.secCount>2000)return{result:!1,count:0};if(this.posCrossRef[this.secCount]=r,this.subGraphs[r].id===e)return{result:!0,count:0};let a=0,c=1;while(a<n.length){let d=this.getPosForId(n[a]);if(d>=0){let o=this.indexNodes2(e,d);if(o.result)return{result:!0,count:c+o.count};else c=c+o.count}a=a+1}return{result:!1,count:c}}getDepthFirstPos(e){return this.posCrossRef[e]}indexNodes(){if(this.secCount=-1,this.subGraphs.length>0)this.indexNodes2("none",this.subGraphs.length-1)}addConnector(e,r){let n=e?.text?.trim();if(!n)return"";let a=r?.text?.trim()??"",c=a.length>0?this.sanitizeText(a):n,d=this.connectors.get(n);if(!d)d={id:n,labelType:"text",domId:A1+n+"-"+this.vertexCounter,styles:[],classes:[],isConnector:!0,text:c},this.connectors.set(n,d),this.vertices.set(n,d),this.vertexCounter++;else if(a.length>0)d.text=c;return n}getSubGraphs(){return this.subGraphs}getConnectors(){return[...this.connectors.values()]}firstGraph(){if(this.firstGraphFlag)return this.firstGraphFlag=!1,!0;return!1}computeEdgeSemantic(e,r){if(e==="arrow_point"&&r==="normal")return"sequence";if(e==="arrow_cross"&&r==="normal")return"failure";if(e==="arrow_open"&&r==="dotted")return"reference";return}destructStartLink(e){let r=e.trim(),n="arrow_open",a="normal";if(r.includes("."))a="dotted";return{type:"arrow_open",stroke:a}}countChar(e,r){let n=r.length,a=0;for(let c=0;c<n;++c)if(r[c]===e)++a;return a}destructEndLink(e){let r=e.trim(),n=r.slice(0,-1),a="arrow_open";switch(r.slice(-1)){case"x":a="arrow_cross";break;case">":a="arrow_point";break;case"-":case".":a="arrow_open",n=r;break}let c="normal",d=n.length-1,o=this.countChar(".",n);if(o>0)c="dotted",d=o;return{type:a,stroke:c,length:d}}destructLink(e,r){let n=this.destructEndLink(e),a;if(r){if(a=this.destructStartLink(r),a.stroke!==n.stroke)return{type:"INVALID",stroke:"INVALID"};return a.type=n.type,a.length=n.length,{...a,edgeSemantic:this.computeEdgeSemantic(a.type,a.stroke)}}return{...n,edgeSemantic:this.computeEdgeSemantic(n.type,n.stroke)}}exists(e,r){for(let n of e)if(n.nodes.includes(r))return!0;return!1}makeUniq(e,r){let n=[];return e.nodes.forEach((a,c)=>{if(!this.exists(r,a))n.push(e.nodes[c])}),{nodes:n}}getTypeFromVertex(e){let r=typeof e.type==="string"?gt(e.type):e.type;switch(r){case"square":case void 0:return"squareRect";case"round":return"roundedRect";case"ellipse":return"ellipse";default:return r}}findNode(e,r){return e.find((n)=>n.id===r)}destructEdgeType(e){let r="none",n="arrow_point";switch(e){case"arrow_point":case"arrow_circle":case"arrow_cross":case"arrow_hierarchy":n=e;break;case"double_arrow_point":case"double_arrow_circle":case"double_arrow_cross":r=e.replace("double_",""),n=r;break}return{arrowTypeStart:r,arrowTypeEnd:n}}addNodeFromVertex(e,r,n,a,c,d){let o=n.get(e.id),f=a.get(e.id)??!1,m=this.findNode(r,e.id);if(m)m.cssStyles=e.styles,m.cssCompiledStyles=this.getCompiledStyles(e.classes),m.cssClasses=e.classes.join(" ");else{let k={id:e.id,label:e.text,labelType:e.labelType,labelStyle:"",parentId:o,padding:c.flowchart?.padding||8,cssStyles:e.styles,cssCompiledStyles:this.getCompiledStyles(["default","node",...e.classes]),cssClasses:"default "+e.classes.join(" "),dir:e.dir,domId:e.domId,look:d,link:e.link,linkTarget:e.linkTarget,tooltip:this.getTooltip(e.id),metadata:e.metadata};if(f)r.push({...k,isGroup:!0,shape:"rect"});else r.push({...k,isGroup:!1,shape:this.getTypeFromVertex(e),wrappingWidth:c.agentflow?.wrappingWidth,minWidth:c.agentflow?.minNodeWidth})}}getCompiledStyles(e){let r=[];for(let n of e){let a=this.classes.get(n);if(a?.styles)r=[...r,...a.styles??[]].map((c)=>c.trim());if(a?.textStyles)r=[...r,...a.textStyles??[]].map((c)=>c.trim())}return r}runPostParseValidators(){if(this.postParseValidationRun)return;this.postParseValidationRun=!0}getData(){this.runPostParseValidators();let e=p(),r=[],n=[],a=this.getSubGraphs(),c=new Map,d=new Map,o=new Set,f=new Map,m=t((g,b,v=new Set)=>{if(v.has(g))return;v.add(g);let q=this.subGraphLookup.get(g);if(!q)return;for(let fe of q.nodes){if(fe===b||v.has(fe))continue;o.add(fe),f.set(fe,b),m(fe,b,v)}},"collectDescendants");for(let g of a)if(g.metadata?.view==="collapsed"&&!o.has(g.id))m(g.id,g.id);let k=t((g,b)=>{let v=new Set,q=b;while(q!==void 0&&!v.has(q)){if(q===g)return!0;v.add(q),q=c.get(q)}return!1},"wouldCloseContainmentCycle");for(let g=a.length-1;g>=0;g--){let b=a[g];if(o.has(b.id))continue;if(b.nodes.length>0)d.set(b.id,!0);for(let v of b.nodes){if(k(v,b.id)){this.emitWarning(bt.CONTAINMENT_VIOLATION,`Container "${b.id}" cannot contain "${v}" because "${v}" already contains it. The nesting that would close the loop is dropped.`,{nodeId:v});continue}c.set(v,b.id)}}for(let g=a.length-1;g>=0;g--){let b=a[g];if(o.has(b.id))continue;if(b.metadata?.view==="collapsed"){let q={...b.metadata,containerType:b.type};r.push({id:b.id,label:b.title,labelStyle:"",labelType:b.labelType,parentId:c.get(b.id),padding:8,cssCompiledStyles:this.getCompiledStyles(b.classes),cssClasses:b.classes.join(" "),shape:"collapsedGroup",dir:b.dir,isGroup:!1,look:e.look,metadata:q})}else r.push({id:b.id,label:b.title,labelStyle:"",labelType:b.labelType,parentId:c.get(b.id),padding:8,cssCompiledStyles:this.getCompiledStyles(b.classes),cssClasses:b.classes.join(" "),shape:G1[b.type??"flow"],dir:b.dir,isGroup:!0,look:e.look,metadata:b.metadata})}this.getVertices().forEach((g)=>{if(o.has(g.id))return;this.addNodeFromVertex(g,r,c,d,e,e.look||"classic")});let C=this.getEdges();C.forEach((g,b)=>{let v=f.get(g.start)??g.start,q=f.get(g.end)??g.end;if(v===q&&g.start!==g.end)return;let{arrowTypeStart:fe,arrowTypeEnd:Se}=this.destructEdgeType(g.type),Ee=[...C.defaultStyle??[]];if(g.style)Ee.push(...g.style);let xe={id:An(v,q,{counter:b,prefix:"L"},g.id),isUserDefinedId:g.isUserDefinedId,start:v,end:q,type:g.type??"normal",label:g.text,labelType:g.labelType,labelpos:"c",thickness:g.stroke,minlen:g.length,classes:g?.stroke==="invisible"?"":"edge-thickness-normal edge-pattern-solid flowchart-link",arrowTypeStart:g?.stroke==="invisible"||g?.type==="arrow_open"?"none":fe,arrowTypeEnd:g?.stroke==="invisible"||g?.type==="arrow_open"?"none":Se,arrowheadStyle:"fill: #333",cssCompiledStyles:this.getCompiledStyles(g.classes),labelStyle:Ee,style:Ee,pattern:g.stroke,look:e.look,animate:g.animate,animation:g.animation,curve:g.interpolate||this.edges.defaultInterpolate||e.flowchart?.curve,metadata:g.metadata};n.push(xe)}),E1(r,this);let B=new Map,_=new Map;for(let g of a){let b=c.get(g.id);if(b!==void 0)_.set(b,[..._.get(b)??[],g.id])}let U=0,F=t((g)=>{if(B.has(g))return;B.set(g,U++);for(let b of _.get(g)??[])F(b)},"walkContainers");for(let g of a)if(c.get(g.id)===void 0)F(g.id);let E=new Set(this.getConnectors().map((g)=>g.id));return D1(r,(g)=>{if(E.has(g))return"connector";let b=this.vertices.get(g);return b?this.deriveVertexKind(b,gt(b.type)):void 0},B),{nodes:r,edges:n,other:{},config:e,connectors:this.getConnectors()}}defaultConfig(){return Bo.flowchart}deriveVertexKind(e,r){if(this.isToolDefinition(e))return"tool";if(r==="hexagon"||r==="hex")return"action";if(r==="lean-right"||r==="lean_right")return"input";if(r==="lin-doc"||r==="lined-document")return"refdoc";if(r==="diamond")return"decision";return"task"}getSemanticModel(){this.runPostParseValidators();let e=new Set(this.subGraphs.map((o)=>o.id)),r=[],n=[];for(let[o,f]of this.vertices){if(e.has(o))continue;if(f.isConnector){let A={id:o};if(f.text!==void 0&&f.text!==o)A.title=f.text;if(f.metadata&&Object.keys(f.metadata).length>0){let C={};for(let[B,_]of Object.entries(f.metadata)){if(i1.has(B))continue;C[B]=_}if(Object.keys(C).length>0)A.metadata=C}n.push(A);continue}let m={id:o};if(f.text!==void 0)m.label=f.text;let k=typeof f.type==="string"?gt(f.type):f.type;if(k!==void 0)m.shape=k;if(m.vertexKind=this.deriveVertexKind(f,k),f.metadata&&Object.keys(f.metadata).length>0){let A={};for(let[C,B]of Object.entries(f.metadata)){if(i1.has(C))continue;A[C]=B}if(Object.keys(A).length>0)m.metadata=A}r.push(m)}let a=this.edges.map((o)=>{let f={start:o.start,end:o.end};if(o.id!==void 0)f.id=o.id;if(typeof o.text==="string"&&o.text.length>0)f.label=o.text;if(o.type!==void 0)f.type=o.type;if(o.stroke!==void 0)f.stroke=o.stroke;if(o.edgeSemantic!==void 0)f.edgeSemantic=o.edgeSemantic;if(o.length!==void 0)f.length=o.length;if(o.metadata&&Object.keys(o.metadata).length>0)f.metadata={...o.metadata};return f}),c=this.subGraphs.map((o)=>{let f={id:o.id,nodes:[...o.nodes]};if(o.type!==void 0)f.type=o.type;if(o.title!==void 0)f.title=o.title;if(o.dir!==void 0)f.direction=o.dir;if(o.metadata&&Object.keys(o.metadata).length>0){let m={};for(let[k,A]of Object.entries(o.metadata)){if(i1.has(k))continue;m[k]=A}if(Object.keys(m).length>0)f.metadata=m}return f}),d={vertices:r,edges:a,subGraphs:c,connectors:n,diagnostics:this.diagnostics};if(this.direction!==void 0)d.direction=this.direction;return d}setFrontmatterLineOffset(e){this.frontmatterLineOffset=e??0}toElementPosition(e){let r=e?.first_line??0,n=e?.first_column??0,a=e?.last_line??r,c=e?.last_column??n,[d,o]=e?.range??[0,0];return{startLine:r+this.frontmatterLineOffset,startColumn:n,endLine:a+this.frontmatterLineOffset,endColumn:c,startIndex:d,endIndex:o}}pushMapping(e,r,n){if(!e)return;let a={id:e,type:r,position:this.toElementPosition(n)};return this.elementMappings.push(a),a}addVertexMapping(e,r,n,a){let c=this.pushMapping(e,"vertex",a);if(c&&n==null)this.bareVertexMappings.add(c)}extendVertexMapping(e,r){if(!e||!r)return;let n=this.toElementPosition(r);for(let a=this.elementMappings.length-1;a>=0;a--){let c=this.elementMappings[a];if(c.type==="vertex"&&c.id===e){if(this.bareVertexMappings.has(c))c.type="attachment",this.bareVertexMappings.delete(c);if(n.endLine>c.position.endLine||n.endLine===c.position.endLine&&n.endColumn>c.position.endColumn)c.position.endLine=n.endLine,c.position.endColumn=n.endColumn,c.position.endIndex=n.endIndex;return}}this.pushMapping(e,"attachment",r)}addEdgeMapping(e,r,n,a){let c=Array.isArray(r)?r.map((o)=>typeof o==="string"?o:o?.id??"").filter(Boolean):[],d=c.length>0?c.join(">"):"edge";this.pushMapping(d,"edge",a)}addSubgraphMapping(e,r,n,a){let c=(typeof e==="string"?e:e?.text)??"",d=this.toElementPosition(n),o=a?this.toElementPosition(a):d;if(!c)return;this.elementMappings.push({id:c,type:"subgraph",position:{startLine:d.startLine,startColumn:d.startColumn,endLine:o.endLine,endColumn:o.endColumn,startIndex:d.startIndex,endIndex:o.endIndex}})}addConnectorMapping(e,r,n,a){let c=e?.text?.trim()??"";if(!c)return;let d=this.toElementPosition(n),o=a?this.toElementPosition(a):d;this.elementMappings.push({id:c,type:"connector",position:{startLine:d.startLine,startColumn:d.startColumn,endLine:o.endLine,endColumn:o.endColumn,startIndex:d.startIndex,endIndex:o.endIndex}})}getElementMappings(){return[...this.elementMappings]}getElementById(e){return this.elementMappings.find((r)=>r.id===e)}getElementsOnLine(e){return this.elementMappings.filter((r)=>e>=r.position.startLine&&e<=r.position.endLine)}getElementAtPosition(e,r){let n=this.elementMappings.filter((c)=>{let{startLine:d,startColumn:o,endLine:f,endColumn:m}=c.position;if(e<d||e>f)return!1;if(e===d&&r<o)return!1;if(e===f&&r>m)return!1;return!0});if(n.length===0)return;let a=t(({position:c})=>[c.endLine-c.startLine,c.endColumn-c.startColumn],"span");return n.reduce((c,d)=>{let[o,f]=a(c),[m,k]=a(d);if(m!==o)return m<o?d:c;return k<f?d:c})}getMappingStats(){let e=0,r=0,n=0,a=0,c=0;for(let d of this.elementMappings)if(d.type==="vertex")e++;else if(d.type==="edge")r++;else if(d.type==="subgraph")n++;else if(d.type==="connector")a++;else if(d.type==="attachment")c++;return{vertices:e,edges:r,subgraphs:n,connectors:a,attachments:c,totalElements:this.elementMappings.length}}emitDiagnostic(e,r,n,a){let c=a?.nodeId??a?.edgeId,d=c?this.getElementById(c):void 0,o={id:e,severity:r,message:n,...a?.nodeId?{nodeId:a.nodeId}:{},...a?.edgeId&&!a?.nodeId?{edgeId:a.edgeId}:{},...d?{position:d.position}:{}};if(this.diagnostics.some((k)=>k.id===o.id&&k.severity===o.severity&&k.message===o.message&&k.nodeId===o.nodeId&&k.edgeId===o.edgeId))return;this.diagnostics.push(o);let m=`agentflow[${e}]: ${n}`;if(r==="error")l.error(m);else l.warn(m)}emitWarning(e,r,n){this.emitDiagnostic(e,"warning",r,n)}emitError(e,r,n){this.emitDiagnostic(e,"error",r,n)}getDiagnostics(){return[...this.diagnostics]}},j1=t(function(e,r){return r.db.getClasses()},"getClasses"),z1=t(async function(e,r,n,a){l.debug("Drawing agentflow diagram",r);let{securityLevel:c,agentflow:d,layout:o}=p();a.db.setDiagramId(r),l.debug("Before getData: ");let f=a.db.getData();l.debug("Data: ",f);let m=Tt(r,c),k=a.db.getDirection();if(f.type=a.type,f.layoutAlgorithm=St(o),f.layoutAlgorithm==="dagre"&&o==="elk")l.warn("flowchart-elk was moved to an external package in Mermaid v11. Please refer [release notes](https://github.com/mermaid-js/mermaid/releases/tag/v11.0.0) for more details. This diagram will be rendered using `dagre` layout as a fallback.");f.direction=k,f.nodeSpacing=d?.nodeSpacing||50,f.rankSpacing=d?.rankSpacing||50,f.markers=["point","circle","cross","hierarchy"],f.diagramId=r,l.debug("REF1:",f),await _t(f,m);let A=d?.diagramPadding??8;W.insertTitle(m,"agentflowTitleText",d?.titleTopMargin??0,a.db.getDiagramTitle()),lt(m,A,"agentflow",d?.useMaxWidth??!0)},"draw"),W1={getClasses:j1,draw:z1},r1=function(){var e=t(function(we,S,T,D){for(T=T||{},D=we.length;D--;T[we[D]]=S);return T},"o"),r=[1,5],n=[1,4],a=[1,3],c=[1,6],d=[1,8,9,10,11,12,28,35,36,38,40,42,47,63,87,88,89,90,91,92,105,108,109,112,114,117,118,119,124,125,126,127,128],o=[2,2],f=[1,15],m=[1,16],k=[1,17],A=[1,18],C=[1,19],B=[1,26],_=[1,27],U=[1,28],F=[1,30],E=[1,31],g=[1,32],b=[1,55],v=[1,54],q=[1,34],fe=[1,35],Se=[1,36],Ee=[1,37],xe=[1,38],Q=[1,50],J=[1,52],Z=[1,48],ee=[1,53],te=[1,49],se=[1,56],ie=[1,51],re=[1,57],ne=[1,58],Ne=[1,39],Re=[1,40],Oe=[1,41],Pe=[1,42],Ge=[1,43],Me=[1,64],V=[1,8,9,10,11,12,28,33,35,36,38,40,42,47,63,87,88,89,90,91,92,105,108,109,112,114,117,118,119,124,125,126,127,128],ce=[1,70],de=[1,68],he=[1,67],pe=[1,69],We=[8,9,10,12,78,80,81],Ke=[1,88],He=[1,101],qe=[1,106],Xe=[1,105],Qe=[1,102],Ze=[1,98],$e=[1,104],et=[1,100],tt=[1,107],it=[1,103],rt=[1,108],nt=[1,99],Ue=[8,9,10,11,12,43,78,80,81],oe=[8,9,10,11,12,43,49,78,80,81],be=[8,9,10,11,12,30,43,47,49,51,53,55,57,59,61,63,66,68,70,71,73,78,80,81,92,105,108,109,112,114,117,118,119],n1=[8,9,10,12,47,63,78,80,81,92,105,108,109,112,114,117,118,119],at=[47,63,92,105,108,109,112,114,117,118,119],a1=[1,131],o1=[1,132],kt=[1,134],mt=[1,133],u1=[47,63,65,77,92,105,108,109,112,114,117,118,119],At=[1,143],Et=[1,157],Ct=[1,158],xt=[1,159],Dt=[1,162],vt=[1,161],Ft=[1,160],Vt=[1,145],It=[1,147],Lt=[1,151],l1=[1,139],c1=[1,140],Bt=[1,152],Mt=[1,153],yt=[1,154],wt=[1,155],Rt=[1,156],Ot=[1,163],Pt=[1,164],Gt=[1,141],Ut=[1,142],jt=[1,149],zt=[1,144],Wt=[1,148],Kt=[1,146],ut=[8,9,10,11,12,28,33,35,36,38,40,42,47,63,87,88,89,90,91,92,105,108,109,112,114,117,118,119,124,125,126,127,128],d1=[1,168],ct=[1,170],X=[8,9,10,12],ke=[8,9,10,11,12,15,47,63,92,108,109,112,114,117,118,119],M=[1,190],ue=[1,186],le=[1,187],y=[1,191],w=[1,188],N=[1,189],dt=[80,119,122],K=[8,9,10,11,12,13,15,28,30,33,35,36,43,47,63,78,87,88,89,90,91,92,93,108,112,114,117,118,119],h1=[11,109],ye=[32,52,54,56,58,60,65,67,69,70,72,74,119,120,121],Te=[1,269],De=[1,267],_e=[1,271],ve=[1,265],Fe=[1,266],Ve=[1,268],Ie=[1,270],Le=[1,272],ht=[1,292],p1=[8,9,10,12,109],Ce=[8,9,10,11,12,63,87,108,109,112,113,114,115],Jt={trace:t(function(){},"trace"),yy:{},symbols_:{error:2,start:3,graphConfig:4,document:5,line:6,statement:7,COMMENT:8,SEMI:9,NEWLINE:10,SPACE:11,EOF:12,GRAPH:13,NODIR:14,DIR:15,FirstStmtSeparator:16,ending:17,endToken:18,spaceList:19,spaceListNewline:20,vertexStatement:21,separator:22,styleStatement:23,linkStyleStatement:24,classDefStatement:25,classStatement:26,clickStatement:27,flow:28,textNoTags:29,SQS:30,text:31,SQE:32,end:33,shapeData:34,global:35,connector:36,direction:37,acc_title:38,acc_title_value:39,acc_descr:40,acc_descr_value:41,acc_descr_multiline_value:42,SHAPE_DATA:43,link:44,node:45,styledVertex:46,AMP:47,vertex:48,STYLE_SEPARATOR:49,idString:50,DOUBLECIRCLESTART:51,DOUBLECIRCLEEND:52,PS:53,PE:54,"(-":55,"-)":56,STADIUMSTART:57,STADIUMEND:58,SUBROUTINESTART:59,SUBROUTINEEND:60,VERTEX_WITH_PROPS_START:61,"NODE_STRING[field]":62,COLON:63,"NODE_STRING[value]":64,PIPE:65,CYLINDERSTART:66,CYLINDEREND:67,DIAMOND_START:68,DIAMOND_STOP:69,TAGEND:70,TRAPSTART:71,TRAPEND:72,INVTRAPSTART:73,INVTRAPEND:74,linkStatement:75,arrowText:76,TESTSTR:77,START_LINK:78,edgeText:79,LINK:80,LINK_ID:81,edgeTextToken:82,STR:83,MD_STR:84,textToken:85,keywords:86,STYLE:87,LINKSTYLE:88,CLASSDEF:89,CLASS:90,CLICK:91,DOWN:92,UP:93,textNoTagsToken:94,stylesOpt:95,"idString[vertex]":96,"idString[class]":97,CALLBACKNAME:98,CALLBACKARGS:99,HREF:100,LINK_TARGET:101,"STR[link]":102,"STR[tooltip]":103,alphaNum:104,DEFAULT:105,numList:106,INTERPOLATE:107,NUM:108,COMMA:109,style:110,styleComponent:111,NODE_STRING:112,UNIT:113,BRKT:114,PCT:115,idStringToken:116,MINUS:117,MULT:118,UNICODE_TEXT:119,TEXT:120,TAGSTART:121,EDGE_TEXT:122,alphaNumToken:123,direction_tb:124,direction_bt:125,direction_rl:126,direction_lr:127,direction_td:128,$accept:0,$end:1},terminals_:{2:"error",8:"COMMENT",9:"SEMI",10:"NEWLINE",11:"SPACE",12:"EOF",13:"GRAPH",14:"NODIR",15:"DIR",28:"flow",30:"SQS",32:"SQE",33:"end",35:"global",36:"connector",38:"acc_title",39:"acc_title_value",40:"acc_descr",41:"acc_descr_value",42:"acc_descr_multiline_value",43:"SHAPE_DATA",47:"AMP",49:"STYLE_SEPARATOR",51:"DOUBLECIRCLESTART",52:"DOUBLECIRCLEEND",53:"PS",54:"PE",55:"(-",56:"-)",57:"STADIUMSTART",58:"STADIUMEND",59:"SUBROUTINESTART",60:"SUBROUTINEEND",61:"VERTEX_WITH_PROPS_START",62:"NODE_STRING[field]",63:"COLON",64:"NODE_STRING[value]",65:"PIPE",66:"CYLINDERSTART",67:"CYLINDEREND",68:"DIAMOND_START",69:"DIAMOND_STOP",70:"TAGEND",71:"TRAPSTART",72:"TRAPEND",73:"INVTRAPSTART",74:"INVTRAPEND",77:"TESTSTR",78:"START_LINK",80:"LINK",81:"LINK_ID",83:"STR",84:"MD_STR",87:"STYLE",88:"LINKSTYLE",89:"CLASSDEF",90:"CLASS",91:"CLICK",92:"DOWN",93:"UP",96:"idString[vertex]",97:"idString[class]",98:"CALLBACKNAME",99:"CALLBACKARGS",100:"HREF",101:"LINK_TARGET",102:"STR[link]",103:"STR[tooltip]",105:"DEFAULT",107:"INTERPOLATE",108:"NUM",109:"COMMA",112:"NODE_STRING",113:"UNIT",114:"BRKT",115:"PCT",117:"MINUS",118:"MULT",119:"UNICODE_TEXT",120:"TEXT",121:"TAGSTART",122:"EDGE_TEXT",124:"direction_tb",125:"direction_bt",126:"direction_rl",127:"direction_lr",128:"direction_td"},productions_:[0,[3,2],[5,0],[5,2],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[4,2],[4,2],[4,2],[4,2],[4,3],[17,2],[17,1],[18,1],[18,1],[18,1],[16,1],[16,1],[16,2],[16,1],[20,2],[20,2],[20,2],[20,1],[20,1],[20,1],[19,2],[19,1],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,9],[7,10],[7,6],[7,7],[7,4],[7,4],[7,7],[7,8],[7,4],[7,5],[7,1],[7,2],[7,2],[7,1],[22,1],[22,1],[22,1],[22,1],[34,2],[34,1],[21,4],[21,3],[21,4],[21,2],[21,2],[21,1],[45,1],[45,6],[45,5],[46,1],[46,3],[48,4],[48,4],[48,6],[48,4],[48,4],[48,4],[48,8],[48,4],[48,4],[48,4],[48,6],[48,4],[48,4],[48,4],[48,4],[48,4],[48,1],[44,2],[44,3],[44,3],[44,1],[44,3],[44,4],[79,1],[79,2],[79,1],[79,1],[75,1],[75,2],[76,3],[31,1],[31,2],[31,1],[31,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[29,1],[29,2],[29,1],[29,1],[25,5],[26,5],[27,2],[27,4],[27,3],[27,5],[27,3],[27,5],[27,5],[27,7],[27,2],[27,4],[27,2],[27,4],[27,4],[27,6],[23,5],[24,5],[24,5],[24,9],[24,9],[24,7],[24,7],[106,1],[106,3],[95,1],[95,3],[110,1],[110,2],[111,1],[111,1],[111,1],[111,1],[111,1],[111,1],[111,1],[111,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[85,1],[85,1],[85,1],[85,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[82,1],[82,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[50,1],[50,2],[104,1],[104,2],[37,1],[37,1],[37,1],[37,1],[37,1]],performAction:t(function(S,T,D,u,H,s,I){var i=s.length-1;switch(H){case 2:this.$=[];break;case 3:if(!Array.isArray(s[i])||s[i].length>0)s[i-1].push(s[i]);this.$=s[i-1];break;case 4:case 198:this.$=s[i];break;case 5:case 33:case 34:case 35:case 36:case 37:this.$=[];break;case 13:u.setDirection("TB"),this.$="TB";break;case 14:u.setDirection(s[i-1]),this.$=s[i-1];break;case 32:this.$=s[i-1].nodes;break;case 38:if(this.$=u.addSubGraph(s[i-6],s[i-1],s[i-4],"flow"),u.addSubgraphMapping)u.addSubgraphMapping(s[i-6],s[i-4],I[i-8],I[i]);break;case 39:if(this.$=u.addSubGraph(s[i-7],s[i-1],s[i-5],"flow"),u.addVertex(this.$,void 0,void 0,void 0,void 0,void 0,void 0,s[i-3],I[i-3]),u.addSubgraphMapping)u.addSubgraphMapping(s[i-7],s[i-5],I[i-9],I[i]);break;case 40:if(this.$=u.addSubGraph(s[i-3],s[i-1],{text:"",type:"text"},"flow"),u.addSubgraphMapping)u.addSubgraphMapping(s[i-3],{text:"",type:"text"},I[i-5],I[i]);break;case 41:if(this.$=u.addSubGraph(s[i-4],s[i-1],{text:"",type:"text"},"flow"),u.addVertex(this.$,void 0,void 0,void 0,void 0,void 0,void 0,s[i-3],I[i-3]),u.addSubgraphMapping)u.addSubgraphMapping(s[i-4],{text:"",type:"text"},I[i-6],I[i]);break;case 42:if(this.$=u.addSubGraph(void 0,s[i-1],void 0,"flow"),u.addSubgraphMapping)u.addSubgraphMapping(void 0,void 0,I[i-3],I[i]);break;case 43:u.addGlobal(s[i-1]),this.$=[];break;case 44:if(this.$=u.addConnector(s[i-4],s[i-2]),u.addConnectorMapping)u.addConnectorMapping(s[i-4],s[i-2],I[i-6],I[i]);break;case 45:if(this.$=u.addConnector(s[i-5],s[i-3]),u.addVertex(this.$,void 0,void 0,void 0,void 0,void 0,void 0,s[i-1],I[i-1]),u.addConnectorMapping)u.addConnectorMapping(s[i-5],s[i-3],I[i-7],I[i]);break;case 46:if(this.$=u.addConnector(s[i-1],{text:"",type:"text"}),u.addConnectorMapping)u.addConnectorMapping(s[i-1],{text:"",type:"text"},I[i-3],I[i]);break;case 47:if(this.$=u.addConnector(s[i-2],{text:"",type:"text"}),u.addVertex(this.$,void 0,void 0,void 0,void 0,void 0,void 0,s[i-1],I[i-1]),u.addConnectorMapping)u.addConnectorMapping(s[i-2],{text:"",type:"text"},I[i-4],I[i]);break;case 49:this.$=s[i].trim(),u.setAccTitle(this.$);break;case 50:case 51:this.$=s[i].trim(),u.setAccDescription(this.$);break;case 56:this.$=s[i-1]+s[i];break;case 57:this.$=s[i];break;case 58:if(u.addVertex(s[i-1][s[i-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,s[i],I[i]),u.extendVertexMapping)u.extendVertexMapping(s[i-1][s[i-1].length-1],I[i]);if(u.addLink(s[i-3].stmt,s[i-1],s[i-2]),u.addEdgeMapping)u.addEdgeMapping(s[i-3].stmt,s[i-1],s[i-2],this._$);this.$={stmt:s[i-1],nodes:s[i-1].concat(s[i-3].nodes)};break;case 59:if(u.addLink(s[i-2].stmt,s[i],s[i-1]),u.addEdgeMapping)u.addEdgeMapping(s[i-2].stmt,s[i],s[i-1],this._$);this.$={stmt:s[i],nodes:s[i].concat(s[i-2].nodes)};break;case 60:if(u.addLink(s[i-3].stmt,s[i-1],s[i-2]),u.addEdgeMapping)u.addEdgeMapping(s[i-3].stmt,s[i-1],s[i-2],this._$);this.$={stmt:s[i-1],nodes:s[i-1].concat(s[i-3].nodes)};break;case 61:this.$={stmt:s[i-1],nodes:s[i-1]};break;case 62:if(u.addVertex(s[i-1][s[i-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,s[i],I[i]),u.extendVertexMapping)u.extendVertexMapping(s[i-1][s[i-1].length-1],I[i]);this.$={stmt:s[i-1],nodes:s[i-1],shapeData:s[i]};break;case 63:this.$={stmt:s[i],nodes:s[i]};break;case 64:this.$=[s[i]];break;case 65:if(u.addVertex(s[i-5][s[i-5].length-1],void 0,void 0,void 0,void 0,void 0,void 0,s[i-4],I[i-4]),u.extendVertexMapping)u.extendVertexMapping(s[i-5][s[i-5].length-1],I[i-4]);this.$=s[i-5].concat(s[i]);break;case 66:this.$=s[i-4].concat(s[i]);break;case 67:this.$=s[i];break;case 68:this.$=s[i-2],u.setClass(s[i-2],s[i]);break;case 69:if(this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"square"),u.addVertexMapping)u.addVertexMapping(s[i-3],s[i-1],"square",this._$);break;case 70:if(this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"doublecircle"),u.addVertexMapping)u.addVertexMapping(s[i-3],s[i-1],"doublecircle",this._$);break;case 71:if(this.$=s[i-5],u.addVertex(s[i-5],s[i-2],"circle"),u.addVertexMapping)u.addVertexMapping(s[i-5],s[i-2],"circle",this._$);break;case 72:if(this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"ellipse"),u.addVertexMapping)u.addVertexMapping(s[i-3],s[i-1],"ellipse",this._$);break;case 73:if(this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"stadium"),u.addVertexMapping)u.addVertexMapping(s[i-3],s[i-1],"stadium",this._$);break;case 74:if(this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"subroutine"),u.addVertexMapping)u.addVertexMapping(s[i-3],s[i-1],"subroutine",this._$);break;case 75:if(this.$=s[i-7],u.addVertex(s[i-7],s[i-1],"rect",void 0,void 0,void 0,Object.fromEntries([[s[i-5],s[i-3]]])),u.addVertexMapping)u.addVertexMapping(s[i-7],s[i-1],"rect",this._$);break;case 76:if(this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"cylinder"),u.addVertexMapping)u.addVertexMapping(s[i-3],s[i-1],"cylinder",this._$);break;case 77:if(this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"round"),u.addVertexMapping)u.addVertexMapping(s[i-3],s[i-1],"round",this._$);break;case 78:if(this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"diamond"),u.addVertexMapping)u.addVertexMapping(s[i-3],s[i-1],"diamond",this._$);break;case 79:if(this.$=s[i-5],u.addVertex(s[i-5],s[i-2],"hexagon"),u.addVertexMapping)u.addVertexMapping(s[i-5],s[i-2],"hexagon",this._$);break;case 80:if(this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"odd"),u.addVertexMapping)u.addVertexMapping(s[i-3],s[i-1],"odd",this._$);break;case 81:if(this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"trapezoid"),u.addVertexMapping)u.addVertexMapping(s[i-3],s[i-1],"trapezoid",this._$);break;case 82:if(this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"inv_trapezoid"),u.addVertexMapping)u.addVertexMapping(s[i-3],s[i-1],"inv_trapezoid",this._$);break;case 83:if(this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"lean_right"),u.addVertexMapping)u.addVertexMapping(s[i-3],s[i-1],"lean_right",this._$);break;case 84:if(this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"lean_left"),u.addVertexMapping)u.addVertexMapping(s[i-3],s[i-1],"lean_left",this._$);break;case 85:if(this.$=s[i],u.addVertex(s[i]),u.addVertexMapping)u.addVertexMapping(s[i],void 0,void 0,this._$);break;case 86:s[i-1].text=s[i],this.$=s[i-1];break;case 87:case 88:s[i-2].text=s[i-1],this.$=s[i-2];break;case 89:this.$=s[i];break;case 90:var Y=u.destructLink(s[i],s[i-2]);this.$={type:Y.type,stroke:Y.stroke,length:Y.length,edgeSemantic:Y.edgeSemantic,text:s[i-1]};break;case 91:var Y=u.destructLink(s[i],s[i-2]);this.$={type:Y.type,stroke:Y.stroke,length:Y.length,edgeSemantic:Y.edgeSemantic,text:s[i-1],id:s[i-3]};break;case 92:this.$={text:s[i],type:"text"};break;case 93:this.$={text:s[i-1].text+""+s[i],type:s[i-1].type};break;case 94:this.$={text:s[i],type:"string"};break;case 95:this.$={text:s[i],type:"markdown"};break;case 96:var Y=u.destructLink(s[i]);this.$={type:Y.type,stroke:Y.stroke,length:Y.length,edgeSemantic:Y.edgeSemantic};break;case 97:var Y=u.destructLink(s[i]);this.$={type:Y.type,stroke:Y.stroke,length:Y.length,edgeSemantic:Y.edgeSemantic,id:s[i-1]};break;case 98:this.$=s[i-1];break;case 99:this.$={text:s[i],type:"text"};break;case 100:this.$={text:s[i-1].text+""+s[i],type:s[i-1].type};break;case 101:this.$={text:s[i],type:"string"};break;case 102:case 119:this.$={text:s[i],type:"markdown"};break;case 116:this.$={text:s[i],type:"text"};break;case 117:this.$={text:s[i-1].text+""+s[i],type:s[i-1].type};break;case 118:this.$={text:s[i],type:"text"};break;case 120:this.$=s[i-4],u.addClass(s[i-2],s[i]);break;case 121:this.$=s[i-4],u.setClass(s[i-2],s[i]);break;case 122:case 130:this.$=s[i-1],u.setClickEvent(s[i-1],s[i]);break;case 123:case 131:this.$=s[i-3],u.setClickEvent(s[i-3],s[i-2]),u.setTooltip(s[i-3],s[i]);break;case 124:this.$=s[i-2],u.setClickEvent(s[i-2],s[i-1],s[i]);break;case 125:this.$=s[i-4],u.setClickEvent(s[i-4],s[i-3],s[i-2]),u.setTooltip(s[i-4],s[i]);break;case 126:this.$=s[i-2],u.setLink(s[i-2],s[i]);break;case 127:this.$=s[i-4],u.setLink(s[i-4],s[i-2]),u.setTooltip(s[i-4],s[i]);break;case 128:this.$=s[i-4],u.setLink(s[i-4],s[i-2],s[i]);break;case 129:this.$=s[i-6],u.setLink(s[i-6],s[i-4],s[i]),u.setTooltip(s[i-6],s[i-2]);break;case 132:this.$=s[i-1],u.setLink(s[i-1],s[i]);break;case 133:this.$=s[i-3],u.setLink(s[i-3],s[i-2]),u.setTooltip(s[i-3],s[i]);break;case 134:this.$=s[i-3],u.setLink(s[i-3],s[i-2],s[i]);break;case 135:this.$=s[i-5],u.setLink(s[i-5],s[i-4],s[i]),u.setTooltip(s[i-5],s[i-2]);break;case 136:this.$=s[i-4],u.addVertex(s[i-2],void 0,void 0,s[i]);break;case 137:this.$=s[i-4],u.updateLink([s[i-2]],s[i]);break;case 138:this.$=s[i-4],u.updateLink(s[i-2],s[i]);break;case 139:this.$=s[i-8],u.updateLinkInterpolate([s[i-6]],s[i-2]),u.updateLink([s[i-6]],s[i]);break;case 140:this.$=s[i-8],u.updateLinkInterpolate(s[i-6],s[i-2]),u.updateLink(s[i-6],s[i]);break;case 141:this.$=s[i-6],u.updateLinkInterpolate([s[i-4]],s[i]);break;case 142:this.$=s[i-6],u.updateLinkInterpolate(s[i-4],s[i]);break;case 143:case 145:this.$=[s[i]];break;case 144:case 146:s[i-2].push(s[i]),this.$=s[i-2];break;case 148:this.$=s[i-1]+s[i];break;case 196:this.$=s[i];break;case 197:this.$=s[i-1]+""+s[i];break;case 199:this.$=s[i-1]+""+s[i];break;case 200:this.$={stmt:"dir",value:"TB"};break;case 201:this.$={stmt:"dir",value:"BT"};break;case 202:this.$={stmt:"dir",value:"RL"};break;case 203:this.$={stmt:"dir",value:"LR"};break;case 204:this.$={stmt:"dir",value:"TD"};break}},"anonymous"),table:[{3:1,4:2,8:r,10:n,11:a,13:c},{1:[3]},e(d,o,{5:7}),{4:8,8:r,10:n,11:a,13:c},{4:9,8:r,10:n,11:a,13:c},{4:10,8:r,10:n,11:a,13:c},{14:[1,11],15:[1,12]},{1:[2,1],6:13,7:14,8:f,9:m,10:k,11:A,12:C,21:20,23:21,24:22,25:23,26:24,27:25,28:B,35:_,36:U,37:29,38:F,40:E,42:g,45:33,46:44,47:b,48:45,50:46,63:v,87:q,88:fe,89:Se,90:Ee,91:xe,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne,124:Ne,125:Re,126:Oe,127:Pe,128:Ge},e(d,[2,10]),e(d,[2,11]),e(d,[2,12]),e(d,[2,13]),{8:[1,63],9:[1,60],10:[1,61],11:Me,16:59,19:62},e(V,[2,3]),e(V,[2,4]),e(V,[2,5]),e(V,[2,6]),e(V,[2,7]),e(V,[2,8]),e(V,[2,9]),{8:ce,9:de,10:he,12:pe,22:65,44:66,75:71,78:[1,72],80:[1,74],81:[1,73]},{8:ce,9:de,10:he,12:pe,22:75},{8:ce,9:de,10:he,12:pe,22:76},{8:ce,9:de,10:he,12:pe,22:77},{8:ce,9:de,10:he,12:pe,22:78},{8:ce,9:de,10:he,12:pe,22:79},{8:ce,9:de,10:he,11:[1,80],12:pe,22:81},{8:ce,9:de,10:he,12:pe,22:82},{11:[1,83]},e(V,[2,48]),{39:[1,84]},{41:[1,85]},e(V,[2,51]),e(We,[2,63],{19:86,34:87,11:Me,43:Ke}),{11:[1,89]},{11:[1,90]},{11:[1,91]},{11:[1,92]},{15:He,47:qe,63:Xe,83:[1,96],92:Qe,98:[1,93],100:[1,94],104:95,108:Ze,109:$e,112:et,114:tt,117:it,118:rt,119:nt,123:97},e(V,[2,200]),e(V,[2,201]),e(V,[2,202]),e(V,[2,203]),e(V,[2,204]),e(Ue,[2,64]),e(Ue,[2,67],{49:[1,109]}),e(oe,[2,85],{116:122,30:[1,110],47:b,51:[1,111],53:[1,112],55:[1,113],57:[1,114],59:[1,115],61:[1,116],63:v,66:[1,117],68:[1,118],70:[1,119],71:[1,120],73:[1,121],92:Q,105:J,108:Z,109:ee,112:te,114:se,117:ie,118:re,119:ne}),e(be,[2,196]),e(be,[2,157]),e(be,[2,158]),e(be,[2,159]),e(be,[2,160]),e(be,[2,161]),e(be,[2,162]),e(be,[2,163]),e(be,[2,164]),e(be,[2,165]),e(be,[2,166]),e(be,[2,167]),e(d,[2,14]),e(d,[2,20]),e(d,[2,21]),{10:[1,123]},e(d,[2,23]),e(n1,[2,31],{19:124,11:Me}),e(V,[2,32]),{45:125,46:44,47:b,48:45,50:46,63:v,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne},e(V,[2,52]),e(V,[2,53]),e(V,[2,54]),e(V,[2,55]),e(at,[2,89],{76:126,65:[1,128],77:[1,127]}),{79:129,82:130,83:a1,84:o1,119:kt,122:mt},{78:[1,135],80:[1,136]},e(u1,[2,96]),e(V,[2,33]),e(V,[2,34]),e(V,[2,35]),e(V,[2,36]),e(V,[2,37]),{11:At,13:Et,15:Ct,28:xt,29:137,33:Dt,35:vt,36:Ft,47:Vt,63:It,78:Lt,83:l1,84:c1,86:150,87:Bt,88:Mt,89:yt,90:wt,91:Rt,92:Ot,93:Pt,94:138,108:Gt,112:Ut,114:jt,117:zt,118:Wt,119:Kt},e(ut,o,{5:165}),e(ut,o,{5:166}),{11:At,13:Et,15:Ct,28:xt,29:167,33:Dt,35:vt,36:Ft,47:Vt,63:It,78:Lt,83:l1,84:c1,86:150,87:Bt,88:Mt,89:yt,90:wt,91:Rt,92:Ot,93:Pt,94:138,108:Gt,112:Ut,114:jt,117:zt,118:Wt,119:Kt},e(V,[2,49]),e(V,[2,50]),e(We,[2,61],{47:d1}),e(We,[2,62],{19:169,11:Me,43:ct}),e(Ue,[2,57]),{47:b,50:171,63:v,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne},{105:[1,172],106:173,108:[1,174]},{47:b,50:175,63:v,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne},{47:b,50:176,63:v,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne},e(X,[2,122],{11:[1,177],99:[1,178]}),{83:[1,179]},e(X,[2,130],{123:181,11:[1,180],15:He,47:qe,63:Xe,92:Qe,108:Ze,109:$e,112:et,114:tt,117:it,118:rt,119:nt}),e(X,[2,132],{11:[1,182]}),e(ke,[2,198]),e(ke,[2,185]),e(ke,[2,186]),e(ke,[2,187]),e(ke,[2,188]),e(ke,[2,189]),e(ke,[2,190]),e(ke,[2,191]),e(ke,[2,192]),e(ke,[2,193]),e(ke,[2,194]),e(ke,[2,195]),{47:b,50:183,63:v,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne},{31:184,70:M,83:ue,84:le,85:185,119:y,120:w,121:N},{31:192,70:M,83:ue,84:le,85:185,119:y,120:w,121:N},{31:194,53:[1,193],70:M,83:ue,84:le,85:185,119:y,120:w,121:N},{31:195,70:M,83:ue,84:le,85:185,119:y,120:w,121:N},{31:196,70:M,83:ue,84:le,85:185,119:y,120:w,121:N},{31:197,70:M,83:ue,84:le,85:185,119:y,120:w,121:N},{112:[1,198]},{31:199,70:M,83:ue,84:le,85:185,119:y,120:w,121:N},{31:200,68:[1,201],70:M,83:ue,84:le,85:185,119:y,120:w,121:N},{31:202,70:M,83:ue,84:le,85:185,119:y,120:w,121:N},{31:203,70:M,83:ue,84:le,85:185,119:y,120:w,121:N},{31:204,70:M,83:ue,84:le,85:185,119:y,120:w,121:N},e(be,[2,197]),e(d,[2,22]),e(n1,[2,30]),e(We,[2,59],{34:205,19:206,11:Me,43:Ke}),e(at,[2,86],{11:[1,207]}),{11:[1,208]},{31:209,70:M,83:ue,84:le,85:185,119:y,120:w,121:N},{80:[1,210],82:211,119:kt,122:mt},e(dt,[2,92]),e(dt,[2,94]),e(dt,[2,95]),e(dt,[2,183]),e(dt,[2,184]),{79:212,82:130,83:a1,84:o1,119:kt,122:mt},e(u1,[2,97]),{8:ce,9:de,10:he,11:At,12:pe,13:Et,15:Ct,22:214,28:xt,30:[1,213],33:Dt,34:215,35:vt,36:Ft,43:Ke,47:Vt,63:It,78:Lt,86:150,87:Bt,88:Mt,89:yt,90:wt,91:Rt,92:Ot,93:Pt,94:216,108:Gt,112:Ut,114:jt,117:zt,118:Wt,119:Kt},e(K,[2,116]),e(K,[2,118]),e(K,[2,119]),e(K,[2,172]),e(K,[2,173]),e(K,[2,174]),e(K,[2,175]),e(K,[2,176]),e(K,[2,177]),e(K,[2,178]),e(K,[2,179]),e(K,[2,180]),e(K,[2,181]),e(K,[2,182]),e(K,[2,103]),e(K,[2,104]),e(K,[2,105]),e(K,[2,106]),e(K,[2,107]),e(K,[2,108]),e(K,[2,109]),e(K,[2,110]),e(K,[2,111]),e(K,[2,112]),e(K,[2,113]),e(K,[2,114]),e(K,[2,115]),{6:13,7:14,8:f,9:m,10:k,11:A,12:C,21:20,23:21,24:22,25:23,26:24,27:25,28:B,33:[1,217],35:_,36:U,37:29,38:F,40:E,42:g,45:33,46:44,47:b,48:45,50:46,63:v,87:q,88:fe,89:Se,90:Ee,91:xe,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne,124:Ne,125:Re,126:Oe,127:Pe,128:Ge},{6:13,7:14,8:f,9:m,10:k,11:A,12:C,21:20,23:21,24:22,25:23,26:24,27:25,28:B,33:[1,218],35:_,36:U,37:29,38:F,40:E,42:g,45:33,46:44,47:b,48:45,50:46,63:v,87:q,88:fe,89:Se,90:Ee,91:xe,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne,124:Ne,125:Re,126:Oe,127:Pe,128:Ge},{8:ce,9:de,10:he,11:At,12:pe,13:Et,15:Ct,22:220,28:xt,30:[1,219],33:Dt,34:221,35:vt,36:Ft,43:Ke,47:Vt,63:It,78:Lt,86:150,87:Bt,88:Mt,89:yt,90:wt,91:Rt,92:Ot,93:Pt,94:216,108:Gt,112:Ut,114:jt,117:zt,118:Wt,119:Kt},{11:Me,19:222},{47:[1,223]},e(Ue,[2,56]),{11:[1,224],47:b,63:v,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:122,117:ie,118:re,119:ne},{11:[1,225]},{11:[1,226],109:[1,227]},e(h1,[2,143]),{11:[1,228],47:b,63:v,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:122,117:ie,118:re,119:ne},{11:[1,229],47:b,63:v,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:122,117:ie,118:re,119:ne},{83:[1,230]},e(X,[2,124],{11:[1,231]}),e(X,[2,126],{11:[1,232]}),{83:[1,233]},e(ke,[2,199]),{83:[1,234],101:[1,235]},e(Ue,[2,68],{116:122,47:b,63:v,92:Q,105:J,108:Z,109:ee,112:te,114:se,117:ie,118:re,119:ne}),{32:[1,236],70:M,85:237,119:y,120:w,121:N},e(ye,[2,99]),e(ye,[2,101]),e(ye,[2,102]),e(ye,[2,168]),e(ye,[2,169]),e(ye,[2,170]),e(ye,[2,171]),{52:[1,238],70:M,85:237,119:y,120:w,121:N},{31:239,70:M,83:ue,84:le,85:185,119:y,120:w,121:N},{54:[1,240],70:M,85:237,119:y,120:w,121:N},{56:[1,241],70:M,85:237,119:y,120:w,121:N},{58:[1,242],70:M,85:237,119:y,120:w,121:N},{60:[1,243],70:M,85:237,119:y,120:w,121:N},{63:[1,244]},{67:[1,245],70:M,85:237,119:y,120:w,121:N},{69:[1,246],70:M,85:237,119:y,120:w,121:N},{31:247,70:M,83:ue,84:le,85:185,119:y,120:w,121:N},{32:[1,248],70:M,85:237,119:y,120:w,121:N},{70:M,72:[1,249],74:[1,250],85:237,119:y,120:w,121:N},{70:M,72:[1,252],74:[1,251],85:237,119:y,120:w,121:N},e(We,[2,58],{19:169,11:Me,43:ct}),e(We,[2,60],{47:d1}),e(at,[2,88]),e(at,[2,87]),{65:[1,253],70:M,85:237,119:y,120:w,121:N},e(at,[2,90]),e(dt,[2,93]),{80:[1,254],82:211,119:kt,122:mt},{31:255,70:M,83:ue,84:le,85:185,119:y,120:w,121:N},e(ut,o,{5:256}),{8:ce,9:de,10:he,12:pe,22:257,43:ct},e(K,[2,117]),e(V,[2,42]),e(V,[2,43]),{31:258,70:M,83:ue,84:le,85:185,119:y,120:w,121:N},e(V,[2,46]),{8:ce,9:de,10:he,12:pe,22:259,43:ct},{46:260,47:b,48:45,50:46,63:v,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne},{11:Me,19:261},{11:Te,63:De,87:_e,95:262,108:ve,110:263,111:264,112:Fe,113:Ve,114:Ie,115:Le},{11:Te,63:De,87:_e,95:273,107:[1,274],108:ve,110:263,111:264,112:Fe,113:Ve,114:Ie,115:Le},{11:Te,63:De,87:_e,95:275,107:[1,276],108:ve,110:263,111:264,112:Fe,113:Ve,114:Ie,115:Le},{108:[1,277]},{11:Te,63:De,87:_e,95:278,108:ve,110:263,111:264,112:Fe,113:Ve,114:Ie,115:Le},{47:b,50:279,63:v,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne},e(X,[2,123]),{83:[1,280]},{83:[1,281],101:[1,282]},e(X,[2,131]),e(X,[2,133],{11:[1,283]}),e(X,[2,134]),e(oe,[2,69]),e(ye,[2,100]),e(oe,[2,70]),{54:[1,284],70:M,85:237,119:y,120:w,121:N},e(oe,[2,77]),e(oe,[2,72]),e(oe,[2,73]),e(oe,[2,74]),{112:[1,285]},e(oe,[2,76]),e(oe,[2,78]),{69:[1,286],70:M,85:237,119:y,120:w,121:N},e(oe,[2,80]),e(oe,[2,81]),e(oe,[2,83]),e(oe,[2,82]),e(oe,[2,84]),e([11,47,63,92,105,108,109,112,114,117,118,119],[2,98]),e(at,[2,91]),{32:[1,287],70:M,85:237,119:y,120:w,121:N},{6:13,7:14,8:f,9:m,10:k,11:A,12:C,21:20,23:21,24:22,25:23,26:24,27:25,28:B,33:[1,288],35:_,36:U,37:29,38:F,40:E,42:g,45:33,46:44,47:b,48:45,50:46,63:v,87:q,88:fe,89:Se,90:Ee,91:xe,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne,124:Ne,125:Re,126:Oe,127:Pe,128:Ge},e(ut,o,{5:289}),{32:[1,290],70:M,85:237,119:y,120:w,121:N},e(V,[2,47]),e(Ue,[2,66]),{46:291,47:b,48:45,50:46,63:v,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne},e(X,[2,136],{109:ht}),e(p1,[2,145],{111:293,11:Te,63:De,87:_e,108:ve,112:Fe,113:Ve,114:Ie,115:Le}),e(Ce,[2,147]),e(Ce,[2,149]),e(Ce,[2,150]),e(Ce,[2,151]),e(Ce,[2,152]),e(Ce,[2,153]),e(Ce,[2,154]),e(Ce,[2,155]),e(Ce,[2,156]),e(X,[2,137],{109:ht}),{11:[1,294]},e(X,[2,138],{109:ht}),{11:[1,295]},e(h1,[2,144]),e(X,[2,120],{109:ht}),e(X,[2,121],{116:122,47:b,63:v,92:Q,105:J,108:Z,109:ee,112:te,114:se,117:ie,118:re,119:ne}),e(X,[2,125]),e(X,[2,127],{11:[1,296]}),e(X,[2,128]),{101:[1,297]},{54:[1,298]},{65:[1,299]},{69:[1,300]},{8:ce,9:de,10:he,12:pe,22:301,34:302,43:Ke},e(V,[2,40]),{6:13,7:14,8:f,9:m,10:k,11:A,12:C,21:20,23:21,24:22,25:23,26:24,27:25,28:B,33:[1,303],35:_,36:U,37:29,38:F,40:E,42:g,45:33,46:44,47:b,48:45,50:46,63:v,87:q,88:fe,89:Se,90:Ee,91:xe,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne,124:Ne,125:Re,126:Oe,127:Pe,128:Ge},{8:ce,9:de,10:he,12:pe,22:304,34:305,43:Ke},e(Ue,[2,65]),{11:Te,63:De,87:_e,108:ve,110:306,111:264,112:Fe,113:Ve,114:Ie,115:Le},e(Ce,[2,148]),{15:He,47:qe,63:Xe,92:Qe,104:307,108:Ze,109:$e,112:et,114:tt,117:it,118:rt,119:nt,123:97},{15:He,47:qe,63:Xe,92:Qe,104:308,108:Ze,109:$e,112:et,114:tt,117:it,118:rt,119:nt,123:97},{101:[1,309]},e(X,[2,135]),e(oe,[2,71]),{31:310,70:M,83:ue,84:le,85:185,119:y,120:w,121:N},e(oe,[2,79]),e(ut,o,{5:311}),{8:ce,9:de,10:he,12:pe,22:312,43:ct},e(V,[2,41]),e(V,[2,44]),{8:ce,9:de,10:he,12:pe,22:313,43:ct},e(p1,[2,146],{111:293,11:Te,63:De,87:_e,108:ve,112:Fe,113:Ve,114:Ie,115:Le}),e(X,[2,141],{123:181,11:[1,314],15:He,47:qe,63:Xe,92:Qe,108:Ze,109:$e,112:et,114:tt,117:it,118:rt,119:nt}),e(X,[2,142],{123:181,11:[1,315],15:He,47:qe,63:Xe,92:Qe,108:Ze,109:$e,112:et,114:tt,117:it,118:rt,119:nt}),e(X,[2,129]),{32:[1,316],70:M,85:237,119:y,120:w,121:N},{6:13,7:14,8:f,9:m,10:k,11:A,12:C,21:20,23:21,24:22,25:23,26:24,27:25,28:B,33:[1,317],35:_,36:U,37:29,38:F,40:E,42:g,45:33,46:44,47:b,48:45,50:46,63:v,87:q,88:fe,89:Se,90:Ee,91:xe,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne,124:Ne,125:Re,126:Oe,127:Pe,128:Ge},e(ut,o,{5:318}),e(V,[2,45]),{11:Te,63:De,87:_e,95:319,108:ve,110:263,111:264,112:Fe,113:Ve,114:Ie,115:Le},{11:Te,63:De,87:_e,95:320,108:ve,110:263,111:264,112:Fe,113:Ve,114:Ie,115:Le},e(oe,[2,75]),e(V,[2,38]),{6:13,7:14,8:f,9:m,10:k,11:A,12:C,21:20,23:21,24:22,25:23,26:24,27:25,28:B,33:[1,321],35:_,36:U,37:29,38:F,40:E,42:g,45:33,46:44,47:b,48:45,50:46,63:v,87:q,88:fe,89:Se,90:Ee,91:xe,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne,124:Ne,125:Re,126:Oe,127:Pe,128:Ge},e(X,[2,139],{109:ht}),e(X,[2,140],{109:ht}),e(V,[2,39])],defaultActions:{},parseError:t(function(S,T){if(T.recoverable)this.trace(S);else{var D=Error(S);throw D.hash=T,D}},"parseError"),parse:t(function(S){var T=this,D=[0],u=[],H=[null],s=[],I=this.table,i="",Y=0,f1=0,g1=0,I1=2,b1=1,L1=s.slice.call(arguments,1),ae=Object.create(this.lexer),je={yy:{}};for(var Zt in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,Zt))je.yy[Zt]=this.yy[Zt];if(ae.setInput(S,je.yy),je.yy.lexer=ae,je.yy.parser=this,typeof ae.yylloc>"u")ae.yylloc={};var $t=ae.yylloc;s.push($t);var B1=ae.options&&ae.options.ranges;if(typeof je.yy.parseError==="function")this.parseError=je.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function M1(Ae){D.length=D.length-2*Ae,H.length=H.length-Ae,s.length=s.length-Ae}t(M1,"popStack");function k1(){var Ae=u.pop()||ae.lex()||b1;if(typeof Ae!=="number"){if(Ae instanceof Array)u=Ae,Ae=u.pop();Ae=T.symbols_[Ae]||Ae}return Ae}t(k1,"lex");var ge,e1,ze,me,Q1,t1,pt={},Yt,Be,m1,qt;while(!0){if(ze=D[D.length-1],this.defaultActions[ze])me=this.defaultActions[ze];else{if(ge===null||typeof ge>"u")ge=k1();me=I[ze]&&I[ze][ge]}if(typeof me>"u"||!me.length||!me[0]){var s1="";qt=[];for(Yt in I[ze])if(this.terminals_[Yt]&&Yt>I1)qt.push("'"+this.terminals_[Yt]+"'");if(ae.showPosition)s1="Parse error on line "+(Y+1)+`:
|
|
22
|
+
You have to call mermaid.initialize.`)}isLinkData(e){return e!==null&&typeof e==="object"&&"id"in e&&typeof e.id==="string"}addLink(e,r,n){let a=this.isLinkData(n)?n.id.replace("@",""):void 0;l.info("addLink",e,r,a);for(let c of e)for(let d of r){let o=c===e[e.length-1],f=d===r[0];if(o&&f)this.addSingleLink(c,d,n,a);else this.addSingleLink(c,d,n,void 0)}}updateLinkInterpolate(e,r){e.forEach((n)=>{if(n==="default"){this.edges.defaultInterpolate=r;return}if(typeof n==="number"&&n>=this.edges.length)throw Error(`The index ${n} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);this.edges[n].interpolate=r})}updateLink(e,r){e.forEach((n)=>{if(typeof n==="number"&&n>=this.edges.length)throw Error(`The index ${n} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);if(n==="default")this.edges.defaultStyle=r;else if(this.edges[n].style=r,(this.edges[n]?.style?.length??0)>0&&!this.edges[n]?.style?.some((a)=>a?.startsWith("fill")))this.edges[n]?.style?.push("fill:none")})}addClass(e,r){let n=r.join().replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");e.split(",").forEach((a)=>{let c=this.classes.get(a);if(c===void 0)c={id:a,styles:[],textStyles:[]},this.classes.set(a,c);if(n!==void 0&&n!==null)n.forEach((d)=>{if(/color/.exec(d)){let o=d.replace("fill","bgFill");c.textStyles.push(o)}c.styles.push(d)})})}setDirection(e){if(this.direction=e.trim(),/.*</.exec(this.direction))this.direction="RL";if(/.*\^/.exec(this.direction))this.direction="BT";if(/.*>/.exec(this.direction))this.direction="LR";if(/.*v/.exec(this.direction))this.direction="TB";if(this.direction==="TD")this.direction="TB"}setClass(e,r){for(let n of e.split(",")){let a=this.vertices.get(n);if(a)a.classes.push(r);let c=this.edges.find((o)=>o.id===n);if(c)c.classes.push(r);let d=this.subGraphLookup.get(n);if(d)d.classes.push(r)}}setTooltip(e,r){if(r===void 0)return;r=this.sanitizeText(r);for(let n of e.split(","))this.tooltips.set(this.version==="gen-1"?this.lookUpDomId(n):n,r)}setClickFun(e,r,n){if(p().securityLevel!=="loose")return;if(r===void 0)return;let a=[];if(typeof n==="string"){a=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let d=0;d<a.length;d++){let o=a[d].trim();if(o.startsWith('"')&&o.endsWith('"'))o=o.substr(1,o.length-2);a[d]=o}}if(a.length===0)a.push(e);let c=this.vertices.get(e);if(c)c.haveCallback=!0,this.funs.push(()=>{let d=this.lookUpDomId(e),o=document.querySelector(`[id="${d}"]`);if(o!==null)o.addEventListener("click",()=>{W.runFunc(r,...a)},!1)})}setLink(e,r,n){e.split(",").forEach((a)=>{let c=this.vertices.get(a);if(c!==void 0)c.link=W.formatUrl(r,this.config),c.linkTarget=n}),this.setClass(e,"clickable")}getTooltip(e){return this.tooltips.get(e)}setClickEvent(e,r,n){e.split(",").forEach((a)=>{this.setClickFun(a,r,n)}),this.setClass(e,"clickable")}bindFunctions(e){this.funs.forEach((r)=>{r(e)})}getDirection(){return this.direction?.trim()}getVertices(){return this.vertices}getEdges(){return this.edges}isToolDefinition(e){return P1.has(e.type)}getTools(){let e=[];for(let r of this.vertices.values())if(this.isToolDefinition(r))e.push(r);return e}getClasses(){return this.classes}setupToolTips(e){let r=Na();h(e).select("svg").selectAll("g.node").on("mouseover",(c)=>{let d=h(c.currentTarget),o=d.attr("title");if(o===null)return;let f=c.currentTarget?.getBoundingClientRect();r.transition().duration(200).style("opacity",".9"),r.text(d.attr("title")).style("left",window.scrollX+f.left+(f.right-f.left)/2+"px").style("top",window.scrollY+f.bottom+"px"),r.html(Nt.sanitize(o)),d.classed("hover",!0)}).on("mouseout",(c)=>{r.transition().duration(500).style("opacity",0),h(c.currentTarget).classed("hover",!1)})}clear(e="gen-2"){this.vertices=new Map,this.classes=new Map,this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.subGraphs=[],this.subGraphLookup=new Map,this.globalNodes=new Set,this.connectors=new Map,this.subCount=0,this.tooltips=new Map,this.firstGraphFlag=!0,this.version=e,this.config=p(),this.diagramId="",this.vertexCounter=0,this.direction=void 0,this.secCount=-1,this.posCrossRef=[],this.frontmatterLineOffset=0,this.elementMappings=[],this.bareVertexMappings=new WeakSet,this.diagnostics=[],this.postParseValidationRun=!1,R()}setGen(e){this.version=e||"gen-2"}defaultStyle(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"}addSubGraph(e,r,n,a){let c=e?.text?.trim(),d=n?.text;if(e===n&&n?.text&&/\s/.exec(n.text))c=void 0;let f=t((_)=>{let P={boolean:{},number:{},string:{}},F=[],E;return{nodeList:_.filter(function(b){let v=typeof b;if(b.stmt&&b.stmt==="dir")return E=b.value,!1;if(b.trim()==="")return!1;if(v in P)return P[v].hasOwnProperty(b)?!1:P[v][b]=!0;else return F.includes(b)?!1:F.push(b)}),dir:E}},"uniq")(r.flat()),{nodeList:m,dir:k}=f,A=p().flowchart??{};if(k=k??(A.inheritDir?this.getDirection()??p().direction??void 0:void 0),this.version==="gen-1")for(let _=0;_<m.length;_++)m[_]=this.lookUpDomId(m[_]);c=c??"subGraph"+this.subCount,d=d||"",d=this.sanitizeText(d),this.subCount=this.subCount+1;let C={id:c,nodes:m.filter((_)=>_!==c&&!this.globalNodes.has(_)),title:d.trim(),classes:[],dir:k,labelType:this.sanitizeNodeLabelType(n?.type),type:a??"flow"};l.info("Adding",C.id,C.nodes,C.dir),C.nodes=this.makeUniq(C,this.subGraphs).nodes;let B=this.getPosForId(c);if(B!==-1){let _=this.subGraphs[B];for(let P of C.nodes)if(!_.nodes.includes(P))_.nodes.push(P);if(C.title)_.title=C.title;if(C.dir)_.dir=C.dir;if(C.type)_.type=C.type;this.subGraphLookup.set(c,_)}else this.subGraphs.push(C),this.subGraphLookup.set(c,C);return c}addGlobal(e){for(let r of e.flat()){if(typeof r!=="string")continue;let n=r.trim();if(n!=="")this.globalNodes.add(n)}for(let r of this.subGraphs)r.nodes=r.nodes.filter((n)=>!this.globalNodes.has(n))}getPosForId(e){for(let[r,n]of this.subGraphs.entries())if(n.id===e)return r;return-1}indexNodes2(e,r){let n=this.subGraphs[r].nodes;if(this.secCount=this.secCount+1,this.secCount>2000)return{result:!1,count:0};if(this.posCrossRef[this.secCount]=r,this.subGraphs[r].id===e)return{result:!0,count:0};let a=0,c=1;while(a<n.length){let d=this.getPosForId(n[a]);if(d>=0){let o=this.indexNodes2(e,d);if(o.result)return{result:!0,count:c+o.count};else c=c+o.count}a=a+1}return{result:!1,count:c}}getDepthFirstPos(e){return this.posCrossRef[e]}indexNodes(){if(this.secCount=-1,this.subGraphs.length>0)this.indexNodes2("none",this.subGraphs.length-1)}addConnector(e,r){let n=e?.text?.trim();if(!n)return"";let a=r?.text?.trim()??"",c=a.length>0?this.sanitizeText(a):n,d=this.connectors.get(n);if(!d)d={id:n,labelType:"text",domId:A1+n+"-"+this.vertexCounter,styles:[],classes:[],isConnector:!0,text:c},this.connectors.set(n,d),this.vertices.set(n,d),this.vertexCounter++;else if(a.length>0)d.text=c;return n}getSubGraphs(){return this.subGraphs}getConnectors(){return[...this.connectors.values()]}firstGraph(){if(this.firstGraphFlag)return this.firstGraphFlag=!1,!0;return!1}computeEdgeSemantic(e,r){if(e==="arrow_point"&&r==="normal")return"sequence";if(e==="arrow_cross"&&r==="normal")return"failure";if(e==="arrow_open"&&r==="dotted")return"reference";return}destructStartLink(e){let r=e.trim(),n="arrow_open",a="normal";if(r.includes("."))a="dotted";return{type:"arrow_open",stroke:a}}countChar(e,r){let n=r.length,a=0;for(let c=0;c<n;++c)if(r[c]===e)++a;return a}destructEndLink(e){let r=e.trim(),n=r.slice(0,-1),a="arrow_open";switch(r.slice(-1)){case"x":a="arrow_cross";break;case">":a="arrow_point";break;case"-":case".":a="arrow_open",n=r;break}let c="normal",d=n.length-1,o=this.countChar(".",n);if(o>0)c="dotted",d=o;return{type:a,stroke:c,length:d}}destructLink(e,r){let n=this.destructEndLink(e),a;if(r){if(a=this.destructStartLink(r),a.stroke!==n.stroke)return{type:"INVALID",stroke:"INVALID"};return a.type=n.type,a.length=n.length,{...a,edgeSemantic:this.computeEdgeSemantic(a.type,a.stroke)}}return{...n,edgeSemantic:this.computeEdgeSemantic(n.type,n.stroke)}}exists(e,r){for(let n of e)if(n.nodes.includes(r))return!0;return!1}makeUniq(e,r){let n=[];return e.nodes.forEach((a,c)=>{if(!this.exists(r,a))n.push(e.nodes[c])}),{nodes:n}}getTypeFromVertex(e){let r=typeof e.type==="string"?gt(e.type):e.type;switch(r){case"square":case void 0:return"squareRect";case"round":return"roundedRect";case"ellipse":return"ellipse";default:return r}}findNode(e,r){return e.find((n)=>n.id===r)}destructEdgeType(e){let r="none",n="arrow_point";switch(e){case"arrow_point":case"arrow_circle":case"arrow_cross":case"arrow_hierarchy":n=e;break;case"double_arrow_point":case"double_arrow_circle":case"double_arrow_cross":r=e.replace("double_",""),n=r;break}return{arrowTypeStart:r,arrowTypeEnd:n}}addNodeFromVertex(e,r,n,a,c,d){let o=n.get(e.id),f=a.get(e.id)??!1,m=this.findNode(r,e.id);if(m)m.cssStyles=e.styles,m.cssCompiledStyles=this.getCompiledStyles(e.classes),m.cssClasses=e.classes.join(" ");else{let k={id:e.id,label:e.text,labelType:e.labelType,labelStyle:"",parentId:o,padding:c.flowchart?.padding||8,cssStyles:e.styles,cssCompiledStyles:this.getCompiledStyles(["default","node",...e.classes]),cssClasses:"default "+e.classes.join(" "),dir:e.dir,domId:e.domId,look:d,link:e.link,linkTarget:e.linkTarget,tooltip:this.getTooltip(e.id),metadata:e.metadata};if(f)r.push({...k,isGroup:!0,shape:"rect"});else r.push({...k,isGroup:!1,shape:this.getTypeFromVertex(e),wrappingWidth:c.agentflow?.wrappingWidth,minWidth:c.agentflow?.minNodeWidth})}}getCompiledStyles(e){let r=[];for(let n of e){let a=this.classes.get(n);if(a?.styles)r=[...r,...a.styles??[]].map((c)=>c.trim());if(a?.textStyles)r=[...r,...a.textStyles??[]].map((c)=>c.trim())}return r}runPostParseValidators(){if(this.postParseValidationRun)return;this.postParseValidationRun=!0}getData(){this.runPostParseValidators();let e=p(),r=[],n=[],a=this.getSubGraphs(),c=new Map,d=new Map,o=new Set,f=new Map,m=t((g,b,v=new Set)=>{if(v.has(g))return;v.add(g);let q=this.subGraphLookup.get(g);if(!q)return;for(let fe of q.nodes){if(fe===b||v.has(fe))continue;o.add(fe),f.set(fe,b),m(fe,b,v)}},"collectDescendants");for(let g of a)if(g.metadata?.view==="collapsed"&&!o.has(g.id))m(g.id,g.id);let k=t((g,b)=>{let v=new Set,q=b;while(q!==void 0&&!v.has(q)){if(q===g)return!0;v.add(q),q=c.get(q)}return!1},"wouldCloseContainmentCycle");for(let g=a.length-1;g>=0;g--){let b=a[g];if(o.has(b.id))continue;if(b.nodes.length>0)d.set(b.id,!0);for(let v of b.nodes){if(k(v,b.id)){this.emitWarning(bt.CONTAINMENT_VIOLATION,`Container "${b.id}" cannot contain "${v}" because "${v}" already contains it. The nesting that would close the loop is dropped.`,{nodeId:v});continue}c.set(v,b.id)}}for(let g=a.length-1;g>=0;g--){let b=a[g];if(o.has(b.id))continue;if(b.metadata?.view==="collapsed"){let q={...b.metadata,containerType:b.type};r.push({id:b.id,label:b.title,labelStyle:"",labelType:b.labelType,parentId:c.get(b.id),padding:8,cssCompiledStyles:this.getCompiledStyles(b.classes),cssClasses:b.classes.join(" "),shape:"collapsedGroup",dir:b.dir,isGroup:!1,look:e.look,metadata:q})}else r.push({id:b.id,label:b.title,labelStyle:"",labelType:b.labelType,parentId:c.get(b.id),padding:8,cssCompiledStyles:this.getCompiledStyles(b.classes),cssClasses:b.classes.join(" "),shape:G1[b.type??"flow"],dir:b.dir,isGroup:!0,look:e.look,metadata:b.metadata})}this.getVertices().forEach((g)=>{if(o.has(g.id))return;this.addNodeFromVertex(g,r,c,d,e,e.look||"classic")});let C=this.getEdges();C.forEach((g,b)=>{let v=f.get(g.start)??g.start,q=f.get(g.end)??g.end;if(v===q&&g.start!==g.end)return;let{arrowTypeStart:fe,arrowTypeEnd:Se}=this.destructEdgeType(g.type),Ee=[...C.defaultStyle??[]];if(g.style)Ee.push(...g.style);let xe={id:An(v,q,{counter:b,prefix:"L"},g.id),isUserDefinedId:g.isUserDefinedId,start:v,end:q,type:g.type??"normal",label:g.text,labelType:g.labelType,labelpos:"c",thickness:g.stroke,minlen:g.length,classes:g?.stroke==="invisible"?"":"edge-thickness-normal edge-pattern-solid flowchart-link",arrowTypeStart:g?.stroke==="invisible"||g?.type==="arrow_open"?"none":fe,arrowTypeEnd:g?.stroke==="invisible"||g?.type==="arrow_open"?"none":Se,arrowheadStyle:"fill: #333",cssCompiledStyles:this.getCompiledStyles(g.classes),labelStyle:Ee,style:Ee,pattern:g.stroke,look:e.look,animate:g.animate,animation:g.animation,curve:g.interpolate||this.edges.defaultInterpolate||e.flowchart?.curve,metadata:g.metadata};n.push(xe)}),E1(r,this);let B=new Map,_=new Map;for(let g of a){let b=c.get(g.id);if(b!==void 0)_.set(b,[..._.get(b)??[],g.id])}let P=0,F=t((g)=>{if(B.has(g))return;B.set(g,P++);for(let b of _.get(g)??[])F(b)},"walkContainers");for(let g of a)if(c.get(g.id)===void 0)F(g.id);let E=new Set(this.getConnectors().map((g)=>g.id));return D1(r,(g)=>{if(E.has(g))return"connector";let b=this.vertices.get(g);return b?this.deriveVertexKind(b,gt(b.type)):void 0},B),{nodes:r,edges:n,other:{},config:e,connectors:this.getConnectors()}}defaultConfig(){return Bo.flowchart}deriveVertexKind(e,r){if(this.isToolDefinition(e))return"tool";if(r==="hexagon"||r==="hex")return"action";if(r==="lean-right"||r==="lean_right")return"input";if(r==="lin-doc"||r==="lined-document")return"refdoc";if(r==="diamond")return"decision";return"task"}getSemanticModel(){this.runPostParseValidators();let e=new Set(this.subGraphs.map((o)=>o.id)),r=[],n=[];for(let[o,f]of this.vertices){if(e.has(o))continue;if(f.isConnector){let A={id:o};if(f.text!==void 0&&f.text!==o)A.title=f.text;if(f.metadata&&Object.keys(f.metadata).length>0){let C={};for(let[B,_]of Object.entries(f.metadata)){if(i1.has(B))continue;C[B]=_}if(Object.keys(C).length>0)A.metadata=C}n.push(A);continue}let m={id:o};if(f.text!==void 0)m.label=f.text;let k=typeof f.type==="string"?gt(f.type):f.type;if(k!==void 0)m.shape=k;if(m.vertexKind=this.deriveVertexKind(f,k),f.metadata&&Object.keys(f.metadata).length>0){let A={};for(let[C,B]of Object.entries(f.metadata)){if(i1.has(C))continue;A[C]=B}if(Object.keys(A).length>0)m.metadata=A}r.push(m)}let a=this.edges.map((o)=>{let f={start:o.start,end:o.end};if(o.id!==void 0)f.id=o.id;if(typeof o.text==="string"&&o.text.length>0)f.label=o.text;if(o.type!==void 0)f.type=o.type;if(o.stroke!==void 0)f.stroke=o.stroke;if(o.edgeSemantic!==void 0)f.edgeSemantic=o.edgeSemantic;if(o.length!==void 0)f.length=o.length;if(o.metadata&&Object.keys(o.metadata).length>0)f.metadata={...o.metadata};return f}),c=this.subGraphs.map((o)=>{let f={id:o.id,nodes:[...o.nodes]};if(o.type!==void 0)f.type=o.type;if(o.title!==void 0)f.title=o.title;if(o.dir!==void 0)f.direction=o.dir;if(o.metadata&&Object.keys(o.metadata).length>0){let m={};for(let[k,A]of Object.entries(o.metadata)){if(i1.has(k))continue;m[k]=A}if(Object.keys(m).length>0)f.metadata=m}return f}),d={vertices:r,edges:a,subGraphs:c,connectors:n,diagnostics:this.diagnostics};if(this.direction!==void 0)d.direction=this.direction;return d}setFrontmatterLineOffset(e){this.frontmatterLineOffset=e??0}toElementPosition(e){let r=e?.first_line??0,n=e?.first_column??0,a=e?.last_line??r,c=e?.last_column??n,[d,o]=e?.range??[0,0];return{startLine:r+this.frontmatterLineOffset,startColumn:n,endLine:a+this.frontmatterLineOffset,endColumn:c,startIndex:d,endIndex:o}}pushMapping(e,r,n){if(!e)return;let a={id:e,type:r,position:this.toElementPosition(n)};return this.elementMappings.push(a),a}addVertexMapping(e,r,n,a){let c=this.pushMapping(e,"vertex",a);if(c&&n==null)this.bareVertexMappings.add(c)}extendVertexMapping(e,r){if(!e||!r)return;let n=this.toElementPosition(r);for(let a=this.elementMappings.length-1;a>=0;a--){let c=this.elementMappings[a];if(c.type==="vertex"&&c.id===e){if(this.bareVertexMappings.has(c))c.type="attachment",this.bareVertexMappings.delete(c);if(n.endLine>c.position.endLine||n.endLine===c.position.endLine&&n.endColumn>c.position.endColumn)c.position.endLine=n.endLine,c.position.endColumn=n.endColumn,c.position.endIndex=n.endIndex;return}}this.pushMapping(e,"attachment",r)}addEdgeMapping(e,r,n,a){let c=Array.isArray(r)?r.map((o)=>typeof o==="string"?o:o?.id??"").filter(Boolean):[],d=c.length>0?c.join(">"):"edge";this.pushMapping(d,"edge",a)}addSubgraphMapping(e,r,n,a){let c=(typeof e==="string"?e:e?.text)??"",d=this.toElementPosition(n),o=a?this.toElementPosition(a):d;if(!c)return;this.elementMappings.push({id:c,type:"subgraph",position:{startLine:d.startLine,startColumn:d.startColumn,endLine:o.endLine,endColumn:o.endColumn,startIndex:d.startIndex,endIndex:o.endIndex}})}addConnectorMapping(e,r,n,a){let c=e?.text?.trim()??"";if(!c)return;let d=this.toElementPosition(n),o=a?this.toElementPosition(a):d;this.elementMappings.push({id:c,type:"connector",position:{startLine:d.startLine,startColumn:d.startColumn,endLine:o.endLine,endColumn:o.endColumn,startIndex:d.startIndex,endIndex:o.endIndex}})}getElementMappings(){return[...this.elementMappings]}getElementById(e){return this.elementMappings.find((r)=>r.id===e)}getElementsOnLine(e){return this.elementMappings.filter((r)=>e>=r.position.startLine&&e<=r.position.endLine)}getElementAtPosition(e,r){let n=this.elementMappings.filter((c)=>{let{startLine:d,startColumn:o,endLine:f,endColumn:m}=c.position;if(e<d||e>f)return!1;if(e===d&&r<o)return!1;if(e===f&&r>m)return!1;return!0});if(n.length===0)return;let a=t(({position:c})=>[c.endLine-c.startLine,c.endColumn-c.startColumn],"span");return n.reduce((c,d)=>{let[o,f]=a(c),[m,k]=a(d);if(m!==o)return m<o?d:c;return k<f?d:c})}getMappingStats(){let e=0,r=0,n=0,a=0,c=0;for(let d of this.elementMappings)if(d.type==="vertex")e++;else if(d.type==="edge")r++;else if(d.type==="subgraph")n++;else if(d.type==="connector")a++;else if(d.type==="attachment")c++;return{vertices:e,edges:r,subgraphs:n,connectors:a,attachments:c,totalElements:this.elementMappings.length}}emitDiagnostic(e,r,n,a){let c=a?.nodeId??a?.edgeId,d=c?this.getElementById(c):void 0,o={id:e,severity:r,message:n,...a?.nodeId?{nodeId:a.nodeId}:{},...a?.edgeId&&!a?.nodeId?{edgeId:a.edgeId}:{},...d?{position:d.position}:{}};if(this.diagnostics.some((k)=>k.id===o.id&&k.severity===o.severity&&k.message===o.message&&k.nodeId===o.nodeId&&k.edgeId===o.edgeId))return;this.diagnostics.push(o);let m=`agentflow[${e}]: ${n}`;if(r==="error")l.error(m);else l.warn(m)}emitWarning(e,r,n){this.emitDiagnostic(e,"warning",r,n)}emitError(e,r,n){this.emitDiagnostic(e,"error",r,n)}getDiagnostics(){return[...this.diagnostics]}},j1=t(function(e,r){return r.db.getClasses()},"getClasses"),z1=t(async function(e,r,n,a){l.debug("Drawing agentflow diagram",r);let{securityLevel:c,agentflow:d,layout:o}=p();a.db.setDiagramId(r),l.debug("Before getData: ");let f=a.db.getData();l.debug("Data: ",f);let m=Tt(r,c),k=a.db.getDirection();if(f.type=a.type,f.layoutAlgorithm=St(o),f.layoutAlgorithm==="dagre"&&o==="elk")l.warn("flowchart-elk was moved to an external package in Mermaid v11. Please refer [release notes](https://github.com/mermaid-js/mermaid/releases/tag/v11.0.0) for more details. This diagram will be rendered using `dagre` layout as a fallback.");f.direction=k,f.nodeSpacing=d?.nodeSpacing||50,f.rankSpacing=d?.rankSpacing||50,f.markers=["point","circle","cross","hierarchy"],f.diagramId=r,l.debug("REF1:",f),await _t(f,m);let A=d?.diagramPadding??8;W.insertTitle(m,"agentflowTitleText",d?.titleTopMargin??0,a.db.getDiagramTitle()),lt(m,A,"agentflow",d?.useMaxWidth??!0)},"draw"),W1={getClasses:j1,draw:z1},r1=function(){var e=t(function(we,S,T,D){for(T=T||{},D=we.length;D--;T[we[D]]=S);return T},"o"),r=[1,5],n=[1,4],a=[1,3],c=[1,6],d=[1,8,9,10,11,12,28,35,36,38,40,42,47,63,87,88,89,90,91,92,105,108,109,112,114,117,118,119,124,125,126,127,128],o=[2,2],f=[1,15],m=[1,16],k=[1,17],A=[1,18],C=[1,19],B=[1,26],_=[1,27],P=[1,28],F=[1,30],E=[1,31],g=[1,32],b=[1,55],v=[1,54],q=[1,34],fe=[1,35],Se=[1,36],Ee=[1,37],xe=[1,38],Q=[1,50],J=[1,52],Z=[1,48],ee=[1,53],te=[1,49],se=[1,56],ie=[1,51],re=[1,57],ne=[1,58],Ne=[1,39],Re=[1,40],Oe=[1,41],Pe=[1,42],Ge=[1,43],Me=[1,64],V=[1,8,9,10,11,12,28,33,35,36,38,40,42,47,63,87,88,89,90,91,92,105,108,109,112,114,117,118,119,124,125,126,127,128],ce=[1,70],de=[1,68],he=[1,67],pe=[1,69],We=[8,9,10,12,78,80,81],Ke=[1,88],He=[1,101],qe=[1,106],Xe=[1,105],Qe=[1,102],Ze=[1,98],$e=[1,104],et=[1,100],tt=[1,107],it=[1,103],rt=[1,108],nt=[1,99],Ue=[8,9,10,11,12,43,78,80,81],oe=[8,9,10,11,12,43,49,78,80,81],be=[8,9,10,11,12,30,43,47,49,51,53,55,57,59,61,63,66,68,70,71,73,78,80,81,92,105,108,109,112,114,117,118,119],n1=[8,9,10,12,47,63,78,80,81,92,105,108,109,112,114,117,118,119],at=[47,63,92,105,108,109,112,114,117,118,119],a1=[1,131],o1=[1,132],kt=[1,134],mt=[1,133],u1=[47,63,65,77,92,105,108,109,112,114,117,118,119],At=[1,143],Et=[1,157],Ct=[1,158],xt=[1,159],Dt=[1,162],vt=[1,161],Ft=[1,160],Vt=[1,145],It=[1,147],Lt=[1,151],l1=[1,139],c1=[1,140],Bt=[1,152],Mt=[1,153],yt=[1,154],wt=[1,155],Rt=[1,156],Ot=[1,163],Pt=[1,164],Gt=[1,141],Ut=[1,142],jt=[1,149],zt=[1,144],Wt=[1,148],Kt=[1,146],ut=[8,9,10,11,12,28,33,35,36,38,40,42,47,63,87,88,89,90,91,92,105,108,109,112,114,117,118,119,124,125,126,127,128],d1=[1,168],ct=[1,170],X=[8,9,10,12],ke=[8,9,10,11,12,15,47,63,92,108,109,112,114,117,118,119],M=[1,190],ue=[1,186],le=[1,187],y=[1,191],w=[1,188],N=[1,189],dt=[80,119,122],K=[8,9,10,11,12,13,15,28,30,33,35,36,43,47,63,78,87,88,89,90,91,92,93,108,112,114,117,118,119],h1=[11,109],ye=[32,52,54,56,58,60,65,67,69,70,72,74,119,120,121],Te=[1,269],De=[1,267],_e=[1,271],ve=[1,265],Fe=[1,266],Ve=[1,268],Ie=[1,270],Le=[1,272],ht=[1,292],p1=[8,9,10,12,109],Ce=[8,9,10,11,12,63,87,108,109,112,113,114,115],Jt={trace:t(function(){},"trace"),yy:{},symbols_:{error:2,start:3,graphConfig:4,document:5,line:6,statement:7,COMMENT:8,SEMI:9,NEWLINE:10,SPACE:11,EOF:12,GRAPH:13,NODIR:14,DIR:15,FirstStmtSeparator:16,ending:17,endToken:18,spaceList:19,spaceListNewline:20,vertexStatement:21,separator:22,styleStatement:23,linkStyleStatement:24,classDefStatement:25,classStatement:26,clickStatement:27,flow:28,textNoTags:29,SQS:30,text:31,SQE:32,end:33,shapeData:34,global:35,connector:36,direction:37,acc_title:38,acc_title_value:39,acc_descr:40,acc_descr_value:41,acc_descr_multiline_value:42,SHAPE_DATA:43,link:44,node:45,styledVertex:46,AMP:47,vertex:48,STYLE_SEPARATOR:49,idString:50,DOUBLECIRCLESTART:51,DOUBLECIRCLEEND:52,PS:53,PE:54,"(-":55,"-)":56,STADIUMSTART:57,STADIUMEND:58,SUBROUTINESTART:59,SUBROUTINEEND:60,VERTEX_WITH_PROPS_START:61,"NODE_STRING[field]":62,COLON:63,"NODE_STRING[value]":64,PIPE:65,CYLINDERSTART:66,CYLINDEREND:67,DIAMOND_START:68,DIAMOND_STOP:69,TAGEND:70,TRAPSTART:71,TRAPEND:72,INVTRAPSTART:73,INVTRAPEND:74,linkStatement:75,arrowText:76,TESTSTR:77,START_LINK:78,edgeText:79,LINK:80,LINK_ID:81,edgeTextToken:82,STR:83,MD_STR:84,textToken:85,keywords:86,STYLE:87,LINKSTYLE:88,CLASSDEF:89,CLASS:90,CLICK:91,DOWN:92,UP:93,textNoTagsToken:94,stylesOpt:95,"idString[vertex]":96,"idString[class]":97,CALLBACKNAME:98,CALLBACKARGS:99,HREF:100,LINK_TARGET:101,"STR[link]":102,"STR[tooltip]":103,alphaNum:104,DEFAULT:105,numList:106,INTERPOLATE:107,NUM:108,COMMA:109,style:110,styleComponent:111,NODE_STRING:112,UNIT:113,BRKT:114,PCT:115,idStringToken:116,MINUS:117,MULT:118,UNICODE_TEXT:119,TEXT:120,TAGSTART:121,EDGE_TEXT:122,alphaNumToken:123,direction_tb:124,direction_bt:125,direction_rl:126,direction_lr:127,direction_td:128,$accept:0,$end:1},terminals_:{2:"error",8:"COMMENT",9:"SEMI",10:"NEWLINE",11:"SPACE",12:"EOF",13:"GRAPH",14:"NODIR",15:"DIR",28:"flow",30:"SQS",32:"SQE",33:"end",35:"global",36:"connector",38:"acc_title",39:"acc_title_value",40:"acc_descr",41:"acc_descr_value",42:"acc_descr_multiline_value",43:"SHAPE_DATA",47:"AMP",49:"STYLE_SEPARATOR",51:"DOUBLECIRCLESTART",52:"DOUBLECIRCLEEND",53:"PS",54:"PE",55:"(-",56:"-)",57:"STADIUMSTART",58:"STADIUMEND",59:"SUBROUTINESTART",60:"SUBROUTINEEND",61:"VERTEX_WITH_PROPS_START",62:"NODE_STRING[field]",63:"COLON",64:"NODE_STRING[value]",65:"PIPE",66:"CYLINDERSTART",67:"CYLINDEREND",68:"DIAMOND_START",69:"DIAMOND_STOP",70:"TAGEND",71:"TRAPSTART",72:"TRAPEND",73:"INVTRAPSTART",74:"INVTRAPEND",77:"TESTSTR",78:"START_LINK",80:"LINK",81:"LINK_ID",83:"STR",84:"MD_STR",87:"STYLE",88:"LINKSTYLE",89:"CLASSDEF",90:"CLASS",91:"CLICK",92:"DOWN",93:"UP",96:"idString[vertex]",97:"idString[class]",98:"CALLBACKNAME",99:"CALLBACKARGS",100:"HREF",101:"LINK_TARGET",102:"STR[link]",103:"STR[tooltip]",105:"DEFAULT",107:"INTERPOLATE",108:"NUM",109:"COMMA",112:"NODE_STRING",113:"UNIT",114:"BRKT",115:"PCT",117:"MINUS",118:"MULT",119:"UNICODE_TEXT",120:"TEXT",121:"TAGSTART",122:"EDGE_TEXT",124:"direction_tb",125:"direction_bt",126:"direction_rl",127:"direction_lr",128:"direction_td"},productions_:[0,[3,2],[5,0],[5,2],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[4,2],[4,2],[4,2],[4,2],[4,3],[17,2],[17,1],[18,1],[18,1],[18,1],[16,1],[16,1],[16,2],[16,1],[20,2],[20,2],[20,2],[20,1],[20,1],[20,1],[19,2],[19,1],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,9],[7,10],[7,6],[7,7],[7,4],[7,4],[7,7],[7,8],[7,4],[7,5],[7,1],[7,2],[7,2],[7,1],[22,1],[22,1],[22,1],[22,1],[34,2],[34,1],[21,4],[21,3],[21,4],[21,2],[21,2],[21,1],[45,1],[45,6],[45,5],[46,1],[46,3],[48,4],[48,4],[48,6],[48,4],[48,4],[48,4],[48,8],[48,4],[48,4],[48,4],[48,6],[48,4],[48,4],[48,4],[48,4],[48,4],[48,1],[44,2],[44,3],[44,3],[44,1],[44,3],[44,4],[79,1],[79,2],[79,1],[79,1],[75,1],[75,2],[76,3],[31,1],[31,2],[31,1],[31,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[29,1],[29,2],[29,1],[29,1],[25,5],[26,5],[27,2],[27,4],[27,3],[27,5],[27,3],[27,5],[27,5],[27,7],[27,2],[27,4],[27,2],[27,4],[27,4],[27,6],[23,5],[24,5],[24,5],[24,9],[24,9],[24,7],[24,7],[106,1],[106,3],[95,1],[95,3],[110,1],[110,2],[111,1],[111,1],[111,1],[111,1],[111,1],[111,1],[111,1],[111,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[85,1],[85,1],[85,1],[85,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[82,1],[82,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[50,1],[50,2],[104,1],[104,2],[37,1],[37,1],[37,1],[37,1],[37,1]],performAction:t(function(S,T,D,u,H,s,I){var i=s.length-1;switch(H){case 2:this.$=[];break;case 3:if(!Array.isArray(s[i])||s[i].length>0)s[i-1].push(s[i]);this.$=s[i-1];break;case 4:case 198:this.$=s[i];break;case 5:case 33:case 34:case 35:case 36:case 37:this.$=[];break;case 13:u.setDirection("TB"),this.$="TB";break;case 14:u.setDirection(s[i-1]),this.$=s[i-1];break;case 32:this.$=s[i-1].nodes;break;case 38:if(this.$=u.addSubGraph(s[i-6],s[i-1],s[i-4],"flow"),u.addSubgraphMapping)u.addSubgraphMapping(s[i-6],s[i-4],I[i-8],I[i]);break;case 39:if(this.$=u.addSubGraph(s[i-7],s[i-1],s[i-5],"flow"),u.addVertex(this.$,void 0,void 0,void 0,void 0,void 0,void 0,s[i-3],I[i-3]),u.addSubgraphMapping)u.addSubgraphMapping(s[i-7],s[i-5],I[i-9],I[i]);break;case 40:if(this.$=u.addSubGraph(s[i-3],s[i-1],{text:"",type:"text"},"flow"),u.addSubgraphMapping)u.addSubgraphMapping(s[i-3],{text:"",type:"text"},I[i-5],I[i]);break;case 41:if(this.$=u.addSubGraph(s[i-4],s[i-1],{text:"",type:"text"},"flow"),u.addVertex(this.$,void 0,void 0,void 0,void 0,void 0,void 0,s[i-3],I[i-3]),u.addSubgraphMapping)u.addSubgraphMapping(s[i-4],{text:"",type:"text"},I[i-6],I[i]);break;case 42:if(this.$=u.addSubGraph(void 0,s[i-1],void 0,"flow"),u.addSubgraphMapping)u.addSubgraphMapping(void 0,void 0,I[i-3],I[i]);break;case 43:u.addGlobal(s[i-1]),this.$=[];break;case 44:if(this.$=u.addConnector(s[i-4],s[i-2]),u.addConnectorMapping)u.addConnectorMapping(s[i-4],s[i-2],I[i-6],I[i]);break;case 45:if(this.$=u.addConnector(s[i-5],s[i-3]),u.addVertex(this.$,void 0,void 0,void 0,void 0,void 0,void 0,s[i-1],I[i-1]),u.addConnectorMapping)u.addConnectorMapping(s[i-5],s[i-3],I[i-7],I[i]);break;case 46:if(this.$=u.addConnector(s[i-1],{text:"",type:"text"}),u.addConnectorMapping)u.addConnectorMapping(s[i-1],{text:"",type:"text"},I[i-3],I[i]);break;case 47:if(this.$=u.addConnector(s[i-2],{text:"",type:"text"}),u.addVertex(this.$,void 0,void 0,void 0,void 0,void 0,void 0,s[i-1],I[i-1]),u.addConnectorMapping)u.addConnectorMapping(s[i-2],{text:"",type:"text"},I[i-4],I[i]);break;case 49:this.$=s[i].trim(),u.setAccTitle(this.$);break;case 50:case 51:this.$=s[i].trim(),u.setAccDescription(this.$);break;case 56:this.$=s[i-1]+s[i];break;case 57:this.$=s[i];break;case 58:if(u.addVertex(s[i-1][s[i-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,s[i],I[i]),u.extendVertexMapping)u.extendVertexMapping(s[i-1][s[i-1].length-1],I[i]);if(u.addLink(s[i-3].stmt,s[i-1],s[i-2]),u.addEdgeMapping)u.addEdgeMapping(s[i-3].stmt,s[i-1],s[i-2],this._$);this.$={stmt:s[i-1],nodes:s[i-1].concat(s[i-3].nodes)};break;case 59:if(u.addLink(s[i-2].stmt,s[i],s[i-1]),u.addEdgeMapping)u.addEdgeMapping(s[i-2].stmt,s[i],s[i-1],this._$);this.$={stmt:s[i],nodes:s[i].concat(s[i-2].nodes)};break;case 60:if(u.addLink(s[i-3].stmt,s[i-1],s[i-2]),u.addEdgeMapping)u.addEdgeMapping(s[i-3].stmt,s[i-1],s[i-2],this._$);this.$={stmt:s[i-1],nodes:s[i-1].concat(s[i-3].nodes)};break;case 61:this.$={stmt:s[i-1],nodes:s[i-1]};break;case 62:if(u.addVertex(s[i-1][s[i-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,s[i],I[i]),u.extendVertexMapping)u.extendVertexMapping(s[i-1][s[i-1].length-1],I[i]);this.$={stmt:s[i-1],nodes:s[i-1],shapeData:s[i]};break;case 63:this.$={stmt:s[i],nodes:s[i]};break;case 64:this.$=[s[i]];break;case 65:if(u.addVertex(s[i-5][s[i-5].length-1],void 0,void 0,void 0,void 0,void 0,void 0,s[i-4],I[i-4]),u.extendVertexMapping)u.extendVertexMapping(s[i-5][s[i-5].length-1],I[i-4]);this.$=s[i-5].concat(s[i]);break;case 66:this.$=s[i-4].concat(s[i]);break;case 67:this.$=s[i];break;case 68:this.$=s[i-2],u.setClass(s[i-2],s[i]);break;case 69:if(this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"square"),u.addVertexMapping)u.addVertexMapping(s[i-3],s[i-1],"square",this._$);break;case 70:if(this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"doublecircle"),u.addVertexMapping)u.addVertexMapping(s[i-3],s[i-1],"doublecircle",this._$);break;case 71:if(this.$=s[i-5],u.addVertex(s[i-5],s[i-2],"circle"),u.addVertexMapping)u.addVertexMapping(s[i-5],s[i-2],"circle",this._$);break;case 72:if(this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"ellipse"),u.addVertexMapping)u.addVertexMapping(s[i-3],s[i-1],"ellipse",this._$);break;case 73:if(this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"stadium"),u.addVertexMapping)u.addVertexMapping(s[i-3],s[i-1],"stadium",this._$);break;case 74:if(this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"subroutine"),u.addVertexMapping)u.addVertexMapping(s[i-3],s[i-1],"subroutine",this._$);break;case 75:if(this.$=s[i-7],u.addVertex(s[i-7],s[i-1],"rect",void 0,void 0,void 0,Object.fromEntries([[s[i-5],s[i-3]]])),u.addVertexMapping)u.addVertexMapping(s[i-7],s[i-1],"rect",this._$);break;case 76:if(this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"cylinder"),u.addVertexMapping)u.addVertexMapping(s[i-3],s[i-1],"cylinder",this._$);break;case 77:if(this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"round"),u.addVertexMapping)u.addVertexMapping(s[i-3],s[i-1],"round",this._$);break;case 78:if(this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"diamond"),u.addVertexMapping)u.addVertexMapping(s[i-3],s[i-1],"diamond",this._$);break;case 79:if(this.$=s[i-5],u.addVertex(s[i-5],s[i-2],"hexagon"),u.addVertexMapping)u.addVertexMapping(s[i-5],s[i-2],"hexagon",this._$);break;case 80:if(this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"odd"),u.addVertexMapping)u.addVertexMapping(s[i-3],s[i-1],"odd",this._$);break;case 81:if(this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"trapezoid"),u.addVertexMapping)u.addVertexMapping(s[i-3],s[i-1],"trapezoid",this._$);break;case 82:if(this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"inv_trapezoid"),u.addVertexMapping)u.addVertexMapping(s[i-3],s[i-1],"inv_trapezoid",this._$);break;case 83:if(this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"lean_right"),u.addVertexMapping)u.addVertexMapping(s[i-3],s[i-1],"lean_right",this._$);break;case 84:if(this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"lean_left"),u.addVertexMapping)u.addVertexMapping(s[i-3],s[i-1],"lean_left",this._$);break;case 85:if(this.$=s[i],u.addVertex(s[i]),u.addVertexMapping)u.addVertexMapping(s[i],void 0,void 0,this._$);break;case 86:s[i-1].text=s[i],this.$=s[i-1];break;case 87:case 88:s[i-2].text=s[i-1],this.$=s[i-2];break;case 89:this.$=s[i];break;case 90:var Y=u.destructLink(s[i],s[i-2]);this.$={type:Y.type,stroke:Y.stroke,length:Y.length,edgeSemantic:Y.edgeSemantic,text:s[i-1]};break;case 91:var Y=u.destructLink(s[i],s[i-2]);this.$={type:Y.type,stroke:Y.stroke,length:Y.length,edgeSemantic:Y.edgeSemantic,text:s[i-1],id:s[i-3]};break;case 92:this.$={text:s[i],type:"text"};break;case 93:this.$={text:s[i-1].text+""+s[i],type:s[i-1].type};break;case 94:this.$={text:s[i],type:"string"};break;case 95:this.$={text:s[i],type:"markdown"};break;case 96:var Y=u.destructLink(s[i]);this.$={type:Y.type,stroke:Y.stroke,length:Y.length,edgeSemantic:Y.edgeSemantic};break;case 97:var Y=u.destructLink(s[i]);this.$={type:Y.type,stroke:Y.stroke,length:Y.length,edgeSemantic:Y.edgeSemantic,id:s[i-1]};break;case 98:this.$=s[i-1];break;case 99:this.$={text:s[i],type:"text"};break;case 100:this.$={text:s[i-1].text+""+s[i],type:s[i-1].type};break;case 101:this.$={text:s[i],type:"string"};break;case 102:case 119:this.$={text:s[i],type:"markdown"};break;case 116:this.$={text:s[i],type:"text"};break;case 117:this.$={text:s[i-1].text+""+s[i],type:s[i-1].type};break;case 118:this.$={text:s[i],type:"text"};break;case 120:this.$=s[i-4],u.addClass(s[i-2],s[i]);break;case 121:this.$=s[i-4],u.setClass(s[i-2],s[i]);break;case 122:case 130:this.$=s[i-1],u.setClickEvent(s[i-1],s[i]);break;case 123:case 131:this.$=s[i-3],u.setClickEvent(s[i-3],s[i-2]),u.setTooltip(s[i-3],s[i]);break;case 124:this.$=s[i-2],u.setClickEvent(s[i-2],s[i-1],s[i]);break;case 125:this.$=s[i-4],u.setClickEvent(s[i-4],s[i-3],s[i-2]),u.setTooltip(s[i-4],s[i]);break;case 126:this.$=s[i-2],u.setLink(s[i-2],s[i]);break;case 127:this.$=s[i-4],u.setLink(s[i-4],s[i-2]),u.setTooltip(s[i-4],s[i]);break;case 128:this.$=s[i-4],u.setLink(s[i-4],s[i-2],s[i]);break;case 129:this.$=s[i-6],u.setLink(s[i-6],s[i-4],s[i]),u.setTooltip(s[i-6],s[i-2]);break;case 132:this.$=s[i-1],u.setLink(s[i-1],s[i]);break;case 133:this.$=s[i-3],u.setLink(s[i-3],s[i-2]),u.setTooltip(s[i-3],s[i]);break;case 134:this.$=s[i-3],u.setLink(s[i-3],s[i-2],s[i]);break;case 135:this.$=s[i-5],u.setLink(s[i-5],s[i-4],s[i]),u.setTooltip(s[i-5],s[i-2]);break;case 136:this.$=s[i-4],u.addVertex(s[i-2],void 0,void 0,s[i]);break;case 137:this.$=s[i-4],u.updateLink([s[i-2]],s[i]);break;case 138:this.$=s[i-4],u.updateLink(s[i-2],s[i]);break;case 139:this.$=s[i-8],u.updateLinkInterpolate([s[i-6]],s[i-2]),u.updateLink([s[i-6]],s[i]);break;case 140:this.$=s[i-8],u.updateLinkInterpolate(s[i-6],s[i-2]),u.updateLink(s[i-6],s[i]);break;case 141:this.$=s[i-6],u.updateLinkInterpolate([s[i-4]],s[i]);break;case 142:this.$=s[i-6],u.updateLinkInterpolate(s[i-4],s[i]);break;case 143:case 145:this.$=[s[i]];break;case 144:case 146:s[i-2].push(s[i]),this.$=s[i-2];break;case 148:this.$=s[i-1]+s[i];break;case 196:this.$=s[i];break;case 197:this.$=s[i-1]+""+s[i];break;case 199:this.$=s[i-1]+""+s[i];break;case 200:this.$={stmt:"dir",value:"TB"};break;case 201:this.$={stmt:"dir",value:"BT"};break;case 202:this.$={stmt:"dir",value:"RL"};break;case 203:this.$={stmt:"dir",value:"LR"};break;case 204:this.$={stmt:"dir",value:"TD"};break}},"anonymous"),table:[{3:1,4:2,8:r,10:n,11:a,13:c},{1:[3]},e(d,o,{5:7}),{4:8,8:r,10:n,11:a,13:c},{4:9,8:r,10:n,11:a,13:c},{4:10,8:r,10:n,11:a,13:c},{14:[1,11],15:[1,12]},{1:[2,1],6:13,7:14,8:f,9:m,10:k,11:A,12:C,21:20,23:21,24:22,25:23,26:24,27:25,28:B,35:_,36:P,37:29,38:F,40:E,42:g,45:33,46:44,47:b,48:45,50:46,63:v,87:q,88:fe,89:Se,90:Ee,91:xe,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne,124:Ne,125:Re,126:Oe,127:Pe,128:Ge},e(d,[2,10]),e(d,[2,11]),e(d,[2,12]),e(d,[2,13]),{8:[1,63],9:[1,60],10:[1,61],11:Me,16:59,19:62},e(V,[2,3]),e(V,[2,4]),e(V,[2,5]),e(V,[2,6]),e(V,[2,7]),e(V,[2,8]),e(V,[2,9]),{8:ce,9:de,10:he,12:pe,22:65,44:66,75:71,78:[1,72],80:[1,74],81:[1,73]},{8:ce,9:de,10:he,12:pe,22:75},{8:ce,9:de,10:he,12:pe,22:76},{8:ce,9:de,10:he,12:pe,22:77},{8:ce,9:de,10:he,12:pe,22:78},{8:ce,9:de,10:he,12:pe,22:79},{8:ce,9:de,10:he,11:[1,80],12:pe,22:81},{8:ce,9:de,10:he,12:pe,22:82},{11:[1,83]},e(V,[2,48]),{39:[1,84]},{41:[1,85]},e(V,[2,51]),e(We,[2,63],{19:86,34:87,11:Me,43:Ke}),{11:[1,89]},{11:[1,90]},{11:[1,91]},{11:[1,92]},{15:He,47:qe,63:Xe,83:[1,96],92:Qe,98:[1,93],100:[1,94],104:95,108:Ze,109:$e,112:et,114:tt,117:it,118:rt,119:nt,123:97},e(V,[2,200]),e(V,[2,201]),e(V,[2,202]),e(V,[2,203]),e(V,[2,204]),e(Ue,[2,64]),e(Ue,[2,67],{49:[1,109]}),e(oe,[2,85],{116:122,30:[1,110],47:b,51:[1,111],53:[1,112],55:[1,113],57:[1,114],59:[1,115],61:[1,116],63:v,66:[1,117],68:[1,118],70:[1,119],71:[1,120],73:[1,121],92:Q,105:J,108:Z,109:ee,112:te,114:se,117:ie,118:re,119:ne}),e(be,[2,196]),e(be,[2,157]),e(be,[2,158]),e(be,[2,159]),e(be,[2,160]),e(be,[2,161]),e(be,[2,162]),e(be,[2,163]),e(be,[2,164]),e(be,[2,165]),e(be,[2,166]),e(be,[2,167]),e(d,[2,14]),e(d,[2,20]),e(d,[2,21]),{10:[1,123]},e(d,[2,23]),e(n1,[2,31],{19:124,11:Me}),e(V,[2,32]),{45:125,46:44,47:b,48:45,50:46,63:v,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne},e(V,[2,52]),e(V,[2,53]),e(V,[2,54]),e(V,[2,55]),e(at,[2,89],{76:126,65:[1,128],77:[1,127]}),{79:129,82:130,83:a1,84:o1,119:kt,122:mt},{78:[1,135],80:[1,136]},e(u1,[2,96]),e(V,[2,33]),e(V,[2,34]),e(V,[2,35]),e(V,[2,36]),e(V,[2,37]),{11:At,13:Et,15:Ct,28:xt,29:137,33:Dt,35:vt,36:Ft,47:Vt,63:It,78:Lt,83:l1,84:c1,86:150,87:Bt,88:Mt,89:yt,90:wt,91:Rt,92:Ot,93:Pt,94:138,108:Gt,112:Ut,114:jt,117:zt,118:Wt,119:Kt},e(ut,o,{5:165}),e(ut,o,{5:166}),{11:At,13:Et,15:Ct,28:xt,29:167,33:Dt,35:vt,36:Ft,47:Vt,63:It,78:Lt,83:l1,84:c1,86:150,87:Bt,88:Mt,89:yt,90:wt,91:Rt,92:Ot,93:Pt,94:138,108:Gt,112:Ut,114:jt,117:zt,118:Wt,119:Kt},e(V,[2,49]),e(V,[2,50]),e(We,[2,61],{47:d1}),e(We,[2,62],{19:169,11:Me,43:ct}),e(Ue,[2,57]),{47:b,50:171,63:v,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne},{105:[1,172],106:173,108:[1,174]},{47:b,50:175,63:v,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne},{47:b,50:176,63:v,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne},e(X,[2,122],{11:[1,177],99:[1,178]}),{83:[1,179]},e(X,[2,130],{123:181,11:[1,180],15:He,47:qe,63:Xe,92:Qe,108:Ze,109:$e,112:et,114:tt,117:it,118:rt,119:nt}),e(X,[2,132],{11:[1,182]}),e(ke,[2,198]),e(ke,[2,185]),e(ke,[2,186]),e(ke,[2,187]),e(ke,[2,188]),e(ke,[2,189]),e(ke,[2,190]),e(ke,[2,191]),e(ke,[2,192]),e(ke,[2,193]),e(ke,[2,194]),e(ke,[2,195]),{47:b,50:183,63:v,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne},{31:184,70:M,83:ue,84:le,85:185,119:y,120:w,121:N},{31:192,70:M,83:ue,84:le,85:185,119:y,120:w,121:N},{31:194,53:[1,193],70:M,83:ue,84:le,85:185,119:y,120:w,121:N},{31:195,70:M,83:ue,84:le,85:185,119:y,120:w,121:N},{31:196,70:M,83:ue,84:le,85:185,119:y,120:w,121:N},{31:197,70:M,83:ue,84:le,85:185,119:y,120:w,121:N},{112:[1,198]},{31:199,70:M,83:ue,84:le,85:185,119:y,120:w,121:N},{31:200,68:[1,201],70:M,83:ue,84:le,85:185,119:y,120:w,121:N},{31:202,70:M,83:ue,84:le,85:185,119:y,120:w,121:N},{31:203,70:M,83:ue,84:le,85:185,119:y,120:w,121:N},{31:204,70:M,83:ue,84:le,85:185,119:y,120:w,121:N},e(be,[2,197]),e(d,[2,22]),e(n1,[2,30]),e(We,[2,59],{34:205,19:206,11:Me,43:Ke}),e(at,[2,86],{11:[1,207]}),{11:[1,208]},{31:209,70:M,83:ue,84:le,85:185,119:y,120:w,121:N},{80:[1,210],82:211,119:kt,122:mt},e(dt,[2,92]),e(dt,[2,94]),e(dt,[2,95]),e(dt,[2,183]),e(dt,[2,184]),{79:212,82:130,83:a1,84:o1,119:kt,122:mt},e(u1,[2,97]),{8:ce,9:de,10:he,11:At,12:pe,13:Et,15:Ct,22:214,28:xt,30:[1,213],33:Dt,34:215,35:vt,36:Ft,43:Ke,47:Vt,63:It,78:Lt,86:150,87:Bt,88:Mt,89:yt,90:wt,91:Rt,92:Ot,93:Pt,94:216,108:Gt,112:Ut,114:jt,117:zt,118:Wt,119:Kt},e(K,[2,116]),e(K,[2,118]),e(K,[2,119]),e(K,[2,172]),e(K,[2,173]),e(K,[2,174]),e(K,[2,175]),e(K,[2,176]),e(K,[2,177]),e(K,[2,178]),e(K,[2,179]),e(K,[2,180]),e(K,[2,181]),e(K,[2,182]),e(K,[2,103]),e(K,[2,104]),e(K,[2,105]),e(K,[2,106]),e(K,[2,107]),e(K,[2,108]),e(K,[2,109]),e(K,[2,110]),e(K,[2,111]),e(K,[2,112]),e(K,[2,113]),e(K,[2,114]),e(K,[2,115]),{6:13,7:14,8:f,9:m,10:k,11:A,12:C,21:20,23:21,24:22,25:23,26:24,27:25,28:B,33:[1,217],35:_,36:P,37:29,38:F,40:E,42:g,45:33,46:44,47:b,48:45,50:46,63:v,87:q,88:fe,89:Se,90:Ee,91:xe,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne,124:Ne,125:Re,126:Oe,127:Pe,128:Ge},{6:13,7:14,8:f,9:m,10:k,11:A,12:C,21:20,23:21,24:22,25:23,26:24,27:25,28:B,33:[1,218],35:_,36:P,37:29,38:F,40:E,42:g,45:33,46:44,47:b,48:45,50:46,63:v,87:q,88:fe,89:Se,90:Ee,91:xe,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne,124:Ne,125:Re,126:Oe,127:Pe,128:Ge},{8:ce,9:de,10:he,11:At,12:pe,13:Et,15:Ct,22:220,28:xt,30:[1,219],33:Dt,34:221,35:vt,36:Ft,43:Ke,47:Vt,63:It,78:Lt,86:150,87:Bt,88:Mt,89:yt,90:wt,91:Rt,92:Ot,93:Pt,94:216,108:Gt,112:Ut,114:jt,117:zt,118:Wt,119:Kt},{11:Me,19:222},{47:[1,223]},e(Ue,[2,56]),{11:[1,224],47:b,63:v,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:122,117:ie,118:re,119:ne},{11:[1,225]},{11:[1,226],109:[1,227]},e(h1,[2,143]),{11:[1,228],47:b,63:v,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:122,117:ie,118:re,119:ne},{11:[1,229],47:b,63:v,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:122,117:ie,118:re,119:ne},{83:[1,230]},e(X,[2,124],{11:[1,231]}),e(X,[2,126],{11:[1,232]}),{83:[1,233]},e(ke,[2,199]),{83:[1,234],101:[1,235]},e(Ue,[2,68],{116:122,47:b,63:v,92:Q,105:J,108:Z,109:ee,112:te,114:se,117:ie,118:re,119:ne}),{32:[1,236],70:M,85:237,119:y,120:w,121:N},e(ye,[2,99]),e(ye,[2,101]),e(ye,[2,102]),e(ye,[2,168]),e(ye,[2,169]),e(ye,[2,170]),e(ye,[2,171]),{52:[1,238],70:M,85:237,119:y,120:w,121:N},{31:239,70:M,83:ue,84:le,85:185,119:y,120:w,121:N},{54:[1,240],70:M,85:237,119:y,120:w,121:N},{56:[1,241],70:M,85:237,119:y,120:w,121:N},{58:[1,242],70:M,85:237,119:y,120:w,121:N},{60:[1,243],70:M,85:237,119:y,120:w,121:N},{63:[1,244]},{67:[1,245],70:M,85:237,119:y,120:w,121:N},{69:[1,246],70:M,85:237,119:y,120:w,121:N},{31:247,70:M,83:ue,84:le,85:185,119:y,120:w,121:N},{32:[1,248],70:M,85:237,119:y,120:w,121:N},{70:M,72:[1,249],74:[1,250],85:237,119:y,120:w,121:N},{70:M,72:[1,252],74:[1,251],85:237,119:y,120:w,121:N},e(We,[2,58],{19:169,11:Me,43:ct}),e(We,[2,60],{47:d1}),e(at,[2,88]),e(at,[2,87]),{65:[1,253],70:M,85:237,119:y,120:w,121:N},e(at,[2,90]),e(dt,[2,93]),{80:[1,254],82:211,119:kt,122:mt},{31:255,70:M,83:ue,84:le,85:185,119:y,120:w,121:N},e(ut,o,{5:256}),{8:ce,9:de,10:he,12:pe,22:257,43:ct},e(K,[2,117]),e(V,[2,42]),e(V,[2,43]),{31:258,70:M,83:ue,84:le,85:185,119:y,120:w,121:N},e(V,[2,46]),{8:ce,9:de,10:he,12:pe,22:259,43:ct},{46:260,47:b,48:45,50:46,63:v,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne},{11:Me,19:261},{11:Te,63:De,87:_e,95:262,108:ve,110:263,111:264,112:Fe,113:Ve,114:Ie,115:Le},{11:Te,63:De,87:_e,95:273,107:[1,274],108:ve,110:263,111:264,112:Fe,113:Ve,114:Ie,115:Le},{11:Te,63:De,87:_e,95:275,107:[1,276],108:ve,110:263,111:264,112:Fe,113:Ve,114:Ie,115:Le},{108:[1,277]},{11:Te,63:De,87:_e,95:278,108:ve,110:263,111:264,112:Fe,113:Ve,114:Ie,115:Le},{47:b,50:279,63:v,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne},e(X,[2,123]),{83:[1,280]},{83:[1,281],101:[1,282]},e(X,[2,131]),e(X,[2,133],{11:[1,283]}),e(X,[2,134]),e(oe,[2,69]),e(ye,[2,100]),e(oe,[2,70]),{54:[1,284],70:M,85:237,119:y,120:w,121:N},e(oe,[2,77]),e(oe,[2,72]),e(oe,[2,73]),e(oe,[2,74]),{112:[1,285]},e(oe,[2,76]),e(oe,[2,78]),{69:[1,286],70:M,85:237,119:y,120:w,121:N},e(oe,[2,80]),e(oe,[2,81]),e(oe,[2,83]),e(oe,[2,82]),e(oe,[2,84]),e([11,47,63,92,105,108,109,112,114,117,118,119],[2,98]),e(at,[2,91]),{32:[1,287],70:M,85:237,119:y,120:w,121:N},{6:13,7:14,8:f,9:m,10:k,11:A,12:C,21:20,23:21,24:22,25:23,26:24,27:25,28:B,33:[1,288],35:_,36:P,37:29,38:F,40:E,42:g,45:33,46:44,47:b,48:45,50:46,63:v,87:q,88:fe,89:Se,90:Ee,91:xe,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne,124:Ne,125:Re,126:Oe,127:Pe,128:Ge},e(ut,o,{5:289}),{32:[1,290],70:M,85:237,119:y,120:w,121:N},e(V,[2,47]),e(Ue,[2,66]),{46:291,47:b,48:45,50:46,63:v,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne},e(X,[2,136],{109:ht}),e(p1,[2,145],{111:293,11:Te,63:De,87:_e,108:ve,112:Fe,113:Ve,114:Ie,115:Le}),e(Ce,[2,147]),e(Ce,[2,149]),e(Ce,[2,150]),e(Ce,[2,151]),e(Ce,[2,152]),e(Ce,[2,153]),e(Ce,[2,154]),e(Ce,[2,155]),e(Ce,[2,156]),e(X,[2,137],{109:ht}),{11:[1,294]},e(X,[2,138],{109:ht}),{11:[1,295]},e(h1,[2,144]),e(X,[2,120],{109:ht}),e(X,[2,121],{116:122,47:b,63:v,92:Q,105:J,108:Z,109:ee,112:te,114:se,117:ie,118:re,119:ne}),e(X,[2,125]),e(X,[2,127],{11:[1,296]}),e(X,[2,128]),{101:[1,297]},{54:[1,298]},{65:[1,299]},{69:[1,300]},{8:ce,9:de,10:he,12:pe,22:301,34:302,43:Ke},e(V,[2,40]),{6:13,7:14,8:f,9:m,10:k,11:A,12:C,21:20,23:21,24:22,25:23,26:24,27:25,28:B,33:[1,303],35:_,36:P,37:29,38:F,40:E,42:g,45:33,46:44,47:b,48:45,50:46,63:v,87:q,88:fe,89:Se,90:Ee,91:xe,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne,124:Ne,125:Re,126:Oe,127:Pe,128:Ge},{8:ce,9:de,10:he,12:pe,22:304,34:305,43:Ke},e(Ue,[2,65]),{11:Te,63:De,87:_e,108:ve,110:306,111:264,112:Fe,113:Ve,114:Ie,115:Le},e(Ce,[2,148]),{15:He,47:qe,63:Xe,92:Qe,104:307,108:Ze,109:$e,112:et,114:tt,117:it,118:rt,119:nt,123:97},{15:He,47:qe,63:Xe,92:Qe,104:308,108:Ze,109:$e,112:et,114:tt,117:it,118:rt,119:nt,123:97},{101:[1,309]},e(X,[2,135]),e(oe,[2,71]),{31:310,70:M,83:ue,84:le,85:185,119:y,120:w,121:N},e(oe,[2,79]),e(ut,o,{5:311}),{8:ce,9:de,10:he,12:pe,22:312,43:ct},e(V,[2,41]),e(V,[2,44]),{8:ce,9:de,10:he,12:pe,22:313,43:ct},e(p1,[2,146],{111:293,11:Te,63:De,87:_e,108:ve,112:Fe,113:Ve,114:Ie,115:Le}),e(X,[2,141],{123:181,11:[1,314],15:He,47:qe,63:Xe,92:Qe,108:Ze,109:$e,112:et,114:tt,117:it,118:rt,119:nt}),e(X,[2,142],{123:181,11:[1,315],15:He,47:qe,63:Xe,92:Qe,108:Ze,109:$e,112:et,114:tt,117:it,118:rt,119:nt}),e(X,[2,129]),{32:[1,316],70:M,85:237,119:y,120:w,121:N},{6:13,7:14,8:f,9:m,10:k,11:A,12:C,21:20,23:21,24:22,25:23,26:24,27:25,28:B,33:[1,317],35:_,36:P,37:29,38:F,40:E,42:g,45:33,46:44,47:b,48:45,50:46,63:v,87:q,88:fe,89:Se,90:Ee,91:xe,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne,124:Ne,125:Re,126:Oe,127:Pe,128:Ge},e(ut,o,{5:318}),e(V,[2,45]),{11:Te,63:De,87:_e,95:319,108:ve,110:263,111:264,112:Fe,113:Ve,114:Ie,115:Le},{11:Te,63:De,87:_e,95:320,108:ve,110:263,111:264,112:Fe,113:Ve,114:Ie,115:Le},e(oe,[2,75]),e(V,[2,38]),{6:13,7:14,8:f,9:m,10:k,11:A,12:C,21:20,23:21,24:22,25:23,26:24,27:25,28:B,33:[1,321],35:_,36:P,37:29,38:F,40:E,42:g,45:33,46:44,47:b,48:45,50:46,63:v,87:q,88:fe,89:Se,90:Ee,91:xe,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne,124:Ne,125:Re,126:Oe,127:Pe,128:Ge},e(X,[2,139],{109:ht}),e(X,[2,140],{109:ht}),e(V,[2,39])],defaultActions:{},parseError:t(function(S,T){if(T.recoverable)this.trace(S);else{var D=Error(S);throw D.hash=T,D}},"parseError"),parse:t(function(S){var T=this,D=[0],u=[],H=[null],s=[],I=this.table,i="",Y=0,f1=0,g1=0,I1=2,b1=1,L1=s.slice.call(arguments,1),ae=Object.create(this.lexer),je={yy:{}};for(var Zt in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,Zt))je.yy[Zt]=this.yy[Zt];if(ae.setInput(S,je.yy),je.yy.lexer=ae,je.yy.parser=this,typeof ae.yylloc>"u")ae.yylloc={};var $t=ae.yylloc;s.push($t);var B1=ae.options&&ae.options.ranges;if(typeof je.yy.parseError==="function")this.parseError=je.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function M1(Ae){D.length=D.length-2*Ae,H.length=H.length-Ae,s.length=s.length-Ae}t(M1,"popStack");function k1(){var Ae=u.pop()||ae.lex()||b1;if(typeof Ae!=="number"){if(Ae instanceof Array)u=Ae,Ae=u.pop();Ae=T.symbols_[Ae]||Ae}return Ae}t(k1,"lex");var ge,e1,ze,me,Q1,t1,pt={},Yt,Be,m1,qt;while(!0){if(ze=D[D.length-1],this.defaultActions[ze])me=this.defaultActions[ze];else{if(ge===null||typeof ge>"u")ge=k1();me=I[ze]&&I[ze][ge]}if(typeof me>"u"||!me.length||!me[0]){var s1="";qt=[];for(Yt in I[ze])if(this.terminals_[Yt]&&Yt>I1)qt.push("'"+this.terminals_[Yt]+"'");if(ae.showPosition)s1="Parse error on line "+(Y+1)+`:
|
|
23
23
|
`+ae.showPosition()+`
|
|
24
24
|
Expecting `+qt.join(", ")+", got '"+(this.terminals_[ge]||ge)+"'";else s1="Parse error on line "+(Y+1)+": Unexpected "+(ge==b1?"end of input":"'"+(this.terminals_[ge]||ge)+"'");this.parseError(s1,{text:ae.match,token:this.terminals_[ge]||ge,line:ae.yylineno,loc:$t,expected:qt})}if(me[0]instanceof Array&&me.length>1)throw Error("Parse Error: multiple actions possible at state: "+ze+", token: "+ge);switch(me[0]){case 1:if(D.push(ge),H.push(ae.yytext),s.push(ae.yylloc),D.push(me[1]),ge=null,!e1){if(f1=ae.yyleng,i=ae.yytext,Y=ae.yylineno,$t=ae.yylloc,g1>0)g1--}else ge=e1,e1=null;break;case 2:if(Be=this.productions_[me[1]][1],pt.$=H[H.length-Be],pt._$={first_line:s[s.length-(Be||1)].first_line,last_line:s[s.length-1].last_line,first_column:s[s.length-(Be||1)].first_column,last_column:s[s.length-1].last_column},B1)pt._$.range=[s[s.length-(Be||1)].range[0],s[s.length-1].range[1]];if(t1=this.performAction.apply(pt,[i,f1,Y,je.yy,me[1],H,s].concat(L1)),typeof t1<"u")return t1;if(Be)D=D.slice(0,-1*Be*2),H=H.slice(0,-1*Be),s=s.slice(0,-1*Be);D.push(this.productions_[me[1]][0]),H.push(pt.$),s.push(pt._$),m1=I[D[D.length-2]][D[D.length-1]],D.push(m1);break;case 3:return!0}}return!0},"parse")},V1=function(){var we={EOF:1,parseError:t(function(T,D){if(this.yy.parser)this.yy.parser.parseError(T,D);else throw Error(T)},"parseError"),setInput:t(function(S,T){if(this.yy=T||this.yy||{},this._input=S,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges)this.yylloc.range=[0,0];return this.offset=0,this},"setInput"),input:t(function(){var S=this._input[0];this.yytext+=S,this.yyleng++,this.offset++,this.match+=S,this.matched+=S;var T=S.match(/(?:\r\n?|\n).*/g);if(T)this.yylineno++,this.yylloc.last_line++;else this.yylloc.last_column++;if(this.options.ranges)this.yylloc.range[1]++;return this._input=this._input.slice(1),S},"input"),unput:t(function(S){var T=S.length,D=S.split(/(?:\r\n?|\n)/g);this._input=S+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-T),this.offset-=T;var u=this.match.split(/(?:\r\n?|\n)/g);if(this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),D.length-1)this.yylineno-=D.length-1;var H=this.yylloc.range;if(this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:D?(D.length===u.length?this.yylloc.first_column:0)+u[u.length-D.length].length-D[0].length:this.yylloc.first_column-T},this.options.ranges)this.yylloc.range=[H[0],H[0]+this.yyleng-T];return this.yyleng=this.yytext.length,this},"unput"),more:t(function(){return this._more=!0,this},"more"),reject:t(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
25
25
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:t(function(S){this.unput(this.match.slice(S))},"less"),pastInput:t(function(){var S=this.matched.substr(0,this.matched.length-this.match.length);return(S.length>20?"...":"")+S.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:t(function(){var S=this.match;if(S.length<20)S+=this._input.substr(0,20-S.length);return(S.substr(0,20)+(S.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:t(function(){var S=this.pastInput(),T=Array(S.length+1).join("-");return S+this.upcomingInput()+`
|
|
@@ -33,14 +33,14 @@ Expecting `+qt.join(", ")+", got '"+(this.terminals_[ge]||ge)+"'";else s1="Parse
|
|
|
33
33
|
stroke: ${f(C)};
|
|
34
34
|
${m(C)}
|
|
35
35
|
}
|
|
36
|
-
`}for(let A=0;A<x1(o);A++){let C=T1(A,o),B=`[data-look="${c}"][data-color-id="color-${C}"].cluster`,_=`[data-look="${c}"][data-color-id="color-${C}"].node`,
|
|
36
|
+
`}for(let A=0;A<x1(o);A++){let C=T1(A,o),B=`[data-look="${c}"][data-color-id="color-${C}"].cluster`,_=`[data-look="${c}"][data-color-id="color-${C}"].node`,P=t((F)=>`${B} ${F}, ${_} ${F}`,"rule");k+=`
|
|
37
37
|
|
|
38
|
-
${
|
|
39
|
-
${
|
|
38
|
+
${P("rect")},
|
|
39
|
+
${P("path")} {
|
|
40
40
|
stroke: ${f(C)};
|
|
41
41
|
${m(C)}
|
|
42
42
|
}
|
|
43
|
-
`}return k},"genColor"),Y1=t((e,r)=>{let n=
|
|
43
|
+
`}return k},"genColor"),Y1=t((e,r)=>{let n=ia,a=n(e,"r"),c=n(e,"g"),d=n(e,"b");return ot(a,c,d,r)},"fade"),q1=t((e)=>`${H1(e)}
|
|
44
44
|
.label {
|
|
45
45
|
font-family: ${e.fontFamily};
|
|
46
46
|
color: ${e.nodeTextColor||e.textColor};
|
|
@@ -196,5 +196,5 @@ Expecting `+qt.join(", ")+", got '"+(this.terminals_[ge]||ge)+"'";else s1="Parse
|
|
|
196
196
|
}
|
|
197
197
|
text-align: center;
|
|
198
198
|
}
|
|
199
|
-
${
|
|
200
|
-
`,"getStyles"),X1=q1,Es={parser:K1,get db(){return new U1},renderer:W1,styles:X1,init:t((e)=>{if(e.agentflow??={},e.layout)
|
|
199
|
+
${kn()}
|
|
200
|
+
`,"getStyles"),X1=q1,Es={parser:K1,get db(){return new U1},renderer:W1,styles:X1,init:t((e)=>{if(e.agentflow??={},e.layout)oa({layout:e.layout});e.flowchart??={},e.flowchart.arrowMarkerAbsolute=e.arrowMarkerAbsolute,oa({flowchart:{arrowMarkerAbsolute:e.arrowMarkerAbsolute}})},"init")};export{Es as diagram};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{be}from"./index-gcs49f3p.js";import{t,l,Mt,K,E,te,R,L,O,P,z,j,G,h,On,ue,yu,N,ie,lt}from"./index-vw5k8csz.js";import{Ka}from"./index-pbe4yed4.js";import{Te}from"./index-trm9x02n.js";function Ge(e){var r=0,n=e.children,o=n&&n.length;if(!o)r=1;else while(--o>=0)r+=n[o].value;e.value=r}function fe(){return this.eachAfter(Ge)}function he(e,r){let n=-1;for(let o of this)e.call(r,o,++n,this);return this}function me(e,r){var n=this,o=[n],s,p,u=-1;while(n=o.pop())if(e.call(r,n,++u,this),s=n.children)for(p=s.length-1;p>=0;--p)o.push(s[p]);return this}function ge(e,r){var n=this,o=[n],s=[],p,u,f,S=-1;while(n=o.pop())if(s.push(n),p=n.children)for(u=0,f=p.length;u<f;++u)o.push(p[u]);while(n=s.pop())e.call(r,n,++S,this);return this}function ye(e,r){let n=-1;for(let o of this)if(e.call(r,o,++n,this))return o}function xe(e){return this.eachAfter(function(r){var n=+e(r.data)||0,o=r.children,s=o&&o.length;while(--s>=0)n+=o[s].value;r.value=n})}function Se(e){return this.eachBefore(function(r){if(r.children)r.children.sort(e)})}function ve(e){var r=this,n=Xe(r,e),o=[r];while(r!==n)r=r.parent,o.push(r);var s=o.length;while(e!==n)o.splice(s,0,e),e=e.parent;return o}function Xe(e,r){if(e===r)return e;var n=e.ancestors(),o=r.ancestors(),s=null;e=n.pop(),r=o.pop();while(e===r)s=e,e=n.pop(),r=o.pop();return s}function we(){var e=this,r=[e];while(e=e.parent)r.push(e);return r}function Ce(){return Array.from(this)}function Le(){var e=[];return this.eachBefore(function(r){if(!r.children)e.push(r)}),e}function $e(){var e=this,r=[];return e.each(function(n){if(n!==e)r.push({source:n.parent,target:n})}),r}function*Ae(){var e=this,r,n=[e],o,s,p;do{r=n.reverse(),n=[];while(e=r.pop())if(yield e,o=e.children)for(s=0,p=o.length;s<p;++s)n.push(o[s])}while(n.length)}function J(e,r){if(e instanceof Map){if(e=[void 0,e],r===void 0)r=Ze}else if(r===void 0)r=je;var n=new ne(e),o,s=[n],p,u,f,S;while(o=s.pop())if((u=r(o.data))&&(S=(u=Array.from(u)).length)){o.children=u;for(f=S-1;f>=0;--f)s.push(p=u[f]=new ne(u[f])),p.parent=o,p.depth=o.depth+1}return n.eachBefore(Je)}function Ye(){return J(this).eachBefore(Ue)}function je(e){return e.children}function Ze(e){return Array.isArray(e)?e[1]:null}function Ue(e){if(e.data.value!==void 0)e.value=e.data.value;e.data=e.data.data}function Je(e){var r=0;do e.height=r;while((e=e.parent)&&e.height<++r)}function ne(e){this.data=e,this.depth=this.height=0,this.parent=null}ne.prototype=J.prototype={constructor:ne,count:fe,each:he,eachAfter:ge,eachBefore:me,find:ye,sum:xe,sort:Se,path:ve,ancestors:we,descendants:Ce,leaves:Le,links:$e,copy:Ye,[Symbol.iterator]:Ae};function Ve(e){if(typeof e!=="function")throw Error();return e}function Q(){return 0}function X(e){return function(){return e}}function Fe(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function Ne(e,r,n,o,s){var p=e.children,u,f=-1,S=p.length,d=e.value&&(o-r)/e.value;while(++f<S)u=p[f],u.y0=n,u.y1=s,u.x0=r,u.x1=r+=u.value*d}function ke(e,r,n,o,s){var p=e.children,u,f=-1,S=p.length,d=e.value&&(s-n)/e.value;while(++f<S)u=p[f],u.x0=r,u.x1=o,u.y0=n,u.y1=n+=u.value*d}var Ke=(1+Math.sqrt(5))/2;function Qe(e,r,n,o,s,p){var u=[],f=r.children,S,d,m=0,T=0,i=f.length,C,b,w=r.value,g,v,B,D,Y,ae,W;while(m<i){C=s-n,b=p-o;do g=f[T++].value;while(!g&&T<i);v=B=g,ae=Math.max(b/C,C/b)/(w*e),W=g*g*ae,Y=Math.max(B/W,W/v);for(;T<i;++T){if(g+=d=f[T].value,d<v)v=d;if(d>B)B=d;if(W=g*g*ae,D=Math.max(B/W,W/v),D>Y){g-=d;break}Y=D}if(u.push(S={value:g,dice:C<b,children:f.slice(m,T)}),S.dice)Ne(S,n,o,s,w?o+=b*g/w:p);else ke(S,n,o,w?n+=C*g/w:s,p);w-=g,m=T}return u}var Pe=function e(r){function n(o,s,p,u,f){Qe(r,o,s,p,u,f)}return n.ratio=function(o){return e((o=+o)>1?o:1)},n}(Ke);function ce(){var e=Pe,r=!1,n=1,o=1,s=[0],p=Q,u=Q,f=Q,S=Q,d=Q;function m(i){if(i.x0=i.y0=0,i.x1=n,i.y1=o,i.eachBefore(T),s=[0],r)i.eachBefore(Fe);return i}function T(i){var C=s[i.depth],b=i.x0+C,w=i.y0+C,g=i.x1-C,v=i.y1-C;if(g<b)b=g=(b+g)/2;if(v<w)w=v=(w+v)/2;if(i.x0=b,i.y0=w,i.x1=g,i.y1=v,i.children){if(C=s[i.depth+1]=p(i)/2,b+=d(i)-C,w+=u(i)-C,g-=f(i)-C,v-=S(i)-C,g<b)b=g=(b+g)/2;if(v<w)w=v=(w+v)/2;e(i,b,w,g,v)}}return m.round=function(i){return arguments.length?(r=!!i,m):r},m.size=function(i){return arguments.length?(n=+i[0],o=+i[1],m):[n,o]},m.tile=function(i){return arguments.length?(e=Ve(i),m):e},m.padding=function(i){return arguments.length?m.paddingInner(i).paddingOuter(i):m.paddingInner()},m.paddingInner=function(i){return arguments.length?(p=typeof i==="function"?i:X(+i),m):p},m.paddingOuter=function(i){return arguments.length?m.paddingTop(i).paddingRight(i).paddingBottom(i).paddingLeft(i):m.paddingTop()},m.paddingTop=function(i){return arguments.length?(u=typeof i==="function"?i:X(+i),m):u},m.paddingRight=function(i){return arguments.length?(f=typeof i==="function"?i:X(+i),m):f},m.paddingBottom=function(i){return arguments.length?(S=typeof i==="function"?i:X(+i),m):S},m.paddingLeft=function(i){return arguments.length?(d=typeof i==="function"?i:X(+i),m):d},m}var Be=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=L,this.getAccTitle=O,this.setDiagramTitle=j,this.getDiagramTitle=G,this.getAccDescription=z,this.setAccDescription=P}static{t(this,"TreeMapDB")}getNodes(){return this.nodes}getConfig(){let e=K,r=E();return ie({...e.treemap,...r.treemap??{}})}addNode(e,r){if(this.nodes.push(e),this.levels.set(e,r),r===0)this.outerNodes.push(e),this.root??=e}getRoot(){return{name:"",children:this.outerNodes}}addClass(e,r){let n=this.classes.get(e)??{id:e,styles:[],textStyles:[]},o=r.replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");if(o)o.forEach((s)=>{if(yu(s))if(n?.textStyles)n.textStyles.push(s);else n.textStyles=[s];if(n?.styles)n.styles.push(s);else n.styles=[s]});this.classes.set(e,n)}getClasses(){return this.classes}getStylesForClass(e){return this.classes.get(e)?.styles??[]}clear(){R(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}};function Ee(e){if(!e.length)return[];let r=[],n=[];return e.forEach((o)=>{let s={name:o.name,children:o.type==="Leaf"?void 0:[]};if(s.classSelector=o?.classSelector,o?.cssCompiledStyles)s.cssCompiledStyles=o.cssCompiledStyles;if(o.type==="Leaf"&&o.value!==void 0)s.value=o.value;while(n.length>0&&n[n.length-1].level>=o.level)n.pop();if(n.length===0)r.push(s);else{let p=n[n.length-1].node;if(p.children)p.children.push(s);else p.children=[s]}if(o.type!=="Leaf")n.push({node:s,level:o.level})}),r}t(Ee,"buildHierarchy");var et=t((e,r)=>{be(e,r);let n=[];for(let p of e.TreemapRows??[])if(p.$type==="ClassDefStatement")r.addClass(p.className??"",p.styleText??"");for(let p of e.TreemapRows??[]){let u=p.item;if(!u)continue;let f=p.indent?parseInt(p.indent):0,S=tt(u),d=u.classSelector?r.getStylesForClass(u.classSelector):[],m=d.length>0?d:void 0,T={level:f,name:S,type:u.$type,value:u.value,classSelector:u.classSelector,cssCompiledStyles:m};n.push(T)}let o=Ee(n),s=t((p,u)=>{for(let f of p)if(r.addNode(f,u),f.children&&f.children.length>0)s(f.children,u+1)},"addNodesRecursively");s(o,0)},"populate"),tt=t((e)=>e.name?String(e.name):"","getItemName"),Re={parser:{yy:void 0},parse:t(async(e)=>{try{let n=await Te("treemap",e);l.debug("Treemap AST:",n);let o=Re.parser?.yy;if(!(o instanceof Be))throw Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");et(n,o)}catch(r){throw l.error("Error parsing treemap:",r),r}},"parse")},at=10,ee=10,le=25,rt=t((e,r,n,o)=>{let s=o.db,p=s.getConfig(),u=p.padding??at,f=s.getDiagramTitle(),S=s.getRoot(),{themeVariables:d}=E();if(!S)return;let m=f?30:0,T=ue(r),i=p.nodeWidth?p.nodeWidth*ee:960,C=p.nodeHeight?p.nodeHeight*ee:500,b=i,w=C+m;T.attr("viewBox",`0 0 ${b} ${w}`),te(T,w,b,p.useMaxWidth);let g;try{let a=p.valueFormat||",";if(a==="$0,0")g=t((c)=>"$"+Ka(",")(c),"valueFormat");else if(a.startsWith("$")&&a.includes(",")){let c=/\.\d+/.exec(a),y=c?c[0]:"";g=t((A)=>"$"+Ka(","+y)(A),"valueFormat")}else if(a.startsWith("$")){let c=a.substring(1);g=t((y)=>"$"+Ka(c||"")(y),"valueFormat")}else g=Ka(a)}catch(a){l.error("Error creating format function:",a),g=Ka(",")}let v=On().range(["transparent",d.cScale0,d.cScale1,d.cScale2,d.cScale3,d.cScale4,d.cScale5,d.cScale6,d.cScale7,d.cScale8,d.cScale9,d.cScale10,d.cScale11]),B=On().range(["transparent",d.cScalePeer0,d.cScalePeer1,d.cScalePeer2,d.cScalePeer3,d.cScalePeer4,d.cScalePeer5,d.cScalePeer6,d.cScalePeer7,d.cScalePeer8,d.cScalePeer9,d.cScalePeer10,d.cScalePeer11]),D=On().range([d.cScaleLabel0,d.cScaleLabel1,d.cScaleLabel2,d.cScaleLabel3,d.cScaleLabel4,d.cScaleLabel5,d.cScaleLabel6,d.cScaleLabel7,d.cScaleLabel8,d.cScaleLabel9,d.cScaleLabel10,d.cScaleLabel11]);if(f)T.append("text").attr("x",b/2).attr("y",m/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(f);let Y=T.append("g").attr("transform",`translate(0, ${m})`).attr("class","treemapContainer"),ae=J(S).sum((a)=>a.value??0).sort((a,c)=>(c.value??0)-(a.value??0)),Me=ce().size([i,C]).paddingTop((a)=>a.children&&a.children.length>0?le+ee:0).paddingInner(u).paddingLeft((a)=>a.children&&a.children.length>0?ee:0).paddingRight((a)=>a.children&&a.children.length>0?ee:0).paddingBottom((a)=>a.children&&a.children.length>0?ee:0).round(!0)(ae),We=Me.descendants().filter((a)=>a.children&&a.children.length>0),re=Y.selectAll(".treemapSection").data(We).enter().append("g").attr("class","treemapSection").attr("transform",(a)=>`translate(${a.x0},${a.y0})`);if(re.append("rect").attr("width",(a)=>a.x1-a.x0).attr("height",le).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",0.6).attr("stroke-width",0.6).attr("style",(a)=>{if(a.depth===0)return"display: none;";return""}),re.append("clipPath").attr("id",(a,c)=>`clip-section-${r}-${c}`).append("rect").attr("width",(a)=>Math.max(0,a.x1-a.x0-12)).attr("height",le),re.append("rect").attr("width",(a)=>a.x1-a.x0).attr("height",(a)=>a.y1-a.y0).attr("class",(a,c)=>`treemapSection section${c}`).attr("fill",(a)=>v(a.data.name)).attr("fill-opacity",0.6).attr("stroke",(a)=>B(a.data.name)).attr("stroke-width",2).attr("stroke-opacity",0.4).attr("style",(a)=>{if(a.depth===0)return"display: none;";let c=N({cssCompiledStyles:a.data.cssCompiledStyles});return c.nodeStyles+";"+c.borderStyles.join(";")}),re.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",le/2).attr("dominant-baseline","middle").text((a)=>a.depth===0?"":a.data.name).attr("font-weight","bold").attr("clip-path",(a,c)=>`url(#clip-section-${r}-${c})`).attr("style",(a)=>{if(a.depth===0)return"display: none;";let c="dominant-baseline: middle; font-size: 12px; fill:"+D(a.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",y=N({cssCompiledStyles:a.data.cssCompiledStyles});return c+y.labelStyles.replace("color:","fill:")}).each(function(a){if(a.depth===0)return;let c=h(this),y=a.data.name;c.text(y);let A=a.x1-a.x0,k=6,F;if(p.showValues!==!1&&a.value){let _=A-10,q=30,Oe=10;F=_-30-10-k}else F=A-k-6;let x=Math.max(15,F),I=c.node();if(I.getComputedTextLength()>x){let q=y;while(q.length>0){if(q=y.substring(0,q.length-1),q.length===0){if(c.text("..."),I.getComputedTextLength()>x)c.text("");break}if(c.text(q+"..."),I.getComputedTextLength()<=x)break}}}),p.showValues!==!1)re.append("text").attr("class","treemapSectionValue").attr("x",(a)=>a.x1-a.x0-10).attr("y",le/2).attr("text-anchor","end").attr("dominant-baseline","middle").text((a)=>a.value?g(a.value):"").attr("font-style","italic").attr("style",(a)=>{if(a.depth===0)return"display: none;";let c="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+D(a.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",y=N({cssCompiledStyles:a.data.cssCompiledStyles});return c+y.labelStyles.replace("color:","fill:")});let _e=Me.leaves(),V=_e.length>20,He=V?16:38,oe=V?14:28,Z=V?4:8,U=V?4:6,pe=V?2:4,ze=V?8:10,de=V?1:2,se=Y.selectAll(".treemapLeafGroup").data(_e).enter().append("g").attr("class",(a,c)=>`treemapNode treemapLeafGroup leaf${c}${a.data.classSelector?` ${a.data.classSelector}`:""}x`).attr("transform",(a)=>`translate(${a.x0},${a.y0})`);if(se.append("rect").attr("width",(a)=>a.x1-a.x0).attr("height",(a)=>a.y1-a.y0).attr("class","treemapLeaf").attr("fill",(a)=>a.parent?v(a.parent.data.name):v(a.data.name)).attr("style",(a)=>N({cssCompiledStyles:a.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",0.3).attr("stroke",(a)=>a.parent?v(a.parent.data.name):v(a.data.name)).attr("stroke-width",3),se.append("clipPath").attr("id",(a,c)=>`clip-${r}-${c}`).append("rect").attr("width",(a)=>Math.max(0,a.x1-a.x0-4)).attr("height",(a)=>Math.max(0,a.y1-a.y0-4)),se.append("text").attr("class","treemapLabel").attr("x",(a)=>(a.x1-a.x0)/2).attr("y",(a)=>(a.y1-a.y0)/2).attr("style",(a)=>{let c=`text-anchor: middle; dominant-baseline: middle; font-size: ${He}px;fill:`+D(a.data.name)+";",y=N({cssCompiledStyles:a.data.cssCompiledStyles});return c+y.labelStyles.replace("color:","fill:")}).attr("clip-path",(a,c)=>`url(#clip-${r}-${c})`).text((a)=>a.data.name).each(function(a){let c=h(this),y=a.x1-a.x0,A=a.y1-a.y0,k=c.node(),F=y-2*pe,H=A-2*pe;if(F<ze||H<ze){c.style("display","none");return}let x=parseInt(c.style("font-size"),10),I=0.6;while(k.getComputedTextLength()>F&&x>Z)x--,c.style("font-size",`${x}px`);let M=Math.max(U,Math.min(oe,Math.round(x*I))),_=x+de+M;while(_>H&&x>Z){if(x--,M=Math.max(U,Math.min(oe,Math.round(x*I))),M<U&&x===Z)break;if(c.style("font-size",`${x}px`),_=x+de+M,M<=U&&_>H);}if(c.style("font-size",`${x}px`),V){if(x<Z||H<Z)c.style("display","none")}else if(k.getComputedTextLength()>F||x<Z||H<x)c.style("display","none")}),p.showValues!==!1)se.append("text").attr("class","treemapValue").attr("x",(c)=>(c.x1-c.x0)/2).attr("y",function(c){return(c.y1-c.y0)/2}).attr("style",(c)=>{let y=`text-anchor: middle; dominant-baseline: hanging; font-size: ${oe}px;fill:`+D(c.data.name)+";",A=N({cssCompiledStyles:c.data.cssCompiledStyles});return y+A.labelStyles.replace("color:","fill:")}).attr("clip-path",(c,y)=>`url(#clip-${r}-${y})`).text((c)=>c.value?g(c.value):"").each(function(c){let y=h(this),A=this.parentNode;if(!A){y.style("display","none");return}let k=h(A).select(".treemapLabel");if(k.empty()||k.style("display")==="none"){y.style("display","none");return}let F=parseFloat(k.style("font-size")),x=Math.max(U,Math.min(oe,Math.round(F*0.6)));y.style("font-size",`${x}px`);let M=(c.y1-c.y0)/2+F/2+de;y.attr("y",M);let _=c.x1-c.x0,De=c.y1-c.y0-4,qe=_-2*pe;if(y.node().getComputedTextLength()>qe||M+x>De||x<U)y.style("display","none");else y.style("display",null)});let Ie=p.diagramPadding??8;lt(T,Ie,"flowchart",p?.useMaxWidth||!1)},"draw"),nt=t(function(e,r){return r.db.getClasses()},"getClasses"),ot={draw:rt,getClasses:nt},st={sectionStrokeColor:"black",sectionStrokeWidth:"1",sectionFillColor:"#efefef",leafStrokeColor:"black",leafStrokeWidth:"1",leafFillColor:"#efefef",labelFontSize:"12px",valueFontSize:"10px",titleFontSize:"14px"},it=t(({treemap:e}={})=>{let r=Mt(),n=E(),o=ie(r,n.themeVariables),s=ie(st,e),p=s.titleColor??o.titleColor,u=s.labelColor??o.textColor,f=s.valueColor??o.textColor;return`
|
|
1
|
+
import{be}from"./index-52rqxgya.js";import{t,l,Mt,K,E,te,R,L,z,O,U,j,G,h,On,de,yu,N,oe,lt}from"./index-fta1y9pc.js";import{Ka}from"./index-jsyekbx9.js";import{Te}from"./index-j51d5a5m.js";function Ge(e){var r=0,n=e.children,o=n&&n.length;if(!o)r=1;else while(--o>=0)r+=n[o].value;e.value=r}function fe(){return this.eachAfter(Ge)}function he(e,r){let n=-1;for(let o of this)e.call(r,o,++n,this);return this}function me(e,r){var n=this,o=[n],s,p,u=-1;while(n=o.pop())if(e.call(r,n,++u,this),s=n.children)for(p=s.length-1;p>=0;--p)o.push(s[p]);return this}function ge(e,r){var n=this,o=[n],s=[],p,u,f,S=-1;while(n=o.pop())if(s.push(n),p=n.children)for(u=0,f=p.length;u<f;++u)o.push(p[u]);while(n=s.pop())e.call(r,n,++S,this);return this}function ye(e,r){let n=-1;for(let o of this)if(e.call(r,o,++n,this))return o}function xe(e){return this.eachAfter(function(r){var n=+e(r.data)||0,o=r.children,s=o&&o.length;while(--s>=0)n+=o[s].value;r.value=n})}function Se(e){return this.eachBefore(function(r){if(r.children)r.children.sort(e)})}function ve(e){var r=this,n=Xe(r,e),o=[r];while(r!==n)r=r.parent,o.push(r);var s=o.length;while(e!==n)o.splice(s,0,e),e=e.parent;return o}function Xe(e,r){if(e===r)return e;var n=e.ancestors(),o=r.ancestors(),s=null;e=n.pop(),r=o.pop();while(e===r)s=e,e=n.pop(),r=o.pop();return s}function we(){var e=this,r=[e];while(e=e.parent)r.push(e);return r}function Ce(){return Array.from(this)}function Le(){var e=[];return this.eachBefore(function(r){if(!r.children)e.push(r)}),e}function $e(){var e=this,r=[];return e.each(function(n){if(n!==e)r.push({source:n.parent,target:n})}),r}function*Ae(){var e=this,r,n=[e],o,s,p;do{r=n.reverse(),n=[];while(e=r.pop())if(yield e,o=e.children)for(s=0,p=o.length;s<p;++s)n.push(o[s])}while(n.length)}function J(e,r){if(e instanceof Map){if(e=[void 0,e],r===void 0)r=Ze}else if(r===void 0)r=je;var n=new ne(e),o,s=[n],p,u,f,S;while(o=s.pop())if((u=r(o.data))&&(S=(u=Array.from(u)).length)){o.children=u;for(f=S-1;f>=0;--f)s.push(p=u[f]=new ne(u[f])),p.parent=o,p.depth=o.depth+1}return n.eachBefore(Je)}function Ye(){return J(this).eachBefore(Ue)}function je(e){return e.children}function Ze(e){return Array.isArray(e)?e[1]:null}function Ue(e){if(e.data.value!==void 0)e.value=e.data.value;e.data=e.data.data}function Je(e){var r=0;do e.height=r;while((e=e.parent)&&e.height<++r)}function ne(e){this.data=e,this.depth=this.height=0,this.parent=null}ne.prototype=J.prototype={constructor:ne,count:fe,each:he,eachAfter:ge,eachBefore:me,find:ye,sum:xe,sort:Se,path:ve,ancestors:we,descendants:Ce,leaves:Le,links:$e,copy:Ye,[Symbol.iterator]:Ae};function Ve(e){if(typeof e!=="function")throw Error();return e}function Q(){return 0}function q(e){return function(){return e}}function Fe(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function Ne(e,r,n,o,s){var p=e.children,u,f=-1,S=p.length,d=e.value&&(o-r)/e.value;while(++f<S)u=p[f],u.y0=n,u.y1=s,u.x0=r,u.x1=r+=u.value*d}function ke(e,r,n,o,s){var p=e.children,u,f=-1,S=p.length,d=e.value&&(s-n)/e.value;while(++f<S)u=p[f],u.x0=r,u.x1=o,u.y0=n,u.y1=n+=u.value*d}var Ke=(1+Math.sqrt(5))/2;function Qe(e,r,n,o,s,p){var u=[],f=r.children,S,d,m=0,T=0,i=f.length,C,b,w=r.value,g,v,P,D,X,ae,B;while(m<i){C=s-n,b=p-o;do g=f[T++].value;while(!g&&T<i);v=P=g,ae=Math.max(b/C,C/b)/(w*e),B=g*g*ae,X=Math.max(P/B,B/v);for(;T<i;++T){if(g+=d=f[T].value,d<v)v=d;if(d>P)P=d;if(B=g*g*ae,D=Math.max(P/B,B/v),D>X){g-=d;break}X=D}if(u.push(S={value:g,dice:C<b,children:f.slice(m,T)}),S.dice)Ne(S,n,o,s,w?o+=b*g/w:p);else ke(S,n,o,w?n+=C*g/w:s,p);w-=g,m=T}return u}var Pe=function e(r){function n(o,s,p,u,f){Qe(r,o,s,p,u,f)}return n.ratio=function(o){return e((o=+o)>1?o:1)},n}(Ke);function ce(){var e=Pe,r=!1,n=1,o=1,s=[0],p=Q,u=Q,f=Q,S=Q,d=Q;function m(i){if(i.x0=i.y0=0,i.x1=n,i.y1=o,i.eachBefore(T),s=[0],r)i.eachBefore(Fe);return i}function T(i){var C=s[i.depth],b=i.x0+C,w=i.y0+C,g=i.x1-C,v=i.y1-C;if(g<b)b=g=(b+g)/2;if(v<w)w=v=(w+v)/2;if(i.x0=b,i.y0=w,i.x1=g,i.y1=v,i.children){if(C=s[i.depth+1]=p(i)/2,b+=d(i)-C,w+=u(i)-C,g-=f(i)-C,v-=S(i)-C,g<b)b=g=(b+g)/2;if(v<w)w=v=(w+v)/2;e(i,b,w,g,v)}}return m.round=function(i){return arguments.length?(r=!!i,m):r},m.size=function(i){return arguments.length?(n=+i[0],o=+i[1],m):[n,o]},m.tile=function(i){return arguments.length?(e=Ve(i),m):e},m.padding=function(i){return arguments.length?m.paddingInner(i).paddingOuter(i):m.paddingInner()},m.paddingInner=function(i){return arguments.length?(p=typeof i==="function"?i:q(+i),m):p},m.paddingOuter=function(i){return arguments.length?m.paddingTop(i).paddingRight(i).paddingBottom(i).paddingLeft(i):m.paddingTop()},m.paddingTop=function(i){return arguments.length?(u=typeof i==="function"?i:q(+i),m):u},m.paddingRight=function(i){return arguments.length?(f=typeof i==="function"?i:q(+i),m):f},m.paddingBottom=function(i){return arguments.length?(S=typeof i==="function"?i:q(+i),m):S},m.paddingLeft=function(i){return arguments.length?(d=typeof i==="function"?i:q(+i),m):d},m}var Be=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=L,this.getAccTitle=z,this.setDiagramTitle=j,this.getDiagramTitle=G,this.getAccDescription=U,this.setAccDescription=O}static{t(this,"TreeMapDB")}getNodes(){return this.nodes}getConfig(){let e=K,r=E();return oe({...e.treemap,...r.treemap??{}})}addNode(e,r){if(this.nodes.push(e),this.levels.set(e,r),r===0)this.outerNodes.push(e),this.root??=e}getRoot(){return{name:"",children:this.outerNodes}}addClass(e,r){let n=this.classes.get(e)??{id:e,styles:[],textStyles:[]},o=r.replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");if(o)o.forEach((s)=>{if(yu(s))if(n?.textStyles)n.textStyles.push(s);else n.textStyles=[s];if(n?.styles)n.styles.push(s);else n.styles=[s]});this.classes.set(e,n)}getClasses(){return this.classes}getStylesForClass(e){return this.classes.get(e)?.styles??[]}clear(){R(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}};function Ee(e){if(!e.length)return[];let r=[],n=[];return e.forEach((o)=>{let s={name:o.name,children:o.type==="Leaf"?void 0:[]};if(s.classSelector=o?.classSelector,o?.cssCompiledStyles)s.cssCompiledStyles=o.cssCompiledStyles;if(o.type==="Leaf"&&o.value!==void 0)s.value=o.value;while(n.length>0&&n[n.length-1].level>=o.level)n.pop();if(n.length===0)r.push(s);else{let p=n[n.length-1].node;if(p.children)p.children.push(s);else p.children=[s]}if(o.type!=="Leaf")n.push({node:s,level:o.level})}),r}t(Ee,"buildHierarchy");var et=t((e,r)=>{be(e,r);let n=[];for(let p of e.TreemapRows??[])if(p.$type==="ClassDefStatement")r.addClass(p.className??"",p.styleText??"");for(let p of e.TreemapRows??[]){let u=p.item;if(!u)continue;let f=p.indent?parseInt(p.indent):0,S=tt(u),d=u.classSelector?r.getStylesForClass(u.classSelector):[],m=d.length>0?d:void 0,T={level:f,name:S,type:u.$type,value:u.value,classSelector:u.classSelector,cssCompiledStyles:m};n.push(T)}let o=Ee(n),s=t((p,u)=>{for(let f of p)if(r.addNode(f,u),f.children&&f.children.length>0)s(f.children,u+1)},"addNodesRecursively");s(o,0)},"populate"),tt=t((e)=>e.name?String(e.name):"","getItemName"),Re={parser:{yy:void 0},parse:t(async(e)=>{try{let n=await Te("treemap",e);l.debug("Treemap AST:",n);let o=Re.parser?.yy;if(!(o instanceof Be))throw Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");et(n,o)}catch(r){throw l.error("Error parsing treemap:",r),r}},"parse")},at=10,ee=10,le=25,rt=t((e,r,n,o)=>{let s=o.db,p=s.getConfig(),u=p.padding??at,f=s.getDiagramTitle(),S=s.getRoot(),{themeVariables:d}=E();if(!S)return;let m=f?30:0,T=de(r),i=p.nodeWidth?p.nodeWidth*ee:960,C=p.nodeHeight?p.nodeHeight*ee:500,b=i,w=C+m;T.attr("viewBox",`0 0 ${b} ${w}`),te(T,w,b,p.useMaxWidth);let g;try{let a=p.valueFormat||",";if(a==="$0,0")g=t((c)=>"$"+Ka(",")(c),"valueFormat");else if(a.startsWith("$")&&a.includes(",")){let c=/\.\d+/.exec(a),y=c?c[0]:"";g=t((A)=>"$"+Ka(","+y)(A),"valueFormat")}else if(a.startsWith("$")){let c=a.substring(1);g=t((y)=>"$"+Ka(c||"")(y),"valueFormat")}else g=Ka(a)}catch(a){l.error("Error creating format function:",a),g=Ka(",")}let v=On().range(["transparent",d.cScale0,d.cScale1,d.cScale2,d.cScale3,d.cScale4,d.cScale5,d.cScale6,d.cScale7,d.cScale8,d.cScale9,d.cScale10,d.cScale11]),P=On().range(["transparent",d.cScalePeer0,d.cScalePeer1,d.cScalePeer2,d.cScalePeer3,d.cScalePeer4,d.cScalePeer5,d.cScalePeer6,d.cScalePeer7,d.cScalePeer8,d.cScalePeer9,d.cScalePeer10,d.cScalePeer11]),D=On().range([d.cScaleLabel0,d.cScaleLabel1,d.cScaleLabel2,d.cScaleLabel3,d.cScaleLabel4,d.cScaleLabel5,d.cScaleLabel6,d.cScaleLabel7,d.cScaleLabel8,d.cScaleLabel9,d.cScaleLabel10,d.cScaleLabel11]);if(f)T.append("text").attr("x",b/2).attr("y",m/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(f);let X=T.append("g").attr("transform",`translate(0, ${m})`).attr("class","treemapContainer"),ae=J(S).sum((a)=>a.value??0).sort((a,c)=>(c.value??0)-(a.value??0)),Me=ce().size([i,C]).paddingTop((a)=>a.children&&a.children.length>0?le+ee:0).paddingInner(u).paddingLeft((a)=>a.children&&a.children.length>0?ee:0).paddingRight((a)=>a.children&&a.children.length>0?ee:0).paddingBottom((a)=>a.children&&a.children.length>0?ee:0).round(!0)(ae),We=Me.descendants().filter((a)=>a.children&&a.children.length>0),re=X.selectAll(".treemapSection").data(We).enter().append("g").attr("class","treemapSection").attr("transform",(a)=>`translate(${a.x0},${a.y0})`);if(re.append("rect").attr("width",(a)=>a.x1-a.x0).attr("height",le).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",0.6).attr("stroke-width",0.6).attr("style",(a)=>{if(a.depth===0)return"display: none;";return""}),re.append("clipPath").attr("id",(a,c)=>`clip-section-${r}-${c}`).append("rect").attr("width",(a)=>Math.max(0,a.x1-a.x0-12)).attr("height",le),re.append("rect").attr("width",(a)=>a.x1-a.x0).attr("height",(a)=>a.y1-a.y0).attr("class",(a,c)=>`treemapSection section${c}`).attr("fill",(a)=>v(a.data.name)).attr("fill-opacity",0.6).attr("stroke",(a)=>P(a.data.name)).attr("stroke-width",2).attr("stroke-opacity",0.4).attr("style",(a)=>{if(a.depth===0)return"display: none;";let c=N({cssCompiledStyles:a.data.cssCompiledStyles});return c.nodeStyles+";"+c.borderStyles.join(";")}),re.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",le/2).attr("dominant-baseline","middle").text((a)=>a.depth===0?"":a.data.name).attr("font-weight","bold").attr("clip-path",(a,c)=>`url(#clip-section-${r}-${c})`).attr("style",(a)=>{if(a.depth===0)return"display: none;";let c="dominant-baseline: middle; font-size: 12px; fill:"+D(a.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",y=N({cssCompiledStyles:a.data.cssCompiledStyles});return c+y.labelStyles.replace("color:","fill:")}).each(function(a){if(a.depth===0)return;let c=h(this),y=a.data.name;c.text(y);let A=a.x1-a.x0,k=6,F;if(p.showValues!==!1&&a.value){let _=A-10,I=30,Oe=10;F=_-30-10-k}else F=A-k-6;let x=Math.max(15,F),H=c.node();if(H.getComputedTextLength()>x){let I=y;while(I.length>0){if(I=y.substring(0,I.length-1),I.length===0){if(c.text("..."),H.getComputedTextLength()>x)c.text("");break}if(c.text(I+"..."),H.getComputedTextLength()<=x)break}}}),p.showValues!==!1)re.append("text").attr("class","treemapSectionValue").attr("x",(a)=>a.x1-a.x0-10).attr("y",le/2).attr("text-anchor","end").attr("dominant-baseline","middle").text((a)=>a.value?g(a.value):"").attr("font-style","italic").attr("style",(a)=>{if(a.depth===0)return"display: none;";let c="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+D(a.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",y=N({cssCompiledStyles:a.data.cssCompiledStyles});return c+y.labelStyles.replace("color:","fill:")});let _e=Me.leaves(),V=_e.length>20,He=V?16:38,se=V?14:28,Y=V?4:8,Z=V?4:6,pe=V?2:4,ze=V?8:10,ue=V?1:2,ie=X.selectAll(".treemapLeafGroup").data(_e).enter().append("g").attr("class",(a,c)=>`treemapNode treemapLeafGroup leaf${c}${a.data.classSelector?` ${a.data.classSelector}`:""}x`).attr("transform",(a)=>`translate(${a.x0},${a.y0})`);if(ie.append("rect").attr("width",(a)=>a.x1-a.x0).attr("height",(a)=>a.y1-a.y0).attr("class","treemapLeaf").attr("fill",(a)=>a.parent?v(a.parent.data.name):v(a.data.name)).attr("style",(a)=>N({cssCompiledStyles:a.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",0.3).attr("stroke",(a)=>a.parent?v(a.parent.data.name):v(a.data.name)).attr("stroke-width",3),ie.append("clipPath").attr("id",(a,c)=>`clip-${r}-${c}`).append("rect").attr("width",(a)=>Math.max(0,a.x1-a.x0-4)).attr("height",(a)=>Math.max(0,a.y1-a.y0-4)),ie.append("text").attr("class","treemapLabel").attr("x",(a)=>(a.x1-a.x0)/2).attr("y",(a)=>(a.y1-a.y0)/2).attr("style",(a)=>{let c=`text-anchor: middle; dominant-baseline: middle; font-size: ${He}px;fill:`+D(a.data.name)+";",y=N({cssCompiledStyles:a.data.cssCompiledStyles});return c+y.labelStyles.replace("color:","fill:")}).attr("clip-path",(a,c)=>`url(#clip-${r}-${c})`).text((a)=>a.data.name).each(function(a){let c=h(this),y=a.x1-a.x0,A=a.y1-a.y0,k=c.node(),F=y-2*pe,W=A-2*pe;if(F<ze||W<ze){c.style("display","none");return}let x=parseInt(c.style("font-size"),10),H=0.6;while(k.getComputedTextLength()>F&&x>Y)x--,c.style("font-size",`${x}px`);let M=Math.max(Z,Math.min(se,Math.round(x*H))),_=x+ue+M;while(_>W&&x>Y){if(x--,M=Math.max(Z,Math.min(se,Math.round(x*H))),M<Z&&x===Y)break;if(c.style("font-size",`${x}px`),_=x+ue+M,M<=Z&&_>W);}if(c.style("font-size",`${x}px`),V){if(x<Y||W<Y)c.style("display","none")}else if(k.getComputedTextLength()>F||x<Y||W<x)c.style("display","none")}),p.showValues!==!1)ie.append("text").attr("class","treemapValue").attr("x",(c)=>(c.x1-c.x0)/2).attr("y",function(c){return(c.y1-c.y0)/2}).attr("style",(c)=>{let y=`text-anchor: middle; dominant-baseline: hanging; font-size: ${se}px;fill:`+D(c.data.name)+";",A=N({cssCompiledStyles:c.data.cssCompiledStyles});return y+A.labelStyles.replace("color:","fill:")}).attr("clip-path",(c,y)=>`url(#clip-${r}-${y})`).text((c)=>c.value?g(c.value):"").each(function(c){let y=h(this),A=this.parentNode;if(!A){y.style("display","none");return}let k=h(A).select(".treemapLabel");if(k.empty()||k.style("display")==="none"){y.style("display","none");return}let F=parseFloat(k.style("font-size")),x=Math.max(Z,Math.min(se,Math.round(F*0.6)));y.style("font-size",`${x}px`);let M=(c.y1-c.y0)/2+F/2+ue;y.attr("y",M);let _=c.x1-c.x0,De=c.y1-c.y0-4,qe=_-2*pe;if(y.node().getComputedTextLength()>qe||M+x>De||x<Z)y.style("display","none");else y.style("display",null)});let Ie=p.diagramPadding??8;lt(T,Ie,"flowchart",p?.useMaxWidth||!1)},"draw"),nt=t(function(e,r){return r.db.getClasses()},"getClasses"),ot={draw:rt,getClasses:nt},st={sectionStrokeColor:"black",sectionStrokeWidth:"1",sectionFillColor:"#efefef",leafStrokeColor:"black",leafStrokeWidth:"1",leafFillColor:"#efefef",labelFontSize:"12px",valueFontSize:"10px",titleFontSize:"14px"},it=t(({treemap:e}={})=>{let r=Mt(),n=E(),o=oe(r,n.themeVariables),s=oe(st,e),p=s.titleColor??o.titleColor,u=s.labelColor??o.textColor,f=s.valueColor??o.textColor;return`
|
|
2
2
|
.treemapNode.section {
|
|
3
3
|
stroke: ${s.sectionStrokeColor};
|
|
4
4
|
stroke-width: ${s.sectionStrokeWidth};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{be}from"./index-
|
|
2
|
-
`)+2),o=o.substring(0,o.lastIndexOf("}")-1),o=X(o,r),o=Do(o,n.textMaxWidth,d),o=o.replaceAll(" "," "),o+="<br/>"}let u=o!==void 0;if(u)m+=`<br/><br/><code style="text-align: left; display: block;max-width:${n.textMaxWidth}px">${o}</code>`;let f={fontSize:d.fontSize,fontWeight:d.fontWeight,fontFamily:d.fontFamily},x=xu(m,f),b=u?x.width/3:x.width,g={content:m,width:b,height:x.height};return l.debug(`[${e.name}] ${e.entityIdentifier} text`,g),g}t(Q,"calculateTextProps");function Z(e,i){let n=i,r=J(n.frame),a={width:n.textProps.width+2*s.boxTextPadding,height:n.textProps.height+2*s.boxTextPadding};return[{$kind:
|
|
3
|
-
`,"id:",i,n),!Fe)throw Error("EventModeling config not found");let a=r.db,{themeVariables:o,eventmodeling:d}=p(),c=h(`[id="${i}"]`),m=a.getDiagramProps(),u=a.getState(),f=`em-arrowhead-${i}`,x=o.emArrowhead??"#000000";u.sortedSwimlanesArray.forEach(fe(c,u.maxR,m,o)),u.boxes.forEach(me(c,m)),u.relations.forEach(xe(c,m,f,o)),c.append("defs").append("marker").attr("id",f).attr("markerWidth","10").attr("markerHeight","7").attr("refX","10").attr("refY","3.5").attr("orient","auto").append("polygon").attr("points","0 0, 10 3.5, 0 7").attr("fill",x),Sl(void 0,c,d?.padding??30,d?.useMaxWidth)},"draw"),Ee={draw:Be},Ae=t((e)=>"","getStyles"),Re=Ae,Ue={parser:Me,db:
|
|
1
|
+
import{be}from"./index-52rqxgya.js";import{t,l,K,E,X,R,L,z,O,U,j,G,p,Sl,h,Do,xu,oe}from"./index-fta1y9pc.js";import{uu,Te}from"./index-j51d5a5m.js";var D="position frame",N="frame positioned",S="position relation",C="relation positioned",ge=t(function(e){l.debug("options str",e)},"setOptions"),he=t(function(){return{}},"getOptions"),pe=t(function(){I(),R()},"clear");function I(){F={}}t(I,"reset");var ve=K.eventmodeling,we=t(()=>oe({...ve,...E().eventmodeling}),"getConfig"),F={};function W(){let e=ye,{ast:i}=F,n=B();if(!i)throw Error("No data for EventModel");return i.frames.forEach((r,a)=>{let o=Q(r,i.dataEntities,n);e=y(e,{$kind:D,index:a,frame:r,textProps:o});let d=void 0;if(re(r))l.debug("source frame",r.sourceFrames),d=i.frames.filter((c)=>r.sourceFrames.some((m)=>m.$refText===c.name)),d.forEach((c)=>{e=y(e,{$kind:S,index:a,frame:r,sourceFrame:c})});else e=y(e,{$kind:S,index:a,frame:r})}),e={...e,sortedSwimlanesArray:A(e.swimlanes)},e}t(W,"getState");function H(e){F.ast=e}t(H,"setAst");var s={swimlaneMinHeight:70,swimlanePadding:15,swimlaneGap:10,boxPadding:10,boxOverlap:90,boxDefaultY:0,boxMinWidth:80,boxMaxWidth:450,boxMinHeight:80,boxMaxHeight:750,contentStartX:250,textMaxWidth:430,boxTextFontWeight:"bold",boxTextPadding:10,swimlaneTextFontWeight:"bold",labelUiAutomation:"UI/Automation",labelUiAutomationPrefix:"UI/A: ",labelCommandReadModel:"Command/Read Model",labelCommandReadModelPrefix:"C/RM: ",labelEvents:"Events",labelEventsPrefix:"Stream: "};function B(){return s}t(B,"getDiagramProps");var ye={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function _(e){let i=e.split(".");if(i.length===2)return i[0];return}t(_,"extractNamespace");function V(e){let i=e.split(".");if(i.length===2)return i[1];return e}t(V,"extractName");function Y(e,i){if(!i||i.length===0)return;return Object.values(e).find((n)=>n.namespace===i)}t(Y,"findSwimlaneByNamespace");function w(e,i,n){return Math.max(i,...Object.keys(e).filter((r)=>{let a=Number.parseInt(r);return a>i&&a<n}).map((r)=>Number.parseInt(r)))+1}t(w,"findNextAvailableIndex");function q(e,i){let n=_(e.entityIdentifier),r=Y(i,n);switch(e.modelEntityType){case"ui":case"pcr":case"processor":if(r)return{index:r.index,label:r.namespace||s.labelUiAutomation};else if(n)return{index:w(i,0,100),label:s.labelUiAutomationPrefix+n};return{index:0,label:s.labelUiAutomation};case"rmo":case"readmodel":case"cmd":case"command":if(r)return{index:r.index,label:r.namespace||s.labelCommandReadModel};else if(n)return{index:w(i,100,200),label:s.labelCommandReadModelPrefix+n};return{index:100,label:s.labelCommandReadModel};case"evt":case"event":default:if(r)return{index:r.index,label:r.namespace||s.labelEvents};else if(n)return{index:w(i,200,300),label:s.labelEventsPrefix+n};return{index:200,label:s.labelEvents}}}t(q,"calculateSwimlaneProps");function J(e){let{themeVariables:i}=E();switch(e.modelEntityType){case"ui":return{fill:i.emUiFill??"white",stroke:i.emUiStroke??"#dbdada"};case"pcr":case"processor":return{fill:i.emProcessorFill??"#edb3f6",stroke:i.emProcessorStroke??"#b88cbf"};case"rmo":case"readmodel":return{fill:i.emReadModelFill??"#d3f1a2",stroke:i.emReadModelStroke??"#a3b732"};case"cmd":case"command":return{fill:i.emCommandFill??"#bcd6fe",stroke:i.emCommandStroke??"#679ac3"};case"evt":case"event":return{fill:i.emEventFill??"#ffb778",stroke:i.emEventStroke??"#c19a0f"};default:return{fill:"red",stroke:"black"}}}t(J,"calculateEntityVisualProps");function Q(e,i,n){let r=E(),a=X(V(e.entityIdentifier)??"",r),o,d={fontSize:16,fontWeight:700,fontFamily:'"trebuchet ms", verdana, arial, sans-serif',joinWith:"<br/>"},m=`<b>${Do(a,n.textMaxWidth,d)}</b>`;if(e.dataInlineValue)o=e.dataInlineValue,o=o.substring(o.indexOf("{")+1),o=o.substring(0,o.lastIndexOf("}")-1),o=X(o,r),o=Do(o,n.textMaxWidth,d),o=o.replaceAll(" "," ");if(e.dataReference){let v=i.find((P)=>P.name===e.dataReference?.$refText);if(v)o=v.dataBlockValue,o=o.substring(o.indexOf(`{
|
|
2
|
+
`)+2),o=o.substring(0,o.lastIndexOf("}")-1),o=X(o,r),o=Do(o,n.textMaxWidth,d),o=o.replaceAll(" "," "),o+="<br/>"}let u=o!==void 0;if(u)m+=`<br/><br/><code style="text-align: left; display: block;max-width:${n.textMaxWidth}px">${o}</code>`;let f={fontSize:d.fontSize,fontWeight:d.fontWeight,fontFamily:d.fontFamily},x=xu(m,f),b=u?x.width/3:x.width,g={content:m,width:b,height:x.height};return l.debug(`[${e.name}] ${e.entityIdentifier} text`,g),g}t(Q,"calculateTextProps");function Z(e,i){let n=i,r=J(n.frame),a={width:n.textProps.width+2*s.boxTextPadding,height:n.textProps.height+2*s.boxTextPadding};return[{$kind:N,frame:n.frame,index:n.index,visual:r,dimension:a,textProps:n.textProps}]}t(Z,"decidePositionFrame");function ee(e,i,n){if(i===void 0)return s.contentStartX;if(i.index===e.index&&e.r)return e.r+s.boxPadding;if(n===void 0)return s.contentStartX;return n.r-s.boxOverlap+s.boxPadding}t(ee,"calculateX");function te(e,i){let n=[...e.map((r)=>r.r),i];return Math.max(...n)}t(te,"calculateMaxRight");function A(e){return Object.values(e).sort((i,n)=>i.index-n.index)}t(A,"sortedSwimlanesArray");function ne(e,i){let n=i,r=q(n.frame,e.swimlanes),a;if(r.index in e.swimlanes)a=e.swimlanes[r.index];else a={index:r.index,label:r.label,r:0,y:r.index*s.swimlaneMinHeight+s.swimlaneGap,height:s.swimlaneMinHeight,maxHeight:s.swimlaneMinHeight};let o=e.boxes.length>0?e.boxes[e.boxes.length-1]:void 0,d=e.previousSwimlaneNumber!==void 0?e.swimlanes[e.previousSwimlaneNumber]:void 0,c={width:Math.max(s.boxMinWidth,Math.min(s.boxMaxWidth,n.dimension.width))+2*s.boxPadding,height:Math.max(s.boxMinHeight,Math.min(s.boxMaxHeight,n.dimension.height))+2*s.boxPadding},m=ee(a,d,o),u=m+c.width+s.boxPadding,f=te(Object.values(e.swimlanes),u);a.r=m+c.width,a.maxHeight=Math.max(a.maxHeight,c.height),a.height=Math.max(s.swimlaneMinHeight,a.maxHeight)+2*s.swimlanePadding;let x={x:m,y:s.swimlanePadding+a.y,r:u,dimension:c,leftSibling:!1,swimlane:a,visual:n.visual,text:n.textProps.content,frame:n.frame,index:n.index},b={...e,boxes:[...e.boxes,x],swimlanes:{...e.swimlanes,[`${a.index}`]:a},previousSwimlaneNumber:r.index,previousFrame:n.frame,maxR:f},g=A(b.swimlanes);if(g.length>0)g[0].y=0;for(let v=1;v<g.length;v++){let P=g[v],T=g[v-1];P.y=T.y+T.height+s.swimlaneGap}return b}t(ne,"evolveFramePositioned");function ie(e,i){if(e===0&&i.sourceFrames.length===0)return!0;return!1}t(ie,"isFirstFrame");function re(e){return e.sourceFrames!==void 0&&e.sourceFrames!==null&&e.sourceFrames.length>0}t(re,"hasSourceFrame");function M(e,i){if(i===void 0||i===null)return;return e.find((n)=>n.frame.name===i.name)}t(M,"findBoxByFrame");function ae(e,i,n){if(n<0)return;for(let r=n;r>=0;r--){let a=e[r];if(a.swimlane.index!==i)return a}return}t(ae,"findBoxByLineIndex");function se(e,i){let n=i;if(uu(n.frame)||ie(n.index,n.frame))return[];let r=M(e.boxes,n.frame);if(r===void 0)throw Error(`Target box not found for frame ${n.frame.name}`);let a;if(n.sourceFrame)a=M(e.boxes,n.sourceFrame);else a=ae(e.boxes,r.swimlane.index,n.index-1);if(a===void 0)return[];return[{$kind:C,frame:n.frame,index:n.index,sourceBox:a,targetBox:r}]}t(se,"decidePositionRelation");function de(e,i){let n=i,r={visual:{fill:"none",stroke:"#000"},source:{x:n.sourceBox.x,y:n.sourceBox.y},target:{x:n.targetBox.x,y:n.targetBox.y},sourceBox:n.sourceBox,targetBox:n.targetBox};return{...e,relations:[...e.relations,r]}}t(de,"evolveRelationPositioned");var Pe={[D]:Z,[S]:se},Se={[N]:ne,[C]:de};function le(e,i){let n=Pe[i.$kind];if(n===void 0||n===null)return[];let r=n(e,i);return l.debug("decided events",r),r}t(le,"decide");function ce(e,i){let n=i.reduce((r,a)=>{let o=Se[a.$kind];if(o===void 0||o===null)return r;return o(r,a)},e);return l.debug("evolve events",{state:e,newState:n,events:i}),n}t(ce,"evolve");function y(e,i){let n=le(e,i);return ce(e,n)}t(y,"dispatch");var k={getConfig:we,setOptions:ge,getOptions:he,clear:pe,setAccTitle:L,getAccTitle:z,getAccDescription:U,setAccDescription:O,setDiagramTitle:j,getDiagramTitle:G,setAst:H,getDiagramProps:B,getState:W},Me={parse:t(async(e)=>{let i=await Te("eventmodeling",e);l.debug(i),k.setAst(i),be(i,k)},"parse")},ke=p(),Fe=ke?.eventmodeling;function me(e,i){return(n)=>{let r=n.swimlane.y+i.swimlanePadding,a=e.append("g").attr("class","em-box");a.append("rect").attr("x",n.x).attr("y",r).attr("rx","3").attr("width",n.dimension.width).attr("height",n.dimension.height).attr("stroke",n.visual.stroke).attr("fill",n.visual.fill),a.append("foreignObject").attr("x",n.x+i.boxPadding).attr("y",r+10).attr("width",n.dimension.width-2*i.boxPadding).attr("height",n.dimension.height-2*i.boxPadding).append("xhtml:div").style("display","table").style("height","100%").style("width","100%").append("span").style("display","table-cell").style("text-align","center").style("vertical-align","middle").html(n.text)}}t(me,"renderD3Box");function ue(e,i){return e>i}t(ue,"dirUpwards");function xe(e,i,n,r){return(a)=>{let o=a.sourceBox.swimlane.y+i.swimlanePadding,d=a.targetBox.swimlane.y+i.swimlanePadding,c=ue(o,d),m=a.sourceBox.x+a.sourceBox.dimension.width*2/3,u=a.targetBox.x+a.targetBox.dimension.width/3,f,x;if(l.debug(`rendering relation up=${c} for `,{sourceBox:a.sourceBox,targetBox:a.targetBox}),c)f=o,x=d+a.targetBox.dimension.height;else f=o+a.sourceBox.dimension.height,x=d;let b=r.emRelationStroke??a.visual.stroke;e.append("path").attr("class","em-relation").attr("fill",a.visual.fill).attr("stroke",b).attr("stroke-width","1").attr("marker-end",`url(#${n})`).attr("d",`M${m} ${f} L${u} ${x}`)}}t(xe,"renderD3Relation");function fe(e,i,n,r){return(a)=>{let o=e.append("g").attr("class","em-swimlane"),d=r.emSwimlaneBackgroundOdd??"rgb(250,250,250)",c=r.emSwimlaneBackgroundStroke??"rgb(240,240,240)";o.append("rect").attr("x",0).attr("y",a.y).attr("rx","3").attr("width",i+n.swimlanePadding).attr("height",a.height).attr("fill",d).attr("stroke",c),o.append("text").attr("font-weight",n.swimlaneTextFontWeight).attr("x",30).attr("y",a.y+30).text(a.label)}}t(fe,"renderD3Swimlane");var Be=t(function(e,i,n,r){if(l.debug("in eventmodeling renderer",e+`
|
|
3
|
+
`,"id:",i,n),!Fe)throw Error("EventModeling config not found");let a=r.db,{themeVariables:o,eventmodeling:d}=p(),c=h(`[id="${i}"]`),m=a.getDiagramProps(),u=a.getState(),f=`em-arrowhead-${i}`,x=o.emArrowhead??"#000000";u.sortedSwimlanesArray.forEach(fe(c,u.maxR,m,o)),u.boxes.forEach(me(c,m)),u.relations.forEach(xe(c,m,f,o)),c.append("defs").append("marker").attr("id",f).attr("markerWidth","10").attr("markerHeight","7").attr("refX","10").attr("refY","3.5").attr("orient","auto").append("polygon").attr("points","0 0, 10 3.5, 0 7").attr("fill",x),Sl(void 0,c,d?.padding??30,d?.useMaxWidth)},"draw"),Ee={draw:Be},Ae=t((e)=>"","getStyles"),Re=Ae,Ue={parser:Me,db:k,renderer:Ee,styles:Re};export{Ue as diagram};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{Ao}from"./index-
|
|
2
|
-
`),e=new Map,i=-1;for(let[g,d]of r.entries())if(d.trim()==="treeView-beta"){i=g;break}if(i===-1)return{text:n,lineMap:e};let a=[];for(let g=i+1;g<r.length;g++){let d=r[g];if(d.trim()===""||N.test(d)||k.test(d))continue;if(V.test(d))continue;a.push(d.replace(/\t/g," "))}if(!M(a))return{text:n,lineMap:e};let o=S(a),s=[],c=0;for(let g=0;g<=i;g++)s.push(r[g]),c++,e.set(c,g+1);for(let g=i+1;g<r.length;g++){let d=r[g],p=d.trim(),f=g+1;if(p===""){s.push(d),c++,e.set(c,f);continue}if(N.test(d)){s.push(d),c++,e.set(c,f);continue}if(k.test(d)){s.push(d),c++,e.set(c,f);continue}if(V.test(d))continue;let h=d.replace(/\t/g," "),w=_.exec(h);if(w?.index!==void 0){let u=w.index,x=Math.round(u/o)+1,m=u+1;while(m<h.length&&
|
|
3
|
-
`),lineMap:e}}t(W,"preprocessBoxDrawing");var v=new Ao(()=>({cnt:1,stack:[{id:0,level:-1,name:"/",nodeType:"directory",children:[]}]})),
|
|
4
|
-
`+n);let a=i.db,o=a.getRoot(),s=a.getConfig(),c=
|
|
1
|
+
import{Ao}from"./index-eyfcm0cy.js";import{be}from"./index-52rqxgya.js";import{t,l,K,E,X,te,R,L,z,O,U,j,G,de,So,ar,oe}from"./index-fta1y9pc.js";import{Te}from"./index-j51d5a5m.js";var D=/[─━│┃└┗├┣]/,_=/[└┗├┣]/,F=/[─━]/,V=/^[\s│┃]+$/,k=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,N=/^\s*%%/,Z=" ";function M(n){return n.some((r)=>D.test(r))}t(M,"isBoxDrawingFormat");function S(n){for(let r of n){let e=_.exec(r);if(e?.index&&e.index>0)return e.index}return 4}t(S,"inferSegmentWidth");function H(n,r){return n.replace(/\bline\s+(\d+)\b/gi,(e,i)=>{let a=parseInt(i,10),o=r.get(a);return o?`line ${o}`:e})}t(H,"remapErrorLines");function W(n){let r=n.split(`
|
|
2
|
+
`),e=new Map,i=-1;for(let[g,d]of r.entries())if(d.trim()==="treeView-beta"){i=g;break}if(i===-1)return{text:n,lineMap:e};let a=[];for(let g=i+1;g<r.length;g++){let d=r[g];if(d.trim()===""||N.test(d)||k.test(d))continue;if(V.test(d))continue;a.push(d.replace(/\t/g," "))}if(!M(a))return{text:n,lineMap:e};let o=S(a),s=[],c=0;for(let g=0;g<=i;g++)s.push(r[g]),c++,e.set(c,g+1);for(let g=i+1;g<r.length;g++){let d=r[g],p=d.trim(),f=g+1;if(p===""){s.push(d),c++,e.set(c,f);continue}if(N.test(d)){s.push(d),c++,e.set(c,f);continue}if(k.test(d)){s.push(d),c++,e.set(c,f);continue}if(V.test(d))continue;let h=d.replace(/\t/g," "),w=_.exec(h);if(w?.index!==void 0){let u=w.index,x=Math.round(u/o)+1,m=u+1;while(m<h.length&&F.test(h[m]))m++;while(m<h.length&&h[m]===" ")m++;let b=h.slice(m).trimEnd();if(!b)throw Error(`Line ${f}: Empty node — expected a filename or directory name after the box-drawing prefix`);let P=Z.repeat(x);s.push(P+b),c++,e.set(c,f)}else if(/^[\s─━│┃└┗├┣]+$/.test(h))continue;else if(D.test(h))s.push(d),c++,e.set(c,f);else if(/^\s+/.test(h))throw Error(`Line ${f}: Unexpected indentation without box-drawing characters. In box-drawing format, use ├── or └── prefixes for indented nodes.`);else s.push(d),c++,e.set(c,f)}return{text:s.join(`
|
|
3
|
+
`),lineMap:e}}t(W,"preprocessBoxDrawing");var v=new Ao(()=>({cnt:1,stack:[{id:0,level:-1,name:"/",nodeType:"directory",children:[]}]})),q=t(()=>{v.reset(),R()},"clear"),J=t(()=>v.records.stack[0],"getRoot"),Q=t(()=>v.records.cnt,"getCount"),ee=K.treeView,re=t(()=>oe(ee,E().treeView),"getConfig"),ne=t((n,r,e,i,a,o)=>{while(n<=v.records.stack[v.records.stack.length-1].level)v.records.stack.pop();let s={id:v.records.cnt++,level:n,name:r,nodeType:e,icon:a,cssClass:i,description:o,children:[]};v.records.stack[v.records.stack.length-1].children.push(s),v.records.stack.push(s)},"addNode"),ie={clear:q,addNode:ne,getRoot:J,getCount:Q,getConfig:re,getAccTitle:z,getAccDescription:U,getDiagramTitle:G,setAccDescription:O,setAccTitle:L,setDiagramTitle:j},I=ie,se=t((n)=>{be(n,I);for(let r of n.nodes){let e=typeof r.indent==="number"?r.indent:0,i=r.name,a=i.endsWith("/");if(a)i=i.slice(0,-1);let o=a?"directory":"file",s=r.classAnnotation||void 0,c=r.iconAnnotation,g=c!==void 0?c||"none":void 0,d=r.descAnnotation||void 0,p=d?X(d,E()):void 0;I.addNode(e,i,o,s,g,p)}},"populate"),ae={parse:t(async(n)=>{let{text:r,lineMap:e}=W(n);try{let i=await Te("treeView",r);l.debug(i),se(i)}catch(i){if(e.size>0&&i instanceof Error)i.message=H(i.message,e);throw i}},"parse")},C={prefix:"mermaid-treeview",height:24,width:24,icons:{folder:{body:'<path fill="currentColor" d="M10.59 4.59A2 2 0 0 0 9.17 4H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.17z"/>'},file:{body:'<path fill="currentColor" fill-rule="evenodd" d="M6 2a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8.83a2 2 0 0 0-.59-1.42l-4.82-4.82A2 2 0 0 0 13.17 2H6Zm7.5 1.9l4.6 4.6h-3.6a1 1 0 0 1-1-1V3.9Z" clip-rule="evenodd"/>'}}};function Y(n,r){let e=r?.filenameIcons?.[n];if(e)return e;let i=n.lastIndexOf(".");if(i>0){let a=n.substring(i).toLowerCase(),o=r?.extensionIcons;return o?.[a]??o?.[a.slice(1)]}return}t(Y,"detectIcon");function y(n,r){if(n.includes(":"))return n;if(n in C.icons||!r)return`${C.prefix}:${n}`;return`${r}:${n}`}t(y,"qualifyIcon");function T(n,r){if(n.icon==="none")return;if(n.icon)return y(n.icon,r.defaultIconPack);if(!r.showIcons)return;if(n.nodeType==="file"){let e=Y(n.name,r);if(e==="none")return;if(e)return y(e,r.defaultIconPack)}return`${C.prefix}:${n.nodeType==="directory"?"folder":"file"}`}t(T,"getNodeIcon");So([{name:C.prefix,icons:C}]);var B=14,ce=4,le=16,he=t(async(n,r)=>{let e=[],i=t((o)=>{let s=T(o,r);if(s)e.push({icon:s,node:o});o.children.forEach(i)},"collect");i(n);let a=await Promise.all(e.map(async({icon:o,node:s})=>({id:s.id,svg:await ar(o,{height:B,width:B})})));return new Map(a.map(({id:o,svg:s})=>[o,s]))},"resolveNodeIcons"),pe=t((n,r,e,i,a,o)=>{let s=i.append("g"),c="treeView-node-label";if(e.nodeType==="directory")c+=" treeView-node-dir";if(e.cssClass)c+=` ${e.cssClass}`;let g=B+ce,d=T(e,a),p=d!==void 0;if(d)s.append("g").attr("class","treeView-node-icon").attr("transform",`translate(${n+a.paddingX}, ${r+a.paddingY})`).html(o.get(e.id)??"");let f=s.append("text").text(e.name).attr("dominant-baseline","middle").attr("class",c),{height:h,width:w}=f.node().getBBox(),u=h+a.paddingY*2,x=n+a.paddingX+(p?g:0);f.attr("x",x),f.attr("y",r+u/2);let m=x+w,b=w+a.paddingX*2+(p?g:0);if(e.BBox={x:n,y:r,width:b,height:u},e.cssClass?.split(/\s+/).includes("highlight"))s.insert("rect",":first-child").attr("x",n).attr("y",r+1).attr("width",0).attr("height",u-2).attr("rx",3).attr("class","treeView-highlight-bg");return{node:e,nodeGroup:s,labelRightEdge:m,centerY:r+u/2}},"positionLabel"),A=t((n,r,e,i,a,o)=>n.append("line").attr("x1",r).attr("y1",e).attr("x2",i).attr("y2",a).attr("stroke-width",o).attr("class","treeView-node-line"),"positionLine"),fe=t((n,r,e,i)=>{let a=0,o=0,s=[],c=t((p,f,h,w)=>{let u=w*(h.rowIndent+h.paddingX),x=pe(u,a,f,p,h,i);s.push(x);let{height:m,width:b}=f.BBox;A(p,u-h.rowIndent,a+m/2,u,a+m/2,h.lineThickness),o=Math.max(o,u+b),a+=m},"drawNode"),g=t((p,f=0)=>{c(n,p,e,f),p.children.forEach((x)=>{g(x,f+1)});let{x:h,y:w,height:u}=p.BBox;if(p.children.length){let{y:x,height:m}=p.children[p.children.length-1].BBox;A(n,h+e.paddingX,w+u,h+e.paddingX,x+m/2+e.lineThickness/2,e.lineThickness)}},"processNode");g(r);let d=s.filter((p)=>p.node.description);if(d.length>0){let f=Math.max(...s.map((h)=>h.labelRightEdge))+le;for(let h of d){let u=h.nodeGroup.append("text").text(h.node.description).attr("dominant-baseline","middle").attr("class","treeView-node-description").attr("x",f).attr("y",h.centerY).node().getBBox();o=Math.max(o,f+u.width+e.paddingX)}}for(let p of s)if(p.node.cssClass?.split(/\s+/).includes("highlight")){let f=p.nodeGroup.select(".treeView-highlight-bg");if(!f.empty()){let h=o-p.node.BBox.x+8;f.attr("width",h),o=Math.max(o,p.node.BBox.x+h+2)}}return{totalHeight:a,totalWidth:o}},"drawTree"),ge=t(async(n,r,e,i)=>{l.debug(`Rendering treeView diagram
|
|
4
|
+
`+n);let a=i.db,o=a.getRoot(),s=a.getConfig(),c=de(r),g=c.append("g");g.attr("class","tree-view");let d=await he(o,s),{totalHeight:p,totalWidth:f}=fe(g,o,s,d);c.attr("viewBox",`-${s.lineThickness/2} 0 ${f} ${p}`),te(c,p,f,s.useMaxWidth)},"draw"),ue={draw:ge},me=ue,we={labelFontSize:"16px",labelColor:"black",lineColor:"black",iconColor:"#546e7a",descriptionColor:"#6a9955",highlightBg:"rgba(255, 193, 7, 0.15)",highlightStroke:"#ffc107"},xe=t(({treeView:n})=>{let{labelFontSize:r,labelColor:e,lineColor:i,iconColor:a,descriptionColor:o,highlightBg:s,highlightStroke:c}=oe(we,n);return`
|
|
5
5
|
.treeView-node-label {
|
|
6
6
|
font-size: ${r};
|
|
7
7
|
fill: ${e};
|