@openbkn/workshop 0.2.2-rc.5 → 0.2.2-rc.6

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 (158) hide show
  1. package/README.md +79 -8
  2. package/component.d.ts +10 -0
  3. package/dist/ActionConfirm-DJ91X3ml.js +236 -0
  4. package/dist/ActionFailure-ZgPt_3B-.js +37 -0
  5. package/dist/AgentChat-CRYai8ge.js +1062 -0
  6. package/dist/AppFormModal-D73ucaHK.js +4282 -0
  7. package/dist/AppListPage-D87piiOw.js +1364 -0
  8. package/dist/AskDrawer-BUMYsRnt.js +38 -0
  9. package/dist/ComputedView-CgYrDbx1.js +3221 -0
  10. package/dist/ConclusionApply-sjGfoEBY.js +153 -0
  11. package/dist/CypherEditor-lus6FA5L.js +485 -0
  12. package/dist/LandingList-6JI6864C.js +230 -0
  13. package/dist/MenuUnfoldOutlined-Cdg24l2h.js +27 -0
  14. package/dist/ModelTrial-ClHFGTpQ.js +359 -0
  15. package/dist/PageRenderer-DBd_g6mN.js +85480 -0
  16. package/dist/README-DjRyTQSR.js +76 -0
  17. package/dist/ScenarioApply-DtW_hh47.js +590 -0
  18. package/dist/SimulateForm-C-i08Jjd.js +153 -0
  19. package/dist/Subgraph-CnrkH9AN.js +32586 -0
  20. package/dist/WorkshopLabPage-DiVXQL9e.js +11364 -0
  21. package/dist/WorkshopRunPage-6hjRUf64.js +253 -0
  22. package/dist/abnfDiagram-WEYOIA3C-beRNhN3c.js +87 -0
  23. package/dist/action-type-tool.service-B2B74fKC.js +1060 -0
  24. package/dist/actionButton-DA5CNEzx.js +94 -0
  25. package/dist/actionButton.en-US-qjeqA7hs.js +94 -0
  26. package/dist/agentChat-EoDznd58.js +116 -0
  27. package/dist/agentChat.en-US-B6-pFd9Y.js +116 -0
  28. package/dist/alertList-DqditwM8.js +84 -0
  29. package/dist/alertList.en-US-BAXAgltP.js +84 -0
  30. package/dist/architectureDiagram-ZHVYKT53-DY2l1qxx.js +4779 -0
  31. package/dist/asOfSlider-QPvHWUMV.js +83 -0
  32. package/dist/asOfSlider.en-US-BI4jVfSn.js +83 -0
  33. package/dist/bkn-agent-execution.service-DVh-SHyl.js +205 -0
  34. package/dist/blockDiagram-RJAE7QA3-DR0mjN2h.js +1435 -0
  35. package/dist/c4Diagram-XDPPPE54-DH5zsGug.js +1518 -0
  36. package/dist/channel-B034hcOF.js +5 -0
  37. package/dist/china-C6m7zXIv.js +9 -0
  38. package/dist/chunk-2E7WHVMD-Ba3svxgx.js +664 -0
  39. package/dist/chunk-2Q5K7J3B-rT4eU6_y.js +15 -0
  40. package/dist/chunk-4EMNKR2T-C1kQZYHK.js +262 -0
  41. package/dist/chunk-55XCU76K-dcpLOktb.js +68 -0
  42. package/dist/chunk-5VM5RSS4-BdpQuzmO.js +19 -0
  43. package/dist/chunk-JWPE2WC7-CDBrSjU7.js +8 -0
  44. package/dist/chunk-VQ5W62QI-BiVKc40w.js +19 -0
  45. package/dist/chunk-XXDRQBXY-CPYrcdVW.js +8 -0
  46. package/dist/chunk-ZCHMQSOR-BG8OLpvb.js +451 -0
  47. package/dist/classDiagram-v2-4MYWR3UA-DqbpQpwI.js +1564 -0
  48. package/dist/component.d-DFoMKuUv.js +179 -0
  49. package/dist/cose-bilkent-JH36ORCC-CdXk4sPf.js +2609 -0
  50. package/dist/customComponents-DasaZ6pq.js +4 -0
  51. package/dist/customComponents.en-US-CkabuCXg.js +79 -0
  52. package/dist/customParseFormat-C0uLEpdq.js +182 -0
  53. package/dist/cynefin-EF2NZ3EQ-D7MVnMHu.js +21746 -0
  54. package/dist/cynefinDiagram-WF24UDRP-BYT_KpDL.js +299 -0
  55. package/dist/cytoscape.esm-BCV9V6aO.js +18760 -0
  56. package/dist/d3-scale-DA8IHmf0.js +1841 -0
  57. package/dist/dagre-NK4GIZVX-l-ghPdM8.js +2154 -0
  58. package/dist/dateRange-BbkLMg8L.js +79 -0
  59. package/dist/dateRange.en-US-CV12Q02G.js +79 -0
  60. package/dist/dayjs.min-DZ-YV8Mv.js +284 -0
  61. package/dist/diagram-CBK3MWTC-Bt3HiwvA.js +542 -0
  62. package/dist/diagram-I5XIIV2D-DcbqfBjx.js +150 -0
  63. package/dist/diagram-ODIL2UCW-9PC1n3n5.js +346 -0
  64. package/dist/diagram-PFBEJUXE-DGhr2kc7.js +478 -0
  65. package/dist/diagram-RJA3I4VV-DwzpOjZ_.js +219 -0
  66. package/dist/diagram-TYUNFSNR-B3Bd3TDU.js +2583 -0
  67. package/dist/dropdownFilter-DOi_8-ZT.js +76 -0
  68. package/dist/dropdownFilter.en-US-BiXpvXtF.js +76 -0
  69. package/dist/ebnfDiagram-V4P3TTPT-E5NN2oKc.js +109 -0
  70. package/dist/elk-QONTBCTQ-dFjcujl_.js +49170 -0
  71. package/dist/erDiagram-KYQIGQAA-BMrasBzB.js +1061 -0
  72. package/dist/eventList-CnsAwfDS.js +115 -0
  73. package/dist/eventList.en-US-Cof3rCLq.js +115 -0
  74. package/dist/eventReport-XS-HegnH.js +76 -0
  75. package/dist/eventReport.en-US-DTx4vzWT.js +76 -0
  76. package/dist/flowDiagram-IUGLLWBU-BGIBH0q0.js +1769 -0
  77. package/dist/ganttChart-DEeSvTJA.js +77 -0
  78. package/dist/ganttChart.en-US-SwRKrnoD.js +77 -0
  79. package/dist/ganttDiagram-R7GPNTJY-C0tb1Lpp.js +1741 -0
  80. package/dist/generateCypher-Ch9_lQa6.js +399 -0
  81. package/dist/gitGraphDiagram-PDYL7XHY-DBqcOa-c.js +815 -0
  82. package/dist/graph-CKJmgLki.js +1541 -0
  83. package/dist/index-BA-GzCXt.js +441 -0
  84. package/dist/infoDiagram-MVDRKAX5-Bwuki4JA.js +24 -0
  85. package/dist/ishikawaDiagram-HPEHV2GE-Dz4d6ygx.js +622 -0
  86. package/dist/journeyDiagram-BOSHW7O7-C99m34Bb.js +834 -0
  87. package/dist/kanban-definition-FNSA4HC5-mdqjODsT.js +724 -0
  88. package/dist/katex-BsrBVQKd.js +11314 -0
  89. package/dist/manifest-BjV1PJ6u.js +41 -0
  90. package/dist/mermaid.core-yQghUlIz.js +17642 -0
  91. package/dist/metricCards-CSb-_cT2.js +104 -0
  92. package/dist/metricCards.en-US-BLLhRsQU.js +104 -0
  93. package/dist/mindmap-definition-6OY57UG3-BZhO2wX4.js +834 -0
  94. package/dist/modelTrial-Bvb-RhGt.js +137 -0
  95. package/dist/modelTrial.en-US-DYcuor-G.js +137 -0
  96. package/dist/models-DekiCOuZ.js +6 -0
  97. package/dist/object-metric-numeric-vs3BeDkH.js +42 -0
  98. package/dist/object-metric.service-flZgBMRX.js +233 -0
  99. package/dist/objectDetail-SQUbp4Py.js +117 -0
  100. package/dist/objectDetail.en-US-DW3mlONM.js +117 -0
  101. package/dist/objectList-D99wPtJH.js +97 -0
  102. package/dist/objectList.en-US-PBBNyVLW.js +97 -0
  103. package/dist/objectTable-0jsFFMN3.js +127 -0
  104. package/dist/objectTable.en-US-yWEs8qc_.js +127 -0
  105. package/dist/pegDiagram-ECIUJNBX-BDa5RfZt.js +95 -0
  106. package/dist/pieDiagram-GNMPY74T-DNVtzXPv.js +165 -0
  107. package/dist/pivotTable-CHmQw18-.js +102 -0
  108. package/dist/pivotTable.en-US-B4uv4P08.js +102 -0
  109. package/dist/prompt-DYrjlEFr.js +373 -0
  110. package/dist/quadrantDiagram-D57K4MC3-vK0f2OvQ.js +1023 -0
  111. package/dist/railroadDiagram-Y72NRBL7-j6ZrTmRp.js +77 -0
  112. package/dist/regionMap-Cme-JyV_.js +128 -0
  113. package/dist/regionMap.en-US-Bwr2_p32.js +128 -0
  114. package/dist/requirementDiagram-EQYSW5RA-DgfEyljA.js +886 -0
  115. package/dist/sankeyDiagram-SY24JHO5-CImx-IX0.js +1160 -0
  116. package/dist/scenarioBar-BV43p7n-.js +122 -0
  117. package/dist/scenarioBar.en-US-5KqMQ2Bg.js +122 -0
  118. package/dist/scheduleGantt-CTYO-zYP.js +180 -0
  119. package/dist/scheduleGantt.en-US-hE7mvVUW.js +180 -0
  120. package/dist/searchBox-Ca7w0f_6.js +67 -0
  121. package/dist/searchBox.en-US-ArS_XBvB.js +67 -0
  122. package/dist/segmentedFilter-MhjVcWo0.js +80 -0
  123. package/dist/segmentedFilter.en-US-BxNrQO5T.js +80 -0
  124. package/dist/sequenceDiagram-BLEHNHQU-nWmjd1ci.js +2969 -0
  125. package/dist/sizeCapture-INFHLROL-D3jlbt7h.js +46 -0
  126. package/dist/stageChain-BxBafwjD.js +74 -0
  127. package/dist/stageChain.en-US-CP0G27n8.js +74 -0
  128. package/dist/stateDiagram-v2-A6IESKWZ-DG1ZetEu.js +1514 -0
  129. package/dist/subgraph-7n4SwliR.js +71 -0
  130. package/dist/subgraph.en-US-BNvY18IW.js +71 -0
  131. package/dist/swimlanes-B3ENRKFQ-cCmJE8AU.js +4991 -0
  132. package/dist/swimlanesDiagram-AYQRV4AK-CtuhyguU.js +14 -0
  133. package/dist/taskInbox-DGWYeI2b.js +118 -0
  134. package/dist/taskInbox.en-US-B-OzDmVl.js +118 -0
  135. package/dist/text-BqSVQKS6.js +78 -0
  136. package/dist/text.en-US-BhAxy_LE.js +78 -0
  137. package/dist/timeline-definition-JXYKGLGB-Cc-INsOv.js +1057 -0
  138. package/dist/trendChart-BjEeRS5_.js +135 -0
  139. package/dist/trendChart.en-US-BBGqWUKM.js +135 -0
  140. package/dist/useLabData-Df-jEHKs.js +20470 -0
  141. package/dist/usecaseDiagram-WPOLBNNX-r8wVjopm.js +7920 -0
  142. package/dist/vennDiagram-Q3Y3IDCW-BZiOcgrj.js +1579 -0
  143. package/dist/wardleyDiagram-IVAIDKWA-16jd07C_.js +675 -0
  144. package/dist/workshop-app-DnHNjBqy.js +86038 -0
  145. package/dist/workshop-app.css +1 -0
  146. package/dist/workshop-app.js +4 -0
  147. package/dist/world-Djau1JyJ.js +9 -0
  148. package/dist/xychartDiagram-4URNHDU4-C8DwWQNh.js +1460 -0
  149. package/dist-cli/workshop.js +340 -217
  150. package/example/host.js +109 -0
  151. package/example/index.html +93 -0
  152. package/example/server.mjs +237 -0
  153. package/index.d.ts +48 -0
  154. package/lib/validate.js +47 -1
  155. package/package.json +17 -5
  156. package/runtime/frame-runtime.js +13 -1
  157. package/workshop-component.js +32 -12
  158. package/workshop.js +2 -0
