@umami/shiso 1.12.0 → 1.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. package/dist/chunks/App.js +76 -49
  2. package/dist/chunks/abnfDiagram-VCTEODGH.js +109 -0
  3. package/dist/chunks/arc.js +130 -0
  4. package/dist/chunks/architecture-7GRP2DOG.js +4 -0
  5. package/dist/chunks/architectureDiagram-5GKGNRK7.js +7466 -0
  6. package/dist/chunks/array.js +8 -0
  7. package/dist/chunks/blockDiagram-I7D4REHJ.js +2546 -0
  8. package/dist/chunks/c4Diagram-7LVT6UL2.js +3654 -0
  9. package/dist/chunks/channel.js +9 -0
  10. package/dist/chunks/chunk-2Q5K7J3B.js +21 -0
  11. package/dist/chunks/chunk-4HAMMTFA.js +6106 -0
  12. package/dist/chunks/chunk-5VM5RSS4.js +21 -0
  13. package/dist/chunks/chunk-75Z2AOVW.js +2185 -0
  14. package/dist/chunks/chunk-DU6HZSFF.js +8729 -0
  15. package/dist/chunks/chunk-F27PBJKO.js +95 -0
  16. package/dist/chunks/chunk-FOHPRMQF.js +27162 -0
  17. package/dist/chunks/chunk-GMAD6QVW.js +2369 -0
  18. package/dist/chunks/chunk-GVQU2GXP.js +58 -0
  19. package/dist/chunks/chunk-IMKFNOWR.js +2593 -0
  20. package/dist/chunks/chunk-JWPE2WC7.js +12 -0
  21. package/dist/chunks/chunk-L3NEJ4N5.js +420 -0
  22. package/dist/chunks/chunk-OSK3NFVY.js +1029 -0
  23. package/dist/chunks/chunk-P2QGCYS3.js +95 -0
  24. package/dist/chunks/chunk-POPQ4Y6H.js +33 -0
  25. package/dist/chunks/chunk-PWAF6VOD.js +467 -0
  26. package/dist/chunks/chunk-SHT3W25Y.js +4813 -0
  27. package/dist/chunks/chunk-SVP7TREG.js +686 -0
  28. package/dist/chunks/chunk-TICWLB2K.js +3800 -0
  29. package/dist/chunks/chunk-XXDRQBXY.js +12 -0
  30. package/dist/chunks/chunk-Y2CYZVJY.js +15 -0
  31. package/dist/chunks/classDiagram-ZZMXUADV.js +33 -0
  32. package/dist/chunks/classDiagram-v2-VYDZK3BY.js +33 -0
  33. package/dist/chunks/cose-bilkent-JH36ORCC.js +4268 -0
  34. package/dist/chunks/cynefin-OW5HDTMX.js +4 -0
  35. package/dist/chunks/cynefinDiagram-5FMLGOSQ.js +482 -0
  36. package/dist/chunks/cytoscape.esm.js +28282 -0
  37. package/dist/chunks/dagre-GXQ25YYZ.js +583 -0
  38. package/dist/chunks/dagre.js +4235 -0
  39. package/dist/chunks/defaultLocale.js +246 -0
  40. package/dist/chunks/diagram-S7CK7UJ4.js +402 -0
  41. package/dist/chunks/diagram-UQ7AKVKN.js +291 -0
  42. package/dist/chunks/diagram-VSXAHHWV.js +553 -0
  43. package/dist/chunks/diagram-VX7I27RA.js +798 -0
  44. package/dist/chunks/diagram-Z3DM3KII.js +186 -0
  45. package/dist/chunks/dist.js +92 -0
  46. package/dist/chunks/docs.js +987 -91
  47. package/dist/chunks/ebnfDiagram-PWID7BFC.js +123 -0
  48. package/dist/chunks/erDiagram-RLTQ6QDP.js +2295 -0
  49. package/dist/chunks/eventmodeling-NTZA5JFV.js +4 -0
  50. package/dist/chunks/flowDiagram-HODETNUW.js +17 -0
  51. package/dist/chunks/ganttDiagram-EL5Y4UJY.js +3928 -0
  52. package/dist/chunks/gitGraph-4MIJSDKK.js +4 -0
  53. package/dist/chunks/gitGraphDiagram-WWUBYQGX.js +1153 -0
  54. package/dist/chunks/graphlib.js +4194 -0
  55. package/dist/chunks/info-A6RAGUB7.js +4 -0
  56. package/dist/chunks/infoDiagram-27XIBGKW.js +25 -0
  57. package/dist/chunks/init.js +14 -0
  58. package/dist/chunks/ishikawaDiagram-5VMMS53U.js +971 -0
  59. package/dist/chunks/journeyDiagram-3NMN7TZE.js +1226 -0
  60. package/dist/chunks/kanban-definition-UXKFOSKX.js +1241 -0
  61. package/dist/chunks/katex.js +26463 -0
  62. package/dist/chunks/line.js +48 -0
  63. package/dist/chunks/linear.js +391 -0
  64. package/dist/chunks/mermaid-parser.core.js +754 -0
  65. package/dist/chunks/mermaid.core.js +4898 -0
  66. package/dist/chunks/mindmap-definition-YA3MSWOX.js +1309 -0
  67. package/dist/chunks/ordinal.js +84 -0
  68. package/dist/chunks/packet-AYTQ26CC.js +4 -0
  69. package/dist/chunks/path.js +106 -0
  70. package/dist/chunks/pegDiagram-XKGWAZYB.js +115 -0
  71. package/dist/chunks/pie-WAS4IAKB.js +4 -0
  72. package/dist/chunks/pieDiagram-E7YTZNPT.js +297 -0
  73. package/dist/chunks/quadrantDiagram-AXDQQJYC.js +2234 -0
  74. package/dist/chunks/radar-RG4KPBEZ.js +4 -0
  75. package/dist/chunks/railroad-74A4TZTK.js +4 -0
  76. package/dist/chunks/railroad-abnf-HS5TGJTU.js +4 -0
  77. package/dist/chunks/railroad-ebnf-LZEXJU2U.js +4 -0
  78. package/dist/chunks/railroad-peg-WCYAUIDC.js +4 -0
  79. package/dist/chunks/railroadDiagram-O6MQD6OU.js +89 -0
  80. package/dist/chunks/requirementDiagram-BXWQKSXE.js +2464 -0
  81. package/dist/chunks/rough.esm.js +1396 -0
  82. package/dist/chunks/sankeyDiagram-P5KCCOFB.js +1308 -0
  83. package/dist/chunks/sequenceDiagram-WJ2MYXX4.js +5445 -0
  84. package/dist/chunks/sizeCapture-INFHLROL.js +56 -0
  85. package/dist/chunks/src.js +2653 -0
  86. package/dist/chunks/stateDiagram-D77RDMKH.js +368 -0
  87. package/dist/chunks/stateDiagram-v2-MP3YSRHH.js +33 -0
  88. package/dist/chunks/swimlanes-42K2YHIH.js +6925 -0
  89. package/dist/chunks/swimlanesDiagram-VR7AAH4N.js +32 -0
  90. package/dist/chunks/timeline-definition-24CTP7MA.js +1507 -0
  91. package/dist/chunks/treeView-Q6P3EWNA.js +4 -0
  92. package/dist/chunks/treemap-WGGIJYW6.js +4 -0
  93. package/dist/chunks/vennDiagram-4TSXK5OY.js +2803 -0
  94. package/dist/chunks/wardley-WFR3VGLG.js +4 -0
  95. package/dist/chunks/wardleyDiagram-VM6X3IG4.js +877 -0
  96. package/dist/chunks/xychartDiagram-S5SC5T6Z.js +2698 -0
  97. package/dist/components.js +2 -2
  98. package/dist/entry-client.js +1 -1
  99. package/dist/entry-server.js +1 -1
  100. package/docs.schema.json +1 -1
  101. package/package.json +2 -1
  102. package/scripts/expand-navigation-globs.mjs +77 -8
  103. package/src/components/CodeBlock.tsx +36 -0
  104. package/src/components/Docs.tsx +44 -21
  105. package/src/components/OpenApiOperation.tsx +28 -20
  106. package/src/components/SideNav.tsx +8 -3
  107. package/src/components/docs/Changelog.tsx +163 -0
  108. package/src/components/docs/Mermaid.tsx +164 -0
  109. package/src/components/docs/Panel.tsx +23 -0
  110. package/src/components/docs/ParamField.tsx +17 -5
  111. package/src/components/docs/PropertiesTable.tsx +2 -2
  112. package/src/components/docs/ResponseField.tsx +17 -5
  113. package/src/components/docs/Tiles.tsx +59 -0
  114. package/src/components/docs/Tree.tsx +359 -0
  115. package/src/components/docs/Update.tsx +72 -0
  116. package/src/components/docs/index.ts +7 -0
  117. package/src/components/docs/panel-context.tsx +25 -0
  118. package/src/components/docs/styles.ts +49 -0
  119. package/src/components/icons/index.ts +4 -0
  120. package/src/lib/rehype-shiki.ts +18 -1
  121. package/types/components.d.ts +79 -0
