@infinilabs/ai-chat 0.0.0 → 0.0.2

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