@celljs/ta 4.9.1 → 4.10.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/cli.mjs +69 -15
- package/dist/gateway.mjs +144 -20
- package/dist/pi/CHANGELOG.md +7 -0
- package/dist/pi/dist/bundle/chunks/anthropic-messages-CA3HHOL3.js +6 -0
- package/dist/pi/dist/bundle/chunks/{azure-openai-responses-FSC6BAW3.js → azure-openai-responses-76TWS6DT.js} +1 -1
- package/dist/pi/dist/bundle/chunks/bedrock-converse-stream.js +3 -3
- package/dist/pi/dist/bundle/chunks/chunk-4KSTFUIK.js +19 -0
- package/dist/pi/dist/bundle/chunks/chunk-4UNPP53I.js +55 -0
- package/dist/pi/dist/bundle/chunks/chunk-AUUCDC7R.js +4 -0
- package/dist/pi/dist/bundle/chunks/{chunk-V6KH5QG4.js → chunk-BAC3QPNW.js} +1 -1
- package/dist/pi/dist/bundle/chunks/{chunk-4EYXVSA5.js → chunk-FF6XOTWB.js} +9 -9
- package/dist/pi/dist/bundle/chunks/chunk-FMPAMX2W.js +82 -0
- package/dist/pi/dist/bundle/chunks/chunk-GFUN2N5K.js +2 -0
- package/dist/pi/dist/bundle/chunks/chunk-IEBK4HQA.js +2 -0
- package/dist/pi/dist/bundle/chunks/{chunk-C2WU32PX.js → chunk-IQUU5XIT.js} +1 -1
- package/dist/pi/dist/bundle/chunks/{chunk-EBFHJFEE.js → chunk-LQLJ7CDW.js} +1 -1
- package/dist/pi/dist/bundle/chunks/chunk-MMDXLZVS.js +30 -0
- package/dist/pi/dist/bundle/chunks/{chunk-GN3QYODH.js → chunk-QN4TOIZN.js} +1 -1
- package/dist/pi/dist/bundle/chunks/chunk-RKNK4Y6L.js +2 -0
- package/dist/pi/dist/bundle/chunks/{chunk-B46VJEHW.js → chunk-V7SLUK6A.js} +1 -1
- package/dist/pi/dist/bundle/chunks/chunk-VEJDBY3O.js +1237 -0
- package/dist/pi/dist/bundle/chunks/chunk-VKJQ6CME.js +8 -0
- package/dist/pi/dist/bundle/chunks/{chunk-3TGLJEWK.js → chunk-WL4TUXY7.js} +1 -1
- package/dist/pi/dist/bundle/chunks/{chunk-YZKQS34S.js → chunk-Y55SJART.js} +5 -1
- package/dist/pi/dist/bundle/chunks/{chunk-EOO47QGR.js → chunk-ZBIZYD6W.js} +1 -1
- package/dist/pi/dist/bundle/chunks/chunk-ZG74NES2.js +2 -0
- package/dist/pi/dist/bundle/chunks/chunk-ZGYS4UTC.js +2 -0
- package/dist/pi/dist/bundle/chunks/{cli-MCOUW5WS.js → cli-7RHMDOHL.js} +7 -7
- package/dist/pi/dist/bundle/chunks/{cloudflare-workers-ai-system-one-WLAFJSP6.js → cloudflare-workers-ai-system-one-U4J7D646.js} +1 -1
- package/dist/pi/dist/bundle/chunks/codemode-worker.js +2 -0
- package/dist/pi/dist/bundle/chunks/{easter-egg-3d-WMBNSJ4M.js → easter-egg-3d-GEVPKQF6.js} +1 -1
- package/dist/pi/dist/bundle/chunks/{execute-4CEBORGZ.js → execute-L2EEDV3L.js} +5 -3
- package/dist/pi/dist/bundle/chunks/github-copilot.js +1 -1
- package/dist/pi/dist/bundle/chunks/{google-generative-ai-INGKNW72.js → google-generative-ai-D5B6W47J.js} +1 -1
- package/dist/pi/dist/bundle/chunks/{google-vertex-IBTX6MBF.js → google-vertex-U4H5YDEW.js} +1 -1
- package/dist/pi/dist/bundle/chunks/{llama-cpp-classify-V5U3QKXI.js → llama-cpp-classify-EJXCQRUQ.js} +1 -1
- package/dist/pi/dist/bundle/chunks/{mistral-conversations-S4OWXIXQ.js → mistral-conversations-S277EKLB.js} +1 -1
- package/dist/pi/dist/bundle/chunks/openai-codex-responses-TEQRB65N.js +10 -0
- package/dist/pi/dist/bundle/chunks/{openai-completions-EJNYB6IX.js → openai-completions-HRZOSLBO.js} +3 -3
- package/dist/pi/dist/bundle/chunks/{openai-decisions-IXI34BYG.js → openai-decisions-F66BDLOM.js} +1 -1
- package/dist/pi/dist/bundle/chunks/openai-responses-BAKFWTGE.js +4 -0
- package/dist/pi/dist/bundle/chunks/{openrouter-images-PISKSFMS.js → openrouter-images-VXF5TVIK.js} +1 -1
- package/dist/pi/dist/bundle/chunks/{pi-messages-NORUKF4E.js → pi-messages-UBJKNDRN.js} +1 -1
- package/dist/pi/dist/bundle/chunks/{runtime-FQB7RU7U.js → runtime-J5ZSBGTX.js} +1 -1
- package/dist/pi/dist/bundle/chunks/{typesafe-system-one-CHVC2UUI.js → typesafe-system-one-56TEMIHL.js} +1 -1
- package/dist/pi/dist/bundle/chunks/virtual-modules-KITQRTYM.js +2 -0
- package/dist/pi/dist/bundle/cli-runtime.js +1 -1
- package/dist/pi/dist/bundle/index.js +1 -1
- package/dist/pi/dist/bundle/rpc-entry.js +1 -1
- package/dist/pi/docs/cli.md +14 -1
- package/dist/pi/docs/extensions.md +27 -7
- package/dist/pi/docs/keybindings.md +1 -1
- package/dist/pi/docs/llama-cpp.md +5 -8
- package/dist/pi/docs/models-configuration.md +6 -1
- package/dist/pi/docs/models.md +2 -1
- package/dist/pi/docs/prompt-templates.md +1 -1
- package/dist/pi/docs/providers.md +1 -1
- package/dist/pi/docs/rpc.md +4 -2
- package/dist/pi/docs/sessions.md +7 -1
- package/dist/pi/docs/settings.md +1 -1
- package/dist/pi/docs/tui.md +1 -1
- package/dist/pi/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/dist/pi/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/dist/pi/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/dist/pi/examples/extensions/gondolin/package-lock.json +2 -2
- package/dist/pi/examples/extensions/gondolin/package.json +1 -1
- package/dist/pi/examples/extensions/plan-mode/index.ts +23 -13
- package/dist/pi/examples/extensions/plan-mode/utils.ts +42 -16
- package/dist/pi/examples/extensions/subagent/README.md +14 -11
- package/dist/pi/examples/extensions/subagent/index.ts +392 -171
- package/dist/pi/examples/extensions/with-deps/package-lock.json +2 -2
- package/dist/pi/examples/extensions/with-deps/package.json +1 -1
- package/dist/pi/examples/tsconfig.json +63 -35
- package/dist/pi/package.json +1 -1
- package/dist/pi/packages/ta-agents/extension/index.mjs +19 -1
- package/dist/pi/packages/ta-agents/lib/agent-bindings.d.ts +2 -0
- package/dist/pi/packages/ta-agents/lib/agent-bindings.js +4 -0
- package/dist/pi/packages/ta-agents/lib/extension.js +15 -1
- package/dist/pi/packages/ta-agents/lib/texts.d.ts +4 -0
- package/dist/pi/packages/ta-agents/lib/texts.js +4 -0
- package/dist/pi/packages/ta-agents/package.json +3 -3
- package/dist/pi/packages/ta-bots/extension/index.mjs +46 -0
- package/dist/pi/packages/ta-bots/host/index.mjs +46 -0
- package/dist/pi/packages/ta-bots/package.json +1 -1
- package/dist/pi/packages/ta-changes/package.json +1 -1
- package/dist/pi/packages/ta-channels/README.en.md +2 -2
- package/dist/pi/packages/ta-channels/README.md +2 -2
- package/dist/pi/packages/ta-channels/host/index.mjs +50 -0
- package/dist/pi/packages/ta-channels/lib/create.js +11 -3
- package/dist/pi/packages/ta-channels/lib/faces.js +1 -1
- package/dist/pi/packages/ta-channels/lib/i18n.d.ts +4 -8
- package/dist/pi/packages/ta-channels/lib/i18n.js +8 -16
- package/dist/pi/packages/ta-channels/lib/more-menu.d.ts +3 -2
- package/dist/pi/packages/ta-channels/lib/more-menu.js +21 -29
- package/dist/pi/packages/ta-channels/lib/room.js +13 -8
- package/dist/pi/packages/ta-channels/lib/sidebar.js +184 -74
- package/dist/pi/packages/ta-channels/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-channels/lib/style.js +83 -37
- package/dist/pi/packages/ta-channels/lib/tasks.js +3 -4
- package/dist/pi/packages/ta-channels/lib/views.d.ts +49 -1
- package/dist/pi/packages/ta-channels/lib/views.js +100 -1
- package/dist/pi/packages/ta-channels/package.json +1 -1
- package/dist/pi/packages/ta-channels/web/index.js +398 -243
- package/dist/pi/packages/ta-computer-use/package.json +2 -2
- package/dist/pi/packages/ta-cron/README.en.md +2 -2
- package/dist/pi/packages/ta-cron/README.md +2 -2
- package/dist/pi/packages/ta-cron/host/index.mjs +6 -0
- package/dist/pi/packages/ta-cron/lib/editor.js +60 -27
- package/dist/pi/packages/ta-cron/lib/i18n.d.ts +12 -1
- package/dist/pi/packages/ta-cron/lib/i18n.js +24 -2
- package/dist/pi/packages/ta-cron/lib/page.d.ts +33 -3
- package/dist/pi/packages/ta-cron/lib/page.js +119 -4
- package/dist/pi/packages/ta-cron/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-cron/lib/style.js +166 -46
- package/dist/pi/packages/ta-cron/lib/task-extension.d.ts +15 -0
- package/dist/pi/packages/ta-cron/lib/task-extension.js +56 -0
- package/dist/pi/packages/ta-cron/lib/task-util.d.ts +2 -0
- package/dist/pi/packages/ta-cron/lib/task-util.js +11 -0
- package/dist/pi/packages/ta-cron/lib/tasks-view.d.ts +4 -1
- package/dist/pi/packages/ta-cron/lib/tasks-view.js +102 -66
- package/dist/pi/packages/ta-cron/package.json +1 -1
- package/dist/pi/packages/ta-cron/web/index.js +928 -404
- package/dist/pi/packages/ta-extensions/README.en.md +3 -1
- package/dist/pi/packages/ta-extensions/README.md +3 -1
- package/dist/pi/packages/ta-extensions/lib/actions.js +3 -1
- package/dist/pi/packages/ta-extensions/lib/composer.d.ts +17 -0
- package/dist/pi/packages/ta-extensions/lib/composer.js +84 -0
- package/dist/pi/packages/ta-extensions/lib/i18n.d.ts +9 -0
- package/dist/pi/packages/ta-extensions/lib/i18n.js +18 -0
- package/dist/pi/packages/ta-extensions/lib/index.js +4 -0
- package/dist/pi/packages/ta-extensions/lib/make-model.d.ts +20 -0
- package/dist/pi/packages/ta-extensions/lib/make-model.js +43 -0
- package/dist/pi/packages/ta-extensions/lib/page.js +42 -18
- package/dist/pi/packages/ta-extensions/lib/settings.d.ts +4 -0
- package/dist/pi/packages/ta-extensions/lib/settings.js +44 -0
- package/dist/pi/packages/ta-extensions/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-extensions/lib/style.js +10 -4
- package/dist/pi/packages/ta-extensions/package.json +1 -1
- package/dist/pi/packages/ta-extensions/skills/ta-package/SKILL.md +7 -3
- package/dist/pi/packages/ta-extensions/web/index.js +269 -26
- package/dist/pi/packages/ta-launcher/package.json +1 -1
- package/dist/pi/packages/ta-workspace/README.md +1 -1
- package/dist/pi/packages/ta-workspace/README.zh-cn.md +1 -1
- package/dist/pi/packages/ta-workspace/lib/bytes.d.ts +11 -0
- package/dist/pi/packages/ta-workspace/lib/bytes.js +40 -0
- package/dist/pi/packages/ta-workspace/lib/common.d.ts +2 -1
- package/dist/pi/packages/ta-workspace/lib/common.js +15 -37
- package/dist/pi/packages/ta-workspace/lib/editors.js +12 -3
- package/dist/pi/packages/ta-workspace/lib/i18n.d.ts +1 -2
- package/dist/pi/packages/ta-workspace/lib/i18n.js +2 -4
- package/dist/pi/packages/ta-workspace/lib/index.js +15 -0
- package/dist/pi/packages/ta-workspace/lib/launcher.d.ts +9 -0
- package/dist/pi/packages/ta-workspace/lib/launcher.js +39 -0
- package/dist/pi/packages/ta-workspace/lib/preview.d.ts +13 -3
- package/dist/pi/packages/ta-workspace/lib/preview.js +17 -14
- package/dist/pi/packages/ta-workspace/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-workspace/lib/style.js +20 -7
- package/dist/pi/packages/ta-workspace/lib/util/keys.d.ts +18 -0
- package/dist/pi/packages/ta-workspace/lib/util/keys.js +23 -0
- package/dist/pi/packages/ta-workspace/lib/util/preview.d.ts +19 -0
- package/dist/pi/packages/ta-workspace/lib/util/preview.js +32 -1
- package/dist/pi/packages/ta-workspace/package.json +1 -1
- package/dist/pi/packages/ta-workspace/web/index.js +235 -67
- package/dist/public/assets/{abnfDiagram-S7VZAUFO-EVMX_yOb.js → abnfDiagram-S7VZAUFO-BmIko5tV.js} +1 -1
- package/dist/public/assets/{architecture-WOLXFQ4H-CDgbgZ_o.js → architecture-WOLXFQ4H-XgsdQ7ul.js} +1 -1
- package/dist/public/assets/{architectureDiagram-YGSQEFNW-dHreaCWz.js → architectureDiagram-YGSQEFNW--sVhMS03.js} +1 -1
- package/dist/public/assets/{blockDiagram-APKKGZFW-D6FhzBDq.js → blockDiagram-APKKGZFW-8f9b-9k2.js} +1 -1
- package/dist/public/assets/browser-DOHZ0JCf.js +12 -0
- package/dist/public/assets/{c4Diagram-KJ2TOQU5-BFpcr8Cs.js → c4Diagram-KJ2TOQU5-CwYQ0Jfy.js} +1 -1
- package/dist/public/assets/{chunk-6MUBBAK2-BczXkMV-.js → chunk-6MUBBAK2-7Y9ezehi.js} +1 -1
- package/dist/public/assets/{chunk-AXFCVDMN-CjJsv3jB.js → chunk-AXFCVDMN-CZIH4pWz.js} +1 -1
- package/dist/public/assets/{chunk-BG4553SI-FBaleaLz.js → chunk-BG4553SI-DsNATY2m.js} +1 -1
- package/dist/public/assets/{chunk-DQASFODM-BFdXY5sX.js → chunk-DQASFODM-CoXkfYE-.js} +1 -1
- package/dist/public/assets/{chunk-HFQBQIA3-C5cwK-Fg.js → chunk-HFQBQIA3-C5OLqki8.js} +1 -1
- package/dist/public/assets/{chunk-KQLB2F66-BUek3IRk.js → chunk-KQLB2F66-DMHuYGEF.js} +1 -1
- package/dist/public/assets/{chunk-KS47KZWR-BxsYBzt6.js → chunk-KS47KZWR-BKeOttO1.js} +1 -1
- package/dist/public/assets/{chunk-LEVMRMFU-Bdcwz9fS.js → chunk-LEVMRMFU-D6zCwkk7.js} +1 -1
- package/dist/public/assets/{chunk-M57EVK23-kkpP5oug.js → chunk-M57EVK23-B5-QqcZg.js} +1 -1
- package/dist/public/assets/{chunk-OY52VR5R-CFhQgxmD.js → chunk-OY52VR5R-DQrq3n0T.js} +1 -1
- package/dist/public/assets/{chunk-QB3YPZ4I-BVXqu0eC.js → chunk-QB3YPZ4I-j6ZT7EDR.js} +1 -1
- package/dist/public/assets/{chunk-R3KSYZAL-B7SUqqLI.js → chunk-R3KSYZAL-D5MXUO36.js} +1 -1
- package/dist/public/assets/{chunk-STOXU5M4-B3abfbnH.js → chunk-STOXU5M4-DaBkw4dD.js} +1 -1
- package/dist/public/assets/{chunk-TU62E6Q5-C9NqnUav.js → chunk-TU62E6Q5-vXcRfGci.js} +1 -1
- package/dist/public/assets/{chunk-X4PVCEUW-BeLfETDx.js → chunk-X4PVCEUW-CIh6H4Y2.js} +1 -1
- package/dist/public/assets/{chunk-XXDRQBXY-DXai1i8p.js → chunk-XXDRQBXY-C_Vwv1FM.js} +1 -1
- package/dist/public/assets/{classDiagram-v2-L25IHNXF-Zj6ne_tC.js → classDiagram-v2-L25IHNXF-DccDWEJn.js} +1 -1
- package/dist/public/assets/{cose-bilkent-JH36ORCC-C0-TjqfJ.js → cose-bilkent-JH36ORCC-BX47lumZ.js} +1 -1
- package/dist/public/assets/cynefin-EF2NZ3EQ-MaI-3dMQ.js +1 -0
- package/dist/public/assets/{cynefinDiagram-L36ESFBY-BnqxfzPa.js → cynefinDiagram-L36ESFBY-BE6WOGxW.js} +1 -1
- package/dist/public/assets/{d3-selection-DfFLTR9d.js → d3-selection-ZcE6yRN5.js} +1 -1
- package/dist/public/assets/{dagre-SPEB5RXH-kI17e5cH.js → dagre-SPEB5RXH-CE6SOOcN.js} +1 -1
- package/dist/public/assets/{diagram-3B7GL73J-DgPjeLA5.js → diagram-3B7GL73J-xC8VtiYL.js} +1 -1
- package/dist/public/assets/{diagram-DNEMPZML-CRhPfa0I.js → diagram-DNEMPZML-4dmcBbjL.js} +1 -1
- package/dist/public/assets/{diagram-L3MUGCDN-ExuTg12b.js → diagram-L3MUGCDN-D14Yn3sQ.js} +1 -1
- package/dist/public/assets/{diagram-LA4NIPWU-Dgx5xNiY.js → diagram-LA4NIPWU-GxSXIhsK.js} +1 -1
- package/dist/public/assets/{diagram-MHCOC4E2-BuifkUTl.js → diagram-MHCOC4E2-Cm7Prlpc.js} +1 -1
- package/dist/public/assets/{diagram-XPFHEONP-CFEaBo7z.js → diagram-XPFHEONP-mkUnnKFu.js} +1 -1
- package/dist/public/assets/{dist-C-iJHcSK.js → dist-acJS-BlA.js} +1 -1
- package/dist/public/assets/{ebnfDiagram-UZSYDL2S-D-hp5yNt.js → ebnfDiagram-UZSYDL2S-m77ua3UQ.js} +1 -1
- package/dist/public/assets/{editor.api-BopUWpqY.js → editor.api-CljTm-EQ.js} +1 -1
- package/dist/public/assets/{elk-XV6XMXQE-CBbk_IpU.js → elk-XV6XMXQE-DsQY1hw9.js} +1 -1
- package/dist/public/assets/{erDiagram-EYBAPDEH-B02R_WWE.js → erDiagram-EYBAPDEH-CV8gJM0P.js} +1 -1
- package/dist/public/assets/{eventmodeling-K75KTNOO-aCZfYnCI.js → eventmodeling-K75KTNOO-C1pymbUr.js} +1 -1
- package/dist/public/assets/flowDiagram-MALGAFMO-shBnAQFk.js +1 -0
- package/dist/public/assets/{freemarker2-DMN60LeK.js → freemarker2-DYJXaMHN.js} +1 -1
- package/dist/public/assets/{ganttDiagram-23REXITY-DioU8TlD.js → ganttDiagram-23REXITY-CppxOWRh.js} +1 -1
- package/dist/public/assets/gitGraph-VSP46ZUC-BtQWboBz.js +1 -0
- package/dist/public/assets/{gitGraphDiagram-STJD7YCW--q3ctg6y.js → gitGraphDiagram-STJD7YCW-CrQrZhcP.js} +1 -1
- package/dist/public/assets/{handlebars-B_-qdvpB.js → handlebars-DZCnH9e2.js} +1 -1
- package/dist/public/assets/{html-BN8Ah3Js.js → html-DuzouNES.js} +1 -1
- package/dist/public/assets/{index-B3A--ac8.js → index-B7OYKvCE.js} +2 -2
- package/dist/public/assets/info-OHQRW6UA-CDSLjba_.js +1 -0
- package/dist/public/assets/{infoDiagram-KBXO4MBG-CGXteYo9.js → infoDiagram-KBXO4MBG-6pby19tQ.js} +1 -1
- package/dist/public/assets/{ishikawaDiagram-M35NCXHK-DM2LmOAc.js → ishikawaDiagram-M35NCXHK-Duf8c8rQ.js} +1 -1
- package/dist/public/assets/{javascript-BlizGb0q.js → javascript-2d_L6cVd.js} +1 -1
- package/dist/public/assets/{journeyDiagram-OPLOXDXO-CNITRtGl.js → journeyDiagram-OPLOXDXO-Dvv-xzNo.js} +1 -1
- package/dist/public/assets/{jsonMode-CEUmT5sN.js → jsonMode-CFadYXyI.js} +1 -1
- package/dist/public/assets/{kanban-definition-BZKZHSQY-BPUuS9um.js → kanban-definition-BZKZHSQY-Dsk6F-TT.js} +1 -1
- package/dist/public/assets/{liquid-BbyLjUbE.js → liquid-Din4CF34.js} +1 -1
- package/dist/public/assets/{mdx-DiQz7Q35.js → mdx-DivDuCWI.js} +1 -1
- package/dist/public/assets/{mermaid-parser.core-Dum100hC.js → mermaid-parser.core-BfCv4CYZ.js} +3 -3
- package/dist/public/assets/{mermaid.core-BWmWf6XO.js → mermaid.core-DC20ZwJj.js} +4 -4
- package/dist/public/assets/{mindmap-definition-I2QAS2VK-L8HyYUDY.js → mindmap-definition-I2QAS2VK-DRZRrJU_.js} +1 -1
- package/dist/public/assets/module-BAQaY56j.js +1 -0
- package/dist/public/assets/module-DxRGg3ED.js +1947 -0
- package/dist/public/assets/{monaco-zOOyBmxy.js → monaco-D1d6MOPe.js} +3 -3
- package/dist/public/assets/packet-JDAUHWVQ-dYb4P9eU.js +1 -0
- package/dist/public/assets/{pegDiagram-FD4XPPHP-CTZKPo0Z.js → pegDiagram-FD4XPPHP-DcGr3Tbk.js} +1 -1
- package/dist/public/assets/pie-XZMESJXO-CIompBnc.js +1 -0
- package/dist/public/assets/{pieDiagram-J4AKIIQI-DAeT3dFi.js → pieDiagram-J4AKIIQI-GF7pu6ch.js} +1 -1
- package/dist/public/assets/{python-C984gt98.js → python-BQbTTTT5.js} +1 -1
- package/dist/public/assets/{quadrantDiagram-XTYBLID2--PXxwV1Z.js → quadrantDiagram-XTYBLID2-D-bcu7Ey.js} +1 -1
- package/dist/public/assets/radar-ABXABTNO-DiJl7BtK.js +1 -0
- package/dist/public/assets/railroad-I3PHUGI6-B5cRBukM.js +1 -0
- package/dist/public/assets/{railroad-abnf-LNEFI6M7-BYcFfrCa.js → railroad-abnf-LNEFI6M7-BiBHsI-K.js} +1 -1
- package/dist/public/assets/{railroad-ebnf-DWYD2UWJ-Cd33qxAm.js → railroad-ebnf-DWYD2UWJ-zKjrfkHs.js} +1 -1
- package/dist/public/assets/{railroad-peg-JR7BVNR7-C5TpzaU8.js → railroad-peg-JR7BVNR7-DKuVn0GT.js} +1 -1
- package/dist/public/assets/{railroadDiagram-MRQ6NCDL-DlWwjbhH.js → railroadDiagram-MRQ6NCDL-Cyn-16mJ.js} +1 -1
- package/dist/public/assets/{razor-BBqMR1Qn.js → razor-DiLk54O0.js} +1 -1
- package/dist/public/assets/{requirementDiagram-Y7LWUY3S-CsYBy9HS.js → requirementDiagram-Y7LWUY3S-CwU2EBkW.js} +1 -1
- package/dist/public/assets/{sankeyDiagram-WGJFYUXA-Baxyb5p9.js → sankeyDiagram-WGJFYUXA-ajf00HyW.js} +1 -1
- package/dist/public/assets/{sequenceDiagram-5NDRBG5M-Cq6VeBT_.js → sequenceDiagram-5NDRBG5M-DiX_OIAw.js} +1 -1
- package/dist/public/assets/{stateDiagram-v2-FJ4FJNEA-O60WKaE7.js → stateDiagram-v2-FJ4FJNEA-CV5bRqB7.js} +1 -1
- package/dist/public/assets/{swimlanes-UMQ2AFYF-C2nf1-Cc.js → swimlanes-UMQ2AFYF-BGQKSlj7.js} +1 -1
- package/dist/public/assets/swimlanesDiagram-OMPLPG4O-DxXlavVT.js +8 -0
- package/dist/public/assets/{timeline-definition-SEUHKTQE-DEfUG6YH.js → timeline-definition-SEUHKTQE-DhQoApff.js} +1 -1
- package/dist/public/assets/treeView-D4JQ5SDB-BOP6mkZC.js +1 -0
- package/dist/public/assets/treemap-SAJKECNS-BJxuPMz3.js +1 -0
- package/dist/public/assets/{typescript-Gtq7f0aU.js → typescript-COQ1g-up.js} +1 -1
- package/dist/public/assets/{usecaseDiagram-AFA6YXN4-Gw9DyJcx.js → usecaseDiagram-AFA6YXN4-CmLFzjie.js} +1 -1
- package/dist/public/assets/{vennDiagram-NNMJR3RB-Clb3MLWF.js → vennDiagram-NNMJR3RB-DOa6JR5K.js} +1 -1
- package/dist/public/assets/wardley-7MLQ67FV-jqlowjVL.js +1 -0
- package/dist/public/assets/{wardleyDiagram-S7YFUSEH-BrTRpwu2.js → wardleyDiagram-S7YFUSEH-BV7EEShp.js} +1 -1
- package/dist/public/assets/{xml-Bx3nk7iG.js → xml-BbvtjuaG.js} +1 -1
- package/dist/public/assets/{xychartDiagram-GGNKY7IX-BfjTcIsb.js → xychartDiagram-GGNKY7IX-DtMpPbsq.js} +1 -1
- package/dist/public/assets/{yaml-dFLE_rSl.js → yaml-Bw8NFga9.js} +1 -1
- package/dist/public/index.html +1 -1
- package/dist/public/launch.svg +46 -42
- package/dist/serve/index.mjs +1354 -555
- package/package.json +25 -25
- package/dist/pi/dist/bundle/chunks/anthropic-messages-BWGCKOF4.js +0 -6
- package/dist/pi/dist/bundle/chunks/chunk-44DLKSKE.js +0 -1232
- package/dist/pi/dist/bundle/chunks/chunk-62VOPMLK.js +0 -65
- package/dist/pi/dist/bundle/chunks/chunk-7O7QKK6A.js +0 -2
- package/dist/pi/dist/bundle/chunks/chunk-CHWNPHIS.js +0 -82
- package/dist/pi/dist/bundle/chunks/chunk-NL4X6LBY.js +0 -4
- package/dist/pi/dist/bundle/chunks/chunk-NZY7EIPA.js +0 -4
- package/dist/pi/dist/bundle/chunks/chunk-R2EGYMOO.js +0 -7
- package/dist/pi/dist/bundle/chunks/chunk-UKVNB6C4.js +0 -2
- package/dist/pi/dist/bundle/chunks/chunk-USJZMAIR.js +0 -2
- package/dist/pi/dist/bundle/chunks/chunk-VOLAXWGI.js +0 -2
- package/dist/pi/dist/bundle/chunks/openai-codex-responses-QAWLOQSN.js +0 -10
- package/dist/pi/dist/bundle/chunks/openai-responses-MD3562FB.js +0 -4
- package/dist/pi/dist/bundle/chunks/virtual-modules-O76XM3OB.js +0 -2
- package/dist/public/assets/browser-y6EDNUmc.js +0 -12
- package/dist/public/assets/cynefin-EF2NZ3EQ-CoY4CrZu.js +0 -1
- package/dist/public/assets/flowDiagram-MALGAFMO-CATkJShO.js +0 -1
- package/dist/public/assets/gitGraph-VSP46ZUC-g4yHXXxx.js +0 -1
- package/dist/public/assets/info-OHQRW6UA-CKADJjz4.js +0 -1
- package/dist/public/assets/module-CH7IXa5L.js +0 -1781
- package/dist/public/assets/module-DNAasuMC.js +0 -1
- package/dist/public/assets/packet-JDAUHWVQ-CpKMhX4K.js +0 -1
- package/dist/public/assets/pie-XZMESJXO-CW-zGDRd.js +0 -1
- package/dist/public/assets/radar-ABXABTNO-Cg8W433p.js +0 -1
- package/dist/public/assets/railroad-I3PHUGI6-DriMt2PQ.js +0 -1
- package/dist/public/assets/swimlanesDiagram-OMPLPG4O-B46JxqS8.js +0 -8
- package/dist/public/assets/treeView-D4JQ5SDB-1LhEWwC9.js +0 -1
- package/dist/public/assets/treemap-SAJKECNS-D3t3N7nS.js +0 -1
- package/dist/public/assets/wardley-7MLQ67FV-D3sAsd8p.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as e,u as t}from"./browser-y6EDNUmc.js";import{n}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";var r=e(((e,t,n)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs=r()})(n,(function(){var e=1e3,t=6e4,n=36e5,r=`millisecond`,i=`second`,a=`minute`,o=`hour`,s=`day`,c=`week`,l=`month`,u=`quarter`,d=`year`,f=`date`,p=`Invalid Date`,m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,h=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:`en`,weekdays:`Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday`.split(`_`),months:`January_February_March_April_May_June_July_August_September_October_November_December`.split(`_`),ordinal:function(e){var t=[`th`,`st`,`nd`,`rd`],n=e%100;return`[`+e+(t[(n-20)%10]||t[n]||t[0])+`]`}},_=function(e,t,n){var r=String(e);return!r||r.length>=t?e:``+Array(t+1-r.length).join(n)+e},v={s:_,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?`+`:`-`)+_(r,2,`0`)+`:`+_(i,2,`0`)},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var r=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(r,l),a=n-i<0,o=t.clone().add(r+(a?-1:1),l);return+(-(r+(n-i)/(a?i-o:o-i))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:l,y:d,w:c,d:s,D:f,h:o,m:a,s:i,ms:r,Q:u}[e]||String(e||``).toLowerCase().replace(/s$/,``)},u:function(e){return e===void 0}},y=`en`,b={};b[y]=g;var x=`$isDayjsObject`,S=function(e){return e instanceof E||!(!e||!e[x])},C=function e(t,n,r){var i;if(!t)return y;if(typeof t==`string`){var a=t.toLowerCase();b[a]&&(i=a),n&&(b[a]=n,i=a);var o=t.split(`-`);if(!i&&o.length>1)return e(o[0])}else{var s=t.name;b[s]=t,i=s}return!r&&i&&(y=i),i||!r&&y},w=function(e,t){if(S(e))return e.clone();var n=typeof t==`object`?t:{};return n.date=e,n.args=arguments,new E(n)},T=v;T.l=C,T.i=S,T.w=function(e,t){return w(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var E=function(){function g(e){this.$L=C(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[x]=!0}var _=g.prototype;return _.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(t===null)return new Date(NaN);if(T.u(t))return new Date;if(t instanceof Date)return new Date(t);if(typeof t==`string`&&!/Z$/i.test(t)){var r=t.match(m);if(r){var i=r[2]-1||0,a=(r[7]||`0`).substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)}}return new Date(t)}(e),this.init()},_.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},_.$utils=function(){return T},_.isValid=function(){return this.$d.toString()!==p},_.isSame=function(e,t){var n=w(e);return this.startOf(t)<=n&&n<=this.endOf(t)},_.isAfter=function(e,t){return w(e)<this.startOf(t)},_.isBefore=function(e,t){return this.endOf(t)<w(e)},_.$g=function(e,t,n){return T.u(e)?this[t]:this.set(n,e)},_.unix=function(){return Math.floor(this.valueOf()/1e3)},_.valueOf=function(){return this.$d.getTime()},_.startOf=function(e,t){var n=this,r=!!T.u(t)||t,u=T.p(e),p=function(e,t){var i=T.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return r?i:i.endOf(s)},m=function(e,t){return T.w(n.toDate()[e].apply(n.toDate(`s`),(r?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},h=this.$W,g=this.$M,_=this.$D,v=`set`+(this.$u?`UTC`:``);switch(u){case d:return r?p(1,0):p(31,11);case l:return r?p(1,g):p(0,g+1);case c:var y=this.$locale().weekStart||0,b=(h<y?h+7:h)-y;return p(r?_-b:_+(6-b),g);case s:case f:return m(v+`Hours`,0);case o:return m(v+`Minutes`,1);case a:return m(v+`Seconds`,2);case i:return m(v+`Milliseconds`,3);default:return this.clone()}},_.endOf=function(e){return this.startOf(e,!1)},_.$set=function(e,t){var n,c=T.p(e),u=`set`+(this.$u?`UTC`:``),p=(n={},n[s]=u+`Date`,n[f]=u+`Date`,n[l]=u+`Month`,n[d]=u+`FullYear`,n[o]=u+`Hours`,n[a]=u+`Minutes`,n[i]=u+`Seconds`,n[r]=u+`Milliseconds`,n)[c],m=c===s?this.$D+(t-this.$W):t;if(c===l||c===d){var h=this.clone().set(f,1);h.$d[p](m),h.init(),this.$d=h.set(f,Math.min(this.$D,h.daysInMonth())).$d}else p&&this.$d[p](m);return this.init(),this},_.set=function(e,t){return this.clone().$set(e,t)},_.get=function(e){return this[T.p(e)]()},_.add=function(r,u){var f,p=this;r=Number(r);var m=T.p(u),h=function(e){var t=w(p);return T.w(t.date(t.date()+Math.round(e*r)),p)};if(m===l)return this.set(l,this.$M+r);if(m===d)return this.set(d,this.$y+r);if(m===s)return h(1);if(m===c)return h(7);var g=(f={},f[a]=t,f[o]=n,f[i]=e,f)[m]||1,_=this.$d.getTime()+r*g;return T.w(_,this)},_.subtract=function(e,t){return this.add(-1*e,t)},_.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||p;var r=e||`YYYY-MM-DDTHH:mm:ssZ`,i=T.z(this),a=this.$H,o=this.$m,s=this.$M,c=n.weekdays,l=n.months,u=n.meridiem,d=function(e,n,i,a){return e&&(e[n]||e(t,r))||i[n].slice(0,a)},f=function(e){return T.s(a%12||12,e,`0`)},m=u||function(e,t,n){var r=e<12?`AM`:`PM`;return n?r.toLowerCase():r};return r.replace(h,(function(e,r){return r||function(e){switch(e){case`YY`:return String(t.$y).slice(-2);case`YYYY`:return T.s(t.$y,4,`0`);case`M`:return s+1;case`MM`:return T.s(s+1,2,`0`);case`MMM`:return d(n.monthsShort,s,l,3);case`MMMM`:return d(l,s);case`D`:return t.$D;case`DD`:return T.s(t.$D,2,`0`);case`d`:return String(t.$W);case`dd`:return d(n.weekdaysMin,t.$W,c,2);case`ddd`:return d(n.weekdaysShort,t.$W,c,3);case`dddd`:return c[t.$W];case`H`:return String(a);case`HH`:return T.s(a,2,`0`);case`h`:return f(1);case`hh`:return f(2);case`a`:return m(a,o,!0);case`A`:return m(a,o,!1);case`m`:return String(o);case`mm`:return T.s(o,2,`0`);case`s`:return String(t.$s);case`ss`:return T.s(t.$s,2,`0`);case`SSS`:return T.s(t.$ms,3,`0`);case`Z`:return i}return null}(e)||i.replace(`:`,``)}))},_.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},_.diff=function(r,f,p){var m,h=this,g=T.p(f),_=w(r),v=(_.utcOffset()-this.utcOffset())*t,y=this-_,b=function(){return T.m(h,_)};switch(g){case d:m=b()/12;break;case l:m=b();break;case u:m=b()/3;break;case c:m=(y-v)/6048e5;break;case s:m=(y-v)/864e5;break;case o:m=y/n;break;case a:m=y/t;break;case i:m=y/e;break;default:m=y}return p?m:T.a(m)},_.daysInMonth=function(){return this.endOf(l).$D},_.$locale=function(){return b[this.$L]},_.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),r=C(e,t,!0);return r&&(n.$L=r),n},_.clone=function(){return T.w(this.$d,this)},_.toDate=function(){return new Date(this.valueOf())},_.toJSON=function(){return this.isValid()?this.toISOString():null},_.toISOString=function(){return this.$d.toISOString()},_.toString=function(){return this.$d.toUTCString()},g}(),D=E.prototype;return w.prototype=D,[[`$ms`,r],[`$s`,i],[`$m`,a],[`$H`,o],[`$W`,s],[`$M`,l],[`$y`,d],[`$D`,f]].forEach((function(e){D[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),w.extend=function(e,t){return e.$i||=(e(t,E,w),!0),w},w.locale=C,w.isDayjs=S,w.unix=function(e){return w(1e3*e)},w.en=b[y],w.Ls=b,w.p={},w}))})),i=t(r(),1),a={trace:0,debug:1,info:2,warn:3,error:4,fatal:5},o={trace:n((...e)=>{},`trace`),debug:n((...e)=>{},`debug`),info:n((...e)=>{},`info`),warn:n((...e)=>{},`warn`),error:n((...e)=>{},`error`),fatal:n((...e)=>{},`fatal`)},s=n(function(e=`fatal`){let t=a.fatal;typeof e==`string`?e.toLowerCase()in a&&(t=a[e]):typeof e==`number`&&(t=e),o.trace=()=>{},o.debug=()=>{},o.info=()=>{},o.warn=()=>{},o.error=()=>{},o.fatal=()=>{},t<=a.fatal&&(o.fatal=console.error?console.error.bind(console,c(`FATAL`),`color: orange`):console.log.bind(console,`\x1B[35m`,c(`FATAL`))),t<=a.error&&(o.error=console.error?console.error.bind(console,c(`ERROR`),`color: orange`):console.log.bind(console,`\x1B[31m`,c(`ERROR`))),t<=a.warn&&(o.warn=console.warn?console.warn.bind(console,c(`WARN`),`color: orange`):console.log.bind(console,`\x1B[33m`,c(`WARN`))),t<=a.info&&(o.info=console.info?console.info.bind(console,c(`INFO`),`color: lightblue`):console.log.bind(console,`\x1B[34m`,c(`INFO`))),t<=a.debug&&(o.debug=console.debug?console.debug.bind(console,c(`DEBUG`),`color: lightgreen`):console.log.bind(console,`\x1B[32m`,c(`DEBUG`))),t<=a.trace&&(o.trace=console.debug?console.debug.bind(console,c(`TRACE`),`color: lightgreen`):console.log.bind(console,`\x1B[32m`,c(`TRACE`)))},`setLogLevel`),c=n(e=>`%c${(0,i.default)().format(`ss.SSS`)} : ${e} : `,`format`),l=`http://www.w3.org/1999/xhtml`,u={svg:`http://www.w3.org/2000/svg`,xhtml:l,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`};function d(e){var t=e+=``,n=t.indexOf(`:`);return n>=0&&(t=e.slice(0,n))!==`xmlns`&&(e=e.slice(n+1)),u.hasOwnProperty(t)?{space:u[t],local:e}:e}function f(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===l&&t.documentElement.namespaceURI===l?t.createElement(e):t.createElementNS(n,e)}}function p(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function m(e){var t=d(e);return(t.local?p:f)(t)}function h(){}function g(e){return e==null?h:function(){return this.querySelector(e)}}function _(e){typeof e!=`function`&&(e=g(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=Array(o),c,l,u=0;u<o;++u)(c=a[u])&&(l=e.call(c,c.__data__,u,a))&&(`__data__`in c&&(l.__data__=c.__data__),s[u]=l);return new Q(r,this._parents)}function v(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function y(){return[]}function b(e){return e==null?y:function(){return this.querySelectorAll(e)}}function x(e){return function(){return v(e.apply(this,arguments))}}function S(e){e=typeof e==`function`?x(e):b(e);for(var t=this._groups,n=t.length,r=[],i=[],a=0;a<n;++a)for(var o=t[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&(r.push(e.call(c,c.__data__,l,o)),i.push(c));return new Q(r,i)}function C(e){return function(){return this.matches(e)}}function w(e){return function(t){return t.matches(e)}}var T=Array.prototype.find;function E(e){return function(){return T.call(this.children,e)}}function D(){return this.firstElementChild}function ee(e){return this.select(e==null?D:E(typeof e==`function`?e:w(e)))}var te=Array.prototype.filter;function ne(){return Array.from(this.children)}function re(e){return function(){return te.call(this.children,e)}}function ie(e){return this.selectAll(e==null?ne:re(typeof e==`function`?e:w(e)))}function ae(e){typeof e!=`function`&&(e=C(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new Q(r,this._parents)}function O(e){return Array(e.length)}function oe(){return new Q(this._enter||this._groups.map(O),this._parents)}function k(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}k.prototype={constructor:k,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function se(e){return function(){return e}}function ce(e,t,n,r,i,a){for(var o=0,s,c=t.length,l=a.length;o<l;++o)(s=t[o])?(s.__data__=a[o],r[o]=s):n[o]=new k(e,a[o]);for(;o<c;++o)(s=t[o])&&(i[o]=s)}function le(e,t,n,r,i,a,o){var s,c,l=new Map,u=t.length,d=a.length,f=Array(u),p;for(s=0;s<u;++s)(c=t[s])&&(f[s]=p=o.call(c,c.__data__,s,t)+``,l.has(p)?i[s]=c:l.set(p,c));for(s=0;s<d;++s)p=o.call(e,a[s],s,a)+``,(c=l.get(p))?(r[s]=c,c.__data__=a[s],l.delete(p)):n[s]=new k(e,a[s]);for(s=0;s<u;++s)(c=t[s])&&l.get(f[s])===c&&(i[s]=c)}function ue(e){return e.__data__}function de(e,t){if(!arguments.length)return Array.from(this,ue);var n=t?le:ce,r=this._parents,i=this._groups;typeof e!=`function`&&(e=se(e));for(var a=i.length,o=Array(a),s=Array(a),c=Array(a),l=0;l<a;++l){var u=r[l],d=i[l],f=d.length,p=A(e.call(u,u&&u.__data__,l,r)),m=p.length,h=s[l]=Array(m),g=o[l]=Array(m);n(u,d,h,g,c[l]=Array(f),p,t);for(var _=0,v=0,y,b;_<m;++_)if(y=h[_]){for(_>=v&&(v=_+1);!(b=g[v])&&++v<m;);y._next=b||null}}return o=new Q(o,r),o._enter=s,o._exit=c,o}function A(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function j(){return new Q(this._exit||this._groups.map(O),this._parents)}function M(e,t,n){var r=this.enter(),i=this,a=this.exit();return typeof e==`function`?(r=e(r),r&&=r.selection()):r=r.append(e+``),t!=null&&(i=t(i),i&&=i.selection()),n==null?a.remove():n(a),r&&i?r.merge(i).order():i}function N(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,a=r.length,o=Math.min(i,a),s=Array(i),c=0;c<o;++c)for(var l=n[c],u=r[c],d=l.length,f=s[c]=Array(d),p,m=0;m<d;++m)(p=l[m]||u[m])&&(f[m]=p);for(;c<i;++c)s[c]=n[c];return new Q(s,this._parents)}function P(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,a=r[i],o;--i>=0;)(o=r[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function F(e){e||=I;function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}for(var n=this._groups,r=n.length,i=Array(r),a=0;a<r;++a){for(var o=n[a],s=o.length,c=i[a]=Array(s),l,u=0;u<s;++u)(l=o[u])&&(c[u]=l);c.sort(t)}return new Q(i,this._parents).order()}function I(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function L(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function R(){return Array.from(this)}function z(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}return null}function B(){let e=0;for(let t of this)++e;return e}function V(){return!this.node()}function H(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],a=0,o=i.length,s;a<o;++a)(s=i[a])&&e.call(s,s.__data__,a,i);return this}function fe(e){return function(){this.removeAttribute(e)}}function pe(e){return function(){this.removeAttributeNS(e.space,e.local)}}function me(e,t){return function(){this.setAttribute(e,t)}}function he(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function ge(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function _e(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function ve(e,t){var n=d(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?pe:fe:typeof t==`function`?n.local?_e:ge:n.local?he:me)(n,t))}function U(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function ye(e){return function(){this.style.removeProperty(e)}}function be(e,t,n){return function(){this.style.setProperty(e,t,n)}}function xe(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function Se(e,t,n){return arguments.length>1?this.each((t==null?ye:typeof t==`function`?xe:be)(e,t,n??``)):Ce(this.node(),e)}function Ce(e,t){return e.style.getPropertyValue(t)||U(e).getComputedStyle(e,null).getPropertyValue(t)}function we(e){return function(){delete this[e]}}function Te(e,t){return function(){this[e]=t}}function Ee(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function De(e,t){return arguments.length>1?this.each((t==null?we:typeof t==`function`?Ee:Te)(e,t)):this.node()[e]}function W(e){return e.trim().split(/^|\s+/)}function G(e){return e.classList||new K(e)}function K(e){this._node=e,this._names=W(e.getAttribute(`class`)||``)}K.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute(`class`,this._names.join(` `)))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute(`class`,this._names.join(` `)))},contains:function(e){return this._names.indexOf(e)>=0}};function q(e,t){for(var n=G(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function J(e,t){for(var n=G(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function Oe(e){return function(){q(this,e)}}function ke(e){return function(){J(this,e)}}function Ae(e,t){return function(){(t.apply(this,arguments)?q:J)(this,e)}}function je(e,t){var n=W(e+``);if(arguments.length<2){for(var r=G(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t==`function`?Ae:t?Oe:ke)(n,t))}function Me(){this.textContent=``}function Ne(e){return function(){this.textContent=e}}function Pe(e){return function(){var t=e.apply(this,arguments);this.textContent=t??``}}function Fe(e){return arguments.length?this.each(e==null?Me:(typeof e==`function`?Pe:Ne)(e)):this.node().textContent}function Ie(){this.innerHTML=``}function Le(e){return function(){this.innerHTML=e}}function Re(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??``}}function ze(e){return arguments.length?this.each(e==null?Ie:(typeof e==`function`?Re:Le)(e)):this.node().innerHTML}function Be(){this.nextSibling&&this.parentNode.appendChild(this)}function Ve(){return this.each(Be)}function He(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Ue(){return this.each(He)}function We(e){var t=typeof e==`function`?e:m(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Ge(){return null}function Ke(e,t){var n=typeof e==`function`?e:m(e),r=t==null?Ge:typeof t==`function`?t:g(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function qe(){var e=this.parentNode;e&&e.removeChild(this)}function Je(){return this.each(qe)}function Ye(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Xe(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Ze(e){return this.select(e?Xe:Ye)}function Qe(e){return arguments.length?this.property(`__data__`,e):this.node().__data__}function $e(e){return function(t){e.call(this,t,this.__data__)}}function et(e){return e.trim().split(/^|\s+/).map(function(e){var t=``,n=e.indexOf(`.`);return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}function tt(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,a;n<i;++n)a=t[n],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++r]=a;++r?t.length=r:delete this.__on}}}function nt(e,t,n){return function(){var r=this.__on,i,a=$e(t);if(r){for(var o=0,s=r.length;o<s;++o)if((i=r[o]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),i.value=t;return}}this.addEventListener(e.type,a,n),i={type:e.type,name:e.name,value:t,listener:a,options:n},r?r.push(i):this.__on=[i]}}function rt(e,t,n){var r=et(e+``),i,a=r.length,o;if(arguments.length<2){var s=this.node().__on;if(s){for(var c=0,l=s.length,u;c<l;++c)for(i=0,u=s[c];i<a;++i)if((o=r[i]).type===u.type&&o.name===u.name)return u.value}}else{for(s=t?nt:tt,i=0;i<a;++i)this.each(s(r[i],t,n));return this}}function Y(e,t,n){var r=U(e),i=r.CustomEvent;typeof i==`function`?i=new i(t,n):(i=r.document.createEvent(`Event`),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function it(e,t){return function(){return Y(this,e,t)}}function X(e,t){return function(){return Y(this,e,t.apply(this,arguments))}}function at(e,t){return this.each((typeof t==`function`?X:it)(e,t))}function*ot(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length,o;i<a;++i)(o=r[i])&&(yield o)}var Z=[null];function Q(e,t){this._groups=e,this._parents=t}function st(){return new Q([[document.documentElement]],Z)}function ct(){return this}Q.prototype=st.prototype={constructor:Q,select:_,selectAll:S,selectChild:ee,selectChildren:ie,filter:ae,data:de,enter:oe,exit:j,join:M,merge:N,selection:ct,order:P,sort:F,call:L,nodes:R,node:z,size:B,empty:V,each:H,attr:ve,style:Se,property:De,classed:je,text:Fe,html:ze,raise:Ve,lower:Ue,append:We,insert:Ke,remove:Je,clone:Ze,datum:Qe,on:rt,dispatch:at,[Symbol.iterator]:ot};function lt(e){return typeof e==`string`?new Q([[document.querySelector(e)]],[document.documentElement]):new Q([[e]],Z)}var ut=0;function dt(){return new $}function $(){this._=`@`+(++ut).toString(36)}$.prototype=dt.prototype={constructor:$,get:function(e){for(var t=this._;!(t in e);)if(!(e=e.parentNode))return;return e[t]},set:function(e,t){return e[this._]=t},remove:function(e){return this._ in e&&delete e[this._]},toString:function(){return this._}};export{r as i,o as n,s as r,lt as t};
|
|
1
|
+
import{s as e,u as t}from"./browser-DOHZ0JCf.js";import{n}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";var r=e(((e,t,n)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs=r()})(n,(function(){var e=1e3,t=6e4,n=36e5,r=`millisecond`,i=`second`,a=`minute`,o=`hour`,s=`day`,c=`week`,l=`month`,u=`quarter`,d=`year`,f=`date`,p=`Invalid Date`,m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,h=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:`en`,weekdays:`Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday`.split(`_`),months:`January_February_March_April_May_June_July_August_September_October_November_December`.split(`_`),ordinal:function(e){var t=[`th`,`st`,`nd`,`rd`],n=e%100;return`[`+e+(t[(n-20)%10]||t[n]||t[0])+`]`}},_=function(e,t,n){var r=String(e);return!r||r.length>=t?e:``+Array(t+1-r.length).join(n)+e},v={s:_,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?`+`:`-`)+_(r,2,`0`)+`:`+_(i,2,`0`)},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var r=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(r,l),a=n-i<0,o=t.clone().add(r+(a?-1:1),l);return+(-(r+(n-i)/(a?i-o:o-i))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:l,y:d,w:c,d:s,D:f,h:o,m:a,s:i,ms:r,Q:u}[e]||String(e||``).toLowerCase().replace(/s$/,``)},u:function(e){return e===void 0}},y=`en`,b={};b[y]=g;var x=`$isDayjsObject`,S=function(e){return e instanceof E||!(!e||!e[x])},C=function e(t,n,r){var i;if(!t)return y;if(typeof t==`string`){var a=t.toLowerCase();b[a]&&(i=a),n&&(b[a]=n,i=a);var o=t.split(`-`);if(!i&&o.length>1)return e(o[0])}else{var s=t.name;b[s]=t,i=s}return!r&&i&&(y=i),i||!r&&y},w=function(e,t){if(S(e))return e.clone();var n=typeof t==`object`?t:{};return n.date=e,n.args=arguments,new E(n)},T=v;T.l=C,T.i=S,T.w=function(e,t){return w(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var E=function(){function g(e){this.$L=C(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[x]=!0}var _=g.prototype;return _.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(t===null)return new Date(NaN);if(T.u(t))return new Date;if(t instanceof Date)return new Date(t);if(typeof t==`string`&&!/Z$/i.test(t)){var r=t.match(m);if(r){var i=r[2]-1||0,a=(r[7]||`0`).substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)}}return new Date(t)}(e),this.init()},_.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},_.$utils=function(){return T},_.isValid=function(){return this.$d.toString()!==p},_.isSame=function(e,t){var n=w(e);return this.startOf(t)<=n&&n<=this.endOf(t)},_.isAfter=function(e,t){return w(e)<this.startOf(t)},_.isBefore=function(e,t){return this.endOf(t)<w(e)},_.$g=function(e,t,n){return T.u(e)?this[t]:this.set(n,e)},_.unix=function(){return Math.floor(this.valueOf()/1e3)},_.valueOf=function(){return this.$d.getTime()},_.startOf=function(e,t){var n=this,r=!!T.u(t)||t,u=T.p(e),p=function(e,t){var i=T.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return r?i:i.endOf(s)},m=function(e,t){return T.w(n.toDate()[e].apply(n.toDate(`s`),(r?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},h=this.$W,g=this.$M,_=this.$D,v=`set`+(this.$u?`UTC`:``);switch(u){case d:return r?p(1,0):p(31,11);case l:return r?p(1,g):p(0,g+1);case c:var y=this.$locale().weekStart||0,b=(h<y?h+7:h)-y;return p(r?_-b:_+(6-b),g);case s:case f:return m(v+`Hours`,0);case o:return m(v+`Minutes`,1);case a:return m(v+`Seconds`,2);case i:return m(v+`Milliseconds`,3);default:return this.clone()}},_.endOf=function(e){return this.startOf(e,!1)},_.$set=function(e,t){var n,c=T.p(e),u=`set`+(this.$u?`UTC`:``),p=(n={},n[s]=u+`Date`,n[f]=u+`Date`,n[l]=u+`Month`,n[d]=u+`FullYear`,n[o]=u+`Hours`,n[a]=u+`Minutes`,n[i]=u+`Seconds`,n[r]=u+`Milliseconds`,n)[c],m=c===s?this.$D+(t-this.$W):t;if(c===l||c===d){var h=this.clone().set(f,1);h.$d[p](m),h.init(),this.$d=h.set(f,Math.min(this.$D,h.daysInMonth())).$d}else p&&this.$d[p](m);return this.init(),this},_.set=function(e,t){return this.clone().$set(e,t)},_.get=function(e){return this[T.p(e)]()},_.add=function(r,u){var f,p=this;r=Number(r);var m=T.p(u),h=function(e){var t=w(p);return T.w(t.date(t.date()+Math.round(e*r)),p)};if(m===l)return this.set(l,this.$M+r);if(m===d)return this.set(d,this.$y+r);if(m===s)return h(1);if(m===c)return h(7);var g=(f={},f[a]=t,f[o]=n,f[i]=e,f)[m]||1,_=this.$d.getTime()+r*g;return T.w(_,this)},_.subtract=function(e,t){return this.add(-1*e,t)},_.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||p;var r=e||`YYYY-MM-DDTHH:mm:ssZ`,i=T.z(this),a=this.$H,o=this.$m,s=this.$M,c=n.weekdays,l=n.months,u=n.meridiem,d=function(e,n,i,a){return e&&(e[n]||e(t,r))||i[n].slice(0,a)},f=function(e){return T.s(a%12||12,e,`0`)},m=u||function(e,t,n){var r=e<12?`AM`:`PM`;return n?r.toLowerCase():r};return r.replace(h,(function(e,r){return r||function(e){switch(e){case`YY`:return String(t.$y).slice(-2);case`YYYY`:return T.s(t.$y,4,`0`);case`M`:return s+1;case`MM`:return T.s(s+1,2,`0`);case`MMM`:return d(n.monthsShort,s,l,3);case`MMMM`:return d(l,s);case`D`:return t.$D;case`DD`:return T.s(t.$D,2,`0`);case`d`:return String(t.$W);case`dd`:return d(n.weekdaysMin,t.$W,c,2);case`ddd`:return d(n.weekdaysShort,t.$W,c,3);case`dddd`:return c[t.$W];case`H`:return String(a);case`HH`:return T.s(a,2,`0`);case`h`:return f(1);case`hh`:return f(2);case`a`:return m(a,o,!0);case`A`:return m(a,o,!1);case`m`:return String(o);case`mm`:return T.s(o,2,`0`);case`s`:return String(t.$s);case`ss`:return T.s(t.$s,2,`0`);case`SSS`:return T.s(t.$ms,3,`0`);case`Z`:return i}return null}(e)||i.replace(`:`,``)}))},_.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},_.diff=function(r,f,p){var m,h=this,g=T.p(f),_=w(r),v=(_.utcOffset()-this.utcOffset())*t,y=this-_,b=function(){return T.m(h,_)};switch(g){case d:m=b()/12;break;case l:m=b();break;case u:m=b()/3;break;case c:m=(y-v)/6048e5;break;case s:m=(y-v)/864e5;break;case o:m=y/n;break;case a:m=y/t;break;case i:m=y/e;break;default:m=y}return p?m:T.a(m)},_.daysInMonth=function(){return this.endOf(l).$D},_.$locale=function(){return b[this.$L]},_.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),r=C(e,t,!0);return r&&(n.$L=r),n},_.clone=function(){return T.w(this.$d,this)},_.toDate=function(){return new Date(this.valueOf())},_.toJSON=function(){return this.isValid()?this.toISOString():null},_.toISOString=function(){return this.$d.toISOString()},_.toString=function(){return this.$d.toUTCString()},g}(),D=E.prototype;return w.prototype=D,[[`$ms`,r],[`$s`,i],[`$m`,a],[`$H`,o],[`$W`,s],[`$M`,l],[`$y`,d],[`$D`,f]].forEach((function(e){D[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),w.extend=function(e,t){return e.$i||=(e(t,E,w),!0),w},w.locale=C,w.isDayjs=S,w.unix=function(e){return w(1e3*e)},w.en=b[y],w.Ls=b,w.p={},w}))})),i=t(r(),1),a={trace:0,debug:1,info:2,warn:3,error:4,fatal:5},o={trace:n((...e)=>{},`trace`),debug:n((...e)=>{},`debug`),info:n((...e)=>{},`info`),warn:n((...e)=>{},`warn`),error:n((...e)=>{},`error`),fatal:n((...e)=>{},`fatal`)},s=n(function(e=`fatal`){let t=a.fatal;typeof e==`string`?e.toLowerCase()in a&&(t=a[e]):typeof e==`number`&&(t=e),o.trace=()=>{},o.debug=()=>{},o.info=()=>{},o.warn=()=>{},o.error=()=>{},o.fatal=()=>{},t<=a.fatal&&(o.fatal=console.error?console.error.bind(console,c(`FATAL`),`color: orange`):console.log.bind(console,`\x1B[35m`,c(`FATAL`))),t<=a.error&&(o.error=console.error?console.error.bind(console,c(`ERROR`),`color: orange`):console.log.bind(console,`\x1B[31m`,c(`ERROR`))),t<=a.warn&&(o.warn=console.warn?console.warn.bind(console,c(`WARN`),`color: orange`):console.log.bind(console,`\x1B[33m`,c(`WARN`))),t<=a.info&&(o.info=console.info?console.info.bind(console,c(`INFO`),`color: lightblue`):console.log.bind(console,`\x1B[34m`,c(`INFO`))),t<=a.debug&&(o.debug=console.debug?console.debug.bind(console,c(`DEBUG`),`color: lightgreen`):console.log.bind(console,`\x1B[32m`,c(`DEBUG`))),t<=a.trace&&(o.trace=console.debug?console.debug.bind(console,c(`TRACE`),`color: lightgreen`):console.log.bind(console,`\x1B[32m`,c(`TRACE`)))},`setLogLevel`),c=n(e=>`%c${(0,i.default)().format(`ss.SSS`)} : ${e} : `,`format`),l=`http://www.w3.org/1999/xhtml`,u={svg:`http://www.w3.org/2000/svg`,xhtml:l,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`};function d(e){var t=e+=``,n=t.indexOf(`:`);return n>=0&&(t=e.slice(0,n))!==`xmlns`&&(e=e.slice(n+1)),u.hasOwnProperty(t)?{space:u[t],local:e}:e}function f(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===l&&t.documentElement.namespaceURI===l?t.createElement(e):t.createElementNS(n,e)}}function p(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function m(e){var t=d(e);return(t.local?p:f)(t)}function h(){}function g(e){return e==null?h:function(){return this.querySelector(e)}}function _(e){typeof e!=`function`&&(e=g(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=Array(o),c,l,u=0;u<o;++u)(c=a[u])&&(l=e.call(c,c.__data__,u,a))&&(`__data__`in c&&(l.__data__=c.__data__),s[u]=l);return new Q(r,this._parents)}function v(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function y(){return[]}function b(e){return e==null?y:function(){return this.querySelectorAll(e)}}function x(e){return function(){return v(e.apply(this,arguments))}}function S(e){e=typeof e==`function`?x(e):b(e);for(var t=this._groups,n=t.length,r=[],i=[],a=0;a<n;++a)for(var o=t[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&(r.push(e.call(c,c.__data__,l,o)),i.push(c));return new Q(r,i)}function C(e){return function(){return this.matches(e)}}function w(e){return function(t){return t.matches(e)}}var T=Array.prototype.find;function E(e){return function(){return T.call(this.children,e)}}function D(){return this.firstElementChild}function ee(e){return this.select(e==null?D:E(typeof e==`function`?e:w(e)))}var te=Array.prototype.filter;function ne(){return Array.from(this.children)}function re(e){return function(){return te.call(this.children,e)}}function ie(e){return this.selectAll(e==null?ne:re(typeof e==`function`?e:w(e)))}function ae(e){typeof e!=`function`&&(e=C(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new Q(r,this._parents)}function O(e){return Array(e.length)}function oe(){return new Q(this._enter||this._groups.map(O),this._parents)}function k(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}k.prototype={constructor:k,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function se(e){return function(){return e}}function ce(e,t,n,r,i,a){for(var o=0,s,c=t.length,l=a.length;o<l;++o)(s=t[o])?(s.__data__=a[o],r[o]=s):n[o]=new k(e,a[o]);for(;o<c;++o)(s=t[o])&&(i[o]=s)}function le(e,t,n,r,i,a,o){var s,c,l=new Map,u=t.length,d=a.length,f=Array(u),p;for(s=0;s<u;++s)(c=t[s])&&(f[s]=p=o.call(c,c.__data__,s,t)+``,l.has(p)?i[s]=c:l.set(p,c));for(s=0;s<d;++s)p=o.call(e,a[s],s,a)+``,(c=l.get(p))?(r[s]=c,c.__data__=a[s],l.delete(p)):n[s]=new k(e,a[s]);for(s=0;s<u;++s)(c=t[s])&&l.get(f[s])===c&&(i[s]=c)}function ue(e){return e.__data__}function de(e,t){if(!arguments.length)return Array.from(this,ue);var n=t?le:ce,r=this._parents,i=this._groups;typeof e!=`function`&&(e=se(e));for(var a=i.length,o=Array(a),s=Array(a),c=Array(a),l=0;l<a;++l){var u=r[l],d=i[l],f=d.length,p=A(e.call(u,u&&u.__data__,l,r)),m=p.length,h=s[l]=Array(m),g=o[l]=Array(m);n(u,d,h,g,c[l]=Array(f),p,t);for(var _=0,v=0,y,b;_<m;++_)if(y=h[_]){for(_>=v&&(v=_+1);!(b=g[v])&&++v<m;);y._next=b||null}}return o=new Q(o,r),o._enter=s,o._exit=c,o}function A(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function j(){return new Q(this._exit||this._groups.map(O),this._parents)}function M(e,t,n){var r=this.enter(),i=this,a=this.exit();return typeof e==`function`?(r=e(r),r&&=r.selection()):r=r.append(e+``),t!=null&&(i=t(i),i&&=i.selection()),n==null?a.remove():n(a),r&&i?r.merge(i).order():i}function N(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,a=r.length,o=Math.min(i,a),s=Array(i),c=0;c<o;++c)for(var l=n[c],u=r[c],d=l.length,f=s[c]=Array(d),p,m=0;m<d;++m)(p=l[m]||u[m])&&(f[m]=p);for(;c<i;++c)s[c]=n[c];return new Q(s,this._parents)}function P(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,a=r[i],o;--i>=0;)(o=r[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function F(e){e||=I;function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}for(var n=this._groups,r=n.length,i=Array(r),a=0;a<r;++a){for(var o=n[a],s=o.length,c=i[a]=Array(s),l,u=0;u<s;++u)(l=o[u])&&(c[u]=l);c.sort(t)}return new Q(i,this._parents).order()}function I(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function L(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function R(){return Array.from(this)}function z(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}return null}function B(){let e=0;for(let t of this)++e;return e}function V(){return!this.node()}function H(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],a=0,o=i.length,s;a<o;++a)(s=i[a])&&e.call(s,s.__data__,a,i);return this}function fe(e){return function(){this.removeAttribute(e)}}function pe(e){return function(){this.removeAttributeNS(e.space,e.local)}}function me(e,t){return function(){this.setAttribute(e,t)}}function he(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function ge(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function _e(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function ve(e,t){var n=d(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?pe:fe:typeof t==`function`?n.local?_e:ge:n.local?he:me)(n,t))}function U(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function ye(e){return function(){this.style.removeProperty(e)}}function be(e,t,n){return function(){this.style.setProperty(e,t,n)}}function xe(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function Se(e,t,n){return arguments.length>1?this.each((t==null?ye:typeof t==`function`?xe:be)(e,t,n??``)):Ce(this.node(),e)}function Ce(e,t){return e.style.getPropertyValue(t)||U(e).getComputedStyle(e,null).getPropertyValue(t)}function we(e){return function(){delete this[e]}}function Te(e,t){return function(){this[e]=t}}function Ee(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function De(e,t){return arguments.length>1?this.each((t==null?we:typeof t==`function`?Ee:Te)(e,t)):this.node()[e]}function W(e){return e.trim().split(/^|\s+/)}function G(e){return e.classList||new K(e)}function K(e){this._node=e,this._names=W(e.getAttribute(`class`)||``)}K.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute(`class`,this._names.join(` `)))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute(`class`,this._names.join(` `)))},contains:function(e){return this._names.indexOf(e)>=0}};function q(e,t){for(var n=G(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function J(e,t){for(var n=G(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function Oe(e){return function(){q(this,e)}}function ke(e){return function(){J(this,e)}}function Ae(e,t){return function(){(t.apply(this,arguments)?q:J)(this,e)}}function je(e,t){var n=W(e+``);if(arguments.length<2){for(var r=G(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t==`function`?Ae:t?Oe:ke)(n,t))}function Me(){this.textContent=``}function Ne(e){return function(){this.textContent=e}}function Pe(e){return function(){var t=e.apply(this,arguments);this.textContent=t??``}}function Fe(e){return arguments.length?this.each(e==null?Me:(typeof e==`function`?Pe:Ne)(e)):this.node().textContent}function Ie(){this.innerHTML=``}function Le(e){return function(){this.innerHTML=e}}function Re(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??``}}function ze(e){return arguments.length?this.each(e==null?Ie:(typeof e==`function`?Re:Le)(e)):this.node().innerHTML}function Be(){this.nextSibling&&this.parentNode.appendChild(this)}function Ve(){return this.each(Be)}function He(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Ue(){return this.each(He)}function We(e){var t=typeof e==`function`?e:m(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Ge(){return null}function Ke(e,t){var n=typeof e==`function`?e:m(e),r=t==null?Ge:typeof t==`function`?t:g(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function qe(){var e=this.parentNode;e&&e.removeChild(this)}function Je(){return this.each(qe)}function Ye(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Xe(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Ze(e){return this.select(e?Xe:Ye)}function Qe(e){return arguments.length?this.property(`__data__`,e):this.node().__data__}function $e(e){return function(t){e.call(this,t,this.__data__)}}function et(e){return e.trim().split(/^|\s+/).map(function(e){var t=``,n=e.indexOf(`.`);return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}function tt(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,a;n<i;++n)a=t[n],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++r]=a;++r?t.length=r:delete this.__on}}}function nt(e,t,n){return function(){var r=this.__on,i,a=$e(t);if(r){for(var o=0,s=r.length;o<s;++o)if((i=r[o]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),i.value=t;return}}this.addEventListener(e.type,a,n),i={type:e.type,name:e.name,value:t,listener:a,options:n},r?r.push(i):this.__on=[i]}}function rt(e,t,n){var r=et(e+``),i,a=r.length,o;if(arguments.length<2){var s=this.node().__on;if(s){for(var c=0,l=s.length,u;c<l;++c)for(i=0,u=s[c];i<a;++i)if((o=r[i]).type===u.type&&o.name===u.name)return u.value}}else{for(s=t?nt:tt,i=0;i<a;++i)this.each(s(r[i],t,n));return this}}function Y(e,t,n){var r=U(e),i=r.CustomEvent;typeof i==`function`?i=new i(t,n):(i=r.document.createEvent(`Event`),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function it(e,t){return function(){return Y(this,e,t)}}function X(e,t){return function(){return Y(this,e,t.apply(this,arguments))}}function at(e,t){return this.each((typeof t==`function`?X:it)(e,t))}function*ot(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length,o;i<a;++i)(o=r[i])&&(yield o)}var Z=[null];function Q(e,t){this._groups=e,this._parents=t}function st(){return new Q([[document.documentElement]],Z)}function ct(){return this}Q.prototype=st.prototype={constructor:Q,select:_,selectAll:S,selectChild:ee,selectChildren:ie,filter:ae,data:de,enter:oe,exit:j,join:M,merge:N,selection:ct,order:P,sort:F,call:L,nodes:R,node:z,size:B,empty:V,each:H,attr:ve,style:Se,property:De,classed:je,text:Fe,html:ze,raise:Ve,lower:Ue,append:We,insert:Ke,remove:Je,clone:Ze,datum:Qe,on:rt,dispatch:at,[Symbol.iterator]:ot};function lt(e){return typeof e==`string`?new Q([[document.querySelector(e)]],[document.documentElement]):new Q([[e]],Z)}var ut=0;function dt(){return new $}function $(){this._=`@`+(++ut).toString(36)}$.prototype=dt.prototype={constructor:$,get:function(e){for(var t=this._;!(t in e);)if(!(e=e.parentNode))return;return e[t]},set:function(e,t){return e[this._]=t},remove:function(e){return this._ in e&&delete e[this._]},toString:function(){return this._}};export{r as i,o as n,s as r,lt as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as e,i as t,n,o as r,r as i,s as a,t as o}from"./chunk-KQLB2F66-BUek3IRk.js";import{r as s}from"./chunk-M57EVK23-kkpP5oug.js";import{a as c,f as l,o as u}from"./chunk-DQASFODM-BFdXY5sX.js";import{a as d,i as f,n as p}from"./chunk-LEVMRMFU-Bdcwz9fS.js";import{c as m}from"./chunk-AXFCVDMN-CjJsv3jB.js";import"./chunk-X4PVCEUW-BeLfETDx.js";import"./chunk-STOXU5M4-B3abfbnH.js";import"./chunk-R3KSYZAL-B7SUqqLI.js";import"./chunk-6MUBBAK2-BczXkMV-.js";import{b as h}from"./chunk-BG4553SI-FBaleaLz.js";import{n as g}from"./d3-selection-DfFLTR9d.js";import{n as _}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{$ as v,A as ee,B as y,C as b,D as x,E as te,F as ne,G as re,H as S,I as ie,J as ae,K as oe,L as se,M as ce,N as le,O as ue,P as de,Q as C,R as fe,S as pe,T as me,U as he,V as ge,W as _e,X as ve,Y as ye,Z as w,_ as be,a as T,b as xe,c as Se,d as Ce,et as E,f as D,g as we,h as Te,i as O,it as Ee,j as De,k as Oe,l as ke,m as Ae,n as k,nt as je,o as A,p as Me,q as Ne,r as j,rt as Pe,s as Fe,t as M,tt as N,u as Ie,v as Le,w as Re,x as ze,y as Be,z as P}from"./graphlib-DoDw2DoG.js";var Ve=/\s/;function He(e){for(var t=e.length;t--&&Ve.test(e.charAt(t)););return t}var Ue=/^\s+/;function We(e){return e&&e.slice(0,He(e)+1).replace(Ue,``)}var Ge=NaN,Ke=/^[-+]0x[0-9a-f]+$/i,qe=/^0b[01]+$/i,Je=/^0o[0-7]+$/i,Ye=parseInt;function Xe(e){if(typeof e==`number`)return e;if(E(e))return Ge;if(w(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=w(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=We(e);var n=qe.test(e);return n||Je.test(e)?Ye(e.slice(2),n?2:8):Ke.test(e)?Ge:+e}var Ze=1/0,Qe=17976931348623157e292;function F(e){return e?(e=Xe(e),e===Ze||e===-Ze?(e<0?-1:1)*Qe:e===e?e:0):e===0?e:0}function $e(e){var t=F(e),n=t%1;return t===t?n?t-n:t:0}var et=Object.create,tt=function(){function e(){}return function(t){if(!w(t))return{};if(et)return et(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function nt(e,t){var n=-1,r=e.length;for(t||=Array(r);++n<r;)t[n]=e[n];return t}function I(e,t,n){t==`__proto__`&&Ne?Ne(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var rt=Object.prototype.hasOwnProperty;function L(e,t,n){var r=e[t];(!(rt.call(e,t)&&S(r,n))||n===void 0&&!(t in e))&&I(e,t,n)}function R(e,t,n,r){var i=!n;n||={};for(var a=-1,o=t.length;++a<o;){var s=t[a],c=r?r(n[s],e[s],s,n,e):void 0;c===void 0&&(c=e[s]),i?I(n,s,c):L(n,s,c)}return n}function z(e,t,n){if(!w(n))return!1;var r=typeof t;return(r==`number`?P(n)&&he(t,n.length):r==`string`&&t in n)?S(n[t],e):!1}function it(e){return y(function(t,n){var r=-1,i=n.length,a=i>1?n[i-1]:void 0,o=i>2?n[2]:void 0;for(a=e.length>3&&typeof a==`function`?(i--,a):void 0,o&&z(n[0],n[1],o)&&(a=i<3?void 0:a,i=1),t=Object(t);++r<i;){var s=n[r];s&&e(t,s,r,a)}return t})}function at(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var ot=Object.prototype.hasOwnProperty;function st(e){if(!w(e))return at(e);var t=fe(e),n=[];for(var r in e)(r!=`constructor`||!t&&ot.call(e,r))&&n.push(r);return n}function B(e){return P(e)?ce(e,!0):st(e)}function V(e){return e!=null&&e.length?b(e,1):[]}function ct(e){return oe(ge(e,void 0,V),e+``)}var lt=De(Object.getPrototypeOf,Object),ut=`[object Object]`,dt=Function.prototype,ft=Object.prototype,pt=dt.toString,mt=ft.hasOwnProperty,ht=pt.call(Object);function gt(e){if(!N(e)||je(e)!=ut)return!1;var t=lt(e);if(t===null)return!0;var n=mt.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&pt.call(n)==ht}var _t=RegExp(`[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]`);function vt(e){return _t.test(e)}function yt(e,t){return e&&R(t,Oe(t),e)}function bt(e,t){return e&&R(t,B(t),e)}var xt=typeof exports==`object`&&exports&&!exports.nodeType&&exports,St=xt&&typeof module==`object`&&module&&!module.nodeType&&module,Ct=St&&St.exports===xt?Ee.Buffer:void 0,wt=Ct?Ct.allocUnsafe:void 0;function Tt(e,t){if(t)return e.slice();var n=e.length,r=wt?wt(n):new e.constructor(n);return e.copy(r),r}function Et(e,t){return R(e,xe(e),t)}var Dt=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)Re(t,xe(e)),e=lt(e);return t}:ze;function Ot(e,t){return R(e,Dt(e),t)}function kt(e){return Be(e,B,Dt)}var At=Object.prototype.hasOwnProperty;function jt(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]==`string`&&At.call(e,`index`)&&(n.index=e.index,n.input=e.input),n}function Mt(e){var t=new e.constructor(e.byteLength);return new we(t).set(new we(e)),t}function Nt(e,t){var n=t?Mt(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var Pt=/\w*$/;function Ft(e){var t=new e.constructor(e.source,Pt.exec(e));return t.lastIndex=e.lastIndex,t}var It=Pe?Pe.prototype:void 0,Lt=It?It.valueOf:void 0;function Rt(e){return Lt?Object(Lt.call(e)):{}}function zt(e,t){var n=t?Mt(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var Bt=`[object Boolean]`,Vt=`[object Date]`,Ht=`[object Map]`,Ut=`[object Number]`,Wt=`[object RegExp]`,Gt=`[object Set]`,Kt=`[object String]`,qt=`[object Symbol]`,Jt=`[object ArrayBuffer]`,Yt=`[object DataView]`,Xt=`[object Float32Array]`,Zt=`[object Float64Array]`,Qt=`[object Int8Array]`,$t=`[object Int16Array]`,en=`[object Int32Array]`,tn=`[object Uint8Array]`,nn=`[object Uint8ClampedArray]`,rn=`[object Uint16Array]`,an=`[object Uint32Array]`;function on(e,t,n){var r=e.constructor;switch(t){case Jt:return Mt(e);case Bt:case Vt:return new r(+e);case Yt:return Nt(e,n);case Xt:case Zt:case Qt:case $t:case en:case tn:case nn:case rn:case an:return zt(e,n);case Ht:return new r;case Ut:case Kt:return new r(e);case Wt:return Ft(e);case Gt:return new r;case qt:return Rt(e)}}function sn(e){return typeof e.constructor==`function`&&!fe(e)?tt(lt(e)):{}}var cn=`[object Map]`;function ln(e){return N(e)&&be(e)==cn}var un=de&&de.isMap,dn=un?ne(un):ln,fn=`[object Set]`;function pn(e){return N(e)&&be(e)==fn}var mn=de&&de.isSet,hn=mn?ne(mn):pn,gn=1,_n=2,vn=4,yn=`[object Arguments]`,bn=`[object Array]`,xn=`[object Boolean]`,Sn=`[object Date]`,Cn=`[object Error]`,wn=`[object Function]`,Tn=`[object GeneratorFunction]`,En=`[object Map]`,Dn=`[object Number]`,On=`[object Object]`,kn=`[object RegExp]`,An=`[object Set]`,jn=`[object String]`,Mn=`[object Symbol]`,Nn=`[object WeakMap]`,Pn=`[object ArrayBuffer]`,Fn=`[object DataView]`,In=`[object Float32Array]`,Ln=`[object Float64Array]`,Rn=`[object Int8Array]`,zn=`[object Int16Array]`,Bn=`[object Int32Array]`,Vn=`[object Uint8Array]`,Hn=`[object Uint8ClampedArray]`,Un=`[object Uint16Array]`,Wn=`[object Uint32Array]`,H={};H[yn]=H[bn]=H[Pn]=H[Fn]=H[xn]=H[Sn]=H[In]=H[Ln]=H[Rn]=H[zn]=H[Bn]=H[En]=H[Dn]=H[On]=H[kn]=H[An]=H[jn]=H[Mn]=H[Vn]=H[Hn]=H[Un]=H[Wn]=!0,H[Cn]=H[wn]=H[Nn]=!1;function U(e,t,n,r,i,a){var o,s=t&gn,c=t&_n,l=t&vn;if(n&&(o=i?n(e,r,i,a):n(e)),o!==void 0)return o;if(!w(e))return e;var u=C(e);if(u){if(o=jt(e),!s)return nt(e,o)}else{var d=be(e),f=d==wn||d==Tn;if(ie(e))return Tt(e,s);if(d==On||d==yn||f&&!i){if(o=c||f?{}:sn(e),!s)return c?Ot(e,bt(o,e)):Et(e,yt(o,e))}else{if(!H[d])return i?e:{};o=on(e,d,s)}}a||=new pe;var p=a.get(e);if(p)return p;a.set(e,o),hn(e)?e.forEach(function(r){o.add(U(r,t,n,r,e,a))}):dn(e)&&e.forEach(function(r,i){o.set(i,U(r,t,n,i,e,a))});var m=u?void 0:(l?c?kt:Le:c?B:Oe)(e);return re(m||e,function(r,i){m&&(i=r,r=e[i]),L(o,i,U(r,t,n,i,e,a))}),o}var Gn=1,Kn=4;function qn(e){return U(e,Gn|Kn)}var Jn=function(){return Ee.Date.now()},Yn=Object.prototype,Xn=Yn.hasOwnProperty,Zn=y(function(e,t){e=Object(e);var n=-1,r=t.length,i=r>2?t[2]:void 0;for(i&&z(t[0],t[1],i)&&(r=1);++n<r;)for(var a=t[n],o=B(a),s=-1,c=o.length;++s<c;){var l=o[s],u=e[l];(u===void 0||S(u,Yn[l])&&!Xn.call(e,l))&&(e[l]=a[l])}return e});function Qn(e,t,n){(n!==void 0&&!S(e[t],n)||n===void 0&&!(t in e))&&I(e,t,n)}function $n(e,t){if((t!==`constructor`||typeof e[t]!=`function`)&&t!=`__proto__`)return e[t]}function er(e){return R(e,B(e))}function tr(e,t,n,r,i,a,o){var s=$n(e,n),c=$n(t,n),l=o.get(c);if(l)Qn(e,n,l);else{var u=a?a(s,c,n+``,e,t,o):void 0,d=u===void 0;if(d){var f=C(c),p=!f&&ie(c),m=!f&&!p&&le(c);u=c,f||p||m?C(s)?u=s:Se(s)?u=nt(s):p?(d=!1,u=Tt(c,!0)):m?(d=!1,u=zt(c,!0)):u=[]:gt(c)||se(c)?(u=s,se(s)?u=er(s):(!w(s)||ye(s))&&(u=sn(c))):d=!1}d&&(o.set(c,u),i(u,c,r,a,o),o.delete(c)),Qn(e,n,u)}}function nr(e,t,n,r,i){e!==t&&Ce(t,function(a,o){if(i||=new pe,w(a))tr(e,t,o,n,nr,r,i);else{var s=r?r($n(e,o),a,o+``,e,t,i):void 0;s===void 0&&(s=a),Qn(e,o,s)}},B)}function W(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}function rr(e){return function(t,n,r){var i=Object(t);if(!P(t)){var a=D(n,3);t=Oe(t),n=function(e){return a(i[e],e,i)}}var o=e(t,n,r);return o>-1?i[a?t[o]:o]:void 0}}var ir=Math.max;function ar(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var i=n==null?0:$e(n);return i<0&&(i=ir(r+i,0)),_e(e,D(t,3),i)}var or=rr(ar);function sr(e,t){var n=-1,r=P(e)?Array(e.length):[];return ke(e,function(e,i,a){r[++n]=t(e,i,a)}),r}function G(e,t){return(C(e)?v:sr)(e,D(t,3))}function cr(e,t){return e==null?e:Ce(e,Fe(t),B)}function lr(e,t){return e&&Ie(e,Fe(t))}function ur(e,t){return e>t}var dr=Object.prototype.hasOwnProperty;function fr(e,t){return e!=null&&dr.call(e,t)}function pr(e,t){return e!=null&&Te(e,t,fr)}var mr=`[object String]`;function hr(e){return typeof e==`string`||!C(e)&&N(e)&&je(e)==mr}function gr(e,t){return e<t}function K(e,t){var n={};return t=D(t,3),Ie(e,function(e,r,i){I(n,r,t(e,r,i))}),n}function _r(e,t,n){for(var r=-1,i=e.length;++r<i;){var a=e[r],o=t(a);if(o!=null&&(s===void 0?o===o&&!E(o):n(o,s)))var s=o,c=a}return c}function q(e){return e&&e.length?_r(e,ve,ur):void 0}var vr=it(function(e,t,n){nr(e,t,n)});function J(e){return e&&e.length?_r(e,ve,gr):void 0}function yr(e,t){return e&&e.length?_r(e,D(t,2),gr):void 0}function br(e,t,n,r){if(!w(e))return e;t=x(t,e);for(var i=-1,a=t.length,o=a-1,s=e;s!=null&&++i<a;){var c=te(t[i]),l=n;if(c===`__proto__`||c===`constructor`||c===`prototype`)return e;if(i!=o){var u=s[c];l=r?r(u,c,s):void 0,l===void 0&&(l=w(u)?u:he(t[i+1])?[]:{})}L(s,c,l),s=s[c]}return e}function xr(e,t,n){for(var r=-1,i=t.length,a={};++r<i;){var o=t[r],s=me(e,o);n(s,o)&&br(a,x(o,e),s)}return a}function Sr(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}function Cr(e,t){if(e!==t){var n=e!==void 0,r=e===null,i=e===e,a=E(e),o=t!==void 0,s=t===null,c=t===t,l=E(t);if(!s&&!l&&!a&&e>t||a&&o&&c&&!s&&!l||r&&o&&c||!n&&c||!i)return 1;if(!r&&!a&&!l&&e<t||l&&n&&i&&!r&&!a||s&&n&&i||!o&&i||!c)return-1}return 0}function wr(e,t,n){for(var r=-1,i=e.criteria,a=t.criteria,o=i.length,s=n.length;++r<o;){var c=Cr(i[r],a[r]);if(c)return r>=s?c:c*(n[r]==`desc`?-1:1)}return e.index-t.index}function Tr(e,t,n){t=t.length?v(t,function(e){return C(e)?function(t){return me(t,e.length===1?e[0]:e)}:e}):[ve];var r=-1;return t=v(t,ne(D)),Sr(sr(e,function(e,n,i){return{criteria:v(t,function(t){return t(e)}),index:++r,value:e}}),function(e,t){return wr(e,t,n)})}var Er=Me(`length`),Dr=`\\ud800-\\udfff`,Or=`\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff`,kr=`\\ufe0e\\ufe0f`,Ar=`[`+Dr+`]`,jr=`[`+Or+`]`,Mr=`\\ud83c[\\udffb-\\udfff]`,Nr=`(?:`+jr+`|`+Mr+`)`,Pr=`[^`+Dr+`]`,Fr=`(?:\\ud83c[\\udde6-\\uddff]){2}`,Ir=`[\\ud800-\\udbff][\\udc00-\\udfff]`,Lr=`\\u200d`,Rr=Nr+`?`,zr=`[`+kr+`]?`,Br=`(?:`+Lr+`(?:`+[Pr,Fr,Ir].join(`|`)+`)`+zr+Rr+`)*`,Vr=zr+Rr+Br,Hr=`(?:`+[Pr+jr+`?`,jr,Fr,Ir,Ar].join(`|`)+`)`,Ur=RegExp(Mr+`(?=`+Mr+`)|`+Hr+Vr,`g`);function Wr(e){for(var t=Ur.lastIndex=0;Ur.test(e);)++t;return t}function Gr(e){return vt(e)?Wr(e):Er(e)}function Kr(e,t){return xr(e,t,function(t,n){return Ae(e,n)})}var qr=ct(function(e,t){return e==null?{}:Kr(e,t)}),Jr=Math.ceil,Yr=Math.max;function Xr(e,t,n,r){for(var i=-1,a=Yr(Jr((t-e)/(n||1)),0),o=Array(a);a--;)o[r?a:++i]=e,e+=n;return o}function Zr(e){return function(t,n,r){return r&&typeof r!=`number`&&z(t,n,r)&&(n=r=void 0),t=F(t),n===void 0?(n=t,t=0):n=F(n),r=r===void 0?t<n?1:-1:F(r),Xr(t,n,r,e)}}var Y=Zr(),Qr=`[object Map]`,$r=`[object Set]`;function ei(e){if(e==null)return 0;if(P(e))return hr(e)?Gr(e):e.length;var t=be(e);return t==Qr||t==$r?e.size:ee(e).length}var X=y(function(e,t){if(e==null)return[];var n=t.length;return n>1&&z(e,t[0],t[1])?t=[]:n>2&&z(t[0],t[1],t[2])&&(t=[t[0]]),Tr(e,b(t,1),[])}),ti=0;function ni(e){var t=++ti;return ue(e)+t}function ri(e,t,n){for(var r=-1,i=e.length,a=t.length,o={};++r<i;){var s=r<a?t[r]:void 0;n(o,e[r],s)}return o}function ii(e,t){return ri(e||[],t||[],L)}var ai=class{constructor(){var e={};e._next=e._prev=e,this._sentinel=e}dequeue(){var e=this._sentinel,t=e._prev;if(t!==e)return oi(t),t}enqueue(e){var t=this._sentinel;e._prev&&e._next&&oi(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t}toString(){for(var e=[],t=this._sentinel,n=t._prev;n!==t;)e.push(JSON.stringify(n,si)),n=n._prev;return`[`+e.join(`, `)+`]`}};function oi(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function si(e,t){if(e!==`_next`&&e!==`_prev`)return t}var ci=ae(1);function li(e,t){if(e.nodeCount()<=1)return[];var n=fi(e,t||ci);return V(G(ui(n.graph,n.buckets,n.zeroIdx),function(t){return e.outEdges(t.v,t.w)}))}function ui(e,t,n){for(var r=[],i=t[t.length-1],a=t[0],o;e.nodeCount();){for(;o=a.dequeue();)di(e,t,n,o);for(;o=i.dequeue();)di(e,t,n,o);if(e.nodeCount()){for(var s=t.length-2;s>0;--s)if(o=t[s].dequeue(),o){r=r.concat(di(e,t,n,o,!0));break}}}return r}function di(e,t,n,r,i){var a=i?[]:void 0;return A(e.inEdges(r.v),function(r){var o=e.edge(r),s=e.node(r.v);i&&a.push({v:r.v,w:r.w}),s.out-=o,pi(t,n,s)}),A(e.outEdges(r.v),function(r){var i=e.edge(r),a=r.w,o=e.node(a);o.in-=i,pi(t,n,o)}),e.removeNode(r.v),a}function fi(e,t){var n=new M,r=0,i=0;A(e.nodes(),function(e){n.setNode(e,{v:e,in:0,out:0})}),A(e.edges(),function(e){var a=n.edge(e.v,e.w)||0,o=t(e),s=a+o;n.setEdge(e.v,e.w,s),i=Math.max(i,n.node(e.v).out+=o),r=Math.max(r,n.node(e.w).in+=o)});var a=Y(i+r+3).map(function(){return new ai}),o=r+1;return A(n.nodes(),function(e){pi(a,o,n.node(e))}),{graph:n,buckets:a,zeroIdx:o}}function pi(e,t,n){n.out?n.in?e[n.out-n.in+t].enqueue(n):e[e.length-1].enqueue(n):e[0].enqueue(n)}function mi(e){var t=e.graph().acyclicer===`greedy`?li(e,n(e)):hi(e);A(t,function(t){var n=e.edge(t);e.removeEdge(t),n.forwardName=t.name,n.reversed=!0,e.setEdge(t.w,t.v,n,ni(`rev`))});function n(e){return function(t){return e.edge(t).weight}}}function hi(e){var t=[],n={},r={};function i(a){Object.prototype.hasOwnProperty.call(r,a)||(r[a]=!0,n[a]=!0,A(e.outEdges(a),function(e){Object.prototype.hasOwnProperty.call(n,e.w)?t.push(e):i(e.w)}),delete n[a])}return A(e.nodes(),i),t}function gi(e){A(e.edges(),function(t){var n=e.edge(t);if(n.reversed){e.removeEdge(t);var r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}})}function Z(e,t,n,r){var i;do i=ni(r);while(e.hasNode(i));return n.dummy=t,e.setNode(i,n),i}function _i(e){var t=new M().setGraph(e.graph());return A(e.nodes(),function(n){t.setNode(n,e.node(n))}),A(e.edges(),function(n){var r=t.edge(n.v,n.w)||{weight:0,minlen:1},i=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})}),t}function vi(e){var t=new M({multigraph:e.isMultigraph()}).setGraph(e.graph());return A(e.nodes(),function(n){e.children(n).length||t.setNode(n,e.node(n))}),A(e.edges(),function(n){t.setEdge(n,e.edge(n))}),t}function yi(e,t){var n=e.x,r=e.y,i=t.x-n,a=t.y-r,o=e.width/2,s=e.height/2;if(!i&&!a)throw Error(`Not possible to find intersection inside of the rectangle`);var c,l;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),c=s*i/a,l=s):(i<0&&(o=-o),c=o,l=o*a/i),{x:n+c,y:r+l}}function bi(e){var t=G(Y(wi(e)+1),function(){return[]});return A(e.nodes(),function(n){var r=e.node(n),i=r.rank;j(i)||(t[i][r.order]=n)}),t}function xi(e){var t=J(G(e.nodes(),function(t){return e.node(t).rank}));A(e.nodes(),function(n){var r=e.node(n);pr(r,`rank`)&&(r.rank-=t)})}function Si(e){var t=J(G(e.nodes(),function(t){return e.node(t).rank})),n=[];A(e.nodes(),function(r){var i=e.node(r).rank-t;n[i]||(n[i]=[]),n[i].push(r)});var r=0,i=e.graph().nodeRankFactor;A(n,function(t,n){j(t)&&n%i!==0?--r:r&&A(t,function(t){e.node(t).rank+=r})})}function Ci(e,t,n,r){var i={width:0,height:0};return arguments.length>=4&&(i.rank=n,i.order=r),Z(e,`border`,i,t)}function wi(e){return q(G(e.nodes(),function(t){var n=e.node(t).rank;if(!j(n))return n}))}function Ti(e,t){var n={lhs:[],rhs:[]};return A(e,function(e){t(e)?n.lhs.push(e):n.rhs.push(e)}),n}function Ei(e,t){var n=Jn();try{return t()}finally{console.log(e+` time: `+(Jn()-n)+`ms`)}}function Di(e,t){return t()}function Oi(e){function t(n){var r=e.children(n),i=e.node(n);if(r.length&&A(r,t),Object.prototype.hasOwnProperty.call(i,`minRank`)){i.borderLeft=[],i.borderRight=[];for(var a=i.minRank,o=i.maxRank+1;a<o;++a)ki(e,`borderLeft`,`_bl`,n,i,a),ki(e,`borderRight`,`_br`,n,i,a)}}A(e.children(),t)}function ki(e,t,n,r,i,a){var o={width:0,height:0,rank:a,borderType:t},s=i[t][a-1],c=Z(e,`border`,o,n);i[t][a]=c,e.setParent(c,r),s&&e.setEdge(s,c,{weight:1})}function Ai(e){var t=e.graph().rankdir.toLowerCase();(t===`lr`||t===`rl`)&&Mi(e)}function ji(e){var t=e.graph().rankdir.toLowerCase();(t===`bt`||t===`rl`)&&Pi(e),(t===`lr`||t===`rl`)&&(Ii(e),Mi(e))}function Mi(e){A(e.nodes(),function(t){Ni(e.node(t))}),A(e.edges(),function(t){Ni(e.edge(t))})}function Ni(e){var t=e.width;e.width=e.height,e.height=t}function Pi(e){A(e.nodes(),function(t){Fi(e.node(t))}),A(e.edges(),function(t){var n=e.edge(t);A(n.points,Fi),Object.prototype.hasOwnProperty.call(n,`y`)&&Fi(n)})}function Fi(e){e.y=-e.y}function Ii(e){A(e.nodes(),function(t){Li(e.node(t))}),A(e.edges(),function(t){var n=e.edge(t);A(n.points,Li),Object.prototype.hasOwnProperty.call(n,`x`)&&Li(n)})}function Li(e){var t=e.x;e.x=e.y,e.y=t}function Ri(e){e.graph().dummyChains=[],A(e.edges(),function(t){zi(e,t)})}function zi(e,t){var n=t.v,r=e.node(n).rank,i=t.w,a=e.node(i).rank,o=t.name,s=e.edge(t),c=s.labelRank;if(a!==r+1){e.removeEdge(t);var l=void 0,u,d=0;for(++r;r<a;++d,++r)s.points=[],l={width:0,height:0,edgeLabel:s,edgeObj:t,rank:r},u=Z(e,`edge`,l,`_d`),r===c&&(l.width=s.width,l.height=s.height,l.dummy=`edge-label`,l.labelpos=s.labelpos),e.setEdge(n,u,{weight:s.weight},o),d===0&&e.graph().dummyChains.push(u),n=u;e.setEdge(n,i,{weight:s.weight},o)}}function Bi(e){A(e.graph().dummyChains,function(t){var n=e.node(t),r=n.edgeLabel,i;for(e.setEdge(n.edgeObj,r);n.dummy;)i=e.successors(t)[0],e.removeNode(t),r.points.push({x:n.x,y:n.y}),n.dummy===`edge-label`&&(r.x=n.x,r.y=n.y,r.width=n.width,r.height=n.height),t=i,n=e.node(t)})}function Vi(e){var t={};function n(r){var i=e.node(r);if(Object.prototype.hasOwnProperty.call(t,r))return i.rank;t[r]=!0;var a=J(G(e.outEdges(r),function(t){return n(t.w)-e.edge(t).minlen}));return(a===1/0||a==null)&&(a=0),i.rank=a}A(e.sources(),n)}function Q(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}function Hi(e){var t=new M({directed:!1}),n=e.nodes()[0],r=e.nodeCount();t.setNode(n,{});for(var i,a;Ui(t,e)<r;)i=Wi(t,e),a=t.hasNode(i.v)?Q(e,i):-Q(e,i),Gi(t,e,a);return t}function Ui(e,t){function n(r){A(t.nodeEdges(r),function(i){var a=i.v,o=r===a?i.w:a;!e.hasNode(o)&&!Q(t,i)&&(e.setNode(o,{}),e.setEdge(r,o,{}),n(o))})}return A(e.nodes(),n),e.nodeCount()}function Wi(e,t){return yr(t.edges(),function(n){if(e.hasNode(n.v)!==e.hasNode(n.w))return Q(t,n)})}function Gi(e,t,n){A(e.nodes(),function(e){t.node(e).rank+=n})}ae(1),ae(1),Ki.CycleException=qi;function Ki(e){var t={},n={},r=[];function i(a){if(Object.prototype.hasOwnProperty.call(n,a))throw new qi;Object.prototype.hasOwnProperty.call(t,a)||(n[a]=!0,t[a]=!0,A(e.predecessors(a),i),delete n[a],r.push(a))}if(A(e.sinks(),i),ei(t)!==e.nodeCount())throw new qi;return r}function qi(){}qi.prototype=Error();function Ji(e,t,n){C(t)||(t=[t]);var r=(e.isDirected()?e.successors:e.neighbors).bind(e),i=[],a={};return A(t,function(t){if(!e.hasNode(t))throw Error(`Graph does not have node: `+t);Yi(e,t,n===`post`,a,r,i)}),i}function Yi(e,t,n,r,i,a){Object.prototype.hasOwnProperty.call(r,t)||(r[t]=!0,n||a.push(t),A(i(t),function(t){Yi(e,t,n,r,i,a)}),n&&a.push(t))}function Xi(e,t){return Ji(e,t,`post`)}function Zi(e,t){return Ji(e,t,`pre`)}$.initLowLimValues=ta,$.initCutValues=Qi,$.calcCutValue=ea,$.leaveEdge=ra,$.enterEdge=ia,$.exchangeEdges=aa;function $(e){e=_i(e),Vi(e);var t=Hi(e);ta(t),Qi(t,e);for(var n,r;n=ra(t);)r=ia(t,e,n),aa(t,e,n,r)}function Qi(e,t){var n=Xi(e,e.nodes());n=n.slice(0,n.length-1),A(n,function(n){$i(e,t,n)})}function $i(e,t,n){var r=e.node(n).parent;e.edge(n,r).cutvalue=ea(e,t,n)}function ea(e,t,n){var r=e.node(n).parent,i=!0,a=t.edge(n,r),o=0;return a||=(i=!1,t.edge(r,n)),o=a.weight,A(t.nodeEdges(n),function(a){var s=a.v===n,c=s?a.w:a.v;if(c!==r){var l=s===i,u=t.edge(a).weight;if(o+=l?u:-u,sa(e,n,c)){var d=e.edge(n,c).cutvalue;o+=l?-d:d}}}),o}function ta(e,t){arguments.length<2&&(t=e.nodes()[0]),na(e,{},1,t)}function na(e,t,n,r,i){var a=n,o=e.node(r);return t[r]=!0,A(e.neighbors(r),function(i){Object.prototype.hasOwnProperty.call(t,i)||(n=na(e,t,n,i,r))}),o.low=a,o.lim=n++,i?o.parent=i:delete o.parent,n}function ra(e){return or(e.edges(),function(t){return e.edge(t).cutvalue<0})}function ia(e,t,n){var r=n.v,i=n.w;t.hasEdge(r,i)||(r=n.w,i=n.v);var a=e.node(r),o=e.node(i),s=a,c=!1;return a.lim>o.lim&&(s=o,c=!0),yr(T(t.edges(),function(t){return c===ca(e,e.node(t.v),s)&&c!==ca(e,e.node(t.w),s)}),function(e){return Q(t,e)})}function aa(e,t,n,r){var i=n.v,a=n.w;e.removeEdge(i,a),e.setEdge(r.v,r.w,{}),ta(e),Qi(e,t),oa(e,t)}function oa(e,t){var n=Zi(e,or(e.nodes(),function(e){return!t.node(e).parent}));n=n.slice(1),A(n,function(n){var r=e.node(n).parent,i=t.edge(n,r),a=!1;i||(i=t.edge(r,n),a=!0),t.node(n).rank=t.node(r).rank+(a?i.minlen:-i.minlen)})}function sa(e,t,n){return e.hasEdge(t,n)}function ca(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}function la(e){switch(e.graph().ranker){case`network-simplex`:fa(e);break;case`tight-tree`:da(e);break;case`longest-path`:ua(e);break;default:fa(e)}}var ua=Vi;function da(e){Vi(e),Hi(e)}function fa(e){$(e)}function pa(e){var t=Z(e,`root`,{},`_root`),n=ha(e),r=q(O(n))-1,i=2*r+1;e.graph().nestingRoot=t,A(e.edges(),function(t){e.edge(t).minlen*=i});var a=ga(e)+1;A(e.children(),function(o){ma(e,t,i,a,r,n,o)}),e.graph().nodeRankFactor=i}function ma(e,t,n,r,i,a,o){var s=e.children(o);if(!s.length)o!==t&&e.setEdge(t,o,{weight:0,minlen:n});else{var c=Ci(e,`_bt`),l=Ci(e,`_bb`),u=e.node(o);e.setParent(c,o),u.borderTop=c,e.setParent(l,o),u.borderBottom=l,A(s,function(s){ma(e,t,n,r,i,a,s);var u=e.node(s),d=u.borderTop?u.borderTop:s,f=u.borderBottom?u.borderBottom:s,p=u.borderTop?r:2*r,m=d===f?i-a[o]+1:1;e.setEdge(c,d,{weight:p,minlen:m,nestingEdge:!0}),e.setEdge(f,l,{weight:p,minlen:m,nestingEdge:!0})}),e.parent(o)||e.setEdge(t,c,{weight:0,minlen:i+a[o]})}}function ha(e){var t={};function n(r,i){var a=e.children(r);a&&a.length&&A(a,function(e){n(e,i+1)}),t[r]=i}return A(e.children(),function(e){n(e,1)}),t}function ga(e){return k(e.edges(),function(t,n){return t+e.edge(n).weight},0)}function _a(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,A(e.edges(),function(t){e.edge(t).nestingEdge&&e.removeEdge(t)})}function va(e,t,n){var r={},i;A(n,function(n){for(var a=e.parent(n),o,s;a;){if(o=e.parent(a),o?(s=r[o],r[o]=a):(s=i,i=a),s&&s!==a){t.setEdge(s,a);return}a=o}})}function ya(e,t,n){var r=ba(e),i=new M({compound:!0}).setGraph({root:r}).setDefaultNodeLabel(function(t){return e.node(t)});return A(e.nodes(),function(a){var o=e.node(a),s=e.parent(a);(o.rank===t||o.minRank<=t&&t<=o.maxRank)&&(i.setNode(a),i.setParent(a,s||r),A(e[n](a),function(t){var n=t.v===a?t.w:t.v,r=i.edge(n,a),o=j(r)?0:r.weight;i.setEdge(n,a,{weight:e.edge(t).weight+o})}),Object.prototype.hasOwnProperty.call(o,`minRank`)&&i.setNode(a,{borderLeft:o.borderLeft[t],borderRight:o.borderRight[t]}))}),i}function ba(e){for(var t;e.hasNode(t=ni(`_root`)););return t}function xa(e,t){for(var n=0,r=1;r<t.length;++r)n+=Sa(e,t[r-1],t[r]);return n}function Sa(e,t,n){for(var r=ii(n,G(n,function(e,t){return t})),i=V(G(t,function(t){return X(G(e.outEdges(t),function(t){return{pos:r[t.w],weight:e.edge(t).weight}}),`pos`)})),a=1;a<n.length;)a<<=1;var o=2*a-1;--a;var s=G(Array(o),function(){return 0}),c=0;return A(i.forEach(function(e){var t=e.pos+a;s[t]+=e.weight;for(var n=0;t>0;)t%2&&(n+=s[t+1]),t=t-1>>1,s[t]+=e.weight;c+=e.weight*n})),c}function Ca(e){var t={},n=T(e.nodes(),function(t){return!e.children(t).length}),r=G(Y(q(G(n,function(t){return e.node(t).rank}))+1),function(){return[]});function i(n){pr(t,n)||(t[n]=!0,r[e.node(n).rank].push(n),A(e.successors(n),i))}var a=X(n,function(t){return e.node(t).rank});return A(a,i),r}function wa(e,t){return G(t,function(t){var n=e.inEdges(t);if(n.length){var r=k(n,function(t,n){var r=e.edge(n),i=e.node(n.v);return{sum:t.sum+r.weight*i.order,weight:t.weight+r.weight}},{sum:0,weight:0});return{v:t,barycenter:r.sum/r.weight,weight:r.weight}}return{v:t}})}function Ta(e,t){var n={};return A(e,function(e,t){var r=n[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:t};j(e.barycenter)||(r.barycenter=e.barycenter,r.weight=e.weight)}),A(t.edges(),function(e){var t=n[e.v],r=n[e.w];!j(t)&&!j(r)&&(r.indegree++,t.out.push(n[e.w]))}),Ea(T(n,function(e){return!e.indegree}))}function Ea(e){var t=[];function n(e){return function(t){t.merged||(j(t.barycenter)||j(e.barycenter)||t.barycenter>=e.barycenter)&&Da(e,t)}}function r(t){return function(n){n.in.push(t),--n.indegree===0&&e.push(n)}}for(;e.length;){var i=e.pop();t.push(i),A(i.in.reverse(),n(i)),A(i.out,r(i))}return G(T(t,function(e){return!e.merged}),function(e){return qr(e,[`vs`,`i`,`barycenter`,`weight`])})}function Da(e,t){var n=0,r=0;e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=n/r,e.weight=r,e.i=Math.min(t.i,e.i),t.merged=!0}function Oa(e,t){var n=Ti(e,function(e){return Object.prototype.hasOwnProperty.call(e,`barycenter`)}),r=n.lhs,i=X(n.rhs,function(e){return-e.i}),a=[],o=0,s=0,c=0;r.sort(Aa(!!t)),c=ka(a,i,c),A(r,function(e){c+=e.vs.length,a.push(e.vs),o+=e.barycenter*e.weight,s+=e.weight,c=ka(a,i,c)});var l={vs:V(a)};return s&&(l.barycenter=o/s,l.weight=s),l}function ka(e,t,n){for(var r;t.length&&(r=W(t)).i<=n;)t.pop(),e.push(r.vs),n++;return n}function Aa(e){return function(t,n){return t.barycenter<n.barycenter?-1:t.barycenter>n.barycenter?1:e?n.i-t.i:t.i-n.i}}function ja(e,t,n,r){var i=e.children(t),a=e.node(t),o=a?a.borderLeft:void 0,s=a?a.borderRight:void 0,c={};o&&(i=T(i,function(e){return e!==o&&e!==s}));var l=wa(e,i);A(l,function(t){if(e.children(t.v).length){var i=ja(e,t.v,n,r);c[t.v]=i,Object.prototype.hasOwnProperty.call(i,`barycenter`)&&Na(t,i)}});var u=Ta(l,n);Ma(u,c);var d=Oa(u,r);if(o&&(d.vs=V([o,d.vs,s]),e.predecessors(o).length)){var f=e.node(e.predecessors(o)[0]),p=e.node(e.predecessors(s)[0]);Object.prototype.hasOwnProperty.call(d,`barycenter`)||(d.barycenter=0,d.weight=0),d.barycenter=(d.barycenter*d.weight+f.order+p.order)/(d.weight+2),d.weight+=2}return d}function Ma(e,t){A(e,function(e){e.vs=V(e.vs.map(function(e){return t[e]?t[e].vs:e}))})}function Na(e,t){j(e.barycenter)?(e.barycenter=t.barycenter,e.weight=t.weight):(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight)}function Pa(e){var t=wi(e),n=Fa(e,Y(1,t+1),`inEdges`),r=Fa(e,Y(t-1,-1,-1),`outEdges`),i=Ca(e);La(e,i);for(var a=1/0,o,s=0,c=0;c<4;++s,++c){Ia(s%2?n:r,s%4>=2),i=bi(e);var l=xa(e,i);l<a&&(c=0,o=qn(i),a=l)}La(e,o)}function Fa(e,t,n){return G(t,function(t){return ya(e,t,n)})}function Ia(e,t){var n=new M;A(e,function(e){var r=e.graph().root,i=ja(e,r,n,t);A(i.vs,function(t,n){e.node(t).order=n}),va(e,n,i.vs)})}function La(e,t){A(t,function(t){A(t,function(t,n){e.node(t).order=n})})}function Ra(e){var t=Ba(e);A(e.graph().dummyChains,function(n){for(var r=e.node(n),i=r.edgeObj,a=za(e,t,i.v,i.w),o=a.path,s=a.lca,c=0,l=o[c],u=!0;n!==i.w;){if(r=e.node(n),u){for(;(l=o[c])!==s&&e.node(l).maxRank<r.rank;)c++;l===s&&(u=!1)}if(!u){for(;c<o.length-1&&e.node(l=o[c+1]).minRank<=r.rank;)c++;l=o[c]}e.setParent(n,l),n=e.successors(n)[0]}})}function za(e,t,n,r){var i=[],a=[],o=Math.min(t[n].low,t[r].low),s=Math.max(t[n].lim,t[r].lim),c=n,l;do c=e.parent(c),i.push(c);while(c&&(t[c].low>o||s>t[c].lim));for(l=c,c=r;(c=e.parent(c))!==l;)a.push(c);return{path:i.concat(a.reverse()),lca:l}}function Ba(e){var t={},n=0;function r(i){var a=n;A(e.children(i),r),t[i]={low:a,lim:n++}}return A(e.children(),r),t}function Va(e,t){var n={};function r(t,r){var i=0,a=0,o=t.length,s=W(r);return A(r,function(t,c){var l=Ua(e,t),u=l?e.node(l).order:o;(l||t===s)&&(A(r.slice(a,c+1),function(t){A(e.predecessors(t),function(r){var a=e.node(r),o=a.order;(o<i||u<o)&&!(a.dummy&&e.node(t).dummy)&&Wa(n,r,t)})}),a=c+1,i=u)}),r}return k(t,r),n}function Ha(e,t){var n={};function r(t,r,i,a,o){var s;A(Y(r,i),function(r){s=t[r],e.node(s).dummy&&A(e.predecessors(s),function(t){var r=e.node(t);r.dummy&&(r.order<a||r.order>o)&&Wa(n,t,s)})})}function i(t,n){var i=-1,a,o=0;return A(n,function(s,c){if(e.node(s).dummy===`border`){var l=e.predecessors(s);l.length&&(a=e.node(l[0]).order,r(n,o,c,i,a),o=c,i=a)}r(n,o,n.length,a,t.length)}),n}return k(t,i),n}function Ua(e,t){if(e.node(t).dummy)return or(e.predecessors(t),function(t){return e.node(t).dummy})}function Wa(e,t,n){if(t>n){var r=t;t=n,n=r}Object.prototype.hasOwnProperty.call(e,t)||Object.defineProperty(e,t,{enumerable:!0,configurable:!0,value:{},writable:!0});var i=e[t];Object.defineProperty(i,n,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function Ga(e,t,n){if(t>n){var r=t;t=n,n=r}return!!e[t]&&Object.prototype.hasOwnProperty.call(e[t],n)}function Ka(e,t,n,r){var i={},a={},o={};return A(t,function(e){A(e,function(e,t){i[e]=e,a[e]=e,o[e]=t})}),A(t,function(e){var t=-1;A(e,function(e){var s=r(e);if(s.length){s=X(s,function(e){return o[e]});for(var c=(s.length-1)/2,l=Math.floor(c),u=Math.ceil(c);l<=u;++l){var d=s[l];a[e]===e&&t<o[d]&&!Ga(n,e,d)&&(a[d]=e,a[e]=i[e]=i[d],t=o[d])}}})}),{root:i,align:a}}function qa(e,t,n,r,i){var a={},o=Ja(e,t,n,i),s=i?`borderLeft`:`borderRight`;function c(e,t){for(var n=o.nodes(),r=n.pop(),i={};r;)i[r]?e(r):(i[r]=!0,n.push(r),n=n.concat(t(r))),r=n.pop()}function l(e){a[e]=o.inEdges(e).reduce(function(e,t){return Math.max(e,a[t.v]+o.edge(t))},0)}function u(t){var n=o.outEdges(t).reduce(function(e,t){return Math.min(e,a[t.w]-o.edge(t))},1/0),r=e.node(t);n!==1/0&&r.borderType!==s&&(a[t]=Math.max(a[t],n))}return c(l,o.predecessors.bind(o)),c(u,o.successors.bind(o)),A(r,function(e){a[e]=a[n[e]]}),a}function Ja(e,t,n,r){var i=new M,a=e.graph(),o=$a(a.nodesep,a.edgesep,r);return A(t,function(t){var r;A(t,function(t){var a=n[t];if(i.setNode(a),r){var s=n[r],c=i.edge(s,a);i.setEdge(s,a,Math.max(o(e,t,r),c||0))}r=t})}),i}function Ya(e,t){return yr(O(t),function(t){var n=-1/0,r=1/0;return cr(t,function(t,i){var a=eo(e,i)/2;n=Math.max(t+a,n),r=Math.min(t-a,r)}),n-r})}function Xa(e,t){var n=O(t),r=J(n),i=q(n);A([`u`,`d`],function(n){A([`l`,`r`],function(a){var o=n+a,s=e[o],c;if(s!==t){var l=O(s);c=a===`l`?r-J(l):i-q(l),c&&(e[o]=K(s,function(e){return e+c}))}})})}function Za(e,t){return K(e.ul,function(n,r){if(t)return e[t.toLowerCase()][r];var i=X(G(e,r));return(i[1]+i[2])/2})}function Qa(e){var t=bi(e),n=vr(Va(e,t),Ha(e,t)),r={},i;return A([`u`,`d`],function(a){i=a===`u`?t:O(t).reverse(),A([`l`,`r`],function(t){t===`r`&&(i=G(i,function(e){return O(e).reverse()}));var o=(a===`u`?e.predecessors:e.successors).bind(e),s=Ka(e,i,n,o),c=qa(e,i,s.root,s.align,t===`r`);t===`r`&&(c=K(c,function(e){return-e})),r[a+t]=c})}),Xa(r,Ya(e,r)),Za(r,e.graph().align)}function $a(e,t,n){return function(r,i,a){var o=r.node(i),s=r.node(a),c=0,l;if(c+=o.width/2,Object.prototype.hasOwnProperty.call(o,`labelpos`))switch(o.labelpos.toLowerCase()){case`l`:l=-o.width/2;break;case`r`:l=o.width/2}if(l&&(c+=n?l:-l),l=0,c+=(o.dummy?t:e)/2,c+=(s.dummy?t:e)/2,c+=s.width/2,Object.prototype.hasOwnProperty.call(s,`labelpos`))switch(s.labelpos.toLowerCase()){case`l`:l=s.width/2;break;case`r`:l=-s.width/2}return l&&(c+=n?l:-l),l=0,c}}function eo(e,t){return e.node(t).width}function to(e){e=vi(e),no(e),lr(Qa(e),function(t,n){e.node(n).x=t})}function no(e){var t=bi(e),n=e.graph().ranksep,r=0;A(t,function(t){var i=q(G(t,function(t){return e.node(t).height}));A(t,function(t){e.node(t).y=r+i/2}),r+=i+n})}function ro(e,t){var n=t&&t.debugTiming?Ei:Di;n(`layout`,()=>{var t=n(` buildLayoutGraph`,()=>ho(e));n(` runLayout`,()=>io(t,n)),n(` updateInputGraph`,()=>ao(e,t))})}function io(e,t){t(` makeSpaceForEdgeLabels`,()=>go(e)),t(` removeSelfEdges`,()=>To(e)),t(` acyclic`,()=>mi(e)),t(` nestingGraph.run`,()=>pa(e)),t(` rank`,()=>la(vi(e))),t(` injectEdgeLabelProxies`,()=>_o(e)),t(` removeEmptyRanks`,()=>Si(e)),t(` nestingGraph.cleanup`,()=>_a(e)),t(` normalizeRanks`,()=>xi(e)),t(` assignRankMinMax`,()=>vo(e)),t(` removeEdgeLabelProxies`,()=>yo(e)),t(` normalize.run`,()=>Ri(e)),t(` parentDummyChains`,()=>Ra(e)),t(` addBorderSegments`,()=>Oi(e)),t(` order`,()=>Pa(e)),t(` insertSelfEdges`,()=>Eo(e)),t(` adjustCoordinateSystem`,()=>Ai(e)),t(` position`,()=>to(e)),t(` positionSelfEdges`,()=>Do(e)),t(` removeBorderNodes`,()=>wo(e)),t(` normalize.undo`,()=>Bi(e)),t(` fixupEdgeLabelCoords`,()=>So(e)),t(` undoCoordinateSystem`,()=>ji(e)),t(` translateGraph`,()=>bo(e)),t(` assignNodeIntersects`,()=>xo(e)),t(` reversePoints`,()=>Co(e)),t(` acyclic.undo`,()=>gi(e))}function ao(e,t){A(e.nodes(),function(n){var r=e.node(n),i=t.node(n);r&&(r.x=i.x,r.y=i.y,t.children(n).length&&(r.width=i.width,r.height=i.height))}),A(e.edges(),function(n){var r=e.edge(n),i=t.edge(n);r.points=i.points,Object.prototype.hasOwnProperty.call(i,`x`)&&(r.x=i.x,r.y=i.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}var oo=[`nodesep`,`edgesep`,`ranksep`,`marginx`,`marginy`],so={ranksep:50,edgesep:20,nodesep:50,rankdir:`tb`},co=[`acyclicer`,`ranker`,`rankdir`,`align`],lo=[`width`,`height`],uo={width:0,height:0},fo=[`minlen`,`weight`,`width`,`height`,`labeloffset`],po={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:`r`},mo=[`labelpos`];function ho(e){var t=new M({multigraph:!0,compound:!0}),n=ko(e.graph());return t.setGraph(vr({},so,Oo(n,oo),qr(n,co))),A(e.nodes(),function(n){var r=ko(e.node(n));t.setNode(n,Zn(Oo(r,lo),uo)),t.setParent(n,e.parent(n))}),A(e.edges(),function(n){var r=ko(e.edge(n));t.setEdge(n,vr({},po,Oo(r,fo),qr(r,mo)))}),t}function go(e){var t=e.graph();t.ranksep/=2,A(e.edges(),function(n){var r=e.edge(n);r.minlen*=2,r.labelpos.toLowerCase()!==`c`&&(t.rankdir===`TB`||t.rankdir===`BT`?r.width+=r.labeloffset:r.height+=r.labeloffset)})}function _o(e){A(e.edges(),function(t){var n=e.edge(t);if(n.width&&n.height){var r=e.node(t.v);Z(e,`edge-proxy`,{rank:(e.node(t.w).rank-r.rank)/2+r.rank,e:t},`_ep`)}})}function vo(e){var t=0;A(e.nodes(),function(n){var r=e.node(n);r.borderTop&&(r.minRank=e.node(r.borderTop).rank,r.maxRank=e.node(r.borderBottom).rank,t=q(t,r.maxRank))}),e.graph().maxRank=t}function yo(e){A(e.nodes(),function(t){var n=e.node(t);n.dummy===`edge-proxy`&&(e.edge(n.e).labelRank=n.rank,e.removeNode(t))})}function bo(e){var t=1/0,n=0,r=1/0,i=0,a=e.graph(),o=a.marginx||0,s=a.marginy||0;function c(e){var a=e.x,o=e.y,s=e.width,c=e.height;t=Math.min(t,a-s/2),n=Math.max(n,a+s/2),r=Math.min(r,o-c/2),i=Math.max(i,o+c/2)}A(e.nodes(),function(t){c(e.node(t))}),A(e.edges(),function(t){var n=e.edge(t);Object.prototype.hasOwnProperty.call(n,`x`)&&c(n)}),t-=o,r-=s,A(e.nodes(),function(n){var i=e.node(n);i.x-=t,i.y-=r}),A(e.edges(),function(n){var i=e.edge(n);A(i.points,function(e){e.x-=t,e.y-=r}),Object.prototype.hasOwnProperty.call(i,`x`)&&(i.x-=t),Object.prototype.hasOwnProperty.call(i,`y`)&&(i.y-=r)}),a.width=n-t+o,a.height=i-r+s}function xo(e){A(e.edges(),function(t){var n=e.edge(t),r=e.node(t.v),i=e.node(t.w),a,o;n.points?(a=n.points[0],o=n.points[n.points.length-1]):(n.points=[],a=i,o=r),n.points.unshift(yi(r,a)),n.points.push(yi(i,o))})}function So(e){A(e.edges(),function(t){var n=e.edge(t);if(Object.prototype.hasOwnProperty.call(n,`x`))switch((n.labelpos===`l`||n.labelpos===`r`)&&(n.width-=n.labeloffset),n.labelpos){case`l`:n.x-=n.width/2+n.labeloffset;break;case`r`:n.x+=n.width/2+n.labeloffset}})}function Co(e){A(e.edges(),function(t){var n=e.edge(t);n.reversed&&n.points.reverse()})}function wo(e){A(e.nodes(),function(t){if(e.children(t).length){var n=e.node(t),r=e.node(n.borderTop),i=e.node(n.borderBottom),a=e.node(W(n.borderLeft)),o=e.node(W(n.borderRight));n.width=Math.abs(o.x-a.x),n.height=Math.abs(i.y-r.y),n.x=a.x+n.width/2,n.y=r.y+n.height/2}}),A(e.nodes(),function(t){e.node(t).dummy===`border`&&e.removeNode(t)})}function To(e){A(e.edges(),function(t){if(t.v===t.w){var n=e.node(t.v);n.selfEdges||=[],n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}function Eo(e){var t=bi(e);A(t,function(t){var n=0;A(t,function(t,r){var i=e.node(t);i.order=r+n,A(i.selfEdges,function(t){Z(e,`selfedge`,{width:t.label.width,height:t.label.height,rank:i.rank,order:r+ ++n,e:t.e,label:t.label},`_se`)}),delete i.selfEdges})})}function Do(e){A(e.nodes(),function(t){var n=e.node(t);if(n.dummy===`selfedge`){var r=e.node(n.e.v),i=r.x+r.width/2,a=r.y,o=n.x-i,s=r.height/2;e.setEdge(n.e,n.label),e.removeNode(t),n.label.points=[{x:i+2*o/3,y:a-s},{x:i+5*o/6,y:a-s},{x:i+o,y:a},{x:i+5*o/6,y:a+s},{x:i+2*o/3,y:a+s}],n.label.x=n.x,n.label.y=n.y}})}function Oo(e,t){return K(qr(e,t),Number)}function ko(e){var t={};return A(e,function(e,n){t[n.toLowerCase()]=e}),t}var Ao=_((e,t,n)=>Math.max(t,Math.min(n,e)),`clamp`),jo=_((e=`TB`)=>{switch(e){case`BT`:return`bottom`;case`LR`:return`right`;case`RL`:return`left`;default:return`top`}},`getDefaultSelfLoopSide`),Mo=_(e=>e===`flowchart`||e===`flowchart-v2`||e===`stateDiagram`||e===`er`||e===`classDiagram`,`shouldMergeSelfLoopSegments`),No=[`x`,`y`,`width`,`height`,`labelBBox`,`intersect`,`calcIntersect`,`diff`,`clusterNode`],Po=_((e,t,n,r,i)=>{let a=[],o=new Set;if(n.forEach(({start:e,end:t})=>{e!==r&&o.add(e),t!==r&&o.add(t)}),o.forEach(t=>{let n=e.node(t);typeof n?.x==`number`&&typeof n?.y==`number`&&a.push(n)}),a.length===0&&n.forEach(({edge:e})=>{(e.points??[]).forEach(e=>{typeof e?.x==`number`&&typeof e?.y==`number`&&a.push(e)})}),a.length===0)return jo(i);let s=a.reduce((e,t)=>({x:e.x+t.x/a.length,y:e.y+t.y/a.length}),{x:0,y:0}),c=s.x-t.x,l=s.y-t.y;return Math.abs(c)>Math.abs(l)?c>0?`right`:`left`:Math.abs(l)>0?l>0?`bottom`:`top`:jo(i)},`getSelfLoopSide`),Fo=_((e,t=`top`,n=0,r=0)=>{let i=e.x,a=e.y-n,o=e.width/2,s=e.height/2,c=Math.max(36,Math.min(100,e.width*.8)),l=Ao(Math.max(r,e.width*.35),36,c),u=Ao(Math.min(e.width,e.height)*.45,24,48);switch(t){case`bottom`:{let e=a+s;return[{x:i-l/2,y:e},{x:i-l/2,y:e+u},{x:i+l/2,y:e+u},{x:i+l/2,y:e}]}case`right`:{let e=i+o;return[{x:e,y:a-l/2},{x:e+u,y:a-l/2},{x:e+u,y:a+l/2},{x:e,y:a+l/2}]}case`left`:{let e=i-o;return[{x:e,y:a-l/2},{x:e-u,y:a-l/2},{x:e-u,y:a+l/2},{x:e,y:a+l/2}]}default:{let e=a-s;return[{x:i-l/2,y:e},{x:i-l/2,y:e-u},{x:i+l/2,y:e-u},{x:i+l/2,y:e}]}}},`getSelfLoopPoints`),Io=_((e,t,n=`top`,r=0,i={})=>{let a=e.x,o=e.y-r,s=i.width??0,c=i.height??0;switch(n){case`bottom`:return{x:a,y:Math.max(...t.map(e=>e.y))+c/2+4};case`right`:return{x:Math.max(...t.map(e=>e.x))+s/2+4,y:o};case`left`:return{x:Math.min(...t.map(e=>e.x))-s/2-4,y:o};default:return{x:a,y:Math.min(...t.map(e=>e.y))-c/2-4}}},`getSelfLoopLabelPosition`),Lo=_((e,t=0,{mergeSelfLoops:n=!0}={})=>{let r=new Map,i=[],a=e.graph()?.rankdir;return e.edges().forEach(t=>{let a=e.edge(t);if(n&&a.selfLoop){let e=a.selfLoop.id;r.has(e)||r.set(e,[]),r.get(e).push({edge:a,start:t.v,end:t.w})}else i.push({edge:a,start:t.v,end:t.w})}),r.forEach(n=>{if(n.length!==3){n.forEach(e=>i.push(e));return}n.sort((e,t)=>e.edge.selfLoop.order-t.edge.selfLoop.order);let[r,o,s]=n,c=r.edge.originalEdge??o.edge.originalEdge??s.edge.originalEdge??o.edge,l=e.node(c.start);if(!l){n.forEach(e=>i.push(e));return}let u={width:o.edge.width,height:o.edge.height},d=Po(e,l,n,c.start,a),f=Fo(l,d,t,u.width??0),p=Io(l,f,d,t,u),m={...o.edge,...c,id:c.id,points:f,start:c.start,end:c.end,x:p.x,y:p.y,width:u.width,height:u.height,labelStyle:o.edge.labelStyle,fromCluster:r.edge.fromCluster??o.edge.fromCluster??s.edge.fromCluster,toCluster:r.edge.toCluster??o.edge.toCluster??s.edge.toCluster};delete m.selfLoop,delete m.originalEdge,i.push({edge:m,start:m.start,end:m.end})}),i},`getEdgesToRender`),Ro=_(async({element:e,graph:i,diagramType:o,id:s,parentCluster:c,siteConfig:l})=>{let f=i.graph().rankdir;g.trace(`Dir in recursive render - dir:`,f);let{clusters:h,edgePaths:v,edgeLabels:ee,nodes:y,rootGroups:b}=t(e,{edgePathsClass:`edgePaths`});i.nodes()?g.info(`Recursive render XXX`,i.nodes()):g.info(`No nodes found for`,i),i.edges().length>0&&g.info(`Recursive edges`,i.edge(i.edges()[0]));let x=Mo(o);await Promise.all(i.nodes().map(async function(e){let t=i.node(e);if(c!==void 0){let t=JSON.parse(JSON.stringify(c.clusterData));g.trace(`Setting data for parent cluster XXX
|
|
1
|
+
import{c as e,i as t,n,o as r,r as i,s as a,t as o}from"./chunk-KQLB2F66-DMHuYGEF.js";import{r as s}from"./chunk-M57EVK23-B5-QqcZg.js";import{a as c,f as l,o as u}from"./chunk-DQASFODM-CoXkfYE-.js";import{a as d,i as f,n as p}from"./chunk-LEVMRMFU-D6zCwkk7.js";import{c as m}from"./chunk-AXFCVDMN-CZIH4pWz.js";import"./chunk-X4PVCEUW-CIh6H4Y2.js";import"./chunk-STOXU5M4-DaBkw4dD.js";import"./chunk-R3KSYZAL-D5MXUO36.js";import"./chunk-6MUBBAK2-7Y9ezehi.js";import{b as h}from"./chunk-BG4553SI-DsNATY2m.js";import{n as g}from"./d3-selection-ZcE6yRN5.js";import{n as _}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{$ as v,A as ee,B as y,C as b,D as x,E as te,F as ne,G as re,H as S,I as ie,J as ae,K as oe,L as se,M as ce,N as le,O as ue,P as de,Q as C,R as fe,S as pe,T as me,U as he,V as ge,W as _e,X as ve,Y as ye,Z as w,_ as be,a as T,b as xe,c as Se,d as Ce,et as E,f as D,g as we,h as Te,i as O,it as Ee,j as De,k as Oe,l as ke,m as Ae,n as k,nt as je,o as A,p as Me,q as Ne,r as j,rt as Pe,s as Fe,t as M,tt as N,u as Ie,v as Le,w as Re,x as ze,y as Be,z as P}from"./graphlib-DoDw2DoG.js";var Ve=/\s/;function He(e){for(var t=e.length;t--&&Ve.test(e.charAt(t)););return t}var Ue=/^\s+/;function We(e){return e&&e.slice(0,He(e)+1).replace(Ue,``)}var Ge=NaN,Ke=/^[-+]0x[0-9a-f]+$/i,qe=/^0b[01]+$/i,Je=/^0o[0-7]+$/i,Ye=parseInt;function Xe(e){if(typeof e==`number`)return e;if(E(e))return Ge;if(w(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=w(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=We(e);var n=qe.test(e);return n||Je.test(e)?Ye(e.slice(2),n?2:8):Ke.test(e)?Ge:+e}var Ze=1/0,Qe=17976931348623157e292;function F(e){return e?(e=Xe(e),e===Ze||e===-Ze?(e<0?-1:1)*Qe:e===e?e:0):e===0?e:0}function $e(e){var t=F(e),n=t%1;return t===t?n?t-n:t:0}var et=Object.create,tt=function(){function e(){}return function(t){if(!w(t))return{};if(et)return et(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function nt(e,t){var n=-1,r=e.length;for(t||=Array(r);++n<r;)t[n]=e[n];return t}function I(e,t,n){t==`__proto__`&&Ne?Ne(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var rt=Object.prototype.hasOwnProperty;function L(e,t,n){var r=e[t];(!(rt.call(e,t)&&S(r,n))||n===void 0&&!(t in e))&&I(e,t,n)}function R(e,t,n,r){var i=!n;n||={};for(var a=-1,o=t.length;++a<o;){var s=t[a],c=r?r(n[s],e[s],s,n,e):void 0;c===void 0&&(c=e[s]),i?I(n,s,c):L(n,s,c)}return n}function z(e,t,n){if(!w(n))return!1;var r=typeof t;return(r==`number`?P(n)&&he(t,n.length):r==`string`&&t in n)?S(n[t],e):!1}function it(e){return y(function(t,n){var r=-1,i=n.length,a=i>1?n[i-1]:void 0,o=i>2?n[2]:void 0;for(a=e.length>3&&typeof a==`function`?(i--,a):void 0,o&&z(n[0],n[1],o)&&(a=i<3?void 0:a,i=1),t=Object(t);++r<i;){var s=n[r];s&&e(t,s,r,a)}return t})}function at(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var ot=Object.prototype.hasOwnProperty;function st(e){if(!w(e))return at(e);var t=fe(e),n=[];for(var r in e)(r!=`constructor`||!t&&ot.call(e,r))&&n.push(r);return n}function B(e){return P(e)?ce(e,!0):st(e)}function V(e){return e!=null&&e.length?b(e,1):[]}function ct(e){return oe(ge(e,void 0,V),e+``)}var lt=De(Object.getPrototypeOf,Object),ut=`[object Object]`,dt=Function.prototype,ft=Object.prototype,pt=dt.toString,mt=ft.hasOwnProperty,ht=pt.call(Object);function gt(e){if(!N(e)||je(e)!=ut)return!1;var t=lt(e);if(t===null)return!0;var n=mt.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&pt.call(n)==ht}var _t=RegExp(`[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]`);function vt(e){return _t.test(e)}function yt(e,t){return e&&R(t,Oe(t),e)}function bt(e,t){return e&&R(t,B(t),e)}var xt=typeof exports==`object`&&exports&&!exports.nodeType&&exports,St=xt&&typeof module==`object`&&module&&!module.nodeType&&module,Ct=St&&St.exports===xt?Ee.Buffer:void 0,wt=Ct?Ct.allocUnsafe:void 0;function Tt(e,t){if(t)return e.slice();var n=e.length,r=wt?wt(n):new e.constructor(n);return e.copy(r),r}function Et(e,t){return R(e,xe(e),t)}var Dt=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)Re(t,xe(e)),e=lt(e);return t}:ze;function Ot(e,t){return R(e,Dt(e),t)}function kt(e){return Be(e,B,Dt)}var At=Object.prototype.hasOwnProperty;function jt(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]==`string`&&At.call(e,`index`)&&(n.index=e.index,n.input=e.input),n}function Mt(e){var t=new e.constructor(e.byteLength);return new we(t).set(new we(e)),t}function Nt(e,t){var n=t?Mt(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var Pt=/\w*$/;function Ft(e){var t=new e.constructor(e.source,Pt.exec(e));return t.lastIndex=e.lastIndex,t}var It=Pe?Pe.prototype:void 0,Lt=It?It.valueOf:void 0;function Rt(e){return Lt?Object(Lt.call(e)):{}}function zt(e,t){var n=t?Mt(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var Bt=`[object Boolean]`,Vt=`[object Date]`,Ht=`[object Map]`,Ut=`[object Number]`,Wt=`[object RegExp]`,Gt=`[object Set]`,Kt=`[object String]`,qt=`[object Symbol]`,Jt=`[object ArrayBuffer]`,Yt=`[object DataView]`,Xt=`[object Float32Array]`,Zt=`[object Float64Array]`,Qt=`[object Int8Array]`,$t=`[object Int16Array]`,en=`[object Int32Array]`,tn=`[object Uint8Array]`,nn=`[object Uint8ClampedArray]`,rn=`[object Uint16Array]`,an=`[object Uint32Array]`;function on(e,t,n){var r=e.constructor;switch(t){case Jt:return Mt(e);case Bt:case Vt:return new r(+e);case Yt:return Nt(e,n);case Xt:case Zt:case Qt:case $t:case en:case tn:case nn:case rn:case an:return zt(e,n);case Ht:return new r;case Ut:case Kt:return new r(e);case Wt:return Ft(e);case Gt:return new r;case qt:return Rt(e)}}function sn(e){return typeof e.constructor==`function`&&!fe(e)?tt(lt(e)):{}}var cn=`[object Map]`;function ln(e){return N(e)&&be(e)==cn}var un=de&&de.isMap,dn=un?ne(un):ln,fn=`[object Set]`;function pn(e){return N(e)&&be(e)==fn}var mn=de&&de.isSet,hn=mn?ne(mn):pn,gn=1,_n=2,vn=4,yn=`[object Arguments]`,bn=`[object Array]`,xn=`[object Boolean]`,Sn=`[object Date]`,Cn=`[object Error]`,wn=`[object Function]`,Tn=`[object GeneratorFunction]`,En=`[object Map]`,Dn=`[object Number]`,On=`[object Object]`,kn=`[object RegExp]`,An=`[object Set]`,jn=`[object String]`,Mn=`[object Symbol]`,Nn=`[object WeakMap]`,Pn=`[object ArrayBuffer]`,Fn=`[object DataView]`,In=`[object Float32Array]`,Ln=`[object Float64Array]`,Rn=`[object Int8Array]`,zn=`[object Int16Array]`,Bn=`[object Int32Array]`,Vn=`[object Uint8Array]`,Hn=`[object Uint8ClampedArray]`,Un=`[object Uint16Array]`,Wn=`[object Uint32Array]`,H={};H[yn]=H[bn]=H[Pn]=H[Fn]=H[xn]=H[Sn]=H[In]=H[Ln]=H[Rn]=H[zn]=H[Bn]=H[En]=H[Dn]=H[On]=H[kn]=H[An]=H[jn]=H[Mn]=H[Vn]=H[Hn]=H[Un]=H[Wn]=!0,H[Cn]=H[wn]=H[Nn]=!1;function U(e,t,n,r,i,a){var o,s=t&gn,c=t&_n,l=t&vn;if(n&&(o=i?n(e,r,i,a):n(e)),o!==void 0)return o;if(!w(e))return e;var u=C(e);if(u){if(o=jt(e),!s)return nt(e,o)}else{var d=be(e),f=d==wn||d==Tn;if(ie(e))return Tt(e,s);if(d==On||d==yn||f&&!i){if(o=c||f?{}:sn(e),!s)return c?Ot(e,bt(o,e)):Et(e,yt(o,e))}else{if(!H[d])return i?e:{};o=on(e,d,s)}}a||=new pe;var p=a.get(e);if(p)return p;a.set(e,o),hn(e)?e.forEach(function(r){o.add(U(r,t,n,r,e,a))}):dn(e)&&e.forEach(function(r,i){o.set(i,U(r,t,n,i,e,a))});var m=u?void 0:(l?c?kt:Le:c?B:Oe)(e);return re(m||e,function(r,i){m&&(i=r,r=e[i]),L(o,i,U(r,t,n,i,e,a))}),o}var Gn=1,Kn=4;function qn(e){return U(e,Gn|Kn)}var Jn=function(){return Ee.Date.now()},Yn=Object.prototype,Xn=Yn.hasOwnProperty,Zn=y(function(e,t){e=Object(e);var n=-1,r=t.length,i=r>2?t[2]:void 0;for(i&&z(t[0],t[1],i)&&(r=1);++n<r;)for(var a=t[n],o=B(a),s=-1,c=o.length;++s<c;){var l=o[s],u=e[l];(u===void 0||S(u,Yn[l])&&!Xn.call(e,l))&&(e[l]=a[l])}return e});function Qn(e,t,n){(n!==void 0&&!S(e[t],n)||n===void 0&&!(t in e))&&I(e,t,n)}function $n(e,t){if((t!==`constructor`||typeof e[t]!=`function`)&&t!=`__proto__`)return e[t]}function er(e){return R(e,B(e))}function tr(e,t,n,r,i,a,o){var s=$n(e,n),c=$n(t,n),l=o.get(c);if(l)Qn(e,n,l);else{var u=a?a(s,c,n+``,e,t,o):void 0,d=u===void 0;if(d){var f=C(c),p=!f&&ie(c),m=!f&&!p&&le(c);u=c,f||p||m?C(s)?u=s:Se(s)?u=nt(s):p?(d=!1,u=Tt(c,!0)):m?(d=!1,u=zt(c,!0)):u=[]:gt(c)||se(c)?(u=s,se(s)?u=er(s):(!w(s)||ye(s))&&(u=sn(c))):d=!1}d&&(o.set(c,u),i(u,c,r,a,o),o.delete(c)),Qn(e,n,u)}}function nr(e,t,n,r,i){e!==t&&Ce(t,function(a,o){if(i||=new pe,w(a))tr(e,t,o,n,nr,r,i);else{var s=r?r($n(e,o),a,o+``,e,t,i):void 0;s===void 0&&(s=a),Qn(e,o,s)}},B)}function W(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}function rr(e){return function(t,n,r){var i=Object(t);if(!P(t)){var a=D(n,3);t=Oe(t),n=function(e){return a(i[e],e,i)}}var o=e(t,n,r);return o>-1?i[a?t[o]:o]:void 0}}var ir=Math.max;function ar(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var i=n==null?0:$e(n);return i<0&&(i=ir(r+i,0)),_e(e,D(t,3),i)}var or=rr(ar);function sr(e,t){var n=-1,r=P(e)?Array(e.length):[];return ke(e,function(e,i,a){r[++n]=t(e,i,a)}),r}function G(e,t){return(C(e)?v:sr)(e,D(t,3))}function cr(e,t){return e==null?e:Ce(e,Fe(t),B)}function lr(e,t){return e&&Ie(e,Fe(t))}function ur(e,t){return e>t}var dr=Object.prototype.hasOwnProperty;function fr(e,t){return e!=null&&dr.call(e,t)}function pr(e,t){return e!=null&&Te(e,t,fr)}var mr=`[object String]`;function hr(e){return typeof e==`string`||!C(e)&&N(e)&&je(e)==mr}function gr(e,t){return e<t}function K(e,t){var n={};return t=D(t,3),Ie(e,function(e,r,i){I(n,r,t(e,r,i))}),n}function _r(e,t,n){for(var r=-1,i=e.length;++r<i;){var a=e[r],o=t(a);if(o!=null&&(s===void 0?o===o&&!E(o):n(o,s)))var s=o,c=a}return c}function q(e){return e&&e.length?_r(e,ve,ur):void 0}var vr=it(function(e,t,n){nr(e,t,n)});function J(e){return e&&e.length?_r(e,ve,gr):void 0}function yr(e,t){return e&&e.length?_r(e,D(t,2),gr):void 0}function br(e,t,n,r){if(!w(e))return e;t=x(t,e);for(var i=-1,a=t.length,o=a-1,s=e;s!=null&&++i<a;){var c=te(t[i]),l=n;if(c===`__proto__`||c===`constructor`||c===`prototype`)return e;if(i!=o){var u=s[c];l=r?r(u,c,s):void 0,l===void 0&&(l=w(u)?u:he(t[i+1])?[]:{})}L(s,c,l),s=s[c]}return e}function xr(e,t,n){for(var r=-1,i=t.length,a={};++r<i;){var o=t[r],s=me(e,o);n(s,o)&&br(a,x(o,e),s)}return a}function Sr(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}function Cr(e,t){if(e!==t){var n=e!==void 0,r=e===null,i=e===e,a=E(e),o=t!==void 0,s=t===null,c=t===t,l=E(t);if(!s&&!l&&!a&&e>t||a&&o&&c&&!s&&!l||r&&o&&c||!n&&c||!i)return 1;if(!r&&!a&&!l&&e<t||l&&n&&i&&!r&&!a||s&&n&&i||!o&&i||!c)return-1}return 0}function wr(e,t,n){for(var r=-1,i=e.criteria,a=t.criteria,o=i.length,s=n.length;++r<o;){var c=Cr(i[r],a[r]);if(c)return r>=s?c:c*(n[r]==`desc`?-1:1)}return e.index-t.index}function Tr(e,t,n){t=t.length?v(t,function(e){return C(e)?function(t){return me(t,e.length===1?e[0]:e)}:e}):[ve];var r=-1;return t=v(t,ne(D)),Sr(sr(e,function(e,n,i){return{criteria:v(t,function(t){return t(e)}),index:++r,value:e}}),function(e,t){return wr(e,t,n)})}var Er=Me(`length`),Dr=`\\ud800-\\udfff`,Or=`\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff`,kr=`\\ufe0e\\ufe0f`,Ar=`[`+Dr+`]`,jr=`[`+Or+`]`,Mr=`\\ud83c[\\udffb-\\udfff]`,Nr=`(?:`+jr+`|`+Mr+`)`,Pr=`[^`+Dr+`]`,Fr=`(?:\\ud83c[\\udde6-\\uddff]){2}`,Ir=`[\\ud800-\\udbff][\\udc00-\\udfff]`,Lr=`\\u200d`,Rr=Nr+`?`,zr=`[`+kr+`]?`,Br=`(?:`+Lr+`(?:`+[Pr,Fr,Ir].join(`|`)+`)`+zr+Rr+`)*`,Vr=zr+Rr+Br,Hr=`(?:`+[Pr+jr+`?`,jr,Fr,Ir,Ar].join(`|`)+`)`,Ur=RegExp(Mr+`(?=`+Mr+`)|`+Hr+Vr,`g`);function Wr(e){for(var t=Ur.lastIndex=0;Ur.test(e);)++t;return t}function Gr(e){return vt(e)?Wr(e):Er(e)}function Kr(e,t){return xr(e,t,function(t,n){return Ae(e,n)})}var qr=ct(function(e,t){return e==null?{}:Kr(e,t)}),Jr=Math.ceil,Yr=Math.max;function Xr(e,t,n,r){for(var i=-1,a=Yr(Jr((t-e)/(n||1)),0),o=Array(a);a--;)o[r?a:++i]=e,e+=n;return o}function Zr(e){return function(t,n,r){return r&&typeof r!=`number`&&z(t,n,r)&&(n=r=void 0),t=F(t),n===void 0?(n=t,t=0):n=F(n),r=r===void 0?t<n?1:-1:F(r),Xr(t,n,r,e)}}var Y=Zr(),Qr=`[object Map]`,$r=`[object Set]`;function ei(e){if(e==null)return 0;if(P(e))return hr(e)?Gr(e):e.length;var t=be(e);return t==Qr||t==$r?e.size:ee(e).length}var X=y(function(e,t){if(e==null)return[];var n=t.length;return n>1&&z(e,t[0],t[1])?t=[]:n>2&&z(t[0],t[1],t[2])&&(t=[t[0]]),Tr(e,b(t,1),[])}),ti=0;function ni(e){var t=++ti;return ue(e)+t}function ri(e,t,n){for(var r=-1,i=e.length,a=t.length,o={};++r<i;){var s=r<a?t[r]:void 0;n(o,e[r],s)}return o}function ii(e,t){return ri(e||[],t||[],L)}var ai=class{constructor(){var e={};e._next=e._prev=e,this._sentinel=e}dequeue(){var e=this._sentinel,t=e._prev;if(t!==e)return oi(t),t}enqueue(e){var t=this._sentinel;e._prev&&e._next&&oi(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t}toString(){for(var e=[],t=this._sentinel,n=t._prev;n!==t;)e.push(JSON.stringify(n,si)),n=n._prev;return`[`+e.join(`, `)+`]`}};function oi(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function si(e,t){if(e!==`_next`&&e!==`_prev`)return t}var ci=ae(1);function li(e,t){if(e.nodeCount()<=1)return[];var n=fi(e,t||ci);return V(G(ui(n.graph,n.buckets,n.zeroIdx),function(t){return e.outEdges(t.v,t.w)}))}function ui(e,t,n){for(var r=[],i=t[t.length-1],a=t[0],o;e.nodeCount();){for(;o=a.dequeue();)di(e,t,n,o);for(;o=i.dequeue();)di(e,t,n,o);if(e.nodeCount()){for(var s=t.length-2;s>0;--s)if(o=t[s].dequeue(),o){r=r.concat(di(e,t,n,o,!0));break}}}return r}function di(e,t,n,r,i){var a=i?[]:void 0;return A(e.inEdges(r.v),function(r){var o=e.edge(r),s=e.node(r.v);i&&a.push({v:r.v,w:r.w}),s.out-=o,pi(t,n,s)}),A(e.outEdges(r.v),function(r){var i=e.edge(r),a=r.w,o=e.node(a);o.in-=i,pi(t,n,o)}),e.removeNode(r.v),a}function fi(e,t){var n=new M,r=0,i=0;A(e.nodes(),function(e){n.setNode(e,{v:e,in:0,out:0})}),A(e.edges(),function(e){var a=n.edge(e.v,e.w)||0,o=t(e),s=a+o;n.setEdge(e.v,e.w,s),i=Math.max(i,n.node(e.v).out+=o),r=Math.max(r,n.node(e.w).in+=o)});var a=Y(i+r+3).map(function(){return new ai}),o=r+1;return A(n.nodes(),function(e){pi(a,o,n.node(e))}),{graph:n,buckets:a,zeroIdx:o}}function pi(e,t,n){n.out?n.in?e[n.out-n.in+t].enqueue(n):e[e.length-1].enqueue(n):e[0].enqueue(n)}function mi(e){var t=e.graph().acyclicer===`greedy`?li(e,n(e)):hi(e);A(t,function(t){var n=e.edge(t);e.removeEdge(t),n.forwardName=t.name,n.reversed=!0,e.setEdge(t.w,t.v,n,ni(`rev`))});function n(e){return function(t){return e.edge(t).weight}}}function hi(e){var t=[],n={},r={};function i(a){Object.prototype.hasOwnProperty.call(r,a)||(r[a]=!0,n[a]=!0,A(e.outEdges(a),function(e){Object.prototype.hasOwnProperty.call(n,e.w)?t.push(e):i(e.w)}),delete n[a])}return A(e.nodes(),i),t}function gi(e){A(e.edges(),function(t){var n=e.edge(t);if(n.reversed){e.removeEdge(t);var r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}})}function Z(e,t,n,r){var i;do i=ni(r);while(e.hasNode(i));return n.dummy=t,e.setNode(i,n),i}function _i(e){var t=new M().setGraph(e.graph());return A(e.nodes(),function(n){t.setNode(n,e.node(n))}),A(e.edges(),function(n){var r=t.edge(n.v,n.w)||{weight:0,minlen:1},i=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})}),t}function vi(e){var t=new M({multigraph:e.isMultigraph()}).setGraph(e.graph());return A(e.nodes(),function(n){e.children(n).length||t.setNode(n,e.node(n))}),A(e.edges(),function(n){t.setEdge(n,e.edge(n))}),t}function yi(e,t){var n=e.x,r=e.y,i=t.x-n,a=t.y-r,o=e.width/2,s=e.height/2;if(!i&&!a)throw Error(`Not possible to find intersection inside of the rectangle`);var c,l;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),c=s*i/a,l=s):(i<0&&(o=-o),c=o,l=o*a/i),{x:n+c,y:r+l}}function bi(e){var t=G(Y(wi(e)+1),function(){return[]});return A(e.nodes(),function(n){var r=e.node(n),i=r.rank;j(i)||(t[i][r.order]=n)}),t}function xi(e){var t=J(G(e.nodes(),function(t){return e.node(t).rank}));A(e.nodes(),function(n){var r=e.node(n);pr(r,`rank`)&&(r.rank-=t)})}function Si(e){var t=J(G(e.nodes(),function(t){return e.node(t).rank})),n=[];A(e.nodes(),function(r){var i=e.node(r).rank-t;n[i]||(n[i]=[]),n[i].push(r)});var r=0,i=e.graph().nodeRankFactor;A(n,function(t,n){j(t)&&n%i!==0?--r:r&&A(t,function(t){e.node(t).rank+=r})})}function Ci(e,t,n,r){var i={width:0,height:0};return arguments.length>=4&&(i.rank=n,i.order=r),Z(e,`border`,i,t)}function wi(e){return q(G(e.nodes(),function(t){var n=e.node(t).rank;if(!j(n))return n}))}function Ti(e,t){var n={lhs:[],rhs:[]};return A(e,function(e){t(e)?n.lhs.push(e):n.rhs.push(e)}),n}function Ei(e,t){var n=Jn();try{return t()}finally{console.log(e+` time: `+(Jn()-n)+`ms`)}}function Di(e,t){return t()}function Oi(e){function t(n){var r=e.children(n),i=e.node(n);if(r.length&&A(r,t),Object.prototype.hasOwnProperty.call(i,`minRank`)){i.borderLeft=[],i.borderRight=[];for(var a=i.minRank,o=i.maxRank+1;a<o;++a)ki(e,`borderLeft`,`_bl`,n,i,a),ki(e,`borderRight`,`_br`,n,i,a)}}A(e.children(),t)}function ki(e,t,n,r,i,a){var o={width:0,height:0,rank:a,borderType:t},s=i[t][a-1],c=Z(e,`border`,o,n);i[t][a]=c,e.setParent(c,r),s&&e.setEdge(s,c,{weight:1})}function Ai(e){var t=e.graph().rankdir.toLowerCase();(t===`lr`||t===`rl`)&&Mi(e)}function ji(e){var t=e.graph().rankdir.toLowerCase();(t===`bt`||t===`rl`)&&Pi(e),(t===`lr`||t===`rl`)&&(Ii(e),Mi(e))}function Mi(e){A(e.nodes(),function(t){Ni(e.node(t))}),A(e.edges(),function(t){Ni(e.edge(t))})}function Ni(e){var t=e.width;e.width=e.height,e.height=t}function Pi(e){A(e.nodes(),function(t){Fi(e.node(t))}),A(e.edges(),function(t){var n=e.edge(t);A(n.points,Fi),Object.prototype.hasOwnProperty.call(n,`y`)&&Fi(n)})}function Fi(e){e.y=-e.y}function Ii(e){A(e.nodes(),function(t){Li(e.node(t))}),A(e.edges(),function(t){var n=e.edge(t);A(n.points,Li),Object.prototype.hasOwnProperty.call(n,`x`)&&Li(n)})}function Li(e){var t=e.x;e.x=e.y,e.y=t}function Ri(e){e.graph().dummyChains=[],A(e.edges(),function(t){zi(e,t)})}function zi(e,t){var n=t.v,r=e.node(n).rank,i=t.w,a=e.node(i).rank,o=t.name,s=e.edge(t),c=s.labelRank;if(a!==r+1){e.removeEdge(t);var l=void 0,u,d=0;for(++r;r<a;++d,++r)s.points=[],l={width:0,height:0,edgeLabel:s,edgeObj:t,rank:r},u=Z(e,`edge`,l,`_d`),r===c&&(l.width=s.width,l.height=s.height,l.dummy=`edge-label`,l.labelpos=s.labelpos),e.setEdge(n,u,{weight:s.weight},o),d===0&&e.graph().dummyChains.push(u),n=u;e.setEdge(n,i,{weight:s.weight},o)}}function Bi(e){A(e.graph().dummyChains,function(t){var n=e.node(t),r=n.edgeLabel,i;for(e.setEdge(n.edgeObj,r);n.dummy;)i=e.successors(t)[0],e.removeNode(t),r.points.push({x:n.x,y:n.y}),n.dummy===`edge-label`&&(r.x=n.x,r.y=n.y,r.width=n.width,r.height=n.height),t=i,n=e.node(t)})}function Vi(e){var t={};function n(r){var i=e.node(r);if(Object.prototype.hasOwnProperty.call(t,r))return i.rank;t[r]=!0;var a=J(G(e.outEdges(r),function(t){return n(t.w)-e.edge(t).minlen}));return(a===1/0||a==null)&&(a=0),i.rank=a}A(e.sources(),n)}function Q(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}function Hi(e){var t=new M({directed:!1}),n=e.nodes()[0],r=e.nodeCount();t.setNode(n,{});for(var i,a;Ui(t,e)<r;)i=Wi(t,e),a=t.hasNode(i.v)?Q(e,i):-Q(e,i),Gi(t,e,a);return t}function Ui(e,t){function n(r){A(t.nodeEdges(r),function(i){var a=i.v,o=r===a?i.w:a;!e.hasNode(o)&&!Q(t,i)&&(e.setNode(o,{}),e.setEdge(r,o,{}),n(o))})}return A(e.nodes(),n),e.nodeCount()}function Wi(e,t){return yr(t.edges(),function(n){if(e.hasNode(n.v)!==e.hasNode(n.w))return Q(t,n)})}function Gi(e,t,n){A(e.nodes(),function(e){t.node(e).rank+=n})}ae(1),ae(1),Ki.CycleException=qi;function Ki(e){var t={},n={},r=[];function i(a){if(Object.prototype.hasOwnProperty.call(n,a))throw new qi;Object.prototype.hasOwnProperty.call(t,a)||(n[a]=!0,t[a]=!0,A(e.predecessors(a),i),delete n[a],r.push(a))}if(A(e.sinks(),i),ei(t)!==e.nodeCount())throw new qi;return r}function qi(){}qi.prototype=Error();function Ji(e,t,n){C(t)||(t=[t]);var r=(e.isDirected()?e.successors:e.neighbors).bind(e),i=[],a={};return A(t,function(t){if(!e.hasNode(t))throw Error(`Graph does not have node: `+t);Yi(e,t,n===`post`,a,r,i)}),i}function Yi(e,t,n,r,i,a){Object.prototype.hasOwnProperty.call(r,t)||(r[t]=!0,n||a.push(t),A(i(t),function(t){Yi(e,t,n,r,i,a)}),n&&a.push(t))}function Xi(e,t){return Ji(e,t,`post`)}function Zi(e,t){return Ji(e,t,`pre`)}$.initLowLimValues=ta,$.initCutValues=Qi,$.calcCutValue=ea,$.leaveEdge=ra,$.enterEdge=ia,$.exchangeEdges=aa;function $(e){e=_i(e),Vi(e);var t=Hi(e);ta(t),Qi(t,e);for(var n,r;n=ra(t);)r=ia(t,e,n),aa(t,e,n,r)}function Qi(e,t){var n=Xi(e,e.nodes());n=n.slice(0,n.length-1),A(n,function(n){$i(e,t,n)})}function $i(e,t,n){var r=e.node(n).parent;e.edge(n,r).cutvalue=ea(e,t,n)}function ea(e,t,n){var r=e.node(n).parent,i=!0,a=t.edge(n,r),o=0;return a||=(i=!1,t.edge(r,n)),o=a.weight,A(t.nodeEdges(n),function(a){var s=a.v===n,c=s?a.w:a.v;if(c!==r){var l=s===i,u=t.edge(a).weight;if(o+=l?u:-u,sa(e,n,c)){var d=e.edge(n,c).cutvalue;o+=l?-d:d}}}),o}function ta(e,t){arguments.length<2&&(t=e.nodes()[0]),na(e,{},1,t)}function na(e,t,n,r,i){var a=n,o=e.node(r);return t[r]=!0,A(e.neighbors(r),function(i){Object.prototype.hasOwnProperty.call(t,i)||(n=na(e,t,n,i,r))}),o.low=a,o.lim=n++,i?o.parent=i:delete o.parent,n}function ra(e){return or(e.edges(),function(t){return e.edge(t).cutvalue<0})}function ia(e,t,n){var r=n.v,i=n.w;t.hasEdge(r,i)||(r=n.w,i=n.v);var a=e.node(r),o=e.node(i),s=a,c=!1;return a.lim>o.lim&&(s=o,c=!0),yr(T(t.edges(),function(t){return c===ca(e,e.node(t.v),s)&&c!==ca(e,e.node(t.w),s)}),function(e){return Q(t,e)})}function aa(e,t,n,r){var i=n.v,a=n.w;e.removeEdge(i,a),e.setEdge(r.v,r.w,{}),ta(e),Qi(e,t),oa(e,t)}function oa(e,t){var n=Zi(e,or(e.nodes(),function(e){return!t.node(e).parent}));n=n.slice(1),A(n,function(n){var r=e.node(n).parent,i=t.edge(n,r),a=!1;i||(i=t.edge(r,n),a=!0),t.node(n).rank=t.node(r).rank+(a?i.minlen:-i.minlen)})}function sa(e,t,n){return e.hasEdge(t,n)}function ca(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}function la(e){switch(e.graph().ranker){case`network-simplex`:fa(e);break;case`tight-tree`:da(e);break;case`longest-path`:ua(e);break;default:fa(e)}}var ua=Vi;function da(e){Vi(e),Hi(e)}function fa(e){$(e)}function pa(e){var t=Z(e,`root`,{},`_root`),n=ha(e),r=q(O(n))-1,i=2*r+1;e.graph().nestingRoot=t,A(e.edges(),function(t){e.edge(t).minlen*=i});var a=ga(e)+1;A(e.children(),function(o){ma(e,t,i,a,r,n,o)}),e.graph().nodeRankFactor=i}function ma(e,t,n,r,i,a,o){var s=e.children(o);if(!s.length)o!==t&&e.setEdge(t,o,{weight:0,minlen:n});else{var c=Ci(e,`_bt`),l=Ci(e,`_bb`),u=e.node(o);e.setParent(c,o),u.borderTop=c,e.setParent(l,o),u.borderBottom=l,A(s,function(s){ma(e,t,n,r,i,a,s);var u=e.node(s),d=u.borderTop?u.borderTop:s,f=u.borderBottom?u.borderBottom:s,p=u.borderTop?r:2*r,m=d===f?i-a[o]+1:1;e.setEdge(c,d,{weight:p,minlen:m,nestingEdge:!0}),e.setEdge(f,l,{weight:p,minlen:m,nestingEdge:!0})}),e.parent(o)||e.setEdge(t,c,{weight:0,minlen:i+a[o]})}}function ha(e){var t={};function n(r,i){var a=e.children(r);a&&a.length&&A(a,function(e){n(e,i+1)}),t[r]=i}return A(e.children(),function(e){n(e,1)}),t}function ga(e){return k(e.edges(),function(t,n){return t+e.edge(n).weight},0)}function _a(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,A(e.edges(),function(t){e.edge(t).nestingEdge&&e.removeEdge(t)})}function va(e,t,n){var r={},i;A(n,function(n){for(var a=e.parent(n),o,s;a;){if(o=e.parent(a),o?(s=r[o],r[o]=a):(s=i,i=a),s&&s!==a){t.setEdge(s,a);return}a=o}})}function ya(e,t,n){var r=ba(e),i=new M({compound:!0}).setGraph({root:r}).setDefaultNodeLabel(function(t){return e.node(t)});return A(e.nodes(),function(a){var o=e.node(a),s=e.parent(a);(o.rank===t||o.minRank<=t&&t<=o.maxRank)&&(i.setNode(a),i.setParent(a,s||r),A(e[n](a),function(t){var n=t.v===a?t.w:t.v,r=i.edge(n,a),o=j(r)?0:r.weight;i.setEdge(n,a,{weight:e.edge(t).weight+o})}),Object.prototype.hasOwnProperty.call(o,`minRank`)&&i.setNode(a,{borderLeft:o.borderLeft[t],borderRight:o.borderRight[t]}))}),i}function ba(e){for(var t;e.hasNode(t=ni(`_root`)););return t}function xa(e,t){for(var n=0,r=1;r<t.length;++r)n+=Sa(e,t[r-1],t[r]);return n}function Sa(e,t,n){for(var r=ii(n,G(n,function(e,t){return t})),i=V(G(t,function(t){return X(G(e.outEdges(t),function(t){return{pos:r[t.w],weight:e.edge(t).weight}}),`pos`)})),a=1;a<n.length;)a<<=1;var o=2*a-1;--a;var s=G(Array(o),function(){return 0}),c=0;return A(i.forEach(function(e){var t=e.pos+a;s[t]+=e.weight;for(var n=0;t>0;)t%2&&(n+=s[t+1]),t=t-1>>1,s[t]+=e.weight;c+=e.weight*n})),c}function Ca(e){var t={},n=T(e.nodes(),function(t){return!e.children(t).length}),r=G(Y(q(G(n,function(t){return e.node(t).rank}))+1),function(){return[]});function i(n){pr(t,n)||(t[n]=!0,r[e.node(n).rank].push(n),A(e.successors(n),i))}var a=X(n,function(t){return e.node(t).rank});return A(a,i),r}function wa(e,t){return G(t,function(t){var n=e.inEdges(t);if(n.length){var r=k(n,function(t,n){var r=e.edge(n),i=e.node(n.v);return{sum:t.sum+r.weight*i.order,weight:t.weight+r.weight}},{sum:0,weight:0});return{v:t,barycenter:r.sum/r.weight,weight:r.weight}}return{v:t}})}function Ta(e,t){var n={};return A(e,function(e,t){var r=n[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:t};j(e.barycenter)||(r.barycenter=e.barycenter,r.weight=e.weight)}),A(t.edges(),function(e){var t=n[e.v],r=n[e.w];!j(t)&&!j(r)&&(r.indegree++,t.out.push(n[e.w]))}),Ea(T(n,function(e){return!e.indegree}))}function Ea(e){var t=[];function n(e){return function(t){t.merged||(j(t.barycenter)||j(e.barycenter)||t.barycenter>=e.barycenter)&&Da(e,t)}}function r(t){return function(n){n.in.push(t),--n.indegree===0&&e.push(n)}}for(;e.length;){var i=e.pop();t.push(i),A(i.in.reverse(),n(i)),A(i.out,r(i))}return G(T(t,function(e){return!e.merged}),function(e){return qr(e,[`vs`,`i`,`barycenter`,`weight`])})}function Da(e,t){var n=0,r=0;e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=n/r,e.weight=r,e.i=Math.min(t.i,e.i),t.merged=!0}function Oa(e,t){var n=Ti(e,function(e){return Object.prototype.hasOwnProperty.call(e,`barycenter`)}),r=n.lhs,i=X(n.rhs,function(e){return-e.i}),a=[],o=0,s=0,c=0;r.sort(Aa(!!t)),c=ka(a,i,c),A(r,function(e){c+=e.vs.length,a.push(e.vs),o+=e.barycenter*e.weight,s+=e.weight,c=ka(a,i,c)});var l={vs:V(a)};return s&&(l.barycenter=o/s,l.weight=s),l}function ka(e,t,n){for(var r;t.length&&(r=W(t)).i<=n;)t.pop(),e.push(r.vs),n++;return n}function Aa(e){return function(t,n){return t.barycenter<n.barycenter?-1:t.barycenter>n.barycenter?1:e?n.i-t.i:t.i-n.i}}function ja(e,t,n,r){var i=e.children(t),a=e.node(t),o=a?a.borderLeft:void 0,s=a?a.borderRight:void 0,c={};o&&(i=T(i,function(e){return e!==o&&e!==s}));var l=wa(e,i);A(l,function(t){if(e.children(t.v).length){var i=ja(e,t.v,n,r);c[t.v]=i,Object.prototype.hasOwnProperty.call(i,`barycenter`)&&Na(t,i)}});var u=Ta(l,n);Ma(u,c);var d=Oa(u,r);if(o&&(d.vs=V([o,d.vs,s]),e.predecessors(o).length)){var f=e.node(e.predecessors(o)[0]),p=e.node(e.predecessors(s)[0]);Object.prototype.hasOwnProperty.call(d,`barycenter`)||(d.barycenter=0,d.weight=0),d.barycenter=(d.barycenter*d.weight+f.order+p.order)/(d.weight+2),d.weight+=2}return d}function Ma(e,t){A(e,function(e){e.vs=V(e.vs.map(function(e){return t[e]?t[e].vs:e}))})}function Na(e,t){j(e.barycenter)?(e.barycenter=t.barycenter,e.weight=t.weight):(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight)}function Pa(e){var t=wi(e),n=Fa(e,Y(1,t+1),`inEdges`),r=Fa(e,Y(t-1,-1,-1),`outEdges`),i=Ca(e);La(e,i);for(var a=1/0,o,s=0,c=0;c<4;++s,++c){Ia(s%2?n:r,s%4>=2),i=bi(e);var l=xa(e,i);l<a&&(c=0,o=qn(i),a=l)}La(e,o)}function Fa(e,t,n){return G(t,function(t){return ya(e,t,n)})}function Ia(e,t){var n=new M;A(e,function(e){var r=e.graph().root,i=ja(e,r,n,t);A(i.vs,function(t,n){e.node(t).order=n}),va(e,n,i.vs)})}function La(e,t){A(t,function(t){A(t,function(t,n){e.node(t).order=n})})}function Ra(e){var t=Ba(e);A(e.graph().dummyChains,function(n){for(var r=e.node(n),i=r.edgeObj,a=za(e,t,i.v,i.w),o=a.path,s=a.lca,c=0,l=o[c],u=!0;n!==i.w;){if(r=e.node(n),u){for(;(l=o[c])!==s&&e.node(l).maxRank<r.rank;)c++;l===s&&(u=!1)}if(!u){for(;c<o.length-1&&e.node(l=o[c+1]).minRank<=r.rank;)c++;l=o[c]}e.setParent(n,l),n=e.successors(n)[0]}})}function za(e,t,n,r){var i=[],a=[],o=Math.min(t[n].low,t[r].low),s=Math.max(t[n].lim,t[r].lim),c=n,l;do c=e.parent(c),i.push(c);while(c&&(t[c].low>o||s>t[c].lim));for(l=c,c=r;(c=e.parent(c))!==l;)a.push(c);return{path:i.concat(a.reverse()),lca:l}}function Ba(e){var t={},n=0;function r(i){var a=n;A(e.children(i),r),t[i]={low:a,lim:n++}}return A(e.children(),r),t}function Va(e,t){var n={};function r(t,r){var i=0,a=0,o=t.length,s=W(r);return A(r,function(t,c){var l=Ua(e,t),u=l?e.node(l).order:o;(l||t===s)&&(A(r.slice(a,c+1),function(t){A(e.predecessors(t),function(r){var a=e.node(r),o=a.order;(o<i||u<o)&&!(a.dummy&&e.node(t).dummy)&&Wa(n,r,t)})}),a=c+1,i=u)}),r}return k(t,r),n}function Ha(e,t){var n={};function r(t,r,i,a,o){var s;A(Y(r,i),function(r){s=t[r],e.node(s).dummy&&A(e.predecessors(s),function(t){var r=e.node(t);r.dummy&&(r.order<a||r.order>o)&&Wa(n,t,s)})})}function i(t,n){var i=-1,a,o=0;return A(n,function(s,c){if(e.node(s).dummy===`border`){var l=e.predecessors(s);l.length&&(a=e.node(l[0]).order,r(n,o,c,i,a),o=c,i=a)}r(n,o,n.length,a,t.length)}),n}return k(t,i),n}function Ua(e,t){if(e.node(t).dummy)return or(e.predecessors(t),function(t){return e.node(t).dummy})}function Wa(e,t,n){if(t>n){var r=t;t=n,n=r}Object.prototype.hasOwnProperty.call(e,t)||Object.defineProperty(e,t,{enumerable:!0,configurable:!0,value:{},writable:!0});var i=e[t];Object.defineProperty(i,n,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function Ga(e,t,n){if(t>n){var r=t;t=n,n=r}return!!e[t]&&Object.prototype.hasOwnProperty.call(e[t],n)}function Ka(e,t,n,r){var i={},a={},o={};return A(t,function(e){A(e,function(e,t){i[e]=e,a[e]=e,o[e]=t})}),A(t,function(e){var t=-1;A(e,function(e){var s=r(e);if(s.length){s=X(s,function(e){return o[e]});for(var c=(s.length-1)/2,l=Math.floor(c),u=Math.ceil(c);l<=u;++l){var d=s[l];a[e]===e&&t<o[d]&&!Ga(n,e,d)&&(a[d]=e,a[e]=i[e]=i[d],t=o[d])}}})}),{root:i,align:a}}function qa(e,t,n,r,i){var a={},o=Ja(e,t,n,i),s=i?`borderLeft`:`borderRight`;function c(e,t){for(var n=o.nodes(),r=n.pop(),i={};r;)i[r]?e(r):(i[r]=!0,n.push(r),n=n.concat(t(r))),r=n.pop()}function l(e){a[e]=o.inEdges(e).reduce(function(e,t){return Math.max(e,a[t.v]+o.edge(t))},0)}function u(t){var n=o.outEdges(t).reduce(function(e,t){return Math.min(e,a[t.w]-o.edge(t))},1/0),r=e.node(t);n!==1/0&&r.borderType!==s&&(a[t]=Math.max(a[t],n))}return c(l,o.predecessors.bind(o)),c(u,o.successors.bind(o)),A(r,function(e){a[e]=a[n[e]]}),a}function Ja(e,t,n,r){var i=new M,a=e.graph(),o=$a(a.nodesep,a.edgesep,r);return A(t,function(t){var r;A(t,function(t){var a=n[t];if(i.setNode(a),r){var s=n[r],c=i.edge(s,a);i.setEdge(s,a,Math.max(o(e,t,r),c||0))}r=t})}),i}function Ya(e,t){return yr(O(t),function(t){var n=-1/0,r=1/0;return cr(t,function(t,i){var a=eo(e,i)/2;n=Math.max(t+a,n),r=Math.min(t-a,r)}),n-r})}function Xa(e,t){var n=O(t),r=J(n),i=q(n);A([`u`,`d`],function(n){A([`l`,`r`],function(a){var o=n+a,s=e[o],c;if(s!==t){var l=O(s);c=a===`l`?r-J(l):i-q(l),c&&(e[o]=K(s,function(e){return e+c}))}})})}function Za(e,t){return K(e.ul,function(n,r){if(t)return e[t.toLowerCase()][r];var i=X(G(e,r));return(i[1]+i[2])/2})}function Qa(e){var t=bi(e),n=vr(Va(e,t),Ha(e,t)),r={},i;return A([`u`,`d`],function(a){i=a===`u`?t:O(t).reverse(),A([`l`,`r`],function(t){t===`r`&&(i=G(i,function(e){return O(e).reverse()}));var o=(a===`u`?e.predecessors:e.successors).bind(e),s=Ka(e,i,n,o),c=qa(e,i,s.root,s.align,t===`r`);t===`r`&&(c=K(c,function(e){return-e})),r[a+t]=c})}),Xa(r,Ya(e,r)),Za(r,e.graph().align)}function $a(e,t,n){return function(r,i,a){var o=r.node(i),s=r.node(a),c=0,l;if(c+=o.width/2,Object.prototype.hasOwnProperty.call(o,`labelpos`))switch(o.labelpos.toLowerCase()){case`l`:l=-o.width/2;break;case`r`:l=o.width/2}if(l&&(c+=n?l:-l),l=0,c+=(o.dummy?t:e)/2,c+=(s.dummy?t:e)/2,c+=s.width/2,Object.prototype.hasOwnProperty.call(s,`labelpos`))switch(s.labelpos.toLowerCase()){case`l`:l=s.width/2;break;case`r`:l=-s.width/2}return l&&(c+=n?l:-l),l=0,c}}function eo(e,t){return e.node(t).width}function to(e){e=vi(e),no(e),lr(Qa(e),function(t,n){e.node(n).x=t})}function no(e){var t=bi(e),n=e.graph().ranksep,r=0;A(t,function(t){var i=q(G(t,function(t){return e.node(t).height}));A(t,function(t){e.node(t).y=r+i/2}),r+=i+n})}function ro(e,t){var n=t&&t.debugTiming?Ei:Di;n(`layout`,()=>{var t=n(` buildLayoutGraph`,()=>ho(e));n(` runLayout`,()=>io(t,n)),n(` updateInputGraph`,()=>ao(e,t))})}function io(e,t){t(` makeSpaceForEdgeLabels`,()=>go(e)),t(` removeSelfEdges`,()=>To(e)),t(` acyclic`,()=>mi(e)),t(` nestingGraph.run`,()=>pa(e)),t(` rank`,()=>la(vi(e))),t(` injectEdgeLabelProxies`,()=>_o(e)),t(` removeEmptyRanks`,()=>Si(e)),t(` nestingGraph.cleanup`,()=>_a(e)),t(` normalizeRanks`,()=>xi(e)),t(` assignRankMinMax`,()=>vo(e)),t(` removeEdgeLabelProxies`,()=>yo(e)),t(` normalize.run`,()=>Ri(e)),t(` parentDummyChains`,()=>Ra(e)),t(` addBorderSegments`,()=>Oi(e)),t(` order`,()=>Pa(e)),t(` insertSelfEdges`,()=>Eo(e)),t(` adjustCoordinateSystem`,()=>Ai(e)),t(` position`,()=>to(e)),t(` positionSelfEdges`,()=>Do(e)),t(` removeBorderNodes`,()=>wo(e)),t(` normalize.undo`,()=>Bi(e)),t(` fixupEdgeLabelCoords`,()=>So(e)),t(` undoCoordinateSystem`,()=>ji(e)),t(` translateGraph`,()=>bo(e)),t(` assignNodeIntersects`,()=>xo(e)),t(` reversePoints`,()=>Co(e)),t(` acyclic.undo`,()=>gi(e))}function ao(e,t){A(e.nodes(),function(n){var r=e.node(n),i=t.node(n);r&&(r.x=i.x,r.y=i.y,t.children(n).length&&(r.width=i.width,r.height=i.height))}),A(e.edges(),function(n){var r=e.edge(n),i=t.edge(n);r.points=i.points,Object.prototype.hasOwnProperty.call(i,`x`)&&(r.x=i.x,r.y=i.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}var oo=[`nodesep`,`edgesep`,`ranksep`,`marginx`,`marginy`],so={ranksep:50,edgesep:20,nodesep:50,rankdir:`tb`},co=[`acyclicer`,`ranker`,`rankdir`,`align`],lo=[`width`,`height`],uo={width:0,height:0},fo=[`minlen`,`weight`,`width`,`height`,`labeloffset`],po={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:`r`},mo=[`labelpos`];function ho(e){var t=new M({multigraph:!0,compound:!0}),n=ko(e.graph());return t.setGraph(vr({},so,Oo(n,oo),qr(n,co))),A(e.nodes(),function(n){var r=ko(e.node(n));t.setNode(n,Zn(Oo(r,lo),uo)),t.setParent(n,e.parent(n))}),A(e.edges(),function(n){var r=ko(e.edge(n));t.setEdge(n,vr({},po,Oo(r,fo),qr(r,mo)))}),t}function go(e){var t=e.graph();t.ranksep/=2,A(e.edges(),function(n){var r=e.edge(n);r.minlen*=2,r.labelpos.toLowerCase()!==`c`&&(t.rankdir===`TB`||t.rankdir===`BT`?r.width+=r.labeloffset:r.height+=r.labeloffset)})}function _o(e){A(e.edges(),function(t){var n=e.edge(t);if(n.width&&n.height){var r=e.node(t.v);Z(e,`edge-proxy`,{rank:(e.node(t.w).rank-r.rank)/2+r.rank,e:t},`_ep`)}})}function vo(e){var t=0;A(e.nodes(),function(n){var r=e.node(n);r.borderTop&&(r.minRank=e.node(r.borderTop).rank,r.maxRank=e.node(r.borderBottom).rank,t=q(t,r.maxRank))}),e.graph().maxRank=t}function yo(e){A(e.nodes(),function(t){var n=e.node(t);n.dummy===`edge-proxy`&&(e.edge(n.e).labelRank=n.rank,e.removeNode(t))})}function bo(e){var t=1/0,n=0,r=1/0,i=0,a=e.graph(),o=a.marginx||0,s=a.marginy||0;function c(e){var a=e.x,o=e.y,s=e.width,c=e.height;t=Math.min(t,a-s/2),n=Math.max(n,a+s/2),r=Math.min(r,o-c/2),i=Math.max(i,o+c/2)}A(e.nodes(),function(t){c(e.node(t))}),A(e.edges(),function(t){var n=e.edge(t);Object.prototype.hasOwnProperty.call(n,`x`)&&c(n)}),t-=o,r-=s,A(e.nodes(),function(n){var i=e.node(n);i.x-=t,i.y-=r}),A(e.edges(),function(n){var i=e.edge(n);A(i.points,function(e){e.x-=t,e.y-=r}),Object.prototype.hasOwnProperty.call(i,`x`)&&(i.x-=t),Object.prototype.hasOwnProperty.call(i,`y`)&&(i.y-=r)}),a.width=n-t+o,a.height=i-r+s}function xo(e){A(e.edges(),function(t){var n=e.edge(t),r=e.node(t.v),i=e.node(t.w),a,o;n.points?(a=n.points[0],o=n.points[n.points.length-1]):(n.points=[],a=i,o=r),n.points.unshift(yi(r,a)),n.points.push(yi(i,o))})}function So(e){A(e.edges(),function(t){var n=e.edge(t);if(Object.prototype.hasOwnProperty.call(n,`x`))switch((n.labelpos===`l`||n.labelpos===`r`)&&(n.width-=n.labeloffset),n.labelpos){case`l`:n.x-=n.width/2+n.labeloffset;break;case`r`:n.x+=n.width/2+n.labeloffset}})}function Co(e){A(e.edges(),function(t){var n=e.edge(t);n.reversed&&n.points.reverse()})}function wo(e){A(e.nodes(),function(t){if(e.children(t).length){var n=e.node(t),r=e.node(n.borderTop),i=e.node(n.borderBottom),a=e.node(W(n.borderLeft)),o=e.node(W(n.borderRight));n.width=Math.abs(o.x-a.x),n.height=Math.abs(i.y-r.y),n.x=a.x+n.width/2,n.y=r.y+n.height/2}}),A(e.nodes(),function(t){e.node(t).dummy===`border`&&e.removeNode(t)})}function To(e){A(e.edges(),function(t){if(t.v===t.w){var n=e.node(t.v);n.selfEdges||=[],n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}function Eo(e){var t=bi(e);A(t,function(t){var n=0;A(t,function(t,r){var i=e.node(t);i.order=r+n,A(i.selfEdges,function(t){Z(e,`selfedge`,{width:t.label.width,height:t.label.height,rank:i.rank,order:r+ ++n,e:t.e,label:t.label},`_se`)}),delete i.selfEdges})})}function Do(e){A(e.nodes(),function(t){var n=e.node(t);if(n.dummy===`selfedge`){var r=e.node(n.e.v),i=r.x+r.width/2,a=r.y,o=n.x-i,s=r.height/2;e.setEdge(n.e,n.label),e.removeNode(t),n.label.points=[{x:i+2*o/3,y:a-s},{x:i+5*o/6,y:a-s},{x:i+o,y:a},{x:i+5*o/6,y:a+s},{x:i+2*o/3,y:a+s}],n.label.x=n.x,n.label.y=n.y}})}function Oo(e,t){return K(qr(e,t),Number)}function ko(e){var t={};return A(e,function(e,n){t[n.toLowerCase()]=e}),t}var Ao=_((e,t,n)=>Math.max(t,Math.min(n,e)),`clamp`),jo=_((e=`TB`)=>{switch(e){case`BT`:return`bottom`;case`LR`:return`right`;case`RL`:return`left`;default:return`top`}},`getDefaultSelfLoopSide`),Mo=_(e=>e===`flowchart`||e===`flowchart-v2`||e===`stateDiagram`||e===`er`||e===`classDiagram`,`shouldMergeSelfLoopSegments`),No=[`x`,`y`,`width`,`height`,`labelBBox`,`intersect`,`calcIntersect`,`diff`,`clusterNode`],Po=_((e,t,n,r,i)=>{let a=[],o=new Set;if(n.forEach(({start:e,end:t})=>{e!==r&&o.add(e),t!==r&&o.add(t)}),o.forEach(t=>{let n=e.node(t);typeof n?.x==`number`&&typeof n?.y==`number`&&a.push(n)}),a.length===0&&n.forEach(({edge:e})=>{(e.points??[]).forEach(e=>{typeof e?.x==`number`&&typeof e?.y==`number`&&a.push(e)})}),a.length===0)return jo(i);let s=a.reduce((e,t)=>({x:e.x+t.x/a.length,y:e.y+t.y/a.length}),{x:0,y:0}),c=s.x-t.x,l=s.y-t.y;return Math.abs(c)>Math.abs(l)?c>0?`right`:`left`:Math.abs(l)>0?l>0?`bottom`:`top`:jo(i)},`getSelfLoopSide`),Fo=_((e,t=`top`,n=0,r=0)=>{let i=e.x,a=e.y-n,o=e.width/2,s=e.height/2,c=Math.max(36,Math.min(100,e.width*.8)),l=Ao(Math.max(r,e.width*.35),36,c),u=Ao(Math.min(e.width,e.height)*.45,24,48);switch(t){case`bottom`:{let e=a+s;return[{x:i-l/2,y:e},{x:i-l/2,y:e+u},{x:i+l/2,y:e+u},{x:i+l/2,y:e}]}case`right`:{let e=i+o;return[{x:e,y:a-l/2},{x:e+u,y:a-l/2},{x:e+u,y:a+l/2},{x:e,y:a+l/2}]}case`left`:{let e=i-o;return[{x:e,y:a-l/2},{x:e-u,y:a-l/2},{x:e-u,y:a+l/2},{x:e,y:a+l/2}]}default:{let e=a-s;return[{x:i-l/2,y:e},{x:i-l/2,y:e-u},{x:i+l/2,y:e-u},{x:i+l/2,y:e}]}}},`getSelfLoopPoints`),Io=_((e,t,n=`top`,r=0,i={})=>{let a=e.x,o=e.y-r,s=i.width??0,c=i.height??0;switch(n){case`bottom`:return{x:a,y:Math.max(...t.map(e=>e.y))+c/2+4};case`right`:return{x:Math.max(...t.map(e=>e.x))+s/2+4,y:o};case`left`:return{x:Math.min(...t.map(e=>e.x))-s/2-4,y:o};default:return{x:a,y:Math.min(...t.map(e=>e.y))-c/2-4}}},`getSelfLoopLabelPosition`),Lo=_((e,t=0,{mergeSelfLoops:n=!0}={})=>{let r=new Map,i=[],a=e.graph()?.rankdir;return e.edges().forEach(t=>{let a=e.edge(t);if(n&&a.selfLoop){let e=a.selfLoop.id;r.has(e)||r.set(e,[]),r.get(e).push({edge:a,start:t.v,end:t.w})}else i.push({edge:a,start:t.v,end:t.w})}),r.forEach(n=>{if(n.length!==3){n.forEach(e=>i.push(e));return}n.sort((e,t)=>e.edge.selfLoop.order-t.edge.selfLoop.order);let[r,o,s]=n,c=r.edge.originalEdge??o.edge.originalEdge??s.edge.originalEdge??o.edge,l=e.node(c.start);if(!l){n.forEach(e=>i.push(e));return}let u={width:o.edge.width,height:o.edge.height},d=Po(e,l,n,c.start,a),f=Fo(l,d,t,u.width??0),p=Io(l,f,d,t,u),m={...o.edge,...c,id:c.id,points:f,start:c.start,end:c.end,x:p.x,y:p.y,width:u.width,height:u.height,labelStyle:o.edge.labelStyle,fromCluster:r.edge.fromCluster??o.edge.fromCluster??s.edge.fromCluster,toCluster:r.edge.toCluster??o.edge.toCluster??s.edge.toCluster};delete m.selfLoop,delete m.originalEdge,i.push({edge:m,start:m.start,end:m.end})}),i},`getEdgesToRender`),Ro=_(async({element:e,graph:i,diagramType:o,id:s,parentCluster:c,siteConfig:l})=>{let f=i.graph().rankdir;g.trace(`Dir in recursive render - dir:`,f);let{clusters:h,edgePaths:v,edgeLabels:ee,nodes:y,rootGroups:b}=t(e,{edgePathsClass:`edgePaths`});i.nodes()?g.info(`Recursive render XXX`,i.nodes()):g.info(`No nodes found for`,i),i.edges().length>0&&g.info(`Recursive edges`,i.edge(i.edges()[0]));let x=Mo(o);await Promise.all(i.nodes().map(async function(e){let t=i.node(e);if(c!==void 0){let t=JSON.parse(JSON.stringify(c.clusterData));g.trace(`Setting data for parent cluster XXX
|
|
2
2
|
Node.id = `,e,`
|
|
3
3
|
data=`,t.height,`
|
|
4
4
|
Parent cluster`,c.height),i.setNode(c.id,t),i.parent(e)||(g.trace(`Setting parent`,e,c.id),i.setParent(e,c.id,t))}if(g.info(`(Insert) Node XXX`+e+`: `+JSON.stringify(i.node(e))),t?.clusterNode){g.info(`Cluster identified XBX`,e,t.width,i.node(e));let{ranksep:n,nodesep:r}=i.graph();t.graph.setGraph({...t.graph.graph(),ranksep:n+25,nodesep:r});let a=await Go({element:y,graph:t.graph,diagramType:o,id:s,parentCluster:i.node(e),siteConfig:l}),c=a.elem;m(t,c),t.diff=a.diff||0,g.info(`New compound node after recursive render XAX`,e,`width`,t.width,`height`,t.height),d(c,t)}else i.children(e).length>0?(g.trace(`Cluster - the non recursive path XBX`,e,t.id,t,t.width,`Graph:`,i),g.trace(r(t.id,i)),n.set(t.id,{id:r(t.id,i),node:t})):(g.trace(`Node - the non recursive path XAX`,e,y,i.node(e),f),await a(y,i.node(e),{config:l,dir:f}))})),await _(async()=>{let e=i.edges().map(async function(e){let t=i.edge(e.v,e.w,e.name);if(g.info(`Edge `+e.v+` -> `+e.w+`: `+JSON.stringify(e)),g.info(`Edge `+e.v+` -> `+e.w+`: `,e,` `,JSON.stringify(i.edge(e))),g.info(`Fix`,n,`ids:`,e.v,e.w,`Translating: `,n.get(e.v),n.get(e.w)),x&&t.selfLoop){if(t.selfLoop.order!==1)return;let e={...t.originalEdge,...t,id:t.selfLoop.id,startLabelLeft:t.originalEdge?.startLabelLeft??t.startLabelLeft,startLabelRight:t.originalEdge?.startLabelRight??t.startLabelRight,endLabelLeft:t.originalEdge?.endLabelLeft??t.endLabelLeft,endLabelRight:t.originalEdge?.endLabelRight??t.endLabelRight};await u(ee,e),t.width=e.width,t.height=e.height,t.labelStyle=e.labelStyle}else await u(ee,t)});await Promise.all(e)},`processEdges`)();let{subGraphTitleTotalMargin:te}=p(l);return{elem:b,graph:i,groups:{clusters:h,edgePaths:v,edgeLabels:ee,nodes:y,rootGroups:b},diagramType:o,id:s,mergeSelfLoops:x,subGraphTitleTotalMargin:te}},`measureDagreGraph`),zo=_(e=>{g.info(`############################################# XXX`),g.info(`### Layout ### XXX`),g.info(`############################################# XXX`),ro(e)},`runDagreGraphLayout`),Bo=_((e,t,n)=>{let r=e.node(t);if(!r)return;let i={...r};return r?.clusterNode?i.y=(r.y??0)+n:e.children(t).length>0?i.height=(r.height??0)+n:i.y=(r.y??0)+n/2,i},`normalizeDagreNode`),Vo=_((e,t)=>{No.forEach(n=>{t[n]!==void 0&&(e[n]=t[n])})},`applyDagreNodeLayout`),Ho=_((e,t,n,r)=>({...e,start:e.start??t,end:e.end??n,points:(e.points??[]).map(e=>({...e,y:typeof e.y==`number`?e.y+r:e.y}))}),`normalizeDagreEdge`),Uo=_((t,n)=>{let{graph:r,mergeSelfLoops:i,subGraphTitleTotalMargin:a=0}=n,o=new Map(t.nodes.map(e=>[e.id,e]));e(r).forEach(e=>{let t=Bo(r,e,a);if(!t)return;Vo(r.node(e),t);let n=o.get(e);n&&Vo(n,t)});let s=a/2;return t.edges=Lo(r,s,{mergeSelfLoops:i}).map(({edge:e,start:t,end:n})=>Ho(e,t,n,s)),t},`applyDagreLayoutResult`),Wo=_(async({elem:t,graph:r,groups:{clusters:i,edgePaths:a},diagramType:o,id:u,mergeSelfLoops:d,subGraphTitleTotalMargin:p})=>{let m=0;await Promise.all(e(r).map(async function(e){let t=r.node(e);if(g.info(`Position XBX => `+e+`: (`+t.x,`,`+t.y,`) width: `,t.width,` height: `,t.height),t?.clusterNode)t.y+=p,g.info(`A tainted cluster node XBX1`,e,t.id,t.width,t.height,t.x,t.y,r.parent(e)),n.get(t.id).node=t,f(t);else if(r.children(e).length>0){g.info(`A pure cluster node XBX1`,e,t.id,t.x,t.y,t.width,t.height,r.parent(e)),t.height+=p,r.node(t.parentId);let a=t?.padding/2||0,o=t?.labelBBox?.height||0,c=o-a||0;g.debug(`OffsetY`,c,`labelHeight`,o,`halfPadding`,a),await s(i,t),n.get(t.id).node=t}else{let e=r.node(t.parentId);t.y+=p/2,g.info(`A regular node XBX1 - using the padding`,t.id,`parent`,t.parentId,t.width,t.height,t.x,t.y,`offsetY`,t.offsetY,`parent`,e,e?.offsetY,t),f(t)}}));let h=p/2;return Lo(r,h,{mergeSelfLoops:d}).forEach(function({edge:e,start:t,end:i}){g.info(`Edge `+t+` -> `+i+`: `+JSON.stringify(e),e),e.points.forEach(e=>e.y+=h);let s=r.node(t),d=r.node(i),f=c(a,e,n,o,s,d,u);l(e,f)}),r.nodes().forEach(function(e){let t=r.node(e);g.info(e,t.type,t.diff),t.isGroup&&(m=t.diff)}),g.warn(`Returning from recursive render XAX`,t,m),{elem:t,diff:m}},`paintDagreLayoutCore`),Go=_(async e=>{let t=await Ro(e);return zo(t.graph),await Wo(t)},`renderDagreSubgraph`),Ko=_(e=>{let t=new M({multigraph:!0,compound:!0}).setGraph({rankdir:e.direction,nodesep:e.config?.nodeSpacing||e.nodeSpacing||e.config?.flowchart?.nodeSpacing,ranksep:e.config?.rankSpacing||e.rankSpacing||e.config?.flowchart?.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});return e.nodes.forEach(e=>{t.setNode(e.id,{...e}),e.parentId&&t.setParent(e.id,e.parentId)}),g.debug(`Edges:`,e.edges),e.edges.forEach(e=>{if(e.start===e.end){let n=e.start,r=n+`---`+n+`---1`,i=n+`---`+n+`---2`,a=t.node(n);t.setNode(r,{domId:r,id:r,parentId:a.parentId,labelStyle:``,label:``,padding:0,shape:`labelRect`,style:``,width:10,height:10}),t.setParent(r,a.parentId),t.setNode(i,{domId:i,id:i,parentId:a.parentId,labelStyle:``,padding:0,shape:`labelRect`,label:``,style:``,width:10,height:10}),t.setParent(i,a.parentId);let o=structuredClone(e),s=structuredClone(e),c=structuredClone(e),l=structuredClone(e);s.originalEdge=o,s.selfLoop={id:o.id,order:0},c.originalEdge=o,c.selfLoop={id:o.id,order:1},l.originalEdge=o,l.selfLoop={id:o.id,order:2},s.label=``,s.arrowTypeEnd=`none`,s.endLabelLeft=``,s.endLabelRight=``,s.startLabelLeft=``,s.id=n+`-cyclic-special-1`,c.startLabelRight=``,c.startLabelLeft=``,c.endLabelLeft=``,c.endLabelRight=``,c.arrowTypeStart=`none`,c.arrowTypeEnd=`none`,c.id=n+`-cyclic-special-mid`,l.label=``,l.startLabelRight=``,l.startLabelLeft=``,l.arrowTypeStart=`none`,a.isGroup&&(s.fromCluster=n,l.toCluster=n),l.id=n+`-cyclic-special-2`,l.arrowTypeStart=`none`,t.setEdge(n,r,s,n+`-cyclic-special-0`),t.setEdge(r,i,c,n+`-cyclic-special-1`),t.setEdge(i,n,l,n+`-cyclic-special-2`)}else t.setEdge(e.start,e.end,{...e},e.id)}),o(t),{graph:t}},`prepareLayoutForDagre`),qo=_(async(e,{element:t,preparedLayout:n})=>{let r=n??Ko(e),i=h(),a=await Ro({element:t,graph:r.graph,diagramType:e.type,id:e.diagramId,parentCluster:void 0,siteConfig:i});return r.measuredLayout=a,a},`measureDagreLayout`),Jo=_((e,t)=>{let n=t.preparedLayout?.measuredLayout;if(!n)throw Error(`runDagreLayoutCore requires measureDagreLayout to run first`);return zo(n.graph),Uo(e,n),n},`runDagreLayoutCore`),Yo=i({prepareLayout:Ko,measureLayout:qo,runLayoutCore:Jo,paintOptions:{clusterDb:n,getNodes:_((t,{measure:n})=>e(n.graph).map(e=>n.graph.node(e)).filter(Boolean),`getDagrePaintNodes`),getEdgeNode:_((e,t,{measure:n})=>e?n.graph.node(e):void 0,`getDagreEdgeNode`),skipNode:_((e,{measure:t})=>!t.graph.hasNode(e.id),`skipNode`),isCluster:_((e,{measure:t})=>t.graph.hasNode(e.id)&&(t.graph.children(e.id)??[]).length>0,`isCluster`)}});export{Uo as applyDagreLayoutResult,Lo as getEdgesToRender,qo as measureDagreLayout,Ko as prepareLayoutForDagre,Yo as render,Jo as runDagreLayoutCore};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as e}from"./chunk-5VM5RSS4-ZNzvKenW.js";import{t}from"./chunk-XXDRQBXY-
|
|
1
|
+
import{t as e}from"./chunk-5VM5RSS4-ZNzvKenW.js";import{t}from"./chunk-XXDRQBXY-C_Vwv1FM.js";import{t as n}from"./chunk-TU62E6Q5-vXcRfGci.js";import{i as r,n as i,r as a,t as o}from"./mermaid.core-DC20ZwJj.js";import{t as s}from"./chunk-HFQBQIA3-C5OLqki8.js";import"./chunk-M57EVK23-B5-QqcZg.js";import{h as c}from"./chunk-DQASFODM-CoXkfYE-.js";import"./chunk-LEVMRMFU-D6zCwkk7.js";import{a as l}from"./chunk-AXFCVDMN-CZIH4pWz.js";import"./chunk-X4PVCEUW-CIh6H4Y2.js";import"./chunk-STOXU5M4-DaBkw4dD.js";import"./chunk-R3KSYZAL-D5MXUO36.js";import{i as u,n as d,o as f,r as p}from"./chunk-J5ZVWO5B-oDCd-gWO.js";import{_ as m,c as h}from"./chunk-6MUBBAK2-7Y9ezehi.js";import{C as g,G as _,H as v,U as y,_ as ee,a as b,at as x,b as S,d as C,et as w,q as T,s as E,v as D}from"./chunk-BG4553SI-DsNATY2m.js";import{n as O,t as k}from"./d3-selection-ZcE6yRN5.js";import{n as A}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";var j={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`},M=new Set([j.SHAPE_UNSUPPORTED,j.SHAPE_REMOVED,j.CONTAINMENT_VIOLATION]);new Set(Object.values(j).filter(e=>!M.has(e)));var N=new Map([[`task`,`roundedRect`],[`tool`,`subroutine`],[`input`,`lean-right`],[`lean_right`,`lean-right`],[`decision`,`diamond`],[`refdoc`,`lin-doc`],[`action`,`hexagon`],[`round`,`rect`]]),te=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`.split(`.`)),ne=new Set([`roundedRect`,`subroutine`,`subprocess`,`subproc`,`framed-rectangle`,`lean-right`,`diamond`,`lin-doc`,`lined-document`,`hexagon`,`hex`,`connector`,`collapsedGroup`]),P=`roundedRect`;function F(e){return e&&(N.get(e)??e)}A(F,`resolveShapeAlias`);function re(e,t){for(let n of e)if(!n.isGroup){if(n.shape&&n.shape!==`squareRect`&&n.shape!==`rect`||(n.shape=P),te.has(n.shape)){let e=`shape "${n.shape}" was removed in v0.8.1, using "${P}"`;t?.emitError?t.emitError(`SHAPE_REMOVED`,e,{nodeId:n.id}):O.warn(`agentflow: ${e}`),n.shape=P}else if(!ne.has(n.shape)){let e=`shape "${n.shape}" is not supported, using "${P}"`;t?.emitWarning?t.emitWarning(`SHAPE_UNSUPPORTED`,e,{nodeId:n.id}):O.warn(`agentflow: ${e}`),n.shape=P}}}A(re,`normaliseNodeShapes`);var I=new Map([[`tool`,0],[`task`,1],[`decision`,2],[`input`,3],[`refdoc`,4],[`connector`,5],[`action`,6]]),L=I.size,R=A(e=>`af-kind-${e}`,`kindClass`),z=[...I.keys()],B=A(e=>Math.max(1,e-L),`containerSlotCount`),V=A((e,t)=>{let n=L+e%B(t);return t>0?n%t:n},`containerSlot`);function ie(e,t,n){let r=S().themeVariables?.borderColorArray,i=Array.isArray(r)?r.length:0,a=n.size;for(let r of e??[]){if(r.isGroup||r.shape===`collapsedGroup`){r.colorIndex=V(n.get(String(r.id))??a++,i);continue}let e=t(String(r.id));e&&I.has(e)&&(r.cssClasses=`${r.cssClasses??``} ${R(e)}`.replace(/\s+/g,` `).trim())}}A(ie,`assignColorSlots`);var ae=`agentflow-`,oe=new Set([`shape`,`view`,`icon`,`img`,`form`,`pos`,`w`,`h`,`class`,`style`,`labelType`]),se=new Set([`subroutine`,`subprocess`,`subproc`,`framed-rectangle`,`tool`]),ce={flow:`flowGroup`};function H(e){if(Array.isArray(e))return e.map(e=>H(e));if(typeof e!=`object`||!e)return e;let t={};for(let n of Object.keys(e))n!==`__proto__`&&n!==`constructor`&&n!==`prototype`&&(t[n]=H(e[n]));return t}A(H,`stripPrototypeKeys`);function le(e){let t=!1,n=!1,r=0,i,a=[];for(let o of e.split(`
|
|
2
2
|
`)){if(i!==void 0){let e=o.length-o.trimStart().length;if(o.trim()===``||e>i){a.push(o);continue}i=void 0}let e=-1;for(let i=0;i<o.length;i++){let a=o[i];if(n)a===`\\`?i++:a===`"`&&(n=!1);else if(t)a===`'`&&(t=!1);else if(a===`"`)n=!0;else if(a===`'`)t=!0;else if(a===`#`&&(i===0||o[i-1]===` `||o[i-1]===` `)){e=i;break}else a===`[`||a===`{`?r++:(a===`]`||a===`}`)&&(r=Math.max(0,r-1))}if(t||n||r>0){a.push(o);continue}let s=e>=0?o.slice(0,e):o,c=e>=0?o.slice(e):``;/:\s*[>|][\d+-]*\s*$/.test(s)?(i=o.length-o.trimStart().length,a.push(o)):a.push(s.replace(/,([\t ]*)$/,`$1`)+c)}return a.join(`
|
|
3
3
|
`)}A(le,`stripLineTrailingCommas`);var ue=class{constructor(){this.vertexCounter=0,this.config=S(),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=y,this.setAccDescription=v,this.setDiagramTitle=T,this.getAccTitle=D,this.getAccDescription=ee,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{A(this,`AgentFlowDB`)}sanitizeText(e){return E.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 t of this.vertices.values())if(t.id===e)return this.diagramId?`${this.diagramId}-${t.domId}`:t.domId;return this.diagramId?`${this.diagramId}-${e}`:e}addVertex(e,t,n,r,a,s,c={},u,d){if(!e||e.trim().length===0)return;let f;if(u!==void 0){let e;e=u.includes(`
|
|
4
4
|
`)?u+`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as e}from"./chunk-JWPE2WC7-DVXcaiue.js";import{a as t}from"./mermaid.core-
|
|
1
|
+
import{t as e}from"./chunk-JWPE2WC7-DVXcaiue.js";import{a as t}from"./mermaid.core-DC20ZwJj.js";import{i as n}from"./chunk-6MUBBAK2-7Y9ezehi.js";import{C as r,H as i,U as a,_ as o,a as s,c,f as l,q as u,v as d,y as f}from"./chunk-BG4553SI-DsNATY2m.js";import{n as p}from"./d3-selection-ZcE6yRN5.js";import{n as m}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{n as h}from"./mermaid-parser.core-BfCv4CYZ.js";var g=l.packet,_=class{constructor(){this.packet=[],this.setAccTitle=a,this.getAccTitle=d,this.setDiagramTitle=u,this.getDiagramTitle=r,this.getAccDescription=o,this.setAccDescription=i}static{m(this,`PacketDB`)}getConfig(){let e=n({...g,...f().packet});return e.showBits&&(e.paddingY+=10),e}getPacket(){return this.packet}pushWord(e){e.length>0&&this.packet.push(e)}clear(){s(),this.packet=[]}},v=1e4,y=m((t,n)=>{e(t,n);let r=-1,i=[],a=1,{bitsPerRow:o}=n.getConfig();for(let{start:e,end:s,bits:c,label:l}of t.blocks){if(e!==void 0&&s!==void 0&&s<e)throw Error(`Packet block ${e} - ${s} is invalid. End must be greater than start.`);if(e??=r+1,e!==r+1)throw Error(`Packet block ${e} - ${s??e} is not contiguous. It should start from ${r+1}.`);if(c===0)throw Error(`Packet block ${e} is invalid. Cannot have a zero bit field.`);for(s??=e+(c??1)-1,c??=s-e+1,r=s,p.debug(`Packet block ${e} - ${r} with label ${l}`);i.length<=o+1&&n.getPacket().length<v;){let[t,r]=b({start:e,end:s,bits:c,label:l},a,o);if(i.push(t),t.end+1===a*o&&(n.pushWord(i),i=[],a++),!r)break;({start:e,end:s,bits:c,label:l}=r)}}n.pushWord(i)},`populate`),b=m((e,t,n)=>{if(e.start===void 0)throw Error(`start should have been set during first phase`);if(e.end===void 0)throw Error(`end should have been set during first phase`);if(e.start>e.end)throw Error(`Block start ${e.start} is greater than block end ${e.end}.`);if(e.end+1<=t*n)return[e,void 0];let r=t*n-1,i=t*n;return[{start:e.start,end:r,label:e.label,bits:r-e.start},{start:i,end:e.end,label:e.label,bits:e.end-i}]},`getNextFittingBlock`),x={parser:{yy:void 0},parse:m(async e=>{let t=await h(`packet`,e),n=x.parser?.yy;if(!(n instanceof _))throw Error(`parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.`);p.debug(t),y(t,n)},`parse`)},S=m((e,n,r,i)=>{let a=i.db,o=a.getConfig(),{rowHeight:s,paddingY:l,bitWidth:u,bitsPerRow:d}=o,f=a.getPacket(),p=a.getDiagramTitle(),m=s+l,h=m*(f.length+1)-(p?0:s),g=u*d+2,_=t(n);_.attr(`viewBox`,`0 0 ${g} ${h}`),c(_,h,g,o.useMaxWidth);for(let[e,t]of f.entries())C(_,t,e,o);_.append(`text`).text(p).attr(`x`,g/2).attr(`y`,h-m/2).attr(`dominant-baseline`,`middle`).attr(`text-anchor`,`middle`).attr(`class`,`packetTitle`)},`draw`),C=m((e,t,n,{rowHeight:r,paddingX:i,paddingY:a,bitWidth:o,bitsPerRow:s,showBits:c,bitOrder:l})=>{let u=e.append(`g`),d=n*(r+a)+a,f=l===`descending`;for(let e of t){let t=e.end-e.start+1,n=e.start%s,a=(f?s-n-t:n)*o+1,l=t*o-i;if(u.append(`rect`).attr(`x`,a).attr(`y`,d).attr(`width`,l).attr(`height`,r).attr(`class`,`packetBlock`),u.append(`text`).attr(`x`,a+l/2).attr(`y`,d+r/2).attr(`class`,`packetLabel`).attr(`dominant-baseline`,`middle`).attr(`text-anchor`,`middle`).text(e.label),!c)continue;let[p,m]=f?[e.end,e.start]:[e.start,e.end],h=t===1,g=d-2;u.append(`text`).attr(`x`,a+(h?l/2:0)).attr(`y`,g).attr(`class`,`packetByte start`).attr(`dominant-baseline`,`auto`).attr(`text-anchor`,h?`middle`:`start`).text(p),h||u.append(`text`).attr(`x`,a+l).attr(`y`,g).attr(`class`,`packetByte end`).attr(`dominant-baseline`,`auto`).attr(`text-anchor`,`end`).text(m)}},`drawWord`),w={draw:S},T={byteFontSize:`10px`,startByteColor:`black`,endByteColor:`black`,labelColor:`black`,labelFontSize:`12px`,titleColor:`black`,titleFontSize:`14px`,blockStrokeColor:`black`,blockStrokeWidth:`1`,blockFillColor:`#efefef`},E={parser:x,get db(){return new _},renderer:w,styles:m(({packet:e}={})=>{let t=n(T,e);return`
|
|
2
2
|
.packetByte {
|
|
3
3
|
font-size: ${t.byteFontSize};
|
|
4
4
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as e}from"./chunk-JWPE2WC7-DVXcaiue.js";import{a as t}from"./mermaid.core-
|
|
1
|
+
import{t as e}from"./chunk-JWPE2WC7-DVXcaiue.js";import{a as t}from"./mermaid.core-DC20ZwJj.js";import{i as n}from"./chunk-6MUBBAK2-7Y9ezehi.js";import{C as r,E as i,H as a,U as o,_ as s,a as c,c as l,f as u,q as d,v as f,y as p}from"./chunk-BG4553SI-DsNATY2m.js";import{n as m}from"./d3-selection-ZcE6yRN5.js";import{n as h}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{n as g}from"./mermaid-parser.core-BfCv4CYZ.js";var _={showLegend:!0,ticks:5,max:null,min:0,graticule:`circle`},v=32,y={axes:[],curves:[],options:_},b=structuredClone(y),x=u.radar,S=h(()=>n({...x,...p().radar}),`getConfig`),C=h(()=>b.axes,`getAxes`),w=h(()=>b.curves,`getCurves`),T=h(()=>b.options,`getOptions`),E=h(e=>{b.axes=e.map(e=>({name:e.name,label:e.label??e.name}))},`setAxes`),D=h(e=>{b.curves=e.map(e=>({name:e.name,label:e.label??e.name,entries:O(e.entries)}))},`setCurves`),O=h(e=>{if(e[0].axis==null)return e.map(e=>e.value);let t=C();if(t.length===0)throw Error(`Axes must be populated before curves for reference entries`);return t.map(t=>{let n=e.find(e=>e.axis?.$refText===t.name);if(n===void 0)throw Error(`Missing entry for axis `+t.label);return n.value})},`computeCurveEntries`),k={getAxes:C,getCurves:w,getOptions:T,setAxes:E,setCurves:D,setOptions:h(e=>{let t=e.reduce((e,t)=>(e[t.name]=t,e),{});b.options={showLegend:t.showLegend?.value??_.showLegend,ticks:t.ticks?.value??_.ticks,max:t.max?.value??_.max,min:t.min?.value??_.min,graticule:t.graticule?.value??_.graticule},b.options.ticks>v&&(m.warn(`Radar diagram ticks (${b.options.ticks}) exceeds maximum allowed (${v}). Using ${v} instead.`),b.options.ticks=v)},`setOptions`),getConfig:S,clear:h(()=>{c(),b=structuredClone(y)},`clear`),setAccTitle:o,getAccTitle:f,setDiagramTitle:d,getDiagramTitle:r,getAccDescription:s,setAccDescription:a},A=h(t=>{e(t,k);let{axes:n,curves:r,options:i}=t;k.setAxes(n),k.setCurves(r),k.setOptions(i)},`populate`),j={parse:h(async e=>{let t=await g(`radar`,e);m.debug(t),A(t)},`parse`)},M=h((e,n,r,i)=>{let a=i.db,o=a.getAxes(),s=a.getCurves(),c=a.getOptions(),l=a.getConfig(),u=a.getDiagramTitle(),d=N(t(n),l),f=c.max??Math.max(...s.map(e=>Math.max(...e.entries))),p=c.min,m=Math.min(l.width,l.height)/2;P(d,o,m,c.ticks,c.graticule),F(d,o,m,l),I(d,o,s,p,f,c.graticule,l),z(d,s,c.showLegend,l),d.append(`text`).attr(`class`,`radarTitle`).text(u).attr(`x`,0).attr(`y`,-l.height/2-l.marginTop)},`draw`),N=h((e,t)=>{let n=t.width+t.marginLeft+t.marginRight,r=t.height+t.marginTop+t.marginBottom,i={x:t.marginLeft+t.width/2,y:t.marginTop+t.height/2};return l(e,r,n,t.useMaxWidth??!0),e.attr(`viewBox`,`0 0 ${n} ${r}`).attr(`overflow`,`visible`),e.append(`g`).attr(`transform`,`translate(${i.x}, ${i.y})`)},`drawFrame`),P=h((e,t,n,r,i)=>{if(i===`circle`)for(let t=0;t<r;t++){let i=n*(t+1)/r;e.append(`circle`).attr(`r`,i).attr(`class`,`radarGraticule`)}else if(i===`polygon`){let i=t.length;for(let a=0;a<r;a++){let o=n*(a+1)/r,s=t.map((e,t)=>{let n=2*t*Math.PI/i-Math.PI/2;return`${o*Math.cos(n)},${o*Math.sin(n)}`}).join(` `);e.append(`polygon`).attr(`points`,s).attr(`class`,`radarGraticule`)}}},`drawGraticule`),F=h((e,t,n,r)=>{let i=t.length;for(let a=0;a<i;a++){let o=t[a].label,s=2*a*Math.PI/i-Math.PI/2,c=Math.cos(s),l=Math.sin(s);e.append(`line`).attr(`x1`,0).attr(`y1`,0).attr(`x2`,n*r.axisScaleFactor*c).attr(`y2`,n*r.axisScaleFactor*l).attr(`class`,`radarAxisLine`);let u=c>.01?`start`:c<-.01?`end`:`middle`,d=l>.01?`hanging`:l<-.01?`auto`:`central`;e.append(`text`).text(o).attr(`x`,n*r.axisLabelFactor*c+4*c).attr(`y`,n*r.axisLabelFactor*l+4*l).attr(`text-anchor`,u).attr(`dominant-baseline`,d).attr(`class`,`radarAxisLabel`)}},`drawAxes`);function I(e,t,n,r,i,a,o){let s=t.length,c=Math.min(o.width,o.height)/2;n.forEach((t,n)=>{if(t.entries.length!==s)return;let l=t.entries.map((e,t)=>{let n=2*Math.PI*t/s-Math.PI/2,a=L(e,r,i,c);return{x:a*Math.cos(n),y:a*Math.sin(n)}});a===`circle`?e.append(`path`).attr(`d`,R(l,o.curveTension)).attr(`class`,`radarCurve-${n}`):a===`polygon`&&e.append(`polygon`).attr(`points`,l.map(e=>`${e.x},${e.y}`).join(` `)).attr(`class`,`radarCurve-${n}`)})}h(I,`drawCurves`);function L(e,t,n,r){return r*(Math.min(Math.max(e,t),n)-t)/(n-t)}h(L,`relativeRadius`);function R(e,t){let n=e.length,r=`M${e[0].x},${e[0].y}`;for(let i=0;i<n;i++){let a=e[(i-1+n)%n],o=e[i],s=e[(i+1)%n],c=e[(i+2)%n],l={x:o.x+(s.x-a.x)*t,y:o.y+(s.y-a.y)*t},u={x:s.x-(c.x-o.x)*t,y:s.y-(c.y-o.y)*t};r+=` C${l.x},${l.y} ${u.x},${u.y} ${s.x},${s.y}`}return`${r} Z`}h(R,`closedRoundCurve`);function z(e,t,n,r){if(!n)return;let i=(r.width/2+r.marginRight)*3/4,a=-(r.height/2+r.marginTop)*3/4;t.forEach((t,n)=>{let r=e.append(`g`).attr(`transform`,`translate(${i}, ${a+n*20})`);r.append(`rect`).attr(`width`,12).attr(`height`,12).attr(`class`,`radarLegendBox-${n}`),r.append(`text`).attr(`x`,16).attr(`y`,0).attr(`class`,`radarLegendText`).text(t.label)})}h(z,`drawLegend`);var B={draw:M},V=h((e,t)=>{let n=``;for(let r=0;r<e.THEME_COLOR_LIMIT;r++){let i=e[`cScale${r}`];n+=`
|
|
2
2
|
.radarCurve-${r} {
|
|
3
3
|
color: ${i};
|
|
4
4
|
fill: ${i};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as e}from"./chunk-TU62E6Q5-C9NqnUav.js";import{t}from"./chunk-JWPE2WC7-DVXcaiue.js";import{a as n}from"./mermaid.core-BWmWf6XO.js";import{i as r,n as i}from"./chunk-X4PVCEUW-BeLfETDx.js";import{i as a}from"./chunk-6MUBBAK2-BczXkMV-.js";import{C as o,E as s,H as c,U as l,_ as u,a as d,c as f,f as p,q as m,v as h,y as g}from"./chunk-BG4553SI-FBaleaLz.js";import{n as _,t as v}from"./d3-selection-DfFLTR9d.js";import{n as y}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{n as b}from"./mermaid-parser.core-Dum100hC.js";import{r as x,y as S}from"./d3-scale-CElPUUud.js";function C(e){var t=0,n=e.children,r=n&&n.length;if(!r)t=1;else for(;--r>=0;)t+=n[r].value;e.value=t}function w(){return this.eachAfter(C)}function T(e,t){let n=-1;for(let r of this)e.call(t,r,++n,this);return this}function E(e,t){for(var n=this,r=[n],i,a,o=-1;n=r.pop();)if(e.call(t,n,++o,this),i=n.children)for(a=i.length-1;a>=0;--a)r.push(i[a]);return this}function D(e,t){for(var n=this,r=[n],i=[],a,o,s,c=-1;n=r.pop();)if(i.push(n),a=n.children)for(o=0,s=a.length;o<s;++o)r.push(a[o]);for(;n=i.pop();)e.call(t,n,++c,this);return this}function O(e,t){let n=-1;for(let r of this)if(e.call(t,r,++n,this))return r}function k(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n})}function A(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function ee(e){for(var t=this,n=j(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r}function j(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}function M(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function N(){return Array.from(this)}function P(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function F(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*te(){var e=this,t,n=[e],r,i,a;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,r=e.children)for(i=0,a=r.length;i<a;++i)n.push(r[i]);while(n.length)}function I(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=z)):t===void 0&&(t=R);for(var n=new H(e),r,i=[n],a,o,s,c;r=i.pop();)if((o=t(r.data))&&(c=(o=Array.from(o)).length))for(r.children=o,s=c-1;s>=0;--s)i.push(a=o[s]=new H(o[s])),a.parent=r,a.depth=r.depth+1;return n.eachBefore(V)}function L(){return I(this).eachBefore(B)}function R(e){return e.children}function z(e){return Array.isArray(e)?e[1]:null}function B(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function V(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function H(e){this.data=e,this.depth=this.height=0,this.parent=null}H.prototype=I.prototype={constructor:H,count:w,each:T,eachAfter:D,eachBefore:E,find:O,sum:k,sort:A,path:ee,ancestors:M,descendants:N,leaves:P,links:F,copy:L,[Symbol.iterator]:te};function U(e){if(typeof e!=`function`)throw Error();return e}function W(){return 0}function G(e){return function(){return e}}function ne(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 K(e,t,n,r,i){for(var a=e.children,o,s=-1,c=a.length,l=e.value&&(r-t)/e.value;++s<c;)o=a[s],o.y0=n,o.y1=i,o.x0=t,o.x1=t+=o.value*l}Object.create(H.prototype);function q(e,t,n,r,i){for(var a=e.children,o,s=-1,c=a.length,l=e.value&&(i-n)/e.value;++s<c;)o=a[s],o.x0=t,o.x1=r,o.y0=n,o.y1=n+=o.value*l}var J=(1+Math.sqrt(5))/2;function Y(e,t,n,r,i,a){for(var o=[],s=t.children,c,l,u=0,d=0,f=s.length,p,m,h=t.value,g,_,v,y,b,x,S;u<f;){p=i-n,m=a-r;do g=s[d++].value;while(!g&&d<f);for(_=v=g,x=Math.max(m/p,p/m)/(h*e),S=g*g*x,b=Math.max(v/S,S/_);d<f;++d){if(g+=l=s[d].value,l<_&&(_=l),l>v&&(v=l),S=g*g*x,y=Math.max(v/S,S/_),y>b){g-=l;break}b=y}o.push(c={value:g,dice:p<m,children:s.slice(u,d)}),c.dice?K(c,n,r,i,h?r+=m*g/h:a):q(c,n,r,h?n+=p*g/h:i,a),h-=g,u=d}return o}var re=(function e(t){function n(e,n,r,i,a){Y(t,e,n,r,i,a)}return n.ratio=function(t){return e((t=+t)>1?t:1)},n})(J);function ie(){var e=re,t=!1,n=1,r=1,i=[0],a=W,o=W,s=W,c=W,l=W;function u(e){return e.x0=e.y0=0,e.x1=n,e.y1=r,e.eachBefore(d),i=[0],t&&e.eachBefore(ne),e}function d(t){var n=i[t.depth],r=t.x0+n,u=t.y0+n,d=t.x1-n,f=t.y1-n;d<r&&(r=d=(r+d)/2),f<u&&(u=f=(u+f)/2),t.x0=r,t.y0=u,t.x1=d,t.y1=f,t.children&&(n=i[t.depth+1]=a(t)/2,r+=l(t)-n,u+=o(t)-n,d-=s(t)-n,f-=c(t)-n,d<r&&(r=d=(r+d)/2),f<u&&(u=f=(u+f)/2),e(t,r,u,d,f))}return u.round=function(e){return arguments.length?(t=!!e,u):t},u.size=function(e){return arguments.length?(n=+e[0],r=+e[1],u):[n,r]},u.tile=function(t){return arguments.length?(e=U(t),u):e},u.padding=function(e){return arguments.length?u.paddingInner(e).paddingOuter(e):u.paddingInner()},u.paddingInner=function(e){return arguments.length?(a=typeof e==`function`?e:G(+e),u):a},u.paddingOuter=function(e){return arguments.length?u.paddingTop(e).paddingRight(e).paddingBottom(e).paddingLeft(e):u.paddingTop()},u.paddingTop=function(e){return arguments.length?(o=typeof e==`function`?e:G(+e),u):o},u.paddingRight=function(e){return arguments.length?(s=typeof e==`function`?e:G(+e),u):s},u.paddingBottom=function(e){return arguments.length?(c=typeof e==`function`?e:G(+e),u):c},u.paddingLeft=function(e){return arguments.length?(l=typeof e==`function`?e:G(+e),u):l},u}(function e(t){function n(e,n,r,i,a){if((o=e._squarify)&&o.ratio===t)for(var o,s,c,l,u=-1,d,f=o.length,p=e.value;++u<f;){for(s=o[u],c=s.children,l=s.value=0,d=c.length;l<d;++l)s.value+=c[l].value;s.dice?K(s,n,r,i,p?r+=(a-r)*s.value/p:a):q(s,n,r,p?n+=(i-n)*s.value/p:i,a),p-=s.value}else e._squarify=o=Y(t,e,n,r,i,a),o.ratio=t}return n.ratio=function(t){return e((t=+t)>1?t:1)},n})(J);var X=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=l,this.getAccTitle=h,this.setDiagramTitle=m,this.getDiagramTitle=o,this.getAccDescription=u,this.setAccDescription=c}static{y(this,`TreeMapDB`)}getNodes(){return this.nodes}getConfig(){let e=p,t=g();return a({...e.treemap,...t.treemap??{}})}addNode(e,t){this.nodes.push(e),this.levels.set(e,t),t===0&&(this.outerNodes.push(e),this.root??=e)}getRoot(){return{name:``,children:this.outerNodes}}addClass(e,t){let n=this.classes.get(e)??{id:e,styles:[],textStyles:[]},r=t.replace(/\\,/g,`§§§`).replace(/,/g,`;`).replace(/§§§/g,`,`).split(`;`);r&&r.forEach(e=>{i(e)&&(n?.textStyles?n.textStyles.push(e):n.textStyles=[e]),n?.styles?n.styles.push(e):n.styles=[e]}),this.classes.set(e,n)}getClasses(){return this.classes}getStylesForClass(e){return this.classes.get(e)?.styles??[]}clear(){d(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}};function Z(e){if(!e.length)return[];let t=[],n=[];return e.forEach(e=>{let r={name:e.name,children:e.type===`Leaf`?void 0:[]};for(r.classSelector=e?.classSelector,e?.cssCompiledStyles&&(r.cssCompiledStyles=e.cssCompiledStyles),e.type===`Leaf`&&e.value!==void 0&&(r.value=e.value);n.length>0&&n[n.length-1].level>=e.level;)n.pop();if(n.length===0)t.push(r);else{let e=n[n.length-1].node;e.children?e.children.push(r):e.children=[r]}e.type!==`Leaf`&&n.push({node:r,level:e.level})}),t}y(Z,`buildHierarchy`);var ae=y((e,n)=>{t(e,n);let r=[];for(let t of e.TreemapRows??[])t.$type===`ClassDefStatement`&&n.addClass(t.className??``,t.styleText??``);for(let t of e.TreemapRows??[]){let e=t.item;if(!e)continue;let i=t.indent?parseInt(t.indent):0,a=oe(e),o=e.classSelector?n.getStylesForClass(e.classSelector):[],s=o.length>0?o:void 0,c={level:i,name:a,type:e.$type,value:e.value,classSelector:e.classSelector,cssCompiledStyles:s};r.push(c)}let i=Z(r),a=y((e,t)=>{for(let r of e)n.addNode(r,t),r.children&&r.children.length>0&&a(r.children,t+1)},`addNodesRecursively`);a(i,0)},`populate`),oe=y(e=>e.name?String(e.name):``,`getItemName`),se={parser:{yy:void 0},parse:y(async e=>{try{let t=await b(`treemap`,e);_.debug(`Treemap AST:`,t);let n=se.parser?.yy;if(!(n instanceof X))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.`);ae(t,n)}catch(e){throw _.error(`Error parsing treemap:`,e),e}},`parse`)},ce=10,Q=10,$=25,le={draw:y((t,i,a,o)=>{let s=o.db,c=s.getConfig(),l=c.padding??ce,u=s.getDiagramTitle(),d=s.getRoot(),{themeVariables:p}=g();if(!d)return;let m=u?30:0,h=n(i),b=c.nodeWidth?c.nodeWidth*Q:960,C=c.nodeHeight?c.nodeHeight*Q:500,w=b,T=C+m;h.attr(`viewBox`,`0 0 ${w} ${T}`),f(h,T,w,c.useMaxWidth);let E;try{let e=c.valueFormat||`,`;if(e===`$0,0`)E=y(e=>`$`+S(`,`)(e),`valueFormat`);else if(e.startsWith(`$`)&&e.includes(`,`)){let t=/\.\d+/.exec(e),n=t?t[0]:``;E=y(e=>`$`+S(`,`+n)(e),`valueFormat`)}else if(e.startsWith(`$`)){let t=e.substring(1);E=y(e=>`$`+S(t||``)(e),`valueFormat`)}else E=S(e)}catch(e){_.error(`Error creating format function:`,e),E=S(`,`)}let D=x().range([`transparent`,p.cScale0,p.cScale1,p.cScale2,p.cScale3,p.cScale4,p.cScale5,p.cScale6,p.cScale7,p.cScale8,p.cScale9,p.cScale10,p.cScale11]),O=x().range([`transparent`,p.cScalePeer0,p.cScalePeer1,p.cScalePeer2,p.cScalePeer3,p.cScalePeer4,p.cScalePeer5,p.cScalePeer6,p.cScalePeer7,p.cScalePeer8,p.cScalePeer9,p.cScalePeer10,p.cScalePeer11]),k=x().range([p.cScaleLabel0,p.cScaleLabel1,p.cScaleLabel2,p.cScaleLabel3,p.cScaleLabel4,p.cScaleLabel5,p.cScaleLabel6,p.cScaleLabel7,p.cScaleLabel8,p.cScaleLabel9,p.cScaleLabel10,p.cScaleLabel11]);u&&h.append(`text`).attr(`x`,w/2).attr(`y`,m/2).attr(`class`,`treemapTitle`).attr(`text-anchor`,`middle`).attr(`dominant-baseline`,`middle`).text(u);let A=h.append(`g`).attr(`transform`,`translate(0, ${m})`).attr(`class`,`treemapContainer`),ee=I(d).sum(e=>e.value??0).sort((e,t)=>(t.value??0)-(e.value??0)),j=ie().size([b,C]).paddingTop(e=>e.children&&e.children.length>0?$+Q:0).paddingInner(l).paddingLeft(e=>e.children&&e.children.length>0?Q:0).paddingRight(e=>e.children&&e.children.length>0?Q:0).paddingBottom(e=>e.children&&e.children.length>0?Q:0).round(!0)(ee),M=j.descendants().filter(e=>e.children&&e.children.length>0),N=A.selectAll(`.treemapSection`).data(M).enter().append(`g`).attr(`class`,`treemapSection`).attr(`transform`,e=>`translate(${e.x0},${e.y0})`);N.append(`rect`).attr(`width`,e=>e.x1-e.x0).attr(`height`,$).attr(`class`,`treemapSectionHeader`).attr(`fill`,`none`).attr(`fill-opacity`,.6).attr(`stroke-width`,.6).attr(`style`,e=>e.depth===0?`display: none;`:``),N.append(`clipPath`).attr(`id`,(e,t)=>`clip-section-${i}-${t}`).append(`rect`).attr(`width`,e=>Math.max(0,e.x1-e.x0-12)).attr(`height`,$),N.append(`rect`).attr(`width`,e=>e.x1-e.x0).attr(`height`,e=>e.y1-e.y0).attr(`class`,(e,t)=>`treemapSection section${t}`).attr(`fill`,e=>D(e.data.name)).attr(`fill-opacity`,.6).attr(`stroke`,e=>O(e.data.name)).attr(`stroke-width`,2).attr(`stroke-opacity`,.4).attr(`style`,e=>{if(e.depth===0)return`display: none;`;let t=r({cssCompiledStyles:e.data.cssCompiledStyles});return t.nodeStyles+`;`+t.borderStyles.join(`;`)}),N.append(`text`).attr(`class`,`treemapSectionLabel`).attr(`x`,6).attr(`y`,$/2).attr(`dominant-baseline`,`middle`).text(e=>e.depth===0?``:e.data.name).attr(`font-weight`,`bold`).attr(`clip-path`,(e,t)=>`url(#clip-section-${i}-${t})`).attr(`style`,e=>e.depth===0?`display: none;`:`dominant-baseline: middle; font-size: 12px; fill:`+k(e.data.name)+`; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;`+r({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace(`color:`,`fill:`)).each(function(e){if(e.depth===0)return;let t=v(this),n=e.data.name;t.text(n);let r=e.x1-e.x0,i;i=c.showValues!==!1&&e.value?r-10-30-10-6:r-6-6;let a=Math.max(15,i),o=t.node();if(o.getComputedTextLength()>a){let e=n;for(;e.length>0;){if(e=n.substring(0,e.length-1),e.length===0){t.text(`...`),o.getComputedTextLength()>a&&t.text(``);break}if(t.text(e+`...`),o.getComputedTextLength()<=a)break}}}),c.showValues!==!1&&N.append(`text`).attr(`class`,`treemapSectionValue`).attr(`x`,e=>e.x1-e.x0-10).attr(`y`,$/2).attr(`text-anchor`,`end`).attr(`dominant-baseline`,`middle`).text(e=>e.value?E(e.value):``).attr(`font-style`,`italic`).attr(`style`,e=>e.depth===0?`display: none;`:`text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:`+k(e.data.name)+`; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;`+r({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace(`color:`,`fill:`));let P=j.leaves(),F=P.length>20,te=F?16:38,L=F?14:28,R=F?4:8,z=F?4:6,B=F?2:4,V=F?8:10,H=F?1:2,U=A.selectAll(`.treemapLeafGroup`).data(P).enter().append(`g`).attr(`class`,(e,t)=>`treemapNode treemapLeafGroup leaf${t}${e.data.classSelector?` ${e.data.classSelector}`:``}x`).attr(`transform`,e=>`translate(${e.x0},${e.y0})`);U.append(`rect`).attr(`width`,e=>e.x1-e.x0).attr(`height`,e=>e.y1-e.y0).attr(`class`,`treemapLeaf`).attr(`fill`,e=>e.parent?D(e.parent.data.name):D(e.data.name)).attr(`style`,e=>r({cssCompiledStyles:e.data.cssCompiledStyles}).nodeStyles).attr(`fill-opacity`,.3).attr(`stroke`,e=>e.parent?D(e.parent.data.name):D(e.data.name)).attr(`stroke-width`,3),U.append(`clipPath`).attr(`id`,(e,t)=>`clip-${i}-${t}`).append(`rect`).attr(`width`,e=>Math.max(0,e.x1-e.x0-4)).attr(`height`,e=>Math.max(0,e.y1-e.y0-4)),U.append(`text`).attr(`class`,`treemapLabel`).attr(`x`,e=>(e.x1-e.x0)/2).attr(`y`,e=>(e.y1-e.y0)/2).attr(`style`,e=>`text-anchor: middle; dominant-baseline: middle; font-size: ${te}px;fill:`+k(e.data.name)+`;`+r({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace(`color:`,`fill:`)).attr(`clip-path`,(e,t)=>`url(#clip-${i}-${t})`).text(e=>e.data.name).each(function(e){let t=v(this),n=e.x1-e.x0,r=e.y1-e.y0,i=t.node(),a=n-2*B,o=r-2*B;if(a<V||o<V){t.style(`display`,`none`);return}let s=parseInt(t.style(`font-size`),10),c=.6;for(;i.getComputedTextLength()>a&&s>R;)s--,t.style(`font-size`,`${s}px`);let l=Math.max(z,Math.min(L,Math.round(s*c))),u=s+H+l;for(;u>o&&s>R&&(s--,l=Math.max(z,Math.min(L,Math.round(s*c))),!(l<z&&s===R));)t.style(`font-size`,`${s}px`),u=s+H+l;t.style(`font-size`,`${s}px`),F?(s<R||o<R)&&t.style(`display`,`none`):(i.getComputedTextLength()>a||s<R||o<s)&&t.style(`display`,`none`)}),c.showValues!==!1&&U.append(`text`).attr(`class`,`treemapValue`).attr(`x`,e=>(e.x1-e.x0)/2).attr(`y`,function(e){return(e.y1-e.y0)/2}).attr(`style`,e=>`text-anchor: middle; dominant-baseline: hanging; font-size: ${L}px;fill:`+k(e.data.name)+`;`+r({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace(`color:`,`fill:`)).attr(`clip-path`,(e,t)=>`url(#clip-${i}-${t})`).text(e=>e.value?E(e.value):``).each(function(e){let t=v(this),n=this.parentNode;if(!n){t.style(`display`,`none`);return}let r=v(n).select(`.treemapLabel`);if(r.empty()||r.style(`display`)===`none`){t.style(`display`,`none`);return}let i=parseFloat(r.style(`font-size`)),a=Math.max(z,Math.min(L,Math.round(i*.6)));t.style(`font-size`,`${a}px`);let o=(e.y1-e.y0)/2+i/2+H;t.attr(`y`,o);let s=e.x1-e.x0,c=e.y1-e.y0-4,l=s-2*B;t.node().getComputedTextLength()>l||o+a>c||a<z?t.style(`display`,`none`):t.style(`display`,null)});let W=c.diagramPadding??8;e(h,W,`flowchart`,c?.useMaxWidth||!1)},`draw`),getClasses:y(function(e,t){return t.db.getClasses()},`getClasses`)},ue={sectionStrokeColor:`black`,sectionStrokeWidth:`1`,sectionFillColor:`#efefef`,leafStrokeColor:`black`,leafStrokeWidth:`1`,leafFillColor:`#efefef`,labelFontSize:`12px`,valueFontSize:`10px`,titleFontSize:`14px`},de={parser:se,get db(){return new X},renderer:le,styles:y(({treemap:e}={})=>{let t=s(),n=g(),r=a(t,n.themeVariables),i=a(ue,e),o=i.titleColor??r.titleColor,c=i.labelColor??r.textColor,l=i.valueColor??r.textColor;return`
|
|
1
|
+
import{t as e}from"./chunk-TU62E6Q5-vXcRfGci.js";import{t}from"./chunk-JWPE2WC7-DVXcaiue.js";import{a as n}from"./mermaid.core-DC20ZwJj.js";import{i as r,n as i}from"./chunk-X4PVCEUW-CIh6H4Y2.js";import{i as a}from"./chunk-6MUBBAK2-7Y9ezehi.js";import{C as o,E as s,H as c,U as l,_ as u,a as d,c as f,f as p,q as m,v as h,y as g}from"./chunk-BG4553SI-DsNATY2m.js";import{n as _,t as v}from"./d3-selection-ZcE6yRN5.js";import{n as y}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{n as b}from"./mermaid-parser.core-BfCv4CYZ.js";import{r as x,y as S}from"./d3-scale-CElPUUud.js";function C(e){var t=0,n=e.children,r=n&&n.length;if(!r)t=1;else for(;--r>=0;)t+=n[r].value;e.value=t}function w(){return this.eachAfter(C)}function T(e,t){let n=-1;for(let r of this)e.call(t,r,++n,this);return this}function E(e,t){for(var n=this,r=[n],i,a,o=-1;n=r.pop();)if(e.call(t,n,++o,this),i=n.children)for(a=i.length-1;a>=0;--a)r.push(i[a]);return this}function D(e,t){for(var n=this,r=[n],i=[],a,o,s,c=-1;n=r.pop();)if(i.push(n),a=n.children)for(o=0,s=a.length;o<s;++o)r.push(a[o]);for(;n=i.pop();)e.call(t,n,++c,this);return this}function O(e,t){let n=-1;for(let r of this)if(e.call(t,r,++n,this))return r}function k(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n})}function A(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function ee(e){for(var t=this,n=j(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r}function j(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}function M(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function N(){return Array.from(this)}function P(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function F(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*te(){var e=this,t,n=[e],r,i,a;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,r=e.children)for(i=0,a=r.length;i<a;++i)n.push(r[i]);while(n.length)}function I(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=z)):t===void 0&&(t=R);for(var n=new H(e),r,i=[n],a,o,s,c;r=i.pop();)if((o=t(r.data))&&(c=(o=Array.from(o)).length))for(r.children=o,s=c-1;s>=0;--s)i.push(a=o[s]=new H(o[s])),a.parent=r,a.depth=r.depth+1;return n.eachBefore(V)}function L(){return I(this).eachBefore(B)}function R(e){return e.children}function z(e){return Array.isArray(e)?e[1]:null}function B(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function V(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function H(e){this.data=e,this.depth=this.height=0,this.parent=null}H.prototype=I.prototype={constructor:H,count:w,each:T,eachAfter:D,eachBefore:E,find:O,sum:k,sort:A,path:ee,ancestors:M,descendants:N,leaves:P,links:F,copy:L,[Symbol.iterator]:te};function U(e){if(typeof e!=`function`)throw Error();return e}function W(){return 0}function G(e){return function(){return e}}function ne(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 K(e,t,n,r,i){for(var a=e.children,o,s=-1,c=a.length,l=e.value&&(r-t)/e.value;++s<c;)o=a[s],o.y0=n,o.y1=i,o.x0=t,o.x1=t+=o.value*l}Object.create(H.prototype);function q(e,t,n,r,i){for(var a=e.children,o,s=-1,c=a.length,l=e.value&&(i-n)/e.value;++s<c;)o=a[s],o.x0=t,o.x1=r,o.y0=n,o.y1=n+=o.value*l}var J=(1+Math.sqrt(5))/2;function Y(e,t,n,r,i,a){for(var o=[],s=t.children,c,l,u=0,d=0,f=s.length,p,m,h=t.value,g,_,v,y,b,x,S;u<f;){p=i-n,m=a-r;do g=s[d++].value;while(!g&&d<f);for(_=v=g,x=Math.max(m/p,p/m)/(h*e),S=g*g*x,b=Math.max(v/S,S/_);d<f;++d){if(g+=l=s[d].value,l<_&&(_=l),l>v&&(v=l),S=g*g*x,y=Math.max(v/S,S/_),y>b){g-=l;break}b=y}o.push(c={value:g,dice:p<m,children:s.slice(u,d)}),c.dice?K(c,n,r,i,h?r+=m*g/h:a):q(c,n,r,h?n+=p*g/h:i,a),h-=g,u=d}return o}var re=(function e(t){function n(e,n,r,i,a){Y(t,e,n,r,i,a)}return n.ratio=function(t){return e((t=+t)>1?t:1)},n})(J);function ie(){var e=re,t=!1,n=1,r=1,i=[0],a=W,o=W,s=W,c=W,l=W;function u(e){return e.x0=e.y0=0,e.x1=n,e.y1=r,e.eachBefore(d),i=[0],t&&e.eachBefore(ne),e}function d(t){var n=i[t.depth],r=t.x0+n,u=t.y0+n,d=t.x1-n,f=t.y1-n;d<r&&(r=d=(r+d)/2),f<u&&(u=f=(u+f)/2),t.x0=r,t.y0=u,t.x1=d,t.y1=f,t.children&&(n=i[t.depth+1]=a(t)/2,r+=l(t)-n,u+=o(t)-n,d-=s(t)-n,f-=c(t)-n,d<r&&(r=d=(r+d)/2),f<u&&(u=f=(u+f)/2),e(t,r,u,d,f))}return u.round=function(e){return arguments.length?(t=!!e,u):t},u.size=function(e){return arguments.length?(n=+e[0],r=+e[1],u):[n,r]},u.tile=function(t){return arguments.length?(e=U(t),u):e},u.padding=function(e){return arguments.length?u.paddingInner(e).paddingOuter(e):u.paddingInner()},u.paddingInner=function(e){return arguments.length?(a=typeof e==`function`?e:G(+e),u):a},u.paddingOuter=function(e){return arguments.length?u.paddingTop(e).paddingRight(e).paddingBottom(e).paddingLeft(e):u.paddingTop()},u.paddingTop=function(e){return arguments.length?(o=typeof e==`function`?e:G(+e),u):o},u.paddingRight=function(e){return arguments.length?(s=typeof e==`function`?e:G(+e),u):s},u.paddingBottom=function(e){return arguments.length?(c=typeof e==`function`?e:G(+e),u):c},u.paddingLeft=function(e){return arguments.length?(l=typeof e==`function`?e:G(+e),u):l},u}(function e(t){function n(e,n,r,i,a){if((o=e._squarify)&&o.ratio===t)for(var o,s,c,l,u=-1,d,f=o.length,p=e.value;++u<f;){for(s=o[u],c=s.children,l=s.value=0,d=c.length;l<d;++l)s.value+=c[l].value;s.dice?K(s,n,r,i,p?r+=(a-r)*s.value/p:a):q(s,n,r,p?n+=(i-n)*s.value/p:i,a),p-=s.value}else e._squarify=o=Y(t,e,n,r,i,a),o.ratio=t}return n.ratio=function(t){return e((t=+t)>1?t:1)},n})(J);var X=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=l,this.getAccTitle=h,this.setDiagramTitle=m,this.getDiagramTitle=o,this.getAccDescription=u,this.setAccDescription=c}static{y(this,`TreeMapDB`)}getNodes(){return this.nodes}getConfig(){let e=p,t=g();return a({...e.treemap,...t.treemap??{}})}addNode(e,t){this.nodes.push(e),this.levels.set(e,t),t===0&&(this.outerNodes.push(e),this.root??=e)}getRoot(){return{name:``,children:this.outerNodes}}addClass(e,t){let n=this.classes.get(e)??{id:e,styles:[],textStyles:[]},r=t.replace(/\\,/g,`§§§`).replace(/,/g,`;`).replace(/§§§/g,`,`).split(`;`);r&&r.forEach(e=>{i(e)&&(n?.textStyles?n.textStyles.push(e):n.textStyles=[e]),n?.styles?n.styles.push(e):n.styles=[e]}),this.classes.set(e,n)}getClasses(){return this.classes}getStylesForClass(e){return this.classes.get(e)?.styles??[]}clear(){d(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}};function Z(e){if(!e.length)return[];let t=[],n=[];return e.forEach(e=>{let r={name:e.name,children:e.type===`Leaf`?void 0:[]};for(r.classSelector=e?.classSelector,e?.cssCompiledStyles&&(r.cssCompiledStyles=e.cssCompiledStyles),e.type===`Leaf`&&e.value!==void 0&&(r.value=e.value);n.length>0&&n[n.length-1].level>=e.level;)n.pop();if(n.length===0)t.push(r);else{let e=n[n.length-1].node;e.children?e.children.push(r):e.children=[r]}e.type!==`Leaf`&&n.push({node:r,level:e.level})}),t}y(Z,`buildHierarchy`);var ae=y((e,n)=>{t(e,n);let r=[];for(let t of e.TreemapRows??[])t.$type===`ClassDefStatement`&&n.addClass(t.className??``,t.styleText??``);for(let t of e.TreemapRows??[]){let e=t.item;if(!e)continue;let i=t.indent?parseInt(t.indent):0,a=oe(e),o=e.classSelector?n.getStylesForClass(e.classSelector):[],s=o.length>0?o:void 0,c={level:i,name:a,type:e.$type,value:e.value,classSelector:e.classSelector,cssCompiledStyles:s};r.push(c)}let i=Z(r),a=y((e,t)=>{for(let r of e)n.addNode(r,t),r.children&&r.children.length>0&&a(r.children,t+1)},`addNodesRecursively`);a(i,0)},`populate`),oe=y(e=>e.name?String(e.name):``,`getItemName`),se={parser:{yy:void 0},parse:y(async e=>{try{let t=await b(`treemap`,e);_.debug(`Treemap AST:`,t);let n=se.parser?.yy;if(!(n instanceof X))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.`);ae(t,n)}catch(e){throw _.error(`Error parsing treemap:`,e),e}},`parse`)},ce=10,Q=10,$=25,le={draw:y((t,i,a,o)=>{let s=o.db,c=s.getConfig(),l=c.padding??ce,u=s.getDiagramTitle(),d=s.getRoot(),{themeVariables:p}=g();if(!d)return;let m=u?30:0,h=n(i),b=c.nodeWidth?c.nodeWidth*Q:960,C=c.nodeHeight?c.nodeHeight*Q:500,w=b,T=C+m;h.attr(`viewBox`,`0 0 ${w} ${T}`),f(h,T,w,c.useMaxWidth);let E;try{let e=c.valueFormat||`,`;if(e===`$0,0`)E=y(e=>`$`+S(`,`)(e),`valueFormat`);else if(e.startsWith(`$`)&&e.includes(`,`)){let t=/\.\d+/.exec(e),n=t?t[0]:``;E=y(e=>`$`+S(`,`+n)(e),`valueFormat`)}else if(e.startsWith(`$`)){let t=e.substring(1);E=y(e=>`$`+S(t||``)(e),`valueFormat`)}else E=S(e)}catch(e){_.error(`Error creating format function:`,e),E=S(`,`)}let D=x().range([`transparent`,p.cScale0,p.cScale1,p.cScale2,p.cScale3,p.cScale4,p.cScale5,p.cScale6,p.cScale7,p.cScale8,p.cScale9,p.cScale10,p.cScale11]),O=x().range([`transparent`,p.cScalePeer0,p.cScalePeer1,p.cScalePeer2,p.cScalePeer3,p.cScalePeer4,p.cScalePeer5,p.cScalePeer6,p.cScalePeer7,p.cScalePeer8,p.cScalePeer9,p.cScalePeer10,p.cScalePeer11]),k=x().range([p.cScaleLabel0,p.cScaleLabel1,p.cScaleLabel2,p.cScaleLabel3,p.cScaleLabel4,p.cScaleLabel5,p.cScaleLabel6,p.cScaleLabel7,p.cScaleLabel8,p.cScaleLabel9,p.cScaleLabel10,p.cScaleLabel11]);u&&h.append(`text`).attr(`x`,w/2).attr(`y`,m/2).attr(`class`,`treemapTitle`).attr(`text-anchor`,`middle`).attr(`dominant-baseline`,`middle`).text(u);let A=h.append(`g`).attr(`transform`,`translate(0, ${m})`).attr(`class`,`treemapContainer`),ee=I(d).sum(e=>e.value??0).sort((e,t)=>(t.value??0)-(e.value??0)),j=ie().size([b,C]).paddingTop(e=>e.children&&e.children.length>0?$+Q:0).paddingInner(l).paddingLeft(e=>e.children&&e.children.length>0?Q:0).paddingRight(e=>e.children&&e.children.length>0?Q:0).paddingBottom(e=>e.children&&e.children.length>0?Q:0).round(!0)(ee),M=j.descendants().filter(e=>e.children&&e.children.length>0),N=A.selectAll(`.treemapSection`).data(M).enter().append(`g`).attr(`class`,`treemapSection`).attr(`transform`,e=>`translate(${e.x0},${e.y0})`);N.append(`rect`).attr(`width`,e=>e.x1-e.x0).attr(`height`,$).attr(`class`,`treemapSectionHeader`).attr(`fill`,`none`).attr(`fill-opacity`,.6).attr(`stroke-width`,.6).attr(`style`,e=>e.depth===0?`display: none;`:``),N.append(`clipPath`).attr(`id`,(e,t)=>`clip-section-${i}-${t}`).append(`rect`).attr(`width`,e=>Math.max(0,e.x1-e.x0-12)).attr(`height`,$),N.append(`rect`).attr(`width`,e=>e.x1-e.x0).attr(`height`,e=>e.y1-e.y0).attr(`class`,(e,t)=>`treemapSection section${t}`).attr(`fill`,e=>D(e.data.name)).attr(`fill-opacity`,.6).attr(`stroke`,e=>O(e.data.name)).attr(`stroke-width`,2).attr(`stroke-opacity`,.4).attr(`style`,e=>{if(e.depth===0)return`display: none;`;let t=r({cssCompiledStyles:e.data.cssCompiledStyles});return t.nodeStyles+`;`+t.borderStyles.join(`;`)}),N.append(`text`).attr(`class`,`treemapSectionLabel`).attr(`x`,6).attr(`y`,$/2).attr(`dominant-baseline`,`middle`).text(e=>e.depth===0?``:e.data.name).attr(`font-weight`,`bold`).attr(`clip-path`,(e,t)=>`url(#clip-section-${i}-${t})`).attr(`style`,e=>e.depth===0?`display: none;`:`dominant-baseline: middle; font-size: 12px; fill:`+k(e.data.name)+`; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;`+r({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace(`color:`,`fill:`)).each(function(e){if(e.depth===0)return;let t=v(this),n=e.data.name;t.text(n);let r=e.x1-e.x0,i;i=c.showValues!==!1&&e.value?r-10-30-10-6:r-6-6;let a=Math.max(15,i),o=t.node();if(o.getComputedTextLength()>a){let e=n;for(;e.length>0;){if(e=n.substring(0,e.length-1),e.length===0){t.text(`...`),o.getComputedTextLength()>a&&t.text(``);break}if(t.text(e+`...`),o.getComputedTextLength()<=a)break}}}),c.showValues!==!1&&N.append(`text`).attr(`class`,`treemapSectionValue`).attr(`x`,e=>e.x1-e.x0-10).attr(`y`,$/2).attr(`text-anchor`,`end`).attr(`dominant-baseline`,`middle`).text(e=>e.value?E(e.value):``).attr(`font-style`,`italic`).attr(`style`,e=>e.depth===0?`display: none;`:`text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:`+k(e.data.name)+`; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;`+r({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace(`color:`,`fill:`));let P=j.leaves(),F=P.length>20,te=F?16:38,L=F?14:28,R=F?4:8,z=F?4:6,B=F?2:4,V=F?8:10,H=F?1:2,U=A.selectAll(`.treemapLeafGroup`).data(P).enter().append(`g`).attr(`class`,(e,t)=>`treemapNode treemapLeafGroup leaf${t}${e.data.classSelector?` ${e.data.classSelector}`:``}x`).attr(`transform`,e=>`translate(${e.x0},${e.y0})`);U.append(`rect`).attr(`width`,e=>e.x1-e.x0).attr(`height`,e=>e.y1-e.y0).attr(`class`,`treemapLeaf`).attr(`fill`,e=>e.parent?D(e.parent.data.name):D(e.data.name)).attr(`style`,e=>r({cssCompiledStyles:e.data.cssCompiledStyles}).nodeStyles).attr(`fill-opacity`,.3).attr(`stroke`,e=>e.parent?D(e.parent.data.name):D(e.data.name)).attr(`stroke-width`,3),U.append(`clipPath`).attr(`id`,(e,t)=>`clip-${i}-${t}`).append(`rect`).attr(`width`,e=>Math.max(0,e.x1-e.x0-4)).attr(`height`,e=>Math.max(0,e.y1-e.y0-4)),U.append(`text`).attr(`class`,`treemapLabel`).attr(`x`,e=>(e.x1-e.x0)/2).attr(`y`,e=>(e.y1-e.y0)/2).attr(`style`,e=>`text-anchor: middle; dominant-baseline: middle; font-size: ${te}px;fill:`+k(e.data.name)+`;`+r({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace(`color:`,`fill:`)).attr(`clip-path`,(e,t)=>`url(#clip-${i}-${t})`).text(e=>e.data.name).each(function(e){let t=v(this),n=e.x1-e.x0,r=e.y1-e.y0,i=t.node(),a=n-2*B,o=r-2*B;if(a<V||o<V){t.style(`display`,`none`);return}let s=parseInt(t.style(`font-size`),10),c=.6;for(;i.getComputedTextLength()>a&&s>R;)s--,t.style(`font-size`,`${s}px`);let l=Math.max(z,Math.min(L,Math.round(s*c))),u=s+H+l;for(;u>o&&s>R&&(s--,l=Math.max(z,Math.min(L,Math.round(s*c))),!(l<z&&s===R));)t.style(`font-size`,`${s}px`),u=s+H+l;t.style(`font-size`,`${s}px`),F?(s<R||o<R)&&t.style(`display`,`none`):(i.getComputedTextLength()>a||s<R||o<s)&&t.style(`display`,`none`)}),c.showValues!==!1&&U.append(`text`).attr(`class`,`treemapValue`).attr(`x`,e=>(e.x1-e.x0)/2).attr(`y`,function(e){return(e.y1-e.y0)/2}).attr(`style`,e=>`text-anchor: middle; dominant-baseline: hanging; font-size: ${L}px;fill:`+k(e.data.name)+`;`+r({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace(`color:`,`fill:`)).attr(`clip-path`,(e,t)=>`url(#clip-${i}-${t})`).text(e=>e.value?E(e.value):``).each(function(e){let t=v(this),n=this.parentNode;if(!n){t.style(`display`,`none`);return}let r=v(n).select(`.treemapLabel`);if(r.empty()||r.style(`display`)===`none`){t.style(`display`,`none`);return}let i=parseFloat(r.style(`font-size`)),a=Math.max(z,Math.min(L,Math.round(i*.6)));t.style(`font-size`,`${a}px`);let o=(e.y1-e.y0)/2+i/2+H;t.attr(`y`,o);let s=e.x1-e.x0,c=e.y1-e.y0-4,l=s-2*B;t.node().getComputedTextLength()>l||o+a>c||a<z?t.style(`display`,`none`):t.style(`display`,null)});let W=c.diagramPadding??8;e(h,W,`flowchart`,c?.useMaxWidth||!1)},`draw`),getClasses:y(function(e,t){return t.db.getClasses()},`getClasses`)},ue={sectionStrokeColor:`black`,sectionStrokeWidth:`1`,sectionFillColor:`#efefef`,leafStrokeColor:`black`,leafStrokeWidth:`1`,leafFillColor:`#efefef`,labelFontSize:`12px`,valueFontSize:`10px`,titleFontSize:`14px`},de={parser:se,get db(){return new X},renderer:le,styles:y(({treemap:e}={})=>{let t=s(),n=g(),r=a(t,n.themeVariables),i=a(ue,e),o=i.titleColor??r.titleColor,c=i.labelColor??r.textColor,l=i.valueColor??r.textColor;return`
|
|
2
2
|
.treemapNode.section {
|
|
3
3
|
stroke: ${i.sectionStrokeColor};
|
|
4
4
|
stroke-width: ${i.sectionStrokeWidth};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{T as e}from"./chunk-NGNAAXSQ-Bxuf9Ivc.js";import{t}from"./chunk-JWPE2WC7-DVXcaiue.js";import{i as n,t as r,v as i}from"./chunk-6MUBBAK2-
|
|
1
|
+
import{T as e}from"./chunk-NGNAAXSQ-Bxuf9Ivc.js";import{t}from"./chunk-JWPE2WC7-DVXcaiue.js";import{i as n,t as r,v as i}from"./chunk-6MUBBAK2-7Y9ezehi.js";import{C as a,H as o,U as s,X as c,_ as l,a as u,b as d,f,q as p,v as m,y as h,z as g}from"./chunk-BG4553SI-DsNATY2m.js";import{n as _,t as ee}from"./d3-selection-ZcE6yRN5.js";import{n as v}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{n as te}from"./mermaid-parser.core-BfCv4CYZ.js";var y=`position frame`,b=`frame positioned`,x=`position relation`,S=`relation positioned`,ne=v(function(e){_.debug(`options str`,e)},`setOptions`),re=v(function(){return{}},`getOptions`),ie=v(function(){C(),u()},`clear`);function C(){w={}}v(C,`reset`);var ae=f.eventmodeling,oe=v(()=>n({...ae,...h().eventmodeling}),`getConfig`),w={};function T(){let e=se,{ast:t}=w,n=O();if(!t)throw Error(`No data for EventModel`);return t.frames.forEach((r,i)=>{let a=F(r,t.dataEntities,n);e=J(e,{$kind:y,index:i,frame:r,textProps:a});let o;V(r)?(_.debug(`source frame`,r.sourceFrames),o=t.frames.filter(e=>r.sourceFrames.some(t=>t.$refText===e.name)),o.forEach(t=>{e=J(e,{$kind:x,index:i,frame:r,sourceFrame:t})})):e=J(e,{$kind:x,index:i,frame:r})}),e={...e,sortedSwimlanesArray:R(e.swimlanes)},e}v(T,`getState`);function E(e){w.ast=void 0;let t=new Set;for(let n of e.frames){if(t.has(n.name)){let e=n.$cstNode?.range.start.line,t=e===void 0?``:` on line ${e+1}`;throw Error(`Duplicate event modeling frame ID "${n.name}"${t}`)}t.add(n.name)}w.ast=e}v(E,`setAst`);var D={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 O(){return D}v(O,`getDiagramProps`);var se={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function k(e){let t=e.split(`.`);if(t.length===2)return t[0]}v(k,`extractNamespace`);function A(e){let t=e.split(`.`);return t.length===2?t[1]:e}v(A,`extractName`);function j(e,t){if(t&&t.length!==0)return Object.values(e).find(e=>e.namespace===t)}v(j,`findSwimlaneByNamespace`);function M(e,t,n){return Math.max(t,...Object.keys(e).filter(e=>{let r=Number.parseInt(e);return r>t&&r<n}).map(e=>Number.parseInt(e)))+1}v(M,`findNextAvailableIndex`);function N(e,t){let n=k(e.entityIdentifier),r=j(t,n);switch(e.modelEntityType){case`ui`:case`pcr`:case`processor`:return r?{index:r.index,label:r.namespace||D.labelUiAutomation}:n?{index:M(t,0,100),label:D.labelUiAutomationPrefix+n}:{index:0,label:D.labelUiAutomation};case`rmo`:case`readmodel`:case`cmd`:case`command`:return r?{index:r.index,label:r.namespace||D.labelCommandReadModel}:n?{index:M(t,100,200),label:D.labelCommandReadModelPrefix+n}:{index:100,label:D.labelCommandReadModel};default:return r?{index:r.index,label:r.namespace||D.labelEvents}:n?{index:M(t,200,300),label:D.labelEventsPrefix+n}:{index:200,label:D.labelEvents}}}v(N,`calculateSwimlaneProps`);function P(e){let{themeVariables:t}=h();switch(e.modelEntityType){case`ui`:return{fill:t.emUiFill??`white`,stroke:t.emUiStroke??`#dbdada`};case`pcr`:case`processor`:return{fill:t.emProcessorFill??`#edb3f6`,stroke:t.emProcessorStroke??`#b88cbf`};case`rmo`:case`readmodel`:return{fill:t.emReadModelFill??`#d3f1a2`,stroke:t.emReadModelStroke??`#a3b732`};case`cmd`:case`command`:return{fill:t.emCommandFill??`#bcd6fe`,stroke:t.emCommandStroke??`#679ac3`};case`evt`:case`event`:return{fill:t.emEventFill??`#ffb778`,stroke:t.emEventStroke??`#c19a0f`};default:return{fill:`red`,stroke:`black`}}}v(P,`calculateEntityVisualProps`);function F(e,t,n){let a=h(),o=g(A(e.entityIdentifier)??``,a),s,c={fontSize:16,fontWeight:700,fontFamily:`"trebuchet ms", verdana, arial, sans-serif`,joinWith:`<br/>`},l=`<b>${i(o,n.textMaxWidth,c)}</b>`;if(e.dataInlineValue&&(s=e.dataInlineValue,s=s.substring(s.indexOf(`{`)+1),s=s.substring(0,s.lastIndexOf(`}`)-1),s=g(s,a),s=i(s,n.textMaxWidth,c),s=s.replaceAll(` `,` `)),e.dataReference){let r=t.find(t=>t.name===e.dataReference?.$refText);r&&(s=r.dataBlockValue,s=s.substring(s.indexOf(`{
|
|
2
2
|
`)+2),s=s.substring(0,s.lastIndexOf(`}`)-1),s=g(s,a),s=i(s,n.textMaxWidth,c),s=s.replaceAll(` `,` `),s+=`<br/>`)}let u=s!==void 0;u&&(l+=`<br/><br/><code style="text-align: left; display: block;max-width:${n.textMaxWidth}px">${s}</code>`);let d={fontSize:c.fontSize,fontWeight:c.fontWeight,fontFamily:c.fontFamily},f=r(l,d),p=u?f.width/3:f.width,m={content:l,width:p,height:f.height};return _.debug(`[${e.name}] ${e.entityIdentifier} text`,m),m}v(F,`calculateTextProps`);function I(e,t){let n=t,r=P(n.frame),i={width:n.textProps.width+2*D.boxTextPadding,height:n.textProps.height+2*D.boxTextPadding};return[{$kind:b,frame:n.frame,index:n.index,visual:r,dimension:i,textProps:n.textProps}]}v(I,`decidePositionFrame`);function ce(e,t,n){return t===void 0?D.contentStartX:t.index===e.index&&e.r?e.r+D.boxPadding:n===void 0?D.contentStartX:n.r-D.boxOverlap+D.boxPadding}v(ce,`calculateX`);function L(e,t){let n=[...e.map(e=>e.r),t];return Math.max(...n)}v(L,`calculateMaxRight`);function R(e){return Object.values(e).sort((e,t)=>e.index-t.index)}v(R,`sortedSwimlanesArray`);function z(e,t){let n=t,r=N(n.frame,e.swimlanes),i;i=r.index in e.swimlanes?e.swimlanes[r.index]:{index:r.index,label:r.label,r:0,y:r.index*D.swimlaneMinHeight+D.swimlaneGap,height:D.swimlaneMinHeight,maxHeight:D.swimlaneMinHeight};let a=e.boxes.length>0?e.boxes[e.boxes.length-1]:void 0,o=e.previousSwimlaneNumber===void 0?void 0:e.swimlanes[e.previousSwimlaneNumber],s={width:Math.max(D.boxMinWidth,Math.min(D.boxMaxWidth,n.dimension.width))+2*D.boxPadding,height:Math.max(D.boxMinHeight,Math.min(D.boxMaxHeight,n.dimension.height))+2*D.boxPadding},c=ce(i,o,a),l=c+s.width+D.boxPadding,u=L(Object.values(e.swimlanes),l);i.r=c+s.width,i.maxHeight=Math.max(i.maxHeight,s.height),i.height=Math.max(D.swimlaneMinHeight,i.maxHeight)+2*D.swimlanePadding;let d={x:c,y:D.swimlanePadding+i.y,r:l,dimension:s,leftSibling:!1,swimlane:i,visual:n.visual,text:n.textProps.content,frame:n.frame,index:n.index},f={...e,boxes:[...e.boxes,d],swimlanes:{...e.swimlanes,[`${i.index}`]:i},previousSwimlaneNumber:r.index,previousFrame:n.frame,maxR:u},p=R(f.swimlanes);p.length>0&&(p[0].y=0);for(let e=1;e<p.length;e++){let t=p[e],n=p[e-1];t.y=n.y+n.height+D.swimlaneGap}return f}v(z,`evolveFramePositioned`);function B(e,t){return e===0&&t.sourceFrames.length===0}v(B,`isFirstFrame`);function V(e){return e.sourceFrames!==void 0&&e.sourceFrames!==null&&e.sourceFrames.length>0}v(V,`hasSourceFrame`);function H(e,t){if(t!=null)return e.find(e=>e.frame.name===t.name)}v(H,`findBoxByFrame`);function U(e,t,n){if(!(n<0))for(let r=n;r>=0;r--){let n=e[r];if(n.swimlane.index!==t)return n}}v(U,`findBoxByLineIndex`);function W(t,n){let r=n;if(B(r.index,r.frame))return[];let i=H(t.boxes,r.frame);if(i===void 0)throw Error(`Target box not found for frame ${r.frame.name}`);let a;if(r.sourceFrame)a=H(t.boxes,r.sourceFrame);else{if(e(r.frame))return[];a=U(t.boxes,i.swimlane.index,r.index-1)}return a===void 0?[]:[{$kind:S,frame:r.frame,index:r.index,sourceBox:a,targetBox:i}]}v(W,`decidePositionRelation`);function G(e,t){let n=t,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]}}v(G,`evolveRelationPositioned`);var le={[y]:I,[x]:W},ue={[b]:z,[S]:G};function K(e,t){let n=le[t.$kind];if(n==null)return[];let r=n(e,t);return _.debug(`decided events`,r),r}v(K,`decide`);function q(e,t){let n=t.reduce((e,t)=>{let n=ue[t.$kind];return n==null?e:n(e,t)},e);return _.debug(`evolve events`,{state:e,newState:n,events:t}),n}v(q,`evolve`);function J(e,t){return q(e,K(e,t))}v(J,`dispatch`);var Y={getConfig:oe,preserveCommentsWhenParsing:!0,setOptions:ne,getOptions:re,clear:ie,setAccTitle:s,getAccTitle:m,getAccDescription:l,setAccDescription:o,setDiagramTitle:p,getDiagramTitle:a,setAst:E,getDiagramProps:O,getState:T},de={parse:v(async e=>{let n=await te(`eventmodeling`,e);_.debug(n),Y.setAst(n),t(n,Y)},`parse`)},fe=d()?.eventmodeling;function X(e,t){return n=>{let r=n.swimlane.y+t.swimlanePadding,i=e.append(`g`).attr(`class`,`em-box`);i.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),i.append(`foreignObject`).attr(`x`,n.x+t.boxPadding).attr(`y`,r+10).attr(`width`,n.dimension.width-2*t.boxPadding).attr(`height`,n.dimension.height-2*t.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)}}v(X,`renderD3Box`);function Z(e,t){return e>t}v(Z,`dirUpwards`);function Q(e,t,n,r){return i=>{let a=i.sourceBox.swimlane.y+t.swimlanePadding,o=i.targetBox.swimlane.y+t.swimlanePadding,s=Z(a,o),c=i.sourceBox.x+i.sourceBox.dimension.width*2/3,l=i.targetBox.x+i.targetBox.dimension.width/3,u,d;_.debug(`rendering relation up=${s} for `,{sourceBox:i.sourceBox,targetBox:i.targetBox}),s?(u=a,d=o+i.targetBox.dimension.height):(u=a+i.sourceBox.dimension.height,d=o);let f=r.emRelationStroke??i.visual.stroke;e.append(`path`).attr(`class`,`em-relation`).attr(`fill`,i.visual.fill).attr(`stroke`,f).attr(`stroke-width`,`1`).attr(`marker-end`,`url(#${n})`).attr(`d`,`M${c} ${u} L${l} ${d}`)}}v(Q,`renderD3Relation`);function $(e,t,n,r){return i=>{let a=e.append(`g`).attr(`class`,`em-swimlane`),o=r.emSwimlaneBackgroundOdd??`rgb(250,250,250)`,s=r.emSwimlaneBackgroundStroke??`rgb(240,240,240)`;a.append(`rect`).attr(`x`,0).attr(`y`,i.y).attr(`rx`,`3`).attr(`width`,t+n.swimlanePadding).attr(`height`,i.height).attr(`fill`,o).attr(`stroke`,s),a.append(`text`).attr(`font-weight`,n.swimlaneTextFontWeight).attr(`x`,30).attr(`y`,i.y+30).text(i.label)}}v($,`renderD3Swimlane`);var pe={parser:de,db:Y,renderer:{draw:v(function(e,t,n,r){if(_.debug(`in eventmodeling renderer`,e+`
|
|
3
3
|
`,`id:`,t,n),!fe)throw Error(`EventModeling config not found`);let i=r.db,{themeVariables:a,eventmodeling:o}=d(),s=ee(`[id="${t}"]`),l=i.getDiagramProps(),u=i.getState(),f=`em-arrowhead-${t}`,p=a.emArrowhead??`#000000`;u.sortedSwimlanesArray.forEach($(s,u.maxR,l,a)),u.boxes.forEach(X(s,l)),u.relations.forEach(Q(s,l,f,a)),s.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`,p),c(void 0,s,o?.padding??30,o?.useMaxWidth)},`draw`)},styles:v(e=>``,`getStyles`)};export{pe as diagram};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as e}from"./chunk-2Q5K7J3B-C1jixKkw.js";import{t}from"./chunk-JWPE2WC7-DVXcaiue.js";import{a as n}from"./mermaid.core-
|
|
1
|
+
import{t as e}from"./chunk-2Q5K7J3B-C1jixKkw.js";import{t}from"./chunk-JWPE2WC7-DVXcaiue.js";import{a as n}from"./mermaid.core-DC20ZwJj.js";import{i as r,t as i}from"./chunk-R3KSYZAL-D5MXUO36.js";import{i as a}from"./chunk-6MUBBAK2-7Y9ezehi.js";import{C as o,H as s,U as c,_ as l,a as u,c as d,f,q as p,v as m,y as h,z as g}from"./chunk-BG4553SI-DsNATY2m.js";import{n as _}from"./d3-selection-ZcE6yRN5.js";import{n as v}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{n as y}from"./mermaid-parser.core-BfCv4CYZ.js";var b=/[─━│┃└┗├┣]/,x=/[└┗├┣]/,S=/[─━]/,C=/^[\s│┃]+$/,w=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,T=/^\s*%%/,E=` `;function D(e){return e.some(e=>b.test(e))}v(D,`isBoxDrawingFormat`);function O(e){for(let t of e){let e=x.exec(t);if(e?.index&&e.index>0)return e.index}return 4}v(O,`inferSegmentWidth`);function k(e,t){return e.replace(/\bline\s+(\d+)\b/gi,(e,n)=>{let r=parseInt(n,10),i=t.get(r);return i?`line ${i}`:e})}v(k,`remapErrorLines`);function A(e){let t=e.split(`
|
|
2
2
|
`),n=new Map,r=-1;for(let[e,n]of t.entries())if(n.trim()===`treeView-beta`){r=e;break}if(r===-1)return{text:e,lineMap:n};let i=[];for(let e=r+1;e<t.length;e++){let n=t[e];n.trim()===``||T.test(n)||w.test(n)||C.test(n)||i.push(n.replace(/\t/g,` `))}if(!D(i))return{text:e,lineMap:n};let a=O(i),o=[],s=0;for(let e=0;e<=r;e++)o.push(t[e]),s++,n.set(s,e+1);for(let e=r+1;e<t.length;e++){let r=t[e],i=r.trim(),c=e+1;if(i===``||T.test(r)||w.test(r)){o.push(r),s++,n.set(s,c);continue}if(C.test(r))continue;let l=r.replace(/\t/g,` `),u=x.exec(l);if(u?.index!==void 0){let e=u.index,t=Math.round(e/a)+1,r=e+1;for(;r<l.length&&S.test(l[r]);)r++;for(;r<l.length&&l[r]===` `;)r++;let i=l.slice(r).trimEnd();if(!i)throw Error(`Line ${c}: Empty node \u2014 expected a filename or directory name after the box-drawing prefix`);let d=E.repeat(t);o.push(d+i),s++,n.set(s,c)}else if(/^[\s─━│┃└┗├┣]+$/.test(l))continue;else if(b.test(l))o.push(r),s++,n.set(s,c);else if(/^\s+/.test(l))throw Error(`Line ${c}: Unexpected indentation without box-drawing characters. In box-drawing format, use \u251C\u2500\u2500 or \u2514\u2500\u2500 prefixes for indented nodes.`);else o.push(r),s++,n.set(s,c)}return{text:o.join(`
|
|
3
3
|
`),lineMap:n}}v(A,`preprocessBoxDrawing`);var j=new e(()=>({cnt:1,stack:[{id:0,level:-1,name:`/`,nodeType:`directory`,children:[]}]})),M=v(()=>{j.reset(),u()},`clear`),N=v(()=>j.records.stack[0],`getRoot`),P=v(()=>j.records.cnt,`getCount`),F=f.treeView,I={clear:M,addNode:v((e,t,n,r,i,a)=>{for(;e<=j.records.stack[j.records.stack.length-1].level;)j.records.stack.pop();let o={id:j.records.cnt++,level:e,name:t,nodeType:n,icon:i,cssClass:r,description:a,children:[]};j.records.stack[j.records.stack.length-1].children.push(o),j.records.stack.push(o)},`addNode`),getRoot:N,getCount:P,getConfig:v(()=>a(F,h().treeView),`getConfig`),getAccTitle:m,getAccDescription:l,getDiagramTitle:o,setAccDescription:s,setAccTitle:c,setDiagramTitle:p},L=v(e=>{t(e,I);for(let t of e.nodes){let e=typeof t.indent==`number`?t.indent:0,n=t.name,r=n.endsWith(`/`);r&&(n=n.slice(0,-1));let i=r?`directory`:`file`,a=t.classAnnotation||void 0,o=t.iconAnnotation,s=o===void 0?void 0:o||`none`,c=t.descAnnotation||void 0,l=c?g(c,h()):void 0;I.addNode(e,n,i,a,s,l)}},`populate`),R={parse:v(async e=>{let{text:t,lineMap:n}=A(e);try{let e=await y(`treeView`,t);_.debug(e),L(e)}catch(e){throw n.size>0&&e instanceof Error&&(e.message=k(e.message,n)),e}},`parse`)},z={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 B(e,t){let n=t?.filenameIcons?.[e];if(n)return n;let r=e.lastIndexOf(`.`);if(r>0){let n=e.substring(r).toLowerCase(),i=t?.extensionIcons;return i?.[n]??i?.[n.slice(1)]}}v(B,`detectIcon`);function V(e,t){return e.includes(`:`)?e:e in z.icons||!t?`${z.prefix}:${e}`:`${t}:${e}`}v(V,`qualifyIcon`);function H(e,t){if(e.icon!==`none`){if(e.icon)return V(e.icon,t.defaultIconPack);if(t.showIcons){if(e.nodeType===`file`){let n=B(e.name,t);if(n===`none`)return;if(n)return V(n,t.defaultIconPack)}return`${z.prefix}:${e.nodeType===`directory`?`folder`:`file`}`}}}v(H,`getNodeIcon`),r([{name:z.prefix,icons:z}]);var U=14,W=4,G=16,K=v(async(e,t)=>{let n=[],r=v(e=>{let i=H(e,t);i&&n.push({icon:i,node:e}),e.children.forEach(r)},`collect`);r(e);let a=await Promise.all(n.map(async({icon:e,node:t})=>({id:t.id,svg:await i(e,{height:U,width:U})})));return new Map(a.map(({id:e,svg:t})=>[e,t]))},`resolveNodeIcons`),q=v((e,t,n,r,i,a)=>{let o=r.append(`g`),s=`treeView-node-label`;n.nodeType===`directory`&&(s+=` treeView-node-dir`),n.cssClass&&(s+=` ${n.cssClass}`);let c=U+W,l=H(n,i),u=l!==void 0;l&&o.append(`g`).attr(`class`,`treeView-node-icon`).attr(`transform`,`translate(${e+i.paddingX}, ${t+i.paddingY})`).html(a.get(n.id)??``);let d=o.append(`text`).text(n.name).attr(`dominant-baseline`,`middle`).attr(`class`,s),{height:f,width:p}=d.node().getBBox(),m=f+i.paddingY*2,h=e+i.paddingX+(u?c:0);d.attr(`x`,h),d.attr(`y`,t+m/2);let g=h+p;return n.BBox={x:e,y:t,width:p+i.paddingX*2+(u?c:0),height:m},n.cssClass?.split(/\s+/).includes(`highlight`)&&o.insert(`rect`,`:first-child`).attr(`x`,e).attr(`y`,t+1).attr(`width`,0).attr(`height`,m-2).attr(`rx`,3).attr(`class`,`treeView-highlight-bg`),{node:n,nodeGroup:o,labelRightEdge:g,centerY:t+m/2}},`positionLabel`),J=v((e,t,n,r,i,a)=>e.append(`line`).attr(`x1`,t).attr(`y1`,n).attr(`x2`,r).attr(`y2`,i).attr(`stroke-width`,a).attr(`class`,`treeView-node-line`),`positionLine`),Y=v((e,t,n,r)=>{let i=0,a=0,o=[],s=v((e,t,n,s)=>{let c=s*(n.rowIndent+n.paddingX),l=q(c,i,t,e,n,r);o.push(l);let{height:u,width:d}=t.BBox;J(e,c-n.rowIndent,i+u/2,c,i+u/2,n.lineThickness),a=Math.max(a,c+d),i+=u},`drawNode`),c=v((t,r=0)=>{s(e,t,n,r),t.children.forEach(e=>{c(e,r+1)});let{x:i,y:a,height:o}=t.BBox;if(t.children.length){let{y:r,height:s}=t.children[t.children.length-1].BBox;J(e,i+n.paddingX,a+o,i+n.paddingX,r+s/2+n.lineThickness/2,n.lineThickness)}},`processNode`);c(t);let l=o.filter(e=>e.node.description);if(l.length>0){let e=Math.max(...o.map(e=>e.labelRightEdge))+G;for(let t of l){let r=t.nodeGroup.append(`text`).text(t.node.description).attr(`dominant-baseline`,`middle`).attr(`class`,`treeView-node-description`).attr(`x`,e).attr(`y`,t.centerY).node().getBBox();a=Math.max(a,e+r.width+n.paddingX)}}for(let e of o)if(e.node.cssClass?.split(/\s+/).includes(`highlight`)){let t=e.nodeGroup.select(`.treeView-highlight-bg`);if(!t.empty()){let n=a-e.node.BBox.x+8;t.attr(`width`,n),a=Math.max(a,e.node.BBox.x+n+2)}}return{totalHeight:i,totalWidth:a}},`drawTree`),X={draw:v(async(e,t,r,i)=>{_.debug(`Rendering treeView diagram
|
|
4
4
|
`+e);let a=i.db,o=a.getRoot(),s=a.getConfig(),c=n(t),l=c.append(`g`);l.attr(`class`,`tree-view`);let{totalHeight:u,totalWidth:f}=Y(l,o,s,await K(o,s));c.attr(`viewBox`,`-${s.lineThickness/2} 0 ${f} ${u}`),d(c,u,f,s.useMaxWidth)},`draw`)},Z={labelFontSize:`16px`,labelColor:`black`,lineColor:`black`,iconColor:`#546e7a`,descriptionColor:`#6a9955`,highlightBg:`rgba(255, 193, 7, 0.15)`,highlightStroke:`#ffc107`},Q={db:I,renderer:X,parser:R,styles:v(({treeView:e})=>{let{labelFontSize:t,labelColor:n,lineColor:r,iconColor:i,descriptionColor:o,highlightBg:s,highlightStroke:c}=a(Z,e);return`
|