@sinm/kai 1.8.5

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 (61) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +219 -0
  3. package/bin/kai-cli.js +21 -0
  4. package/dist-cli/kai-cli.js +218494 -0
  5. package/dist-electron/renderer/assets/_baseUniq-C3qTPmDE.js +660 -0
  6. package/dist-electron/renderer/assets/arc-BNCDL4e8.js +131 -0
  7. package/dist-electron/renderer/assets/architectureDiagram-Q4EWVU46-BdbGbDeJ.js +8718 -0
  8. package/dist-electron/renderer/assets/blockDiagram-DXYQGD6D-QiXI7ilT.js +3637 -0
  9. package/dist-electron/renderer/assets/c4Diagram-AHTNJAMY-BddxtMgY.js +2482 -0
  10. package/dist-electron/renderer/assets/channel-C_JLiB8I.js +7 -0
  11. package/dist-electron/renderer/assets/chunk-4BX2VUAB-s-dHrXuO.js +16 -0
  12. package/dist-electron/renderer/assets/chunk-4TB4RGXK-vzGbJGfp.js +1920 -0
  13. package/dist-electron/renderer/assets/chunk-55IACEB6-DS6S48ws.js +13 -0
  14. package/dist-electron/renderer/assets/chunk-EDXVE4YY-CkjF90gW.js +24 -0
  15. package/dist-electron/renderer/assets/chunk-FMBD7UC4-BXvIgVUY.js +19 -0
  16. package/dist-electron/renderer/assets/chunk-OYMX7WX6-YZbrtKSv.js +1939 -0
  17. package/dist-electron/renderer/assets/chunk-QZHKN3VN-BbLYRfB3.js +19 -0
  18. package/dist-electron/renderer/assets/chunk-YZCP3GAM-JVGt9SK_.js +116 -0
  19. package/dist-electron/renderer/assets/classDiagram-6PBFFD2Q-BwZMRjub.js +23 -0
  20. package/dist-electron/renderer/assets/classDiagram-v2-HSJHXN6E-BwZMRjub.js +23 -0
  21. package/dist-electron/renderer/assets/clone-BC-6Iyrf.js +8 -0
  22. package/dist-electron/renderer/assets/cose-bilkent-S5V4N54A-C3CGX8BH.js +4942 -0
  23. package/dist-electron/renderer/assets/cytoscape.esm-D6E6cAed.js +30246 -0
  24. package/dist-electron/renderer/assets/dagre-KV5264BT-DXOCL1ZZ.js +694 -0
  25. package/dist-electron/renderer/assets/defaultLocale-B2RvLBDe.js +206 -0
  26. package/dist-electron/renderer/assets/diagram-5BDNPKRD-B9dghm7-.js +171 -0
  27. package/dist-electron/renderer/assets/diagram-G4DWMVQ6-DDupyCeT.js +853 -0
  28. package/dist-electron/renderer/assets/diagram-MMDJMWI5-Bagr5R3p.js +303 -0
  29. package/dist-electron/renderer/assets/diagram-TYMM5635-YL5sCgeo.js +214 -0
  30. package/dist-electron/renderer/assets/erDiagram-SMLLAGMA-CHytCe4p.js +1227 -0
  31. package/dist-electron/renderer/assets/flowDiagram-DWJPFMVM-BJgPbbzi.js +2332 -0
  32. package/dist-electron/renderer/assets/ganttDiagram-T4ZO3ILL-BN-Vq0iy.js +3714 -0
  33. package/dist-electron/renderer/assets/gitGraphDiagram-UUTBAWPF-CbUpEcLb.js +1375 -0
  34. package/dist-electron/renderer/assets/graph-Di49T8Ee.js +953 -0
  35. package/dist-electron/renderer/assets/index-C55TZN9T.css +14105 -0
  36. package/dist-electron/renderer/assets/index-D-H_6heO.js +91405 -0
  37. package/dist-electron/renderer/assets/infoDiagram-42DDH7IO-BPl-rsFx.js +33 -0
  38. package/dist-electron/renderer/assets/init-ZxktEp_H.js +16 -0
  39. package/dist-electron/renderer/assets/ishikawaDiagram-UXIWVN3A-C8ly-VN_.js +967 -0
  40. package/dist-electron/renderer/assets/journeyDiagram-VCZTEJTY-nUjo5Mzy.js +1255 -0
  41. package/dist-electron/renderer/assets/kanban-definition-6JOO6SKY-DWVGGGQB.js +1052 -0
  42. package/dist-electron/renderer/assets/katex-CYis69t2.js +14301 -0
  43. package/dist-electron/renderer/assets/layout-BO15dWax.js +2217 -0
  44. package/dist-electron/renderer/assets/linear-bwcJeNAk.js +340 -0
  45. package/dist-electron/renderer/assets/min-CSnTolL5.js +41 -0
  46. package/dist-electron/renderer/assets/mindmap-definition-QFDTVHPH-WJVpu9VT.js +1186 -0
  47. package/dist-electron/renderer/assets/ordinal-CxptdPJm.js +76 -0
  48. package/dist-electron/renderer/assets/pieDiagram-DEJITSTG-DF_DZ5Q4.js +248 -0
  49. package/dist-electron/renderer/assets/quadrantDiagram-34T5L4WZ-UhXGuJcr.js +1342 -0
  50. package/dist-electron/renderer/assets/requirementDiagram-MS252O5E-BtD6ux77.js +1204 -0
  51. package/dist-electron/renderer/assets/sankeyDiagram-XADWPNL6-CC4IbM1T.js +1205 -0
  52. package/dist-electron/renderer/assets/sequenceDiagram-FGHM5R23-Da4bQBSu.js +4502 -0
  53. package/dist-electron/renderer/assets/stateDiagram-FHFEXIEX-zEkMqOXM.js +452 -0
  54. package/dist-electron/renderer/assets/stateDiagram-v2-QKLJ7IA2-DpXHvwUL.js +21 -0
  55. package/dist-electron/renderer/assets/timeline-definition-GMOUNBTQ-DJnjzEUR.js +1596 -0
  56. package/dist-electron/renderer/assets/vennDiagram-DHZGUBPP-f6WAsZFS.js +2486 -0
  57. package/dist-electron/renderer/assets/wardley-RL74JXVD-pTLEMWKj.js +24199 -0
  58. package/dist-electron/renderer/assets/wardleyDiagram-NUSXRM2D-GRV6kOg2.js +901 -0
  59. package/dist-electron/renderer/assets/xychartDiagram-5P7HB3ND-BAcUBgxf.js +1932 -0
  60. package/dist-electron/renderer/index.html +13 -0
  61. package/package.json +52 -0
