jekyll-ham 1.0.4 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (366) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +11 -2
  3. data/_layouts/default.html +6 -0
  4. data/_layouts/page.html +1 -1
  5. data/assets/mermaid/Diagram.d.ts +33 -0
  6. data/assets/mermaid/Tableau10-31042135.js +10 -0
  7. data/assets/mermaid/Tableau10-558cc280.js +9 -0
  8. data/assets/mermaid/__mocks__/mermaidAPI.d.ts +13 -0
  9. data/assets/mermaid/accessibility.d.ts +27 -0
  10. data/assets/mermaid/accessibility.spec.d.ts +1 -0
  11. data/assets/mermaid/arc-c0f908ab.js +148 -0
  12. data/assets/mermaid/arc-d1f6357e.js +86 -0
  13. data/assets/mermaid/array-2ff2c7a6.js +6 -0
  14. data/assets/mermaid/array-b7dcf730.js +6 -0
  15. data/assets/mermaid/assignWithDepth.d.ts +30 -0
  16. data/assets/mermaid/blockDiagram-5dc23a45.js +1230 -0
  17. data/assets/mermaid/blockDiagram-9f4a6865.js +1822 -0
  18. data/assets/mermaid/blockDiagram-efe38566.js +1818 -0
  19. data/assets/mermaid/c4Diagram-1e775db3.js +1579 -0
  20. data/assets/mermaid/c4Diagram-ae766693.js +2473 -0
  21. data/assets/mermaid/c4Diagram-af207393.js +2463 -0
  22. data/assets/mermaid/channel-ebbc4130.js +5 -0
  23. data/assets/mermaid/channel-f9001828.js +8 -0
  24. data/assets/mermaid/classDiagram-72b9c71d.js +356 -0
  25. data/assets/mermaid/classDiagram-f52caa06.js +220 -0
  26. data/assets/mermaid/classDiagram-fb54d2a0.js +363 -0
  27. data/assets/mermaid/classDiagram-v2-640c694e.js +206 -0
  28. data/assets/mermaid/classDiagram-v2-a2b738ad.js +298 -0
  29. data/assets/mermaid/classDiagram-v2-fedb80f6.js +290 -0
  30. data/assets/mermaid/clone-9ea6bfeb.js +8 -0
  31. data/assets/mermaid/clone-afc2f047.js +8 -0
  32. data/assets/mermaid/config.d.ts +98 -0
  33. data/assets/mermaid/config.spec.d.ts +1 -0
  34. data/assets/mermaid/config.type.d.ts +1534 -0
  35. data/assets/mermaid/createText-03b82060.js +2966 -0
  36. data/assets/mermaid/createText-b70fe78a.js +4929 -0
  37. data/assets/mermaid/createText-ca0c5216.js +251 -0
  38. data/assets/mermaid/dagre-wrapper/blockArrowHelper.d.ts +8 -0
  39. data/assets/mermaid/dagre-wrapper/clusters.d.ts +4 -0
  40. data/assets/mermaid/dagre-wrapper/createLabel.d.ts +9 -0
  41. data/assets/mermaid/dagre-wrapper/edgeMarker.d.ts +12 -0
  42. data/assets/mermaid/dagre-wrapper/edgeMarker.spec.d.ts +1 -0
  43. data/assets/mermaid/dagre-wrapper/edges.d.ts +14 -0
  44. data/assets/mermaid/dagre-wrapper/index.d.ts +1 -0
  45. data/assets/mermaid/dagre-wrapper/intersect/index.d.ts +13 -0
  46. data/assets/mermaid/dagre-wrapper/intersect/intersect-circle.d.ts +10 -0
  47. data/assets/mermaid/dagre-wrapper/intersect/intersect-ellipse.d.ts +11 -0
  48. data/assets/mermaid/dagre-wrapper/intersect/intersect-line.d.ts +13 -0
  49. data/assets/mermaid/dagre-wrapper/intersect/intersect-node.d.ts +6 -0
  50. data/assets/mermaid/dagre-wrapper/intersect/intersect-polygon.d.ts +10 -0
  51. data/assets/mermaid/dagre-wrapper/intersect/intersect-rect.d.ts +5 -0
  52. data/assets/mermaid/dagre-wrapper/markers.d.ts +2 -0
  53. data/assets/mermaid/dagre-wrapper/mermaid-graphlib.d.ts +8 -0
  54. data/assets/mermaid/dagre-wrapper/nodes.d.ts +4 -0
  55. data/assets/mermaid/dagre-wrapper/shapes/note.d.ts +2 -0
  56. data/assets/mermaid/dagre-wrapper/shapes/util.d.ts +14 -0
  57. data/assets/mermaid/defaultConfig.d.ts +12 -0
  58. data/assets/mermaid/diagram-api/comments.d.ts +6 -0
  59. data/assets/mermaid/diagram-api/comments.spec.d.ts +1 -0
  60. data/assets/mermaid/diagram-api/detectType.d.ts +42 -0
  61. data/assets/mermaid/diagram-api/diagram-orchestration.d.ts +1 -0
  62. data/assets/mermaid/diagram-api/diagram-orchestration.spec.d.ts +1 -0
  63. data/assets/mermaid/diagram-api/diagramAPI.d.ts +31 -0
  64. data/assets/mermaid/diagram-api/diagramAPI.spec.d.ts +1 -0
  65. data/assets/mermaid/diagram-api/frontmatter.d.ts +18 -0
  66. data/assets/mermaid/diagram-api/frontmatter.spec.d.ts +1 -0
  67. data/assets/mermaid/diagram-api/loadDiagram.d.ts +1 -0
  68. data/assets/mermaid/diagram-api/regexes.d.ts +3 -0
  69. data/assets/mermaid/diagram-api/types.d.ts +84 -0
  70. data/assets/mermaid/diagram.spec.d.ts +1 -0
  71. data/assets/mermaid/diagrams/block/blockDB.d.ts +54 -0
  72. data/assets/mermaid/diagrams/block/blockDetector.d.ts +3 -0
  73. data/assets/mermaid/diagrams/block/blockDiagram.d.ts +2 -0
  74. data/assets/mermaid/diagrams/block/blockRenderer.d.ts +15 -0
  75. data/assets/mermaid/diagrams/block/blockTypes.d.ts +36 -0
  76. data/assets/mermaid/diagrams/block/blockUtils.d.ts +1 -0
  77. data/assets/mermaid/diagrams/block/layout.d.ts +13 -0
  78. data/assets/mermaid/diagrams/block/layout.spec.d.ts +1 -0
  79. data/assets/mermaid/diagrams/block/parser/block.spec.d.ts +1 -0
  80. data/assets/mermaid/diagrams/block/renderHelpers.d.ts +10 -0
  81. data/assets/mermaid/diagrams/block/styles.d.ts +18 -0
  82. data/assets/mermaid/diagrams/c4/c4Db.d.ts +127 -0
  83. data/assets/mermaid/diagrams/c4/c4Detector.d.ts +3 -0
  84. data/assets/mermaid/diagrams/c4/c4Diagram.d.ts +2 -0
  85. data/assets/mermaid/diagrams/c4/c4Renderer.d.ts +12 -0
  86. data/assets/mermaid/diagrams/c4/styles.d.ts +2 -0
  87. data/assets/mermaid/diagrams/c4/svgDraw.d.ts +36 -0
  88. data/assets/mermaid/diagrams/class/classDb.d.ts +144 -0
  89. data/assets/mermaid/diagrams/class/classDetector-V2.d.ts +3 -0
  90. data/assets/mermaid/diagrams/class/classDetector.d.ts +3 -0
  91. data/assets/mermaid/diagrams/class/classDiagram-v2.d.ts +2 -0
  92. data/assets/mermaid/diagrams/class/classDiagram.d.ts +2 -0
  93. data/assets/mermaid/diagrams/class/classDiagram.spec.d.ts +1 -0
  94. data/assets/mermaid/diagrams/class/classRenderer-v2.d.ts +57 -0
  95. data/assets/mermaid/diagrams/class/classRenderer.d.ts +5 -0
  96. data/assets/mermaid/diagrams/class/classTypes.d.ts +78 -0
  97. data/assets/mermaid/diagrams/class/classTypes.spec.d.ts +1 -0
  98. data/assets/mermaid/diagrams/class/styles.d.ts +2 -0
  99. data/assets/mermaid/diagrams/class/svgDraw.d.ts +25 -0
  100. data/assets/mermaid/diagrams/common/common.d.ts +110 -0
  101. data/assets/mermaid/diagrams/common/common.spec.d.ts +1 -0
  102. data/assets/mermaid/diagrams/common/commonDb.d.ts +7 -0
  103. data/assets/mermaid/diagrams/common/commonTypes.d.ts +51 -0
  104. data/assets/mermaid/diagrams/common/svgDrawCommon.d.ts +15 -0
  105. data/assets/mermaid/diagrams/er/erDb.d.ts +49 -0
  106. data/assets/mermaid/diagrams/er/erDetector.d.ts +3 -0
  107. data/assets/mermaid/diagrams/er/erDiagram.d.ts +34 -0
  108. data/assets/mermaid/diagrams/er/erMarkers.d.ts +24 -0
  109. data/assets/mermaid/diagrams/er/erRenderer.d.ts +19 -0
  110. data/assets/mermaid/diagrams/er/erRenderer.spec.d.ts +1 -0
  111. data/assets/mermaid/diagrams/er/styles.d.ts +2 -0
  112. data/assets/mermaid/diagrams/error/errorDiagram.d.ts +3 -0
  113. data/assets/mermaid/diagrams/error/errorRenderer.d.ts +12 -0
  114. data/assets/mermaid/diagrams/flowchart/elk/detector.d.ts +3 -0
  115. data/assets/mermaid/diagrams/flowchart/elk/detector.spec.d.ts +1 -0
  116. data/assets/mermaid/diagrams/flowchart/elk/flowRenderer-elk.d.ts +10 -0
  117. data/assets/mermaid/diagrams/flowchart/elk/flowchart-elk-definition.d.ts +10 -0
  118. data/assets/mermaid/diagrams/flowchart/elk/render-utils.d.ts +5 -0
  119. data/assets/mermaid/diagrams/flowchart/elk/render-utils.spec.d.ts +1 -0
  120. data/assets/mermaid/diagrams/flowchart/elk/styles.d.ts +19 -0
  121. data/assets/mermaid/diagrams/flowchart/flowChartShapes.d.ts +9 -0
  122. data/assets/mermaid/diagrams/flowchart/flowDb.d.ts +87 -0
  123. data/assets/mermaid/diagrams/flowchart/flowDetector-v2.d.ts +3 -0
  124. data/assets/mermaid/diagrams/flowchart/flowDetector.d.ts +3 -0
  125. data/assets/mermaid/diagrams/flowchart/flowDiagram-v2.d.ts +57 -0
  126. data/assets/mermaid/diagrams/flowchart/flowDiagram.d.ts +57 -0
  127. data/assets/mermaid/diagrams/flowchart/flowRenderer-v2.d.ts +13 -0
  128. data/assets/mermaid/diagrams/flowchart/flowRenderer.d.ts +13 -0
  129. data/assets/mermaid/diagrams/flowchart/styles.d.ts +18 -0
  130. data/assets/mermaid/diagrams/gantt/ganttDb.d.ts +106 -0
  131. data/assets/mermaid/diagrams/gantt/ganttDb.spec.d.ts +1 -0
  132. data/assets/mermaid/diagrams/gantt/ganttDetector.d.ts +3 -0
  133. data/assets/mermaid/diagrams/gantt/ganttDiagram.d.ts +2 -0
  134. data/assets/mermaid/diagrams/gantt/ganttRenderer.d.ts +7 -0
  135. data/assets/mermaid/diagrams/gantt/styles.d.ts +2 -0
  136. data/assets/mermaid/diagrams/git/gitGraphAst.d.ts +61 -0
  137. data/assets/mermaid/diagrams/git/gitGraphDetector.d.ts +3 -0
  138. data/assets/mermaid/diagrams/git/gitGraphDiagram.d.ts +2 -0
  139. data/assets/mermaid/diagrams/git/gitGraphRenderer.d.ts +5 -0
  140. data/assets/mermaid/diagrams/git/styles.d.ts +2 -0
  141. data/assets/mermaid/diagrams/info/info.spec.d.ts +1 -0
  142. data/assets/mermaid/diagrams/info/infoDb.d.ts +5 -0
  143. data/assets/mermaid/diagrams/info/infoDetector.d.ts +2 -0
  144. data/assets/mermaid/diagrams/info/infoDiagram.d.ts +2 -0
  145. data/assets/mermaid/diagrams/info/infoRenderer.d.ts +4 -0
  146. data/assets/mermaid/diagrams/info/infoTypes.d.ts +9 -0
  147. data/assets/mermaid/diagrams/mindmap/detector.d.ts +3 -0
  148. data/assets/mermaid/diagrams/mindmap/mindmap-definition.d.ts +2 -0
  149. data/assets/mermaid/diagrams/mindmap/mindmap.spec.d.ts +1 -0
  150. data/assets/mermaid/diagrams/mindmap/mindmapDb.d.ts +30 -0
  151. data/assets/mermaid/diagrams/mindmap/mindmapRenderer.d.ts +21 -0
  152. data/assets/mermaid/diagrams/mindmap/mindmapTypes.d.ts +20 -0
  153. data/assets/mermaid/diagrams/mindmap/styles.d.ts +3 -0
  154. data/assets/mermaid/diagrams/mindmap/svgDraw.d.ts +13 -0
  155. data/assets/mermaid/diagrams/pie/pie.spec.d.ts +1 -0
  156. data/assets/mermaid/diagrams/pie/pieDb.d.ts +6 -0
  157. data/assets/mermaid/diagrams/pie/pieDetector.d.ts +2 -0
  158. data/assets/mermaid/diagrams/pie/pieDiagram.d.ts +2 -0
  159. data/assets/mermaid/diagrams/pie/pieRenderer.d.ts +13 -0
  160. data/assets/mermaid/diagrams/pie/pieStyles.d.ts +3 -0
  161. data/assets/mermaid/diagrams/pie/pieTypes.d.ts +53 -0
  162. data/assets/mermaid/diagrams/quadrant-chart/parser/quadrant.jison.spec.d.ts +1 -0
  163. data/assets/mermaid/diagrams/quadrant-chart/quadrantBuilder.d.ts +118 -0
  164. data/assets/mermaid/diagrams/quadrant-chart/quadrantDb.d.ts +38 -0
  165. data/assets/mermaid/diagrams/quadrant-chart/quadrantDetector.d.ts +3 -0
  166. data/assets/mermaid/diagrams/quadrant-chart/quadrantDiagram.d.ts +2 -0
  167. data/assets/mermaid/diagrams/quadrant-chart/quadrantRenderer.d.ts +6 -0
  168. data/assets/mermaid/diagrams/requirement/requirementDb.d.ts +70 -0
  169. data/assets/mermaid/diagrams/requirement/requirementDetector.d.ts +3 -0
  170. data/assets/mermaid/diagrams/requirement/requirementDiagram.d.ts +2 -0
  171. data/assets/mermaid/diagrams/requirement/requirementMarkers.d.ts +10 -0
  172. data/assets/mermaid/diagrams/requirement/requirementRenderer.d.ts +7 -0
  173. data/assets/mermaid/diagrams/requirement/styles.d.ts +2 -0
  174. data/assets/mermaid/diagrams/sankey/parser/sankey.spec.d.ts +1 -0
  175. data/assets/mermaid/diagrams/sankey/sankeyDB.d.ts +36 -0
  176. data/assets/mermaid/diagrams/sankey/sankeyDetector.d.ts +3 -0
  177. data/assets/mermaid/diagrams/sankey/sankeyDiagram.d.ts +2 -0
  178. data/assets/mermaid/diagrams/sankey/sankeyRenderer.d.ts +14 -0
  179. data/assets/mermaid/diagrams/sankey/sankeyUtils.d.ts +1 -0
  180. data/assets/mermaid/diagrams/sequence/sequenceDb.d.ts +153 -0
  181. data/assets/mermaid/diagrams/sequence/sequenceDetector.d.ts +3 -0
  182. data/assets/mermaid/diagrams/sequence/sequenceDiagram.d.ts +2 -0
  183. data/assets/mermaid/diagrams/sequence/sequenceRenderer.d.ts +202 -0
  184. data/assets/mermaid/diagrams/sequence/styles.d.ts +2 -0
  185. data/assets/mermaid/diagrams/sequence/svgDraw.d.ts +73 -0
  186. data/assets/mermaid/diagrams/state/id-cache.d.ts +11 -0
  187. data/assets/mermaid/diagrams/state/shapes.d.ts +14 -0
  188. data/assets/mermaid/diagrams/state/stateCommon.d.ts +22 -0
  189. data/assets/mermaid/diagrams/state/stateDb.d.ts +91 -0
  190. data/assets/mermaid/diagrams/state/stateDetector-V2.d.ts +3 -0
  191. data/assets/mermaid/diagrams/state/stateDetector.d.ts +3 -0
  192. data/assets/mermaid/diagrams/state/stateDiagram-v2.d.ts +2 -0
  193. data/assets/mermaid/diagrams/state/stateDiagram.d.ts +2 -0
  194. data/assets/mermaid/diagrams/state/stateRenderer-v2.d.ts +20 -0
  195. data/assets/mermaid/diagrams/state/stateRenderer.d.ts +7 -0
  196. data/assets/mermaid/diagrams/state/styles.d.ts +2 -0
  197. data/assets/mermaid/diagrams/timeline/detector.d.ts +3 -0
  198. data/assets/mermaid/diagrams/timeline/styles.d.ts +2 -0
  199. data/assets/mermaid/diagrams/timeline/svgDraw.d.ts +46 -0
  200. data/assets/mermaid/diagrams/timeline/timeline-definition.d.ts +10 -0
  201. data/assets/mermaid/diagrams/timeline/timelineDb.d.ts +20 -0
  202. data/assets/mermaid/diagrams/timeline/timelineRenderer.d.ts +19 -0
  203. data/assets/mermaid/diagrams/user-journey/journeyDb.d.ts +30 -0
  204. data/assets/mermaid/diagrams/user-journey/journeyDetector.d.ts +3 -0
  205. data/assets/mermaid/diagrams/user-journey/journeyDiagram.d.ts +2 -0
  206. data/assets/mermaid/diagrams/user-journey/journeyRenderer.d.ts +30 -0
  207. data/assets/mermaid/diagrams/user-journey/styles.d.ts +2 -0
  208. data/assets/mermaid/diagrams/user-journey/svgDraw.d.ts +20 -0
  209. data/assets/mermaid/diagrams/xychart/chartBuilder/components/axis/bandAxis.d.ts +12 -0
  210. data/assets/mermaid/diagrams/xychart/chartBuilder/components/axis/baseAxis.d.ts +38 -0
  211. data/assets/mermaid/diagrams/xychart/chartBuilder/components/axis/index.d.ts +12 -0
  212. data/assets/mermaid/diagrams/xychart/chartBuilder/components/axis/linearAxis.d.ts +11 -0
  213. data/assets/mermaid/diagrams/xychart/chartBuilder/components/chartTitle.d.ts +16 -0
  214. data/assets/mermaid/diagrams/xychart/chartBuilder/components/plot/barPlot.d.ts +12 -0
  215. data/assets/mermaid/diagrams/xychart/chartBuilder/components/plot/index.d.ts +20 -0
  216. data/assets/mermaid/diagrams/xychart/chartBuilder/components/plot/linePlot.d.ts +11 -0
  217. data/assets/mermaid/diagrams/xychart/chartBuilder/index.d.ts +5 -0
  218. data/assets/mermaid/diagrams/xychart/chartBuilder/interfaces.d.ts +132 -0
  219. data/assets/mermaid/diagrams/xychart/chartBuilder/orchestrator.d.ts +12 -0
  220. data/assets/mermaid/diagrams/xychart/chartBuilder/textDimensionCalculator.d.ts +10 -0
  221. data/assets/mermaid/diagrams/xychart/parser/xychart.jison.spec.d.ts +1 -0
  222. data/assets/mermaid/diagrams/xychart/xychartDb.d.ts +40 -0
  223. data/assets/mermaid/diagrams/xychart/xychartDetector.d.ts +3 -0
  224. data/assets/mermaid/diagrams/xychart/xychartDiagram.d.ts +2 -0
  225. data/assets/mermaid/diagrams/xychart/xychartRenderer.d.ts +6 -0
  226. data/assets/mermaid/docs/vite.config.d.ts +2 -0
  227. data/assets/mermaid/edges-066a5561.js +1840 -0
  228. data/assets/mermaid/edges-16357fde.js +1083 -0
  229. data/assets/mermaid/edges-ce5cfb7c.js +1840 -0
  230. data/assets/mermaid/erDiagram-09d1c15f.js +1176 -0
  231. data/assets/mermaid/erDiagram-543717f2.js +1321 -0
  232. data/assets/mermaid/erDiagram-c7ff1bec.js +931 -0
  233. data/assets/mermaid/errors.d.ts +3 -0
  234. data/assets/mermaid/flowDb-9a89ea33.js +1126 -0
  235. data/assets/mermaid/flowDb-ba9bd7fa.js +1713 -0
  236. data/assets/mermaid/flowDb-c1833063.js +1714 -0
  237. data/assets/mermaid/flowDiagram-aadb13b0.js +797 -0
  238. data/assets/mermaid/flowDiagram-b222e15a.js +614 -0
  239. data/assets/mermaid/flowDiagram-b5e7ba30.js +1278 -0
  240. data/assets/mermaid/flowDiagram-v2-13329dc7.js +40 -0
  241. data/assets/mermaid/flowDiagram-v2-54711e03.js +32 -0
  242. data/assets/mermaid/flowDiagram-v2-f2119625.js +25 -0
  243. data/assets/mermaid/flowchart-elk-definition-2d49707c.js +93397 -0
  244. data/assets/mermaid/flowchart-elk-definition-ae0efee6.js +814 -0
  245. data/assets/mermaid/flowchart-elk-definition-cf813a97.js +48407 -0
  246. data/assets/mermaid/ganttDiagram-12cf43db.js +3445 -0
  247. data/assets/mermaid/ganttDiagram-3c2fde2b.js +2501 -0
  248. data/assets/mermaid/ganttDiagram-b62c793e.js +2061 -0
  249. data/assets/mermaid/gitGraphDiagram-942e62fe.js +1800 -0
  250. data/assets/mermaid/gitGraphDiagram-b9392a12.js +1790 -0
  251. data/assets/mermaid/gitGraphDiagram-c3a0619c.js +1264 -0
  252. data/assets/mermaid/graph-0ee63739.js +881 -0
  253. data/assets/mermaid/graph-fe24fab6.js +1285 -0
  254. data/assets/mermaid/index-01f381cb.js +622 -0
  255. data/assets/mermaid/index-bb6d8841.js +373 -0
  256. data/assets/mermaid/index-fc479858.js +663 -0
  257. data/assets/mermaid/infoDiagram-2f5c50c0.js +319 -0
  258. data/assets/mermaid/infoDiagram-94cd232f.js +520 -0
  259. data/assets/mermaid/infoDiagram-d0d5c9bd.js +510 -0
  260. data/assets/mermaid/init-cc95ec8e.js +16 -0
  261. data/assets/mermaid/init-f9637058.js +16 -0
  262. data/assets/mermaid/interactionDb.d.ts +2 -0
  263. data/assets/mermaid/journeyDiagram-14fe341a.js +804 -0
  264. data/assets/mermaid/journeyDiagram-6625b456.js +1191 -0
  265. data/assets/mermaid/journeyDiagram-b56e6921.js +1183 -0
  266. data/assets/mermaid/katex-d90b6d29.js +11624 -0
  267. data/assets/mermaid/katex-ffb0e8f1.js +14432 -0
  268. data/assets/mermaid/layout-163b9689.js +2314 -0
  269. data/assets/mermaid/layout-fd473db2.js +1536 -0
  270. data/assets/mermaid/line-24d93f1b.js +34 -0
  271. data/assets/mermaid/line-87f517ef.js +50 -0
  272. data/assets/mermaid/linear-0ad15847.js +595 -0
  273. data/assets/mermaid/linear-9bcf74c4.js +447 -0
  274. data/assets/mermaid/logger.d.ts +9 -0
  275. data/assets/mermaid/mermaid-6dc72991.js +6461 -0
  276. data/assets/mermaid/mermaid-9f2aa176.js +8112 -0
  277. data/assets/mermaid/mermaid-dcacb631.js +12793 -0
  278. data/assets/mermaid/mermaid.core.mjs +14 -0
  279. data/assets/mermaid/mermaid.d.ts +146 -0
  280. data/assets/mermaid/mermaid.esm.min.mjs +4 -0
  281. data/assets/mermaid/mermaid.esm.mjs +4 -0
  282. data/assets/mermaid/mermaid.js +195755 -0
  283. data/assets/mermaid/mermaid.min.js +2029 -0
  284. data/assets/mermaid/mermaid.spec.d.ts +1 -0
  285. data/assets/mermaid/mermaidAPI.d.ts +170 -0
  286. data/assets/mermaid/mermaidAPI.spec.d.ts +1 -0
  287. data/assets/mermaid/mindmap-definition-307c710a.js +1177 -0
  288. data/assets/mermaid/mindmap-definition-696ddea4.js +32342 -0
  289. data/assets/mermaid/mindmap-definition-9399c7e6.js +18760 -0
  290. data/assets/mermaid/ordinal-475e0c0c.js +82 -0
  291. data/assets/mermaid/ordinal-5695958c.js +65 -0
  292. data/assets/mermaid/path-39bad7e2.js +118 -0
  293. data/assets/mermaid/path-428ebac9.js +91 -0
  294. data/assets/mermaid/pieDiagram-828dae43.js +502 -0
  295. data/assets/mermaid/pieDiagram-bb1d19e5.js +722 -0
  296. data/assets/mermaid/pieDiagram-e854eaf0.js +772 -0
  297. data/assets/mermaid/preprocess.d.ts +10 -0
  298. data/assets/mermaid/quadrantDiagram-25a9848b.js +1199 -0
  299. data/assets/mermaid/quadrantDiagram-5fa00455.js +904 -0
  300. data/assets/mermaid/quadrantDiagram-c759a472.js +1207 -0
  301. data/assets/mermaid/rendering-util/createText.d.ts +11 -0
  302. data/assets/mermaid/rendering-util/handle-markdown-text.d.ts +6 -0
  303. data/assets/mermaid/rendering-util/handle-markdown-text.spec.d.ts +1 -0
  304. data/assets/mermaid/rendering-util/selectSvgElement.d.ts +8 -0
  305. data/assets/mermaid/rendering-util/splitText.d.ts +24 -0
  306. data/assets/mermaid/rendering-util/splitText.spec.d.ts +1 -0
  307. data/assets/mermaid/rendering-util/uid.d.ts +8 -0
  308. data/assets/mermaid/requirementDiagram-03163dc4.js +769 -0
  309. data/assets/mermaid/requirementDiagram-87253d64.js +1098 -0
  310. data/assets/mermaid/requirementDiagram-a721e157.js +1091 -0
  311. data/assets/mermaid/sankeyDiagram-33525efb.js +1198 -0
  312. data/assets/mermaid/sankeyDiagram-52ec8976.js +818 -0
  313. data/assets/mermaid/sankeyDiagram-707fac0f.js +660 -0
  314. data/assets/mermaid/sequenceDiagram-6894f283.js +3346 -0
  315. data/assets/mermaid/sequenceDiagram-9813c129.js +3336 -0
  316. data/assets/mermaid/sequenceDiagram-b517d154.js +2234 -0
  317. data/assets/mermaid/setupGraphViewbox.d.ts +3 -0
  318. data/assets/mermaid/stateDiagram-5dee940d.js +474 -0
  319. data/assets/mermaid/stateDiagram-5ec31577.js +467 -0
  320. data/assets/mermaid/stateDiagram-fca82b5b.js +275 -0
  321. data/assets/mermaid/stateDiagram-v2-1992cada.js +333 -0
  322. data/assets/mermaid/stateDiagram-v2-992e82a1.js +325 -0
  323. data/assets/mermaid/stateDiagram-v2-ed04200a.js +190 -0
  324. data/assets/mermaid/styles-0784dbeb.js +1363 -0
  325. data/assets/mermaid/styles-11e81fdd.js +1089 -0
  326. data/assets/mermaid/styles-36a1a2e8.js +1483 -0
  327. data/assets/mermaid/styles-483fbfea.js +509 -0
  328. data/assets/mermaid/styles-727cdd61.js +571 -0
  329. data/assets/mermaid/styles-b83b31c9.js +1484 -0
  330. data/assets/mermaid/styles-cacbff60.js +960 -0
  331. data/assets/mermaid/styles-e75131e4.js +433 -0
  332. data/assets/mermaid/styles-f80da881.js +1363 -0
  333. data/assets/mermaid/styles.d.ts +12 -0
  334. data/assets/mermaid/styles.spec.d.ts +1 -0
  335. data/assets/mermaid/svgDrawCommon-5e1cfd1d.js +101 -0
  336. data/assets/mermaid/svgDrawCommon-d6ab583c.js +100 -0
  337. data/assets/mermaid/svgDrawCommon-ecc5f780.js +64 -0
  338. data/assets/mermaid/tests/MockedD3.d.ts +45 -0
  339. data/assets/mermaid/tests/setup.d.ts +1 -0
  340. data/assets/mermaid/tests/util.d.ts +3 -0
  341. data/assets/mermaid/themes/erDiagram-oldHardcodedValues.d.ts +7 -0
  342. data/assets/mermaid/themes/index.d.ts +24 -0
  343. data/assets/mermaid/themes/theme-base.d.ts +189 -0
  344. data/assets/mermaid/themes/theme-dark.d.ts +177 -0
  345. data/assets/mermaid/themes/theme-default.d.ts +188 -0
  346. data/assets/mermaid/themes/theme-forest.d.ts +185 -0
  347. data/assets/mermaid/themes/theme-helpers.d.ts +1 -0
  348. data/assets/mermaid/themes/theme-neutral.d.ts +182 -0
  349. data/assets/mermaid/timeline-definition-23ce0e2e.js +1211 -0
  350. data/assets/mermaid/timeline-definition-4ee9bff4.js +795 -0
  351. data/assets/mermaid/timeline-definition-bf702344.js +1219 -0
  352. data/assets/mermaid/types.d.ts +31 -0
  353. data/assets/mermaid/utils/imperativeState.d.ts +32 -0
  354. data/assets/mermaid/utils/imperativeState.spec.d.ts +1 -0
  355. data/assets/mermaid/utils/lineWithOffset.d.ts +5 -0
  356. data/assets/mermaid/utils/sanitizeDirective.d.ts +7 -0
  357. data/assets/mermaid/utils/subGraphTitleMargins.d.ts +8 -0
  358. data/assets/mermaid/utils/subGraphTitleMargins.spec.d.ts +1 -0
  359. data/assets/mermaid/utils.d.ts +286 -0
  360. data/assets/mermaid/utils.spec.d.ts +1 -0
  361. data/assets/mermaid/xychartDiagram-de2e5521.js +1800 -0
  362. data/assets/mermaid/xychartDiagram-e5e6b652.js +1284 -0
  363. data/assets/mermaid/xychartDiagram-f11f50a6.js +1745 -0
  364. data/assets/tables.css +23 -0
  365. data/assets/toURI.js +142 -0
  366. metadata +363 -2
