pmx-canvas 0.11.0 → 0.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (300) hide show
  1. package/.github/extensions/pmx-canvas/extension.mjs +4 -1
  2. package/.github/extensions/pmx-canvas/runtime.json +1 -1
  3. package/.github/extensions/pmx-canvas/tools.json +440 -18
  4. package/CHANGELOG.md +51 -0
  5. package/dist/amp-plugin/pmx-canvas/LICENSE +21 -0
  6. package/dist/amp-plugin/pmx-canvas/THIRD_PARTY_LICENSES.txt +331 -0
  7. package/dist/amp-plugin/pmx-canvas/index.js +5445 -0
  8. package/dist/amp-plugin/pmx-canvas/runtime.json +3 -0
  9. package/dist/amp-plugin/pmx-canvas/shared-runtime.mjs +194 -0
  10. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/SKILL.md +267 -0
  11. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/evals/evals.json +1168 -0
  12. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/evals/fixtures/code-exploration/src/auth/jwt.ts +17 -0
  13. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/evals/fixtures/code-exploration/src/auth/login.ts +12 -0
  14. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/evals/fixtures/code-exploration/src/auth/middleware.ts +13 -0
  15. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/evals/fixtures/code-exploration/src/routes/auth.ts +13 -0
  16. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/evals/fixtures/investigation-board/src/handlers/users.ts +27 -0
  17. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/mcp.json +36 -0
  18. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/references/ax-html-control-surface.md +101 -0
  19. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/references/codex-app-adapter.md +151 -0
  20. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/references/excalidraw-diagram-authoring.md +150 -0
  21. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/references/full-reference.md +1839 -0
  22. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/references/github-copilot-app-adapter.md +223 -0
  23. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/references/html-primitives.md +139 -0
  24. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/references/importing-context.md +132 -0
  25. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/references/installing-pmx-canvas.md +301 -0
  26. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/references/tours-and-recording.md +117 -0
  27. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/references/workbench-workflows.md +908 -0
  28. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas-orchestration/SKILL.md +141 -0
  29. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas-testing/SKILL.md +266 -0
  30. package/dist/amp-plugin/pmx-canvas/start-mcp.mjs +14857 -0
  31. package/dist/amp-plugin/pmx-canvas/tools.json +10963 -0
  32. package/dist/canvas/chunks/{abnfDiagram-N423BO3Z-p8dtp6va.js → abnfDiagram-N423BO3Z-cwtsds5d.js} +1 -1
  33. package/dist/canvas/chunks/architecture-TIHT7OUA-x63cwejs.js +1 -0
  34. package/dist/canvas/chunks/{architectureDiagram-T3A2C74G-5jhmxrzf.js → architectureDiagram-T3A2C74G-b4xc9tpz.js} +3 -3
  35. package/dist/canvas/chunks/{blockDiagram-VBNYF7ZC-pw1fa9yb.js → blockDiagram-VBNYF7ZC-ahp3yxxs.js} +7 -7
  36. package/dist/canvas/chunks/{c4Diagram-5PPSVZJV-x07nq0tt.js → c4Diagram-5PPSVZJV-nappnay7.js} +4 -4
  37. package/dist/canvas/chunks/classDiagram-JCYQIIEL-k1j2xc1t.js +1 -0
  38. package/dist/canvas/chunks/classDiagram-v2-OCEON4UE-33x08xf2.js +1 -0
  39. package/dist/canvas/chunks/{cose-bilkent-JH36ORCC-nm39npq0.js → cose-bilkent-JH36ORCC-a428syda.js} +1 -1
  40. package/dist/canvas/chunks/cynefin-VYW2F7L2-8v6jxfz8.js +1 -0
  41. package/dist/canvas/chunks/{cynefinDiagram-MW4NZA55-vdxrwahz.js → cynefinDiagram-MW4NZA55-nspsqebj.js} +1 -1
  42. package/dist/canvas/chunks/{dagre-VZM6K2ZE-bqdm7wpd.js → dagre-VZM6K2ZE-8y6177fh.js} +2 -2
  43. package/dist/canvas/chunks/{diagram-7IWD3JNH-gs5gpr93.js → diagram-7IWD3JNH-vym028wn.js} +4 -4
  44. package/dist/canvas/chunks/{diagram-B4RE2ZJO-cgwjg47s.js → diagram-B4RE2ZJO-jddqb8sy.js} +1 -1
  45. package/dist/canvas/chunks/{diagram-LBJQPF4R-w3vahpav.js → diagram-LBJQPF4R-bjwbpkrn.js} +1 -1
  46. package/dist/canvas/chunks/{diagram-Q27KOJAE-42837z6h.js → diagram-Q27KOJAE-j6ph6hcx.js} +2 -2
  47. package/dist/canvas/chunks/{diagram-UB23O5K3-4fz83q59.js → diagram-UB23O5K3-p09w8jej.js} +1 -1
  48. package/dist/canvas/chunks/{ebnfDiagram-BXEA7PRR-zphtgegj.js → ebnfDiagram-BXEA7PRR-j975ycq5.js} +1 -1
  49. package/dist/canvas/chunks/{erDiagram-JOGREHBK-zvbbdxp4.js → erDiagram-JOGREHBK-sxp6hjn8.js} +5 -5
  50. package/dist/canvas/chunks/eventmodeling-45OFAUF4-xzfgn6xg.js +1 -0
  51. package/dist/canvas/chunks/flowDiagram-UKHOOZJN-2nsmkskb.js +1 -0
  52. package/dist/canvas/chunks/{ganttDiagram-PKOTCBZU-282jzycm.js → ganttDiagram-PKOTCBZU-4tv230y2.js} +2 -2
  53. package/dist/canvas/chunks/gitGraph-TEB2WS4Q-macbhand.js +1 -0
  54. package/dist/canvas/chunks/{gitGraphDiagram-DS77QQ5N-vqqy6p1b.js → gitGraphDiagram-DS77QQ5N-mqgmnw9g.js} +1 -1
  55. package/dist/canvas/chunks/{index-wgv7en21.js → index-037z5dz2.js} +2 -2
  56. package/dist/canvas/chunks/{index-w2mra17t.js → index-081n3har.js} +1 -1
  57. package/dist/canvas/chunks/{index-353m7b0p.js → index-5n03dmb9.js} +1 -1
  58. package/dist/canvas/chunks/{index-yw8h9vha.js → index-60pgzdqe.js} +1 -1
  59. package/dist/canvas/chunks/index-8g1vb57n.js +2 -0
  60. package/dist/canvas/chunks/{index-vv56h019.js → index-8rjes9r6.js} +1 -1
  61. package/dist/canvas/chunks/{index-nprm96xp.js → index-9022d1n9.js} +1 -1
  62. package/dist/canvas/chunks/{index-194m3hc3.js → index-9b02042t.js} +1 -1
  63. package/dist/canvas/chunks/{index-0rk4gp1g.js → index-ap4q4vez.js} +1 -1
  64. package/dist/canvas/chunks/{index-rh7nv68n.js → index-dyp2nhd3.js} +1 -1
  65. package/dist/canvas/chunks/index-frvta4tm.js +2 -0
  66. package/dist/canvas/chunks/{index-s4j678gj.js → index-h9ycj8n2.js} +1 -1
  67. package/dist/canvas/chunks/{index-fjtdggjn.js → index-mergmj97.js} +2 -2
  68. package/dist/canvas/chunks/index-nwsya6dj.js +301 -0
  69. package/dist/canvas/chunks/{index-3cy1bzwh.js → index-nz8qbd1p.js} +1 -1
  70. package/dist/canvas/chunks/{index-d3b3gqe9.js → index-qhfrazv3.js} +1 -1
  71. package/dist/canvas/chunks/{index-6qmsnxwy.js → index-v119nznk.js} +4 -4
  72. package/dist/canvas/chunks/{index-r2fyc9w1.js → index-vpt37m3d.js} +6 -6
  73. package/dist/canvas/chunks/{index-qj8fxwsf.js → index-y9ma6azy.js} +1 -1
  74. package/dist/canvas/chunks/{index-tb1wf525.js → index-zx0j3a2z.js} +26 -26
  75. package/dist/canvas/chunks/info-DKCQHKI2-a0ykzs9z.js +1 -0
  76. package/dist/canvas/chunks/{infoDiagram-6WML65LV-v1yvggqj.js → infoDiagram-6WML65LV-qv97qq6a.js} +2 -2
  77. package/dist/canvas/chunks/ishikawaDiagram-WSZJBQD7-p9306gh0.js +70 -0
  78. package/dist/canvas/chunks/{journeyDiagram-NVQOT4AX-zjcffveh.js → journeyDiagram-NVQOT4AX-sv67zats.js} +5 -5
  79. package/dist/canvas/chunks/{kanban-definition-27J2QSJJ-dakqtfp1.js → kanban-definition-27J2QSJJ-k2pfam6p.js} +1 -1
  80. package/dist/canvas/chunks/{mermaid.core-j2geswrd.js → mermaid.core-83r0fdce.js} +4 -4
  81. package/dist/canvas/chunks/{mindmap-definition-FAOFIHXS-142xhr3k.js → mindmap-definition-FAOFIHXS-vg2newm1.js} +1 -1
  82. package/dist/canvas/chunks/packet-7NZHBO7P-tqnabcdv.js +1 -0
  83. package/dist/canvas/chunks/{pegDiagram-VL7TDLO6-5wvk7vsd.js → pegDiagram-VL7TDLO6-k2h7zc5n.js} +1 -1
  84. package/dist/canvas/chunks/pie-RZYD4A2V-wke6gyhe.js +1 -0
  85. package/dist/canvas/chunks/{pieDiagram-7S7Q4E2Y-ztdhwycc.js → pieDiagram-7S7Q4E2Y-hg169p1v.js} +2 -2
  86. package/dist/canvas/chunks/{quadrantDiagram-CIZ2JOQS-c5p9gmg6.js → quadrantDiagram-CIZ2JOQS-bxtvsq0b.js} +5 -5
  87. package/dist/canvas/chunks/radar-I7S5WNFK-w7ka0drw.js +1 -0
  88. package/dist/canvas/chunks/railroad-3IZDKUUU-y3vg318x.js +1 -0
  89. package/dist/canvas/chunks/railroad-abnf-AHOZXSZD-6hqvcz3c.js +1 -0
  90. package/dist/canvas/chunks/railroad-ebnf-EBAXGLYW-vcae260m.js +1 -0
  91. package/dist/canvas/chunks/railroad-peg-LSFZ7HO6-0dbyme23.js +1 -0
  92. package/dist/canvas/chunks/{railroadDiagram-AXF67PYL-xkmqkjwf.js → railroadDiagram-AXF67PYL-njyhcp4p.js} +1 -1
  93. package/dist/canvas/chunks/{requirementDiagram-LRYGKXZP-9wm2dyaw.js → requirementDiagram-LRYGKXZP-2z6v09gm.js} +4 -4
  94. package/dist/canvas/chunks/{sankeyDiagram-W5VNT64P-2w19etgb.js → sankeyDiagram-W5VNT64P-15mzam0e.js} +1 -1
  95. package/dist/canvas/chunks/{sequenceDiagram-SI44F4Z6-0jn0vwmz.js → sequenceDiagram-SI44F4Z6-rbshyd2c.js} +12 -12
  96. package/dist/canvas/chunks/{sizeCapture-X5ZJPWSS-x75epwdq.js → sizeCapture-X5ZJPWSS-sg26xwts.js} +1 -1
  97. package/dist/canvas/chunks/{stateDiagram-OKZ733FA-schjpy6d.js → stateDiagram-OKZ733FA-6eahp98e.js} +1 -1
  98. package/dist/canvas/chunks/stateDiagram-v2-UEYNNEHI-tty0ggn5.js +1 -0
  99. package/dist/canvas/chunks/{swimlanes-SLNWSIFB-gkw4xce3.js → swimlanes-SLNWSIFB-ze5db10t.js} +1 -1
  100. package/dist/canvas/chunks/swimlanesDiagram-ULZ7WXOC-thze75gq.js +8 -0
  101. package/dist/canvas/chunks/{timeline-definition-Z64GVDOM-x7nkcy01.js → timeline-definition-Z64GVDOM-vnp7jyy8.js} +3 -3
  102. package/dist/canvas/chunks/treeView-QDETBFTQ-6ysffnm6.js +1 -0
  103. package/dist/canvas/chunks/treemap-6X3UGDF4-m3h9p066.js +1 -0
  104. package/dist/canvas/chunks/vennDiagram-T6HMQDX7-0qrnb7mj.js +34 -0
  105. package/dist/canvas/chunks/wardley-OPB4EBWU-dp37drwx.js +1 -0
  106. package/dist/canvas/chunks/{wardleyDiagram-T6FBY63Y-t1j52t9r.js → wardleyDiagram-T6FBY63Y-8nxg8wqt.js} +4 -4
  107. package/dist/canvas/chunks/{xychartDiagram-ELKLHX3M-38t16pme.js → xychartDiagram-ELKLHX3M-nj921e7s.js} +5 -5
  108. package/dist/canvas/global.css +94 -1
  109. package/dist/canvas/index.js +154 -145
  110. package/dist/canvas/mcp-app.html +600 -498
  111. package/dist/json-render/index.css +1 -1
  112. package/dist/types/client/canvas/BoardMoveDialog.d.ts +2 -0
  113. package/dist/types/client/canvas/EdgeEditor.d.ts +19 -0
  114. package/dist/types/client/canvas/GroupNavigation.d.ts +2 -0
  115. package/dist/types/client/canvas/TextPrompt.d.ts +4 -0
  116. package/dist/types/client/nodes/PromptNode.d.ts +1 -0
  117. package/dist/types/client/nodes/ViewerFrame.d.ts +1 -1
  118. package/dist/types/client/nodes/WorkCard.d.ts +7 -0
  119. package/dist/types/client/nodes/use-ax-surface-bridge.d.ts +1 -0
  120. package/dist/types/client/state/canvas-store.d.ts +15 -0
  121. package/dist/types/client/state/human-store.d.ts +2 -0
  122. package/dist/types/client/state/intent-bridge.d.ts +4 -2
  123. package/dist/types/client/state/relation-store.d.ts +11 -0
  124. package/dist/types/client/types.d.ts +1 -1
  125. package/dist/types/json-render/catalog.d.ts +2 -2
  126. package/dist/types/server/agent-presence.d.ts +1 -0
  127. package/dist/types/server/ax-interaction.d.ts +1 -0
  128. package/dist/types/server/ax-state-manager.d.ts +10 -2
  129. package/dist/types/server/board-local.d.ts +4 -0
  130. package/dist/types/server/board-move.d.ts +38 -0
  131. package/dist/types/server/canvas-db.d.ts +12 -2
  132. package/dist/types/server/canvas-operations.d.ts +5 -6
  133. package/dist/types/server/canvas-provenance.d.ts +1 -1
  134. package/dist/types/server/canvas-serialization.d.ts +1 -0
  135. package/dist/types/server/canvas-state.d.ts +84 -20
  136. package/dist/types/server/card-relocation.d.ts +6 -0
  137. package/dist/types/server/context-reads.d.ts +3 -1
  138. package/dist/types/server/human-presence.d.ts +1 -1
  139. package/dist/types/server/index.d.ts +16 -5
  140. package/dist/types/server/intent-registry.d.ts +8 -4
  141. package/dist/types/server/knowledge-lifecycle.d.ts +4 -2
  142. package/dist/types/server/mutation-history.d.ts +7 -5
  143. package/dist/types/server/operations/registry.d.ts +2 -0
  144. package/dist/types/server/trace-manager.d.ts +1 -0
  145. package/dist/types/shared/ax-kinds.d.ts +6 -0
  146. package/dist/types/shared/ax-surface-protocol.d.ts +8 -0
  147. package/dist/types/shared/human-presence.d.ts +1 -0
  148. package/dist/types/shared/lifecycle-status.d.ts +2 -0
  149. package/docs/RELEASE.md +21 -14
  150. package/docs/agent-plugin.md +22 -2
  151. package/docs/amp-plugin.md +270 -0
  152. package/docs/cli.md +42 -3
  153. package/docs/design/GuestName.dc.html +50 -0
  154. package/docs/design/PluginLogo.svg +7 -0
  155. package/docs/design/WorkCards.dc.html +39 -0
  156. package/docs/design/canvas.json +16 -0
  157. package/docs/design/plugin-logo.png +0 -0
  158. package/docs/design.md +111 -8
  159. package/docs/evals/agents-md-sections.md +38 -0
  160. package/docs/http-api.md +128 -10
  161. package/docs/mcp.md +61 -9
  162. package/docs/node-types.md +71 -1
  163. package/docs/plans/plan-009-tech-debt-backlog.md +1 -1
  164. package/docs/plans/plan-019-post-0.9-roadmap.md +44 -20
  165. package/docs/plans/plan-020-wave-5-work-planning.md +553 -0
  166. package/docs/product-vision-2026-09.md +33 -17
  167. package/docs/sdk.md +18 -0
  168. package/package.json +6 -3
  169. package/plugins/pmx-canvas/assets/preview.png +0 -0
  170. package/plugins/pmx-canvas/com.github.copilot/extensions/pmx-canvas/extension.mjs +4 -1
  171. package/plugins/pmx-canvas/com.github.copilot/extensions/pmx-canvas/runtime.json +1 -1
  172. package/plugins/pmx-canvas/plugin.json +2 -2
  173. package/plugins/pmx-canvas/runtime.json +1 -1
  174. package/plugins/pmx-canvas/tools.json +440 -18
  175. package/skills/data-analysis/SKILL.md +13 -26
  176. package/skills/frontend-design/LICENSE.txt +177 -0
  177. package/skills/frontend-design/SKILL.md +3 -0
  178. package/skills/pmx-canvas/SKILL.md +248 -842
  179. package/skills/pmx-canvas/evals/evals.json +110 -5
  180. package/skills/pmx-canvas/references/full-reference.md +142 -28
  181. package/skills/pmx-canvas/references/html-primitives.md +7 -0
  182. package/skills/pmx-canvas/references/installing-pmx-canvas.md +61 -11
  183. package/skills/pmx-canvas/references/tours-and-recording.md +39 -6
  184. package/skills/pmx-canvas/references/workbench-workflows.md +908 -0
  185. package/skills/pmx-canvas-testing/SKILL.md +7 -5
  186. package/skills/published-consumer-e2e/SKILL.md +25 -8
  187. package/skills/published-consumer-e2e/scripts/run-published-consumer-e2e.sh +51 -75
  188. package/skills/web-artifacts-builder/LICENSE.txt +202 -0
  189. package/skills/web-artifacts-builder/SKILL.md +6 -0
  190. package/skills/web-artifacts-builder/scripts/bundle-artifact.sh +2 -2
  191. package/skills/web-artifacts-builder/scripts/init-artifact.sh +8 -8
  192. package/src/cli/commands/apps.ts +1 -0
  193. package/src/cli/commands/boards.ts +30 -0
  194. package/src/client/App.tsx +20 -4
  195. package/src/client/canvas/AttentionHistory.tsx +10 -2
  196. package/src/client/canvas/BoardMoveDialog.tsx +225 -0
  197. package/src/client/canvas/CanvasNode.tsx +45 -2
  198. package/src/client/canvas/CanvasViewport.tsx +38 -9
  199. package/src/client/canvas/ContextMenu.tsx +34 -12
  200. package/src/client/canvas/EdgeEditor.tsx +149 -0
  201. package/src/client/canvas/EdgeLayer.tsx +87 -16
  202. package/src/client/canvas/ExpandedNodeOverlay.tsx +4 -0
  203. package/src/client/canvas/GroupNavigation.tsx +85 -0
  204. package/src/client/canvas/RelationsPanel.tsx +9 -0
  205. package/src/client/canvas/SelectionBar.tsx +21 -0
  206. package/src/client/canvas/SessionPanel.tsx +35 -1
  207. package/src/client/canvas/TextPrompt.tsx +18 -1
  208. package/src/client/canvas/TopBar.tsx +30 -0
  209. package/src/client/canvas/canvas-area.ts +1 -1
  210. package/src/client/nodes/ExtAppFrame.tsx +26 -10
  211. package/src/client/nodes/MarkdownNode.tsx +6 -7
  212. package/src/client/nodes/PromptNode.tsx +32 -3
  213. package/src/client/nodes/StatusNode.tsx +12 -0
  214. package/src/client/nodes/StatusSummary.tsx +11 -0
  215. package/src/client/nodes/ViewerFrame.tsx +21 -10
  216. package/src/client/nodes/WorkCard.tsx +175 -0
  217. package/src/client/nodes/use-ax-surface-bridge.ts +18 -14
  218. package/src/client/state/attention-bridge.ts +5 -0
  219. package/src/client/state/attention-store.ts +1 -0
  220. package/src/client/state/canvas-store.ts +185 -15
  221. package/src/client/state/human-store.ts +22 -2
  222. package/src/client/state/intent-bridge.ts +19 -5
  223. package/src/client/state/relation-store.ts +127 -1
  224. package/src/client/theme/global.css +94 -1
  225. package/src/client/types.ts +1 -0
  226. package/src/mcp/server.ts +13 -3
  227. package/src/server/agent-presence.ts +43 -23
  228. package/src/server/ax-flow-loop.ts +6 -0
  229. package/src/server/ax-gate-ttl.ts +8 -1
  230. package/src/server/ax-interaction.ts +16 -10
  231. package/src/server/ax-state-manager.ts +17 -4
  232. package/src/server/ax-wait.ts +20 -6
  233. package/src/server/board-export.ts +19 -6
  234. package/src/server/board-local.ts +20 -0
  235. package/src/server/board-move.ts +297 -0
  236. package/src/server/canvas-db.ts +262 -160
  237. package/src/server/canvas-operations.ts +139 -109
  238. package/src/server/canvas-schema.ts +21 -0
  239. package/src/server/canvas-serialization.ts +2 -0
  240. package/src/server/canvas-state.ts +792 -159
  241. package/src/server/card-relocation.ts +53 -0
  242. package/src/server/code-graph.ts +4 -3
  243. package/src/server/context-reads.ts +83 -55
  244. package/src/server/demo-state.json +35 -15
  245. package/src/server/file-watcher.ts +30 -10
  246. package/src/server/human-presence.ts +18 -5
  247. package/src/server/index.ts +35 -15
  248. package/src/server/intent-registry.ts +43 -5
  249. package/src/server/knowledge-lifecycle.ts +32 -9
  250. package/src/server/lifecycle-status.ts +29 -1
  251. package/src/server/mcp-app-runtime.ts +26 -7
  252. package/src/server/mutation-history.ts +37 -8
  253. package/src/server/operations/composites.ts +6 -3
  254. package/src/server/operations/mcp-contracts.ts +15 -0
  255. package/src/server/operations/mcp.ts +36 -9
  256. package/src/server/operations/ops/annotation.ts +22 -1
  257. package/src/server/operations/ops/ax-await.ts +1 -0
  258. package/src/server/operations/ops/ax-timeline.ts +28 -2
  259. package/src/server/operations/ops/batch.ts +25 -11
  260. package/src/server/operations/ops/boards.ts +44 -3
  261. package/src/server/operations/ops/nodes.ts +70 -0
  262. package/src/server/operations/ops/query.ts +32 -3
  263. package/src/server/operations/ops/snapshots.ts +1 -0
  264. package/src/server/operations/registry.ts +49 -4
  265. package/src/server/server.ts +62 -16
  266. package/src/server/tour-control.ts +37 -12
  267. package/src/server/trace-manager.ts +4 -0
  268. package/src/server/web-artifacts/scripts/bundle-artifact.sh +2 -2
  269. package/src/server/web-artifacts/scripts/init-artifact.sh +8 -8
  270. package/src/shared/agent-context.ts +7 -1
  271. package/src/shared/auto-arrange.ts +5 -4
  272. package/src/shared/ax-kinds.ts +13 -0
  273. package/src/shared/ax-surface-protocol.ts +22 -0
  274. package/src/shared/human-presence.ts +1 -0
  275. package/src/shared/lifecycle-status.ts +2 -0
  276. package/dist/canvas/chunks/architecture-TIHT7OUA-9tffvpsv.js +0 -1
  277. package/dist/canvas/chunks/classDiagram-JCYQIIEL-nc6g5x1r.js +0 -1
  278. package/dist/canvas/chunks/classDiagram-v2-OCEON4UE-0qnbpwvh.js +0 -1
  279. package/dist/canvas/chunks/cynefin-VYW2F7L2-ys8p46ts.js +0 -1
  280. package/dist/canvas/chunks/eventmodeling-45OFAUF4-v9q6dn4c.js +0 -1
  281. package/dist/canvas/chunks/flowDiagram-UKHOOZJN-yrr5z8tc.js +0 -1
  282. package/dist/canvas/chunks/gitGraph-TEB2WS4Q-kdwb8m0a.js +0 -1
  283. package/dist/canvas/chunks/index-1r72hdzb.js +0 -301
  284. package/dist/canvas/chunks/index-g3pwnqeb.js +0 -2
  285. package/dist/canvas/chunks/index-rft2hcz5.js +0 -2
  286. package/dist/canvas/chunks/info-DKCQHKI2-wpzs6sz3.js +0 -1
  287. package/dist/canvas/chunks/ishikawaDiagram-WSZJBQD7-5hnq1a9p.js +0 -70
  288. package/dist/canvas/chunks/packet-7NZHBO7P-xn439f0s.js +0 -1
  289. package/dist/canvas/chunks/pie-RZYD4A2V-0kf16rwh.js +0 -1
  290. package/dist/canvas/chunks/radar-I7S5WNFK-0g2pz36t.js +0 -1
  291. package/dist/canvas/chunks/railroad-3IZDKUUU-fcaran6j.js +0 -1
  292. package/dist/canvas/chunks/railroad-abnf-AHOZXSZD-wgdya41q.js +0 -1
  293. package/dist/canvas/chunks/railroad-ebnf-EBAXGLYW-gy07a4ka.js +0 -1
  294. package/dist/canvas/chunks/railroad-peg-LSFZ7HO6-ewk6wtkh.js +0 -1
  295. package/dist/canvas/chunks/stateDiagram-v2-UEYNNEHI-k8sfp2e7.js +0 -1
  296. package/dist/canvas/chunks/swimlanesDiagram-ULZ7WXOC-nqysw67j.js +0 -8
  297. package/dist/canvas/chunks/treeView-QDETBFTQ-cesw6gp0.js +0 -1
  298. package/dist/canvas/chunks/treemap-6X3UGDF4-zdv4knp9.js +0 -1
  299. package/dist/canvas/chunks/vennDiagram-T6HMQDX7-x8dqn9yf.js +0 -34
  300. package/dist/canvas/chunks/wardley-OPB4EBWU-44pdddez.js +0 -1