@@ -0,0 +1,1920 @@
1
+ import { g as getIconStyles } from "./chunk-FMBD7UC4-BXvIgVUY.js";
2
+ import { c as createTooltip } from "./chunk-YZCP3GAM-JVGt9SK_.js";
3
+ import { g as getDiagramElement } from "./chunk-55IACEB6-DS6S48ws.js";
4
+ import { s as setupViewPortForSVG } from "./chunk-EDXVE4YY-CkjF90gW.js";
5
+ import { _ as __name, l as log, c as getConfig2, o as getRegisteredLayoutAlgorithm, r as render, u as utils_default, d as select, y as purify, b as setAccTitle, a as getAccTitle, s as setAccDescription, g as getAccDescription, p as setDiagramTitle, q as getDiagramTitle, k as common_default, z as clear, x as getEdgeId, i as sanitizeText, Q as parseGenericTypes } from "./index-D-H_6heO.js";
6
+ var parser = (function() {
7
+ var o = /* @__PURE__ */ __name(function(k, v, o2, l) {
8
+ for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v) ;
9
+ return o2;
10
+ }, "o"), $V0 = [1, 18], $V1 = [1, 19], $V2 = [1, 20], $V3 = [1, 41], $V4 = [1, 26], $V5 = [1, 42], $V6 = [1, 24], $V7 = [1, 25], $V8 = [1, 32], $V9 = [1, 33], $Va = [1, 34], $Vb = [1, 45], $Vc = [1, 35], $Vd = [1, 36], $Ve = [1, 37], $Vf = [1, 38], $Vg = [1, 27], $Vh = [1, 28], $Vi = [1, 29], $Vj = [1, 30], $Vk = [1, 31], $Vl = [1, 44], $Vm = [1, 46], $Vn = [1, 43], $Vo = [1, 47], $Vp = [1, 9], $Vq = [1, 8, 9], $Vr = [1, 58], $Vs = [1, 59], $Vt = [1, 60], $Vu = [1, 61], $Vv = [1, 62], $Vw = [1, 63], $Vx = [1, 64], $Vy = [1, 8, 9, 41], $Vz = [1, 77], $VA = [1, 8, 9, 12, 13, 22, 39, 41, 44, 46, 68, 69, 70, 71, 72, 73, 74, 79, 81], $VB = [1, 8, 9, 12, 13, 18, 20, 22, 39, 41, 44, 46, 47, 60, 68, 69, 70, 71, 72, 73, 74, 79, 81, 86, 100, 102, 103], $VC = [13, 60, 86, 100, 102, 103], $VD = [13, 60, 73, 74, 86, 100, 102, 103], $VE = [13, 60, 68, 69, 70, 71, 72, 86, 100, 102, 103], $VF = [1, 102], $VG = [1, 120], $VH = [1, 116], $VI = [1, 112], $VJ = [1, 118], $VK = [1, 113], $VL = [1, 114], $VM = [1, 115], $VN = [1, 117], $VO = [1, 119], $VP = [22, 50, 60, 61, 82, 86, 87, 88, 89, 90], $VQ = [1, 8, 9, 39, 41, 44, 46], $VR = [1, 8, 9, 22], $VS = [1, 150], $VT = [1, 8, 9, 61], $VU = [1, 8, 9, 22, 50, 60, 61, 82, 86, 87, 88, 89, 90];
11
+ var parser2 = {
12
+ trace: /* @__PURE__ */ __name(function trace() {
13
+ }, "trace"),
14
+ yy: {},
15
+ symbols_: { "error": 2, "start": 3, "mermaidDoc": 4, "statements": 5, "graphConfig": 6, "CLASS_DIAGRAM": 7, "NEWLINE": 8, "EOF": 9, "statement": 10, "classLabel": 11, "SQS": 12, "STR": 13, "SQE": 14, "namespaceName": 15, "alphaNumToken": 16, "classLiteralName": 17, "DOT": 18, "className": 19, "GENERICTYPE": 20, "relationStatement": 21, "LABEL": 22, "namespaceStatement": 23, "classStatement": 24, "memberStatement": 25, "annotationStatement": 26, "clickStatement": 27, "styleStatement": 28, "cssClassStatement": 29, "noteStatement": 30, "classDefStatement": 31, "direction": 32, "acc_title": 33, "acc_title_value": 34, "acc_descr": 35, "acc_descr_value": 36, "acc_descr_multiline_value": 37, "namespaceIdentifier": 38, "STRUCT_START": 39, "classStatements": 40, "STRUCT_STOP": 41, "NAMESPACE": 42, "classIdentifier": 43, "STYLE_SEPARATOR": 44, "members": 45, "ANNOTATION_START": 46, "ANNOTATION_END": 47, "CLASS": 48, "emptyBody": 49, "SPACE": 50, "MEMBER": 51, "SEPARATOR": 52, "relation": 53, "NOTE_FOR": 54, "noteText": 55, "NOTE": 56, "CLASSDEF": 57, "classList": 58, "stylesOpt": 59, "ALPHA": 60, "COMMA": 61, "direction_tb": 62, "direction_bt": 63, "direction_rl": 64, "direction_lr": 65, "relationType": 66, "lineType": 67, "AGGREGATION": 68, "EXTENSION": 69, "COMPOSITION": 70, "DEPENDENCY": 71, "LOLLIPOP": 72, "LINE": 73, "DOTTED_LINE": 74, "CALLBACK": 75, "LINK": 76, "LINK_TARGET": 77, "CLICK": 78, "CALLBACK_NAME": 79, "CALLBACK_ARGS": 80, "HREF": 81, "STYLE": 82, "CSSCLASS": 83, "style": 84, "styleComponent": 85, "NUM": 86, "COLON": 87, "UNIT": 88, "BRKT": 89, "PCT": 90, "commentToken": 91, "textToken": 92, "graphCodeTokens": 93, "textNoTagsToken": 94, "TAGSTART": 95, "TAGEND": 96, "==": 97, "--": 98, "DEFAULT": 99, "MINUS": 100, "keywords": 101, "UNICODE_TEXT": 102, "BQUOTE_STR": 103, "$accept": 0, "$end": 1 },
16
+ terminals_: { 2: "error", 7: "CLASS_DIAGRAM", 8: "NEWLINE", 9: "EOF", 12: "SQS", 13: "STR", 14: "SQE", 18: "DOT", 20: "GENERICTYPE", 22: "LABEL", 33: "acc_title", 34: "acc_title_value", 35: "acc_descr", 36: "acc_descr_value", 37: "acc_descr_multiline_value", 39: "STRUCT_START", 41: "STRUCT_STOP", 42: "NAMESPACE", 44: "STYLE_SEPARATOR", 46: "ANNOTATION_START", 47: "ANNOTATION_END", 48: "CLASS", 50: "SPACE", 51: "MEMBER", 52: "SEPARATOR", 54: "NOTE_FOR", 56: "NOTE", 57: "CLASSDEF", 60: "ALPHA", 61: "COMMA", 62: "direction_tb", 63: "direction_bt", 64: "direction_rl", 65: "direction_lr", 68: "AGGREGATION", 69: "EXTENSION", 70: "COMPOSITION", 71: "DEPENDENCY", 72: "LOLLIPOP", 73: "LINE", 74: "DOTTED_LINE", 75: "CALLBACK", 76: "LINK", 77: "LINK_TARGET", 78: "CLICK", 79: "CALLBACK_NAME", 80: "CALLBACK_ARGS", 81: "HREF", 82: "STYLE", 83: "CSSCLASS", 86: "NUM", 87: "COLON", 88: "UNIT", 89: "BRKT", 90: "PCT", 93: "graphCodeTokens", 95: "TAGSTART", 96: "TAGEND", 97: "==", 98: "--", 99: "DEFAULT", 100: "MINUS", 101: "keywords", 102: "UNICODE_TEXT", 103: "BQUOTE_STR" },
17
+ productions_: [0, [3, 1], [3, 1], [4, 1], [6, 4], [5, 1], [5, 2], [5, 3], [11, 3], [15, 1], [15, 1], [15, 3], [15, 2], [19, 1], [19, 3], [19, 1], [19, 2], [19, 2], [19, 2], [10, 1], [10, 2], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 2], [10, 2], [10, 1], [23, 4], [23, 5], [38, 2], [40, 1], [40, 2], [40, 3], [40, 1], [40, 2], [40, 3], [24, 1], [24, 3], [24, 4], [24, 3], [24, 6], [24, 4], [24, 7], [24, 6], [43, 2], [43, 3], [49, 0], [49, 2], [49, 2], [26, 4], [45, 1], [45, 2], [25, 1], [25, 2], [25, 1], [25, 1], [21, 3], [21, 4], [21, 4], [21, 5], [30, 3], [30, 2], [31, 3], [58, 1], [58, 3], [32, 1], [32, 1], [32, 1], [32, 1], [53, 3], [53, 2], [53, 2], [53, 1], [66, 1], [66, 1], [66, 1], [66, 1], [66, 1], [67, 1], [67, 1], [27, 3], [27, 4], [27, 3], [27, 4], [27, 4], [27, 5], [27, 3], [27, 4], [27, 4], [27, 5], [27, 4], [27, 5], [27, 5], [27, 6], [28, 3], [29, 3], [59, 1], [59, 3], [84, 1], [84, 2], [85, 1], [85, 1], [85, 1], [85, 1], [85, 1], [85, 1], [85, 1], [85, 1], [85, 1], [91, 1], [91, 1], [92, 1], [92, 1], [92, 1], [92, 1], [92, 1], [92, 1], [92, 1], [94, 1], [94, 1], [94, 1], [94, 1], [16, 1], [16, 1], [16, 1], [16, 1], [17, 1], [55, 1]],
18
+ performAction: /* @__PURE__ */ __name(function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) {
19
+ var $0 = $$.length - 1;
20
+ switch (yystate) {
21
+ case 8:
22
+ this.$ = $$[$0 - 1];
23
+ break;
24
+ case 9:
25
+ case 10:
26
+ case 13:
27
+ case 15:
28
+ this.$ = $$[$0];
29
+ break;
30
+ case 11:
31
+ case 14:
32
+ this.$ = $$[$0 - 2] + "." + $$[$0];
33
+ break;
34
+ case 12:
35
+ case 16:
36
+ this.$ = $$[$0 - 1] + $$[$0];
37
+ break;
38
+ case 17:
39
+ case 18:
40
+ this.$ = $$[$0 - 1] + "~" + $$[$0] + "~";
41
+ break;
42
+ case 19:
43
+ yy.addRelation($$[$0]);
44
+ break;
45
+ case 20:
46
+ $$[$0 - 1].title = yy.cleanupLabel($$[$0]);
47
+ yy.addRelation($$[$0 - 1]);
48
+ break;
49
+ case 31:
50
+ this.$ = $$[$0].trim();
51
+ yy.setAccTitle(this.$);
52
+ break;
53
+ case 32:
54
+ case 33:
55
+ this.$ = $$[$0].trim();
56
+ yy.setAccDescription(this.$);
57
+ break;
58
+ case 34:
59
+ yy.addClassesToNamespace($$[$0 - 3], $$[$0 - 1][0], $$[$0 - 1][1]);
60
+ break;
61
+ case 35:
62
+ yy.addClassesToNamespace($$[$0 - 4], $$[$0 - 1][0], $$[$0 - 1][1]);
63
+ break;
64
+ case 36:
65
+ this.$ = $$[$0];
66
+ yy.addNamespace($$[$0]);
67
+ break;
68
+ case 37:
69
+ this.$ = [[$$[$0]], []];
70
+ break;
71
+ case 38:
72
+ this.$ = [[$$[$0 - 1]], []];
73
+ break;
74
+ case 39:
75
+ $$[$0][0].unshift($$[$0 - 2]);
76
+ this.$ = $$[$0];
77
+ break;
78
+ case 40:
79
+ this.$ = [[], [$$[$0]]];
80
+ break;
81
+ case 41:
82
+ this.$ = [[], [$$[$0 - 1]]];
83
+ break;
84
+ case 42:
85
+ $$[$0][1].unshift($$[$0 - 2]);
86
+ this.$ = $$[$0];
87
+ break;
88
+ case 44:
89
+ yy.setCssClass($$[$0 - 2], $$[$0]);
90
+ break;
91
+ case 45:
92
+ yy.addMembers($$[$0 - 3], $$[$0 - 1]);
93
+ break;
94
+ case 47:
95
+ yy.setCssClass($$[$0 - 5], $$[$0 - 3]);
96
+ yy.addMembers($$[$0 - 5], $$[$0 - 1]);
97
+ break;
98
+ case 48:
99
+ yy.addAnnotation($$[$0 - 3], $$[$0 - 1]);
100
+ break;
101
+ case 49:
102
+ yy.addAnnotation($$[$0 - 6], $$[$0 - 4]);
103
+ yy.addMembers($$[$0 - 6], $$[$0 - 1]);
104
+ break;
105
+ case 50:
106
+ yy.addAnnotation($$[$0 - 5], $$[$0 - 3]);
107
+ break;
108
+ case 51:
109
+ this.$ = $$[$0];
110
+ yy.addClass($$[$0]);
111
+ break;
112
+ case 52:
113
+ this.$ = $$[$0 - 1];
114
+ yy.addClass($$[$0 - 1]);
115
+ yy.setClassLabel($$[$0 - 1], $$[$0]);
116
+ break;
117
+ case 56:
118
+ yy.addAnnotation($$[$0], $$[$0 - 2]);
119
+ break;
120
+ case 57:
121
+ case 70:
122
+ this.$ = [$$[$0]];
123
+ break;
124
+ case 58:
125
+ $$[$0].push($$[$0 - 1]);
126
+ this.$ = $$[$0];
127
+ break;
128
+ case 59:
129
+ break;
130
+ case 60:
131
+ yy.addMember($$[$0 - 1], yy.cleanupLabel($$[$0]));
132
+ break;
133
+ case 61:
134
+ break;
135
+ case 62:
136
+ break;
137
+ case 63:
138
+ this.$ = { "id1": $$[$0 - 2], "id2": $$[$0], relation: $$[$0 - 1], relationTitle1: "none", relationTitle2: "none" };
139
+ break;
140
+ case 64:
141
+ this.$ = { id1: $$[$0 - 3], id2: $$[$0], relation: $$[$0 - 1], relationTitle1: $$[$0 - 2], relationTitle2: "none" };
142
+ break;
143
+ case 65:
144
+ this.$ = { id1: $$[$0 - 3], id2: $$[$0], relation: $$[$0 - 2], relationTitle1: "none", relationTitle2: $$[$0 - 1] };
145
+ break;
146
+ case 66:
147
+ this.$ = { id1: $$[$0 - 4], id2: $$[$0], relation: $$[$0 - 2], relationTitle1: $$[$0 - 3], relationTitle2: $$[$0 - 1] };
148
+ break;
149
+ case 67:
150
+ this.$ = yy.addNote($$[$0], $$[$0 - 1]);
151
+ break;
152
+ case 68:
153
+ this.$ = yy.addNote($$[$0]);
154
+ break;
155
+ case 69:
156
+ this.$ = $$[$0 - 2];
157
+ yy.defineClass($$[$0 - 1], $$[$0]);
158
+ break;
159
+ case 71:
160
+ this.$ = $$[$0 - 2].concat([$$[$0]]);
161
+ break;
162
+ case 72:
163
+ yy.setDirection("TB");
164
+ break;
165
+ case 73:
166
+ yy.setDirection("BT");
167
+ break;
168
+ case 74:
169
+ yy.setDirection("RL");
170
+ break;
171
+ case 75:
172
+ yy.setDirection("LR");
173
+ break;
174
+ case 76:
175
+ this.$ = { type1: $$[$0 - 2], type2: $$[$0], lineType: $$[$0 - 1] };
176
+ break;
177
+ case 77:
178
+ this.$ = { type1: "none", type2: $$[$0], lineType: $$[$0 - 1] };
179
+ break;
180
+ case 78:
181
+ this.$ = { type1: $$[$0 - 1], type2: "none", lineType: $$[$0] };
182
+ break;
183
+ case 79:
184
+ this.$ = { type1: "none", type2: "none", lineType: $$[$0] };
185
+ break;
186
+ case 80:
187
+ this.$ = yy.relationType.AGGREGATION;
188
+ break;
189
+ case 81:
190
+ this.$ = yy.relationType.EXTENSION;
191
+ break;
192
+ case 82:
193
+ this.$ = yy.relationType.COMPOSITION;
194
+ break;
195
+ case 83:
196
+ this.$ = yy.relationType.DEPENDENCY;
197
+ break;
198
+ case 84:
199
+ this.$ = yy.relationType.LOLLIPOP;
200
+ break;
201
+ case 85:
202
+ this.$ = yy.lineType.LINE;
203
+ break;
204
+ case 86:
205
+ this.$ = yy.lineType.DOTTED_LINE;
206
+ break;
207
+ case 87:
208
+ case 93:
209
+ this.$ = $$[$0 - 2];
210
+ yy.setClickEvent($$[$0 - 1], $$[$0]);
211
+ break;
212
+ case 88:
213
+ case 94:
214
+ this.$ = $$[$0 - 3];
215
+ yy.setClickEvent($$[$0 - 2], $$[$0 - 1]);
216
+ yy.setTooltip($$[$0 - 2], $$[$0]);
217
+ break;
218
+ case 89:
219
+ this.$ = $$[$0 - 2];
220
+ yy.setLink($$[$0 - 1], $$[$0]);
221
+ break;
222
+ case 90:
223
+ this.$ = $$[$0 - 3];
224
+ yy.setLink($$[$0 - 2], $$[$0 - 1], $$[$0]);
225
+ break;
226
+ case 91:
227
+ this.$ = $$[$0 - 3];
228
+ yy.setLink($$[$0 - 2], $$[$0 - 1]);
229
+ yy.setTooltip($$[$0 - 2], $$[$0]);
230
+ break;
231
+ case 92:
232
+ this.$ = $$[$0 - 4];
233
+ yy.setLink($$[$0 - 3], $$[$0 - 2], $$[$0]);
234
+ yy.setTooltip($$[$0 - 3], $$[$0 - 1]);
235
+ break;
236
+ case 95:
237
+ this.$ = $$[$0 - 3];
238
+ yy.setClickEvent($$[$0 - 2], $$[$0 - 1], $$[$0]);
239
+ break;
240
+ case 96:
241
+ this.$ = $$[$0 - 4];
242
+ yy.setClickEvent($$[$0 - 3], $$[$0 - 2], $$[$0 - 1]);
243
+ yy.setTooltip($$[$0 - 3], $$[$0]);
244
+ break;
245
+ case 97:
246
+ this.$ = $$[$0 - 3];
247
+ yy.setLink($$[$0 - 2], $$[$0]);
248
+ break;
249
+ case 98:
250
+ this.$ = $$[$0 - 4];
251
+ yy.setLink($$[$0 - 3], $$[$0 - 1], $$[$0]);
252
+ break;
253
+ case 99:
254
+ this.$ = $$[$0 - 4];
255
+ yy.setLink($$[$0 - 3], $$[$0 - 1]);
256
+ yy.setTooltip($$[$0 - 3], $$[$0]);
257
+ break;
258
+ case 100:
259
+ this.$ = $$[$0 - 5];
260
+ yy.setLink($$[$0 - 4], $$[$0 - 2], $$[$0]);
261
+ yy.setTooltip($$[$0 - 4], $$[$0 - 1]);
262
+ break;
263
+ case 101:
264
+ this.$ = $$[$0 - 2];
265
+ yy.setCssStyle($$[$0 - 1], $$[$0]);
266
+ break;
267
+ case 102:
268
+ yy.setCssClass($$[$0 - 1], $$[$0]);
269
+ break;
270
+ case 103:
271
+ this.$ = [$$[$0]];
272
+ break;
273
+ case 104:
274
+ $$[$0 - 2].push($$[$0]);
275
+ this.$ = $$[$0 - 2];
276
+ break;
277
+ case 106:
278
+ this.$ = $$[$0 - 1] + $$[$0];
279
+ break;
280
+ }
281
+ }, "anonymous"),
282
+ table: [{ 3: 1, 4: 2, 5: 3, 6: 4, 7: [1, 6], 10: 5, 16: 39, 17: 40, 19: 21, 21: 7, 23: 8, 24: 9, 25: 10, 26: 11, 27: 12, 28: 13, 29: 14, 30: 15, 31: 16, 32: 17, 33: $V0, 35: $V1, 37: $V2, 38: 22, 42: $V3, 43: 23, 46: $V4, 48: $V5, 51: $V6, 52: $V7, 54: $V8, 56: $V9, 57: $Va, 60: $Vb, 62: $Vc, 63: $Vd, 64: $Ve, 65: $Vf, 75: $Vg, 76: $Vh, 78: $Vi, 82: $Vj, 83: $Vk, 86: $Vl, 100: $Vm, 102: $Vn, 103: $Vo }, { 1: [3] }, { 1: [2, 1] }, { 1: [2, 2] }, { 1: [2, 3] }, o($Vp, [2, 5], { 8: [1, 48] }), { 8: [1, 49] }, o($Vq, [2, 19], { 22: [1, 50] }), o($Vq, [2, 21]), o($Vq, [2, 22]), o($Vq, [2, 23]), o($Vq, [2, 24]), o($Vq, [2, 25]), o($Vq, [2, 26]), o($Vq, [2, 27]), o($Vq, [2, 28]), o($Vq, [2, 29]), o($Vq, [2, 30]), { 34: [1, 51] }, { 36: [1, 52] }, o($Vq, [2, 33]), o($Vq, [2, 59], { 53: 53, 66: 56, 67: 57, 13: [1, 54], 22: [1, 55], 68: $Vr, 69: $Vs, 70: $Vt, 71: $Vu, 72: $Vv, 73: $Vw, 74: $Vx }), { 39: [1, 65] }, o($Vy, [2, 43], { 39: [1, 67], 44: [1, 66], 46: [1, 68] }), o($Vq, [2, 61]), o($Vq, [2, 62]), { 16: 69, 60: $Vb, 86: $Vl, 100: $Vm, 102: $Vn }, { 16: 39, 17: 40, 19: 70, 60: $Vb, 86: $Vl, 100: $Vm, 102: $Vn, 103: $Vo }, { 16: 39, 17: 40, 19: 71, 60: $Vb, 86: $Vl, 100: $Vm, 102: $Vn, 103: $Vo }, { 16: 39, 17: 40, 19: 72, 60: $Vb, 86: $Vl, 100: $Vm, 102: $Vn, 103: $Vo }, { 60: [1, 73] }, { 13: [1, 74] }, { 16: 39, 17: 40, 19: 75, 60: $Vb, 86: $Vl, 100: $Vm, 102: $Vn, 103: $Vo }, { 13: $Vz, 55: 76 }, { 58: 78, 60: [1, 79] }, o($Vq, [2, 72]), o($Vq, [2, 73]), o($Vq, [2, 74]), o($Vq, [2, 75]), o($VA, [2, 13], { 16: 39, 17: 40, 19: 81, 18: [1, 80], 20: [1, 82], 60: $Vb, 86: $Vl, 100: $Vm, 102: $Vn, 103: $Vo }), o($VA, [2, 15], { 20: [1, 83] }), { 15: 84, 16: 85, 17: 86, 60: $Vb, 86: $Vl, 100: $Vm, 102: $Vn, 103: $Vo }, { 16: 39, 17: 40, 19: 87, 60: $Vb, 86: $Vl, 100: $Vm, 102: $Vn, 103: $Vo }, o($VB, [2, 129]), o($VB, [2, 130]), o($VB, [2, 131]), o($VB, [2, 132]), o([1, 8, 9, 12, 13, 20, 22, 39, 41, 44, 46, 68, 69, 70, 71, 72, 73, 74, 79, 81], [2, 133]), o($Vp, [2, 6], { 10: 5, 21: 7, 23: 8, 24: 9, 25: 10, 26: 11, 27: 12, 28: 13, 29: 14, 30: 15, 31: 16, 32: 17, 19: 21, 38: 22, 43: 23, 16: 39, 17: 40, 5: 88, 33: $V0, 35: $V1, 37: $V2, 42: $V3, 46: $V4, 48: $V5, 51: $V6, 52: $V7, 54: $V8, 56: $V9, 57: $Va, 60: $Vb, 62: $Vc, 63: $Vd, 64: $Ve, 65: $Vf, 75: $Vg, 76: $Vh, 78: $Vi, 82: $Vj, 83: $Vk, 86: $Vl, 100: $Vm, 102: $Vn, 103: $Vo }), { 5: 89, 10: 5, 16: 39, 17: 40, 19: 21, 21: 7, 23: 8, 24: 9, 25: 10, 26: 11, 27: 12, 28: 13, 29: 14, 30: 15, 31: 16, 32: 17, 33: $V0, 35: $V1, 37: $V2, 38: 22, 42: $V3, 43: 23, 46: $V4, 48: $V5, 51: $V6, 52: $V7, 54: $V8, 56: $V9, 57: $Va, 60: $Vb, 62: $Vc, 63: $Vd, 64: $Ve, 65: $Vf, 75: $Vg, 76: $Vh, 78: $Vi, 82: $Vj, 83: $Vk, 86: $Vl, 100: $Vm, 102: $Vn, 103: $Vo }, o($Vq, [2, 20]), o($Vq, [2, 31]), o($Vq, [2, 32]), { 13: [1, 91], 16: 39, 17: 40, 19: 90, 60: $Vb, 86: $Vl, 100: $Vm, 102: $Vn, 103: $Vo }, { 53: 92, 66: 56, 67: 57, 68: $Vr, 69: $Vs, 70: $Vt, 71: $Vu, 72: $Vv, 73: $Vw, 74: $Vx }, o($Vq, [2, 60]), { 67: 93, 73: $Vw, 74: $Vx }, o($VC, [2, 79], { 66: 94, 68: $Vr, 69: $Vs, 70: $Vt, 71: $Vu, 72: $Vv }), o($VD, [2, 80]), o($VD, [2, 81]), o($VD, [2, 82]), o($VD, [2, 83]), o($VD, [2, 84]), o($VE, [2, 85]), o($VE, [2, 86]), { 8: [1, 96], 24: 97, 30: 98, 40: 95, 43: 23, 48: $V5, 54: $V8, 56: $V9 }, { 16: 99, 60: $Vb, 86: $Vl, 100: $Vm, 102: $Vn }, { 41: [1, 101], 45: 100, 51: $VF }, { 16: 103, 60: $Vb, 86: $Vl, 100: $Vm, 102: $Vn }, { 47: [1, 104] }, { 13: [1, 105] }, { 13: [1, 106] }, { 79: [1, 107], 81: [1, 108] }, { 22: $VG, 50: $VH, 59: 109, 60: $VI, 82: $VJ, 84: 110, 85: 111, 86: $VK, 87: $VL, 88: $VM, 89: $VN, 90: $VO }, { 60: [1, 121] }, { 13: $Vz, 55: 122 }, o($Vy, [2, 68]), o($Vy, [2, 134]), { 22: $VG, 50: $VH, 59: 123, 60: $VI, 61: [1, 124], 82: $VJ, 84: 110, 85: 111, 86: $VK, 87: $VL, 88: $VM, 89: $VN, 90: $VO }, o($VP, [2, 70]), { 16: 39, 17: 40, 19: 125, 60: $Vb, 86: $Vl, 100: $Vm, 102: $Vn, 103: $Vo }, o($VA, [2, 16]), o($VA, [2, 17]), o($VA, [2, 18]), { 39: [2, 36] }, { 15: 127, 16: 85, 17: 86, 18: [1, 126], 39: [2, 9], 60: $Vb, 86: $Vl, 100: $Vm, 102: $Vn, 103: $Vo }, { 39: [2, 10] }, o($VQ, [2, 51], { 11: 128, 12: [1, 129] }), o($Vp, [2, 7]), { 9: [1, 130] }, o($VR, [2, 63]), { 16: 39, 17: 40, 19: 131, 60: $Vb, 86: $Vl, 100: $Vm, 102: $Vn, 103: $Vo }, { 13: [1, 133], 16: 39, 17: 40, 19: 132, 60: $Vb, 86: $Vl, 100: $Vm, 102: $Vn, 103: $Vo }, o($VC, [2, 78], { 66: 134, 68: $Vr, 69: $Vs, 70: $Vt, 71: $Vu, 72: $Vv }), o($VC, [2, 77]), { 41: [1, 135] }, { 24: 97, 30: 98, 40: 136, 43: 23, 48: $V5, 54: $V8, 56: $V9 }, { 8: [1, 137], 41: [2, 37] }, { 8: [1, 138], 41: [2, 40] }, o($Vy, [2, 44], { 39: [1, 139] }), { 41: [1, 140] }, o($Vy, [2, 46]), { 41: [2, 57], 45: 141, 51: $VF }, { 47: [1, 142] }, { 16: 39, 17: 40, 19: 143, 60: $Vb, 86: $Vl, 100: $Vm, 102: $Vn, 103: $Vo }, o($Vq, [2, 87], { 13: [1, 144] }), o($Vq, [2, 89], { 13: [1, 146], 77: [1, 145] }), o($Vq, [2, 93], { 13: [1, 147], 80: [1, 148] }), { 13: [1, 149] }, o($Vq, [2, 101], { 61: $VS }), o($VT, [2, 103], { 85: 151, 22: $VG, 50: $VH, 60: $VI, 82: $VJ, 86: $VK, 87: $VL, 88: $VM, 89: $VN, 90: $VO }), o($VU, [2, 105]), o($VU, [2, 107]), o($VU, [2, 108]), o($VU, [2, 109]), o($VU, [2, 110]), o($VU, [2, 111]), o($VU, [2, 112]), o($VU, [2, 113]), o($VU, [2, 114]), o($VU, [2, 115]), o($Vq, [2, 102]), o($Vy, [2, 67]), o($Vq, [2, 69], { 61: $VS }), { 60: [1, 152] }, o($VA, [2, 14]), { 15: 153, 16: 85, 17: 86, 60: $Vb, 86: $Vl, 100: $Vm, 102: $Vn, 103: $Vo }, { 39: [2, 12] }, o($VQ, [2, 52]), { 13: [1, 154] }, { 1: [2, 4] }, o($VR, [2, 65]), o($VR, [2, 64]), { 16: 39, 17: 40, 19: 155, 60: $Vb, 86: $Vl, 100: $Vm, 102: $Vn, 103: $Vo }, o($VC, [2, 76]), o($Vq, [2, 34]), { 41: [1, 156] }, { 24: 97, 30: 98, 40: 157, 41: [2, 38], 43: 23, 48: $V5, 54: $V8, 56: $V9 }, { 24: 97, 30: 98, 40: 158, 41: [2, 41], 43: 23, 48: $V5, 54: $V8, 56: $V9 }, { 45: 159, 51: $VF }, o($Vy, [2, 45]), { 41: [2, 58] }, o($Vy, [2, 48], { 39: [1, 160] }), o($Vq, [2, 56]), o($Vq, [2, 88]), o($Vq, [2, 90]), o($Vq, [2, 91], { 77: [1, 161] }), o($Vq, [2, 94]), o($Vq, [2, 95], { 13: [1, 162] }), o($Vq, [2, 97], { 13: [1, 164], 77: [1, 163] }), { 22: $VG, 50: $VH, 60: $VI, 82: $VJ, 84: 165, 85: 111, 86: $VK, 87: $VL, 88: $VM, 89: $VN, 90: $VO }, o($VU, [2, 106]), o($VP, [2, 71]), { 39: [2, 11] }, { 14: [1, 166] }, o($VR, [2, 66]), o($Vq, [2, 35]), { 41: [2, 39] }, { 41: [2, 42] }, { 41: [1, 167] }, { 41: [1, 169], 45: 168, 51: $VF }, o($Vq, [2, 92]), o($Vq, [2, 96]), o($Vq, [2, 98]), o($Vq, [2, 99], { 77: [1, 170] }), o($VT, [2, 104], { 85: 151, 22: $VG, 50: $VH, 60: $VI, 82: $VJ, 86: $VK, 87: $VL, 88: $VM, 89: $VN, 90: $VO }), o($VQ, [2, 8]), o($Vy, [2, 47]), { 41: [1, 171] }, o($Vy, [2, 50]), o($Vq, [2, 100]), o($Vy, [2, 49])],
283
+ defaultActions: { 2: [2, 1], 3: [2, 2], 4: [2, 3], 84: [2, 36], 86: [2, 10], 127: [2, 12], 130: [2, 4], 141: [2, 58], 153: [2, 11], 157: [2, 39], 158: [2, 42] },
284
+ parseError: /* @__PURE__ */ __name(function parseError(str, hash) {
285
+ if (hash.recoverable) {
286
+ this.trace(str);
287
+ } else {
288
+ var error = new Error(str);
289
+ error.hash = hash;
290
+ throw error;
291
+ }
292
+ }, "parseError"),
293
+ parse: /* @__PURE__ */ __name(function parse(input) {
294
+ var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, TERROR = 2, EOF = 1;
295
+ var args = lstack.slice.call(arguments, 1);
296
+ var lexer2 = Object.create(this.lexer);
297
+ var sharedState = { yy: {} };
298
+ for (var k in this.yy) {
299
+ if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
300
+ sharedState.yy[k] = this.yy[k];
301
+ }
302
+ }
303
+ lexer2.setInput(input, sharedState.yy);
304
+ sharedState.yy.lexer = lexer2;
305
+ sharedState.yy.parser = this;
306
+ if (typeof lexer2.yylloc == "undefined") {
307
+ lexer2.yylloc = {};
308
+ }
309
+ var yyloc = lexer2.yylloc;
310
+ lstack.push(yyloc);
311
+ var ranges = lexer2.options && lexer2.options.ranges;
312
+ if (typeof sharedState.yy.parseError === "function") {
313
+ this.parseError = sharedState.yy.parseError;
314
+ } else {
315
+ this.parseError = Object.getPrototypeOf(this).parseError;
316
+ }
317
+ function popStack(n) {
318
+ stack.length = stack.length - 2 * n;
319
+ vstack.length = vstack.length - n;
320
+ lstack.length = lstack.length - n;
321
+ }
322
+ __name(popStack, "popStack");
323
+ function lex() {
324
+ var token;
325
+ token = tstack.pop() || lexer2.lex() || EOF;
326
+ if (typeof token !== "number") {
327
+ if (token instanceof Array) {
328
+ tstack = token;
329
+ token = tstack.pop();
330
+ }
331
+ token = self.symbols_[token] || token;
332
+ }
333
+ return token;
334
+ }
335
+ __name(lex, "lex");
336
+ var symbol, state, action, r, yyval = {}, p, len, newState, expected;
337
+ while (true) {
338
+ state = stack[stack.length - 1];
339
+ if (this.defaultActions[state]) {
340
+ action = this.defaultActions[state];
341
+ } else {
342
+ if (symbol === null || typeof symbol == "undefined") {
343
+ symbol = lex();
344
+ }
345
+ action = table[state] && table[state][symbol];
346
+ }
347
+ if (typeof action === "undefined" || !action.length || !action[0]) {
348
+ var errStr = "";
349
+ expected = [];
350
+ for (p in table[state]) {
351
+ if (this.terminals_[p] && p > TERROR) {
352
+ expected.push("'" + this.terminals_[p] + "'");
353
+ }
354
+ }
355
+ if (lexer2.showPosition) {
356
+ errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer2.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
357
+ } else {
358
+ errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'");
359
+ }
360
+ this.parseError(errStr, {
361
+ text: lexer2.match,
362
+ token: this.terminals_[symbol] || symbol,
363
+ line: lexer2.yylineno,
364
+ loc: yyloc,
365
+ expected
366
+ });
367
+ }
368
+ if (action[0] instanceof Array && action.length > 1) {
369
+ throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
370
+ }
371
+ switch (action[0]) {
372
+ case 1:
373
+ stack.push(symbol);
374
+ vstack.push(lexer2.yytext);
375
+ lstack.push(lexer2.yylloc);
376
+ stack.push(action[1]);
377
+ symbol = null;
378
+ {
379
+ yyleng = lexer2.yyleng;
380
+ yytext = lexer2.yytext;
381
+ yylineno = lexer2.yylineno;
382
+ yyloc = lexer2.yylloc;
383
+ }
384
+ break;
385
+ case 2:
386
+ len = this.productions_[action[1]][1];
387
+ yyval.$ = vstack[vstack.length - len];
388
+ yyval._$ = {
389
+ first_line: lstack[lstack.length - (len || 1)].first_line,
390
+ last_line: lstack[lstack.length - 1].last_line,
391
+ first_column: lstack[lstack.length - (len || 1)].first_column,
392
+ last_column: lstack[lstack.length - 1].last_column
393
+ };
394
+ if (ranges) {
395
+ yyval._$.range = [
396
+ lstack[lstack.length - (len || 1)].range[0],
397
+ lstack[lstack.length - 1].range[1]
398
+ ];
399
+ }
400
+ r = this.performAction.apply(yyval, [
401
+ yytext,
402
+ yyleng,
403
+ yylineno,
404
+ sharedState.yy,
405
+ action[1],
406
+ vstack,
407
+ lstack
408
+ ].concat(args));
409
+ if (typeof r !== "undefined") {
410
+ return r;
411
+ }
412
+ if (len) {
413
+ stack = stack.slice(0, -1 * len * 2);
414
+ vstack = vstack.slice(0, -1 * len);
415
+ lstack = lstack.slice(0, -1 * len);
416
+ }
417
+ stack.push(this.productions_[action[1]][0]);
418
+ vstack.push(yyval.$);
419
+ lstack.push(yyval._$);
420
+ newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
421
+ stack.push(newState);
422
+ break;
423
+ case 3:
424
+ return true;
425
+ }
426
+ }
427
+ return true;
428
+ }, "parse")
429
+ };
430
+ var lexer = /* @__PURE__ */ (function() {
431
+ var lexer2 = {
432
+ EOF: 1,
433
+ parseError: /* @__PURE__ */ __name(function parseError(str, hash) {
434
+ if (this.yy.parser) {
435
+ this.yy.parser.parseError(str, hash);
436
+ } else {
437
+ throw new Error(str);
438
+ }
439
+ }, "parseError"),
440
+ // resets the lexer, sets new input
441
+ setInput: /* @__PURE__ */ __name(function(input, yy) {
442
+ this.yy = yy || this.yy || {};
443
+ this._input = input;
444
+ this._more = this._backtrack = this.done = false;
445
+ this.yylineno = this.yyleng = 0;
446
+ this.yytext = this.matched = this.match = "";
447
+ this.conditionStack = ["INITIAL"];
448
+ this.yylloc = {
449
+ first_line: 1,
450
+ first_column: 0,
451
+ last_line: 1,
452
+ last_column: 0
453
+ };
454
+ if (this.options.ranges) {
455
+ this.yylloc.range = [0, 0];
456
+ }
457
+ this.offset = 0;
458
+ return this;
459
+ }, "setInput"),
460
+ // consumes and returns one char from the input
461
+ input: /* @__PURE__ */ __name(function() {
462
+ var ch = this._input[0];
463
+ this.yytext += ch;
464
+ this.yyleng++;
465
+ this.offset++;
466
+ this.match += ch;
467
+ this.matched += ch;
468
+ var lines = ch.match(/(?:\r\n?|\n).*/g);
469
+ if (lines) {
470
+ this.yylineno++;
471
+ this.yylloc.last_line++;
472
+ } else {
473
+ this.yylloc.last_column++;
474
+ }
475
+ if (this.options.ranges) {
476
+ this.yylloc.range[1]++;
477
+ }
478
+ this._input = this._input.slice(1);
479
+ return ch;
480
+ }, "input"),
481
+ // unshifts one char (or a string) into the input
482
+ unput: /* @__PURE__ */ __name(function(ch) {
483
+ var len = ch.length;
484
+ var lines = ch.split(/(?:\r\n?|\n)/g);
485
+ this._input = ch + this._input;
486
+ this.yytext = this.yytext.substr(0, this.yytext.length - len);
487
+ this.offset -= len;
488
+ var oldLines = this.match.split(/(?:\r\n?|\n)/g);
489
+ this.match = this.match.substr(0, this.match.length - 1);
490
+ this.matched = this.matched.substr(0, this.matched.length - 1);
491
+ if (lines.length - 1) {
492
+ this.yylineno -= lines.length - 1;
493
+ }
494
+ var r = this.yylloc.range;
495
+ this.yylloc = {
496
+ first_line: this.yylloc.first_line,
497
+ last_line: this.yylineno + 1,
498
+ first_column: this.yylloc.first_column,
499
+ last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len
500
+ };
501
+ if (this.options.ranges) {
502
+ this.yylloc.range = [r[0], r[0] + this.yyleng - len];
503
+ }
504
+ this.yyleng = this.yytext.length;
505
+ return this;
506
+ }, "unput"),
507
+ // When called from action, caches matched text and appends it on next action
508
+ more: /* @__PURE__ */ __name(function() {
509
+ this._more = true;
510
+ return this;
511
+ }, "more"),
512
+ // 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.
513
+ reject: /* @__PURE__ */ __name(function() {
514
+ if (this.options.backtrack_lexer) {
515
+ this._backtrack = true;
516
+ } else {
517
+ return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + this.showPosition(), {
518
+ text: "",
519
+ token: null,
520
+ line: this.yylineno
521
+ });
522
+ }
523
+ return this;
524
+ }, "reject"),
525
+ // retain first n characters of the match
526
+ less: /* @__PURE__ */ __name(function(n) {
527
+ this.unput(this.match.slice(n));
528
+ }, "less"),
529
+ // displays already matched input, i.e. for error messages
530
+ pastInput: /* @__PURE__ */ __name(function() {
531
+ var past = this.matched.substr(0, this.matched.length - this.match.length);
532
+ return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, "");
533
+ }, "pastInput"),
534
+ // displays upcoming input, i.e. for error messages
535
+ upcomingInput: /* @__PURE__ */ __name(function() {
536
+ var next = this.match;
537
+ if (next.length < 20) {
538
+ next += this._input.substr(0, 20 - next.length);
539
+ }
540
+ return (next.substr(0, 20) + (next.length > 20 ? "..." : "")).replace(/\n/g, "");
541
+ }, "upcomingInput"),
542
+ // displays the character position where the lexing error occurred, i.e. for error messages
543
+ showPosition: /* @__PURE__ */ __name(function() {
544
+ var pre = this.pastInput();
545
+ var c = new Array(pre.length + 1).join("-");
546
+ return pre + this.upcomingInput() + "\n" + c + "^";
547
+ }, "showPosition"),
548
+ // test the lexed token: return FALSE when not a match, otherwise return token
549
+ test_match: /* @__PURE__ */ __name(function(match, indexed_rule) {
550
+ var token, lines, backup;
551
+ if (this.options.backtrack_lexer) {
552
+ backup = {
553
+ yylineno: this.yylineno,
554
+ yylloc: {
555
+ first_line: this.yylloc.first_line,
556
+ last_line: this.last_line,
557
+ first_column: this.yylloc.first_column,
558
+ last_column: this.yylloc.last_column
559
+ },
560
+ yytext: this.yytext,
561
+ match: this.match,
562
+ matches: this.matches,
563
+ matched: this.matched,
564
+ yyleng: this.yyleng,
565
+ offset: this.offset,
566
+ _more: this._more,
567
+ _input: this._input,
568
+ yy: this.yy,
569
+ conditionStack: this.conditionStack.slice(0),
570
+ done: this.done
571
+ };
572
+ if (this.options.ranges) {
573
+ backup.yylloc.range = this.yylloc.range.slice(0);
574
+ }
575
+ }
576
+ lines = match[0].match(/(?:\r\n?|\n).*/g);
577
+ if (lines) {
578
+ this.yylineno += lines.length;
579
+ }
580
+ this.yylloc = {
581
+ first_line: this.yylloc.last_line,
582
+ last_line: this.yylineno + 1,
583
+ first_column: this.yylloc.last_column,
584
+ last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length
585
+ };
586
+ this.yytext += match[0];
587
+ this.match += match[0];
588
+ this.matches = match;
589
+ this.yyleng = this.yytext.length;
590
+ if (this.options.ranges) {
591
+ this.yylloc.range = [this.offset, this.offset += this.yyleng];
592
+ }
593
+ this._more = false;
594
+ this._backtrack = false;
595
+ this._input = this._input.slice(match[0].length);
596
+ this.matched += match[0];
597
+ token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
598
+ if (this.done && this._input) {
599
+ this.done = false;
600
+ }
601
+ if (token) {
602
+ return token;
603
+ } else if (this._backtrack) {
604
+ for (var k in backup) {
605
+ this[k] = backup[k];
606
+ }
607
+ return false;
608
+ }
609
+ return false;
610
+ }, "test_match"),
611
+ // return next match in input
612
+ next: /* @__PURE__ */ __name(function() {
613
+ if (this.done) {
614
+ return this.EOF;
615
+ }
616
+ if (!this._input) {
617
+ this.done = true;
618
+ }
619
+ var token, match, tempMatch, index;
620
+ if (!this._more) {
621
+ this.yytext = "";
622
+ this.match = "";
623
+ }
624
+ var rules = this._currentRules();
625
+ for (var i = 0; i < rules.length; i++) {
626
+ tempMatch = this._input.match(this.rules[rules[i]]);
627
+ if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
628
+ match = tempMatch;
629
+ index = i;
630
+ if (this.options.backtrack_lexer) {
631
+ token = this.test_match(tempMatch, rules[i]);
632
+ if (token !== false) {
633
+ return token;
634
+ } else if (this._backtrack) {
635
+ match = false;
636
+ continue;
637
+ } else {
638
+ return false;
639
+ }
640
+ } else if (!this.options.flex) {
641
+ break;
642
+ }
643
+ }
644
+ }
645
+ if (match) {
646
+ token = this.test_match(match, rules[index]);
647
+ if (token !== false) {
648
+ return token;
649
+ }
650
+ return false;
651
+ }
652
+ if (this._input === "") {
653
+ return this.EOF;
654
+ } else {
655
+ return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), {
656
+ text: "",
657
+ token: null,
658
+ line: this.yylineno
659
+ });
660
+ }
661
+ }, "next"),
662
+ // return next match that has a token
663
+ lex: /* @__PURE__ */ __name(function lex() {
664
+ var r = this.next();
665
+ if (r) {
666
+ return r;
667
+ } else {
668
+ return this.lex();
669
+ }
670
+ }, "lex"),
671
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
672
+ begin: /* @__PURE__ */ __name(function begin(condition) {
673
+ this.conditionStack.push(condition);
674
+ }, "begin"),
675
+ // pop the previously active lexer condition state off the condition stack
676
+ popState: /* @__PURE__ */ __name(function popState() {
677
+ var n = this.conditionStack.length - 1;
678
+ if (n > 0) {
679
+ return this.conditionStack.pop();
680
+ } else {
681
+ return this.conditionStack[0];
682
+ }
683
+ }, "popState"),
684
+ // produce the lexer rule set which is active for the currently active lexer condition state
685
+ _currentRules: /* @__PURE__ */ __name(function _currentRules() {
686
+ if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
687
+ return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
688
+ } else {
689
+ return this.conditions["INITIAL"].rules;
690
+ }
691
+ }, "_currentRules"),
692
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
693
+ topState: /* @__PURE__ */ __name(function topState(n) {
694
+ n = this.conditionStack.length - 1 - Math.abs(n || 0);
695
+ if (n >= 0) {
696
+ return this.conditionStack[n];
697
+ } else {
698
+ return "INITIAL";
699
+ }
700
+ }, "topState"),
701
+ // alias for begin(condition)
702
+ pushState: /* @__PURE__ */ __name(function pushState(condition) {
703
+ this.begin(condition);
704
+ }, "pushState"),
705
+ // return the number of states currently on the stack
706
+ stateStackSize: /* @__PURE__ */ __name(function stateStackSize() {
707
+ return this.conditionStack.length;
708
+ }, "stateStackSize"),
709
+ options: {},
710
+ performAction: /* @__PURE__ */ __name(function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
711
+ switch ($avoiding_name_collisions) {
712
+ case 0:
713
+ return 62;
714
+ case 1:
715
+ return 63;
716
+ case 2:
717
+ return 64;
718
+ case 3:
719
+ return 65;
720
+ case 4:
721
+ break;
722
+ case 5:
723
+ break;
724
+ case 6:
725
+ this.begin("acc_title");
726
+ return 33;
727
+ case 7:
728
+ this.popState();
729
+ return "acc_title_value";
730
+ case 8:
731
+ this.begin("acc_descr");
732
+ return 35;
733
+ case 9:
734
+ this.popState();
735
+ return "acc_descr_value";
736
+ case 10:
737
+ this.begin("acc_descr_multiline");
738
+ break;
739
+ case 11:
740
+ this.popState();
741
+ break;
742
+ case 12:
743
+ return "acc_descr_multiline_value";
744
+ case 13:
745
+ return 8;
746
+ case 14:
747
+ break;
748
+ case 15:
749
+ return 7;
750
+ case 16:
751
+ return 7;
752
+ case 17:
753
+ return "EDGE_STATE";
754
+ case 18:
755
+ this.begin("callback_name");
756
+ break;
757
+ case 19:
758
+ this.popState();
759
+ break;
760
+ case 20:
761
+ this.popState();
762
+ this.begin("callback_args");
763
+ break;
764
+ case 21:
765
+ return 79;
766
+ case 22:
767
+ this.popState();
768
+ break;
769
+ case 23:
770
+ return 80;
771
+ case 24:
772
+ this.popState();
773
+ break;
774
+ case 25:
775
+ return "STR";
776
+ case 26:
777
+ this.begin("string");
778
+ break;
779
+ case 27:
780
+ return 82;
781
+ case 28:
782
+ return 57;
783
+ case 29:
784
+ this.begin("namespace");
785
+ return 42;
786
+ case 30:
787
+ this.popState();
788
+ return 8;
789
+ case 31:
790
+ break;
791
+ case 32:
792
+ this.begin("namespace-body");
793
+ return 39;
794
+ case 33:
795
+ this.popState();
796
+ return 41;
797
+ case 34:
798
+ return "EOF_IN_STRUCT";
799
+ case 35:
800
+ return 8;
801
+ case 36:
802
+ break;
803
+ case 37:
804
+ return "EDGE_STATE";
805
+ case 38:
806
+ this.begin("class");
807
+ return 48;
808
+ case 39:
809
+ this.popState();
810
+ return 8;
811
+ case 40:
812
+ break;
813
+ case 41:
814
+ this.popState();
815
+ this.popState();
816
+ return 41;
817
+ case 42:
818
+ this.begin("class-body");
819
+ return 39;
820
+ case 43:
821
+ this.popState();
822
+ return 41;
823
+ case 44:
824
+ return "EOF_IN_STRUCT";
825
+ case 45:
826
+ return "EDGE_STATE";
827
+ case 46:
828
+ return "OPEN_IN_STRUCT";
829
+ case 47:
830
+ break;
831
+ case 48:
832
+ return "MEMBER";
833
+ case 49:
834
+ return 83;
835
+ case 50:
836
+ return 75;
837
+ case 51:
838
+ return 76;
839
+ case 52:
840
+ return 78;
841
+ case 53:
842
+ return 54;
843
+ case 54:
844
+ return 56;
845
+ case 55:
846
+ return 46;
847
+ case 56:
848
+ return 47;
849
+ case 57:
850
+ return 81;
851
+ case 58:
852
+ this.popState();
853
+ break;
854
+ case 59:
855
+ return "GENERICTYPE";
856
+ case 60:
857
+ this.begin("generic");
858
+ break;
859
+ case 61:
860
+ this.popState();
861
+ break;
862
+ case 62:
863
+ return "BQUOTE_STR";
864
+ case 63:
865
+ this.begin("bqstring");
866
+ break;
867
+ case 64:
868
+ return 77;
869
+ case 65:
870
+ return 77;
871
+ case 66:
872
+ return 77;
873
+ case 67:
874
+ return 77;
875
+ case 68:
876
+ return 69;
877
+ case 69:
878
+ return 69;
879
+ case 70:
880
+ return 71;
881
+ case 71:
882
+ return 71;
883
+ case 72:
884
+ return 70;
885
+ case 73:
886
+ return 68;
887
+ case 74:
888
+ return 72;
889
+ case 75:
890
+ return 73;
891
+ case 76:
892
+ return 74;
893
+ case 77:
894
+ return 22;
895
+ case 78:
896
+ return 44;
897
+ case 79:
898
+ return 100;
899
+ case 80:
900
+ return 18;
901
+ case 81:
902
+ return "PLUS";
903
+ case 82:
904
+ return 87;
905
+ case 83:
906
+ return 61;
907
+ case 84:
908
+ return 89;
909
+ case 85:
910
+ return 89;
911
+ case 86:
912
+ return 90;
913
+ case 87:
914
+ return "EQUALS";
915
+ case 88:
916
+ return "EQUALS";
917
+ case 89:
918
+ return 60;
919
+ case 90:
920
+ return 12;
921
+ case 91:
922
+ return 14;
923
+ case 92:
924
+ return "PUNCTUATION";
925
+ case 93:
926
+ return 86;
927
+ case 94:
928
+ return 102;
929
+ case 95:
930
+ return 50;
931
+ case 96:
932
+ return 50;
933
+ case 97:
934
+ return 9;
935
+ }
936
+ }, "anonymous"),
937
+ rules: [/^(?:.*direction\s+TB[^\n]*)/, /^(?:.*direction\s+BT[^\n]*)/, /^(?:.*direction\s+RL[^\n]*)/, /^(?:.*direction\s+LR[^\n]*)/, /^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/, /^(?:%%[^\n]*(\r?\n)*)/, /^(?:accTitle\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*\{\s*)/, /^(?:[\}])/, /^(?:[^\}]*)/, /^(?:\s*(\r?\n)+)/, /^(?:\s+)/, /^(?:classDiagram-v2\b)/, /^(?:classDiagram\b)/, /^(?:\[\*\])/, /^(?:call[\s]+)/, /^(?:\([\s]*\))/, /^(?:\()/, /^(?:[^(]*)/, /^(?:\))/, /^(?:[^)]*)/, /^(?:["])/, /^(?:[^"]*)/, /^(?:["])/, /^(?:style\b)/, /^(?:classDef\b)/, /^(?:namespace\b)/, /^(?:\s*(\r?\n)+)/, /^(?:\s+)/, /^(?:[{])/, /^(?:[}])/, /^(?:$)/, /^(?:\s*(\r?\n)+)/, /^(?:\s+)/, /^(?:\[\*\])/, /^(?:class\b)/, /^(?:\s*(\r?\n)+)/, /^(?:\s+)/, /^(?:[}])/, /^(?:[{])/, /^(?:[}])/, /^(?:$)/, /^(?:\[\*\])/, /^(?:[{])/, /^(?:[\n])/, /^(?:[^{}\n]*)/, /^(?:cssClass\b)/, /^(?:callback\b)/, /^(?:link\b)/, /^(?:click\b)/, /^(?:note for\b)/, /^(?:note\b)/, /^(?:<<)/, /^(?:>>)/, /^(?:href\b)/, /^(?:[~])/, /^(?:[^~]*)/, /^(?:~)/, /^(?:[`])/, /^(?:[^`]+)/, /^(?:[`])/, /^(?:_self\b)/, /^(?:_blank\b)/, /^(?:_parent\b)/, /^(?:_top\b)/, /^(?:\s*<\|)/, /^(?:\s*\|>)/, /^(?:\s*>)/, /^(?:\s*<)/, /^(?:\s*\*)/, /^(?:\s*o\b)/, /^(?:\s*\(\))/, /^(?:--)/, /^(?:\.\.)/, /^(?::{1}[^:\n;]+)/, /^(?::{3})/, /^(?:-)/, /^(?:\.)/, /^(?:\+)/, /^(?::)/, /^(?:,)/, /^(?:#)/, /^(?:#)/, /^(?:%)/, /^(?:=)/, /^(?:=)/, /^(?:\w+)/, /^(?:\[)/, /^(?:\])/, /^(?:[!"#$%&'*+,-.`?\\/])/, /^(?:[0-9]+)/, /^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/, /^(?:\s)/, /^(?:\s)/, /^(?:$)/],
938
+ conditions: { "namespace-body": { "rules": [26, 33, 34, 35, 36, 37, 38, 49, 50, 51, 52, 53, 54, 55, 56, 57, 60, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 97], "inclusive": false }, "namespace": { "rules": [26, 29, 30, 31, 32, 49, 50, 51, 52, 53, 54, 55, 56, 57, 60, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 97], "inclusive": false }, "class-body": { "rules": [26, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 60, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 97], "inclusive": false }, "class": { "rules": [26, 39, 40, 41, 42, 49, 50, 51, 52, 53, 54, 55, 56, 57, 60, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 97], "inclusive": false }, "acc_descr_multiline": { "rules": [11, 12, 26, 49, 50, 51, 52, 53, 54, 55, 56, 57, 60, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 97], "inclusive": false }, "acc_descr": { "rules": [9, 26, 49, 50, 51, 52, 53, 54, 55, 56, 57, 60, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 97], "inclusive": false }, "acc_title": { "rules": [7, 26, 49, 50, 51, 52, 53, 54, 55, 56, 57, 60, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 97], "inclusive": false }, "callback_args": { "rules": [22, 23, 26, 49, 50, 51, 52, 53, 54, 55, 56, 57, 60, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 97], "inclusive": false }, "callback_name": { "rules": [19, 20, 21, 26, 49, 50, 51, 52, 53, 54, 55, 56, 57, 60, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 97], "inclusive": false }, "href": { "rules": [26, 49, 50, 51, 52, 53, 54, 55, 56, 57, 60, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 97], "inclusive": false }, "struct": { "rules": [26, 49, 50, 51, 52, 53, 54, 55, 56, 57, 60, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 97], "inclusive": false }, "generic": { "rules": [26, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 97], "inclusive": false }, "bqstring": { "rules": [26, 49, 50, 51, 52, 53, 54, 55, 56, 57, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 97], "inclusive": false }, "string": { "rules": [24, 25, 26, 49, 50, 51, 52, 53, 54, 55, 56, 57, 60, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 97], "inclusive": false }, "INITIAL": { "rules": [0, 1, 2, 3, 4, 5, 6, 8, 10, 13, 14, 15, 16, 17, 18, 26, 27, 28, 29, 38, 49, 50, 51, 52, 53, 54, 55, 56, 57, 60, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97], "inclusive": true } }
939
+ };
940
+ return lexer2;
941
+ })();
942
+ parser2.lexer = lexer;
943
+ function Parser() {
944
+ this.yy = {};
945
+ }
946
+ __name(Parser, "Parser");
947
+ Parser.prototype = parser2;
948
+ parser2.Parser = Parser;
949
+ return new Parser();
950
+ })();
951
+ parser.parser = parser;
952
+ var classDiagram_default = parser;
953
+ var visibilityValues = ["#", "+", "~", "-", ""];
954
+ var ClassMember = class {
955
+ static {
956
+ __name(this, "ClassMember");
957
+ }
958
+ constructor(input, memberType) {
959
+ this.memberType = memberType;
960
+ this.visibility = "";
961
+ this.classifier = "";
962
+ this.text = "";
963
+ const sanitizedInput = sanitizeText(input, getConfig2());
964
+ this.parseMember(sanitizedInput);
965
+ }
966
+ getDisplayDetails() {
967
+ let displayText = this.visibility + parseGenericTypes(this.id);
968
+ if (this.memberType === "method") {
969
+ displayText += `(${parseGenericTypes(this.parameters.trim())})`;
970
+ if (this.returnType) {
971
+ displayText += " : " + parseGenericTypes(this.returnType);
972
+ }
973
+ }
974
+ displayText = displayText.trim();
975
+ const cssStyle = this.parseClassifier();
976
+ return {
977
+ displayText,
978
+ cssStyle
979
+ };
980
+ }
981
+ parseMember(input) {
982
+ let potentialClassifier = "";
983
+ if (this.memberType === "method") {
984
+ const methodRegEx = /([#+~-])?(.+)\((.*)\)([\s$*])?(.*)([$*])?/;
985
+ const match = methodRegEx.exec(input);
986
+ if (match) {
987
+ const detectedVisibility = match[1] ? match[1].trim() : "";
988
+ if (visibilityValues.includes(detectedVisibility)) {
989
+ this.visibility = detectedVisibility;
990
+ }
991
+ this.id = match[2];
992
+ this.parameters = match[3] ? match[3].trim() : "";
993
+ potentialClassifier = match[4] ? match[4].trim() : "";
994
+ this.returnType = match[5] ? match[5].trim() : "";
995
+ if (potentialClassifier === "") {
996
+ const lastChar = this.returnType.substring(this.returnType.length - 1);
997
+ if (/[$*]/.exec(lastChar)) {
998
+ potentialClassifier = lastChar;
999
+ this.returnType = this.returnType.substring(0, this.returnType.length - 1);
1000
+ }
1001
+ }
1002
+ }
1003
+ } else {
1004
+ const length = input.length;
1005
+ const firstChar = input.substring(0, 1);
1006
+ const lastChar = input.substring(length - 1);
1007
+ if (visibilityValues.includes(firstChar)) {
1008
+ this.visibility = firstChar;
1009
+ }
1010
+ if (/[$*]/.exec(lastChar)) {
1011
+ potentialClassifier = lastChar;
1012
+ }
1013
+ this.id = input.substring(
1014
+ this.visibility === "" ? 0 : 1,
1015
+ potentialClassifier === "" ? length : length - 1
1016
+ );
1017
+ }
1018
+ this.classifier = potentialClassifier;
1019
+ this.id = this.id.startsWith(" ") ? " " + this.id.trim() : this.id.trim();
1020
+ const combinedText = `${this.visibility ? "\\" + this.visibility : ""}${parseGenericTypes(this.id)}${this.memberType === "method" ? `(${parseGenericTypes(this.parameters)})${this.returnType ? " : " + parseGenericTypes(this.returnType) : ""}` : ""}`;
1021
+ this.text = combinedText.replaceAll("<", "&lt;").replaceAll(">", "&gt;");
1022
+ if (this.text.startsWith("\\&lt;")) {
1023
+ this.text = this.text.replace("\\&lt;", "~");
1024
+ }
1025
+ }
1026
+ parseClassifier() {
1027
+ switch (this.classifier) {
1028
+ case "*":
1029
+ return "font-style:italic;";
1030
+ case "$":
1031
+ return "text-decoration:underline;";
1032
+ default:
1033
+ return "";
1034
+ }
1035
+ }
1036
+ };
1037
+ var MERMAID_DOM_ID_PREFIX = "classId-";
1038
+ var classCounter = 0;
1039
+ var sanitizeText2 = /* @__PURE__ */ __name((txt) => common_default.sanitizeText(txt, getConfig2()), "sanitizeText");
1040
+ var ClassDB = class {
1041
+ constructor() {
1042
+ this.relations = [];
1043
+ this.classes = /* @__PURE__ */ new Map();
1044
+ this.styleClasses = /* @__PURE__ */ new Map();
1045
+ this.notes = /* @__PURE__ */ new Map();
1046
+ this.interfaces = [];
1047
+ this.namespaces = /* @__PURE__ */ new Map();
1048
+ this.namespaceCounter = 0;
1049
+ this.diagramId = "";
1050
+ this.functions = [];
1051
+ this.lineType = {
1052
+ LINE: 0,
1053
+ DOTTED_LINE: 1
1054
+ };
1055
+ this.relationType = {
1056
+ AGGREGATION: 0,
1057
+ EXTENSION: 1,
1058
+ COMPOSITION: 2,
1059
+ DEPENDENCY: 3,
1060
+ LOLLIPOP: 4
1061
+ };
1062
+ this.setupToolTips = /* @__PURE__ */ __name((element) => {
1063
+ const tooltipElem = createTooltip();
1064
+ const svg = select(element).select("svg");
1065
+ const nodes = svg.selectAll("g").filter(function() {
1066
+ return select(this).attr("title") !== null;
1067
+ });
1068
+ nodes.on("mouseover", (event) => {
1069
+ const el = select(event.currentTarget);
1070
+ const title = el.attr("title");
1071
+ if (!title) {
1072
+ return;
1073
+ }
1074
+ const rect = event.currentTarget.getBoundingClientRect();
1075
+ tooltipElem.transition().duration(200).style("opacity", ".9");
1076
+ tooltipElem.html(purify.sanitize(title)).style("left", `${window.scrollX + rect.left + rect.width / 2}px`).style("top", `${window.scrollY + rect.bottom + 4}px`);
1077
+ el.classed("hover", true);
1078
+ }).on("mouseout", (event) => {
1079
+ tooltipElem.transition().duration(500).style("opacity", 0);
1080
+ select(event.currentTarget).classed("hover", false);
1081
+ });
1082
+ }, "setupToolTips");
1083
+ this.direction = "TB";
1084
+ this.setAccTitle = setAccTitle;
1085
+ this.getAccTitle = getAccTitle;
1086
+ this.setAccDescription = setAccDescription;
1087
+ this.getAccDescription = getAccDescription;
1088
+ this.setDiagramTitle = setDiagramTitle;
1089
+ this.getDiagramTitle = getDiagramTitle;
1090
+ this.getConfig = /* @__PURE__ */ __name(() => getConfig2().class, "getConfig");
1091
+ this.functions.push(this.setupToolTips.bind(this));
1092
+ this.clear();
1093
+ this.addRelation = this.addRelation.bind(this);
1094
+ this.addClassesToNamespace = this.addClassesToNamespace.bind(this);
1095
+ this.addNamespace = this.addNamespace.bind(this);
1096
+ this.setCssClass = this.setCssClass.bind(this);
1097
+ this.addMembers = this.addMembers.bind(this);
1098
+ this.addClass = this.addClass.bind(this);
1099
+ this.setClassLabel = this.setClassLabel.bind(this);
1100
+ this.addAnnotation = this.addAnnotation.bind(this);
1101
+ this.addMember = this.addMember.bind(this);
1102
+ this.cleanupLabel = this.cleanupLabel.bind(this);
1103
+ this.addNote = this.addNote.bind(this);
1104
+ this.defineClass = this.defineClass.bind(this);
1105
+ this.setDirection = this.setDirection.bind(this);
1106
+ this.setLink = this.setLink.bind(this);
1107
+ this.bindFunctions = this.bindFunctions.bind(this);
1108
+ this.clear = this.clear.bind(this);
1109
+ this.setTooltip = this.setTooltip.bind(this);
1110
+ this.setClickEvent = this.setClickEvent.bind(this);
1111
+ this.setCssStyle = this.setCssStyle.bind(this);
1112
+ }
1113
+ static {
1114
+ __name(this, "ClassDB");
1115
+ }
1116
+ splitClassNameAndType(_id) {
1117
+ const id = common_default.sanitizeText(_id, getConfig2());
1118
+ let genericType = "";
1119
+ let className = id;
1120
+ if (id.indexOf("~") > 0) {
1121
+ const split = id.split("~");
1122
+ className = sanitizeText2(split[0]);
1123
+ genericType = sanitizeText2(split[1]);
1124
+ }
1125
+ return { className, type: genericType };
1126
+ }
1127
+ setClassLabel(_id, label) {
1128
+ const id = common_default.sanitizeText(_id, getConfig2());
1129
+ if (label) {
1130
+ label = sanitizeText2(label);
1131
+ }
1132
+ const { className } = this.splitClassNameAndType(id);
1133
+ this.classes.get(className).label = label;
1134
+ this.classes.get(className).text = `${label}${this.classes.get(className).type ? `<${this.classes.get(className).type}>` : ""}`;
1135
+ }
1136
+ /**
1137
+ * Function called by parser when a node definition has been found.
1138
+ *
1139
+ * @param id - ID of the class to add
1140
+ * @public
1141
+ */
1142
+ addClass(_id) {
1143
+ const id = common_default.sanitizeText(_id, getConfig2());
1144
+ const { className, type } = this.splitClassNameAndType(id);
1145
+ if (this.classes.has(className)) {
1146
+ return;
1147
+ }
1148
+ const name = common_default.sanitizeText(className, getConfig2());
1149
+ this.classes.set(name, {
1150
+ id: name,
1151
+ type,
1152
+ label: name,
1153
+ text: `${name}${type ? `&lt;${type}&gt;` : ""}`,
1154
+ shape: "classBox",
1155
+ cssClasses: "default",
1156
+ methods: [],
1157
+ members: [],
1158
+ annotations: [],
1159
+ styles: [],
1160
+ domId: MERMAID_DOM_ID_PREFIX + name + "-" + classCounter
1161
+ });
1162
+ classCounter++;
1163
+ }
1164
+ addInterface(label, classId) {
1165
+ const classInterface = {
1166
+ id: `interface${this.interfaces.length}`,
1167
+ label,
1168
+ classId
1169
+ };
1170
+ this.interfaces.push(classInterface);
1171
+ }
1172
+ /**
1173
+ * Sets the diagram's SVG element ID, used to prefix domIds for uniqueness
1174
+ * across multiple diagrams on the same page.
1175
+ */
1176
+ setDiagramId(svgElementId) {
1177
+ this.diagramId = svgElementId;
1178
+ }
1179
+ /**
1180
+ * Function to lookup domId from id in the graph definition.
1181
+ * When diagramId is set, returns the prefixed version for DOM uniqueness.
1182
+ *
1183
+ * @param id - class ID to lookup
1184
+ * @public
1185
+ */
1186
+ lookUpDomId(_id) {
1187
+ const id = common_default.sanitizeText(_id, getConfig2());
1188
+ if (this.classes.has(id)) {
1189
+ const domId = this.classes.get(id).domId;
1190
+ return this.diagramId ? `${this.diagramId}-${domId}` : domId;
1191
+ }
1192
+ throw new Error("Class not found: " + id);
1193
+ }
1194
+ clear() {
1195
+ this.relations = [];
1196
+ this.classes = /* @__PURE__ */ new Map();
1197
+ this.notes = /* @__PURE__ */ new Map();
1198
+ this.interfaces = [];
1199
+ this.functions = [];
1200
+ this.functions.push(this.setupToolTips.bind(this));
1201
+ this.namespaces = /* @__PURE__ */ new Map();
1202
+ this.namespaceCounter = 0;
1203
+ this.diagramId = "";
1204
+ this.direction = "TB";
1205
+ clear();
1206
+ }
1207
+ getClass(id) {
1208
+ return this.classes.get(id);
1209
+ }
1210
+ getClasses() {
1211
+ return this.classes;
1212
+ }
1213
+ getRelations() {
1214
+ return this.relations;
1215
+ }
1216
+ getNote(id) {
1217
+ const key = typeof id === "number" ? `note${id}` : id;
1218
+ return this.notes.get(key);
1219
+ }
1220
+ getNotes() {
1221
+ return this.notes;
1222
+ }
1223
+ addRelation(classRelation) {
1224
+ log.debug("Adding relation: " + JSON.stringify(classRelation));
1225
+ const invalidTypes = [
1226
+ this.relationType.LOLLIPOP,
1227
+ this.relationType.AGGREGATION,
1228
+ this.relationType.COMPOSITION,
1229
+ this.relationType.DEPENDENCY,
1230
+ this.relationType.EXTENSION
1231
+ ];
1232
+ if (classRelation.relation.type1 === this.relationType.LOLLIPOP && !invalidTypes.includes(classRelation.relation.type2)) {
1233
+ this.addClass(classRelation.id2);
1234
+ this.addInterface(classRelation.id1, classRelation.id2);
1235
+ classRelation.id1 = `interface${this.interfaces.length - 1}`;
1236
+ } else if (classRelation.relation.type2 === this.relationType.LOLLIPOP && !invalidTypes.includes(classRelation.relation.type1)) {
1237
+ this.addClass(classRelation.id1);
1238
+ this.addInterface(classRelation.id2, classRelation.id1);
1239
+ classRelation.id2 = `interface${this.interfaces.length - 1}`;
1240
+ } else {
1241
+ this.addClass(classRelation.id1);
1242
+ this.addClass(classRelation.id2);
1243
+ }
1244
+ classRelation.id1 = this.splitClassNameAndType(classRelation.id1).className;
1245
+ classRelation.id2 = this.splitClassNameAndType(classRelation.id2).className;
1246
+ classRelation.relationTitle1 = common_default.sanitizeText(
1247
+ classRelation.relationTitle1.trim(),
1248
+ getConfig2()
1249
+ );
1250
+ classRelation.relationTitle2 = common_default.sanitizeText(
1251
+ classRelation.relationTitle2.trim(),
1252
+ getConfig2()
1253
+ );
1254
+ this.relations.push(classRelation);
1255
+ }
1256
+ /**
1257
+ * Adds an annotation to the specified class Annotations mark special properties of the given type
1258
+ * (like 'interface' or 'service')
1259
+ *
1260
+ * @param className - The class name
1261
+ * @param annotation - The name of the annotation without any brackets
1262
+ * @public
1263
+ */
1264
+ addAnnotation(className, annotation) {
1265
+ const validatedClassName = this.splitClassNameAndType(className).className;
1266
+ this.classes.get(validatedClassName).annotations.push(annotation);
1267
+ }
1268
+ /**
1269
+ * Adds a member to the specified class
1270
+ *
1271
+ * @param className - The class name
1272
+ * @param member - The full name of the member. If the member is enclosed in `<<brackets>>` it is
1273
+ * treated as an annotation If the member is ending with a closing bracket ) it is treated as a
1274
+ * method Otherwise the member will be treated as a normal property
1275
+ * @public
1276
+ */
1277
+ addMember(className, member) {
1278
+ this.addClass(className);
1279
+ const validatedClassName = this.splitClassNameAndType(className).className;
1280
+ const theClass = this.classes.get(validatedClassName);
1281
+ if (typeof member === "string") {
1282
+ const memberString = member.trim();
1283
+ if (memberString.startsWith("<<") && memberString.endsWith(">>")) {
1284
+ theClass.annotations.push(sanitizeText2(memberString.substring(2, memberString.length - 2)));
1285
+ } else if (memberString.indexOf(")") > 0) {
1286
+ theClass.methods.push(new ClassMember(memberString, "method"));
1287
+ } else if (memberString) {
1288
+ theClass.members.push(new ClassMember(memberString, "attribute"));
1289
+ }
1290
+ }
1291
+ }
1292
+ addMembers(className, members) {
1293
+ if (Array.isArray(members)) {
1294
+ members.reverse();
1295
+ members.forEach((member) => this.addMember(className, member));
1296
+ }
1297
+ }
1298
+ addNote(text, className) {
1299
+ const index = this.notes.size;
1300
+ const note = {
1301
+ id: `note${index}`,
1302
+ class: className,
1303
+ text,
1304
+ index
1305
+ };
1306
+ this.notes.set(note.id, note);
1307
+ return note.id;
1308
+ }
1309
+ cleanupLabel(label) {
1310
+ if (label.startsWith(":")) {
1311
+ label = label.substring(1);
1312
+ }
1313
+ return sanitizeText2(label.trim());
1314
+ }
1315
+ /**
1316
+ * Called by parser when assigning cssClass to a class
1317
+ *
1318
+ * @param ids - Comma separated list of ids
1319
+ * @param className - Class to add
1320
+ */
1321
+ setCssClass(ids, className) {
1322
+ ids.split(",").forEach((_id) => {
1323
+ let id = _id;
1324
+ if (/\d/.exec(_id[0])) {
1325
+ id = MERMAID_DOM_ID_PREFIX + id;
1326
+ }
1327
+ const classNode = this.classes.get(id);
1328
+ if (classNode) {
1329
+ classNode.cssClasses += " " + className;
1330
+ }
1331
+ });
1332
+ }
1333
+ defineClass(ids, style) {
1334
+ for (const id of ids) {
1335
+ let styleClass = this.styleClasses.get(id);
1336
+ if (styleClass === void 0) {
1337
+ styleClass = { id, styles: [], textStyles: [] };
1338
+ this.styleClasses.set(id, styleClass);
1339
+ }
1340
+ if (style) {
1341
+ style.forEach((s) => {
1342
+ if (/color/.exec(s)) {
1343
+ const newStyle = s.replace("fill", "bgFill");
1344
+ styleClass.textStyles.push(newStyle);
1345
+ }
1346
+ styleClass.styles.push(s);
1347
+ });
1348
+ }
1349
+ this.classes.forEach((value) => {
1350
+ if (value.cssClasses.includes(id)) {
1351
+ value.styles.push(...style.flatMap((s) => s.split(",")));
1352
+ }
1353
+ });
1354
+ }
1355
+ }
1356
+ /**
1357
+ * Called by parser when a tooltip is found, e.g. a clickable element.
1358
+ *
1359
+ * @param ids - Comma separated list of ids
1360
+ * @param tooltip - Tooltip to add
1361
+ */
1362
+ setTooltip(ids, tooltip) {
1363
+ ids.split(",").forEach((id) => {
1364
+ if (tooltip !== void 0) {
1365
+ this.classes.get(id).tooltip = sanitizeText2(tooltip);
1366
+ }
1367
+ });
1368
+ }
1369
+ getTooltip(id, namespace) {
1370
+ if (namespace && this.namespaces.has(namespace)) {
1371
+ return this.namespaces.get(namespace).classes.get(id).tooltip;
1372
+ }
1373
+ return this.classes.get(id).tooltip;
1374
+ }
1375
+ /**
1376
+ * Called by parser when a link is found. Adds the URL to the vertex data.
1377
+ *
1378
+ * @param ids - Comma separated list of ids
1379
+ * @param linkStr - URL to create a link for
1380
+ * @param target - Target of the link, _blank by default as originally defined in the svgDraw.js file
1381
+ */
1382
+ setLink(ids, linkStr, target) {
1383
+ const config = getConfig2();
1384
+ ids.split(",").forEach((_id) => {
1385
+ let id = _id;
1386
+ if (/\d/.exec(_id[0])) {
1387
+ id = MERMAID_DOM_ID_PREFIX + id;
1388
+ }
1389
+ const theClass = this.classes.get(id);
1390
+ if (theClass) {
1391
+ theClass.link = utils_default.formatUrl(linkStr, config);
1392
+ if (config.securityLevel === "sandbox") {
1393
+ theClass.linkTarget = "_top";
1394
+ } else if (typeof target === "string") {
1395
+ theClass.linkTarget = sanitizeText2(target);
1396
+ } else {
1397
+ theClass.linkTarget = "_blank";
1398
+ }
1399
+ }
1400
+ });
1401
+ this.setCssClass(ids, "clickable");
1402
+ }
1403
+ /**
1404
+ * Called by parser when a click definition is found. Registers an event handler.
1405
+ *
1406
+ * @param ids - Comma separated list of ids
1407
+ * @param functionName - Function to be called on click
1408
+ * @param functionArgs - Function args the function should be called with
1409
+ */
1410
+ setClickEvent(ids, functionName, functionArgs) {
1411
+ ids.split(",").forEach((id) => {
1412
+ this.setClickFunc(id, functionName, functionArgs);
1413
+ this.classes.get(id).haveCallback = true;
1414
+ });
1415
+ this.setCssClass(ids, "clickable");
1416
+ }
1417
+ setClickFunc(_domId, functionName, functionArgs) {
1418
+ const domId = common_default.sanitizeText(_domId, getConfig2());
1419
+ const config = getConfig2();
1420
+ if (config.securityLevel !== "loose") {
1421
+ return;
1422
+ }
1423
+ if (functionName === void 0) {
1424
+ return;
1425
+ }
1426
+ const id = domId;
1427
+ if (this.classes.has(id)) {
1428
+ let argList = [];
1429
+ if (typeof functionArgs === "string") {
1430
+ argList = functionArgs.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);
1431
+ for (let i = 0; i < argList.length; i++) {
1432
+ let item = argList[i].trim();
1433
+ if (item.startsWith('"') && item.endsWith('"')) {
1434
+ item = item.substr(1, item.length - 2);
1435
+ }
1436
+ argList[i] = item;
1437
+ }
1438
+ }
1439
+ if (argList.length === 0) {
1440
+ argList.push(id);
1441
+ }
1442
+ this.functions.push(() => {
1443
+ const elemId = this.lookUpDomId(id);
1444
+ const elem = document.querySelector(`[id="${elemId}"]`);
1445
+ if (elem !== null) {
1446
+ elem.addEventListener(
1447
+ "click",
1448
+ () => {
1449
+ utils_default.runFunc(functionName, ...argList);
1450
+ },
1451
+ false
1452
+ );
1453
+ }
1454
+ });
1455
+ }
1456
+ }
1457
+ bindFunctions(element) {
1458
+ this.functions.forEach((fun) => {
1459
+ fun(element);
1460
+ });
1461
+ }
1462
+ // Utility function to escape HTML meta-characters
1463
+ escapeHtml(str) {
1464
+ return str.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
1465
+ }
1466
+ getDirection() {
1467
+ return this.direction;
1468
+ }
1469
+ setDirection(dir) {
1470
+ this.direction = dir;
1471
+ }
1472
+ /**
1473
+ * Function called by parser when a namespace definition has been found.
1474
+ *
1475
+ * @param id - ID of the namespace to add
1476
+ * @public
1477
+ */
1478
+ addNamespace(id) {
1479
+ if (this.namespaces.has(id)) {
1480
+ return;
1481
+ }
1482
+ this.namespaces.set(id, {
1483
+ id,
1484
+ classes: /* @__PURE__ */ new Map(),
1485
+ notes: /* @__PURE__ */ new Map(),
1486
+ children: /* @__PURE__ */ new Map(),
1487
+ domId: MERMAID_DOM_ID_PREFIX + id + "-" + this.namespaceCounter
1488
+ });
1489
+ this.namespaceCounter++;
1490
+ }
1491
+ getNamespace(name) {
1492
+ return this.namespaces.get(name);
1493
+ }
1494
+ getNamespaces() {
1495
+ return this.namespaces;
1496
+ }
1497
+ /**
1498
+ * Function called by parser when a namespace definition has been found.
1499
+ *
1500
+ * @param id - ID of the namespace to add
1501
+ * @param classNames - IDs of the class to add
1502
+ * @param noteNames - IDs of the notes to add
1503
+ * @public
1504
+ */
1505
+ addClassesToNamespace(id, classNames, noteNames) {
1506
+ if (!this.namespaces.has(id)) {
1507
+ return;
1508
+ }
1509
+ for (const name of classNames) {
1510
+ const { className } = this.splitClassNameAndType(name);
1511
+ const classNode = this.getClass(className);
1512
+ classNode.parent = id;
1513
+ this.namespaces.get(id).classes.set(className, classNode);
1514
+ }
1515
+ for (const noteName of noteNames) {
1516
+ const noteNode = this.getNote(noteName);
1517
+ noteNode.parent = id;
1518
+ this.namespaces.get(id).notes.set(noteName, noteNode);
1519
+ }
1520
+ }
1521
+ setCssStyle(id, styles) {
1522
+ const thisClass = this.classes.get(id);
1523
+ if (!styles || !thisClass) {
1524
+ return;
1525
+ }
1526
+ for (const s of styles) {
1527
+ if (s.includes(",")) {
1528
+ thisClass.styles.push(...s.split(","));
1529
+ } else {
1530
+ thisClass.styles.push(s);
1531
+ }
1532
+ }
1533
+ }
1534
+ /**
1535
+ * Gets the arrow marker for a type index
1536
+ *
1537
+ * @param type - The type to look for
1538
+ * @returns The arrow marker
1539
+ */
1540
+ getArrowMarker(type) {
1541
+ let marker;
1542
+ switch (type) {
1543
+ case 0:
1544
+ marker = "aggregation";
1545
+ break;
1546
+ case 1:
1547
+ marker = "extension";
1548
+ break;
1549
+ case 2:
1550
+ marker = "composition";
1551
+ break;
1552
+ case 3:
1553
+ marker = "dependency";
1554
+ break;
1555
+ case 4:
1556
+ marker = "lollipop";
1557
+ break;
1558
+ default:
1559
+ marker = "none";
1560
+ }
1561
+ return marker;
1562
+ }
1563
+ getData() {
1564
+ const nodes = [];
1565
+ const edges = [];
1566
+ const config = getConfig2();
1567
+ for (const namespace of this.namespaces.values()) {
1568
+ const node = {
1569
+ id: namespace.id,
1570
+ label: namespace.id,
1571
+ isGroup: true,
1572
+ padding: config.class.padding ?? 16,
1573
+ // parent node must be one of [rect, roundedWithTitle, noteGroup, divider]
1574
+ shape: "rect",
1575
+ cssStyles: [],
1576
+ look: config.look
1577
+ };
1578
+ nodes.push(node);
1579
+ }
1580
+ for (const classNode of this.classes.values()) {
1581
+ const node = {
1582
+ ...classNode,
1583
+ type: void 0,
1584
+ isGroup: false,
1585
+ parentId: classNode.parent,
1586
+ look: config.look
1587
+ };
1588
+ nodes.push(node);
1589
+ }
1590
+ for (const note of this.notes.values()) {
1591
+ const noteNode = {
1592
+ id: note.id,
1593
+ label: note.text,
1594
+ isGroup: false,
1595
+ shape: "note",
1596
+ padding: config.class.padding ?? 6,
1597
+ cssStyles: [
1598
+ "text-align: left",
1599
+ "white-space: nowrap",
1600
+ `fill: ${config.themeVariables.noteBkgColor}`,
1601
+ `stroke: ${config.themeVariables.noteBorderColor}`
1602
+ ],
1603
+ look: config.look,
1604
+ parentId: note.parent,
1605
+ labelType: "markdown"
1606
+ };
1607
+ nodes.push(noteNode);
1608
+ const noteClassId = this.classes.get(note.class)?.id;
1609
+ if (noteClassId) {
1610
+ const edge = {
1611
+ id: `edgeNote${note.index}`,
1612
+ start: note.id,
1613
+ end: noteClassId,
1614
+ type: "normal",
1615
+ thickness: "normal",
1616
+ classes: "relation",
1617
+ arrowTypeStart: "none",
1618
+ arrowTypeEnd: "none",
1619
+ arrowheadStyle: "",
1620
+ labelStyle: [""],
1621
+ style: ["fill: none"],
1622
+ pattern: "dotted",
1623
+ look: config.look
1624
+ };
1625
+ edges.push(edge);
1626
+ }
1627
+ }
1628
+ for (const _interface of this.interfaces) {
1629
+ const interfaceNode = {
1630
+ id: _interface.id,
1631
+ label: _interface.label,
1632
+ isGroup: false,
1633
+ shape: "rect",
1634
+ cssStyles: ["opacity: 0;"],
1635
+ look: config.look
1636
+ };
1637
+ nodes.push(interfaceNode);
1638
+ }
1639
+ let cnt = 0;
1640
+ for (const classRelation of this.relations) {
1641
+ cnt++;
1642
+ const edge = {
1643
+ id: getEdgeId(classRelation.id1, classRelation.id2, {
1644
+ prefix: "id",
1645
+ counter: cnt
1646
+ }),
1647
+ start: classRelation.id1,
1648
+ end: classRelation.id2,
1649
+ type: "normal",
1650
+ label: classRelation.title,
1651
+ labelpos: "c",
1652
+ thickness: "normal",
1653
+ classes: "relation",
1654
+ arrowTypeStart: this.getArrowMarker(classRelation.relation.type1),
1655
+ arrowTypeEnd: this.getArrowMarker(classRelation.relation.type2),
1656
+ startLabelRight: classRelation.relationTitle1 === "none" ? "" : classRelation.relationTitle1,
1657
+ endLabelLeft: classRelation.relationTitle2 === "none" ? "" : classRelation.relationTitle2,
1658
+ arrowheadStyle: "",
1659
+ labelStyle: ["display: inline-block"],
1660
+ style: classRelation.style || "",
1661
+ pattern: classRelation.relation.lineType == 1 ? "dashed" : "solid",
1662
+ look: config.look,
1663
+ labelType: "markdown"
1664
+ };
1665
+ edges.push(edge);
1666
+ }
1667
+ return { nodes, edges, other: {}, config, direction: this.getDirection() };
1668
+ }
1669
+ };
1670
+ var getStyles = /* @__PURE__ */ __name((options) => `g.classGroup text {
1671
+ fill: ${options.nodeBorder || options.classText};
1672
+ stroke: none;
1673
+ font-family: ${options.fontFamily};
1674
+ font-size: 10px;
1675
+
1676
+ .title {
1677
+ font-weight: bolder;
1678
+ }
1679
+
1680
+ }
1681
+
1682
+ .cluster-label text {
1683
+ fill: ${options.titleColor};
1684
+ }
1685
+ .cluster-label span {
1686
+ color: ${options.titleColor};
1687
+ }
1688
+ .cluster-label span p {
1689
+ background-color: transparent;
1690
+ }
1691
+
1692
+ .cluster rect {
1693
+ fill: ${options.clusterBkg};
1694
+ stroke: ${options.clusterBorder};
1695
+ stroke-width: 1px;
1696
+ }
1697
+
1698
+ .cluster text {
1699
+ fill: ${options.titleColor};
1700
+ }
1701
+
1702
+ .cluster span {
1703
+ color: ${options.titleColor};
1704
+ }
1705
+
1706
+ .nodeLabel, .edgeLabel {
1707
+ color: ${options.classText};
1708
+ }
1709
+
1710
+ .noteLabel .nodeLabel, .noteLabel .edgeLabel {
1711
+ color: ${options.noteTextColor};
1712
+ }
1713
+ .edgeLabel .label rect {
1714
+ fill: ${options.mainBkg};
1715
+ }
1716
+ .label text {
1717
+ fill: ${options.classText};
1718
+ }
1719
+
1720
+ .labelBkg {
1721
+ background: ${options.mainBkg};
1722
+ }
1723
+ .edgeLabel .label span {
1724
+ background: ${options.mainBkg};
1725
+ }
1726
+
1727
+ .classTitle {
1728
+ font-weight: bolder;
1729
+ }
1730
+ .node rect,
1731
+ .node circle,
1732
+ .node ellipse,
1733
+ .node polygon,
1734
+ .node path {
1735
+ fill: ${options.mainBkg};
1736
+ stroke: ${options.nodeBorder};
1737
+ stroke-width: ${options.strokeWidth};
1738
+ }
1739
+
1740
+
1741
+ .divider {
1742
+ stroke: ${options.nodeBorder};
1743
+ stroke-width: 1;
1744
+ }
1745
+
1746
+ g.clickable {
1747
+ cursor: pointer;
1748
+ }
1749
+
1750
+ g.classGroup rect {
1751
+ fill: ${options.mainBkg};
1752
+ stroke: ${options.nodeBorder};
1753
+ }
1754
+
1755
+ g.classGroup line {
1756
+ stroke: ${options.nodeBorder};
1757
+ stroke-width: 1;
1758
+ }
1759
+
1760
+ .classLabel .box {
1761
+ stroke: none;
1762
+ stroke-width: 0;
1763
+ fill: ${options.mainBkg};
1764
+ opacity: 0.5;
1765
+ }
1766
+
1767
+ .classLabel .label {
1768
+ fill: ${options.nodeBorder};
1769
+ font-size: 10px;
1770
+ }
1771
+
1772
+ .relation {
1773
+ stroke: ${options.lineColor};
1774
+ stroke-width: ${options.strokeWidth};
1775
+ fill: none;
1776
+ }
1777
+
1778
+ .dashed-line{
1779
+ stroke-dasharray: 3;
1780
+ }
1781
+
1782
+ .dotted-line{
1783
+ stroke-dasharray: 1 2;
1784
+ }
1785
+
1786
+ [id$="-compositionStart"], .composition {
1787
+ fill: ${options.lineColor} !important;
1788
+ stroke: ${options.lineColor} !important;
1789
+ stroke-width: 1;
1790
+ }
1791
+
1792
+ [id$="-compositionEnd"], .composition {
1793
+ fill: ${options.lineColor} !important;
1794
+ stroke: ${options.lineColor} !important;
1795
+ stroke-width: 1;
1796
+ }
1797
+
1798
+ [id$="-dependencyStart"], .dependency {
1799
+ fill: ${options.lineColor} !important;
1800
+ stroke: ${options.lineColor} !important;
1801
+ stroke-width: 1;
1802
+ }
1803
+
1804
+ [id$="-dependencyEnd"], .dependency {
1805
+ fill: ${options.lineColor} !important;
1806
+ stroke: ${options.lineColor} !important;
1807
+ stroke-width: 1;
1808
+ }
1809
+
1810
+ [id$="-extensionStart"], .extension {
1811
+ fill: transparent !important;
1812
+ stroke: ${options.lineColor} !important;
1813
+ stroke-width: 1;
1814
+ }
1815
+
1816
+ [id$="-extensionEnd"], .extension {
1817
+ fill: transparent !important;
1818
+ stroke: ${options.lineColor} !important;
1819
+ stroke-width: 1;
1820
+ }
1821
+
1822
+ [id$="-aggregationStart"], .aggregation {
1823
+ fill: transparent !important;
1824
+ stroke: ${options.lineColor} !important;
1825
+ stroke-width: 1;
1826
+ }
1827
+
1828
+ [id$="-aggregationEnd"], .aggregation {
1829
+ fill: transparent !important;
1830
+ stroke: ${options.lineColor} !important;
1831
+ stroke-width: 1;
1832
+ }
1833
+
1834
+ [id$="-lollipopStart"], .lollipop {
1835
+ fill: ${options.mainBkg} !important;
1836
+ stroke: ${options.lineColor} !important;
1837
+ stroke-width: 1;
1838
+ }
1839
+
1840
+ [id$="-lollipopEnd"], .lollipop {
1841
+ fill: ${options.mainBkg} !important;
1842
+ stroke: ${options.lineColor} !important;
1843
+ stroke-width: 1;
1844
+ }
1845
+
1846
+ .edgeTerminals {
1847
+ font-size: 11px;
1848
+ line-height: initial;
1849
+ }
1850
+
1851
+ .classTitleText {
1852
+ text-anchor: middle;
1853
+ font-size: 18px;
1854
+ fill: ${options.textColor};
1855
+ }
1856
+
1857
+ .edgeLabel[data-look="neo"] {
1858
+ background-color: ${options.edgeLabelBackground};
1859
+ p {
1860
+ background-color: ${options.edgeLabelBackground};
1861
+ }
1862
+ rect {
1863
+ opacity: 0.5;
1864
+ background-color: ${options.edgeLabelBackground};
1865
+ fill: ${options.edgeLabelBackground};
1866
+ }
1867
+ text-align: center;
1868
+ }
1869
+ ${getIconStyles()}
1870
+ `, "getStyles");
1871
+ var styles_default = getStyles;
1872
+ var getDir = /* @__PURE__ */ __name((parsedItem, defaultDir = "TB") => {
1873
+ if (!parsedItem.doc) {
1874
+ return defaultDir;
1875
+ }
1876
+ let dir = defaultDir;
1877
+ for (const parsedItemDoc of parsedItem.doc) {
1878
+ if (parsedItemDoc.stmt === "dir") {
1879
+ dir = parsedItemDoc.value;
1880
+ }
1881
+ }
1882
+ return dir;
1883
+ }, "getDir");
1884
+ var getClasses = /* @__PURE__ */ __name(function(text, diagramObj) {
1885
+ return diagramObj.db.getClasses();
1886
+ }, "getClasses");
1887
+ var draw = /* @__PURE__ */ __name(async function(text, id, _version, diag) {
1888
+ log.info("REF0:");
1889
+ log.info("Drawing class diagram (v3)", id);
1890
+ const { securityLevel, state: conf, layout } = getConfig2();
1891
+ diag.db.setDiagramId(id);
1892
+ const data4Layout = diag.db.getData();
1893
+ const svg = getDiagramElement(id, securityLevel);
1894
+ data4Layout.type = diag.type;
1895
+ data4Layout.layoutAlgorithm = getRegisteredLayoutAlgorithm(layout);
1896
+ data4Layout.nodeSpacing = conf?.nodeSpacing || 50;
1897
+ data4Layout.rankSpacing = conf?.rankSpacing || 50;
1898
+ data4Layout.markers = ["aggregation", "extension", "composition", "dependency", "lollipop"];
1899
+ data4Layout.diagramId = id;
1900
+ await render(data4Layout, svg);
1901
+ const padding = 8;
1902
+ utils_default.insertTitle(
1903
+ svg,
1904
+ "classDiagramTitleText",
1905
+ conf?.titleTopMargin ?? 25,
1906
+ diag.db.getDiagramTitle()
1907
+ );
1908
+ setupViewPortForSVG(svg, padding, "classDiagram", conf?.useMaxWidth ?? true);
1909
+ }, "draw");
1910
+ var classRenderer_v3_unified_default = {
1911
+ getClasses,
1912
+ draw,
1913
+ getDir
1914
+ };
1915
+ export {
1916
+ ClassDB as C,
1917
+ classDiagram_default as a,
1918
+ classRenderer_v3_unified_default as c,
1919
+ styles_default as s
1920
+ };