@ucap-llm/ai-ui 1.1.13 → 1.1.15

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