@@ -0,0 +1,8 @@
1
+ import{e}from"./index-nwsya6dj.js";import"./index-v119nznk.js";import"./index-y9ma6azy.js";import{di,hi}from"./index-60pgzdqe.js";import"./index-9022d1n9.js";import"./index-frvta4tm.js";import"./index-h9ycj8n2.js";import"./index-nz8qbd1p.js";var r=e((t)=>`${di(t)}
2
+ .swimlane.cluster rect {
3
+ stroke: ${t.clusterBorder} !important;
4
+ }
5
+ [data-look="neo"].cluster rect {
6
+ filter: none;
7
+ }
8
+ `,"getStyles"),o=r,x=hi({defaultLayout:"swimlane",styles:o});export{x as diagram};
@@ -1,9 +1,9 @@
1
- import{e,st,t,N,i,a,u,Ie,Dn,d,r,n,A,he}from"./index-1r72hdzb.js";import"./index-6qmsnxwy.js";import{De}from"./index-rh7nv68n.js";var dt=function(){var o=e(function(T,h,k,y){for(k=k||{},y=T.length;y--;k[T[y]]=h);return k},"o"),s=[6,11,13,14,15,17,19,20,23,24],c=[1,12],p=[1,13],l=[1,14],m=[1,15],g=[1,16],f=[1,19],_=[1,20],v={trace:e(function(){},"trace"),yy:{},symbols_:{error:2,start:3,timeline_header:4,document:5,EOF:6,timeline:7,timeline_lr:8,timeline_td:9,line:10,SPACE:11,statement:12,NEWLINE:13,title:14,acc_title:15,acc_title_value:16,acc_descr:17,acc_descr_value:18,acc_descr_multiline_value:19,section:20,period_statement:21,event_statement:22,period:23,event:24,$accept:0,$end:1},terminals_:{2:"error",6:"EOF",7:"timeline",8:"timeline_lr",9:"timeline_td",11:"SPACE",13:"NEWLINE",14:"title",15:"acc_title",16:"acc_title_value",17:"acc_descr",18:"acc_descr_value",19:"acc_descr_multiline_value",20:"section",23:"period",24:"event"},productions_:[0,[3,3],[4,1],[4,1],[4,1],[5,0],[5,2],[10,2],[10,1],[10,1],[10,1],[12,1],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[21,1],[22,1]],performAction:e(function(h,k,y,b,S,x,L){var I=x.length-1;switch(S){case 1:return x[I-1];case 3:b.setDirection("LR");break;case 4:b.setDirection("TD");break;case 5:this.$=[];break;case 6:x[I-1].push(x[I]),this.$=x[I-1];break;case 7:case 8:this.$=x[I];break;case 9:case 10:this.$=[];break;case 11:b.getCommonDb().setDiagramTitle(x[I].substr(6)),this.$=x[I].substr(6);break;case 12:this.$=x[I].trim(),b.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=x[I].trim(),b.getCommonDb().setAccDescription(this.$);break;case 15:b.addSection(x[I].substr(8)),this.$=x[I].substr(8);break;case 18:b.addTask(x[I],0,""),this.$=x[I];break;case 19:b.addEvent(x[I].substr(2)),this.$=x[I];break}},"anonymous"),table:[{3:1,4:2,7:[1,3],8:[1,4],9:[1,5]},{1:[3]},o(s,[2,5],{5:6}),o(s,[2,2]),o(s,[2,3]),o(s,[2,4]),{6:[1,7],10:8,11:[1,9],12:10,13:[1,11],14:c,15:p,17:l,19:m,20:g,21:17,22:18,23:f,24:_},o(s,[2,10],{1:[2,1]}),o(s,[2,6]),{12:21,14:c,15:p,17:l,19:m,20:g,21:17,22:18,23:f,24:_},o(s,[2,8]),o(s,[2,9]),o(s,[2,11]),{16:[1,22]},{18:[1,23]},o(s,[2,14]),o(s,[2,15]),o(s,[2,16]),o(s,[2,17]),o(s,[2,18]),o(s,[2,19]),o(s,[2,7]),o(s,[2,12]),o(s,[2,13])],defaultActions:{},parseError:e(function(h,k){if(k.recoverable)this.trace(h);else{var y=Error(h);throw y.hash=k,y}},"parseError"),parse:e(function(h){var k=this,y=[0],b=[],S=[null],x=[],L=this.table,I="",B=0,K=0,U=0,Q=2,F=1,D=x.slice.call(arguments,1),C=Object.create(this.lexer),O={yy:{}};for(var Z in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,Z))O.yy[Z]=this.yy[Z];if(C.setInput(h,O.yy),O.yy.lexer=C,O.yy.parser=this,typeof C.yylloc>"u")C.yylloc={};var Y=C.yylloc;x.push(Y);var W=C.options&&C.options.ranges;if(typeof O.yy.parseError==="function")this.parseError=O.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function H(X){y.length=y.length-2*X,S.length=S.length-X,x.length=x.length-X}e(H,"popStack");function R(){var X=b.pop()||C.lex()||F;if(typeof X!=="number"){if(X instanceof Array)b=X,X=b.pop();X=k.symbols_[X]||X}return X}e(R,"lex");var M,V,z,P,lt,rt,J={},nt,j,kt,it;while(!0){if(z=y[y.length-1],this.defaultActions[z])P=this.defaultActions[z];else{if(M===null||typeof M>"u")M=R();P=L[z]&&L[z][M]}if(typeof P>"u"||!P.length||!P[0]){var ht="";it=[];for(nt in L[z])if(this.terminals_[nt]&&nt>Q)it.push("'"+this.terminals_[nt]+"'");if(C.showPosition)ht="Parse error on line "+(B+1)+`:
1
+ import{e,ot,t,N,i,a,u,Ie,Dn,d,r,n,A,he}from"./index-nwsya6dj.js";import"./index-v119nznk.js";import{De}from"./index-dyp2nhd3.js";var dt=function(){var o=e(function(T,h,k,y){for(k=k||{},y=T.length;y--;k[T[y]]=h);return k},"o"),s=[6,11,13,14,15,17,19,20,23,24],c=[1,12],p=[1,13],l=[1,14],m=[1,15],g=[1,16],f=[1,19],_=[1,20],v={trace:e(function(){},"trace"),yy:{},symbols_:{error:2,start:3,timeline_header:4,document:5,EOF:6,timeline:7,timeline_lr:8,timeline_td:9,line:10,SPACE:11,statement:12,NEWLINE:13,title:14,acc_title:15,acc_title_value:16,acc_descr:17,acc_descr_value:18,acc_descr_multiline_value:19,section:20,period_statement:21,event_statement:22,period:23,event:24,$accept:0,$end:1},terminals_:{2:"error",6:"EOF",7:"timeline",8:"timeline_lr",9:"timeline_td",11:"SPACE",13:"NEWLINE",14:"title",15:"acc_title",16:"acc_title_value",17:"acc_descr",18:"acc_descr_value",19:"acc_descr_multiline_value",20:"section",23:"period",24:"event"},productions_:[0,[3,3],[4,1],[4,1],[4,1],[5,0],[5,2],[10,2],[10,1],[10,1],[10,1],[12,1],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[21,1],[22,1]],performAction:e(function(h,k,y,b,S,x,L){var I=x.length-1;switch(S){case 1:return x[I-1];case 3:b.setDirection("LR");break;case 4:b.setDirection("TD");break;case 5:this.$=[];break;case 6:x[I-1].push(x[I]),this.$=x[I-1];break;case 7:case 8:this.$=x[I];break;case 9:case 10:this.$=[];break;case 11:b.getCommonDb().setDiagramTitle(x[I].substr(6)),this.$=x[I].substr(6);break;case 12:this.$=x[I].trim(),b.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=x[I].trim(),b.getCommonDb().setAccDescription(this.$);break;case 15:b.addSection(x[I].substr(8)),this.$=x[I].substr(8);break;case 18:b.addTask(x[I],0,""),this.$=x[I];break;case 19:b.addEvent(x[I].substr(2)),this.$=x[I];break}},"anonymous"),table:[{3:1,4:2,7:[1,3],8:[1,4],9:[1,5]},{1:[3]},o(s,[2,5],{5:6}),o(s,[2,2]),o(s,[2,3]),o(s,[2,4]),{6:[1,7],10:8,11:[1,9],12:10,13:[1,11],14:c,15:p,17:l,19:m,20:g,21:17,22:18,23:f,24:_},o(s,[2,10],{1:[2,1]}),o(s,[2,6]),{12:21,14:c,15:p,17:l,19:m,20:g,21:17,22:18,23:f,24:_},o(s,[2,8]),o(s,[2,9]),o(s,[2,11]),{16:[1,22]},{18:[1,23]},o(s,[2,14]),o(s,[2,15]),o(s,[2,16]),o(s,[2,17]),o(s,[2,18]),o(s,[2,19]),o(s,[2,7]),o(s,[2,12]),o(s,[2,13])],defaultActions:{},parseError:e(function(h,k){if(k.recoverable)this.trace(h);else{var y=Error(h);throw y.hash=k,y}},"parseError"),parse:e(function(h){var k=this,y=[0],b=[],S=[null],x=[],L=this.table,I="",B=0,K=0,U=0,Q=2,F=1,D=x.slice.call(arguments,1),C=Object.create(this.lexer),O={yy:{}};for(var Z in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,Z))O.yy[Z]=this.yy[Z];if(C.setInput(h,O.yy),O.yy.lexer=C,O.yy.parser=this,typeof C.yylloc>"u")C.yylloc={};var Y=C.yylloc;x.push(Y);var W=C.options&&C.options.ranges;if(typeof O.yy.parseError==="function")this.parseError=O.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function H(X){y.length=y.length-2*X,S.length=S.length-X,x.length=x.length-X}e(H,"popStack");function R(){var X=b.pop()||C.lex()||F;if(typeof X!=="number"){if(X instanceof Array)b=X,X=b.pop();X=k.symbols_[X]||X}return X}e(R,"lex");var M,V,z,P,lt,rt,J={},nt,j,kt,st;while(!0){if(z=y[y.length-1],this.defaultActions[z])P=this.defaultActions[z];else{if(M===null||typeof M>"u")M=R();P=L[z]&&L[z][M]}if(typeof P>"u"||!P.length||!P[0]){var ht="";st=[];for(nt in L[z])if(this.terminals_[nt]&&nt>Q)st.push("'"+this.terminals_[nt]+"'");if(C.showPosition)ht="Parse error on line "+(B+1)+`:
2
2
  `+C.showPosition()+`
3
- Expecting `+it.join(", ")+", got '"+(this.terminals_[M]||M)+"'";else ht="Parse error on line "+(B+1)+": Unexpected "+(M==F?"end of input":"'"+(this.terminals_[M]||M)+"'");this.parseError(ht,{text:C.match,token:this.terminals_[M]||M,line:C.yylineno,loc:Y,expected:it})}if(P[0]instanceof Array&&P.length>1)throw Error("Parse Error: multiple actions possible at state: "+z+", token: "+M);switch(P[0]){case 1:if(y.push(M),S.push(C.yytext),x.push(C.yylloc),y.push(P[1]),M=null,!V){if(K=C.yyleng,I=C.yytext,B=C.yylineno,Y=C.yylloc,U>0)U--}else M=V,V=null;break;case 2:if(j=this.productions_[P[1]][1],J.$=S[S.length-j],J._$={first_line:x[x.length-(j||1)].first_line,last_line:x[x.length-1].last_line,first_column:x[x.length-(j||1)].first_column,last_column:x[x.length-1].last_column},W)J._$.range=[x[x.length-(j||1)].range[0],x[x.length-1].range[1]];if(rt=this.performAction.apply(J,[I,K,B,O.yy,P[1],S,x].concat(D)),typeof rt<"u")return rt;if(j)y=y.slice(0,-1*j*2),S=S.slice(0,-1*j),x=x.slice(0,-1*j);y.push(this.productions_[P[1]][0]),S.push(J.$),x.push(J._$),kt=L[y[y.length-2]][y[y.length-1]],y.push(kt);break;case 3:return!0}}return!0},"parse")},E=function(){var T={EOF:1,parseError:e(function(k,y){if(this.yy.parser)this.yy.parser.parseError(k,y);else throw Error(k)},"parseError"),setInput:e(function(h,k){if(this.yy=k||this.yy||{},this._input=h,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges)this.yylloc.range=[0,0];return this.offset=0,this},"setInput"),input:e(function(){var h=this._input[0];this.yytext+=h,this.yyleng++,this.offset++,this.match+=h,this.matched+=h;var k=h.match(/(?:\r\n?|\n).*/g);if(k)this.yylineno++,this.yylloc.last_line++;else this.yylloc.last_column++;if(this.options.ranges)this.yylloc.range[1]++;return this._input=this._input.slice(1),h},"input"),unput:e(function(h){var k=h.length,y=h.split(/(?:\r\n?|\n)/g);this._input=h+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-k),this.offset-=k;var b=this.match.split(/(?:\r\n?|\n)/g);if(this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),y.length-1)this.yylineno-=y.length-1;var S=this.yylloc.range;if(this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:y?(y.length===b.length?this.yylloc.first_column:0)+b[b.length-y.length].length-y[0].length:this.yylloc.first_column-k},this.options.ranges)this.yylloc.range=[S[0],S[0]+this.yyleng-k];return this.yyleng=this.yytext.length,this},"unput"),more:e(function(){return this._more=!0,this},"more"),reject:e(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
3
+ Expecting `+st.join(", ")+", got '"+(this.terminals_[M]||M)+"'";else ht="Parse error on line "+(B+1)+": Unexpected "+(M==F?"end of input":"'"+(this.terminals_[M]||M)+"'");this.parseError(ht,{text:C.match,token:this.terminals_[M]||M,line:C.yylineno,loc:Y,expected:st})}if(P[0]instanceof Array&&P.length>1)throw Error("Parse Error: multiple actions possible at state: "+z+", token: "+M);switch(P[0]){case 1:if(y.push(M),S.push(C.yytext),x.push(C.yylloc),y.push(P[1]),M=null,!V){if(K=C.yyleng,I=C.yytext,B=C.yylineno,Y=C.yylloc,U>0)U--}else M=V,V=null;break;case 2:if(j=this.productions_[P[1]][1],J.$=S[S.length-j],J._$={first_line:x[x.length-(j||1)].first_line,last_line:x[x.length-1].last_line,first_column:x[x.length-(j||1)].first_column,last_column:x[x.length-1].last_column},W)J._$.range=[x[x.length-(j||1)].range[0],x[x.length-1].range[1]];if(rt=this.performAction.apply(J,[I,K,B,O.yy,P[1],S,x].concat(D)),typeof rt<"u")return rt;if(j)y=y.slice(0,-1*j*2),S=S.slice(0,-1*j),x=x.slice(0,-1*j);y.push(this.productions_[P[1]][0]),S.push(J.$),x.push(J._$),kt=L[y[y.length-2]][y[y.length-1]],y.push(kt);break;case 3:return!0}}return!0},"parse")},E=function(){var T={EOF:1,parseError:e(function(k,y){if(this.yy.parser)this.yy.parser.parseError(k,y);else throw Error(k)},"parseError"),setInput:e(function(h,k){if(this.yy=k||this.yy||{},this._input=h,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges)this.yylloc.range=[0,0];return this.offset=0,this},"setInput"),input:e(function(){var h=this._input[0];this.yytext+=h,this.yyleng++,this.offset++,this.match+=h,this.matched+=h;var k=h.match(/(?:\r\n?|\n).*/g);if(k)this.yylineno++,this.yylloc.last_line++;else this.yylloc.last_column++;if(this.options.ranges)this.yylloc.range[1]++;return this._input=this._input.slice(1),h},"input"),unput:e(function(h){var k=h.length,y=h.split(/(?:\r\n?|\n)/g);this._input=h+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-k),this.offset-=k;var b=this.match.split(/(?:\r\n?|\n)/g);if(this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),y.length-1)this.yylineno-=y.length-1;var S=this.yylloc.range;if(this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:y?(y.length===b.length?this.yylloc.first_column:0)+b[b.length-y.length].length-y[0].length:this.yylloc.first_column-k},this.options.ranges)this.yylloc.range=[S[0],S[0]+this.yyleng-k];return this.yyleng=this.yytext.length,this},"unput"),more:e(function(){return this._more=!0,this},"more"),reject:e(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:e(function(h){this.unput(this.match.slice(h))},"less"),pastInput:e(function(){var h=this.matched.substr(0,this.matched.length-this.match.length);return(h.length>20?"...":"")+h.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:e(function(){var h=this.match;if(h.length<20)h+=this._input.substr(0,20-h.length);return(h.substr(0,20)+(h.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:e(function(){var h=this.pastInput(),k=Array(h.length+1).join("-");return h+this.upcomingInput()+`
5
5
  `+k+"^"},"showPosition"),test_match:e(function(h,k){var y,b,S;if(this.options.backtrack_lexer){if(S={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges)S.yylloc.range=this.yylloc.range.slice(0)}if(b=h[0].match(/(?:\r\n?|\n).*/g),b)this.yylineno+=b.length;if(this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:b?b[b.length-1].length-b[b.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+h[0].length},this.yytext+=h[0],this.match+=h[0],this.matches=h,this.yyleng=this.yytext.length,this.options.ranges)this.yylloc.range=[this.offset,this.offset+=this.yyleng];if(this._more=!1,this._backtrack=!1,this._input=this._input.slice(h[0].length),this.matched+=h[0],y=this.performAction.call(this,this.yy,this,k,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input)this.done=!1;if(y)return y;else if(this._backtrack){for(var x in S)this[x]=S[x];return!1}return!1},"test_match"),next:e(function(){if(this.done)return this.EOF;if(!this._input)this.done=!0;var h,k,y,b;if(!this._more)this.yytext="",this.match="";var S=this._currentRules();for(var x=0;x<S.length;x++)if(y=this._input.match(this.rules[S[x]]),y&&(!k||y[0].length>k[0].length)){if(k=y,b=x,this.options.backtrack_lexer)if(h=this.test_match(y,S[x]),h!==!1)return h;else if(this._backtrack){k=!1;continue}else return!1;else if(!this.options.flex)break}if(k){if(h=this.test_match(k,S[b]),h!==!1)return h;return!1}if(this._input==="")return this.EOF;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
6
- `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:e(function(){var k=this.next();if(k)return k;else return this.lex()},"lex"),begin:e(function(k){this.conditionStack.push(k)},"begin"),popState:e(function(){var k=this.conditionStack.length-1;if(k>0)return this.conditionStack.pop();else return this.conditionStack[0]},"popState"),_currentRules:e(function(){if(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1])return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules;else return this.conditions.INITIAL.rules},"_currentRules"),topState:e(function(k){if(k=this.conditionStack.length-1-Math.abs(k||0),k>=0)return this.conditionStack[k];else return"INITIAL"},"topState"),pushState:e(function(k){this.begin(k)},"pushState"),stateStackSize:e(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:e(function(k,y,b,S){var x=S;switch(b){case 0:break;case 1:break;case 2:return 13;case 3:break;case 4:break;case 5:return 8;case 6:return 9;case 7:return 7;case 8:return 14;case 9:return this.begin("acc_title"),15;break;case 10:return this.popState(),"acc_title_value";break;case 11:return this.begin("acc_descr"),17;break;case 12:return this.popState(),"acc_descr_value";break;case 13:this.begin("acc_descr_multiline");break;case 14:this.popState();break;case 15:return"acc_descr_multiline_value";case 16:return 20;case 17:return 24;case 18:return 23;case 19:return 6;case 20:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:timeline[ \t]+LR\b)/i,/^(?:timeline[ \t]+TD\b)/i,/^(?:timeline\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^:\n]+)/i,/^(?::\s(?:[^:\n]|:(?!\s))+)/i,/^(?:[^#:\n]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[14,15],inclusive:!1},acc_descr:{rules:[12],inclusive:!1},acc_title:{rules:[10],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,13,16,17,18,19,20],inclusive:!0}}};return T}();v.lexer=E;function w(){this.yy={}}return e(w,"Parser"),w.prototype=v,v.Parser=w,new w}();dt.parser=dt;var Ot=dt,St={};st(St,{addEvent:()=>Ct,addSection:()=>Ht,addTask:()=>At,addTaskOrg:()=>Rt,clear:()=>$t,default:()=>Gt,getCommonDb:()=>Tt,getDirection:()=>It,getSections:()=>Lt,getTasks:()=>Mt,setDirection:()=>Nt});var tt="",Et=0,pt="LR",gt=[],at=[],et=[],Tt=e(()=>Dn,"getCommonDb"),$t=e(function(){gt.length=0,at.length=0,tt="",et.length=0,pt="LR",d()},"clear"),Nt=e(function(o){pt=o},"setDirection"),It=e(function(){return pt},"getDirection"),Ht=e(function(o){tt=o,gt.push(o)},"addSection"),Lt=e(function(){return gt},"getSections"),Mt=e(function(){let o=xt(),s=100,c=0;while(!o&&c<s)o=xt(),c++;return at.push(...et),at},"getTasks"),At=e(function(o,s,c){let p={id:Et++,section:tt,type:tt,task:o,score:s?s:0,events:c?[c]:[]};et.push(p)},"addTask"),Ct=e(function(o){et.find((c)=>c.id===Et-1).events.push(o)},"addEvent"),Rt=e(function(o){let s={section:tt,type:tt,description:o,task:o,classes:[]};at.push(s)},"addTaskOrg"),xt=e(function(){let o=e(function(c){return et[c].processed},"compileTask"),s=!0;for(let[c,p]of et.entries())o(c),s=s&&p.processed;return s},"compileTasks"),Gt={clear:$t,getCommonDb:Tt,getDirection:It,setDirection:Nt,addSection:Ht,getSections:Lt,getTasks:Mt,addTask:At,addTaskOrg:Rt,addEvent:Ct},Wt=0,ot=e(function(o,s){let c=o.append("rect");if(c.attr("x",s.x),c.attr("y",s.y),c.attr("fill",s.fill),c.attr("stroke",s.stroke),c.attr("width",s.width),c.attr("height",s.height),c.attr("rx",s.rx),c.attr("ry",s.ry),s.class!==void 0)c.attr("class",s.class);return c},"drawRect"),Dt=e(function(o,s){let p=o.append("circle").attr("cx",s.cx).attr("cy",s.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),l=o.append("g");l.append("circle").attr("cx",s.cx-5).attr("cy",s.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),l.append("circle").attr("cx",s.cx+5).attr("cy",s.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666");function m(_){let v=De().startAngle(Math.PI/2).endAngle(3*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);_.append("path").attr("class","mouth").attr("d",v).attr("transform","translate("+s.cx+","+(s.cy+2)+")")}e(m,"smile");function g(_){let v=De().startAngle(3*Math.PI/2).endAngle(5*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);_.append("path").attr("class","mouth").attr("d",v).attr("transform","translate("+s.cx+","+(s.cy+7)+")")}e(g,"sad");function f(_){_.append("line").attr("class","mouth").attr("stroke",2).attr("x1",s.cx-5).attr("y1",s.cy+7).attr("x2",s.cx+5).attr("y2",s.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}if(e(f,"ambivalent"),s.score>3)m(l);else if(s.score<3)g(l);else f(l);return p},"drawFace"),Kt=e(function(o,s){let c=o.append("circle");if(c.attr("cx",s.cx),c.attr("cy",s.cy),c.attr("class","actor-"+s.pos),c.attr("fill",s.fill),c.attr("stroke",s.stroke),c.attr("r",s.r),c.class!==void 0)c.attr("class",c.class);if(s.title!==void 0)c.append("title").text(s.title);return c},"drawCircle"),Pt=e(function(o,s){let c=s.text.replace(/<br\s*\/?>/gi," "),p=o.append("text");if(p.attr("x",s.x),p.attr("y",s.y),p.attr("class","legend"),p.style("text-anchor",s.anchor),s.class!==void 0)p.attr("class",s.class);let l=p.append("tspan");return l.attr("x",s.x+s.textMargin*2),l.text(c),p},"drawText"),Ut=e(function(o,s){function c(l,m,g,f,_){return l+","+m+" "+(l+g)+","+m+" "+(l+g)+","+(m+f-_)+" "+(l+g-_*1.2)+","+(m+f)+" "+l+","+(m+f)}e(c,"genPoints");let p=o.append("polygon");p.attr("points",c(s.x,s.y,50,20,7)),p.attr("class","labelBox"),s.y=s.y+s.labelMargin,s.x=s.x+0.5*s.labelMargin,Pt(o,s)},"drawLabel"),Xt=e(function(o,s,c){let p=o.append("g"),l=ft();l.x=s.x,l.y=s.y,l.fill=s.fill,l.width=c.width,l.height=c.height,l.class="journey-section section-type-"+s.num,l.rx=3,l.ry=3,ot(p,l),Bt(c)(s.text,p,l.x,l.y,l.width,l.height,{class:"journey-section section-type-"+s.num},c,s.colour)},"drawSection"),ut=-1,Zt=e(function(o,s,c,p){let l=s.x+c.width/2,m=o.append("g");ut++;let g=450;m.append("line").attr("id",p+"-task"+ut).attr("x1",l).attr("y1",s.y).attr("x2",l).attr("y2",g).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),Dt(m,{cx:l,cy:300+(5-s.score)*30,score:s.score});let f=ft();f.x=s.x,f.y=s.y,f.fill=s.fill,f.width=c.width,f.height=c.height,f.class="task task-type-"+s.num,f.rx=3,f.ry=3,ot(m,f),Bt(c)(s.task,m,f.x,f.y,f.width,f.height,{class:"task"},c,s.colour)},"drawTask"),jt=e(function(o,s){ot(o,{x:s.startx,y:s.starty,width:s.stopx-s.startx,height:s.stopy-s.starty,fill:s.fill,class:"rect"}).lower()},"drawBackgroundRect"),qt=e(function(){return{x:0,y:0,fill:void 0,"text-anchor":"start",width:100,height:100,textMargin:0,rx:0,ry:0}},"getTextObj"),ft=e(function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),Bt=function(){function o(l,m,g,f,_,v,E,w){let T=m.append("text").attr("x",g+_/2).attr("y",f+v/2+5).style("font-color",w).style("text-anchor","middle").text(l);p(T,E)}e(o,"byText");function s(l,m,g,f,_,v,E,w,T){let{taskFontSize:h,taskFontFamily:k}=w,y=l.split(/<br\s*\/?>/gi);for(let b=0;b<y.length;b++){let S=b*h-h*(y.length-1)/2,x=m.append("text").attr("x",g+_/2).attr("y",f).attr("fill",T).style("text-anchor","middle").style("font-size",h).style("font-family",k);x.append("tspan").attr("x",g+_/2).attr("dy",S).text(y[b]),x.attr("y",f+v/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),p(x,E)}}e(s,"byTspan");function c(l,m,g,f,_,v,E,w){let T=m.append("switch"),k=T.append("foreignObject").attr("x",g).attr("y",f).attr("width",_).attr("height",v).attr("position","fixed").append("xhtml:div").style("display","table").style("height","100%").style("width","100%");k.append("div").attr("class","label").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(l),s(l,T,g,f,_,v,E,w),p(k,E)}e(c,"byFo");function p(l,m){for(let g in m)if(g in m)l.attr(g,m[g])}return e(p,"_setTextAttrs"),function(l){return l.textPlacement==="fo"?c:l.textPlacement==="old"?o:s}}(),Jt=e(function(o,s){Wt=0,ut=-1,o.append("defs").append("marker").attr("id",s+"-arrowhead").attr("refX",5).attr("refY",2).attr("markerWidth",6).attr("markerHeight",4).attr("orient","auto").append("path").attr("d","M 0,0 V 4 L6,2 Z")},"initGraphics");function yt(o,s){o.each(function(){var c=n(this),p=c.text().split(/(\s+|<br>)/).reverse(),l,m=[],g=1.1,f=c.attr("y"),_=parseFloat(c.attr("dy")),v=c.text(null).append("tspan").attr("x",0).attr("y",f).attr("dy",_+"em");for(let E=0;E<p.length;E++)if(l=p[p.length-1-E],m.push(l),v.text(m.join(" ").trim()),v.node().getComputedTextLength()>s||l==="<br>"){if(m.pop(),v.text(m.join(" ").trim()),l==="<br>")m=[""];else m=[l];v=c.append("tspan").attr("x",0).attr("y",f).attr("dy",g+"em").text(l)}})}e(yt,"wrap");var Qt=e(function(o,s,c,p,l,m=!1){let{theme:g,look:f}=p,_=g?.includes("redux"),v=p?.themeVariables?.THEME_COLOR_LIMIT??12,E=c%v-1,w=o.append("g");s.section=E,w.attr("class",(s.class?s.class+" ":"")+"timeline-node "+("section-"+E));let T=w.append("g"),h=w.append("g"),y=h.append("text").text(s.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(yt,s.width).node().getBBox(),b=p.fontSize?.replace?p.fontSize.replace("px",""):p.fontSize;if(s.height=y.height+b*1.1*0.5+s.padding,s.height=Math.max(s.height,s.maxHeight),s.width=s.width+2*s.padding,h.attr("transform","translate("+s.width/2+", "+s.padding/2+")"),_)h.attr("transform",`translate(${s.width/2}, ${m?s.padding/2+3:s.padding})`);if(te(T,s,E,l,p),f==="neo"){if(w.attr("data-look","neo"),_){let S=g.includes("dark"),x=o.node()?.ownerSVGElement??o.node(),L=n(x),I=L.attr("id")??"",B=I?`${I}-drop-shadow`:"drop-shadow";if(L.select(`#${B}`).empty()){let K=L.select("defs");(K.empty()?L.append("defs"):K).append("filter").attr("id",B).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity",S?"0.2":"0.06").attr("flood-color",S?"#FFFFFF":"#000000")}}}return s},"drawNode"),Yt=e(function(o,s,c){let p=o.append("g"),m=p.append("text").text(s.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(yt,s.width).node().getBBox(),g=c.fontSize?.replace?c.fontSize.replace("px",""):c.fontSize;return p.remove(),m.height+g*1.1*0.5+s.padding},"getVirtualNodeHeight"),te=e(function(o,s,c,p,l){let{theme:m}=l,g=m?.includes("redux")?0:5,f=5,_=g>0?`M0 ${s.height-5} v${-s.height+10} q0,-${g},${g},-${g} h${s.width-10} q${g},0,${g},${g} v${s.height-5} H0 Z`:`M0 ${s.height-5} v${-(s.height-5)} h${s.width} v${s.height} H0 Z`;if(o.append("path").attr("id",p+"-node-"+Wt++).attr("class","node-bkg node-"+s.type).attr("d",_),!m?.includes("redux"))o.append("line").attr("class","node-line-"+c).attr("x1",0).attr("y1",s.height).attr("x2",s.width).attr("y2",s.height)},"defaultBkg"),G={drawRect:ot,drawCircle:Kt,drawSection:Xt,drawText:Pt,drawLabel:Ut,drawTask:Zt,drawBackgroundRect:jt,getTextObj:qt,getNoteRect:ft,initGraphics:Jt,drawNode:Qt,getVirtualNodeHeight:Yt},ee=e(function(o,s,c,p){let l=r(),{look:m,theme:g,themeVariables:f}=l,{useGradient:_,gradientStart:v,gradientStop:E}=f,w=l.timeline?.leftMargin??50;t.debug("timeline",p.db);let T=l.securityLevel,h;if(T==="sandbox")h=n("#i"+s);let y=(T==="sandbox"?n(h.nodes()[0].contentDocument.body):n("body")).select("#"+s);y.append("g");let b=p.db.getTasks(),S=p.db.getCommonDb().getDiagramTitle();t.debug("task",b),G.initGraphics(y,s);let x=p.db.getSections();t.debug("sections",x);let L=0,I=0,B=0,K=0,U=50+w,Q=50;K=50;let F=0,D=!0;x.forEach(function(W){let H={number:F,descr:W,section:F,width:150,padding:20,maxHeight:L},R=G.getVirtualNodeHeight(y,H,l);t.debug("sectionHeight before draw",R),L=Math.max(L,R+20)});let C=0,O=0;t.debug("tasks.length",b.length);for(let[W,H]of b.entries()){let R={number:W,descr:H,section:H.section,width:150,padding:20,maxHeight:I},M=G.getVirtualNodeHeight(y,R,l);t.debug("taskHeight before draw",M),I=Math.max(I,M+20),C=Math.max(C,H.events.length);let V=0;for(let z of H.events){let P={descr:z,section:H.section,number:H.section,width:150,padding:20,maxHeight:50};V+=G.getVirtualNodeHeight(y,P,l)}if(H.events.length>0)V+=(H.events.length-1)*10;O=Math.max(O,V)}if(t.debug("maxSectionHeight before draw",L),t.debug("maxTaskHeight before draw",I),x&&x.length>0)x.forEach((W)=>{let H=b.filter((z)=>z.section===W),R={number:F,descr:W,section:F,width:200*Math.max(H.length,1)-50,padding:20,maxHeight:L};t.debug("sectionNode",R);let M=y.append("g"),V=G.drawNode(M,R,F,l,s);if(t.debug("sectionNode output",V),M.attr("transform",`translate(${U}, ${K})`),Q+=L+50,H.length>0)bt(y,H,F,U,Q,I,l,C,O,L,!1,s);U+=200*Math.max(H.length,1),Q=K,F++});else D=!1,bt(y,b,F,U,Q,I,l,C,O,L,!0,s);let Z=y.node().getBBox();if(t.debug("bounds",Z),S)y.append("text").text(S).attr("x",m==="neo"?Z.x*2+w:Z.width/2-w).attr("font-size","4ex").attr("font-weight","bold").attr("y",20);if(B=D?L+I+150:I+100,y.append("g").attr("class","lineWrapper").append("line").attr("x1",w).attr("y1",B).attr("x2",Z.width+3*w).attr("y2",B).attr("stroke-width",4).attr("stroke","black").attr("marker-end",`url(#${s}-arrowhead)`),m==="neo"&&_&&g!=="neutral"){let W=y.select("defs"),R=(W.empty()?y.append("defs"):W).append("linearGradient").attr("id",y.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");R.append("stop").attr("offset","0%").attr("stop-color",v).attr("stop-opacity",1),R.append("stop").attr("offset","100%").attr("stop-color",E).attr("stop-opacity",1)}Ie(void 0,y,l.timeline?.padding??50,l.timeline?.useMaxWidth??!1)},"draw"),bt=e(function(o,s,c,p,l,m,g,f,_,v,E,w){for(let T of s){let h={descr:T.task,section:c,number:c,width:150,padding:20,maxHeight:m};t.debug("taskNode",h);let k=o.append("g").attr("class","taskWrapper"),b=G.drawNode(k,h,c,g,w).height;if(t.debug("taskHeight after draw",b),k.attr("transform",`translate(${p}, ${l})`),m=Math.max(m,b),T.events){let S=o.append("g").attr("class","lineWrapper"),x=m;l+=100,x=x+re(o,T.events,c,p,l,g,w),l-=100,S.append("line").attr("x1",p+95).attr("y1",l+m).attr("x2",p+95).attr("y2",l+m+100+_+100).attr("stroke-width",2).attr("stroke","black").attr("marker-end",`url(#${w}-arrowhead)`).attr("stroke-dasharray","5,5")}if(p=p+200,E&&!g.timeline?.disableMulticolor)c++}l=l-10},"drawTasks"),re=e(function(o,s,c,p,l,m,g){let f=0,_=l;l=l+100;for(let v of s){let E={descr:v,section:c,number:c,width:150,padding:20,maxHeight:50};t.debug("eventNode",E);let w=o.append("g").attr("class","eventWrapper"),h=G.drawNode(w,E,c,m,g,!0).height;f=f+h,w.attr("transform",`translate(${p}, ${l})`),l=l+10+h}return l=_,f},"drawEvents"),ne={setConf:e(()=>{},"setConf"),draw:ee},ct=200,q=5,se=ct+q*2,mt=ct+100,ie=mt+q*2,Vt=10,ae=0,vt=20,Ft=20,_t=30,zt=50,oe=e(function(o,s,c,p){let l=r(),m=l.timeline?.leftMargin??50;t.debug("timeline",p.db);let g=A(s);g.append("g");let f=p.db.getTasks(),_=p.db.getCommonDb().getDiagramTitle();t.debug("task",f),G.initGraphics(g);let v=p.db.getSections();t.debug("sections",v);let E=0,w=0,T=50+m,h=50,k=h,y=T,b=se+Ft,S=ie+zt,x=y+b,L=0,I=v&&v.length>0,B=I?x:T+b,K=Math.max(50,b+S-q*2);v.forEach(function(W){let H={number:L,descr:W,section:L,width:K,padding:q,maxHeight:E},R=G.getVirtualNodeHeight(g,H,l);t.debug("sectionHeight before draw",R),E=Math.max(E,R)});let U=0;t.debug("tasks.length",f.length);for(let[W,H]of f.entries()){let R={number:W,descr:H,section:H.section,width:ct,padding:q,maxHeight:w},M=G.getVirtualNodeHeight(g,R,l);t.debug("taskHeight before draw",M),w=Math.max(w,M);let V=0;for(let z of H.events){let P={descr:z,section:H.section,number:H.section,width:mt,padding:q,maxHeight:50};V+=G.getVirtualNodeHeight(g,P,l)}if(H.events.length>0)V+=(H.events.length-1)*Vt;U=Math.max(U,V)+ae}t.debug("maxSectionHeight before draw",E),t.debug("maxTaskHeight before draw",w);let F=Math.max(w,U)+_t;if(I)v.forEach((W)=>{let H=f.filter((J)=>J.section===W),R={number:L,descr:W,section:L,width:K,padding:q,maxHeight:E};t.debug("sectionNode",R);let M=g.append("g"),V=G.drawNode(M,R,L,l);t.debug("sectionNode output",V);let z=B-b;M.attr("transform",`translate(${z}, ${h})`);let P=h+V.height+vt;if(H.length>0)wt(g,H,L,B,P,w,l,F,!1);let lt=H.length,rt=V.height+vt+F*Math.max(lt,1)-(lt>0?_t*2:0);h+=rt,L++});else wt(g,f,L,B,h,w,l,F,!0);let D=g.node()?.getBBox();if(!D)throw Error("bbox not found");if(t.debug("bounds",D),_){if(g.append("text").text(_).attr("x",D.width/2-m).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),D=g.node()?.getBBox(),!D)throw Error("bbox not found");t.debug("bounds after title",D)}let[C]=he(l.fontSize),O=(C??16)*2,Z=(C??16)*0.5+20,Y=g.append("g").attr("class","lineWrapper");Y.append("line").attr("x1",B).attr("y1",k-O).attr("x2",B).attr("y2",D.y+D.height+Z).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)"),Y.lower(),Ie(void 0,g,l.timeline?.padding??50,l.timeline?.useMaxWidth??!1)},"draw"),wt=e(function(o,s,c,p,l,m,g,f,_){for(let v of s){let E={descr:v.task,section:c,number:c,width:ct,padding:q,maxHeight:m};t.debug("taskNode",E);let w=o.append("g").attr("class","taskWrapper"),T=G.drawNode(w,E,c,g),h=T.height;t.debug("taskHeight after draw",h);let k=p-Ft-T.width;if(w.attr("transform",`translate(${k}, ${l})`),m=Math.max(m,h),v.events&&v.events.length>0){let y=l,b=p+zt;ce(o,v.events,c,p,b,y,g)}if(l=l+f,_&&!g.timeline?.disableMulticolor)c++}},"drawTasks"),ce=e(function(o,s,c,p,l,m,g){let f=m;for(let _ of s){let v={descr:_,section:c,number:c,width:mt,padding:q,maxHeight:0};t.debug("eventNode",v);let E=o.append("g").attr("class","eventWrapper"),T=G.drawNode(E,v,c,g).height;E.attr("transform",`translate(${l}, ${f})`);let h=o.append("g").attr("class","lineWrapper"),k=f+T/2;h.append("line").attr("x1",p).attr("y1",k).attr("x2",l).attr("y2",k).attr("stroke-width",2).attr("stroke","black").attr("marker-end","url(#arrowhead)").attr("stroke-dasharray","5,5"),f=f+T+Vt}return f-m},"drawEvents"),le={setConf:e(()=>{},"setConf"),draw:oe},de=e((o)=>{let{theme:s}=u(),c=s?.includes("dark"),p=s?.includes("color"),l=o.svgId?.replace(/^#/,"")??"",m=l?`url(#${l}-drop-shadow)`:o.dropShadow??"none",g="";for(let f=0;f<o.THEME_COLOR_LIMIT;f++){let _=`${17-3*f}`,v=p?o.borderColorArray[f]:o.mainBkg,E=p?o.borderColorArray[f]:o.nodeBorder;g+=`
6
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:e(function(){var k=this.next();if(k)return k;else return this.lex()},"lex"),begin:e(function(k){this.conditionStack.push(k)},"begin"),popState:e(function(){var k=this.conditionStack.length-1;if(k>0)return this.conditionStack.pop();else return this.conditionStack[0]},"popState"),_currentRules:e(function(){if(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1])return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules;else return this.conditions.INITIAL.rules},"_currentRules"),topState:e(function(k){if(k=this.conditionStack.length-1-Math.abs(k||0),k>=0)return this.conditionStack[k];else return"INITIAL"},"topState"),pushState:e(function(k){this.begin(k)},"pushState"),stateStackSize:e(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:e(function(k,y,b,S){var x=S;switch(b){case 0:break;case 1:break;case 2:return 13;case 3:break;case 4:break;case 5:return 8;case 6:return 9;case 7:return 7;case 8:return 14;case 9:return this.begin("acc_title"),15;break;case 10:return this.popState(),"acc_title_value";break;case 11:return this.begin("acc_descr"),17;break;case 12:return this.popState(),"acc_descr_value";break;case 13:this.begin("acc_descr_multiline");break;case 14:this.popState();break;case 15:return"acc_descr_multiline_value";case 16:return 20;case 17:return 24;case 18:return 23;case 19:return 6;case 20:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:timeline[ \t]+LR\b)/i,/^(?:timeline[ \t]+TD\b)/i,/^(?:timeline\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^:\n]+)/i,/^(?::\s(?:[^:\n]|:(?!\s))+)/i,/^(?:[^#:\n]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[14,15],inclusive:!1},acc_descr:{rules:[12],inclusive:!1},acc_title:{rules:[10],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,13,16,17,18,19,20],inclusive:!0}}};return T}();v.lexer=E;function w(){this.yy={}}return e(w,"Parser"),w.prototype=v,v.Parser=w,new w}();dt.parser=dt;var Ot=dt,St={};ot(St,{addEvent:()=>Ct,addSection:()=>Ht,addTask:()=>At,addTaskOrg:()=>Rt,clear:()=>$t,default:()=>Gt,getCommonDb:()=>Tt,getDirection:()=>It,getSections:()=>Lt,getTasks:()=>Mt,setDirection:()=>Nt});var tt="",Et=0,pt="LR",gt=[],it=[],et=[],Tt=e(()=>Dn,"getCommonDb"),$t=e(function(){gt.length=0,it.length=0,tt="",et.length=0,pt="LR",d()},"clear"),Nt=e(function(o){pt=o},"setDirection"),It=e(function(){return pt},"getDirection"),Ht=e(function(o){tt=o,gt.push(o)},"addSection"),Lt=e(function(){return gt},"getSections"),Mt=e(function(){let o=xt(),s=100,c=0;while(!o&&c<s)o=xt(),c++;return it.push(...et),it},"getTasks"),At=e(function(o,s,c){let p={id:Et++,section:tt,type:tt,task:o,score:s?s:0,events:c?[c]:[]};et.push(p)},"addTask"),Ct=e(function(o){et.find((c)=>c.id===Et-1).events.push(o)},"addEvent"),Rt=e(function(o){let s={section:tt,type:tt,description:o,task:o,classes:[]};it.push(s)},"addTaskOrg"),xt=e(function(){let o=e(function(c){return et[c].processed},"compileTask"),s=!0;for(let[c,p]of et.entries())o(c),s=s&&p.processed;return s},"compileTasks"),Gt={clear:$t,getCommonDb:Tt,getDirection:It,setDirection:Nt,addSection:Ht,getSections:Lt,getTasks:Mt,addTask:At,addTaskOrg:Rt,addEvent:Ct},Wt=0,at=e(function(o,s){let c=o.append("rect");if(c.attr("x",s.x),c.attr("y",s.y),c.attr("fill",s.fill),c.attr("stroke",s.stroke),c.attr("width",s.width),c.attr("height",s.height),c.attr("rx",s.rx),c.attr("ry",s.ry),s.class!==void 0)c.attr("class",s.class);return c},"drawRect"),Dt=e(function(o,s){let p=o.append("circle").attr("cx",s.cx).attr("cy",s.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),l=o.append("g");l.append("circle").attr("cx",s.cx-5).attr("cy",s.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),l.append("circle").attr("cx",s.cx+5).attr("cy",s.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666");function m(_){let v=De().startAngle(Math.PI/2).endAngle(3*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);_.append("path").attr("class","mouth").attr("d",v).attr("transform","translate("+s.cx+","+(s.cy+2)+")")}e(m,"smile");function g(_){let v=De().startAngle(3*Math.PI/2).endAngle(5*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);_.append("path").attr("class","mouth").attr("d",v).attr("transform","translate("+s.cx+","+(s.cy+7)+")")}e(g,"sad");function f(_){_.append("line").attr("class","mouth").attr("stroke",2).attr("x1",s.cx-5).attr("y1",s.cy+7).attr("x2",s.cx+5).attr("y2",s.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}if(e(f,"ambivalent"),s.score>3)m(l);else if(s.score<3)g(l);else f(l);return p},"drawFace"),Kt=e(function(o,s){let c=o.append("circle");if(c.attr("cx",s.cx),c.attr("cy",s.cy),c.attr("class","actor-"+s.pos),c.attr("fill",s.fill),c.attr("stroke",s.stroke),c.attr("r",s.r),c.class!==void 0)c.attr("class",c.class);if(s.title!==void 0)c.append("title").text(s.title);return c},"drawCircle"),Pt=e(function(o,s){let c=s.text.replace(/<br\s*\/?>/gi," "),p=o.append("text");if(p.attr("x",s.x),p.attr("y",s.y),p.attr("class","legend"),p.style("text-anchor",s.anchor),s.class!==void 0)p.attr("class",s.class);let l=p.append("tspan");return l.attr("x",s.x+s.textMargin*2),l.text(c),p},"drawText"),Ut=e(function(o,s){function c(l,m,g,f,_){return l+","+m+" "+(l+g)+","+m+" "+(l+g)+","+(m+f-_)+" "+(l+g-_*1.2)+","+(m+f)+" "+l+","+(m+f)}e(c,"genPoints");let p=o.append("polygon");p.attr("points",c(s.x,s.y,50,20,7)),p.attr("class","labelBox"),s.y=s.y+s.labelMargin,s.x=s.x+0.5*s.labelMargin,Pt(o,s)},"drawLabel"),Xt=e(function(o,s,c){let p=o.append("g"),l=ft();l.x=s.x,l.y=s.y,l.fill=s.fill,l.width=c.width,l.height=c.height,l.class="journey-section section-type-"+s.num,l.rx=3,l.ry=3,at(p,l),Bt(c)(s.text,p,l.x,l.y,l.width,l.height,{class:"journey-section section-type-"+s.num},c,s.colour)},"drawSection"),ut=-1,Zt=e(function(o,s,c,p){let l=s.x+c.width/2,m=o.append("g");ut++;let g=450;m.append("line").attr("id",p+"-task"+ut).attr("x1",l).attr("y1",s.y).attr("x2",l).attr("y2",g).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),Dt(m,{cx:l,cy:300+(5-s.score)*30,score:s.score});let f=ft();f.x=s.x,f.y=s.y,f.fill=s.fill,f.width=c.width,f.height=c.height,f.class="task task-type-"+s.num,f.rx=3,f.ry=3,at(m,f),Bt(c)(s.task,m,f.x,f.y,f.width,f.height,{class:"task"},c,s.colour)},"drawTask"),jt=e(function(o,s){at(o,{x:s.startx,y:s.starty,width:s.stopx-s.startx,height:s.stopy-s.starty,fill:s.fill,class:"rect"}).lower()},"drawBackgroundRect"),qt=e(function(){return{x:0,y:0,fill:void 0,"text-anchor":"start",width:100,height:100,textMargin:0,rx:0,ry:0}},"getTextObj"),ft=e(function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),Bt=function(){function o(l,m,g,f,_,v,E,w){let T=m.append("text").attr("x",g+_/2).attr("y",f+v/2+5).style("font-color",w).style("text-anchor","middle").text(l);p(T,E)}e(o,"byText");function s(l,m,g,f,_,v,E,w,T){let{taskFontSize:h,taskFontFamily:k}=w,y=l.split(/<br\s*\/?>/gi);for(let b=0;b<y.length;b++){let S=b*h-h*(y.length-1)/2,x=m.append("text").attr("x",g+_/2).attr("y",f).attr("fill",T).style("text-anchor","middle").style("font-size",h).style("font-family",k);x.append("tspan").attr("x",g+_/2).attr("dy",S).text(y[b]),x.attr("y",f+v/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),p(x,E)}}e(s,"byTspan");function c(l,m,g,f,_,v,E,w){let T=m.append("switch"),k=T.append("foreignObject").attr("x",g).attr("y",f).attr("width",_).attr("height",v).attr("position","fixed").append("xhtml:div").style("display","table").style("height","100%").style("width","100%");k.append("div").attr("class","label").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(l),s(l,T,g,f,_,v,E,w),p(k,E)}e(c,"byFo");function p(l,m){for(let g in m)if(g in m)l.attr(g,m[g])}return e(p,"_setTextAttrs"),function(l){return l.textPlacement==="fo"?c:l.textPlacement==="old"?o:s}}(),Jt=e(function(o,s){Wt=0,ut=-1,o.append("defs").append("marker").attr("id",s+"-arrowhead").attr("refX",5).attr("refY",2).attr("markerWidth",6).attr("markerHeight",4).attr("orient","auto").append("path").attr("d","M 0,0 V 4 L6,2 Z")},"initGraphics");function yt(o,s){o.each(function(){var c=n(this),p=c.text().split(/(\s+|<br>)/).reverse(),l,m=[],g=1.1,f=c.attr("y"),_=parseFloat(c.attr("dy")),v=c.text(null).append("tspan").attr("x",0).attr("y",f).attr("dy",_+"em");for(let E=0;E<p.length;E++)if(l=p[p.length-1-E],m.push(l),v.text(m.join(" ").trim()),v.node().getComputedTextLength()>s||l==="<br>"){if(m.pop(),v.text(m.join(" ").trim()),l==="<br>")m=[""];else m=[l];v=c.append("tspan").attr("x",0).attr("y",f).attr("dy",g+"em").text(l)}})}e(yt,"wrap");var Qt=e(function(o,s,c,p,l,m=!1){let{theme:g,look:f}=p,_=g?.includes("redux"),v=p?.themeVariables?.THEME_COLOR_LIMIT??12,E=c%v-1,w=o.append("g");s.section=E,w.attr("class",(s.class?s.class+" ":"")+"timeline-node "+("section-"+E));let T=w.append("g"),h=w.append("g"),y=h.append("text").text(s.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(yt,s.width).node().getBBox(),b=p.fontSize?.replace?p.fontSize.replace("px",""):p.fontSize;if(s.height=y.height+b*1.1*0.5+s.padding,s.height=Math.max(s.height,s.maxHeight),s.width=s.width+2*s.padding,h.attr("transform","translate("+s.width/2+", "+s.padding/2+")"),_)h.attr("transform",`translate(${s.width/2}, ${m?s.padding/2+3:s.padding})`);if(te(T,s,E,l,p),f==="neo"){if(w.attr("data-look","neo"),_){let S=g.includes("dark"),x=o.node()?.ownerSVGElement??o.node(),L=n(x),I=L.attr("id")??"",B=I?`${I}-drop-shadow`:"drop-shadow";if(L.select(`#${B}`).empty()){let K=L.select("defs");(K.empty()?L.append("defs"):K).append("filter").attr("id",B).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity",S?"0.2":"0.06").attr("flood-color",S?"#FFFFFF":"#000000")}}}return s},"drawNode"),Yt=e(function(o,s,c){let p=o.append("g"),m=p.append("text").text(s.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(yt,s.width).node().getBBox(),g=c.fontSize?.replace?c.fontSize.replace("px",""):c.fontSize;return p.remove(),m.height+g*1.1*0.5+s.padding},"getVirtualNodeHeight"),te=e(function(o,s,c,p,l){let{theme:m}=l,g=m?.includes("redux")?0:5,f=5,_=g>0?`M0 ${s.height-5} v${-s.height+10} q0,-${g},${g},-${g} h${s.width-10} q${g},0,${g},${g} v${s.height-5} H0 Z`:`M0 ${s.height-5} v${-(s.height-5)} h${s.width} v${s.height} H0 Z`;if(o.append("path").attr("id",p+"-node-"+Wt++).attr("class","node-bkg node-"+s.type).attr("d",_),!m?.includes("redux"))o.append("line").attr("class","node-line-"+c).attr("x1",0).attr("y1",s.height).attr("x2",s.width).attr("y2",s.height)},"defaultBkg"),G={drawRect:at,drawCircle:Kt,drawSection:Xt,drawText:Pt,drawLabel:Ut,drawTask:Zt,drawBackgroundRect:jt,getTextObj:qt,getNoteRect:ft,initGraphics:Jt,drawNode:Qt,getVirtualNodeHeight:Yt},ee=e(function(o,s,c,p){let l=r(),{look:m,theme:g,themeVariables:f}=l,{useGradient:_,gradientStart:v,gradientStop:E}=f,w=l.timeline?.leftMargin??50;t.debug("timeline",p.db);let T=l.securityLevel,h;if(T==="sandbox")h=n("#i"+s);let y=(T==="sandbox"?n(h.nodes()[0].contentDocument.body):n("body")).select("#"+s);y.append("g");let b=p.db.getTasks(),S=p.db.getCommonDb().getDiagramTitle();t.debug("task",b),G.initGraphics(y,s);let x=p.db.getSections();t.debug("sections",x);let L=0,I=0,B=0,K=0,U=50+w,Q=50;K=50;let F=0,D=!0;x.forEach(function(W){let H={number:F,descr:W,section:F,width:150,padding:20,maxHeight:L},R=G.getVirtualNodeHeight(y,H,l);t.debug("sectionHeight before draw",R),L=Math.max(L,R+20)});let C=0,O=0;t.debug("tasks.length",b.length);for(let[W,H]of b.entries()){let R={number:W,descr:H,section:H.section,width:150,padding:20,maxHeight:I},M=G.getVirtualNodeHeight(y,R,l);t.debug("taskHeight before draw",M),I=Math.max(I,M+20),C=Math.max(C,H.events.length);let V=0;for(let z of H.events){let P={descr:z,section:H.section,number:H.section,width:150,padding:20,maxHeight:50};V+=G.getVirtualNodeHeight(y,P,l)}if(H.events.length>0)V+=(H.events.length-1)*10;O=Math.max(O,V)}if(t.debug("maxSectionHeight before draw",L),t.debug("maxTaskHeight before draw",I),x&&x.length>0)x.forEach((W)=>{let H=b.filter((z)=>z.section===W),R={number:F,descr:W,section:F,width:200*Math.max(H.length,1)-50,padding:20,maxHeight:L};t.debug("sectionNode",R);let M=y.append("g"),V=G.drawNode(M,R,F,l,s);if(t.debug("sectionNode output",V),M.attr("transform",`translate(${U}, ${K})`),Q+=L+50,H.length>0)bt(y,H,F,U,Q,I,l,C,O,L,!1,s);U+=200*Math.max(H.length,1),Q=K,F++});else D=!1,bt(y,b,F,U,Q,I,l,C,O,L,!0,s);let Z=y.node().getBBox();if(t.debug("bounds",Z),S)y.append("text").text(S).attr("x",m==="neo"?Z.x*2+w:Z.width/2-w).attr("font-size","4ex").attr("font-weight","bold").attr("y",20);if(B=D?L+I+150:I+100,y.append("g").attr("class","lineWrapper").append("line").attr("x1",w).attr("y1",B).attr("x2",Z.width+3*w).attr("y2",B).attr("stroke-width",4).attr("stroke","black").attr("marker-end",`url(#${s}-arrowhead)`),m==="neo"&&_&&g!=="neutral"){let W=y.select("defs"),R=(W.empty()?y.append("defs"):W).append("linearGradient").attr("id",y.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");R.append("stop").attr("offset","0%").attr("stop-color",v).attr("stop-opacity",1),R.append("stop").attr("offset","100%").attr("stop-color",E).attr("stop-opacity",1)}Ie(void 0,y,l.timeline?.padding??50,l.timeline?.useMaxWidth??!1)},"draw"),bt=e(function(o,s,c,p,l,m,g,f,_,v,E,w){for(let T of s){let h={descr:T.task,section:c,number:c,width:150,padding:20,maxHeight:m};t.debug("taskNode",h);let k=o.append("g").attr("class","taskWrapper"),b=G.drawNode(k,h,c,g,w).height;if(t.debug("taskHeight after draw",b),k.attr("transform",`translate(${p}, ${l})`),m=Math.max(m,b),T.events){let S=o.append("g").attr("class","lineWrapper"),x=m;l+=100,x=x+re(o,T.events,c,p,l,g,w),l-=100,S.append("line").attr("x1",p+95).attr("y1",l+m).attr("x2",p+95).attr("y2",l+m+100+_+100).attr("stroke-width",2).attr("stroke","black").attr("marker-end",`url(#${w}-arrowhead)`).attr("stroke-dasharray","5,5")}if(p=p+200,E&&!g.timeline?.disableMulticolor)c++}l=l-10},"drawTasks"),re=e(function(o,s,c,p,l,m,g){let f=0,_=l;l=l+100;for(let v of s){let E={descr:v,section:c,number:c,width:150,padding:20,maxHeight:50};t.debug("eventNode",E);let w=o.append("g").attr("class","eventWrapper"),h=G.drawNode(w,E,c,m,g,!0).height;f=f+h,w.attr("transform",`translate(${p}, ${l})`),l=l+10+h}return l=_,f},"drawEvents"),ne={setConf:e(()=>{},"setConf"),draw:ee},ct=200,q=5,se=ct+q*2,mt=ct+100,ie=mt+q*2,Vt=10,ae=0,vt=20,Ft=20,_t=30,zt=50,oe=e(function(o,s,c,p){let l=r(),m=l.timeline?.leftMargin??50;t.debug("timeline",p.db);let g=A(s);g.append("g");let f=p.db.getTasks(),_=p.db.getCommonDb().getDiagramTitle();t.debug("task",f),G.initGraphics(g);let v=p.db.getSections();t.debug("sections",v);let E=0,w=0,T=50+m,h=50,k=h,y=T,b=se+Ft,S=ie+zt,x=y+b,L=0,I=v&&v.length>0,B=I?x:T+b,K=Math.max(50,b+S-q*2);v.forEach(function(W){let H={number:L,descr:W,section:L,width:K,padding:q,maxHeight:E},R=G.getVirtualNodeHeight(g,H,l);t.debug("sectionHeight before draw",R),E=Math.max(E,R)});let U=0;t.debug("tasks.length",f.length);for(let[W,H]of f.entries()){let R={number:W,descr:H,section:H.section,width:ct,padding:q,maxHeight:w},M=G.getVirtualNodeHeight(g,R,l);t.debug("taskHeight before draw",M),w=Math.max(w,M);let V=0;for(let z of H.events){let P={descr:z,section:H.section,number:H.section,width:mt,padding:q,maxHeight:50};V+=G.getVirtualNodeHeight(g,P,l)}if(H.events.length>0)V+=(H.events.length-1)*Vt;U=Math.max(U,V)+ae}t.debug("maxSectionHeight before draw",E),t.debug("maxTaskHeight before draw",w);let F=Math.max(w,U)+_t;if(I)v.forEach((W)=>{let H=f.filter((J)=>J.section===W),R={number:L,descr:W,section:L,width:K,padding:q,maxHeight:E};t.debug("sectionNode",R);let M=g.append("g"),V=G.drawNode(M,R,L,l);t.debug("sectionNode output",V);let z=B-b;M.attr("transform",`translate(${z}, ${h})`);let P=h+V.height+vt;if(H.length>0)wt(g,H,L,B,P,w,l,F,!1);let lt=H.length,rt=V.height+vt+F*Math.max(lt,1)-(lt>0?_t*2:0);h+=rt,L++});else wt(g,f,L,B,h,w,l,F,!0);let D=g.node()?.getBBox();if(!D)throw Error("bbox not found");if(t.debug("bounds",D),_){if(g.append("text").text(_).attr("x",D.width/2-m).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),D=g.node()?.getBBox(),!D)throw Error("bbox not found");t.debug("bounds after title",D)}let[C]=he(l.fontSize),O=(C??16)*2,Z=(C??16)*0.5+20,Y=g.append("g").attr("class","lineWrapper");Y.append("line").attr("x1",B).attr("y1",k-O).attr("x2",B).attr("y2",D.y+D.height+Z).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)"),Y.lower(),Ie(void 0,g,l.timeline?.padding??50,l.timeline?.useMaxWidth??!1)},"draw"),wt=e(function(o,s,c,p,l,m,g,f,_){for(let v of s){let E={descr:v.task,section:c,number:c,width:ct,padding:q,maxHeight:m};t.debug("taskNode",E);let w=o.append("g").attr("class","taskWrapper"),T=G.drawNode(w,E,c,g),h=T.height;t.debug("taskHeight after draw",h);let k=p-Ft-T.width;if(w.attr("transform",`translate(${k}, ${l})`),m=Math.max(m,h),v.events&&v.events.length>0){let y=l,b=p+zt;ce(o,v.events,c,p,b,y,g)}if(l=l+f,_&&!g.timeline?.disableMulticolor)c++}},"drawTasks"),ce=e(function(o,s,c,p,l,m,g){let f=m;for(let _ of s){let v={descr:_,section:c,number:c,width:mt,padding:q,maxHeight:0};t.debug("eventNode",v);let E=o.append("g").attr("class","eventWrapper"),T=G.drawNode(E,v,c,g).height;E.attr("transform",`translate(${l}, ${f})`);let h=o.append("g").attr("class","lineWrapper"),k=f+T/2;h.append("line").attr("x1",p).attr("y1",k).attr("x2",l).attr("y2",k).attr("stroke-width",2).attr("stroke","black").attr("marker-end","url(#arrowhead)").attr("stroke-dasharray","5,5"),f=f+T+Vt}return f-m},"drawEvents"),le={setConf:e(()=>{},"setConf"),draw:oe},de=e((o)=>{let{theme:s}=u(),c=s?.includes("dark"),p=s?.includes("color"),l=o.svgId?.replace(/^#/,"")??"",m=l?`url(#${l}-drop-shadow)`:o.dropShadow??"none",g="";for(let f=0;f<o.THEME_COLOR_LIMIT;f++){let _=`${17-3*f}`,v=p?o.borderColorArray[f]:o.mainBkg,E=p?o.borderColorArray[f]:o.nodeBorder;g+=`
7
7
  .section-${f-1} rect,
8
8
  .section-${f-1} path,
9
9
  .section-${f-1} circle {
@@ -0,0 +1 @@
1
+ import{li}from"./index-zx0j3a2z.js";export{li as createTreeViewServices};
@@ -0,0 +1 @@
1
+ import{ti}from"./index-zx0j3a2z.js";export{ti as createTreemapServices};
@@ -0,0 +1,34 @@
1
+ import{e,N,fr,i,a,x,u,T,d,f,p,m,g,b,v,n,A,E,s}from"./index-nwsya6dj.js";import"./index-v119nznk.js";var fe=(t,o)=>fr(t,"a",-o),wt=fe;function It(t,o){let l=de(t),r=l.filter((I)=>he(I,t)),c=0,h=0,y=[];if(r.length>1){let I=Kt(r);for(let S=0;S<r.length;++S){let k=r[S];k.angle=Math.atan2(k.x-I.x,k.y-I.y)}r.sort((S,k)=>k.angle-S.angle);let w=r[r.length-1];for(let S=0;S<r.length;++S){let k=r[S];h+=(w.x+k.x)*(k.y-w.y);let C={x:(k.x+w.x)/2,y:(k.y+w.y)/2},z=null;for(let j=0;j<k.parentIndex.length;++j)if(w.parentIndex.includes(k.parentIndex[j])){let O=t[k.parentIndex[j]],B=Math.atan2(k.x-O.x,k.y-O.y),W=Math.atan2(w.x-O.x,w.y-O.y),U=W-B;if(U<0)U+=2*Math.PI;let q=W-U/2,D=at(C,{x:O.x+O.radius*Math.sin(q),y:O.y+O.radius*Math.cos(q)});if(D>O.radius*2)D=O.radius*2;if(z==null||z.width>D)z={circle:O,width:D,p1:k,p2:w,large:D>O.radius,sweep:!0}}if(z!=null)y.push(z),c+=Tt(z.circle.radius,z.width),w=k}}else{let I=t[0];for(let S=1;S<t.length;++S)if(t[S].radius<I.radius)I=t[S];let w=!1;for(let S=0;S<t.length;++S)if(at(t[S],I)>Math.abs(I.radius-t[S].radius)){w=!0;break}if(w)c=h=0;else c=I.radius*I.radius*Math.PI,y.push({circle:I,p1:{x:I.x,y:I.y+I.radius},p2:{x:I.x-0.0000000001,y:I.y+I.radius},width:I.radius*2,large:!0,sweep:!0})}if(h/=2,o)o.area=c+h,o.arcArea=c,o.polygonArea=h,o.arcs=y,o.innerPoints=r,o.intersectionPoints=l;return c+h}function he(t,o){return o.every((l)=>at(t,l)<l.radius+0.0000000001)}function de(t){let o=[];for(let l=0;l<t.length;++l)for(let r=l+1;r<t.length;++r){let c=Wt(t[l],t[r]);for(let h of c)h.parentIndex=[l,r],o.push(h)}return o}function Tt(t,o){return t*t*Math.acos(1-o/t)-(t-o)*Math.sqrt(o*(2*t-o))}function at(t,o){return Math.sqrt((t.x-o.x)*(t.x-o.x)+(t.y-o.y)*(t.y-o.y))}function Nt(t,o,l){if(l>=t+o)return 0;if(l<=Math.abs(t-o))return Math.PI*Math.min(t,o)*Math.min(t,o);let r=t-(l*l-o*o+t*t)/(2*l),c=o-(l*l-t*t+o*o)/(2*l);return Tt(t,r)+Tt(o,c)}function Wt(t,o){let l=at(t,o),r=t.radius,c=o.radius;if(l>=r+c||l<=Math.abs(r-c))return[];let h=(r*r-c*c+l*l)/(2*l),y=Math.sqrt(r*r-h*h),I=t.x+h*(o.x-t.x)/l,w=t.y+h*(o.y-t.y)/l,S=-(o.y-t.y)*(y/l),k=-(o.x-t.x)*(y/l);return[{x:I+S,y:w-k},{x:I-S,y:w+k}]}function Kt(t){let o={x:0,y:0};for(let l of t)o.x+=l.x,o.y+=l.y;return o.x/=t.length,o.y/=t.length,o}function ge(t,o,l,r){r=r||{};let c=r.maxIterations||100,h=r.tolerance||0.0000000001,y=t(o),I=t(l),w=l-o;if(y*I>0)throw"Initial bisect points must have opposite signs";if(y===0)return o;if(I===0)return l;for(let S=0;S<c;++S){w/=2;let k=o+w,C=t(k);if(C*y>=0)o=k;if(Math.abs(w)<h||C===0)return k}return o+w}function zt(t){let o=Array(t);for(let l=0;l<t;++l)o[l]=0;return o}function Ut(t,o){return zt(t).map(()=>zt(o))}function pt(t,o){let l=0;for(let r=0;r<t.length;++r)l+=t[r]*o[r];return l}function At(t){return Math.sqrt(pt(t,t))}function Dt(t,o,l){for(let r=0;r<o.length;++r)t[r]=o[r]*l}function xt(t,o,l,r,c){for(let h=0;h<t.length;++h)t[h]=o*l[h]+r*c[h]}function Ht(t,o,l){l=l||{};let r=l.maxIterations||o.length*200,c=l.nonZeroDelta||1.05,h=l.zeroDelta||0.001,y=l.minErrorDelta||0.000001,I=l.minErrorDelta||0.00001,w=l.rho!==void 0?l.rho:1,S=l.chi!==void 0?l.chi:2,k=l.psi!==void 0?l.psi:-0.5,C=l.sigma!==void 0?l.sigma:0.5,z,j=o.length,O=Array(j+1);O[0]=o,O[0].fx=t(o),O[0].id=0;for(let F=0;F<j;++F){let M=o.slice();M[F]=M[F]?M[F]*c:h,O[F+1]=M,O[F+1].fx=t(M),O[F+1].id=F+1}function B(F){for(let M=0;M<F.length;M++)O[j][M]=F[M];O[j].fx=F.fx}let W=(F,M)=>F.fx-M.fx,U=o.slice(),q=o.slice(),D=o.slice(),L=o.slice();for(let F=0;F<r;++F){if(O.sort(W),l.history){let R=O.map((_)=>{let Y=_.slice();return Y.fx=_.fx,Y.id=_.id,Y});R.sort((_,Y)=>_.id-Y.id),l.history.push({x:O[0].slice(),fx:O[0].fx,simplex:R})}z=0;for(let R=0;R<j;++R)z=Math.max(z,Math.abs(O[0][R]-O[1][R]));if(Math.abs(O[0].fx-O[j].fx)<y&&z<I)break;for(let R=0;R<j;++R){U[R]=0;for(let _=0;_<j;++_)U[R]+=O[_][R];U[R]/=j}let M=O[j];if(xt(q,1+w,U,-w,M),q.fx=t(q),q.fx<O[0].fx)if(xt(L,1+S,U,-S,M),L.fx=t(L),L.fx<q.fx)B(L);else B(q);else if(q.fx>=O[j-1].fx){let R=!1;if(q.fx>M.fx)if(xt(D,1+k,U,-k,M),D.fx=t(D),D.fx<M.fx)B(D);else R=!0;else if(xt(D,1-k*w,U,k*w,M),D.fx=t(D),D.fx<q.fx)B(D);else R=!0;if(R){if(C>=1)break;for(let _=1;_<O.length;++_)xt(O[_],1-C,O[0],C,O[_]),O[_].fx=t(O[_])}}else B(q)}return O.sort(W),{fx:O[0].fx,x:O[0]}}function xe(t,o,l,r,c,h,y){let I=l.fx,w=pt(l.fxprime,o),S=I,k=I,C=w,z=0;c=c||1,h=h||0.000001,y=y||0.1;function j(O,B,W){for(let U=0;U<16;++U)if(c=(O+B)/2,xt(r.x,1,l.x,c,o),S=r.fx=t(r.x,r.fxprime),C=pt(r.fxprime,o),S>I+h*c*w||S>=W)B=c;else{if(Math.abs(C)<=-y*w)return c;if(C*(B-O)>=0)B=O;O=c,W=S}return 0}for(let O=0;O<10;++O){if(xt(r.x,1,l.x,c,o),S=r.fx=t(r.x,r.fxprime),C=pt(r.fxprime,o),S>I+h*c*w||O&&S>=k)return j(z,c,k);if(Math.abs(C)<=-y*w)return c;if(C>=0)return j(c,z,S);k=S,z=c,c*=2}return c}function ye(t,o,l){let r={x:o.slice(),fx:0,fxprime:o.slice()},c={x:o.slice(),fx:0,fxprime:o.slice()},h=o.slice(),y,I,w=1,S;l=l||{},S=l.maxIterations||o.length*20,r.fx=t(r.x,r.fxprime),y=r.fxprime.slice(),Dt(y,r.fxprime,-1);for(let k=0;k<S;++k){if(w=xe(t,y,r,c,w),l.history)l.history.push({x:r.x.slice(),fx:r.fx,fxprime:r.fxprime.slice(),alpha:w});if(!w)Dt(y,r.fxprime,-1);else{xt(h,1,c.fxprime,-1,r.fxprime);let C=pt(r.fxprime,r.fxprime),z=Math.max(0,pt(h,c.fxprime)/C);xt(y,z,y,-1,c.fxprime),I=r,r=c,c=I}if(At(r.fxprime)<=0.00001)break}if(l.history)l.history.push({x:r.x.slice(),fx:r.fx,fxprime:r.fxprime.slice(),alpha:w});return r}function Yt(t,o={}){o.maxIterations=o.maxIterations||500;let l=o.initialLayout||ve,r=o.lossFunction||mt,c=pe(t,o),h=l(c,o),y=Object.keys(h),I=[];for(let k of y)I.push(h[k].x),I.push(h[k].y);let S=Ht((k)=>{let C={};for(let z=0;z<y.length;++z){let j=y[z];C[j]={x:k[2*z],y:k[2*z+1],radius:h[j].radius}}return r(C,c)},I,o).x;for(let k=0;k<y.length;++k){let C=y[k];h[C].x=S[2*k],h[C].y=S[2*k+1]}return h}var Xt=0.0000000001;function Rt(t,o,l){if(Math.min(t,o)*Math.min(t,o)*Math.PI<=l+Xt)return Math.abs(t-o);return ge((r)=>Nt(t,o,r)-l,0,t+o)}function pe(t,o={}){let l=o.distinct,r=t.map((I)=>Object.assign({},I));function c(I){return I.join(";")}if(l){let I=new Map;for(let w of r)for(let S=0;S<w.sets.length;S++){let k=String(w.sets[S]);I.set(k,w.size+(I.get(k)||0));for(let C=S+1;C<w.sets.length;C++){let z=String(w.sets[C]),j=`${k};${z}`,O=`${z};${k}`;I.set(j,w.size+(I.get(j)||0)),I.set(O,w.size+(I.get(O)||0))}}for(let w of r)if(w.sets.length<3)w.size=I.get(c(w.sets))}let h=[],y=new Set;for(let I of r)if(I.sets.length===1)h.push(I.sets[0]);else if(I.sets.length===2){let w=I.sets[0],S=I.sets[1];y.add(c(I.sets)),y.add(c([S,w]))}h.sort((I,w)=>I===w?0:I<w?-1:1);for(let I=0;I<h.length;++I){let w=h[I];for(let S=I+1;S<h.length;++S){let k=h[S];if(!y.has(c([w,k])))r.push({sets:[w,k],size:0})}}return r}function me(t,o,l){let r=Ut(o.length,o.length),c=Ut(o.length,o.length);return t.filter((h)=>h.sets.length===2).forEach((h)=>{let y=l[h.sets[0]],I=l[h.sets[1]],w=Math.sqrt(o[y].size/Math.PI),S=Math.sqrt(o[I].size/Math.PI),k=Rt(w,S,h.size);r[y][I]=r[I][y]=k;let C=0;if(h.size+0.0000000001>=Math.min(o[y].size,o[I].size))C=1;else if(h.size<=0.0000000001)C=-1;c[y][I]=c[I][y]=C}),{distances:r,constraints:c}}function be(t,o,l,r){for(let h=0;h<o.length;++h)o[h]=0;let c=0;for(let h=0;h<l.length;++h){let y=t[2*h],I=t[2*h+1];for(let w=h+1;w<l.length;++w){let S=t[2*w],k=t[2*w+1],C=l[h][w],z=r[h][w],j=(S-y)*(S-y)+(k-I)*(k-I),O=Math.sqrt(j),B=j-C*C;if(z>0&&O<=C||z<0&&O>=C)continue;c+=2*B*B,o[2*h]+=4*B*(y-S),o[2*h+1]+=4*B*(I-k),o[2*w]+=4*B*(S-y),o[2*w+1]+=4*B*(k-I)}}return c}function ve(t,o={}){let l=Ie(t,o),r=o.lossFunction||mt;if(t.length>=8){let c=ke(t,o),h=r(c,t),y=r(l,t);if(h+0.00000001<y)l=c}return l}function ke(t,o={}){let l=o.restarts||10,r=[],c={};for(let z of t)if(z.sets.length===1)c[z.sets[0]]=r.length,r.push(z);let{distances:h,constraints:y}=me(t,r,c),I=At(h.map(At))/h.length;h=h.map((z)=>z.map((j)=>j/I));let w=(z,j)=>be(z,j,h,y),S=null;for(let z=0;z<l;++z){let j=zt(h.length*2).map(Math.random),O=ye(w,j,o);if(!S||O.fx<S.fx)S=O}let k=S.x,C={};for(let z=0;z<r.length;++z){let j=r[z];C[j.sets[0]]={x:k[2*z]*I,y:k[2*z+1]*I,radius:Math.sqrt(j.size/Math.PI)}}if(o.history)for(let z of o.history)Dt(z.x,I);return C}function Ie(t,o){let l=o&&o.lossFunction?o.lossFunction:mt,r={},c={};for(let C of t)if(C.sets.length===1){let z=C.sets[0];r[z]={x:10000000000,y:10000000000,rowid:r.length,size:C.size,radius:Math.sqrt(C.size/Math.PI)},c[z]=[]}t=t.filter((C)=>C.sets.length===2);for(let C of t){let z=C.weight!=null?C.weight:1,j=C.sets[0],O=C.sets[1];if(C.size+Xt>=Math.min(r[j].size,r[O].size))z=0;c[j].push({set:O,size:C.size,weight:z}),c[O].push({set:j,size:C.size,weight:z})}let h=[];Object.keys(c).forEach((C)=>{let z=0;for(let j=0;j<c[C].length;++j)z+=c[C][j].size*c[C][j].weight;h.push({set:C,size:z})});function y(C,z){return z.size-C.size}h.sort(y);let I={};function w(C){return C.set in I}function S(C,z){r[z].x=C.x,r[z].y=C.y,I[z]=!0}S({x:0,y:0},h[0].set);for(let C=1;C<h.length;++C){let z=h[C].set,j=c[z].filter(w),O=r[z];if(j.sort(y),j.length===0)throw"ERROR: missing pairwise overlap information";let B=[];for(var k=0;k<j.length;++k){let q=r[j[k].set],D=Rt(O.radius,q.radius,j[k].size);B.push({x:q.x+D,y:q.y}),B.push({x:q.x-D,y:q.y}),B.push({y:q.y+D,x:q.x}),B.push({y:q.y-D,x:q.x});for(let L=k+1;L<j.length;++L){let F=r[j[L].set],M=Rt(O.radius,F.radius,j[L].size),R=Wt({x:q.x,y:q.y,radius:D},{x:F.x,y:F.y,radius:M});B.push(...R)}}let W=100000000000000000000000000000000000000000000000000,U=B[0];for(let q of B){r[z].x=q.x,r[z].y=q.y;let D=l(r,t);if(D<W)W=D,U=q}S(U,z)}return r}function mt(t,o){let l=0;for(let r of o){if(r.sets.length===1)continue;let c;if(r.sets.length===2){let y=t[r.sets[0]],I=t[r.sets[1]];c=Nt(y.radius,I.radius,at(y,I))}else c=It(r.sets.map((y)=>t[y]));let h=r.weight!=null?r.weight:1;l+=h*(c-r.size)*(c-r.size)}return l}function Zt(t,o){let l=0;for(let r of o){if(r.sets.length===1)continue;let c;if(r.sets.length===2){let I=t[r.sets[0]],w=t[r.sets[1]];c=Nt(I.radius,w.radius,at(I,w))}else c=It(r.sets.map((I)=>t[I]));let h=r.weight!=null?r.weight:1,y=Math.log((c+1)/(r.size+1));l+=h*y*y}return l}function Me(t,o,l){if(l==null)t.sort((c,h)=>h.radius-c.radius);else t.sort(l);if(t.length>0){let c=t[0].x,h=t[0].y;for(let y of t)y.x-=c,y.y-=h}if(t.length===2){if(at(t[0],t[1])<Math.abs(t[1].radius-t[0].radius))t[1].x=t[0].x+t[0].radius-t[1].radius-0.0000000001,t[1].y=t[0].y}if(t.length>1){let c=Math.atan2(t[1].x,t[1].y)-o,h=Math.cos(c),y=Math.sin(c);for(let I of t){let{x:w,y:S}=I;I.x=h*w-y*S,I.y=y*w+h*S}}if(t.length>2){let c=Math.atan2(t[2].x,t[2].y)-o;while(c<0)c+=2*Math.PI;while(c>2*Math.PI)c-=2*Math.PI;if(c>Math.PI){let h=t[1].y/(0.0000000001+t[1].x);for(let y of t){var r=(y.x+h*y.y)/(1+h*h);y.x=2*r-y.x,y.y=2*r*h-y.y}}}}function Se(t){t.forEach((c)=>{c.parent=c});function o(c){if(c.parent!==c)c.parent=o(c.parent);return c.parent}function l(c,h){let y=o(c),I=o(h);y.parent=I}for(let c=0;c<t.length;++c)for(let h=c+1;h<t.length;++h){let y=t[c].radius+t[h].radius;if(at(t[c],t[h])+0.0000000001<y)l(t[h],t[c])}let r=new Map;for(let c=0;c<t.length;++c){let h=o(t[c]).parent.setid;if(!r.has(h))r.set(h,[]);r.get(h).push(t[c])}return t.forEach((c)=>{delete c.parent}),Array.from(r.values())}function Ct(t){let o=(l)=>{let r=t.reduce((h,y)=>Math.max(h,y[l]+y.radius),Number.NEGATIVE_INFINITY),c=t.reduce((h,y)=>Math.min(h,y[l]-y.radius),Number.POSITIVE_INFINITY);return{max:r,min:c}};return{xRange:o("x"),yRange:o("y")}}function Jt(t,o,l){if(o==null)o=Math.PI/2;let r=te(t).map((S)=>Object.assign({},S)),c=Se(r);for(let S of c){Me(S,o,l);let k=Ct(S);S.size=(k.xRange.max-k.xRange.min)*(k.yRange.max-k.yRange.min),S.bounds=k}c.sort((S,k)=>k.size-S.size),r=c[0];let h=r.bounds,y=(h.xRange.max-h.xRange.min)/50;function I(S,k,C){if(!S)return;let z=S.bounds,j,O;if(k)j=h.xRange.max-z.xRange.min+y;else{j=h.xRange.max-z.xRange.max;let B=(z.xRange.max-z.xRange.min)/2-(h.xRange.max-h.xRange.min)/2;if(B<0)j+=B}if(C)O=h.yRange.max-z.yRange.min+y;else{O=h.yRange.max-z.yRange.max;let B=(z.yRange.max-z.yRange.min)/2-(h.yRange.max-h.yRange.min)/2;if(B<0)O+=B}for(let B of S)B.x+=j,B.y+=O,r.push(B)}let w=1;while(w<c.length)I(c[w],!0,!1),I(c[w+1],!1,!0),I(c[w+2],!0,!0),w+=3,h=Ct(r);return $t(r)}function Qt(t,o,l,r,c){let h=te(t);o-=2*r,l-=2*r;let{xRange:y,yRange:I}=Ct(h);if(y.max===y.min||I.max===I.min)return console.log("not scaling solution: zero size detected"),t;let w,S;if(c){let j=Math.sqrt(c/Math.PI)*2;w=o/j,S=l/j}else w=o/(y.max-y.min),S=l/(I.max-I.min);let k=Math.min(S,w),C=(o-(y.max-y.min)*k)/2,z=(l-(I.max-I.min)*k)/2;return $t(h.map((j)=>({radius:k*j.radius,x:r+C+(j.x-y.min)*k,y:r+z+(j.y-I.min)*k,setid:j.setid})))}function $t(t){let o={};for(let l of t)o[l.setid]=l;return o}function te(t){return Object.keys(t).map((l)=>Object.assign(t[l],{setid:l}))}function ee(t={}){let o=!1,l=600,r=350,c=15,h=1000,y=Math.PI/2,I=!0,w=null,S=!0,k=!0,C=null,z=null,j=!1,O=null,B=t&&t.symmetricalTextCentre?t.symmetricalTextCentre:!1,W={},U=t&&t.colourScheme?t.colourScheme:t&&t.colorScheme?t.colorScheme:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],q=0,D=function(R){if(R in W)return W[R];var _=W[R]=U[q];if(q+=1,q>=U.length)q=0;return _},L=Yt,F=mt;function M(R){let _=R.datum(),Y=new Set;_.forEach((P)=>{if(P.size==0&&P.sets.length==1)Y.add(P.sets[0])}),_=_.filter((P)=>!P.sets.some((st)=>Y.has(st)));let V={},X={};if(_.length>0){let P=L(_,{lossFunction:F,distinct:j});if(I)P=Jt(P,y,z);V=Qt(P,l,r,c,w),X=se(V,_,B)}let lt={};_.forEach((P)=>{if(P.label)lt[P.sets]=P.label});function it(P){if(P.sets in lt)return lt[P.sets];if(P.sets.length==1)return""+P.sets[0]}R.selectAll("svg").data([V]).enter().append("svg");let J=R.select("svg");if(o)J.attr("viewBox",`0 0 ${l} ${r}`);else J.attr("width",l).attr("height",r);let H={},Z=!1;J.selectAll(".venn-area path").each(function(P){let st=this.getAttribute("d");if(P.sets.length==1&&st&&!j)Z=!0,H[P.sets[0]]=Ee(st)});function G(P){return(st)=>{let bt=P.sets.map((gt)=>{let ht=H[gt],ot=V[gt];if(!ht)ht={x:l/2,y:r/2,radius:1};if(!ot)ot={x:l/2,y:r/2,radius:1};return{x:ht.x*(1-st)+ot.x*st,y:ht.y*(1-st)+ot.y*st,radius:ht.radius*(1-st)+ot.radius*st}});return Gt(bt,O)}}let Q=J.selectAll(".venn-area").data(_,(P)=>P.sets),rt=Q.enter().append("g").attr("class",(P)=>`venn-area venn-${P.sets.length==1?"circle":"intersection"}${P.colour||P.color?" venn-coloured":""}`).attr("data-venn-sets",(P)=>P.sets.join("_")),tt=rt.append("path"),et=rt.append("text").attr("class","label").text((P)=>it(P)).attr("text-anchor","middle").attr("dy",".35em").attr("x",l/2).attr("y",r/2);if(k)tt.style("fill-opacity","0").filter((P)=>P.sets.length==1).style("fill",(P)=>P.colour?P.colour:P.color?P.color:D(P.sets)).style("fill-opacity",".25"),et.style("fill",(P)=>{if(P.colour||P.color)return"#FFF";if(t.textFill)return t.textFill;return P.sets.length==1?D(P.sets):"#444"});function ft(P){if(typeof P.transition==="function")return P.transition("venn").duration(h);return P}let nt=R;if(Z&&typeof nt.transition==="function")nt=ft(R),nt.selectAll("path").attrTween("d",G);else nt.selectAll("path").attr("d",(P)=>Gt(P.sets.map((st)=>V[st])),O);let K=nt.selectAll("text").filter((P)=>(P.sets in X)).text((P)=>it(P)).attr("x",(P)=>Math.floor(X[P.sets].x)).attr("y",(P)=>Math.floor(X[P.sets].y));if(S)if(Z)if("on"in K)K.on("end",_t(V,it));else K.each("end",_t(V,it));else K.each(_t(V,it));let dt=ft(Q.exit()).remove();if(typeof Q.transition==="function")dt.selectAll("path").attrTween("d",G);let ct=dt.selectAll("text").attr("x",l/2).attr("y",r/2);if(C!==null)et.style("font-size","0px"),K.style("font-size",C),ct.style("font-size","0px");return{circles:V,textCentres:X,nodes:Q,enter:rt,update:nt,exit:dt}}return M.wrap=function(R){if(!arguments.length)return S;return S=R,M},M.useViewBox=function(){return o=!0,M},M.width=function(R){if(!arguments.length)return l;return l=R,M},M.height=function(R){if(!arguments.length)return r;return r=R,M},M.padding=function(R){if(!arguments.length)return c;return c=R,M},M.distinct=function(R){if(!arguments.length)return j;return j=R,M},M.colours=function(R){if(!arguments.length)return D;return D=R,M},M.colors=function(R){if(!arguments.length)return D;return D=R,M},M.fontSize=function(R){if(!arguments.length)return C;return C=R,M},M.round=function(R){if(!arguments.length)return O;return O=R,M},M.duration=function(R){if(!arguments.length)return h;return h=R,M},M.layoutFunction=function(R){if(!arguments.length)return L;return L=R,M},M.normalize=function(R){if(!arguments.length)return I;return I=R,M},M.scaleToFit=function(R){if(!arguments.length)return w;return w=R,M},M.styled=function(R){if(!arguments.length)return k;return k=R,M},M.orientation=function(R){if(!arguments.length)return y;return y=R,M},M.orientationOrder=function(R){if(!arguments.length)return z;return z=R,M},M.lossFunction=function(R){if(!arguments.length)return F;return F=R==="default"?mt:R==="logRatio"?Zt:R,M},M}function _t(t,o){return function(l){let r=this,c=t[l.sets[0]].radius||50,h=o(l)||"",y=h.split(/\s+/).reverse(),I=3,w=(h.length+y.length)/3,S=y.pop(),k=[S],C=0,z=1.1;r.textContent=null;let j=[];function O(D){let L=r.ownerDocument.createElementNS(r.namespaceURI,"tspan");return L.textContent=D,j.push(L),r.append(L),L}let B=O(S);while(!0){if(S=y.pop(),!S)break;k.push(S);let D=k.join(" ");if(B.textContent=D,D.length>w&&B.getComputedTextLength()>c)k.pop(),B.textContent=k.join(" "),k=[S],B=O(S),C++}let W=0.35-C*z/2,U=r.getAttribute("x"),q=r.getAttribute("y");j.forEach((D,L)=>{D.setAttribute("x",U),D.setAttribute("y",q),D.setAttribute("dy",`${W+L*z}em`)})}}function Et(t,o,l){let r=o[0].radius-at(o[0],t);for(let c=1;c<o.length;++c){let h=o[c].radius-at(o[c],t);if(h<=r)r=h}for(let c=0;c<l.length;++c){let h=at(l[c],t)-l[c].radius;if(h<=r)r=h}return r}function ne(t,o,l){let r=[];for(let k of t)r.push({x:k.x,y:k.y}),r.push({x:k.x+k.radius/2,y:k.y}),r.push({x:k.x-k.radius/2,y:k.y}),r.push({x:k.x,y:k.y+k.radius/2}),r.push({x:k.x,y:k.y-k.radius/2});let c=r[0],h=Et(r[0],t,o);for(let k=1;k<r.length;++k){let C=Et(r[k],t,o);if(C>=h)c=r[k],h=C}let y=Ht((k)=>-1*Et({x:k[0],y:k[1]},t,o),[c.x,c.y],{maxIterations:500,minErrorDelta:0.0000000001}).x,I={x:l?0:y[0],y:y[1]},w=!0;for(let k of t)if(at(I,k)>k.radius){w=!1;break}for(let k of o)if(at(I,k)<k.radius){w=!1;break}if(w)return I;if(t.length==1)return{x:t[0].x,y:t[0].y};let S={};if(It(t,S),S.arcs.length===0)return{x:0,y:-1000,disjoint:!0};if(S.arcs.length==1)return{x:S.arcs[0].circle.x,y:S.arcs[0].circle.y};if(o.length)return ne(t,[]);return Kt(S.arcs.map((k)=>k.p1))}function we(t){let o={},l=Object.keys(t);for(let r of l)o[r]=[];for(let r=0;r<l.length;r++){let c=l[r],h=t[c];for(let y=r+1;y<l.length;++y){let I=l[y],w=t[I],S=at(h,w);if(S+w.radius<=h.radius+0.0000000001)o[I].push(c);else if(S+h.radius<=w.radius+0.0000000001)o[c].push(I)}}return o}function se(t,o,l){let r={},c=we(t);for(let h=0;h<o.length;++h){let y=o[h].sets,I={},w={};for(let z=0;z<y.length;++z){I[y[z]]=!0;let j=c[y[z]];for(let O=0;O<j.length;++O)w[j[O]]=!0}let S=[],k=[];for(let z in t)if(z in I)S.push(t[z]);else if(!(z in w))k.push(t[z]);let C=ne(S,k,l);if(r[y]=C,C.disjoint&&o[h].size>0)console.log("WARNING: area "+y+" not represented on screen")}return r}function _e(t,o,l){let r=[];return r.push(`
2
+ M`,t,o),r.push(`
3
+ m`,-l,0),r.push(`
4
+ a`,l,l,0,1,0,l*2,0),r.push(`
5
+ a`,l,l,0,1,0,-l*2,0),r.join(" ")}function Ee(t){let o=t.split(" ");return{x:Number.parseFloat(o[1]),y:Number.parseFloat(o[2]),radius:-Number.parseFloat(o[4])}}function ie(t){if(t.length===0)return[];let o={};return It(t,o),o.arcs}function re(t,o){if(t.length===0)return"M 0 0";let l=Math.pow(10,o||0),r=o!=null?(h)=>Math.round(h*l)/l:(h)=>h;if(t.length==1){let h=t[0].circle;return _e(r(h.x),r(h.y),r(h.radius))}let c=[`
6
+ M`,r(t[0].p2.x),r(t[0].p2.y)];for(let h of t){let y=r(h.circle.radius);c.push(`
7
+ A`,y,y,0,h.large?1:0,h.sweep?1:0,r(h.p1.x),r(h.p1.y))}return c.join(" ")}function Gt(t,o){return re(ie(t),o)}function oe(t,o={}){let{lossFunction:l,layoutFunction:r=Yt,normalize:c=!0,orientation:h=Math.PI/2,orientationOrder:y,width:I=600,height:w=350,padding:S=15,scaleToFit:k=!1,symmetricalTextCentre:C=!1,distinct:z,round:j=2}=o,O=r(t,{lossFunction:l==="default"||!l?mt:l==="logRatio"?Zt:l,distinct:z});if(c)O=Jt(O,h,y);let B=Qt(O,I,w,S,k),W=se(B,t,C),U=new Map(Object.keys(B).map((L)=>[L,{set:L,x:B[L].x,y:B[L].y,radius:B[L].radius}])),q=t.map((L)=>{let F=L.sets.map((_)=>U.get(_)),M=ie(F),R=re(M,j);return{circles:F,arcs:M,path:R,area:L,has:new Set(L.sets)}});function D(L){let F="";for(let M of q)if(M.has.size>L.length&&L.every((R)=>M.has.has(R)))F+=" "+M.path;return F}return q.map(({circles:L,arcs:F,path:M,area:R})=>({data:R,text:W[R.sets],circles:L,arcs:F,path:M,distinctPath:M+D(R.sets)}))}var Ot=function(){var t=e(function(q,D,L,F){for(L=L||{},F=q.length;F--;L[q[F]]=D);return L},"o"),o=[5,8],l=[7,8,11,12,17,19,22,24],r=[1,17],c=[1,18],h=[7,8,11,12,14,15,16,17,19,20,21,22,24,27],y=[1,31],I=[1,39],w=[7,8,11,12,17,19,22,24,27],S=[1,57],k=[1,56],C=[1,58],z=[1,59],j=[1,60],O=[7,8,11,12,16,17,19,20,22,24,27,31,32,33],B={trace:e(function(){},"trace"),yy:{},symbols_:{error:2,start:3,optNewlines:4,VENN:5,document:6,EOF:7,NEWLINE:8,line:9,statement:10,TITLE:11,SET:12,identifier:13,BRACKET_LABEL:14,COLON:15,NUMERIC:16,UNION:17,identifierList:18,TEXT:19,IDENTIFIER:20,STRING:21,INDENT_TEXT:22,indentedTextTail:23,STYLE:24,stylesOpt:25,styleField:26,COMMA:27,styleValue:28,valueTokens:29,valueToken:30,HEXCOLOR:31,RGBCOLOR:32,RGBACOLOR:33,$accept:0,$end:1},terminals_:{2:"error",5:"VENN",7:"EOF",8:"NEWLINE",11:"TITLE",12:"SET",14:"BRACKET_LABEL",15:"COLON",16:"NUMERIC",17:"UNION",19:"TEXT",20:"IDENTIFIER",21:"STRING",22:"INDENT_TEXT",24:"STYLE",27:"COMMA",31:"HEXCOLOR",32:"RGBCOLOR",33:"RGBACOLOR"},productions_:[0,[3,4],[4,0],[4,2],[6,0],[6,2],[9,1],[9,1],[10,1],[10,2],[10,3],[10,4],[10,5],[10,2],[10,3],[10,4],[10,5],[10,3],[10,3],[10,3],[10,4],[10,4],[10,2],[10,3],[23,1],[23,1],[23,1],[23,2],[23,2],[25,1],[25,3],[26,3],[28,1],[28,1],[29,1],[29,2],[30,1],[30,1],[30,1],[30,1],[30,1],[18,1],[18,3],[13,1],[13,1]],performAction:e(function(D,L,F,M,R,_,Y){var V=_.length-1;switch(R){case 1:return _[V-1];case 2:case 3:case 4:this.$=[];break;case 5:_[V-1].push(_[V]),this.$=_[V-1];break;case 6:this.$=[];break;case 7:case 22:case 32:case 36:case 37:case 38:case 39:case 40:this.$=_[V];break;case 8:M.setDiagramTitle(_[V].substr(6)),this.$=_[V].substr(6);break;case 9:if(M.addSubsetData([_[V]],void 0,void 0),M.setIndentMode)M.setIndentMode(!0);break;case 10:if(M.addSubsetData([_[V-1]],_[V],void 0),M.setIndentMode)M.setIndentMode(!0);break;case 11:if(M.addSubsetData([_[V-2]],void 0,parseFloat(_[V])),M.setIndentMode)M.setIndentMode(!0);break;case 12:if(M.addSubsetData([_[V-3]],_[V-2],parseFloat(_[V])),M.setIndentMode)M.setIndentMode(!0);break;case 13:if(_[V].length<2)throw Error("union requires multiple identifiers");if(M.validateUnionIdentifiers)M.validateUnionIdentifiers(_[V]);if(M.addSubsetData(_[V],void 0,void 0),M.setIndentMode)M.setIndentMode(!0);break;case 14:if(_[V-1].length<2)throw Error("union requires multiple identifiers");if(M.validateUnionIdentifiers)M.validateUnionIdentifiers(_[V-1]);if(M.addSubsetData(_[V-1],_[V],void 0),M.setIndentMode)M.setIndentMode(!0);break;case 15:if(_[V-2].length<2)throw Error("union requires multiple identifiers");if(M.validateUnionIdentifiers)M.validateUnionIdentifiers(_[V-2]);if(M.addSubsetData(_[V-2],void 0,parseFloat(_[V])),M.setIndentMode)M.setIndentMode(!0);break;case 16:if(_[V-3].length<2)throw Error("union requires multiple identifiers");if(M.validateUnionIdentifiers)M.validateUnionIdentifiers(_[V-3]);if(M.addSubsetData(_[V-3],_[V-2],parseFloat(_[V])),M.setIndentMode)M.setIndentMode(!0);break;case 17:case 18:case 19:M.addTextData(_[V-1],_[V],void 0);break;case 20:case 21:M.addTextData(_[V-2],_[V-1],_[V]);break;case 23:M.addStyleData(_[V-1],_[V]);break;case 24:case 25:case 26:var X=M.getCurrentSets();if(!X)throw Error("text requires set");M.addTextData(X,_[V],void 0);break;case 27:case 28:var X=M.getCurrentSets();if(!X)throw Error("text requires set");M.addTextData(X,_[V-1],_[V]);break;case 29:case 41:this.$=[_[V]];break;case 30:case 42:this.$=[..._[V-2],_[V]];break;case 31:this.$=[_[V-2],_[V]];break;case 33:this.$=_[V].join(" ");break;case 34:this.$=[_[V]];break;case 35:_[V-1].push(_[V]),this.$=_[V-1];break;case 43:case 44:this.$=_[V];break}},"anonymous"),table:[t(o,[2,2],{3:1,4:2}),{1:[3]},{5:[1,3],8:[1,4]},t(l,[2,4],{6:5}),t(o,[2,3]),{7:[1,6],8:[1,8],9:7,10:9,11:[1,10],12:[1,11],17:[1,12],19:[1,13],22:[1,14],24:[1,15]},{1:[2,1]},t(l,[2,5]),t(l,[2,6]),t(l,[2,7]),t(l,[2,8]),{13:16,20:r,21:c},{13:20,18:19,20:r,21:c},{13:20,18:21,20:r,21:c},{16:[1,25],20:[1,23],21:[1,24],23:22},{13:20,18:26,20:r,21:c},t(l,[2,9],{14:[1,27],15:[1,28]}),t(h,[2,43]),t(h,[2,44]),t(l,[2,13],{14:[1,29],15:[1,30],27:y}),t(h,[2,41]),{16:[1,34],20:[1,32],21:[1,33],27:y},t(l,[2,22]),t(l,[2,24],{14:[1,35]}),t(l,[2,25],{14:[1,36]}),t(l,[2,26]),{20:I,25:37,26:38,27:y},t(l,[2,10],{15:[1,40]}),{16:[1,41]},t(l,[2,14],{15:[1,42]}),{16:[1,43]},{13:44,20:r,21:c},t(l,[2,17],{14:[1,45]}),t(l,[2,18],{14:[1,46]}),t(l,[2,19]),t(l,[2,27]),t(l,[2,28]),t(l,[2,23],{27:[1,47]}),t(w,[2,29]),{15:[1,48]},{16:[1,49]},t(l,[2,11]),{16:[1,50]},t(l,[2,15]),t(h,[2,42]),t(l,[2,20]),t(l,[2,21]),{20:I,26:51},{16:S,20:k,21:[1,53],28:52,29:54,30:55,31:C,32:z,33:j},t(l,[2,12]),t(l,[2,16]),t(w,[2,30]),t(w,[2,31]),t(w,[2,32]),t(w,[2,33],{30:61,16:S,20:k,31:C,32:z,33:j}),t(O,[2,34]),t(O,[2,36]),t(O,[2,37]),t(O,[2,38]),t(O,[2,39]),t(O,[2,40]),t(O,[2,35])],defaultActions:{6:[2,1]},parseError:e(function(D,L){if(L.recoverable)this.trace(D);else{var F=Error(D);throw F.hash=L,F}},"parseError"),parse:e(function(D){var L=this,F=[0],M=[],R=[null],_=[],Y=this.table,V="",X=0,lt=0,it=0,J=2,H=1,Z=_.slice.call(arguments,1),G=Object.create(this.lexer),Q={yy:{}};for(var rt in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,rt))Q.yy[rt]=this.yy[rt];if(G.setInput(D,Q.yy),Q.yy.lexer=G,Q.yy.parser=this,typeof G.yylloc>"u")G.yylloc={};var tt=G.yylloc;_.push(tt);var et=G.options&&G.options.ranges;if(typeof Q.yy.parseError==="function")this.parseError=Q.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function ft(ut){F.length=F.length-2*ut,R.length=R.length-ut,_.length=_.length-ut}e(ft,"popStack");function nt(){var ut=M.pop()||G.lex()||H;if(typeof ut!=="number"){if(ut instanceof Array)M=ut,ut=M.pop();ut=L.symbols_[ut]||ut}return ut}e(nt,"lex");var K,dt,ct,P,st,bt,gt={},ht,ot,qt,kt;while(!0){if(ct=F[F.length-1],this.defaultActions[ct])P=this.defaultActions[ct];else{if(K===null||typeof K>"u")K=nt();P=Y[ct]&&Y[ct][K]}if(typeof P>"u"||!P.length||!P[0]){var St="";kt=[];for(ht in Y[ct])if(this.terminals_[ht]&&ht>J)kt.push("'"+this.terminals_[ht]+"'");if(G.showPosition)St="Parse error on line "+(X+1)+`:
8
+ `+G.showPosition()+`
9
+ Expecting `+kt.join(", ")+", got '"+(this.terminals_[K]||K)+"'";else St="Parse error on line "+(X+1)+": Unexpected "+(K==H?"end of input":"'"+(this.terminals_[K]||K)+"'");this.parseError(St,{text:G.match,token:this.terminals_[K]||K,line:G.yylineno,loc:tt,expected:kt})}if(P[0]instanceof Array&&P.length>1)throw Error("Parse Error: multiple actions possible at state: "+ct+", token: "+K);switch(P[0]){case 1:if(F.push(K),R.push(G.yytext),_.push(G.yylloc),F.push(P[1]),K=null,!dt){if(lt=G.yyleng,V=G.yytext,X=G.yylineno,tt=G.yylloc,it>0)it--}else K=dt,dt=null;break;case 2:if(ot=this.productions_[P[1]][1],gt.$=R[R.length-ot],gt._$={first_line:_[_.length-(ot||1)].first_line,last_line:_[_.length-1].last_line,first_column:_[_.length-(ot||1)].first_column,last_column:_[_.length-1].last_column},et)gt._$.range=[_[_.length-(ot||1)].range[0],_[_.length-1].range[1]];if(bt=this.performAction.apply(gt,[V,lt,X,Q.yy,P[1],R,_].concat(Z)),typeof bt<"u")return bt;if(ot)F=F.slice(0,-1*ot*2),R=R.slice(0,-1*ot),_=_.slice(0,-1*ot);F.push(this.productions_[P[1]][0]),R.push(gt.$),_.push(gt._$),qt=Y[F[F.length-2]][F[F.length-1]],F.push(qt);break;case 3:return!0}}return!0},"parse")},W=function(){var q={EOF:1,parseError:e(function(L,F){if(this.yy.parser)this.yy.parser.parseError(L,F);else throw Error(L)},"parseError"),setInput:e(function(D,L){if(this.yy=L||this.yy||{},this._input=D,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges)this.yylloc.range=[0,0];return this.offset=0,this},"setInput"),input:e(function(){var D=this._input[0];this.yytext+=D,this.yyleng++,this.offset++,this.match+=D,this.matched+=D;var L=D.match(/(?:\r\n?|\n).*/g);if(L)this.yylineno++,this.yylloc.last_line++;else this.yylloc.last_column++;if(this.options.ranges)this.yylloc.range[1]++;return this._input=this._input.slice(1),D},"input"),unput:e(function(D){var L=D.length,F=D.split(/(?:\r\n?|\n)/g);this._input=D+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-L),this.offset-=L;var M=this.match.split(/(?:\r\n?|\n)/g);if(this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),F.length-1)this.yylineno-=F.length-1;var R=this.yylloc.range;if(this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:F?(F.length===M.length?this.yylloc.first_column:0)+M[M.length-F.length].length-F[0].length:this.yylloc.first_column-L},this.options.ranges)this.yylloc.range=[R[0],R[0]+this.yyleng-L];return this.yyleng=this.yytext.length,this},"unput"),more:e(function(){return this._more=!0,this},"more"),reject:e(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
10
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:e(function(D){this.unput(this.match.slice(D))},"less"),pastInput:e(function(){var D=this.matched.substr(0,this.matched.length-this.match.length);return(D.length>20?"...":"")+D.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:e(function(){var D=this.match;if(D.length<20)D+=this._input.substr(0,20-D.length);return(D.substr(0,20)+(D.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:e(function(){var D=this.pastInput(),L=Array(D.length+1).join("-");return D+this.upcomingInput()+`
11
+ `+L+"^"},"showPosition"),test_match:e(function(D,L){var F,M,R;if(this.options.backtrack_lexer){if(R={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges)R.yylloc.range=this.yylloc.range.slice(0)}if(M=D[0].match(/(?:\r\n?|\n).*/g),M)this.yylineno+=M.length;if(this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:M?M[M.length-1].length-M[M.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+D[0].length},this.yytext+=D[0],this.match+=D[0],this.matches=D,this.yyleng=this.yytext.length,this.options.ranges)this.yylloc.range=[this.offset,this.offset+=this.yyleng];if(this._more=!1,this._backtrack=!1,this._input=this._input.slice(D[0].length),this.matched+=D[0],F=this.performAction.call(this,this.yy,this,L,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input)this.done=!1;if(F)return F;else if(this._backtrack){for(var _ in R)this[_]=R[_];return!1}return!1},"test_match"),next:e(function(){if(this.done)return this.EOF;if(!this._input)this.done=!0;var D,L,F,M;if(!this._more)this.yytext="",this.match="";var R=this._currentRules();for(var _=0;_<R.length;_++)if(F=this._input.match(this.rules[R[_]]),F&&(!L||F[0].length>L[0].length)){if(L=F,M=_,this.options.backtrack_lexer)if(D=this.test_match(F,R[_]),D!==!1)return D;else if(this._backtrack){L=!1;continue}else return!1;else if(!this.options.flex)break}if(L){if(D=this.test_match(L,R[M]),D!==!1)return D;return!1}if(this._input==="")return this.EOF;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
12
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:e(function(){var L=this.next();if(L)return L;else return this.lex()},"lex"),begin:e(function(L){this.conditionStack.push(L)},"begin"),popState:e(function(){var L=this.conditionStack.length-1;if(L>0)return this.conditionStack.pop();else return this.conditionStack[0]},"popState"),_currentRules:e(function(){if(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1])return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules;else return this.conditions.INITIAL.rules},"_currentRules"),topState:e(function(L){if(L=this.conditionStack.length-1-Math.abs(L||0),L>=0)return this.conditionStack[L];else return"INITIAL"},"topState"),pushState:e(function(L){this.begin(L)},"pushState"),stateStackSize:e(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:e(function(L,F,M,R){var _=R;switch(M){case 0:break;case 1:break;case 2:break;case 3:if(L.getIndentMode&&L.getIndentMode())return L.consumeIndentText=!0,this.begin("INITIAL"),22;break;case 4:break;case 5:if(L.setIndentMode)L.setIndentMode(!1);this.begin("INITIAL"),this.unput(F.yytext);break;case 6:return this.begin("bol"),8;break;case 7:break;case 8:break;case 9:return 7;case 10:return 11;case 11:return 5;case 12:return 12;case 13:return 17;case 14:if(L.consumeIndentText)L.consumeIndentText=!1;else return 19;break;case 15:return 24;case 16:return F.yytext=F.yytext.slice(2,-2),14;break;case 17:return F.yytext=F.yytext.slice(1,-1).trim(),14;break;case 18:return 16;case 19:return 31;case 20:return 33;case 21:return 32;case 22:return 20;case 23:return 21;case 24:return 27;case 25:return 15}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[ \t]+(?=[\n\r]))/i,/^(?:[ \t]+(?=text\b))/i,/^(?:[ \t]+)/i,/^(?:[^ \t\n\r])/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:[ \t]+)/i,/^(?:$)/i,/^(?:title\s[^#\n;]+)/i,/^(?:venn-beta\b)/i,/^(?:set\b)/i,/^(?:union\b)/i,/^(?:text\b)/i,/^(?:style\b)/i,/^(?:\["[^\"]*"\])/i,/^(?:\[[^\]\"]+\])/i,/^(?:[+-]?(\d+(\.\d+)?|\.\d+))/i,/^(?:#[0-9a-fA-F]{3,8})/i,/^(?:rgba\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i,/^(?:rgb\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i,/^(?:[A-Za-z_][A-Za-z0-9\-_]*)/i,/^(?:"[^\"]*")/i,/^(?:,)/i,/^(?::)/i],conditions:{bol:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],inclusive:!0},INITIAL:{rules:[0,1,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],inclusive:!0}}};return q}();B.lexer=W;function U(){this.yy={}}return e(U,"Parser"),U.prototype=B,B.Parser=U,new U}();Ot.parser=Ot;var ze=Ot,Lt=[],jt=[],Ft=[],Pt=new Set,Vt,Bt=!1,Ae=e((t,o,l)=>{let r=Mt(t).sort(),c=l??10/Math.pow(t.length,2);if(Vt=r,r.length===1)Pt.add(r[0]);Lt.push({sets:r,size:c,label:o?vt(o):void 0})},"addSubsetData"),De=e(()=>Lt,"getSubsetData"),vt=e((t)=>{let o=t.trim();if(o.length>=2&&o.startsWith('"')&&o.endsWith('"'))return o.slice(1,-1);return o},"normalizeText"),Re=e((t)=>t?vt(t):t,"normalizeStyleValue"),Ce=e((t,o,l)=>{let r=vt(o);jt.push({sets:Mt(t).sort(),id:r,label:l?vt(l):void 0})},"addTextData"),Ne=e((t,o)=>{let l=Mt(t).sort(),r={};for(let[c,h]of o)r[c]=Re(h)??h;Ft.push({targets:l,styles:r})},"addStyleData"),Oe=e(()=>Ft,"getStyleData"),Mt=e((t)=>t.map((o)=>vt(o)),"normalizeIdentifierList"),Le=e((t)=>{let l=Mt(t).filter((r)=>!Pt.has(r));if(l.length>0)throw Error(`unknown set identifier: ${l.join(", ")}`)},"validateUnionIdentifiers"),je=e(()=>jt,"getTextData"),Fe=e(()=>Vt,"getCurrentSets"),Pe=e(()=>Bt,"getIndentMode"),Ve=e((t)=>{Bt=t},"setIndentMode"),Be=x.venn;function ae(){return E(Be,u().venn)}e(ae,"getConfig");var qe=e(()=>{d(),Lt.length=0,jt.length=0,Ft.length=0,Pt.clear(),Vt=void 0,Bt=!1},"customClear"),Ue={getConfig:ae,clear:qe,setAccTitle:f,getAccTitle:p,setDiagramTitle:b,getDiagramTitle:v,getAccDescription:g,setAccDescription:m,addSubsetData:Ae,getSubsetData:De,addTextData:Ce,addStyleData:Ne,validateUnionIdentifiers:Le,getTextData:je,getStyleData:Oe,getCurrentSets:Fe,getIndentMode:Pe,setIndentMode:Ve},Ge=e((t)=>`
13
+ .venn-title {
14
+ font-size: 32px;
15
+ fill: ${t.vennTitleTextColor};
16
+ font-family: ${t.fontFamily};
17
+ }
18
+
19
+ .venn-circle text {
20
+ font-size: 48px;
21
+ font-family: ${t.fontFamily};
22
+ }
23
+
24
+ .venn-intersection text {
25
+ font-size: 48px;
26
+ fill: ${t.vennSetTextColor};
27
+ font-family: ${t.fontFamily};
28
+ }
29
+
30
+ .venn-text-node {
31
+ font-family: ${t.fontFamily};
32
+ color: ${t.vennSetTextColor};
33
+ }
34
+ `,"getStyles"),We=Ge;function le(t){let o=new Map;for(let l of t){let r=l.targets.join("|"),c=o.get(r);if(c)Object.assign(c,l.styles);else o.set(r,{...l.styles})}return o}e(le,"buildStyleByKey");var Ke=e((t,o,l,r)=>{let c=r.db,h=c.getConfig?.(),{themeVariables:y,look:I,handDrawnSeed:w}=u(),S=I==="handDrawn",k=[y.venn1,y.venn2,y.venn3,y.venn4,y.venn5,y.venn6,y.venn7,y.venn8].filter(Boolean),C=c.getDiagramTitle?.(),z=c.getSubsetData(),j=c.getTextData(),O=le(c.getStyleData()),B=ue(z),W=h?.width??800,U=h?.height??450,q=1600,D=W/1600,L=C?48*D:0,F=y.primaryTextColor??y.textColor,M=A(o);if(M.attr("viewBox",`0 0 ${W} ${U}`),C)M.append("text").text(C).attr("class","venn-title").attr("font-size",`${32*D}px`).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("x","50%").attr("y",32*D).style("fill",y.vennTitleTextColor||y.titleColor);let R=n(document.createElement("div")),_=ee().width(W).height(U-L);R.datum(B).call(_);let Y=S?s.svg(R.select("svg").node()):void 0,V=oe(B,{width:W,height:U-L,padding:h?.padding??15}),X=new Map;for(let H of V){let Z=yt([...H.data.sets].sort());X.set(Z,H)}if(j.length>0)ce(h,X,R,j,D,O);let lt=N(y.background||"#f4f4f4");if(R.selectAll(".venn-circle").each(function(H,Z){let G=n(this),rt=yt([...H.sets].sort()),tt=O.get(rt),et=tt?.fill||k[Z%k.length]||y.primaryColor;G.classed(`venn-set-${Z%8}`,!0);let ft=tt?.["fill-opacity"]??0.1,nt=tt?.stroke||et,K=tt?.["stroke-width"]||`${5*D}`;if(S&&Y){let ct=X.get(rt);if(ct&&ct.circles.length>0){let P=ct.circles[0],st=Y.circle(P.x,P.y,P.radius*2,{roughness:0.7,seed:w,fill:wt(et,0.7),fillStyle:"hachure",fillWeight:2,hachureGap:8,hachureAngle:-41+Z*60,stroke:nt,strokeWidth:parseFloat(String(K))});G.select("path").remove(),G.node()?.insertBefore(st,G.select("text").node())}}else G.select("path").style("fill",et).style("fill-opacity",ft).style("stroke",nt).style("stroke-width",K).style("stroke-opacity",0.95);let dt=tt?.color||(lt?i(et,30):a(et,30));G.select("text").style("font-size",`${48*D}px`).style("fill",dt)}),S&&Y)R.selectAll(".venn-intersection").each(function(H){let Z=n(this),Q=yt([...H.sets].sort()),rt=O.get(Q),tt=rt?.fill;if(tt){let et=Z.select("path"),ft=et.attr("d");if(ft){let nt=Y.path(ft,{roughness:0.7,seed:w,fill:wt(tt,0.3),fillStyle:"cross-hatch",fillWeight:2,hachureGap:6,hachureAngle:60,stroke:"none"}),K=et.node();K?.parentNode?.insertBefore(nt,K),et.remove()}}else Z.select("path").style("fill-opacity",0);Z.select("text").style("font-size",`${48*D}px`).style("fill",rt?.color??y.vennSetTextColor??F)});else R.selectAll(".venn-intersection text").style("font-size",`${48*D}px`).style("fill",(H)=>{let G=yt([...H.sets].sort());return O.get(G)?.color??y.vennSetTextColor??F}),R.selectAll(".venn-intersection path").style("fill-opacity",(H)=>{let G=yt([...H.sets].sort());return O.get(G)?.fill?1:0}).style("fill",(H)=>{let G=yt([...H.sets].sort());return O.get(G)?.fill??"transparent"});let it=M.append("g").attr("transform",`translate(0, ${L})`),J=R.select("svg").node();if(J&&"childNodes"in J)for(let H of[...J.childNodes])it.node()?.appendChild(H);T(M,U,W,h?.useMaxWidth??!0)},"draw");function yt(t){return t.join("|")}e(yt,"stableSetsKey");function ce(t,o,l,r,c,h){let y=t?.useDebugLayout??!1,w=l.select("svg").append("g").attr("class","venn-text-nodes"),S=new Map;for(let k of r){let C=yt(k.sets),z=S.get(C);if(z)z.push(k);else S.set(C,[k])}for(let[k,C]of S.entries()){let z=o.get(k);if(!z?.text)continue;let j=z.text.x,O=z.text.y,B=Math.min(...z.circles.map((J)=>J.radius)),W=Math.min(...z.circles.map((J)=>J.radius-Math.hypot(j-J.x,O-J.y))),U=Number.isFinite(W)?Math.max(0,W):0;if(U===0&&Number.isFinite(B))U=B*0.6;let q=w.append("g").attr("class","venn-text-area").attr("font-size",`${40*c}px`);if(y)q.append("circle").attr("class","venn-text-debug-circle").attr("cx",j).attr("cy",O).attr("r",U).attr("fill","none").attr("stroke","purple").attr("stroke-width",1.5*c).attr("stroke-dasharray",`${6*c} ${4*c}`);let D=Math.max(80*c,U*2*0.95),L=Math.max(60*c,U*2*0.95),R=(z.data.label&&z.data.label.length>0?Math.min(32*c,U*0.25):0)+(C.length<=2?30*c:0),_=j-D/2,Y=O-L/2+R,V=Math.max(1,Math.ceil(Math.sqrt(C.length))),X=Math.max(1,Math.ceil(C.length/V)),lt=D/V,it=L/X;for(let[J,H]of C.entries()){let Z=J%V,G=Math.floor(J/V),Q=_+lt*(Z+0.5),rt=Y+it*(G+0.5);if(y)q.append("rect").attr("class","venn-text-debug-cell").attr("x",_+lt*Z).attr("y",Y+it*G).attr("width",lt).attr("height",it).attr("fill","none").attr("stroke","teal").attr("stroke-width",1*c).attr("stroke-dasharray",`${4*c} ${3*c}`);let tt=lt*0.9,et=it*0.9,ft=q.append("foreignObject").attr("class","venn-text-node-fo").attr("width",tt).attr("height",et).attr("x",Q-tt/2).attr("y",rt-et/2).attr("overflow","visible"),nt=h.get(H.id)?.color,K=ft.append("xhtml:span").attr("class","venn-text-node").style("display","flex").style("width","100%").style("height","100%").style("white-space","normal").style("align-items","center").style("justify-content","center").style("text-align","center").style("overflow-wrap","normal").style("word-break","normal").text(H.label??H.id);if(nt)K.style("color",nt)}}}e(ce,"renderTextNodes");function ue(t){let o=new Set(t.map((c)=>[...c.sets].sort().join("|"))),l=new Map(t.filter((c)=>c.sets.length===1&&c.size!==void 0).map((c)=>[c.sets[0],c.size])),r=[];for(let c of t){if(c.sets.length<3)continue;let h=[...c.sets].sort();for(let y=0;y<h.length-1;y++)for(let I=y+1;I<h.length;I++){let w=[h[y],h[I]],S=w.join("|");if(!o.has(S)){o.add(S);let k=l.get(w[0]),C=l.get(w[1]),z=k!==void 0&&C!==void 0?Math.min(k,C)/4:2.5;r.push({sets:w,size:z,label:""})}}}return r.length>0?[...t,...r]:t}e(ue,"ensurePairwiseSubsets");var He={draw:Ke},rn={parser:ze,db:Ue,renderer:He,styles:We};export{rn as diagram};
@@ -0,0 +1 @@
1
+ import{ri}from"./index-zx0j3a2z.js";export{ri as createWardleyServices};
@@ -1,5 +1,5 @@
1
- import{R}from"./index-353m7b0p.js";import{e,t,j,u,k,d,f,p,m,g,b,v,r,A,E}from"./index-1r72hdzb.js";import"./index-6qmsnxwy.js";import{D}from"./index-tb1wf525.js";var nt=e((o,l)=>{let s=o<=1?o*100:o;if(s<0||s>100)throw Error(`${l} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${o}`);return s},"toPercent"),Z=e((o,l,s)=>({x:nt(l,`${s} evolution`),y:nt(o,`${s} visibility`)}),"toCoordinates"),ht=e((o)=>{if(!o)return;if(o==="+<>")return"bidirectional";if(o==="+<")return"backward";if(o==="+>")return"forward";return},"getFlowFromPort"),Ft=e((o)=>{if(!o?.startsWith("+"))return{};let s=/^\+'([^']*)'/.exec(o)?.[1];if(o.includes("<>"))return{flow:"bidirectional",label:s};if(o.includes("<"))return{flow:"backward",label:s};if(o.includes(">"))return{flow:"forward",label:s};return{label:s}},"extractFlowFromArrow"),Rt=e((o,l)=>{if(R(o,l),o.size)l.setSize(o.size.width,o.size.height);if(o.evolution){let s=o.evolution.stages.map((n)=>{if(n.secondName)return`${n.name.trim()} / ${n.secondName.trim()}`;return n.name.trim()}),S=o.evolution.stages.filter((n)=>n.boundary!==void 0).map((n)=>n.boundary);l.updateAxes({stages:s,stageBoundaries:S})}if(o.anchors.forEach((s)=>{let S=Z(s.visibility,s.evolution,`Anchor "${s.name}"`);l.addNode(s.name,s.name,S.x,S.y,"anchor")}),o.components.forEach((s)=>{let S=Z(s.visibility,s.evolution,`Component "${s.name}"`),n=s.label?(s.label.negX?-1:1)*s.label.offsetX:void 0,x=s.label?(s.label.negY?-1:1)*s.label.offsetY:void 0,L=s.decorator?.strategy;l.addNode(s.name,s.name,S.x,S.y,"component",n,x,s.inertia,L)}),o.notes.forEach((s)=>{let S=Z(s.visibility,s.evolution,`Note "${s.text}"`);l.addNote(s.text,S.x,S.y)}),o.pipelines.forEach((s)=>{let S=l.getNode(s.parent);if(!S||typeof S.y!=="number")throw Error(`Pipeline "${s.parent}" must reference an existing component with coordinates.`);let n=S.y;l.startPipeline(s.parent),s.components.forEach((x)=>{let L=`${s.parent}_${x.name}`,B=x.label?(x.label.negX?-1:1)*x.label.offsetX:void 0,N=x.label?(x.label.negY?-1:1)*x.label.offsetY:void 0,et=nt(x.evolution,`Pipeline component "${x.name}" evolution`);l.addNode(L,x.name,et,n,"pipeline-component",B,N),l.addPipelineComponent(s.parent,L)})}),o.links.forEach((s)=>{let S=!!s.arrow&&(s.arrow.includes("-.->")||s.arrow.includes(".-.")),n=ht(s.fromPort)??ht(s.toPort),{flow:x,label:L}=Ft(s.arrow);if(!n&&x)n=x;let B=s.linkLabel,N=L??B;l.addLink(l.resolveNodeId(s.from),l.resolveNodeId(s.to),S,N,n)}),o.evolves.forEach((s)=>{let S=l.getNode(s.component);if(S?.y!==void 0){let n=nt(s.target,`Evolve target for "${s.component}"`);l.addTrend(s.component,n,S.y)}}),o.annotations.length>0){let s=o.annotations[0],S=Z(s.x,s.y,"Annotations box");l.setAnnotationsBox(S.x,S.y)}o.annotation.forEach((s)=>{let S=Z(s.x,s.y,`Annotation ${s.number}`);l.addAnnotation(s.number,[{x:S.x,y:S.y}],s.text)}),o.accelerators.forEach((s)=>{let S=Z(s.x,s.y,`Accelerator "${s.name}"`);l.addAccelerator(s.name,S.x,S.y)}),o.deaccelerators.forEach((s)=>{let S=Z(s.x,s.y,`Deaccelerator "${s.name}"`);l.addDeaccelerator(s.name,S.x,S.y)})},"populateDb"),ft={parser:{yy:void 0},parse:e(async(o)=>{let l=await D("wardley",o);t.debug(l);let s=ft.parser?.yy;if(!s||typeof s.addNode!=="function")throw Error("parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Rt(l,s)},"parse")},Ot=class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}static{e(this,"WardleyBuilder")}addNode(o){let l=this.nodes.get(o.id)??{id:o.id,label:o.label},s={...l,...o,className:o.className??l.className,labelOffsetX:o.labelOffsetX??l.labelOffsetX,labelOffsetY:o.labelOffsetY??l.labelOffsetY};this.nodes.set(o.id,s)}addLink(o){this.links.push(o)}addTrend(o){this.trends.set(o.nodeId,o)}startPipeline(o){this.pipelines.set(o,{nodeId:o,componentIds:[]});let l=this.nodes.get(o);if(l)l.isPipelineParent=!0}addPipelineComponent(o,l){let s=this.pipelines.get(o);if(s)s.componentIds.push(l);let S=this.nodes.get(l);if(S)S.inPipeline=!0}addAnnotation(o){this.annotations.push(o)}addNote(o){this.notes.push(o)}addAccelerator(o){this.accelerators.push(o)}addDeaccelerator(o){this.deaccelerators.push(o)}setAnnotationsBox(o,l){this.annotationsBox={x:o,y:l}}setAxes(o){this.axes={...this.axes,...o}}setSize(o,l){this.size={width:o,height:l}}getNode(o){return this.nodes.get(o)}resolveNodeId(o){if(this.nodes.has(o))return o;for(let[l,s]of this.nodes)if(s.label===o)return l;return o}build(){let o=[];for(let l of this.nodes.values()){if(typeof l.x!=="number"||typeof l.y!=="number")throw Error(`Node "${l.label}" is missing coordinates`);o.push(l)}return{nodes:o,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}},W=new Ot;function xt(){return r()["wardley-beta"]}e(xt,"getConfig");function gt(o,l,s,S,n,x,L,B,N){W.addNode({id:o,label:l,x:s,y:S,className:n,labelOffsetX:x,labelOffsetY:L,inertia:B,sourceStrategy:N})}e(gt,"addNode");function yt(o,l,s=!1,S,n){W.addLink({source:o,target:l,dashed:s,label:S,flow:n})}e(yt,"addLink");function ut(o,l,s){W.addTrend({nodeId:o,targetX:l,targetY:s})}e(ut,"addTrend");function wt(o,l,s){W.addAnnotation({number:o,coordinates:l,text:s})}e(wt,"addAnnotation");function mt(o,l,s){W.addNote({text:o,x:l,y:s})}e(mt,"addNote");function kt(o,l,s){W.addAccelerator({name:o,x:l,y:s})}e(kt,"addAccelerator");function bt(o,l,s){W.addDeaccelerator({name:o,x:l,y:s})}e(bt,"addDeaccelerator");function $t(o,l){W.setAnnotationsBox(o,l)}e($t,"setAnnotationsBox");function vt(o,l){W.setSize(o,l)}e(vt,"setSize");function Pt(o){W.startPipeline(o)}e(Pt,"startPipeline");function Ct(o,l){W.addPipelineComponent(o,l)}e(Ct,"addPipelineComponent");function St(o){W.setAxes(o)}e(St,"updateAxes");function Mt(o){return W.getNode(o)}e(Mt,"getNode");function Nt(o){return W.resolveNodeId(o)}e(Nt,"resolveNodeId");function zt(){return W.build()}e(zt,"getWardleyData");function Lt(){W.clear(),d()}e(Lt,"clear");var Dt={getConfig:xt,addNode:gt,addLink:yt,addTrend:ut,addAnnotation:wt,addNote:mt,addAccelerator:kt,addDeaccelerator:bt,setAnnotationsBox:$t,setSize:vt,startPipeline:Pt,addPipelineComponent:Ct,updateAxes:St,getNode:Mt,resolveNodeId:Nt,getWardleyData:zt,clear:Lt,setAccTitle:f,getAccTitle:p,setDiagramTitle:b,getDiagramTitle:v,getAccDescription:g,setAccDescription:m},Gt=["Genesis","Custom Built","Product","Commodity"],qt=e(()=>{let{themeVariables:o}=r();return{backgroundColor:o.wardley?.backgroundColor??o.background??"#fff",axisColor:o.wardley?.axisColor??"#000",axisTextColor:o.wardley?.axisTextColor??o.primaryTextColor??"#222",gridColor:o.wardley?.gridColor??"rgba(100, 100, 100, 0.2)",componentFill:o.wardley?.componentFill??"#fff",componentStroke:o.wardley?.componentStroke??"#000",componentLabelColor:o.wardley?.componentLabelColor??o.primaryTextColor??"#222",linkStroke:o.wardley?.linkStroke??"#000",evolutionStroke:o.wardley?.evolutionStroke??"#dc3545",annotationStroke:o.wardley?.annotationStroke??"#000",annotationTextColor:o.wardley?.annotationTextColor??o.primaryTextColor??"#222",annotationFill:o.wardley?.annotationFill??o.background??"#fff"}},"getTheme"),jt=e(()=>{let o=r()["wardley-beta"];return{width:o?.width??900,height:o?.height??600,padding:o?.padding??48,nodeRadius:o?.nodeRadius??6,nodeLabelOffset:o?.nodeLabelOffset??8,axisFontSize:o?.axisFontSize??12,labelFontSize:o?.labelFontSize??10,showGrid:o?.showGrid??!1,useMaxWidth:o?.useMaxWidth??!0}},"getConfigValues"),Vt=e((o,l,s,S)=>{t.debug(`Rendering Wardley map
2
- `+o);let n=jt(),x=qt(),L=n.nodeRadius*1.6,B=S.db,N=B.getWardleyData(),et=B.getDiagramTitle(),F=N.size?.width??n.width,X=N.size?.height??n.height,J=A(l);J.selectAll("*").remove(),k(J,X,F,n.useMaxWidth),J.attr("viewBox",`0 0 ${F} ${X}`);let Y=J.append("g").attr("class","wardley-map"),st=J.append("defs");st.append("marker").attr("id",`arrow-${l}`).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("fill",x.evolutionStroke).attr("stroke","none"),st.append("marker").attr("id",`link-arrow-end-${l}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",x.linkStroke).attr("stroke","none"),st.append("marker").attr("id",`link-arrow-start-${l}`).attr("viewBox","0 0 10 10").attr("refX",1).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z").attr("fill",x.linkStroke).attr("stroke","none"),Y.append("rect").attr("class","wardley-background").attr("width",F).attr("height",X).attr("fill",x.backgroundColor);let K=F-n.padding*2,Q=X-n.padding*2;if(et)Y.append("text").attr("class","wardley-title").attr("x",F/2).attr("y",n.padding/2).attr("fill",x.axisTextColor).attr("font-size",n.axisFontSize*1.05).attr("font-weight","bold").attr("text-anchor","middle").attr("dominant-baseline","middle").text(et);let q=e((a)=>n.padding+a/100*K,"projectX"),V=e((a)=>X-n.padding-a/100*Q,"projectY"),at=Y.append("g").attr("class","wardley-axes");at.append("line").attr("x1",n.padding).attr("x2",F-n.padding).attr("y1",X-n.padding).attr("y2",X-n.padding).attr("stroke",x.axisColor).attr("stroke-width",1),at.append("line").attr("x1",n.padding).attr("x2",n.padding).attr("y1",n.padding).attr("y2",X-n.padding).attr("stroke",x.axisColor).attr("stroke-width",1);let Tt=N.axes.xLabel??"Evolution",Wt=N.axes.yLabel??"Visibility";at.append("text").attr("class","wardley-axis-label wardley-axis-label-x").attr("x",n.padding+K/2).attr("y",X-n.padding/4).attr("fill",x.axisTextColor).attr("font-size",n.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").text(Tt),at.append("text").attr("class","wardley-axis-label wardley-axis-label-y").attr("x",n.padding/3).attr("y",n.padding+Q/2).attr("fill",x.axisTextColor).attr("font-size",n.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").attr("transform",`rotate(-90 ${n.padding/3} ${n.padding+Q/2})`).text(Wt);let tt=N.axes.stages&&N.axes.stages.length>0?N.axes.stages:Gt;if(tt.length>0){let a=Y.append("g").attr("class","wardley-stages"),c=N.axes.stageBoundaries,i=[];if(c&&c.length===tt.length){let h=0;c.forEach((w)=>{i.push({start:h,end:w}),h=w})}else{let h=1/tt.length;tt.forEach((w,P)=>{i.push({start:P*h,end:(P+1)*h})})}tt.forEach((h,w)=>{let P=i[w],M=n.padding+P.start*K,C=n.padding+P.end*K,z=(M+C)/2;if(w>0)a.append("line").attr("x1",M).attr("x2",M).attr("y1",n.padding).attr("y2",X-n.padding).attr("stroke","#000").attr("stroke-width",1).attr("stroke-dasharray","5 5").attr("opacity",0.8);a.append("text").attr("class","wardley-stage-label").attr("x",z).attr("y",X-n.padding/1.5).attr("fill",x.axisTextColor).attr("font-size",n.axisFontSize-2).attr("text-anchor","middle").text(h)})}if(n.showGrid){let a=Y.append("g").attr("class","wardley-grid");for(let c=1;c<4;c++){let i=c/4,h=n.padding+K*i;a.append("line").attr("x1",h).attr("x2",h).attr("y1",n.padding).attr("y2",X-n.padding).attr("stroke",x.gridColor).attr("stroke-dasharray","2 6"),a.append("line").attr("x1",n.padding).attr("x2",F-n.padding).attr("y1",X-n.padding-Q*i).attr("y2",X-n.padding-Q*i).attr("stroke",x.gridColor).attr("stroke-dasharray","2 6")}}let y=new Map;if(N.nodes.forEach((a)=>{y.set(a.id,{x:q(a.x),y:V(a.y),node:a})}),N.pipelines.length>0){let a=Y.append("g").attr("class","wardley-pipelines"),c=Y.append("g").attr("class","wardley-pipeline-links");N.pipelines.forEach((i)=>{if(i.componentIds.length===0)return;let h=i.componentIds.map((C)=>({id:C,pos:y.get(C),node:N.nodes.find((z)=>z.id===C)})).filter((C)=>C.pos&&C.node).sort((C,z)=>C.node.x-z.node.x);for(let C=0;C<h.length-1;C++){let z=h[C],T=h[C+1];c.append("line").attr("class","wardley-pipeline-evolution-link").attr("x1",z.pos.x).attr("y1",z.pos.y).attr("x2",T.pos.x).attr("y2",T.pos.y).attr("stroke",x.linkStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4")}let w=1/0,P=-1/0,M=0;if(i.componentIds.forEach((C)=>{let z=y.get(C);if(z)w=Math.min(w,z.x),P=Math.max(P,z.x),M=z.y}),w!==1/0&&P!==-1/0){let z=n.nodeRadius*4,T=M-z/2,I=y.get(i.nodeId);if(I){let G=(w+P)/2;I.x=G,I.y=T-L/6}a.append("rect").attr("class","wardley-pipeline-box").attr("x",w-15).attr("y",T).attr("width",P-w+30).attr("height",z).attr("fill","none").attr("stroke",x.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}})}let lt=Y.append("g").attr("class","wardley-links"),ct=new Map;N.pipelines.forEach((a)=>{ct.set(a.nodeId,new Set(a.componentIds))});let pt=N.links.filter((a)=>{if(!y.has(a.source)||!y.has(a.target))return!1;if(ct.get(a.target)?.has(a.source))return!1;return!0});lt.selectAll("line").data(pt).enter().append("line").attr("class",(a)=>`wardley-link${a.dashed?" wardley-link--dashed":""}`).attr("x1",(a)=>{let c=y.get(a.source),i=y.get(a.target),w=N.nodes.find((z)=>z.id===a.source).isPipelineParent?L/Math.sqrt(2):n.nodeRadius,P=i.x-c.x,M=i.y-c.y,C=Math.sqrt(P*P+M*M);return c.x+P/C*w}).attr("y1",(a)=>{let c=y.get(a.source),i=y.get(a.target),w=N.nodes.find((z)=>z.id===a.source).isPipelineParent?L/Math.sqrt(2):n.nodeRadius,P=i.x-c.x,M=i.y-c.y,C=Math.sqrt(P*P+M*M);return c.y+M/C*w}).attr("x2",(a)=>{let c=y.get(a.source),i=y.get(a.target),w=N.nodes.find((z)=>z.id===a.target).isPipelineParent?L/Math.sqrt(2):n.nodeRadius,P=c.x-i.x,M=c.y-i.y,C=Math.sqrt(P*P+M*M);return i.x+P/C*w}).attr("y2",(a)=>{let c=y.get(a.source),i=y.get(a.target),w=N.nodes.find((z)=>z.id===a.target).isPipelineParent?L/Math.sqrt(2):n.nodeRadius,P=c.x-i.x,M=c.y-i.y,C=Math.sqrt(P*P+M*M);return i.y+M/C*w}).attr("stroke",x.linkStroke).attr("stroke-width",1).attr("stroke-dasharray",(a)=>a.dashed?"6 6":null).attr("marker-end",(a)=>{if(a.flow==="forward"||a.flow==="bidirectional")return`url(#link-arrow-end-${l})`;return null}).attr("marker-start",(a)=>{if(a.flow==="backward"||a.flow==="bidirectional")return`url(#link-arrow-start-${l})`;return null}),lt.selectAll("text").data(pt.filter((a)=>a.label)).enter().append("text").attr("class","wardley-link-label").attr("x",(a)=>{let c=y.get(a.source),i=y.get(a.target),h=(c.x+i.x)/2,w=i.y-c.y,P=i.x-c.x,M=Math.sqrt(P*P+w*w),C=8,z=w/M;return h+z*8}).attr("y",(a)=>{let c=y.get(a.source),i=y.get(a.target),h=(c.y+i.y)/2,w=i.x-c.x,P=i.y-c.y,M=Math.sqrt(w*w+P*P),C=8,z=-w/M;return h+z*8}).attr("fill",x.axisTextColor).attr("font-size",n.labelFontSize).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("transform",(a)=>{let c=y.get(a.source),i=y.get(a.target),h=(c.x+i.x)/2,w=(c.y+i.y)/2,P=i.x-c.x,M=i.y-c.y,C=Math.sqrt(P*P+M*M),z=8,T=M/C,I=-P/C,G=h+T*8,rt=w+I*8,U=Math.atan2(M,P)*180/Math.PI;if(U>90||U<-90)U+=180;return`rotate(${U} ${G} ${rt})`}).text((a)=>a.label);let At=Y.append("g").attr("class","wardley-trends"),Xt=N.trends.map((a)=>{let c=y.get(a.nodeId);if(!c)return null;let i=q(a.targetX),h=V(a.targetY),w=i-c.x,P=h-c.y,M=Math.sqrt(w*w+P*P),C=n.nodeRadius+2,z=M>C?i-w/M*C:i,T=M>C?h-P/M*C:h;return{origin:c,targetX:i,targetY:h,adjustedX2:z,adjustedY2:T}}).filter((a)=>a!==null);At.selectAll("line").data(Xt).enter().append("line").attr("class","wardley-trend").attr("x1",(a)=>a.origin.x).attr("y1",(a)=>a.origin.y).attr("x2",(a)=>a.adjustedX2).attr("y2",(a)=>a.adjustedY2).attr("stroke",x.evolutionStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4").attr("marker-end",`url(#arrow-${l})`);let O=Y.append("g").attr("class","wardley-nodes").selectAll("g").data(N.nodes).enter().append("g").attr("class",(a)=>["wardley-node",a.className?`wardley-node--${a.className}`:""].filter(Boolean).join(" "));O.filter((a)=>a.sourceStrategy==="outsource").append("circle").attr("class","wardley-outsource-overlay").attr("cx",(a)=>y.get(a.id).x).attr("cy",(a)=>y.get(a.id).y).attr("r",n.nodeRadius*2).attr("fill","#666").attr("stroke",x.componentStroke).attr("stroke-width",1),O.filter((a)=>a.sourceStrategy==="buy").append("circle").attr("class","wardley-buy-overlay").attr("cx",(a)=>y.get(a.id).x).attr("cy",(a)=>y.get(a.id).y).attr("r",n.nodeRadius*2).attr("fill","#ccc").attr("stroke",x.componentStroke).attr("stroke-width",1),O.filter((a)=>a.sourceStrategy==="build").append("circle").attr("class","wardley-build-overlay").attr("cx",(a)=>y.get(a.id).x).attr("cy",(a)=>y.get(a.id).y).attr("r",n.nodeRadius*2).attr("fill","#eee").attr("stroke","#000").attr("stroke-width",1);let _=O.filter((a)=>a.sourceStrategy==="market");_.append("circle").attr("class","wardley-market-overlay").attr("cx",(a)=>y.get(a.id).x).attr("cy",(a)=>y.get(a.id).y).attr("r",n.nodeRadius*2).attr("fill","white").attr("stroke",x.componentStroke).attr("stroke-width",1),O.filter((a)=>!a.isPipelineParent&&a.sourceStrategy!=="market"&&a.className!=="anchor").append("circle").attr("cx",(a)=>y.get(a.id).x).attr("cy",(a)=>y.get(a.id).y).attr("r",n.nodeRadius).attr("fill",x.componentFill).attr("stroke",x.componentStroke).attr("stroke-width",1);let it=n.nodeRadius*0.7,H=n.nodeRadius*1.2;if(_.append("line").attr("class","wardley-market-line").attr("x1",(a)=>y.get(a.id).x).attr("y1",(a)=>y.get(a.id).y-H).attr("x2",(a)=>y.get(a.id).x-H*Math.cos(Math.PI/6)).attr("y2",(a)=>y.get(a.id).y+H*Math.sin(Math.PI/6)).attr("stroke",x.componentStroke).attr("stroke-width",1),_.append("line").attr("class","wardley-market-line").attr("x1",(a)=>y.get(a.id).x-H*Math.cos(Math.PI/6)).attr("y1",(a)=>y.get(a.id).y+H*Math.sin(Math.PI/6)).attr("x2",(a)=>y.get(a.id).x+H*Math.cos(Math.PI/6)).attr("y2",(a)=>y.get(a.id).y+H*Math.sin(Math.PI/6)).attr("stroke",x.componentStroke).attr("stroke-width",1),_.append("line").attr("class","wardley-market-line").attr("x1",(a)=>y.get(a.id).x+H*Math.cos(Math.PI/6)).attr("y1",(a)=>y.get(a.id).y+H*Math.sin(Math.PI/6)).attr("x2",(a)=>y.get(a.id).x).attr("y2",(a)=>y.get(a.id).y-H).attr("stroke",x.componentStroke).attr("stroke-width",1),_.append("circle").attr("class","wardley-market-dot").attr("cx",(a)=>y.get(a.id).x).attr("cy",(a)=>y.get(a.id).y-H).attr("r",it).attr("fill","white").attr("stroke",x.componentStroke).attr("stroke-width",2),_.append("circle").attr("class","wardley-market-dot").attr("cx",(a)=>y.get(a.id).x-H*Math.cos(Math.PI/6)).attr("cy",(a)=>y.get(a.id).y+H*Math.sin(Math.PI/6)).attr("r",it).attr("fill","white").attr("stroke",x.componentStroke).attr("stroke-width",2),_.append("circle").attr("class","wardley-market-dot").attr("cx",(a)=>y.get(a.id).x+H*Math.cos(Math.PI/6)).attr("cy",(a)=>y.get(a.id).y+H*Math.sin(Math.PI/6)).attr("r",it).attr("fill","white").attr("stroke",x.componentStroke).attr("stroke-width",2),O.filter((a)=>a.isPipelineParent===!0).append("rect").attr("x",(a)=>y.get(a.id).x-L/2).attr("y",(a)=>y.get(a.id).y-L/2).attr("width",L).attr("height",L).attr("fill",x.componentFill).attr("stroke",x.componentStroke).attr("stroke-width",1),O.filter((a)=>a.inertia===!0).append("line").attr("class","wardley-inertia").attr("x1",(a)=>{let c=y.get(a.id),i=a.isPipelineParent?L/2+15:n.nodeRadius+15;if(a.sourceStrategy)i+=n.nodeRadius+10;return c.x+i}).attr("y1",(a)=>{let c=y.get(a.id),i=a.isPipelineParent?L:n.nodeRadius*2;return c.y-i/2}).attr("x2",(a)=>{let c=y.get(a.id),i=a.isPipelineParent?L/2+15:n.nodeRadius+15;if(a.sourceStrategy)i+=n.nodeRadius+10;return c.x+i}).attr("y2",(a)=>{let c=y.get(a.id),i=a.isPipelineParent?L:n.nodeRadius*2;return c.y+i/2}).attr("stroke",x.componentStroke).attr("stroke-width",6),O.append("text").attr("x",(a)=>{let c=y.get(a.id);if(a.className==="anchor")return a.labelOffsetX!==void 0?c.x+a.labelOffsetX:c.x;let i=n.nodeLabelOffset;if(a.sourceStrategy&&a.labelOffsetX===void 0)i+=10;let h=a.labelOffsetX??i;return c.x+h}).attr("y",(a)=>{let c=y.get(a.id);if(a.className==="anchor")return a.labelOffsetY!==void 0?c.y+a.labelOffsetY:c.y-3;let i=-n.nodeLabelOffset;if(a.sourceStrategy&&a.labelOffsetY===void 0)i-=10;let h=a.labelOffsetY??i;return c.y+h}).attr("class","wardley-node-label").attr("fill",(a)=>{if(a.className==="evolved")return x.evolutionStroke;if(a.className==="anchor")return"#000";return x.componentLabelColor}).attr("font-size",n.labelFontSize).attr("font-weight",(a)=>a.className==="anchor"?"bold":"normal").attr("text-anchor",(a)=>a.className==="anchor"?"middle":"start").attr("dominant-baseline",(a)=>a.className==="anchor"?"middle":"auto").text((a)=>a.label),N.annotations.length>0){let a=Y.append("g").attr("class","wardley-annotations");if(N.annotations.forEach((c)=>{let i=c.coordinates.map((h)=>({x:q(h.x),y:V(h.y)}));if(i.length>1)for(let h=0;h<i.length-1;h++)a.append("line").attr("class","wardley-annotation-line").attr("x1",i[h].x).attr("y1",i[h].y).attr("x2",i[h+1].x).attr("y2",i[h+1].y).attr("stroke",x.axisColor).attr("stroke-width",1.5).attr("stroke-dasharray","4 4");i.forEach((h)=>{let w=a.append("g").attr("class","wardley-annotation");w.append("circle").attr("cx",h.x).attr("cy",h.y).attr("r",10).attr("fill","white").attr("stroke",x.axisColor).attr("stroke-width",1.5),w.append("text").attr("x",h.x).attr("y",h.y).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",10).attr("fill",x.axisTextColor).attr("font-weight","bold").text(c.number)})}),N.annotationsBox){let c=q(N.annotationsBox.x),i=V(N.annotationsBox.y),h=10,w=16,P=11,M=a.append("g").attr("class","wardley-annotations-box"),C=[...N.annotations].filter((T)=>T.text).sort((T,I)=>T.number-I.number),z=[];if(C.forEach((T,I)=>{let G=M.append("text").attr("x",c+h).attr("y",i+h+(I+1)*w).attr("font-size",P).attr("fill",x.axisTextColor).attr("text-anchor","start").attr("dominant-baseline","middle").text(`${T.number}. ${T.text}`);z.push(G)}),z.length>0){let T=0,I=0;z.forEach((dt)=>{let ot=dt.node(),It=ot.getComputedTextLength();T=Math.max(T,It);let Bt=ot.getBBox();I=Math.max(I,Bt.height)});let G=T+h*2+105,rt=C.length*w+h*2+I/2,U=n.padding,Et=F-n.padding-G,Ht=n.padding,Yt=X-n.padding-rt;c=Math.max(U,Math.min(c,Et)),i=Math.max(Ht,Math.min(i,Yt)),z.forEach((dt,ot)=>{dt.attr("x",c+h).attr("y",i+h+(ot+1)*w)}),M.insert("rect","text").attr("x",c).attr("y",i).attr("width",G).attr("height",rt).attr("fill","white").attr("stroke",x.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}}}if(N.notes.length>0){let a=Y.append("g").attr("class","wardley-notes");N.notes.forEach((c)=>{let i=q(c.x),h=V(c.y);a.append("text").attr("x",i).attr("y",h).attr("text-anchor","start").attr("font-size",11).attr("fill",x.axisTextColor).attr("font-weight","bold").text(c.text)})}if(N.accelerators.length>0){let a=Y.append("g").attr("class","wardley-accelerators");N.accelerators.forEach((c)=>{let i=q(c.x),h=V(c.y),w=60,P=30,M=20,C=`
1
+ import{R}from"./index-5n03dmb9.js";import{e,t,j,u,T,d,f,p,m,g,b,v,r,A,E}from"./index-nwsya6dj.js";import"./index-v119nznk.js";import{D}from"./index-zx0j3a2z.js";var nt=e((o,l)=>{let s=o<=1?o*100:o;if(s<0||s>100)throw Error(`${l} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${o}`);return s},"toPercent"),Z=e((o,l,s)=>({x:nt(l,`${s} evolution`),y:nt(o,`${s} visibility`)}),"toCoordinates"),ht=e((o)=>{if(!o)return;if(o==="+<>")return"bidirectional";if(o==="+<")return"backward";if(o==="+>")return"forward";return},"getFlowFromPort"),Ft=e((o)=>{if(!o?.startsWith("+"))return{};let s=/^\+'([^']*)'/.exec(o)?.[1];if(o.includes("<>"))return{flow:"bidirectional",label:s};if(o.includes("<"))return{flow:"backward",label:s};if(o.includes(">"))return{flow:"forward",label:s};return{label:s}},"extractFlowFromArrow"),Rt=e((o,l)=>{if(R(o,l),o.size)l.setSize(o.size.width,o.size.height);if(o.evolution){let s=o.evolution.stages.map((n)=>{if(n.secondName)return`${n.name.trim()} / ${n.secondName.trim()}`;return n.name.trim()}),C=o.evolution.stages.filter((n)=>n.boundary!==void 0).map((n)=>n.boundary);l.updateAxes({stages:s,stageBoundaries:C})}if(o.anchors.forEach((s)=>{let C=Z(s.visibility,s.evolution,`Anchor "${s.name}"`);l.addNode(s.name,s.name,C.x,C.y,"anchor")}),o.components.forEach((s)=>{let C=Z(s.visibility,s.evolution,`Component "${s.name}"`),n=s.label?(s.label.negX?-1:1)*s.label.offsetX:void 0,x=s.label?(s.label.negY?-1:1)*s.label.offsetY:void 0,z=s.decorator?.strategy;l.addNode(s.name,s.name,C.x,C.y,"component",n,x,s.inertia,z)}),o.notes.forEach((s)=>{let C=Z(s.visibility,s.evolution,`Note "${s.text}"`);l.addNote(s.text,C.x,C.y)}),o.pipelines.forEach((s)=>{let C=l.getNode(s.parent);if(!C||typeof C.y!=="number")throw Error(`Pipeline "${s.parent}" must reference an existing component with coordinates.`);let n=C.y;l.startPipeline(s.parent),s.components.forEach((x)=>{let z=`${s.parent}_${x.name}`,B=x.label?(x.label.negX?-1:1)*x.label.offsetX:void 0,M=x.label?(x.label.negY?-1:1)*x.label.offsetY:void 0,et=nt(x.evolution,`Pipeline component "${x.name}" evolution`);l.addNode(z,x.name,et,n,"pipeline-component",B,M),l.addPipelineComponent(s.parent,z)})}),o.links.forEach((s)=>{let C=!!s.arrow&&(s.arrow.includes("-.->")||s.arrow.includes(".-.")),n=ht(s.fromPort)??ht(s.toPort),{flow:x,label:z}=Ft(s.arrow);if(!n&&x)n=x;let B=s.linkLabel,M=z??B;l.addLink(l.resolveNodeId(s.from),l.resolveNodeId(s.to),C,M,n)}),o.evolves.forEach((s)=>{let C=l.getNode(s.component);if(C?.y!==void 0){let n=nt(s.target,`Evolve target for "${s.component}"`);l.addTrend(s.component,n,C.y)}}),o.annotations.length>0){let s=o.annotations[0],C=Z(s.x,s.y,"Annotations box");l.setAnnotationsBox(C.x,C.y)}o.annotation.forEach((s)=>{let C=Z(s.x,s.y,`Annotation ${s.number}`);l.addAnnotation(s.number,[{x:C.x,y:C.y}],s.text)}),o.accelerators.forEach((s)=>{let C=Z(s.x,s.y,`Accelerator "${s.name}"`);l.addAccelerator(s.name,C.x,C.y)}),o.deaccelerators.forEach((s)=>{let C=Z(s.x,s.y,`Deaccelerator "${s.name}"`);l.addDeaccelerator(s.name,C.x,C.y)})},"populateDb"),ft={parser:{yy:void 0},parse:e(async(o)=>{let l=await D("wardley",o);t.debug(l);let s=ft.parser?.yy;if(!s||typeof s.addNode!=="function")throw Error("parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Rt(l,s)},"parse")},Ot=class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}static{e(this,"WardleyBuilder")}addNode(o){let l=this.nodes.get(o.id)??{id:o.id,label:o.label},s={...l,...o,className:o.className??l.className,labelOffsetX:o.labelOffsetX??l.labelOffsetX,labelOffsetY:o.labelOffsetY??l.labelOffsetY};this.nodes.set(o.id,s)}addLink(o){this.links.push(o)}addTrend(o){this.trends.set(o.nodeId,o)}startPipeline(o){this.pipelines.set(o,{nodeId:o,componentIds:[]});let l=this.nodes.get(o);if(l)l.isPipelineParent=!0}addPipelineComponent(o,l){let s=this.pipelines.get(o);if(s)s.componentIds.push(l);let C=this.nodes.get(l);if(C)C.inPipeline=!0}addAnnotation(o){this.annotations.push(o)}addNote(o){this.notes.push(o)}addAccelerator(o){this.accelerators.push(o)}addDeaccelerator(o){this.deaccelerators.push(o)}setAnnotationsBox(o,l){this.annotationsBox={x:o,y:l}}setAxes(o){this.axes={...this.axes,...o}}setSize(o,l){this.size={width:o,height:l}}getNode(o){return this.nodes.get(o)}resolveNodeId(o){if(this.nodes.has(o))return o;for(let[l,s]of this.nodes)if(s.label===o)return l;return o}build(){let o=[];for(let l of this.nodes.values()){if(typeof l.x!=="number"||typeof l.y!=="number")throw Error(`Node "${l.label}" is missing coordinates`);o.push(l)}return{nodes:o,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}},W=new Ot;function xt(){return r()["wardley-beta"]}e(xt,"getConfig");function gt(o,l,s,C,n,x,z,B,M){W.addNode({id:o,label:l,x:s,y:C,className:n,labelOffsetX:x,labelOffsetY:z,inertia:B,sourceStrategy:M})}e(gt,"addNode");function yt(o,l,s=!1,C,n){W.addLink({source:o,target:l,dashed:s,label:C,flow:n})}e(yt,"addLink");function ut(o,l,s){W.addTrend({nodeId:o,targetX:l,targetY:s})}e(ut,"addTrend");function wt(o,l,s){W.addAnnotation({number:o,coordinates:l,text:s})}e(wt,"addAnnotation");function mt(o,l,s){W.addNote({text:o,x:l,y:s})}e(mt,"addNote");function kt(o,l,s){W.addAccelerator({name:o,x:l,y:s})}e(kt,"addAccelerator");function bt(o,l,s){W.addDeaccelerator({name:o,x:l,y:s})}e(bt,"addDeaccelerator");function $t(o,l){W.setAnnotationsBox(o,l)}e($t,"setAnnotationsBox");function vt(o,l){W.setSize(o,l)}e(vt,"setSize");function Pt(o){W.startPipeline(o)}e(Pt,"startPipeline");function Ct(o,l){W.addPipelineComponent(o,l)}e(Ct,"addPipelineComponent");function St(o){W.setAxes(o)}e(St,"updateAxes");function Mt(o){return W.getNode(o)}e(Mt,"getNode");function Nt(o){return W.resolveNodeId(o)}e(Nt,"resolveNodeId");function zt(){return W.build()}e(zt,"getWardleyData");function Lt(){W.clear(),d()}e(Lt,"clear");var Dt={getConfig:xt,addNode:gt,addLink:yt,addTrend:ut,addAnnotation:wt,addNote:mt,addAccelerator:kt,addDeaccelerator:bt,setAnnotationsBox:$t,setSize:vt,startPipeline:Pt,addPipelineComponent:Ct,updateAxes:St,getNode:Mt,resolveNodeId:Nt,getWardleyData:zt,clear:Lt,setAccTitle:f,getAccTitle:p,setDiagramTitle:b,getDiagramTitle:v,getAccDescription:g,setAccDescription:m},Gt=["Genesis","Custom Built","Product","Commodity"],qt=e(()=>{let{themeVariables:o}=r();return{backgroundColor:o.wardley?.backgroundColor??o.background??"#fff",axisColor:o.wardley?.axisColor??"#000",axisTextColor:o.wardley?.axisTextColor??o.primaryTextColor??"#222",gridColor:o.wardley?.gridColor??"rgba(100, 100, 100, 0.2)",componentFill:o.wardley?.componentFill??"#fff",componentStroke:o.wardley?.componentStroke??"#000",componentLabelColor:o.wardley?.componentLabelColor??o.primaryTextColor??"#222",linkStroke:o.wardley?.linkStroke??"#000",evolutionStroke:o.wardley?.evolutionStroke??"#dc3545",annotationStroke:o.wardley?.annotationStroke??"#000",annotationTextColor:o.wardley?.annotationTextColor??o.primaryTextColor??"#222",annotationFill:o.wardley?.annotationFill??o.background??"#fff"}},"getTheme"),jt=e(()=>{let o=r()["wardley-beta"];return{width:o?.width??900,height:o?.height??600,padding:o?.padding??48,nodeRadius:o?.nodeRadius??6,nodeLabelOffset:o?.nodeLabelOffset??8,axisFontSize:o?.axisFontSize??12,labelFontSize:o?.labelFontSize??10,showGrid:o?.showGrid??!1,useMaxWidth:o?.useMaxWidth??!0}},"getConfigValues"),Vt=e((o,l,s,C)=>{t.debug(`Rendering Wardley map
2
+ `+o);let n=jt(),x=qt(),z=n.nodeRadius*1.6,B=C.db,M=B.getWardleyData(),et=B.getDiagramTitle(),F=M.size?.width??n.width,X=M.size?.height??n.height,J=A(l);J.selectAll("*").remove(),T(J,X,F,n.useMaxWidth),J.attr("viewBox",`0 0 ${F} ${X}`);let Y=J.append("g").attr("class","wardley-map"),st=J.append("defs");st.append("marker").attr("id",`arrow-${l}`).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("fill",x.evolutionStroke).attr("stroke","none"),st.append("marker").attr("id",`link-arrow-end-${l}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",x.linkStroke).attr("stroke","none"),st.append("marker").attr("id",`link-arrow-start-${l}`).attr("viewBox","0 0 10 10").attr("refX",1).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z").attr("fill",x.linkStroke).attr("stroke","none"),Y.append("rect").attr("class","wardley-background").attr("width",F).attr("height",X).attr("fill",x.backgroundColor);let K=F-n.padding*2,Q=X-n.padding*2;if(et)Y.append("text").attr("class","wardley-title").attr("x",F/2).attr("y",n.padding/2).attr("fill",x.axisTextColor).attr("font-size",n.axisFontSize*1.05).attr("font-weight","bold").attr("text-anchor","middle").attr("dominant-baseline","middle").text(et);let q=e((a)=>n.padding+a/100*K,"projectX"),V=e((a)=>X-n.padding-a/100*Q,"projectY"),at=Y.append("g").attr("class","wardley-axes");at.append("line").attr("x1",n.padding).attr("x2",F-n.padding).attr("y1",X-n.padding).attr("y2",X-n.padding).attr("stroke",x.axisColor).attr("stroke-width",1),at.append("line").attr("x1",n.padding).attr("x2",n.padding).attr("y1",n.padding).attr("y2",X-n.padding).attr("stroke",x.axisColor).attr("stroke-width",1);let Tt=M.axes.xLabel??"Evolution",Wt=M.axes.yLabel??"Visibility";at.append("text").attr("class","wardley-axis-label wardley-axis-label-x").attr("x",n.padding+K/2).attr("y",X-n.padding/4).attr("fill",x.axisTextColor).attr("font-size",n.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").text(Tt),at.append("text").attr("class","wardley-axis-label wardley-axis-label-y").attr("x",n.padding/3).attr("y",n.padding+Q/2).attr("fill",x.axisTextColor).attr("font-size",n.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").attr("transform",`rotate(-90 ${n.padding/3} ${n.padding+Q/2})`).text(Wt);let tt=M.axes.stages&&M.axes.stages.length>0?M.axes.stages:Gt;if(tt.length>0){let a=Y.append("g").attr("class","wardley-stages"),c=M.axes.stageBoundaries,i=[];if(c&&c.length===tt.length){let h=0;c.forEach((w)=>{i.push({start:h,end:w}),h=w})}else{let h=1/tt.length;tt.forEach((w,k)=>{i.push({start:k*h,end:(k+1)*h})})}tt.forEach((h,w)=>{let k=i[w],S=n.padding+k.start*K,P=n.padding+k.end*K,N=(S+P)/2;if(w>0)a.append("line").attr("x1",S).attr("x2",S).attr("y1",n.padding).attr("y2",X-n.padding).attr("stroke","#000").attr("stroke-width",1).attr("stroke-dasharray","5 5").attr("opacity",0.8);a.append("text").attr("class","wardley-stage-label").attr("x",N).attr("y",X-n.padding/1.5).attr("fill",x.axisTextColor).attr("font-size",n.axisFontSize-2).attr("text-anchor","middle").text(h)})}if(n.showGrid){let a=Y.append("g").attr("class","wardley-grid");for(let c=1;c<4;c++){let i=c/4,h=n.padding+K*i;a.append("line").attr("x1",h).attr("x2",h).attr("y1",n.padding).attr("y2",X-n.padding).attr("stroke",x.gridColor).attr("stroke-dasharray","2 6"),a.append("line").attr("x1",n.padding).attr("x2",F-n.padding).attr("y1",X-n.padding-Q*i).attr("y2",X-n.padding-Q*i).attr("stroke",x.gridColor).attr("stroke-dasharray","2 6")}}let y=new Map;if(M.nodes.forEach((a)=>{y.set(a.id,{x:q(a.x),y:V(a.y),node:a})}),M.pipelines.length>0){let a=Y.append("g").attr("class","wardley-pipelines"),c=Y.append("g").attr("class","wardley-pipeline-links");M.pipelines.forEach((i)=>{if(i.componentIds.length===0)return;let h=i.componentIds.map((P)=>({id:P,pos:y.get(P),node:M.nodes.find((N)=>N.id===P)})).filter((P)=>P.pos&&P.node).sort((P,N)=>P.node.x-N.node.x);for(let P=0;P<h.length-1;P++){let N=h[P],L=h[P+1];c.append("line").attr("class","wardley-pipeline-evolution-link").attr("x1",N.pos.x).attr("y1",N.pos.y).attr("x2",L.pos.x).attr("y2",L.pos.y).attr("stroke",x.linkStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4")}let w=1/0,k=-1/0,S=0;if(i.componentIds.forEach((P)=>{let N=y.get(P);if(N)w=Math.min(w,N.x),k=Math.max(k,N.x),S=N.y}),w!==1/0&&k!==-1/0){let N=n.nodeRadius*4,L=S-N/2,I=y.get(i.nodeId);if(I){let G=(w+k)/2;I.x=G,I.y=L-z/6}a.append("rect").attr("class","wardley-pipeline-box").attr("x",w-15).attr("y",L).attr("width",k-w+30).attr("height",N).attr("fill","none").attr("stroke",x.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}})}let lt=Y.append("g").attr("class","wardley-links"),ct=new Map;M.pipelines.forEach((a)=>{ct.set(a.nodeId,new Set(a.componentIds))});let pt=M.links.filter((a)=>{if(!y.has(a.source)||!y.has(a.target))return!1;if(ct.get(a.target)?.has(a.source))return!1;return!0});lt.selectAll("line").data(pt).enter().append("line").attr("class",(a)=>`wardley-link${a.dashed?" wardley-link--dashed":""}`).attr("x1",(a)=>{let c=y.get(a.source),i=y.get(a.target),w=M.nodes.find((N)=>N.id===a.source).isPipelineParent?z/Math.sqrt(2):n.nodeRadius,k=i.x-c.x,S=i.y-c.y,P=Math.sqrt(k*k+S*S);return c.x+k/P*w}).attr("y1",(a)=>{let c=y.get(a.source),i=y.get(a.target),w=M.nodes.find((N)=>N.id===a.source).isPipelineParent?z/Math.sqrt(2):n.nodeRadius,k=i.x-c.x,S=i.y-c.y,P=Math.sqrt(k*k+S*S);return c.y+S/P*w}).attr("x2",(a)=>{let c=y.get(a.source),i=y.get(a.target),w=M.nodes.find((N)=>N.id===a.target).isPipelineParent?z/Math.sqrt(2):n.nodeRadius,k=c.x-i.x,S=c.y-i.y,P=Math.sqrt(k*k+S*S);return i.x+k/P*w}).attr("y2",(a)=>{let c=y.get(a.source),i=y.get(a.target),w=M.nodes.find((N)=>N.id===a.target).isPipelineParent?z/Math.sqrt(2):n.nodeRadius,k=c.x-i.x,S=c.y-i.y,P=Math.sqrt(k*k+S*S);return i.y+S/P*w}).attr("stroke",x.linkStroke).attr("stroke-width",1).attr("stroke-dasharray",(a)=>a.dashed?"6 6":null).attr("marker-end",(a)=>{if(a.flow==="forward"||a.flow==="bidirectional")return`url(#link-arrow-end-${l})`;return null}).attr("marker-start",(a)=>{if(a.flow==="backward"||a.flow==="bidirectional")return`url(#link-arrow-start-${l})`;return null}),lt.selectAll("text").data(pt.filter((a)=>a.label)).enter().append("text").attr("class","wardley-link-label").attr("x",(a)=>{let c=y.get(a.source),i=y.get(a.target),h=(c.x+i.x)/2,w=i.y-c.y,k=i.x-c.x,S=Math.sqrt(k*k+w*w),P=8,N=w/S;return h+N*8}).attr("y",(a)=>{let c=y.get(a.source),i=y.get(a.target),h=(c.y+i.y)/2,w=i.x-c.x,k=i.y-c.y,S=Math.sqrt(w*w+k*k),P=8,N=-w/S;return h+N*8}).attr("fill",x.axisTextColor).attr("font-size",n.labelFontSize).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("transform",(a)=>{let c=y.get(a.source),i=y.get(a.target),h=(c.x+i.x)/2,w=(c.y+i.y)/2,k=i.x-c.x,S=i.y-c.y,P=Math.sqrt(k*k+S*S),N=8,L=S/P,I=-k/P,G=h+L*8,rt=w+I*8,U=Math.atan2(S,k)*180/Math.PI;if(U>90||U<-90)U+=180;return`rotate(${U} ${G} ${rt})`}).text((a)=>a.label);let At=Y.append("g").attr("class","wardley-trends"),Xt=M.trends.map((a)=>{let c=y.get(a.nodeId);if(!c)return null;let i=q(a.targetX),h=V(a.targetY),w=i-c.x,k=h-c.y,S=Math.sqrt(w*w+k*k),P=n.nodeRadius+2,N=S>P?i-w/S*P:i,L=S>P?h-k/S*P:h;return{origin:c,targetX:i,targetY:h,adjustedX2:N,adjustedY2:L}}).filter((a)=>a!==null);At.selectAll("line").data(Xt).enter().append("line").attr("class","wardley-trend").attr("x1",(a)=>a.origin.x).attr("y1",(a)=>a.origin.y).attr("x2",(a)=>a.adjustedX2).attr("y2",(a)=>a.adjustedY2).attr("stroke",x.evolutionStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4").attr("marker-end",`url(#arrow-${l})`);let O=Y.append("g").attr("class","wardley-nodes").selectAll("g").data(M.nodes).enter().append("g").attr("class",(a)=>["wardley-node",a.className?`wardley-node--${a.className}`:""].filter(Boolean).join(" "));O.filter((a)=>a.sourceStrategy==="outsource").append("circle").attr("class","wardley-outsource-overlay").attr("cx",(a)=>y.get(a.id).x).attr("cy",(a)=>y.get(a.id).y).attr("r",n.nodeRadius*2).attr("fill","#666").attr("stroke",x.componentStroke).attr("stroke-width",1),O.filter((a)=>a.sourceStrategy==="buy").append("circle").attr("class","wardley-buy-overlay").attr("cx",(a)=>y.get(a.id).x).attr("cy",(a)=>y.get(a.id).y).attr("r",n.nodeRadius*2).attr("fill","#ccc").attr("stroke",x.componentStroke).attr("stroke-width",1),O.filter((a)=>a.sourceStrategy==="build").append("circle").attr("class","wardley-build-overlay").attr("cx",(a)=>y.get(a.id).x).attr("cy",(a)=>y.get(a.id).y).attr("r",n.nodeRadius*2).attr("fill","#eee").attr("stroke","#000").attr("stroke-width",1);let _=O.filter((a)=>a.sourceStrategy==="market");_.append("circle").attr("class","wardley-market-overlay").attr("cx",(a)=>y.get(a.id).x).attr("cy",(a)=>y.get(a.id).y).attr("r",n.nodeRadius*2).attr("fill","white").attr("stroke",x.componentStroke).attr("stroke-width",1),O.filter((a)=>!a.isPipelineParent&&a.sourceStrategy!=="market"&&a.className!=="anchor").append("circle").attr("cx",(a)=>y.get(a.id).x).attr("cy",(a)=>y.get(a.id).y).attr("r",n.nodeRadius).attr("fill",x.componentFill).attr("stroke",x.componentStroke).attr("stroke-width",1);let it=n.nodeRadius*0.7,H=n.nodeRadius*1.2;if(_.append("line").attr("class","wardley-market-line").attr("x1",(a)=>y.get(a.id).x).attr("y1",(a)=>y.get(a.id).y-H).attr("x2",(a)=>y.get(a.id).x-H*Math.cos(Math.PI/6)).attr("y2",(a)=>y.get(a.id).y+H*Math.sin(Math.PI/6)).attr("stroke",x.componentStroke).attr("stroke-width",1),_.append("line").attr("class","wardley-market-line").attr("x1",(a)=>y.get(a.id).x-H*Math.cos(Math.PI/6)).attr("y1",(a)=>y.get(a.id).y+H*Math.sin(Math.PI/6)).attr("x2",(a)=>y.get(a.id).x+H*Math.cos(Math.PI/6)).attr("y2",(a)=>y.get(a.id).y+H*Math.sin(Math.PI/6)).attr("stroke",x.componentStroke).attr("stroke-width",1),_.append("line").attr("class","wardley-market-line").attr("x1",(a)=>y.get(a.id).x+H*Math.cos(Math.PI/6)).attr("y1",(a)=>y.get(a.id).y+H*Math.sin(Math.PI/6)).attr("x2",(a)=>y.get(a.id).x).attr("y2",(a)=>y.get(a.id).y-H).attr("stroke",x.componentStroke).attr("stroke-width",1),_.append("circle").attr("class","wardley-market-dot").attr("cx",(a)=>y.get(a.id).x).attr("cy",(a)=>y.get(a.id).y-H).attr("r",it).attr("fill","white").attr("stroke",x.componentStroke).attr("stroke-width",2),_.append("circle").attr("class","wardley-market-dot").attr("cx",(a)=>y.get(a.id).x-H*Math.cos(Math.PI/6)).attr("cy",(a)=>y.get(a.id).y+H*Math.sin(Math.PI/6)).attr("r",it).attr("fill","white").attr("stroke",x.componentStroke).attr("stroke-width",2),_.append("circle").attr("class","wardley-market-dot").attr("cx",(a)=>y.get(a.id).x+H*Math.cos(Math.PI/6)).attr("cy",(a)=>y.get(a.id).y+H*Math.sin(Math.PI/6)).attr("r",it).attr("fill","white").attr("stroke",x.componentStroke).attr("stroke-width",2),O.filter((a)=>a.isPipelineParent===!0).append("rect").attr("x",(a)=>y.get(a.id).x-z/2).attr("y",(a)=>y.get(a.id).y-z/2).attr("width",z).attr("height",z).attr("fill",x.componentFill).attr("stroke",x.componentStroke).attr("stroke-width",1),O.filter((a)=>a.inertia===!0).append("line").attr("class","wardley-inertia").attr("x1",(a)=>{let c=y.get(a.id),i=a.isPipelineParent?z/2+15:n.nodeRadius+15;if(a.sourceStrategy)i+=n.nodeRadius+10;return c.x+i}).attr("y1",(a)=>{let c=y.get(a.id),i=a.isPipelineParent?z:n.nodeRadius*2;return c.y-i/2}).attr("x2",(a)=>{let c=y.get(a.id),i=a.isPipelineParent?z/2+15:n.nodeRadius+15;if(a.sourceStrategy)i+=n.nodeRadius+10;return c.x+i}).attr("y2",(a)=>{let c=y.get(a.id),i=a.isPipelineParent?z:n.nodeRadius*2;return c.y+i/2}).attr("stroke",x.componentStroke).attr("stroke-width",6),O.append("text").attr("x",(a)=>{let c=y.get(a.id);if(a.className==="anchor")return a.labelOffsetX!==void 0?c.x+a.labelOffsetX:c.x;let i=n.nodeLabelOffset;if(a.sourceStrategy&&a.labelOffsetX===void 0)i+=10;let h=a.labelOffsetX??i;return c.x+h}).attr("y",(a)=>{let c=y.get(a.id);if(a.className==="anchor")return a.labelOffsetY!==void 0?c.y+a.labelOffsetY:c.y-3;let i=-n.nodeLabelOffset;if(a.sourceStrategy&&a.labelOffsetY===void 0)i-=10;let h=a.labelOffsetY??i;return c.y+h}).attr("class","wardley-node-label").attr("fill",(a)=>{if(a.className==="evolved")return x.evolutionStroke;if(a.className==="anchor")return"#000";return x.componentLabelColor}).attr("font-size",n.labelFontSize).attr("font-weight",(a)=>a.className==="anchor"?"bold":"normal").attr("text-anchor",(a)=>a.className==="anchor"?"middle":"start").attr("dominant-baseline",(a)=>a.className==="anchor"?"middle":"auto").text((a)=>a.label),M.annotations.length>0){let a=Y.append("g").attr("class","wardley-annotations");if(M.annotations.forEach((c)=>{let i=c.coordinates.map((h)=>({x:q(h.x),y:V(h.y)}));if(i.length>1)for(let h=0;h<i.length-1;h++)a.append("line").attr("class","wardley-annotation-line").attr("x1",i[h].x).attr("y1",i[h].y).attr("x2",i[h+1].x).attr("y2",i[h+1].y).attr("stroke",x.axisColor).attr("stroke-width",1.5).attr("stroke-dasharray","4 4");i.forEach((h)=>{let w=a.append("g").attr("class","wardley-annotation");w.append("circle").attr("cx",h.x).attr("cy",h.y).attr("r",10).attr("fill","white").attr("stroke",x.axisColor).attr("stroke-width",1.5),w.append("text").attr("x",h.x).attr("y",h.y).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",10).attr("fill",x.axisTextColor).attr("font-weight","bold").text(c.number)})}),M.annotationsBox){let c=q(M.annotationsBox.x),i=V(M.annotationsBox.y),h=10,w=16,k=11,S=a.append("g").attr("class","wardley-annotations-box"),P=[...M.annotations].filter((L)=>L.text).sort((L,I)=>L.number-I.number),N=[];if(P.forEach((L,I)=>{let G=S.append("text").attr("x",c+h).attr("y",i+h+(I+1)*w).attr("font-size",k).attr("fill",x.axisTextColor).attr("text-anchor","start").attr("dominant-baseline","middle").text(`${L.number}. ${L.text}`);N.push(G)}),N.length>0){let L=0,I=0;N.forEach((dt)=>{let ot=dt.node(),It=ot.getComputedTextLength();L=Math.max(L,It);let Bt=ot.getBBox();I=Math.max(I,Bt.height)});let G=L+h*2+105,rt=P.length*w+h*2+I/2,U=n.padding,Et=F-n.padding-G,Ht=n.padding,Yt=X-n.padding-rt;c=Math.max(U,Math.min(c,Et)),i=Math.max(Ht,Math.min(i,Yt)),N.forEach((dt,ot)=>{dt.attr("x",c+h).attr("y",i+h+(ot+1)*w)}),S.insert("rect","text").attr("x",c).attr("y",i).attr("width",G).attr("height",rt).attr("fill","white").attr("stroke",x.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}}}if(M.notes.length>0){let a=Y.append("g").attr("class","wardley-notes");M.notes.forEach((c)=>{let i=q(c.x),h=V(c.y);a.append("text").attr("x",i).attr("y",h).attr("text-anchor","start").attr("font-size",11).attr("fill",x.axisTextColor).attr("font-weight","bold").text(c.text)})}if(M.accelerators.length>0){let a=Y.append("g").attr("class","wardley-accelerators");M.accelerators.forEach((c)=>{let i=q(c.x),h=V(c.y),w=60,k=30,S=20,P=`
3
3
  M ${i} ${h-15}
4
4
  L ${i+60-20} ${h-15}
5
5
  L ${i+60-20} ${h-15-8}
@@ -8,7 +8,7 @@ import{R}from"./index-353m7b0p.js";import{e,t,j,u,k,d,f,p,m,g,b,v,r,A,E}from"./i
8
8
  L ${i+60-20} ${h+15}
9
9
  L ${i} ${h+15}
10
10
  Z
11
- `;a.append("path").attr("d",C).attr("fill","white").attr("stroke",x.componentStroke).attr("stroke-width",1),a.append("text").attr("x",i+30).attr("y",h+15+15).attr("text-anchor","middle").attr("font-size",10).attr("fill",x.axisTextColor).attr("font-weight","bold").text(c.name)})}if(N.deaccelerators.length>0){let a=Y.append("g").attr("class","wardley-deaccelerators");N.deaccelerators.forEach((c)=>{let i=q(c.x),h=V(c.y),w=60,P=30,M=20,C=`
11
+ `;a.append("path").attr("d",P).attr("fill","white").attr("stroke",x.componentStroke).attr("stroke-width",1),a.append("text").attr("x",i+30).attr("y",h+15+15).attr("text-anchor","middle").attr("font-size",10).attr("fill",x.axisTextColor).attr("font-weight","bold").text(c.name)})}if(M.deaccelerators.length>0){let a=Y.append("g").attr("class","wardley-deaccelerators");M.deaccelerators.forEach((c)=>{let i=q(c.x),h=V(c.y),w=60,k=30,S=20,P=`
12
12
  M ${i+60} ${h-15}
13
13
  L ${i+20} ${h-15}
14
14
  L ${i+20} ${h-15-8}
@@ -17,7 +17,7 @@ import{R}from"./index-353m7b0p.js";import{e,t,j,u,k,d,f,p,m,g,b,v,r,A,E}from"./i
17
17
  L ${i+20} ${h+15}
18
18
  L ${i+60} ${h+15}
19
19
  Z
20
- `;a.append("path").attr("d",C).attr("fill","white").attr("stroke",x.componentStroke).attr("stroke-width",1),a.append("text").attr("x",i+30).attr("y",h+15+15).attr("text-anchor","middle").attr("font-size",10).attr("fill",x.axisTextColor).attr("font-weight","bold").text(c.name)})}},"draw"),_t={draw:Vt},Zt=e(({wardley:o}={})=>{let l=j(),s=u(),S=E(l,s.themeVariables),n=E(S.wardley,o);return`
20
+ `;a.append("path").attr("d",P).attr("fill","white").attr("stroke",x.componentStroke).attr("stroke-width",1),a.append("text").attr("x",i+30).attr("y",h+15+15).attr("text-anchor","middle").attr("font-size",10).attr("fill",x.axisTextColor).attr("font-weight","bold").text(c.name)})}},"draw"),_t={draw:Vt},Zt=e(({wardley:o}={})=>{let l=j(),s=u(),C=E(l,s.themeVariables),n=E(C.wardley,o);return`
21
21
  .wardley-background {
22
22
  fill: ${n.backgroundColor};
23
23
  }