gradio-leaderboard 0.0.12rc0__py3-none-any.whl → 0.0.14__py3-none-any.whl

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 (59) hide show
  1. gradio_leaderboard/leaderboard.pyi +102 -72
  2. gradio_leaderboard/templates/component/Index-CzS_eGV6.js +34210 -0
  3. gradio_leaderboard/templates/component/_basePickBy-CPQEc5fh.js +151 -0
  4. gradio_leaderboard/templates/component/_baseUniq-DlEwemC3.js +615 -0
  5. gradio_leaderboard/templates/component/arc-4UNMf6Jv.js +83 -0
  6. gradio_leaderboard/templates/component/architectureDiagram-NQ2NVSRB-ClVp_eQQ.js +4629 -0
  7. gradio_leaderboard/templates/component/blockDiagram-PHRCVELO-CBZHEIQE.js +2255 -0
  8. gradio_leaderboard/templates/component/c4Diagram-6F6E4RAY-BcEP_NdH.js +1586 -0
  9. gradio_leaderboard/templates/component/channel-BK2Jce3b.js +5 -0
  10. gradio_leaderboard/templates/component/chunk-353BL4L5-D4dVjjbU.js +8 -0
  11. gradio_leaderboard/templates/component/chunk-67H74DCK-Dd9cOxfN.js +64 -0
  12. gradio_leaderboard/templates/component/chunk-6OLS64BW-CfumlcA2.js +1376 -0
  13. gradio_leaderboard/templates/component/chunk-AACKK3MU-4CpiDhxa.js +18 -0
  14. gradio_leaderboard/templates/component/chunk-BFAMUDN2-C6YyJRb4.js +8 -0
  15. gradio_leaderboard/templates/component/chunk-E2GYISFI-CbYUJnri.js +19 -0
  16. gradio_leaderboard/templates/component/chunk-QEP2MXWD-BYLoFCys.js +1380 -0
  17. gradio_leaderboard/templates/component/chunk-SKB7J2MH-DNiBnZKZ.js +19 -0
  18. gradio_leaderboard/templates/component/classDiagram-BGRH5UQR-BrG1RRX8.js +16 -0
  19. gradio_leaderboard/templates/component/classDiagram-v2-O24JOBDK-BrG1RRX8.js +16 -0
  20. gradio_leaderboard/templates/component/clone-BA6MvtJ3.js +8 -0
  21. gradio_leaderboard/templates/component/cytoscape.esm-Bdz5CrXX.js +18629 -0
  22. gradio_leaderboard/templates/component/dagre-FFZHY6LT-6RahWHGr.js +444 -0
  23. gradio_leaderboard/templates/component/defaultLocale-D7EN2tov.js +171 -0
  24. gradio_leaderboard/templates/component/diagram-3EMPZRKU-DtoOVTDy.js +526 -0
  25. gradio_leaderboard/templates/component/diagram-5UYTHUR4-MEp0H-U7.js +137 -0
  26. gradio_leaderboard/templates/component/diagram-ZTM2IBQH-22c5YuUh.js +217 -0
  27. gradio_leaderboard/templates/component/erDiagram-R3QVA2FD-DZp2MeDc.js +844 -0
  28. gradio_leaderboard/templates/component/flowDiagram-PKI6S5ZS-CfK9UZi3.js +1623 -0
  29. gradio_leaderboard/templates/component/ganttDiagram-EK5VF46D-waaD2Kup.js +2502 -0
  30. gradio_leaderboard/templates/component/gitGraphDiagram-GW3U2K7C-DJCAxNvz.js +699 -0
  31. gradio_leaderboard/templates/component/graph-CXm5uxKj.js +247 -0
  32. gradio_leaderboard/templates/component/index.js +2 -29469
  33. gradio_leaderboard/templates/component/infoDiagram-RLU2ROGC-_Rx9wF6U.js +24 -0
  34. gradio_leaderboard/templates/component/init-DjUOC4st.js +16 -0
  35. gradio_leaderboard/templates/component/journeyDiagram-EWQZEKCU-G-tt0noJ.js +836 -0
  36. gradio_leaderboard/templates/component/kanban-definition-ILFWEQ3N-2aHifLFR.js +718 -0
  37. gradio_leaderboard/templates/component/layout-DiZ88ySr.js +1324 -0
  38. gradio_leaderboard/templates/component/linear-D4M9Dm-w.js +259 -0
  39. gradio_leaderboard/templates/component/mermaid.core-D36e06XD.js +14941 -0
  40. gradio_leaderboard/templates/component/mindmap-definition-CZNETY7S-1Jow2c7r.js +3215 -0
  41. gradio_leaderboard/templates/component/ordinal-DfAQgscy.js +61 -0
  42. gradio_leaderboard/templates/component/pieDiagram-NIOCPIFQ-DU7jHSoi.js +162 -0
  43. gradio_leaderboard/templates/component/quadrantDiagram-2OG54O6I-GcojS_If.js +1028 -0
  44. gradio_leaderboard/templates/component/requirementDiagram-SO3GGRV7-CBRyajan.js +853 -0
  45. gradio_leaderboard/templates/component/sankeyDiagram-4UZDY2LN-CeZji6oR.js +820 -0
  46. gradio_leaderboard/templates/component/sequenceDiagram-ZIKVLSP4-DMygkr3Y.js +2284 -0
  47. gradio_leaderboard/templates/component/stateDiagram-XX37X6EN-DK2vsx2r.js +263 -0
  48. gradio_leaderboard/templates/component/stateDiagram-v2-GD6S3NHB-BoIkPrjk.js +16 -0
  49. gradio_leaderboard/templates/component/style.css +1 -1
  50. gradio_leaderboard/templates/component/timeline-definition-RI47OAVP-BQ_Jr8hZ.js +797 -0
  51. gradio_leaderboard/templates/component/treemap-FKARHQ26-2Ty0RcZX.js +12981 -0
  52. gradio_leaderboard/templates/component/xychartDiagram-H2YORKM3--C9dwTwV.js +1368 -0
  53. gradio_leaderboard/templates/example/index.js +201 -139
  54. {gradio_leaderboard-0.0.12rc0.dist-info → gradio_leaderboard-0.0.14.dist-info}/METADATA +3 -3
  55. gradio_leaderboard-0.0.14.dist-info/RECORD +59 -0
  56. {gradio_leaderboard-0.0.12rc0.dist-info → gradio_leaderboard-0.0.14.dist-info}/WHEEL +1 -1
  57. gradio_leaderboard/templates/component/__vite-browser-external-2447137e.js +0 -4
  58. gradio_leaderboard/templates/component/wrapper-6f348d45-19fa94bf.js +0 -2453
  59. gradio_leaderboard-0.0.12rc0.dist-info/RECORD +0 -12
