@bytechain.cn/colamd 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (157) hide show
  1. package/.github/workflows/release.yml +66 -0
  2. package/.trae/documents/fix-mermaid-colors-and-sankey.md +50 -0
  3. package/CLAUDE.md +87 -0
  4. package/LICENSE +21 -0
  5. package/README.md +540 -0
  6. package/README_CN.md +543 -0
  7. package/demo.md +486 -0
  8. package/dist/main/index.js +735 -0
  9. package/dist/preload/index.js +71 -0
  10. package/dist/renderer/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
  11. package/dist/renderer/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
  12. package/dist/renderer/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
  13. package/dist/renderer/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
  14. package/dist/renderer/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
  15. package/dist/renderer/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
  16. package/dist/renderer/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
  17. package/dist/renderer/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
  18. package/dist/renderer/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
  19. package/dist/renderer/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
  20. package/dist/renderer/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
  21. package/dist/renderer/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
  22. package/dist/renderer/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
  23. package/dist/renderer/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
  24. package/dist/renderer/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
  25. package/dist/renderer/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
  26. package/dist/renderer/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
  27. package/dist/renderer/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
  28. package/dist/renderer/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
  29. package/dist/renderer/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
  30. package/dist/renderer/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
  31. package/dist/renderer/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
  32. package/dist/renderer/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
  33. package/dist/renderer/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
  34. package/dist/renderer/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
  35. package/dist/renderer/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
  36. package/dist/renderer/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
  37. package/dist/renderer/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
  38. package/dist/renderer/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
  39. package/dist/renderer/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
  40. package/dist/renderer/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
  41. package/dist/renderer/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
  42. package/dist/renderer/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
  43. package/dist/renderer/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
  44. package/dist/renderer/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
  45. package/dist/renderer/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
  46. package/dist/renderer/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
  47. package/dist/renderer/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
  48. package/dist/renderer/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
  49. package/dist/renderer/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
  50. package/dist/renderer/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
  51. package/dist/renderer/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
  52. package/dist/renderer/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
  53. package/dist/renderer/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
  54. package/dist/renderer/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
  55. package/dist/renderer/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
  56. package/dist/renderer/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
  57. package/dist/renderer/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
  58. package/dist/renderer/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
  59. package/dist/renderer/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
  60. package/dist/renderer/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
  61. package/dist/renderer/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
  62. package/dist/renderer/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
  63. package/dist/renderer/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
  64. package/dist/renderer/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
  65. package/dist/renderer/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
  66. package/dist/renderer/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
  67. package/dist/renderer/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
  68. package/dist/renderer/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
  69. package/dist/renderer/assets/arc-tTbbM8LO.js +131 -0
  70. package/dist/renderer/assets/architectureDiagram-3BPJPVTR-CEgYow6c.js +8720 -0
  71. package/dist/renderer/assets/blockDiagram-GPEHLZMM-LHyVtPwW.js +3825 -0
  72. package/dist/renderer/assets/c4Diagram-AAUBKEIU-C1P1eJrf.js +2482 -0
  73. package/dist/renderer/assets/channel-upve91Tq.js +7 -0
  74. package/dist/renderer/assets/chunk-2J33WTMH-lag2vhq9.js +24 -0
  75. package/dist/renderer/assets/chunk-4BX2VUAB-BXJ8Ggh-.js +16 -0
  76. package/dist/renderer/assets/chunk-55IACEB6-CiBpxRa1.js +13 -0
  77. package/dist/renderer/assets/chunk-727SXJPM-ODeKQFXC.js +2016 -0
  78. package/dist/renderer/assets/chunk-AQP2D5EJ-BK7xJolB.js +1953 -0
  79. package/dist/renderer/assets/chunk-FMBD7UC4-BxpCZPtz.js +19 -0
  80. package/dist/renderer/assets/chunk-ND2GUHAM-CqqaU9Ue.js +116 -0
  81. package/dist/renderer/assets/chunk-QZHKN3VN-Biq_K124.js +19 -0
  82. package/dist/renderer/assets/classDiagram-4FO5ZUOK-Cq95X99o.js +23 -0
  83. package/dist/renderer/assets/classDiagram-v2-Q7XG4LA2-Cq95X99o.js +23 -0
  84. package/dist/renderer/assets/cose-bilkent-S5V4N54A-XasiD0bu.js +4942 -0
  85. package/dist/renderer/assets/cytoscape.esm-CpHeHM5e.js +30269 -0
  86. package/dist/renderer/assets/dagre-BM42HDAG-Nq84Gfx4.js +705 -0
  87. package/dist/renderer/assets/defaultLocale-B2RvLBDe.js +206 -0
  88. package/dist/renderer/assets/diagram-2AECGRRQ-DwuB1GWt.js +301 -0
  89. package/dist/renderer/assets/diagram-5GNKFQAL-C2tgeI1h.js +169 -0
  90. package/dist/renderer/assets/diagram-KO2AKTUF-D5KzjNBc.js +632 -0
  91. package/dist/renderer/assets/diagram-LMA3HP47-C12xHS1c.js +212 -0
  92. package/dist/renderer/assets/diagram-OG6HWLK6-CnxI9oEa.js +851 -0
  93. package/dist/renderer/assets/erDiagram-TEJ5UH35-D_uPaKwn.js +1227 -0
  94. package/dist/renderer/assets/flowDiagram-I6XJVG4X-B6q_1-tE.js +2332 -0
  95. package/dist/renderer/assets/ganttDiagram-6RSMTGT7-CFo7ifF9.js +3720 -0
  96. package/dist/renderer/assets/gitGraphDiagram-PVQCEYII-WSexHTnq.js +1373 -0
  97. package/dist/renderer/assets/graph-DyX_9f6d.js +1988 -0
  98. package/dist/renderer/assets/index-DW7LS8C1.js +72292 -0
  99. package/dist/renderer/assets/index-dyHEFYvY.css +2184 -0
  100. package/dist/renderer/assets/infoDiagram-5YYISTIA-DaeJdLRq.js +31 -0
  101. package/dist/renderer/assets/init-ZxktEp_H.js +16 -0
  102. package/dist/renderer/assets/ishikawaDiagram-YF4QCWOH-DDCZc35f.js +967 -0
  103. package/dist/renderer/assets/journeyDiagram-JHISSGLW-BEdmpAgl.js +1255 -0
  104. package/dist/renderer/assets/kanban-definition-UN3LZRKU-BEFtQcFb.js +1052 -0
  105. package/dist/renderer/assets/layout-CAJgQHdw.js +2610 -0
  106. package/dist/renderer/assets/linear-B2ggJ8Am.js +340 -0
  107. package/dist/renderer/assets/mindmap-definition-RKZ34NQL-DSxVgHB5.js +1180 -0
  108. package/dist/renderer/assets/ordinal-DSZU4PqD.js +76 -0
  109. package/dist/renderer/assets/pieDiagram-4H26LBE5-CwYoJBuL.js +246 -0
  110. package/dist/renderer/assets/quadrantDiagram-W4KKPZXB-CST9Fvg9.js +1344 -0
  111. package/dist/renderer/assets/requirementDiagram-4Y6WPE33-DtrH52jS.js +1204 -0
  112. package/dist/renderer/assets/sankeyDiagram-5OEKKPKP-ca1tPzJ_.js +1274 -0
  113. package/dist/renderer/assets/sequenceDiagram-3UESZ5HK-Dfp1EJZ7.js +4514 -0
  114. package/dist/renderer/assets/stateDiagram-AJRCARHV-Bha2QoNB.js +450 -0
  115. package/dist/renderer/assets/stateDiagram-v2-BHNVJYJU-DWgFUYu1.js +21 -0
  116. package/dist/renderer/assets/timeline-definition-PNZ67QCA-C3h_-OTj.js +1596 -0
  117. package/dist/renderer/assets/vennDiagram-CIIHVFJN-DFzjSrZi.js +2486 -0
  118. package/dist/renderer/assets/wardley-L42UT6IY-Cx-VbqoS.js +30699 -0
  119. package/dist/renderer/assets/wardleyDiagram-YWT4CUSO-S2D9XqX6.js +975 -0
  120. package/dist/renderer/assets/xychartDiagram-2RQKCTM6-Cfxigbts.js +1932 -0
  121. package/dist/renderer/index.html +19 -0
  122. package/docs/agent-diff-view.md +48 -0
  123. package/electron-builder.yml +57 -0
  124. package/electron.vite.config.ts +30 -0
  125. package/package.json +40 -0
  126. package/resources/entitlements.mac.plist +12 -0
  127. package/resources/icon.icns +0 -0
  128. package/resources/icon.png +0 -0
  129. package/resources/icon.svg +23 -0
  130. package/resources/templates/slides/icon.png +0 -0
  131. package/resources/templates/slides/slides-template.md +74 -0
  132. package/resources/templates/slides/template.html +535 -0
  133. package/scripts/afterPack.js +13 -0
  134. package/src/main/index.ts +881 -0
  135. package/src/preload/index.ts +110 -0
  136. package/src/renderer/editor/editor.ts +204 -0
  137. package/src/renderer/editor/html-view.ts +15 -0
  138. package/src/renderer/editor/plugins/index.ts +76 -0
  139. package/src/renderer/editor/plugins/math-plugin.ts +297 -0
  140. package/src/renderer/editor/plugins/mermaid-plugin-custom.css +431 -0
  141. package/src/renderer/editor/plugins/mermaid-plugin-dark.css +428 -0
  142. package/src/renderer/editor/plugins/mermaid-plugin-elegant.css +443 -0
  143. package/src/renderer/editor/plugins/mermaid-plugin-newsprint.css +208 -0
  144. package/src/renderer/editor/plugins/mermaid-plugin.css +111 -0
  145. package/src/renderer/editor/plugins/mermaid-plugin.ts +679 -0
  146. package/src/renderer/env.d.ts +7 -0
  147. package/src/renderer/index.html +18 -0
  148. package/src/renderer/main.ts +303 -0
  149. package/src/renderer/themes/base.css +509 -0
  150. package/src/renderer/themes/theme-manager.ts +40 -0
  151. package/themes/README.md +280 -0
  152. package/themes/elegant.css +664 -0
  153. package/themes/guizang.css +732 -0
  154. package/tsconfig.json +14 -0
  155. package/tsconfig.main.json +11 -0
  156. package/tsconfig.preload.json +11 -0
  157. package/tsconfig.renderer.json +12 -0