@@ -0,0 +1,1518 @@
1
+ import { d as Ie } from "./chunk-55XCU76K-dcpLOktb.js";
2
+ import { s as Me, g as Be, a as Ve, b as Ye, _ as d, c as Ot, l as de, d as Fe, e as Ue, i as je, f as Nt, h as ze, j as me, k as Zt, w as We, m as te, n as pe } from "./mermaid.core-yQghUlIz.js";
3
+ var jt = (function() {
4
+ var t = /* @__PURE__ */ d(function(_t, m, x, E) {
5
+ for (x = x || {}, E = _t.length; E--; x[_t[E]] = m) ;
6
+ return x;
7
+ }, "o"), e = [1, 24], a = [1, 25], i = [1, 26], u = [1, 27], r = [1, 28], n = [1, 63], l = [1, 64], s = [1, 65], h = [1, 66], y = [1, 67], p = [1, 68], g = [1, 69], v = [1, 29], w = [1, 30], N = [1, 31], O = [1, 32], P = [1, 33], I = [1, 34], X = [1, 35], q = [1, 36], H = [1, 37], Q = [1, 38], K = [1, 39], G = [1, 40], J = [1, 41], Z = [1, 42], $ = [1, 43], tt = [1, 44], et = [1, 45], nt = [1, 46], st = [1, 47], at = [1, 48], rt = [1, 50], it = [1, 51], ot = [1, 52], lt = [1, 53], ct = [1, 54], ut = [1, 55], ht = [1, 56], dt = [1, 57], pt = [1, 58], ft = [1, 59], yt = [1, 60], kt = [14, 42], Xt = [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], Pt = [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], S = [1, 82], T = [1, 83], k = [1, 84], C = [1, 85], R = [12, 14, 42], oe = [12, 14, 33, 42], Bt = [12, 14, 33, 42, 76, 77, 79, 80], xt = [12, 33], qt = [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], Ht = {
8
+ trace: /* @__PURE__ */ d(function() {
9
+ }, "trace"),
10
+ yy: {},
11
+ 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 },
12
+ 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" },
13
+ 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]],
14
+ performAction: /* @__PURE__ */ d(function(m, x, E, _, D, o, Dt) {
15
+ var f = o.length - 1;
16
+ switch (D) {
17
+ case 3:
18
+ _.setDirection("TB");
19
+ break;
20
+ case 4:
21
+ _.setDirection("BT");
22
+ break;
23
+ case 5:
24
+ _.setDirection("RL");
25
+ break;
26
+ case 6:
27
+ _.setDirection("LR");
28
+ break;
29
+ case 8:
30
+ case 9:
31
+ case 10:
32
+ case 11:
33
+ case 12:
34
+ _.setC4Type(o[f - 3]);
35
+ break;
36
+ case 19:
37
+ _.setTitle(o[f].substring(6)), this.$ = o[f].substring(6);
38
+ break;
39
+ case 20:
40
+ _.setAccDescription(o[f].substring(15)), this.$ = o[f].substring(15);
41
+ break;
42
+ case 21:
43
+ this.$ = o[f].trim(), _.setTitle(this.$);
44
+ break;
45
+ case 22:
46
+ case 23:
47
+ this.$ = o[f].trim(), _.setAccDescription(this.$);
48
+ break;
49
+ case 28:
50
+ o[f].splice(2, 0, "ENTERPRISE"), _.addPersonOrSystemBoundary(...o[f]), this.$ = o[f];
51
+ break;
52
+ case 29:
53
+ o[f].splice(2, 0, "SYSTEM"), _.addPersonOrSystemBoundary(...o[f]), this.$ = o[f];
54
+ break;
55
+ case 30:
56
+ _.addPersonOrSystemBoundary(...o[f]), this.$ = o[f];
57
+ break;
58
+ case 31:
59
+ o[f].splice(2, 0, "CONTAINER"), _.addContainerBoundary(...o[f]), this.$ = o[f];
60
+ break;
61
+ case 32:
62
+ _.addDeploymentNode("node", ...o[f]), this.$ = o[f];
63
+ break;
64
+ case 33:
65
+ _.addDeploymentNode("nodeL", ...o[f]), this.$ = o[f];
66
+ break;
67
+ case 34:
68
+ _.addDeploymentNode("nodeR", ...o[f]), this.$ = o[f];
69
+ break;
70
+ case 35:
71
+ _.popBoundaryParseStack();
72
+ break;
73
+ case 39:
74
+ _.addPersonOrSystem("person", ...o[f]), this.$ = o[f];
75
+ break;
76
+ case 40:
77
+ _.addPersonOrSystem("external_person", ...o[f]), this.$ = o[f];
78
+ break;
79
+ case 41:
80
+ _.addPersonOrSystem("system", ...o[f]), this.$ = o[f];
81
+ break;
82
+ case 42:
83
+ _.addPersonOrSystem("system_db", ...o[f]), this.$ = o[f];
84
+ break;
85
+ case 43:
86
+ _.addPersonOrSystem("system_queue", ...o[f]), this.$ = o[f];
87
+ break;
88
+ case 44:
89
+ _.addPersonOrSystem("external_system", ...o[f]), this.$ = o[f];
90
+ break;
91
+ case 45:
92
+ _.addPersonOrSystem("external_system_db", ...o[f]), this.$ = o[f];
93
+ break;
94
+ case 46:
95
+ _.addPersonOrSystem("external_system_queue", ...o[f]), this.$ = o[f];
96
+ break;
97
+ case 47:
98
+ _.addContainer("container", ...o[f]), this.$ = o[f];
99
+ break;
100
+ case 48:
101
+ _.addContainer("container_db", ...o[f]), this.$ = o[f];
102
+ break;
103
+ case 49:
104
+ _.addContainer("container_queue", ...o[f]), this.$ = o[f];
105
+ break;
106
+ case 50:
107
+ _.addContainer("external_container", ...o[f]), this.$ = o[f];
108
+ break;
109
+ case 51:
110
+ _.addContainer("external_container_db", ...o[f]), this.$ = o[f];
111
+ break;
112
+ case 52:
113
+ _.addContainer("external_container_queue", ...o[f]), this.$ = o[f];
114
+ break;
115
+ case 53:
116
+ _.addComponent("component", ...o[f]), this.$ = o[f];
117
+ break;
118
+ case 54:
119
+ _.addComponent("component_db", ...o[f]), this.$ = o[f];
120
+ break;
121
+ case 55:
122
+ _.addComponent("component_queue", ...o[f]), this.$ = o[f];
123
+ break;
124
+ case 56:
125
+ _.addComponent("external_component", ...o[f]), this.$ = o[f];
126
+ break;
127
+ case 57:
128
+ _.addComponent("external_component_db", ...o[f]), this.$ = o[f];
129
+ break;
130
+ case 58:
131
+ _.addComponent("external_component_queue", ...o[f]), this.$ = o[f];
132
+ break;
133
+ case 60:
134
+ _.addRel("rel", ...o[f]), this.$ = o[f];
135
+ break;
136
+ case 61:
137
+ _.addRel("birel", ...o[f]), this.$ = o[f];
138
+ break;
139
+ case 62:
140
+ _.addRel("rel_u", ...o[f]), this.$ = o[f];
141
+ break;
142
+ case 63:
143
+ _.addRel("rel_d", ...o[f]), this.$ = o[f];
144
+ break;
145
+ case 64:
146
+ _.addRel("rel_l", ...o[f]), this.$ = o[f];
147
+ break;
148
+ case 65:
149
+ _.addRel("rel_r", ...o[f]), this.$ = o[f];
150
+ break;
151
+ case 66:
152
+ _.addRel("rel_b", ...o[f]), this.$ = o[f];
153
+ break;
154
+ case 67:
155
+ o[f].splice(0, 1), _.addRel("rel", ...o[f]), this.$ = o[f];
156
+ break;
157
+ case 68:
158
+ _.updateElStyle("update_el_style", ...o[f]), this.$ = o[f];
159
+ break;
160
+ case 69:
161
+ _.updateRelStyle("update_rel_style", ...o[f]), this.$ = o[f];
162
+ break;
163
+ case 70:
164
+ _.updateLayoutConfig("update_layout_config", ...o[f]), this.$ = o[f];
165
+ break;
166
+ case 71:
167
+ this.$ = [o[f]];
168
+ break;
169
+ case 72:
170
+ o[f].unshift(o[f - 1]), this.$ = o[f];
171
+ break;
172
+ case 73:
173
+ case 75:
174
+ this.$ = o[f].trim();
175
+ break;
176
+ case 74:
177
+ let vt = {};
178
+ vt[o[f - 1].trim()] = o[f].trim(), this.$ = vt;
179
+ break;
180
+ case 76:
181
+ this.$ = "";
182
+ break;
183
+ }
184
+ }, "anonymous"),
185
+ 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: e, 23: a, 24: i, 26: u, 28: r, 29: 49, 30: 61, 32: 62, 34: n, 36: l, 37: s, 38: h, 39: y, 40: p, 41: g, 43: 23, 44: v, 45: w, 46: N, 47: O, 48: P, 49: I, 50: X, 51: q, 52: H, 53: Q, 54: K, 55: G, 56: J, 57: Z, 58: $, 59: tt, 60: et, 61: nt, 62: st, 63: at, 64: rt, 65: it, 66: ot, 67: lt, 68: ct, 69: ut, 70: ht, 71: dt, 72: pt, 73: ft, 74: yt }, { 13: 70, 19: 20, 20: 21, 21: 22, 22: e, 23: a, 24: i, 26: u, 28: r, 29: 49, 30: 61, 32: 62, 34: n, 36: l, 37: s, 38: h, 39: y, 40: p, 41: g, 43: 23, 44: v, 45: w, 46: N, 47: O, 48: P, 49: I, 50: X, 51: q, 52: H, 53: Q, 54: K, 55: G, 56: J, 57: Z, 58: $, 59: tt, 60: et, 61: nt, 62: st, 63: at, 64: rt, 65: it, 66: ot, 67: lt, 68: ct, 69: ut, 70: ht, 71: dt, 72: pt, 73: ft, 74: yt }, { 13: 71, 19: 20, 20: 21, 21: 22, 22: e, 23: a, 24: i, 26: u, 28: r, 29: 49, 30: 61, 32: 62, 34: n, 36: l, 37: s, 38: h, 39: y, 40: p, 41: g, 43: 23, 44: v, 45: w, 46: N, 47: O, 48: P, 49: I, 50: X, 51: q, 52: H, 53: Q, 54: K, 55: G, 56: J, 57: Z, 58: $, 59: tt, 60: et, 61: nt, 62: st, 63: at, 64: rt, 65: it, 66: ot, 67: lt, 68: ct, 69: ut, 70: ht, 71: dt, 72: pt, 73: ft, 74: yt }, { 13: 72, 19: 20, 20: 21, 21: 22, 22: e, 23: a, 24: i, 26: u, 28: r, 29: 49, 30: 61, 32: 62, 34: n, 36: l, 37: s, 38: h, 39: y, 40: p, 41: g, 43: 23, 44: v, 45: w, 46: N, 47: O, 48: P, 49: I, 50: X, 51: q, 52: H, 53: Q, 54: K, 55: G, 56: J, 57: Z, 58: $, 59: tt, 60: et, 61: nt, 62: st, 63: at, 64: rt, 65: it, 66: ot, 67: lt, 68: ct, 69: ut, 70: ht, 71: dt, 72: pt, 73: ft, 74: yt }, { 13: 73, 19: 20, 20: 21, 21: 22, 22: e, 23: a, 24: i, 26: u, 28: r, 29: 49, 30: 61, 32: 62, 34: n, 36: l, 37: s, 38: h, 39: y, 40: p, 41: g, 43: 23, 44: v, 45: w, 46: N, 47: O, 48: P, 49: I, 50: X, 51: q, 52: H, 53: Q, 54: K, 55: G, 56: J, 57: Z, 58: $, 59: tt, 60: et, 61: nt, 62: st, 63: at, 64: rt, 65: it, 66: ot, 67: lt, 68: ct, 69: ut, 70: ht, 71: dt, 72: pt, 73: ft, 74: yt }, { 14: [1, 74] }, t(kt, [2, 13], { 43: 23, 29: 49, 30: 61, 32: 62, 20: 75, 34: n, 36: l, 37: s, 38: h, 39: y, 40: p, 41: g, 44: v, 45: w, 46: N, 47: O, 48: P, 49: I, 50: X, 51: q, 52: H, 53: Q, 54: K, 55: G, 56: J, 57: Z, 58: $, 59: tt, 60: et, 61: nt, 62: st, 63: at, 64: rt, 65: it, 66: ot, 67: lt, 68: ct, 69: ut, 70: ht, 71: dt, 72: pt, 73: ft, 74: yt }), t(kt, [2, 14]), t(Xt, [2, 16], { 12: [1, 76] }), t(kt, [2, 36], { 12: [1, 77] }), t(Pt, [2, 19]), t(Pt, [2, 20]), { 25: [1, 78] }, { 27: [1, 79] }, t(Pt, [2, 23]), { 35: 80, 75: 81, 76: S, 77: T, 79: k, 80: C }, { 35: 86, 75: 81, 76: S, 77: T, 79: k, 80: C }, { 35: 87, 75: 81, 76: S, 77: T, 79: k, 80: C }, { 35: 88, 75: 81, 76: S, 77: T, 79: k, 80: C }, { 35: 89, 75: 81, 76: S, 77: T, 79: k, 80: C }, { 35: 90, 75: 81, 76: S, 77: T, 79: k, 80: C }, { 35: 91, 75: 81, 76: S, 77: T, 79: k, 80: C }, { 35: 92, 75: 81, 76: S, 77: T, 79: k, 80: C }, { 35: 93, 75: 81, 76: S, 77: T, 79: k, 80: C }, { 35: 94, 75: 81, 76: S, 77: T, 79: k, 80: C }, { 35: 95, 75: 81, 76: S, 77: T, 79: k, 80: C }, { 35: 96, 75: 81, 76: S, 77: T, 79: k, 80: C }, { 35: 97, 75: 81, 76: S, 77: T, 79: k, 80: C }, { 35: 98, 75: 81, 76: S, 77: T, 79: k, 80: C }, { 35: 99, 75: 81, 76: S, 77: T, 79: k, 80: C }, { 35: 100, 75: 81, 76: S, 77: T, 79: k, 80: C }, { 35: 101, 75: 81, 76: S, 77: T, 79: k, 80: C }, { 35: 102, 75: 81, 76: S, 77: T, 79: k, 80: C }, { 35: 103, 75: 81, 76: S, 77: T, 79: k, 80: C }, { 35: 104, 75: 81, 76: S, 77: T, 79: k, 80: C }, t(R, [2, 59]), { 35: 105, 75: 81, 76: S, 77: T, 79: k, 80: C }, { 35: 106, 75: 81, 76: S, 77: T, 79: k, 80: C }, { 35: 107, 75: 81, 76: S, 77: T, 79: k, 80: C }, { 35: 108, 75: 81, 76: S, 77: T, 79: k, 80: C }, { 35: 109, 75: 81, 76: S, 77: T, 79: k, 80: C }, { 35: 110, 75: 81, 76: S, 77: T, 79: k, 80: C }, { 35: 111, 75: 81, 76: S, 77: T, 79: k, 80: C }, { 35: 112, 75: 81, 76: S, 77: T, 79: k, 80: C }, { 35: 113, 75: 81, 76: S, 77: T, 79: k, 80: C }, { 35: 114, 75: 81, 76: S, 77: T, 79: k, 80: C }, { 35: 115, 75: 81, 76: S, 77: T, 79: k, 80: C }, { 20: 116, 29: 49, 30: 61, 32: 62, 34: n, 36: l, 37: s, 38: h, 39: y, 40: p, 41: g, 43: 23, 44: v, 45: w, 46: N, 47: O, 48: P, 49: I, 50: X, 51: q, 52: H, 53: Q, 54: K, 55: G, 56: J, 57: Z, 58: $, 59: tt, 60: et, 61: nt, 62: st, 63: at, 64: rt, 65: it, 66: ot, 67: lt, 68: ct, 69: ut, 70: ht, 71: dt, 72: pt, 73: ft, 74: yt }, { 12: [1, 118], 33: [1, 117] }, { 35: 119, 75: 81, 76: S, 77: T, 79: k, 80: C }, { 35: 120, 75: 81, 76: S, 77: T, 79: k, 80: C }, { 35: 121, 75: 81, 76: S, 77: T, 79: k, 80: C }, { 35: 122, 75: 81, 76: S, 77: T, 79: k, 80: C }, { 35: 123, 75: 81, 76: S, 77: T, 79: k, 80: C }, { 35: 124, 75: 81, 76: S, 77: T, 79: k, 80: C }, { 35: 125, 75: 81, 76: S, 77: T, 79: k, 80: C }, { 14: [1, 126] }, { 14: [1, 127] }, { 14: [1, 128] }, { 14: [1, 129] }, { 1: [2, 8] }, t(kt, [2, 15]), t(Xt, [2, 17], { 21: 22, 19: 130, 22: e, 23: a, 24: i, 26: u, 28: r }), t(kt, [2, 37], { 19: 20, 20: 21, 21: 22, 43: 23, 29: 49, 30: 61, 32: 62, 13: 131, 22: e, 23: a, 24: i, 26: u, 28: r, 34: n, 36: l, 37: s, 38: h, 39: y, 40: p, 41: g, 44: v, 45: w, 46: N, 47: O, 48: P, 49: I, 50: X, 51: q, 52: H, 53: Q, 54: K, 55: G, 56: J, 57: Z, 58: $, 59: tt, 60: et, 61: nt, 62: st, 63: at, 64: rt, 65: it, 66: ot, 67: lt, 68: ct, 69: ut, 70: ht, 71: dt, 72: pt, 73: ft, 74: yt }), t(Pt, [2, 21]), t(Pt, [2, 22]), t(R, [2, 39]), t(oe, [2, 71], { 75: 81, 35: 132, 76: S, 77: T, 79: k, 80: C }), t(Bt, [2, 73]), { 78: [1, 133] }, t(Bt, [2, 75]), t(Bt, [2, 76]), t(R, [2, 40]), t(R, [2, 41]), t(R, [2, 42]), t(R, [2, 43]), t(R, [2, 44]), t(R, [2, 45]), t(R, [2, 46]), t(R, [2, 47]), t(R, [2, 48]), t(R, [2, 49]), t(R, [2, 50]), t(R, [2, 51]), t(R, [2, 52]), t(R, [2, 53]), t(R, [2, 54]), t(R, [2, 55]), t(R, [2, 56]), t(R, [2, 57]), t(R, [2, 58]), t(R, [2, 60]), t(R, [2, 61]), t(R, [2, 62]), t(R, [2, 63]), t(R, [2, 64]), t(R, [2, 65]), t(R, [2, 66]), t(R, [2, 67]), t(R, [2, 68]), t(R, [2, 69]), t(R, [2, 70]), { 31: 134, 42: [1, 135] }, { 12: [1, 136] }, { 33: [1, 137] }, t(xt, [2, 28]), t(xt, [2, 29]), t(xt, [2, 30]), t(xt, [2, 31]), t(xt, [2, 32]), t(xt, [2, 33]), t(xt, [2, 34]), { 1: [2, 9] }, { 1: [2, 10] }, { 1: [2, 11] }, { 1: [2, 12] }, t(Xt, [2, 18]), t(kt, [2, 38]), t(oe, [2, 72]), t(Bt, [2, 74]), t(R, [2, 24]), t(R, [2, 35]), t(qt, [2, 25]), t(qt, [2, 26], { 12: [1, 138] }), t(qt, [2, 27])],
186
+ 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] },
187
+ parseError: /* @__PURE__ */ d(function(m, x) {
188
+ if (x.recoverable)
189
+ this.trace(m);
190
+ else {
191
+ var E = new Error(m);
192
+ throw E.hash = x, E;
193
+ }
194
+ }, "parseError"),
195
+ parse: /* @__PURE__ */ d(function(m) {
196
+ var x = this, E = [0], _ = [], D = [null], o = [], Dt = this.table, f = "", vt = 0, le = 0, De = 2, ce = 1, Ne = o.slice.call(arguments, 1), A = Object.create(this.lexer), Et = { yy: {} };
197
+ for (var Qt in this.yy)
198
+ Object.prototype.hasOwnProperty.call(this.yy, Qt) && (Et.yy[Qt] = this.yy[Qt]);
199
+ A.setInput(m, Et.yy), Et.yy.lexer = A, Et.yy.parser = this, typeof A.yylloc > "u" && (A.yylloc = {});
200
+ var Kt = A.yylloc;
201
+ o.push(Kt);
202
+ var Ae = A.options && A.options.ranges;
203
+ typeof Et.yy.parseError == "function" ? this.parseError = Et.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
204
+ function Le(B) {
205
+ E.length = E.length - 2 * B, D.length = D.length - B, o.length = o.length - B;
206
+ }
207
+ d(Le, "popStack");
208
+ function ue() {
209
+ var B;
210
+ return B = _.pop() || A.lex() || ce, typeof B != "number" && (B instanceof Array && (_ = B, B = _.pop()), B = x.symbols_[B] || B), B;
211
+ }
212
+ d(ue, "lex");
213
+ for (var M, St, V, Gt, Ct = {}, Yt, z, he, Ft; ; ) {
214
+ if (St = E[E.length - 1], this.defaultActions[St] ? V = this.defaultActions[St] : ((M === null || typeof M > "u") && (M = ue()), V = Dt[St] && Dt[St][M]), typeof V > "u" || !V.length || !V[0]) {
215
+ var Jt = "";
216
+ Ft = [];
217
+ for (Yt in Dt[St])
218
+ this.terminals_[Yt] && Yt > De && Ft.push("'" + this.terminals_[Yt] + "'");
219
+ A.showPosition ? Jt = "Parse error on line " + (vt + 1) + `:
220
+ ` + A.showPosition() + `
221
+ Expecting ` + Ft.join(", ") + ", got '" + (this.terminals_[M] || M) + "'" : Jt = "Parse error on line " + (vt + 1) + ": Unexpected " + (M == ce ? "end of input" : "'" + (this.terminals_[M] || M) + "'"), this.parseError(Jt, {
222
+ text: A.match,
223
+ token: this.terminals_[M] || M,
224
+ line: A.yylineno,
225
+ loc: Kt,
226
+ expected: Ft
227
+ });
228
+ }
229
+ if (V[0] instanceof Array && V.length > 1)
230
+ throw new Error("Parse Error: multiple actions possible at state: " + St + ", token: " + M);
231
+ switch (V[0]) {
232
+ case 1:
233
+ E.push(M), D.push(A.yytext), o.push(A.yylloc), E.push(V[1]), M = null, le = A.yyleng, f = A.yytext, vt = A.yylineno, Kt = A.yylloc;
234
+ break;
235
+ case 2:
236
+ if (z = this.productions_[V[1]][1], Ct.$ = D[D.length - z], Ct._$ = {
237
+ first_line: o[o.length - (z || 1)].first_line,
238
+ last_line: o[o.length - 1].last_line,
239
+ first_column: o[o.length - (z || 1)].first_column,
240
+ last_column: o[o.length - 1].last_column
241
+ }, Ae && (Ct._$.range = [
242
+ o[o.length - (z || 1)].range[0],
243
+ o[o.length - 1].range[1]
244
+ ]), Gt = this.performAction.apply(Ct, [
245
+ f,
246
+ le,
247
+ vt,
248
+ Et.yy,
249
+ V[1],
250
+ D,
251
+ o
252
+ ].concat(Ne)), typeof Gt < "u")
253
+ return Gt;
254
+ z && (E = E.slice(0, -1 * z * 2), D = D.slice(0, -1 * z), o = o.slice(0, -1 * z)), E.push(this.productions_[V[1]][0]), D.push(Ct.$), o.push(Ct._$), he = Dt[E[E.length - 2]][E[E.length - 1]], E.push(he);
255
+ break;
256
+ case 3:
257
+ return !0;
258
+ }
259
+ }
260
+ return !0;
261
+ }, "parse")
262
+ }, Pe = /* @__PURE__ */ (function() {
263
+ var _t = {
264
+ EOF: 1,
265
+ parseError: /* @__PURE__ */ d(function(x, E) {
266
+ if (this.yy.parser)
267
+ this.yy.parser.parseError(x, E);
268
+ else
269
+ throw new Error(x);
270
+ }, "parseError"),
271
+ // resets the lexer, sets new input
272
+ setInput: /* @__PURE__ */ d(function(m, x) {
273
+ return this.yy = x || this.yy || {}, this._input = m, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
274
+ first_line: 1,
275
+ first_column: 0,
276
+ last_line: 1,
277
+ last_column: 0
278
+ }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
279
+ }, "setInput"),
280
+ // consumes and returns one char from the input
281
+ input: /* @__PURE__ */ d(function() {
282
+ var m = this._input[0];
283
+ this.yytext += m, this.yyleng++, this.offset++, this.match += m, this.matched += m;
284
+ var x = m.match(/(?:\r\n?|\n).*/g);
285
+ return x ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), m;
286
+ }, "input"),
287
+ // unshifts one char (or a string) into the input
288
+ unput: /* @__PURE__ */ d(function(m) {
289
+ var x = m.length, E = m.split(/(?:\r\n?|\n)/g);
290
+ this._input = m + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - x), this.offset -= x;
291
+ var _ = this.match.split(/(?:\r\n?|\n)/g);
292
+ this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), E.length - 1 && (this.yylineno -= E.length - 1);
293
+ var D = this.yylloc.range;
294
+ return this.yylloc = {
295
+ first_line: this.yylloc.first_line,
296
+ last_line: this.yylineno + 1,
297
+ first_column: this.yylloc.first_column,
298
+ last_column: E ? (E.length === _.length ? this.yylloc.first_column : 0) + _[_.length - E.length].length - E[0].length : this.yylloc.first_column - x
299
+ }, this.options.ranges && (this.yylloc.range = [D[0], D[0] + this.yyleng - x]), this.yyleng = this.yytext.length, this;
300
+ }, "unput"),
301
+ // When called from action, caches matched text and appends it on next action
302
+ more: /* @__PURE__ */ d(function() {
303
+ return this._more = !0, this;
304
+ }, "more"),
305
+ // 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.
306
+ reject: /* @__PURE__ */ d(function() {
307
+ if (this.options.backtrack_lexer)
308
+ this._backtrack = !0;
309
+ else
310
+ 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).
311
+ ` + this.showPosition(), {
312
+ text: "",
313
+ token: null,
314
+ line: this.yylineno
315
+ });
316
+ return this;
317
+ }, "reject"),
318
+ // retain first n characters of the match
319
+ less: /* @__PURE__ */ d(function(m) {
320
+ this.unput(this.match.slice(m));
321
+ }, "less"),
322
+ // displays already matched input, i.e. for error messages
323
+ pastInput: /* @__PURE__ */ d(function() {
324
+ var m = this.matched.substr(0, this.matched.length - this.match.length);
325
+ return (m.length > 20 ? "..." : "") + m.substr(-20).replace(/\n/g, "");
326
+ }, "pastInput"),
327
+ // displays upcoming input, i.e. for error messages
328
+ upcomingInput: /* @__PURE__ */ d(function() {
329
+ var m = this.match;
330
+ return m.length < 20 && (m += this._input.substr(0, 20 - m.length)), (m.substr(0, 20) + (m.length > 20 ? "..." : "")).replace(/\n/g, "");
331
+ }, "upcomingInput"),
332
+ // displays the character position where the lexing error occurred, i.e. for error messages
333
+ showPosition: /* @__PURE__ */ d(function() {
334
+ var m = this.pastInput(), x = new Array(m.length + 1).join("-");
335
+ return m + this.upcomingInput() + `
336
+ ` + x + "^";
337
+ }, "showPosition"),
338
+ // test the lexed token: return FALSE when not a match, otherwise return token
339
+ test_match: /* @__PURE__ */ d(function(m, x) {
340
+ var E, _, D;
341
+ if (this.options.backtrack_lexer && (D = {
342
+ yylineno: this.yylineno,
343
+ yylloc: {
344
+ first_line: this.yylloc.first_line,
345
+ last_line: this.last_line,
346
+ first_column: this.yylloc.first_column,
347
+ last_column: this.yylloc.last_column
348
+ },
349
+ yytext: this.yytext,
350
+ match: this.match,
351
+ matches: this.matches,
352
+ matched: this.matched,
353
+ yyleng: this.yyleng,
354
+ offset: this.offset,
355
+ _more: this._more,
356
+ _input: this._input,
357
+ yy: this.yy,
358
+ conditionStack: this.conditionStack.slice(0),
359
+ done: this.done
360
+ }, this.options.ranges && (D.yylloc.range = this.yylloc.range.slice(0))), _ = m[0].match(/(?:\r\n?|\n).*/g), _ && (this.yylineno += _.length), this.yylloc = {
361
+ first_line: this.yylloc.last_line,
362
+ last_line: this.yylineno + 1,
363
+ first_column: this.yylloc.last_column,
364
+ last_column: _ ? _[_.length - 1].length - _[_.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + m[0].length
365
+ }, this.yytext += m[0], this.match += m[0], this.matches = m, this.yyleng = this.yytext.length, this.options.ranges && (this.yylloc.range = [this.offset, this.offset += this.yyleng]), this._more = !1, this._backtrack = !1, this._input = this._input.slice(m[0].length), this.matched += m[0], E = this.performAction.call(this, this.yy, this, x, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), E)
366
+ return E;
367
+ if (this._backtrack) {
368
+ for (var o in D)
369
+ this[o] = D[o];
370
+ return !1;
371
+ }
372
+ return !1;
373
+ }, "test_match"),
374
+ // return next match in input
375
+ next: /* @__PURE__ */ d(function() {
376
+ if (this.done)
377
+ return this.EOF;
378
+ this._input || (this.done = !0);
379
+ var m, x, E, _;
380
+ this._more || (this.yytext = "", this.match = "");
381
+ for (var D = this._currentRules(), o = 0; o < D.length; o++)
382
+ if (E = this._input.match(this.rules[D[o]]), E && (!x || E[0].length > x[0].length)) {
383
+ if (x = E, _ = o, this.options.backtrack_lexer) {
384
+ if (m = this.test_match(E, D[o]), m !== !1)
385
+ return m;
386
+ if (this._backtrack) {
387
+ x = !1;
388
+ continue;
389
+ } else
390
+ return !1;
391
+ } else if (!this.options.flex)
392
+ break;
393
+ }
394
+ return x ? (m = this.test_match(x, D[_]), m !== !1 ? m : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
395
+ ` + this.showPosition(), {
396
+ text: "",
397
+ token: null,
398
+ line: this.yylineno
399
+ });
400
+ }, "next"),
401
+ // return next match that has a token
402
+ lex: /* @__PURE__ */ d(function() {
403
+ var x = this.next();
404
+ return x || this.lex();
405
+ }, "lex"),
406
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
407
+ begin: /* @__PURE__ */ d(function(x) {
408
+ this.conditionStack.push(x);
409
+ }, "begin"),
410
+ // pop the previously active lexer condition state off the condition stack
411
+ popState: /* @__PURE__ */ d(function() {
412
+ var x = this.conditionStack.length - 1;
413
+ return x > 0 ? this.conditionStack.pop() : this.conditionStack[0];
414
+ }, "popState"),
415
+ // produce the lexer rule set which is active for the currently active lexer condition state
416
+ _currentRules: /* @__PURE__ */ d(function() {
417
+ return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
418
+ }, "_currentRules"),
419
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
420
+ topState: /* @__PURE__ */ d(function(x) {
421
+ return x = this.conditionStack.length - 1 - Math.abs(x || 0), x >= 0 ? this.conditionStack[x] : "INITIAL";
422
+ }, "topState"),
423
+ // alias for begin(condition)
424
+ pushState: /* @__PURE__ */ d(function(x) {
425
+ this.begin(x);
426
+ }, "pushState"),
427
+ // return the number of states currently on the stack
428
+ stateStackSize: /* @__PURE__ */ d(function() {
429
+ return this.conditionStack.length;
430
+ }, "stateStackSize"),
431
+ options: {},
432
+ performAction: /* @__PURE__ */ d(function(x, E, _, D) {
433
+ switch (_) {
434
+ case 0:
435
+ return 6;
436
+ case 1:
437
+ return 7;
438
+ case 2:
439
+ return 8;
440
+ case 3:
441
+ return 9;
442
+ case 4:
443
+ return 22;
444
+ case 5:
445
+ return 23;
446
+ case 6:
447
+ return this.begin("acc_title"), 24;
448
+ case 7:
449
+ return this.popState(), "acc_title_value";
450
+ case 8:
451
+ return this.begin("acc_descr"), 26;
452
+ case 9:
453
+ return this.popState(), "acc_descr_value";
454
+ case 10:
455
+ this.begin("acc_descr_multiline");
456
+ break;
457
+ case 11:
458
+ this.popState();
459
+ break;
460
+ case 12:
461
+ return "acc_descr_multiline_value";
462
+ case 13:
463
+ break;
464
+ case 14:
465
+ c;
466
+ break;
467
+ case 15:
468
+ return 12;
469
+ case 16:
470
+ break;
471
+ case 17:
472
+ return 11;
473
+ case 18:
474
+ return 15;
475
+ case 19:
476
+ return 16;
477
+ case 20:
478
+ return 17;
479
+ case 21:
480
+ return 18;
481
+ case 22:
482
+ return this.begin("person_ext"), 45;
483
+ case 23:
484
+ return this.begin("person"), 44;
485
+ case 24:
486
+ return this.begin("system_ext_queue"), 51;
487
+ case 25:
488
+ return this.begin("system_ext_db"), 50;
489
+ case 26:
490
+ return this.begin("system_ext"), 49;
491
+ case 27:
492
+ return this.begin("system_queue"), 48;
493
+ case 28:
494
+ return this.begin("system_db"), 47;
495
+ case 29:
496
+ return this.begin("system"), 46;
497
+ case 30:
498
+ return this.begin("boundary"), 37;
499
+ case 31:
500
+ return this.begin("enterprise_boundary"), 34;
501
+ case 32:
502
+ return this.begin("system_boundary"), 36;
503
+ case 33:
504
+ return this.begin("container_ext_queue"), 57;
505
+ case 34:
506
+ return this.begin("container_ext_db"), 56;
507
+ case 35:
508
+ return this.begin("container_ext"), 55;
509
+ case 36:
510
+ return this.begin("container_queue"), 54;
511
+ case 37:
512
+ return this.begin("container_db"), 53;
513
+ case 38:
514
+ return this.begin("container"), 52;
515
+ case 39:
516
+ return this.begin("container_boundary"), 38;
517
+ case 40:
518
+ return this.begin("component_ext_queue"), 63;
519
+ case 41:
520
+ return this.begin("component_ext_db"), 62;
521
+ case 42:
522
+ return this.begin("component_ext"), 61;
523
+ case 43:
524
+ return this.begin("component_queue"), 60;
525
+ case 44:
526
+ return this.begin("component_db"), 59;
527
+ case 45:
528
+ return this.begin("component"), 58;
529
+ case 46:
530
+ return this.begin("node"), 39;
531
+ case 47:
532
+ return this.begin("node"), 39;
533
+ case 48:
534
+ return this.begin("node_l"), 40;
535
+ case 49:
536
+ return this.begin("node_r"), 41;
537
+ case 50:
538
+ return this.begin("rel"), 64;
539
+ case 51:
540
+ return this.begin("birel"), 65;
541
+ case 52:
542
+ return this.begin("rel_u"), 66;
543
+ case 53:
544
+ return this.begin("rel_u"), 66;
545
+ case 54:
546
+ return this.begin("rel_d"), 67;
547
+ case 55:
548
+ return this.begin("rel_d"), 67;
549
+ case 56:
550
+ return this.begin("rel_l"), 68;
551
+ case 57:
552
+ return this.begin("rel_l"), 68;
553
+ case 58:
554
+ return this.begin("rel_r"), 69;
555
+ case 59:
556
+ return this.begin("rel_r"), 69;
557
+ case 60:
558
+ return this.begin("rel_b"), 70;
559
+ case 61:
560
+ return this.begin("rel_index"), 71;
561
+ case 62:
562
+ return this.begin("update_el_style"), 72;
563
+ case 63:
564
+ return this.begin("update_rel_style"), 73;
565
+ case 64:
566
+ return this.begin("update_layout_config"), 74;
567
+ case 65:
568
+ return "EOF_IN_STRUCT";
569
+ case 66:
570
+ return this.begin("attribute"), "ATTRIBUTE_EMPTY";
571
+ case 67:
572
+ this.begin("attribute");
573
+ break;
574
+ case 68:
575
+ this.popState(), this.popState();
576
+ break;
577
+ case 69:
578
+ return 80;
579
+ case 70:
580
+ break;
581
+ case 71:
582
+ return 80;
583
+ case 72:
584
+ this.begin("string");
585
+ break;
586
+ case 73:
587
+ this.popState();
588
+ break;
589
+ case 74:
590
+ return "STR";
591
+ case 75:
592
+ this.begin("string_kv");
593
+ break;
594
+ case 76:
595
+ return this.begin("string_kv_key"), "STR_KEY";
596
+ case 77:
597
+ this.popState(), this.begin("string_kv_value");
598
+ break;
599
+ case 78:
600
+ return "STR_VALUE";
601
+ case 79:
602
+ this.popState(), this.popState();
603
+ break;
604
+ case 80:
605
+ return "STR";
606
+ case 81:
607
+ return "LBRACE";
608
+ case 82:
609
+ return "RBRACE";
610
+ case 83:
611
+ return "SPACE";
612
+ case 84:
613
+ return "EOL";
614
+ case 85:
615
+ return 14;
616
+ }
617
+ }, "anonymous"),
618
+ 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]+)/, /^(?:$)/],
619
+ conditions: { acc_descr_multiline: { rules: [11, 12], inclusive: !1 }, acc_descr: { rules: [9], inclusive: !1 }, acc_title: { rules: [7], inclusive: !1 }, string_kv_value: { rules: [78, 79], inclusive: !1 }, string_kv_key: { rules: [77], inclusive: !1 }, string_kv: { rules: [76], inclusive: !1 }, string: { rules: [73, 74], inclusive: !1 }, attribute: { rules: [68, 69, 70, 71, 72, 75, 80], inclusive: !1 }, update_layout_config: { rules: [65, 66, 67, 68], inclusive: !1 }, update_rel_style: { rules: [65, 66, 67, 68], inclusive: !1 }, update_el_style: { rules: [65, 66, 67, 68], inclusive: !1 }, rel_b: { rules: [65, 66, 67, 68], inclusive: !1 }, rel_r: { rules: [65, 66, 67, 68], inclusive: !1 }, rel_l: { rules: [65, 66, 67, 68], inclusive: !1 }, rel_d: { rules: [65, 66, 67, 68], inclusive: !1 }, rel_u: { rules: [65, 66, 67, 68], inclusive: !1 }, rel_bi: { rules: [], inclusive: !1 }, rel: { rules: [65, 66, 67, 68], inclusive: !1 }, node_r: { rules: [65, 66, 67, 68], inclusive: !1 }, node_l: { rules: [65, 66, 67, 68], inclusive: !1 }, node: { rules: [65, 66, 67, 68], inclusive: !1 }, index: { rules: [], inclusive: !1 }, rel_index: { rules: [65, 66, 67, 68], inclusive: !1 }, component_ext_queue: { rules: [65, 66, 67, 68], inclusive: !1 }, component_ext_db: { rules: [65, 66, 67, 68], inclusive: !1 }, component_ext: { rules: [65, 66, 67, 68], inclusive: !1 }, component_queue: { rules: [65, 66, 67, 68], inclusive: !1 }, component_db: { rules: [65, 66, 67, 68], inclusive: !1 }, component: { rules: [65, 66, 67, 68], inclusive: !1 }, container_boundary: { rules: [65, 66, 67, 68], inclusive: !1 }, container_ext_queue: { rules: [65, 66, 67, 68], inclusive: !1 }, container_ext_db: { rules: [65, 66, 67, 68], inclusive: !1 }, container_ext: { rules: [65, 66, 67, 68], inclusive: !1 }, container_queue: { rules: [65, 66, 67, 68], inclusive: !1 }, container_db: { rules: [65, 66, 67, 68], inclusive: !1 }, container: { rules: [65, 66, 67, 68], inclusive: !1 }, birel: { rules: [65, 66, 67, 68], inclusive: !1 }, system_boundary: { rules: [65, 66, 67, 68], inclusive: !1 }, enterprise_boundary: { rules: [65, 66, 67, 68], inclusive: !1 }, boundary: { rules: [65, 66, 67, 68], inclusive: !1 }, system_ext_queue: { rules: [65, 66, 67, 68], inclusive: !1 }, system_ext_db: { rules: [65, 66, 67, 68], inclusive: !1 }, system_ext: { rules: [65, 66, 67, 68], inclusive: !1 }, system_queue: { rules: [65, 66, 67, 68], inclusive: !1 }, system_db: { rules: [65, 66, 67, 68], inclusive: !1 }, system: { rules: [65, 66, 67, 68], inclusive: !1 }, person_ext: { rules: [65, 66, 67, 68], inclusive: !1 }, person: { rules: [65, 66, 67, 68], inclusive: !1 }, 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: !0 } }
620
+ };
621
+ return _t;
622
+ })();
623
+ Ht.lexer = Pe;
624
+ function Vt() {
625
+ this.yy = {};
626
+ }
627
+ return d(Vt, "Parser"), Vt.prototype = Ht, Ht.Parser = Vt, new Vt();
628
+ })();
629
+ jt.parser = jt;
630
+ var Xe = jt, be = /* @__PURE__ */ d((t) => Ot()[t], "getRequiredConfig"), Y = /* @__PURE__ */ new Set(["label", "descr", "techn", "type"]), Tt = /* @__PURE__ */ d((t, e) => {
631
+ for (const [a, i] of Object.entries(e))
632
+ if (i !== void 0)
633
+ if (typeof i == "object") {
634
+ const [u, r] = Object.entries(i)[0];
635
+ t[u] = Y.has(u) ? { text: r } : r;
636
+ } else
637
+ t[a] = i;
638
+ }, "assignAttributes"), xe = /* @__PURE__ */ d(() => ({
639
+ alias: "global",
640
+ label: { text: "global" },
641
+ type: { text: "global" },
642
+ tags: null,
643
+ link: null,
644
+ parentBoundary: ""
645
+ // The layout fields are populated later by the renderer.
646
+ }), "createGlobalBoundary"), U = [], gt = [""], L = "global", F = "", j = [xe()], Mt = [], ae = "", re = !1, zt = 4, Wt = 2, ve, qe = /* @__PURE__ */ d(function() {
647
+ return ve;
648
+ }, "getC4Type"), He = /* @__PURE__ */ d(function(t) {
649
+ ve = me(t, Ot());
650
+ }, "setC4Type"), Qe = /* @__PURE__ */ d(function(t, e, a, i, u, r, n, l, s) {
651
+ if (t == null || e === void 0 || e === null || a === void 0 || a === null || i === void 0 || i === null)
652
+ return;
653
+ let h = {};
654
+ const y = Mt.find((p) => p.from === e && p.to === a);
655
+ if (y ? h = y : Mt.push(h), h.type = t, h.from = e, h.to = a, h.label = { text: i }, u == null)
656
+ h.techn ??= { text: "" };
657
+ else if (typeof u == "object") {
658
+ const [p, g] = Object.entries(u)[0];
659
+ h[p] = Y.has(p) ? { text: g } : g;
660
+ } else
661
+ h.techn = { text: u };
662
+ if (r == null)
663
+ h.descr ??= { text: "" };
664
+ else if (typeof r == "object") {
665
+ const [p, g] = Object.entries(r)[0];
666
+ h[p] = Y.has(p) ? { text: g } : g;
667
+ } else
668
+ h.descr = { text: r };
669
+ Tt(h, { sprite: n, tags: l, link: s }), h.wrap = bt();
670
+ }, "addRel"), Ke = /* @__PURE__ */ d(function(t, e, a, i, u, r, n) {
671
+ if (e === null || a === null)
672
+ return;
673
+ let l = {};
674
+ const s = U.find((h) => h.alias === e);
675
+ if (s && e === s.alias ? l = s : (l.alias = e, U.push(l)), a == null ? l.label = { text: "" } : l.label = { text: a }, i == null)
676
+ l.descr ??= { text: "" };
677
+ else if (typeof i == "object") {
678
+ const [h, y] = Object.entries(i)[0];
679
+ l[h] = Y.has(h) ? { text: y } : y;
680
+ } else
681
+ l.descr = { text: i };
682
+ Tt(l, { sprite: u, tags: r, link: n }), l.typeC4Shape = { text: t }, l.parentBoundary = L, l.wrap = bt();
683
+ }, "addPersonOrSystem"), Ge = /* @__PURE__ */ d(function(t, e, a, i, u, r, n, l) {
684
+ if (e === null || a === null)
685
+ return;
686
+ let s = {};
687
+ const h = U.find((y) => y.alias === e);
688
+ if (h && e === h.alias ? s = h : (s.alias = e, U.push(s)), a == null ? s.label = { text: "" } : s.label = { text: a }, i == null)
689
+ s.techn ??= { text: "" };
690
+ else if (typeof i == "object") {
691
+ const [y, p] = Object.entries(i)[0];
692
+ s[y] = Y.has(y) ? { text: p } : p;
693
+ } else
694
+ s.techn = { text: i };
695
+ if (u == null)
696
+ s.descr ??= { text: "" };
697
+ else if (typeof u == "object") {
698
+ const [y, p] = Object.entries(u)[0];
699
+ s[y] = Y.has(y) ? { text: p } : p;
700
+ } else
701
+ s.descr = { text: u };
702
+ Tt(s, { sprite: r, tags: n, link: l }), s.wrap = bt(), s.typeC4Shape = { text: t }, s.parentBoundary = L;
703
+ }, "addContainer"), Je = /* @__PURE__ */ d(function(t, e, a, i, u, r, n, l) {
704
+ if (e === null || a === null)
705
+ return;
706
+ let s = {};
707
+ const h = U.find((y) => y.alias === e);
708
+ if (h && e === h.alias ? s = h : (s.alias = e, U.push(s)), a == null ? s.label = { text: "" } : s.label = { text: a }, i == null)
709
+ s.techn ??= { text: "" };
710
+ else if (typeof i == "object") {
711
+ const [y, p] = Object.entries(i)[0];
712
+ s[y] = Y.has(y) ? { text: p } : p;
713
+ } else
714
+ s.techn = { text: i };
715
+ if (u == null)
716
+ s.descr ??= { text: "" };
717
+ else if (typeof u == "object") {
718
+ const [y, p] = Object.entries(u)[0];
719
+ s[y] = Y.has(y) ? { text: p } : p;
720
+ } else
721
+ s.descr = { text: u };
722
+ Tt(s, { sprite: r, tags: n, link: l }), s.wrap = bt(), s.typeC4Shape = { text: t }, s.parentBoundary = L;
723
+ }, "addComponent"), Ze = /* @__PURE__ */ d(function(t, e, a, i, u) {
724
+ if (t === null || e === null)
725
+ return;
726
+ let r = {};
727
+ const n = j.find((l) => l.alias === t);
728
+ if (n && t === n.alias ? r = n : (r.alias = t, j.push(r)), e == null ? r.label = { text: "" } : r.label = { text: e }, a == null)
729
+ r.type = { text: "system" };
730
+ else if (typeof a == "object") {
731
+ const [l, s] = Object.entries(a)[0];
732
+ r[l] = Y.has(l) ? { text: s } : s;
733
+ } else
734
+ r.type = { text: a };
735
+ Tt(r, { tags: i, link: u }), r.parentBoundary = L, r.wrap = bt(), F = L, L = t, gt.push(F);
736
+ }, "addPersonOrSystemBoundary"), $e = /* @__PURE__ */ d(function(t, e, a, i, u) {
737
+ if (t === null || e === null)
738
+ return;
739
+ let r = {};
740
+ const n = j.find((l) => l.alias === t);
741
+ if (n && t === n.alias ? r = n : (r.alias = t, j.push(r)), e == null ? r.label = { text: "" } : r.label = { text: e }, a == null)
742
+ r.type = { text: "container" };
743
+ else if (typeof a == "object") {
744
+ const [l, s] = Object.entries(a)[0];
745
+ r[l] = Y.has(l) ? { text: s } : s;
746
+ } else
747
+ r.type = { text: a };
748
+ Tt(r, { tags: i, link: u }), r.parentBoundary = L, r.wrap = bt(), F = L, L = t, gt.push(F);
749
+ }, "addContainerBoundary"), t0 = /* @__PURE__ */ d(function(t, e, a, i, u, r, n, l) {
750
+ if (e === null || a === null)
751
+ return;
752
+ let s = {};
753
+ const h = j.find((y) => y.alias === e);
754
+ if (h && e === h.alias ? s = h : (s.alias = e, j.push(s)), a == null ? s.label = { text: "" } : s.label = { text: a }, i == null)
755
+ s.type = { text: "node" };
756
+ else if (typeof i == "object") {
757
+ const [y, p] = Object.entries(i)[0];
758
+ s[y] = Y.has(y) ? { text: p } : p;
759
+ } else
760
+ s.type = { text: i };
761
+ if (u == null)
762
+ s.descr ??= { text: "" };
763
+ else if (typeof u == "object") {
764
+ const [y, p] = Object.entries(u)[0];
765
+ s[y] = Y.has(y) ? { text: p } : p;
766
+ } else
767
+ s.descr = { text: u };
768
+ Tt(s, { tags: n, link: l }), s.nodeType = t, s.parentBoundary = L, s.wrap = bt(), F = L, L = e, gt.push(F);
769
+ }, "addDeploymentNode"), e0 = /* @__PURE__ */ d(function() {
770
+ L = F, gt.pop(), F = gt.pop(), gt.push(F);
771
+ }, "popBoundaryParseStack"), n0 = /* @__PURE__ */ d(function(t, e, a, i, u, r, n, l, s, h, y) {
772
+ let p = U.find(
773
+ (g) => g.alias === e
774
+ );
775
+ if (!(p === void 0 && (p = j.find((g) => g.alias === e), p === void 0))) {
776
+ if (a != null)
777
+ if (typeof a == "object") {
778
+ const [g, v] = Object.entries(a)[0];
779
+ p[g] = v;
780
+ } else
781
+ p.bgColor = a;
782
+ if (i != null)
783
+ if (typeof i == "object") {
784
+ const [g, v] = Object.entries(i)[0];
785
+ p[g] = v;
786
+ } else
787
+ p.fontColor = i;
788
+ if (u != null)
789
+ if (typeof u == "object") {
790
+ const [g, v] = Object.entries(u)[0];
791
+ p[g] = v;
792
+ } else
793
+ p.borderColor = u;
794
+ if (r != null)
795
+ if (typeof r == "object") {
796
+ const [g, v] = Object.entries(r)[0];
797
+ p[g] = v;
798
+ } else
799
+ p.shadowing = r;
800
+ if (n != null)
801
+ if (typeof n == "object") {
802
+ const [g, v] = Object.entries(n)[0];
803
+ p[g] = v;
804
+ } else
805
+ p.shape = n;
806
+ if (l != null)
807
+ if (typeof l == "object") {
808
+ const [g, v] = Object.entries(l)[0];
809
+ p[g] = v;
810
+ } else
811
+ p.sprite = l;
812
+ if (s != null)
813
+ if (typeof s == "object") {
814
+ const [g, v] = Object.entries(s)[0];
815
+ p[g] = v;
816
+ } else
817
+ p.techn = s;
818
+ if (h != null)
819
+ if (typeof h == "object") {
820
+ const [g, v] = Object.entries(h)[0];
821
+ p[g] = v;
822
+ } else
823
+ p.legendText = h;
824
+ if (y != null)
825
+ if (typeof y == "object") {
826
+ const [g, v] = Object.entries(y)[0];
827
+ p[g] = v;
828
+ } else
829
+ p.legendSprite = y;
830
+ }
831
+ }, "updateElStyle"), s0 = /* @__PURE__ */ d(function(t, e, a, i, u, r, n) {
832
+ const l = Mt.find((s) => s.from === e && s.to === a);
833
+ if (l !== void 0) {
834
+ if (i != null)
835
+ if (typeof i == "object") {
836
+ const [s, h] = Object.entries(i)[0];
837
+ l[s] = h;
838
+ } else
839
+ l.textColor = i;
840
+ if (u != null)
841
+ if (typeof u == "object") {
842
+ const [s, h] = Object.entries(u)[0];
843
+ l[s] = h;
844
+ } else
845
+ l.lineColor = u;
846
+ if (r != null)
847
+ if (typeof r == "object") {
848
+ const [s, h] = Object.entries(r)[0];
849
+ l[s] = parseInt(h);
850
+ } else
851
+ l.offsetX = parseInt(r);
852
+ if (n != null)
853
+ if (typeof n == "object") {
854
+ const [s, h] = Object.entries(n)[0];
855
+ l[s] = parseInt(h);
856
+ } else
857
+ l.offsetY = parseInt(n);
858
+ }
859
+ }, "updateRelStyle"), a0 = /* @__PURE__ */ d(function(t, e, a) {
860
+ let i = zt, u = Wt;
861
+ if (typeof e == "object") {
862
+ const r = Object.values(e)[0];
863
+ i = parseInt(r);
864
+ } else
865
+ i = parseInt(e);
866
+ if (typeof a == "object") {
867
+ const r = Object.values(a)[0];
868
+ u = parseInt(r);
869
+ } else
870
+ u = parseInt(a);
871
+ i >= 1 && (zt = i), u >= 1 && (Wt = u);
872
+ }, "updateLayoutConfig"), r0 = /* @__PURE__ */ d(function() {
873
+ return zt;
874
+ }, "getC4ShapeInRow"), i0 = /* @__PURE__ */ d(function() {
875
+ return Wt;
876
+ }, "getC4BoundaryInRow"), o0 = /* @__PURE__ */ d(function() {
877
+ return L;
878
+ }, "getCurrentBoundaryParse"), l0 = /* @__PURE__ */ d(function() {
879
+ return F;
880
+ }, "getParentBoundaryParse"), Ee = /* @__PURE__ */ d(function(t) {
881
+ return t == null ? U : U.filter((e) => e.parentBoundary === t);
882
+ }, "getC4ShapeArray"), c0 = /* @__PURE__ */ d(function(t) {
883
+ return U.find((e) => e.alias === t) ?? j.find((e) => e.alias === t);
884
+ }, "getC4Shape"), u0 = /* @__PURE__ */ d(function(t) {
885
+ return Object.keys(Ee(t));
886
+ }, "getC4ShapeKeys"), Se = /* @__PURE__ */ d(function(t) {
887
+ return t == null ? j : j.filter((e) => e.parentBoundary === t);
888
+ }, "getBoundaries"), h0 = Se, d0 = /* @__PURE__ */ d(function() {
889
+ return Mt;
890
+ }, "getRels"), p0 = /* @__PURE__ */ d(function() {
891
+ return ae;
892
+ }, "getTitle"), f0 = /* @__PURE__ */ d(function(t) {
893
+ re = t;
894
+ }, "setWrap"), bt = /* @__PURE__ */ d(function() {
895
+ return re;
896
+ }, "autoWrap"), y0 = /* @__PURE__ */ d(function() {
897
+ U = [], j = [xe()], F = "", L = "global", gt = [""], Mt = [], gt = [""], ae = "", re = !1, zt = 4, Wt = 2;
898
+ }, "clear"), _0 = {
899
+ SOLID: 0,
900
+ DOTTED: 1,
901
+ NOTE: 2,
902
+ SOLID_CROSS: 3,
903
+ DOTTED_CROSS: 4,
904
+ SOLID_OPEN: 5,
905
+ DOTTED_OPEN: 6,
906
+ LOOP_START: 10,
907
+ LOOP_END: 11,
908
+ ALT_START: 12,
909
+ ALT_ELSE: 13,
910
+ ALT_END: 14,
911
+ OPT_START: 15,
912
+ OPT_END: 16,
913
+ ACTIVE_START: 17,
914
+ ACTIVE_END: 18,
915
+ PAR_START: 19,
916
+ PAR_AND: 20,
917
+ PAR_END: 21,
918
+ RECT_START: 22,
919
+ RECT_END: 23,
920
+ SOLID_POINT: 24,
921
+ DOTTED_POINT: 25
922
+ }, g0 = {
923
+ FILLED: 0,
924
+ OPEN: 1
925
+ }, m0 = {
926
+ LEFTOF: 0,
927
+ RIGHTOF: 1,
928
+ OVER: 2
929
+ }, b0 = /* @__PURE__ */ d(function(t) {
930
+ ae = me(t, Ot());
931
+ }, "setTitle"), ee = {
932
+ addPersonOrSystem: Ke,
933
+ addPersonOrSystemBoundary: Ze,
934
+ addContainer: Ge,
935
+ addContainerBoundary: $e,
936
+ addComponent: Je,
937
+ addDeploymentNode: t0,
938
+ popBoundaryParseStack: e0,
939
+ addRel: Qe,
940
+ updateElStyle: n0,
941
+ updateRelStyle: s0,
942
+ updateLayoutConfig: a0,
943
+ autoWrap: bt,
944
+ setWrap: f0,
945
+ getC4ShapeArray: Ee,
946
+ getC4Shape: c0,
947
+ getC4ShapeKeys: u0,
948
+ getBoundaries: Se,
949
+ getBoundarys: h0,
950
+ getCurrentBoundaryParse: o0,
951
+ getParentBoundaryParse: l0,
952
+ getRels: d0,
953
+ getTitle: p0,
954
+ getC4Type: qe,
955
+ getC4ShapeInRow: r0,
956
+ getC4BoundaryInRow: i0,
957
+ setAccTitle: Ye,
958
+ getAccTitle: Ve,
959
+ getAccDescription: Be,
960
+ setAccDescription: Me,
961
+ getConfig: /* @__PURE__ */ d(() => be("c4"), "getConfig"),
962
+ clear: y0,
963
+ LINETYPE: _0,
964
+ ARROWTYPE: g0,
965
+ PLACEMENT: m0,
966
+ setTitle: b0,
967
+ setC4Type: He
968
+ // apply,
969
+ }, Te = /* @__PURE__ */ d(function(t, e) {
970
+ return Ie(t, e);
971
+ }, "drawRect"), x0 = /* @__PURE__ */ d((t, e, a, i) => {
972
+ const u = t.append("g");
973
+ let r = 0;
974
+ for (const n of e) {
975
+ const l = n.textColor ? n.textColor : "#444444", s = n.lineColor ? n.lineColor : "#444444", h = n.offsetX ? parseInt(String(n.offsetX)) : 0, y = n.offsetY ? parseInt(String(n.offsetY)) : 0, p = "";
976
+ if (r === 0) {
977
+ const w = u.append("line");
978
+ w.attr("x1", n.startPoint.x), w.attr("y1", n.startPoint.y), w.attr("x2", n.endPoint.x), w.attr("y2", n.endPoint.y), w.attr("stroke-width", "1"), w.attr("stroke", s), w.style("fill", "none"), n.type !== "rel_b" && w.attr("marker-end", "url(" + p + "#" + i + "-arrowhead)"), (n.type === "birel" || n.type === "rel_b") && w.attr("marker-start", "url(" + p + "#" + i + "-arrowend)"), r = -1;
979
+ } else {
980
+ const w = u.append("path");
981
+ w.attr("fill", "none").attr("stroke-width", "1").attr("stroke", s).attr(
982
+ "d",
983
+ "Mstartx,starty Qcontrolx,controly stopx,stopy ".replaceAll("startx", n.startPoint.x).replaceAll("starty", n.startPoint.y).replaceAll(
984
+ "controlx",
985
+ n.startPoint.x + (n.endPoint.x - n.startPoint.x) / 2 - (n.endPoint.x - n.startPoint.x) / 4
986
+ ).replaceAll(
987
+ "controly",
988
+ n.startPoint.y + (n.endPoint.y - n.startPoint.y) / 2
989
+ ).replaceAll("stopx", n.endPoint.x).replaceAll("stopy", n.endPoint.y)
990
+ ), n.type !== "rel_b" && w.attr("marker-end", "url(" + p + "#" + i + "-arrowhead)"), (n.type === "birel" || n.type === "rel_b") && w.attr("marker-start", "url(" + p + "#" + i + "-arrowend)");
991
+ }
992
+ const g = n.label.width;
993
+ let v = a.messageFont();
994
+ At(a)(
995
+ n.label.text,
996
+ u,
997
+ Math.min(n.startPoint.x, n.endPoint.x) + Math.abs(n.endPoint.x - n.startPoint.x) / 2 + h,
998
+ Math.min(n.startPoint.y, n.endPoint.y) + Math.abs(n.endPoint.y - n.startPoint.y) / 2 + y,
999
+ g,
1000
+ n.label.height,
1001
+ { fill: l },
1002
+ v
1003
+ ), n.techn && n.techn.text !== "" && (v = a.messageFont(), At(a)(
1004
+ "[" + n.techn.text + "]",
1005
+ u,
1006
+ Math.min(n.startPoint.x, n.endPoint.x) + Math.abs(n.endPoint.x - n.startPoint.x) / 2 + h,
1007
+ Math.min(n.startPoint.y, n.endPoint.y) + Math.abs(n.endPoint.y - n.startPoint.y) / 2 + a.messageFontSize + 5 + y,
1008
+ Math.max(g, n.techn.width),
1009
+ n.techn.height,
1010
+ { fill: l, "font-style": "italic" },
1011
+ v
1012
+ ));
1013
+ }
1014
+ }, "drawRels"), v0 = /* @__PURE__ */ d(function(t, e, a) {
1015
+ const i = t.append("g"), u = e.bgColor ? e.bgColor : "none", r = e.borderColor ? e.borderColor : "#444444", n = e.fontColor ? e.fontColor : "black";
1016
+ let l = {
1017
+ "stroke-width": 1,
1018
+ "stroke-dasharray": "7.0,7.0"
1019
+ };
1020
+ e.nodeType && (l = { "stroke-width": 1 });
1021
+ const s = {
1022
+ x: e.x,
1023
+ y: e.y,
1024
+ fill: u,
1025
+ stroke: r,
1026
+ width: e.width,
1027
+ height: e.height,
1028
+ rx: 2.5,
1029
+ ry: 2.5,
1030
+ attrs: l
1031
+ };
1032
+ Te(i, s);
1033
+ let h = a.boundaryFont();
1034
+ h.fontWeight = "bold", h.fontSize = h.fontSize + 2, h.fontColor = n, At(a)(
1035
+ e.label.text,
1036
+ i,
1037
+ e.x,
1038
+ e.y + e.label.Y,
1039
+ e.width,
1040
+ e.height,
1041
+ { fill: "#444444" },
1042
+ h
1043
+ ), e.type && e.type.text !== "" && (h = a.boundaryFont(), h.fontColor = n, At(a)(
1044
+ e.type.text,
1045
+ i,
1046
+ e.x,
1047
+ e.y + e.type.Y,
1048
+ e.width,
1049
+ e.height,
1050
+ { fill: "#444444" },
1051
+ h
1052
+ )), e.descr && e.descr.text !== "" && (h = a.boundaryFont(), h.fontSize = h.fontSize - 2, h.fontColor = n, At(a)(
1053
+ e.descr.text,
1054
+ i,
1055
+ e.x,
1056
+ e.y + e.descr.Y,
1057
+ e.width,
1058
+ e.height,
1059
+ { fill: "#444444" },
1060
+ h
1061
+ ));
1062
+ }, "drawBoundary"), E0 = /* @__PURE__ */ d(function(t, e) {
1063
+ t.append("defs").append("symbol").attr("id", e + "-database").attr("fill-rule", "evenodd").attr("clip-rule", "evenodd").append("path").attr("transform", "scale(.5)").attr(
1064
+ "d",
1065
+ "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"
1066
+ );
1067
+ }, "insertDatabaseIcon"), S0 = /* @__PURE__ */ d(function(t, e) {
1068
+ t.append("defs").append("symbol").attr("id", e + "-computer").attr("width", "24").attr("height", "24").append("path").attr("transform", "scale(.5)").attr(
1069
+ "d",
1070
+ "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"
1071
+ );
1072
+ }, "insertComputerIcon"), T0 = /* @__PURE__ */ d(function(t, e) {
1073
+ t.append("defs").append("symbol").attr("id", e + "-clock").attr("width", "24").attr("height", "24").append("path").attr("transform", "scale(.5)").attr(
1074
+ "d",
1075
+ "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"
1076
+ );
1077
+ }, "insertClockIcon"), k0 = /* @__PURE__ */ d(function(t, e) {
1078
+ t.append("defs").append("marker").attr("id", e + "-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");
1079
+ }, "insertArrowHead"), C0 = /* @__PURE__ */ d(function(t, e) {
1080
+ t.append("defs").append("marker").attr("id", e + "-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");
1081
+ }, "insertArrowEnd"), R0 = /* @__PURE__ */ d(function(t, e) {
1082
+ t.append("defs").append("marker").attr("id", e + "-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");
1083
+ }, "insertArrowFilledHead"), w0 = /* @__PURE__ */ d(function(t, e) {
1084
+ const i = t.append("defs").append("marker").attr("id", e + "-crosshead").attr("markerWidth", 15).attr("markerHeight", 8).attr("orient", "auto").attr("refX", 16).attr("refY", 4);
1085
+ i.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"), i.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");
1086
+ }, "insertArrowCrossHead"), At = /* @__PURE__ */ (function() {
1087
+ function t(u, r, n, l, s, h, y) {
1088
+ const p = r.append("text").attr("x", n + s / 2).attr("y", l + h / 2 + 5).style("text-anchor", "middle").text(u);
1089
+ i(p, y);
1090
+ }
1091
+ d(t, "byText");
1092
+ function e(u, r, n, l, s, h, y, p) {
1093
+ const { fontSize: g, fontFamily: v, fontWeight: w } = p, N = u.split(te.lineBreakRegex);
1094
+ for (let O = 0; O < N.length; O++) {
1095
+ const P = O * g - g * (N.length - 1) / 2, I = r.append("text").attr("x", n + s / 2).attr("y", l).style("text-anchor", "middle").attr("dominant-baseline", "middle").style("font-size", g).style("font-weight", w).style("font-family", v);
1096
+ I.append("tspan").attr("dy", P).text(N[O]).attr("alignment-baseline", "mathematical"), i(I, y);
1097
+ }
1098
+ }
1099
+ d(e, "byTspan");
1100
+ function a(u, r, n, l, s, h, y, p) {
1101
+ const g = r.append("switch"), w = g.append("foreignObject").attr("x", n).attr("y", l).attr("width", s).attr("height", h).append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
1102
+ w.append("div").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(u), e(u, g, n, l, s, h, y, p), i(w, y);
1103
+ }
1104
+ d(a, "byFo");
1105
+ function i(u, r) {
1106
+ for (const n in r)
1107
+ r.hasOwnProperty(n) && u.attr(n, r[n]);
1108
+ }
1109
+ return d(i, "_setTextAttrs"), function(u) {
1110
+ return u.textPlacement === "fo" ? a : u.textPlacement === "old" ? t : e;
1111
+ };
1112
+ })(), W = {
1113
+ drawRect: Te,
1114
+ drawBoundary: v0,
1115
+ drawRels: x0,
1116
+ insertArrowHead: k0,
1117
+ insertArrowEnd: C0,
1118
+ insertArrowFilledHead: R0,
1119
+ insertArrowCrossHead: w0,
1120
+ insertDatabaseIcon: E0,
1121
+ insertComputerIcon: S0,
1122
+ insertClockIcon: T0
1123
+ }, O0 = /* @__PURE__ */ d((t, e) => {
1124
+ if (e === "sandbox") {
1125
+ const i = Zt("#i" + t).node()?.contentDocument;
1126
+ if (!i)
1127
+ throw new Error(`Sandbox iframe #i${t} is missing its content document`);
1128
+ return { root: Zt(i.body), doc: i };
1129
+ }
1130
+ return { root: Zt("body"), doc: document };
1131
+ }, "getDiagramRoot"), P0 = /* @__PURE__ */ new Set([
1132
+ "system_queue",
1133
+ "external_system_queue",
1134
+ "container_queue",
1135
+ "external_container_queue",
1136
+ "component_queue",
1137
+ "external_component_queue"
1138
+ ]), D0 = /* @__PURE__ */ new Set([
1139
+ "system_db",
1140
+ "external_system_db",
1141
+ "container_db",
1142
+ "external_container_db",
1143
+ "component_db",
1144
+ "external_component_db"
1145
+ ]), N0 = {
1146
+ person: "person",
1147
+ box: "rounded",
1148
+ rounded: "rounded",
1149
+ cylinder: "cylinder",
1150
+ database: "cylinder",
1151
+ db: "cylinder",
1152
+ queue: "h-cyl",
1153
+ pipe: "h-cyl",
1154
+ component: "fr-rect"
1155
+ }, $t = /* @__PURE__ */ d((t) => t ? N0[t.toLowerCase()] : void 0, "keywordShape"), A0 = /* @__PURE__ */ d((t) => {
1156
+ const e = $t(t.shape) ?? $t(t.sprite);
1157
+ if (e)
1158
+ return e;
1159
+ if (t.tags)
1160
+ for (const i of t.tags.split(",")) {
1161
+ const u = $t(i.trim());
1162
+ if (u)
1163
+ return u;
1164
+ }
1165
+ const a = t.typeC4Shape.text;
1166
+ return a === "person" || a === "external_person" ? "person" : D0.has(a) ? "cylinder" : P0.has(a) ? "h-cyl" : "rounded";
1167
+ }, "resolveNodeShape"), L0 = {
1168
+ person: "Person",
1169
+ system: "Software System",
1170
+ container: "Container",
1171
+ component: "Component"
1172
+ }, I0 = /* @__PURE__ */ d((t) => {
1173
+ const e = t.replace(/^external_/, "").replace(/_(db|queue)$/, "");
1174
+ return L0[e] ?? e.replace(/_/g, " ");
1175
+ }, "stereotypeLabel"), M0 = /* @__PURE__ */ d((t) => t.startsWith("external_"), "isExternal"), B0 = /* @__PURE__ */ d((t) => {
1176
+ const e = I0(t.typeC4Shape.text);
1177
+ return t.techn?.text ? `[${e}: ${t.techn.text}]` : `[${e}]`;
1178
+ }, "stereotypeText"), ke = [
1179
+ "person",
1180
+ "system",
1181
+ "system_db",
1182
+ "system_queue",
1183
+ "container",
1184
+ "container_db",
1185
+ "container_queue",
1186
+ "component",
1187
+ "component_db",
1188
+ "component_queue"
1189
+ ].flatMap((t) => [t, `external_${t}`]), V0 = new Set(ke), fe = /* @__PURE__ */ d((t) => V0.has(t), "isC4ElementType"), Y0 = /* @__PURE__ */ d((t, e) => {
1190
+ const a = t.typeC4Shape.text, i = t.bgColor ?? (fe(a) && e[`${a}_bg_color`]), u = t.borderColor ?? (fe(a) && e[`${a}_border_color`]), r = [];
1191
+ return i && r.push(`fill:${i}`), u && r.push(`stroke:${u}`), r.push(`color:${t.fontColor ?? "#FFFFFF"}`), r;
1192
+ }, "elementCssStyles"), ye = /* @__PURE__ */ d((t, e, a, i, u) => {
1193
+ const r = t.typeC4Shape.text, n = ["c4-shape", `c4-${r}`];
1194
+ M0(r) && n.push("c4-external");
1195
+ const l = A0(t), s = Y0(t, e);
1196
+ return (l === "rounded" || l === "fr-rect") && s.push("rx:12px", "ry:12px"), {
1197
+ id: t.alias,
1198
+ label: t.label.text,
1199
+ stereotype: B0(t),
1200
+ description: t.descr?.text ? [t.descr.text] : void 0,
1201
+ labelType: "string",
1202
+ isGroup: !1,
1203
+ shape: l,
1204
+ cssClasses: n.join(" "),
1205
+ cssStyles: s,
1206
+ padding: a,
1207
+ look: i,
1208
+ useHtmlLabels: !1,
1209
+ width: u
1210
+ };
1211
+ }, "buildC4Node"), Lt = 0, It = 0, Ce = 4, ne = 2;
1212
+ jt.yy = ee;
1213
+ var b = {}, Rt, Re = (Rt = class {
1214
+ constructor(e) {
1215
+ this.name = "", this.data = {}, this.data.startx = void 0, this.data.stopx = void 0, this.data.starty = void 0, this.data.stopy = void 0, this.data.widthLimit = void 0, this.nextData = {}, this.nextData.startx = void 0, this.nextData.stopx = void 0, this.nextData.starty = void 0, this.nextData.stopy = void 0, this.nextData.cnt = 0, se(e.db.getConfig());
1216
+ }
1217
+ setData(e, a, i, u) {
1218
+ this.nextData.startx = this.data.startx = e, this.nextData.stopx = this.data.stopx = a, this.nextData.starty = this.data.starty = i, this.nextData.stopy = this.data.stopy = u;
1219
+ }
1220
+ updateVal(e, a, i, u) {
1221
+ e[a] === void 0 ? e[a] = i : e[a] = u(i, e[a]);
1222
+ }
1223
+ insert(e) {
1224
+ this.nextData.cnt = this.nextData.cnt + 1;
1225
+ const a = this.nextData.stopx, i = this.data.widthLimit;
1226
+ let u = this.nextData.startx === this.nextData.stopx ? a + e.margin : a + e.margin * 2, r = u + e.width, n = this.nextData.starty + e.margin * 2, l = n + e.height;
1227
+ (u >= i || r >= i || this.nextData.cnt > Ce) && (u = this.nextData.startx + e.margin + b.nextLinePaddingX, n = this.nextData.stopy + e.margin * 2, this.nextData.stopx = r = u + e.width, this.nextData.starty = this.nextData.stopy, this.nextData.stopy = l = n + e.height, this.nextData.cnt = 1), e.x = u, e.y = n, this.updateVal(this.data, "startx", u, Math.min), this.updateVal(this.data, "starty", n, Math.min), this.updateVal(this.data, "stopx", r, Math.max), this.updateVal(this.data, "stopy", l, Math.max), this.updateVal(this.nextData, "startx", u, Math.min), this.updateVal(this.nextData, "starty", n, Math.min), this.updateVal(this.nextData, "stopx", r, Math.max), this.updateVal(this.nextData, "stopy", l, Math.max);
1228
+ }
1229
+ init(e) {
1230
+ this.name = "", this.data = {
1231
+ startx: void 0,
1232
+ stopx: void 0,
1233
+ starty: void 0,
1234
+ stopy: void 0,
1235
+ widthLimit: void 0
1236
+ }, this.nextData = {
1237
+ startx: void 0,
1238
+ stopx: void 0,
1239
+ starty: void 0,
1240
+ stopy: void 0,
1241
+ cnt: 0
1242
+ }, se(e.db.getConfig());
1243
+ }
1244
+ bumpLastMargin(e) {
1245
+ this.data.stopx += e, this.data.stopy += e;
1246
+ }
1247
+ }, d(Rt, "Bounds"), Rt), se = /* @__PURE__ */ d(function(t) {
1248
+ Ue(b, t), t?.fontFamily && (b.personFontFamily = b.systemFontFamily = b.messageFontFamily = t.fontFamily), t?.fontSize && (b.personFontSize = b.systemFontSize = b.messageFontSize = t.fontSize), t?.fontWeight && (b.personFontWeight = b.systemFontWeight = b.messageFontWeight = t.fontWeight);
1249
+ }, "setConf"), Ut = /* @__PURE__ */ d((t) => ({
1250
+ fontFamily: t.boundaryFontFamily,
1251
+ fontSize: t.boundaryFontSize,
1252
+ fontWeight: t.boundaryFontWeight
1253
+ }), "boundaryFont"), F0 = /* @__PURE__ */ d((t) => ({
1254
+ fontFamily: t.messageFontFamily,
1255
+ fontSize: t.messageFontSize,
1256
+ fontWeight: t.messageFontWeight
1257
+ }), "messageFont");
1258
+ function mt(t, e, a, i, u) {
1259
+ const r = e[t];
1260
+ if (!r.width)
1261
+ if (a)
1262
+ r.text = We(
1263
+ r.text,
1264
+ u,
1265
+ i
1266
+ ), r.textLines = r.text.split(te.lineBreakRegex).length, r.width = u, r.height = pe(r.text, i);
1267
+ else {
1268
+ const n = r.text.split(te.lineBreakRegex);
1269
+ r.textLines = n.length;
1270
+ let l = 0;
1271
+ r.height = 0, r.width = 0;
1272
+ for (const s of n)
1273
+ r.width = Math.max(
1274
+ Nt(s, i),
1275
+ r.width
1276
+ ), l = pe(s, i), r.height = r.height + l;
1277
+ }
1278
+ return r;
1279
+ }
1280
+ d(mt, "calcC4ShapeTextWH");
1281
+ var we = /* @__PURE__ */ d(function(t, e, a) {
1282
+ const i = a.data.startx, u = a.data.starty;
1283
+ e.x = i, e.y = u, e.width = a.data.stopx - i, e.height = a.data.stopy - u, e.intersect = (s) => je.rect(
1284
+ {
1285
+ x: e.x + e.width / 2,
1286
+ y: e.y + e.height / 2,
1287
+ width: e.width,
1288
+ height: e.height
1289
+ },
1290
+ s
1291
+ ), e.label.y = b.c4ShapeMargin - 35;
1292
+ const r = e.wrap && b.wrap, n = Ut(b);
1293
+ n.fontSize = n.fontSize + 2, n.fontWeight = "bold";
1294
+ const l = Nt(
1295
+ e.label.text,
1296
+ n
1297
+ );
1298
+ mt("label", e, r, n, l), W.drawBoundary(t, e, b);
1299
+ }, "drawBoundary"), Oe = /* @__PURE__ */ d(async function(t, e, a, i) {
1300
+ const u = Ot(), r = u.look ?? "classic", n = { config: u }, l = e.attr("id") ?? "", s = i.map((y) => a[Number(y)]), h = /* @__PURE__ */ d((y) => {
1301
+ const p = y.shape ? ze[y.shape] : void 0;
1302
+ if (!p)
1303
+ throw new Error(`C4: no shape handler for "${y.shape}"`);
1304
+ return p;
1305
+ }, "shapeHandlerFor");
1306
+ await Promise.all(
1307
+ s.map(async (y) => {
1308
+ const p = ye(y, b, b.c4ShapePadding, r, b.width);
1309
+ p.domId = `${l}-${p.id}`;
1310
+ const g = await h(p)(e, p, n);
1311
+ y.width = p.width ?? b.width, y.height = p.height ?? b.height, y.margin = b.c4ShapeMargin, g.remove();
1312
+ })
1313
+ );
1314
+ for (const y of s)
1315
+ t.insert(y);
1316
+ await Promise.all(
1317
+ s.map(async (y) => {
1318
+ const p = ye(y, b, b.c4ShapePadding, r, b.width);
1319
+ p.domId = `${l}-${p.id}`, p.x = y.x + y.width / 2, p.y = y.y + y.height / 2;
1320
+ const g = e.append("g").attr(
1321
+ "transform",
1322
+ `translate(${y.x + y.width / 2}, ${y.y + y.height / 2})`
1323
+ );
1324
+ await h(p)(g, p, n), y.intersect = p.intersect;
1325
+ })
1326
+ ), t.bumpLastMargin(b.c4ShapeMargin);
1327
+ }, "drawC4ShapeArray"), wt, U0 = (wt = class {
1328
+ constructor(e, a) {
1329
+ this.x = e, this.y = a;
1330
+ }
1331
+ }, d(wt, "Point"), wt), _e = /* @__PURE__ */ d(function(t, e) {
1332
+ if (!t.intersect)
1333
+ throw new Error(
1334
+ `C4 element "${t.alias}" has no intersect function. Please report this to https://github.com/mermaid-js/mermaid/issues`
1335
+ );
1336
+ const { x: a, y: i } = t.intersect(e);
1337
+ return new U0(a, i);
1338
+ }, "getIntersectPoint"), j0 = /* @__PURE__ */ d(function(t, e) {
1339
+ const a = { x: 0, y: 0 };
1340
+ a.x = e.x + e.width / 2, a.y = e.y + e.height / 2;
1341
+ const i = _e(t, a);
1342
+ a.x = t.x + t.width / 2, a.y = t.y + t.height / 2;
1343
+ const u = _e(e, a);
1344
+ return { startPoint: i, endPoint: u };
1345
+ }, "getIntersectPoints"), z0 = /* @__PURE__ */ d(function(t, e, a, i, u) {
1346
+ const r = i.db.getC4Type();
1347
+ let n = 0;
1348
+ for (const l of e) {
1349
+ n = n + 1;
1350
+ const s = l.wrap && b.wrap, h = F0(b);
1351
+ r === "C4Dynamic" && (l.label.text = n + ": " + l.label.text);
1352
+ let y = Nt(l.label.text, h);
1353
+ mt("label", l, s, h, y), l.techn && l.techn.text !== "" && (y = Nt(l.techn.text, h), mt("techn", l, s, h, y)), l.descr && l.descr.text !== "" && (y = Nt(l.descr.text, h), mt("descr", l, s, h, y));
1354
+ const p = a(l.from), g = a(l.to);
1355
+ if (!p || !g)
1356
+ throw new Error(
1357
+ `C4 rel "${l.from}" -> "${l.to}" references an unknown shape or boundary`
1358
+ );
1359
+ const v = j0(p, g);
1360
+ if (!v.startPoint || !v.endPoint)
1361
+ throw new Error(
1362
+ `Could not calculate intersection points for rel "${l.from}" -> "${l.to}"`
1363
+ );
1364
+ l.startPoint = v.startPoint, l.endPoint = v.endPoint;
1365
+ }
1366
+ W.drawRels(t, e, b, u);
1367
+ }, "drawRels");
1368
+ async function ie(t, e, a, i, u) {
1369
+ const r = u.db, n = new Re(u);
1370
+ n.data.widthLimit = a.data.widthLimit / Math.min(ne, i.length);
1371
+ for (const [l, s] of i.entries()) {
1372
+ let h = 0;
1373
+ s.image = { width: 0, height: 0, Y: 0 }, s.sprite && (s.image.width = 48, s.image.height = 48, s.image.Y = h, h = s.image.Y + s.image.height);
1374
+ const y = s.wrap && b.wrap, p = Ut(b);
1375
+ p.fontSize = p.fontSize + 2, p.fontWeight = "bold";
1376
+ const g = mt(
1377
+ "label",
1378
+ s,
1379
+ y,
1380
+ p,
1381
+ n.data.widthLimit
1382
+ );
1383
+ if (g.Y = h + 8, h = g.Y + g.height, s.type && s.type.text !== "") {
1384
+ s.type.text = "[" + s.type.text + "]";
1385
+ const O = Ut(b), P = mt(
1386
+ "type",
1387
+ s,
1388
+ y,
1389
+ O,
1390
+ n.data.widthLimit
1391
+ );
1392
+ P.Y = h + 5, h = P.Y + P.height;
1393
+ }
1394
+ if (s.descr && s.descr.text !== "") {
1395
+ const O = Ut(b);
1396
+ O.fontSize = O.fontSize - 2;
1397
+ const P = mt(
1398
+ "descr",
1399
+ s,
1400
+ y,
1401
+ O,
1402
+ n.data.widthLimit
1403
+ );
1404
+ P.Y = h + 20, h = P.Y + P.height;
1405
+ }
1406
+ if (l == 0 || l % ne === 0) {
1407
+ const O = a.data.startx + b.diagramMarginX, P = a.data.stopy + b.diagramMarginY + h;
1408
+ n.setData(O, O, P, P);
1409
+ } else {
1410
+ const O = n.data.stopx !== n.data.startx ? n.data.stopx + b.diagramMarginX : n.data.startx, P = n.data.starty;
1411
+ n.setData(O, O, P, P);
1412
+ }
1413
+ n.name = s.alias;
1414
+ const v = r.getC4ShapeArray(s.alias), w = r.getC4ShapeKeys(s.alias);
1415
+ w.length > 0 && await Oe(
1416
+ n,
1417
+ t,
1418
+ v,
1419
+ w
1420
+ ), e = s.alias;
1421
+ const N = r.getBoundaries(e);
1422
+ N.length > 0 && await ie(
1423
+ t,
1424
+ e,
1425
+ n,
1426
+ N,
1427
+ u
1428
+ ), s.alias !== "global" && we(t, s, n), a.data.stopy = Math.max(
1429
+ n.data.stopy + b.c4ShapeMargin,
1430
+ a.data.stopy
1431
+ ), a.data.stopx = Math.max(
1432
+ n.data.stopx + b.c4ShapeMargin,
1433
+ a.data.stopx
1434
+ ), Lt = Math.max(Lt, a.data.stopx), It = Math.max(It, a.data.stopy);
1435
+ }
1436
+ }
1437
+ d(ie, "drawInsideBoundary");
1438
+ var W0 = /* @__PURE__ */ d(async function(t, e, a, i) {
1439
+ b = be("c4");
1440
+ const u = Ot().securityLevel, { root: r } = O0(e, u), n = i.db;
1441
+ n.setWrap(b.wrap), Ce = n.getC4ShapeInRow(), ne = n.getC4BoundaryInRow(), de.debug(`C:${JSON.stringify(b, null, 2)}`);
1442
+ const l = r.select(`[id="${e}"]`);
1443
+ W.insertComputerIcon(l, e), W.insertDatabaseIcon(l, e), W.insertClockIcon(l, e);
1444
+ const s = new Re(i);
1445
+ s.setData(
1446
+ b.diagramMarginX,
1447
+ b.diagramMarginX,
1448
+ b.diagramMarginY,
1449
+ b.diagramMarginY
1450
+ ), s.data.widthLimit = screen.availWidth, Lt = b.diagramMarginX, It = b.diagramMarginY;
1451
+ const h = n.getTitle(), y = n.getBoundaries("");
1452
+ await ie(l, "", s, y, i), W.insertArrowHead(l, e), W.insertArrowEnd(l, e), W.insertArrowCrossHead(l, e), W.insertArrowFilledHead(l, e), z0(l, n.getRels(), n.getC4Shape, i, e), s.data.stopx = Lt, s.data.stopy = It;
1453
+ const p = s.data, g = p.startx, v = p.starty, N = It - v + 2 * b.diagramMarginY, O = Lt - g, P = O + 2 * b.diagramMarginX;
1454
+ h && l.append("text").text(h).attr("x", O / 2 - 4 * b.diagramMarginX).attr("y", v + b.diagramMarginY), Fe(l, N, P, b.useMaxWidth);
1455
+ const I = h ? 60 : 0;
1456
+ l.attr(
1457
+ "viewBox",
1458
+ g - b.diagramMarginX + " -" + (b.diagramMarginY + I) + " " + P + " " + (N + I)
1459
+ ), de.debug("models:", p);
1460
+ }, "draw"), ge = {
1461
+ drawPersonOrSystemArray: Oe,
1462
+ drawBoundary: we,
1463
+ setConf: se,
1464
+ draw: W0
1465
+ }, X0 = /* @__PURE__ */ d(() => {
1466
+ const t = Ot().c4 ?? {}, e = new CSSStyleSheet();
1467
+ for (const a of ke) {
1468
+ const i = e.cssRules[e.insertRule(`.c4-shape.c4-${a} .label {}`, e.cssRules.length)], u = t[`${a}FontFamily`], r = t[`${a}FontSize`], n = t[`${a}FontWeight`];
1469
+ u && i.style.setProperty("font-family", u), r && i.style.setProperty(
1470
+ "font-size",
1471
+ typeof r == "number" ? `${r}px` : r
1472
+ ), n && i.style.setProperty("font-weight", String(n));
1473
+ }
1474
+ return [...e.cssRules].filter((a) => a.style.length > 0).map((a) => ` ${a.cssText}`).join(`
1475
+ `);
1476
+ }, "elementFontStyles"), q0 = /* @__PURE__ */ d((t) => `.person {
1477
+ stroke: ${t.personBorder};
1478
+ fill: ${t.personBkg};
1479
+ }
1480
+ ${X0()}
1481
+
1482
+ /* The element font colour is set inline per element (default white); the
1483
+ label text takes it via currentColor. */
1484
+ .c4-shape .label,
1485
+ .c4-shape .label text {
1486
+ color: inherit;
1487
+ fill: currentColor;
1488
+ }
1489
+ /* Structurizr typography: bold name, smaller stereotype/type and description lines. */
1490
+ .c4-shape .label .c4-name {
1491
+ font-weight: bold;
1492
+ }
1493
+ .c4-shape .label .c4-type {
1494
+ font-size: 0.75em;
1495
+ }
1496
+ .c4-shape .label .c4-descr {
1497
+ font-size: 0.82em;
1498
+ }
1499
+ .c4-shape .basic,
1500
+ .c4-shape rect,
1501
+ .c4-shape path,
1502
+ .c4-shape circle,
1503
+ .c4-shape ellipse,
1504
+ .c4-shape line {
1505
+ stroke-width: 2px;
1506
+ }
1507
+ `, "getStyles"), H0 = q0, G0 = {
1508
+ parser: Xe,
1509
+ db: ee,
1510
+ renderer: ge,
1511
+ styles: H0,
1512
+ init: /* @__PURE__ */ d(({ c4: t, wrap: e }) => {
1513
+ ge.setConf(t), ee.setWrap(e);
1514
+ }, "init")
1515
+ };
1516
+ export {
1517
+ G0 as diagram
1518
+ };