@schmitech/chatbot-widget 0.5.3 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/dist/_basePickBy-C3-QE0dl-5eQ6L29l.js +152 -0
  2. package/dist/_baseUniq-CstiM9Lp-AFR_Ns0a.js +615 -0
  3. package/dist/arc-W3NKKXLI-DHbDwLx0.js +84 -0
  4. package/dist/architecture-U656AL7Q-fn9wJZsH-BLoGjtkP.js +6 -0
  5. package/dist/architectureDiagram-VXUJARFQ-zzJsgPC6-C4OfUE0m.js +4667 -0
  6. package/dist/blockDiagram-VD42YOAC-D-In4h7h-BYXdRmeG.js +2266 -0
  7. package/dist/c4Diagram-YG6GDRKO-DBs8r9gh-BdLuHgPT.js +1582 -0
  8. package/dist/channel-RBWQyMSg-Cx0HUumY.js +6 -0
  9. package/dist/chatbot-widget.bundle.js +4473 -1556
  10. package/dist/chatbot-widget.css +1 -1
  11. package/dist/chatbot-widget.es.js +12 -63659
  12. package/dist/chatbot-widget.umd.js +4472 -1555
  13. package/dist/chunk-4BX2VUAB-BqD7w0AR-CbA2613c.js +10 -0
  14. package/dist/chunk-55IACEB6-D8pvDVEJ-DrL4SJSR.js +9 -0
  15. package/dist/chunk-B4BG7PRW-Dwma1pSy-BWjG5dc6.js +1375 -0
  16. package/dist/chunk-DI55MBZ5-BY2XXvZz-DbAvz3Pq.js +1383 -0
  17. package/dist/chunk-FMBD7UC4-BeiLbQ8U-BNaZTCv4.js +20 -0
  18. package/dist/chunk-QN33PNHL-BkO3hOeq-DkU1EzGA.js +21 -0
  19. package/dist/chunk-QZHKN3VN-Cwlo2qTG-DMmeZmp5.js +16 -0
  20. package/dist/chunk-TZMSLE5B-BnXK-OiF-RfzVsOBe.js +65 -0
  21. package/dist/classDiagram-2ON5EDUG-Crd6O69V-kCZrFOLN.js +17 -0
  22. package/dist/classDiagram-v2-WZHVMYZB-Crd6O69V-kCZrFOLN.js +17 -0
  23. package/dist/clone-CfLgyC8S-DsDOh4B4.js +9 -0
  24. package/dist/config/index.d.ts +4 -2
  25. package/dist/cose-bilkent-S5V4N54A-DKeVcPDK-de_7nZTY.js +2609 -0
  26. package/dist/cytoscape.esm-CjI2IsL8-Be2K4mI6.js +18723 -0
  27. package/dist/dagre-6UL2VRFP-BPf604Df-BhZs6zCq.js +448 -0
  28. package/dist/diagram-PSM6KHXK-DeLcpEV3-qb4rujeN.js +532 -0
  29. package/dist/diagram-QEK2KX5R-C_5RR1NJ-C5kZWmRl.js +222 -0
  30. package/dist/diagram-S2PKOQOG-DVx43aon-4nlw6iDz.js +144 -0
  31. package/dist/erDiagram-Q2GNP2WA-DgUeO5_h-DHc9Yphl.js +841 -0
  32. package/dist/flowDiagram-NV44I4VS-C5HQUzU9-DHjbmAtJ.js +1628 -0
  33. package/dist/ganttDiagram-JELNMOA3-DgSZ1ixF-C3hJs_k9.js +1936 -0
  34. package/dist/gitGraph-F6HP7TQM-UL7-Bx1s-Cog5rj3j.js +6 -0
  35. package/dist/gitGraphDiagram-NY62KEGX-DY5loT9K-CEcKQNrM.js +713 -0
  36. package/dist/graph-BfwqPHx6-DErF9dBN.js +248 -0
  37. package/dist/index-B5s_uaP2.js +124168 -0
  38. package/dist/index-BAOVR-xx-thst7Pu6.js +13251 -0
  39. package/dist/info-NVLQJR56-BsqQ0RXQ-BcYgZCCY.js +6 -0
  40. package/dist/infoDiagram-WHAUD3N6-DIqQ6vCk-BuiAAMSH.js +25 -0
  41. package/dist/journeyDiagram-XKPGCS4Q-DXjg3S3r-Byi_TGXs.js +835 -0
  42. package/dist/kanban-definition-3W4ZIXB7-Uxt7Am6n-jy96nA-g.js +721 -0
  43. package/dist/layout-CSfkE668-BjigbqJL.js +1333 -0
  44. package/dist/mermaid-parser.core-LjuO4CL3-BLqmPe8-.js +12891 -0
  45. package/dist/mindmap-definition-VGOIOE7T-DXwVuAPE-SK4e1Sse.js +787 -0
  46. package/dist/packet-BFZMPI3H-DJWkrKrV-BamBev9S.js +6 -0
  47. package/dist/pie-7BOR55EZ-DC8hTFwn-D1bcIQbR.js +6 -0
  48. package/dist/pieDiagram-ADFJNKIX-Cj0EHHtj-Dbr09c-S.js +161 -0
  49. package/dist/quadrantDiagram-AYHSOK5B-CnLDz007-Ci0DQl2T.js +1024 -0
  50. package/dist/radar-NHE76QYJ-Bijk-Fk9-9nAmDCMr.js +6 -0
  51. package/dist/requirementDiagram-UZGBJVZJ-rDaI-8Be-CSEc4S33.js +851 -0
  52. package/dist/sankeyDiagram-TZEHDZUN-A0YO8ixs-Zj8Z0j0n.js +810 -0
  53. package/dist/sequenceDiagram-WL72ISMW-BFF7TtP7-Dcofckjv.js +2519 -0
  54. package/dist/shared/styles.d.ts +1 -1
  55. package/dist/stateDiagram-FKZM4ZOC-ofFsB7HJ-BJBX12rE.js +264 -0
  56. package/dist/stateDiagram-v2-4FDKWEC3-CEZFbksU-BywmU88h.js +17 -0
  57. package/dist/timeline-definition-IT6M3QCI-5W361ZNm-MP_ufVe7.js +800 -0
  58. package/dist/treemap-KMMF4GRG-pGRoYcSn-BeZ7sXgP.js +6 -0
  59. package/dist/ui/Message.d.ts +1 -5
  60. package/dist/ui/MessagesList.d.ts +1 -5
  61. package/dist/utils/contentFiltering.d.ts +12 -0
  62. package/dist/xychartDiagram-PRI3JC2R-CSr0GxaP-DBgCtplP.js +1297 -0
  63. package/package.json +3 -3
  64. package/dist/ui/TypingEffect.d.ts +0 -18