@@ -0,0 +1,2295 @@
1
+ import { n as __name, t as __export } from "./chunk-Y2CYZVJY.js";
2
+ import { m as log, p as select_default } from "./src.js";
3
+ import { H as setAccDescription, K as setDiagramTitle, U as setAccTitle, a as clear, it as rgba, s as common_default, v as getAccDescription, w as getDiagramTitle, x as getConfig2, y as getAccTitle } from "./chunk-DU6HZSFF.js";
4
+ import { t as channel } from "./channel.js";
5
+ import { c as getEdgeId, g as utils_default } from "./chunk-75Z2AOVW.js";
6
+ import "./chunk-PWAF6VOD.js";
7
+ import "./chunk-GMAD6QVW.js";
8
+ import "./chunk-P2QGCYS3.js";
9
+ import "./chunk-4HAMMTFA.js";
10
+ import "./chunk-GVQU2GXP.js";
11
+ import "./chunk-OSK3NFVY.js";
12
+ import { t as getDiagramElement } from "./chunk-XXDRQBXY.js";
13
+ import { t as setupViewPortForSVG } from "./chunk-POPQ4Y6H.js";
14
+ import "./chunk-L3NEJ4N5.js";
15
+ import { d as render, u as getRegisteredLayoutAlgorithm } from "./mermaid.core.js";
16
+
17
+ //#region ../../node_modules/.pnpm/mermaid@11.17.2/node_modules/mermaid/dist/chunks/mermaid.core/erDiagram-RLTQ6QDP.mjs
18
+ var parser = (function() {
19
+ var o = /* @__PURE__ */ __name(function(k, v, o2, l) {
20
+ for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v);
21
+ return o2;
22
+ }, "o"), $V0 = [
23
+ 6,
24
+ 9,
25
+ 21,
26
+ 23,
27
+ 25,
28
+ 27,
29
+ 34,
30
+ 37,
31
+ 38,
32
+ 39,
33
+ 40,
34
+ 41,
35
+ 43,
36
+ 46,
37
+ 47,
38
+ 51,
39
+ 53,
40
+ 54,
41
+ 55
42
+ ], $V1 = [2, 2], $V2 = [1, 7], $V3 = [1, 9], $V4 = [1, 10], $V5 = [1, 11], $V6 = [1, 12], $V7 = [1, 30], $V8 = [1, 23], $V9 = [1, 24], $Va = [1, 25], $Vb = [1, 26], $Vc = [1, 27], $Vd = [1, 19], $Ve = [1, 28], $Vf = [1, 29], $Vg = [1, 20], $Vh = [1, 18], $Vi = [1, 21], $Vj = [1, 22], $Vk = [2, 6], $Vl = [
43
+ 6,
44
+ 9,
45
+ 21,
46
+ 23,
47
+ 25,
48
+ 27,
49
+ 33,
50
+ 34,
51
+ 37,
52
+ 38,
53
+ 39,
54
+ 40,
55
+ 41,
56
+ 43,
57
+ 46,
58
+ 47,
59
+ 51,
60
+ 53,
61
+ 54,
62
+ 55
63
+ ], $Vm = [1, 36], $Vn = [1, 37], $Vo = [1, 38], $Vp = [1, 39], $Vq = [1, 40], $Vr = [
64
+ 6,
65
+ 9,
66
+ 12,
67
+ 14,
68
+ 16,
69
+ 19,
70
+ 20,
71
+ 21,
72
+ 23,
73
+ 25,
74
+ 27,
75
+ 33,
76
+ 34,
77
+ 37,
78
+ 38,
79
+ 39,
80
+ 40,
81
+ 41,
82
+ 43,
83
+ 46,
84
+ 47,
85
+ 50,
86
+ 51,
87
+ 53,
88
+ 54,
89
+ 55,
90
+ 69,
91
+ 70,
92
+ 71,
93
+ 72,
94
+ 73
95
+ ], $Vs = [1, 46], $Vt = [1, 47], $Vu = [1, 57], $Vv = [
96
+ 43,
97
+ 51,
98
+ 53,
99
+ 54,
100
+ 55,
101
+ 74,
102
+ 75
103
+ ], $Vw = [1, 70], $Vx = [1, 68], $Vy = [1, 65], $Vz = [1, 69], $VA = [1, 71], $VB = [
104
+ 6,
105
+ 9,
106
+ 12,
107
+ 16,
108
+ 21,
109
+ 23,
110
+ 25,
111
+ 27,
112
+ 33,
113
+ 34,
114
+ 37,
115
+ 38,
116
+ 39,
117
+ 40,
118
+ 41,
119
+ 43,
120
+ 44,
121
+ 45,
122
+ 46,
123
+ 47,
124
+ 51,
125
+ 52,
126
+ 53,
127
+ 54,
128
+ 55,
129
+ 69,
130
+ 70,
131
+ 71,
132
+ 72,
133
+ 73
134
+ ], $VC = [1, 78], $VD = [1, 77], $VE = [1, 76], $VF = [
135
+ 69,
136
+ 70,
137
+ 71,
138
+ 72,
139
+ 73
140
+ ], $VG = [1, 91], $VH = [
141
+ 6,
142
+ 9,
143
+ 45,
144
+ 50
145
+ ], $VI = [
146
+ 6,
147
+ 9,
148
+ 12,
149
+ 44,
150
+ 45,
151
+ 50,
152
+ 51,
153
+ 52
154
+ ], $VJ = [1, 101], $VK = [1, 100], $VL = [1, 99], $VM = [18, 61], $VN = [1, 110], $VO = [1, 109], $VP = [
155
+ 20,
156
+ 43,
157
+ 51,
158
+ 53,
159
+ 54,
160
+ 55
161
+ ], $VQ = [
162
+ 18,
163
+ 61,
164
+ 64,
165
+ 66
166
+ ];
167
+ var parser2 = {
168
+ trace: /* @__PURE__ */ __name(function trace() {}, "trace"),
169
+ yy: {},
170
+ symbols_: {
171
+ "error": 2,
172
+ "start": 3,
173
+ "ER_DIAGRAM": 4,
174
+ "document": 5,
175
+ "EOF": 6,
176
+ "line": 7,
177
+ "statement": 8,
178
+ "NEWLINE": 9,
179
+ "entityName": 10,
180
+ "relSpec": 11,
181
+ "COLON": 12,
182
+ "role": 13,
183
+ "STYLE_SEPARATOR": 14,
184
+ "idList": 15,
185
+ "BLOCK_START": 16,
186
+ "attributes": 17,
187
+ "BLOCK_STOP": 18,
188
+ "SQS": 19,
189
+ "SQE": 20,
190
+ "title": 21,
191
+ "title_value": 22,
192
+ "acc_title": 23,
193
+ "acc_title_value": 24,
194
+ "acc_descr": 25,
195
+ "acc_descr_value": 26,
196
+ "acc_descr_multiline_value": 27,
197
+ "direction": 28,
198
+ "classDefStatement": 29,
199
+ "classStatement": 30,
200
+ "styleStatement": 31,
201
+ "subgraphHeader": 32,
202
+ "END": 33,
203
+ "SUBGRAPH": 34,
204
+ "separator": 35,
205
+ "subgraphTitle": 36,
206
+ "direction_tb": 37,
207
+ "direction_bt": 38,
208
+ "direction_rl": 39,
209
+ "direction_lr": 40,
210
+ "CLASSDEF": 41,
211
+ "stylesOpt": 42,
212
+ "UNICODE_TEXT": 43,
213
+ "STYLE_TEXT": 44,
214
+ "COMMA": 45,
215
+ "CLASS": 46,
216
+ "STYLE": 47,
217
+ "style": 48,
218
+ "styleComponent": 49,
219
+ "SEMI": 50,
220
+ "NUM": 51,
221
+ "BRKT": 52,
222
+ "ENTITY_NAME": 53,
223
+ "DECIMAL_NUM": 54,
224
+ "ENTITY_ONE": 55,
225
+ "attribute": 56,
226
+ "attributeType": 57,
227
+ "attributeName": 58,
228
+ "attributeKeyTypeList": 59,
229
+ "attributeComment": 60,
230
+ "ATTRIBUTE_WORD": 61,
231
+ "?": 62,
232
+ "attributeKeyType": 63,
233
+ ",": 64,
234
+ "ATTRIBUTE_KEY": 65,
235
+ "COMMENT": 66,
236
+ "cardinality": 67,
237
+ "relType": 68,
238
+ "ZERO_OR_ONE": 69,
239
+ "ZERO_OR_MORE": 70,
240
+ "ONE_OR_MORE": 71,
241
+ "ONLY_ONE": 72,
242
+ "MD_PARENT": 73,
243
+ "NON_IDENTIFYING": 74,
244
+ "IDENTIFYING": 75,
245
+ "WORD": 76,
246
+ "$accept": 0,
247
+ "$end": 1
248
+ },
249
+ terminals_: {
250
+ 2: "error",
251
+ 4: "ER_DIAGRAM",
252
+ 6: "EOF",
253
+ 9: "NEWLINE",
254
+ 12: "COLON",
255
+ 14: "STYLE_SEPARATOR",
256
+ 16: "BLOCK_START",
257
+ 18: "BLOCK_STOP",
258
+ 19: "SQS",
259
+ 20: "SQE",
260
+ 21: "title",
261
+ 22: "title_value",
262
+ 23: "acc_title",
263
+ 24: "acc_title_value",
264
+ 25: "acc_descr",
265
+ 26: "acc_descr_value",
266
+ 27: "acc_descr_multiline_value",
267
+ 33: "END",
268
+ 34: "SUBGRAPH",
269
+ 37: "direction_tb",
270
+ 38: "direction_bt",
271
+ 39: "direction_rl",
272
+ 40: "direction_lr",
273
+ 41: "CLASSDEF",
274
+ 43: "UNICODE_TEXT",
275
+ 44: "STYLE_TEXT",
276
+ 45: "COMMA",
277
+ 46: "CLASS",
278
+ 47: "STYLE",
279
+ 50: "SEMI",
280
+ 51: "NUM",
281
+ 52: "BRKT",
282
+ 53: "ENTITY_NAME",
283
+ 54: "DECIMAL_NUM",
284
+ 55: "ENTITY_ONE",
285
+ 61: "ATTRIBUTE_WORD",
286
+ 62: "?",
287
+ 64: ",",
288
+ 65: "ATTRIBUTE_KEY",
289
+ 66: "COMMENT",
290
+ 69: "ZERO_OR_ONE",
291
+ 70: "ZERO_OR_MORE",
292
+ 71: "ONE_OR_MORE",
293
+ 72: "ONLY_ONE",
294
+ 73: "MD_PARENT",
295
+ 74: "NON_IDENTIFYING",
296
+ 75: "IDENTIFYING",
297
+ 76: "WORD"
298
+ },
299
+ productions_: [
300
+ 0,
301
+ [3, 3],
302
+ [5, 0],
303
+ [5, 2],
304
+ [7, 1],
305
+ [7, 1],
306
+ [7, 1],
307
+ [8, 5],
308
+ [8, 9],
309
+ [8, 7],
310
+ [8, 7],
311
+ [8, 4],
312
+ [8, 6],
313
+ [8, 3],
314
+ [8, 5],
315
+ [8, 1],
316
+ [8, 3],
317
+ [8, 7],
318
+ [8, 9],
319
+ [8, 6],
320
+ [8, 8],
321
+ [8, 4],
322
+ [8, 6],
323
+ [8, 2],
324
+ [8, 2],
325
+ [8, 2],
326
+ [8, 1],
327
+ [8, 1],
328
+ [8, 1],
329
+ [8, 1],
330
+ [8, 1],
331
+ [8, 3],
332
+ [32, 3],
333
+ [32, 6],
334
+ [36, 1],
335
+ [36, 2],
336
+ [28, 1],
337
+ [28, 1],
338
+ [28, 1],
339
+ [28, 1],
340
+ [29, 4],
341
+ [15, 1],
342
+ [15, 1],
343
+ [15, 3],
344
+ [15, 3],
345
+ [30, 3],
346
+ [31, 4],
347
+ [42, 1],
348
+ [42, 3],
349
+ [48, 1],
350
+ [48, 2],
351
+ [35, 1],
352
+ [35, 1],
353
+ [35, 1],
354
+ [49, 1],
355
+ [49, 1],
356
+ [49, 1],
357
+ [49, 1],
358
+ [10, 1],
359
+ [10, 1],
360
+ [10, 1],
361
+ [10, 1],
362
+ [10, 1],
363
+ [17, 1],
364
+ [17, 2],
365
+ [56, 2],
366
+ [56, 3],
367
+ [56, 3],
368
+ [56, 4],
369
+ [57, 1],
370
+ [57, 2],
371
+ [58, 1],
372
+ [59, 1],
373
+ [59, 3],
374
+ [63, 1],
375
+ [60, 1],
376
+ [11, 3],
377
+ [67, 1],
378
+ [67, 1],
379
+ [67, 1],
380
+ [67, 1],
381
+ [67, 1],
382
+ [68, 1],
383
+ [68, 1],
384
+ [13, 1],
385
+ [13, 1],
386
+ [13, 1]
387
+ ],
388
+ performAction: /* @__PURE__ */ __name(function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) {
389
+ var $0 = $$.length - 1;
390
+ switch (yystate) {
391
+ case 1: break;
392
+ case 2:
393
+ this.$ = [];
394
+ break;
395
+ case 3:
396
+ this.$ = $$[$0 - 1].concat($$[$0]);
397
+ break;
398
+ case 4:
399
+ this.$ = $$[$0];
400
+ break;
401
+ case 5:
402
+ case 6:
403
+ this.$ = [];
404
+ break;
405
+ case 7:
406
+ yy.addEntity($$[$0 - 4]);
407
+ yy.addEntity($$[$0 - 2]);
408
+ yy.addRelationship($$[$0 - 4], $$[$0], $$[$0 - 2], $$[$0 - 3]);
409
+ this.$ = [$$[$0 - 4], $$[$0 - 2]];
410
+ break;
411
+ case 8:
412
+ yy.addEntity($$[$0 - 8]);
413
+ yy.addEntity($$[$0 - 4]);
414
+ yy.addRelationship($$[$0 - 8], $$[$0], $$[$0 - 4], $$[$0 - 5]);
415
+ yy.setClass([$$[$0 - 8]], $$[$0 - 6]);
416
+ yy.setClass([$$[$0 - 4]], $$[$0 - 2]);
417
+ this.$ = [$$[$0 - 8], $$[$0 - 4]];
418
+ break;
419
+ case 9:
420
+ yy.addEntity($$[$0 - 6]);
421
+ yy.addEntity($$[$0 - 2]);
422
+ yy.addRelationship($$[$0 - 6], $$[$0], $$[$0 - 2], $$[$0 - 3]);
423
+ yy.setClass([$$[$0 - 6]], $$[$0 - 4]);
424
+ this.$ = [$$[$0 - 6], $$[$0 - 2]];
425
+ break;
426
+ case 10:
427
+ yy.addEntity($$[$0 - 6]);
428
+ yy.addEntity($$[$0 - 4]);
429
+ yy.addRelationship($$[$0 - 6], $$[$0], $$[$0 - 4], $$[$0 - 5]);
430
+ yy.setClass([$$[$0 - 4]], $$[$0 - 2]);
431
+ this.$ = [$$[$0 - 6], $$[$0 - 4]];
432
+ break;
433
+ case 11:
434
+ yy.addEntity($$[$0 - 3]);
435
+ yy.addAttributes($$[$0 - 3], $$[$0 - 1]);
436
+ this.$ = [$$[$0 - 3]];
437
+ break;
438
+ case 12:
439
+ yy.addEntity($$[$0 - 5]);
440
+ yy.addAttributes($$[$0 - 5], $$[$0 - 1]);
441
+ yy.setClass([$$[$0 - 5]], $$[$0 - 3]);
442
+ this.$ = [$$[$0 - 5]];
443
+ break;
444
+ case 13:
445
+ yy.addEntity($$[$0 - 2]);
446
+ this.$ = [$$[$0 - 2]];
447
+ break;
448
+ case 14:
449
+ yy.addEntity($$[$0 - 4]);
450
+ yy.setClass([$$[$0 - 4]], $$[$0 - 2]);
451
+ this.$ = [$$[$0 - 4]];
452
+ break;
453
+ case 15:
454
+ yy.addEntity($$[$0]);
455
+ this.$ = [$$[$0]];
456
+ break;
457
+ case 16:
458
+ yy.addEntity($$[$0 - 2]);
459
+ yy.setClass([$$[$0 - 2]], $$[$0]);
460
+ this.$ = [$$[$0 - 2]];
461
+ break;
462
+ case 17:
463
+ yy.addEntity($$[$0 - 6], $$[$0 - 4]);
464
+ yy.addAttributes($$[$0 - 6], $$[$0 - 1]);
465
+ this.$ = [$$[$0 - 6]];
466
+ break;
467
+ case 18:
468
+ yy.addEntity($$[$0 - 8], $$[$0 - 6]);
469
+ yy.addAttributes($$[$0 - 8], $$[$0 - 1]);
470
+ yy.setClass([$$[$0 - 8]], $$[$0 - 3]);
471
+ this.$ = [$$[$0 - 8]];
472
+ break;
473
+ case 19:
474
+ yy.addEntity($$[$0 - 5], $$[$0 - 3]);
475
+ this.$ = [$$[$0 - 5]];
476
+ break;
477
+ case 20:
478
+ yy.addEntity($$[$0 - 7], $$[$0 - 5]);
479
+ yy.setClass([$$[$0 - 7]], $$[$0 - 2]);
480
+ this.$ = [$$[$0 - 7]];
481
+ break;
482
+ case 21:
483
+ yy.addEntity($$[$0 - 3], $$[$0 - 1]);
484
+ break;
485
+ case 22:
486
+ yy.addEntity($$[$0 - 5], $$[$0 - 3]);
487
+ yy.setClass([$$[$0 - 5]], $$[$0]);
488
+ break;
489
+ case 23:
490
+ case 24:
491
+ this.$ = $$[$0].trim();
492
+ yy.setAccTitle(this.$);
493
+ break;
494
+ case 25:
495
+ case 26:
496
+ this.$ = $$[$0].trim();
497
+ yy.setAccDescription(this.$);
498
+ break;
499
+ case 27:
500
+ if (!yy.subgraphDepth) {
501
+ yy.setDirection($$[$0].value);
502
+ this.$ = [];
503
+ } else this.$ = $$[$0];
504
+ break;
505
+ case 31:
506
+ yy.subgraphDepth = (yy.subgraphDepth || 1) - 1;
507
+ this.$ = yy.addSubGraph({ text: $$[$0 - 2].id }, $$[$0 - 1], { text: $$[$0 - 2].text });
508
+ break;
509
+ case 32:
510
+ yy.subgraphDepth = (yy.subgraphDepth || 0) + 1;
511
+ this.$ = {
512
+ id: $$[$0 - 1],
513
+ text: $$[$0 - 1]
514
+ };
515
+ break;
516
+ case 33:
517
+ yy.subgraphDepth = (yy.subgraphDepth || 0) + 1;
518
+ this.$ = {
519
+ id: $$[$0 - 4],
520
+ text: $$[$0 - 2]
521
+ };
522
+ break;
523
+ case 34:
524
+ case 59:
525
+ case 60:
526
+ case 61:
527
+ case 62:
528
+ case 86:
529
+ this.$ = $$[$0];
530
+ break;
531
+ case 35:
532
+ this.$ = $$[$0 - 1] + " " + $$[$0];
533
+ break;
534
+ case 36:
535
+ this.$ = {
536
+ stmt: "dir",
537
+ value: "TB"
538
+ };
539
+ break;
540
+ case 37:
541
+ this.$ = {
542
+ stmt: "dir",
543
+ value: "BT"
544
+ };
545
+ break;
546
+ case 38:
547
+ this.$ = {
548
+ stmt: "dir",
549
+ value: "RL"
550
+ };
551
+ break;
552
+ case 39:
553
+ this.$ = {
554
+ stmt: "dir",
555
+ value: "LR"
556
+ };
557
+ break;
558
+ case 40:
559
+ this.$ = $$[$0 - 3];
560
+ yy.addClass($$[$0 - 2], $$[$0 - 1]);
561
+ break;
562
+ case 41:
563
+ case 42:
564
+ case 63:
565
+ case 72:
566
+ this.$ = [$$[$0]];
567
+ break;
568
+ case 43:
569
+ case 44:
570
+ this.$ = $$[$0 - 2].concat([$$[$0]]);
571
+ break;
572
+ case 45:
573
+ this.$ = $$[$0 - 2];
574
+ yy.setClass($$[$0 - 1], $$[$0]);
575
+ break;
576
+ case 46:
577
+ this.$ = $$[$0 - 3];
578
+ yy.addCssStyles($$[$0 - 2], $$[$0 - 1]);
579
+ break;
580
+ case 47:
581
+ this.$ = [$$[$0]];
582
+ break;
583
+ case 48:
584
+ $$[$0 - 2].push($$[$0]);
585
+ this.$ = $$[$0 - 2];
586
+ break;
587
+ case 50:
588
+ this.$ = $$[$0 - 1] + $$[$0];
589
+ break;
590
+ case 58:
591
+ case 84:
592
+ case 85:
593
+ this.$ = $$[$0].replace(/"/g, "");
594
+ break;
595
+ case 64:
596
+ $$[$0].push($$[$0 - 1]);
597
+ this.$ = $$[$0];
598
+ break;
599
+ case 65:
600
+ this.$ = {
601
+ type: $$[$0 - 1],
602
+ name: $$[$0]
603
+ };
604
+ break;
605
+ case 66:
606
+ this.$ = {
607
+ type: $$[$0 - 2],
608
+ name: $$[$0 - 1],
609
+ keys: $$[$0]
610
+ };
611
+ break;
612
+ case 67:
613
+ this.$ = {
614
+ type: $$[$0 - 2],
615
+ name: $$[$0 - 1],
616
+ comment: $$[$0]
617
+ };
618
+ break;
619
+ case 68:
620
+ this.$ = {
621
+ type: $$[$0 - 3],
622
+ name: $$[$0 - 2],
623
+ keys: $$[$0 - 1],
624
+ comment: $$[$0]
625
+ };
626
+ break;
627
+ case 69:
628
+ case 71:
629
+ case 74:
630
+ this.$ = $$[$0];
631
+ break;
632
+ case 70:
633
+ this.$ = $$[$0 - 1] + $$[$0];
634
+ break;
635
+ case 73:
636
+ $$[$0 - 2].push($$[$0]);
637
+ this.$ = $$[$0 - 2];
638
+ break;
639
+ case 75:
640
+ this.$ = $$[$0].replace(/"/g, "");
641
+ break;
642
+ case 76:
643
+ this.$ = {
644
+ cardA: $$[$0],
645
+ relType: $$[$0 - 1],
646
+ cardB: $$[$0 - 2]
647
+ };
648
+ break;
649
+ case 77:
650
+ this.$ = yy.Cardinality.ZERO_OR_ONE;
651
+ break;
652
+ case 78:
653
+ this.$ = yy.Cardinality.ZERO_OR_MORE;
654
+ break;
655
+ case 79:
656
+ this.$ = yy.Cardinality.ONE_OR_MORE;
657
+ break;
658
+ case 80:
659
+ this.$ = yy.Cardinality.ONLY_ONE;
660
+ break;
661
+ case 81:
662
+ this.$ = yy.Cardinality.MD_PARENT;
663
+ break;
664
+ case 82:
665
+ this.$ = yy.Identification.NON_IDENTIFYING;
666
+ break;
667
+ case 83: this.$ = yy.Identification.IDENTIFYING;
668
+ }
669
+ }, "anonymous"),
670
+ table: [
671
+ {
672
+ 3: 1,
673
+ 4: [1, 2]
674
+ },
675
+ { 1: [3] },
676
+ o($V0, $V1, { 5: 3 }),
677
+ {
678
+ 6: [1, 4],
679
+ 7: 5,
680
+ 8: 6,
681
+ 9: $V2,
682
+ 10: 8,
683
+ 21: $V3,
684
+ 23: $V4,
685
+ 25: $V5,
686
+ 27: $V6,
687
+ 28: 13,
688
+ 29: 14,
689
+ 30: 15,
690
+ 31: 16,
691
+ 32: 17,
692
+ 34: $V7,
693
+ 37: $V8,
694
+ 38: $V9,
695
+ 39: $Va,
696
+ 40: $Vb,
697
+ 41: $Vc,
698
+ 43: $Vd,
699
+ 46: $Ve,
700
+ 47: $Vf,
701
+ 51: $Vg,
702
+ 53: $Vh,
703
+ 54: $Vi,
704
+ 55: $Vj
705
+ },
706
+ o($V0, $Vk, { 1: [2, 1] }),
707
+ o($Vl, [2, 3]),
708
+ o($Vl, [2, 4]),
709
+ o($Vl, [2, 5]),
710
+ o($Vl, [2, 15], {
711
+ 11: 31,
712
+ 67: 35,
713
+ 14: [1, 32],
714
+ 16: [1, 33],
715
+ 19: [1, 34],
716
+ 69: $Vm,
717
+ 70: $Vn,
718
+ 71: $Vo,
719
+ 72: $Vp,
720
+ 73: $Vq
721
+ }),
722
+ { 22: [1, 41] },
723
+ { 24: [1, 42] },
724
+ { 26: [1, 43] },
725
+ o($Vl, [2, 26]),
726
+ o($Vl, [2, 27]),
727
+ o($Vl, [2, 28]),
728
+ o($Vl, [2, 29]),
729
+ o($Vl, [2, 30]),
730
+ o($Vl, $V1, { 5: 44 }),
731
+ o($Vr, [2, 58]),
732
+ o($Vr, [2, 59]),
733
+ o($Vr, [2, 60]),
734
+ o($Vr, [2, 61]),
735
+ o($Vr, [2, 62]),
736
+ o($Vl, [2, 36]),
737
+ o($Vl, [2, 37]),
738
+ o($Vl, [2, 38]),
739
+ o($Vl, [2, 39]),
740
+ {
741
+ 15: 45,
742
+ 43: $Vs,
743
+ 44: $Vt
744
+ },
745
+ {
746
+ 15: 48,
747
+ 43: $Vs,
748
+ 44: $Vt
749
+ },
750
+ {
751
+ 15: 49,
752
+ 43: $Vs,
753
+ 44: $Vt
754
+ },
755
+ {
756
+ 10: 50,
757
+ 43: $Vd,
758
+ 51: $Vg,
759
+ 53: $Vh,
760
+ 54: $Vi,
761
+ 55: $Vj
762
+ },
763
+ {
764
+ 10: 51,
765
+ 43: $Vd,
766
+ 51: $Vg,
767
+ 53: $Vh,
768
+ 54: $Vi,
769
+ 55: $Vj
770
+ },
771
+ {
772
+ 15: 52,
773
+ 43: $Vs,
774
+ 44: $Vt
775
+ },
776
+ {
777
+ 17: 53,
778
+ 18: [1, 54],
779
+ 56: 55,
780
+ 57: 56,
781
+ 61: $Vu
782
+ },
783
+ {
784
+ 10: 58,
785
+ 43: $Vd,
786
+ 51: $Vg,
787
+ 53: $Vh,
788
+ 54: $Vi,
789
+ 55: $Vj
790
+ },
791
+ {
792
+ 68: 59,
793
+ 74: [1, 60],
794
+ 75: [1, 61]
795
+ },
796
+ o($Vv, [2, 77]),
797
+ o($Vv, [2, 78]),
798
+ o($Vv, [2, 79]),
799
+ o($Vv, [2, 80]),
800
+ o($Vv, [2, 81]),
801
+ o($Vl, [2, 23]),
802
+ o($Vl, [2, 24]),
803
+ o($Vl, [2, 25]),
804
+ {
805
+ 6: [1, 63],
806
+ 7: 5,
807
+ 8: 6,
808
+ 9: $V2,
809
+ 10: 8,
810
+ 21: $V3,
811
+ 23: $V4,
812
+ 25: $V5,
813
+ 27: $V6,
814
+ 28: 13,
815
+ 29: 14,
816
+ 30: 15,
817
+ 31: 16,
818
+ 32: 17,
819
+ 33: [1, 62],
820
+ 34: $V7,
821
+ 37: $V8,
822
+ 38: $V9,
823
+ 39: $Va,
824
+ 40: $Vb,
825
+ 41: $Vc,
826
+ 43: $Vd,
827
+ 46: $Ve,
828
+ 47: $Vf,
829
+ 51: $Vg,
830
+ 53: $Vh,
831
+ 54: $Vi,
832
+ 55: $Vj
833
+ },
834
+ {
835
+ 12: $Vw,
836
+ 42: 64,
837
+ 44: $Vx,
838
+ 45: $Vy,
839
+ 48: 66,
840
+ 49: 67,
841
+ 51: $Vz,
842
+ 52: $VA
843
+ },
844
+ o($VB, [2, 41]),
845
+ o($VB, [2, 42]),
846
+ {
847
+ 15: 72,
848
+ 43: $Vs,
849
+ 44: $Vt,
850
+ 45: $Vy
851
+ },
852
+ {
853
+ 12: $Vw,
854
+ 42: 73,
855
+ 44: $Vx,
856
+ 45: $Vy,
857
+ 48: 66,
858
+ 49: 67,
859
+ 51: $Vz,
860
+ 52: $VA
861
+ },
862
+ {
863
+ 6: $VC,
864
+ 9: $VD,
865
+ 19: [1, 75],
866
+ 35: 74,
867
+ 50: $VE
868
+ },
869
+ {
870
+ 12: [1, 79],
871
+ 14: [1, 80]
872
+ },
873
+ o($Vl, [2, 16], {
874
+ 67: 35,
875
+ 11: 81,
876
+ 16: [1, 82],
877
+ 45: $Vy,
878
+ 69: $Vm,
879
+ 70: $Vn,
880
+ 71: $Vo,
881
+ 72: $Vp,
882
+ 73: $Vq
883
+ }),
884
+ { 18: [1, 83] },
885
+ o($Vl, [2, 13]),
886
+ {
887
+ 17: 84,
888
+ 18: [2, 63],
889
+ 56: 55,
890
+ 57: 56,
891
+ 61: $Vu
892
+ },
893
+ {
894
+ 58: 85,
895
+ 61: [1, 86]
896
+ },
897
+ {
898
+ 61: [2, 69],
899
+ 62: [1, 87]
900
+ },
901
+ { 20: [1, 88] },
902
+ {
903
+ 67: 89,
904
+ 69: $Vm,
905
+ 70: $Vn,
906
+ 71: $Vo,
907
+ 72: $Vp,
908
+ 73: $Vq
909
+ },
910
+ o($VF, [2, 82]),
911
+ o($VF, [2, 83]),
912
+ o($Vl, [2, 31]),
913
+ o($Vl, $Vk),
914
+ {
915
+ 6: $VC,
916
+ 9: $VD,
917
+ 35: 90,
918
+ 45: $VG,
919
+ 50: $VE
920
+ },
921
+ {
922
+ 43: [1, 92],
923
+ 44: [1, 93]
924
+ },
925
+ o($VH, [2, 47], {
926
+ 49: 94,
927
+ 12: $Vw,
928
+ 44: $Vx,
929
+ 51: $Vz,
930
+ 52: $VA
931
+ }),
932
+ o($VI, [2, 49]),
933
+ o($VI, [2, 54]),
934
+ o($VI, [2, 55]),
935
+ o($VI, [2, 56]),
936
+ o($VI, [2, 57]),
937
+ o($Vl, [2, 45], { 45: $Vy }),
938
+ {
939
+ 6: $VC,
940
+ 9: $VD,
941
+ 35: 95,
942
+ 45: $VG,
943
+ 50: $VE
944
+ },
945
+ o($Vl, [2, 32]),
946
+ {
947
+ 10: 97,
948
+ 36: 96,
949
+ 43: $Vd,
950
+ 51: $Vg,
951
+ 53: $Vh,
952
+ 54: $Vi,
953
+ 55: $Vj
954
+ },
955
+ o($Vl, [2, 51]),
956
+ o($Vl, [2, 52]),
957
+ o($Vl, [2, 53]),
958
+ {
959
+ 13: 98,
960
+ 43: $VJ,
961
+ 53: $VK,
962
+ 76: $VL
963
+ },
964
+ {
965
+ 15: 102,
966
+ 43: $Vs,
967
+ 44: $Vt
968
+ },
969
+ {
970
+ 10: 103,
971
+ 43: $Vd,
972
+ 51: $Vg,
973
+ 53: $Vh,
974
+ 54: $Vi,
975
+ 55: $Vj
976
+ },
977
+ {
978
+ 17: 104,
979
+ 18: [1, 105],
980
+ 56: 55,
981
+ 57: 56,
982
+ 61: $Vu
983
+ },
984
+ o($Vl, [2, 11]),
985
+ { 18: [2, 64] },
986
+ o($VM, [2, 65], {
987
+ 59: 106,
988
+ 60: 107,
989
+ 63: 108,
990
+ 65: $VN,
991
+ 66: $VO
992
+ }),
993
+ o([
994
+ 18,
995
+ 61,
996
+ 65,
997
+ 66
998
+ ], [2, 71]),
999
+ { 61: [2, 70] },
1000
+ o($Vl, [2, 21], {
1001
+ 14: [1, 112],
1002
+ 16: [1, 111]
1003
+ }),
1004
+ o([
1005
+ 43,
1006
+ 51,
1007
+ 53,
1008
+ 54,
1009
+ 55
1010
+ ], [2, 76]),
1011
+ o($Vl, [2, 40]),
1012
+ {
1013
+ 12: $Vw,
1014
+ 44: $Vx,
1015
+ 48: 113,
1016
+ 49: 67,
1017
+ 51: $Vz,
1018
+ 52: $VA
1019
+ },
1020
+ o($VB, [2, 43]),
1021
+ o($VB, [2, 44]),
1022
+ o($VI, [2, 50]),
1023
+ o($Vl, [2, 46]),
1024
+ {
1025
+ 10: 115,
1026
+ 20: [1, 114],
1027
+ 43: $Vd,
1028
+ 51: $Vg,
1029
+ 53: $Vh,
1030
+ 54: $Vi,
1031
+ 55: $Vj
1032
+ },
1033
+ o($VP, [2, 34]),
1034
+ o($Vl, [2, 7]),
1035
+ o($Vl, [2, 84]),
1036
+ o($Vl, [2, 85]),
1037
+ o($Vl, [2, 86]),
1038
+ {
1039
+ 12: [1, 116],
1040
+ 45: $Vy
1041
+ },
1042
+ {
1043
+ 12: [1, 118],
1044
+ 14: [1, 117]
1045
+ },
1046
+ { 18: [1, 119] },
1047
+ o($Vl, [2, 14]),
1048
+ o($VM, [2, 66], {
1049
+ 60: 120,
1050
+ 64: [1, 121],
1051
+ 66: $VO
1052
+ }),
1053
+ o($VM, [2, 67]),
1054
+ o($VQ, [2, 72]),
1055
+ o($VM, [2, 75]),
1056
+ o($VQ, [2, 74]),
1057
+ {
1058
+ 17: 122,
1059
+ 18: [1, 123],
1060
+ 56: 55,
1061
+ 57: 56,
1062
+ 61: $Vu
1063
+ },
1064
+ {
1065
+ 15: 124,
1066
+ 43: $Vs,
1067
+ 44: $Vt
1068
+ },
1069
+ o($VH, [2, 48], {
1070
+ 49: 94,
1071
+ 12: $Vw,
1072
+ 44: $Vx,
1073
+ 51: $Vz,
1074
+ 52: $VA
1075
+ }),
1076
+ {
1077
+ 6: $VC,
1078
+ 9: $VD,
1079
+ 35: 125,
1080
+ 50: $VE
1081
+ },
1082
+ o($VP, [2, 35]),
1083
+ {
1084
+ 13: 126,
1085
+ 43: $VJ,
1086
+ 53: $VK,
1087
+ 76: $VL
1088
+ },
1089
+ {
1090
+ 15: 127,
1091
+ 43: $Vs,
1092
+ 44: $Vt
1093
+ },
1094
+ {
1095
+ 13: 128,
1096
+ 43: $VJ,
1097
+ 53: $VK,
1098
+ 76: $VL
1099
+ },
1100
+ o($Vl, [2, 12]),
1101
+ o($VM, [2, 68]),
1102
+ {
1103
+ 63: 129,
1104
+ 65: $VN
1105
+ },
1106
+ { 18: [1, 130] },
1107
+ o($Vl, [2, 19]),
1108
+ o($Vl, [2, 22], {
1109
+ 16: [1, 131],
1110
+ 45: $Vy
1111
+ }),
1112
+ o($Vl, [2, 33]),
1113
+ o($Vl, [2, 10]),
1114
+ {
1115
+ 12: [1, 132],
1116
+ 45: $Vy
1117
+ },
1118
+ o($Vl, [2, 9]),
1119
+ o($VQ, [2, 73]),
1120
+ o($Vl, [2, 17]),
1121
+ {
1122
+ 17: 133,
1123
+ 18: [1, 134],
1124
+ 56: 55,
1125
+ 57: 56,
1126
+ 61: $Vu
1127
+ },
1128
+ {
1129
+ 13: 135,
1130
+ 43: $VJ,
1131
+ 53: $VK,
1132
+ 76: $VL
1133
+ },
1134
+ { 18: [1, 136] },
1135
+ o($Vl, [2, 20]),
1136
+ o($Vl, [2, 8]),
1137
+ o($Vl, [2, 18])
1138
+ ],
1139
+ defaultActions: {
1140
+ 84: [2, 64],
1141
+ 87: [2, 70]
1142
+ },
1143
+ parseError: /* @__PURE__ */ __name(function parseError(str, hash) {
1144
+ if (hash.recoverable) this.trace(str);
1145
+ else {
1146
+ var error = new Error(str);
1147
+ error.hash = hash;
1148
+ throw error;
1149
+ }
1150
+ }, "parseError"),
1151
+ parse: /* @__PURE__ */ __name(function parse(input) {
1152
+ var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;
1153
+ var args = lstack.slice.call(arguments, 1);
1154
+ var lexer2 = Object.create(this.lexer);
1155
+ var sharedState = { yy: {} };
1156
+ for (var k in this.yy) if (Object.prototype.hasOwnProperty.call(this.yy, k)) sharedState.yy[k] = this.yy[k];
1157
+ lexer2.setInput(input, sharedState.yy);
1158
+ sharedState.yy.lexer = lexer2;
1159
+ sharedState.yy.parser = this;
1160
+ if (typeof lexer2.yylloc == "undefined") lexer2.yylloc = {};
1161
+ var yyloc = lexer2.yylloc;
1162
+ lstack.push(yyloc);
1163
+ var ranges = lexer2.options && lexer2.options.ranges;
1164
+ if (typeof sharedState.yy.parseError === "function") this.parseError = sharedState.yy.parseError;
1165
+ else this.parseError = Object.getPrototypeOf(this).parseError;
1166
+ function popStack(n) {
1167
+ stack.length = stack.length - 2 * n;
1168
+ vstack.length = vstack.length - n;
1169
+ lstack.length = lstack.length - n;
1170
+ }
1171
+ __name(popStack, "popStack");
1172
+ function lex() {
1173
+ var token = tstack.pop() || lexer2.lex() || EOF;
1174
+ if (typeof token !== "number") {
1175
+ if (token instanceof Array) {
1176
+ tstack = token;
1177
+ token = tstack.pop();
1178
+ }
1179
+ token = self.symbols_[token] || token;
1180
+ }
1181
+ return token;
1182
+ }
1183
+ __name(lex, "lex");
1184
+ var symbol, preErrorSymbol, state, action, r, yyval = {}, p, len, newState, expected;
1185
+ while (true) {
1186
+ state = stack[stack.length - 1];
1187
+ if (this.defaultActions[state]) action = this.defaultActions[state];
1188
+ else {
1189
+ if (symbol === null || typeof symbol == "undefined") symbol = lex();
1190
+ action = table[state] && table[state][symbol];
1191
+ }
1192
+ if (typeof action === "undefined" || !action.length || !action[0]) {
1193
+ var errStr = "";
1194
+ expected = [];
1195
+ for (p in table[state]) if (this.terminals_[p] && p > TERROR) expected.push("'" + this.terminals_[p] + "'");
1196
+ if (lexer2.showPosition) errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer2.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
1197
+ else errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'");
1198
+ this.parseError(errStr, {
1199
+ text: lexer2.match,
1200
+ token: this.terminals_[symbol] || symbol,
1201
+ line: lexer2.yylineno,
1202
+ loc: yyloc,
1203
+ expected
1204
+ });
1205
+ }
1206
+ if (action[0] instanceof Array && action.length > 1) throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
1207
+ switch (action[0]) {
1208
+ case 1:
1209
+ stack.push(symbol);
1210
+ vstack.push(lexer2.yytext);
1211
+ lstack.push(lexer2.yylloc);
1212
+ stack.push(action[1]);
1213
+ symbol = null;
1214
+ if (!preErrorSymbol) {
1215
+ yyleng = lexer2.yyleng;
1216
+ yytext = lexer2.yytext;
1217
+ yylineno = lexer2.yylineno;
1218
+ yyloc = lexer2.yylloc;
1219
+ if (recovering > 0) recovering--;
1220
+ } else {
1221
+ symbol = preErrorSymbol;
1222
+ preErrorSymbol = null;
1223
+ }
1224
+ break;
1225
+ case 2:
1226
+ len = this.productions_[action[1]][1];
1227
+ yyval.$ = vstack[vstack.length - len];
1228
+ yyval._$ = {
1229
+ first_line: lstack[lstack.length - (len || 1)].first_line,
1230
+ last_line: lstack[lstack.length - 1].last_line,
1231
+ first_column: lstack[lstack.length - (len || 1)].first_column,
1232
+ last_column: lstack[lstack.length - 1].last_column
1233
+ };
1234
+ if (ranges) yyval._$.range = [lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1]];
1235
+ r = this.performAction.apply(yyval, [
1236
+ yytext,
1237
+ yyleng,
1238
+ yylineno,
1239
+ sharedState.yy,
1240
+ action[1],
1241
+ vstack,
1242
+ lstack
1243
+ ].concat(args));
1244
+ if (typeof r !== "undefined") return r;
1245
+ if (len) {
1246
+ stack = stack.slice(0, -1 * len * 2);
1247
+ vstack = vstack.slice(0, -1 * len);
1248
+ lstack = lstack.slice(0, -1 * len);
1249
+ }
1250
+ stack.push(this.productions_[action[1]][0]);
1251
+ vstack.push(yyval.$);
1252
+ lstack.push(yyval._$);
1253
+ newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
1254
+ stack.push(newState);
1255
+ break;
1256
+ case 3: return true;
1257
+ }
1258
+ }
1259
+ return true;
1260
+ }, "parse")
1261
+ };
1262
+ parser2.lexer = /* @__PURE__ */ (function() {
1263
+ return {
1264
+ EOF: 1,
1265
+ parseError: /* @__PURE__ */ __name(function parseError(str, hash) {
1266
+ if (this.yy.parser) this.yy.parser.parseError(str, hash);
1267
+ else throw new Error(str);
1268
+ }, "parseError"),
1269
+ setInput: /* @__PURE__ */ __name(function(input, yy) {
1270
+ this.yy = yy || this.yy || {};
1271
+ this._input = input;
1272
+ this._more = this._backtrack = this.done = false;
1273
+ this.yylineno = this.yyleng = 0;
1274
+ this.yytext = this.matched = this.match = "";
1275
+ this.conditionStack = ["INITIAL"];
1276
+ this.yylloc = {
1277
+ first_line: 1,
1278
+ first_column: 0,
1279
+ last_line: 1,
1280
+ last_column: 0
1281
+ };
1282
+ if (this.options.ranges) this.yylloc.range = [0, 0];
1283
+ this.offset = 0;
1284
+ return this;
1285
+ }, "setInput"),
1286
+ input: /* @__PURE__ */ __name(function() {
1287
+ var ch = this._input[0];
1288
+ this.yytext += ch;
1289
+ this.yyleng++;
1290
+ this.offset++;
1291
+ this.match += ch;
1292
+ this.matched += ch;
1293
+ if (ch.match(/(?:\r\n?|\n).*/g)) {
1294
+ this.yylineno++;
1295
+ this.yylloc.last_line++;
1296
+ } else this.yylloc.last_column++;
1297
+ if (this.options.ranges) this.yylloc.range[1]++;
1298
+ this._input = this._input.slice(1);
1299
+ return ch;
1300
+ }, "input"),
1301
+ unput: /* @__PURE__ */ __name(function(ch) {
1302
+ var len = ch.length;
1303
+ var lines = ch.split(/(?:\r\n?|\n)/g);
1304
+ this._input = ch + this._input;
1305
+ this.yytext = this.yytext.substr(0, this.yytext.length - len);
1306
+ this.offset -= len;
1307
+ var oldLines = this.match.split(/(?:\r\n?|\n)/g);
1308
+ this.match = this.match.substr(0, this.match.length - 1);
1309
+ this.matched = this.matched.substr(0, this.matched.length - 1);
1310
+ if (lines.length - 1) this.yylineno -= lines.length - 1;
1311
+ var r = this.yylloc.range;
1312
+ this.yylloc = {
1313
+ first_line: this.yylloc.first_line,
1314
+ last_line: this.yylineno + 1,
1315
+ first_column: this.yylloc.first_column,
1316
+ 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
1317
+ };
1318
+ if (this.options.ranges) this.yylloc.range = [r[0], r[0] + this.yyleng - len];
1319
+ this.yyleng = this.yytext.length;
1320
+ return this;
1321
+ }, "unput"),
1322
+ more: /* @__PURE__ */ __name(function() {
1323
+ this._more = true;
1324
+ return this;
1325
+ }, "more"),
1326
+ reject: /* @__PURE__ */ __name(function() {
1327
+ if (this.options.backtrack_lexer) this._backtrack = true;
1328
+ else return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + this.showPosition(), {
1329
+ text: "",
1330
+ token: null,
1331
+ line: this.yylineno
1332
+ });
1333
+ return this;
1334
+ }, "reject"),
1335
+ less: /* @__PURE__ */ __name(function(n) {
1336
+ this.unput(this.match.slice(n));
1337
+ }, "less"),
1338
+ pastInput: /* @__PURE__ */ __name(function() {
1339
+ var past = this.matched.substr(0, this.matched.length - this.match.length);
1340
+ return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, "");
1341
+ }, "pastInput"),
1342
+ upcomingInput: /* @__PURE__ */ __name(function() {
1343
+ var next = this.match;
1344
+ if (next.length < 20) next += this._input.substr(0, 20 - next.length);
1345
+ return (next.substr(0, 20) + (next.length > 20 ? "..." : "")).replace(/\n/g, "");
1346
+ }, "upcomingInput"),
1347
+ showPosition: /* @__PURE__ */ __name(function() {
1348
+ var pre = this.pastInput();
1349
+ var c = new Array(pre.length + 1).join("-");
1350
+ return pre + this.upcomingInput() + "\n" + c + "^";
1351
+ }, "showPosition"),
1352
+ test_match: /* @__PURE__ */ __name(function(match, indexed_rule) {
1353
+ var token, lines, backup;
1354
+ if (this.options.backtrack_lexer) {
1355
+ backup = {
1356
+ yylineno: this.yylineno,
1357
+ yylloc: {
1358
+ first_line: this.yylloc.first_line,
1359
+ last_line: this.last_line,
1360
+ first_column: this.yylloc.first_column,
1361
+ last_column: this.yylloc.last_column
1362
+ },
1363
+ yytext: this.yytext,
1364
+ match: this.match,
1365
+ matches: this.matches,
1366
+ matched: this.matched,
1367
+ yyleng: this.yyleng,
1368
+ offset: this.offset,
1369
+ _more: this._more,
1370
+ _input: this._input,
1371
+ yy: this.yy,
1372
+ conditionStack: this.conditionStack.slice(0),
1373
+ done: this.done
1374
+ };
1375
+ if (this.options.ranges) backup.yylloc.range = this.yylloc.range.slice(0);
1376
+ }
1377
+ lines = match[0].match(/(?:\r\n?|\n).*/g);
1378
+ if (lines) this.yylineno += lines.length;
1379
+ this.yylloc = {
1380
+ first_line: this.yylloc.last_line,
1381
+ last_line: this.yylineno + 1,
1382
+ first_column: this.yylloc.last_column,
1383
+ last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length
1384
+ };
1385
+ this.yytext += match[0];
1386
+ this.match += match[0];
1387
+ this.matches = match;
1388
+ this.yyleng = this.yytext.length;
1389
+ if (this.options.ranges) this.yylloc.range = [this.offset, this.offset += this.yyleng];
1390
+ this._more = false;
1391
+ this._backtrack = false;
1392
+ this._input = this._input.slice(match[0].length);
1393
+ this.matched += match[0];
1394
+ token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
1395
+ if (this.done && this._input) this.done = false;
1396
+ if (token) return token;
1397
+ else if (this._backtrack) {
1398
+ for (var k in backup) this[k] = backup[k];
1399
+ return false;
1400
+ }
1401
+ return false;
1402
+ }, "test_match"),
1403
+ next: /* @__PURE__ */ __name(function() {
1404
+ if (this.done) return this.EOF;
1405
+ if (!this._input) this.done = true;
1406
+ var token, match, tempMatch, index;
1407
+ if (!this._more) {
1408
+ this.yytext = "";
1409
+ this.match = "";
1410
+ }
1411
+ var rules = this._currentRules();
1412
+ for (var i = 0; i < rules.length; i++) {
1413
+ tempMatch = this._input.match(this.rules[rules[i]]);
1414
+ if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
1415
+ match = tempMatch;
1416
+ index = i;
1417
+ if (this.options.backtrack_lexer) {
1418
+ token = this.test_match(tempMatch, rules[i]);
1419
+ if (token !== false) return token;
1420
+ else if (this._backtrack) {
1421
+ match = false;
1422
+ continue;
1423
+ } else return false;
1424
+ } else if (!this.options.flex) break;
1425
+ }
1426
+ }
1427
+ if (match) {
1428
+ token = this.test_match(match, rules[index]);
1429
+ if (token !== false) return token;
1430
+ return false;
1431
+ }
1432
+ if (this._input === "") return this.EOF;
1433
+ else return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), {
1434
+ text: "",
1435
+ token: null,
1436
+ line: this.yylineno
1437
+ });
1438
+ }, "next"),
1439
+ lex: /* @__PURE__ */ __name(function lex() {
1440
+ var r = this.next();
1441
+ if (r) return r;
1442
+ else return this.lex();
1443
+ }, "lex"),
1444
+ begin: /* @__PURE__ */ __name(function begin(condition) {
1445
+ this.conditionStack.push(condition);
1446
+ }, "begin"),
1447
+ popState: /* @__PURE__ */ __name(function popState() {
1448
+ if (this.conditionStack.length - 1 > 0) return this.conditionStack.pop();
1449
+ else return this.conditionStack[0];
1450
+ }, "popState"),
1451
+ _currentRules: /* @__PURE__ */ __name(function _currentRules() {
1452
+ if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
1453
+ else return this.conditions["INITIAL"].rules;
1454
+ }, "_currentRules"),
1455
+ topState: /* @__PURE__ */ __name(function topState(n) {
1456
+ n = this.conditionStack.length - 1 - Math.abs(n || 0);
1457
+ if (n >= 0) return this.conditionStack[n];
1458
+ else return "INITIAL";
1459
+ }, "topState"),
1460
+ pushState: /* @__PURE__ */ __name(function pushState(condition) {
1461
+ this.begin(condition);
1462
+ }, "pushState"),
1463
+ stateStackSize: /* @__PURE__ */ __name(function stateStackSize() {
1464
+ return this.conditionStack.length;
1465
+ }, "stateStackSize"),
1466
+ options: { "case-insensitive": true },
1467
+ performAction: /* @__PURE__ */ __name(function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
1468
+ switch ($avoiding_name_collisions) {
1469
+ case 0:
1470
+ this.begin("acc_title");
1471
+ return 23;
1472
+ case 1:
1473
+ this.popState();
1474
+ return "acc_title_value";
1475
+ case 2:
1476
+ this.begin("acc_descr");
1477
+ return 25;
1478
+ case 3:
1479
+ this.popState();
1480
+ return "acc_descr_value";
1481
+ case 4:
1482
+ this.begin("acc_descr_multiline");
1483
+ break;
1484
+ case 5:
1485
+ this.popState();
1486
+ break;
1487
+ case 6: return "acc_descr_multiline_value";
1488
+ case 7: return 37;
1489
+ case 8: return 38;
1490
+ case 9: return 39;
1491
+ case 10: return 40;
1492
+ case 11: break;
1493
+ case 12: return 9;
1494
+ case 13: return 53;
1495
+ case 14: return 76;
1496
+ case 15: return 4;
1497
+ case 16:
1498
+ this.begin("block");
1499
+ return 16;
1500
+ case 17: return 52;
1501
+ case 18: return 52;
1502
+ case 19: return 45;
1503
+ case 20: return 14;
1504
+ case 21: return 12;
1505
+ case 22: break;
1506
+ case 23: return 65;
1507
+ case 24: return 61;
1508
+ case 25: return 61;
1509
+ case 26:
1510
+ this.begin("block_bq");
1511
+ break;
1512
+ case 27: return 61;
1513
+ case 28:
1514
+ this.popState();
1515
+ break;
1516
+ case 29: return 66;
1517
+ case 30: break;
1518
+ case 31:
1519
+ this.popState();
1520
+ return 18;
1521
+ case 32: return yy_.yytext[0];
1522
+ case 33: return 19;
1523
+ case 34: return 20;
1524
+ case 35:
1525
+ this.begin("style");
1526
+ return 47;
1527
+ case 36:
1528
+ this.popState();
1529
+ return 9;
1530
+ case 37: break;
1531
+ case 38: return 12;
1532
+ case 39: return 45;
1533
+ case 40: return 52;
1534
+ case 41:
1535
+ this.begin("style");
1536
+ return 41;
1537
+ case 42: return 46;
1538
+ case 43: return 34;
1539
+ case 44: return 33;
1540
+ case 45: return 69;
1541
+ case 46: return 71;
1542
+ case 47: return 71;
1543
+ case 48: return 71;
1544
+ case 49: return 69;
1545
+ case 50: return 69;
1546
+ case 51: return 70;
1547
+ case 52: return 70;
1548
+ case 53: return 70;
1549
+ case 54: return 70;
1550
+ case 55: return 70;
1551
+ case 56: return 71;
1552
+ case 57: return 70;
1553
+ case 58: return 71;
1554
+ case 59: return 72;
1555
+ case 60: return 72;
1556
+ case 61: return 54;
1557
+ case 62: return 72;
1558
+ case 63: return 72;
1559
+ case 64: return 72;
1560
+ case 65: return 55;
1561
+ case 66: return 51;
1562
+ case 67: return 72;
1563
+ case 68: return 69;
1564
+ case 69: return 70;
1565
+ case 70: return 71;
1566
+ case 71: return 73;
1567
+ case 72: return 74;
1568
+ case 73: return 75;
1569
+ case 74: return 75;
1570
+ case 75: return 74;
1571
+ case 76: return 74;
1572
+ case 77: return 74;
1573
+ case 78: return 44;
1574
+ case 79: return 50;
1575
+ case 80: return 43;
1576
+ case 81: return yy_.yytext[0];
1577
+ case 82: return 6;
1578
+ }
1579
+ }, "anonymous"),
1580
+ rules: [
1581
+ /^(?:accTitle\s*:\s*)/i,
1582
+ /^(?:(?!\n||)*[^\n]*)/i,
1583
+ /^(?:accDescr\s*:\s*)/i,
1584
+ /^(?:(?!\n||)*[^\n]*)/i,
1585
+ /^(?:accDescr\s*\{\s*)/i,
1586
+ /^(?:[\}])/i,
1587
+ /^(?:[^\}]*)/i,
1588
+ /^(?:.*direction\s+TB[^\n]*)/i,
1589
+ /^(?:.*direction\s+BT[^\n]*)/i,
1590
+ /^(?:.*direction\s+RL[^\n]*)/i,
1591
+ /^(?:.*direction\s+LR[^\n]*)/i,
1592
+ /^(?:[ \t\r]+)/i,
1593
+ /^(?:[\n]+)/i,
1594
+ /^(?:"[^"%\r\n\v\b\\]+")/i,
1595
+ /^(?:"[^"]*")/i,
1596
+ /^(?:erDiagram\b)/i,
1597
+ /^(?:\{)/i,
1598
+ /^(?:#)/i,
1599
+ /^(?:#)/i,
1600
+ /^(?:,)/i,
1601
+ /^(?::::)/i,
1602
+ /^(?::)/i,
1603
+ /^(?:\s+)/i,
1604
+ /^(?:\b((?:PK)|(?:FK)|(?:UK))\b)/i,
1605
+ /^(?:([^\s]*)[~].*[~]([^\s]*))/i,
1606
+ /^(?:([\*A-Za-z_\u00C0-\uFFFF][A-Za-z0-9\-\_\[\]\(\)\.,\u00C0-\uFFFF\*]*))/i,
1607
+ /^(?:[`])/i,
1608
+ /^(?:[^`]+)/i,
1609
+ /^(?:[`])/i,
1610
+ /^(?:"[^"]*")/i,
1611
+ /^(?:[\n]+)/i,
1612
+ /^(?:\})/i,
1613
+ /^(?:.)/i,
1614
+ /^(?:\[)/i,
1615
+ /^(?:\])/i,
1616
+ /^(?:style\b)/i,
1617
+ /^(?:[\n]+)/i,
1618
+ /^(?:\s+)/i,
1619
+ /^(?::)/i,
1620
+ /^(?:,)/i,
1621
+ /^(?:#)/i,
1622
+ /^(?:classDef\b)/i,
1623
+ /^(?:class\b)/i,
1624
+ /^(?:subgraph\b)/i,
1625
+ /^(?:end\b\s*)/i,
1626
+ /^(?:one or zero\b)/i,
1627
+ /^(?:one or more\b)/i,
1628
+ /^(?:one or many\b)/i,
1629
+ /^(?:1\+)/i,
1630
+ /^(?:\|o\b)/i,
1631
+ /^(?:zero or one\b)/i,
1632
+ /^(?:zero or more\b)/i,
1633
+ /^(?:zero or many\b)/i,
1634
+ /^(?:0\+)/i,
1635
+ /^(?:\}o\b)/i,
1636
+ /^(?:many\(0\))/i,
1637
+ /^(?:many\(1\))/i,
1638
+ /^(?:many\b)/i,
1639
+ /^(?:\}\|)/i,
1640
+ /^(?:one\b)/i,
1641
+ /^(?:only one\b)/i,
1642
+ /^(?:[0-9]+\.[0-9]+)/i,
1643
+ /^(?:1(?=\s+[A-Za-z_"']))/i,
1644
+ /^(?:1(?=\s+[0-9]))/i,
1645
+ /^(?:1(?=(--|\.\.|\.-|-\.)))/i,
1646
+ /^(?:1\b)/i,
1647
+ /^(?:[0-9]+)/i,
1648
+ /^(?:\|\|)/i,
1649
+ /^(?:o\|)/i,
1650
+ /^(?:o\{)/i,
1651
+ /^(?:\|\{)/i,
1652
+ /^(?:u(?=[\.\-\|]))/i,
1653
+ /^(?:\.\.)/i,
1654
+ /^(?:--)/i,
1655
+ /^(?:to\b)/i,
1656
+ /^(?:optionally to\b)/i,
1657
+ /^(?:\.-)/i,
1658
+ /^(?:-\.)/i,
1659
+ /^(?:([^\x00-\x7F]|\w|-|\*)+)/i,
1660
+ /^(?:;)/i,
1661
+ /^(?:([^\x00-\x7F]|\w|-|\*|\.)+)/i,
1662
+ /^(?:.)/i,
1663
+ /^(?:$)/i
1664
+ ],
1665
+ conditions: {
1666
+ "style": {
1667
+ "rules": [
1668
+ 36,
1669
+ 37,
1670
+ 38,
1671
+ 39,
1672
+ 40,
1673
+ 78,
1674
+ 79
1675
+ ],
1676
+ "inclusive": false
1677
+ },
1678
+ "acc_descr_multiline": {
1679
+ "rules": [5, 6],
1680
+ "inclusive": false
1681
+ },
1682
+ "acc_descr": {
1683
+ "rules": [3],
1684
+ "inclusive": false
1685
+ },
1686
+ "acc_title": {
1687
+ "rules": [1],
1688
+ "inclusive": false
1689
+ },
1690
+ "block_bq": {
1691
+ "rules": [27, 28],
1692
+ "inclusive": false
1693
+ },
1694
+ "block": {
1695
+ "rules": [
1696
+ 22,
1697
+ 23,
1698
+ 24,
1699
+ 25,
1700
+ 26,
1701
+ 29,
1702
+ 30,
1703
+ 31,
1704
+ 32
1705
+ ],
1706
+ "inclusive": false
1707
+ },
1708
+ "INITIAL": {
1709
+ "rules": [
1710
+ 0,
1711
+ 2,
1712
+ 4,
1713
+ 7,
1714
+ 8,
1715
+ 9,
1716
+ 10,
1717
+ 11,
1718
+ 12,
1719
+ 13,
1720
+ 14,
1721
+ 15,
1722
+ 16,
1723
+ 17,
1724
+ 18,
1725
+ 19,
1726
+ 20,
1727
+ 21,
1728
+ 33,
1729
+ 34,
1730
+ 35,
1731
+ 41,
1732
+ 42,
1733
+ 43,
1734
+ 44,
1735
+ 45,
1736
+ 46,
1737
+ 47,
1738
+ 48,
1739
+ 49,
1740
+ 50,
1741
+ 51,
1742
+ 52,
1743
+ 53,
1744
+ 54,
1745
+ 55,
1746
+ 56,
1747
+ 57,
1748
+ 58,
1749
+ 59,
1750
+ 60,
1751
+ 61,
1752
+ 62,
1753
+ 63,
1754
+ 64,
1755
+ 65,
1756
+ 66,
1757
+ 67,
1758
+ 68,
1759
+ 69,
1760
+ 70,
1761
+ 71,
1762
+ 72,
1763
+ 73,
1764
+ 74,
1765
+ 75,
1766
+ 76,
1767
+ 77,
1768
+ 80,
1769
+ 81,
1770
+ 82
1771
+ ],
1772
+ "inclusive": true
1773
+ }
1774
+ }
1775
+ };
1776
+ })();
1777
+ function Parser() {
1778
+ this.yy = {};
1779
+ }
1780
+ __name(Parser, "Parser");
1781
+ Parser.prototype = parser2;
1782
+ parser2.Parser = Parser;
1783
+ return new Parser();
1784
+ })();
1785
+ parser.parser = parser;
1786
+ var erDiagram_default = parser;
1787
+ var ErDB = class {
1788
+ constructor() {
1789
+ this.entities = /* @__PURE__ */ new Map();
1790
+ this.relationships = [];
1791
+ this.classes = /* @__PURE__ */ new Map();
1792
+ this.subgraphDepth = 0;
1793
+ this.subGraphs = [];
1794
+ this.subGraphLookup = /* @__PURE__ */ new Map();
1795
+ this.subCount = 0;
1796
+ this.direction = "TB";
1797
+ this.Cardinality = {
1798
+ ZERO_OR_ONE: "ZERO_OR_ONE",
1799
+ ZERO_OR_MORE: "ZERO_OR_MORE",
1800
+ ONE_OR_MORE: "ONE_OR_MORE",
1801
+ ONLY_ONE: "ONLY_ONE",
1802
+ MD_PARENT: "MD_PARENT"
1803
+ };
1804
+ this.Identification = {
1805
+ NON_IDENTIFYING: "NON_IDENTIFYING",
1806
+ IDENTIFYING: "IDENTIFYING"
1807
+ };
1808
+ this.setAccTitle = setAccTitle;
1809
+ this.getAccTitle = getAccTitle;
1810
+ this.setAccDescription = setAccDescription;
1811
+ this.getAccDescription = getAccDescription;
1812
+ this.setDiagramTitle = setDiagramTitle;
1813
+ this.getDiagramTitle = getDiagramTitle;
1814
+ this.getConfig = /* @__PURE__ */ __name(() => getConfig2().er, "getConfig");
1815
+ this.clear();
1816
+ this.addEntity = this.addEntity.bind(this);
1817
+ this.addAttributes = this.addAttributes.bind(this);
1818
+ this.addRelationship = this.addRelationship.bind(this);
1819
+ this.setDirection = this.setDirection.bind(this);
1820
+ this.addCssStyles = this.addCssStyles.bind(this);
1821
+ this.addClass = this.addClass.bind(this);
1822
+ this.setClass = this.setClass.bind(this);
1823
+ this.setAccTitle = this.setAccTitle.bind(this);
1824
+ this.setAccDescription = this.setAccDescription.bind(this);
1825
+ this.addSubGraph = this.addSubGraph.bind(this);
1826
+ }
1827
+ static {
1828
+ __name(this, "ErDB");
1829
+ }
1830
+ /**
1831
+ * Add entity
1832
+ * @param name - The name of the entity
1833
+ * @param alias - The alias of the entity
1834
+ */
1835
+ addEntity(name, alias = "") {
1836
+ if (!this.entities.has(name)) {
1837
+ this.entities.set(name, {
1838
+ id: `entity-${name}-${this.entities.size}`,
1839
+ label: name,
1840
+ attributes: [],
1841
+ alias,
1842
+ shape: "erBox",
1843
+ look: getConfig2().look ?? "default",
1844
+ cssClasses: "default",
1845
+ cssStyles: [],
1846
+ labelType: "markdown"
1847
+ });
1848
+ log.info("Added new entity :", name);
1849
+ } else if (!this.entities.get(name)?.alias && alias) {
1850
+ this.entities.get(name).alias = alias;
1851
+ log.info(`Add alias '${alias}' to entity '${name}'`);
1852
+ }
1853
+ return this.entities.get(name);
1854
+ }
1855
+ getEntity(name) {
1856
+ return this.entities.get(name);
1857
+ }
1858
+ getEntities() {
1859
+ return this.entities;
1860
+ }
1861
+ getClasses() {
1862
+ return this.classes;
1863
+ }
1864
+ addAttributes(entityName, attribs) {
1865
+ const entity = this.addEntity(entityName);
1866
+ let i;
1867
+ for (i = attribs.length - 1; i >= 0; i--) {
1868
+ if (!attribs[i].keys) attribs[i].keys = [];
1869
+ if (!attribs[i].comment) attribs[i].comment = "";
1870
+ entity.attributes.push(attribs[i]);
1871
+ log.debug("Added attribute ", attribs[i].name);
1872
+ }
1873
+ }
1874
+ /**
1875
+ * Add a relationship
1876
+ *
1877
+ * @param entA - The first entity in the relationship
1878
+ * @param rolA - The role played by the first entity in relation to the second
1879
+ * @param entB - The second entity in the relationship
1880
+ * @param rSpec - The details of the relationship between the two entities
1881
+ */
1882
+ addRelationship(entA, rolA, entB, rSpec) {
1883
+ let entityAId;
1884
+ if (this.subGraphLookup.has(entA)) entityAId = entA;
1885
+ else {
1886
+ const entityA = this.addEntity(entA);
1887
+ if (!entityA) return;
1888
+ entityAId = entityA.id;
1889
+ }
1890
+ let entityBId;
1891
+ if (this.subGraphLookup.has(entB)) entityBId = entB;
1892
+ else {
1893
+ const entityB = this.addEntity(entB);
1894
+ if (!entityB) return;
1895
+ entityBId = entityB.id;
1896
+ }
1897
+ const rel = {
1898
+ entityA: entityAId,
1899
+ roleA: rolA,
1900
+ entityB: entityBId,
1901
+ relSpec: rSpec
1902
+ };
1903
+ this.relationships.push(rel);
1904
+ log.debug("Added new relationship :", rel);
1905
+ }
1906
+ getRelationships() {
1907
+ return this.relationships;
1908
+ }
1909
+ getDirection() {
1910
+ return this.direction;
1911
+ }
1912
+ setDirection(dir) {
1913
+ this.direction = dir;
1914
+ }
1915
+ getCompiledStyles(classDefs) {
1916
+ let compiledStyles = [];
1917
+ for (const customClass of classDefs) {
1918
+ const cssClass = this.classes.get(customClass);
1919
+ if (cssClass?.styles) compiledStyles = [...compiledStyles, ...cssClass.styles ?? []].map((s) => s.trim());
1920
+ if (cssClass?.textStyles) compiledStyles = [...compiledStyles, ...cssClass.textStyles ?? []].map((s) => s.trim());
1921
+ }
1922
+ return compiledStyles;
1923
+ }
1924
+ addCssStyles(ids, styles) {
1925
+ for (const id of ids) {
1926
+ const entity = this.entities.get(id);
1927
+ const subGraph = this.subGraphLookup.get(id);
1928
+ if (!styles) continue;
1929
+ if (entity) for (const style of styles) entity.cssStyles.push(style);
1930
+ if (subGraph) {
1931
+ if (!subGraph.cssStyles) subGraph.cssStyles = [];
1932
+ for (const style of styles) subGraph.cssStyles.push(style);
1933
+ }
1934
+ }
1935
+ }
1936
+ addClass(ids, style) {
1937
+ ids.forEach((id) => {
1938
+ let classNode = this.classes.get(id);
1939
+ if (classNode === void 0) {
1940
+ classNode = {
1941
+ id,
1942
+ styles: [],
1943
+ textStyles: []
1944
+ };
1945
+ this.classes.set(id, classNode);
1946
+ }
1947
+ if (style) style.forEach(function(s) {
1948
+ if (/color/.exec(s)) {
1949
+ const newStyle = s.replace("fill", "bgFill");
1950
+ classNode.textStyles.push(newStyle);
1951
+ }
1952
+ classNode.styles.push(s);
1953
+ });
1954
+ });
1955
+ }
1956
+ addSubGraph(_id, list, _title) {
1957
+ let id = _id.text.trim();
1958
+ let title = _title.text;
1959
+ const result = (/* @__PURE__ */ __name((a) => {
1960
+ const seen = /* @__PURE__ */ new Set();
1961
+ let dir2;
1962
+ return {
1963
+ nodeList: a.filter((item) => {
1964
+ if (item?.stmt) {
1965
+ if (item.stmt === "dir") dir2 = item.value;
1966
+ return false;
1967
+ }
1968
+ if (typeof item !== "string") return false;
1969
+ const trimmed = item.trim();
1970
+ if (!trimmed) return false;
1971
+ if (seen.has(trimmed)) return false;
1972
+ seen.add(trimmed);
1973
+ return true;
1974
+ }),
1975
+ dir: dir2
1976
+ };
1977
+ }, "uniq"))(list.flat());
1978
+ const nodeList = result.nodeList;
1979
+ const dir = result.dir;
1980
+ id = id ?? "subGraph" + this.subCount;
1981
+ title = title || "";
1982
+ title = this.sanitizeText(title);
1983
+ this.subCount = this.subCount + 1;
1984
+ const subGraph = {
1985
+ id,
1986
+ nodes: nodeList,
1987
+ title: title.trim(),
1988
+ classes: [],
1989
+ cssStyles: [],
1990
+ dir,
1991
+ labelType: this.sanitizeNodeLabelType(_title?.type)
1992
+ };
1993
+ log.info("Adding", subGraph.id, subGraph.nodes, subGraph.dir);
1994
+ subGraph.nodes = this.makeUniq(subGraph, this.subGraphs).nodes;
1995
+ this.subGraphs.push(subGraph);
1996
+ this.subGraphLookup.set(id, subGraph);
1997
+ return id;
1998
+ }
1999
+ getSubGraphs() {
2000
+ return this.subGraphs;
2001
+ }
2002
+ setClass(ids, classNames) {
2003
+ for (const id of ids) {
2004
+ const entity = this.entities.get(id);
2005
+ if (entity) for (const className of classNames) entity.cssClasses += " " + className;
2006
+ const subGraph = this.subGraphLookup.get(id);
2007
+ if (subGraph) for (const className of classNames) subGraph.classes.push(className);
2008
+ }
2009
+ }
2010
+ /**
2011
+ * Build a quick lookup for all node IDs already assigned to existing subgraphs.
2012
+ */
2013
+ subgraphNodeCache(allSubgraphs) {
2014
+ const nodeCache = /* @__PURE__ */ new Set();
2015
+ for (const subGraph of allSubgraphs) for (const id of subGraph.nodes) nodeCache.add(id);
2016
+ return nodeCache;
2017
+ }
2018
+ /**
2019
+ * Filter out nodes that are already part of another subgraph,
2020
+ * keeping subgraph membership unique.
2021
+ */
2022
+ makeUniq(subGraph, allSubgraphs) {
2023
+ const existingNodes = this.subgraphNodeCache(allSubgraphs);
2024
+ const res = [];
2025
+ subGraph.nodes.forEach((_id, pos) => {
2026
+ if (existingNodes.has(_id)) log.warn(`Entity '${_id}' already belongs to another subgraph and will be ignored`);
2027
+ else res.push(subGraph.nodes[pos]);
2028
+ });
2029
+ return { nodes: res };
2030
+ }
2031
+ sanitizeText(txt) {
2032
+ return common_default.sanitizeText(txt, getConfig2());
2033
+ }
2034
+ sanitizeNodeLabelType(labelType) {
2035
+ switch (labelType) {
2036
+ case "markdown":
2037
+ case "string":
2038
+ case "text": return labelType;
2039
+ default: return "markdown";
2040
+ }
2041
+ }
2042
+ clear() {
2043
+ this.entities = /* @__PURE__ */ new Map();
2044
+ this.classes = /* @__PURE__ */ new Map();
2045
+ this.relationships = [];
2046
+ this.subGraphs = [];
2047
+ this.subGraphLookup = /* @__PURE__ */ new Map();
2048
+ this.subCount = 0;
2049
+ this.subgraphDepth = 0;
2050
+ clear();
2051
+ }
2052
+ getData() {
2053
+ const nodes = [];
2054
+ const edges = [];
2055
+ const config = getConfig2();
2056
+ const subGraphs = this.getSubGraphs();
2057
+ const parentDB = /* @__PURE__ */ new Map();
2058
+ const subGraphDB = /* @__PURE__ */ new Map();
2059
+ for (let i = subGraphs.length - 1; i >= 0; i--) {
2060
+ const subGraph = subGraphs[i];
2061
+ if (subGraph.nodes.length > 0) subGraphDB.set(subGraph.id, true);
2062
+ for (const id of subGraph.nodes) parentDB.set(id, subGraph.id);
2063
+ }
2064
+ for (let i = subGraphs.length - 1; i >= 0; i--) {
2065
+ const subGraph = subGraphs[i];
2066
+ nodes.push({
2067
+ id: subGraph.id,
2068
+ label: subGraph.title,
2069
+ labelStyle: "",
2070
+ labelType: subGraph.labelType,
2071
+ parentId: parentDB.get(subGraph.id),
2072
+ padding: 8,
2073
+ cssCompiledStyles: this.getCompiledStyles(subGraph.classes),
2074
+ cssStyles: subGraph.cssStyles,
2075
+ cssClasses: subGraph.classes.join(" "),
2076
+ shape: "rect",
2077
+ dir: subGraph.dir,
2078
+ isGroup: true,
2079
+ look: config.look
2080
+ });
2081
+ }
2082
+ const subGraphIds = new Set(subGraphs.map((sg) => sg.id));
2083
+ let colorIndex = 0;
2084
+ for (const entityKey of this.entities.keys()) {
2085
+ if (subGraphIds.has(entityKey)) continue;
2086
+ const entityNode = this.entities.get(entityKey);
2087
+ if (entityNode) {
2088
+ entityNode.cssCompiledStyles = this.getCompiledStyles(entityNode.cssClasses.split(" "));
2089
+ entityNode.colorIndex = colorIndex++;
2090
+ nodes.push({
2091
+ ...entityNode,
2092
+ parentId: parentDB.get(entityKey),
2093
+ isGroup: false
2094
+ });
2095
+ }
2096
+ }
2097
+ let count = 0;
2098
+ for (const relationship of this.relationships) {
2099
+ const edge = {
2100
+ id: getEdgeId(relationship.entityA, relationship.entityB, {
2101
+ prefix: "id",
2102
+ counter: count++
2103
+ }),
2104
+ type: "normal",
2105
+ curve: "basis",
2106
+ start: relationship.entityA,
2107
+ end: relationship.entityB,
2108
+ label: relationship.roleA,
2109
+ labelpos: "c",
2110
+ thickness: "normal",
2111
+ classes: "relationshipLine",
2112
+ arrowTypeStart: relationship.relSpec.cardB.toLowerCase(),
2113
+ arrowTypeEnd: relationship.relSpec.cardA.toLowerCase(),
2114
+ pattern: relationship.relSpec.relType == "IDENTIFYING" ? "solid" : "dashed",
2115
+ look: config.look,
2116
+ labelType: "markdown"
2117
+ };
2118
+ edges.push(edge);
2119
+ }
2120
+ return {
2121
+ nodes,
2122
+ edges,
2123
+ other: {},
2124
+ config,
2125
+ direction: this.direction
2126
+ };
2127
+ }
2128
+ };
2129
+ var erRenderer_unified_exports = {};
2130
+ __export(erRenderer_unified_exports, { draw: () => draw });
2131
+ var draw = /* @__PURE__ */ __name(async function(text, id, _version, diag) {
2132
+ log.info("REF0:");
2133
+ log.info("Drawing er diagram (unified)", id);
2134
+ const { securityLevel, er: conf, layout } = getConfig2();
2135
+ const data4Layout = diag.db.getData();
2136
+ const svg = getDiagramElement(id, securityLevel);
2137
+ data4Layout.type = diag.type;
2138
+ data4Layout.layoutAlgorithm = getRegisteredLayoutAlgorithm(layout);
2139
+ data4Layout.config.flowchart.nodeSpacing = conf?.nodeSpacing || 140;
2140
+ data4Layout.config.flowchart.rankSpacing = conf?.rankSpacing || 80;
2141
+ data4Layout.direction = diag.db.getDirection();
2142
+ const { config } = data4Layout;
2143
+ const { look } = config;
2144
+ if (look === "neo") data4Layout.markers = [
2145
+ "only_one_neo",
2146
+ "zero_or_one_neo",
2147
+ "one_or_more_neo",
2148
+ "zero_or_more_neo"
2149
+ ];
2150
+ else data4Layout.markers = [
2151
+ "only_one",
2152
+ "zero_or_one",
2153
+ "one_or_more",
2154
+ "zero_or_more"
2155
+ ];
2156
+ data4Layout.diagramId = id;
2157
+ await render(data4Layout, svg);
2158
+ if (data4Layout.layoutAlgorithm === "elk") svg.select(".edges").lower();
2159
+ const backgroundNodes = svg.selectAll("[id*=\"-background\"]");
2160
+ if (Array.from(backgroundNodes).length > 0) backgroundNodes.each(function() {
2161
+ const backgroundNode = select_default(this);
2162
+ const nonBackgroundId = backgroundNode.attr("id").replace("-background", "");
2163
+ const nonBackgroundNode = svg.select(`#${CSS.escape(nonBackgroundId)}`);
2164
+ if (!nonBackgroundNode.empty()) {
2165
+ const transform = nonBackgroundNode.attr("transform");
2166
+ backgroundNode.attr("transform", transform);
2167
+ }
2168
+ });
2169
+ const padding = 8;
2170
+ utils_default.insertTitle(svg, "erDiagramTitleText", conf?.titleTopMargin ?? 25, diag.db.getDiagramTitle());
2171
+ setupViewPortForSVG(svg, padding, "erDiagram", conf?.useMaxWidth ?? true);
2172
+ }, "draw");
2173
+ var fade = /* @__PURE__ */ __name((color, opacity) => {
2174
+ const channel2 = channel;
2175
+ const r = channel2(color, "r");
2176
+ const g = channel2(color, "g");
2177
+ const b = channel2(color, "b");
2178
+ return rgba(r, g, b, opacity);
2179
+ }, "fade");
2180
+ var COLOR_THEMES = /* @__PURE__ */ new Set(["redux-color", "redux-dark-color"]);
2181
+ var genColor = /* @__PURE__ */ __name((options) => {
2182
+ const { theme, look, bkgColorArray, borderColorArray } = options;
2183
+ if (!COLOR_THEMES.has(theme)) return "";
2184
+ const hasBkgColors = bkgColorArray?.length > 0;
2185
+ let sections = "";
2186
+ for (let i = 0; i < options.THEME_COLOR_LIMIT; i++) sections += `
2187
+
2188
+ [data-look="${look}"][data-color-id="color-${i}"].node path {
2189
+ stroke: ${borderColorArray[i]};
2190
+ ${hasBkgColors ? `fill: ${bkgColorArray[i]};` : ""}
2191
+ }
2192
+
2193
+ [data-look="${look}"][data-color-id="color-${i}"].node rect {
2194
+ stroke: ${borderColorArray[i]};
2195
+ ${hasBkgColors ? `fill: ${bkgColorArray[i]};` : ""}
2196
+ }
2197
+ `;
2198
+ return sections;
2199
+ }, "genColor");
2200
+ var diagram = {
2201
+ parser: erDiagram_default,
2202
+ get db() {
2203
+ return new ErDB();
2204
+ },
2205
+ renderer: erRenderer_unified_exports,
2206
+ styles: /* @__PURE__ */ __name((options) => {
2207
+ const { look, theme, erEdgeLabelBackground, strokeWidth } = options;
2208
+ return `
2209
+ ${genColor(options)}
2210
+ .entityBox {
2211
+ fill: ${options.mainBkg};
2212
+ stroke: ${options.nodeBorder};
2213
+ }
2214
+
2215
+ .relationshipLabelBox {
2216
+ fill: ${options.tertiaryColor};
2217
+ opacity: 0.7;
2218
+ background-color: ${options.tertiaryColor};
2219
+ rect {
2220
+ opacity: 0.5;
2221
+ }
2222
+ }
2223
+
2224
+ .labelBkg {
2225
+ background-color: ${COLOR_THEMES.has(theme) && erEdgeLabelBackground ? erEdgeLabelBackground : fade(options.tertiaryColor, .5)};
2226
+ }
2227
+
2228
+ .edgeLabel {
2229
+ background-color: ${COLOR_THEMES.has(theme) && erEdgeLabelBackground ? erEdgeLabelBackground : options.edgeLabelBackground};
2230
+ }
2231
+ .edgeLabel .label rect {
2232
+ fill: ${COLOR_THEMES.has(theme) && erEdgeLabelBackground ? erEdgeLabelBackground : options.edgeLabelBackground};
2233
+ }
2234
+ .edgeLabel .label text {
2235
+ fill: ${options.textColor};
2236
+ }
2237
+
2238
+ .edgeLabel .label {
2239
+ fill: ${options.nodeBorder};
2240
+ font-size: 14px;
2241
+ }
2242
+
2243
+ .label {
2244
+ font-family: ${options.fontFamily};
2245
+ color: ${options.nodeTextColor || options.textColor};
2246
+ }
2247
+
2248
+ .edge-pattern-dashed {
2249
+ stroke-dasharray: 8,8;
2250
+ }
2251
+
2252
+ .node rect,
2253
+ .node circle,
2254
+ .node ellipse,
2255
+ .node polygon
2256
+ {
2257
+ fill: ${options.mainBkg};
2258
+ stroke: ${options.nodeBorder};
2259
+ stroke-width: ${look === "neo" ? strokeWidth : "1px"};
2260
+ }
2261
+
2262
+ .relationshipLine {
2263
+ stroke: ${options.lineColor};
2264
+ stroke-width: ${look === "neo" ? strokeWidth : "1px"};
2265
+ fill: none;
2266
+ }
2267
+
2268
+ .marker {
2269
+ fill: none !important;
2270
+ stroke: ${options.lineColor} !important;
2271
+ stroke-width: 1;
2272
+ }
2273
+ [data-look=neo].labelBkg {
2274
+ background-color: ${fade(options.tertiaryColor, .5)};
2275
+ }
2276
+
2277
+ .cluster rect {
2278
+ fill: ${options.clusterBkg ?? options.mainBkg};
2279
+ stroke: ${options.clusterBorder ?? options.nodeBorder};
2280
+ stroke-width: 1px;
2281
+ }
2282
+
2283
+ .cluster text {
2284
+ fill: ${options.titleColor ?? options.textColor};
2285
+ }
2286
+
2287
+ .cluster-label text {
2288
+ fill: ${options.titleColor ?? options.textColor};
2289
+ }
2290
+ `;
2291
+ }, "getStyles")
2292
+ };
2293
+
2294
+ //#endregion
2295
+ export { diagram };