react-docs-ui 0.6.17 → 0.6.19

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 (150) hide show
  1. package/dist/{AIChatDialog-W60DtiEW.js → AIChatDialog-BnAX3dRn.js} +2 -2
  2. package/dist/{AISelectionTrigger-MaBGhxTE.js → AISelectionTrigger-SLyb8Vep.js} +2 -2
  3. package/dist/{AISettingsPanel-aiMnncnQ.js → AISettingsPanel-Bsd_wLP4.js} +3 -3
  4. package/dist/{DocsApp-BN6Bo0YD.js → DocsApp-CybQmyB8.js} +3669 -3285
  5. package/dist/{GlobalContextMenu-DG6x5Y5w.js → GlobalContextMenu-BtVjQk0v.js} +1 -1
  6. package/dist/{MdxContent-CMB8ZbXo.js → MdxContent-CH9GcMIg.js} +310 -306
  7. package/dist/{MdxContent.lazy-C4rcCv4v.js → MdxContent.lazy-D7XJ-ZHl.js} +1 -1
  8. package/dist/{SearchDialog-tUSKKsxW.js → SearchDialog-DWVre6R9.js} +66 -56
  9. package/dist/{SearchRuntime-5fXpxDsi.js → SearchRuntime-D0rSMKV3.js} +6 -5
  10. package/dist/_basePickBy-D8oNWNf8.js +166 -0
  11. package/dist/_baseUniq-DHuXxixa.js +682 -0
  12. package/dist/arc-j69r3jDe.js +80 -0
  13. package/dist/architecture-PBZL5I3N-DvHexcWL.js +3 -0
  14. package/dist/architectureDiagram-2XIMDMQ5-DmhcSwl7.js +4045 -0
  15. package/dist/array-DHiPsILf.js +6 -0
  16. package/dist/blockDiagram-WCTKOSBZ-B6A-w3LB.js +3025 -0
  17. package/dist/c4Diagram-IC4MRINW-AmEpu2Zd.js +2964 -0
  18. package/dist/channel-CqxMgZ5t.js +5 -0
  19. package/dist/chunk-4BX2VUAB-D3p73nhw.js +8 -0
  20. package/dist/chunk-55IACEB6-CLgZJbYv.js +8 -0
  21. package/dist/chunk-7E7YKBS2-CKRA8Egz.js +23 -0
  22. package/dist/chunk-7R4GIKGN-C19ZEV_b.js +2596 -0
  23. package/dist/chunk-C72U2L5F-B6IP-vol.js +23 -0
  24. package/dist/chunk-EGIJ26TM-Cw4ft_Ra.js +23 -0
  25. package/dist/chunk-FMBD7UC4-D-Ronn4l.js +5 -0
  26. package/dist/chunk-GEFDOKGD-8e2771NL.js +1121 -0
  27. package/dist/chunk-GLR3WWYH-ShSppUzV.js +41 -0
  28. package/dist/chunk-HHEYEP7N-CU-ZzGab.js +9 -0
  29. package/dist/chunk-JSJVCQXG-D49UMhzO.js +60 -0
  30. package/dist/chunk-KX2RTZJC-BDcxmH0D.js +25 -0
  31. package/dist/chunk-KYZI473N-B9L8Kk83.js +3434 -0
  32. package/dist/chunk-L3YUKLVL-CEVeJJT9.js +23 -0
  33. package/dist/chunk-MX3YWQON-CVZUx3EI.js +80 -0
  34. package/dist/chunk-NBPlniwU.js +23 -0
  35. package/dist/chunk-NQ4KR5QH-BWRGvKed.js +2002 -0
  36. package/dist/chunk-O4XLMI2P-BlC0d_Zr.js +511 -0
  37. package/dist/chunk-OZEHJAEY-BuORg3qI.js +64 -0
  38. package/dist/chunk-PQ6SQG4A-BggLWIDB.js +67 -0
  39. package/dist/chunk-PU5JKC2W-CeOPBYeP.js +1885 -0
  40. package/dist/chunk-QZHKN3VN-3LiJhn2O.js +15 -0
  41. package/dist/chunk-R5LLSJPH-B8KdhC9h.js +35 -0
  42. package/dist/chunk-WL4C6EOR-DLbU3P3W.js +3194 -0
  43. package/dist/chunk-XIRO2GV7-Bv7JEVD4.js +30 -0
  44. package/dist/chunk-XPW4576I-Bu03pPNP.js +1146 -0
  45. package/dist/chunk-XZSTWKYB-CpQJcKKv.js +15797 -0
  46. package/dist/chunk-YBOYWFTD-BAPGCoDq.js +32 -0
  47. package/dist/classDiagram-VBA2DB6C-D4y64v83.js +29 -0
  48. package/dist/classDiagram-v2-RAHNMMFH-DXkt0Wd4.js +29 -0
  49. package/dist/clone-B2fVtDap.js +8 -0
  50. package/dist/cose-bilkent-S5V4N54A-BX63fiTJ.js +2250 -0
  51. package/dist/cytoscape.esm-D1tmL96B.js +18100 -0
  52. package/dist/dagre-BM10A37c.js +1483 -0
  53. package/dist/dagre-KLK3FWXG-BkGeaeJf.js +294 -0
  54. package/dist/defaultLocale-CS9riXxY.js +201 -0
  55. package/dist/diagram-E7M64L7V-BCpOexcP.js +527 -0
  56. package/dist/diagram-IFDJBPK2-lSNeST-Z.js +213 -0
  57. package/dist/diagram-P4PSJMXO-Dd8HMHpS.js +133 -0
  58. package/dist/dist-DeXxBykG.js +50 -0
  59. package/dist/docs-app.es.js +1 -1
  60. package/dist/erDiagram-INFDFZHY-DjNq2UqZ.js +1666 -0
  61. package/dist/flowDiagram-PKNHOUZH-AUeVhXRc.js +4161 -0
  62. package/dist/ganttDiagram-A5KZAMGK-DZIM1zx8.js +3072 -0
  63. package/dist/gitGraph-HDMCJU4V-BiirFMfI.js +3 -0
  64. package/dist/gitGraphDiagram-K3NZZRJ6-CpR0vINe.js +625 -0
  65. package/dist/graphlib-DOjl69i0.js +225 -0
  66. package/dist/info-3K5VOQVL-CfGgZztt.js +3 -0
  67. package/dist/infoDiagram-LFFYTUFH-DAJ9foHI.js +19 -0
  68. package/dist/init-B4NvJPDj.js +15 -0
  69. package/dist/isArrayLikeObject-DLIYDRni.js +578 -0
  70. package/dist/isEmpty-DhbfzuZy.js +35 -0
  71. package/dist/ishikawaDiagram-PHBUUO56-B7xss2de.js +717 -0
  72. package/dist/journeyDiagram-4ABVD52K-BbX80Gcw.js +883 -0
  73. package/dist/kanban-definition-K7BYSVSG-BQ87hifQ.js +971 -0
  74. package/dist/line-DfLnhEwA.js +34 -0
  75. package/dist/linear-CWB56ned.js +289 -0
  76. package/dist/math-DHDNczAo.js +10 -0
  77. package/dist/{shiki-highlighter-BmQSSJpS.js → mdx-components-m1cGPhc8.js} +1437 -1338
  78. package/dist/mermaid-parser.core-l4wHnGuN.js +59 -0
  79. package/dist/mermaid.core-CtkJeRVj.js +919 -0
  80. package/dist/mindmap-definition-YRQLILUH-Cnl-qPDR.js +964 -0
  81. package/dist/ordinal-CD64W6lf.js +65 -0
  82. package/dist/packet-RMMSAZCW-DfA9M99B.js +3 -0
  83. package/dist/path-BjiRrKY7.js +85 -0
  84. package/dist/pie-UPGHQEXC-Bujrkgkt.js +3 -0
  85. package/dist/pieDiagram-SKSYHLDU-xow4mVuZ.js +165 -0
  86. package/dist/quadrantDiagram-337W2JSQ-CV2tMWXO.js +1974 -0
  87. package/dist/radar-KQ55EAFF-DEzDT04F.js +3 -0
  88. package/dist/react-docs-ui.css +1 -1
  89. package/dist/react-docs-ui.es.js +19 -19
  90. package/dist/requirementDiagram-Z7DCOOCP-Bx6NAgqy.js +2201 -0
  91. package/dist/rough.esm-BOvWpVpy.js +1352 -0
  92. package/dist/sankeyDiagram-WA2Y5GQK-CvTU-CXN.js +920 -0
  93. package/dist/sequenceDiagram-2WXFIKYE-1wYHvZEI.js +4109 -0
  94. package/dist/src-DI0MZP4m.js +2146 -0
  95. package/dist/stateDiagram-RAJIS63D-DFmbSHPX.js +217 -0
  96. package/dist/stateDiagram-v2-FVOUBMTO-TjYtTjLB.js +27 -0
  97. package/dist/timeline-definition-YZTLITO2-BAK411Yg.js +830 -0
  98. package/dist/treemap-KZPCXAKY-DThdSsPR.js +3 -0
  99. package/dist/types/components/AnnouncementBar.d.ts +12 -0
  100. package/dist/types/components/AnnouncementBar.d.ts.map +1 -0
  101. package/dist/types/components/DocsLayout.d.ts +10 -2
  102. package/dist/types/components/DocsLayout.d.ts.map +1 -1
  103. package/dist/types/components/HeaderNav.d.ts +17 -1
  104. package/dist/types/components/HeaderNav.d.ts.map +1 -1
  105. package/dist/types/components/MdxContent.d.ts.map +1 -1
  106. package/dist/types/components/MobileSidebar.d.ts +2 -1
  107. package/dist/types/components/MobileSidebar.d.ts.map +1 -1
  108. package/dist/types/components/PageFeedback.d.ts +11 -0
  109. package/dist/types/components/PageFeedback.d.ts.map +1 -0
  110. package/dist/types/components/PageMetaActions.d.ts +15 -0
  111. package/dist/types/components/PageMetaActions.d.ts.map +1 -0
  112. package/dist/types/components/PageNavigation.d.ts +2 -1
  113. package/dist/types/components/PageNavigation.d.ts.map +1 -1
  114. package/dist/types/components/SearchLauncher.d.ts +2 -1
  115. package/dist/types/components/SearchLauncher.d.ts.map +1 -1
  116. package/dist/types/components/SidebarNav.d.ts +2 -1
  117. package/dist/types/components/SidebarNav.d.ts.map +1 -1
  118. package/dist/types/components/mdx-components/Mermaid.d.ts +6 -0
  119. package/dist/types/components/mdx-components/Mermaid.d.ts.map +1 -0
  120. package/dist/types/components/mdx-components/Tabs.d.ts +13 -0
  121. package/dist/types/components/mdx-components/Tabs.d.ts.map +1 -0
  122. package/dist/types/components/mdx-components/index.d.ts +2 -0
  123. package/dist/types/components/mdx-components/index.d.ts.map +1 -1
  124. package/dist/types/components/search/SearchProvider.d.ts +2 -1
  125. package/dist/types/components/search/SearchProvider.d.ts.map +1 -1
  126. package/dist/types/components/search/SearchRuntime.d.ts +2 -1
  127. package/dist/types/components/search/SearchRuntime.d.ts.map +1 -1
  128. package/dist/types/lib/component-scanner.d.ts.map +1 -1
  129. package/dist/types/lib/config.d.ts +52 -0
  130. package/dist/types/lib/config.d.ts.map +1 -1
  131. package/dist/types/lib/navigation.d.ts +1 -1
  132. package/dist/types/lib/navigation.d.ts.map +1 -1
  133. package/dist/types/lib/page-meta.d.ts +16 -0
  134. package/dist/types/lib/page-meta.d.ts.map +1 -0
  135. package/dist/types/lib/search/build/index-generator.d.ts.map +1 -1
  136. package/dist/types/lib/search/build/types.d.ts +1 -0
  137. package/dist/types/lib/search/build/types.d.ts.map +1 -1
  138. package/dist/types/lib/search/runtime/search-engine.d.ts.map +1 -1
  139. package/dist/types/lib/search/runtime/types.d.ts +1 -0
  140. package/dist/types/lib/search/runtime/types.d.ts.map +1 -1
  141. package/dist/types/lib/versioning.d.ts +6 -0
  142. package/dist/types/lib/versioning.d.ts.map +1 -0
  143. package/dist/vennDiagram-LZ73GAT5-B7dft0U9.js +1858 -0
  144. package/dist/xychartDiagram-JWTSCODW-CXtfEnJM.js +2041 -0
  145. package/package.json +6 -2
  146. /package/dist/{AIProvider-C1_b1iKH.js → AIProvider-niZNPSGi.js} +0 -0
  147. /package/dist/{context-menu-CB7erSoV.js → context-menu-BIQsQup7.js} +0 -0
  148. /package/dist/{dialog-DQ6nkP0y.js → dialog-D8otbqQL.js} +0 -0
  149. /package/dist/{mdx-components-Dxpipc50.js → mdx-components-TEc3uhbY.js} +0 -0
  150. /package/dist/{use-toast-d9VPBjMn.js → use-toast-DK69oadB.js} +0 -0
