@legionworks/facet 1.9.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 (327) hide show
  1. package/LICENSE-APACHE +202 -0
  2. package/LICENSE-MIT +23 -0
  3. package/README.md +158 -0
  4. package/dist/gallery/chunk-4g8rem85.css +656 -0
  5. package/dist/gallery/chunk-c6s9k9ty.js +5970 -0
  6. package/dist/gallery/frame/artifact.css +8424 -0
  7. package/dist/gallery/frame/chunks/abnfDiagram-N423BO3Z-jj74szbm.js +155 -0
  8. package/dist/gallery/frame/chunks/architecture-TIHT7OUA-cvdjn7dt.js +10 -0
  9. package/dist/gallery/frame/chunks/architectureDiagram-T3A2C74G-n4z77eg6.js +8675 -0
  10. package/dist/gallery/frame/chunks/blockDiagram-VBNYF7ZC-7xsqzrd1.js +3529 -0
  11. package/dist/gallery/frame/chunks/c4Diagram-5PPSVZJV-z2zjs7wx.js +2413 -0
  12. package/dist/gallery/frame/chunks/classDiagram-JCYQIIEL-ve8rngqp.js +47 -0
  13. package/dist/gallery/frame/chunks/classDiagram-v2-OCEON4UE-8cfaxb8z.js +47 -0
  14. package/dist/gallery/frame/chunks/cose-bilkent-JH36ORCC-sn92qexx.js +4822 -0
  15. package/dist/gallery/frame/chunks/cynefin-VYW2F7L2-tqjv913d.js +10 -0
  16. package/dist/gallery/frame/chunks/cynefinDiagram-MW4NZA55-c1c0dj12.js +500 -0
  17. package/dist/gallery/frame/chunks/dagre-VZM6K2ZE-7tyg4yt2.js +476 -0
  18. package/dist/gallery/frame/chunks/diagram-7IWD3JNH-y4eng9sc.js +526 -0
  19. package/dist/gallery/frame/chunks/diagram-B4RE2ZJO-rn3p7j5h.js +673 -0
  20. package/dist/gallery/frame/chunks/diagram-LBJQPF4R-w4a2cm9q.js +255 -0
  21. package/dist/gallery/frame/chunks/diagram-Q27KOJAE-aqc2v7wy.js +575 -0
  22. package/dist/gallery/frame/chunks/diagram-UB23O5K3-xncy8nyd.js +355 -0
  23. package/dist/gallery/frame/chunks/ebnfDiagram-BXEA7PRR-acwgxz16.js +175 -0
  24. package/dist/gallery/frame/chunks/erDiagram-JOGREHBK-mzp5nswt.js +1332 -0
  25. package/dist/gallery/frame/chunks/eventmodeling-45OFAUF4-sg07qr0c.js +10 -0
  26. package/dist/gallery/frame/chunks/flowDiagram-UKHOOZJN-2e5ygs44.js +29 -0
  27. package/dist/gallery/frame/chunks/ganttDiagram-PKOTCBZU-p2hhh7hr.js +2620 -0
  28. package/dist/gallery/frame/chunks/gitGraph-TEB2WS4Q-j6kw0naa.js +10 -0
  29. package/dist/gallery/frame/chunks/gitGraphDiagram-DS77QQ5N-4z9z8wjm.js +1347 -0
  30. package/dist/gallery/frame/chunks/info-DKCQHKI2-mpt80jd3.js +10 -0
  31. package/dist/gallery/frame/chunks/infoDiagram-6WML65LV-5rqm3mgg.js +65 -0
  32. package/dist/gallery/frame/chunks/ishikawaDiagram-WSZJBQD7-b51z96jy.js +975 -0
  33. package/dist/gallery/frame/chunks/journeyDiagram-NVQOT4AX-9jbfp0pk.js +1272 -0
  34. package/dist/gallery/frame/chunks/kanban-definition-27J2QSJJ-4x0vx4se.js +1116 -0
  35. package/dist/gallery/frame/chunks/katex-xfgk95tv.js +14034 -0
  36. package/dist/gallery/frame/chunks/markdown-1s5vwkf2.js +9 -0
  37. package/dist/gallery/frame/chunks/markdown-2h6bwsms.js +3239 -0
  38. package/dist/gallery/frame/chunks/markdown-2x113yh8.js +107 -0
  39. package/dist/gallery/frame/chunks/markdown-30b7rwmp.js +1943 -0
  40. package/dist/gallery/frame/chunks/markdown-356bfj4g.js +2031 -0
  41. package/dist/gallery/frame/chunks/markdown-44n9ea69.js +2406 -0
  42. package/dist/gallery/frame/chunks/markdown-56enrf2r.js +39 -0
  43. package/dist/gallery/frame/chunks/markdown-5avymm8t.js +725 -0
  44. package/dist/gallery/frame/chunks/markdown-6r4svars.js +33 -0
  45. package/dist/gallery/frame/chunks/markdown-6zz8efx2.js +24 -0
  46. package/dist/gallery/frame/chunks/markdown-7jp6prnb.js +19 -0
  47. package/dist/gallery/frame/chunks/markdown-809k7q41.js +55 -0
  48. package/dist/gallery/frame/chunks/markdown-82xmzhzd.js +1076 -0
  49. package/dist/gallery/frame/chunks/markdown-92n37gd4.js +7627 -0
  50. package/dist/gallery/frame/chunks/markdown-ag2sssf8.js +36 -0
  51. package/dist/gallery/frame/chunks/markdown-b4s7ntq2.js +19 -0
  52. package/dist/gallery/frame/chunks/markdown-c9k0fvp1.js +100 -0
  53. package/dist/gallery/frame/chunks/markdown-ceefymn8.js +125 -0
  54. package/dist/gallery/frame/chunks/markdown-d1wfbs70.js +243 -0
  55. package/dist/gallery/frame/chunks/markdown-dy5sgjhc.js +11022 -0
  56. package/dist/gallery/frame/chunks/markdown-dz3z5w30.js +30868 -0
  57. package/dist/gallery/frame/chunks/markdown-eg6ngz7y.js +30340 -0
  58. package/dist/gallery/frame/chunks/markdown-ff5wvb43.js +1149 -0
  59. package/dist/gallery/frame/chunks/markdown-ffg06nfz.js +86 -0
  60. package/dist/gallery/frame/chunks/markdown-fvfncadf.js +472 -0
  61. package/dist/gallery/frame/chunks/markdown-gvyszqpv.js +19 -0
  62. package/dist/gallery/frame/chunks/markdown-gx1p0ew0.js +88 -0
  63. package/dist/gallery/frame/chunks/markdown-gxye5frz.js +65 -0
  64. package/dist/gallery/frame/chunks/markdown-h7pzv34e.js +105 -0
  65. package/dist/gallery/frame/chunks/markdown-hab789t9.js +47 -0
  66. package/dist/gallery/frame/chunks/markdown-hjp6sj8t.js +125 -0
  67. package/dist/gallery/frame/chunks/markdown-jka64qgp.js +1993 -0
  68. package/dist/gallery/frame/chunks/markdown-k8xkn8mw.js +56 -0
  69. package/dist/gallery/frame/chunks/markdown-m7frq8x8.js +112 -0
  70. package/dist/gallery/frame/chunks/markdown-p740v4qm.js +36 -0
  71. package/dist/gallery/frame/chunks/markdown-pxfeh231.js +57 -0
  72. package/dist/gallery/frame/chunks/markdown-pzgd8z3s.js +87 -0
  73. package/dist/gallery/frame/chunks/markdown-qx3cngz2.js +1673 -0
  74. package/dist/gallery/frame/chunks/markdown-rawhfvvc.js +85 -0
  75. package/dist/gallery/frame/chunks/markdown-rd8w0ng9.js +49 -0
  76. package/dist/gallery/frame/chunks/markdown-rm2yxfjj.js +2773 -0
  77. package/dist/gallery/frame/chunks/markdown-s1jatrnk.js +993 -0
  78. package/dist/gallery/frame/chunks/markdown-sgfg5vvq.js +59 -0
  79. package/dist/gallery/frame/chunks/markdown-t4ethv9d.js +409 -0
  80. package/dist/gallery/frame/chunks/markdown-tnmabqvz.js +36 -0
  81. package/dist/gallery/frame/chunks/markdown-tvdpppw8.js +5292 -0
  82. package/dist/gallery/frame/chunks/markdown-v0x27twr.js +22 -0
  83. package/dist/gallery/frame/chunks/markdown-v14td68x.js +36 -0
  84. package/dist/gallery/frame/chunks/markdown-w6sgd54z.js +36 -0
  85. package/dist/gallery/frame/chunks/markdown-xw8dsk8b.js +2125 -0
  86. package/dist/gallery/frame/chunks/markdown-y18mve73.js +85 -0
  87. package/dist/gallery/frame/chunks/markdown-yengsms5.js +427 -0
  88. package/dist/gallery/frame/chunks/markdown-z1wc0v0d.js +1826 -0
  89. package/dist/gallery/frame/chunks/markdown-zazx9h4n.js +329 -0
  90. package/dist/gallery/frame/chunks/mermaid-de7p4v0x.js +30 -0
  91. package/dist/gallery/frame/chunks/mindmap-definition-FAOFIHXS-ra44cbem.js +1216 -0
  92. package/dist/gallery/frame/chunks/packet-7NZHBO7P-xppm5913.js +10 -0
  93. package/dist/gallery/frame/chunks/pegDiagram-VL7TDLO6-a2a4wg03.js +163 -0
  94. package/dist/gallery/frame/chunks/pie-RZYD4A2V-hnbxk152.js +10 -0
  95. package/dist/gallery/frame/chunks/pieDiagram-7S7Q4E2Y-f1vxjtmx.js +311 -0
  96. package/dist/gallery/frame/chunks/quadrantDiagram-CIZ2JOQS-ywafa6kh.js +1390 -0
  97. package/dist/gallery/frame/chunks/radar-I7S5WNFK-ewqd27se.js +10 -0
  98. package/dist/gallery/frame/chunks/railroad-3IZDKUUU-5hy4bdx3.js +10 -0
  99. package/dist/gallery/frame/chunks/railroad-abnf-AHOZXSZD-bh5sxz0d.js +10 -0
  100. package/dist/gallery/frame/chunks/railroad-ebnf-EBAXGLYW-6b9c3zeh.js +10 -0
  101. package/dist/gallery/frame/chunks/railroad-peg-LSFZ7HO6-avc8v39s.js +10 -0
  102. package/dist/gallery/frame/chunks/railroadDiagram-AXF67PYL-qc61wax4.js +131 -0
  103. package/dist/gallery/frame/chunks/requirementDiagram-LRYGKXZP-9bs4786c.js +1295 -0
  104. package/dist/gallery/frame/chunks/sankeyDiagram-W5VNT64P-awt1em8b.js +1339 -0
  105. package/dist/gallery/frame/chunks/sequenceDiagram-SI44F4Z6-qaf9mz3t.js +4324 -0
  106. package/dist/gallery/frame/chunks/sizeCapture-X5ZJPWSS-9fq685xd.js +64 -0
  107. package/dist/gallery/frame/chunks/stateDiagram-OKZ733FA-vx7a7hh0.js +456 -0
  108. package/dist/gallery/frame/chunks/stateDiagram-v2-UEYNNEHI-x4m6ws5t.js +46 -0
  109. package/dist/gallery/frame/chunks/swimlanes-SLNWSIFB-e4mxm1gh.js +8287 -0
  110. package/dist/gallery/frame/chunks/swimlanesDiagram-ULZ7WXOC-0h93e2qq.js +42 -0
  111. package/dist/gallery/frame/chunks/timeline-definition-Z64GVDOM-wp0bhbzg.js +1549 -0
  112. package/dist/gallery/frame/chunks/treeView-QDETBFTQ-hcx7n0vt.js +10 -0
  113. package/dist/gallery/frame/chunks/treemap-6X3UGDF4-av02skdw.js +10 -0
  114. package/dist/gallery/frame/chunks/vennDiagram-T6HMQDX7-pmvk1p7n.js +2566 -0
  115. package/dist/gallery/frame/chunks/wardley-OPB4EBWU-njsp6e40.js +10 -0
  116. package/dist/gallery/frame/chunks/wardleyDiagram-T6FBY63Y-eggmnv4z.js +979 -0
  117. package/dist/gallery/frame/chunks/xychartDiagram-ELKLHX3M-q40tnpe5.js +1954 -0
  118. package/dist/gallery/frame/frame.css +183 -0
  119. package/dist/gallery/frame/runtime/chart.js +42744 -0
  120. package/dist/gallery/frame/runtime/html.js +14 -0
  121. package/dist/gallery/frame/runtime/markdown.js +1403 -0
  122. package/dist/gallery/frame/runtime/mermaid.js +32 -0
  123. package/dist/gallery/frame/runtime/svg.js +14 -0
  124. package/dist/gallery/frame/runtime/tsx.js +52 -0
  125. package/dist/gallery/index.html +104 -0
  126. package/docs/reference/cli.md +163 -0
  127. package/docs/reference/export.md +106 -0
  128. package/docs/reference/html.md +215 -0
  129. package/docs/reference/http.md +85 -0
  130. package/docs/reference/mcp.md +78 -0
  131. package/docs/reference/security.md +119 -0
  132. package/docs/reference/storage.md +93 -0
  133. package/docs/reference/tsx.md +101 -0
  134. package/docs/reference/validation.md +212 -0
  135. package/package.json +89 -0
  136. package/scripts/build-gallery.ts +127 -0
  137. package/scripts/launch-netns.sh +67 -0
  138. package/skills/facet/SKILL.md +100 -0
  139. package/src/cli/client.ts +311 -0
  140. package/src/cli/commands/create.ts +49 -0
  141. package/src/cli/commands/doctor.ts +249 -0
  142. package/src/cli/commands/export.ts +179 -0
  143. package/src/cli/commands/instantiate.ts +35 -0
  144. package/src/cli/commands/list.ts +49 -0
  145. package/src/cli/commands/open.ts +75 -0
  146. package/src/cli/commands/pin.ts +39 -0
  147. package/src/cli/commands/promote.ts +49 -0
  148. package/src/cli/commands/publish.ts +122 -0
  149. package/src/cli/commands/read-back.ts +56 -0
  150. package/src/cli/commands/status.ts +114 -0
  151. package/src/cli/commands/watch.ts +146 -0
  152. package/src/cli/main.ts +522 -0
  153. package/src/cli/output.ts +106 -0
  154. package/src/cli/parser.ts +376 -0
  155. package/src/cli/presenter.ts +212 -0
  156. package/src/cli/service-metadata.ts +134 -0
  157. package/src/cli/spawn-service.ts +326 -0
  158. package/src/css.d.ts +4 -0
  159. package/src/gallery-web/app.ts +1581 -0
  160. package/src/gallery-web/export-menu.ts +121 -0
  161. package/src/gallery-web/export.ts +112 -0
  162. package/src/gallery-web/favicon.ts +54 -0
  163. package/src/gallery-web/frame/entries/chart.ts +6 -0
  164. package/src/gallery-web/frame/entries/html.ts +6 -0
  165. package/src/gallery-web/frame/entries/markdown.ts +6 -0
  166. package/src/gallery-web/frame/entries/mermaid.ts +6 -0
  167. package/src/gallery-web/frame/entries/svg.ts +6 -0
  168. package/src/gallery-web/frame/entries/tsx.ts +6 -0
  169. package/src/gallery-web/frame/frame-payload.ts +91 -0
  170. package/src/gallery-web/frame/renderer-validation.ts +13 -0
  171. package/src/gallery-web/frame/renderers/chart.ts +182 -0
  172. package/src/gallery-web/frame/renderers/dompurify-shim.ts +112 -0
  173. package/src/gallery-web/frame/renderers/html.ts +48 -0
  174. package/src/gallery-web/frame/renderers/markdown.ts +81 -0
  175. package/src/gallery-web/frame/renderers/mermaid.ts +120 -0
  176. package/src/gallery-web/frame/renderers/registry.ts +260 -0
  177. package/src/gallery-web/frame/renderers/svg.ts +393 -0
  178. package/src/gallery-web/frame/renderers/tsx.ts +61 -0
  179. package/src/gallery-web/frame/runtime.ts +501 -0
  180. package/src/gallery-web/frame/styles/artifact.css +8424 -0
  181. package/src/gallery-web/frame/styles/frame.css +183 -0
  182. package/src/gallery-web/frame/styles/html-source.css +23 -0
  183. package/src/gallery-web/frame/view-box.ts +33 -0
  184. package/src/gallery-web/frame-html.ts +72 -0
  185. package/src/gallery-web/index.html +104 -0
  186. package/src/gallery-web/session.ts +107 -0
  187. package/src/gallery-web/sse-client.ts +212 -0
  188. package/src/gallery-web/styles/app.css +420 -0
  189. package/src/gallery-web/styles/tokens.css +112 -0
  190. package/src/gallery-web/styles/verdict.css +186 -0
  191. package/src/gallery-web/swap.ts +64 -0
  192. package/src/gallery-web/theme.ts +40 -0
  193. package/src/gallery-web/view-state.ts +93 -0
  194. package/src/harness-adapters/claude-code/README.md +10 -0
  195. package/src/harness-adapters/claude-code/facet.sh +4 -0
  196. package/src/harness-adapters/codex/README.md +10 -0
  197. package/src/harness-adapters/codex/facet.sh +4 -0
  198. package/src/harness-adapters/mcp/README.md +13 -0
  199. package/src/harness-adapters/mcp/cli-bridge.ts +216 -0
  200. package/src/harness-adapters/mcp/main.ts +15 -0
  201. package/src/harness-adapters/mcp/server.ts +164 -0
  202. package/src/harness-adapters/mcp/tool-schemas.ts +53 -0
  203. package/src/harness-adapters/opencode/README.md +10 -0
  204. package/src/harness-adapters/opencode/facet.sh +4 -0
  205. package/src/runtime/compiled-entrypoints.ts +69 -0
  206. package/src/service/dispatcher.ts +717 -0
  207. package/src/service/export.ts +218 -0
  208. package/src/service/http-utils.ts +55 -0
  209. package/src/service/lexical/expectations.ts +210 -0
  210. package/src/service/lifecycle/idle-controller.ts +125 -0
  211. package/src/service/lifecycle/orphan-cleanup.ts +128 -0
  212. package/src/service/lifecycle/process-lock.ts +235 -0
  213. package/src/service/main.ts +136 -0
  214. package/src/service/process.ts +240 -0
  215. package/src/service/router-guards.ts +239 -0
  216. package/src/service/router.ts +627 -0
  217. package/src/service/security/auth.ts +168 -0
  218. package/src/service/security/host-origin.ts +138 -0
  219. package/src/service/security/http-guards.ts +13 -0
  220. package/src/service/security/leases.ts +182 -0
  221. package/src/service/security/token-store.ts +138 -0
  222. package/src/service/server.ts +356 -0
  223. package/src/service/store/database.ts +61 -0
  224. package/src/service/store/evidence-retention.ts +234 -0
  225. package/src/service/store/migrations.ts +167 -0
  226. package/src/service/store/repository-lifecycle.ts +121 -0
  227. package/src/service/store/repository.ts +732 -0
  228. package/src/service/store/schema.ts +218 -0
  229. package/src/service/stored-verdict.ts +97 -0
  230. package/src/service/stream.ts +301 -0
  231. package/src/service/verdict-enrichment.ts +45 -0
  232. package/src/shared/build/frame-bundle-plugins.ts +61 -0
  233. package/src/shared/build-mode.ts +28 -0
  234. package/src/shared/config/evidence-read.ts +98 -0
  235. package/src/shared/config/limits.ts +56 -0
  236. package/src/shared/config/paths.ts +96 -0
  237. package/src/shared/contracts/artifact-types.ts +2 -0
  238. package/src/shared/contracts/artifact.ts +98 -0
  239. package/src/shared/contracts/commands/_shared.ts +59 -0
  240. package/src/shared/contracts/commands/guards.ts +86 -0
  241. package/src/shared/contracts/commands/index.ts +204 -0
  242. package/src/shared/contracts/commands/names.ts +35 -0
  243. package/src/shared/contracts/commands/requests.ts +149 -0
  244. package/src/shared/contracts/commands/results.ts +200 -0
  245. package/src/shared/contracts/envelope.ts +140 -0
  246. package/src/shared/contracts/events.ts +41 -0
  247. package/src/shared/contracts/observed-counts.ts +19 -0
  248. package/src/shared/contracts/renderers.ts +6 -0
  249. package/src/shared/contracts/validation.ts +296 -0
  250. package/src/shared/errors/facet-error.ts +127 -0
  251. package/src/shared/errors/store-error.ts +68 -0
  252. package/src/shared/evidence-image.ts +37 -0
  253. package/src/shared/export.ts +31 -0
  254. package/src/shared/html/policy.ts +108 -0
  255. package/src/shared/html/style-vocabulary.ts +352 -0
  256. package/src/shared/logging/logger.ts +108 -0
  257. package/src/shared/logging/redact.ts +49 -0
  258. package/src/shared/security/frozen-csp.ts +13 -0
  259. package/src/shared/storage-version.ts +2 -0
  260. package/src/shared/tsx/execution.ts +29 -0
  261. package/src/shared/tsx/import-policy.ts +94 -0
  262. package/src/shared/util/dir-permissions.ts +94 -0
  263. package/src/shared/util/mermaid-nodes.ts +230 -0
  264. package/src/shared/util/process.ts +67 -0
  265. package/src/shared/util/time.ts +21 -0
  266. package/src/shared/version.ts +3 -0
  267. package/src/validation/sandbox/limits.ts +41 -0
  268. package/src/validation/sandbox/netns.ts +177 -0
  269. package/src/validation/tier0/chart.ts +177 -0
  270. package/src/validation/tier0/dom-shim.ts +54 -0
  271. package/src/validation/tier0/html.ts +408 -0
  272. package/src/validation/tier0/markdown.ts +285 -0
  273. package/src/validation/tier0/mermaid.ts +98 -0
  274. package/src/validation/tier0/runner.ts +504 -0
  275. package/src/validation/tier0/svg.ts +321 -0
  276. package/src/validation/tier0/tsx/allowlist-resolver.ts +77 -0
  277. package/src/validation/tier0/tsx/ast-policy-capabilities.ts +238 -0
  278. package/src/validation/tier0/tsx/ast-policy-shared.ts +71 -0
  279. package/src/validation/tier0/tsx/ast-policy.ts +181 -0
  280. package/src/validation/tier0/tsx/compiler.ts +156 -0
  281. package/src/validation/tier0/worker-dispatch.ts +211 -0
  282. package/src/validation/tier0/worker-entry.ts +96 -0
  283. package/src/validation/tier0/worker-input.ts +75 -0
  284. package/src/validation/tier1/browser-process.ts +147 -0
  285. package/src/validation/tier1/cdp-pipe.ts +281 -0
  286. package/src/validation/tier1/entries/chart.ts +5 -0
  287. package/src/validation/tier1/entries/html.ts +6 -0
  288. package/src/validation/tier1/entries/markdown.ts +5 -0
  289. package/src/validation/tier1/entries/mermaid.ts +5 -0
  290. package/src/validation/tier1/entries/svg.ts +5 -0
  291. package/src/validation/tier1/entries/tsx.ts +5 -0
  292. package/src/validation/tier1/frame-target.ts +162 -0
  293. package/src/validation/tier1/harness-entry.ts +261 -0
  294. package/src/validation/tier1/harness.ts +215 -0
  295. package/src/validation/tier1/isolated-probe.ts +94 -0
  296. package/src/validation/tier1/launcher.ts +177 -0
  297. package/src/validation/tier1/limits.ts +80 -0
  298. package/src/validation/tier1/nonce.ts +17 -0
  299. package/src/validation/tier1/protocol-probe.ts +519 -0
  300. package/src/validation/tier1/runner.ts +1122 -0
  301. package/src/validation/tier1/verdict.ts +246 -0
  302. package/src/validation/tier1/webp.ts +69 -0
  303. package/templates/README.md +88 -0
  304. package/templates/bar-compare.vl.json +63 -0
  305. package/templates/capacity-report.tsx +102 -0
  306. package/templates/decision-record.md +24 -0
  307. package/templates/deployment-state.mmd +40 -0
  308. package/templates/exemplar.md +91 -0
  309. package/templates/facet-story.tsx +799 -0
  310. package/templates/fleet-dashboard.html +141 -0
  311. package/templates/html-release-ledger.html +91 -0
  312. package/templates/html-status-report.html +114 -0
  313. package/templates/incident-console.tsx +147 -0
  314. package/templates/legion-boundaries.mmd +23 -0
  315. package/templates/legion-flow.mmd +15 -0
  316. package/templates/legion-sequence.mmd +14 -0
  317. package/templates/legion-state.mmd +7 -0
  318. package/templates/metric-card.svg +29 -0
  319. package/templates/observability-map.svg +101 -0
  320. package/templates/pipeline-audit.md +108 -0
  321. package/templates/release-metrics.vl.json +98 -0
  322. package/templates/service-topology.mmd +47 -0
  323. package/templates/status-report.md +32 -0
  324. package/templates/system-map.svg +53 -0
  325. package/templates/timeseries.vl.json +71 -0
  326. package/templates/tsx-interactive-counter.tsx +19 -0
  327. package/templates/tsx-status-report.tsx +31 -0