@@ -0,0 +1,844 @@
1
+ import { g as vt } from "./chunk-BFAMUDN2-C6YyJRb4.js";
2
+ import { s as Dt } from "./chunk-SKB7J2MH-DNiBnZKZ.js";
3
+ import { _ as o, s as wt, g as Vt, c as Lt, b as Mt, n as Bt, o as Ft, d as $, l as D, t as Yt, r as Pt, B as zt, y as Gt, z as Kt, j as Zt, u as Ut, A as jt } from "./mermaid.core-D36e06XD.js";
4
+ import { c as Wt } from "./channel-BK2Jce3b.js";
5
+ var ut = function() {
6
+ var e = /* @__PURE__ */ o(function(N, n, a, c) {
7
+ for (a = a || {}, c = N.length; c--; a[N[c]] = n) ;
8
+ return a;
9
+ }, "o"), i = [6, 8, 10, 22, 24, 26, 28, 33, 34, 35, 36, 37, 40, 43, 44, 50], d = [1, 10], l = [1, 11], h = [1, 12], p = [1, 13], R = [1, 20], g = [1, 21], m = [1, 22], w = [1, 23], K = [1, 24], k = [1, 19], tt = [1, 25], Z = [1, 26], S = [1, 18], V = [1, 33], et = [1, 34], st = [1, 35], it = [1, 36], rt = [1, 37], dt = [6, 8, 10, 13, 15, 17, 20, 21, 22, 24, 26, 28, 33, 34, 35, 36, 37, 40, 43, 44, 50, 63, 64, 65, 66, 67], T = [1, 42], O = [1, 43], L = [1, 52], M = [40, 50, 68, 69], B = [1, 63], F = [1, 61], A = [1, 58], Y = [1, 62], P = [1, 64], U = [6, 8, 10, 13, 17, 22, 24, 26, 28, 33, 34, 35, 36, 37, 40, 41, 42, 43, 44, 48, 49, 50, 63, 64, 65, 66, 67], pt = [63, 64, 65, 66, 67], ft = [1, 81], yt = [1, 80], _t = [1, 78], gt = [1, 79], bt = [6, 10, 42, 47], C = [6, 10, 13, 41, 42, 47, 48, 49], j = [1, 89], W = [1, 88], Q = [1, 87], z = [19, 56], mt = [1, 98], Et = [1, 97], nt = [19, 56, 58, 60], at = {
10
+ trace: /* @__PURE__ */ o(function() {
11
+ }, "trace"),
12
+ yy: {},
13
+ symbols_: { error: 2, start: 3, ER_DIAGRAM: 4, document: 5, EOF: 6, line: 7, SPACE: 8, statement: 9, NEWLINE: 10, entityName: 11, relSpec: 12, COLON: 13, role: 14, STYLE_SEPARATOR: 15, idList: 16, BLOCK_START: 17, attributes: 18, BLOCK_STOP: 19, SQS: 20, SQE: 21, title: 22, title_value: 23, acc_title: 24, acc_title_value: 25, acc_descr: 26, acc_descr_value: 27, acc_descr_multiline_value: 28, direction: 29, classDefStatement: 30, classStatement: 31, styleStatement: 32, direction_tb: 33, direction_bt: 34, direction_rl: 35, direction_lr: 36, CLASSDEF: 37, stylesOpt: 38, separator: 39, UNICODE_TEXT: 40, STYLE_TEXT: 41, COMMA: 42, CLASS: 43, STYLE: 44, style: 45, styleComponent: 46, SEMI: 47, NUM: 48, BRKT: 49, ENTITY_NAME: 50, attribute: 51, attributeType: 52, attributeName: 53, attributeKeyTypeList: 54, attributeComment: 55, ATTRIBUTE_WORD: 56, attributeKeyType: 57, ",": 58, ATTRIBUTE_KEY: 59, COMMENT: 60, cardinality: 61, relType: 62, ZERO_OR_ONE: 63, ZERO_OR_MORE: 64, ONE_OR_MORE: 65, ONLY_ONE: 66, MD_PARENT: 67, NON_IDENTIFYING: 68, IDENTIFYING: 69, WORD: 70, $accept: 0, $end: 1 },
14
+ terminals_: { 2: "error", 4: "ER_DIAGRAM", 6: "EOF", 8: "SPACE", 10: "NEWLINE", 13: "COLON", 15: "STYLE_SEPARATOR", 17: "BLOCK_START", 19: "BLOCK_STOP", 20: "SQS", 21: "SQE", 22: "title", 23: "title_value", 24: "acc_title", 25: "acc_title_value", 26: "acc_descr", 27: "acc_descr_value", 28: "acc_descr_multiline_value", 33: "direction_tb", 34: "direction_bt", 35: "direction_rl", 36: "direction_lr", 37: "CLASSDEF", 40: "UNICODE_TEXT", 41: "STYLE_TEXT", 42: "COMMA", 43: "CLASS", 44: "STYLE", 47: "SEMI", 48: "NUM", 49: "BRKT", 50: "ENTITY_NAME", 56: "ATTRIBUTE_WORD", 58: ",", 59: "ATTRIBUTE_KEY", 60: "COMMENT", 63: "ZERO_OR_ONE", 64: "ZERO_OR_MORE", 65: "ONE_OR_MORE", 66: "ONLY_ONE", 67: "MD_PARENT", 68: "NON_IDENTIFYING", 69: "IDENTIFYING", 70: "WORD" },
15
+ productions_: [0, [3, 3], [5, 0], [5, 2], [7, 2], [7, 1], [7, 1], [7, 1], [9, 5], [9, 9], [9, 7], [9, 7], [9, 4], [9, 6], [9, 3], [9, 5], [9, 1], [9, 3], [9, 7], [9, 9], [9, 6], [9, 8], [9, 4], [9, 6], [9, 2], [9, 2], [9, 2], [9, 1], [9, 1], [9, 1], [9, 1], [9, 1], [29, 1], [29, 1], [29, 1], [29, 1], [30, 4], [16, 1], [16, 1], [16, 3], [16, 3], [31, 3], [32, 4], [38, 1], [38, 3], [45, 1], [45, 2], [39, 1], [39, 1], [39, 1], [46, 1], [46, 1], [46, 1], [46, 1], [11, 1], [11, 1], [18, 1], [18, 2], [51, 2], [51, 3], [51, 3], [51, 4], [52, 1], [53, 1], [54, 1], [54, 3], [57, 1], [55, 1], [12, 3], [61, 1], [61, 1], [61, 1], [61, 1], [61, 1], [62, 1], [62, 1], [14, 1], [14, 1], [14, 1]],
16
+ performAction: /* @__PURE__ */ o(function(n, a, c, r, u, t, G) {
17
+ var s = t.length - 1;
18
+ switch (u) {
19
+ case 1:
20
+ break;
21
+ case 2:
22
+ this.$ = [];
23
+ break;
24
+ case 3:
25
+ t[s - 1].push(t[s]), this.$ = t[s - 1];
26
+ break;
27
+ case 4:
28
+ case 5:
29
+ this.$ = t[s];
30
+ break;
31
+ case 6:
32
+ case 7:
33
+ this.$ = [];
34
+ break;
35
+ case 8:
36
+ r.addEntity(t[s - 4]), r.addEntity(t[s - 2]), r.addRelationship(t[s - 4], t[s], t[s - 2], t[s - 3]);
37
+ break;
38
+ case 9:
39
+ r.addEntity(t[s - 8]), r.addEntity(t[s - 4]), r.addRelationship(t[s - 8], t[s], t[s - 4], t[s - 5]), r.setClass([t[s - 8]], t[s - 6]), r.setClass([t[s - 4]], t[s - 2]);
40
+ break;
41
+ case 10:
42
+ r.addEntity(t[s - 6]), r.addEntity(t[s - 2]), r.addRelationship(t[s - 6], t[s], t[s - 2], t[s - 3]), r.setClass([t[s - 6]], t[s - 4]);
43
+ break;
44
+ case 11:
45
+ r.addEntity(t[s - 6]), r.addEntity(t[s - 4]), r.addRelationship(t[s - 6], t[s], t[s - 4], t[s - 5]), r.setClass([t[s - 4]], t[s - 2]);
46
+ break;
47
+ case 12:
48
+ r.addEntity(t[s - 3]), r.addAttributes(t[s - 3], t[s - 1]);
49
+ break;
50
+ case 13:
51
+ r.addEntity(t[s - 5]), r.addAttributes(t[s - 5], t[s - 1]), r.setClass([t[s - 5]], t[s - 3]);
52
+ break;
53
+ case 14:
54
+ r.addEntity(t[s - 2]);
55
+ break;
56
+ case 15:
57
+ r.addEntity(t[s - 4]), r.setClass([t[s - 4]], t[s - 2]);
58
+ break;
59
+ case 16:
60
+ r.addEntity(t[s]);
61
+ break;
62
+ case 17:
63
+ r.addEntity(t[s - 2]), r.setClass([t[s - 2]], t[s]);
64
+ break;
65
+ case 18:
66
+ r.addEntity(t[s - 6], t[s - 4]), r.addAttributes(t[s - 6], t[s - 1]);
67
+ break;
68
+ case 19:
69
+ r.addEntity(t[s - 8], t[s - 6]), r.addAttributes(t[s - 8], t[s - 1]), r.setClass([t[s - 8]], t[s - 3]);
70
+ break;
71
+ case 20:
72
+ r.addEntity(t[s - 5], t[s - 3]);
73
+ break;
74
+ case 21:
75
+ r.addEntity(t[s - 7], t[s - 5]), r.setClass([t[s - 7]], t[s - 2]);
76
+ break;
77
+ case 22:
78
+ r.addEntity(t[s - 3], t[s - 1]);
79
+ break;
80
+ case 23:
81
+ r.addEntity(t[s - 5], t[s - 3]), r.setClass([t[s - 5]], t[s]);
82
+ break;
83
+ case 24:
84
+ case 25:
85
+ this.$ = t[s].trim(), r.setAccTitle(this.$);
86
+ break;
87
+ case 26:
88
+ case 27:
89
+ this.$ = t[s].trim(), r.setAccDescription(this.$);
90
+ break;
91
+ case 32:
92
+ r.setDirection("TB");
93
+ break;
94
+ case 33:
95
+ r.setDirection("BT");
96
+ break;
97
+ case 34:
98
+ r.setDirection("RL");
99
+ break;
100
+ case 35:
101
+ r.setDirection("LR");
102
+ break;
103
+ case 36:
104
+ this.$ = t[s - 3], r.addClass(t[s - 2], t[s - 1]);
105
+ break;
106
+ case 37:
107
+ case 38:
108
+ case 56:
109
+ case 64:
110
+ this.$ = [t[s]];
111
+ break;
112
+ case 39:
113
+ case 40:
114
+ this.$ = t[s - 2].concat([t[s]]);
115
+ break;
116
+ case 41:
117
+ this.$ = t[s - 2], r.setClass(t[s - 1], t[s]);
118
+ break;
119
+ case 42:
120
+ this.$ = t[s - 3], r.addCssStyles(t[s - 2], t[s - 1]);
121
+ break;
122
+ case 43:
123
+ this.$ = [t[s]];
124
+ break;
125
+ case 44:
126
+ t[s - 2].push(t[s]), this.$ = t[s - 2];
127
+ break;
128
+ case 46:
129
+ this.$ = t[s - 1] + t[s];
130
+ break;
131
+ case 54:
132
+ case 76:
133
+ case 77:
134
+ this.$ = t[s].replace(/"/g, "");
135
+ break;
136
+ case 55:
137
+ case 78:
138
+ this.$ = t[s];
139
+ break;
140
+ case 57:
141
+ t[s].push(t[s - 1]), this.$ = t[s];
142
+ break;
143
+ case 58:
144
+ this.$ = { type: t[s - 1], name: t[s] };
145
+ break;
146
+ case 59:
147
+ this.$ = { type: t[s - 2], name: t[s - 1], keys: t[s] };
148
+ break;
149
+ case 60:
150
+ this.$ = { type: t[s - 2], name: t[s - 1], comment: t[s] };
151
+ break;
152
+ case 61:
153
+ this.$ = { type: t[s - 3], name: t[s - 2], keys: t[s - 1], comment: t[s] };
154
+ break;
155
+ case 62:
156
+ case 63:
157
+ case 66:
158
+ this.$ = t[s];
159
+ break;
160
+ case 65:
161
+ t[s - 2].push(t[s]), this.$ = t[s - 2];
162
+ break;
163
+ case 67:
164
+ this.$ = t[s].replace(/"/g, "");
165
+ break;
166
+ case 68:
167
+ this.$ = { cardA: t[s], relType: t[s - 1], cardB: t[s - 2] };
168
+ break;
169
+ case 69:
170
+ this.$ = r.Cardinality.ZERO_OR_ONE;
171
+ break;
172
+ case 70:
173
+ this.$ = r.Cardinality.ZERO_OR_MORE;
174
+ break;
175
+ case 71:
176
+ this.$ = r.Cardinality.ONE_OR_MORE;
177
+ break;
178
+ case 72:
179
+ this.$ = r.Cardinality.ONLY_ONE;
180
+ break;
181
+ case 73:
182
+ this.$ = r.Cardinality.MD_PARENT;
183
+ break;
184
+ case 74:
185
+ this.$ = r.Identification.NON_IDENTIFYING;
186
+ break;
187
+ case 75:
188
+ this.$ = r.Identification.IDENTIFYING;
189
+ break;
190
+ }
191
+ }, "anonymous"),
192
+ table: [{ 3: 1, 4: [1, 2] }, { 1: [3] }, e(i, [2, 2], { 5: 3 }), { 6: [1, 4], 7: 5, 8: [1, 6], 9: 7, 10: [1, 8], 11: 9, 22: d, 24: l, 26: h, 28: p, 29: 14, 30: 15, 31: 16, 32: 17, 33: R, 34: g, 35: m, 36: w, 37: K, 40: k, 43: tt, 44: Z, 50: S }, e(i, [2, 7], { 1: [2, 1] }), e(i, [2, 3]), { 9: 27, 11: 9, 22: d, 24: l, 26: h, 28: p, 29: 14, 30: 15, 31: 16, 32: 17, 33: R, 34: g, 35: m, 36: w, 37: K, 40: k, 43: tt, 44: Z, 50: S }, e(i, [2, 5]), e(i, [2, 6]), e(i, [2, 16], { 12: 28, 61: 32, 15: [1, 29], 17: [1, 30], 20: [1, 31], 63: V, 64: et, 65: st, 66: it, 67: rt }), { 23: [1, 38] }, { 25: [1, 39] }, { 27: [1, 40] }, e(i, [2, 27]), e(i, [2, 28]), e(i, [2, 29]), e(i, [2, 30]), e(i, [2, 31]), e(dt, [2, 54]), e(dt, [2, 55]), e(i, [2, 32]), e(i, [2, 33]), e(i, [2, 34]), e(i, [2, 35]), { 16: 41, 40: T, 41: O }, { 16: 44, 40: T, 41: O }, { 16: 45, 40: T, 41: O }, e(i, [2, 4]), { 11: 46, 40: k, 50: S }, { 16: 47, 40: T, 41: O }, { 18: 48, 19: [1, 49], 51: 50, 52: 51, 56: L }, { 11: 53, 40: k, 50: S }, { 62: 54, 68: [1, 55], 69: [1, 56] }, e(M, [2, 69]), e(M, [2, 70]), e(M, [2, 71]), e(M, [2, 72]), e(M, [2, 73]), e(i, [2, 24]), e(i, [2, 25]), e(i, [2, 26]), { 13: B, 38: 57, 41: F, 42: A, 45: 59, 46: 60, 48: Y, 49: P }, e(U, [2, 37]), e(U, [2, 38]), { 16: 65, 40: T, 41: O, 42: A }, { 13: B, 38: 66, 41: F, 42: A, 45: 59, 46: 60, 48: Y, 49: P }, { 13: [1, 67], 15: [1, 68] }, e(i, [2, 17], { 61: 32, 12: 69, 17: [1, 70], 42: A, 63: V, 64: et, 65: st, 66: it, 67: rt }), { 19: [1, 71] }, e(i, [2, 14]), { 18: 72, 19: [2, 56], 51: 50, 52: 51, 56: L }, { 53: 73, 56: [1, 74] }, { 56: [2, 62] }, { 21: [1, 75] }, { 61: 76, 63: V, 64: et, 65: st, 66: it, 67: rt }, e(pt, [2, 74]), e(pt, [2, 75]), { 6: ft, 10: yt, 39: 77, 42: _t, 47: gt }, { 40: [1, 82], 41: [1, 83] }, e(bt, [2, 43], { 46: 84, 13: B, 41: F, 48: Y, 49: P }), e(C, [2, 45]), e(C, [2, 50]), e(C, [2, 51]), e(C, [2, 52]), e(C, [2, 53]), e(i, [2, 41], { 42: A }), { 6: ft, 10: yt, 39: 85, 42: _t, 47: gt }, { 14: 86, 40: j, 50: W, 70: Q }, { 16: 90, 40: T, 41: O }, { 11: 91, 40: k, 50: S }, { 18: 92, 19: [1, 93], 51: 50, 52: 51, 56: L }, e(i, [2, 12]), { 19: [2, 57] }, e(z, [2, 58], { 54: 94, 55: 95, 57: 96, 59: mt, 60: Et }), e([19, 56, 59, 60], [2, 63]), e(i, [2, 22], { 15: [1, 100], 17: [1, 99] }), e([40, 50], [2, 68]), e(i, [2, 36]), { 13: B, 41: F, 45: 101, 46: 60, 48: Y, 49: P }, e(i, [2, 47]), e(i, [2, 48]), e(i, [2, 49]), e(U, [2, 39]), e(U, [2, 40]), e(C, [2, 46]), e(i, [2, 42]), e(i, [2, 8]), e(i, [2, 76]), e(i, [2, 77]), e(i, [2, 78]), { 13: [1, 102], 42: A }, { 13: [1, 104], 15: [1, 103] }, { 19: [1, 105] }, e(i, [2, 15]), e(z, [2, 59], { 55: 106, 58: [1, 107], 60: Et }), e(z, [2, 60]), e(nt, [2, 64]), e(z, [2, 67]), e(nt, [2, 66]), { 18: 108, 19: [1, 109], 51: 50, 52: 51, 56: L }, { 16: 110, 40: T, 41: O }, e(bt, [2, 44], { 46: 84, 13: B, 41: F, 48: Y, 49: P }), { 14: 111, 40: j, 50: W, 70: Q }, { 16: 112, 40: T, 41: O }, { 14: 113, 40: j, 50: W, 70: Q }, e(i, [2, 13]), e(z, [2, 61]), { 57: 114, 59: mt }, { 19: [1, 115] }, e(i, [2, 20]), e(i, [2, 23], { 17: [1, 116], 42: A }), e(i, [2, 11]), { 13: [1, 117], 42: A }, e(i, [2, 10]), e(nt, [2, 65]), e(i, [2, 18]), { 18: 118, 19: [1, 119], 51: 50, 52: 51, 56: L }, { 14: 120, 40: j, 50: W, 70: Q }, { 19: [1, 121] }, e(i, [2, 21]), e(i, [2, 9]), e(i, [2, 19])],
193
+ defaultActions: { 52: [2, 62], 72: [2, 57] },
194
+ parseError: /* @__PURE__ */ o(function(n, a) {
195
+ if (a.recoverable)
196
+ this.trace(n);
197
+ else {
198
+ var c = new Error(n);
199
+ throw c.hash = a, c;
200
+ }
201
+ }, "parseError"),
202
+ parse: /* @__PURE__ */ o(function(n) {
203
+ var a = this, c = [0], r = [], u = [null], t = [], G = this.table, s = "", q = 0, kt = 0, Rt = 2, St = 1, It = t.slice.call(arguments, 1), f = Object.create(this.lexer), I = { yy: {} };
204
+ for (var ct in this.yy)
205
+ Object.prototype.hasOwnProperty.call(this.yy, ct) && (I.yy[ct] = this.yy[ct]);
206
+ f.setInput(n, I.yy), I.yy.lexer = f, I.yy.parser = this, typeof f.yylloc > "u" && (f.yylloc = {});
207
+ var lt = f.yylloc;
208
+ t.push(lt);
209
+ var xt = f.options && f.options.ranges;
210
+ typeof I.yy.parseError == "function" ? this.parseError = I.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
211
+ function Ct(_) {
212
+ c.length = c.length - 2 * _, u.length = u.length - _, t.length = t.length - _;
213
+ }
214
+ o(Ct, "popStack");
215
+ function Tt() {
216
+ var _;
217
+ return _ = r.pop() || f.lex() || St, typeof _ != "number" && (_ instanceof Array && (r = _, _ = r.pop()), _ = a.symbols_[_] || _), _;
218
+ }
219
+ o(Tt, "lex");
220
+ for (var y, x, b, ot, v = {}, H, E, Ot, J; ; ) {
221
+ if (x = c[c.length - 1], this.defaultActions[x] ? b = this.defaultActions[x] : ((y === null || typeof y > "u") && (y = Tt()), b = G[x] && G[x][y]), typeof b > "u" || !b.length || !b[0]) {
222
+ var ht = "";
223
+ J = [];
224
+ for (H in G[x])
225
+ this.terminals_[H] && H > Rt && J.push("'" + this.terminals_[H] + "'");
226
+ f.showPosition ? ht = "Parse error on line " + (q + 1) + `:
227
+ ` + f.showPosition() + `
228
+ Expecting ` + J.join(", ") + ", got '" + (this.terminals_[y] || y) + "'" : ht = "Parse error on line " + (q + 1) + ": Unexpected " + (y == St ? "end of input" : "'" + (this.terminals_[y] || y) + "'"), this.parseError(ht, {
229
+ text: f.match,
230
+ token: this.terminals_[y] || y,
231
+ line: f.yylineno,
232
+ loc: lt,
233
+ expected: J
234
+ });
235
+ }
236
+ if (b[0] instanceof Array && b.length > 1)
237
+ throw new Error("Parse Error: multiple actions possible at state: " + x + ", token: " + y);
238
+ switch (b[0]) {
239
+ case 1:
240
+ c.push(y), u.push(f.yytext), t.push(f.yylloc), c.push(b[1]), y = null, kt = f.yyleng, s = f.yytext, q = f.yylineno, lt = f.yylloc;
241
+ break;
242
+ case 2:
243
+ if (E = this.productions_[b[1]][1], v.$ = u[u.length - E], v._$ = {
244
+ first_line: t[t.length - (E || 1)].first_line,
245
+ last_line: t[t.length - 1].last_line,
246
+ first_column: t[t.length - (E || 1)].first_column,
247
+ last_column: t[t.length - 1].last_column
248
+ }, xt && (v._$.range = [
249
+ t[t.length - (E || 1)].range[0],
250
+ t[t.length - 1].range[1]
251
+ ]), ot = this.performAction.apply(v, [
252
+ s,
253
+ kt,
254
+ q,
255
+ I.yy,
256
+ b[1],
257
+ u,
258
+ t
259
+ ].concat(It)), typeof ot < "u")
260
+ return ot;
261
+ E && (c = c.slice(0, -1 * E * 2), u = u.slice(0, -1 * E), t = t.slice(0, -1 * E)), c.push(this.productions_[b[1]][0]), u.push(v.$), t.push(v._$), Ot = G[c[c.length - 2]][c[c.length - 1]], c.push(Ot);
262
+ break;
263
+ case 3:
264
+ return !0;
265
+ }
266
+ }
267
+ return !0;
268
+ }, "parse")
269
+ }, Nt = /* @__PURE__ */ function() {
270
+ var N = {
271
+ EOF: 1,
272
+ parseError: /* @__PURE__ */ o(function(a, c) {
273
+ if (this.yy.parser)
274
+ this.yy.parser.parseError(a, c);
275
+ else
276
+ throw new Error(a);
277
+ }, "parseError"),
278
+ // resets the lexer, sets new input
279
+ setInput: /* @__PURE__ */ o(function(n, a) {
280
+ return this.yy = a || this.yy || {}, this._input = n, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
281
+ first_line: 1,
282
+ first_column: 0,
283
+ last_line: 1,
284
+ last_column: 0
285
+ }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
286
+ }, "setInput"),
287
+ // consumes and returns one char from the input
288
+ input: /* @__PURE__ */ o(function() {
289
+ var n = this._input[0];
290
+ this.yytext += n, this.yyleng++, this.offset++, this.match += n, this.matched += n;
291
+ var a = n.match(/(?:\r\n?|\n).*/g);
292
+ return a ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), n;
293
+ }, "input"),
294
+ // unshifts one char (or a string) into the input
295
+ unput: /* @__PURE__ */ o(function(n) {
296
+ var a = n.length, c = n.split(/(?:\r\n?|\n)/g);
297
+ this._input = n + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - a), this.offset -= a;
298
+ var r = this.match.split(/(?:\r\n?|\n)/g);
299
+ this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), c.length - 1 && (this.yylineno -= c.length - 1);
300
+ var u = this.yylloc.range;
301
+ return this.yylloc = {
302
+ first_line: this.yylloc.first_line,
303
+ last_line: this.yylineno + 1,
304
+ first_column: this.yylloc.first_column,
305
+ last_column: c ? (c.length === r.length ? this.yylloc.first_column : 0) + r[r.length - c.length].length - c[0].length : this.yylloc.first_column - a
306
+ }, this.options.ranges && (this.yylloc.range = [u[0], u[0] + this.yyleng - a]), this.yyleng = this.yytext.length, this;
307
+ }, "unput"),
308
+ // When called from action, caches matched text and appends it on next action
309
+ more: /* @__PURE__ */ o(function() {
310
+ return this._more = !0, this;
311
+ }, "more"),
312
+ // 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.
313
+ reject: /* @__PURE__ */ o(function() {
314
+ if (this.options.backtrack_lexer)
315
+ this._backtrack = !0;
316
+ else
317
+ 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).
318
+ ` + this.showPosition(), {
319
+ text: "",
320
+ token: null,
321
+ line: this.yylineno
322
+ });
323
+ return this;
324
+ }, "reject"),
325
+ // retain first n characters of the match
326
+ less: /* @__PURE__ */ o(function(n) {
327
+ this.unput(this.match.slice(n));
328
+ }, "less"),
329
+ // displays already matched input, i.e. for error messages
330
+ pastInput: /* @__PURE__ */ o(function() {
331
+ var n = this.matched.substr(0, this.matched.length - this.match.length);
332
+ return (n.length > 20 ? "..." : "") + n.substr(-20).replace(/\n/g, "");
333
+ }, "pastInput"),
334
+ // displays upcoming input, i.e. for error messages
335
+ upcomingInput: /* @__PURE__ */ o(function() {
336
+ var n = this.match;
337
+ return n.length < 20 && (n += this._input.substr(0, 20 - n.length)), (n.substr(0, 20) + (n.length > 20 ? "..." : "")).replace(/\n/g, "");
338
+ }, "upcomingInput"),
339
+ // displays the character position where the lexing error occurred, i.e. for error messages
340
+ showPosition: /* @__PURE__ */ o(function() {
341
+ var n = this.pastInput(), a = new Array(n.length + 1).join("-");
342
+ return n + this.upcomingInput() + `
343
+ ` + a + "^";
344
+ }, "showPosition"),
345
+ // test the lexed token: return FALSE when not a match, otherwise return token
346
+ test_match: /* @__PURE__ */ o(function(n, a) {
347
+ var c, r, u;
348
+ if (this.options.backtrack_lexer && (u = {
349
+ yylineno: this.yylineno,
350
+ yylloc: {
351
+ first_line: this.yylloc.first_line,
352
+ last_line: this.last_line,
353
+ first_column: this.yylloc.first_column,
354
+ last_column: this.yylloc.last_column
355
+ },
356
+ yytext: this.yytext,
357
+ match: this.match,
358
+ matches: this.matches,
359
+ matched: this.matched,
360
+ yyleng: this.yyleng,
361
+ offset: this.offset,
362
+ _more: this._more,
363
+ _input: this._input,
364
+ yy: this.yy,
365
+ conditionStack: this.conditionStack.slice(0),
366
+ done: this.done
367
+ }, this.options.ranges && (u.yylloc.range = this.yylloc.range.slice(0))), r = n[0].match(/(?:\r\n?|\n).*/g), r && (this.yylineno += r.length), this.yylloc = {
368
+ first_line: this.yylloc.last_line,
369
+ last_line: this.yylineno + 1,
370
+ first_column: this.yylloc.last_column,
371
+ last_column: r ? r[r.length - 1].length - r[r.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + n[0].length
372
+ }, this.yytext += n[0], this.match += n[0], this.matches = n, this.yyleng = this.yytext.length, this.options.ranges && (this.yylloc.range = [this.offset, this.offset += this.yyleng]), this._more = !1, this._backtrack = !1, this._input = this._input.slice(n[0].length), this.matched += n[0], c = this.performAction.call(this, this.yy, this, a, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), c)
373
+ return c;
374
+ if (this._backtrack) {
375
+ for (var t in u)
376
+ this[t] = u[t];
377
+ return !1;
378
+ }
379
+ return !1;
380
+ }, "test_match"),
381
+ // return next match in input
382
+ next: /* @__PURE__ */ o(function() {
383
+ if (this.done)
384
+ return this.EOF;
385
+ this._input || (this.done = !0);
386
+ var n, a, c, r;
387
+ this._more || (this.yytext = "", this.match = "");
388
+ for (var u = this._currentRules(), t = 0; t < u.length; t++)
389
+ if (c = this._input.match(this.rules[u[t]]), c && (!a || c[0].length > a[0].length)) {
390
+ if (a = c, r = t, this.options.backtrack_lexer) {
391
+ if (n = this.test_match(c, u[t]), n !== !1)
392
+ return n;
393
+ if (this._backtrack) {
394
+ a = !1;
395
+ continue;
396
+ } else
397
+ return !1;
398
+ } else if (!this.options.flex)
399
+ break;
400
+ }
401
+ return a ? (n = this.test_match(a, u[r]), n !== !1 ? n : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
402
+ ` + this.showPosition(), {
403
+ text: "",
404
+ token: null,
405
+ line: this.yylineno
406
+ });
407
+ }, "next"),
408
+ // return next match that has a token
409
+ lex: /* @__PURE__ */ o(function() {
410
+ var a = this.next();
411
+ return a || this.lex();
412
+ }, "lex"),
413
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
414
+ begin: /* @__PURE__ */ o(function(a) {
415
+ this.conditionStack.push(a);
416
+ }, "begin"),
417
+ // pop the previously active lexer condition state off the condition stack
418
+ popState: /* @__PURE__ */ o(function() {
419
+ var a = this.conditionStack.length - 1;
420
+ return a > 0 ? this.conditionStack.pop() : this.conditionStack[0];
421
+ }, "popState"),
422
+ // produce the lexer rule set which is active for the currently active lexer condition state
423
+ _currentRules: /* @__PURE__ */ o(function() {
424
+ return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
425
+ }, "_currentRules"),
426
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
427
+ topState: /* @__PURE__ */ o(function(a) {
428
+ return a = this.conditionStack.length - 1 - Math.abs(a || 0), a >= 0 ? this.conditionStack[a] : "INITIAL";
429
+ }, "topState"),
430
+ // alias for begin(condition)
431
+ pushState: /* @__PURE__ */ o(function(a) {
432
+ this.begin(a);
433
+ }, "pushState"),
434
+ // return the number of states currently on the stack
435
+ stateStackSize: /* @__PURE__ */ o(function() {
436
+ return this.conditionStack.length;
437
+ }, "stateStackSize"),
438
+ options: { "case-insensitive": !0 },
439
+ performAction: /* @__PURE__ */ o(function(a, c, r, u) {
440
+ switch (r) {
441
+ case 0:
442
+ return this.begin("acc_title"), 24;
443
+ case 1:
444
+ return this.popState(), "acc_title_value";
445
+ case 2:
446
+ return this.begin("acc_descr"), 26;
447
+ case 3:
448
+ return this.popState(), "acc_descr_value";
449
+ case 4:
450
+ this.begin("acc_descr_multiline");
451
+ break;
452
+ case 5:
453
+ this.popState();
454
+ break;
455
+ case 6:
456
+ return "acc_descr_multiline_value";
457
+ case 7:
458
+ return 33;
459
+ case 8:
460
+ return 34;
461
+ case 9:
462
+ return 35;
463
+ case 10:
464
+ return 36;
465
+ case 11:
466
+ return 10;
467
+ case 12:
468
+ break;
469
+ case 13:
470
+ return 8;
471
+ case 14:
472
+ return 50;
473
+ case 15:
474
+ return 70;
475
+ case 16:
476
+ return 4;
477
+ case 17:
478
+ return this.begin("block"), 17;
479
+ case 18:
480
+ return 49;
481
+ case 19:
482
+ return 49;
483
+ case 20:
484
+ return 42;
485
+ case 21:
486
+ return 15;
487
+ case 22:
488
+ return 13;
489
+ case 23:
490
+ break;
491
+ case 24:
492
+ return 59;
493
+ case 25:
494
+ return 56;
495
+ case 26:
496
+ return 56;
497
+ case 27:
498
+ return 60;
499
+ case 28:
500
+ break;
501
+ case 29:
502
+ return this.popState(), 19;
503
+ case 30:
504
+ return c.yytext[0];
505
+ case 31:
506
+ return 20;
507
+ case 32:
508
+ return 21;
509
+ case 33:
510
+ return this.begin("style"), 44;
511
+ case 34:
512
+ return this.popState(), 10;
513
+ case 35:
514
+ break;
515
+ case 36:
516
+ return 13;
517
+ case 37:
518
+ return 42;
519
+ case 38:
520
+ return 49;
521
+ case 39:
522
+ return this.begin("style"), 37;
523
+ case 40:
524
+ return 43;
525
+ case 41:
526
+ return 63;
527
+ case 42:
528
+ return 65;
529
+ case 43:
530
+ return 65;
531
+ case 44:
532
+ return 65;
533
+ case 45:
534
+ return 63;
535
+ case 46:
536
+ return 63;
537
+ case 47:
538
+ return 64;
539
+ case 48:
540
+ return 64;
541
+ case 49:
542
+ return 64;
543
+ case 50:
544
+ return 64;
545
+ case 51:
546
+ return 64;
547
+ case 52:
548
+ return 65;
549
+ case 53:
550
+ return 64;
551
+ case 54:
552
+ return 65;
553
+ case 55:
554
+ return 66;
555
+ case 56:
556
+ return 66;
557
+ case 57:
558
+ return 66;
559
+ case 58:
560
+ return 66;
561
+ case 59:
562
+ return 63;
563
+ case 60:
564
+ return 64;
565
+ case 61:
566
+ return 65;
567
+ case 62:
568
+ return 67;
569
+ case 63:
570
+ return 68;
571
+ case 64:
572
+ return 69;
573
+ case 65:
574
+ return 69;
575
+ case 66:
576
+ return 68;
577
+ case 67:
578
+ return 68;
579
+ case 68:
580
+ return 68;
581
+ case 69:
582
+ return 41;
583
+ case 70:
584
+ return 47;
585
+ case 71:
586
+ return 40;
587
+ case 72:
588
+ return 48;
589
+ case 73:
590
+ return c.yytext[0];
591
+ case 74:
592
+ return 6;
593
+ }
594
+ }, "anonymous"),
595
+ rules: [/^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?:.*direction\s+TB[^\n]*)/i, /^(?:.*direction\s+BT[^\n]*)/i, /^(?:.*direction\s+RL[^\n]*)/i, /^(?:.*direction\s+LR[^\n]*)/i, /^(?:[\n]+)/i, /^(?:\s+)/i, /^(?:[\s]+)/i, /^(?:"[^"%\r\n\v\b\\]+")/i, /^(?:"[^"]*")/i, /^(?:erDiagram\b)/i, /^(?:\{)/i, /^(?:#)/i, /^(?:#)/i, /^(?:,)/i, /^(?::::)/i, /^(?::)/i, /^(?:\s+)/i, /^(?:\b((?:PK)|(?:FK)|(?:UK))\b)/i, /^(?:([^\s]*)[~].*[~]([^\s]*))/i, /^(?:([\*A-Za-z_\u00C0-\uFFFF][A-Za-z0-9\-\_\[\]\(\)\u00C0-\uFFFF\*]*))/i, /^(?:"[^"]*")/i, /^(?:[\n]+)/i, /^(?:\})/i, /^(?:.)/i, /^(?:\[)/i, /^(?:\])/i, /^(?:style\b)/i, /^(?:[\n]+)/i, /^(?:\s+)/i, /^(?::)/i, /^(?:,)/i, /^(?:#)/i, /^(?:classDef\b)/i, /^(?:class\b)/i, /^(?:one or zero\b)/i, /^(?:one or more\b)/i, /^(?:one or many\b)/i, /^(?:1\+)/i, /^(?:\|o\b)/i, /^(?:zero or one\b)/i, /^(?:zero or more\b)/i, /^(?:zero or many\b)/i, /^(?:0\+)/i, /^(?:\}o\b)/i, /^(?:many\(0\))/i, /^(?:many\(1\))/i, /^(?:many\b)/i, /^(?:\}\|)/i, /^(?:one\b)/i, /^(?:only one\b)/i, /^(?:1\b)/i, /^(?:\|\|)/i, /^(?:o\|)/i, /^(?:o\{)/i, /^(?:\|\{)/i, /^(?:\s*u\b)/i, /^(?:\.\.)/i, /^(?:--)/i, /^(?:to\b)/i, /^(?:optionally to\b)/i, /^(?:\.-)/i, /^(?:-\.)/i, /^(?:([^\x00-\x7F]|\w|-|\*)+)/i, /^(?:;)/i, /^(?:([^\x00-\x7F]|\w|-|\*)+)/i, /^(?:[0-9])/i, /^(?:.)/i, /^(?:$)/i],
596
+ conditions: { style: { rules: [34, 35, 36, 37, 38, 69, 70], inclusive: !1 }, acc_descr_multiline: { rules: [5, 6], inclusive: !1 }, acc_descr: { rules: [3], inclusive: !1 }, acc_title: { rules: [1], inclusive: !1 }, block: { rules: [23, 24, 25, 26, 27, 28, 29, 30], inclusive: !1 }, INITIAL: { rules: [0, 2, 4, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 31, 32, 33, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 71, 72, 73, 74], inclusive: !0 } }
597
+ };
598
+ return N;
599
+ }();
600
+ at.lexer = Nt;
601
+ function X() {
602
+ this.yy = {};
603
+ }
604
+ return o(X, "Parser"), X.prototype = at, at.Parser = X, new X();
605
+ }();
606
+ ut.parser = ut;
607
+ var Qt = ut, Xt = class {
608
+ constructor() {
609
+ this.entities = /* @__PURE__ */ new Map(), this.relationships = [], this.classes = /* @__PURE__ */ new Map(), this.direction = "TB", this.Cardinality = {
610
+ ZERO_OR_ONE: "ZERO_OR_ONE",
611
+ ZERO_OR_MORE: "ZERO_OR_MORE",
612
+ ONE_OR_MORE: "ONE_OR_MORE",
613
+ ONLY_ONE: "ONLY_ONE",
614
+ MD_PARENT: "MD_PARENT"
615
+ }, this.Identification = {
616
+ NON_IDENTIFYING: "NON_IDENTIFYING",
617
+ IDENTIFYING: "IDENTIFYING"
618
+ }, this.setAccTitle = wt, this.getAccTitle = Vt, this.setAccDescription = Lt, this.getAccDescription = Mt, this.setDiagramTitle = Bt, this.getDiagramTitle = Ft, this.getConfig = /* @__PURE__ */ o(() => $().er, "getConfig"), this.clear(), this.addEntity = this.addEntity.bind(this), this.addAttributes = this.addAttributes.bind(this), this.addRelationship = this.addRelationship.bind(this), this.setDirection = this.setDirection.bind(this), this.addCssStyles = this.addCssStyles.bind(this), this.addClass = this.addClass.bind(this), this.setClass = this.setClass.bind(this), this.setAccTitle = this.setAccTitle.bind(this), this.setAccDescription = this.setAccDescription.bind(this);
619
+ }
620
+ static {
621
+ o(this, "ErDB");
622
+ }
623
+ /**
624
+ * Add entity
625
+ * @param name - The name of the entity
626
+ * @param alias - The alias of the entity
627
+ */
628
+ addEntity(e, i = "") {
629
+ return this.entities.has(e) ? !this.entities.get(e)?.alias && i && (this.entities.get(e).alias = i, D.info(`Add alias '${i}' to entity '${e}'`)) : (this.entities.set(e, {
630
+ id: `entity-${e}-${this.entities.size}`,
631
+ label: e,
632
+ attributes: [],
633
+ alias: i,
634
+ shape: "erBox",
635
+ look: $().look ?? "default",
636
+ cssClasses: "default",
637
+ cssStyles: []
638
+ }), D.info("Added new entity :", e)), this.entities.get(e);
639
+ }
640
+ getEntity(e) {
641
+ return this.entities.get(e);
642
+ }
643
+ getEntities() {
644
+ return this.entities;
645
+ }
646
+ getClasses() {
647
+ return this.classes;
648
+ }
649
+ addAttributes(e, i) {
650
+ const d = this.addEntity(e);
651
+ let l;
652
+ for (l = i.length - 1; l >= 0; l--)
653
+ i[l].keys || (i[l].keys = []), i[l].comment || (i[l].comment = ""), d.attributes.push(i[l]), D.debug("Added attribute ", i[l].name);
654
+ }
655
+ /**
656
+ * Add a relationship
657
+ *
658
+ * @param entA - The first entity in the relationship
659
+ * @param rolA - The role played by the first entity in relation to the second
660
+ * @param entB - The second entity in the relationship
661
+ * @param rSpec - The details of the relationship between the two entities
662
+ */
663
+ addRelationship(e, i, d, l) {
664
+ const h = this.entities.get(e), p = this.entities.get(d);
665
+ if (!h || !p)
666
+ return;
667
+ const R = {
668
+ entityA: h.id,
669
+ roleA: i,
670
+ entityB: p.id,
671
+ relSpec: l
672
+ };
673
+ this.relationships.push(R), D.debug("Added new relationship :", R);
674
+ }
675
+ getRelationships() {
676
+ return this.relationships;
677
+ }
678
+ getDirection() {
679
+ return this.direction;
680
+ }
681
+ setDirection(e) {
682
+ this.direction = e;
683
+ }
684
+ getCompiledStyles(e) {
685
+ let i = [];
686
+ for (const d of e) {
687
+ const l = this.classes.get(d);
688
+ l?.styles && (i = [...i, ...l.styles ?? []].map((h) => h.trim())), l?.textStyles && (i = [...i, ...l.textStyles ?? []].map((h) => h.trim()));
689
+ }
690
+ return i;
691
+ }
692
+ addCssStyles(e, i) {
693
+ for (const d of e) {
694
+ const l = this.entities.get(d);
695
+ if (!i || !l)
696
+ return;
697
+ for (const h of i)
698
+ l.cssStyles.push(h);
699
+ }
700
+ }
701
+ addClass(e, i) {
702
+ e.forEach((d) => {
703
+ let l = this.classes.get(d);
704
+ l === void 0 && (l = { id: d, styles: [], textStyles: [] }, this.classes.set(d, l)), i && i.forEach(function(h) {
705
+ if (/color/.exec(h)) {
706
+ const p = h.replace("fill", "bgFill");
707
+ l.textStyles.push(p);
708
+ }
709
+ l.styles.push(h);
710
+ });
711
+ });
712
+ }
713
+ setClass(e, i) {
714
+ for (const d of e) {
715
+ const l = this.entities.get(d);
716
+ if (l)
717
+ for (const h of i)
718
+ l.cssClasses += " " + h;
719
+ }
720
+ }
721
+ clear() {
722
+ this.entities = /* @__PURE__ */ new Map(), this.classes = /* @__PURE__ */ new Map(), this.relationships = [], Yt();
723
+ }
724
+ getData() {
725
+ const e = [], i = [], d = $();
726
+ for (const h of this.entities.keys()) {
727
+ const p = this.entities.get(h);
728
+ p && (p.cssCompiledStyles = this.getCompiledStyles(p.cssClasses.split(" ")), e.push(p));
729
+ }
730
+ let l = 0;
731
+ for (const h of this.relationships) {
732
+ const p = {
733
+ id: Pt(h.entityA, h.entityB, {
734
+ prefix: "id",
735
+ counter: l++
736
+ }),
737
+ type: "normal",
738
+ curve: "basis",
739
+ start: h.entityA,
740
+ end: h.entityB,
741
+ label: h.roleA,
742
+ labelpos: "c",
743
+ thickness: "normal",
744
+ classes: "relationshipLine",
745
+ arrowTypeStart: h.relSpec.cardB.toLowerCase(),
746
+ arrowTypeEnd: h.relSpec.cardA.toLowerCase(),
747
+ pattern: h.relSpec.relType == "IDENTIFYING" ? "solid" : "dashed",
748
+ look: d.look
749
+ };
750
+ i.push(p);
751
+ }
752
+ return { nodes: e, edges: i, other: {}, config: d, direction: "TB" };
753
+ }
754
+ }, At = {};
755
+ zt(At, {
756
+ draw: () => qt
757
+ });
758
+ var qt = /* @__PURE__ */ o(async function(e, i, d, l) {
759
+ D.info("REF0:"), D.info("Drawing er diagram (unified)", i);
760
+ const { securityLevel: h, er: p, layout: R } = $(), g = l.db.getData(), m = vt(i, h);
761
+ g.type = l.type, g.layoutAlgorithm = Gt(R), g.config.flowchart.nodeSpacing = p?.nodeSpacing || 140, g.config.flowchart.rankSpacing = p?.rankSpacing || 80, g.direction = l.db.getDirection(), g.markers = ["only_one", "zero_or_one", "one_or_more", "zero_or_more"], g.diagramId = i, await Kt(g, m), g.layoutAlgorithm === "elk" && m.select(".edges").lower();
762
+ const w = m.selectAll('[id*="-background"]');
763
+ Array.from(w).length > 0 && w.each(function() {
764
+ const k = Zt(this), Z = k.attr("id").replace("-background", ""), S = m.select(`#${CSS.escape(Z)}`);
765
+ if (!S.empty()) {
766
+ const V = S.attr("transform");
767
+ k.attr("transform", V);
768
+ }
769
+ });
770
+ const K = 8;
771
+ Ut.insertTitle(
772
+ m,
773
+ "erDiagramTitleText",
774
+ p?.titleTopMargin ?? 25,
775
+ l.db.getDiagramTitle()
776
+ ), Dt(m, K, "erDiagram", p?.useMaxWidth ?? !0);
777
+ }, "draw"), Ht = /* @__PURE__ */ o((e, i) => {
778
+ const d = Wt, l = d(e, "r"), h = d(e, "g"), p = d(e, "b");
779
+ return jt(l, h, p, i);
780
+ }, "fade"), Jt = /* @__PURE__ */ o((e) => `
781
+ .entityBox {
782
+ fill: ${e.mainBkg};
783
+ stroke: ${e.nodeBorder};
784
+ }
785
+
786
+ .relationshipLabelBox {
787
+ fill: ${e.tertiaryColor};
788
+ opacity: 0.7;
789
+ background-color: ${e.tertiaryColor};
790
+ rect {
791
+ opacity: 0.5;
792
+ }
793
+ }
794
+
795
+ .labelBkg {
796
+ background-color: ${Ht(e.tertiaryColor, 0.5)};
797
+ }
798
+
799
+ .edgeLabel .label {
800
+ fill: ${e.nodeBorder};
801
+ font-size: 14px;
802
+ }
803
+
804
+ .label {
805
+ font-family: ${e.fontFamily};
806
+ color: ${e.nodeTextColor || e.textColor};
807
+ }
808
+
809
+ .edge-pattern-dashed {
810
+ stroke-dasharray: 8,8;
811
+ }
812
+
813
+ .node rect,
814
+ .node circle,
815
+ .node ellipse,
816
+ .node polygon
817
+ {
818
+ fill: ${e.mainBkg};
819
+ stroke: ${e.nodeBorder};
820
+ stroke-width: 1px;
821
+ }
822
+
823
+ .relationshipLine {
824
+ stroke: ${e.lineColor};
825
+ stroke-width: 1;
826
+ fill: none;
827
+ }
828
+
829
+ .marker {
830
+ fill: none !important;
831
+ stroke: ${e.lineColor} !important;
832
+ stroke-width: 1;
833
+ }
834
+ `, "getStyles"), $t = Jt, re = {
835
+ parser: Qt,
836
+ get db() {
837
+ return new Xt();
838
+ },
839
+ renderer: At,
840
+ styles: $t
841
+ };
842
+ export {
843
+ re as diagram
844
+ };