pmx-canvas 0.11.0 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (298) hide show
  1. package/.github/extensions/pmx-canvas/extension.mjs +3 -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 +37 -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 +251 -0
  11. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/evals/evals.json +1086 -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 +1785 -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 +251 -0
  26. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/references/tours-and-recording.md +111 -0
  27. package/dist/amp-plugin/pmx-canvas/skills/pmx-canvas/references/workbench-workflows.md +900 -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 +16 -2
  151. package/docs/amp-plugin.md +271 -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 +3 -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 +232 -842
  179. package/skills/pmx-canvas/evals/evals.json +26 -3
  180. package/skills/pmx-canvas/references/full-reference.md +80 -20
  181. package/skills/pmx-canvas/references/html-primitives.md +7 -0
  182. package/skills/pmx-canvas/references/installing-pmx-canvas.md +6 -6
  183. package/skills/pmx-canvas/references/tours-and-recording.md +29 -2
  184. package/skills/pmx-canvas/references/workbench-workflows.md +900 -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/init-artifact.sh +2 -2
  191. package/src/cli/commands/apps.ts +1 -0
  192. package/src/cli/commands/boards.ts +30 -0
  193. package/src/client/App.tsx +20 -4
  194. package/src/client/canvas/AttentionHistory.tsx +10 -2
  195. package/src/client/canvas/BoardMoveDialog.tsx +225 -0
  196. package/src/client/canvas/CanvasNode.tsx +45 -2
  197. package/src/client/canvas/CanvasViewport.tsx +38 -9
  198. package/src/client/canvas/ContextMenu.tsx +34 -12
  199. package/src/client/canvas/EdgeEditor.tsx +149 -0
  200. package/src/client/canvas/EdgeLayer.tsx +87 -16
  201. package/src/client/canvas/ExpandedNodeOverlay.tsx +4 -0
  202. package/src/client/canvas/GroupNavigation.tsx +85 -0
  203. package/src/client/canvas/RelationsPanel.tsx +9 -0
  204. package/src/client/canvas/SelectionBar.tsx +21 -0
  205. package/src/client/canvas/SessionPanel.tsx +35 -1
  206. package/src/client/canvas/TextPrompt.tsx +18 -1
  207. package/src/client/canvas/TopBar.tsx +30 -0
  208. package/src/client/canvas/canvas-area.ts +1 -1
  209. package/src/client/nodes/ExtAppFrame.tsx +26 -10
  210. package/src/client/nodes/MarkdownNode.tsx +6 -7
  211. package/src/client/nodes/PromptNode.tsx +32 -3
  212. package/src/client/nodes/StatusNode.tsx +12 -0
  213. package/src/client/nodes/StatusSummary.tsx +11 -0
  214. package/src/client/nodes/ViewerFrame.tsx +21 -10
  215. package/src/client/nodes/WorkCard.tsx +175 -0
  216. package/src/client/nodes/use-ax-surface-bridge.ts +18 -14
  217. package/src/client/state/attention-bridge.ts +5 -0
  218. package/src/client/state/attention-store.ts +1 -0
  219. package/src/client/state/canvas-store.ts +185 -15
  220. package/src/client/state/human-store.ts +22 -2
  221. package/src/client/state/intent-bridge.ts +19 -5
  222. package/src/client/state/relation-store.ts +127 -1
  223. package/src/client/theme/global.css +94 -1
  224. package/src/client/types.ts +1 -0
  225. package/src/mcp/server.ts +13 -3
  226. package/src/server/agent-presence.ts +43 -23
  227. package/src/server/ax-flow-loop.ts +6 -0
  228. package/src/server/ax-gate-ttl.ts +8 -1
  229. package/src/server/ax-interaction.ts +16 -10
  230. package/src/server/ax-state-manager.ts +17 -4
  231. package/src/server/ax-wait.ts +20 -6
  232. package/src/server/board-export.ts +19 -6
  233. package/src/server/board-local.ts +20 -0
  234. package/src/server/board-move.ts +297 -0
  235. package/src/server/canvas-db.ts +249 -158
  236. package/src/server/canvas-operations.ts +139 -109
  237. package/src/server/canvas-schema.ts +21 -0
  238. package/src/server/canvas-serialization.ts +2 -0
  239. package/src/server/canvas-state.ts +792 -159
  240. package/src/server/card-relocation.ts +53 -0
  241. package/src/server/code-graph.ts +4 -3
  242. package/src/server/context-reads.ts +83 -55
  243. package/src/server/demo-state.json +35 -15
  244. package/src/server/file-watcher.ts +30 -10
  245. package/src/server/human-presence.ts +18 -5
  246. package/src/server/index.ts +35 -15
  247. package/src/server/intent-registry.ts +43 -5
  248. package/src/server/knowledge-lifecycle.ts +32 -9
  249. package/src/server/lifecycle-status.ts +29 -1
  250. package/src/server/mcp-app-runtime.ts +26 -7
  251. package/src/server/mutation-history.ts +37 -8
  252. package/src/server/operations/composites.ts +6 -3
  253. package/src/server/operations/mcp-contracts.ts +15 -0
  254. package/src/server/operations/mcp.ts +36 -9
  255. package/src/server/operations/ops/annotation.ts +22 -1
  256. package/src/server/operations/ops/ax-await.ts +1 -0
  257. package/src/server/operations/ops/ax-timeline.ts +28 -2
  258. package/src/server/operations/ops/batch.ts +25 -11
  259. package/src/server/operations/ops/boards.ts +44 -3
  260. package/src/server/operations/ops/nodes.ts +70 -0
  261. package/src/server/operations/ops/query.ts +32 -3
  262. package/src/server/operations/ops/snapshots.ts +1 -0
  263. package/src/server/operations/registry.ts +49 -4
  264. package/src/server/server.ts +62 -16
  265. package/src/server/tour-control.ts +37 -12
  266. package/src/server/trace-manager.ts +4 -0
  267. package/src/server/web-artifacts/scripts/init-artifact.sh +2 -2
  268. package/src/shared/agent-context.ts +7 -1
  269. package/src/shared/auto-arrange.ts +5 -4
  270. package/src/shared/ax-kinds.ts +13 -0
  271. package/src/shared/ax-surface-protocol.ts +22 -0
  272. package/src/shared/human-presence.ts +1 -0
  273. package/src/shared/lifecycle-status.ts +2 -0
  274. package/dist/canvas/chunks/architecture-TIHT7OUA-9tffvpsv.js +0 -1
  275. package/dist/canvas/chunks/classDiagram-JCYQIIEL-nc6g5x1r.js +0 -1
  276. package/dist/canvas/chunks/classDiagram-v2-OCEON4UE-0qnbpwvh.js +0 -1
  277. package/dist/canvas/chunks/cynefin-VYW2F7L2-ys8p46ts.js +0 -1
  278. package/dist/canvas/chunks/eventmodeling-45OFAUF4-v9q6dn4c.js +0 -1
  279. package/dist/canvas/chunks/flowDiagram-UKHOOZJN-yrr5z8tc.js +0 -1
  280. package/dist/canvas/chunks/gitGraph-TEB2WS4Q-kdwb8m0a.js +0 -1
  281. package/dist/canvas/chunks/index-1r72hdzb.js +0 -301
  282. package/dist/canvas/chunks/index-g3pwnqeb.js +0 -2
  283. package/dist/canvas/chunks/index-rft2hcz5.js +0 -2
  284. package/dist/canvas/chunks/info-DKCQHKI2-wpzs6sz3.js +0 -1
  285. package/dist/canvas/chunks/ishikawaDiagram-WSZJBQD7-5hnq1a9p.js +0 -70
  286. package/dist/canvas/chunks/packet-7NZHBO7P-xn439f0s.js +0 -1
  287. package/dist/canvas/chunks/pie-RZYD4A2V-0kf16rwh.js +0 -1
  288. package/dist/canvas/chunks/radar-I7S5WNFK-0g2pz36t.js +0 -1
  289. package/dist/canvas/chunks/railroad-3IZDKUUU-fcaran6j.js +0 -1
  290. package/dist/canvas/chunks/railroad-abnf-AHOZXSZD-wgdya41q.js +0 -1
  291. package/dist/canvas/chunks/railroad-ebnf-EBAXGLYW-gy07a4ka.js +0 -1
  292. package/dist/canvas/chunks/railroad-peg-LSFZ7HO6-ewk6wtkh.js +0 -1
  293. package/dist/canvas/chunks/stateDiagram-v2-UEYNNEHI-k8sfp2e7.js +0 -1
  294. package/dist/canvas/chunks/swimlanesDiagram-ULZ7WXOC-nqysw67j.js +0 -8
  295. package/dist/canvas/chunks/treeView-QDETBFTQ-cesw6gp0.js +0 -1
  296. package/dist/canvas/chunks/treemap-6X3UGDF4-zdv4knp9.js +0 -1
  297. package/dist/canvas/chunks/vennDiagram-T6HMQDX7-x8dqn9yf.js +0 -34
  298. package/dist/canvas/chunks/wardley-OPB4EBWU-44pdddez.js +0 -1