@@ -0,0 +1,2031 @@
1
+ import {
2
+ getIconStyles
3
+ } from "./markdown-v0x27twr.js";
4
+ import {
5
+ createTooltip
6
+ } from "./markdown-hjp6sj8t.js";
7
+ import {
8
+ getDiagramElement
9
+ } from "./markdown-gvyszqpv.js";
10
+ import {
11
+ setupViewPortForSVG
12
+ } from "./markdown-6r4svars.js";
13
+ import {
14
+ getRegisteredLayoutAlgorithm,
15
+ render
16
+ } from "./markdown-h7pzv34e.js";
17
+ import {
18
+ getEdgeId,
19
+ utils_default
20
+ } from "./markdown-ff5wvb43.js";
21
+ import {
22
+ clear,
23
+ common_default,
24
+ dompurify_shim_default,
25
+ getAccDescription,
26
+ getAccTitle,
27
+ getConfig2,
28
+ getDiagramTitle,
29
+ parseGenericTypes,
30
+ sanitizeText,
31
+ setAccDescription,
32
+ setAccTitle,
33
+ setDiagramTitle
34
+ } from "./markdown-92n37gd4.js";
35
+ import {
36
+ log,
37
+ select_default
38
+ } from "./markdown-xw8dsk8b.js";
39
+ import {
40
+ __name
41
+ } from "./markdown-1s5vwkf2.js";
42
+
43
+ // node_modules/mermaid/dist/chunks/mermaid.core/chunk-GF5L2VYU.mjs
44
+ var parser = function() {
45
+ var o = /* @__PURE__ */ __name(function(k, v, o2, l) {
46
+ for (o2 = o2 || {}, l = k.length;l--; o2[k[l]] = v)
47
+ ;
48
+ return o2;
49
+ }, "o"), $V0 = [1, 18], $V1 = [1, 19], $V2 = [1, 20], $V3 = [1, 41], $V4 = [1, 26], $V5 = [1, 42], $V6 = [1, 24], $V7 = [1, 25], $V8 = [1, 32], $V9 = [1, 33], $Va = [1, 34], $Vb = [1, 45], $Vc = [1, 35], $Vd = [1, 36], $Ve = [1, 37], $Vf = [1, 38], $Vg = [1, 27], $Vh = [1, 28], $Vi = [1, 29], $Vj = [1, 30], $Vk = [1, 31], $Vl = [1, 44], $Vm = [1, 46], $Vn = [1, 43], $Vo = [1, 47], $Vp = [1, 9], $Vq = [1, 8, 9], $Vr = [1, 58], $Vs = [1, 59], $Vt = [1, 60], $Vu = [1, 61], $Vv = [1, 62], $Vw = [1, 63], $Vx = [1, 64], $Vy = [1, 8, 9, 41], $Vz = [1, 77], $VA = [1, 8, 9, 12, 13, 22, 39, 41, 44, 46, 68, 69, 70, 71, 72, 73, 74, 79, 81], $VB = [1, 8, 9, 12, 13, 18, 20, 22, 39, 41, 44, 46, 47, 60, 68, 69, 70, 71, 72, 73, 74, 79, 81, 86, 100, 102, 103], $VC = [13, 60, 86, 100, 102, 103], $VD = [13, 60, 73, 74, 86, 100, 102, 103], $VE = [13, 60, 68, 69, 70, 71, 72, 86, 100, 102, 103], $VF = [1, 103], $VG = [1, 121], $VH = [1, 117], $VI = [1, 113], $VJ = [1, 119], $VK = [1, 114], $VL = [1, 115], $VM = [1, 116], $VN = [1, 118], $VO = [1, 120], $VP = [22, 50, 60, 61, 82, 86, 87, 88, 89, 90], $VQ = [1, 128], $VR = [12, 39], $VS = [1, 8, 9, 39, 41, 44, 46], $VT = [1, 8, 9, 22], $VU = [1, 153], $VV = [1, 8, 9, 61], $VW = [1, 8, 9, 22, 50, 60, 61, 82, 86, 87, 88, 89, 90];
50
+ var parser2 = {
51
+ trace: /* @__PURE__ */ __name(function trace() {}, "trace"),
52
+ yy: {},
53
+ symbols_: { error: 2, start: 3, mermaidDoc: 4, statements: 5, graphConfig: 6, CLASS_DIAGRAM: 7, NEWLINE: 8, EOF: 9, statement: 10, classLabel: 11, SQS: 12, STR: 13, SQE: 14, namespaceName: 15, alphaNumToken: 16, classLiteralName: 17, DOT: 18, className: 19, GENERICTYPE: 20, relationStatement: 21, LABEL: 22, namespaceStatement: 23, classStatement: 24, memberStatement: 25, annotationStatement: 26, clickStatement: 27, styleStatement: 28, cssClassStatement: 29, noteStatement: 30, classDefStatement: 31, direction: 32, acc_title: 33, acc_title_value: 34, acc_descr: 35, acc_descr_value: 36, acc_descr_multiline_value: 37, namespaceIdentifier: 38, STRUCT_START: 39, classStatements: 40, STRUCT_STOP: 41, NAMESPACE: 42, classIdentifier: 43, STYLE_SEPARATOR: 44, members: 45, ANNOTATION_START: 46, ANNOTATION_END: 47, CLASS: 48, emptyBody: 49, SPACE: 50, MEMBER: 51, SEPARATOR: 52, relation: 53, NOTE_FOR: 54, noteText: 55, NOTE: 56, CLASSDEF: 57, classList: 58, stylesOpt: 59, ALPHA: 60, COMMA: 61, direction_tb: 62, direction_bt: 63, direction_rl: 64, direction_lr: 65, relationType: 66, lineType: 67, AGGREGATION: 68, EXTENSION: 69, COMPOSITION: 70, DEPENDENCY: 71, LOLLIPOP: 72, LINE: 73, DOTTED_LINE: 74, CALLBACK: 75, LINK: 76, LINK_TARGET: 77, CLICK: 78, CALLBACK_NAME: 79, CALLBACK_ARGS: 80, HREF: 81, STYLE: 82, CSSCLASS: 83, style: 84, styleComponent: 85, NUM: 86, COLON: 87, UNIT: 88, BRKT: 89, PCT: 90, commentToken: 91, textToken: 92, graphCodeTokens: 93, textNoTagsToken: 94, TAGSTART: 95, TAGEND: 96, "==": 97, "--": 98, DEFAULT: 99, MINUS: 100, keywords: 101, UNICODE_TEXT: 102, BQUOTE_STR: 103, $accept: 0, $end: 1 },
54
+ terminals_: { 2: "error", 7: "CLASS_DIAGRAM", 8: "NEWLINE", 9: "EOF", 12: "SQS", 13: "STR", 14: "SQE", 18: "DOT", 20: "GENERICTYPE", 22: "LABEL", 33: "acc_title", 34: "acc_title_value", 35: "acc_descr", 36: "acc_descr_value", 37: "acc_descr_multiline_value", 39: "STRUCT_START", 41: "STRUCT_STOP", 42: "NAMESPACE", 44: "STYLE_SEPARATOR", 46: "ANNOTATION_START", 47: "ANNOTATION_END", 48: "CLASS", 50: "SPACE", 51: "MEMBER", 52: "SEPARATOR", 54: "NOTE_FOR", 56: "NOTE", 57: "CLASSDEF", 60: "ALPHA", 61: "COMMA", 62: "direction_tb", 63: "direction_bt", 64: "direction_rl", 65: "direction_lr", 68: "AGGREGATION", 69: "EXTENSION", 70: "COMPOSITION", 71: "DEPENDENCY", 72: "LOLLIPOP", 73: "LINE", 74: "DOTTED_LINE", 75: "CALLBACK", 76: "LINK", 77: "LINK_TARGET", 78: "CLICK", 79: "CALLBACK_NAME", 80: "CALLBACK_ARGS", 81: "HREF", 82: "STYLE", 83: "CSSCLASS", 86: "NUM", 87: "COLON", 88: "UNIT", 89: "BRKT", 90: "PCT", 93: "graphCodeTokens", 95: "TAGSTART", 96: "TAGEND", 97: "==", 98: "--", 99: "DEFAULT", 100: "MINUS", 101: "keywords", 102: "UNICODE_TEXT", 103: "BQUOTE_STR" },
55
+ productions_: [0, [3, 1], [3, 1], [4, 1], [6, 4], [5, 1], [5, 2], [5, 3], [11, 3], [15, 1], [15, 1], [15, 3], [15, 2], [19, 1], [19, 3], [19, 1], [19, 2], [19, 2], [19, 2], [10, 1], [10, 2], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 2], [10, 2], [10, 1], [23, 4], [23, 5], [38, 2], [38, 3], [40, 1], [40, 2], [40, 3], [40, 1], [40, 2], [40, 3], [40, 1], [40, 2], [40, 3], [24, 1], [24, 3], [24, 4], [24, 3], [24, 6], [24, 4], [24, 7], [24, 6], [43, 2], [43, 3], [49, 0], [49, 2], [49, 2], [26, 4], [45, 1], [45, 2], [25, 1], [25, 2], [25, 1], [25, 1], [21, 3], [21, 4], [21, 4], [21, 5], [30, 3], [30, 2], [31, 3], [58, 1], [58, 3], [32, 1], [32, 1], [32, 1], [32, 1], [53, 3], [53, 2], [53, 2], [53, 1], [66, 1], [66, 1], [66, 1], [66, 1], [66, 1], [67, 1], [67, 1], [27, 3], [27, 4], [27, 3], [27, 4], [27, 4], [27, 5], [27, 3], [27, 4], [27, 4], [27, 5], [27, 4], [27, 5], [27, 5], [27, 6], [28, 3], [29, 3], [59, 1], [59, 3], [84, 1], [84, 2], [85, 1], [85, 1], [85, 1], [85, 1], [85, 1], [85, 1], [85, 1], [85, 1], [85, 1], [91, 1], [91, 1], [92, 1], [92, 1], [92, 1], [92, 1], [92, 1], [92, 1], [92, 1], [94, 1], [94, 1], [94, 1], [94, 1], [16, 1], [16, 1], [16, 1], [16, 1], [17, 1], [55, 1]],
56
+ performAction: /* @__PURE__ */ __name(function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) {
57
+ var $0 = $$.length - 1;
58
+ switch (yystate) {
59
+ case 8:
60
+ this.$ = $$[$0 - 1];
61
+ break;
62
+ case 9:
63
+ case 10:
64
+ case 13:
65
+ case 15:
66
+ this.$ = $$[$0];
67
+ break;
68
+ case 11:
69
+ case 14:
70
+ this.$ = $$[$0 - 2] + "." + $$[$0];
71
+ break;
72
+ case 12:
73
+ case 16:
74
+ this.$ = $$[$0 - 1] + $$[$0];
75
+ break;
76
+ case 17:
77
+ case 18:
78
+ this.$ = $$[$0 - 1] + "~" + $$[$0] + "~";
79
+ break;
80
+ case 19:
81
+ yy.addRelation($$[$0]);
82
+ break;
83
+ case 20:
84
+ $$[$0 - 1].title = yy.cleanupLabel($$[$0]);
85
+ yy.addRelation($$[$0 - 1]);
86
+ break;
87
+ case 31:
88
+ this.$ = $$[$0].trim();
89
+ yy.setAccTitle(this.$);
90
+ break;
91
+ case 32:
92
+ case 33:
93
+ this.$ = $$[$0].trim();
94
+ yy.setAccDescription(this.$);
95
+ break;
96
+ case 34:
97
+ yy.addClassesToNamespace($$[$0 - 3], $$[$0 - 1][0], $$[$0 - 1][1]);
98
+ yy.popNamespace();
99
+ break;
100
+ case 35:
101
+ yy.addClassesToNamespace($$[$0 - 4], $$[$0 - 1][0], $$[$0 - 1][1]);
102
+ yy.popNamespace();
103
+ break;
104
+ case 36:
105
+ this.$ = yy.addNamespace($$[$0]);
106
+ break;
107
+ case 37:
108
+ this.$ = yy.addNamespace($$[$0 - 1], $$[$0]);
109
+ break;
110
+ case 38:
111
+ this.$ = [[$$[$0]], []];
112
+ break;
113
+ case 39:
114
+ this.$ = [[$$[$0 - 1]], []];
115
+ break;
116
+ case 40:
117
+ $$[$0][0].unshift($$[$0 - 2]);
118
+ this.$ = $$[$0];
119
+ break;
120
+ case 41:
121
+ this.$ = [[], [$$[$0]]];
122
+ break;
123
+ case 42:
124
+ this.$ = [[], [$$[$0 - 1]]];
125
+ break;
126
+ case 43:
127
+ $$[$0][1].unshift($$[$0 - 2]);
128
+ this.$ = $$[$0];
129
+ break;
130
+ case 44:
131
+ case 45:
132
+ this.$ = [[], []];
133
+ break;
134
+ case 46:
135
+ this.$ = $$[$0];
136
+ break;
137
+ case 48:
138
+ yy.setCssClass($$[$0 - 2], $$[$0]);
139
+ break;
140
+ case 49:
141
+ yy.addMembers($$[$0 - 3], $$[$0 - 1]);
142
+ break;
143
+ case 51:
144
+ yy.setCssClass($$[$0 - 5], $$[$0 - 3]);
145
+ yy.addMembers($$[$0 - 5], $$[$0 - 1]);
146
+ break;
147
+ case 52:
148
+ yy.addAnnotation($$[$0 - 3], $$[$0 - 1]);
149
+ break;
150
+ case 53:
151
+ yy.addAnnotation($$[$0 - 6], $$[$0 - 4]);
152
+ yy.addMembers($$[$0 - 6], $$[$0 - 1]);
153
+ break;
154
+ case 54:
155
+ yy.addAnnotation($$[$0 - 5], $$[$0 - 3]);
156
+ break;
157
+ case 55:
158
+ this.$ = $$[$0];
159
+ yy.addClass($$[$0]);
160
+ break;
161
+ case 56:
162
+ this.$ = $$[$0 - 1];
163
+ yy.addClass($$[$0 - 1]);
164
+ yy.setClassLabel($$[$0 - 1], $$[$0]);
165
+ break;
166
+ case 60:
167
+ yy.addAnnotation($$[$0], $$[$0 - 2]);
168
+ break;
169
+ case 61:
170
+ case 74:
171
+ this.$ = [$$[$0]];
172
+ break;
173
+ case 62:
174
+ $$[$0].push($$[$0 - 1]);
175
+ this.$ = $$[$0];
176
+ break;
177
+ case 63:
178
+ break;
179
+ case 64:
180
+ yy.addMember($$[$0 - 1], yy.cleanupLabel($$[$0]));
181
+ break;
182
+ case 65:
183
+ break;
184
+ case 66:
185
+ break;
186
+ case 67:
187
+ this.$ = { id1: $$[$0 - 2], id2: $$[$0], relation: $$[$0 - 1], relationTitle1: "none", relationTitle2: "none" };
188
+ break;
189
+ case 68:
190
+ this.$ = { id1: $$[$0 - 3], id2: $$[$0], relation: $$[$0 - 1], relationTitle1: $$[$0 - 2], relationTitle2: "none" };
191
+ break;
192
+ case 69:
193
+ this.$ = { id1: $$[$0 - 3], id2: $$[$0], relation: $$[$0 - 2], relationTitle1: "none", relationTitle2: $$[$0 - 1] };
194
+ break;
195
+ case 70:
196
+ this.$ = { id1: $$[$0 - 4], id2: $$[$0], relation: $$[$0 - 2], relationTitle1: $$[$0 - 3], relationTitle2: $$[$0 - 1] };
197
+ break;
198
+ case 71:
199
+ this.$ = yy.addNote($$[$0], $$[$0 - 1]);
200
+ break;
201
+ case 72:
202
+ this.$ = yy.addNote($$[$0]);
203
+ break;
204
+ case 73:
205
+ this.$ = $$[$0 - 2];
206
+ yy.defineClass($$[$0 - 1], $$[$0]);
207
+ break;
208
+ case 75:
209
+ this.$ = $$[$0 - 2].concat([$$[$0]]);
210
+ break;
211
+ case 76:
212
+ yy.setDirection("TB");
213
+ break;
214
+ case 77:
215
+ yy.setDirection("BT");
216
+ break;
217
+ case 78:
218
+ yy.setDirection("RL");
219
+ break;
220
+ case 79:
221
+ yy.setDirection("LR");
222
+ break;
223
+ case 80:
224
+ this.$ = { type1: $$[$0 - 2], type2: $$[$0], lineType: $$[$0 - 1] };
225
+ break;
226
+ case 81:
227
+ this.$ = { type1: "none", type2: $$[$0], lineType: $$[$0 - 1] };
228
+ break;
229
+ case 82:
230
+ this.$ = { type1: $$[$0 - 1], type2: "none", lineType: $$[$0] };
231
+ break;
232
+ case 83:
233
+ this.$ = { type1: "none", type2: "none", lineType: $$[$0] };
234
+ break;
235
+ case 84:
236
+ this.$ = yy.relationType.AGGREGATION;
237
+ break;
238
+ case 85:
239
+ this.$ = yy.relationType.EXTENSION;
240
+ break;
241
+ case 86:
242
+ this.$ = yy.relationType.COMPOSITION;
243
+ break;
244
+ case 87:
245
+ this.$ = yy.relationType.DEPENDENCY;
246
+ break;
247
+ case 88:
248
+ this.$ = yy.relationType.LOLLIPOP;
249
+ break;
250
+ case 89:
251
+ this.$ = yy.lineType.LINE;
252
+ break;
253
+ case 90:
254
+ this.$ = yy.lineType.DOTTED_LINE;
255
+ break;
256
+ case 91:
257
+ case 97:
258
+ this.$ = $$[$0 - 2];
259
+ yy.setClickEvent($$[$0 - 1], $$[$0]);
260
+ break;
261
+ case 92:
262
+ case 98:
263
+ this.$ = $$[$0 - 3];
264
+ yy.setClickEvent($$[$0 - 2], $$[$0 - 1]);
265
+ yy.setTooltip($$[$0 - 2], $$[$0]);
266
+ break;
267
+ case 93:
268
+ this.$ = $$[$0 - 2];
269
+ yy.setLink($$[$0 - 1], $$[$0]);
270
+ break;
271
+ case 94:
272
+ this.$ = $$[$0 - 3];
273
+ yy.setLink($$[$0 - 2], $$[$0 - 1], $$[$0]);
274
+ break;
275
+ case 95:
276
+ this.$ = $$[$0 - 3];
277
+ yy.setLink($$[$0 - 2], $$[$0 - 1]);
278
+ yy.setTooltip($$[$0 - 2], $$[$0]);
279
+ break;
280
+ case 96:
281
+ this.$ = $$[$0 - 4];
282
+ yy.setLink($$[$0 - 3], $$[$0 - 2], $$[$0]);
283
+ yy.setTooltip($$[$0 - 3], $$[$0 - 1]);
284
+ break;
285
+ case 99:
286
+ this.$ = $$[$0 - 3];
287
+ yy.setClickEvent($$[$0 - 2], $$[$0 - 1], $$[$0]);
288
+ break;
289
+ case 100:
290
+ this.$ = $$[$0 - 4];
291
+ yy.setClickEvent($$[$0 - 3], $$[$0 - 2], $$[$0 - 1]);
292
+ yy.setTooltip($$[$0 - 3], $$[$0]);
293
+ break;
294
+ case 101:
295
+ this.$ = $$[$0 - 3];
296
+ yy.setLink($$[$0 - 2], $$[$0]);
297
+ break;
298
+ case 102:
299
+ this.$ = $$[$0 - 4];
300
+ yy.setLink($$[$0 - 3], $$[$0 - 1], $$[$0]);
301
+ break;
302
+ case 103:
303
+ this.$ = $$[$0 - 4];
304
+ yy.setLink($$[$0 - 3], $$[$0 - 1]);
305
+ yy.setTooltip($$[$0 - 3], $$[$0]);
306
+ break;
307
+ case 104:
308
+ this.$ = $$[$0 - 5];
309
+ yy.setLink($$[$0 - 4], $$[$0 - 2], $$[$0]);
310
+ yy.setTooltip($$[$0 - 4], $$[$0 - 1]);
311
+ break;
312
+ case 105:
313
+ this.$ = $$[$0 - 2];
314
+ yy.setCssStyle($$[$0 - 1], $$[$0]);
315
+ break;
316
+ case 106:
317
+ yy.setCssClass($$[$0 - 1], $$[$0]);
318
+ break;
319
+ case 107:
320
+ this.$ = [$$[$0]];
321
+ break;
322
+ case 108:
323
+ $$[$0 - 2].push($$[$0]);
324
+ this.$ = $$[$0 - 2];
325
+ break;
326
+ case 110:
327
+ this.$ = $$[$0 - 1] + $$[$0];
328
+ break;
329
+ }
330
+ }, "anonymous"),
331
+ table: [{ 3: 1, 4: 2, 5: 3, 6: 4, 7: [1, 6], 10: 5, 16: 39, 17: 40, 19: 21, 21: 7, 23: 8, 24: 9, 25: 10, 26: 11, 27: 12, 28: 13, 29: 14, 30: 15, 31: 16, 32: 17, 33: $V0, 35: $V1, 37: $V2, 38: 22, 42: $V3, 43: 23, 46: $V4, 48: $V5, 51: $V6, 52: $V7, 54: $V8, 56: $V9, 57: $Va, 60: $Vb, 62: $Vc, 63: $Vd, 64: $Ve, 65: $Vf, 75: $Vg, 76: $Vh, 78: $Vi, 82: $Vj, 83: $Vk, 86: $Vl, 100: $Vm, 102: $Vn, 103: $Vo }, { 1: [3] }, { 1: [2, 1] }, { 1: [2, 2] }, { 1: [2, 3] }, o($Vp, [2, 5], { 8: [1, 48] }), { 8: [1, 49] }, o($Vq, [2, 19], { 22: [1, 50] }), o($Vq, [2, 21]), o($Vq, [2, 22]), o($Vq, [2, 23]), o($Vq, [2, 24]), o($Vq, [2, 25]), o($Vq, [2, 26]), o($Vq, [2, 27]), o($Vq, [2, 28]), o($Vq, [2, 29]), o($Vq, [2, 30]), { 34: [1, 51] }, { 36: [1, 52] }, o($Vq, [2, 33]), o($Vq, [2, 63], { 53: 53, 66: 56, 67: 57, 13: [1, 54], 22: [1, 55], 68: $Vr, 69: $Vs, 70: $Vt, 71: $Vu, 72: $Vv, 73: $Vw, 74: $Vx }), { 39: [1, 65] }, o($Vy, [2, 47], { 39: [1, 67], 44: [1, 66], 46: [1, 68] }), o($Vq, [2, 65]), o($Vq, [2, 66]), { 16: 69, 60: $Vb, 86: $Vl, 100: $Vm, 102: $Vn }, { 16: 39, 17: 40, 19: 70, 60: $Vb, 86: $Vl, 100: $Vm, 102: $Vn, 103: $Vo }, { 16: 39, 17: 40, 19: 71, 60: $Vb, 86: $Vl, 100: $Vm, 102: $Vn, 103: $Vo }, { 16: 39, 17: 40, 19: 72, 60: $Vb, 86: $Vl, 100: $Vm, 102: $Vn, 103: $Vo }, { 60: [1, 73] }, { 13: [1, 74] }, { 16: 39, 17: 40, 19: 75, 60: $Vb, 86: $Vl, 100: $Vm, 102: $Vn, 103: $Vo }, { 13: $Vz, 55: 76 }, { 58: 78, 60: [1, 79] }, o($Vq, [2, 76]), o($Vq, [2, 77]), o($Vq, [2, 78]), o($Vq, [2, 79]), o($VA, [2, 13], { 16: 39, 17: 40, 19: 81, 18: [1, 80], 20: [1, 82], 60: $Vb, 86: $Vl, 100: $Vm, 102: $Vn, 103: $Vo }), o($VA, [2, 15], { 20: [1, 83] }), { 15: 84, 16: 85, 17: 86, 60: $Vb, 86: $Vl, 100: $Vm, 102: $Vn, 103: $Vo }, { 16: 39, 17: 40, 19: 87, 60: $Vb, 86: $Vl, 100: $Vm, 102: $Vn, 103: $Vo }, o($VB, [2, 133]), o($VB, [2, 134]), o($VB, [2, 135]), o($VB, [2, 136]), o([1, 8, 9, 12, 13, 20, 22, 39, 41, 44, 46, 68, 69, 70, 71, 72, 73, 74, 79, 81], [2, 137]), o($Vp, [2, 6], { 10: 5, 21: 7, 23: 8, 24: 9, 25: 10, 26: 11, 27: 12, 28: 13, 29: 14, 30: 15, 31: 16, 32: 17, 19: 21, 38: 22, 43: 23, 16: 39, 17: 40, 5: 88, 33: $V0, 35: $V1, 37: $V2, 42: $V3, 46: $V4, 48: $V5, 51: $V6, 52: $V7, 54: $V8, 56: $V9, 57: $Va, 60: $Vb, 62: $Vc, 63: $Vd, 64: $Ve, 65: $Vf, 75: $Vg, 76: $Vh, 78: $Vi, 82: $Vj, 83: $Vk, 86: $Vl, 100: $Vm, 102: $Vn, 103: $Vo }), { 5: 89, 10: 5, 16: 39, 17: 40, 19: 21, 21: 7, 23: 8, 24: 9, 25: 10, 26: 11, 27: 12, 28: 13, 29: 14, 30: 15, 31: 16, 32: 17, 33: $V0, 35: $V1, 37: $V2, 38: 22, 42: $V3, 43: 23, 46: $V4, 48: $V5, 51: $V6, 52: $V7, 54: $V8, 56: $V9, 57: $Va, 60: $Vb, 62: $Vc, 63: $Vd, 64: $Ve, 65: $Vf, 75: $Vg, 76: $Vh, 78: $Vi, 82: $Vj, 83: $Vk, 86: $Vl, 100: $Vm, 102: $Vn, 103: $Vo }, o($Vq, [2, 20]), o($Vq, [2, 31]), o($Vq, [2, 32]), { 13: [1, 91], 16: 39, 17: 40, 19: 90, 60: $Vb, 86: $Vl, 100: $Vm, 102: $Vn, 103: $Vo }, { 53: 92, 66: 56, 67: 57, 68: $Vr, 69: $Vs, 70: $Vt, 71: $Vu, 72: $Vv, 73: $Vw, 74: $Vx }, o($Vq, [2, 64]), { 67: 93, 73: $Vw, 74: $Vx }, o($VC, [2, 83], { 66: 94, 68: $Vr, 69: $Vs, 70: $Vt, 71: $Vu, 72: $Vv }), o($VD, [2, 84]), o($VD, [2, 85]), o($VD, [2, 86]), o($VD, [2, 87]), o($VD, [2, 88]), o($VE, [2, 89]), o($VE, [2, 90]), { 8: [1, 96], 23: 99, 24: 97, 30: 98, 38: 22, 40: 95, 42: $V3, 43: 23, 48: $V5, 54: $V8, 56: $V9 }, { 16: 100, 60: $Vb, 86: $Vl, 100: $Vm, 102: $Vn }, { 41: [1, 102], 45: 101, 51: $VF }, { 16: 104, 60: $Vb, 86: $Vl, 100: $Vm, 102: $Vn }, { 47: [1, 105] }, { 13: [1, 106] }, { 13: [1, 107] }, { 79: [1, 108], 81: [1, 109] }, { 22: $VG, 50: $VH, 59: 110, 60: $VI, 82: $VJ, 84: 111, 85: 112, 86: $VK, 87: $VL, 88: $VM, 89: $VN, 90: $VO }, { 60: [1, 122] }, { 13: $Vz, 55: 123 }, o($Vy, [2, 72]), o($Vy, [2, 138]), { 22: $VG, 50: $VH, 59: 124, 60: $VI, 61: [1, 125], 82: $VJ, 84: 111, 85: 112, 86: $VK, 87: $VL, 88: $VM, 89: $VN, 90: $VO }, o($VP, [2, 74]), { 16: 39, 17: 40, 19: 126, 60: $Vb, 86: $Vl, 100: $Vm, 102: $Vn, 103: $Vo }, o($VA, [2, 16]), o($VA, [2, 17]), o($VA, [2, 18]), { 11: 127, 12: $VQ, 39: [2, 36] }, o($VR, [2, 9], { 16: 85, 17: 86, 15: 130, 18: [1, 129], 60: $Vb, 86: $Vl, 100: $Vm, 102: $Vn, 103: $Vo }), o($VR, [2, 10]), o($VS, [2, 55], { 11: 131, 12: $VQ }), o($Vp, [2, 7]), { 9: [1, 132] }, o($VT, [2, 67]), { 16: 39, 17: 40, 19: 133, 60: $Vb, 86: $Vl, 100: $Vm, 102: $Vn, 103: $Vo }, { 13: [1, 135], 16: 39, 17: 40, 19: 134, 60: $Vb, 86: $Vl, 100: $Vm, 102: $Vn, 103: $Vo }, o($VC, [2, 82], { 66: 136, 68: $Vr, 69: $Vs, 70: $Vt, 71: $Vu, 72: $Vv }), o($VC, [2, 81]), { 41: [1, 137] }, { 23: 99, 24: 97, 30: 98, 38: 22, 40: 138, 42: $V3, 43: 23, 48: $V5, 54: $V8, 56: $V9 }, { 8: [1, 139], 41: [2, 38] }, { 8: [1, 140], 41: [2, 41] }, { 8: [1, 141], 41: [2, 44] }, o($Vy, [2, 48], { 39: [1, 142] }), { 41: [1, 143] }, o($Vy, [2, 50]), { 41: [2, 61], 45: 144, 51: $VF }, { 47: [1, 145] }, { 16: 39, 17: 40, 19: 146, 60: $Vb, 86: $Vl, 100: $Vm, 102: $Vn, 103: $Vo }, o($Vq, [2, 91], { 13: [1, 147] }), o($Vq, [2, 93], { 13: [1, 149], 77: [1, 148] }), o($Vq, [2, 97], { 13: [1, 150], 80: [1, 151] }), { 13: [1, 152] }, o($Vq, [2, 105], { 61: $VU }), o($VV, [2, 107], { 85: 154, 22: $VG, 50: $VH, 60: $VI, 82: $VJ, 86: $VK, 87: $VL, 88: $VM, 89: $VN, 90: $VO }), o($VW, [2, 109]), o($VW, [2, 111]), o($VW, [2, 112]), o($VW, [2, 113]), o($VW, [2, 114]), o($VW, [2, 115]), o($VW, [2, 116]), o($VW, [2, 117]), o($VW, [2, 118]), o($VW, [2, 119]), o($Vq, [2, 106]), o($Vy, [2, 71]), o($Vq, [2, 73], { 61: $VU }), { 60: [1, 155] }, o($VA, [2, 14]), { 39: [2, 37] }, { 13: [1, 156] }, { 15: 157, 16: 85, 17: 86, 60: $Vb, 86: $Vl, 100: $Vm, 102: $Vn, 103: $Vo }, o($VR, [2, 12]), o($VS, [2, 56]), { 1: [2, 4] }, o($VT, [2, 69]), o($VT, [2, 68]), { 16: 39, 17: 40, 19: 158, 60: $Vb, 86: $Vl, 100: $Vm, 102: $Vn, 103: $Vo }, o($VC, [2, 80]), o($Vy, [2, 34]), { 41: [1, 159] }, { 23: 99, 24: 97, 30: 98, 38: 22, 40: 160, 41: [2, 39], 42: $V3, 43: 23, 48: $V5, 54: $V8, 56: $V9 }, { 23: 99, 24: 97, 30: 98, 38: 22, 40: 161, 41: [2, 42], 42: $V3, 43: 23, 48: $V5, 54: $V8, 56: $V9 }, { 23: 99, 24: 97, 30: 98, 38: 22, 40: 162, 41: [2, 45], 42: $V3, 43: 23, 48: $V5, 54: $V8, 56: $V9 }, { 45: 163, 51: $VF }, o($Vy, [2, 49]), { 41: [2, 62] }, o($Vy, [2, 52], { 39: [1, 164] }), o($Vq, [2, 60]), o($Vq, [2, 92]), o($Vq, [2, 94]), o($Vq, [2, 95], { 77: [1, 165] }), o($Vq, [2, 98]), o($Vq, [2, 99], { 13: [1, 166] }), o($Vq, [2, 101], { 13: [1, 168], 77: [1, 167] }), { 22: $VG, 50: $VH, 60: $VI, 82: $VJ, 84: 169, 85: 112, 86: $VK, 87: $VL, 88: $VM, 89: $VN, 90: $VO }, o($VW, [2, 110]), o($VP, [2, 75]), { 14: [1, 170] }, o($VR, [2, 11]), o($VT, [2, 70]), o($Vy, [2, 35]), { 41: [2, 40] }, { 41: [2, 43] }, { 41: [2, 46] }, { 41: [1, 171] }, { 41: [1, 173], 45: 172, 51: $VF }, o($Vq, [2, 96]), o($Vq, [2, 100]), o($Vq, [2, 102]), o($Vq, [2, 103], { 77: [1, 174] }), o($VV, [2, 108], { 85: 154, 22: $VG, 50: $VH, 60: $VI, 82: $VJ, 86: $VK, 87: $VL, 88: $VM, 89: $VN, 90: $VO }), o($VS, [2, 8]), o($Vy, [2, 51]), { 41: [1, 175] }, o($Vy, [2, 54]), o($Vq, [2, 104]), o($Vy, [2, 53])],
332
+ defaultActions: { 2: [2, 1], 3: [2, 2], 4: [2, 3], 127: [2, 37], 132: [2, 4], 144: [2, 62], 160: [2, 40], 161: [2, 43], 162: [2, 46] },
333
+ parseError: /* @__PURE__ */ __name(function parseError(str, hash) {
334
+ if (hash.recoverable) {
335
+ this.trace(str);
336
+ } else {
337
+ var error = new Error(str);
338
+ error.hash = hash;
339
+ throw error;
340
+ }
341
+ }, "parseError"),
342
+ parse: /* @__PURE__ */ __name(function parse(input) {
343
+ var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;
344
+ var args = lstack.slice.call(arguments, 1);
345
+ var lexer2 = Object.create(this.lexer);
346
+ var sharedState = { yy: {} };
347
+ for (var k in this.yy) {
348
+ if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
349
+ sharedState.yy[k] = this.yy[k];
350
+ }
351
+ }
352
+ lexer2.setInput(input, sharedState.yy);
353
+ sharedState.yy.lexer = lexer2;
354
+ sharedState.yy.parser = this;
355
+ if (typeof lexer2.yylloc == "undefined") {
356
+ lexer2.yylloc = {};
357
+ }
358
+ var yyloc = lexer2.yylloc;
359
+ lstack.push(yyloc);
360
+ var ranges = lexer2.options && lexer2.options.ranges;
361
+ if (typeof sharedState.yy.parseError === "function") {
362
+ this.parseError = sharedState.yy.parseError;
363
+ } else {
364
+ this.parseError = Object.getPrototypeOf(this).parseError;
365
+ }
366
+ function popStack(n) {
367
+ stack.length = stack.length - 2 * n;
368
+ vstack.length = vstack.length - n;
369
+ lstack.length = lstack.length - n;
370
+ }
371
+ __name(popStack, "popStack");
372
+ function lex() {
373
+ var token;
374
+ token = tstack.pop() || lexer2.lex() || EOF;
375
+ if (typeof token !== "number") {
376
+ if (token instanceof Array) {
377
+ tstack = token;
378
+ token = tstack.pop();
379
+ }
380
+ token = self.symbols_[token] || token;
381
+ }
382
+ return token;
383
+ }
384
+ __name(lex, "lex");
385
+ var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;
386
+ while (true) {
387
+ state = stack[stack.length - 1];
388
+ if (this.defaultActions[state]) {
389
+ action = this.defaultActions[state];
390
+ } else {
391
+ if (symbol === null || typeof symbol == "undefined") {
392
+ symbol = lex();
393
+ }
394
+ action = table[state] && table[state][symbol];
395
+ }
396
+ if (typeof action === "undefined" || !action.length || !action[0]) {
397
+ var errStr = "";
398
+ expected = [];
399
+ for (p in table[state]) {
400
+ if (this.terminals_[p] && p > TERROR) {
401
+ expected.push("'" + this.terminals_[p] + "'");
402
+ }
403
+ }
404
+ if (lexer2.showPosition) {
405
+ errStr = "Parse error on line " + (yylineno + 1) + `:
406
+ ` + lexer2.showPosition() + `
407
+ Expecting ` + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
408
+ } else {
409
+ errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'");
410
+ }
411
+ this.parseError(errStr, {
412
+ text: lexer2.match,
413
+ token: this.terminals_[symbol] || symbol,
414
+ line: lexer2.yylineno,
415
+ loc: yyloc,
416
+ expected
417
+ });
418
+ }
419
+ if (action[0] instanceof Array && action.length > 1) {
420
+ throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
421
+ }
422
+ switch (action[0]) {
423
+ case 1:
424
+ stack.push(symbol);
425
+ vstack.push(lexer2.yytext);
426
+ lstack.push(lexer2.yylloc);
427
+ stack.push(action[1]);
428
+ symbol = null;
429
+ if (!preErrorSymbol) {
430
+ yyleng = lexer2.yyleng;
431
+ yytext = lexer2.yytext;
432
+ yylineno = lexer2.yylineno;
433
+ yyloc = lexer2.yylloc;
434
+ if (recovering > 0) {
435
+ recovering--;
436
+ }
437
+ } else {
438
+ symbol = preErrorSymbol;
439
+ preErrorSymbol = null;
440
+ }
441
+ break;
442
+ case 2:
443
+ len = this.productions_[action[1]][1];
444
+ yyval.$ = vstack[vstack.length - len];
445
+ yyval._$ = {
446
+ first_line: lstack[lstack.length - (len || 1)].first_line,
447
+ last_line: lstack[lstack.length - 1].last_line,
448
+ first_column: lstack[lstack.length - (len || 1)].first_column,
449
+ last_column: lstack[lstack.length - 1].last_column
450
+ };
451
+ if (ranges) {
452
+ yyval._$.range = [
453
+ lstack[lstack.length - (len || 1)].range[0],
454
+ lstack[lstack.length - 1].range[1]
455
+ ];
456
+ }
457
+ r = this.performAction.apply(yyval, [
458
+ yytext,
459
+ yyleng,
460
+ yylineno,
461
+ sharedState.yy,
462
+ action[1],
463
+ vstack,
464
+ lstack
465
+ ].concat(args));
466
+ if (typeof r !== "undefined") {
467
+ return r;
468
+ }
469
+ if (len) {
470
+ stack = stack.slice(0, -1 * len * 2);
471
+ vstack = vstack.slice(0, -1 * len);
472
+ lstack = lstack.slice(0, -1 * len);
473
+ }
474
+ stack.push(this.productions_[action[1]][0]);
475
+ vstack.push(yyval.$);
476
+ lstack.push(yyval._$);
477
+ newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
478
+ stack.push(newState);
479
+ break;
480
+ case 3:
481
+ return true;
482
+ }
483
+ }
484
+ return true;
485
+ }, "parse")
486
+ };
487
+ var lexer = /* @__PURE__ */ function() {
488
+ var lexer2 = {
489
+ EOF: 1,
490
+ parseError: /* @__PURE__ */ __name(function parseError(str, hash) {
491
+ if (this.yy.parser) {
492
+ this.yy.parser.parseError(str, hash);
493
+ } else {
494
+ throw new Error(str);
495
+ }
496
+ }, "parseError"),
497
+ setInput: /* @__PURE__ */ __name(function(input, yy) {
498
+ this.yy = yy || this.yy || {};
499
+ this._input = input;
500
+ this._more = this._backtrack = this.done = false;
501
+ this.yylineno = this.yyleng = 0;
502
+ this.yytext = this.matched = this.match = "";
503
+ this.conditionStack = ["INITIAL"];
504
+ this.yylloc = {
505
+ first_line: 1,
506
+ first_column: 0,
507
+ last_line: 1,
508
+ last_column: 0
509
+ };
510
+ if (this.options.ranges) {
511
+ this.yylloc.range = [0, 0];
512
+ }
513
+ this.offset = 0;
514
+ return this;
515
+ }, "setInput"),
516
+ input: /* @__PURE__ */ __name(function() {
517
+ var ch = this._input[0];
518
+ this.yytext += ch;
519
+ this.yyleng++;
520
+ this.offset++;
521
+ this.match += ch;
522
+ this.matched += ch;
523
+ var lines = ch.match(/(?:\r\n?|\n).*/g);
524
+ if (lines) {
525
+ this.yylineno++;
526
+ this.yylloc.last_line++;
527
+ } else {
528
+ this.yylloc.last_column++;
529
+ }
530
+ if (this.options.ranges) {
531
+ this.yylloc.range[1]++;
532
+ }
533
+ this._input = this._input.slice(1);
534
+ return ch;
535
+ }, "input"),
536
+ unput: /* @__PURE__ */ __name(function(ch) {
537
+ var len = ch.length;
538
+ var lines = ch.split(/(?:\r\n?|\n)/g);
539
+ this._input = ch + this._input;
540
+ this.yytext = this.yytext.substr(0, this.yytext.length - len);
541
+ this.offset -= len;
542
+ var oldLines = this.match.split(/(?:\r\n?|\n)/g);
543
+ this.match = this.match.substr(0, this.match.length - 1);
544
+ this.matched = this.matched.substr(0, this.matched.length - 1);
545
+ if (lines.length - 1) {
546
+ this.yylineno -= lines.length - 1;
547
+ }
548
+ var r = this.yylloc.range;
549
+ this.yylloc = {
550
+ first_line: this.yylloc.first_line,
551
+ last_line: this.yylineno + 1,
552
+ first_column: this.yylloc.first_column,
553
+ last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len
554
+ };
555
+ if (this.options.ranges) {
556
+ this.yylloc.range = [r[0], r[0] + this.yyleng - len];
557
+ }
558
+ this.yyleng = this.yytext.length;
559
+ return this;
560
+ }, "unput"),
561
+ more: /* @__PURE__ */ __name(function() {
562
+ this._more = true;
563
+ return this;
564
+ }, "more"),
565
+ reject: /* @__PURE__ */ __name(function() {
566
+ if (this.options.backtrack_lexer) {
567
+ this._backtrack = true;
568
+ } else {
569
+ 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).
570
+ ` + this.showPosition(), {
571
+ text: "",
572
+ token: null,
573
+ line: this.yylineno
574
+ });
575
+ }
576
+ return this;
577
+ }, "reject"),
578
+ less: /* @__PURE__ */ __name(function(n) {
579
+ this.unput(this.match.slice(n));
580
+ }, "less"),
581
+ pastInput: /* @__PURE__ */ __name(function() {
582
+ var past = this.matched.substr(0, this.matched.length - this.match.length);
583
+ return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, "");
584
+ }, "pastInput"),
585
+ upcomingInput: /* @__PURE__ */ __name(function() {
586
+ var next = this.match;
587
+ if (next.length < 20) {
588
+ next += this._input.substr(0, 20 - next.length);
589
+ }
590
+ return (next.substr(0, 20) + (next.length > 20 ? "..." : "")).replace(/\n/g, "");
591
+ }, "upcomingInput"),
592
+ showPosition: /* @__PURE__ */ __name(function() {
593
+ var pre = this.pastInput();
594
+ var c = new Array(pre.length + 1).join("-");
595
+ return pre + this.upcomingInput() + `
596
+ ` + c + "^";
597
+ }, "showPosition"),
598
+ test_match: /* @__PURE__ */ __name(function(match, indexed_rule) {
599
+ var token, lines, backup;
600
+ if (this.options.backtrack_lexer) {
601
+ backup = {
602
+ yylineno: this.yylineno,
603
+ yylloc: {
604
+ first_line: this.yylloc.first_line,
605
+ last_line: this.last_line,
606
+ first_column: this.yylloc.first_column,
607
+ last_column: this.yylloc.last_column
608
+ },
609
+ yytext: this.yytext,
610
+ match: this.match,
611
+ matches: this.matches,
612
+ matched: this.matched,
613
+ yyleng: this.yyleng,
614
+ offset: this.offset,
615
+ _more: this._more,
616
+ _input: this._input,
617
+ yy: this.yy,
618
+ conditionStack: this.conditionStack.slice(0),
619
+ done: this.done
620
+ };
621
+ if (this.options.ranges) {
622
+ backup.yylloc.range = this.yylloc.range.slice(0);
623
+ }
624
+ }
625
+ lines = match[0].match(/(?:\r\n?|\n).*/g);
626
+ if (lines) {
627
+ this.yylineno += lines.length;
628
+ }
629
+ this.yylloc = {
630
+ first_line: this.yylloc.last_line,
631
+ last_line: this.yylineno + 1,
632
+ first_column: this.yylloc.last_column,
633
+ last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length
634
+ };
635
+ this.yytext += match[0];
636
+ this.match += match[0];
637
+ this.matches = match;
638
+ this.yyleng = this.yytext.length;
639
+ if (this.options.ranges) {
640
+ this.yylloc.range = [this.offset, this.offset += this.yyleng];
641
+ }
642
+ this._more = false;
643
+ this._backtrack = false;
644
+ this._input = this._input.slice(match[0].length);
645
+ this.matched += match[0];
646
+ token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
647
+ if (this.done && this._input) {
648
+ this.done = false;
649
+ }
650
+ if (token) {
651
+ return token;
652
+ } else if (this._backtrack) {
653
+ for (var k in backup) {
654
+ this[k] = backup[k];
655
+ }
656
+ return false;
657
+ }
658
+ return false;
659
+ }, "test_match"),
660
+ next: /* @__PURE__ */ __name(function() {
661
+ if (this.done) {
662
+ return this.EOF;
663
+ }
664
+ if (!this._input) {
665
+ this.done = true;
666
+ }
667
+ var token, match, tempMatch, index;
668
+ if (!this._more) {
669
+ this.yytext = "";
670
+ this.match = "";
671
+ }
672
+ var rules = this._currentRules();
673
+ for (var i = 0;i < rules.length; i++) {
674
+ tempMatch = this._input.match(this.rules[rules[i]]);
675
+ if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
676
+ match = tempMatch;
677
+ index = i;
678
+ if (this.options.backtrack_lexer) {
679
+ token = this.test_match(tempMatch, rules[i]);
680
+ if (token !== false) {
681
+ return token;
682
+ } else if (this._backtrack) {
683
+ match = false;
684
+ continue;
685
+ } else {
686
+ return false;
687
+ }
688
+ } else if (!this.options.flex) {
689
+ break;
690
+ }
691
+ }
692
+ }
693
+ if (match) {
694
+ token = this.test_match(match, rules[index]);
695
+ if (token !== false) {
696
+ return token;
697
+ }
698
+ return false;
699
+ }
700
+ if (this._input === "") {
701
+ return this.EOF;
702
+ } else {
703
+ return this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
704
+ ` + this.showPosition(), {
705
+ text: "",
706
+ token: null,
707
+ line: this.yylineno
708
+ });
709
+ }
710
+ }, "next"),
711
+ lex: /* @__PURE__ */ __name(function lex() {
712
+ var r = this.next();
713
+ if (r) {
714
+ return r;
715
+ } else {
716
+ return this.lex();
717
+ }
718
+ }, "lex"),
719
+ begin: /* @__PURE__ */ __name(function begin(condition) {
720
+ this.conditionStack.push(condition);
721
+ }, "begin"),
722
+ popState: /* @__PURE__ */ __name(function popState() {
723
+ var n = this.conditionStack.length - 1;
724
+ if (n > 0) {
725
+ return this.conditionStack.pop();
726
+ } else {
727
+ return this.conditionStack[0];
728
+ }
729
+ }, "popState"),
730
+ _currentRules: /* @__PURE__ */ __name(function _currentRules() {
731
+ if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
732
+ return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
733
+ } else {
734
+ return this.conditions["INITIAL"].rules;
735
+ }
736
+ }, "_currentRules"),
737
+ topState: /* @__PURE__ */ __name(function topState(n) {
738
+ n = this.conditionStack.length - 1 - Math.abs(n || 0);
739
+ if (n >= 0) {
740
+ return this.conditionStack[n];
741
+ } else {
742
+ return "INITIAL";
743
+ }
744
+ }, "topState"),
745
+ pushState: /* @__PURE__ */ __name(function pushState(condition) {
746
+ this.begin(condition);
747
+ }, "pushState"),
748
+ stateStackSize: /* @__PURE__ */ __name(function stateStackSize() {
749
+ return this.conditionStack.length;
750
+ }, "stateStackSize"),
751
+ options: {},
752
+ performAction: /* @__PURE__ */ __name(function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
753
+ var YYSTATE = YY_START;
754
+ switch ($avoiding_name_collisions) {
755
+ case 0:
756
+ return 62;
757
+ break;
758
+ case 1:
759
+ return 63;
760
+ break;
761
+ case 2:
762
+ return 64;
763
+ break;
764
+ case 3:
765
+ return 65;
766
+ break;
767
+ case 4:
768
+ break;
769
+ case 5:
770
+ break;
771
+ case 6:
772
+ this.begin("acc_title");
773
+ return 33;
774
+ break;
775
+ case 7:
776
+ this.popState();
777
+ return "acc_title_value";
778
+ break;
779
+ case 8:
780
+ this.begin("acc_descr");
781
+ return 35;
782
+ break;
783
+ case 9:
784
+ this.popState();
785
+ return "acc_descr_value";
786
+ break;
787
+ case 10:
788
+ this.begin("acc_descr_multiline");
789
+ break;
790
+ case 11:
791
+ this.popState();
792
+ break;
793
+ case 12:
794
+ return "acc_descr_multiline_value";
795
+ break;
796
+ case 13:
797
+ return 8;
798
+ break;
799
+ case 14:
800
+ break;
801
+ case 15:
802
+ return 7;
803
+ break;
804
+ case 16:
805
+ return 7;
806
+ break;
807
+ case 17:
808
+ return "EDGE_STATE";
809
+ break;
810
+ case 18:
811
+ this.begin("callback_name");
812
+ break;
813
+ case 19:
814
+ this.popState();
815
+ break;
816
+ case 20:
817
+ this.popState();
818
+ this.begin("callback_args");
819
+ break;
820
+ case 21:
821
+ return 79;
822
+ break;
823
+ case 22:
824
+ this.popState();
825
+ break;
826
+ case 23:
827
+ return 80;
828
+ break;
829
+ case 24:
830
+ this.popState();
831
+ break;
832
+ case 25:
833
+ return "STR";
834
+ break;
835
+ case 26:
836
+ this.begin("string");
837
+ break;
838
+ case 27:
839
+ return 82;
840
+ break;
841
+ case 28:
842
+ return 57;
843
+ break;
844
+ case 29:
845
+ this.begin("namespace");
846
+ return 42;
847
+ break;
848
+ case 30:
849
+ this.popState();
850
+ return 8;
851
+ break;
852
+ case 31:
853
+ break;
854
+ case 32:
855
+ this.begin("namespace-body");
856
+ return 39;
857
+ break;
858
+ case 33:
859
+ this.popState();
860
+ this.less(0);
861
+ break;
862
+ case 34:
863
+ this.popState();
864
+ return 41;
865
+ break;
866
+ case 35:
867
+ return "EOF_IN_STRUCT";
868
+ break;
869
+ case 36:
870
+ return 8;
871
+ break;
872
+ case 37:
873
+ break;
874
+ case 38:
875
+ return "EDGE_STATE";
876
+ break;
877
+ case 39:
878
+ this.begin("class");
879
+ return 48;
880
+ break;
881
+ case 40:
882
+ this.popState();
883
+ return 8;
884
+ break;
885
+ case 41:
886
+ break;
887
+ case 42:
888
+ this.popState();
889
+ this.popState();
890
+ return 41;
891
+ break;
892
+ case 43:
893
+ this.begin("class-body");
894
+ return 39;
895
+ break;
896
+ case 44:
897
+ this.popState();
898
+ return 41;
899
+ break;
900
+ case 45:
901
+ return "EOF_IN_STRUCT";
902
+ break;
903
+ case 46:
904
+ return "EDGE_STATE";
905
+ break;
906
+ case 47:
907
+ return "OPEN_IN_STRUCT";
908
+ break;
909
+ case 48:
910
+ break;
911
+ case 49:
912
+ return "MEMBER";
913
+ break;
914
+ case 50:
915
+ return 83;
916
+ break;
917
+ case 51:
918
+ return 75;
919
+ break;
920
+ case 52:
921
+ return 76;
922
+ break;
923
+ case 53:
924
+ return 78;
925
+ break;
926
+ case 54:
927
+ return 54;
928
+ break;
929
+ case 55:
930
+ return 56;
931
+ break;
932
+ case 56:
933
+ return 46;
934
+ break;
935
+ case 57:
936
+ return 47;
937
+ break;
938
+ case 58:
939
+ return 81;
940
+ break;
941
+ case 59:
942
+ this.popState();
943
+ break;
944
+ case 60:
945
+ return "GENERICTYPE";
946
+ break;
947
+ case 61:
948
+ this.begin("generic");
949
+ break;
950
+ case 62:
951
+ this.popState();
952
+ break;
953
+ case 63:
954
+ return "BQUOTE_STR";
955
+ break;
956
+ case 64:
957
+ this.begin("bqstring");
958
+ break;
959
+ case 65:
960
+ return 77;
961
+ break;
962
+ case 66:
963
+ return 77;
964
+ break;
965
+ case 67:
966
+ return 77;
967
+ break;
968
+ case 68:
969
+ return 77;
970
+ break;
971
+ case 69:
972
+ return 69;
973
+ break;
974
+ case 70:
975
+ return 69;
976
+ break;
977
+ case 71:
978
+ return 71;
979
+ break;
980
+ case 72:
981
+ return 71;
982
+ break;
983
+ case 73:
984
+ return 70;
985
+ break;
986
+ case 74:
987
+ return 68;
988
+ break;
989
+ case 75:
990
+ return 72;
991
+ break;
992
+ case 76:
993
+ return 73;
994
+ break;
995
+ case 77:
996
+ return 74;
997
+ break;
998
+ case 78:
999
+ return 22;
1000
+ break;
1001
+ case 79:
1002
+ return 44;
1003
+ break;
1004
+ case 80:
1005
+ return 100;
1006
+ break;
1007
+ case 81:
1008
+ return 18;
1009
+ break;
1010
+ case 82:
1011
+ return "PLUS";
1012
+ break;
1013
+ case 83:
1014
+ return 87;
1015
+ break;
1016
+ case 84:
1017
+ return 61;
1018
+ break;
1019
+ case 85:
1020
+ return 89;
1021
+ break;
1022
+ case 86:
1023
+ return 89;
1024
+ break;
1025
+ case 87:
1026
+ return 90;
1027
+ break;
1028
+ case 88:
1029
+ return "EQUALS";
1030
+ break;
1031
+ case 89:
1032
+ return "EQUALS";
1033
+ break;
1034
+ case 90:
1035
+ return 60;
1036
+ break;
1037
+ case 91:
1038
+ return 12;
1039
+ break;
1040
+ case 92:
1041
+ return 14;
1042
+ break;
1043
+ case 93:
1044
+ return "PUNCTUATION";
1045
+ break;
1046
+ case 94:
1047
+ return 86;
1048
+ break;
1049
+ case 95:
1050
+ return 102;
1051
+ break;
1052
+ case 96:
1053
+ return 50;
1054
+ break;
1055
+ case 97:
1056
+ return 50;
1057
+ break;
1058
+ case 98:
1059
+ return 9;
1060
+ break;
1061
+ }
1062
+ }, "anonymous"),
1063
+ rules: [/^(?:.*direction\s+TB[^\n]*)/, /^(?:.*direction\s+BT[^\n]*)/, /^(?:.*direction\s+RL[^\n]*)/, /^(?:.*direction\s+LR[^\n]*)/, /^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/, /^(?:%%[^\n]*(\r?\n)*)/, /^(?:accTitle\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*\{\s*)/, /^(?:[\}])/, /^(?:[^\}]*)/, /^(?:\s*(\r?\n)+)/, /^(?:\s+)/, /^(?:classDiagram-v2\b)/, /^(?:classDiagram\b)/, /^(?:\[\*\])/, /^(?:call[\s]+)/, /^(?:\([\s]*\))/, /^(?:\()/, /^(?:[^(]*)/, /^(?:\))/, /^(?:[^)]*)/, /^(?:["])/, /^(?:[^"]*)/, /^(?:["])/, /^(?:style\b)/, /^(?:classDef\b)/, /^(?:namespace\b)/, /^(?:\s*(\r?\n)+)/, /^(?:\s+)/, /^(?:[{])/, /^(?:[}])/, /^(?:[}])/, /^(?:$)/, /^(?:\s*(\r?\n)+)/, /^(?:\s+)/, /^(?:\[\*\])/, /^(?:class\b)/, /^(?:\s*(\r?\n)+)/, /^(?:\s+)/, /^(?:[}])/, /^(?:[{])/, /^(?:[}])/, /^(?:$)/, /^(?:\[\*\])/, /^(?:[{])/, /^(?:[\n])/, /^(?:[^{}\n]*)/, /^(?:cssClass\b)/, /^(?:callback\b)/, /^(?:link\b)/, /^(?:click\b)/, /^(?:note for\b)/, /^(?:note\b)/, /^(?:<<)/, /^(?:>>)/, /^(?:href\b)/, /^(?:[~])/, /^(?:[^~]*)/, /^(?:~)/, /^(?:[`])/, /^(?:[^`]+)/, /^(?:[`])/, /^(?:_self\b)/, /^(?:_blank\b)/, /^(?:_parent\b)/, /^(?:_top\b)/, /^(?:\s*<\|)/, /^(?:\s*\|>)/, /^(?:\s*>)/, /^(?:\s*<)/, /^(?:\s*\*)/, /^(?:\s*o\b)/, /^(?:\s*\(\))/, /^(?:--)/, /^(?:\.\.)/, /^(?::{1}[^:\n;]+)/, /^(?::{3})/, /^(?:-)/, /^(?:\.)/, /^(?:\+)/, /^(?::)/, /^(?:,)/, /^(?:#)/, /^(?:#)/, /^(?:%)/, /^(?:=)/, /^(?:=)/, /^(?:\w+)/, /^(?:\[)/, /^(?:\])/, /^(?:[!"#$%&'*+,-.`?\\/])/, /^(?:[0-9]+)/, /^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/, /^(?:\s)/, /^(?:\s)/, /^(?:$)/],
1064
+ conditions: { "namespace-body": { rules: [26, 29, 34, 35, 36, 37, 38, 39, 50, 51, 52, 53, 54, 55, 56, 57, 58, 61, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 98], inclusive: false }, namespace: { rules: [26, 29, 30, 31, 32, 33, 50, 51, 52, 53, 54, 55, 56, 57, 58, 61, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 98], inclusive: false }, "class-body": { rules: [26, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 61, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 98], inclusive: false }, class: { rules: [26, 40, 41, 42, 43, 50, 51, 52, 53, 54, 55, 56, 57, 58, 61, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 98], inclusive: false }, acc_descr_multiline: { rules: [11, 12, 26, 50, 51, 52, 53, 54, 55, 56, 57, 58, 61, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 98], inclusive: false }, acc_descr: { rules: [9, 26, 50, 51, 52, 53, 54, 55, 56, 57, 58, 61, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 98], inclusive: false }, acc_title: { rules: [7, 26, 50, 51, 52, 53, 54, 55, 56, 57, 58, 61, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 98], inclusive: false }, callback_args: { rules: [22, 23, 26, 50, 51, 52, 53, 54, 55, 56, 57, 58, 61, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 98], inclusive: false }, callback_name: { rules: [19, 20, 21, 26, 50, 51, 52, 53, 54, 55, 56, 57, 58, 61, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 98], inclusive: false }, href: { rules: [26, 50, 51, 52, 53, 54, 55, 56, 57, 58, 61, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 98], inclusive: false }, struct: { rules: [26, 50, 51, 52, 53, 54, 55, 56, 57, 58, 61, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 98], inclusive: false }, generic: { rules: [26, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 98], inclusive: false }, bqstring: { rules: [26, 50, 51, 52, 53, 54, 55, 56, 57, 58, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 98], inclusive: false }, string: { rules: [24, 25, 26, 50, 51, 52, 53, 54, 55, 56, 57, 58, 61, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 98], inclusive: false }, INITIAL: { rules: [0, 1, 2, 3, 4, 5, 6, 8, 10, 13, 14, 15, 16, 17, 18, 26, 27, 28, 29, 39, 50, 51, 52, 53, 54, 55, 56, 57, 58, 61, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98], inclusive: true } }
1065
+ };
1066
+ return lexer2;
1067
+ }();
1068
+ parser2.lexer = lexer;
1069
+ function Parser() {
1070
+ this.yy = {};
1071
+ }
1072
+ __name(Parser, "Parser");
1073
+ Parser.prototype = parser2;
1074
+ parser2.Parser = Parser;
1075
+ return new Parser;
1076
+ }();
1077
+ parser.parser = parser;
1078
+ var classDiagram_default = parser;
1079
+ var visibilityValues = ["#", "+", "~", "-", ""];
1080
+ var ClassMember = class {
1081
+ static {
1082
+ __name(this, "ClassMember");
1083
+ }
1084
+ constructor(input, memberType) {
1085
+ this.memberType = memberType;
1086
+ this.visibility = "";
1087
+ this.classifier = "";
1088
+ this.text = "";
1089
+ const sanitizedInput = sanitizeText(input, getConfig2());
1090
+ this.parseMember(sanitizedInput);
1091
+ }
1092
+ getDisplayDetails() {
1093
+ let displayText = this.visibility + parseGenericTypes(this.id);
1094
+ if (this.memberType === "method") {
1095
+ displayText += `(${parseGenericTypes(this.parameters.trim())})`;
1096
+ if (this.returnType) {
1097
+ displayText += " : " + parseGenericTypes(this.returnType);
1098
+ }
1099
+ }
1100
+ displayText = displayText.trim();
1101
+ const cssStyle = this.parseClassifier();
1102
+ return {
1103
+ displayText,
1104
+ cssStyle
1105
+ };
1106
+ }
1107
+ parseMember(input) {
1108
+ let potentialClassifier = "";
1109
+ if (this.memberType === "method") {
1110
+ const methodRegEx = /([#+~-])?(.+)\((.*)\)([\s$*])?(.*)([$*])?/;
1111
+ const match = methodRegEx.exec(input);
1112
+ if (match) {
1113
+ const detectedVisibility = match[1] ? match[1].trim() : "";
1114
+ if (visibilityValues.includes(detectedVisibility)) {
1115
+ this.visibility = detectedVisibility;
1116
+ }
1117
+ this.id = match[2];
1118
+ this.parameters = match[3] ? match[3].trim() : "";
1119
+ potentialClassifier = match[4] ? match[4].trim() : "";
1120
+ this.returnType = match[5] ? match[5].trim() : "";
1121
+ if (potentialClassifier === "") {
1122
+ const lastChar = this.returnType.substring(this.returnType.length - 1);
1123
+ if (/[$*]/.exec(lastChar)) {
1124
+ potentialClassifier = lastChar;
1125
+ this.returnType = this.returnType.substring(0, this.returnType.length - 1);
1126
+ }
1127
+ }
1128
+ }
1129
+ } else {
1130
+ const length = input.length;
1131
+ const firstChar = input.substring(0, 1);
1132
+ const lastChar = input.substring(length - 1);
1133
+ if (visibilityValues.includes(firstChar)) {
1134
+ this.visibility = firstChar;
1135
+ }
1136
+ if (/[$*]/.exec(lastChar)) {
1137
+ potentialClassifier = lastChar;
1138
+ }
1139
+ this.id = input.substring(this.visibility === "" ? 0 : 1, potentialClassifier === "" ? length : length - 1);
1140
+ }
1141
+ this.classifier = potentialClassifier;
1142
+ this.id = this.id.startsWith(" ") ? " " + this.id.trim() : this.id.trim();
1143
+ const combinedText = `${this.visibility ? "\\" + this.visibility : ""}${parseGenericTypes(this.id)}${this.memberType === "method" ? `(${parseGenericTypes(this.parameters)})${this.returnType ? " : " + parseGenericTypes(this.returnType) : ""}` : ""}`;
1144
+ this.text = combinedText.replaceAll("<", "&lt;").replaceAll(">", "&gt;");
1145
+ if (this.text.startsWith("\\&lt;")) {
1146
+ this.text = this.text.replace("\\&lt;", "~");
1147
+ }
1148
+ }
1149
+ parseClassifier() {
1150
+ switch (this.classifier) {
1151
+ case "*":
1152
+ return "font-style:italic;";
1153
+ case "$":
1154
+ return "text-decoration:underline;";
1155
+ default:
1156
+ return "";
1157
+ }
1158
+ }
1159
+ };
1160
+ var MERMAID_DOM_ID_PREFIX = "classId-";
1161
+ var classCounter = 0;
1162
+ var sanitizeText2 = /* @__PURE__ */ __name((txt) => common_default.sanitizeText(txt, getConfig2()), "sanitizeText");
1163
+ var ClassDB = class _ClassDB {
1164
+ constructor() {
1165
+ this.relations = [];
1166
+ this.classes = /* @__PURE__ */ new Map;
1167
+ this.styleClasses = /* @__PURE__ */ new Map;
1168
+ this.notes = /* @__PURE__ */ new Map;
1169
+ this.interfaces = [];
1170
+ this.namespaces = /* @__PURE__ */ new Map;
1171
+ this.namespaceCounter = 0;
1172
+ this.namespaceStack = [];
1173
+ this.diagramId = "";
1174
+ this.functions = [];
1175
+ this.lineType = {
1176
+ LINE: 0,
1177
+ DOTTED_LINE: 1
1178
+ };
1179
+ this.relationType = {
1180
+ AGGREGATION: 0,
1181
+ EXTENSION: 1,
1182
+ COMPOSITION: 2,
1183
+ DEPENDENCY: 3,
1184
+ LOLLIPOP: 4
1185
+ };
1186
+ this.setupToolTips = /* @__PURE__ */ __name((element) => {
1187
+ const tooltipElem = createTooltip();
1188
+ const svg = select_default(element).select("svg");
1189
+ const nodes = svg.selectAll("g").filter(function() {
1190
+ return select_default(this).attr("title") !== null;
1191
+ });
1192
+ nodes.on("mouseover", (event) => {
1193
+ const el = select_default(event.currentTarget);
1194
+ const title = el.attr("title");
1195
+ if (!title) {
1196
+ return;
1197
+ }
1198
+ const rect = event.currentTarget.getBoundingClientRect();
1199
+ tooltipElem.transition().duration(200).style("opacity", ".9");
1200
+ tooltipElem.html(dompurify_shim_default.sanitize(title)).style("left", `${window.scrollX + rect.left + rect.width / 2}px`).style("top", `${window.scrollY + rect.bottom + 4}px`);
1201
+ el.classed("hover", true);
1202
+ }).on("mouseout", (event) => {
1203
+ tooltipElem.transition().duration(500).style("opacity", 0);
1204
+ select_default(event.currentTarget).classed("hover", false);
1205
+ });
1206
+ }, "setupToolTips");
1207
+ this.direction = "TB";
1208
+ this.setAccTitle = setAccTitle;
1209
+ this.getAccTitle = getAccTitle;
1210
+ this.setAccDescription = setAccDescription;
1211
+ this.getAccDescription = getAccDescription;
1212
+ this.setDiagramTitle = setDiagramTitle;
1213
+ this.getDiagramTitle = getDiagramTitle;
1214
+ this.getConfig = /* @__PURE__ */ __name(() => getConfig2().class, "getConfig");
1215
+ this.functions.push(this.setupToolTips.bind(this));
1216
+ this.clear();
1217
+ this.addRelation = this.addRelation.bind(this);
1218
+ this.addClassesToNamespace = this.addClassesToNamespace.bind(this);
1219
+ this.addNamespace = this.addNamespace.bind(this);
1220
+ this.popNamespace = this.popNamespace.bind(this);
1221
+ this.setCssClass = this.setCssClass.bind(this);
1222
+ this.addMembers = this.addMembers.bind(this);
1223
+ this.addClass = this.addClass.bind(this);
1224
+ this.setClassLabel = this.setClassLabel.bind(this);
1225
+ this.addAnnotation = this.addAnnotation.bind(this);
1226
+ this.addMember = this.addMember.bind(this);
1227
+ this.cleanupLabel = this.cleanupLabel.bind(this);
1228
+ this.addNote = this.addNote.bind(this);
1229
+ this.defineClass = this.defineClass.bind(this);
1230
+ this.setDirection = this.setDirection.bind(this);
1231
+ this.setLink = this.setLink.bind(this);
1232
+ this.bindFunctions = this.bindFunctions.bind(this);
1233
+ this.clear = this.clear.bind(this);
1234
+ this.setTooltip = this.setTooltip.bind(this);
1235
+ this.setClickEvent = this.setClickEvent.bind(this);
1236
+ this.setCssStyle = this.setCssStyle.bind(this);
1237
+ }
1238
+ static {
1239
+ __name(this, "ClassDB");
1240
+ }
1241
+ splitClassNameAndType(_id) {
1242
+ const id = common_default.sanitizeText(_id, getConfig2());
1243
+ let genericType = "";
1244
+ let className = id;
1245
+ if (id.indexOf("~") > 0) {
1246
+ const split = id.split("~");
1247
+ className = sanitizeText2(split[0]);
1248
+ genericType = sanitizeText2(split[1]);
1249
+ }
1250
+ return { className, type: genericType };
1251
+ }
1252
+ setClassLabel(_id, label) {
1253
+ const id = common_default.sanitizeText(_id, getConfig2());
1254
+ if (label) {
1255
+ label = sanitizeText2(label);
1256
+ }
1257
+ const { className } = this.splitClassNameAndType(id);
1258
+ this.classes.get(className).label = label;
1259
+ this.classes.get(className).text = `${label}${this.classes.get(className).type ? `<${this.classes.get(className).type}>` : ""}`;
1260
+ }
1261
+ addClass(_id) {
1262
+ const id = common_default.sanitizeText(_id, getConfig2());
1263
+ const { className, type } = this.splitClassNameAndType(id);
1264
+ if (this.classes.has(className)) {
1265
+ return;
1266
+ }
1267
+ const name = common_default.sanitizeText(className, getConfig2());
1268
+ this.classes.set(name, {
1269
+ id: name,
1270
+ type,
1271
+ label: name,
1272
+ text: `${name}${type ? `&lt;${type}&gt;` : ""}`,
1273
+ shape: "classBox",
1274
+ cssClasses: "default",
1275
+ methods: [],
1276
+ members: [],
1277
+ annotations: [],
1278
+ styles: [],
1279
+ domId: MERMAID_DOM_ID_PREFIX + name + "-" + classCounter
1280
+ });
1281
+ classCounter++;
1282
+ }
1283
+ addInterface(label, classId) {
1284
+ const classInterface = {
1285
+ id: `interface${this.interfaces.length}`,
1286
+ label,
1287
+ classId
1288
+ };
1289
+ this.interfaces.push(classInterface);
1290
+ }
1291
+ setDiagramId(svgElementId) {
1292
+ this.diagramId = svgElementId;
1293
+ }
1294
+ lookUpDomId(_id) {
1295
+ const id = common_default.sanitizeText(_id, getConfig2());
1296
+ if (this.classes.has(id)) {
1297
+ const domId = this.classes.get(id).domId;
1298
+ return this.diagramId ? `${this.diagramId}-${domId}` : domId;
1299
+ }
1300
+ throw new Error("Class not found: " + id);
1301
+ }
1302
+ clear() {
1303
+ this.relations = [];
1304
+ this.classes = /* @__PURE__ */ new Map;
1305
+ this.notes = /* @__PURE__ */ new Map;
1306
+ this.interfaces = [];
1307
+ this.functions = [];
1308
+ this.functions.push(this.setupToolTips.bind(this));
1309
+ this.namespaces = /* @__PURE__ */ new Map;
1310
+ this.namespaceCounter = 0;
1311
+ this.namespaceStack = [];
1312
+ this.diagramId = "";
1313
+ this.direction = "TB";
1314
+ clear();
1315
+ }
1316
+ getClass(id) {
1317
+ return this.classes.get(id);
1318
+ }
1319
+ getClasses() {
1320
+ return this.classes;
1321
+ }
1322
+ getRelations() {
1323
+ return this.relations;
1324
+ }
1325
+ getNote(id) {
1326
+ const key = typeof id === "number" ? `note${id}` : id;
1327
+ return this.notes.get(key);
1328
+ }
1329
+ getNotes() {
1330
+ return this.notes;
1331
+ }
1332
+ addRelation(classRelation) {
1333
+ log.debug("Adding relation: " + JSON.stringify(classRelation));
1334
+ const invalidTypes = [
1335
+ this.relationType.LOLLIPOP,
1336
+ this.relationType.AGGREGATION,
1337
+ this.relationType.COMPOSITION,
1338
+ this.relationType.DEPENDENCY,
1339
+ this.relationType.EXTENSION
1340
+ ];
1341
+ if (classRelation.relation.type1 === this.relationType.LOLLIPOP && !invalidTypes.includes(classRelation.relation.type2)) {
1342
+ this.addClass(classRelation.id2);
1343
+ this.addInterface(classRelation.id1, classRelation.id2);
1344
+ classRelation.id1 = `interface${this.interfaces.length - 1}`;
1345
+ } else if (classRelation.relation.type2 === this.relationType.LOLLIPOP && !invalidTypes.includes(classRelation.relation.type1)) {
1346
+ this.addClass(classRelation.id1);
1347
+ this.addInterface(classRelation.id2, classRelation.id1);
1348
+ classRelation.id2 = `interface${this.interfaces.length - 1}`;
1349
+ } else {
1350
+ this.addClass(classRelation.id1);
1351
+ this.addClass(classRelation.id2);
1352
+ }
1353
+ classRelation.id1 = this.splitClassNameAndType(classRelation.id1).className;
1354
+ classRelation.id2 = this.splitClassNameAndType(classRelation.id2).className;
1355
+ classRelation.relationTitle1 = common_default.sanitizeText(classRelation.relationTitle1.trim(), getConfig2());
1356
+ classRelation.relationTitle2 = common_default.sanitizeText(classRelation.relationTitle2.trim(), getConfig2());
1357
+ this.relations.push(classRelation);
1358
+ }
1359
+ addAnnotation(className, annotation) {
1360
+ const validatedClassName = this.splitClassNameAndType(className).className;
1361
+ this.classes.get(validatedClassName).annotations.push(annotation);
1362
+ }
1363
+ addMember(className, member) {
1364
+ this.addClass(className);
1365
+ const validatedClassName = this.splitClassNameAndType(className).className;
1366
+ const theClass = this.classes.get(validatedClassName);
1367
+ if (typeof member === "string") {
1368
+ const memberString = member.trim();
1369
+ if (memberString.startsWith("<<") && memberString.endsWith(">>")) {
1370
+ theClass.annotations.push(sanitizeText2(memberString.substring(2, memberString.length - 2)));
1371
+ } else if (memberString.indexOf(")") > 0) {
1372
+ theClass.methods.push(new ClassMember(memberString, "method"));
1373
+ } else if (memberString) {
1374
+ theClass.members.push(new ClassMember(memberString, "attribute"));
1375
+ }
1376
+ }
1377
+ }
1378
+ addMembers(className, members) {
1379
+ if (Array.isArray(members)) {
1380
+ members.reverse();
1381
+ members.forEach((member) => this.addMember(className, member));
1382
+ }
1383
+ }
1384
+ addNote(text, className) {
1385
+ const index = this.notes.size;
1386
+ const note = {
1387
+ id: `note${index}`,
1388
+ class: className,
1389
+ text,
1390
+ index
1391
+ };
1392
+ this.notes.set(note.id, note);
1393
+ return note.id;
1394
+ }
1395
+ cleanupLabel(label) {
1396
+ if (label.startsWith(":")) {
1397
+ label = label.substring(1);
1398
+ }
1399
+ return sanitizeText2(label.trim());
1400
+ }
1401
+ setCssClass(ids, className) {
1402
+ ids.split(",").forEach((_id) => {
1403
+ let id = _id;
1404
+ if (/\d/.exec(_id[0])) {
1405
+ id = MERMAID_DOM_ID_PREFIX + id;
1406
+ }
1407
+ id = this.splitClassNameAndType(id).className;
1408
+ const classNode = this.classes.get(id);
1409
+ if (classNode) {
1410
+ classNode.cssClasses += " " + className;
1411
+ }
1412
+ });
1413
+ }
1414
+ defineClass(ids, style) {
1415
+ for (const id of ids) {
1416
+ let styleClass = this.styleClasses.get(id);
1417
+ if (styleClass === undefined) {
1418
+ styleClass = { id, styles: [], textStyles: [] };
1419
+ this.styleClasses.set(id, styleClass);
1420
+ }
1421
+ if (style) {
1422
+ style.forEach((s) => {
1423
+ if (/color/.exec(s)) {
1424
+ const newStyle = s.replace("fill", "bgFill");
1425
+ styleClass.textStyles.push(newStyle);
1426
+ }
1427
+ styleClass.styles.push(s);
1428
+ });
1429
+ }
1430
+ this.classes.forEach((value) => {
1431
+ if (value.cssClasses.includes(id)) {
1432
+ value.styles.push(...style.flatMap((s) => s.split(",")));
1433
+ }
1434
+ });
1435
+ }
1436
+ }
1437
+ setTooltip(ids, tooltip) {
1438
+ ids.split(",").forEach((id) => {
1439
+ if (tooltip !== undefined) {
1440
+ const className = this.splitClassNameAndType(id).className;
1441
+ const classNode = this.classes.get(className);
1442
+ if (classNode) {
1443
+ classNode.tooltip = sanitizeText2(tooltip);
1444
+ }
1445
+ }
1446
+ });
1447
+ }
1448
+ getTooltip(id, namespace) {
1449
+ if (namespace && this.namespaces.has(namespace)) {
1450
+ return this.namespaces.get(namespace).classes.get(id).tooltip;
1451
+ }
1452
+ return this.classes.get(id).tooltip;
1453
+ }
1454
+ setLink(ids, linkStr, target) {
1455
+ const config = getConfig2();
1456
+ ids.split(",").forEach((_id) => {
1457
+ let id = _id;
1458
+ if (/\d/.exec(_id[0])) {
1459
+ id = MERMAID_DOM_ID_PREFIX + id;
1460
+ }
1461
+ id = this.splitClassNameAndType(id).className;
1462
+ const theClass = this.classes.get(id);
1463
+ if (theClass) {
1464
+ theClass.link = utils_default.formatUrl(linkStr, config);
1465
+ if (config.securityLevel === "sandbox") {
1466
+ theClass.linkTarget = "_top";
1467
+ } else if (typeof target === "string") {
1468
+ theClass.linkTarget = sanitizeText2(target);
1469
+ } else {
1470
+ theClass.linkTarget = "_blank";
1471
+ }
1472
+ }
1473
+ });
1474
+ this.setCssClass(ids, "clickable");
1475
+ }
1476
+ setClickEvent(ids, functionName, functionArgs) {
1477
+ ids.split(",").forEach((id) => {
1478
+ this.setClickFunc(id, functionName, functionArgs);
1479
+ const className = this.splitClassNameAndType(id).className;
1480
+ const classNode = this.classes.get(className);
1481
+ if (classNode) {
1482
+ classNode.haveCallback = true;
1483
+ }
1484
+ });
1485
+ this.setCssClass(ids, "clickable");
1486
+ }
1487
+ setClickFunc(_domId, functionName, functionArgs) {
1488
+ const domId = common_default.sanitizeText(_domId, getConfig2());
1489
+ const config = getConfig2();
1490
+ if (config.securityLevel !== "loose") {
1491
+ return;
1492
+ }
1493
+ if (functionName === undefined) {
1494
+ return;
1495
+ }
1496
+ const id = this.splitClassNameAndType(domId).className;
1497
+ if (this.classes.has(id)) {
1498
+ let argList = [];
1499
+ if (typeof functionArgs === "string") {
1500
+ argList = functionArgs.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);
1501
+ for (let i = 0;i < argList.length; i++) {
1502
+ let item = argList[i].trim();
1503
+ if (item.startsWith('"') && item.endsWith('"')) {
1504
+ item = item.substr(1, item.length - 2);
1505
+ }
1506
+ argList[i] = item;
1507
+ }
1508
+ }
1509
+ if (argList.length === 0) {
1510
+ argList.push(id);
1511
+ }
1512
+ this.functions.push(() => {
1513
+ const elemId = this.lookUpDomId(id);
1514
+ const elem = document.querySelector(`[id="${elemId}"]`);
1515
+ if (elem !== null) {
1516
+ elem.addEventListener("click", () => {
1517
+ utils_default.runFunc(functionName, ...argList);
1518
+ }, false);
1519
+ }
1520
+ });
1521
+ }
1522
+ }
1523
+ bindFunctions(element) {
1524
+ this.functions.forEach((fun) => {
1525
+ fun(element);
1526
+ });
1527
+ }
1528
+ escapeHtml(str) {
1529
+ return str.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
1530
+ }
1531
+ getDirection() {
1532
+ return this.direction;
1533
+ }
1534
+ setDirection(dir) {
1535
+ this.direction = dir;
1536
+ }
1537
+ static resolveQualifiedId(id, stack) {
1538
+ const prefix = stack.at(-1);
1539
+ return prefix ? `${prefix}.${id}` : id;
1540
+ }
1541
+ static getAncestorIds(qualifiedId) {
1542
+ const parts = qualifiedId.split(".");
1543
+ const ids = new Array(parts.length);
1544
+ ids[0] = parts[0];
1545
+ for (let i = 1;i < parts.length; i++) {
1546
+ ids[i] = `${ids[i - 1]}.${parts[i]}`;
1547
+ }
1548
+ return ids;
1549
+ }
1550
+ createNamespaceNode(id, label, parentId, explicit = false) {
1551
+ return {
1552
+ id,
1553
+ label,
1554
+ classes: /* @__PURE__ */ new Map,
1555
+ notes: /* @__PURE__ */ new Map,
1556
+ children: /* @__PURE__ */ new Map,
1557
+ domId: MERMAID_DOM_ID_PREFIX + id + "-" + this.namespaceCounter++,
1558
+ parent: parentId,
1559
+ explicit
1560
+ };
1561
+ }
1562
+ linkParentChild(parentId, childId) {
1563
+ const parent = this.namespaces.get(parentId);
1564
+ const child = this.namespaces.get(childId);
1565
+ if (!parent || !child) {
1566
+ return;
1567
+ }
1568
+ if (!parent.children.has(childId)) {
1569
+ parent.children.set(childId, child);
1570
+ }
1571
+ child.parent ??= parentId;
1572
+ }
1573
+ addNamespace(id, label) {
1574
+ const qualifiedId = _ClassDB.resolveQualifiedId(id, this.namespaceStack);
1575
+ this.namespaceStack.push(qualifiedId);
1576
+ if (this.namespaces.has(qualifiedId)) {
1577
+ const existing = this.namespaces.get(qualifiedId);
1578
+ existing.explicit = true;
1579
+ if (label) {
1580
+ existing.label = label;
1581
+ }
1582
+ return qualifiedId;
1583
+ }
1584
+ const parts = qualifiedId.split(".");
1585
+ const ancestorIds = _ClassDB.getAncestorIds(qualifiedId);
1586
+ for (let i = 0;i < ancestorIds.length; i++) {
1587
+ const currentId = ancestorIds[i];
1588
+ const parentId = i > 0 ? ancestorIds[i - 1] : undefined;
1589
+ const isLeaf = i === ancestorIds.length - 1;
1590
+ const nodeLabel = isLeaf && label ? label : parts[i];
1591
+ if (!this.namespaces.has(currentId)) {
1592
+ this.namespaces.set(currentId, this.createNamespaceNode(currentId, nodeLabel, parentId, isLeaf));
1593
+ } else if (isLeaf) {
1594
+ this.namespaces.get(currentId).explicit = true;
1595
+ }
1596
+ if (parentId) {
1597
+ this.linkParentChild(parentId, currentId);
1598
+ }
1599
+ }
1600
+ return qualifiedId;
1601
+ }
1602
+ popNamespace() {
1603
+ this.namespaceStack.pop();
1604
+ }
1605
+ getNamespace(name) {
1606
+ return this.namespaces.get(name);
1607
+ }
1608
+ getNamespaces() {
1609
+ return this.namespaces;
1610
+ }
1611
+ addClassesToNamespace(id, classNames, noteNames) {
1612
+ if (!this.namespaces.has(id)) {
1613
+ return;
1614
+ }
1615
+ for (const name of classNames) {
1616
+ const { className } = this.splitClassNameAndType(name);
1617
+ const classNode = this.getClass(className);
1618
+ classNode.parent = id;
1619
+ this.namespaces.get(id).classes.set(className, classNode);
1620
+ }
1621
+ for (const noteName of noteNames) {
1622
+ const noteNode = this.getNote(noteName);
1623
+ noteNode.parent = id;
1624
+ this.namespaces.get(id).notes.set(noteName, noteNode);
1625
+ }
1626
+ }
1627
+ setCssStyle(id, styles) {
1628
+ const thisClass = this.classes.get(id);
1629
+ if (!styles || !thisClass) {
1630
+ return;
1631
+ }
1632
+ for (const s of styles) {
1633
+ if (s.includes(",")) {
1634
+ thisClass.styles.push(...s.split(","));
1635
+ } else {
1636
+ thisClass.styles.push(s);
1637
+ }
1638
+ }
1639
+ }
1640
+ getArrowMarker(type) {
1641
+ let marker;
1642
+ switch (type) {
1643
+ case 0:
1644
+ marker = "aggregation";
1645
+ break;
1646
+ case 1:
1647
+ marker = "extension";
1648
+ break;
1649
+ case 2:
1650
+ marker = "composition";
1651
+ break;
1652
+ case 3:
1653
+ marker = "dependency";
1654
+ break;
1655
+ case 4:
1656
+ marker = "lollipop";
1657
+ break;
1658
+ default:
1659
+ marker = "none";
1660
+ }
1661
+ return marker;
1662
+ }
1663
+ resolveExplicitAncestor(id) {
1664
+ let current = id;
1665
+ while (current) {
1666
+ const ns = this.namespaces.get(current);
1667
+ if (!ns) {
1668
+ return;
1669
+ }
1670
+ if (ns.explicit) {
1671
+ return current;
1672
+ }
1673
+ current = ns.parent;
1674
+ }
1675
+ return;
1676
+ }
1677
+ getData() {
1678
+ const nodes = [];
1679
+ const edges = [];
1680
+ const config = getConfig2();
1681
+ const hierarchical = config.class?.hierarchicalNamespaces ?? true;
1682
+ for (const namespace of this.namespaces.values()) {
1683
+ if (!hierarchical && !namespace.explicit) {
1684
+ continue;
1685
+ }
1686
+ const node = {
1687
+ id: namespace.id,
1688
+ label: hierarchical ? namespace.label : namespace.id,
1689
+ isGroup: true,
1690
+ padding: config.class.padding ?? 16,
1691
+ shape: "rect",
1692
+ cssStyles: [],
1693
+ look: config.look,
1694
+ parentId: hierarchical ? namespace.parent : undefined
1695
+ };
1696
+ nodes.push(node);
1697
+ }
1698
+ for (const classNode of this.classes.values()) {
1699
+ const parentId = hierarchical ? classNode.parent : this.resolveExplicitAncestor(classNode.parent);
1700
+ const node = {
1701
+ ...classNode,
1702
+ type: undefined,
1703
+ isGroup: false,
1704
+ parentId,
1705
+ look: config.look
1706
+ };
1707
+ nodes.push(node);
1708
+ }
1709
+ for (const note of this.notes.values()) {
1710
+ const noteParentId = hierarchical ? note.parent : this.resolveExplicitAncestor(note.parent);
1711
+ const noteNode = {
1712
+ id: note.id,
1713
+ label: note.text,
1714
+ isGroup: false,
1715
+ shape: "note",
1716
+ padding: config.class.padding ?? 6,
1717
+ cssStyles: [
1718
+ "text-align: left",
1719
+ "white-space: nowrap",
1720
+ `fill: ${config.themeVariables.noteBkgColor}`,
1721
+ `stroke: ${config.themeVariables.noteBorderColor}`
1722
+ ],
1723
+ look: config.look,
1724
+ parentId: noteParentId,
1725
+ labelType: "markdown"
1726
+ };
1727
+ nodes.push(noteNode);
1728
+ const noteClassId = this.classes.get(note.class)?.id;
1729
+ if (noteClassId) {
1730
+ const edge = {
1731
+ id: `edgeNote${note.index}`,
1732
+ start: note.id,
1733
+ end: noteClassId,
1734
+ type: "normal",
1735
+ thickness: "normal",
1736
+ classes: "relation",
1737
+ arrowTypeStart: "none",
1738
+ arrowTypeEnd: "none",
1739
+ arrowheadStyle: "",
1740
+ labelStyle: [""],
1741
+ style: ["fill: none"],
1742
+ pattern: "dotted",
1743
+ look: config.look
1744
+ };
1745
+ edges.push(edge);
1746
+ }
1747
+ }
1748
+ for (const _interface of this.interfaces) {
1749
+ const interfaceNode = {
1750
+ id: _interface.id,
1751
+ label: _interface.label,
1752
+ isGroup: false,
1753
+ shape: "rect",
1754
+ cssStyles: ["opacity: 0;"],
1755
+ look: config.look
1756
+ };
1757
+ nodes.push(interfaceNode);
1758
+ }
1759
+ let cnt = 0;
1760
+ for (const classRelation of this.relations) {
1761
+ cnt++;
1762
+ const edge = {
1763
+ id: getEdgeId(classRelation.id1, classRelation.id2, {
1764
+ prefix: "id",
1765
+ counter: cnt
1766
+ }),
1767
+ start: classRelation.id1,
1768
+ end: classRelation.id2,
1769
+ type: "normal",
1770
+ label: classRelation.title,
1771
+ labelpos: "c",
1772
+ thickness: "normal",
1773
+ classes: "relation",
1774
+ arrowTypeStart: this.getArrowMarker(classRelation.relation.type1),
1775
+ arrowTypeEnd: this.getArrowMarker(classRelation.relation.type2),
1776
+ startLabelRight: classRelation.relationTitle1 === "none" ? "" : classRelation.relationTitle1,
1777
+ endLabelLeft: classRelation.relationTitle2 === "none" ? "" : classRelation.relationTitle2,
1778
+ arrowheadStyle: "",
1779
+ labelStyle: ["display: inline-block"],
1780
+ style: classRelation.style || "",
1781
+ pattern: classRelation.relation.lineType == 1 ? "dashed" : "solid",
1782
+ look: config.look,
1783
+ labelType: "markdown"
1784
+ };
1785
+ edges.push(edge);
1786
+ }
1787
+ return { nodes, edges, other: {}, config, direction: this.getDirection() };
1788
+ }
1789
+ };
1790
+ var getStyles = /* @__PURE__ */ __name((options) => `g.classGroup text {
1791
+ fill: ${options.nodeBorder || options.classText};
1792
+ stroke: none;
1793
+ font-family: ${options.fontFamily};
1794
+ font-size: 10px;
1795
+
1796
+ .title {
1797
+ font-weight: bolder;
1798
+ }
1799
+
1800
+ }
1801
+
1802
+ .cluster-label text {
1803
+ fill: ${options.titleColor};
1804
+ }
1805
+ .cluster-label span {
1806
+ color: ${options.titleColor};
1807
+ }
1808
+ .cluster-label span p {
1809
+ background-color: transparent;
1810
+ }
1811
+
1812
+ .cluster rect {
1813
+ fill: ${options.clusterBkg};
1814
+ stroke: ${options.clusterBorder};
1815
+ stroke-width: 1px;
1816
+ }
1817
+
1818
+ .cluster text {
1819
+ fill: ${options.titleColor};
1820
+ }
1821
+
1822
+ .cluster span {
1823
+ color: ${options.titleColor};
1824
+ }
1825
+
1826
+ .nodeLabel, .edgeLabel {
1827
+ color: ${options.classText};
1828
+ }
1829
+
1830
+ .noteLabel .nodeLabel, .noteLabel .edgeLabel {
1831
+ color: ${options.noteTextColor};
1832
+ }
1833
+ .edgeLabel .label rect {
1834
+ fill: ${options.mainBkg};
1835
+ }
1836
+ .label text {
1837
+ fill: ${options.classText};
1838
+ }
1839
+
1840
+ .labelBkg {
1841
+ background: ${options.mainBkg};
1842
+ }
1843
+ .edgeLabel .label span {
1844
+ background: ${options.mainBkg};
1845
+ }
1846
+
1847
+ .classTitle {
1848
+ font-weight: bolder;
1849
+ }
1850
+ .node rect,
1851
+ .node circle,
1852
+ .node ellipse,
1853
+ .node polygon,
1854
+ .node path {
1855
+ fill: ${options.mainBkg};
1856
+ stroke: ${options.nodeBorder};
1857
+ stroke-width: ${options.strokeWidth};
1858
+ }
1859
+
1860
+
1861
+ .divider {
1862
+ stroke: ${options.nodeBorder};
1863
+ stroke-width: 1;
1864
+ }
1865
+
1866
+ g.clickable {
1867
+ cursor: pointer;
1868
+ }
1869
+
1870
+ g.classGroup rect {
1871
+ fill: ${options.mainBkg};
1872
+ stroke: ${options.nodeBorder};
1873
+ }
1874
+
1875
+ g.classGroup line {
1876
+ stroke: ${options.nodeBorder};
1877
+ stroke-width: 1;
1878
+ }
1879
+
1880
+ .classLabel .box {
1881
+ stroke: none;
1882
+ stroke-width: 0;
1883
+ fill: ${options.mainBkg};
1884
+ opacity: 0.5;
1885
+ }
1886
+
1887
+ .classLabel .label {
1888
+ fill: ${options.nodeBorder};
1889
+ font-size: 10px;
1890
+ }
1891
+
1892
+ .relation {
1893
+ stroke: ${options.lineColor};
1894
+ stroke-width: ${options.strokeWidth};
1895
+ fill: none;
1896
+ }
1897
+
1898
+ .dashed-line{
1899
+ stroke-dasharray: 3;
1900
+ }
1901
+
1902
+ .dotted-line{
1903
+ stroke-dasharray: 1 2;
1904
+ }
1905
+
1906
+ [id$="-compositionStart"], .composition {
1907
+ fill: ${options.lineColor} !important;
1908
+ stroke: ${options.lineColor} !important;
1909
+ stroke-width: 1;
1910
+ }
1911
+
1912
+ [id$="-compositionEnd"], .composition {
1913
+ fill: ${options.lineColor} !important;
1914
+ stroke: ${options.lineColor} !important;
1915
+ stroke-width: 1;
1916
+ }
1917
+
1918
+ [id$="-dependencyStart"], .dependency {
1919
+ fill: ${options.lineColor} !important;
1920
+ stroke: ${options.lineColor} !important;
1921
+ stroke-width: 1;
1922
+ }
1923
+
1924
+ [id$="-dependencyEnd"], .dependency {
1925
+ fill: ${options.lineColor} !important;
1926
+ stroke: ${options.lineColor} !important;
1927
+ stroke-width: 1;
1928
+ }
1929
+
1930
+ [id$="-extensionStart"], .extension {
1931
+ fill: transparent !important;
1932
+ stroke: ${options.lineColor} !important;
1933
+ stroke-width: 1;
1934
+ }
1935
+
1936
+ [id$="-extensionEnd"], .extension {
1937
+ fill: transparent !important;
1938
+ stroke: ${options.lineColor} !important;
1939
+ stroke-width: 1;
1940
+ }
1941
+
1942
+ [id$="-aggregationStart"], .aggregation {
1943
+ fill: transparent !important;
1944
+ stroke: ${options.lineColor} !important;
1945
+ stroke-width: 1;
1946
+ }
1947
+
1948
+ [id$="-aggregationEnd"], .aggregation {
1949
+ fill: transparent !important;
1950
+ stroke: ${options.lineColor} !important;
1951
+ stroke-width: 1;
1952
+ }
1953
+
1954
+ [id$="-lollipopStart"], .lollipop {
1955
+ fill: ${options.mainBkg} !important;
1956
+ stroke: ${options.lineColor} !important;
1957
+ stroke-width: 1;
1958
+ }
1959
+
1960
+ [id$="-lollipopEnd"], .lollipop {
1961
+ fill: ${options.mainBkg} !important;
1962
+ stroke: ${options.lineColor} !important;
1963
+ stroke-width: 1;
1964
+ }
1965
+
1966
+ .edgeTerminals {
1967
+ font-size: 11px;
1968
+ line-height: initial;
1969
+ }
1970
+
1971
+ .classTitleText {
1972
+ text-anchor: middle;
1973
+ font-size: 18px;
1974
+ fill: ${options.textColor};
1975
+ }
1976
+
1977
+ .edgeLabel[data-look="neo"] {
1978
+ background-color: ${options.edgeLabelBackground};
1979
+ p {
1980
+ background-color: ${options.edgeLabelBackground};
1981
+ }
1982
+ rect {
1983
+ opacity: 0.5;
1984
+ background-color: ${options.edgeLabelBackground};
1985
+ fill: ${options.edgeLabelBackground};
1986
+ }
1987
+ text-align: center;
1988
+ }
1989
+ ${getIconStyles()}
1990
+ `, "getStyles");
1991
+ var styles_default = getStyles;
1992
+ var getDir = /* @__PURE__ */ __name((parsedItem, defaultDir = "TB") => {
1993
+ if (!parsedItem.doc) {
1994
+ return defaultDir;
1995
+ }
1996
+ let dir = defaultDir;
1997
+ for (const parsedItemDoc of parsedItem.doc) {
1998
+ if (parsedItemDoc.stmt === "dir") {
1999
+ dir = parsedItemDoc.value;
2000
+ }
2001
+ }
2002
+ return dir;
2003
+ }, "getDir");
2004
+ var getClasses = /* @__PURE__ */ __name(function(text, diagramObj) {
2005
+ return diagramObj.db.getClasses();
2006
+ }, "getClasses");
2007
+ var draw = /* @__PURE__ */ __name(async function(text, id, _version, diag) {
2008
+ log.info("REF0:");
2009
+ log.info("Drawing class diagram (v3)", id);
2010
+ const { securityLevel, state: conf, layout } = getConfig2();
2011
+ diag.db.setDiagramId(id);
2012
+ const data4Layout = diag.db.getData();
2013
+ const svg = getDiagramElement(id, securityLevel);
2014
+ data4Layout.type = diag.type;
2015
+ data4Layout.layoutAlgorithm = getRegisteredLayoutAlgorithm(layout);
2016
+ data4Layout.nodeSpacing = conf?.nodeSpacing || 50;
2017
+ data4Layout.rankSpacing = conf?.rankSpacing || 50;
2018
+ data4Layout.markers = ["aggregation", "extension", "composition", "dependency", "lollipop"];
2019
+ data4Layout.diagramId = id;
2020
+ await render(data4Layout, svg);
2021
+ const padding = 8;
2022
+ utils_default.insertTitle(svg, "classDiagramTitleText", conf?.titleTopMargin ?? 25, diag.db.getDiagramTitle());
2023
+ setupViewPortForSVG(svg, padding, "classDiagram", conf?.useMaxWidth ?? true);
2024
+ }, "draw");
2025
+ var classRenderer_v3_unified_default = {
2026
+ getClasses,
2027
+ draw,
2028
+ getDir
2029
+ };
2030
+
2031
+ export { classDiagram_default, ClassDB, styles_default, classRenderer_v3_unified_default };