@@ -0,0 +1,3025 @@
1
+ import { T as e, c as t, h as n, i as r } from "./chunk-GEFDOKGD-8e2771NL.js";
2
+ import { t as i } from "./clone-B2fVtDap.js";
3
+ import { t as a } from "./graphlib-DOjl69i0.js";
4
+ import { g as o, h as s, p as c } from "./src-DI0MZP4m.js";
5
+ import { D as l, L as u, a as d, b as f, c as p, nt as m, s as h, w as g, y as _ } from "./chunk-7R4GIKGN-C19ZEV_b.js";
6
+ import { t as v } from "./channel-CqxMgZ5t.js";
7
+ import { t as y } from "./line-DfLnhEwA.js";
8
+ import { n as b } from "./chunk-PU5JKC2W-CeOPBYeP.js";
9
+ import { t as x } from "./chunk-FMBD7UC4-D-Ronn4l.js";
10
+ import { n as S, t as C } from "./chunk-MX3YWQON-CVZUx3EI.js";
11
+ import { n as w, t as T } from "./chunk-YBOYWFTD-BAPGCoDq.js";
12
+ //#region node_modules/mermaid/dist/chunks/mermaid.core/blockDiagram-WCTKOSBZ.mjs
13
+ var E = (function() {
14
+ var e = /* @__PURE__ */ s(function(e, t, n, r) {
15
+ for (n ||= {}, r = e.length; r--; n[e[r]] = t);
16
+ return n;
17
+ }, "o"), t = [1, 15], n = [1, 7], r = [1, 13], i = [1, 14], a = [1, 19], o = [1, 16], c = [1, 17], l = [1, 18], u = [8, 30], d = [
18
+ 8,
19
+ 10,
20
+ 21,
21
+ 28,
22
+ 29,
23
+ 30,
24
+ 31,
25
+ 39,
26
+ 43,
27
+ 46
28
+ ], f = [1, 23], p = [1, 24], m = [
29
+ 8,
30
+ 10,
31
+ 15,
32
+ 16,
33
+ 21,
34
+ 28,
35
+ 29,
36
+ 30,
37
+ 31,
38
+ 39,
39
+ 43,
40
+ 46
41
+ ], h = [
42
+ 8,
43
+ 10,
44
+ 15,
45
+ 16,
46
+ 21,
47
+ 27,
48
+ 28,
49
+ 29,
50
+ 30,
51
+ 31,
52
+ 39,
53
+ 43,
54
+ 46
55
+ ], g = [1, 49], _ = {
56
+ trace: /* @__PURE__ */ s(function() {}, "trace"),
57
+ yy: {},
58
+ symbols_: {
59
+ error: 2,
60
+ spaceLines: 3,
61
+ SPACELINE: 4,
62
+ NL: 5,
63
+ separator: 6,
64
+ SPACE: 7,
65
+ EOF: 8,
66
+ start: 9,
67
+ BLOCK_DIAGRAM_KEY: 10,
68
+ document: 11,
69
+ stop: 12,
70
+ statement: 13,
71
+ link: 14,
72
+ LINK: 15,
73
+ START_LINK: 16,
74
+ LINK_LABEL: 17,
75
+ STR: 18,
76
+ nodeStatement: 19,
77
+ columnsStatement: 20,
78
+ SPACE_BLOCK: 21,
79
+ blockStatement: 22,
80
+ classDefStatement: 23,
81
+ cssClassStatement: 24,
82
+ styleStatement: 25,
83
+ node: 26,
84
+ SIZE: 27,
85
+ COLUMNS: 28,
86
+ "id-block": 29,
87
+ end: 30,
88
+ NODE_ID: 31,
89
+ nodeShapeNLabel: 32,
90
+ dirList: 33,
91
+ DIR: 34,
92
+ NODE_DSTART: 35,
93
+ NODE_DEND: 36,
94
+ BLOCK_ARROW_START: 37,
95
+ BLOCK_ARROW_END: 38,
96
+ classDef: 39,
97
+ CLASSDEF_ID: 40,
98
+ CLASSDEF_STYLEOPTS: 41,
99
+ DEFAULT: 42,
100
+ class: 43,
101
+ CLASSENTITY_IDS: 44,
102
+ STYLECLASS: 45,
103
+ style: 46,
104
+ STYLE_ENTITY_IDS: 47,
105
+ STYLE_DEFINITION_DATA: 48,
106
+ $accept: 0,
107
+ $end: 1
108
+ },
109
+ terminals_: {
110
+ 2: "error",
111
+ 4: "SPACELINE",
112
+ 5: "NL",
113
+ 7: "SPACE",
114
+ 8: "EOF",
115
+ 10: "BLOCK_DIAGRAM_KEY",
116
+ 15: "LINK",
117
+ 16: "START_LINK",
118
+ 17: "LINK_LABEL",
119
+ 18: "STR",
120
+ 21: "SPACE_BLOCK",
121
+ 27: "SIZE",
122
+ 28: "COLUMNS",
123
+ 29: "id-block",
124
+ 30: "end",
125
+ 31: "NODE_ID",
126
+ 34: "DIR",
127
+ 35: "NODE_DSTART",
128
+ 36: "NODE_DEND",
129
+ 37: "BLOCK_ARROW_START",
130
+ 38: "BLOCK_ARROW_END",
131
+ 39: "classDef",
132
+ 40: "CLASSDEF_ID",
133
+ 41: "CLASSDEF_STYLEOPTS",
134
+ 42: "DEFAULT",
135
+ 43: "class",
136
+ 44: "CLASSENTITY_IDS",
137
+ 45: "STYLECLASS",
138
+ 46: "style",
139
+ 47: "STYLE_ENTITY_IDS",
140
+ 48: "STYLE_DEFINITION_DATA"
141
+ },
142
+ productions_: [
143
+ 0,
144
+ [3, 1],
145
+ [3, 2],
146
+ [3, 2],
147
+ [6, 1],
148
+ [6, 1],
149
+ [6, 1],
150
+ [9, 3],
151
+ [12, 1],
152
+ [12, 1],
153
+ [12, 2],
154
+ [12, 2],
155
+ [11, 1],
156
+ [11, 2],
157
+ [14, 1],
158
+ [14, 4],
159
+ [13, 1],
160
+ [13, 1],
161
+ [13, 1],
162
+ [13, 1],
163
+ [13, 1],
164
+ [13, 1],
165
+ [13, 1],
166
+ [19, 3],
167
+ [19, 2],
168
+ [19, 1],
169
+ [20, 1],
170
+ [22, 4],
171
+ [22, 3],
172
+ [26, 1],
173
+ [26, 2],
174
+ [33, 1],
175
+ [33, 2],
176
+ [32, 3],
177
+ [32, 4],
178
+ [23, 3],
179
+ [23, 3],
180
+ [24, 3],
181
+ [25, 3]
182
+ ],
183
+ performAction: /* @__PURE__ */ s(function(e, t, n, r, i, a, o) {
184
+ var s = a.length - 1;
185
+ switch (i) {
186
+ case 4:
187
+ r.getLogger().debug("Rule: separator (NL) ");
188
+ break;
189
+ case 5:
190
+ r.getLogger().debug("Rule: separator (Space) ");
191
+ break;
192
+ case 6:
193
+ r.getLogger().debug("Rule: separator (EOF) ");
194
+ break;
195
+ case 7:
196
+ r.getLogger().debug("Rule: hierarchy: ", a[s - 1]), r.setHierarchy(a[s - 1]);
197
+ break;
198
+ case 8:
199
+ r.getLogger().debug("Stop NL ");
200
+ break;
201
+ case 9:
202
+ r.getLogger().debug("Stop EOF ");
203
+ break;
204
+ case 10:
205
+ r.getLogger().debug("Stop NL2 ");
206
+ break;
207
+ case 11:
208
+ r.getLogger().debug("Stop EOF2 ");
209
+ break;
210
+ case 12:
211
+ r.getLogger().debug("Rule: statement: ", a[s]), typeof a[s].length == "number" ? this.$ = a[s] : this.$ = [a[s]];
212
+ break;
213
+ case 13:
214
+ r.getLogger().debug("Rule: statement #2: ", a[s - 1]), this.$ = [a[s - 1]].concat(a[s]);
215
+ break;
216
+ case 14:
217
+ r.getLogger().debug("Rule: link: ", a[s], e), this.$ = {
218
+ edgeTypeStr: a[s],
219
+ label: ""
220
+ };
221
+ break;
222
+ case 15:
223
+ r.getLogger().debug("Rule: LABEL link: ", a[s - 3], a[s - 1], a[s]), this.$ = {
224
+ edgeTypeStr: a[s],
225
+ label: a[s - 1]
226
+ };
227
+ break;
228
+ case 18:
229
+ let t = parseInt(a[s]);
230
+ this.$ = {
231
+ id: r.generateId(),
232
+ type: "space",
233
+ label: "",
234
+ width: t,
235
+ children: []
236
+ };
237
+ break;
238
+ case 23:
239
+ r.getLogger().debug("Rule: (nodeStatement link node) ", a[s - 2], a[s - 1], a[s], " typestr: ", a[s - 1].edgeTypeStr);
240
+ let n = r.edgeStrToEdgeData(a[s - 1].edgeTypeStr);
241
+ this.$ = [
242
+ {
243
+ id: a[s - 2].id,
244
+ label: a[s - 2].label,
245
+ type: a[s - 2].type,
246
+ directions: a[s - 2].directions
247
+ },
248
+ {
249
+ id: a[s - 2].id + "-" + a[s].id,
250
+ start: a[s - 2].id,
251
+ end: a[s].id,
252
+ label: a[s - 1].label,
253
+ type: "edge",
254
+ directions: a[s].directions,
255
+ arrowTypeEnd: n,
256
+ arrowTypeStart: "arrow_open"
257
+ },
258
+ {
259
+ id: a[s].id,
260
+ label: a[s].label,
261
+ type: r.typeStr2Type(a[s].typeStr),
262
+ directions: a[s].directions
263
+ }
264
+ ];
265
+ break;
266
+ case 24:
267
+ r.getLogger().debug("Rule: nodeStatement (abc88 node size) ", a[s - 1], a[s]), this.$ = {
268
+ id: a[s - 1].id,
269
+ label: a[s - 1].label,
270
+ type: r.typeStr2Type(a[s - 1].typeStr),
271
+ directions: a[s - 1].directions,
272
+ widthInColumns: parseInt(a[s], 10)
273
+ };
274
+ break;
275
+ case 25:
276
+ r.getLogger().debug("Rule: nodeStatement (node) ", a[s]), this.$ = {
277
+ id: a[s].id,
278
+ label: a[s].label,
279
+ type: r.typeStr2Type(a[s].typeStr),
280
+ directions: a[s].directions,
281
+ widthInColumns: 1
282
+ };
283
+ break;
284
+ case 26:
285
+ r.getLogger().debug("APA123", this ? this : "na"), r.getLogger().debug("COLUMNS: ", a[s]), this.$ = {
286
+ type: "column-setting",
287
+ columns: a[s] === "auto" ? -1 : parseInt(a[s])
288
+ };
289
+ break;
290
+ case 27:
291
+ r.getLogger().debug("Rule: id-block statement : ", a[s - 2], a[s - 1]), r.generateId(), this.$ = {
292
+ ...a[s - 2],
293
+ type: "composite",
294
+ children: a[s - 1]
295
+ };
296
+ break;
297
+ case 28:
298
+ r.getLogger().debug("Rule: blockStatement : ", a[s - 2], a[s - 1], a[s]), this.$ = {
299
+ id: r.generateId(),
300
+ type: "composite",
301
+ label: "",
302
+ children: a[s - 1]
303
+ };
304
+ break;
305
+ case 29:
306
+ r.getLogger().debug("Rule: node (NODE_ID separator): ", a[s]), this.$ = { id: a[s] };
307
+ break;
308
+ case 30:
309
+ r.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ", a[s - 1], a[s]), this.$ = {
310
+ id: a[s - 1],
311
+ label: a[s].label,
312
+ typeStr: a[s].typeStr,
313
+ directions: a[s].directions
314
+ };
315
+ break;
316
+ case 31:
317
+ r.getLogger().debug("Rule: dirList: ", a[s]), this.$ = [a[s]];
318
+ break;
319
+ case 32:
320
+ r.getLogger().debug("Rule: dirList: ", a[s - 1], a[s]), this.$ = [a[s - 1]].concat(a[s]);
321
+ break;
322
+ case 33:
323
+ r.getLogger().debug("Rule: nodeShapeNLabel: ", a[s - 2], a[s - 1], a[s]), this.$ = {
324
+ typeStr: a[s - 2] + a[s],
325
+ label: a[s - 1]
326
+ };
327
+ break;
328
+ case 34:
329
+ r.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ", a[s - 3], a[s - 2], " #3:", a[s - 1], a[s]), this.$ = {
330
+ typeStr: a[s - 3] + a[s],
331
+ label: a[s - 2],
332
+ directions: a[s - 1]
333
+ };
334
+ break;
335
+ case 35:
336
+ case 36:
337
+ this.$ = {
338
+ type: "classDef",
339
+ id: a[s - 1].trim(),
340
+ css: a[s].trim()
341
+ };
342
+ break;
343
+ case 37:
344
+ this.$ = {
345
+ type: "applyClass",
346
+ id: a[s - 1].trim(),
347
+ styleClass: a[s].trim()
348
+ };
349
+ break;
350
+ case 38:
351
+ this.$ = {
352
+ type: "applyStyles",
353
+ id: a[s - 1].trim(),
354
+ stylesStr: a[s].trim()
355
+ };
356
+ break;
357
+ }
358
+ }, "anonymous"),
359
+ table: [
360
+ {
361
+ 9: 1,
362
+ 10: [1, 2]
363
+ },
364
+ { 1: [3] },
365
+ {
366
+ 10: t,
367
+ 11: 3,
368
+ 13: 4,
369
+ 19: 5,
370
+ 20: 6,
371
+ 21: n,
372
+ 22: 8,
373
+ 23: 9,
374
+ 24: 10,
375
+ 25: 11,
376
+ 26: 12,
377
+ 28: r,
378
+ 29: i,
379
+ 31: a,
380
+ 39: o,
381
+ 43: c,
382
+ 46: l
383
+ },
384
+ { 8: [1, 20] },
385
+ e(u, [2, 12], {
386
+ 13: 4,
387
+ 19: 5,
388
+ 20: 6,
389
+ 22: 8,
390
+ 23: 9,
391
+ 24: 10,
392
+ 25: 11,
393
+ 26: 12,
394
+ 11: 21,
395
+ 10: t,
396
+ 21: n,
397
+ 28: r,
398
+ 29: i,
399
+ 31: a,
400
+ 39: o,
401
+ 43: c,
402
+ 46: l
403
+ }),
404
+ e(d, [2, 16], {
405
+ 14: 22,
406
+ 15: f,
407
+ 16: p
408
+ }),
409
+ e(d, [2, 17]),
410
+ e(d, [2, 18]),
411
+ e(d, [2, 19]),
412
+ e(d, [2, 20]),
413
+ e(d, [2, 21]),
414
+ e(d, [2, 22]),
415
+ e(m, [2, 25], { 27: [1, 25] }),
416
+ e(d, [2, 26]),
417
+ {
418
+ 19: 26,
419
+ 26: 12,
420
+ 31: a
421
+ },
422
+ {
423
+ 10: t,
424
+ 11: 27,
425
+ 13: 4,
426
+ 19: 5,
427
+ 20: 6,
428
+ 21: n,
429
+ 22: 8,
430
+ 23: 9,
431
+ 24: 10,
432
+ 25: 11,
433
+ 26: 12,
434
+ 28: r,
435
+ 29: i,
436
+ 31: a,
437
+ 39: o,
438
+ 43: c,
439
+ 46: l
440
+ },
441
+ {
442
+ 40: [1, 28],
443
+ 42: [1, 29]
444
+ },
445
+ { 44: [1, 30] },
446
+ { 47: [1, 31] },
447
+ e(h, [2, 29], {
448
+ 32: 32,
449
+ 35: [1, 33],
450
+ 37: [1, 34]
451
+ }),
452
+ { 1: [2, 7] },
453
+ e(u, [2, 13]),
454
+ {
455
+ 26: 35,
456
+ 31: a
457
+ },
458
+ { 31: [2, 14] },
459
+ { 17: [1, 36] },
460
+ e(m, [2, 24]),
461
+ {
462
+ 10: t,
463
+ 11: 37,
464
+ 13: 4,
465
+ 14: 22,
466
+ 15: f,
467
+ 16: p,
468
+ 19: 5,
469
+ 20: 6,
470
+ 21: n,
471
+ 22: 8,
472
+ 23: 9,
473
+ 24: 10,
474
+ 25: 11,
475
+ 26: 12,
476
+ 28: r,
477
+ 29: i,
478
+ 31: a,
479
+ 39: o,
480
+ 43: c,
481
+ 46: l
482
+ },
483
+ { 30: [1, 38] },
484
+ { 41: [1, 39] },
485
+ { 41: [1, 40] },
486
+ { 45: [1, 41] },
487
+ { 48: [1, 42] },
488
+ e(h, [2, 30]),
489
+ { 18: [1, 43] },
490
+ { 18: [1, 44] },
491
+ e(m, [2, 23]),
492
+ { 18: [1, 45] },
493
+ { 30: [1, 46] },
494
+ e(d, [2, 28]),
495
+ e(d, [2, 35]),
496
+ e(d, [2, 36]),
497
+ e(d, [2, 37]),
498
+ e(d, [2, 38]),
499
+ { 36: [1, 47] },
500
+ {
501
+ 33: 48,
502
+ 34: g
503
+ },
504
+ { 15: [1, 50] },
505
+ e(d, [2, 27]),
506
+ e(h, [2, 33]),
507
+ { 38: [1, 51] },
508
+ {
509
+ 33: 52,
510
+ 34: g,
511
+ 38: [2, 31]
512
+ },
513
+ { 31: [2, 15] },
514
+ e(h, [2, 34]),
515
+ { 38: [2, 32] }
516
+ ],
517
+ defaultActions: {
518
+ 20: [2, 7],
519
+ 23: [2, 14],
520
+ 50: [2, 15],
521
+ 52: [2, 32]
522
+ },
523
+ parseError: /* @__PURE__ */ s(function(e, t) {
524
+ if (t.recoverable) this.trace(e);
525
+ else {
526
+ var n = Error(e);
527
+ throw n.hash = t, n;
528
+ }
529
+ }, "parseError"),
530
+ parse: /* @__PURE__ */ s(function(e) {
531
+ var t = this, n = [0], r = [], i = [null], a = [], o = this.table, c = "", l = 0, u = 0, d = 0, f = 2, p = 1, m = a.slice.call(arguments, 1), h = Object.create(this.lexer), g = { yy: {} };
532
+ for (var _ in this.yy) Object.prototype.hasOwnProperty.call(this.yy, _) && (g.yy[_] = this.yy[_]);
533
+ h.setInput(e, g.yy), g.yy.lexer = h, g.yy.parser = this, h.yylloc === void 0 && (h.yylloc = {});
534
+ var v = h.yylloc;
535
+ a.push(v);
536
+ var y = h.options && h.options.ranges;
537
+ typeof g.yy.parseError == "function" ? this.parseError = g.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
538
+ function b(e) {
539
+ n.length -= 2 * e, i.length -= e, a.length -= e;
540
+ }
541
+ s(b, "popStack");
542
+ function x() {
543
+ var e = r.pop() || h.lex() || p;
544
+ return typeof e != "number" && (e instanceof Array && (r = e, e = r.pop()), e = t.symbols_[e] || e), e;
545
+ }
546
+ s(x, "lex");
547
+ for (var S, C, w, T, E, D = {}, O, k, A, j;;) {
548
+ if (w = n[n.length - 1], this.defaultActions[w] ? T = this.defaultActions[w] : (S ??= x(), T = o[w] && o[w][S]), T === void 0 || !T.length || !T[0]) {
549
+ var M = "";
550
+ for (O in j = [], o[w]) this.terminals_[O] && O > f && j.push("'" + this.terminals_[O] + "'");
551
+ M = h.showPosition ? "Parse error on line " + (l + 1) + ":\n" + h.showPosition() + "\nExpecting " + j.join(", ") + ", got '" + (this.terminals_[S] || S) + "'" : "Parse error on line " + (l + 1) + ": Unexpected " + (S == p ? "end of input" : "'" + (this.terminals_[S] || S) + "'"), this.parseError(M, {
552
+ text: h.match,
553
+ token: this.terminals_[S] || S,
554
+ line: h.yylineno,
555
+ loc: v,
556
+ expected: j
557
+ });
558
+ }
559
+ if (T[0] instanceof Array && T.length > 1) throw Error("Parse Error: multiple actions possible at state: " + w + ", token: " + S);
560
+ switch (T[0]) {
561
+ case 1:
562
+ n.push(S), i.push(h.yytext), a.push(h.yylloc), n.push(T[1]), S = null, C ? (S = C, C = null) : (u = h.yyleng, c = h.yytext, l = h.yylineno, v = h.yylloc, d > 0 && d--);
563
+ break;
564
+ case 2:
565
+ if (k = this.productions_[T[1]][1], D.$ = i[i.length - k], D._$ = {
566
+ first_line: a[a.length - (k || 1)].first_line,
567
+ last_line: a[a.length - 1].last_line,
568
+ first_column: a[a.length - (k || 1)].first_column,
569
+ last_column: a[a.length - 1].last_column
570
+ }, y && (D._$.range = [a[a.length - (k || 1)].range[0], a[a.length - 1].range[1]]), E = this.performAction.apply(D, [
571
+ c,
572
+ u,
573
+ l,
574
+ g.yy,
575
+ T[1],
576
+ i,
577
+ a
578
+ ].concat(m)), E !== void 0) return E;
579
+ k && (n = n.slice(0, -1 * k * 2), i = i.slice(0, -1 * k), a = a.slice(0, -1 * k)), n.push(this.productions_[T[1]][0]), i.push(D.$), a.push(D._$), A = o[n[n.length - 2]][n[n.length - 1]], n.push(A);
580
+ break;
581
+ case 3: return !0;
582
+ }
583
+ }
584
+ return !0;
585
+ }, "parse")
586
+ };
587
+ _.lexer = /* @__PURE__ */ (function() {
588
+ return {
589
+ EOF: 1,
590
+ parseError: /* @__PURE__ */ s(function(e, t) {
591
+ if (this.yy.parser) this.yy.parser.parseError(e, t);
592
+ else throw Error(e);
593
+ }, "parseError"),
594
+ setInput: /* @__PURE__ */ s(function(e, t) {
595
+ return this.yy = t || this.yy || {}, this._input = e, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
596
+ first_line: 1,
597
+ first_column: 0,
598
+ last_line: 1,
599
+ last_column: 0
600
+ }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
601
+ }, "setInput"),
602
+ input: /* @__PURE__ */ s(function() {
603
+ var e = this._input[0];
604
+ return this.yytext += e, this.yyleng++, this.offset++, this.match += e, this.matched += e, e.match(/(?:\r\n?|\n).*/g) ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), e;
605
+ }, "input"),
606
+ unput: /* @__PURE__ */ s(function(e) {
607
+ var t = e.length, n = e.split(/(?:\r\n?|\n)/g);
608
+ this._input = e + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - t), this.offset -= t;
609
+ var r = this.match.split(/(?:\r\n?|\n)/g);
610
+ this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), n.length - 1 && (this.yylineno -= n.length - 1);
611
+ var i = this.yylloc.range;
612
+ return this.yylloc = {
613
+ first_line: this.yylloc.first_line,
614
+ last_line: this.yylineno + 1,
615
+ first_column: this.yylloc.first_column,
616
+ last_column: n ? (n.length === r.length ? this.yylloc.first_column : 0) + r[r.length - n.length].length - n[0].length : this.yylloc.first_column - t
617
+ }, this.options.ranges && (this.yylloc.range = [i[0], i[0] + this.yyleng - t]), this.yyleng = this.yytext.length, this;
618
+ }, "unput"),
619
+ more: /* @__PURE__ */ s(function() {
620
+ return this._more = !0, this;
621
+ }, "more"),
622
+ reject: /* @__PURE__ */ s(function() {
623
+ if (this.options.backtrack_lexer) this._backtrack = !0;
624
+ else return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + this.showPosition(), {
625
+ text: "",
626
+ token: null,
627
+ line: this.yylineno
628
+ });
629
+ return this;
630
+ }, "reject"),
631
+ less: /* @__PURE__ */ s(function(e) {
632
+ this.unput(this.match.slice(e));
633
+ }, "less"),
634
+ pastInput: /* @__PURE__ */ s(function() {
635
+ var e = this.matched.substr(0, this.matched.length - this.match.length);
636
+ return (e.length > 20 ? "..." : "") + e.substr(-20).replace(/\n/g, "");
637
+ }, "pastInput"),
638
+ upcomingInput: /* @__PURE__ */ s(function() {
639
+ var e = this.match;
640
+ return e.length < 20 && (e += this._input.substr(0, 20 - e.length)), (e.substr(0, 20) + (e.length > 20 ? "..." : "")).replace(/\n/g, "");
641
+ }, "upcomingInput"),
642
+ showPosition: /* @__PURE__ */ s(function() {
643
+ var e = this.pastInput(), t = Array(e.length + 1).join("-");
644
+ return e + this.upcomingInput() + "\n" + t + "^";
645
+ }, "showPosition"),
646
+ test_match: /* @__PURE__ */ s(function(e, t) {
647
+ var n, r, i;
648
+ if (this.options.backtrack_lexer && (i = {
649
+ yylineno: this.yylineno,
650
+ yylloc: {
651
+ first_line: this.yylloc.first_line,
652
+ last_line: this.last_line,
653
+ first_column: this.yylloc.first_column,
654
+ last_column: this.yylloc.last_column
655
+ },
656
+ yytext: this.yytext,
657
+ match: this.match,
658
+ matches: this.matches,
659
+ matched: this.matched,
660
+ yyleng: this.yyleng,
661
+ offset: this.offset,
662
+ _more: this._more,
663
+ _input: this._input,
664
+ yy: this.yy,
665
+ conditionStack: this.conditionStack.slice(0),
666
+ done: this.done
667
+ }, this.options.ranges && (i.yylloc.range = this.yylloc.range.slice(0))), r = e[0].match(/(?:\r\n?|\n).*/g), r && (this.yylineno += r.length), this.yylloc = {
668
+ first_line: this.yylloc.last_line,
669
+ last_line: this.yylineno + 1,
670
+ first_column: this.yylloc.last_column,
671
+ last_column: r ? r[r.length - 1].length - r[r.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + e[0].length
672
+ }, this.yytext += e[0], this.match += e[0], this.matches = e, 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(e[0].length), this.matched += e[0], n = this.performAction.call(this, this.yy, this, t, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), n) return n;
673
+ if (this._backtrack) {
674
+ for (var a in i) this[a] = i[a];
675
+ return !1;
676
+ }
677
+ return !1;
678
+ }, "test_match"),
679
+ next: /* @__PURE__ */ s(function() {
680
+ if (this.done) return this.EOF;
681
+ this._input || (this.done = !0);
682
+ var e, t, n, r;
683
+ this._more || (this.yytext = "", this.match = "");
684
+ for (var i = this._currentRules(), a = 0; a < i.length; a++) if (n = this._input.match(this.rules[i[a]]), n && (!t || n[0].length > t[0].length)) {
685
+ if (t = n, r = a, this.options.backtrack_lexer) {
686
+ if (e = this.test_match(n, i[a]), e !== !1) return e;
687
+ if (this._backtrack) {
688
+ t = !1;
689
+ continue;
690
+ } else return !1;
691
+ } else if (!this.options.flex) break;
692
+ }
693
+ return t ? (e = this.test_match(t, i[r]), e === !1 ? !1 : e) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), {
694
+ text: "",
695
+ token: null,
696
+ line: this.yylineno
697
+ });
698
+ }, "next"),
699
+ lex: /* @__PURE__ */ s(function() {
700
+ return this.next() || this.lex();
701
+ }, "lex"),
702
+ begin: /* @__PURE__ */ s(function(e) {
703
+ this.conditionStack.push(e);
704
+ }, "begin"),
705
+ popState: /* @__PURE__ */ s(function() {
706
+ return this.conditionStack.length - 1 > 0 ? this.conditionStack.pop() : this.conditionStack[0];
707
+ }, "popState"),
708
+ _currentRules: /* @__PURE__ */ s(function() {
709
+ return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
710
+ }, "_currentRules"),
711
+ topState: /* @__PURE__ */ s(function(e) {
712
+ return e = this.conditionStack.length - 1 - Math.abs(e || 0), e >= 0 ? this.conditionStack[e] : "INITIAL";
713
+ }, "topState"),
714
+ pushState: /* @__PURE__ */ s(function(e) {
715
+ this.begin(e);
716
+ }, "pushState"),
717
+ stateStackSize: /* @__PURE__ */ s(function() {
718
+ return this.conditionStack.length;
719
+ }, "stateStackSize"),
720
+ options: {},
721
+ performAction: /* @__PURE__ */ s(function(e, t, n, r) {
722
+ switch (n) {
723
+ case 0: return e.getLogger().debug("Found block-beta"), 10;
724
+ case 1: return e.getLogger().debug("Found id-block"), 29;
725
+ case 2: return e.getLogger().debug("Found block"), 10;
726
+ case 3:
727
+ e.getLogger().debug(".", t.yytext);
728
+ break;
729
+ case 4:
730
+ e.getLogger().debug("_", t.yytext);
731
+ break;
732
+ case 5: return 5;
733
+ case 6: return t.yytext = -1, 28;
734
+ case 7: return t.yytext = t.yytext.replace(/columns\s+/, ""), e.getLogger().debug("COLUMNS (LEX)", t.yytext), 28;
735
+ case 8:
736
+ this.pushState("md_string");
737
+ break;
738
+ case 9: return "MD_STR";
739
+ case 10:
740
+ this.popState();
741
+ break;
742
+ case 11:
743
+ this.pushState("string");
744
+ break;
745
+ case 12:
746
+ e.getLogger().debug("LEX: POPPING STR:", t.yytext), this.popState();
747
+ break;
748
+ case 13: return e.getLogger().debug("LEX: STR end:", t.yytext), "STR";
749
+ case 14: return t.yytext = t.yytext.replace(/space\:/, ""), e.getLogger().debug("SPACE NUM (LEX)", t.yytext), 21;
750
+ case 15: return t.yytext = "1", e.getLogger().debug("COLUMNS (LEX)", t.yytext), 21;
751
+ case 16: return 42;
752
+ case 17: return "LINKSTYLE";
753
+ case 18: return "INTERPOLATE";
754
+ case 19: return this.pushState("CLASSDEF"), 39;
755
+ case 20: return this.popState(), this.pushState("CLASSDEFID"), "DEFAULT_CLASSDEF_ID";
756
+ case 21: return this.popState(), this.pushState("CLASSDEFID"), 40;
757
+ case 22: return this.popState(), 41;
758
+ case 23: return this.pushState("CLASS"), 43;
759
+ case 24: return this.popState(), this.pushState("CLASS_STYLE"), 44;
760
+ case 25: return this.popState(), 45;
761
+ case 26: return this.pushState("STYLE_STMNT"), 46;
762
+ case 27: return this.popState(), this.pushState("STYLE_DEFINITION"), 47;
763
+ case 28: return this.popState(), 48;
764
+ case 29: return this.pushState("acc_title"), "acc_title";
765
+ case 30: return this.popState(), "acc_title_value";
766
+ case 31: return this.pushState("acc_descr"), "acc_descr";
767
+ case 32: return this.popState(), "acc_descr_value";
768
+ case 33:
769
+ this.pushState("acc_descr_multiline");
770
+ break;
771
+ case 34:
772
+ this.popState();
773
+ break;
774
+ case 35: return "acc_descr_multiline_value";
775
+ case 36: return 30;
776
+ case 37: return this.popState(), e.getLogger().debug("Lex: (("), "NODE_DEND";
777
+ case 38: return this.popState(), e.getLogger().debug("Lex: (("), "NODE_DEND";
778
+ case 39: return this.popState(), e.getLogger().debug("Lex: ))"), "NODE_DEND";
779
+ case 40: return this.popState(), e.getLogger().debug("Lex: (("), "NODE_DEND";
780
+ case 41: return this.popState(), e.getLogger().debug("Lex: (("), "NODE_DEND";
781
+ case 42: return this.popState(), e.getLogger().debug("Lex: (-"), "NODE_DEND";
782
+ case 43: return this.popState(), e.getLogger().debug("Lex: -)"), "NODE_DEND";
783
+ case 44: return this.popState(), e.getLogger().debug("Lex: (("), "NODE_DEND";
784
+ case 45: return this.popState(), e.getLogger().debug("Lex: ]]"), "NODE_DEND";
785
+ case 46: return this.popState(), e.getLogger().debug("Lex: ("), "NODE_DEND";
786
+ case 47: return this.popState(), e.getLogger().debug("Lex: ])"), "NODE_DEND";
787
+ case 48: return this.popState(), e.getLogger().debug("Lex: /]"), "NODE_DEND";
788
+ case 49: return this.popState(), e.getLogger().debug("Lex: /]"), "NODE_DEND";
789
+ case 50: return this.popState(), e.getLogger().debug("Lex: )]"), "NODE_DEND";
790
+ case 51: return this.popState(), e.getLogger().debug("Lex: )"), "NODE_DEND";
791
+ case 52: return this.popState(), e.getLogger().debug("Lex: ]>"), "NODE_DEND";
792
+ case 53: return this.popState(), e.getLogger().debug("Lex: ]"), "NODE_DEND";
793
+ case 54: return e.getLogger().debug("Lexa: -)"), this.pushState("NODE"), 35;
794
+ case 55: return e.getLogger().debug("Lexa: (-"), this.pushState("NODE"), 35;
795
+ case 56: return e.getLogger().debug("Lexa: ))"), this.pushState("NODE"), 35;
796
+ case 57: return e.getLogger().debug("Lexa: )"), this.pushState("NODE"), 35;
797
+ case 58: return e.getLogger().debug("Lex: ((("), this.pushState("NODE"), 35;
798
+ case 59: return e.getLogger().debug("Lexa: )"), this.pushState("NODE"), 35;
799
+ case 60: return e.getLogger().debug("Lexa: )"), this.pushState("NODE"), 35;
800
+ case 61: return e.getLogger().debug("Lexa: )"), this.pushState("NODE"), 35;
801
+ case 62: return e.getLogger().debug("Lexc: >"), this.pushState("NODE"), 35;
802
+ case 63: return e.getLogger().debug("Lexa: (["), this.pushState("NODE"), 35;
803
+ case 64: return e.getLogger().debug("Lexa: )"), this.pushState("NODE"), 35;
804
+ case 65: return this.pushState("NODE"), 35;
805
+ case 66: return this.pushState("NODE"), 35;
806
+ case 67: return this.pushState("NODE"), 35;
807
+ case 68: return this.pushState("NODE"), 35;
808
+ case 69: return this.pushState("NODE"), 35;
809
+ case 70: return this.pushState("NODE"), 35;
810
+ case 71: return this.pushState("NODE"), 35;
811
+ case 72: return e.getLogger().debug("Lexa: ["), this.pushState("NODE"), 35;
812
+ case 73: return this.pushState("BLOCK_ARROW"), e.getLogger().debug("LEX ARR START"), 37;
813
+ case 74: return e.getLogger().debug("Lex: NODE_ID", t.yytext), 31;
814
+ case 75: return e.getLogger().debug("Lex: EOF", t.yytext), 8;
815
+ case 76:
816
+ this.pushState("md_string");
817
+ break;
818
+ case 77:
819
+ this.pushState("md_string");
820
+ break;
821
+ case 78: return "NODE_DESCR";
822
+ case 79:
823
+ this.popState();
824
+ break;
825
+ case 80:
826
+ e.getLogger().debug("Lex: Starting string"), this.pushState("string");
827
+ break;
828
+ case 81:
829
+ e.getLogger().debug("LEX ARR: Starting string"), this.pushState("string");
830
+ break;
831
+ case 82: return e.getLogger().debug("LEX: NODE_DESCR:", t.yytext), "NODE_DESCR";
832
+ case 83:
833
+ e.getLogger().debug("LEX POPPING"), this.popState();
834
+ break;
835
+ case 84:
836
+ e.getLogger().debug("Lex: =>BAE"), this.pushState("ARROW_DIR");
837
+ break;
838
+ case 85: return t.yytext = t.yytext.replace(/^,\s*/, ""), e.getLogger().debug("Lex (right): dir:", t.yytext), "DIR";
839
+ case 86: return t.yytext = t.yytext.replace(/^,\s*/, ""), e.getLogger().debug("Lex (left):", t.yytext), "DIR";
840
+ case 87: return t.yytext = t.yytext.replace(/^,\s*/, ""), e.getLogger().debug("Lex (x):", t.yytext), "DIR";
841
+ case 88: return t.yytext = t.yytext.replace(/^,\s*/, ""), e.getLogger().debug("Lex (y):", t.yytext), "DIR";
842
+ case 89: return t.yytext = t.yytext.replace(/^,\s*/, ""), e.getLogger().debug("Lex (up):", t.yytext), "DIR";
843
+ case 90: return t.yytext = t.yytext.replace(/^,\s*/, ""), e.getLogger().debug("Lex (down):", t.yytext), "DIR";
844
+ case 91: return t.yytext = "]>", e.getLogger().debug("Lex (ARROW_DIR end):", t.yytext), this.popState(), this.popState(), "BLOCK_ARROW_END";
845
+ case 92: return e.getLogger().debug("Lex: LINK", "#" + t.yytext + "#"), 15;
846
+ case 93: return e.getLogger().debug("Lex: LINK", t.yytext), 15;
847
+ case 94: return e.getLogger().debug("Lex: LINK", t.yytext), 15;
848
+ case 95: return e.getLogger().debug("Lex: LINK", t.yytext), 15;
849
+ case 96: return e.getLogger().debug("Lex: START_LINK", t.yytext), this.pushState("LLABEL"), 16;
850
+ case 97: return e.getLogger().debug("Lex: START_LINK", t.yytext), this.pushState("LLABEL"), 16;
851
+ case 98: return e.getLogger().debug("Lex: START_LINK", t.yytext), this.pushState("LLABEL"), 16;
852
+ case 99:
853
+ this.pushState("md_string");
854
+ break;
855
+ case 100: return e.getLogger().debug("Lex: Starting string"), this.pushState("string"), "LINK_LABEL";
856
+ case 101: return this.popState(), e.getLogger().debug("Lex: LINK", "#" + t.yytext + "#"), 15;
857
+ case 102: return this.popState(), e.getLogger().debug("Lex: LINK", t.yytext), 15;
858
+ case 103: return this.popState(), e.getLogger().debug("Lex: LINK", t.yytext), 15;
859
+ case 104: return e.getLogger().debug("Lex: COLON", t.yytext), t.yytext = t.yytext.slice(1), 27;
860
+ }
861
+ }, "anonymous"),
862
+ rules: [
863
+ /^(?:block-beta\b)/,
864
+ /^(?:block:)/,
865
+ /^(?:block\b)/,
866
+ /^(?:[\s]+)/,
867
+ /^(?:[\n]+)/,
868
+ /^(?:((\u000D\u000A)|(\u000A)))/,
869
+ /^(?:columns\s+auto\b)/,
870
+ /^(?:columns\s+[\d]+)/,
871
+ /^(?:["][`])/,
872
+ /^(?:[^`"]+)/,
873
+ /^(?:[`]["])/,
874
+ /^(?:["])/,
875
+ /^(?:["])/,
876
+ /^(?:[^"]*)/,
877
+ /^(?:space[:]\d+)/,
878
+ /^(?:space\b)/,
879
+ /^(?:default\b)/,
880
+ /^(?:linkStyle\b)/,
881
+ /^(?:interpolate\b)/,
882
+ /^(?:classDef\s+)/,
883
+ /^(?:DEFAULT\s+)/,
884
+ /^(?:\w+\s+)/,
885
+ /^(?:[^\n]*)/,
886
+ /^(?:class\s+)/,
887
+ /^(?:(\w+)+((,\s*\w+)*))/,
888
+ /^(?:[^\n]*)/,
889
+ /^(?:style\s+)/,
890
+ /^(?:(\w+)+((,\s*\w+)*))/,
891
+ /^(?:[^\n]*)/,
892
+ /^(?:accTitle\s*:\s*)/,
893
+ /^(?:(?!\n||)*[^\n]*)/,
894
+ /^(?:accDescr\s*:\s*)/,
895
+ /^(?:(?!\n||)*[^\n]*)/,
896
+ /^(?:accDescr\s*\{\s*)/,
897
+ /^(?:[\}])/,
898
+ /^(?:[^\}]*)/,
899
+ /^(?:end\b\s*)/,
900
+ /^(?:\(\(\()/,
901
+ /^(?:\)\)\))/,
902
+ /^(?:[\)]\))/,
903
+ /^(?:\}\})/,
904
+ /^(?:\})/,
905
+ /^(?:\(-)/,
906
+ /^(?:-\))/,
907
+ /^(?:\(\()/,
908
+ /^(?:\]\])/,
909
+ /^(?:\()/,
910
+ /^(?:\]\))/,
911
+ /^(?:\\\])/,
912
+ /^(?:\/\])/,
913
+ /^(?:\)\])/,
914
+ /^(?:[\)])/,
915
+ /^(?:\]>)/,
916
+ /^(?:[\]])/,
917
+ /^(?:-\))/,
918
+ /^(?:\(-)/,
919
+ /^(?:\)\))/,
920
+ /^(?:\))/,
921
+ /^(?:\(\(\()/,
922
+ /^(?:\(\()/,
923
+ /^(?:\{\{)/,
924
+ /^(?:\{)/,
925
+ /^(?:>)/,
926
+ /^(?:\(\[)/,
927
+ /^(?:\()/,
928
+ /^(?:\[\[)/,
929
+ /^(?:\[\|)/,
930
+ /^(?:\[\()/,
931
+ /^(?:\)\)\))/,
932
+ /^(?:\[\\)/,
933
+ /^(?:\[\/)/,
934
+ /^(?:\[\\)/,
935
+ /^(?:\[)/,
936
+ /^(?:<\[)/,
937
+ /^(?:[^\(\[\n\-\)\{\}\s\<\>:]+)/,
938
+ /^(?:$)/,
939
+ /^(?:["][`])/,
940
+ /^(?:["][`])/,
941
+ /^(?:[^`"]+)/,
942
+ /^(?:[`]["])/,
943
+ /^(?:["])/,
944
+ /^(?:["])/,
945
+ /^(?:[^"]+)/,
946
+ /^(?:["])/,
947
+ /^(?:\]>\s*\()/,
948
+ /^(?:,?\s*right\s*)/,
949
+ /^(?:,?\s*left\s*)/,
950
+ /^(?:,?\s*x\s*)/,
951
+ /^(?:,?\s*y\s*)/,
952
+ /^(?:,?\s*up\s*)/,
953
+ /^(?:,?\s*down\s*)/,
954
+ /^(?:\)\s*)/,
955
+ /^(?:\s*[xo<]?--+[-xo>]\s*)/,
956
+ /^(?:\s*[xo<]?==+[=xo>]\s*)/,
957
+ /^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,
958
+ /^(?:\s*~~[\~]+\s*)/,
959
+ /^(?:\s*[xo<]?--\s*)/,
960
+ /^(?:\s*[xo<]?==\s*)/,
961
+ /^(?:\s*[xo<]?-\.\s*)/,
962
+ /^(?:["][`])/,
963
+ /^(?:["])/,
964
+ /^(?:\s*[xo<]?--+[-xo>]\s*)/,
965
+ /^(?:\s*[xo<]?==+[=xo>]\s*)/,
966
+ /^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,
967
+ /^(?::\d+)/
968
+ ],
969
+ conditions: {
970
+ STYLE_DEFINITION: {
971
+ rules: [28],
972
+ inclusive: !1
973
+ },
974
+ STYLE_STMNT: {
975
+ rules: [27],
976
+ inclusive: !1
977
+ },
978
+ CLASSDEFID: {
979
+ rules: [22],
980
+ inclusive: !1
981
+ },
982
+ CLASSDEF: {
983
+ rules: [20, 21],
984
+ inclusive: !1
985
+ },
986
+ CLASS_STYLE: {
987
+ rules: [25],
988
+ inclusive: !1
989
+ },
990
+ CLASS: {
991
+ rules: [24],
992
+ inclusive: !1
993
+ },
994
+ LLABEL: {
995
+ rules: [
996
+ 99,
997
+ 100,
998
+ 101,
999
+ 102,
1000
+ 103
1001
+ ],
1002
+ inclusive: !1
1003
+ },
1004
+ ARROW_DIR: {
1005
+ rules: [
1006
+ 85,
1007
+ 86,
1008
+ 87,
1009
+ 88,
1010
+ 89,
1011
+ 90,
1012
+ 91
1013
+ ],
1014
+ inclusive: !1
1015
+ },
1016
+ BLOCK_ARROW: {
1017
+ rules: [
1018
+ 76,
1019
+ 81,
1020
+ 84
1021
+ ],
1022
+ inclusive: !1
1023
+ },
1024
+ NODE: {
1025
+ rules: [
1026
+ 37,
1027
+ 38,
1028
+ 39,
1029
+ 40,
1030
+ 41,
1031
+ 42,
1032
+ 43,
1033
+ 44,
1034
+ 45,
1035
+ 46,
1036
+ 47,
1037
+ 48,
1038
+ 49,
1039
+ 50,
1040
+ 51,
1041
+ 52,
1042
+ 53,
1043
+ 77,
1044
+ 80
1045
+ ],
1046
+ inclusive: !1
1047
+ },
1048
+ md_string: {
1049
+ rules: [
1050
+ 9,
1051
+ 10,
1052
+ 78,
1053
+ 79
1054
+ ],
1055
+ inclusive: !1
1056
+ },
1057
+ space: {
1058
+ rules: [],
1059
+ inclusive: !1
1060
+ },
1061
+ string: {
1062
+ rules: [
1063
+ 12,
1064
+ 13,
1065
+ 82,
1066
+ 83
1067
+ ],
1068
+ inclusive: !1
1069
+ },
1070
+ acc_descr_multiline: {
1071
+ rules: [34, 35],
1072
+ inclusive: !1
1073
+ },
1074
+ acc_descr: {
1075
+ rules: [32],
1076
+ inclusive: !1
1077
+ },
1078
+ acc_title: {
1079
+ rules: [30],
1080
+ inclusive: !1
1081
+ },
1082
+ INITIAL: {
1083
+ rules: [
1084
+ 0,
1085
+ 1,
1086
+ 2,
1087
+ 3,
1088
+ 4,
1089
+ 5,
1090
+ 6,
1091
+ 7,
1092
+ 8,
1093
+ 11,
1094
+ 14,
1095
+ 15,
1096
+ 16,
1097
+ 17,
1098
+ 18,
1099
+ 19,
1100
+ 23,
1101
+ 26,
1102
+ 29,
1103
+ 31,
1104
+ 33,
1105
+ 36,
1106
+ 54,
1107
+ 55,
1108
+ 56,
1109
+ 57,
1110
+ 58,
1111
+ 59,
1112
+ 60,
1113
+ 61,
1114
+ 62,
1115
+ 63,
1116
+ 64,
1117
+ 65,
1118
+ 66,
1119
+ 67,
1120
+ 68,
1121
+ 69,
1122
+ 70,
1123
+ 71,
1124
+ 72,
1125
+ 73,
1126
+ 74,
1127
+ 75,
1128
+ 92,
1129
+ 93,
1130
+ 94,
1131
+ 95,
1132
+ 96,
1133
+ 97,
1134
+ 98,
1135
+ 104
1136
+ ],
1137
+ inclusive: !0
1138
+ }
1139
+ }
1140
+ };
1141
+ })();
1142
+ function v() {
1143
+ this.yy = {};
1144
+ }
1145
+ return s(v, "Parser"), v.prototype = _, _.Parser = v, new v();
1146
+ })();
1147
+ E.parser = E;
1148
+ var D = E, O = /* @__PURE__ */ new Map(), k = [], A = /* @__PURE__ */ new Map(), j = "color", M = "fill", ee = "bgFill", te = ",", ne = f(), N = /* @__PURE__ */ new Map(), re = /* @__PURE__ */ s((e) => h.sanitizeText(e, ne), "sanitizeText"), ie = /* @__PURE__ */ s(function(e, t = "") {
1149
+ let n = N.get(e);
1150
+ n || (n = {
1151
+ id: e,
1152
+ styles: [],
1153
+ textStyles: []
1154
+ }, N.set(e, n)), t?.split(te).forEach((e) => {
1155
+ let t = e.replace(/([^;]*);/, "$1").trim();
1156
+ if (RegExp(j).exec(e)) {
1157
+ let e = t.replace(M, ee).replace(j, M);
1158
+ n.textStyles.push(e);
1159
+ }
1160
+ n.styles.push(t);
1161
+ });
1162
+ }, "addStyleClass"), ae = /* @__PURE__ */ s(function(e, t = "") {
1163
+ let n = O.get(e);
1164
+ t != null && (n.styles = t.split(te));
1165
+ }, "addStyle2Node"), oe = /* @__PURE__ */ s(function(e, t) {
1166
+ e.split(",").forEach(function(e) {
1167
+ let n = O.get(e);
1168
+ if (n === void 0) {
1169
+ let t = e.trim();
1170
+ n = {
1171
+ id: t,
1172
+ type: "na",
1173
+ children: []
1174
+ }, O.set(t, n);
1175
+ }
1176
+ n.classes ||= [], n.classes.push(t);
1177
+ });
1178
+ }, "setCssClass"), se = /* @__PURE__ */ s((e, t) => {
1179
+ let n = e.flat(), r = [], a = n.find((e) => e?.type === "column-setting")?.columns ?? -1;
1180
+ for (let e of n) {
1181
+ if (typeof a == "number" && a > 0 && e.type !== "column-setting" && typeof e.widthInColumns == "number" && e.widthInColumns > a && o.warn(`Block ${e.id} width ${e.widthInColumns} exceeds configured column width ${a}`), e.label &&= re(e.label), e.type === "classDef") {
1182
+ ie(e.id, e.css);
1183
+ continue;
1184
+ }
1185
+ if (e.type === "applyClass") {
1186
+ oe(e.id, e?.styleClass ?? "");
1187
+ continue;
1188
+ }
1189
+ if (e.type === "applyStyles") {
1190
+ e?.stylesStr && ae(e.id, e?.stylesStr);
1191
+ continue;
1192
+ }
1193
+ if (e.type === "column-setting") t.columns = e.columns ?? -1;
1194
+ else if (e.type === "edge") {
1195
+ let t = (A.get(e.id) ?? 0) + 1;
1196
+ A.set(e.id, t), e.id = t + "-" + e.id, k.push(e);
1197
+ } else {
1198
+ e.label || (e.type === "composite" ? e.label = "" : e.label = e.id);
1199
+ let t = O.get(e.id);
1200
+ if (t === void 0 ? O.set(e.id, e) : (e.type !== "na" && (t.type = e.type), e.label !== e.id && (t.label = e.label)), e.children && se(e.children, e), e.type === "space") {
1201
+ let t = e.width ?? 1;
1202
+ for (let n = 0; n < t; n++) {
1203
+ let t = i(e);
1204
+ t.id = t.id + "-" + n, O.set(t.id, t), r.push(t);
1205
+ }
1206
+ } else t === void 0 && r.push(e);
1207
+ }
1208
+ }
1209
+ t.children = r;
1210
+ }, "populateBlockDatabase"), P = [], F = {
1211
+ id: "root",
1212
+ type: "composite",
1213
+ children: [],
1214
+ columns: -1
1215
+ }, ce = /* @__PURE__ */ s(() => {
1216
+ o.debug("Clear called"), d(), F = {
1217
+ id: "root",
1218
+ type: "composite",
1219
+ children: [],
1220
+ columns: -1
1221
+ }, O = /* @__PURE__ */ new Map([["root", F]]), P = [], N = /* @__PURE__ */ new Map(), k = [], A = /* @__PURE__ */ new Map();
1222
+ }, "clear");
1223
+ function le(e) {
1224
+ switch (o.debug("typeStr2Type", e), e) {
1225
+ case "[]": return "square";
1226
+ case "()": return o.debug("we have a round"), "round";
1227
+ case "(())": return "circle";
1228
+ case ">]": return "rect_left_inv_arrow";
1229
+ case "{}": return "diamond";
1230
+ case "{{}}": return "hexagon";
1231
+ case "([])": return "stadium";
1232
+ case "[[]]": return "subroutine";
1233
+ case "[()]": return "cylinder";
1234
+ case "((()))": return "doublecircle";
1235
+ case "[//]": return "lean_right";
1236
+ case "[\\\\]": return "lean_left";
1237
+ case "[/\\]": return "trapezoid";
1238
+ case "[\\/]": return "inv_trapezoid";
1239
+ case "<[]>": return "block_arrow";
1240
+ default: return "na";
1241
+ }
1242
+ }
1243
+ s(le, "typeStr2Type");
1244
+ function ue(e) {
1245
+ switch (o.debug("typeStr2Type", e), e) {
1246
+ case "==": return "thick";
1247
+ default: return "normal";
1248
+ }
1249
+ }
1250
+ s(ue, "edgeTypeStr2Type");
1251
+ function de(e) {
1252
+ switch (e.replace(/^[\s-]+|[\s-]+$/g, "")) {
1253
+ case "x": return "arrow_cross";
1254
+ case "o": return "arrow_circle";
1255
+ case ">": return "arrow_point";
1256
+ default: return "";
1257
+ }
1258
+ }
1259
+ s(de, "edgeStrToEdgeData");
1260
+ var fe = 0, pe = {
1261
+ getConfig: /* @__PURE__ */ s(() => _().block, "getConfig"),
1262
+ typeStr2Type: le,
1263
+ edgeTypeStr2Type: ue,
1264
+ edgeStrToEdgeData: de,
1265
+ getLogger: /* @__PURE__ */ s(() => o, "getLogger"),
1266
+ getBlocksFlat: /* @__PURE__ */ s(() => [...O.values()], "getBlocksFlat"),
1267
+ getBlocks: /* @__PURE__ */ s(() => P || [], "getBlocks"),
1268
+ getEdges: /* @__PURE__ */ s(() => k, "getEdges"),
1269
+ setHierarchy: /* @__PURE__ */ s((e) => {
1270
+ F.children = e, se(e, F), P = F.children;
1271
+ }, "setHierarchy"),
1272
+ getBlock: /* @__PURE__ */ s((e) => O.get(e), "getBlock"),
1273
+ setBlock: /* @__PURE__ */ s((e) => {
1274
+ O.set(e.id, e);
1275
+ }, "setBlock"),
1276
+ getColumns: /* @__PURE__ */ s((e) => {
1277
+ let t = O.get(e);
1278
+ return t ? t.columns ? t.columns : t.children ? t.children.length : -1 : -1;
1279
+ }, "getColumns"),
1280
+ getClasses: /* @__PURE__ */ s(function() {
1281
+ return N;
1282
+ }, "getClasses"),
1283
+ clear: ce,
1284
+ generateId: /* @__PURE__ */ s(() => (fe++, "id-" + Math.random().toString(36).substr(2, 12) + "-" + fe), "generateId")
1285
+ }, I = /* @__PURE__ */ s((e, t) => {
1286
+ let n = v;
1287
+ return m(n(e, "r"), n(e, "g"), n(e, "b"), t);
1288
+ }, "fade"), me = /* @__PURE__ */ s((e) => `.label {
1289
+ font-family: ${e.fontFamily};
1290
+ color: ${e.nodeTextColor || e.textColor};
1291
+ }
1292
+ .cluster-label text {
1293
+ fill: ${e.titleColor};
1294
+ }
1295
+ .cluster-label span,p {
1296
+ color: ${e.titleColor};
1297
+ }
1298
+
1299
+
1300
+
1301
+ .label text,span,p {
1302
+ fill: ${e.nodeTextColor || e.textColor};
1303
+ color: ${e.nodeTextColor || e.textColor};
1304
+ }
1305
+
1306
+ .node rect,
1307
+ .node circle,
1308
+ .node ellipse,
1309
+ .node polygon,
1310
+ .node path {
1311
+ fill: ${e.mainBkg};
1312
+ stroke: ${e.nodeBorder};
1313
+ stroke-width: 1px;
1314
+ }
1315
+ .flowchart-label text {
1316
+ text-anchor: middle;
1317
+ }
1318
+ // .flowchart-label .text-outer-tspan {
1319
+ // text-anchor: middle;
1320
+ // }
1321
+ // .flowchart-label .text-inner-tspan {
1322
+ // text-anchor: start;
1323
+ // }
1324
+
1325
+ .node .label {
1326
+ text-align: center;
1327
+ }
1328
+ .node.clickable {
1329
+ cursor: pointer;
1330
+ }
1331
+
1332
+ .arrowheadPath {
1333
+ fill: ${e.arrowheadColor};
1334
+ }
1335
+
1336
+ .edgePath .path {
1337
+ stroke: ${e.lineColor};
1338
+ stroke-width: 2.0px;
1339
+ }
1340
+
1341
+ .flowchart-link {
1342
+ stroke: ${e.lineColor};
1343
+ fill: none;
1344
+ }
1345
+
1346
+ .edgeLabel {
1347
+ background-color: ${e.edgeLabelBackground};
1348
+ /*
1349
+ * This is for backward compatibility with existing code that didn't
1350
+ * add a \`<p>\` around edge labels.
1351
+ *
1352
+ * TODO: We should probably remove this in a future release.
1353
+ */
1354
+ p {
1355
+ margin: 0;
1356
+ padding: 0;
1357
+ display: inline;
1358
+ }
1359
+ rect {
1360
+ opacity: 0.5;
1361
+ background-color: ${e.edgeLabelBackground};
1362
+ fill: ${e.edgeLabelBackground};
1363
+ }
1364
+ text-align: center;
1365
+ }
1366
+
1367
+ /* For html labels only */
1368
+ .labelBkg {
1369
+ background-color: ${e.edgeLabelBackground};
1370
+ }
1371
+
1372
+ .node .cluster {
1373
+ // fill: ${I(e.mainBkg, .5)};
1374
+ fill: ${I(e.clusterBkg, .5)};
1375
+ stroke: ${I(e.clusterBorder, .2)};
1376
+ box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px;
1377
+ stroke-width: 1px;
1378
+ }
1379
+
1380
+ .cluster text {
1381
+ fill: ${e.titleColor};
1382
+ }
1383
+
1384
+ .cluster span,p {
1385
+ color: ${e.titleColor};
1386
+ }
1387
+ /* .cluster div {
1388
+ color: ${e.titleColor};
1389
+ } */
1390
+
1391
+ div.mermaidTooltip {
1392
+ position: absolute;
1393
+ text-align: center;
1394
+ max-width: 200px;
1395
+ padding: 2px;
1396
+ font-family: ${e.fontFamily};
1397
+ font-size: 12px;
1398
+ background: ${e.tertiaryColor};
1399
+ border: 1px solid ${e.border2};
1400
+ border-radius: 2px;
1401
+ pointer-events: none;
1402
+ z-index: 100;
1403
+ }
1404
+
1405
+ .flowchartTitleText {
1406
+ text-anchor: middle;
1407
+ font-size: 18px;
1408
+ fill: ${e.textColor};
1409
+ }
1410
+ ${x()}
1411
+ `, "getStyles"), he = /* @__PURE__ */ s((e, t, n, r) => {
1412
+ t.forEach((t) => {
1413
+ ge[t](e, n, r);
1414
+ });
1415
+ }, "insertMarkers"), ge = {
1416
+ extension: /* @__PURE__ */ s((e, t, n) => {
1417
+ o.trace("Making markers for ", n), e.append("defs").append("marker").attr("id", n + "_" + t + "-extensionStart").attr("class", "marker extension " + t).attr("refX", 18).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 1,7 L18,13 V 1 Z"), e.append("defs").append("marker").attr("id", n + "_" + t + "-extensionEnd").attr("class", "marker extension " + t).attr("refX", 1).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 1,1 V 13 L18,7 Z");
1418
+ }, "extension"),
1419
+ composition: /* @__PURE__ */ s((e, t, n) => {
1420
+ e.append("defs").append("marker").attr("id", n + "_" + t + "-compositionStart").attr("class", "marker composition " + t).attr("refX", 18).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"), e.append("defs").append("marker").attr("id", n + "_" + t + "-compositionEnd").attr("class", "marker composition " + t).attr("refX", 1).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
1421
+ }, "composition"),
1422
+ aggregation: /* @__PURE__ */ s((e, t, n) => {
1423
+ e.append("defs").append("marker").attr("id", n + "_" + t + "-aggregationStart").attr("class", "marker aggregation " + t).attr("refX", 18).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"), e.append("defs").append("marker").attr("id", n + "_" + t + "-aggregationEnd").attr("class", "marker aggregation " + t).attr("refX", 1).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
1424
+ }, "aggregation"),
1425
+ dependency: /* @__PURE__ */ s((e, t, n) => {
1426
+ e.append("defs").append("marker").attr("id", n + "_" + t + "-dependencyStart").attr("class", "marker dependency " + t).attr("refX", 6).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 5,7 L9,13 L1,7 L9,1 Z"), e.append("defs").append("marker").attr("id", n + "_" + t + "-dependencyEnd").attr("class", "marker dependency " + t).attr("refX", 13).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");
1427
+ }, "dependency"),
1428
+ lollipop: /* @__PURE__ */ s((e, t, n) => {
1429
+ e.append("defs").append("marker").attr("id", n + "_" + t + "-lollipopStart").attr("class", "marker lollipop " + t).attr("refX", 13).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("circle").attr("stroke", "black").attr("fill", "transparent").attr("cx", 7).attr("cy", 7).attr("r", 6), e.append("defs").append("marker").attr("id", n + "_" + t + "-lollipopEnd").attr("class", "marker lollipop " + t).attr("refX", 1).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("circle").attr("stroke", "black").attr("fill", "transparent").attr("cx", 7).attr("cy", 7).attr("r", 6);
1430
+ }, "lollipop"),
1431
+ point: /* @__PURE__ */ s((e, t, n) => {
1432
+ e.append("marker").attr("id", n + "_" + t + "-pointEnd").attr("class", "marker " + t).attr("viewBox", "0 0 10 10").attr("refX", 6).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").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0"), e.append("marker").attr("id", n + "_" + t + "-pointStart").attr("class", "marker " + t).attr("viewBox", "0 0 10 10").attr("refX", 4.5).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto").append("path").attr("d", "M 0 5 L 10 10 L 10 0 z").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0");
1433
+ }, "point"),
1434
+ circle: /* @__PURE__ */ s((e, t, n) => {
1435
+ e.append("marker").attr("id", n + "_" + t + "-circleEnd").attr("class", "marker " + t).attr("viewBox", "0 0 10 10").attr("refX", 11).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("circle").attr("cx", "5").attr("cy", "5").attr("r", "5").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0"), e.append("marker").attr("id", n + "_" + t + "-circleStart").attr("class", "marker " + t).attr("viewBox", "0 0 10 10").attr("refX", -1).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("circle").attr("cx", "5").attr("cy", "5").attr("r", "5").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0");
1436
+ }, "circle"),
1437
+ cross: /* @__PURE__ */ s((e, t, n) => {
1438
+ e.append("marker").attr("id", n + "_" + t + "-crossEnd").attr("class", "marker cross " + t).attr("viewBox", "0 0 11 11").attr("refX", 12).attr("refY", 5.2).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("path").attr("d", "M 1,1 l 9,9 M 10,1 l -9,9").attr("class", "arrowMarkerPath").style("stroke-width", 2).style("stroke-dasharray", "1,0"), e.append("marker").attr("id", n + "_" + t + "-crossStart").attr("class", "marker cross " + t).attr("viewBox", "0 0 11 11").attr("refX", -1).attr("refY", 5.2).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("path").attr("d", "M 1,1 l 9,9 M 10,1 l -9,9").attr("class", "arrowMarkerPath").style("stroke-width", 2).style("stroke-dasharray", "1,0");
1439
+ }, "cross"),
1440
+ barb: /* @__PURE__ */ s((e, t, n) => {
1441
+ e.append("defs").append("marker").attr("id", n + "_" + t + "-barbEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 14).attr("markerUnits", "strokeWidth").attr("orient", "auto").append("path").attr("d", "M 19,7 L9,13 L14,7 L9,1 Z");
1442
+ }, "barb")
1443
+ }, _e = he, L = f()?.block?.padding ?? 8;
1444
+ function R(e, t) {
1445
+ if (e === 0 || !Number.isInteger(e)) throw Error("Columns must be an integer !== 0.");
1446
+ if (t < 0 || !Number.isInteger(t)) throw Error("Position must be a non-negative integer." + t);
1447
+ return e < 0 ? {
1448
+ px: t,
1449
+ py: 0
1450
+ } : e === 1 ? {
1451
+ px: 0,
1452
+ py: t
1453
+ } : {
1454
+ px: t % e,
1455
+ py: Math.floor(t / e)
1456
+ };
1457
+ }
1458
+ s(R, "calculateBlockPosition");
1459
+ var ve = /* @__PURE__ */ s((e) => {
1460
+ let t = 0, n = 0;
1461
+ for (let r of e.children) {
1462
+ let { width: e, height: i, x: a, y: s } = r.size ?? {
1463
+ width: 0,
1464
+ height: 0,
1465
+ x: 0,
1466
+ y: 0
1467
+ };
1468
+ o.debug("getMaxChildSize abc95 child:", r.id, "width:", e, "height:", i, "x:", a, "y:", s, r.type), r.type !== "space" && (e > t && (t = e / (r.widthInColumns ?? 1)), i > n && (n = i));
1469
+ }
1470
+ return {
1471
+ width: t,
1472
+ height: n
1473
+ };
1474
+ }, "getMaxChildSize");
1475
+ function z(e, t, n = 0, r = 0) {
1476
+ o.debug("setBlockSizes abc95 (start)", e.id, e?.size?.x, "block width =", e?.size, "siblingWidth", n), e?.size?.width || (e.size = {
1477
+ width: n,
1478
+ height: r,
1479
+ x: 0,
1480
+ y: 0
1481
+ });
1482
+ let i = 0, a = 0;
1483
+ if (e.children?.length > 0) {
1484
+ for (let n of e.children) z(n, t);
1485
+ let s = ve(e);
1486
+ i = s.width, a = s.height, o.debug("setBlockSizes abc95 maxWidth of", e.id, ":s children is ", i, a);
1487
+ for (let t of e.children) t.size && (o.debug(`abc95 Setting size of children of ${e.id} id=${t.id} ${i} ${a} ${JSON.stringify(t.size)}`), t.size.width = i * (t.widthInColumns ?? 1) + L * ((t.widthInColumns ?? 1) - 1), t.size.height = a, t.size.x = 0, t.size.y = 0, o.debug(`abc95 updating size of ${e.id} children child:${t.id} maxWidth:${i} maxHeight:${a}`));
1488
+ for (let n of e.children) z(n, t, i, a);
1489
+ let c = e.columns ?? -1, l = 0;
1490
+ for (let t of e.children) l += t.widthInColumns ?? 1;
1491
+ let u = e.children.length;
1492
+ c > 0 && c < l && (u = c);
1493
+ let d = Math.ceil(l / u), f = u * (i + L) + L, p = d * (a + L) + L;
1494
+ if (f < n) {
1495
+ o.debug(`Detected to small sibling: abc95 ${e.id} siblingWidth ${n} siblingHeight ${r} width ${f}`), f = n, p = r;
1496
+ let t = (n - u * L - L) / u, s = (r - d * L - L) / d;
1497
+ o.debug("Size indata abc88", e.id, "childWidth", t, "maxWidth", i), o.debug("Size indata abc88", e.id, "childHeight", s, "maxHeight", a), o.debug("Size indata abc88 xSize", u, "padding", L);
1498
+ for (let n of e.children) n.size && (n.size.width = t, n.size.height = s, n.size.x = 0, n.size.y = 0);
1499
+ }
1500
+ if (o.debug(`abc95 (finale calc) ${e.id} xSize ${u} ySize ${d} columns ${c}${e.children.length} width=${Math.max(f, e.size?.width || 0)}`), f < (e?.size?.width || 0)) {
1501
+ f = e?.size?.width || 0;
1502
+ let t = c > 0 ? Math.min(e.children.length, c) : e.children.length;
1503
+ if (t > 0) {
1504
+ let n = (f - t * L - L) / t;
1505
+ o.debug("abc95 (growing to fit) width", e.id, f, e.size?.width, n);
1506
+ for (let t of e.children) t.size && (t.size.width = n);
1507
+ }
1508
+ }
1509
+ e.size = {
1510
+ width: f,
1511
+ height: p,
1512
+ x: 0,
1513
+ y: 0
1514
+ };
1515
+ }
1516
+ o.debug("setBlockSizes abc94 (done)", e.id, e?.size?.x, e?.size?.width, e?.size?.y, e?.size?.height);
1517
+ }
1518
+ s(z, "setBlockSizes");
1519
+ function ye(e, t) {
1520
+ o.debug(`abc85 layout blocks (=>layoutBlocks) ${e.id} x: ${e?.size?.x} y: ${e?.size?.y} width: ${e?.size?.width}`);
1521
+ let n = e.columns ?? -1;
1522
+ if (o.debug("layoutBlocks columns abc95", e.id, "=>", n, e), e.children && e.children.length > 0) {
1523
+ let r = e?.children[0]?.size?.width ?? 0, i = e.children.length * r + (e.children.length - 1) * L;
1524
+ o.debug("widthOfChildren 88", i, "posX");
1525
+ let a = /* @__PURE__ */ new Map();
1526
+ {
1527
+ let t = 0;
1528
+ for (let r of e.children) {
1529
+ if (!r.size) continue;
1530
+ let { py: e } = R(n, t), i = a.get(e) ?? 0;
1531
+ r.size.height > i && a.set(e, r.size.height);
1532
+ let o = r?.widthInColumns ?? 1;
1533
+ n > 0 && (o = Math.min(o, n - t % n)), t += o;
1534
+ }
1535
+ }
1536
+ let s = /* @__PURE__ */ new Map();
1537
+ {
1538
+ let e = 0, t = [...a.keys()].sort((e, t) => e - t);
1539
+ for (let n of t) s.set(n, e), e += (a.get(n) ?? 0) + L;
1540
+ }
1541
+ let c = 0;
1542
+ o.debug("abc91 block?.size?.x", e.id, e?.size?.x);
1543
+ let l = e?.size?.x ? e?.size?.x + (-e?.size?.width / 2 || 0) : -L, u = 0;
1544
+ for (let r of e.children) {
1545
+ let i = e;
1546
+ if (!r.size) continue;
1547
+ let { width: d, height: f } = r.size, { px: p, py: m } = R(n, c);
1548
+ if (m != u && (u = m, l = e?.size?.x ? e?.size?.x + (-e?.size?.width / 2 || 0) : -L, o.debug("New row in layout for block", e.id, " and child ", r.id, u)), o.debug(`abc89 layout blocks (child) id: ${r.id} Pos: ${c} (px, py) ${p},${m} (${i?.size?.x},${i?.size?.y}) parent: ${i.id} width: ${d}${L}`), i.size) {
1549
+ let e = d / 2;
1550
+ r.size.x = l + L + e, o.debug(`abc91 layout blocks (calc) px, pyid:${r.id} startingPos=X${l} new startingPosX${r.size.x} ${e} padding=${L} width=${d} halfWidth=${e} => x:${r.size.x} y:${r.size.y} ${r.widthInColumns} (width * (child?.w || 1)) / 2 ${d * (r?.widthInColumns ?? 1) / 2}`), l = r.size.x + e;
1551
+ let t = s.get(m) ?? 0, n = a.get(m) ?? f;
1552
+ r.size.y = i.size.y - i.size.height / 2 + t + n / 2 + L, o.debug(`abc88 layout blocks (calc) px, pyid:${r.id}startingPosX${l}${L}${e}=>x:${r.size.x}y:${r.size.y}${r.widthInColumns}(width * (child?.w || 1)) / 2${d * (r?.widthInColumns ?? 1) / 2}`);
1553
+ }
1554
+ r.children && ye(r, t);
1555
+ let h = r?.widthInColumns ?? 1;
1556
+ n > 0 && (h = Math.min(h, n - c % n)), c += h, o.debug("abc88 columnsPos", r, c);
1557
+ }
1558
+ }
1559
+ o.debug(`layout blocks (<==layoutBlocks) ${e.id} x: ${e?.size?.x} y: ${e?.size?.y} width: ${e?.size?.width}`);
1560
+ }
1561
+ s(ye, "layoutBlocks");
1562
+ function be(e, { minX: t, minY: n, maxX: r, maxY: i } = {
1563
+ minX: 0,
1564
+ minY: 0,
1565
+ maxX: 0,
1566
+ maxY: 0
1567
+ }) {
1568
+ if (e.size && e.id !== "root") {
1569
+ let { x: a, y: o, width: s, height: c } = e.size;
1570
+ a - s / 2 < t && (t = a - s / 2), o - c / 2 < n && (n = o - c / 2), a + s / 2 > r && (r = a + s / 2), o + c / 2 > i && (i = o + c / 2);
1571
+ }
1572
+ if (e.children) for (let a of e.children) ({minX: t, minY: n, maxX: r, maxY: i} = be(a, {
1573
+ minX: t,
1574
+ minY: n,
1575
+ maxX: r,
1576
+ maxY: i
1577
+ }));
1578
+ return {
1579
+ minX: t,
1580
+ minY: n,
1581
+ maxX: r,
1582
+ maxY: i
1583
+ };
1584
+ }
1585
+ s(be, "findBounds");
1586
+ function xe(e) {
1587
+ let t = e.getBlock("root");
1588
+ if (!t) return;
1589
+ z(t, e, 0, 0), ye(t, e), o.debug("getBlocks", JSON.stringify(t, null, 2));
1590
+ let { minX: n, minY: r, maxX: i, maxY: a } = be(t), s = a - r;
1591
+ return {
1592
+ x: n,
1593
+ y: r,
1594
+ width: i - n,
1595
+ height: s
1596
+ };
1597
+ }
1598
+ s(xe, "layout");
1599
+ var B = /* @__PURE__ */ s(async (e, t, n, r = !1, i = !1) => {
1600
+ let a = t || "";
1601
+ typeof a == "object" && (a = a[0]);
1602
+ let o = f(), s = g(o);
1603
+ return await b(e, a, {
1604
+ style: n,
1605
+ isTitle: r,
1606
+ useHtmlLabels: s,
1607
+ markdown: !1,
1608
+ isNode: i,
1609
+ width: Infinity
1610
+ }, o);
1611
+ }, "createLabel"), Se = /* @__PURE__ */ s((e, t, n, r, i) => {
1612
+ t.arrowTypeStart && we(e, "start", t.arrowTypeStart, n, r, i), t.arrowTypeEnd && we(e, "end", t.arrowTypeEnd, n, r, i);
1613
+ }, "addEdgeMarkers"), Ce = {
1614
+ arrow_cross: "cross",
1615
+ arrow_point: "point",
1616
+ arrow_barb: "barb",
1617
+ arrow_circle: "circle",
1618
+ aggregation: "aggregation",
1619
+ extension: "extension",
1620
+ composition: "composition",
1621
+ dependency: "dependency",
1622
+ lollipop: "lollipop"
1623
+ }, we = /* @__PURE__ */ s((e, t, n, r, i, a) => {
1624
+ let s = Ce[n];
1625
+ if (!s) {
1626
+ o.warn(`Unknown arrow type: ${n}`);
1627
+ return;
1628
+ }
1629
+ let c = t === "start" ? "Start" : "End";
1630
+ e.attr(`marker-${t}`, `url(${r}#${i}_${a}-${s}${c})`);
1631
+ }, "addEdgeMarker"), V = {}, H = {}, Te = /* @__PURE__ */ s(async (e, t) => {
1632
+ let n = f(), r = g(n), i = e.insert("g").attr("class", "edgeLabel"), a = i.insert("g").attr("class", "label"), o = t.labelType === "markdown", s = await b(e, t.label, {
1633
+ style: t.labelStyle,
1634
+ useHtmlLabels: r,
1635
+ addSvgBackground: o,
1636
+ isNode: !1,
1637
+ markdown: o,
1638
+ width: o ? void 0 : Infinity
1639
+ }, n);
1640
+ a.node().appendChild(s);
1641
+ let l = s.getBBox(), u = l;
1642
+ if (r) {
1643
+ let e = s.children[0], t = c(s);
1644
+ l = e.getBoundingClientRect(), u = l, t.attr("width", l.width), t.attr("height", l.height);
1645
+ } else {
1646
+ let e = c(s).select("text").node();
1647
+ e && typeof e.getBBox == "function" && (u = e.getBBox());
1648
+ }
1649
+ a.attr("transform", C(u, r)), V[t.id] = i, t.width = l.width, t.height = l.height;
1650
+ let d;
1651
+ if (t.startLabelLeft) {
1652
+ let n = e.insert("g").attr("class", "edgeTerminals"), i = n.insert("g").attr("class", "inner"), a = await B(i, t.startLabelLeft, t.labelStyle);
1653
+ d = a;
1654
+ let o = a.getBBox();
1655
+ if (r) {
1656
+ let e = a.children[0], t = c(a);
1657
+ o = e.getBoundingClientRect(), t.attr("width", o.width), t.attr("height", o.height);
1658
+ }
1659
+ i.attr("transform", C(o, r)), H[t.id] || (H[t.id] = {}), H[t.id].startLeft = n, U(d, t.startLabelLeft);
1660
+ }
1661
+ if (t.startLabelRight) {
1662
+ let n = e.insert("g").attr("class", "edgeTerminals"), i = n.insert("g").attr("class", "inner"), a = await B(n, t.startLabelRight, t.labelStyle);
1663
+ d = a, i.node().appendChild(a);
1664
+ let o = a.getBBox();
1665
+ if (r) {
1666
+ let e = a.children[0], t = c(a);
1667
+ o = e.getBoundingClientRect(), t.attr("width", o.width), t.attr("height", o.height);
1668
+ }
1669
+ i.attr("transform", C(o, r)), H[t.id] || (H[t.id] = {}), H[t.id].startRight = n, U(d, t.startLabelRight);
1670
+ }
1671
+ if (t.endLabelLeft) {
1672
+ let n = e.insert("g").attr("class", "edgeTerminals"), i = n.insert("g").attr("class", "inner"), a = await B(i, t.endLabelLeft, t.labelStyle);
1673
+ d = a;
1674
+ let o = a.getBBox();
1675
+ if (r) {
1676
+ let e = a.children[0], t = c(a);
1677
+ o = e.getBoundingClientRect(), t.attr("width", o.width), t.attr("height", o.height);
1678
+ }
1679
+ i.attr("transform", C(o, r)), n.node().appendChild(a), H[t.id] || (H[t.id] = {}), H[t.id].endLeft = n, U(d, t.endLabelLeft);
1680
+ }
1681
+ if (t.endLabelRight) {
1682
+ let n = e.insert("g").attr("class", "edgeTerminals"), i = n.insert("g").attr("class", "inner"), a = await B(i, t.endLabelRight, t.labelStyle);
1683
+ d = a;
1684
+ let o = a.getBBox();
1685
+ if (r) {
1686
+ let e = a.children[0], t = c(a);
1687
+ o = e.getBoundingClientRect(), t.attr("width", o.width), t.attr("height", o.height);
1688
+ }
1689
+ i.attr("transform", C(o, r)), n.node().appendChild(a), H[t.id] || (H[t.id] = {}), H[t.id].endRight = n, U(d, t.endLabelRight);
1690
+ }
1691
+ return s;
1692
+ }, "insertEdgeLabel");
1693
+ function U(e, t) {
1694
+ g(f()) && e && (e.style.width = t.length * 9 + "px", e.style.height = "12px");
1695
+ }
1696
+ s(U, "setTerminalWidth");
1697
+ var Ee = /* @__PURE__ */ s((e, t) => {
1698
+ o.debug("Moving label abc88 ", e.id, e.label, V[e.id], t);
1699
+ let r = t.updatedPath ? t.updatedPath : t.originalPath, { subGraphTitleTotalMargin: i } = w(f());
1700
+ if (e.label) {
1701
+ let a = V[e.id], s = e.x, c = e.y;
1702
+ if (r) {
1703
+ let i = n.calcLabelPosition(r);
1704
+ o.debug("Moving label " + e.label + " from (", s, ",", c, ") to (", i.x, ",", i.y, ") abc88"), t.updatedPath && (s = i.x, c = i.y);
1705
+ }
1706
+ a.attr("transform", `translate(${s}, ${c + i / 2})`);
1707
+ }
1708
+ if (e.startLabelLeft) {
1709
+ let t = H[e.id].startLeft, i = e.x, a = e.y;
1710
+ if (r) {
1711
+ let t = n.calcTerminalLabelPosition(e.arrowTypeStart ? 10 : 0, "start_left", r);
1712
+ i = t.x, a = t.y;
1713
+ }
1714
+ t.attr("transform", `translate(${i}, ${a})`);
1715
+ }
1716
+ if (e.startLabelRight) {
1717
+ let t = H[e.id].startRight, i = e.x, a = e.y;
1718
+ if (r) {
1719
+ let t = n.calcTerminalLabelPosition(e.arrowTypeStart ? 10 : 0, "start_right", r);
1720
+ i = t.x, a = t.y;
1721
+ }
1722
+ t.attr("transform", `translate(${i}, ${a})`);
1723
+ }
1724
+ if (e.endLabelLeft) {
1725
+ let t = H[e.id].endLeft, i = e.x, a = e.y;
1726
+ if (r) {
1727
+ let t = n.calcTerminalLabelPosition(e.arrowTypeEnd ? 10 : 0, "end_left", r);
1728
+ i = t.x, a = t.y;
1729
+ }
1730
+ t.attr("transform", `translate(${i}, ${a})`);
1731
+ }
1732
+ if (e.endLabelRight) {
1733
+ let t = H[e.id].endRight, i = e.x, a = e.y;
1734
+ if (r) {
1735
+ let t = n.calcTerminalLabelPosition(e.arrowTypeEnd ? 10 : 0, "end_right", r);
1736
+ i = t.x, a = t.y;
1737
+ }
1738
+ t.attr("transform", `translate(${i}, ${a})`);
1739
+ }
1740
+ }, "positionEdgeLabel"), De = /* @__PURE__ */ s((e, t) => {
1741
+ let n = e.x, r = e.y, i = Math.abs(t.x - n), a = Math.abs(t.y - r), o = e.width / 2, s = e.height / 2;
1742
+ return i >= o || a >= s;
1743
+ }, "outsideNode"), Oe = /* @__PURE__ */ s((e, t, n) => {
1744
+ o.debug(`intersection calc abc89:
1745
+ outsidePoint: ${JSON.stringify(t)}
1746
+ insidePoint : ${JSON.stringify(n)}
1747
+ node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);
1748
+ let r = e.x, i = e.y, a = Math.abs(r - n.x), s = e.width / 2, c = n.x < t.x ? s - a : s + a, l = e.height / 2, u = Math.abs(t.y - n.y), d = Math.abs(t.x - n.x);
1749
+ if (Math.abs(i - t.y) * s > Math.abs(r - t.x) * l) {
1750
+ let e = n.y < t.y ? t.y - l - i : i - l - t.y;
1751
+ c = d * e / u;
1752
+ let r = {
1753
+ x: n.x < t.x ? n.x + c : n.x - d + c,
1754
+ y: n.y < t.y ? n.y + u - e : n.y - u + e
1755
+ };
1756
+ return c === 0 && (r.x = t.x, r.y = t.y), d === 0 && (r.x = t.x), u === 0 && (r.y = t.y), o.debug(`abc89 topp/bott calc, Q ${u}, q ${e}, R ${d}, r ${c}`, r), r;
1757
+ } else {
1758
+ c = n.x < t.x ? t.x - s - r : r - s - t.x;
1759
+ let e = u * c / d, i = n.x < t.x ? n.x + d - c : n.x - d + c, a = n.y < t.y ? n.y + e : n.y - e;
1760
+ return o.debug(`sides calc abc89, Q ${u}, q ${e}, R ${d}, r ${c}`, {
1761
+ _x: i,
1762
+ _y: a
1763
+ }), c === 0 && (i = t.x, a = t.y), d === 0 && (i = t.x), u === 0 && (a = t.y), {
1764
+ x: i,
1765
+ y: a
1766
+ };
1767
+ }
1768
+ }, "intersection"), ke = /* @__PURE__ */ s((e, t) => {
1769
+ o.debug("abc88 cutPathAtIntersect", e, t);
1770
+ let n = [], r = e[0], i = !1;
1771
+ return e.forEach((e) => {
1772
+ if (!De(t, e) && !i) {
1773
+ let a = Oe(t, r, e), o = !1;
1774
+ n.forEach((e) => {
1775
+ o ||= e.x === a.x && e.y === a.y;
1776
+ }), n.some((e) => e.x === a.x && e.y === a.y) || n.push(a), i = !0;
1777
+ } else r = e, i || n.push(e);
1778
+ }), n;
1779
+ }, "cutPathAtIntersect"), Ae = /* @__PURE__ */ s(function(t, n, r, i, a, s, c) {
1780
+ let u = r.points;
1781
+ o.debug("abc88 InsertEdge: edge=", r, "e=", n);
1782
+ let d = !1, p = s.node(n.v);
1783
+ var m = s.node(n.w);
1784
+ m?.intersect && p?.intersect && (u = u.slice(1, r.points.length - 1), u.unshift(p.intersect(u[0])), u.push(m.intersect(u[u.length - 1]))), r.toCluster && (o.debug("to cluster abc88", i[r.toCluster]), u = ke(r.points, i[r.toCluster].node), d = !0), r.fromCluster && (o.debug("from cluster abc88", i[r.fromCluster]), u = ke(u.reverse(), i[r.fromCluster].node).reverse(), d = !0);
1785
+ let h = u.filter((e) => !Number.isNaN(e.y)), g = e;
1786
+ r.curve && (a === "graph" || a === "flowchart") && (g = r.curve);
1787
+ let { x: _, y: v } = S(r), b = y().x(_).y(v).curve(g), x;
1788
+ switch (r.thickness) {
1789
+ case "normal":
1790
+ x = "edge-thickness-normal";
1791
+ break;
1792
+ case "thick":
1793
+ x = "edge-thickness-thick";
1794
+ break;
1795
+ case "invisible":
1796
+ x = "edge-thickness-thick";
1797
+ break;
1798
+ default: x = "";
1799
+ }
1800
+ switch (r.pattern) {
1801
+ case "solid":
1802
+ x += " edge-pattern-solid";
1803
+ break;
1804
+ case "dotted":
1805
+ x += " edge-pattern-dotted";
1806
+ break;
1807
+ case "dashed":
1808
+ x += " edge-pattern-dashed";
1809
+ break;
1810
+ }
1811
+ let C = t.append("path").attr("d", b(h)).attr("id", r.id).attr("class", " " + x + (r.classes ? " " + r.classes : "")).attr("style", r.style), w = "";
1812
+ (f().flowchart.arrowMarkerAbsolute || f().state.arrowMarkerAbsolute) && (w = l(!0)), Se(C, r, w, c, a);
1813
+ let T = {};
1814
+ return d && (T.updatedPath = u), T.originalPath = r.points, T;
1815
+ }, "insertEdge"), je = /* @__PURE__ */ s((e) => {
1816
+ let t = /* @__PURE__ */ new Set();
1817
+ for (let n of e) switch (n) {
1818
+ case "x":
1819
+ t.add("right"), t.add("left");
1820
+ break;
1821
+ case "y":
1822
+ t.add("up"), t.add("down");
1823
+ break;
1824
+ default:
1825
+ t.add(n);
1826
+ break;
1827
+ }
1828
+ return t;
1829
+ }, "expandAndDeduplicateDirections"), Me = /* @__PURE__ */ s((e, t, n) => {
1830
+ let r = je(e), i = t.height + 2 * n.padding, a = i / 2, o = t.width + 2 * a + n.padding, s = n.padding / 2;
1831
+ return r.has("right") && r.has("left") && r.has("up") && r.has("down") ? [
1832
+ {
1833
+ x: 0,
1834
+ y: 0
1835
+ },
1836
+ {
1837
+ x: a,
1838
+ y: 0
1839
+ },
1840
+ {
1841
+ x: o / 2,
1842
+ y: 2 * s
1843
+ },
1844
+ {
1845
+ x: o - a,
1846
+ y: 0
1847
+ },
1848
+ {
1849
+ x: o,
1850
+ y: 0
1851
+ },
1852
+ {
1853
+ x: o,
1854
+ y: -i / 3
1855
+ },
1856
+ {
1857
+ x: o + 2 * s,
1858
+ y: -i / 2
1859
+ },
1860
+ {
1861
+ x: o,
1862
+ y: -2 * i / 3
1863
+ },
1864
+ {
1865
+ x: o,
1866
+ y: -i
1867
+ },
1868
+ {
1869
+ x: o - a,
1870
+ y: -i
1871
+ },
1872
+ {
1873
+ x: o / 2,
1874
+ y: -i - 2 * s
1875
+ },
1876
+ {
1877
+ x: a,
1878
+ y: -i
1879
+ },
1880
+ {
1881
+ x: 0,
1882
+ y: -i
1883
+ },
1884
+ {
1885
+ x: 0,
1886
+ y: -2 * i / 3
1887
+ },
1888
+ {
1889
+ x: -2 * s,
1890
+ y: -i / 2
1891
+ },
1892
+ {
1893
+ x: 0,
1894
+ y: -i / 3
1895
+ }
1896
+ ] : r.has("right") && r.has("left") && r.has("up") ? [
1897
+ {
1898
+ x: a,
1899
+ y: 0
1900
+ },
1901
+ {
1902
+ x: o - a,
1903
+ y: 0
1904
+ },
1905
+ {
1906
+ x: o,
1907
+ y: -i / 2
1908
+ },
1909
+ {
1910
+ x: o - a,
1911
+ y: -i
1912
+ },
1913
+ {
1914
+ x: a,
1915
+ y: -i
1916
+ },
1917
+ {
1918
+ x: 0,
1919
+ y: -i / 2
1920
+ }
1921
+ ] : r.has("right") && r.has("left") && r.has("down") ? [
1922
+ {
1923
+ x: 0,
1924
+ y: 0
1925
+ },
1926
+ {
1927
+ x: a,
1928
+ y: -i
1929
+ },
1930
+ {
1931
+ x: o - a,
1932
+ y: -i
1933
+ },
1934
+ {
1935
+ x: o,
1936
+ y: 0
1937
+ }
1938
+ ] : r.has("right") && r.has("up") && r.has("down") ? [
1939
+ {
1940
+ x: 0,
1941
+ y: 0
1942
+ },
1943
+ {
1944
+ x: o,
1945
+ y: -a
1946
+ },
1947
+ {
1948
+ x: o,
1949
+ y: -i + a
1950
+ },
1951
+ {
1952
+ x: 0,
1953
+ y: -i
1954
+ }
1955
+ ] : r.has("left") && r.has("up") && r.has("down") ? [
1956
+ {
1957
+ x: o,
1958
+ y: 0
1959
+ },
1960
+ {
1961
+ x: 0,
1962
+ y: -a
1963
+ },
1964
+ {
1965
+ x: 0,
1966
+ y: -i + a
1967
+ },
1968
+ {
1969
+ x: o,
1970
+ y: -i
1971
+ }
1972
+ ] : r.has("right") && r.has("left") ? [
1973
+ {
1974
+ x: a,
1975
+ y: 0
1976
+ },
1977
+ {
1978
+ x: a,
1979
+ y: -s
1980
+ },
1981
+ {
1982
+ x: o - a,
1983
+ y: -s
1984
+ },
1985
+ {
1986
+ x: o - a,
1987
+ y: 0
1988
+ },
1989
+ {
1990
+ x: o,
1991
+ y: -i / 2
1992
+ },
1993
+ {
1994
+ x: o - a,
1995
+ y: -i
1996
+ },
1997
+ {
1998
+ x: o - a,
1999
+ y: -i + s
2000
+ },
2001
+ {
2002
+ x: a,
2003
+ y: -i + s
2004
+ },
2005
+ {
2006
+ x: a,
2007
+ y: -i
2008
+ },
2009
+ {
2010
+ x: 0,
2011
+ y: -i / 2
2012
+ }
2013
+ ] : r.has("up") && r.has("down") ? [
2014
+ {
2015
+ x: o / 2,
2016
+ y: 0
2017
+ },
2018
+ {
2019
+ x: 0,
2020
+ y: -s
2021
+ },
2022
+ {
2023
+ x: a,
2024
+ y: -s
2025
+ },
2026
+ {
2027
+ x: a,
2028
+ y: -i + s
2029
+ },
2030
+ {
2031
+ x: 0,
2032
+ y: -i + s
2033
+ },
2034
+ {
2035
+ x: o / 2,
2036
+ y: -i
2037
+ },
2038
+ {
2039
+ x: o,
2040
+ y: -i + s
2041
+ },
2042
+ {
2043
+ x: o - a,
2044
+ y: -i + s
2045
+ },
2046
+ {
2047
+ x: o - a,
2048
+ y: -s
2049
+ },
2050
+ {
2051
+ x: o,
2052
+ y: -s
2053
+ }
2054
+ ] : r.has("right") && r.has("up") ? [
2055
+ {
2056
+ x: 0,
2057
+ y: 0
2058
+ },
2059
+ {
2060
+ x: o,
2061
+ y: -a
2062
+ },
2063
+ {
2064
+ x: 0,
2065
+ y: -i
2066
+ }
2067
+ ] : r.has("right") && r.has("down") ? [
2068
+ {
2069
+ x: 0,
2070
+ y: 0
2071
+ },
2072
+ {
2073
+ x: o,
2074
+ y: 0
2075
+ },
2076
+ {
2077
+ x: 0,
2078
+ y: -i
2079
+ }
2080
+ ] : r.has("left") && r.has("up") ? [
2081
+ {
2082
+ x: o,
2083
+ y: 0
2084
+ },
2085
+ {
2086
+ x: 0,
2087
+ y: -a
2088
+ },
2089
+ {
2090
+ x: o,
2091
+ y: -i
2092
+ }
2093
+ ] : r.has("left") && r.has("down") ? [
2094
+ {
2095
+ x: o,
2096
+ y: 0
2097
+ },
2098
+ {
2099
+ x: 0,
2100
+ y: 0
2101
+ },
2102
+ {
2103
+ x: o,
2104
+ y: -i
2105
+ }
2106
+ ] : r.has("right") ? [
2107
+ {
2108
+ x: a,
2109
+ y: -s
2110
+ },
2111
+ {
2112
+ x: a,
2113
+ y: -s
2114
+ },
2115
+ {
2116
+ x: o - a,
2117
+ y: -s
2118
+ },
2119
+ {
2120
+ x: o - a,
2121
+ y: 0
2122
+ },
2123
+ {
2124
+ x: o,
2125
+ y: -i / 2
2126
+ },
2127
+ {
2128
+ x: o - a,
2129
+ y: -i
2130
+ },
2131
+ {
2132
+ x: o - a,
2133
+ y: -i + s
2134
+ },
2135
+ {
2136
+ x: a,
2137
+ y: -i + s
2138
+ },
2139
+ {
2140
+ x: a,
2141
+ y: -i + s
2142
+ }
2143
+ ] : r.has("left") ? [
2144
+ {
2145
+ x: a,
2146
+ y: 0
2147
+ },
2148
+ {
2149
+ x: a,
2150
+ y: -s
2151
+ },
2152
+ {
2153
+ x: o - a,
2154
+ y: -s
2155
+ },
2156
+ {
2157
+ x: o - a,
2158
+ y: -i + s
2159
+ },
2160
+ {
2161
+ x: a,
2162
+ y: -i + s
2163
+ },
2164
+ {
2165
+ x: a,
2166
+ y: -i
2167
+ },
2168
+ {
2169
+ x: 0,
2170
+ y: -i / 2
2171
+ }
2172
+ ] : r.has("up") ? [
2173
+ {
2174
+ x: a,
2175
+ y: -s
2176
+ },
2177
+ {
2178
+ x: a,
2179
+ y: -i + s
2180
+ },
2181
+ {
2182
+ x: 0,
2183
+ y: -i + s
2184
+ },
2185
+ {
2186
+ x: o / 2,
2187
+ y: -i
2188
+ },
2189
+ {
2190
+ x: o,
2191
+ y: -i + s
2192
+ },
2193
+ {
2194
+ x: o - a,
2195
+ y: -i + s
2196
+ },
2197
+ {
2198
+ x: o - a,
2199
+ y: -s
2200
+ }
2201
+ ] : r.has("down") ? [
2202
+ {
2203
+ x: o / 2,
2204
+ y: 0
2205
+ },
2206
+ {
2207
+ x: 0,
2208
+ y: -s
2209
+ },
2210
+ {
2211
+ x: a,
2212
+ y: -s
2213
+ },
2214
+ {
2215
+ x: a,
2216
+ y: -i + s
2217
+ },
2218
+ {
2219
+ x: o - a,
2220
+ y: -i + s
2221
+ },
2222
+ {
2223
+ x: o - a,
2224
+ y: -s
2225
+ },
2226
+ {
2227
+ x: o,
2228
+ y: -s
2229
+ }
2230
+ ] : [{
2231
+ x: 0,
2232
+ y: 0
2233
+ }];
2234
+ }, "getArrowPoints");
2235
+ function Ne(e, t) {
2236
+ return e.intersect(t);
2237
+ }
2238
+ s(Ne, "intersectNode");
2239
+ var Pe = Ne;
2240
+ function Fe(e, t, n, r) {
2241
+ var i = e.x, a = e.y, o = i - r.x, s = a - r.y, c = Math.sqrt(t * t * s * s + n * n * o * o), l = Math.abs(t * n * o / c);
2242
+ r.x < i && (l = -l);
2243
+ var u = Math.abs(t * n * s / c);
2244
+ return r.y < a && (u = -u), {
2245
+ x: i + l,
2246
+ y: a + u
2247
+ };
2248
+ }
2249
+ s(Fe, "intersectEllipse");
2250
+ var Ie = Fe;
2251
+ function Le(e, t, n) {
2252
+ return Ie(e, t, t, n);
2253
+ }
2254
+ s(Le, "intersectCircle");
2255
+ var Re = Le;
2256
+ function ze(e, t, n, r) {
2257
+ var i = t.y - e.y, a, o = e.x - t.x, s, c = t.x * e.y - e.x * t.y, l, u, d, f = i * n.x + o * n.y + c, p = i * r.x + o * r.y + c, m, h, g, _, v;
2258
+ if (!(f !== 0 && p !== 0 && W(f, p)) && (a = r.y - n.y, s = n.x - r.x, l = r.x * n.y - n.x * r.y, u = a * e.x + s * e.y + l, d = a * t.x + s * t.y + l, !(u !== 0 && d !== 0 && W(u, d)) && (m = i * s - a * o, m !== 0))) return h = Math.abs(m / 2), g = o * l - s * c, _ = g < 0 ? (g - h) / m : (g + h) / m, g = a * c - i * l, v = g < 0 ? (g - h) / m : (g + h) / m, {
2259
+ x: _,
2260
+ y: v
2261
+ };
2262
+ }
2263
+ s(ze, "intersectLine");
2264
+ function W(e, t) {
2265
+ return e * t > 0;
2266
+ }
2267
+ s(W, "sameSign");
2268
+ var Be = ze, Ve = He;
2269
+ function He(e, t, n) {
2270
+ var r = e.x, i = e.y, a = [], o = Infinity, s = Infinity;
2271
+ typeof t.forEach == "function" ? t.forEach(function(e) {
2272
+ o = Math.min(o, e.x), s = Math.min(s, e.y);
2273
+ }) : (o = Math.min(o, t.x), s = Math.min(s, t.y));
2274
+ for (var c = r - e.width / 2 - o, l = i - e.height / 2 - s, u = 0; u < t.length; u++) {
2275
+ var d = t[u], f = t[u < t.length - 1 ? u + 1 : 0], p = Be(e, n, {
2276
+ x: c + d.x,
2277
+ y: l + d.y
2278
+ }, {
2279
+ x: c + f.x,
2280
+ y: l + f.y
2281
+ });
2282
+ p && a.push(p);
2283
+ }
2284
+ return a.length ? (a.length > 1 && a.sort(function(e, t) {
2285
+ var r = e.x - n.x, i = e.y - n.y, a = Math.sqrt(r * r + i * i), o = t.x - n.x, s = t.y - n.y, c = Math.sqrt(o * o + s * s);
2286
+ return a < c ? -1 : a === c ? 0 : 1;
2287
+ }), a[0]) : e;
2288
+ }
2289
+ s(He, "intersectPolygon");
2290
+ var G = {
2291
+ node: Pe,
2292
+ circle: Re,
2293
+ ellipse: Ie,
2294
+ polygon: Ve,
2295
+ rect: /* @__PURE__ */ s((e, t) => {
2296
+ var n = e.x, r = e.y, i = t.x - n, a = t.y - r, o = e.width / 2, s = e.height / 2, c, l;
2297
+ return Math.abs(a) * o > Math.abs(i) * s ? (a < 0 && (s = -s), c = a === 0 ? 0 : s * i / a, l = s) : (i < 0 && (o = -o), c = o, l = i === 0 ? 0 : o * a / i), {
2298
+ x: n + c,
2299
+ y: r + l
2300
+ };
2301
+ }, "intersectRect")
2302
+ }, K = /* @__PURE__ */ s(async (e, t, n, i) => {
2303
+ let a = f(), o, s = t.useHtmlLabels || g(a);
2304
+ o = n || "node default";
2305
+ let l = e.insert("g").attr("class", o).attr("id", t.domId || t.id), d = l.insert("g").attr("class", "label").attr("style", t.labelStyle), p;
2306
+ p = t.labelText === void 0 ? "" : typeof t.labelText == "string" ? t.labelText : t.labelText[0];
2307
+ let m;
2308
+ m = t.labelType === "markdown" ? b(d, u(r(p), a), {
2309
+ useHtmlLabels: s,
2310
+ width: t.width || a.flowchart.wrappingWidth,
2311
+ classes: "markdown-node-label"
2312
+ }, a) : await B(d, u(r(p), a), t.labelStyle, !1, i);
2313
+ let h = m.getBBox(), _ = t.padding / 2;
2314
+ if (g(a)) {
2315
+ let e = m.children[0], t = c(m);
2316
+ await T(e, p), h = e.getBoundingClientRect(), t.attr("width", h.width), t.attr("height", h.height);
2317
+ }
2318
+ return s ? d.attr("transform", "translate(" + -h.width / 2 + ", " + -h.height / 2 + ")") : d.attr("transform", "translate(0, " + -h.height / 2 + ")"), t.centerLabel && d.attr("transform", "translate(" + -h.width / 2 + ", " + -h.height / 2 + ")"), d.insert("rect", ":first-child"), {
2319
+ shapeSvg: l,
2320
+ bbox: h,
2321
+ halfPadding: _,
2322
+ label: d
2323
+ };
2324
+ }, "labelHelper"), q = /* @__PURE__ */ s((e, t) => {
2325
+ let n = t.node().getBBox();
2326
+ e.width = n.width, e.height = n.height;
2327
+ }, "updateNodeBounds");
2328
+ function J(e, t, n, r) {
2329
+ return e.insert("polygon", ":first-child").attr("points", r.map(function(e) {
2330
+ return e.x + "," + e.y;
2331
+ }).join(" ")).attr("class", "label-container").attr("transform", "translate(" + -t / 2 + "," + n / 2 + ")");
2332
+ }
2333
+ s(J, "insertPolygonShape");
2334
+ var Ue = /* @__PURE__ */ s(async (e, t) => {
2335
+ t.useHtmlLabels || g(f()) || (t.centerLabel = !0);
2336
+ let { shapeSvg: n, bbox: r, halfPadding: i } = await K(e, t, "node " + t.classes, !0);
2337
+ o.info("Classes = ", t.classes);
2338
+ let a = n.insert("rect", ":first-child");
2339
+ return a.attr("rx", t.rx).attr("ry", t.ry).attr("x", -r.width / 2 - i).attr("y", -r.height / 2 - i).attr("width", r.width + t.padding).attr("height", r.height + t.padding), q(t, a), t.intersect = function(e) {
2340
+ return G.rect(t, e);
2341
+ }, n;
2342
+ }, "note"), We = /* @__PURE__ */ s((e) => e ? " " + e : "", "formatClass"), Y = /* @__PURE__ */ s((e, t) => `${t || "node default"}${We(e.classes)} ${We(e.class)}`, "getClassesFromNode"), Ge = /* @__PURE__ */ s(async (e, t) => {
2343
+ let { shapeSvg: n, bbox: r } = await K(e, t, Y(t, void 0), !0), i = r.width + t.padding + (r.height + t.padding), a = [
2344
+ {
2345
+ x: i / 2,
2346
+ y: 0
2347
+ },
2348
+ {
2349
+ x: i,
2350
+ y: -i / 2
2351
+ },
2352
+ {
2353
+ x: i / 2,
2354
+ y: -i
2355
+ },
2356
+ {
2357
+ x: 0,
2358
+ y: -i / 2
2359
+ }
2360
+ ];
2361
+ o.info("Question main (Circle)");
2362
+ let s = J(n, i, i, a);
2363
+ return s.attr("style", t.style), q(t, s), t.intersect = function(e) {
2364
+ return o.warn("Intersect called"), G.polygon(t, a, e);
2365
+ }, n;
2366
+ }, "question"), Ke = /* @__PURE__ */ s((e, t) => {
2367
+ let n = e.insert("g").attr("class", "node default").attr("id", t.domId || t.id);
2368
+ return n.insert("polygon", ":first-child").attr("points", [
2369
+ {
2370
+ x: 0,
2371
+ y: 28 / 2
2372
+ },
2373
+ {
2374
+ x: 28 / 2,
2375
+ y: 0
2376
+ },
2377
+ {
2378
+ x: 0,
2379
+ y: -28 / 2
2380
+ },
2381
+ {
2382
+ x: -28 / 2,
2383
+ y: 0
2384
+ }
2385
+ ].map(function(e) {
2386
+ return e.x + "," + e.y;
2387
+ }).join(" ")).attr("class", "state-start").attr("r", 7).attr("width", 28).attr("height", 28), t.width = 28, t.height = 28, t.intersect = function(e) {
2388
+ return G.circle(t, 14, e);
2389
+ }, n;
2390
+ }, "choice"), qe = /* @__PURE__ */ s(async (e, t) => {
2391
+ let { shapeSvg: n, bbox: r } = await K(e, t, Y(t, void 0), !0), i = r.height + t.padding, a = i / 4, o = r.width + 2 * a + t.padding, s = [
2392
+ {
2393
+ x: a,
2394
+ y: 0
2395
+ },
2396
+ {
2397
+ x: o - a,
2398
+ y: 0
2399
+ },
2400
+ {
2401
+ x: o,
2402
+ y: -i / 2
2403
+ },
2404
+ {
2405
+ x: o - a,
2406
+ y: -i
2407
+ },
2408
+ {
2409
+ x: a,
2410
+ y: -i
2411
+ },
2412
+ {
2413
+ x: 0,
2414
+ y: -i / 2
2415
+ }
2416
+ ], c = J(n, o, i, s);
2417
+ return c.attr("style", t.style), q(t, c), t.intersect = function(e) {
2418
+ return G.polygon(t, s, e);
2419
+ }, n;
2420
+ }, "hexagon"), Je = /* @__PURE__ */ s(async (e, t) => {
2421
+ let { shapeSvg: n, bbox: r } = await K(e, t, void 0, !0), i = r.height + 2 * t.padding, a = i / 2, o = r.width + 2 * a + t.padding, s = Me(t.directions, r, t), c = J(n, o, i, s);
2422
+ return c.attr("style", t.style), q(t, c), t.intersect = function(e) {
2423
+ return G.polygon(t, s, e);
2424
+ }, n;
2425
+ }, "block_arrow"), Ye = /* @__PURE__ */ s(async (e, t) => {
2426
+ let { shapeSvg: n, bbox: r } = await K(e, t, Y(t, void 0), !0), i = r.width + t.padding, a = r.height + t.padding, o = [
2427
+ {
2428
+ x: -a / 2,
2429
+ y: 0
2430
+ },
2431
+ {
2432
+ x: i,
2433
+ y: 0
2434
+ },
2435
+ {
2436
+ x: i,
2437
+ y: -a
2438
+ },
2439
+ {
2440
+ x: -a / 2,
2441
+ y: -a
2442
+ },
2443
+ {
2444
+ x: 0,
2445
+ y: -a / 2
2446
+ }
2447
+ ];
2448
+ return J(n, i, a, o).attr("style", t.style), t.width = i + a, t.height = a, t.intersect = function(e) {
2449
+ return G.polygon(t, o, e);
2450
+ }, n;
2451
+ }, "rect_left_inv_arrow"), Xe = /* @__PURE__ */ s(async (e, t) => {
2452
+ let { shapeSvg: n, bbox: r } = await K(e, t, Y(t), !0), i = r.width + t.padding, a = r.height + t.padding, o = [
2453
+ {
2454
+ x: -2 * a / 6,
2455
+ y: 0
2456
+ },
2457
+ {
2458
+ x: i - a / 6,
2459
+ y: 0
2460
+ },
2461
+ {
2462
+ x: i + 2 * a / 6,
2463
+ y: -a
2464
+ },
2465
+ {
2466
+ x: a / 6,
2467
+ y: -a
2468
+ }
2469
+ ], s = J(n, i, a, o);
2470
+ return s.attr("style", t.style), q(t, s), t.intersect = function(e) {
2471
+ return G.polygon(t, o, e);
2472
+ }, n;
2473
+ }, "lean_right"), Ze = /* @__PURE__ */ s(async (e, t) => {
2474
+ let { shapeSvg: n, bbox: r } = await K(e, t, Y(t, void 0), !0), i = r.width + t.padding, a = r.height + t.padding, o = [
2475
+ {
2476
+ x: 2 * a / 6,
2477
+ y: 0
2478
+ },
2479
+ {
2480
+ x: i + a / 6,
2481
+ y: 0
2482
+ },
2483
+ {
2484
+ x: i - 2 * a / 6,
2485
+ y: -a
2486
+ },
2487
+ {
2488
+ x: -a / 6,
2489
+ y: -a
2490
+ }
2491
+ ], s = J(n, i, a, o);
2492
+ return s.attr("style", t.style), q(t, s), t.intersect = function(e) {
2493
+ return G.polygon(t, o, e);
2494
+ }, n;
2495
+ }, "lean_left"), Qe = /* @__PURE__ */ s(async (e, t) => {
2496
+ let { shapeSvg: n, bbox: r } = await K(e, t, Y(t, void 0), !0), i = r.width + t.padding, a = r.height + t.padding, o = [
2497
+ {
2498
+ x: -2 * a / 6,
2499
+ y: 0
2500
+ },
2501
+ {
2502
+ x: i + 2 * a / 6,
2503
+ y: 0
2504
+ },
2505
+ {
2506
+ x: i - a / 6,
2507
+ y: -a
2508
+ },
2509
+ {
2510
+ x: a / 6,
2511
+ y: -a
2512
+ }
2513
+ ], s = J(n, i, a, o);
2514
+ return s.attr("style", t.style), q(t, s), t.intersect = function(e) {
2515
+ return G.polygon(t, o, e);
2516
+ }, n;
2517
+ }, "trapezoid"), $e = /* @__PURE__ */ s(async (e, t) => {
2518
+ let { shapeSvg: n, bbox: r } = await K(e, t, Y(t, void 0), !0), i = r.width + t.padding, a = r.height + t.padding, o = [
2519
+ {
2520
+ x: a / 6,
2521
+ y: 0
2522
+ },
2523
+ {
2524
+ x: i - a / 6,
2525
+ y: 0
2526
+ },
2527
+ {
2528
+ x: i + 2 * a / 6,
2529
+ y: -a
2530
+ },
2531
+ {
2532
+ x: -2 * a / 6,
2533
+ y: -a
2534
+ }
2535
+ ], s = J(n, i, a, o);
2536
+ return s.attr("style", t.style), q(t, s), t.intersect = function(e) {
2537
+ return G.polygon(t, o, e);
2538
+ }, n;
2539
+ }, "inv_trapezoid"), et = /* @__PURE__ */ s(async (e, t) => {
2540
+ let { shapeSvg: n, bbox: r } = await K(e, t, Y(t, void 0), !0), i = r.width + t.padding, a = r.height + t.padding, o = [
2541
+ {
2542
+ x: 0,
2543
+ y: 0
2544
+ },
2545
+ {
2546
+ x: i + a / 2,
2547
+ y: 0
2548
+ },
2549
+ {
2550
+ x: i,
2551
+ y: -a / 2
2552
+ },
2553
+ {
2554
+ x: i + a / 2,
2555
+ y: -a
2556
+ },
2557
+ {
2558
+ x: 0,
2559
+ y: -a
2560
+ }
2561
+ ], s = J(n, i, a, o);
2562
+ return s.attr("style", t.style), q(t, s), t.intersect = function(e) {
2563
+ return G.polygon(t, o, e);
2564
+ }, n;
2565
+ }, "rect_right_inv_arrow"), tt = /* @__PURE__ */ s(async (e, t) => {
2566
+ let { shapeSvg: n, bbox: r } = await K(e, t, Y(t, void 0), !0), i = r.width + t.padding, a = i / 2, o = a / (2.5 + i / 50), s = r.height + o + t.padding, c = "M 0," + o + " a " + a + "," + o + " 0,0,0 " + i + " 0 a " + a + "," + o + " 0,0,0 " + -i + " 0 l 0," + s + " a " + a + "," + o + " 0,0,0 " + i + " 0 l 0," + -s;
2567
+ return q(t, n.attr("label-offset-y", o).insert("path", ":first-child").attr("style", t.style).attr("d", c).attr("transform", "translate(" + -i / 2 + "," + -(s / 2 + o) + ")")), t.intersect = function(e) {
2568
+ let n = G.rect(t, e), r = n.x - t.x;
2569
+ if (a != 0 && (Math.abs(r) < t.width / 2 || Math.abs(r) == t.width / 2 && Math.abs(n.y - t.y) > t.height / 2 - o)) {
2570
+ let i = o * o * (1 - r * r / (a * a));
2571
+ i != 0 && (i = Math.sqrt(i)), i = o - i, e.y - t.y > 0 && (i = -i), n.y += i;
2572
+ }
2573
+ return n;
2574
+ }, n;
2575
+ }, "cylinder"), nt = /* @__PURE__ */ s(async (e, t) => {
2576
+ let { shapeSvg: n, bbox: r, halfPadding: i } = await K(e, t, "node " + t.classes + " " + t.class, !0), a = n.insert("rect", ":first-child"), s = t.positioned ? t.width : r.width + t.padding, c = t.positioned ? t.height : r.height + t.padding, l = t.positioned ? -s / 2 : -r.width / 2 - i, u = t.positioned ? -c / 2 : -r.height / 2 - i;
2577
+ if (a.attr("class", "basic label-container").attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("x", l).attr("y", u).attr("width", s).attr("height", c), t.props) {
2578
+ let e = new Set(Object.keys(t.props));
2579
+ t.props.borders && (X(a, t.props.borders, s, c), e.delete("borders")), e.forEach((e) => {
2580
+ o.warn(`Unknown node property ${e}`);
2581
+ });
2582
+ }
2583
+ return q(t, a), t.intersect = function(e) {
2584
+ return G.rect(t, e);
2585
+ }, n;
2586
+ }, "rect"), rt = /* @__PURE__ */ s(async (e, t) => {
2587
+ let { shapeSvg: n, bbox: r, halfPadding: i } = await K(e, t, "node " + t.classes, !0), a = n.insert("rect", ":first-child"), s = t.positioned ? t.width : r.width + t.padding, c = t.positioned ? t.height : r.height + t.padding, l = t.positioned ? -s / 2 : -r.width / 2 - i, u = t.positioned ? -c / 2 : -r.height / 2 - i;
2588
+ if (a.attr("class", "basic cluster composite label-container").attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("x", l).attr("y", u).attr("width", s).attr("height", c), t.props) {
2589
+ let e = new Set(Object.keys(t.props));
2590
+ t.props.borders && (X(a, t.props.borders, s, c), e.delete("borders")), e.forEach((e) => {
2591
+ o.warn(`Unknown node property ${e}`);
2592
+ });
2593
+ }
2594
+ return q(t, a), t.intersect = function(e) {
2595
+ return G.rect(t, e);
2596
+ }, n;
2597
+ }, "composite"), it = /* @__PURE__ */ s(async (e, t) => {
2598
+ let { shapeSvg: n } = await K(e, t, "label", !0);
2599
+ o.trace("Classes = ", t.class);
2600
+ let r = n.insert("rect", ":first-child");
2601
+ if (r.attr("width", 0).attr("height", 0), n.attr("class", "label edgeLabel"), t.props) {
2602
+ let e = new Set(Object.keys(t.props));
2603
+ t.props.borders && (X(r, t.props.borders, 0, 0), e.delete("borders")), e.forEach((e) => {
2604
+ o.warn(`Unknown node property ${e}`);
2605
+ });
2606
+ }
2607
+ return q(t, r), t.intersect = function(e) {
2608
+ return G.rect(t, e);
2609
+ }, n;
2610
+ }, "labelRect");
2611
+ function X(e, t, n, r) {
2612
+ let i = [], a = /* @__PURE__ */ s((e) => {
2613
+ i.push(e, 0);
2614
+ }, "addBorder"), c = /* @__PURE__ */ s((e) => {
2615
+ i.push(0, e);
2616
+ }, "skipBorder");
2617
+ t.includes("t") ? (o.debug("add top border"), a(n)) : c(n), t.includes("r") ? (o.debug("add right border"), a(r)) : c(r), t.includes("b") ? (o.debug("add bottom border"), a(n)) : c(n), t.includes("l") ? (o.debug("add left border"), a(r)) : c(r), e.attr("stroke-dasharray", i.join(" "));
2618
+ }
2619
+ s(X, "applyNodePropertyBorders");
2620
+ var at = /* @__PURE__ */ s(async (e, t) => {
2621
+ let n;
2622
+ n = t.classes ? "node " + t.classes : "node default";
2623
+ let r = e.insert("g").attr("class", n).attr("id", t.domId || t.id), i = r.insert("rect", ":first-child"), a = r.insert("line"), s = r.insert("g").attr("class", "label"), l = t.labelText.flat ? t.labelText.flat() : t.labelText, u = "";
2624
+ u = typeof l == "object" ? l[0] : l, o.info("Label text abc79", u, l, typeof l == "object");
2625
+ let d = await B(s, u, t.labelStyle, !0, !0), p = {
2626
+ width: 0,
2627
+ height: 0
2628
+ };
2629
+ if (g(f())) {
2630
+ let e = d.children[0], t = c(d);
2631
+ p = e.getBoundingClientRect(), t.attr("width", p.width), t.attr("height", p.height);
2632
+ }
2633
+ o.info("Text 2", l);
2634
+ let m = l.slice(1, l.length), h = d.getBBox(), _ = await B(s, m.join ? m.join("<br/>") : m, t.labelStyle, !0, !0);
2635
+ if (g(f())) {
2636
+ let e = _.children[0], t = c(_);
2637
+ p = e.getBoundingClientRect(), t.attr("width", p.width), t.attr("height", p.height);
2638
+ }
2639
+ let v = t.padding / 2;
2640
+ return c(_).attr("transform", "translate( " + (p.width > h.width ? 0 : (h.width - p.width) / 2) + ", " + (h.height + v + 5) + ")"), c(d).attr("transform", "translate( " + (p.width < h.width ? 0 : -(h.width - p.width) / 2) + ", 0)"), p = s.node().getBBox(), s.attr("transform", "translate(" + -p.width / 2 + ", " + (-p.height / 2 - v + 3) + ")"), i.attr("class", "outer title-state").attr("x", -p.width / 2 - v).attr("y", -p.height / 2 - v).attr("width", p.width + t.padding).attr("height", p.height + t.padding), a.attr("class", "divider").attr("x1", -p.width / 2 - v).attr("x2", p.width / 2 + v).attr("y1", -p.height / 2 - v + h.height + v).attr("y2", -p.height / 2 - v + h.height + v), q(t, i), t.intersect = function(e) {
2641
+ return G.rect(t, e);
2642
+ }, r;
2643
+ }, "rectWithTitle"), ot = /* @__PURE__ */ s(async (e, t) => {
2644
+ let { shapeSvg: n, bbox: r } = await K(e, t, Y(t, void 0), !0), i = r.height + t.padding, a = r.width + i / 4 + t.padding;
2645
+ return q(t, n.insert("rect", ":first-child").attr("style", t.style).attr("rx", i / 2).attr("ry", i / 2).attr("x", -a / 2).attr("y", -i / 2).attr("width", a).attr("height", i)), t.intersect = function(e) {
2646
+ return G.rect(t, e);
2647
+ }, n;
2648
+ }, "stadium"), st = /* @__PURE__ */ s(async (e, t) => {
2649
+ let { shapeSvg: n, bbox: r, halfPadding: i } = await K(e, t, Y(t, void 0), !0), a = n.insert("circle", ":first-child");
2650
+ return a.attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("r", r.width / 2 + i).attr("width", r.width + t.padding).attr("height", r.height + t.padding), o.info("Circle main"), q(t, a), t.intersect = function(e) {
2651
+ return o.info("Circle intersect", t, r.width / 2 + i, e), G.circle(t, r.width / 2 + i, e);
2652
+ }, n;
2653
+ }, "circle"), ct = /* @__PURE__ */ s(async (e, t) => {
2654
+ let { shapeSvg: n, bbox: r, halfPadding: i } = await K(e, t, Y(t, void 0), !0), a = n.insert("g", ":first-child"), s = a.insert("circle"), c = a.insert("circle");
2655
+ return a.attr("class", t.class), s.attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("r", r.width / 2 + i + 5).attr("width", r.width + t.padding + 10).attr("height", r.height + t.padding + 10), c.attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("r", r.width / 2 + i).attr("width", r.width + t.padding).attr("height", r.height + t.padding), o.info("DoubleCircle main"), q(t, s), t.intersect = function(e) {
2656
+ return o.info("DoubleCircle intersect", t, r.width / 2 + i + 5, e), G.circle(t, r.width / 2 + i + 5, e);
2657
+ }, n;
2658
+ }, "doublecircle"), lt = /* @__PURE__ */ s(async (e, t) => {
2659
+ let { shapeSvg: n, bbox: r } = await K(e, t, Y(t, void 0), !0), i = r.width + t.padding, a = r.height + t.padding, o = [
2660
+ {
2661
+ x: 0,
2662
+ y: 0
2663
+ },
2664
+ {
2665
+ x: i,
2666
+ y: 0
2667
+ },
2668
+ {
2669
+ x: i,
2670
+ y: -a
2671
+ },
2672
+ {
2673
+ x: 0,
2674
+ y: -a
2675
+ },
2676
+ {
2677
+ x: 0,
2678
+ y: 0
2679
+ },
2680
+ {
2681
+ x: -8,
2682
+ y: 0
2683
+ },
2684
+ {
2685
+ x: i + 8,
2686
+ y: 0
2687
+ },
2688
+ {
2689
+ x: i + 8,
2690
+ y: -a
2691
+ },
2692
+ {
2693
+ x: -8,
2694
+ y: -a
2695
+ },
2696
+ {
2697
+ x: -8,
2698
+ y: 0
2699
+ }
2700
+ ], s = J(n, i, a, o);
2701
+ return s.attr("style", t.style), q(t, s), t.intersect = function(e) {
2702
+ return G.polygon(t, o, e);
2703
+ }, n;
2704
+ }, "subroutine"), ut = /* @__PURE__ */ s((e, t) => {
2705
+ let n = e.insert("g").attr("class", "node default").attr("id", t.domId || t.id), r = n.insert("circle", ":first-child");
2706
+ return r.attr("class", "state-start").attr("r", 7).attr("width", 14).attr("height", 14), q(t, r), t.intersect = function(e) {
2707
+ return G.circle(t, 7, e);
2708
+ }, n;
2709
+ }, "start"), dt = /* @__PURE__ */ s((e, t, n) => {
2710
+ let r = e.insert("g").attr("class", "node default").attr("id", t.domId || t.id), i = 70, a = 10;
2711
+ return n === "LR" && (i = 10, a = 70), q(t, r.append("rect").attr("x", -1 * i / 2).attr("y", -1 * a / 2).attr("width", i).attr("height", a).attr("class", "fork-join")), t.height += t.padding / 2, t.width += t.padding / 2, t.intersect = function(e) {
2712
+ return G.rect(t, e);
2713
+ }, r;
2714
+ }, "forkJoin"), ft = {
2715
+ rhombus: Ge,
2716
+ composite: rt,
2717
+ question: Ge,
2718
+ rect: nt,
2719
+ labelRect: it,
2720
+ rectWithTitle: at,
2721
+ choice: Ke,
2722
+ circle: st,
2723
+ doublecircle: ct,
2724
+ stadium: ot,
2725
+ hexagon: qe,
2726
+ block_arrow: Je,
2727
+ rect_left_inv_arrow: Ye,
2728
+ lean_right: Xe,
2729
+ lean_left: Ze,
2730
+ trapezoid: Qe,
2731
+ inv_trapezoid: $e,
2732
+ rect_right_inv_arrow: et,
2733
+ cylinder: tt,
2734
+ start: ut,
2735
+ end: /* @__PURE__ */ s((e, t) => {
2736
+ let n = e.insert("g").attr("class", "node default").attr("id", t.domId || t.id), r = n.insert("circle", ":first-child"), i = n.insert("circle", ":first-child");
2737
+ return i.attr("class", "state-start").attr("r", 7).attr("width", 14).attr("height", 14), r.attr("class", "state-end").attr("r", 5).attr("width", 10).attr("height", 10), q(t, i), t.intersect = function(e) {
2738
+ return G.circle(t, 7, e);
2739
+ }, n;
2740
+ }, "end"),
2741
+ note: Ue,
2742
+ subroutine: lt,
2743
+ fork: dt,
2744
+ join: dt,
2745
+ class_box: /* @__PURE__ */ s(async (e, t) => {
2746
+ let n = t.padding / 2, r;
2747
+ r = t.classes ? "node " + t.classes : "node default";
2748
+ let i = e.insert("g").attr("class", r).attr("id", t.domId || t.id), a = i.insert("rect", ":first-child"), o = i.insert("line"), s = i.insert("line"), l = 0, u = 4, d = i.insert("g").attr("class", "label"), p = 0, m = t.classData.annotations?.[0], h = await B(d, t.classData.annotations[0] ? "«" + t.classData.annotations[0] + "»" : "", t.labelStyle, !0, !0), _ = h.getBBox();
2749
+ if (g(f())) {
2750
+ let e = h.children[0], t = c(h);
2751
+ _ = e.getBoundingClientRect(), t.attr("width", _.width), t.attr("height", _.height);
2752
+ }
2753
+ t.classData.annotations[0] && (u += _.height + 4, l += _.width);
2754
+ let v = t.classData.label;
2755
+ t.classData.type !== void 0 && t.classData.type !== "" && (g(f()) ? v += "&lt;" + t.classData.type + "&gt;" : v += "<" + t.classData.type + ">");
2756
+ let y = await B(d, v, t.labelStyle, !0, !0);
2757
+ c(y).attr("class", "classTitle");
2758
+ let b = y.getBBox();
2759
+ if (g(f())) {
2760
+ let e = y.children[0], t = c(y);
2761
+ b = e.getBoundingClientRect(), t.attr("width", b.width), t.attr("height", b.height);
2762
+ }
2763
+ u += b.height + 4, b.width > l && (l = b.width);
2764
+ let x = [];
2765
+ t.classData.members.forEach(async (e) => {
2766
+ let n = e.getDisplayDetails(), r = n.displayText;
2767
+ g(f()) && (r = r.replace(/</g, "&lt;").replace(/>/g, "&gt;"));
2768
+ let i = await B(d, r, n.cssStyle ? n.cssStyle : t.labelStyle, !0, !0), a = i.getBBox();
2769
+ if (g(f())) {
2770
+ let e = i.children[0], t = c(i);
2771
+ a = e.getBoundingClientRect(), t.attr("width", a.width), t.attr("height", a.height);
2772
+ }
2773
+ a.width > l && (l = a.width), u += a.height + 4, x.push(i);
2774
+ }), u += 8;
2775
+ let S = [];
2776
+ if (t.classData.methods.forEach(async (e) => {
2777
+ let n = e.getDisplayDetails(), r = n.displayText;
2778
+ g(f()) && (r = r.replace(/</g, "&lt;").replace(/>/g, "&gt;"));
2779
+ let i = await B(d, r, n.cssStyle ? n.cssStyle : t.labelStyle, !0, !0), a = i.getBBox();
2780
+ if (g(f())) {
2781
+ let e = i.children[0], t = c(i);
2782
+ a = e.getBoundingClientRect(), t.attr("width", a.width), t.attr("height", a.height);
2783
+ }
2784
+ a.width > l && (l = a.width), u += a.height + 4, S.push(i);
2785
+ }), u += 8, m) {
2786
+ let e = (l - _.width) / 2;
2787
+ c(h).attr("transform", "translate( " + (-1 * l / 2 + e) + ", " + -1 * u / 2 + ")"), p = _.height + 4;
2788
+ }
2789
+ let C = (l - b.width) / 2;
2790
+ return c(y).attr("transform", "translate( " + (-1 * l / 2 + C) + ", " + (-1 * u / 2 + p) + ")"), p += b.height + 4, o.attr("class", "divider").attr("x1", -l / 2 - n).attr("x2", l / 2 + n).attr("y1", -u / 2 - n + 8 + p).attr("y2", -u / 2 - n + 8 + p), p += 8, x.forEach((e) => {
2791
+ c(e).attr("transform", "translate( " + -l / 2 + ", " + (-1 * u / 2 + p + 8 / 2) + ")");
2792
+ let t = e?.getBBox();
2793
+ p += (t?.height ?? 0) + 4;
2794
+ }), p += 8, s.attr("class", "divider").attr("x1", -l / 2 - n).attr("x2", l / 2 + n).attr("y1", -u / 2 - n + 8 + p).attr("y2", -u / 2 - n + 8 + p), p += 8, S.forEach((e) => {
2795
+ c(e).attr("transform", "translate( " + -l / 2 + ", " + (-1 * u / 2 + p) + ")");
2796
+ let t = e?.getBBox();
2797
+ p += (t?.height ?? 0) + 4;
2798
+ }), a.attr("style", t.style).attr("class", "outer title-state").attr("x", -l / 2 - n).attr("y", -(u / 2) - n).attr("width", l + t.padding).attr("height", u + t.padding), q(t, a), t.intersect = function(e) {
2799
+ return G.rect(t, e);
2800
+ }, i;
2801
+ }, "class_box")
2802
+ }, Z = {}, pt = /* @__PURE__ */ s(async (e, t, n) => {
2803
+ let r, i;
2804
+ if (t.link) {
2805
+ let a;
2806
+ f().securityLevel === "sandbox" ? a = "_top" : t.linkTarget && (a = t.linkTarget || "_blank"), r = e.insert("svg:a").attr("xlink:href", t.link).attr("target", a), i = await ft[t.shape](r, t, n);
2807
+ } else i = await ft[t.shape](e, t, n), r = i;
2808
+ return t.tooltip && i.attr("title", t.tooltip), t.class && i.attr("class", "node default " + t.class), Z[t.id] = r, t.haveCallback && Z[t.id].attr("class", Z[t.id].attr("class") + " clickable"), r;
2809
+ }, "insertNode"), mt = /* @__PURE__ */ s((e) => {
2810
+ let t = Z[e.id];
2811
+ o.trace("Transforming node", e.diff, e, "translate(" + (e.x - e.width / 2 - 5) + ", " + e.width / 2 + ")");
2812
+ let n = e.diff || 0;
2813
+ return e.clusterNode ? t.attr("transform", "translate(" + (e.x + n - e.width / 2) + ", " + (e.y - e.height / 2 - 8) + ")") : t.attr("transform", "translate(" + e.x + ", " + e.y + ")"), n;
2814
+ }, "positionNode");
2815
+ function Q(e, n, r = !1) {
2816
+ let i = e, a = "default";
2817
+ (i?.classes?.length || 0) > 0 && (a = (i?.classes ?? []).join(" ")), a += " flowchart-label";
2818
+ let o = 0, s = "", c;
2819
+ switch (i.type) {
2820
+ case "round":
2821
+ o = 5, s = "rect";
2822
+ break;
2823
+ case "composite":
2824
+ o = 0, s = "composite", c = 0;
2825
+ break;
2826
+ case "square":
2827
+ s = "rect";
2828
+ break;
2829
+ case "diamond":
2830
+ s = "question";
2831
+ break;
2832
+ case "hexagon":
2833
+ s = "hexagon";
2834
+ break;
2835
+ case "block_arrow":
2836
+ s = "block_arrow";
2837
+ break;
2838
+ case "odd":
2839
+ s = "rect_left_inv_arrow";
2840
+ break;
2841
+ case "lean_right":
2842
+ s = "lean_right";
2843
+ break;
2844
+ case "lean_left":
2845
+ s = "lean_left";
2846
+ break;
2847
+ case "trapezoid":
2848
+ s = "trapezoid";
2849
+ break;
2850
+ case "inv_trapezoid":
2851
+ s = "inv_trapezoid";
2852
+ break;
2853
+ case "rect_left_inv_arrow":
2854
+ s = "rect_left_inv_arrow";
2855
+ break;
2856
+ case "circle":
2857
+ s = "circle";
2858
+ break;
2859
+ case "ellipse":
2860
+ s = "ellipse";
2861
+ break;
2862
+ case "stadium":
2863
+ s = "stadium";
2864
+ break;
2865
+ case "subroutine":
2866
+ s = "subroutine";
2867
+ break;
2868
+ case "cylinder":
2869
+ s = "cylinder";
2870
+ break;
2871
+ case "group":
2872
+ s = "rect";
2873
+ break;
2874
+ case "doublecircle":
2875
+ s = "doublecircle";
2876
+ break;
2877
+ default: s = "rect";
2878
+ }
2879
+ let l = t(i?.styles ?? []), u = i.label, d = i.size ?? {
2880
+ width: 0,
2881
+ height: 0,
2882
+ x: 0,
2883
+ y: 0
2884
+ };
2885
+ return {
2886
+ labelStyle: l.labelStyle,
2887
+ shape: s,
2888
+ labelText: u,
2889
+ rx: o,
2890
+ ry: o,
2891
+ class: a,
2892
+ style: l.style,
2893
+ id: i.id,
2894
+ directions: i.directions,
2895
+ width: d.width,
2896
+ height: d.height,
2897
+ x: d.x,
2898
+ y: d.y,
2899
+ positioned: r,
2900
+ intersect: void 0,
2901
+ type: i.type,
2902
+ padding: c ?? _()?.block?.padding ?? 0
2903
+ };
2904
+ }
2905
+ s(Q, "getNodeFromBlock");
2906
+ async function ht(e, t, n) {
2907
+ let r = Q(t, n, !1);
2908
+ if (r.type === "group") return;
2909
+ let i = await pt(e, r, { config: _() }), a = i.node().getBBox(), o = n.getBlock(r.id);
2910
+ o.size = {
2911
+ width: a.width,
2912
+ height: a.height,
2913
+ x: 0,
2914
+ y: 0,
2915
+ node: i
2916
+ }, n.setBlock(o), i.remove();
2917
+ }
2918
+ s(ht, "calculateBlockSize");
2919
+ async function gt(e, t, n) {
2920
+ let r = Q(t, n, !0);
2921
+ n.getBlock(r.id).type !== "space" && (await pt(e, r, { config: _() }), t.intersect = r?.intersect, mt(r));
2922
+ }
2923
+ s(gt, "insertBlockPositioned");
2924
+ async function $(e, t, n, r) {
2925
+ for (let i of t) await r(e, i, n), i.children && await $(e, i.children, n, r);
2926
+ }
2927
+ s($, "performOperations");
2928
+ async function _t(e, t, n) {
2929
+ await $(e, t, n, ht);
2930
+ }
2931
+ s(_t, "calculateBlockSizes");
2932
+ async function vt(e, t, n) {
2933
+ await $(e, t, n, gt);
2934
+ }
2935
+ s(vt, "insertBlocks");
2936
+ async function yt(e, t, n, r, i) {
2937
+ let o = new a({
2938
+ multigraph: !0,
2939
+ compound: !0
2940
+ });
2941
+ o.setGraph({
2942
+ rankdir: "TB",
2943
+ nodesep: 10,
2944
+ ranksep: 10,
2945
+ marginx: 8,
2946
+ marginy: 8
2947
+ });
2948
+ for (let e of n) e.size && o.setNode(e.id, {
2949
+ width: e.size.width,
2950
+ height: e.size.height,
2951
+ intersect: e.intersect
2952
+ });
2953
+ for (let n of t) if (n.start && n.end) {
2954
+ let t = r.getBlock(n.start), a = r.getBlock(n.end);
2955
+ if (t?.size && a?.size) {
2956
+ let r = t.size, s = a.size, c = [
2957
+ {
2958
+ x: r.x,
2959
+ y: r.y
2960
+ },
2961
+ {
2962
+ x: r.x + (s.x - r.x) / 2,
2963
+ y: r.y + (s.y - r.y) / 2
2964
+ },
2965
+ {
2966
+ x: s.x,
2967
+ y: s.y
2968
+ }
2969
+ ];
2970
+ Ae(e, {
2971
+ v: n.start,
2972
+ w: n.end,
2973
+ name: n.id
2974
+ }, {
2975
+ ...n,
2976
+ arrowTypeEnd: n.arrowTypeEnd,
2977
+ arrowTypeStart: n.arrowTypeStart,
2978
+ points: c,
2979
+ classes: "edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"
2980
+ }, void 0, "block", o, i), n.label && (await Te(e, {
2981
+ ...n,
2982
+ label: n.label,
2983
+ labelStyle: "stroke: #333; stroke-width: 1.5px;fill:none;",
2984
+ arrowTypeEnd: n.arrowTypeEnd,
2985
+ arrowTypeStart: n.arrowTypeStart,
2986
+ points: c,
2987
+ classes: "edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"
2988
+ }), Ee({
2989
+ ...n,
2990
+ x: c[1].x,
2991
+ y: c[1].y
2992
+ }, { originalPath: c }));
2993
+ }
2994
+ }
2995
+ }
2996
+ s(yt, "insertEdges");
2997
+ var bt = {
2998
+ parser: D,
2999
+ db: pe,
3000
+ renderer: {
3001
+ draw: /* @__PURE__ */ s(async function(e, t, n, r) {
3002
+ let { securityLevel: i, block: a } = _(), s = r.db, l;
3003
+ i === "sandbox" && (l = c("#i" + t));
3004
+ let u = c(i === "sandbox" ? l.nodes()[0].contentDocument.body : "body"), d = i === "sandbox" ? u.select(`[id="${t}"]`) : c(`[id="${t}"]`);
3005
+ _e(d, [
3006
+ "point",
3007
+ "circle",
3008
+ "cross"
3009
+ ], r.type, t);
3010
+ let f = s.getBlocks(), m = s.getBlocksFlat(), h = s.getEdges(), g = d.insert("g").attr("class", "block");
3011
+ await _t(g, f, s);
3012
+ let v = xe(s);
3013
+ if (await vt(g, f, s), await yt(g, h, m, s, t), v) {
3014
+ let e = v, t = Math.max(1, Math.round(.125 * (e.width / e.height))), n = e.height + t + 10, r = e.width + 10, { useMaxWidth: i } = a;
3015
+ p(d, n, r, !!i), o.debug("Here Bounds", v, e), d.attr("viewBox", `${e.x - 5} ${e.y - 5} ${e.width + 10} ${e.height + 10}`);
3016
+ }
3017
+ }, "draw"),
3018
+ getClasses: /* @__PURE__ */ s(function(e, t) {
3019
+ return t.db.getClasses();
3020
+ }, "getClasses")
3021
+ },
3022
+ styles: me
3023
+ };
3024
+ //#endregion
3025
+ export { bt as diagram };