@n8n-zengchao/chat 0.62.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 (151) hide show
  1. package/README.md +289 -0
  2. package/dist/App.vue.d.ts +2 -0
  3. package/dist/__stories__/App.stories.d.ts +18 -0
  4. package/dist/__tests__/Input.spec.d.ts +1 -0
  5. package/dist/__tests__/api/generic.spec.d.ts +1 -0
  6. package/dist/__tests__/api/message.spec.d.ts +1 -0
  7. package/dist/__tests__/index.spec.d.ts +1 -0
  8. package/dist/__tests__/plugins/chat.spec.d.ts +1 -0
  9. package/dist/__tests__/plugins/chat.test.d.ts +1 -0
  10. package/dist/__tests__/setup.d.ts +0 -0
  11. package/dist/__tests__/utils/create.d.ts +5 -0
  12. package/dist/__tests__/utils/fetch.d.ts +13 -0
  13. package/dist/__tests__/utils/index.d.ts +3 -0
  14. package/dist/__tests__/utils/selectors.d.ts +12 -0
  15. package/dist/__tests__/utils/streaming.spec.d.ts +1 -0
  16. package/dist/__tests__/utils/streamingHandlers.spec.d.ts +1 -0
  17. package/dist/_basePickBy-aQilsjEs.mjs +106 -0
  18. package/dist/_baseUniq-Agc10qFQ.mjs +232 -0
  19. package/dist/api/generic.d.ts +7 -0
  20. package/dist/api/index.d.ts +2 -0
  21. package/dist/api/message.d.ts +11 -0
  22. package/dist/arc-EhYU_DB1.mjs +79 -0
  23. package/dist/architecture-U656AL7Q-B1STlXpR.mjs +10 -0
  24. package/dist/architectureDiagram-VXUJARFQ-DOVAbXSw.mjs +4054 -0
  25. package/dist/array-B5w981Vk.mjs +5 -0
  26. package/dist/blockDiagram-VD42YOAC-BsX3Fkg3.mjs +3013 -0
  27. package/dist/c4Diagram-YG6GDRKO-B5JaLuX6.mjs +2957 -0
  28. package/dist/channel-CqrIo07y.mjs +4 -0
  29. package/dist/chat.bundle.es.js +37656 -0
  30. package/dist/chat.bundle.umd.js +2784 -0
  31. package/dist/chat.es.js +35738 -0
  32. package/dist/chat.umd.js +2776 -0
  33. package/dist/chunk-4BX2VUAB-dn0RXIrC.mjs +7 -0
  34. package/dist/chunk-55IACEB6-DrIttNoL.mjs +7 -0
  35. package/dist/chunk-76Q3JFCE-D7DMbWeQ.mjs +20 -0
  36. package/dist/chunk-ABZYJK2D-_NXv778f.mjs +2516 -0
  37. package/dist/chunk-ATLVNIR6-CBnG7Ev9.mjs +66 -0
  38. package/dist/chunk-B4BG7PRW-DElmmAse.mjs +3109 -0
  39. package/dist/chunk-CVBHYZKI-kPsSw5G9.mjs +11 -0
  40. package/dist/chunk-DI55MBZ5-Bw6uFFfD.mjs +1995 -0
  41. package/dist/chunk-DZXZ2BO8.mjs +19 -0
  42. package/dist/chunk-EXTU4WIE-DWzncOZf.mjs +8 -0
  43. package/dist/chunk-FMBD7UC4-CQf-nVrj.mjs +4 -0
  44. package/dist/chunk-FPAJGGOC-HRc6DGju.mjs +12254 -0
  45. package/dist/chunk-FWNWRKHM-CGiJVNMo.mjs +57 -0
  46. package/dist/chunk-HN2XXSSU-DMfVdeUE.mjs +75 -0
  47. package/dist/chunk-JA3XYJ7Z-b0Li4NN8.mjs +1834 -0
  48. package/dist/chunk-JZLCHNYA-C_4MLySW.mjs +4862 -0
  49. package/dist/chunk-KS23V3DP-BRKOfbU6.mjs +136 -0
  50. package/dist/chunk-LBM3YZW2-JIQK8wiH.mjs +20 -0
  51. package/dist/chunk-LHMN2FUI-PNCyIUgu.mjs +20 -0
  52. package/dist/chunk-MI3HLSF2-B9GTCmLp.mjs +1146 -0
  53. package/dist/chunk-N4CR4FBY-CjlmnCPD.mjs +40 -0
  54. package/dist/chunk-O7ZBX7Z2-DmJUfqJj.mjs +27 -0
  55. package/dist/chunk-QN33PNHL-nN1zLFSf.mjs +24 -0
  56. package/dist/chunk-QXUST7PY-CY78Btj9.mjs +487 -0
  57. package/dist/chunk-QZHKN3VN-BF5N1pfB.mjs +12 -0
  58. package/dist/chunk-S3R3BYOJ-BhFsv0Go.mjs +1076 -0
  59. package/dist/chunk-S6J4BHB3-BvrWTdbl.mjs +20 -0
  60. package/dist/chunk-T53DSG4Q-XzY06amw.mjs +25 -0
  61. package/dist/chunk-TZMSLE5B-DVmJQ8eg.mjs +57 -0
  62. package/dist/classDiagram-2ON5EDUG-CKxiEVX9.mjs +33 -0
  63. package/dist/classDiagram-v2-WZHVMYZB-sAa_2keq.mjs +33 -0
  64. package/dist/clone-nkGlb0Gn.mjs +8 -0
  65. package/dist/components/Button.vue.d.ts +17 -0
  66. package/dist/components/Chat.vue.d.ts +2 -0
  67. package/dist/components/ChatFile.vue.d.ts +11 -0
  68. package/dist/components/ChatWindow.vue.d.ts +2 -0
  69. package/dist/components/GetStarted.vue.d.ts +2 -0
  70. package/dist/components/GetStartedFooter.vue.d.ts +2 -0
  71. package/dist/components/Input.vue.d.ts +39 -0
  72. package/dist/components/Layout.vue.d.ts +23 -0
  73. package/dist/components/Message.vue.d.ts +39 -0
  74. package/dist/components/MessageTyping.vue.d.ts +76 -0
  75. package/dist/components/MessagesList.vue.d.ts +164 -0
  76. package/dist/components/PoweredBy.vue.d.ts +2 -0
  77. package/dist/components/index.d.ts +10 -0
  78. package/dist/composables/index.d.ts +3 -0
  79. package/dist/composables/useChat.d.ts +2 -0
  80. package/dist/composables/useI18n.d.ts +4 -0
  81. package/dist/composables/useOptions.d.ts +4 -0
  82. package/dist/constants/defaults.d.ts +3 -0
  83. package/dist/constants/index.d.ts +3 -0
  84. package/dist/constants/localStorage.d.ts +2 -0
  85. package/dist/constants/symbols.d.ts +4 -0
  86. package/dist/cose-bilkent-S5V4N54A-1lKG2PUg.mjs +2251 -0
  87. package/dist/cytoscape.esm-Dls1_mGy.mjs +18108 -0
  88. package/dist/dagre-6UL2VRFP-CbWFu9xQ.mjs +300 -0
  89. package/dist/dagre-DEdOheHq.mjs +1385 -0
  90. package/dist/defaultLocale-CyoQm63E.mjs +178 -0
  91. package/dist/diagram-PSM6KHXK-CJcHbrJH.mjs +499 -0
  92. package/dist/diagram-QEK2KX5R-XQ9XOVL4.mjs +228 -0
  93. package/dist/diagram-S2PKOQOG-CmRfaeSf.mjs +146 -0
  94. package/dist/dist-BT0fjU7K.mjs +50 -0
  95. package/dist/erDiagram-Q2GNP2WA-iuoUWHwm.mjs +1603 -0
  96. package/dist/event-buses/chatEventBus.d.ts +1 -0
  97. package/dist/event-buses/index.d.ts +1 -0
  98. package/dist/favicon.ico +0 -0
  99. package/dist/flowDiagram-NV44I4VS-D3GMS8-G.mjs +4132 -0
  100. package/dist/ganttDiagram-LVOFAZNH-DMTZVZDR.mjs +2832 -0
  101. package/dist/gitGraph-F6HP7TQM-CrdUzURw.mjs +10 -0
  102. package/dist/gitGraphDiagram-NY62KEGX-DipP5Fgt.mjs +636 -0
  103. package/dist/graphlib-D9eH5icd.mjs +224 -0
  104. package/dist/index.d.ts +2 -0
  105. package/dist/info-NVLQJR56-C-93Yf3U.mjs +10 -0
  106. package/dist/infoDiagram-F6ZHWCRC-jM50s26K.mjs +33 -0
  107. package/dist/init-CYeu4QfE.mjs +14 -0
  108. package/dist/isArrayLikeObject-BPcFdnyK.mjs +459 -0
  109. package/dist/isUndefined-BvarJ1wS.mjs +374 -0
  110. package/dist/journeyDiagram-XKPGCS4Q-BEEO_0Bh.mjs +885 -0
  111. package/dist/kanban-definition-3W4ZIXB7-B8u_HDmL.mjs +971 -0
  112. package/dist/katex-Dc1vXbUC.mjs +22094 -0
  113. package/dist/line-BJxACIPZ.mjs +31 -0
  114. package/dist/linear-DHHVI-cj.mjs +251 -0
  115. package/dist/math-Byg0NvhS.mjs +9 -0
  116. package/dist/mermaid-parser.core-YT4qvimq.mjs +49 -0
  117. package/dist/mindmap-definition-VGOIOE7T-ah41V88S.mjs +960 -0
  118. package/dist/now-DsJMgI1z.mjs +6 -0
  119. package/dist/ordinal-L0-EVPg8.mjs +62 -0
  120. package/dist/packet-BFZMPI3H-Cs4kRHct.mjs +10 -0
  121. package/dist/path-BcDHwjEr.mjs +80 -0
  122. package/dist/pie-7BOR55EZ-YZ5Xu4o6.mjs +10 -0
  123. package/dist/pieDiagram-ADFJNKIX-CqI33m1a.mjs +174 -0
  124. package/dist/plugins/chat.d.ts +3 -0
  125. package/dist/plugins/index.d.ts +1 -0
  126. package/dist/quadrantDiagram-AYHSOK5B-DDv2X9c1.mjs +1971 -0
  127. package/dist/radar-NHE76QYJ-TpirOFtv.mjs +10 -0
  128. package/dist/requirementDiagram-UZGBJVZJ-DXa77VzO.mjs +2194 -0
  129. package/dist/sankeyDiagram-TZEHDZUN--B9DInJC.mjs +885 -0
  130. package/dist/sequenceDiagram-WL72ISMW-Dqn9jJ3g.mjs +3562 -0
  131. package/dist/src-DdwtiGjk.mjs +1976 -0
  132. package/dist/stateDiagram-FKZM4ZOC-D3eEcVjS.mjs +226 -0
  133. package/dist/stateDiagram-v2-4FDKWEC3-dzwJ4caL.mjs +32 -0
  134. package/dist/style.css +3 -0
  135. package/dist/timeline-definition-IT6M3QCI-z93ry7RN.mjs +831 -0
  136. package/dist/toInteger-1S_4Byef.mjs +36 -0
  137. package/dist/treemap-KMMF4GRG-BlF0Ev1z.mjs +10 -0
  138. package/dist/types/chat.d.ts +13 -0
  139. package/dist/types/index.d.ts +5 -0
  140. package/dist/types/messages.d.ts +17 -0
  141. package/dist/types/options.d.ts +33 -0
  142. package/dist/types/streaming.d.ts +18 -0
  143. package/dist/types/webhook.d.ts +19 -0
  144. package/dist/utils/event-bus.d.ts +8 -0
  145. package/dist/utils/index.d.ts +3 -0
  146. package/dist/utils/mount.d.ts +1 -0
  147. package/dist/utils/streaming.d.ts +26 -0
  148. package/dist/utils/streamingHandlers.d.ts +6 -0
  149. package/dist/utils/utils.d.ts +1 -0
  150. package/dist/xychartDiagram-PRI3JC2R-C3aDcgBz.mjs +2022 -0
  151. package/package.json +78 -0