@@ -1,9 +1,9 @@
1
- import{e,t,q,u,M,w,ht,l,k,d,r,n,Le,Be,Pt,mt,jr,Ot,Vt,Yt,jt,Xr,Kr,Zr,Jr,Bn,Qr,Tr,en,Fn,zn,Gn,Hn,Wn,Un,qn,Vn,Yn,gt,Xn,h,Te,Ne,an,Z,Fe,Jn}from"./index-1r72hdzb.js";import"./index-6qmsnxwy.js";import{L}from"./index-fjtdggjn.js";import{we}from"./index-nprm96xp.js";import{Rt}from"./index-g3pwnqeb.js";function Gt(s){return Array.isArray(s)}function qt(s){if(Pt(s))return s;let a=mt(s);if(!Re(s))return{};if(Gt(s)){let o=Array.from(s);if(s.length>0&&typeof s[0]==="string"&&Object.hasOwn(s,"index"))o.index=s.index,o.input=s.input;return o}if(gt(s)){let o=s;return new o.constructor(o.buffer,o.byteOffset,o.length)}if(a===Qr)return new ArrayBuffer(s.byteLength);if(a===en){let o=s,{buffer:g,byteOffset:f,byteLength:i}=o,p=new ArrayBuffer(i),x=new Uint8Array(g,f,i);return new Uint8Array(p).set(x),new DataView(p)}if(a===Yt||a===Vt||a===Ot){let g=new s.constructor(s.valueOf());if(a===Ot)ze(g,s);else Dt(g,s);return g}if(a===Kr)return new Date(Number(s));if(a===jr){let o=s,g=new RegExp(o.source,o.flags);return g.lastIndex=o.lastIndex,g}if(a===Xr)return Object(Symbol.prototype.valueOf.call(s));if(a===Zr){let o=s,g=new Map;return o.forEach((f,i)=>{g.set(i,f)}),g}if(a===Jr){let o=s,g=new Set;return o.forEach((f)=>{g.add(f)}),g}if(a===jt){let o=s,g={};return Dt(g,o),g.length=o.length,g[Symbol.iterator]=o[Symbol.iterator],g}let c={};return Me(c,s),Dt(c,s),Ae(c,s),c}function Re(s){switch(mt(s)){case jt:case Bn:case Qr:case en:case Yt:case Kr:case Vn:case Yn:case Wn:case Un:case qn:case Zr:case Vt:case Tr:case jr:case Jr:case Ot:case Xr:case Fn:case zn:case Gn:case Hn:return!0;default:return!1}}function Dt(s,a){for(let c in a)if(Object.hasOwn(a,c))s[c]=a[c]}function Ae(s,a){let c=Object.getOwnPropertySymbols(a);for(let o=0;o<c.length;o++){let g=c[o];if(Object.prototype.propertyIsEnumerable.call(a,g))s[g]=a[g]}}function ze(s,a){let c=a.valueOf().length;for(let o in a)if(Object.hasOwn(a,o)&&(Number.isNaN(Number(o))||Number(o)>=c))s[o]=a[o]}function Me(s,a){let c=Object.getPrototypeOf(a);if(c!==null){if(typeof a.constructor==="function")Object.setPrototypeOf(s,c)}}var Nt=function(){var s=e(function(z,N,v,_){for(v=v||{},_=z.length;_--;v[z[_]]=N);return v},"o"),a=[1,15],c=[1,7],o=[1,13],g=[1,14],f=[1,19],i=[1,16],p=[1,17],x=[1,18],m=[8,30],b=[8,10,21,28,29,30,31,39,43,46],S=[1,23],D=[1,24],B=[8,10,15,16,21,28,29,30,31,39,43,46],T=[8,10,15,16,21,27,28,29,30,31,39,43,46],O=[1,49],I={trace:e(function(){},"trace"),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$accept:0,$end:1},terminals_:{2:"error",4:"SPACELINE",5:"NL",7:"SPACE",8:"EOF",10:"BLOCK_DIAGRAM_KEY",15:"LINK",16:"START_LINK",17:"LINK_LABEL",18:"STR",21:"SPACE_BLOCK",27:"SIZE",28:"COLUMNS",29:"id-block",30:"end",31:"NODE_ID",34:"DIR",35:"NODE_DSTART",36:"NODE_DEND",37:"BLOCK_ARROW_START",38:"BLOCK_ARROW_END",39:"classDef",40:"CLASSDEF_ID",41:"CLASSDEF_STYLEOPTS",42:"DEFAULT",43:"class",44:"CLASSENTITY_IDS",45:"STYLECLASS",46:"style",47:"STYLE_ENTITY_IDS",48:"STYLE_DEFINITION_DATA"},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:e(function(N,v,_,C,R,y,V){var E=y.length-1;switch(R){case 4:C.getLogger().debug("Rule: separator (NL) ");break;case 5:C.getLogger().debug("Rule: separator (Space) ");break;case 6:C.getLogger().debug("Rule: separator (EOF) ");break;case 7:C.getLogger().debug("Rule: hierarchy: ",y[E-1]),C.setHierarchy(y[E-1]);break;case 8:C.getLogger().debug("Stop NL ");break;case 9:C.getLogger().debug("Stop EOF ");break;case 10:C.getLogger().debug("Stop NL2 ");break;case 11:C.getLogger().debug("Stop EOF2 ");break;case 12:C.getLogger().debug("Rule: statement: ",y[E]),typeof y[E].length==="number"?this.$=y[E]:this.$=[y[E]];break;case 13:C.getLogger().debug("Rule: statement #2: ",y[E-1]),this.$=[y[E-1]].concat(y[E]);break;case 14:C.getLogger().debug("Rule: link: ",y[E],N),this.$={edgeTypeStr:y[E],label:""};break;case 15:C.getLogger().debug("Rule: LABEL link: ",y[E-3],y[E-1],y[E]),this.$={edgeTypeStr:y[E],label:y[E-1]};break;case 18:let W=parseInt(y[E]),it=C.generateId();this.$={id:it,type:"space",label:"",width:W,children:[]};break;case 23:C.getLogger().debug("Rule: (nodeStatement link node) ",y[E-2],y[E-1],y[E]," typestr: ",y[E-1].edgeTypeStr);let rt=C.edgeStrToEdgeData(y[E-1].edgeTypeStr),kt=C.edgeStrToEdgeStartData(y[E-1].edgeTypeStr),ut=C.edgeStrToThickness(y[E-1].edgeTypeStr),St=C.edgeStrToPattern(y[E-1].edgeTypeStr);this.$=[{id:y[E-2].id,label:y[E-2].label,type:y[E-2].type,directions:y[E-2].directions},{id:y[E-2].id+"-"+y[E].id,start:y[E-2].id,end:y[E].id,label:y[E-1].label,type:"edge",thickness:ut,pattern:St,directions:y[E].directions,arrowTypeEnd:rt,arrowTypeStart:kt},{id:y[E].id,label:y[E].label,type:C.typeStr2Type(y[E].typeStr),directions:y[E].directions}];break;case 24:C.getLogger().debug("Rule: nodeStatement (abc88 node size) ",y[E-1],y[E]),this.$={id:y[E-1].id,label:y[E-1].label,type:C.typeStr2Type(y[E-1].typeStr),directions:y[E-1].directions,widthInColumns:parseInt(y[E],10)};break;case 25:C.getLogger().debug("Rule: nodeStatement (node) ",y[E]),this.$={id:y[E].id,label:y[E].label,type:C.typeStr2Type(y[E].typeStr),directions:y[E].directions,widthInColumns:1};break;case 26:C.getLogger().debug("APA123",this?this:"na"),C.getLogger().debug("COLUMNS: ",y[E]),this.$={type:"column-setting",columns:y[E]==="auto"?-1:parseInt(y[E])};break;case 27:C.getLogger().debug("Rule: id-block statement : ",y[E-2],y[E-1]);let Y=C.generateId();this.$={...y[E-2],type:"composite",children:y[E-1]};break;case 28:C.getLogger().debug("Rule: blockStatement : ",y[E-2],y[E-1],y[E]);let at=C.generateId();this.$={id:at,type:"composite",label:"",children:y[E-1]};break;case 29:C.getLogger().debug("Rule: node (NODE_ID separator): ",y[E]),this.$={id:y[E]};break;case 30:C.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",y[E-1],y[E]),this.$={id:y[E-1],label:y[E].label,typeStr:y[E].typeStr,directions:y[E].directions};break;case 31:C.getLogger().debug("Rule: dirList: ",y[E]),this.$=[y[E]];break;case 32:C.getLogger().debug("Rule: dirList: ",y[E-1],y[E]),this.$=[y[E-1]].concat(y[E]);break;case 33:C.getLogger().debug("Rule: nodeShapeNLabel: ",y[E-2],y[E-1],y[E]),this.$={typeStr:y[E-2]+y[E],label:y[E-1]};break;case 34:C.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",y[E-3],y[E-2]," #3:",y[E-1],y[E]),this.$={typeStr:y[E-3]+y[E],label:y[E-2],directions:y[E-1]};break;case 35:case 36:this.$={type:"classDef",id:y[E-1].trim(),css:y[E].trim()};break;case 37:this.$={type:"applyClass",id:y[E-1].trim(),styleClass:y[E].trim()};break;case 38:this.$={type:"applyStyles",id:y[E-1].trim(),stylesStr:y[E].trim()};break}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:a,11:3,13:4,19:5,20:6,21:c,22:8,23:9,24:10,25:11,26:12,28:o,29:g,31:f,39:i,43:p,46:x},{8:[1,20]},s(m,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:a,21:c,28:o,29:g,31:f,39:i,43:p,46:x}),s(b,[2,16],{14:22,15:S,16:D}),s(b,[2,17]),s(b,[2,18]),s(b,[2,19]),s(b,[2,20]),s(b,[2,21]),s(b,[2,22]),s(B,[2,25],{27:[1,25]}),s(b,[2,26]),{19:26,26:12,31:f},{10:a,11:27,13:4,19:5,20:6,21:c,22:8,23:9,24:10,25:11,26:12,28:o,29:g,31:f,39:i,43:p,46:x},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},s(T,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},s(m,[2,13]),{26:35,31:f},{31:[2,14]},{17:[1,36]},s(B,[2,24]),{10:a,11:37,13:4,14:22,15:S,16:D,19:5,20:6,21:c,22:8,23:9,24:10,25:11,26:12,28:o,29:g,31:f,39:i,43:p,46:x},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},s(T,[2,30]),{18:[1,43]},{18:[1,44]},s(B,[2,23]),{18:[1,45]},{30:[1,46]},s(b,[2,28]),s(b,[2,35]),s(b,[2,36]),s(b,[2,37]),s(b,[2,38]),{36:[1,47]},{33:48,34:O},{15:[1,50]},s(b,[2,27]),s(T,[2,33]),{38:[1,51]},{33:52,34:O,38:[2,31]},{31:[2,15]},s(T,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:e(function(N,v){if(v.recoverable)this.trace(N);else{var _=Error(N);throw _.hash=v,_}},"parseError"),parse:e(function(N){var v=this,_=[0],C=[],R=[null],y=[],V=this.table,E="",W=0,it=0,rt=0,kt=2,ut=1,St=y.slice.call(arguments,1),Y=Object.create(this.lexer),at={yy:{}};for(var Lt in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,Lt))at.yy[Lt]=this.yy[Lt];if(Y.setInput(N,at.yy),at.yy.lexer=Y,at.yy.parser=this,typeof Y.yylloc>"u")Y.yylloc={};var vt=Y.yylloc;y.push(vt);var Ce=Y.options&&Y.options.ranges;if(typeof at.yy.parseError==="function")this.parseError=at.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function Oe(J){_.length=_.length-2*J,R.length=R.length-J,y.length=y.length-J}e(Oe,"popStack");function Xt(){var J=C.pop()||Y.lex()||ut;if(typeof J!=="number"){if(J instanceof Array)C=J,J=C.pop();J=v.symbols_[J]||J}return J}e(Xt,"lex");var X,Et,nt,j,ya,_t,ct={},dt,st,Zt,pt;while(!0){if(nt=_[_.length-1],this.defaultActions[nt])j=this.defaultActions[nt];else{if(X===null||typeof X>"u")X=Xt();j=V[nt]&&V[nt][X]}if(typeof j>"u"||!j.length||!j[0]){var Tt="";pt=[];for(dt in V[nt])if(this.terminals_[dt]&&dt>kt)pt.push("'"+this.terminals_[dt]+"'");if(Y.showPosition)Tt="Parse error on line "+(W+1)+`:
1
+ import{e,t,q,u,M,w,ht,l,T,d,r,n,Le,Be,Pt,mt,jr,Ot,Vt,Yt,jt,Xr,Kr,Zr,Jr,Bn,Qr,kr,en,Fn,zn,Gn,Hn,Wn,Un,qn,Vn,Yn,gt,Xn,h,ke,Ne,an,Z,Fe,Jn}from"./index-nwsya6dj.js";import"./index-v119nznk.js";import{L}from"./index-mergmj97.js";import{we}from"./index-9022d1n9.js";import{Rt}from"./index-frvta4tm.js";function Gt(s){return Array.isArray(s)}function qt(s){if(Pt(s))return s;let a=mt(s);if(!Re(s))return{};if(Gt(s)){let o=Array.from(s);if(s.length>0&&typeof s[0]==="string"&&Object.hasOwn(s,"index"))o.index=s.index,o.input=s.input;return o}if(gt(s)){let o=s;return new o.constructor(o.buffer,o.byteOffset,o.length)}if(a===Qr)return new ArrayBuffer(s.byteLength);if(a===en){let o=s,{buffer:g,byteOffset:f,byteLength:i}=o,p=new ArrayBuffer(i),x=new Uint8Array(g,f,i);return new Uint8Array(p).set(x),new DataView(p)}if(a===Yt||a===Vt||a===Ot){let g=new s.constructor(s.valueOf());if(a===Ot)ze(g,s);else Dt(g,s);return g}if(a===Kr)return new Date(Number(s));if(a===jr){let o=s,g=new RegExp(o.source,o.flags);return g.lastIndex=o.lastIndex,g}if(a===Xr)return Object(Symbol.prototype.valueOf.call(s));if(a===Zr){let o=s,g=new Map;return o.forEach((f,i)=>{g.set(i,f)}),g}if(a===Jr){let o=s,g=new Set;return o.forEach((f)=>{g.add(f)}),g}if(a===jt){let o=s,g={};return Dt(g,o),g.length=o.length,g[Symbol.iterator]=o[Symbol.iterator],g}let c={};return Me(c,s),Dt(c,s),Ae(c,s),c}function Re(s){switch(mt(s)){case jt:case Bn:case Qr:case en:case Yt:case Kr:case Vn:case Yn:case Wn:case Un:case qn:case Zr:case Vt:case kr:case jr:case Jr:case Ot:case Xr:case Fn:case zn:case Gn:case Hn:return!0;default:return!1}}function Dt(s,a){for(let c in a)if(Object.hasOwn(a,c))s[c]=a[c]}function Ae(s,a){let c=Object.getOwnPropertySymbols(a);for(let o=0;o<c.length;o++){let g=c[o];if(Object.prototype.propertyIsEnumerable.call(a,g))s[g]=a[g]}}function ze(s,a){let c=a.valueOf().length;for(let o in a)if(Object.hasOwn(a,o)&&(Number.isNaN(Number(o))||Number(o)>=c))s[o]=a[o]}function Me(s,a){let c=Object.getPrototypeOf(a);if(c!==null){if(typeof a.constructor==="function")Object.setPrototypeOf(s,c)}}var Nt=function(){var s=e(function(z,N,S,E){for(S=S||{},E=z.length;E--;S[z[E]]=N);return S},"o"),a=[1,15],c=[1,7],o=[1,13],g=[1,14],f=[1,19],i=[1,16],p=[1,17],x=[1,18],m=[8,30],b=[8,10,21,28,29,30,31,39,43,46],k=[1,23],D=[1,24],B=[8,10,15,16,21,28,29,30,31,39,43,46],_=[8,10,15,16,21,27,28,29,30,31,39,43,46],O=[1,49],I={trace:e(function(){},"trace"),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$accept:0,$end:1},terminals_:{2:"error",4:"SPACELINE",5:"NL",7:"SPACE",8:"EOF",10:"BLOCK_DIAGRAM_KEY",15:"LINK",16:"START_LINK",17:"LINK_LABEL",18:"STR",21:"SPACE_BLOCK",27:"SIZE",28:"COLUMNS",29:"id-block",30:"end",31:"NODE_ID",34:"DIR",35:"NODE_DSTART",36:"NODE_DEND",37:"BLOCK_ARROW_START",38:"BLOCK_ARROW_END",39:"classDef",40:"CLASSDEF_ID",41:"CLASSDEF_STYLEOPTS",42:"DEFAULT",43:"class",44:"CLASSENTITY_IDS",45:"STYLECLASS",46:"style",47:"STYLE_ENTITY_IDS",48:"STYLE_DEFINITION_DATA"},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:e(function(N,S,E,C,R,y,V){var v=y.length-1;switch(R){case 4:C.getLogger().debug("Rule: separator (NL) ");break;case 5:C.getLogger().debug("Rule: separator (Space) ");break;case 6:C.getLogger().debug("Rule: separator (EOF) ");break;case 7:C.getLogger().debug("Rule: hierarchy: ",y[v-1]),C.setHierarchy(y[v-1]);break;case 8:C.getLogger().debug("Stop NL ");break;case 9:C.getLogger().debug("Stop EOF ");break;case 10:C.getLogger().debug("Stop NL2 ");break;case 11:C.getLogger().debug("Stop EOF2 ");break;case 12:C.getLogger().debug("Rule: statement: ",y[v]),typeof y[v].length==="number"?this.$=y[v]:this.$=[y[v]];break;case 13:C.getLogger().debug("Rule: statement #2: ",y[v-1]),this.$=[y[v-1]].concat(y[v]);break;case 14:C.getLogger().debug("Rule: link: ",y[v],N),this.$={edgeTypeStr:y[v],label:""};break;case 15:C.getLogger().debug("Rule: LABEL link: ",y[v-3],y[v-1],y[v]),this.$={edgeTypeStr:y[v],label:y[v-1]};break;case 18:let W=parseInt(y[v]),it=C.generateId();this.$={id:it,type:"space",label:"",width:W,children:[]};break;case 23:C.getLogger().debug("Rule: (nodeStatement link node) ",y[v-2],y[v-1],y[v]," typestr: ",y[v-1].edgeTypeStr);let rt=C.edgeStrToEdgeData(y[v-1].edgeTypeStr),kt=C.edgeStrToEdgeStartData(y[v-1].edgeTypeStr),ut=C.edgeStrToThickness(y[v-1].edgeTypeStr),St=C.edgeStrToPattern(y[v-1].edgeTypeStr);this.$=[{id:y[v-2].id,label:y[v-2].label,type:y[v-2].type,directions:y[v-2].directions},{id:y[v-2].id+"-"+y[v].id,start:y[v-2].id,end:y[v].id,label:y[v-1].label,type:"edge",thickness:ut,pattern:St,directions:y[v].directions,arrowTypeEnd:rt,arrowTypeStart:kt},{id:y[v].id,label:y[v].label,type:C.typeStr2Type(y[v].typeStr),directions:y[v].directions}];break;case 24:C.getLogger().debug("Rule: nodeStatement (abc88 node size) ",y[v-1],y[v]),this.$={id:y[v-1].id,label:y[v-1].label,type:C.typeStr2Type(y[v-1].typeStr),directions:y[v-1].directions,widthInColumns:parseInt(y[v],10)};break;case 25:C.getLogger().debug("Rule: nodeStatement (node) ",y[v]),this.$={id:y[v].id,label:y[v].label,type:C.typeStr2Type(y[v].typeStr),directions:y[v].directions,widthInColumns:1};break;case 26:C.getLogger().debug("APA123",this?this:"na"),C.getLogger().debug("COLUMNS: ",y[v]),this.$={type:"column-setting",columns:y[v]==="auto"?-1:parseInt(y[v])};break;case 27:C.getLogger().debug("Rule: id-block statement : ",y[v-2],y[v-1]);let Y=C.generateId();this.$={...y[v-2],type:"composite",children:y[v-1]};break;case 28:C.getLogger().debug("Rule: blockStatement : ",y[v-2],y[v-1],y[v]);let at=C.generateId();this.$={id:at,type:"composite",label:"",children:y[v-1]};break;case 29:C.getLogger().debug("Rule: node (NODE_ID separator): ",y[v]),this.$={id:y[v]};break;case 30:C.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",y[v-1],y[v]),this.$={id:y[v-1],label:y[v].label,typeStr:y[v].typeStr,directions:y[v].directions};break;case 31:C.getLogger().debug("Rule: dirList: ",y[v]),this.$=[y[v]];break;case 32:C.getLogger().debug("Rule: dirList: ",y[v-1],y[v]),this.$=[y[v-1]].concat(y[v]);break;case 33:C.getLogger().debug("Rule: nodeShapeNLabel: ",y[v-2],y[v-1],y[v]),this.$={typeStr:y[v-2]+y[v],label:y[v-1]};break;case 34:C.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",y[v-3],y[v-2]," #3:",y[v-1],y[v]),this.$={typeStr:y[v-3]+y[v],label:y[v-2],directions:y[v-1]};break;case 35:case 36:this.$={type:"classDef",id:y[v-1].trim(),css:y[v].trim()};break;case 37:this.$={type:"applyClass",id:y[v-1].trim(),styleClass:y[v].trim()};break;case 38:this.$={type:"applyStyles",id:y[v-1].trim(),stylesStr:y[v].trim()};break}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:a,11:3,13:4,19:5,20:6,21:c,22:8,23:9,24:10,25:11,26:12,28:o,29:g,31:f,39:i,43:p,46:x},{8:[1,20]},s(m,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:a,21:c,28:o,29:g,31:f,39:i,43:p,46:x}),s(b,[2,16],{14:22,15:k,16:D}),s(b,[2,17]),s(b,[2,18]),s(b,[2,19]),s(b,[2,20]),s(b,[2,21]),s(b,[2,22]),s(B,[2,25],{27:[1,25]}),s(b,[2,26]),{19:26,26:12,31:f},{10:a,11:27,13:4,19:5,20:6,21:c,22:8,23:9,24:10,25:11,26:12,28:o,29:g,31:f,39:i,43:p,46:x},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},s(_,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},s(m,[2,13]),{26:35,31:f},{31:[2,14]},{17:[1,36]},s(B,[2,24]),{10:a,11:37,13:4,14:22,15:k,16:D,19:5,20:6,21:c,22:8,23:9,24:10,25:11,26:12,28:o,29:g,31:f,39:i,43:p,46:x},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},s(_,[2,30]),{18:[1,43]},{18:[1,44]},s(B,[2,23]),{18:[1,45]},{30:[1,46]},s(b,[2,28]),s(b,[2,35]),s(b,[2,36]),s(b,[2,37]),s(b,[2,38]),{36:[1,47]},{33:48,34:O},{15:[1,50]},s(b,[2,27]),s(_,[2,33]),{38:[1,51]},{33:52,34:O,38:[2,31]},{31:[2,15]},s(_,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:e(function(N,S){if(S.recoverable)this.trace(N);else{var E=Error(N);throw E.hash=S,E}},"parseError"),parse:e(function(N){var S=this,E=[0],C=[],R=[null],y=[],V=this.table,v="",W=0,it=0,rt=0,kt=2,ut=1,St=y.slice.call(arguments,1),Y=Object.create(this.lexer),at={yy:{}};for(var Lt in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,Lt))at.yy[Lt]=this.yy[Lt];if(Y.setInput(N,at.yy),at.yy.lexer=Y,at.yy.parser=this,typeof Y.yylloc>"u")Y.yylloc={};var vt=Y.yylloc;y.push(vt);var Ce=Y.options&&Y.options.ranges;if(typeof at.yy.parseError==="function")this.parseError=at.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function Oe(J){E.length=E.length-2*J,R.length=R.length-J,y.length=y.length-J}e(Oe,"popStack");function Xt(){var J=C.pop()||Y.lex()||ut;if(typeof J!=="number"){if(J instanceof Array)C=J,J=C.pop();J=S.symbols_[J]||J}return J}e(Xt,"lex");var X,Et,nt,j,ya,_t,ct={},dt,st,Zt,pt;while(!0){if(nt=E[E.length-1],this.defaultActions[nt])j=this.defaultActions[nt];else{if(X===null||typeof X>"u")X=Xt();j=V[nt]&&V[nt][X]}if(typeof j>"u"||!j.length||!j[0]){var Tt="";pt=[];for(dt in V[nt])if(this.terminals_[dt]&&dt>kt)pt.push("'"+this.terminals_[dt]+"'");if(Y.showPosition)Tt="Parse error on line "+(W+1)+`:
2
2
  `+Y.showPosition()+`
3
- Expecting `+pt.join(", ")+", got '"+(this.terminals_[X]||X)+"'";else Tt="Parse error on line "+(W+1)+": Unexpected "+(X==ut?"end of input":"'"+(this.terminals_[X]||X)+"'");this.parseError(Tt,{text:Y.match,token:this.terminals_[X]||X,line:Y.yylineno,loc:vt,expected:pt})}if(j[0]instanceof Array&&j.length>1)throw Error("Parse Error: multiple actions possible at state: "+nt+", token: "+X);switch(j[0]){case 1:if(_.push(X),R.push(Y.yytext),y.push(Y.yylloc),_.push(j[1]),X=null,!Et){if(it=Y.yyleng,E=Y.yytext,W=Y.yylineno,vt=Y.yylloc,rt>0)rt--}else X=Et,Et=null;break;case 2:if(st=this.productions_[j[1]][1],ct.$=R[R.length-st],ct._$={first_line:y[y.length-(st||1)].first_line,last_line:y[y.length-1].last_line,first_column:y[y.length-(st||1)].first_column,last_column:y[y.length-1].last_column},Ce)ct._$.range=[y[y.length-(st||1)].range[0],y[y.length-1].range[1]];if(_t=this.performAction.apply(ct,[E,it,W,at.yy,j[1],R,y].concat(St)),typeof _t<"u")return _t;if(st)_=_.slice(0,-1*st*2),R=R.slice(0,-1*st),y=y.slice(0,-1*st);_.push(this.productions_[j[1]][0]),R.push(ct.$),y.push(ct._$),Zt=V[_[_.length-2]][_[_.length-1]],_.push(Zt);break;case 3:return!0}}return!0},"parse")},F=function(){var z={EOF:1,parseError:e(function(v,_){if(this.yy.parser)this.yy.parser.parseError(v,_);else throw Error(v)},"parseError"),setInput:e(function(N,v){if(this.yy=v||this.yy||{},this._input=N,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 N=this._input[0];this.yytext+=N,this.yyleng++,this.offset++,this.match+=N,this.matched+=N;var v=N.match(/(?:\r\n?|\n).*/g);if(v)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),N},"input"),unput:e(function(N){var v=N.length,_=N.split(/(?:\r\n?|\n)/g);this._input=N+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-v),this.offset-=v;var C=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),_.length-1)this.yylineno-=_.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:_?(_.length===C.length?this.yylloc.first_column:0)+C[C.length-_.length].length-_[0].length:this.yylloc.first_column-v},this.options.ranges)this.yylloc.range=[R[0],R[0]+this.yyleng-v];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
- `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:e(function(N){this.unput(this.match.slice(N))},"less"),pastInput:e(function(){var N=this.matched.substr(0,this.matched.length-this.match.length);return(N.length>20?"...":"")+N.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:e(function(){var N=this.match;if(N.length<20)N+=this._input.substr(0,20-N.length);return(N.substr(0,20)+(N.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:e(function(){var N=this.pastInput(),v=Array(N.length+1).join("-");return N+this.upcomingInput()+`
5
- `+v+"^"},"showPosition"),test_match:e(function(N,v){var _,C,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(C=N[0].match(/(?:\r\n?|\n).*/g),C)this.yylineno+=C.length;if(this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:C?C[C.length-1].length-C[C.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+N[0].length},this.yytext+=N[0],this.match+=N[0],this.matches=N,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(N[0].length),this.matched+=N[0],_=this.performAction.call(this,this.yy,this,v,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input)this.done=!1;if(_)return _;else if(this._backtrack){for(var y in R)this[y]=R[y];return!1}return!1},"test_match"),next:e(function(){if(this.done)return this.EOF;if(!this._input)this.done=!0;var N,v,_,C;if(!this._more)this.yytext="",this.match="";var R=this._currentRules();for(var y=0;y<R.length;y++)if(_=this._input.match(this.rules[R[y]]),_&&(!v||_[0].length>v[0].length)){if(v=_,C=y,this.options.backtrack_lexer)if(N=this.test_match(_,R[y]),N!==!1)return N;else if(this._backtrack){v=!1;continue}else return!1;else if(!this.options.flex)break}if(v){if(N=this.test_match(v,R[C]),N!==!1)return N;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 v=this.next();if(v)return v;else return this.lex()},"lex"),begin:e(function(v){this.conditionStack.push(v)},"begin"),popState:e(function(){var v=this.conditionStack.length-1;if(v>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(v){if(v=this.conditionStack.length-1-Math.abs(v||0),v>=0)return this.conditionStack[v];else return"INITIAL"},"topState"),pushState:e(function(v){this.begin(v)},"pushState"),stateStackSize:e(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:e(function(v,_,C,R){var y=R;switch(C){case 0:return v.getLogger().debug("Found block-beta"),10;break;case 1:return v.getLogger().debug("Found id-block"),29;break;case 2:return v.getLogger().debug("Found block"),10;break;case 3:v.getLogger().debug(".",_.yytext);break;case 4:v.getLogger().debug("_",_.yytext);break;case 5:return 5;case 6:return _.yytext=-1,28;break;case 7:return _.yytext=_.yytext.replace(/columns\s+/,""),v.getLogger().debug("COLUMNS (LEX)",_.yytext),28;break;case 8:this.pushState("md_string");break;case 9:return"MD_STR";case 10:this.popState();break;case 11:this.pushState("string");break;case 12:v.getLogger().debug("LEX: POPPING STR:",_.yytext),this.popState();break;case 13:return v.getLogger().debug("LEX: STR end:",_.yytext),"STR";break;case 14:return _.yytext=_.yytext.replace(/space\:/,""),v.getLogger().debug("SPACE NUM (LEX)",_.yytext),21;break;case 15:return _.yytext="1",v.getLogger().debug("COLUMNS (LEX)",_.yytext),21;break;case 16:return 42;case 17:return"LINKSTYLE";case 18:return"INTERPOLATE";case 19:return this.pushState("CLASSDEF"),39;break;case 20:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";break;case 21:return this.popState(),this.pushState("CLASSDEFID"),40;break;case 22:return this.popState(),41;break;case 23:return this.pushState("CLASS"),43;break;case 24:return this.popState(),this.pushState("CLASS_STYLE"),44;break;case 25:return this.popState(),45;break;case 26:return this.pushState("STYLE_STMNT"),46;break;case 27:return this.popState(),this.pushState("STYLE_DEFINITION"),47;break;case 28:return this.popState(),48;break;case 29:return this.pushState("acc_title"),"acc_title";break;case 30:return this.popState(),"acc_title_value";break;case 31:return this.pushState("acc_descr"),"acc_descr";break;case 32:return this.popState(),"acc_descr_value";break;case 33:this.pushState("acc_descr_multiline");break;case 34:this.popState();break;case 35:return"acc_descr_multiline_value";case 36:return 30;case 37:return this.popState(),v.getLogger().debug("Lex: (("),"NODE_DEND";break;case 38:return this.popState(),v.getLogger().debug("Lex: (("),"NODE_DEND";break;case 39:return this.popState(),v.getLogger().debug("Lex: ))"),"NODE_DEND";break;case 40:return this.popState(),v.getLogger().debug("Lex: (("),"NODE_DEND";break;case 41:return this.popState(),v.getLogger().debug("Lex: (("),"NODE_DEND";break;case 42:return this.popState(),v.getLogger().debug("Lex: (-"),"NODE_DEND";break;case 43:return this.popState(),v.getLogger().debug("Lex: -)"),"NODE_DEND";break;case 44:return this.popState(),v.getLogger().debug("Lex: (("),"NODE_DEND";break;case 45:return this.popState(),v.getLogger().debug("Lex: ]]"),"NODE_DEND";break;case 46:return this.popState(),v.getLogger().debug("Lex: ("),"NODE_DEND";break;case 47:return this.popState(),v.getLogger().debug("Lex: ])"),"NODE_DEND";break;case 48:return this.popState(),v.getLogger().debug("Lex: /]"),"NODE_DEND";break;case 49:return this.popState(),v.getLogger().debug("Lex: /]"),"NODE_DEND";break;case 50:return this.popState(),v.getLogger().debug("Lex: )]"),"NODE_DEND";break;case 51:return this.popState(),v.getLogger().debug("Lex: )"),"NODE_DEND";break;case 52:return this.popState(),v.getLogger().debug("Lex: ]>"),"NODE_DEND";break;case 53:return this.popState(),v.getLogger().debug("Lex: ]"),"NODE_DEND";break;case 54:return v.getLogger().debug("Lexa: -)"),this.pushState("NODE"),35;break;case 55:return v.getLogger().debug("Lexa: (-"),this.pushState("NODE"),35;break;case 56:return v.getLogger().debug("Lexa: ))"),this.pushState("NODE"),35;break;case 57:return v.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;break;case 58:return v.getLogger().debug("Lex: ((("),this.pushState("NODE"),35;break;case 59:return v.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;break;case 60:return v.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;break;case 61:return v.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;break;case 62:return v.getLogger().debug("Lexc: >"),this.pushState("NODE"),35;break;case 63:return v.getLogger().debug("Lexa: (["),this.pushState("NODE"),35;break;case 64:return v.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;break;case 65:return this.pushState("NODE"),35;break;case 66:return this.pushState("NODE"),35;break;case 67:return this.pushState("NODE"),35;break;case 68:return this.pushState("NODE"),35;break;case 69:return this.pushState("NODE"),35;break;case 70:return this.pushState("NODE"),35;break;case 71:return this.pushState("NODE"),35;break;case 72:return v.getLogger().debug("Lexa: ["),this.pushState("NODE"),35;break;case 73:return this.pushState("BLOCK_ARROW"),v.getLogger().debug("LEX ARR START"),37;break;case 74:return v.getLogger().debug("Lex: NODE_ID",_.yytext),31;break;case 75:return v.getLogger().debug("Lex: EOF",_.yytext),8;break;case 76:this.pushState("md_string");break;case 77:this.pushState("md_string");break;case 78:return"NODE_DESCR";case 79:this.popState();break;case 80:v.getLogger().debug("Lex: Starting string"),this.pushState("string");break;case 81:v.getLogger().debug("LEX ARR: Starting string"),this.pushState("string");break;case 82:return v.getLogger().debug("LEX: NODE_DESCR:",_.yytext),"NODE_DESCR";break;case 83:v.getLogger().debug("LEX POPPING"),this.popState();break;case 84:v.getLogger().debug("Lex: =>BAE"),this.pushState("ARROW_DIR");break;case 85:return _.yytext=_.yytext.replace(/^,\s*/,""),v.getLogger().debug("Lex (right): dir:",_.yytext),"DIR";break;case 86:return _.yytext=_.yytext.replace(/^,\s*/,""),v.getLogger().debug("Lex (left):",_.yytext),"DIR";break;case 87:return _.yytext=_.yytext.replace(/^,\s*/,""),v.getLogger().debug("Lex (x):",_.yytext),"DIR";break;case 88:return _.yytext=_.yytext.replace(/^,\s*/,""),v.getLogger().debug("Lex (y):",_.yytext),"DIR";break;case 89:return _.yytext=_.yytext.replace(/^,\s*/,""),v.getLogger().debug("Lex (up):",_.yytext),"DIR";break;case 90:return _.yytext=_.yytext.replace(/^,\s*/,""),v.getLogger().debug("Lex (down):",_.yytext),"DIR";break;case 91:return _.yytext="]>",v.getLogger().debug("Lex (ARROW_DIR end):",_.yytext),this.popState(),this.popState(),"BLOCK_ARROW_END";break;case 92:return v.getLogger().debug("Lex: LINK","#"+_.yytext+"#"),15;break;case 93:return v.getLogger().debug("Lex: LINK",_.yytext),15;break;case 94:return v.getLogger().debug("Lex: LINK",_.yytext),15;break;case 95:return v.getLogger().debug("Lex: LINK",_.yytext),15;break;case 96:return v.getLogger().debug("Lex: START_LINK",_.yytext),this.pushState("LLABEL"),16;break;case 97:return v.getLogger().debug("Lex: START_LINK",_.yytext),this.pushState("LLABEL"),16;break;case 98:return v.getLogger().debug("Lex: START_LINK",_.yytext),this.pushState("LLABEL"),16;break;case 99:this.pushState("md_string");break;case 100:return v.getLogger().debug("Lex: Starting string"),this.pushState("string"),"LINK_LABEL";break;case 101:return this.popState(),v.getLogger().debug("Lex: LINK","#"+_.yytext+"#"),15;break;case 102:return this.popState(),v.getLogger().debug("Lex: LINK",_.yytext),15;break;case 103:return this.popState(),v.getLogger().debug("Lex: LINK",_.yytext),15;break;case 104:return v.getLogger().debug("Lex: COLON",_.yytext),_.yytext=_.yytext.slice(1),27;break}},"anonymous"),rules:[/^(?:block-beta\b)/,/^(?:block:)/,/^(?:block\b)/,/^(?:[\s]+)/,/^(?:[\n]+)/,/^(?:((\u000D\u000A)|(\u000A)))/,/^(?:columns\s+auto\b)/,/^(?:columns\s+[\d]+)/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:space[:]\d+)/,/^(?:space\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\s+)/,/^(?:DEFAULT\s+)/,/^(?:\w+\s+)/,/^(?:[^\n]*)/,/^(?:class\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:style\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:end\b\s*)/,/^(?:\(\(\()/,/^(?:\)\)\))/,/^(?:[\)]\))/,/^(?:\}\})/,/^(?:\})/,/^(?:\(-)/,/^(?:-\))/,/^(?:\(\()/,/^(?:\]\])/,/^(?:\()/,/^(?:\]\))/,/^(?:\\\])/,/^(?:\/\])/,/^(?:\)\])/,/^(?:[\)])/,/^(?:\]>)/,/^(?:[\]])/,/^(?:-\))/,/^(?:\(-)/,/^(?:\)\))/,/^(?:\))/,/^(?:\(\(\()/,/^(?:\(\()/,/^(?:\{\{)/,/^(?:\{)/,/^(?:>)/,/^(?:\(\[)/,/^(?:\()/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\[\\)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:\[)/,/^(?:<\[)/,/^(?:[^\(\[\n\-\)\{\}\s\<\>:=]+)/,/^(?:$)/,/^(?:["][`])/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:\]>\s*\()/,/^(?:,?\s*right\s*)/,/^(?:,?\s*left\s*)/,/^(?:,?\s*x\s*)/,/^(?:,?\s*y\s*)/,/^(?:,?\s*up\s*)/,/^(?:,?\s*down\s*)/,/^(?:\)\s*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*~~[\~]+\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:["][`])/,/^(?:["])/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?::\d+)/],conditions:{STYLE_DEFINITION:{rules:[28],inclusive:!1},STYLE_STMNT:{rules:[27],inclusive:!1},CLASSDEFID:{rules:[22],inclusive:!1},CLASSDEF:{rules:[20,21],inclusive:!1},CLASS_STYLE:{rules:[25],inclusive:!1},CLASS:{rules:[24],inclusive:!1},LLABEL:{rules:[99,100,101,102,103],inclusive:!1},ARROW_DIR:{rules:[85,86,87,88,89,90,91],inclusive:!1},BLOCK_ARROW:{rules:[76,81,84],inclusive:!1},NODE:{rules:[37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,77,80],inclusive:!1},md_string:{rules:[9,10,78,79],inclusive:!1},space:{rules:[],inclusive:!1},string:{rules:[12,13,82,83],inclusive:!1},acc_descr_multiline:{rules:[34,35],inclusive:!1},acc_descr:{rules:[32],inclusive:!1},acc_title:{rules:[30],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,11,14,15,16,17,18,19,23,26,29,31,33,36,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,92,93,94,95,96,97,98,104],inclusive:!0}}};return z}();I.lexer=F;function A(){this.yy={}}return e(A,"Parser"),A.prototype=I,I.Parser=A,new A}();Nt.parser=Nt;var Pe=Nt,tt=new Map,Mt=[],It=new Map,Jt="color",Qt="fill",He="bgFill",ne=",",xt=new Map,Ft="",We=e((s)=>l.sanitizeText(s,r()),"sanitizeText"),Ye=e(function(s,a=""){let c=xt.get(s);if(!c)c={id:s,styles:[],textStyles:[]},xt.set(s,c);if(a!==void 0&&a!==null)a.split(ne).forEach((o)=>{let g=o.replace(/([^;]*);/,"$1").trim();if(RegExp(Jt).exec(o)){let i=g.replace(Qt,He).replace(Jt,Qt);c.textStyles.push(i)}c.styles.push(g)})},"addStyleClass"),Ke=e(function(s,a=""){let c=tt.get(s);if(a!==void 0&&a!==null)c.styles=a.split(ne)},"addStyle2Node"),Ue=e(function(s,a){s.split(",").forEach(function(c){let o=tt.get(c);if(o===void 0){let g=c.trim();o={id:g,type:"na",children:[]},tt.set(g,o)}if(!o.classes)o.classes=[];o.classes.push(a)})},"setCssClass"),ce=e((s,a)=>{let c=s.flat(),o=[],f=c.find((i)=>i?.type==="column-setting")?.columns??-1;for(let i of c){if(typeof f==="number"&&f>0&&i.type!=="column-setting"&&typeof i.widthInColumns==="number"&&i.widthInColumns>f)t.warn(`Block ${i.id} width ${i.widthInColumns} exceeds configured column width ${f}`);if(i.label)i.label=We(i.label);if(i.type==="classDef"){Ye(i.id,i.css);continue}if(i.type==="applyClass"){Ue(i.id,i?.styleClass??"");continue}if(i.type==="applyStyles"){if(i?.stylesStr)Ke(i.id,i?.stylesStr);continue}if(i.type==="column-setting")a.columns=i.columns??-1;else if(i.type==="edge"){let p=(It.get(i.id)??0)+1;It.set(i.id,p),i.id=p+"-"+i.id,Mt.push(i)}else{if(!i.label)if(i.type==="composite")i.label="";else i.label=i.id;let p=tt.get(i.id);if(p===void 0)tt.set(i.id,i);else{if(i.type!=="na")p.type=i.type;if(i.label!==i.id)p.label=i.label}if(i.children)ce(i.children,i);if(i.type==="space"){let x=i.width??1;for(let m=0;m<x;m++){let b=qt(i);b.id=b.id+"-"+m,tt.set(b.id,b),o.push(b)}}else if(p===void 0)o.push(i)}}a.children=o},"populateBlockDatabase"),Ht=[],ot={id:"root",type:"composite",children:[],columns:-1},Xe=e(()=>{t.debug("Clear called"),d(),ot={id:"root",type:"composite",children:[],columns:-1},tt=new Map([["root",ot]]),Ht=[],xt=new Map,Mt=[],It=new Map,Ft=""},"clear");function le(s){switch(t.debug("typeStr2Type",s),s){case"[]":return"square";case"()":return t.debug("we have a round"),"round";case"(())":return"circle";case">]":return"rect_left_inv_arrow";case"{}":return"diamond";case"{{}}":return"hexagon";case"([])":return"stadium";case"[[]]":return"subroutine";case"[()]":return"cylinder";case"((()))":return"doublecircle";case"[//]":return"lean_right";case"[\\\\]":return"lean_left";case"[/\\]":return"trapezoid";case"[\\/]":return"inv_trapezoid";case"<[]>":return"block_arrow";default:return"na"}}e(le,"typeStr2Type");function oe(s){switch(t.debug("typeStr2Type",s),s){case"==":return"thick";default:return"normal"}}e(oe,"edgeTypeStr2Type");function he(s){switch(s.trim().slice(-1)){case"x":return"arrow_cross";case"o":return"arrow_circle";case">":return"arrow_point";default:return""}}e(he,"edgeStrToEdgeData");function ge(s){switch(s.trim().charAt(0)){case"x":return"arrow_cross";case"o":return"arrow_circle";case"<":return"arrow_point";default:return"arrow_open"}}e(ge,"edgeStrToEdgeStartData");function ue(s){return s.includes("==")?"thick":"normal"}e(ue,"edgeStrToThickness");function de(s){if(s.includes(".-"))return"dotted";return"solid"}e(de,"edgeStrToPattern");var $t=0,Ve=e(()=>($t++,"id-"+Math.random().toString(36).substr(2,12)+"-"+$t),"generateId"),Ze=e((s)=>{ot.children=s,ce(s,ot),Ht=ot.children},"setHierarchy"),Ge=e((s)=>{let a=tt.get(s);if(!a)return-1;if(a.columns)return a.columns;if(!a.children)return-1;return a.children.length},"getColumns"),je=e(()=>[...tt.values()],"getBlocksFlat"),qe=e(()=>Ht||[],"getBlocks"),Je=e(()=>Mt,"getEdges"),Qe=e((s)=>tt.get(s),"getBlock"),$e=e((s)=>{tt.set(s.id,s)},"setBlock"),tr=e((s)=>{Ft=s},"setDiagramId"),er=e(()=>Ft,"getDiagramId"),rr=e(()=>t,"getLogger"),ar=e(function(){return xt},"getClasses"),sr={getConfig:e(()=>u().block,"getConfig"),typeStr2Type:le,edgeTypeStr2Type:oe,edgeStrToEdgeData:he,edgeStrToEdgeStartData:ge,edgeStrToThickness:ue,edgeStrToPattern:de,getLogger:rr,getBlocksFlat:je,getBlocks:qe,getEdges:Je,setHierarchy:Ze,getBlock:Qe,setBlock:$e,getColumns:Ge,getClasses:ar,clear:Xe,generateId:Ve,setDiagramId:tr,getDiagramId:er},ir=sr,Bt=e((s,a)=>{let c=Rt,o=c(s,"r"),g=c(s,"g"),f=c(s,"b");return q(o,g,f,a)},"fade"),nr=e((s)=>`.label {
3
+ Expecting `+pt.join(", ")+", got '"+(this.terminals_[X]||X)+"'";else Tt="Parse error on line "+(W+1)+": Unexpected "+(X==ut?"end of input":"'"+(this.terminals_[X]||X)+"'");this.parseError(Tt,{text:Y.match,token:this.terminals_[X]||X,line:Y.yylineno,loc:vt,expected:pt})}if(j[0]instanceof Array&&j.length>1)throw Error("Parse Error: multiple actions possible at state: "+nt+", token: "+X);switch(j[0]){case 1:if(E.push(X),R.push(Y.yytext),y.push(Y.yylloc),E.push(j[1]),X=null,!Et){if(it=Y.yyleng,v=Y.yytext,W=Y.yylineno,vt=Y.yylloc,rt>0)rt--}else X=Et,Et=null;break;case 2:if(st=this.productions_[j[1]][1],ct.$=R[R.length-st],ct._$={first_line:y[y.length-(st||1)].first_line,last_line:y[y.length-1].last_line,first_column:y[y.length-(st||1)].first_column,last_column:y[y.length-1].last_column},Ce)ct._$.range=[y[y.length-(st||1)].range[0],y[y.length-1].range[1]];if(_t=this.performAction.apply(ct,[v,it,W,at.yy,j[1],R,y].concat(St)),typeof _t<"u")return _t;if(st)E=E.slice(0,-1*st*2),R=R.slice(0,-1*st),y=y.slice(0,-1*st);E.push(this.productions_[j[1]][0]),R.push(ct.$),y.push(ct._$),Zt=V[E[E.length-2]][E[E.length-1]],E.push(Zt);break;case 3:return!0}}return!0},"parse")},F=function(){var z={EOF:1,parseError:e(function(S,E){if(this.yy.parser)this.yy.parser.parseError(S,E);else throw Error(S)},"parseError"),setInput:e(function(N,S){if(this.yy=S||this.yy||{},this._input=N,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 N=this._input[0];this.yytext+=N,this.yyleng++,this.offset++,this.match+=N,this.matched+=N;var S=N.match(/(?:\r\n?|\n).*/g);if(S)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),N},"input"),unput:e(function(N){var S=N.length,E=N.split(/(?:\r\n?|\n)/g);this._input=N+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-S),this.offset-=S;var C=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),E.length-1)this.yylineno-=E.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:E?(E.length===C.length?this.yylloc.first_column:0)+C[C.length-E.length].length-E[0].length:this.yylloc.first_column-S},this.options.ranges)this.yylloc.range=[R[0],R[0]+this.yyleng-S];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
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:e(function(N){this.unput(this.match.slice(N))},"less"),pastInput:e(function(){var N=this.matched.substr(0,this.matched.length-this.match.length);return(N.length>20?"...":"")+N.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:e(function(){var N=this.match;if(N.length<20)N+=this._input.substr(0,20-N.length);return(N.substr(0,20)+(N.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:e(function(){var N=this.pastInput(),S=Array(N.length+1).join("-");return N+this.upcomingInput()+`
5
+ `+S+"^"},"showPosition"),test_match:e(function(N,S){var E,C,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(C=N[0].match(/(?:\r\n?|\n).*/g),C)this.yylineno+=C.length;if(this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:C?C[C.length-1].length-C[C.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+N[0].length},this.yytext+=N[0],this.match+=N[0],this.matches=N,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(N[0].length),this.matched+=N[0],E=this.performAction.call(this,this.yy,this,S,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input)this.done=!1;if(E)return E;else if(this._backtrack){for(var y in R)this[y]=R[y];return!1}return!1},"test_match"),next:e(function(){if(this.done)return this.EOF;if(!this._input)this.done=!0;var N,S,E,C;if(!this._more)this.yytext="",this.match="";var R=this._currentRules();for(var y=0;y<R.length;y++)if(E=this._input.match(this.rules[R[y]]),E&&(!S||E[0].length>S[0].length)){if(S=E,C=y,this.options.backtrack_lexer)if(N=this.test_match(E,R[y]),N!==!1)return N;else if(this._backtrack){S=!1;continue}else return!1;else if(!this.options.flex)break}if(S){if(N=this.test_match(S,R[C]),N!==!1)return N;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 S=this.next();if(S)return S;else return this.lex()},"lex"),begin:e(function(S){this.conditionStack.push(S)},"begin"),popState:e(function(){var S=this.conditionStack.length-1;if(S>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(S){if(S=this.conditionStack.length-1-Math.abs(S||0),S>=0)return this.conditionStack[S];else return"INITIAL"},"topState"),pushState:e(function(S){this.begin(S)},"pushState"),stateStackSize:e(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:e(function(S,E,C,R){var y=R;switch(C){case 0:return S.getLogger().debug("Found block-beta"),10;break;case 1:return S.getLogger().debug("Found id-block"),29;break;case 2:return S.getLogger().debug("Found block"),10;break;case 3:S.getLogger().debug(".",E.yytext);break;case 4:S.getLogger().debug("_",E.yytext);break;case 5:return 5;case 6:return E.yytext=-1,28;break;case 7:return E.yytext=E.yytext.replace(/columns\s+/,""),S.getLogger().debug("COLUMNS (LEX)",E.yytext),28;break;case 8:this.pushState("md_string");break;case 9:return"MD_STR";case 10:this.popState();break;case 11:this.pushState("string");break;case 12:S.getLogger().debug("LEX: POPPING STR:",E.yytext),this.popState();break;case 13:return S.getLogger().debug("LEX: STR end:",E.yytext),"STR";break;case 14:return E.yytext=E.yytext.replace(/space\:/,""),S.getLogger().debug("SPACE NUM (LEX)",E.yytext),21;break;case 15:return E.yytext="1",S.getLogger().debug("COLUMNS (LEX)",E.yytext),21;break;case 16:return 42;case 17:return"LINKSTYLE";case 18:return"INTERPOLATE";case 19:return this.pushState("CLASSDEF"),39;break;case 20:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";break;case 21:return this.popState(),this.pushState("CLASSDEFID"),40;break;case 22:return this.popState(),41;break;case 23:return this.pushState("CLASS"),43;break;case 24:return this.popState(),this.pushState("CLASS_STYLE"),44;break;case 25:return this.popState(),45;break;case 26:return this.pushState("STYLE_STMNT"),46;break;case 27:return this.popState(),this.pushState("STYLE_DEFINITION"),47;break;case 28:return this.popState(),48;break;case 29:return this.pushState("acc_title"),"acc_title";break;case 30:return this.popState(),"acc_title_value";break;case 31:return this.pushState("acc_descr"),"acc_descr";break;case 32:return this.popState(),"acc_descr_value";break;case 33:this.pushState("acc_descr_multiline");break;case 34:this.popState();break;case 35:return"acc_descr_multiline_value";case 36:return 30;case 37:return this.popState(),S.getLogger().debug("Lex: (("),"NODE_DEND";break;case 38:return this.popState(),S.getLogger().debug("Lex: (("),"NODE_DEND";break;case 39:return this.popState(),S.getLogger().debug("Lex: ))"),"NODE_DEND";break;case 40:return this.popState(),S.getLogger().debug("Lex: (("),"NODE_DEND";break;case 41:return this.popState(),S.getLogger().debug("Lex: (("),"NODE_DEND";break;case 42:return this.popState(),S.getLogger().debug("Lex: (-"),"NODE_DEND";break;case 43:return this.popState(),S.getLogger().debug("Lex: -)"),"NODE_DEND";break;case 44:return this.popState(),S.getLogger().debug("Lex: (("),"NODE_DEND";break;case 45:return this.popState(),S.getLogger().debug("Lex: ]]"),"NODE_DEND";break;case 46:return this.popState(),S.getLogger().debug("Lex: ("),"NODE_DEND";break;case 47:return this.popState(),S.getLogger().debug("Lex: ])"),"NODE_DEND";break;case 48:return this.popState(),S.getLogger().debug("Lex: /]"),"NODE_DEND";break;case 49:return this.popState(),S.getLogger().debug("Lex: /]"),"NODE_DEND";break;case 50:return this.popState(),S.getLogger().debug("Lex: )]"),"NODE_DEND";break;case 51:return this.popState(),S.getLogger().debug("Lex: )"),"NODE_DEND";break;case 52:return this.popState(),S.getLogger().debug("Lex: ]>"),"NODE_DEND";break;case 53:return this.popState(),S.getLogger().debug("Lex: ]"),"NODE_DEND";break;case 54:return S.getLogger().debug("Lexa: -)"),this.pushState("NODE"),35;break;case 55:return S.getLogger().debug("Lexa: (-"),this.pushState("NODE"),35;break;case 56:return S.getLogger().debug("Lexa: ))"),this.pushState("NODE"),35;break;case 57:return S.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;break;case 58:return S.getLogger().debug("Lex: ((("),this.pushState("NODE"),35;break;case 59:return S.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;break;case 60:return S.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;break;case 61:return S.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;break;case 62:return S.getLogger().debug("Lexc: >"),this.pushState("NODE"),35;break;case 63:return S.getLogger().debug("Lexa: (["),this.pushState("NODE"),35;break;case 64:return S.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;break;case 65:return this.pushState("NODE"),35;break;case 66:return this.pushState("NODE"),35;break;case 67:return this.pushState("NODE"),35;break;case 68:return this.pushState("NODE"),35;break;case 69:return this.pushState("NODE"),35;break;case 70:return this.pushState("NODE"),35;break;case 71:return this.pushState("NODE"),35;break;case 72:return S.getLogger().debug("Lexa: ["),this.pushState("NODE"),35;break;case 73:return this.pushState("BLOCK_ARROW"),S.getLogger().debug("LEX ARR START"),37;break;case 74:return S.getLogger().debug("Lex: NODE_ID",E.yytext),31;break;case 75:return S.getLogger().debug("Lex: EOF",E.yytext),8;break;case 76:this.pushState("md_string");break;case 77:this.pushState("md_string");break;case 78:return"NODE_DESCR";case 79:this.popState();break;case 80:S.getLogger().debug("Lex: Starting string"),this.pushState("string");break;case 81:S.getLogger().debug("LEX ARR: Starting string"),this.pushState("string");break;case 82:return S.getLogger().debug("LEX: NODE_DESCR:",E.yytext),"NODE_DESCR";break;case 83:S.getLogger().debug("LEX POPPING"),this.popState();break;case 84:S.getLogger().debug("Lex: =>BAE"),this.pushState("ARROW_DIR");break;case 85:return E.yytext=E.yytext.replace(/^,\s*/,""),S.getLogger().debug("Lex (right): dir:",E.yytext),"DIR";break;case 86:return E.yytext=E.yytext.replace(/^,\s*/,""),S.getLogger().debug("Lex (left):",E.yytext),"DIR";break;case 87:return E.yytext=E.yytext.replace(/^,\s*/,""),S.getLogger().debug("Lex (x):",E.yytext),"DIR";break;case 88:return E.yytext=E.yytext.replace(/^,\s*/,""),S.getLogger().debug("Lex (y):",E.yytext),"DIR";break;case 89:return E.yytext=E.yytext.replace(/^,\s*/,""),S.getLogger().debug("Lex (up):",E.yytext),"DIR";break;case 90:return E.yytext=E.yytext.replace(/^,\s*/,""),S.getLogger().debug("Lex (down):",E.yytext),"DIR";break;case 91:return E.yytext="]>",S.getLogger().debug("Lex (ARROW_DIR end):",E.yytext),this.popState(),this.popState(),"BLOCK_ARROW_END";break;case 92:return S.getLogger().debug("Lex: LINK","#"+E.yytext+"#"),15;break;case 93:return S.getLogger().debug("Lex: LINK",E.yytext),15;break;case 94:return S.getLogger().debug("Lex: LINK",E.yytext),15;break;case 95:return S.getLogger().debug("Lex: LINK",E.yytext),15;break;case 96:return S.getLogger().debug("Lex: START_LINK",E.yytext),this.pushState("LLABEL"),16;break;case 97:return S.getLogger().debug("Lex: START_LINK",E.yytext),this.pushState("LLABEL"),16;break;case 98:return S.getLogger().debug("Lex: START_LINK",E.yytext),this.pushState("LLABEL"),16;break;case 99:this.pushState("md_string");break;case 100:return S.getLogger().debug("Lex: Starting string"),this.pushState("string"),"LINK_LABEL";break;case 101:return this.popState(),S.getLogger().debug("Lex: LINK","#"+E.yytext+"#"),15;break;case 102:return this.popState(),S.getLogger().debug("Lex: LINK",E.yytext),15;break;case 103:return this.popState(),S.getLogger().debug("Lex: LINK",E.yytext),15;break;case 104:return S.getLogger().debug("Lex: COLON",E.yytext),E.yytext=E.yytext.slice(1),27;break}},"anonymous"),rules:[/^(?:block-beta\b)/,/^(?:block:)/,/^(?:block\b)/,/^(?:[\s]+)/,/^(?:[\n]+)/,/^(?:((\u000D\u000A)|(\u000A)))/,/^(?:columns\s+auto\b)/,/^(?:columns\s+[\d]+)/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:space[:]\d+)/,/^(?:space\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\s+)/,/^(?:DEFAULT\s+)/,/^(?:\w+\s+)/,/^(?:[^\n]*)/,/^(?:class\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:style\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:end\b\s*)/,/^(?:\(\(\()/,/^(?:\)\)\))/,/^(?:[\)]\))/,/^(?:\}\})/,/^(?:\})/,/^(?:\(-)/,/^(?:-\))/,/^(?:\(\()/,/^(?:\]\])/,/^(?:\()/,/^(?:\]\))/,/^(?:\\\])/,/^(?:\/\])/,/^(?:\)\])/,/^(?:[\)])/,/^(?:\]>)/,/^(?:[\]])/,/^(?:-\))/,/^(?:\(-)/,/^(?:\)\))/,/^(?:\))/,/^(?:\(\(\()/,/^(?:\(\()/,/^(?:\{\{)/,/^(?:\{)/,/^(?:>)/,/^(?:\(\[)/,/^(?:\()/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\[\\)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:\[)/,/^(?:<\[)/,/^(?:[^\(\[\n\-\)\{\}\s\<\>:=]+)/,/^(?:$)/,/^(?:["][`])/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:\]>\s*\()/,/^(?:,?\s*right\s*)/,/^(?:,?\s*left\s*)/,/^(?:,?\s*x\s*)/,/^(?:,?\s*y\s*)/,/^(?:,?\s*up\s*)/,/^(?:,?\s*down\s*)/,/^(?:\)\s*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*~~[\~]+\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:["][`])/,/^(?:["])/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?::\d+)/],conditions:{STYLE_DEFINITION:{rules:[28],inclusive:!1},STYLE_STMNT:{rules:[27],inclusive:!1},CLASSDEFID:{rules:[22],inclusive:!1},CLASSDEF:{rules:[20,21],inclusive:!1},CLASS_STYLE:{rules:[25],inclusive:!1},CLASS:{rules:[24],inclusive:!1},LLABEL:{rules:[99,100,101,102,103],inclusive:!1},ARROW_DIR:{rules:[85,86,87,88,89,90,91],inclusive:!1},BLOCK_ARROW:{rules:[76,81,84],inclusive:!1},NODE:{rules:[37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,77,80],inclusive:!1},md_string:{rules:[9,10,78,79],inclusive:!1},space:{rules:[],inclusive:!1},string:{rules:[12,13,82,83],inclusive:!1},acc_descr_multiline:{rules:[34,35],inclusive:!1},acc_descr:{rules:[32],inclusive:!1},acc_title:{rules:[30],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,11,14,15,16,17,18,19,23,26,29,31,33,36,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,92,93,94,95,96,97,98,104],inclusive:!0}}};return z}();I.lexer=F;function A(){this.yy={}}return e(A,"Parser"),A.prototype=I,I.Parser=A,new A}();Nt.parser=Nt;var Pe=Nt,tt=new Map,Mt=[],It=new Map,Jt="color",Qt="fill",He="bgFill",ne=",",xt=new Map,Ft="",We=e((s)=>l.sanitizeText(s,r()),"sanitizeText"),Ye=e(function(s,a=""){let c=xt.get(s);if(!c)c={id:s,styles:[],textStyles:[]},xt.set(s,c);if(a!==void 0&&a!==null)a.split(ne).forEach((o)=>{let g=o.replace(/([^;]*);/,"$1").trim();if(RegExp(Jt).exec(o)){let i=g.replace(Qt,He).replace(Jt,Qt);c.textStyles.push(i)}c.styles.push(g)})},"addStyleClass"),Ke=e(function(s,a=""){let c=tt.get(s);if(a!==void 0&&a!==null)c.styles=a.split(ne)},"addStyle2Node"),Ue=e(function(s,a){s.split(",").forEach(function(c){let o=tt.get(c);if(o===void 0){let g=c.trim();o={id:g,type:"na",children:[]},tt.set(g,o)}if(!o.classes)o.classes=[];o.classes.push(a)})},"setCssClass"),ce=e((s,a)=>{let c=s.flat(),o=[],f=c.find((i)=>i?.type==="column-setting")?.columns??-1;for(let i of c){if(typeof f==="number"&&f>0&&i.type!=="column-setting"&&typeof i.widthInColumns==="number"&&i.widthInColumns>f)t.warn(`Block ${i.id} width ${i.widthInColumns} exceeds configured column width ${f}`);if(i.label)i.label=We(i.label);if(i.type==="classDef"){Ye(i.id,i.css);continue}if(i.type==="applyClass"){Ue(i.id,i?.styleClass??"");continue}if(i.type==="applyStyles"){if(i?.stylesStr)Ke(i.id,i?.stylesStr);continue}if(i.type==="column-setting")a.columns=i.columns??-1;else if(i.type==="edge"){let p=(It.get(i.id)??0)+1;It.set(i.id,p),i.id=p+"-"+i.id,Mt.push(i)}else{if(!i.label)if(i.type==="composite")i.label="";else i.label=i.id;let p=tt.get(i.id);if(p===void 0)tt.set(i.id,i);else{if(i.type!=="na")p.type=i.type;if(i.label!==i.id)p.label=i.label}if(i.children)ce(i.children,i);if(i.type==="space"){let x=i.width??1;for(let m=0;m<x;m++){let b=qt(i);b.id=b.id+"-"+m,tt.set(b.id,b),o.push(b)}}else if(p===void 0)o.push(i)}}a.children=o},"populateBlockDatabase"),Ht=[],ot={id:"root",type:"composite",children:[],columns:-1},Xe=e(()=>{t.debug("Clear called"),d(),ot={id:"root",type:"composite",children:[],columns:-1},tt=new Map([["root",ot]]),Ht=[],xt=new Map,Mt=[],It=new Map,Ft=""},"clear");function le(s){switch(t.debug("typeStr2Type",s),s){case"[]":return"square";case"()":return t.debug("we have a round"),"round";case"(())":return"circle";case">]":return"rect_left_inv_arrow";case"{}":return"diamond";case"{{}}":return"hexagon";case"([])":return"stadium";case"[[]]":return"subroutine";case"[()]":return"cylinder";case"((()))":return"doublecircle";case"[//]":return"lean_right";case"[\\\\]":return"lean_left";case"[/\\]":return"trapezoid";case"[\\/]":return"inv_trapezoid";case"<[]>":return"block_arrow";default:return"na"}}e(le,"typeStr2Type");function oe(s){switch(t.debug("typeStr2Type",s),s){case"==":return"thick";default:return"normal"}}e(oe,"edgeTypeStr2Type");function he(s){switch(s.trim().slice(-1)){case"x":return"arrow_cross";case"o":return"arrow_circle";case">":return"arrow_point";default:return""}}e(he,"edgeStrToEdgeData");function ge(s){switch(s.trim().charAt(0)){case"x":return"arrow_cross";case"o":return"arrow_circle";case"<":return"arrow_point";default:return"arrow_open"}}e(ge,"edgeStrToEdgeStartData");function ue(s){return s.includes("==")?"thick":"normal"}e(ue,"edgeStrToThickness");function de(s){if(s.includes(".-"))return"dotted";return"solid"}e(de,"edgeStrToPattern");var $t=0,Ve=e(()=>($t++,"id-"+Math.random().toString(36).substr(2,12)+"-"+$t),"generateId"),Ze=e((s)=>{ot.children=s,ce(s,ot),Ht=ot.children},"setHierarchy"),Ge=e((s)=>{let a=tt.get(s);if(!a)return-1;if(a.columns)return a.columns;if(!a.children)return-1;return a.children.length},"getColumns"),je=e(()=>[...tt.values()],"getBlocksFlat"),qe=e(()=>Ht||[],"getBlocks"),Je=e(()=>Mt,"getEdges"),Qe=e((s)=>tt.get(s),"getBlock"),$e=e((s)=>{tt.set(s.id,s)},"setBlock"),tr=e((s)=>{Ft=s},"setDiagramId"),er=e(()=>Ft,"getDiagramId"),rr=e(()=>t,"getLogger"),ar=e(function(){return xt},"getClasses"),sr={getConfig:e(()=>u().block,"getConfig"),typeStr2Type:le,edgeTypeStr2Type:oe,edgeStrToEdgeData:he,edgeStrToEdgeStartData:ge,edgeStrToThickness:ue,edgeStrToPattern:de,getLogger:rr,getBlocksFlat:je,getBlocks:qe,getEdges:Je,setHierarchy:Ze,getBlock:Qe,setBlock:$e,getColumns:Ge,getClasses:ar,clear:Xe,generateId:Ve,setDiagramId:tr,getDiagramId:er},ir=sr,Bt=e((s,a)=>{let c=Rt,o=c(s,"r"),g=c(s,"g"),f=c(s,"b");return q(o,g,f,a)},"fade"),nr=e((s)=>`.label {
7
7
  font-family: ${s.fontFamily};
8
8
  color: ${s.nodeTextColor||s.textColor};
9
9
  }
@@ -126,7 +126,7 @@ Expecting `+pt.join(", ")+", got '"+(this.terminals_[X]||X)+"'";else Tt="Parse e
126
126
  fill: ${s.textColor};
127
127
  }
128
128
  ${we()}
129
- `,"getStyles"),cr=nr,lr=e((s,a,c,o)=>{a.forEach((g)=>{br[g](s,c,o)})},"insertMarkers"),or=e((s,a,c)=>{t.trace("Making markers for ",c),s.append("defs").append("marker").attr("id",c+"_"+a+"-extensionStart").attr("class","marker extension "+a).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),s.append("defs").append("marker").attr("id",c+"_"+a+"-extensionEnd").attr("class","marker extension "+a).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z")},"extension"),hr=e((s,a,c)=>{s.append("defs").append("marker").attr("id",c+"_"+a+"-compositionStart").attr("class","marker composition "+a).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),s.append("defs").append("marker").attr("id",c+"_"+a+"-compositionEnd").attr("class","marker composition "+a).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),gr=e((s,a,c)=>{s.append("defs").append("marker").attr("id",c+"_"+a+"-aggregationStart").attr("class","marker aggregation "+a).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),s.append("defs").append("marker").attr("id",c+"_"+a+"-aggregationEnd").attr("class","marker aggregation "+a).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),ur=e((s,a,c)=>{s.append("defs").append("marker").attr("id",c+"_"+a+"-dependencyStart").attr("class","marker dependency "+a).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),s.append("defs").append("marker").attr("id",c+"_"+a+"-dependencyEnd").attr("class","marker dependency "+a).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),dr=e((s,a,c)=>{s.append("defs").append("marker").attr("id",c+"_"+a+"-lollipopStart").attr("class","marker lollipop "+a).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),s.append("defs").append("marker").attr("id",c+"_"+a+"-lollipopEnd").attr("class","marker lollipop "+a).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)},"lollipop"),pr=e((s,a,c)=>{s.append("marker").attr("id",c+"_"+a+"-pointEnd").attr("class","marker "+a).attr("viewBox","0 0 10 10").attr("refX",6).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),s.append("marker").attr("id",c+"_"+a+"-pointStart").attr("class","marker "+a).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"point"),fr=e((s,a,c)=>{s.append("marker").attr("id",c+"_"+a+"-circleEnd").attr("class","marker "+a).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),s.append("marker").attr("id",c+"_"+a+"-circleStart").attr("class","marker "+a).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"circle"),xr=e((s,a,c)=>{s.append("marker").attr("id",c+"_"+a+"-crossEnd").attr("class","marker cross "+a).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),s.append("marker").attr("id",c+"_"+a+"-crossStart").attr("class","marker cross "+a).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0")},"cross"),yr=e((s,a,c)=>{s.append("defs").append("marker").attr("id",c+"_"+a+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),br={extension:or,composition:hr,aggregation:gr,dependency:ur,lollipop:dr,point:pr,circle:fr,cross:xr,barb:yr},mr=lr;function Ct(s,a){if(s===0||!Number.isInteger(s))throw Error("Columns must be an integer !== 0.");if(a<0||!Number.isInteger(a))throw Error("Position must be a non-negative integer."+a);if(s<0)return{px:a,py:0};if(s===1)return{px:0,py:a};let c=a%s,o=Math.floor(a/s);return{px:c,py:o}}e(Ct,"calculateBlockPosition");var wr=e((s)=>{let a=0,c=0;for(let o of s.children){let{width:g,height:f,x:i,y:p}=o.size??{width:0,height:0,x:0,y:0};if(t.debug("getMaxChildSize abc95 child:",o.id,"width:",g,"height:",f,"x:",i,"y:",p,o.type),o.type==="space")continue;let x=g/(o.widthInColumns??1);if(x>a)a=x;if(f>c)c=f}return{width:a,height:c}},"getMaxChildSize");function yt(s,a,c=0,o=0,g=8){if(t.debug("setBlockSizes abc95 (start)",s.id,s?.size?.x,"block width =",s?.size,"siblingWidth",c),!s?.size?.width)s.size={width:c,height:o,x:0,y:0};let f=0,i=0;if(s.children?.length>0){for(let T of s.children)yt(T,a,0,0,g);let p=wr(s);f=p.width,i=p.height,t.debug("setBlockSizes abc95 maxWidth of",s.id,":s children is ",f,i);for(let T of s.children)if(T.size)t.debug(`abc95 Setting size of children of ${s.id} id=${T.id} ${f} ${i} ${JSON.stringify(T.size)}`),T.size.width=f*(T.widthInColumns??1)+g*((T.widthInColumns??1)-1),T.size.height=i,T.size.x=0,T.size.y=0,t.debug(`abc95 updating size of ${s.id} children child:${T.id} maxWidth:${f} maxHeight:${i}`);for(let T of s.children)yt(T,a,f,i,g);let x=s.columns??-1,m=0;for(let T of s.children)m+=T.widthInColumns??1;let b=s.children.length;if(x>0&&x<m)b=x;let S=Math.ceil(m/b),D=b*(f+g)+g,B=S*(i+g)+g;if(D<c){t.debug(`Detected to small sibling: abc95 ${s.id} siblingWidth ${c} siblingHeight ${o} width ${D}`),D=c,B=o;let T=(c-b*g-g)/b,O=(o-S*g-g)/S;t.debug("Size indata abc88",s.id,"childWidth",T,"maxWidth",f),t.debug("Size indata abc88",s.id,"childHeight",O,"maxHeight",i),t.debug("Size indata abc88 xSize",b,"padding",g);for(let I of s.children)if(I.size)I.size.width=T,I.size.height=O,I.size.x=0,I.size.y=0}if(t.debug(`abc95 (finale calc) ${s.id} xSize ${b} ySize ${S} columns ${x}${s.children.length} width=${Math.max(D,s.size?.width||0)}`),D<(s?.size?.width||0)){D=s?.size?.width||0;let T=x>0?Math.min(s.children.length,x):s.children.length;if(T>0){let O=(D-T*g-g)/T;t.debug("abc95 (growing to fit) width",s.id,D,s.size?.width,O);for(let I of s.children)if(I.size)I.size.width=O}}s.size={width:D,height:B,x:0,y:0}}t.debug("setBlockSizes abc94 (done)",s.id,s?.size?.x,s?.size?.width,s?.size?.y,s?.size?.height)}e(yt,"setBlockSizes");function Wt(s,a,c=8){t.debug(`abc85 layout blocks (=>layoutBlocks) ${s.id} x: ${s?.size?.x} y: ${s?.size?.y} width: ${s?.size?.width}`);let o=s.columns??-1;if(t.debug("layoutBlocks columns abc95",s.id,"=>",o,s),s.children&&s.children.length>0){let g=s?.children[0]?.size?.width??0,f=s.children.length*g+(s.children.length-1)*c;t.debug("widthOfChildren 88",f,"posX");let i=new Map;{let S=0;for(let D of s.children){if(!D.size)continue;let{py:B}=Ct(o,S),T=i.get(B)??0;if(D.size.height>T)i.set(B,D.size.height);let O=D?.widthInColumns??1;if(o>0)O=Math.min(O,o-S%o);S+=O}}let p=new Map;{let S=0,D=[...i.keys()].sort((B,T)=>B-T);for(let B of D)p.set(B,S),S+=(i.get(B)??0)+c}let x=0;t.debug("abc91 block?.size?.x",s.id,s?.size?.x);let m=s?.size?.x?s?.size?.x+(-s?.size?.width/2||0):-c,b=0;for(let S of s.children){let D=s;if(!S.size)continue;let{width:B,height:T}=S.size,{px:O,py:I}=Ct(o,x);if(I!=b)b=I,m=s?.size?.x?s?.size?.x+(-s?.size?.width/2||0):-c,t.debug("New row in layout for block",s.id," and child ",S.id,b);if(t.debug(`abc89 layout blocks (child) id: ${S.id} Pos: ${x} (px, py) ${O},${I} (${D?.size?.x},${D?.size?.y}) parent: ${D.id} width: ${B}${c}`),D.size){let A=B/2;S.size.x=m+c+A,t.debug(`abc91 layout blocks (calc) px, pyid:${S.id} startingPos=X${m} new startingPosX${S.size.x} ${A} padding=${c} width=${B} halfWidth=${A} => x:${S.size.x} y:${S.size.y} ${S.widthInColumns} (width * (child?.w || 1)) / 2 ${B*(S?.widthInColumns??1)/2}`),m=S.size.x+A;let z=p.get(I)??0,N=i.get(I)??T;S.size.y=D.size.y-D.size.height/2+z+N/2+c,t.debug(`abc88 layout blocks (calc) px, pyid:${S.id}startingPosX${m}${c}${A}=>x:${S.size.x}y:${S.size.y}${S.widthInColumns}(width * (child?.w || 1)) / 2${B*(S?.widthInColumns??1)/2}`)}if(S.children)Wt(S,a,c);let F=S?.widthInColumns??1;if(o>0)F=Math.min(F,o-x%o);x+=F,t.debug("abc88 columnsPos",S,x)}}t.debug(`layout blocks (<==layoutBlocks) ${s.id} x: ${s?.size?.x} y: ${s?.size?.y} width: ${s?.size?.width}`)}e(Wt,"layoutBlocks");function Kt(s,{minX:a,minY:c,maxX:o,maxY:g}={minX:0,minY:0,maxX:0,maxY:0}){if(s.size&&s.id!=="root"){let{x:f,y:i,width:p,height:x}=s.size;if(f-p/2<a)a=f-p/2;if(i-x/2<c)c=i-x/2;if(f+p/2>o)o=f+p/2;if(i+x/2>g)g=i+x/2}if(s.children)for(let f of s.children)({minX:a,minY:c,maxX:o,maxY:g}=Kt(f,{minX:a,minY:c,maxX:o,maxY:g}));return{minX:a,minY:c,maxX:o,maxY:g}}e(Kt,"findBounds");function pe(s){let a=s.getBlock("root");if(!a)return;let c=r()?.block?.padding??8;yt(a,s,0,0,c),Wt(a,s,c),t.debug("getBlocks",JSON.stringify(a,null,2));let{minX:o,minY:g,maxX:f,maxY:i}=Kt(a),p=i-g,x=f-o;return{x:o,y:g,width:x,height:p}}e(pe,"layout");var kr=e(async(s,a,c,o=!1,g=!1)=>{let f=a||"";if(typeof f==="object")f=f[0];let i=r(),p=M(i);return await Z(s,f,{style:c,isTitle:o,useHtmlLabels:p,markdown:!1,isNode:g,width:Number.POSITIVE_INFINITY},i)},"createLabel"),Q=kr,Sr=e((s,a,c,o,g)=>{if(a.arrowTypeStart)te(s,"start",a.arrowTypeStart,c,o,g);if(a.arrowTypeEnd)te(s,"end",a.arrowTypeEnd,c,o,g)},"addEdgeMarkers"),Lr={arrow_cross:"cross",arrow_point:"point",arrow_barb:"barb",arrow_circle:"circle",aggregation:"aggregation",extension:"extension",composition:"composition",dependency:"dependency",lollipop:"lollipop"},te=e((s,a,c,o,g,f)=>{let i=Lr[c];if(!i){t.warn(`Unknown arrow type: ${c}`);return}let p=a==="start"?"Start":"End";s.attr(`marker-${a}`,`url(${o}#${g}_${f}-${i}${p})`)},"addEdgeMarker"),At={},U={},vr=e(async(s,a)=>{let c=r(),o=M(c),g=s.insert("g").attr("class","edgeLabel"),f=g.insert("g").attr("class","label"),i=a.labelType==="markdown",p=await Z(s,a.label,{style:a.labelStyle,useHtmlLabels:o,addSvgBackground:i,isNode:!1,markdown:i,width:i?void 0:Number.POSITIVE_INFINITY},c);f.node().appendChild(p);let x=p.getBBox(),m=x;if(o){let S=p.children[0],D=n(p);x=S.getBoundingClientRect(),m=x,D.attr("width",x.width),D.attr("height",x.height)}else{let S=n(p).select("text").node();if(S&&typeof S.getBBox==="function")m=S.getBBox()}f.attr("transform",Fe(m,o)),At[a.id]=g,a.width=x.width,a.height=x.height;let b;if(a.startLabelLeft){let S=s.insert("g").attr("class","edgeTerminals"),D=S.insert("g").attr("class","inner"),B=await Q(D,a.startLabelLeft,a.labelStyle);b=B;let T=B.getBBox();if(o){let O=B.children[0],I=n(B);T=O.getBoundingClientRect(),I.attr("width",T.width),I.attr("height",T.height)}if(D.attr("transform",Fe(T,o)),!U[a.id])U[a.id]={};U[a.id].startLeft=S,lt(b,a.startLabelLeft)}if(a.startLabelRight){let S=s.insert("g").attr("class","edgeTerminals"),D=S.insert("g").attr("class","inner"),B=await Q(D,a.startLabelRight,a.labelStyle);b=B;let T=B.getBBox();if(o){let O=B.children[0],I=n(B);T=O.getBoundingClientRect(),I.attr("width",T.width),I.attr("height",T.height)}if(D.attr("transform",Fe(T,o)),!U[a.id])U[a.id]={};U[a.id].startRight=S,lt(b,a.startLabelRight)}if(a.endLabelLeft){let S=s.insert("g").attr("class","edgeTerminals"),D=S.insert("g").attr("class","inner"),B=await Q(S,a.endLabelLeft,a.labelStyle);b=B;let T=B.getBBox();if(o){let O=B.children[0],I=n(B);T=O.getBoundingClientRect(),I.attr("width",T.width),I.attr("height",T.height)}if(D.attr("transform",Fe(T,o)),!U[a.id])U[a.id]={};U[a.id].endLeft=S,lt(b,a.endLabelLeft)}if(a.endLabelRight){let S=s.insert("g").attr("class","edgeTerminals"),D=S.insert("g").attr("class","inner"),B=await Q(S,a.endLabelRight,a.labelStyle);b=B;let T=B.getBBox();if(o){let O=B.children[0],I=n(B);T=O.getBoundingClientRect(),I.attr("width",T.width),I.attr("height",T.height)}if(D.attr("transform",Fe(T,o)),!U[a.id])U[a.id]={};U[a.id].endRight=S,lt(b,a.endLabelRight)}return p},"insertEdgeLabel");function lt(s,a){if(M(r())&&s)s.style.width=a.length*9+"px",s.style.height="12px"}e(lt,"setTerminalWidth");var Er=e((s,a)=>{t.debug("Moving label abc88 ",s.id,s.label,At[s.id],a);let c=a.updatedPath?a.updatedPath:a.originalPath,o=r(),{subGraphTitleTotalMargin:g}=Ne(o);if(s.label){let f=At[s.id],{x:i,y:p}=s;if(c){let x=h.calcLabelPosition(c);if(t.debug("Moving label "+s.label+" from (",i,",",p,") to (",x.x,",",x.y,") abc88"),a.updatedPath)i=x.x,p=x.y}f.attr("transform",`translate(${i}, ${p+g/2})`)}if(s.startLabelLeft){let f=U[s.id].startLeft,{x:i,y:p}=s;if(c){let x=h.calcTerminalLabelPosition(s.arrowTypeStart?10:0,"start_left",c);i=x.x,p=x.y}f.attr("transform",`translate(${i}, ${p})`)}if(s.startLabelRight){let f=U[s.id].startRight,{x:i,y:p}=s;if(c){let x=h.calcTerminalLabelPosition(s.arrowTypeStart?10:0,"start_right",c);i=x.x,p=x.y}f.attr("transform",`translate(${i}, ${p})`)}if(s.endLabelLeft){let f=U[s.id].endLeft,{x:i,y:p}=s;if(c){let x=h.calcTerminalLabelPosition(s.arrowTypeEnd?10:0,"end_left",c);i=x.x,p=x.y}f.attr("transform",`translate(${i}, ${p})`)}if(s.endLabelRight){let f=U[s.id].endRight,{x:i,y:p}=s;if(c){let x=h.calcTerminalLabelPosition(s.arrowTypeEnd?10:0,"end_right",c);i=x.x,p=x.y}f.attr("transform",`translate(${i}, ${p})`)}},"positionEdgeLabel"),_r=e((s,a)=>{let{x:c,y:o}=s,g=Math.abs(a.x-c),f=Math.abs(a.y-o),i=s.width/2,p=s.height/2;if(g>=i||f>=p)return!0;return!1},"outsideNode"),Dr=e((s,a,c)=>{t.debug(`intersection calc abc89:
129
+ `,"getStyles"),cr=nr,lr=e((s,a,c,o)=>{a.forEach((g)=>{br[g](s,c,o)})},"insertMarkers"),or=e((s,a,c)=>{t.trace("Making markers for ",c),s.append("defs").append("marker").attr("id",c+"_"+a+"-extensionStart").attr("class","marker extension "+a).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),s.append("defs").append("marker").attr("id",c+"_"+a+"-extensionEnd").attr("class","marker extension "+a).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z")},"extension"),hr=e((s,a,c)=>{s.append("defs").append("marker").attr("id",c+"_"+a+"-compositionStart").attr("class","marker composition "+a).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),s.append("defs").append("marker").attr("id",c+"_"+a+"-compositionEnd").attr("class","marker composition "+a).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),gr=e((s,a,c)=>{s.append("defs").append("marker").attr("id",c+"_"+a+"-aggregationStart").attr("class","marker aggregation "+a).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),s.append("defs").append("marker").attr("id",c+"_"+a+"-aggregationEnd").attr("class","marker aggregation "+a).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),ur=e((s,a,c)=>{s.append("defs").append("marker").attr("id",c+"_"+a+"-dependencyStart").attr("class","marker dependency "+a).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),s.append("defs").append("marker").attr("id",c+"_"+a+"-dependencyEnd").attr("class","marker dependency "+a).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),dr=e((s,a,c)=>{s.append("defs").append("marker").attr("id",c+"_"+a+"-lollipopStart").attr("class","marker lollipop "+a).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),s.append("defs").append("marker").attr("id",c+"_"+a+"-lollipopEnd").attr("class","marker lollipop "+a).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)},"lollipop"),pr=e((s,a,c)=>{s.append("marker").attr("id",c+"_"+a+"-pointEnd").attr("class","marker "+a).attr("viewBox","0 0 10 10").attr("refX",6).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),s.append("marker").attr("id",c+"_"+a+"-pointStart").attr("class","marker "+a).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"point"),fr=e((s,a,c)=>{s.append("marker").attr("id",c+"_"+a+"-circleEnd").attr("class","marker "+a).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),s.append("marker").attr("id",c+"_"+a+"-circleStart").attr("class","marker "+a).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"circle"),xr=e((s,a,c)=>{s.append("marker").attr("id",c+"_"+a+"-crossEnd").attr("class","marker cross "+a).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),s.append("marker").attr("id",c+"_"+a+"-crossStart").attr("class","marker cross "+a).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0")},"cross"),yr=e((s,a,c)=>{s.append("defs").append("marker").attr("id",c+"_"+a+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),br={extension:or,composition:hr,aggregation:gr,dependency:ur,lollipop:dr,point:pr,circle:fr,cross:xr,barb:yr},mr=lr;function Ct(s,a){if(s===0||!Number.isInteger(s))throw Error("Columns must be an integer !== 0.");if(a<0||!Number.isInteger(a))throw Error("Position must be a non-negative integer."+a);if(s<0)return{px:a,py:0};if(s===1)return{px:0,py:a};let c=a%s,o=Math.floor(a/s);return{px:c,py:o}}e(Ct,"calculateBlockPosition");var wr=e((s)=>{let a=0,c=0;for(let o of s.children){let{width:g,height:f,x:i,y:p}=o.size??{width:0,height:0,x:0,y:0};if(t.debug("getMaxChildSize abc95 child:",o.id,"width:",g,"height:",f,"x:",i,"y:",p,o.type),o.type==="space")continue;let x=g/(o.widthInColumns??1);if(x>a)a=x;if(f>c)c=f}return{width:a,height:c}},"getMaxChildSize");function yt(s,a,c=0,o=0,g=8){if(t.debug("setBlockSizes abc95 (start)",s.id,s?.size?.x,"block width =",s?.size,"siblingWidth",c),!s?.size?.width)s.size={width:c,height:o,x:0,y:0};let f=0,i=0;if(s.children?.length>0){for(let _ of s.children)yt(_,a,0,0,g);let p=wr(s);f=p.width,i=p.height,t.debug("setBlockSizes abc95 maxWidth of",s.id,":s children is ",f,i);for(let _ of s.children)if(_.size)t.debug(`abc95 Setting size of children of ${s.id} id=${_.id} ${f} ${i} ${JSON.stringify(_.size)}`),_.size.width=f*(_.widthInColumns??1)+g*((_.widthInColumns??1)-1),_.size.height=i,_.size.x=0,_.size.y=0,t.debug(`abc95 updating size of ${s.id} children child:${_.id} maxWidth:${f} maxHeight:${i}`);for(let _ of s.children)yt(_,a,f,i,g);let x=s.columns??-1,m=0;for(let _ of s.children)m+=_.widthInColumns??1;let b=s.children.length;if(x>0&&x<m)b=x;let k=Math.ceil(m/b),D=b*(f+g)+g,B=k*(i+g)+g;if(D<c){t.debug(`Detected to small sibling: abc95 ${s.id} siblingWidth ${c} siblingHeight ${o} width ${D}`),D=c,B=o;let _=(c-b*g-g)/b,O=(o-k*g-g)/k;t.debug("Size indata abc88",s.id,"childWidth",_,"maxWidth",f),t.debug("Size indata abc88",s.id,"childHeight",O,"maxHeight",i),t.debug("Size indata abc88 xSize",b,"padding",g);for(let I of s.children)if(I.size)I.size.width=_,I.size.height=O,I.size.x=0,I.size.y=0}if(t.debug(`abc95 (finale calc) ${s.id} xSize ${b} ySize ${k} columns ${x}${s.children.length} width=${Math.max(D,s.size?.width||0)}`),D<(s?.size?.width||0)){D=s?.size?.width||0;let _=x>0?Math.min(s.children.length,x):s.children.length;if(_>0){let O=(D-_*g-g)/_;t.debug("abc95 (growing to fit) width",s.id,D,s.size?.width,O);for(let I of s.children)if(I.size)I.size.width=O}}s.size={width:D,height:B,x:0,y:0}}t.debug("setBlockSizes abc94 (done)",s.id,s?.size?.x,s?.size?.width,s?.size?.y,s?.size?.height)}e(yt,"setBlockSizes");function Wt(s,a,c=8){t.debug(`abc85 layout blocks (=>layoutBlocks) ${s.id} x: ${s?.size?.x} y: ${s?.size?.y} width: ${s?.size?.width}`);let o=s.columns??-1;if(t.debug("layoutBlocks columns abc95",s.id,"=>",o,s),s.children&&s.children.length>0){let g=s?.children[0]?.size?.width??0,f=s.children.length*g+(s.children.length-1)*c;t.debug("widthOfChildren 88",f,"posX");let i=new Map;{let k=0;for(let D of s.children){if(!D.size)continue;let{py:B}=Ct(o,k),_=i.get(B)??0;if(D.size.height>_)i.set(B,D.size.height);let O=D?.widthInColumns??1;if(o>0)O=Math.min(O,o-k%o);k+=O}}let p=new Map;{let k=0,D=[...i.keys()].sort((B,_)=>B-_);for(let B of D)p.set(B,k),k+=(i.get(B)??0)+c}let x=0;t.debug("abc91 block?.size?.x",s.id,s?.size?.x);let m=s?.size?.x?s?.size?.x+(-s?.size?.width/2||0):-c,b=0;for(let k of s.children){let D=s;if(!k.size)continue;let{width:B,height:_}=k.size,{px:O,py:I}=Ct(o,x);if(I!=b)b=I,m=s?.size?.x?s?.size?.x+(-s?.size?.width/2||0):-c,t.debug("New row in layout for block",s.id," and child ",k.id,b);if(t.debug(`abc89 layout blocks (child) id: ${k.id} Pos: ${x} (px, py) ${O},${I} (${D?.size?.x},${D?.size?.y}) parent: ${D.id} width: ${B}${c}`),D.size){let A=B/2;k.size.x=m+c+A,t.debug(`abc91 layout blocks (calc) px, pyid:${k.id} startingPos=X${m} new startingPosX${k.size.x} ${A} padding=${c} width=${B} halfWidth=${A} => x:${k.size.x} y:${k.size.y} ${k.widthInColumns} (width * (child?.w || 1)) / 2 ${B*(k?.widthInColumns??1)/2}`),m=k.size.x+A;let z=p.get(I)??0,N=i.get(I)??_;k.size.y=D.size.y-D.size.height/2+z+N/2+c,t.debug(`abc88 layout blocks (calc) px, pyid:${k.id}startingPosX${m}${c}${A}=>x:${k.size.x}y:${k.size.y}${k.widthInColumns}(width * (child?.w || 1)) / 2${B*(k?.widthInColumns??1)/2}`)}if(k.children)Wt(k,a,c);let F=k?.widthInColumns??1;if(o>0)F=Math.min(F,o-x%o);x+=F,t.debug("abc88 columnsPos",k,x)}}t.debug(`layout blocks (<==layoutBlocks) ${s.id} x: ${s?.size?.x} y: ${s?.size?.y} width: ${s?.size?.width}`)}e(Wt,"layoutBlocks");function Kt(s,{minX:a,minY:c,maxX:o,maxY:g}={minX:0,minY:0,maxX:0,maxY:0}){if(s.size&&s.id!=="root"){let{x:f,y:i,width:p,height:x}=s.size;if(f-p/2<a)a=f-p/2;if(i-x/2<c)c=i-x/2;if(f+p/2>o)o=f+p/2;if(i+x/2>g)g=i+x/2}if(s.children)for(let f of s.children)({minX:a,minY:c,maxX:o,maxY:g}=Kt(f,{minX:a,minY:c,maxX:o,maxY:g}));return{minX:a,minY:c,maxX:o,maxY:g}}e(Kt,"findBounds");function pe(s){let a=s.getBlock("root");if(!a)return;let c=r()?.block?.padding??8;yt(a,s,0,0,c),Wt(a,s,c),t.debug("getBlocks",JSON.stringify(a,null,2));let{minX:o,minY:g,maxX:f,maxY:i}=Kt(a),p=i-g,x=f-o;return{x:o,y:g,width:x,height:p}}e(pe,"layout");var Sr=e(async(s,a,c,o=!1,g=!1)=>{let f=a||"";if(typeof f==="object")f=f[0];let i=r(),p=M(i);return await Z(s,f,{style:c,isTitle:o,useHtmlLabels:p,markdown:!1,isNode:g,width:Number.POSITIVE_INFINITY},i)},"createLabel"),Q=Sr,Lr=e((s,a,c,o,g)=>{if(a.arrowTypeStart)te(s,"start",a.arrowTypeStart,c,o,g);if(a.arrowTypeEnd)te(s,"end",a.arrowTypeEnd,c,o,g)},"addEdgeMarkers"),vr={arrow_cross:"cross",arrow_point:"point",arrow_barb:"barb",arrow_circle:"circle",aggregation:"aggregation",extension:"extension",composition:"composition",dependency:"dependency",lollipop:"lollipop"},te=e((s,a,c,o,g,f)=>{let i=vr[c];if(!i){t.warn(`Unknown arrow type: ${c}`);return}let p=a==="start"?"Start":"End";s.attr(`marker-${a}`,`url(${o}#${g}_${f}-${i}${p})`)},"addEdgeMarker"),At={},U={},Er=e(async(s,a)=>{let c=r(),o=M(c),g=s.insert("g").attr("class","edgeLabel"),f=g.insert("g").attr("class","label"),i=a.labelType==="markdown",p=await Z(s,a.label,{style:a.labelStyle,useHtmlLabels:o,addSvgBackground:i,isNode:!1,markdown:i,width:i?void 0:Number.POSITIVE_INFINITY},c);f.node().appendChild(p);let x=p.getBBox(),m=x;if(o){let k=p.children[0],D=n(p);x=k.getBoundingClientRect(),m=x,D.attr("width",x.width),D.attr("height",x.height)}else{let k=n(p).select("text").node();if(k&&typeof k.getBBox==="function")m=k.getBBox()}f.attr("transform",Fe(m,o)),At[a.id]=g,a.width=x.width,a.height=x.height;let b;if(a.startLabelLeft){let k=s.insert("g").attr("class","edgeTerminals"),D=k.insert("g").attr("class","inner"),B=await Q(D,a.startLabelLeft,a.labelStyle);b=B;let _=B.getBBox();if(o){let O=B.children[0],I=n(B);_=O.getBoundingClientRect(),I.attr("width",_.width),I.attr("height",_.height)}if(D.attr("transform",Fe(_,o)),!U[a.id])U[a.id]={};U[a.id].startLeft=k,lt(b,a.startLabelLeft)}if(a.startLabelRight){let k=s.insert("g").attr("class","edgeTerminals"),D=k.insert("g").attr("class","inner"),B=await Q(D,a.startLabelRight,a.labelStyle);b=B;let _=B.getBBox();if(o){let O=B.children[0],I=n(B);_=O.getBoundingClientRect(),I.attr("width",_.width),I.attr("height",_.height)}if(D.attr("transform",Fe(_,o)),!U[a.id])U[a.id]={};U[a.id].startRight=k,lt(b,a.startLabelRight)}if(a.endLabelLeft){let k=s.insert("g").attr("class","edgeTerminals"),D=k.insert("g").attr("class","inner"),B=await Q(k,a.endLabelLeft,a.labelStyle);b=B;let _=B.getBBox();if(o){let O=B.children[0],I=n(B);_=O.getBoundingClientRect(),I.attr("width",_.width),I.attr("height",_.height)}if(D.attr("transform",Fe(_,o)),!U[a.id])U[a.id]={};U[a.id].endLeft=k,lt(b,a.endLabelLeft)}if(a.endLabelRight){let k=s.insert("g").attr("class","edgeTerminals"),D=k.insert("g").attr("class","inner"),B=await Q(k,a.endLabelRight,a.labelStyle);b=B;let _=B.getBBox();if(o){let O=B.children[0],I=n(B);_=O.getBoundingClientRect(),I.attr("width",_.width),I.attr("height",_.height)}if(D.attr("transform",Fe(_,o)),!U[a.id])U[a.id]={};U[a.id].endRight=k,lt(b,a.endLabelRight)}return p},"insertEdgeLabel");function lt(s,a){if(M(r())&&s)s.style.width=a.length*9+"px",s.style.height="12px"}e(lt,"setTerminalWidth");var _r=e((s,a)=>{t.debug("Moving label abc88 ",s.id,s.label,At[s.id],a);let c=a.updatedPath?a.updatedPath:a.originalPath,o=r(),{subGraphTitleTotalMargin:g}=Ne(o);if(s.label){let f=At[s.id],{x:i,y:p}=s;if(c){let x=h.calcLabelPosition(c);if(t.debug("Moving label "+s.label+" from (",i,",",p,") to (",x.x,",",x.y,") abc88"),a.updatedPath)i=x.x,p=x.y}f.attr("transform",`translate(${i}, ${p+g/2})`)}if(s.startLabelLeft){let f=U[s.id].startLeft,{x:i,y:p}=s;if(c){let x=h.calcTerminalLabelPosition(s.arrowTypeStart?10:0,"start_left",c);i=x.x,p=x.y}f.attr("transform",`translate(${i}, ${p})`)}if(s.startLabelRight){let f=U[s.id].startRight,{x:i,y:p}=s;if(c){let x=h.calcTerminalLabelPosition(s.arrowTypeStart?10:0,"start_right",c);i=x.x,p=x.y}f.attr("transform",`translate(${i}, ${p})`)}if(s.endLabelLeft){let f=U[s.id].endLeft,{x:i,y:p}=s;if(c){let x=h.calcTerminalLabelPosition(s.arrowTypeEnd?10:0,"end_left",c);i=x.x,p=x.y}f.attr("transform",`translate(${i}, ${p})`)}if(s.endLabelRight){let f=U[s.id].endRight,{x:i,y:p}=s;if(c){let x=h.calcTerminalLabelPosition(s.arrowTypeEnd?10:0,"end_right",c);i=x.x,p=x.y}f.attr("transform",`translate(${i}, ${p})`)}},"positionEdgeLabel"),Tr=e((s,a)=>{let{x:c,y:o}=s,g=Math.abs(a.x-c),f=Math.abs(a.y-o),i=s.width/2,p=s.height/2;if(g>=i||f>=p)return!0;return!1},"outsideNode"),Dr=e((s,a,c)=>{t.debug(`intersection calc abc89:
130
130
  outsidePoint: ${JSON.stringify(a)}
131
131
  insidePoint : ${JSON.stringify(c)}
132
- node : x:${s.x} y:${s.y} w:${s.width} h:${s.height}`);let{x:o,y:g}=s,f=Math.abs(o-c.x),i=s.width/2,p=c.x<a.x?i-f:i+f,x=s.height/2,m=Math.abs(a.y-c.y),b=Math.abs(a.x-c.x);if(Math.abs(g-a.y)*i>Math.abs(o-a.x)*x){let S=c.y<a.y?a.y-x-g:g-x-a.y;p=b*S/m;let D={x:c.x<a.x?c.x+p:c.x-b+p,y:c.y<a.y?c.y+m-S:c.y-m+S};if(p===0)D.x=a.x,D.y=a.y;if(b===0)D.x=a.x;if(m===0)D.y=a.y;return t.debug(`abc89 topp/bott calc, Q ${m}, q ${S}, R ${b}, r ${p}`,D),D}else{if(c.x<a.x)p=a.x-i-o;else p=o-i-a.x;let S=m*p/b,D=c.x<a.x?c.x+b-p:c.x-b+p,B=c.y<a.y?c.y+S:c.y-S;if(t.debug(`sides calc abc89, Q ${m}, q ${S}, R ${b}, r ${p}`,{_x:D,_y:B}),p===0)D=a.x,B=a.y;if(b===0)D=a.x;if(m===0)B=a.y;return{x:D,y:B}}},"intersection"),ee=e((s,a)=>{t.debug("abc88 cutPathAtIntersect",s,a);let c=[],o=s[0],g=!1;return s.forEach((f)=>{if(!_r(a,f)&&!g){let i=Dr(a,o,f),p=!1;if(c.forEach((x)=>{p=p||x.x===i.x&&x.y===i.y}),!c.some((x)=>x.x===i.x&&x.y===i.y))c.push(i);g=!0}else if(o=f,!g)c.push(f)}),c},"cutPathAtIntersect"),Br=e(function(s,a,c,o,g,f,i){let p=c.points;t.debug("abc88 InsertEdge: edge=",c,"e=",a);let x=!1,m=f.node(a.v);var b=f.node(a.w);if(b?.intersect&&m?.intersect)p=p.slice(1,c.points.length-1),p.unshift(m.intersect(p[0])),p.push(b.intersect(p[p.length-1]));if(c.toCluster)t.debug("to cluster abc88",o[c.toCluster]),p=ee(c.points,o[c.toCluster].node),x=!0;if(c.fromCluster)t.debug("from cluster abc88",o[c.fromCluster]),p=ee(p.reverse(),o[c.fromCluster].node).reverse(),x=!0;let S=p.filter((N)=>!Number.isNaN(N.y)),D=Be;if(c.curve&&(g==="graph"||g==="flowchart"))D=c.curve;let{x:B,y:T}=Jn(c),O=Le().x(B).y(T).curve(D),I;switch(c.thickness){case"normal":I="edge-thickness-normal";break;case"thick":I="edge-thickness-thick";break;case"invisible":I="edge-thickness-thick";break;default:I=""}switch(c.pattern){case"solid":I+=" edge-pattern-solid";break;case"dotted":I+=" edge-pattern-dotted";break;case"dashed":I+=" edge-pattern-dashed";break}let F=s.append("path").attr("d",O(S)).attr("id",c.id).attr("class"," "+I+(c.classes?" "+c.classes:"")).attr("style",c.style),A="";if(r().flowchart.arrowMarkerAbsolute||r().state.arrowMarkerAbsolute)A=ht(!0);Sr(F,c,A,i,g);let z={};if(x)z.updatedPath=p;return z.originalPath=c.points,z},"insertEdge"),Nr=e((s)=>{let a=new Set;for(let c of s)switch(c){case"x":a.add("right"),a.add("left");break;case"y":a.add("up"),a.add("down");break;default:a.add(c);break}return a},"expandAndDeduplicateDirections"),Ir=e((s,a,c,o)=>{let g=Nr(s),f=2,i=a.height+2*c.padding,p=i/2,x=o??a.width+2*p+c.padding,m=c.padding/2;if(g.has("right")&&g.has("left")&&g.has("up")&&g.has("down"))return[{x:0,y:0},{x:p,y:0},{x:x/2,y:2*m},{x:x-p,y:0},{x,y:0},{x,y:-i/3},{x:x+2*m,y:-i/2},{x,y:-2*i/3},{x,y:-i},{x:x-p,y:-i},{x:x/2,y:-i-2*m},{x:p,y:-i},{x:0,y:-i},{x:0,y:-2*i/3},{x:-2*m,y:-i/2},{x:0,y:-i/3}];if(g.has("right")&&g.has("left")&&g.has("up"))return[{x:p,y:0},{x:x-p,y:0},{x,y:-i/2},{x:x-p,y:-i},{x:p,y:-i},{x:0,y:-i/2}];if(g.has("right")&&g.has("left")&&g.has("down"))return[{x:0,y:0},{x:p,y:-i},{x:x-p,y:-i},{x,y:0}];if(g.has("right")&&g.has("up")&&g.has("down"))return[{x:0,y:0},{x,y:-p},{x,y:-i+p},{x:0,y:-i}];if(g.has("left")&&g.has("up")&&g.has("down"))return[{x,y:0},{x:0,y:-p},{x:0,y:-i+p},{x,y:-i}];if(g.has("right")&&g.has("left"))return[{x:p,y:0},{x:p,y:-m},{x:x-p,y:-m},{x:x-p,y:0},{x,y:-i/2},{x:x-p,y:-i},{x:x-p,y:-i+m},{x:p,y:-i+m},{x:p,y:-i},{x:0,y:-i/2}];if(g.has("up")&&g.has("down"))return[{x:x/2,y:0},{x:0,y:-m},{x:p,y:-m},{x:p,y:-i+m},{x:0,y:-i+m},{x:x/2,y:-i},{x,y:-i+m},{x:x-p,y:-i+m},{x:x-p,y:-m},{x,y:-m}];if(g.has("right")&&g.has("up"))return[{x:0,y:0},{x,y:-p},{x:0,y:-i}];if(g.has("right")&&g.has("down"))return[{x:0,y:0},{x,y:0},{x:0,y:-i}];if(g.has("left")&&g.has("up"))return[{x,y:0},{x:0,y:-p},{x,y:-i}];if(g.has("left")&&g.has("down"))return[{x,y:0},{x:0,y:0},{x,y:-i}];if(g.has("right"))return[{x:p,y:-m},{x:p,y:-m},{x:x-p,y:-m},{x:x-p,y:0},{x,y:-i/2},{x:x-p,y:-i},{x:x-p,y:-i+m},{x:p,y:-i+m},{x:p,y:-i+m}];if(g.has("left"))return[{x:p,y:0},{x:p,y:-m},{x:x-p,y:-m},{x:x-p,y:-i+m},{x:p,y:-i+m},{x:p,y:-i},{x:0,y:-i/2}];if(g.has("up"))return[{x:p,y:-m},{x:p,y:-i+m},{x:0,y:-i+m},{x:x/2,y:-i},{x,y:-i+m},{x:x-p,y:-i+m},{x:x-p,y:-m}];if(g.has("down"))return[{x:x/2,y:0},{x:0,y:-m},{x:p,y:-m},{x:p,y:-i+m},{x:x-p,y:-i+m},{x:x-p,y:-m},{x,y:-m}];return[{x:0,y:0}]},"getArrowPoints");function fe(s,a){return s.intersect(a)}e(fe,"intersectNode");var Cr=fe;function xe(s,a,c,o){var{x:g,y:f}=s,i=g-o.x,p=f-o.y,x=Math.sqrt(a*a*p*p+c*c*i*i),m=Math.abs(a*c*i/x);if(o.x<g)m=-m;var b=Math.abs(a*c*p/x);if(o.y<f)b=-b;return{x:g+m,y:f+b}}e(xe,"intersectEllipse");var ye=xe;function be(s,a,c){return ye(s,a,a,c)}e(be,"intersectCircle");var Or=be;function me(s,a,c,o){var g,f,i,p,x,m,b,S,D,B,T,O,I,F,A;if(g=a.y-s.y,i=s.x-a.x,x=a.x*s.y-s.x*a.y,D=g*c.x+i*c.y+x,B=g*o.x+i*o.y+x,D!==0&&B!==0&&zt(D,B))return;if(f=o.y-c.y,p=c.x-o.x,m=o.x*c.y-c.x*o.y,b=f*s.x+p*s.y+m,S=f*a.x+p*a.y+m,b!==0&&S!==0&&zt(b,S))return;if(T=g*p-f*i,T===0)return;return O=Math.abs(T/2),I=i*m-p*x,F=I<0?(I-O)/T:(I+O)/T,I=f*x-g*m,A=I<0?(I-O)/T:(I+O)/T,{x:F,y:A}}e(me,"intersectLine");function zt(s,a){return s*a>0}e(zt,"sameSign");var Rr=me,Ar=ke;function ke(s,a,c){var{x:o,y:g}=s,f=[],{POSITIVE_INFINITY:i,POSITIVE_INFINITY:p}=Number;if(typeof a.forEach==="function")a.forEach(function(T){i=Math.min(i,T.x),p=Math.min(p,T.y)});else i=Math.min(i,a.x),p=Math.min(p,a.y);var x=o-s.width/2-i,m=g-s.height/2-p;for(var b=0;b<a.length;b++){var S=a[b],D=a[b<a.length-1?b+1:0],B=Rr(s,c,{x:x+S.x,y:m+S.y},{x:x+D.x,y:m+D.y});if(B)f.push(B)}if(!f.length)return s;if(f.length>1)f.sort(function(T,O){var I=T.x-c.x,F=T.y-c.y,A=Math.sqrt(I*I+F*F),z=O.x-c.x,N=O.y-c.y,v=Math.sqrt(z*z+N*N);return A<v?-1:A===v?0:1});return f[0]}e(ke,"intersectPolygon");var zr=e((s,a)=>{var{x:c,y:o}=s,g=a.x-c,f=a.y-o,i=s.width/2,p=s.height/2,x,m;if(Math.abs(f)*i>Math.abs(g)*p){if(f<0)p=-p;x=f===0?0:p*g/f,m=p}else{if(g<0)i=-i;x=i,m=g===0?0:i*f/g}return{x:c+x,y:o+m}},"intersectRect"),Mr=zr,P={node:Cr,circle:Or,ellipse:ye,polygon:Ar,rect:Mr},K=e(async(s,a,c,o)=>{let g=r(),f,i=a.useHtmlLabels||M(g);if(!c)f="node default";else f=c;let p=s.insert("g").attr("class",f).attr("id",a.domId||a.id),x=p.insert("g").attr("class","label").attr("style",a.labelStyle),m;if(a.labelText===void 0)m="";else m=typeof a.labelText==="string"?a.labelText:a.labelText[0];let b;if(a.labelType==="markdown")b=Z(x,w(Te(m),g),{useHtmlLabels:i,width:a.width||g.flowchart.wrappingWidth,classes:"markdown-node-label"},g);else b=await Q(x,w(Te(m),g),a.labelStyle,!1,o);let S=b.getBBox(),D=a.padding/2;if(M(g)){let B=b.children[0],T=n(b);await an(B,m),S=B.getBoundingClientRect(),T.attr("width",S.width),T.attr("height",S.height)}if(i)x.attr("transform","translate("+-S.width/2+", "+-S.height/2+")");else x.attr("transform","translate(0, "+-S.height/2+")");if(a.centerLabel)x.attr("transform","translate("+-S.width/2+", "+-S.height/2+")");return x.insert("rect",":first-child"),{shapeSvg:p,bbox:S,halfPadding:D,label:x}},"labelHelper"),H=e((s,a)=>{let c=a.node().getBBox();s.width=c.width,s.height=c.height},"updateNodeBounds");function et(s,a,c,o){return s.insert("polygon",":first-child").attr("points",o.map(function(g){return g.x+","+g.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-a/2+","+c/2+")")}e(et,"insertPolygonShape");var Pr=e(async(s,a)=>{if(!(a.useHtmlLabels||M(r())))a.centerLabel=!0;let{shapeSvg:o,bbox:g,halfPadding:f}=await K(s,a,"node "+a.classes,!0);t.info("Classes = ",a.classes);let i=o.insert("rect",":first-child");return i.attr("rx",a.rx).attr("ry",a.ry).attr("x",-g.width/2-f).attr("y",-g.height/2-f).attr("width",g.width+a.padding).attr("height",g.height+a.padding),H(a,i),a.intersect=function(p){return P.rect(a,p)},o},"note"),Fr=Pr,re=e((s)=>{if(s)return" "+s;return""},"formatClass"),G=e((s,a)=>`${a?a:"node default"}${re(s.classes)} ${re(s.class)}`,"getClassesFromNode"),ae=e(async(s,a)=>{let{shapeSvg:c,bbox:o}=await K(s,a,G(a,void 0),!0),g=o.width+a.padding,f=o.height+a.padding,i=g+f,p=[{x:i/2,y:0},{x:i,y:-i/2},{x:i/2,y:-i},{x:0,y:-i/2}];t.info("Question main (Circle)");let x=et(c,i,i,p);return x.attr("style",a.style),H(a,x),a.intersect=function(m){return t.warn("Intersect called"),P.polygon(a,p,m)},c},"question"),Hr=e((s,a)=>{let c=s.insert("g").attr("class","node default").attr("id",a.domId||a.id),o=28,g=[{x:0,y:14},{x:14,y:0},{x:0,y:-14},{x:-14,y:0}];return c.insert("polygon",":first-child").attr("points",g.map(function(i){return i.x+","+i.y}).join(" ")).attr("class","state-start").attr("r",7).attr("width",28).attr("height",28),a.width=28,a.height=28,a.intersect=function(i){return P.circle(a,14,i)},c},"choice"),Wr=e(async(s,a)=>{let{shapeSvg:c,bbox:o}=await K(s,a,G(a,void 0),!0),g=4,f=a.positioned?a.height:o.height+a.padding,i=f/4,p=a.positioned?a.width:o.width+2*i+a.padding,x=[{x:i,y:0},{x:p-i,y:0},{x:p,y:-f/2},{x:p-i,y:-f},{x:i,y:-f},{x:0,y:-f/2}],m=et(c,p,f,x);return m.attr("style",a.style),H(a,m),a.intersect=function(b){return P.polygon(a,x,b)},c},"hexagon"),Yr=e(async(s,a)=>{let{shapeSvg:c,bbox:o}=await K(s,a,void 0,!0),g=2,f=o.height+2*a.padding,i=f/2,p=o.width+2*i+a.padding,m=a.positioned&&(a.widthInColumns??1)>1&&a.width>p?a.width:p,b=Ir(a.directions,o,a,m),S=et(c,m,f,b);return S.attr("style",a.style),H(a,S),a.intersect=function(D){return P.polygon(a,b,D)},c},"block_arrow"),Ur=e(async(s,a)=>{let{shapeSvg:c,bbox:o}=await K(s,a,G(a,void 0),!0),g=o.width+a.padding,f=o.height+a.padding,i=[{x:-f/2,y:0},{x:g,y:0},{x:g,y:-f},{x:-f/2,y:-f},{x:0,y:-f/2}];return et(c,g,f,i).attr("style",a.style),a.width=g+f,a.height=f,a.intersect=function(x){return P.polygon(a,i,x)},c},"rect_left_inv_arrow"),Vr=e(async(s,a)=>{let{shapeSvg:c,bbox:o}=await K(s,a,G(a),!0),g=o.width+a.padding,f=o.height+a.padding,i=[{x:-2*f/6,y:0},{x:g-f/6,y:0},{x:g+2*f/6,y:-f},{x:f/6,y:-f}],p=et(c,g,f,i);return p.attr("style",a.style),H(a,p),a.intersect=function(x){return P.polygon(a,i,x)},c},"lean_right"),Gr=e(async(s,a)=>{let{shapeSvg:c,bbox:o}=await K(s,a,G(a,void 0),!0),g=o.width+a.padding,f=o.height+a.padding,i=[{x:2*f/6,y:0},{x:g+f/6,y:0},{x:g-2*f/6,y:-f},{x:-f/6,y:-f}],p=et(c,g,f,i);return p.attr("style",a.style),H(a,p),a.intersect=function(x){return P.polygon(a,i,x)},c},"lean_left"),qr=e(async(s,a)=>{let{shapeSvg:c,bbox:o}=await K(s,a,G(a,void 0),!0),g=o.width+a.padding,f=o.height+a.padding,i=[{x:-2*f/6,y:0},{x:g+2*f/6,y:0},{x:g-f/6,y:-f},{x:f/6,y:-f}],p=et(c,g,f,i);return p.attr("style",a.style),H(a,p),a.intersect=function(x){return P.polygon(a,i,x)},c},"trapezoid"),$r=e(async(s,a)=>{let{shapeSvg:c,bbox:o}=await K(s,a,G(a,void 0),!0),g=o.width+a.padding,f=o.height+a.padding,i=[{x:f/6,y:0},{x:g-f/6,y:0},{x:g+2*f/6,y:-f},{x:-2*f/6,y:-f}],p=et(c,g,f,i);return p.attr("style",a.style),H(a,p),a.intersect=function(x){return P.polygon(a,i,x)},c},"inv_trapezoid"),ta=e(async(s,a)=>{let{shapeSvg:c,bbox:o}=await K(s,a,G(a,void 0),!0),g=o.width+a.padding,f=o.height+a.padding,i=[{x:0,y:0},{x:g+f/2,y:0},{x:g,y:-f/2},{x:g+f/2,y:-f},{x:0,y:-f}],p=et(c,g,f,i);return p.attr("style",a.style),H(a,p),a.intersect=function(x){return P.polygon(a,i,x)},c},"rect_right_inv_arrow"),ea=e(async(s,a)=>{let{shapeSvg:c,bbox:o}=await K(s,a,G(a,void 0),!0),g=o.width+a.padding,f=g/2,i=f/(2.5+g/50),p=o.height+i+a.padding,x="M 0,"+i+" a "+f+","+i+" 0,0,0 "+g+" 0 a "+f+","+i+" 0,0,0 "+-g+" 0 l 0,"+p+" a "+f+","+i+" 0,0,0 "+g+" 0 l 0,"+-p,m=c.attr("label-offset-y",i).insert("path",":first-child").attr("style",a.style).attr("d",x).attr("transform","translate("+-g/2+","+-(p/2+i)+")");return H(a,m),a.intersect=function(b){let S=P.rect(a,b),D=S.x-a.x;if(f!=0&&(Math.abs(D)<a.width/2||Math.abs(D)==a.width/2&&Math.abs(S.y-a.y)>a.height/2-i)){let B=i*i*(1-D*D/(f*f));if(B!=0)B=Math.sqrt(B);if(B=i-B,b.y-a.y>0)B=-B;S.y+=B}return S},c},"cylinder"),ra=e(async(s,a)=>{let{shapeSvg:c,bbox:o,halfPadding:g}=await K(s,a,"node "+a.classes+" "+a.class,!0),f=c.insert("rect",":first-child"),i=a.positioned?a.width:o.width+a.padding,p=a.positioned?a.height:o.height+a.padding,x=a.positioned?-i/2:-o.width/2-g,m=a.positioned?-p/2:-o.height/2-g;if(f.attr("class","basic label-container").attr("style",a.style).attr("rx",a.rx).attr("ry",a.ry).attr("x",x).attr("y",m).attr("width",i).attr("height",p),a.props){let b=new Set(Object.keys(a.props));if(a.props.borders)bt(f,a.props.borders,i,p),b.delete("borders");b.forEach((S)=>{t.warn(`Unknown node property ${S}`)})}return H(a,f),a.intersect=function(b){return P.rect(a,b)},c},"rect"),aa=e(async(s,a)=>{let{shapeSvg:c,bbox:o,halfPadding:g}=await K(s,a,"node "+a.classes,!0),f=c.insert("rect",":first-child"),i=a.positioned?a.width:o.width+a.padding,p=a.positioned?a.height:o.height+a.padding,x=a.positioned?-i/2:-o.width/2-g,m=a.positioned?-p/2:-o.height/2-g;if(f.attr("class","basic cluster composite label-container").attr("style",a.style).attr("rx",a.rx).attr("ry",a.ry).attr("x",x).attr("y",m).attr("width",i).attr("height",p),a.props){let b=new Set(Object.keys(a.props));if(a.props.borders)bt(f,a.props.borders,i,p),b.delete("borders");b.forEach((S)=>{t.warn(`Unknown node property ${S}`)})}return H(a,f),a.intersect=function(b){return P.rect(a,b)},c},"composite"),sa=e(async(s,a)=>{let{shapeSvg:c}=await K(s,a,"label",!0);t.trace("Classes = ",a.class);let o=c.insert("rect",":first-child"),g=0,f=0;if(o.attr("width",g).attr("height",f),c.attr("class","label edgeLabel"),a.props){let i=new Set(Object.keys(a.props));if(a.props.borders)bt(o,a.props.borders,g,f),i.delete("borders");i.forEach((p)=>{t.warn(`Unknown node property ${p}`)})}return H(a,o),a.intersect=function(i){return P.rect(a,i)},c},"labelRect");function bt(s,a,c,o){let g=[],f=e((p)=>{g.push(p,0)},"addBorder"),i=e((p)=>{g.push(0,p)},"skipBorder");if(a.includes("t"))t.debug("add top border"),f(c);else i(c);if(a.includes("r"))t.debug("add right border"),f(o);else i(o);if(a.includes("b"))t.debug("add bottom border"),f(c);else i(c);if(a.includes("l"))t.debug("add left border"),f(o);else i(o);s.attr("stroke-dasharray",g.join(" "))}e(bt,"applyNodePropertyBorders");var ia=e(async(s,a)=>{let c;if(!a.classes)c="node default";else c="node "+a.classes;let o=s.insert("g").attr("class",c).attr("id",a.domId||a.id),g=o.insert("rect",":first-child"),f=o.insert("line"),i=o.insert("g").attr("class","label"),p=a.labelText.flat?a.labelText.flat():a.labelText,x="";if(typeof p==="object")x=p[0];else x=p;t.info("Label text abc79",x,p,typeof p==="object");let m=await Q(i,x,a.labelStyle,!0,!0),b={width:0,height:0};if(M(r())){let O=m.children[0],I=n(m);b=O.getBoundingClientRect(),I.attr("width",b.width),I.attr("height",b.height)}t.info("Text 2",p);let S=p.slice(1,p.length),D=m.getBBox(),B=await Q(i,S.join?S.join("<br/>"):S,a.labelStyle,!0,!0);if(M(r())){let O=B.children[0],I=n(B);b=O.getBoundingClientRect(),I.attr("width",b.width),I.attr("height",b.height)}let T=a.padding/2;return n(B).attr("transform","translate( "+(b.width>D.width?0:(D.width-b.width)/2)+", "+(D.height+T+5)+")"),n(m).attr("transform","translate( "+(b.width<D.width?0:-(D.width-b.width)/2)+", 0)"),b=i.node().getBBox(),i.attr("transform","translate("+-b.width/2+", "+(-b.height/2-T+3)+")"),g.attr("class","outer title-state").attr("x",-b.width/2-T).attr("y",-b.height/2-T).attr("width",b.width+a.padding).attr("height",b.height+a.padding),f.attr("class","divider").attr("x1",-b.width/2-T).attr("x2",b.width/2+T).attr("y1",-b.height/2-T+D.height+T).attr("y2",-b.height/2-T+D.height+T),H(a,g),a.intersect=function(O){return P.rect(a,O)},o},"rectWithTitle"),na=e(async(s,a)=>{let{shapeSvg:c,bbox:o}=await K(s,a,G(a,void 0),!0),g=o.height+a.padding,f=o.width+g/4+a.padding,i=c.insert("rect",":first-child").attr("style",a.style).attr("rx",g/2).attr("ry",g/2).attr("x",-f/2).attr("y",-g/2).attr("width",f).attr("height",g);return H(a,i),a.intersect=function(p){return P.rect(a,p)},c},"stadium"),ca=e(async(s,a)=>{let{shapeSvg:c,bbox:o,halfPadding:g}=await K(s,a,G(a,void 0),!0),f=c.insert("circle",":first-child");return f.attr("style",a.style).attr("rx",a.rx).attr("ry",a.ry).attr("r",o.width/2+g).attr("width",o.width+a.padding).attr("height",o.height+a.padding),t.info("Circle main"),H(a,f),a.intersect=function(i){return t.info("Circle intersect",a,o.width/2+g,i),P.circle(a,o.width/2+g,i)},c},"circle"),la=e(async(s,a)=>{let{shapeSvg:c,bbox:o,halfPadding:g}=await K(s,a,G(a,void 0),!0),f=5,i=c.insert("g",":first-child"),p=i.insert("circle"),x=i.insert("circle");return i.attr("class",a.class),p.attr("style",a.style).attr("rx",a.rx).attr("ry",a.ry).attr("r",o.width/2+g+5).attr("width",o.width+a.padding+10).attr("height",o.height+a.padding+10),x.attr("style",a.style).attr("rx",a.rx).attr("ry",a.ry).attr("r",o.width/2+g).attr("width",o.width+a.padding).attr("height",o.height+a.padding),t.info("DoubleCircle main"),H(a,p),a.intersect=function(m){return t.info("DoubleCircle intersect",a,o.width/2+g+5,m),P.circle(a,o.width/2+g+5,m)},c},"doublecircle"),oa=e(async(s,a)=>{let{shapeSvg:c,bbox:o}=await K(s,a,G(a,void 0),!0),g=o.width+a.padding,f=o.height+a.padding,i=[{x:0,y:0},{x:g,y:0},{x:g,y:-f},{x:0,y:-f},{x:0,y:0},{x:-8,y:0},{x:g+8,y:0},{x:g+8,y:-f},{x:-8,y:-f},{x:-8,y:0}],p=et(c,g,f,i);return p.attr("style",a.style),H(a,p),a.intersect=function(x){return P.polygon(a,i,x)},c},"subroutine"),ha=e((s,a)=>{let c=s.insert("g").attr("class","node default").attr("id",a.domId||a.id),o=c.insert("circle",":first-child");return o.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),H(a,o),a.intersect=function(g){return P.circle(a,7,g)},c},"start"),se=e((s,a,c)=>{let o=s.insert("g").attr("class","node default").attr("id",a.domId||a.id),g=70,f=10;if(c==="LR")g=10,f=70;let i=o.append("rect").attr("x",-1*g/2).attr("y",-1*f/2).attr("width",g).attr("height",f).attr("class","fork-join");return H(a,i),a.height=a.height+a.padding/2,a.width=a.width+a.padding/2,a.intersect=function(p){return P.rect(a,p)},o},"forkJoin"),ga=e((s,a)=>{let c=s.insert("g").attr("class","node default").attr("id",a.domId||a.id),o=c.insert("circle",":first-child"),g=c.insert("circle",":first-child");return g.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),o.attr("class","state-end").attr("r",5).attr("width",10).attr("height",10),H(a,g),a.intersect=function(f){return P.circle(a,7,f)},c},"end"),ua=e(async(s,a)=>{let c=a.padding/2,o=4,g=8,f;if(!a.classes)f="node default";else f="node "+a.classes;let i=s.insert("g").attr("class",f).attr("id",a.domId||a.id),p=i.insert("rect",":first-child"),x=i.insert("line"),m=i.insert("line"),b=0,S=4,D=i.insert("g").attr("class","label"),B=0,T=a.classData.annotations?.[0],O=a.classData.annotations[0]?"«"+a.classData.annotations[0]+"»":"",I=await Q(D,O,a.labelStyle,!0,!0),F=I.getBBox();if(M(r())){let R=I.children[0],y=n(I);F=R.getBoundingClientRect(),y.attr("width",F.width),y.attr("height",F.height)}if(a.classData.annotations[0])S+=F.height+4,b+=F.width;let A=a.classData.label;if(a.classData.type!==void 0&&a.classData.type!=="")if(M(r()))A+="&lt;"+a.classData.type+"&gt;";else A+="<"+a.classData.type+">";let z=await Q(D,A,a.labelStyle,!0,!0);n(z).attr("class","classTitle");let N=z.getBBox();if(M(r())){let R=z.children[0],y=n(z);N=R.getBoundingClientRect(),y.attr("width",N.width),y.attr("height",N.height)}if(S+=N.height+4,N.width>b)b=N.width;let v=[];a.classData.members.forEach(async(R)=>{let y=R.getDisplayDetails(),V=y.displayText;if(M(r()))V=V.replace(/</g,"&lt;").replace(/>/g,"&gt;");let E=await Q(D,V,y.cssStyle?y.cssStyle:a.labelStyle,!0,!0),W=E.getBBox();if(M(r())){let it=E.children[0],rt=n(E);W=it.getBoundingClientRect(),rt.attr("width",W.width),rt.attr("height",W.height)}if(W.width>b)b=W.width;S+=W.height+4,v.push(E)}),S+=8;let _=[];if(a.classData.methods.forEach(async(R)=>{let y=R.getDisplayDetails(),V=y.displayText;if(M(r()))V=V.replace(/</g,"&lt;").replace(/>/g,"&gt;");let E=await Q(D,V,y.cssStyle?y.cssStyle:a.labelStyle,!0,!0),W=E.getBBox();if(M(r())){let it=E.children[0],rt=n(E);W=it.getBoundingClientRect(),rt.attr("width",W.width),rt.attr("height",W.height)}if(W.width>b)b=W.width;S+=W.height+4,_.push(E)}),S+=8,T){let R=(b-F.width)/2;n(I).attr("transform","translate( "+(-1*b/2+R)+", "+-1*S/2+")"),B=F.height+4}let C=(b-N.width)/2;return n(z).attr("transform","translate( "+(-1*b/2+C)+", "+(-1*S/2+B)+")"),B+=N.height+4,x.attr("class","divider").attr("x1",-b/2-c).attr("x2",b/2+c).attr("y1",-S/2-c+8+B).attr("y2",-S/2-c+8+B),B+=8,v.forEach((R)=>{n(R).attr("transform","translate( "+-b/2+", "+(-1*S/2+B+4)+")");let y=R?.getBBox();B+=(y?.height??0)+4}),B+=8,m.attr("class","divider").attr("x1",-b/2-c).attr("x2",b/2+c).attr("y1",-S/2-c+8+B).attr("y2",-S/2-c+8+B),B+=8,_.forEach((R)=>{n(R).attr("transform","translate( "+-b/2+", "+(-1*S/2+B)+")");let y=R?.getBBox();B+=(y?.height??0)+4}),p.attr("style",a.style).attr("class","outer title-state").attr("x",-b/2-c).attr("y",-(S/2)-c).attr("width",b+a.padding).attr("height",S+a.padding),H(a,p),a.intersect=function(R){return P.rect(a,R)},i},"class_box"),ie={rhombus:ae,composite:aa,question:ae,rect:ra,labelRect:sa,rectWithTitle:ia,choice:Hr,circle:ca,doublecircle:la,stadium:na,hexagon:Wr,block_arrow:Yr,rect_left_inv_arrow:Ur,lean_right:Vr,lean_left:Gr,trapezoid:qr,inv_trapezoid:$r,rect_right_inv_arrow:ta,cylinder:ea,start:ha,end:ga,note:Fr,subroutine:oa,fork:se,join:se,class_box:ua},ft={},Se=e(async(s,a,c)=>{let o,g;if(a.link){let f;if(r().securityLevel==="sandbox")f="_top";else if(a.linkTarget)f=a.linkTarget||"_blank";o=s.insert("svg:a").attr("xlink:href",a.link).attr("target",f),g=await ie[a.shape](o,a,c)}else g=await ie[a.shape](s,a,c),o=g;if(a.tooltip)g.attr("title",a.tooltip);if(a.class)g.attr("class","node default "+a.class);if(ft[a.id]=o,a.haveCallback)ft[a.id].attr("class",ft[a.id].attr("class")+" clickable");return o},"insertNode"),da=e((s)=>{let a=ft[s.id];t.trace("Transforming node",s.diff,s,"translate("+(s.x-s.width/2-5)+", "+s.width/2+")");let c=8,o=s.diff||0;if(s.clusterNode)a.attr("transform","translate("+(s.x+o-s.width/2)+", "+(s.y-s.height/2-c)+")");else a.attr("transform","translate("+s.x+", "+s.y+")");return o},"positionNode");function Ut(s,a,c=!1){let o=s,g="default";if((o?.classes?.length||0)>0)g=(o?.classes??[]).join(" ");g=g+" flowchart-label";let f=0,i="",p;switch(o.type){case"round":f=5,i="rect";break;case"composite":f=0,i="composite",p=0;break;case"square":i="rect";break;case"diamond":i="question";break;case"hexagon":i="hexagon";break;case"block_arrow":i="block_arrow";break;case"odd":i="rect_left_inv_arrow";break;case"lean_right":i="lean_right";break;case"lean_left":i="lean_left";break;case"trapezoid":i="trapezoid";break;case"inv_trapezoid":i="inv_trapezoid";break;case"rect_left_inv_arrow":i="rect_left_inv_arrow";break;case"circle":i="circle";break;case"ellipse":i="ellipse";break;case"stadium":i="stadium";break;case"subroutine":i="subroutine";break;case"cylinder":i="cylinder";break;case"group":i="rect";break;case"doublecircle":i="doublecircle";break;default:i="rect"}let x=Xn(o?.styles??[]),m=o.label,b=o.size??{width:0,height:0,x:0,y:0},S=a.getDiagramId();return{labelStyle:x.labelStyle,shape:i,labelText:m,rx:f,ry:f,class:g,style:x.style,id:o.id,domId:S?`${S}-${o.id}`:o.id,directions:o.directions,width:b.width,height:b.height,x:b.x,y:b.y,positioned:c,intersect:void 0,type:o.type,padding:p??u()?.block?.padding??0,widthInColumns:o.widthInColumns??1}}e(Ut,"getNodeFromBlock");async function ve(s,a,c){let o=Ut(a,c,!1);if(o.type==="group")return;let g=u(),f=await Se(s,o,{config:g}),i=f.node().getBBox(),p=c.getBlock(o.id);p.size={width:i.width,height:i.height,x:0,y:0,node:f},c.setBlock(p),f.remove()}e(ve,"calculateBlockSize");async function Ee(s,a,c){let o=Ut(a,c,!0);if(c.getBlock(o.id).type!=="space"){let f=u();await Se(s,o,{config:f}),a.intersect=o?.intersect,da(o)}}e(Ee,"insertBlockPositioned");async function wt(s,a,c,o){for(let g of a)if(await o(s,g,c),g.children)await wt(s,g.children,c,o)}e(wt,"performOperations");async function _e(s,a,c){await wt(s,a,c,ve)}e(_e,"calculateBlockSizes");async function De(s,a,c){await wt(s,a,c,Ee)}e(De,"insertBlocks");async function Ie(s,a,c,o,g){let f=new L({multigraph:!0,compound:!0});f.setGraph({rankdir:"TB",nodesep:10,ranksep:10,marginx:8,marginy:8});for(let i of c)if(i.size)f.setNode(i.id,{width:i.size.width,height:i.size.height,intersect:i.intersect});for(let i of a)if(i.start&&i.end){let p=o.getBlock(i.start),x=o.getBlock(i.end);if(p?.size&&x?.size){let m=p.size,b=x.size,S=[{x:m.x,y:m.y},{x:m.x+(b.x-m.x)/2,y:m.y+(b.y-m.y)/2},{x:b.x,y:b.y}],D=g?`${g}-${i.id}`:i.id,B=i.thickness==="thick"?"edge-thickness-thick":"edge-thickness-normal",T=i.pattern==="dotted"?"edge-pattern-dotted":"edge-pattern-solid",O=`${B} ${T} flowchart-link LS-a1 LE-b1`;if(Br(s,{v:i.start,w:i.end,name:D},{...i,id:D,arrowTypeEnd:i.arrowTypeEnd,arrowTypeStart:i.arrowTypeStart,points:S,classes:O},void 0,"block",f,g),i.label)await vr(s,{...i,label:i.label,labelStyle:"stroke: #333; stroke-width: 1.5px;fill:none;",arrowTypeEnd:i.arrowTypeEnd,arrowTypeStart:i.arrowTypeStart,points:S,classes:O}),Er({...i,x:S[1].x,y:S[1].y},{originalPath:S})}}}e(Ie,"insertEdges");var pa=e(function(s,a){return a.db.getClasses()},"getClasses"),fa=e(async function(s,a,c,o){let{securityLevel:g,block:f}=u(),i=o.db;i.setDiagramId(a);let p;if(g==="sandbox")p=n("#i"+a);let x=g==="sandbox"?n(p.nodes()[0].contentDocument.body):n("body"),m=g==="sandbox"?x.select(`[id="${a}"]`):n(`[id="${a}"]`);mr(m,["point","circle","cross"],o.type,a);let S=i.getBlocks(),D=i.getBlocksFlat(),B=i.getEdges(),T=m.insert("g").attr("class","block");await _e(T,S,i);let O=pe(i);if(await De(T,S,i),await Ie(T,B,D,i,a),O){let I=O,F=Math.max(1,Math.round(0.125*(I.width/I.height))),A=I.height+F+10,z=I.width+10,{useMaxWidth:N}=f;k(m,A,z,!!N),t.debug("Here Bounds",O,I),m.attr("viewBox",`${I.x-5} ${I.y-5} ${I.width+10} ${I.height+10}`)}},"draw"),xa={draw:fa,getClasses:pa},Wa={parser:Pe,db:ir,renderer:xa,styles:cr};export{Wa as diagram};
132
+ node : x:${s.x} y:${s.y} w:${s.width} h:${s.height}`);let{x:o,y:g}=s,f=Math.abs(o-c.x),i=s.width/2,p=c.x<a.x?i-f:i+f,x=s.height/2,m=Math.abs(a.y-c.y),b=Math.abs(a.x-c.x);if(Math.abs(g-a.y)*i>Math.abs(o-a.x)*x){let k=c.y<a.y?a.y-x-g:g-x-a.y;p=b*k/m;let D={x:c.x<a.x?c.x+p:c.x-b+p,y:c.y<a.y?c.y+m-k:c.y-m+k};if(p===0)D.x=a.x,D.y=a.y;if(b===0)D.x=a.x;if(m===0)D.y=a.y;return t.debug(`abc89 topp/bott calc, Q ${m}, q ${k}, R ${b}, r ${p}`,D),D}else{if(c.x<a.x)p=a.x-i-o;else p=o-i-a.x;let k=m*p/b,D=c.x<a.x?c.x+b-p:c.x-b+p,B=c.y<a.y?c.y+k:c.y-k;if(t.debug(`sides calc abc89, Q ${m}, q ${k}, R ${b}, r ${p}`,{_x:D,_y:B}),p===0)D=a.x,B=a.y;if(b===0)D=a.x;if(m===0)B=a.y;return{x:D,y:B}}},"intersection"),ee=e((s,a)=>{t.debug("abc88 cutPathAtIntersect",s,a);let c=[],o=s[0],g=!1;return s.forEach((f)=>{if(!Tr(a,f)&&!g){let i=Dr(a,o,f),p=!1;if(c.forEach((x)=>{p=p||x.x===i.x&&x.y===i.y}),!c.some((x)=>x.x===i.x&&x.y===i.y))c.push(i);g=!0}else if(o=f,!g)c.push(f)}),c},"cutPathAtIntersect"),Br=e(function(s,a,c,o,g,f,i){let p=c.points;t.debug("abc88 InsertEdge: edge=",c,"e=",a);let x=!1,m=f.node(a.v);var b=f.node(a.w);if(b?.intersect&&m?.intersect)p=p.slice(1,c.points.length-1),p.unshift(m.intersect(p[0])),p.push(b.intersect(p[p.length-1]));if(c.toCluster)t.debug("to cluster abc88",o[c.toCluster]),p=ee(c.points,o[c.toCluster].node),x=!0;if(c.fromCluster)t.debug("from cluster abc88",o[c.fromCluster]),p=ee(p.reverse(),o[c.fromCluster].node).reverse(),x=!0;let k=p.filter((N)=>!Number.isNaN(N.y)),D=Be;if(c.curve&&(g==="graph"||g==="flowchart"))D=c.curve;let{x:B,y:_}=Jn(c),O=Le().x(B).y(_).curve(D),I;switch(c.thickness){case"normal":I="edge-thickness-normal";break;case"thick":I="edge-thickness-thick";break;case"invisible":I="edge-thickness-thick";break;default:I=""}switch(c.pattern){case"solid":I+=" edge-pattern-solid";break;case"dotted":I+=" edge-pattern-dotted";break;case"dashed":I+=" edge-pattern-dashed";break}let F=s.append("path").attr("d",O(k)).attr("id",c.id).attr("class"," "+I+(c.classes?" "+c.classes:"")).attr("style",c.style),A="";if(r().flowchart.arrowMarkerAbsolute||r().state.arrowMarkerAbsolute)A=ht(!0);Lr(F,c,A,i,g);let z={};if(x)z.updatedPath=p;return z.originalPath=c.points,z},"insertEdge"),Nr=e((s)=>{let a=new Set;for(let c of s)switch(c){case"x":a.add("right"),a.add("left");break;case"y":a.add("up"),a.add("down");break;default:a.add(c);break}return a},"expandAndDeduplicateDirections"),Ir=e((s,a,c,o)=>{let g=Nr(s),f=2,i=a.height+2*c.padding,p=i/2,x=o??a.width+2*p+c.padding,m=c.padding/2;if(g.has("right")&&g.has("left")&&g.has("up")&&g.has("down"))return[{x:0,y:0},{x:p,y:0},{x:x/2,y:2*m},{x:x-p,y:0},{x,y:0},{x,y:-i/3},{x:x+2*m,y:-i/2},{x,y:-2*i/3},{x,y:-i},{x:x-p,y:-i},{x:x/2,y:-i-2*m},{x:p,y:-i},{x:0,y:-i},{x:0,y:-2*i/3},{x:-2*m,y:-i/2},{x:0,y:-i/3}];if(g.has("right")&&g.has("left")&&g.has("up"))return[{x:p,y:0},{x:x-p,y:0},{x,y:-i/2},{x:x-p,y:-i},{x:p,y:-i},{x:0,y:-i/2}];if(g.has("right")&&g.has("left")&&g.has("down"))return[{x:0,y:0},{x:p,y:-i},{x:x-p,y:-i},{x,y:0}];if(g.has("right")&&g.has("up")&&g.has("down"))return[{x:0,y:0},{x,y:-p},{x,y:-i+p},{x:0,y:-i}];if(g.has("left")&&g.has("up")&&g.has("down"))return[{x,y:0},{x:0,y:-p},{x:0,y:-i+p},{x,y:-i}];if(g.has("right")&&g.has("left"))return[{x:p,y:0},{x:p,y:-m},{x:x-p,y:-m},{x:x-p,y:0},{x,y:-i/2},{x:x-p,y:-i},{x:x-p,y:-i+m},{x:p,y:-i+m},{x:p,y:-i},{x:0,y:-i/2}];if(g.has("up")&&g.has("down"))return[{x:x/2,y:0},{x:0,y:-m},{x:p,y:-m},{x:p,y:-i+m},{x:0,y:-i+m},{x:x/2,y:-i},{x,y:-i+m},{x:x-p,y:-i+m},{x:x-p,y:-m},{x,y:-m}];if(g.has("right")&&g.has("up"))return[{x:0,y:0},{x,y:-p},{x:0,y:-i}];if(g.has("right")&&g.has("down"))return[{x:0,y:0},{x,y:0},{x:0,y:-i}];if(g.has("left")&&g.has("up"))return[{x,y:0},{x:0,y:-p},{x,y:-i}];if(g.has("left")&&g.has("down"))return[{x,y:0},{x:0,y:0},{x,y:-i}];if(g.has("right"))return[{x:p,y:-m},{x:p,y:-m},{x:x-p,y:-m},{x:x-p,y:0},{x,y:-i/2},{x:x-p,y:-i},{x:x-p,y:-i+m},{x:p,y:-i+m},{x:p,y:-i+m}];if(g.has("left"))return[{x:p,y:0},{x:p,y:-m},{x:x-p,y:-m},{x:x-p,y:-i+m},{x:p,y:-i+m},{x:p,y:-i},{x:0,y:-i/2}];if(g.has("up"))return[{x:p,y:-m},{x:p,y:-i+m},{x:0,y:-i+m},{x:x/2,y:-i},{x,y:-i+m},{x:x-p,y:-i+m},{x:x-p,y:-m}];if(g.has("down"))return[{x:x/2,y:0},{x:0,y:-m},{x:p,y:-m},{x:p,y:-i+m},{x:x-p,y:-i+m},{x:x-p,y:-m},{x,y:-m}];return[{x:0,y:0}]},"getArrowPoints");function fe(s,a){return s.intersect(a)}e(fe,"intersectNode");var Cr=fe;function xe(s,a,c,o){var{x:g,y:f}=s,i=g-o.x,p=f-o.y,x=Math.sqrt(a*a*p*p+c*c*i*i),m=Math.abs(a*c*i/x);if(o.x<g)m=-m;var b=Math.abs(a*c*p/x);if(o.y<f)b=-b;return{x:g+m,y:f+b}}e(xe,"intersectEllipse");var ye=xe;function be(s,a,c){return ye(s,a,a,c)}e(be,"intersectCircle");var Or=be;function me(s,a,c,o){var g,f,i,p,x,m,b,k,D,B,_,O,I,F,A;if(g=a.y-s.y,i=s.x-a.x,x=a.x*s.y-s.x*a.y,D=g*c.x+i*c.y+x,B=g*o.x+i*o.y+x,D!==0&&B!==0&&zt(D,B))return;if(f=o.y-c.y,p=c.x-o.x,m=o.x*c.y-c.x*o.y,b=f*s.x+p*s.y+m,k=f*a.x+p*a.y+m,b!==0&&k!==0&&zt(b,k))return;if(_=g*p-f*i,_===0)return;return O=Math.abs(_/2),I=i*m-p*x,F=I<0?(I-O)/_:(I+O)/_,I=f*x-g*m,A=I<0?(I-O)/_:(I+O)/_,{x:F,y:A}}e(me,"intersectLine");function zt(s,a){return s*a>0}e(zt,"sameSign");var Rr=me,Ar=Se;function Se(s,a,c){var{x:o,y:g}=s,f=[],{POSITIVE_INFINITY:i,POSITIVE_INFINITY:p}=Number;if(typeof a.forEach==="function")a.forEach(function(_){i=Math.min(i,_.x),p=Math.min(p,_.y)});else i=Math.min(i,a.x),p=Math.min(p,a.y);var x=o-s.width/2-i,m=g-s.height/2-p;for(var b=0;b<a.length;b++){var k=a[b],D=a[b<a.length-1?b+1:0],B=Rr(s,c,{x:x+k.x,y:m+k.y},{x:x+D.x,y:m+D.y});if(B)f.push(B)}if(!f.length)return s;if(f.length>1)f.sort(function(_,O){var I=_.x-c.x,F=_.y-c.y,A=Math.sqrt(I*I+F*F),z=O.x-c.x,N=O.y-c.y,S=Math.sqrt(z*z+N*N);return A<S?-1:A===S?0:1});return f[0]}e(Se,"intersectPolygon");var zr=e((s,a)=>{var{x:c,y:o}=s,g=a.x-c,f=a.y-o,i=s.width/2,p=s.height/2,x,m;if(Math.abs(f)*i>Math.abs(g)*p){if(f<0)p=-p;x=f===0?0:p*g/f,m=p}else{if(g<0)i=-i;x=i,m=g===0?0:i*f/g}return{x:c+x,y:o+m}},"intersectRect"),Mr=zr,P={node:Cr,circle:Or,ellipse:ye,polygon:Ar,rect:Mr},K=e(async(s,a,c,o)=>{let g=r(),f,i=a.useHtmlLabels||M(g);if(!c)f="node default";else f=c;let p=s.insert("g").attr("class",f).attr("id",a.domId||a.id),x=p.insert("g").attr("class","label").attr("style",a.labelStyle),m;if(a.labelText===void 0)m="";else m=typeof a.labelText==="string"?a.labelText:a.labelText[0];let b;if(a.labelType==="markdown")b=Z(x,w(ke(m),g),{useHtmlLabels:i,width:a.width||g.flowchart.wrappingWidth,classes:"markdown-node-label"},g);else b=await Q(x,w(ke(m),g),a.labelStyle,!1,o);let k=b.getBBox(),D=a.padding/2;if(M(g)){let B=b.children[0],_=n(b);await an(B,m),k=B.getBoundingClientRect(),_.attr("width",k.width),_.attr("height",k.height)}if(i)x.attr("transform","translate("+-k.width/2+", "+-k.height/2+")");else x.attr("transform","translate(0, "+-k.height/2+")");if(a.centerLabel)x.attr("transform","translate("+-k.width/2+", "+-k.height/2+")");return x.insert("rect",":first-child"),{shapeSvg:p,bbox:k,halfPadding:D,label:x}},"labelHelper"),H=e((s,a)=>{let c=a.node().getBBox();s.width=c.width,s.height=c.height},"updateNodeBounds");function et(s,a,c,o){return s.insert("polygon",":first-child").attr("points",o.map(function(g){return g.x+","+g.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-a/2+","+c/2+")")}e(et,"insertPolygonShape");var Pr=e(async(s,a)=>{if(!(a.useHtmlLabels||M(r())))a.centerLabel=!0;let{shapeSvg:o,bbox:g,halfPadding:f}=await K(s,a,"node "+a.classes,!0);t.info("Classes = ",a.classes);let i=o.insert("rect",":first-child");return i.attr("rx",a.rx).attr("ry",a.ry).attr("x",-g.width/2-f).attr("y",-g.height/2-f).attr("width",g.width+a.padding).attr("height",g.height+a.padding),H(a,i),a.intersect=function(p){return P.rect(a,p)},o},"note"),Fr=Pr,re=e((s)=>{if(s)return" "+s;return""},"formatClass"),G=e((s,a)=>`${a?a:"node default"}${re(s.classes)} ${re(s.class)}`,"getClassesFromNode"),ae=e(async(s,a)=>{let{shapeSvg:c,bbox:o}=await K(s,a,G(a,void 0),!0),g=o.width+a.padding,f=o.height+a.padding,i=g+f,p=[{x:i/2,y:0},{x:i,y:-i/2},{x:i/2,y:-i},{x:0,y:-i/2}];t.info("Question main (Circle)");let x=et(c,i,i,p);return x.attr("style",a.style),H(a,x),a.intersect=function(m){return t.warn("Intersect called"),P.polygon(a,p,m)},c},"question"),Hr=e((s,a)=>{let c=s.insert("g").attr("class","node default").attr("id",a.domId||a.id),o=28,g=[{x:0,y:14},{x:14,y:0},{x:0,y:-14},{x:-14,y:0}];return c.insert("polygon",":first-child").attr("points",g.map(function(i){return i.x+","+i.y}).join(" ")).attr("class","state-start").attr("r",7).attr("width",28).attr("height",28),a.width=28,a.height=28,a.intersect=function(i){return P.circle(a,14,i)},c},"choice"),Wr=e(async(s,a)=>{let{shapeSvg:c,bbox:o}=await K(s,a,G(a,void 0),!0),g=4,f=a.positioned?a.height:o.height+a.padding,i=f/4,p=a.positioned?a.width:o.width+2*i+a.padding,x=[{x:i,y:0},{x:p-i,y:0},{x:p,y:-f/2},{x:p-i,y:-f},{x:i,y:-f},{x:0,y:-f/2}],m=et(c,p,f,x);return m.attr("style",a.style),H(a,m),a.intersect=function(b){return P.polygon(a,x,b)},c},"hexagon"),Yr=e(async(s,a)=>{let{shapeSvg:c,bbox:o}=await K(s,a,void 0,!0),g=2,f=o.height+2*a.padding,i=f/2,p=o.width+2*i+a.padding,m=a.positioned&&(a.widthInColumns??1)>1&&a.width>p?a.width:p,b=Ir(a.directions,o,a,m),k=et(c,m,f,b);return k.attr("style",a.style),H(a,k),a.intersect=function(D){return P.polygon(a,b,D)},c},"block_arrow"),Ur=e(async(s,a)=>{let{shapeSvg:c,bbox:o}=await K(s,a,G(a,void 0),!0),g=o.width+a.padding,f=o.height+a.padding,i=[{x:-f/2,y:0},{x:g,y:0},{x:g,y:-f},{x:-f/2,y:-f},{x:0,y:-f/2}];return et(c,g,f,i).attr("style",a.style),a.width=g+f,a.height=f,a.intersect=function(x){return P.polygon(a,i,x)},c},"rect_left_inv_arrow"),Vr=e(async(s,a)=>{let{shapeSvg:c,bbox:o}=await K(s,a,G(a),!0),g=o.width+a.padding,f=o.height+a.padding,i=[{x:-2*f/6,y:0},{x:g-f/6,y:0},{x:g+2*f/6,y:-f},{x:f/6,y:-f}],p=et(c,g,f,i);return p.attr("style",a.style),H(a,p),a.intersect=function(x){return P.polygon(a,i,x)},c},"lean_right"),Gr=e(async(s,a)=>{let{shapeSvg:c,bbox:o}=await K(s,a,G(a,void 0),!0),g=o.width+a.padding,f=o.height+a.padding,i=[{x:2*f/6,y:0},{x:g+f/6,y:0},{x:g-2*f/6,y:-f},{x:-f/6,y:-f}],p=et(c,g,f,i);return p.attr("style",a.style),H(a,p),a.intersect=function(x){return P.polygon(a,i,x)},c},"lean_left"),qr=e(async(s,a)=>{let{shapeSvg:c,bbox:o}=await K(s,a,G(a,void 0),!0),g=o.width+a.padding,f=o.height+a.padding,i=[{x:-2*f/6,y:0},{x:g+2*f/6,y:0},{x:g-f/6,y:-f},{x:f/6,y:-f}],p=et(c,g,f,i);return p.attr("style",a.style),H(a,p),a.intersect=function(x){return P.polygon(a,i,x)},c},"trapezoid"),$r=e(async(s,a)=>{let{shapeSvg:c,bbox:o}=await K(s,a,G(a,void 0),!0),g=o.width+a.padding,f=o.height+a.padding,i=[{x:f/6,y:0},{x:g-f/6,y:0},{x:g+2*f/6,y:-f},{x:-2*f/6,y:-f}],p=et(c,g,f,i);return p.attr("style",a.style),H(a,p),a.intersect=function(x){return P.polygon(a,i,x)},c},"inv_trapezoid"),ta=e(async(s,a)=>{let{shapeSvg:c,bbox:o}=await K(s,a,G(a,void 0),!0),g=o.width+a.padding,f=o.height+a.padding,i=[{x:0,y:0},{x:g+f/2,y:0},{x:g,y:-f/2},{x:g+f/2,y:-f},{x:0,y:-f}],p=et(c,g,f,i);return p.attr("style",a.style),H(a,p),a.intersect=function(x){return P.polygon(a,i,x)},c},"rect_right_inv_arrow"),ea=e(async(s,a)=>{let{shapeSvg:c,bbox:o}=await K(s,a,G(a,void 0),!0),g=o.width+a.padding,f=g/2,i=f/(2.5+g/50),p=o.height+i+a.padding,x="M 0,"+i+" a "+f+","+i+" 0,0,0 "+g+" 0 a "+f+","+i+" 0,0,0 "+-g+" 0 l 0,"+p+" a "+f+","+i+" 0,0,0 "+g+" 0 l 0,"+-p,m=c.attr("label-offset-y",i).insert("path",":first-child").attr("style",a.style).attr("d",x).attr("transform","translate("+-g/2+","+-(p/2+i)+")");return H(a,m),a.intersect=function(b){let k=P.rect(a,b),D=k.x-a.x;if(f!=0&&(Math.abs(D)<a.width/2||Math.abs(D)==a.width/2&&Math.abs(k.y-a.y)>a.height/2-i)){let B=i*i*(1-D*D/(f*f));if(B!=0)B=Math.sqrt(B);if(B=i-B,b.y-a.y>0)B=-B;k.y+=B}return k},c},"cylinder"),ra=e(async(s,a)=>{let{shapeSvg:c,bbox:o,halfPadding:g}=await K(s,a,"node "+a.classes+" "+a.class,!0),f=c.insert("rect",":first-child"),i=a.positioned?a.width:o.width+a.padding,p=a.positioned?a.height:o.height+a.padding,x=a.positioned?-i/2:-o.width/2-g,m=a.positioned?-p/2:-o.height/2-g;if(f.attr("class","basic label-container").attr("style",a.style).attr("rx",a.rx).attr("ry",a.ry).attr("x",x).attr("y",m).attr("width",i).attr("height",p),a.props){let b=new Set(Object.keys(a.props));if(a.props.borders)bt(f,a.props.borders,i,p),b.delete("borders");b.forEach((k)=>{t.warn(`Unknown node property ${k}`)})}return H(a,f),a.intersect=function(b){return P.rect(a,b)},c},"rect"),aa=e(async(s,a)=>{let{shapeSvg:c,bbox:o,halfPadding:g}=await K(s,a,"node "+a.classes,!0),f=c.insert("rect",":first-child"),i=a.positioned?a.width:o.width+a.padding,p=a.positioned?a.height:o.height+a.padding,x=a.positioned?-i/2:-o.width/2-g,m=a.positioned?-p/2:-o.height/2-g;if(f.attr("class","basic cluster composite label-container").attr("style",a.style).attr("rx",a.rx).attr("ry",a.ry).attr("x",x).attr("y",m).attr("width",i).attr("height",p),a.props){let b=new Set(Object.keys(a.props));if(a.props.borders)bt(f,a.props.borders,i,p),b.delete("borders");b.forEach((k)=>{t.warn(`Unknown node property ${k}`)})}return H(a,f),a.intersect=function(b){return P.rect(a,b)},c},"composite"),sa=e(async(s,a)=>{let{shapeSvg:c}=await K(s,a,"label",!0);t.trace("Classes = ",a.class);let o=c.insert("rect",":first-child"),g=0,f=0;if(o.attr("width",g).attr("height",f),c.attr("class","label edgeLabel"),a.props){let i=new Set(Object.keys(a.props));if(a.props.borders)bt(o,a.props.borders,g,f),i.delete("borders");i.forEach((p)=>{t.warn(`Unknown node property ${p}`)})}return H(a,o),a.intersect=function(i){return P.rect(a,i)},c},"labelRect");function bt(s,a,c,o){let g=[],f=e((p)=>{g.push(p,0)},"addBorder"),i=e((p)=>{g.push(0,p)},"skipBorder");if(a.includes("t"))t.debug("add top border"),f(c);else i(c);if(a.includes("r"))t.debug("add right border"),f(o);else i(o);if(a.includes("b"))t.debug("add bottom border"),f(c);else i(c);if(a.includes("l"))t.debug("add left border"),f(o);else i(o);s.attr("stroke-dasharray",g.join(" "))}e(bt,"applyNodePropertyBorders");var ia=e(async(s,a)=>{let c;if(!a.classes)c="node default";else c="node "+a.classes;let o=s.insert("g").attr("class",c).attr("id",a.domId||a.id),g=o.insert("rect",":first-child"),f=o.insert("line"),i=o.insert("g").attr("class","label"),p=a.labelText.flat?a.labelText.flat():a.labelText,x="";if(typeof p==="object")x=p[0];else x=p;t.info("Label text abc79",x,p,typeof p==="object");let m=await Q(i,x,a.labelStyle,!0,!0),b={width:0,height:0};if(M(r())){let O=m.children[0],I=n(m);b=O.getBoundingClientRect(),I.attr("width",b.width),I.attr("height",b.height)}t.info("Text 2",p);let k=p.slice(1,p.length),D=m.getBBox(),B=await Q(i,k.join?k.join("<br/>"):k,a.labelStyle,!0,!0);if(M(r())){let O=B.children[0],I=n(B);b=O.getBoundingClientRect(),I.attr("width",b.width),I.attr("height",b.height)}let _=a.padding/2;return n(B).attr("transform","translate( "+(b.width>D.width?0:(D.width-b.width)/2)+", "+(D.height+_+5)+")"),n(m).attr("transform","translate( "+(b.width<D.width?0:-(D.width-b.width)/2)+", 0)"),b=i.node().getBBox(),i.attr("transform","translate("+-b.width/2+", "+(-b.height/2-_+3)+")"),g.attr("class","outer title-state").attr("x",-b.width/2-_).attr("y",-b.height/2-_).attr("width",b.width+a.padding).attr("height",b.height+a.padding),f.attr("class","divider").attr("x1",-b.width/2-_).attr("x2",b.width/2+_).attr("y1",-b.height/2-_+D.height+_).attr("y2",-b.height/2-_+D.height+_),H(a,g),a.intersect=function(O){return P.rect(a,O)},o},"rectWithTitle"),na=e(async(s,a)=>{let{shapeSvg:c,bbox:o}=await K(s,a,G(a,void 0),!0),g=o.height+a.padding,f=o.width+g/4+a.padding,i=c.insert("rect",":first-child").attr("style",a.style).attr("rx",g/2).attr("ry",g/2).attr("x",-f/2).attr("y",-g/2).attr("width",f).attr("height",g);return H(a,i),a.intersect=function(p){return P.rect(a,p)},c},"stadium"),ca=e(async(s,a)=>{let{shapeSvg:c,bbox:o,halfPadding:g}=await K(s,a,G(a,void 0),!0),f=c.insert("circle",":first-child");return f.attr("style",a.style).attr("rx",a.rx).attr("ry",a.ry).attr("r",o.width/2+g).attr("width",o.width+a.padding).attr("height",o.height+a.padding),t.info("Circle main"),H(a,f),a.intersect=function(i){return t.info("Circle intersect",a,o.width/2+g,i),P.circle(a,o.width/2+g,i)},c},"circle"),la=e(async(s,a)=>{let{shapeSvg:c,bbox:o,halfPadding:g}=await K(s,a,G(a,void 0),!0),f=5,i=c.insert("g",":first-child"),p=i.insert("circle"),x=i.insert("circle");return i.attr("class",a.class),p.attr("style",a.style).attr("rx",a.rx).attr("ry",a.ry).attr("r",o.width/2+g+5).attr("width",o.width+a.padding+10).attr("height",o.height+a.padding+10),x.attr("style",a.style).attr("rx",a.rx).attr("ry",a.ry).attr("r",o.width/2+g).attr("width",o.width+a.padding).attr("height",o.height+a.padding),t.info("DoubleCircle main"),H(a,p),a.intersect=function(m){return t.info("DoubleCircle intersect",a,o.width/2+g+5,m),P.circle(a,o.width/2+g+5,m)},c},"doublecircle"),oa=e(async(s,a)=>{let{shapeSvg:c,bbox:o}=await K(s,a,G(a,void 0),!0),g=o.width+a.padding,f=o.height+a.padding,i=[{x:0,y:0},{x:g,y:0},{x:g,y:-f},{x:0,y:-f},{x:0,y:0},{x:-8,y:0},{x:g+8,y:0},{x:g+8,y:-f},{x:-8,y:-f},{x:-8,y:0}],p=et(c,g,f,i);return p.attr("style",a.style),H(a,p),a.intersect=function(x){return P.polygon(a,i,x)},c},"subroutine"),ha=e((s,a)=>{let c=s.insert("g").attr("class","node default").attr("id",a.domId||a.id),o=c.insert("circle",":first-child");return o.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),H(a,o),a.intersect=function(g){return P.circle(a,7,g)},c},"start"),se=e((s,a,c)=>{let o=s.insert("g").attr("class","node default").attr("id",a.domId||a.id),g=70,f=10;if(c==="LR")g=10,f=70;let i=o.append("rect").attr("x",-1*g/2).attr("y",-1*f/2).attr("width",g).attr("height",f).attr("class","fork-join");return H(a,i),a.height=a.height+a.padding/2,a.width=a.width+a.padding/2,a.intersect=function(p){return P.rect(a,p)},o},"forkJoin"),ga=e((s,a)=>{let c=s.insert("g").attr("class","node default").attr("id",a.domId||a.id),o=c.insert("circle",":first-child"),g=c.insert("circle",":first-child");return g.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),o.attr("class","state-end").attr("r",5).attr("width",10).attr("height",10),H(a,g),a.intersect=function(f){return P.circle(a,7,f)},c},"end"),ua=e(async(s,a)=>{let c=a.padding/2,o=4,g=8,f;if(!a.classes)f="node default";else f="node "+a.classes;let i=s.insert("g").attr("class",f).attr("id",a.domId||a.id),p=i.insert("rect",":first-child"),x=i.insert("line"),m=i.insert("line"),b=0,k=4,D=i.insert("g").attr("class","label"),B=0,_=a.classData.annotations?.[0],O=a.classData.annotations[0]?"«"+a.classData.annotations[0]+"»":"",I=await Q(D,O,a.labelStyle,!0,!0),F=I.getBBox();if(M(r())){let R=I.children[0],y=n(I);F=R.getBoundingClientRect(),y.attr("width",F.width),y.attr("height",F.height)}if(a.classData.annotations[0])k+=F.height+4,b+=F.width;let A=a.classData.label;if(a.classData.type!==void 0&&a.classData.type!=="")if(M(r()))A+="&lt;"+a.classData.type+"&gt;";else A+="<"+a.classData.type+">";let z=await Q(D,A,a.labelStyle,!0,!0);n(z).attr("class","classTitle");let N=z.getBBox();if(M(r())){let R=z.children[0],y=n(z);N=R.getBoundingClientRect(),y.attr("width",N.width),y.attr("height",N.height)}if(k+=N.height+4,N.width>b)b=N.width;let S=[];a.classData.members.forEach(async(R)=>{let y=R.getDisplayDetails(),V=y.displayText;if(M(r()))V=V.replace(/</g,"&lt;").replace(/>/g,"&gt;");let v=await Q(D,V,y.cssStyle?y.cssStyle:a.labelStyle,!0,!0),W=v.getBBox();if(M(r())){let it=v.children[0],rt=n(v);W=it.getBoundingClientRect(),rt.attr("width",W.width),rt.attr("height",W.height)}if(W.width>b)b=W.width;k+=W.height+4,S.push(v)}),k+=8;let E=[];if(a.classData.methods.forEach(async(R)=>{let y=R.getDisplayDetails(),V=y.displayText;if(M(r()))V=V.replace(/</g,"&lt;").replace(/>/g,"&gt;");let v=await Q(D,V,y.cssStyle?y.cssStyle:a.labelStyle,!0,!0),W=v.getBBox();if(M(r())){let it=v.children[0],rt=n(v);W=it.getBoundingClientRect(),rt.attr("width",W.width),rt.attr("height",W.height)}if(W.width>b)b=W.width;k+=W.height+4,E.push(v)}),k+=8,_){let R=(b-F.width)/2;n(I).attr("transform","translate( "+(-1*b/2+R)+", "+-1*k/2+")"),B=F.height+4}let C=(b-N.width)/2;return n(z).attr("transform","translate( "+(-1*b/2+C)+", "+(-1*k/2+B)+")"),B+=N.height+4,x.attr("class","divider").attr("x1",-b/2-c).attr("x2",b/2+c).attr("y1",-k/2-c+8+B).attr("y2",-k/2-c+8+B),B+=8,S.forEach((R)=>{n(R).attr("transform","translate( "+-b/2+", "+(-1*k/2+B+4)+")");let y=R?.getBBox();B+=(y?.height??0)+4}),B+=8,m.attr("class","divider").attr("x1",-b/2-c).attr("x2",b/2+c).attr("y1",-k/2-c+8+B).attr("y2",-k/2-c+8+B),B+=8,E.forEach((R)=>{n(R).attr("transform","translate( "+-b/2+", "+(-1*k/2+B)+")");let y=R?.getBBox();B+=(y?.height??0)+4}),p.attr("style",a.style).attr("class","outer title-state").attr("x",-b/2-c).attr("y",-(k/2)-c).attr("width",b+a.padding).attr("height",k+a.padding),H(a,p),a.intersect=function(R){return P.rect(a,R)},i},"class_box"),ie={rhombus:ae,composite:aa,question:ae,rect:ra,labelRect:sa,rectWithTitle:ia,choice:Hr,circle:ca,doublecircle:la,stadium:na,hexagon:Wr,block_arrow:Yr,rect_left_inv_arrow:Ur,lean_right:Vr,lean_left:Gr,trapezoid:qr,inv_trapezoid:$r,rect_right_inv_arrow:ta,cylinder:ea,start:ha,end:ga,note:Fr,subroutine:oa,fork:se,join:se,class_box:ua},ft={},ve=e(async(s,a,c)=>{let o,g;if(a.link){let f;if(r().securityLevel==="sandbox")f="_top";else if(a.linkTarget)f=a.linkTarget||"_blank";o=s.insert("svg:a").attr("xlink:href",a.link).attr("target",f),g=await ie[a.shape](o,a,c)}else g=await ie[a.shape](s,a,c),o=g;if(a.tooltip)g.attr("title",a.tooltip);if(a.class)g.attr("class","node default "+a.class);if(ft[a.id]=o,a.haveCallback)ft[a.id].attr("class",ft[a.id].attr("class")+" clickable");return o},"insertNode"),da=e((s)=>{let a=ft[s.id];t.trace("Transforming node",s.diff,s,"translate("+(s.x-s.width/2-5)+", "+s.width/2+")");let c=8,o=s.diff||0;if(s.clusterNode)a.attr("transform","translate("+(s.x+o-s.width/2)+", "+(s.y-s.height/2-c)+")");else a.attr("transform","translate("+s.x+", "+s.y+")");return o},"positionNode");function Ut(s,a,c=!1){let o=s,g="default";if((o?.classes?.length||0)>0)g=(o?.classes??[]).join(" ");g=g+" flowchart-label";let f=0,i="",p;switch(o.type){case"round":f=5,i="rect";break;case"composite":f=0,i="composite",p=0;break;case"square":i="rect";break;case"diamond":i="question";break;case"hexagon":i="hexagon";break;case"block_arrow":i="block_arrow";break;case"odd":i="rect_left_inv_arrow";break;case"lean_right":i="lean_right";break;case"lean_left":i="lean_left";break;case"trapezoid":i="trapezoid";break;case"inv_trapezoid":i="inv_trapezoid";break;case"rect_left_inv_arrow":i="rect_left_inv_arrow";break;case"circle":i="circle";break;case"ellipse":i="ellipse";break;case"stadium":i="stadium";break;case"subroutine":i="subroutine";break;case"cylinder":i="cylinder";break;case"group":i="rect";break;case"doublecircle":i="doublecircle";break;default:i="rect"}let x=Xn(o?.styles??[]),m=o.label,b=o.size??{width:0,height:0,x:0,y:0},k=a.getDiagramId();return{labelStyle:x.labelStyle,shape:i,labelText:m,rx:f,ry:f,class:g,style:x.style,id:o.id,domId:k?`${k}-${o.id}`:o.id,directions:o.directions,width:b.width,height:b.height,x:b.x,y:b.y,positioned:c,intersect:void 0,type:o.type,padding:p??u()?.block?.padding??0,widthInColumns:o.widthInColumns??1}}e(Ut,"getNodeFromBlock");async function Ee(s,a,c){let o=Ut(a,c,!1);if(o.type==="group")return;let g=u(),f=await ve(s,o,{config:g}),i=f.node().getBBox(),p=c.getBlock(o.id);p.size={width:i.width,height:i.height,x:0,y:0,node:f},c.setBlock(p),f.remove()}e(Ee,"calculateBlockSize");async function _e(s,a,c){let o=Ut(a,c,!0);if(c.getBlock(o.id).type!=="space"){let f=u();await ve(s,o,{config:f}),a.intersect=o?.intersect,da(o)}}e(_e,"insertBlockPositioned");async function wt(s,a,c,o){for(let g of a)if(await o(s,g,c),g.children)await wt(s,g.children,c,o)}e(wt,"performOperations");async function Te(s,a,c){await wt(s,a,c,Ee)}e(Te,"calculateBlockSizes");async function De(s,a,c){await wt(s,a,c,_e)}e(De,"insertBlocks");async function Ie(s,a,c,o,g){let f=new L({multigraph:!0,compound:!0});f.setGraph({rankdir:"TB",nodesep:10,ranksep:10,marginx:8,marginy:8});for(let i of c)if(i.size)f.setNode(i.id,{width:i.size.width,height:i.size.height,intersect:i.intersect});for(let i of a)if(i.start&&i.end){let p=o.getBlock(i.start),x=o.getBlock(i.end);if(p?.size&&x?.size){let m=p.size,b=x.size,k=[{x:m.x,y:m.y},{x:m.x+(b.x-m.x)/2,y:m.y+(b.y-m.y)/2},{x:b.x,y:b.y}],D=g?`${g}-${i.id}`:i.id,B=i.thickness==="thick"?"edge-thickness-thick":"edge-thickness-normal",_=i.pattern==="dotted"?"edge-pattern-dotted":"edge-pattern-solid",O=`${B} ${_} flowchart-link LS-a1 LE-b1`;if(Br(s,{v:i.start,w:i.end,name:D},{...i,id:D,arrowTypeEnd:i.arrowTypeEnd,arrowTypeStart:i.arrowTypeStart,points:k,classes:O},void 0,"block",f,g),i.label)await Er(s,{...i,label:i.label,labelStyle:"stroke: #333; stroke-width: 1.5px;fill:none;",arrowTypeEnd:i.arrowTypeEnd,arrowTypeStart:i.arrowTypeStart,points:k,classes:O}),_r({...i,x:k[1].x,y:k[1].y},{originalPath:k})}}}e(Ie,"insertEdges");var pa=e(function(s,a){return a.db.getClasses()},"getClasses"),fa=e(async function(s,a,c,o){let{securityLevel:g,block:f}=u(),i=o.db;i.setDiagramId(a);let p;if(g==="sandbox")p=n("#i"+a);let x=g==="sandbox"?n(p.nodes()[0].contentDocument.body):n("body"),m=g==="sandbox"?x.select(`[id="${a}"]`):n(`[id="${a}"]`);mr(m,["point","circle","cross"],o.type,a);let k=i.getBlocks(),D=i.getBlocksFlat(),B=i.getEdges(),_=m.insert("g").attr("class","block");await Te(_,k,i);let O=pe(i);if(await De(_,k,i),await Ie(_,B,D,i,a),O){let I=O,F=Math.max(1,Math.round(0.125*(I.width/I.height))),A=I.height+F+10,z=I.width+10,{useMaxWidth:N}=f;T(m,A,z,!!N),t.debug("Here Bounds",O,I),m.attr("viewBox",`${I.x-5} ${I.y-5} ${I.width+10} ${I.height+10}`)}},"draw"),xa={draw:fa,getClasses:pa},Wa={parser:Pe,db:ir,renderer:xa,styles:cr};export{Wa as diagram};