oh-my-agent-web 0.7.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +394 -248
- package/README.md +387 -247
- package/dist/server/approval/rules.js +4 -16
- package/dist/server/approval/scope.js +3 -3
- package/dist/server/cli-config.js +3 -3
- package/dist/server/cli-info.js +9 -9
- package/dist/server/cli.js +108 -23
- package/dist/server/engine/builtin.js +64 -1
- package/dist/server/engine/catalog-probe.js +34 -0
- package/dist/server/engine/claude-map.js +296 -0
- package/dist/server/engine/claude-sessions.js +581 -0
- package/dist/server/engine/claude-transport.js +75 -0
- package/dist/server/engine/claude.js +414 -0
- package/dist/server/engine/cli-version.js +119 -0
- package/dist/server/engine/codex-map.js +19 -23
- package/dist/server/engine/codex-sessions.js +5 -5
- package/dist/server/engine/codex-subagents.js +349 -0
- package/dist/server/engine/codex.js +215 -2
- package/dist/server/engine/dsh-history.js +1 -1
- package/dist/server/engine/dsh-log.js +47 -36
- package/dist/server/engine/dsh-map.js +3 -5
- package/dist/server/engine/dsh-prompt-patch.js +48 -0
- package/dist/server/engine/dsh-sessions.js +10 -11
- package/dist/server/engine/dsh-transport.js +2 -2
- package/dist/server/engine/dsh.js +45 -2
- package/dist/server/engine/engine-versions.js +41 -0
- package/dist/server/engine/fake.js +38 -7
- package/dist/server/engine/model-registry-reload.js +1 -1
- package/dist/server/engine/opencode-map.js +2 -2
- package/dist/server/engine/opencode-projects.js +1 -1
- package/dist/server/engine/opencode-sessions.js +2 -2
- package/dist/server/engine/opencode.js +39 -1
- package/dist/server/engine/pi-events.js +4 -4
- package/dist/server/engine/pi-plugins.js +8 -6
- package/dist/server/engine/pi-sdk.js +179 -5
- package/dist/server/engine/pi-subagent-tool.js +2 -2
- package/dist/server/engine/pi-subagents.js +2 -2
- package/dist/server/engine/pi-transcript.js +1 -1
- package/dist/server/engine/registry.js +12 -2
- package/dist/server/engine/suggestion-guidance.js +22 -9
- package/dist/server/engine/wiring.js +57 -3
- package/dist/server/files/content-search.js +187 -0
- package/dist/server/files/file-search.js +3 -3
- package/dist/server/files/file-service.js +33 -15
- package/dist/server/files/files-routes.js +68 -7
- package/dist/server/files/git-info.js +51 -11
- package/dist/server/files/path-resolve.js +176 -0
- package/dist/server/files/pick-dir-routes.js +93 -0
- package/dist/server/files/pick-path-routes.js +126 -0
- package/dist/server/http/auth-routes.js +71 -4
- package/dist/server/http/auth.js +48 -30
- package/dist/server/http/aux-routes.js +20 -4
- package/dist/server/http/file-headers.js +3 -3
- package/dist/server/http/health-and-static.js +1 -1
- package/dist/server/http/live-routes.js +4 -4
- package/dist/server/http/login-page.js +128 -1
- package/dist/server/http/password-store.js +31 -0
- package/dist/server/index.js +93 -11
- package/dist/server/markers/actions.js +8 -8
- package/dist/server/mcp/codex-mcp-store.js +190 -0
- package/dist/server/mcp/json-mcp-store.js +276 -0
- package/dist/server/mcp/mcp-auth.js +1 -1
- package/dist/server/mcp/mcp-command.js +0 -2
- package/dist/server/mcp/mcp-engine-shared.js +112 -0
- package/dist/server/mcp/mcp-import.js +4 -5
- package/dist/server/mcp/mcp-market.js +2 -3
- package/dist/server/mcp/mcp-routes.js +4 -3
- package/dist/server/mcp/none-mcp-store.js +27 -0
- package/dist/server/mcp/pi-mcp-config.js +1 -1
- package/dist/server/plugins/engine-plugin-stores.js +265 -0
- package/dist/server/plugins/plugin-routes.js +4 -3
- package/dist/server/protocol-parse.js +52 -4
- package/dist/server/protocol.js +0 -1
- package/dist/server/providers/catalog-writes.js +1 -1
- package/dist/server/providers/catalog.js +2 -2
- package/dist/server/providers/codex-models.js +1 -1
- package/dist/server/providers/codex-test.js +1 -1
- package/dist/server/providers/enabled-models.js +1 -11
- package/dist/server/providers/import-routes.js +2 -2
- package/dist/server/providers/probe-routes.js +26 -0
- package/dist/server/providers/provider-handlers.js +3 -3
- package/dist/server/providers/provider-pool.js +2 -2
- package/dist/server/providers/provider-store.js +5 -2
- package/dist/server/providers/subscription-routes.js +4 -2
- package/dist/server/providers/validate.js +13 -14
- package/dist/server/push/push-routes.js +32 -3
- package/dist/server/push/push.js +43 -9
- package/dist/server/session/client-view.js +2 -2
- package/dist/server/session/close-ephemeral.js +23 -0
- package/dist/server/session/conversation-create.js +31 -9
- package/dist/server/session/delete-session.js +25 -14
- package/dist/server/session/engine-switch.js +12 -5
- package/dist/server/session/fork-session.js +38 -0
- package/dist/server/session/lock.js +4 -4
- package/dist/server/session/model-controller.js +14 -2
- package/dist/server/session/move-session.js +40 -0
- package/dist/server/session/persist-ephemeral.js +48 -0
- package/dist/server/session/pi-opener.js +2 -2
- package/dist/server/session/pi-refresh.js +1 -1
- package/dist/server/session/pi-sessions-provider.js +2 -2
- package/dist/server/session/pi-sessions.js +107 -18
- package/dist/server/session/runtime.js +144 -9
- package/dist/server/session/session-stats.js +2 -2
- package/dist/server/session/settings.js +45 -49
- package/dist/server/session/subagents.js +4 -1
- package/dist/server/session/suggest-title.js +33 -0
- package/dist/server/session/title-prompt.js +126 -0
- package/dist/server/session/turn-finish.js +2 -2
- package/dist/server/session/turn-queue.js +5 -5
- package/dist/server/session/turn-watchdog.js +2 -2
- package/dist/server/skills/skill-install.js +3 -5
- package/dist/server/skills/skill-store.js +3 -3
- package/dist/server/skills/skillhub.js +3 -4
- package/dist/server/snapshot/messages.js +2 -8
- package/dist/server/snapshot/sender.js +1 -1
- package/dist/server/snapshot/state.js +3 -5
- package/dist/server/subagents/profile-store.js +11 -9
- package/dist/server/terminal/terminal-session.js +9 -9
- package/dist/server/uploads/upload-routes.js +1 -1
- package/dist/server/uploads/upload-store.js +4 -6
- package/dist/server/util/env.js +27 -21
- package/dist/server/util/ids.js +1 -1
- package/dist/server/util/json-file.js +38 -0
- package/dist/server/util/log-file.js +3 -3
- package/dist/server/util/log.js +4 -4
- package/dist/server/util/origin.js +5 -24
- package/dist/server/util/paths.js +25 -3
- package/dist/server/util/pricing-index.js +2 -6
- package/dist/server/util/pricing.js +10 -10
- package/dist/server/util/spawn-cli.js +2 -2
- package/dist/server/util/upstream-version.js +10 -12
- package/dist/server/util/version.js +2 -2
- package/dist/server/web-proxy/proxy-routes.js +167 -0
- package/dist/server/web-proxy/proxy-url.js +60 -0
- package/dist/server/web-proxy/rewrite.js +84 -0
- package/dist/server/ws/handle-message.js +21 -2
- package/package.json +13 -14
- package/scripts/prune-prebuilds.mjs +1 -1
- package/web/dist/assets/_oh-my-agent-web-mermaid-pruned_chunk_abnfDiagram-WEYOIA3C-Dq-2fRb4.js +1 -0
- package/web/dist/assets/_oh-my-agent-web-mermaid-pruned_chunk_architectureDiagram-ZHVYKT53-Dh5CEs4k.js +1 -0
- package/web/dist/assets/_oh-my-agent-web-mermaid-pruned_chunk_c4Diagram-XDPPPE54-Cb19QmmE.js +1 -0
- package/web/dist/assets/_oh-my-agent-web-mermaid-pruned_chunk_cynefinDiagram-WF24UDRP-COk-IL9O.js +1 -0
- package/web/dist/assets/_oh-my-agent-web-mermaid-pruned_chunk_diagram-CBK3MWTC-Gp_0nfEJ.js +1 -0
- package/web/dist/assets/_oh-my-agent-web-mermaid-pruned_chunk_diagram-ODIL2UCW-rzPf_9IN.js +1 -0
- package/web/dist/assets/_oh-my-agent-web-mermaid-pruned_chunk_diagram-PFBEJUXE-B5EnLWwl.js +1 -0
- package/web/dist/assets/_oh-my-agent-web-mermaid-pruned_chunk_diagram-TYUNFSNR-DVpFKFwC.js +1 -0
- package/web/dist/assets/_oh-my-agent-web-mermaid-pruned_chunk_ebnfDiagram-V4P3TTPT-CDL1qiPY.js +1 -0
- package/web/dist/assets/_oh-my-agent-web-mermaid-pruned_chunk_ishikawaDiagram-HPEHV2GE-CSkoONzp.js +1 -0
- package/web/dist/assets/_oh-my-agent-web-mermaid-pruned_chunk_mindmap-definition-6OY57UG3-B9sdVB6_.js +1 -0
- package/web/dist/assets/_oh-my-agent-web-mermaid-pruned_chunk_pegDiagram-ECIUJNBX-B6P7baCF.js +1 -0
- package/web/dist/assets/_oh-my-agent-web-mermaid-pruned_chunk_railroadDiagram-Y72NRBL7-W_a8Vy2l.js +1 -0
- package/web/dist/assets/_oh-my-agent-web-mermaid-pruned_chunk_swimlanes-B3ENRKFQ-DvGif-RR.js +1 -0
- package/web/dist/assets/_oh-my-agent-web-mermaid-pruned_chunk_swimlanesDiagram-AYQRV4AK-D0gFG_EI.js +1 -0
- package/web/dist/assets/_oh-my-agent-web-mermaid-pruned_chunk_usecaseDiagram-WPOLBNNX-BjgUBJiR.js +1 -0
- package/web/dist/assets/_oh-my-agent-web-mermaid-pruned_chunk_vennDiagram-Q3Y3IDCW-DnVuWTpF.js +1 -0
- package/web/dist/assets/_oh-my-agent-web-mermaid-pruned_chunk_wardleyDiagram-IVAIDKWA-B2vDAqpl.js +1 -0
- package/web/dist/assets/{arc-BTAvbR16.js → arc-Df9SI9yh.js} +1 -1
- package/web/dist/assets/{architecture-WOLXFQ4H-fewLD5_7.js → architecture-WOLXFQ4H-iO49E8Y1.js} +1 -1
- package/web/dist/assets/{blockDiagram-RJAE7QA3-ClmgyxZl.js → blockDiagram-RJAE7QA3-D8d1ukIs.js} +1 -1
- package/web/dist/assets/channel-C2-OT56h.js +1 -0
- package/web/dist/assets/{chunk-55XCU76K-DdC5EhZG.js → chunk-55XCU76K-C5wOvqDb.js} +1 -1
- package/web/dist/assets/{chunk-7S6XSTFO-CgToWHK6.js → chunk-7S6XSTFO-WIrWcDbG.js} +1 -1
- package/web/dist/assets/{chunk-AQDTSKZB-D-rQMnp7.js → chunk-AQDTSKZB-OkzYqFsw.js} +1 -1
- package/web/dist/assets/{chunk-DSNLSHJZ-cuZoTGMH.js → chunk-DSNLSHJZ-CHEA9kYd.js} +2 -2
- package/web/dist/assets/{chunk-HNE4Q36P-CiKr9iSN.js → chunk-HNE4Q36P-CPsq34CI.js} +1 -1
- package/web/dist/assets/{chunk-VQ5W62QI-DbTfXAAT.js → chunk-VQ5W62QI-CamPnEuF.js} +1 -1
- package/web/dist/assets/{chunk-WQQL4CDK-DHanHfB5.js → chunk-WQQL4CDK-gNypBVAM.js} +1 -1
- package/web/dist/assets/{chunk-ZAUX2LTX-SrjFXpy2.js → chunk-ZAUX2LTX--4WyRBRV.js} +1 -1
- package/web/dist/assets/{chunk-ZCHMQSOR-7Wy8xXQ5.js → chunk-ZCHMQSOR-umv3Lkpn.js} +1 -1
- package/web/dist/assets/{classDiagram-v2-4MYWR3UA-CBe5ZDvZ.js → classDiagram-v2-4MYWR3UA-C1XldpO1.js} +1 -1
- package/web/dist/assets/{cose-bilkent-JH36ORCC-Dljdyvhw.js → cose-bilkent-JH36ORCC-BvugZzFU.js} +1 -1
- package/web/dist/assets/{cynefin-EF2NZ3EQ-CcZU7GFP.js → cynefin-EF2NZ3EQ-6qXB70s4.js} +1 -1
- package/web/dist/assets/{dagre-NK4GIZVX-Bq_6y8qp.js → dagre-NK4GIZVX-DDdlABYw.js} +1 -1
- package/web/dist/assets/{diagram-I5XIIV2D-C2lnnYVG.js → diagram-I5XIIV2D-T8oWy5CY.js} +1 -1
- package/web/dist/assets/{diagram-RJA3I4VV-Bqf8Z6wJ.js → diagram-RJA3I4VV-CkdHTtfV.js} +1 -1
- package/web/dist/assets/{elk-QONTBCTQ-Cdzq_cJ5.js → elk-QONTBCTQ-BiEUbJJX.js} +1 -1
- package/web/dist/assets/{erDiagram-KYQIGQAA-ZJLCjPFC.js → erDiagram-KYQIGQAA-q3WwhyzH.js} +1 -1
- package/web/dist/assets/{eventmodeling-K75KTNOO-DHqeIpes.js → eventmodeling-K75KTNOO-BO5gW_NC.js} +1 -1
- package/web/dist/assets/{flowDiagram-IUGLLWBU-AVgYvXKN.js → flowDiagram-IUGLLWBU-DubjP6UK.js} +1 -1
- package/web/dist/assets/{ganttDiagram-R7GPNTJY-CR1SG1M7.js → ganttDiagram-R7GPNTJY-lKNRH8CI.js} +1 -1
- package/web/dist/assets/{gitGraph-VSP46ZUC-CIZQPK0R.js → gitGraph-VSP46ZUC-Cwlv3omT.js} +1 -1
- package/web/dist/assets/{gitGraphDiagram-PDYL7XHY-BhOCWEh6.js → gitGraphDiagram-PDYL7XHY-Bo9GpFvW.js} +1 -1
- package/web/dist/assets/index-CeYhxqkk.js +113 -0
- package/web/dist/assets/index-GJgJwZ23.css +1 -0
- package/web/dist/assets/{info-OHQRW6UA-C2wuRxeQ.js → info-OHQRW6UA-g3MbTRmN.js} +1 -1
- package/web/dist/assets/{infoDiagram-MVDRKAX5-BP5doAB5.js → infoDiagram-MVDRKAX5-CmILYLoB.js} +1 -1
- package/web/dist/assets/{journeyDiagram-BOSHW7O7-BcIDRTPS.js → journeyDiagram-BOSHW7O7-Av8T0U1C.js} +1 -1
- package/web/dist/assets/{kanban-definition-FNSA4HC5-CRH_bcoT.js → kanban-definition-FNSA4HC5-B9NyWQYN.js} +1 -1
- package/web/dist/assets/{line-iA4GPA_S.js → line-BUrll1My.js} +1 -1
- package/web/dist/assets/{linear-BGUKwkTH.js → linear-DjET0phX.js} +1 -1
- package/web/dist/assets/{math-DgNW_bVP.js → math-BJAjkhlu.js} +1 -1
- package/web/dist/assets/{mermaid-parser.core-CsqmgpEv.js → mermaid-parser.core-CaTdkhkS.js} +3 -3
- package/web/dist/assets/{mermaid.core-C1yCGQK6.js → mermaid.core-Cktx937U.js} +4 -4
- package/web/dist/assets/{packet-JDAUHWVQ-2ggaoz2g.js → packet-JDAUHWVQ-DhG6l3PG.js} +1 -1
- package/web/dist/assets/{pie-XZMESJXO-h_yslQQs.js → pie-XZMESJXO-YPcOx7s0.js} +1 -1
- package/web/dist/assets/{pieDiagram-GNMPY74T-6-JZMFyk.js → pieDiagram-GNMPY74T-DesiZKUl.js} +1 -1
- package/web/dist/assets/{quadrantDiagram-D57K4MC3-K5r1HOgL.js → quadrantDiagram-D57K4MC3-Cn1kBVgu.js} +1 -1
- package/web/dist/assets/{radar-ABXABTNO-6fOJGGgq.js → radar-ABXABTNO-CtuRfYSz.js} +1 -1
- package/web/dist/assets/{railroad-I3PHUGI6-B_gUgQ3d.js → railroad-I3PHUGI6-D5Gnyy0R.js} +1 -1
- package/web/dist/assets/{railroad-abnf-LNEFI6M7-CJ_eqiXZ.js → railroad-abnf-LNEFI6M7-Kw4pmJEm.js} +1 -1
- package/web/dist/assets/{railroad-ebnf-DWYD2UWJ-BTsgjLTU.js → railroad-ebnf-DWYD2UWJ-D8Mk5dIe.js} +1 -1
- package/web/dist/assets/{railroad-peg-JR7BVNR7-D91uiLln.js → railroad-peg-JR7BVNR7-R5Jwzs8F.js} +1 -1
- package/web/dist/assets/{requirementDiagram-EQYSW5RA-uapnV_OO.js → requirementDiagram-EQYSW5RA-B9RDq-cL.js} +1 -1
- package/web/dist/assets/{sankeyDiagram-SY24JHO5-BQsbFgUb.js → sankeyDiagram-SY24JHO5-DoEatOm6.js} +1 -1
- package/web/dist/assets/{sequenceDiagram-BLEHNHQU-iRoSYX_e.js → sequenceDiagram-BLEHNHQU-DGE5Z9lT.js} +1 -1
- package/web/dist/assets/{src-BBrKcs9r.js → src-BnEL7pZw.js} +1 -1
- package/web/dist/assets/{stateDiagram-v2-A6IESKWZ-Bzj9z5KH.js → stateDiagram-v2-A6IESKWZ-_vn8W-k_.js} +1 -1
- package/web/dist/assets/{timeline-definition-JXYKGLGB-DLUUuJX0.js → timeline-definition-JXYKGLGB-BaSLTtgR.js} +1 -1
- package/web/dist/assets/{treeView-D4JQ5SDB-CphIQ3n5.js → treeView-D4JQ5SDB-DZElyFgL.js} +1 -1
- package/web/dist/assets/{treemap-SAJKECNS-DqU3insw.js → treemap-SAJKECNS-DWDO4K4G.js} +1 -1
- package/web/dist/assets/{wardley-7MLQ67FV-Ch7d8cmC.js → wardley-7MLQ67FV-DTOUsk6Q.js} +1 -1
- package/web/dist/assets/{xychartDiagram-4URNHDU4-DdxpWBeM.js → xychartDiagram-4URNHDU4-DiaCfgAB.js} +1 -1
- package/web/dist/index.html +2 -2
- package/docs/screenshots/01-chat.png +0 -0
- package/docs/screenshots/02-answer.png +0 -0
- package/docs/screenshots/03-files-diff.png +0 -0
- package/docs/screenshots/04-terminal.png +0 -0
- package/docs/screenshots/05-models.png +0 -0
- package/docs/screenshots/06-skills.png +0 -0
- package/docs/screenshots/07-skills-hub.png +0 -0
- package/docs/screenshots/08-mcp.png +0 -0
- package/docs/screenshots/09-subagents.png +0 -0
- package/docs/screenshots/10-settings.png +0 -0
- package/docs/screenshots/11-plugins.png +0 -0
- package/docs/screenshots/12-voice.png +0 -0
- package/docs/screenshots/13-push.png +0 -0
- package/docs/screenshots/README.md +0 -45
- package/web/dist/assets/_omaw-mermaid-pruned_chunk_abnfDiagram-WEYOIA3C-CvNbnJ75.js +0 -1
- package/web/dist/assets/_omaw-mermaid-pruned_chunk_architectureDiagram-ZHVYKT53-T7NZZ4ao.js +0 -1
- package/web/dist/assets/_omaw-mermaid-pruned_chunk_c4Diagram-XDPPPE54-ByuAPg39.js +0 -1
- package/web/dist/assets/_omaw-mermaid-pruned_chunk_cynefinDiagram-WF24UDRP-BY5DHttT.js +0 -1
- package/web/dist/assets/_omaw-mermaid-pruned_chunk_diagram-CBK3MWTC-D7ZYyrF7.js +0 -1
- package/web/dist/assets/_omaw-mermaid-pruned_chunk_diagram-ODIL2UCW-C6kcOZFc.js +0 -1
- package/web/dist/assets/_omaw-mermaid-pruned_chunk_diagram-PFBEJUXE-CzFPFq0D.js +0 -1
- package/web/dist/assets/_omaw-mermaid-pruned_chunk_diagram-TYUNFSNR-B4G4T8SL.js +0 -1
- package/web/dist/assets/_omaw-mermaid-pruned_chunk_ebnfDiagram-V4P3TTPT-BkQ4xwD0.js +0 -1
- package/web/dist/assets/_omaw-mermaid-pruned_chunk_ishikawaDiagram-HPEHV2GE-52xqckJv.js +0 -1
- package/web/dist/assets/_omaw-mermaid-pruned_chunk_mindmap-definition-6OY57UG3-7cQksbFn.js +0 -1
- package/web/dist/assets/_omaw-mermaid-pruned_chunk_pegDiagram-ECIUJNBX-udgtBpwv.js +0 -1
- package/web/dist/assets/_omaw-mermaid-pruned_chunk_railroadDiagram-Y72NRBL7-Cd2dcQWz.js +0 -1
- package/web/dist/assets/_omaw-mermaid-pruned_chunk_swimlanes-B3ENRKFQ-p34pL1Yk.js +0 -1
- package/web/dist/assets/_omaw-mermaid-pruned_chunk_swimlanesDiagram-AYQRV4AK-BslfPs4r.js +0 -1
- package/web/dist/assets/_omaw-mermaid-pruned_chunk_usecaseDiagram-WPOLBNNX-DJZoN9Xk.js +0 -1
- package/web/dist/assets/_omaw-mermaid-pruned_chunk_vennDiagram-Q3Y3IDCW-DPXo67cZ.js +0 -1
- package/web/dist/assets/_omaw-mermaid-pruned_chunk_wardleyDiagram-IVAIDKWA-BE6ukwkg.js +0 -1
- package/web/dist/assets/channel-DfaYIFFE.js +0 -1
- package/web/dist/assets/index-CZQjJbRg.js +0 -104
- package/web/dist/assets/index-ChDUWKZX.css +0 -1
- /package/web/dist/assets/{_omaw-mermaid-pruned_katex_katex-Zojedrce.js → _oh-my-agent-web-mermaid-pruned_katex_katex-Zojedrce.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as t,p as n}from"./src-BBrKcs9r.js";import{b as r,g as i,w as a}from"./chunk-DSNLSHJZ-cuZoTGMH.js";import{c as o,f as s,g as c,h as l,n as u,o as d,p as f,s as p}from"./chunk-ZAUX2LTX-SrjFXpy2.js";import{n as m}from"./chunk-AQDTSKZB-D-rQMnp7.js";import{s as h}from"./chunk-J5ZVWO5B-oDCd-gWO.js";var g=e(async(e,a)=>{let u=r(),{theme:d,themeVariables:f,handDrawnSeed:p}=u,{clusterBkg:g,clusterBorder:_,borderColorArray:v}=f,y=_,{labelStyles:b,nodeStyles:x,borderStyles:S,backgroundStyles:C}=l(a),w=e.insert(`g`).attr(`class`,`cluster swimlane `+(a.cssClasses||``)).attr(`id`,a.domId??a.id).attr(`data-id`,a.id).attr(`data-et`,`cluster`).attr(`data-look`,a.look);h(w,a.colorIndex,d,v);let T=i(u.flowchart.htmlLabels),E=a.direction===`LR`,D=w.insert(`g`).attr(`class`,`cluster-label swimlane-label`),O=await m(D,a.label,{style:a.labelStyle,useHtmlLabels:T,isNode:!0,width:a.width}),k=O.getBBox();if(T){let e=O.children[0],t=n(O);k=e.getBoundingClientRect(),t.attr(`width`,k.width),t.attr(`height`,k.height)}let A=a.padding??0,j=a.width<=k.width+A?k.width+A:a.width;a.diff=a.width<=k.width+A?(j-a.width)/2-A:-A;let M=a.height,N=a.y-M/2,P=a.y+M/2,F=a.x-j/2,I=a.swimlaneContentTop===void 0?N+M/3:a.swimlaneContentTop,L=E?4:0,R=k.height+2*L,z,B;if(E){let e=Math.max(R,k.height+2*L),t=F+e,n=Math.max(0,j-e);if(a.look===`handDrawn`){let r=s.svg(w),i=c(a,{roughness:.7,fill:g,stroke:y,seed:p}),o=c(a,{roughness:.7,fill:`none`,stroke:y,seed:p}),l=r.rectangle(F,N,e,M,i);z=w.insert(()=>l,`:first-child`).attr(`class`,`swimlane-title`);let u=r.rectangle(t,N,n,M,o);B=w.insert(()=>u,`:first-child`).attr(`class`,`swimlane-body`),z.select(`path:nth-child(2)`).attr(`style`,S.join(`;`)),z.select(`path`).attr(`style`,C.join(`;`).replace(`fill`,`stroke`))}else z=w.insert(`rect`,`:first-child`),B=w.insert(`rect`,`:first-child`),z.attr(`class`,`swimlane-title`).attr(`style`,x).attr(`x`,F).attr(`y`,N).attr(`width`,e).attr(`height`,M).attr(`fill`,g).attr(`stroke`,y),B.attr(`class`,`swimlane-body`).attr(`style`,x).attr(`x`,t).attr(`y`,N).attr(`width`,n).attr(`height`,M).attr(`fill`,`none`).attr(`stroke`,y);let r=F+e/2,i=a.y;D.attr(`transform`,`translate(${r}, ${i}) rotate(-90) translate(${-k.width/2}, ${-k.height/2})`)}else{let e=Math.max(0,I-N),t=Math.min(R,e),n=N+t,r=Math.max(0,P-n),i=a.x-j/2;if(a.look===`handDrawn`){let e=s.svg(w),o=c(a,{roughness:.7,fill:g,stroke:y,fillWeight:3,seed:p}),l=c(a,{roughness:.7,fill:`none`,stroke:y,seed:p}),u=e.rectangle(i,N,j,t,o);z=w.insert(()=>u,`:first-child`).attr(`class`,`swimlane-title`);let d=e.rectangle(i,n,j,r,l);B=w.insert(()=>d,`:first-child`).attr(`class`,`swimlane-body`),z.select(`path:nth-child(2)`).attr(`style`,S.join(`;`)),z.select(`path`).attr(`style`,C.join(`;`).replace(`fill`,`stroke`))}else z=w.insert(`rect`,`:first-child`),B=w.insert(`rect`,`:first-child`),z.attr(`class`,`swimlane-title`).attr(`style`,x).attr(`x`,i).attr(`y`,N).attr(`width`,j).attr(`height`,t).attr(`fill`,g).attr(`stroke`,y),B.attr(`class`,`swimlane-body`).attr(`style`,x).attr(`x`,i).attr(`y`,n).attr(`width`,j).attr(`height`,r).attr(`fill`,`none`).attr(`stroke`,y);let o=a.x-k.width/2,l=N+(t-k.height)/2;D.attr(`transform`,`translate(${o}, ${l})`)}if(t.trace(`Swimlane data `,a,JSON.stringify(a)),b){let e=D.select(`span`);e&&e.attr(`style`,b)}return a.offsetX=0,a.width=j,a.height=M,a.offsetY=k.height-A/2,a.intersect=function(e){return o(a,e)},{cluster:w,labelBBox:k}},`swimlane`),_=e(async(e,i)=>{t.info(`Creating subgraph rect for `,i.id,i);let f=r(),{theme:g,themeVariables:_,handDrawnSeed:v}=f,{clusterBkg:y,clusterBorder:b,borderColorArray:x}=_,{labelStyles:S,nodeStyles:C,borderStyles:w,backgroundStyles:T}=l(i),E=e.insert(`g`).attr(`class`,`cluster `+i.cssClasses).attr(`id`,i.domId).attr(`data-look`,i.look);h(E,i.colorIndex,g,x);let D=a(f),O=E.insert(`g`).attr(`class`,`cluster-label `),k;k=i.labelType===`markdown`?await m(O,i.label,{style:i.labelStyle,useHtmlLabels:D,isNode:!0,width:i.width}):await d(O,i.label,i.labelStyle||``,!1,!0);let A=k.getBBox();if(a(f)){let e=k.children[0],t=n(k);A=e.getBoundingClientRect(),t.attr(`width`,A.width),t.attr(`height`,A.height)}let j=i.width<=A.width+i.padding?A.width+i.padding:i.width;i.diff=i.width<=A.width+i.padding?(j-i.width)/2-i.padding:-i.padding;let M=i.height,N=i.x-j/2,P=i.y-M/2;t.trace(`Data `,i,JSON.stringify(i));let F;if(i.look===`handDrawn`){let e=s.svg(E),n=c(i,{roughness:.7,fill:y,stroke:b,fillWeight:3,seed:v}),r=e.path(p(N,P,j,M,0),n);F=E.insert(()=>(t.debug(`Rough node insert CXC`,r),r),`:first-child`),F.select(`path:nth-child(2)`).attr(`style`,w.join(`;`)),F.select(`path`).attr(`style`,T.join(`;`).replace(`fill`,`stroke`))}else F=E.insert(`rect`,`:first-child`),F.attr(`style`,C).attr(`rx`,i.rx).attr(`ry`,i.ry).attr(`x`,N).attr(`y`,P).attr(`width`,j).attr(`height`,M);let{subGraphTitleTopMargin:I}=u(f);if(O.attr(`transform`,`translate(${i.x-A.width/2}, ${i.y-i.height/2+I})`),S){let e=O.select(`span`);e&&e.attr(`style`,S)}let L=F.node().getBBox();return i.offsetX=0,i.width=L.width,i.height=L.height,i.offsetY=A.height-i.padding/2,i.intersect=function(e){return o(i,e)},{cluster:E,labelBBox:A}},`rect`),v=e((e,t)=>{let n=e.insert(`g`).attr(`class`,`note-cluster`).attr(`id`,t.domId),r=n.insert(`rect`,`:first-child`),i=0*t.padding,a=i/2;r.attr(`rx`,t.rx).attr(`ry`,t.ry).attr(`x`,t.x-t.width/2-a).attr(`y`,t.y-t.height/2-a).attr(`width`,t.width+i).attr(`height`,t.height+i).attr(`fill`,`none`);let s=r.node().getBBox();return t.width=s.width,t.height=s.height,t.intersect=function(e){return o(t,e)},{cluster:n,labelBBox:{width:0,height:0}}},`noteGroup`),y=e(async(e,t)=>{let i=r(),{theme:c,themeVariables:l,handDrawnSeed:u}=i,{altBackground:f,borderColorArray:m,compositeBackground:g,compositeTitleBackground:_,nodeBorder:v}=l,y=e.insert(`g`).attr(`class`,t.cssClasses).attr(`id`,t.domId).attr(`data-id`,t.id).attr(`data-look`,t.look);h(y,t.colorIndex,c,m);let b=y.insert(`g`,`:first-child`),x=y.insert(`g`).attr(`class`,`cluster-label`),S=y.append(`rect`),C=await d(x,t.label,t.labelStyle,void 0,!0),w=C.getBBox();if(a(i)){let e=C.children[0],t=n(C);w=e.getBoundingClientRect(),t.attr(`width`,w.width),t.attr(`height`,w.height)}let T=0*t.padding,E=T/2,D=(t.width<=w.width+t.padding?w.width+t.padding:t.width)+T;t.diff=t.width<=w.width+t.padding?(D-t.width)/2-t.padding:-t.padding;let O=t.height+T,k=t.height+T-w.height-6,A=t.x-D/2,j=t.y-O/2;t.width=D;let M=t.y-t.height/2-E+w.height+2,N;if(t.look===`handDrawn`){let e=t.cssClasses.includes(`statediagram-cluster-alt`),n=s.svg(y),r=t.rx||t.ry?n.path(p(A,j,D,O,10),{roughness:.7,fill:_,fillStyle:`solid`,stroke:v,seed:u}):n.rectangle(A,j,D,O,{seed:u});N=y.insert(()=>r,`:first-child`);let i=n.rectangle(A,M,D,k,{fill:e?f:g,fillStyle:e?`hachure`:`solid`,stroke:v,seed:u});N=y.insert(()=>r,`:first-child`),S=y.insert(()=>i),N.attr(`class`,`outer`),S.attr(`class`,`inner`)}else N=b.insert(`rect`,`:first-child`),N.attr(`class`,`outer`).attr(`x`,A).attr(`y`,j).attr(`width`,D).attr(`height`,O).attr(`data-look`,t.look),S.attr(`class`,`inner`).attr(`x`,A).attr(`y`,M).attr(`width`,D).attr(`height`,k);return x.attr(`transform`,`translate(${t.x-w.width/2}, ${j+1-(a(i)?0:3)})`),t.height=N.node().getBBox().height,t.offsetX=0,t.offsetY=w.height-t.padding/2,t.labelBBox=w,t.intersect=function(e){return o(t,e)},{cluster:y,labelBBox:w}},`roundedWithTitle`),b=e(async(e,i)=>{t.info(`Creating subgraph rect for `,i.id,i);let d=r(),{themeVariables:f,handDrawnSeed:h}=d,{clusterBkg:g,clusterBorder:_}=f,{labelStyles:v,nodeStyles:y,borderStyles:b,backgroundStyles:x}=l(i),S=e.insert(`g`).attr(`class`,`cluster `+i.cssClasses).attr(`id`,i.domId).attr(`data-look`,i.look),C=a(d),w=S.insert(`g`).attr(`class`,`cluster-label `),T=await m(w,i.label,{style:i.labelStyle,useHtmlLabels:C,isNode:!0,width:i.width}),E=T.getBBox();if(a(d)){let e=T.children[0],t=n(T);E=e.getBoundingClientRect(),t.attr(`width`,E.width),t.attr(`height`,E.height)}let D=i.width<=E.width+i.padding?E.width+i.padding:i.width;i.diff=i.width<=E.width+i.padding?(D-i.width)/2-i.padding:-i.padding;let O=i.height,k=i.x-D/2,A=i.y-O/2;t.trace(`Data `,i,JSON.stringify(i));let j;if(i.look===`handDrawn`){let e=s.svg(S),n=c(i,{roughness:.7,fill:g,stroke:_,fillWeight:4,seed:h}),r=e.path(p(k,A,D,O,i.rx),n);j=S.insert(()=>(t.debug(`Rough node insert CXC`,r),r),`:first-child`),j.select(`path:nth-child(2)`).attr(`style`,b.join(`;`)),j.select(`path`).attr(`style`,x.join(`;`).replace(`fill`,`stroke`))}else j=S.insert(`rect`,`:first-child`),j.attr(`style`,y).attr(`rx`,i.rx).attr(`ry`,i.ry).attr(`x`,k).attr(`y`,A).attr(`width`,D).attr(`height`,O);let{subGraphTitleTopMargin:M}=u(d);if(w.attr(`transform`,`translate(${i.x-E.width/2}, ${i.y-i.height/2+M})`),v){let e=w.select(`span`);e&&e.attr(`style`,v)}let N=j.node().getBBox();return i.offsetX=0,i.width=N.width,i.height=N.height,i.offsetY=E.height-i.padding/2,i.intersect=function(e){return o(i,e)},{cluster:S,labelBBox:E}},`kanbanSection`),x=e((e,t)=>{let{theme:n,themeVariables:i,handDrawnSeed:a}=r(),{altBackground:c,nodeBorder:l,borderColorArray:u}=i,d=e.insert(`g`).attr(`class`,t.cssClasses).attr(`id`,t.domId).attr(`data-look`,t.look);h(d,t.colorIndex,n,u);let f=d.insert(`g`,`:first-child`),p=0*t.padding,m=t.width+p;t.diff=-t.padding;let g=t.height+p,_=t.x-m/2,v=t.y-g/2;t.width=m;let y;if(t.look===`handDrawn`){let e=s.svg(d).rectangle(_,v,m,g,{fill:c??`#efefef`,fillStyle:`solid`,roughness:.5,strokeLineDash:[5],stroke:l,seed:a});y=d.insert(()=>e,`:first-child`).attr(`class`,`divider`)}else{y=f.insert(`rect`,`:first-child`);let e=`outer`;e=(t.look,`divider`),y.attr(`class`,e).attr(`x`,_).attr(`y`,v).attr(`width`,m).attr(`height`,g).attr(`data-look`,t.look)}return t.height=y.node().getBBox().height,t.offsetX=0,t.offsetY=0,t.intersect=function(e){return o(t,e)},{cluster:d,labelBBox:{}}},`divider`),S=e(async(e,i,f)=>{t.info(`Creating ${f.cssClass} for `,i.id,i);let g=r(),{theme:_,themeVariables:v,handDrawnSeed:y}=g,{borderColorArray:b}=v,{labelStyles:x,borderStyles:S}=l(i),C=e.insert(`g`).attr(`class`,`cluster `+f.cssClass+` `+i.cssClasses).attr(`id`,i.domId??i.id).attr(`data-look`,i.look);h(C,i.colorIndex,_,b);let w=a(g),T=C.insert(`g`).attr(`class`,`cluster-label`),E={width:0,height:0},D=i.label?.trim();if(D){let e;if(e=i.labelType===`markdown`?await m(T,i.label,{style:i.labelStyle,useHtmlLabels:w,isNode:!0,width:i.width}):await d(T,i.label,i.labelStyle||``,!1,!0),E=e.getBBox(),w){let t=e.children[0],r=n(e);E=t.getBoundingClientRect(),r.attr(`width`,E.width),r.attr(`height`,E.height)}}let O=i.width<=E.width+i.padding?E.width+i.padding:i.width;i.diff=i.width<=E.width+i.padding?(O-i.width)/2-i.padding:-i.padding;let k=i.height,A=i.x-O/2,j=i.y-k/2,M;if(i.look===`handDrawn`){let e=s.svg(C),t=c(i,{roughness:f.roughness,fill:f.fill,stroke:f.stroke,strokeWidth:f.strokeWidth,seed:y,...f.fill===`none`?{fillWeight:0}:{fillStyle:`solid`},...f.strokeDash?{strokeLineDash:f.strokeDash}:{}}),n=e.path(p(A,j,O,k,f.rx),t);M=C.insert(()=>n,`:first-child`),M.select(`path:nth-child(2)`).attr(`style`,S.join(`;`))}else M=C.insert(`rect`,`:first-child`),M.attr(`rx`,f.rx).attr(`ry`,f.rx).attr(`x`,A).attr(`y`,j).attr(`width`,O).attr(`height`,k).attr(`fill`,f.fill).attr(`stroke`,f.stroke).attr(`stroke-width`,f.strokeWidth+`px`),f.strokeDash&&M.attr(`stroke-dasharray`,f.strokeDash.join(`, `));if(D){let{subGraphTitleTopMargin:e}=u(g);if(T.attr(`transform`,`translate(${i.x-E.width/2}, ${i.y-i.height/2+e})`),x){let e=T.select(`span`);e&&e.attr(`style`,x)}}let N=M.node().getBBox();return i.offsetX=0,i.width=N.width,i.height=N.height,i.offsetY=E.height-i.padding/2,i.intersect=function(e){return o(i,e)},{cluster:C,labelBBox:E}},`createContainerGroup`),C=e(async(e,t)=>{let{themeVariables:n}=r();return S(e,t,{cssClass:`flow-cluster`,rx:10,fill:`none`,stroke:n.flowContainerStroke||n.secondaryBorderColor,strokeWidth:.75,roughness:.7})},`flowGroup`),w=e((e,t)=>{let n=e.boundaryType||`rect`,r=n===`package`?20:e.padding,i=n===`package`?t.height+10:0,a=Math.max(e.width,t.width+r),o=n===`package`?Math.max(e.height,i+e.padding*2):e.height,s=e.x-a/2,c=e.y-o/2;return{boundaryType:n,width:a,height:o,x:s,y:c,bodyY:c+i,bodyHeight:o-i,tabHeight:i,tabWidth:n===`package`?Math.min(a,Math.max(80,t.width+20)):0}},`getUsecaseSystemBoundaryGeometry`),T={rect:_,squareRect:_,roundedWithTitle:y,noteGroup:v,divider:x,kanbanSection:b,flowGroup:C,usecaseSystemBoundary:e(async(e,i)=>{t.info(`Creating usecase system boundary for `,i.id,i);let d=r(),{theme:p,themeVariables:g,handDrawnSeed:_}=d,{clusterBkg:v,clusterBorder:y,borderColorArray:b}=g,{labelStyles:x,nodeStyles:S}=l(i),{stylesMap:C}=f(i),T=i.boundaryType||`rect`,E=e.insert(`g`).attr(`class`,`cluster usecase-system-boundary usecase-system-boundary-${T} ${i.cssClasses}`).attr(`id`,typeof i.domId==`string`?i.domId:i.id).attr(`data-boundary-type`,T).attr(`data-look`,i.look);h(E,i.colorIndex,p,b);let D=a(d),O=E.insert(`g`).attr(`class`,`cluster-label system-boundary-title`),k=await m(O,i.label,{style:x,useHtmlLabels:D,isNode:!0}),A=k.getBBox();if(D){let e=k.children[0],t=n(k);A=e.getBoundingClientRect(),t.attr(`width`,A.width),t.attr(`height`,A.height)}let{width:j,height:M,x:N,y:P,bodyY:F,bodyHeight:I,tabHeight:L,tabWidth:R}=w(i,A);i.diff=i.width<=A.width+i.padding?(j-i.width)/2-i.padding:-i.padding;let z=c(i,{fill:C.get(`fill`)||v,stroke:C.get(`stroke`)||y,strokeWidth:C.get(`stroke-width`)?.replace(`px`,``)||1,seed:_});if(i.look===`handDrawn`){let e=s.svg(E),t=e.rectangle(N,F,j,I,z);if(E.insert(()=>t,`:first-child`).attr(`class`,`boundary-body label-container`),T===`package`){let t=e.rectangle(N,P,R,L,z);E.insert(()=>t,`:first-child`).attr(`class`,`boundary-tab system-boundary-package-tab label-container`)}}else E.insert(`rect`,`:first-child`).attr(`class`,`boundary-body label-container`).attr(`style`,S).attr(`x`,N).attr(`y`,F).attr(`width`,j).attr(`height`,I),T===`package`&&E.insert(`rect`,`:first-child`).attr(`class`,`boundary-tab system-boundary-package-tab label-container`).attr(`style`,S).attr(`x`,N).attr(`y`,P).attr(`width`,R).attr(`height`,L);let{subGraphTitleTopMargin:B}=u(d);return T===`package`?O.attr(`transform`,`translate(${N+(R-A.width)/2}, ${P+(L-A.height)/2})`):O.attr(`transform`,`translate(${i.x-A.width/2}, ${P+B})`),x&&(O.attr(`style`,x),O.select(`span`).attr(`style`,x)),i.offsetX=0,i.width=j,i.height=M,i.offsetY=A.height-i.padding/2,i.labelBBox=A,i.intersect=function(e){return o(i,e)},{cluster:E,labelBBox:A}},`usecaseSystemBoundary`),swimlane:g},E=new Set([`noteGroup`,`divider`]),D=e(e=>!E.has(e??`rect`),`clusterPaintsTitle`),O=new Map,k=e(async(e,t)=>{let n=await T[t.shape||`rect`](e,t);return O.set(t.id,n),n},`insertCluster`),A=e(()=>{O=new Map},`clear`);export{D as n,k as r,A as t};
|
|
1
|
+
import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as t,p as n}from"./src-BnEL7pZw.js";import{b as r,g as i,w as a}from"./chunk-DSNLSHJZ-CHEA9kYd.js";import{c as o,f as s,g as c,h as l,n as u,o as d,p as f,s as p}from"./chunk-ZAUX2LTX--4WyRBRV.js";import{n as m}from"./chunk-AQDTSKZB-OkzYqFsw.js";import{s as h}from"./chunk-J5ZVWO5B-oDCd-gWO.js";var g=e(async(e,a)=>{let u=r(),{theme:d,themeVariables:f,handDrawnSeed:p}=u,{clusterBkg:g,clusterBorder:_,borderColorArray:v}=f,y=_,{labelStyles:b,nodeStyles:x,borderStyles:S,backgroundStyles:C}=l(a),w=e.insert(`g`).attr(`class`,`cluster swimlane `+(a.cssClasses||``)).attr(`id`,a.domId??a.id).attr(`data-id`,a.id).attr(`data-et`,`cluster`).attr(`data-look`,a.look);h(w,a.colorIndex,d,v);let T=i(u.flowchart.htmlLabels),E=a.direction===`LR`,D=w.insert(`g`).attr(`class`,`cluster-label swimlane-label`),O=await m(D,a.label,{style:a.labelStyle,useHtmlLabels:T,isNode:!0,width:a.width}),k=O.getBBox();if(T){let e=O.children[0],t=n(O);k=e.getBoundingClientRect(),t.attr(`width`,k.width),t.attr(`height`,k.height)}let A=a.padding??0,j=a.width<=k.width+A?k.width+A:a.width;a.diff=a.width<=k.width+A?(j-a.width)/2-A:-A;let M=a.height,N=a.y-M/2,P=a.y+M/2,F=a.x-j/2,I=a.swimlaneContentTop===void 0?N+M/3:a.swimlaneContentTop,L=E?4:0,R=k.height+2*L,z,B;if(E){let e=Math.max(R,k.height+2*L),t=F+e,n=Math.max(0,j-e);if(a.look===`handDrawn`){let r=s.svg(w),i=c(a,{roughness:.7,fill:g,stroke:y,seed:p}),o=c(a,{roughness:.7,fill:`none`,stroke:y,seed:p}),l=r.rectangle(F,N,e,M,i);z=w.insert(()=>l,`:first-child`).attr(`class`,`swimlane-title`);let u=r.rectangle(t,N,n,M,o);B=w.insert(()=>u,`:first-child`).attr(`class`,`swimlane-body`),z.select(`path:nth-child(2)`).attr(`style`,S.join(`;`)),z.select(`path`).attr(`style`,C.join(`;`).replace(`fill`,`stroke`))}else z=w.insert(`rect`,`:first-child`),B=w.insert(`rect`,`:first-child`),z.attr(`class`,`swimlane-title`).attr(`style`,x).attr(`x`,F).attr(`y`,N).attr(`width`,e).attr(`height`,M).attr(`fill`,g).attr(`stroke`,y),B.attr(`class`,`swimlane-body`).attr(`style`,x).attr(`x`,t).attr(`y`,N).attr(`width`,n).attr(`height`,M).attr(`fill`,`none`).attr(`stroke`,y);let r=F+e/2,i=a.y;D.attr(`transform`,`translate(${r}, ${i}) rotate(-90) translate(${-k.width/2}, ${-k.height/2})`)}else{let e=Math.max(0,I-N),t=Math.min(R,e),n=N+t,r=Math.max(0,P-n),i=a.x-j/2;if(a.look===`handDrawn`){let e=s.svg(w),o=c(a,{roughness:.7,fill:g,stroke:y,fillWeight:3,seed:p}),l=c(a,{roughness:.7,fill:`none`,stroke:y,seed:p}),u=e.rectangle(i,N,j,t,o);z=w.insert(()=>u,`:first-child`).attr(`class`,`swimlane-title`);let d=e.rectangle(i,n,j,r,l);B=w.insert(()=>d,`:first-child`).attr(`class`,`swimlane-body`),z.select(`path:nth-child(2)`).attr(`style`,S.join(`;`)),z.select(`path`).attr(`style`,C.join(`;`).replace(`fill`,`stroke`))}else z=w.insert(`rect`,`:first-child`),B=w.insert(`rect`,`:first-child`),z.attr(`class`,`swimlane-title`).attr(`style`,x).attr(`x`,i).attr(`y`,N).attr(`width`,j).attr(`height`,t).attr(`fill`,g).attr(`stroke`,y),B.attr(`class`,`swimlane-body`).attr(`style`,x).attr(`x`,i).attr(`y`,n).attr(`width`,j).attr(`height`,r).attr(`fill`,`none`).attr(`stroke`,y);let o=a.x-k.width/2,l=N+(t-k.height)/2;D.attr(`transform`,`translate(${o}, ${l})`)}if(t.trace(`Swimlane data `,a,JSON.stringify(a)),b){let e=D.select(`span`);e&&e.attr(`style`,b)}return a.offsetX=0,a.width=j,a.height=M,a.offsetY=k.height-A/2,a.intersect=function(e){return o(a,e)},{cluster:w,labelBBox:k}},`swimlane`),_=e(async(e,i)=>{t.info(`Creating subgraph rect for `,i.id,i);let f=r(),{theme:g,themeVariables:_,handDrawnSeed:v}=f,{clusterBkg:y,clusterBorder:b,borderColorArray:x}=_,{labelStyles:S,nodeStyles:C,borderStyles:w,backgroundStyles:T}=l(i),E=e.insert(`g`).attr(`class`,`cluster `+i.cssClasses).attr(`id`,i.domId).attr(`data-look`,i.look);h(E,i.colorIndex,g,x);let D=a(f),O=E.insert(`g`).attr(`class`,`cluster-label `),k;k=i.labelType===`markdown`?await m(O,i.label,{style:i.labelStyle,useHtmlLabels:D,isNode:!0,width:i.width}):await d(O,i.label,i.labelStyle||``,!1,!0);let A=k.getBBox();if(a(f)){let e=k.children[0],t=n(k);A=e.getBoundingClientRect(),t.attr(`width`,A.width),t.attr(`height`,A.height)}let j=i.width<=A.width+i.padding?A.width+i.padding:i.width;i.diff=i.width<=A.width+i.padding?(j-i.width)/2-i.padding:-i.padding;let M=i.height,N=i.x-j/2,P=i.y-M/2;t.trace(`Data `,i,JSON.stringify(i));let F;if(i.look===`handDrawn`){let e=s.svg(E),n=c(i,{roughness:.7,fill:y,stroke:b,fillWeight:3,seed:v}),r=e.path(p(N,P,j,M,0),n);F=E.insert(()=>(t.debug(`Rough node insert CXC`,r),r),`:first-child`),F.select(`path:nth-child(2)`).attr(`style`,w.join(`;`)),F.select(`path`).attr(`style`,T.join(`;`).replace(`fill`,`stroke`))}else F=E.insert(`rect`,`:first-child`),F.attr(`style`,C).attr(`rx`,i.rx).attr(`ry`,i.ry).attr(`x`,N).attr(`y`,P).attr(`width`,j).attr(`height`,M);let{subGraphTitleTopMargin:I}=u(f);if(O.attr(`transform`,`translate(${i.x-A.width/2}, ${i.y-i.height/2+I})`),S){let e=O.select(`span`);e&&e.attr(`style`,S)}let L=F.node().getBBox();return i.offsetX=0,i.width=L.width,i.height=L.height,i.offsetY=A.height-i.padding/2,i.intersect=function(e){return o(i,e)},{cluster:E,labelBBox:A}},`rect`),v=e((e,t)=>{let n=e.insert(`g`).attr(`class`,`note-cluster`).attr(`id`,t.domId),r=n.insert(`rect`,`:first-child`),i=0*t.padding,a=i/2;r.attr(`rx`,t.rx).attr(`ry`,t.ry).attr(`x`,t.x-t.width/2-a).attr(`y`,t.y-t.height/2-a).attr(`width`,t.width+i).attr(`height`,t.height+i).attr(`fill`,`none`);let s=r.node().getBBox();return t.width=s.width,t.height=s.height,t.intersect=function(e){return o(t,e)},{cluster:n,labelBBox:{width:0,height:0}}},`noteGroup`),y=e(async(e,t)=>{let i=r(),{theme:c,themeVariables:l,handDrawnSeed:u}=i,{altBackground:f,borderColorArray:m,compositeBackground:g,compositeTitleBackground:_,nodeBorder:v}=l,y=e.insert(`g`).attr(`class`,t.cssClasses).attr(`id`,t.domId).attr(`data-id`,t.id).attr(`data-look`,t.look);h(y,t.colorIndex,c,m);let b=y.insert(`g`,`:first-child`),x=y.insert(`g`).attr(`class`,`cluster-label`),S=y.append(`rect`),C=await d(x,t.label,t.labelStyle,void 0,!0),w=C.getBBox();if(a(i)){let e=C.children[0],t=n(C);w=e.getBoundingClientRect(),t.attr(`width`,w.width),t.attr(`height`,w.height)}let T=0*t.padding,E=T/2,D=(t.width<=w.width+t.padding?w.width+t.padding:t.width)+T;t.diff=t.width<=w.width+t.padding?(D-t.width)/2-t.padding:-t.padding;let O=t.height+T,k=t.height+T-w.height-6,A=t.x-D/2,j=t.y-O/2;t.width=D;let M=t.y-t.height/2-E+w.height+2,N;if(t.look===`handDrawn`){let e=t.cssClasses.includes(`statediagram-cluster-alt`),n=s.svg(y),r=t.rx||t.ry?n.path(p(A,j,D,O,10),{roughness:.7,fill:_,fillStyle:`solid`,stroke:v,seed:u}):n.rectangle(A,j,D,O,{seed:u});N=y.insert(()=>r,`:first-child`);let i=n.rectangle(A,M,D,k,{fill:e?f:g,fillStyle:e?`hachure`:`solid`,stroke:v,seed:u});N=y.insert(()=>r,`:first-child`),S=y.insert(()=>i),N.attr(`class`,`outer`),S.attr(`class`,`inner`)}else N=b.insert(`rect`,`:first-child`),N.attr(`class`,`outer`).attr(`x`,A).attr(`y`,j).attr(`width`,D).attr(`height`,O).attr(`data-look`,t.look),S.attr(`class`,`inner`).attr(`x`,A).attr(`y`,M).attr(`width`,D).attr(`height`,k);return x.attr(`transform`,`translate(${t.x-w.width/2}, ${j+1-(a(i)?0:3)})`),t.height=N.node().getBBox().height,t.offsetX=0,t.offsetY=w.height-t.padding/2,t.labelBBox=w,t.intersect=function(e){return o(t,e)},{cluster:y,labelBBox:w}},`roundedWithTitle`),b=e(async(e,i)=>{t.info(`Creating subgraph rect for `,i.id,i);let d=r(),{themeVariables:f,handDrawnSeed:h}=d,{clusterBkg:g,clusterBorder:_}=f,{labelStyles:v,nodeStyles:y,borderStyles:b,backgroundStyles:x}=l(i),S=e.insert(`g`).attr(`class`,`cluster `+i.cssClasses).attr(`id`,i.domId).attr(`data-look`,i.look),C=a(d),w=S.insert(`g`).attr(`class`,`cluster-label `),T=await m(w,i.label,{style:i.labelStyle,useHtmlLabels:C,isNode:!0,width:i.width}),E=T.getBBox();if(a(d)){let e=T.children[0],t=n(T);E=e.getBoundingClientRect(),t.attr(`width`,E.width),t.attr(`height`,E.height)}let D=i.width<=E.width+i.padding?E.width+i.padding:i.width;i.diff=i.width<=E.width+i.padding?(D-i.width)/2-i.padding:-i.padding;let O=i.height,k=i.x-D/2,A=i.y-O/2;t.trace(`Data `,i,JSON.stringify(i));let j;if(i.look===`handDrawn`){let e=s.svg(S),n=c(i,{roughness:.7,fill:g,stroke:_,fillWeight:4,seed:h}),r=e.path(p(k,A,D,O,i.rx),n);j=S.insert(()=>(t.debug(`Rough node insert CXC`,r),r),`:first-child`),j.select(`path:nth-child(2)`).attr(`style`,b.join(`;`)),j.select(`path`).attr(`style`,x.join(`;`).replace(`fill`,`stroke`))}else j=S.insert(`rect`,`:first-child`),j.attr(`style`,y).attr(`rx`,i.rx).attr(`ry`,i.ry).attr(`x`,k).attr(`y`,A).attr(`width`,D).attr(`height`,O);let{subGraphTitleTopMargin:M}=u(d);if(w.attr(`transform`,`translate(${i.x-E.width/2}, ${i.y-i.height/2+M})`),v){let e=w.select(`span`);e&&e.attr(`style`,v)}let N=j.node().getBBox();return i.offsetX=0,i.width=N.width,i.height=N.height,i.offsetY=E.height-i.padding/2,i.intersect=function(e){return o(i,e)},{cluster:S,labelBBox:E}},`kanbanSection`),x=e((e,t)=>{let{theme:n,themeVariables:i,handDrawnSeed:a}=r(),{altBackground:c,nodeBorder:l,borderColorArray:u}=i,d=e.insert(`g`).attr(`class`,t.cssClasses).attr(`id`,t.domId).attr(`data-look`,t.look);h(d,t.colorIndex,n,u);let f=d.insert(`g`,`:first-child`),p=0*t.padding,m=t.width+p;t.diff=-t.padding;let g=t.height+p,_=t.x-m/2,v=t.y-g/2;t.width=m;let y;if(t.look===`handDrawn`){let e=s.svg(d).rectangle(_,v,m,g,{fill:c??`#efefef`,fillStyle:`solid`,roughness:.5,strokeLineDash:[5],stroke:l,seed:a});y=d.insert(()=>e,`:first-child`).attr(`class`,`divider`)}else{y=f.insert(`rect`,`:first-child`);let e=`outer`;e=(t.look,`divider`),y.attr(`class`,e).attr(`x`,_).attr(`y`,v).attr(`width`,m).attr(`height`,g).attr(`data-look`,t.look)}return t.height=y.node().getBBox().height,t.offsetX=0,t.offsetY=0,t.intersect=function(e){return o(t,e)},{cluster:d,labelBBox:{}}},`divider`),S=e(async(e,i,f)=>{t.info(`Creating ${f.cssClass} for `,i.id,i);let g=r(),{theme:_,themeVariables:v,handDrawnSeed:y}=g,{borderColorArray:b}=v,{labelStyles:x,borderStyles:S}=l(i),C=e.insert(`g`).attr(`class`,`cluster `+f.cssClass+` `+i.cssClasses).attr(`id`,i.domId??i.id).attr(`data-look`,i.look);h(C,i.colorIndex,_,b);let w=a(g),T=C.insert(`g`).attr(`class`,`cluster-label`),E={width:0,height:0},D=i.label?.trim();if(D){let e;if(e=i.labelType===`markdown`?await m(T,i.label,{style:i.labelStyle,useHtmlLabels:w,isNode:!0,width:i.width}):await d(T,i.label,i.labelStyle||``,!1,!0),E=e.getBBox(),w){let t=e.children[0],r=n(e);E=t.getBoundingClientRect(),r.attr(`width`,E.width),r.attr(`height`,E.height)}}let O=i.width<=E.width+i.padding?E.width+i.padding:i.width;i.diff=i.width<=E.width+i.padding?(O-i.width)/2-i.padding:-i.padding;let k=i.height,A=i.x-O/2,j=i.y-k/2,M;if(i.look===`handDrawn`){let e=s.svg(C),t=c(i,{roughness:f.roughness,fill:f.fill,stroke:f.stroke,strokeWidth:f.strokeWidth,seed:y,...f.fill===`none`?{fillWeight:0}:{fillStyle:`solid`},...f.strokeDash?{strokeLineDash:f.strokeDash}:{}}),n=e.path(p(A,j,O,k,f.rx),t);M=C.insert(()=>n,`:first-child`),M.select(`path:nth-child(2)`).attr(`style`,S.join(`;`))}else M=C.insert(`rect`,`:first-child`),M.attr(`rx`,f.rx).attr(`ry`,f.rx).attr(`x`,A).attr(`y`,j).attr(`width`,O).attr(`height`,k).attr(`fill`,f.fill).attr(`stroke`,f.stroke).attr(`stroke-width`,f.strokeWidth+`px`),f.strokeDash&&M.attr(`stroke-dasharray`,f.strokeDash.join(`, `));if(D){let{subGraphTitleTopMargin:e}=u(g);if(T.attr(`transform`,`translate(${i.x-E.width/2}, ${i.y-i.height/2+e})`),x){let e=T.select(`span`);e&&e.attr(`style`,x)}}let N=M.node().getBBox();return i.offsetX=0,i.width=N.width,i.height=N.height,i.offsetY=E.height-i.padding/2,i.intersect=function(e){return o(i,e)},{cluster:C,labelBBox:E}},`createContainerGroup`),C=e(async(e,t)=>{let{themeVariables:n}=r();return S(e,t,{cssClass:`flow-cluster`,rx:10,fill:`none`,stroke:n.flowContainerStroke||n.secondaryBorderColor,strokeWidth:.75,roughness:.7})},`flowGroup`),w=e((e,t)=>{let n=e.boundaryType||`rect`,r=n===`package`?20:e.padding,i=n===`package`?t.height+10:0,a=Math.max(e.width,t.width+r),o=n===`package`?Math.max(e.height,i+e.padding*2):e.height,s=e.x-a/2,c=e.y-o/2;return{boundaryType:n,width:a,height:o,x:s,y:c,bodyY:c+i,bodyHeight:o-i,tabHeight:i,tabWidth:n===`package`?Math.min(a,Math.max(80,t.width+20)):0}},`getUsecaseSystemBoundaryGeometry`),T={rect:_,squareRect:_,roundedWithTitle:y,noteGroup:v,divider:x,kanbanSection:b,flowGroup:C,usecaseSystemBoundary:e(async(e,i)=>{t.info(`Creating usecase system boundary for `,i.id,i);let d=r(),{theme:p,themeVariables:g,handDrawnSeed:_}=d,{clusterBkg:v,clusterBorder:y,borderColorArray:b}=g,{labelStyles:x,nodeStyles:S}=l(i),{stylesMap:C}=f(i),T=i.boundaryType||`rect`,E=e.insert(`g`).attr(`class`,`cluster usecase-system-boundary usecase-system-boundary-${T} ${i.cssClasses}`).attr(`id`,typeof i.domId==`string`?i.domId:i.id).attr(`data-boundary-type`,T).attr(`data-look`,i.look);h(E,i.colorIndex,p,b);let D=a(d),O=E.insert(`g`).attr(`class`,`cluster-label system-boundary-title`),k=await m(O,i.label,{style:x,useHtmlLabels:D,isNode:!0}),A=k.getBBox();if(D){let e=k.children[0],t=n(k);A=e.getBoundingClientRect(),t.attr(`width`,A.width),t.attr(`height`,A.height)}let{width:j,height:M,x:N,y:P,bodyY:F,bodyHeight:I,tabHeight:L,tabWidth:R}=w(i,A);i.diff=i.width<=A.width+i.padding?(j-i.width)/2-i.padding:-i.padding;let z=c(i,{fill:C.get(`fill`)||v,stroke:C.get(`stroke`)||y,strokeWidth:C.get(`stroke-width`)?.replace(`px`,``)||1,seed:_});if(i.look===`handDrawn`){let e=s.svg(E),t=e.rectangle(N,F,j,I,z);if(E.insert(()=>t,`:first-child`).attr(`class`,`boundary-body label-container`),T===`package`){let t=e.rectangle(N,P,R,L,z);E.insert(()=>t,`:first-child`).attr(`class`,`boundary-tab system-boundary-package-tab label-container`)}}else E.insert(`rect`,`:first-child`).attr(`class`,`boundary-body label-container`).attr(`style`,S).attr(`x`,N).attr(`y`,F).attr(`width`,j).attr(`height`,I),T===`package`&&E.insert(`rect`,`:first-child`).attr(`class`,`boundary-tab system-boundary-package-tab label-container`).attr(`style`,S).attr(`x`,N).attr(`y`,P).attr(`width`,R).attr(`height`,L);let{subGraphTitleTopMargin:B}=u(d);return T===`package`?O.attr(`transform`,`translate(${N+(R-A.width)/2}, ${P+(L-A.height)/2})`):O.attr(`transform`,`translate(${i.x-A.width/2}, ${P+B})`),x&&(O.attr(`style`,x),O.select(`span`).attr(`style`,x)),i.offsetX=0,i.width=j,i.height=M,i.offsetY=A.height-i.padding/2,i.labelBBox=A,i.intersect=function(e){return o(i,e)},{cluster:E,labelBBox:A}},`usecaseSystemBoundary`),swimlane:g},E=new Set([`noteGroup`,`divider`]),D=e(e=>!E.has(e??`rect`),`clusterPaintsTitle`),O=new Map,k=e(async(e,t)=>{let n=await T[t.shape||`rect`](e,t);return O.set(t.id,n),n},`insertCluster`),A=e(()=>{O=new Map},`clear`);export{D as n,k as r,A as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as t,p as n}from"./src-
|
|
1
|
+
import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as t,p as n}from"./src-BnEL7pZw.js";import{c as r}from"./chunk-DSNLSHJZ-CHEA9kYd.js";var i=e((e,t)=>{let r;return t===`sandbox`&&(r=n(`#i`+e)),n(t===`sandbox`?r.nodes()[0].contentDocument.body:`body`).select(`[id="${e}"]`)},`getDiagramElement`),a=e((e,n,i,a)=>{e.attr(`class`,i);let{width:c,height:l,x:u,y:d}=o(e,n);r(e,l,c,a);let f=s(u,d,c,l,n);e.attr(`viewBox`,f),t.debug(`viewBox configured: ${f} with padding: ${n}`)},`setupViewPortForSVG`),o=e((e,t)=>{let n=e.node()?.getBBox()||{width:0,height:0,x:0,y:0};return{width:n.width+t*2,height:n.height+t*2,x:n.x,y:n.y}},`calculateDimensionsWithPadding`),s=e((e,t,n,r,i)=>`${e-i} ${t-i} ${n} ${r}`,`createViewBox`);export{i as n,a as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as t,p as n}from"./src-
|
|
1
|
+
import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as t,p as n}from"./src-BnEL7pZw.js";import{b as r,w as i,y as a}from"./chunk-DSNLSHJZ-CHEA9kYd.js";import{f as o,h as s,m as c,n as l,o as u}from"./chunk-ZAUX2LTX--4WyRBRV.js";import{n as d,r as f}from"./chunk-AQDTSKZB-OkzYqFsw.js";import{$ as p,G as m,J as h,K as g,Q as _,W as v,X as y,Y as b,Z as x,et as S,h as C,l as ee,q as te,tt as w}from"./chunk-7S6XSTFO-WIrWcDbG.js";import{t as ne}from"./line-BUrll1My.js";var T=e((e,t)=>{if(t)return`translate(`+-e.width/2+`, `+-e.height/2+`)`;let n=e.x??0,r=e.y??0;return`translate(`+-(n+e.width/2)+`, `+-(r+e.height/2)+`)`},`computeLabelTransform`),E={aggregation:17.25,extension:17.25,composition:17.25,dependency:6,lollipop:13.5,arrow_point:4,arrow_barb:0,arrow_barb_neo:5.5},D={arrow_point:4,arrow_cross:12.5,arrow_circle:12.5};function O(e,t){if(e===void 0||t===void 0)return{angle:0,deltaX:0,deltaY:0};e=k(e),t=k(t);let[n,r]=[e.x,e.y],[i,a]=[t.x,t.y],o=i-n,s=a-r;return{angle:Math.atan(s/o),deltaX:o,deltaY:s}}e(O,`calculateDeltaAndAngle`);var k=e(e=>Array.isArray(e)?{x:e[0],y:e[1]}:e,`pointTransformer`),re=e(t=>({x:e(function(e,n,r){let i=0,a=k(r[0]).x<k(r[r.length-1]).x?`left`:`right`;if(n===0&&Object.hasOwn(E,t.arrowTypeStart)){let{angle:e,deltaX:n}=O(r[0],r[1]);i=E[t.arrowTypeStart]*Math.cos(e)*(n>=0?1:-1)}else if(n===r.length-1&&Object.hasOwn(E,t.arrowTypeEnd)){let{angle:e,deltaX:n}=O(r[r.length-1],r[r.length-2]);i=E[t.arrowTypeEnd]*Math.cos(e)*(n>=0?1:-1)}let o=Math.abs(k(e).x-k(r[r.length-1]).x),s=Math.abs(k(e).y-k(r[r.length-1]).y),c=Math.abs(k(e).x-k(r[0]).x),l=Math.abs(k(e).y-k(r[0]).y),u=E[t.arrowTypeStart],d=E[t.arrowTypeEnd];if(o<d&&o>0&&s<d){let e=d+1-o;e*=a===`right`?-1:1,i-=e}if(c<u&&c>0&&l<u){let e=u+1-c;e*=a===`right`?-1:1,i+=e}return k(e).x+i},`x`),y:e(function(e,n,r){let i=0,a=k(r[0]).y<k(r[r.length-1]).y?`down`:`up`;if(n===0&&Object.hasOwn(E,t.arrowTypeStart)){let{angle:e,deltaY:n}=O(r[0],r[1]);i=E[t.arrowTypeStart]*Math.abs(Math.sin(e))*(n>=0?1:-1)}else if(n===r.length-1&&Object.hasOwn(E,t.arrowTypeEnd)){let{angle:e,deltaY:n}=O(r[r.length-1],r[r.length-2]);i=E[t.arrowTypeEnd]*Math.abs(Math.sin(e))*(n>=0?1:-1)}let o=Math.abs(k(e).y-k(r[r.length-1]).y),s=Math.abs(k(e).x-k(r[r.length-1]).x),c=Math.abs(k(e).y-k(r[0]).y),l=Math.abs(k(e).x-k(r[0]).x),u=E[t.arrowTypeStart],d=E[t.arrowTypeEnd];if(o<d&&o>0&&s<d){let e=d+1-o;e*=a===`up`?-1:1,i-=e}if(c<u&&c>0&&l<u){let e=u+1-c;e*=a===`up`?-1:1,i+=e}return k(e).y+i},`y`)}),`getLineFunctionsWithOffset`),ie=e((e,t,n,r,i,a=!1,o)=>{t.arrowTypeStart&&M(e,`start`,t.arrowTypeStart,n,r,i,a,o),t.arrowTypeEnd&&M(e,`end`,t.arrowTypeEnd,n,r,i,a,o)},`addEdgeMarkers`),A={arrow_cross:{type:`cross`,fill:!1},arrow_point:{type:`point`,fill:!0},arrow_barb:{type:`barb`,fill:!0},arrow_barb_neo:{type:`barb`,fill:!0},arrow_circle:{type:`circle`,fill:!1},arrow_hierarchy:{type:`hierarchy`,fill:!1},aggregation:{type:`aggregation`,fill:!1},extension:{type:`extension`,fill:!1},composition:{type:`composition`,fill:!0},dependency:{type:`dependency`,fill:!0},lollipop:{type:`lollipop`,fill:!1},only_one:{type:`onlyOne`,fill:!1},zero_or_one:{type:`zeroOrOne`,fill:!1},one_or_more:{type:`oneOrMore`,fill:!1},zero_or_more:{type:`zeroOrMore`,fill:!1},requirement_arrow:{type:`requirement_arrow`,fill:!1},requirement_contains:{type:`requirement_contains`,fill:!1}},j=[`cross`,`point`,`circle`,`lollipop`,`aggregation`,`extension`,`composition`,`dependency`,`barb`],M=e((e,n,r,i,a,o,s=!1,c)=>{if(!r||r===`none`)return;let l=A[r],u=l&&j.includes(l.type);if(!l){t.warn(`Unknown arrow type: ${r}`);return}let d=`${a}_${o}-${l.type}${n===`start`?`Start`:`End`}${s&&u?`-margin`:``}`;if(c&&c.trim()!==``){let t=`${d}_${c.replace(/[^\dA-Za-z]/g,`_`)}`;if(!document.getElementById(t)){let e=document.getElementById(d);if(e){let n=e.cloneNode(!0);n.id=t,n.querySelectorAll(`path, circle, line`).forEach(e=>{e.setAttribute(`stroke`,c),l.fill&&e.setAttribute(`fill`,c)}),e.parentNode?.appendChild(n)}}e.attr(`marker-${n}`,`url(${i}#${t})`)}else e.attr(`marker-${n}`,`url(${i}#${d})`)},`addEdgeMarker`),ae=e(e=>typeof e==`string`?e:r()?.flowchart?.curve,`resolveEdgeCurveType`),N=new Map,P=new Map,oe=e(()=>{N.clear(),P.clear()},`clear`),F=e(e=>!!(e.label||e.startLabelLeft||e.startLabelRight||e.endLabelLeft||e.endLabelRight),`hasEdgeLabel`),I=e(e=>e?typeof e==`string`?e:e.reduce((e,t)=>e+`;`+t,``):``,`getLabelStyles`),L=e(async(e,a)=>{let o=r(),c=i(o),{labelStyles:l}=s(a);a.labelStyle=l;let p=e.insert(`g`).attr(`class`,`edgeLabel`),m=p.insert(`g`).attr(`class`,`label`).attr(`data-id`,a.id),h=a.labelType===`markdown`,g=await d(e,a.label,{style:I(a.labelStyle),useHtmlLabels:c,addSvgBackground:!0,isNode:!1,markdown:h,width:void 0},o);m.node().appendChild(g),t.info(`abc82`,a,a.labelType);let _,v;if(c){let e=g.children[0],t=n(g);_=await f.measure(()=>e.getBoundingClientRect()),v=_,t.attr(`width`,_.width),t.attr(`height`,_.height)}else{let e=n(g).select(`text`).node();await f.measure(()=>{_=g.getBBox(),v=e&&typeof e.getBBox==`function`?e.getBBox():_})}m.attr(`transform`,T(v,c)),N.set(a.id,p),a.width=_.width,a.height=_.height;let y;if(a.startLabelLeft){let t=e.insert(`g`).attr(`class`,`edgeTerminals`),r=t.insert(`g`).attr(`class`,`inner`),i=await u(r,a.startLabelLeft,I(a.labelStyle)||``,!1,!1);y=i;let o=i.getBBox();if(c){let e=i.children[0],t=n(i);o=e.getBoundingClientRect(),t.attr(`width`,o.width),t.attr(`height`,o.height)}r.attr(`transform`,T(o,c)),P.get(a.id)||P.set(a.id,{}),P.get(a.id).startLeft=t,z(y,a.startLabelLeft,o),R(a,`startLeft`,o)}if(a.startLabelRight){let t=e.insert(`g`).attr(`class`,`edgeTerminals`),r=t.insert(`g`).attr(`class`,`inner`),i=await u(r,a.startLabelRight,I(a.labelStyle)||``,!1,!1);y=i;let o=i.getBBox();if(c){let e=i.children[0],t=n(i);o=e.getBoundingClientRect(),t.attr(`width`,o.width),t.attr(`height`,o.height)}r.attr(`transform`,T(o,c)),P.get(a.id)||P.set(a.id,{}),P.get(a.id).startRight=t,z(y,a.startLabelRight,o),R(a,`startRight`,o)}if(a.endLabelLeft){let t=e.insert(`g`).attr(`class`,`edgeTerminals`),r=t.insert(`g`).attr(`class`,`inner`),i=await u(r,a.endLabelLeft,I(a.labelStyle)||``,!1,!1);y=i;let o=i.getBBox();if(c){let e=i.children[0],t=n(i);o=e.getBoundingClientRect(),t.attr(`width`,o.width),t.attr(`height`,o.height)}r.attr(`transform`,T(o,c)),P.get(a.id)||P.set(a.id,{}),P.get(a.id).endLeft=t,z(y,a.endLabelLeft,o),R(a,`endLeft`,o)}if(a.endLabelRight){let t=e.insert(`g`).attr(`class`,`edgeTerminals`),r=t.insert(`g`).attr(`class`,`inner`),i=await u(r,a.endLabelRight,I(a.labelStyle)||``,!1,!1);y=i;let o=i.getBBox();if(c){let e=i.children[0],t=n(i);o=e.getBoundingClientRect(),t.attr(`width`,o.width),t.attr(`height`,o.height)}r.attr(`transform`,T(o,c)),P.get(a.id)||P.set(a.id,{}),P.get(a.id).endRight=t,z(y,a.endLabelRight,o),R(a,`endRight`,o)}return g},`insertEdgeLabel`);function R(e,t,n){e.terminalLabelSizes??={},e.terminalLabelSizes[t]={width:n.width,height:n.height}}e(R,`recordTerminalLabelSize`);function z(e,t,n){i(r())&&e&&(e.style.width=Math.max(t.length*9,n.width)+`px`,e.style.height=n.height+`px`)}e(z,`setTerminalWidth`);var B=e((e,t)=>{let n=e.x,r=e.y;if(t?.updatedPath){let i=C.calcLabelPosition(t.updatedPath);if(t.originalPath){let a=C.calcLabelPosition(t.originalPath);n=e.x+(i.x-a.x),r=e.y+(i.y-a.y)}else n=i.x,r=i.y}return{x:n,y:r}},`resolveEdgeLabelPosition`),V=e((e,n)=>{t.debug(`Moving label abc88 `,e.id,e.label,N.get(e.id),n);let i=r(),{subGraphTitleTotalMargin:a}=l(i);if(e.label){let r=N.get(e.id),{x:i,y:o}=B(e,n);t.debug(`Moving label `+e.label+` from (`,e.x,`,`,e.y,`) to (`,i,`,`,o,`) abc88`),r.attr(`transform`,`translate(${i}, ${o+a/2})`)}let o=n.updatedPath?n.updatedPath:n.originalPath;if(e.startLabelLeft){let t=P.get(e.id).startLeft,n=e.x,r=e.y;if(o){let t=C.calcTerminalLabelPosition(e.arrowTypeStart?10:0,`start_left`,o);n=t.x,r=t.y}t.attr(`transform`,`translate(${n}, ${r})`)}if(e.startLabelRight){let t=P.get(e.id).startRight,n=e.x,r=e.y;if(o){let t=C.calcTerminalLabelPosition(e.arrowTypeStart?10:0,`start_right`,o);n=t.x,r=t.y}t.attr(`transform`,`translate(${n}, ${r})`)}if(e.endLabelLeft){let t=P.get(e.id).endLeft,n=e.x,r=e.y;if(o){let t=C.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,`end_left`,o);n=t.x,r=t.y}t.attr(`transform`,`translate(${n}, ${r})`)}if(e.endLabelRight){let t=P.get(e.id).endRight,n=e.x,r=e.y;if(o){let t=C.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,`end_right`,o);n=t.x,r=t.y}t.attr(`transform`,`translate(${n}, ${r})`)}},`positionEdgeLabel`),se=e((e,t)=>{if(!e?.isLabelEdge||!e?.id?.endsWith(`-to-label`)||!Array.isArray(t)||t.length!==2)return t;let[n,r]=t,i=Math.abs(r.x-n.x),a=Math.abs(r.y-n.y);return i<.001||a<.001?t:a>=i?[n,{x:n.x,y:r.y},r]:[n,{x:r.x,y:n.y},r]},`orthogonalizeToLabelClippedPoints`),H=e((e,t)=>{let n=e.x,r=e.y,i=Math.abs(t.x-n),a=Math.abs(t.y-r),o=e.width/2,s=e.height/2;return i>=o||a>=s},`outsideNode`),U=e((e,n,r)=>{t.debug(`intersection calc abc89:
|
|
2
2
|
outsidePoint: ${JSON.stringify(n)}
|
|
3
3
|
insidePoint : ${JSON.stringify(r)}
|
|
4
4
|
node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);let i=e.x,a=e.y,o=Math.abs(i-r.x),s=e.width/2,c=r.x<n.x?s-o:s+o,l=e.height/2,u=Math.abs(n.y-r.y),d=Math.abs(n.x-r.x);if(Math.abs(a-n.y)*s>Math.abs(i-n.x)*l){let e=r.y<n.y?n.y-l-a:a-l-n.y;c=d*e/u;let i={x:r.x<n.x?r.x+c:r.x-d+c,y:r.y<n.y?r.y+u-e:r.y-u+e};return c===0&&(i.x=n.x,i.y=n.y),d===0&&(i.x=n.x),u===0&&(i.y=n.y),t.debug(`abc89 top/bottom calc, Q ${u}, q ${e}, R ${d}, r ${c}`,i),i}{c=r.x<n.x?n.x-s-i:i-s-n.x;let e=u*c/d,a=r.x<n.x?r.x+d-c:r.x-d+c,o=r.y<n.y?r.y+e:r.y-e;return t.debug(`sides calc abc89, Q ${u}, q ${e}, R ${d}, r ${c}`,{_x:a,_y:o}),c===0&&(a=n.x,o=n.y),d===0&&(a=n.x),u===0&&(o=n.y),{x:a,y:o}}},`intersection`),W=e((e,n)=>{t.warn(`abc88 cutPathAtIntersect`,e,n);let r=[],i=e[0],a=!1;return e.forEach(e=>{if(t.info(`abc88 checking point`,e,n),!H(n,e)&&!a){let o=U(n,i,e);t.debug(`abc88 inside`,e,i,o),t.debug(`abc88 intersection`,o,n);let s=!1;r.forEach(e=>{s||=e.x===o.x&&e.y===o.y}),r.some(e=>e.x===o.x&&e.y===o.y)?t.warn(`abc88 no intersect`,o,r):r.push(o),a=!0}else t.warn(`abc88 outside`,e,i),i=e,a||r.push(e)}),t.debug(`returning points`,r),r},`cutPathAtIntersect`);function G(e){let t=[],n=[];for(let r=1;r<e.length-1;r++){let i=e[r-1],a=e[r],o=e[r+1];(i.x===a.x&&a.y===o.y&&Math.abs(a.x-o.x)>5&&Math.abs(a.y-i.y)>5||i.y===a.y&&a.x===o.x&&Math.abs(a.x-i.x)>5&&Math.abs(a.y-o.y)>5)&&(t.push(a),n.push(r))}return{cornerPoints:t,cornerPointPositions:n}}e(G,`extractCornerPoints`);var K=e(function(e,t,n){let r=t.x-e.x,i=t.y-e.y,a=n/Math.sqrt(r*r+i*i);return{x:t.x-a*r,y:t.y-a*i}},`findAdjacentPoint`),ce=e(function(e){let{cornerPointPositions:n}=G(e),r=[];for(let i=0;i<e.length;i++)if(n.includes(i)){let n=e[i-1],a=e[i+1],o=e[i],s=K(n,o,5),c=K(a,o,5),l=c.x-s.x,u=c.y-s.y;r.push(s);let d=Math.sqrt(2)*2,f={x:o.x,y:o.y};Math.abs(a.x-n.x)>10&&Math.abs(a.y-n.y)>=10?(t.debug(`Corner point fixing`,Math.abs(a.x-n.x),Math.abs(a.y-n.y)),f=o.x===s.x?{x:l<0?s.x-5+d:s.x+5-d,y:u<0?s.y-d:s.y+d}:{x:l<0?s.x-d:s.x+d,y:u<0?s.y-5+d:s.y+5-d}):t.debug(`Corner point skipping fixing`,Math.abs(a.x-n.x),Math.abs(a.y-n.y)),r.push(f,c)}else r.push(e[i]);return r},`fixCorners`),le=e((e,t,n)=>{let r=e-t-n,i=Math.floor(r/4);return`0 ${t} ${Array(Number.isFinite(i)?Math.max(0,i):0).fill(`2 2`).join(` `)} ${n}`},`generateDashArray`),q=e(function(e,i,a,s,l,u,d,f=!1,T=void 0){if(!d)throw Error(`insertEdge: missing diagramId for edge "${i.id}" \u2014 edge IDs require a diagram prefix for uniqueness`);let{handDrawnSeed:E,layout:O}=r(),k=T??O,A=i.points,j=!1,M=l;var N=u;let P=[];for(let e in i.cssCompiledStyles)c(e)||P.push(i.cssCompiledStyles[e]);if(k===`swimlane`){if(!f&&N.intersect&&M.intersect&&Array.isArray(A)&&A.length>=2){if(A.length===2)A=[M.intersect(A[0]),N.intersect(A[1])];else{let e=A.slice(1,-1),t=e[0],n=e[e.length-1],r=.5,i=Math.abs(A[A.length-1].x-n.x)<r&&Math.abs(A[A.length-1].y-n.y)<r,a=M.intersect(t),o=i?n:N.intersect(n),s=Math.abs(o.x-n.x)<r&&Math.abs(o.y-n.y)<r,c=Math.abs(a.x-t.x)<r&&Math.abs(a.y-t.y)<r?[]:[a],l=s?[]:[o];A=[...c,...e,...l]}}A=se(i,A)}else N.intersect&&M.intersect&&!f&&(A=A.slice(1,i.points.length-1),A.unshift(M.intersect(A[0])),A.push(N.intersect(A[A.length-1])));let oe=btoa(JSON.stringify(A));i.toCluster&&(t.info(`to cluster abc88`,a.get(i.toCluster)),A=W(i.points,a.get(i.toCluster).node),j=!0),i.fromCluster&&(t.debug(`from cluster abc88`,a.get(i.fromCluster),JSON.stringify(A,null,2)),A=W(A.reverse(),a.get(i.fromCluster).node).reverse(),j=!0);let F=A.filter(e=>!Number.isNaN(e.y)),I=ae(i.curve);I!==`rounded`&&(F=ce(F));let L=w;switch(I){case`linear`:L=w;break;case`basis`:L=_;break;case`cardinal`:L=x;break;case`bumpX`:L=p;break;case`bumpY`:L=S;break;case`catmullRom`:L=y;break;case`monotoneX`:L=h;break;case`monotoneY`:L=b;break;case`natural`:L=te;break;case`step`:L=g;break;case`stepAfter`:L=v;break;case`stepBefore`:L=m;break;case`rounded`:L=w;break;default:L=_}let{x:R,y:z}=re(i),B=ne().x(R).y(z).curve(L),V;switch(i.thickness){case`normal`:V=`edge-thickness-normal`;break;case`thick`:V=`edge-thickness-thick`;break;case`invisible`:V=`edge-thickness-invisible`;break;default:V=`edge-thickness-normal`}switch(i.pattern){case`solid`:V+=` edge-pattern-solid`;break;case`dotted`:V+=` edge-pattern-dotted`;break;case`dashed`:V+=` edge-pattern-dashed`;break;default:V+=` edge-pattern-solid`}let H,U=I===`rounded`?J(X(F,i),5):B(F),G=Array.isArray(i.style)?i.style:[i.style],K=G.find(e=>e?.startsWith(`stroke:`)),q=``;i.animate&&(q=`edge-animation-fast`),i.animation&&(q=`edge-animation-`+i.animation);let Y=!1;if(i.look===`handDrawn`){let t=o.svg(e);Object.assign([],F);let r=t.path(U,{roughness:.3,seed:E});V+=` transition`,H=n(r).select(`path`).attr(`id`,`${d}-${i.id}`).attr(`class`,` `+V+(i.classes?` `+i.classes:``)+(q?` `+q:``)).attr(`style`,G?G.reduce((e,t)=>e+`;`+t,``):``);let a=H.attr(`d`);H.attr(`d`,a),e.node().appendChild(H.node())}else{let t=P.join(`;`),n=G?G.reduce((e,t)=>e+t+`;`,``):``,r=(t?t+`;`+n+`;`:n)+`;`+(G?G.reduce((e,t)=>e+`;`+t,``):``);H=e.append(`path`).attr(`d`,U).attr(`id`,`${d}-${i.id}`).attr(`class`,` `+V+(i.classes?` `+i.classes:``)+(q?` `+q:``)).attr(`style`,r),K=r.match(/stroke:([^;]+)/)?.[1],Y=i.animate===!0||!!i.animation||t.includes(`animation`);let a=H.node(),o=typeof a.getTotalLength==`function`?a.getTotalLength():0,s=D[i.arrowTypeStart]||0,c=D[i.arrowTypeEnd]||0;if(i.look===`neo`&&!Y){let e=`stroke-dasharray: ${i.pattern===`dotted`||i.pattern===`dashed`?le(o,s,c):`0 ${s} ${o-s-c} ${c}`}; stroke-dashoffset: 0;`;H.attr(`style`,e+H.attr(`style`))}}H.attr(`data-edge`,!0),H.attr(`data-et`,`edge`),H.attr(`data-id`,i.id),H.attr(`data-points`,oe),H.attr(`data-look`,ee(i.look)),i.showPoints&&F.forEach(t=>{e.append(`circle`).style(`stroke`,`red`).style(`fill`,`red`).attr(`r`,1).attr(`cx`,t.x).attr(`cy`,t.y)});let Z=``;(r().flowchart.arrowMarkerAbsolute||r().state.arrowMarkerAbsolute)&&(Z=window.location.protocol+`//`+window.location.host+window.location.pathname+window.location.search,Z=Z.replace(/\(/g,`\\(`).replace(/\)/g,`\\)`)),t.info(`arrowTypeStart`,i.arrowTypeStart),t.info(`arrowTypeEnd`,i.arrowTypeEnd);let Q=!Y&&i?.look===`neo`;ie(H,i,Z,d,s,Q,K);let ue=Math.floor(A.length/2),de=A[ue];C.isLabelCoordinateInPath(de,H.attr(`d`))||(j=!0);let $={};return j&&($.updatedPath=A),$.originalPath=i.points,$},`insertEdge`);function J(e,t){if(e.length<2)return``;let n=``,r=e.length,i=1e-5;for(let a=0;a<r;a++){let o=e[a],s=e[a-1],c=e[a+1];if(a===0)n+=`M${o.x},${o.y}`;else if(a===r-1)n+=`L${o.x},${o.y}`;else{let e=o.x-s.x,r=o.y-s.y,a=c.x-o.x,l=c.y-o.y,u=Math.hypot(e,r),d=Math.hypot(a,l);if(u<i||d<i){n+=`L${o.x},${o.y}`;continue}let f=e/u,p=r/u,m=a/d,h=l/d,g=f*m+p*h,_=Math.acos(Math.max(-1,Math.min(1,g)));if(_<i||Math.abs(Math.PI-_)<i){n+=`L${o.x},${o.y}`;continue}let v=Math.min(t/Math.sin(_/2),u/2,d/2),y=o.x-f*v,b=o.y-p*v,x=o.x+m*v,S=o.y+h*v;n+=`L${y},${b}`,n+=`Q${o.x},${o.y} ${x},${S}`}}return n}e(J,`generateRoundedPath`);function Y(e,t){if(!e||!t)return{angle:0,deltaX:0,deltaY:0};let n=t.x-e.x,r=t.y-e.y;return{angle:Math.atan2(r,n),deltaX:n,deltaY:r}}e(Y,`calculateDeltaAndAngle`);function X(e,t){let n=e.map(e=>({...e}));if(e.length>=2&&E[t.arrowTypeStart]){let r=E[t.arrowTypeStart],i=e[0],a=e[1],{angle:o}=Y(i,a),s=r*Math.cos(o),c=r*Math.sin(o);n[0].x=i.x+s,n[0].y=i.y+c}let r=e.length;if(r>=2&&E[t.arrowTypeEnd]){let i=E[t.arrowTypeEnd],a=e[r-1],o=e[r-2],{angle:s}=Y(o,a),c=i*Math.cos(s),l=i*Math.sin(s);n[r-1].x=a.x-c,n[r-1].y=a.y-l}return n}e(X,`applyMarkerOffsetsToPoints`);var Z=e((e,t,n,r)=>{t.forEach(t=>{Q[t](e,n,r)})},`insertMarkers`),Q={extension:e((e,n,r)=>{t.trace(`Making markers for `,r),e.append(`defs`).append(`marker`).attr(`id`,r+`_`+n+`-extensionStart`).attr(`class`,`marker extension `+n).attr(`refX`,18).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).attr(`d`,`M 1,7 L18,13 V 1 Z`),e.append(`defs`).append(`marker`).attr(`id`,r+`_`+n+`-extensionEnd`).attr(`class`,`marker extension `+n).attr(`refX`,1).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).attr(`d`,`M 1,1 V 13 L18,7 Z`),e.append(`marker`).attr(`id`,r+`_`+n+`-extensionStart-margin`).attr(`class`,`marker extension `+n).attr(`refX`,18).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).attr(`viewBox`,`0 0 20 14`).append(`polygon`).attr(`points`,`10,7 18,13 18,1`).style(`stroke-width`,2).style(`stroke-dasharray`,`0`),e.append(`defs`).append(`marker`).attr(`id`,r+`_`+n+`-extensionEnd-margin`).attr(`class`,`marker extension `+n).attr(`refX`,9).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).attr(`viewBox`,`0 0 20 14`).append(`polygon`).attr(`points`,`10,1 10,13 18,7`).style(`stroke-width`,2).style(`stroke-dasharray`,`0`)},`extension`),composition:e((e,t,n)=>{e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-compositionStart`).attr(`class`,`marker composition `+t).attr(`refX`,18).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).attr(`d`,`M 18,7 L9,13 L1,7 L9,1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-compositionEnd`).attr(`class`,`marker composition `+t).attr(`refX`,1).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).attr(`d`,`M 18,7 L9,13 L1,7 L9,1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-compositionStart-margin`).attr(`class`,`marker composition `+t).attr(`refX`,15).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).style(`stroke-width`,0).attr(`viewBox`,`0 0 15 15`).attr(`d`,`M 18,7 L9,13 L1,7 L9,1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-compositionEnd-margin`).attr(`class`,`marker composition `+t).attr(`refX`,3.5).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).style(`stroke-width`,0).attr(`d`,`M 18,7 L9,13 L1,7 L9,1 Z`)},`composition`),aggregation:e((e,t,n)=>{e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-aggregationStart`).attr(`class`,`marker aggregation `+t).attr(`refX`,18).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).attr(`d`,`M 18,7 L9,13 L1,7 L9,1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-aggregationEnd`).attr(`class`,`marker aggregation `+t).attr(`refX`,1).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).attr(`d`,`M 18,7 L9,13 L1,7 L9,1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-aggregationStart-margin`).attr(`class`,`marker aggregation `+t).attr(`refX`,15).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).style(`stroke-width`,2).attr(`d`,`M 18,7 L9,13 L1,7 L9,1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-aggregationEnd-margin`).attr(`class`,`marker aggregation `+t).attr(`refX`,1).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).style(`stroke-width`,2).attr(`d`,`M 18,7 L9,13 L1,7 L9,1 Z`)},`aggregation`),dependency:e((e,t,n)=>{e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-dependencyStart`).attr(`class`,`marker dependency `+t).attr(`refX`,6).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).attr(`d`,`M 5,7 L9,13 L1,7 L9,1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-dependencyEnd`).attr(`class`,`marker dependency `+t).attr(`refX`,13).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).attr(`d`,`M 18,7 L9,13 L14,7 L9,1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-dependencyStart-margin`).attr(`class`,`marker dependency `+t).attr(`refX`,4).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).style(`stroke-width`,0).attr(`d`,`M 5,7 L9,13 L1,7 L9,1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-dependencyEnd-margin`).attr(`class`,`marker dependency `+t).attr(`refX`,16).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).style(`stroke-width`,0).attr(`d`,`M 18,7 L9,13 L14,7 L9,1 Z`)},`dependency`),lollipop:e((e,t,n)=>{e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-lollipopStart`).attr(`class`,`marker lollipop `+t).attr(`refX`,13).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`circle`).attr(`fill`,`transparent`).attr(`cx`,7).attr(`cy`,7).attr(`r`,6),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-lollipopEnd`).attr(`class`,`marker lollipop `+t).attr(`refX`,1).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`circle`).attr(`fill`,`transparent`).attr(`cx`,7).attr(`cy`,7).attr(`r`,6),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-lollipopStart-margin`).attr(`class`,`marker lollipop `+t).attr(`refX`,13).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`circle`).attr(`fill`,`transparent`).attr(`cx`,7).attr(`cy`,7).attr(`r`,6).attr(`stroke-width`,2),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-lollipopEnd-margin`).attr(`class`,`marker lollipop `+t).attr(`refX`,1).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`circle`).attr(`fill`,`transparent`).attr(`cx`,7).attr(`cy`,7).attr(`r`,6).attr(`stroke-width`,2)},`lollipop`),point:e((e,t,n)=>{e.append(`marker`).attr(`id`,n+`_`+t+`-pointEnd`).attr(`class`,`marker `+t).attr(`viewBox`,`0 0 10 10`).attr(`refX`,5).attr(`refY`,5).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,8).attr(`markerHeight`,8).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 0 0 L 10 5 L 0 10 z`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,1).style(`stroke-dasharray`,`1,0`),e.append(`marker`).attr(`id`,n+`_`+t+`-pointStart`).attr(`class`,`marker `+t).attr(`viewBox`,`0 0 10 10`).attr(`refX`,4.5).attr(`refY`,5).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,8).attr(`markerHeight`,8).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 0 5 L 10 10 L 10 0 z`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,1).style(`stroke-dasharray`,`1,0`),e.append(`marker`).attr(`id`,n+`_`+t+`-pointEnd-margin`).attr(`class`,`marker `+t).attr(`viewBox`,`0 0 11.5 14`).attr(`refX`,11.5).attr(`refY`,7).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,10.5).attr(`markerHeight`,14).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 0 0 L 11.5 7 L 0 14 z`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,0).style(`stroke-dasharray`,`1,0`),e.append(`marker`).attr(`id`,n+`_`+t+`-pointStart-margin`).attr(`class`,`marker `+t).attr(`viewBox`,`0 0 11.5 14`).attr(`refX`,1).attr(`refY`,7).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,11.5).attr(`markerHeight`,14).attr(`orient`,`auto`).append(`polygon`).attr(`points`,`0,7 11.5,14 11.5,0`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,0).style(`stroke-dasharray`,`1,0`)},`point`),circle:e((e,t,n)=>{e.append(`marker`).attr(`id`,n+`_`+t+`-circleEnd`).attr(`class`,`marker `+t).attr(`viewBox`,`0 0 10 10`).attr(`refX`,11).attr(`refY`,5).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,11).attr(`markerHeight`,11).attr(`orient`,`auto`).append(`circle`).attr(`cx`,`5`).attr(`cy`,`5`).attr(`r`,`5`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,1).style(`stroke-dasharray`,`1,0`),e.append(`marker`).attr(`id`,n+`_`+t+`-circleStart`).attr(`class`,`marker `+t).attr(`viewBox`,`0 0 10 10`).attr(`refX`,-1).attr(`refY`,5).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,11).attr(`markerHeight`,11).attr(`orient`,`auto`).append(`circle`).attr(`cx`,`5`).attr(`cy`,`5`).attr(`r`,`5`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,1).style(`stroke-dasharray`,`1,0`),e.append(`marker`).attr(`id`,n+`_`+t+`-circleEnd-margin`).attr(`class`,`marker `+t).attr(`viewBox`,`0 0 10 10`).attr(`refY`,5).attr(`refX`,12.25).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,14).attr(`markerHeight`,14).attr(`orient`,`auto`).append(`circle`).attr(`cx`,`5`).attr(`cy`,`5`).attr(`r`,`5`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,0).style(`stroke-dasharray`,`1,0`),e.append(`marker`).attr(`id`,n+`_`+t+`-circleStart-margin`).attr(`class`,`marker `+t).attr(`viewBox`,`0 0 10 10`).attr(`refX`,-2).attr(`refY`,5).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,14).attr(`markerHeight`,14).attr(`orient`,`auto`).append(`circle`).attr(`cx`,`5`).attr(`cy`,`5`).attr(`r`,`5`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,0).style(`stroke-dasharray`,`1,0`)},`circle`),cross:e((e,t,n)=>{e.append(`marker`).attr(`id`,n+`_`+t+`-crossEnd`).attr(`class`,`marker cross `+t).attr(`viewBox`,`0 0 11 11`).attr(`refX`,12).attr(`refY`,5.2).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,11).attr(`markerHeight`,11).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 1,1 l 9,9 M 10,1 l -9,9`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,2).style(`stroke-dasharray`,`1,0`),e.append(`marker`).attr(`id`,n+`_`+t+`-crossStart`).attr(`class`,`marker cross `+t).attr(`viewBox`,`0 0 11 11`).attr(`refX`,-1).attr(`refY`,5.2).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,11).attr(`markerHeight`,11).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 1,1 l 9,9 M 10,1 l -9,9`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,2).style(`stroke-dasharray`,`1,0`),e.append(`marker`).attr(`id`,n+`_`+t+`-crossEnd-margin`).attr(`class`,`marker cross `+t).attr(`viewBox`,`0 0 15 15`).attr(`refX`,17.7).attr(`refY`,7.5).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,12).attr(`markerHeight`,12).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 1,1 L 14,14 M 1,14 L 14,1`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,2.5),e.append(`marker`).attr(`id`,n+`_`+t+`-crossStart-margin`).attr(`class`,`marker cross `+t).attr(`viewBox`,`0 0 15 15`).attr(`refX`,-3.5).attr(`refY`,7.5).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,12).attr(`markerHeight`,12).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 1,1 L 14,14 M 1,14 L 14,1`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,2.5).style(`stroke-dasharray`,`1,0`)},`cross`),barb:e((e,t,n)=>{e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-barbEnd`).attr(`refX`,19).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,14).attr(`markerUnits`,`userSpaceOnUse`).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 19,7 L9,13 L14,7 L9,1 Z`)},`barb`),barbNeo:e((e,t,n)=>{let{themeVariables:r}=a(),{transitionColor:i}=r;e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-barbEnd`).attr(`refX`,19).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,14).attr(`markerUnits`,`strokeWidth`).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 19,7 L11,14 L13,7 L11,0 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-barbEnd-margin`).attr(`refX`,17).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,14).attr(`markerUnits`,`userSpaceOnUse`).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 19,7 L11,14 L13,7 L11,0 Z`).attr(`fill`,`${i}`)},`barbNeo`),hierarchy:e((e,t,n)=>{e.append(`marker`).attr(`id`,n+`_`+t+`-hierarchyEnd`).attr(`class`,`marker hierarchy `+t).attr(`viewBox`,`0 0 12 10`).attr(`refX`,10).attr(`refY`,5).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,12).attr(`markerHeight`,10).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 0 0 L 6 5 L 0 10 M 4 0 L 10 5 L 4 10`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,1).style(`stroke-dasharray`,`1,0`).style(`fill`,`none`),e.append(`marker`).attr(`id`,n+`_`+t+`-hierarchyStart`).attr(`class`,`marker hierarchy `+t).attr(`viewBox`,`0 0 12 10`).attr(`refX`,2).attr(`refY`,5).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,12).attr(`markerHeight`,10).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 12 0 L 6 5 L 12 10 M 8 0 L 2 5 L 8 10`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,1).style(`stroke-dasharray`,`1,0`).style(`fill`,`none`)},`hierarchy`),only_one:e((e,t,n)=>{e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-onlyOneStart`).attr(`class`,`marker onlyOne `+t).attr(`refX`,0).attr(`refY`,9).attr(`markerWidth`,18).attr(`markerHeight`,18).attr(`orient`,`auto`).append(`path`).attr(`d`,`M9,0 L9,18 M15,0 L15,18`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-onlyOneEnd`).attr(`class`,`marker onlyOne `+t).attr(`refX`,18).attr(`refY`,9).attr(`markerWidth`,18).attr(`markerHeight`,18).attr(`orient`,`auto`).append(`path`).attr(`d`,`M3,0 L3,18 M9,0 L9,18`)},`only_one`),zero_or_one:e((e,t,n)=>{let r=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-zeroOrOneStart`).attr(`class`,`marker zeroOrOne `+t).attr(`refX`,0).attr(`refY`,9).attr(`markerWidth`,30).attr(`markerHeight`,18).attr(`orient`,`auto`);r.append(`circle`).attr(`fill`,`white`).attr(`cx`,21).attr(`cy`,9).attr(`r`,6),r.append(`path`).attr(`d`,`M9,0 L9,18`);let i=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-zeroOrOneEnd`).attr(`class`,`marker zeroOrOne `+t).attr(`refX`,30).attr(`refY`,9).attr(`markerWidth`,30).attr(`markerHeight`,18).attr(`orient`,`auto`);i.append(`circle`).attr(`fill`,`white`).attr(`cx`,9).attr(`cy`,9).attr(`r`,6),i.append(`path`).attr(`d`,`M21,0 L21,18`)},`zero_or_one`),one_or_more:e((e,t,n)=>{e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-oneOrMoreStart`).attr(`class`,`marker oneOrMore `+t).attr(`refX`,18).attr(`refY`,18).attr(`markerWidth`,45).attr(`markerHeight`,36).attr(`orient`,`auto`).append(`path`).attr(`d`,`M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-oneOrMoreEnd`).attr(`class`,`marker oneOrMore `+t).attr(`refX`,27).attr(`refY`,18).attr(`markerWidth`,45).attr(`markerHeight`,36).attr(`orient`,`auto`).append(`path`).attr(`d`,`M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18`)},`one_or_more`),zero_or_more:e((e,t,n)=>{let r=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-zeroOrMoreStart`).attr(`class`,`marker zeroOrMore `+t).attr(`refX`,18).attr(`refY`,18).attr(`markerWidth`,57).attr(`markerHeight`,36).attr(`orient`,`auto`);r.append(`circle`).attr(`fill`,`white`).attr(`cx`,48).attr(`cy`,18).attr(`r`,6),r.append(`path`).attr(`d`,`M0,18 Q18,0 36,18 Q18,36 0,18`);let i=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-zeroOrMoreEnd`).attr(`class`,`marker zeroOrMore `+t).attr(`refX`,39).attr(`refY`,18).attr(`markerWidth`,57).attr(`markerHeight`,36).attr(`orient`,`auto`);i.append(`circle`).attr(`fill`,`white`).attr(`cx`,9).attr(`cy`,18).attr(`r`,6),i.append(`path`).attr(`d`,`M21,18 Q39,0 57,18 Q39,36 21,18`)},`zero_or_more`),only_one_neo:e((e,t,n)=>{let{themeVariables:r}=a(),{strokeWidth:i}=r;e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-onlyOneStart`).attr(`class`,`marker onlyOne `+t).attr(`refX`,0).attr(`refY`,9).attr(`markerWidth`,18).attr(`markerHeight`,18).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).attr(`d`,`M9,0 L9,18 M15,0 L15,18`).attr(`stroke-width`,`${i}`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-onlyOneEnd`).attr(`class`,`marker onlyOne `+t).attr(`refX`,18).attr(`refY`,9).attr(`markerWidth`,18).attr(`markerHeight`,18).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).attr(`d`,`M3,0 L3,18 M9,0 L9,18`).attr(`stroke-width`,`${i}`)},`only_one_neo`),zero_or_one_neo:e((e,t,n)=>{let{themeVariables:r}=a(),{strokeWidth:i,mainBkg:o}=r,s=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-zeroOrOneStart`).attr(`class`,`marker zeroOrOne `+t).attr(`refX`,0).attr(`refY`,9).attr(`markerWidth`,30).attr(`markerHeight`,18).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`);s.append(`circle`).attr(`fill`,o??`white`).attr(`cx`,21).attr(`cy`,9).attr(`stroke-width`,`${i}`).attr(`r`,6),s.append(`path`).attr(`d`,`M9,0 L9,18`).attr(`stroke-width`,`${i}`);let c=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-zeroOrOneEnd`).attr(`class`,`marker zeroOrOne `+t).attr(`refX`,30).attr(`refY`,9).attr(`markerWidth`,30).attr(`markerHeight`,18).attr(`markerUnits`,`userSpaceOnUse`).attr(`orient`,`auto`);c.append(`circle`).attr(`fill`,o??`white`).attr(`cx`,9).attr(`cy`,9).attr(`stroke-width`,`${i}`).attr(`r`,6),c.append(`path`).attr(`d`,`M21,0 L21,18`).attr(`stroke-width`,`${i}`)},`zero_or_one_neo`),one_or_more_neo:e((e,t,n)=>{let{themeVariables:r}=a(),{strokeWidth:i}=r;e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-oneOrMoreStart`).attr(`class`,`marker oneOrMore `+t).attr(`refX`,18).attr(`refY`,18).attr(`markerWidth`,45).attr(`markerHeight`,36).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).attr(`d`,`M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27`).attr(`stroke-width`,`${i}`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-oneOrMoreEnd`).attr(`class`,`marker oneOrMore `+t).attr(`refX`,27).attr(`refY`,18).attr(`markerWidth`,45).attr(`markerHeight`,36).attr(`markerUnits`,`userSpaceOnUse`).attr(`orient`,`auto`).append(`path`).attr(`d`,`M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18`).attr(`stroke-width`,`${i}`)},`one_or_more_neo`),zero_or_more_neo:e((e,t,n)=>{let{themeVariables:r}=a(),{strokeWidth:i,mainBkg:o}=r,s=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-zeroOrMoreStart`).attr(`class`,`marker zeroOrMore `+t).attr(`refX`,18).attr(`refY`,18).attr(`markerWidth`,57).attr(`markerHeight`,36).attr(`markerUnits`,`userSpaceOnUse`).attr(`orient`,`auto`);s.append(`circle`).attr(`fill`,o??`white`).attr(`cx`,45.5).attr(`cy`,18).attr(`r`,6).attr(`stroke-width`,`${i}`),s.append(`path`).attr(`d`,`M0,18 Q18,0 36,18 Q18,36 0,18`).attr(`stroke-width`,`${i}`);let c=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-zeroOrMoreEnd`).attr(`class`,`marker zeroOrMore `+t).attr(`refX`,39).attr(`refY`,18).attr(`markerWidth`,57).attr(`markerHeight`,36).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`);c.append(`circle`).attr(`fill`,o??`white`).attr(`cx`,11).attr(`cy`,18).attr(`r`,6).attr(`stroke-width`,`${i}`),c.append(`path`).attr(`d`,`M21,18 Q39,0 57,18 Q39,36 21,18`).attr(`stroke-width`,`${i}`)},`zero_or_more_neo`),requirement_arrow:e((e,t,n)=>{e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-requirement_arrowEnd`).attr(`refX`,20).attr(`refY`,10).attr(`markerWidth`,20).attr(`markerHeight`,20).attr(`orient`,`auto`).append(`path`).attr(`d`,`M0,0
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as t,p as n}from"./src-BBrKcs9r.js";import{O as r,R as i,b as a,f as o,g as s,j as c,w as l,y as u,z as d}from"./chunk-DSNLSHJZ-cuZoTGMH.js";import{a as f,n as p,o as m,r as h}from"./chunk-AQDTSKZB-D-rQMnp7.js";import{f as g,l as _,r as v,t as y}from"./chunk-7S6XSTFO-CgToWHK6.js";import{s as b}from"./chunk-J5ZVWO5B-oDCd-gWO.js";var x=e(e=>{let{handDrawnSeed:t}=a();return{fill:e,hachureAngle:120,hachureGap:1.5,fillWeight:1.5,roughness:.7,stroke:e,seed:t}},`solidStateFill`),S=e(e=>Array.isArray(e)?e:e?e.split(`;`).map(e=>e.trim()).filter(Boolean):[],`normalizeStyleList`),C=e(e=>{let t=w([...e.cssCompiledStyles||[],...e.cssStyles||[],...S(e.labelStyle)]);return{stylesMap:t,stylesArray:[...t]}},`compileStyles`),w=e(e=>{let t=new Map;return e.forEach(e=>{let[n,r]=e.split(`:`);t.set(n.trim(),r?.trim())}),t},`styles2Map`),T=e(e=>e===`color`||e===`font-size`||e===`font-family`||e===`font-weight`||e===`font-style`||e===`text-decoration`||e===`text-align`||e===`text-transform`||e===`line-height`||e===`letter-spacing`||e===`word-spacing`||e===`text-shadow`||e===`text-overflow`||e===`white-space`||e===`word-wrap`||e===`word-break`||e===`overflow-wrap`||e===`hyphens`,`isLabelStyle`),E=e(e=>{let{stylesArray:t}=C(e),n=[],r=[],i=[],a=[];return t.forEach(e=>{let t=e[0];T(t)?n.push(e.join(`:`)+` !important`):(r.push(e.join(`:`)+` !important`),t.includes(`stroke`)&&i.push(e.join(`:`)+` !important`),t===`fill`&&a.push(e.join(`:`)+` !important`))}),{labelStyles:n.join(`;`),nodeStyles:r.join(`;`),stylesArray:t,borderStyles:i,backgroundStyles:a}},`styles2String`),D=e((e,t)=>{let{themeVariables:n,handDrawnSeed:r}=a(),{nodeBorder:i,mainBkg:o}=n,{stylesMap:s}=C(e);return Object.assign({roughness:.7,fill:s.get(`fill`)||o,fillStyle:`hachure`,fillWeight:1.5,hachureGap:1.5,stroke:s.get(`stroke`)||i,seed:r,strokeWidth:s.get(`stroke-width`)?.replace(`px`,``)||1.3,fillLineDash:[0,0],strokeLineDash:O(s.get(`stroke-dasharray`))},t)},`userNodeOverrides`),O=e(e=>{if(!e)return[0,0];let t=e.trim().split(/\s+/).map(Number);if(t.length===1){let e=isNaN(t[0])?0:t[0];return[e,e]}return[isNaN(t[0])?0:t[0],isNaN(t[1])?0:t[1]]},`getStrokeDashArray`);function k(e,t,n){if(e&&e.length){let[r,i]=t,a=Math.PI/180*n,o=Math.cos(a),s=Math.sin(a);for(let t of e){let[e,n]=t;t[0]=(e-r)*o-(n-i)*s+r,t[1]=(e-r)*s+(n-i)*o+i}}}function A(e,t){return e[0]===t[0]&&e[1]===t[1]}function j(e,t,n,r=1){let i=n,a=Math.max(t,.1),o=e[0]&&e[0][0]&&typeof e[0][0]==`number`?[e]:e,s=[0,0];if(i)for(let e of o)k(e,s,i);let c=function(e,t,n){let r=[];for(let t of e){let e=[...t];A(e[0],e[e.length-1])||e.push([e[0][0],e[0][1]]),e.length>2&&r.push(e)}let i=[];t=Math.max(t,.1);let a=[];for(let e of r)for(let t=0;t<e.length-1;t++){let n=e[t],r=e[t+1];if(n[1]!==r[1]){let e=Math.min(n[1],r[1]);a.push({ymin:e,ymax:Math.max(n[1],r[1]),x:e===n[1]?n[0]:r[0],islope:(r[0]-n[0])/(r[1]-n[1])})}}if(a.sort(((e,t)=>e.ymin<t.ymin?-1:e.ymin>t.ymin?1:e.x<t.x?-1:e.x>t.x?1:e.ymax===t.ymax?0:(e.ymax-t.ymax)/Math.abs(e.ymax-t.ymax))),!a.length)return i;let o=[],s=a[0].ymin,c=0;for(;o.length||a.length;){if(a.length){let e=-1;for(let t=0;t<a.length&&!(a[t].ymin>s);t++)e=t;a.splice(0,e+1).forEach((e=>{o.push({s,edge:e})}))}if(o=o.filter((e=>!(e.edge.ymax<=s))),o.sort(((e,t)=>e.edge.x===t.edge.x?0:(e.edge.x-t.edge.x)/Math.abs(e.edge.x-t.edge.x))),(n!==1||c%t==0)&&o.length>1)for(let e=0;e<o.length;e+=2){let t=e+1;if(t>=o.length)break;let n=o[e].edge,r=o[t].edge;i.push([[Math.round(n.x),s],[Math.round(r.x),s]])}s+=n,o.forEach((e=>{e.edge.x=e.edge.x+n*e.edge.islope})),c++}return i}(o,a,r);if(i){for(let e of o)k(e,s,-i);(function(e,t,n){let r=[];e.forEach((e=>r.push(...e))),k(r,t,n)})(c,s,-i)}return c}function M(e,t){let n=t.hachureAngle+90,r=t.hachureGap;r<0&&(r=4*t.strokeWidth),r=Math.round(Math.max(r,.1));let i=1;return t.roughness>=1&&(t.randomizer?.next()||Math.random())>.7&&(i=r),j(e,r,n,i||1)}var N=class{constructor(e){this.helper=e}fillPolygons(e,t){return this._fillPolygons(e,t)}_fillPolygons(e,t){let n=M(e,t);return{type:`fillSketch`,ops:this.renderLines(n,t)}}renderLines(e,t){let n=[];for(let r of e)n.push(...this.helper.doubleLineOps(r[0][0],r[0][1],r[1][0],r[1][1],t));return n}};function P(e){let t=e[0],n=e[1];return Math.sqrt((t[0]-n[0])**2+(t[1]-n[1])**2)}var ee=class extends N{fillPolygons(e,t){let n=t.hachureGap;n<0&&(n=4*t.strokeWidth),n=Math.max(n,.1);let r=M(e,Object.assign({},t,{hachureGap:n})),i=Math.PI/180*t.hachureAngle,a=[],o=.5*n*Math.cos(i),s=.5*n*Math.sin(i);for(let[e,t]of r)P([e,t])&&a.push([[e[0]-o,e[1]+s],[...t]],[[e[0]+o,e[1]-s],[...t]]);return{type:`fillSketch`,ops:this.renderLines(a,t)}}},F=class extends N{fillPolygons(e,t){let n=this._fillPolygons(e,t),r=Object.assign({},t,{hachureAngle:t.hachureAngle+90}),i=this._fillPolygons(e,r);return n.ops=n.ops.concat(i.ops),n}},I=class{constructor(e){this.helper=e}fillPolygons(e,t){let n=M(e,t=Object.assign({},t,{hachureAngle:0}));return this.dotsOnLines(n,t)}dotsOnLines(e,t){let n=[],r=t.hachureGap;r<0&&(r=4*t.strokeWidth),r=Math.max(r,.1);let i=t.fillWeight;i<0&&(i=t.strokeWidth/2);let a=r/4;for(let o of e){let e=P(o),s=e/r,c=Math.ceil(s)-1,l=e-c*r,u=(o[0][0]+o[1][0])/2-r/4,d=Math.min(o[0][1],o[1][1]);for(let e=0;e<c;e++){let o=d+l+e*r,s=u-a+2*Math.random()*a,c=o-a+2*Math.random()*a,f=this.helper.ellipse(s,c,i,i,t);n.push(...f.ops)}}return{type:`fillSketch`,ops:n}}},te=class{constructor(e){this.helper=e}fillPolygons(e,t){let n=M(e,t);return{type:`fillSketch`,ops:this.dashedLine(n,t)}}dashedLine(e,t){let n=t.dashOffset<0?t.hachureGap<0?4*t.strokeWidth:t.hachureGap:t.dashOffset,r=t.dashGap<0?t.hachureGap<0?4*t.strokeWidth:t.hachureGap:t.dashGap,i=[];return e.forEach((e=>{let a=P(e),o=Math.floor(a/(n+r)),s=(a+r-o*(n+r))/2,c=e[0],l=e[1];c[0]>l[0]&&(c=e[1],l=e[0]);let u=Math.atan((l[1]-c[1])/(l[0]-c[0]));for(let e=0;e<o;e++){let a=e*(n+r),o=a+n,l=[c[0]+a*Math.cos(u)+s*Math.cos(u),c[1]+a*Math.sin(u)+s*Math.sin(u)],d=[c[0]+o*Math.cos(u)+s*Math.cos(u),c[1]+o*Math.sin(u)+s*Math.sin(u)];i.push(...this.helper.doubleLineOps(l[0],l[1],d[0],d[1],t))}})),i}},ne=class{constructor(e){this.helper=e}fillPolygons(e,t){let n=t.hachureGap<0?4*t.strokeWidth:t.hachureGap,r=t.zigzagOffset<0?n:t.zigzagOffset,i=M(e,t=Object.assign({},t,{hachureGap:n+r}));return{type:`fillSketch`,ops:this.zigzagLines(i,r,t)}}zigzagLines(e,t,n){let r=[];return e.forEach((e=>{let i=P(e),a=Math.round(i/(2*t)),o=e[0],s=e[1];o[0]>s[0]&&(o=e[1],s=e[0]);let c=Math.atan((s[1]-o[1])/(s[0]-o[0]));for(let e=0;e<a;e++){let i=2*e*t,a=2*(e+1)*t,s=Math.sqrt(2*t**2),l=[o[0]+i*Math.cos(c),o[1]+i*Math.sin(c)],u=[o[0]+a*Math.cos(c),o[1]+a*Math.sin(c)],d=[l[0]+s*Math.cos(c+Math.PI/4),l[1]+s*Math.sin(c+Math.PI/4)];r.push(...this.helper.doubleLineOps(l[0],l[1],d[0],d[1],n),...this.helper.doubleLineOps(d[0],d[1],u[0],u[1],n))}})),r}},L={},R=class{constructor(e){this.seed=e}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}},z=0,re=1,ie=2,ae={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0};function B(e,t){return e.type===t}function V(e){let t=[],n=function(e){let t=[];for(;e!==``;)if(e.match(/^([ \t\r\n,]+)/))e=e.substr(RegExp.$1.length);else if(e.match(/^([aAcChHlLmMqQsStTvVzZ])/))t[t.length]={type:z,text:RegExp.$1},e=e.substr(RegExp.$1.length);else{if(!e.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];t[t.length]={type:re,text:`${parseFloat(RegExp.$1)}`},e=e.substr(RegExp.$1.length)}return t[t.length]={type:ie,text:``},t}(e),r=`BOD`,i=0,a=n[i];for(;!B(a,ie);){let o=0,s=[];if(r===`BOD`){if(a.text!==`M`&&a.text!==`m`)return V(`M0,0`+e);i++,o=ae[a.text],r=a.text}else B(a,re)?o=ae[r]:(i++,o=ae[a.text],r=a.text);if(!(i+o<n.length))throw Error(`Path data ended short`);for(let e=i;e<i+o;e++){let t=n[e];if(!B(t,re))throw Error(`Param not a number: `+r+`,`+t.text);s[s.length]=+t.text}if(typeof ae[r]!=`number`)throw Error(`Bad segment: `+r);{let e={key:r,data:s};t.push(e),i+=o,a=n[i],r===`M`&&(r=`L`),r===`m`&&(r=`l`)}}return t}function oe(e){let t=0,n=0,r=0,i=0,a=[];for(let{key:o,data:s}of e)switch(o){case`M`:a.push({key:`M`,data:[...s]}),[t,n]=s,[r,i]=s;break;case`m`:t+=s[0],n+=s[1],a.push({key:`M`,data:[t,n]}),r=t,i=n;break;case`L`:a.push({key:`L`,data:[...s]}),[t,n]=s;break;case`l`:t+=s[0],n+=s[1],a.push({key:`L`,data:[t,n]});break;case`C`:a.push({key:`C`,data:[...s]}),t=s[4],n=s[5];break;case`c`:{let e=s.map(((e,r)=>r%2?e+n:e+t));a.push({key:`C`,data:e}),t=e[4],n=e[5];break}case`Q`:a.push({key:`Q`,data:[...s]}),t=s[2],n=s[3];break;case`q`:{let e=s.map(((e,r)=>r%2?e+n:e+t));a.push({key:`Q`,data:e}),t=e[2],n=e[3];break}case`A`:a.push({key:`A`,data:[...s]}),t=s[5],n=s[6];break;case`a`:t+=s[5],n+=s[6],a.push({key:`A`,data:[s[0],s[1],s[2],s[3],s[4],t,n]});break;case`H`:a.push({key:`H`,data:[...s]}),t=s[0];break;case`h`:t+=s[0],a.push({key:`H`,data:[t]});break;case`V`:a.push({key:`V`,data:[...s]}),n=s[0];break;case`v`:n+=s[0],a.push({key:`V`,data:[n]});break;case`S`:a.push({key:`S`,data:[...s]}),t=s[2],n=s[3];break;case`s`:{let e=s.map(((e,r)=>r%2?e+n:e+t));a.push({key:`S`,data:e}),t=e[2],n=e[3];break}case`T`:a.push({key:`T`,data:[...s]}),t=s[0],n=s[1];break;case`t`:t+=s[0],n+=s[1],a.push({key:`T`,data:[t,n]});break;case`Z`:case`z`:a.push({key:`Z`,data:[]}),t=r,n=i}return a}function se(e){let t=[],n=``,r=0,i=0,a=0,o=0,s=0,c=0;for(let{key:l,data:u}of e){switch(l){case`M`:t.push({key:`M`,data:[...u]}),[r,i]=u,[a,o]=u;break;case`C`:t.push({key:`C`,data:[...u]}),r=u[4],i=u[5],s=u[2],c=u[3];break;case`L`:t.push({key:`L`,data:[...u]}),[r,i]=u;break;case`H`:r=u[0],t.push({key:`L`,data:[r,i]});break;case`V`:i=u[0],t.push({key:`L`,data:[r,i]});break;case`S`:{let e=0,a=0;n===`C`||n===`S`?(e=r+(r-s),a=i+(i-c)):(e=r,a=i),t.push({key:`C`,data:[e,a,...u]}),s=u[0],c=u[1],r=u[2],i=u[3];break}case`T`:{let[e,a]=u,o=0,l=0;n===`Q`||n===`T`?(o=r+(r-s),l=i+(i-c)):(o=r,l=i);let d=r+2*(o-r)/3,f=i+2*(l-i)/3,p=e+2*(o-e)/3,m=a+2*(l-a)/3;t.push({key:`C`,data:[d,f,p,m,e,a]}),s=o,c=l,r=e,i=a;break}case`Q`:{let[e,n,a,o]=u,l=r+2*(e-r)/3,d=i+2*(n-i)/3,f=a+2*(e-a)/3,p=o+2*(n-o)/3;t.push({key:`C`,data:[l,d,f,p,a,o]}),s=e,c=n,r=a,i=o;break}case`A`:{let e=Math.abs(u[0]),n=Math.abs(u[1]),a=u[2],o=u[3],s=u[4],c=u[5],l=u[6];e===0||n===0?(t.push({key:`C`,data:[r,i,c,l,c,l]}),r=c,i=l):(r!==c||i!==l)&&(le(r,i,c,l,e,n,a,o,s).forEach((function(e){t.push({key:`C`,data:e})})),r=c,i=l);break}case`Z`:t.push({key:`Z`,data:[]}),r=a,i=o}n=l}return t}function ce(e,t,n){return[e*Math.cos(n)-t*Math.sin(n),e*Math.sin(n)+t*Math.cos(n)]}function le(e,t,n,r,i,a,o,s,c,l){let u=(d=o,Math.PI*d/180);var d;let f=[],p=0,m=0,h=0,g=0;if(l)[p,m,h,g]=l;else{[e,t]=ce(e,t,-u),[n,r]=ce(n,r,-u);let o=(e-n)/2,l=(t-r)/2,d=o*o/(i*i)+l*l/(a*a);d>1&&(d=Math.sqrt(d),i*=d,a*=d);let f=i*i,_=a*a,v=f*_-f*l*l-_*o*o,y=f*l*l+_*o*o,b=(s===c?-1:1)*Math.sqrt(Math.abs(v/y));h=b*i*l/a+(e+n)/2,g=b*-a*o/i+(t+r)/2,p=Math.asin(parseFloat(((t-g)/a).toFixed(9))),m=Math.asin(parseFloat(((r-g)/a).toFixed(9))),e<h&&(p=Math.PI-p),n<h&&(m=Math.PI-m),p<0&&(p=2*Math.PI+p),m<0&&(m=2*Math.PI+m),c&&p>m&&(p-=2*Math.PI),!c&&m>p&&(m-=2*Math.PI)}let _=m-p;if(Math.abs(_)>120*Math.PI/180){let e=m,t=n,s=r;m=c&&m>p?p+120*Math.PI/180*1:p+120*Math.PI/180*-1,f=le(n=h+i*Math.cos(m),r=g+a*Math.sin(m),t,s,i,a,o,0,c,[m,e,h,g])}_=m-p;let v=Math.cos(p),y=Math.sin(p),b=Math.cos(m),x=Math.sin(m),S=Math.tan(_/4),C=4/3*i*S,w=4/3*a*S,T=[e,t],E=[e+C*y,t-w*v],D=[n+C*x,r-w*b],O=[n,r];if(E[0]=2*T[0]-E[0],E[1]=2*T[1]-E[1],l)return[E,D,O].concat(f);{f=[E,D,O].concat(f);let e=[];for(let t=0;t<f.length;t+=3){let n=ce(f[t][0],f[t][1],u),r=ce(f[t+1][0],f[t+1][1],u),i=ce(f[t+2][0],f[t+2][1],u);e.push([n[0],n[1],r[0],r[1],i[0],i[1]])}return e}}var ue={randOffset:function(e,t){return H(e,t)},randOffsetWithRange:function(e,t,n){return Ce(e,t,n)},ellipse:function(e,t,n,r,i){return ge(e,t,i,he(n,r,i)).opset},doubleLineOps:function(e,t,n,r,i){return we(e,t,n,r,i,!0)}};function de(e,t,n,r,i){return{type:`path`,ops:we(e,t,n,r,i)}}function fe(e,t,n){let r=(e||[]).length;if(r>2){let i=[];for(let t=0;t<r-1;t++)i.push(...we(e[t][0],e[t][1],e[t+1][0],e[t+1][1],n));return t&&i.push(...we(e[r-1][0],e[r-1][1],e[0][0],e[0][1],n)),{type:`path`,ops:i}}return r===2?de(e[0][0],e[0][1],e[1][0],e[1][1],n):{type:`path`,ops:[]}}function pe(e,t,n,r,i){return function(e,t){return fe(e,!0,t)}([[e,t],[e+n,t],[e+n,t+r],[e,t+r]],i)}function me(e,t){if(e.length){let n=typeof e[0][0]==`number`?[e]:e,r=Ee(n[0],1*(1+.2*t.roughness),t),i=t.disableMultiStroke?[]:Ee(n[0],1.5*(1+.22*t.roughness),xe(t));for(let e=1;e<n.length;e++){let a=n[e];if(a.length){let e=Ee(a,1*(1+.2*t.roughness),t),n=t.disableMultiStroke?[]:Ee(a,1.5*(1+.22*t.roughness),xe(t));for(let t of e)t.op!==`move`&&r.push(t);for(let e of n)e.op!==`move`&&i.push(e)}}return{type:`path`,ops:r.concat(i)}}return{type:`path`,ops:[]}}function he(e,t,n){let r=Math.sqrt(2*Math.PI*Math.sqrt(((e/2)**2+(t/2)**2)/2)),i=Math.ceil(Math.max(n.curveStepCount,n.curveStepCount/Math.sqrt(200)*r)),a=2*Math.PI/i,o=Math.abs(e/2),s=Math.abs(t/2),c=1-n.curveFitting;return o+=H(o*c,n),s+=H(s*c,n),{increment:a,rx:o,ry:s}}function ge(e,t,n,r){let[i,a]=Oe(r.increment,e,t,r.rx,r.ry,1,r.increment*Ce(.1,Ce(.4,1,n),n),n),o=De(i,null,n);if(!n.disableMultiStroke&&n.roughness!==0){let[i]=Oe(r.increment,e,t,r.rx,r.ry,1.5,0,n),a=De(i,null,n);o=o.concat(a)}return{estimatedPoints:a,opset:{type:`path`,ops:o}}}function _e(e,t,n,r,i,a,o,s,c){let l=e,u=t,d=Math.abs(n/2),f=Math.abs(r/2);d+=H(.01*d,c),f+=H(.01*f,c);let p=i,m=a;for(;p<0;)p+=2*Math.PI,m+=2*Math.PI;m-p>2*Math.PI&&(p=0,m=2*Math.PI);let h=2*Math.PI/c.curveStepCount,g=Math.min(h/2,(m-p)/2),_=ke(g,l,u,d,f,p,m,1,c);if(!c.disableMultiStroke){let e=ke(g,l,u,d,f,p,m,1.5,c);_.push(...e)}return o&&(s?_.push(...we(l,u,l+d*Math.cos(p),u+f*Math.sin(p),c),...we(l,u,l+d*Math.cos(m),u+f*Math.sin(m),c)):_.push({op:`lineTo`,data:[l,u]},{op:`lineTo`,data:[l+d*Math.cos(p),u+f*Math.sin(p)]})),{type:`path`,ops:_}}function ve(e,t){let n=se(oe(V(e))),r=[],i=[0,0],a=[0,0];for(let{key:e,data:o}of n)switch(e){case`M`:a=[o[0],o[1]],i=[o[0],o[1]];break;case`L`:r.push(...we(a[0],a[1],o[0],o[1],t)),a=[o[0],o[1]];break;case`C`:{let[e,n,i,s,c,l]=o;r.push(...Ae(e,n,i,s,c,l,a,t)),a=[c,l];break}case`Z`:r.push(...we(a[0],a[1],i[0],i[1],t)),a=[i[0],i[1]]}return{type:`path`,ops:r}}function ye(e,t){let n=[];for(let r of e)if(r.length){let e=t.maxRandomnessOffset||0,i=r.length;if(i>2){n.push({op:`move`,data:[r[0][0]+H(e,t),r[0][1]+H(e,t)]});for(let a=1;a<i;a++)n.push({op:`lineTo`,data:[r[a][0]+H(e,t),r[a][1]+H(e,t)]})}}return{type:`fillPath`,ops:n}}function be(e,t){return function(e,t){let n=e.fillStyle||`hachure`;if(!L[n])switch(n){case`zigzag`:L[n]||(L[n]=new ee(t));break;case`cross-hatch`:L[n]||(L[n]=new F(t));break;case`dots`:L[n]||(L[n]=new I(t));break;case`dashed`:L[n]||(L[n]=new te(t));break;case`zigzag-line`:L[n]||(L[n]=new ne(t));break;default:n=`hachure`,L[n]||(L[n]=new N(t))}return L[n]}(t,ue).fillPolygons(e,t)}function xe(e){let t=Object.assign({},e);return t.randomizer=void 0,e.seed&&(t.seed=e.seed+1),t}function Se(e){return e.randomizer||=new R(e.seed||0),e.randomizer.next()}function Ce(e,t,n,r=1){return n.roughness*r*(Se(n)*(t-e)+e)}function H(e,t,n=1){return Ce(-e,e,t,n)}function we(e,t,n,r,i,a=!1){let o=a?i.disableMultiStrokeFill:i.disableMultiStroke,s=Te(e,t,n,r,i,!0,!1);if(o)return s;let c=Te(e,t,n,r,i,!0,!0);return s.concat(c)}function Te(e,t,n,r,i,a,o){let s=(e-n)**2+(t-r)**2,c=Math.sqrt(s),l=1;l=c<200?1:c>500?.4:-.0016668*c+1.233334;let u=i.maxRandomnessOffset||0;u*u*100>s&&(u=c/10);let d=u/2,f=.2+.2*Se(i),p=i.bowing*i.maxRandomnessOffset*(r-t)/200,m=i.bowing*i.maxRandomnessOffset*(e-n)/200;p=H(p,i,l),m=H(m,i,l);let h=[],g=()=>H(d,i,l),_=()=>H(u,i,l),v=i.preserveVertices;return a&&(o?h.push({op:`move`,data:[e+(v?0:g()),t+(v?0:g())]}):h.push({op:`move`,data:[e+(v?0:H(u,i,l)),t+(v?0:H(u,i,l))]})),o?h.push({op:`bcurveTo`,data:[p+e+(n-e)*f+g(),m+t+(r-t)*f+g(),p+e+2*(n-e)*f+g(),m+t+2*(r-t)*f+g(),n+(v?0:g()),r+(v?0:g())]}):h.push({op:`bcurveTo`,data:[p+e+(n-e)*f+_(),m+t+(r-t)*f+_(),p+e+2*(n-e)*f+_(),m+t+2*(r-t)*f+_(),n+(v?0:_()),r+(v?0:_())]}),h}function Ee(e,t,n){if(!e.length)return[];let r=[];r.push([e[0][0]+H(t,n),e[0][1]+H(t,n)]),r.push([e[0][0]+H(t,n),e[0][1]+H(t,n)]);for(let i=1;i<e.length;i++)r.push([e[i][0]+H(t,n),e[i][1]+H(t,n)]),i===e.length-1&&r.push([e[i][0]+H(t,n),e[i][1]+H(t,n)]);return De(r,null,n)}function De(e,t,n){let r=e.length,i=[];if(r>3){let a=[],o=1-n.curveTightness;i.push({op:`move`,data:[e[1][0],e[1][1]]});for(let t=1;t+2<r;t++){let n=e[t];a[0]=[n[0],n[1]],a[1]=[n[0]+(o*e[t+1][0]-o*e[t-1][0])/6,n[1]+(o*e[t+1][1]-o*e[t-1][1])/6],a[2]=[e[t+1][0]+(o*e[t][0]-o*e[t+2][0])/6,e[t+1][1]+(o*e[t][1]-o*e[t+2][1])/6],a[3]=[e[t+1][0],e[t+1][1]],i.push({op:`bcurveTo`,data:[a[1][0],a[1][1],a[2][0],a[2][1],a[3][0],a[3][1]]})}if(t&&t.length===2){let e=n.maxRandomnessOffset;i.push({op:`lineTo`,data:[t[0]+H(e,n),t[1]+H(e,n)]})}}else r===3?(i.push({op:`move`,data:[e[1][0],e[1][1]]}),i.push({op:`bcurveTo`,data:[e[1][0],e[1][1],e[2][0],e[2][1],e[2][0],e[2][1]]})):r===2&&i.push(...Te(e[0][0],e[0][1],e[1][0],e[1][1],n,!0,!0));return i}function Oe(e,t,n,r,i,a,o,s){let c=[],l=[];if(s.roughness===0){e/=4,l.push([t+r*Math.cos(-e),n+i*Math.sin(-e)]);for(let a=0;a<=2*Math.PI;a+=e){let e=[t+r*Math.cos(a),n+i*Math.sin(a)];c.push(e),l.push(e)}l.push([t+r*Math.cos(0),n+i*Math.sin(0)]),l.push([t+r*Math.cos(e),n+i*Math.sin(e)])}else{let u=H(.5,s)-Math.PI/2;l.push([H(a,s)+t+.9*r*Math.cos(u-e),H(a,s)+n+.9*i*Math.sin(u-e)]);let d=2*Math.PI+u-.01;for(let o=u;o<d;o+=e){let e=[H(a,s)+t+r*Math.cos(o),H(a,s)+n+i*Math.sin(o)];c.push(e),l.push(e)}l.push([H(a,s)+t+r*Math.cos(u+2*Math.PI+.5*o),H(a,s)+n+i*Math.sin(u+2*Math.PI+.5*o)]),l.push([H(a,s)+t+.98*r*Math.cos(u+o),H(a,s)+n+.98*i*Math.sin(u+o)]),l.push([H(a,s)+t+.9*r*Math.cos(u+.5*o),H(a,s)+n+.9*i*Math.sin(u+.5*o)])}return[l,c]}function ke(e,t,n,r,i,a,o,s,c){let l=a+H(.1,c),u=[];u.push([H(s,c)+t+.9*r*Math.cos(l-e),H(s,c)+n+.9*i*Math.sin(l-e)]);for(let a=l;a<=o;a+=e)u.push([H(s,c)+t+r*Math.cos(a),H(s,c)+n+i*Math.sin(a)]);return u.push([t+r*Math.cos(o),n+i*Math.sin(o)]),u.push([t+r*Math.cos(o),n+i*Math.sin(o)]),De(u,null,c)}function Ae(e,t,n,r,i,a,o,s){let c=[],l=[s.maxRandomnessOffset||1,(s.maxRandomnessOffset||1)+.3],u=[0,0],d=s.disableMultiStroke?1:2,f=s.preserveVertices;for(let p=0;p<d;p++)p===0?c.push({op:`move`,data:[o[0],o[1]]}):c.push({op:`move`,data:[o[0]+(f?0:H(l[0],s)),o[1]+(f?0:H(l[0],s))]}),u=f?[i,a]:[i+H(l[p],s),a+H(l[p],s)],c.push({op:`bcurveTo`,data:[e+H(l[p],s),t+H(l[p],s),n+H(l[p],s),r+H(l[p],s),u[0],u[1]]});return c}function je(e){return[...e]}function Me(e,t=0){let n=e.length;if(n<3)throw Error(`A curve must have at least three points.`);let r=[];if(n===3)r.push(je(e[0]),je(e[1]),je(e[2]),je(e[2]));else{let n=[];n.push(e[0],e[0]);for(let t=1;t<e.length;t++)n.push(e[t]),t===e.length-1&&n.push(e[t]);let i=[],a=1-t;r.push(je(n[0]));for(let e=1;e+2<n.length;e++){let t=n[e];i[0]=[t[0],t[1]],i[1]=[t[0]+(a*n[e+1][0]-a*n[e-1][0])/6,t[1]+(a*n[e+1][1]-a*n[e-1][1])/6],i[2]=[n[e+1][0]+(a*n[e][0]-a*n[e+2][0])/6,n[e+1][1]+(a*n[e][1]-a*n[e+2][1])/6],i[3]=[n[e+1][0],n[e+1][1]],r.push(i[1],i[2],i[3])}}return r}function Ne(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2}function Pe(e,t,n){let r=Ne(t,n);if(r===0)return Ne(e,t);let i=((e[0]-t[0])*(n[0]-t[0])+(e[1]-t[1])*(n[1]-t[1]))/r;return i=Math.max(0,Math.min(1,i)),Ne(e,Fe(t,n,i))}function Fe(e,t,n){return[e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n]}function Ie(e,t,n,r){let i=r||[];if(function(e,t){let n=e[t+0],r=e[t+1],i=e[t+2],a=e[t+3],o=3*r[0]-2*n[0]-a[0];o*=o;let s=3*r[1]-2*n[1]-a[1];s*=s;let c=3*i[0]-2*a[0]-n[0];c*=c;let l=3*i[1]-2*a[1]-n[1];return l*=l,o<c&&(o=c),s<l&&(s=l),o+s}(e,t)<n){let n=e[t+0];i.length?(a=i[i.length-1],o=n,Math.sqrt(Ne(a,o))>1&&i.push(n)):i.push(n),i.push(e[t+3])}else{let r=.5,a=e[t+0],o=e[t+1],s=e[t+2],c=e[t+3],l=Fe(a,o,r),u=Fe(o,s,r),d=Fe(s,c,r),f=Fe(l,u,r),p=Fe(u,d,r),m=Fe(f,p,r);Ie([a,l,f,m],0,n,i),Ie([m,p,d,c],0,n,i)}var a,o;return i}function Le(e,t){return Re(e,0,e.length,t)}function Re(e,t,n,r,i){let a=i||[],o=e[t],s=e[n-1],c=0,l=1;for(let r=t+1;r<n-1;++r){let t=Pe(e[r],o,s);t>c&&(c=t,l=r)}return Math.sqrt(c)>r?(Re(e,t,l+1,r,a),Re(e,l,n,r,a)):(a.length||a.push(o),a.push(s)),a}function ze(e,t=.15,n){let r=[],i=(e.length-1)/3;for(let n=0;n<i;n++)Ie(e,3*n,t,r);return n&&n>0?Re(r,0,r.length,n):r}var U=`none`,Be=class{constructor(e){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:`#000`,strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:`hachure`,fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=e||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(e){return e?Object.assign({},this.defaultOptions,e):this.defaultOptions}_d(e,t,n){return{shape:e,sets:t||[],options:n||this.defaultOptions}}line(e,t,n,r,i){let a=this._o(i);return this._d(`line`,[de(e,t,n,r,a)],a)}rectangle(e,t,n,r,i){let a=this._o(i),o=[],s=pe(e,t,n,r,a);if(a.fill){let i=[[e,t],[e+n,t],[e+n,t+r],[e,t+r]];a.fillStyle===`solid`?o.push(ye([i],a)):o.push(be([i],a))}return a.stroke!==U&&o.push(s),this._d(`rectangle`,o,a)}ellipse(e,t,n,r,i){let a=this._o(i),o=[],s=he(n,r,a),c=ge(e,t,a,s);if(a.fill){if(a.fillStyle===`solid`){let n=ge(e,t,a,s).opset;n.type=`fillPath`,o.push(n)}else o.push(be([c.estimatedPoints],a))}return a.stroke!==U&&o.push(c.opset),this._d(`ellipse`,o,a)}circle(e,t,n,r){let i=this.ellipse(e,t,n,n,r);return i.shape=`circle`,i}linearPath(e,t){let n=this._o(t);return this._d(`linearPath`,[fe(e,!1,n)],n)}arc(e,t,n,r,i,a,o=!1,s){let c=this._o(s),l=[],u=_e(e,t,n,r,i,a,o,!0,c);if(o&&c.fill){if(c.fillStyle===`solid`){let o=Object.assign({},c);o.disableMultiStroke=!0;let s=_e(e,t,n,r,i,a,!0,!1,o);s.type=`fillPath`,l.push(s)}else l.push(function(e,t,n,r,i,a,o){let s=e,c=t,l=Math.abs(n/2),u=Math.abs(r/2);l+=H(.01*l,o),u+=H(.01*u,o);let d=i,f=a;for(;d<0;)d+=2*Math.PI,f+=2*Math.PI;f-d>2*Math.PI&&(d=0,f=2*Math.PI);let p=(f-d)/o.curveStepCount,m=[];for(let e=d;e<=f;e+=p)m.push([s+l*Math.cos(e),c+u*Math.sin(e)]);return m.push([s+l*Math.cos(f),c+u*Math.sin(f)]),m.push([s,c]),be([m],o)}(e,t,n,r,i,a,c))}return c.stroke!==U&&l.push(u),this._d(`arc`,l,c)}curve(e,t){let n=this._o(t),r=[],i=me(e,n);if(n.fill&&n.fill!==U){if(n.fillStyle===`solid`){let t=me(e,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));r.push({type:`fillPath`,ops:this._mergedShape(t.ops)})}else{let t=[],i=e;if(i.length){let e=typeof i[0][0]==`number`?[i]:i;for(let r of e)r.length<3?t.push(...r):r.length===3?t.push(...ze(Me([r[0],r[0],r[1],r[2]]),10,(1+n.roughness)/2)):t.push(...ze(Me(r),10,(1+n.roughness)/2))}t.length&&r.push(be([t],n))}}return n.stroke!==U&&r.push(i),this._d(`curve`,r,n)}polygon(e,t){let n=this._o(t),r=[],i=fe(e,!0,n);return n.fill&&(n.fillStyle===`solid`?r.push(ye([e],n)):r.push(be([e],n))),n.stroke!==U&&r.push(i),this._d(`polygon`,r,n)}path(e,t){let n=this._o(t),r=[];if(!e)return this._d(`path`,r,n);e=(e||``).replace(/\n/g,` `).replace(/(-\s)/g,`-`).replace(`/(ss)/g`,` `);let i=n.fill&&n.fill!==`transparent`&&n.fill!==U,a=n.stroke!==U,o=!!(n.simplification&&n.simplification<1),s=function(e,t,n){let r=se(oe(V(e))),i=[],a=[],o=[0,0],s=[],c=()=>{s.length>=4&&a.push(...ze(s,t)),s=[]},l=()=>{c(),a.length&&(i.push(a),a=[])};for(let{key:e,data:t}of r)switch(e){case`M`:l(),o=[t[0],t[1]],a.push(o);break;case`L`:c(),a.push([t[0],t[1]]);break;case`C`:if(!s.length){let e=a.length?a[a.length-1]:o;s.push([e[0],e[1]])}s.push([t[0],t[1]]),s.push([t[2],t[3]]),s.push([t[4],t[5]]);break;case`Z`:c(),a.push([o[0],o[1]])}if(l(),!n)return i;let u=[];for(let e of i){let t=Le(e,n);t.length&&u.push(t)}return u}(e,1,o?4-4*(n.simplification||1):(1+n.roughness)/2),c=ve(e,n);if(i){if(n.fillStyle===`solid`){if(s.length===1){let t=ve(e,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));r.push({type:`fillPath`,ops:this._mergedShape(t.ops)})}else r.push(ye(s,n))}else r.push(be(s,n))}return a&&(o?s.forEach((e=>{r.push(fe(e,!1,n))})):r.push(c)),this._d(`path`,r,n)}opsToPath(e,t){let n=``;for(let r of e.ops){let e=typeof t==`number`&&t>=0?r.data.map((e=>+e.toFixed(t))):r.data;switch(r.op){case`move`:n+=`M${e[0]} ${e[1]} `;break;case`bcurveTo`:n+=`C${e[0]} ${e[1]}, ${e[2]} ${e[3]}, ${e[4]} ${e[5]} `;break;case`lineTo`:n+=`L${e[0]} ${e[1]} `}}return n.trim()}toPaths(e){let t=e.sets||[],n=e.options||this.defaultOptions,r=[];for(let e of t){let t=null;switch(e.type){case`path`:t={d:this.opsToPath(e),stroke:n.stroke,strokeWidth:n.strokeWidth,fill:U};break;case`fillPath`:t={d:this.opsToPath(e),stroke:U,strokeWidth:0,fill:n.fill||U};break;case`fillSketch`:t=this.fillSketch(e,n)}t&&r.push(t)}return r}fillSketch(e,t){let n=t.fillWeight;return n<0&&(n=t.strokeWidth/2),{d:this.opsToPath(e),stroke:t.fill||U,strokeWidth:n,fill:U}}_mergedShape(e){return e.filter(((e,t)=>t===0||e.op!==`move`))}},Ve=class{constructor(e,t){this.canvas=e,this.ctx=this.canvas.getContext(`2d`),this.gen=new Be(t)}draw(e){let t=e.sets||[],n=e.options||this.getDefaultOptions(),r=this.ctx,i=e.options.fixedDecimalPlaceDigits;for(let a of t)switch(a.type){case`path`:r.save(),r.strokeStyle=n.stroke===`none`?`transparent`:n.stroke,r.lineWidth=n.strokeWidth,n.strokeLineDash&&r.setLineDash(n.strokeLineDash),n.strokeLineDashOffset&&(r.lineDashOffset=n.strokeLineDashOffset),this._drawToContext(r,a,i),r.restore();break;case`fillPath`:{r.save(),r.fillStyle=n.fill||``;let t=e.shape===`curve`||e.shape===`polygon`||e.shape===`path`?`evenodd`:`nonzero`;this._drawToContext(r,a,i,t),r.restore();break}case`fillSketch`:this.fillSketch(r,a,n)}}fillSketch(e,t,n){let r=n.fillWeight;r<0&&(r=n.strokeWidth/2),e.save(),n.fillLineDash&&e.setLineDash(n.fillLineDash),n.fillLineDashOffset&&(e.lineDashOffset=n.fillLineDashOffset),e.strokeStyle=n.fill||``,e.lineWidth=r,this._drawToContext(e,t,n.fixedDecimalPlaceDigits),e.restore()}_drawToContext(e,t,n,r=`nonzero`){e.beginPath();for(let r of t.ops){let t=typeof n==`number`&&n>=0?r.data.map((e=>+e.toFixed(n))):r.data;switch(r.op){case`move`:e.moveTo(t[0],t[1]);break;case`bcurveTo`:e.bezierCurveTo(t[0],t[1],t[2],t[3],t[4],t[5]);break;case`lineTo`:e.lineTo(t[0],t[1])}}t.type===`fillPath`?e.fill(r):e.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(e,t,n,r,i){let a=this.gen.line(e,t,n,r,i);return this.draw(a),a}rectangle(e,t,n,r,i){let a=this.gen.rectangle(e,t,n,r,i);return this.draw(a),a}ellipse(e,t,n,r,i){let a=this.gen.ellipse(e,t,n,r,i);return this.draw(a),a}circle(e,t,n,r){let i=this.gen.circle(e,t,n,r);return this.draw(i),i}linearPath(e,t){let n=this.gen.linearPath(e,t);return this.draw(n),n}polygon(e,t){let n=this.gen.polygon(e,t);return this.draw(n),n}arc(e,t,n,r,i,a,o=!1,s){let c=this.gen.arc(e,t,n,r,i,a,o,s);return this.draw(c),c}curve(e,t){let n=this.gen.curve(e,t);return this.draw(n),n}path(e,t){let n=this.gen.path(e,t);return this.draw(n),n}},He=`http://www.w3.org/2000/svg`,Ue=class{constructor(e,t){this.svg=e,this.gen=new Be(t)}draw(e){let t=e.sets||[],n=e.options||this.getDefaultOptions(),r=this.svg.ownerDocument||window.document,i=r.createElementNS(He,`g`),a=e.options.fixedDecimalPlaceDigits;for(let o of t){let t=null;switch(o.type){case`path`:t=r.createElementNS(He,`path`),t.setAttribute(`d`,this.opsToPath(o,a)),t.setAttribute(`stroke`,n.stroke),t.setAttribute(`stroke-width`,n.strokeWidth+``),t.setAttribute(`fill`,`none`),n.strokeLineDash&&t.setAttribute(`stroke-dasharray`,n.strokeLineDash.join(` `).trim()),n.strokeLineDashOffset&&t.setAttribute(`stroke-dashoffset`,`${n.strokeLineDashOffset}`);break;case`fillPath`:t=r.createElementNS(He,`path`),t.setAttribute(`d`,this.opsToPath(o,a)),t.setAttribute(`stroke`,`none`),t.setAttribute(`stroke-width`,`0`),t.setAttribute(`fill`,n.fill||``),e.shape!==`curve`&&e.shape!==`polygon`||t.setAttribute(`fill-rule`,`evenodd`);break;case`fillSketch`:t=this.fillSketch(r,o,n)}t&&i.appendChild(t)}return i}fillSketch(e,t,n){let r=n.fillWeight;r<0&&(r=n.strokeWidth/2);let i=e.createElementNS(He,`path`);return i.setAttribute(`d`,this.opsToPath(t,n.fixedDecimalPlaceDigits)),i.setAttribute(`stroke`,n.fill||``),i.setAttribute(`stroke-width`,r+``),i.setAttribute(`fill`,`none`),n.fillLineDash&&i.setAttribute(`stroke-dasharray`,n.fillLineDash.join(` `).trim()),n.fillLineDashOffset&&i.setAttribute(`stroke-dashoffset`,`${n.fillLineDashOffset}`),i}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(e,t){return this.gen.opsToPath(e,t)}line(e,t,n,r,i){let a=this.gen.line(e,t,n,r,i);return this.draw(a)}rectangle(e,t,n,r,i){let a=this.gen.rectangle(e,t,n,r,i);return this.draw(a)}ellipse(e,t,n,r,i){let a=this.gen.ellipse(e,t,n,r,i);return this.draw(a)}circle(e,t,n,r){let i=this.gen.circle(e,t,n,r);return this.draw(i)}linearPath(e,t){let n=this.gen.linearPath(e,t);return this.draw(n)}polygon(e,t){let n=this.gen.polygon(e,t);return this.draw(n)}arc(e,t,n,r,i,a,o=!1,s){let c=this.gen.arc(e,t,n,r,i,a,o,s);return this.draw(c)}curve(e,t){let n=this.gen.curve(e,t);return this.draw(n)}path(e,t){let n=this.gen.path(e,t);return this.draw(n)}},W={canvas:(e,t)=>new Ve(e,t),svg:(e,t)=>new Ue(e,t),generator:e=>new Be(e),newSeed:()=>Be.newSeed()},We=1,Ge=3;async function Ke(t){let n=t.getElementsByTagName(`img`);if(!n||n.length===0)return;let r=!qe(t);await Promise.all([...n].map(t=>new Promise(n=>{function i(){if(t.style.display=`flex`,t.style.flexDirection=`column`,r){let e=a().fontSize?a().fontSize:window.getComputedStyle(document.body).fontSize,[n=o.fontSize]=g(e),r=n*5+`px`;t.style.minWidth=r,t.style.maxWidth=r}else t.style.width=`100%`;n(t)}e(i,`setupImage`),setTimeout(()=>{t.complete&&i()}),t.addEventListener(`error`,i),t.addEventListener(`load`,i)})))}e(Ke,`configureLabelImages`);function qe(e){return e.nodeType===Ge?e.textContent?.trim()!==``:e.nodeType!==We||e.tagName.toLowerCase()===`img`?!1:[...e.childNodes].some(qe)}e(qe,`hasTextBesidesImages`);var Je=3,Ye=32,Xe=e(async(e,t,r)=>{let o=a(),s=e.insert(`g`).attr(`class`,r??`node default`).attr(`id`,t.domId||t.id),c=s.insert(`g`).attr(`class`,`label`).attr(`style`,_(t.labelStyle)),l=[{text:typeof t.label==`string`?t.label:t.label?.[0]??``,cssClass:`c4-name`},{text:t.stereotype,cssClass:`c4-type`},...(t.description??[]).map(e=>({text:e,cssClass:`c4-descr`}))].filter(e=>e.text),u=t.width?Math.max(t.width-2*(t.padding??0),Ye):a().flowchart?.wrappingWidth??200,d=o.c4?.wrap??!0?u:1/0,f=await Promise.all(l.map(async e=>{let r=c.append(`g`).attr(`class`,e.cssClass),a=await p(r,i(v(e.text??``),o),{useHtmlLabels:!1,markdown:!1,isNode:!0,width:d,style:t.labelStyle},o);return n(a).selectAll(`tspan.text-outer-tspan`).attr(`text-anchor`,`middle`),n(a).selectAll(`tspan.text-inner-tspan`).attr(`font-weight`,null).attr(`font-style`,null),{el:r,box:r.node().getBBox()}})),m=Math.max(...f.map(({box:e})=>e.width),0),h=0;for(let{el:e,box:t}of f)e.attr(`transform`,`translate(${m/2-t.x-t.width/2}, ${h-t.y})`),h+=t.height+Je;let g=f.length>0?h-Je:0;return c.insert(`rect`,`:first-child`),c.attr(`transform`,`translate(${-m/2}, ${-g/2})`),{shapeSvg:s,bbox:c.node().getBBox(),halfPadding:(t.padding??0)/2,label:c}},`c4LabelHelper`),Ze=e((t,n)=>{let{x:r,y:i,width:a,height:o}=t;return a>=n?t:`left`in t?{x:r,y:i,width:n,height:o,top:i,left:r,bottom:i+o,right:r+n,toJSON:e(()=>({}),`toJSON`)}:{x:r-(n-a)/2,y:i,width:n,height:o}},`withMinWidth`),G=e(async(e,t,r,{ignoreMinWidth:o=!1}={})=>{if(t.stereotype!==void 0)return Xe(e,t,r);let c,l=t.useHtmlLabels||s(a()?.htmlLabels);c=r||`node default`;let u=e.insert(`g`).attr(`class`,c).attr(`id`,t.domId||t.id),d=u.insert(`g`).attr(`class`,`label`).attr(`style`,_(t.labelStyle)),f;f=t.label===void 0?``:typeof t.label==`string`?t.label:t.label[0];let m=!!t.icon||!!t.img,g=t.labelType===`markdown`,y=f&&!t.width&&!o?t.minWidth??0:0,b=await p(d,i(v(f),a()),{useHtmlLabels:l,width:t.width||t.wrappingWidth||a().flowchart?.wrappingWidth,minWidth:y,classes:g?`markdown-node-label`:``,style:t.labelStyle,addSvgBackground:m,markdown:g},a()),x=(t?.padding??0)/2,S;if(l){let e=b.children[0],t=n(b);await Ke(e),S=await h.measure(()=>e.getBoundingClientRect()),S=Ze(S,y),t.attr(`width`,S.width),t.attr(`height`,S.height)}else S=await h.measure(()=>b.getBBox()),S=Ze(S,y);return l?d.attr(`transform`,`translate(`+-S.width/2+`, `+-S.height/2+`)`):d.attr(`transform`,`translate(0, `+-S.height/2+`)`),t.centerLabel&&d.attr(`transform`,`translate(`+-S.width/2+`, `+-S.height/2+`)`),d.insert(`rect`,`:first-child`),{shapeSvg:u,bbox:S,halfPadding:x,label:d}},`labelHelper`),Qe=e(async(e,t,r)=>{let o=r.useHtmlLabels??l(a()),s=e.insert(`g`).attr(`class`,`label`).attr(`style`,r.labelStyle||``),c=await p(s,i(v(t),a()),{useHtmlLabels:o,width:r.width||a()?.flowchart?.wrappingWidth,style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img}),u=r.padding/2,d;if(l(a())){let e=c.children[0],t=n(c);d=await h.measure(()=>e.getBoundingClientRect()),t.attr(`width`,d.width),t.attr(`height`,d.height)}else d=await h.measure(()=>c.getBBox());return o?s.attr(`transform`,`translate(`+-d.width/2+`, `+-d.height/2+`)`):s.attr(`transform`,`translate(0, `+-d.height/2+`)`),r.centerLabel&&s.attr(`transform`,`translate(`+-d.width/2+`, `+-d.height/2+`)`),s.insert(`rect`,`:first-child`),{shapeSvg:e,bbox:d,halfPadding:u,label:s}},`insertLabel`),K=e((e,t,n)=>{if(n){e.width=n.width,e.height=n.height;return}let r=t.node().getBBox();e.width=r.width,e.height=r.height},`updateNodeBounds`),q=e((e,t)=>(e.look===`handDrawn`?`rough-node`:`node`)+` `+e.cssClasses+` `+(t||``),`getNodeClasses`);function J(e){let t=e.map((e,t)=>`${t===0?`M`:`L`}${e.x},${e.y}`);return t.push(`Z`),t.join(` `)}e(J,`createPathFromPoints`);function $e(e,t,n,r,i,a){let o=[],s=n-e,c=r-t,l=s/a,u=2*Math.PI/l,d=t+c/2;for(let t=0;t<=50;t++){let n=e+t/50*s,r=d+i*Math.sin(u*(n-e));o.push({x:n,y:r})}return o}e($e,`generateFullSineWavePoints`);function Y(e,t,n,r,i,a){let o=[],s=i*Math.PI/180,c=(a*Math.PI/180-s)/(r-1);for(let i=0;i<r;i++){let r=s+i*c,a=e+n*Math.cos(r),l=t+n*Math.sin(r);o.push({x:-a,y:-l})}return o}e(Y,`generateCirclePoints`);function et(t){let n=Array.from(t.childNodes).filter(e=>e.tagName===`path`),r=document.createElementNS(`http://www.w3.org/2000/svg`,`path`),i=n.map(e=>e.getAttribute(`d`)).filter(e=>e!==null).join(` `);r.setAttribute(`d`,i);let a=n.find(e=>e.getAttribute(`fill`)!==`none`),o=n.find(e=>e.getAttribute(`stroke`)!==`none`),s=e((e,t)=>e?.getAttribute(t)??void 0,`getAttr`);if(a){let e={fill:s(a,`fill`),"fill-opacity":s(a,`fill-opacity`)??`1`};Object.entries(e).forEach(([e,t])=>{t&&r.setAttribute(e,t)})}if(o){let e={stroke:s(o,`stroke`),"stroke-width":s(o,`stroke-width`)??`1`,"stroke-opacity":s(o,`stroke-opacity`)??`1`};Object.entries(e).forEach(([e,t])=>{t&&r.setAttribute(e,t)})}let c=document.createElementNS(`http://www.w3.org/2000/svg`,`g`);return c.appendChild(r),c}e(et,`mergePaths`);var tt=e((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,c,l;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),c=a===0?0:s*i/a,l=s):(i<0&&(o=-o),c=o,l=i===0?0:o*a/i),{x:n+c,y:r+l}},`intersectRect`);function nt(e,t){return e.intersect(t)}e(nt,`intersectNode`);var rt=nt;function it(e,t,n,r){var i=e.x,a=e.y,o=i-r.x,s=a-r.y,c=Math.sqrt(t*t*s*s+n*n*o*o),l=Math.abs(t*n*o/c);r.x<i&&(l=-l);var u=Math.abs(t*n*s/c);return r.y<a&&(u=-u),{x:i+l,y:a+u}}e(it,`intersectEllipse`);var at=it;function ot(e,t,n){return at(e,t,t,n)}e(ot,`intersectCircle`);var st=ot;function ct(e,t,n,r){{let i=t.y-e.y,a=e.x-t.x,o=t.x*e.y-e.x*t.y,s=i*n.x+a*n.y+o,c=i*r.x+a*r.y+o,l=1e-6;if(s!==0&&c!==0&<(s,c))return;let u=r.y-n.y,d=n.x-r.x,f=r.x*n.y-n.x*r.y,p=u*e.x+d*e.y+f,m=u*t.x+d*t.y+f;if(Math.abs(p)<l&&Math.abs(m)<l&<(p,m))return;let h=i*d-u*a;return h===0?void 0:{x:(a*f-d*o)/h,y:(u*o-i*f)/h}}}e(ct,`intersectLine`);function lt(e,t){return e*t>0}e(lt,`sameSign`);var ut=ct;function dt(e,t,n){let r=e.x,i=e.y,a=[],o=1/0,s=1/0;typeof t.forEach==`function`?t.forEach(function(e){o=Math.min(o,e.x),s=Math.min(s,e.y)}):(o=Math.min(o,t.x),s=Math.min(s,t.y));let c=r-e.width/2-o,l=i-e.height/2-s;for(let r=0;r<t.length;r++){let i=t[r],o=t[r<t.length-1?r+1:0],s=ut(e,n,{x:c+i.x,y:l+i.y},{x:c+o.x,y:l+o.y});s&&a.push(s)}return a.length?(a.length>1&&a.sort(function(e,t){let r=e.x-n.x,i=e.y-n.y,a=Math.sqrt(r*r+i*i),o=t.x-n.x,s=t.y-n.y,c=Math.sqrt(o*o+s*s);return a<c?-1:a===c?0:1}),a[0]):e}e(dt,`intersectPolygon`);var X={node:rt,circle:st,ellipse:at,polygon:dt,rect:tt},Z=e((e,t,n,r,i)=>[`M`,e+i,t,`H`,e+n-i,`A`,i,i,0,0,1,e+n,t+i,`V`,t+r-i,`A`,i,i,0,0,1,e+n-i,t+r,`H`,e+i,`A`,i,i,0,0,1,e,t+r-i,`V`,t+i,`A`,i,i,0,0,1,e+i,t,`Z`].join(` `),`createRoundedRectPathD`),ft=e(async(e,t,n,r=!1,i=!1)=>{let o=t||``;typeof o==`object`&&(o=o[0]);let s=a(),c=l(s);return await p(e,o,{style:n,isTitle:r,useHtmlLabels:c,markdown:!1,isNode:i,width:1/0},s)},`createLabel`);function pt(e,n){let{labelStyles:r}=E(n);n.labelStyle=r;let i=q(n),a=i;i||(a=`anchor`);let o=e.insert(`g`).attr(`class`,a).attr(`id`,n.domId||n.id),{cssStyles:s}=n,c=W.svg(o),l=D(n,{fill:`black`,stroke:`none`,fillStyle:`solid`});n.look!==`handDrawn`&&(l.roughness=0);let u=c.circle(0,0,2,l),d=o.insert(()=>u,`:first-child`);return d.attr(`class`,`anchor`).attr(`style`,_(s)),K(n,d),n.intersect=function(e){return t.info(`Circle intersect`,n,1,e),X.circle(n,1,e)},o}e(pt,`anchor`);function mt(e,t,n,r,i,a,o){let s=(e+n)/2,c=(t+r)/2,l=Math.atan2(r-t,n-e),u=(n-e)/2,d=(r-t)/2,f=u/i,p=d/a,m=Math.sqrt(f**2+p**2);if(m>1)throw Error(`The given radii are too small to create an arc between the points.`);let h=Math.sqrt(1-m**2),g=s+h*a*Math.sin(l)*(o?-1:1),_=c-h*i*Math.cos(l)*(o?-1:1),v=Math.atan2((t-_)/a,(e-g)/i),y=Math.atan2((r-_)/a,(n-g)/i)-v;o&&y<0&&(y+=2*Math.PI),!o&&y>0&&(y-=2*Math.PI);let b=[];for(let e=0;e<20;e++){let t=v+e/19*y,n=g+i*Math.cos(t),r=_+a*Math.sin(t);b.push({x:n,y:r})}return b}e(mt,`generateArcPoints`);function ht(e,t,n){let[r,i]=[t,n].sort((e,t)=>t-e);return i*(1-Math.sqrt(1-(e/r/2)**2))}e(ht,`calculateArcSagitta`);async function gt(t,n){let{labelStyles:r,nodeStyles:i}=E(n);n.labelStyle=r;let a=n.padding??0,o=n.look===`neo`?16:a,s=n.look===`neo`?12:a,c=e(e=>e+s,`calcTotalHeight`),l=e(e=>{let t=e/2;return[t/(2.5+e/50),t]},`calcEllipseRadius`),{shapeSvg:u,bbox:d}=await G(t,n,q(n)),f=c(n?.height?n?.height:d.height),[p,m]=l(f),h=ht(f,p,m),g=(n?.width?n?.width:d.width)+o*2+h-h,_=f,{cssStyles:v}=n,y=[{x:g/2,y:-_/2},{x:-g/2,y:-_/2},...mt(-g/2,-_/2,-g/2,_/2,p,m,!1),{x:g/2,y:_/2},...mt(g/2,_/2,g/2,-_/2,p,m,!0)],b=W.svg(u),x=D(n,{});n.look!==`handDrawn`&&(x.roughness=0,x.fillStyle=`solid`);let S=J(y),C=b.path(S,x),w=u.insert(()=>C,`:first-child`);return w.attr(`class`,`basic label-container outer-path`),v&&n.look!==`handDrawn`&&w.selectAll(`path`).attr(`style`,v),i&&n.look!==`handDrawn`&&w.selectAll(`path`).attr(`style`,i),w.attr(`transform`,`translate(${p/2}, 0)`),K(n,w),n.intersect=function(e){return X.polygon(n,y,e)},u}e(gt,`bowTieRect`);async function _t(t,n,{config:{themeVariables:r}}){let{labelStyles:i,nodeStyles:a}=E(n);n.labelStyle=i;let{shapeSvg:o,bbox:s,label:c}=await G(t,n,q(n)),l=r?.nodeBorder??r?.lineColor??`currentColor`,u=n.padding??12,d=Math.max(s.width+u*2,n.width??0,80),f=Math.max(Math.min(d*.08,12),5),p=Math.max(s.height+u*2+f,n.height??0),m=-p/2+f,h=p/2,g=d*.72,_=[`M${-d/2},${m}`,`L${-g/2},${h}`,`A${g/2},${f} 0 0 0 ${g/2},${h}`,`L${d/2},${m}`,`A${d/2},${f} 0 0 0 ${-d/2},${m}`,`Z`].join(` `),{cssStyles:v}=n,y=o.insert(`g`,`:first-child`).attr(`class`,`basic label-container`);if(n.look===`handDrawn`){let e=W.svg(o).path(_,D(n,{}));y.node()?.appendChild(e),v&&y.attr(`style`,v)}else y.append(`path`).attr(`d`,_).attr(`style`,a);y.append(`ellipse`).attr(`cx`,0).attr(`cy`,m).attr(`rx`,d/2).attr(`ry`,f).attr(`style`,`fill:none;stroke:${l};stroke-width:1px`),K(n,y);let b=m+(h-m)/2;c.attr(`transform`,`translate(${-(s.width/2)-(s.x-(s.left??0))}, ${b-s.height/2-(s.y-(s.top??0))})`);let x=e((e,t,n)=>Array.from({length:13},(r,i)=>{let a=Math.PI-i*Math.PI/12;return{x:e*Math.cos(a),y:t+n*f*Math.sin(a)}}),`arc`),S=[...x(d/2,m,-1),...x(g/2,h,1).reverse()];return n.intersect=function(e){return X.polygon(n,S,e)},o}e(_t,`bucket`);var vt=20,yt=8,bt=80,xt=8;function St(e){let{themeVariables:t}=a(),n=t.clusterBkg,r=t.clusterBorder;switch(e){case`flow`:return{rx:10,fill:`none`,stroke:t.flowContainerStroke||t.secondaryBorderColor,strokeWidth:.75,cssClass:`flow-collapsed`};default:return{rx:xt,fill:n,stroke:r,cssClass:`collapsed-group`}}}e(St,`getCollapsedStyle`);async function Ct(e,t){let n=St(t.metadata?.containerType),{fill:r,stroke:i}=n,{nodeStyles:o}=E(t),{shapeSvg:s,bbox:c}=await G(e,t,q(t)),{theme:u,themeVariables:d}=a();b(s,t.colorIndex,u,d.borderColorArray);let f=t.padding??8,p=c.height,m=Math.max(c.width+f*2,bt,t?.width??0),h=Math.max(p+yt+vt+f*2,t?.height??0),g=-m/2,v=-h/2,y=-(yt+vt)/2,x=s.select(`.label`);x&&(t.useHtmlLabels??l(a())?x.attr(`transform`,`translate(${-c.width/2}, ${-c.height/2+y})`):x.attr(`transform`,`translate(0, ${-c.height/2+y})`));let S;if(t.look===`handDrawn`){let e=W.svg(s),a=D(t,{fill:r,stroke:i,...n.strokeWidth===void 0?{}:{strokeWidth:n.strokeWidth},...r===`none`?{fillWeight:0}:{fillStyle:`solid`}}),o=e.path(Z(g,v,m,h,n.rx),a);S=s.insert(()=>o,`:first-child`),S.attr(`class`,`basic label-container `+n.cssClass).attr(`style`,_(t.cssStyles))}else S=s.insert(`rect`,`:first-child`),S.attr(`class`,`basic label-container `+n.cssClass).attr(`style`,o).attr(`rx`,n.rx).attr(`ry`,n.rx).attr(`x`,g).attr(`y`,v).attr(`width`,m).attr(`height`,h).attr(`fill`,r).attr(`stroke`,i),n.strokeWidth!==void 0&&S.attr(`stroke-width`,n.strokeWidth+`px`);let C=v+f+p+yt;s.append(`line`).attr(`class`,`collapsed-separator`).attr(`x1`,g+8).attr(`y1`,C).attr(`x2`,g+m-8).attr(`y2`,C).attr(`stroke`,i).attr(`stroke-dasharray`,`3, 3`);let w=C+vt/2;for(let e=-1;e<=1;e++)s.append(`circle`).attr(`class`,`collapsed-indicator`).attr(`cx`,e*10).attr(`cy`,w).attr(`r`,2.5).attr(`fill`,i);return K(t,S),t.calcIntersect=function(e,t){return X.rect(e,t)},t.intersect=function(e){return X.rect(t,e)},s}e(Ct,`collapsedGroup`);function wt(e,t,n,r){return e.insert(`polygon`,`:first-child`).attr(`points`,r.map(function(e){return e.x+`,`+e.y}).join(` `)).attr(`class`,`label-container`).attr(`transform`,`translate(`+-t/2+`,`+n/2+`)`)}e(wt,`insertPolygonShape`);var Tt=[`right`,`left`,`up`,`down`],Et=`point`,Dt=e(e=>{let t=new Set;for(let n of e)switch(n){case`x`:t.add(`right`),t.add(`left`);break;case`y`:t.add(`up`),t.add(`down`);break;default:t.add(n)}return t},`expandAndDeduplicateDirections`),Ot=e(e=>Tt.filter(t=>e.has(t)).join(`|`)||Et,`getDirectionKey`),kt={"right|left|up|down":e(({height:e,midpoint:t,padding:n,width:r})=>[{x:0,y:0},{x:t,y:0},{x:r/2,y:2*n},{x:r-t,y:0},{x:r,y:0},{x:r,y:-e/3},{x:r+2*n,y:-e/2},{x:r,y:-2*e/3},{x:r,y:-e},{x:r-t,y:-e},{x:r/2,y:-e-2*n},{x:t,y:-e},{x:0,y:-e},{x:0,y:-2*e/3},{x:-2*n,y:-e/2},{x:0,y:-e/3}],`right|left|up|down`),"right|left|up":e(({height:e,midpoint:t,width:n})=>[{x:t,y:0},{x:n-t,y:0},{x:n,y:-e/2},{x:n-t,y:-e},{x:t,y:-e},{x:0,y:-e/2}],`right|left|up`),"right|left|down":e(({height:e,midpoint:t,width:n})=>[{x:0,y:0},{x:t,y:-e},{x:n-t,y:-e},{x:n,y:0}],`right|left|down`),"right|up|down":e(({height:e,midpoint:t,width:n})=>[{x:0,y:0},{x:n,y:-t},{x:n,y:-e+t},{x:0,y:-e}],`right|up|down`),"left|up|down":e(({height:e,midpoint:t,width:n})=>[{x:n,y:0},{x:0,y:-t},{x:0,y:-e+t},{x:n,y:-e}],`left|up|down`),"right|left":e(({height:e,midpoint:t,padding:n,width:r})=>[{x:t,y:0},{x:t,y:-n},{x:r-t,y:-n},{x:r-t,y:0},{x:r,y:-e/2},{x:r-t,y:-e},{x:r-t,y:-e+n},{x:t,y:-e+n},{x:t,y:-e},{x:0,y:-e/2}],`right|left`),"up|down":e(({height:e,midpoint:t,padding:n,width:r})=>[{x:r/2,y:0},{x:0,y:-n},{x:t,y:-n},{x:t,y:-e+n},{x:0,y:-e+n},{x:r/2,y:-e},{x:r,y:-e+n},{x:r-t,y:-e+n},{x:r-t,y:-n},{x:r,y:-n}],`up|down`),"right|up":e(({height:e,midpoint:t,width:n})=>[{x:0,y:0},{x:n,y:-t},{x:0,y:-e}],`right|up`),"right|down":e(({height:e,width:t})=>[{x:0,y:0},{x:t,y:0},{x:0,y:-e}],`right|down`),"left|up":e(({height:e,midpoint:t,width:n})=>[{x:n,y:0},{x:0,y:-t},{x:n,y:-e}],`left|up`),"left|down":e(({height:e,width:t})=>[{x:t,y:0},{x:0,y:0},{x:t,y:-e}],`left|down`),right:e(({height:e,midpoint:t,padding:n,width:r})=>[{x:t,y:-n},{x:t,y:-n},{x:r-t,y:-n},{x:r-t,y:0},{x:r,y:-e/2},{x:r-t,y:-e},{x:r-t,y:-e+n},{x:t,y:-e+n},{x:t,y:-e+n}],`right`),left:e(({height:e,midpoint:t,padding:n,width:r})=>[{x:t,y:0},{x:t,y:-n},{x:r-t,y:-n},{x:r-t,y:-e+n},{x:t,y:-e+n},{x:t,y:-e},{x:0,y:-e/2}],`left`),up:e(({height:e,midpoint:t,padding:n,width:r})=>[{x:t,y:-n},{x:t,y:-e+n},{x:0,y:-e+n},{x:r/2,y:-e},{x:r,y:-e+n},{x:r-t,y:-e+n},{x:r-t,y:-n}],`up`),down:e(({height:e,midpoint:t,padding:n,width:r})=>[{x:r/2,y:0},{x:0,y:-n},{x:t,y:-n},{x:t,y:-e+n},{x:r-t,y:-e+n},{x:r-t,y:-n},{x:r,y:-n}],`down`),[Et]:()=>[{x:0,y:0}]},At=e((e,t,n,r)=>{let i=Dt(e),a=(n.padding??0)/2,o=t.height+4*a,s=o/2,c=r??t.width+2*s+2*a;return(kt[Ot(i)]??kt[Et])({height:o,midpoint:s,padding:a,width:c})},`getArrowPoints`);async function jt(e,t){let n=t,{shapeSvg:r,bbox:i}=await G(e,n,q(n)),a=n.padding??0,o=i.height+2*a,s=o/2,c=i.width+2*s+a,l=n.width??0,u=n.positioned&&(n.widthInColumns??1)>1&&l>c?l:c,d=At(n.directions??[],i,n,u),f=wt(r,u,o,d);return f.attr(`style`,n.style??null),K(n,f),n.intersect=function(e){return X.polygon(n,d,e)},r}e(jt,`block_arrow`);async function Mt(e,t,{config:{themeVariables:n}}){let{labelStyles:r,nodeStyles:i}=E(t);t.labelStyle=r;let{shapeSvg:a,bbox:o,label:s}=await G(e,t,q(t)),c=n?.nodeBorder??n?.lineColor??`currentColor`,l=t.padding??12,u=Math.max(o.width+l*2,t.width??0,90),d=Math.max(o.height+l*2+18,t.height??0),f=-d/2,{cssStyles:p}=t,m=a.insert(`g`,`:first-child`).attr(`class`,`basic label-container`);if(t.look===`handDrawn`){let e=W.svg(a).path(Z(-u/2,f,u,d,12),D(t,{}));m.node()?.appendChild(e),p&&m.attr(`style`,p)}else m.append(`rect`).attr(`x`,-u/2).attr(`y`,f).attr(`width`,u).attr(`height`,d).attr(`rx`,12).attr(`ry`,12).attr(`style`,i);m.append(`line`).attr(`x1`,-u/2).attr(`y1`,f+18).attr(`x2`,u/2).attr(`y2`,f+18).attr(`style`,`stroke:${c};stroke-width:1px`);for(let e=0;e<3;e++)m.append(`circle`).attr(`cx`,-u/2+12+e*9).attr(`cy`,f+9).attr(`r`,2.5).attr(`style`,`fill:${c};stroke:none`);m.append(`rect`).attr(`class`,`browser-address-bar`).attr(`x`,-u/2+44).attr(`y`,f+4).attr(`width`,Math.max(u-56,10)).attr(`height`,10).attr(`rx`,3).attr(`ry`,3).attr(`style`,`fill:none;stroke:${c};stroke-width:1px;opacity:0.6`),K(t,m);let h=f+18+(d-18)/2;return s.attr(`transform`,`translate(${-(o.width/2)-(o.x-(o.left??0))}, ${h-o.height/2-(o.y-(o.top??0))})`),t.intersect=function(e){return X.rect(t,e)},a}e(Mt,`browser`);var Nt=12;async function Pt(e,t){let{labelStyles:n,nodeStyles:r}=E(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?28:i,o=t.look===`neo`?24:i,{shapeSvg:s,bbox:c}=await G(e,t,q(t)),l=(t?.width??c.width)+(t.look===`neo`?a*2:a+Nt),u=(t?.height??c.height)+(t.look===`neo`?o*2:o),d=l,f=-u,p=[{x:0+Nt,y:f},{x:d,y:f},{x:d,y:0},{x:0,y:0},{x:0,y:f+Nt},{x:0+Nt,y:f}],m,{cssStyles:h}=t;if(t.look===`handDrawn`){let e=W.svg(s),n=D(t,{}),r=J(p),i=e.path(r,n);m=s.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-l/2}, ${u/2})`),h&&m.attr(`style`,h)}else m=wt(s,l,u,p);return r&&m.attr(`style`,r),K(t,m),t.intersect=function(e){return X.polygon(t,p,e)},s}e(Pt,`card`);function Ft(e,t){let{nodeStyles:n}=E(t);t.label=``;let r=e.insert(`g`).attr(`class`,q(t)).attr(`id`,t.domId??t.id),{cssStyles:i}=t,a=Math.max(28,t.width??0),o=[{x:0,y:a/2},{x:a/2,y:0},{x:0,y:-a/2},{x:-a/2,y:0}],s=W.svg(r),c=D(t,{});t.look!==`handDrawn`&&(c.roughness=0,c.fillStyle=`solid`);let l=J(o),u=s.path(l,c),d=r.insert(()=>u,`:first-child`);return i&&t.look!==`handDrawn`&&d.selectAll(`path`).attr(`style`,i),n&&t.look!==`handDrawn`&&d.selectAll(`path`).attr(`style`,n),t.width=28,t.height=28,t.intersect=function(e){return X.polygon(t,o,e)},r}e(Ft,`choice`);async function It(e,n,r){let{labelStyles:i,nodeStyles:a}=E(n);n.labelStyle=i;let{shapeSvg:o,bbox:s,halfPadding:c}=await G(e,n,q(n),{ignoreMinWidth:!0}),l=r?.padding??c,u=Math.sqrt(s.width**2+s.height**2)/2,d=n.look===`neo`?u+16:u+l,f,{cssStyles:p}=n;if(n.look===`handDrawn`){let e=W.svg(o),t=D(n,{}),r=e.circle(0,0,d*2,t);f=o.insert(()=>r,`:first-child`),f.attr(`class`,`basic label-container`).attr(`style`,_(p))}else f=o.insert(`circle`,`:first-child`).attr(`class`,`basic label-container`).attr(`style`,a).attr(`r`,d).attr(`cx`,0).attr(`cy`,0);return K(n,f),n.calcIntersect=function(e,t){let n=e.width/2;return X.circle(e,n,t)},n.intersect=function(e){return t.info(`Circle intersect`,n,d,e),X.circle(n,d,e)},o}e(It,`circle`);async function Lt(e,t){let n=t,{shapeSvg:r,bbox:i,halfPadding:a}=await G(e,n,[`node`,n.cssClasses,n.class].filter(Boolean).join(` `)),o=r.insert(`rect`,`:first-child`),s=n.padding??0,c=n.positioned?n.width??0:i.width+s,l=n.positioned?n.height??0:i.height+s,u=n.positioned?-c/2:-i.width/2-a,d=n.positioned?-l/2:-i.height/2-a;return o.attr(`class`,`basic cluster composite label-container`).attr(`style`,n.style??null).attr(`rx`,n.rx??null).attr(`ry`,n.ry??null).attr(`x`,u).attr(`y`,d).attr(`width`,c).attr(`height`,l),K(n,o),n.intersect=function(e){return X.rect(n,e)},r}e(Lt,`composite`);async function Rt(e,t,{config:{themeVariables:n}}){let{labelStyles:r,nodeStyles:i}=E(t);t.labelStyle=r;let{shapeSvg:a,bbox:o,label:s}=await G(e,t,q(t)),c=n?.nodeBorder??n?.lineColor??`currentColor`,l=t.padding??12,u=Math.max(o.width+l*2,t.width??0,90),d=Math.max(o.height+l*2+20,t.height??0),f=-d/2,{cssStyles:p}=t,m=a.insert(`g`,`:first-child`).attr(`class`,`basic label-container`);if(t.look===`handDrawn`){let e=W.svg(a).path(Z(-u/2,f,u,d,12),D(t,{}));m.node()?.appendChild(e),p&&m.attr(`style`,p)}else m.append(`rect`).attr(`x`,-u/2).attr(`y`,f).attr(`width`,u).attr(`height`,d).attr(`rx`,12).attr(`ry`,12).attr(`style`,i);m.append(`text`).attr(`x`,-u/2+12).attr(`y`,f+16).attr(`class`,`console-glyph`).attr(`style`,`font-family:monospace;font-weight:bold;font-size:14px;fill:${c}`).text(`>_`),K(t,m);let h=f+20+(d-20)/2;return s.attr(`transform`,`translate(${-(o.width/2)-(o.x-(o.left??0))}, ${h-o.height/2-(o.y-(o.top??0))})`),t.intersect=function(e){return X.rect(t,e)},a}e(Rt,`consoleWindow`);function zt(e){let t=Math.cos(Math.PI/4),n=Math.sin(Math.PI/4),r=e*2,i={x:r/2*t,y:r/2*n},a={x:-(r/2)*t,y:r/2*n},o={x:-(r/2)*t,y:-(r/2)*n},s={x:r/2*t,y:-(r/2)*n};return`M ${a.x},${a.y} L ${s.x},${s.y}
|
|
1
|
+
import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as t,p as n}from"./src-BnEL7pZw.js";import{O as r,R as i,b as a,f as o,g as s,j as c,w as l,y as u,z as d}from"./chunk-DSNLSHJZ-CHEA9kYd.js";import{a as f,n as p,o as m,r as h}from"./chunk-AQDTSKZB-OkzYqFsw.js";import{f as g,l as _,r as v,t as y}from"./chunk-7S6XSTFO-WIrWcDbG.js";import{s as b}from"./chunk-J5ZVWO5B-oDCd-gWO.js";var x=e(e=>{let{handDrawnSeed:t}=a();return{fill:e,hachureAngle:120,hachureGap:1.5,fillWeight:1.5,roughness:.7,stroke:e,seed:t}},`solidStateFill`),S=e(e=>Array.isArray(e)?e:e?e.split(`;`).map(e=>e.trim()).filter(Boolean):[],`normalizeStyleList`),C=e(e=>{let t=w([...e.cssCompiledStyles||[],...e.cssStyles||[],...S(e.labelStyle)]);return{stylesMap:t,stylesArray:[...t]}},`compileStyles`),w=e(e=>{let t=new Map;return e.forEach(e=>{let[n,r]=e.split(`:`);t.set(n.trim(),r?.trim())}),t},`styles2Map`),T=e(e=>e===`color`||e===`font-size`||e===`font-family`||e===`font-weight`||e===`font-style`||e===`text-decoration`||e===`text-align`||e===`text-transform`||e===`line-height`||e===`letter-spacing`||e===`word-spacing`||e===`text-shadow`||e===`text-overflow`||e===`white-space`||e===`word-wrap`||e===`word-break`||e===`overflow-wrap`||e===`hyphens`,`isLabelStyle`),E=e(e=>{let{stylesArray:t}=C(e),n=[],r=[],i=[],a=[];return t.forEach(e=>{let t=e[0];T(t)?n.push(e.join(`:`)+` !important`):(r.push(e.join(`:`)+` !important`),t.includes(`stroke`)&&i.push(e.join(`:`)+` !important`),t===`fill`&&a.push(e.join(`:`)+` !important`))}),{labelStyles:n.join(`;`),nodeStyles:r.join(`;`),stylesArray:t,borderStyles:i,backgroundStyles:a}},`styles2String`),D=e((e,t)=>{let{themeVariables:n,handDrawnSeed:r}=a(),{nodeBorder:i,mainBkg:o}=n,{stylesMap:s}=C(e);return Object.assign({roughness:.7,fill:s.get(`fill`)||o,fillStyle:`hachure`,fillWeight:1.5,hachureGap:1.5,stroke:s.get(`stroke`)||i,seed:r,strokeWidth:s.get(`stroke-width`)?.replace(`px`,``)||1.3,fillLineDash:[0,0],strokeLineDash:O(s.get(`stroke-dasharray`))},t)},`userNodeOverrides`),O=e(e=>{if(!e)return[0,0];let t=e.trim().split(/\s+/).map(Number);if(t.length===1){let e=isNaN(t[0])?0:t[0];return[e,e]}return[isNaN(t[0])?0:t[0],isNaN(t[1])?0:t[1]]},`getStrokeDashArray`);function k(e,t,n){if(e&&e.length){let[r,i]=t,a=Math.PI/180*n,o=Math.cos(a),s=Math.sin(a);for(let t of e){let[e,n]=t;t[0]=(e-r)*o-(n-i)*s+r,t[1]=(e-r)*s+(n-i)*o+i}}}function A(e,t){return e[0]===t[0]&&e[1]===t[1]}function j(e,t,n,r=1){let i=n,a=Math.max(t,.1),o=e[0]&&e[0][0]&&typeof e[0][0]==`number`?[e]:e,s=[0,0];if(i)for(let e of o)k(e,s,i);let c=function(e,t,n){let r=[];for(let t of e){let e=[...t];A(e[0],e[e.length-1])||e.push([e[0][0],e[0][1]]),e.length>2&&r.push(e)}let i=[];t=Math.max(t,.1);let a=[];for(let e of r)for(let t=0;t<e.length-1;t++){let n=e[t],r=e[t+1];if(n[1]!==r[1]){let e=Math.min(n[1],r[1]);a.push({ymin:e,ymax:Math.max(n[1],r[1]),x:e===n[1]?n[0]:r[0],islope:(r[0]-n[0])/(r[1]-n[1])})}}if(a.sort(((e,t)=>e.ymin<t.ymin?-1:e.ymin>t.ymin?1:e.x<t.x?-1:e.x>t.x?1:e.ymax===t.ymax?0:(e.ymax-t.ymax)/Math.abs(e.ymax-t.ymax))),!a.length)return i;let o=[],s=a[0].ymin,c=0;for(;o.length||a.length;){if(a.length){let e=-1;for(let t=0;t<a.length&&!(a[t].ymin>s);t++)e=t;a.splice(0,e+1).forEach((e=>{o.push({s,edge:e})}))}if(o=o.filter((e=>!(e.edge.ymax<=s))),o.sort(((e,t)=>e.edge.x===t.edge.x?0:(e.edge.x-t.edge.x)/Math.abs(e.edge.x-t.edge.x))),(n!==1||c%t==0)&&o.length>1)for(let e=0;e<o.length;e+=2){let t=e+1;if(t>=o.length)break;let n=o[e].edge,r=o[t].edge;i.push([[Math.round(n.x),s],[Math.round(r.x),s]])}s+=n,o.forEach((e=>{e.edge.x=e.edge.x+n*e.edge.islope})),c++}return i}(o,a,r);if(i){for(let e of o)k(e,s,-i);(function(e,t,n){let r=[];e.forEach((e=>r.push(...e))),k(r,t,n)})(c,s,-i)}return c}function M(e,t){let n=t.hachureAngle+90,r=t.hachureGap;r<0&&(r=4*t.strokeWidth),r=Math.round(Math.max(r,.1));let i=1;return t.roughness>=1&&(t.randomizer?.next()||Math.random())>.7&&(i=r),j(e,r,n,i||1)}var N=class{constructor(e){this.helper=e}fillPolygons(e,t){return this._fillPolygons(e,t)}_fillPolygons(e,t){let n=M(e,t);return{type:`fillSketch`,ops:this.renderLines(n,t)}}renderLines(e,t){let n=[];for(let r of e)n.push(...this.helper.doubleLineOps(r[0][0],r[0][1],r[1][0],r[1][1],t));return n}};function P(e){let t=e[0],n=e[1];return Math.sqrt((t[0]-n[0])**2+(t[1]-n[1])**2)}var ee=class extends N{fillPolygons(e,t){let n=t.hachureGap;n<0&&(n=4*t.strokeWidth),n=Math.max(n,.1);let r=M(e,Object.assign({},t,{hachureGap:n})),i=Math.PI/180*t.hachureAngle,a=[],o=.5*n*Math.cos(i),s=.5*n*Math.sin(i);for(let[e,t]of r)P([e,t])&&a.push([[e[0]-o,e[1]+s],[...t]],[[e[0]+o,e[1]-s],[...t]]);return{type:`fillSketch`,ops:this.renderLines(a,t)}}},F=class extends N{fillPolygons(e,t){let n=this._fillPolygons(e,t),r=Object.assign({},t,{hachureAngle:t.hachureAngle+90}),i=this._fillPolygons(e,r);return n.ops=n.ops.concat(i.ops),n}},I=class{constructor(e){this.helper=e}fillPolygons(e,t){let n=M(e,t=Object.assign({},t,{hachureAngle:0}));return this.dotsOnLines(n,t)}dotsOnLines(e,t){let n=[],r=t.hachureGap;r<0&&(r=4*t.strokeWidth),r=Math.max(r,.1);let i=t.fillWeight;i<0&&(i=t.strokeWidth/2);let a=r/4;for(let o of e){let e=P(o),s=e/r,c=Math.ceil(s)-1,l=e-c*r,u=(o[0][0]+o[1][0])/2-r/4,d=Math.min(o[0][1],o[1][1]);for(let e=0;e<c;e++){let o=d+l+e*r,s=u-a+2*Math.random()*a,c=o-a+2*Math.random()*a,f=this.helper.ellipse(s,c,i,i,t);n.push(...f.ops)}}return{type:`fillSketch`,ops:n}}},te=class{constructor(e){this.helper=e}fillPolygons(e,t){let n=M(e,t);return{type:`fillSketch`,ops:this.dashedLine(n,t)}}dashedLine(e,t){let n=t.dashOffset<0?t.hachureGap<0?4*t.strokeWidth:t.hachureGap:t.dashOffset,r=t.dashGap<0?t.hachureGap<0?4*t.strokeWidth:t.hachureGap:t.dashGap,i=[];return e.forEach((e=>{let a=P(e),o=Math.floor(a/(n+r)),s=(a+r-o*(n+r))/2,c=e[0],l=e[1];c[0]>l[0]&&(c=e[1],l=e[0]);let u=Math.atan((l[1]-c[1])/(l[0]-c[0]));for(let e=0;e<o;e++){let a=e*(n+r),o=a+n,l=[c[0]+a*Math.cos(u)+s*Math.cos(u),c[1]+a*Math.sin(u)+s*Math.sin(u)],d=[c[0]+o*Math.cos(u)+s*Math.cos(u),c[1]+o*Math.sin(u)+s*Math.sin(u)];i.push(...this.helper.doubleLineOps(l[0],l[1],d[0],d[1],t))}})),i}},ne=class{constructor(e){this.helper=e}fillPolygons(e,t){let n=t.hachureGap<0?4*t.strokeWidth:t.hachureGap,r=t.zigzagOffset<0?n:t.zigzagOffset,i=M(e,t=Object.assign({},t,{hachureGap:n+r}));return{type:`fillSketch`,ops:this.zigzagLines(i,r,t)}}zigzagLines(e,t,n){let r=[];return e.forEach((e=>{let i=P(e),a=Math.round(i/(2*t)),o=e[0],s=e[1];o[0]>s[0]&&(o=e[1],s=e[0]);let c=Math.atan((s[1]-o[1])/(s[0]-o[0]));for(let e=0;e<a;e++){let i=2*e*t,a=2*(e+1)*t,s=Math.sqrt(2*t**2),l=[o[0]+i*Math.cos(c),o[1]+i*Math.sin(c)],u=[o[0]+a*Math.cos(c),o[1]+a*Math.sin(c)],d=[l[0]+s*Math.cos(c+Math.PI/4),l[1]+s*Math.sin(c+Math.PI/4)];r.push(...this.helper.doubleLineOps(l[0],l[1],d[0],d[1],n),...this.helper.doubleLineOps(d[0],d[1],u[0],u[1],n))}})),r}},L={},R=class{constructor(e){this.seed=e}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}},z=0,re=1,ie=2,ae={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0};function B(e,t){return e.type===t}function V(e){let t=[],n=function(e){let t=[];for(;e!==``;)if(e.match(/^([ \t\r\n,]+)/))e=e.substr(RegExp.$1.length);else if(e.match(/^([aAcChHlLmMqQsStTvVzZ])/))t[t.length]={type:z,text:RegExp.$1},e=e.substr(RegExp.$1.length);else{if(!e.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];t[t.length]={type:re,text:`${parseFloat(RegExp.$1)}`},e=e.substr(RegExp.$1.length)}return t[t.length]={type:ie,text:``},t}(e),r=`BOD`,i=0,a=n[i];for(;!B(a,ie);){let o=0,s=[];if(r===`BOD`){if(a.text!==`M`&&a.text!==`m`)return V(`M0,0`+e);i++,o=ae[a.text],r=a.text}else B(a,re)?o=ae[r]:(i++,o=ae[a.text],r=a.text);if(!(i+o<n.length))throw Error(`Path data ended short`);for(let e=i;e<i+o;e++){let t=n[e];if(!B(t,re))throw Error(`Param not a number: `+r+`,`+t.text);s[s.length]=+t.text}if(typeof ae[r]!=`number`)throw Error(`Bad segment: `+r);{let e={key:r,data:s};t.push(e),i+=o,a=n[i],r===`M`&&(r=`L`),r===`m`&&(r=`l`)}}return t}function oe(e){let t=0,n=0,r=0,i=0,a=[];for(let{key:o,data:s}of e)switch(o){case`M`:a.push({key:`M`,data:[...s]}),[t,n]=s,[r,i]=s;break;case`m`:t+=s[0],n+=s[1],a.push({key:`M`,data:[t,n]}),r=t,i=n;break;case`L`:a.push({key:`L`,data:[...s]}),[t,n]=s;break;case`l`:t+=s[0],n+=s[1],a.push({key:`L`,data:[t,n]});break;case`C`:a.push({key:`C`,data:[...s]}),t=s[4],n=s[5];break;case`c`:{let e=s.map(((e,r)=>r%2?e+n:e+t));a.push({key:`C`,data:e}),t=e[4],n=e[5];break}case`Q`:a.push({key:`Q`,data:[...s]}),t=s[2],n=s[3];break;case`q`:{let e=s.map(((e,r)=>r%2?e+n:e+t));a.push({key:`Q`,data:e}),t=e[2],n=e[3];break}case`A`:a.push({key:`A`,data:[...s]}),t=s[5],n=s[6];break;case`a`:t+=s[5],n+=s[6],a.push({key:`A`,data:[s[0],s[1],s[2],s[3],s[4],t,n]});break;case`H`:a.push({key:`H`,data:[...s]}),t=s[0];break;case`h`:t+=s[0],a.push({key:`H`,data:[t]});break;case`V`:a.push({key:`V`,data:[...s]}),n=s[0];break;case`v`:n+=s[0],a.push({key:`V`,data:[n]});break;case`S`:a.push({key:`S`,data:[...s]}),t=s[2],n=s[3];break;case`s`:{let e=s.map(((e,r)=>r%2?e+n:e+t));a.push({key:`S`,data:e}),t=e[2],n=e[3];break}case`T`:a.push({key:`T`,data:[...s]}),t=s[0],n=s[1];break;case`t`:t+=s[0],n+=s[1],a.push({key:`T`,data:[t,n]});break;case`Z`:case`z`:a.push({key:`Z`,data:[]}),t=r,n=i}return a}function se(e){let t=[],n=``,r=0,i=0,a=0,o=0,s=0,c=0;for(let{key:l,data:u}of e){switch(l){case`M`:t.push({key:`M`,data:[...u]}),[r,i]=u,[a,o]=u;break;case`C`:t.push({key:`C`,data:[...u]}),r=u[4],i=u[5],s=u[2],c=u[3];break;case`L`:t.push({key:`L`,data:[...u]}),[r,i]=u;break;case`H`:r=u[0],t.push({key:`L`,data:[r,i]});break;case`V`:i=u[0],t.push({key:`L`,data:[r,i]});break;case`S`:{let e=0,a=0;n===`C`||n===`S`?(e=r+(r-s),a=i+(i-c)):(e=r,a=i),t.push({key:`C`,data:[e,a,...u]}),s=u[0],c=u[1],r=u[2],i=u[3];break}case`T`:{let[e,a]=u,o=0,l=0;n===`Q`||n===`T`?(o=r+(r-s),l=i+(i-c)):(o=r,l=i);let d=r+2*(o-r)/3,f=i+2*(l-i)/3,p=e+2*(o-e)/3,m=a+2*(l-a)/3;t.push({key:`C`,data:[d,f,p,m,e,a]}),s=o,c=l,r=e,i=a;break}case`Q`:{let[e,n,a,o]=u,l=r+2*(e-r)/3,d=i+2*(n-i)/3,f=a+2*(e-a)/3,p=o+2*(n-o)/3;t.push({key:`C`,data:[l,d,f,p,a,o]}),s=e,c=n,r=a,i=o;break}case`A`:{let e=Math.abs(u[0]),n=Math.abs(u[1]),a=u[2],o=u[3],s=u[4],c=u[5],l=u[6];e===0||n===0?(t.push({key:`C`,data:[r,i,c,l,c,l]}),r=c,i=l):(r!==c||i!==l)&&(le(r,i,c,l,e,n,a,o,s).forEach((function(e){t.push({key:`C`,data:e})})),r=c,i=l);break}case`Z`:t.push({key:`Z`,data:[]}),r=a,i=o}n=l}return t}function ce(e,t,n){return[e*Math.cos(n)-t*Math.sin(n),e*Math.sin(n)+t*Math.cos(n)]}function le(e,t,n,r,i,a,o,s,c,l){let u=(d=o,Math.PI*d/180);var d;let f=[],p=0,m=0,h=0,g=0;if(l)[p,m,h,g]=l;else{[e,t]=ce(e,t,-u),[n,r]=ce(n,r,-u);let o=(e-n)/2,l=(t-r)/2,d=o*o/(i*i)+l*l/(a*a);d>1&&(d=Math.sqrt(d),i*=d,a*=d);let f=i*i,_=a*a,v=f*_-f*l*l-_*o*o,y=f*l*l+_*o*o,b=(s===c?-1:1)*Math.sqrt(Math.abs(v/y));h=b*i*l/a+(e+n)/2,g=b*-a*o/i+(t+r)/2,p=Math.asin(parseFloat(((t-g)/a).toFixed(9))),m=Math.asin(parseFloat(((r-g)/a).toFixed(9))),e<h&&(p=Math.PI-p),n<h&&(m=Math.PI-m),p<0&&(p=2*Math.PI+p),m<0&&(m=2*Math.PI+m),c&&p>m&&(p-=2*Math.PI),!c&&m>p&&(m-=2*Math.PI)}let _=m-p;if(Math.abs(_)>120*Math.PI/180){let e=m,t=n,s=r;m=c&&m>p?p+120*Math.PI/180*1:p+120*Math.PI/180*-1,f=le(n=h+i*Math.cos(m),r=g+a*Math.sin(m),t,s,i,a,o,0,c,[m,e,h,g])}_=m-p;let v=Math.cos(p),y=Math.sin(p),b=Math.cos(m),x=Math.sin(m),S=Math.tan(_/4),C=4/3*i*S,w=4/3*a*S,T=[e,t],E=[e+C*y,t-w*v],D=[n+C*x,r-w*b],O=[n,r];if(E[0]=2*T[0]-E[0],E[1]=2*T[1]-E[1],l)return[E,D,O].concat(f);{f=[E,D,O].concat(f);let e=[];for(let t=0;t<f.length;t+=3){let n=ce(f[t][0],f[t][1],u),r=ce(f[t+1][0],f[t+1][1],u),i=ce(f[t+2][0],f[t+2][1],u);e.push([n[0],n[1],r[0],r[1],i[0],i[1]])}return e}}var ue={randOffset:function(e,t){return H(e,t)},randOffsetWithRange:function(e,t,n){return Ce(e,t,n)},ellipse:function(e,t,n,r,i){return ge(e,t,i,he(n,r,i)).opset},doubleLineOps:function(e,t,n,r,i){return we(e,t,n,r,i,!0)}};function de(e,t,n,r,i){return{type:`path`,ops:we(e,t,n,r,i)}}function fe(e,t,n){let r=(e||[]).length;if(r>2){let i=[];for(let t=0;t<r-1;t++)i.push(...we(e[t][0],e[t][1],e[t+1][0],e[t+1][1],n));return t&&i.push(...we(e[r-1][0],e[r-1][1],e[0][0],e[0][1],n)),{type:`path`,ops:i}}return r===2?de(e[0][0],e[0][1],e[1][0],e[1][1],n):{type:`path`,ops:[]}}function pe(e,t,n,r,i){return function(e,t){return fe(e,!0,t)}([[e,t],[e+n,t],[e+n,t+r],[e,t+r]],i)}function me(e,t){if(e.length){let n=typeof e[0][0]==`number`?[e]:e,r=Ee(n[0],1*(1+.2*t.roughness),t),i=t.disableMultiStroke?[]:Ee(n[0],1.5*(1+.22*t.roughness),xe(t));for(let e=1;e<n.length;e++){let a=n[e];if(a.length){let e=Ee(a,1*(1+.2*t.roughness),t),n=t.disableMultiStroke?[]:Ee(a,1.5*(1+.22*t.roughness),xe(t));for(let t of e)t.op!==`move`&&r.push(t);for(let e of n)e.op!==`move`&&i.push(e)}}return{type:`path`,ops:r.concat(i)}}return{type:`path`,ops:[]}}function he(e,t,n){let r=Math.sqrt(2*Math.PI*Math.sqrt(((e/2)**2+(t/2)**2)/2)),i=Math.ceil(Math.max(n.curveStepCount,n.curveStepCount/Math.sqrt(200)*r)),a=2*Math.PI/i,o=Math.abs(e/2),s=Math.abs(t/2),c=1-n.curveFitting;return o+=H(o*c,n),s+=H(s*c,n),{increment:a,rx:o,ry:s}}function ge(e,t,n,r){let[i,a]=Oe(r.increment,e,t,r.rx,r.ry,1,r.increment*Ce(.1,Ce(.4,1,n),n),n),o=De(i,null,n);if(!n.disableMultiStroke&&n.roughness!==0){let[i]=Oe(r.increment,e,t,r.rx,r.ry,1.5,0,n),a=De(i,null,n);o=o.concat(a)}return{estimatedPoints:a,opset:{type:`path`,ops:o}}}function _e(e,t,n,r,i,a,o,s,c){let l=e,u=t,d=Math.abs(n/2),f=Math.abs(r/2);d+=H(.01*d,c),f+=H(.01*f,c);let p=i,m=a;for(;p<0;)p+=2*Math.PI,m+=2*Math.PI;m-p>2*Math.PI&&(p=0,m=2*Math.PI);let h=2*Math.PI/c.curveStepCount,g=Math.min(h/2,(m-p)/2),_=ke(g,l,u,d,f,p,m,1,c);if(!c.disableMultiStroke){let e=ke(g,l,u,d,f,p,m,1.5,c);_.push(...e)}return o&&(s?_.push(...we(l,u,l+d*Math.cos(p),u+f*Math.sin(p),c),...we(l,u,l+d*Math.cos(m),u+f*Math.sin(m),c)):_.push({op:`lineTo`,data:[l,u]},{op:`lineTo`,data:[l+d*Math.cos(p),u+f*Math.sin(p)]})),{type:`path`,ops:_}}function ve(e,t){let n=se(oe(V(e))),r=[],i=[0,0],a=[0,0];for(let{key:e,data:o}of n)switch(e){case`M`:a=[o[0],o[1]],i=[o[0],o[1]];break;case`L`:r.push(...we(a[0],a[1],o[0],o[1],t)),a=[o[0],o[1]];break;case`C`:{let[e,n,i,s,c,l]=o;r.push(...Ae(e,n,i,s,c,l,a,t)),a=[c,l];break}case`Z`:r.push(...we(a[0],a[1],i[0],i[1],t)),a=[i[0],i[1]]}return{type:`path`,ops:r}}function ye(e,t){let n=[];for(let r of e)if(r.length){let e=t.maxRandomnessOffset||0,i=r.length;if(i>2){n.push({op:`move`,data:[r[0][0]+H(e,t),r[0][1]+H(e,t)]});for(let a=1;a<i;a++)n.push({op:`lineTo`,data:[r[a][0]+H(e,t),r[a][1]+H(e,t)]})}}return{type:`fillPath`,ops:n}}function be(e,t){return function(e,t){let n=e.fillStyle||`hachure`;if(!L[n])switch(n){case`zigzag`:L[n]||(L[n]=new ee(t));break;case`cross-hatch`:L[n]||(L[n]=new F(t));break;case`dots`:L[n]||(L[n]=new I(t));break;case`dashed`:L[n]||(L[n]=new te(t));break;case`zigzag-line`:L[n]||(L[n]=new ne(t));break;default:n=`hachure`,L[n]||(L[n]=new N(t))}return L[n]}(t,ue).fillPolygons(e,t)}function xe(e){let t=Object.assign({},e);return t.randomizer=void 0,e.seed&&(t.seed=e.seed+1),t}function Se(e){return e.randomizer||=new R(e.seed||0),e.randomizer.next()}function Ce(e,t,n,r=1){return n.roughness*r*(Se(n)*(t-e)+e)}function H(e,t,n=1){return Ce(-e,e,t,n)}function we(e,t,n,r,i,a=!1){let o=a?i.disableMultiStrokeFill:i.disableMultiStroke,s=Te(e,t,n,r,i,!0,!1);if(o)return s;let c=Te(e,t,n,r,i,!0,!0);return s.concat(c)}function Te(e,t,n,r,i,a,o){let s=(e-n)**2+(t-r)**2,c=Math.sqrt(s),l=1;l=c<200?1:c>500?.4:-.0016668*c+1.233334;let u=i.maxRandomnessOffset||0;u*u*100>s&&(u=c/10);let d=u/2,f=.2+.2*Se(i),p=i.bowing*i.maxRandomnessOffset*(r-t)/200,m=i.bowing*i.maxRandomnessOffset*(e-n)/200;p=H(p,i,l),m=H(m,i,l);let h=[],g=()=>H(d,i,l),_=()=>H(u,i,l),v=i.preserveVertices;return a&&(o?h.push({op:`move`,data:[e+(v?0:g()),t+(v?0:g())]}):h.push({op:`move`,data:[e+(v?0:H(u,i,l)),t+(v?0:H(u,i,l))]})),o?h.push({op:`bcurveTo`,data:[p+e+(n-e)*f+g(),m+t+(r-t)*f+g(),p+e+2*(n-e)*f+g(),m+t+2*(r-t)*f+g(),n+(v?0:g()),r+(v?0:g())]}):h.push({op:`bcurveTo`,data:[p+e+(n-e)*f+_(),m+t+(r-t)*f+_(),p+e+2*(n-e)*f+_(),m+t+2*(r-t)*f+_(),n+(v?0:_()),r+(v?0:_())]}),h}function Ee(e,t,n){if(!e.length)return[];let r=[];r.push([e[0][0]+H(t,n),e[0][1]+H(t,n)]),r.push([e[0][0]+H(t,n),e[0][1]+H(t,n)]);for(let i=1;i<e.length;i++)r.push([e[i][0]+H(t,n),e[i][1]+H(t,n)]),i===e.length-1&&r.push([e[i][0]+H(t,n),e[i][1]+H(t,n)]);return De(r,null,n)}function De(e,t,n){let r=e.length,i=[];if(r>3){let a=[],o=1-n.curveTightness;i.push({op:`move`,data:[e[1][0],e[1][1]]});for(let t=1;t+2<r;t++){let n=e[t];a[0]=[n[0],n[1]],a[1]=[n[0]+(o*e[t+1][0]-o*e[t-1][0])/6,n[1]+(o*e[t+1][1]-o*e[t-1][1])/6],a[2]=[e[t+1][0]+(o*e[t][0]-o*e[t+2][0])/6,e[t+1][1]+(o*e[t][1]-o*e[t+2][1])/6],a[3]=[e[t+1][0],e[t+1][1]],i.push({op:`bcurveTo`,data:[a[1][0],a[1][1],a[2][0],a[2][1],a[3][0],a[3][1]]})}if(t&&t.length===2){let e=n.maxRandomnessOffset;i.push({op:`lineTo`,data:[t[0]+H(e,n),t[1]+H(e,n)]})}}else r===3?(i.push({op:`move`,data:[e[1][0],e[1][1]]}),i.push({op:`bcurveTo`,data:[e[1][0],e[1][1],e[2][0],e[2][1],e[2][0],e[2][1]]})):r===2&&i.push(...Te(e[0][0],e[0][1],e[1][0],e[1][1],n,!0,!0));return i}function Oe(e,t,n,r,i,a,o,s){let c=[],l=[];if(s.roughness===0){e/=4,l.push([t+r*Math.cos(-e),n+i*Math.sin(-e)]);for(let a=0;a<=2*Math.PI;a+=e){let e=[t+r*Math.cos(a),n+i*Math.sin(a)];c.push(e),l.push(e)}l.push([t+r*Math.cos(0),n+i*Math.sin(0)]),l.push([t+r*Math.cos(e),n+i*Math.sin(e)])}else{let u=H(.5,s)-Math.PI/2;l.push([H(a,s)+t+.9*r*Math.cos(u-e),H(a,s)+n+.9*i*Math.sin(u-e)]);let d=2*Math.PI+u-.01;for(let o=u;o<d;o+=e){let e=[H(a,s)+t+r*Math.cos(o),H(a,s)+n+i*Math.sin(o)];c.push(e),l.push(e)}l.push([H(a,s)+t+r*Math.cos(u+2*Math.PI+.5*o),H(a,s)+n+i*Math.sin(u+2*Math.PI+.5*o)]),l.push([H(a,s)+t+.98*r*Math.cos(u+o),H(a,s)+n+.98*i*Math.sin(u+o)]),l.push([H(a,s)+t+.9*r*Math.cos(u+.5*o),H(a,s)+n+.9*i*Math.sin(u+.5*o)])}return[l,c]}function ke(e,t,n,r,i,a,o,s,c){let l=a+H(.1,c),u=[];u.push([H(s,c)+t+.9*r*Math.cos(l-e),H(s,c)+n+.9*i*Math.sin(l-e)]);for(let a=l;a<=o;a+=e)u.push([H(s,c)+t+r*Math.cos(a),H(s,c)+n+i*Math.sin(a)]);return u.push([t+r*Math.cos(o),n+i*Math.sin(o)]),u.push([t+r*Math.cos(o),n+i*Math.sin(o)]),De(u,null,c)}function Ae(e,t,n,r,i,a,o,s){let c=[],l=[s.maxRandomnessOffset||1,(s.maxRandomnessOffset||1)+.3],u=[0,0],d=s.disableMultiStroke?1:2,f=s.preserveVertices;for(let p=0;p<d;p++)p===0?c.push({op:`move`,data:[o[0],o[1]]}):c.push({op:`move`,data:[o[0]+(f?0:H(l[0],s)),o[1]+(f?0:H(l[0],s))]}),u=f?[i,a]:[i+H(l[p],s),a+H(l[p],s)],c.push({op:`bcurveTo`,data:[e+H(l[p],s),t+H(l[p],s),n+H(l[p],s),r+H(l[p],s),u[0],u[1]]});return c}function je(e){return[...e]}function Me(e,t=0){let n=e.length;if(n<3)throw Error(`A curve must have at least three points.`);let r=[];if(n===3)r.push(je(e[0]),je(e[1]),je(e[2]),je(e[2]));else{let n=[];n.push(e[0],e[0]);for(let t=1;t<e.length;t++)n.push(e[t]),t===e.length-1&&n.push(e[t]);let i=[],a=1-t;r.push(je(n[0]));for(let e=1;e+2<n.length;e++){let t=n[e];i[0]=[t[0],t[1]],i[1]=[t[0]+(a*n[e+1][0]-a*n[e-1][0])/6,t[1]+(a*n[e+1][1]-a*n[e-1][1])/6],i[2]=[n[e+1][0]+(a*n[e][0]-a*n[e+2][0])/6,n[e+1][1]+(a*n[e][1]-a*n[e+2][1])/6],i[3]=[n[e+1][0],n[e+1][1]],r.push(i[1],i[2],i[3])}}return r}function Ne(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2}function Pe(e,t,n){let r=Ne(t,n);if(r===0)return Ne(e,t);let i=((e[0]-t[0])*(n[0]-t[0])+(e[1]-t[1])*(n[1]-t[1]))/r;return i=Math.max(0,Math.min(1,i)),Ne(e,Fe(t,n,i))}function Fe(e,t,n){return[e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n]}function Ie(e,t,n,r){let i=r||[];if(function(e,t){let n=e[t+0],r=e[t+1],i=e[t+2],a=e[t+3],o=3*r[0]-2*n[0]-a[0];o*=o;let s=3*r[1]-2*n[1]-a[1];s*=s;let c=3*i[0]-2*a[0]-n[0];c*=c;let l=3*i[1]-2*a[1]-n[1];return l*=l,o<c&&(o=c),s<l&&(s=l),o+s}(e,t)<n){let n=e[t+0];i.length?(a=i[i.length-1],o=n,Math.sqrt(Ne(a,o))>1&&i.push(n)):i.push(n),i.push(e[t+3])}else{let r=.5,a=e[t+0],o=e[t+1],s=e[t+2],c=e[t+3],l=Fe(a,o,r),u=Fe(o,s,r),d=Fe(s,c,r),f=Fe(l,u,r),p=Fe(u,d,r),m=Fe(f,p,r);Ie([a,l,f,m],0,n,i),Ie([m,p,d,c],0,n,i)}var a,o;return i}function Le(e,t){return Re(e,0,e.length,t)}function Re(e,t,n,r,i){let a=i||[],o=e[t],s=e[n-1],c=0,l=1;for(let r=t+1;r<n-1;++r){let t=Pe(e[r],o,s);t>c&&(c=t,l=r)}return Math.sqrt(c)>r?(Re(e,t,l+1,r,a),Re(e,l,n,r,a)):(a.length||a.push(o),a.push(s)),a}function ze(e,t=.15,n){let r=[],i=(e.length-1)/3;for(let n=0;n<i;n++)Ie(e,3*n,t,r);return n&&n>0?Re(r,0,r.length,n):r}var U=`none`,Be=class{constructor(e){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:`#000`,strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:`hachure`,fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=e||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(e){return e?Object.assign({},this.defaultOptions,e):this.defaultOptions}_d(e,t,n){return{shape:e,sets:t||[],options:n||this.defaultOptions}}line(e,t,n,r,i){let a=this._o(i);return this._d(`line`,[de(e,t,n,r,a)],a)}rectangle(e,t,n,r,i){let a=this._o(i),o=[],s=pe(e,t,n,r,a);if(a.fill){let i=[[e,t],[e+n,t],[e+n,t+r],[e,t+r]];a.fillStyle===`solid`?o.push(ye([i],a)):o.push(be([i],a))}return a.stroke!==U&&o.push(s),this._d(`rectangle`,o,a)}ellipse(e,t,n,r,i){let a=this._o(i),o=[],s=he(n,r,a),c=ge(e,t,a,s);if(a.fill){if(a.fillStyle===`solid`){let n=ge(e,t,a,s).opset;n.type=`fillPath`,o.push(n)}else o.push(be([c.estimatedPoints],a))}return a.stroke!==U&&o.push(c.opset),this._d(`ellipse`,o,a)}circle(e,t,n,r){let i=this.ellipse(e,t,n,n,r);return i.shape=`circle`,i}linearPath(e,t){let n=this._o(t);return this._d(`linearPath`,[fe(e,!1,n)],n)}arc(e,t,n,r,i,a,o=!1,s){let c=this._o(s),l=[],u=_e(e,t,n,r,i,a,o,!0,c);if(o&&c.fill){if(c.fillStyle===`solid`){let o=Object.assign({},c);o.disableMultiStroke=!0;let s=_e(e,t,n,r,i,a,!0,!1,o);s.type=`fillPath`,l.push(s)}else l.push(function(e,t,n,r,i,a,o){let s=e,c=t,l=Math.abs(n/2),u=Math.abs(r/2);l+=H(.01*l,o),u+=H(.01*u,o);let d=i,f=a;for(;d<0;)d+=2*Math.PI,f+=2*Math.PI;f-d>2*Math.PI&&(d=0,f=2*Math.PI);let p=(f-d)/o.curveStepCount,m=[];for(let e=d;e<=f;e+=p)m.push([s+l*Math.cos(e),c+u*Math.sin(e)]);return m.push([s+l*Math.cos(f),c+u*Math.sin(f)]),m.push([s,c]),be([m],o)}(e,t,n,r,i,a,c))}return c.stroke!==U&&l.push(u),this._d(`arc`,l,c)}curve(e,t){let n=this._o(t),r=[],i=me(e,n);if(n.fill&&n.fill!==U){if(n.fillStyle===`solid`){let t=me(e,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));r.push({type:`fillPath`,ops:this._mergedShape(t.ops)})}else{let t=[],i=e;if(i.length){let e=typeof i[0][0]==`number`?[i]:i;for(let r of e)r.length<3?t.push(...r):r.length===3?t.push(...ze(Me([r[0],r[0],r[1],r[2]]),10,(1+n.roughness)/2)):t.push(...ze(Me(r),10,(1+n.roughness)/2))}t.length&&r.push(be([t],n))}}return n.stroke!==U&&r.push(i),this._d(`curve`,r,n)}polygon(e,t){let n=this._o(t),r=[],i=fe(e,!0,n);return n.fill&&(n.fillStyle===`solid`?r.push(ye([e],n)):r.push(be([e],n))),n.stroke!==U&&r.push(i),this._d(`polygon`,r,n)}path(e,t){let n=this._o(t),r=[];if(!e)return this._d(`path`,r,n);e=(e||``).replace(/\n/g,` `).replace(/(-\s)/g,`-`).replace(`/(ss)/g`,` `);let i=n.fill&&n.fill!==`transparent`&&n.fill!==U,a=n.stroke!==U,o=!!(n.simplification&&n.simplification<1),s=function(e,t,n){let r=se(oe(V(e))),i=[],a=[],o=[0,0],s=[],c=()=>{s.length>=4&&a.push(...ze(s,t)),s=[]},l=()=>{c(),a.length&&(i.push(a),a=[])};for(let{key:e,data:t}of r)switch(e){case`M`:l(),o=[t[0],t[1]],a.push(o);break;case`L`:c(),a.push([t[0],t[1]]);break;case`C`:if(!s.length){let e=a.length?a[a.length-1]:o;s.push([e[0],e[1]])}s.push([t[0],t[1]]),s.push([t[2],t[3]]),s.push([t[4],t[5]]);break;case`Z`:c(),a.push([o[0],o[1]])}if(l(),!n)return i;let u=[];for(let e of i){let t=Le(e,n);t.length&&u.push(t)}return u}(e,1,o?4-4*(n.simplification||1):(1+n.roughness)/2),c=ve(e,n);if(i){if(n.fillStyle===`solid`){if(s.length===1){let t=ve(e,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));r.push({type:`fillPath`,ops:this._mergedShape(t.ops)})}else r.push(ye(s,n))}else r.push(be(s,n))}return a&&(o?s.forEach((e=>{r.push(fe(e,!1,n))})):r.push(c)),this._d(`path`,r,n)}opsToPath(e,t){let n=``;for(let r of e.ops){let e=typeof t==`number`&&t>=0?r.data.map((e=>+e.toFixed(t))):r.data;switch(r.op){case`move`:n+=`M${e[0]} ${e[1]} `;break;case`bcurveTo`:n+=`C${e[0]} ${e[1]}, ${e[2]} ${e[3]}, ${e[4]} ${e[5]} `;break;case`lineTo`:n+=`L${e[0]} ${e[1]} `}}return n.trim()}toPaths(e){let t=e.sets||[],n=e.options||this.defaultOptions,r=[];for(let e of t){let t=null;switch(e.type){case`path`:t={d:this.opsToPath(e),stroke:n.stroke,strokeWidth:n.strokeWidth,fill:U};break;case`fillPath`:t={d:this.opsToPath(e),stroke:U,strokeWidth:0,fill:n.fill||U};break;case`fillSketch`:t=this.fillSketch(e,n)}t&&r.push(t)}return r}fillSketch(e,t){let n=t.fillWeight;return n<0&&(n=t.strokeWidth/2),{d:this.opsToPath(e),stroke:t.fill||U,strokeWidth:n,fill:U}}_mergedShape(e){return e.filter(((e,t)=>t===0||e.op!==`move`))}},Ve=class{constructor(e,t){this.canvas=e,this.ctx=this.canvas.getContext(`2d`),this.gen=new Be(t)}draw(e){let t=e.sets||[],n=e.options||this.getDefaultOptions(),r=this.ctx,i=e.options.fixedDecimalPlaceDigits;for(let a of t)switch(a.type){case`path`:r.save(),r.strokeStyle=n.stroke===`none`?`transparent`:n.stroke,r.lineWidth=n.strokeWidth,n.strokeLineDash&&r.setLineDash(n.strokeLineDash),n.strokeLineDashOffset&&(r.lineDashOffset=n.strokeLineDashOffset),this._drawToContext(r,a,i),r.restore();break;case`fillPath`:{r.save(),r.fillStyle=n.fill||``;let t=e.shape===`curve`||e.shape===`polygon`||e.shape===`path`?`evenodd`:`nonzero`;this._drawToContext(r,a,i,t),r.restore();break}case`fillSketch`:this.fillSketch(r,a,n)}}fillSketch(e,t,n){let r=n.fillWeight;r<0&&(r=n.strokeWidth/2),e.save(),n.fillLineDash&&e.setLineDash(n.fillLineDash),n.fillLineDashOffset&&(e.lineDashOffset=n.fillLineDashOffset),e.strokeStyle=n.fill||``,e.lineWidth=r,this._drawToContext(e,t,n.fixedDecimalPlaceDigits),e.restore()}_drawToContext(e,t,n,r=`nonzero`){e.beginPath();for(let r of t.ops){let t=typeof n==`number`&&n>=0?r.data.map((e=>+e.toFixed(n))):r.data;switch(r.op){case`move`:e.moveTo(t[0],t[1]);break;case`bcurveTo`:e.bezierCurveTo(t[0],t[1],t[2],t[3],t[4],t[5]);break;case`lineTo`:e.lineTo(t[0],t[1])}}t.type===`fillPath`?e.fill(r):e.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(e,t,n,r,i){let a=this.gen.line(e,t,n,r,i);return this.draw(a),a}rectangle(e,t,n,r,i){let a=this.gen.rectangle(e,t,n,r,i);return this.draw(a),a}ellipse(e,t,n,r,i){let a=this.gen.ellipse(e,t,n,r,i);return this.draw(a),a}circle(e,t,n,r){let i=this.gen.circle(e,t,n,r);return this.draw(i),i}linearPath(e,t){let n=this.gen.linearPath(e,t);return this.draw(n),n}polygon(e,t){let n=this.gen.polygon(e,t);return this.draw(n),n}arc(e,t,n,r,i,a,o=!1,s){let c=this.gen.arc(e,t,n,r,i,a,o,s);return this.draw(c),c}curve(e,t){let n=this.gen.curve(e,t);return this.draw(n),n}path(e,t){let n=this.gen.path(e,t);return this.draw(n),n}},He=`http://www.w3.org/2000/svg`,Ue=class{constructor(e,t){this.svg=e,this.gen=new Be(t)}draw(e){let t=e.sets||[],n=e.options||this.getDefaultOptions(),r=this.svg.ownerDocument||window.document,i=r.createElementNS(He,`g`),a=e.options.fixedDecimalPlaceDigits;for(let o of t){let t=null;switch(o.type){case`path`:t=r.createElementNS(He,`path`),t.setAttribute(`d`,this.opsToPath(o,a)),t.setAttribute(`stroke`,n.stroke),t.setAttribute(`stroke-width`,n.strokeWidth+``),t.setAttribute(`fill`,`none`),n.strokeLineDash&&t.setAttribute(`stroke-dasharray`,n.strokeLineDash.join(` `).trim()),n.strokeLineDashOffset&&t.setAttribute(`stroke-dashoffset`,`${n.strokeLineDashOffset}`);break;case`fillPath`:t=r.createElementNS(He,`path`),t.setAttribute(`d`,this.opsToPath(o,a)),t.setAttribute(`stroke`,`none`),t.setAttribute(`stroke-width`,`0`),t.setAttribute(`fill`,n.fill||``),e.shape!==`curve`&&e.shape!==`polygon`||t.setAttribute(`fill-rule`,`evenodd`);break;case`fillSketch`:t=this.fillSketch(r,o,n)}t&&i.appendChild(t)}return i}fillSketch(e,t,n){let r=n.fillWeight;r<0&&(r=n.strokeWidth/2);let i=e.createElementNS(He,`path`);return i.setAttribute(`d`,this.opsToPath(t,n.fixedDecimalPlaceDigits)),i.setAttribute(`stroke`,n.fill||``),i.setAttribute(`stroke-width`,r+``),i.setAttribute(`fill`,`none`),n.fillLineDash&&i.setAttribute(`stroke-dasharray`,n.fillLineDash.join(` `).trim()),n.fillLineDashOffset&&i.setAttribute(`stroke-dashoffset`,`${n.fillLineDashOffset}`),i}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(e,t){return this.gen.opsToPath(e,t)}line(e,t,n,r,i){let a=this.gen.line(e,t,n,r,i);return this.draw(a)}rectangle(e,t,n,r,i){let a=this.gen.rectangle(e,t,n,r,i);return this.draw(a)}ellipse(e,t,n,r,i){let a=this.gen.ellipse(e,t,n,r,i);return this.draw(a)}circle(e,t,n,r){let i=this.gen.circle(e,t,n,r);return this.draw(i)}linearPath(e,t){let n=this.gen.linearPath(e,t);return this.draw(n)}polygon(e,t){let n=this.gen.polygon(e,t);return this.draw(n)}arc(e,t,n,r,i,a,o=!1,s){let c=this.gen.arc(e,t,n,r,i,a,o,s);return this.draw(c)}curve(e,t){let n=this.gen.curve(e,t);return this.draw(n)}path(e,t){let n=this.gen.path(e,t);return this.draw(n)}},W={canvas:(e,t)=>new Ve(e,t),svg:(e,t)=>new Ue(e,t),generator:e=>new Be(e),newSeed:()=>Be.newSeed()},We=1,Ge=3;async function Ke(t){let n=t.getElementsByTagName(`img`);if(!n||n.length===0)return;let r=!qe(t);await Promise.all([...n].map(t=>new Promise(n=>{function i(){if(t.style.display=`flex`,t.style.flexDirection=`column`,r){let e=a().fontSize?a().fontSize:window.getComputedStyle(document.body).fontSize,[n=o.fontSize]=g(e),r=n*5+`px`;t.style.minWidth=r,t.style.maxWidth=r}else t.style.width=`100%`;n(t)}e(i,`setupImage`),setTimeout(()=>{t.complete&&i()}),t.addEventListener(`error`,i),t.addEventListener(`load`,i)})))}e(Ke,`configureLabelImages`);function qe(e){return e.nodeType===Ge?e.textContent?.trim()!==``:e.nodeType!==We||e.tagName.toLowerCase()===`img`?!1:[...e.childNodes].some(qe)}e(qe,`hasTextBesidesImages`);var Je=3,Ye=32,Xe=e(async(e,t,r)=>{let o=a(),s=e.insert(`g`).attr(`class`,r??`node default`).attr(`id`,t.domId||t.id),c=s.insert(`g`).attr(`class`,`label`).attr(`style`,_(t.labelStyle)),l=[{text:typeof t.label==`string`?t.label:t.label?.[0]??``,cssClass:`c4-name`},{text:t.stereotype,cssClass:`c4-type`},...(t.description??[]).map(e=>({text:e,cssClass:`c4-descr`}))].filter(e=>e.text),u=t.width?Math.max(t.width-2*(t.padding??0),Ye):a().flowchart?.wrappingWidth??200,d=o.c4?.wrap??!0?u:1/0,f=await Promise.all(l.map(async e=>{let r=c.append(`g`).attr(`class`,e.cssClass),a=await p(r,i(v(e.text??``),o),{useHtmlLabels:!1,markdown:!1,isNode:!0,width:d,style:t.labelStyle},o);return n(a).selectAll(`tspan.text-outer-tspan`).attr(`text-anchor`,`middle`),n(a).selectAll(`tspan.text-inner-tspan`).attr(`font-weight`,null).attr(`font-style`,null),{el:r,box:r.node().getBBox()}})),m=Math.max(...f.map(({box:e})=>e.width),0),h=0;for(let{el:e,box:t}of f)e.attr(`transform`,`translate(${m/2-t.x-t.width/2}, ${h-t.y})`),h+=t.height+Je;let g=f.length>0?h-Je:0;return c.insert(`rect`,`:first-child`),c.attr(`transform`,`translate(${-m/2}, ${-g/2})`),{shapeSvg:s,bbox:c.node().getBBox(),halfPadding:(t.padding??0)/2,label:c}},`c4LabelHelper`),Ze=e((t,n)=>{let{x:r,y:i,width:a,height:o}=t;return a>=n?t:`left`in t?{x:r,y:i,width:n,height:o,top:i,left:r,bottom:i+o,right:r+n,toJSON:e(()=>({}),`toJSON`)}:{x:r-(n-a)/2,y:i,width:n,height:o}},`withMinWidth`),G=e(async(e,t,r,{ignoreMinWidth:o=!1}={})=>{if(t.stereotype!==void 0)return Xe(e,t,r);let c,l=t.useHtmlLabels||s(a()?.htmlLabels);c=r||`node default`;let u=e.insert(`g`).attr(`class`,c).attr(`id`,t.domId||t.id),d=u.insert(`g`).attr(`class`,`label`).attr(`style`,_(t.labelStyle)),f;f=t.label===void 0?``:typeof t.label==`string`?t.label:t.label[0];let m=!!t.icon||!!t.img,g=t.labelType===`markdown`,y=f&&!t.width&&!o?t.minWidth??0:0,b=await p(d,i(v(f),a()),{useHtmlLabels:l,width:t.width||t.wrappingWidth||a().flowchart?.wrappingWidth,minWidth:y,classes:g?`markdown-node-label`:``,style:t.labelStyle,addSvgBackground:m,markdown:g},a()),x=(t?.padding??0)/2,S;if(l){let e=b.children[0],t=n(b);await Ke(e),S=await h.measure(()=>e.getBoundingClientRect()),S=Ze(S,y),t.attr(`width`,S.width),t.attr(`height`,S.height)}else S=await h.measure(()=>b.getBBox()),S=Ze(S,y);return l?d.attr(`transform`,`translate(`+-S.width/2+`, `+-S.height/2+`)`):d.attr(`transform`,`translate(0, `+-S.height/2+`)`),t.centerLabel&&d.attr(`transform`,`translate(`+-S.width/2+`, `+-S.height/2+`)`),d.insert(`rect`,`:first-child`),{shapeSvg:u,bbox:S,halfPadding:x,label:d}},`labelHelper`),Qe=e(async(e,t,r)=>{let o=r.useHtmlLabels??l(a()),s=e.insert(`g`).attr(`class`,`label`).attr(`style`,r.labelStyle||``),c=await p(s,i(v(t),a()),{useHtmlLabels:o,width:r.width||a()?.flowchart?.wrappingWidth,style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img}),u=r.padding/2,d;if(l(a())){let e=c.children[0],t=n(c);d=await h.measure(()=>e.getBoundingClientRect()),t.attr(`width`,d.width),t.attr(`height`,d.height)}else d=await h.measure(()=>c.getBBox());return o?s.attr(`transform`,`translate(`+-d.width/2+`, `+-d.height/2+`)`):s.attr(`transform`,`translate(0, `+-d.height/2+`)`),r.centerLabel&&s.attr(`transform`,`translate(`+-d.width/2+`, `+-d.height/2+`)`),s.insert(`rect`,`:first-child`),{shapeSvg:e,bbox:d,halfPadding:u,label:s}},`insertLabel`),K=e((e,t,n)=>{if(n){e.width=n.width,e.height=n.height;return}let r=t.node().getBBox();e.width=r.width,e.height=r.height},`updateNodeBounds`),q=e((e,t)=>(e.look===`handDrawn`?`rough-node`:`node`)+` `+e.cssClasses+` `+(t||``),`getNodeClasses`);function J(e){let t=e.map((e,t)=>`${t===0?`M`:`L`}${e.x},${e.y}`);return t.push(`Z`),t.join(` `)}e(J,`createPathFromPoints`);function $e(e,t,n,r,i,a){let o=[],s=n-e,c=r-t,l=s/a,u=2*Math.PI/l,d=t+c/2;for(let t=0;t<=50;t++){let n=e+t/50*s,r=d+i*Math.sin(u*(n-e));o.push({x:n,y:r})}return o}e($e,`generateFullSineWavePoints`);function Y(e,t,n,r,i,a){let o=[],s=i*Math.PI/180,c=(a*Math.PI/180-s)/(r-1);for(let i=0;i<r;i++){let r=s+i*c,a=e+n*Math.cos(r),l=t+n*Math.sin(r);o.push({x:-a,y:-l})}return o}e(Y,`generateCirclePoints`);function et(t){let n=Array.from(t.childNodes).filter(e=>e.tagName===`path`),r=document.createElementNS(`http://www.w3.org/2000/svg`,`path`),i=n.map(e=>e.getAttribute(`d`)).filter(e=>e!==null).join(` `);r.setAttribute(`d`,i);let a=n.find(e=>e.getAttribute(`fill`)!==`none`),o=n.find(e=>e.getAttribute(`stroke`)!==`none`),s=e((e,t)=>e?.getAttribute(t)??void 0,`getAttr`);if(a){let e={fill:s(a,`fill`),"fill-opacity":s(a,`fill-opacity`)??`1`};Object.entries(e).forEach(([e,t])=>{t&&r.setAttribute(e,t)})}if(o){let e={stroke:s(o,`stroke`),"stroke-width":s(o,`stroke-width`)??`1`,"stroke-opacity":s(o,`stroke-opacity`)??`1`};Object.entries(e).forEach(([e,t])=>{t&&r.setAttribute(e,t)})}let c=document.createElementNS(`http://www.w3.org/2000/svg`,`g`);return c.appendChild(r),c}e(et,`mergePaths`);var tt=e((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,c,l;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),c=a===0?0:s*i/a,l=s):(i<0&&(o=-o),c=o,l=i===0?0:o*a/i),{x:n+c,y:r+l}},`intersectRect`);function nt(e,t){return e.intersect(t)}e(nt,`intersectNode`);var rt=nt;function it(e,t,n,r){var i=e.x,a=e.y,o=i-r.x,s=a-r.y,c=Math.sqrt(t*t*s*s+n*n*o*o),l=Math.abs(t*n*o/c);r.x<i&&(l=-l);var u=Math.abs(t*n*s/c);return r.y<a&&(u=-u),{x:i+l,y:a+u}}e(it,`intersectEllipse`);var at=it;function ot(e,t,n){return at(e,t,t,n)}e(ot,`intersectCircle`);var st=ot;function ct(e,t,n,r){{let i=t.y-e.y,a=e.x-t.x,o=t.x*e.y-e.x*t.y,s=i*n.x+a*n.y+o,c=i*r.x+a*r.y+o,l=1e-6;if(s!==0&&c!==0&<(s,c))return;let u=r.y-n.y,d=n.x-r.x,f=r.x*n.y-n.x*r.y,p=u*e.x+d*e.y+f,m=u*t.x+d*t.y+f;if(Math.abs(p)<l&&Math.abs(m)<l&<(p,m))return;let h=i*d-u*a;return h===0?void 0:{x:(a*f-d*o)/h,y:(u*o-i*f)/h}}}e(ct,`intersectLine`);function lt(e,t){return e*t>0}e(lt,`sameSign`);var ut=ct;function dt(e,t,n){let r=e.x,i=e.y,a=[],o=1/0,s=1/0;typeof t.forEach==`function`?t.forEach(function(e){o=Math.min(o,e.x),s=Math.min(s,e.y)}):(o=Math.min(o,t.x),s=Math.min(s,t.y));let c=r-e.width/2-o,l=i-e.height/2-s;for(let r=0;r<t.length;r++){let i=t[r],o=t[r<t.length-1?r+1:0],s=ut(e,n,{x:c+i.x,y:l+i.y},{x:c+o.x,y:l+o.y});s&&a.push(s)}return a.length?(a.length>1&&a.sort(function(e,t){let r=e.x-n.x,i=e.y-n.y,a=Math.sqrt(r*r+i*i),o=t.x-n.x,s=t.y-n.y,c=Math.sqrt(o*o+s*s);return a<c?-1:a===c?0:1}),a[0]):e}e(dt,`intersectPolygon`);var X={node:rt,circle:st,ellipse:at,polygon:dt,rect:tt},Z=e((e,t,n,r,i)=>[`M`,e+i,t,`H`,e+n-i,`A`,i,i,0,0,1,e+n,t+i,`V`,t+r-i,`A`,i,i,0,0,1,e+n-i,t+r,`H`,e+i,`A`,i,i,0,0,1,e,t+r-i,`V`,t+i,`A`,i,i,0,0,1,e+i,t,`Z`].join(` `),`createRoundedRectPathD`),ft=e(async(e,t,n,r=!1,i=!1)=>{let o=t||``;typeof o==`object`&&(o=o[0]);let s=a(),c=l(s);return await p(e,o,{style:n,isTitle:r,useHtmlLabels:c,markdown:!1,isNode:i,width:1/0},s)},`createLabel`);function pt(e,n){let{labelStyles:r}=E(n);n.labelStyle=r;let i=q(n),a=i;i||(a=`anchor`);let o=e.insert(`g`).attr(`class`,a).attr(`id`,n.domId||n.id),{cssStyles:s}=n,c=W.svg(o),l=D(n,{fill:`black`,stroke:`none`,fillStyle:`solid`});n.look!==`handDrawn`&&(l.roughness=0);let u=c.circle(0,0,2,l),d=o.insert(()=>u,`:first-child`);return d.attr(`class`,`anchor`).attr(`style`,_(s)),K(n,d),n.intersect=function(e){return t.info(`Circle intersect`,n,1,e),X.circle(n,1,e)},o}e(pt,`anchor`);function mt(e,t,n,r,i,a,o){let s=(e+n)/2,c=(t+r)/2,l=Math.atan2(r-t,n-e),u=(n-e)/2,d=(r-t)/2,f=u/i,p=d/a,m=Math.sqrt(f**2+p**2);if(m>1)throw Error(`The given radii are too small to create an arc between the points.`);let h=Math.sqrt(1-m**2),g=s+h*a*Math.sin(l)*(o?-1:1),_=c-h*i*Math.cos(l)*(o?-1:1),v=Math.atan2((t-_)/a,(e-g)/i),y=Math.atan2((r-_)/a,(n-g)/i)-v;o&&y<0&&(y+=2*Math.PI),!o&&y>0&&(y-=2*Math.PI);let b=[];for(let e=0;e<20;e++){let t=v+e/19*y,n=g+i*Math.cos(t),r=_+a*Math.sin(t);b.push({x:n,y:r})}return b}e(mt,`generateArcPoints`);function ht(e,t,n){let[r,i]=[t,n].sort((e,t)=>t-e);return i*(1-Math.sqrt(1-(e/r/2)**2))}e(ht,`calculateArcSagitta`);async function gt(t,n){let{labelStyles:r,nodeStyles:i}=E(n);n.labelStyle=r;let a=n.padding??0,o=n.look===`neo`?16:a,s=n.look===`neo`?12:a,c=e(e=>e+s,`calcTotalHeight`),l=e(e=>{let t=e/2;return[t/(2.5+e/50),t]},`calcEllipseRadius`),{shapeSvg:u,bbox:d}=await G(t,n,q(n)),f=c(n?.height?n?.height:d.height),[p,m]=l(f),h=ht(f,p,m),g=(n?.width?n?.width:d.width)+o*2+h-h,_=f,{cssStyles:v}=n,y=[{x:g/2,y:-_/2},{x:-g/2,y:-_/2},...mt(-g/2,-_/2,-g/2,_/2,p,m,!1),{x:g/2,y:_/2},...mt(g/2,_/2,g/2,-_/2,p,m,!0)],b=W.svg(u),x=D(n,{});n.look!==`handDrawn`&&(x.roughness=0,x.fillStyle=`solid`);let S=J(y),C=b.path(S,x),w=u.insert(()=>C,`:first-child`);return w.attr(`class`,`basic label-container outer-path`),v&&n.look!==`handDrawn`&&w.selectAll(`path`).attr(`style`,v),i&&n.look!==`handDrawn`&&w.selectAll(`path`).attr(`style`,i),w.attr(`transform`,`translate(${p/2}, 0)`),K(n,w),n.intersect=function(e){return X.polygon(n,y,e)},u}e(gt,`bowTieRect`);async function _t(t,n,{config:{themeVariables:r}}){let{labelStyles:i,nodeStyles:a}=E(n);n.labelStyle=i;let{shapeSvg:o,bbox:s,label:c}=await G(t,n,q(n)),l=r?.nodeBorder??r?.lineColor??`currentColor`,u=n.padding??12,d=Math.max(s.width+u*2,n.width??0,80),f=Math.max(Math.min(d*.08,12),5),p=Math.max(s.height+u*2+f,n.height??0),m=-p/2+f,h=p/2,g=d*.72,_=[`M${-d/2},${m}`,`L${-g/2},${h}`,`A${g/2},${f} 0 0 0 ${g/2},${h}`,`L${d/2},${m}`,`A${d/2},${f} 0 0 0 ${-d/2},${m}`,`Z`].join(` `),{cssStyles:v}=n,y=o.insert(`g`,`:first-child`).attr(`class`,`basic label-container`);if(n.look===`handDrawn`){let e=W.svg(o).path(_,D(n,{}));y.node()?.appendChild(e),v&&y.attr(`style`,v)}else y.append(`path`).attr(`d`,_).attr(`style`,a);y.append(`ellipse`).attr(`cx`,0).attr(`cy`,m).attr(`rx`,d/2).attr(`ry`,f).attr(`style`,`fill:none;stroke:${l};stroke-width:1px`),K(n,y);let b=m+(h-m)/2;c.attr(`transform`,`translate(${-(s.width/2)-(s.x-(s.left??0))}, ${b-s.height/2-(s.y-(s.top??0))})`);let x=e((e,t,n)=>Array.from({length:13},(r,i)=>{let a=Math.PI-i*Math.PI/12;return{x:e*Math.cos(a),y:t+n*f*Math.sin(a)}}),`arc`),S=[...x(d/2,m,-1),...x(g/2,h,1).reverse()];return n.intersect=function(e){return X.polygon(n,S,e)},o}e(_t,`bucket`);var vt=20,yt=8,bt=80,xt=8;function St(e){let{themeVariables:t}=a(),n=t.clusterBkg,r=t.clusterBorder;switch(e){case`flow`:return{rx:10,fill:`none`,stroke:t.flowContainerStroke||t.secondaryBorderColor,strokeWidth:.75,cssClass:`flow-collapsed`};default:return{rx:xt,fill:n,stroke:r,cssClass:`collapsed-group`}}}e(St,`getCollapsedStyle`);async function Ct(e,t){let n=St(t.metadata?.containerType),{fill:r,stroke:i}=n,{nodeStyles:o}=E(t),{shapeSvg:s,bbox:c}=await G(e,t,q(t)),{theme:u,themeVariables:d}=a();b(s,t.colorIndex,u,d.borderColorArray);let f=t.padding??8,p=c.height,m=Math.max(c.width+f*2,bt,t?.width??0),h=Math.max(p+yt+vt+f*2,t?.height??0),g=-m/2,v=-h/2,y=-(yt+vt)/2,x=s.select(`.label`);x&&(t.useHtmlLabels??l(a())?x.attr(`transform`,`translate(${-c.width/2}, ${-c.height/2+y})`):x.attr(`transform`,`translate(0, ${-c.height/2+y})`));let S;if(t.look===`handDrawn`){let e=W.svg(s),a=D(t,{fill:r,stroke:i,...n.strokeWidth===void 0?{}:{strokeWidth:n.strokeWidth},...r===`none`?{fillWeight:0}:{fillStyle:`solid`}}),o=e.path(Z(g,v,m,h,n.rx),a);S=s.insert(()=>o,`:first-child`),S.attr(`class`,`basic label-container `+n.cssClass).attr(`style`,_(t.cssStyles))}else S=s.insert(`rect`,`:first-child`),S.attr(`class`,`basic label-container `+n.cssClass).attr(`style`,o).attr(`rx`,n.rx).attr(`ry`,n.rx).attr(`x`,g).attr(`y`,v).attr(`width`,m).attr(`height`,h).attr(`fill`,r).attr(`stroke`,i),n.strokeWidth!==void 0&&S.attr(`stroke-width`,n.strokeWidth+`px`);let C=v+f+p+yt;s.append(`line`).attr(`class`,`collapsed-separator`).attr(`x1`,g+8).attr(`y1`,C).attr(`x2`,g+m-8).attr(`y2`,C).attr(`stroke`,i).attr(`stroke-dasharray`,`3, 3`);let w=C+vt/2;for(let e=-1;e<=1;e++)s.append(`circle`).attr(`class`,`collapsed-indicator`).attr(`cx`,e*10).attr(`cy`,w).attr(`r`,2.5).attr(`fill`,i);return K(t,S),t.calcIntersect=function(e,t){return X.rect(e,t)},t.intersect=function(e){return X.rect(t,e)},s}e(Ct,`collapsedGroup`);function wt(e,t,n,r){return e.insert(`polygon`,`:first-child`).attr(`points`,r.map(function(e){return e.x+`,`+e.y}).join(` `)).attr(`class`,`label-container`).attr(`transform`,`translate(`+-t/2+`,`+n/2+`)`)}e(wt,`insertPolygonShape`);var Tt=[`right`,`left`,`up`,`down`],Et=`point`,Dt=e(e=>{let t=new Set;for(let n of e)switch(n){case`x`:t.add(`right`),t.add(`left`);break;case`y`:t.add(`up`),t.add(`down`);break;default:t.add(n)}return t},`expandAndDeduplicateDirections`),Ot=e(e=>Tt.filter(t=>e.has(t)).join(`|`)||Et,`getDirectionKey`),kt={"right|left|up|down":e(({height:e,midpoint:t,padding:n,width:r})=>[{x:0,y:0},{x:t,y:0},{x:r/2,y:2*n},{x:r-t,y:0},{x:r,y:0},{x:r,y:-e/3},{x:r+2*n,y:-e/2},{x:r,y:-2*e/3},{x:r,y:-e},{x:r-t,y:-e},{x:r/2,y:-e-2*n},{x:t,y:-e},{x:0,y:-e},{x:0,y:-2*e/3},{x:-2*n,y:-e/2},{x:0,y:-e/3}],`right|left|up|down`),"right|left|up":e(({height:e,midpoint:t,width:n})=>[{x:t,y:0},{x:n-t,y:0},{x:n,y:-e/2},{x:n-t,y:-e},{x:t,y:-e},{x:0,y:-e/2}],`right|left|up`),"right|left|down":e(({height:e,midpoint:t,width:n})=>[{x:0,y:0},{x:t,y:-e},{x:n-t,y:-e},{x:n,y:0}],`right|left|down`),"right|up|down":e(({height:e,midpoint:t,width:n})=>[{x:0,y:0},{x:n,y:-t},{x:n,y:-e+t},{x:0,y:-e}],`right|up|down`),"left|up|down":e(({height:e,midpoint:t,width:n})=>[{x:n,y:0},{x:0,y:-t},{x:0,y:-e+t},{x:n,y:-e}],`left|up|down`),"right|left":e(({height:e,midpoint:t,padding:n,width:r})=>[{x:t,y:0},{x:t,y:-n},{x:r-t,y:-n},{x:r-t,y:0},{x:r,y:-e/2},{x:r-t,y:-e},{x:r-t,y:-e+n},{x:t,y:-e+n},{x:t,y:-e},{x:0,y:-e/2}],`right|left`),"up|down":e(({height:e,midpoint:t,padding:n,width:r})=>[{x:r/2,y:0},{x:0,y:-n},{x:t,y:-n},{x:t,y:-e+n},{x:0,y:-e+n},{x:r/2,y:-e},{x:r,y:-e+n},{x:r-t,y:-e+n},{x:r-t,y:-n},{x:r,y:-n}],`up|down`),"right|up":e(({height:e,midpoint:t,width:n})=>[{x:0,y:0},{x:n,y:-t},{x:0,y:-e}],`right|up`),"right|down":e(({height:e,width:t})=>[{x:0,y:0},{x:t,y:0},{x:0,y:-e}],`right|down`),"left|up":e(({height:e,midpoint:t,width:n})=>[{x:n,y:0},{x:0,y:-t},{x:n,y:-e}],`left|up`),"left|down":e(({height:e,width:t})=>[{x:t,y:0},{x:0,y:0},{x:t,y:-e}],`left|down`),right:e(({height:e,midpoint:t,padding:n,width:r})=>[{x:t,y:-n},{x:t,y:-n},{x:r-t,y:-n},{x:r-t,y:0},{x:r,y:-e/2},{x:r-t,y:-e},{x:r-t,y:-e+n},{x:t,y:-e+n},{x:t,y:-e+n}],`right`),left:e(({height:e,midpoint:t,padding:n,width:r})=>[{x:t,y:0},{x:t,y:-n},{x:r-t,y:-n},{x:r-t,y:-e+n},{x:t,y:-e+n},{x:t,y:-e},{x:0,y:-e/2}],`left`),up:e(({height:e,midpoint:t,padding:n,width:r})=>[{x:t,y:-n},{x:t,y:-e+n},{x:0,y:-e+n},{x:r/2,y:-e},{x:r,y:-e+n},{x:r-t,y:-e+n},{x:r-t,y:-n}],`up`),down:e(({height:e,midpoint:t,padding:n,width:r})=>[{x:r/2,y:0},{x:0,y:-n},{x:t,y:-n},{x:t,y:-e+n},{x:r-t,y:-e+n},{x:r-t,y:-n},{x:r,y:-n}],`down`),[Et]:()=>[{x:0,y:0}]},At=e((e,t,n,r)=>{let i=Dt(e),a=(n.padding??0)/2,o=t.height+4*a,s=o/2,c=r??t.width+2*s+2*a;return(kt[Ot(i)]??kt[Et])({height:o,midpoint:s,padding:a,width:c})},`getArrowPoints`);async function jt(e,t){let n=t,{shapeSvg:r,bbox:i}=await G(e,n,q(n)),a=n.padding??0,o=i.height+2*a,s=o/2,c=i.width+2*s+a,l=n.width??0,u=n.positioned&&(n.widthInColumns??1)>1&&l>c?l:c,d=At(n.directions??[],i,n,u),f=wt(r,u,o,d);return f.attr(`style`,n.style??null),K(n,f),n.intersect=function(e){return X.polygon(n,d,e)},r}e(jt,`block_arrow`);async function Mt(e,t,{config:{themeVariables:n}}){let{labelStyles:r,nodeStyles:i}=E(t);t.labelStyle=r;let{shapeSvg:a,bbox:o,label:s}=await G(e,t,q(t)),c=n?.nodeBorder??n?.lineColor??`currentColor`,l=t.padding??12,u=Math.max(o.width+l*2,t.width??0,90),d=Math.max(o.height+l*2+18,t.height??0),f=-d/2,{cssStyles:p}=t,m=a.insert(`g`,`:first-child`).attr(`class`,`basic label-container`);if(t.look===`handDrawn`){let e=W.svg(a).path(Z(-u/2,f,u,d,12),D(t,{}));m.node()?.appendChild(e),p&&m.attr(`style`,p)}else m.append(`rect`).attr(`x`,-u/2).attr(`y`,f).attr(`width`,u).attr(`height`,d).attr(`rx`,12).attr(`ry`,12).attr(`style`,i);m.append(`line`).attr(`x1`,-u/2).attr(`y1`,f+18).attr(`x2`,u/2).attr(`y2`,f+18).attr(`style`,`stroke:${c};stroke-width:1px`);for(let e=0;e<3;e++)m.append(`circle`).attr(`cx`,-u/2+12+e*9).attr(`cy`,f+9).attr(`r`,2.5).attr(`style`,`fill:${c};stroke:none`);m.append(`rect`).attr(`class`,`browser-address-bar`).attr(`x`,-u/2+44).attr(`y`,f+4).attr(`width`,Math.max(u-56,10)).attr(`height`,10).attr(`rx`,3).attr(`ry`,3).attr(`style`,`fill:none;stroke:${c};stroke-width:1px;opacity:0.6`),K(t,m);let h=f+18+(d-18)/2;return s.attr(`transform`,`translate(${-(o.width/2)-(o.x-(o.left??0))}, ${h-o.height/2-(o.y-(o.top??0))})`),t.intersect=function(e){return X.rect(t,e)},a}e(Mt,`browser`);var Nt=12;async function Pt(e,t){let{labelStyles:n,nodeStyles:r}=E(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?28:i,o=t.look===`neo`?24:i,{shapeSvg:s,bbox:c}=await G(e,t,q(t)),l=(t?.width??c.width)+(t.look===`neo`?a*2:a+Nt),u=(t?.height??c.height)+(t.look===`neo`?o*2:o),d=l,f=-u,p=[{x:0+Nt,y:f},{x:d,y:f},{x:d,y:0},{x:0,y:0},{x:0,y:f+Nt},{x:0+Nt,y:f}],m,{cssStyles:h}=t;if(t.look===`handDrawn`){let e=W.svg(s),n=D(t,{}),r=J(p),i=e.path(r,n);m=s.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-l/2}, ${u/2})`),h&&m.attr(`style`,h)}else m=wt(s,l,u,p);return r&&m.attr(`style`,r),K(t,m),t.intersect=function(e){return X.polygon(t,p,e)},s}e(Pt,`card`);function Ft(e,t){let{nodeStyles:n}=E(t);t.label=``;let r=e.insert(`g`).attr(`class`,q(t)).attr(`id`,t.domId??t.id),{cssStyles:i}=t,a=Math.max(28,t.width??0),o=[{x:0,y:a/2},{x:a/2,y:0},{x:0,y:-a/2},{x:-a/2,y:0}],s=W.svg(r),c=D(t,{});t.look!==`handDrawn`&&(c.roughness=0,c.fillStyle=`solid`);let l=J(o),u=s.path(l,c),d=r.insert(()=>u,`:first-child`);return i&&t.look!==`handDrawn`&&d.selectAll(`path`).attr(`style`,i),n&&t.look!==`handDrawn`&&d.selectAll(`path`).attr(`style`,n),t.width=28,t.height=28,t.intersect=function(e){return X.polygon(t,o,e)},r}e(Ft,`choice`);async function It(e,n,r){let{labelStyles:i,nodeStyles:a}=E(n);n.labelStyle=i;let{shapeSvg:o,bbox:s,halfPadding:c}=await G(e,n,q(n),{ignoreMinWidth:!0}),l=r?.padding??c,u=Math.sqrt(s.width**2+s.height**2)/2,d=n.look===`neo`?u+16:u+l,f,{cssStyles:p}=n;if(n.look===`handDrawn`){let e=W.svg(o),t=D(n,{}),r=e.circle(0,0,d*2,t);f=o.insert(()=>r,`:first-child`),f.attr(`class`,`basic label-container`).attr(`style`,_(p))}else f=o.insert(`circle`,`:first-child`).attr(`class`,`basic label-container`).attr(`style`,a).attr(`r`,d).attr(`cx`,0).attr(`cy`,0);return K(n,f),n.calcIntersect=function(e,t){let n=e.width/2;return X.circle(e,n,t)},n.intersect=function(e){return t.info(`Circle intersect`,n,d,e),X.circle(n,d,e)},o}e(It,`circle`);async function Lt(e,t){let n=t,{shapeSvg:r,bbox:i,halfPadding:a}=await G(e,n,[`node`,n.cssClasses,n.class].filter(Boolean).join(` `)),o=r.insert(`rect`,`:first-child`),s=n.padding??0,c=n.positioned?n.width??0:i.width+s,l=n.positioned?n.height??0:i.height+s,u=n.positioned?-c/2:-i.width/2-a,d=n.positioned?-l/2:-i.height/2-a;return o.attr(`class`,`basic cluster composite label-container`).attr(`style`,n.style??null).attr(`rx`,n.rx??null).attr(`ry`,n.ry??null).attr(`x`,u).attr(`y`,d).attr(`width`,c).attr(`height`,l),K(n,o),n.intersect=function(e){return X.rect(n,e)},r}e(Lt,`composite`);async function Rt(e,t,{config:{themeVariables:n}}){let{labelStyles:r,nodeStyles:i}=E(t);t.labelStyle=r;let{shapeSvg:a,bbox:o,label:s}=await G(e,t,q(t)),c=n?.nodeBorder??n?.lineColor??`currentColor`,l=t.padding??12,u=Math.max(o.width+l*2,t.width??0,90),d=Math.max(o.height+l*2+20,t.height??0),f=-d/2,{cssStyles:p}=t,m=a.insert(`g`,`:first-child`).attr(`class`,`basic label-container`);if(t.look===`handDrawn`){let e=W.svg(a).path(Z(-u/2,f,u,d,12),D(t,{}));m.node()?.appendChild(e),p&&m.attr(`style`,p)}else m.append(`rect`).attr(`x`,-u/2).attr(`y`,f).attr(`width`,u).attr(`height`,d).attr(`rx`,12).attr(`ry`,12).attr(`style`,i);m.append(`text`).attr(`x`,-u/2+12).attr(`y`,f+16).attr(`class`,`console-glyph`).attr(`style`,`font-family:monospace;font-weight:bold;font-size:14px;fill:${c}`).text(`>_`),K(t,m);let h=f+20+(d-20)/2;return s.attr(`transform`,`translate(${-(o.width/2)-(o.x-(o.left??0))}, ${h-o.height/2-(o.y-(o.top??0))})`),t.intersect=function(e){return X.rect(t,e)},a}e(Rt,`consoleWindow`);function zt(e){let t=Math.cos(Math.PI/4),n=Math.sin(Math.PI/4),r=e*2,i={x:r/2*t,y:r/2*n},a={x:-(r/2)*t,y:r/2*n},o={x:-(r/2)*t,y:-(r/2)*n},s={x:r/2*t,y:-(r/2)*n};return`M ${a.x},${a.y} L ${s.x},${s.y}
|
|
2
2
|
M ${i.x},${i.y} L ${o.x},${o.y}`}e(zt,`createLine`);function Bt(e,n){let{labelStyles:r,nodeStyles:i}=E(n);n.labelStyle=r,n.label=``;let a=e.insert(`g`).attr(`class`,q(n)).attr(`id`,n.domId??n.id),o=Math.max(30,n?.width??0),{cssStyles:s}=n,c=W.svg(a),l=D(n,{});n.look!==`handDrawn`&&(l.roughness=0,l.fillStyle=`solid`);let u=c.circle(0,0,o*2,l),d=zt(o),f=c.path(d,l),p=a.insert(()=>u,`:first-child`);return p.insert(()=>f),p.attr(`class`,`outer-path`),s&&n.look!==`handDrawn`&&p.selectAll(`path`).attr(`style`,s),i&&n.look!==`handDrawn`&&p.selectAll(`path`).attr(`style`,i),K(n,p),n.intersect=function(e){return t.info(`crossedCircle intersect`,n,{radius:o,point:e}),X.circle(n,o,e)},a}e(Bt,`crossedCircle`);function Vt(e,t,n,r=100,i=0,a=180){let o=[],s=i*Math.PI/180,c=(a*Math.PI/180-s)/(r-1);for(let i=0;i<r;i++){let r=s+i*c,a=e+n*Math.cos(r),l=t+n*Math.sin(r);o.push({x:-a,y:-l})}return o}e(Vt,`generateCirclePoints`);async function Ht(e,t){let{labelStyles:n,nodeStyles:r}=E(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await G(e,t,q(t)),s=t.look===`neo`?18:t.padding??0,c=t.look===`neo`?12:t.padding??0,l=a.width+s,u=a.height+c,d=Math.max(5,u*.1),{cssStyles:f}=t,p=[...Vt(l/2,-u/2,d,30,-90,0),{x:-l/2-d,y:d},...Vt(l/2+d*2,-d,d,20,-180,-270),...Vt(l/2+d*2,d,d,20,-90,-180),{x:-l/2-d,y:-u/2},...Vt(l/2,u/2,d,20,0,90)],m=[{x:l/2,y:-u/2-d},{x:-l/2,y:-u/2-d},...Vt(l/2,-u/2,d,20,-90,0),{x:-l/2-d,y:-d},...Vt(l/2+l*.1,-d,d,20,-180,-270),...Vt(l/2+l*.1,d,d,20,-90,-180),{x:-l/2-d,y:u/2},...Vt(l/2,u/2,d,20,0,90),{x:-l/2,y:u/2+d},{x:l/2,y:u/2+d}],h=W.svg(i),g=D(t,{fill:`none`});t.look!==`handDrawn`&&(g.roughness=0,g.fillStyle=`solid`);let _=J(p).replace(`Z`,``),v=h.path(_,g),y=J(m),b=h.path(y,{...g}),x=i.insert(`g`,`:first-child`);return x.insert(()=>b,`:first-child`).attr(`stroke-opacity`,0),x.insert(()=>v,`:first-child`),x.attr(`class`,`text`),f&&t.look!==`handDrawn`&&x.selectAll(`path`).attr(`style`,f),r&&t.look!==`handDrawn`&&x.selectAll(`path`).attr(`style`,r),x.attr(`transform`,`translate(${d}, 0)`),o.attr(`transform`,`translate(${-l/2+d-(a.x-(a.left??0))},${-u/2+(t.padding??0)/2-(a.y-(a.top??0))})`),K(t,x),t.intersect=function(e){return X.polygon(t,m,e)},i}e(Ht,`curlyBraceLeft`);function Ut(e,t,n,r=100,i=0,a=180){let o=[],s=i*Math.PI/180,c=(a*Math.PI/180-s)/(r-1);for(let i=0;i<r;i++){let r=s+i*c,a=e+n*Math.cos(r),l=t+n*Math.sin(r);o.push({x:a,y:l})}return o}e(Ut,`generateCirclePoints`);async function Wt(e,t){let{labelStyles:n,nodeStyles:r}=E(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await G(e,t,q(t)),s=t.look===`neo`?18:t.padding??0,c=t.look===`neo`?12:t.padding??0,l=a.width+(t.look===`neo`?s*2:s),u=a.height+(t.look===`neo`?c*2:c),d=Math.max(5,u*.1),{cssStyles:f}=t,p=[...Ut(l/2,-u/2,d,20,-90,0),{x:l/2+d,y:-d},...Ut(l/2+d*2,-d,d,20,-180,-270),...Ut(l/2+d*2,d,d,20,-90,-180),{x:l/2+d,y:u/2},...Ut(l/2,u/2,d,20,0,90)],m=[{x:-l/2,y:-u/2-d},{x:l/2,y:-u/2-d},...Ut(l/2,-u/2,d,20,-90,0),{x:l/2+d,y:-d},...Ut(l/2+d*2,-d,d,20,-180,-270),...Ut(l/2+d*2,d,d,20,-90,-180),{x:l/2+d,y:u/2},...Ut(l/2,u/2,d,20,0,90),{x:l/2,y:u/2+d},{x:-l/2,y:u/2+d}],h=W.svg(i),g=D(t,{fill:`none`});t.look!==`handDrawn`&&(g.roughness=0,g.fillStyle=`solid`);let _=J(p).replace(`Z`,``),v=h.path(_,g),y=J(m),b=h.path(y,{...g}),x=i.insert(`g`,`:first-child`);return x.insert(()=>b,`:first-child`).attr(`stroke-opacity`,0),x.insert(()=>v,`:first-child`),x.attr(`class`,`text`),f&&t.look!==`handDrawn`&&x.selectAll(`path`).attr(`style`,f),r&&t.look!==`handDrawn`&&x.selectAll(`path`).attr(`style`,r),x.attr(`transform`,`translate(${-d}, 0)`),o.attr(`transform`,`translate(${-l/2+(t.padding??0)/2-(a.x-(a.left??0))},${-u/2+(t.padding??0)/2-(a.y-(a.top??0))})`),K(t,x),t.intersect=function(e){return X.polygon(t,m,e)},i}e(Wt,`curlyBraceRight`);function Q(e,t,n,r=100,i=0,a=180){let o=[],s=i*Math.PI/180,c=(a*Math.PI/180-s)/(r-1);for(let i=0;i<r;i++){let r=s+i*c,a=e+n*Math.cos(r),l=t+n*Math.sin(r);o.push({x:-a,y:-l})}return o}e(Q,`generateCirclePoints`);async function Gt(e,t){let{labelStyles:n,nodeStyles:r}=E(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await G(e,t,q(t)),s=t.look===`neo`?18:t.padding??0,c=t.look===`neo`?12:t.padding??0,l=a.width+(t.look===`neo`?s*2:s),u=a.height+(t.look===`neo`?c*2:c),d=Math.max(5,u*.1),{cssStyles:f}=t,p=[...Q(l/2,-u/2,d,30,-90,0),{x:-l/2-d,y:d},...Q(l/2+d*2,-d,d,20,-180,-270),...Q(l/2+d*2,d,d,20,-90,-180),{x:-l/2-d,y:-u/2},...Q(l/2,u/2,d,20,0,90)],m=[...Q(-l/2+d+d/2,-u/2,d,20,-90,-180),{x:l/2-d/2,y:d},...Q(-l/2-d/2,-d,d,20,0,90),...Q(-l/2-d/2,d,d,20,-90,0),{x:l/2-d/2,y:-d},...Q(-l/2+d+d/2,u/2,d,30,-180,-270)],h=[{x:l/2,y:-u/2-d},{x:-l/2,y:-u/2-d},...Q(l/2,-u/2,d,20,-90,0),{x:-l/2-d,y:-d},...Q(l/2+d*2,-d,d,20,-180,-270),...Q(l/2+d*2,d,d,20,-90,-180),{x:-l/2-d,y:u/2},...Q(l/2,u/2,d,20,0,90),{x:-l/2,y:u/2+d},{x:l/2-d-d/2,y:u/2+d},...Q(-l/2+d+d/2,-u/2,d,20,-90,-180),{x:l/2-d/2,y:d},...Q(-l/2-d/2,-d,d,20,0,90),...Q(-l/2-d/2,d,d,20,-90,0),{x:l/2-d/2,y:-d},...Q(-l/2+d+d/2,u/2,d,30,-180,-270)],g=W.svg(i),_=D(t,{fill:`none`});t.look!==`handDrawn`&&(_.roughness=0,_.fillStyle=`solid`);let v=J(p).replace(`Z`,``),y=g.path(v,_),b=J(m).replace(`Z`,``),x=g.path(b,_),S=J(h),C=g.path(S,{..._}),w=i.insert(`g`,`:first-child`);return w.insert(()=>C,`:first-child`).attr(`stroke-opacity`,0),w.insert(()=>y,`:first-child`),w.insert(()=>x,`:first-child`),w.attr(`class`,`text`),f&&t.look!==`handDrawn`&&w.selectAll(`path`).attr(`style`,f),r&&t.look!==`handDrawn`&&w.selectAll(`path`).attr(`style`,r),w.attr(`transform`,`translate(${d-d/4}, 0)`),o.attr(`transform`,`translate(${-l/2+(t.padding??0)/2-(a.x-(a.left??0))},${-u/2+(t.padding??0)/2-(a.y-(a.top??0))})`),K(t,w),t.intersect=function(e){return X.polygon(t,h,e)},i}e(Gt,`curlyBraces`);async function Kt(e,t){let{labelStyles:n,nodeStyles:r}=E(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i,{shapeSvg:s,bbox:c}=await G(e,t,q(t)),l=Math.max(5,c.height+o*2,t?.height??0),u=l/2,d=u-Math.sqrt(Math.max(0,u**2-(c.height/2)**2)),f=Math.max(l/4,d),p=Math.max(20,c.width+a*2+f*2,(c.width+a*2)*1.25,t?.width??0),{cssStyles:m}=t,h=W.svg(s),g=D(t,{});t.look!==`handDrawn`&&(g.roughness=0,g.fillStyle=`solid`);let _=p,v=l,y=_-u,b=v/4,x=[{x:y,y:0},{x:b,y:0},{x:0,y:v/2},{x:b,y:v},{x:y,y:v},...Y(-y,-v/2,u,50,270,90)],S=J(x),C=h.path(S,g),w=s.insert(()=>C,`:first-child`);return w.attr(`class`,`basic label-container outer-path`),m&&t.look!==`handDrawn`&&w.selectChildren(`path`).attr(`style`,m),r&&t.look!==`handDrawn`&&w.selectChildren(`path`).attr(`style`,r),w.attr(`transform`,`translate(${-p/2}, ${-l/2})`),K(t,w),t.intersect=function(e){return X.polygon(t,x,e)},s}e(Kt,`curvedTrapezoid`);async function qt(e,t){let{labelStyles:n,nodeStyles:r}=E(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await G(e,t,q(t)),s=t.padding??20,c=Math.max(a.width+s*2,t.width??0,100),l=Math.min(Math.max(c*.23,16),56),u=l*.27,d=Math.max(a.height+s*2,t.height?t.height-(2*l-u):0),f=Math.min(c*.177,d*.45),p=d+2*l-u,m=-p/2,h=m+2*l-u,g=i.insert(`g`,`:first-child`).attr(`class`,`basic label-container`),{cssStyles:_}=t;if(t.look===`handDrawn`){let e=W.svg(i),n=D(t,{}),r=e.path(Z(-c/2,h,c,d,f),n),a=e.circle(0,m+l,l*2,n);g.insert(()=>a,`:first-child`),g.insert(()=>r,`:first-child`),_&&g.attr(`style`,_)}else g.append(`rect`).attr(`x`,-c/2).attr(`y`,h).attr(`width`,c).attr(`height`,d).attr(`rx`,f).attr(`ry`,f).attr(`style`,r),g.append(`circle`).attr(`cx`,0).attr(`cy`,m+l).attr(`r`,l).attr(`style`,r);K(t,g);let v=h+d/2;o.attr(`transform`,`translate(${-(a.width/2)-(a.x-(a.left??0))}, ${v-a.height/2-(a.y-(a.top??0))})`);let y=m+l,b=Math.asin(Math.min(1,(h-y)/l))*180/Math.PI,x=[...Y(0,-y,l,24,180+b,-b),...Y(-(-c/2+f),-(h+f),f,12,90,0),...Y(-(-c/2+f),-(p/2-f),f,12,360,270),...Y(-(c/2-f),-(p/2-f),f,12,270,180),...Y(-(c/2-f),-(h+f),f,12,180,90)];return t.intersect=function(e){return X.polygon(t,x,e)},i}e(qt,`person`);var Jt=e((e,t,n,r,i,a)=>[`M${e},${t+a}`,`a${i},${a} 0,0,0 ${n},0`,`a${i},${a} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${a} 0,0,0 ${n},0`,`l0,${-r}`].join(` `),`createCylinderPathD`),Yt=e((e,t,n,r,i,a)=>[`M${e},${t+a}`,`M${e+n},${t+a}`,`a${i},${a} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${a} 0,0,0 ${n},0`,`l0,${-r}`].join(` `),`createOuterCylinderPathD`),Xt=e((e,t,n,r,i,a)=>[`M${e-n/2},${-r/2}`,`a${i},${a} 0,0,0 ${n},0`].join(` `),`createInnerCylinderPathD`),Zt=8,Qt=8;async function $t(e,t){let{labelStyles:n,nodeStyles:r}=E(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?24:i,o=t.look===`neo`?24:i,s=t.width??0;if(t.width&&(t.width-=o,t.width<Qt&&(t.width=Qt)),t.height){let e=s/2/(2.5+s/50);t.height=t.height-a-e*3,t.height<Zt&&(t.height=Zt)}let{shapeSvg:c,bbox:l,label:u}=await G(e,t,q(t)),d=Math.max(t.width??0,l.width)+o,f=d/2,p=f/(2.5+d/50),m=Math.max(t.height??0,l.height)+a+p,h,{cssStyles:g}=t;if(t.look===`handDrawn`){let e=W.svg(c),n=Yt(0,0,d,m,f,p),r=Xt(0,p,d,m,f,p),i=D(t,{}),a=e.path(n,i),o=e.path(r,D(t,{fill:`none`}));h=c.insert(()=>o,`:first-child`),h=c.insert(()=>a,`:first-child`),h.attr(`class`,`basic label-container`),g&&h.attr(`style`,g)}else{let e=Jt(0,0,d,m,f,p);h=c.insert(`path`,`:first-child`).attr(`d`,e).attr(`class`,`basic label-container outer-path`).attr(`style`,_(g)).attr(`style`,r)}return h.attr(`label-offset-y`,p),h.attr(`transform`,`translate(${-d/2}, ${-(m/2+p)})`),K(t,h),u.attr(`transform`,`translate(${-(l.width/2)-(l.x-(l.left??0))}, ${-(l.height/2)+(t.padding??0)/1.5-(l.y-(l.top??0))})`),t.intersect=function(e){let n=X.rect(t,e),r=n.x-(t.x??0);if(f!=0&&(Math.abs(r)<(t.width??0)/2||Math.abs(r)==(t.width??0)/2&&Math.abs(n.y-(t.y??0))>(t.height??0)/2-p)){let i=p*p*(1-r*r/(f*f));i>0&&(i=Math.sqrt(i)),i=p-i,e.y-(t.y??0)>0&&(i=-i),n.y+=i}return n},c}e($t,`cylinder`);async function en(e,t,n){let{labelStyles:r,nodeStyles:i}=E(t);t.labelStyle=r;let{shapeSvg:a,bbox:o}=await G(e,t,q(t)),s=Math.max(o.width+n.labelPaddingX*2,t?.width||0),c=Math.max(o.height+n.labelPaddingY*2,t?.height||0),l=-s/2,u=-c/2,d,{rx:f,ry:p}=t,{cssStyles:m}=t;if(n?.rx&&n.ry&&(f=n.rx,p=n.ry),t.look===`handDrawn`){let e=W.svg(a),n=D(t,{}),r=f||p?e.path(Z(l,u,s,c,f||0),n):e.rectangle(l,u,s,c,n);d=a.insert(()=>r,`:first-child`),d.attr(`class`,`basic label-container`).attr(`style`,_(m))}else d=a.insert(`rect`,`:first-child`),d.attr(`class`,`basic label-container`).attr(`style`,i).attr(`rx`,_(f)).attr(`ry`,_(p)).attr(`x`,l).attr(`y`,u).attr(`width`,s).attr(`height`,c);return K(t,d,t.look===`handDrawn`?void 0:{width:s,height:c}),t.calcIntersect=function(e,t){return X.rect(e,t)},t.intersect=function(e){return X.rect(t,e)},a}e(en,`drawRect`);async function tn(e,t){let{cssClasses:n,labelPaddingX:r,labelPaddingY:i,padding:a,width:o,height:s}=t,c=await en(e,t,{rx:0,ry:0,classes:n??``,labelPaddingX:r??(a??0)*2,labelPaddingY:i??a??0});if(t.look===`handDrawn`){let e=W.svg(c),n=D(t,{}),r=c.select(`.basic.label-container > path:nth-child(2)`),i=r.node();if(!i)return c;let a=null;if(i instanceof SVGGraphicsElement)a=i.getBBox();else return c;return c.insert(()=>e.line(a.x,a.y,a.x+a.width,a.y,n),`.basic.label-container g.label`),c.insert(()=>e.line(a.x,a.y+a.height,a.x+a.width,a.y+a.height,n),`.basic.label-container g.label`),r.remove(),c}let l=c.select(`.basic.label-container`),u=(Number(l.attr(`width`))||o)??0,d=(Number(l.attr(`height`))||s)??0;return u>0&&d>0&&l.attr(`stroke-dasharray`,`${u} ${d}`),c}e(tn,`datastore`);async function nn(e,t){let{labelStyles:n,nodeStyles:r}=E(t);t.labelStyle=n;let i=t.look===`neo`?16:t.padding??0,a=t.look===`neo`?16:t.padding??0,{shapeSvg:o,bbox:s,label:c}=await G(e,t,q(t)),l=s.width+i,u=s.height+a,d=u*.2,f=-l/2,p=-u/2-d/2,{cssStyles:m}=t,h=W.svg(o),g=D(t,{});t.look!==`handDrawn`&&(g.roughness=0,g.fillStyle=`solid`);let _=[{x:f,y:p+d},{x:-f,y:p+d},{x:-f,y:-p},{x:f,y:-p},{x:f,y:p},{x:-f,y:p},{x:-f,y:p+d}],v=h.polygon(_.map(e=>[e.x,e.y]),g),y=o.insert(()=>v,`:first-child`);return y.attr(`class`,`basic label-container outer-path`),m&&t.look!==`handDrawn`&&y.selectAll(`path`).attr(`style`,m),r&&t.look!==`handDrawn`&&y.selectAll(`path`).attr(`style`,r),c.attr(`transform`,`translate(${f+(t.padding??0)/2-(s.x-(s.left??0))}, ${p+d+(t.padding??0)/2-(s.y-(s.top??0))})`),K(t,y),t.intersect=function(e){return X.rect(t,e)},o}e(nn,`dividedRectangle`);async function rn(e,n){let{labelStyles:r,nodeStyles:i}=E(n),a=n.look===`neo`?12:5;n.labelStyle=r;let o=n.padding??0,s=n.look===`neo`?16:o,{shapeSvg:c,bbox:l}=await G(e,n,q(n),{ignoreMinWidth:!0}),u=Math.sqrt(l.width**2+l.height**2)/2,d=(n?.width?n?.width/2:u)+(s??0),f=d+a,p,{cssStyles:m}=n;if(n.look===`handDrawn`){let e=W.svg(c),t=D(n,{roughness:.2,strokeWidth:2.5}),r=D(n,{roughness:.2,strokeWidth:1.5}),i=e.circle(0,0,f*2,t),a=e.circle(0,0,d*2,r);p=c.insert(`g`,`:first-child`),p.attr(`class`,_(n.cssClasses)).attr(`style`,_(m)),p.node()?.appendChild(i),p.node()?.appendChild(a)}else{p=c.insert(`g`,`:first-child`);let e=p.insert(`circle`,`:first-child`),t=p.insert(`circle`);p.attr(`class`,`basic label-container`).attr(`style`,i),e.attr(`class`,`outer-circle`).attr(`style`,i).attr(`r`,f).attr(`cx`,0).attr(`cy`,0),t.attr(`class`,`inner-circle`).attr(`style`,i).attr(`r`,d).attr(`cx`,0).attr(`cy`,0)}return K(n,p),n.intersect=function(e){return t.info(`DoubleCircle intersect`,n,f,e),X.circle(n,f,e)},c}e(rn,`doublecircle`);async function an(e,t){let{labelStyles:n,nodeStyles:r}=E(t);t.labelStyle=n;let{shapeSvg:i,bbox:o,halfPadding:s}=await G(e,t,q(t)),{theme:c,themeVariables:l}=a();b(i,t.colorIndex,c,l.borderColorArray);let u=s??10,d=o.width/2+u*2,f=o.height/2+u*2,p,{cssStyles:m}=t;if(t.look===`handDrawn`){let e=W.svg(i),n=D(t,{}),r=e.ellipse(0,0,d*2,f*2,n);p=i.insert(()=>r,`:first-child`),p.attr(`class`,`basic label-container`),m&&p.attr(`style`,m)}else p=i.insert(`ellipse`,`:first-child`).attr(`class`,`basic label-container`).attr(`style`,r).attr(`rx`,d).attr(`ry`,f).attr(`cx`,0).attr(`cy`,0);return t.width=d*2,t.height=f*2,K(t,p),t.calcIntersect=function(e,t){let n=e.width/2,r=e.height/2;return X.ellipse(e,n,r,t)},t.intersect=function(e){return X.ellipse(t,d,f,e)},i}e(an,`usecaseEllipse`);function on(e,n,{config:{themeVariables:r}}){let{labelStyles:i,nodeStyles:a}=E(n);n.label=``,n.labelStyle=i;let o=e.insert(`g`).attr(`class`,q(n)).attr(`id`,n.domId??n.id),{cssStyles:s}=n,c=W.svg(o),{nodeBorder:l}=r,u=D(n,{fillStyle:`solid`});n.look!==`handDrawn`&&(u.roughness=0);let d=c.circle(0,0,14,u),f=o.insert(()=>d,`:first-child`);return f.selectAll(`path`).attr(`style`,`fill: ${l} !important;`),s&&s.length>0&&n.look!==`handDrawn`&&f.selectAll(`path`).attr(`style`,s),a&&n.look!==`handDrawn`&&f.selectAll(`path`).attr(`style`,a),K(n,f),n.intersect=function(e){return t.info(`filledCircle intersect`,n,{radius:7,point:e}),X.circle(n,7,e)},o}e(on,`filledCircle`);var sn=10,cn=10;async function ln(e,n){let{labelStyles:r,nodeStyles:i}=E(n);n.labelStyle=r;let a=n.padding??0,o=n.look===`neo`?a*2:a;(n.width||n.height)&&(n.height=n?.height??0,n.height<sn&&(n.height=sn),n.width=(n?.width??0)-o-o/2,n.width<cn&&(n.width=cn));let{shapeSvg:s,bbox:c,label:l}=await G(e,n,q(n)),u=(n?.width?n?.width:c.width)+(o??0),d=n?.height?n?.height:u+c.height,f=d,p=[{x:0,y:-d},{x:f,y:-d},{x:f/2,y:0}],{cssStyles:m}=n,h=W.svg(s),g=D(n,{});n.look!==`handDrawn`&&(g.roughness=0,g.fillStyle=`solid`);let _=J(p),v=h.path(_,g),y=s.insert(()=>v,`:first-child`).attr(`transform`,`translate(${-d/2}, ${d/2})`).attr(`class`,`outer-path`);return m&&n.look!==`handDrawn`&&y.selectChildren(`path`).attr(`style`,m),i&&n.look!==`handDrawn`&&y.selectChildren(`path`).attr(`style`,i),n.width=u,n.height=d,K(n,y),l.attr(`transform`,`translate(${-c.width/2-(c.x-(c.left??0))}, ${-d/2+(n.padding??0)/2+(c.y-(c.top??0))})`),n.intersect=function(e){return t.info(`Triangle intersect`,n,p,e),X.polygon(n,p,e)},s}e(ln,`flippedTriangle`);async function un(e,t){let{labelStyles:n,nodeStyles:r}=E(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await G(e,t,q(t)),s=t.padding??12,c=Math.max(a.width+s*2,t.width??0,90),l=a.height+s*2,u=Math.max(Math.min(l*.16,14),8),d=Math.max(l+u,t.height??0),f=d-u,p=Math.max(c*.38,28),m=-d/2,h=[{x:-c/2,y:m},{x:-c/2+p,y:m},{x:-c/2+p,y:m+u},{x:c/2,y:m+u},{x:c/2,y:d/2},{x:-c/2,y:d/2}],g=[`M${h[0].x},${h[0].y}`,...h.slice(1).map(e=>`L${e.x},${e.y}`),`Z`].join(` `),{cssStyles:_}=t,v;if(t.look===`handDrawn`){let e=W.svg(i).path(g,D(t,{}));v=i.insert(()=>e,`:first-child`).attr(`class`,`basic label-container`),_&&v.attr(`style`,_)}else v=i.insert(`path`,`:first-child`).attr(`d`,g).attr(`class`,`basic label-container`).attr(`style`,r);t.look===`handDrawn`?K(t,v):K(t,v,{width:c,height:d});let y=m+u+f/2;return o.attr(`transform`,`translate(${-(a.width/2)-(a.x-(a.left??0))}, ${y-a.height/2-(a.y-(a.top??0))})`),t.intersect=function(e){return X.polygon(t,h,e)},i}e(un,`folder`);function dn(e,t,{dir:n,config:{state:r,themeVariables:i}}){let{nodeStyles:a}=E(t);t.label=``;let o=e.insert(`g`).attr(`class`,q(t)).attr(`id`,t.domId??t.id),{cssStyles:s}=t,c=Math.max(70,t?.width??0),l=Math.max(10,t?.height??0);(n===`LR`||n===`RL`)&&(c=Math.max(10,t?.width??0),l=Math.max(70,t?.height??0));let u=-1*c/2,d=-1*l/2,f=W.svg(o),p=D(t,{stroke:i.lineColor,fill:i.lineColor});t.look!==`handDrawn`&&(p.roughness=0,p.fillStyle=`solid`);let m=f.rectangle(u,d,c,l,p),h=o.insert(()=>m,`:first-child`);s&&t.look!==`handDrawn`&&h.selectAll(`path`).attr(`style`,s),a&&t.look!==`handDrawn`&&h.selectAll(`path`).attr(`style`,a),K(t,h);let g=r?.padding??0;return t.width&&t.height&&(t.width+=g/2||0,t.height+=g/2||0),t.intersect=function(e){return X.rect(t,e)},o}e(dn,`forkJoin`);async function fn(e,n){let{labelStyles:r,nodeStyles:i}=E(n);n.labelStyle=r;let a=n.look===`neo`?16:n.padding??0,o=n.look===`neo`?12:n.padding??0;(n.width||n.height)&&(n.height=(n?.height??0)-o*2,n.height<10&&(n.height=10),n.width=(n?.width??0)-a*2,n.width<15&&(n.width=15));let{shapeSvg:s,bbox:c}=await G(e,n,q(n)),l=(n?.height?n?.height:Math.max(10,c.height))+o*2,u=l/2,d=u-Math.sqrt(Math.max(0,u**2-(c.height/2)**2)),f=(n?.width?n?.width:Math.max(15,c.width)+d*2)+a*2,{cssStyles:p}=n,m=W.svg(s),h=D(n,{});n.look!==`handDrawn`&&(h.roughness=0,h.fillStyle=`solid`);let g=[{x:-f/2,y:-l/2},{x:f/2-u,y:-l/2},...Y(-f/2+u,0,u,50,90,270),{x:f/2-u,y:l/2},{x:-f/2,y:l/2}],_=J(g),v=m.path(_,h),y=s.insert(()=>v,`:first-child`);return y.attr(`class`,`basic label-container outer-path`),p&&n.look!==`handDrawn`&&y.selectChildren(`path`).attr(`style`,p),i&&n.look!==`handDrawn`&&y.selectChildren(`path`).attr(`style`,i),K(n,y),n.intersect=function(e){return t.info(`Pill intersect`,n,{radius:u,point:e}),X.polygon(n,g,e)},s}e(fn,`halfRoundedRectangle`);var pn=e((e,t,n,r,i)=>[`M${e+i},${t}`,`L${e+n-i},${t}`,`L${e+n},${t-r/2}`,`L${e+n-i},${t-r}`,`L${e+i},${t-r}`,`L${e},${t-r/2}`,`Z`].join(` `),`createHexagonPathD`);async function mn(e,t){let{labelStyles:n,nodeStyles:r}=E(t),i=t.look===`neo`?3.5:4;t.labelStyle=n;let a=t.padding??0,o=t.look===`neo`?70:a,s=t.look===`neo`?32:a;if(t.width||t.height){let e=(t.height??0)/i;t.width=(t?.width??0)-2*e-s,t.height=(t.height??0)-o}let{shapeSvg:c,bbox:l}=await G(e,t,q(t)),u=(t?.height?t?.height:l.height)+o,d=u/i,f=(t?.width?t?.width:l.width)+2*d+s,p=[{x:d,y:0},{x:f-d,y:0},{x:f,y:-u/2},{x:f-d,y:-u},{x:d,y:-u},{x:0,y:-u/2}],m,{cssStyles:h}=t;if(t.look===`handDrawn`){let e=W.svg(c),n=D(t,{}),r=pn(0,0,f,u,d),i=e.path(r,n);m=c.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-f/2}, ${u/2})`),h&&m.attr(`style`,h)}else m=wt(c,f,u,p);return r&&m.attr(`style`,r),t.width=f,t.height=u,K(t,m),t.intersect=function(e){return X.polygon(t,p,e)},c}e(mn,`hexagon`);async function hn(e,n){let{labelStyles:r,nodeStyles:i}=E(n);n.label=``,n.labelStyle=r;let{shapeSvg:a}=await G(e,n,q(n)),o=Math.max(30,n?.width??0),s=Math.max(30,n?.height??0),{cssStyles:c}=n,l=W.svg(a),u=D(n,{});n.look!==`handDrawn`&&(u.roughness=0,u.fillStyle=`solid`);let d=[{x:0,y:0},{x:o,y:0},{x:0,y:s},{x:o,y:s}],f=J(d),p=l.path(f,u),m=a.insert(()=>p,`:first-child`);return m.attr(`class`,`basic label-container outer-path`),c&&n.look!==`handDrawn`&&m.selectChildren(`path`).attr(`style`,c),i&&n.look!==`handDrawn`&&m.selectChildren(`path`).attr(`style`,i),m.attr(`transform`,`translate(${-o/2}, ${-s/2})`),K(n,m),n.intersect=function(e){return t.info(`Pill intersect`,n,{points:d}),X.polygon(n,d,e)},a}e(hn,`hourglass`);async function gn(e,n,{config:{themeVariables:r,flowchart:i}}){let{labelStyles:a}=E(n);n.labelStyle=a;let o=n.assetHeight??48,s=n.assetWidth??48,c=Math.max(o,s),l=i?.wrappingWidth;n.width=Math.max(c,l??0);let{shapeSvg:u,bbox:d,label:p}=await G(e,n,`icon-shape default`),m=n.pos===`t`,h=c,g=c,{nodeBorder:_}=r,{stylesMap:v}=C(n),y=-g/2,b=-h/2,x=n.label?8:0,S=W.svg(u),w=D(n,{stroke:`none`,fill:`none`});n.look!==`handDrawn`&&(w.roughness=0,w.fillStyle=`solid`);let T=S.rectangle(y,b,g,h,w),O=Math.max(g,d.width),k=h+d.height+x,A=S.rectangle(-O/2,-k/2,O,k,{...w,fill:`transparent`,stroke:`none`}),j=u.insert(()=>T,`:first-child`),M=u.insert(()=>A);if(n.icon){let e=u.append(`g`);e.html(`<g>${await f(n.icon,{height:c,width:c,fallbackPrefix:``})}</g>`);let t=e.node().getBBox(),r=t.width,i=t.height,a=t.x,o=t.y;e.attr(`transform`,`translate(${-r/2-a},${m?d.height/2+x/2-i/2-o:-d.height/2-x/2-i/2-o})`),e.attr(`style`,`color: ${v.get(`stroke`)??_};`)}return p.attr(`transform`,`translate(${-d.width/2-(d.x-(d.left??0))},${m?-k/2:k/2-d.height})`),j.attr(`transform`,`translate(0,${m?d.height/2+x/2:-d.height/2-x/2})`),K(n,M),n.intersect=function(e){if(t.info(`iconSquare intersect`,n,e),!n.label)return X.rect(n,e);let r=n.x??0,i=n.y??0,a=n.height??0,o=[];return o=m?[{x:r-d.width/2,y:i-a/2},{x:r+d.width/2,y:i-a/2},{x:r+d.width/2,y:i-a/2+d.height+x},{x:r+g/2,y:i-a/2+d.height+x},{x:r+g/2,y:i+a/2},{x:r-g/2,y:i+a/2},{x:r-g/2,y:i-a/2+d.height+x},{x:r-d.width/2,y:i-a/2+d.height+x}]:[{x:r-g/2,y:i-a/2},{x:r+g/2,y:i-a/2},{x:r+g/2,y:i-a/2+h},{x:r+d.width/2,y:i-a/2+h},{x:r+d.width/2/2,y:i+a/2},{x:r-d.width/2,y:i+a/2},{x:r-d.width/2,y:i-a/2+h},{x:r-g/2,y:i-a/2+h}],X.polygon(n,o,e)},u}e(gn,`icon`);async function _n(e,n,{config:{themeVariables:r,flowchart:i}}){let{labelStyles:a}=E(n);n.labelStyle=a;let o=n.assetHeight??48,s=n.assetWidth??48,c=Math.max(o,s),l=i?.wrappingWidth;n.width=Math.max(c,l??0);let{shapeSvg:u,bbox:d,label:p}=await G(e,n,`icon-shape default`),m=n.label?8:0,h=n.pos===`t`,{nodeBorder:g,mainBkg:_}=r,{stylesMap:v}=C(n),y=W.svg(u),b=D(n,{});n.look!==`handDrawn`&&(b.roughness=0,b.fillStyle=`solid`),b.stroke=v.get(`fill`)??_;let x=u.append(`g`);n.icon&&x.html(`<g>${await f(n.icon,{height:c,width:c,fallbackPrefix:``})}</g>`);let S=x.node().getBBox(),w=S.width,T=S.height,O=S.x,k=S.y,A=Math.max(w,T)*Math.SQRT2+40,j=y.circle(0,0,A,b),M=Math.max(A,d.width),N=A+d.height+m,P=y.rectangle(-M/2,-N/2,M,N,{...b,fill:`transparent`,stroke:`none`}),ee=u.insert(()=>j,`:first-child`),F=u.insert(()=>P);return x.attr(`transform`,`translate(${-w/2-O},${h?d.height/2+m/2-T/2-k:-d.height/2-m/2-T/2-k})`),x.attr(`style`,`color: ${v.get(`stroke`)??g};`),p.attr(`transform`,`translate(${-d.width/2-(d.x-(d.left??0))},${h?-N/2:N/2-d.height})`),ee.attr(`transform`,`translate(0,${h?d.height/2+m/2:-d.height/2-m/2})`),K(n,F),n.intersect=function(e){return t.info(`iconSquare intersect`,n,e),X.rect(n,e)},u}e(_n,`iconCircle`);async function vn(e,n,{config:{themeVariables:r,flowchart:i}}){let{labelStyles:a}=E(n);n.labelStyle=a;let o=n.assetHeight??48,s=n.assetWidth??48,c=Math.max(o,s),l=i?.wrappingWidth;n.width=Math.max(c,l??0);let{shapeSvg:u,bbox:d,halfPadding:p,label:m}=await G(e,n,`icon-shape default`),h=n.pos===`t`,g=c+p*2,_=c+p*2,{nodeBorder:v,mainBkg:y}=r,{stylesMap:b}=C(n),x=-_/2,S=-g/2,w=n.label?8:0,T=W.svg(u),O=D(n,{});n.look!==`handDrawn`&&(O.roughness=0,O.fillStyle=`solid`),O.stroke=b.get(`fill`)??y;let k=T.path(Z(x,S,_,g,5),O),A=Math.max(_,d.width),j=g+d.height+w,M=T.rectangle(-A/2,-j/2,A,j,{...O,fill:`transparent`,stroke:`none`}),N=u.insert(()=>k,`:first-child`).attr(`class`,`icon-shape2`),P=u.insert(()=>M);if(n.icon){let e=u.append(`g`);e.html(`<g>${await f(n.icon,{height:c,width:c,fallbackPrefix:``})}</g>`);let t=e.node().getBBox(),r=t.width,i=t.height,a=t.x,o=t.y;e.attr(`transform`,`translate(${-r/2-a},${h?d.height/2+w/2-i/2-o:-d.height/2-w/2-i/2-o})`),e.attr(`style`,`color: ${b.get(`stroke`)??v};`)}return m.attr(`transform`,`translate(${-d.width/2-(d.x-(d.left??0))},${h?-j/2:j/2-d.height})`),N.attr(`transform`,`translate(0,${h?d.height/2+w/2:-d.height/2-w/2})`),K(n,P),n.intersect=function(e){if(t.info(`iconSquare intersect`,n,e),!n.label)return X.rect(n,e);let r=n.x??0,i=n.y??0,a=n.height??0,o=[];return o=h?[{x:r-d.width/2,y:i-a/2},{x:r+d.width/2,y:i-a/2},{x:r+d.width/2,y:i-a/2+d.height+w},{x:r+_/2,y:i-a/2+d.height+w},{x:r+_/2,y:i+a/2},{x:r-_/2,y:i+a/2},{x:r-_/2,y:i-a/2+d.height+w},{x:r-d.width/2,y:i-a/2+d.height+w}]:[{x:r-_/2,y:i-a/2},{x:r+_/2,y:i-a/2},{x:r+_/2,y:i-a/2+g},{x:r+d.width/2,y:i-a/2+g},{x:r+d.width/2/2,y:i+a/2},{x:r-d.width/2,y:i+a/2},{x:r-d.width/2,y:i-a/2+g},{x:r-_/2,y:i-a/2+g}],X.polygon(n,o,e)},u}e(vn,`iconRounded`);async function yn(e,n,{config:{themeVariables:r,flowchart:i}}){let{labelStyles:a}=E(n);n.labelStyle=a;let o=n.assetHeight??48,s=n.assetWidth??48,c=Math.max(o,s),l=i?.wrappingWidth;n.width=Math.max(c,l??0);let{shapeSvg:u,bbox:d,halfPadding:p,label:m}=await G(e,n,`icon-shape default`),h=n.pos===`t`,g=c+p*2,_=c+p*2,{nodeBorder:v,mainBkg:y}=r,{stylesMap:b}=C(n),x=-_/2,S=-g/2,w=n.label?8:0,T=W.svg(u),O=D(n,{});n.look!==`handDrawn`&&(O.roughness=0,O.fillStyle=`solid`),O.stroke=b.get(`fill`)??y;let k=T.path(Z(x,S,_,g,.1),O),A=Math.max(_,d.width),j=g+d.height+w,M=T.rectangle(-A/2,-j/2,A,j,{...O,fill:`transparent`,stroke:`none`}),N=u.insert(()=>k,`:first-child`),P=u.insert(()=>M);if(n.icon){let e=u.append(`g`);e.html(`<g>${await f(n.icon,{height:c,width:c,fallbackPrefix:``})}</g>`);let t=e.node().getBBox(),r=t.width,i=t.height,a=t.x,o=t.y;e.attr(`transform`,`translate(${-r/2-a},${h?d.height/2+w/2-i/2-o:-d.height/2-w/2-i/2-o})`),e.attr(`style`,`color: ${b.get(`stroke`)??v};`)}return m.attr(`transform`,`translate(${-d.width/2-(d.x-(d.left??0))},${h?-j/2:j/2-d.height})`),N.attr(`transform`,`translate(0,${h?d.height/2+w/2:-d.height/2-w/2})`),K(n,P),n.intersect=function(e){if(t.info(`iconSquare intersect`,n,e),!n.label)return X.rect(n,e);let r=n.x??0,i=n.y??0,a=n.height??0,o=[];return o=h?[{x:r-d.width/2,y:i-a/2},{x:r+d.width/2,y:i-a/2},{x:r+d.width/2,y:i-a/2+d.height+w},{x:r+_/2,y:i-a/2+d.height+w},{x:r+_/2,y:i+a/2},{x:r-_/2,y:i+a/2},{x:r-_/2,y:i-a/2+d.height+w},{x:r-d.width/2,y:i-a/2+d.height+w}]:[{x:r-_/2,y:i-a/2},{x:r+_/2,y:i-a/2},{x:r+_/2,y:i-a/2+g},{x:r+d.width/2,y:i-a/2+g},{x:r+d.width/2/2,y:i+a/2},{x:r-d.width/2,y:i+a/2},{x:r-d.width/2,y:i-a/2+g},{x:r-_/2,y:i-a/2+g}],X.polygon(n,o,e)},u}e(yn,`iconSquare`);async function bn(e,n,{config:{flowchart:r}}){let i=new Image;i.src=n?.img??``,await i.decode();let a=Number(i.naturalWidth.toString().replace(`px`,``)),o=Number(i.naturalHeight.toString().replace(`px`,``));n.imageAspectRatio=a/o;let{labelStyles:s}=E(n);n.labelStyle=s;let c=r?.wrappingWidth;n.defaultWidth=r?.wrappingWidth;let l=Math.max(n.label?c??0:0,n?.assetWidth??a),u=n.constraint===`on`&&n?.assetHeight?n.assetHeight*n.imageAspectRatio:l,d=n.constraint===`on`?u/n.imageAspectRatio:n?.assetHeight??o;n.width=Math.max(u,c??0);let{shapeSvg:f,bbox:p,label:m}=await G(e,n,`image-shape default`),h=n.pos===`t`,g=-u/2,_=-d/2,v=n.label?8:0,y=W.svg(f),b=D(n,{});n.look!==`handDrawn`&&(b.roughness=0,b.fillStyle=`solid`);let x=y.rectangle(g,_,u,d,b),S=Math.max(u,p.width),C=d+p.height+v,w=y.rectangle(-S/2,-C/2,S,C,{...b,fill:`none`,stroke:`none`}),T=f.insert(()=>x,`:first-child`),O=f.insert(()=>w);if(n.img){let e=f.append(`image`);e.attr(`href`,n.img),e.attr(`width`,u),e.attr(`height`,d),e.attr(`preserveAspectRatio`,`none`),e.attr(`transform`,`translate(${-u/2},${h?C/2-d:-C/2})`)}return m.attr(`transform`,`translate(${-p.width/2-(p.x-(p.left??0))},${h?-d/2-p.height/2-v/2:d/2-p.height/2+v/2})`),T.attr(`transform`,`translate(0,${h?p.height/2+v/2:-p.height/2-v/2})`),K(n,O),n.intersect=function(e){if(t.info(`iconSquare intersect`,n,e),!n.label)return X.rect(n,e);let r=n.x??0,i=n.y??0,a=n.height??0,o=[];return o=h?[{x:r-p.width/2,y:i-a/2},{x:r+p.width/2,y:i-a/2},{x:r+p.width/2,y:i-a/2+p.height+v},{x:r+u/2,y:i-a/2+p.height+v},{x:r+u/2,y:i+a/2},{x:r-u/2,y:i+a/2},{x:r-u/2,y:i-a/2+p.height+v},{x:r-p.width/2,y:i-a/2+p.height+v}]:[{x:r-u/2,y:i-a/2},{x:r+u/2,y:i-a/2},{x:r+u/2,y:i-a/2+d},{x:r+p.width/2,y:i-a/2+d},{x:r+p.width/2/2,y:i+a/2},{x:r-p.width/2,y:i+a/2},{x:r-p.width/2,y:i-a/2+d},{x:r-u/2,y:i-a/2+d}],X.polygon(n,o,e)},f}e(bn,`imageSquare`);async function xn(e,t){let{labelStyles:n,nodeStyles:r}=E(t);t.labelStyle=n;let i=t.padding??0,a=i,o=t.look===`neo`?i*2:i,{shapeSvg:s,bbox:c}=await G(e,t,q(t)),l=Math.max(c.height+a*2,t.height??0),u=Math.max(c.width+o*2,(t.width??0)-l),d=[{x:0,y:0},{x:u,y:0},{x:u+3*l/6,y:-l},{x:-3*l/6,y:-l}],f,{cssStyles:p}=t;if(t.look===`handDrawn`){let e=W.svg(s),n=D(t,{}),r=J(d),i=e.path(r,n);f=s.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-u/2}, ${l/2})`),p&&f.attr(`style`,p)}else f=wt(s,u,l,d);return r&&f.attr(`style`,r),t.width=u,t.height=l,K(t,f),t.intersect=function(e){return X.polygon(t,d,e)},s}e(xn,`inv_trapezoid`);async function Sn(e,t){let{shapeSvg:n,bbox:r,label:i}=await G(e,t,`label`),a=n.insert(`rect`,`:first-child`);return a.attr(`width`,.1).attr(`height`,.1),n.attr(`class`,`label edgeLabel`),i.attr(`transform`,`translate(${-(r.width/2)-(r.x-(r.left??0))}, ${-(r.height/2)-(r.y-(r.top??0))})`),K(t,a),t.intersect=function(e){return X.rect(t,e)},n}e(Sn,`labelRect`);async function Cn(e,t){let{labelStyles:n,nodeStyles:r}=E(t);t.labelStyle=n;let i=t.padding??0,a=i,o=t.look===`neo`?i*2:i,{shapeSvg:s,bbox:c}=await G(e,t,q(t)),l=Math.max(c.height+a,t.height??0),u=Math.max(c.width+o,(t.width??0)-l),d=[{x:0,y:0},{x:u+3*l/6,y:0},{x:u,y:-l},{x:-(3*l)/6,y:-l}],f,{cssStyles:p}=t;if(t.look===`handDrawn`){let e=W.svg(s),n=D(t,{}),r=J(d),i=e.path(r,n);f=s.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-u/2}, ${l/2})`),p&&f.attr(`style`,p)}else f=wt(s,u,l,d);return r&&f.attr(`style`,r),t.width=u,t.height=l,K(t,f),t.intersect=function(e){return X.polygon(t,d,e)},s}e(Cn,`lean_left`);async function wn(e,t){let{labelStyles:n,nodeStyles:r}=E(t);t.labelStyle=n;let i=t.padding??0,a=i,o=t.look===`neo`?i*2:i,{shapeSvg:s,bbox:c}=await G(e,t,q(t)),l=Math.max(c.height+a,t.height??0),u=Math.max(c.width+o,(t.width??0)-l),d=[{x:-3*l/6,y:0},{x:u,y:0},{x:u+3*l/6,y:-l},{x:0,y:-l}],f,{cssStyles:p}=t;if(t.look===`handDrawn`){let e=W.svg(s),n=D(t,{}),r=J(d),i=e.path(r,n);f=s.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-u/2}, ${l/2})`),p&&f.attr(`style`,p)}else f=wt(s,u,l,d);return r&&f.attr(`style`,r),t.width=u,t.height=l,K(t,f),t.intersect=function(e){return X.polygon(t,d,e)},s}e(wn,`lean_right`);function Tn(e,n){let{labelStyles:r,nodeStyles:i}=E(n);n.label=``,n.labelStyle=r;let a=e.insert(`g`).attr(`class`,q(n)).attr(`id`,n.domId??n.id),{cssStyles:o}=n,s=Math.max(35,n?.width??0),c=Math.max(35,n?.height??0),l=[{x:s,y:0},{x:0,y:c+7/2},{x:s-14,y:c+7/2},{x:0,y:2*c},{x:s,y:c-7/2},{x:14,y:c-7/2}],u=W.svg(a),d=D(n,{});n.look!==`handDrawn`&&(d.roughness=0,d.fillStyle=`solid`);let f=J(l),p=u.path(f,d),m=a.insert(()=>p,`:first-child`);return m.attr(`class`,`outer-path`),o&&n.look!==`handDrawn`&&m.selectAll(`path`).attr(`style`,o),i&&n.look!==`handDrawn`&&m.selectAll(`path`).attr(`style`,i),m.attr(`transform`,`translate(-${s/2},${-c})`),K(n,m),n.intersect=function(e){return t.info(`lightningBolt intersect`,n,e),X.polygon(n,l,e)},a}e(Tn,`lightningBolt`);var En=e((e,t,n,r,i,a,o)=>[`M${e},${t+a}`,`a${i},${a} 0,0,0 ${n},0`,`a${i},${a} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${a} 0,0,0 ${n},0`,`l0,${-r}`,`M${e},${t+a+o}`,`a${i},${a} 0,0,0 ${n},0`].join(` `),`createCylinderPathD`),Dn=e((e,t,n,r,i,a,o)=>[`M${e},${t+a}`,`M${e+n},${t+a}`,`a${i},${a} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${a} 0,0,0 ${n},0`,`l0,${-r}`,`M${e},${t+a+o}`,`a${i},${a} 0,0,0 ${n},0`].join(` `),`createOuterCylinderPathD`),On=e((e,t,n,r,i,a)=>[`M${e-n/2},${-r/2}`,`a${i},${a} 0,0,0 ${n},0`].join(` `),`createInnerCylinderPathD`),kn=10,An=10;async function jn(e,t){let{labelStyles:n,nodeStyles:r}=E(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?24:i;if(t.width||t.height){let e=t.width??0;t.width=(t.width??0)-a,t.width<An&&(t.width=An);let n=e/2/(2.5+e/50);t.height=(t.height??0)-o-n*3,t.height<kn&&(t.height=kn)}let{shapeSvg:s,bbox:c,label:l}=await G(e,t,q(t)),u=(t?.width?t?.width:c.width)+a*2,d=u/2,f=d/(2.5+u/50),p=(t?.height?t?.height:c.height)+f+o*2,m=p*.1,h,{cssStyles:g}=t;if(t.look===`handDrawn`){let e=W.svg(s),n=Dn(0,0,u,p,d,f,m),r=On(0,f,u,p,d,f),i=D(t,{}),a=e.path(n,i),o=e.path(r,i);s.insert(()=>o,`:first-child`).attr(`class`,`line`),h=s.insert(()=>a,`:first-child`),h.attr(`class`,`basic label-container`),g&&h.attr(`style`,g)}else{let e=En(0,0,u,p,d,f,m);h=s.insert(`path`,`:first-child`).attr(`d`,e).attr(`class`,`basic label-container outer-path`).attr(`style`,_(g)).attr(`style`,r)}return h.attr(`label-offset-y`,f),h.attr(`transform`,`translate(${-u/2}, ${-(p/2+f)})`),K(t,h),l.attr(`transform`,`translate(${-(c.width/2)-(c.x-(c.left??0))}, ${-(c.height/2)+f-(c.y-(c.top??0))})`),t.intersect=function(e){let n=X.rect(t,e),r=n.x-(t.x??0);if(d!=0&&(Math.abs(r)<(t.width??0)/2||Math.abs(r)==(t.width??0)/2&&Math.abs(n.y-(t.y??0))>(t.height??0)/2-f)){let i=f*f*(1-r*r/(d*d));i>0&&(i=Math.sqrt(i)),i=f-i,e.y-(t.y??0)>0&&(i=-i),n.y+=i}return n},s}e(jn,`linedCylinder`);async function Mn(e,t){let{labelStyles:n,nodeStyles:r}=E(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i;(t.width||t.height)&&(t.width=(t.width??0)*10/11-a*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-o*2,t.height<10&&(t.height=10));let{shapeSvg:s,bbox:c,label:l}=await G(e,t,q(t)),u=(t?.width?t?.width:c.width)+(a??0)*2,d=(t?.height?t?.height:c.height)+(o??0)*2,f=t.look===`neo`?d/4:d/8,p=d+f,{cssStyles:m}=t,h=W.svg(s),g=D(t,{});t.look!==`handDrawn`&&(g.roughness=0,g.fillStyle=`solid`);let _=[{x:-u/2-u/2*.1,y:-p/2},{x:-u/2-u/2*.1,y:p/2},...$e(-u/2-u/2*.1,p/2,u/2+u/2*.1,p/2,f,.8),{x:u/2+u/2*.1,y:-p/2},{x:-u/2-u/2*.1,y:-p/2},{x:-u/2,y:-p/2},{x:-u/2,y:p/2*1.1},{x:-u/2,y:-p/2}],v=h.polygon(_.map(e=>[e.x,e.y]),g),y=s.insert(()=>v,`:first-child`);return y.attr(`class`,`basic label-container outer-path`),m&&t.look!==`handDrawn`&&y.selectAll(`path`).attr(`style`,m),r&&t.look!==`handDrawn`&&y.selectAll(`path`).attr(`style`,r),y.attr(`transform`,`translate(0,${-f/2})`),l.attr(`transform`,`translate(${-u/2+(t.padding??0)+u/2*.1/2-(c.x-(c.left??0))},${-d/2+(t.padding??0)-f-(c.y-(c.top??0))})`),K(t,y),t.intersect=function(e){return X.polygon(t,_,e)},s}e(Mn,`linedWaveEdgedRect`);var Nn=56,Pn=72,Fn=8,In=2,Ln=8,Rn={normal:`usecase-actor-shape usecase-actor-normal`,hollow:`usecase-actor-hollow`,awesome:`usecase-actor-awesome`,icon:`usecase-actor-icon`},zn=Math.PI/3,Bn=.6,Vn=e((e,t)=>{let n=t*Bn,r=t*Math.sqrt(1-Bn**2),i=Math.cos(zn),a=-Math.sin(zn),o=n*-a,s=e+n*i,c=r*i,l=r*a;return`M ${o-c} ${s-l} L ${o+c} ${s+l}`},`businessMarkerPathForCircle`),Hn={normal:Vn(-24,12),hollow:Vn(-23,9),awesome:Vn(-21,13),icon:`M 12 -8 L 26 -26`},Un=e((e,t,n)=>{let r=(t.x??0)-(t.left??0),i=(t.y??0)-(t.top??0);e.attr(`transform`,`translate(${-t.width/2-r},${n-t.height/2-i})`)},`positionLabel`),Wn=e((e,t,n,r,i=!1)=>{if(t.look===`handDrawn`){let a=W.svg(e).path(n,D(t,i?{fill:`none`}:{}));return e.insert(()=>a,`:first-child`).attr(`class`,r)}let a=e.append(`path`).attr(`class`,r).attr(`d`,n);return i&&a.attr(`fill`,`none`),a},`appendActorPath`),Gn=e((e,t,n,r,i,a,o=!1)=>{if(t.look===`handDrawn`){let s=W.svg(e).circle(n,r,i*2,D(t,o?{fill:`none`}:{}));return e.insert(()=>s,`:first-child`).attr(`class`,a)}let s=e.append(`circle`).attr(`class`,a).attr(`cx`,n).attr(`cy`,r).attr(`r`,i);return o&&s.attr(`fill`,`none`),s},`appendActorCircle`),Kn=e((e,t,n)=>{t.business&&e.append(`path`).attr(`class`,`usecase-business-marker usecase-actor-business-marker`).attr(`d`,Hn[n]).attr(`fill`,`none`).attr(`style`,`stroke: inherit !important; stroke-width: inherit !important`)},`appendBusinessActorMarker`);async function qn(e,t,n,r){let{labelStyles:i,nodeStyles:o}=E(t);t.labelStyle=i;let{shapeSvg:s,bbox:c,label:l}=await G(e,n===`icon`||t.stereotype!==void 0?{...t,icon:n===`icon`?void 0:t.icon,stereotype:void 0}:t,q(t,`usecase-actor-variant usecase-actor-${n}`)),u=t.accessibleName??t.label;u&&s.attr(`role`,`img`).attr(`aria-label`,u),l.attr(`class`,`label actor-label usecase-actor-label`);let{theme:d,themeVariables:f}=a();b(s,t.colorIndex,d,f.borderColorArray);let p,m;if(t.stereotype){let e=await Qe(s,`\xAB${t.stereotype}\xBB`,{labelStyle:i,useHtmlLabels:t.useHtmlLabels,padding:0,centerLabel:!0,width:t.wrappingWidth});p=e.label.attr(`class`,`label usecase-stereotype`),m=e.bbox}let h=s.append(`g`).attr(`class`,`usecase-actor-glyph ${Rn[n]}`).attr(`style`,o||null);await r(h,t),Kn(h,t,n);let g=t.padding??Ln,_=m?.height??0,v=Pn+Fn+c.height+(m?_+In:0),y=Math.max(Nn,c.width,m?.width??0)+g*2,x=v+g*2,S=-v/2;h.attr(`transform`,`translate(0,${S+Pn/2})`);let C=S+Pn+Fn;return p&&m&&(C+=_/2,Un(p,m,C),C+=_/2+In),Un(l,c,C+c.height/2),K(t,s.insert(`rect`,`:first-child`).attr(`class`,`usecase-actor-outline`).attr(`x`,-y/2).attr(`y`,-x/2).attr(`width`,y).attr(`height`,x).attr(`opacity`,0).attr(`aria-hidden`,`true`)),t.intersect=e=>X.rect(t,e),s}e(qn,`renderUsecaseActor`);var Jn=[`M 0 -12`,`C 6.627 -12 12 -17.373 12 -24`,`C 12 -30.627 6.627 -36 0 -36`,`C -6.627 -36 -12 -30.627 -12 -24`,`C -12 -17.373 -6.627 -12 0 -12 Z`,`M 0 -12 V 8`,`M -17 -5 H 17`,`M 0 8 L -15 28`,`M 0 8 L 15 28`].join(` `);async function Yn(e,t){return qn(e,t,`normal`,(e,t)=>{Wn(e,t,Jn,`usecase-actor-stick`)})}e(Yn,`usecaseActor`);var Xn=[`M 0 -34`,`C 7.18 -34 13 -28.18 13 -21`,`C 13 -13.82 7.18 -8 0 -8`,`C -7.18 -8 -13 -13.82 -13 -21`,`C -13 -28.18 -7.18 -34 0 -34 Z`,`M -24 25`,`C -24 7 -14 -3 0 -3`,`C 14 -3 24 7 24 25`,`C 24 28 21 30 18 30`,`H -18`,`C -21 30 -24 28 -24 25 Z`].join(` `);async function Zn(e,t){return qn(e,t,`awesome`,(e,t)=>{Wn(e,t,Xn,`usecase-actor-awesome-silhouette`)})}e(Zn,`usecaseActorAwesome`);var Qn=[`M -22 -10`,`H 22`,`V 0`,`H 6`,`L 22 17`,`L 13 28`,`L 0 13`,`L -13 28`,`L -22 17`,`L -6 0`,`H -22`,`Z`].join(` `);async function $n(e,t){return qn(e,t,`hollow`,(e,t)=>{Gn(e,t,0,-23,9,`usecase-actor-hollow-head`,!0),Wn(e,t,Qn,`usecase-actor-hollow-body`,!0)})}e($n,`usecaseActorHollow`);var er=52,tr=42,nr=-2,rr=e(async(e,t)=>{let n=-er/2,r=nr-er/2;if(t.look===`handDrawn`){let i=W.svg(e).rectangle(n,r,er,er,D(t,{}));e.insert(()=>i,`:first-child`).attr(`class`,`usecase-actor-icon-frame`)}else e.append(`rect`).attr(`class`,`usecase-actor-icon-frame`).attr(`x`,n).attr(`y`,r).attr(`width`,er).attr(`height`,er).attr(`rx`,4).attr(`ry`,4);let i=t.icon??``,a=await m(i.includes(`:`)?i:`fa:${i}`),o=await f(i,{height:tr,width:tr,fallbackPrefix:`fa`}),s=e.append(`g`).attr(`class`,`usecase-actor-icon-symbol${a?``:` usecase-actor-icon-fallback`}`).attr(`aria-hidden`,`true`).html(`<g>${o}</g>`),c=s.node()?.getBBox();c&&s.attr(`transform`,`translate(${-c.width/2-c.x},${nr-c.height/2-c.y})`)},`drawIconActor`);async function ir(e,t){return qn(e,t,`icon`,rr)}e(ir,`usecaseActorIcon`);var ar=e((e,t,n)=>{let r=(t.x??0)-(t.left??0),i=(t.y??0)-(t.top??0);e.attr(`transform`,`translate(${-t.width/2-r},${n-t.height/2-i})`)},`positionLabel`);async function or(e,t){let n=t,{labelStyles:r,nodeStyles:i}=E(t);t.labelStyle=r;let{shapeSvg:o,bbox:s,halfPadding:c,label:l}=await G(e,n.stereotype?{...t,stereotype:void 0}:t,q(t,`usecase-business-shape`));l.attr(`class`,`label usecase-label`);let{theme:u,themeVariables:d}=a();b(o,t.colorIndex,u,d.borderColorArray);let f,p;if(n.stereotype){let e=await Qe(o,`\xAB${n.stereotype}\xBB`,{labelStyle:r,useHtmlLabels:t.useHtmlLabels,padding:0,centerLabel:!0,width:t.wrappingWidth});f=e.label.attr(`class`,`label usecase-stereotype`),p=e.bbox}let m=p?2:0,h=s.height+(p?.height??0)+m,g=Math.max(s.width,p?.width??0),_=c??10,v=g/2+_*2,y=h/2+_*2,x=Math.min(Math.max(_/5,1),_/2),S=g/2+x,C=v-x,w=S/v,T=C/v,O=y*Math.sqrt(Math.max(0,1-w*w)),k=-y*Math.sqrt(Math.max(0,1-T*T));f&&p&&ar(f,p,-h/2+p.height/2),ar(l,s,h/2-s.height/2);let A;if(t.look===`handDrawn`){let e=W.svg(o).ellipse(0,0,v*2,y*2,D(t,{}));A=o.insert(()=>e,`:first-child`).attr(`class`,`basic label-container usecase-business-ellipse`)}else A=o.insert(`ellipse`,`:first-child`).attr(`class`,`basic label-container usecase-business-ellipse`).attr(`style`,i).attr(`rx`,v).attr(`ry`,y).attr(`cx`,0).attr(`cy`,0);o.append(`path`).attr(`class`,`usecase-business-marker`).attr(`d`,`M ${S} ${O} L ${C} ${k}`).attr(`fill`,`none`).attr(`style`,i||null);let j=n.accessibleName??n.label;return j&&o.attr(`role`,`img`).attr(`aria-label`,j),K(t,A),t.calcIntersect=(e,t)=>X.ellipse(e,e.width/2,e.height/2,t),t.intersect=e=>X.ellipse(t,v,y,e),o}e(or,`usecaseBusiness`);var sr=8,cr=4,lr=1,ur=e((e,t,n,r)=>{let i=(t.x??0)-(t.left??0),a=(t.y??0)-(t.top??0);e.attr(`transform`,`translate(${n-t.width/2-i},${r-t.height/2-a})`)},`positionLabel`),dr=e(e=>{let t=Number.parseFloat(e??``);return Number.isFinite(t)&&t>=0?t:lr},`numericStrokeWidth`);async function fr(t,n){let r=n,{labelStyles:i,nodeStyles:a}=E(n),{stylesMap:o}=C(n);n.labelStyle=i;let{shapeSvg:s,bbox:c,label:l}=await G(t,n,q(n,`usecase-json-table`));s.attr(`role`,`img`),r.accessibleName&&s.attr(`aria-label`,r.accessibleName),l.attr(`class`,`label usecase-json-title`);let u=s.append(`g`).attr(`class`,`usecase-json-table-grid`),d=[];for(let e of r.jsonRows??[]){let t=await Qe(u,e.key,{labelStyle:i,useHtmlLabels:n.useHtmlLabels,padding:0,centerLabel:!0}),r=await Qe(u,e.value,{labelStyle:i,useHtmlLabels:n.useHtmlLabels,padding:0,centerLabel:!0});d.push({key:{label:t.label.attr(`class`,`label usecase-json-key`),bbox:t.bbox},value:{label:r.label.attr(`class`,`label usecase-json-value`),bbox:r.bbox}})}let f=Math.max(0,...d.map(({key:e})=>e.bbox.width))+sr*2,p=Math.max(0,...d.map(({value:e})=>e.bbox.width))+sr*2,m=c.width+sr*2,h=Math.max(m,f+p),g=p+Math.max(0,h-f-p),_=c.height+cr*2,v=d.map(({key:e,value:t})=>Math.max(e.bbox.height,t.bbox.height)+cr*2),y=_+v.reduce((e,t)=>e+t,0),b=dr(o.get(`stroke-width`)),x=h+b*2,S=y+b*2,w=-h/2,T=-y/2,O=n.look===`handDrawn`?W.svg(s):void 0,k=O?D(n,{}):void 0,A=e((e,t,n,r,i,o)=>{if(O&&k){let a=O.rectangle(n,r,i,o,k);return e.insert(()=>a,`:first-child`).attr(`class`,t)}return e.insert(`rect`,`:first-child`).attr(`class`,t).attr(`x`,n).attr(`y`,r).attr(`width`,i).attr(`height`,o).attr(`style`,a)},`insertCell`),j=A(s,`label-container usecase-json-border`,-x/2,-S/2,x,S);A(u,`usecase-json-cell usecase-json-title-cell`,w,T,h,_),u.node()?.append(l.node()),ur(l,c,0,T+_/2);let M=T+_;return d.forEach(({key:e,value:t},n)=>{let r=v[n],i=u.append(`g`).attr(`class`,`usecase-json-row`).attr(`data-row-index`,n).attr(`transform`,`translate(0,${M})`);A(i,`usecase-json-cell usecase-json-key-cell`,w,0,f,r),A(i,`usecase-json-cell usecase-json-value-cell`,w+f,0,g,r),i.node()?.append(e.label.node(),t.label.node()),ur(e.label,e.bbox,w+f/2,r/2),ur(t.label,t.bbox,w+f+g/2,r/2),M+=r}),K(n,j),n.intersect=e=>X.rect(n,e),s}e(fr,`usecaseJsonTable`);async function pr(e,t){let{labelStyles:n,nodeStyles:r}=E(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i,s=t.look===`neo`?10:5;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-a*2-2*s,10),t.height=Math.max((t?.height??0)-o*2-2*s,10));let{shapeSvg:c,bbox:l,label:u}=await G(e,t,q(t)),d=(t?.width?t?.width:l.width)+a*2+2*s,f=(t?.height?t?.height:l.height)+o*2+2*s,p=d-2*s,m=f-2*s,h=-p/2,g=-m/2,{cssStyles:_}=t,v=W.svg(c),y=D(t,{}),b=[{x:h-s,y:g+s},{x:h-s,y:g+m+s},{x:h+p-s,y:g+m+s},{x:h+p-s,y:g+m},{x:h+p,y:g+m},{x:h+p,y:g+m-s},{x:h+p+s,y:g+m-s},{x:h+p+s,y:g-s},{x:h+s,y:g-s},{x:h+s,y:g},{x:h,y:g},{x:h,y:g+s}],x=[{x:h,y:g+s},{x:h+p-s,y:g+s},{x:h+p-s,y:g+m},{x:h+p,y:g+m},{x:h+p,y:g},{x:h,y:g}];t.look!==`handDrawn`&&(y.roughness=0,y.fillStyle=`solid`);let S=J(b),C=v.path(S,y),w=J(x),T=v.path(w,y);t.look!==`handDrawn`&&(C=et(C),T=et(T));let O=c.insert(`g`,`:first-child`);return O.insert(()=>C),O.insert(()=>T),O.attr(`class`,`basic label-container outer-path`),_&&t.look!==`handDrawn`&&O.selectAll(`path`).attr(`style`,_),r&&t.look!==`handDrawn`&&O.selectAll(`path`).attr(`style`,r),u.attr(`transform`,`translate(${-(l.width/2)-s-(l.x-(l.left??0))}, ${-(l.height/2)+s-(l.y-(l.top??0))})`),K(t,O),t.intersect=function(e){return X.polygon(t,b,e)},c}e(pr,`multiRect`);async function mr(e,t){let{labelStyles:n,nodeStyles:r}=E(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await G(e,t,q(t)),s=t.padding??0,c=t.look===`neo`?16:s,l=t.look===`neo`?12:s,u=!0;(t.width||t.height)&&(u=!1,t.width=(t?.width??0)-c*2,t.height=(t?.height??0)-l*3);let d=Math.max(a.width,t?.width??0)+c*2,f=Math.max(a.height,t?.height??0)+l*3,p=t.look===`neo`?f/4:f/8,m=f+(u?p/2:-p/2),h=-d/2,g=-m/2,{cssStyles:_}=t,v=$e(h-10,g+m+10,h+d-10,g+m+10,p,.8),y=v?.[v.length-1],b=[{x:h-10,y:g+10},{x:h-10,y:g+m+10},...v,{x:h+d-10,y:y.y-10},{x:h+d,y:y.y-10},{x:h+d,y:y.y-20},{x:h+d+10,y:y.y-20},{x:h+d+10,y:g-10},{x:h+10,y:g-10},{x:h+10,y:g},{x:h,y:g},{x:h,y:g+10}],x=[{x:h,y:g+10},{x:h+d-10,y:g+10},{x:h+d-10,y:y.y-10},{x:h+d,y:y.y-10},{x:h+d,y:g},{x:h,y:g}],S=W.svg(i),C=D(t,{});t.look!==`handDrawn`&&(C.roughness=0,C.fillStyle=`solid`);let w=J(b),T=S.path(w,C),O=J(x),k=S.path(O,C),A=i.insert(()=>T,`:first-child`);return A.insert(()=>k),A.attr(`class`,`basic label-container outer-path`),_&&t.look!==`handDrawn`&&A.selectAll(`path`).attr(`style`,_),r&&t.look!==`handDrawn`&&A.selectAll(`path`).attr(`style`,r),A.attr(`transform`,`translate(0,${-p/2})`),o.attr(`transform`,`translate(${-(a.width/2)-10-(a.x-(a.left??0))}, ${-(a.height/2)+10-p-(a.y-(a.top??0))})`),K(t,A),t.intersect=function(e){return X.polygon(t,b,e)},i}e(mr,`multiWaveEdgedRectangle`);async function hr(e,t,{config:{themeVariables:n}}){let{labelStyles:r,nodeStyles:i}=E(t);t.labelStyle=r,t.useHtmlLabels||l(u())||(t.centerLabel=!0);let{shapeSvg:a,bbox:o,label:s}=await G(e,t,q(t)),c=Math.max(o.width+(t.padding??0)*2,t?.width??0),d=Math.max(o.height+(t.padding??0)*2,t?.height??0),f=-c/2,p=-d/2,{cssStyles:m}=t,h=W.svg(a),g=D(t,{fill:n.noteBkgColor,stroke:n.noteBorderColor});t.look!==`handDrawn`&&(g.roughness=0,g.fillStyle=`solid`);let _=h.rectangle(f,p,c,d,g),v=a.insert(()=>_,`:first-child`);return v.attr(`class`,`basic label-container outer-path`),s.attr(`class`,`label noteLabel`),m&&t.look!==`handDrawn`&&v.selectAll(`path`).attr(`style`,m),i&&t.look!==`handDrawn`&&v.selectAll(`path`).attr(`style`,i),s.attr(`transform`,`translate(${-o.width/2-(o.x-(o.left??0))}, ${-(o.height/2)-(o.y-(o.top??0))})`),K(t,v),t.intersect=function(e){return X.rect(t,e)},a}e(hr,`note`);var gr=e((e,t,n)=>[`M${e+n/2},${t}`,`L${e+n},${t-n/2}`,`L${e+n/2},${t-n}`,`L${e},${t-n/2}`,`Z`].join(` `),`createDecisionBoxPathD`);async function _r(e,t){let{labelStyles:n,nodeStyles:r}=E(t);t.labelStyle=n;let{shapeSvg:i,bbox:a}=await G(e,t,q(t)),o=a.width+(t.padding??0)+(a.height+(t.padding??0)),s=.5,c=[{x:o/2,y:0},{x:o,y:-o/2},{x:o/2,y:-o},{x:0,y:-o/2}],l,{cssStyles:u}=t;if(t.look===`handDrawn`){let e=W.svg(i),n=D(t,{}),r=gr(0,0,o),a=e.path(r,n);l=i.insert(()=>a,`:first-child`).attr(`transform`,`translate(${-o/2+s}, ${o/2})`),u&&l.attr(`style`,u)}else l=wt(i,o,o,c),l.attr(`transform`,`translate(${-o/2+s}, ${o/2})`);return r&&l.attr(`style`,r),K(t,l),t.calcIntersect=function(e,t){let n=e.width,r=[{x:n/2,y:0},{x:n,y:-n/2},{x:n/2,y:-n},{x:0,y:-n/2}];return X.polygon(e,r,t)},t.intersect=function(e){return this.calcIntersect(t,e)},i}e(_r,`question`);async function vr(e,t){let{labelStyles:n,nodeStyles:r}=E(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?21:i??0,o=t.look===`neo`?12:i??0,{shapeSvg:s,bbox:c,label:l}=await G(e,t,q(t)),u=c.width+(t.look===`neo`?a*2:a),d=Math.max(c.height+(t.look===`neo`?o*2:o),t.height??0),f=d/4,p=-Math.max(u,(t.width??0)-f)/2,m=-d/2,h=m/2,g=[{x:p+h,y:m},{x:p,y:0},{x:p+h,y:-m},{x:-p,y:-m},{x:-p,y:m}],{cssStyles:_}=t,v=W.svg(s),y=D(t,{});t.look!==`handDrawn`&&(y.roughness=0,y.fillStyle=`solid`);let b=J(g),x=v.path(b,y),S=s.insert(()=>x,`:first-child`);return S.attr(`class`,`basic label-container outer-path`),_&&t.look!==`handDrawn`&&S.selectAll(`path`).attr(`style`,_),r&&t.look!==`handDrawn`&&S.selectAll(`path`).attr(`style`,r),S.attr(`transform`,`translate(${-h/2},0)`),l.attr(`transform`,`translate(${-h/2-c.width/2-(c.x-(c.left??0))}, ${-(c.height/2)-(c.y-(c.top??0))})`),K(t,S),t.intersect=function(e){return X.polygon(t,g,e)},s}e(vr,`rect_left_inv_arrow`);async function yr(e,r){let{labelStyles:i,nodeStyles:o}=E(r);r.labelStyle=i;let s;s=r.cssClasses?`node `+r.cssClasses:`node default`;let c=e.insert(`g`).attr(`class`,s).attr(`id`,r.domId||r.id),u=c.insert(`g`),d=c.insert(`g`).attr(`class`,`label`).attr(`style`,o),f=r.description,p=r.label,m=await ft(d,p,r.labelStyle,!0,!0),h={width:0,height:0};if(l(a())){let e=m.children[0],t=n(m);h=e.getBoundingClientRect(),t.attr(`width`,h.width),t.attr(`height`,h.height)}t.info(`Text 2`,f);let g=f||[],_=m.getBBox(),v=await ft(d,Array.isArray(g)?g.join(`<br/>`):g,r.labelStyle,!0,!0),y=v.children[0],b=n(v);h=y.getBoundingClientRect(),b.attr(`width`,h.width),b.attr(`height`,h.height);let x=(r.padding||0)/2;n(v).attr(`transform`,`translate( `+(h.width>_.width?0:(_.width-h.width)/2)+`, `+(_.height+x+5)+`)`),n(m).attr(`transform`,`translate( `+(h.width<_.width?0:-(_.width-h.width)/2)+`, 0)`),h=d.node().getBBox(),d.attr(`transform`,`translate(`+-h.width/2+`, `+(-h.height/2-x+3)+`)`);let S=h.width+(r.padding||0),C=h.height+(r.padding||0),w=-h.width/2-x,T=-h.height/2-x,O,k;if(r.look===`handDrawn`){let e=W.svg(c),n=D(r,{}),i=e.path(Z(w,T,S,C,r.rx||0),n),a=e.line(-h.width/2-x,-h.height/2-x+_.height+x,h.width/2+x,-h.height/2-x+_.height+x,n);k=c.insert(()=>(t.debug(`Rough node insert CXC`,i),a),`:first-child`),O=c.insert(()=>(t.debug(`Rough node insert CXC`,i),i),`:first-child`)}else O=u.insert(`rect`,`:first-child`),k=u.insert(`line`),O.attr(`class`,`outer title-state`).attr(`style`,o).attr(`x`,-h.width/2-x).attr(`y`,-h.height/2-x).attr(`width`,h.width+(r.padding||0)).attr(`height`,h.height+(r.padding||0)),k.attr(`class`,`divider`).attr(`x1`,-h.width/2-x).attr(`x2`,h.width/2+x).attr(`y1`,-h.height/2-x+_.height+x).attr(`y2`,-h.height/2-x+_.height+x);return K(r,O),r.intersect=function(e){return X.rect(r,e)},c}e(yr,`rectWithTitle`);async function br(e,t,{config:{themeVariables:n}}){let r=n?.radius??5;return en(e,t,{rx:r,ry:r,classes:``,labelPaddingX:(t?.padding??0)*1,labelPaddingY:(t?.padding??0)*1})}e(br,`roundedRect`);var xr=8;async function Sr(e,t){let{labelStyles:n,nodeStyles:r}=E(t);t.labelStyle=n;let i=t.look===`neo`?16:t.padding??0,a=t.look===`neo`?12:t.padding??0,{shapeSvg:o,bbox:s,label:c}=await G(e,t,q(t)),l=(t?.width??s.width)+i*2+(t.look===`neo`?xr:xr*2),u=(t?.height??s.height)+a*2,d=l-xr,f=u,p=xr-l/2,m=-u/2,{cssStyles:h}=t,g=W.svg(o),v=D(t,{});t.look!==`handDrawn`&&(v.roughness=0,v.fillStyle=`solid`);let y=[{x:p,y:m},{x:p+d,y:m},{x:p+d,y:m+f},{x:p-xr,y:m+f},{x:p-xr,y:m},{x:p,y:m},{x:p,y:m+f}],b=g.polygon(y.map(e=>[e.x,e.y]),v),x=o.insert(()=>b,`:first-child`);return x.attr(`class`,`basic label-container outer-path`).attr(`style`,_(h)),r&&t.look!==`handDrawn`&&x.selectAll(`path`).attr(`style`,r),h&&t.look!==`handDrawn`&&x.selectAll(`path`).attr(`style`,r),c.attr(`transform`,`translate(${xr/2-s.width/2-(s.x-(s.left??0))}, ${-(s.height/2)-(s.y-(s.top??0))})`),K(t,x),t.intersect=function(e){return X.rect(t,e)},o}e(Sr,`shadedProcess`);async function Cr(e,t){let{labelStyles:n,nodeStyles:r}=E(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-a*2,10),t.height=Math.max((t?.height??0)/1.5-o*2,10));let{shapeSvg:s,bbox:c,label:l}=await G(e,t,q(t)),u=(t?.width?t?.width:c.width)+a*2,d=((t?.height?t?.height:c.height)+o*2)*1.5,f=u,p=d/1.5,m=-f/2,h=-p/2,{cssStyles:g}=t,_=W.svg(s),v=D(t,{});t.look!==`handDrawn`&&(v.roughness=0,v.fillStyle=`solid`);let y=[{x:m,y:h},{x:m,y:h+p},{x:m+f,y:h+p},{x:m+f,y:h-p/2}],b=J(y),x=_.path(b,v),S=s.insert(()=>x,`:first-child`);return S.attr(`class`,`basic label-container outer-path`),g&&t.look!==`handDrawn`&&S.selectChildren(`path`).attr(`style`,g),r&&t.look!==`handDrawn`&&S.selectChildren(`path`).attr(`style`,r),S.attr(`transform`,`translate(0, ${p/4})`),l.attr(`transform`,`translate(${-f/2+(t.padding??0)-(c.x-(c.left??0))}, ${-p/4+(t.padding??0)-(c.y-(c.top??0))})`),K(t,S),t.intersect=function(e){return X.polygon(t,y,e)},s}e(Cr,`slopedRect`);async function wr(e,t){let n=t.padding??0,r=t.look===`neo`?16:n*2,i=t.look===`neo`?12:n,o=await en(e,t,{rx:0,ry:0,classes:``,labelPaddingX:t.labelPaddingX??r,labelPaddingY:i});if(t.colorIndex!==void 0){let{theme:e,themeVariables:n}=a();b(o,t.colorIndex,e,n.borderColorArray)}return o}e(wr,`squareRect`);var Tr=50,Er=e((e,t,n)=>{let r=e.height+n,i=r*Math.cos(Math.PI/(2*(Tr-1))),a=Math.sqrt(Math.max(0,i**2-e.height**2));return{w:Math.max(e.width+r/4+t,1.5*r+(r-i),e.width+t+r-a),h:r}},`stadiumDimensions`);async function Dr(e,t){let{labelStyles:n,nodeStyles:r}=E(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?40:i,o=t.look===`neo`?24:i,{shapeSvg:s,bbox:c}=await G(e,t,q(t)),{w:l,h:u}=Er(c,a,o),d=u/2,{cssStyles:f}=t,p=W.svg(s),m=D(t,{});t.look!==`handDrawn`&&(m.roughness=0,m.fillStyle=`solid`);let h=[{x:-l/2+d,y:-u/2},{x:l/2-d,y:-u/2},...Y(-l/2+d,0,d,Tr,90,270),{x:l/2-d,y:u/2},...Y(l/2-d,0,d,Tr,270,450)],g=J(h),_=p.path(g,m),v=s.insert(()=>_,`:first-child`);return v.attr(`class`,`basic label-container outer-path`),f&&t.look!==`handDrawn`&&v.selectChildren(`path`).attr(`style`,f),r&&t.look!==`handDrawn`&&v.selectChildren(`path`).attr(`style`,r),K(t,v),t.intersect=function(e){return X.polygon(t,h,e)},s}e(Dr,`stadium`);async function Or(e,t){return en(e,t,{rx:t.look===`neo`?3:5,ry:t.look===`neo`?3:5,classes:`flowchart-node`})}e(Or,`state`);function kr(e,t,{config:{themeVariables:n}}){let{labelStyles:r,nodeStyles:i}=E(t);t.labelStyle=r;let{cssStyles:a}=t,{lineColor:o,stateBorder:s,nodeBorder:c,nodeShadow:l}=n;(t.width||t.height)&&((t.width??0)<14&&(t.width=14),(t.height??0)<14&&(t.height=14)),t.width||=14,t.height||=14;let u=e.insert(`g`).attr(`class`,`node default`).attr(`id`,t.domId??t.id),d=W.svg(u),f=D(t,{});t.look!==`handDrawn`&&(f.roughness=0,f.fillStyle=`solid`);let p=d.circle(0,0,t.width,{...f,stroke:o,strokeWidth:2}),m=s??c,h=(t.width??0)*5/14,g=d.circle(0,0,h,{...f,fill:m,stroke:m,strokeWidth:2,fillStyle:`solid`}),_=u.insert(()=>p,`:first-child`);if(_.insert(()=>g),t.look!==`handDrawn`&&_.attr(`class`,`outer-path`),a&&_.selectAll(`path`).attr(`style`,a),i&&_.selectAll(`path`).attr(`style`,i),t.width<25&&l&&t.look!==`handDrawn`){let t=e.node()?.ownerSVGElement?.id??``,n=t?`${t}-drop-shadow-small`:`drop-shadow-small`;_.attr(`style`,`filter:url(#${n})`)}return K(t,_),t.intersect=function(e){return X.circle(t,(t.width??0)/2,e)},u}e(kr,`stateEnd`);function Ar(e,t,{config:{themeVariables:n}}){let{lineColor:r,nodeShadow:i}=n;(t.width||t.height)&&((t.width??0)<14&&(t.width=14),(t.height??0)<14&&(t.height=14)),t.width||=14,t.height||=14;let a=e.insert(`g`).attr(`class`,`node default`).attr(`id`,t.domId||t.id),o;if(t.look===`handDrawn`){let e=W.svg(a).circle(0,0,t.width,x(r));o=a.insert(()=>e),o.attr(`class`,`state-start`).attr(`r`,(t.width??7)/2).attr(`width`,t.width??14).attr(`height`,t.height??14)}else o=a.insert(`circle`,`:first-child`),o.attr(`class`,`state-start`).attr(`r`,(t.width??7)/2).attr(`width`,t.width??14).attr(`height`,t.height??14);if(t.width<25&&i&&t.look!==`handDrawn`){let t=e.node()?.ownerSVGElement?.id??``,n=t?`${t}-drop-shadow-small`:`drop-shadow-small`;o.attr(`style`,`filter:url(#${n})`)}return K(t,o),t.intersect=function(e){return X.circle(t,(t.width??7)/2,e)},a}e(Ar,`stateStart`);var jr=8;async function Mr(e,t){let{labelStyles:n,nodeStyles:r}=E(t);t.labelStyle=n;let i=t?.padding??8,a=t.look===`neo`?28:i,o=t.look===`neo`?12:i,{shapeSvg:s,bbox:c}=await G(e,t,q(t)),l=Math.max(c.width+2*jr+a,t.width??0),u=Math.max(c.height+o,t.height??0),d=l-2*jr,f=u,p=-l/2,m=-u/2,h=[{x:0,y:0},{x:d,y:0},{x:d,y:-f},{x:0,y:-f},{x:0,y:0},{x:-8,y:0},{x:d+8,y:0},{x:d+8,y:-f},{x:-8,y:-f},{x:-8,y:0}];if(t.look===`handDrawn`){let e=W.svg(s),n=D(t,{}),r=e.rectangle(p,m,d+16,f,n),i=e.line(p+jr,m,p+jr,m+f,n),a=e.line(p+jr+d,m,p+jr+d,m+f,n);s.insert(()=>i,`:first-child`),s.insert(()=>a,`:first-child`);let o=s.insert(()=>r,`:first-child`),{cssStyles:c}=t;o.attr(`class`,`basic label-container`).attr(`style`,_(c)),K(t,o)}else{let e=wt(s,d,f,h);r&&e.attr(`style`,r),K(t,e)}return t.intersect=function(e){return X.polygon(t,h,e)},s}e(Mr,`subroutine`);var Nr=.2;async function Pr(e,t){let{labelStyles:n,nodeStyles:r}=E(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i;(t.width||t.height)&&(t.height=Math.max((t?.height??0)-o*2,10),t.width=Math.max((t?.width??0)-a*2-Nr*(t.height+o*2),10));let{shapeSvg:s,bbox:c}=await G(e,t,q(t)),l=(t?.height?t?.height:c.height)+o*2,u=Nr*l,d=Nr*l,f=(t?.width?t?.width:c.width)+a*2+u-u,p=l,m=-f/2,h=-p/2,{cssStyles:g}=t,_=W.svg(s),v=D(t,{}),y=[{x:m-u/2,y:h},{x:m+f+u/2,y:h},{x:m+f+u/2,y:h+p},{x:m-u/2,y:h+p}],b=[{x:m+f-u/2,y:h+p},{x:m+f+u/2,y:h+p},{x:m+f+u/2,y:h+p-d}];t.look!==`handDrawn`&&(v.roughness=0,v.fillStyle=`solid`);let x=J(y),S=_.path(x,v),C=J(b),w=_.path(C,{...v,fillStyle:`solid`}),T=s.insert(()=>w,`:first-child`);return T.insert(()=>S,`:first-child`),T.attr(`class`,`basic label-container outer-path`),g&&t.look!==`handDrawn`&&T.selectAll(`path`).attr(`style`,g),r&&t.look!==`handDrawn`&&T.selectAll(`path`).attr(`style`,r),K(t,T),t.intersect=function(e){return X.polygon(t,y,e)},s}e(Pr,`taggedRect`);async function Fr(e,t){let{labelStyles:n,nodeStyles:r}=E(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await G(e,t,q(t)),s=Math.max(a.width+(t.padding??0)*2,t?.width??0),c=Math.max(a.height+(t.padding??0)*2,t?.height??0),l=c/8,u=.2*s,d=.2*c,f=c+l,{cssStyles:p}=t,m=W.svg(i),h=D(t,{});t.look!==`handDrawn`&&(h.roughness=0,h.fillStyle=`solid`);let g=[{x:-s/2-s/2*.1,y:f/2},...$e(-s/2-s/2*.1,f/2,s/2+s/2*.1,f/2,l,.8),{x:s/2+s/2*.1,y:-f/2},{x:-s/2-s/2*.1,y:-f/2}],_=-s/2+s/2*.1,v=-f/2-d*.4,y=[{x:_+s-u,y:(v+c)*1.3},{x:_+s,y:v+c-d},{x:_+s,y:(v+c)*.9},...$e(_+s,(v+c)*1.25,_+s-u,(v+c)*1.3,-c*.02,.5)],b=J(g),x=m.path(b,h),S=J(y),C=m.path(S,{...h,fillStyle:`solid`}),w=i.insert(()=>C,`:first-child`);return w.insert(()=>x,`:first-child`),w.attr(`class`,`basic label-container outer-path`),p&&t.look!==`handDrawn`&&w.selectAll(`path`).attr(`style`,p),r&&t.look!==`handDrawn`&&w.selectAll(`path`).attr(`style`,r),w.attr(`transform`,`translate(0,${-l/2})`),o.attr(`transform`,`translate(${-s/2+(t.padding??0)-(a.x-(a.left??0))},${-c/2+(t.padding??0)-l/2-(a.y-(a.top??0))})`),K(t,w),t.intersect=function(e){return X.polygon(t,g,e)},i}e(Fr,`taggedWaveEdgedRectangle`);async function Ir(e,t){let{labelStyles:n,nodeStyles:r}=E(t);t.labelStyle=n;let{shapeSvg:i,bbox:a}=await G(e,t,q(t)),o=Math.max(a.width+(t.padding??0),t?.width||0),s=Math.max(a.height+(t.padding??0),t?.height||0),c=-o/2,l=-s/2,u=i.insert(`rect`,`:first-child`);return u.attr(`class`,`text`).attr(`style`,r).attr(`rx`,0).attr(`ry`,0).attr(`x`,c).attr(`y`,l).attr(`width`,o).attr(`height`,s),K(t,u),t.intersect=function(e){return X.rect(t,e)},i}e(Ir,`text`);var Lr=e((e,t,n,r,i,a)=>`M${e},${t}
|
|
3
3
|
a${i},${a} 0,0,1 0,${-r}
|
|
4
4
|
l${n},0
|