@@ -0,0 +1,1603 @@
1
+ /*! Package version @n8n/chat@0.62.0 */
2
+ import "./isArrayLikeObject-BPcFdnyK.mjs";
3
+ import { c as getEdgeId, g as utils_default } from "./chunk-S3R3BYOJ-BhFsv0Go.mjs";
4
+ import { g as log, h as __name, m as __export, p as select_default } from "./src-DdwtiGjk.mjs";
5
+ import { B as setAccTitle, C as getDiagramTitle, U as setDiagramTitle, _ as getAccDescription, a as clear, b as getConfig2, et as rgba_default, v as getAccTitle, z as setAccDescription } from "./chunk-ABZYJK2D-_NXv778f.mjs";
6
+ import { t as channel_default } from "./channel-CqrIo07y.mjs";
7
+ import "./path-BcDHwjEr.mjs";
8
+ import "./math-Byg0NvhS.mjs";
9
+ import "./array-B5w981Vk.mjs";
10
+ import "./line-BJxACIPZ.mjs";
11
+ import "./chunk-HN2XXSSU-DMfVdeUE.mjs";
12
+ import "./chunk-CVBHYZKI-kPsSw5G9.mjs";
13
+ import "./chunk-ATLVNIR6-CBnG7Ev9.mjs";
14
+ import "./dist-BT0fjU7K.mjs";
15
+ import "./chunk-JA3XYJ7Z-b0Li4NN8.mjs";
16
+ import "./chunk-JZLCHNYA-C_4MLySW.mjs";
17
+ import "./chunk-QXUST7PY-CY78Btj9.mjs";
18
+ import { r as render, t as getRegisteredLayoutAlgorithm } from "./chunk-N4CR4FBY-CjlmnCPD.mjs";
19
+ import { t as getDiagramElement } from "./chunk-55IACEB6-DrIttNoL.mjs";
20
+ import { t as setupViewPortForSVG } from "./chunk-QN33PNHL-nN1zLFSf.mjs";
21
+ var parser = (function() {
22
+ var e = /* @__PURE__ */ __name(function(e, t, n, r) {
23
+ for (n ||= {}, r = e.length; r--; n[e[r]] = t);
24
+ return n;
25
+ }, "o"), t = [
26
+ 6,
27
+ 8,
28
+ 10,
29
+ 22,
30
+ 24,
31
+ 26,
32
+ 28,
33
+ 33,
34
+ 34,
35
+ 35,
36
+ 36,
37
+ 37,
38
+ 40,
39
+ 43,
40
+ 44,
41
+ 50
42
+ ], n = [1, 10], i = [1, 11], a = [1, 12], o = [1, 13], s = [1, 20], c = [1, 21], l = [1, 22], u = [1, 23], d = [1, 24], f = [1, 19], p = [1, 25], m = [1, 26], h = [1, 18], g = [1, 33], _ = [1, 34], v = [1, 35], y = [1, 36], b = [1, 37], x = [
43
+ 6,
44
+ 8,
45
+ 10,
46
+ 13,
47
+ 15,
48
+ 17,
49
+ 20,
50
+ 21,
51
+ 22,
52
+ 24,
53
+ 26,
54
+ 28,
55
+ 33,
56
+ 34,
57
+ 35,
58
+ 36,
59
+ 37,
60
+ 40,
61
+ 43,
62
+ 44,
63
+ 50,
64
+ 63,
65
+ 64,
66
+ 65,
67
+ 66,
68
+ 67
69
+ ], S = [1, 42], C = [1, 43], w = [1, 52], T = [
70
+ 40,
71
+ 50,
72
+ 68,
73
+ 69
74
+ ], E = [1, 63], D = [1, 61], O = [1, 58], k = [1, 62], A = [1, 64], j = [
75
+ 6,
76
+ 8,
77
+ 10,
78
+ 13,
79
+ 17,
80
+ 22,
81
+ 24,
82
+ 26,
83
+ 28,
84
+ 33,
85
+ 34,
86
+ 35,
87
+ 36,
88
+ 37,
89
+ 40,
90
+ 41,
91
+ 42,
92
+ 43,
93
+ 44,
94
+ 48,
95
+ 49,
96
+ 50,
97
+ 63,
98
+ 64,
99
+ 65,
100
+ 66,
101
+ 67
102
+ ], M = [
103
+ 63,
104
+ 64,
105
+ 65,
106
+ 66,
107
+ 67
108
+ ], N = [1, 81], P = [1, 80], F = [1, 78], I = [1, 79], L = [
109
+ 6,
110
+ 10,
111
+ 42,
112
+ 47
113
+ ], R = [
114
+ 6,
115
+ 10,
116
+ 13,
117
+ 41,
118
+ 42,
119
+ 47,
120
+ 48,
121
+ 49
122
+ ], z = [1, 89], B = [1, 88], V = [1, 87], H = [19, 56], U = [1, 98], W = [1, 97], G = [
123
+ 19,
124
+ 56,
125
+ 58,
126
+ 60
127
+ ], K = {
128
+ trace: /* @__PURE__ */ __name(function() {}, "trace"),
129
+ yy: {},
130
+ symbols_: {
131
+ error: 2,
132
+ start: 3,
133
+ ER_DIAGRAM: 4,
134
+ document: 5,
135
+ EOF: 6,
136
+ line: 7,
137
+ SPACE: 8,
138
+ statement: 9,
139
+ NEWLINE: 10,
140
+ entityName: 11,
141
+ relSpec: 12,
142
+ COLON: 13,
143
+ role: 14,
144
+ STYLE_SEPARATOR: 15,
145
+ idList: 16,
146
+ BLOCK_START: 17,
147
+ attributes: 18,
148
+ BLOCK_STOP: 19,
149
+ SQS: 20,
150
+ SQE: 21,
151
+ title: 22,
152
+ title_value: 23,
153
+ acc_title: 24,
154
+ acc_title_value: 25,
155
+ acc_descr: 26,
156
+ acc_descr_value: 27,
157
+ acc_descr_multiline_value: 28,
158
+ direction: 29,
159
+ classDefStatement: 30,
160
+ classStatement: 31,
161
+ styleStatement: 32,
162
+ direction_tb: 33,
163
+ direction_bt: 34,
164
+ direction_rl: 35,
165
+ direction_lr: 36,
166
+ CLASSDEF: 37,
167
+ stylesOpt: 38,
168
+ separator: 39,
169
+ UNICODE_TEXT: 40,
170
+ STYLE_TEXT: 41,
171
+ COMMA: 42,
172
+ CLASS: 43,
173
+ STYLE: 44,
174
+ style: 45,
175
+ styleComponent: 46,
176
+ SEMI: 47,
177
+ NUM: 48,
178
+ BRKT: 49,
179
+ ENTITY_NAME: 50,
180
+ attribute: 51,
181
+ attributeType: 52,
182
+ attributeName: 53,
183
+ attributeKeyTypeList: 54,
184
+ attributeComment: 55,
185
+ ATTRIBUTE_WORD: 56,
186
+ attributeKeyType: 57,
187
+ ",": 58,
188
+ ATTRIBUTE_KEY: 59,
189
+ COMMENT: 60,
190
+ cardinality: 61,
191
+ relType: 62,
192
+ ZERO_OR_ONE: 63,
193
+ ZERO_OR_MORE: 64,
194
+ ONE_OR_MORE: 65,
195
+ ONLY_ONE: 66,
196
+ MD_PARENT: 67,
197
+ NON_IDENTIFYING: 68,
198
+ IDENTIFYING: 69,
199
+ WORD: 70,
200
+ $accept: 0,
201
+ $end: 1
202
+ },
203
+ terminals_: {
204
+ 2: "error",
205
+ 4: "ER_DIAGRAM",
206
+ 6: "EOF",
207
+ 8: "SPACE",
208
+ 10: "NEWLINE",
209
+ 13: "COLON",
210
+ 15: "STYLE_SEPARATOR",
211
+ 17: "BLOCK_START",
212
+ 19: "BLOCK_STOP",
213
+ 20: "SQS",
214
+ 21: "SQE",
215
+ 22: "title",
216
+ 23: "title_value",
217
+ 24: "acc_title",
218
+ 25: "acc_title_value",
219
+ 26: "acc_descr",
220
+ 27: "acc_descr_value",
221
+ 28: "acc_descr_multiline_value",
222
+ 33: "direction_tb",
223
+ 34: "direction_bt",
224
+ 35: "direction_rl",
225
+ 36: "direction_lr",
226
+ 37: "CLASSDEF",
227
+ 40: "UNICODE_TEXT",
228
+ 41: "STYLE_TEXT",
229
+ 42: "COMMA",
230
+ 43: "CLASS",
231
+ 44: "STYLE",
232
+ 47: "SEMI",
233
+ 48: "NUM",
234
+ 49: "BRKT",
235
+ 50: "ENTITY_NAME",
236
+ 56: "ATTRIBUTE_WORD",
237
+ 58: ",",
238
+ 59: "ATTRIBUTE_KEY",
239
+ 60: "COMMENT",
240
+ 63: "ZERO_OR_ONE",
241
+ 64: "ZERO_OR_MORE",
242
+ 65: "ONE_OR_MORE",
243
+ 66: "ONLY_ONE",
244
+ 67: "MD_PARENT",
245
+ 68: "NON_IDENTIFYING",
246
+ 69: "IDENTIFYING",
247
+ 70: "WORD"
248
+ },
249
+ productions_: [
250
+ 0,
251
+ [3, 3],
252
+ [5, 0],
253
+ [5, 2],
254
+ [7, 2],
255
+ [7, 1],
256
+ [7, 1],
257
+ [7, 1],
258
+ [9, 5],
259
+ [9, 9],
260
+ [9, 7],
261
+ [9, 7],
262
+ [9, 4],
263
+ [9, 6],
264
+ [9, 3],
265
+ [9, 5],
266
+ [9, 1],
267
+ [9, 3],
268
+ [9, 7],
269
+ [9, 9],
270
+ [9, 6],
271
+ [9, 8],
272
+ [9, 4],
273
+ [9, 6],
274
+ [9, 2],
275
+ [9, 2],
276
+ [9, 2],
277
+ [9, 1],
278
+ [9, 1],
279
+ [9, 1],
280
+ [9, 1],
281
+ [9, 1],
282
+ [29, 1],
283
+ [29, 1],
284
+ [29, 1],
285
+ [29, 1],
286
+ [30, 4],
287
+ [16, 1],
288
+ [16, 1],
289
+ [16, 3],
290
+ [16, 3],
291
+ [31, 3],
292
+ [32, 4],
293
+ [38, 1],
294
+ [38, 3],
295
+ [45, 1],
296
+ [45, 2],
297
+ [39, 1],
298
+ [39, 1],
299
+ [39, 1],
300
+ [46, 1],
301
+ [46, 1],
302
+ [46, 1],
303
+ [46, 1],
304
+ [11, 1],
305
+ [11, 1],
306
+ [18, 1],
307
+ [18, 2],
308
+ [51, 2],
309
+ [51, 3],
310
+ [51, 3],
311
+ [51, 4],
312
+ [52, 1],
313
+ [53, 1],
314
+ [54, 1],
315
+ [54, 3],
316
+ [57, 1],
317
+ [55, 1],
318
+ [12, 3],
319
+ [61, 1],
320
+ [61, 1],
321
+ [61, 1],
322
+ [61, 1],
323
+ [61, 1],
324
+ [62, 1],
325
+ [62, 1],
326
+ [14, 1],
327
+ [14, 1],
328
+ [14, 1]
329
+ ],
330
+ performAction: /* @__PURE__ */ __name(function(e, t, n, r, i, a, o) {
331
+ var s = a.length - 1;
332
+ switch (i) {
333
+ case 1: break;
334
+ case 2:
335
+ this.$ = [];
336
+ break;
337
+ case 3:
338
+ a[s - 1].push(a[s]), this.$ = a[s - 1];
339
+ break;
340
+ case 4:
341
+ case 5:
342
+ this.$ = a[s];
343
+ break;
344
+ case 6:
345
+ case 7:
346
+ this.$ = [];
347
+ break;
348
+ case 8:
349
+ r.addEntity(a[s - 4]), r.addEntity(a[s - 2]), r.addRelationship(a[s - 4], a[s], a[s - 2], a[s - 3]);
350
+ break;
351
+ case 9:
352
+ r.addEntity(a[s - 8]), r.addEntity(a[s - 4]), r.addRelationship(a[s - 8], a[s], a[s - 4], a[s - 5]), r.setClass([a[s - 8]], a[s - 6]), r.setClass([a[s - 4]], a[s - 2]);
353
+ break;
354
+ case 10:
355
+ r.addEntity(a[s - 6]), r.addEntity(a[s - 2]), r.addRelationship(a[s - 6], a[s], a[s - 2], a[s - 3]), r.setClass([a[s - 6]], a[s - 4]);
356
+ break;
357
+ case 11:
358
+ r.addEntity(a[s - 6]), r.addEntity(a[s - 4]), r.addRelationship(a[s - 6], a[s], a[s - 4], a[s - 5]), r.setClass([a[s - 4]], a[s - 2]);
359
+ break;
360
+ case 12:
361
+ r.addEntity(a[s - 3]), r.addAttributes(a[s - 3], a[s - 1]);
362
+ break;
363
+ case 13:
364
+ r.addEntity(a[s - 5]), r.addAttributes(a[s - 5], a[s - 1]), r.setClass([a[s - 5]], a[s - 3]);
365
+ break;
366
+ case 14:
367
+ r.addEntity(a[s - 2]);
368
+ break;
369
+ case 15:
370
+ r.addEntity(a[s - 4]), r.setClass([a[s - 4]], a[s - 2]);
371
+ break;
372
+ case 16:
373
+ r.addEntity(a[s]);
374
+ break;
375
+ case 17:
376
+ r.addEntity(a[s - 2]), r.setClass([a[s - 2]], a[s]);
377
+ break;
378
+ case 18:
379
+ r.addEntity(a[s - 6], a[s - 4]), r.addAttributes(a[s - 6], a[s - 1]);
380
+ break;
381
+ case 19:
382
+ r.addEntity(a[s - 8], a[s - 6]), r.addAttributes(a[s - 8], a[s - 1]), r.setClass([a[s - 8]], a[s - 3]);
383
+ break;
384
+ case 20:
385
+ r.addEntity(a[s - 5], a[s - 3]);
386
+ break;
387
+ case 21:
388
+ r.addEntity(a[s - 7], a[s - 5]), r.setClass([a[s - 7]], a[s - 2]);
389
+ break;
390
+ case 22:
391
+ r.addEntity(a[s - 3], a[s - 1]);
392
+ break;
393
+ case 23:
394
+ r.addEntity(a[s - 5], a[s - 3]), r.setClass([a[s - 5]], a[s]);
395
+ break;
396
+ case 24:
397
+ case 25:
398
+ this.$ = a[s].trim(), r.setAccTitle(this.$);
399
+ break;
400
+ case 26:
401
+ case 27:
402
+ this.$ = a[s].trim(), r.setAccDescription(this.$);
403
+ break;
404
+ case 32:
405
+ r.setDirection("TB");
406
+ break;
407
+ case 33:
408
+ r.setDirection("BT");
409
+ break;
410
+ case 34:
411
+ r.setDirection("RL");
412
+ break;
413
+ case 35:
414
+ r.setDirection("LR");
415
+ break;
416
+ case 36:
417
+ this.$ = a[s - 3], r.addClass(a[s - 2], a[s - 1]);
418
+ break;
419
+ case 37:
420
+ case 38:
421
+ case 56:
422
+ case 64:
423
+ this.$ = [a[s]];
424
+ break;
425
+ case 39:
426
+ case 40:
427
+ this.$ = a[s - 2].concat([a[s]]);
428
+ break;
429
+ case 41:
430
+ this.$ = a[s - 2], r.setClass(a[s - 1], a[s]);
431
+ break;
432
+ case 42:
433
+ this.$ = a[s - 3], r.addCssStyles(a[s - 2], a[s - 1]);
434
+ break;
435
+ case 43:
436
+ this.$ = [a[s]];
437
+ break;
438
+ case 44:
439
+ a[s - 2].push(a[s]), this.$ = a[s - 2];
440
+ break;
441
+ case 46:
442
+ this.$ = a[s - 1] + a[s];
443
+ break;
444
+ case 54:
445
+ case 76:
446
+ case 77:
447
+ this.$ = a[s].replace(/"/g, "");
448
+ break;
449
+ case 55:
450
+ case 78:
451
+ this.$ = a[s];
452
+ break;
453
+ case 57:
454
+ a[s].push(a[s - 1]), this.$ = a[s];
455
+ break;
456
+ case 58:
457
+ this.$ = {
458
+ type: a[s - 1],
459
+ name: a[s]
460
+ };
461
+ break;
462
+ case 59:
463
+ this.$ = {
464
+ type: a[s - 2],
465
+ name: a[s - 1],
466
+ keys: a[s]
467
+ };
468
+ break;
469
+ case 60:
470
+ this.$ = {
471
+ type: a[s - 2],
472
+ name: a[s - 1],
473
+ comment: a[s]
474
+ };
475
+ break;
476
+ case 61:
477
+ this.$ = {
478
+ type: a[s - 3],
479
+ name: a[s - 2],
480
+ keys: a[s - 1],
481
+ comment: a[s]
482
+ };
483
+ break;
484
+ case 62:
485
+ case 63:
486
+ case 66:
487
+ this.$ = a[s];
488
+ break;
489
+ case 65:
490
+ a[s - 2].push(a[s]), this.$ = a[s - 2];
491
+ break;
492
+ case 67:
493
+ this.$ = a[s].replace(/"/g, "");
494
+ break;
495
+ case 68:
496
+ this.$ = {
497
+ cardA: a[s],
498
+ relType: a[s - 1],
499
+ cardB: a[s - 2]
500
+ };
501
+ break;
502
+ case 69:
503
+ this.$ = r.Cardinality.ZERO_OR_ONE;
504
+ break;
505
+ case 70:
506
+ this.$ = r.Cardinality.ZERO_OR_MORE;
507
+ break;
508
+ case 71:
509
+ this.$ = r.Cardinality.ONE_OR_MORE;
510
+ break;
511
+ case 72:
512
+ this.$ = r.Cardinality.ONLY_ONE;
513
+ break;
514
+ case 73:
515
+ this.$ = r.Cardinality.MD_PARENT;
516
+ break;
517
+ case 74:
518
+ this.$ = r.Identification.NON_IDENTIFYING;
519
+ break;
520
+ case 75:
521
+ this.$ = r.Identification.IDENTIFYING;
522
+ break;
523
+ }
524
+ }, "anonymous"),
525
+ table: [
526
+ {
527
+ 3: 1,
528
+ 4: [1, 2]
529
+ },
530
+ { 1: [3] },
531
+ e(t, [2, 2], { 5: 3 }),
532
+ {
533
+ 6: [1, 4],
534
+ 7: 5,
535
+ 8: [1, 6],
536
+ 9: 7,
537
+ 10: [1, 8],
538
+ 11: 9,
539
+ 22: n,
540
+ 24: i,
541
+ 26: a,
542
+ 28: o,
543
+ 29: 14,
544
+ 30: 15,
545
+ 31: 16,
546
+ 32: 17,
547
+ 33: s,
548
+ 34: c,
549
+ 35: l,
550
+ 36: u,
551
+ 37: d,
552
+ 40: f,
553
+ 43: p,
554
+ 44: m,
555
+ 50: h
556
+ },
557
+ e(t, [2, 7], { 1: [2, 1] }),
558
+ e(t, [2, 3]),
559
+ {
560
+ 9: 27,
561
+ 11: 9,
562
+ 22: n,
563
+ 24: i,
564
+ 26: a,
565
+ 28: o,
566
+ 29: 14,
567
+ 30: 15,
568
+ 31: 16,
569
+ 32: 17,
570
+ 33: s,
571
+ 34: c,
572
+ 35: l,
573
+ 36: u,
574
+ 37: d,
575
+ 40: f,
576
+ 43: p,
577
+ 44: m,
578
+ 50: h
579
+ },
580
+ e(t, [2, 5]),
581
+ e(t, [2, 6]),
582
+ e(t, [2, 16], {
583
+ 12: 28,
584
+ 61: 32,
585
+ 15: [1, 29],
586
+ 17: [1, 30],
587
+ 20: [1, 31],
588
+ 63: g,
589
+ 64: _,
590
+ 65: v,
591
+ 66: y,
592
+ 67: b
593
+ }),
594
+ { 23: [1, 38] },
595
+ { 25: [1, 39] },
596
+ { 27: [1, 40] },
597
+ e(t, [2, 27]),
598
+ e(t, [2, 28]),
599
+ e(t, [2, 29]),
600
+ e(t, [2, 30]),
601
+ e(t, [2, 31]),
602
+ e(x, [2, 54]),
603
+ e(x, [2, 55]),
604
+ e(t, [2, 32]),
605
+ e(t, [2, 33]),
606
+ e(t, [2, 34]),
607
+ e(t, [2, 35]),
608
+ {
609
+ 16: 41,
610
+ 40: S,
611
+ 41: C
612
+ },
613
+ {
614
+ 16: 44,
615
+ 40: S,
616
+ 41: C
617
+ },
618
+ {
619
+ 16: 45,
620
+ 40: S,
621
+ 41: C
622
+ },
623
+ e(t, [2, 4]),
624
+ {
625
+ 11: 46,
626
+ 40: f,
627
+ 50: h
628
+ },
629
+ {
630
+ 16: 47,
631
+ 40: S,
632
+ 41: C
633
+ },
634
+ {
635
+ 18: 48,
636
+ 19: [1, 49],
637
+ 51: 50,
638
+ 52: 51,
639
+ 56: w
640
+ },
641
+ {
642
+ 11: 53,
643
+ 40: f,
644
+ 50: h
645
+ },
646
+ {
647
+ 62: 54,
648
+ 68: [1, 55],
649
+ 69: [1, 56]
650
+ },
651
+ e(T, [2, 69]),
652
+ e(T, [2, 70]),
653
+ e(T, [2, 71]),
654
+ e(T, [2, 72]),
655
+ e(T, [2, 73]),
656
+ e(t, [2, 24]),
657
+ e(t, [2, 25]),
658
+ e(t, [2, 26]),
659
+ {
660
+ 13: E,
661
+ 38: 57,
662
+ 41: D,
663
+ 42: O,
664
+ 45: 59,
665
+ 46: 60,
666
+ 48: k,
667
+ 49: A
668
+ },
669
+ e(j, [2, 37]),
670
+ e(j, [2, 38]),
671
+ {
672
+ 16: 65,
673
+ 40: S,
674
+ 41: C,
675
+ 42: O
676
+ },
677
+ {
678
+ 13: E,
679
+ 38: 66,
680
+ 41: D,
681
+ 42: O,
682
+ 45: 59,
683
+ 46: 60,
684
+ 48: k,
685
+ 49: A
686
+ },
687
+ {
688
+ 13: [1, 67],
689
+ 15: [1, 68]
690
+ },
691
+ e(t, [2, 17], {
692
+ 61: 32,
693
+ 12: 69,
694
+ 17: [1, 70],
695
+ 42: O,
696
+ 63: g,
697
+ 64: _,
698
+ 65: v,
699
+ 66: y,
700
+ 67: b
701
+ }),
702
+ { 19: [1, 71] },
703
+ e(t, [2, 14]),
704
+ {
705
+ 18: 72,
706
+ 19: [2, 56],
707
+ 51: 50,
708
+ 52: 51,
709
+ 56: w
710
+ },
711
+ {
712
+ 53: 73,
713
+ 56: [1, 74]
714
+ },
715
+ { 56: [2, 62] },
716
+ { 21: [1, 75] },
717
+ {
718
+ 61: 76,
719
+ 63: g,
720
+ 64: _,
721
+ 65: v,
722
+ 66: y,
723
+ 67: b
724
+ },
725
+ e(M, [2, 74]),
726
+ e(M, [2, 75]),
727
+ {
728
+ 6: N,
729
+ 10: P,
730
+ 39: 77,
731
+ 42: F,
732
+ 47: I
733
+ },
734
+ {
735
+ 40: [1, 82],
736
+ 41: [1, 83]
737
+ },
738
+ e(L, [2, 43], {
739
+ 46: 84,
740
+ 13: E,
741
+ 41: D,
742
+ 48: k,
743
+ 49: A
744
+ }),
745
+ e(R, [2, 45]),
746
+ e(R, [2, 50]),
747
+ e(R, [2, 51]),
748
+ e(R, [2, 52]),
749
+ e(R, [2, 53]),
750
+ e(t, [2, 41], { 42: O }),
751
+ {
752
+ 6: N,
753
+ 10: P,
754
+ 39: 85,
755
+ 42: F,
756
+ 47: I
757
+ },
758
+ {
759
+ 14: 86,
760
+ 40: z,
761
+ 50: B,
762
+ 70: V
763
+ },
764
+ {
765
+ 16: 90,
766
+ 40: S,
767
+ 41: C
768
+ },
769
+ {
770
+ 11: 91,
771
+ 40: f,
772
+ 50: h
773
+ },
774
+ {
775
+ 18: 92,
776
+ 19: [1, 93],
777
+ 51: 50,
778
+ 52: 51,
779
+ 56: w
780
+ },
781
+ e(t, [2, 12]),
782
+ { 19: [2, 57] },
783
+ e(H, [2, 58], {
784
+ 54: 94,
785
+ 55: 95,
786
+ 57: 96,
787
+ 59: U,
788
+ 60: W
789
+ }),
790
+ e([
791
+ 19,
792
+ 56,
793
+ 59,
794
+ 60
795
+ ], [2, 63]),
796
+ e(t, [2, 22], {
797
+ 15: [1, 100],
798
+ 17: [1, 99]
799
+ }),
800
+ e([40, 50], [2, 68]),
801
+ e(t, [2, 36]),
802
+ {
803
+ 13: E,
804
+ 41: D,
805
+ 45: 101,
806
+ 46: 60,
807
+ 48: k,
808
+ 49: A
809
+ },
810
+ e(t, [2, 47]),
811
+ e(t, [2, 48]),
812
+ e(t, [2, 49]),
813
+ e(j, [2, 39]),
814
+ e(j, [2, 40]),
815
+ e(R, [2, 46]),
816
+ e(t, [2, 42]),
817
+ e(t, [2, 8]),
818
+ e(t, [2, 76]),
819
+ e(t, [2, 77]),
820
+ e(t, [2, 78]),
821
+ {
822
+ 13: [1, 102],
823
+ 42: O
824
+ },
825
+ {
826
+ 13: [1, 104],
827
+ 15: [1, 103]
828
+ },
829
+ { 19: [1, 105] },
830
+ e(t, [2, 15]),
831
+ e(H, [2, 59], {
832
+ 55: 106,
833
+ 58: [1, 107],
834
+ 60: W
835
+ }),
836
+ e(H, [2, 60]),
837
+ e(G, [2, 64]),
838
+ e(H, [2, 67]),
839
+ e(G, [2, 66]),
840
+ {
841
+ 18: 108,
842
+ 19: [1, 109],
843
+ 51: 50,
844
+ 52: 51,
845
+ 56: w
846
+ },
847
+ {
848
+ 16: 110,
849
+ 40: S,
850
+ 41: C
851
+ },
852
+ e(L, [2, 44], {
853
+ 46: 84,
854
+ 13: E,
855
+ 41: D,
856
+ 48: k,
857
+ 49: A
858
+ }),
859
+ {
860
+ 14: 111,
861
+ 40: z,
862
+ 50: B,
863
+ 70: V
864
+ },
865
+ {
866
+ 16: 112,
867
+ 40: S,
868
+ 41: C
869
+ },
870
+ {
871
+ 14: 113,
872
+ 40: z,
873
+ 50: B,
874
+ 70: V
875
+ },
876
+ e(t, [2, 13]),
877
+ e(H, [2, 61]),
878
+ {
879
+ 57: 114,
880
+ 59: U
881
+ },
882
+ { 19: [1, 115] },
883
+ e(t, [2, 20]),
884
+ e(t, [2, 23], {
885
+ 17: [1, 116],
886
+ 42: O
887
+ }),
888
+ e(t, [2, 11]),
889
+ {
890
+ 13: [1, 117],
891
+ 42: O
892
+ },
893
+ e(t, [2, 10]),
894
+ e(G, [2, 65]),
895
+ e(t, [2, 18]),
896
+ {
897
+ 18: 118,
898
+ 19: [1, 119],
899
+ 51: 50,
900
+ 52: 51,
901
+ 56: w
902
+ },
903
+ {
904
+ 14: 120,
905
+ 40: z,
906
+ 50: B,
907
+ 70: V
908
+ },
909
+ { 19: [1, 121] },
910
+ e(t, [2, 21]),
911
+ e(t, [2, 9]),
912
+ e(t, [2, 19])
913
+ ],
914
+ defaultActions: {
915
+ 52: [2, 62],
916
+ 72: [2, 57]
917
+ },
918
+ parseError: /* @__PURE__ */ __name(function(e, t) {
919
+ if (t.recoverable) this.trace(e);
920
+ else {
921
+ var n = Error(e);
922
+ throw n.hash = t, n;
923
+ }
924
+ }, "parseError"),
925
+ parse: /* @__PURE__ */ __name(function(e) {
926
+ var t = this, n = [0], i = [], a = [null], o = [], s = this.table, c = "", l = 0, u = 0, d = 0, f = 2, p = 1, m = o.slice.call(arguments, 1), h = Object.create(this.lexer), g = { yy: {} };
927
+ for (var _ in this.yy) Object.prototype.hasOwnProperty.call(this.yy, _) && (g.yy[_] = this.yy[_]);
928
+ h.setInput(e, g.yy), g.yy.lexer = h, g.yy.parser = this, h.yylloc === void 0 && (h.yylloc = {});
929
+ var v = h.yylloc;
930
+ o.push(v);
931
+ var y = h.options && h.options.ranges;
932
+ typeof g.yy.parseError == "function" ? this.parseError = g.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
933
+ function b(e) {
934
+ n.length -= 2 * e, a.length -= e, o.length -= e;
935
+ }
936
+ __name(b, "popStack");
937
+ function x() {
938
+ var e = i.pop() || h.lex() || p;
939
+ return typeof e != "number" && (e instanceof Array && (i = e, e = i.pop()), e = t.symbols_[e] || e), e;
940
+ }
941
+ __name(x, "lex");
942
+ for (var S, C, w, T, E, D = {}, O, k, A, j;;) {
943
+ if (w = n[n.length - 1], this.defaultActions[w] ? T = this.defaultActions[w] : (S ??= x(), T = s[w] && s[w][S]), T === void 0 || !T.length || !T[0]) {
944
+ var M = "";
945
+ for (O in j = [], s[w]) this.terminals_[O] && O > f && j.push("'" + this.terminals_[O] + "'");
946
+ M = h.showPosition ? "Parse error on line " + (l + 1) + ":\n" + h.showPosition() + "\nExpecting " + j.join(", ") + ", got '" + (this.terminals_[S] || S) + "'" : "Parse error on line " + (l + 1) + ": Unexpected " + (S == p ? "end of input" : "'" + (this.terminals_[S] || S) + "'"), this.parseError(M, {
947
+ text: h.match,
948
+ token: this.terminals_[S] || S,
949
+ line: h.yylineno,
950
+ loc: v,
951
+ expected: j
952
+ });
953
+ }
954
+ if (T[0] instanceof Array && T.length > 1) throw Error("Parse Error: multiple actions possible at state: " + w + ", token: " + S);
955
+ switch (T[0]) {
956
+ case 1:
957
+ n.push(S), a.push(h.yytext), o.push(h.yylloc), n.push(T[1]), S = null, C ? (S = C, C = null) : (u = h.yyleng, c = h.yytext, l = h.yylineno, v = h.yylloc, d > 0 && d--);
958
+ break;
959
+ case 2:
960
+ if (k = this.productions_[T[1]][1], D.$ = a[a.length - k], D._$ = {
961
+ first_line: o[o.length - (k || 1)].first_line,
962
+ last_line: o[o.length - 1].last_line,
963
+ first_column: o[o.length - (k || 1)].first_column,
964
+ last_column: o[o.length - 1].last_column
965
+ }, y && (D._$.range = [o[o.length - (k || 1)].range[0], o[o.length - 1].range[1]]), E = this.performAction.apply(D, [
966
+ c,
967
+ u,
968
+ l,
969
+ g.yy,
970
+ T[1],
971
+ a,
972
+ o
973
+ ].concat(m)), E !== void 0) return E;
974
+ k && (n = n.slice(0, -1 * k * 2), a = a.slice(0, -1 * k), o = o.slice(0, -1 * k)), n.push(this.productions_[T[1]][0]), a.push(D.$), o.push(D._$), A = s[n[n.length - 2]][n[n.length - 1]], n.push(A);
975
+ break;
976
+ case 3: return !0;
977
+ }
978
+ }
979
+ return !0;
980
+ }, "parse")
981
+ };
982
+ K.lexer = /* @__PURE__ */ (function() {
983
+ return {
984
+ EOF: 1,
985
+ parseError: /* @__PURE__ */ __name(function(e, t) {
986
+ if (this.yy.parser) this.yy.parser.parseError(e, t);
987
+ else throw Error(e);
988
+ }, "parseError"),
989
+ setInput: /* @__PURE__ */ __name(function(e, t) {
990
+ return this.yy = t || this.yy || {}, this._input = e, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
991
+ first_line: 1,
992
+ first_column: 0,
993
+ last_line: 1,
994
+ last_column: 0
995
+ }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
996
+ }, "setInput"),
997
+ input: /* @__PURE__ */ __name(function() {
998
+ var e = this._input[0];
999
+ return this.yytext += e, this.yyleng++, this.offset++, this.match += e, this.matched += e, e.match(/(?:\r\n?|\n).*/g) ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), e;
1000
+ }, "input"),
1001
+ unput: /* @__PURE__ */ __name(function(e) {
1002
+ var t = e.length, n = e.split(/(?:\r\n?|\n)/g);
1003
+ this._input = e + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - t), this.offset -= t;
1004
+ var r = this.match.split(/(?:\r\n?|\n)/g);
1005
+ this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), n.length - 1 && (this.yylineno -= n.length - 1);
1006
+ var i = this.yylloc.range;
1007
+ return this.yylloc = {
1008
+ first_line: this.yylloc.first_line,
1009
+ last_line: this.yylineno + 1,
1010
+ first_column: this.yylloc.first_column,
1011
+ last_column: n ? (n.length === r.length ? this.yylloc.first_column : 0) + r[r.length - n.length].length - n[0].length : this.yylloc.first_column - t
1012
+ }, this.options.ranges && (this.yylloc.range = [i[0], i[0] + this.yyleng - t]), this.yyleng = this.yytext.length, this;
1013
+ }, "unput"),
1014
+ more: /* @__PURE__ */ __name(function() {
1015
+ return this._more = !0, this;
1016
+ }, "more"),
1017
+ reject: /* @__PURE__ */ __name(function() {
1018
+ if (this.options.backtrack_lexer) this._backtrack = !0;
1019
+ 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(), {
1020
+ text: "",
1021
+ token: null,
1022
+ line: this.yylineno
1023
+ });
1024
+ return this;
1025
+ }, "reject"),
1026
+ less: /* @__PURE__ */ __name(function(e) {
1027
+ this.unput(this.match.slice(e));
1028
+ }, "less"),
1029
+ pastInput: /* @__PURE__ */ __name(function() {
1030
+ var e = this.matched.substr(0, this.matched.length - this.match.length);
1031
+ return (e.length > 20 ? "..." : "") + e.substr(-20).replace(/\n/g, "");
1032
+ }, "pastInput"),
1033
+ upcomingInput: /* @__PURE__ */ __name(function() {
1034
+ var e = this.match;
1035
+ return e.length < 20 && (e += this._input.substr(0, 20 - e.length)), (e.substr(0, 20) + (e.length > 20 ? "..." : "")).replace(/\n/g, "");
1036
+ }, "upcomingInput"),
1037
+ showPosition: /* @__PURE__ */ __name(function() {
1038
+ var e = this.pastInput(), t = Array(e.length + 1).join("-");
1039
+ return e + this.upcomingInput() + "\n" + t + "^";
1040
+ }, "showPosition"),
1041
+ test_match: /* @__PURE__ */ __name(function(e, t) {
1042
+ var n, r, i;
1043
+ if (this.options.backtrack_lexer && (i = {
1044
+ yylineno: this.yylineno,
1045
+ yylloc: {
1046
+ first_line: this.yylloc.first_line,
1047
+ last_line: this.last_line,
1048
+ first_column: this.yylloc.first_column,
1049
+ last_column: this.yylloc.last_column
1050
+ },
1051
+ yytext: this.yytext,
1052
+ match: this.match,
1053
+ matches: this.matches,
1054
+ matched: this.matched,
1055
+ yyleng: this.yyleng,
1056
+ offset: this.offset,
1057
+ _more: this._more,
1058
+ _input: this._input,
1059
+ yy: this.yy,
1060
+ conditionStack: this.conditionStack.slice(0),
1061
+ done: this.done
1062
+ }, this.options.ranges && (i.yylloc.range = this.yylloc.range.slice(0))), r = e[0].match(/(?:\r\n?|\n).*/g), r && (this.yylineno += r.length), this.yylloc = {
1063
+ first_line: this.yylloc.last_line,
1064
+ last_line: this.yylineno + 1,
1065
+ first_column: this.yylloc.last_column,
1066
+ last_column: r ? r[r.length - 1].length - r[r.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + e[0].length
1067
+ }, this.yytext += e[0], this.match += e[0], this.matches = e, 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(e[0].length), this.matched += e[0], n = this.performAction.call(this, this.yy, this, t, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), n) return n;
1068
+ if (this._backtrack) {
1069
+ for (var a in i) this[a] = i[a];
1070
+ return !1;
1071
+ }
1072
+ return !1;
1073
+ }, "test_match"),
1074
+ next: /* @__PURE__ */ __name(function() {
1075
+ if (this.done) return this.EOF;
1076
+ this._input || (this.done = !0);
1077
+ var e, t, n, r;
1078
+ this._more || (this.yytext = "", this.match = "");
1079
+ for (var i = this._currentRules(), a = 0; a < i.length; a++) if (n = this._input.match(this.rules[i[a]]), n && (!t || n[0].length > t[0].length)) {
1080
+ if (t = n, r = a, this.options.backtrack_lexer) {
1081
+ if (e = this.test_match(n, i[a]), e !== !1) return e;
1082
+ if (this._backtrack) {
1083
+ t = !1;
1084
+ continue;
1085
+ } else return !1;
1086
+ } else if (!this.options.flex) break;
1087
+ }
1088
+ return t ? (e = this.test_match(t, i[r]), e === !1 ? !1 : e) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), {
1089
+ text: "",
1090
+ token: null,
1091
+ line: this.yylineno
1092
+ });
1093
+ }, "next"),
1094
+ lex: /* @__PURE__ */ __name(function() {
1095
+ return this.next() || this.lex();
1096
+ }, "lex"),
1097
+ begin: /* @__PURE__ */ __name(function(e) {
1098
+ this.conditionStack.push(e);
1099
+ }, "begin"),
1100
+ popState: /* @__PURE__ */ __name(function() {
1101
+ return this.conditionStack.length - 1 > 0 ? this.conditionStack.pop() : this.conditionStack[0];
1102
+ }, "popState"),
1103
+ _currentRules: /* @__PURE__ */ __name(function() {
1104
+ return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
1105
+ }, "_currentRules"),
1106
+ topState: /* @__PURE__ */ __name(function(e) {
1107
+ return e = this.conditionStack.length - 1 - Math.abs(e || 0), e >= 0 ? this.conditionStack[e] : "INITIAL";
1108
+ }, "topState"),
1109
+ pushState: /* @__PURE__ */ __name(function(e) {
1110
+ this.begin(e);
1111
+ }, "pushState"),
1112
+ stateStackSize: /* @__PURE__ */ __name(function() {
1113
+ return this.conditionStack.length;
1114
+ }, "stateStackSize"),
1115
+ options: { "case-insensitive": !0 },
1116
+ performAction: /* @__PURE__ */ __name(function(e, t, n, r) {
1117
+ switch (n) {
1118
+ case 0: return this.begin("acc_title"), 24;
1119
+ case 1: return this.popState(), "acc_title_value";
1120
+ case 2: return this.begin("acc_descr"), 26;
1121
+ case 3: return this.popState(), "acc_descr_value";
1122
+ case 4:
1123
+ this.begin("acc_descr_multiline");
1124
+ break;
1125
+ case 5:
1126
+ this.popState();
1127
+ break;
1128
+ case 6: return "acc_descr_multiline_value";
1129
+ case 7: return 33;
1130
+ case 8: return 34;
1131
+ case 9: return 35;
1132
+ case 10: return 36;
1133
+ case 11: return 10;
1134
+ case 12: break;
1135
+ case 13: return 8;
1136
+ case 14: return 50;
1137
+ case 15: return 70;
1138
+ case 16: return 4;
1139
+ case 17: return this.begin("block"), 17;
1140
+ case 18: return 49;
1141
+ case 19: return 49;
1142
+ case 20: return 42;
1143
+ case 21: return 15;
1144
+ case 22: return 13;
1145
+ case 23: break;
1146
+ case 24: return 59;
1147
+ case 25: return 56;
1148
+ case 26: return 56;
1149
+ case 27: return 60;
1150
+ case 28: break;
1151
+ case 29: return this.popState(), 19;
1152
+ case 30: return t.yytext[0];
1153
+ case 31: return 20;
1154
+ case 32: return 21;
1155
+ case 33: return this.begin("style"), 44;
1156
+ case 34: return this.popState(), 10;
1157
+ case 35: break;
1158
+ case 36: return 13;
1159
+ case 37: return 42;
1160
+ case 38: return 49;
1161
+ case 39: return this.begin("style"), 37;
1162
+ case 40: return 43;
1163
+ case 41: return 63;
1164
+ case 42: return 65;
1165
+ case 43: return 65;
1166
+ case 44: return 65;
1167
+ case 45: return 63;
1168
+ case 46: return 63;
1169
+ case 47: return 64;
1170
+ case 48: return 64;
1171
+ case 49: return 64;
1172
+ case 50: return 64;
1173
+ case 51: return 64;
1174
+ case 52: return 65;
1175
+ case 53: return 64;
1176
+ case 54: return 65;
1177
+ case 55: return 66;
1178
+ case 56: return 66;
1179
+ case 57: return 66;
1180
+ case 58: return 66;
1181
+ case 59: return 63;
1182
+ case 60: return 64;
1183
+ case 61: return 65;
1184
+ case 62: return 67;
1185
+ case 63: return 68;
1186
+ case 64: return 69;
1187
+ case 65: return 69;
1188
+ case 66: return 68;
1189
+ case 67: return 68;
1190
+ case 68: return 68;
1191
+ case 69: return 41;
1192
+ case 70: return 47;
1193
+ case 71: return 40;
1194
+ case 72: return 48;
1195
+ case 73: return t.yytext[0];
1196
+ case 74: return 6;
1197
+ }
1198
+ }, "anonymous"),
1199
+ rules: [
1200
+ /^(?:accTitle\s*:\s*)/i,
1201
+ /^(?:(?!\n||)*[^\n]*)/i,
1202
+ /^(?:accDescr\s*:\s*)/i,
1203
+ /^(?:(?!\n||)*[^\n]*)/i,
1204
+ /^(?:accDescr\s*\{\s*)/i,
1205
+ /^(?:[\}])/i,
1206
+ /^(?:[^\}]*)/i,
1207
+ /^(?:.*direction\s+TB[^\n]*)/i,
1208
+ /^(?:.*direction\s+BT[^\n]*)/i,
1209
+ /^(?:.*direction\s+RL[^\n]*)/i,
1210
+ /^(?:.*direction\s+LR[^\n]*)/i,
1211
+ /^(?:[\n]+)/i,
1212
+ /^(?:\s+)/i,
1213
+ /^(?:[\s]+)/i,
1214
+ /^(?:"[^"%\r\n\v\b\\]+")/i,
1215
+ /^(?:"[^"]*")/i,
1216
+ /^(?:erDiagram\b)/i,
1217
+ /^(?:\{)/i,
1218
+ /^(?:#)/i,
1219
+ /^(?:#)/i,
1220
+ /^(?:,)/i,
1221
+ /^(?::::)/i,
1222
+ /^(?::)/i,
1223
+ /^(?:\s+)/i,
1224
+ /^(?:\b((?:PK)|(?:FK)|(?:UK))\b)/i,
1225
+ /^(?:([^\s]*)[~].*[~]([^\s]*))/i,
1226
+ /^(?:([\*A-Za-z_\u00C0-\uFFFF][A-Za-z0-9\-\_\[\]\(\)\u00C0-\uFFFF\*]*))/i,
1227
+ /^(?:"[^"]*")/i,
1228
+ /^(?:[\n]+)/i,
1229
+ /^(?:\})/i,
1230
+ /^(?:.)/i,
1231
+ /^(?:\[)/i,
1232
+ /^(?:\])/i,
1233
+ /^(?:style\b)/i,
1234
+ /^(?:[\n]+)/i,
1235
+ /^(?:\s+)/i,
1236
+ /^(?::)/i,
1237
+ /^(?:,)/i,
1238
+ /^(?:#)/i,
1239
+ /^(?:classDef\b)/i,
1240
+ /^(?:class\b)/i,
1241
+ /^(?:one or zero\b)/i,
1242
+ /^(?:one or more\b)/i,
1243
+ /^(?:one or many\b)/i,
1244
+ /^(?:1\+)/i,
1245
+ /^(?:\|o\b)/i,
1246
+ /^(?:zero or one\b)/i,
1247
+ /^(?:zero or more\b)/i,
1248
+ /^(?:zero or many\b)/i,
1249
+ /^(?:0\+)/i,
1250
+ /^(?:\}o\b)/i,
1251
+ /^(?:many\(0\))/i,
1252
+ /^(?:many\(1\))/i,
1253
+ /^(?:many\b)/i,
1254
+ /^(?:\}\|)/i,
1255
+ /^(?:one\b)/i,
1256
+ /^(?:only one\b)/i,
1257
+ /^(?:1\b)/i,
1258
+ /^(?:\|\|)/i,
1259
+ /^(?:o\|)/i,
1260
+ /^(?:o\{)/i,
1261
+ /^(?:\|\{)/i,
1262
+ /^(?:\s*u\b)/i,
1263
+ /^(?:\.\.)/i,
1264
+ /^(?:--)/i,
1265
+ /^(?:to\b)/i,
1266
+ /^(?:optionally to\b)/i,
1267
+ /^(?:\.-)/i,
1268
+ /^(?:-\.)/i,
1269
+ /^(?:([^\x00-\x7F]|\w|-|\*)+)/i,
1270
+ /^(?:;)/i,
1271
+ /^(?:([^\x00-\x7F]|\w|-|\*)+)/i,
1272
+ /^(?:[0-9])/i,
1273
+ /^(?:.)/i,
1274
+ /^(?:$)/i
1275
+ ],
1276
+ conditions: {
1277
+ style: {
1278
+ rules: [
1279
+ 34,
1280
+ 35,
1281
+ 36,
1282
+ 37,
1283
+ 38,
1284
+ 69,
1285
+ 70
1286
+ ],
1287
+ inclusive: !1
1288
+ },
1289
+ acc_descr_multiline: {
1290
+ rules: [5, 6],
1291
+ inclusive: !1
1292
+ },
1293
+ acc_descr: {
1294
+ rules: [3],
1295
+ inclusive: !1
1296
+ },
1297
+ acc_title: {
1298
+ rules: [1],
1299
+ inclusive: !1
1300
+ },
1301
+ block: {
1302
+ rules: [
1303
+ 23,
1304
+ 24,
1305
+ 25,
1306
+ 26,
1307
+ 27,
1308
+ 28,
1309
+ 29,
1310
+ 30
1311
+ ],
1312
+ inclusive: !1
1313
+ },
1314
+ INITIAL: {
1315
+ rules: [
1316
+ 0,
1317
+ 2,
1318
+ 4,
1319
+ 7,
1320
+ 8,
1321
+ 9,
1322
+ 10,
1323
+ 11,
1324
+ 12,
1325
+ 13,
1326
+ 14,
1327
+ 15,
1328
+ 16,
1329
+ 17,
1330
+ 18,
1331
+ 19,
1332
+ 20,
1333
+ 21,
1334
+ 22,
1335
+ 31,
1336
+ 32,
1337
+ 33,
1338
+ 39,
1339
+ 40,
1340
+ 41,
1341
+ 42,
1342
+ 43,
1343
+ 44,
1344
+ 45,
1345
+ 46,
1346
+ 47,
1347
+ 48,
1348
+ 49,
1349
+ 50,
1350
+ 51,
1351
+ 52,
1352
+ 53,
1353
+ 54,
1354
+ 55,
1355
+ 56,
1356
+ 57,
1357
+ 58,
1358
+ 59,
1359
+ 60,
1360
+ 61,
1361
+ 62,
1362
+ 63,
1363
+ 64,
1364
+ 65,
1365
+ 66,
1366
+ 67,
1367
+ 68,
1368
+ 71,
1369
+ 72,
1370
+ 73,
1371
+ 74
1372
+ ],
1373
+ inclusive: !0
1374
+ }
1375
+ }
1376
+ };
1377
+ })();
1378
+ function q() {
1379
+ this.yy = {};
1380
+ }
1381
+ return __name(q, "Parser"), q.prototype = K, K.Parser = q, new q();
1382
+ })();
1383
+ parser.parser = parser;
1384
+ var erDiagram_default = parser, ErDB = class {
1385
+ constructor() {
1386
+ this.entities = /* @__PURE__ */ new Map(), this.relationships = [], this.classes = /* @__PURE__ */ new Map(), this.direction = "TB", this.Cardinality = {
1387
+ ZERO_OR_ONE: "ZERO_OR_ONE",
1388
+ ZERO_OR_MORE: "ZERO_OR_MORE",
1389
+ ONE_OR_MORE: "ONE_OR_MORE",
1390
+ ONLY_ONE: "ONLY_ONE",
1391
+ MD_PARENT: "MD_PARENT"
1392
+ }, this.Identification = {
1393
+ NON_IDENTIFYING: "NON_IDENTIFYING",
1394
+ IDENTIFYING: "IDENTIFYING"
1395
+ }, this.setAccTitle = setAccTitle, this.getAccTitle = getAccTitle, this.setAccDescription = setAccDescription, this.getAccDescription = getAccDescription, this.setDiagramTitle = setDiagramTitle, this.getDiagramTitle = getDiagramTitle, this.getConfig = /* @__PURE__ */ __name(() => getConfig2().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);
1396
+ }
1397
+ static #_ = __name(this, "ErDB");
1398
+ addEntity(e, t = "") {
1399
+ return this.entities.has(e) ? !this.entities.get(e)?.alias && t && (this.entities.get(e).alias = t, log.info(`Add alias '${t}' to entity '${e}'`)) : (this.entities.set(e, {
1400
+ id: `entity-${e}-${this.entities.size}`,
1401
+ label: e,
1402
+ attributes: [],
1403
+ alias: t,
1404
+ shape: "erBox",
1405
+ look: getConfig2().look ?? "default",
1406
+ cssClasses: "default",
1407
+ cssStyles: []
1408
+ }), log.info("Added new entity :", e)), this.entities.get(e);
1409
+ }
1410
+ getEntity(e) {
1411
+ return this.entities.get(e);
1412
+ }
1413
+ getEntities() {
1414
+ return this.entities;
1415
+ }
1416
+ getClasses() {
1417
+ return this.classes;
1418
+ }
1419
+ addAttributes(e, t) {
1420
+ let r = this.addEntity(e), i;
1421
+ for (i = t.length - 1; i >= 0; i--) t[i].keys || (t[i].keys = []), t[i].comment || (t[i].comment = ""), r.attributes.push(t[i]), log.debug("Added attribute ", t[i].name);
1422
+ }
1423
+ addRelationship(e, t, r, i) {
1424
+ let a = this.entities.get(e), o = this.entities.get(r);
1425
+ if (!a || !o) return;
1426
+ let s = {
1427
+ entityA: a.id,
1428
+ roleA: t,
1429
+ entityB: o.id,
1430
+ relSpec: i
1431
+ };
1432
+ this.relationships.push(s), log.debug("Added new relationship :", s);
1433
+ }
1434
+ getRelationships() {
1435
+ return this.relationships;
1436
+ }
1437
+ getDirection() {
1438
+ return this.direction;
1439
+ }
1440
+ setDirection(e) {
1441
+ this.direction = e;
1442
+ }
1443
+ getCompiledStyles(e) {
1444
+ let t = [];
1445
+ for (let n of e) {
1446
+ let e = this.classes.get(n);
1447
+ e?.styles && (t = [...t, ...e.styles ?? []].map((e) => e.trim())), e?.textStyles && (t = [...t, ...e.textStyles ?? []].map((e) => e.trim()));
1448
+ }
1449
+ return t;
1450
+ }
1451
+ addCssStyles(e, t) {
1452
+ for (let n of e) {
1453
+ let e = this.entities.get(n);
1454
+ if (!t || !e) return;
1455
+ for (let n of t) e.cssStyles.push(n);
1456
+ }
1457
+ }
1458
+ addClass(e, t) {
1459
+ e.forEach((e) => {
1460
+ let n = this.classes.get(e);
1461
+ n === void 0 && (n = {
1462
+ id: e,
1463
+ styles: [],
1464
+ textStyles: []
1465
+ }, this.classes.set(e, n)), t && t.forEach(function(e) {
1466
+ if (/color/.exec(e)) {
1467
+ let t = e.replace("fill", "bgFill");
1468
+ n.textStyles.push(t);
1469
+ }
1470
+ n.styles.push(e);
1471
+ });
1472
+ });
1473
+ }
1474
+ setClass(e, t) {
1475
+ for (let n of e) {
1476
+ let e = this.entities.get(n);
1477
+ if (e) for (let n of t) e.cssClasses += " " + n;
1478
+ }
1479
+ }
1480
+ clear() {
1481
+ this.entities = /* @__PURE__ */ new Map(), this.classes = /* @__PURE__ */ new Map(), this.relationships = [], clear();
1482
+ }
1483
+ getData() {
1484
+ let t = [], n = [], r = getConfig2();
1485
+ for (let e of this.entities.keys()) {
1486
+ let n = this.entities.get(e);
1487
+ n && (n.cssCompiledStyles = this.getCompiledStyles(n.cssClasses.split(" ")), t.push(n));
1488
+ }
1489
+ let i = 0;
1490
+ for (let t of this.relationships) {
1491
+ let a = {
1492
+ id: getEdgeId(t.entityA, t.entityB, {
1493
+ prefix: "id",
1494
+ counter: i++
1495
+ }),
1496
+ type: "normal",
1497
+ curve: "basis",
1498
+ start: t.entityA,
1499
+ end: t.entityB,
1500
+ label: t.roleA,
1501
+ labelpos: "c",
1502
+ thickness: "normal",
1503
+ classes: "relationshipLine",
1504
+ arrowTypeStart: t.relSpec.cardB.toLowerCase(),
1505
+ arrowTypeEnd: t.relSpec.cardA.toLowerCase(),
1506
+ pattern: t.relSpec.relType == "IDENTIFYING" ? "solid" : "dashed",
1507
+ look: r.look
1508
+ };
1509
+ n.push(a);
1510
+ }
1511
+ return {
1512
+ nodes: t,
1513
+ edges: n,
1514
+ other: {},
1515
+ config: r,
1516
+ direction: "TB"
1517
+ };
1518
+ }
1519
+ }, erRenderer_unified_exports = {};
1520
+ __export(erRenderer_unified_exports, { draw: () => draw });
1521
+ var draw = /* @__PURE__ */ __name(async function(e, r, i, o) {
1522
+ log.info("REF0:"), log.info("Drawing er diagram (unified)", r);
1523
+ let { securityLevel: s, er: c, layout: l } = getConfig2(), u = o.db.getData(), f = getDiagramElement(r, s);
1524
+ u.type = o.type, u.layoutAlgorithm = getRegisteredLayoutAlgorithm(l), u.config.flowchart.nodeSpacing = c?.nodeSpacing || 140, u.config.flowchart.rankSpacing = c?.rankSpacing || 80, u.direction = o.db.getDirection(), u.markers = [
1525
+ "only_one",
1526
+ "zero_or_one",
1527
+ "one_or_more",
1528
+ "zero_or_more"
1529
+ ], u.diagramId = r, await render(u, f), u.layoutAlgorithm === "elk" && f.select(".edges").lower();
1530
+ let p = f.selectAll("[id*=\"-background\"]");
1531
+ Array.from(p).length > 0 && p.each(function() {
1532
+ let e = select_default(this), t = e.attr("id").replace("-background", ""), n = f.select(`#${CSS.escape(t)}`);
1533
+ if (!n.empty()) {
1534
+ let t = n.attr("transform");
1535
+ e.attr("transform", t);
1536
+ }
1537
+ }), utils_default.insertTitle(f, "erDiagramTitleText", c?.titleTopMargin ?? 25, o.db.getDiagramTitle()), setupViewPortForSVG(f, 8, "erDiagram", c?.useMaxWidth ?? !0);
1538
+ }, "draw"), fade = /* @__PURE__ */ __name((e, t) => {
1539
+ let n = channel_default;
1540
+ return rgba_default(n(e, "r"), n(e, "g"), n(e, "b"), t);
1541
+ }, "fade"), diagram = {
1542
+ parser: erDiagram_default,
1543
+ get db() {
1544
+ return new ErDB();
1545
+ },
1546
+ renderer: erRenderer_unified_exports,
1547
+ styles: /* @__PURE__ */ __name((e) => `
1548
+ .entityBox {
1549
+ fill: ${e.mainBkg};
1550
+ stroke: ${e.nodeBorder};
1551
+ }
1552
+
1553
+ .relationshipLabelBox {
1554
+ fill: ${e.tertiaryColor};
1555
+ opacity: 0.7;
1556
+ background-color: ${e.tertiaryColor};
1557
+ rect {
1558
+ opacity: 0.5;
1559
+ }
1560
+ }
1561
+
1562
+ .labelBkg {
1563
+ background-color: ${fade(e.tertiaryColor, .5)};
1564
+ }
1565
+
1566
+ .edgeLabel .label {
1567
+ fill: ${e.nodeBorder};
1568
+ font-size: 14px;
1569
+ }
1570
+
1571
+ .label {
1572
+ font-family: ${e.fontFamily};
1573
+ color: ${e.nodeTextColor || e.textColor};
1574
+ }
1575
+
1576
+ .edge-pattern-dashed {
1577
+ stroke-dasharray: 8,8;
1578
+ }
1579
+
1580
+ .node rect,
1581
+ .node circle,
1582
+ .node ellipse,
1583
+ .node polygon
1584
+ {
1585
+ fill: ${e.mainBkg};
1586
+ stroke: ${e.nodeBorder};
1587
+ stroke-width: 1px;
1588
+ }
1589
+
1590
+ .relationshipLine {
1591
+ stroke: ${e.lineColor};
1592
+ stroke-width: 1;
1593
+ fill: none;
1594
+ }
1595
+
1596
+ .marker {
1597
+ fill: none !important;
1598
+ stroke: ${e.lineColor} !important;
1599
+ stroke-width: 1;
1600
+ }
1601
+ `, "getStyles")
1602
+ };
1603
+ export { diagram };