@@ -0,0 +1,2482 @@
1
+ import { g as getNoteRect, d as drawRect } from "./chunk-ND2GUHAM-CqqaU9Ue.js";
2
+ import { s as setAccDescription, g as getAccDescription, a as getAccTitle, b as setAccTitle, _ as __name, c as getConfig2, d as select, l as log, e as configureSvgSize, f as assignWithDepth_default, h as calculateTextWidth, i as sanitizeText, j as distExports, w as wrapLabel, k as common_default, m as calculateTextHeight } from "./index-DW7LS8C1.js";
3
+ var parser = (function() {
4
+ var o = /* @__PURE__ */ __name(function(k, v, o2, l) {
5
+ for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v) ;
6
+ return o2;
7
+ }, "o"), $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];
8
+ var parser2 = {
9
+ trace: /* @__PURE__ */ __name(function trace() {
10
+ }, "trace"),
11
+ yy: {},
12
+ 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 },
13
+ 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" },
14
+ 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]],
15
+ performAction: /* @__PURE__ */ __name(function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) {
16
+ var $0 = $$.length - 1;
17
+ switch (yystate) {
18
+ case 3:
19
+ yy.setDirection("TB");
20
+ break;
21
+ case 4:
22
+ yy.setDirection("BT");
23
+ break;
24
+ case 5:
25
+ yy.setDirection("RL");
26
+ break;
27
+ case 6:
28
+ yy.setDirection("LR");
29
+ break;
30
+ case 8:
31
+ case 9:
32
+ case 10:
33
+ case 11:
34
+ case 12:
35
+ yy.setC4Type($$[$0 - 3]);
36
+ break;
37
+ case 19:
38
+ yy.setTitle($$[$0].substring(6));
39
+ this.$ = $$[$0].substring(6);
40
+ break;
41
+ case 20:
42
+ yy.setAccDescription($$[$0].substring(15));
43
+ this.$ = $$[$0].substring(15);
44
+ break;
45
+ case 21:
46
+ this.$ = $$[$0].trim();
47
+ yy.setTitle(this.$);
48
+ break;
49
+ case 22:
50
+ case 23:
51
+ this.$ = $$[$0].trim();
52
+ yy.setAccDescription(this.$);
53
+ break;
54
+ case 28:
55
+ $$[$0].splice(2, 0, "ENTERPRISE");
56
+ yy.addPersonOrSystemBoundary(...$$[$0]);
57
+ this.$ = $$[$0];
58
+ break;
59
+ case 29:
60
+ $$[$0].splice(2, 0, "SYSTEM");
61
+ yy.addPersonOrSystemBoundary(...$$[$0]);
62
+ this.$ = $$[$0];
63
+ break;
64
+ case 30:
65
+ yy.addPersonOrSystemBoundary(...$$[$0]);
66
+ this.$ = $$[$0];
67
+ break;
68
+ case 31:
69
+ $$[$0].splice(2, 0, "CONTAINER");
70
+ yy.addContainerBoundary(...$$[$0]);
71
+ this.$ = $$[$0];
72
+ break;
73
+ case 32:
74
+ yy.addDeploymentNode("node", ...$$[$0]);
75
+ this.$ = $$[$0];
76
+ break;
77
+ case 33:
78
+ yy.addDeploymentNode("nodeL", ...$$[$0]);
79
+ this.$ = $$[$0];
80
+ break;
81
+ case 34:
82
+ yy.addDeploymentNode("nodeR", ...$$[$0]);
83
+ this.$ = $$[$0];
84
+ break;
85
+ case 35:
86
+ yy.popBoundaryParseStack();
87
+ break;
88
+ case 39:
89
+ yy.addPersonOrSystem("person", ...$$[$0]);
90
+ this.$ = $$[$0];
91
+ break;
92
+ case 40:
93
+ yy.addPersonOrSystem("external_person", ...$$[$0]);
94
+ this.$ = $$[$0];
95
+ break;
96
+ case 41:
97
+ yy.addPersonOrSystem("system", ...$$[$0]);
98
+ this.$ = $$[$0];
99
+ break;
100
+ case 42:
101
+ yy.addPersonOrSystem("system_db", ...$$[$0]);
102
+ this.$ = $$[$0];
103
+ break;
104
+ case 43:
105
+ yy.addPersonOrSystem("system_queue", ...$$[$0]);
106
+ this.$ = $$[$0];
107
+ break;
108
+ case 44:
109
+ yy.addPersonOrSystem("external_system", ...$$[$0]);
110
+ this.$ = $$[$0];
111
+ break;
112
+ case 45:
113
+ yy.addPersonOrSystem("external_system_db", ...$$[$0]);
114
+ this.$ = $$[$0];
115
+ break;
116
+ case 46:
117
+ yy.addPersonOrSystem("external_system_queue", ...$$[$0]);
118
+ this.$ = $$[$0];
119
+ break;
120
+ case 47:
121
+ yy.addContainer("container", ...$$[$0]);
122
+ this.$ = $$[$0];
123
+ break;
124
+ case 48:
125
+ yy.addContainer("container_db", ...$$[$0]);
126
+ this.$ = $$[$0];
127
+ break;
128
+ case 49:
129
+ yy.addContainer("container_queue", ...$$[$0]);
130
+ this.$ = $$[$0];
131
+ break;
132
+ case 50:
133
+ yy.addContainer("external_container", ...$$[$0]);
134
+ this.$ = $$[$0];
135
+ break;
136
+ case 51:
137
+ yy.addContainer("external_container_db", ...$$[$0]);
138
+ this.$ = $$[$0];
139
+ break;
140
+ case 52:
141
+ yy.addContainer("external_container_queue", ...$$[$0]);
142
+ this.$ = $$[$0];
143
+ break;
144
+ case 53:
145
+ yy.addComponent("component", ...$$[$0]);
146
+ this.$ = $$[$0];
147
+ break;
148
+ case 54:
149
+ yy.addComponent("component_db", ...$$[$0]);
150
+ this.$ = $$[$0];
151
+ break;
152
+ case 55:
153
+ yy.addComponent("component_queue", ...$$[$0]);
154
+ this.$ = $$[$0];
155
+ break;
156
+ case 56:
157
+ yy.addComponent("external_component", ...$$[$0]);
158
+ this.$ = $$[$0];
159
+ break;
160
+ case 57:
161
+ yy.addComponent("external_component_db", ...$$[$0]);
162
+ this.$ = $$[$0];
163
+ break;
164
+ case 58:
165
+ yy.addComponent("external_component_queue", ...$$[$0]);
166
+ this.$ = $$[$0];
167
+ break;
168
+ case 60:
169
+ yy.addRel("rel", ...$$[$0]);
170
+ this.$ = $$[$0];
171
+ break;
172
+ case 61:
173
+ yy.addRel("birel", ...$$[$0]);
174
+ this.$ = $$[$0];
175
+ break;
176
+ case 62:
177
+ yy.addRel("rel_u", ...$$[$0]);
178
+ this.$ = $$[$0];
179
+ break;
180
+ case 63:
181
+ yy.addRel("rel_d", ...$$[$0]);
182
+ this.$ = $$[$0];
183
+ break;
184
+ case 64:
185
+ yy.addRel("rel_l", ...$$[$0]);
186
+ this.$ = $$[$0];
187
+ break;
188
+ case 65:
189
+ yy.addRel("rel_r", ...$$[$0]);
190
+ this.$ = $$[$0];
191
+ break;
192
+ case 66:
193
+ yy.addRel("rel_b", ...$$[$0]);
194
+ this.$ = $$[$0];
195
+ break;
196
+ case 67:
197
+ $$[$0].splice(0, 1);
198
+ yy.addRel("rel", ...$$[$0]);
199
+ this.$ = $$[$0];
200
+ break;
201
+ case 68:
202
+ yy.updateElStyle("update_el_style", ...$$[$0]);
203
+ this.$ = $$[$0];
204
+ break;
205
+ case 69:
206
+ yy.updateRelStyle("update_rel_style", ...$$[$0]);
207
+ this.$ = $$[$0];
208
+ break;
209
+ case 70:
210
+ yy.updateLayoutConfig("update_layout_config", ...$$[$0]);
211
+ this.$ = $$[$0];
212
+ break;
213
+ case 71:
214
+ this.$ = [$$[$0]];
215
+ break;
216
+ case 72:
217
+ $$[$0].unshift($$[$0 - 1]);
218
+ this.$ = $$[$0];
219
+ break;
220
+ case 73:
221
+ case 75:
222
+ this.$ = $$[$0].trim();
223
+ break;
224
+ case 74:
225
+ let kv = {};
226
+ kv[$$[$0 - 1].trim()] = $$[$0].trim();
227
+ this.$ = kv;
228
+ break;
229
+ case 76:
230
+ this.$ = "";
231
+ break;
232
+ }
233
+ }, "anonymous"),
234
+ 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])],
235
+ 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] },
236
+ parseError: /* @__PURE__ */ __name(function parseError(str, hash) {
237
+ if (hash.recoverable) {
238
+ this.trace(str);
239
+ } else {
240
+ var error = new Error(str);
241
+ error.hash = hash;
242
+ throw error;
243
+ }
244
+ }, "parseError"),
245
+ parse: /* @__PURE__ */ __name(function parse(input) {
246
+ var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, TERROR = 2, EOF = 1;
247
+ var args = lstack.slice.call(arguments, 1);
248
+ var lexer2 = Object.create(this.lexer);
249
+ var sharedState = { yy: {} };
250
+ for (var k in this.yy) {
251
+ if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
252
+ sharedState.yy[k] = this.yy[k];
253
+ }
254
+ }
255
+ lexer2.setInput(input, sharedState.yy);
256
+ sharedState.yy.lexer = lexer2;
257
+ sharedState.yy.parser = this;
258
+ if (typeof lexer2.yylloc == "undefined") {
259
+ lexer2.yylloc = {};
260
+ }
261
+ var yyloc = lexer2.yylloc;
262
+ lstack.push(yyloc);
263
+ var ranges = lexer2.options && lexer2.options.ranges;
264
+ if (typeof sharedState.yy.parseError === "function") {
265
+ this.parseError = sharedState.yy.parseError;
266
+ } else {
267
+ this.parseError = Object.getPrototypeOf(this).parseError;
268
+ }
269
+ function popStack(n) {
270
+ stack.length = stack.length - 2 * n;
271
+ vstack.length = vstack.length - n;
272
+ lstack.length = lstack.length - n;
273
+ }
274
+ __name(popStack, "popStack");
275
+ function lex() {
276
+ var token;
277
+ token = tstack.pop() || lexer2.lex() || EOF;
278
+ if (typeof token !== "number") {
279
+ if (token instanceof Array) {
280
+ tstack = token;
281
+ token = tstack.pop();
282
+ }
283
+ token = self.symbols_[token] || token;
284
+ }
285
+ return token;
286
+ }
287
+ __name(lex, "lex");
288
+ var symbol, state, action, r, yyval = {}, p, len, newState, expected;
289
+ while (true) {
290
+ state = stack[stack.length - 1];
291
+ if (this.defaultActions[state]) {
292
+ action = this.defaultActions[state];
293
+ } else {
294
+ if (symbol === null || typeof symbol == "undefined") {
295
+ symbol = lex();
296
+ }
297
+ action = table[state] && table[state][symbol];
298
+ }
299
+ if (typeof action === "undefined" || !action.length || !action[0]) {
300
+ var errStr = "";
301
+ expected = [];
302
+ for (p in table[state]) {
303
+ if (this.terminals_[p] && p > TERROR) {
304
+ expected.push("'" + this.terminals_[p] + "'");
305
+ }
306
+ }
307
+ if (lexer2.showPosition) {
308
+ errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer2.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
309
+ } else {
310
+ errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'");
311
+ }
312
+ this.parseError(errStr, {
313
+ text: lexer2.match,
314
+ token: this.terminals_[symbol] || symbol,
315
+ line: lexer2.yylineno,
316
+ loc: yyloc,
317
+ expected
318
+ });
319
+ }
320
+ if (action[0] instanceof Array && action.length > 1) {
321
+ throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
322
+ }
323
+ switch (action[0]) {
324
+ case 1:
325
+ stack.push(symbol);
326
+ vstack.push(lexer2.yytext);
327
+ lstack.push(lexer2.yylloc);
328
+ stack.push(action[1]);
329
+ symbol = null;
330
+ {
331
+ yyleng = lexer2.yyleng;
332
+ yytext = lexer2.yytext;
333
+ yylineno = lexer2.yylineno;
334
+ yyloc = lexer2.yylloc;
335
+ }
336
+ break;
337
+ case 2:
338
+ len = this.productions_[action[1]][1];
339
+ yyval.$ = vstack[vstack.length - len];
340
+ yyval._$ = {
341
+ first_line: lstack[lstack.length - (len || 1)].first_line,
342
+ last_line: lstack[lstack.length - 1].last_line,
343
+ first_column: lstack[lstack.length - (len || 1)].first_column,
344
+ last_column: lstack[lstack.length - 1].last_column
345
+ };
346
+ if (ranges) {
347
+ yyval._$.range = [
348
+ lstack[lstack.length - (len || 1)].range[0],
349
+ lstack[lstack.length - 1].range[1]
350
+ ];
351
+ }
352
+ r = this.performAction.apply(yyval, [
353
+ yytext,
354
+ yyleng,
355
+ yylineno,
356
+ sharedState.yy,
357
+ action[1],
358
+ vstack,
359
+ lstack
360
+ ].concat(args));
361
+ if (typeof r !== "undefined") {
362
+ return r;
363
+ }
364
+ if (len) {
365
+ stack = stack.slice(0, -1 * len * 2);
366
+ vstack = vstack.slice(0, -1 * len);
367
+ lstack = lstack.slice(0, -1 * len);
368
+ }
369
+ stack.push(this.productions_[action[1]][0]);
370
+ vstack.push(yyval.$);
371
+ lstack.push(yyval._$);
372
+ newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
373
+ stack.push(newState);
374
+ break;
375
+ case 3:
376
+ return true;
377
+ }
378
+ }
379
+ return true;
380
+ }, "parse")
381
+ };
382
+ var lexer = /* @__PURE__ */ (function() {
383
+ var lexer2 = {
384
+ EOF: 1,
385
+ parseError: /* @__PURE__ */ __name(function parseError(str, hash) {
386
+ if (this.yy.parser) {
387
+ this.yy.parser.parseError(str, hash);
388
+ } else {
389
+ throw new Error(str);
390
+ }
391
+ }, "parseError"),
392
+ // resets the lexer, sets new input
393
+ setInput: /* @__PURE__ */ __name(function(input, yy) {
394
+ this.yy = yy || this.yy || {};
395
+ this._input = input;
396
+ this._more = this._backtrack = this.done = false;
397
+ this.yylineno = this.yyleng = 0;
398
+ this.yytext = this.matched = this.match = "";
399
+ this.conditionStack = ["INITIAL"];
400
+ this.yylloc = {
401
+ first_line: 1,
402
+ first_column: 0,
403
+ last_line: 1,
404
+ last_column: 0
405
+ };
406
+ if (this.options.ranges) {
407
+ this.yylloc.range = [0, 0];
408
+ }
409
+ this.offset = 0;
410
+ return this;
411
+ }, "setInput"),
412
+ // consumes and returns one char from the input
413
+ input: /* @__PURE__ */ __name(function() {
414
+ var ch = this._input[0];
415
+ this.yytext += ch;
416
+ this.yyleng++;
417
+ this.offset++;
418
+ this.match += ch;
419
+ this.matched += ch;
420
+ var lines = ch.match(/(?:\r\n?|\n).*/g);
421
+ if (lines) {
422
+ this.yylineno++;
423
+ this.yylloc.last_line++;
424
+ } else {
425
+ this.yylloc.last_column++;
426
+ }
427
+ if (this.options.ranges) {
428
+ this.yylloc.range[1]++;
429
+ }
430
+ this._input = this._input.slice(1);
431
+ return ch;
432
+ }, "input"),
433
+ // unshifts one char (or a string) into the input
434
+ unput: /* @__PURE__ */ __name(function(ch) {
435
+ var len = ch.length;
436
+ var lines = ch.split(/(?:\r\n?|\n)/g);
437
+ this._input = ch + this._input;
438
+ this.yytext = this.yytext.substr(0, this.yytext.length - len);
439
+ this.offset -= len;
440
+ var oldLines = this.match.split(/(?:\r\n?|\n)/g);
441
+ this.match = this.match.substr(0, this.match.length - 1);
442
+ this.matched = this.matched.substr(0, this.matched.length - 1);
443
+ if (lines.length - 1) {
444
+ this.yylineno -= lines.length - 1;
445
+ }
446
+ var r = this.yylloc.range;
447
+ this.yylloc = {
448
+ first_line: this.yylloc.first_line,
449
+ last_line: this.yylineno + 1,
450
+ first_column: this.yylloc.first_column,
451
+ 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
452
+ };
453
+ if (this.options.ranges) {
454
+ this.yylloc.range = [r[0], r[0] + this.yyleng - len];
455
+ }
456
+ this.yyleng = this.yytext.length;
457
+ return this;
458
+ }, "unput"),
459
+ // When called from action, caches matched text and appends it on next action
460
+ more: /* @__PURE__ */ __name(function() {
461
+ this._more = true;
462
+ return this;
463
+ }, "more"),
464
+ // 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.
465
+ reject: /* @__PURE__ */ __name(function() {
466
+ if (this.options.backtrack_lexer) {
467
+ this._backtrack = true;
468
+ } else {
469
+ 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(), {
470
+ text: "",
471
+ token: null,
472
+ line: this.yylineno
473
+ });
474
+ }
475
+ return this;
476
+ }, "reject"),
477
+ // retain first n characters of the match
478
+ less: /* @__PURE__ */ __name(function(n) {
479
+ this.unput(this.match.slice(n));
480
+ }, "less"),
481
+ // displays already matched input, i.e. for error messages
482
+ pastInput: /* @__PURE__ */ __name(function() {
483
+ var past = this.matched.substr(0, this.matched.length - this.match.length);
484
+ return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, "");
485
+ }, "pastInput"),
486
+ // displays upcoming input, i.e. for error messages
487
+ upcomingInput: /* @__PURE__ */ __name(function() {
488
+ var next = this.match;
489
+ if (next.length < 20) {
490
+ next += this._input.substr(0, 20 - next.length);
491
+ }
492
+ return (next.substr(0, 20) + (next.length > 20 ? "..." : "")).replace(/\n/g, "");
493
+ }, "upcomingInput"),
494
+ // displays the character position where the lexing error occurred, i.e. for error messages
495
+ showPosition: /* @__PURE__ */ __name(function() {
496
+ var pre = this.pastInput();
497
+ var c2 = new Array(pre.length + 1).join("-");
498
+ return pre + this.upcomingInput() + "\n" + c2 + "^";
499
+ }, "showPosition"),
500
+ // test the lexed token: return FALSE when not a match, otherwise return token
501
+ test_match: /* @__PURE__ */ __name(function(match, indexed_rule) {
502
+ var token, lines, backup;
503
+ if (this.options.backtrack_lexer) {
504
+ backup = {
505
+ yylineno: this.yylineno,
506
+ yylloc: {
507
+ first_line: this.yylloc.first_line,
508
+ last_line: this.last_line,
509
+ first_column: this.yylloc.first_column,
510
+ last_column: this.yylloc.last_column
511
+ },
512
+ yytext: this.yytext,
513
+ match: this.match,
514
+ matches: this.matches,
515
+ matched: this.matched,
516
+ yyleng: this.yyleng,
517
+ offset: this.offset,
518
+ _more: this._more,
519
+ _input: this._input,
520
+ yy: this.yy,
521
+ conditionStack: this.conditionStack.slice(0),
522
+ done: this.done
523
+ };
524
+ if (this.options.ranges) {
525
+ backup.yylloc.range = this.yylloc.range.slice(0);
526
+ }
527
+ }
528
+ lines = match[0].match(/(?:\r\n?|\n).*/g);
529
+ if (lines) {
530
+ this.yylineno += lines.length;
531
+ }
532
+ this.yylloc = {
533
+ first_line: this.yylloc.last_line,
534
+ last_line: this.yylineno + 1,
535
+ first_column: this.yylloc.last_column,
536
+ last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length
537
+ };
538
+ this.yytext += match[0];
539
+ this.match += match[0];
540
+ this.matches = match;
541
+ this.yyleng = this.yytext.length;
542
+ if (this.options.ranges) {
543
+ this.yylloc.range = [this.offset, this.offset += this.yyleng];
544
+ }
545
+ this._more = false;
546
+ this._backtrack = false;
547
+ this._input = this._input.slice(match[0].length);
548
+ this.matched += match[0];
549
+ token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
550
+ if (this.done && this._input) {
551
+ this.done = false;
552
+ }
553
+ if (token) {
554
+ return token;
555
+ } else if (this._backtrack) {
556
+ for (var k in backup) {
557
+ this[k] = backup[k];
558
+ }
559
+ return false;
560
+ }
561
+ return false;
562
+ }, "test_match"),
563
+ // return next match in input
564
+ next: /* @__PURE__ */ __name(function() {
565
+ if (this.done) {
566
+ return this.EOF;
567
+ }
568
+ if (!this._input) {
569
+ this.done = true;
570
+ }
571
+ var token, match, tempMatch, index;
572
+ if (!this._more) {
573
+ this.yytext = "";
574
+ this.match = "";
575
+ }
576
+ var rules = this._currentRules();
577
+ for (var i = 0; i < rules.length; i++) {
578
+ tempMatch = this._input.match(this.rules[rules[i]]);
579
+ if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
580
+ match = tempMatch;
581
+ index = i;
582
+ if (this.options.backtrack_lexer) {
583
+ token = this.test_match(tempMatch, rules[i]);
584
+ if (token !== false) {
585
+ return token;
586
+ } else if (this._backtrack) {
587
+ match = false;
588
+ continue;
589
+ } else {
590
+ return false;
591
+ }
592
+ } else if (!this.options.flex) {
593
+ break;
594
+ }
595
+ }
596
+ }
597
+ if (match) {
598
+ token = this.test_match(match, rules[index]);
599
+ if (token !== false) {
600
+ return token;
601
+ }
602
+ return false;
603
+ }
604
+ if (this._input === "") {
605
+ return this.EOF;
606
+ } else {
607
+ return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), {
608
+ text: "",
609
+ token: null,
610
+ line: this.yylineno
611
+ });
612
+ }
613
+ }, "next"),
614
+ // return next match that has a token
615
+ lex: /* @__PURE__ */ __name(function lex() {
616
+ var r = this.next();
617
+ if (r) {
618
+ return r;
619
+ } else {
620
+ return this.lex();
621
+ }
622
+ }, "lex"),
623
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
624
+ begin: /* @__PURE__ */ __name(function begin(condition) {
625
+ this.conditionStack.push(condition);
626
+ }, "begin"),
627
+ // pop the previously active lexer condition state off the condition stack
628
+ popState: /* @__PURE__ */ __name(function popState() {
629
+ var n = this.conditionStack.length - 1;
630
+ if (n > 0) {
631
+ return this.conditionStack.pop();
632
+ } else {
633
+ return this.conditionStack[0];
634
+ }
635
+ }, "popState"),
636
+ // produce the lexer rule set which is active for the currently active lexer condition state
637
+ _currentRules: /* @__PURE__ */ __name(function _currentRules() {
638
+ if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
639
+ return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
640
+ } else {
641
+ return this.conditions["INITIAL"].rules;
642
+ }
643
+ }, "_currentRules"),
644
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
645
+ topState: /* @__PURE__ */ __name(function topState(n) {
646
+ n = this.conditionStack.length - 1 - Math.abs(n || 0);
647
+ if (n >= 0) {
648
+ return this.conditionStack[n];
649
+ } else {
650
+ return "INITIAL";
651
+ }
652
+ }, "topState"),
653
+ // alias for begin(condition)
654
+ pushState: /* @__PURE__ */ __name(function pushState(condition) {
655
+ this.begin(condition);
656
+ }, "pushState"),
657
+ // return the number of states currently on the stack
658
+ stateStackSize: /* @__PURE__ */ __name(function stateStackSize() {
659
+ return this.conditionStack.length;
660
+ }, "stateStackSize"),
661
+ options: {},
662
+ performAction: /* @__PURE__ */ __name(function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
663
+ switch ($avoiding_name_collisions) {
664
+ case 0:
665
+ return 6;
666
+ case 1:
667
+ return 7;
668
+ case 2:
669
+ return 8;
670
+ case 3:
671
+ return 9;
672
+ case 4:
673
+ return 22;
674
+ case 5:
675
+ return 23;
676
+ case 6:
677
+ this.begin("acc_title");
678
+ return 24;
679
+ case 7:
680
+ this.popState();
681
+ return "acc_title_value";
682
+ case 8:
683
+ this.begin("acc_descr");
684
+ return 26;
685
+ case 9:
686
+ this.popState();
687
+ return "acc_descr_value";
688
+ case 10:
689
+ this.begin("acc_descr_multiline");
690
+ break;
691
+ case 11:
692
+ this.popState();
693
+ break;
694
+ case 12:
695
+ return "acc_descr_multiline_value";
696
+ case 13:
697
+ break;
698
+ case 14:
699
+ c;
700
+ break;
701
+ case 15:
702
+ return 12;
703
+ case 16:
704
+ break;
705
+ case 17:
706
+ return 11;
707
+ case 18:
708
+ return 15;
709
+ case 19:
710
+ return 16;
711
+ case 20:
712
+ return 17;
713
+ case 21:
714
+ return 18;
715
+ case 22:
716
+ this.begin("person_ext");
717
+ return 45;
718
+ case 23:
719
+ this.begin("person");
720
+ return 44;
721
+ case 24:
722
+ this.begin("system_ext_queue");
723
+ return 51;
724
+ case 25:
725
+ this.begin("system_ext_db");
726
+ return 50;
727
+ case 26:
728
+ this.begin("system_ext");
729
+ return 49;
730
+ case 27:
731
+ this.begin("system_queue");
732
+ return 48;
733
+ case 28:
734
+ this.begin("system_db");
735
+ return 47;
736
+ case 29:
737
+ this.begin("system");
738
+ return 46;
739
+ case 30:
740
+ this.begin("boundary");
741
+ return 37;
742
+ case 31:
743
+ this.begin("enterprise_boundary");
744
+ return 34;
745
+ case 32:
746
+ this.begin("system_boundary");
747
+ return 36;
748
+ case 33:
749
+ this.begin("container_ext_queue");
750
+ return 57;
751
+ case 34:
752
+ this.begin("container_ext_db");
753
+ return 56;
754
+ case 35:
755
+ this.begin("container_ext");
756
+ return 55;
757
+ case 36:
758
+ this.begin("container_queue");
759
+ return 54;
760
+ case 37:
761
+ this.begin("container_db");
762
+ return 53;
763
+ case 38:
764
+ this.begin("container");
765
+ return 52;
766
+ case 39:
767
+ this.begin("container_boundary");
768
+ return 38;
769
+ case 40:
770
+ this.begin("component_ext_queue");
771
+ return 63;
772
+ case 41:
773
+ this.begin("component_ext_db");
774
+ return 62;
775
+ case 42:
776
+ this.begin("component_ext");
777
+ return 61;
778
+ case 43:
779
+ this.begin("component_queue");
780
+ return 60;
781
+ case 44:
782
+ this.begin("component_db");
783
+ return 59;
784
+ case 45:
785
+ this.begin("component");
786
+ return 58;
787
+ case 46:
788
+ this.begin("node");
789
+ return 39;
790
+ case 47:
791
+ this.begin("node");
792
+ return 39;
793
+ case 48:
794
+ this.begin("node_l");
795
+ return 40;
796
+ case 49:
797
+ this.begin("node_r");
798
+ return 41;
799
+ case 50:
800
+ this.begin("rel");
801
+ return 64;
802
+ case 51:
803
+ this.begin("birel");
804
+ return 65;
805
+ case 52:
806
+ this.begin("rel_u");
807
+ return 66;
808
+ case 53:
809
+ this.begin("rel_u");
810
+ return 66;
811
+ case 54:
812
+ this.begin("rel_d");
813
+ return 67;
814
+ case 55:
815
+ this.begin("rel_d");
816
+ return 67;
817
+ case 56:
818
+ this.begin("rel_l");
819
+ return 68;
820
+ case 57:
821
+ this.begin("rel_l");
822
+ return 68;
823
+ case 58:
824
+ this.begin("rel_r");
825
+ return 69;
826
+ case 59:
827
+ this.begin("rel_r");
828
+ return 69;
829
+ case 60:
830
+ this.begin("rel_b");
831
+ return 70;
832
+ case 61:
833
+ this.begin("rel_index");
834
+ return 71;
835
+ case 62:
836
+ this.begin("update_el_style");
837
+ return 72;
838
+ case 63:
839
+ this.begin("update_rel_style");
840
+ return 73;
841
+ case 64:
842
+ this.begin("update_layout_config");
843
+ return 74;
844
+ case 65:
845
+ return "EOF_IN_STRUCT";
846
+ case 66:
847
+ this.begin("attribute");
848
+ return "ATTRIBUTE_EMPTY";
849
+ case 67:
850
+ this.begin("attribute");
851
+ break;
852
+ case 68:
853
+ this.popState();
854
+ this.popState();
855
+ break;
856
+ case 69:
857
+ return 80;
858
+ case 70:
859
+ break;
860
+ case 71:
861
+ return 80;
862
+ case 72:
863
+ this.begin("string");
864
+ break;
865
+ case 73:
866
+ this.popState();
867
+ break;
868
+ case 74:
869
+ return "STR";
870
+ case 75:
871
+ this.begin("string_kv");
872
+ break;
873
+ case 76:
874
+ this.begin("string_kv_key");
875
+ return "STR_KEY";
876
+ case 77:
877
+ this.popState();
878
+ this.begin("string_kv_value");
879
+ break;
880
+ case 78:
881
+ return "STR_VALUE";
882
+ case 79:
883
+ this.popState();
884
+ this.popState();
885
+ break;
886
+ case 80:
887
+ return "STR";
888
+ case 81:
889
+ return "LBRACE";
890
+ case 82:
891
+ return "RBRACE";
892
+ case 83:
893
+ return "SPACE";
894
+ case 84:
895
+ return "EOL";
896
+ case 85:
897
+ return 14;
898
+ }
899
+ }, "anonymous"),
900
+ 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]+)/, /^(?:$)/],
901
+ 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": [65, 66, 67, 68], "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 } }
902
+ };
903
+ return lexer2;
904
+ })();
905
+ parser2.lexer = lexer;
906
+ function Parser() {
907
+ this.yy = {};
908
+ }
909
+ __name(Parser, "Parser");
910
+ Parser.prototype = parser2;
911
+ parser2.Parser = Parser;
912
+ return new Parser();
913
+ })();
914
+ parser.parser = parser;
915
+ var c4Diagram_default = parser;
916
+ var c4ShapeArray = [];
917
+ var boundaryParseStack = [""];
918
+ var currentBoundaryParse = "global";
919
+ var parentBoundaryParse = "";
920
+ var boundaries = [
921
+ {
922
+ alias: "global",
923
+ label: { text: "global" },
924
+ type: { text: "global" },
925
+ tags: null,
926
+ link: null,
927
+ parentBoundary: ""
928
+ }
929
+ ];
930
+ var rels = [];
931
+ var title = "";
932
+ var wrapEnabled = false;
933
+ var c4ShapeInRow = 4;
934
+ var c4BoundaryInRow = 2;
935
+ var c4Type;
936
+ var getC4Type = /* @__PURE__ */ __name(function() {
937
+ return c4Type;
938
+ }, "getC4Type");
939
+ var setC4Type = /* @__PURE__ */ __name(function(c4TypeParam) {
940
+ let sanitizedText = sanitizeText(c4TypeParam, getConfig2());
941
+ c4Type = sanitizedText;
942
+ }, "setC4Type");
943
+ var addRel = /* @__PURE__ */ __name(function(type, from, to, label, techn, descr, sprite, tags, link) {
944
+ if (type === void 0 || type === null || from === void 0 || from === null || to === void 0 || to === null || label === void 0 || label === null) {
945
+ return;
946
+ }
947
+ let rel = {};
948
+ const old = rels.find((rel2) => rel2.from === from && rel2.to === to);
949
+ if (old) {
950
+ rel = old;
951
+ } else {
952
+ rels.push(rel);
953
+ }
954
+ rel.type = type;
955
+ rel.from = from;
956
+ rel.to = to;
957
+ rel.label = { text: label };
958
+ if (techn === void 0 || techn === null) {
959
+ rel.techn = { text: "" };
960
+ } else {
961
+ if (typeof techn === "object") {
962
+ let [key, value] = Object.entries(techn)[0];
963
+ rel[key] = { text: value };
964
+ } else {
965
+ rel.techn = { text: techn };
966
+ }
967
+ }
968
+ if (descr === void 0 || descr === null) {
969
+ rel.descr = { text: "" };
970
+ } else {
971
+ if (typeof descr === "object") {
972
+ let [key, value] = Object.entries(descr)[0];
973
+ rel[key] = { text: value };
974
+ } else {
975
+ rel.descr = { text: descr };
976
+ }
977
+ }
978
+ if (typeof sprite === "object") {
979
+ let [key, value] = Object.entries(sprite)[0];
980
+ rel[key] = value;
981
+ } else {
982
+ rel.sprite = sprite;
983
+ }
984
+ if (typeof tags === "object") {
985
+ let [key, value] = Object.entries(tags)[0];
986
+ rel[key] = value;
987
+ } else {
988
+ rel.tags = tags;
989
+ }
990
+ if (typeof link === "object") {
991
+ let [key, value] = Object.entries(link)[0];
992
+ rel[key] = value;
993
+ } else {
994
+ rel.link = link;
995
+ }
996
+ rel.wrap = autoWrap();
997
+ }, "addRel");
998
+ var addPersonOrSystem = /* @__PURE__ */ __name(function(typeC4Shape, alias, label, descr, sprite, tags, link) {
999
+ if (alias === null || label === null) {
1000
+ return;
1001
+ }
1002
+ let personOrSystem = {};
1003
+ const old = c4ShapeArray.find((personOrSystem2) => personOrSystem2.alias === alias);
1004
+ if (old && alias === old.alias) {
1005
+ personOrSystem = old;
1006
+ } else {
1007
+ personOrSystem.alias = alias;
1008
+ c4ShapeArray.push(personOrSystem);
1009
+ }
1010
+ if (label === void 0 || label === null) {
1011
+ personOrSystem.label = { text: "" };
1012
+ } else {
1013
+ personOrSystem.label = { text: label };
1014
+ }
1015
+ if (descr === void 0 || descr === null) {
1016
+ personOrSystem.descr = { text: "" };
1017
+ } else {
1018
+ if (typeof descr === "object") {
1019
+ let [key, value] = Object.entries(descr)[0];
1020
+ personOrSystem[key] = { text: value };
1021
+ } else {
1022
+ personOrSystem.descr = { text: descr };
1023
+ }
1024
+ }
1025
+ if (typeof sprite === "object") {
1026
+ let [key, value] = Object.entries(sprite)[0];
1027
+ personOrSystem[key] = value;
1028
+ } else {
1029
+ personOrSystem.sprite = sprite;
1030
+ }
1031
+ if (typeof tags === "object") {
1032
+ let [key, value] = Object.entries(tags)[0];
1033
+ personOrSystem[key] = value;
1034
+ } else {
1035
+ personOrSystem.tags = tags;
1036
+ }
1037
+ if (typeof link === "object") {
1038
+ let [key, value] = Object.entries(link)[0];
1039
+ personOrSystem[key] = value;
1040
+ } else {
1041
+ personOrSystem.link = link;
1042
+ }
1043
+ personOrSystem.typeC4Shape = { text: typeC4Shape };
1044
+ personOrSystem.parentBoundary = currentBoundaryParse;
1045
+ personOrSystem.wrap = autoWrap();
1046
+ }, "addPersonOrSystem");
1047
+ var addContainer = /* @__PURE__ */ __name(function(typeC4Shape, alias, label, techn, descr, sprite, tags, link) {
1048
+ if (alias === null || label === null) {
1049
+ return;
1050
+ }
1051
+ let container = {};
1052
+ const old = c4ShapeArray.find((container2) => container2.alias === alias);
1053
+ if (old && alias === old.alias) {
1054
+ container = old;
1055
+ } else {
1056
+ container.alias = alias;
1057
+ c4ShapeArray.push(container);
1058
+ }
1059
+ if (label === void 0 || label === null) {
1060
+ container.label = { text: "" };
1061
+ } else {
1062
+ container.label = { text: label };
1063
+ }
1064
+ if (techn === void 0 || techn === null) {
1065
+ container.techn = { text: "" };
1066
+ } else {
1067
+ if (typeof techn === "object") {
1068
+ let [key, value] = Object.entries(techn)[0];
1069
+ container[key] = { text: value };
1070
+ } else {
1071
+ container.techn = { text: techn };
1072
+ }
1073
+ }
1074
+ if (descr === void 0 || descr === null) {
1075
+ container.descr = { text: "" };
1076
+ } else {
1077
+ if (typeof descr === "object") {
1078
+ let [key, value] = Object.entries(descr)[0];
1079
+ container[key] = { text: value };
1080
+ } else {
1081
+ container.descr = { text: descr };
1082
+ }
1083
+ }
1084
+ if (typeof sprite === "object") {
1085
+ let [key, value] = Object.entries(sprite)[0];
1086
+ container[key] = value;
1087
+ } else {
1088
+ container.sprite = sprite;
1089
+ }
1090
+ if (typeof tags === "object") {
1091
+ let [key, value] = Object.entries(tags)[0];
1092
+ container[key] = value;
1093
+ } else {
1094
+ container.tags = tags;
1095
+ }
1096
+ if (typeof link === "object") {
1097
+ let [key, value] = Object.entries(link)[0];
1098
+ container[key] = value;
1099
+ } else {
1100
+ container.link = link;
1101
+ }
1102
+ container.wrap = autoWrap();
1103
+ container.typeC4Shape = { text: typeC4Shape };
1104
+ container.parentBoundary = currentBoundaryParse;
1105
+ }, "addContainer");
1106
+ var addComponent = /* @__PURE__ */ __name(function(typeC4Shape, alias, label, techn, descr, sprite, tags, link) {
1107
+ if (alias === null || label === null) {
1108
+ return;
1109
+ }
1110
+ let component = {};
1111
+ const old = c4ShapeArray.find((component2) => component2.alias === alias);
1112
+ if (old && alias === old.alias) {
1113
+ component = old;
1114
+ } else {
1115
+ component.alias = alias;
1116
+ c4ShapeArray.push(component);
1117
+ }
1118
+ if (label === void 0 || label === null) {
1119
+ component.label = { text: "" };
1120
+ } else {
1121
+ component.label = { text: label };
1122
+ }
1123
+ if (techn === void 0 || techn === null) {
1124
+ component.techn = { text: "" };
1125
+ } else {
1126
+ if (typeof techn === "object") {
1127
+ let [key, value] = Object.entries(techn)[0];
1128
+ component[key] = { text: value };
1129
+ } else {
1130
+ component.techn = { text: techn };
1131
+ }
1132
+ }
1133
+ if (descr === void 0 || descr === null) {
1134
+ component.descr = { text: "" };
1135
+ } else {
1136
+ if (typeof descr === "object") {
1137
+ let [key, value] = Object.entries(descr)[0];
1138
+ component[key] = { text: value };
1139
+ } else {
1140
+ component.descr = { text: descr };
1141
+ }
1142
+ }
1143
+ if (typeof sprite === "object") {
1144
+ let [key, value] = Object.entries(sprite)[0];
1145
+ component[key] = value;
1146
+ } else {
1147
+ component.sprite = sprite;
1148
+ }
1149
+ if (typeof tags === "object") {
1150
+ let [key, value] = Object.entries(tags)[0];
1151
+ component[key] = value;
1152
+ } else {
1153
+ component.tags = tags;
1154
+ }
1155
+ if (typeof link === "object") {
1156
+ let [key, value] = Object.entries(link)[0];
1157
+ component[key] = value;
1158
+ } else {
1159
+ component.link = link;
1160
+ }
1161
+ component.wrap = autoWrap();
1162
+ component.typeC4Shape = { text: typeC4Shape };
1163
+ component.parentBoundary = currentBoundaryParse;
1164
+ }, "addComponent");
1165
+ var addPersonOrSystemBoundary = /* @__PURE__ */ __name(function(alias, label, type, tags, link) {
1166
+ if (alias === null || label === null) {
1167
+ return;
1168
+ }
1169
+ let boundary = {};
1170
+ const old = boundaries.find((boundary2) => boundary2.alias === alias);
1171
+ if (old && alias === old.alias) {
1172
+ boundary = old;
1173
+ } else {
1174
+ boundary.alias = alias;
1175
+ boundaries.push(boundary);
1176
+ }
1177
+ if (label === void 0 || label === null) {
1178
+ boundary.label = { text: "" };
1179
+ } else {
1180
+ boundary.label = { text: label };
1181
+ }
1182
+ if (type === void 0 || type === null) {
1183
+ boundary.type = { text: "system" };
1184
+ } else {
1185
+ if (typeof type === "object") {
1186
+ let [key, value] = Object.entries(type)[0];
1187
+ boundary[key] = { text: value };
1188
+ } else {
1189
+ boundary.type = { text: type };
1190
+ }
1191
+ }
1192
+ if (typeof tags === "object") {
1193
+ let [key, value] = Object.entries(tags)[0];
1194
+ boundary[key] = value;
1195
+ } else {
1196
+ boundary.tags = tags;
1197
+ }
1198
+ if (typeof link === "object") {
1199
+ let [key, value] = Object.entries(link)[0];
1200
+ boundary[key] = value;
1201
+ } else {
1202
+ boundary.link = link;
1203
+ }
1204
+ boundary.parentBoundary = currentBoundaryParse;
1205
+ boundary.wrap = autoWrap();
1206
+ parentBoundaryParse = currentBoundaryParse;
1207
+ currentBoundaryParse = alias;
1208
+ boundaryParseStack.push(parentBoundaryParse);
1209
+ }, "addPersonOrSystemBoundary");
1210
+ var addContainerBoundary = /* @__PURE__ */ __name(function(alias, label, type, tags, link) {
1211
+ if (alias === null || label === null) {
1212
+ return;
1213
+ }
1214
+ let boundary = {};
1215
+ const old = boundaries.find((boundary2) => boundary2.alias === alias);
1216
+ if (old && alias === old.alias) {
1217
+ boundary = old;
1218
+ } else {
1219
+ boundary.alias = alias;
1220
+ boundaries.push(boundary);
1221
+ }
1222
+ if (label === void 0 || label === null) {
1223
+ boundary.label = { text: "" };
1224
+ } else {
1225
+ boundary.label = { text: label };
1226
+ }
1227
+ if (type === void 0 || type === null) {
1228
+ boundary.type = { text: "container" };
1229
+ } else {
1230
+ if (typeof type === "object") {
1231
+ let [key, value] = Object.entries(type)[0];
1232
+ boundary[key] = { text: value };
1233
+ } else {
1234
+ boundary.type = { text: type };
1235
+ }
1236
+ }
1237
+ if (typeof tags === "object") {
1238
+ let [key, value] = Object.entries(tags)[0];
1239
+ boundary[key] = value;
1240
+ } else {
1241
+ boundary.tags = tags;
1242
+ }
1243
+ if (typeof link === "object") {
1244
+ let [key, value] = Object.entries(link)[0];
1245
+ boundary[key] = value;
1246
+ } else {
1247
+ boundary.link = link;
1248
+ }
1249
+ boundary.parentBoundary = currentBoundaryParse;
1250
+ boundary.wrap = autoWrap();
1251
+ parentBoundaryParse = currentBoundaryParse;
1252
+ currentBoundaryParse = alias;
1253
+ boundaryParseStack.push(parentBoundaryParse);
1254
+ }, "addContainerBoundary");
1255
+ var addDeploymentNode = /* @__PURE__ */ __name(function(nodeType, alias, label, type, descr, sprite, tags, link) {
1256
+ if (alias === null || label === null) {
1257
+ return;
1258
+ }
1259
+ let boundary = {};
1260
+ const old = boundaries.find((boundary2) => boundary2.alias === alias);
1261
+ if (old && alias === old.alias) {
1262
+ boundary = old;
1263
+ } else {
1264
+ boundary.alias = alias;
1265
+ boundaries.push(boundary);
1266
+ }
1267
+ if (label === void 0 || label === null) {
1268
+ boundary.label = { text: "" };
1269
+ } else {
1270
+ boundary.label = { text: label };
1271
+ }
1272
+ if (type === void 0 || type === null) {
1273
+ boundary.type = { text: "node" };
1274
+ } else {
1275
+ if (typeof type === "object") {
1276
+ let [key, value] = Object.entries(type)[0];
1277
+ boundary[key] = { text: value };
1278
+ } else {
1279
+ boundary.type = { text: type };
1280
+ }
1281
+ }
1282
+ if (descr === void 0 || descr === null) {
1283
+ boundary.descr = { text: "" };
1284
+ } else {
1285
+ if (typeof descr === "object") {
1286
+ let [key, value] = Object.entries(descr)[0];
1287
+ boundary[key] = { text: value };
1288
+ } else {
1289
+ boundary.descr = { text: descr };
1290
+ }
1291
+ }
1292
+ if (typeof tags === "object") {
1293
+ let [key, value] = Object.entries(tags)[0];
1294
+ boundary[key] = value;
1295
+ } else {
1296
+ boundary.tags = tags;
1297
+ }
1298
+ if (typeof link === "object") {
1299
+ let [key, value] = Object.entries(link)[0];
1300
+ boundary[key] = value;
1301
+ } else {
1302
+ boundary.link = link;
1303
+ }
1304
+ boundary.nodeType = nodeType;
1305
+ boundary.parentBoundary = currentBoundaryParse;
1306
+ boundary.wrap = autoWrap();
1307
+ parentBoundaryParse = currentBoundaryParse;
1308
+ currentBoundaryParse = alias;
1309
+ boundaryParseStack.push(parentBoundaryParse);
1310
+ }, "addDeploymentNode");
1311
+ var popBoundaryParseStack = /* @__PURE__ */ __name(function() {
1312
+ currentBoundaryParse = parentBoundaryParse;
1313
+ boundaryParseStack.pop();
1314
+ parentBoundaryParse = boundaryParseStack.pop();
1315
+ boundaryParseStack.push(parentBoundaryParse);
1316
+ }, "popBoundaryParseStack");
1317
+ var updateElStyle = /* @__PURE__ */ __name(function(typeC4Shape, elementName, bgColor, fontColor, borderColor, shadowing, shape, sprite, techn, legendText, legendSprite) {
1318
+ let old = c4ShapeArray.find((element) => element.alias === elementName);
1319
+ if (old === void 0) {
1320
+ old = boundaries.find((element) => element.alias === elementName);
1321
+ if (old === void 0) {
1322
+ return;
1323
+ }
1324
+ }
1325
+ if (bgColor !== void 0 && bgColor !== null) {
1326
+ if (typeof bgColor === "object") {
1327
+ let [key, value] = Object.entries(bgColor)[0];
1328
+ old[key] = value;
1329
+ } else {
1330
+ old.bgColor = bgColor;
1331
+ }
1332
+ }
1333
+ if (fontColor !== void 0 && fontColor !== null) {
1334
+ if (typeof fontColor === "object") {
1335
+ let [key, value] = Object.entries(fontColor)[0];
1336
+ old[key] = value;
1337
+ } else {
1338
+ old.fontColor = fontColor;
1339
+ }
1340
+ }
1341
+ if (borderColor !== void 0 && borderColor !== null) {
1342
+ if (typeof borderColor === "object") {
1343
+ let [key, value] = Object.entries(borderColor)[0];
1344
+ old[key] = value;
1345
+ } else {
1346
+ old.borderColor = borderColor;
1347
+ }
1348
+ }
1349
+ if (shadowing !== void 0 && shadowing !== null) {
1350
+ if (typeof shadowing === "object") {
1351
+ let [key, value] = Object.entries(shadowing)[0];
1352
+ old[key] = value;
1353
+ } else {
1354
+ old.shadowing = shadowing;
1355
+ }
1356
+ }
1357
+ if (shape !== void 0 && shape !== null) {
1358
+ if (typeof shape === "object") {
1359
+ let [key, value] = Object.entries(shape)[0];
1360
+ old[key] = value;
1361
+ } else {
1362
+ old.shape = shape;
1363
+ }
1364
+ }
1365
+ if (sprite !== void 0 && sprite !== null) {
1366
+ if (typeof sprite === "object") {
1367
+ let [key, value] = Object.entries(sprite)[0];
1368
+ old[key] = value;
1369
+ } else {
1370
+ old.sprite = sprite;
1371
+ }
1372
+ }
1373
+ if (techn !== void 0 && techn !== null) {
1374
+ if (typeof techn === "object") {
1375
+ let [key, value] = Object.entries(techn)[0];
1376
+ old[key] = value;
1377
+ } else {
1378
+ old.techn = techn;
1379
+ }
1380
+ }
1381
+ if (legendText !== void 0 && legendText !== null) {
1382
+ if (typeof legendText === "object") {
1383
+ let [key, value] = Object.entries(legendText)[0];
1384
+ old[key] = value;
1385
+ } else {
1386
+ old.legendText = legendText;
1387
+ }
1388
+ }
1389
+ if (legendSprite !== void 0 && legendSprite !== null) {
1390
+ if (typeof legendSprite === "object") {
1391
+ let [key, value] = Object.entries(legendSprite)[0];
1392
+ old[key] = value;
1393
+ } else {
1394
+ old.legendSprite = legendSprite;
1395
+ }
1396
+ }
1397
+ }, "updateElStyle");
1398
+ var updateRelStyle = /* @__PURE__ */ __name(function(typeC4Shape, from, to, textColor, lineColor, offsetX, offsetY) {
1399
+ const old = rels.find((rel) => rel.from === from && rel.to === to);
1400
+ if (old === void 0) {
1401
+ return;
1402
+ }
1403
+ if (textColor !== void 0 && textColor !== null) {
1404
+ if (typeof textColor === "object") {
1405
+ let [key, value] = Object.entries(textColor)[0];
1406
+ old[key] = value;
1407
+ } else {
1408
+ old.textColor = textColor;
1409
+ }
1410
+ }
1411
+ if (lineColor !== void 0 && lineColor !== null) {
1412
+ if (typeof lineColor === "object") {
1413
+ let [key, value] = Object.entries(lineColor)[0];
1414
+ old[key] = value;
1415
+ } else {
1416
+ old.lineColor = lineColor;
1417
+ }
1418
+ }
1419
+ if (offsetX !== void 0 && offsetX !== null) {
1420
+ if (typeof offsetX === "object") {
1421
+ let [key, value] = Object.entries(offsetX)[0];
1422
+ old[key] = parseInt(value);
1423
+ } else {
1424
+ old.offsetX = parseInt(offsetX);
1425
+ }
1426
+ }
1427
+ if (offsetY !== void 0 && offsetY !== null) {
1428
+ if (typeof offsetY === "object") {
1429
+ let [key, value] = Object.entries(offsetY)[0];
1430
+ old[key] = parseInt(value);
1431
+ } else {
1432
+ old.offsetY = parseInt(offsetY);
1433
+ }
1434
+ }
1435
+ }, "updateRelStyle");
1436
+ var updateLayoutConfig = /* @__PURE__ */ __name(function(typeC4Shape, c4ShapeInRowParam, c4BoundaryInRowParam) {
1437
+ let c4ShapeInRowValue = c4ShapeInRow;
1438
+ let c4BoundaryInRowValue = c4BoundaryInRow;
1439
+ if (typeof c4ShapeInRowParam === "object") {
1440
+ const value = Object.values(c4ShapeInRowParam)[0];
1441
+ c4ShapeInRowValue = parseInt(value);
1442
+ } else {
1443
+ c4ShapeInRowValue = parseInt(c4ShapeInRowParam);
1444
+ }
1445
+ if (typeof c4BoundaryInRowParam === "object") {
1446
+ const value = Object.values(c4BoundaryInRowParam)[0];
1447
+ c4BoundaryInRowValue = parseInt(value);
1448
+ } else {
1449
+ c4BoundaryInRowValue = parseInt(c4BoundaryInRowParam);
1450
+ }
1451
+ if (c4ShapeInRowValue >= 1) {
1452
+ c4ShapeInRow = c4ShapeInRowValue;
1453
+ }
1454
+ if (c4BoundaryInRowValue >= 1) {
1455
+ c4BoundaryInRow = c4BoundaryInRowValue;
1456
+ }
1457
+ }, "updateLayoutConfig");
1458
+ var getC4ShapeInRow = /* @__PURE__ */ __name(function() {
1459
+ return c4ShapeInRow;
1460
+ }, "getC4ShapeInRow");
1461
+ var getC4BoundaryInRow = /* @__PURE__ */ __name(function() {
1462
+ return c4BoundaryInRow;
1463
+ }, "getC4BoundaryInRow");
1464
+ var getCurrentBoundaryParse = /* @__PURE__ */ __name(function() {
1465
+ return currentBoundaryParse;
1466
+ }, "getCurrentBoundaryParse");
1467
+ var getParentBoundaryParse = /* @__PURE__ */ __name(function() {
1468
+ return parentBoundaryParse;
1469
+ }, "getParentBoundaryParse");
1470
+ var getC4ShapeArray = /* @__PURE__ */ __name(function(parentBoundary) {
1471
+ if (parentBoundary === void 0 || parentBoundary === null) {
1472
+ return c4ShapeArray;
1473
+ } else {
1474
+ return c4ShapeArray.filter((personOrSystem) => {
1475
+ return personOrSystem.parentBoundary === parentBoundary;
1476
+ });
1477
+ }
1478
+ }, "getC4ShapeArray");
1479
+ var getC4Shape = /* @__PURE__ */ __name(function(alias) {
1480
+ return c4ShapeArray.find((personOrSystem) => personOrSystem.alias === alias);
1481
+ }, "getC4Shape");
1482
+ var getC4ShapeKeys = /* @__PURE__ */ __name(function(parentBoundary) {
1483
+ return Object.keys(getC4ShapeArray(parentBoundary));
1484
+ }, "getC4ShapeKeys");
1485
+ var getBoundaries = /* @__PURE__ */ __name(function(parentBoundary) {
1486
+ if (parentBoundary === void 0 || parentBoundary === null) {
1487
+ return boundaries;
1488
+ } else {
1489
+ return boundaries.filter((boundary) => boundary.parentBoundary === parentBoundary);
1490
+ }
1491
+ }, "getBoundaries");
1492
+ var getBoundarys = getBoundaries;
1493
+ var getRels = /* @__PURE__ */ __name(function() {
1494
+ return rels;
1495
+ }, "getRels");
1496
+ var getTitle = /* @__PURE__ */ __name(function() {
1497
+ return title;
1498
+ }, "getTitle");
1499
+ var setWrap = /* @__PURE__ */ __name(function(wrapSetting) {
1500
+ wrapEnabled = wrapSetting;
1501
+ }, "setWrap");
1502
+ var autoWrap = /* @__PURE__ */ __name(function() {
1503
+ return wrapEnabled;
1504
+ }, "autoWrap");
1505
+ var clear = /* @__PURE__ */ __name(function() {
1506
+ c4ShapeArray = [];
1507
+ boundaries = [
1508
+ {
1509
+ alias: "global",
1510
+ label: { text: "global" },
1511
+ type: { text: "global" },
1512
+ tags: null,
1513
+ link: null,
1514
+ parentBoundary: ""
1515
+ }
1516
+ ];
1517
+ parentBoundaryParse = "";
1518
+ currentBoundaryParse = "global";
1519
+ boundaryParseStack = [""];
1520
+ rels = [];
1521
+ boundaryParseStack = [""];
1522
+ title = "";
1523
+ wrapEnabled = false;
1524
+ c4ShapeInRow = 4;
1525
+ c4BoundaryInRow = 2;
1526
+ }, "clear");
1527
+ var LINETYPE = {
1528
+ SOLID: 0,
1529
+ DOTTED: 1,
1530
+ NOTE: 2,
1531
+ SOLID_CROSS: 3,
1532
+ DOTTED_CROSS: 4,
1533
+ SOLID_OPEN: 5,
1534
+ DOTTED_OPEN: 6,
1535
+ LOOP_START: 10,
1536
+ LOOP_END: 11,
1537
+ ALT_START: 12,
1538
+ ALT_ELSE: 13,
1539
+ ALT_END: 14,
1540
+ OPT_START: 15,
1541
+ OPT_END: 16,
1542
+ ACTIVE_START: 17,
1543
+ ACTIVE_END: 18,
1544
+ PAR_START: 19,
1545
+ PAR_AND: 20,
1546
+ PAR_END: 21,
1547
+ RECT_START: 22,
1548
+ RECT_END: 23,
1549
+ SOLID_POINT: 24,
1550
+ DOTTED_POINT: 25
1551
+ };
1552
+ var ARROWTYPE = {
1553
+ FILLED: 0,
1554
+ OPEN: 1
1555
+ };
1556
+ var PLACEMENT = {
1557
+ LEFTOF: 0,
1558
+ RIGHTOF: 1,
1559
+ OVER: 2
1560
+ };
1561
+ var setTitle = /* @__PURE__ */ __name(function(txt) {
1562
+ let sanitizedText = sanitizeText(txt, getConfig2());
1563
+ title = sanitizedText;
1564
+ }, "setTitle");
1565
+ var c4Db_default = {
1566
+ addPersonOrSystem,
1567
+ addPersonOrSystemBoundary,
1568
+ addContainer,
1569
+ addContainerBoundary,
1570
+ addComponent,
1571
+ addDeploymentNode,
1572
+ popBoundaryParseStack,
1573
+ addRel,
1574
+ updateElStyle,
1575
+ updateRelStyle,
1576
+ updateLayoutConfig,
1577
+ autoWrap,
1578
+ setWrap,
1579
+ getC4ShapeArray,
1580
+ getC4Shape,
1581
+ getC4ShapeKeys,
1582
+ getBoundaries,
1583
+ getBoundarys,
1584
+ getCurrentBoundaryParse,
1585
+ getParentBoundaryParse,
1586
+ getRels,
1587
+ getTitle,
1588
+ getC4Type,
1589
+ getC4ShapeInRow,
1590
+ getC4BoundaryInRow,
1591
+ setAccTitle,
1592
+ getAccTitle,
1593
+ getAccDescription,
1594
+ setAccDescription,
1595
+ getConfig: /* @__PURE__ */ __name(() => getConfig2().c4, "getConfig"),
1596
+ clear,
1597
+ LINETYPE,
1598
+ ARROWTYPE,
1599
+ PLACEMENT,
1600
+ setTitle,
1601
+ setC4Type
1602
+ // apply,
1603
+ };
1604
+ var drawRect2 = /* @__PURE__ */ __name(function(elem, rectData) {
1605
+ return drawRect(elem, rectData);
1606
+ }, "drawRect");
1607
+ var drawImage = /* @__PURE__ */ __name(function(elem, width, height, x, y, link) {
1608
+ const imageElem = elem.append("image");
1609
+ imageElem.attr("width", width);
1610
+ imageElem.attr("height", height);
1611
+ imageElem.attr("x", x);
1612
+ imageElem.attr("y", y);
1613
+ let sanitizedLink = link.startsWith("data:image/png;base64") ? link : distExports.sanitizeUrl(link);
1614
+ imageElem.attr("xlink:href", sanitizedLink);
1615
+ }, "drawImage");
1616
+ var drawRels = /* @__PURE__ */ __name((elem, rels2, conf2, diagramId) => {
1617
+ const relsElem = elem.append("g");
1618
+ let i = 0;
1619
+ for (let rel of rels2) {
1620
+ let textColor = rel.textColor ? rel.textColor : "#444444";
1621
+ let strokeColor = rel.lineColor ? rel.lineColor : "#444444";
1622
+ let offsetX = rel.offsetX ? parseInt(rel.offsetX) : 0;
1623
+ let offsetY = rel.offsetY ? parseInt(rel.offsetY) : 0;
1624
+ let url = "";
1625
+ if (i === 0) {
1626
+ let line = relsElem.append("line");
1627
+ line.attr("x1", rel.startPoint.x);
1628
+ line.attr("y1", rel.startPoint.y);
1629
+ line.attr("x2", rel.endPoint.x);
1630
+ line.attr("y2", rel.endPoint.y);
1631
+ line.attr("stroke-width", "1");
1632
+ line.attr("stroke", strokeColor);
1633
+ line.style("fill", "none");
1634
+ if (rel.type !== "rel_b") {
1635
+ line.attr("marker-end", "url(" + url + "#" + diagramId + "-arrowhead)");
1636
+ }
1637
+ if (rel.type === "birel" || rel.type === "rel_b") {
1638
+ line.attr("marker-start", "url(" + url + "#" + diagramId + "-arrowend)");
1639
+ }
1640
+ i = -1;
1641
+ } else {
1642
+ let line = relsElem.append("path");
1643
+ line.attr("fill", "none").attr("stroke-width", "1").attr("stroke", strokeColor).attr(
1644
+ "d",
1645
+ "Mstartx,starty Qcontrolx,controly stopx,stopy ".replaceAll("startx", rel.startPoint.x).replaceAll("starty", rel.startPoint.y).replaceAll(
1646
+ "controlx",
1647
+ rel.startPoint.x + (rel.endPoint.x - rel.startPoint.x) / 2 - (rel.endPoint.x - rel.startPoint.x) / 4
1648
+ ).replaceAll("controly", rel.startPoint.y + (rel.endPoint.y - rel.startPoint.y) / 2).replaceAll("stopx", rel.endPoint.x).replaceAll("stopy", rel.endPoint.y)
1649
+ );
1650
+ if (rel.type !== "rel_b") {
1651
+ line.attr("marker-end", "url(" + url + "#" + diagramId + "-arrowhead)");
1652
+ }
1653
+ if (rel.type === "birel" || rel.type === "rel_b") {
1654
+ line.attr("marker-start", "url(" + url + "#" + diagramId + "-arrowend)");
1655
+ }
1656
+ }
1657
+ let messageConf = conf2.messageFont();
1658
+ _drawTextCandidateFunc(conf2)(
1659
+ rel.label.text,
1660
+ relsElem,
1661
+ Math.min(rel.startPoint.x, rel.endPoint.x) + Math.abs(rel.endPoint.x - rel.startPoint.x) / 2 + offsetX,
1662
+ Math.min(rel.startPoint.y, rel.endPoint.y) + Math.abs(rel.endPoint.y - rel.startPoint.y) / 2 + offsetY,
1663
+ rel.label.width,
1664
+ rel.label.height,
1665
+ { fill: textColor },
1666
+ messageConf
1667
+ );
1668
+ if (rel.techn && rel.techn.text !== "") {
1669
+ messageConf = conf2.messageFont();
1670
+ _drawTextCandidateFunc(conf2)(
1671
+ "[" + rel.techn.text + "]",
1672
+ relsElem,
1673
+ Math.min(rel.startPoint.x, rel.endPoint.x) + Math.abs(rel.endPoint.x - rel.startPoint.x) / 2 + offsetX,
1674
+ Math.min(rel.startPoint.y, rel.endPoint.y) + Math.abs(rel.endPoint.y - rel.startPoint.y) / 2 + conf2.messageFontSize + 5 + offsetY,
1675
+ Math.max(rel.label.width, rel.techn.width),
1676
+ rel.techn.height,
1677
+ { fill: textColor, "font-style": "italic" },
1678
+ messageConf
1679
+ );
1680
+ }
1681
+ }
1682
+ }, "drawRels");
1683
+ var drawBoundary = /* @__PURE__ */ __name(function(elem, boundary, conf2) {
1684
+ const boundaryElem = elem.append("g");
1685
+ let fillColor = boundary.bgColor ? boundary.bgColor : "none";
1686
+ let strokeColor = boundary.borderColor ? boundary.borderColor : "#444444";
1687
+ let fontColor = boundary.fontColor ? boundary.fontColor : "black";
1688
+ let attrsValue = { "stroke-width": 1, "stroke-dasharray": "7.0,7.0" };
1689
+ if (boundary.nodeType) {
1690
+ attrsValue = { "stroke-width": 1 };
1691
+ }
1692
+ let rectData = {
1693
+ x: boundary.x,
1694
+ y: boundary.y,
1695
+ fill: fillColor,
1696
+ stroke: strokeColor,
1697
+ width: boundary.width,
1698
+ height: boundary.height,
1699
+ rx: 2.5,
1700
+ ry: 2.5,
1701
+ attrs: attrsValue
1702
+ };
1703
+ drawRect2(boundaryElem, rectData);
1704
+ let boundaryConf = conf2.boundaryFont();
1705
+ boundaryConf.fontWeight = "bold";
1706
+ boundaryConf.fontSize = boundaryConf.fontSize + 2;
1707
+ boundaryConf.fontColor = fontColor;
1708
+ _drawTextCandidateFunc(conf2)(
1709
+ boundary.label.text,
1710
+ boundaryElem,
1711
+ boundary.x,
1712
+ boundary.y + boundary.label.Y,
1713
+ boundary.width,
1714
+ boundary.height,
1715
+ { fill: "#444444" },
1716
+ boundaryConf
1717
+ );
1718
+ if (boundary.type && boundary.type.text !== "") {
1719
+ boundaryConf = conf2.boundaryFont();
1720
+ boundaryConf.fontColor = fontColor;
1721
+ _drawTextCandidateFunc(conf2)(
1722
+ boundary.type.text,
1723
+ boundaryElem,
1724
+ boundary.x,
1725
+ boundary.y + boundary.type.Y,
1726
+ boundary.width,
1727
+ boundary.height,
1728
+ { fill: "#444444" },
1729
+ boundaryConf
1730
+ );
1731
+ }
1732
+ if (boundary.descr && boundary.descr.text !== "") {
1733
+ boundaryConf = conf2.boundaryFont();
1734
+ boundaryConf.fontSize = boundaryConf.fontSize - 2;
1735
+ boundaryConf.fontColor = fontColor;
1736
+ _drawTextCandidateFunc(conf2)(
1737
+ boundary.descr.text,
1738
+ boundaryElem,
1739
+ boundary.x,
1740
+ boundary.y + boundary.descr.Y,
1741
+ boundary.width,
1742
+ boundary.height,
1743
+ { fill: "#444444" },
1744
+ boundaryConf
1745
+ );
1746
+ }
1747
+ }, "drawBoundary");
1748
+ var drawC4Shape = /* @__PURE__ */ __name(function(elem, c4Shape, conf2) {
1749
+ let fillColor = c4Shape.bgColor ? c4Shape.bgColor : conf2[c4Shape.typeC4Shape.text + "_bg_color"];
1750
+ let strokeColor = c4Shape.borderColor ? c4Shape.borderColor : conf2[c4Shape.typeC4Shape.text + "_border_color"];
1751
+ let fontColor = c4Shape.fontColor ? c4Shape.fontColor : "#FFFFFF";
1752
+ let personImg = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";
1753
+ switch (c4Shape.typeC4Shape.text) {
1754
+ case "person":
1755
+ personImg = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";
1756
+ break;
1757
+ case "external_person":
1758
+ personImg = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAAB6ElEQVR4Xu2YLY+EMBCG9+dWr0aj0Wg0Go1Go0+j8Xdv2uTCvv1gpt0ebHKPuhDaeW4605Z9mJvx4AdXUyTUdd08z+u6flmWZRnHsWkafk9DptAwDPu+f0eAYtu2PEaGWuj5fCIZrBAC2eLBAnRCsEkkxmeaJp7iDJ2QMDdHsLg8SxKFEJaAo8lAXnmuOFIhTMpxxKATebo4UiFknuNo4OniSIXQyRxEA3YsnjGCVEjVXD7yLUAqxBGUyPv/Y4W2beMgGuS7kVQIBycH0fD+oi5pezQETxdHKmQKGk1eQEYldK+jw5GxPfZ9z7Mk0Qnhf1W1m3w//EUn5BDmSZsbR44QQLBEqrBHqOrmSKaQAxdnLArCrxZcM7A7ZKs4ioRq8LFC+NpC3WCBJsvpVw5edm9iEXFuyNfxXAgSwfrFQ1c0iNda8AdejvUgnktOtJQQxmcfFzGglc5WVCj7oDgFqU18boeFSs52CUh8LE8BIVQDT1ABrB0HtgSEYlX5doJnCwv9TXocKCaKbnwhdDKPq4lf3SwU3HLq4V/+WYhHVMa/3b4IlfyikAduCkcBc7mQ3/z/Qq/cTuikhkzB12Ae/mcJC9U+Vo8Ej1gWAtgbeGgFsAMHr50BIWOLCbezvhpBFUdY6EJuJ/QDW0XoMX60zZ0AAAAASUVORK5CYII=";
1759
+ break;
1760
+ }
1761
+ const c4ShapeElem = elem.append("g");
1762
+ c4ShapeElem.attr("class", "person-man");
1763
+ const rect = getNoteRect();
1764
+ switch (c4Shape.typeC4Shape.text) {
1765
+ case "person":
1766
+ case "external_person":
1767
+ case "system":
1768
+ case "external_system":
1769
+ case "container":
1770
+ case "external_container":
1771
+ case "component":
1772
+ case "external_component":
1773
+ rect.x = c4Shape.x;
1774
+ rect.y = c4Shape.y;
1775
+ rect.fill = fillColor;
1776
+ rect.width = c4Shape.width;
1777
+ rect.height = c4Shape.height;
1778
+ rect.stroke = strokeColor;
1779
+ rect.rx = 2.5;
1780
+ rect.ry = 2.5;
1781
+ rect.attrs = { "stroke-width": 0.5 };
1782
+ drawRect2(c4ShapeElem, rect);
1783
+ break;
1784
+ case "system_db":
1785
+ case "external_system_db":
1786
+ case "container_db":
1787
+ case "external_container_db":
1788
+ case "component_db":
1789
+ case "external_component_db":
1790
+ c4ShapeElem.append("path").attr("fill", fillColor).attr("stroke-width", "0.5").attr("stroke", strokeColor).attr(
1791
+ "d",
1792
+ "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)
1793
+ );
1794
+ c4ShapeElem.append("path").attr("fill", "none").attr("stroke-width", "0.5").attr("stroke", strokeColor).attr(
1795
+ "d",
1796
+ "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)
1797
+ );
1798
+ break;
1799
+ case "system_queue":
1800
+ case "external_system_queue":
1801
+ case "container_queue":
1802
+ case "external_container_queue":
1803
+ case "component_queue":
1804
+ case "external_component_queue":
1805
+ c4ShapeElem.append("path").attr("fill", fillColor).attr("stroke-width", "0.5").attr("stroke", strokeColor).attr(
1806
+ "d",
1807
+ "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)
1808
+ );
1809
+ c4ShapeElem.append("path").attr("fill", "none").attr("stroke-width", "0.5").attr("stroke", strokeColor).attr(
1810
+ "d",
1811
+ "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)
1812
+ );
1813
+ break;
1814
+ }
1815
+ let c4ShapeFontConf = getC4ShapeFont(conf2, c4Shape.typeC4Shape.text);
1816
+ 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 + ">>");
1817
+ switch (c4Shape.typeC4Shape.text) {
1818
+ case "person":
1819
+ case "external_person":
1820
+ drawImage(
1821
+ c4ShapeElem,
1822
+ 48,
1823
+ 48,
1824
+ c4Shape.x + c4Shape.width / 2 - 24,
1825
+ c4Shape.y + c4Shape.image.Y,
1826
+ personImg
1827
+ );
1828
+ break;
1829
+ }
1830
+ let textFontConf = conf2[c4Shape.typeC4Shape.text + "Font"]();
1831
+ textFontConf.fontWeight = "bold";
1832
+ textFontConf.fontSize = textFontConf.fontSize + 2;
1833
+ textFontConf.fontColor = fontColor;
1834
+ _drawTextCandidateFunc(conf2)(
1835
+ c4Shape.label.text,
1836
+ c4ShapeElem,
1837
+ c4Shape.x,
1838
+ c4Shape.y + c4Shape.label.Y,
1839
+ c4Shape.width,
1840
+ c4Shape.height,
1841
+ { fill: fontColor },
1842
+ textFontConf
1843
+ );
1844
+ textFontConf = conf2[c4Shape.typeC4Shape.text + "Font"]();
1845
+ textFontConf.fontColor = fontColor;
1846
+ if (c4Shape.techn && c4Shape.techn?.text !== "") {
1847
+ _drawTextCandidateFunc(conf2)(
1848
+ c4Shape.techn.text,
1849
+ c4ShapeElem,
1850
+ c4Shape.x,
1851
+ c4Shape.y + c4Shape.techn.Y,
1852
+ c4Shape.width,
1853
+ c4Shape.height,
1854
+ { fill: fontColor, "font-style": "italic" },
1855
+ textFontConf
1856
+ );
1857
+ } else if (c4Shape.type && c4Shape.type.text !== "") {
1858
+ _drawTextCandidateFunc(conf2)(
1859
+ c4Shape.type.text,
1860
+ c4ShapeElem,
1861
+ c4Shape.x,
1862
+ c4Shape.y + c4Shape.type.Y,
1863
+ c4Shape.width,
1864
+ c4Shape.height,
1865
+ { fill: fontColor, "font-style": "italic" },
1866
+ textFontConf
1867
+ );
1868
+ }
1869
+ if (c4Shape.descr && c4Shape.descr.text !== "") {
1870
+ textFontConf = conf2.personFont();
1871
+ textFontConf.fontColor = fontColor;
1872
+ _drawTextCandidateFunc(conf2)(
1873
+ c4Shape.descr.text,
1874
+ c4ShapeElem,
1875
+ c4Shape.x,
1876
+ c4Shape.y + c4Shape.descr.Y,
1877
+ c4Shape.width,
1878
+ c4Shape.height,
1879
+ { fill: fontColor },
1880
+ textFontConf
1881
+ );
1882
+ }
1883
+ return c4Shape.height;
1884
+ }, "drawC4Shape");
1885
+ var insertDatabaseIcon = /* @__PURE__ */ __name(function(elem, id) {
1886
+ elem.append("defs").append("symbol").attr("id", id + "-database").attr("fill-rule", "evenodd").attr("clip-rule", "evenodd").append("path").attr("transform", "scale(.5)").attr(
1887
+ "d",
1888
+ "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"
1889
+ );
1890
+ }, "insertDatabaseIcon");
1891
+ var insertComputerIcon = /* @__PURE__ */ __name(function(elem, id) {
1892
+ elem.append("defs").append("symbol").attr("id", id + "-computer").attr("width", "24").attr("height", "24").append("path").attr("transform", "scale(.5)").attr(
1893
+ "d",
1894
+ "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"
1895
+ );
1896
+ }, "insertComputerIcon");
1897
+ var insertClockIcon = /* @__PURE__ */ __name(function(elem, id) {
1898
+ elem.append("defs").append("symbol").attr("id", id + "-clock").attr("width", "24").attr("height", "24").append("path").attr("transform", "scale(.5)").attr(
1899
+ "d",
1900
+ "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"
1901
+ );
1902
+ }, "insertClockIcon");
1903
+ var insertArrowHead = /* @__PURE__ */ __name(function(elem, id) {
1904
+ elem.append("defs").append("marker").attr("id", 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");
1905
+ }, "insertArrowHead");
1906
+ var insertArrowEnd = /* @__PURE__ */ __name(function(elem, id) {
1907
+ elem.append("defs").append("marker").attr("id", 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");
1908
+ }, "insertArrowEnd");
1909
+ var insertArrowFilledHead = /* @__PURE__ */ __name(function(elem, id) {
1910
+ elem.append("defs").append("marker").attr("id", 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");
1911
+ }, "insertArrowFilledHead");
1912
+ var insertArrowCrossHead = /* @__PURE__ */ __name(function(elem, id) {
1913
+ const defs = elem.append("defs");
1914
+ const marker = defs.append("marker").attr("id", id + "-crosshead").attr("markerWidth", 15).attr("markerHeight", 8).attr("orient", "auto").attr("refX", 16).attr("refY", 4);
1915
+ 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");
1916
+ 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");
1917
+ }, "insertArrowCrossHead");
1918
+ var getC4ShapeFont = /* @__PURE__ */ __name((cnf, typeC4Shape) => {
1919
+ return {
1920
+ fontFamily: cnf[typeC4Shape + "FontFamily"],
1921
+ fontSize: cnf[typeC4Shape + "FontSize"],
1922
+ fontWeight: cnf[typeC4Shape + "FontWeight"]
1923
+ };
1924
+ }, "getC4ShapeFont");
1925
+ var _drawTextCandidateFunc = /* @__PURE__ */ (function() {
1926
+ function byText(content, g, x, y, width, height, textAttrs) {
1927
+ const text = g.append("text").attr("x", x + width / 2).attr("y", y + height / 2 + 5).style("text-anchor", "middle").text(content);
1928
+ _setTextAttrs(text, textAttrs);
1929
+ }
1930
+ __name(byText, "byText");
1931
+ function byTspan(content, g, x, y, width, height, textAttrs, conf2) {
1932
+ const { fontSize, fontFamily, fontWeight } = conf2;
1933
+ const lines = content.split(common_default.lineBreakRegex);
1934
+ for (let i = 0; i < lines.length; i++) {
1935
+ const dy = i * fontSize - fontSize * (lines.length - 1) / 2;
1936
+ 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);
1937
+ text.append("tspan").attr("dy", dy).text(lines[i]).attr("alignment-baseline", "mathematical");
1938
+ _setTextAttrs(text, textAttrs);
1939
+ }
1940
+ }
1941
+ __name(byTspan, "byTspan");
1942
+ function byFo(content, g, x, y, width, height, textAttrs, conf2) {
1943
+ const s = g.append("switch");
1944
+ const f = s.append("foreignObject").attr("x", x).attr("y", y).attr("width", width).attr("height", height);
1945
+ const text = f.append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
1946
+ text.append("div").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(content);
1947
+ byTspan(content, s, x, y, width, height, textAttrs, conf2);
1948
+ _setTextAttrs(text, textAttrs);
1949
+ }
1950
+ __name(byFo, "byFo");
1951
+ function _setTextAttrs(toText, fromTextAttrsDict) {
1952
+ for (const key in fromTextAttrsDict) {
1953
+ if (fromTextAttrsDict.hasOwnProperty(key)) {
1954
+ toText.attr(key, fromTextAttrsDict[key]);
1955
+ }
1956
+ }
1957
+ }
1958
+ __name(_setTextAttrs, "_setTextAttrs");
1959
+ return function(conf2) {
1960
+ return conf2.textPlacement === "fo" ? byFo : conf2.textPlacement === "old" ? byText : byTspan;
1961
+ };
1962
+ })();
1963
+ var svgDraw_default = {
1964
+ drawRect: drawRect2,
1965
+ drawBoundary,
1966
+ drawC4Shape,
1967
+ drawRels,
1968
+ drawImage,
1969
+ insertArrowHead,
1970
+ insertArrowEnd,
1971
+ insertArrowFilledHead,
1972
+ insertArrowCrossHead,
1973
+ insertDatabaseIcon,
1974
+ insertComputerIcon,
1975
+ insertClockIcon
1976
+ };
1977
+ var globalBoundaryMaxX = 0;
1978
+ var globalBoundaryMaxY = 0;
1979
+ var c4ShapeInRow2 = 4;
1980
+ var c4BoundaryInRow2 = 2;
1981
+ parser.yy = c4Db_default;
1982
+ var conf = {};
1983
+ var Bounds = class {
1984
+ static {
1985
+ __name(this, "Bounds");
1986
+ }
1987
+ constructor(diagObj) {
1988
+ this.name = "";
1989
+ this.data = {};
1990
+ this.data.startx = void 0;
1991
+ this.data.stopx = void 0;
1992
+ this.data.starty = void 0;
1993
+ this.data.stopy = void 0;
1994
+ this.data.widthLimit = void 0;
1995
+ this.nextData = {};
1996
+ this.nextData.startx = void 0;
1997
+ this.nextData.stopx = void 0;
1998
+ this.nextData.starty = void 0;
1999
+ this.nextData.stopy = void 0;
2000
+ this.nextData.cnt = 0;
2001
+ setConf(diagObj.db.getConfig());
2002
+ }
2003
+ setData(startx, stopx, starty, stopy) {
2004
+ this.nextData.startx = this.data.startx = startx;
2005
+ this.nextData.stopx = this.data.stopx = stopx;
2006
+ this.nextData.starty = this.data.starty = starty;
2007
+ this.nextData.stopy = this.data.stopy = stopy;
2008
+ }
2009
+ updateVal(obj, key, val, fun) {
2010
+ if (obj[key] === void 0) {
2011
+ obj[key] = val;
2012
+ } else {
2013
+ obj[key] = fun(val, obj[key]);
2014
+ }
2015
+ }
2016
+ insert(c4Shape) {
2017
+ this.nextData.cnt = this.nextData.cnt + 1;
2018
+ let _startx = this.nextData.startx === this.nextData.stopx ? this.nextData.stopx + c4Shape.margin : this.nextData.stopx + c4Shape.margin * 2;
2019
+ let _stopx = _startx + c4Shape.width;
2020
+ let _starty = this.nextData.starty + c4Shape.margin * 2;
2021
+ let _stopy = _starty + c4Shape.height;
2022
+ if (_startx >= this.data.widthLimit || _stopx >= this.data.widthLimit || this.nextData.cnt > c4ShapeInRow2) {
2023
+ _startx = this.nextData.startx + c4Shape.margin + conf.nextLinePaddingX;
2024
+ _starty = this.nextData.stopy + c4Shape.margin * 2;
2025
+ this.nextData.stopx = _stopx = _startx + c4Shape.width;
2026
+ this.nextData.starty = this.nextData.stopy;
2027
+ this.nextData.stopy = _stopy = _starty + c4Shape.height;
2028
+ this.nextData.cnt = 1;
2029
+ }
2030
+ c4Shape.x = _startx;
2031
+ c4Shape.y = _starty;
2032
+ this.updateVal(this.data, "startx", _startx, Math.min);
2033
+ this.updateVal(this.data, "starty", _starty, Math.min);
2034
+ this.updateVal(this.data, "stopx", _stopx, Math.max);
2035
+ this.updateVal(this.data, "stopy", _stopy, Math.max);
2036
+ this.updateVal(this.nextData, "startx", _startx, Math.min);
2037
+ this.updateVal(this.nextData, "starty", _starty, Math.min);
2038
+ this.updateVal(this.nextData, "stopx", _stopx, Math.max);
2039
+ this.updateVal(this.nextData, "stopy", _stopy, Math.max);
2040
+ }
2041
+ init(diagObj) {
2042
+ this.name = "";
2043
+ this.data = {
2044
+ startx: void 0,
2045
+ stopx: void 0,
2046
+ starty: void 0,
2047
+ stopy: void 0,
2048
+ widthLimit: void 0
2049
+ };
2050
+ this.nextData = {
2051
+ startx: void 0,
2052
+ stopx: void 0,
2053
+ starty: void 0,
2054
+ stopy: void 0,
2055
+ cnt: 0
2056
+ };
2057
+ setConf(diagObj.db.getConfig());
2058
+ }
2059
+ bumpLastMargin(margin) {
2060
+ this.data.stopx += margin;
2061
+ this.data.stopy += margin;
2062
+ }
2063
+ };
2064
+ var setConf = /* @__PURE__ */ __name(function(cnf) {
2065
+ assignWithDepth_default(conf, cnf);
2066
+ if (cnf.fontFamily) {
2067
+ conf.personFontFamily = conf.systemFontFamily = conf.messageFontFamily = cnf.fontFamily;
2068
+ }
2069
+ if (cnf.fontSize) {
2070
+ conf.personFontSize = conf.systemFontSize = conf.messageFontSize = cnf.fontSize;
2071
+ }
2072
+ if (cnf.fontWeight) {
2073
+ conf.personFontWeight = conf.systemFontWeight = conf.messageFontWeight = cnf.fontWeight;
2074
+ }
2075
+ }, "setConf");
2076
+ var c4ShapeFont = /* @__PURE__ */ __name((cnf, typeC4Shape) => {
2077
+ return {
2078
+ fontFamily: cnf[typeC4Shape + "FontFamily"],
2079
+ fontSize: cnf[typeC4Shape + "FontSize"],
2080
+ fontWeight: cnf[typeC4Shape + "FontWeight"]
2081
+ };
2082
+ }, "c4ShapeFont");
2083
+ var boundaryFont = /* @__PURE__ */ __name((cnf) => {
2084
+ return {
2085
+ fontFamily: cnf.boundaryFontFamily,
2086
+ fontSize: cnf.boundaryFontSize,
2087
+ fontWeight: cnf.boundaryFontWeight
2088
+ };
2089
+ }, "boundaryFont");
2090
+ var messageFont = /* @__PURE__ */ __name((cnf) => {
2091
+ return {
2092
+ fontFamily: cnf.messageFontFamily,
2093
+ fontSize: cnf.messageFontSize,
2094
+ fontWeight: cnf.messageFontWeight
2095
+ };
2096
+ }, "messageFont");
2097
+ function calcC4ShapeTextWH(textType, c4Shape, c4ShapeTextWrap, textConf, textLimitWidth) {
2098
+ if (!c4Shape[textType].width) {
2099
+ if (c4ShapeTextWrap) {
2100
+ c4Shape[textType].text = wrapLabel(c4Shape[textType].text, textLimitWidth, textConf);
2101
+ c4Shape[textType].textLines = c4Shape[textType].text.split(common_default.lineBreakRegex).length;
2102
+ c4Shape[textType].width = textLimitWidth;
2103
+ c4Shape[textType].height = calculateTextHeight(c4Shape[textType].text, textConf);
2104
+ } else {
2105
+ let lines = c4Shape[textType].text.split(common_default.lineBreakRegex);
2106
+ c4Shape[textType].textLines = lines.length;
2107
+ let lineHeight = 0;
2108
+ c4Shape[textType].height = 0;
2109
+ c4Shape[textType].width = 0;
2110
+ for (const line of lines) {
2111
+ c4Shape[textType].width = Math.max(
2112
+ calculateTextWidth(line, textConf),
2113
+ c4Shape[textType].width
2114
+ );
2115
+ lineHeight = calculateTextHeight(line, textConf);
2116
+ c4Shape[textType].height = c4Shape[textType].height + lineHeight;
2117
+ }
2118
+ }
2119
+ }
2120
+ }
2121
+ __name(calcC4ShapeTextWH, "calcC4ShapeTextWH");
2122
+ var drawBoundary2 = /* @__PURE__ */ __name(function(diagram2, boundary, bounds) {
2123
+ boundary.x = bounds.data.startx;
2124
+ boundary.y = bounds.data.starty;
2125
+ boundary.width = bounds.data.stopx - bounds.data.startx;
2126
+ boundary.height = bounds.data.stopy - bounds.data.starty;
2127
+ boundary.label.y = conf.c4ShapeMargin - 35;
2128
+ let boundaryTextWrap = boundary.wrap && conf.wrap;
2129
+ let boundaryLabelConf = boundaryFont(conf);
2130
+ boundaryLabelConf.fontSize = boundaryLabelConf.fontSize + 2;
2131
+ boundaryLabelConf.fontWeight = "bold";
2132
+ let textLimitWidth = calculateTextWidth(boundary.label.text, boundaryLabelConf);
2133
+ calcC4ShapeTextWH("label", boundary, boundaryTextWrap, boundaryLabelConf, textLimitWidth);
2134
+ svgDraw_default.drawBoundary(diagram2, boundary, conf);
2135
+ }, "drawBoundary");
2136
+ var drawC4ShapeArray = /* @__PURE__ */ __name(function(currentBounds, diagram2, c4ShapeArray2, c4ShapeKeys) {
2137
+ let Y = 0;
2138
+ for (const c4ShapeKey of c4ShapeKeys) {
2139
+ Y = 0;
2140
+ const c4Shape = c4ShapeArray2[c4ShapeKey];
2141
+ let c4ShapeTypeConf = c4ShapeFont(conf, c4Shape.typeC4Shape.text);
2142
+ c4ShapeTypeConf.fontSize = c4ShapeTypeConf.fontSize - 2;
2143
+ c4Shape.typeC4Shape.width = calculateTextWidth(
2144
+ "«" + c4Shape.typeC4Shape.text + "»",
2145
+ c4ShapeTypeConf
2146
+ );
2147
+ c4Shape.typeC4Shape.height = c4ShapeTypeConf.fontSize + 2;
2148
+ c4Shape.typeC4Shape.Y = conf.c4ShapePadding;
2149
+ Y = c4Shape.typeC4Shape.Y + c4Shape.typeC4Shape.height - 4;
2150
+ c4Shape.image = { width: 0, height: 0, Y: 0 };
2151
+ switch (c4Shape.typeC4Shape.text) {
2152
+ case "person":
2153
+ case "external_person":
2154
+ c4Shape.image.width = 48;
2155
+ c4Shape.image.height = 48;
2156
+ c4Shape.image.Y = Y;
2157
+ Y = c4Shape.image.Y + c4Shape.image.height;
2158
+ break;
2159
+ }
2160
+ if (c4Shape.sprite) {
2161
+ c4Shape.image.width = 48;
2162
+ c4Shape.image.height = 48;
2163
+ c4Shape.image.Y = Y;
2164
+ Y = c4Shape.image.Y + c4Shape.image.height;
2165
+ }
2166
+ let c4ShapeTextWrap = c4Shape.wrap && conf.wrap;
2167
+ let textLimitWidth = conf.width - conf.c4ShapePadding * 2;
2168
+ let c4ShapeLabelConf = c4ShapeFont(conf, c4Shape.typeC4Shape.text);
2169
+ c4ShapeLabelConf.fontSize = c4ShapeLabelConf.fontSize + 2;
2170
+ c4ShapeLabelConf.fontWeight = "bold";
2171
+ calcC4ShapeTextWH("label", c4Shape, c4ShapeTextWrap, c4ShapeLabelConf, textLimitWidth);
2172
+ c4Shape.label.Y = Y + 8;
2173
+ Y = c4Shape.label.Y + c4Shape.label.height;
2174
+ if (c4Shape.type && c4Shape.type.text !== "") {
2175
+ c4Shape.type.text = "[" + c4Shape.type.text + "]";
2176
+ let c4ShapeTypeConf2 = c4ShapeFont(conf, c4Shape.typeC4Shape.text);
2177
+ calcC4ShapeTextWH("type", c4Shape, c4ShapeTextWrap, c4ShapeTypeConf2, textLimitWidth);
2178
+ c4Shape.type.Y = Y + 5;
2179
+ Y = c4Shape.type.Y + c4Shape.type.height;
2180
+ } else if (c4Shape.techn && c4Shape.techn.text !== "") {
2181
+ c4Shape.techn.text = "[" + c4Shape.techn.text + "]";
2182
+ let c4ShapeTechnConf = c4ShapeFont(conf, c4Shape.techn.text);
2183
+ calcC4ShapeTextWH("techn", c4Shape, c4ShapeTextWrap, c4ShapeTechnConf, textLimitWidth);
2184
+ c4Shape.techn.Y = Y + 5;
2185
+ Y = c4Shape.techn.Y + c4Shape.techn.height;
2186
+ }
2187
+ let rectHeight = Y;
2188
+ let rectWidth = c4Shape.label.width;
2189
+ if (c4Shape.descr && c4Shape.descr.text !== "") {
2190
+ let c4ShapeDescrConf = c4ShapeFont(conf, c4Shape.typeC4Shape.text);
2191
+ calcC4ShapeTextWH("descr", c4Shape, c4ShapeTextWrap, c4ShapeDescrConf, textLimitWidth);
2192
+ c4Shape.descr.Y = Y + 20;
2193
+ Y = c4Shape.descr.Y + c4Shape.descr.height;
2194
+ rectWidth = Math.max(c4Shape.label.width, c4Shape.descr.width);
2195
+ rectHeight = Y - c4Shape.descr.textLines * 5;
2196
+ }
2197
+ rectWidth = rectWidth + conf.c4ShapePadding;
2198
+ c4Shape.width = Math.max(c4Shape.width || conf.width, rectWidth, conf.width);
2199
+ c4Shape.height = Math.max(c4Shape.height || conf.height, rectHeight, conf.height);
2200
+ c4Shape.margin = c4Shape.margin || conf.c4ShapeMargin;
2201
+ currentBounds.insert(c4Shape);
2202
+ svgDraw_default.drawC4Shape(diagram2, c4Shape, conf);
2203
+ }
2204
+ currentBounds.bumpLastMargin(conf.c4ShapeMargin);
2205
+ }, "drawC4ShapeArray");
2206
+ var Point = class {
2207
+ static {
2208
+ __name(this, "Point");
2209
+ }
2210
+ constructor(x, y) {
2211
+ this.x = x;
2212
+ this.y = y;
2213
+ }
2214
+ };
2215
+ var getIntersectPoint = /* @__PURE__ */ __name(function(fromNode, endPoint) {
2216
+ let x1 = fromNode.x;
2217
+ let y1 = fromNode.y;
2218
+ let x2 = endPoint.x;
2219
+ let y2 = endPoint.y;
2220
+ let fromCenterX = x1 + fromNode.width / 2;
2221
+ let fromCenterY = y1 + fromNode.height / 2;
2222
+ let dx = Math.abs(x1 - x2);
2223
+ let dy = Math.abs(y1 - y2);
2224
+ let tanDYX = dy / dx;
2225
+ let fromDYX = fromNode.height / fromNode.width;
2226
+ let returnPoint = null;
2227
+ if (y1 == y2 && x1 < x2) {
2228
+ returnPoint = new Point(x1 + fromNode.width, fromCenterY);
2229
+ } else if (y1 == y2 && x1 > x2) {
2230
+ returnPoint = new Point(x1, fromCenterY);
2231
+ } else if (x1 == x2 && y1 < y2) {
2232
+ returnPoint = new Point(fromCenterX, y1 + fromNode.height);
2233
+ } else if (x1 == x2 && y1 > y2) {
2234
+ returnPoint = new Point(fromCenterX, y1);
2235
+ }
2236
+ if (x1 > x2 && y1 < y2) {
2237
+ if (fromDYX >= tanDYX) {
2238
+ returnPoint = new Point(x1, fromCenterY + tanDYX * fromNode.width / 2);
2239
+ } else {
2240
+ returnPoint = new Point(
2241
+ fromCenterX - dx / dy * fromNode.height / 2,
2242
+ y1 + fromNode.height
2243
+ );
2244
+ }
2245
+ } else if (x1 < x2 && y1 < y2) {
2246
+ if (fromDYX >= tanDYX) {
2247
+ returnPoint = new Point(x1 + fromNode.width, fromCenterY + tanDYX * fromNode.width / 2);
2248
+ } else {
2249
+ returnPoint = new Point(
2250
+ fromCenterX + dx / dy * fromNode.height / 2,
2251
+ y1 + fromNode.height
2252
+ );
2253
+ }
2254
+ } else if (x1 < x2 && y1 > y2) {
2255
+ if (fromDYX >= tanDYX) {
2256
+ returnPoint = new Point(x1 + fromNode.width, fromCenterY - tanDYX * fromNode.width / 2);
2257
+ } else {
2258
+ returnPoint = new Point(fromCenterX + fromNode.height / 2 * dx / dy, y1);
2259
+ }
2260
+ } else if (x1 > x2 && y1 > y2) {
2261
+ if (fromDYX >= tanDYX) {
2262
+ returnPoint = new Point(x1, fromCenterY - fromNode.width / 2 * tanDYX);
2263
+ } else {
2264
+ returnPoint = new Point(fromCenterX - fromNode.height / 2 * dx / dy, y1);
2265
+ }
2266
+ }
2267
+ return returnPoint;
2268
+ }, "getIntersectPoint");
2269
+ var getIntersectPoints = /* @__PURE__ */ __name(function(fromNode, endNode) {
2270
+ let endIntersectPoint = { x: 0, y: 0 };
2271
+ endIntersectPoint.x = endNode.x + endNode.width / 2;
2272
+ endIntersectPoint.y = endNode.y + endNode.height / 2;
2273
+ let startPoint = getIntersectPoint(fromNode, endIntersectPoint);
2274
+ endIntersectPoint.x = fromNode.x + fromNode.width / 2;
2275
+ endIntersectPoint.y = fromNode.y + fromNode.height / 2;
2276
+ let endPoint = getIntersectPoint(endNode, endIntersectPoint);
2277
+ return { startPoint, endPoint };
2278
+ }, "getIntersectPoints");
2279
+ var drawRels2 = /* @__PURE__ */ __name(function(diagram2, rels2, getC4ShapeObj, diagObj, diagramId) {
2280
+ let i = 0;
2281
+ for (let rel of rels2) {
2282
+ i = i + 1;
2283
+ let relTextWrap = rel.wrap && conf.wrap;
2284
+ let relConf = messageFont(conf);
2285
+ let diagramType = diagObj.db.getC4Type();
2286
+ if (diagramType === "C4Dynamic") {
2287
+ rel.label.text = i + ": " + rel.label.text;
2288
+ }
2289
+ let textLimitWidth = calculateTextWidth(rel.label.text, relConf);
2290
+ calcC4ShapeTextWH("label", rel, relTextWrap, relConf, textLimitWidth);
2291
+ if (rel.techn && rel.techn.text !== "") {
2292
+ textLimitWidth = calculateTextWidth(rel.techn.text, relConf);
2293
+ calcC4ShapeTextWH("techn", rel, relTextWrap, relConf, textLimitWidth);
2294
+ }
2295
+ if (rel.descr && rel.descr.text !== "") {
2296
+ textLimitWidth = calculateTextWidth(rel.descr.text, relConf);
2297
+ calcC4ShapeTextWH("descr", rel, relTextWrap, relConf, textLimitWidth);
2298
+ }
2299
+ let fromNode = getC4ShapeObj(rel.from);
2300
+ let endNode = getC4ShapeObj(rel.to);
2301
+ let points = getIntersectPoints(fromNode, endNode);
2302
+ rel.startPoint = points.startPoint;
2303
+ rel.endPoint = points.endPoint;
2304
+ }
2305
+ svgDraw_default.drawRels(diagram2, rels2, conf, diagramId);
2306
+ }, "drawRels");
2307
+ function drawInsideBoundary(diagram2, parentBoundaryAlias, parentBounds, currentBoundaries, diagObj) {
2308
+ let currentBounds = new Bounds(diagObj);
2309
+ currentBounds.data.widthLimit = parentBounds.data.widthLimit / Math.min(c4BoundaryInRow2, currentBoundaries.length);
2310
+ for (let [i, currentBoundary] of currentBoundaries.entries()) {
2311
+ let Y = 0;
2312
+ currentBoundary.image = { width: 0, height: 0, Y: 0 };
2313
+ if (currentBoundary.sprite) {
2314
+ currentBoundary.image.width = 48;
2315
+ currentBoundary.image.height = 48;
2316
+ currentBoundary.image.Y = Y;
2317
+ Y = currentBoundary.image.Y + currentBoundary.image.height;
2318
+ }
2319
+ let currentBoundaryTextWrap = currentBoundary.wrap && conf.wrap;
2320
+ let currentBoundaryLabelConf = boundaryFont(conf);
2321
+ currentBoundaryLabelConf.fontSize = currentBoundaryLabelConf.fontSize + 2;
2322
+ currentBoundaryLabelConf.fontWeight = "bold";
2323
+ calcC4ShapeTextWH(
2324
+ "label",
2325
+ currentBoundary,
2326
+ currentBoundaryTextWrap,
2327
+ currentBoundaryLabelConf,
2328
+ currentBounds.data.widthLimit
2329
+ );
2330
+ currentBoundary.label.Y = Y + 8;
2331
+ Y = currentBoundary.label.Y + currentBoundary.label.height;
2332
+ if (currentBoundary.type && currentBoundary.type.text !== "") {
2333
+ currentBoundary.type.text = "[" + currentBoundary.type.text + "]";
2334
+ let currentBoundaryTypeConf = boundaryFont(conf);
2335
+ calcC4ShapeTextWH(
2336
+ "type",
2337
+ currentBoundary,
2338
+ currentBoundaryTextWrap,
2339
+ currentBoundaryTypeConf,
2340
+ currentBounds.data.widthLimit
2341
+ );
2342
+ currentBoundary.type.Y = Y + 5;
2343
+ Y = currentBoundary.type.Y + currentBoundary.type.height;
2344
+ }
2345
+ if (currentBoundary.descr && currentBoundary.descr.text !== "") {
2346
+ let currentBoundaryDescrConf = boundaryFont(conf);
2347
+ currentBoundaryDescrConf.fontSize = currentBoundaryDescrConf.fontSize - 2;
2348
+ calcC4ShapeTextWH(
2349
+ "descr",
2350
+ currentBoundary,
2351
+ currentBoundaryTextWrap,
2352
+ currentBoundaryDescrConf,
2353
+ currentBounds.data.widthLimit
2354
+ );
2355
+ currentBoundary.descr.Y = Y + 20;
2356
+ Y = currentBoundary.descr.Y + currentBoundary.descr.height;
2357
+ }
2358
+ if (i == 0 || i % c4BoundaryInRow2 === 0) {
2359
+ let _x = parentBounds.data.startx + conf.diagramMarginX;
2360
+ let _y = parentBounds.data.stopy + conf.diagramMarginY + Y;
2361
+ currentBounds.setData(_x, _x, _y, _y);
2362
+ } else {
2363
+ let _x = currentBounds.data.stopx !== currentBounds.data.startx ? currentBounds.data.stopx + conf.diagramMarginX : currentBounds.data.startx;
2364
+ let _y = currentBounds.data.starty;
2365
+ currentBounds.setData(_x, _x, _y, _y);
2366
+ }
2367
+ currentBounds.name = currentBoundary.alias;
2368
+ let currentPersonOrSystemArray = diagObj.db.getC4ShapeArray(currentBoundary.alias);
2369
+ let currentPersonOrSystemKeys = diagObj.db.getC4ShapeKeys(currentBoundary.alias);
2370
+ if (currentPersonOrSystemKeys.length > 0) {
2371
+ drawC4ShapeArray(
2372
+ currentBounds,
2373
+ diagram2,
2374
+ currentPersonOrSystemArray,
2375
+ currentPersonOrSystemKeys
2376
+ );
2377
+ }
2378
+ parentBoundaryAlias = currentBoundary.alias;
2379
+ let nextCurrentBoundaries = diagObj.db.getBoundaries(parentBoundaryAlias);
2380
+ if (nextCurrentBoundaries.length > 0) {
2381
+ drawInsideBoundary(
2382
+ diagram2,
2383
+ parentBoundaryAlias,
2384
+ currentBounds,
2385
+ nextCurrentBoundaries,
2386
+ diagObj
2387
+ );
2388
+ }
2389
+ if (currentBoundary.alias !== "global") {
2390
+ drawBoundary2(diagram2, currentBoundary, currentBounds);
2391
+ }
2392
+ parentBounds.data.stopy = Math.max(
2393
+ currentBounds.data.stopy + conf.c4ShapeMargin,
2394
+ parentBounds.data.stopy
2395
+ );
2396
+ parentBounds.data.stopx = Math.max(
2397
+ currentBounds.data.stopx + conf.c4ShapeMargin,
2398
+ parentBounds.data.stopx
2399
+ );
2400
+ globalBoundaryMaxX = Math.max(globalBoundaryMaxX, parentBounds.data.stopx);
2401
+ globalBoundaryMaxY = Math.max(globalBoundaryMaxY, parentBounds.data.stopy);
2402
+ }
2403
+ }
2404
+ __name(drawInsideBoundary, "drawInsideBoundary");
2405
+ var draw = /* @__PURE__ */ __name(function(_text, id, _version, diagObj) {
2406
+ conf = getConfig2().c4;
2407
+ const securityLevel = getConfig2().securityLevel;
2408
+ let sandboxElement;
2409
+ if (securityLevel === "sandbox") {
2410
+ sandboxElement = select("#i" + id);
2411
+ }
2412
+ const root = securityLevel === "sandbox" ? select(sandboxElement.nodes()[0].contentDocument.body) : select("body");
2413
+ let db = diagObj.db;
2414
+ diagObj.db.setWrap(conf.wrap);
2415
+ c4ShapeInRow2 = db.getC4ShapeInRow();
2416
+ c4BoundaryInRow2 = db.getC4BoundaryInRow();
2417
+ log.debug(`C:${JSON.stringify(conf, null, 2)}`);
2418
+ const diagram2 = securityLevel === "sandbox" ? root.select(`[id="${id}"]`) : select(`[id="${id}"]`);
2419
+ svgDraw_default.insertComputerIcon(diagram2, id);
2420
+ svgDraw_default.insertDatabaseIcon(diagram2, id);
2421
+ svgDraw_default.insertClockIcon(diagram2, id);
2422
+ let screenBounds = new Bounds(diagObj);
2423
+ screenBounds.setData(
2424
+ conf.diagramMarginX,
2425
+ conf.diagramMarginX,
2426
+ conf.diagramMarginY,
2427
+ conf.diagramMarginY
2428
+ );
2429
+ screenBounds.data.widthLimit = screen.availWidth;
2430
+ globalBoundaryMaxX = conf.diagramMarginX;
2431
+ globalBoundaryMaxY = conf.diagramMarginY;
2432
+ const title2 = diagObj.db.getTitle();
2433
+ let currentBoundaries = diagObj.db.getBoundaries("");
2434
+ drawInsideBoundary(diagram2, "", screenBounds, currentBoundaries, diagObj);
2435
+ svgDraw_default.insertArrowHead(diagram2, id);
2436
+ svgDraw_default.insertArrowEnd(diagram2, id);
2437
+ svgDraw_default.insertArrowCrossHead(diagram2, id);
2438
+ svgDraw_default.insertArrowFilledHead(diagram2, id);
2439
+ drawRels2(diagram2, diagObj.db.getRels(), diagObj.db.getC4Shape, diagObj, id);
2440
+ screenBounds.data.stopx = globalBoundaryMaxX;
2441
+ screenBounds.data.stopy = globalBoundaryMaxY;
2442
+ const box = screenBounds.data;
2443
+ let boxHeight = box.stopy - box.starty;
2444
+ let height = boxHeight + 2 * conf.diagramMarginY;
2445
+ let boxWidth = box.stopx - box.startx;
2446
+ const width = boxWidth + 2 * conf.diagramMarginX;
2447
+ if (title2) {
2448
+ diagram2.append("text").text(title2).attr("x", (box.stopx - box.startx) / 2 - 4 * conf.diagramMarginX).attr("y", box.starty + conf.diagramMarginY);
2449
+ }
2450
+ configureSvgSize(diagram2, height, width, conf.useMaxWidth);
2451
+ const extraVertForTitle = title2 ? 60 : 0;
2452
+ diagram2.attr(
2453
+ "viewBox",
2454
+ box.startx - conf.diagramMarginX + " -" + (conf.diagramMarginY + extraVertForTitle) + " " + width + " " + (height + extraVertForTitle)
2455
+ );
2456
+ log.debug(`models:`, box);
2457
+ }, "draw");
2458
+ var c4Renderer_default = {
2459
+ drawPersonOrSystemArray: drawC4ShapeArray,
2460
+ drawBoundary: drawBoundary2,
2461
+ setConf,
2462
+ draw
2463
+ };
2464
+ var getStyles = /* @__PURE__ */ __name((options) => `.person {
2465
+ stroke: ${options.personBorder};
2466
+ fill: ${options.personBkg};
2467
+ }
2468
+ `, "getStyles");
2469
+ var styles_default = getStyles;
2470
+ var diagram = {
2471
+ parser: c4Diagram_default,
2472
+ db: c4Db_default,
2473
+ renderer: c4Renderer_default,
2474
+ styles: styles_default,
2475
+ init: /* @__PURE__ */ __name(({ c4, wrap }) => {
2476
+ c4Renderer_default.setConf(c4);
2477
+ c4Db_default.setWrap(wrap);
2478
+ }, "init")
2479
+ };
2480
+ export {
2481
+ diagram
2482
+ };