@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,1332 @@
1
+ import {
2
+ getDiagramElement
3
+ } from "./markdown-gvyszqpv.js";
4
+ import {
5
+ setupViewPortForSVG
6
+ } from "./markdown-6r4svars.js";
7
+ import {
8
+ getRegisteredLayoutAlgorithm,
9
+ render
10
+ } from "./markdown-h7pzv34e.js";
11
+ import"./markdown-s1jatrnk.js";
12
+ import"./markdown-m7frq8x8.js";
13
+ import"./markdown-tvdpppw8.js";
14
+ import"./markdown-sgfg5vvq.js";
15
+ import"./markdown-82xmzhzd.js";
16
+ import"./markdown-c9k0fvp1.js";
17
+ import"./markdown-qx3cngz2.js";
18
+ import"./markdown-yengsms5.js";
19
+ import {
20
+ getEdgeId,
21
+ utils_default
22
+ } from "./markdown-ff5wvb43.js";
23
+ import"./markdown-pzgd8z3s.js";
24
+ import {
25
+ channel_default,
26
+ clear,
27
+ getAccDescription,
28
+ getAccTitle,
29
+ getConfig2,
30
+ getDiagramTitle,
31
+ rgba_default,
32
+ setAccDescription,
33
+ setAccTitle,
34
+ setDiagramTitle
35
+ } from "./markdown-92n37gd4.js";
36
+ import {
37
+ log,
38
+ select_default
39
+ } from "./markdown-xw8dsk8b.js";
40
+ import {
41
+ __export,
42
+ __name
43
+ } from "./markdown-1s5vwkf2.js";
44
+ import"./markdown-dy5sgjhc.js";
45
+ import"./markdown-809k7q41.js";
46
+
47
+ // node_modules/mermaid/dist/chunks/mermaid.core/erDiagram-JOGREHBK.mjs
48
+ var parser = function() {
49
+ var o = /* @__PURE__ */ __name(function(k, v, o2, l) {
50
+ for (o2 = o2 || {}, l = k.length;l--; o2[k[l]] = v)
51
+ ;
52
+ return o2;
53
+ }, "o"), $V0 = [6, 8, 10, 22, 24, 26, 28, 33, 34, 35, 36, 37, 40, 43, 44, 48, 50, 51, 52], $V1 = [1, 10], $V2 = [1, 11], $V3 = [1, 12], $V4 = [1, 13], $V5 = [1, 23], $V6 = [1, 24], $V7 = [1, 25], $V8 = [1, 26], $V9 = [1, 27], $Va = [1, 19], $Vb = [1, 28], $Vc = [1, 29], $Vd = [1, 20], $Ve = [1, 18], $Vf = [1, 21], $Vg = [1, 22], $Vh = [1, 36], $Vi = [1, 37], $Vj = [1, 38], $Vk = [1, 39], $Vl = [1, 40], $Vm = [6, 8, 10, 13, 15, 17, 20, 21, 22, 24, 26, 28, 33, 34, 35, 36, 37, 40, 43, 44, 48, 50, 51, 52, 66, 67, 68, 69, 70], $Vn = [1, 45], $Vo = [1, 46], $Vp = [1, 55], $Vq = [40, 48, 50, 51, 52, 71, 72], $Vr = [1, 66], $Vs = [1, 64], $Vt = [1, 61], $Vu = [1, 65], $Vv = [1, 67], $Vw = [6, 8, 10, 13, 17, 22, 24, 26, 28, 33, 34, 35, 36, 37, 40, 41, 42, 43, 44, 48, 49, 50, 51, 52, 66, 67, 68, 69, 70], $Vx = [66, 67, 68, 69, 70], $Vy = [1, 85], $Vz = [1, 84], $VA = [1, 82], $VB = [1, 83], $VC = [6, 10, 42, 47], $VD = [6, 10, 13, 41, 42, 47, 48, 49], $VE = [1, 93], $VF = [1, 92], $VG = [1, 91], $VH = [19, 58], $VI = [1, 102], $VJ = [1, 101], $VK = [19, 58, 61, 63];
54
+ var parser2 = {
55
+ trace: /* @__PURE__ */ __name(function trace() {}, "trace"),
56
+ yy: {},
57
+ symbols_: { error: 2, start: 3, ER_DIAGRAM: 4, document: 5, EOF: 6, line: 7, SPACE: 8, statement: 9, NEWLINE: 10, entityName: 11, relSpec: 12, COLON: 13, role: 14, STYLE_SEPARATOR: 15, idList: 16, BLOCK_START: 17, attributes: 18, BLOCK_STOP: 19, SQS: 20, SQE: 21, title: 22, title_value: 23, acc_title: 24, acc_title_value: 25, acc_descr: 26, acc_descr_value: 27, acc_descr_multiline_value: 28, direction: 29, classDefStatement: 30, classStatement: 31, styleStatement: 32, direction_tb: 33, direction_bt: 34, direction_rl: 35, direction_lr: 36, CLASSDEF: 37, stylesOpt: 38, separator: 39, UNICODE_TEXT: 40, STYLE_TEXT: 41, COMMA: 42, CLASS: 43, STYLE: 44, style: 45, styleComponent: 46, SEMI: 47, NUM: 48, BRKT: 49, ENTITY_NAME: 50, DECIMAL_NUM: 51, ENTITY_ONE: 52, attribute: 53, attributeType: 54, attributeName: 55, attributeKeyTypeList: 56, attributeComment: 57, ATTRIBUTE_WORD: 58, "?": 59, attributeKeyType: 60, ",": 61, ATTRIBUTE_KEY: 62, COMMENT: 63, cardinality: 64, relType: 65, ZERO_OR_ONE: 66, ZERO_OR_MORE: 67, ONE_OR_MORE: 68, ONLY_ONE: 69, MD_PARENT: 70, NON_IDENTIFYING: 71, IDENTIFYING: 72, WORD: 73, $accept: 0, $end: 1 },
58
+ terminals_: { 2: "error", 4: "ER_DIAGRAM", 6: "EOF", 8: "SPACE", 10: "NEWLINE", 13: "COLON", 15: "STYLE_SEPARATOR", 17: "BLOCK_START", 19: "BLOCK_STOP", 20: "SQS", 21: "SQE", 22: "title", 23: "title_value", 24: "acc_title", 25: "acc_title_value", 26: "acc_descr", 27: "acc_descr_value", 28: "acc_descr_multiline_value", 33: "direction_tb", 34: "direction_bt", 35: "direction_rl", 36: "direction_lr", 37: "CLASSDEF", 40: "UNICODE_TEXT", 41: "STYLE_TEXT", 42: "COMMA", 43: "CLASS", 44: "STYLE", 47: "SEMI", 48: "NUM", 49: "BRKT", 50: "ENTITY_NAME", 51: "DECIMAL_NUM", 52: "ENTITY_ONE", 58: "ATTRIBUTE_WORD", 59: "?", 61: ",", 62: "ATTRIBUTE_KEY", 63: "COMMENT", 66: "ZERO_OR_ONE", 67: "ZERO_OR_MORE", 68: "ONE_OR_MORE", 69: "ONLY_ONE", 70: "MD_PARENT", 71: "NON_IDENTIFYING", 72: "IDENTIFYING", 73: "WORD" },
59
+ productions_: [0, [3, 3], [5, 0], [5, 2], [7, 2], [7, 1], [7, 1], [7, 1], [9, 5], [9, 9], [9, 7], [9, 7], [9, 4], [9, 6], [9, 3], [9, 5], [9, 1], [9, 3], [9, 7], [9, 9], [9, 6], [9, 8], [9, 4], [9, 6], [9, 2], [9, 2], [9, 2], [9, 1], [9, 1], [9, 1], [9, 1], [9, 1], [29, 1], [29, 1], [29, 1], [29, 1], [30, 4], [16, 1], [16, 1], [16, 3], [16, 3], [31, 3], [32, 4], [38, 1], [38, 3], [45, 1], [45, 2], [39, 1], [39, 1], [39, 1], [46, 1], [46, 1], [46, 1], [46, 1], [11, 1], [11, 1], [11, 1], [11, 1], [11, 1], [18, 1], [18, 2], [53, 2], [53, 3], [53, 3], [53, 4], [54, 1], [54, 2], [55, 1], [56, 1], [56, 3], [60, 1], [57, 1], [12, 3], [64, 1], [64, 1], [64, 1], [64, 1], [64, 1], [65, 1], [65, 1], [14, 1], [14, 1], [14, 1]],
60
+ performAction: /* @__PURE__ */ __name(function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) {
61
+ var $0 = $$.length - 1;
62
+ switch (yystate) {
63
+ case 1:
64
+ break;
65
+ case 2:
66
+ this.$ = [];
67
+ break;
68
+ case 3:
69
+ $$[$0 - 1].push($$[$0]);
70
+ this.$ = $$[$0 - 1];
71
+ break;
72
+ case 4:
73
+ case 5:
74
+ this.$ = $$[$0];
75
+ break;
76
+ case 6:
77
+ case 7:
78
+ this.$ = [];
79
+ break;
80
+ case 8:
81
+ yy.addEntity($$[$0 - 4]);
82
+ yy.addEntity($$[$0 - 2]);
83
+ yy.addRelationship($$[$0 - 4], $$[$0], $$[$0 - 2], $$[$0 - 3]);
84
+ break;
85
+ case 9:
86
+ yy.addEntity($$[$0 - 8]);
87
+ yy.addEntity($$[$0 - 4]);
88
+ yy.addRelationship($$[$0 - 8], $$[$0], $$[$0 - 4], $$[$0 - 5]);
89
+ yy.setClass([$$[$0 - 8]], $$[$0 - 6]);
90
+ yy.setClass([$$[$0 - 4]], $$[$0 - 2]);
91
+ break;
92
+ case 10:
93
+ yy.addEntity($$[$0 - 6]);
94
+ yy.addEntity($$[$0 - 2]);
95
+ yy.addRelationship($$[$0 - 6], $$[$0], $$[$0 - 2], $$[$0 - 3]);
96
+ yy.setClass([$$[$0 - 6]], $$[$0 - 4]);
97
+ break;
98
+ case 11:
99
+ yy.addEntity($$[$0 - 6]);
100
+ yy.addEntity($$[$0 - 4]);
101
+ yy.addRelationship($$[$0 - 6], $$[$0], $$[$0 - 4], $$[$0 - 5]);
102
+ yy.setClass([$$[$0 - 4]], $$[$0 - 2]);
103
+ break;
104
+ case 12:
105
+ yy.addEntity($$[$0 - 3]);
106
+ yy.addAttributes($$[$0 - 3], $$[$0 - 1]);
107
+ break;
108
+ case 13:
109
+ yy.addEntity($$[$0 - 5]);
110
+ yy.addAttributes($$[$0 - 5], $$[$0 - 1]);
111
+ yy.setClass([$$[$0 - 5]], $$[$0 - 3]);
112
+ break;
113
+ case 14:
114
+ yy.addEntity($$[$0 - 2]);
115
+ break;
116
+ case 15:
117
+ yy.addEntity($$[$0 - 4]);
118
+ yy.setClass([$$[$0 - 4]], $$[$0 - 2]);
119
+ break;
120
+ case 16:
121
+ yy.addEntity($$[$0]);
122
+ break;
123
+ case 17:
124
+ yy.addEntity($$[$0 - 2]);
125
+ yy.setClass([$$[$0 - 2]], $$[$0]);
126
+ break;
127
+ case 18:
128
+ yy.addEntity($$[$0 - 6], $$[$0 - 4]);
129
+ yy.addAttributes($$[$0 - 6], $$[$0 - 1]);
130
+ break;
131
+ case 19:
132
+ yy.addEntity($$[$0 - 8], $$[$0 - 6]);
133
+ yy.addAttributes($$[$0 - 8], $$[$0 - 1]);
134
+ yy.setClass([$$[$0 - 8]], $$[$0 - 3]);
135
+ break;
136
+ case 20:
137
+ yy.addEntity($$[$0 - 5], $$[$0 - 3]);
138
+ break;
139
+ case 21:
140
+ yy.addEntity($$[$0 - 7], $$[$0 - 5]);
141
+ yy.setClass([$$[$0 - 7]], $$[$0 - 2]);
142
+ break;
143
+ case 22:
144
+ yy.addEntity($$[$0 - 3], $$[$0 - 1]);
145
+ break;
146
+ case 23:
147
+ yy.addEntity($$[$0 - 5], $$[$0 - 3]);
148
+ yy.setClass([$$[$0 - 5]], $$[$0]);
149
+ break;
150
+ case 24:
151
+ case 25:
152
+ this.$ = $$[$0].trim();
153
+ yy.setAccTitle(this.$);
154
+ break;
155
+ case 26:
156
+ case 27:
157
+ this.$ = $$[$0].trim();
158
+ yy.setAccDescription(this.$);
159
+ break;
160
+ case 32:
161
+ yy.setDirection("TB");
162
+ break;
163
+ case 33:
164
+ yy.setDirection("BT");
165
+ break;
166
+ case 34:
167
+ yy.setDirection("RL");
168
+ break;
169
+ case 35:
170
+ yy.setDirection("LR");
171
+ break;
172
+ case 36:
173
+ this.$ = $$[$0 - 3];
174
+ yy.addClass($$[$0 - 2], $$[$0 - 1]);
175
+ break;
176
+ case 37:
177
+ case 38:
178
+ case 59:
179
+ case 68:
180
+ this.$ = [$$[$0]];
181
+ break;
182
+ case 39:
183
+ case 40:
184
+ this.$ = $$[$0 - 2].concat([$$[$0]]);
185
+ break;
186
+ case 41:
187
+ this.$ = $$[$0 - 2];
188
+ yy.setClass($$[$0 - 1], $$[$0]);
189
+ break;
190
+ case 42:
191
+ ;
192
+ this.$ = $$[$0 - 3];
193
+ yy.addCssStyles($$[$0 - 2], $$[$0 - 1]);
194
+ break;
195
+ case 43:
196
+ this.$ = [$$[$0]];
197
+ break;
198
+ case 44:
199
+ $$[$0 - 2].push($$[$0]);
200
+ this.$ = $$[$0 - 2];
201
+ break;
202
+ case 46:
203
+ this.$ = $$[$0 - 1] + $$[$0];
204
+ break;
205
+ case 54:
206
+ case 80:
207
+ case 81:
208
+ this.$ = $$[$0].replace(/"/g, "");
209
+ break;
210
+ case 55:
211
+ case 56:
212
+ case 57:
213
+ case 58:
214
+ case 82:
215
+ this.$ = $$[$0];
216
+ break;
217
+ case 60:
218
+ $$[$0].push($$[$0 - 1]);
219
+ this.$ = $$[$0];
220
+ break;
221
+ case 61:
222
+ this.$ = { type: $$[$0 - 1], name: $$[$0] };
223
+ break;
224
+ case 62:
225
+ this.$ = { type: $$[$0 - 2], name: $$[$0 - 1], keys: $$[$0] };
226
+ break;
227
+ case 63:
228
+ this.$ = { type: $$[$0 - 2], name: $$[$0 - 1], comment: $$[$0] };
229
+ break;
230
+ case 64:
231
+ this.$ = { type: $$[$0 - 3], name: $$[$0 - 2], keys: $$[$0 - 1], comment: $$[$0] };
232
+ break;
233
+ case 65:
234
+ case 67:
235
+ case 70:
236
+ this.$ = $$[$0];
237
+ break;
238
+ case 66:
239
+ this.$ = $$[$0 - 1] + $$[$0];
240
+ break;
241
+ case 69:
242
+ $$[$0 - 2].push($$[$0]);
243
+ this.$ = $$[$0 - 2];
244
+ break;
245
+ case 71:
246
+ this.$ = $$[$0].replace(/"/g, "");
247
+ break;
248
+ case 72:
249
+ this.$ = { cardA: $$[$0], relType: $$[$0 - 1], cardB: $$[$0 - 2] };
250
+ break;
251
+ case 73:
252
+ this.$ = yy.Cardinality.ZERO_OR_ONE;
253
+ break;
254
+ case 74:
255
+ this.$ = yy.Cardinality.ZERO_OR_MORE;
256
+ break;
257
+ case 75:
258
+ this.$ = yy.Cardinality.ONE_OR_MORE;
259
+ break;
260
+ case 76:
261
+ this.$ = yy.Cardinality.ONLY_ONE;
262
+ break;
263
+ case 77:
264
+ this.$ = yy.Cardinality.MD_PARENT;
265
+ break;
266
+ case 78:
267
+ this.$ = yy.Identification.NON_IDENTIFYING;
268
+ break;
269
+ case 79:
270
+ this.$ = yy.Identification.IDENTIFYING;
271
+ break;
272
+ }
273
+ }, "anonymous"),
274
+ table: [{ 3: 1, 4: [1, 2] }, { 1: [3] }, o($V0, [2, 2], { 5: 3 }), { 6: [1, 4], 7: 5, 8: [1, 6], 9: 7, 10: [1, 8], 11: 9, 22: $V1, 24: $V2, 26: $V3, 28: $V4, 29: 14, 30: 15, 31: 16, 32: 17, 33: $V5, 34: $V6, 35: $V7, 36: $V8, 37: $V9, 40: $Va, 43: $Vb, 44: $Vc, 48: $Vd, 50: $Ve, 51: $Vf, 52: $Vg }, o($V0, [2, 7], { 1: [2, 1] }), o($V0, [2, 3]), { 9: 30, 11: 9, 22: $V1, 24: $V2, 26: $V3, 28: $V4, 29: 14, 30: 15, 31: 16, 32: 17, 33: $V5, 34: $V6, 35: $V7, 36: $V8, 37: $V9, 40: $Va, 43: $Vb, 44: $Vc, 48: $Vd, 50: $Ve, 51: $Vf, 52: $Vg }, o($V0, [2, 5]), o($V0, [2, 6]), o($V0, [2, 16], { 12: 31, 64: 35, 15: [1, 32], 17: [1, 33], 20: [1, 34], 66: $Vh, 67: $Vi, 68: $Vj, 69: $Vk, 70: $Vl }), { 23: [1, 41] }, { 25: [1, 42] }, { 27: [1, 43] }, o($V0, [2, 27]), o($V0, [2, 28]), o($V0, [2, 29]), o($V0, [2, 30]), o($V0, [2, 31]), o($Vm, [2, 54]), o($Vm, [2, 55]), o($Vm, [2, 56]), o($Vm, [2, 57]), o($Vm, [2, 58]), o($V0, [2, 32]), o($V0, [2, 33]), o($V0, [2, 34]), o($V0, [2, 35]), { 16: 44, 40: $Vn, 41: $Vo }, { 16: 47, 40: $Vn, 41: $Vo }, { 16: 48, 40: $Vn, 41: $Vo }, o($V0, [2, 4]), { 11: 49, 40: $Va, 48: $Vd, 50: $Ve, 51: $Vf, 52: $Vg }, { 16: 50, 40: $Vn, 41: $Vo }, { 18: 51, 19: [1, 52], 53: 53, 54: 54, 58: $Vp }, { 11: 56, 40: $Va, 48: $Vd, 50: $Ve, 51: $Vf, 52: $Vg }, { 65: 57, 71: [1, 58], 72: [1, 59] }, o($Vq, [2, 73]), o($Vq, [2, 74]), o($Vq, [2, 75]), o($Vq, [2, 76]), o($Vq, [2, 77]), o($V0, [2, 24]), o($V0, [2, 25]), o($V0, [2, 26]), { 13: $Vr, 38: 60, 41: $Vs, 42: $Vt, 45: 62, 46: 63, 48: $Vu, 49: $Vv }, o($Vw, [2, 37]), o($Vw, [2, 38]), { 16: 68, 40: $Vn, 41: $Vo, 42: $Vt }, { 13: $Vr, 38: 69, 41: $Vs, 42: $Vt, 45: 62, 46: 63, 48: $Vu, 49: $Vv }, { 13: [1, 70], 15: [1, 71] }, o($V0, [2, 17], { 64: 35, 12: 72, 17: [1, 73], 42: $Vt, 66: $Vh, 67: $Vi, 68: $Vj, 69: $Vk, 70: $Vl }), { 19: [1, 74] }, o($V0, [2, 14]), { 18: 75, 19: [2, 59], 53: 53, 54: 54, 58: $Vp }, { 55: 76, 58: [1, 77] }, { 58: [2, 65], 59: [1, 78] }, { 21: [1, 79] }, { 64: 80, 66: $Vh, 67: $Vi, 68: $Vj, 69: $Vk, 70: $Vl }, o($Vx, [2, 78]), o($Vx, [2, 79]), { 6: $Vy, 10: $Vz, 39: 81, 42: $VA, 47: $VB }, { 40: [1, 86], 41: [1, 87] }, o($VC, [2, 43], { 46: 88, 13: $Vr, 41: $Vs, 48: $Vu, 49: $Vv }), o($VD, [2, 45]), o($VD, [2, 50]), o($VD, [2, 51]), o($VD, [2, 52]), o($VD, [2, 53]), o($V0, [2, 41], { 42: $Vt }), { 6: $Vy, 10: $Vz, 39: 89, 42: $VA, 47: $VB }, { 14: 90, 40: $VE, 50: $VF, 73: $VG }, { 16: 94, 40: $Vn, 41: $Vo }, { 11: 95, 40: $Va, 48: $Vd, 50: $Ve, 51: $Vf, 52: $Vg }, { 18: 96, 19: [1, 97], 53: 53, 54: 54, 58: $Vp }, o($V0, [2, 12]), { 19: [2, 60] }, o($VH, [2, 61], { 56: 98, 57: 99, 60: 100, 62: $VI, 63: $VJ }), o([19, 58, 62, 63], [2, 67]), { 58: [2, 66] }, o($V0, [2, 22], { 15: [1, 104], 17: [1, 103] }), o([40, 48, 50, 51, 52], [2, 72]), o($V0, [2, 36]), { 13: $Vr, 41: $Vs, 45: 105, 46: 63, 48: $Vu, 49: $Vv }, o($V0, [2, 47]), o($V0, [2, 48]), o($V0, [2, 49]), o($Vw, [2, 39]), o($Vw, [2, 40]), o($VD, [2, 46]), o($V0, [2, 42]), o($V0, [2, 8]), o($V0, [2, 80]), o($V0, [2, 81]), o($V0, [2, 82]), { 13: [1, 106], 42: $Vt }, { 13: [1, 108], 15: [1, 107] }, { 19: [1, 109] }, o($V0, [2, 15]), o($VH, [2, 62], { 57: 110, 61: [1, 111], 63: $VJ }), o($VH, [2, 63]), o($VK, [2, 68]), o($VH, [2, 71]), o($VK, [2, 70]), { 18: 112, 19: [1, 113], 53: 53, 54: 54, 58: $Vp }, { 16: 114, 40: $Vn, 41: $Vo }, o($VC, [2, 44], { 46: 88, 13: $Vr, 41: $Vs, 48: $Vu, 49: $Vv }), { 14: 115, 40: $VE, 50: $VF, 73: $VG }, { 16: 116, 40: $Vn, 41: $Vo }, { 14: 117, 40: $VE, 50: $VF, 73: $VG }, o($V0, [2, 13]), o($VH, [2, 64]), { 60: 118, 62: $VI }, { 19: [1, 119] }, o($V0, [2, 20]), o($V0, [2, 23], { 17: [1, 120], 42: $Vt }), o($V0, [2, 11]), { 13: [1, 121], 42: $Vt }, o($V0, [2, 10]), o($VK, [2, 69]), o($V0, [2, 18]), { 18: 122, 19: [1, 123], 53: 53, 54: 54, 58: $Vp }, { 14: 124, 40: $VE, 50: $VF, 73: $VG }, { 19: [1, 125] }, o($V0, [2, 21]), o($V0, [2, 9]), o($V0, [2, 19])],
275
+ defaultActions: { 75: [2, 60], 78: [2, 66] },
276
+ parseError: /* @__PURE__ */ __name(function parseError(str, hash) {
277
+ if (hash.recoverable) {
278
+ this.trace(str);
279
+ } else {
280
+ var error = new Error(str);
281
+ error.hash = hash;
282
+ throw error;
283
+ }
284
+ }, "parseError"),
285
+ parse: /* @__PURE__ */ __name(function parse(input) {
286
+ var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;
287
+ var args = lstack.slice.call(arguments, 1);
288
+ var lexer2 = Object.create(this.lexer);
289
+ var sharedState = { yy: {} };
290
+ for (var k in this.yy) {
291
+ if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
292
+ sharedState.yy[k] = this.yy[k];
293
+ }
294
+ }
295
+ lexer2.setInput(input, sharedState.yy);
296
+ sharedState.yy.lexer = lexer2;
297
+ sharedState.yy.parser = this;
298
+ if (typeof lexer2.yylloc == "undefined") {
299
+ lexer2.yylloc = {};
300
+ }
301
+ var yyloc = lexer2.yylloc;
302
+ lstack.push(yyloc);
303
+ var ranges = lexer2.options && lexer2.options.ranges;
304
+ if (typeof sharedState.yy.parseError === "function") {
305
+ this.parseError = sharedState.yy.parseError;
306
+ } else {
307
+ this.parseError = Object.getPrototypeOf(this).parseError;
308
+ }
309
+ function popStack(n) {
310
+ stack.length = stack.length - 2 * n;
311
+ vstack.length = vstack.length - n;
312
+ lstack.length = lstack.length - n;
313
+ }
314
+ __name(popStack, "popStack");
315
+ function lex() {
316
+ var token;
317
+ token = tstack.pop() || lexer2.lex() || EOF;
318
+ if (typeof token !== "number") {
319
+ if (token instanceof Array) {
320
+ tstack = token;
321
+ token = tstack.pop();
322
+ }
323
+ token = self.symbols_[token] || token;
324
+ }
325
+ return token;
326
+ }
327
+ __name(lex, "lex");
328
+ var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;
329
+ while (true) {
330
+ state = stack[stack.length - 1];
331
+ if (this.defaultActions[state]) {
332
+ action = this.defaultActions[state];
333
+ } else {
334
+ if (symbol === null || typeof symbol == "undefined") {
335
+ symbol = lex();
336
+ }
337
+ action = table[state] && table[state][symbol];
338
+ }
339
+ if (typeof action === "undefined" || !action.length || !action[0]) {
340
+ var errStr = "";
341
+ expected = [];
342
+ for (p in table[state]) {
343
+ if (this.terminals_[p] && p > TERROR) {
344
+ expected.push("'" + this.terminals_[p] + "'");
345
+ }
346
+ }
347
+ if (lexer2.showPosition) {
348
+ errStr = "Parse error on line " + (yylineno + 1) + `:
349
+ ` + lexer2.showPosition() + `
350
+ Expecting ` + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
351
+ } else {
352
+ errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'");
353
+ }
354
+ this.parseError(errStr, {
355
+ text: lexer2.match,
356
+ token: this.terminals_[symbol] || symbol,
357
+ line: lexer2.yylineno,
358
+ loc: yyloc,
359
+ expected
360
+ });
361
+ }
362
+ if (action[0] instanceof Array && action.length > 1) {
363
+ throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
364
+ }
365
+ switch (action[0]) {
366
+ case 1:
367
+ stack.push(symbol);
368
+ vstack.push(lexer2.yytext);
369
+ lstack.push(lexer2.yylloc);
370
+ stack.push(action[1]);
371
+ symbol = null;
372
+ if (!preErrorSymbol) {
373
+ yyleng = lexer2.yyleng;
374
+ yytext = lexer2.yytext;
375
+ yylineno = lexer2.yylineno;
376
+ yyloc = lexer2.yylloc;
377
+ if (recovering > 0) {
378
+ recovering--;
379
+ }
380
+ } else {
381
+ symbol = preErrorSymbol;
382
+ preErrorSymbol = null;
383
+ }
384
+ break;
385
+ case 2:
386
+ len = this.productions_[action[1]][1];
387
+ yyval.$ = vstack[vstack.length - len];
388
+ yyval._$ = {
389
+ first_line: lstack[lstack.length - (len || 1)].first_line,
390
+ last_line: lstack[lstack.length - 1].last_line,
391
+ first_column: lstack[lstack.length - (len || 1)].first_column,
392
+ last_column: lstack[lstack.length - 1].last_column
393
+ };
394
+ if (ranges) {
395
+ yyval._$.range = [
396
+ lstack[lstack.length - (len || 1)].range[0],
397
+ lstack[lstack.length - 1].range[1]
398
+ ];
399
+ }
400
+ r = this.performAction.apply(yyval, [
401
+ yytext,
402
+ yyleng,
403
+ yylineno,
404
+ sharedState.yy,
405
+ action[1],
406
+ vstack,
407
+ lstack
408
+ ].concat(args));
409
+ if (typeof r !== "undefined") {
410
+ return r;
411
+ }
412
+ if (len) {
413
+ stack = stack.slice(0, -1 * len * 2);
414
+ vstack = vstack.slice(0, -1 * len);
415
+ lstack = lstack.slice(0, -1 * len);
416
+ }
417
+ stack.push(this.productions_[action[1]][0]);
418
+ vstack.push(yyval.$);
419
+ lstack.push(yyval._$);
420
+ newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
421
+ stack.push(newState);
422
+ break;
423
+ case 3:
424
+ return true;
425
+ }
426
+ }
427
+ return true;
428
+ }, "parse")
429
+ };
430
+ var lexer = /* @__PURE__ */ function() {
431
+ var lexer2 = {
432
+ EOF: 1,
433
+ parseError: /* @__PURE__ */ __name(function parseError(str, hash) {
434
+ if (this.yy.parser) {
435
+ this.yy.parser.parseError(str, hash);
436
+ } else {
437
+ throw new Error(str);
438
+ }
439
+ }, "parseError"),
440
+ setInput: /* @__PURE__ */ __name(function(input, yy) {
441
+ this.yy = yy || this.yy || {};
442
+ this._input = input;
443
+ this._more = this._backtrack = this.done = false;
444
+ this.yylineno = this.yyleng = 0;
445
+ this.yytext = this.matched = this.match = "";
446
+ this.conditionStack = ["INITIAL"];
447
+ this.yylloc = {
448
+ first_line: 1,
449
+ first_column: 0,
450
+ last_line: 1,
451
+ last_column: 0
452
+ };
453
+ if (this.options.ranges) {
454
+ this.yylloc.range = [0, 0];
455
+ }
456
+ this.offset = 0;
457
+ return this;
458
+ }, "setInput"),
459
+ input: /* @__PURE__ */ __name(function() {
460
+ var ch = this._input[0];
461
+ this.yytext += ch;
462
+ this.yyleng++;
463
+ this.offset++;
464
+ this.match += ch;
465
+ this.matched += ch;
466
+ var lines = ch.match(/(?:\r\n?|\n).*/g);
467
+ if (lines) {
468
+ this.yylineno++;
469
+ this.yylloc.last_line++;
470
+ } else {
471
+ this.yylloc.last_column++;
472
+ }
473
+ if (this.options.ranges) {
474
+ this.yylloc.range[1]++;
475
+ }
476
+ this._input = this._input.slice(1);
477
+ return ch;
478
+ }, "input"),
479
+ unput: /* @__PURE__ */ __name(function(ch) {
480
+ var len = ch.length;
481
+ var lines = ch.split(/(?:\r\n?|\n)/g);
482
+ this._input = ch + this._input;
483
+ this.yytext = this.yytext.substr(0, this.yytext.length - len);
484
+ this.offset -= len;
485
+ var oldLines = this.match.split(/(?:\r\n?|\n)/g);
486
+ this.match = this.match.substr(0, this.match.length - 1);
487
+ this.matched = this.matched.substr(0, this.matched.length - 1);
488
+ if (lines.length - 1) {
489
+ this.yylineno -= lines.length - 1;
490
+ }
491
+ var r = this.yylloc.range;
492
+ this.yylloc = {
493
+ first_line: this.yylloc.first_line,
494
+ last_line: this.yylineno + 1,
495
+ first_column: this.yylloc.first_column,
496
+ 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
497
+ };
498
+ if (this.options.ranges) {
499
+ this.yylloc.range = [r[0], r[0] + this.yyleng - len];
500
+ }
501
+ this.yyleng = this.yytext.length;
502
+ return this;
503
+ }, "unput"),
504
+ more: /* @__PURE__ */ __name(function() {
505
+ this._more = true;
506
+ return this;
507
+ }, "more"),
508
+ reject: /* @__PURE__ */ __name(function() {
509
+ if (this.options.backtrack_lexer) {
510
+ this._backtrack = true;
511
+ } else {
512
+ 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).
513
+ ` + this.showPosition(), {
514
+ text: "",
515
+ token: null,
516
+ line: this.yylineno
517
+ });
518
+ }
519
+ return this;
520
+ }, "reject"),
521
+ less: /* @__PURE__ */ __name(function(n) {
522
+ this.unput(this.match.slice(n));
523
+ }, "less"),
524
+ pastInput: /* @__PURE__ */ __name(function() {
525
+ var past = this.matched.substr(0, this.matched.length - this.match.length);
526
+ return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, "");
527
+ }, "pastInput"),
528
+ upcomingInput: /* @__PURE__ */ __name(function() {
529
+ var next = this.match;
530
+ if (next.length < 20) {
531
+ next += this._input.substr(0, 20 - next.length);
532
+ }
533
+ return (next.substr(0, 20) + (next.length > 20 ? "..." : "")).replace(/\n/g, "");
534
+ }, "upcomingInput"),
535
+ showPosition: /* @__PURE__ */ __name(function() {
536
+ var pre = this.pastInput();
537
+ var c = new Array(pre.length + 1).join("-");
538
+ return pre + this.upcomingInput() + `
539
+ ` + c + "^";
540
+ }, "showPosition"),
541
+ test_match: /* @__PURE__ */ __name(function(match, indexed_rule) {
542
+ var token, lines, backup;
543
+ if (this.options.backtrack_lexer) {
544
+ backup = {
545
+ yylineno: this.yylineno,
546
+ yylloc: {
547
+ first_line: this.yylloc.first_line,
548
+ last_line: this.last_line,
549
+ first_column: this.yylloc.first_column,
550
+ last_column: this.yylloc.last_column
551
+ },
552
+ yytext: this.yytext,
553
+ match: this.match,
554
+ matches: this.matches,
555
+ matched: this.matched,
556
+ yyleng: this.yyleng,
557
+ offset: this.offset,
558
+ _more: this._more,
559
+ _input: this._input,
560
+ yy: this.yy,
561
+ conditionStack: this.conditionStack.slice(0),
562
+ done: this.done
563
+ };
564
+ if (this.options.ranges) {
565
+ backup.yylloc.range = this.yylloc.range.slice(0);
566
+ }
567
+ }
568
+ lines = match[0].match(/(?:\r\n?|\n).*/g);
569
+ if (lines) {
570
+ this.yylineno += lines.length;
571
+ }
572
+ this.yylloc = {
573
+ first_line: this.yylloc.last_line,
574
+ last_line: this.yylineno + 1,
575
+ first_column: this.yylloc.last_column,
576
+ last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length
577
+ };
578
+ this.yytext += match[0];
579
+ this.match += match[0];
580
+ this.matches = match;
581
+ this.yyleng = this.yytext.length;
582
+ if (this.options.ranges) {
583
+ this.yylloc.range = [this.offset, this.offset += this.yyleng];
584
+ }
585
+ this._more = false;
586
+ this._backtrack = false;
587
+ this._input = this._input.slice(match[0].length);
588
+ this.matched += match[0];
589
+ token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
590
+ if (this.done && this._input) {
591
+ this.done = false;
592
+ }
593
+ if (token) {
594
+ return token;
595
+ } else if (this._backtrack) {
596
+ for (var k in backup) {
597
+ this[k] = backup[k];
598
+ }
599
+ return false;
600
+ }
601
+ return false;
602
+ }, "test_match"),
603
+ next: /* @__PURE__ */ __name(function() {
604
+ if (this.done) {
605
+ return this.EOF;
606
+ }
607
+ if (!this._input) {
608
+ this.done = true;
609
+ }
610
+ var token, match, tempMatch, index;
611
+ if (!this._more) {
612
+ this.yytext = "";
613
+ this.match = "";
614
+ }
615
+ var rules = this._currentRules();
616
+ for (var i = 0;i < rules.length; i++) {
617
+ tempMatch = this._input.match(this.rules[rules[i]]);
618
+ if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
619
+ match = tempMatch;
620
+ index = i;
621
+ if (this.options.backtrack_lexer) {
622
+ token = this.test_match(tempMatch, rules[i]);
623
+ if (token !== false) {
624
+ return token;
625
+ } else if (this._backtrack) {
626
+ match = false;
627
+ continue;
628
+ } else {
629
+ return false;
630
+ }
631
+ } else if (!this.options.flex) {
632
+ break;
633
+ }
634
+ }
635
+ }
636
+ if (match) {
637
+ token = this.test_match(match, rules[index]);
638
+ if (token !== false) {
639
+ return token;
640
+ }
641
+ return false;
642
+ }
643
+ if (this._input === "") {
644
+ return this.EOF;
645
+ } else {
646
+ return this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
647
+ ` + this.showPosition(), {
648
+ text: "",
649
+ token: null,
650
+ line: this.yylineno
651
+ });
652
+ }
653
+ }, "next"),
654
+ lex: /* @__PURE__ */ __name(function lex() {
655
+ var r = this.next();
656
+ if (r) {
657
+ return r;
658
+ } else {
659
+ return this.lex();
660
+ }
661
+ }, "lex"),
662
+ begin: /* @__PURE__ */ __name(function begin(condition) {
663
+ this.conditionStack.push(condition);
664
+ }, "begin"),
665
+ popState: /* @__PURE__ */ __name(function popState() {
666
+ var n = this.conditionStack.length - 1;
667
+ if (n > 0) {
668
+ return this.conditionStack.pop();
669
+ } else {
670
+ return this.conditionStack[0];
671
+ }
672
+ }, "popState"),
673
+ _currentRules: /* @__PURE__ */ __name(function _currentRules() {
674
+ if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
675
+ return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
676
+ } else {
677
+ return this.conditions["INITIAL"].rules;
678
+ }
679
+ }, "_currentRules"),
680
+ topState: /* @__PURE__ */ __name(function topState(n) {
681
+ n = this.conditionStack.length - 1 - Math.abs(n || 0);
682
+ if (n >= 0) {
683
+ return this.conditionStack[n];
684
+ } else {
685
+ return "INITIAL";
686
+ }
687
+ }, "topState"),
688
+ pushState: /* @__PURE__ */ __name(function pushState(condition) {
689
+ this.begin(condition);
690
+ }, "pushState"),
691
+ stateStackSize: /* @__PURE__ */ __name(function stateStackSize() {
692
+ return this.conditionStack.length;
693
+ }, "stateStackSize"),
694
+ options: { "case-insensitive": true },
695
+ performAction: /* @__PURE__ */ __name(function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
696
+ var YYSTATE = YY_START;
697
+ switch ($avoiding_name_collisions) {
698
+ case 0:
699
+ this.begin("acc_title");
700
+ return 24;
701
+ break;
702
+ case 1:
703
+ this.popState();
704
+ return "acc_title_value";
705
+ break;
706
+ case 2:
707
+ this.begin("acc_descr");
708
+ return 26;
709
+ break;
710
+ case 3:
711
+ this.popState();
712
+ return "acc_descr_value";
713
+ break;
714
+ case 4:
715
+ this.begin("acc_descr_multiline");
716
+ break;
717
+ case 5:
718
+ this.popState();
719
+ break;
720
+ case 6:
721
+ return "acc_descr_multiline_value";
722
+ break;
723
+ case 7:
724
+ return 33;
725
+ break;
726
+ case 8:
727
+ return 34;
728
+ break;
729
+ case 9:
730
+ return 35;
731
+ break;
732
+ case 10:
733
+ return 36;
734
+ break;
735
+ case 11:
736
+ return 10;
737
+ break;
738
+ case 12:
739
+ break;
740
+ case 13:
741
+ return 8;
742
+ break;
743
+ case 14:
744
+ return 50;
745
+ break;
746
+ case 15:
747
+ return 73;
748
+ break;
749
+ case 16:
750
+ return 4;
751
+ break;
752
+ case 17:
753
+ this.begin("block");
754
+ return 17;
755
+ break;
756
+ case 18:
757
+ return 49;
758
+ break;
759
+ case 19:
760
+ return 49;
761
+ break;
762
+ case 20:
763
+ return 42;
764
+ break;
765
+ case 21:
766
+ return 15;
767
+ break;
768
+ case 22:
769
+ return 13;
770
+ break;
771
+ case 23:
772
+ break;
773
+ case 24:
774
+ return 62;
775
+ break;
776
+ case 25:
777
+ return 58;
778
+ break;
779
+ case 26:
780
+ return 58;
781
+ break;
782
+ case 27:
783
+ this.begin("block_bq");
784
+ break;
785
+ case 28:
786
+ return 58;
787
+ break;
788
+ case 29:
789
+ this.popState();
790
+ break;
791
+ case 30:
792
+ return 63;
793
+ break;
794
+ case 31:
795
+ break;
796
+ case 32:
797
+ this.popState();
798
+ return 19;
799
+ break;
800
+ case 33:
801
+ return yy_.yytext[0];
802
+ break;
803
+ case 34:
804
+ return 20;
805
+ break;
806
+ case 35:
807
+ return 21;
808
+ break;
809
+ case 36:
810
+ this.begin("style");
811
+ return 44;
812
+ break;
813
+ case 37:
814
+ this.popState();
815
+ return 10;
816
+ break;
817
+ case 38:
818
+ break;
819
+ case 39:
820
+ return 13;
821
+ break;
822
+ case 40:
823
+ return 42;
824
+ break;
825
+ case 41:
826
+ return 49;
827
+ break;
828
+ case 42:
829
+ this.begin("style");
830
+ return 37;
831
+ break;
832
+ case 43:
833
+ return 43;
834
+ break;
835
+ case 44:
836
+ return 66;
837
+ break;
838
+ case 45:
839
+ return 68;
840
+ break;
841
+ case 46:
842
+ return 68;
843
+ break;
844
+ case 47:
845
+ return 68;
846
+ break;
847
+ case 48:
848
+ return 66;
849
+ break;
850
+ case 49:
851
+ return 66;
852
+ break;
853
+ case 50:
854
+ return 67;
855
+ break;
856
+ case 51:
857
+ return 67;
858
+ break;
859
+ case 52:
860
+ return 67;
861
+ break;
862
+ case 53:
863
+ return 67;
864
+ break;
865
+ case 54:
866
+ return 67;
867
+ break;
868
+ case 55:
869
+ return 68;
870
+ break;
871
+ case 56:
872
+ return 67;
873
+ break;
874
+ case 57:
875
+ return 68;
876
+ break;
877
+ case 58:
878
+ return 69;
879
+ break;
880
+ case 59:
881
+ return 69;
882
+ break;
883
+ case 60:
884
+ return 51;
885
+ break;
886
+ case 61:
887
+ return 69;
888
+ break;
889
+ case 62:
890
+ return 69;
891
+ break;
892
+ case 63:
893
+ return 69;
894
+ break;
895
+ case 64:
896
+ return 52;
897
+ break;
898
+ case 65:
899
+ return 48;
900
+ break;
901
+ case 66:
902
+ return 69;
903
+ break;
904
+ case 67:
905
+ return 66;
906
+ break;
907
+ case 68:
908
+ return 67;
909
+ break;
910
+ case 69:
911
+ return 68;
912
+ break;
913
+ case 70:
914
+ return 70;
915
+ break;
916
+ case 71:
917
+ return 71;
918
+ break;
919
+ case 72:
920
+ return 72;
921
+ break;
922
+ case 73:
923
+ return 72;
924
+ break;
925
+ case 74:
926
+ return 71;
927
+ break;
928
+ case 75:
929
+ return 71;
930
+ break;
931
+ case 76:
932
+ return 71;
933
+ break;
934
+ case 77:
935
+ return 41;
936
+ break;
937
+ case 78:
938
+ return 47;
939
+ break;
940
+ case 79:
941
+ return 40;
942
+ break;
943
+ case 80:
944
+ return yy_.yytext[0];
945
+ break;
946
+ case 81:
947
+ return 6;
948
+ break;
949
+ }
950
+ }, "anonymous"),
951
+ rules: [/^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?:.*direction\s+TB[^\n]*)/i, /^(?:.*direction\s+BT[^\n]*)/i, /^(?:.*direction\s+RL[^\n]*)/i, /^(?:.*direction\s+LR[^\n]*)/i, /^(?:[\n]+)/i, /^(?:\s+)/i, /^(?:[\s]+)/i, /^(?:"[^"%\r\n\v\b\\]+")/i, /^(?:"[^"]*")/i, /^(?:erDiagram\b)/i, /^(?:\{)/i, /^(?:#)/i, /^(?:#)/i, /^(?:,)/i, /^(?::::)/i, /^(?::)/i, /^(?:\s+)/i, /^(?:\b((?:PK)|(?:FK)|(?:UK))\b)/i, /^(?:([^\s]*)[~].*[~]([^\s]*))/i, /^(?:([\*A-Za-z_\u00C0-\uFFFF][A-Za-z0-9\-\_\[\]\(\)\.,\u00C0-\uFFFF\*]*))/i, /^(?:[`])/i, /^(?:[^`]+)/i, /^(?:[`])/i, /^(?:"[^"]*")/i, /^(?:[\n]+)/i, /^(?:\})/i, /^(?:.)/i, /^(?:\[)/i, /^(?:\])/i, /^(?:style\b)/i, /^(?:[\n]+)/i, /^(?:\s+)/i, /^(?::)/i, /^(?:,)/i, /^(?:#)/i, /^(?:classDef\b)/i, /^(?:class\b)/i, /^(?:one or zero\b)/i, /^(?:one or more\b)/i, /^(?:one or many\b)/i, /^(?:1\+)/i, /^(?:\|o\b)/i, /^(?:zero or one\b)/i, /^(?:zero or more\b)/i, /^(?:zero or many\b)/i, /^(?:0\+)/i, /^(?:\}o\b)/i, /^(?:many\(0\))/i, /^(?:many\(1\))/i, /^(?:many\b)/i, /^(?:\}\|)/i, /^(?:one\b)/i, /^(?:only one\b)/i, /^(?:[0-9]+\.[0-9]+)/i, /^(?:1(?=\s+[A-Za-z_"']))/i, /^(?:1(?=\s+[0-9]))/i, /^(?:1(?=(--|\.\.|\.-|-\.)))/i, /^(?:1\b)/i, /^(?:[0-9]+)/i, /^(?:\|\|)/i, /^(?:o\|)/i, /^(?:o\{)/i, /^(?:\|\{)/i, /^(?:u(?=[\.\-\|]))/i, /^(?:\.\.)/i, /^(?:--)/i, /^(?:to\b)/i, /^(?:optionally to\b)/i, /^(?:\.-)/i, /^(?:-\.)/i, /^(?:([^\x00-\x7F]|\w|-|\*)+)/i, /^(?:;)/i, /^(?:([^\x00-\x7F]|\w|-|\*|\.)+)/i, /^(?:.)/i, /^(?:$)/i],
952
+ conditions: { style: { rules: [37, 38, 39, 40, 41, 77, 78], inclusive: false }, acc_descr_multiline: { rules: [5, 6], inclusive: false }, acc_descr: { rules: [3], inclusive: false }, acc_title: { rules: [1], inclusive: false }, block_bq: { rules: [28, 29], inclusive: false }, block: { rules: [23, 24, 25, 26, 27, 30, 31, 32, 33], inclusive: false }, INITIAL: { rules: [0, 2, 4, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 34, 35, 36, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 79, 80, 81], inclusive: true } }
953
+ };
954
+ return lexer2;
955
+ }();
956
+ parser2.lexer = lexer;
957
+ function Parser() {
958
+ this.yy = {};
959
+ }
960
+ __name(Parser, "Parser");
961
+ Parser.prototype = parser2;
962
+ parser2.Parser = Parser;
963
+ return new Parser;
964
+ }();
965
+ parser.parser = parser;
966
+ var erDiagram_default = parser;
967
+ var ErDB = class {
968
+ constructor() {
969
+ this.entities = /* @__PURE__ */ new Map;
970
+ this.relationships = [];
971
+ this.classes = /* @__PURE__ */ new Map;
972
+ this.direction = "TB";
973
+ this.Cardinality = {
974
+ ZERO_OR_ONE: "ZERO_OR_ONE",
975
+ ZERO_OR_MORE: "ZERO_OR_MORE",
976
+ ONE_OR_MORE: "ONE_OR_MORE",
977
+ ONLY_ONE: "ONLY_ONE",
978
+ MD_PARENT: "MD_PARENT"
979
+ };
980
+ this.Identification = {
981
+ NON_IDENTIFYING: "NON_IDENTIFYING",
982
+ IDENTIFYING: "IDENTIFYING"
983
+ };
984
+ this.setAccTitle = setAccTitle;
985
+ this.getAccTitle = getAccTitle;
986
+ this.setAccDescription = setAccDescription;
987
+ this.getAccDescription = getAccDescription;
988
+ this.setDiagramTitle = setDiagramTitle;
989
+ this.getDiagramTitle = getDiagramTitle;
990
+ this.getConfig = /* @__PURE__ */ __name(() => getConfig2().er, "getConfig");
991
+ this.clear();
992
+ this.addEntity = this.addEntity.bind(this);
993
+ this.addAttributes = this.addAttributes.bind(this);
994
+ this.addRelationship = this.addRelationship.bind(this);
995
+ this.setDirection = this.setDirection.bind(this);
996
+ this.addCssStyles = this.addCssStyles.bind(this);
997
+ this.addClass = this.addClass.bind(this);
998
+ this.setClass = this.setClass.bind(this);
999
+ this.setAccTitle = this.setAccTitle.bind(this);
1000
+ this.setAccDescription = this.setAccDescription.bind(this);
1001
+ }
1002
+ static {
1003
+ __name(this, "ErDB");
1004
+ }
1005
+ addEntity(name, alias = "") {
1006
+ if (!this.entities.has(name)) {
1007
+ this.entities.set(name, {
1008
+ id: `entity-${name}-${this.entities.size}`,
1009
+ label: name,
1010
+ attributes: [],
1011
+ alias,
1012
+ shape: "erBox",
1013
+ look: getConfig2().look ?? "default",
1014
+ cssClasses: "default",
1015
+ cssStyles: [],
1016
+ labelType: "markdown"
1017
+ });
1018
+ log.info("Added new entity :", name);
1019
+ } else if (!this.entities.get(name)?.alias && alias) {
1020
+ this.entities.get(name).alias = alias;
1021
+ log.info(`Add alias '${alias}' to entity '${name}'`);
1022
+ }
1023
+ return this.entities.get(name);
1024
+ }
1025
+ getEntity(name) {
1026
+ return this.entities.get(name);
1027
+ }
1028
+ getEntities() {
1029
+ return this.entities;
1030
+ }
1031
+ getClasses() {
1032
+ return this.classes;
1033
+ }
1034
+ addAttributes(entityName, attribs) {
1035
+ const entity = this.addEntity(entityName);
1036
+ let i;
1037
+ for (i = attribs.length - 1;i >= 0; i--) {
1038
+ if (!attribs[i].keys) {
1039
+ attribs[i].keys = [];
1040
+ }
1041
+ if (!attribs[i].comment) {
1042
+ attribs[i].comment = "";
1043
+ }
1044
+ entity.attributes.push(attribs[i]);
1045
+ log.debug("Added attribute ", attribs[i].name);
1046
+ }
1047
+ }
1048
+ addRelationship(entA, rolA, entB, rSpec) {
1049
+ const entityA = this.entities.get(entA);
1050
+ const entityB = this.entities.get(entB);
1051
+ if (!entityA || !entityB) {
1052
+ return;
1053
+ }
1054
+ const rel = {
1055
+ entityA: entityA.id,
1056
+ roleA: rolA,
1057
+ entityB: entityB.id,
1058
+ relSpec: rSpec
1059
+ };
1060
+ this.relationships.push(rel);
1061
+ log.debug("Added new relationship :", rel);
1062
+ }
1063
+ getRelationships() {
1064
+ return this.relationships;
1065
+ }
1066
+ getDirection() {
1067
+ return this.direction;
1068
+ }
1069
+ setDirection(dir) {
1070
+ this.direction = dir;
1071
+ }
1072
+ getCompiledStyles(classDefs) {
1073
+ let compiledStyles = [];
1074
+ for (const customClass of classDefs) {
1075
+ const cssClass = this.classes.get(customClass);
1076
+ if (cssClass?.styles) {
1077
+ compiledStyles = [...compiledStyles, ...cssClass.styles ?? []].map((s) => s.trim());
1078
+ }
1079
+ if (cssClass?.textStyles) {
1080
+ compiledStyles = [...compiledStyles, ...cssClass.textStyles ?? []].map((s) => s.trim());
1081
+ }
1082
+ }
1083
+ return compiledStyles;
1084
+ }
1085
+ addCssStyles(ids, styles) {
1086
+ for (const id of ids) {
1087
+ const entity = this.entities.get(id);
1088
+ if (!styles || !entity) {
1089
+ return;
1090
+ }
1091
+ for (const style of styles) {
1092
+ entity.cssStyles.push(style);
1093
+ }
1094
+ }
1095
+ }
1096
+ addClass(ids, style) {
1097
+ ids.forEach((id) => {
1098
+ let classNode = this.classes.get(id);
1099
+ if (classNode === undefined) {
1100
+ classNode = { id, styles: [], textStyles: [] };
1101
+ this.classes.set(id, classNode);
1102
+ }
1103
+ if (style) {
1104
+ style.forEach(function(s) {
1105
+ if (/color/.exec(s)) {
1106
+ const newStyle = s.replace("fill", "bgFill");
1107
+ classNode.textStyles.push(newStyle);
1108
+ }
1109
+ classNode.styles.push(s);
1110
+ });
1111
+ }
1112
+ });
1113
+ }
1114
+ setClass(ids, classNames) {
1115
+ for (const id of ids) {
1116
+ const entity = this.entities.get(id);
1117
+ if (entity) {
1118
+ for (const className of classNames) {
1119
+ entity.cssClasses += " " + className;
1120
+ }
1121
+ }
1122
+ }
1123
+ }
1124
+ clear() {
1125
+ this.entities = /* @__PURE__ */ new Map;
1126
+ this.classes = /* @__PURE__ */ new Map;
1127
+ this.relationships = [];
1128
+ clear();
1129
+ }
1130
+ getData() {
1131
+ const nodes = [];
1132
+ const edges = [];
1133
+ const config = getConfig2();
1134
+ let colorIndex = 0;
1135
+ for (const entityKey of this.entities.keys()) {
1136
+ const entityNode = this.entities.get(entityKey);
1137
+ if (entityNode) {
1138
+ entityNode.cssCompiledStyles = this.getCompiledStyles(entityNode.cssClasses.split(" "));
1139
+ entityNode.colorIndex = colorIndex++;
1140
+ nodes.push(entityNode);
1141
+ }
1142
+ }
1143
+ let count = 0;
1144
+ for (const relationship of this.relationships) {
1145
+ const edge = {
1146
+ id: getEdgeId(relationship.entityA, relationship.entityB, {
1147
+ prefix: "id",
1148
+ counter: count++
1149
+ }),
1150
+ type: "normal",
1151
+ curve: "basis",
1152
+ start: relationship.entityA,
1153
+ end: relationship.entityB,
1154
+ label: relationship.roleA,
1155
+ labelpos: "c",
1156
+ thickness: "normal",
1157
+ classes: "relationshipLine",
1158
+ arrowTypeStart: relationship.relSpec.cardB.toLowerCase(),
1159
+ arrowTypeEnd: relationship.relSpec.cardA.toLowerCase(),
1160
+ pattern: relationship.relSpec.relType == "IDENTIFYING" ? "solid" : "dashed",
1161
+ look: config.look,
1162
+ labelType: "markdown"
1163
+ };
1164
+ edges.push(edge);
1165
+ }
1166
+ return { nodes, edges, other: {}, config, direction: "TB" };
1167
+ }
1168
+ };
1169
+ var erRenderer_unified_exports = {};
1170
+ __export(erRenderer_unified_exports, {
1171
+ draw: () => draw
1172
+ });
1173
+ var draw = /* @__PURE__ */ __name(async function(text, id, _version, diag) {
1174
+ log.info("REF0:");
1175
+ log.info("Drawing er diagram (unified)", id);
1176
+ const { securityLevel, er: conf, layout } = getConfig2();
1177
+ const data4Layout = diag.db.getData();
1178
+ const svg = getDiagramElement(id, securityLevel);
1179
+ data4Layout.type = diag.type;
1180
+ data4Layout.layoutAlgorithm = getRegisteredLayoutAlgorithm(layout);
1181
+ data4Layout.config.flowchart.nodeSpacing = conf?.nodeSpacing || 140;
1182
+ data4Layout.config.flowchart.rankSpacing = conf?.rankSpacing || 80;
1183
+ data4Layout.direction = diag.db.getDirection();
1184
+ const { config } = data4Layout;
1185
+ const { look } = config;
1186
+ if (look === "neo") {
1187
+ data4Layout.markers = [
1188
+ "only_one_neo",
1189
+ "zero_or_one_neo",
1190
+ "one_or_more_neo",
1191
+ "zero_or_more_neo"
1192
+ ];
1193
+ } else {
1194
+ data4Layout.markers = ["only_one", "zero_or_one", "one_or_more", "zero_or_more"];
1195
+ }
1196
+ data4Layout.diagramId = id;
1197
+ await render(data4Layout, svg);
1198
+ if (data4Layout.layoutAlgorithm === "elk") {
1199
+ svg.select(".edges").lower();
1200
+ }
1201
+ const backgroundNodes = svg.selectAll('[id*="-background"]');
1202
+ if (Array.from(backgroundNodes).length > 0) {
1203
+ backgroundNodes.each(function() {
1204
+ const backgroundNode = select_default(this);
1205
+ const backgroundId = backgroundNode.attr("id");
1206
+ const nonBackgroundId = backgroundId.replace("-background", "");
1207
+ const nonBackgroundNode = svg.select(`#${CSS.escape(nonBackgroundId)}`);
1208
+ if (!nonBackgroundNode.empty()) {
1209
+ const transform = nonBackgroundNode.attr("transform");
1210
+ backgroundNode.attr("transform", transform);
1211
+ }
1212
+ });
1213
+ }
1214
+ const padding = 8;
1215
+ utils_default.insertTitle(svg, "erDiagramTitleText", conf?.titleTopMargin ?? 25, diag.db.getDiagramTitle());
1216
+ setupViewPortForSVG(svg, padding, "erDiagram", conf?.useMaxWidth ?? true);
1217
+ }, "draw");
1218
+ var fade = /* @__PURE__ */ __name((color, opacity) => {
1219
+ const channel2 = channel_default;
1220
+ const r = channel2(color, "r");
1221
+ const g = channel2(color, "g");
1222
+ const b = channel2(color, "b");
1223
+ return rgba_default(r, g, b, opacity);
1224
+ }, "fade");
1225
+ var COLOR_THEMES = /* @__PURE__ */ new Set(["redux-color", "redux-dark-color"]);
1226
+ var genColor = /* @__PURE__ */ __name((options) => {
1227
+ const { theme, look, bkgColorArray, borderColorArray } = options;
1228
+ if (!COLOR_THEMES.has(theme)) {
1229
+ return "";
1230
+ }
1231
+ const hasBkgColors = bkgColorArray?.length > 0;
1232
+ let sections = "";
1233
+ for (let i = 0;i < options.THEME_COLOR_LIMIT; i++) {
1234
+ sections += `
1235
+
1236
+ [data-look="${look}"][data-color-id="color-${i}"].node path {
1237
+ stroke: ${borderColorArray[i]};
1238
+ ${hasBkgColors ? `fill: ${bkgColorArray[i]};` : ""}
1239
+ }
1240
+
1241
+ [data-look="${look}"][data-color-id="color-${i}"].node rect {
1242
+ stroke: ${borderColorArray[i]};
1243
+ ${hasBkgColors ? `fill: ${bkgColorArray[i]};` : ""}
1244
+ }
1245
+ `;
1246
+ }
1247
+ return sections;
1248
+ }, "genColor");
1249
+ var getStyles = /* @__PURE__ */ __name((options) => {
1250
+ const { look, theme, erEdgeLabelBackground, strokeWidth } = options;
1251
+ return `
1252
+ ${genColor(options)}
1253
+ .entityBox {
1254
+ fill: ${options.mainBkg};
1255
+ stroke: ${options.nodeBorder};
1256
+ }
1257
+
1258
+ .relationshipLabelBox {
1259
+ fill: ${options.tertiaryColor};
1260
+ opacity: 0.7;
1261
+ background-color: ${options.tertiaryColor};
1262
+ rect {
1263
+ opacity: 0.5;
1264
+ }
1265
+ }
1266
+
1267
+ .labelBkg {
1268
+ background-color: ${COLOR_THEMES.has(theme) && erEdgeLabelBackground ? erEdgeLabelBackground : fade(options.tertiaryColor, 0.5)};
1269
+ }
1270
+
1271
+ .edgeLabel {
1272
+ background-color: ${COLOR_THEMES.has(theme) && erEdgeLabelBackground ? erEdgeLabelBackground : options.edgeLabelBackground};
1273
+ }
1274
+ .edgeLabel .label rect {
1275
+ fill: ${COLOR_THEMES.has(theme) && erEdgeLabelBackground ? erEdgeLabelBackground : options.edgeLabelBackground};
1276
+ }
1277
+ .edgeLabel .label text {
1278
+ fill: ${options.textColor};
1279
+ }
1280
+
1281
+ .edgeLabel .label {
1282
+ fill: ${options.nodeBorder};
1283
+ font-size: 14px;
1284
+ }
1285
+
1286
+ .label {
1287
+ font-family: ${options.fontFamily};
1288
+ color: ${options.nodeTextColor || options.textColor};
1289
+ }
1290
+
1291
+ .edge-pattern-dashed {
1292
+ stroke-dasharray: 8,8;
1293
+ }
1294
+
1295
+ .node rect,
1296
+ .node circle,
1297
+ .node ellipse,
1298
+ .node polygon
1299
+ {
1300
+ fill: ${options.mainBkg};
1301
+ stroke: ${options.nodeBorder};
1302
+ stroke-width: ${look === "neo" ? strokeWidth : "1px"};
1303
+ }
1304
+
1305
+ .relationshipLine {
1306
+ stroke: ${options.lineColor};
1307
+ stroke-width: ${look === "neo" ? strokeWidth : "1px"};
1308
+ fill: none;
1309
+ }
1310
+
1311
+ .marker {
1312
+ fill: none !important;
1313
+ stroke: ${options.lineColor} !important;
1314
+ stroke-width: 1;
1315
+ }
1316
+ [data-look=neo].labelBkg {
1317
+ background-color: ${fade(options.tertiaryColor, 0.5)};
1318
+ }
1319
+ `;
1320
+ }, "getStyles");
1321
+ var styles_default = getStyles;
1322
+ var diagram = {
1323
+ parser: erDiagram_default,
1324
+ get db() {
1325
+ return new ErDB;
1326
+ },
1327
+ renderer: erRenderer_unified_exports,
1328
+ styles: styles_default
1329
+ };
1330
+ export {
1331
+ diagram
1332
+ };