@weavecode/weave 0.1.7 → 0.1.8
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/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/adapter/bun/serve-static.js +1 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/adapter/bun/websocket.js +1 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/context.js +1 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/helper/css/common.js +3 -5
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/hono-base.js +4 -10
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/hono.js +0 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/middleware/basic-auth/index.js +1 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/middleware/bearer-auth/index.js +1 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/middleware/csrf/index.js +2 -2
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/middleware/jwk/jwk.js +2 -2
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/middleware/jwt/jwt.js +2 -2
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/middleware/mount/index.js +4 -4
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/router/reg-exp-router/node.js +13 -11
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/router/reg-exp-router/prepared-router.js +4 -4
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/router/reg-exp-router/router.js +39 -51
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/router/reg-exp-router/trie.js +15 -5
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/utils/jwt/jwt.js +2 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/utils/mount.js +35 -0
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/utils/url.js +10 -0
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/cjs/validator/validator.js +1 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/context.js +1 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/helper/css/common.js +3 -5
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/hono-base.js +4 -10
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/hono.js +0 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/middleware/basic-auth/index.js +1 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/middleware/bearer-auth/index.js +1 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/middleware/csrf/index.js +2 -2
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/middleware/jwk/jwk.js +2 -2
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/middleware/jwt/jwt.js +2 -2
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/middleware/language/language.js +1 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/middleware/mount/index.js +4 -4
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/router/reg-exp-router/node.js +13 -11
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/router/reg-exp-router/prepared-router.js +5 -5
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/router/reg-exp-router/router.js +40 -52
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/router/reg-exp-router/trie.js +15 -5
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/types/middleware/mount/index.d.ts +1 -0
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/types/router/reg-exp-router/node.d.ts +3 -3
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/types/router/reg-exp-router/trie.d.ts +1 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/types/utils/mount.d.ts +4 -0
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/types/utils/url.d.ts +1 -0
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/utils/jwt/jwt.js +2 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/utils/mount.js +34 -0
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/utils/url.js +10 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/dist/validator/validator.js +1 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/hono/package.json +1 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwks/remote.js +3 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/deflate.js +2 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/jwt_claims_set.js +2 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/package.json +1 -1
- package/node_modules/@weavecode/cli/dist/commands/msg.js +2 -2
- package/node_modules/@weavecode/cli/dist/i18n/dict/en.js +1 -1
- package/node_modules/@weavecode/cli/dist/i18n/dict/zh.js +1 -1
- package/node_modules/@weavecode/cli/dist/init/claudemd-gen.js +3 -3
- package/node_modules/@weavecode/cli/dist/statusline/ansi.js +1 -1
- package/node_modules/@weavecode/cli/dist/statusline/mock-input.js +1 -1
- package/node_modules/@weavecode/cli/dist/statusline/preview.js +2 -2
- package/node_modules/@weavecode/cli/package.json +5 -5
- package/node_modules/@weavecode/core/dist/harness.d.ts +78 -0
- package/node_modules/@weavecode/core/dist/harness.js +1 -1
- package/node_modules/@weavecode/core/dist/index.d.ts +1 -1
- package/node_modules/@weavecode/core/dist/index.js +1 -1
- package/node_modules/@weavecode/core/package.json +1 -1
- package/node_modules/@weavecode/harness/dist/claude/commands.d.ts +2 -0
- package/node_modules/@weavecode/harness/dist/claude/commands.js +3 -2
- package/node_modules/@weavecode/harness/dist/driver.d.ts +6 -0
- package/node_modules/@weavecode/harness/dist/zcode/assets.js +1 -1
- package/node_modules/@weavecode/harness/dist/zcode/capture.js +3 -3
- package/node_modules/@weavecode/harness/dist/zcode/mcp.js +2 -2
- package/node_modules/@weavecode/harness/package.json +2 -2
- package/node_modules/@weavecode/server/dist/daemon/dev-entry.js +1 -1
- package/node_modules/@weavecode/server/dist/daemon/hooks-routes.js +1 -1
- package/node_modules/@weavecode/server/dist/daemon/opener/launch.js +1 -1
- package/node_modules/@weavecode/server/dist/daemon/pet-seed.d.ts +6 -0
- package/node_modules/@weavecode/server/dist/daemon/pet-seed.js +1 -0
- package/node_modules/@weavecode/server/dist/daemon/pet-window.d.ts +17 -0
- package/node_modules/@weavecode/server/dist/daemon/pet-window.js +2 -0
- package/node_modules/@weavecode/server/dist/daemon/project-files.d.ts +1 -1
- package/node_modules/@weavecode/server/dist/daemon/project-files.js +2 -2
- package/node_modules/@weavecode/server/dist/daemon/routes/pets.d.ts +3 -0
- package/node_modules/@weavecode/server/dist/daemon/routes/pets.js +1 -0
- package/node_modules/@weavecode/server/dist/daemon/routes/settings-statusline.js +1 -1
- package/node_modules/@weavecode/server/dist/daemon/routes/visualizations.js +2 -1
- package/node_modules/@weavecode/server/dist/daemon/server.d.ts +2 -0
- package/node_modules/@weavecode/server/dist/daemon/settings.d.ts +21 -0
- package/node_modules/@weavecode/server/dist/daemon/settings.js +2 -2
- package/node_modules/@weavecode/server/dist/daemon/start.js +1 -1
- package/node_modules/@weavecode/server/dist/db/db.d.ts +4 -1
- package/node_modules/@weavecode/server/dist/db/db.js +2 -2
- package/node_modules/@weavecode/server/dist/db/paths.d.ts +4 -0
- package/node_modules/@weavecode/server/dist/db/paths.js +1 -1
- package/node_modules/@weavecode/server/dist/index.d.ts +1 -1
- package/node_modules/@weavecode/server/dist/index.js +1 -1
- package/node_modules/@weavecode/server/dist/repositories/hook-events.d.ts +6 -0
- package/node_modules/@weavecode/server/dist/repositories/hook-events.js +8 -5
- package/node_modules/@weavecode/server/dist/repositories/sessions.js +2 -2
- package/node_modules/@weavecode/server/package.json +4 -4
- package/node_modules/@weavecode/server/web/dist/assets/abnfDiagram-WEYOIA3C-t5OQjhuS.js +1 -0
- package/node_modules/@weavecode/server/web/dist/assets/{arc-CRZTRyjb.js → arc-De-uH_Q9.js} +1 -1
- package/node_modules/@weavecode/server/web/dist/assets/architectureDiagram-ZHVYKT53-ImPclD43.js +36 -0
- package/node_modules/@weavecode/server/web/dist/assets/{blockDiagram-RJAE7QA3-BIH8mSIZ.js → blockDiagram-RJAE7QA3-B5xEQs6X.js} +2 -2
- package/node_modules/@weavecode/server/web/dist/assets/{c4Diagram-XDPPPE54-5YoKWFOD.js → c4Diagram-XDPPPE54-DP8MjIgJ.js} +2 -2
- package/node_modules/@weavecode/server/web/dist/assets/channel-C0RGiobt.js +1 -0
- package/node_modules/@weavecode/server/web/dist/assets/{chunk-2E7WHVMD-B653kMXt.js → chunk-2E7WHVMD-C3UFIDyj.js} +1 -1
- package/node_modules/@weavecode/server/web/dist/assets/{chunk-2Q5K7J3B-f_A4_eDz.js → chunk-2Q5K7J3B-Bgw-3YfG.js} +1 -1
- package/node_modules/@weavecode/server/web/dist/assets/{chunk-4EMNKR2T-v5j5qNGj.js → chunk-4EMNKR2T-Dy_Wq9qn.js} +1 -1
- package/node_modules/@weavecode/server/web/dist/assets/chunk-55XCU76K-D32C0DXX.js +1 -0
- package/node_modules/@weavecode/server/web/dist/assets/{chunk-5VM5RSS4-BeROhLXN.js → chunk-5VM5RSS4-Dpmi-9Gi.js} +1 -1
- package/node_modules/@weavecode/server/web/dist/assets/{chunk-JWPE2WC7-D6dXb_jr.js → chunk-JWPE2WC7-CEYXaZDX.js} +1 -1
- package/node_modules/@weavecode/server/web/dist/assets/{chunk-VQ5W62QI-CnHdSEMi.js → chunk-VQ5W62QI-A616Pgzo.js} +1 -1
- package/node_modules/@weavecode/server/web/dist/assets/chunk-XXDRQBXY-CnxFMLWV.js +1 -0
- package/node_modules/@weavecode/server/web/dist/assets/chunk-ZCHMQSOR-BhjCTig8.js +2 -0
- package/node_modules/@weavecode/server/web/dist/assets/{classDiagram-v2-4MYWR3UA-DQe1b_k8.js → classDiagram-v2-4MYWR3UA-rzlq5tPv.js} +2 -2
- package/node_modules/@weavecode/server/web/dist/assets/cose-bilkent-JH36ORCC-CxWQXzj8.js +1 -0
- package/node_modules/@weavecode/server/web/dist/assets/{cynefin-EF2NZ3EQ-OZotFKUu.js → cynefin-EF2NZ3EQ-AFHjx2wU.js} +1 -1
- package/node_modules/@weavecode/server/web/dist/assets/cynefinDiagram-WF24UDRP-Bp_Oaf9U.js +62 -0
- package/node_modules/@weavecode/server/web/dist/assets/dagre-NK4GIZVX-7oUPIU35.js +4 -0
- package/node_modules/@weavecode/server/web/dist/assets/diagram-CBK3MWTC-D_rS_rSY.js +24 -0
- package/node_modules/@weavecode/server/web/dist/assets/diagram-I5XIIV2D-Duc_cKMb.js +24 -0
- package/node_modules/@weavecode/server/web/dist/assets/{diagram-ODIL2UCW-D9A6W8oB.js → diagram-ODIL2UCW-DA0XFVXm.js} +2 -2
- package/node_modules/@weavecode/server/web/dist/assets/{diagram-PFBEJUXE-PeI-eyu2.js → diagram-PFBEJUXE-D1U0Xhtt.js} +2 -2
- package/node_modules/@weavecode/server/web/dist/assets/diagram-RJA3I4VV-CbDFY871.js +41 -0
- package/node_modules/@weavecode/server/web/dist/assets/{diagram-TYUNFSNR-D5KieEw5.js → diagram-TYUNFSNR-jPg9AxQv.js} +2 -2
- package/node_modules/@weavecode/server/web/dist/assets/ebnfDiagram-V4P3TTPT-ZHfGTB0N.js +1 -0
- package/node_modules/@weavecode/server/web/dist/assets/{elk-QONTBCTQ-D3xrVg0U.js → elk-QONTBCTQ-C-ESJrUi.js} +3 -3
- package/node_modules/@weavecode/server/web/dist/assets/{erDiagram-KYQIGQAA-y_V1cor7.js → erDiagram-KYQIGQAA-DGK7TeHj.js} +2 -2
- package/node_modules/@weavecode/server/web/dist/assets/{flowDiagram-IUGLLWBU-BJ8Z0MkF.js → flowDiagram-IUGLLWBU-CVV4rL8v.js} +1 -1
- package/node_modules/@weavecode/server/web/dist/assets/ganttDiagram-R7GPNTJY-CuAwNvbm.js +292 -0
- package/node_modules/@weavecode/server/web/dist/assets/gitGraphDiagram-PDYL7XHY-D_15Wtf-.js +106 -0
- package/node_modules/@weavecode/server/web/dist/assets/infoDiagram-MVDRKAX5-ClqhbrCa.js +2 -0
- package/node_modules/@weavecode/server/web/dist/assets/{ishikawaDiagram-HPEHV2GE-ChEnND76.js → ishikawaDiagram-HPEHV2GE-CUJ891JX.js} +2 -2
- package/node_modules/@weavecode/server/web/dist/assets/{journeyDiagram-BOSHW7O7-DHcNtpYF.js → journeyDiagram-BOSHW7O7-B4skiMu-.js} +2 -2
- package/node_modules/@weavecode/server/web/dist/assets/{kanban-definition-FNSA4HC5-Dft7qpW5.js → kanban-definition-FNSA4HC5-UNGJR_y_.js} +2 -2
- package/node_modules/@weavecode/server/web/dist/assets/linear-BEB-UwbR.js +1 -0
- package/node_modules/@weavecode/server/web/dist/assets/main-B_0jS_Gz.js +1096 -0
- package/node_modules/@weavecode/server/web/dist/assets/main-Czzlavi4.css +11 -0
- package/node_modules/@weavecode/server/web/dist/assets/{mermaid.core-D_Dp_Kl2.js → mermaid.core-knGXJfjz.js} +4 -4
- package/node_modules/@weavecode/server/web/dist/assets/{mindmap-definition-6OY57UG3-CM6OAd_-.js → mindmap-definition-6OY57UG3-CEldbr3a.js} +2 -2
- package/node_modules/@weavecode/server/web/dist/assets/modulepreload-polyfill-B5Qt9EMX.js +1 -0
- package/node_modules/@weavecode/server/web/dist/assets/pegDiagram-ECIUJNBX-cNCkGLx3.js +1 -0
- package/node_modules/@weavecode/server/web/dist/assets/pet-DJCpIDM5.js +1 -0
- package/node_modules/@weavecode/server/web/dist/assets/pieDiagram-GNMPY74T-CfMEFiQD.js +39 -0
- package/node_modules/@weavecode/server/web/dist/assets/{quadrantDiagram-D57K4MC3-D8pQ_PU2.js → quadrantDiagram-D57K4MC3-knmi2rwP.js} +4 -4
- package/node_modules/@weavecode/server/web/dist/assets/railroadDiagram-Y72NRBL7-BJ7AzhEo.js +1 -0
- package/node_modules/@weavecode/server/web/dist/assets/{requirementDiagram-EQYSW5RA-C90DU5Ny.js → requirementDiagram-EQYSW5RA-Dte2LGQM.js} +2 -2
- package/node_modules/@weavecode/server/web/dist/assets/{sankeyDiagram-SY24JHO5-B_poYGgJ.js → sankeyDiagram-SY24JHO5-3noLaWgd.js} +2 -2
- package/node_modules/@weavecode/server/web/dist/assets/{sequenceDiagram-BLEHNHQU-DDW7b2Dn.js → sequenceDiagram-BLEHNHQU-CclOWTTc.js} +2 -2
- package/node_modules/@weavecode/server/web/dist/assets/sizeCapture-INFHLROL-B82sbLhA.js +1 -0
- package/node_modules/@weavecode/server/web/dist/assets/{stateDiagram-v2-A6IESKWZ-CkVMAyxG.js → stateDiagram-v2-A6IESKWZ-BXfVDwSN.js} +2 -2
- package/node_modules/@weavecode/server/web/dist/assets/swimlanes-B3ENRKFQ-D4lKZaeV.js +1 -0
- package/node_modules/@weavecode/server/web/dist/assets/swimlanesDiagram-AYQRV4AK-DbdFh_d6.js +8 -0
- package/node_modules/@weavecode/server/web/dist/assets/{timeline-definition-JXYKGLGB-DnhkRGLb.js → timeline-definition-JXYKGLGB-D6H6zP5b.js} +2 -2
- package/node_modules/@weavecode/server/web/dist/assets/{usecaseDiagram-WPOLBNNX-_TdIjC6Z.js → usecaseDiagram-WPOLBNNX-D2J2bKo_.js} +2 -2
- package/node_modules/@weavecode/server/web/dist/assets/{vennDiagram-Q3Y3IDCW-FzgsymXB.js → vennDiagram-Q3Y3IDCW-pdRbIkpB.js} +2 -2
- package/node_modules/@weavecode/server/web/dist/assets/{wardleyDiagram-IVAIDKWA-BwqimStC.js → wardleyDiagram-IVAIDKWA-Cyd2QPMf.js} +2 -2
- package/node_modules/@weavecode/server/web/dist/assets/{xychartDiagram-4URNHDU4-CFjjVPIV.js → xychartDiagram-4URNHDU4-Bd4BkwVM.js} +2 -2
- package/node_modules/@weavecode/server/web/dist/index.html +3 -2
- package/node_modules/@weavecode/server/web/dist/pet.html +60 -0
- package/node_modules/@weavecode/templates/dist/index.d.ts +2 -0
- package/node_modules/@weavecode/templates/dist/index.js +1 -1
- package/node_modules/@weavecode/templates/dist/resources/pets/weave-spider/pet.json +7 -0
- package/node_modules/@weavecode/templates/dist/resources/pets/weave-spider/spritesheet.png +0 -0
- package/node_modules/@weavecode/templates/dist/resources/weave-market/.claude-plugin/marketplace.json +6 -0
- package/node_modules/@weavecode/templates/dist/resources/weave-market/plugins/core-skills/weave-pet-hatcher/.claude-plugin/plugin.json +8 -0
- package/node_modules/@weavecode/templates/dist/resources/weave-market/plugins/core-skills/weave-pet-hatcher/skills/weave-pet-hatcher/SKILL.md +121 -0
- package/node_modules/@weavecode/templates/dist/resources/weave-market/plugins/core-skills/weave-pet-hatcher/skills/weave-pet-hatcher/scripts/assemble-pet.mjs +308 -0
- package/node_modules/@weavecode/templates/dist/resources/weave-market/plugins/core-skills/weave-pet-hatcher/weave.json +4 -0
- package/node_modules/@weavecode/templates/package.json +2 -2
- package/package.json +11 -7
- package/scripts/preinstall.mjs +70 -0
- package/node_modules/@weavecode/server/web/dist/assets/abnfDiagram-WEYOIA3C-DDeQkTf5.js +0 -1
- package/node_modules/@weavecode/server/web/dist/assets/architectureDiagram-ZHVYKT53-Dj54DE3O.js +0 -36
- package/node_modules/@weavecode/server/web/dist/assets/channel-5VM93AJ8.js +0 -1
- package/node_modules/@weavecode/server/web/dist/assets/chunk-55XCU76K-CgEqeP7j.js +0 -1
- package/node_modules/@weavecode/server/web/dist/assets/chunk-XXDRQBXY-BkG_e6PE.js +0 -1
- package/node_modules/@weavecode/server/web/dist/assets/chunk-ZCHMQSOR-DxR-fxzs.js +0 -2
- package/node_modules/@weavecode/server/web/dist/assets/cose-bilkent-JH36ORCC-DThrA8S5.js +0 -1
- package/node_modules/@weavecode/server/web/dist/assets/cynefinDiagram-WF24UDRP-DJjq2hfT.js +0 -62
- package/node_modules/@weavecode/server/web/dist/assets/dagre-NK4GIZVX-C2vH93HT.js +0 -4
- package/node_modules/@weavecode/server/web/dist/assets/diagram-CBK3MWTC-DrF_ScM-.js +0 -24
- package/node_modules/@weavecode/server/web/dist/assets/diagram-I5XIIV2D-D1qoUJ4t.js +0 -24
- package/node_modules/@weavecode/server/web/dist/assets/diagram-RJA3I4VV-DITY0Rd8.js +0 -41
- package/node_modules/@weavecode/server/web/dist/assets/ebnfDiagram-V4P3TTPT-DDylK-gz.js +0 -1
- package/node_modules/@weavecode/server/web/dist/assets/ganttDiagram-R7GPNTJY-C0q-CS1T.js +0 -292
- package/node_modules/@weavecode/server/web/dist/assets/gitGraphDiagram-PDYL7XHY-BYTComiB.js +0 -106
- package/node_modules/@weavecode/server/web/dist/assets/index-BKxAxaVG.js +0 -1091
- package/node_modules/@weavecode/server/web/dist/assets/index-C0Sd4MH7.css +0 -11
- package/node_modules/@weavecode/server/web/dist/assets/infoDiagram-MVDRKAX5-DtixgjLP.js +0 -2
- package/node_modules/@weavecode/server/web/dist/assets/linear-DEo11t-X.js +0 -1
- package/node_modules/@weavecode/server/web/dist/assets/pegDiagram-ECIUJNBX-_QkY0h8Q.js +0 -1
- package/node_modules/@weavecode/server/web/dist/assets/pieDiagram-GNMPY74T-ZGr5vtDj.js +0 -39
- package/node_modules/@weavecode/server/web/dist/assets/railroadDiagram-Y72NRBL7-DUIo-WmA.js +0 -1
- package/node_modules/@weavecode/server/web/dist/assets/sizeCapture-INFHLROL-CmKoqX6K.js +0 -1
- package/node_modules/@weavecode/server/web/dist/assets/swimlanes-B3ENRKFQ-Dm_Omzky.js +0 -1
- package/node_modules/@weavecode/server/web/dist/assets/swimlanesDiagram-AYQRV4AK-Bjj8ZA4d.js +0 -8
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var aC=Object.defineProperty;var iC=(t,e,r)=>e in t?aC(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var L=(t,e,r)=>iC(t,typeof e!="symbol"?e+"":e,r);import{_ as et}from"./index-BKxAxaVG.js";var sC=Object.create,ol=Object.defineProperty,oC=Object.getOwnPropertyDescriptor,nd=Object.getOwnPropertyNames,lC=Object.getPrototypeOf,uC=Object.prototype.hasOwnProperty,s=(t,e)=>ol(t,"name",{value:e,configurable:!0}),cC=(t,e)=>function(){return t&&(e=(0,t[nd(t)[0]])(t=0)),e},re=(t,e)=>function(){return e||(0,t[nd(t)[0]])((e={exports:{}}).exports,e),e.exports},fC=(t,e)=>{for(var r in e)ol(t,r,{get:e[r],enumerable:!0})},_y=(t,e,r,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of nd(e))!uC.call(t,n)&&n!==r&&ol(t,n,{get:()=>e[n],enumerable:!(a=oC(e,n))||a.enumerable});return t},ad=(t,e,r)=>(r=t!=null?sC(lC(t)):{},_y(ol(r,"default",{value:t,enumerable:!0}),t)),id=t=>_y(ol({},"__esModule",{value:!0}),t),ll=re({"../../node_modules/.pnpm/vscode-jsonrpc@9.0.3/node_modules/vscode-jsonrpc/lib/common/is.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.boolean=e,t.string=r,t.number=a,t.error=n,t.func=i,t.array=o,t.stringArray=u;function e(l){return l===!0||l===!1}s(e,"boolean");function r(l){return typeof l=="string"||l instanceof String}s(r,"string");function a(l){return typeof l=="number"||l instanceof Number}s(a,"number");function n(l){return l instanceof Error}s(n,"error");function i(l){return typeof l=="function"}s(i,"func");function o(l){return Array.isArray(l)}s(o,"array");function u(l){return o(l)&&l.every(c=>r(c))}s(u,"stringArray")}}),Sy=re({"../../node_modules/.pnpm/vscode-jsonrpc@9.0.3/node_modules/vscode-jsonrpc/lib/common/messages.js"(t){var G,S,I,T,w,k,b,x,U,Z,Q,ee,ae,pe,ye,De,Oe,Je,Ze,pt,ze,Ge,st,Qe,se;var e=t&&t.__createBinding||(Object.create?function(V,q,z,oe){oe===void 0&&(oe=z);var de=Object.getOwnPropertyDescriptor(q,z);(!de||("get"in de?!q.__esModule:de.writable||de.configurable))&&(de={enumerable:!0,get:s(function(){return q[z]},"get")}),Object.defineProperty(V,oe,de)}:function(V,q,z,oe){oe===void 0&&(oe=z),V[oe]=q[z]}),r=t&&t.__setModuleDefault||(Object.create?function(V,q){Object.defineProperty(V,"default",{enumerable:!0,value:q})}:function(V,q){V.default=q}),a=t&&t.__importStar||function(){var V=s(function(q){return V=Object.getOwnPropertyNames||function(z){var oe=[];for(var de in z)Object.prototype.hasOwnProperty.call(z,de)&&(oe[oe.length]=de);return oe},V(q)},"ownKeys");return function(q){if(q&&q.__esModule)return q;var z={};if(q!=null)for(var oe=V(q),de=0;de<oe.length;de++)oe[de]!=="default"&&e(z,q,oe[de]);return r(z,q),z}}();Object.defineProperty(t,"__esModule",{value:!0}),t.Message=t.NotificationType9=t.NotificationType8=t.NotificationType7=t.NotificationType6=t.NotificationType5=t.NotificationType4=t.NotificationType3=t.NotificationType2=t.NotificationType1=t.NotificationType0=t.NotificationType=t.RequestType9=t.RequestType8=t.RequestType7=t.RequestType6=t.RequestType5=t.RequestType4=t.RequestType3=t.RequestType2=t.RequestType1=t.RequestType=t.RequestType0=t.AbstractMessageSignature=t.ParameterStructures=t.ResponseError=t.ErrorCodes=void 0;var n=a(ll()),i;(function(V){V.ParseError=-32700,V.InvalidRequest=-32600,V.MethodNotFound=-32601,V.InvalidParams=-32602,V.InternalError=-32603,V.jsonrpcReservedErrorRangeStart=-32099,V.serverErrorStart=-32099,V.MessageWriteError=-32099,V.MessageReadError=-32098,V.PendingResponseRejected=-32097,V.ConnectionInactive=-32096,V.ServerNotInitialized=-32002,V.UnknownErrorCode=-32001,V.jsonrpcReservedErrorRangeEnd=-32e3,V.serverErrorEnd=-32e3})(i||(t.ErrorCodes=i={}));var o=(G=class extends Error{constructor(z,oe,de){super(oe);L(this,"code");L(this,"data");this.code=n.number(z)?z:i.UnknownErrorCode,this.data=de,Object.setPrototypeOf(this,G.prototype)}toJson(){const z={code:this.code,message:this.message};return this.data!==void 0&&(z.data=this.data),z}},s(G,"ResponseError"),G);t.ResponseError=o;var u=(S=class{constructor(q){L(this,"kind");this.kind=q}static is(q){return q===S.auto||q===S.byName||q===S.byPosition}toString(){return this.kind}},s(S,"ParameterStructures"),L(S,"auto",new S("auto")),L(S,"byPosition",new S("byPosition")),L(S,"byName",new S("byName")),S);t.ParameterStructures=u;var l=(I=class{constructor(q,z){L(this,"method");L(this,"numberOfParams");this.method=q,this.numberOfParams=z}get parameterStructures(){return u.auto}},s(I,"AbstractMessageSignature"),I);t.AbstractMessageSignature=l;var c=(T=class extends l{constructor(z){super(z,0);L(this,"_")}},s(T,"RequestType0"),T);t.RequestType0=c;var f=(w=class extends l{constructor(z,oe=u.auto){super(z,1);L(this,"_parameterStructures");L(this,"_");this._parameterStructures=oe}get parameterStructures(){return this._parameterStructures}},s(w,"RequestType"),w);t.RequestType=f;var p=(k=class extends l{constructor(z,oe=u.auto){super(z,1);L(this,"_parameterStructures");L(this,"_");this._parameterStructures=oe}get parameterStructures(){return this._parameterStructures}},s(k,"RequestType1"),k);t.RequestType1=p;var h=(b=class extends l{constructor(z){super(z,2);L(this,"_")}},s(b,"RequestType2"),b);t.RequestType2=h;var y=(x=class extends l{constructor(z){super(z,3);L(this,"_")}},s(x,"RequestType3"),x);t.RequestType3=y;var A=(U=class extends l{constructor(z){super(z,4);L(this,"_")}},s(U,"RequestType4"),U);t.RequestType4=A;var v=(Z=class extends l{constructor(z){super(z,5);L(this,"_")}},s(Z,"RequestType5"),Z);t.RequestType5=v;var R=(Q=class extends l{constructor(z){super(z,6);L(this,"_")}},s(Q,"RequestType6"),Q);t.RequestType6=R;var m=(ee=class extends l{constructor(z){super(z,7);L(this,"_")}},s(ee,"RequestType7"),ee);t.RequestType7=m;var g=(ae=class extends l{constructor(z){super(z,8);L(this,"_")}},s(ae,"RequestType8"),ae);t.RequestType8=g;var E=(pe=class extends l{constructor(z){super(z,9);L(this,"_")}},s(pe,"RequestType9"),pe);t.RequestType9=E;var _=(ye=class extends l{constructor(z,oe=u.auto){super(z,1);L(this,"_parameterStructures");L(this,"_");this._parameterStructures=oe}get parameterStructures(){return this._parameterStructures}},s(ye,"NotificationType"),ye);t.NotificationType=_;var P=(De=class extends l{constructor(z){super(z,0);L(this,"_")}},s(De,"NotificationType0"),De);t.NotificationType0=P;var F=(Oe=class extends l{constructor(z,oe=u.auto){super(z,1);L(this,"_parameterStructures");L(this,"_");this._parameterStructures=oe}get parameterStructures(){return this._parameterStructures}},s(Oe,"NotificationType1"),Oe);t.NotificationType1=F;var W=(Je=class extends l{constructor(z){super(z,2);L(this,"_")}},s(Je,"NotificationType2"),Je);t.NotificationType2=W;var le=(Ze=class extends l{constructor(z){super(z,3);L(this,"_")}},s(Ze,"NotificationType3"),Ze);t.NotificationType3=le;var ge=(pt=class extends l{constructor(z){super(z,4);L(this,"_")}},s(pt,"NotificationType4"),pt);t.NotificationType4=ge;var X=(ze=class extends l{constructor(z){super(z,5);L(this,"_")}},s(ze,"NotificationType5"),ze);t.NotificationType5=X;var ve=(Ge=class extends l{constructor(z){super(z,6);L(this,"_")}},s(Ge,"NotificationType6"),Ge);t.NotificationType6=ve;var Le=(st=class extends l{constructor(z){super(z,7);L(this,"_")}},s(st,"NotificationType7"),st);t.NotificationType7=Le;var D=(Qe=class extends l{constructor(z){super(z,8);L(this,"_")}},s(Qe,"NotificationType8"),Qe);t.NotificationType8=D;var N=(se=class extends l{constructor(z){super(z,9);L(this,"_")}},s(se,"NotificationType9"),se);t.NotificationType9=N;var M;(function(V){function q(de){const Me=de;return Me&&n.string(Me.method)&&(n.string(Me.id)||n.number(Me.id))}s(q,"isRequest"),V.isRequest=q;function z(de){const Me=de;return Me&&n.string(Me.method)&&de.id===void 0}s(z,"isNotification"),V.isNotification=z;function oe(de){const Me=de;return Me&&(Me.result!==void 0||!!Me.error)&&(n.string(Me.id)||n.number(Me.id)||Me.id===null)}s(oe,"isResponse"),V.isResponse=oe})(M||(t.Message=M={}))}}),wy=re({"../../node_modules/.pnpm/vscode-jsonrpc@9.0.3/node_modules/vscode-jsonrpc/lib/common/linkedMap.js"(t){var n,i,o;Object.defineProperty(t,"__esModule",{value:!0}),t.LRUCache=t.LinkedMap=t.Touch=void 0;var e;(function(u){u.None=0,u.First=1,u.AsOld=u.First,u.Last=2,u.AsNew=u.Last})(e||(t.Touch=e={}));var r=(i=class{constructor(){L(this,n,"LinkedMap");L(this,"_map");L(this,"_head");L(this,"_tail");L(this,"_size");L(this,"_state");this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){var l;return(l=this._head)==null?void 0:l.value}get last(){var l;return(l=this._tail)==null?void 0:l.value}before(l){var f;const c=this._map.get(l);return c?(f=c.previous)==null?void 0:f.value:void 0}after(l){var f;const c=this._map.get(l);return c?(f=c.next)==null?void 0:f.value:void 0}has(l){return this._map.has(l)}get(l,c=e.None){const f=this._map.get(l);if(f)return c!==e.None&&this.touch(f,c),f.value}set(l,c,f=e.None){let p=this._map.get(l);if(p)p.value=c,f!==e.None&&this.touch(p,f);else{switch(p={key:l,value:c,next:void 0,previous:void 0},f){case e.None:this.addItemLast(p);break;case e.First:this.addItemFirst(p);break;case e.Last:this.addItemLast(p);break;default:this.addItemLast(p);break}this._map.set(l,p),this._size++}return this}delete(l){return!!this.remove(l)}remove(l){const c=this._map.get(l);if(c)return this._map.delete(l),this.removeItem(c),this._size--,c.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const l=this._head;return this._map.delete(l.key),this.removeItem(l),this._size--,l.value}forEach(l,c){const f=this._state;let p=this._head;for(;p;){if(c?l.bind(c)(p.value,p.key,this):l(p.value,p.key,this),this._state!==f)throw new Error("LinkedMap got modified during iteration.");p=p.next}}keys(){const l=this._state;let c=this._head;const f={[Symbol.iterator]:()=>f,next:s(()=>{if(this._state!==l)throw new Error("LinkedMap got modified during iteration.");if(c){const p={value:c.key,done:!1};return c=c.next,p}else return{value:void 0,done:!0}},"next")};return f}values(){const l=this._state;let c=this._head;const f={[Symbol.iterator]:()=>f,next:s(()=>{if(this._state!==l)throw new Error("LinkedMap got modified during iteration.");if(c){const p={value:c.value,done:!1};return c=c.next,p}else return{value:void 0,done:!0}},"next")};return f}entries(){const l=this._state;let c=this._head;const f={[Symbol.iterator]:()=>f,next:s(()=>{if(this._state!==l)throw new Error("LinkedMap got modified during iteration.");if(c){const p={value:[c.key,c.value],done:!1};return c=c.next,p}else return{value:void 0,done:!0}},"next")};return f}[(n=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(l){if(l>=this.size)return;if(l===0){this.clear();return}let c=this._head,f=this.size;for(;c&&f>l;)this._map.delete(c.key),c=c.next,f--;this._head=c,this._size=f,c&&(c.previous=void 0),this._state++}addItemFirst(l){if(!this._head&&!this._tail)this._tail=l;else if(this._head)l.next=this._head,this._head.previous=l;else throw new Error("Invalid list");this._head=l,this._state++}addItemLast(l){if(!this._head&&!this._tail)this._head=l;else if(this._tail)l.previous=this._tail,this._tail.next=l;else throw new Error("Invalid list");this._tail=l,this._state++}removeItem(l){if(l===this._head&&l===this._tail)this._head=void 0,this._tail=void 0;else if(l===this._head){if(!l.next)throw new Error("Invalid list");l.next.previous=void 0,this._head=l.next}else if(l===this._tail){if(!l.previous)throw new Error("Invalid list");l.previous.next=void 0,this._tail=l.previous}else{const c=l.next,f=l.previous;if(!c||!f)throw new Error("Invalid list");c.previous=f,f.next=c}l.next=void 0,l.previous=void 0,this._state++}touch(l,c){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(c!==e.First&&c!==e.Last)){if(c===e.First){if(l===this._head)return;const f=l.next,p=l.previous;l===this._tail?(p.next=void 0,this._tail=p):(f.previous=p,p.next=f),l.previous=void 0,l.next=this._head,this._head.previous=l,this._head=l,this._state++}else if(c===e.Last){if(l===this._tail)return;const f=l.next,p=l.previous;l===this._head?(f.previous=void 0,this._head=f):(f.previous=p,p.next=f),l.next=void 0,l.previous=this._tail,this._tail.next=l,this._tail=l,this._state++}}}toJSON(){const l=[];return this.forEach((c,f)=>{l.push([f,c])}),l}fromJSON(l){this.clear();for(const[c,f]of l)this.set(c,f)}},s(i,"LinkedMap"),i);t.LinkedMap=r;var a=(o=class extends r{constructor(c,f=1){super();L(this,"_limit");L(this,"_ratio");this._limit=c,this._ratio=Math.min(Math.max(0,f),1)}get limit(){return this._limit}set limit(c){this._limit=c,this.checkTrim()}get ratio(){return this._ratio}set ratio(c){this._ratio=Math.min(Math.max(0,c),1),this.checkTrim()}get(c,f=e.AsNew){return super.get(c,f)}peek(c){return super.get(c,e.None)}set(c,f){return super.set(c,f,e.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}},s(o,"LRUCache"),o);t.LRUCache=a}}),pC=re({"../../node_modules/.pnpm/vscode-jsonrpc@9.0.3/node_modules/vscode-jsonrpc/lib/common/disposable.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Disposable=void 0;var e;(function(r){function a(n){return{dispose:n}}s(a,"create"),r.create=a})(e||(t.Disposable=e={}))}}),Kr=re({"../../node_modules/.pnpm/vscode-jsonrpc@9.0.3/node_modules/vscode-jsonrpc/lib/common/ral.js"(t){Object.defineProperty(t,"__esModule",{value:!0});var e;function r(){if(e===void 0)throw new Error("No runtime abstraction layer installed");return e}s(r,"RAL"),function(a){function n(i){if(i===void 0)throw new Error("No runtime abstraction layer provided");e=i}s(n,"install"),a.install=n}(r||(r={})),t.default=r}}),ul=re({"../../node_modules/.pnpm/vscode-jsonrpc@9.0.3/node_modules/vscode-jsonrpc/lib/common/events.js"(t){var o,u;var e=t&&t.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(t,"__esModule",{value:!0}),t.Emitter=t.Event=void 0;var r=e(Kr()),a;(function(l){const c={dispose(){}};l.None=function(){return c}})(a||(t.Event=a={}));var n=(o=class{constructor(){L(this,"_callbacks");L(this,"_contexts")}add(c,f=null,p){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(c),this._contexts.push(f),Array.isArray(p)&&p.push({dispose:s(()=>this.remove(c,f),"dispose")})}remove(c,f=null){if(!this._callbacks)return;let p=!1;for(let h=0,y=this._callbacks.length;h<y;h++)if(this._callbacks[h]===c)if(this._contexts[h]===f){this._callbacks.splice(h,1),this._contexts.splice(h,1);return}else p=!0;if(p)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...c){if(!this._callbacks)return[];const f=[],p=this._callbacks.slice(0),h=this._contexts.slice(0);for(let y=0,A=p.length;y<A;y++)try{f.push(p[y].apply(h[y],c))}catch(v){(0,r.default)().console.error(v)}return f}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},s(o,"CallbackList"),o),i=(u=class{constructor(c){L(this,"_options");L(this,"_event");L(this,"_callbacks");this._options=c}get event(){return this._event||(this._event=(c,f,p)=>{this._callbacks||(this._callbacks=new n),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(c,f);const h={dispose:s(()=>{this._callbacks&&(this._callbacks.remove(c,f),h.dispose=u._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))},"dispose")};return Array.isArray(p)&&p.push(h),h}),this._event}fire(c){this._callbacks&&this._callbacks.invoke.call(this._callbacks,c)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}},s(u,"Emitter"),L(u,"_noop",s(function(){},"_noop")),u);t.Emitter=i}}),sd=re({"../../node_modules/.pnpm/vscode-jsonrpc@9.0.3/node_modules/vscode-jsonrpc/lib/common/cancellation.js"(t){var h,y;var e=t&&t.__createBinding||(Object.create?function(A,v,R,m){m===void 0&&(m=R);var g=Object.getOwnPropertyDescriptor(v,R);(!g||("get"in g?!v.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:s(function(){return v[R]},"get")}),Object.defineProperty(A,m,g)}:function(A,v,R,m){m===void 0&&(m=R),A[m]=v[R]}),r=t&&t.__setModuleDefault||(Object.create?function(A,v){Object.defineProperty(A,"default",{enumerable:!0,value:v})}:function(A,v){A.default=v}),a=t&&t.__importStar||function(){var A=s(function(v){return A=Object.getOwnPropertyNames||function(R){var m=[];for(var g in R)Object.prototype.hasOwnProperty.call(R,g)&&(m[m.length]=g);return m},A(v)},"ownKeys");return function(v){if(v&&v.__esModule)return v;var R={};if(v!=null)for(var m=A(v),g=0;g<m.length;g++)m[g]!=="default"&&e(R,v,m[g]);return r(R,v),R}}(),n=t&&t.__importDefault||function(A){return A&&A.__esModule?A:{default:A}};Object.defineProperty(t,"__esModule",{value:!0}),t.CancellationTokenSource=t.CancellationToken=void 0;var i=n(Kr()),o=a(ll()),u=ul(),l;(function(A){A.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:u.Event.None}),A.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:u.Event.None});function v(R){const m=R;return m&&(m===A.None||m===A.Cancelled||o.boolean(m.isCancellationRequested)&&!!m.onCancellationRequested)}s(v,"is"),A.is=v})(l||(t.CancellationToken=l={}));var c=Object.freeze(function(A,v){const R=(0,i.default)().timer.setTimeout(A.bind(v),0);return{dispose(){R.dispose()}}}),f=(h=class{constructor(){L(this,"_isCancelled",!1);L(this,"_emitter")}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?c:(this._emitter||(this._emitter=new u.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},s(h,"MutableToken"),h),p=(y=class{constructor(){L(this,"_token")}get token(){return this._token||(this._token=new f),this._token}cancel(){this._token?this._token.cancel():this._token=l.Cancelled}dispose(){this._token?this._token instanceof f&&this._token.dispose():this._token=l.None}},s(y,"CancellationTokenSource"),y);t.CancellationTokenSource=p}}),dC=re({"../../node_modules/.pnpm/vscode-jsonrpc@9.0.3/node_modules/vscode-jsonrpc/lib/common/sharedArrayCancellation.js"(t){var u,l,c,f;Object.defineProperty(t,"__esModule",{value:!0}),t.SharedArrayReceiverStrategy=t.SharedArraySenderStrategy=void 0;var e=sd(),r;(function(p){p.Continue=0,p.Cancelled=1})(r||(r={}));var a=(u=class{constructor(){L(this,"buffers");this.buffers=new Map}enableCancellation(h){if(h.id===null)return;const y=new SharedArrayBuffer(4),A=new Int32Array(y,0,1);A[0]=r.Continue,this.buffers.set(h.id,y),h.$cancellationData=y}async sendCancellation(h,y){const A=this.buffers.get(y);if(A===void 0)return;const v=new Int32Array(A,0,1);Atomics.store(v,0,r.Cancelled)}cleanup(h){this.buffers.delete(h)}dispose(){this.buffers.clear()}},s(u,"SharedArraySenderStrategy"),u);t.SharedArraySenderStrategy=a;var n=(l=class{constructor(h){L(this,"data");this.data=new Int32Array(h,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===r.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},s(l,"SharedArrayBufferCancellationToken"),l),i=(c=class{constructor(h){L(this,"token");this.token=new n(h)}cancel(){}dispose(){}},s(c,"SharedArrayBufferCancellationTokenSource"),c),o=(f=class{constructor(){L(this,"kind","request")}createCancellationTokenSource(h){const y=h.$cancellationData;return y===void 0?new e.CancellationTokenSource:new i(y)}},s(f,"SharedArrayReceiverStrategy"),f);t.SharedArrayReceiverStrategy=o}}),Py=re({"../../node_modules/.pnpm/vscode-jsonrpc@9.0.3/node_modules/vscode-jsonrpc/lib/common/semaphore.js"(t){var n;var e=t&&t.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(t,"__esModule",{value:!0}),t.Semaphore=void 0;var r=e(Kr()),a=(n=class{constructor(o=1){L(this,"_capacity");L(this,"_active");L(this,"_waiting");if(o<=0)throw new Error("Capacity must be greater than 0");this._capacity=o,this._active=0,this._waiting=[]}lock(o){return new Promise((u,l)=>{this._waiting.push({thunk:o,resolve:u,reject:l}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,r.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;const o=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("Too many thunks active");try{const u=o.thunk();u instanceof Promise?u.then(l=>{this._active--,o.resolve(l),this.runNext()},l=>{this._active--,o.reject(l),this.runNext()}):(this._active--,o.resolve(u),this.runNext())}catch(u){this._active--,o.reject(u),this.runNext()}}},s(n,"Semaphore"),n);t.Semaphore=a}}),mC=re({"../../node_modules/.pnpm/vscode-jsonrpc@9.0.3/node_modules/vscode-jsonrpc/lib/common/messageReader.js"(t){var y,A;var e=t&&t.__createBinding||(Object.create?function(v,R,m,g){g===void 0&&(g=m);var E=Object.getOwnPropertyDescriptor(R,m);(!E||("get"in E?!R.__esModule:E.writable||E.configurable))&&(E={enumerable:!0,get:s(function(){return R[m]},"get")}),Object.defineProperty(v,g,E)}:function(v,R,m,g){g===void 0&&(g=m),v[g]=R[m]}),r=t&&t.__setModuleDefault||(Object.create?function(v,R){Object.defineProperty(v,"default",{enumerable:!0,value:R})}:function(v,R){v.default=R}),a=t&&t.__importStar||function(){var v=s(function(R){return v=Object.getOwnPropertyNames||function(m){var g=[];for(var E in m)Object.prototype.hasOwnProperty.call(m,E)&&(g[g.length]=E);return g},v(R)},"ownKeys");return function(R){if(R&&R.__esModule)return R;var m={};if(R!=null)for(var g=v(R),E=0;E<g.length;E++)g[E]!=="default"&&e(m,R,g[E]);return r(m,R),m}}(),n=t&&t.__importDefault||function(v){return v&&v.__esModule?v:{default:v}};Object.defineProperty(t,"__esModule",{value:!0}),t.ReadableStreamMessageReader=t.AbstractMessageReader=t.MessageReader=void 0;var i=n(Kr()),o=a(ll()),u=ul(),l=Py(),c;(function(v){function R(m){const g=m;return g&&o.func(g.listen)&&o.func(g.dispose)&&o.func(g.onError)&&o.func(g.onClose)&&o.func(g.onPartialMessage)}s(R,"is"),v.is=R})(c||(t.MessageReader=c={}));var f=(y=class{constructor(){L(this,"errorEmitter");L(this,"closeEmitter");L(this,"partialMessageEmitter");this.errorEmitter=new u.Emitter,this.closeEmitter=new u.Emitter,this.partialMessageEmitter=new u.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose(),this.partialMessageEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(R){this.errorEmitter.fire(this.asError(R))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(R){this.partialMessageEmitter.fire(R)}asError(R){return R instanceof Error?R:new Error(`Reader received error. Reason: ${o.string(R.message)?R.message:"unknown"}`)}},s(y,"AbstractMessageReader"),y);t.AbstractMessageReader=f;var p;(function(v){function R(m){let g,E;const _=new Map;let P;const F=new Map;if(m===void 0||typeof m=="string")g=m??"utf-8";else{if(g=m.charset??"utf-8",m.contentDecoder!==void 0&&(E=m.contentDecoder,_.set(E.name,E)),m.contentDecoders!==void 0)for(const W of m.contentDecoders)_.set(W.name,W);if(m.contentTypeDecoder!==void 0&&(P=m.contentTypeDecoder,F.set(P.name,P)),m.contentTypeDecoders!==void 0)for(const W of m.contentTypeDecoders)F.set(W.name,W)}return P===void 0&&(P=(0,i.default)().applicationJson.decoder,F.set(P.name,P)),{charset:g,contentDecoder:E,contentDecoders:_,contentTypeDecoder:P,contentTypeDecoders:F}}s(R,"fromOptions"),v.fromOptions=R})(p||(p={}));var h=(A=class extends f{constructor(m,g){super();L(this,"readable");L(this,"options");L(this,"callback");L(this,"nextMessageLength");L(this,"messageToken");L(this,"buffer");L(this,"partialMessageTimer");L(this,"_partialMessageTimeout");L(this,"readSemaphore");this.readable=m,this.options=p.fromOptions(g),this.buffer=(0,i.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new l.Semaphore(1)}set partialMessageTimeout(m){this._partialMessageTimeout=m}get partialMessageTimeout(){return this._partialMessageTimeout}listen(m){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=m;const g=this.readable.onData(E=>{this.onData(E)});return this.readable.onError(E=>this.fireError(E)),this.readable.onClose(()=>this.fireClose()),g}onData(m){try{for(this.buffer.append(m);;){if(this.nextMessageLength===-1){const E=this.buffer.tryReadHeaders(!0);if(!E)return;const _=E.get("content-length");if(!_){this.fireError(new Error(`Header must provide a Content-Length property.
|
|
1
|
+
var aC=Object.defineProperty;var iC=(t,e,r)=>e in t?aC(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var L=(t,e,r)=>iC(t,typeof e!="symbol"?e+"":e,r);import{_ as et}from"./main-B_0jS_Gz.js";var sC=Object.create,ol=Object.defineProperty,oC=Object.getOwnPropertyDescriptor,nd=Object.getOwnPropertyNames,lC=Object.getPrototypeOf,uC=Object.prototype.hasOwnProperty,s=(t,e)=>ol(t,"name",{value:e,configurable:!0}),cC=(t,e)=>function(){return t&&(e=(0,t[nd(t)[0]])(t=0)),e},re=(t,e)=>function(){return e||(0,t[nd(t)[0]])((e={exports:{}}).exports,e),e.exports},fC=(t,e)=>{for(var r in e)ol(t,r,{get:e[r],enumerable:!0})},_y=(t,e,r,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of nd(e))!uC.call(t,n)&&n!==r&&ol(t,n,{get:()=>e[n],enumerable:!(a=oC(e,n))||a.enumerable});return t},ad=(t,e,r)=>(r=t!=null?sC(lC(t)):{},_y(ol(r,"default",{value:t,enumerable:!0}),t)),id=t=>_y(ol({},"__esModule",{value:!0}),t),ll=re({"../../node_modules/.pnpm/vscode-jsonrpc@9.0.3/node_modules/vscode-jsonrpc/lib/common/is.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.boolean=e,t.string=r,t.number=a,t.error=n,t.func=i,t.array=o,t.stringArray=u;function e(l){return l===!0||l===!1}s(e,"boolean");function r(l){return typeof l=="string"||l instanceof String}s(r,"string");function a(l){return typeof l=="number"||l instanceof Number}s(a,"number");function n(l){return l instanceof Error}s(n,"error");function i(l){return typeof l=="function"}s(i,"func");function o(l){return Array.isArray(l)}s(o,"array");function u(l){return o(l)&&l.every(c=>r(c))}s(u,"stringArray")}}),Sy=re({"../../node_modules/.pnpm/vscode-jsonrpc@9.0.3/node_modules/vscode-jsonrpc/lib/common/messages.js"(t){var G,S,I,T,w,k,b,x,U,Z,Q,ee,ae,pe,ye,De,Oe,Je,Ze,pt,ze,Ge,st,Qe,se;var e=t&&t.__createBinding||(Object.create?function(V,q,z,oe){oe===void 0&&(oe=z);var de=Object.getOwnPropertyDescriptor(q,z);(!de||("get"in de?!q.__esModule:de.writable||de.configurable))&&(de={enumerable:!0,get:s(function(){return q[z]},"get")}),Object.defineProperty(V,oe,de)}:function(V,q,z,oe){oe===void 0&&(oe=z),V[oe]=q[z]}),r=t&&t.__setModuleDefault||(Object.create?function(V,q){Object.defineProperty(V,"default",{enumerable:!0,value:q})}:function(V,q){V.default=q}),a=t&&t.__importStar||function(){var V=s(function(q){return V=Object.getOwnPropertyNames||function(z){var oe=[];for(var de in z)Object.prototype.hasOwnProperty.call(z,de)&&(oe[oe.length]=de);return oe},V(q)},"ownKeys");return function(q){if(q&&q.__esModule)return q;var z={};if(q!=null)for(var oe=V(q),de=0;de<oe.length;de++)oe[de]!=="default"&&e(z,q,oe[de]);return r(z,q),z}}();Object.defineProperty(t,"__esModule",{value:!0}),t.Message=t.NotificationType9=t.NotificationType8=t.NotificationType7=t.NotificationType6=t.NotificationType5=t.NotificationType4=t.NotificationType3=t.NotificationType2=t.NotificationType1=t.NotificationType0=t.NotificationType=t.RequestType9=t.RequestType8=t.RequestType7=t.RequestType6=t.RequestType5=t.RequestType4=t.RequestType3=t.RequestType2=t.RequestType1=t.RequestType=t.RequestType0=t.AbstractMessageSignature=t.ParameterStructures=t.ResponseError=t.ErrorCodes=void 0;var n=a(ll()),i;(function(V){V.ParseError=-32700,V.InvalidRequest=-32600,V.MethodNotFound=-32601,V.InvalidParams=-32602,V.InternalError=-32603,V.jsonrpcReservedErrorRangeStart=-32099,V.serverErrorStart=-32099,V.MessageWriteError=-32099,V.MessageReadError=-32098,V.PendingResponseRejected=-32097,V.ConnectionInactive=-32096,V.ServerNotInitialized=-32002,V.UnknownErrorCode=-32001,V.jsonrpcReservedErrorRangeEnd=-32e3,V.serverErrorEnd=-32e3})(i||(t.ErrorCodes=i={}));var o=(G=class extends Error{constructor(z,oe,de){super(oe);L(this,"code");L(this,"data");this.code=n.number(z)?z:i.UnknownErrorCode,this.data=de,Object.setPrototypeOf(this,G.prototype)}toJson(){const z={code:this.code,message:this.message};return this.data!==void 0&&(z.data=this.data),z}},s(G,"ResponseError"),G);t.ResponseError=o;var u=(S=class{constructor(q){L(this,"kind");this.kind=q}static is(q){return q===S.auto||q===S.byName||q===S.byPosition}toString(){return this.kind}},s(S,"ParameterStructures"),L(S,"auto",new S("auto")),L(S,"byPosition",new S("byPosition")),L(S,"byName",new S("byName")),S);t.ParameterStructures=u;var l=(I=class{constructor(q,z){L(this,"method");L(this,"numberOfParams");this.method=q,this.numberOfParams=z}get parameterStructures(){return u.auto}},s(I,"AbstractMessageSignature"),I);t.AbstractMessageSignature=l;var c=(T=class extends l{constructor(z){super(z,0);L(this,"_")}},s(T,"RequestType0"),T);t.RequestType0=c;var f=(w=class extends l{constructor(z,oe=u.auto){super(z,1);L(this,"_parameterStructures");L(this,"_");this._parameterStructures=oe}get parameterStructures(){return this._parameterStructures}},s(w,"RequestType"),w);t.RequestType=f;var p=(k=class extends l{constructor(z,oe=u.auto){super(z,1);L(this,"_parameterStructures");L(this,"_");this._parameterStructures=oe}get parameterStructures(){return this._parameterStructures}},s(k,"RequestType1"),k);t.RequestType1=p;var h=(b=class extends l{constructor(z){super(z,2);L(this,"_")}},s(b,"RequestType2"),b);t.RequestType2=h;var y=(x=class extends l{constructor(z){super(z,3);L(this,"_")}},s(x,"RequestType3"),x);t.RequestType3=y;var A=(U=class extends l{constructor(z){super(z,4);L(this,"_")}},s(U,"RequestType4"),U);t.RequestType4=A;var v=(Z=class extends l{constructor(z){super(z,5);L(this,"_")}},s(Z,"RequestType5"),Z);t.RequestType5=v;var R=(Q=class extends l{constructor(z){super(z,6);L(this,"_")}},s(Q,"RequestType6"),Q);t.RequestType6=R;var m=(ee=class extends l{constructor(z){super(z,7);L(this,"_")}},s(ee,"RequestType7"),ee);t.RequestType7=m;var g=(ae=class extends l{constructor(z){super(z,8);L(this,"_")}},s(ae,"RequestType8"),ae);t.RequestType8=g;var E=(pe=class extends l{constructor(z){super(z,9);L(this,"_")}},s(pe,"RequestType9"),pe);t.RequestType9=E;var _=(ye=class extends l{constructor(z,oe=u.auto){super(z,1);L(this,"_parameterStructures");L(this,"_");this._parameterStructures=oe}get parameterStructures(){return this._parameterStructures}},s(ye,"NotificationType"),ye);t.NotificationType=_;var P=(De=class extends l{constructor(z){super(z,0);L(this,"_")}},s(De,"NotificationType0"),De);t.NotificationType0=P;var F=(Oe=class extends l{constructor(z,oe=u.auto){super(z,1);L(this,"_parameterStructures");L(this,"_");this._parameterStructures=oe}get parameterStructures(){return this._parameterStructures}},s(Oe,"NotificationType1"),Oe);t.NotificationType1=F;var W=(Je=class extends l{constructor(z){super(z,2);L(this,"_")}},s(Je,"NotificationType2"),Je);t.NotificationType2=W;var le=(Ze=class extends l{constructor(z){super(z,3);L(this,"_")}},s(Ze,"NotificationType3"),Ze);t.NotificationType3=le;var ge=(pt=class extends l{constructor(z){super(z,4);L(this,"_")}},s(pt,"NotificationType4"),pt);t.NotificationType4=ge;var X=(ze=class extends l{constructor(z){super(z,5);L(this,"_")}},s(ze,"NotificationType5"),ze);t.NotificationType5=X;var ve=(Ge=class extends l{constructor(z){super(z,6);L(this,"_")}},s(Ge,"NotificationType6"),Ge);t.NotificationType6=ve;var Le=(st=class extends l{constructor(z){super(z,7);L(this,"_")}},s(st,"NotificationType7"),st);t.NotificationType7=Le;var D=(Qe=class extends l{constructor(z){super(z,8);L(this,"_")}},s(Qe,"NotificationType8"),Qe);t.NotificationType8=D;var N=(se=class extends l{constructor(z){super(z,9);L(this,"_")}},s(se,"NotificationType9"),se);t.NotificationType9=N;var M;(function(V){function q(de){const Me=de;return Me&&n.string(Me.method)&&(n.string(Me.id)||n.number(Me.id))}s(q,"isRequest"),V.isRequest=q;function z(de){const Me=de;return Me&&n.string(Me.method)&&de.id===void 0}s(z,"isNotification"),V.isNotification=z;function oe(de){const Me=de;return Me&&(Me.result!==void 0||!!Me.error)&&(n.string(Me.id)||n.number(Me.id)||Me.id===null)}s(oe,"isResponse"),V.isResponse=oe})(M||(t.Message=M={}))}}),wy=re({"../../node_modules/.pnpm/vscode-jsonrpc@9.0.3/node_modules/vscode-jsonrpc/lib/common/linkedMap.js"(t){var n,i,o;Object.defineProperty(t,"__esModule",{value:!0}),t.LRUCache=t.LinkedMap=t.Touch=void 0;var e;(function(u){u.None=0,u.First=1,u.AsOld=u.First,u.Last=2,u.AsNew=u.Last})(e||(t.Touch=e={}));var r=(i=class{constructor(){L(this,n,"LinkedMap");L(this,"_map");L(this,"_head");L(this,"_tail");L(this,"_size");L(this,"_state");this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){var l;return(l=this._head)==null?void 0:l.value}get last(){var l;return(l=this._tail)==null?void 0:l.value}before(l){var f;const c=this._map.get(l);return c?(f=c.previous)==null?void 0:f.value:void 0}after(l){var f;const c=this._map.get(l);return c?(f=c.next)==null?void 0:f.value:void 0}has(l){return this._map.has(l)}get(l,c=e.None){const f=this._map.get(l);if(f)return c!==e.None&&this.touch(f,c),f.value}set(l,c,f=e.None){let p=this._map.get(l);if(p)p.value=c,f!==e.None&&this.touch(p,f);else{switch(p={key:l,value:c,next:void 0,previous:void 0},f){case e.None:this.addItemLast(p);break;case e.First:this.addItemFirst(p);break;case e.Last:this.addItemLast(p);break;default:this.addItemLast(p);break}this._map.set(l,p),this._size++}return this}delete(l){return!!this.remove(l)}remove(l){const c=this._map.get(l);if(c)return this._map.delete(l),this.removeItem(c),this._size--,c.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const l=this._head;return this._map.delete(l.key),this.removeItem(l),this._size--,l.value}forEach(l,c){const f=this._state;let p=this._head;for(;p;){if(c?l.bind(c)(p.value,p.key,this):l(p.value,p.key,this),this._state!==f)throw new Error("LinkedMap got modified during iteration.");p=p.next}}keys(){const l=this._state;let c=this._head;const f={[Symbol.iterator]:()=>f,next:s(()=>{if(this._state!==l)throw new Error("LinkedMap got modified during iteration.");if(c){const p={value:c.key,done:!1};return c=c.next,p}else return{value:void 0,done:!0}},"next")};return f}values(){const l=this._state;let c=this._head;const f={[Symbol.iterator]:()=>f,next:s(()=>{if(this._state!==l)throw new Error("LinkedMap got modified during iteration.");if(c){const p={value:c.value,done:!1};return c=c.next,p}else return{value:void 0,done:!0}},"next")};return f}entries(){const l=this._state;let c=this._head;const f={[Symbol.iterator]:()=>f,next:s(()=>{if(this._state!==l)throw new Error("LinkedMap got modified during iteration.");if(c){const p={value:[c.key,c.value],done:!1};return c=c.next,p}else return{value:void 0,done:!0}},"next")};return f}[(n=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(l){if(l>=this.size)return;if(l===0){this.clear();return}let c=this._head,f=this.size;for(;c&&f>l;)this._map.delete(c.key),c=c.next,f--;this._head=c,this._size=f,c&&(c.previous=void 0),this._state++}addItemFirst(l){if(!this._head&&!this._tail)this._tail=l;else if(this._head)l.next=this._head,this._head.previous=l;else throw new Error("Invalid list");this._head=l,this._state++}addItemLast(l){if(!this._head&&!this._tail)this._head=l;else if(this._tail)l.previous=this._tail,this._tail.next=l;else throw new Error("Invalid list");this._tail=l,this._state++}removeItem(l){if(l===this._head&&l===this._tail)this._head=void 0,this._tail=void 0;else if(l===this._head){if(!l.next)throw new Error("Invalid list");l.next.previous=void 0,this._head=l.next}else if(l===this._tail){if(!l.previous)throw new Error("Invalid list");l.previous.next=void 0,this._tail=l.previous}else{const c=l.next,f=l.previous;if(!c||!f)throw new Error("Invalid list");c.previous=f,f.next=c}l.next=void 0,l.previous=void 0,this._state++}touch(l,c){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(c!==e.First&&c!==e.Last)){if(c===e.First){if(l===this._head)return;const f=l.next,p=l.previous;l===this._tail?(p.next=void 0,this._tail=p):(f.previous=p,p.next=f),l.previous=void 0,l.next=this._head,this._head.previous=l,this._head=l,this._state++}else if(c===e.Last){if(l===this._tail)return;const f=l.next,p=l.previous;l===this._head?(f.previous=void 0,this._head=f):(f.previous=p,p.next=f),l.next=void 0,l.previous=this._tail,this._tail.next=l,this._tail=l,this._state++}}}toJSON(){const l=[];return this.forEach((c,f)=>{l.push([f,c])}),l}fromJSON(l){this.clear();for(const[c,f]of l)this.set(c,f)}},s(i,"LinkedMap"),i);t.LinkedMap=r;var a=(o=class extends r{constructor(c,f=1){super();L(this,"_limit");L(this,"_ratio");this._limit=c,this._ratio=Math.min(Math.max(0,f),1)}get limit(){return this._limit}set limit(c){this._limit=c,this.checkTrim()}get ratio(){return this._ratio}set ratio(c){this._ratio=Math.min(Math.max(0,c),1),this.checkTrim()}get(c,f=e.AsNew){return super.get(c,f)}peek(c){return super.get(c,e.None)}set(c,f){return super.set(c,f,e.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}},s(o,"LRUCache"),o);t.LRUCache=a}}),pC=re({"../../node_modules/.pnpm/vscode-jsonrpc@9.0.3/node_modules/vscode-jsonrpc/lib/common/disposable.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Disposable=void 0;var e;(function(r){function a(n){return{dispose:n}}s(a,"create"),r.create=a})(e||(t.Disposable=e={}))}}),Kr=re({"../../node_modules/.pnpm/vscode-jsonrpc@9.0.3/node_modules/vscode-jsonrpc/lib/common/ral.js"(t){Object.defineProperty(t,"__esModule",{value:!0});var e;function r(){if(e===void 0)throw new Error("No runtime abstraction layer installed");return e}s(r,"RAL"),function(a){function n(i){if(i===void 0)throw new Error("No runtime abstraction layer provided");e=i}s(n,"install"),a.install=n}(r||(r={})),t.default=r}}),ul=re({"../../node_modules/.pnpm/vscode-jsonrpc@9.0.3/node_modules/vscode-jsonrpc/lib/common/events.js"(t){var o,u;var e=t&&t.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(t,"__esModule",{value:!0}),t.Emitter=t.Event=void 0;var r=e(Kr()),a;(function(l){const c={dispose(){}};l.None=function(){return c}})(a||(t.Event=a={}));var n=(o=class{constructor(){L(this,"_callbacks");L(this,"_contexts")}add(c,f=null,p){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(c),this._contexts.push(f),Array.isArray(p)&&p.push({dispose:s(()=>this.remove(c,f),"dispose")})}remove(c,f=null){if(!this._callbacks)return;let p=!1;for(let h=0,y=this._callbacks.length;h<y;h++)if(this._callbacks[h]===c)if(this._contexts[h]===f){this._callbacks.splice(h,1),this._contexts.splice(h,1);return}else p=!0;if(p)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...c){if(!this._callbacks)return[];const f=[],p=this._callbacks.slice(0),h=this._contexts.slice(0);for(let y=0,A=p.length;y<A;y++)try{f.push(p[y].apply(h[y],c))}catch(v){(0,r.default)().console.error(v)}return f}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},s(o,"CallbackList"),o),i=(u=class{constructor(c){L(this,"_options");L(this,"_event");L(this,"_callbacks");this._options=c}get event(){return this._event||(this._event=(c,f,p)=>{this._callbacks||(this._callbacks=new n),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(c,f);const h={dispose:s(()=>{this._callbacks&&(this._callbacks.remove(c,f),h.dispose=u._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))},"dispose")};return Array.isArray(p)&&p.push(h),h}),this._event}fire(c){this._callbacks&&this._callbacks.invoke.call(this._callbacks,c)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}},s(u,"Emitter"),L(u,"_noop",s(function(){},"_noop")),u);t.Emitter=i}}),sd=re({"../../node_modules/.pnpm/vscode-jsonrpc@9.0.3/node_modules/vscode-jsonrpc/lib/common/cancellation.js"(t){var h,y;var e=t&&t.__createBinding||(Object.create?function(A,v,R,m){m===void 0&&(m=R);var g=Object.getOwnPropertyDescriptor(v,R);(!g||("get"in g?!v.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:s(function(){return v[R]},"get")}),Object.defineProperty(A,m,g)}:function(A,v,R,m){m===void 0&&(m=R),A[m]=v[R]}),r=t&&t.__setModuleDefault||(Object.create?function(A,v){Object.defineProperty(A,"default",{enumerable:!0,value:v})}:function(A,v){A.default=v}),a=t&&t.__importStar||function(){var A=s(function(v){return A=Object.getOwnPropertyNames||function(R){var m=[];for(var g in R)Object.prototype.hasOwnProperty.call(R,g)&&(m[m.length]=g);return m},A(v)},"ownKeys");return function(v){if(v&&v.__esModule)return v;var R={};if(v!=null)for(var m=A(v),g=0;g<m.length;g++)m[g]!=="default"&&e(R,v,m[g]);return r(R,v),R}}(),n=t&&t.__importDefault||function(A){return A&&A.__esModule?A:{default:A}};Object.defineProperty(t,"__esModule",{value:!0}),t.CancellationTokenSource=t.CancellationToken=void 0;var i=n(Kr()),o=a(ll()),u=ul(),l;(function(A){A.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:u.Event.None}),A.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:u.Event.None});function v(R){const m=R;return m&&(m===A.None||m===A.Cancelled||o.boolean(m.isCancellationRequested)&&!!m.onCancellationRequested)}s(v,"is"),A.is=v})(l||(t.CancellationToken=l={}));var c=Object.freeze(function(A,v){const R=(0,i.default)().timer.setTimeout(A.bind(v),0);return{dispose(){R.dispose()}}}),f=(h=class{constructor(){L(this,"_isCancelled",!1);L(this,"_emitter")}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?c:(this._emitter||(this._emitter=new u.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},s(h,"MutableToken"),h),p=(y=class{constructor(){L(this,"_token")}get token(){return this._token||(this._token=new f),this._token}cancel(){this._token?this._token.cancel():this._token=l.Cancelled}dispose(){this._token?this._token instanceof f&&this._token.dispose():this._token=l.None}},s(y,"CancellationTokenSource"),y);t.CancellationTokenSource=p}}),dC=re({"../../node_modules/.pnpm/vscode-jsonrpc@9.0.3/node_modules/vscode-jsonrpc/lib/common/sharedArrayCancellation.js"(t){var u,l,c,f;Object.defineProperty(t,"__esModule",{value:!0}),t.SharedArrayReceiverStrategy=t.SharedArraySenderStrategy=void 0;var e=sd(),r;(function(p){p.Continue=0,p.Cancelled=1})(r||(r={}));var a=(u=class{constructor(){L(this,"buffers");this.buffers=new Map}enableCancellation(h){if(h.id===null)return;const y=new SharedArrayBuffer(4),A=new Int32Array(y,0,1);A[0]=r.Continue,this.buffers.set(h.id,y),h.$cancellationData=y}async sendCancellation(h,y){const A=this.buffers.get(y);if(A===void 0)return;const v=new Int32Array(A,0,1);Atomics.store(v,0,r.Cancelled)}cleanup(h){this.buffers.delete(h)}dispose(){this.buffers.clear()}},s(u,"SharedArraySenderStrategy"),u);t.SharedArraySenderStrategy=a;var n=(l=class{constructor(h){L(this,"data");this.data=new Int32Array(h,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===r.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},s(l,"SharedArrayBufferCancellationToken"),l),i=(c=class{constructor(h){L(this,"token");this.token=new n(h)}cancel(){}dispose(){}},s(c,"SharedArrayBufferCancellationTokenSource"),c),o=(f=class{constructor(){L(this,"kind","request")}createCancellationTokenSource(h){const y=h.$cancellationData;return y===void 0?new e.CancellationTokenSource:new i(y)}},s(f,"SharedArrayReceiverStrategy"),f);t.SharedArrayReceiverStrategy=o}}),Py=re({"../../node_modules/.pnpm/vscode-jsonrpc@9.0.3/node_modules/vscode-jsonrpc/lib/common/semaphore.js"(t){var n;var e=t&&t.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(t,"__esModule",{value:!0}),t.Semaphore=void 0;var r=e(Kr()),a=(n=class{constructor(o=1){L(this,"_capacity");L(this,"_active");L(this,"_waiting");if(o<=0)throw new Error("Capacity must be greater than 0");this._capacity=o,this._active=0,this._waiting=[]}lock(o){return new Promise((u,l)=>{this._waiting.push({thunk:o,resolve:u,reject:l}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,r.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;const o=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("Too many thunks active");try{const u=o.thunk();u instanceof Promise?u.then(l=>{this._active--,o.resolve(l),this.runNext()},l=>{this._active--,o.reject(l),this.runNext()}):(this._active--,o.resolve(u),this.runNext())}catch(u){this._active--,o.reject(u),this.runNext()}}},s(n,"Semaphore"),n);t.Semaphore=a}}),mC=re({"../../node_modules/.pnpm/vscode-jsonrpc@9.0.3/node_modules/vscode-jsonrpc/lib/common/messageReader.js"(t){var y,A;var e=t&&t.__createBinding||(Object.create?function(v,R,m,g){g===void 0&&(g=m);var E=Object.getOwnPropertyDescriptor(R,m);(!E||("get"in E?!R.__esModule:E.writable||E.configurable))&&(E={enumerable:!0,get:s(function(){return R[m]},"get")}),Object.defineProperty(v,g,E)}:function(v,R,m,g){g===void 0&&(g=m),v[g]=R[m]}),r=t&&t.__setModuleDefault||(Object.create?function(v,R){Object.defineProperty(v,"default",{enumerable:!0,value:R})}:function(v,R){v.default=R}),a=t&&t.__importStar||function(){var v=s(function(R){return v=Object.getOwnPropertyNames||function(m){var g=[];for(var E in m)Object.prototype.hasOwnProperty.call(m,E)&&(g[g.length]=E);return g},v(R)},"ownKeys");return function(R){if(R&&R.__esModule)return R;var m={};if(R!=null)for(var g=v(R),E=0;E<g.length;E++)g[E]!=="default"&&e(m,R,g[E]);return r(m,R),m}}(),n=t&&t.__importDefault||function(v){return v&&v.__esModule?v:{default:v}};Object.defineProperty(t,"__esModule",{value:!0}),t.ReadableStreamMessageReader=t.AbstractMessageReader=t.MessageReader=void 0;var i=n(Kr()),o=a(ll()),u=ul(),l=Py(),c;(function(v){function R(m){const g=m;return g&&o.func(g.listen)&&o.func(g.dispose)&&o.func(g.onError)&&o.func(g.onClose)&&o.func(g.onPartialMessage)}s(R,"is"),v.is=R})(c||(t.MessageReader=c={}));var f=(y=class{constructor(){L(this,"errorEmitter");L(this,"closeEmitter");L(this,"partialMessageEmitter");this.errorEmitter=new u.Emitter,this.closeEmitter=new u.Emitter,this.partialMessageEmitter=new u.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose(),this.partialMessageEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(R){this.errorEmitter.fire(this.asError(R))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(R){this.partialMessageEmitter.fire(R)}asError(R){return R instanceof Error?R:new Error(`Reader received error. Reason: ${o.string(R.message)?R.message:"unknown"}`)}},s(y,"AbstractMessageReader"),y);t.AbstractMessageReader=f;var p;(function(v){function R(m){let g,E;const _=new Map;let P;const F=new Map;if(m===void 0||typeof m=="string")g=m??"utf-8";else{if(g=m.charset??"utf-8",m.contentDecoder!==void 0&&(E=m.contentDecoder,_.set(E.name,E)),m.contentDecoders!==void 0)for(const W of m.contentDecoders)_.set(W.name,W);if(m.contentTypeDecoder!==void 0&&(P=m.contentTypeDecoder,F.set(P.name,P)),m.contentTypeDecoders!==void 0)for(const W of m.contentTypeDecoders)F.set(W.name,W)}return P===void 0&&(P=(0,i.default)().applicationJson.decoder,F.set(P.name,P)),{charset:g,contentDecoder:E,contentDecoders:_,contentTypeDecoder:P,contentTypeDecoders:F}}s(R,"fromOptions"),v.fromOptions=R})(p||(p={}));var h=(A=class extends f{constructor(m,g){super();L(this,"readable");L(this,"options");L(this,"callback");L(this,"nextMessageLength");L(this,"messageToken");L(this,"buffer");L(this,"partialMessageTimer");L(this,"_partialMessageTimeout");L(this,"readSemaphore");this.readable=m,this.options=p.fromOptions(g),this.buffer=(0,i.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new l.Semaphore(1)}set partialMessageTimeout(m){this._partialMessageTimeout=m}get partialMessageTimeout(){return this._partialMessageTimeout}listen(m){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=m;const g=this.readable.onData(E=>{this.onData(E)});return this.readable.onError(E=>this.fireError(E)),this.readable.onClose(()=>this.fireClose()),g}onData(m){try{for(this.buffer.append(m);;){if(this.nextMessageLength===-1){const E=this.buffer.tryReadHeaders(!0);if(!E)return;const _=E.get("content-length");if(!_){this.fireError(new Error(`Header must provide a Content-Length property.
|
|
2
2
|
${JSON.stringify(Object.fromEntries(E))}`));return}const P=parseInt(_);if(isNaN(P)){this.fireError(new Error(`Content-Length value must be a number. Got ${_}`));return}this.nextMessageLength=P}const g=this.buffer.tryReadBody(this.nextMessageLength);if(g===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{const E=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(g):g,_=await this.options.contentTypeDecoder.decode(E,this.options);this.callback(_)}).catch(E=>{this.fireError(E)})}}catch(g){this.fireError(g)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,i.default)().timer.setTimeout((m,g)=>{this.partialMessageTimer=void 0,m===this.messageToken&&(this.firePartialMessage({messageToken:m,waitingTime:g}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}},s(A,"ReadableStreamMessageReader"),A);t.ReadableStreamMessageReader=h}}),hC=re({"../../node_modules/.pnpm/vscode-jsonrpc@9.0.3/node_modules/vscode-jsonrpc/lib/common/messageWriter.js"(t){var v,R;var e=t&&t.__createBinding||(Object.create?function(m,g,E,_){_===void 0&&(_=E);var P=Object.getOwnPropertyDescriptor(g,E);(!P||("get"in P?!g.__esModule:P.writable||P.configurable))&&(P={enumerable:!0,get:s(function(){return g[E]},"get")}),Object.defineProperty(m,_,P)}:function(m,g,E,_){_===void 0&&(_=E),m[_]=g[E]}),r=t&&t.__setModuleDefault||(Object.create?function(m,g){Object.defineProperty(m,"default",{enumerable:!0,value:g})}:function(m,g){m.default=g}),a=t&&t.__importStar||function(){var m=s(function(g){return m=Object.getOwnPropertyNames||function(E){var _=[];for(var P in E)Object.prototype.hasOwnProperty.call(E,P)&&(_[_.length]=P);return _},m(g)},"ownKeys");return function(g){if(g&&g.__esModule)return g;var E={};if(g!=null)for(var _=m(g),P=0;P<_.length;P++)_[P]!=="default"&&e(E,g,_[P]);return r(E,g),E}}(),n=t&&t.__importDefault||function(m){return m&&m.__esModule?m:{default:m}};Object.defineProperty(t,"__esModule",{value:!0}),t.WriteableStreamMessageWriter=t.AbstractMessageWriter=t.MessageWriter=void 0;var i=n(Kr()),o=a(ll()),u=Py(),l=ul(),c="Content-Length: ",f=`\r
|
|
3
3
|
`,p;(function(m){function g(E){const _=E;return _&&o.func(_.dispose)&&o.func(_.onClose)&&o.func(_.onError)&&o.func(_.write)}s(g,"is"),m.is=g})(p||(t.MessageWriter=p={}));var h=(v=class{constructor(){L(this,"errorEmitter");L(this,"closeEmitter");this.errorEmitter=new l.Emitter,this.closeEmitter=new l.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(g,E,_){this.errorEmitter.fire([this.asError(g),E,_])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(g){return g instanceof Error?g:new Error(`Writer received error. Reason: ${o.string(g.message)?g.message:"unknown"}`)}},s(v,"AbstractMessageWriter"),v);t.AbstractMessageWriter=h;var y;(function(m){function g(E){return E===void 0||typeof E=="string"?{charset:E??"utf-8",contentTypeEncoder:(0,i.default)().applicationJson.encoder}:{charset:E.charset??"utf-8",contentEncoder:E.contentEncoder,contentTypeEncoder:E.contentTypeEncoder??(0,i.default)().applicationJson.encoder}}s(g,"fromOptions"),m.fromOptions=g})(y||(y={}));var A=(R=class extends h{constructor(E,_){super();L(this,"writable");L(this,"options");L(this,"errorCount");L(this,"writeSemaphore");this.writable=E,this.options=y.fromOptions(_),this.errorCount=0,this.writeSemaphore=new u.Semaphore(1),this.writable.onError(P=>this.fireError(P)),this.writable.onClose(()=>this.fireClose())}async write(E){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(E,this.options).then(P=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(P):P).then(P=>{const F=[];return F.push(c,P.byteLength.toString(),f),F.push(f),this.doWrite(E,F,P)},P=>{throw this.fireError(P),P}))}async doWrite(E,_,P){try{return await this.writable.write(_.join(""),"ascii"),this.writable.write(P)}catch(F){return this.handleError(F,E),Promise.reject(F)}}handleError(E,_){this.errorCount++,this.fireError(E,_,this.errorCount)}end(){this.writable.end()}},s(R,"WriteableStreamMessageWriter"),R);t.WriteableStreamMessageWriter=A}}),yC=re({"../../node_modules/.pnpm/vscode-jsonrpc@9.0.3/node_modules/vscode-jsonrpc/lib/common/messageBuffer.js"(t){var i;Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractMessageBuffer=void 0;var e=13,r=10,a=`\r
|
|
4
4
|
`,n=(i=class{constructor(u="utf-8"){L(this,"_encoding");L(this,"_chunks");L(this,"_totalLength");this._encoding=u,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(u){const l=typeof u=="string"?this.fromString(u,this._encoding):u;this._chunks.push(l),this._totalLength+=l.byteLength}tryReadHeaders(u=!1){if(this._chunks.length===0)return;let l=0,c=0,f=0,p=0;e:for(;c<this._chunks.length;){const v=this._chunks[c];for(f=0;f<v.length;){switch(v[f]){case e:switch(l){case 0:l=1;break;case 2:l=3;break;default:l=0}break;case r:switch(l){case 1:l=2;break;case 3:l=4,f++;break e;default:l=0}break;default:l=0}f++}p+=v.byteLength,c++}if(l!==4)return;const h=this._read(p+f),y=new Map,A=this.toString(h,"ascii").split(a);if(A.length<2)return y;for(let v=0;v<A.length-2;v++){const R=A[v],m=R.indexOf(":");if(m===-1)throw new Error(`Message header must separate key and value using ':'
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import{p as xt}from"./chunk-JWPE2WC7-CEYXaZDX.js";import{s as gt,g as $t,q as bt,p as wt,a as Ct,b as vt,_ as s,l as O,P as Dt,d as kt,z as Tt,M as Q,K as U,N as At,Q as ot}from"./mermaid.core-knGXJfjz.js";import{p as Bt}from"./cynefin-EF2NZ3EQ-AFHjx2wU.js";import"./main-B_0jS_Gz.js";import"./modulepreload-polyfill-B5Qt9EMX.js";var rt=s(()=>({domains:new Map,transitions:[]}),"createDefaultData"),H=rt(),St=s(()=>H.domains,"getDomains"),Mt=s(()=>H.transitions,"getTransitions"),zt=s(t=>{if(t)for(const e of t){const n=e.domain,a=(e.items??[]).map(c=>({label:c.label}));H.domains.set(n,{name:n,items:a})}},"setDomains"),Lt=s(t=>{t&&(H.transitions=t.filter(e=>e.from===e.to?(O.warn(`Cynefin: self-loop transition on domain "${e.from}" is not meaningful and will be skipped.`),!1):!0).map(e=>({from:e.from,to:e.to,label:e.label||void 0})))},"setTransitions"),Nt=s(()=>Q({...At.cynefin,...U().cynefin}),"getConfig"),Pt=s(()=>{Tt(),H=rt()},"clear"),Y={getDomains:St,getTransitions:Mt,setDomains:zt,setTransitions:Lt,getConfig:Nt,clear:Pt,setAccTitle:vt,getAccTitle:Ct,setDiagramTitle:wt,getDiagramTitle:bt,getAccDescription:$t,setAccDescription:gt},It=s(t=>{xt(t,Y),Y.setDomains(t.domains),Y.setTransitions(t.transitions)},"populate"),Wt={parse:s(async t=>{const e=await Bt("cynefin",t);O.debug(e),It(e)},"parse")};function E(t){let e=t+1831565813|0;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}s(E,"seededRandom");function st(t){let e=0;for(let n=0;n<t.length;n++){const a=t.charCodeAt(n);e=(e<<5)-e+a,e|=0}return e}s(st,"hashString");function it(t,e){return typeof t=="number"&&Number.isFinite(t)&&t!==0?t:st(e)}s(it,"resolveSeed");function ct(t,e,n,a){const c=t/2,m=a??t*.015,v=7,W=e/v,d=[];for(let o=0;o<=v;o++){const p=E(n+o*17)*m*2-m;d.push({x:c+p,y:o*W})}let D=`M${d[0].x},${d[0].y}`;for(let o=0;o<d.length-1;o++){const p=d[o],i=d[o+1],f=(p.y+i.y)/2,b=o%2===0?1:-1,h=m*1.5*b*E(n+o*31+7),R=p.x+h,_=f,F=i.x-h;D+=` C${R},${_} ${F},${f} ${i.x},${i.y}`}return D}s(ct,"generateFoldPath");function lt(t,e,n,a){const c=e/2,m=a??e*.015,v=7,W=t/v,d=[];for(let o=0;o<=v;o++){const p=E(n+o*23)*m*2-m;d.push({x:o*W,y:c+p})}let D=`M${d[0].x},${d[0].y}`;for(let o=0;o<d.length-1;o++){const p=d[o],i=d[o+1],f=(p.x+i.x)/2,b=o%2===0?1:-1,h=m*1.5*b*E(n+o*37+11),R=f,_=p.y+h,F=f,z=i.y-h;D+=` C${R},${_} ${F},${z} ${i.x},${i.y}`}return D}s(lt,"generateHorizontalBoundary");function dt(t,e){const n=t/2,a=e*.5,c=e,m=t*.03;return[`M${n},${a}`,`C${n+m},${a+(c-a)*.2}`,`${n-m*1.5},${a+(c-a)*.55}`,`${n+m*.5},${a+(c-a)*.75}`,`C${n-m},${a+(c-a)*.85}`,`${n+m*.3},${a+(c-a)*.95}`,`${n},${c}`].join(" ")}s(dt,"generateCliffPath");function ft(t,e,n,a){return[`M${t-n},${e}`,`A${n},${a} 0 1,1 ${t+n},${e}`,`A${n},${a} 0 1,1 ${t-n},${e}`,"Z"].join(" ")}s(ft,"generateConfusionPath");var at={complex:{model:"Probe → Sense → Respond",practice:"Emergent Practices"},complicated:{model:"Sense → Analyse → Respond",practice:"Good Practices"},clear:{model:"Sense → Categorise → Respond",practice:"Best Practices"},chaotic:{model:"Act → Sense → Respond",practice:"Novel Practices"},confusion:{model:"",practice:"Disorder"}},Rt=s((t,e)=>{const n=t/2,a=e/2;return{complex:{cx:n/2,cy:a/2,x:0,y:0,w:n,h:a},complicated:{cx:n+n/2,cy:a/2,x:n,y:0,w:n,h:a},chaotic:{cx:n/2,cy:a+a/2,x:0,y:a,w:n,h:a},clear:{cx:n+n/2,cy:a+a/2,x:n,y:a,w:n,h:a},confusion:{cx:n,cy:a,x:n*.7,y:a*.7,w:n*.6,h:a*.6}}},"getDomainLayouts"),_t=s(()=>{const t=ot(),e=U();return Q(t,e.themeVariables).cynefin},"getCynefinDomainColors"),q=3,Ft=s((t,e,n,a)=>{const c=a.db,m=c.getDomains(),v=c.getTransitions(),W=c.getDiagramTitle(),d=c.getAccTitle(),D=c.getAccDescription(),o=c.getConfig(),p=_t();O.debug("Rendering Cynefin diagram");const i=o.width,f=o.height,b=o.padding,h=o.showDomainDescriptions,R=o.boundaryAmplitude,_=i+b*2,F=f+b*2,z={complex:p.complexBg,complicated:p.complicatedBg,clear:p.clearBg,chaotic:p.chaoticBg,confusion:p.confusionBg},k=Dt(e);kt(k,F,_,o.useMaxWidth??!0),k.attr("viewBox",`0 0 ${_} ${F}`),d&&k.append("title").text(d),D&&k.append("desc").text(D);const T=k.append("g").attr("transform",`translate(${b}, ${b})`),V=Rt(i,f),K=it(o.seed,e),mt=T.append("g").attr("class","cynefin-backgrounds"),X=["complex","complicated","chaotic","clear"];for(const l of X){const r=V[l];mt.append("rect").attr("class","cynefinDomain").attr("x",r.x).attr("y",r.y).attr("width",r.w).attr("height",r.h).attr("fill",z[l]).attr("fill-opacity",.4).attr("stroke","none")}const j=T.append("g").attr("class","cynefin-boundaries");j.append("path").attr("class","cynefinBoundary").attr("d",ct(i,f,K,R)).attr("fill","none"),j.append("path").attr("class","cynefinBoundary").attr("d",lt(i,f,K+100,R)).attr("fill","none"),j.append("path").attr("class","cynefinCliff").attr("d",dt(i,f)).attr("fill","none");const pt=i*.15,yt=f*.15;T.append("path").attr("class","cynefinConfusion").attr("d",ft(i/2,f/2,pt,yt)).attr("fill",z.confusion).attr("fill-opacity",.5);const Z=T.append("g").attr("class","cynefin-labels");for(const l of X){const r=V[l];Z.append("text").attr("class","cynefinDomainLabel").attr("x",r.cx).attr("y",h?r.cy-30:r.cy).attr("text-anchor","middle").attr("dominant-baseline","middle").text(l.charAt(0).toUpperCase()+l.slice(1))}if(Z.append("text").attr("class","cynefinDomainLabel").attr("x",i/2).attr("y",h?f/2-10:f/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text("Confusion"),h){const l=T.append("g").attr("class","cynefin-subtitles");for(const r of X){const u=V[r],y=at[r];l.append("text").attr("class","cynefinSubtitle").attr("x",u.cx).attr("y",u.cy-10).attr("text-anchor","middle").attr("dominant-baseline","middle").text(y.model),l.append("text").attr("class","cynefinSubtitle").attr("x",u.cx).attr("y",u.cy+5).attr("text-anchor","middle").attr("dominant-baseline","middle").text(y.practice)}l.append("text").attr("class","cynefinSubtitle").attr("x",i/2).attr("y",f/2+8).attr("text-anchor","middle").attr("dominant-baseline","middle").text(at.confusion.practice)}const J=T.append("g").attr("class","cynefin-items"),A=26,tt=10,ut=["complex","complicated","chaotic","clear","confusion"];for(const l of ut){const r=m.get(l);if(!r||r.items.length===0)continue;const u=V[l],y=l==="confusion";let L=r.items,N=0;y&&r.items.length>q&&(N=r.items.length-q,L=r.items.slice(0,q));let B;if(y){const g=h?22:14;B=u.cy+g}else B=u.cy+(h?25:15);if([...L].forEach((g,S)=>{const w=B+S*(A+4),M=J.append("g"),P=M.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",A/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(g.label);let $=g.label.length*7;const x=P.node();if(x&&typeof x.getBBox=="function"){const G=x.getBBox();G.width>0&&($=G.width)}const C=$+tt*2,I=u.cx-C/2;M.attr("transform",`translate(${I}, ${w})`),M.insert("rect","text").attr("class","cynefinItem").attr("x",0).attr("y",0).attr("width",C).attr("height",A).attr("rx",4).attr("ry",4).attr("fill",z[l]).attr("fill-opacity",.95),P.attr("x",C/2).attr("y",A/2)}),N>0){const g=B+L.length*(A+4),S=`+${N} more`,w=J.append("g"),M=w.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",A/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(S);let P=S.length*7;const $=M.node();if($&&typeof $.getBBox=="function"){const I=$.getBBox();I.width>0&&(P=I.width)}const x=P+tt*2,C=u.cx-x/2;w.attr("transform",`translate(${C}, ${g})`),w.insert("rect","text").attr("class","cynefinItemOverflow").attr("x",0).attr("y",0).attr("width",x).attr("height",A).attr("rx",4).attr("ry",4).attr("fill",z[l]).attr("fill-opacity",.6),M.attr("x",x/2).attr("y",A/2)}}if(v.length>0){const l=k.select("defs").empty()?k.append("defs"):k.select("defs"),r=`cynefin-arrow-${e}`;l.append("marker").attr("id",r).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","cynefinArrowHead");const u=T.append("g").attr("class","cynefin-arrows");v.forEach(y=>{const L=V[y.from],N=V[y.to];if(!L||!N)return;if(y.from===y.to){O.warn(`Cynefin renderer: skipping self-loop on domain "${y.from}"`);return}const B=L.cx,g=L.cy,S=N.cx,w=N.cy,M=(B+S)/2,P=(g+w)/2,$=S-B,x=w-g,C=Math.sqrt($*$+x*x),I=C*.15,G=-x/C,ht=$/C,et=M+G*I,nt=P+ht*I;u.append("path").attr("class","cynefinArrowLine").attr("d",`M${B},${g} Q${et},${nt} ${S},${w}`).attr("fill","none").attr("marker-end",`url(#${r})`),y.label&&u.append("text").attr("class","cynefinArrowLabel").attr("x",et).attr("y",nt-6).attr("text-anchor","middle").attr("dominant-baseline","auto").text(y.label)})}W&&T.append("text").attr("class","cynefinTitle").attr("x",i/2).attr("y",-b/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text(W)},"draw"),Vt={draw:Ft},Et=s(()=>{const t=ot(),e=U();return Q(t,e.themeVariables).cynefin},"getCynefinTheme"),Ht=s(()=>{const t=Et();return`
|
|
2
|
+
.cynefinDomain {
|
|
3
|
+
stroke: none;
|
|
4
|
+
}
|
|
5
|
+
.cynefinDomainLabel {
|
|
6
|
+
font-size: ${t.domainFontSize}px;
|
|
7
|
+
font-weight: bold;
|
|
8
|
+
fill: ${t.labelColor};
|
|
9
|
+
}
|
|
10
|
+
.cynefinSubtitle {
|
|
11
|
+
font-size: ${t.itemFontSize-1}px;
|
|
12
|
+
fill: ${t.textColor};
|
|
13
|
+
font-style: italic;
|
|
14
|
+
}
|
|
15
|
+
.cynefinItem {
|
|
16
|
+
fill-opacity: 0.95;
|
|
17
|
+
stroke: ${t.boundaryColor};
|
|
18
|
+
stroke-width: 1;
|
|
19
|
+
}
|
|
20
|
+
.cynefinItemText {
|
|
21
|
+
font-size: ${t.itemFontSize}px;
|
|
22
|
+
fill: ${t.textColor};
|
|
23
|
+
}
|
|
24
|
+
.cynefinItemOverflow {
|
|
25
|
+
fill-opacity: 0.6;
|
|
26
|
+
stroke: ${t.boundaryColor};
|
|
27
|
+
stroke-width: 1;
|
|
28
|
+
stroke-dasharray: 3 2;
|
|
29
|
+
}
|
|
30
|
+
.cynefinBoundary {
|
|
31
|
+
stroke: ${t.boundaryColor};
|
|
32
|
+
stroke-width: ${t.boundaryWidth};
|
|
33
|
+
stroke-dasharray: 6 3;
|
|
34
|
+
}
|
|
35
|
+
.cynefinCliff {
|
|
36
|
+
stroke: ${t.cliffColor};
|
|
37
|
+
stroke-width: ${t.cliffWidth};
|
|
38
|
+
}
|
|
39
|
+
.cynefinConfusion {
|
|
40
|
+
stroke: ${t.boundaryColor};
|
|
41
|
+
stroke-width: 1.5;
|
|
42
|
+
stroke-dasharray: 4 2;
|
|
43
|
+
}
|
|
44
|
+
.cynefinArrowLine {
|
|
45
|
+
stroke: ${t.arrowColor};
|
|
46
|
+
stroke-width: ${t.arrowWidth};
|
|
47
|
+
fill: none;
|
|
48
|
+
}
|
|
49
|
+
.cynefinArrowHead {
|
|
50
|
+
fill: ${t.arrowColor};
|
|
51
|
+
stroke: none;
|
|
52
|
+
}
|
|
53
|
+
.cynefinArrowLabel {
|
|
54
|
+
font-size: ${t.itemFontSize-1}px;
|
|
55
|
+
fill: ${t.textColor};
|
|
56
|
+
}
|
|
57
|
+
.cynefinTitle {
|
|
58
|
+
font-size: ${t.domainFontSize+2}px;
|
|
59
|
+
font-weight: bold;
|
|
60
|
+
fill: ${t.labelColor};
|
|
61
|
+
}
|
|
62
|
+
`},"styles"),Gt=Ht,Qt={parser:Wt,db:Y,renderer:Vt,styles:Gt};export{Qt as diagram};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{s as pe,a as Hn,c as zn,b as Jn,f as Ce,e as T,i as Kn}from"./chunk-ZCHMQSOR-BhjCTig8.js";import{_ as x,c as Zn,l as m,bl as Qn,bm as er,aC as nr,aB as Ie,am as Re,ak as rr,ay as tr,b6 as ar}from"./mermaid.core-knGXJfjz.js";import{i as q,a as N,d as ke,e as K,b as Z,c as on,f as ge,g as sn,h as ir,j as dn,s as or,o as sr,k as dr,l as ve,m as ur,r as fr,U as _e,S as Me,n as be,p as we,q as H,t as un,u as fn,v as cr,w as R,x as lr,y as hr,z as pr,A as Ae,B as gr,C as cn,D as M,E as vr,F as br,H as wr,I as U,J as ln,K as hn,L as mr,M as me,N as pn,O as yr,P as gn,Q as xr,R as Er,G as P,T as l,V as Lr,W as O,X,Y as k,Z as Q}from"./graph-DGbsTEsI.js";import"./main-B_0jS_Gz.js";import"./modulepreload-polyfill-B5Qt9EMX.js";var Or=/\s/;function Nr(e){for(var n=e.length;n--&&Or.test(e.charAt(n)););return n}var Pr=/^\s+/;function Tr(e){return e&&e.slice(0,Nr(e)+1).replace(Pr,"")}var je=NaN,Sr=/^[-+]0x[0-9a-f]+$/i,Cr=/^0b[01]+$/i,Ir=/^0o[0-7]+$/i,Rr=parseInt;function kr(e){if(typeof e=="number")return e;if(q(e))return je;if(N(e)){var n=typeof e.valueOf=="function"?e.valueOf():e;e=N(n)?n+"":n}if(typeof e!="string")return e===0?e:+e;e=Tr(e);var r=Cr.test(e);return r||Ir.test(e)?Rr(e.slice(2),r?2:8):Sr.test(e)?je:+e}var De=1/0,_r=17976931348623157e292;function V(e){if(!e)return e===0?e:0;if(e=kr(e),e===De||e===-De){var n=e<0?-1:1;return n*_r}return e===e?e:0}function Mr(e){var n=V(e),r=n%1;return n===n?r?n-r:n:0}var Be=Object.create,Ar=function(){function e(){}return function(n){if(!N(n))return{};if(Be)return Be(n);e.prototype=n;var r=new e;return e.prototype=void 0,r}}();function jr(e,n){var r=-1,t=e.length;for(n||(n=Array(t));++r<t;)n[r]=e[r];return n}function ee(e,n,r){n=="__proto__"&&ke?ke(e,n,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[n]=r}var Dr=Object.prototype,Br=Dr.hasOwnProperty;function ne(e,n,r){var t=e[n];(!(Br.call(e,n)&&K(t,r))||r===void 0&&!(n in e))&&ee(e,n,r)}function $r(e,n,r,t){var a=!r;r||(r={});for(var i=-1,o=n.length;++i<o;){var s=n[i],d=void 0;d===void 0&&(d=e[s]),a?ee(r,s,d):ne(r,s,d)}return r}function B(e,n,r){if(!N(r))return!1;var t=typeof n;return(t=="number"?Z(r)&&on(n,r.length):t=="string"&&n in r)?K(r[n],e):!1}function Fr(e){return ge(function(n,r){var t=-1,a=r.length,i=a>1?r[a-1]:void 0,o=a>2?r[2]:void 0;for(i=e.length>3&&typeof i=="function"?(a--,i):void 0,o&&B(r[0],r[1],o)&&(i=a<3?void 0:i,a=1),n=Object(n);++t<a;){var s=r[t];s&&e(n,s,t,i)}return n})}function Xr(e){var n=[];if(e!=null)for(var r in Object(e))n.push(r);return n}var Gr=Object.prototype,Yr=Gr.hasOwnProperty;function Ur(e){if(!N(e))return Xr(e);var n=sn(e),r=[];for(var t in e)t=="constructor"&&(n||!Yr.call(e,t))||r.push(t);return r}function re(e){return Z(e)?ir(e,!0):Ur(e)}function A(e){var n=e==null?0:e.length;return n?dn(e):[]}function Vr(e){return or(sr(e,void 0,A),e+"")}var vn=dr(Object.getPrototypeOf,Object),Wr="[object Object]",qr=Function.prototype,Hr=Object.prototype,bn=qr.toString,zr=Hr.hasOwnProperty,Jr=bn.call(Object);function Kr(e){if(!ve(e)||ur(e)!=Wr)return!1;var n=vn(e);if(n===null)return!0;var r=zr.call(n,"constructor")&&n.constructor;return typeof r=="function"&&r instanceof r&&bn.call(r)==Jr}var wn=typeof exports=="object"&&exports&&!exports.nodeType&&exports,$e=wn&&typeof module=="object"&&module&&!module.nodeType&&module,Zr=$e&&$e.exports===wn,Fe=Zr?fr.Buffer:void 0,Xe=Fe?Fe.allocUnsafe:void 0;function mn(e,n){if(n)return e.slice();var r=e.length,t=Xe?Xe(r):new e.constructor(r);return e.copy(t),t}var Qr=Object.prototype,et=Qr.hasOwnProperty;function nt(e){var n=e.length,r=new e.constructor(n);return n&&typeof e[0]=="string"&&et.call(e,"index")&&(r.index=e.index,r.input=e.input),r}function ye(e){var n=new e.constructor(e.byteLength);return new _e(n).set(new _e(e)),n}function rt(e,n){var r=ye(e.buffer);return new e.constructor(r,e.byteOffset,e.byteLength)}var tt=/\w*$/;function at(e){var n=new e.constructor(e.source,tt.exec(e));return n.lastIndex=e.lastIndex,n}var Ge=Me?Me.prototype:void 0,Ye=Ge?Ge.valueOf:void 0;function it(e){return Ye?Object(Ye.call(e)):{}}function yn(e,n){var r=n?ye(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}var ot="[object Boolean]",st="[object Date]",dt="[object Map]",ut="[object Number]",ft="[object RegExp]",ct="[object Set]",lt="[object String]",ht="[object Symbol]",pt="[object ArrayBuffer]",gt="[object DataView]",vt="[object Float32Array]",bt="[object Float64Array]",wt="[object Int8Array]",mt="[object Int16Array]",yt="[object Int32Array]",xt="[object Uint8Array]",Et="[object Uint8ClampedArray]",Lt="[object Uint16Array]",Ot="[object Uint32Array]";function Nt(e,n,r){var t=e.constructor;switch(n){case pt:return ye(e);case ot:case st:return new t(+e);case gt:return rt(e);case vt:case bt:case wt:case mt:case yt:case xt:case Et:case Lt:case Ot:return yn(e,r);case dt:return new t;case ut:case lt:return new t(e);case ft:return at(e);case ct:return new t;case ht:return it(e)}}function xn(e){return typeof e.constructor=="function"&&!sn(e)?Ar(vn(e)):{}}var Pt="[object Map]";function Tt(e){return ve(e)&&be(e)==Pt}var Ue=H&&H.isMap,St=Ue?we(Ue):Tt,Ct="[object Set]";function It(e){return ve(e)&&be(e)==Ct}var Ve=H&&H.isSet,Rt=Ve?we(Ve):It,kt=1,En="[object Arguments]",_t="[object Array]",Mt="[object Boolean]",At="[object Date]",jt="[object Error]",Ln="[object Function]",Dt="[object GeneratorFunction]",Bt="[object Map]",$t="[object Number]",On="[object Object]",Ft="[object RegExp]",Xt="[object Set]",Gt="[object String]",Yt="[object Symbol]",Ut="[object WeakMap]",Vt="[object ArrayBuffer]",Wt="[object DataView]",qt="[object Float32Array]",Ht="[object Float64Array]",zt="[object Int8Array]",Jt="[object Int16Array]",Kt="[object Int32Array]",Zt="[object Uint8Array]",Qt="[object Uint8ClampedArray]",ea="[object Uint16Array]",na="[object Uint32Array]",y={};y[En]=y[_t]=y[Vt]=y[Wt]=y[Mt]=y[At]=y[qt]=y[Ht]=y[zt]=y[Jt]=y[Kt]=y[Bt]=y[$t]=y[On]=y[Ft]=y[Xt]=y[Gt]=y[Yt]=y[Zt]=y[Qt]=y[ea]=y[na]=!0;y[jt]=y[Ln]=y[Ut]=!1;function W(e,n,r,t,a,i){var o,s=n&kt;if(o!==void 0)return o;if(!N(e))return e;var d=R(e);if(d)o=nt(e);else{var u=be(e),f=u==Ln||u==Dt;if(un(e))return mn(e,s);if(u==On||u==En||f&&!a)o=f?{}:xn(e);else{if(!y[u])return a?e:{};o=Nt(e,u,s)}}i||(i=new fn);var c=i.get(e);if(c)return c;i.set(e,o),Rt(e)?e.forEach(function(p){o.add(W(p,n,r,p,e,i))}):St(e)&&e.forEach(function(p,g){o.set(g,W(p,n,r,g,e,i))});var h=lr,b=d?void 0:h(e);return cr(b||e,function(p,g){b&&(g=p,p=e[g]),ne(o,g,W(p,n,r,g,e,i))}),o}var ra=1,ta=4;function aa(e){return W(e,ra|ta)}var Nn=Object.prototype,ia=Nn.hasOwnProperty,oa=ge(function(e,n){e=Object(e);var r=-1,t=n.length,a=t>2?n[2]:void 0;for(a&&B(n[0],n[1],a)&&(t=1);++r<t;)for(var i=n[r],o=re(i),s=-1,d=o.length;++s<d;){var u=o[s],f=e[u];(f===void 0||K(f,Nn[u])&&!ia.call(e,u))&&(e[u]=i[u])}return e});function fe(e,n,r){(r!==void 0&&!K(e[n],r)||r===void 0&&!(n in e))&&ee(e,n,r)}function ce(e,n){if(!(n==="constructor"&&typeof e[n]=="function")&&n!="__proto__")return e[n]}function sa(e){return $r(e,re(e))}function da(e,n,r,t,a,i,o){var s=ce(e,r),d=ce(n,r),u=o.get(d);if(u){fe(e,r,u);return}var f=i?i(s,d,r+"",e,n,o):void 0,c=f===void 0;if(c){var h=R(d),b=!h&&un(d),p=!h&&!b&&hr(d);f=d,h||b||p?R(s)?f=s:pr(s)?f=jr(s):b?(c=!1,f=mn(d,!0)):p?(c=!1,f=yn(d,!0)):f=[]:Kr(d)||Ae(d)?(f=s,Ae(s)?f=sa(s):(!N(s)||gr(s))&&(f=xn(d))):c=!1}c&&(o.set(d,f),a(f,d,t,i,o),o.delete(d)),fe(e,r,f)}function Pn(e,n,r,t,a){e!==n&&cn(n,function(i,o){if(a||(a=new fn),N(i))da(e,n,o,r,Pn,t,a);else{var s=t?t(ce(e,o),i,o+"",e,n,a):void 0;s===void 0&&(s=i),fe(e,o,s)}},re)}function z(e){var n=e==null?0:e.length;return n?e[n-1]:void 0}function ua(e){return function(n,r,t){var a=Object(n);if(!Z(n)){var i=M(r);n=vr(n),r=function(s){return i(a[s],s,a)}}var o=e(n,r,t);return o>-1?a[i?n[o]:o]:void 0}}var fa=Math.max;function ca(e,n,r){var t=e==null?0:e.length;if(!t)return-1;var a=r==null?0:Mr(r);return a<0&&(a=fa(t+a,0)),br(e,M(n),a)}var xe=ua(ca);function Tn(e,n){var r=-1,t=Z(e)?Array(e.length):[];return wr(e,function(a,i,o){t[++r]=n(a,i,o)}),t}function E(e,n){var r=R(e)?U:Tn;return r(e,M(n))}function la(e,n){return e==null?e:cn(e,ln(n),re)}function ha(e,n){return e&&hn(e,ln(n))}function pa(e,n){return e>n}var ga=Object.prototype,va=ga.hasOwnProperty;function ba(e,n){return e!=null&&va.call(e,n)}function Sn(e,n){return e!=null&&mr(e,n,ba)}function Cn(e,n){return e<n}function te(e,n){var r={};return n=M(n),hn(e,function(t,a,i){ee(r,a,n(t,a,i))}),r}function Ee(e,n,r){for(var t=-1,a=e.length;++t<a;){var i=e[t],o=n(i);if(o!=null&&(s===void 0?o===o&&!q(o):r(o,s)))var s=o,d=i}return d}function C(e){return e&&e.length?Ee(e,me,pa):void 0}var le=Fr(function(e,n,r){Pn(e,n,r)});function $(e){return e&&e.length?Ee(e,me,Cn):void 0}function Le(e,n){return e&&e.length?Ee(e,M(n),Cn):void 0}function wa(e,n,r,t){if(!N(e))return e;n=pn(n,e);for(var a=-1,i=n.length,o=i-1,s=e;s!=null&&++a<i;){var d=yr(n[a]),u=r;if(d==="__proto__"||d==="constructor"||d==="prototype")return e;if(a!=o){var f=s[d];u=void 0,u===void 0&&(u=N(f)?f:on(n[a+1])?[]:{})}ne(s,d,u),s=s[d]}return e}function ma(e,n,r){for(var t=-1,a=n.length,i={};++t<a;){var o=n[t],s=gn(e,o);r(s,o)&&wa(i,pn(o,e),s)}return i}function ya(e,n){var r=e.length;for(e.sort(n);r--;)e[r]=e[r].value;return e}function xa(e,n){if(e!==n){var r=e!==void 0,t=e===null,a=e===e,i=q(e),o=n!==void 0,s=n===null,d=n===n,u=q(n);if(!s&&!u&&!i&&e>n||i&&o&&d&&!s&&!u||t&&o&&d||!r&&d||!a)return 1;if(!t&&!i&&!u&&e<n||u&&r&&a&&!t&&!i||s&&r&&a||!o&&a||!d)return-1}return 0}function Ea(e,n,r){for(var t=-1,a=e.criteria,i=n.criteria,o=a.length,s=r.length;++t<o;){var d=xa(a[t],i[t]);if(d){if(t>=s)return d;var u=r[t];return d*(u=="desc"?-1:1)}}return e.index-n.index}function La(e,n,r){n.length?n=U(n,function(i){return R(i)?function(o){return gn(o,i.length===1?i[0]:i)}:i}):n=[me];var t=-1;n=U(n,we(M));var a=Tn(e,function(i,o,s){var d=U(n,function(u){return u(i)});return{criteria:d,index:++t,value:i}});return ya(a,function(i,o){return Ea(i,o,r)})}function Oa(e,n){return ma(e,n,function(r,t){return xr(e,t)})}var J=Vr(function(e,n){return e==null?{}:Oa(e,n)}),Na=Math.ceil,Pa=Math.max;function Ta(e,n,r,t){for(var a=-1,i=Pa(Na((n-e)/(r||1)),0),o=Array(i);i--;)o[++a]=e,e+=r;return o}function Sa(e){return function(n,r,t){return t&&typeof t!="number"&&B(n,r,t)&&(r=t=void 0),n=V(n),r===void 0?(r=n,n=0):r=V(r),t=t===void 0?n<r?1:-1:V(t),Ta(n,r,t)}}var _=Sa(),G=ge(function(e,n){if(e==null)return[];var r=n.length;return r>1&&B(e,n[0],n[1])?n=[]:r>2&&B(n[0],n[1],n[2])&&(n=[n[0]]),La(e,dn(n),[])}),Ca=0;function Oe(e){var n=++Ca;return Er(e)+n}function Ia(e,n,r){for(var t=-1,a=e.length,i=n.length,o={};++t<a;){var s=t<i?n[t]:void 0;r(o,e[t],s)}return o}function Ra(e,n){return Ia(e||[],n||[],ne)}class ka{constructor(){var n={};n._next=n._prev=n,this._sentinel=n}dequeue(){var n=this._sentinel,r=n._prev;if(r!==n)return We(r),r}enqueue(n){var r=this._sentinel;n._prev&&n._next&&We(n),n._next=r._next,r._next._prev=n,r._next=n,n._prev=r}toString(){for(var n=[],r=this._sentinel,t=r._prev;t!==r;)n.push(JSON.stringify(t,_a)),t=t._prev;return"["+n.join(", ")+"]"}}function We(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function _a(e,n){if(e!=="_next"&&e!=="_prev")return n}var Ma=Lr(1);function Aa(e,n){if(e.nodeCount()<=1)return[];var r=Da(e,n||Ma),t=ja(r.graph,r.buckets,r.zeroIdx);return A(E(t,function(a){return e.outEdges(a.v,a.w)}))}function ja(e,n,r){for(var t=[],a=n[n.length-1],i=n[0],o;e.nodeCount();){for(;o=i.dequeue();)ie(e,n,r,o);for(;o=a.dequeue();)ie(e,n,r,o);if(e.nodeCount()){for(var s=n.length-2;s>0;--s)if(o=n[s].dequeue(),o){t=t.concat(ie(e,n,r,o,!0));break}}}return t}function ie(e,n,r,t,a){var i=a?[]:void 0;return l(e.inEdges(t.v),function(o){var s=e.edge(o),d=e.node(o.v);a&&i.push({v:o.v,w:o.w}),d.out-=s,he(n,r,d)}),l(e.outEdges(t.v),function(o){var s=e.edge(o),d=o.w,u=e.node(d);u.in-=s,he(n,r,u)}),e.removeNode(t.v),i}function Da(e,n){var r=new P,t=0,a=0;l(e.nodes(),function(s){r.setNode(s,{v:s,in:0,out:0})}),l(e.edges(),function(s){var d=r.edge(s.v,s.w)||0,u=n(s),f=d+u;r.setEdge(s.v,s.w,f),a=Math.max(a,r.node(s.v).out+=u),t=Math.max(t,r.node(s.w).in+=u)});var i=_(a+t+3).map(function(){return new ka}),o=t+1;return l(r.nodes(),function(s){he(i,o,r.node(s))}),{graph:r,buckets:i,zeroIdx:o}}function he(e,n,r){r.out?r.in?e[r.out-r.in+n].enqueue(r):e[e.length-1].enqueue(r):e[0].enqueue(r)}function Ba(e){var n=e.graph().acyclicer==="greedy"?Aa(e,r(e)):$a(e);l(n,function(t){var a=e.edge(t);e.removeEdge(t),a.forwardName=t.name,a.reversed=!0,e.setEdge(t.w,t.v,a,Oe("rev"))});function r(t){return function(a){return t.edge(a).weight}}}function $a(e){var n=[],r={},t={};function a(i){Object.prototype.hasOwnProperty.call(t,i)||(t[i]=!0,r[i]=!0,l(e.outEdges(i),function(o){Object.prototype.hasOwnProperty.call(r,o.w)?n.push(o):a(o.w)}),delete r[i])}return l(e.nodes(),a),n}function Fa(e){l(e.edges(),function(n){var r=e.edge(n);if(r.reversed){e.removeEdge(n);var t=r.forwardName;delete r.reversed,delete r.forwardName,e.setEdge(n.w,n.v,r,t)}})}function j(e,n,r,t){var a;do a=Oe(t);while(e.hasNode(a));return r.dummy=n,e.setNode(a,r),a}function Xa(e){var n=new P().setGraph(e.graph());return l(e.nodes(),function(r){n.setNode(r,e.node(r))}),l(e.edges(),function(r){var t=n.edge(r.v,r.w)||{weight:0,minlen:1},a=e.edge(r);n.setEdge(r.v,r.w,{weight:t.weight+a.weight,minlen:Math.max(t.minlen,a.minlen)})}),n}function In(e){var n=new P({multigraph:e.isMultigraph()}).setGraph(e.graph());return l(e.nodes(),function(r){e.children(r).length||n.setNode(r,e.node(r))}),l(e.edges(),function(r){n.setEdge(r,e.edge(r))}),n}function qe(e,n){var r=e.x,t=e.y,a=n.x-r,i=n.y-t,o=e.width/2,s=e.height/2;if(!a&&!i)throw new Error("Not possible to find intersection inside of the rectangle");var d,u;return Math.abs(i)*o>Math.abs(a)*s?(i<0&&(s=-s),d=s*a/i,u=s):(a<0&&(o=-o),d=o,u=o*i/a),{x:r+d,y:t+u}}function ae(e){var n=E(_(Rn(e)+1),function(){return[]});return l(e.nodes(),function(r){var t=e.node(r),a=t.rank;O(a)||(n[a][t.order]=r)}),n}function Ga(e){var n=$(E(e.nodes(),function(r){return e.node(r).rank}));l(e.nodes(),function(r){var t=e.node(r);Sn(t,"rank")&&(t.rank-=n)})}function Ya(e){var n=$(E(e.nodes(),function(i){return e.node(i).rank})),r=[];l(e.nodes(),function(i){var o=e.node(i).rank-n;r[o]||(r[o]=[]),r[o].push(i)});var t=0,a=e.graph().nodeRankFactor;l(r,function(i,o){O(i)&&o%a!==0?--t:t&&l(i,function(s){e.node(s).rank+=t})})}function He(e,n,r,t){var a={width:0,height:0};return arguments.length>=4&&(a.rank=r,a.order=t),j(e,"border",a,n)}function Rn(e){return C(E(e.nodes(),function(n){var r=e.node(n).rank;if(!O(r))return r}))}function Ua(e,n){var r={lhs:[],rhs:[]};return l(e,function(t){n(t)?r.lhs.push(t):r.rhs.push(t)}),r}function Va(e,n){return n()}function Wa(e){function n(r){var t=e.children(r),a=e.node(r);if(t.length&&l(t,n),Object.prototype.hasOwnProperty.call(a,"minRank")){a.borderLeft=[],a.borderRight=[];for(var i=a.minRank,o=a.maxRank+1;i<o;++i)ze(e,"borderLeft","_bl",r,a,i),ze(e,"borderRight","_br",r,a,i)}}l(e.children(),n)}function ze(e,n,r,t,a,i){var o={width:0,height:0,rank:i,borderType:n},s=a[n][i-1],d=j(e,"border",o,r);a[n][i]=d,e.setParent(d,t),s&&e.setEdge(s,d,{weight:1})}function qa(e){var n=e.graph().rankdir.toLowerCase();(n==="lr"||n==="rl")&&kn(e)}function Ha(e){var n=e.graph().rankdir.toLowerCase();(n==="bt"||n==="rl")&&za(e),(n==="lr"||n==="rl")&&(Ja(e),kn(e))}function kn(e){l(e.nodes(),function(n){Je(e.node(n))}),l(e.edges(),function(n){Je(e.edge(n))})}function Je(e){var n=e.width;e.width=e.height,e.height=n}function za(e){l(e.nodes(),function(n){oe(e.node(n))}),l(e.edges(),function(n){var r=e.edge(n);l(r.points,oe),Object.prototype.hasOwnProperty.call(r,"y")&&oe(r)})}function oe(e){e.y=-e.y}function Ja(e){l(e.nodes(),function(n){se(e.node(n))}),l(e.edges(),function(n){var r=e.edge(n);l(r.points,se),Object.prototype.hasOwnProperty.call(r,"x")&&se(r)})}function se(e){var n=e.x;e.x=e.y,e.y=n}function Ka(e){e.graph().dummyChains=[],l(e.edges(),function(n){Za(e,n)})}function Za(e,n){var r=n.v,t=e.node(r).rank,a=n.w,i=e.node(a).rank,o=n.name,s=e.edge(n),d=s.labelRank;if(i!==t+1){e.removeEdge(n);var u=void 0,f,c;for(c=0,++t;t<i;++c,++t)s.points=[],u={width:0,height:0,edgeLabel:s,edgeObj:n,rank:t},f=j(e,"edge",u,"_d"),t===d&&(u.width=s.width,u.height=s.height,u.dummy="edge-label",u.labelpos=s.labelpos),e.setEdge(r,f,{weight:s.weight},o),c===0&&e.graph().dummyChains.push(f),r=f;e.setEdge(r,a,{weight:s.weight},o)}}function Qa(e){l(e.graph().dummyChains,function(n){var r=e.node(n),t=r.edgeLabel,a;for(e.setEdge(r.edgeObj,t);r.dummy;)a=e.successors(n)[0],e.removeNode(n),t.points.push({x:r.x,y:r.y}),r.dummy==="edge-label"&&(t.x=r.x,t.y=r.y,t.width=r.width,t.height=r.height),n=a,r=e.node(n)})}function Ne(e){var n={};function r(t){var a=e.node(t);if(Object.prototype.hasOwnProperty.call(n,t))return a.rank;n[t]=!0;var i=$(E(e.outEdges(t),function(o){return r(o.w)-e.edge(o).minlen}));return(i===Number.POSITIVE_INFINITY||i===void 0||i===null)&&(i=0),a.rank=i}l(e.sources(),r)}function F(e,n){return e.node(n.w).rank-e.node(n.v).rank-e.edge(n).minlen}function _n(e){var n=new P({directed:!1}),r=e.nodes()[0],t=e.nodeCount();n.setNode(r,{});for(var a,i;ei(n,e)<t;)a=ni(n,e),i=n.hasNode(a.v)?F(e,a):-F(e,a),ri(n,e,i);return n}function ei(e,n){function r(t){l(n.nodeEdges(t),function(a){var i=a.v,o=t===i?a.w:i;!e.hasNode(o)&&!F(n,a)&&(e.setNode(o,{}),e.setEdge(t,o,{}),r(o))})}return l(e.nodes(),r),e.nodeCount()}function ni(e,n){return Le(n.edges(),function(r){if(e.hasNode(r.v)!==e.hasNode(r.w))return F(n,r)})}function ri(e,n,r){l(e.nodes(),function(t){n.node(t).rank+=r})}function ti(){}ti.prototype=new Error;function Mn(e,n,r){R(n)||(n=[n]);var t=(e.isDirected()?e.successors:e.neighbors).bind(e),a=[],i={};return l(n,function(o){if(!e.hasNode(o))throw new Error("Graph does not have node: "+o);An(e,o,r==="post",i,t,a)}),a}function An(e,n,r,t,a,i){Object.prototype.hasOwnProperty.call(t,n)||(t[n]=!0,r||i.push(n),l(a(n),function(o){An(e,o,r,t,a,i)}),r&&i.push(n))}function ai(e,n){return Mn(e,n,"post")}function ii(e,n){return Mn(e,n,"pre")}I.initLowLimValues=Te;I.initCutValues=Pe;I.calcCutValue=jn;I.leaveEdge=Bn;I.enterEdge=$n;I.exchangeEdges=Fn;function I(e){e=Xa(e),Ne(e);var n=_n(e);Te(n),Pe(n,e);for(var r,t;r=Bn(n);)t=$n(n,e,r),Fn(n,e,r,t)}function Pe(e,n){var r=ai(e,e.nodes());r=r.slice(0,r.length-1),l(r,function(t){oi(e,n,t)})}function oi(e,n,r){var t=e.node(r),a=t.parent;e.edge(r,a).cutvalue=jn(e,n,r)}function jn(e,n,r){var t=e.node(r),a=t.parent,i=!0,o=n.edge(r,a),s=0;return o||(i=!1,o=n.edge(a,r)),s=o.weight,l(n.nodeEdges(r),function(d){var u=d.v===r,f=u?d.w:d.v;if(f!==a){var c=u===i,h=n.edge(d).weight;if(s+=c?h:-h,di(e,r,f)){var b=e.edge(r,f).cutvalue;s+=c?-b:b}}}),s}function Te(e,n){arguments.length<2&&(n=e.nodes()[0]),Dn(e,{},1,n)}function Dn(e,n,r,t,a){var i=r,o=e.node(t);return n[t]=!0,l(e.neighbors(t),function(s){Object.prototype.hasOwnProperty.call(n,s)||(r=Dn(e,n,r,s,t))}),o.low=i,o.lim=r++,a?o.parent=a:delete o.parent,r}function Bn(e){return xe(e.edges(),function(n){return e.edge(n).cutvalue<0})}function $n(e,n,r){var t=r.v,a=r.w;n.hasEdge(t,a)||(t=r.w,a=r.v);var i=e.node(t),o=e.node(a),s=i,d=!1;i.lim>o.lim&&(s=o,d=!0);var u=X(n.edges(),function(f){return d===Ke(e,e.node(f.v),s)&&d!==Ke(e,e.node(f.w),s)});return Le(u,function(f){return F(n,f)})}function Fn(e,n,r,t){var a=r.v,i=r.w;e.removeEdge(a,i),e.setEdge(t.v,t.w,{}),Te(e),Pe(e,n),si(e,n)}function si(e,n){var r=xe(e.nodes(),function(a){return!n.node(a).parent}),t=ii(e,r);t=t.slice(1),l(t,function(a){var i=e.node(a).parent,o=n.edge(a,i),s=!1;o||(o=n.edge(i,a),s=!0),n.node(a).rank=n.node(i).rank+(s?o.minlen:-o.minlen)})}function di(e,n,r){return e.hasEdge(n,r)}function Ke(e,n,r){return r.low<=n.lim&&n.lim<=r.lim}function ui(e){switch(e.graph().ranker){case"network-simplex":Ze(e);break;case"tight-tree":ci(e);break;case"longest-path":fi(e);break;default:Ze(e)}}var fi=Ne;function ci(e){Ne(e),_n(e)}function Ze(e){I(e)}function li(e){var n=j(e,"root",{},"_root"),r=hi(e),t=C(k(r))-1,a=2*t+1;e.graph().nestingRoot=n,l(e.edges(),function(o){e.edge(o).minlen*=a});var i=pi(e)+1;l(e.children(),function(o){Xn(e,n,a,i,t,r,o)}),e.graph().nodeRankFactor=a}function Xn(e,n,r,t,a,i,o){var s=e.children(o);if(!s.length){o!==n&&e.setEdge(n,o,{weight:0,minlen:r});return}var d=He(e,"_bt"),u=He(e,"_bb"),f=e.node(o);e.setParent(d,o),f.borderTop=d,e.setParent(u,o),f.borderBottom=u,l(s,function(c){Xn(e,n,r,t,a,i,c);var h=e.node(c),b=h.borderTop?h.borderTop:c,p=h.borderBottom?h.borderBottom:c,g=h.borderTop?t:2*t,v=b!==p?1:a-i[o]+1;e.setEdge(d,b,{weight:g,minlen:v,nestingEdge:!0}),e.setEdge(p,u,{weight:g,minlen:v,nestingEdge:!0})}),e.parent(o)||e.setEdge(n,d,{weight:0,minlen:a+i[o]})}function hi(e){var n={};function r(t,a){var i=e.children(t);i&&i.length&&l(i,function(o){r(o,a+1)}),n[t]=a}return l(e.children(),function(t){r(t,1)}),n}function pi(e){return Q(e.edges(),function(n,r){return n+e.edge(r).weight},0)}function gi(e){var n=e.graph();e.removeNode(n.nestingRoot),delete n.nestingRoot,l(e.edges(),function(r){var t=e.edge(r);t.nestingEdge&&e.removeEdge(r)})}function vi(e,n,r){var t={},a;l(r,function(i){for(var o=e.parent(i),s,d;o;){if(s=e.parent(o),s?(d=t[s],t[s]=o):(d=a,a=o),d&&d!==o){n.setEdge(d,o);return}o=s}})}function bi(e,n,r){var t=wi(e),a=new P({compound:!0}).setGraph({root:t}).setDefaultNodeLabel(function(i){return e.node(i)});return l(e.nodes(),function(i){var o=e.node(i),s=e.parent(i);(o.rank===n||o.minRank<=n&&n<=o.maxRank)&&(a.setNode(i),a.setParent(i,s||t),l(e[r](i),function(d){var u=d.v===i?d.w:d.v,f=a.edge(u,i),c=O(f)?0:f.weight;a.setEdge(u,i,{weight:e.edge(d).weight+c})}),Object.prototype.hasOwnProperty.call(o,"minRank")&&a.setNode(i,{borderLeft:o.borderLeft[n],borderRight:o.borderRight[n]}))}),a}function wi(e){for(var n;e.hasNode(n=Oe("_root")););return n}function mi(e,n){for(var r=0,t=1;t<n.length;++t)r+=yi(e,n[t-1],n[t]);return r}function yi(e,n,r){for(var t=Ra(r,E(r,function(u,f){return f})),a=A(E(n,function(u){return G(E(e.outEdges(u),function(f){return{pos:t[f.w],weight:e.edge(f).weight}}),"pos")})),i=1;i<r.length;)i<<=1;var o=2*i-1;i-=1;var s=E(new Array(o),function(){return 0}),d=0;return l(a.forEach(function(u){var f=u.pos+i;s[f]+=u.weight;for(var c=0;f>0;)f%2&&(c+=s[f+1]),f=f-1>>1,s[f]+=u.weight;d+=u.weight*c})),d}function xi(e){var n={},r=X(e.nodes(),function(s){return!e.children(s).length}),t=C(E(r,function(s){return e.node(s).rank})),a=E(_(t+1),function(){return[]});function i(s){if(!Sn(n,s)){n[s]=!0;var d=e.node(s);a[d.rank].push(s),l(e.successors(s),i)}}var o=G(r,function(s){return e.node(s).rank});return l(o,i),a}function Ei(e,n){return E(n,function(r){var t=e.inEdges(r);if(t.length){var a=Q(t,function(i,o){var s=e.edge(o),d=e.node(o.v);return{sum:i.sum+s.weight*d.order,weight:i.weight+s.weight}},{sum:0,weight:0});return{v:r,barycenter:a.sum/a.weight,weight:a.weight}}else return{v:r}})}function Li(e,n){var r={};l(e,function(a,i){var o=r[a.v]={indegree:0,in:[],out:[],vs:[a.v],i};O(a.barycenter)||(o.barycenter=a.barycenter,o.weight=a.weight)}),l(n.edges(),function(a){var i=r[a.v],o=r[a.w];!O(i)&&!O(o)&&(o.indegree++,i.out.push(r[a.w]))});var t=X(r,function(a){return!a.indegree});return Oi(t)}function Oi(e){var n=[];function r(i){return function(o){o.merged||(O(o.barycenter)||O(i.barycenter)||o.barycenter>=i.barycenter)&&Ni(i,o)}}function t(i){return function(o){o.in.push(i),--o.indegree===0&&e.push(o)}}for(;e.length;){var a=e.pop();n.push(a),l(a.in.reverse(),r(a)),l(a.out,t(a))}return E(X(n,function(i){return!i.merged}),function(i){return J(i,["vs","i","barycenter","weight"])})}function Ni(e,n){var r=0,t=0;e.weight&&(r+=e.barycenter*e.weight,t+=e.weight),n.weight&&(r+=n.barycenter*n.weight,t+=n.weight),e.vs=n.vs.concat(e.vs),e.barycenter=r/t,e.weight=t,e.i=Math.min(n.i,e.i),n.merged=!0}function Pi(e,n){var r=Ua(e,function(f){return Object.prototype.hasOwnProperty.call(f,"barycenter")}),t=r.lhs,a=G(r.rhs,function(f){return-f.i}),i=[],o=0,s=0,d=0;t.sort(Ti(!!n)),d=Qe(i,a,d),l(t,function(f){d+=f.vs.length,i.push(f.vs),o+=f.barycenter*f.weight,s+=f.weight,d=Qe(i,a,d)});var u={vs:A(i)};return s&&(u.barycenter=o/s,u.weight=s),u}function Qe(e,n,r){for(var t;n.length&&(t=z(n)).i<=r;)n.pop(),e.push(t.vs),r++;return r}function Ti(e){return function(n,r){return n.barycenter<r.barycenter?-1:n.barycenter>r.barycenter?1:e?r.i-n.i:n.i-r.i}}function Gn(e,n,r,t){var a=e.children(n),i=e.node(n),o=i?i.borderLeft:void 0,s=i?i.borderRight:void 0,d={};o&&(a=X(a,function(p){return p!==o&&p!==s}));var u=Ei(e,a);l(u,function(p){if(e.children(p.v).length){var g=Gn(e,p.v,r,t);d[p.v]=g,Object.prototype.hasOwnProperty.call(g,"barycenter")&&Ci(p,g)}});var f=Li(u,r);Si(f,d);var c=Pi(f,t);if(o&&(c.vs=A([o,c.vs,s]),e.predecessors(o).length)){var h=e.node(e.predecessors(o)[0]),b=e.node(e.predecessors(s)[0]);Object.prototype.hasOwnProperty.call(c,"barycenter")||(c.barycenter=0,c.weight=0),c.barycenter=(c.barycenter*c.weight+h.order+b.order)/(c.weight+2),c.weight+=2}return c}function Si(e,n){l(e,function(r){r.vs=A(r.vs.map(function(t){return n[t]?n[t].vs:t}))})}function Ci(e,n){O(e.barycenter)?(e.barycenter=n.barycenter,e.weight=n.weight):(e.barycenter=(e.barycenter*e.weight+n.barycenter*n.weight)/(e.weight+n.weight),e.weight+=n.weight)}function Ii(e){var n=Rn(e),r=en(e,_(1,n+1),"inEdges"),t=en(e,_(n-1,-1,-1),"outEdges"),a=xi(e);nn(e,a);for(var i=Number.POSITIVE_INFINITY,o,s=0,d=0;d<4;++s,++d){Ri(s%2?r:t,s%4>=2),a=ae(e);var u=mi(e,a);u<i&&(d=0,o=aa(a),i=u)}nn(e,o)}function en(e,n,r){return E(n,function(t){return bi(e,t,r)})}function Ri(e,n){var r=new P;l(e,function(t){var a=t.graph().root,i=Gn(t,a,r,n);l(i.vs,function(o,s){t.node(o).order=s}),vi(t,r,i.vs)})}function nn(e,n){l(n,function(r){l(r,function(t,a){e.node(t).order=a})})}function ki(e){var n=Mi(e);l(e.graph().dummyChains,function(r){for(var t=e.node(r),a=t.edgeObj,i=_i(e,n,a.v,a.w),o=i.path,s=i.lca,d=0,u=o[d],f=!0;r!==a.w;){if(t=e.node(r),f){for(;(u=o[d])!==s&&e.node(u).maxRank<t.rank;)d++;u===s&&(f=!1)}if(!f){for(;d<o.length-1&&e.node(u=o[d+1]).minRank<=t.rank;)d++;u=o[d]}e.setParent(r,u),r=e.successors(r)[0]}})}function _i(e,n,r,t){var a=[],i=[],o=Math.min(n[r].low,n[t].low),s=Math.max(n[r].lim,n[t].lim),d,u;d=r;do d=e.parent(d),a.push(d);while(d&&(n[d].low>o||s>n[d].lim));for(u=d,d=t;(d=e.parent(d))!==u;)i.push(d);return{path:a.concat(i.reverse()),lca:u}}function Mi(e){var n={},r=0;function t(a){var i=r;l(e.children(a),t),n[a]={low:i,lim:r++}}return l(e.children(),t),n}function Ai(e,n){var r={};function t(a,i){var o=0,s=0,d=a.length,u=z(i);return l(i,function(f,c){var h=Di(e,f),b=h?e.node(h).order:d;(h||f===u)&&(l(i.slice(s,c+1),function(p){l(e.predecessors(p),function(g){var v=e.node(g),w=v.order;(w<o||b<w)&&!(v.dummy&&e.node(p).dummy)&&Yn(r,g,p)})}),s=c+1,o=b)}),i}return Q(n,t),r}function ji(e,n){var r={};function t(i,o,s,d,u){var f;l(_(o,s),function(c){f=i[c],e.node(f).dummy&&l(e.predecessors(f),function(h){var b=e.node(h);b.dummy&&(b.order<d||b.order>u)&&Yn(r,h,f)})})}function a(i,o){var s=-1,d,u=0;return l(o,function(f,c){if(e.node(f).dummy==="border"){var h=e.predecessors(f);h.length&&(d=e.node(h[0]).order,t(o,u,c,s,d),u=c,s=d)}t(o,u,o.length,d,i.length)}),o}return Q(n,a),r}function Di(e,n){if(e.node(n).dummy)return xe(e.predecessors(n),function(r){return e.node(r).dummy})}function Yn(e,n,r){if(n>r){var t=n;n=r,r=t}Object.prototype.hasOwnProperty.call(e,n)||Object.defineProperty(e,n,{enumerable:!0,configurable:!0,value:{},writable:!0});var a=e[n];Object.defineProperty(a,r,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function Bi(e,n,r){if(n>r){var t=n;n=r,r=t}return!!e[n]&&Object.prototype.hasOwnProperty.call(e[n],r)}function $i(e,n,r,t){var a={},i={},o={};return l(n,function(s){l(s,function(d,u){a[d]=d,i[d]=d,o[d]=u})}),l(n,function(s){var d=-1;l(s,function(u){var f=t(u);if(f.length){f=G(f,function(g){return o[g]});for(var c=(f.length-1)/2,h=Math.floor(c),b=Math.ceil(c);h<=b;++h){var p=f[h];i[u]===u&&d<o[p]&&!Bi(r,u,p)&&(i[p]=u,i[u]=a[u]=a[p],d=o[p])}}})}),{root:a,align:i}}function Fi(e,n,r,t,a){var i={},o=Xi(e,n,r,a),s=a?"borderLeft":"borderRight";function d(c,h){for(var b=o.nodes(),p=b.pop(),g={};p;)g[p]?c(p):(g[p]=!0,b.push(p),b=b.concat(h(p))),p=b.pop()}function u(c){i[c]=o.inEdges(c).reduce(function(h,b){return Math.max(h,i[b.v]+o.edge(b))},0)}function f(c){var h=o.outEdges(c).reduce(function(p,g){return Math.min(p,i[g.w]-o.edge(g))},Number.POSITIVE_INFINITY),b=e.node(c);h!==Number.POSITIVE_INFINITY&&b.borderType!==s&&(i[c]=Math.max(i[c],h))}return d(u,o.predecessors.bind(o)),d(f,o.successors.bind(o)),l(t,function(c){i[c]=i[r[c]]}),i}function Xi(e,n,r,t){var a=new P,i=e.graph(),o=Wi(i.nodesep,i.edgesep,t);return l(n,function(s){var d;l(s,function(u){var f=r[u];if(a.setNode(f),d){var c=r[d],h=a.edge(c,f);a.setEdge(c,f,Math.max(o(e,u,d),h||0))}d=u})}),a}function Gi(e,n){return Le(k(n),function(r){var t=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY;return la(r,function(i,o){var s=qi(e,o)/2;t=Math.max(i+s,t),a=Math.min(i-s,a)}),t-a})}function Yi(e,n){var r=k(n),t=$(r),a=C(r);l(["u","d"],function(i){l(["l","r"],function(o){var s=i+o,d=e[s],u;if(d!==n){var f=k(d);u=o==="l"?t-$(f):a-C(f),u&&(e[s]=te(d,function(c){return c+u}))}})})}function Ui(e,n){return te(e.ul,function(r,t){if(n)return e[n.toLowerCase()][t];var a=G(E(e,t));return(a[1]+a[2])/2})}function Vi(e){var n=ae(e),r=le(Ai(e,n),ji(e,n)),t={},a;l(["u","d"],function(o){a=o==="u"?n:k(n).reverse(),l(["l","r"],function(s){s==="r"&&(a=E(a,function(c){return k(c).reverse()}));var d=(o==="u"?e.predecessors:e.successors).bind(e),u=$i(e,a,r,d),f=Fi(e,a,u.root,u.align,s==="r");s==="r"&&(f=te(f,function(c){return-c})),t[o+s]=f})});var i=Gi(e,t);return Yi(t,i),Ui(t,e.graph().align)}function Wi(e,n,r){return function(t,a,i){var o=t.node(a),s=t.node(i),d=0,u;if(d+=o.width/2,Object.prototype.hasOwnProperty.call(o,"labelpos"))switch(o.labelpos.toLowerCase()){case"l":u=-o.width/2;break;case"r":u=o.width/2;break}if(u&&(d+=r?u:-u),u=0,d+=(o.dummy?n:e)/2,d+=(s.dummy?n:e)/2,d+=s.width/2,Object.prototype.hasOwnProperty.call(s,"labelpos"))switch(s.labelpos.toLowerCase()){case"l":u=s.width/2;break;case"r":u=-s.width/2;break}return u&&(d+=r?u:-u),u=0,d}}function qi(e,n){return e.node(n).width}function Hi(e){e=In(e),zi(e),ha(Vi(e),function(n,r){e.node(r).x=n})}function zi(e){var n=ae(e),r=e.graph().ranksep,t=0;l(n,function(a){var i=C(E(a,function(o){return e.node(o).height}));l(a,function(o){e.node(o).y=t+i/2}),t+=i+r})}function Ji(e,n){var r=Va;r("layout",()=>{var t=r(" buildLayoutGraph",()=>so(e));r(" runLayout",()=>Ki(t,r)),r(" updateInputGraph",()=>Zi(e,t))})}function Ki(e,n){n(" makeSpaceForEdgeLabels",()=>uo(e)),n(" removeSelfEdges",()=>wo(e)),n(" acyclic",()=>Ba(e)),n(" nestingGraph.run",()=>li(e)),n(" rank",()=>ui(In(e))),n(" injectEdgeLabelProxies",()=>fo(e)),n(" removeEmptyRanks",()=>Ya(e)),n(" nestingGraph.cleanup",()=>gi(e)),n(" normalizeRanks",()=>Ga(e)),n(" assignRankMinMax",()=>co(e)),n(" removeEdgeLabelProxies",()=>lo(e)),n(" normalize.run",()=>Ka(e)),n(" parentDummyChains",()=>ki(e)),n(" addBorderSegments",()=>Wa(e)),n(" order",()=>Ii(e)),n(" insertSelfEdges",()=>mo(e)),n(" adjustCoordinateSystem",()=>qa(e)),n(" position",()=>Hi(e)),n(" positionSelfEdges",()=>yo(e)),n(" removeBorderNodes",()=>bo(e)),n(" normalize.undo",()=>Qa(e)),n(" fixupEdgeLabelCoords",()=>go(e)),n(" undoCoordinateSystem",()=>Ha(e)),n(" translateGraph",()=>ho(e)),n(" assignNodeIntersects",()=>po(e)),n(" reversePoints",()=>vo(e)),n(" acyclic.undo",()=>Fa(e))}function Zi(e,n){l(e.nodes(),function(r){var t=e.node(r),a=n.node(r);t&&(t.x=a.x,t.y=a.y,n.children(r).length&&(t.width=a.width,t.height=a.height))}),l(e.edges(),function(r){var t=e.edge(r),a=n.edge(r);t.points=a.points,Object.prototype.hasOwnProperty.call(a,"x")&&(t.x=a.x,t.y=a.y)}),e.graph().width=n.graph().width,e.graph().height=n.graph().height}var Qi=["nodesep","edgesep","ranksep","marginx","marginy"],eo={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},no=["acyclicer","ranker","rankdir","align"],ro=["width","height"],to={width:0,height:0},ao=["minlen","weight","width","height","labeloffset"],io={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},oo=["labelpos"];function so(e){var n=new P({multigraph:!0,compound:!0}),r=ue(e.graph());return n.setGraph(le({},eo,de(r,Qi),J(r,no))),l(e.nodes(),function(t){var a=ue(e.node(t));n.setNode(t,oa(de(a,ro),to)),n.setParent(t,e.parent(t))}),l(e.edges(),function(t){var a=ue(e.edge(t));n.setEdge(t,le({},io,de(a,ao),J(a,oo)))}),n}function uo(e){var n=e.graph();n.ranksep/=2,l(e.edges(),function(r){var t=e.edge(r);t.minlen*=2,t.labelpos.toLowerCase()!=="c"&&(n.rankdir==="TB"||n.rankdir==="BT"?t.width+=t.labeloffset:t.height+=t.labeloffset)})}function fo(e){l(e.edges(),function(n){var r=e.edge(n);if(r.width&&r.height){var t=e.node(n.v),a=e.node(n.w),i={rank:(a.rank-t.rank)/2+t.rank,e:n};j(e,"edge-proxy",i,"_ep")}})}function co(e){var n=0;l(e.nodes(),function(r){var t=e.node(r);t.borderTop&&(t.minRank=e.node(t.borderTop).rank,t.maxRank=e.node(t.borderBottom).rank,n=C(n,t.maxRank))}),e.graph().maxRank=n}function lo(e){l(e.nodes(),function(n){var r=e.node(n);r.dummy==="edge-proxy"&&(e.edge(r.e).labelRank=r.rank,e.removeNode(n))})}function ho(e){var n=Number.POSITIVE_INFINITY,r=0,t=Number.POSITIVE_INFINITY,a=0,i=e.graph(),o=i.marginx||0,s=i.marginy||0;function d(u){var f=u.x,c=u.y,h=u.width,b=u.height;n=Math.min(n,f-h/2),r=Math.max(r,f+h/2),t=Math.min(t,c-b/2),a=Math.max(a,c+b/2)}l(e.nodes(),function(u){d(e.node(u))}),l(e.edges(),function(u){var f=e.edge(u);Object.prototype.hasOwnProperty.call(f,"x")&&d(f)}),n-=o,t-=s,l(e.nodes(),function(u){var f=e.node(u);f.x-=n,f.y-=t}),l(e.edges(),function(u){var f=e.edge(u);l(f.points,function(c){c.x-=n,c.y-=t}),Object.prototype.hasOwnProperty.call(f,"x")&&(f.x-=n),Object.prototype.hasOwnProperty.call(f,"y")&&(f.y-=t)}),i.width=r-n+o,i.height=a-t+s}function po(e){l(e.edges(),function(n){var r=e.edge(n),t=e.node(n.v),a=e.node(n.w),i,o;r.points?(i=r.points[0],o=r.points[r.points.length-1]):(r.points=[],i=a,o=t),r.points.unshift(qe(t,i)),r.points.push(qe(a,o))})}function go(e){l(e.edges(),function(n){var r=e.edge(n);if(Object.prototype.hasOwnProperty.call(r,"x"))switch((r.labelpos==="l"||r.labelpos==="r")&&(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset;break}})}function vo(e){l(e.edges(),function(n){var r=e.edge(n);r.reversed&&r.points.reverse()})}function bo(e){l(e.nodes(),function(n){if(e.children(n).length){var r=e.node(n),t=e.node(r.borderTop),a=e.node(r.borderBottom),i=e.node(z(r.borderLeft)),o=e.node(z(r.borderRight));r.width=Math.abs(o.x-i.x),r.height=Math.abs(a.y-t.y),r.x=i.x+r.width/2,r.y=t.y+r.height/2}}),l(e.nodes(),function(n){e.node(n).dummy==="border"&&e.removeNode(n)})}function wo(e){l(e.edges(),function(n){if(n.v===n.w){var r=e.node(n.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e:n,label:e.edge(n)}),e.removeEdge(n)}})}function mo(e){var n=ae(e);l(n,function(r){var t=0;l(r,function(a,i){var o=e.node(a);o.order=i+t,l(o.selfEdges,function(s){j(e,"selfedge",{width:s.label.width,height:s.label.height,rank:o.rank,order:i+ ++t,e:s.e,label:s.label},"_se")}),delete o.selfEdges})})}function yo(e){l(e.nodes(),function(n){var r=e.node(n);if(r.dummy==="selfedge"){var t=e.node(r.e.v),a=t.x+t.width/2,i=t.y,o=r.x-a,s=t.height/2;e.setEdge(r.e,r.label),e.removeNode(n),r.label.points=[{x:a+2*o/3,y:i-s},{x:a+5*o/6,y:i-s},{x:a+o,y:i},{x:a+5*o/6,y:i+s},{x:a+2*o/3,y:i+s}],r.label.x=r.x,r.label.y=r.y}})}function de(e,n){return te(J(e,n),Number)}function ue(e){var n={};return l(e,function(r,t){n[t.toLowerCase()]=r}),n}var rn=x((e,n,r)=>Math.max(n,Math.min(r,e)),"clamp"),tn=x((e="TB")=>{switch(e){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";case"TB":default:return"top"}},"getDefaultSelfLoopSide"),xo=x(e=>e==="flowchart"||e==="flowchart-v2"||e==="stateDiagram"||e==="er"||e==="classDiagram","shouldMergeSelfLoopSegments"),Eo=["x","y","width","height","labelBBox","intersect","calcIntersect","diff","clusterNode"],Lo=x((e,n,r,t,a)=>{const i=[],o=new Set;if(r.forEach(({start:f,end:c})=>{f!==t&&o.add(f),c!==t&&o.add(c)}),o.forEach(f=>{const c=e.node(f);typeof(c==null?void 0:c.x)=="number"&&typeof(c==null?void 0:c.y)=="number"&&i.push(c)}),i.length===0&&r.forEach(({edge:f})=>{(f.points??[]).forEach(c=>{typeof(c==null?void 0:c.x)=="number"&&typeof(c==null?void 0:c.y)=="number"&&i.push(c)})}),i.length===0)return tn(a);const s=i.reduce((f,c)=>({x:f.x+c.x/i.length,y:f.y+c.y/i.length}),{x:0,y:0}),d=s.x-n.x,u=s.y-n.y;return Math.abs(d)>Math.abs(u)?d>0?"right":"left":Math.abs(u)>0?u>0?"bottom":"top":tn(a)},"getSelfLoopSide"),Oo=x((e,n="top",r=0,t=0)=>{const a=e.x,i=e.y-r,o=e.width/2,s=e.height/2,d=Math.max(36,Math.min(100,e.width*.8)),u=rn(Math.max(t,e.width*.35),36,d),f=rn(Math.min(e.width,e.height)*.45,24,48);switch(n){case"bottom":{const c=i+s;return[{x:a-u/2,y:c},{x:a-u/2,y:c+f},{x:a+u/2,y:c+f},{x:a+u/2,y:c}]}case"right":{const c=a+o;return[{x:c,y:i-u/2},{x:c+f,y:i-u/2},{x:c+f,y:i+u/2},{x:c,y:i+u/2}]}case"left":{const c=a-o;return[{x:c,y:i-u/2},{x:c-f,y:i-u/2},{x:c-f,y:i+u/2},{x:c,y:i+u/2}]}case"top":default:{const c=i-s;return[{x:a-u/2,y:c},{x:a-u/2,y:c-f},{x:a+u/2,y:c-f},{x:a+u/2,y:c}]}}},"getSelfLoopPoints"),No=x((e,n,r="top",t=0,a={})=>{const o=e.x,s=e.y-t,d=a.width??0,u=a.height??0;switch(r){case"bottom":return{x:o,y:Math.max(...n.map(f=>f.y))+u/2+4};case"right":return{x:Math.max(...n.map(f=>f.x))+d/2+4,y:s};case"left":return{x:Math.min(...n.map(f=>f.x))-d/2-4,y:s};case"top":default:return{x:o,y:Math.min(...n.map(f=>f.y))-u/2-4}}},"getSelfLoopLabelPosition"),Un=x((e,n=0,{mergeSelfLoops:r=!0}={})=>{var o;const t=new Map,a=[],i=(o=e.graph())==null?void 0:o.rankdir;return e.edges().forEach(s=>{const d=e.edge(s);if(r&&d.selfLoop){const u=d.selfLoop.id;t.has(u)||t.set(u,[]),t.get(u).push({edge:d,start:s.v,end:s.w})}else a.push({edge:d,start:s.v,end:s.w})}),t.forEach(s=>{if(s.length!==3){s.forEach(L=>a.push(L));return}s.sort((L,S)=>L.edge.selfLoop.order-S.edge.selfLoop.order);const[d,u,f]=s,c=d.edge.originalEdge??u.edge.originalEdge??f.edge.originalEdge??u.edge,h=e.node(c.start);if(!h){s.forEach(L=>a.push(L));return}const b={width:u.edge.width,height:u.edge.height},p=Lo(e,h,s,c.start,i),g=Oo(h,p,n,b.width??0),v=No(h,g,p,n,b),w={...u.edge,...c,id:c.id,points:g,start:c.start,end:c.end,x:v.x,y:v.y,width:b.width,height:b.height,labelStyle:u.edge.labelStyle,fromCluster:d.edge.fromCluster??u.edge.fromCluster??f.edge.fromCluster,toCluster:d.edge.toCluster??u.edge.toCluster??f.edge.toCluster};delete w.selfLoop,delete w.originalEdge,a.push({edge:w,start:w.start,end:w.end})}),a},"getEdgesToRender"),Vn=x(async({element:e,graph:n,diagramType:r,id:t,parentCluster:a,siteConfig:i})=>{const o=n.graph().rankdir;m.trace("Dir in recursive render - dir:",o);const{clusters:s,edgePaths:d,edgeLabels:u,nodes:f,rootGroups:c}=Jn(e,{edgePathsClass:"edgePaths"});n.nodes()?m.info("Recursive render XXX",n.nodes()):m.info("No nodes found for",n),n.edges().length>0&&m.info("Recursive edges",n.edge(n.edges()[0]));const h=xo(r);await Promise.all(n.nodes().map(async function(g){const v=n.node(g);if(a!==void 0){const w=JSON.parse(JSON.stringify(a.clusterData));m.trace(`Setting data for parent cluster XXX
|
|
2
|
+
Node.id = `,g,`
|
|
3
|
+
data=`,w.height,`
|
|
4
|
+
Parent cluster`,a.height),n.setNode(a.id,w),n.parent(g)||(m.trace("Setting parent",g,a.id),n.setParent(g,a.id,w))}if(m.info("(Insert) Node XXX"+g+": "+JSON.stringify(n.node(g))),v!=null&&v.clusterNode){m.info("Cluster identified XBX",g,v.width,n.node(g));const{ranksep:w,nodesep:L}=n.graph();v.graph.setGraph({...v.graph.graph(),ranksep:w+25,nodesep:L});const S=await Io({element:f,graph:v.graph,diagramType:r,id:t,parentCluster:n.node(g),siteConfig:i}),D=S.elem;Qn(v,D),v.diff=S.diff||0,m.info("New compound node after recursive render XAX",g,"width",v.width,"height",v.height),er(D,v)}else n.children(g).length>0?(m.trace("Cluster - the non recursive path XBX",g,v.id,v,v.width,"Graph:",n),m.trace(Ce(v.id,n)),T.set(v.id,{id:Ce(v.id,n),node:v})):(m.trace("Node - the non recursive path XAX",g,f,n.node(g),o),await Kn(f,n.node(g),{config:i,dir:o}))})),await x(async()=>{const g=n.edges().map(async function(v){var L,S,D,Se;const w=n.edge(v.v,v.w,v.name);if(m.info("Edge "+v.v+" -> "+v.w+": "+JSON.stringify(v)),m.info("Edge "+v.v+" -> "+v.w+": ",v," ",JSON.stringify(n.edge(v))),m.info("Fix",T,"ids:",v.v,v.w,"Translating: ",T.get(v.v),T.get(v.w)),h&&w.selfLoop){if(w.selfLoop.order!==1)return;const Y={...w.originalEdge,...w,id:w.selfLoop.id,startLabelLeft:((L=w.originalEdge)==null?void 0:L.startLabelLeft)??w.startLabelLeft,startLabelRight:((S=w.originalEdge)==null?void 0:S.startLabelRight)??w.startLabelRight,endLabelLeft:((D=w.originalEdge)==null?void 0:D.endLabelLeft)??w.endLabelLeft,endLabelRight:((Se=w.originalEdge)==null?void 0:Se.endLabelRight)??w.endLabelRight};await Ie(u,Y),w.width=Y.width,w.height=Y.height,w.labelStyle=Y.labelStyle;return}await Ie(u,w)});await Promise.all(g)},"processEdges")();const{subGraphTitleTotalMargin:p}=nr(i);return{elem:c,graph:n,groups:{clusters:s,edgePaths:d,edgeLabels:u,nodes:f,rootGroups:c},diagramType:r,id:t,mergeSelfLoops:h,subGraphTitleTotalMargin:p}},"measureDagreGraph"),Wn=x(e=>{m.info("############################################# XXX"),m.info("### Layout ### XXX"),m.info("############################################# XXX"),Ji(e)},"runDagreGraphLayout"),Po=x((e,n,r)=>{const t=e.node(n);if(!t)return;const a={...t};return t!=null&&t.clusterNode?a.y=(t.y??0)+r:e.children(n).length>0?a.height=(t.height??0)+r:a.y=(t.y??0)+r/2,a},"normalizeDagreNode"),an=x((e,n)=>{Eo.forEach(r=>{n[r]!==void 0&&(e[r]=n[r])})},"applyDagreNodeLayout"),To=x((e,n,r,t)=>({...e,start:e.start??n,end:e.end??r,points:(e.points??[]).map(a=>({...a,y:typeof a.y=="number"?a.y+t:a.y}))}),"normalizeDagreEdge"),So=x((e,n)=>{const{graph:r,mergeSelfLoops:t,subGraphTitleTotalMargin:a=0}=n,i=new Map(e.nodes.map(s=>[s.id,s]));pe(r).forEach(s=>{const d=Po(r,s,a);if(!d)return;an(r.node(s),d);const u=i.get(s);u&&an(u,d)});const o=a/2;return e.edges=Un(r,o,{mergeSelfLoops:t}).map(({edge:s,start:d,end:u})=>To(s,d,u,o)),e},"applyDagreLayoutResult"),Co=x(async({elem:e,graph:n,groups:{clusters:r,edgePaths:t},diagramType:a,id:i,mergeSelfLoops:o,subGraphTitleTotalMargin:s})=>{let d=0;await Promise.all(pe(n).map(async function(c){var b;const h=n.node(c);if(m.info("Position XBX => "+c+": ("+h.x,","+h.y,") width: ",h.width," height: ",h.height),h!=null&&h.clusterNode)h.y+=s,m.info("A tainted cluster node XBX1",c,h.id,h.width,h.height,h.x,h.y,n.parent(c)),T.get(h.id).node=h,Re(h);else if(n.children(c).length>0){m.info("A pure cluster node XBX1",c,h.id,h.x,h.y,h.width,h.height,n.parent(c)),h.height+=s,n.node(h.parentId);const p=(h==null?void 0:h.padding)/2||0,g=((b=h==null?void 0:h.labelBBox)==null?void 0:b.height)||0,v=g-p||0;m.debug("OffsetY",v,"labelHeight",g,"halfPadding",p),await rr(r,h),T.get(h.id).node=h}else{const p=n.node(h.parentId);h.y+=s/2,m.info("A regular node XBX1 - using the padding",h.id,"parent",h.parentId,h.width,h.height,h.x,h.y,"offsetY",h.offsetY,"parent",p,p==null?void 0:p.offsetY,h),Re(h)}}));const u=s/2;return Un(n,u,{mergeSelfLoops:o}).forEach(function({edge:c,start:h,end:b}){m.info("Edge "+h+" -> "+b+": "+JSON.stringify(c),c),c.points.forEach(w=>w.y+=u);const p=n.node(h),g=n.node(b),v=tr(t,c,T,a,p,g,i);ar(c,v)}),n.nodes().forEach(function(c){const h=n.node(c);m.info(c,h.type,h.diff),h.isGroup&&(d=h.diff)}),m.warn("Returning from recursive render XAX",e,d),{elem:e,diff:d}},"paintDagreLayoutCore"),Io=x(async e=>{const n=await Vn(e);return Wn(n.graph),await Co(n)},"renderDagreSubgraph"),qn=x(e=>{var r,t,a,i,o,s;const n=new P({multigraph:!0,compound:!0}).setGraph({rankdir:e.direction,nodesep:((r=e.config)==null?void 0:r.nodeSpacing)||e.nodeSpacing||((a=(t=e.config)==null?void 0:t.flowchart)==null?void 0:a.nodeSpacing),ranksep:((i=e.config)==null?void 0:i.rankSpacing)||e.rankSpacing||((s=(o=e.config)==null?void 0:o.flowchart)==null?void 0:s.rankSpacing),marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});return e.nodes.forEach(d=>{n.setNode(d.id,{...d}),d.parentId&&n.setParent(d.id,d.parentId)}),m.debug("Edges:",e.edges),e.edges.forEach(d=>{if(d.start===d.end){const u=d.start,f=u+"---"+u+"---1",c=u+"---"+u+"---2",h=n.node(u);n.setNode(f,{domId:f,id:f,parentId:h.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),n.setParent(f,h.parentId),n.setNode(c,{domId:c,id:c,parentId:h.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),n.setParent(c,h.parentId);const b=structuredClone(d),p=structuredClone(d),g=structuredClone(d),v=structuredClone(d);p.originalEdge=b,p.selfLoop={id:b.id,order:0},g.originalEdge=b,g.selfLoop={id:b.id,order:1},v.originalEdge=b,v.selfLoop={id:b.id,order:2},p.label="",p.arrowTypeEnd="none",p.endLabelLeft="",p.endLabelRight="",p.startLabelLeft="",p.id=u+"-cyclic-special-1",g.startLabelRight="",g.startLabelLeft="",g.endLabelLeft="",g.endLabelRight="",g.arrowTypeStart="none",g.arrowTypeEnd="none",g.id=u+"-cyclic-special-mid",v.label="",v.startLabelRight="",v.startLabelLeft="",v.arrowTypeStart="none",h.isGroup&&(p.fromCluster=u,v.toCluster=u),v.id=u+"-cyclic-special-2",v.arrowTypeStart="none",n.setEdge(u,f,p,u+"-cyclic-special-0"),n.setEdge(f,c,g,u+"-cyclic-special-1"),n.setEdge(c,u,v,u+"-cyclic-special-2")}else n.setEdge(d.start,d.end,{...d},d.id)}),Hn(n),{graph:n}},"prepareLayoutForDagre"),Ro=x(async(e,{element:n,preparedLayout:r})=>{const t=r??qn(e),a=Zn(),i=await Vn({element:n,graph:t.graph,diagramType:e.type,id:e.diagramId,parentCluster:void 0,siteConfig:a});return t.measuredLayout=i,i},"measureDagreLayout"),ko=x((e,n)=>{var t;const r=(t=n.preparedLayout)==null?void 0:t.measuredLayout;if(!r)throw new Error("runDagreLayoutCore requires measureDagreLayout to run first");return Wn(r.graph),So(e,r),r},"runDagreLayoutCore"),_o=x((e,{measure:n})=>pe(n.graph).map(r=>n.graph.node(r)).filter(Boolean),"getDagrePaintNodes"),Mo=x((e,n,{measure:r})=>e?r.graph.node(e):void 0,"getDagreEdgeNode"),Fo=zn({prepareLayout:qn,measureLayout:Ro,runLayoutCore:ko,paintOptions:{clusterDb:T,getNodes:_o,getEdgeNode:Mo,skipNode:x((e,{measure:n})=>!n.graph.hasNode(e.id),"skipNode"),isCluster:x((e,{measure:n})=>n.graph.hasNode(e.id)&&(n.graph.children(e.id)??[]).length>0,"isCluster")}});export{So as applyDagreLayoutResult,Un as getEdgesToRender,Ro as measureDagreLayout,qn as prepareLayoutForDagre,Fo as render,ko as runDagreLayoutCore};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import{p as ge}from"./chunk-JWPE2WC7-CEYXaZDX.js";import{_ as w,Q as ye,K as ae,M as ee,P as Se,d as ve,l as te,bh as B,b as xe,a as be,p as we,q as Ce,g as Te,s as Le,N as $e,bi as Ae,z as Fe}from"./mermaid.core-knGXJfjz.js";import{s as Ne}from"./chunk-VQ5W62QI-A616Pgzo.js";import{p as Me}from"./cynefin-EF2NZ3EQ-AFHjx2wU.js";import{s as K}from"./main-B_0jS_Gz.js";import{b as O}from"./defaultLocale-DX6XiGOO.js";import{o as J}from"./ordinal-Cboi1Yqb.js";import"./modulepreload-polyfill-B5Qt9EMX.js";import"./init-Gi6I4Gst.js";function _e(t){var a=0,l=t.children,n=l&&l.length;if(!n)a=1;else for(;--n>=0;)a+=l[n].value;t.value=a}function ke(){return this.eachAfter(_e)}function ze(t,a){let l=-1;for(const n of this)t.call(a,n,++l,this);return this}function Ve(t,a){for(var l=this,n=[l],r,s,h=-1;l=n.pop();)if(t.call(a,l,++h,this),r=l.children)for(s=r.length-1;s>=0;--s)n.push(r[s]);return this}function De(t,a){for(var l=this,n=[l],r=[],s,h,d,g=-1;l=n.pop();)if(r.push(l),s=l.children)for(h=0,d=s.length;h<d;++h)n.push(s[h]);for(;l=r.pop();)t.call(a,l,++g,this);return this}function Pe(t,a){let l=-1;for(const n of this)if(t.call(a,n,++l,this))return n}function Be(t){return this.eachAfter(function(a){for(var l=+t(a.data)||0,n=a.children,r=n&&n.length;--r>=0;)l+=n[r].value;a.value=l})}function Ee(t){return this.eachBefore(function(a){a.children&&a.children.sort(t)})}function Re(t){for(var a=this,l=We(a,t),n=[a];a!==l;)a=a.parent,n.push(a);for(var r=n.length;t!==l;)n.splice(r,0,t),t=t.parent;return n}function We(t,a){if(t===a)return t;var l=t.ancestors(),n=a.ancestors(),r=null;for(t=l.pop(),a=n.pop();t===a;)r=t,t=l.pop(),a=n.pop();return r}function He(){for(var t=this,a=[t];t=t.parent;)a.push(t);return a}function Ie(){return Array.from(this)}function Oe(){var t=[];return this.eachBefore(function(a){a.children||t.push(a)}),t}function qe(){var t=this,a=[];return t.each(function(l){l!==t&&a.push({source:l.parent,target:l})}),a}function*Ge(){var t=this,a,l=[t],n,r,s;do for(a=l.reverse(),l=[];t=a.pop();)if(yield t,n=t.children)for(r=0,s=n.length;r<s;++r)l.push(n[r]);while(l.length)}function ne(t,a){t instanceof Map?(t=[void 0,t],a===void 0&&(a=je)):a===void 0&&(a=Ye);for(var l=new Q(t),n,r=[l],s,h,d,g;n=r.pop();)if((h=a(n.data))&&(g=(h=Array.from(h)).length))for(n.children=h,d=g-1;d>=0;--d)r.push(s=h[d]=new Q(h[d])),s.parent=n,s.depth=n.depth+1;return l.eachBefore(Qe)}function Xe(){return ne(this).eachBefore(Ke)}function Ye(t){return t.children}function je(t){return Array.isArray(t)?t[1]:null}function Ke(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function Qe(t){var a=0;do t.height=a;while((t=t.parent)&&t.height<++a)}function Q(t){this.data=t,this.depth=this.height=0,this.parent=null}Q.prototype=ne.prototype={constructor:Q,count:ke,each:ze,eachAfter:De,eachBefore:Ve,find:Pe,sum:Be,sort:Ee,path:Re,ancestors:He,descendants:Ie,leaves:Oe,links:qe,copy:Xe,[Symbol.iterator]:Ge};function Ue(t){if(typeof t!="function")throw new Error;return t}function q(){return 0}function G(t){return function(){return t}}function Ze(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function Je(t,a,l,n,r){for(var s=t.children,h,d=-1,g=s.length,c=t.value&&(n-a)/t.value;++d<g;)h=s[d],h.y0=l,h.y1=r,h.x0=a,h.x1=a+=h.value*c}function et(t,a,l,n,r){for(var s=t.children,h,d=-1,g=s.length,c=t.value&&(r-l)/t.value;++d<g;)h=s[d],h.x0=a,h.x1=n,h.y0=l,h.y1=l+=h.value*c}var tt=(1+Math.sqrt(5))/2;function at(t,a,l,n,r,s){for(var h=[],d=a.children,g,c,p=0,b=0,i=d.length,x,S,v=a.value,u,y,M,A,V,W,_;p<i;){x=r-l,S=s-n;do u=d[b++].value;while(!u&&b<i);for(y=M=u,W=Math.max(S/x,x/S)/(v*t),_=u*u*W,V=Math.max(M/_,_/y);b<i;++b){if(u+=c=d[b].value,c<y&&(y=c),c>M&&(M=c),_=u*u*W,A=Math.max(M/_,_/y),A>V){u-=c;break}V=A}h.push(g={value:u,dice:x<S,children:d.slice(p,b)}),g.dice?Je(g,l,n,r,v?n+=S*u/v:s):et(g,l,n,v?l+=x*u/v:r,s),v-=u,p=b}return h}const nt=function t(a){function l(n,r,s,h,d){at(a,n,r,s,h,d)}return l.ratio=function(n){return t((n=+n)>1?n:1)},l}(tt);function lt(){var t=nt,a=!1,l=1,n=1,r=[0],s=q,h=q,d=q,g=q,c=q;function p(i){return i.x0=i.y0=0,i.x1=l,i.y1=n,i.eachBefore(b),r=[0],a&&i.eachBefore(Ze),i}function b(i){var x=r[i.depth],S=i.x0+x,v=i.y0+x,u=i.x1-x,y=i.y1-x;u<S&&(S=u=(S+u)/2),y<v&&(v=y=(v+y)/2),i.x0=S,i.y0=v,i.x1=u,i.y1=y,i.children&&(x=r[i.depth+1]=s(i)/2,S+=c(i)-x,v+=h(i)-x,u-=d(i)-x,y-=g(i)-x,u<S&&(S=u=(S+u)/2),y<v&&(v=y=(v+y)/2),t(i,S,v,u,y))}return p.round=function(i){return arguments.length?(a=!!i,p):a},p.size=function(i){return arguments.length?(l=+i[0],n=+i[1],p):[l,n]},p.tile=function(i){return arguments.length?(t=Ue(i),p):t},p.padding=function(i){return arguments.length?p.paddingInner(i).paddingOuter(i):p.paddingInner()},p.paddingInner=function(i){return arguments.length?(s=typeof i=="function"?i:G(+i),p):s},p.paddingOuter=function(i){return arguments.length?p.paddingTop(i).paddingRight(i).paddingBottom(i).paddingLeft(i):p.paddingTop()},p.paddingTop=function(i){return arguments.length?(h=typeof i=="function"?i:G(+i),p):h},p.paddingRight=function(i){return arguments.length?(d=typeof i=="function"?i:G(+i),p):d},p.paddingBottom=function(i){return arguments.length?(g=typeof i=="function"?i:G(+i),p):g},p.paddingLeft=function(i){return arguments.length?(c=typeof i=="function"?i:G(+i),p):c},p}var R,oe=(R=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=xe,this.getAccTitle=be,this.setDiagramTitle=we,this.getDiagramTitle=Ce,this.getAccDescription=Te,this.setAccDescription=Le}getNodes(){return this.nodes}getConfig(){const a=$e,l=ae();return ee({...a.treemap,...l.treemap??{}})}addNode(a,l){this.nodes.push(a),this.levels.set(a,l),l===0&&(this.outerNodes.push(a),this.root??(this.root=a))}getRoot(){return{name:"",children:this.outerNodes}}addClass(a,l){const n=this.classes.get(a)??{id:a,styles:[],textStyles:[]},r=l.replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");r&&r.forEach(s=>{Ae(s)&&(n!=null&&n.textStyles?n.textStyles.push(s):n.textStyles=[s]),n!=null&&n.styles?n.styles.push(s):n.styles=[s]}),this.classes.set(a,n)}getClasses(){return this.classes}getStylesForClass(a){var l;return((l=this.classes.get(a))==null?void 0:l.styles)??[]}clear(){Fe(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}},w(R,"TreeMapDB"),R);function ce(t){if(!t.length)return[];const a=[],l=[];return t.forEach(n=>{const r={name:n.name,children:n.type==="Leaf"?void 0:[]};for(r.classSelector=n==null?void 0:n.classSelector,n!=null&&n.cssCompiledStyles&&(r.cssCompiledStyles=n.cssCompiledStyles),n.type==="Leaf"&&n.value!==void 0&&(r.value=n.value);l.length>0&&l[l.length-1].level>=n.level;)l.pop();if(l.length===0)a.push(r);else{const s=l[l.length-1].node;s.children?s.children.push(r):s.children=[r]}n.type!=="Leaf"&&l.push({node:r,level:n.level})}),a}w(ce,"buildHierarchy");var rt=w((t,a)=>{ge(t,a);const l=[];for(const s of t.TreemapRows??[])s.$type==="ClassDefStatement"&&a.addClass(s.className??"",s.styleText??"");for(const s of t.TreemapRows??[]){const h=s.item;if(!h)continue;const d=s.indent?parseInt(s.indent):0,g=st(h),c=h.classSelector?a.getStylesForClass(h.classSelector):[],p=c.length>0?c:void 0,b={level:d,name:g,type:h.$type,value:h.value,classSelector:h.classSelector,cssCompiledStyles:p};l.push(b)}const n=ce(l),r=w((s,h)=>{for(const d of s)a.addNode(d,h),d.children&&d.children.length>0&&r(d.children,h+1)},"addNodesRecursively");r(n,0)},"populate"),st=w(t=>t.name?String(t.name):"","getItemName"),he={parser:{yy:void 0},parse:w(async t=>{var a;try{const n=await Me("treemap",t);te.debug("Treemap AST:",n);const r=(a=he.parser)==null?void 0:a.yy;if(!(r instanceof oe))throw new Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");rt(n,r)}catch(l){throw te.error("Error parsing treemap:",l),l}},"parse")},it=10,E=10,X=25,ot=w((t,a,l,n)=>{const r=n.db,s=r.getConfig(),h=s.padding??it,d=r.getDiagramTitle(),g=r.getRoot(),{themeVariables:c}=ae();if(!g)return;const p=d?30:0,b=Se(a),i=s.nodeWidth?s.nodeWidth*E:960,x=s.nodeHeight?s.nodeHeight*E:500,S=i,v=x+p;b.attr("viewBox",`0 0 ${S} ${v}`),ve(b,v,S,s.useMaxWidth);let u;try{const e=s.valueFormat||",";if(e==="$0,0")u=w(o=>"$"+O(",")(o),"valueFormat");else if(e.startsWith("$")&&e.includes(",")){const o=/\.\d+/.exec(e),f=o?o[0]:"";u=w(C=>"$"+O(","+f)(C),"valueFormat")}else if(e.startsWith("$")){const o=e.substring(1);u=w(f=>"$"+O(o||"")(f),"valueFormat")}else u=O(e)}catch(e){te.error("Error creating format function:",e),u=O(",")}const y=J().range(["transparent",c.cScale0,c.cScale1,c.cScale2,c.cScale3,c.cScale4,c.cScale5,c.cScale6,c.cScale7,c.cScale8,c.cScale9,c.cScale10,c.cScale11]),M=J().range(["transparent",c.cScalePeer0,c.cScalePeer1,c.cScalePeer2,c.cScalePeer3,c.cScalePeer4,c.cScalePeer5,c.cScalePeer6,c.cScalePeer7,c.cScalePeer8,c.cScalePeer9,c.cScalePeer10,c.cScalePeer11]),A=J().range([c.cScaleLabel0,c.cScaleLabel1,c.cScaleLabel2,c.cScaleLabel3,c.cScaleLabel4,c.cScaleLabel5,c.cScaleLabel6,c.cScaleLabel7,c.cScaleLabel8,c.cScaleLabel9,c.cScaleLabel10,c.cScaleLabel11]);d&&b.append("text").attr("x",S/2).attr("y",p/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(d);const V=b.append("g").attr("transform",`translate(0, ${p})`).attr("class","treemapContainer"),W=ne(g).sum(e=>e.value??0).sort((e,o)=>(o.value??0)-(e.value??0)),le=lt().size([i,x]).paddingTop(e=>e.children&&e.children.length>0?X+E:0).paddingInner(h).paddingLeft(e=>e.children&&e.children.length>0?E:0).paddingRight(e=>e.children&&e.children.length>0?E:0).paddingBottom(e=>e.children&&e.children.length>0?E:0).round(!0)(W),de=le.descendants().filter(e=>e.children&&e.children.length>0),H=V.selectAll(".treemapSection").data(de).enter().append("g").attr("class","treemapSection").attr("transform",e=>`translate(${e.x0},${e.y0})`);H.append("rect").attr("width",e=>e.x1-e.x0).attr("height",X).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",e=>e.depth===0?"display: none;":""),H.append("clipPath").attr("id",(e,o)=>`clip-section-${a}-${o}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-12)).attr("height",X),H.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class",(e,o)=>`treemapSection section${o}`).attr("fill",e=>y(e.data.name)).attr("fill-opacity",.6).attr("stroke",e=>M(e.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",e=>{if(e.depth===0)return"display: none;";const o=B({cssCompiledStyles:e.data.cssCompiledStyles});return o.nodeStyles+";"+o.borderStyles.join(";")}),H.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",X/2).attr("dominant-baseline","middle").text(e=>e.depth===0?"":e.data.name).attr("font-weight","bold").attr("clip-path",(e,o)=>`url(#clip-section-${a}-${o})`).attr("style",e=>{if(e.depth===0)return"display: none;";const o="dominant-baseline: middle; font-size: 12px; fill:"+A(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",f=B({cssCompiledStyles:e.data.cssCompiledStyles});return o+f.labelStyles.replace("color:","fill:")}).each(function(e){if(e.depth===0)return;const o=K(this),f=e.data.name;o.text(f);const C=e.x1-e.x0,L=6;let T;s.showValues!==!1&&e.value?T=C-10-30-10-L:T=C-L-6;const m=Math.max(15,T),k=o.node();if(k.getComputedTextLength()>m){const $="...";let z=f;for(;z.length>0;){if(z=f.substring(0,z.length-1),z.length===0){o.text($),k.getComputedTextLength()>m&&o.text("");break}if(o.text(z+$),k.getComputedTextLength()<=m)break}}}),s.showValues!==!1&&H.append("text").attr("class","treemapSectionValue").attr("x",e=>e.x1-e.x0-10).attr("y",X/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(e=>e.value?u(e.value):"").attr("font-style","italic").attr("style",e=>{if(e.depth===0)return"display: none;";const o="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+A(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",f=B({cssCompiledStyles:e.data.cssCompiledStyles});return o+f.labelStyles.replace("color:","fill:")});const re=le.leaves(),F=re.length>20,pe=F?16:38,Y=F?14:28,D=F?4:8,I=F?4:6,U=F?2:4,se=F?8:10,Z=F?1:2,j=V.selectAll(".treemapLeafGroup").data(re).enter().append("g").attr("class",(e,o)=>`treemapNode treemapLeafGroup leaf${o}${e.data.classSelector?` ${e.data.classSelector}`:""}x`).attr("transform",e=>`translate(${e.x0},${e.y0})`);j.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class","treemapLeaf").attr("fill",e=>e.parent?y(e.parent.data.name):y(e.data.name)).attr("style",e=>B({cssCompiledStyles:e.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",e=>e.parent?y(e.parent.data.name):y(e.data.name)).attr("stroke-width",3),j.append("clipPath").attr("id",(e,o)=>`clip-${a}-${o}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-4)).attr("height",e=>Math.max(0,e.y1-e.y0-4)),j.append("text").attr("class","treemapLabel").attr("x",e=>(e.x1-e.x0)/2).attr("y",e=>(e.y1-e.y0)/2).attr("style",e=>{const o=`text-anchor: middle; dominant-baseline: middle; font-size: ${pe}px;fill:`+A(e.data.name)+";",f=B({cssCompiledStyles:e.data.cssCompiledStyles});return o+f.labelStyles.replace("color:","fill:")}).attr("clip-path",(e,o)=>`url(#clip-${a}-${o})`).text(e=>e.data.name).each(function(e){const o=K(this),f=e.x1-e.x0,C=e.y1-e.y0,L=o.node(),T=f-2*U,P=C-2*U;if(T<se||P<se){o.style("display","none");return}let m=parseInt(o.style("font-size"),10);const k=.6;for(;L.getComputedTextLength()>T&&m>D;)m--,o.style("font-size",`${m}px`);let N=Math.max(I,Math.min(Y,Math.round(m*k))),$=m+Z+N;for(;$>P&&m>D&&(m--,N=Math.max(I,Math.min(Y,Math.round(m*k))),!(N<I&&m===D));)o.style("font-size",`${m}px`),$=m+Z+N;o.style("font-size",`${m}px`),F?(m<D||P<D)&&o.style("display","none"):(L.getComputedTextLength()>T||m<D||P<m)&&o.style("display","none")}),s.showValues!==!1&&j.append("text").attr("class","treemapValue").attr("x",o=>(o.x1-o.x0)/2).attr("y",function(o){return(o.y1-o.y0)/2}).attr("style",o=>{const f=`text-anchor: middle; dominant-baseline: hanging; font-size: ${Y}px;fill:`+A(o.data.name)+";",C=B({cssCompiledStyles:o.data.cssCompiledStyles});return f+C.labelStyles.replace("color:","fill:")}).attr("clip-path",(o,f)=>`url(#clip-${a}-${f})`).text(o=>o.value?u(o.value):"").each(function(o){const f=K(this),C=this.parentNode;if(!C){f.style("display","none");return}const L=K(C).select(".treemapLabel");if(L.empty()||L.style("display")==="none"){f.style("display","none");return}const T=parseFloat(L.style("font-size")),m=Math.max(I,Math.min(Y,Math.round(T*.6)));f.style("font-size",`${m}px`);const N=(o.y1-o.y0)/2+T/2+Z;f.attr("y",N);const $=o.x1-o.x0,ie=o.y1-o.y0-4,me=$-2*U;f.node().getComputedTextLength()>me||N+m>ie||m<I?f.style("display","none"):f.style("display",null)});const ue=s.diagramPadding??8;Ne(b,ue,"flowchart",(s==null?void 0:s.useMaxWidth)||!1)},"draw"),ct=w(function(t,a){return a.db.getClasses()},"getClasses"),ht={draw:ot,getClasses:ct},dt={sectionStrokeColor:"black",sectionStrokeWidth:"1",sectionFillColor:"#efefef",leafStrokeColor:"black",leafStrokeWidth:"1",leafFillColor:"#efefef",labelFontSize:"12px",valueFontSize:"10px",titleFontSize:"14px"},pt=w(({treemap:t}={})=>{const a=ye(),l=ae(),n=ee(a,l.themeVariables),r=ee(dt,t),s=r.titleColor??n.titleColor,h=r.labelColor??n.textColor,d=r.valueColor??n.textColor;return`
|
|
2
|
+
.treemapNode.section {
|
|
3
|
+
stroke: ${r.sectionStrokeColor};
|
|
4
|
+
stroke-width: ${r.sectionStrokeWidth};
|
|
5
|
+
fill: ${r.sectionFillColor};
|
|
6
|
+
}
|
|
7
|
+
.treemapNode.leaf {
|
|
8
|
+
stroke: ${r.leafStrokeColor};
|
|
9
|
+
stroke-width: ${r.leafStrokeWidth};
|
|
10
|
+
fill: ${r.leafFillColor};
|
|
11
|
+
}
|
|
12
|
+
.treemapLabel {
|
|
13
|
+
fill: ${h};
|
|
14
|
+
font-size: ${r.labelFontSize};
|
|
15
|
+
}
|
|
16
|
+
.treemapValue {
|
|
17
|
+
fill: ${d};
|
|
18
|
+
font-size: ${r.valueFontSize};
|
|
19
|
+
}
|
|
20
|
+
.treemapTitle {
|
|
21
|
+
fill: ${s};
|
|
22
|
+
font-size: ${r.titleFontSize};
|
|
23
|
+
}
|
|
24
|
+
`},"getStyles"),ut=pt,Tt={parser:he,get db(){return new oe},renderer:ht,styles:ut};export{Tt as diagram};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import{p as z}from"./chunk-JWPE2WC7-CEYXaZDX.js";import{_ as f,M as B,P,d as E,l as $,b as F,a as A,p as W,q as _,g as N,s as M,K as L,N as Y,z as I}from"./mermaid.core-knGXJfjz.js";import{p as K}from"./cynefin-EF2NZ3EQ-AFHjx2wU.js";import"./main-B_0jS_Gz.js";import"./modulepreload-polyfill-B5Qt9EMX.js";var O=Y.packet,b,C=(b=class{constructor(){this.packet=[],this.setAccTitle=F,this.getAccTitle=A,this.setDiagramTitle=W,this.getDiagramTitle=_,this.getAccDescription=N,this.setAccDescription=M}getConfig(){const t=B({...O,...L().packet});return t.showBits&&(t.paddingY+=10),t}getPacket(){return this.packet}pushWord(t){t.length>0&&this.packet.push(t)}clear(){I(),this.packet=[]}},f(b,"PacketDB"),b),j=1e4,q=f((e,t)=>{z(e,t);let s=-1,r=[],i=1;const{bitsPerRow:l}=t.getConfig();for(let{start:a,end:o,bits:d,label:g}of e.blocks){if(a!==void 0&&o!==void 0&&o<a)throw new Error(`Packet block ${a} - ${o} is invalid. End must be greater than start.`);if(a??(a=s+1),a!==s+1)throw new Error(`Packet block ${a} - ${o??a} is not contiguous. It should start from ${s+1}.`);if(d===0)throw new Error(`Packet block ${a} is invalid. Cannot have a zero bit field.`);for(o??(o=a+(d??1)-1),d??(d=o-a+1),s=o,$.debug(`Packet block ${a} - ${s} with label ${g}`);r.length<=l+1&&t.getPacket().length<j;){const[c,p]=G({start:a,end:o,bits:d,label:g},i,l);if(r.push(c),c.end+1===i*l&&(t.pushWord(r),r=[],i++),!p)break;({start:a,end:o,bits:d,label:g}=p)}}t.pushWord(r)},"populate"),G=f((e,t,s)=>{if(e.start===void 0)throw new Error("start should have been set during first phase");if(e.end===void 0)throw new Error("end should have been set during first phase");if(e.start>e.end)throw new Error(`Block start ${e.start} is greater than block end ${e.end}.`);if(e.end+1<=t*s)return[e,void 0];const r=t*s-1,i=t*s;return[{start:e.start,end:r,label:e.label,bits:r-e.start},{start:i,end:e.end,label:e.label,bits:e.end-i}]},"getNextFittingBlock"),S={parser:{yy:void 0},parse:f(async e=>{var r;const t=await K("packet",e),s=(r=S.parser)==null?void 0:r.yy;if(!(s instanceof C))throw new Error("parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");$.debug(t),q(t,s)},"parse")},H=f((e,t,s,r)=>{const i=r.db,l=i.getConfig(),{rowHeight:a,paddingY:o,bitWidth:d,bitsPerRow:g}=l,c=i.getPacket(),p=i.getDiagramTitle(),m=a+o,n=m*(c.length+1)-(p?0:a),h=d*g+2,k=P(t);k.attr("viewBox",`0 0 ${h} ${n}`),E(k,n,h,l.useMaxWidth);for(const[x,u]of c.entries())U(k,u,x,l);k.append("text").text(p).attr("x",h/2).attr("y",n-m/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),U=f((e,t,s,{rowHeight:r,paddingX:i,paddingY:l,bitWidth:a,bitsPerRow:o,showBits:d,bitOrder:g})=>{const c=e.append("g"),p=s*(r+l)+l,m=g==="descending";for(const n of t){const h=n.end-n.start+1,k=n.start%o,u=(m?o-k-h:k)*a+1,w=h*a-i;if(c.append("rect").attr("x",u).attr("y",p).attr("width",w).attr("height",r).attr("class","packetBlock"),c.append("text").attr("x",u+w/2).attr("y",p+r/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(n.label),!d)continue;const[D,T]=m?[n.end,n.start]:[n.start,n.end],v=h===1,y=p-2;c.append("text").attr("x",u+(v?w/2:0)).attr("y",y).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",v?"middle":"start").text(D),v||c.append("text").attr("x",u+w).attr("y",y).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(T)}},"drawWord"),X={draw:H},J={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},Q=f(({packet:e}={})=>{const t=B(J,e);return`
|
|
2
|
+
.packetByte {
|
|
3
|
+
font-size: ${t.byteFontSize};
|
|
4
|
+
}
|
|
5
|
+
.packetByte.start {
|
|
6
|
+
fill: ${t.startByteColor};
|
|
7
|
+
}
|
|
8
|
+
.packetByte.end {
|
|
9
|
+
fill: ${t.endByteColor};
|
|
10
|
+
}
|
|
11
|
+
.packetLabel {
|
|
12
|
+
fill: ${t.labelColor};
|
|
13
|
+
font-size: ${t.labelFontSize};
|
|
14
|
+
}
|
|
15
|
+
.packetTitle {
|
|
16
|
+
fill: ${t.titleColor};
|
|
17
|
+
font-size: ${t.titleFontSize};
|
|
18
|
+
}
|
|
19
|
+
.packetBlock {
|
|
20
|
+
stroke: ${t.blockStrokeColor};
|
|
21
|
+
stroke-width: ${t.blockStrokeWidth};
|
|
22
|
+
fill: ${t.blockFillColor};
|
|
23
|
+
}
|
|
24
|
+
`},"styles"),at={parser:S,get db(){return new C},renderer:X,styles:Q};export{at as diagram};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{I as W}from"./chunk-2Q5K7J3B-
|
|
1
|
+
import{I as W}from"./chunk-2Q5K7J3B-Bgw-3YfG.js";import{p as X}from"./chunk-JWPE2WC7-CEYXaZDX.js";import{p as O,b as G,s as P,q as Y,g as q,a as F,_ as g,M as A,l as E,P as Z,d as j,K as L,z as U,j as K,ap as J,N as Q,aq as ee}from"./mermaid.core-knGXJfjz.js";import{p as te}from"./cynefin-EF2NZ3EQ-AFHjx2wU.js";import"./main-B_0jS_Gz.js";import"./modulepreload-polyfill-B5Qt9EMX.js";var D=/[─━│┃└┗├┣]/,_=/[└┗├┣]/,re=/[─━]/,T=/^[\s│┃]+$/,V=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,$=/^\s*%%/,ne=" ";function S(r){return r.some(t=>D.test(t))}g(S,"isBoxDrawingFormat");function M(r){for(const t of r){const e=_.exec(t);if(e!=null&&e.index&&e.index>0)return e.index}return 4}g(M,"inferSegmentWidth");function R(r,t){return r.replace(/\bline\s+(\d+)\b/gi,(e,i)=>{const s=parseInt(i,10),o=t.get(s);return o?`line ${o}`:e})}g(R,"remapErrorLines");function H(r){const t=r.split(`
|
|
2
2
|
`),e=new Map;let i=-1;for(const[d,l]of t.entries())if(l.trim()==="treeView-beta"){i=d;break}if(i===-1)return{text:r,lineMap:e};const s=[];for(let d=i+1;d<t.length;d++){const l=t[d];l.trim()===""||$.test(l)||V.test(l)||T.test(l)||s.push(l.replace(/\t/g," "))}if(!S(s))return{text:r,lineMap:e};const o=M(s),n=[];let c=0;for(let d=0;d<=i;d++)n.push(t[d]),c++,e.set(c,d+1);for(let d=i+1;d<t.length;d++){const l=t[d],u=l.trim(),a=d+1;if(u===""){n.push(l),c++,e.set(c,a);continue}if($.test(l)){n.push(l),c++,e.set(c,a);continue}if(V.test(l)){n.push(l),c++,e.set(c,a);continue}if(T.test(l))continue;const p=l.replace(/\t/g," "),h=_.exec(p);if((h==null?void 0:h.index)!==void 0){const m=h.index,w=Math.round(m/o)+1;let f=m+1;for(;f<p.length&&re.test(p[f]);)f++;for(;f<p.length&&p[f]===" ";)f++;const v=p.slice(f).trimEnd();if(!v)throw new Error(`Line ${a}: Empty node — expected a filename or directory name after the box-drawing prefix`);const b=ne.repeat(w);n.push(b+v),c++,e.set(c,a)}else{if(/^[\s─━│┃└┗├┣]+$/.test(p))continue;if(D.test(p))n.push(l),c++,e.set(c,a);else{if(/^\s+/.test(p))throw new Error(`Line ${a}: Unexpected indentation without box-drawing characters. In box-drawing format, use ├── or └── prefixes for indented nodes.`);n.push(l),c++,e.set(c,a)}}}return{text:n.join(`
|
|
3
3
|
`),lineMap:e}}g(H,"preprocessBoxDrawing");var x=new W(()=>({cnt:1,stack:[{id:0,level:-1,name:"/",nodeType:"directory",children:[]}]})),ie=g(()=>{x.reset(),U()},"clear"),oe=g(()=>x.records.stack[0],"getRoot"),se=g(()=>x.records.cnt,"getCount"),ae=Q.treeView,ce=g(()=>A(ae,L().treeView),"getConfig"),le=g((r,t,e,i,s,o)=>{for(;r<=x.records.stack[x.records.stack.length-1].level;)x.records.stack.pop();const n={id:x.records.cnt++,level:r,name:t,nodeType:e,icon:s,cssClass:i,description:o,children:[]};x.records.stack[x.records.stack.length-1].children.push(n),x.records.stack.push(n)},"addNode"),de={clear:ie,addNode:le,getRoot:oe,getCount:se,getConfig:ce,getAccTitle:F,getAccDescription:q,getDiagramTitle:Y,setAccDescription:P,setAccTitle:G,setDiagramTitle:O},I=de,he=g(r=>{X(r,I);for(const t of r.nodes){const e=typeof t.indent=="number"?t.indent:0;let i=t.name;const s=i.endsWith("/");s&&(i=i.slice(0,-1));const o=s?"directory":"file",n=t.classAnnotation||void 0,c=t.iconAnnotation,d=c!==void 0?c||"none":void 0,l=t.descAnnotation||void 0,u=l?K(l,L()):void 0;I.addNode(e,i,o,n,d,u)}},"populate"),pe={parse:g(async r=>{const{text:t,lineMap:e}=H(r);try{const i=await te("treeView",t);E.debug(i),he(i)}catch(i){throw e.size>0&&i instanceof Error&&(i.message=R(i.message,e)),i}},"parse")},C={prefix:"mermaid-treeview",height:24,width:24,icons:{folder:{body:'<path fill="currentColor" d="M10.59 4.59A2 2 0 0 0 9.17 4H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.17z"/>'},file:{body:'<path fill="currentColor" fill-rule="evenodd" d="M6 2a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8.83a2 2 0 0 0-.59-1.42l-4.82-4.82A2 2 0 0 0 13.17 2H6Zm7.5 1.9l4.6 4.6h-3.6a1 1 0 0 1-1-1V3.9Z" clip-rule="evenodd"/>'}}};function z(r,t){var s;const e=(s=t==null?void 0:t.filenameIcons)==null?void 0:s[r];if(e)return e;const i=r.lastIndexOf(".");if(i>0){const o=r.substring(i).toLowerCase(),n=t==null?void 0:t.extensionIcons;return(n==null?void 0:n[o])??(n==null?void 0:n[o.slice(1)])}}g(z,"detectIcon");function y(r,t){return r.includes(":")?r:r in C.icons||!t?`${C.prefix}:${r}`:`${t}:${r}`}g(y,"qualifyIcon");function N(r,t){if(r.icon!=="none"){if(r.icon)return y(r.icon,t.defaultIconPack);if(t.showIcons){if(r.nodeType==="file"){const e=z(r.name,t);if(e==="none")return;if(e)return y(e,t.defaultIconPack)}return`${C.prefix}:${r.nodeType==="directory"?"folder":"file"}`}}}g(N,"getNodeIcon");ee([{name:C.prefix,icons:C}]);var B=14,ge=4,fe=16,ue=g(async(r,t)=>{const e=[],i=g(o=>{const n=N(o,t);n&&e.push({icon:n,node:o}),o.children.forEach(i)},"collect");i(r);const s=await Promise.all(e.map(async({icon:o,node:n})=>({id:n.id,svg:await J(o,{height:B,width:B})})));return new Map(s.map(({id:o,svg:n})=>[o,n]))},"resolveNodeIcons"),we=g((r,t,e,i,s,o)=>{var b;const n=i.append("g");let c="treeView-node-label";e.nodeType==="directory"&&(c+=" treeView-node-dir"),e.cssClass&&(c+=` ${e.cssClass}`);const d=B+ge,l=N(e,s),u=l!==void 0;l&&n.append("g").attr("class","treeView-node-icon").attr("transform",`translate(${r+s.paddingX}, ${t+s.paddingY})`).html(o.get(e.id)??"");const a=n.append("text").text(e.name).attr("dominant-baseline","middle").attr("class",c),{height:p,width:h}=a.node().getBBox(),m=p+s.paddingY*2,w=r+s.paddingX+(u?d:0);a.attr("x",w),a.attr("y",t+m/2);const f=w+h,v=h+s.paddingX*2+(u?d:0);return e.BBox={x:r,y:t,width:v,height:m},(b=e.cssClass)!=null&&b.split(/\s+/).includes("highlight")&&n.insert("rect",":first-child").attr("x",r).attr("y",t+1).attr("width",0).attr("height",m-2).attr("rx",3).attr("class","treeView-highlight-bg"),{node:e,nodeGroup:n,labelRightEdge:f,centerY:t+m/2}},"positionLabel"),k=g((r,t,e,i,s,o)=>r.append("line").attr("x1",t).attr("y1",e).attr("x2",i).attr("y2",s).attr("stroke-width",o).attr("class","treeView-node-line"),"positionLine"),me=g((r,t,e,i)=>{var u;let s=0,o=0;const n=[],c=g((a,p,h,m)=>{const w=m*(h.rowIndent+h.paddingX),f=we(w,s,p,a,h,i);n.push(f);const{height:v,width:b}=p.BBox;k(a,w-h.rowIndent,s+v/2,w,s+v/2,h.lineThickness),o=Math.max(o,w+b),s+=v},"drawNode"),d=g((a,p=0)=>{c(r,a,e,p),a.children.forEach(f=>{d(f,p+1)});const{x:h,y:m,height:w}=a.BBox;if(a.children.length){const{y:f,height:v}=a.children[a.children.length-1].BBox;k(r,h+e.paddingX,m+w,h+e.paddingX,f+v/2+e.lineThickness/2,e.lineThickness)}},"processNode");d(t);const l=n.filter(a=>a.node.description);if(l.length>0){const p=Math.max(...n.map(h=>h.labelRightEdge))+fe;for(const h of l){const w=h.nodeGroup.append("text").text(h.node.description).attr("dominant-baseline","middle").attr("class","treeView-node-description").attr("x",p).attr("y",h.centerY).node().getBBox();o=Math.max(o,p+w.width+e.paddingX)}}for(const a of n)if((u=a.node.cssClass)!=null&&u.split(/\s+/).includes("highlight")){const p=a.nodeGroup.select(".treeView-highlight-bg");if(!p.empty()){const h=o-a.node.BBox.x+8;p.attr("width",h),o=Math.max(o,a.node.BBox.x+h+2)}}return{totalHeight:s,totalWidth:o}},"drawTree"),ve=g(async(r,t,e,i)=>{E.debug(`Rendering treeView diagram
|
|
4
4
|
`+r);const s=i.db,o=s.getRoot(),n=s.getConfig(),c=Z(t),d=c.append("g");d.attr("class","tree-view");const l=await ue(o,n),{totalHeight:u,totalWidth:a}=me(d,o,n,l);c.attr("viewBox",`-${n.lineThickness/2} 0 ${a} ${u}`),j(c,u,a,n.useMaxWidth)},"draw"),xe={draw:ve},be=xe,Ce={labelFontSize:"16px",labelColor:"black",lineColor:"black",iconColor:"#546e7a",descriptionColor:"#6a9955",highlightBg:"rgba(255, 193, 7, 0.15)",highlightStroke:"#ffc107"},Ie=g(({treeView:r})=>{const{labelFontSize:t,labelColor:e,lineColor:i,iconColor:s,descriptionColor:o,highlightBg:n,highlightStroke:c}=A(Ce,r);return`
|
|
@@ -27,4 +27,4 @@ import{I as W}from"./chunk-2Q5K7J3B-f_A4_eDz.js";import{p as X}from"./chunk-JWPE
|
|
|
27
27
|
stroke: ${c};
|
|
28
28
|
stroke-width: 1;
|
|
29
29
|
}
|
|
30
|
-
`},"styles"),ye=Ie,
|
|
30
|
+
`},"styles"),ye=Ie,Ae={db:I,renderer:be,parser:pe,styles:ye};export{Ae as diagram};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{p as oe}from"./chunk-JWPE2WC7-
|
|
1
|
+
import{p as oe}from"./chunk-JWPE2WC7-CEYXaZDX.js";import{q as se,p as de,s as le,g as ce,a as me,b as ue,_ as o,l as g,c as D,L as xe,z as fe,M as ge,K as $,N as he,j as S,w as M,ar as pe}from"./mermaid.core-knGXJfjz.js";import{p as be,i as ve}from"./cynefin-EF2NZ3EQ-AFHjx2wU.js";import{s as we}from"./main-B_0jS_Gz.js";import"./modulepreload-polyfill-B5Qt9EMX.js";var N="position frame",T="frame positioned",B="position relation",C="relation positioned",ye=o(function(e){g.debug("options str",e)},"setOptions"),Pe=o(function(){return{}},"getOptions"),Se=o(function(){W(),fe()},"clear");function W(){y={}}o(W,"reset");var Me=he.eventmodeling,ke=o(()=>ge({...Me,...$().eventmodeling}),"getConfig"),y={};function I(){let e=Be;const{ast:n}=y,t=R();if(!n)throw new Error("No data for EventModel");return n.frames.forEach((i,a)=>{const r=X(i,n.dataEntities,t);e=w(e,{$kind:N,index:a,frame:i,textProps:r});let d;q(i)?(g.debug("source frame",i.sourceFrames),d=n.frames.filter(l=>i.sourceFrames.some(c=>c.$refText===l.name)),d.forEach(l=>{e=w(e,{$kind:B,index:a,frame:i,sourceFrame:l})})):e=w(e,{$kind:B,index:a,frame:i})}),e={...e,sortedSwimlanesArray:A(e.swimlanes)},e}o(I,"getState");function O(e){var t;y.ast=void 0;const n=new Set;for(const i of e.frames){if(n.has(i.name)){const a=(t=i.$cstNode)==null?void 0:t.range.start.line,r=a===void 0?"":` on line ${a+1}`;throw new Error(`Duplicate event modeling frame ID "${i.name}"${r}`)}n.add(i.name)}y.ast=e}o(O,"setAst");var s={swimlaneMinHeight:70,swimlanePadding:15,swimlaneGap:10,boxPadding:10,boxOverlap:90,boxDefaultY:0,boxMinWidth:80,boxMaxWidth:450,boxMinHeight:80,boxMaxHeight:750,contentStartX:250,textMaxWidth:450-2*10,boxTextFontWeight:"bold",boxTextPadding:10,swimlaneTextFontWeight:"bold",labelUiAutomation:"UI/Automation",labelUiAutomationPrefix:"UI/A: ",labelCommandReadModel:"Command/Read Model",labelCommandReadModelPrefix:"C/RM: ",labelEvents:"Events",labelEventsPrefix:"Stream: "};function R(){return s}o(R,"getDiagramProps");var Be={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function H(e){const n=e.split(".");if(n.length===2)return n[0]}o(H,"extractNamespace");function U(e){const n=e.split(".");return n.length===2?n[1]:e}o(U,"extractName");function _(e,n){if(!(!n||n.length===0))return Object.values(e).find(t=>t.namespace===n)}o(_,"findSwimlaneByNamespace");function v(e,n,t){return Math.max(n,...Object.keys(e).filter(i=>{const a=Number.parseInt(i);return a>n&&a<t}).map(i=>Number.parseInt(i)))+1}o(v,"findNextAvailableIndex");function L(e,n){const t=H(e.entityIdentifier),i=_(n,t);switch(e.modelEntityType){case"ui":case"pcr":case"processor":return i?{index:i.index,label:i.namespace||s.labelUiAutomation}:t?{index:v(n,0,100),label:s.labelUiAutomationPrefix+t}:{index:0,label:s.labelUiAutomation};case"rmo":case"readmodel":case"cmd":case"command":return i?{index:i.index,label:i.namespace||s.labelCommandReadModel}:t?{index:v(n,100,200),label:s.labelCommandReadModelPrefix+t}:{index:100,label:s.labelCommandReadModel};case"evt":case"event":default:return i?{index:i.index,label:i.namespace||s.labelEvents}:t?{index:v(n,200,300),label:s.labelEventsPrefix+t}:{index:200,label:s.labelEvents}}}o(L,"calculateSwimlaneProps");function V(e){const{themeVariables:n}=$();switch(e.modelEntityType){case"ui":return{fill:n.emUiFill??"white",stroke:n.emUiStroke??"#dbdada"};case"pcr":case"processor":return{fill:n.emProcessorFill??"#edb3f6",stroke:n.emProcessorStroke??"#b88cbf"};case"rmo":case"readmodel":return{fill:n.emReadModelFill??"#d3f1a2",stroke:n.emReadModelStroke??"#a3b732"};case"cmd":case"command":return{fill:n.emCommandFill??"#bcd6fe",stroke:n.emCommandStroke??"#679ac3"};case"evt":case"event":return{fill:n.emEventFill??"#ffb778",stroke:n.emEventStroke??"#c19a0f"};default:return{fill:"red",stroke:"black"}}}o(V,"calculateEntityVisualProps");function X(e,n,t){const i=$(),a=S(U(e.entityIdentifier)??"",i);let r;const d={fontSize:16,fontWeight:700,fontFamily:'"trebuchet ms", verdana, arial, sans-serif',joinWith:"<br/>"};let c=`<b>${M(a,t.textMaxWidth,d)}</b>`;if(e.dataInlineValue&&(r=e.dataInlineValue,r=r.substring(r.indexOf("{")+1),r=r.substring(0,r.lastIndexOf("}")-1),r=S(r,i),r=M(r,t.textMaxWidth,d),r=r.replaceAll(" "," ")),e.dataReference){const p=n.find(P=>{var b;return P.name===((b=e.dataReference)==null?void 0:b.$refText)});p&&(r=p.dataBlockValue,r=r.substring(r.indexOf(`{
|
|
2
2
|
`)+2),r=r.substring(0,r.lastIndexOf("}")-1),r=S(r,i),r=M(r,t.textMaxWidth,d),r=r.replaceAll(" "," "),r+="<br/>")}const m=r!==void 0;m&&(c+=`<br/><br/><code style="text-align: left; display: block;max-width:${t.textMaxWidth}px">${r}</code>`);const x={fontSize:d.fontSize,fontWeight:d.fontWeight,fontFamily:d.fontFamily},u=pe(c,x),h=m?u.width/3:u.width,f={content:c,width:h,height:u.height};return g.debug(`[${e.name}] ${e.entityIdentifier} text`,f),f}o(X,"calculateTextProps");function j(e,n){const t=n,i=V(t.frame),a={width:t.textProps.width+2*s.boxTextPadding,height:t.textProps.height+2*s.boxTextPadding};return[{$kind:T,frame:t.frame,index:t.index,visual:i,dimension:a,textProps:t.textProps}]}o(j,"decidePositionFrame");function G(e,n,t){return n===void 0?s.contentStartX:n.index===e.index&&e.r?e.r+s.boxPadding:t===void 0?s.contentStartX:t.r-s.boxOverlap+s.boxPadding}o(G,"calculateX");function Y(e,n){const t=[...e.map(i=>i.r),n];return Math.max(...t)}o(Y,"calculateMaxRight");function A(e){return Object.values(e).sort((n,t)=>n.index-t.index)}o(A,"sortedSwimlanesArray");function z(e,n){const t=n,i=L(t.frame,e.swimlanes);let a;i.index in e.swimlanes?a=e.swimlanes[i.index]:a={index:i.index,label:i.label,r:0,y:i.index*s.swimlaneMinHeight+s.swimlaneGap,height:s.swimlaneMinHeight,maxHeight:s.swimlaneMinHeight};const r=e.boxes.length>0?e.boxes[e.boxes.length-1]:void 0,d=e.previousSwimlaneNumber!==void 0?e.swimlanes[e.previousSwimlaneNumber]:void 0,l={width:Math.max(s.boxMinWidth,Math.min(s.boxMaxWidth,t.dimension.width))+2*s.boxPadding,height:Math.max(s.boxMinHeight,Math.min(s.boxMaxHeight,t.dimension.height))+2*s.boxPadding},c=G(a,d,r),m=c+l.width+s.boxPadding,x=Y(Object.values(e.swimlanes),m);a.r=c+l.width,a.maxHeight=Math.max(a.maxHeight,l.height),a.height=Math.max(s.swimlaneMinHeight,a.maxHeight)+2*s.swimlanePadding;const u={x:c,y:s.swimlanePadding+a.y,r:m,dimension:l,leftSibling:!1,swimlane:a,visual:t.visual,text:t.textProps.content,frame:t.frame,index:t.index},h={...e,boxes:[...e.boxes,u],swimlanes:{...e.swimlanes,[`${a.index}`]:a},previousSwimlaneNumber:i.index,previousFrame:t.frame,maxR:x},f=A(h.swimlanes);f.length>0&&(f[0].y=0);for(let p=1;p<f.length;p++){const P=f[p],b=f[p-1];P.y=b.y+b.height+s.swimlaneGap}return h}o(z,"evolveFramePositioned");function K(e,n){return e===0&&n.sourceFrames.length===0}o(K,"isFirstFrame");function q(e){return e.sourceFrames!==void 0&&e.sourceFrames!==null&&e.sourceFrames.length>0}o(q,"hasSourceFrame");function F(e,n){if(n!=null)return e.find(t=>t.frame.name===n.name)}o(F,"findBoxByFrame");function J(e,n,t){if(!(t<0))for(let i=t;i>=0;i--){const a=e[i];if(a.swimlane.index!==n)return a}}o(J,"findBoxByLineIndex");function Q(e,n){const t=n;if(K(t.index,t.frame))return[];const i=F(e.boxes,t.frame);if(i===void 0)throw new Error(`Target box not found for frame ${t.frame.name}`);let a;if(t.sourceFrame)a=F(e.boxes,t.sourceFrame);else{if(ve(t.frame))return[];a=J(e.boxes,i.swimlane.index,t.index-1)}return a===void 0?[]:[{$kind:C,frame:t.frame,index:t.index,sourceBox:a,targetBox:i}]}o(Q,"decidePositionRelation");function Z(e,n){const t=n,i={visual:{fill:"none",stroke:"#000"},source:{x:t.sourceBox.x,y:t.sourceBox.y},target:{x:t.targetBox.x,y:t.targetBox.y},sourceBox:t.sourceBox,targetBox:t.targetBox};return{...e,relations:[...e.relations,i]}}o(Z,"evolveRelationPositioned");var Fe={[N]:j,[B]:Q},Ee={[T]:z,[C]:Z};function ee(e,n){const t=Fe[n.$kind];if(t==null)return[];const i=t(e,n);return g.debug("decided events",i),i}o(ee,"decide");function te(e,n){const t=n.reduce((i,a)=>{const r=Ee[a.$kind];return r==null?i:r(i,a)},e);return g.debug("evolve events",{state:e,newState:t,events:n}),t}o(te,"evolve");function w(e,n){const t=ee(e,n);return te(e,t)}o(w,"dispatch");var E={getConfig:ke,preserveCommentsWhenParsing:!0,setOptions:ye,getOptions:Pe,clear:Se,setAccTitle:ue,getAccTitle:me,getAccDescription:ce,setAccDescription:le,setDiagramTitle:de,getDiagramTitle:se,setAst:O,getDiagramProps:R,getState:I},$e={parse:o(async e=>{const n=await be("eventmodeling",e);g.debug(n),E.setAst(n),oe(n,E)},"parse")},k=D(),Re=k==null?void 0:k.eventmodeling;function ne(e,n){return t=>{const i=t.swimlane.y+n.swimlanePadding,a=e.append("g").attr("class","em-box");a.append("rect").attr("x",t.x).attr("y",i).attr("rx","3").attr("width",t.dimension.width).attr("height",t.dimension.height).attr("stroke",t.visual.stroke).attr("fill",t.visual.fill),a.append("foreignObject").attr("x",t.x+n.boxPadding).attr("y",i+10).attr("width",t.dimension.width-2*n.boxPadding).attr("height",t.dimension.height-2*n.boxPadding).append("xhtml:div").style("display","table").style("height","100%").style("width","100%").append("span").style("display","table-cell").style("text-align","center").style("vertical-align","middle").html(t.text)}}o(ne,"renderD3Box");function ie(e,n){return e>n}o(ie,"dirUpwards");function ae(e,n,t,i){return a=>{const r=a.sourceBox.swimlane.y+n.swimlanePadding,d=a.targetBox.swimlane.y+n.swimlanePadding,l=ie(r,d),c=a.sourceBox.x+a.sourceBox.dimension.width*2/3,m=a.targetBox.x+a.targetBox.dimension.width/3;let x,u;g.debug(`rendering relation up=${l} for `,{sourceBox:a.sourceBox,targetBox:a.targetBox}),l?(x=r,u=d+a.targetBox.dimension.height):(x=r+a.sourceBox.dimension.height,u=d);const h=i.emRelationStroke??a.visual.stroke;e.append("path").attr("class","em-relation").attr("fill",a.visual.fill).attr("stroke",h).attr("stroke-width","1").attr("marker-end",`url(#${t})`).attr("d",`M${c} ${x} L${m} ${u}`)}}o(ae,"renderD3Relation");function re(e,n,t,i){return a=>{const r=e.append("g").attr("class","em-swimlane"),d=i.emSwimlaneBackgroundOdd??"rgb(250,250,250)",l=i.emSwimlaneBackgroundStroke??"rgb(240,240,240)";r.append("rect").attr("x",0).attr("y",a.y).attr("rx","3").attr("width",n+t.swimlanePadding).attr("height",a.height).attr("fill",d).attr("stroke",l),r.append("text").attr("font-weight",t.swimlaneTextFontWeight).attr("x",30).attr("y",a.y+30).text(a.label)}}o(re,"renderD3Swimlane");var Ae=o(function(e,n,t,i){if(g.debug("in eventmodeling renderer",e+`
|
|
3
|
-
`,"id:",n,t),!Re)throw new Error("EventModeling config not found");const a=i.db,{themeVariables:r,eventmodeling:d}=D(),l=we(`[id="${n}"]`),c=a.getDiagramProps(),m=a.getState(),x=`em-arrowhead-${n}`,u=r.emArrowhead??"#000000";m.sortedSwimlanesArray.forEach(re(l,m.maxR,c,r)),m.boxes.forEach(ne(l,c)),m.relations.forEach(ae(l,c,x,r)),l.append("defs").append("marker").attr("id",x).attr("markerWidth","10").attr("markerHeight","7").attr("refX","10").attr("refY","3.5").attr("orient","auto").append("polygon").attr("points","0 0, 10 3.5, 0 7").attr("fill",u),xe(void 0,l,(d==null?void 0:d.padding)??30,d==null?void 0:d.useMaxWidth)},"draw"),De={draw:Ae},Ne=o(e=>"","getStyles"),Te=Ne,
|
|
3
|
+
`,"id:",n,t),!Re)throw new Error("EventModeling config not found");const a=i.db,{themeVariables:r,eventmodeling:d}=D(),l=we(`[id="${n}"]`),c=a.getDiagramProps(),m=a.getState(),x=`em-arrowhead-${n}`,u=r.emArrowhead??"#000000";m.sortedSwimlanesArray.forEach(re(l,m.maxR,c,r)),m.boxes.forEach(ne(l,c)),m.relations.forEach(ae(l,c,x,r)),l.append("defs").append("marker").attr("id",x).attr("markerWidth","10").attr("markerHeight","7").attr("refX","10").attr("refY","3.5").attr("orient","auto").append("polygon").attr("points","0 0, 10 3.5, 0 7").attr("fill",u),xe(void 0,l,(d==null?void 0:d.padding)??30,d==null?void 0:d.useMaxWidth)},"draw"),De={draw:Ae},Ne=o(e=>"","getStyles"),Te=Ne,Ue={parser:$e,db:E,renderer:De,styles:Te};export{Ue as diagram};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import{p as I}from"./chunk-JWPE2WC7-CEYXaZDX.js";import{s as _,g as E,q as F,p as D,a as P,b as z,_ as c,P as G,z as B,M as w,K as C,N as W,l as b,Q as V,d as H}from"./mermaid.core-knGXJfjz.js";import{p as j}from"./cynefin-EF2NZ3EQ-AFHjx2wU.js";import"./main-B_0jS_Gz.js";import"./modulepreload-polyfill-B5Qt9EMX.js";var x={showLegend:!0,ticks:5,max:null,min:0,graticule:"circle"},y=32,A={axes:[],curves:[],options:x},m=structuredClone(A),K=W.radar,N=c(()=>w({...K,...C().radar}),"getConfig"),M=c(()=>m.axes,"getAxes"),U=c(()=>m.curves,"getCurves"),X=c(()=>m.options,"getOptions"),q=c(a=>{m.axes=a.map(t=>({name:t.name,label:t.label??t.name}))},"setAxes"),Q=c(a=>{m.curves=a.map(t=>({name:t.name,label:t.label??t.name,entries:Y(t.entries)}))},"setCurves"),Y=c(a=>{if(a[0].axis==null)return a.map(e=>e.value);const t=M();if(t.length===0)throw new Error("Axes must be populated before curves for reference entries");return t.map(e=>{const r=a.find(s=>{var n;return((n=s.axis)==null?void 0:n.$refText)===e.name});if(r===void 0)throw new Error("Missing entry for axis "+e.label);return r.value})},"computeCurveEntries"),Z=c(a=>{var e,r,s,n,l;const t=a.reduce((o,i)=>(o[i.name]=i,o),{});m.options={showLegend:((e=t.showLegend)==null?void 0:e.value)??x.showLegend,ticks:((r=t.ticks)==null?void 0:r.value)??x.ticks,max:((s=t.max)==null?void 0:s.value)??x.max,min:((n=t.min)==null?void 0:n.value)??x.min,graticule:((l=t.graticule)==null?void 0:l.value)??x.graticule},m.options.ticks>y&&(b.warn(`Radar diagram ticks (${m.options.ticks}) exceeds maximum allowed (${y}). Using ${y} instead.`),m.options.ticks=y)},"setOptions"),J=c(()=>{B(),m=structuredClone(A)},"clear"),$={getAxes:M,getCurves:U,getOptions:X,setAxes:q,setCurves:Q,setOptions:Z,getConfig:N,clear:J,setAccTitle:z,getAccTitle:P,setDiagramTitle:D,getDiagramTitle:F,getAccDescription:E,setAccDescription:_},tt=c(a=>{I(a,$);const{axes:t,curves:e,options:r}=a;$.setAxes(t),$.setCurves(e),$.setOptions(r)},"populate"),et={parse:c(async a=>{const t=await j("radar",a);b.debug(t),tt(t)},"parse")},at=c((a,t,e,r)=>{const s=r.db,n=s.getAxes(),l=s.getCurves(),o=s.getOptions(),i=s.getConfig(),d=s.getDiagramTitle(),p=G(t),u=rt(p,i),g=o.max??Math.max(...l.map(f=>Math.max(...f.entries))),h=o.min,v=Math.min(i.width,i.height)/2;st(u,n,v,o.ticks,o.graticule),nt(u,n,v,i),L(u,n,l,h,g,o.graticule,i),k(u,l,o.showLegend,i),u.append("text").attr("class","radarTitle").text(d).attr("x",0).attr("y",-i.height/2-i.marginTop)},"draw"),rt=c((a,t)=>{const e=t.width+t.marginLeft+t.marginRight,r=t.height+t.marginTop+t.marginBottom,s={x:t.marginLeft+t.width/2,y:t.marginTop+t.height/2};return H(a,r,e,t.useMaxWidth??!0),a.attr("viewBox",`0 0 ${e} ${r}`).attr("overflow","visible"),a.append("g").attr("transform",`translate(${s.x}, ${s.y})`)},"drawFrame"),st=c((a,t,e,r,s)=>{if(s==="circle")for(let n=0;n<r;n++){const l=e*(n+1)/r;a.append("circle").attr("r",l).attr("class","radarGraticule")}else if(s==="polygon"){const n=t.length;for(let l=0;l<r;l++){const o=e*(l+1)/r,i=t.map((d,p)=>{const u=2*p*Math.PI/n-Math.PI/2,g=o*Math.cos(u),h=o*Math.sin(u);return`${g},${h}`}).join(" ");a.append("polygon").attr("points",i).attr("class","radarGraticule")}}},"drawGraticule"),nt=c((a,t,e,r)=>{const s=t.length;for(let n=0;n<s;n++){const l=t[n].label,o=2*n*Math.PI/s-Math.PI/2,i=Math.cos(o),d=Math.sin(o);a.append("line").attr("x1",0).attr("y1",0).attr("x2",e*r.axisScaleFactor*i).attr("y2",e*r.axisScaleFactor*d).attr("class","radarAxisLine");const p=i>.01?"start":i<-.01?"end":"middle",u=d>.01?"hanging":d<-.01?"auto":"central",g=4;a.append("text").text(l).attr("x",e*r.axisLabelFactor*i+g*i).attr("y",e*r.axisLabelFactor*d+g*d).attr("text-anchor",p).attr("dominant-baseline",u).attr("class","radarAxisLabel")}},"drawAxes");function L(a,t,e,r,s,n,l){const o=t.length,i=Math.min(l.width,l.height)/2;e.forEach((d,p)=>{if(d.entries.length!==o)return;const u=d.entries.map((g,h)=>{const v=2*Math.PI*h/o-Math.PI/2,f=T(g,r,s,i),O=f*Math.cos(v),R=f*Math.sin(v);return{x:O,y:R}});n==="circle"?a.append("path").attr("d",S(u,l.curveTension)).attr("class",`radarCurve-${p}`):n==="polygon"&&a.append("polygon").attr("points",u.map(g=>`${g.x},${g.y}`).join(" ")).attr("class",`radarCurve-${p}`)})}c(L,"drawCurves");function T(a,t,e,r){const s=Math.min(Math.max(a,t),e);return r*(s-t)/(e-t)}c(T,"relativeRadius");function S(a,t){const e=a.length;let r=`M${a[0].x},${a[0].y}`;for(let s=0;s<e;s++){const n=a[(s-1+e)%e],l=a[s],o=a[(s+1)%e],i=a[(s+2)%e],d={x:l.x+(o.x-n.x)*t,y:l.y+(o.y-n.y)*t},p={x:o.x-(i.x-l.x)*t,y:o.y-(i.y-l.y)*t};r+=` C${d.x},${d.y} ${p.x},${p.y} ${o.x},${o.y}`}return`${r} Z`}c(S,"closedRoundCurve");function k(a,t,e,r){if(!e)return;const s=(r.width/2+r.marginRight)*3/4,n=-(r.height/2+r.marginTop)*3/4,l=20;t.forEach((o,i)=>{const d=a.append("g").attr("transform",`translate(${s}, ${n+i*l})`);d.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${i}`),d.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(o.label)})}c(k,"drawLegend");var ot={draw:at},it=c((a,t)=>{let e="";for(let r=0;r<a.THEME_COLOR_LIMIT;r++){const s=a[`cScale${r}`];e+=`
|
|
2
|
+
.radarCurve-${r} {
|
|
3
|
+
color: ${s};
|
|
4
|
+
fill: ${s};
|
|
5
|
+
fill-opacity: ${t.curveOpacity};
|
|
6
|
+
stroke: ${s};
|
|
7
|
+
stroke-width: ${t.curveStrokeWidth};
|
|
8
|
+
}
|
|
9
|
+
.radarLegendBox-${r} {
|
|
10
|
+
fill: ${s};
|
|
11
|
+
fill-opacity: ${t.curveOpacity};
|
|
12
|
+
stroke: ${s};
|
|
13
|
+
}
|
|
14
|
+
`}return e},"genIndexStyles"),lt=c(a=>{const t=V(),e=C(),r=w(t,e.themeVariables),s=w(r.radar,a);return{themeVariables:r,radarOptions:s}},"buildRadarStyleOptions"),ct=c(({radar:a}={})=>{const{themeVariables:t,radarOptions:e}=lt(a);return`
|
|
15
|
+
.radarTitle {
|
|
16
|
+
font-size: ${t.fontSize};
|
|
17
|
+
color: ${t.titleColor};
|
|
18
|
+
dominant-baseline: hanging;
|
|
19
|
+
text-anchor: middle;
|
|
20
|
+
}
|
|
21
|
+
.radarAxisLine {
|
|
22
|
+
stroke: ${e.axisColor};
|
|
23
|
+
stroke-width: ${e.axisStrokeWidth};
|
|
24
|
+
}
|
|
25
|
+
.radarAxisLabel {
|
|
26
|
+
font-size: ${e.axisLabelFontSize}px;
|
|
27
|
+
color: ${e.axisColor};
|
|
28
|
+
}
|
|
29
|
+
.radarGraticule {
|
|
30
|
+
fill: ${e.graticuleColor};
|
|
31
|
+
fill-opacity: ${e.graticuleOpacity};
|
|
32
|
+
stroke: ${e.graticuleColor};
|
|
33
|
+
stroke-width: ${e.graticuleStrokeWidth};
|
|
34
|
+
}
|
|
35
|
+
.radarLegendText {
|
|
36
|
+
text-anchor: start;
|
|
37
|
+
font-size: ${e.legendFontSize}px;
|
|
38
|
+
dominant-baseline: hanging;
|
|
39
|
+
}
|
|
40
|
+
${it(t,e)}
|
|
41
|
+
`},"styles"),xt={parser:et,db:$,renderer:ot,styles:ct};export{xt as diagram};
|