@@ -0,0 +1,2266 @@
1
+ import { l as ce } from "./chunk-FMBD7UC4-BeiLbQ8U-BNaZTCv4.js";
2
+ import { x as g, S as at, f as B, G as he, a as w, L as ue, R as ge, b9 as ye, av as pe, aC as be, p as z, az as xe, ba as G, bb as Wt, j as fe, v as tt, n as me, bc as we, bd as bt, y as xt, be as Le } from "./index-B5s_uaP2.js";
3
+ import { a as Se } from "./clone-CfLgyC8S-DsDOh4B4.js";
4
+ import { L as ke } from "./graph-BfwqPHx6-DErF9dBN.js";
5
+ import { t as _e } from "./channel-RBWQyMSg-Cx0HUumY.js";
6
+ typeof window < "u" && (window.global = window);
7
+ var ft = function() {
8
+ var e = /* @__PURE__ */ g(function(D, c, p, f) {
9
+ for (p = p || {}, f = D.length; f--; p[D[f]] = c) ;
10
+ return p;
11
+ }, "o"), t = [1, 15], s = [1, 7], i = [1, 13], l = [1, 14], a = [1, 19], r = [1, 16], n = [1, 17], o = [1, 18], u = [8, 30], y = [8, 10, 21, 28, 29, 30, 31, 39, 43, 46], b = [1, 23], x = [1, 24], S = [8, 10, 15, 16, 21, 28, 29, 30, 31, 39, 43, 46], L = [8, 10, 15, 16, 21, 27, 28, 29, 30, 31, 39, 43, 46], _ = [1, 49], k = {
12
+ trace: /* @__PURE__ */ g(function() {
13
+ }, "trace"),
14
+ yy: {},
15
+ symbols_: { error: 2, spaceLines: 3, SPACELINE: 4, NL: 5, separator: 6, SPACE: 7, EOF: 8, start: 9, BLOCK_DIAGRAM_KEY: 10, document: 11, stop: 12, statement: 13, link: 14, LINK: 15, START_LINK: 16, LINK_LABEL: 17, STR: 18, nodeStatement: 19, columnsStatement: 20, SPACE_BLOCK: 21, blockStatement: 22, classDefStatement: 23, cssClassStatement: 24, styleStatement: 25, node: 26, SIZE: 27, COLUMNS: 28, "id-block": 29, end: 30, NODE_ID: 31, nodeShapeNLabel: 32, dirList: 33, DIR: 34, NODE_DSTART: 35, NODE_DEND: 36, BLOCK_ARROW_START: 37, BLOCK_ARROW_END: 38, classDef: 39, CLASSDEF_ID: 40, CLASSDEF_STYLEOPTS: 41, DEFAULT: 42, class: 43, CLASSENTITY_IDS: 44, STYLECLASS: 45, style: 46, STYLE_ENTITY_IDS: 47, STYLE_DEFINITION_DATA: 48, $accept: 0, $end: 1 },
16
+ terminals_: { 2: "error", 4: "SPACELINE", 5: "NL", 7: "SPACE", 8: "EOF", 10: "BLOCK_DIAGRAM_KEY", 15: "LINK", 16: "START_LINK", 17: "LINK_LABEL", 18: "STR", 21: "SPACE_BLOCK", 27: "SIZE", 28: "COLUMNS", 29: "id-block", 30: "end", 31: "NODE_ID", 34: "DIR", 35: "NODE_DSTART", 36: "NODE_DEND", 37: "BLOCK_ARROW_START", 38: "BLOCK_ARROW_END", 39: "classDef", 40: "CLASSDEF_ID", 41: "CLASSDEF_STYLEOPTS", 42: "DEFAULT", 43: "class", 44: "CLASSENTITY_IDS", 45: "STYLECLASS", 46: "style", 47: "STYLE_ENTITY_IDS", 48: "STYLE_DEFINITION_DATA" },
17
+ productions_: [0, [3, 1], [3, 2], [3, 2], [6, 1], [6, 1], [6, 1], [9, 3], [12, 1], [12, 1], [12, 2], [12, 2], [11, 1], [11, 2], [14, 1], [14, 4], [13, 1], [13, 1], [13, 1], [13, 1], [13, 1], [13, 1], [13, 1], [19, 3], [19, 2], [19, 1], [20, 1], [22, 4], [22, 3], [26, 1], [26, 2], [33, 1], [33, 2], [32, 3], [32, 4], [23, 3], [23, 3], [24, 3], [25, 3]],
18
+ performAction: /* @__PURE__ */ g(function(D, c, p, f, E, d, m) {
19
+ var h = d.length - 1;
20
+ switch (E) {
21
+ case 4:
22
+ f.getLogger().debug("Rule: separator (NL) ");
23
+ break;
24
+ case 5:
25
+ f.getLogger().debug("Rule: separator (Space) ");
26
+ break;
27
+ case 6:
28
+ f.getLogger().debug("Rule: separator (EOF) ");
29
+ break;
30
+ case 7:
31
+ f.getLogger().debug("Rule: hierarchy: ", d[h - 1]), f.setHierarchy(d[h - 1]);
32
+ break;
33
+ case 8:
34
+ f.getLogger().debug("Stop NL ");
35
+ break;
36
+ case 9:
37
+ f.getLogger().debug("Stop EOF ");
38
+ break;
39
+ case 10:
40
+ f.getLogger().debug("Stop NL2 ");
41
+ break;
42
+ case 11:
43
+ f.getLogger().debug("Stop EOF2 ");
44
+ break;
45
+ case 12:
46
+ f.getLogger().debug("Rule: statement: ", d[h]), typeof d[h].length == "number" ? this.$ = d[h] : this.$ = [d[h]];
47
+ break;
48
+ case 13:
49
+ f.getLogger().debug("Rule: statement #2: ", d[h - 1]), this.$ = [d[h - 1]].concat(d[h]);
50
+ break;
51
+ case 14:
52
+ f.getLogger().debug("Rule: link: ", d[h], D), this.$ = { edgeTypeStr: d[h], label: "" };
53
+ break;
54
+ case 15:
55
+ f.getLogger().debug("Rule: LABEL link: ", d[h - 3], d[h - 1], d[h]), this.$ = { edgeTypeStr: d[h], label: d[h - 1] };
56
+ break;
57
+ case 18:
58
+ const O = parseInt(d[h]), M = f.generateId();
59
+ this.$ = { id: M, type: "space", label: "", width: O, children: [] };
60
+ break;
61
+ case 23:
62
+ f.getLogger().debug("Rule: (nodeStatement link node) ", d[h - 2], d[h - 1], d[h], " typestr: ", d[h - 1].edgeTypeStr);
63
+ const R = f.edgeStrToEdgeData(d[h - 1].edgeTypeStr);
64
+ this.$ = [
65
+ { id: d[h - 2].id, label: d[h - 2].label, type: d[h - 2].type, directions: d[h - 2].directions },
66
+ { id: d[h - 2].id + "-" + d[h].id, start: d[h - 2].id, end: d[h].id, label: d[h - 1].label, type: "edge", directions: d[h].directions, arrowTypeEnd: R, arrowTypeStart: "arrow_open" },
67
+ { id: d[h].id, label: d[h].label, type: f.typeStr2Type(d[h].typeStr), directions: d[h].directions }
68
+ ];
69
+ break;
70
+ case 24:
71
+ f.getLogger().debug("Rule: nodeStatement (abc88 node size) ", d[h - 1], d[h]), this.$ = { id: d[h - 1].id, label: d[h - 1].label, type: f.typeStr2Type(d[h - 1].typeStr), directions: d[h - 1].directions, widthInColumns: parseInt(d[h], 10) };
72
+ break;
73
+ case 25:
74
+ f.getLogger().debug("Rule: nodeStatement (node) ", d[h]), this.$ = { id: d[h].id, label: d[h].label, type: f.typeStr2Type(d[h].typeStr), directions: d[h].directions, widthInColumns: 1 };
75
+ break;
76
+ case 26:
77
+ f.getLogger().debug("APA123", this ? this : "na"), f.getLogger().debug("COLUMNS: ", d[h]), this.$ = { type: "column-setting", columns: d[h] === "auto" ? -1 : parseInt(d[h]) };
78
+ break;
79
+ case 27:
80
+ f.getLogger().debug("Rule: id-block statement : ", d[h - 2], d[h - 1]), f.generateId(), this.$ = { ...d[h - 2], type: "composite", children: d[h - 1] };
81
+ break;
82
+ case 28:
83
+ f.getLogger().debug("Rule: blockStatement : ", d[h - 2], d[h - 1], d[h]);
84
+ const W = f.generateId();
85
+ this.$ = { id: W, type: "composite", label: "", children: d[h - 1] };
86
+ break;
87
+ case 29:
88
+ f.getLogger().debug("Rule: node (NODE_ID separator): ", d[h]), this.$ = { id: d[h] };
89
+ break;
90
+ case 30:
91
+ f.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ", d[h - 1], d[h]), this.$ = { id: d[h - 1], label: d[h].label, typeStr: d[h].typeStr, directions: d[h].directions };
92
+ break;
93
+ case 31:
94
+ f.getLogger().debug("Rule: dirList: ", d[h]), this.$ = [d[h]];
95
+ break;
96
+ case 32:
97
+ f.getLogger().debug("Rule: dirList: ", d[h - 1], d[h]), this.$ = [d[h - 1]].concat(d[h]);
98
+ break;
99
+ case 33:
100
+ f.getLogger().debug("Rule: nodeShapeNLabel: ", d[h - 2], d[h - 1], d[h]), this.$ = { typeStr: d[h - 2] + d[h], label: d[h - 1] };
101
+ break;
102
+ case 34:
103
+ f.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ", d[h - 3], d[h - 2], " #3:", d[h - 1], d[h]), this.$ = { typeStr: d[h - 3] + d[h], label: d[h - 2], directions: d[h - 1] };
104
+ break;
105
+ case 35:
106
+ case 36:
107
+ this.$ = { type: "classDef", id: d[h - 1].trim(), css: d[h].trim() };
108
+ break;
109
+ case 37:
110
+ this.$ = { type: "applyClass", id: d[h - 1].trim(), styleClass: d[h].trim() };
111
+ break;
112
+ case 38:
113
+ this.$ = { type: "applyStyles", id: d[h - 1].trim(), stylesStr: d[h].trim() };
114
+ break;
115
+ }
116
+ }, "anonymous"),
117
+ table: [{ 9: 1, 10: [1, 2] }, { 1: [3] }, { 10: t, 11: 3, 13: 4, 19: 5, 20: 6, 21: s, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 28: i, 29: l, 31: a, 39: r, 43: n, 46: o }, { 8: [1, 20] }, e(u, [2, 12], { 13: 4, 19: 5, 20: 6, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 11: 21, 10: t, 21: s, 28: i, 29: l, 31: a, 39: r, 43: n, 46: o }), e(y, [2, 16], { 14: 22, 15: b, 16: x }), e(y, [2, 17]), e(y, [2, 18]), e(y, [2, 19]), e(y, [2, 20]), e(y, [2, 21]), e(y, [2, 22]), e(S, [2, 25], { 27: [1, 25] }), e(y, [2, 26]), { 19: 26, 26: 12, 31: a }, { 10: t, 11: 27, 13: 4, 19: 5, 20: 6, 21: s, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 28: i, 29: l, 31: a, 39: r, 43: n, 46: o }, { 40: [1, 28], 42: [1, 29] }, { 44: [1, 30] }, { 47: [1, 31] }, e(L, [2, 29], { 32: 32, 35: [1, 33], 37: [1, 34] }), { 1: [2, 7] }, e(u, [2, 13]), { 26: 35, 31: a }, { 31: [2, 14] }, { 17: [1, 36] }, e(S, [2, 24]), { 10: t, 11: 37, 13: 4, 14: 22, 15: b, 16: x, 19: 5, 20: 6, 21: s, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 28: i, 29: l, 31: a, 39: r, 43: n, 46: o }, { 30: [1, 38] }, { 41: [1, 39] }, { 41: [1, 40] }, { 45: [1, 41] }, { 48: [1, 42] }, e(L, [2, 30]), { 18: [1, 43] }, { 18: [1, 44] }, e(S, [2, 23]), { 18: [1, 45] }, { 30: [1, 46] }, e(y, [2, 28]), e(y, [2, 35]), e(y, [2, 36]), e(y, [2, 37]), e(y, [2, 38]), { 36: [1, 47] }, { 33: 48, 34: _ }, { 15: [1, 50] }, e(y, [2, 27]), e(L, [2, 33]), { 38: [1, 51] }, { 33: 52, 34: _, 38: [2, 31] }, { 31: [2, 15] }, e(L, [2, 34]), { 38: [2, 32] }],
118
+ defaultActions: { 20: [2, 7], 23: [2, 14], 50: [2, 15], 52: [2, 32] },
119
+ parseError: /* @__PURE__ */ g(function(D, c) {
120
+ if (c.recoverable)
121
+ this.trace(D);
122
+ else {
123
+ var p = new Error(D);
124
+ throw p.hash = c, p;
125
+ }
126
+ }, "parseError"),
127
+ parse: /* @__PURE__ */ g(function(D) {
128
+ var c = this, p = [0], f = [], E = [null], d = [], m = this.table, h = "", O = 0, M = 0, R = 2, W = 1, j = d.slice.call(arguments, 1), T = Object.create(this.lexer), Q = { yy: {} };
129
+ for (var ut in this.yy)
130
+ Object.prototype.hasOwnProperty.call(this.yy, ut) && (Q.yy[ut] = this.yy[ut]);
131
+ T.setInput(D, Q.yy), Q.yy.lexer = T, Q.yy.parser = this, typeof T.yylloc > "u" && (T.yylloc = {});
132
+ var gt = T.yylloc;
133
+ d.push(gt);
134
+ var oe = T.options && T.options.ranges;
135
+ typeof Q.yy.parseError == "function" ? this.parseError = Q.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
136
+ function de(F) {
137
+ p.length = p.length - 2 * F, E.length = E.length - F, d.length = d.length - F;
138
+ }
139
+ g(de, "popStack");
140
+ function Nt() {
141
+ var F;
142
+ return F = f.pop() || T.lex() || W, typeof F != "number" && (F instanceof Array && (f = F, F = f.pop()), F = c.symbols_[F] || F), F;
143
+ }
144
+ g(Nt, "lex");
145
+ for (var X, V, K, yt, q = {}, st, J, Tt, it; ; ) {
146
+ if (V = p[p.length - 1], this.defaultActions[V] ? K = this.defaultActions[V] : ((X === null || typeof X > "u") && (X = Nt()), K = m[V] && m[V][X]), typeof K > "u" || !K.length || !K[0]) {
147
+ var pt = "";
148
+ it = [];
149
+ for (st in m[V])
150
+ this.terminals_[st] && st > R && it.push("'" + this.terminals_[st] + "'");
151
+ T.showPosition ? pt = "Parse error on line " + (O + 1) + `:
152
+ ` + T.showPosition() + `
153
+ Expecting ` + it.join(", ") + ", got '" + (this.terminals_[X] || X) + "'" : pt = "Parse error on line " + (O + 1) + ": Unexpected " + (X == W ? "end of input" : "'" + (this.terminals_[X] || X) + "'"), this.parseError(pt, {
154
+ text: T.match,
155
+ token: this.terminals_[X] || X,
156
+ line: T.yylineno,
157
+ loc: gt,
158
+ expected: it
159
+ });
160
+ }
161
+ if (K[0] instanceof Array && K.length > 1)
162
+ throw new Error("Parse Error: multiple actions possible at state: " + V + ", token: " + X);
163
+ switch (K[0]) {
164
+ case 1:
165
+ p.push(X), E.push(T.yytext), d.push(T.yylloc), p.push(K[1]), X = null, M = T.yyleng, h = T.yytext, O = T.yylineno, gt = T.yylloc;
166
+ break;
167
+ case 2:
168
+ if (J = this.productions_[K[1]][1], q.$ = E[E.length - J], q._$ = {
169
+ first_line: d[d.length - (J || 1)].first_line,
170
+ last_line: d[d.length - 1].last_line,
171
+ first_column: d[d.length - (J || 1)].first_column,
172
+ last_column: d[d.length - 1].last_column
173
+ }, oe && (q._$.range = [
174
+ d[d.length - (J || 1)].range[0],
175
+ d[d.length - 1].range[1]
176
+ ]), yt = this.performAction.apply(q, [
177
+ h,
178
+ M,
179
+ O,
180
+ Q.yy,
181
+ K[1],
182
+ E,
183
+ d
184
+ ].concat(j)), typeof yt < "u")
185
+ return yt;
186
+ J && (p = p.slice(0, -1 * J * 2), E = E.slice(0, -1 * J), d = d.slice(0, -1 * J)), p.push(this.productions_[K[1]][0]), E.push(q.$), d.push(q._$), Tt = m[p[p.length - 2]][p[p.length - 1]], p.push(Tt);
187
+ break;
188
+ case 3:
189
+ return !0;
190
+ }
191
+ }
192
+ return !0;
193
+ }, "parse")
194
+ }, N = /* @__PURE__ */ function() {
195
+ var D = {
196
+ EOF: 1,
197
+ parseError: /* @__PURE__ */ g(function(c, p) {
198
+ if (this.yy.parser)
199
+ this.yy.parser.parseError(c, p);
200
+ else
201
+ throw new Error(c);
202
+ }, "parseError"),
203
+ // resets the lexer, sets new input
204
+ setInput: /* @__PURE__ */ g(function(c, p) {
205
+ return this.yy = p || this.yy || {}, this._input = c, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
206
+ first_line: 1,
207
+ first_column: 0,
208
+ last_line: 1,
209
+ last_column: 0
210
+ }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
211
+ }, "setInput"),
212
+ // consumes and returns one char from the input
213
+ input: /* @__PURE__ */ g(function() {
214
+ var c = this._input[0];
215
+ this.yytext += c, this.yyleng++, this.offset++, this.match += c, this.matched += c;
216
+ var p = c.match(/(?:\r\n?|\n).*/g);
217
+ return p ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), c;
218
+ }, "input"),
219
+ // unshifts one char (or a string) into the input
220
+ unput: /* @__PURE__ */ g(function(c) {
221
+ var p = c.length, f = c.split(/(?:\r\n?|\n)/g);
222
+ this._input = c + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - p), this.offset -= p;
223
+ var E = this.match.split(/(?:\r\n?|\n)/g);
224
+ this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), f.length - 1 && (this.yylineno -= f.length - 1);
225
+ var d = this.yylloc.range;
226
+ return this.yylloc = {
227
+ first_line: this.yylloc.first_line,
228
+ last_line: this.yylineno + 1,
229
+ first_column: this.yylloc.first_column,
230
+ last_column: f ? (f.length === E.length ? this.yylloc.first_column : 0) + E[E.length - f.length].length - f[0].length : this.yylloc.first_column - p
231
+ }, this.options.ranges && (this.yylloc.range = [d[0], d[0] + this.yyleng - p]), this.yyleng = this.yytext.length, this;
232
+ }, "unput"),
233
+ // When called from action, caches matched text and appends it on next action
234
+ more: /* @__PURE__ */ g(function() {
235
+ return this._more = !0, this;
236
+ }, "more"),
237
+ // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
238
+ reject: /* @__PURE__ */ g(function() {
239
+ if (this.options.backtrack_lexer)
240
+ this._backtrack = !0;
241
+ else
242
+ 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).
243
+ ` + this.showPosition(), {
244
+ text: "",
245
+ token: null,
246
+ line: this.yylineno
247
+ });
248
+ return this;
249
+ }, "reject"),
250
+ // retain first n characters of the match
251
+ less: /* @__PURE__ */ g(function(c) {
252
+ this.unput(this.match.slice(c));
253
+ }, "less"),
254
+ // displays already matched input, i.e. for error messages
255
+ pastInput: /* @__PURE__ */ g(function() {
256
+ var c = this.matched.substr(0, this.matched.length - this.match.length);
257
+ return (c.length > 20 ? "..." : "") + c.substr(-20).replace(/\n/g, "");
258
+ }, "pastInput"),
259
+ // displays upcoming input, i.e. for error messages
260
+ upcomingInput: /* @__PURE__ */ g(function() {
261
+ var c = this.match;
262
+ return c.length < 20 && (c += this._input.substr(0, 20 - c.length)), (c.substr(0, 20) + (c.length > 20 ? "..." : "")).replace(/\n/g, "");
263
+ }, "upcomingInput"),
264
+ // displays the character position where the lexing error occurred, i.e. for error messages
265
+ showPosition: /* @__PURE__ */ g(function() {
266
+ var c = this.pastInput(), p = new Array(c.length + 1).join("-");
267
+ return c + this.upcomingInput() + `
268
+ ` + p + "^";
269
+ }, "showPosition"),
270
+ // test the lexed token: return FALSE when not a match, otherwise return token
271
+ test_match: /* @__PURE__ */ g(function(c, p) {
272
+ var f, E, d;
273
+ if (this.options.backtrack_lexer && (d = {
274
+ yylineno: this.yylineno,
275
+ yylloc: {
276
+ first_line: this.yylloc.first_line,
277
+ last_line: this.last_line,
278
+ first_column: this.yylloc.first_column,
279
+ last_column: this.yylloc.last_column
280
+ },
281
+ yytext: this.yytext,
282
+ match: this.match,
283
+ matches: this.matches,
284
+ matched: this.matched,
285
+ yyleng: this.yyleng,
286
+ offset: this.offset,
287
+ _more: this._more,
288
+ _input: this._input,
289
+ yy: this.yy,
290
+ conditionStack: this.conditionStack.slice(0),
291
+ done: this.done
292
+ }, this.options.ranges && (d.yylloc.range = this.yylloc.range.slice(0))), E = c[0].match(/(?:\r\n?|\n).*/g), E && (this.yylineno += E.length), this.yylloc = {
293
+ first_line: this.yylloc.last_line,
294
+ last_line: this.yylineno + 1,
295
+ first_column: this.yylloc.last_column,
296
+ last_column: E ? E[E.length - 1].length - E[E.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + c[0].length
297
+ }, this.yytext += c[0], this.match += c[0], this.matches = c, 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(c[0].length), this.matched += c[0], f = this.performAction.call(this, this.yy, this, p, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), f)
298
+ return f;
299
+ if (this._backtrack) {
300
+ for (var m in d)
301
+ this[m] = d[m];
302
+ return !1;
303
+ }
304
+ return !1;
305
+ }, "test_match"),
306
+ // return next match in input
307
+ next: /* @__PURE__ */ g(function() {
308
+ if (this.done)
309
+ return this.EOF;
310
+ this._input || (this.done = !0);
311
+ var c, p, f, E;
312
+ this._more || (this.yytext = "", this.match = "");
313
+ for (var d = this._currentRules(), m = 0; m < d.length; m++)
314
+ if (f = this._input.match(this.rules[d[m]]), f && (!p || f[0].length > p[0].length)) {
315
+ if (p = f, E = m, this.options.backtrack_lexer) {
316
+ if (c = this.test_match(f, d[m]), c !== !1)
317
+ return c;
318
+ if (this._backtrack) {
319
+ p = !1;
320
+ continue;
321
+ } else
322
+ return !1;
323
+ } else if (!this.options.flex)
324
+ break;
325
+ }
326
+ return p ? (c = this.test_match(p, d[E]), c !== !1 ? c : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
327
+ ` + this.showPosition(), {
328
+ text: "",
329
+ token: null,
330
+ line: this.yylineno
331
+ });
332
+ }, "next"),
333
+ // return next match that has a token
334
+ lex: /* @__PURE__ */ g(function() {
335
+ var c = this.next();
336
+ return c || this.lex();
337
+ }, "lex"),
338
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
339
+ begin: /* @__PURE__ */ g(function(c) {
340
+ this.conditionStack.push(c);
341
+ }, "begin"),
342
+ // pop the previously active lexer condition state off the condition stack
343
+ popState: /* @__PURE__ */ g(function() {
344
+ var c = this.conditionStack.length - 1;
345
+ return c > 0 ? this.conditionStack.pop() : this.conditionStack[0];
346
+ }, "popState"),
347
+ // produce the lexer rule set which is active for the currently active lexer condition state
348
+ _currentRules: /* @__PURE__ */ g(function() {
349
+ return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
350
+ }, "_currentRules"),
351
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
352
+ topState: /* @__PURE__ */ g(function(c) {
353
+ return c = this.conditionStack.length - 1 - Math.abs(c || 0), c >= 0 ? this.conditionStack[c] : "INITIAL";
354
+ }, "topState"),
355
+ // alias for begin(condition)
356
+ pushState: /* @__PURE__ */ g(function(c) {
357
+ this.begin(c);
358
+ }, "pushState"),
359
+ // return the number of states currently on the stack
360
+ stateStackSize: /* @__PURE__ */ g(function() {
361
+ return this.conditionStack.length;
362
+ }, "stateStackSize"),
363
+ options: {},
364
+ performAction: /* @__PURE__ */ g(function(c, p, f, E) {
365
+ switch (f) {
366
+ case 0:
367
+ return c.getLogger().debug("Found block-beta"), 10;
368
+ case 1:
369
+ return c.getLogger().debug("Found id-block"), 29;
370
+ case 2:
371
+ return c.getLogger().debug("Found block"), 10;
372
+ case 3:
373
+ c.getLogger().debug(".", p.yytext);
374
+ break;
375
+ case 4:
376
+ c.getLogger().debug("_", p.yytext);
377
+ break;
378
+ case 5:
379
+ return 5;
380
+ case 6:
381
+ return p.yytext = -1, 28;
382
+ case 7:
383
+ return p.yytext = p.yytext.replace(/columns\s+/, ""), c.getLogger().debug("COLUMNS (LEX)", p.yytext), 28;
384
+ case 8:
385
+ this.pushState("md_string");
386
+ break;
387
+ case 9:
388
+ return "MD_STR";
389
+ case 10:
390
+ this.popState();
391
+ break;
392
+ case 11:
393
+ this.pushState("string");
394
+ break;
395
+ case 12:
396
+ c.getLogger().debug("LEX: POPPING STR:", p.yytext), this.popState();
397
+ break;
398
+ case 13:
399
+ return c.getLogger().debug("LEX: STR end:", p.yytext), "STR";
400
+ case 14:
401
+ return p.yytext = p.yytext.replace(/space\:/, ""), c.getLogger().debug("SPACE NUM (LEX)", p.yytext), 21;
402
+ case 15:
403
+ return p.yytext = "1", c.getLogger().debug("COLUMNS (LEX)", p.yytext), 21;
404
+ case 16:
405
+ return 42;
406
+ case 17:
407
+ return "LINKSTYLE";
408
+ case 18:
409
+ return "INTERPOLATE";
410
+ case 19:
411
+ return this.pushState("CLASSDEF"), 39;
412
+ case 20:
413
+ return this.popState(), this.pushState("CLASSDEFID"), "DEFAULT_CLASSDEF_ID";
414
+ case 21:
415
+ return this.popState(), this.pushState("CLASSDEFID"), 40;
416
+ case 22:
417
+ return this.popState(), 41;
418
+ case 23:
419
+ return this.pushState("CLASS"), 43;
420
+ case 24:
421
+ return this.popState(), this.pushState("CLASS_STYLE"), 44;
422
+ case 25:
423
+ return this.popState(), 45;
424
+ case 26:
425
+ return this.pushState("STYLE_STMNT"), 46;
426
+ case 27:
427
+ return this.popState(), this.pushState("STYLE_DEFINITION"), 47;
428
+ case 28:
429
+ return this.popState(), 48;
430
+ case 29:
431
+ return this.pushState("acc_title"), "acc_title";
432
+ case 30:
433
+ return this.popState(), "acc_title_value";
434
+ case 31:
435
+ return this.pushState("acc_descr"), "acc_descr";
436
+ case 32:
437
+ return this.popState(), "acc_descr_value";
438
+ case 33:
439
+ this.pushState("acc_descr_multiline");
440
+ break;
441
+ case 34:
442
+ this.popState();
443
+ break;
444
+ case 35:
445
+ return "acc_descr_multiline_value";
446
+ case 36:
447
+ return 30;
448
+ case 37:
449
+ return this.popState(), c.getLogger().debug("Lex: (("), "NODE_DEND";
450
+ case 38:
451
+ return this.popState(), c.getLogger().debug("Lex: (("), "NODE_DEND";
452
+ case 39:
453
+ return this.popState(), c.getLogger().debug("Lex: ))"), "NODE_DEND";
454
+ case 40:
455
+ return this.popState(), c.getLogger().debug("Lex: (("), "NODE_DEND";
456
+ case 41:
457
+ return this.popState(), c.getLogger().debug("Lex: (("), "NODE_DEND";
458
+ case 42:
459
+ return this.popState(), c.getLogger().debug("Lex: (-"), "NODE_DEND";
460
+ case 43:
461
+ return this.popState(), c.getLogger().debug("Lex: -)"), "NODE_DEND";
462
+ case 44:
463
+ return this.popState(), c.getLogger().debug("Lex: (("), "NODE_DEND";
464
+ case 45:
465
+ return this.popState(), c.getLogger().debug("Lex: ]]"), "NODE_DEND";
466
+ case 46:
467
+ return this.popState(), c.getLogger().debug("Lex: ("), "NODE_DEND";
468
+ case 47:
469
+ return this.popState(), c.getLogger().debug("Lex: ])"), "NODE_DEND";
470
+ case 48:
471
+ return this.popState(), c.getLogger().debug("Lex: /]"), "NODE_DEND";
472
+ case 49:
473
+ return this.popState(), c.getLogger().debug("Lex: /]"), "NODE_DEND";
474
+ case 50:
475
+ return this.popState(), c.getLogger().debug("Lex: )]"), "NODE_DEND";
476
+ case 51:
477
+ return this.popState(), c.getLogger().debug("Lex: )"), "NODE_DEND";
478
+ case 52:
479
+ return this.popState(), c.getLogger().debug("Lex: ]>"), "NODE_DEND";
480
+ case 53:
481
+ return this.popState(), c.getLogger().debug("Lex: ]"), "NODE_DEND";
482
+ case 54:
483
+ return c.getLogger().debug("Lexa: -)"), this.pushState("NODE"), 35;
484
+ case 55:
485
+ return c.getLogger().debug("Lexa: (-"), this.pushState("NODE"), 35;
486
+ case 56:
487
+ return c.getLogger().debug("Lexa: ))"), this.pushState("NODE"), 35;
488
+ case 57:
489
+ return c.getLogger().debug("Lexa: )"), this.pushState("NODE"), 35;
490
+ case 58:
491
+ return c.getLogger().debug("Lex: ((("), this.pushState("NODE"), 35;
492
+ case 59:
493
+ return c.getLogger().debug("Lexa: )"), this.pushState("NODE"), 35;
494
+ case 60:
495
+ return c.getLogger().debug("Lexa: )"), this.pushState("NODE"), 35;
496
+ case 61:
497
+ return c.getLogger().debug("Lexa: )"), this.pushState("NODE"), 35;
498
+ case 62:
499
+ return c.getLogger().debug("Lexc: >"), this.pushState("NODE"), 35;
500
+ case 63:
501
+ return c.getLogger().debug("Lexa: (["), this.pushState("NODE"), 35;
502
+ case 64:
503
+ return c.getLogger().debug("Lexa: )"), this.pushState("NODE"), 35;
504
+ case 65:
505
+ return this.pushState("NODE"), 35;
506
+ case 66:
507
+ return this.pushState("NODE"), 35;
508
+ case 67:
509
+ return this.pushState("NODE"), 35;
510
+ case 68:
511
+ return this.pushState("NODE"), 35;
512
+ case 69:
513
+ return this.pushState("NODE"), 35;
514
+ case 70:
515
+ return this.pushState("NODE"), 35;
516
+ case 71:
517
+ return this.pushState("NODE"), 35;
518
+ case 72:
519
+ return c.getLogger().debug("Lexa: ["), this.pushState("NODE"), 35;
520
+ case 73:
521
+ return this.pushState("BLOCK_ARROW"), c.getLogger().debug("LEX ARR START"), 37;
522
+ case 74:
523
+ return c.getLogger().debug("Lex: NODE_ID", p.yytext), 31;
524
+ case 75:
525
+ return c.getLogger().debug("Lex: EOF", p.yytext), 8;
526
+ case 76:
527
+ this.pushState("md_string");
528
+ break;
529
+ case 77:
530
+ this.pushState("md_string");
531
+ break;
532
+ case 78:
533
+ return "NODE_DESCR";
534
+ case 79:
535
+ this.popState();
536
+ break;
537
+ case 80:
538
+ c.getLogger().debug("Lex: Starting string"), this.pushState("string");
539
+ break;
540
+ case 81:
541
+ c.getLogger().debug("LEX ARR: Starting string"), this.pushState("string");
542
+ break;
543
+ case 82:
544
+ return c.getLogger().debug("LEX: NODE_DESCR:", p.yytext), "NODE_DESCR";
545
+ case 83:
546
+ c.getLogger().debug("LEX POPPING"), this.popState();
547
+ break;
548
+ case 84:
549
+ c.getLogger().debug("Lex: =>BAE"), this.pushState("ARROW_DIR");
550
+ break;
551
+ case 85:
552
+ return p.yytext = p.yytext.replace(/^,\s*/, ""), c.getLogger().debug("Lex (right): dir:", p.yytext), "DIR";
553
+ case 86:
554
+ return p.yytext = p.yytext.replace(/^,\s*/, ""), c.getLogger().debug("Lex (left):", p.yytext), "DIR";
555
+ case 87:
556
+ return p.yytext = p.yytext.replace(/^,\s*/, ""), c.getLogger().debug("Lex (x):", p.yytext), "DIR";
557
+ case 88:
558
+ return p.yytext = p.yytext.replace(/^,\s*/, ""), c.getLogger().debug("Lex (y):", p.yytext), "DIR";
559
+ case 89:
560
+ return p.yytext = p.yytext.replace(/^,\s*/, ""), c.getLogger().debug("Lex (up):", p.yytext), "DIR";
561
+ case 90:
562
+ return p.yytext = p.yytext.replace(/^,\s*/, ""), c.getLogger().debug("Lex (down):", p.yytext), "DIR";
563
+ case 91:
564
+ return p.yytext = "]>", c.getLogger().debug("Lex (ARROW_DIR end):", p.yytext), this.popState(), this.popState(), "BLOCK_ARROW_END";
565
+ case 92:
566
+ return c.getLogger().debug("Lex: LINK", "#" + p.yytext + "#"), 15;
567
+ case 93:
568
+ return c.getLogger().debug("Lex: LINK", p.yytext), 15;
569
+ case 94:
570
+ return c.getLogger().debug("Lex: LINK", p.yytext), 15;
571
+ case 95:
572
+ return c.getLogger().debug("Lex: LINK", p.yytext), 15;
573
+ case 96:
574
+ return c.getLogger().debug("Lex: START_LINK", p.yytext), this.pushState("LLABEL"), 16;
575
+ case 97:
576
+ return c.getLogger().debug("Lex: START_LINK", p.yytext), this.pushState("LLABEL"), 16;
577
+ case 98:
578
+ return c.getLogger().debug("Lex: START_LINK", p.yytext), this.pushState("LLABEL"), 16;
579
+ case 99:
580
+ this.pushState("md_string");
581
+ break;
582
+ case 100:
583
+ return c.getLogger().debug("Lex: Starting string"), this.pushState("string"), "LINK_LABEL";
584
+ case 101:
585
+ return this.popState(), c.getLogger().debug("Lex: LINK", "#" + p.yytext + "#"), 15;
586
+ case 102:
587
+ return this.popState(), c.getLogger().debug("Lex: LINK", p.yytext), 15;
588
+ case 103:
589
+ return this.popState(), c.getLogger().debug("Lex: LINK", p.yytext), 15;
590
+ case 104:
591
+ return c.getLogger().debug("Lex: COLON", p.yytext), p.yytext = p.yytext.slice(1), 27;
592
+ }
593
+ }, "anonymous"),
594
+ rules: [/^(?:block-beta\b)/, /^(?:block:)/, /^(?:block\b)/, /^(?:[\s]+)/, /^(?:[\n]+)/, /^(?:((\u000D\u000A)|(\u000A)))/, /^(?:columns\s+auto\b)/, /^(?:columns\s+[\d]+)/, /^(?:["][`])/, /^(?:[^`"]+)/, /^(?:[`]["])/, /^(?:["])/, /^(?:["])/, /^(?:[^"]*)/, /^(?:space[:]\d+)/, /^(?:space\b)/, /^(?:default\b)/, /^(?:linkStyle\b)/, /^(?:interpolate\b)/, /^(?:classDef\s+)/, /^(?:DEFAULT\s+)/, /^(?:\w+\s+)/, /^(?:[^\n]*)/, /^(?:class\s+)/, /^(?:(\w+)+((,\s*\w+)*))/, /^(?:[^\n]*)/, /^(?:style\s+)/, /^(?:(\w+)+((,\s*\w+)*))/, /^(?:[^\n]*)/, /^(?:accTitle\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*\{\s*)/, /^(?:[\}])/, /^(?:[^\}]*)/, /^(?:end\b\s*)/, /^(?:\(\(\()/, /^(?:\)\)\))/, /^(?:[\)]\))/, /^(?:\}\})/, /^(?:\})/, /^(?:\(-)/, /^(?:-\))/, /^(?:\(\()/, /^(?:\]\])/, /^(?:\()/, /^(?:\]\))/, /^(?:\\\])/, /^(?:\/\])/, /^(?:\)\])/, /^(?:[\)])/, /^(?:\]>)/, /^(?:[\]])/, /^(?:-\))/, /^(?:\(-)/, /^(?:\)\))/, /^(?:\))/, /^(?:\(\(\()/, /^(?:\(\()/, /^(?:\{\{)/, /^(?:\{)/, /^(?:>)/, /^(?:\(\[)/, /^(?:\()/, /^(?:\[\[)/, /^(?:\[\|)/, /^(?:\[\()/, /^(?:\)\)\))/, /^(?:\[\\)/, /^(?:\[\/)/, /^(?:\[\\)/, /^(?:\[)/, /^(?:<\[)/, /^(?:[^\(\[\n\-\)\{\}\s\<\>:]+)/, /^(?:$)/, /^(?:["][`])/, /^(?:["][`])/, /^(?:[^`"]+)/, /^(?:[`]["])/, /^(?:["])/, /^(?:["])/, /^(?:[^"]+)/, /^(?:["])/, /^(?:\]>\s*\()/, /^(?:,?\s*right\s*)/, /^(?:,?\s*left\s*)/, /^(?:,?\s*x\s*)/, /^(?:,?\s*y\s*)/, /^(?:,?\s*up\s*)/, /^(?:,?\s*down\s*)/, /^(?:\)\s*)/, /^(?:\s*[xo<]?--+[-xo>]\s*)/, /^(?:\s*[xo<]?==+[=xo>]\s*)/, /^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/, /^(?:\s*~~[\~]+\s*)/, /^(?:\s*[xo<]?--\s*)/, /^(?:\s*[xo<]?==\s*)/, /^(?:\s*[xo<]?-\.\s*)/, /^(?:["][`])/, /^(?:["])/, /^(?:\s*[xo<]?--+[-xo>]\s*)/, /^(?:\s*[xo<]?==+[=xo>]\s*)/, /^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/, /^(?::\d+)/],
595
+ conditions: { STYLE_DEFINITION: { rules: [28], inclusive: !1 }, STYLE_STMNT: { rules: [27], inclusive: !1 }, CLASSDEFID: { rules: [22], inclusive: !1 }, CLASSDEF: { rules: [20, 21], inclusive: !1 }, CLASS_STYLE: { rules: [25], inclusive: !1 }, CLASS: { rules: [24], inclusive: !1 }, LLABEL: { rules: [99, 100, 101, 102, 103], inclusive: !1 }, ARROW_DIR: { rules: [85, 86, 87, 88, 89, 90, 91], inclusive: !1 }, BLOCK_ARROW: { rules: [76, 81, 84], inclusive: !1 }, NODE: { rules: [37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 77, 80], inclusive: !1 }, md_string: { rules: [9, 10, 78, 79], inclusive: !1 }, space: { rules: [], inclusive: !1 }, string: { rules: [12, 13, 82, 83], inclusive: !1 }, acc_descr_multiline: { rules: [34, 35], inclusive: !1 }, acc_descr: { rules: [32], inclusive: !1 }, acc_title: { rules: [30], inclusive: !1 }, INITIAL: { rules: [0, 1, 2, 3, 4, 5, 6, 7, 8, 11, 14, 15, 16, 17, 18, 19, 23, 26, 29, 31, 33, 36, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 92, 93, 94, 95, 96, 97, 98, 104], inclusive: !0 } }
596
+ };
597
+ return D;
598
+ }();
599
+ k.lexer = N;
600
+ function v() {
601
+ this.yy = {};
602
+ }
603
+ return g(v, "Parser"), v.prototype = k, k.Parser = v, new v();
604
+ }();
605
+ ft.parser = ft;
606
+ var ve = ft, U = /* @__PURE__ */ new Map(), kt = [], mt = /* @__PURE__ */ new Map(), $t = "color", Ct = "fill", Ee = "bgFill", Ft = ",", De = z(), ot = /* @__PURE__ */ new Map(), Ne = /* @__PURE__ */ g((e) => me.sanitizeText(e, De), "sanitizeText"), Te = /* @__PURE__ */ g(function(e, t = "") {
607
+ let s = ot.get(e);
608
+ s || (s = { id: e, styles: [], textStyles: [] }, ot.set(e, s)), t != null && t.split(Ft).forEach((i) => {
609
+ const l = i.replace(/([^;]*);/, "$1").trim();
610
+ if (RegExp($t).exec(i)) {
611
+ const a = l.replace(Ct, Ee).replace($t, Ct);
612
+ s.textStyles.push(a);
613
+ }
614
+ s.styles.push(l);
615
+ });
616
+ }, "addStyleClass"), $e = /* @__PURE__ */ g(function(e, t = "") {
617
+ const s = U.get(e);
618
+ t != null && (s.styles = t.split(Ft));
619
+ }, "addStyle2Node"), Ce = /* @__PURE__ */ g(function(e, t) {
620
+ e.split(",").forEach(function(s) {
621
+ let i = U.get(s);
622
+ if (i === void 0) {
623
+ const l = s.trim();
624
+ i = { id: l, type: "na", children: [] }, U.set(l, i);
625
+ }
626
+ i.classes || (i.classes = []), i.classes.push(t);
627
+ });
628
+ }, "setCssClass"), Yt = /* @__PURE__ */ g((e, t) => {
629
+ const s = e.flat(), i = [], l = s.find((r) => (r == null ? void 0 : r.type) === "column-setting"), a = (l == null ? void 0 : l.columns) ?? -1;
630
+ for (const r of s) {
631
+ if (typeof a == "number" && a > 0 && r.type !== "column-setting" && typeof r.widthInColumns == "number" && r.widthInColumns > a && w.warn(
632
+ `Block ${r.id} width ${r.widthInColumns} exceeds configured column width ${a}`
633
+ ), r.label && (r.label = Ne(r.label)), r.type === "classDef") {
634
+ Te(r.id, r.css);
635
+ continue;
636
+ }
637
+ if (r.type === "applyClass") {
638
+ Ce(r.id, (r == null ? void 0 : r.styleClass) ?? "");
639
+ continue;
640
+ }
641
+ if (r.type === "applyStyles") {
642
+ r != null && r.stylesStr && $e(r.id, r == null ? void 0 : r.stylesStr);
643
+ continue;
644
+ }
645
+ if (r.type === "column-setting")
646
+ t.columns = r.columns ?? -1;
647
+ else if (r.type === "edge") {
648
+ const n = (mt.get(r.id) ?? 0) + 1;
649
+ mt.set(r.id, n), r.id = n + "-" + r.id, kt.push(r);
650
+ } else {
651
+ r.label || (r.type === "composite" ? r.label = "" : r.label = r.id);
652
+ const n = U.get(r.id);
653
+ if (n === void 0 ? U.set(r.id, r) : (r.type !== "na" && (n.type = r.type), r.label !== r.id && (n.label = r.label)), r.children && Yt(r.children, r), r.type === "space") {
654
+ const o = r.width ?? 1;
655
+ for (let u = 0; u < o; u++) {
656
+ const y = Se(r);
657
+ y.id = y.id + "-" + u, U.set(y.id, y), i.push(y);
658
+ }
659
+ } else n === void 0 && i.push(r);
660
+ }
661
+ }
662
+ t.children = i;
663
+ }, "populateBlockDatabase"), _t = [], rt = { id: "root", type: "composite", children: [], columns: -1 }, Ie = /* @__PURE__ */ g(() => {
664
+ w.debug("Clear called"), ue(), rt = { id: "root", type: "composite", children: [], columns: -1 }, U = /* @__PURE__ */ new Map([["root", rt]]), _t = [], ot = /* @__PURE__ */ new Map(), kt = [], mt = /* @__PURE__ */ new Map();
665
+ }, "clear");
666
+ function Kt(e) {
667
+ switch (w.debug("typeStr2Type", e), e) {
668
+ case "[]":
669
+ return "square";
670
+ case "()":
671
+ return w.debug("we have a round"), "round";
672
+ case "(())":
673
+ return "circle";
674
+ case ">]":
675
+ return "rect_left_inv_arrow";
676
+ case "{}":
677
+ return "diamond";
678
+ case "{{}}":
679
+ return "hexagon";
680
+ case "([])":
681
+ return "stadium";
682
+ case "[[]]":
683
+ return "subroutine";
684
+ case "[()]":
685
+ return "cylinder";
686
+ case "((()))":
687
+ return "doublecircle";
688
+ case "[//]":
689
+ return "lean_right";
690
+ case "[\\\\]":
691
+ return "lean_left";
692
+ case "[/\\]":
693
+ return "trapezoid";
694
+ case "[\\/]":
695
+ return "inv_trapezoid";
696
+ case "<[]>":
697
+ return "block_arrow";
698
+ default:
699
+ return "na";
700
+ }
701
+ }
702
+ g(Kt, "typeStr2Type");
703
+ function Ht(e) {
704
+ switch (w.debug("typeStr2Type", e), e) {
705
+ case "==":
706
+ return "thick";
707
+ default:
708
+ return "normal";
709
+ }
710
+ }
711
+ g(Ht, "edgeTypeStr2Type");
712
+ function jt(e) {
713
+ switch (e.replace(/^[\s-]+|[\s-]+$/g, "")) {
714
+ case "x":
715
+ return "arrow_cross";
716
+ case "o":
717
+ return "arrow_circle";
718
+ case ">":
719
+ return "arrow_point";
720
+ default:
721
+ return "";
722
+ }
723
+ }
724
+ g(jt, "edgeStrToEdgeData");
725
+ var It = 0, Oe = /* @__PURE__ */ g(() => (It++, "id-" + Math.random().toString(36).substr(2, 12) + "-" + It), "generateId"), Be = /* @__PURE__ */ g((e) => {
726
+ rt.children = e, Yt(e, rt), _t = rt.children;
727
+ }, "setHierarchy"), ze = /* @__PURE__ */ g((e) => {
728
+ const t = U.get(e);
729
+ return t ? t.columns ? t.columns : t.children ? t.children.length : -1 : -1;
730
+ }, "getColumns"), Re = /* @__PURE__ */ g(() => [...U.values()], "getBlocksFlat"), Ae = /* @__PURE__ */ g(() => _t || [], "getBlocks"), Me = /* @__PURE__ */ g(() => kt, "getEdges"), Pe = /* @__PURE__ */ g((e) => U.get(e), "getBlock"), Xe = /* @__PURE__ */ g((e) => {
731
+ U.set(e.id, e);
732
+ }, "setBlock"), We = /* @__PURE__ */ g(() => w, "getLogger"), Fe = /* @__PURE__ */ g(function() {
733
+ return ot;
734
+ }, "getClasses"), Ye = {
735
+ getConfig: /* @__PURE__ */ g(() => at().block, "getConfig"),
736
+ typeStr2Type: Kt,
737
+ edgeTypeStr2Type: Ht,
738
+ edgeStrToEdgeData: jt,
739
+ getLogger: We,
740
+ getBlocksFlat: Re,
741
+ getBlocks: Ae,
742
+ getEdges: Me,
743
+ setHierarchy: Be,
744
+ getBlock: Pe,
745
+ setBlock: Xe,
746
+ getColumns: ze,
747
+ getClasses: Fe,
748
+ clear: Ie,
749
+ generateId: Oe
750
+ }, Ke = Ye, nt = /* @__PURE__ */ g((e, t) => {
751
+ const s = _e, i = s(e, "r"), l = s(e, "g"), a = s(e, "b");
752
+ return ge(i, l, a, t);
753
+ }, "fade"), He = /* @__PURE__ */ g((e) => `.label {
754
+ font-family: ${e.fontFamily};
755
+ color: ${e.nodeTextColor || e.textColor};
756
+ }
757
+ .cluster-label text {
758
+ fill: ${e.titleColor};
759
+ }
760
+ .cluster-label span,p {
761
+ color: ${e.titleColor};
762
+ }
763
+
764
+
765
+
766
+ .label text,span,p {
767
+ fill: ${e.nodeTextColor || e.textColor};
768
+ color: ${e.nodeTextColor || e.textColor};
769
+ }
770
+
771
+ .node rect,
772
+ .node circle,
773
+ .node ellipse,
774
+ .node polygon,
775
+ .node path {
776
+ fill: ${e.mainBkg};
777
+ stroke: ${e.nodeBorder};
778
+ stroke-width: 1px;
779
+ }
780
+ .flowchart-label text {
781
+ text-anchor: middle;
782
+ }
783
+ // .flowchart-label .text-outer-tspan {
784
+ // text-anchor: middle;
785
+ // }
786
+ // .flowchart-label .text-inner-tspan {
787
+ // text-anchor: start;
788
+ // }
789
+
790
+ .node .label {
791
+ text-align: center;
792
+ }
793
+ .node.clickable {
794
+ cursor: pointer;
795
+ }
796
+
797
+ .arrowheadPath {
798
+ fill: ${e.arrowheadColor};
799
+ }
800
+
801
+ .edgePath .path {
802
+ stroke: ${e.lineColor};
803
+ stroke-width: 2.0px;
804
+ }
805
+
806
+ .flowchart-link {
807
+ stroke: ${e.lineColor};
808
+ fill: none;
809
+ }
810
+
811
+ .edgeLabel {
812
+ background-color: ${e.edgeLabelBackground};
813
+ rect {
814
+ opacity: 0.5;
815
+ background-color: ${e.edgeLabelBackground};
816
+ fill: ${e.edgeLabelBackground};
817
+ }
818
+ text-align: center;
819
+ }
820
+
821
+ /* For html labels only */
822
+ .labelBkg {
823
+ background-color: ${nt(e.edgeLabelBackground, 0.5)};
824
+ // background-color:
825
+ }
826
+
827
+ .node .cluster {
828
+ // fill: ${nt(e.mainBkg, 0.5)};
829
+ fill: ${nt(e.clusterBkg, 0.5)};
830
+ stroke: ${nt(e.clusterBorder, 0.2)};
831
+ box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px;
832
+ stroke-width: 1px;
833
+ }
834
+
835
+ .cluster text {
836
+ fill: ${e.titleColor};
837
+ }
838
+
839
+ .cluster span,p {
840
+ color: ${e.titleColor};
841
+ }
842
+ /* .cluster div {
843
+ color: ${e.titleColor};
844
+ } */
845
+
846
+ div.mermaidTooltip {
847
+ position: absolute;
848
+ text-align: center;
849
+ max-width: 200px;
850
+ padding: 2px;
851
+ font-family: ${e.fontFamily};
852
+ font-size: 12px;
853
+ background: ${e.tertiaryColor};
854
+ border: 1px solid ${e.border2};
855
+ border-radius: 2px;
856
+ pointer-events: none;
857
+ z-index: 100;
858
+ }
859
+
860
+ .flowchartTitleText {
861
+ text-anchor: middle;
862
+ font-size: 18px;
863
+ fill: ${e.textColor};
864
+ }
865
+ ${ce()}
866
+ `, "getStyles"), je = He, Ue = /* @__PURE__ */ g((e, t, s, i) => {
867
+ t.forEach((l) => {
868
+ ar[l](e, s, i);
869
+ });
870
+ }, "insertMarkers"), Ze = /* @__PURE__ */ g((e, t, s) => {
871
+ w.trace("Making markers for ", s), e.append("defs").append("marker").attr("id", s + "_" + 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", s + "_" + 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");
872
+ }, "extension"), Ge = /* @__PURE__ */ g((e, t, s) => {
873
+ e.append("defs").append("marker").attr("id", s + "_" + 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", s + "_" + 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");
874
+ }, "composition"), Je = /* @__PURE__ */ g((e, t, s) => {
875
+ e.append("defs").append("marker").attr("id", s + "_" + 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", s + "_" + 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");
876
+ }, "aggregation"), Qe = /* @__PURE__ */ g((e, t, s) => {
877
+ e.append("defs").append("marker").attr("id", s + "_" + 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", s + "_" + 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");
878
+ }, "dependency"), Ve = /* @__PURE__ */ g((e, t, s) => {
879
+ e.append("defs").append("marker").attr("id", s + "_" + 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", s + "_" + 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);
880
+ }, "lollipop"), qe = /* @__PURE__ */ g((e, t, s) => {
881
+ e.append("marker").attr("id", s + "_" + 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", s + "_" + 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");
882
+ }, "point"), tr = /* @__PURE__ */ g((e, t, s) => {
883
+ e.append("marker").attr("id", s + "_" + 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", s + "_" + 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");
884
+ }, "circle"), er = /* @__PURE__ */ g((e, t, s) => {
885
+ e.append("marker").attr("id", s + "_" + 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", s + "_" + 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");
886
+ }, "cross"), rr = /* @__PURE__ */ g((e, t, s) => {
887
+ e.append("defs").append("marker").attr("id", s + "_" + 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");
888
+ }, "barb"), ar = {
889
+ extension: Ze,
890
+ composition: Ge,
891
+ aggregation: Je,
892
+ dependency: Qe,
893
+ lollipop: Ve,
894
+ point: qe,
895
+ circle: tr,
896
+ cross: er,
897
+ barb: rr
898
+ }, sr = Ue, Ot, Bt, I = ((Bt = (Ot = z()) == null ? void 0 : Ot.block) == null ? void 0 : Bt.padding) ?? 8;
899
+ function Ut(e, t) {
900
+ if (e === 0 || !Number.isInteger(e))
901
+ throw new Error("Columns must be an integer !== 0.");
902
+ if (t < 0 || !Number.isInteger(t))
903
+ throw new Error("Position must be a non-negative integer." + t);
904
+ if (e < 0)
905
+ return { px: t, py: 0 };
906
+ if (e === 1)
907
+ return { px: 0, py: t };
908
+ const s = t % e, i = Math.floor(t / e);
909
+ return { px: s, py: i };
910
+ }
911
+ g(Ut, "calculateBlockPosition");
912
+ var ir = /* @__PURE__ */ g((e) => {
913
+ let t = 0, s = 0;
914
+ for (const i of e.children) {
915
+ const { width: l, height: a, x: r, y: n } = i.size ?? { width: 0, height: 0, x: 0, y: 0 };
916
+ w.debug(
917
+ "getMaxChildSize abc95 child:",
918
+ i.id,
919
+ "width:",
920
+ l,
921
+ "height:",
922
+ a,
923
+ "x:",
924
+ r,
925
+ "y:",
926
+ n,
927
+ i.type
928
+ ), i.type !== "space" && (l > t && (t = l / (e.widthInColumns ?? 1)), a > s && (s = a));
929
+ }
930
+ return { width: t, height: s };
931
+ }, "getMaxChildSize");
932
+ function dt(e, t, s = 0, i = 0) {
933
+ var l, a, r, n, o, u, y, b, x, S, L;
934
+ w.debug(
935
+ "setBlockSizes abc95 (start)",
936
+ e.id,
937
+ (l = e == null ? void 0 : e.size) == null ? void 0 : l.x,
938
+ "block width =",
939
+ e == null ? void 0 : e.size,
940
+ "siblingWidth",
941
+ s
942
+ ), (a = e == null ? void 0 : e.size) != null && a.width || (e.size = {
943
+ width: s,
944
+ height: i,
945
+ x: 0,
946
+ y: 0
947
+ });
948
+ let _ = 0, k = 0;
949
+ if (((r = e.children) == null ? void 0 : r.length) > 0) {
950
+ for (const d of e.children)
951
+ dt(d, t);
952
+ const N = ir(e);
953
+ _ = N.width, k = N.height, w.debug("setBlockSizes abc95 maxWidth of", e.id, ":s children is ", _, k);
954
+ for (const d of e.children)
955
+ d.size && (w.debug(
956
+ `abc95 Setting size of children of ${e.id} id=${d.id} ${_} ${k} ${JSON.stringify(d.size)}`
957
+ ), d.size.width = _ * (d.widthInColumns ?? 1) + I * ((d.widthInColumns ?? 1) - 1), d.size.height = k, d.size.x = 0, d.size.y = 0, w.debug(
958
+ `abc95 updating size of ${e.id} children child:${d.id} maxWidth:${_} maxHeight:${k}`
959
+ ));
960
+ for (const d of e.children)
961
+ dt(d, t, _, k);
962
+ const v = e.columns ?? -1;
963
+ let D = 0;
964
+ for (const d of e.children)
965
+ D += d.widthInColumns ?? 1;
966
+ let c = e.children.length;
967
+ v > 0 && v < D && (c = v);
968
+ const p = Math.ceil(D / c);
969
+ let f = c * (_ + I) + I, E = p * (k + I) + I;
970
+ if (f < s) {
971
+ w.debug(
972
+ `Detected to small sibling: abc95 ${e.id} siblingWidth ${s} siblingHeight ${i} width ${f}`
973
+ ), f = s, E = i;
974
+ const d = (s - c * I - I) / c, m = (i - p * I - I) / p;
975
+ w.debug("Size indata abc88", e.id, "childWidth", d, "maxWidth", _), w.debug("Size indata abc88", e.id, "childHeight", m, "maxHeight", k), w.debug("Size indata abc88 xSize", c, "padding", I);
976
+ for (const h of e.children)
977
+ h.size && (h.size.width = d, h.size.height = m, h.size.x = 0, h.size.y = 0);
978
+ }
979
+ if (w.debug(
980
+ `abc95 (finale calc) ${e.id} xSize ${c} ySize ${p} columns ${v}${e.children.length} width=${Math.max(f, ((n = e.size) == null ? void 0 : n.width) || 0)}`
981
+ ), f < (((o = e == null ? void 0 : e.size) == null ? void 0 : o.width) || 0)) {
982
+ f = ((u = e == null ? void 0 : e.size) == null ? void 0 : u.width) || 0;
983
+ const d = v > 0 ? Math.min(e.children.length, v) : e.children.length;
984
+ if (d > 0) {
985
+ const m = (f - d * I - I) / d;
986
+ w.debug("abc95 (growing to fit) width", e.id, f, (y = e.size) == null ? void 0 : y.width, m);
987
+ for (const h of e.children)
988
+ h.size && (h.size.width = m);
989
+ }
990
+ }
991
+ e.size = {
992
+ width: f,
993
+ height: E,
994
+ x: 0,
995
+ y: 0
996
+ };
997
+ }
998
+ w.debug(
999
+ "setBlockSizes abc94 (done)",
1000
+ e.id,
1001
+ (b = e == null ? void 0 : e.size) == null ? void 0 : b.x,
1002
+ (x = e == null ? void 0 : e.size) == null ? void 0 : x.width,
1003
+ (S = e == null ? void 0 : e.size) == null ? void 0 : S.y,
1004
+ (L = e == null ? void 0 : e.size) == null ? void 0 : L.height
1005
+ );
1006
+ }
1007
+ g(dt, "setBlockSizes");
1008
+ function vt(e, t) {
1009
+ var s, i, l, a, r, n, o, u, y, b, x, S, L, _, k, N, v;
1010
+ w.debug(
1011
+ `abc85 layout blocks (=>layoutBlocks) ${e.id} x: ${(s = e == null ? void 0 : e.size) == null ? void 0 : s.x} y: ${(i = e == null ? void 0 : e.size) == null ? void 0 : i.y} width: ${(l = e == null ? void 0 : e.size) == null ? void 0 : l.width}`
1012
+ );
1013
+ const D = e.columns ?? -1;
1014
+ if (w.debug("layoutBlocks columns abc95", e.id, "=>", D, e), e.children && // find max width of children
1015
+ e.children.length > 0) {
1016
+ const c = ((r = (a = e == null ? void 0 : e.children[0]) == null ? void 0 : a.size) == null ? void 0 : r.width) ?? 0, p = e.children.length * c + (e.children.length - 1) * I;
1017
+ w.debug("widthOfChildren 88", p, "posX");
1018
+ let f = 0;
1019
+ w.debug("abc91 block?.size?.x", e.id, (n = e == null ? void 0 : e.size) == null ? void 0 : n.x);
1020
+ let E = (o = e == null ? void 0 : e.size) != null && o.x ? ((u = e == null ? void 0 : e.size) == null ? void 0 : u.x) + (-((y = e == null ? void 0 : e.size) == null ? void 0 : y.width) / 2 || 0) : -I, d = 0;
1021
+ for (const m of e.children) {
1022
+ const h = e;
1023
+ if (!m.size)
1024
+ continue;
1025
+ const { width: O, height: M } = m.size, { px: R, py: W } = Ut(D, f);
1026
+ if (W != d && (d = W, E = (b = e == null ? void 0 : e.size) != null && b.x ? ((x = e == null ? void 0 : e.size) == null ? void 0 : x.x) + (-((S = e == null ? void 0 : e.size) == null ? void 0 : S.width) / 2 || 0) : -I, w.debug("New row in layout for block", e.id, " and child ", m.id, d)), w.debug(
1027
+ `abc89 layout blocks (child) id: ${m.id} Pos: ${f} (px, py) ${R},${W} (${(L = h == null ? void 0 : h.size) == null ? void 0 : L.x},${(_ = h == null ? void 0 : h.size) == null ? void 0 : _.y}) parent: ${h.id} width: ${O}${I}`
1028
+ ), h.size) {
1029
+ const T = O / 2;
1030
+ m.size.x = E + I + T, w.debug(
1031
+ `abc91 layout blocks (calc) px, pyid:${m.id} startingPos=X${E} new startingPosX${m.size.x} ${T} padding=${I} width=${O} halfWidth=${T} => x:${m.size.x} y:${m.size.y} ${m.widthInColumns} (width * (child?.w || 1)) / 2 ${O * ((m == null ? void 0 : m.widthInColumns) ?? 1) / 2}`
1032
+ ), E = m.size.x + T, m.size.y = h.size.y - h.size.height / 2 + W * (M + I) + M / 2 + I, w.debug(
1033
+ `abc88 layout blocks (calc) px, pyid:${m.id}startingPosX${E}${I}${T}=>x:${m.size.x}y:${m.size.y}${m.widthInColumns}(width * (child?.w || 1)) / 2${O * ((m == null ? void 0 : m.widthInColumns) ?? 1) / 2}`
1034
+ );
1035
+ }
1036
+ m.children && vt(m);
1037
+ let j = (m == null ? void 0 : m.widthInColumns) ?? 1;
1038
+ D > 0 && (j = Math.min(j, D - f % D)), f += j, w.debug("abc88 columnsPos", m, f);
1039
+ }
1040
+ }
1041
+ w.debug(
1042
+ `layout blocks (<==layoutBlocks) ${e.id} x: ${(k = e == null ? void 0 : e.size) == null ? void 0 : k.x} y: ${(N = e == null ? void 0 : e.size) == null ? void 0 : N.y} width: ${(v = e == null ? void 0 : e.size) == null ? void 0 : v.width}`
1043
+ );
1044
+ }
1045
+ g(vt, "layoutBlocks");
1046
+ function Et(e, { minX: t, minY: s, maxX: i, maxY: l } = { minX: 0, minY: 0, maxX: 0, maxY: 0 }) {
1047
+ if (e.size && e.id !== "root") {
1048
+ const { x: a, y: r, width: n, height: o } = e.size;
1049
+ a - n / 2 < t && (t = a - n / 2), r - o / 2 < s && (s = r - o / 2), a + n / 2 > i && (i = a + n / 2), r + o / 2 > l && (l = r + o / 2);
1050
+ }
1051
+ if (e.children)
1052
+ for (const a of e.children)
1053
+ ({ minX: t, minY: s, maxX: i, maxY: l } = Et(a, { minX: t, minY: s, maxX: i, maxY: l }));
1054
+ return { minX: t, minY: s, maxX: i, maxY: l };
1055
+ }
1056
+ g(Et, "findBounds");
1057
+ function Zt(e) {
1058
+ const t = e.getBlock("root");
1059
+ if (!t)
1060
+ return;
1061
+ dt(t, e, 0, 0), vt(t), w.debug("getBlocks", JSON.stringify(t, null, 2));
1062
+ const { minX: s, minY: i, maxX: l, maxY: a } = Et(t), r = a - i, n = l - s;
1063
+ return { x: s, y: i, width: n, height: r };
1064
+ }
1065
+ g(Zt, "layout");
1066
+ function wt(e, t) {
1067
+ t && e.attr("style", t);
1068
+ }
1069
+ g(wt, "applyStyle");
1070
+ function Gt(e, t) {
1071
+ const s = B(document.createElementNS("http://www.w3.org/2000/svg", "foreignObject")), i = s.append("xhtml:div"), l = e.label, a = e.isNode ? "nodeLabel" : "edgeLabel", r = i.append("span");
1072
+ return r.html(xt(l, t)), wt(r, e.labelStyle), r.attr("class", a), wt(i, e.labelStyle), i.style("display", "inline-block"), i.style("white-space", "nowrap"), i.attr("xmlns", "http://www.w3.org/1999/xhtml"), s.node();
1073
+ }
1074
+ g(Gt, "addHtmlLabel");
1075
+ var nr = /* @__PURE__ */ g(async (e, t, s, i) => {
1076
+ let l = e || "";
1077
+ typeof l == "object" && (l = l[0]);
1078
+ const a = z();
1079
+ if (G(a.flowchart.htmlLabels)) {
1080
+ l = l.replace(/\\n|\n/g, "<br />"), w.debug("vertexText" + l);
1081
+ const r = await we(bt(l)), n = {
1082
+ isNode: i,
1083
+ label: r,
1084
+ labelStyle: t.replace("fill:", "color:")
1085
+ };
1086
+ return Gt(n, a);
1087
+ } else {
1088
+ const r = document.createElementNS("http://www.w3.org/2000/svg", "text");
1089
+ r.setAttribute("style", t.replace("color:", "fill:"));
1090
+ let n = [];
1091
+ typeof l == "string" ? n = l.split(/\\n|\n|<br\s*\/?>/gi) : Array.isArray(l) ? n = l : n = [];
1092
+ for (const o of n) {
1093
+ const u = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
1094
+ u.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", "preserve"), u.setAttribute("dy", "1em"), u.setAttribute("x", "0"), s ? u.setAttribute("class", "title-row") : u.setAttribute("class", "row"), u.textContent = o.trim(), r.appendChild(u);
1095
+ }
1096
+ return r;
1097
+ }
1098
+ }, "createLabel"), H = nr, lr = /* @__PURE__ */ g((e, t, s, i, l) => {
1099
+ t.arrowTypeStart && zt(e, "start", t.arrowTypeStart, s, i, l), t.arrowTypeEnd && zt(e, "end", t.arrowTypeEnd, s, i, l);
1100
+ }, "addEdgeMarkers"), or = {
1101
+ arrow_cross: "cross",
1102
+ arrow_point: "point",
1103
+ arrow_barb: "barb",
1104
+ arrow_circle: "circle",
1105
+ aggregation: "aggregation",
1106
+ extension: "extension",
1107
+ composition: "composition",
1108
+ dependency: "dependency",
1109
+ lollipop: "lollipop"
1110
+ }, zt = /* @__PURE__ */ g((e, t, s, i, l, a) => {
1111
+ const r = or[s];
1112
+ if (!r) {
1113
+ w.warn(`Unknown arrow type: ${s}`);
1114
+ return;
1115
+ }
1116
+ const n = t === "start" ? "Start" : "End";
1117
+ e.attr(`marker-${t}`, `url(${i}#${l}_${a}-${r}${n})`);
1118
+ }, "addEdgeMarker"), Lt = {}, P = {}, dr = /* @__PURE__ */ g(async (e, t) => {
1119
+ const s = z(), i = G(s.flowchart.htmlLabels), l = t.labelType === "markdown" ? Wt(
1120
+ e,
1121
+ t.label,
1122
+ {
1123
+ style: t.labelStyle,
1124
+ useHtmlLabels: i,
1125
+ addSvgBackground: !0
1126
+ },
1127
+ s
1128
+ ) : await H(t.label, t.labelStyle), a = e.insert("g").attr("class", "edgeLabel"), r = a.insert("g").attr("class", "label");
1129
+ r.node().appendChild(l);
1130
+ let n = l.getBBox();
1131
+ if (i) {
1132
+ const u = l.children[0], y = B(l);
1133
+ n = u.getBoundingClientRect(), y.attr("width", n.width), y.attr("height", n.height);
1134
+ }
1135
+ r.attr("transform", "translate(" + -n.width / 2 + ", " + -n.height / 2 + ")"), Lt[t.id] = a, t.width = n.width, t.height = n.height;
1136
+ let o;
1137
+ if (t.startLabelLeft) {
1138
+ const u = await H(t.startLabelLeft, t.labelStyle), y = e.insert("g").attr("class", "edgeTerminals"), b = y.insert("g").attr("class", "inner");
1139
+ o = b.node().appendChild(u);
1140
+ const x = u.getBBox();
1141
+ b.attr("transform", "translate(" + -x.width / 2 + ", " + -x.height / 2 + ")"), P[t.id] || (P[t.id] = {}), P[t.id].startLeft = y, et(o, t.startLabelLeft);
1142
+ }
1143
+ if (t.startLabelRight) {
1144
+ const u = await H(t.startLabelRight, t.labelStyle), y = e.insert("g").attr("class", "edgeTerminals"), b = y.insert("g").attr("class", "inner");
1145
+ o = y.node().appendChild(u), b.node().appendChild(u);
1146
+ const x = u.getBBox();
1147
+ b.attr("transform", "translate(" + -x.width / 2 + ", " + -x.height / 2 + ")"), P[t.id] || (P[t.id] = {}), P[t.id].startRight = y, et(o, t.startLabelRight);
1148
+ }
1149
+ if (t.endLabelLeft) {
1150
+ const u = await H(t.endLabelLeft, t.labelStyle), y = e.insert("g").attr("class", "edgeTerminals"), b = y.insert("g").attr("class", "inner");
1151
+ o = b.node().appendChild(u);
1152
+ const x = u.getBBox();
1153
+ b.attr("transform", "translate(" + -x.width / 2 + ", " + -x.height / 2 + ")"), y.node().appendChild(u), P[t.id] || (P[t.id] = {}), P[t.id].endLeft = y, et(o, t.endLabelLeft);
1154
+ }
1155
+ if (t.endLabelRight) {
1156
+ const u = await H(t.endLabelRight, t.labelStyle), y = e.insert("g").attr("class", "edgeTerminals"), b = y.insert("g").attr("class", "inner");
1157
+ o = b.node().appendChild(u);
1158
+ const x = u.getBBox();
1159
+ b.attr("transform", "translate(" + -x.width / 2 + ", " + -x.height / 2 + ")"), y.node().appendChild(u), P[t.id] || (P[t.id] = {}), P[t.id].endRight = y, et(o, t.endLabelRight);
1160
+ }
1161
+ return l;
1162
+ }, "insertEdgeLabel");
1163
+ function et(e, t) {
1164
+ z().flowchart.htmlLabels && e && (e.style.width = t.length * 9 + "px", e.style.height = "12px");
1165
+ }
1166
+ g(et, "setTerminalWidth");
1167
+ var cr = /* @__PURE__ */ g((e, t) => {
1168
+ w.debug("Moving label abc88 ", e.id, e.label, Lt[e.id], t);
1169
+ let s = t.updatedPath ? t.updatedPath : t.originalPath;
1170
+ const i = z(), { subGraphTitleTotalMargin: l } = fe(i);
1171
+ if (e.label) {
1172
+ const a = Lt[e.id];
1173
+ let r = e.x, n = e.y;
1174
+ if (s) {
1175
+ const o = tt.calcLabelPosition(s);
1176
+ w.debug(
1177
+ "Moving label " + e.label + " from (",
1178
+ r,
1179
+ ",",
1180
+ n,
1181
+ ") to (",
1182
+ o.x,
1183
+ ",",
1184
+ o.y,
1185
+ ") abc88"
1186
+ ), t.updatedPath && (r = o.x, n = o.y);
1187
+ }
1188
+ a.attr("transform", `translate(${r}, ${n + l / 2})`);
1189
+ }
1190
+ if (e.startLabelLeft) {
1191
+ const a = P[e.id].startLeft;
1192
+ let r = e.x, n = e.y;
1193
+ if (s) {
1194
+ const o = tt.calcTerminalLabelPosition(e.arrowTypeStart ? 10 : 0, "start_left", s);
1195
+ r = o.x, n = o.y;
1196
+ }
1197
+ a.attr("transform", `translate(${r}, ${n})`);
1198
+ }
1199
+ if (e.startLabelRight) {
1200
+ const a = P[e.id].startRight;
1201
+ let r = e.x, n = e.y;
1202
+ if (s) {
1203
+ const o = tt.calcTerminalLabelPosition(
1204
+ e.arrowTypeStart ? 10 : 0,
1205
+ "start_right",
1206
+ s
1207
+ );
1208
+ r = o.x, n = o.y;
1209
+ }
1210
+ a.attr("transform", `translate(${r}, ${n})`);
1211
+ }
1212
+ if (e.endLabelLeft) {
1213
+ const a = P[e.id].endLeft;
1214
+ let r = e.x, n = e.y;
1215
+ if (s) {
1216
+ const o = tt.calcTerminalLabelPosition(e.arrowTypeEnd ? 10 : 0, "end_left", s);
1217
+ r = o.x, n = o.y;
1218
+ }
1219
+ a.attr("transform", `translate(${r}, ${n})`);
1220
+ }
1221
+ if (e.endLabelRight) {
1222
+ const a = P[e.id].endRight;
1223
+ let r = e.x, n = e.y;
1224
+ if (s) {
1225
+ const o = tt.calcTerminalLabelPosition(e.arrowTypeEnd ? 10 : 0, "end_right", s);
1226
+ r = o.x, n = o.y;
1227
+ }
1228
+ a.attr("transform", `translate(${r}, ${n})`);
1229
+ }
1230
+ }, "positionEdgeLabel"), hr = /* @__PURE__ */ g((e, t) => {
1231
+ const s = e.x, i = e.y, l = Math.abs(t.x - s), a = Math.abs(t.y - i), r = e.width / 2, n = e.height / 2;
1232
+ return l >= r || a >= n;
1233
+ }, "outsideNode"), ur = /* @__PURE__ */ g((e, t, s) => {
1234
+ w.debug(`intersection calc abc89:
1235
+ outsidePoint: ${JSON.stringify(t)}
1236
+ insidePoint : ${JSON.stringify(s)}
1237
+ node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);
1238
+ const i = e.x, l = e.y, a = Math.abs(i - s.x), r = e.width / 2;
1239
+ let n = s.x < t.x ? r - a : r + a;
1240
+ const o = e.height / 2, u = Math.abs(t.y - s.y), y = Math.abs(t.x - s.x);
1241
+ if (Math.abs(l - t.y) * r > Math.abs(i - t.x) * o) {
1242
+ let b = s.y < t.y ? t.y - o - l : l - o - t.y;
1243
+ n = y * b / u;
1244
+ const x = {
1245
+ x: s.x < t.x ? s.x + n : s.x - y + n,
1246
+ y: s.y < t.y ? s.y + u - b : s.y - u + b
1247
+ };
1248
+ return n === 0 && (x.x = t.x, x.y = t.y), y === 0 && (x.x = t.x), u === 0 && (x.y = t.y), w.debug(`abc89 topp/bott calc, Q ${u}, q ${b}, R ${y}, r ${n}`, x), x;
1249
+ } else {
1250
+ s.x < t.x ? n = t.x - r - i : n = i - r - t.x;
1251
+ let b = u * n / y, x = s.x < t.x ? s.x + y - n : s.x - y + n, S = s.y < t.y ? s.y + b : s.y - b;
1252
+ return w.debug(`sides calc abc89, Q ${u}, q ${b}, R ${y}, r ${n}`, { _x: x, _y: S }), n === 0 && (x = t.x, S = t.y), y === 0 && (x = t.x), u === 0 && (S = t.y), { x, y: S };
1253
+ }
1254
+ }, "intersection"), Rt = /* @__PURE__ */ g((e, t) => {
1255
+ w.debug("abc88 cutPathAtIntersect", e, t);
1256
+ let s = [], i = e[0], l = !1;
1257
+ return e.forEach((a) => {
1258
+ if (!hr(t, a) && !l) {
1259
+ const r = ur(t, i, a);
1260
+ let n = !1;
1261
+ s.forEach((o) => {
1262
+ n = n || o.x === r.x && o.y === r.y;
1263
+ }), s.some((o) => o.x === r.x && o.y === r.y) || s.push(r), l = !0;
1264
+ } else
1265
+ i = a, l || s.push(a);
1266
+ }), s;
1267
+ }, "cutPathAtIntersect"), gr = /* @__PURE__ */ g(function(e, t, s, i, l, a, r) {
1268
+ let n = s.points;
1269
+ w.debug("abc88 InsertEdge: edge=", s, "e=", t);
1270
+ let o = !1;
1271
+ const u = a.node(t.v);
1272
+ var y = a.node(t.w);
1273
+ y != null && y.intersect && u != null && u.intersect && (n = n.slice(1, s.points.length - 1), n.unshift(u.intersect(n[0])), n.push(y.intersect(n[n.length - 1]))), s.toCluster && (w.debug("to cluster abc88", i[s.toCluster]), n = Rt(s.points, i[s.toCluster].node), o = !0), s.fromCluster && (w.debug("from cluster abc88", i[s.fromCluster]), n = Rt(n.reverse(), i[s.fromCluster].node).reverse(), o = !0);
1274
+ const b = n.filter((c) => !Number.isNaN(c.y));
1275
+ let x = be;
1276
+ s.curve && (l === "graph" || l === "flowchart") && (x = s.curve);
1277
+ const { x: S, y: L } = ye(s), _ = pe().x(S).y(L).curve(x);
1278
+ let k;
1279
+ switch (s.thickness) {
1280
+ case "normal":
1281
+ k = "edge-thickness-normal";
1282
+ break;
1283
+ case "thick":
1284
+ k = "edge-thickness-thick";
1285
+ break;
1286
+ case "invisible":
1287
+ k = "edge-thickness-thick";
1288
+ break;
1289
+ default:
1290
+ k = "";
1291
+ }
1292
+ switch (s.pattern) {
1293
+ case "solid":
1294
+ k += " edge-pattern-solid";
1295
+ break;
1296
+ case "dotted":
1297
+ k += " edge-pattern-dotted";
1298
+ break;
1299
+ case "dashed":
1300
+ k += " edge-pattern-dashed";
1301
+ break;
1302
+ }
1303
+ const N = e.append("path").attr("d", _(b)).attr("id", s.id).attr("class", " " + k + (s.classes ? " " + s.classes : "")).attr("style", s.style);
1304
+ let v = "";
1305
+ (z().flowchart.arrowMarkerAbsolute || z().state.arrowMarkerAbsolute) && (v = xe(!0)), lr(N, s, v, r, l);
1306
+ let D = {};
1307
+ return o && (D.updatedPath = n), D.originalPath = s.points, D;
1308
+ }, "insertEdge"), yr = /* @__PURE__ */ g((e) => {
1309
+ const t = /* @__PURE__ */ new Set();
1310
+ for (const s of e)
1311
+ switch (s) {
1312
+ case "x":
1313
+ t.add("right"), t.add("left");
1314
+ break;
1315
+ case "y":
1316
+ t.add("up"), t.add("down");
1317
+ break;
1318
+ default:
1319
+ t.add(s);
1320
+ break;
1321
+ }
1322
+ return t;
1323
+ }, "expandAndDeduplicateDirections"), pr = /* @__PURE__ */ g((e, t, s) => {
1324
+ const i = yr(e), l = 2, a = t.height + 2 * s.padding, r = a / l, n = t.width + 2 * r + s.padding, o = s.padding / 2;
1325
+ return i.has("right") && i.has("left") && i.has("up") && i.has("down") ? [
1326
+ // Bottom
1327
+ { x: 0, y: 0 },
1328
+ { x: r, y: 0 },
1329
+ { x: n / 2, y: 2 * o },
1330
+ { x: n - r, y: 0 },
1331
+ { x: n, y: 0 },
1332
+ // Right
1333
+ { x: n, y: -a / 3 },
1334
+ { x: n + 2 * o, y: -a / 2 },
1335
+ { x: n, y: -2 * a / 3 },
1336
+ { x: n, y: -a },
1337
+ // Top
1338
+ { x: n - r, y: -a },
1339
+ { x: n / 2, y: -a - 2 * o },
1340
+ { x: r, y: -a },
1341
+ // Left
1342
+ { x: 0, y: -a },
1343
+ { x: 0, y: -2 * a / 3 },
1344
+ { x: -2 * o, y: -a / 2 },
1345
+ { x: 0, y: -a / 3 }
1346
+ ] : i.has("right") && i.has("left") && i.has("up") ? [
1347
+ { x: r, y: 0 },
1348
+ { x: n - r, y: 0 },
1349
+ { x: n, y: -a / 2 },
1350
+ { x: n - r, y: -a },
1351
+ { x: r, y: -a },
1352
+ { x: 0, y: -a / 2 }
1353
+ ] : i.has("right") && i.has("left") && i.has("down") ? [
1354
+ { x: 0, y: 0 },
1355
+ { x: r, y: -a },
1356
+ { x: n - r, y: -a },
1357
+ { x: n, y: 0 }
1358
+ ] : i.has("right") && i.has("up") && i.has("down") ? [
1359
+ { x: 0, y: 0 },
1360
+ { x: n, y: -r },
1361
+ { x: n, y: -a + r },
1362
+ { x: 0, y: -a }
1363
+ ] : i.has("left") && i.has("up") && i.has("down") ? [
1364
+ { x: n, y: 0 },
1365
+ { x: 0, y: -r },
1366
+ { x: 0, y: -a + r },
1367
+ { x: n, y: -a }
1368
+ ] : i.has("right") && i.has("left") ? [
1369
+ { x: r, y: 0 },
1370
+ { x: r, y: -o },
1371
+ { x: n - r, y: -o },
1372
+ { x: n - r, y: 0 },
1373
+ { x: n, y: -a / 2 },
1374
+ { x: n - r, y: -a },
1375
+ { x: n - r, y: -a + o },
1376
+ { x: r, y: -a + o },
1377
+ { x: r, y: -a },
1378
+ { x: 0, y: -a / 2 }
1379
+ ] : i.has("up") && i.has("down") ? [
1380
+ // Bottom center
1381
+ { x: n / 2, y: 0 },
1382
+ // Left pont of bottom arrow
1383
+ { x: 0, y: -o },
1384
+ { x: r, y: -o },
1385
+ // Left top over vertical section
1386
+ { x: r, y: -a + o },
1387
+ { x: 0, y: -a + o },
1388
+ // Top of arrow
1389
+ { x: n / 2, y: -a },
1390
+ { x: n, y: -a + o },
1391
+ // Top of right vertical bar
1392
+ { x: n - r, y: -a + o },
1393
+ { x: n - r, y: -o },
1394
+ { x: n, y: -o }
1395
+ ] : i.has("right") && i.has("up") ? [
1396
+ { x: 0, y: 0 },
1397
+ { x: n, y: -r },
1398
+ { x: 0, y: -a }
1399
+ ] : i.has("right") && i.has("down") ? [
1400
+ { x: 0, y: 0 },
1401
+ { x: n, y: 0 },
1402
+ { x: 0, y: -a }
1403
+ ] : i.has("left") && i.has("up") ? [
1404
+ { x: n, y: 0 },
1405
+ { x: 0, y: -r },
1406
+ { x: n, y: -a }
1407
+ ] : i.has("left") && i.has("down") ? [
1408
+ { x: n, y: 0 },
1409
+ { x: 0, y: 0 },
1410
+ { x: n, y: -a }
1411
+ ] : i.has("right") ? [
1412
+ { x: r, y: -o },
1413
+ { x: r, y: -o },
1414
+ { x: n - r, y: -o },
1415
+ { x: n - r, y: 0 },
1416
+ { x: n, y: -a / 2 },
1417
+ { x: n - r, y: -a },
1418
+ { x: n - r, y: -a + o },
1419
+ // top left corner of arrow
1420
+ { x: r, y: -a + o },
1421
+ { x: r, y: -a + o }
1422
+ ] : i.has("left") ? [
1423
+ { x: r, y: 0 },
1424
+ { x: r, y: -o },
1425
+ // Two points, the right corners
1426
+ { x: n - r, y: -o },
1427
+ { x: n - r, y: -a + o },
1428
+ { x: r, y: -a + o },
1429
+ { x: r, y: -a },
1430
+ { x: 0, y: -a / 2 }
1431
+ ] : i.has("up") ? [
1432
+ // Bottom center
1433
+ { x: r, y: -o },
1434
+ // Left top over vertical section
1435
+ { x: r, y: -a + o },
1436
+ { x: 0, y: -a + o },
1437
+ // Top of arrow
1438
+ { x: n / 2, y: -a },
1439
+ { x: n, y: -a + o },
1440
+ // Top of right vertical bar
1441
+ { x: n - r, y: -a + o },
1442
+ { x: n - r, y: -o }
1443
+ ] : i.has("down") ? [
1444
+ // Bottom center
1445
+ { x: n / 2, y: 0 },
1446
+ // Left pont of bottom arrow
1447
+ { x: 0, y: -o },
1448
+ { x: r, y: -o },
1449
+ // Left top over vertical section
1450
+ { x: r, y: -a + o },
1451
+ { x: n - r, y: -a + o },
1452
+ { x: n - r, y: -o },
1453
+ { x: n, y: -o }
1454
+ ] : [{ x: 0, y: 0 }];
1455
+ }, "getArrowPoints");
1456
+ function Jt(e, t) {
1457
+ return e.intersect(t);
1458
+ }
1459
+ g(Jt, "intersectNode");
1460
+ var br = Jt;
1461
+ function Qt(e, t, s, i) {
1462
+ var l = e.x, a = e.y, r = l - i.x, n = a - i.y, o = Math.sqrt(t * t * n * n + s * s * r * r), u = Math.abs(t * s * r / o);
1463
+ i.x < l && (u = -u);
1464
+ var y = Math.abs(t * s * n / o);
1465
+ return i.y < a && (y = -y), { x: l + u, y: a + y };
1466
+ }
1467
+ g(Qt, "intersectEllipse");
1468
+ var Vt = Qt;
1469
+ function qt(e, t, s) {
1470
+ return Vt(e, t, t, s);
1471
+ }
1472
+ g(qt, "intersectCircle");
1473
+ var xr = qt;
1474
+ function te(e, t, s, i) {
1475
+ var l, a, r, n, o, u, y, b, x, S, L, _, k, N, v;
1476
+ if (l = t.y - e.y, r = e.x - t.x, o = t.x * e.y - e.x * t.y, x = l * s.x + r * s.y + o, S = l * i.x + r * i.y + o, !(x !== 0 && S !== 0 && St(x, S)) && (a = i.y - s.y, n = s.x - i.x, u = i.x * s.y - s.x * i.y, y = a * e.x + n * e.y + u, b = a * t.x + n * t.y + u, !(y !== 0 && b !== 0 && St(y, b)) && (L = l * n - a * r, L !== 0)))
1477
+ return _ = Math.abs(L / 2), k = r * u - n * o, N = k < 0 ? (k - _) / L : (k + _) / L, k = a * o - l * u, v = k < 0 ? (k - _) / L : (k + _) / L, { x: N, y: v };
1478
+ }
1479
+ g(te, "intersectLine");
1480
+ function St(e, t) {
1481
+ return e * t > 0;
1482
+ }
1483
+ g(St, "sameSign");
1484
+ var fr = te, mr = ee;
1485
+ function ee(e, t, s) {
1486
+ var i = e.x, l = e.y, a = [], r = Number.POSITIVE_INFINITY, n = Number.POSITIVE_INFINITY;
1487
+ typeof t.forEach == "function" ? t.forEach(function(L) {
1488
+ r = Math.min(r, L.x), n = Math.min(n, L.y);
1489
+ }) : (r = Math.min(r, t.x), n = Math.min(n, t.y));
1490
+ for (var o = i - e.width / 2 - r, u = l - e.height / 2 - n, y = 0; y < t.length; y++) {
1491
+ var b = t[y], x = t[y < t.length - 1 ? y + 1 : 0], S = fr(
1492
+ e,
1493
+ s,
1494
+ { x: o + b.x, y: u + b.y },
1495
+ { x: o + x.x, y: u + x.y }
1496
+ );
1497
+ S && a.push(S);
1498
+ }
1499
+ return a.length ? (a.length > 1 && a.sort(function(L, _) {
1500
+ var k = L.x - s.x, N = L.y - s.y, v = Math.sqrt(k * k + N * N), D = _.x - s.x, c = _.y - s.y, p = Math.sqrt(D * D + c * c);
1501
+ return v < p ? -1 : v === p ? 0 : 1;
1502
+ }), a[0]) : e;
1503
+ }
1504
+ g(ee, "intersectPolygon");
1505
+ var wr = /* @__PURE__ */ g((e, t) => {
1506
+ var s = e.x, i = e.y, l = t.x - s, a = t.y - i, r = e.width / 2, n = e.height / 2, o, u;
1507
+ return Math.abs(a) * r > Math.abs(l) * n ? (a < 0 && (n = -n), o = a === 0 ? 0 : n * l / a, u = n) : (l < 0 && (r = -r), o = r, u = l === 0 ? 0 : r * a / l), { x: s + o, y: i + u };
1508
+ }, "intersectRect"), Lr = wr, $ = {
1509
+ node: br,
1510
+ circle: xr,
1511
+ ellipse: Vt,
1512
+ polygon: mr,
1513
+ rect: Lr
1514
+ }, A = /* @__PURE__ */ g(async (e, t, s, i) => {
1515
+ const l = z();
1516
+ let a;
1517
+ const r = t.useHtmlLabels || G(l.flowchart.htmlLabels);
1518
+ s ? a = s : a = "node default";
1519
+ const n = e.insert("g").attr("class", a).attr("id", t.domId || t.id), o = n.insert("g").attr("class", "label").attr("style", t.labelStyle);
1520
+ let u;
1521
+ t.labelText === void 0 ? u = "" : u = typeof t.labelText == "string" ? t.labelText : t.labelText[0];
1522
+ const y = o.node();
1523
+ let b;
1524
+ t.labelType === "markdown" ? b = Wt(
1525
+ o,
1526
+ xt(bt(u), l),
1527
+ {
1528
+ useHtmlLabels: r,
1529
+ width: t.width || l.flowchart.wrappingWidth,
1530
+ classes: "markdown-node-label"
1531
+ },
1532
+ l
1533
+ ) : b = y.appendChild(
1534
+ await H(
1535
+ xt(bt(u), l),
1536
+ t.labelStyle,
1537
+ !1,
1538
+ i
1539
+ )
1540
+ );
1541
+ let x = b.getBBox();
1542
+ const S = t.padding / 2;
1543
+ if (G(l.flowchart.htmlLabels)) {
1544
+ const L = b.children[0], _ = B(b), k = L.getElementsByTagName("img");
1545
+ if (k) {
1546
+ const N = u.replace(/<img[^>]*>/g, "").trim() === "";
1547
+ await Promise.all(
1548
+ [...k].map(
1549
+ (v) => new Promise((D) => {
1550
+ function c() {
1551
+ if (v.style.display = "flex", v.style.flexDirection = "column", N) {
1552
+ const p = l.fontSize ? l.fontSize : window.getComputedStyle(document.body).fontSize, f = parseInt(p, 10) * 5 + "px";
1553
+ v.style.minWidth = f, v.style.maxWidth = f;
1554
+ } else
1555
+ v.style.width = "100%";
1556
+ D(v);
1557
+ }
1558
+ g(c, "setupImage"), setTimeout(() => {
1559
+ v.complete && c();
1560
+ }), v.addEventListener("error", c), v.addEventListener("load", c);
1561
+ })
1562
+ )
1563
+ );
1564
+ }
1565
+ x = L.getBoundingClientRect(), _.attr("width", x.width), _.attr("height", x.height);
1566
+ }
1567
+ return r ? o.attr("transform", "translate(" + -x.width / 2 + ", " + -x.height / 2 + ")") : o.attr("transform", "translate(0, " + -x.height / 2 + ")"), t.centerLabel && o.attr("transform", "translate(" + -x.width / 2 + ", " + -x.height / 2 + ")"), o.insert("rect", ":first-child"), { shapeSvg: n, bbox: x, halfPadding: S, label: o };
1568
+ }, "labelHelper"), C = /* @__PURE__ */ g((e, t) => {
1569
+ const s = t.node().getBBox();
1570
+ e.width = s.width, e.height = s.height;
1571
+ }, "updateNodeBounds");
1572
+ function Z(e, t, s, i) {
1573
+ return e.insert("polygon", ":first-child").attr(
1574
+ "points",
1575
+ i.map(function(l) {
1576
+ return l.x + "," + l.y;
1577
+ }).join(" ")
1578
+ ).attr("class", "label-container").attr("transform", "translate(" + -t / 2 + "," + s / 2 + ")");
1579
+ }
1580
+ g(Z, "insertPolygonShape");
1581
+ var Sr = /* @__PURE__ */ g(async (e, t) => {
1582
+ t.useHtmlLabels || z().flowchart.htmlLabels || (t.centerLabel = !0);
1583
+ const { shapeSvg: s, bbox: i, halfPadding: l } = await A(
1584
+ e,
1585
+ t,
1586
+ "node " + t.classes,
1587
+ !0
1588
+ );
1589
+ w.info("Classes = ", t.classes);
1590
+ const a = s.insert("rect", ":first-child");
1591
+ return a.attr("rx", t.rx).attr("ry", t.ry).attr("x", -i.width / 2 - l).attr("y", -i.height / 2 - l).attr("width", i.width + t.padding).attr("height", i.height + t.padding), C(t, a), t.intersect = function(r) {
1592
+ return $.rect(t, r);
1593
+ }, s;
1594
+ }, "note"), kr = Sr, At = /* @__PURE__ */ g((e) => e ? " " + e : "", "formatClass"), Y = /* @__PURE__ */ g((e, t) => `${t || "node default"}${At(e.classes)} ${At(
1595
+ e.class
1596
+ )}`, "getClassesFromNode"), Mt = /* @__PURE__ */ g(async (e, t) => {
1597
+ const { shapeSvg: s, bbox: i } = await A(
1598
+ e,
1599
+ t,
1600
+ Y(t, void 0),
1601
+ !0
1602
+ ), l = i.width + t.padding, a = i.height + t.padding, r = l + a, n = [
1603
+ { x: r / 2, y: 0 },
1604
+ { x: r, y: -r / 2 },
1605
+ { x: r / 2, y: -r },
1606
+ { x: 0, y: -r / 2 }
1607
+ ];
1608
+ w.info("Question main (Circle)");
1609
+ const o = Z(s, r, r, n);
1610
+ return o.attr("style", t.style), C(t, o), t.intersect = function(u) {
1611
+ return w.warn("Intersect called"), $.polygon(t, n, u);
1612
+ }, s;
1613
+ }, "question"), _r = /* @__PURE__ */ g((e, t) => {
1614
+ const s = e.insert("g").attr("class", "node default").attr("id", t.domId || t.id), i = 28, l = [
1615
+ { x: 0, y: i / 2 },
1616
+ { x: i / 2, y: 0 },
1617
+ { x: 0, y: -i / 2 },
1618
+ { x: -i / 2, y: 0 }
1619
+ ];
1620
+ return s.insert("polygon", ":first-child").attr(
1621
+ "points",
1622
+ l.map(function(a) {
1623
+ return a.x + "," + a.y;
1624
+ }).join(" ")
1625
+ ).attr("class", "state-start").attr("r", 7).attr("width", 28).attr("height", 28), t.width = 28, t.height = 28, t.intersect = function(a) {
1626
+ return $.circle(t, 14, a);
1627
+ }, s;
1628
+ }, "choice"), vr = /* @__PURE__ */ g(async (e, t) => {
1629
+ const { shapeSvg: s, bbox: i } = await A(
1630
+ e,
1631
+ t,
1632
+ Y(t, void 0),
1633
+ !0
1634
+ ), l = 4, a = i.height + t.padding, r = a / l, n = i.width + 2 * r + t.padding, o = [
1635
+ { x: r, y: 0 },
1636
+ { x: n - r, y: 0 },
1637
+ { x: n, y: -a / 2 },
1638
+ { x: n - r, y: -a },
1639
+ { x: r, y: -a },
1640
+ { x: 0, y: -a / 2 }
1641
+ ], u = Z(s, n, a, o);
1642
+ return u.attr("style", t.style), C(t, u), t.intersect = function(y) {
1643
+ return $.polygon(t, o, y);
1644
+ }, s;
1645
+ }, "hexagon"), Er = /* @__PURE__ */ g(async (e, t) => {
1646
+ const { shapeSvg: s, bbox: i } = await A(e, t, void 0, !0), l = 2, a = i.height + 2 * t.padding, r = a / l, n = i.width + 2 * r + t.padding, o = pr(t.directions, i, t), u = Z(s, n, a, o);
1647
+ return u.attr("style", t.style), C(t, u), t.intersect = function(y) {
1648
+ return $.polygon(t, o, y);
1649
+ }, s;
1650
+ }, "block_arrow"), Dr = /* @__PURE__ */ g(async (e, t) => {
1651
+ const { shapeSvg: s, bbox: i } = await A(
1652
+ e,
1653
+ t,
1654
+ Y(t, void 0),
1655
+ !0
1656
+ ), l = i.width + t.padding, a = i.height + t.padding, r = [
1657
+ { x: -a / 2, y: 0 },
1658
+ { x: l, y: 0 },
1659
+ { x: l, y: -a },
1660
+ { x: -a / 2, y: -a },
1661
+ { x: 0, y: -a / 2 }
1662
+ ];
1663
+ return Z(s, l, a, r).attr("style", t.style), t.width = l + a, t.height = a, t.intersect = function(n) {
1664
+ return $.polygon(t, r, n);
1665
+ }, s;
1666
+ }, "rect_left_inv_arrow"), Nr = /* @__PURE__ */ g(async (e, t) => {
1667
+ const { shapeSvg: s, bbox: i } = await A(e, t, Y(t), !0), l = i.width + t.padding, a = i.height + t.padding, r = [
1668
+ { x: -2 * a / 6, y: 0 },
1669
+ { x: l - a / 6, y: 0 },
1670
+ { x: l + 2 * a / 6, y: -a },
1671
+ { x: a / 6, y: -a }
1672
+ ], n = Z(s, l, a, r);
1673
+ return n.attr("style", t.style), C(t, n), t.intersect = function(o) {
1674
+ return $.polygon(t, r, o);
1675
+ }, s;
1676
+ }, "lean_right"), Tr = /* @__PURE__ */ g(async (e, t) => {
1677
+ const { shapeSvg: s, bbox: i } = await A(
1678
+ e,
1679
+ t,
1680
+ Y(t, void 0),
1681
+ !0
1682
+ ), l = i.width + t.padding, a = i.height + t.padding, r = [
1683
+ { x: 2 * a / 6, y: 0 },
1684
+ { x: l + a / 6, y: 0 },
1685
+ { x: l - 2 * a / 6, y: -a },
1686
+ { x: -a / 6, y: -a }
1687
+ ], n = Z(s, l, a, r);
1688
+ return n.attr("style", t.style), C(t, n), t.intersect = function(o) {
1689
+ return $.polygon(t, r, o);
1690
+ }, s;
1691
+ }, "lean_left"), $r = /* @__PURE__ */ g(async (e, t) => {
1692
+ const { shapeSvg: s, bbox: i } = await A(
1693
+ e,
1694
+ t,
1695
+ Y(t, void 0),
1696
+ !0
1697
+ ), l = i.width + t.padding, a = i.height + t.padding, r = [
1698
+ { x: -2 * a / 6, y: 0 },
1699
+ { x: l + 2 * a / 6, y: 0 },
1700
+ { x: l - a / 6, y: -a },
1701
+ { x: a / 6, y: -a }
1702
+ ], n = Z(s, l, a, r);
1703
+ return n.attr("style", t.style), C(t, n), t.intersect = function(o) {
1704
+ return $.polygon(t, r, o);
1705
+ }, s;
1706
+ }, "trapezoid"), Cr = /* @__PURE__ */ g(async (e, t) => {
1707
+ const { shapeSvg: s, bbox: i } = await A(
1708
+ e,
1709
+ t,
1710
+ Y(t, void 0),
1711
+ !0
1712
+ ), l = i.width + t.padding, a = i.height + t.padding, r = [
1713
+ { x: a / 6, y: 0 },
1714
+ { x: l - a / 6, y: 0 },
1715
+ { x: l + 2 * a / 6, y: -a },
1716
+ { x: -2 * a / 6, y: -a }
1717
+ ], n = Z(s, l, a, r);
1718
+ return n.attr("style", t.style), C(t, n), t.intersect = function(o) {
1719
+ return $.polygon(t, r, o);
1720
+ }, s;
1721
+ }, "inv_trapezoid"), Ir = /* @__PURE__ */ g(async (e, t) => {
1722
+ const { shapeSvg: s, bbox: i } = await A(
1723
+ e,
1724
+ t,
1725
+ Y(t, void 0),
1726
+ !0
1727
+ ), l = i.width + t.padding, a = i.height + t.padding, r = [
1728
+ { x: 0, y: 0 },
1729
+ { x: l + a / 2, y: 0 },
1730
+ { x: l, y: -a / 2 },
1731
+ { x: l + a / 2, y: -a },
1732
+ { x: 0, y: -a }
1733
+ ], n = Z(s, l, a, r);
1734
+ return n.attr("style", t.style), C(t, n), t.intersect = function(o) {
1735
+ return $.polygon(t, r, o);
1736
+ }, s;
1737
+ }, "rect_right_inv_arrow"), Or = /* @__PURE__ */ g(async (e, t) => {
1738
+ const { shapeSvg: s, bbox: i } = await A(
1739
+ e,
1740
+ t,
1741
+ Y(t, void 0),
1742
+ !0
1743
+ ), l = i.width + t.padding, a = l / 2, r = a / (2.5 + l / 50), n = i.height + r + t.padding, o = "M 0," + r + " a " + a + "," + r + " 0,0,0 " + l + " 0 a " + a + "," + r + " 0,0,0 " + -l + " 0 l 0," + n + " a " + a + "," + r + " 0,0,0 " + l + " 0 l 0," + -n, u = s.attr("label-offset-y", r).insert("path", ":first-child").attr("style", t.style).attr("d", o).attr("transform", "translate(" + -l / 2 + "," + -(n / 2 + r) + ")");
1744
+ return C(t, u), t.intersect = function(y) {
1745
+ const b = $.rect(t, y), x = b.x - t.x;
1746
+ if (a != 0 && (Math.abs(x) < t.width / 2 || Math.abs(x) == t.width / 2 && Math.abs(b.y - t.y) > t.height / 2 - r)) {
1747
+ let S = r * r * (1 - x * x / (a * a));
1748
+ S != 0 && (S = Math.sqrt(S)), S = r - S, y.y - t.y > 0 && (S = -S), b.y += S;
1749
+ }
1750
+ return b;
1751
+ }, s;
1752
+ }, "cylinder"), Br = /* @__PURE__ */ g(async (e, t) => {
1753
+ const { shapeSvg: s, bbox: i, halfPadding: l } = await A(
1754
+ e,
1755
+ t,
1756
+ "node " + t.classes + " " + t.class,
1757
+ !0
1758
+ ), a = s.insert("rect", ":first-child"), r = t.positioned ? t.width : i.width + t.padding, n = t.positioned ? t.height : i.height + t.padding, o = t.positioned ? -r / 2 : -i.width / 2 - l, u = t.positioned ? -n / 2 : -i.height / 2 - l;
1759
+ if (a.attr("class", "basic label-container").attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("x", o).attr("y", u).attr("width", r).attr("height", n), t.props) {
1760
+ const y = new Set(Object.keys(t.props));
1761
+ t.props.borders && (ct(a, t.props.borders, r, n), y.delete("borders")), y.forEach((b) => {
1762
+ w.warn(`Unknown node property ${b}`);
1763
+ });
1764
+ }
1765
+ return C(t, a), t.intersect = function(y) {
1766
+ return $.rect(t, y);
1767
+ }, s;
1768
+ }, "rect"), zr = /* @__PURE__ */ g(async (e, t) => {
1769
+ const { shapeSvg: s, bbox: i, halfPadding: l } = await A(
1770
+ e,
1771
+ t,
1772
+ "node " + t.classes,
1773
+ !0
1774
+ ), a = s.insert("rect", ":first-child"), r = t.positioned ? t.width : i.width + t.padding, n = t.positioned ? t.height : i.height + t.padding, o = t.positioned ? -r / 2 : -i.width / 2 - l, u = t.positioned ? -n / 2 : -i.height / 2 - l;
1775
+ if (a.attr("class", "basic cluster composite label-container").attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("x", o).attr("y", u).attr("width", r).attr("height", n), t.props) {
1776
+ const y = new Set(Object.keys(t.props));
1777
+ t.props.borders && (ct(a, t.props.borders, r, n), y.delete("borders")), y.forEach((b) => {
1778
+ w.warn(`Unknown node property ${b}`);
1779
+ });
1780
+ }
1781
+ return C(t, a), t.intersect = function(y) {
1782
+ return $.rect(t, y);
1783
+ }, s;
1784
+ }, "composite"), Rr = /* @__PURE__ */ g(async (e, t) => {
1785
+ const { shapeSvg: s } = await A(e, t, "label", !0);
1786
+ w.trace("Classes = ", t.class);
1787
+ const i = s.insert("rect", ":first-child"), l = 0, a = 0;
1788
+ if (i.attr("width", l).attr("height", a), s.attr("class", "label edgeLabel"), t.props) {
1789
+ const r = new Set(Object.keys(t.props));
1790
+ t.props.borders && (ct(i, t.props.borders, l, a), r.delete("borders")), r.forEach((n) => {
1791
+ w.warn(`Unknown node property ${n}`);
1792
+ });
1793
+ }
1794
+ return C(t, i), t.intersect = function(r) {
1795
+ return $.rect(t, r);
1796
+ }, s;
1797
+ }, "labelRect");
1798
+ function ct(e, t, s, i) {
1799
+ const l = [], a = /* @__PURE__ */ g((n) => {
1800
+ l.push(n, 0);
1801
+ }, "addBorder"), r = /* @__PURE__ */ g((n) => {
1802
+ l.push(0, n);
1803
+ }, "skipBorder");
1804
+ t.includes("t") ? (w.debug("add top border"), a(s)) : r(s), t.includes("r") ? (w.debug("add right border"), a(i)) : r(i), t.includes("b") ? (w.debug("add bottom border"), a(s)) : r(s), t.includes("l") ? (w.debug("add left border"), a(i)) : r(i), e.attr("stroke-dasharray", l.join(" "));
1805
+ }
1806
+ g(ct, "applyNodePropertyBorders");
1807
+ var Ar = /* @__PURE__ */ g(async (e, t) => {
1808
+ let s;
1809
+ t.classes ? s = "node " + t.classes : s = "node default";
1810
+ const i = e.insert("g").attr("class", s).attr("id", t.domId || t.id), l = i.insert("rect", ":first-child"), a = i.insert("line"), r = i.insert("g").attr("class", "label"), n = t.labelText.flat ? t.labelText.flat() : t.labelText;
1811
+ let o = "";
1812
+ typeof n == "object" ? o = n[0] : o = n, w.info("Label text abc79", o, n, typeof n == "object");
1813
+ const u = r.node().appendChild(await H(o, t.labelStyle, !0, !0));
1814
+ let y = { width: 0, height: 0 };
1815
+ if (G(z().flowchart.htmlLabels)) {
1816
+ const _ = u.children[0], k = B(u);
1817
+ y = _.getBoundingClientRect(), k.attr("width", y.width), k.attr("height", y.height);
1818
+ }
1819
+ w.info("Text 2", n);
1820
+ const b = n.slice(1, n.length);
1821
+ let x = u.getBBox();
1822
+ const S = r.node().appendChild(
1823
+ await H(
1824
+ b.join ? b.join("<br/>") : b,
1825
+ t.labelStyle,
1826
+ !0,
1827
+ !0
1828
+ )
1829
+ );
1830
+ if (G(z().flowchart.htmlLabels)) {
1831
+ const _ = S.children[0], k = B(S);
1832
+ y = _.getBoundingClientRect(), k.attr("width", y.width), k.attr("height", y.height);
1833
+ }
1834
+ const L = t.padding / 2;
1835
+ return B(S).attr(
1836
+ "transform",
1837
+ "translate( " + // (titleBox.width - bbox.width) / 2 +
1838
+ (y.width > x.width ? 0 : (x.width - y.width) / 2) + ", " + (x.height + L + 5) + ")"
1839
+ ), B(u).attr(
1840
+ "transform",
1841
+ "translate( " + // (titleBox.width - bbox.width) / 2 +
1842
+ (y.width < x.width ? 0 : -(x.width - y.width) / 2) + ", 0)"
1843
+ ), y = r.node().getBBox(), r.attr(
1844
+ "transform",
1845
+ "translate(" + -y.width / 2 + ", " + (-y.height / 2 - L + 3) + ")"
1846
+ ), l.attr("class", "outer title-state").attr("x", -y.width / 2 - L).attr("y", -y.height / 2 - L).attr("width", y.width + t.padding).attr("height", y.height + t.padding), a.attr("class", "divider").attr("x1", -y.width / 2 - L).attr("x2", y.width / 2 + L).attr("y1", -y.height / 2 - L + x.height + L).attr("y2", -y.height / 2 - L + x.height + L), C(t, l), t.intersect = function(_) {
1847
+ return $.rect(t, _);
1848
+ }, i;
1849
+ }, "rectWithTitle"), Mr = /* @__PURE__ */ g(async (e, t) => {
1850
+ const { shapeSvg: s, bbox: i } = await A(
1851
+ e,
1852
+ t,
1853
+ Y(t, void 0),
1854
+ !0
1855
+ ), l = i.height + t.padding, a = i.width + l / 4 + t.padding, r = s.insert("rect", ":first-child").attr("style", t.style).attr("rx", l / 2).attr("ry", l / 2).attr("x", -a / 2).attr("y", -l / 2).attr("width", a).attr("height", l);
1856
+ return C(t, r), t.intersect = function(n) {
1857
+ return $.rect(t, n);
1858
+ }, s;
1859
+ }, "stadium"), Pr = /* @__PURE__ */ g(async (e, t) => {
1860
+ const { shapeSvg: s, bbox: i, halfPadding: l } = await A(
1861
+ e,
1862
+ t,
1863
+ Y(t, void 0),
1864
+ !0
1865
+ ), a = s.insert("circle", ":first-child");
1866
+ return a.attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("r", i.width / 2 + l).attr("width", i.width + t.padding).attr("height", i.height + t.padding), w.info("Circle main"), C(t, a), t.intersect = function(r) {
1867
+ return w.info("Circle intersect", t, i.width / 2 + l, r), $.circle(t, i.width / 2 + l, r);
1868
+ }, s;
1869
+ }, "circle"), Xr = /* @__PURE__ */ g(async (e, t) => {
1870
+ const { shapeSvg: s, bbox: i, halfPadding: l } = await A(
1871
+ e,
1872
+ t,
1873
+ Y(t, void 0),
1874
+ !0
1875
+ ), a = 5, r = s.insert("g", ":first-child"), n = r.insert("circle"), o = r.insert("circle");
1876
+ return r.attr("class", t.class), n.attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("r", i.width / 2 + l + a).attr("width", i.width + t.padding + a * 2).attr("height", i.height + t.padding + a * 2), o.attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("r", i.width / 2 + l).attr("width", i.width + t.padding).attr("height", i.height + t.padding), w.info("DoubleCircle main"), C(t, n), t.intersect = function(u) {
1877
+ return w.info("DoubleCircle intersect", t, i.width / 2 + l + a, u), $.circle(t, i.width / 2 + l + a, u);
1878
+ }, s;
1879
+ }, "doublecircle"), Wr = /* @__PURE__ */ g(async (e, t) => {
1880
+ const { shapeSvg: s, bbox: i } = await A(
1881
+ e,
1882
+ t,
1883
+ Y(t, void 0),
1884
+ !0
1885
+ ), l = i.width + t.padding, a = i.height + t.padding, r = [
1886
+ { x: 0, y: 0 },
1887
+ { x: l, y: 0 },
1888
+ { x: l, y: -a },
1889
+ { x: 0, y: -a },
1890
+ { x: 0, y: 0 },
1891
+ { x: -8, y: 0 },
1892
+ { x: l + 8, y: 0 },
1893
+ { x: l + 8, y: -a },
1894
+ { x: -8, y: -a },
1895
+ { x: -8, y: 0 }
1896
+ ], n = Z(s, l, a, r);
1897
+ return n.attr("style", t.style), C(t, n), t.intersect = function(o) {
1898
+ return $.polygon(t, r, o);
1899
+ }, s;
1900
+ }, "subroutine"), Fr = /* @__PURE__ */ g((e, t) => {
1901
+ const s = e.insert("g").attr("class", "node default").attr("id", t.domId || t.id), i = s.insert("circle", ":first-child");
1902
+ return i.attr("class", "state-start").attr("r", 7).attr("width", 14).attr("height", 14), C(t, i), t.intersect = function(l) {
1903
+ return $.circle(t, 7, l);
1904
+ }, s;
1905
+ }, "start"), Pt = /* @__PURE__ */ g((e, t, s) => {
1906
+ const i = e.insert("g").attr("class", "node default").attr("id", t.domId || t.id);
1907
+ let l = 70, a = 10;
1908
+ s === "LR" && (l = 10, a = 70);
1909
+ const r = i.append("rect").attr("x", -1 * l / 2).attr("y", -1 * a / 2).attr("width", l).attr("height", a).attr("class", "fork-join");
1910
+ return C(t, r), t.height = t.height + t.padding / 2, t.width = t.width + t.padding / 2, t.intersect = function(n) {
1911
+ return $.rect(t, n);
1912
+ }, i;
1913
+ }, "forkJoin"), Yr = /* @__PURE__ */ g((e, t) => {
1914
+ const s = e.insert("g").attr("class", "node default").attr("id", t.domId || t.id), i = s.insert("circle", ":first-child"), l = s.insert("circle", ":first-child");
1915
+ return l.attr("class", "state-start").attr("r", 7).attr("width", 14).attr("height", 14), i.attr("class", "state-end").attr("r", 5).attr("width", 10).attr("height", 10), C(t, l), t.intersect = function(a) {
1916
+ return $.circle(t, 7, a);
1917
+ }, s;
1918
+ }, "end"), Kr = /* @__PURE__ */ g(async (e, t) => {
1919
+ var s;
1920
+ const i = t.padding / 2, l = 4, a = 8;
1921
+ let r;
1922
+ t.classes ? r = "node " + t.classes : r = "node default";
1923
+ const n = e.insert("g").attr("class", r).attr("id", t.domId || t.id), o = n.insert("rect", ":first-child"), u = n.insert("line"), y = n.insert("line");
1924
+ let b = 0, x = l;
1925
+ const S = n.insert("g").attr("class", "label");
1926
+ let L = 0;
1927
+ const _ = (s = t.classData.annotations) == null ? void 0 : s[0], k = t.classData.annotations[0] ? "«" + t.classData.annotations[0] + "»" : "", N = S.node().appendChild(await H(k, t.labelStyle, !0, !0));
1928
+ let v = N.getBBox();
1929
+ if (G(z().flowchart.htmlLabels)) {
1930
+ const m = N.children[0], h = B(N);
1931
+ v = m.getBoundingClientRect(), h.attr("width", v.width), h.attr("height", v.height);
1932
+ }
1933
+ t.classData.annotations[0] && (x += v.height + l, b += v.width);
1934
+ let D = t.classData.label;
1935
+ t.classData.type !== void 0 && t.classData.type !== "" && (z().flowchart.htmlLabels ? D += "&lt;" + t.classData.type + "&gt;" : D += "<" + t.classData.type + ">");
1936
+ const c = S.node().appendChild(await H(D, t.labelStyle, !0, !0));
1937
+ B(c).attr("class", "classTitle");
1938
+ let p = c.getBBox();
1939
+ if (G(z().flowchart.htmlLabels)) {
1940
+ const m = c.children[0], h = B(c);
1941
+ p = m.getBoundingClientRect(), h.attr("width", p.width), h.attr("height", p.height);
1942
+ }
1943
+ x += p.height + l, p.width > b && (b = p.width);
1944
+ const f = [];
1945
+ t.classData.members.forEach(async (m) => {
1946
+ const h = m.getDisplayDetails();
1947
+ let O = h.displayText;
1948
+ z().flowchart.htmlLabels && (O = O.replace(/</g, "&lt;").replace(/>/g, "&gt;"));
1949
+ const M = S.node().appendChild(
1950
+ await H(
1951
+ O,
1952
+ h.cssStyle ? h.cssStyle : t.labelStyle,
1953
+ !0,
1954
+ !0
1955
+ )
1956
+ );
1957
+ let R = M.getBBox();
1958
+ if (G(z().flowchart.htmlLabels)) {
1959
+ const W = M.children[0], j = B(M);
1960
+ R = W.getBoundingClientRect(), j.attr("width", R.width), j.attr("height", R.height);
1961
+ }
1962
+ R.width > b && (b = R.width), x += R.height + l, f.push(M);
1963
+ }), x += a;
1964
+ const E = [];
1965
+ if (t.classData.methods.forEach(async (m) => {
1966
+ const h = m.getDisplayDetails();
1967
+ let O = h.displayText;
1968
+ z().flowchart.htmlLabels && (O = O.replace(/</g, "&lt;").replace(/>/g, "&gt;"));
1969
+ const M = S.node().appendChild(
1970
+ await H(
1971
+ O,
1972
+ h.cssStyle ? h.cssStyle : t.labelStyle,
1973
+ !0,
1974
+ !0
1975
+ )
1976
+ );
1977
+ let R = M.getBBox();
1978
+ if (G(z().flowchart.htmlLabels)) {
1979
+ const W = M.children[0], j = B(M);
1980
+ R = W.getBoundingClientRect(), j.attr("width", R.width), j.attr("height", R.height);
1981
+ }
1982
+ R.width > b && (b = R.width), x += R.height + l, E.push(M);
1983
+ }), x += a, _) {
1984
+ let m = (b - v.width) / 2;
1985
+ B(N).attr(
1986
+ "transform",
1987
+ "translate( " + (-1 * b / 2 + m) + ", " + -1 * x / 2 + ")"
1988
+ ), L = v.height + l;
1989
+ }
1990
+ let d = (b - p.width) / 2;
1991
+ return B(c).attr(
1992
+ "transform",
1993
+ "translate( " + (-1 * b / 2 + d) + ", " + (-1 * x / 2 + L) + ")"
1994
+ ), L += p.height + l, u.attr("class", "divider").attr("x1", -b / 2 - i).attr("x2", b / 2 + i).attr("y1", -x / 2 - i + a + L).attr("y2", -x / 2 - i + a + L), L += a, f.forEach((m) => {
1995
+ B(m).attr(
1996
+ "transform",
1997
+ "translate( " + -b / 2 + ", " + (-1 * x / 2 + L + a / 2) + ")"
1998
+ );
1999
+ const h = m == null ? void 0 : m.getBBox();
2000
+ L += ((h == null ? void 0 : h.height) ?? 0) + l;
2001
+ }), L += a, y.attr("class", "divider").attr("x1", -b / 2 - i).attr("x2", b / 2 + i).attr("y1", -x / 2 - i + a + L).attr("y2", -x / 2 - i + a + L), L += a, E.forEach((m) => {
2002
+ B(m).attr(
2003
+ "transform",
2004
+ "translate( " + -b / 2 + ", " + (-1 * x / 2 + L) + ")"
2005
+ );
2006
+ const h = m == null ? void 0 : m.getBBox();
2007
+ L += ((h == null ? void 0 : h.height) ?? 0) + l;
2008
+ }), o.attr("style", t.style).attr("class", "outer title-state").attr("x", -b / 2 - i).attr("y", -(x / 2) - i).attr("width", b + t.padding).attr("height", x + t.padding), C(t, o), t.intersect = function(m) {
2009
+ return $.rect(t, m);
2010
+ }, n;
2011
+ }, "class_box"), Xt = {
2012
+ rhombus: Mt,
2013
+ composite: zr,
2014
+ question: Mt,
2015
+ rect: Br,
2016
+ labelRect: Rr,
2017
+ rectWithTitle: Ar,
2018
+ choice: _r,
2019
+ circle: Pr,
2020
+ doublecircle: Xr,
2021
+ stadium: Mr,
2022
+ hexagon: vr,
2023
+ block_arrow: Er,
2024
+ rect_left_inv_arrow: Dr,
2025
+ lean_right: Nr,
2026
+ lean_left: Tr,
2027
+ trapezoid: $r,
2028
+ inv_trapezoid: Cr,
2029
+ rect_right_inv_arrow: Ir,
2030
+ cylinder: Or,
2031
+ start: Fr,
2032
+ end: Yr,
2033
+ note: kr,
2034
+ subroutine: Wr,
2035
+ fork: Pt,
2036
+ join: Pt,
2037
+ class_box: Kr
2038
+ }, lt = {}, re = /* @__PURE__ */ g(async (e, t, s) => {
2039
+ let i, l;
2040
+ if (t.link) {
2041
+ let a;
2042
+ z().securityLevel === "sandbox" ? a = "_top" : t.linkTarget && (a = t.linkTarget || "_blank"), i = e.insert("svg:a").attr("xlink:href", t.link).attr("target", a), l = await Xt[t.shape](i, t, s);
2043
+ } else
2044
+ l = await Xt[t.shape](e, t, s), i = l;
2045
+ return t.tooltip && l.attr("title", t.tooltip), t.class && l.attr("class", "node default " + t.class), lt[t.id] = i, t.haveCallback && lt[t.id].attr("class", lt[t.id].attr("class") + " clickable"), i;
2046
+ }, "insertNode"), Hr = /* @__PURE__ */ g((e) => {
2047
+ const t = lt[e.id];
2048
+ w.trace(
2049
+ "Transforming node",
2050
+ e.diff,
2051
+ e,
2052
+ "translate(" + (e.x - e.width / 2 - 5) + ", " + e.width / 2 + ")"
2053
+ );
2054
+ const s = 8, i = e.diff || 0;
2055
+ return e.clusterNode ? t.attr(
2056
+ "transform",
2057
+ "translate(" + (e.x + i - e.width / 2) + ", " + (e.y - e.height / 2 - s) + ")"
2058
+ ) : t.attr("transform", "translate(" + e.x + ", " + e.y + ")"), i;
2059
+ }, "positionNode");
2060
+ function Dt(e, t, s = !1) {
2061
+ var i, l, a;
2062
+ const r = e;
2063
+ let n = "default";
2064
+ (((i = r == null ? void 0 : r.classes) == null ? void 0 : i.length) || 0) > 0 && (n = ((r == null ? void 0 : r.classes) ?? []).join(" ")), n = n + " flowchart-label";
2065
+ let o = 0, u = "", y;
2066
+ switch (r.type) {
2067
+ case "round":
2068
+ o = 5, u = "rect";
2069
+ break;
2070
+ case "composite":
2071
+ o = 0, u = "composite", y = 0;
2072
+ break;
2073
+ case "square":
2074
+ u = "rect";
2075
+ break;
2076
+ case "diamond":
2077
+ u = "question";
2078
+ break;
2079
+ case "hexagon":
2080
+ u = "hexagon";
2081
+ break;
2082
+ case "block_arrow":
2083
+ u = "block_arrow";
2084
+ break;
2085
+ case "odd":
2086
+ u = "rect_left_inv_arrow";
2087
+ break;
2088
+ case "lean_right":
2089
+ u = "lean_right";
2090
+ break;
2091
+ case "lean_left":
2092
+ u = "lean_left";
2093
+ break;
2094
+ case "trapezoid":
2095
+ u = "trapezoid";
2096
+ break;
2097
+ case "inv_trapezoid":
2098
+ u = "inv_trapezoid";
2099
+ break;
2100
+ case "rect_left_inv_arrow":
2101
+ u = "rect_left_inv_arrow";
2102
+ break;
2103
+ case "circle":
2104
+ u = "circle";
2105
+ break;
2106
+ case "ellipse":
2107
+ u = "ellipse";
2108
+ break;
2109
+ case "stadium":
2110
+ u = "stadium";
2111
+ break;
2112
+ case "subroutine":
2113
+ u = "subroutine";
2114
+ break;
2115
+ case "cylinder":
2116
+ u = "cylinder";
2117
+ break;
2118
+ case "group":
2119
+ u = "rect";
2120
+ break;
2121
+ case "doublecircle":
2122
+ u = "doublecircle";
2123
+ break;
2124
+ default:
2125
+ u = "rect";
2126
+ }
2127
+ const b = Le((r == null ? void 0 : r.styles) ?? []), x = r.label, S = r.size ?? { width: 0, height: 0, x: 0, y: 0 };
2128
+ return {
2129
+ labelStyle: b.labelStyle,
2130
+ shape: u,
2131
+ labelText: x,
2132
+ rx: o,
2133
+ ry: o,
2134
+ class: n,
2135
+ style: b.style,
2136
+ id: r.id,
2137
+ directions: r.directions,
2138
+ width: S.width,
2139
+ height: S.height,
2140
+ x: S.x,
2141
+ y: S.y,
2142
+ positioned: s,
2143
+ intersect: void 0,
2144
+ type: r.type,
2145
+ padding: y ?? ((a = (l = at()) == null ? void 0 : l.block) == null ? void 0 : a.padding) ?? 0
2146
+ };
2147
+ }
2148
+ g(Dt, "getNodeFromBlock");
2149
+ async function ae(e, t, s) {
2150
+ const i = Dt(t, s, !1);
2151
+ if (i.type === "group")
2152
+ return;
2153
+ const l = at(), a = await re(e, i, { config: l }), r = a.node().getBBox(), n = s.getBlock(i.id);
2154
+ n.size = { width: r.width, height: r.height, x: 0, y: 0, node: a }, s.setBlock(n), a.remove();
2155
+ }
2156
+ g(ae, "calculateBlockSize");
2157
+ async function se(e, t, s) {
2158
+ const i = Dt(t, s, !0);
2159
+ if (s.getBlock(i.id).type !== "space") {
2160
+ const l = at();
2161
+ await re(e, i, { config: l }), t.intersect = i == null ? void 0 : i.intersect, Hr(i);
2162
+ }
2163
+ }
2164
+ g(se, "insertBlockPositioned");
2165
+ async function ht(e, t, s, i) {
2166
+ for (const l of t)
2167
+ await i(e, l, s), l.children && await ht(e, l.children, s, i);
2168
+ }
2169
+ g(ht, "performOperations");
2170
+ async function ie(e, t, s) {
2171
+ await ht(e, t, s, ae);
2172
+ }
2173
+ g(ie, "calculateBlockSizes");
2174
+ async function ne(e, t, s) {
2175
+ await ht(e, t, s, se);
2176
+ }
2177
+ g(ne, "insertBlocks");
2178
+ async function le(e, t, s, i, l) {
2179
+ const a = new ke({
2180
+ multigraph: !0,
2181
+ compound: !0
2182
+ });
2183
+ a.setGraph({
2184
+ rankdir: "TB",
2185
+ nodesep: 10,
2186
+ ranksep: 10,
2187
+ marginx: 8,
2188
+ marginy: 8
2189
+ });
2190
+ for (const r of s)
2191
+ r.size && a.setNode(r.id, {
2192
+ width: r.size.width,
2193
+ height: r.size.height,
2194
+ intersect: r.intersect
2195
+ });
2196
+ for (const r of t)
2197
+ if (r.start && r.end) {
2198
+ const n = i.getBlock(r.start), o = i.getBlock(r.end);
2199
+ if (n != null && n.size && o != null && o.size) {
2200
+ const u = n.size, y = o.size, b = [
2201
+ { x: u.x, y: u.y },
2202
+ { x: u.x + (y.x - u.x) / 2, y: u.y + (y.y - u.y) / 2 },
2203
+ { x: y.x, y: y.y }
2204
+ ];
2205
+ gr(
2206
+ e,
2207
+ { v: r.start, w: r.end, name: r.id },
2208
+ {
2209
+ ...r,
2210
+ arrowTypeEnd: r.arrowTypeEnd,
2211
+ arrowTypeStart: r.arrowTypeStart,
2212
+ points: b,
2213
+ classes: "edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"
2214
+ },
2215
+ void 0,
2216
+ "block",
2217
+ a,
2218
+ l
2219
+ ), r.label && (await dr(e, {
2220
+ ...r,
2221
+ label: r.label,
2222
+ labelStyle: "stroke: #333; stroke-width: 1.5px;fill:none;",
2223
+ arrowTypeEnd: r.arrowTypeEnd,
2224
+ arrowTypeStart: r.arrowTypeStart,
2225
+ points: b,
2226
+ classes: "edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"
2227
+ }), cr(
2228
+ { ...r, x: b[1].x, y: b[1].y },
2229
+ {
2230
+ originalPath: b
2231
+ }
2232
+ ));
2233
+ }
2234
+ }
2235
+ }
2236
+ g(le, "insertEdges");
2237
+ var jr = /* @__PURE__ */ g(function(e, t) {
2238
+ return t.db.getClasses();
2239
+ }, "getClasses"), Ur = /* @__PURE__ */ g(async function(e, t, s, i) {
2240
+ const { securityLevel: l, block: a } = at(), r = i.db;
2241
+ let n;
2242
+ l === "sandbox" && (n = B("#i" + t));
2243
+ const o = l === "sandbox" ? B(n.nodes()[0].contentDocument.body) : B("body"), u = l === "sandbox" ? o.select(`[id="${t}"]`) : B(`[id="${t}"]`);
2244
+ sr(u, ["point", "circle", "cross"], i.type, t);
2245
+ const y = r.getBlocks(), b = r.getBlocksFlat(), x = r.getEdges(), S = u.insert("g").attr("class", "block");
2246
+ await ie(S, y, r);
2247
+ const L = Zt(r);
2248
+ if (await ne(S, y, r), await le(S, x, b, r, t), L) {
2249
+ const _ = L, k = Math.max(1, Math.round(0.125 * (_.width / _.height))), N = _.height + k + 10, v = _.width + 10, { useMaxWidth: D } = a;
2250
+ he(u, N, v, !!D), w.debug("Here Bounds", L, _), u.attr(
2251
+ "viewBox",
2252
+ `${_.x - 5} ${_.y - 5} ${_.width + 10} ${_.height + 10}`
2253
+ );
2254
+ }
2255
+ }, "draw"), Zr = {
2256
+ draw: Ur,
2257
+ getClasses: jr
2258
+ }, ta = {
2259
+ parser: ve,
2260
+ db: Ke,
2261
+ renderer: Zr,
2262
+ styles: je
2263
+ };
2264
+ export {
2265
+ ta as diagram
2266
+ };