@@ -0,0 +1,1818 @@
1
+ var _a, _b;
2
+ import { c as getConfig, _ as getConfig$1, l as log, E as clear$1, f as common, B as rgba, o as getStylesFromArray, j as d3select, k as configureSvgSize } from "./mermaid-dcacb631.js";
3
+ import { c as clone } from "./clone-9ea6bfeb.js";
4
+ import { c as channel } from "./channel-f9001828.js";
5
+ import { h as insertEdge, f as insertEdgeLabel, j as positionEdgeLabel, e as insertNode, p as positionNode, a as insertMarkers } from "./edges-ce5cfb7c.js";
6
+ import { G as Graph } from "./graph-fe24fab6.js";
7
+ import { o as ordinal } from "./ordinal-475e0c0c.js";
8
+ import { d as d3schemeTableau10 } from "./Tableau10-31042135.js";
9
+ import "./createText-b70fe78a.js";
10
+ import "./line-87f517ef.js";
11
+ import "./array-b7dcf730.js";
12
+ import "./path-39bad7e2.js";
13
+ import "./init-cc95ec8e.js";
14
+ var parser = function() {
15
+ var o = function(k, v, o2, l) {
16
+ for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v)
17
+ ;
18
+ return o2;
19
+ }, $V0 = [1, 7], $V1 = [1, 13], $V2 = [1, 14], $V3 = [1, 15], $V4 = [1, 19], $V5 = [1, 16], $V6 = [1, 17], $V7 = [1, 18], $V8 = [8, 30], $V9 = [8, 21, 28, 29, 30, 31, 32, 40, 44, 47], $Va = [1, 23], $Vb = [1, 24], $Vc = [8, 15, 16, 21, 28, 29, 30, 31, 32, 40, 44, 47], $Vd = [8, 15, 16, 21, 27, 28, 29, 30, 31, 32, 40, 44, 47], $Ve = [1, 49];
20
+ var parser2 = {
21
+ trace: function trace() {
22
+ },
23
+ yy: {},
24
+ symbols_: { "error": 2, "spaceLines": 3, "SPACELINE": 4, "NL": 5, "separator": 6, "SPACE": 7, "EOF": 8, "start": 9, "BLOCK_DIAGRAM_KEY": 10, "document": 11, "stop": 12, "statement": 13, "link": 14, "LINK": 15, "START_LINK": 16, "LINK_LABEL": 17, "STR": 18, "nodeStatement": 19, "columnsStatement": 20, "SPACE_BLOCK": 21, "blockStatement": 22, "classDefStatement": 23, "cssClassStatement": 24, "styleStatement": 25, "node": 26, "SIZE": 27, "COLUMNS": 28, "id-block": 29, "end": 30, "block": 31, "NODE_ID": 32, "nodeShapeNLabel": 33, "dirList": 34, "DIR": 35, "NODE_DSTART": 36, "NODE_DEND": 37, "BLOCK_ARROW_START": 38, "BLOCK_ARROW_END": 39, "classDef": 40, "CLASSDEF_ID": 41, "CLASSDEF_STYLEOPTS": 42, "DEFAULT": 43, "class": 44, "CLASSENTITY_IDS": 45, "STYLECLASS": 46, "style": 47, "STYLE_ENTITY_IDS": 48, "STYLE_DEFINITION_DATA": 49, "$accept": 0, "$end": 1 },
25
+ terminals_: { 2: "error", 4: "SPACELINE", 5: "NL", 7: "SPACE", 8: "EOF", 10: "BLOCK_DIAGRAM_KEY", 15: "LINK", 16: "START_LINK", 17: "LINK_LABEL", 18: "STR", 21: "SPACE_BLOCK", 27: "SIZE", 28: "COLUMNS", 29: "id-block", 30: "end", 31: "block", 32: "NODE_ID", 35: "DIR", 36: "NODE_DSTART", 37: "NODE_DEND", 38: "BLOCK_ARROW_START", 39: "BLOCK_ARROW_END", 40: "classDef", 41: "CLASSDEF_ID", 42: "CLASSDEF_STYLEOPTS", 43: "DEFAULT", 44: "class", 45: "CLASSENTITY_IDS", 46: "STYLECLASS", 47: "style", 48: "STYLE_ENTITY_IDS", 49: "STYLE_DEFINITION_DATA" },
26
+ productions_: [0, [3, 1], [3, 2], [3, 2], [6, 1], [6, 1], [6, 1], [9, 3], [12, 1], [12, 1], [12, 2], [12, 2], [11, 1], [11, 2], [14, 1], [14, 4], [13, 1], [13, 1], [13, 1], [13, 1], [13, 1], [13, 1], [13, 1], [19, 3], [19, 2], [19, 1], [20, 1], [22, 4], [22, 3], [26, 1], [26, 2], [34, 1], [34, 2], [33, 3], [33, 4], [23, 3], [23, 3], [24, 3], [25, 3]],
27
+ performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) {
28
+ var $0 = $$.length - 1;
29
+ switch (yystate) {
30
+ case 4:
31
+ yy.getLogger().debug("Rule: separator (NL) ");
32
+ break;
33
+ case 5:
34
+ yy.getLogger().debug("Rule: separator (Space) ");
35
+ break;
36
+ case 6:
37
+ yy.getLogger().debug("Rule: separator (EOF) ");
38
+ break;
39
+ case 7:
40
+ yy.getLogger().debug("Rule: hierarchy: ", $$[$0 - 1]);
41
+ yy.setHierarchy($$[$0 - 1]);
42
+ break;
43
+ case 8:
44
+ yy.getLogger().debug("Stop NL ");
45
+ break;
46
+ case 9:
47
+ yy.getLogger().debug("Stop EOF ");
48
+ break;
49
+ case 10:
50
+ yy.getLogger().debug("Stop NL2 ");
51
+ break;
52
+ case 11:
53
+ yy.getLogger().debug("Stop EOF2 ");
54
+ break;
55
+ case 12:
56
+ yy.getLogger().debug("Rule: statement: ", $$[$0]);
57
+ typeof $$[$0].length === "number" ? this.$ = $$[$0] : this.$ = [$$[$0]];
58
+ break;
59
+ case 13:
60
+ yy.getLogger().debug("Rule: statement #2: ", $$[$0 - 1]);
61
+ this.$ = [$$[$0 - 1]].concat($$[$0]);
62
+ break;
63
+ case 14:
64
+ yy.getLogger().debug("Rule: link: ", $$[$0], yytext);
65
+ this.$ = { edgeTypeStr: $$[$0], label: "" };
66
+ break;
67
+ case 15:
68
+ yy.getLogger().debug("Rule: LABEL link: ", $$[$0 - 3], $$[$0 - 1], $$[$0]);
69
+ this.$ = { edgeTypeStr: $$[$0], label: $$[$0 - 1] };
70
+ break;
71
+ case 18:
72
+ const num = parseInt($$[$0]);
73
+ const spaceId = yy.generateId();
74
+ this.$ = { id: spaceId, type: "space", label: "", width: num, children: [] };
75
+ break;
76
+ case 23:
77
+ yy.getLogger().debug("Rule: (nodeStatement link node) ", $$[$0 - 2], $$[$0 - 1], $$[$0], " typestr: ", $$[$0 - 1].edgeTypeStr);
78
+ const edgeData = yy.edgeStrToEdgeData($$[$0 - 1].edgeTypeStr);
79
+ this.$ = [
80
+ { id: $$[$0 - 2].id, label: $$[$0 - 2].label, type: $$[$0 - 2].type, directions: $$[$0 - 2].directions },
81
+ { id: $$[$0 - 2].id + "-" + $$[$0].id, start: $$[$0 - 2].id, end: $$[$0].id, label: $$[$0 - 1].label, type: "edge", directions: $$[$0].directions, arrowTypeEnd: edgeData, arrowTypeStart: "arrow_open" },
82
+ { id: $$[$0].id, label: $$[$0].label, type: yy.typeStr2Type($$[$0].typeStr), directions: $$[$0].directions }
83
+ ];
84
+ break;
85
+ case 24:
86
+ yy.getLogger().debug("Rule: nodeStatement (abc88 node size) ", $$[$0 - 1], $$[$0]);
87
+ this.$ = { id: $$[$0 - 1].id, label: $$[$0 - 1].label, type: yy.typeStr2Type($$[$0 - 1].typeStr), directions: $$[$0 - 1].directions, widthInColumns: parseInt($$[$0], 10) };
88
+ break;
89
+ case 25:
90
+ yy.getLogger().debug("Rule: nodeStatement (node) ", $$[$0]);
91
+ this.$ = { id: $$[$0].id, label: $$[$0].label, type: yy.typeStr2Type($$[$0].typeStr), directions: $$[$0].directions, widthInColumns: 1 };
92
+ break;
93
+ case 26:
94
+ yy.getLogger().debug("APA123", this ? this : "na");
95
+ yy.getLogger().debug("COLUMNS: ", $$[$0]);
96
+ this.$ = { type: "column-setting", columns: $$[$0] === "auto" ? -1 : parseInt($$[$0]) };
97
+ break;
98
+ case 27:
99
+ yy.getLogger().debug("Rule: id-block statement : ", $$[$0 - 2], $$[$0 - 1]);
100
+ yy.generateId();
101
+ this.$ = { ...$$[$0 - 2], type: "composite", children: $$[$0 - 1] };
102
+ break;
103
+ case 28:
104
+ yy.getLogger().debug("Rule: blockStatement : ", $$[$0 - 2], $$[$0 - 1], $$[$0]);
105
+ const id = yy.generateId();
106
+ this.$ = { id, type: "composite", label: "", children: $$[$0 - 1] };
107
+ break;
108
+ case 29:
109
+ yy.getLogger().debug("Rule: node (NODE_ID separator): ", $$[$0]);
110
+ this.$ = { id: $$[$0] };
111
+ break;
112
+ case 30:
113
+ yy.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ", $$[$0 - 1], $$[$0]);
114
+ this.$ = { id: $$[$0 - 1], label: $$[$0].label, typeStr: $$[$0].typeStr, directions: $$[$0].directions };
115
+ break;
116
+ case 31:
117
+ yy.getLogger().debug("Rule: dirList: ", $$[$0]);
118
+ this.$ = [$$[$0]];
119
+ break;
120
+ case 32:
121
+ yy.getLogger().debug("Rule: dirList: ", $$[$0 - 1], $$[$0]);
122
+ this.$ = [$$[$0 - 1]].concat($$[$0]);
123
+ break;
124
+ case 33:
125
+ yy.getLogger().debug("Rule: nodeShapeNLabel: ", $$[$0 - 2], $$[$0 - 1], $$[$0]);
126
+ this.$ = { typeStr: $$[$0 - 2] + $$[$0], label: $$[$0 - 1] };
127
+ break;
128
+ case 34:
129
+ yy.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ", $$[$0 - 3], $$[$0 - 2], " #3:", $$[$0 - 1], $$[$0]);
130
+ this.$ = { typeStr: $$[$0 - 3] + $$[$0], label: $$[$0 - 2], directions: $$[$0 - 1] };
131
+ break;
132
+ case 35:
133
+ case 36:
134
+ this.$ = { type: "classDef", id: $$[$0 - 1].trim(), css: $$[$0].trim() };
135
+ break;
136
+ case 37:
137
+ this.$ = { type: "applyClass", id: $$[$0 - 1].trim(), styleClass: $$[$0].trim() };
138
+ break;
139
+ case 38:
140
+ this.$ = { type: "applyStyles", id: $$[$0 - 1].trim(), stylesStr: $$[$0].trim() };
141
+ break;
142
+ }
143
+ },
144
+ table: [{ 9: 1, 10: [1, 2] }, { 1: [3] }, { 11: 3, 13: 4, 19: 5, 20: 6, 21: $V0, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 28: $V1, 29: $V2, 31: $V3, 32: $V4, 40: $V5, 44: $V6, 47: $V7 }, { 8: [1, 20] }, o($V8, [2, 12], { 13: 4, 19: 5, 20: 6, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 11: 21, 21: $V0, 28: $V1, 29: $V2, 31: $V3, 32: $V4, 40: $V5, 44: $V6, 47: $V7 }), o($V9, [2, 16], { 14: 22, 15: $Va, 16: $Vb }), o($V9, [2, 17]), o($V9, [2, 18]), o($V9, [2, 19]), o($V9, [2, 20]), o($V9, [2, 21]), o($V9, [2, 22]), o($Vc, [2, 25], { 27: [1, 25] }), o($V9, [2, 26]), { 19: 26, 26: 12, 32: $V4 }, { 11: 27, 13: 4, 19: 5, 20: 6, 21: $V0, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 28: $V1, 29: $V2, 31: $V3, 32: $V4, 40: $V5, 44: $V6, 47: $V7 }, { 41: [1, 28], 43: [1, 29] }, { 45: [1, 30] }, { 48: [1, 31] }, o($Vd, [2, 29], { 33: 32, 36: [1, 33], 38: [1, 34] }), { 1: [2, 7] }, o($V8, [2, 13]), { 26: 35, 32: $V4 }, { 32: [2, 14] }, { 17: [1, 36] }, o($Vc, [2, 24]), { 11: 37, 13: 4, 14: 22, 15: $Va, 16: $Vb, 19: 5, 20: 6, 21: $V0, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 28: $V1, 29: $V2, 31: $V3, 32: $V4, 40: $V5, 44: $V6, 47: $V7 }, { 30: [1, 38] }, { 42: [1, 39] }, { 42: [1, 40] }, { 46: [1, 41] }, { 49: [1, 42] }, o($Vd, [2, 30]), { 18: [1, 43] }, { 18: [1, 44] }, o($Vc, [2, 23]), { 18: [1, 45] }, { 30: [1, 46] }, o($V9, [2, 28]), o($V9, [2, 35]), o($V9, [2, 36]), o($V9, [2, 37]), o($V9, [2, 38]), { 37: [1, 47] }, { 34: 48, 35: $Ve }, { 15: [1, 50] }, o($V9, [2, 27]), o($Vd, [2, 33]), { 39: [1, 51] }, { 34: 52, 35: $Ve, 39: [2, 31] }, { 32: [2, 15] }, o($Vd, [2, 34]), { 39: [2, 32] }],
145
+ defaultActions: { 20: [2, 7], 23: [2, 14], 50: [2, 15], 52: [2, 32] },
146
+ parseError: function parseError(str, hash) {
147
+ if (hash.recoverable) {
148
+ this.trace(str);
149
+ } else {
150
+ var error = new Error(str);
151
+ error.hash = hash;
152
+ throw error;
153
+ }
154
+ },
155
+ parse: function parse(input) {
156
+ var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, TERROR = 2, EOF = 1;
157
+ var args = lstack.slice.call(arguments, 1);
158
+ var lexer2 = Object.create(this.lexer);
159
+ var sharedState = { yy: {} };
160
+ for (var k in this.yy) {
161
+ if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
162
+ sharedState.yy[k] = this.yy[k];
163
+ }
164
+ }
165
+ lexer2.setInput(input, sharedState.yy);
166
+ sharedState.yy.lexer = lexer2;
167
+ sharedState.yy.parser = this;
168
+ if (typeof lexer2.yylloc == "undefined") {
169
+ lexer2.yylloc = {};
170
+ }
171
+ var yyloc = lexer2.yylloc;
172
+ lstack.push(yyloc);
173
+ var ranges = lexer2.options && lexer2.options.ranges;
174
+ if (typeof sharedState.yy.parseError === "function") {
175
+ this.parseError = sharedState.yy.parseError;
176
+ } else {
177
+ this.parseError = Object.getPrototypeOf(this).parseError;
178
+ }
179
+ function lex() {
180
+ var token;
181
+ token = tstack.pop() || lexer2.lex() || EOF;
182
+ if (typeof token !== "number") {
183
+ if (token instanceof Array) {
184
+ tstack = token;
185
+ token = tstack.pop();
186
+ }
187
+ token = self.symbols_[token] || token;
188
+ }
189
+ return token;
190
+ }
191
+ var symbol, state, action, r, yyval = {}, p, len, newState, expected;
192
+ while (true) {
193
+ state = stack[stack.length - 1];
194
+ if (this.defaultActions[state]) {
195
+ action = this.defaultActions[state];
196
+ } else {
197
+ if (symbol === null || typeof symbol == "undefined") {
198
+ symbol = lex();
199
+ }
200
+ action = table[state] && table[state][symbol];
201
+ }
202
+ if (typeof action === "undefined" || !action.length || !action[0]) {
203
+ var errStr = "";
204
+ expected = [];
205
+ for (p in table[state]) {
206
+ if (this.terminals_[p] && p > TERROR) {
207
+ expected.push("'" + this.terminals_[p] + "'");
208
+ }
209
+ }
210
+ if (lexer2.showPosition) {
211
+ errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer2.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
212
+ } else {
213
+ errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'");
214
+ }
215
+ this.parseError(errStr, {
216
+ text: lexer2.match,
217
+ token: this.terminals_[symbol] || symbol,
218
+ line: lexer2.yylineno,
219
+ loc: yyloc,
220
+ expected
221
+ });
222
+ }
223
+ if (action[0] instanceof Array && action.length > 1) {
224
+ throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
225
+ }
226
+ switch (action[0]) {
227
+ case 1:
228
+ stack.push(symbol);
229
+ vstack.push(lexer2.yytext);
230
+ lstack.push(lexer2.yylloc);
231
+ stack.push(action[1]);
232
+ symbol = null;
233
+ {
234
+ yyleng = lexer2.yyleng;
235
+ yytext = lexer2.yytext;
236
+ yylineno = lexer2.yylineno;
237
+ yyloc = lexer2.yylloc;
238
+ }
239
+ break;
240
+ case 2:
241
+ len = this.productions_[action[1]][1];
242
+ yyval.$ = vstack[vstack.length - len];
243
+ yyval._$ = {
244
+ first_line: lstack[lstack.length - (len || 1)].first_line,
245
+ last_line: lstack[lstack.length - 1].last_line,
246
+ first_column: lstack[lstack.length - (len || 1)].first_column,
247
+ last_column: lstack[lstack.length - 1].last_column
248
+ };
249
+ if (ranges) {
250
+ yyval._$.range = [
251
+ lstack[lstack.length - (len || 1)].range[0],
252
+ lstack[lstack.length - 1].range[1]
253
+ ];
254
+ }
255
+ r = this.performAction.apply(yyval, [
256
+ yytext,
257
+ yyleng,
258
+ yylineno,
259
+ sharedState.yy,
260
+ action[1],
261
+ vstack,
262
+ lstack
263
+ ].concat(args));
264
+ if (typeof r !== "undefined") {
265
+ return r;
266
+ }
267
+ if (len) {
268
+ stack = stack.slice(0, -1 * len * 2);
269
+ vstack = vstack.slice(0, -1 * len);
270
+ lstack = lstack.slice(0, -1 * len);
271
+ }
272
+ stack.push(this.productions_[action[1]][0]);
273
+ vstack.push(yyval.$);
274
+ lstack.push(yyval._$);
275
+ newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
276
+ stack.push(newState);
277
+ break;
278
+ case 3:
279
+ return true;
280
+ }
281
+ }
282
+ return true;
283
+ }
284
+ };
285
+ var lexer = function() {
286
+ var lexer2 = {
287
+ EOF: 1,
288
+ parseError: function parseError(str, hash) {
289
+ if (this.yy.parser) {
290
+ this.yy.parser.parseError(str, hash);
291
+ } else {
292
+ throw new Error(str);
293
+ }
294
+ },
295
+ // resets the lexer, sets new input
296
+ setInput: function(input, yy) {
297
+ this.yy = yy || this.yy || {};
298
+ this._input = input;
299
+ this._more = this._backtrack = this.done = false;
300
+ this.yylineno = this.yyleng = 0;
301
+ this.yytext = this.matched = this.match = "";
302
+ this.conditionStack = ["INITIAL"];
303
+ this.yylloc = {
304
+ first_line: 1,
305
+ first_column: 0,
306
+ last_line: 1,
307
+ last_column: 0
308
+ };
309
+ if (this.options.ranges) {
310
+ this.yylloc.range = [0, 0];
311
+ }
312
+ this.offset = 0;
313
+ return this;
314
+ },
315
+ // consumes and returns one char from the input
316
+ input: function() {
317
+ var ch = this._input[0];
318
+ this.yytext += ch;
319
+ this.yyleng++;
320
+ this.offset++;
321
+ this.match += ch;
322
+ this.matched += ch;
323
+ var lines = ch.match(/(?:\r\n?|\n).*/g);
324
+ if (lines) {
325
+ this.yylineno++;
326
+ this.yylloc.last_line++;
327
+ } else {
328
+ this.yylloc.last_column++;
329
+ }
330
+ if (this.options.ranges) {
331
+ this.yylloc.range[1]++;
332
+ }
333
+ this._input = this._input.slice(1);
334
+ return ch;
335
+ },
336
+ // unshifts one char (or a string) into the input
337
+ unput: function(ch) {
338
+ var len = ch.length;
339
+ var lines = ch.split(/(?:\r\n?|\n)/g);
340
+ this._input = ch + this._input;
341
+ this.yytext = this.yytext.substr(0, this.yytext.length - len);
342
+ this.offset -= len;
343
+ var oldLines = this.match.split(/(?:\r\n?|\n)/g);
344
+ this.match = this.match.substr(0, this.match.length - 1);
345
+ this.matched = this.matched.substr(0, this.matched.length - 1);
346
+ if (lines.length - 1) {
347
+ this.yylineno -= lines.length - 1;
348
+ }
349
+ var r = this.yylloc.range;
350
+ this.yylloc = {
351
+ first_line: this.yylloc.first_line,
352
+ last_line: this.yylineno + 1,
353
+ first_column: this.yylloc.first_column,
354
+ 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
355
+ };
356
+ if (this.options.ranges) {
357
+ this.yylloc.range = [r[0], r[0] + this.yyleng - len];
358
+ }
359
+ this.yyleng = this.yytext.length;
360
+ return this;
361
+ },
362
+ // When called from action, caches matched text and appends it on next action
363
+ more: function() {
364
+ this._more = true;
365
+ return this;
366
+ },
367
+ // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
368
+ reject: function() {
369
+ if (this.options.backtrack_lexer) {
370
+ this._backtrack = true;
371
+ } else {
372
+ 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).\n" + this.showPosition(), {
373
+ text: "",
374
+ token: null,
375
+ line: this.yylineno
376
+ });
377
+ }
378
+ return this;
379
+ },
380
+ // retain first n characters of the match
381
+ less: function(n) {
382
+ this.unput(this.match.slice(n));
383
+ },
384
+ // displays already matched input, i.e. for error messages
385
+ pastInput: function() {
386
+ var past = this.matched.substr(0, this.matched.length - this.match.length);
387
+ return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, "");
388
+ },
389
+ // displays upcoming input, i.e. for error messages
390
+ upcomingInput: function() {
391
+ var next = this.match;
392
+ if (next.length < 20) {
393
+ next += this._input.substr(0, 20 - next.length);
394
+ }
395
+ return (next.substr(0, 20) + (next.length > 20 ? "..." : "")).replace(/\n/g, "");
396
+ },
397
+ // displays the character position where the lexing error occurred, i.e. for error messages
398
+ showPosition: function() {
399
+ var pre = this.pastInput();
400
+ var c = new Array(pre.length + 1).join("-");
401
+ return pre + this.upcomingInput() + "\n" + c + "^";
402
+ },
403
+ // test the lexed token: return FALSE when not a match, otherwise return token
404
+ test_match: function(match, indexed_rule) {
405
+ var token, lines, backup;
406
+ if (this.options.backtrack_lexer) {
407
+ backup = {
408
+ yylineno: this.yylineno,
409
+ yylloc: {
410
+ first_line: this.yylloc.first_line,
411
+ last_line: this.last_line,
412
+ first_column: this.yylloc.first_column,
413
+ last_column: this.yylloc.last_column
414
+ },
415
+ yytext: this.yytext,
416
+ match: this.match,
417
+ matches: this.matches,
418
+ matched: this.matched,
419
+ yyleng: this.yyleng,
420
+ offset: this.offset,
421
+ _more: this._more,
422
+ _input: this._input,
423
+ yy: this.yy,
424
+ conditionStack: this.conditionStack.slice(0),
425
+ done: this.done
426
+ };
427
+ if (this.options.ranges) {
428
+ backup.yylloc.range = this.yylloc.range.slice(0);
429
+ }
430
+ }
431
+ lines = match[0].match(/(?:\r\n?|\n).*/g);
432
+ if (lines) {
433
+ this.yylineno += lines.length;
434
+ }
435
+ this.yylloc = {
436
+ first_line: this.yylloc.last_line,
437
+ last_line: this.yylineno + 1,
438
+ first_column: this.yylloc.last_column,
439
+ last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length
440
+ };
441
+ this.yytext += match[0];
442
+ this.match += match[0];
443
+ this.matches = match;
444
+ this.yyleng = this.yytext.length;
445
+ if (this.options.ranges) {
446
+ this.yylloc.range = [this.offset, this.offset += this.yyleng];
447
+ }
448
+ this._more = false;
449
+ this._backtrack = false;
450
+ this._input = this._input.slice(match[0].length);
451
+ this.matched += match[0];
452
+ token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
453
+ if (this.done && this._input) {
454
+ this.done = false;
455
+ }
456
+ if (token) {
457
+ return token;
458
+ } else if (this._backtrack) {
459
+ for (var k in backup) {
460
+ this[k] = backup[k];
461
+ }
462
+ return false;
463
+ }
464
+ return false;
465
+ },
466
+ // return next match in input
467
+ next: function() {
468
+ if (this.done) {
469
+ return this.EOF;
470
+ }
471
+ if (!this._input) {
472
+ this.done = true;
473
+ }
474
+ var token, match, tempMatch, index;
475
+ if (!this._more) {
476
+ this.yytext = "";
477
+ this.match = "";
478
+ }
479
+ var rules = this._currentRules();
480
+ for (var i = 0; i < rules.length; i++) {
481
+ tempMatch = this._input.match(this.rules[rules[i]]);
482
+ if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
483
+ match = tempMatch;
484
+ index = i;
485
+ if (this.options.backtrack_lexer) {
486
+ token = this.test_match(tempMatch, rules[i]);
487
+ if (token !== false) {
488
+ return token;
489
+ } else if (this._backtrack) {
490
+ match = false;
491
+ continue;
492
+ } else {
493
+ return false;
494
+ }
495
+ } else if (!this.options.flex) {
496
+ break;
497
+ }
498
+ }
499
+ }
500
+ if (match) {
501
+ token = this.test_match(match, rules[index]);
502
+ if (token !== false) {
503
+ return token;
504
+ }
505
+ return false;
506
+ }
507
+ if (this._input === "") {
508
+ return this.EOF;
509
+ } else {
510
+ return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), {
511
+ text: "",
512
+ token: null,
513
+ line: this.yylineno
514
+ });
515
+ }
516
+ },
517
+ // return next match that has a token
518
+ lex: function lex() {
519
+ var r = this.next();
520
+ if (r) {
521
+ return r;
522
+ } else {
523
+ return this.lex();
524
+ }
525
+ },
526
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
527
+ begin: function begin(condition) {
528
+ this.conditionStack.push(condition);
529
+ },
530
+ // pop the previously active lexer condition state off the condition stack
531
+ popState: function popState() {
532
+ var n = this.conditionStack.length - 1;
533
+ if (n > 0) {
534
+ return this.conditionStack.pop();
535
+ } else {
536
+ return this.conditionStack[0];
537
+ }
538
+ },
539
+ // produce the lexer rule set which is active for the currently active lexer condition state
540
+ _currentRules: function _currentRules() {
541
+ if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
542
+ return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
543
+ } else {
544
+ return this.conditions["INITIAL"].rules;
545
+ }
546
+ },
547
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
548
+ topState: function topState(n) {
549
+ n = this.conditionStack.length - 1 - Math.abs(n || 0);
550
+ if (n >= 0) {
551
+ return this.conditionStack[n];
552
+ } else {
553
+ return "INITIAL";
554
+ }
555
+ },
556
+ // alias for begin(condition)
557
+ pushState: function pushState(condition) {
558
+ this.begin(condition);
559
+ },
560
+ // return the number of states currently on the stack
561
+ stateStackSize: function stateStackSize() {
562
+ return this.conditionStack.length;
563
+ },
564
+ options: {},
565
+ performAction: function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
566
+ switch ($avoiding_name_collisions) {
567
+ case 0:
568
+ return 10;
569
+ case 1:
570
+ yy.getLogger().debug("Found space-block");
571
+ return 31;
572
+ case 2:
573
+ yy.getLogger().debug("Found nl-block");
574
+ return 31;
575
+ case 3:
576
+ yy.getLogger().debug("Found space-block");
577
+ return 29;
578
+ case 4:
579
+ yy.getLogger().debug(".", yy_.yytext);
580
+ break;
581
+ case 5:
582
+ yy.getLogger().debug("_", yy_.yytext);
583
+ break;
584
+ case 6:
585
+ return 5;
586
+ case 7:
587
+ yy_.yytext = -1;
588
+ return 28;
589
+ case 8:
590
+ yy_.yytext = yy_.yytext.replace(/columns\s+/, "");
591
+ yy.getLogger().debug("COLUMNS (LEX)", yy_.yytext);
592
+ return 28;
593
+ case 9:
594
+ this.pushState("md_string");
595
+ break;
596
+ case 10:
597
+ return "MD_STR";
598
+ case 11:
599
+ this.popState();
600
+ break;
601
+ case 12:
602
+ this.pushState("string");
603
+ break;
604
+ case 13:
605
+ yy.getLogger().debug("LEX: POPPING STR:", yy_.yytext);
606
+ this.popState();
607
+ break;
608
+ case 14:
609
+ yy.getLogger().debug("LEX: STR end:", yy_.yytext);
610
+ return "STR";
611
+ case 15:
612
+ yy_.yytext = yy_.yytext.replace(/space\:/, "");
613
+ yy.getLogger().debug("SPACE NUM (LEX)", yy_.yytext);
614
+ return 21;
615
+ case 16:
616
+ yy_.yytext = "1";
617
+ yy.getLogger().debug("COLUMNS (LEX)", yy_.yytext);
618
+ return 21;
619
+ case 17:
620
+ return 43;
621
+ case 18:
622
+ return "LINKSTYLE";
623
+ case 19:
624
+ return "INTERPOLATE";
625
+ case 20:
626
+ this.pushState("CLASSDEF");
627
+ return 40;
628
+ case 21:
629
+ this.popState();
630
+ this.pushState("CLASSDEFID");
631
+ return "DEFAULT_CLASSDEF_ID";
632
+ case 22:
633
+ this.popState();
634
+ this.pushState("CLASSDEFID");
635
+ return 41;
636
+ case 23:
637
+ this.popState();
638
+ return 42;
639
+ case 24:
640
+ this.pushState("CLASS");
641
+ return 44;
642
+ case 25:
643
+ this.popState();
644
+ this.pushState("CLASS_STYLE");
645
+ return 45;
646
+ case 26:
647
+ this.popState();
648
+ return 46;
649
+ case 27:
650
+ this.pushState("STYLE_STMNT");
651
+ return 47;
652
+ case 28:
653
+ this.popState();
654
+ this.pushState("STYLE_DEFINITION");
655
+ return 48;
656
+ case 29:
657
+ this.popState();
658
+ return 49;
659
+ case 30:
660
+ this.pushState("acc_title");
661
+ return "acc_title";
662
+ case 31:
663
+ this.popState();
664
+ return "acc_title_value";
665
+ case 32:
666
+ this.pushState("acc_descr");
667
+ return "acc_descr";
668
+ case 33:
669
+ this.popState();
670
+ return "acc_descr_value";
671
+ case 34:
672
+ this.pushState("acc_descr_multiline");
673
+ break;
674
+ case 35:
675
+ this.popState();
676
+ break;
677
+ case 36:
678
+ return "acc_descr_multiline_value";
679
+ case 37:
680
+ return 30;
681
+ case 38:
682
+ this.popState();
683
+ yy.getLogger().debug("Lex: ((");
684
+ return "NODE_DEND";
685
+ case 39:
686
+ this.popState();
687
+ yy.getLogger().debug("Lex: ((");
688
+ return "NODE_DEND";
689
+ case 40:
690
+ this.popState();
691
+ yy.getLogger().debug("Lex: ))");
692
+ return "NODE_DEND";
693
+ case 41:
694
+ this.popState();
695
+ yy.getLogger().debug("Lex: ((");
696
+ return "NODE_DEND";
697
+ case 42:
698
+ this.popState();
699
+ yy.getLogger().debug("Lex: ((");
700
+ return "NODE_DEND";
701
+ case 43:
702
+ this.popState();
703
+ yy.getLogger().debug("Lex: (-");
704
+ return "NODE_DEND";
705
+ case 44:
706
+ this.popState();
707
+ yy.getLogger().debug("Lex: -)");
708
+ return "NODE_DEND";
709
+ case 45:
710
+ this.popState();
711
+ yy.getLogger().debug("Lex: ((");
712
+ return "NODE_DEND";
713
+ case 46:
714
+ this.popState();
715
+ yy.getLogger().debug("Lex: ]]");
716
+ return "NODE_DEND";
717
+ case 47:
718
+ this.popState();
719
+ yy.getLogger().debug("Lex: (");
720
+ return "NODE_DEND";
721
+ case 48:
722
+ this.popState();
723
+ yy.getLogger().debug("Lex: ])");
724
+ return "NODE_DEND";
725
+ case 49:
726
+ this.popState();
727
+ yy.getLogger().debug("Lex: /]");
728
+ return "NODE_DEND";
729
+ case 50:
730
+ this.popState();
731
+ yy.getLogger().debug("Lex: /]");
732
+ return "NODE_DEND";
733
+ case 51:
734
+ this.popState();
735
+ yy.getLogger().debug("Lex: )]");
736
+ return "NODE_DEND";
737
+ case 52:
738
+ this.popState();
739
+ yy.getLogger().debug("Lex: )");
740
+ return "NODE_DEND";
741
+ case 53:
742
+ this.popState();
743
+ yy.getLogger().debug("Lex: ]>");
744
+ return "NODE_DEND";
745
+ case 54:
746
+ this.popState();
747
+ yy.getLogger().debug("Lex: ]");
748
+ return "NODE_DEND";
749
+ case 55:
750
+ yy.getLogger().debug("Lexa: -)");
751
+ this.pushState("NODE");
752
+ return 36;
753
+ case 56:
754
+ yy.getLogger().debug("Lexa: (-");
755
+ this.pushState("NODE");
756
+ return 36;
757
+ case 57:
758
+ yy.getLogger().debug("Lexa: ))");
759
+ this.pushState("NODE");
760
+ return 36;
761
+ case 58:
762
+ yy.getLogger().debug("Lexa: )");
763
+ this.pushState("NODE");
764
+ return 36;
765
+ case 59:
766
+ yy.getLogger().debug("Lex: (((");
767
+ this.pushState("NODE");
768
+ return 36;
769
+ case 60:
770
+ yy.getLogger().debug("Lexa: )");
771
+ this.pushState("NODE");
772
+ return 36;
773
+ case 61:
774
+ yy.getLogger().debug("Lexa: )");
775
+ this.pushState("NODE");
776
+ return 36;
777
+ case 62:
778
+ yy.getLogger().debug("Lexa: )");
779
+ this.pushState("NODE");
780
+ return 36;
781
+ case 63:
782
+ yy.getLogger().debug("Lexc: >");
783
+ this.pushState("NODE");
784
+ return 36;
785
+ case 64:
786
+ yy.getLogger().debug("Lexa: ([");
787
+ this.pushState("NODE");
788
+ return 36;
789
+ case 65:
790
+ yy.getLogger().debug("Lexa: )");
791
+ this.pushState("NODE");
792
+ return 36;
793
+ case 66:
794
+ this.pushState("NODE");
795
+ return 36;
796
+ case 67:
797
+ this.pushState("NODE");
798
+ return 36;
799
+ case 68:
800
+ this.pushState("NODE");
801
+ return 36;
802
+ case 69:
803
+ this.pushState("NODE");
804
+ return 36;
805
+ case 70:
806
+ this.pushState("NODE");
807
+ return 36;
808
+ case 71:
809
+ this.pushState("NODE");
810
+ return 36;
811
+ case 72:
812
+ this.pushState("NODE");
813
+ return 36;
814
+ case 73:
815
+ yy.getLogger().debug("Lexa: [");
816
+ this.pushState("NODE");
817
+ return 36;
818
+ case 74:
819
+ this.pushState("BLOCK_ARROW");
820
+ yy.getLogger().debug("LEX ARR START");
821
+ return 38;
822
+ case 75:
823
+ yy.getLogger().debug("Lex: NODE_ID", yy_.yytext);
824
+ return 32;
825
+ case 76:
826
+ yy.getLogger().debug("Lex: EOF", yy_.yytext);
827
+ return 8;
828
+ case 77:
829
+ this.pushState("md_string");
830
+ break;
831
+ case 78:
832
+ this.pushState("md_string");
833
+ break;
834
+ case 79:
835
+ return "NODE_DESCR";
836
+ case 80:
837
+ this.popState();
838
+ break;
839
+ case 81:
840
+ yy.getLogger().debug("Lex: Starting string");
841
+ this.pushState("string");
842
+ break;
843
+ case 82:
844
+ yy.getLogger().debug("LEX ARR: Starting string");
845
+ this.pushState("string");
846
+ break;
847
+ case 83:
848
+ yy.getLogger().debug("LEX: NODE_DESCR:", yy_.yytext);
849
+ return "NODE_DESCR";
850
+ case 84:
851
+ yy.getLogger().debug("LEX POPPING");
852
+ this.popState();
853
+ break;
854
+ case 85:
855
+ yy.getLogger().debug("Lex: =>BAE");
856
+ this.pushState("ARROW_DIR");
857
+ break;
858
+ case 86:
859
+ yy_.yytext = yy_.yytext.replace(/^,\s*/, "");
860
+ yy.getLogger().debug("Lex (right): dir:", yy_.yytext);
861
+ return "DIR";
862
+ case 87:
863
+ yy_.yytext = yy_.yytext.replace(/^,\s*/, "");
864
+ yy.getLogger().debug("Lex (left):", yy_.yytext);
865
+ return "DIR";
866
+ case 88:
867
+ yy_.yytext = yy_.yytext.replace(/^,\s*/, "");
868
+ yy.getLogger().debug("Lex (x):", yy_.yytext);
869
+ return "DIR";
870
+ case 89:
871
+ yy_.yytext = yy_.yytext.replace(/^,\s*/, "");
872
+ yy.getLogger().debug("Lex (y):", yy_.yytext);
873
+ return "DIR";
874
+ case 90:
875
+ yy_.yytext = yy_.yytext.replace(/^,\s*/, "");
876
+ yy.getLogger().debug("Lex (up):", yy_.yytext);
877
+ return "DIR";
878
+ case 91:
879
+ yy_.yytext = yy_.yytext.replace(/^,\s*/, "");
880
+ yy.getLogger().debug("Lex (down):", yy_.yytext);
881
+ return "DIR";
882
+ case 92:
883
+ yy_.yytext = "]>";
884
+ yy.getLogger().debug("Lex (ARROW_DIR end):", yy_.yytext);
885
+ this.popState();
886
+ this.popState();
887
+ return "BLOCK_ARROW_END";
888
+ case 93:
889
+ yy.getLogger().debug("Lex: LINK", "#" + yy_.yytext + "#");
890
+ return 15;
891
+ case 94:
892
+ yy.getLogger().debug("Lex: LINK", yy_.yytext);
893
+ return 15;
894
+ case 95:
895
+ yy.getLogger().debug("Lex: LINK", yy_.yytext);
896
+ return 15;
897
+ case 96:
898
+ yy.getLogger().debug("Lex: LINK", yy_.yytext);
899
+ return 15;
900
+ case 97:
901
+ yy.getLogger().debug("Lex: START_LINK", yy_.yytext);
902
+ this.pushState("LLABEL");
903
+ return 16;
904
+ case 98:
905
+ yy.getLogger().debug("Lex: START_LINK", yy_.yytext);
906
+ this.pushState("LLABEL");
907
+ return 16;
908
+ case 99:
909
+ yy.getLogger().debug("Lex: START_LINK", yy_.yytext);
910
+ this.pushState("LLABEL");
911
+ return 16;
912
+ case 100:
913
+ this.pushState("md_string");
914
+ break;
915
+ case 101:
916
+ yy.getLogger().debug("Lex: Starting string");
917
+ this.pushState("string");
918
+ return "LINK_LABEL";
919
+ case 102:
920
+ this.popState();
921
+ yy.getLogger().debug("Lex: LINK", "#" + yy_.yytext + "#");
922
+ return 15;
923
+ case 103:
924
+ this.popState();
925
+ yy.getLogger().debug("Lex: LINK", yy_.yytext);
926
+ return 15;
927
+ case 104:
928
+ this.popState();
929
+ yy.getLogger().debug("Lex: LINK", yy_.yytext);
930
+ return 15;
931
+ case 105:
932
+ yy.getLogger().debug("Lex: COLON", yy_.yytext);
933
+ yy_.yytext = yy_.yytext.slice(1);
934
+ return 27;
935
+ }
936
+ },
937
+ rules: [/^(?:block-beta\b)/, /^(?:block\s+)/, /^(?:block\n+)/, /^(?:block:)/, /^(?:[\s]+)/, /^(?:[\n]+)/, /^(?:((\u000D\u000A)|(\u000A)))/, /^(?:columns\s+auto\b)/, /^(?:columns\s+[\d]+)/, /^(?:["][`])/, /^(?:[^`"]+)/, /^(?:[`]["])/, /^(?:["])/, /^(?:["])/, /^(?:[^"]*)/, /^(?:space[:]\d+)/, /^(?:space\b)/, /^(?:default\b)/, /^(?:linkStyle\b)/, /^(?:interpolate\b)/, /^(?:classDef\s+)/, /^(?:DEFAULT\s+)/, /^(?:\w+\s+)/, /^(?:[^\n]*)/, /^(?:class\s+)/, /^(?:(\w+)+((,\s*\w+)*))/, /^(?:[^\n]*)/, /^(?:style\s+)/, /^(?:(\w+)+((,\s*\w+)*))/, /^(?:[^\n]*)/, /^(?:accTitle\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*\{\s*)/, /^(?:[\}])/, /^(?:[^\}]*)/, /^(?:end\b\s*)/, /^(?:\(\(\()/, /^(?:\)\)\))/, /^(?:[\)]\))/, /^(?:\}\})/, /^(?:\})/, /^(?:\(-)/, /^(?:-\))/, /^(?:\(\()/, /^(?:\]\])/, /^(?:\()/, /^(?:\]\))/, /^(?:\\\])/, /^(?:\/\])/, /^(?:\)\])/, /^(?:[\)])/, /^(?:\]>)/, /^(?:[\]])/, /^(?:-\))/, /^(?:\(-)/, /^(?:\)\))/, /^(?:\))/, /^(?:\(\(\()/, /^(?:\(\()/, /^(?:\{\{)/, /^(?:\{)/, /^(?:>)/, /^(?:\(\[)/, /^(?:\()/, /^(?:\[\[)/, /^(?:\[\|)/, /^(?:\[\()/, /^(?:\)\)\))/, /^(?:\[\\)/, /^(?:\[\/)/, /^(?:\[\\)/, /^(?:\[)/, /^(?:<\[)/, /^(?:[^\(\[\n\-\)\{\}\s\<\>:]+)/, /^(?:$)/, /^(?:["][`])/, /^(?:["][`])/, /^(?:[^`"]+)/, /^(?:[`]["])/, /^(?:["])/, /^(?:["])/, /^(?:[^"]+)/, /^(?:["])/, /^(?:\]>\s*\()/, /^(?:,?\s*right\s*)/, /^(?:,?\s*left\s*)/, /^(?:,?\s*x\s*)/, /^(?:,?\s*y\s*)/, /^(?:,?\s*up\s*)/, /^(?:,?\s*down\s*)/, /^(?:\)\s*)/, /^(?:\s*[xo<]?--+[-xo>]\s*)/, /^(?:\s*[xo<]?==+[=xo>]\s*)/, /^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/, /^(?:\s*~~[\~]+\s*)/, /^(?:\s*[xo<]?--\s*)/, /^(?:\s*[xo<]?==\s*)/, /^(?:\s*[xo<]?-\.\s*)/, /^(?:["][`])/, /^(?:["])/, /^(?:\s*[xo<]?--+[-xo>]\s*)/, /^(?:\s*[xo<]?==+[=xo>]\s*)/, /^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/, /^(?::\d+)/],
938
+ conditions: { "STYLE_DEFINITION": { "rules": [29], "inclusive": false }, "STYLE_STMNT": { "rules": [28], "inclusive": false }, "CLASSDEFID": { "rules": [23], "inclusive": false }, "CLASSDEF": { "rules": [21, 22], "inclusive": false }, "CLASS_STYLE": { "rules": [26], "inclusive": false }, "CLASS": { "rules": [25], "inclusive": false }, "LLABEL": { "rules": [100, 101, 102, 103, 104], "inclusive": false }, "ARROW_DIR": { "rules": [86, 87, 88, 89, 90, 91, 92], "inclusive": false }, "BLOCK_ARROW": { "rules": [77, 82, 85], "inclusive": false }, "NODE": { "rules": [38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 78, 81], "inclusive": false }, "md_string": { "rules": [10, 11, 79, 80], "inclusive": false }, "space": { "rules": [], "inclusive": false }, "string": { "rules": [13, 14, 83, 84], "inclusive": false }, "acc_descr_multiline": { "rules": [35, 36], "inclusive": false }, "acc_descr": { "rules": [33], "inclusive": false }, "acc_title": { "rules": [31], "inclusive": false }, "INITIAL": { "rules": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 15, 16, 17, 18, 19, 20, 24, 27, 30, 32, 34, 37, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 93, 94, 95, 96, 97, 98, 99, 105], "inclusive": true } }
939
+ };
940
+ return lexer2;
941
+ }();
942
+ parser2.lexer = lexer;
943
+ function Parser() {
944
+ this.yy = {};
945
+ }
946
+ Parser.prototype = parser2;
947
+ parser2.Parser = Parser;
948
+ return new Parser();
949
+ }();
950
+ parser.parser = parser;
951
+ const parser$1 = parser;
952
+ let blockDatabase = {};
953
+ let edgeList = [];
954
+ let edgeCount = {};
955
+ const COLOR_KEYWORD = "color";
956
+ const FILL_KEYWORD = "fill";
957
+ const BG_FILL = "bgFill";
958
+ const STYLECLASS_SEP = ",";
959
+ const config = getConfig();
960
+ let classes = {};
961
+ const sanitizeText = (txt) => common.sanitizeText(txt, config);
962
+ const addStyleClass = function(id, styleAttributes = "") {
963
+ if (classes[id] === void 0) {
964
+ classes[id] = { id, styles: [], textStyles: [] };
965
+ }
966
+ const foundClass = classes[id];
967
+ if (styleAttributes !== void 0 && styleAttributes !== null) {
968
+ styleAttributes.split(STYLECLASS_SEP).forEach((attrib) => {
969
+ const fixedAttrib = attrib.replace(/([^;]*);/, "$1").trim();
970
+ if (attrib.match(COLOR_KEYWORD)) {
971
+ const newStyle1 = fixedAttrib.replace(FILL_KEYWORD, BG_FILL);
972
+ const newStyle2 = newStyle1.replace(COLOR_KEYWORD, FILL_KEYWORD);
973
+ foundClass.textStyles.push(newStyle2);
974
+ }
975
+ foundClass.styles.push(fixedAttrib);
976
+ });
977
+ }
978
+ };
979
+ const addStyle2Node = function(id, styles = "") {
980
+ const foundBlock = blockDatabase[id];
981
+ if (styles !== void 0 && styles !== null) {
982
+ foundBlock.styles = styles.split(STYLECLASS_SEP);
983
+ }
984
+ };
985
+ const setCssClass = function(itemIds, cssClassName) {
986
+ itemIds.split(",").forEach(function(id) {
987
+ let foundBlock = blockDatabase[id];
988
+ if (foundBlock === void 0) {
989
+ const trimmedId = id.trim();
990
+ blockDatabase[trimmedId] = { id: trimmedId, type: "na", children: [] };
991
+ foundBlock = blockDatabase[trimmedId];
992
+ }
993
+ if (!foundBlock.classes) {
994
+ foundBlock.classes = [];
995
+ }
996
+ foundBlock.classes.push(cssClassName);
997
+ });
998
+ };
999
+ const populateBlockDatabase = (_blockList, parent) => {
1000
+ const blockList = _blockList.flat();
1001
+ const children = [];
1002
+ for (const block of blockList) {
1003
+ if (block.label) {
1004
+ block.label = sanitizeText(block.label);
1005
+ }
1006
+ if (block.type === "classDef") {
1007
+ addStyleClass(block.id, block.css);
1008
+ continue;
1009
+ }
1010
+ if (block.type === "applyClass") {
1011
+ setCssClass(block.id, (block == null ? void 0 : block.styleClass) || "");
1012
+ continue;
1013
+ }
1014
+ if (block.type === "applyStyles") {
1015
+ if (block == null ? void 0 : block.stylesStr) {
1016
+ addStyle2Node(block.id, block == null ? void 0 : block.stylesStr);
1017
+ }
1018
+ continue;
1019
+ }
1020
+ if (block.type === "column-setting") {
1021
+ parent.columns = block.columns || -1;
1022
+ } else if (block.type === "edge") {
1023
+ if (edgeCount[block.id]) {
1024
+ edgeCount[block.id]++;
1025
+ } else {
1026
+ edgeCount[block.id] = 1;
1027
+ }
1028
+ block.id = edgeCount[block.id] + "-" + block.id;
1029
+ edgeList.push(block);
1030
+ } else {
1031
+ if (!block.label) {
1032
+ if (block.type === "composite") {
1033
+ block.label = "";
1034
+ } else {
1035
+ block.label = block.id;
1036
+ }
1037
+ }
1038
+ const newBlock = !blockDatabase[block.id];
1039
+ if (newBlock) {
1040
+ blockDatabase[block.id] = block;
1041
+ } else {
1042
+ if (block.type !== "na") {
1043
+ blockDatabase[block.id].type = block.type;
1044
+ }
1045
+ if (block.label !== block.id) {
1046
+ blockDatabase[block.id].label = block.label;
1047
+ }
1048
+ }
1049
+ if (block.children) {
1050
+ populateBlockDatabase(block.children, block);
1051
+ }
1052
+ if (block.type === "space") {
1053
+ const w = block.width || 1;
1054
+ for (let j = 0; j < w; j++) {
1055
+ const newBlock2 = clone(block);
1056
+ newBlock2.id = newBlock2.id + "-" + j;
1057
+ blockDatabase[newBlock2.id] = newBlock2;
1058
+ children.push(newBlock2);
1059
+ }
1060
+ } else if (newBlock) {
1061
+ children.push(block);
1062
+ }
1063
+ }
1064
+ }
1065
+ parent.children = children;
1066
+ };
1067
+ let blocks = [];
1068
+ let rootBlock = { id: "root", type: "composite", children: [], columns: -1 };
1069
+ const clear = () => {
1070
+ log.debug("Clear called");
1071
+ clear$1();
1072
+ rootBlock = { id: "root", type: "composite", children: [], columns: -1 };
1073
+ blockDatabase = { root: rootBlock };
1074
+ blocks = [];
1075
+ classes = {};
1076
+ edgeList = [];
1077
+ edgeCount = {};
1078
+ };
1079
+ function typeStr2Type(typeStr) {
1080
+ log.debug("typeStr2Type", typeStr);
1081
+ switch (typeStr) {
1082
+ case "[]":
1083
+ return "square";
1084
+ case "()":
1085
+ log.debug("we have a round");
1086
+ return "round";
1087
+ case "(())":
1088
+ return "circle";
1089
+ case ">]":
1090
+ return "rect_left_inv_arrow";
1091
+ case "{}":
1092
+ return "diamond";
1093
+ case "{{}}":
1094
+ return "hexagon";
1095
+ case "([])":
1096
+ return "stadium";
1097
+ case "[[]]":
1098
+ return "subroutine";
1099
+ case "[()]":
1100
+ return "cylinder";
1101
+ case "((()))":
1102
+ return "doublecircle";
1103
+ case "[//]":
1104
+ return "lean_right";
1105
+ case "[\\\\]":
1106
+ return "lean_left";
1107
+ case "[/\\]":
1108
+ return "trapezoid";
1109
+ case "[\\/]":
1110
+ return "inv_trapezoid";
1111
+ case "<[]>":
1112
+ return "block_arrow";
1113
+ default:
1114
+ return "na";
1115
+ }
1116
+ }
1117
+ function edgeTypeStr2Type(typeStr) {
1118
+ log.debug("typeStr2Type", typeStr);
1119
+ switch (typeStr) {
1120
+ case "==":
1121
+ return "thick";
1122
+ default:
1123
+ return "normal";
1124
+ }
1125
+ }
1126
+ function edgeStrToEdgeData(typeStr) {
1127
+ switch (typeStr.trim()) {
1128
+ case "--x":
1129
+ return "arrow_cross";
1130
+ case "--o":
1131
+ return "arrow_circle";
1132
+ default:
1133
+ return "arrow_point";
1134
+ }
1135
+ }
1136
+ let cnt = 0;
1137
+ const generateId = () => {
1138
+ cnt++;
1139
+ return "id-" + Math.random().toString(36).substr(2, 12) + "-" + cnt;
1140
+ };
1141
+ const setHierarchy = (block) => {
1142
+ rootBlock.children = block;
1143
+ populateBlockDatabase(block, rootBlock);
1144
+ blocks = rootBlock.children;
1145
+ };
1146
+ const getColumns = (blockId) => {
1147
+ const block = blockDatabase[blockId];
1148
+ if (!block) {
1149
+ return -1;
1150
+ }
1151
+ if (block.columns) {
1152
+ return block.columns;
1153
+ }
1154
+ if (!block.children) {
1155
+ return -1;
1156
+ }
1157
+ return block.children.length;
1158
+ };
1159
+ const getBlocksFlat = () => {
1160
+ return [...Object.values(blockDatabase)];
1161
+ };
1162
+ const getBlocks = () => {
1163
+ return blocks || [];
1164
+ };
1165
+ const getEdges = () => {
1166
+ return edgeList;
1167
+ };
1168
+ const getBlock = (id) => {
1169
+ return blockDatabase[id];
1170
+ };
1171
+ const setBlock = (block) => {
1172
+ blockDatabase[block.id] = block;
1173
+ };
1174
+ const getLogger = () => console;
1175
+ const getClasses$1 = function() {
1176
+ return classes;
1177
+ };
1178
+ const db = {
1179
+ getConfig: () => getConfig$1().block,
1180
+ typeStr2Type,
1181
+ edgeTypeStr2Type,
1182
+ edgeStrToEdgeData,
1183
+ getLogger,
1184
+ getBlocksFlat,
1185
+ getBlocks,
1186
+ getEdges,
1187
+ setHierarchy,
1188
+ getBlock,
1189
+ setBlock,
1190
+ getColumns,
1191
+ getClasses: getClasses$1,
1192
+ clear,
1193
+ generateId
1194
+ };
1195
+ const db$1 = db;
1196
+ const fade = (color, opacity) => {
1197
+ const channel$1 = channel;
1198
+ const r = channel$1(color, "r");
1199
+ const g = channel$1(color, "g");
1200
+ const b = channel$1(color, "b");
1201
+ return rgba(r, g, b, opacity);
1202
+ };
1203
+ const getStyles = (options) => `.label {
1204
+ font-family: ${options.fontFamily};
1205
+ color: ${options.nodeTextColor || options.textColor};
1206
+ }
1207
+ .cluster-label text {
1208
+ fill: ${options.titleColor};
1209
+ }
1210
+ .cluster-label span,p {
1211
+ color: ${options.titleColor};
1212
+ }
1213
+
1214
+
1215
+
1216
+ .label text,span,p {
1217
+ fill: ${options.nodeTextColor || options.textColor};
1218
+ color: ${options.nodeTextColor || options.textColor};
1219
+ }
1220
+
1221
+ .node rect,
1222
+ .node circle,
1223
+ .node ellipse,
1224
+ .node polygon,
1225
+ .node path {
1226
+ fill: ${options.mainBkg};
1227
+ stroke: ${options.nodeBorder};
1228
+ stroke-width: 1px;
1229
+ }
1230
+ .flowchart-label text {
1231
+ text-anchor: middle;
1232
+ }
1233
+ // .flowchart-label .text-outer-tspan {
1234
+ // text-anchor: middle;
1235
+ // }
1236
+ // .flowchart-label .text-inner-tspan {
1237
+ // text-anchor: start;
1238
+ // }
1239
+
1240
+ .node .label {
1241
+ text-align: center;
1242
+ }
1243
+ .node.clickable {
1244
+ cursor: pointer;
1245
+ }
1246
+
1247
+ .arrowheadPath {
1248
+ fill: ${options.arrowheadColor};
1249
+ }
1250
+
1251
+ .edgePath .path {
1252
+ stroke: ${options.lineColor};
1253
+ stroke-width: 2.0px;
1254
+ }
1255
+
1256
+ .flowchart-link {
1257
+ stroke: ${options.lineColor};
1258
+ fill: none;
1259
+ }
1260
+
1261
+ .edgeLabel {
1262
+ background-color: ${options.edgeLabelBackground};
1263
+ rect {
1264
+ opacity: 0.5;
1265
+ background-color: ${options.edgeLabelBackground};
1266
+ fill: ${options.edgeLabelBackground};
1267
+ }
1268
+ text-align: center;
1269
+ }
1270
+
1271
+ /* For html labels only */
1272
+ .labelBkg {
1273
+ background-color: ${fade(options.edgeLabelBackground, 0.5)};
1274
+ // background-color:
1275
+ }
1276
+
1277
+ .node .cluster {
1278
+ // fill: ${fade(options.mainBkg, 0.5)};
1279
+ fill: ${fade(options.clusterBkg, 0.5)};
1280
+ stroke: ${fade(options.clusterBorder, 0.2)};
1281
+ box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px;
1282
+ stroke-width: 1px;
1283
+ }
1284
+
1285
+ .cluster text {
1286
+ fill: ${options.titleColor};
1287
+ }
1288
+
1289
+ .cluster span,p {
1290
+ color: ${options.titleColor};
1291
+ }
1292
+ /* .cluster div {
1293
+ color: ${options.titleColor};
1294
+ } */
1295
+
1296
+ div.mermaidTooltip {
1297
+ position: absolute;
1298
+ text-align: center;
1299
+ max-width: 200px;
1300
+ padding: 2px;
1301
+ font-family: ${options.fontFamily};
1302
+ font-size: 12px;
1303
+ background: ${options.tertiaryColor};
1304
+ border: 1px solid ${options.border2};
1305
+ border-radius: 2px;
1306
+ pointer-events: none;
1307
+ z-index: 100;
1308
+ }
1309
+
1310
+ .flowchartTitleText {
1311
+ text-anchor: middle;
1312
+ font-size: 18px;
1313
+ fill: ${options.textColor};
1314
+ }
1315
+ `;
1316
+ const flowStyles = getStyles;
1317
+ function getNodeFromBlock(block, db2, positioned = false) {
1318
+ var _a2, _b2, _c;
1319
+ const vertex = block;
1320
+ let classStr = "default";
1321
+ if ((((_a2 = vertex == null ? void 0 : vertex.classes) == null ? void 0 : _a2.length) || 0) > 0) {
1322
+ classStr = ((vertex == null ? void 0 : vertex.classes) || []).join(" ");
1323
+ }
1324
+ classStr = classStr + " flowchart-label";
1325
+ let radius = 0;
1326
+ let shape = "";
1327
+ let padding2;
1328
+ switch (vertex.type) {
1329
+ case "round":
1330
+ radius = 5;
1331
+ shape = "rect";
1332
+ break;
1333
+ case "composite":
1334
+ radius = 0;
1335
+ shape = "composite";
1336
+ padding2 = 0;
1337
+ break;
1338
+ case "square":
1339
+ shape = "rect";
1340
+ break;
1341
+ case "diamond":
1342
+ shape = "question";
1343
+ break;
1344
+ case "hexagon":
1345
+ shape = "hexagon";
1346
+ break;
1347
+ case "block_arrow":
1348
+ shape = "block_arrow";
1349
+ break;
1350
+ case "odd":
1351
+ shape = "rect_left_inv_arrow";
1352
+ break;
1353
+ case "lean_right":
1354
+ shape = "lean_right";
1355
+ break;
1356
+ case "lean_left":
1357
+ shape = "lean_left";
1358
+ break;
1359
+ case "trapezoid":
1360
+ shape = "trapezoid";
1361
+ break;
1362
+ case "inv_trapezoid":
1363
+ shape = "inv_trapezoid";
1364
+ break;
1365
+ case "rect_left_inv_arrow":
1366
+ shape = "rect_left_inv_arrow";
1367
+ break;
1368
+ case "circle":
1369
+ shape = "circle";
1370
+ break;
1371
+ case "ellipse":
1372
+ shape = "ellipse";
1373
+ break;
1374
+ case "stadium":
1375
+ shape = "stadium";
1376
+ break;
1377
+ case "subroutine":
1378
+ shape = "subroutine";
1379
+ break;
1380
+ case "cylinder":
1381
+ shape = "cylinder";
1382
+ break;
1383
+ case "group":
1384
+ shape = "rect";
1385
+ break;
1386
+ case "doublecircle":
1387
+ shape = "doublecircle";
1388
+ break;
1389
+ default:
1390
+ shape = "rect";
1391
+ }
1392
+ const styles = getStylesFromArray((vertex == null ? void 0 : vertex.styles) || []);
1393
+ const vertexText = vertex.label;
1394
+ const bounds = vertex.size || { width: 0, height: 0, x: 0, y: 0 };
1395
+ const node = {
1396
+ labelStyle: styles.labelStyle,
1397
+ shape,
1398
+ labelText: vertexText,
1399
+ rx: radius,
1400
+ ry: radius,
1401
+ class: classStr,
1402
+ style: styles.style,
1403
+ id: vertex.id,
1404
+ directions: vertex.directions,
1405
+ width: bounds.width,
1406
+ height: bounds.height,
1407
+ x: bounds.x,
1408
+ y: bounds.y,
1409
+ positioned,
1410
+ intersect: void 0,
1411
+ type: vertex.type,
1412
+ padding: padding2 ?? (((_c = (_b2 = getConfig$1()) == null ? void 0 : _b2.block) == null ? void 0 : _c.padding) || 0)
1413
+ };
1414
+ return node;
1415
+ }
1416
+ async function calculateBlockSize(elem, block, db2) {
1417
+ const node = getNodeFromBlock(block, db2, false);
1418
+ if (node.type === "group") {
1419
+ return;
1420
+ }
1421
+ const nodeEl = await insertNode(elem, node);
1422
+ const boundingBox = nodeEl.node().getBBox();
1423
+ const obj = db2.getBlock(node.id);
1424
+ obj.size = { width: boundingBox.width, height: boundingBox.height, x: 0, y: 0, node: nodeEl };
1425
+ db2.setBlock(obj);
1426
+ nodeEl.remove();
1427
+ }
1428
+ async function insertBlockPositioned(elem, block, db2) {
1429
+ const node = getNodeFromBlock(block, db2, true);
1430
+ const obj = db2.getBlock(node.id);
1431
+ if (obj.type !== "space") {
1432
+ await insertNode(elem, node);
1433
+ block.intersect = node == null ? void 0 : node.intersect;
1434
+ positionNode(node);
1435
+ }
1436
+ }
1437
+ async function performOperations(elem, blocks2, db2, operation) {
1438
+ for (const block of blocks2) {
1439
+ await operation(elem, block, db2);
1440
+ if (block.children) {
1441
+ await performOperations(elem, block.children, db2, operation);
1442
+ }
1443
+ }
1444
+ }
1445
+ async function calculateBlockSizes(elem, blocks2, db2) {
1446
+ await performOperations(elem, blocks2, db2, calculateBlockSize);
1447
+ }
1448
+ async function insertBlocks(elem, blocks2, db2) {
1449
+ await performOperations(elem, blocks2, db2, insertBlockPositioned);
1450
+ }
1451
+ async function insertEdges(elem, edges, blocks2, db2, id) {
1452
+ const g = new Graph({
1453
+ multigraph: true,
1454
+ compound: true
1455
+ });
1456
+ g.setGraph({
1457
+ rankdir: "TB",
1458
+ nodesep: 10,
1459
+ ranksep: 10,
1460
+ marginx: 8,
1461
+ marginy: 8
1462
+ });
1463
+ for (const block of blocks2) {
1464
+ if (block.size) {
1465
+ g.setNode(block.id, {
1466
+ width: block.size.width,
1467
+ height: block.size.height,
1468
+ intersect: block.intersect
1469
+ });
1470
+ }
1471
+ }
1472
+ for (const edge of edges) {
1473
+ if (edge.start && edge.end) {
1474
+ const startBlock = db2.getBlock(edge.start);
1475
+ const endBlock = db2.getBlock(edge.end);
1476
+ if ((startBlock == null ? void 0 : startBlock.size) && (endBlock == null ? void 0 : endBlock.size)) {
1477
+ const start = startBlock.size;
1478
+ const end = endBlock.size;
1479
+ const points = [
1480
+ { x: start.x, y: start.y },
1481
+ { x: start.x + (end.x - start.x) / 2, y: start.y + (end.y - start.y) / 2 },
1482
+ { x: end.x, y: end.y }
1483
+ ];
1484
+ await insertEdge(
1485
+ elem,
1486
+ { v: edge.start, w: edge.end, name: edge.id },
1487
+ {
1488
+ ...edge,
1489
+ arrowTypeEnd: edge.arrowTypeEnd,
1490
+ arrowTypeStart: edge.arrowTypeStart,
1491
+ points,
1492
+ classes: "edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"
1493
+ },
1494
+ void 0,
1495
+ "block",
1496
+ g,
1497
+ id
1498
+ );
1499
+ if (edge.label) {
1500
+ await insertEdgeLabel(elem, {
1501
+ ...edge,
1502
+ label: edge.label,
1503
+ labelStyle: "stroke: #333; stroke-width: 1.5px;fill:none;",
1504
+ arrowTypeEnd: edge.arrowTypeEnd,
1505
+ arrowTypeStart: edge.arrowTypeStart,
1506
+ points,
1507
+ classes: "edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"
1508
+ });
1509
+ await positionEdgeLabel(
1510
+ { ...edge, x: points[1].x, y: points[1].y },
1511
+ {
1512
+ originalPath: points
1513
+ }
1514
+ );
1515
+ }
1516
+ }
1517
+ }
1518
+ }
1519
+ }
1520
+ const padding = ((_b = (_a = getConfig()) == null ? void 0 : _a.block) == null ? void 0 : _b.padding) || 8;
1521
+ function calculateBlockPosition(columns, position) {
1522
+ if (columns === 0 || !Number.isInteger(columns)) {
1523
+ throw new Error("Columns must be an integer !== 0.");
1524
+ }
1525
+ if (position < 0 || !Number.isInteger(position)) {
1526
+ throw new Error("Position must be a non-negative integer." + position);
1527
+ }
1528
+ if (columns < 0) {
1529
+ return { px: position, py: 0 };
1530
+ }
1531
+ if (columns === 1) {
1532
+ return { px: 0, py: position };
1533
+ }
1534
+ const px = position % columns;
1535
+ const py = Math.floor(position / columns);
1536
+ return { px, py };
1537
+ }
1538
+ const getMaxChildSize = (block) => {
1539
+ let maxWidth = 0;
1540
+ let maxHeight = 0;
1541
+ for (const child of block.children) {
1542
+ const { width, height, x, y } = child.size || { width: 0, height: 0, x: 0, y: 0 };
1543
+ log.debug(
1544
+ "getMaxChildSize abc95 child:",
1545
+ child.id,
1546
+ "width:",
1547
+ width,
1548
+ "height:",
1549
+ height,
1550
+ "x:",
1551
+ x,
1552
+ "y:",
1553
+ y,
1554
+ child.type
1555
+ );
1556
+ if (child.type === "space") {
1557
+ continue;
1558
+ }
1559
+ if (width > maxWidth) {
1560
+ maxWidth = width / (block.widthInColumns || 1);
1561
+ }
1562
+ if (height > maxHeight) {
1563
+ maxHeight = height;
1564
+ }
1565
+ }
1566
+ return { width: maxWidth, height: maxHeight };
1567
+ };
1568
+ function setBlockSizes(block, db2, siblingWidth = 0, siblingHeight = 0) {
1569
+ var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k;
1570
+ log.debug(
1571
+ "setBlockSizes abc95 (start)",
1572
+ block.id,
1573
+ (_a2 = block == null ? void 0 : block.size) == null ? void 0 : _a2.x,
1574
+ "block width =",
1575
+ block == null ? void 0 : block.size,
1576
+ "sieblingWidth",
1577
+ siblingWidth
1578
+ );
1579
+ if (!((_b2 = block == null ? void 0 : block.size) == null ? void 0 : _b2.width)) {
1580
+ block.size = {
1581
+ width: siblingWidth,
1582
+ height: siblingHeight,
1583
+ x: 0,
1584
+ y: 0
1585
+ };
1586
+ }
1587
+ let maxWidth = 0;
1588
+ let maxHeight = 0;
1589
+ if (((_c = block.children) == null ? void 0 : _c.length) > 0) {
1590
+ for (const child of block.children) {
1591
+ setBlockSizes(child, db2);
1592
+ }
1593
+ const childSize = getMaxChildSize(block);
1594
+ maxWidth = childSize.width;
1595
+ maxHeight = childSize.height;
1596
+ log.debug("setBlockSizes abc95 maxWidth of", block.id, ":s children is ", maxWidth, maxHeight);
1597
+ for (const child of block.children) {
1598
+ if (child.size) {
1599
+ log.debug(
1600
+ `abc95 Setting size of children of ${block.id} id=${child.id} ${maxWidth} ${maxHeight} ${child.size}`
1601
+ );
1602
+ child.size.width = maxWidth * (child.widthInColumns || 1) + padding * ((child.widthInColumns || 1) - 1);
1603
+ child.size.height = maxHeight;
1604
+ child.size.x = 0;
1605
+ child.size.y = 0;
1606
+ log.debug(
1607
+ `abc95 updating size of ${block.id} children child:${child.id} maxWidth:${maxWidth} maxHeight:${maxHeight}`
1608
+ );
1609
+ }
1610
+ }
1611
+ for (const child of block.children) {
1612
+ setBlockSizes(child, db2, maxWidth, maxHeight);
1613
+ }
1614
+ const columns = block.columns || -1;
1615
+ let numItems = 0;
1616
+ for (const child of block.children) {
1617
+ numItems += child.widthInColumns || 1;
1618
+ }
1619
+ let xSize = block.children.length;
1620
+ if (columns > 0 && columns < numItems) {
1621
+ xSize = columns;
1622
+ }
1623
+ block.widthInColumns || 1;
1624
+ const ySize = Math.ceil(numItems / xSize);
1625
+ let width = xSize * (maxWidth + padding) + padding;
1626
+ let height = ySize * (maxHeight + padding) + padding;
1627
+ if (width < siblingWidth) {
1628
+ log.debug(
1629
+ `Detected to small siebling: abc95 ${block.id} sieblingWidth ${siblingWidth} sieblingHeight ${siblingHeight} width ${width}`
1630
+ );
1631
+ width = siblingWidth;
1632
+ height = siblingHeight;
1633
+ const childWidth = (siblingWidth - xSize * padding - padding) / xSize;
1634
+ const childHeight = (siblingHeight - ySize * padding - padding) / ySize;
1635
+ log.debug("Size indata abc88", block.id, "childWidth", childWidth, "maxWidth", maxWidth);
1636
+ log.debug("Size indata abc88", block.id, "childHeight", childHeight, "maxHeight", maxHeight);
1637
+ log.debug("Size indata abc88 xSize", xSize, "padding", padding);
1638
+ for (const child of block.children) {
1639
+ if (child.size) {
1640
+ child.size.width = childWidth;
1641
+ child.size.height = childHeight;
1642
+ child.size.x = 0;
1643
+ child.size.y = 0;
1644
+ }
1645
+ }
1646
+ }
1647
+ log.debug(
1648
+ `abc95 (finale calc) ${block.id} xSize ${xSize} ySize ${ySize} columns ${columns}${block.children.length} width=${Math.max(width, ((_d = block.size) == null ? void 0 : _d.width) || 0)}`
1649
+ );
1650
+ if (width < (((_e = block == null ? void 0 : block.size) == null ? void 0 : _e.width) || 0)) {
1651
+ width = ((_f = block == null ? void 0 : block.size) == null ? void 0 : _f.width) || 0;
1652
+ const num = columns > 0 ? Math.min(block.children.length, columns) : block.children.length;
1653
+ if (num > 0) {
1654
+ const childWidth = (width - num * padding - padding) / num;
1655
+ log.debug("abc95 (growing to fit) width", block.id, width, (_g = block.size) == null ? void 0 : _g.width, childWidth);
1656
+ for (const child of block.children) {
1657
+ if (child.size) {
1658
+ child.size.width = childWidth;
1659
+ }
1660
+ }
1661
+ }
1662
+ }
1663
+ block.size = {
1664
+ width,
1665
+ height,
1666
+ x: 0,
1667
+ y: 0
1668
+ };
1669
+ }
1670
+ log.debug(
1671
+ "setBlockSizes abc94 (done)",
1672
+ block.id,
1673
+ (_h = block == null ? void 0 : block.size) == null ? void 0 : _h.x,
1674
+ (_i = block == null ? void 0 : block.size) == null ? void 0 : _i.width,
1675
+ (_j = block == null ? void 0 : block.size) == null ? void 0 : _j.y,
1676
+ (_k = block == null ? void 0 : block.size) == null ? void 0 : _k.height
1677
+ );
1678
+ }
1679
+ function layoutBlocks(block, db2) {
1680
+ var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q;
1681
+ log.debug(
1682
+ `abc85 layout blocks (=>layoutBlocks) ${block.id} x: ${(_a2 = block == null ? void 0 : block.size) == null ? void 0 : _a2.x} y: ${(_b2 = block == null ? void 0 : block.size) == null ? void 0 : _b2.y} width: ${(_c = block == null ? void 0 : block.size) == null ? void 0 : _c.width}`
1683
+ );
1684
+ const columns = block.columns || -1;
1685
+ log.debug("layoutBlocks columns abc95", block.id, "=>", columns, block);
1686
+ if (block.children && // find max width of children
1687
+ block.children.length > 0) {
1688
+ const width = ((_e = (_d = block == null ? void 0 : block.children[0]) == null ? void 0 : _d.size) == null ? void 0 : _e.width) || 0;
1689
+ const widthOfChildren = block.children.length * width + (block.children.length - 1) * padding;
1690
+ log.debug("widthOfChildren 88", widthOfChildren, "posX");
1691
+ let columnPos = 0;
1692
+ log.debug("abc91 block?.size?.x", block.id, (_f = block == null ? void 0 : block.size) == null ? void 0 : _f.x);
1693
+ let startingPosX = ((_g = block == null ? void 0 : block.size) == null ? void 0 : _g.x) ? ((_h = block == null ? void 0 : block.size) == null ? void 0 : _h.x) + (-((_i = block == null ? void 0 : block.size) == null ? void 0 : _i.width) / 2 || 0) : -padding;
1694
+ let rowPos = 0;
1695
+ for (const child of block.children) {
1696
+ const parent = block;
1697
+ if (!child.size) {
1698
+ continue;
1699
+ }
1700
+ const { width: width2, height } = child.size;
1701
+ const { px, py } = calculateBlockPosition(columns, columnPos);
1702
+ if (py != rowPos) {
1703
+ rowPos = py;
1704
+ startingPosX = ((_j = block == null ? void 0 : block.size) == null ? void 0 : _j.x) ? ((_k = block == null ? void 0 : block.size) == null ? void 0 : _k.x) + (-((_l = block == null ? void 0 : block.size) == null ? void 0 : _l.width) / 2 || 0) : -padding;
1705
+ log.debug("New row in layout for block", block.id, " and child ", child.id, rowPos);
1706
+ }
1707
+ log.debug(
1708
+ `abc89 layout blocks (child) id: ${child.id} Pos: ${columnPos} (px, py) ${px},${py} (${(_m = parent == null ? void 0 : parent.size) == null ? void 0 : _m.x},${(_n = parent == null ? void 0 : parent.size) == null ? void 0 : _n.y}) parent: ${parent.id} width: ${width2}${padding}`
1709
+ );
1710
+ if (parent.size) {
1711
+ const halfWidth = width2 / 2;
1712
+ child.size.x = startingPosX + padding + halfWidth;
1713
+ log.debug(
1714
+ `abc91 layout blocks (calc) px, pyid:${child.id} startingPos=X${startingPosX} new startingPosX${child.size.x} ${halfWidth} padding=${padding} width=${width2} halfWidth=${halfWidth} => x:${child.size.x} y:${child.size.y} ${child.widthInColumns} (width * (child?.w || 1)) / 2 ${width2 * ((child == null ? void 0 : child.widthInColumns) || 1) / 2}`
1715
+ );
1716
+ startingPosX = child.size.x + halfWidth;
1717
+ child.size.y = parent.size.y - parent.size.height / 2 + py * (height + padding) + height / 2 + padding;
1718
+ log.debug(
1719
+ `abc88 layout blocks (calc) px, pyid:${child.id}startingPosX${startingPosX}${padding}${halfWidth}=>x:${child.size.x}y:${child.size.y}${child.widthInColumns}(width * (child?.w || 1)) / 2${width2 * ((child == null ? void 0 : child.widthInColumns) || 1) / 2}`
1720
+ );
1721
+ }
1722
+ if (child.children) {
1723
+ layoutBlocks(child);
1724
+ }
1725
+ columnPos += (child == null ? void 0 : child.widthInColumns) || 1;
1726
+ log.debug("abc88 columnsPos", child, columnPos);
1727
+ }
1728
+ }
1729
+ log.debug(
1730
+ `layout blocks (<==layoutBlocks) ${block.id} x: ${(_o = block == null ? void 0 : block.size) == null ? void 0 : _o.x} y: ${(_p = block == null ? void 0 : block.size) == null ? void 0 : _p.y} width: ${(_q = block == null ? void 0 : block.size) == null ? void 0 : _q.width}`
1731
+ );
1732
+ }
1733
+ function findBounds(block, { minX, minY, maxX, maxY } = { minX: 0, minY: 0, maxX: 0, maxY: 0 }) {
1734
+ if (block.size && block.id !== "root") {
1735
+ const { x, y, width, height } = block.size;
1736
+ if (x - width / 2 < minX) {
1737
+ minX = x - width / 2;
1738
+ }
1739
+ if (y - height / 2 < minY) {
1740
+ minY = y - height / 2;
1741
+ }
1742
+ if (x + width / 2 > maxX) {
1743
+ maxX = x + width / 2;
1744
+ }
1745
+ if (y + height / 2 > maxY) {
1746
+ maxY = y + height / 2;
1747
+ }
1748
+ }
1749
+ if (block.children) {
1750
+ for (const child of block.children) {
1751
+ ({ minX, minY, maxX, maxY } = findBounds(child, { minX, minY, maxX, maxY }));
1752
+ }
1753
+ }
1754
+ return { minX, minY, maxX, maxY };
1755
+ }
1756
+ function layout(db2) {
1757
+ const root = db2.getBlock("root");
1758
+ if (!root) {
1759
+ return;
1760
+ }
1761
+ setBlockSizes(root, db2, 0, 0);
1762
+ layoutBlocks(root);
1763
+ log.debug("getBlocks", JSON.stringify(root, null, 2));
1764
+ const { minX, minY, maxX, maxY } = findBounds(root);
1765
+ const height = maxY - minY;
1766
+ const width = maxX - minX;
1767
+ return { x: minX, y: minY, width, height };
1768
+ }
1769
+ const getClasses = function(text, diagObj) {
1770
+ return diagObj.db.getClasses();
1771
+ };
1772
+ const draw = async function(text, id, _version, diagObj) {
1773
+ const { securityLevel, block: conf } = getConfig$1();
1774
+ const db2 = diagObj.db;
1775
+ let sandboxElement;
1776
+ if (securityLevel === "sandbox") {
1777
+ sandboxElement = d3select("#i" + id);
1778
+ }
1779
+ const root = securityLevel === "sandbox" ? d3select(sandboxElement.nodes()[0].contentDocument.body) : d3select("body");
1780
+ const svg = securityLevel === "sandbox" ? root.select(`[id="${id}"]`) : d3select(`[id="${id}"]`);
1781
+ const markers = ["point", "circle", "cross"];
1782
+ insertMarkers(svg, markers, diagObj.type, id);
1783
+ const bl = db2.getBlocks();
1784
+ const blArr = db2.getBlocksFlat();
1785
+ const edges = db2.getEdges();
1786
+ const nodes = svg.insert("g").attr("class", "block");
1787
+ await calculateBlockSizes(nodes, bl, db2);
1788
+ const bounds = layout(db2);
1789
+ await insertBlocks(nodes, bl, db2);
1790
+ await insertEdges(nodes, edges, blArr, db2, id);
1791
+ if (bounds) {
1792
+ const bounds2 = bounds;
1793
+ const magicFactor = Math.max(1, Math.round(0.125 * (bounds2.width / bounds2.height)));
1794
+ const height = bounds2.height + magicFactor + 10;
1795
+ const width = bounds2.width + 10;
1796
+ const { useMaxWidth } = conf;
1797
+ configureSvgSize(svg, height, width, !!useMaxWidth);
1798
+ log.debug("Here Bounds", bounds, bounds2);
1799
+ svg.attr(
1800
+ "viewBox",
1801
+ `${bounds2.x - 5} ${bounds2.y - 5} ${bounds2.width + 10} ${bounds2.height + 10}`
1802
+ );
1803
+ }
1804
+ ordinal(d3schemeTableau10);
1805
+ };
1806
+ const renderer = {
1807
+ draw,
1808
+ getClasses
1809
+ };
1810
+ const diagram = {
1811
+ parser: parser$1,
1812
+ db: db$1,
1813
+ renderer,
1814
+ styles: flowStyles
1815
+ };
1816
+ export {
1817
+ diagram
1818
+ };