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,2463 @@
1
+ import { s as setAccTitle, g as getAccTitle, a as getAccDescription, b as setAccDescription, c as getConfig, d as sanitizeText, e as dist, f as common, h as assignWithDepth, i as calculateTextWidth, j as d3select, l as log, k as configureSvgSize, w as wrapLabel, m as calculateTextHeight } from "./mermaid-dcacb631.js";
2
+ import { d as drawRect$1, g as getNoteRect } from "./svgDrawCommon-d6ab583c.js";
3
+ var parser = function() {
4
+ var o = function(k, v, o2, l) {
5
+ for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v)
6
+ ;
7
+ return o2;
8
+ }, $V0 = [1, 24], $V1 = [1, 25], $V2 = [1, 26], $V3 = [1, 27], $V4 = [1, 28], $V5 = [1, 63], $V6 = [1, 64], $V7 = [1, 65], $V8 = [1, 66], $V9 = [1, 67], $Va = [1, 68], $Vb = [1, 69], $Vc = [1, 29], $Vd = [1, 30], $Ve = [1, 31], $Vf = [1, 32], $Vg = [1, 33], $Vh = [1, 34], $Vi = [1, 35], $Vj = [1, 36], $Vk = [1, 37], $Vl = [1, 38], $Vm = [1, 39], $Vn = [1, 40], $Vo = [1, 41], $Vp = [1, 42], $Vq = [1, 43], $Vr = [1, 44], $Vs = [1, 45], $Vt = [1, 46], $Vu = [1, 47], $Vv = [1, 48], $Vw = [1, 50], $Vx = [1, 51], $Vy = [1, 52], $Vz = [1, 53], $VA = [1, 54], $VB = [1, 55], $VC = [1, 56], $VD = [1, 57], $VE = [1, 58], $VF = [1, 59], $VG = [1, 60], $VH = [14, 42], $VI = [14, 34, 36, 37, 38, 39, 40, 41, 42, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74], $VJ = [12, 14, 34, 36, 37, 38, 39, 40, 41, 42, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74], $VK = [1, 82], $VL = [1, 83], $VM = [1, 84], $VN = [1, 85], $VO = [12, 14, 42], $VP = [12, 14, 33, 42], $VQ = [12, 14, 33, 42, 76, 77, 79, 80], $VR = [12, 33], $VS = [34, 36, 37, 38, 39, 40, 41, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74];
9
+ var parser2 = {
10
+ trace: function trace() {
11
+ },
12
+ yy: {},
13
+ symbols_: { "error": 2, "start": 3, "mermaidDoc": 4, "direction": 5, "direction_tb": 6, "direction_bt": 7, "direction_rl": 8, "direction_lr": 9, "graphConfig": 10, "C4_CONTEXT": 11, "NEWLINE": 12, "statements": 13, "EOF": 14, "C4_CONTAINER": 15, "C4_COMPONENT": 16, "C4_DYNAMIC": 17, "C4_DEPLOYMENT": 18, "otherStatements": 19, "diagramStatements": 20, "otherStatement": 21, "title": 22, "accDescription": 23, "acc_title": 24, "acc_title_value": 25, "acc_descr": 26, "acc_descr_value": 27, "acc_descr_multiline_value": 28, "boundaryStatement": 29, "boundaryStartStatement": 30, "boundaryStopStatement": 31, "boundaryStart": 32, "LBRACE": 33, "ENTERPRISE_BOUNDARY": 34, "attributes": 35, "SYSTEM_BOUNDARY": 36, "BOUNDARY": 37, "CONTAINER_BOUNDARY": 38, "NODE": 39, "NODE_L": 40, "NODE_R": 41, "RBRACE": 42, "diagramStatement": 43, "PERSON": 44, "PERSON_EXT": 45, "SYSTEM": 46, "SYSTEM_DB": 47, "SYSTEM_QUEUE": 48, "SYSTEM_EXT": 49, "SYSTEM_EXT_DB": 50, "SYSTEM_EXT_QUEUE": 51, "CONTAINER": 52, "CONTAINER_DB": 53, "CONTAINER_QUEUE": 54, "CONTAINER_EXT": 55, "CONTAINER_EXT_DB": 56, "CONTAINER_EXT_QUEUE": 57, "COMPONENT": 58, "COMPONENT_DB": 59, "COMPONENT_QUEUE": 60, "COMPONENT_EXT": 61, "COMPONENT_EXT_DB": 62, "COMPONENT_EXT_QUEUE": 63, "REL": 64, "BIREL": 65, "REL_U": 66, "REL_D": 67, "REL_L": 68, "REL_R": 69, "REL_B": 70, "REL_INDEX": 71, "UPDATE_EL_STYLE": 72, "UPDATE_REL_STYLE": 73, "UPDATE_LAYOUT_CONFIG": 74, "attribute": 75, "STR": 76, "STR_KEY": 77, "STR_VALUE": 78, "ATTRIBUTE": 79, "ATTRIBUTE_EMPTY": 80, "$accept": 0, "$end": 1 },
14
+ terminals_: { 2: "error", 6: "direction_tb", 7: "direction_bt", 8: "direction_rl", 9: "direction_lr", 11: "C4_CONTEXT", 12: "NEWLINE", 14: "EOF", 15: "C4_CONTAINER", 16: "C4_COMPONENT", 17: "C4_DYNAMIC", 18: "C4_DEPLOYMENT", 22: "title", 23: "accDescription", 24: "acc_title", 25: "acc_title_value", 26: "acc_descr", 27: "acc_descr_value", 28: "acc_descr_multiline_value", 33: "LBRACE", 34: "ENTERPRISE_BOUNDARY", 36: "SYSTEM_BOUNDARY", 37: "BOUNDARY", 38: "CONTAINER_BOUNDARY", 39: "NODE", 40: "NODE_L", 41: "NODE_R", 42: "RBRACE", 44: "PERSON", 45: "PERSON_EXT", 46: "SYSTEM", 47: "SYSTEM_DB", 48: "SYSTEM_QUEUE", 49: "SYSTEM_EXT", 50: "SYSTEM_EXT_DB", 51: "SYSTEM_EXT_QUEUE", 52: "CONTAINER", 53: "CONTAINER_DB", 54: "CONTAINER_QUEUE", 55: "CONTAINER_EXT", 56: "CONTAINER_EXT_DB", 57: "CONTAINER_EXT_QUEUE", 58: "COMPONENT", 59: "COMPONENT_DB", 60: "COMPONENT_QUEUE", 61: "COMPONENT_EXT", 62: "COMPONENT_EXT_DB", 63: "COMPONENT_EXT_QUEUE", 64: "REL", 65: "BIREL", 66: "REL_U", 67: "REL_D", 68: "REL_L", 69: "REL_R", 70: "REL_B", 71: "REL_INDEX", 72: "UPDATE_EL_STYLE", 73: "UPDATE_REL_STYLE", 74: "UPDATE_LAYOUT_CONFIG", 76: "STR", 77: "STR_KEY", 78: "STR_VALUE", 79: "ATTRIBUTE", 80: "ATTRIBUTE_EMPTY" },
15
+ productions_: [0, [3, 1], [3, 1], [5, 1], [5, 1], [5, 1], [5, 1], [4, 1], [10, 4], [10, 4], [10, 4], [10, 4], [10, 4], [13, 1], [13, 1], [13, 2], [19, 1], [19, 2], [19, 3], [21, 1], [21, 1], [21, 2], [21, 2], [21, 1], [29, 3], [30, 3], [30, 3], [30, 4], [32, 2], [32, 2], [32, 2], [32, 2], [32, 2], [32, 2], [32, 2], [31, 1], [20, 1], [20, 2], [20, 3], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 1], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [35, 1], [35, 2], [75, 1], [75, 2], [75, 1], [75, 1]],
16
+ performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) {
17
+ var $0 = $$.length - 1;
18
+ switch (yystate) {
19
+ case 3:
20
+ yy.setDirection("TB");
21
+ break;
22
+ case 4:
23
+ yy.setDirection("BT");
24
+ break;
25
+ case 5:
26
+ yy.setDirection("RL");
27
+ break;
28
+ case 6:
29
+ yy.setDirection("LR");
30
+ break;
31
+ case 8:
32
+ case 9:
33
+ case 10:
34
+ case 11:
35
+ case 12:
36
+ yy.setC4Type($$[$0 - 3]);
37
+ break;
38
+ case 19:
39
+ yy.setTitle($$[$0].substring(6));
40
+ this.$ = $$[$0].substring(6);
41
+ break;
42
+ case 20:
43
+ yy.setAccDescription($$[$0].substring(15));
44
+ this.$ = $$[$0].substring(15);
45
+ break;
46
+ case 21:
47
+ this.$ = $$[$0].trim();
48
+ yy.setTitle(this.$);
49
+ break;
50
+ case 22:
51
+ case 23:
52
+ this.$ = $$[$0].trim();
53
+ yy.setAccDescription(this.$);
54
+ break;
55
+ case 28:
56
+ case 29:
57
+ $$[$0].splice(2, 0, "ENTERPRISE");
58
+ yy.addPersonOrSystemBoundary(...$$[$0]);
59
+ this.$ = $$[$0];
60
+ break;
61
+ case 30:
62
+ yy.addPersonOrSystemBoundary(...$$[$0]);
63
+ this.$ = $$[$0];
64
+ break;
65
+ case 31:
66
+ $$[$0].splice(2, 0, "CONTAINER");
67
+ yy.addContainerBoundary(...$$[$0]);
68
+ this.$ = $$[$0];
69
+ break;
70
+ case 32:
71
+ yy.addDeploymentNode("node", ...$$[$0]);
72
+ this.$ = $$[$0];
73
+ break;
74
+ case 33:
75
+ yy.addDeploymentNode("nodeL", ...$$[$0]);
76
+ this.$ = $$[$0];
77
+ break;
78
+ case 34:
79
+ yy.addDeploymentNode("nodeR", ...$$[$0]);
80
+ this.$ = $$[$0];
81
+ break;
82
+ case 35:
83
+ yy.popBoundaryParseStack();
84
+ break;
85
+ case 39:
86
+ yy.addPersonOrSystem("person", ...$$[$0]);
87
+ this.$ = $$[$0];
88
+ break;
89
+ case 40:
90
+ yy.addPersonOrSystem("external_person", ...$$[$0]);
91
+ this.$ = $$[$0];
92
+ break;
93
+ case 41:
94
+ yy.addPersonOrSystem("system", ...$$[$0]);
95
+ this.$ = $$[$0];
96
+ break;
97
+ case 42:
98
+ yy.addPersonOrSystem("system_db", ...$$[$0]);
99
+ this.$ = $$[$0];
100
+ break;
101
+ case 43:
102
+ yy.addPersonOrSystem("system_queue", ...$$[$0]);
103
+ this.$ = $$[$0];
104
+ break;
105
+ case 44:
106
+ yy.addPersonOrSystem("external_system", ...$$[$0]);
107
+ this.$ = $$[$0];
108
+ break;
109
+ case 45:
110
+ yy.addPersonOrSystem("external_system_db", ...$$[$0]);
111
+ this.$ = $$[$0];
112
+ break;
113
+ case 46:
114
+ yy.addPersonOrSystem("external_system_queue", ...$$[$0]);
115
+ this.$ = $$[$0];
116
+ break;
117
+ case 47:
118
+ yy.addContainer("container", ...$$[$0]);
119
+ this.$ = $$[$0];
120
+ break;
121
+ case 48:
122
+ yy.addContainer("container_db", ...$$[$0]);
123
+ this.$ = $$[$0];
124
+ break;
125
+ case 49:
126
+ yy.addContainer("container_queue", ...$$[$0]);
127
+ this.$ = $$[$0];
128
+ break;
129
+ case 50:
130
+ yy.addContainer("external_container", ...$$[$0]);
131
+ this.$ = $$[$0];
132
+ break;
133
+ case 51:
134
+ yy.addContainer("external_container_db", ...$$[$0]);
135
+ this.$ = $$[$0];
136
+ break;
137
+ case 52:
138
+ yy.addContainer("external_container_queue", ...$$[$0]);
139
+ this.$ = $$[$0];
140
+ break;
141
+ case 53:
142
+ yy.addComponent("component", ...$$[$0]);
143
+ this.$ = $$[$0];
144
+ break;
145
+ case 54:
146
+ yy.addComponent("component_db", ...$$[$0]);
147
+ this.$ = $$[$0];
148
+ break;
149
+ case 55:
150
+ yy.addComponent("component_queue", ...$$[$0]);
151
+ this.$ = $$[$0];
152
+ break;
153
+ case 56:
154
+ yy.addComponent("external_component", ...$$[$0]);
155
+ this.$ = $$[$0];
156
+ break;
157
+ case 57:
158
+ yy.addComponent("external_component_db", ...$$[$0]);
159
+ this.$ = $$[$0];
160
+ break;
161
+ case 58:
162
+ yy.addComponent("external_component_queue", ...$$[$0]);
163
+ this.$ = $$[$0];
164
+ break;
165
+ case 60:
166
+ yy.addRel("rel", ...$$[$0]);
167
+ this.$ = $$[$0];
168
+ break;
169
+ case 61:
170
+ yy.addRel("birel", ...$$[$0]);
171
+ this.$ = $$[$0];
172
+ break;
173
+ case 62:
174
+ yy.addRel("rel_u", ...$$[$0]);
175
+ this.$ = $$[$0];
176
+ break;
177
+ case 63:
178
+ yy.addRel("rel_d", ...$$[$0]);
179
+ this.$ = $$[$0];
180
+ break;
181
+ case 64:
182
+ yy.addRel("rel_l", ...$$[$0]);
183
+ this.$ = $$[$0];
184
+ break;
185
+ case 65:
186
+ yy.addRel("rel_r", ...$$[$0]);
187
+ this.$ = $$[$0];
188
+ break;
189
+ case 66:
190
+ yy.addRel("rel_b", ...$$[$0]);
191
+ this.$ = $$[$0];
192
+ break;
193
+ case 67:
194
+ $$[$0].splice(0, 1);
195
+ yy.addRel("rel", ...$$[$0]);
196
+ this.$ = $$[$0];
197
+ break;
198
+ case 68:
199
+ yy.updateElStyle("update_el_style", ...$$[$0]);
200
+ this.$ = $$[$0];
201
+ break;
202
+ case 69:
203
+ yy.updateRelStyle("update_rel_style", ...$$[$0]);
204
+ this.$ = $$[$0];
205
+ break;
206
+ case 70:
207
+ yy.updateLayoutConfig("update_layout_config", ...$$[$0]);
208
+ this.$ = $$[$0];
209
+ break;
210
+ case 71:
211
+ this.$ = [$$[$0]];
212
+ break;
213
+ case 72:
214
+ $$[$0].unshift($$[$0 - 1]);
215
+ this.$ = $$[$0];
216
+ break;
217
+ case 73:
218
+ case 75:
219
+ this.$ = $$[$0].trim();
220
+ break;
221
+ case 74:
222
+ let kv = {};
223
+ kv[$$[$0 - 1].trim()] = $$[$0].trim();
224
+ this.$ = kv;
225
+ break;
226
+ case 76:
227
+ this.$ = "";
228
+ break;
229
+ }
230
+ },
231
+ table: [{ 3: 1, 4: 2, 5: 3, 6: [1, 5], 7: [1, 6], 8: [1, 7], 9: [1, 8], 10: 4, 11: [1, 9], 15: [1, 10], 16: [1, 11], 17: [1, 12], 18: [1, 13] }, { 1: [3] }, { 1: [2, 1] }, { 1: [2, 2] }, { 1: [2, 7] }, { 1: [2, 3] }, { 1: [2, 4] }, { 1: [2, 5] }, { 1: [2, 6] }, { 12: [1, 14] }, { 12: [1, 15] }, { 12: [1, 16] }, { 12: [1, 17] }, { 12: [1, 18] }, { 13: 19, 19: 20, 20: 21, 21: 22, 22: $V0, 23: $V1, 24: $V2, 26: $V3, 28: $V4, 29: 49, 30: 61, 32: 62, 34: $V5, 36: $V6, 37: $V7, 38: $V8, 39: $V9, 40: $Va, 41: $Vb, 43: 23, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi, 51: $Vj, 52: $Vk, 53: $Vl, 54: $Vm, 55: $Vn, 56: $Vo, 57: $Vp, 58: $Vq, 59: $Vr, 60: $Vs, 61: $Vt, 62: $Vu, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz, 68: $VA, 69: $VB, 70: $VC, 71: $VD, 72: $VE, 73: $VF, 74: $VG }, { 13: 70, 19: 20, 20: 21, 21: 22, 22: $V0, 23: $V1, 24: $V2, 26: $V3, 28: $V4, 29: 49, 30: 61, 32: 62, 34: $V5, 36: $V6, 37: $V7, 38: $V8, 39: $V9, 40: $Va, 41: $Vb, 43: 23, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi, 51: $Vj, 52: $Vk, 53: $Vl, 54: $Vm, 55: $Vn, 56: $Vo, 57: $Vp, 58: $Vq, 59: $Vr, 60: $Vs, 61: $Vt, 62: $Vu, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz, 68: $VA, 69: $VB, 70: $VC, 71: $VD, 72: $VE, 73: $VF, 74: $VG }, { 13: 71, 19: 20, 20: 21, 21: 22, 22: $V0, 23: $V1, 24: $V2, 26: $V3, 28: $V4, 29: 49, 30: 61, 32: 62, 34: $V5, 36: $V6, 37: $V7, 38: $V8, 39: $V9, 40: $Va, 41: $Vb, 43: 23, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi, 51: $Vj, 52: $Vk, 53: $Vl, 54: $Vm, 55: $Vn, 56: $Vo, 57: $Vp, 58: $Vq, 59: $Vr, 60: $Vs, 61: $Vt, 62: $Vu, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz, 68: $VA, 69: $VB, 70: $VC, 71: $VD, 72: $VE, 73: $VF, 74: $VG }, { 13: 72, 19: 20, 20: 21, 21: 22, 22: $V0, 23: $V1, 24: $V2, 26: $V3, 28: $V4, 29: 49, 30: 61, 32: 62, 34: $V5, 36: $V6, 37: $V7, 38: $V8, 39: $V9, 40: $Va, 41: $Vb, 43: 23, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi, 51: $Vj, 52: $Vk, 53: $Vl, 54: $Vm, 55: $Vn, 56: $Vo, 57: $Vp, 58: $Vq, 59: $Vr, 60: $Vs, 61: $Vt, 62: $Vu, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz, 68: $VA, 69: $VB, 70: $VC, 71: $VD, 72: $VE, 73: $VF, 74: $VG }, { 13: 73, 19: 20, 20: 21, 21: 22, 22: $V0, 23: $V1, 24: $V2, 26: $V3, 28: $V4, 29: 49, 30: 61, 32: 62, 34: $V5, 36: $V6, 37: $V7, 38: $V8, 39: $V9, 40: $Va, 41: $Vb, 43: 23, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi, 51: $Vj, 52: $Vk, 53: $Vl, 54: $Vm, 55: $Vn, 56: $Vo, 57: $Vp, 58: $Vq, 59: $Vr, 60: $Vs, 61: $Vt, 62: $Vu, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz, 68: $VA, 69: $VB, 70: $VC, 71: $VD, 72: $VE, 73: $VF, 74: $VG }, { 14: [1, 74] }, o($VH, [2, 13], { 43: 23, 29: 49, 30: 61, 32: 62, 20: 75, 34: $V5, 36: $V6, 37: $V7, 38: $V8, 39: $V9, 40: $Va, 41: $Vb, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi, 51: $Vj, 52: $Vk, 53: $Vl, 54: $Vm, 55: $Vn, 56: $Vo, 57: $Vp, 58: $Vq, 59: $Vr, 60: $Vs, 61: $Vt, 62: $Vu, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz, 68: $VA, 69: $VB, 70: $VC, 71: $VD, 72: $VE, 73: $VF, 74: $VG }), o($VH, [2, 14]), o($VI, [2, 16], { 12: [1, 76] }), o($VH, [2, 36], { 12: [1, 77] }), o($VJ, [2, 19]), o($VJ, [2, 20]), { 25: [1, 78] }, { 27: [1, 79] }, o($VJ, [2, 23]), { 35: 80, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 86, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 87, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 88, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 89, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 90, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 91, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 92, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 93, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 94, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 95, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 96, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 97, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 98, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 99, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 100, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 101, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 102, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 103, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 104, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, o($VO, [2, 59]), { 35: 105, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 106, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 107, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 108, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 109, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 110, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 111, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 112, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 113, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 114, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 115, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 20: 116, 29: 49, 30: 61, 32: 62, 34: $V5, 36: $V6, 37: $V7, 38: $V8, 39: $V9, 40: $Va, 41: $Vb, 43: 23, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi, 51: $Vj, 52: $Vk, 53: $Vl, 54: $Vm, 55: $Vn, 56: $Vo, 57: $Vp, 58: $Vq, 59: $Vr, 60: $Vs, 61: $Vt, 62: $Vu, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz, 68: $VA, 69: $VB, 70: $VC, 71: $VD, 72: $VE, 73: $VF, 74: $VG }, { 12: [1, 118], 33: [1, 117] }, { 35: 119, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 120, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 121, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 122, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 123, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 124, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 125, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 14: [1, 126] }, { 14: [1, 127] }, { 14: [1, 128] }, { 14: [1, 129] }, { 1: [2, 8] }, o($VH, [2, 15]), o($VI, [2, 17], { 21: 22, 19: 130, 22: $V0, 23: $V1, 24: $V2, 26: $V3, 28: $V4 }), o($VH, [2, 37], { 19: 20, 20: 21, 21: 22, 43: 23, 29: 49, 30: 61, 32: 62, 13: 131, 22: $V0, 23: $V1, 24: $V2, 26: $V3, 28: $V4, 34: $V5, 36: $V6, 37: $V7, 38: $V8, 39: $V9, 40: $Va, 41: $Vb, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi, 51: $Vj, 52: $Vk, 53: $Vl, 54: $Vm, 55: $Vn, 56: $Vo, 57: $Vp, 58: $Vq, 59: $Vr, 60: $Vs, 61: $Vt, 62: $Vu, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz, 68: $VA, 69: $VB, 70: $VC, 71: $VD, 72: $VE, 73: $VF, 74: $VG }), o($VJ, [2, 21]), o($VJ, [2, 22]), o($VO, [2, 39]), o($VP, [2, 71], { 75: 81, 35: 132, 76: $VK, 77: $VL, 79: $VM, 80: $VN }), o($VQ, [2, 73]), { 78: [1, 133] }, o($VQ, [2, 75]), o($VQ, [2, 76]), o($VO, [2, 40]), o($VO, [2, 41]), o($VO, [2, 42]), o($VO, [2, 43]), o($VO, [2, 44]), o($VO, [2, 45]), o($VO, [2, 46]), o($VO, [2, 47]), o($VO, [2, 48]), o($VO, [2, 49]), o($VO, [2, 50]), o($VO, [2, 51]), o($VO, [2, 52]), o($VO, [2, 53]), o($VO, [2, 54]), o($VO, [2, 55]), o($VO, [2, 56]), o($VO, [2, 57]), o($VO, [2, 58]), o($VO, [2, 60]), o($VO, [2, 61]), o($VO, [2, 62]), o($VO, [2, 63]), o($VO, [2, 64]), o($VO, [2, 65]), o($VO, [2, 66]), o($VO, [2, 67]), o($VO, [2, 68]), o($VO, [2, 69]), o($VO, [2, 70]), { 31: 134, 42: [1, 135] }, { 12: [1, 136] }, { 33: [1, 137] }, o($VR, [2, 28]), o($VR, [2, 29]), o($VR, [2, 30]), o($VR, [2, 31]), o($VR, [2, 32]), o($VR, [2, 33]), o($VR, [2, 34]), { 1: [2, 9] }, { 1: [2, 10] }, { 1: [2, 11] }, { 1: [2, 12] }, o($VI, [2, 18]), o($VH, [2, 38]), o($VP, [2, 72]), o($VQ, [2, 74]), o($VO, [2, 24]), o($VO, [2, 35]), o($VS, [2, 25]), o($VS, [2, 26], { 12: [1, 138] }), o($VS, [2, 27])],
232
+ defaultActions: { 2: [2, 1], 3: [2, 2], 4: [2, 7], 5: [2, 3], 6: [2, 4], 7: [2, 5], 8: [2, 6], 74: [2, 8], 126: [2, 9], 127: [2, 10], 128: [2, 11], 129: [2, 12] },
233
+ parseError: function parseError(str, hash) {
234
+ if (hash.recoverable) {
235
+ this.trace(str);
236
+ } else {
237
+ var error = new Error(str);
238
+ error.hash = hash;
239
+ throw error;
240
+ }
241
+ },
242
+ parse: function parse(input) {
243
+ var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, TERROR = 2, EOF = 1;
244
+ var args = lstack.slice.call(arguments, 1);
245
+ var lexer2 = Object.create(this.lexer);
246
+ var sharedState = { yy: {} };
247
+ for (var k in this.yy) {
248
+ if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
249
+ sharedState.yy[k] = this.yy[k];
250
+ }
251
+ }
252
+ lexer2.setInput(input, sharedState.yy);
253
+ sharedState.yy.lexer = lexer2;
254
+ sharedState.yy.parser = this;
255
+ if (typeof lexer2.yylloc == "undefined") {
256
+ lexer2.yylloc = {};
257
+ }
258
+ var yyloc = lexer2.yylloc;
259
+ lstack.push(yyloc);
260
+ var ranges = lexer2.options && lexer2.options.ranges;
261
+ if (typeof sharedState.yy.parseError === "function") {
262
+ this.parseError = sharedState.yy.parseError;
263
+ } else {
264
+ this.parseError = Object.getPrototypeOf(this).parseError;
265
+ }
266
+ function lex() {
267
+ var token;
268
+ token = tstack.pop() || lexer2.lex() || EOF;
269
+ if (typeof token !== "number") {
270
+ if (token instanceof Array) {
271
+ tstack = token;
272
+ token = tstack.pop();
273
+ }
274
+ token = self.symbols_[token] || token;
275
+ }
276
+ return token;
277
+ }
278
+ var symbol, state, action, r, yyval = {}, p, len, newState, expected;
279
+ while (true) {
280
+ state = stack[stack.length - 1];
281
+ if (this.defaultActions[state]) {
282
+ action = this.defaultActions[state];
283
+ } else {
284
+ if (symbol === null || typeof symbol == "undefined") {
285
+ symbol = lex();
286
+ }
287
+ action = table[state] && table[state][symbol];
288
+ }
289
+ if (typeof action === "undefined" || !action.length || !action[0]) {
290
+ var errStr = "";
291
+ expected = [];
292
+ for (p in table[state]) {
293
+ if (this.terminals_[p] && p > TERROR) {
294
+ expected.push("'" + this.terminals_[p] + "'");
295
+ }
296
+ }
297
+ if (lexer2.showPosition) {
298
+ errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer2.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
299
+ } else {
300
+ errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'");
301
+ }
302
+ this.parseError(errStr, {
303
+ text: lexer2.match,
304
+ token: this.terminals_[symbol] || symbol,
305
+ line: lexer2.yylineno,
306
+ loc: yyloc,
307
+ expected
308
+ });
309
+ }
310
+ if (action[0] instanceof Array && action.length > 1) {
311
+ throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
312
+ }
313
+ switch (action[0]) {
314
+ case 1:
315
+ stack.push(symbol);
316
+ vstack.push(lexer2.yytext);
317
+ lstack.push(lexer2.yylloc);
318
+ stack.push(action[1]);
319
+ symbol = null;
320
+ {
321
+ yyleng = lexer2.yyleng;
322
+ yytext = lexer2.yytext;
323
+ yylineno = lexer2.yylineno;
324
+ yyloc = lexer2.yylloc;
325
+ }
326
+ break;
327
+ case 2:
328
+ len = this.productions_[action[1]][1];
329
+ yyval.$ = vstack[vstack.length - len];
330
+ yyval._$ = {
331
+ first_line: lstack[lstack.length - (len || 1)].first_line,
332
+ last_line: lstack[lstack.length - 1].last_line,
333
+ first_column: lstack[lstack.length - (len || 1)].first_column,
334
+ last_column: lstack[lstack.length - 1].last_column
335
+ };
336
+ if (ranges) {
337
+ yyval._$.range = [
338
+ lstack[lstack.length - (len || 1)].range[0],
339
+ lstack[lstack.length - 1].range[1]
340
+ ];
341
+ }
342
+ r = this.performAction.apply(yyval, [
343
+ yytext,
344
+ yyleng,
345
+ yylineno,
346
+ sharedState.yy,
347
+ action[1],
348
+ vstack,
349
+ lstack
350
+ ].concat(args));
351
+ if (typeof r !== "undefined") {
352
+ return r;
353
+ }
354
+ if (len) {
355
+ stack = stack.slice(0, -1 * len * 2);
356
+ vstack = vstack.slice(0, -1 * len);
357
+ lstack = lstack.slice(0, -1 * len);
358
+ }
359
+ stack.push(this.productions_[action[1]][0]);
360
+ vstack.push(yyval.$);
361
+ lstack.push(yyval._$);
362
+ newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
363
+ stack.push(newState);
364
+ break;
365
+ case 3:
366
+ return true;
367
+ }
368
+ }
369
+ return true;
370
+ }
371
+ };
372
+ var lexer = function() {
373
+ var lexer2 = {
374
+ EOF: 1,
375
+ parseError: function parseError(str, hash) {
376
+ if (this.yy.parser) {
377
+ this.yy.parser.parseError(str, hash);
378
+ } else {
379
+ throw new Error(str);
380
+ }
381
+ },
382
+ // resets the lexer, sets new input
383
+ setInput: function(input, yy) {
384
+ this.yy = yy || this.yy || {};
385
+ this._input = input;
386
+ this._more = this._backtrack = this.done = false;
387
+ this.yylineno = this.yyleng = 0;
388
+ this.yytext = this.matched = this.match = "";
389
+ this.conditionStack = ["INITIAL"];
390
+ this.yylloc = {
391
+ first_line: 1,
392
+ first_column: 0,
393
+ last_line: 1,
394
+ last_column: 0
395
+ };
396
+ if (this.options.ranges) {
397
+ this.yylloc.range = [0, 0];
398
+ }
399
+ this.offset = 0;
400
+ return this;
401
+ },
402
+ // consumes and returns one char from the input
403
+ input: function() {
404
+ var ch = this._input[0];
405
+ this.yytext += ch;
406
+ this.yyleng++;
407
+ this.offset++;
408
+ this.match += ch;
409
+ this.matched += ch;
410
+ var lines = ch.match(/(?:\r\n?|\n).*/g);
411
+ if (lines) {
412
+ this.yylineno++;
413
+ this.yylloc.last_line++;
414
+ } else {
415
+ this.yylloc.last_column++;
416
+ }
417
+ if (this.options.ranges) {
418
+ this.yylloc.range[1]++;
419
+ }
420
+ this._input = this._input.slice(1);
421
+ return ch;
422
+ },
423
+ // unshifts one char (or a string) into the input
424
+ unput: function(ch) {
425
+ var len = ch.length;
426
+ var lines = ch.split(/(?:\r\n?|\n)/g);
427
+ this._input = ch + this._input;
428
+ this.yytext = this.yytext.substr(0, this.yytext.length - len);
429
+ this.offset -= len;
430
+ var oldLines = this.match.split(/(?:\r\n?|\n)/g);
431
+ this.match = this.match.substr(0, this.match.length - 1);
432
+ this.matched = this.matched.substr(0, this.matched.length - 1);
433
+ if (lines.length - 1) {
434
+ this.yylineno -= lines.length - 1;
435
+ }
436
+ var r = this.yylloc.range;
437
+ this.yylloc = {
438
+ first_line: this.yylloc.first_line,
439
+ last_line: this.yylineno + 1,
440
+ first_column: this.yylloc.first_column,
441
+ 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
442
+ };
443
+ if (this.options.ranges) {
444
+ this.yylloc.range = [r[0], r[0] + this.yyleng - len];
445
+ }
446
+ this.yyleng = this.yytext.length;
447
+ return this;
448
+ },
449
+ // When called from action, caches matched text and appends it on next action
450
+ more: function() {
451
+ this._more = true;
452
+ return this;
453
+ },
454
+ // 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.
455
+ reject: function() {
456
+ if (this.options.backtrack_lexer) {
457
+ this._backtrack = true;
458
+ } else {
459
+ 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(), {
460
+ text: "",
461
+ token: null,
462
+ line: this.yylineno
463
+ });
464
+ }
465
+ return this;
466
+ },
467
+ // retain first n characters of the match
468
+ less: function(n) {
469
+ this.unput(this.match.slice(n));
470
+ },
471
+ // displays already matched input, i.e. for error messages
472
+ pastInput: function() {
473
+ var past = this.matched.substr(0, this.matched.length - this.match.length);
474
+ return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, "");
475
+ },
476
+ // displays upcoming input, i.e. for error messages
477
+ upcomingInput: function() {
478
+ var next = this.match;
479
+ if (next.length < 20) {
480
+ next += this._input.substr(0, 20 - next.length);
481
+ }
482
+ return (next.substr(0, 20) + (next.length > 20 ? "..." : "")).replace(/\n/g, "");
483
+ },
484
+ // displays the character position where the lexing error occurred, i.e. for error messages
485
+ showPosition: function() {
486
+ var pre = this.pastInput();
487
+ var c2 = new Array(pre.length + 1).join("-");
488
+ return pre + this.upcomingInput() + "\n" + c2 + "^";
489
+ },
490
+ // test the lexed token: return FALSE when not a match, otherwise return token
491
+ test_match: function(match, indexed_rule) {
492
+ var token, lines, backup;
493
+ if (this.options.backtrack_lexer) {
494
+ backup = {
495
+ yylineno: this.yylineno,
496
+ yylloc: {
497
+ first_line: this.yylloc.first_line,
498
+ last_line: this.last_line,
499
+ first_column: this.yylloc.first_column,
500
+ last_column: this.yylloc.last_column
501
+ },
502
+ yytext: this.yytext,
503
+ match: this.match,
504
+ matches: this.matches,
505
+ matched: this.matched,
506
+ yyleng: this.yyleng,
507
+ offset: this.offset,
508
+ _more: this._more,
509
+ _input: this._input,
510
+ yy: this.yy,
511
+ conditionStack: this.conditionStack.slice(0),
512
+ done: this.done
513
+ };
514
+ if (this.options.ranges) {
515
+ backup.yylloc.range = this.yylloc.range.slice(0);
516
+ }
517
+ }
518
+ lines = match[0].match(/(?:\r\n?|\n).*/g);
519
+ if (lines) {
520
+ this.yylineno += lines.length;
521
+ }
522
+ this.yylloc = {
523
+ first_line: this.yylloc.last_line,
524
+ last_line: this.yylineno + 1,
525
+ first_column: this.yylloc.last_column,
526
+ last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length
527
+ };
528
+ this.yytext += match[0];
529
+ this.match += match[0];
530
+ this.matches = match;
531
+ this.yyleng = this.yytext.length;
532
+ if (this.options.ranges) {
533
+ this.yylloc.range = [this.offset, this.offset += this.yyleng];
534
+ }
535
+ this._more = false;
536
+ this._backtrack = false;
537
+ this._input = this._input.slice(match[0].length);
538
+ this.matched += match[0];
539
+ token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
540
+ if (this.done && this._input) {
541
+ this.done = false;
542
+ }
543
+ if (token) {
544
+ return token;
545
+ } else if (this._backtrack) {
546
+ for (var k in backup) {
547
+ this[k] = backup[k];
548
+ }
549
+ return false;
550
+ }
551
+ return false;
552
+ },
553
+ // return next match in input
554
+ next: function() {
555
+ if (this.done) {
556
+ return this.EOF;
557
+ }
558
+ if (!this._input) {
559
+ this.done = true;
560
+ }
561
+ var token, match, tempMatch, index;
562
+ if (!this._more) {
563
+ this.yytext = "";
564
+ this.match = "";
565
+ }
566
+ var rules = this._currentRules();
567
+ for (var i = 0; i < rules.length; i++) {
568
+ tempMatch = this._input.match(this.rules[rules[i]]);
569
+ if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
570
+ match = tempMatch;
571
+ index = i;
572
+ if (this.options.backtrack_lexer) {
573
+ token = this.test_match(tempMatch, rules[i]);
574
+ if (token !== false) {
575
+ return token;
576
+ } else if (this._backtrack) {
577
+ match = false;
578
+ continue;
579
+ } else {
580
+ return false;
581
+ }
582
+ } else if (!this.options.flex) {
583
+ break;
584
+ }
585
+ }
586
+ }
587
+ if (match) {
588
+ token = this.test_match(match, rules[index]);
589
+ if (token !== false) {
590
+ return token;
591
+ }
592
+ return false;
593
+ }
594
+ if (this._input === "") {
595
+ return this.EOF;
596
+ } else {
597
+ return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), {
598
+ text: "",
599
+ token: null,
600
+ line: this.yylineno
601
+ });
602
+ }
603
+ },
604
+ // return next match that has a token
605
+ lex: function lex() {
606
+ var r = this.next();
607
+ if (r) {
608
+ return r;
609
+ } else {
610
+ return this.lex();
611
+ }
612
+ },
613
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
614
+ begin: function begin(condition) {
615
+ this.conditionStack.push(condition);
616
+ },
617
+ // pop the previously active lexer condition state off the condition stack
618
+ popState: function popState() {
619
+ var n = this.conditionStack.length - 1;
620
+ if (n > 0) {
621
+ return this.conditionStack.pop();
622
+ } else {
623
+ return this.conditionStack[0];
624
+ }
625
+ },
626
+ // produce the lexer rule set which is active for the currently active lexer condition state
627
+ _currentRules: function _currentRules() {
628
+ if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
629
+ return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
630
+ } else {
631
+ return this.conditions["INITIAL"].rules;
632
+ }
633
+ },
634
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
635
+ topState: function topState(n) {
636
+ n = this.conditionStack.length - 1 - Math.abs(n || 0);
637
+ if (n >= 0) {
638
+ return this.conditionStack[n];
639
+ } else {
640
+ return "INITIAL";
641
+ }
642
+ },
643
+ // alias for begin(condition)
644
+ pushState: function pushState(condition) {
645
+ this.begin(condition);
646
+ },
647
+ // return the number of states currently on the stack
648
+ stateStackSize: function stateStackSize() {
649
+ return this.conditionStack.length;
650
+ },
651
+ options: {},
652
+ performAction: function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
653
+ switch ($avoiding_name_collisions) {
654
+ case 0:
655
+ return 6;
656
+ case 1:
657
+ return 7;
658
+ case 2:
659
+ return 8;
660
+ case 3:
661
+ return 9;
662
+ case 4:
663
+ return 22;
664
+ case 5:
665
+ return 23;
666
+ case 6:
667
+ this.begin("acc_title");
668
+ return 24;
669
+ case 7:
670
+ this.popState();
671
+ return "acc_title_value";
672
+ case 8:
673
+ this.begin("acc_descr");
674
+ return 26;
675
+ case 9:
676
+ this.popState();
677
+ return "acc_descr_value";
678
+ case 10:
679
+ this.begin("acc_descr_multiline");
680
+ break;
681
+ case 11:
682
+ this.popState();
683
+ break;
684
+ case 12:
685
+ return "acc_descr_multiline_value";
686
+ case 13:
687
+ break;
688
+ case 14:
689
+ c;
690
+ break;
691
+ case 15:
692
+ return 12;
693
+ case 16:
694
+ break;
695
+ case 17:
696
+ return 11;
697
+ case 18:
698
+ return 15;
699
+ case 19:
700
+ return 16;
701
+ case 20:
702
+ return 17;
703
+ case 21:
704
+ return 18;
705
+ case 22:
706
+ this.begin("person_ext");
707
+ return 45;
708
+ case 23:
709
+ this.begin("person");
710
+ return 44;
711
+ case 24:
712
+ this.begin("system_ext_queue");
713
+ return 51;
714
+ case 25:
715
+ this.begin("system_ext_db");
716
+ return 50;
717
+ case 26:
718
+ this.begin("system_ext");
719
+ return 49;
720
+ case 27:
721
+ this.begin("system_queue");
722
+ return 48;
723
+ case 28:
724
+ this.begin("system_db");
725
+ return 47;
726
+ case 29:
727
+ this.begin("system");
728
+ return 46;
729
+ case 30:
730
+ this.begin("boundary");
731
+ return 37;
732
+ case 31:
733
+ this.begin("enterprise_boundary");
734
+ return 34;
735
+ case 32:
736
+ this.begin("system_boundary");
737
+ return 36;
738
+ case 33:
739
+ this.begin("container_ext_queue");
740
+ return 57;
741
+ case 34:
742
+ this.begin("container_ext_db");
743
+ return 56;
744
+ case 35:
745
+ this.begin("container_ext");
746
+ return 55;
747
+ case 36:
748
+ this.begin("container_queue");
749
+ return 54;
750
+ case 37:
751
+ this.begin("container_db");
752
+ return 53;
753
+ case 38:
754
+ this.begin("container");
755
+ return 52;
756
+ case 39:
757
+ this.begin("container_boundary");
758
+ return 38;
759
+ case 40:
760
+ this.begin("component_ext_queue");
761
+ return 63;
762
+ case 41:
763
+ this.begin("component_ext_db");
764
+ return 62;
765
+ case 42:
766
+ this.begin("component_ext");
767
+ return 61;
768
+ case 43:
769
+ this.begin("component_queue");
770
+ return 60;
771
+ case 44:
772
+ this.begin("component_db");
773
+ return 59;
774
+ case 45:
775
+ this.begin("component");
776
+ return 58;
777
+ case 46:
778
+ this.begin("node");
779
+ return 39;
780
+ case 47:
781
+ this.begin("node");
782
+ return 39;
783
+ case 48:
784
+ this.begin("node_l");
785
+ return 40;
786
+ case 49:
787
+ this.begin("node_r");
788
+ return 41;
789
+ case 50:
790
+ this.begin("rel");
791
+ return 64;
792
+ case 51:
793
+ this.begin("birel");
794
+ return 65;
795
+ case 52:
796
+ this.begin("rel_u");
797
+ return 66;
798
+ case 53:
799
+ this.begin("rel_u");
800
+ return 66;
801
+ case 54:
802
+ this.begin("rel_d");
803
+ return 67;
804
+ case 55:
805
+ this.begin("rel_d");
806
+ return 67;
807
+ case 56:
808
+ this.begin("rel_l");
809
+ return 68;
810
+ case 57:
811
+ this.begin("rel_l");
812
+ return 68;
813
+ case 58:
814
+ this.begin("rel_r");
815
+ return 69;
816
+ case 59:
817
+ this.begin("rel_r");
818
+ return 69;
819
+ case 60:
820
+ this.begin("rel_b");
821
+ return 70;
822
+ case 61:
823
+ this.begin("rel_index");
824
+ return 71;
825
+ case 62:
826
+ this.begin("update_el_style");
827
+ return 72;
828
+ case 63:
829
+ this.begin("update_rel_style");
830
+ return 73;
831
+ case 64:
832
+ this.begin("update_layout_config");
833
+ return 74;
834
+ case 65:
835
+ return "EOF_IN_STRUCT";
836
+ case 66:
837
+ this.begin("attribute");
838
+ return "ATTRIBUTE_EMPTY";
839
+ case 67:
840
+ this.begin("attribute");
841
+ break;
842
+ case 68:
843
+ this.popState();
844
+ this.popState();
845
+ break;
846
+ case 69:
847
+ return 80;
848
+ case 70:
849
+ break;
850
+ case 71:
851
+ return 80;
852
+ case 72:
853
+ this.begin("string");
854
+ break;
855
+ case 73:
856
+ this.popState();
857
+ break;
858
+ case 74:
859
+ return "STR";
860
+ case 75:
861
+ this.begin("string_kv");
862
+ break;
863
+ case 76:
864
+ this.begin("string_kv_key");
865
+ return "STR_KEY";
866
+ case 77:
867
+ this.popState();
868
+ this.begin("string_kv_value");
869
+ break;
870
+ case 78:
871
+ return "STR_VALUE";
872
+ case 79:
873
+ this.popState();
874
+ this.popState();
875
+ break;
876
+ case 80:
877
+ return "STR";
878
+ case 81:
879
+ return "LBRACE";
880
+ case 82:
881
+ return "RBRACE";
882
+ case 83:
883
+ return "SPACE";
884
+ case 84:
885
+ return "EOL";
886
+ case 85:
887
+ return 14;
888
+ }
889
+ },
890
+ rules: [/^(?:.*direction\s+TB[^\n]*)/, /^(?:.*direction\s+BT[^\n]*)/, /^(?:.*direction\s+RL[^\n]*)/, /^(?:.*direction\s+LR[^\n]*)/, /^(?:title\s[^#\n;]+)/, /^(?:accDescription\s[^#\n;]+)/, /^(?:accTitle\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*\{\s*)/, /^(?:[\}])/, /^(?:[^\}]*)/, /^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/, /^(?:%%[^\n]*(\r?\n)*)/, /^(?:\s*(\r?\n)+)/, /^(?:\s+)/, /^(?:C4Context\b)/, /^(?:C4Container\b)/, /^(?:C4Component\b)/, /^(?:C4Dynamic\b)/, /^(?:C4Deployment\b)/, /^(?:Person_Ext\b)/, /^(?:Person\b)/, /^(?:SystemQueue_Ext\b)/, /^(?:SystemDb_Ext\b)/, /^(?:System_Ext\b)/, /^(?:SystemQueue\b)/, /^(?:SystemDb\b)/, /^(?:System\b)/, /^(?:Boundary\b)/, /^(?:Enterprise_Boundary\b)/, /^(?:System_Boundary\b)/, /^(?:ContainerQueue_Ext\b)/, /^(?:ContainerDb_Ext\b)/, /^(?:Container_Ext\b)/, /^(?:ContainerQueue\b)/, /^(?:ContainerDb\b)/, /^(?:Container\b)/, /^(?:Container_Boundary\b)/, /^(?:ComponentQueue_Ext\b)/, /^(?:ComponentDb_Ext\b)/, /^(?:Component_Ext\b)/, /^(?:ComponentQueue\b)/, /^(?:ComponentDb\b)/, /^(?:Component\b)/, /^(?:Deployment_Node\b)/, /^(?:Node\b)/, /^(?:Node_L\b)/, /^(?:Node_R\b)/, /^(?:Rel\b)/, /^(?:BiRel\b)/, /^(?:Rel_Up\b)/, /^(?:Rel_U\b)/, /^(?:Rel_Down\b)/, /^(?:Rel_D\b)/, /^(?:Rel_Left\b)/, /^(?:Rel_L\b)/, /^(?:Rel_Right\b)/, /^(?:Rel_R\b)/, /^(?:Rel_Back\b)/, /^(?:RelIndex\b)/, /^(?:UpdateElementStyle\b)/, /^(?:UpdateRelStyle\b)/, /^(?:UpdateLayoutConfig\b)/, /^(?:$)/, /^(?:[(][ ]*[,])/, /^(?:[(])/, /^(?:[)])/, /^(?:,,)/, /^(?:,)/, /^(?:[ ]*["]["])/, /^(?:[ ]*["])/, /^(?:["])/, /^(?:[^"]*)/, /^(?:[ ]*[\$])/, /^(?:[^=]*)/, /^(?:[=][ ]*["])/, /^(?:[^"]+)/, /^(?:["])/, /^(?:[^,]+)/, /^(?:\{)/, /^(?:\})/, /^(?:[\s]+)/, /^(?:[\n\r]+)/, /^(?:$)/],
891
+ conditions: { "acc_descr_multiline": { "rules": [11, 12], "inclusive": false }, "acc_descr": { "rules": [9], "inclusive": false }, "acc_title": { "rules": [7], "inclusive": false }, "string_kv_value": { "rules": [78, 79], "inclusive": false }, "string_kv_key": { "rules": [77], "inclusive": false }, "string_kv": { "rules": [76], "inclusive": false }, "string": { "rules": [73, 74], "inclusive": false }, "attribute": { "rules": [68, 69, 70, 71, 72, 75, 80], "inclusive": false }, "update_layout_config": { "rules": [65, 66, 67, 68], "inclusive": false }, "update_rel_style": { "rules": [65, 66, 67, 68], "inclusive": false }, "update_el_style": { "rules": [65, 66, 67, 68], "inclusive": false }, "rel_b": { "rules": [65, 66, 67, 68], "inclusive": false }, "rel_r": { "rules": [65, 66, 67, 68], "inclusive": false }, "rel_l": { "rules": [65, 66, 67, 68], "inclusive": false }, "rel_d": { "rules": [65, 66, 67, 68], "inclusive": false }, "rel_u": { "rules": [65, 66, 67, 68], "inclusive": false }, "rel_bi": { "rules": [], "inclusive": false }, "rel": { "rules": [65, 66, 67, 68], "inclusive": false }, "node_r": { "rules": [65, 66, 67, 68], "inclusive": false }, "node_l": { "rules": [65, 66, 67, 68], "inclusive": false }, "node": { "rules": [65, 66, 67, 68], "inclusive": false }, "index": { "rules": [], "inclusive": false }, "rel_index": { "rules": [65, 66, 67, 68], "inclusive": false }, "component_ext_queue": { "rules": [], "inclusive": false }, "component_ext_db": { "rules": [65, 66, 67, 68], "inclusive": false }, "component_ext": { "rules": [65, 66, 67, 68], "inclusive": false }, "component_queue": { "rules": [65, 66, 67, 68], "inclusive": false }, "component_db": { "rules": [65, 66, 67, 68], "inclusive": false }, "component": { "rules": [65, 66, 67, 68], "inclusive": false }, "container_boundary": { "rules": [65, 66, 67, 68], "inclusive": false }, "container_ext_queue": { "rules": [65, 66, 67, 68], "inclusive": false }, "container_ext_db": { "rules": [65, 66, 67, 68], "inclusive": false }, "container_ext": { "rules": [65, 66, 67, 68], "inclusive": false }, "container_queue": { "rules": [65, 66, 67, 68], "inclusive": false }, "container_db": { "rules": [65, 66, 67, 68], "inclusive": false }, "container": { "rules": [65, 66, 67, 68], "inclusive": false }, "birel": { "rules": [65, 66, 67, 68], "inclusive": false }, "system_boundary": { "rules": [65, 66, 67, 68], "inclusive": false }, "enterprise_boundary": { "rules": [65, 66, 67, 68], "inclusive": false }, "boundary": { "rules": [65, 66, 67, 68], "inclusive": false }, "system_ext_queue": { "rules": [65, 66, 67, 68], "inclusive": false }, "system_ext_db": { "rules": [65, 66, 67, 68], "inclusive": false }, "system_ext": { "rules": [65, 66, 67, 68], "inclusive": false }, "system_queue": { "rules": [65, 66, 67, 68], "inclusive": false }, "system_db": { "rules": [65, 66, 67, 68], "inclusive": false }, "system": { "rules": [65, 66, 67, 68], "inclusive": false }, "person_ext": { "rules": [65, 66, 67, 68], "inclusive": false }, "person": { "rules": [65, 66, 67, 68], "inclusive": false }, "INITIAL": { "rules": [0, 1, 2, 3, 4, 5, 6, 8, 10, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 81, 82, 83, 84, 85], "inclusive": true } }
892
+ };
893
+ return lexer2;
894
+ }();
895
+ parser2.lexer = lexer;
896
+ function Parser() {
897
+ this.yy = {};
898
+ }
899
+ Parser.prototype = parser2;
900
+ parser2.Parser = Parser;
901
+ return new Parser();
902
+ }();
903
+ parser.parser = parser;
904
+ const parser$1 = parser;
905
+ let c4ShapeArray = [];
906
+ let boundaryParseStack = [""];
907
+ let currentBoundaryParse = "global";
908
+ let parentBoundaryParse = "";
909
+ let boundaries = [
910
+ {
911
+ alias: "global",
912
+ label: { text: "global" },
913
+ type: { text: "global" },
914
+ tags: null,
915
+ link: null,
916
+ parentBoundary: ""
917
+ }
918
+ ];
919
+ let rels = [];
920
+ let title = "";
921
+ let wrapEnabled = false;
922
+ let c4ShapeInRow$1 = 4;
923
+ let c4BoundaryInRow$1 = 2;
924
+ var c4Type;
925
+ const getC4Type = function() {
926
+ return c4Type;
927
+ };
928
+ const setC4Type = function(c4TypeParam) {
929
+ let sanitizedText = sanitizeText(c4TypeParam, getConfig());
930
+ c4Type = sanitizedText;
931
+ };
932
+ const addRel = function(type, from, to, label, techn, descr, sprite, tags, link) {
933
+ if (type === void 0 || type === null || from === void 0 || from === null || to === void 0 || to === null || label === void 0 || label === null) {
934
+ return;
935
+ }
936
+ let rel = {};
937
+ const old = rels.find((rel2) => rel2.from === from && rel2.to === to);
938
+ if (old) {
939
+ rel = old;
940
+ } else {
941
+ rels.push(rel);
942
+ }
943
+ rel.type = type;
944
+ rel.from = from;
945
+ rel.to = to;
946
+ rel.label = { text: label };
947
+ if (techn === void 0 || techn === null) {
948
+ rel.techn = { text: "" };
949
+ } else {
950
+ if (typeof techn === "object") {
951
+ let [key, value] = Object.entries(techn)[0];
952
+ rel[key] = { text: value };
953
+ } else {
954
+ rel.techn = { text: techn };
955
+ }
956
+ }
957
+ if (descr === void 0 || descr === null) {
958
+ rel.descr = { text: "" };
959
+ } else {
960
+ if (typeof descr === "object") {
961
+ let [key, value] = Object.entries(descr)[0];
962
+ rel[key] = { text: value };
963
+ } else {
964
+ rel.descr = { text: descr };
965
+ }
966
+ }
967
+ if (typeof sprite === "object") {
968
+ let [key, value] = Object.entries(sprite)[0];
969
+ rel[key] = value;
970
+ } else {
971
+ rel.sprite = sprite;
972
+ }
973
+ if (typeof tags === "object") {
974
+ let [key, value] = Object.entries(tags)[0];
975
+ rel[key] = value;
976
+ } else {
977
+ rel.tags = tags;
978
+ }
979
+ if (typeof link === "object") {
980
+ let [key, value] = Object.entries(link)[0];
981
+ rel[key] = value;
982
+ } else {
983
+ rel.link = link;
984
+ }
985
+ rel.wrap = autoWrap();
986
+ };
987
+ const addPersonOrSystem = function(typeC4Shape, alias, label, descr, sprite, tags, link) {
988
+ if (alias === null || label === null) {
989
+ return;
990
+ }
991
+ let personOrSystem = {};
992
+ const old = c4ShapeArray.find((personOrSystem2) => personOrSystem2.alias === alias);
993
+ if (old && alias === old.alias) {
994
+ personOrSystem = old;
995
+ } else {
996
+ personOrSystem.alias = alias;
997
+ c4ShapeArray.push(personOrSystem);
998
+ }
999
+ if (label === void 0 || label === null) {
1000
+ personOrSystem.label = { text: "" };
1001
+ } else {
1002
+ personOrSystem.label = { text: label };
1003
+ }
1004
+ if (descr === void 0 || descr === null) {
1005
+ personOrSystem.descr = { text: "" };
1006
+ } else {
1007
+ if (typeof descr === "object") {
1008
+ let [key, value] = Object.entries(descr)[0];
1009
+ personOrSystem[key] = { text: value };
1010
+ } else {
1011
+ personOrSystem.descr = { text: descr };
1012
+ }
1013
+ }
1014
+ if (typeof sprite === "object") {
1015
+ let [key, value] = Object.entries(sprite)[0];
1016
+ personOrSystem[key] = value;
1017
+ } else {
1018
+ personOrSystem.sprite = sprite;
1019
+ }
1020
+ if (typeof tags === "object") {
1021
+ let [key, value] = Object.entries(tags)[0];
1022
+ personOrSystem[key] = value;
1023
+ } else {
1024
+ personOrSystem.tags = tags;
1025
+ }
1026
+ if (typeof link === "object") {
1027
+ let [key, value] = Object.entries(link)[0];
1028
+ personOrSystem[key] = value;
1029
+ } else {
1030
+ personOrSystem.link = link;
1031
+ }
1032
+ personOrSystem.typeC4Shape = { text: typeC4Shape };
1033
+ personOrSystem.parentBoundary = currentBoundaryParse;
1034
+ personOrSystem.wrap = autoWrap();
1035
+ };
1036
+ const addContainer = function(typeC4Shape, alias, label, techn, descr, sprite, tags, link) {
1037
+ if (alias === null || label === null) {
1038
+ return;
1039
+ }
1040
+ let container = {};
1041
+ const old = c4ShapeArray.find((container2) => container2.alias === alias);
1042
+ if (old && alias === old.alias) {
1043
+ container = old;
1044
+ } else {
1045
+ container.alias = alias;
1046
+ c4ShapeArray.push(container);
1047
+ }
1048
+ if (label === void 0 || label === null) {
1049
+ container.label = { text: "" };
1050
+ } else {
1051
+ container.label = { text: label };
1052
+ }
1053
+ if (techn === void 0 || techn === null) {
1054
+ container.techn = { text: "" };
1055
+ } else {
1056
+ if (typeof techn === "object") {
1057
+ let [key, value] = Object.entries(techn)[0];
1058
+ container[key] = { text: value };
1059
+ } else {
1060
+ container.techn = { text: techn };
1061
+ }
1062
+ }
1063
+ if (descr === void 0 || descr === null) {
1064
+ container.descr = { text: "" };
1065
+ } else {
1066
+ if (typeof descr === "object") {
1067
+ let [key, value] = Object.entries(descr)[0];
1068
+ container[key] = { text: value };
1069
+ } else {
1070
+ container.descr = { text: descr };
1071
+ }
1072
+ }
1073
+ if (typeof sprite === "object") {
1074
+ let [key, value] = Object.entries(sprite)[0];
1075
+ container[key] = value;
1076
+ } else {
1077
+ container.sprite = sprite;
1078
+ }
1079
+ if (typeof tags === "object") {
1080
+ let [key, value] = Object.entries(tags)[0];
1081
+ container[key] = value;
1082
+ } else {
1083
+ container.tags = tags;
1084
+ }
1085
+ if (typeof link === "object") {
1086
+ let [key, value] = Object.entries(link)[0];
1087
+ container[key] = value;
1088
+ } else {
1089
+ container.link = link;
1090
+ }
1091
+ container.wrap = autoWrap();
1092
+ container.typeC4Shape = { text: typeC4Shape };
1093
+ container.parentBoundary = currentBoundaryParse;
1094
+ };
1095
+ const addComponent = function(typeC4Shape, alias, label, techn, descr, sprite, tags, link) {
1096
+ if (alias === null || label === null) {
1097
+ return;
1098
+ }
1099
+ let component = {};
1100
+ const old = c4ShapeArray.find((component2) => component2.alias === alias);
1101
+ if (old && alias === old.alias) {
1102
+ component = old;
1103
+ } else {
1104
+ component.alias = alias;
1105
+ c4ShapeArray.push(component);
1106
+ }
1107
+ if (label === void 0 || label === null) {
1108
+ component.label = { text: "" };
1109
+ } else {
1110
+ component.label = { text: label };
1111
+ }
1112
+ if (techn === void 0 || techn === null) {
1113
+ component.techn = { text: "" };
1114
+ } else {
1115
+ if (typeof techn === "object") {
1116
+ let [key, value] = Object.entries(techn)[0];
1117
+ component[key] = { text: value };
1118
+ } else {
1119
+ component.techn = { text: techn };
1120
+ }
1121
+ }
1122
+ if (descr === void 0 || descr === null) {
1123
+ component.descr = { text: "" };
1124
+ } else {
1125
+ if (typeof descr === "object") {
1126
+ let [key, value] = Object.entries(descr)[0];
1127
+ component[key] = { text: value };
1128
+ } else {
1129
+ component.descr = { text: descr };
1130
+ }
1131
+ }
1132
+ if (typeof sprite === "object") {
1133
+ let [key, value] = Object.entries(sprite)[0];
1134
+ component[key] = value;
1135
+ } else {
1136
+ component.sprite = sprite;
1137
+ }
1138
+ if (typeof tags === "object") {
1139
+ let [key, value] = Object.entries(tags)[0];
1140
+ component[key] = value;
1141
+ } else {
1142
+ component.tags = tags;
1143
+ }
1144
+ if (typeof link === "object") {
1145
+ let [key, value] = Object.entries(link)[0];
1146
+ component[key] = value;
1147
+ } else {
1148
+ component.link = link;
1149
+ }
1150
+ component.wrap = autoWrap();
1151
+ component.typeC4Shape = { text: typeC4Shape };
1152
+ component.parentBoundary = currentBoundaryParse;
1153
+ };
1154
+ const addPersonOrSystemBoundary = function(alias, label, type, tags, link) {
1155
+ if (alias === null || label === null) {
1156
+ return;
1157
+ }
1158
+ let boundary = {};
1159
+ const old = boundaries.find((boundary2) => boundary2.alias === alias);
1160
+ if (old && alias === old.alias) {
1161
+ boundary = old;
1162
+ } else {
1163
+ boundary.alias = alias;
1164
+ boundaries.push(boundary);
1165
+ }
1166
+ if (label === void 0 || label === null) {
1167
+ boundary.label = { text: "" };
1168
+ } else {
1169
+ boundary.label = { text: label };
1170
+ }
1171
+ if (type === void 0 || type === null) {
1172
+ boundary.type = { text: "system" };
1173
+ } else {
1174
+ if (typeof type === "object") {
1175
+ let [key, value] = Object.entries(type)[0];
1176
+ boundary[key] = { text: value };
1177
+ } else {
1178
+ boundary.type = { text: type };
1179
+ }
1180
+ }
1181
+ if (typeof tags === "object") {
1182
+ let [key, value] = Object.entries(tags)[0];
1183
+ boundary[key] = value;
1184
+ } else {
1185
+ boundary.tags = tags;
1186
+ }
1187
+ if (typeof link === "object") {
1188
+ let [key, value] = Object.entries(link)[0];
1189
+ boundary[key] = value;
1190
+ } else {
1191
+ boundary.link = link;
1192
+ }
1193
+ boundary.parentBoundary = currentBoundaryParse;
1194
+ boundary.wrap = autoWrap();
1195
+ parentBoundaryParse = currentBoundaryParse;
1196
+ currentBoundaryParse = alias;
1197
+ boundaryParseStack.push(parentBoundaryParse);
1198
+ };
1199
+ const addContainerBoundary = function(alias, label, type, tags, link) {
1200
+ if (alias === null || label === null) {
1201
+ return;
1202
+ }
1203
+ let boundary = {};
1204
+ const old = boundaries.find((boundary2) => boundary2.alias === alias);
1205
+ if (old && alias === old.alias) {
1206
+ boundary = old;
1207
+ } else {
1208
+ boundary.alias = alias;
1209
+ boundaries.push(boundary);
1210
+ }
1211
+ if (label === void 0 || label === null) {
1212
+ boundary.label = { text: "" };
1213
+ } else {
1214
+ boundary.label = { text: label };
1215
+ }
1216
+ if (type === void 0 || type === null) {
1217
+ boundary.type = { text: "container" };
1218
+ } else {
1219
+ if (typeof type === "object") {
1220
+ let [key, value] = Object.entries(type)[0];
1221
+ boundary[key] = { text: value };
1222
+ } else {
1223
+ boundary.type = { text: type };
1224
+ }
1225
+ }
1226
+ if (typeof tags === "object") {
1227
+ let [key, value] = Object.entries(tags)[0];
1228
+ boundary[key] = value;
1229
+ } else {
1230
+ boundary.tags = tags;
1231
+ }
1232
+ if (typeof link === "object") {
1233
+ let [key, value] = Object.entries(link)[0];
1234
+ boundary[key] = value;
1235
+ } else {
1236
+ boundary.link = link;
1237
+ }
1238
+ boundary.parentBoundary = currentBoundaryParse;
1239
+ boundary.wrap = autoWrap();
1240
+ parentBoundaryParse = currentBoundaryParse;
1241
+ currentBoundaryParse = alias;
1242
+ boundaryParseStack.push(parentBoundaryParse);
1243
+ };
1244
+ const addDeploymentNode = function(nodeType, alias, label, type, descr, sprite, tags, link) {
1245
+ if (alias === null || label === null) {
1246
+ return;
1247
+ }
1248
+ let boundary = {};
1249
+ const old = boundaries.find((boundary2) => boundary2.alias === alias);
1250
+ if (old && alias === old.alias) {
1251
+ boundary = old;
1252
+ } else {
1253
+ boundary.alias = alias;
1254
+ boundaries.push(boundary);
1255
+ }
1256
+ if (label === void 0 || label === null) {
1257
+ boundary.label = { text: "" };
1258
+ } else {
1259
+ boundary.label = { text: label };
1260
+ }
1261
+ if (type === void 0 || type === null) {
1262
+ boundary.type = { text: "node" };
1263
+ } else {
1264
+ if (typeof type === "object") {
1265
+ let [key, value] = Object.entries(type)[0];
1266
+ boundary[key] = { text: value };
1267
+ } else {
1268
+ boundary.type = { text: type };
1269
+ }
1270
+ }
1271
+ if (descr === void 0 || descr === null) {
1272
+ boundary.descr = { text: "" };
1273
+ } else {
1274
+ if (typeof descr === "object") {
1275
+ let [key, value] = Object.entries(descr)[0];
1276
+ boundary[key] = { text: value };
1277
+ } else {
1278
+ boundary.descr = { text: descr };
1279
+ }
1280
+ }
1281
+ if (typeof tags === "object") {
1282
+ let [key, value] = Object.entries(tags)[0];
1283
+ boundary[key] = value;
1284
+ } else {
1285
+ boundary.tags = tags;
1286
+ }
1287
+ if (typeof link === "object") {
1288
+ let [key, value] = Object.entries(link)[0];
1289
+ boundary[key] = value;
1290
+ } else {
1291
+ boundary.link = link;
1292
+ }
1293
+ boundary.nodeType = nodeType;
1294
+ boundary.parentBoundary = currentBoundaryParse;
1295
+ boundary.wrap = autoWrap();
1296
+ parentBoundaryParse = currentBoundaryParse;
1297
+ currentBoundaryParse = alias;
1298
+ boundaryParseStack.push(parentBoundaryParse);
1299
+ };
1300
+ const popBoundaryParseStack = function() {
1301
+ currentBoundaryParse = parentBoundaryParse;
1302
+ boundaryParseStack.pop();
1303
+ parentBoundaryParse = boundaryParseStack.pop();
1304
+ boundaryParseStack.push(parentBoundaryParse);
1305
+ };
1306
+ const updateElStyle = function(typeC4Shape, elementName, bgColor, fontColor, borderColor, shadowing, shape, sprite, techn, legendText, legendSprite) {
1307
+ let old = c4ShapeArray.find((element) => element.alias === elementName);
1308
+ if (old === void 0) {
1309
+ old = boundaries.find((element) => element.alias === elementName);
1310
+ if (old === void 0) {
1311
+ return;
1312
+ }
1313
+ }
1314
+ if (bgColor !== void 0 && bgColor !== null) {
1315
+ if (typeof bgColor === "object") {
1316
+ let [key, value] = Object.entries(bgColor)[0];
1317
+ old[key] = value;
1318
+ } else {
1319
+ old.bgColor = bgColor;
1320
+ }
1321
+ }
1322
+ if (fontColor !== void 0 && fontColor !== null) {
1323
+ if (typeof fontColor === "object") {
1324
+ let [key, value] = Object.entries(fontColor)[0];
1325
+ old[key] = value;
1326
+ } else {
1327
+ old.fontColor = fontColor;
1328
+ }
1329
+ }
1330
+ if (borderColor !== void 0 && borderColor !== null) {
1331
+ if (typeof borderColor === "object") {
1332
+ let [key, value] = Object.entries(borderColor)[0];
1333
+ old[key] = value;
1334
+ } else {
1335
+ old.borderColor = borderColor;
1336
+ }
1337
+ }
1338
+ if (shadowing !== void 0 && shadowing !== null) {
1339
+ if (typeof shadowing === "object") {
1340
+ let [key, value] = Object.entries(shadowing)[0];
1341
+ old[key] = value;
1342
+ } else {
1343
+ old.shadowing = shadowing;
1344
+ }
1345
+ }
1346
+ if (shape !== void 0 && shape !== null) {
1347
+ if (typeof shape === "object") {
1348
+ let [key, value] = Object.entries(shape)[0];
1349
+ old[key] = value;
1350
+ } else {
1351
+ old.shape = shape;
1352
+ }
1353
+ }
1354
+ if (sprite !== void 0 && sprite !== null) {
1355
+ if (typeof sprite === "object") {
1356
+ let [key, value] = Object.entries(sprite)[0];
1357
+ old[key] = value;
1358
+ } else {
1359
+ old.sprite = sprite;
1360
+ }
1361
+ }
1362
+ if (techn !== void 0 && techn !== null) {
1363
+ if (typeof techn === "object") {
1364
+ let [key, value] = Object.entries(techn)[0];
1365
+ old[key] = value;
1366
+ } else {
1367
+ old.techn = techn;
1368
+ }
1369
+ }
1370
+ if (legendText !== void 0 && legendText !== null) {
1371
+ if (typeof legendText === "object") {
1372
+ let [key, value] = Object.entries(legendText)[0];
1373
+ old[key] = value;
1374
+ } else {
1375
+ old.legendText = legendText;
1376
+ }
1377
+ }
1378
+ if (legendSprite !== void 0 && legendSprite !== null) {
1379
+ if (typeof legendSprite === "object") {
1380
+ let [key, value] = Object.entries(legendSprite)[0];
1381
+ old[key] = value;
1382
+ } else {
1383
+ old.legendSprite = legendSprite;
1384
+ }
1385
+ }
1386
+ };
1387
+ const updateRelStyle = function(typeC4Shape, from, to, textColor, lineColor, offsetX, offsetY) {
1388
+ const old = rels.find((rel) => rel.from === from && rel.to === to);
1389
+ if (old === void 0) {
1390
+ return;
1391
+ }
1392
+ if (textColor !== void 0 && textColor !== null) {
1393
+ if (typeof textColor === "object") {
1394
+ let [key, value] = Object.entries(textColor)[0];
1395
+ old[key] = value;
1396
+ } else {
1397
+ old.textColor = textColor;
1398
+ }
1399
+ }
1400
+ if (lineColor !== void 0 && lineColor !== null) {
1401
+ if (typeof lineColor === "object") {
1402
+ let [key, value] = Object.entries(lineColor)[0];
1403
+ old[key] = value;
1404
+ } else {
1405
+ old.lineColor = lineColor;
1406
+ }
1407
+ }
1408
+ if (offsetX !== void 0 && offsetX !== null) {
1409
+ if (typeof offsetX === "object") {
1410
+ let [key, value] = Object.entries(offsetX)[0];
1411
+ old[key] = parseInt(value);
1412
+ } else {
1413
+ old.offsetX = parseInt(offsetX);
1414
+ }
1415
+ }
1416
+ if (offsetY !== void 0 && offsetY !== null) {
1417
+ if (typeof offsetY === "object") {
1418
+ let [key, value] = Object.entries(offsetY)[0];
1419
+ old[key] = parseInt(value);
1420
+ } else {
1421
+ old.offsetY = parseInt(offsetY);
1422
+ }
1423
+ }
1424
+ };
1425
+ const updateLayoutConfig = function(typeC4Shape, c4ShapeInRowParam, c4BoundaryInRowParam) {
1426
+ let c4ShapeInRowValue = c4ShapeInRow$1;
1427
+ let c4BoundaryInRowValue = c4BoundaryInRow$1;
1428
+ if (typeof c4ShapeInRowParam === "object") {
1429
+ const value = Object.values(c4ShapeInRowParam)[0];
1430
+ c4ShapeInRowValue = parseInt(value);
1431
+ } else {
1432
+ c4ShapeInRowValue = parseInt(c4ShapeInRowParam);
1433
+ }
1434
+ if (typeof c4BoundaryInRowParam === "object") {
1435
+ const value = Object.values(c4BoundaryInRowParam)[0];
1436
+ c4BoundaryInRowValue = parseInt(value);
1437
+ } else {
1438
+ c4BoundaryInRowValue = parseInt(c4BoundaryInRowParam);
1439
+ }
1440
+ if (c4ShapeInRowValue >= 1) {
1441
+ c4ShapeInRow$1 = c4ShapeInRowValue;
1442
+ }
1443
+ if (c4BoundaryInRowValue >= 1) {
1444
+ c4BoundaryInRow$1 = c4BoundaryInRowValue;
1445
+ }
1446
+ };
1447
+ const getC4ShapeInRow = function() {
1448
+ return c4ShapeInRow$1;
1449
+ };
1450
+ const getC4BoundaryInRow = function() {
1451
+ return c4BoundaryInRow$1;
1452
+ };
1453
+ const getCurrentBoundaryParse = function() {
1454
+ return currentBoundaryParse;
1455
+ };
1456
+ const getParentBoundaryParse = function() {
1457
+ return parentBoundaryParse;
1458
+ };
1459
+ const getC4ShapeArray = function(parentBoundary) {
1460
+ if (parentBoundary === void 0 || parentBoundary === null) {
1461
+ return c4ShapeArray;
1462
+ } else {
1463
+ return c4ShapeArray.filter((personOrSystem) => {
1464
+ return personOrSystem.parentBoundary === parentBoundary;
1465
+ });
1466
+ }
1467
+ };
1468
+ const getC4Shape = function(alias) {
1469
+ return c4ShapeArray.find((personOrSystem) => personOrSystem.alias === alias);
1470
+ };
1471
+ const getC4ShapeKeys = function(parentBoundary) {
1472
+ return Object.keys(getC4ShapeArray(parentBoundary));
1473
+ };
1474
+ const getBoundaries = function(parentBoundary) {
1475
+ if (parentBoundary === void 0 || parentBoundary === null) {
1476
+ return boundaries;
1477
+ } else {
1478
+ return boundaries.filter((boundary) => boundary.parentBoundary === parentBoundary);
1479
+ }
1480
+ };
1481
+ const getBoundarys = getBoundaries;
1482
+ const getRels = function() {
1483
+ return rels;
1484
+ };
1485
+ const getTitle = function() {
1486
+ return title;
1487
+ };
1488
+ const setWrap = function(wrapSetting) {
1489
+ wrapEnabled = wrapSetting;
1490
+ };
1491
+ const autoWrap = function() {
1492
+ return wrapEnabled;
1493
+ };
1494
+ const clear = function() {
1495
+ c4ShapeArray = [];
1496
+ boundaries = [
1497
+ {
1498
+ alias: "global",
1499
+ label: { text: "global" },
1500
+ type: { text: "global" },
1501
+ tags: null,
1502
+ link: null,
1503
+ parentBoundary: ""
1504
+ }
1505
+ ];
1506
+ parentBoundaryParse = "";
1507
+ currentBoundaryParse = "global";
1508
+ boundaryParseStack = [""];
1509
+ rels = [];
1510
+ boundaryParseStack = [""];
1511
+ title = "";
1512
+ wrapEnabled = false;
1513
+ c4ShapeInRow$1 = 4;
1514
+ c4BoundaryInRow$1 = 2;
1515
+ };
1516
+ const LINETYPE = {
1517
+ SOLID: 0,
1518
+ DOTTED: 1,
1519
+ NOTE: 2,
1520
+ SOLID_CROSS: 3,
1521
+ DOTTED_CROSS: 4,
1522
+ SOLID_OPEN: 5,
1523
+ DOTTED_OPEN: 6,
1524
+ LOOP_START: 10,
1525
+ LOOP_END: 11,
1526
+ ALT_START: 12,
1527
+ ALT_ELSE: 13,
1528
+ ALT_END: 14,
1529
+ OPT_START: 15,
1530
+ OPT_END: 16,
1531
+ ACTIVE_START: 17,
1532
+ ACTIVE_END: 18,
1533
+ PAR_START: 19,
1534
+ PAR_AND: 20,
1535
+ PAR_END: 21,
1536
+ RECT_START: 22,
1537
+ RECT_END: 23,
1538
+ SOLID_POINT: 24,
1539
+ DOTTED_POINT: 25
1540
+ };
1541
+ const ARROWTYPE = {
1542
+ FILLED: 0,
1543
+ OPEN: 1
1544
+ };
1545
+ const PLACEMENT = {
1546
+ LEFTOF: 0,
1547
+ RIGHTOF: 1,
1548
+ OVER: 2
1549
+ };
1550
+ const setTitle = function(txt) {
1551
+ let sanitizedText = sanitizeText(txt, getConfig());
1552
+ title = sanitizedText;
1553
+ };
1554
+ const db = {
1555
+ addPersonOrSystem,
1556
+ addPersonOrSystemBoundary,
1557
+ addContainer,
1558
+ addContainerBoundary,
1559
+ addComponent,
1560
+ addDeploymentNode,
1561
+ popBoundaryParseStack,
1562
+ addRel,
1563
+ updateElStyle,
1564
+ updateRelStyle,
1565
+ updateLayoutConfig,
1566
+ autoWrap,
1567
+ setWrap,
1568
+ getC4ShapeArray,
1569
+ getC4Shape,
1570
+ getC4ShapeKeys,
1571
+ getBoundaries,
1572
+ getBoundarys,
1573
+ getCurrentBoundaryParse,
1574
+ getParentBoundaryParse,
1575
+ getRels,
1576
+ getTitle,
1577
+ getC4Type,
1578
+ getC4ShapeInRow,
1579
+ getC4BoundaryInRow,
1580
+ setAccTitle,
1581
+ getAccTitle,
1582
+ getAccDescription,
1583
+ setAccDescription,
1584
+ getConfig: () => getConfig().c4,
1585
+ clear,
1586
+ LINETYPE,
1587
+ ARROWTYPE,
1588
+ PLACEMENT,
1589
+ setTitle,
1590
+ setC4Type
1591
+ // apply,
1592
+ };
1593
+ const drawRect = function(elem, rectData) {
1594
+ return drawRect$1(elem, rectData);
1595
+ };
1596
+ const drawImage = function(elem, width, height, x, y, link) {
1597
+ const imageElem = elem.append("image");
1598
+ imageElem.attr("width", width);
1599
+ imageElem.attr("height", height);
1600
+ imageElem.attr("x", x);
1601
+ imageElem.attr("y", y);
1602
+ let sanitizedLink = link.startsWith("data:image/png;base64") ? link : dist.sanitizeUrl(link);
1603
+ imageElem.attr("xlink:href", sanitizedLink);
1604
+ };
1605
+ const drawRels$1 = (elem, rels2, conf2) => {
1606
+ const relsElem = elem.append("g");
1607
+ let i = 0;
1608
+ for (let rel of rels2) {
1609
+ let textColor = rel.textColor ? rel.textColor : "#444444";
1610
+ let strokeColor = rel.lineColor ? rel.lineColor : "#444444";
1611
+ let offsetX = rel.offsetX ? parseInt(rel.offsetX) : 0;
1612
+ let offsetY = rel.offsetY ? parseInt(rel.offsetY) : 0;
1613
+ let url = "";
1614
+ if (i === 0) {
1615
+ let line = relsElem.append("line");
1616
+ line.attr("x1", rel.startPoint.x);
1617
+ line.attr("y1", rel.startPoint.y);
1618
+ line.attr("x2", rel.endPoint.x);
1619
+ line.attr("y2", rel.endPoint.y);
1620
+ line.attr("stroke-width", "1");
1621
+ line.attr("stroke", strokeColor);
1622
+ line.style("fill", "none");
1623
+ if (rel.type !== "rel_b") {
1624
+ line.attr("marker-end", "url(" + url + "#arrowhead)");
1625
+ }
1626
+ if (rel.type === "birel" || rel.type === "rel_b") {
1627
+ line.attr("marker-start", "url(" + url + "#arrowend)");
1628
+ }
1629
+ i = -1;
1630
+ } else {
1631
+ let line = relsElem.append("path");
1632
+ line.attr("fill", "none").attr("stroke-width", "1").attr("stroke", strokeColor).attr(
1633
+ "d",
1634
+ "Mstartx,starty Qcontrolx,controly stopx,stopy ".replaceAll("startx", rel.startPoint.x).replaceAll("starty", rel.startPoint.y).replaceAll(
1635
+ "controlx",
1636
+ rel.startPoint.x + (rel.endPoint.x - rel.startPoint.x) / 2 - (rel.endPoint.x - rel.startPoint.x) / 4
1637
+ ).replaceAll("controly", rel.startPoint.y + (rel.endPoint.y - rel.startPoint.y) / 2).replaceAll("stopx", rel.endPoint.x).replaceAll("stopy", rel.endPoint.y)
1638
+ );
1639
+ if (rel.type !== "rel_b") {
1640
+ line.attr("marker-end", "url(" + url + "#arrowhead)");
1641
+ }
1642
+ if (rel.type === "birel" || rel.type === "rel_b") {
1643
+ line.attr("marker-start", "url(" + url + "#arrowend)");
1644
+ }
1645
+ }
1646
+ let messageConf = conf2.messageFont();
1647
+ _drawTextCandidateFunc(conf2)(
1648
+ rel.label.text,
1649
+ relsElem,
1650
+ Math.min(rel.startPoint.x, rel.endPoint.x) + Math.abs(rel.endPoint.x - rel.startPoint.x) / 2 + offsetX,
1651
+ Math.min(rel.startPoint.y, rel.endPoint.y) + Math.abs(rel.endPoint.y - rel.startPoint.y) / 2 + offsetY,
1652
+ rel.label.width,
1653
+ rel.label.height,
1654
+ { fill: textColor },
1655
+ messageConf
1656
+ );
1657
+ if (rel.techn && rel.techn.text !== "") {
1658
+ messageConf = conf2.messageFont();
1659
+ _drawTextCandidateFunc(conf2)(
1660
+ "[" + rel.techn.text + "]",
1661
+ relsElem,
1662
+ Math.min(rel.startPoint.x, rel.endPoint.x) + Math.abs(rel.endPoint.x - rel.startPoint.x) / 2 + offsetX,
1663
+ Math.min(rel.startPoint.y, rel.endPoint.y) + Math.abs(rel.endPoint.y - rel.startPoint.y) / 2 + conf2.messageFontSize + 5 + offsetY,
1664
+ Math.max(rel.label.width, rel.techn.width),
1665
+ rel.techn.height,
1666
+ { fill: textColor, "font-style": "italic" },
1667
+ messageConf
1668
+ );
1669
+ }
1670
+ }
1671
+ };
1672
+ const drawBoundary$1 = function(elem, boundary, conf2) {
1673
+ const boundaryElem = elem.append("g");
1674
+ let fillColor = boundary.bgColor ? boundary.bgColor : "none";
1675
+ let strokeColor = boundary.borderColor ? boundary.borderColor : "#444444";
1676
+ let fontColor = boundary.fontColor ? boundary.fontColor : "black";
1677
+ let attrsValue = { "stroke-width": 1, "stroke-dasharray": "7.0,7.0" };
1678
+ if (boundary.nodeType) {
1679
+ attrsValue = { "stroke-width": 1 };
1680
+ }
1681
+ let rectData = {
1682
+ x: boundary.x,
1683
+ y: boundary.y,
1684
+ fill: fillColor,
1685
+ stroke: strokeColor,
1686
+ width: boundary.width,
1687
+ height: boundary.height,
1688
+ rx: 2.5,
1689
+ ry: 2.5,
1690
+ attrs: attrsValue
1691
+ };
1692
+ drawRect(boundaryElem, rectData);
1693
+ let boundaryConf = conf2.boundaryFont();
1694
+ boundaryConf.fontWeight = "bold";
1695
+ boundaryConf.fontSize = boundaryConf.fontSize + 2;
1696
+ boundaryConf.fontColor = fontColor;
1697
+ _drawTextCandidateFunc(conf2)(
1698
+ boundary.label.text,
1699
+ boundaryElem,
1700
+ boundary.x,
1701
+ boundary.y + boundary.label.Y,
1702
+ boundary.width,
1703
+ boundary.height,
1704
+ { fill: "#444444" },
1705
+ boundaryConf
1706
+ );
1707
+ if (boundary.type && boundary.type.text !== "") {
1708
+ boundaryConf = conf2.boundaryFont();
1709
+ boundaryConf.fontColor = fontColor;
1710
+ _drawTextCandidateFunc(conf2)(
1711
+ boundary.type.text,
1712
+ boundaryElem,
1713
+ boundary.x,
1714
+ boundary.y + boundary.type.Y,
1715
+ boundary.width,
1716
+ boundary.height,
1717
+ { fill: "#444444" },
1718
+ boundaryConf
1719
+ );
1720
+ }
1721
+ if (boundary.descr && boundary.descr.text !== "") {
1722
+ boundaryConf = conf2.boundaryFont();
1723
+ boundaryConf.fontSize = boundaryConf.fontSize - 2;
1724
+ boundaryConf.fontColor = fontColor;
1725
+ _drawTextCandidateFunc(conf2)(
1726
+ boundary.descr.text,
1727
+ boundaryElem,
1728
+ boundary.x,
1729
+ boundary.y + boundary.descr.Y,
1730
+ boundary.width,
1731
+ boundary.height,
1732
+ { fill: "#444444" },
1733
+ boundaryConf
1734
+ );
1735
+ }
1736
+ };
1737
+ const drawC4Shape = function(elem, c4Shape, conf2) {
1738
+ var _a;
1739
+ let fillColor = c4Shape.bgColor ? c4Shape.bgColor : conf2[c4Shape.typeC4Shape.text + "_bg_color"];
1740
+ let strokeColor = c4Shape.borderColor ? c4Shape.borderColor : conf2[c4Shape.typeC4Shape.text + "_border_color"];
1741
+ let fontColor = c4Shape.fontColor ? c4Shape.fontColor : "#FFFFFF";
1742
+ let personImg = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";
1743
+ switch (c4Shape.typeC4Shape.text) {
1744
+ case "person":
1745
+ personImg = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";
1746
+ break;
1747
+ case "external_person":
1748
+ personImg = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAAB6ElEQVR4Xu2YLY+EMBCG9+dWr0aj0Wg0Go1Go0+j8Xdv2uTCvv1gpt0ebHKPuhDaeW4605Z9mJvx4AdXUyTUdd08z+u6flmWZRnHsWkafk9DptAwDPu+f0eAYtu2PEaGWuj5fCIZrBAC2eLBAnRCsEkkxmeaJp7iDJ2QMDdHsLg8SxKFEJaAo8lAXnmuOFIhTMpxxKATebo4UiFknuNo4OniSIXQyRxEA3YsnjGCVEjVXD7yLUAqxBGUyPv/Y4W2beMgGuS7kVQIBycH0fD+oi5pezQETxdHKmQKGk1eQEYldK+jw5GxPfZ9z7Mk0Qnhf1W1m3w//EUn5BDmSZsbR44QQLBEqrBHqOrmSKaQAxdnLArCrxZcM7A7ZKs4ioRq8LFC+NpC3WCBJsvpVw5edm9iEXFuyNfxXAgSwfrFQ1c0iNda8AdejvUgnktOtJQQxmcfFzGglc5WVCj7oDgFqU18boeFSs52CUh8LE8BIVQDT1ABrB0HtgSEYlX5doJnCwv9TXocKCaKbnwhdDKPq4lf3SwU3HLq4V/+WYhHVMa/3b4IlfyikAduCkcBc7mQ3/z/Qq/cTuikhkzB12Ae/mcJC9U+Vo8Ej1gWAtgbeGgFsAMHr50BIWOLCbezvhpBFUdY6EJuJ/QDW0XoMX60zZ0AAAAASUVORK5CYII=";
1749
+ break;
1750
+ }
1751
+ const c4ShapeElem = elem.append("g");
1752
+ c4ShapeElem.attr("class", "person-man");
1753
+ const rect = getNoteRect();
1754
+ switch (c4Shape.typeC4Shape.text) {
1755
+ case "person":
1756
+ case "external_person":
1757
+ case "system":
1758
+ case "external_system":
1759
+ case "container":
1760
+ case "external_container":
1761
+ case "component":
1762
+ case "external_component":
1763
+ rect.x = c4Shape.x;
1764
+ rect.y = c4Shape.y;
1765
+ rect.fill = fillColor;
1766
+ rect.width = c4Shape.width;
1767
+ rect.height = c4Shape.height;
1768
+ rect.stroke = strokeColor;
1769
+ rect.rx = 2.5;
1770
+ rect.ry = 2.5;
1771
+ rect.attrs = { "stroke-width": 0.5 };
1772
+ drawRect(c4ShapeElem, rect);
1773
+ break;
1774
+ case "system_db":
1775
+ case "external_system_db":
1776
+ case "container_db":
1777
+ case "external_container_db":
1778
+ case "component_db":
1779
+ case "external_component_db":
1780
+ c4ShapeElem.append("path").attr("fill", fillColor).attr("stroke-width", "0.5").attr("stroke", strokeColor).attr(
1781
+ "d",
1782
+ "Mstartx,startyc0,-10 half,-10 half,-10c0,0 half,0 half,10l0,heightc0,10 -half,10 -half,10c0,0 -half,0 -half,-10l0,-height".replaceAll("startx", c4Shape.x).replaceAll("starty", c4Shape.y).replaceAll("half", c4Shape.width / 2).replaceAll("height", c4Shape.height)
1783
+ );
1784
+ c4ShapeElem.append("path").attr("fill", "none").attr("stroke-width", "0.5").attr("stroke", strokeColor).attr(
1785
+ "d",
1786
+ "Mstartx,startyc0,10 half,10 half,10c0,0 half,0 half,-10".replaceAll("startx", c4Shape.x).replaceAll("starty", c4Shape.y).replaceAll("half", c4Shape.width / 2)
1787
+ );
1788
+ break;
1789
+ case "system_queue":
1790
+ case "external_system_queue":
1791
+ case "container_queue":
1792
+ case "external_container_queue":
1793
+ case "component_queue":
1794
+ case "external_component_queue":
1795
+ c4ShapeElem.append("path").attr("fill", fillColor).attr("stroke-width", "0.5").attr("stroke", strokeColor).attr(
1796
+ "d",
1797
+ "Mstartx,startylwidth,0c5,0 5,half 5,halfc0,0 0,half -5,halfl-width,0c-5,0 -5,-half -5,-halfc0,0 0,-half 5,-half".replaceAll("startx", c4Shape.x).replaceAll("starty", c4Shape.y).replaceAll("width", c4Shape.width).replaceAll("half", c4Shape.height / 2)
1798
+ );
1799
+ c4ShapeElem.append("path").attr("fill", "none").attr("stroke-width", "0.5").attr("stroke", strokeColor).attr(
1800
+ "d",
1801
+ "Mstartx,startyc-5,0 -5,half -5,halfc0,half 5,half 5,half".replaceAll("startx", c4Shape.x + c4Shape.width).replaceAll("starty", c4Shape.y).replaceAll("half", c4Shape.height / 2)
1802
+ );
1803
+ break;
1804
+ }
1805
+ let c4ShapeFontConf = getC4ShapeFont(conf2, c4Shape.typeC4Shape.text);
1806
+ c4ShapeElem.append("text").attr("fill", fontColor).attr("font-family", c4ShapeFontConf.fontFamily).attr("font-size", c4ShapeFontConf.fontSize - 2).attr("font-style", "italic").attr("lengthAdjust", "spacing").attr("textLength", c4Shape.typeC4Shape.width).attr("x", c4Shape.x + c4Shape.width / 2 - c4Shape.typeC4Shape.width / 2).attr("y", c4Shape.y + c4Shape.typeC4Shape.Y).text("<<" + c4Shape.typeC4Shape.text + ">>");
1807
+ switch (c4Shape.typeC4Shape.text) {
1808
+ case "person":
1809
+ case "external_person":
1810
+ drawImage(
1811
+ c4ShapeElem,
1812
+ 48,
1813
+ 48,
1814
+ c4Shape.x + c4Shape.width / 2 - 24,
1815
+ c4Shape.y + c4Shape.image.Y,
1816
+ personImg
1817
+ );
1818
+ break;
1819
+ }
1820
+ let textFontConf = conf2[c4Shape.typeC4Shape.text + "Font"]();
1821
+ textFontConf.fontWeight = "bold";
1822
+ textFontConf.fontSize = textFontConf.fontSize + 2;
1823
+ textFontConf.fontColor = fontColor;
1824
+ _drawTextCandidateFunc(conf2)(
1825
+ c4Shape.label.text,
1826
+ c4ShapeElem,
1827
+ c4Shape.x,
1828
+ c4Shape.y + c4Shape.label.Y,
1829
+ c4Shape.width,
1830
+ c4Shape.height,
1831
+ { fill: fontColor },
1832
+ textFontConf
1833
+ );
1834
+ textFontConf = conf2[c4Shape.typeC4Shape.text + "Font"]();
1835
+ textFontConf.fontColor = fontColor;
1836
+ if (c4Shape.techn && ((_a = c4Shape.techn) == null ? void 0 : _a.text) !== "") {
1837
+ _drawTextCandidateFunc(conf2)(
1838
+ c4Shape.techn.text,
1839
+ c4ShapeElem,
1840
+ c4Shape.x,
1841
+ c4Shape.y + c4Shape.techn.Y,
1842
+ c4Shape.width,
1843
+ c4Shape.height,
1844
+ { fill: fontColor, "font-style": "italic" },
1845
+ textFontConf
1846
+ );
1847
+ } else if (c4Shape.type && c4Shape.type.text !== "") {
1848
+ _drawTextCandidateFunc(conf2)(
1849
+ c4Shape.type.text,
1850
+ c4ShapeElem,
1851
+ c4Shape.x,
1852
+ c4Shape.y + c4Shape.type.Y,
1853
+ c4Shape.width,
1854
+ c4Shape.height,
1855
+ { fill: fontColor, "font-style": "italic" },
1856
+ textFontConf
1857
+ );
1858
+ }
1859
+ if (c4Shape.descr && c4Shape.descr.text !== "") {
1860
+ textFontConf = conf2.personFont();
1861
+ textFontConf.fontColor = fontColor;
1862
+ _drawTextCandidateFunc(conf2)(
1863
+ c4Shape.descr.text,
1864
+ c4ShapeElem,
1865
+ c4Shape.x,
1866
+ c4Shape.y + c4Shape.descr.Y,
1867
+ c4Shape.width,
1868
+ c4Shape.height,
1869
+ { fill: fontColor },
1870
+ textFontConf
1871
+ );
1872
+ }
1873
+ return c4Shape.height;
1874
+ };
1875
+ const insertDatabaseIcon = function(elem) {
1876
+ elem.append("defs").append("symbol").attr("id", "database").attr("fill-rule", "evenodd").attr("clip-rule", "evenodd").append("path").attr("transform", "scale(.5)").attr(
1877
+ "d",
1878
+ "M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z"
1879
+ );
1880
+ };
1881
+ const insertComputerIcon = function(elem) {
1882
+ elem.append("defs").append("symbol").attr("id", "computer").attr("width", "24").attr("height", "24").append("path").attr("transform", "scale(.5)").attr(
1883
+ "d",
1884
+ "M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z"
1885
+ );
1886
+ };
1887
+ const insertClockIcon = function(elem) {
1888
+ elem.append("defs").append("symbol").attr("id", "clock").attr("width", "24").attr("height", "24").append("path").attr("transform", "scale(.5)").attr(
1889
+ "d",
1890
+ "M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z"
1891
+ );
1892
+ };
1893
+ const insertArrowHead = function(elem) {
1894
+ elem.append("defs").append("marker").attr("id", "arrowhead").attr("refX", 9).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto").append("path").attr("d", "M 0 0 L 10 5 L 0 10 z");
1895
+ };
1896
+ const insertArrowEnd = function(elem) {
1897
+ elem.append("defs").append("marker").attr("id", "arrowend").attr("refX", 1).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto").append("path").attr("d", "M 10 0 L 0 5 L 10 10 z");
1898
+ };
1899
+ const insertArrowFilledHead = function(elem) {
1900
+ elem.append("defs").append("marker").attr("id", "filled-head").attr("refX", 18).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L14,7 L9,1 Z");
1901
+ };
1902
+ const insertDynamicNumber = function(elem) {
1903
+ elem.append("defs").append("marker").attr("id", "sequencenumber").attr("refX", 15).attr("refY", 15).attr("markerWidth", 60).attr("markerHeight", 40).attr("orient", "auto").append("circle").attr("cx", 15).attr("cy", 15).attr("r", 6);
1904
+ };
1905
+ const insertArrowCrossHead = function(elem) {
1906
+ const defs = elem.append("defs");
1907
+ const marker = defs.append("marker").attr("id", "crosshead").attr("markerWidth", 15).attr("markerHeight", 8).attr("orient", "auto").attr("refX", 16).attr("refY", 4);
1908
+ marker.append("path").attr("fill", "black").attr("stroke", "#000000").style("stroke-dasharray", "0, 0").attr("stroke-width", "1px").attr("d", "M 9,2 V 6 L16,4 Z");
1909
+ marker.append("path").attr("fill", "none").attr("stroke", "#000000").style("stroke-dasharray", "0, 0").attr("stroke-width", "1px").attr("d", "M 0,1 L 6,7 M 6,1 L 0,7");
1910
+ };
1911
+ const getC4ShapeFont = (cnf, typeC4Shape) => {
1912
+ return {
1913
+ fontFamily: cnf[typeC4Shape + "FontFamily"],
1914
+ fontSize: cnf[typeC4Shape + "FontSize"],
1915
+ fontWeight: cnf[typeC4Shape + "FontWeight"]
1916
+ };
1917
+ };
1918
+ const _drawTextCandidateFunc = function() {
1919
+ function byText(content, g, x, y, width, height, textAttrs) {
1920
+ const text = g.append("text").attr("x", x + width / 2).attr("y", y + height / 2 + 5).style("text-anchor", "middle").text(content);
1921
+ _setTextAttrs(text, textAttrs);
1922
+ }
1923
+ function byTspan(content, g, x, y, width, height, textAttrs, conf2) {
1924
+ const { fontSize, fontFamily, fontWeight } = conf2;
1925
+ const lines = content.split(common.lineBreakRegex);
1926
+ for (let i = 0; i < lines.length; i++) {
1927
+ const dy = i * fontSize - fontSize * (lines.length - 1) / 2;
1928
+ const text = g.append("text").attr("x", x + width / 2).attr("y", y).style("text-anchor", "middle").attr("dominant-baseline", "middle").style("font-size", fontSize).style("font-weight", fontWeight).style("font-family", fontFamily);
1929
+ text.append("tspan").attr("dy", dy).text(lines[i]).attr("alignment-baseline", "mathematical");
1930
+ _setTextAttrs(text, textAttrs);
1931
+ }
1932
+ }
1933
+ function byFo(content, g, x, y, width, height, textAttrs, conf2) {
1934
+ const s = g.append("switch");
1935
+ const f = s.append("foreignObject").attr("x", x).attr("y", y).attr("width", width).attr("height", height);
1936
+ const text = f.append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
1937
+ text.append("div").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(content);
1938
+ byTspan(content, s, x, y, width, height, textAttrs, conf2);
1939
+ _setTextAttrs(text, textAttrs);
1940
+ }
1941
+ function _setTextAttrs(toText, fromTextAttrsDict) {
1942
+ for (const key in fromTextAttrsDict) {
1943
+ if (fromTextAttrsDict.hasOwnProperty(key)) {
1944
+ toText.attr(key, fromTextAttrsDict[key]);
1945
+ }
1946
+ }
1947
+ }
1948
+ return function(conf2) {
1949
+ return conf2.textPlacement === "fo" ? byFo : conf2.textPlacement === "old" ? byText : byTspan;
1950
+ };
1951
+ }();
1952
+ const svgDraw = {
1953
+ drawRect,
1954
+ drawBoundary: drawBoundary$1,
1955
+ drawC4Shape,
1956
+ drawRels: drawRels$1,
1957
+ drawImage,
1958
+ insertArrowHead,
1959
+ insertArrowEnd,
1960
+ insertArrowFilledHead,
1961
+ insertDynamicNumber,
1962
+ insertArrowCrossHead,
1963
+ insertDatabaseIcon,
1964
+ insertComputerIcon,
1965
+ insertClockIcon
1966
+ };
1967
+ let globalBoundaryMaxX = 0, globalBoundaryMaxY = 0;
1968
+ let c4ShapeInRow = 4;
1969
+ let c4BoundaryInRow = 2;
1970
+ parser.yy = db;
1971
+ let conf = {};
1972
+ class Bounds {
1973
+ constructor(diagObj) {
1974
+ this.name = "";
1975
+ this.data = {};
1976
+ this.data.startx = void 0;
1977
+ this.data.stopx = void 0;
1978
+ this.data.starty = void 0;
1979
+ this.data.stopy = void 0;
1980
+ this.data.widthLimit = void 0;
1981
+ this.nextData = {};
1982
+ this.nextData.startx = void 0;
1983
+ this.nextData.stopx = void 0;
1984
+ this.nextData.starty = void 0;
1985
+ this.nextData.stopy = void 0;
1986
+ this.nextData.cnt = 0;
1987
+ setConf(diagObj.db.getConfig());
1988
+ }
1989
+ setData(startx, stopx, starty, stopy) {
1990
+ this.nextData.startx = this.data.startx = startx;
1991
+ this.nextData.stopx = this.data.stopx = stopx;
1992
+ this.nextData.starty = this.data.starty = starty;
1993
+ this.nextData.stopy = this.data.stopy = stopy;
1994
+ }
1995
+ updateVal(obj, key, val, fun) {
1996
+ if (obj[key] === void 0) {
1997
+ obj[key] = val;
1998
+ } else {
1999
+ obj[key] = fun(val, obj[key]);
2000
+ }
2001
+ }
2002
+ insert(c4Shape) {
2003
+ this.nextData.cnt = this.nextData.cnt + 1;
2004
+ let _startx = this.nextData.startx === this.nextData.stopx ? this.nextData.stopx + c4Shape.margin : this.nextData.stopx + c4Shape.margin * 2;
2005
+ let _stopx = _startx + c4Shape.width;
2006
+ let _starty = this.nextData.starty + c4Shape.margin * 2;
2007
+ let _stopy = _starty + c4Shape.height;
2008
+ if (_startx >= this.data.widthLimit || _stopx >= this.data.widthLimit || this.nextData.cnt > c4ShapeInRow) {
2009
+ _startx = this.nextData.startx + c4Shape.margin + conf.nextLinePaddingX;
2010
+ _starty = this.nextData.stopy + c4Shape.margin * 2;
2011
+ this.nextData.stopx = _stopx = _startx + c4Shape.width;
2012
+ this.nextData.starty = this.nextData.stopy;
2013
+ this.nextData.stopy = _stopy = _starty + c4Shape.height;
2014
+ this.nextData.cnt = 1;
2015
+ }
2016
+ c4Shape.x = _startx;
2017
+ c4Shape.y = _starty;
2018
+ this.updateVal(this.data, "startx", _startx, Math.min);
2019
+ this.updateVal(this.data, "starty", _starty, Math.min);
2020
+ this.updateVal(this.data, "stopx", _stopx, Math.max);
2021
+ this.updateVal(this.data, "stopy", _stopy, Math.max);
2022
+ this.updateVal(this.nextData, "startx", _startx, Math.min);
2023
+ this.updateVal(this.nextData, "starty", _starty, Math.min);
2024
+ this.updateVal(this.nextData, "stopx", _stopx, Math.max);
2025
+ this.updateVal(this.nextData, "stopy", _stopy, Math.max);
2026
+ }
2027
+ init(diagObj) {
2028
+ this.name = "";
2029
+ this.data = {
2030
+ startx: void 0,
2031
+ stopx: void 0,
2032
+ starty: void 0,
2033
+ stopy: void 0,
2034
+ widthLimit: void 0
2035
+ };
2036
+ this.nextData = {
2037
+ startx: void 0,
2038
+ stopx: void 0,
2039
+ starty: void 0,
2040
+ stopy: void 0,
2041
+ cnt: 0
2042
+ };
2043
+ setConf(diagObj.db.getConfig());
2044
+ }
2045
+ bumpLastMargin(margin) {
2046
+ this.data.stopx += margin;
2047
+ this.data.stopy += margin;
2048
+ }
2049
+ }
2050
+ const setConf = function(cnf) {
2051
+ assignWithDepth(conf, cnf);
2052
+ if (cnf.fontFamily) {
2053
+ conf.personFontFamily = conf.systemFontFamily = conf.messageFontFamily = cnf.fontFamily;
2054
+ }
2055
+ if (cnf.fontSize) {
2056
+ conf.personFontSize = conf.systemFontSize = conf.messageFontSize = cnf.fontSize;
2057
+ }
2058
+ if (cnf.fontWeight) {
2059
+ conf.personFontWeight = conf.systemFontWeight = conf.messageFontWeight = cnf.fontWeight;
2060
+ }
2061
+ };
2062
+ const c4ShapeFont = (cnf, typeC4Shape) => {
2063
+ return {
2064
+ fontFamily: cnf[typeC4Shape + "FontFamily"],
2065
+ fontSize: cnf[typeC4Shape + "FontSize"],
2066
+ fontWeight: cnf[typeC4Shape + "FontWeight"]
2067
+ };
2068
+ };
2069
+ const boundaryFont = (cnf) => {
2070
+ return {
2071
+ fontFamily: cnf.boundaryFontFamily,
2072
+ fontSize: cnf.boundaryFontSize,
2073
+ fontWeight: cnf.boundaryFontWeight
2074
+ };
2075
+ };
2076
+ const messageFont = (cnf) => {
2077
+ return {
2078
+ fontFamily: cnf.messageFontFamily,
2079
+ fontSize: cnf.messageFontSize,
2080
+ fontWeight: cnf.messageFontWeight
2081
+ };
2082
+ };
2083
+ function calcC4ShapeTextWH(textType, c4Shape, c4ShapeTextWrap, textConf, textLimitWidth) {
2084
+ if (!c4Shape[textType].width) {
2085
+ if (c4ShapeTextWrap) {
2086
+ c4Shape[textType].text = wrapLabel(c4Shape[textType].text, textLimitWidth, textConf);
2087
+ c4Shape[textType].textLines = c4Shape[textType].text.split(common.lineBreakRegex).length;
2088
+ c4Shape[textType].width = textLimitWidth;
2089
+ c4Shape[textType].height = calculateTextHeight(c4Shape[textType].text, textConf);
2090
+ } else {
2091
+ let lines = c4Shape[textType].text.split(common.lineBreakRegex);
2092
+ c4Shape[textType].textLines = lines.length;
2093
+ let lineHeight = 0;
2094
+ c4Shape[textType].height = 0;
2095
+ c4Shape[textType].width = 0;
2096
+ for (const line of lines) {
2097
+ c4Shape[textType].width = Math.max(
2098
+ calculateTextWidth(line, textConf),
2099
+ c4Shape[textType].width
2100
+ );
2101
+ lineHeight = calculateTextHeight(line, textConf);
2102
+ c4Shape[textType].height = c4Shape[textType].height + lineHeight;
2103
+ }
2104
+ }
2105
+ }
2106
+ }
2107
+ const drawBoundary = function(diagram2, boundary, bounds) {
2108
+ boundary.x = bounds.data.startx;
2109
+ boundary.y = bounds.data.starty;
2110
+ boundary.width = bounds.data.stopx - bounds.data.startx;
2111
+ boundary.height = bounds.data.stopy - bounds.data.starty;
2112
+ boundary.label.y = conf.c4ShapeMargin - 35;
2113
+ let boundaryTextWrap = boundary.wrap && conf.wrap;
2114
+ let boundaryLabelConf = boundaryFont(conf);
2115
+ boundaryLabelConf.fontSize = boundaryLabelConf.fontSize + 2;
2116
+ boundaryLabelConf.fontWeight = "bold";
2117
+ let textLimitWidth = calculateTextWidth(boundary.label.text, boundaryLabelConf);
2118
+ calcC4ShapeTextWH("label", boundary, boundaryTextWrap, boundaryLabelConf, textLimitWidth);
2119
+ svgDraw.drawBoundary(diagram2, boundary, conf);
2120
+ };
2121
+ const drawC4ShapeArray = function(currentBounds, diagram2, c4ShapeArray2, c4ShapeKeys) {
2122
+ let Y = 0;
2123
+ for (const c4ShapeKey of c4ShapeKeys) {
2124
+ Y = 0;
2125
+ const c4Shape = c4ShapeArray2[c4ShapeKey];
2126
+ let c4ShapeTypeConf = c4ShapeFont(conf, c4Shape.typeC4Shape.text);
2127
+ c4ShapeTypeConf.fontSize = c4ShapeTypeConf.fontSize - 2;
2128
+ c4Shape.typeC4Shape.width = calculateTextWidth(
2129
+ "«" + c4Shape.typeC4Shape.text + "»",
2130
+ c4ShapeTypeConf
2131
+ );
2132
+ c4Shape.typeC4Shape.height = c4ShapeTypeConf.fontSize + 2;
2133
+ c4Shape.typeC4Shape.Y = conf.c4ShapePadding;
2134
+ Y = c4Shape.typeC4Shape.Y + c4Shape.typeC4Shape.height - 4;
2135
+ c4Shape.image = { width: 0, height: 0, Y: 0 };
2136
+ switch (c4Shape.typeC4Shape.text) {
2137
+ case "person":
2138
+ case "external_person":
2139
+ c4Shape.image.width = 48;
2140
+ c4Shape.image.height = 48;
2141
+ c4Shape.image.Y = Y;
2142
+ Y = c4Shape.image.Y + c4Shape.image.height;
2143
+ break;
2144
+ }
2145
+ if (c4Shape.sprite) {
2146
+ c4Shape.image.width = 48;
2147
+ c4Shape.image.height = 48;
2148
+ c4Shape.image.Y = Y;
2149
+ Y = c4Shape.image.Y + c4Shape.image.height;
2150
+ }
2151
+ let c4ShapeTextWrap = c4Shape.wrap && conf.wrap;
2152
+ let textLimitWidth = conf.width - conf.c4ShapePadding * 2;
2153
+ let c4ShapeLabelConf = c4ShapeFont(conf, c4Shape.typeC4Shape.text);
2154
+ c4ShapeLabelConf.fontSize = c4ShapeLabelConf.fontSize + 2;
2155
+ c4ShapeLabelConf.fontWeight = "bold";
2156
+ calcC4ShapeTextWH("label", c4Shape, c4ShapeTextWrap, c4ShapeLabelConf, textLimitWidth);
2157
+ c4Shape["label"].Y = Y + 8;
2158
+ Y = c4Shape["label"].Y + c4Shape["label"].height;
2159
+ if (c4Shape.type && c4Shape.type.text !== "") {
2160
+ c4Shape.type.text = "[" + c4Shape.type.text + "]";
2161
+ let c4ShapeTypeConf2 = c4ShapeFont(conf, c4Shape.typeC4Shape.text);
2162
+ calcC4ShapeTextWH("type", c4Shape, c4ShapeTextWrap, c4ShapeTypeConf2, textLimitWidth);
2163
+ c4Shape["type"].Y = Y + 5;
2164
+ Y = c4Shape["type"].Y + c4Shape["type"].height;
2165
+ } else if (c4Shape.techn && c4Shape.techn.text !== "") {
2166
+ c4Shape.techn.text = "[" + c4Shape.techn.text + "]";
2167
+ let c4ShapeTechnConf = c4ShapeFont(conf, c4Shape.techn.text);
2168
+ calcC4ShapeTextWH("techn", c4Shape, c4ShapeTextWrap, c4ShapeTechnConf, textLimitWidth);
2169
+ c4Shape["techn"].Y = Y + 5;
2170
+ Y = c4Shape["techn"].Y + c4Shape["techn"].height;
2171
+ }
2172
+ let rectHeight = Y;
2173
+ let rectWidth = c4Shape.label.width;
2174
+ if (c4Shape.descr && c4Shape.descr.text !== "") {
2175
+ let c4ShapeDescrConf = c4ShapeFont(conf, c4Shape.typeC4Shape.text);
2176
+ calcC4ShapeTextWH("descr", c4Shape, c4ShapeTextWrap, c4ShapeDescrConf, textLimitWidth);
2177
+ c4Shape["descr"].Y = Y + 20;
2178
+ Y = c4Shape["descr"].Y + c4Shape["descr"].height;
2179
+ rectWidth = Math.max(c4Shape.label.width, c4Shape.descr.width);
2180
+ rectHeight = Y - c4Shape["descr"].textLines * 5;
2181
+ }
2182
+ rectWidth = rectWidth + conf.c4ShapePadding;
2183
+ c4Shape.width = Math.max(c4Shape.width || conf.width, rectWidth, conf.width);
2184
+ c4Shape.height = Math.max(c4Shape.height || conf.height, rectHeight, conf.height);
2185
+ c4Shape.margin = c4Shape.margin || conf.c4ShapeMargin;
2186
+ currentBounds.insert(c4Shape);
2187
+ svgDraw.drawC4Shape(diagram2, c4Shape, conf);
2188
+ }
2189
+ currentBounds.bumpLastMargin(conf.c4ShapeMargin);
2190
+ };
2191
+ class Point {
2192
+ constructor(x, y) {
2193
+ this.x = x;
2194
+ this.y = y;
2195
+ }
2196
+ }
2197
+ let getIntersectPoint = function(fromNode, endPoint) {
2198
+ let x1 = fromNode.x;
2199
+ let y1 = fromNode.y;
2200
+ let x2 = endPoint.x;
2201
+ let y2 = endPoint.y;
2202
+ let fromCenterX = x1 + fromNode.width / 2;
2203
+ let fromCenterY = y1 + fromNode.height / 2;
2204
+ let dx = Math.abs(x1 - x2);
2205
+ let dy = Math.abs(y1 - y2);
2206
+ let tanDYX = dy / dx;
2207
+ let fromDYX = fromNode.height / fromNode.width;
2208
+ let returnPoint = null;
2209
+ if (y1 == y2 && x1 < x2) {
2210
+ returnPoint = new Point(x1 + fromNode.width, fromCenterY);
2211
+ } else if (y1 == y2 && x1 > x2) {
2212
+ returnPoint = new Point(x1, fromCenterY);
2213
+ } else if (x1 == x2 && y1 < y2) {
2214
+ returnPoint = new Point(fromCenterX, y1 + fromNode.height);
2215
+ } else if (x1 == x2 && y1 > y2) {
2216
+ returnPoint = new Point(fromCenterX, y1);
2217
+ }
2218
+ if (x1 > x2 && y1 < y2) {
2219
+ if (fromDYX >= tanDYX) {
2220
+ returnPoint = new Point(x1, fromCenterY + tanDYX * fromNode.width / 2);
2221
+ } else {
2222
+ returnPoint = new Point(
2223
+ fromCenterX - dx / dy * fromNode.height / 2,
2224
+ y1 + fromNode.height
2225
+ );
2226
+ }
2227
+ } else if (x1 < x2 && y1 < y2) {
2228
+ if (fromDYX >= tanDYX) {
2229
+ returnPoint = new Point(x1 + fromNode.width, fromCenterY + tanDYX * fromNode.width / 2);
2230
+ } else {
2231
+ returnPoint = new Point(
2232
+ fromCenterX + dx / dy * fromNode.height / 2,
2233
+ y1 + fromNode.height
2234
+ );
2235
+ }
2236
+ } else if (x1 < x2 && y1 > y2) {
2237
+ if (fromDYX >= tanDYX) {
2238
+ returnPoint = new Point(x1 + fromNode.width, fromCenterY - tanDYX * fromNode.width / 2);
2239
+ } else {
2240
+ returnPoint = new Point(fromCenterX + fromNode.height / 2 * dx / dy, y1);
2241
+ }
2242
+ } else if (x1 > x2 && y1 > y2) {
2243
+ if (fromDYX >= tanDYX) {
2244
+ returnPoint = new Point(x1, fromCenterY - fromNode.width / 2 * tanDYX);
2245
+ } else {
2246
+ returnPoint = new Point(fromCenterX - fromNode.height / 2 * dx / dy, y1);
2247
+ }
2248
+ }
2249
+ return returnPoint;
2250
+ };
2251
+ let getIntersectPoints = function(fromNode, endNode) {
2252
+ let endIntersectPoint = { x: 0, y: 0 };
2253
+ endIntersectPoint.x = endNode.x + endNode.width / 2;
2254
+ endIntersectPoint.y = endNode.y + endNode.height / 2;
2255
+ let startPoint = getIntersectPoint(fromNode, endIntersectPoint);
2256
+ endIntersectPoint.x = fromNode.x + fromNode.width / 2;
2257
+ endIntersectPoint.y = fromNode.y + fromNode.height / 2;
2258
+ let endPoint = getIntersectPoint(endNode, endIntersectPoint);
2259
+ return { startPoint, endPoint };
2260
+ };
2261
+ const drawRels = function(diagram2, rels2, getC4ShapeObj, diagObj) {
2262
+ let i = 0;
2263
+ for (let rel of rels2) {
2264
+ i = i + 1;
2265
+ let relTextWrap = rel.wrap && conf.wrap;
2266
+ let relConf = messageFont(conf);
2267
+ let diagramType = diagObj.db.getC4Type();
2268
+ if (diagramType === "C4Dynamic") {
2269
+ rel.label.text = i + ": " + rel.label.text;
2270
+ }
2271
+ let textLimitWidth = calculateTextWidth(rel.label.text, relConf);
2272
+ calcC4ShapeTextWH("label", rel, relTextWrap, relConf, textLimitWidth);
2273
+ if (rel.techn && rel.techn.text !== "") {
2274
+ textLimitWidth = calculateTextWidth(rel.techn.text, relConf);
2275
+ calcC4ShapeTextWH("techn", rel, relTextWrap, relConf, textLimitWidth);
2276
+ }
2277
+ if (rel.descr && rel.descr.text !== "") {
2278
+ textLimitWidth = calculateTextWidth(rel.descr.text, relConf);
2279
+ calcC4ShapeTextWH("descr", rel, relTextWrap, relConf, textLimitWidth);
2280
+ }
2281
+ let fromNode = getC4ShapeObj(rel.from);
2282
+ let endNode = getC4ShapeObj(rel.to);
2283
+ let points = getIntersectPoints(fromNode, endNode);
2284
+ rel.startPoint = points.startPoint;
2285
+ rel.endPoint = points.endPoint;
2286
+ }
2287
+ svgDraw.drawRels(diagram2, rels2, conf);
2288
+ };
2289
+ function drawInsideBoundary(diagram2, parentBoundaryAlias, parentBounds, currentBoundaries, diagObj) {
2290
+ let currentBounds = new Bounds(diagObj);
2291
+ currentBounds.data.widthLimit = parentBounds.data.widthLimit / Math.min(c4BoundaryInRow, currentBoundaries.length);
2292
+ for (let [i, currentBoundary] of currentBoundaries.entries()) {
2293
+ let Y = 0;
2294
+ currentBoundary.image = { width: 0, height: 0, Y: 0 };
2295
+ if (currentBoundary.sprite) {
2296
+ currentBoundary.image.width = 48;
2297
+ currentBoundary.image.height = 48;
2298
+ currentBoundary.image.Y = Y;
2299
+ Y = currentBoundary.image.Y + currentBoundary.image.height;
2300
+ }
2301
+ let currentBoundaryTextWrap = currentBoundary.wrap && conf.wrap;
2302
+ let currentBoundaryLabelConf = boundaryFont(conf);
2303
+ currentBoundaryLabelConf.fontSize = currentBoundaryLabelConf.fontSize + 2;
2304
+ currentBoundaryLabelConf.fontWeight = "bold";
2305
+ calcC4ShapeTextWH(
2306
+ "label",
2307
+ currentBoundary,
2308
+ currentBoundaryTextWrap,
2309
+ currentBoundaryLabelConf,
2310
+ currentBounds.data.widthLimit
2311
+ );
2312
+ currentBoundary["label"].Y = Y + 8;
2313
+ Y = currentBoundary["label"].Y + currentBoundary["label"].height;
2314
+ if (currentBoundary.type && currentBoundary.type.text !== "") {
2315
+ currentBoundary.type.text = "[" + currentBoundary.type.text + "]";
2316
+ let currentBoundaryTypeConf = boundaryFont(conf);
2317
+ calcC4ShapeTextWH(
2318
+ "type",
2319
+ currentBoundary,
2320
+ currentBoundaryTextWrap,
2321
+ currentBoundaryTypeConf,
2322
+ currentBounds.data.widthLimit
2323
+ );
2324
+ currentBoundary["type"].Y = Y + 5;
2325
+ Y = currentBoundary["type"].Y + currentBoundary["type"].height;
2326
+ }
2327
+ if (currentBoundary.descr && currentBoundary.descr.text !== "") {
2328
+ let currentBoundaryDescrConf = boundaryFont(conf);
2329
+ currentBoundaryDescrConf.fontSize = currentBoundaryDescrConf.fontSize - 2;
2330
+ calcC4ShapeTextWH(
2331
+ "descr",
2332
+ currentBoundary,
2333
+ currentBoundaryTextWrap,
2334
+ currentBoundaryDescrConf,
2335
+ currentBounds.data.widthLimit
2336
+ );
2337
+ currentBoundary["descr"].Y = Y + 20;
2338
+ Y = currentBoundary["descr"].Y + currentBoundary["descr"].height;
2339
+ }
2340
+ if (i == 0 || i % c4BoundaryInRow === 0) {
2341
+ let _x = parentBounds.data.startx + conf.diagramMarginX;
2342
+ let _y = parentBounds.data.stopy + conf.diagramMarginY + Y;
2343
+ currentBounds.setData(_x, _x, _y, _y);
2344
+ } else {
2345
+ let _x = currentBounds.data.stopx !== currentBounds.data.startx ? currentBounds.data.stopx + conf.diagramMarginX : currentBounds.data.startx;
2346
+ let _y = currentBounds.data.starty;
2347
+ currentBounds.setData(_x, _x, _y, _y);
2348
+ }
2349
+ currentBounds.name = currentBoundary.alias;
2350
+ let currentPersonOrSystemArray = diagObj.db.getC4ShapeArray(currentBoundary.alias);
2351
+ let currentPersonOrSystemKeys = diagObj.db.getC4ShapeKeys(currentBoundary.alias);
2352
+ if (currentPersonOrSystemKeys.length > 0) {
2353
+ drawC4ShapeArray(
2354
+ currentBounds,
2355
+ diagram2,
2356
+ currentPersonOrSystemArray,
2357
+ currentPersonOrSystemKeys
2358
+ );
2359
+ }
2360
+ parentBoundaryAlias = currentBoundary.alias;
2361
+ let nextCurrentBoundaries = diagObj.db.getBoundarys(parentBoundaryAlias);
2362
+ if (nextCurrentBoundaries.length > 0) {
2363
+ drawInsideBoundary(
2364
+ diagram2,
2365
+ parentBoundaryAlias,
2366
+ currentBounds,
2367
+ nextCurrentBoundaries,
2368
+ diagObj
2369
+ );
2370
+ }
2371
+ if (currentBoundary.alias !== "global") {
2372
+ drawBoundary(diagram2, currentBoundary, currentBounds);
2373
+ }
2374
+ parentBounds.data.stopy = Math.max(
2375
+ currentBounds.data.stopy + conf.c4ShapeMargin,
2376
+ parentBounds.data.stopy
2377
+ );
2378
+ parentBounds.data.stopx = Math.max(
2379
+ currentBounds.data.stopx + conf.c4ShapeMargin,
2380
+ parentBounds.data.stopx
2381
+ );
2382
+ globalBoundaryMaxX = Math.max(globalBoundaryMaxX, parentBounds.data.stopx);
2383
+ globalBoundaryMaxY = Math.max(globalBoundaryMaxY, parentBounds.data.stopy);
2384
+ }
2385
+ }
2386
+ const draw = function(_text, id, _version, diagObj) {
2387
+ conf = getConfig().c4;
2388
+ const securityLevel = getConfig().securityLevel;
2389
+ let sandboxElement;
2390
+ if (securityLevel === "sandbox") {
2391
+ sandboxElement = d3select("#i" + id);
2392
+ }
2393
+ const root = securityLevel === "sandbox" ? d3select(sandboxElement.nodes()[0].contentDocument.body) : d3select("body");
2394
+ let db2 = diagObj.db;
2395
+ diagObj.db.setWrap(conf.wrap);
2396
+ c4ShapeInRow = db2.getC4ShapeInRow();
2397
+ c4BoundaryInRow = db2.getC4BoundaryInRow();
2398
+ log.debug(`C:${JSON.stringify(conf, null, 2)}`);
2399
+ const diagram2 = securityLevel === "sandbox" ? root.select(`[id="${id}"]`) : d3select(`[id="${id}"]`);
2400
+ svgDraw.insertComputerIcon(diagram2);
2401
+ svgDraw.insertDatabaseIcon(diagram2);
2402
+ svgDraw.insertClockIcon(diagram2);
2403
+ let screenBounds = new Bounds(diagObj);
2404
+ screenBounds.setData(
2405
+ conf.diagramMarginX,
2406
+ conf.diagramMarginX,
2407
+ conf.diagramMarginY,
2408
+ conf.diagramMarginY
2409
+ );
2410
+ screenBounds.data.widthLimit = screen.availWidth;
2411
+ globalBoundaryMaxX = conf.diagramMarginX;
2412
+ globalBoundaryMaxY = conf.diagramMarginY;
2413
+ const title2 = diagObj.db.getTitle();
2414
+ let currentBoundaries = diagObj.db.getBoundarys("");
2415
+ drawInsideBoundary(diagram2, "", screenBounds, currentBoundaries, diagObj);
2416
+ svgDraw.insertArrowHead(diagram2);
2417
+ svgDraw.insertArrowEnd(diagram2);
2418
+ svgDraw.insertArrowCrossHead(diagram2);
2419
+ svgDraw.insertArrowFilledHead(diagram2);
2420
+ drawRels(diagram2, diagObj.db.getRels(), diagObj.db.getC4Shape, diagObj);
2421
+ screenBounds.data.stopx = globalBoundaryMaxX;
2422
+ screenBounds.data.stopy = globalBoundaryMaxY;
2423
+ const box = screenBounds.data;
2424
+ let boxHeight = box.stopy - box.starty;
2425
+ let height = boxHeight + 2 * conf.diagramMarginY;
2426
+ let boxWidth = box.stopx - box.startx;
2427
+ const width = boxWidth + 2 * conf.diagramMarginX;
2428
+ if (title2) {
2429
+ diagram2.append("text").text(title2).attr("x", (box.stopx - box.startx) / 2 - 4 * conf.diagramMarginX).attr("y", box.starty + conf.diagramMarginY);
2430
+ }
2431
+ configureSvgSize(diagram2, height, width, conf.useMaxWidth);
2432
+ const extraVertForTitle = title2 ? 60 : 0;
2433
+ diagram2.attr(
2434
+ "viewBox",
2435
+ box.startx - conf.diagramMarginX + " -" + (conf.diagramMarginY + extraVertForTitle) + " " + width + " " + (height + extraVertForTitle)
2436
+ );
2437
+ log.debug(`models:`, box);
2438
+ };
2439
+ const renderer = {
2440
+ drawPersonOrSystemArray: drawC4ShapeArray,
2441
+ drawBoundary,
2442
+ setConf,
2443
+ draw
2444
+ };
2445
+ const getStyles = (options) => `.person {
2446
+ stroke: ${options.personBorder};
2447
+ fill: ${options.personBkg};
2448
+ }
2449
+ `;
2450
+ const styles = getStyles;
2451
+ const diagram = {
2452
+ parser: parser$1,
2453
+ db,
2454
+ renderer,
2455
+ styles,
2456
+ init: ({ c4, wrap }) => {
2457
+ renderer.setConf(c4);
2458
+ db.setWrap(wrap);
2459
+ }
2460
+ };
2461
+ export {
2462
+ diagram
2463
+ };