@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,1216 @@
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"./markdown-ff5wvb43.js";
20
+ import"./markdown-pzgd8z3s.js";
21
+ import {
22
+ darken_default,
23
+ defaultConfig_default,
24
+ getConfig,
25
+ getConfig2,
26
+ getUserDefinedConfig,
27
+ is_dark_default,
28
+ lighten_default,
29
+ sanitizeText
30
+ } from "./markdown-92n37gd4.js";
31
+ import {
32
+ log
33
+ } from "./markdown-xw8dsk8b.js";
34
+ import {
35
+ __name
36
+ } from "./markdown-1s5vwkf2.js";
37
+ import"./markdown-dy5sgjhc.js";
38
+ import"./markdown-809k7q41.js";
39
+ // node_modules/uuid/dist/rng.js
40
+ var rnds8 = new Uint8Array(16);
41
+ function rng() {
42
+ return crypto.getRandomValues(rnds8);
43
+ }
44
+
45
+ // node_modules/uuid/dist/stringify.js
46
+ var byteToHex = [];
47
+ for (let i = 0;i < 256; ++i) {
48
+ byteToHex.push((i + 256).toString(16).slice(1));
49
+ }
50
+ function unsafeStringify(arr, offset = 0) {
51
+ return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
52
+ }
53
+
54
+ // node_modules/uuid/dist/v4.js
55
+ function v4(options, buf, offset) {
56
+ if (!buf && !options && crypto.randomUUID) {
57
+ return crypto.randomUUID();
58
+ }
59
+ return _v4(options, buf, offset);
60
+ }
61
+ function _v4(options, buf, offset) {
62
+ options = options || {};
63
+ const rnds = options.random ?? options.rng?.() ?? rng();
64
+ if (rnds.length < 16) {
65
+ throw new Error("Random bytes length must be >= 16");
66
+ }
67
+ rnds[6] = rnds[6] & 15 | 64;
68
+ rnds[8] = rnds[8] & 63 | 128;
69
+ if (buf) {
70
+ offset = offset || 0;
71
+ if (offset < 0 || offset + 16 > buf.length) {
72
+ throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`);
73
+ }
74
+ for (let i = 0;i < 16; ++i) {
75
+ buf[offset + i] = rnds[i];
76
+ }
77
+ return buf;
78
+ }
79
+ return unsafeStringify(rnds);
80
+ }
81
+ var v4_default = v4;
82
+ // node_modules/mermaid/dist/chunks/mermaid.core/mindmap-definition-FAOFIHXS.mjs
83
+ var parser = function() {
84
+ var o = /* @__PURE__ */ __name(function(k, v, o2, l) {
85
+ for (o2 = o2 || {}, l = k.length;l--; o2[k[l]] = v)
86
+ ;
87
+ return o2;
88
+ }, "o"), $V0 = [1, 4], $V1 = [1, 13], $V2 = [1, 12], $V3 = [1, 15], $V4 = [1, 16], $V5 = [1, 20], $V6 = [1, 19], $V7 = [6, 7, 8], $V8 = [1, 26], $V9 = [1, 24], $Va = [1, 25], $Vb = [6, 7, 11], $Vc = [1, 6, 13, 15, 16, 19, 22], $Vd = [1, 33], $Ve = [1, 34], $Vf = [1, 6, 7, 11, 13, 15, 16, 19, 22];
89
+ var parser2 = {
90
+ trace: /* @__PURE__ */ __name(function trace() {}, "trace"),
91
+ yy: {},
92
+ symbols_: { error: 2, start: 3, mindMap: 4, spaceLines: 5, SPACELINE: 6, NL: 7, MINDMAP: 8, document: 9, stop: 10, EOF: 11, statement: 12, SPACELIST: 13, node: 14, ICON: 15, CLASS: 16, nodeWithId: 17, nodeWithoutId: 18, NODE_DSTART: 19, NODE_DESCR: 20, NODE_DEND: 21, NODE_ID: 22, $accept: 0, $end: 1 },
93
+ terminals_: { 2: "error", 6: "SPACELINE", 7: "NL", 8: "MINDMAP", 11: "EOF", 13: "SPACELIST", 15: "ICON", 16: "CLASS", 19: "NODE_DSTART", 20: "NODE_DESCR", 21: "NODE_DEND", 22: "NODE_ID" },
94
+ productions_: [0, [3, 1], [3, 2], [5, 1], [5, 2], [5, 2], [4, 2], [4, 3], [10, 1], [10, 1], [10, 1], [10, 2], [10, 2], [9, 3], [9, 2], [12, 2], [12, 2], [12, 2], [12, 1], [12, 1], [12, 1], [12, 1], [12, 1], [14, 1], [14, 1], [18, 3], [17, 1], [17, 4]],
95
+ performAction: /* @__PURE__ */ __name(function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) {
96
+ var $0 = $$.length - 1;
97
+ switch (yystate) {
98
+ case 6:
99
+ case 7:
100
+ return yy;
101
+ break;
102
+ case 8:
103
+ yy.getLogger().trace("Stop NL ");
104
+ break;
105
+ case 9:
106
+ yy.getLogger().trace("Stop EOF ");
107
+ break;
108
+ case 11:
109
+ yy.getLogger().trace("Stop NL2 ");
110
+ break;
111
+ case 12:
112
+ yy.getLogger().trace("Stop EOF2 ");
113
+ break;
114
+ case 15:
115
+ yy.getLogger().info("Node: ", $$[$0].id);
116
+ yy.addNode($$[$0 - 1].length, $$[$0].id, $$[$0].descr, $$[$0].type);
117
+ break;
118
+ case 16:
119
+ yy.getLogger().trace("Icon: ", $$[$0]);
120
+ yy.decorateNode({ icon: $$[$0] });
121
+ break;
122
+ case 17:
123
+ case 21:
124
+ yy.decorateNode({ class: $$[$0] });
125
+ break;
126
+ case 18:
127
+ yy.getLogger().trace("SPACELIST");
128
+ break;
129
+ case 19:
130
+ yy.getLogger().trace("Node: ", $$[$0].id);
131
+ yy.addNode(0, $$[$0].id, $$[$0].descr, $$[$0].type);
132
+ break;
133
+ case 20:
134
+ yy.decorateNode({ icon: $$[$0] });
135
+ break;
136
+ case 25:
137
+ yy.getLogger().trace("node found ..", $$[$0 - 2]);
138
+ this.$ = { id: $$[$0 - 1], descr: $$[$0 - 1], type: yy.getType($$[$0 - 2], $$[$0]) };
139
+ break;
140
+ case 26:
141
+ this.$ = { id: $$[$0], descr: $$[$0], type: yy.nodeType.DEFAULT };
142
+ break;
143
+ case 27:
144
+ yy.getLogger().trace("node found ..", $$[$0 - 3]);
145
+ this.$ = { id: $$[$0 - 3], descr: $$[$0 - 1], type: yy.getType($$[$0 - 2], $$[$0]) };
146
+ break;
147
+ }
148
+ }, "anonymous"),
149
+ table: [{ 3: 1, 4: 2, 5: 3, 6: [1, 5], 8: $V0 }, { 1: [3] }, { 1: [2, 1] }, { 4: 6, 6: [1, 7], 7: [1, 8], 8: $V0 }, { 6: $V1, 7: [1, 10], 9: 9, 12: 11, 13: $V2, 14: 14, 15: $V3, 16: $V4, 17: 17, 18: 18, 19: $V5, 22: $V6 }, o($V7, [2, 3]), { 1: [2, 2] }, o($V7, [2, 4]), o($V7, [2, 5]), { 1: [2, 6], 6: $V1, 12: 21, 13: $V2, 14: 14, 15: $V3, 16: $V4, 17: 17, 18: 18, 19: $V5, 22: $V6 }, { 6: $V1, 9: 22, 12: 11, 13: $V2, 14: 14, 15: $V3, 16: $V4, 17: 17, 18: 18, 19: $V5, 22: $V6 }, { 6: $V8, 7: $V9, 10: 23, 11: $Va }, o($Vb, [2, 22], { 17: 17, 18: 18, 14: 27, 15: [1, 28], 16: [1, 29], 19: $V5, 22: $V6 }), o($Vb, [2, 18]), o($Vb, [2, 19]), o($Vb, [2, 20]), o($Vb, [2, 21]), o($Vb, [2, 23]), o($Vb, [2, 24]), o($Vb, [2, 26], { 19: [1, 30] }), { 20: [1, 31] }, { 6: $V8, 7: $V9, 10: 32, 11: $Va }, { 1: [2, 7], 6: $V1, 12: 21, 13: $V2, 14: 14, 15: $V3, 16: $V4, 17: 17, 18: 18, 19: $V5, 22: $V6 }, o($Vc, [2, 14], { 7: $Vd, 11: $Ve }), o($Vf, [2, 8]), o($Vf, [2, 9]), o($Vf, [2, 10]), o($Vb, [2, 15]), o($Vb, [2, 16]), o($Vb, [2, 17]), { 20: [1, 35] }, { 21: [1, 36] }, o($Vc, [2, 13], { 7: $Vd, 11: $Ve }), o($Vf, [2, 11]), o($Vf, [2, 12]), { 21: [1, 37] }, o($Vb, [2, 25]), o($Vb, [2, 27])],
150
+ defaultActions: { 2: [2, 1], 6: [2, 2] },
151
+ parseError: /* @__PURE__ */ __name(function parseError(str, hash) {
152
+ if (hash.recoverable) {
153
+ this.trace(str);
154
+ } else {
155
+ var error = new Error(str);
156
+ error.hash = hash;
157
+ throw error;
158
+ }
159
+ }, "parseError"),
160
+ parse: /* @__PURE__ */ __name(function parse(input) {
161
+ var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;
162
+ var args = lstack.slice.call(arguments, 1);
163
+ var lexer2 = Object.create(this.lexer);
164
+ var sharedState = { yy: {} };
165
+ for (var k in this.yy) {
166
+ if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
167
+ sharedState.yy[k] = this.yy[k];
168
+ }
169
+ }
170
+ lexer2.setInput(input, sharedState.yy);
171
+ sharedState.yy.lexer = lexer2;
172
+ sharedState.yy.parser = this;
173
+ if (typeof lexer2.yylloc == "undefined") {
174
+ lexer2.yylloc = {};
175
+ }
176
+ var yyloc = lexer2.yylloc;
177
+ lstack.push(yyloc);
178
+ var ranges = lexer2.options && lexer2.options.ranges;
179
+ if (typeof sharedState.yy.parseError === "function") {
180
+ this.parseError = sharedState.yy.parseError;
181
+ } else {
182
+ this.parseError = Object.getPrototypeOf(this).parseError;
183
+ }
184
+ function popStack(n) {
185
+ stack.length = stack.length - 2 * n;
186
+ vstack.length = vstack.length - n;
187
+ lstack.length = lstack.length - n;
188
+ }
189
+ __name(popStack, "popStack");
190
+ function lex() {
191
+ var token;
192
+ token = tstack.pop() || lexer2.lex() || EOF;
193
+ if (typeof token !== "number") {
194
+ if (token instanceof Array) {
195
+ tstack = token;
196
+ token = tstack.pop();
197
+ }
198
+ token = self.symbols_[token] || token;
199
+ }
200
+ return token;
201
+ }
202
+ __name(lex, "lex");
203
+ var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;
204
+ while (true) {
205
+ state = stack[stack.length - 1];
206
+ if (this.defaultActions[state]) {
207
+ action = this.defaultActions[state];
208
+ } else {
209
+ if (symbol === null || typeof symbol == "undefined") {
210
+ symbol = lex();
211
+ }
212
+ action = table[state] && table[state][symbol];
213
+ }
214
+ if (typeof action === "undefined" || !action.length || !action[0]) {
215
+ var errStr = "";
216
+ expected = [];
217
+ for (p in table[state]) {
218
+ if (this.terminals_[p] && p > TERROR) {
219
+ expected.push("'" + this.terminals_[p] + "'");
220
+ }
221
+ }
222
+ if (lexer2.showPosition) {
223
+ errStr = "Parse error on line " + (yylineno + 1) + `:
224
+ ` + lexer2.showPosition() + `
225
+ Expecting ` + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
226
+ } else {
227
+ errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'");
228
+ }
229
+ this.parseError(errStr, {
230
+ text: lexer2.match,
231
+ token: this.terminals_[symbol] || symbol,
232
+ line: lexer2.yylineno,
233
+ loc: yyloc,
234
+ expected
235
+ });
236
+ }
237
+ if (action[0] instanceof Array && action.length > 1) {
238
+ throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
239
+ }
240
+ switch (action[0]) {
241
+ case 1:
242
+ stack.push(symbol);
243
+ vstack.push(lexer2.yytext);
244
+ lstack.push(lexer2.yylloc);
245
+ stack.push(action[1]);
246
+ symbol = null;
247
+ if (!preErrorSymbol) {
248
+ yyleng = lexer2.yyleng;
249
+ yytext = lexer2.yytext;
250
+ yylineno = lexer2.yylineno;
251
+ yyloc = lexer2.yylloc;
252
+ if (recovering > 0) {
253
+ recovering--;
254
+ }
255
+ } else {
256
+ symbol = preErrorSymbol;
257
+ preErrorSymbol = null;
258
+ }
259
+ break;
260
+ case 2:
261
+ len = this.productions_[action[1]][1];
262
+ yyval.$ = vstack[vstack.length - len];
263
+ yyval._$ = {
264
+ first_line: lstack[lstack.length - (len || 1)].first_line,
265
+ last_line: lstack[lstack.length - 1].last_line,
266
+ first_column: lstack[lstack.length - (len || 1)].first_column,
267
+ last_column: lstack[lstack.length - 1].last_column
268
+ };
269
+ if (ranges) {
270
+ yyval._$.range = [
271
+ lstack[lstack.length - (len || 1)].range[0],
272
+ lstack[lstack.length - 1].range[1]
273
+ ];
274
+ }
275
+ r = this.performAction.apply(yyval, [
276
+ yytext,
277
+ yyleng,
278
+ yylineno,
279
+ sharedState.yy,
280
+ action[1],
281
+ vstack,
282
+ lstack
283
+ ].concat(args));
284
+ if (typeof r !== "undefined") {
285
+ return r;
286
+ }
287
+ if (len) {
288
+ stack = stack.slice(0, -1 * len * 2);
289
+ vstack = vstack.slice(0, -1 * len);
290
+ lstack = lstack.slice(0, -1 * len);
291
+ }
292
+ stack.push(this.productions_[action[1]][0]);
293
+ vstack.push(yyval.$);
294
+ lstack.push(yyval._$);
295
+ newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
296
+ stack.push(newState);
297
+ break;
298
+ case 3:
299
+ return true;
300
+ }
301
+ }
302
+ return true;
303
+ }, "parse")
304
+ };
305
+ var lexer = /* @__PURE__ */ function() {
306
+ var lexer2 = {
307
+ EOF: 1,
308
+ parseError: /* @__PURE__ */ __name(function parseError(str, hash) {
309
+ if (this.yy.parser) {
310
+ this.yy.parser.parseError(str, hash);
311
+ } else {
312
+ throw new Error(str);
313
+ }
314
+ }, "parseError"),
315
+ setInput: /* @__PURE__ */ __name(function(input, yy) {
316
+ this.yy = yy || this.yy || {};
317
+ this._input = input;
318
+ this._more = this._backtrack = this.done = false;
319
+ this.yylineno = this.yyleng = 0;
320
+ this.yytext = this.matched = this.match = "";
321
+ this.conditionStack = ["INITIAL"];
322
+ this.yylloc = {
323
+ first_line: 1,
324
+ first_column: 0,
325
+ last_line: 1,
326
+ last_column: 0
327
+ };
328
+ if (this.options.ranges) {
329
+ this.yylloc.range = [0, 0];
330
+ }
331
+ this.offset = 0;
332
+ return this;
333
+ }, "setInput"),
334
+ input: /* @__PURE__ */ __name(function() {
335
+ var ch = this._input[0];
336
+ this.yytext += ch;
337
+ this.yyleng++;
338
+ this.offset++;
339
+ this.match += ch;
340
+ this.matched += ch;
341
+ var lines = ch.match(/(?:\r\n?|\n).*/g);
342
+ if (lines) {
343
+ this.yylineno++;
344
+ this.yylloc.last_line++;
345
+ } else {
346
+ this.yylloc.last_column++;
347
+ }
348
+ if (this.options.ranges) {
349
+ this.yylloc.range[1]++;
350
+ }
351
+ this._input = this._input.slice(1);
352
+ return ch;
353
+ }, "input"),
354
+ unput: /* @__PURE__ */ __name(function(ch) {
355
+ var len = ch.length;
356
+ var lines = ch.split(/(?:\r\n?|\n)/g);
357
+ this._input = ch + this._input;
358
+ this.yytext = this.yytext.substr(0, this.yytext.length - len);
359
+ this.offset -= len;
360
+ var oldLines = this.match.split(/(?:\r\n?|\n)/g);
361
+ this.match = this.match.substr(0, this.match.length - 1);
362
+ this.matched = this.matched.substr(0, this.matched.length - 1);
363
+ if (lines.length - 1) {
364
+ this.yylineno -= lines.length - 1;
365
+ }
366
+ var r = this.yylloc.range;
367
+ this.yylloc = {
368
+ first_line: this.yylloc.first_line,
369
+ last_line: this.yylineno + 1,
370
+ first_column: this.yylloc.first_column,
371
+ 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
372
+ };
373
+ if (this.options.ranges) {
374
+ this.yylloc.range = [r[0], r[0] + this.yyleng - len];
375
+ }
376
+ this.yyleng = this.yytext.length;
377
+ return this;
378
+ }, "unput"),
379
+ more: /* @__PURE__ */ __name(function() {
380
+ this._more = true;
381
+ return this;
382
+ }, "more"),
383
+ reject: /* @__PURE__ */ __name(function() {
384
+ if (this.options.backtrack_lexer) {
385
+ this._backtrack = true;
386
+ } else {
387
+ 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).
388
+ ` + this.showPosition(), {
389
+ text: "",
390
+ token: null,
391
+ line: this.yylineno
392
+ });
393
+ }
394
+ return this;
395
+ }, "reject"),
396
+ less: /* @__PURE__ */ __name(function(n) {
397
+ this.unput(this.match.slice(n));
398
+ }, "less"),
399
+ pastInput: /* @__PURE__ */ __name(function() {
400
+ var past = this.matched.substr(0, this.matched.length - this.match.length);
401
+ return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, "");
402
+ }, "pastInput"),
403
+ upcomingInput: /* @__PURE__ */ __name(function() {
404
+ var next = this.match;
405
+ if (next.length < 20) {
406
+ next += this._input.substr(0, 20 - next.length);
407
+ }
408
+ return (next.substr(0, 20) + (next.length > 20 ? "..." : "")).replace(/\n/g, "");
409
+ }, "upcomingInput"),
410
+ showPosition: /* @__PURE__ */ __name(function() {
411
+ var pre = this.pastInput();
412
+ var c = new Array(pre.length + 1).join("-");
413
+ return pre + this.upcomingInput() + `
414
+ ` + c + "^";
415
+ }, "showPosition"),
416
+ test_match: /* @__PURE__ */ __name(function(match, indexed_rule) {
417
+ var token, lines, backup;
418
+ if (this.options.backtrack_lexer) {
419
+ backup = {
420
+ yylineno: this.yylineno,
421
+ yylloc: {
422
+ first_line: this.yylloc.first_line,
423
+ last_line: this.last_line,
424
+ first_column: this.yylloc.first_column,
425
+ last_column: this.yylloc.last_column
426
+ },
427
+ yytext: this.yytext,
428
+ match: this.match,
429
+ matches: this.matches,
430
+ matched: this.matched,
431
+ yyleng: this.yyleng,
432
+ offset: this.offset,
433
+ _more: this._more,
434
+ _input: this._input,
435
+ yy: this.yy,
436
+ conditionStack: this.conditionStack.slice(0),
437
+ done: this.done
438
+ };
439
+ if (this.options.ranges) {
440
+ backup.yylloc.range = this.yylloc.range.slice(0);
441
+ }
442
+ }
443
+ lines = match[0].match(/(?:\r\n?|\n).*/g);
444
+ if (lines) {
445
+ this.yylineno += lines.length;
446
+ }
447
+ this.yylloc = {
448
+ first_line: this.yylloc.last_line,
449
+ last_line: this.yylineno + 1,
450
+ first_column: this.yylloc.last_column,
451
+ last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length
452
+ };
453
+ this.yytext += match[0];
454
+ this.match += match[0];
455
+ this.matches = match;
456
+ this.yyleng = this.yytext.length;
457
+ if (this.options.ranges) {
458
+ this.yylloc.range = [this.offset, this.offset += this.yyleng];
459
+ }
460
+ this._more = false;
461
+ this._backtrack = false;
462
+ this._input = this._input.slice(match[0].length);
463
+ this.matched += match[0];
464
+ token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
465
+ if (this.done && this._input) {
466
+ this.done = false;
467
+ }
468
+ if (token) {
469
+ return token;
470
+ } else if (this._backtrack) {
471
+ for (var k in backup) {
472
+ this[k] = backup[k];
473
+ }
474
+ return false;
475
+ }
476
+ return false;
477
+ }, "test_match"),
478
+ next: /* @__PURE__ */ __name(function() {
479
+ if (this.done) {
480
+ return this.EOF;
481
+ }
482
+ if (!this._input) {
483
+ this.done = true;
484
+ }
485
+ var token, match, tempMatch, index;
486
+ if (!this._more) {
487
+ this.yytext = "";
488
+ this.match = "";
489
+ }
490
+ var rules = this._currentRules();
491
+ for (var i = 0;i < rules.length; i++) {
492
+ tempMatch = this._input.match(this.rules[rules[i]]);
493
+ if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
494
+ match = tempMatch;
495
+ index = i;
496
+ if (this.options.backtrack_lexer) {
497
+ token = this.test_match(tempMatch, rules[i]);
498
+ if (token !== false) {
499
+ return token;
500
+ } else if (this._backtrack) {
501
+ match = false;
502
+ continue;
503
+ } else {
504
+ return false;
505
+ }
506
+ } else if (!this.options.flex) {
507
+ break;
508
+ }
509
+ }
510
+ }
511
+ if (match) {
512
+ token = this.test_match(match, rules[index]);
513
+ if (token !== false) {
514
+ return token;
515
+ }
516
+ return false;
517
+ }
518
+ if (this._input === "") {
519
+ return this.EOF;
520
+ } else {
521
+ return this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
522
+ ` + this.showPosition(), {
523
+ text: "",
524
+ token: null,
525
+ line: this.yylineno
526
+ });
527
+ }
528
+ }, "next"),
529
+ lex: /* @__PURE__ */ __name(function lex() {
530
+ var r = this.next();
531
+ if (r) {
532
+ return r;
533
+ } else {
534
+ return this.lex();
535
+ }
536
+ }, "lex"),
537
+ begin: /* @__PURE__ */ __name(function begin(condition) {
538
+ this.conditionStack.push(condition);
539
+ }, "begin"),
540
+ popState: /* @__PURE__ */ __name(function popState() {
541
+ var n = this.conditionStack.length - 1;
542
+ if (n > 0) {
543
+ return this.conditionStack.pop();
544
+ } else {
545
+ return this.conditionStack[0];
546
+ }
547
+ }, "popState"),
548
+ _currentRules: /* @__PURE__ */ __name(function _currentRules() {
549
+ if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
550
+ return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
551
+ } else {
552
+ return this.conditions["INITIAL"].rules;
553
+ }
554
+ }, "_currentRules"),
555
+ topState: /* @__PURE__ */ __name(function topState(n) {
556
+ n = this.conditionStack.length - 1 - Math.abs(n || 0);
557
+ if (n >= 0) {
558
+ return this.conditionStack[n];
559
+ } else {
560
+ return "INITIAL";
561
+ }
562
+ }, "topState"),
563
+ pushState: /* @__PURE__ */ __name(function pushState(condition) {
564
+ this.begin(condition);
565
+ }, "pushState"),
566
+ stateStackSize: /* @__PURE__ */ __name(function stateStackSize() {
567
+ return this.conditionStack.length;
568
+ }, "stateStackSize"),
569
+ options: { "case-insensitive": true },
570
+ performAction: /* @__PURE__ */ __name(function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
571
+ var YYSTATE = YY_START;
572
+ switch ($avoiding_name_collisions) {
573
+ case 0:
574
+ yy.getLogger().trace("Found comment", yy_.yytext);
575
+ return 6;
576
+ break;
577
+ case 1:
578
+ return 8;
579
+ break;
580
+ case 2:
581
+ this.begin("CLASS");
582
+ break;
583
+ case 3:
584
+ this.popState();
585
+ return 16;
586
+ break;
587
+ case 4:
588
+ this.popState();
589
+ break;
590
+ case 5:
591
+ yy.getLogger().trace("Begin icon");
592
+ this.begin("ICON");
593
+ break;
594
+ case 6:
595
+ yy.getLogger().trace("SPACELINE");
596
+ return 6;
597
+ break;
598
+ case 7:
599
+ return 7;
600
+ break;
601
+ case 8:
602
+ return 15;
603
+ break;
604
+ case 9:
605
+ yy.getLogger().trace("end icon");
606
+ this.popState();
607
+ break;
608
+ case 10:
609
+ yy.getLogger().trace("Exploding node");
610
+ this.begin("NODE");
611
+ return 19;
612
+ break;
613
+ case 11:
614
+ yy.getLogger().trace("Cloud");
615
+ this.begin("NODE");
616
+ return 19;
617
+ break;
618
+ case 12:
619
+ yy.getLogger().trace("Explosion Bang");
620
+ this.begin("NODE");
621
+ return 19;
622
+ break;
623
+ case 13:
624
+ yy.getLogger().trace("Cloud Bang");
625
+ this.begin("NODE");
626
+ return 19;
627
+ break;
628
+ case 14:
629
+ this.begin("NODE");
630
+ return 19;
631
+ break;
632
+ case 15:
633
+ this.begin("NODE");
634
+ return 19;
635
+ break;
636
+ case 16:
637
+ this.begin("NODE");
638
+ return 19;
639
+ break;
640
+ case 17:
641
+ this.begin("NODE");
642
+ return 19;
643
+ break;
644
+ case 18:
645
+ return 13;
646
+ break;
647
+ case 19:
648
+ return 22;
649
+ break;
650
+ case 20:
651
+ return 11;
652
+ break;
653
+ case 21:
654
+ this.begin("NSTR2");
655
+ break;
656
+ case 22:
657
+ return "NODE_DESCR";
658
+ break;
659
+ case 23:
660
+ this.popState();
661
+ break;
662
+ case 24:
663
+ yy.getLogger().trace("Starting NSTR");
664
+ this.begin("NSTR");
665
+ break;
666
+ case 25:
667
+ yy.getLogger().trace("description:", yy_.yytext);
668
+ return "NODE_DESCR";
669
+ break;
670
+ case 26:
671
+ this.popState();
672
+ break;
673
+ case 27:
674
+ this.popState();
675
+ yy.getLogger().trace("node end ))");
676
+ return "NODE_DEND";
677
+ break;
678
+ case 28:
679
+ this.popState();
680
+ yy.getLogger().trace("node end )");
681
+ return "NODE_DEND";
682
+ break;
683
+ case 29:
684
+ this.popState();
685
+ yy.getLogger().trace("node end ...", yy_.yytext);
686
+ return "NODE_DEND";
687
+ break;
688
+ case 30:
689
+ this.popState();
690
+ yy.getLogger().trace("node end ((");
691
+ return "NODE_DEND";
692
+ break;
693
+ case 31:
694
+ this.popState();
695
+ yy.getLogger().trace("node end (-");
696
+ return "NODE_DEND";
697
+ break;
698
+ case 32:
699
+ this.popState();
700
+ yy.getLogger().trace("node end (-");
701
+ return "NODE_DEND";
702
+ break;
703
+ case 33:
704
+ this.popState();
705
+ yy.getLogger().trace("node end ((");
706
+ return "NODE_DEND";
707
+ break;
708
+ case 34:
709
+ this.popState();
710
+ yy.getLogger().trace("node end ((");
711
+ return "NODE_DEND";
712
+ break;
713
+ case 35:
714
+ yy.getLogger().trace("Long description:", yy_.yytext);
715
+ return 20;
716
+ break;
717
+ case 36:
718
+ yy.getLogger().trace("Long description:", yy_.yytext);
719
+ return 20;
720
+ break;
721
+ }
722
+ }, "anonymous"),
723
+ rules: [/^(?:\s*%%.*)/i, /^(?:mindmap\b)/i, /^(?::::)/i, /^(?:.+)/i, /^(?:\n)/i, /^(?:::icon\()/i, /^(?:[\s]+[\n])/i, /^(?:[\n]+)/i, /^(?:[^\)]+)/i, /^(?:\))/i, /^(?:-\))/i, /^(?:\(-)/i, /^(?:\)\))/i, /^(?:\))/i, /^(?:\(\()/i, /^(?:\{\{)/i, /^(?:\()/i, /^(?:\[)/i, /^(?:[\s]+)/i, /^(?:[^\(\[\n\)\{\}]+)/i, /^(?:$)/i, /^(?:["][`])/i, /^(?:[^`"]+)/i, /^(?:[`]["])/i, /^(?:["])/i, /^(?:[^"]+)/i, /^(?:["])/i, /^(?:[\)]\))/i, /^(?:[\)])/i, /^(?:[\]])/i, /^(?:\}\})/i, /^(?:\(-)/i, /^(?:-\))/i, /^(?:\(\()/i, /^(?:\()/i, /^(?:[^\)\]\(\}]+)/i, /^(?:.+(?!\(\())/i],
724
+ conditions: { CLASS: { rules: [3, 4], inclusive: false }, ICON: { rules: [8, 9], inclusive: false }, NSTR2: { rules: [22, 23], inclusive: false }, NSTR: { rules: [25, 26], inclusive: false }, NODE: { rules: [21, 24, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36], inclusive: false }, INITIAL: { rules: [0, 1, 2, 5, 6, 7, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20], inclusive: true } }
725
+ };
726
+ return lexer2;
727
+ }();
728
+ parser2.lexer = lexer;
729
+ function Parser() {
730
+ this.yy = {};
731
+ }
732
+ __name(Parser, "Parser");
733
+ Parser.prototype = parser2;
734
+ parser2.Parser = Parser;
735
+ return new Parser;
736
+ }();
737
+ parser.parser = parser;
738
+ var mindmap_default = parser;
739
+ var MAX_SECTIONS = 12;
740
+ var nodeType = {
741
+ DEFAULT: 0,
742
+ NO_BORDER: 0,
743
+ ROUNDED_RECT: 1,
744
+ RECT: 2,
745
+ CIRCLE: 3,
746
+ CLOUD: 4,
747
+ BANG: 5,
748
+ HEXAGON: 6
749
+ };
750
+ var MindmapDB = class {
751
+ constructor() {
752
+ this.nodes = [];
753
+ this.count = 0;
754
+ this.elements = {};
755
+ this.getLogger = this.getLogger.bind(this);
756
+ this.nodeType = nodeType;
757
+ this.clear();
758
+ this.getType = this.getType.bind(this);
759
+ this.getElementById = this.getElementById.bind(this);
760
+ this.getParent = this.getParent.bind(this);
761
+ this.getMindmap = this.getMindmap.bind(this);
762
+ this.addNode = this.addNode.bind(this);
763
+ this.decorateNode = this.decorateNode.bind(this);
764
+ }
765
+ static {
766
+ __name(this, "MindmapDB");
767
+ }
768
+ clear() {
769
+ this.nodes = [];
770
+ this.count = 0;
771
+ this.elements = {};
772
+ this.baseLevel = undefined;
773
+ }
774
+ getParent(level) {
775
+ for (let i = this.nodes.length - 1;i >= 0; i--) {
776
+ if (this.nodes[i].level < level) {
777
+ return this.nodes[i];
778
+ }
779
+ }
780
+ return null;
781
+ }
782
+ getMindmap() {
783
+ return this.nodes.length > 0 ? this.nodes[0] : null;
784
+ }
785
+ addNode(level, id, descr, type) {
786
+ log.info("addNode", level, id, descr, type);
787
+ let isRoot = false;
788
+ if (this.nodes.length === 0) {
789
+ this.baseLevel = level;
790
+ level = 0;
791
+ isRoot = true;
792
+ } else if (this.baseLevel !== undefined) {
793
+ level = level - this.baseLevel;
794
+ isRoot = false;
795
+ }
796
+ const conf = getConfig2();
797
+ let padding = conf.mindmap?.padding ?? defaultConfig_default.mindmap.padding;
798
+ switch (type) {
799
+ case this.nodeType.ROUNDED_RECT:
800
+ case this.nodeType.RECT:
801
+ case this.nodeType.HEXAGON:
802
+ padding *= 2;
803
+ break;
804
+ }
805
+ const node = {
806
+ id: this.count++,
807
+ nodeId: sanitizeText(id, conf),
808
+ level,
809
+ descr: sanitizeText(descr, conf),
810
+ type,
811
+ children: [],
812
+ width: conf.mindmap?.maxNodeWidth ?? defaultConfig_default.mindmap.maxNodeWidth,
813
+ padding,
814
+ isRoot
815
+ };
816
+ const parent = this.getParent(level);
817
+ if (parent) {
818
+ parent.children.push(node);
819
+ this.nodes.push(node);
820
+ } else {
821
+ if (isRoot) {
822
+ this.nodes.push(node);
823
+ } else {
824
+ throw new Error(`There can be only one root. No parent could be found for ("${node.descr}")`);
825
+ }
826
+ }
827
+ }
828
+ getType(startStr, endStr) {
829
+ log.debug("In get type", startStr, endStr);
830
+ switch (startStr) {
831
+ case "[":
832
+ return this.nodeType.RECT;
833
+ case "(":
834
+ return endStr === ")" ? this.nodeType.ROUNDED_RECT : this.nodeType.CLOUD;
835
+ case "((":
836
+ return this.nodeType.CIRCLE;
837
+ case ")":
838
+ return this.nodeType.CLOUD;
839
+ case "))":
840
+ return this.nodeType.BANG;
841
+ case "{{":
842
+ return this.nodeType.HEXAGON;
843
+ default:
844
+ return this.nodeType.DEFAULT;
845
+ }
846
+ }
847
+ setElementForId(id, element) {
848
+ this.elements[id] = element;
849
+ }
850
+ getElementById(id) {
851
+ return this.elements[id];
852
+ }
853
+ decorateNode(decoration) {
854
+ if (!decoration) {
855
+ return;
856
+ }
857
+ const config = getConfig2();
858
+ const node = this.nodes[this.nodes.length - 1];
859
+ if (decoration.icon) {
860
+ node.icon = sanitizeText(decoration.icon, config);
861
+ }
862
+ if (decoration.class) {
863
+ node.class = sanitizeText(decoration.class, config);
864
+ }
865
+ }
866
+ type2Str(type) {
867
+ switch (type) {
868
+ case this.nodeType.DEFAULT:
869
+ return "no-border";
870
+ case this.nodeType.RECT:
871
+ return "rect";
872
+ case this.nodeType.ROUNDED_RECT:
873
+ return "rounded-rect";
874
+ case this.nodeType.CIRCLE:
875
+ return "circle";
876
+ case this.nodeType.CLOUD:
877
+ return "cloud";
878
+ case this.nodeType.BANG:
879
+ return "bang";
880
+ case this.nodeType.HEXAGON:
881
+ return "hexgon";
882
+ default:
883
+ return "no-border";
884
+ }
885
+ }
886
+ assignSections(node, sectionNumber) {
887
+ if (node.level === 0) {
888
+ node.section = undefined;
889
+ } else {
890
+ node.section = sectionNumber;
891
+ }
892
+ if (node.children) {
893
+ for (const [index, child] of node.children.entries()) {
894
+ const childSectionNumber = node.level === 0 ? index % (MAX_SECTIONS - 1) : sectionNumber;
895
+ this.assignSections(child, childSectionNumber);
896
+ }
897
+ }
898
+ }
899
+ flattenNodes(node, processedNodes) {
900
+ const conf = getConfig2();
901
+ const cssClasses = ["mindmap-node"];
902
+ if (node.isRoot === true) {
903
+ cssClasses.push("section-root", "section--1");
904
+ } else if (node.section !== undefined) {
905
+ cssClasses.push(`section-${node.section}`);
906
+ }
907
+ if (node.class) {
908
+ cssClasses.push(node.class);
909
+ }
910
+ const classes = cssClasses.join(" ");
911
+ const getShapeFromType = /* @__PURE__ */ __name((type) => {
912
+ const theme = conf.theme?.toLowerCase() ?? "";
913
+ const isReduxTheme = theme.includes("redux");
914
+ switch (type) {
915
+ case nodeType.CIRCLE:
916
+ return "mindmapCircle";
917
+ case nodeType.RECT:
918
+ return "rect";
919
+ case nodeType.ROUNDED_RECT:
920
+ return "rounded";
921
+ case nodeType.CLOUD:
922
+ return "cloud";
923
+ case nodeType.BANG:
924
+ return "bang";
925
+ case nodeType.HEXAGON:
926
+ return "hexagon";
927
+ case nodeType.DEFAULT:
928
+ return isReduxTheme ? "rounded" : "defaultMindmapNode";
929
+ case nodeType.NO_BORDER:
930
+ default:
931
+ return "rect";
932
+ }
933
+ }, "getShapeFromType");
934
+ const processedNode = {
935
+ id: node.id.toString(),
936
+ domId: "node_" + node.id.toString(),
937
+ label: node.descr,
938
+ labelType: "markdown",
939
+ isGroup: false,
940
+ shape: getShapeFromType(node.type),
941
+ width: node.width,
942
+ height: node.height ?? 0,
943
+ padding: node.padding,
944
+ cssClasses: classes,
945
+ cssStyles: [],
946
+ look: conf.look,
947
+ icon: node.icon,
948
+ x: node.x,
949
+ y: node.y,
950
+ level: node.level,
951
+ nodeId: node.nodeId,
952
+ type: node.type,
953
+ section: node.section
954
+ };
955
+ processedNodes.push(processedNode);
956
+ if (node.children) {
957
+ for (const child of node.children) {
958
+ this.flattenNodes(child, processedNodes);
959
+ }
960
+ }
961
+ }
962
+ generateEdges(node, edges) {
963
+ if (!node.children) {
964
+ return;
965
+ }
966
+ const conf = getConfig2();
967
+ for (const child of node.children) {
968
+ let edgeClasses = "edge";
969
+ if (child.section !== undefined) {
970
+ edgeClasses += ` section-edge-${child.section}`;
971
+ }
972
+ const edgeDepth = node.level + 1;
973
+ edgeClasses += ` edge-depth-${edgeDepth}`;
974
+ const edge = {
975
+ id: `edge_${node.id}_${child.id}`,
976
+ start: node.id.toString(),
977
+ end: child.id.toString(),
978
+ type: "normal",
979
+ curve: "basis",
980
+ thickness: "normal",
981
+ look: conf.look,
982
+ classes: edgeClasses,
983
+ depth: node.level,
984
+ section: child.section
985
+ };
986
+ edges.push(edge);
987
+ this.generateEdges(child, edges);
988
+ }
989
+ }
990
+ getData() {
991
+ const mindmapRoot = this.getMindmap();
992
+ const config = getConfig2();
993
+ const userDefinedConfig = getUserDefinedConfig();
994
+ const hasUserDefinedLayout = userDefinedConfig.layout !== undefined;
995
+ const finalConfig = config;
996
+ if (!hasUserDefinedLayout) {
997
+ finalConfig.layout = "cose-bilkent";
998
+ }
999
+ if (!mindmapRoot) {
1000
+ return {
1001
+ nodes: [],
1002
+ edges: [],
1003
+ config: finalConfig
1004
+ };
1005
+ }
1006
+ log.debug("getData: mindmapRoot", mindmapRoot, config);
1007
+ this.assignSections(mindmapRoot);
1008
+ const processedNodes = [];
1009
+ const processedEdges = [];
1010
+ this.flattenNodes(mindmapRoot, processedNodes);
1011
+ this.generateEdges(mindmapRoot, processedEdges);
1012
+ log.debug(`getData: processed ${processedNodes.length} nodes and ${processedEdges.length} edges`);
1013
+ const shapes = /* @__PURE__ */ new Map;
1014
+ for (const node of processedNodes) {
1015
+ shapes.set(node.id, {
1016
+ shape: node.shape,
1017
+ width: node.width,
1018
+ height: node.height,
1019
+ padding: node.padding
1020
+ });
1021
+ }
1022
+ return {
1023
+ nodes: processedNodes,
1024
+ edges: processedEdges,
1025
+ config: finalConfig,
1026
+ rootNode: mindmapRoot,
1027
+ markers: ["point"],
1028
+ direction: "TB",
1029
+ nodeSpacing: 50,
1030
+ rankSpacing: 50,
1031
+ shapes: Object.fromEntries(shapes),
1032
+ type: "mindmap",
1033
+ diagramId: "mindmap-" + v4_default()
1034
+ };
1035
+ }
1036
+ getLogger() {
1037
+ return log;
1038
+ }
1039
+ };
1040
+ var draw = /* @__PURE__ */ __name(async (text, id, _version, diagObj) => {
1041
+ log.debug(`Rendering mindmap diagram
1042
+ ` + text);
1043
+ const db = diagObj.db;
1044
+ const data4Layout = db.getData();
1045
+ const svg = getDiagramElement(id, data4Layout.config.securityLevel);
1046
+ data4Layout.type = diagObj.type;
1047
+ data4Layout.layoutAlgorithm = getRegisteredLayoutAlgorithm(data4Layout.config.layout, {
1048
+ fallback: "cose-bilkent"
1049
+ });
1050
+ data4Layout.diagramId = id;
1051
+ const mm = db.getMindmap();
1052
+ if (!mm) {
1053
+ return;
1054
+ }
1055
+ data4Layout.nodes.forEach((node) => {
1056
+ if (node.shape === "rounded") {
1057
+ node.radius = 15;
1058
+ node.taper = 15;
1059
+ node.stroke = "none";
1060
+ node.width = 0;
1061
+ node.padding = 15;
1062
+ } else if (node.shape === "circle") {
1063
+ node.padding = 10;
1064
+ } else if (node.shape === "rect") {
1065
+ node.width = 0;
1066
+ node.padding = 10;
1067
+ } else if (node.shape === "hexagon") {
1068
+ node.width = 0;
1069
+ node.height = 0;
1070
+ }
1071
+ });
1072
+ await render(data4Layout, svg);
1073
+ const { themeVariables } = getConfig();
1074
+ const { useGradient, gradientStart, gradientStop } = themeVariables;
1075
+ if (useGradient && gradientStart && gradientStop) {
1076
+ const svgId = svg.attr("id");
1077
+ const gradient = svg.append("defs").append("linearGradient").attr("id", `${svgId}-gradient`).attr("gradientUnits", "objectBoundingBox").attr("x1", "0%").attr("y1", "0%").attr("x2", "100%").attr("y2", "0%");
1078
+ gradient.append("stop").attr("offset", "0%").attr("stop-color", gradientStart).attr("stop-opacity", 1);
1079
+ gradient.append("stop").attr("offset", "100%").attr("stop-color", gradientStop).attr("stop-opacity", 1);
1080
+ }
1081
+ setupViewPortForSVG(svg, data4Layout.config.mindmap?.padding ?? defaultConfig_default.mindmap.padding, "mindmapDiagram", data4Layout.config.mindmap?.useMaxWidth ?? defaultConfig_default.mindmap.useMaxWidth);
1082
+ }, "draw");
1083
+ var mindmapRenderer_default = {
1084
+ draw
1085
+ };
1086
+ var genSections = /* @__PURE__ */ __name((options) => {
1087
+ const { theme, look } = options;
1088
+ let sections = "";
1089
+ for (let i = 0;i < options.THEME_COLOR_LIMIT; i++) {
1090
+ options["lineColor" + i] = options["lineColor" + i] || options["cScaleInv" + i];
1091
+ if (is_dark_default(options["lineColor" + i])) {
1092
+ options["lineColor" + i] = lighten_default(options["lineColor" + i], 20);
1093
+ } else {
1094
+ options["lineColor" + i] = darken_default(options["lineColor" + i], 20);
1095
+ }
1096
+ }
1097
+ for (let i = 0;i < options.THEME_COLOR_LIMIT; i++) {
1098
+ const sw = "" + (look === "neo" ? Math.max(10 - (i - 1) * 2, 2) : 17 - 3 * i);
1099
+ sections += `
1100
+ .section-${i - 1} rect, .section-${i - 1} path, .section-${i - 1} circle, .section-${i - 1} polygon, .section-${i - 1} path {
1101
+ fill: ${options["cScale" + i]};
1102
+ }
1103
+ .section-${i - 1} text {
1104
+ fill: ${options["cScaleLabel" + i]};
1105
+ }
1106
+ .section-${i - 1} span {
1107
+ color: ${options["cScaleLabel" + i]};
1108
+ }
1109
+ .node-icon-${i - 1} {
1110
+ font-size: 40px;
1111
+ color: ${options["cScaleLabel" + i]};
1112
+ }
1113
+ .section-edge-${i - 1}{
1114
+ stroke: ${options["cScale" + i]};
1115
+ }
1116
+ .edge-depth-${i - 1}{
1117
+ stroke-width: ${sw};
1118
+ }
1119
+ .section-${i - 1} line {
1120
+ stroke: ${options["cScaleInv" + i]} ;
1121
+ stroke-width: 3;
1122
+ }
1123
+
1124
+ .disabled, .disabled circle, .disabled text {
1125
+ fill: lightgray;
1126
+ }
1127
+ .disabled text {
1128
+ fill: #efefef;
1129
+ }
1130
+ [data-look="neo"].mindmap-node.section-${i - 1} rect, [data-look="neo"].mindmap-node.section-${i - 1} path, [data-look="neo"].mindmap-node.section-${i - 1} circle, [data-look="neo"].mindmap-node.section-${i - 1} polygon {
1131
+ fill: ${theme === "redux" || theme === "redux-dark" || theme === "neutral" ? options.mainBkg : options["cScale" + i]};
1132
+ stroke: ${theme === "redux" || theme === "redux-dark" ? options.nodeBorder : options["cScale" + i]};
1133
+ stroke-width: ${options.strokeWidth ?? 2}px;
1134
+ }
1135
+ [data-look="neo"].section-edge-${i - 1}{
1136
+ stroke: ${theme?.includes("redux") || theme === "neo-dark" ? options.nodeBorder : options["cScale" + i]};
1137
+ }
1138
+ [data-look="neo"].mindmap-node.section-${i - 1} text {
1139
+ fill: ${theme === "redux" || theme === "redux-dark" ? options.nodeBorder : options["cScaleLabel" + (theme === "neutral" ? 1 : i)]};
1140
+ }
1141
+ `;
1142
+ }
1143
+ return sections;
1144
+ }, "genSections");
1145
+ var genGradient = /* @__PURE__ */ __name((THEME_COLOR_LIMIT, svgId, mainBkg) => {
1146
+ let sections = "";
1147
+ for (let i = 0;i < THEME_COLOR_LIMIT; i++) {
1148
+ sections += `
1149
+ [data-look="neo"].mindmap-node.section-${i - 1} rect, [data-look="neo"].mindmap-node.section-${i - 1} path, [data-look="neo"].mindmap-node.section-${i - 1} circle, [data-look="neo"].mindmap-node.section-${i - 1} polygon {
1150
+ stroke: url(${svgId}-gradient);
1151
+ fill: ${mainBkg};
1152
+ }
1153
+ .section-${i - 1} line {
1154
+ stroke-width: 0;
1155
+ }`;
1156
+ }
1157
+ return sections;
1158
+ }, "genGradient");
1159
+ var getStyles = /* @__PURE__ */ __name((options) => {
1160
+ const { theme } = options;
1161
+ const svgId = options.svgId;
1162
+ const scopedDropShadow = options.dropShadow ? options.dropShadow.replace("url(#drop-shadow)", `url(${svgId}-drop-shadow)`) : "none";
1163
+ return `
1164
+ .edge {
1165
+ stroke-width: 3;
1166
+ }
1167
+ ${genSections(options)}
1168
+ .section-root rect, .section-root path, .section-root circle, .section-root polygon {
1169
+ fill: ${options.git0};
1170
+ }
1171
+ .section-root text {
1172
+ fill: ${options.gitBranchLabel0};
1173
+ }
1174
+ .section-root span {
1175
+ color: ${theme?.includes("redux") ? options.nodeBorder : options.gitBranchLabel0};
1176
+ }
1177
+ .icon-container {
1178
+ height:100%;
1179
+ display: flex;
1180
+ justify-content: center;
1181
+ align-items: center;
1182
+ }
1183
+ .edge {
1184
+ fill: none;
1185
+ }
1186
+ .mindmap-node-label {
1187
+ dy: 1em;
1188
+ alignment-baseline: middle;
1189
+ text-anchor: middle;
1190
+ dominant-baseline: middle;
1191
+ text-align: center;
1192
+ }
1193
+ [data-look="neo"].mindmap-node {
1194
+ filter: ${scopedDropShadow};
1195
+ }
1196
+ [data-look="neo"].mindmap-node.section-root rect, [data-look="neo"].mindmap-node.section-root path, [data-look="neo"].mindmap-node.section-root circle, [data-look="neo"].mindmap-node.section-root polygon {
1197
+ fill: ${theme?.includes("redux") ? options.mainBkg : options.git0};
1198
+ }
1199
+ [data-look="neo"].mindmap-node.section-root .text-inner-tspan {
1200
+ fill: ${theme?.includes("redux") ? options.nodeBorder : options["cScaleLabel" + (theme === "neutral" ? 1 : 0)]};
1201
+ }
1202
+ ${options.useGradient && svgId && options.mainBkg ? genGradient(options.THEME_COLOR_LIMIT, svgId, options.mainBkg) : ""}
1203
+ `;
1204
+ }, "getStyles");
1205
+ var styles_default = getStyles;
1206
+ var diagram = {
1207
+ get db() {
1208
+ return new MindmapDB;
1209
+ },
1210
+ renderer: mindmapRenderer_default,
1211
+ parser: mindmap_default,
1212
+ styles: styles_default
1213
+ };
1214
+ export {
1215
+ diagram
1216
+ };