@webskill/sdk 0.21.0 → 0.22.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 (132) hide show
  1. package/dist/abnfDiagram-O67JEVCF-DtYFjfqO.js +109 -0
  2. package/dist/agent.d.ts +3 -3
  3. package/dist/agent.js +1012 -130
  4. package/dist/{approval-DwN2o2QG.js → approval-DWQlDPbY.js} +102 -16
  5. package/dist/arc-8U_6NQWm.js +130 -0
  6. package/dist/architecture-7GRP2DOG-RTw1wpAq.js +4 -0
  7. package/dist/architectureDiagram-NJMV4G6O-XmmXrJAK.js +7473 -0
  8. package/dist/array-DQfpQNY8.js +8 -0
  9. package/dist/blockDiagram-BEXU5L5S-D4yjnCD1.js +2582 -0
  10. package/dist/browser.d.ts +444 -48
  11. package/dist/browser.js +1771 -91
  12. package/dist/c4Diagram-YGBWAQC7-BLmA_JSd.js +3668 -0
  13. package/dist/channel-CZxxLrG7.js +9 -0
  14. package/dist/chunk-2Q5K7J3B-Ck03gkFR.js +21 -0
  15. package/dist/chunk-3FUC2YCW-tr6jmbQf.js +530 -0
  16. package/dist/chunk-5DYCD2WN-Bt97YGTd.js +58 -0
  17. package/dist/chunk-5VM5RSS4-BBxa48HL.js +21 -0
  18. package/dist/chunk-6AEJRKK7-JXK89I-O.js +14 -0
  19. package/dist/chunk-742MDFTN-CPmgCGwC.js +466 -0
  20. package/dist/chunk-7INBJB4K-C9jq9o66.js +6552 -0
  21. package/dist/chunk-7M6MHVWA-BrKCWcR1.js +4894 -0
  22. package/dist/chunk-7PRAP22T-BHED6GVs.js +95 -0
  23. package/dist/chunk-DUW6YSOI-DoZj78PO.js +19 -0
  24. package/dist/chunk-FOHPRMQF-Dkbp819z.js +27189 -0
  25. package/dist/chunk-GNY47TPC-Bpvq1T49.js +87 -0
  26. package/dist/chunk-GTNCS2PH-CLmh4I2c.js +686 -0
  27. package/dist/chunk-GWA4HPMP-B6vN3fkL.js +95 -0
  28. package/dist/chunk-J5ZVWO5B-Bi_Pcobw.js +26 -0
  29. package/dist/chunk-JWPE2WC7-D1rC79GS.js +12 -0
  30. package/dist/chunk-LNGE3PJU-D5OIoe3Z.js +2582 -0
  31. package/dist/chunk-MBY4JIJT-C34L7a4f.js +2276 -0
  32. package/dist/chunk-NETBCI7D-Cg84k8N8.js +321 -0
  33. package/dist/chunk-O7XYJQB3-B6K0KOSL.js +8846 -0
  34. package/dist/chunk-UA2S7LBM-DxHM29_K.js +612 -0
  35. package/dist/chunk-WEXAMYUT-Ba6jFWhB.js +33 -0
  36. package/dist/chunk-XXDRQBXY-DPbSy4kg.js +12 -0
  37. package/dist/chunk-Y2CYZVJY-U3QOMqrW.js +15 -0
  38. package/dist/chunk-Z7XXMR3K-oLg1h8F3.js +1038 -0
  39. package/dist/chunk-ZIGJFQKS-DqEFBuHR.js +2215 -0
  40. package/dist/classDiagram-v2-NBCMYWYE-BqnOWIUt.js +3845 -0
  41. package/dist/cose-bilkent-JH36ORCC-C0dTAHVK.js +4270 -0
  42. package/dist/cynefin-OW5HDTMX-B2QvgEQj.js +4 -0
  43. package/dist/cynefinDiagram-VND7K2PF-yAWc6Z3W.js +479 -0
  44. package/dist/cytoscape.esm-C64mRh9B.js +28325 -0
  45. package/dist/dagre-6A5THRUB-D0w2W27v.js +4816 -0
  46. package/dist/defaultLocale-B_EoOkSF.js +249 -0
  47. package/dist/diagram-22UHCM2B-DvgzhUzP.js +6115 -0
  48. package/dist/diagram-3UASUU5V-DWgUB-ef.js +795 -0
  49. package/dist/diagram-ATOU4E4O-P1olqwIs.js +553 -0
  50. package/dist/diagram-CDSNMT55-BUlZuLUe.js +402 -0
  51. package/dist/diagram-MLGK6HIB-6w5qmkGt.js +186 -0
  52. package/dist/diagram-MPIPVDR6-DEFiSo8o.js +289 -0
  53. package/dist/dist-UajCDt3n.js +92 -0
  54. package/dist/ebnfDiagram-ZINNZB2B-CI8liCfR.js +123 -0
  55. package/dist/elk-276RUBZZ-3SvW6OAK.js +90034 -0
  56. package/dist/erDiagram-OPXOYQCR-CPTbKhwP.js +2301 -0
  57. package/dist/eventmodeling-NTZA5JFV-BlyuqGp0.js +4 -0
  58. package/dist/flowDiagram-KWPJA3E3-CcUJ6HbV.js +18 -0
  59. package/dist/ganttDiagram-FUAMR5RP-31UjY0KK.js +3939 -0
  60. package/dist/{toolSource-C9oNuKmr.js → geometry-wx5ZTYzi.js} +162 -12
  61. package/dist/gitGraph-4MIJSDKK-ChdVlrk7.js +4 -0
  62. package/dist/gitGraphDiagram-X574FWY7-DKuxJymB.js +1153 -0
  63. package/dist/governance.d.ts +3 -3
  64. package/dist/graphlib-tk9gQYuN.js +4194 -0
  65. package/dist/{index-B8Tgmpwh.d.ts → index-BiO9_XRk.d.ts} +2 -2
  66. package/dist/{index-CYLt5u4L.d.ts → index-CjwdZQOS.d.ts} +700 -12
  67. package/dist/{index-DHopiH_m.d.ts → index-YPd8ZSEa.d.ts} +156 -9
  68. package/dist/index.d.ts +4 -4
  69. package/dist/index.js +6 -6
  70. package/dist/info-A6RAGUB7-CxRAt9S9.js +4 -0
  71. package/dist/infoDiagram-VRGFBTTK-pRspGfjZ.js +25 -0
  72. package/dist/init-CMOIWdg-.js +16 -0
  73. package/dist/ishikawaDiagram-OU5B5YK6-DKerAPAg.js +975 -0
  74. package/dist/journeyDiagram-ZHPQQLJL-C4MK-YO5.js +1227 -0
  75. package/dist/kanban-definition-PNTS6WVX-BqsZpMXx.js +1244 -0
  76. package/dist/katex-BcRRvyh_.js +26465 -0
  77. package/dist/{kind-DaKqLX2F.js → kind-Dc8x0HWz.js} +54 -7
  78. package/dist/line-LgV8iVMV.js +48 -0
  79. package/dist/linear-BWKR0Tqd.js +393 -0
  80. package/dist/linkedDocument-CIuh_Yp0.js +416 -0
  81. package/dist/mcp.d.ts +2 -2
  82. package/dist/{memoryArtifactStore-D6dLeY55.js → memoryArtifactStore-Bs7glPqm.js} +14 -0
  83. package/dist/mermaid-parser.core-pYR5siSx.js +754 -0
  84. package/dist/mermaid.core-DMtwGCHy.js +1756 -0
  85. package/dist/mindmap-definition-NLK3R4M7-CXbD-myG.js +1312 -0
  86. package/dist/node.d.ts +3 -3
  87. package/dist/node.js +2 -2
  88. package/dist/{openUiLibrary-b0i7F_oZ.js → openUiLibrary-B7j3rLrm.js} +1 -1
  89. package/dist/{openUiSpecLang-CLXJEeRU.js → openUiSpecLang-BSYYnjay.js} +1 -1
  90. package/dist/ordinal-CxA6GHQS.js +84 -0
  91. package/dist/packet-AYTQ26CC-BOm08cxl.js +4 -0
  92. package/dist/path-C27Z2Bjv.js +106 -0
  93. package/dist/pegDiagram-GJSIUBJH-BLGJOewQ.js +115 -0
  94. package/dist/pie-WAS4IAKB-Dvg7glpk.js +4 -0
  95. package/dist/pieDiagram-5QR66LMP-laoaV_PB.js +298 -0
  96. package/dist/quadrantDiagram-O4NWA36T-Db_wFBkT.js +2236 -0
  97. package/dist/radar-RG4KPBEZ-BZDaTu06.js +4 -0
  98. package/dist/railroad-74A4TZTK-C-UhjkOy.js +4 -0
  99. package/dist/railroad-abnf-HS5TGJTU-dUKVA4OS.js +4 -0
  100. package/dist/railroad-ebnf-LZEXJU2U-DzQumk18.js +4 -0
  101. package/dist/railroad-peg-WCYAUIDC-B3vvTWed.js +4 -0
  102. package/dist/railroadDiagram-XR7U4H2S-BY0sTM4X.js +89 -0
  103. package/dist/requirementDiagram-PLB6GJNP-3rkQfEhs.js +2474 -0
  104. package/dist/rough.cjs-AmDd_NQk.js +1395 -0
  105. package/dist/sankeyDiagram-IPEJSGJF-CGAJhyG2.js +3578 -0
  106. package/dist/sequenceDiagram-PO4LG4MO-9FJjFX06.js +5522 -0
  107. package/dist/sizeCapture-INFHLROL-D8PWxdOn.js +56 -0
  108. package/dist/{skillVersionStore-B24Jjjry-BkOk9wI_.d.ts → skillVersionStore-B24Jjjry-BY1H7Krp.d.ts} +1 -1
  109. package/dist/src-NkhI3UMl.js +2653 -0
  110. package/dist/stateDiagram-v2-GCMORJYK-B0O3wc1-.js +2715 -0
  111. package/dist/swimlanes-2SLR337P-D4EOnrpu.js +6637 -0
  112. package/dist/swimlanesDiagram-TC7HE7FX-BUx29EJ9.js +30 -0
  113. package/dist/testing.d.ts +2 -1
  114. package/dist/testing.js +1 -1
  115. package/dist/timeline-definition-EJHVYXUP-CrgiiB4C.js +1513 -0
  116. package/dist/treeView-Q6P3EWNA-C1by-Gzc.js +4 -0
  117. package/dist/treemap-WGGIJYW6-mC2NZ6ad.js +4 -0
  118. package/dist/{types-BvTV_05--BW8zDuEk.d.ts → types-CpDRZ0rA-BM5FI9oN.d.ts} +59 -8
  119. package/dist/ui-react.d.ts +3 -3
  120. package/dist/ui-react.js +3718 -77
  121. package/dist/ui-vue.d.ts +1 -1
  122. package/dist/ui.d.ts +3 -3
  123. package/dist/ui.js +2 -2
  124. package/dist/usecaseDiagram-POWQR4AR-BUt_TQOY.js +14397 -0
  125. package/dist/vennDiagram-UO4OBE2U-CwXr0wjA.js +2808 -0
  126. package/dist/wardley-WFR3VGLG-CVSYjq_S.js +4 -0
  127. package/dist/wardleyDiagram-VNRHLVJA-Cpfd47dQ.js +874 -0
  128. package/dist/{webSkillApi-Cib6G-94.js → webSkillApi-Dy-Zjv0y.js} +1 -1
  129. package/dist/{webskillLitCatalog-W06npwej.js → webskillLitCatalog-D5BCiMCU.js} +1 -1
  130. package/dist/xychartDiagram-PMCCYNJV-e1TeVoc6.js +2704 -0
  131. package/package.json +1 -1
  132. package/dist/linkedDocument-C0gj1sMq.js +0 -245
@@ -0,0 +1,2582 @@
1
+ import { n as __name } from "./chunk-Y2CYZVJY-U3QOMqrW.js";
2
+ import { m as log, p as select_default } from "./src-NkhI3UMl.js";
3
+ import { a as clear, at as rgba, b as getConfig, c as configureSvgSize, s as common_default, x as getConfig2 } from "./chunk-O7XYJQB3-B6K0KOSL.js";
4
+ import { t as channel } from "./channel-CZxxLrG7.js";
5
+ import { A as float64ArrayTag, B as symbolTag, C as argumentsTag, D as dataViewTag, E as booleanTag, F as numberTag, G as getTag, H as uint32ArrayTag, I as objectTag, L as regexpTag, M as int32ArrayTag, N as int8ArrayTag, O as dateTag, P as mapTag, R as setTag, T as arrayTag, U as uint8ArrayTag, V as uint16ArrayTag, W as uint8ClampedArrayTag, b as isPrimitive, j as int16ArrayTag, k as float32ArrayTag, l as getStylesFromArray, v as isTypedArray, w as arrayBufferTag, z as stringTag } from "./chunk-ZIGJFQKS-DqEFBuHR.js";
6
+ import "./chunk-742MDFTN-CPmgCGwC.js";
7
+ import "./chunk-MBY4JIJT-C34L7a4f.js";
8
+ import { t as getIconStyles } from "./chunk-5VM5RSS4-BBxa48HL.js";
9
+ import { t as insertLookDefs } from "./chunk-DUW6YSOI-DoZj78PO.js";
10
+ import "./chunk-7PRAP22T-BHED6GVs.js";
11
+ import { i as isColorTheme, n as colorSlotCount, o as safeLook, r as hasPalette, s as stampColorSlot } from "./chunk-J5ZVWO5B-Bi_Pcobw.js";
12
+ import "./chunk-7INBJB4K-C9jq9o66.js";
13
+ import { i as positionNode, r as insertNode } from "./chunk-5DYCD2WN-Bt97YGTd.js";
14
+ import { a as insertEdgeLabel, c as markers_default, i as insertEdge, l as positionEdgeLabel } from "./chunk-Z7XXMR3K-oLg1h8F3.js";
15
+ import { t as Graph } from "./graphlib-tk9gQYuN.js";
16
+
17
+ //#region ../../node_modules/.pnpm/es-toolkit@1.50.0/node_modules/es-toolkit/dist/compat/predicate/isArray.mjs
18
+ /**
19
+ * Checks if the given value is an array.
20
+ *
21
+ * This function tests whether the provided value is an array or not.
22
+ * It returns `true` if the value is an array, and `false` otherwise.
23
+ *
24
+ * This function can also serve as a type predicate in TypeScript, narrowing the type of the argument to an array.
25
+ *
26
+ * @param value - The value to test if it is an array.
27
+ * @returns `true` if the value is an array, `false` otherwise.
28
+ *
29
+ * @example
30
+ * const value1 = [1, 2, 3];
31
+ * const value2 = 'abc';
32
+ * const value3 = () => {};
33
+ *
34
+ * console.log(isArray(value1)); // true
35
+ * console.log(isArray(value2)); // false
36
+ * console.log(isArray(value3)); // false
37
+ */
38
+ function isArray(value) {
39
+ return Array.isArray(value);
40
+ }
41
+
42
+ //#endregion
43
+ //#region ../../node_modules/.pnpm/es-toolkit@1.50.0/node_modules/es-toolkit/dist/compat/object/clone.mjs
44
+ /**
45
+ * Creates a shallow clone of the given object.
46
+ *
47
+ * @template T - The type of the object.
48
+ * @param obj - The object to clone.
49
+ * @returns A shallow clone of the given object.
50
+ *
51
+ * @example
52
+ * // Clone a primitive object
53
+ * const num = 29;
54
+ * const clonedNum = clone(num);
55
+ * console.log(clonedNum); // 29
56
+ * console.log(clonedNum === num); // true
57
+ *
58
+ * @example
59
+ * // Clone an array
60
+ * const arr = [1, 2, 3];
61
+ * const clonedArr = clone(arr);
62
+ * console.log(clonedArr); // [1, 2, 3]
63
+ * console.log(clonedArr === arr); // false
64
+ *
65
+ * @example
66
+ * // Clone an object
67
+ * const obj = { a: 1, b: 'es-toolkit', c: [1, 2, 3] };
68
+ * const clonedObj = clone(obj);
69
+ * console.log(clonedObj); // { a: 1, b: 'es-toolkit', c: [1, 2, 3] }
70
+ * console.log(clonedObj === obj); // false
71
+ */
72
+ function clone(obj) {
73
+ if (isPrimitive(obj)) return obj;
74
+ const tag = getTag(obj);
75
+ if (!isCloneableObject(obj)) return {};
76
+ if (isArray(obj)) {
77
+ const result = Array.from(obj);
78
+ if (obj.length > 0 && typeof obj[0] === "string" && Object.hasOwn(obj, "index")) {
79
+ result.index = obj.index;
80
+ result.input = obj.input;
81
+ }
82
+ return result;
83
+ }
84
+ if (isTypedArray(obj)) {
85
+ const typedArray = obj;
86
+ const Ctor = typedArray.constructor;
87
+ return new Ctor(typedArray.buffer, typedArray.byteOffset, typedArray.length);
88
+ }
89
+ if (tag === "[object ArrayBuffer]") return new ArrayBuffer(obj.byteLength);
90
+ if (tag === "[object DataView]") {
91
+ const dataView = obj;
92
+ const buffer = dataView.buffer;
93
+ const byteOffset = dataView.byteOffset;
94
+ const byteLength = dataView.byteLength;
95
+ const clonedBuffer = new ArrayBuffer(byteLength);
96
+ const srcView = new Uint8Array(buffer, byteOffset, byteLength);
97
+ new Uint8Array(clonedBuffer).set(srcView);
98
+ return new DataView(clonedBuffer);
99
+ }
100
+ if (tag === "[object Boolean]" || tag === "[object Number]" || tag === "[object String]") {
101
+ const Ctor = obj.constructor;
102
+ const clone = new Ctor(obj.valueOf());
103
+ if (tag === "[object String]") cloneStringObjectProperties(clone, obj);
104
+ else copyOwnProperties(clone, obj);
105
+ return clone;
106
+ }
107
+ if (tag === "[object Date]") return new Date(Number(obj));
108
+ if (tag === "[object RegExp]") {
109
+ const regExp = obj;
110
+ const clone = new RegExp(regExp.source, regExp.flags);
111
+ clone.lastIndex = regExp.lastIndex;
112
+ return clone;
113
+ }
114
+ if (tag === "[object Symbol]") return Object(Symbol.prototype.valueOf.call(obj));
115
+ if (tag === "[object Map]") {
116
+ const map = obj;
117
+ const result = /* @__PURE__ */ new Map();
118
+ map.forEach((obj, key) => {
119
+ result.set(key, obj);
120
+ });
121
+ return result;
122
+ }
123
+ if (tag === "[object Set]") {
124
+ const set = obj;
125
+ const result = /* @__PURE__ */ new Set();
126
+ set.forEach((obj) => {
127
+ result.add(obj);
128
+ });
129
+ return result;
130
+ }
131
+ if (tag === "[object Arguments]") {
132
+ const args = obj;
133
+ const result = {};
134
+ copyOwnProperties(result, args);
135
+ result.length = args.length;
136
+ result[Symbol.iterator] = args[Symbol.iterator];
137
+ return result;
138
+ }
139
+ const result = {};
140
+ copyPrototype(result, obj);
141
+ copyOwnProperties(result, obj);
142
+ copySymbolProperties(result, obj);
143
+ return result;
144
+ }
145
+ function isCloneableObject(object) {
146
+ switch (getTag(object)) {
147
+ case argumentsTag:
148
+ case arrayTag:
149
+ case arrayBufferTag:
150
+ case dataViewTag:
151
+ case booleanTag:
152
+ case dateTag:
153
+ case float32ArrayTag:
154
+ case float64ArrayTag:
155
+ case int8ArrayTag:
156
+ case int16ArrayTag:
157
+ case int32ArrayTag:
158
+ case mapTag:
159
+ case numberTag:
160
+ case objectTag:
161
+ case regexpTag:
162
+ case setTag:
163
+ case stringTag:
164
+ case symbolTag:
165
+ case uint8ArrayTag:
166
+ case uint8ClampedArrayTag:
167
+ case uint16ArrayTag:
168
+ case uint32ArrayTag: return true;
169
+ default: return false;
170
+ }
171
+ }
172
+ function copyOwnProperties(target, source) {
173
+ for (const key in source) if (Object.hasOwn(source, key)) target[key] = source[key];
174
+ }
175
+ function copySymbolProperties(target, source) {
176
+ const symbols = Object.getOwnPropertySymbols(source);
177
+ for (let i = 0; i < symbols.length; i++) {
178
+ const symbol = symbols[i];
179
+ if (Object.prototype.propertyIsEnumerable.call(source, symbol)) target[symbol] = source[symbol];
180
+ }
181
+ }
182
+ function cloneStringObjectProperties(target, source) {
183
+ const stringLength = source.valueOf().length;
184
+ for (const key in source) if (Object.hasOwn(source, key) && (Number.isNaN(Number(key)) || Number(key) >= stringLength)) target[key] = source[key];
185
+ }
186
+ function copyPrototype(target, source) {
187
+ const proto = Object.getPrototypeOf(source);
188
+ if (proto !== null) {
189
+ if (typeof source.constructor === "function") Object.setPrototypeOf(target, proto);
190
+ }
191
+ }
192
+
193
+ //#endregion
194
+ //#region ../../node_modules/.pnpm/mermaid@12.0.0/node_modules/mermaid/dist/chunks/mermaid.core/blockDiagram-BEXU5L5S.mjs
195
+ var parser = (function() {
196
+ var o = /* @__PURE__ */ __name(function(k, v, o2, l) {
197
+ for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v);
198
+ return o2;
199
+ }, "o"), $V0 = [1, 15], $V1 = [1, 7], $V2 = [1, 13], $V3 = [1, 14], $V4 = [1, 19], $V5 = [1, 16], $V6 = [1, 17], $V7 = [1, 18], $V8 = [8, 30], $V9 = [
200
+ 8,
201
+ 10,
202
+ 21,
203
+ 28,
204
+ 29,
205
+ 30,
206
+ 31,
207
+ 39,
208
+ 43,
209
+ 46
210
+ ], $Va = [1, 23], $Vb = [1, 24], $Vc = [
211
+ 8,
212
+ 10,
213
+ 15,
214
+ 16,
215
+ 21,
216
+ 28,
217
+ 29,
218
+ 30,
219
+ 31,
220
+ 39,
221
+ 43,
222
+ 46
223
+ ], $Vd = [
224
+ 8,
225
+ 10,
226
+ 15,
227
+ 16,
228
+ 21,
229
+ 27,
230
+ 28,
231
+ 29,
232
+ 30,
233
+ 31,
234
+ 39,
235
+ 43,
236
+ 46
237
+ ], $Ve = [1, 49];
238
+ var parser2 = {
239
+ trace: /* @__PURE__ */ __name(function trace() {}, "trace"),
240
+ yy: {},
241
+ symbols_: {
242
+ "error": 2,
243
+ "spaceLines": 3,
244
+ "SPACELINE": 4,
245
+ "NL": 5,
246
+ "separator": 6,
247
+ "SPACE": 7,
248
+ "EOF": 8,
249
+ "start": 9,
250
+ "BLOCK_DIAGRAM_KEY": 10,
251
+ "document": 11,
252
+ "stop": 12,
253
+ "statement": 13,
254
+ "link": 14,
255
+ "LINK": 15,
256
+ "START_LINK": 16,
257
+ "LINK_LABEL": 17,
258
+ "STR": 18,
259
+ "nodeStatement": 19,
260
+ "columnsStatement": 20,
261
+ "SPACE_BLOCK": 21,
262
+ "blockStatement": 22,
263
+ "classDefStatement": 23,
264
+ "cssClassStatement": 24,
265
+ "styleStatement": 25,
266
+ "node": 26,
267
+ "SIZE": 27,
268
+ "COLUMNS": 28,
269
+ "id-block": 29,
270
+ "end": 30,
271
+ "NODE_ID": 31,
272
+ "nodeShapeNLabel": 32,
273
+ "dirList": 33,
274
+ "DIR": 34,
275
+ "NODE_DSTART": 35,
276
+ "NODE_DEND": 36,
277
+ "BLOCK_ARROW_START": 37,
278
+ "BLOCK_ARROW_END": 38,
279
+ "classDef": 39,
280
+ "CLASSDEF_ID": 40,
281
+ "CLASSDEF_STYLEOPTS": 41,
282
+ "DEFAULT": 42,
283
+ "class": 43,
284
+ "CLASSENTITY_IDS": 44,
285
+ "STYLECLASS": 45,
286
+ "style": 46,
287
+ "STYLE_ENTITY_IDS": 47,
288
+ "STYLE_DEFINITION_DATA": 48,
289
+ "$accept": 0,
290
+ "$end": 1
291
+ },
292
+ terminals_: {
293
+ 2: "error",
294
+ 4: "SPACELINE",
295
+ 5: "NL",
296
+ 7: "SPACE",
297
+ 8: "EOF",
298
+ 10: "BLOCK_DIAGRAM_KEY",
299
+ 15: "LINK",
300
+ 16: "START_LINK",
301
+ 17: "LINK_LABEL",
302
+ 18: "STR",
303
+ 21: "SPACE_BLOCK",
304
+ 27: "SIZE",
305
+ 28: "COLUMNS",
306
+ 29: "id-block",
307
+ 30: "end",
308
+ 31: "NODE_ID",
309
+ 34: "DIR",
310
+ 35: "NODE_DSTART",
311
+ 36: "NODE_DEND",
312
+ 37: "BLOCK_ARROW_START",
313
+ 38: "BLOCK_ARROW_END",
314
+ 39: "classDef",
315
+ 40: "CLASSDEF_ID",
316
+ 41: "CLASSDEF_STYLEOPTS",
317
+ 42: "DEFAULT",
318
+ 43: "class",
319
+ 44: "CLASSENTITY_IDS",
320
+ 45: "STYLECLASS",
321
+ 46: "style",
322
+ 47: "STYLE_ENTITY_IDS",
323
+ 48: "STYLE_DEFINITION_DATA"
324
+ },
325
+ productions_: [
326
+ 0,
327
+ [3, 1],
328
+ [3, 2],
329
+ [3, 2],
330
+ [6, 1],
331
+ [6, 1],
332
+ [6, 1],
333
+ [9, 3],
334
+ [12, 1],
335
+ [12, 1],
336
+ [12, 2],
337
+ [12, 2],
338
+ [11, 1],
339
+ [11, 2],
340
+ [14, 1],
341
+ [14, 4],
342
+ [13, 1],
343
+ [13, 1],
344
+ [13, 1],
345
+ [13, 1],
346
+ [13, 1],
347
+ [13, 1],
348
+ [13, 1],
349
+ [19, 3],
350
+ [19, 2],
351
+ [19, 1],
352
+ [20, 1],
353
+ [22, 4],
354
+ [22, 3],
355
+ [26, 1],
356
+ [26, 2],
357
+ [33, 1],
358
+ [33, 2],
359
+ [32, 3],
360
+ [32, 4],
361
+ [23, 3],
362
+ [23, 3],
363
+ [24, 3],
364
+ [25, 3]
365
+ ],
366
+ performAction: /* @__PURE__ */ __name(function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) {
367
+ var $0 = $$.length - 1;
368
+ switch (yystate) {
369
+ case 4:
370
+ yy.getLogger().debug("Rule: separator (NL) ");
371
+ break;
372
+ case 5:
373
+ yy.getLogger().debug("Rule: separator (Space) ");
374
+ break;
375
+ case 6:
376
+ yy.getLogger().debug("Rule: separator (EOF) ");
377
+ break;
378
+ case 7:
379
+ yy.getLogger().debug("Rule: hierarchy: ", $$[$0 - 1]);
380
+ yy.setHierarchy($$[$0 - 1]);
381
+ break;
382
+ case 8:
383
+ yy.getLogger().debug("Stop NL ");
384
+ break;
385
+ case 9:
386
+ yy.getLogger().debug("Stop EOF ");
387
+ break;
388
+ case 10:
389
+ yy.getLogger().debug("Stop NL2 ");
390
+ break;
391
+ case 11:
392
+ yy.getLogger().debug("Stop EOF2 ");
393
+ break;
394
+ case 12:
395
+ yy.getLogger().debug("Rule: statement: ", $$[$0]);
396
+ typeof $$[$0].length === "number" ? this.$ = $$[$0] : this.$ = [$$[$0]];
397
+ break;
398
+ case 13:
399
+ yy.getLogger().debug("Rule: statement #2: ", $$[$0 - 1]);
400
+ this.$ = [$$[$0 - 1]].concat($$[$0]);
401
+ break;
402
+ case 14:
403
+ yy.getLogger().debug("Rule: link: ", $$[$0], yytext);
404
+ this.$ = {
405
+ edgeTypeStr: $$[$0],
406
+ label: ""
407
+ };
408
+ break;
409
+ case 15:
410
+ yy.getLogger().debug("Rule: LABEL link: ", $$[$0 - 3], $$[$0 - 1], $$[$0]);
411
+ this.$ = {
412
+ edgeTypeStr: $$[$0],
413
+ label: $$[$0 - 1]
414
+ };
415
+ break;
416
+ case 18:
417
+ const num = parseInt($$[$0]);
418
+ const spaceId = yy.generateId();
419
+ this.$ = {
420
+ id: spaceId,
421
+ type: "space",
422
+ label: "",
423
+ width: num,
424
+ children: []
425
+ };
426
+ break;
427
+ case 23:
428
+ yy.getLogger().debug("Rule: (nodeStatement link node) ", $$[$0 - 2], $$[$0 - 1], $$[$0], " typestr: ", $$[$0 - 1].edgeTypeStr);
429
+ const edgeData = yy.edgeStrToEdgeData($$[$0 - 1].edgeTypeStr);
430
+ const startEdgeData = yy.edgeStrToEdgeStartData($$[$0 - 1].edgeTypeStr);
431
+ const lineThickness = yy.edgeStrToThickness($$[$0 - 1].edgeTypeStr);
432
+ const linePattern = yy.edgeStrToPattern($$[$0 - 1].edgeTypeStr);
433
+ this.$ = [
434
+ {
435
+ id: $$[$0 - 2].id,
436
+ label: $$[$0 - 2].label,
437
+ type: $$[$0 - 2].type,
438
+ directions: $$[$0 - 2].directions
439
+ },
440
+ {
441
+ id: $$[$0 - 2].id + "-" + $$[$0].id,
442
+ start: $$[$0 - 2].id,
443
+ end: $$[$0].id,
444
+ label: $$[$0 - 1].label,
445
+ type: "edge",
446
+ thickness: lineThickness,
447
+ pattern: linePattern,
448
+ directions: $$[$0].directions,
449
+ arrowTypeEnd: edgeData,
450
+ arrowTypeStart: startEdgeData
451
+ },
452
+ {
453
+ id: $$[$0].id,
454
+ label: $$[$0].label,
455
+ type: yy.typeStr2Type($$[$0].typeStr),
456
+ directions: $$[$0].directions
457
+ }
458
+ ];
459
+ break;
460
+ case 24:
461
+ yy.getLogger().debug("Rule: nodeStatement (abc88 node size) ", $$[$0 - 1], $$[$0]);
462
+ this.$ = {
463
+ id: $$[$0 - 1].id,
464
+ label: $$[$0 - 1].label,
465
+ type: yy.typeStr2Type($$[$0 - 1].typeStr),
466
+ directions: $$[$0 - 1].directions,
467
+ widthInColumns: parseInt($$[$0], 10)
468
+ };
469
+ break;
470
+ case 25:
471
+ yy.getLogger().debug("Rule: nodeStatement (node) ", $$[$0]);
472
+ this.$ = {
473
+ id: $$[$0].id,
474
+ label: $$[$0].label,
475
+ type: yy.typeStr2Type($$[$0].typeStr),
476
+ directions: $$[$0].directions,
477
+ widthInColumns: 1
478
+ };
479
+ break;
480
+ case 26:
481
+ yy.getLogger().debug("APA123", this ? this : "na");
482
+ yy.getLogger().debug("COLUMNS: ", $$[$0]);
483
+ this.$ = {
484
+ type: "column-setting",
485
+ columns: $$[$0] === "auto" ? -1 : parseInt($$[$0])
486
+ };
487
+ break;
488
+ case 27:
489
+ yy.getLogger().debug("Rule: id-block statement : ", $$[$0 - 2], $$[$0 - 1]);
490
+ yy.generateId();
491
+ this.$ = {
492
+ ...$$[$0 - 2],
493
+ type: "composite",
494
+ children: $$[$0 - 1]
495
+ };
496
+ break;
497
+ case 28:
498
+ yy.getLogger().debug("Rule: blockStatement : ", $$[$0 - 2], $$[$0 - 1], $$[$0]);
499
+ const id = yy.generateId();
500
+ this.$ = {
501
+ id,
502
+ type: "composite",
503
+ label: "",
504
+ children: $$[$0 - 1]
505
+ };
506
+ break;
507
+ case 29:
508
+ yy.getLogger().debug("Rule: node (NODE_ID separator): ", $$[$0]);
509
+ this.$ = { id: $$[$0] };
510
+ break;
511
+ case 30:
512
+ yy.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ", $$[$0 - 1], $$[$0]);
513
+ this.$ = {
514
+ id: $$[$0 - 1],
515
+ label: $$[$0].label,
516
+ typeStr: $$[$0].typeStr,
517
+ directions: $$[$0].directions
518
+ };
519
+ break;
520
+ case 31:
521
+ yy.getLogger().debug("Rule: dirList: ", $$[$0]);
522
+ this.$ = [$$[$0]];
523
+ break;
524
+ case 32:
525
+ yy.getLogger().debug("Rule: dirList: ", $$[$0 - 1], $$[$0]);
526
+ this.$ = [$$[$0 - 1]].concat($$[$0]);
527
+ break;
528
+ case 33:
529
+ yy.getLogger().debug("Rule: nodeShapeNLabel: ", $$[$0 - 2], $$[$0 - 1], $$[$0]);
530
+ this.$ = {
531
+ typeStr: $$[$0 - 2] + $$[$0],
532
+ label: $$[$0 - 1]
533
+ };
534
+ break;
535
+ case 34:
536
+ yy.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ", $$[$0 - 3], $$[$0 - 2], " #3:", $$[$0 - 1], $$[$0]);
537
+ this.$ = {
538
+ typeStr: $$[$0 - 3] + $$[$0],
539
+ label: $$[$0 - 2],
540
+ directions: $$[$0 - 1]
541
+ };
542
+ break;
543
+ case 35:
544
+ case 36:
545
+ this.$ = {
546
+ type: "classDef",
547
+ id: $$[$0 - 1].trim(),
548
+ css: $$[$0].trim()
549
+ };
550
+ break;
551
+ case 37:
552
+ this.$ = {
553
+ type: "applyClass",
554
+ id: $$[$0 - 1].trim(),
555
+ styleClass: $$[$0].trim()
556
+ };
557
+ break;
558
+ case 38:
559
+ this.$ = {
560
+ type: "applyStyles",
561
+ id: $$[$0 - 1].trim(),
562
+ stylesStr: $$[$0].trim()
563
+ };
564
+ break;
565
+ }
566
+ }, "anonymous"),
567
+ table: [
568
+ {
569
+ 9: 1,
570
+ 10: [1, 2]
571
+ },
572
+ { 1: [3] },
573
+ {
574
+ 10: $V0,
575
+ 11: 3,
576
+ 13: 4,
577
+ 19: 5,
578
+ 20: 6,
579
+ 21: $V1,
580
+ 22: 8,
581
+ 23: 9,
582
+ 24: 10,
583
+ 25: 11,
584
+ 26: 12,
585
+ 28: $V2,
586
+ 29: $V3,
587
+ 31: $V4,
588
+ 39: $V5,
589
+ 43: $V6,
590
+ 46: $V7
591
+ },
592
+ { 8: [1, 20] },
593
+ o($V8, [2, 12], {
594
+ 13: 4,
595
+ 19: 5,
596
+ 20: 6,
597
+ 22: 8,
598
+ 23: 9,
599
+ 24: 10,
600
+ 25: 11,
601
+ 26: 12,
602
+ 11: 21,
603
+ 10: $V0,
604
+ 21: $V1,
605
+ 28: $V2,
606
+ 29: $V3,
607
+ 31: $V4,
608
+ 39: $V5,
609
+ 43: $V6,
610
+ 46: $V7
611
+ }),
612
+ o($V9, [2, 16], {
613
+ 14: 22,
614
+ 15: $Va,
615
+ 16: $Vb
616
+ }),
617
+ o($V9, [2, 17]),
618
+ o($V9, [2, 18]),
619
+ o($V9, [2, 19]),
620
+ o($V9, [2, 20]),
621
+ o($V9, [2, 21]),
622
+ o($V9, [2, 22]),
623
+ o($Vc, [2, 25], { 27: [1, 25] }),
624
+ o($V9, [2, 26]),
625
+ {
626
+ 19: 26,
627
+ 26: 12,
628
+ 31: $V4
629
+ },
630
+ {
631
+ 10: $V0,
632
+ 11: 27,
633
+ 13: 4,
634
+ 19: 5,
635
+ 20: 6,
636
+ 21: $V1,
637
+ 22: 8,
638
+ 23: 9,
639
+ 24: 10,
640
+ 25: 11,
641
+ 26: 12,
642
+ 28: $V2,
643
+ 29: $V3,
644
+ 31: $V4,
645
+ 39: $V5,
646
+ 43: $V6,
647
+ 46: $V7
648
+ },
649
+ {
650
+ 40: [1, 28],
651
+ 42: [1, 29]
652
+ },
653
+ { 44: [1, 30] },
654
+ { 47: [1, 31] },
655
+ o($Vd, [2, 29], {
656
+ 32: 32,
657
+ 35: [1, 33],
658
+ 37: [1, 34]
659
+ }),
660
+ { 1: [2, 7] },
661
+ o($V8, [2, 13]),
662
+ {
663
+ 26: 35,
664
+ 31: $V4
665
+ },
666
+ { 31: [2, 14] },
667
+ { 17: [1, 36] },
668
+ o($Vc, [2, 24]),
669
+ {
670
+ 10: $V0,
671
+ 11: 37,
672
+ 13: 4,
673
+ 14: 22,
674
+ 15: $Va,
675
+ 16: $Vb,
676
+ 19: 5,
677
+ 20: 6,
678
+ 21: $V1,
679
+ 22: 8,
680
+ 23: 9,
681
+ 24: 10,
682
+ 25: 11,
683
+ 26: 12,
684
+ 28: $V2,
685
+ 29: $V3,
686
+ 31: $V4,
687
+ 39: $V5,
688
+ 43: $V6,
689
+ 46: $V7
690
+ },
691
+ { 30: [1, 38] },
692
+ { 41: [1, 39] },
693
+ { 41: [1, 40] },
694
+ { 45: [1, 41] },
695
+ { 48: [1, 42] },
696
+ o($Vd, [2, 30]),
697
+ { 18: [1, 43] },
698
+ { 18: [1, 44] },
699
+ o($Vc, [2, 23]),
700
+ { 18: [1, 45] },
701
+ { 30: [1, 46] },
702
+ o($V9, [2, 28]),
703
+ o($V9, [2, 35]),
704
+ o($V9, [2, 36]),
705
+ o($V9, [2, 37]),
706
+ o($V9, [2, 38]),
707
+ { 36: [1, 47] },
708
+ {
709
+ 33: 48,
710
+ 34: $Ve
711
+ },
712
+ { 15: [1, 50] },
713
+ o($V9, [2, 27]),
714
+ o($Vd, [2, 33]),
715
+ { 38: [1, 51] },
716
+ {
717
+ 33: 52,
718
+ 34: $Ve,
719
+ 38: [2, 31]
720
+ },
721
+ { 31: [2, 15] },
722
+ o($Vd, [2, 34]),
723
+ { 38: [2, 32] }
724
+ ],
725
+ defaultActions: {
726
+ 20: [2, 7],
727
+ 23: [2, 14],
728
+ 50: [2, 15],
729
+ 52: [2, 32]
730
+ },
731
+ parseError: /* @__PURE__ */ __name(function parseError(str, hash) {
732
+ if (hash.recoverable) this.trace(str);
733
+ else {
734
+ var error = new Error(str);
735
+ error.hash = hash;
736
+ throw error;
737
+ }
738
+ }, "parseError"),
739
+ parse: /* @__PURE__ */ __name(function parse(input) {
740
+ var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;
741
+ var args = lstack.slice.call(arguments, 1);
742
+ var lexer2 = Object.create(this.lexer);
743
+ var sharedState = { yy: {} };
744
+ for (var k in this.yy) if (Object.prototype.hasOwnProperty.call(this.yy, k)) sharedState.yy[k] = this.yy[k];
745
+ lexer2.setInput(input, sharedState.yy);
746
+ sharedState.yy.lexer = lexer2;
747
+ sharedState.yy.parser = this;
748
+ if (typeof lexer2.yylloc == "undefined") lexer2.yylloc = {};
749
+ var yyloc = lexer2.yylloc;
750
+ lstack.push(yyloc);
751
+ var ranges = lexer2.options && lexer2.options.ranges;
752
+ if (typeof sharedState.yy.parseError === "function") this.parseError = sharedState.yy.parseError;
753
+ else this.parseError = Object.getPrototypeOf(this).parseError;
754
+ function popStack(n) {
755
+ stack.length = stack.length - 2 * n;
756
+ vstack.length = vstack.length - n;
757
+ lstack.length = lstack.length - n;
758
+ }
759
+ __name(popStack, "popStack");
760
+ function lex() {
761
+ var token = tstack.pop() || lexer2.lex() || EOF;
762
+ if (typeof token !== "number") {
763
+ if (token instanceof Array) {
764
+ tstack = token;
765
+ token = tstack.pop();
766
+ }
767
+ token = self.symbols_[token] || token;
768
+ }
769
+ return token;
770
+ }
771
+ __name(lex, "lex");
772
+ var symbol, preErrorSymbol, state, action, r, yyval = {}, p, len, newState, expected;
773
+ while (true) {
774
+ state = stack[stack.length - 1];
775
+ if (this.defaultActions[state]) action = this.defaultActions[state];
776
+ else {
777
+ if (symbol === null || typeof symbol == "undefined") symbol = lex();
778
+ action = table[state] && table[state][symbol];
779
+ }
780
+ if (typeof action === "undefined" || !action.length || !action[0]) {
781
+ var errStr = "";
782
+ expected = [];
783
+ for (p in table[state]) if (this.terminals_[p] && p > TERROR) expected.push("'" + this.terminals_[p] + "'");
784
+ if (lexer2.showPosition) errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer2.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
785
+ else errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'");
786
+ this.parseError(errStr, {
787
+ text: lexer2.match,
788
+ token: this.terminals_[symbol] || symbol,
789
+ line: lexer2.yylineno,
790
+ loc: yyloc,
791
+ expected
792
+ });
793
+ }
794
+ if (action[0] instanceof Array && action.length > 1) throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
795
+ switch (action[0]) {
796
+ case 1:
797
+ stack.push(symbol);
798
+ vstack.push(lexer2.yytext);
799
+ lstack.push(lexer2.yylloc);
800
+ stack.push(action[1]);
801
+ symbol = null;
802
+ if (!preErrorSymbol) {
803
+ yyleng = lexer2.yyleng;
804
+ yytext = lexer2.yytext;
805
+ yylineno = lexer2.yylineno;
806
+ yyloc = lexer2.yylloc;
807
+ if (recovering > 0) recovering--;
808
+ } else {
809
+ symbol = preErrorSymbol;
810
+ preErrorSymbol = null;
811
+ }
812
+ break;
813
+ case 2:
814
+ len = this.productions_[action[1]][1];
815
+ yyval.$ = vstack[vstack.length - len];
816
+ yyval._$ = {
817
+ first_line: lstack[lstack.length - (len || 1)].first_line,
818
+ last_line: lstack[lstack.length - 1].last_line,
819
+ first_column: lstack[lstack.length - (len || 1)].first_column,
820
+ last_column: lstack[lstack.length - 1].last_column
821
+ };
822
+ if (ranges) yyval._$.range = [lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1]];
823
+ r = this.performAction.apply(yyval, [
824
+ yytext,
825
+ yyleng,
826
+ yylineno,
827
+ sharedState.yy,
828
+ action[1],
829
+ vstack,
830
+ lstack
831
+ ].concat(args));
832
+ if (typeof r !== "undefined") return r;
833
+ if (len) {
834
+ stack = stack.slice(0, -1 * len * 2);
835
+ vstack = vstack.slice(0, -1 * len);
836
+ lstack = lstack.slice(0, -1 * len);
837
+ }
838
+ stack.push(this.productions_[action[1]][0]);
839
+ vstack.push(yyval.$);
840
+ lstack.push(yyval._$);
841
+ newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
842
+ stack.push(newState);
843
+ break;
844
+ case 3: return true;
845
+ }
846
+ }
847
+ return true;
848
+ }, "parse")
849
+ };
850
+ parser2.lexer = /* @__PURE__ */ (function() {
851
+ return {
852
+ EOF: 1,
853
+ parseError: /* @__PURE__ */ __name(function parseError(str, hash) {
854
+ if (this.yy.parser) this.yy.parser.parseError(str, hash);
855
+ else throw new Error(str);
856
+ }, "parseError"),
857
+ setInput: /* @__PURE__ */ __name(function(input, yy) {
858
+ this.yy = yy || this.yy || {};
859
+ this._input = input;
860
+ this._more = this._backtrack = this.done = false;
861
+ this.yylineno = this.yyleng = 0;
862
+ this.yytext = this.matched = this.match = "";
863
+ this.conditionStack = ["INITIAL"];
864
+ this.yylloc = {
865
+ first_line: 1,
866
+ first_column: 0,
867
+ last_line: 1,
868
+ last_column: 0
869
+ };
870
+ if (this.options.ranges) this.yylloc.range = [0, 0];
871
+ this.offset = 0;
872
+ return this;
873
+ }, "setInput"),
874
+ input: /* @__PURE__ */ __name(function() {
875
+ var ch = this._input[0];
876
+ this.yytext += ch;
877
+ this.yyleng++;
878
+ this.offset++;
879
+ this.match += ch;
880
+ this.matched += ch;
881
+ if (ch.match(/(?:\r\n?|\n).*/g)) {
882
+ this.yylineno++;
883
+ this.yylloc.last_line++;
884
+ } else this.yylloc.last_column++;
885
+ if (this.options.ranges) this.yylloc.range[1]++;
886
+ this._input = this._input.slice(1);
887
+ return ch;
888
+ }, "input"),
889
+ unput: /* @__PURE__ */ __name(function(ch) {
890
+ var len = ch.length;
891
+ var lines = ch.split(/(?:\r\n?|\n)/g);
892
+ this._input = ch + this._input;
893
+ this.yytext = this.yytext.substr(0, this.yytext.length - len);
894
+ this.offset -= len;
895
+ var oldLines = this.match.split(/(?:\r\n?|\n)/g);
896
+ this.match = this.match.substr(0, this.match.length - 1);
897
+ this.matched = this.matched.substr(0, this.matched.length - 1);
898
+ if (lines.length - 1) this.yylineno -= lines.length - 1;
899
+ var r = this.yylloc.range;
900
+ this.yylloc = {
901
+ first_line: this.yylloc.first_line,
902
+ last_line: this.yylineno + 1,
903
+ first_column: this.yylloc.first_column,
904
+ 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
905
+ };
906
+ if (this.options.ranges) this.yylloc.range = [r[0], r[0] + this.yyleng - len];
907
+ this.yyleng = this.yytext.length;
908
+ return this;
909
+ }, "unput"),
910
+ more: /* @__PURE__ */ __name(function() {
911
+ this._more = true;
912
+ return this;
913
+ }, "more"),
914
+ reject: /* @__PURE__ */ __name(function() {
915
+ if (this.options.backtrack_lexer) this._backtrack = true;
916
+ 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(), {
917
+ text: "",
918
+ token: null,
919
+ line: this.yylineno
920
+ });
921
+ return this;
922
+ }, "reject"),
923
+ less: /* @__PURE__ */ __name(function(n) {
924
+ this.unput(this.match.slice(n));
925
+ }, "less"),
926
+ pastInput: /* @__PURE__ */ __name(function() {
927
+ var past = this.matched.substr(0, this.matched.length - this.match.length);
928
+ return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, "");
929
+ }, "pastInput"),
930
+ upcomingInput: /* @__PURE__ */ __name(function() {
931
+ var next = this.match;
932
+ if (next.length < 20) next += this._input.substr(0, 20 - next.length);
933
+ return (next.substr(0, 20) + (next.length > 20 ? "..." : "")).replace(/\n/g, "");
934
+ }, "upcomingInput"),
935
+ showPosition: /* @__PURE__ */ __name(function() {
936
+ var pre = this.pastInput();
937
+ var c = new Array(pre.length + 1).join("-");
938
+ return pre + this.upcomingInput() + "\n" + c + "^";
939
+ }, "showPosition"),
940
+ test_match: /* @__PURE__ */ __name(function(match, indexed_rule) {
941
+ var token, lines, backup;
942
+ if (this.options.backtrack_lexer) {
943
+ backup = {
944
+ yylineno: this.yylineno,
945
+ yylloc: {
946
+ first_line: this.yylloc.first_line,
947
+ last_line: this.last_line,
948
+ first_column: this.yylloc.first_column,
949
+ last_column: this.yylloc.last_column
950
+ },
951
+ yytext: this.yytext,
952
+ match: this.match,
953
+ matches: this.matches,
954
+ matched: this.matched,
955
+ yyleng: this.yyleng,
956
+ offset: this.offset,
957
+ _more: this._more,
958
+ _input: this._input,
959
+ yy: this.yy,
960
+ conditionStack: this.conditionStack.slice(0),
961
+ done: this.done
962
+ };
963
+ if (this.options.ranges) backup.yylloc.range = this.yylloc.range.slice(0);
964
+ }
965
+ lines = match[0].match(/(?:\r\n?|\n).*/g);
966
+ if (lines) this.yylineno += lines.length;
967
+ this.yylloc = {
968
+ first_line: this.yylloc.last_line,
969
+ last_line: this.yylineno + 1,
970
+ first_column: this.yylloc.last_column,
971
+ last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length
972
+ };
973
+ this.yytext += match[0];
974
+ this.match += match[0];
975
+ this.matches = match;
976
+ this.yyleng = this.yytext.length;
977
+ if (this.options.ranges) this.yylloc.range = [this.offset, this.offset += this.yyleng];
978
+ this._more = false;
979
+ this._backtrack = false;
980
+ this._input = this._input.slice(match[0].length);
981
+ this.matched += match[0];
982
+ token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
983
+ if (this.done && this._input) this.done = false;
984
+ if (token) return token;
985
+ else if (this._backtrack) {
986
+ for (var k in backup) this[k] = backup[k];
987
+ return false;
988
+ }
989
+ return false;
990
+ }, "test_match"),
991
+ next: /* @__PURE__ */ __name(function() {
992
+ if (this.done) return this.EOF;
993
+ if (!this._input) this.done = true;
994
+ var token, match, tempMatch, index;
995
+ if (!this._more) {
996
+ this.yytext = "";
997
+ this.match = "";
998
+ }
999
+ var rules = this._currentRules();
1000
+ for (var i = 0; i < rules.length; i++) {
1001
+ tempMatch = this._input.match(this.rules[rules[i]]);
1002
+ if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
1003
+ match = tempMatch;
1004
+ index = i;
1005
+ if (this.options.backtrack_lexer) {
1006
+ token = this.test_match(tempMatch, rules[i]);
1007
+ if (token !== false) return token;
1008
+ else if (this._backtrack) {
1009
+ match = false;
1010
+ continue;
1011
+ } else return false;
1012
+ } else if (!this.options.flex) break;
1013
+ }
1014
+ }
1015
+ if (match) {
1016
+ token = this.test_match(match, rules[index]);
1017
+ if (token !== false) return token;
1018
+ return false;
1019
+ }
1020
+ if (this._input === "") return this.EOF;
1021
+ else return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), {
1022
+ text: "",
1023
+ token: null,
1024
+ line: this.yylineno
1025
+ });
1026
+ }, "next"),
1027
+ lex: /* @__PURE__ */ __name(function lex() {
1028
+ var r = this.next();
1029
+ if (r) return r;
1030
+ else return this.lex();
1031
+ }, "lex"),
1032
+ begin: /* @__PURE__ */ __name(function begin(condition) {
1033
+ this.conditionStack.push(condition);
1034
+ }, "begin"),
1035
+ popState: /* @__PURE__ */ __name(function popState() {
1036
+ if (this.conditionStack.length - 1 > 0) return this.conditionStack.pop();
1037
+ else return this.conditionStack[0];
1038
+ }, "popState"),
1039
+ _currentRules: /* @__PURE__ */ __name(function _currentRules() {
1040
+ if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
1041
+ else return this.conditions["INITIAL"].rules;
1042
+ }, "_currentRules"),
1043
+ topState: /* @__PURE__ */ __name(function topState(n) {
1044
+ n = this.conditionStack.length - 1 - Math.abs(n || 0);
1045
+ if (n >= 0) return this.conditionStack[n];
1046
+ else return "INITIAL";
1047
+ }, "topState"),
1048
+ pushState: /* @__PURE__ */ __name(function pushState(condition) {
1049
+ this.begin(condition);
1050
+ }, "pushState"),
1051
+ stateStackSize: /* @__PURE__ */ __name(function stateStackSize() {
1052
+ return this.conditionStack.length;
1053
+ }, "stateStackSize"),
1054
+ options: {},
1055
+ performAction: /* @__PURE__ */ __name(function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
1056
+ switch ($avoiding_name_collisions) {
1057
+ case 0:
1058
+ yy.getLogger().debug("Found block-beta");
1059
+ return 10;
1060
+ case 1:
1061
+ yy.getLogger().debug("Found id-block");
1062
+ return 29;
1063
+ case 2:
1064
+ yy.getLogger().debug("Found block");
1065
+ return 10;
1066
+ case 3:
1067
+ yy.getLogger().debug(".", yy_.yytext);
1068
+ break;
1069
+ case 4:
1070
+ yy.getLogger().debug("_", yy_.yytext);
1071
+ break;
1072
+ case 5: return 5;
1073
+ case 6:
1074
+ yy_.yytext = -1;
1075
+ return 28;
1076
+ case 7:
1077
+ yy_.yytext = yy_.yytext.replace(/columns\s+/, "");
1078
+ yy.getLogger().debug("COLUMNS (LEX)", yy_.yytext);
1079
+ return 28;
1080
+ case 8:
1081
+ this.pushState("md_string");
1082
+ break;
1083
+ case 9: return "MD_STR";
1084
+ case 10:
1085
+ this.popState();
1086
+ break;
1087
+ case 11:
1088
+ this.pushState("string");
1089
+ break;
1090
+ case 12:
1091
+ yy.getLogger().debug("LEX: POPPING STR:", yy_.yytext);
1092
+ this.popState();
1093
+ break;
1094
+ case 13:
1095
+ yy.getLogger().debug("LEX: STR end:", yy_.yytext);
1096
+ return "STR";
1097
+ case 14:
1098
+ yy_.yytext = yy_.yytext.replace(/space\:/, "");
1099
+ yy.getLogger().debug("SPACE NUM (LEX)", yy_.yytext);
1100
+ return 21;
1101
+ case 15:
1102
+ yy_.yytext = "1";
1103
+ yy.getLogger().debug("COLUMNS (LEX)", yy_.yytext);
1104
+ return 21;
1105
+ case 16: return 42;
1106
+ case 17: return "LINKSTYLE";
1107
+ case 18: return "INTERPOLATE";
1108
+ case 19:
1109
+ this.pushState("CLASSDEF");
1110
+ return 39;
1111
+ case 20:
1112
+ this.popState();
1113
+ this.pushState("CLASSDEFID");
1114
+ return "DEFAULT_CLASSDEF_ID";
1115
+ case 21:
1116
+ this.popState();
1117
+ this.pushState("CLASSDEFID");
1118
+ return 40;
1119
+ case 22:
1120
+ this.popState();
1121
+ return 41;
1122
+ case 23:
1123
+ this.pushState("CLASS");
1124
+ return 43;
1125
+ case 24:
1126
+ this.popState();
1127
+ this.pushState("CLASS_STYLE");
1128
+ return 44;
1129
+ case 25:
1130
+ this.popState();
1131
+ return 45;
1132
+ case 26:
1133
+ this.pushState("STYLE_STMNT");
1134
+ return 46;
1135
+ case 27:
1136
+ this.popState();
1137
+ this.pushState("STYLE_DEFINITION");
1138
+ return 47;
1139
+ case 28:
1140
+ this.popState();
1141
+ return 48;
1142
+ case 29:
1143
+ this.pushState("acc_title");
1144
+ return "acc_title";
1145
+ case 30:
1146
+ this.popState();
1147
+ return "acc_title_value";
1148
+ case 31:
1149
+ this.pushState("acc_descr");
1150
+ return "acc_descr";
1151
+ case 32:
1152
+ this.popState();
1153
+ return "acc_descr_value";
1154
+ case 33:
1155
+ this.pushState("acc_descr_multiline");
1156
+ break;
1157
+ case 34:
1158
+ this.popState();
1159
+ break;
1160
+ case 35: return "acc_descr_multiline_value";
1161
+ case 36: return 30;
1162
+ case 37:
1163
+ this.popState();
1164
+ yy.getLogger().debug("Lex: ((");
1165
+ return "NODE_DEND";
1166
+ case 38:
1167
+ this.popState();
1168
+ yy.getLogger().debug("Lex: ((");
1169
+ return "NODE_DEND";
1170
+ case 39:
1171
+ this.popState();
1172
+ yy.getLogger().debug("Lex: ))");
1173
+ return "NODE_DEND";
1174
+ case 40:
1175
+ this.popState();
1176
+ yy.getLogger().debug("Lex: ((");
1177
+ return "NODE_DEND";
1178
+ case 41:
1179
+ this.popState();
1180
+ yy.getLogger().debug("Lex: ((");
1181
+ return "NODE_DEND";
1182
+ case 42:
1183
+ this.popState();
1184
+ yy.getLogger().debug("Lex: (-");
1185
+ return "NODE_DEND";
1186
+ case 43:
1187
+ this.popState();
1188
+ yy.getLogger().debug("Lex: -)");
1189
+ return "NODE_DEND";
1190
+ case 44:
1191
+ this.popState();
1192
+ yy.getLogger().debug("Lex: ((");
1193
+ return "NODE_DEND";
1194
+ case 45:
1195
+ this.popState();
1196
+ yy.getLogger().debug("Lex: ]]");
1197
+ return "NODE_DEND";
1198
+ case 46:
1199
+ this.popState();
1200
+ yy.getLogger().debug("Lex: (");
1201
+ return "NODE_DEND";
1202
+ case 47:
1203
+ this.popState();
1204
+ yy.getLogger().debug("Lex: ])");
1205
+ return "NODE_DEND";
1206
+ case 48:
1207
+ this.popState();
1208
+ yy.getLogger().debug("Lex: /]");
1209
+ return "NODE_DEND";
1210
+ case 49:
1211
+ this.popState();
1212
+ yy.getLogger().debug("Lex: /]");
1213
+ return "NODE_DEND";
1214
+ case 50:
1215
+ this.popState();
1216
+ yy.getLogger().debug("Lex: )]");
1217
+ return "NODE_DEND";
1218
+ case 51:
1219
+ this.popState();
1220
+ yy.getLogger().debug("Lex: )");
1221
+ return "NODE_DEND";
1222
+ case 52:
1223
+ this.popState();
1224
+ yy.getLogger().debug("Lex: ]>");
1225
+ return "NODE_DEND";
1226
+ case 53:
1227
+ this.popState();
1228
+ yy.getLogger().debug("Lex: ]");
1229
+ return "NODE_DEND";
1230
+ case 54:
1231
+ yy.getLogger().debug("Lexa: -)");
1232
+ this.pushState("NODE");
1233
+ return 35;
1234
+ case 55:
1235
+ yy.getLogger().debug("Lexa: (-");
1236
+ this.pushState("NODE");
1237
+ return 35;
1238
+ case 56:
1239
+ yy.getLogger().debug("Lexa: ))");
1240
+ this.pushState("NODE");
1241
+ return 35;
1242
+ case 57:
1243
+ yy.getLogger().debug("Lexa: )");
1244
+ this.pushState("NODE");
1245
+ return 35;
1246
+ case 58:
1247
+ yy.getLogger().debug("Lex: (((");
1248
+ this.pushState("NODE");
1249
+ return 35;
1250
+ case 59:
1251
+ yy.getLogger().debug("Lexa: )");
1252
+ this.pushState("NODE");
1253
+ return 35;
1254
+ case 60:
1255
+ yy.getLogger().debug("Lexa: )");
1256
+ this.pushState("NODE");
1257
+ return 35;
1258
+ case 61:
1259
+ yy.getLogger().debug("Lexa: )");
1260
+ this.pushState("NODE");
1261
+ return 35;
1262
+ case 62:
1263
+ yy.getLogger().debug("Lexc: >");
1264
+ this.pushState("NODE");
1265
+ return 35;
1266
+ case 63:
1267
+ yy.getLogger().debug("Lexa: ([");
1268
+ this.pushState("NODE");
1269
+ return 35;
1270
+ case 64:
1271
+ yy.getLogger().debug("Lexa: )");
1272
+ this.pushState("NODE");
1273
+ return 35;
1274
+ case 65:
1275
+ this.pushState("NODE");
1276
+ return 35;
1277
+ case 66:
1278
+ this.pushState("NODE");
1279
+ return 35;
1280
+ case 67:
1281
+ this.pushState("NODE");
1282
+ return 35;
1283
+ case 68:
1284
+ this.pushState("NODE");
1285
+ return 35;
1286
+ case 69:
1287
+ this.pushState("NODE");
1288
+ return 35;
1289
+ case 70:
1290
+ this.pushState("NODE");
1291
+ return 35;
1292
+ case 71:
1293
+ this.pushState("NODE");
1294
+ return 35;
1295
+ case 72:
1296
+ yy.getLogger().debug("Lexa: [");
1297
+ this.pushState("NODE");
1298
+ return 35;
1299
+ case 73:
1300
+ this.pushState("BLOCK_ARROW");
1301
+ yy.getLogger().debug("LEX ARR START");
1302
+ return 37;
1303
+ case 74:
1304
+ yy.getLogger().debug("Lex: NODE_ID", yy_.yytext);
1305
+ return 31;
1306
+ case 75:
1307
+ yy.getLogger().debug("Lex: EOF", yy_.yytext);
1308
+ return 8;
1309
+ case 76:
1310
+ this.pushState("md_string");
1311
+ break;
1312
+ case 77:
1313
+ this.pushState("md_string");
1314
+ break;
1315
+ case 78: return "NODE_DESCR";
1316
+ case 79:
1317
+ this.popState();
1318
+ break;
1319
+ case 80:
1320
+ yy.getLogger().debug("Lex: Starting string");
1321
+ this.pushState("string");
1322
+ break;
1323
+ case 81:
1324
+ yy.getLogger().debug("LEX ARR: Starting string");
1325
+ this.pushState("string");
1326
+ break;
1327
+ case 82:
1328
+ yy.getLogger().debug("LEX: NODE_DESCR:", yy_.yytext);
1329
+ return "NODE_DESCR";
1330
+ case 83:
1331
+ yy.getLogger().debug("LEX POPPING");
1332
+ this.popState();
1333
+ break;
1334
+ case 84:
1335
+ yy.getLogger().debug("Lex: =>BAE");
1336
+ this.pushState("ARROW_DIR");
1337
+ break;
1338
+ case 85:
1339
+ yy_.yytext = yy_.yytext.replace(/^,\s*/, "");
1340
+ yy.getLogger().debug("Lex (right): dir:", yy_.yytext);
1341
+ return "DIR";
1342
+ case 86:
1343
+ yy_.yytext = yy_.yytext.replace(/^,\s*/, "");
1344
+ yy.getLogger().debug("Lex (left):", yy_.yytext);
1345
+ return "DIR";
1346
+ case 87:
1347
+ yy_.yytext = yy_.yytext.replace(/^,\s*/, "");
1348
+ yy.getLogger().debug("Lex (x):", yy_.yytext);
1349
+ return "DIR";
1350
+ case 88:
1351
+ yy_.yytext = yy_.yytext.replace(/^,\s*/, "");
1352
+ yy.getLogger().debug("Lex (y):", yy_.yytext);
1353
+ return "DIR";
1354
+ case 89:
1355
+ yy_.yytext = yy_.yytext.replace(/^,\s*/, "");
1356
+ yy.getLogger().debug("Lex (up):", yy_.yytext);
1357
+ return "DIR";
1358
+ case 90:
1359
+ yy_.yytext = yy_.yytext.replace(/^,\s*/, "");
1360
+ yy.getLogger().debug("Lex (down):", yy_.yytext);
1361
+ return "DIR";
1362
+ case 91:
1363
+ yy_.yytext = "]>";
1364
+ yy.getLogger().debug("Lex (ARROW_DIR end):", yy_.yytext);
1365
+ this.popState();
1366
+ this.popState();
1367
+ return "BLOCK_ARROW_END";
1368
+ case 92:
1369
+ yy.getLogger().debug("Lex: LINK", "#" + yy_.yytext + "#");
1370
+ return 15;
1371
+ case 93:
1372
+ yy.getLogger().debug("Lex: LINK", yy_.yytext);
1373
+ return 15;
1374
+ case 94:
1375
+ yy.getLogger().debug("Lex: LINK", yy_.yytext);
1376
+ return 15;
1377
+ case 95:
1378
+ yy.getLogger().debug("Lex: LINK", yy_.yytext);
1379
+ return 15;
1380
+ case 96:
1381
+ yy.getLogger().debug("Lex: START_LINK", yy_.yytext);
1382
+ this.pushState("LLABEL");
1383
+ return 16;
1384
+ case 97:
1385
+ yy.getLogger().debug("Lex: START_LINK", yy_.yytext);
1386
+ this.pushState("LLABEL");
1387
+ return 16;
1388
+ case 98:
1389
+ yy.getLogger().debug("Lex: START_LINK", yy_.yytext);
1390
+ this.pushState("LLABEL");
1391
+ return 16;
1392
+ case 99:
1393
+ this.pushState("md_string");
1394
+ break;
1395
+ case 100:
1396
+ yy.getLogger().debug("Lex: Starting string");
1397
+ this.pushState("string");
1398
+ return "LINK_LABEL";
1399
+ case 101:
1400
+ this.popState();
1401
+ yy.getLogger().debug("Lex: LINK", "#" + yy_.yytext + "#");
1402
+ return 15;
1403
+ case 102:
1404
+ this.popState();
1405
+ yy.getLogger().debug("Lex: LINK", yy_.yytext);
1406
+ return 15;
1407
+ case 103:
1408
+ this.popState();
1409
+ yy.getLogger().debug("Lex: LINK", yy_.yytext);
1410
+ return 15;
1411
+ case 104:
1412
+ yy.getLogger().debug("Lex: COLON", yy_.yytext);
1413
+ yy_.yytext = yy_.yytext.slice(1);
1414
+ return 27;
1415
+ }
1416
+ }, "anonymous"),
1417
+ rules: [
1418
+ /^(?:block-beta\b)/,
1419
+ /^(?:block:)/,
1420
+ /^(?:block\b)/,
1421
+ /^(?:[\s]+)/,
1422
+ /^(?:[\n]+)/,
1423
+ /^(?:((\u000D\u000A)|(\u000A)))/,
1424
+ /^(?:columns\s+auto\b)/,
1425
+ /^(?:columns\s+[\d]+)/,
1426
+ /^(?:["][`])/,
1427
+ /^(?:[^`"]+)/,
1428
+ /^(?:[`]["])/,
1429
+ /^(?:["])/,
1430
+ /^(?:["])/,
1431
+ /^(?:[^"]*)/,
1432
+ /^(?:space[:]\d+)/,
1433
+ /^(?:space\b)/,
1434
+ /^(?:default\b)/,
1435
+ /^(?:linkStyle\b)/,
1436
+ /^(?:interpolate\b)/,
1437
+ /^(?:classDef\s+)/,
1438
+ /^(?:DEFAULT\s+)/,
1439
+ /^(?:\w+\s+)/,
1440
+ /^(?:[^\n]*)/,
1441
+ /^(?:class\s+)/,
1442
+ /^(?:(\w+)+((,\s*\w+)*))/,
1443
+ /^(?:[^\n]*)/,
1444
+ /^(?:style\s+)/,
1445
+ /^(?:(\w+)+((,\s*\w+)*))/,
1446
+ /^(?:[^\n]*)/,
1447
+ /^(?:accTitle\s*:\s*)/,
1448
+ /^(?:(?!\n||)*[^\n]*)/,
1449
+ /^(?:accDescr\s*:\s*)/,
1450
+ /^(?:(?!\n||)*[^\n]*)/,
1451
+ /^(?:accDescr\s*\{\s*)/,
1452
+ /^(?:[\}])/,
1453
+ /^(?:[^\}]*)/,
1454
+ /^(?:end\b\s*)/,
1455
+ /^(?:\(\(\()/,
1456
+ /^(?:\)\)\))/,
1457
+ /^(?:[\)]\))/,
1458
+ /^(?:\}\})/,
1459
+ /^(?:\})/,
1460
+ /^(?:\(-)/,
1461
+ /^(?:-\))/,
1462
+ /^(?:\(\()/,
1463
+ /^(?:\]\])/,
1464
+ /^(?:\()/,
1465
+ /^(?:\]\))/,
1466
+ /^(?:\\\])/,
1467
+ /^(?:\/\])/,
1468
+ /^(?:\)\])/,
1469
+ /^(?:[\)])/,
1470
+ /^(?:\]>)/,
1471
+ /^(?:[\]])/,
1472
+ /^(?:-\))/,
1473
+ /^(?:\(-)/,
1474
+ /^(?:\)\))/,
1475
+ /^(?:\))/,
1476
+ /^(?:\(\(\()/,
1477
+ /^(?:\(\()/,
1478
+ /^(?:\{\{)/,
1479
+ /^(?:\{)/,
1480
+ /^(?:>)/,
1481
+ /^(?:\(\[)/,
1482
+ /^(?:\()/,
1483
+ /^(?:\[\[)/,
1484
+ /^(?:\[\|)/,
1485
+ /^(?:\[\()/,
1486
+ /^(?:\)\)\))/,
1487
+ /^(?:\[\\)/,
1488
+ /^(?:\[\/)/,
1489
+ /^(?:\[\\)/,
1490
+ /^(?:\[)/,
1491
+ /^(?:<\[)/,
1492
+ /^(?:[^\(\[\n\-\)\{\}\s\<\>:=]+)/,
1493
+ /^(?:$)/,
1494
+ /^(?:["][`])/,
1495
+ /^(?:["][`])/,
1496
+ /^(?:[^`"]+)/,
1497
+ /^(?:[`]["])/,
1498
+ /^(?:["])/,
1499
+ /^(?:["])/,
1500
+ /^(?:[^"]+)/,
1501
+ /^(?:["])/,
1502
+ /^(?:\]>\s*\()/,
1503
+ /^(?:,?\s*right\s*)/,
1504
+ /^(?:,?\s*left\s*)/,
1505
+ /^(?:,?\s*x\s*)/,
1506
+ /^(?:,?\s*y\s*)/,
1507
+ /^(?:,?\s*up\s*)/,
1508
+ /^(?:,?\s*down\s*)/,
1509
+ /^(?:\)\s*)/,
1510
+ /^(?:\s*[xo<]?--+[-xo>]\s*)/,
1511
+ /^(?:\s*[xo<]?==+[=xo>]\s*)/,
1512
+ /^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,
1513
+ /^(?:\s*~~[\~]+\s*)/,
1514
+ /^(?:\s*[xo<]?--\s*)/,
1515
+ /^(?:\s*[xo<]?==\s*)/,
1516
+ /^(?:\s*[xo<]?-\.\s*)/,
1517
+ /^(?:["][`])/,
1518
+ /^(?:["])/,
1519
+ /^(?:\s*[xo<]?--+[-xo>]\s*)/,
1520
+ /^(?:\s*[xo<]?==+[=xo>]\s*)/,
1521
+ /^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,
1522
+ /^(?::\d+)/
1523
+ ],
1524
+ conditions: {
1525
+ "STYLE_DEFINITION": {
1526
+ "rules": [28],
1527
+ "inclusive": false
1528
+ },
1529
+ "STYLE_STMNT": {
1530
+ "rules": [27],
1531
+ "inclusive": false
1532
+ },
1533
+ "CLASSDEFID": {
1534
+ "rules": [22],
1535
+ "inclusive": false
1536
+ },
1537
+ "CLASSDEF": {
1538
+ "rules": [20, 21],
1539
+ "inclusive": false
1540
+ },
1541
+ "CLASS_STYLE": {
1542
+ "rules": [25],
1543
+ "inclusive": false
1544
+ },
1545
+ "CLASS": {
1546
+ "rules": [24],
1547
+ "inclusive": false
1548
+ },
1549
+ "LLABEL": {
1550
+ "rules": [
1551
+ 99,
1552
+ 100,
1553
+ 101,
1554
+ 102,
1555
+ 103
1556
+ ],
1557
+ "inclusive": false
1558
+ },
1559
+ "ARROW_DIR": {
1560
+ "rules": [
1561
+ 85,
1562
+ 86,
1563
+ 87,
1564
+ 88,
1565
+ 89,
1566
+ 90,
1567
+ 91
1568
+ ],
1569
+ "inclusive": false
1570
+ },
1571
+ "BLOCK_ARROW": {
1572
+ "rules": [
1573
+ 76,
1574
+ 81,
1575
+ 84
1576
+ ],
1577
+ "inclusive": false
1578
+ },
1579
+ "NODE": {
1580
+ "rules": [
1581
+ 37,
1582
+ 38,
1583
+ 39,
1584
+ 40,
1585
+ 41,
1586
+ 42,
1587
+ 43,
1588
+ 44,
1589
+ 45,
1590
+ 46,
1591
+ 47,
1592
+ 48,
1593
+ 49,
1594
+ 50,
1595
+ 51,
1596
+ 52,
1597
+ 53,
1598
+ 77,
1599
+ 80
1600
+ ],
1601
+ "inclusive": false
1602
+ },
1603
+ "md_string": {
1604
+ "rules": [
1605
+ 9,
1606
+ 10,
1607
+ 78,
1608
+ 79
1609
+ ],
1610
+ "inclusive": false
1611
+ },
1612
+ "space": {
1613
+ "rules": [],
1614
+ "inclusive": false
1615
+ },
1616
+ "string": {
1617
+ "rules": [
1618
+ 12,
1619
+ 13,
1620
+ 82,
1621
+ 83
1622
+ ],
1623
+ "inclusive": false
1624
+ },
1625
+ "acc_descr_multiline": {
1626
+ "rules": [34, 35],
1627
+ "inclusive": false
1628
+ },
1629
+ "acc_descr": {
1630
+ "rules": [32],
1631
+ "inclusive": false
1632
+ },
1633
+ "acc_title": {
1634
+ "rules": [30],
1635
+ "inclusive": false
1636
+ },
1637
+ "INITIAL": {
1638
+ "rules": [
1639
+ 0,
1640
+ 1,
1641
+ 2,
1642
+ 3,
1643
+ 4,
1644
+ 5,
1645
+ 6,
1646
+ 7,
1647
+ 8,
1648
+ 11,
1649
+ 14,
1650
+ 15,
1651
+ 16,
1652
+ 17,
1653
+ 18,
1654
+ 19,
1655
+ 23,
1656
+ 26,
1657
+ 29,
1658
+ 31,
1659
+ 33,
1660
+ 36,
1661
+ 54,
1662
+ 55,
1663
+ 56,
1664
+ 57,
1665
+ 58,
1666
+ 59,
1667
+ 60,
1668
+ 61,
1669
+ 62,
1670
+ 63,
1671
+ 64,
1672
+ 65,
1673
+ 66,
1674
+ 67,
1675
+ 68,
1676
+ 69,
1677
+ 70,
1678
+ 71,
1679
+ 72,
1680
+ 73,
1681
+ 74,
1682
+ 75,
1683
+ 92,
1684
+ 93,
1685
+ 94,
1686
+ 95,
1687
+ 96,
1688
+ 97,
1689
+ 98,
1690
+ 104
1691
+ ],
1692
+ "inclusive": true
1693
+ }
1694
+ }
1695
+ };
1696
+ })();
1697
+ function Parser() {
1698
+ this.yy = {};
1699
+ }
1700
+ __name(Parser, "Parser");
1701
+ Parser.prototype = parser2;
1702
+ parser2.Parser = Parser;
1703
+ return new Parser();
1704
+ })();
1705
+ parser.parser = parser;
1706
+ var block_default = parser;
1707
+ var blockDatabase = /* @__PURE__ */ new Map();
1708
+ var edgeList = [];
1709
+ var edgeCount = /* @__PURE__ */ new Map();
1710
+ var COLOR_KEYWORD = "color";
1711
+ var FILL_KEYWORD = "fill";
1712
+ var BG_FILL = "bgFill";
1713
+ var STYLECLASS_SEP = ",";
1714
+ var classes = /* @__PURE__ */ new Map();
1715
+ var diagramId = "";
1716
+ var sanitizeText = /* @__PURE__ */ __name((txt) => common_default.sanitizeText(txt, getConfig2()), "sanitizeText");
1717
+ var addStyleClass = /* @__PURE__ */ __name(function(id, styleAttributes = "") {
1718
+ let foundClass = classes.get(id);
1719
+ if (!foundClass) {
1720
+ foundClass = {
1721
+ id,
1722
+ styles: [],
1723
+ textStyles: []
1724
+ };
1725
+ classes.set(id, foundClass);
1726
+ }
1727
+ if (styleAttributes !== void 0 && styleAttributes !== null) styleAttributes.split(STYLECLASS_SEP).forEach((attrib) => {
1728
+ const fixedAttrib = attrib.replace(/([^;]*);/, "$1").trim();
1729
+ if (RegExp(COLOR_KEYWORD).exec(attrib)) {
1730
+ const newStyle2 = fixedAttrib.replace(FILL_KEYWORD, BG_FILL).replace(COLOR_KEYWORD, FILL_KEYWORD);
1731
+ foundClass.textStyles.push(newStyle2);
1732
+ }
1733
+ foundClass.styles.push(fixedAttrib);
1734
+ });
1735
+ }, "addStyleClass");
1736
+ var addStyle2Node = /* @__PURE__ */ __name(function(id, styles = "") {
1737
+ const foundBlock = blockDatabase.get(id);
1738
+ if (styles !== void 0 && styles !== null) foundBlock.styles = styles.split(STYLECLASS_SEP);
1739
+ }, "addStyle2Node");
1740
+ var setCssClass = /* @__PURE__ */ __name(function(itemIds, cssClassName) {
1741
+ itemIds.split(",").forEach(function(id) {
1742
+ let foundBlock = blockDatabase.get(id);
1743
+ if (foundBlock === void 0) {
1744
+ const trimmedId = id.trim();
1745
+ foundBlock = {
1746
+ id: trimmedId,
1747
+ type: "na",
1748
+ children: []
1749
+ };
1750
+ blockDatabase.set(trimmedId, foundBlock);
1751
+ }
1752
+ if (!foundBlock.classes) foundBlock.classes = [];
1753
+ foundBlock.classes.push(cssClassName);
1754
+ });
1755
+ }, "setCssClass");
1756
+ var nextColorIndex = 0;
1757
+ var populateBlockDatabase = /* @__PURE__ */ __name((_blockList, parent) => {
1758
+ const blockList = _blockList.flat();
1759
+ const children = [];
1760
+ const column = blockList.find((b) => b?.type === "column-setting")?.columns ?? -1;
1761
+ for (const block of blockList) {
1762
+ if (typeof column === "number" && column > 0 && block.type !== "column-setting" && typeof block.widthInColumns === "number" && block.widthInColumns > column) log.warn(`Block ${block.id} width ${block.widthInColumns} exceeds configured column width ${column}`);
1763
+ if (block.label) block.label = sanitizeText(block.label);
1764
+ if (block.type === "classDef") {
1765
+ addStyleClass(block.id, block.css);
1766
+ continue;
1767
+ }
1768
+ if (block.type === "applyClass") {
1769
+ setCssClass(block.id, block?.styleClass ?? "");
1770
+ continue;
1771
+ }
1772
+ if (block.type === "applyStyles") {
1773
+ if (block?.stylesStr) addStyle2Node(block.id, block?.stylesStr);
1774
+ continue;
1775
+ }
1776
+ if (block.type === "column-setting") parent.columns = block.columns ?? -1;
1777
+ else if (block.type === "edge") {
1778
+ const count = (edgeCount.get(block.id) ?? 0) + 1;
1779
+ edgeCount.set(block.id, count);
1780
+ block.id = count + "-" + block.id;
1781
+ edgeList.push(block);
1782
+ } else {
1783
+ if (!block.label) if (block.type === "composite") block.label = "";
1784
+ else block.label = block.id;
1785
+ const existingBlock = blockDatabase.get(block.id);
1786
+ if (existingBlock === void 0) {
1787
+ if (block.type === "composite") block.colorIndex = nextColorIndex++;
1788
+ blockDatabase.set(block.id, block);
1789
+ } else {
1790
+ if (block.type !== "na") existingBlock.type = block.type;
1791
+ if (block.label !== block.id) existingBlock.label = block.label;
1792
+ }
1793
+ if (block.children) populateBlockDatabase(block.children, block);
1794
+ if (block.type === "space") {
1795
+ const w = block.width ?? 1;
1796
+ for (let j = 0; j < w; j++) {
1797
+ const newBlock = clone(block);
1798
+ newBlock.id = newBlock.id + "-" + j;
1799
+ blockDatabase.set(newBlock.id, newBlock);
1800
+ children.push(newBlock);
1801
+ }
1802
+ } else if (existingBlock === void 0) children.push(block);
1803
+ }
1804
+ }
1805
+ parent.children = children;
1806
+ }, "populateBlockDatabase");
1807
+ var blocks = [];
1808
+ var rootBlock = {
1809
+ id: "root",
1810
+ type: "composite",
1811
+ children: [],
1812
+ columns: -1
1813
+ };
1814
+ var clear2 = /* @__PURE__ */ __name(() => {
1815
+ log.debug("Clear called");
1816
+ clear();
1817
+ rootBlock = {
1818
+ id: "root",
1819
+ type: "composite",
1820
+ children: [],
1821
+ columns: -1
1822
+ };
1823
+ blockDatabase = /* @__PURE__ */ new Map([["root", rootBlock]]);
1824
+ blocks = [];
1825
+ classes = /* @__PURE__ */ new Map();
1826
+ edgeList = [];
1827
+ edgeCount = /* @__PURE__ */ new Map();
1828
+ diagramId = "";
1829
+ nextColorIndex = 0;
1830
+ }, "clear");
1831
+ function typeStr2Type(typeStr) {
1832
+ log.debug("typeStr2Type", typeStr);
1833
+ switch (typeStr) {
1834
+ case "[]": return "square";
1835
+ case "()":
1836
+ log.debug("we have a round");
1837
+ return "round";
1838
+ case "(())": return "circle";
1839
+ case ">]": return "rect_left_inv_arrow";
1840
+ case "{}": return "diamond";
1841
+ case "{{}}": return "hexagon";
1842
+ case "([])": return "stadium";
1843
+ case "[[]]": return "subroutine";
1844
+ case "[()]": return "cylinder";
1845
+ case "((()))": return "doublecircle";
1846
+ case "[//]": return "lean_right";
1847
+ case "[\\\\]": return "lean_left";
1848
+ case "[/\\]": return "trapezoid";
1849
+ case "[\\/]": return "inv_trapezoid";
1850
+ case "<[]>": return "block_arrow";
1851
+ default: return "na";
1852
+ }
1853
+ }
1854
+ __name(typeStr2Type, "typeStr2Type");
1855
+ function edgeTypeStr2Type(typeStr) {
1856
+ log.debug("typeStr2Type", typeStr);
1857
+ switch (typeStr) {
1858
+ case "==": return "thick";
1859
+ default: return "normal";
1860
+ }
1861
+ }
1862
+ __name(edgeTypeStr2Type, "edgeTypeStr2Type");
1863
+ function edgeStrToEdgeData(typeStr) {
1864
+ switch (typeStr.trim().slice(-1)) {
1865
+ case "x": return "arrow_cross";
1866
+ case "o": return "arrow_circle";
1867
+ case ">": return "arrow_point";
1868
+ default: return "";
1869
+ }
1870
+ }
1871
+ __name(edgeStrToEdgeData, "edgeStrToEdgeData");
1872
+ function edgeStrToEdgeStartData(typeStr) {
1873
+ switch (typeStr.trim().charAt(0)) {
1874
+ case "x": return "arrow_cross";
1875
+ case "o": return "arrow_circle";
1876
+ case "<": return "arrow_point";
1877
+ default: return "arrow_open";
1878
+ }
1879
+ }
1880
+ __name(edgeStrToEdgeStartData, "edgeStrToEdgeStartData");
1881
+ function edgeStrToThickness(typeStr) {
1882
+ return typeStr.includes("==") ? "thick" : "normal";
1883
+ }
1884
+ __name(edgeStrToThickness, "edgeStrToThickness");
1885
+ function edgeStrToPattern(typeStr) {
1886
+ if (typeStr.includes(".-")) return "dotted";
1887
+ return "solid";
1888
+ }
1889
+ __name(edgeStrToPattern, "edgeStrToPattern");
1890
+ var cnt = 0;
1891
+ var blockDB_default = {
1892
+ getConfig: /* @__PURE__ */ __name(() => getConfig().block, "getConfig"),
1893
+ typeStr2Type,
1894
+ edgeTypeStr2Type,
1895
+ edgeStrToEdgeData,
1896
+ edgeStrToEdgeStartData,
1897
+ edgeStrToThickness,
1898
+ edgeStrToPattern,
1899
+ getLogger: /* @__PURE__ */ __name(() => log, "getLogger"),
1900
+ getBlocksFlat: /* @__PURE__ */ __name(() => {
1901
+ return [...blockDatabase.values()];
1902
+ }, "getBlocksFlat"),
1903
+ getBlocks: /* @__PURE__ */ __name(() => {
1904
+ return blocks || [];
1905
+ }, "getBlocks"),
1906
+ getEdges: /* @__PURE__ */ __name(() => {
1907
+ return edgeList;
1908
+ }, "getEdges"),
1909
+ setHierarchy: /* @__PURE__ */ __name((block) => {
1910
+ rootBlock.children = block;
1911
+ populateBlockDatabase(block, rootBlock);
1912
+ blocks = rootBlock.children;
1913
+ }, "setHierarchy"),
1914
+ getBlock: /* @__PURE__ */ __name((id) => {
1915
+ return blockDatabase.get(id);
1916
+ }, "getBlock"),
1917
+ setBlock: /* @__PURE__ */ __name((block) => {
1918
+ blockDatabase.set(block.id, block);
1919
+ }, "setBlock"),
1920
+ getColumns: /* @__PURE__ */ __name((blockId) => {
1921
+ const block = blockDatabase.get(blockId);
1922
+ if (!block) return -1;
1923
+ if (block.columns) return block.columns;
1924
+ if (!block.children) return -1;
1925
+ return block.children.length;
1926
+ }, "getColumns"),
1927
+ getClasses: /* @__PURE__ */ __name(function() {
1928
+ return classes;
1929
+ }, "getClasses"),
1930
+ clear: clear2,
1931
+ generateId: /* @__PURE__ */ __name(() => {
1932
+ cnt++;
1933
+ return "id-" + Math.random().toString(36).substr(2, 12) + "-" + cnt;
1934
+ }, "generateId"),
1935
+ setDiagramId: /* @__PURE__ */ __name((id) => {
1936
+ diagramId = id;
1937
+ }, "setDiagramId"),
1938
+ getDiagramId: /* @__PURE__ */ __name(() => diagramId, "getDiagramId")
1939
+ };
1940
+ var genColor = /* @__PURE__ */ __name((options) => {
1941
+ const { theme, bkgColorArray, borderColorArray } = options;
1942
+ if (!isColorTheme(theme, borderColorArray)) return "";
1943
+ const look = safeLook(options.look);
1944
+ const hasBkgColors = hasPalette(bkgColorArray);
1945
+ let sections = "";
1946
+ for (let i = 0; i < colorSlotCount(options.THEME_COLOR_LIMIT, borderColorArray); i++) {
1947
+ const borderColor = borderColorArray[i % borderColorArray.length];
1948
+ const fill = hasBkgColors ? `fill: ${bkgColorArray[i % bkgColorArray.length]};` : "";
1949
+ const slot = `[data-look="${look}"][data-color-id="color-${i}"]`;
1950
+ sections += `
1951
+
1952
+ ${slot}.node rect.composite {
1953
+ stroke: ${borderColor};
1954
+ ${fill}
1955
+ }
1956
+ `;
1957
+ }
1958
+ return sections;
1959
+ }, "genColor");
1960
+ var fade = /* @__PURE__ */ __name((color, opacity) => {
1961
+ const channel2 = channel;
1962
+ const r = channel2(color, "r");
1963
+ const g = channel2(color, "g");
1964
+ const b = channel2(color, "b");
1965
+ return rgba(r, g, b, opacity);
1966
+ }, "fade");
1967
+ var styles_default = /* @__PURE__ */ __name((options) => `${genColor(options)}
1968
+ .label {
1969
+ font-family: ${options.fontFamily};
1970
+ color: ${options.nodeTextColor || options.textColor};
1971
+ }
1972
+ .cluster-label text {
1973
+ fill: ${options.titleColor};
1974
+ }
1975
+ .cluster-label span {
1976
+ color: ${options.titleColor};
1977
+ }
1978
+
1979
+
1980
+
1981
+ .label text,span {
1982
+ fill: ${options.nodeTextColor || options.textColor};
1983
+ color: ${options.nodeTextColor || options.textColor};
1984
+ }
1985
+
1986
+ .node rect,
1987
+ .node circle,
1988
+ .node ellipse,
1989
+ .node polygon,
1990
+ .node path {
1991
+ fill: ${options.mainBkg};
1992
+ stroke: ${options.nodeBorder};
1993
+ /* From the theme, as every other diagram does. Pinned at 1px here, so block drew a
1994
+ thinner border than an identical flowchart node under any theme asking for more --
1995
+ the neo theme asks for 2. Nothing downstream corrected it: the neo rules set stroke
1996
+ and filter, never stroke-width. */
1997
+ stroke-width: ${options.strokeWidth ?? 1}px;
1998
+ }
1999
+ .flowchart-label text {
2000
+ text-anchor: middle;
2001
+ }
2002
+ // .flowchart-label .text-outer-tspan {
2003
+ // text-anchor: middle;
2004
+ // }
2005
+ // .flowchart-label .text-inner-tspan {
2006
+ // text-anchor: start;
2007
+ // }
2008
+
2009
+ .node .label {
2010
+ text-align: center;
2011
+ }
2012
+ .node.clickable {
2013
+ cursor: pointer;
2014
+ }
2015
+
2016
+ .arrowheadPath {
2017
+ fill: ${options.arrowheadColor};
2018
+ }
2019
+
2020
+ .edgePaths .path {
2021
+ stroke: ${options.lineColor};
2022
+ stroke-width: 2.0px;
2023
+ }
2024
+
2025
+ .flowchart-link {
2026
+ stroke: ${options.lineColor};
2027
+ fill: none;
2028
+ }
2029
+
2030
+ .edgeLabel {
2031
+ background-color: ${options.edgeLabelBackground};
2032
+ /*
2033
+ * This is for backward compatibility with existing code that didn't
2034
+ * add a \`<p>\` around edge labels.
2035
+ *
2036
+ * TODO: We should probably remove this in a future release.
2037
+ */
2038
+ p {
2039
+ margin: 0;
2040
+ padding: 0;
2041
+ display: inline;
2042
+ }
2043
+ rect {
2044
+ opacity: 0.5;
2045
+ background-color: ${options.edgeLabelBackground};
2046
+ fill: ${options.edgeLabelBackground};
2047
+ }
2048
+ text-align: center;
2049
+ }
2050
+
2051
+ /* For html labels only */
2052
+ .labelBkg {
2053
+ background-color: ${options.edgeLabelBackground};
2054
+ }
2055
+
2056
+ .node .cluster {
2057
+ // fill: ${fade(options.mainBkg, .5)};
2058
+ fill: ${fade(options.clusterBkg, .5)};
2059
+ stroke: ${fade(options.clusterBorder, .2)};
2060
+ box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px;
2061
+ stroke-width: 1px;
2062
+ }
2063
+
2064
+ .cluster text {
2065
+ fill: ${options.titleColor};
2066
+ }
2067
+
2068
+ .cluster span {
2069
+ color: ${options.titleColor};
2070
+ }
2071
+ /* .cluster div {
2072
+ color: ${options.titleColor};
2073
+ } */
2074
+
2075
+ div.mermaidTooltip {
2076
+ position: absolute;
2077
+ text-align: center;
2078
+ max-width: 200px;
2079
+ padding: 2px;
2080
+ font-family: ${options.fontFamily};
2081
+ font-size: 12px;
2082
+ background: ${options.tertiaryColor};
2083
+ border: 1px solid ${options.border2};
2084
+ border-radius: 2px;
2085
+ pointer-events: none;
2086
+ z-index: 100;
2087
+ }
2088
+
2089
+ .flowchartTitleText {
2090
+ text-anchor: middle;
2091
+ font-size: 18px;
2092
+ fill: ${options.textColor};
2093
+ }
2094
+ ${getIconStyles()}
2095
+ `, "getStyles");
2096
+ function calculateBlockPosition(columns, position) {
2097
+ if (columns === 0 || !Number.isInteger(columns)) throw new Error("Columns must be an integer !== 0.");
2098
+ if (position < 0 || !Number.isInteger(position)) throw new Error("Position must be a non-negative integer." + position);
2099
+ if (columns < 0) return {
2100
+ px: position,
2101
+ py: 0
2102
+ };
2103
+ if (columns === 1) return {
2104
+ px: 0,
2105
+ py: position
2106
+ };
2107
+ return {
2108
+ px: position % columns,
2109
+ py: Math.floor(position / columns)
2110
+ };
2111
+ }
2112
+ __name(calculateBlockPosition, "calculateBlockPosition");
2113
+ var getMaxChildSize = /* @__PURE__ */ __name((block) => {
2114
+ let maxWidth = 0;
2115
+ let maxHeight = 0;
2116
+ for (const child of block.children) {
2117
+ const { width, height, x, y } = child.size ?? {
2118
+ width: 0,
2119
+ height: 0,
2120
+ x: 0,
2121
+ y: 0
2122
+ };
2123
+ log.debug("getMaxChildSize abc95 child:", child.id, "width:", width, "height:", height, "x:", x, "y:", y, child.type);
2124
+ if (child.type === "space") continue;
2125
+ const normalizedWidth = width / (child.widthInColumns ?? 1);
2126
+ if (normalizedWidth > maxWidth) maxWidth = normalizedWidth;
2127
+ if (height > maxHeight) maxHeight = height;
2128
+ }
2129
+ return {
2130
+ width: maxWidth,
2131
+ height: maxHeight
2132
+ };
2133
+ }, "getMaxChildSize");
2134
+ function setBlockSizes(block, db2, siblingWidth = 0, siblingHeight = 0, padding = 8) {
2135
+ log.debug("setBlockSizes abc95 (start)", block.id, block?.size?.x, "block width =", block?.size, "siblingWidth", siblingWidth);
2136
+ if (!block?.size?.width) block.size = {
2137
+ width: siblingWidth,
2138
+ height: siblingHeight,
2139
+ x: 0,
2140
+ y: 0
2141
+ };
2142
+ let maxWidth = 0;
2143
+ let maxHeight = 0;
2144
+ if (block.children?.length > 0) {
2145
+ for (const child of block.children) setBlockSizes(child, db2, 0, 0, padding);
2146
+ const childSize = getMaxChildSize(block);
2147
+ maxWidth = childSize.width;
2148
+ maxHeight = childSize.height;
2149
+ log.debug("setBlockSizes abc95 maxWidth of", block.id, ":s children is ", maxWidth, maxHeight);
2150
+ for (const child of block.children) if (child.size) {
2151
+ log.debug(`abc95 Setting size of children of ${block.id} id=${child.id} ${maxWidth} ${maxHeight} ${JSON.stringify(child.size)}`);
2152
+ child.size.width = maxWidth * (child.widthInColumns ?? 1) + padding * ((child.widthInColumns ?? 1) - 1);
2153
+ child.size.height = maxHeight;
2154
+ child.size.x = 0;
2155
+ child.size.y = 0;
2156
+ log.debug(`abc95 updating size of ${block.id} children child:${child.id} maxWidth:${maxWidth} maxHeight:${maxHeight}`);
2157
+ }
2158
+ for (const child of block.children) setBlockSizes(child, db2, maxWidth, maxHeight, padding);
2159
+ const columns = block.columns ?? -1;
2160
+ let numItems = 0;
2161
+ for (const child of block.children) numItems += child.widthInColumns ?? 1;
2162
+ let xSize = block.children.length;
2163
+ if (columns > 0 && columns < numItems) xSize = columns;
2164
+ const ySize = Math.ceil(numItems / xSize);
2165
+ let width = xSize * (maxWidth + padding) + padding;
2166
+ let height = ySize * (maxHeight + padding) + padding;
2167
+ if (width < siblingWidth) {
2168
+ log.debug(`Detected to small sibling: abc95 ${block.id} siblingWidth ${siblingWidth} siblingHeight ${siblingHeight} width ${width}`);
2169
+ width = siblingWidth;
2170
+ height = siblingHeight;
2171
+ const childWidth = (siblingWidth - xSize * padding - padding) / xSize;
2172
+ const childHeight = (siblingHeight - ySize * padding - padding) / ySize;
2173
+ log.debug("Size indata abc88", block.id, "childWidth", childWidth, "maxWidth", maxWidth);
2174
+ log.debug("Size indata abc88", block.id, "childHeight", childHeight, "maxHeight", maxHeight);
2175
+ log.debug("Size indata abc88 xSize", xSize, "padding", padding);
2176
+ for (const child of block.children) if (child.size) {
2177
+ child.size.width = childWidth;
2178
+ child.size.height = childHeight;
2179
+ child.size.x = 0;
2180
+ child.size.y = 0;
2181
+ }
2182
+ }
2183
+ log.debug(`abc95 (finale calc) ${block.id} xSize ${xSize} ySize ${ySize} columns ${columns}${block.children.length} width=${Math.max(width, block.size?.width || 0)}`);
2184
+ if (width < (block?.size?.width || 0)) {
2185
+ width = block?.size?.width || 0;
2186
+ const num = columns > 0 ? Math.min(block.children.length, columns) : block.children.length;
2187
+ if (num > 0) {
2188
+ const childWidth = (width - num * padding - padding) / num;
2189
+ log.debug("abc95 (growing to fit) width", block.id, width, block.size?.width, childWidth);
2190
+ for (const child of block.children) if (child.size) child.size.width = childWidth;
2191
+ }
2192
+ }
2193
+ block.size = {
2194
+ width,
2195
+ height,
2196
+ x: 0,
2197
+ y: 0
2198
+ };
2199
+ }
2200
+ log.debug("setBlockSizes abc94 (done)", block.id, block?.size?.x, block?.size?.width, block?.size?.y, block?.size?.height);
2201
+ }
2202
+ __name(setBlockSizes, "setBlockSizes");
2203
+ function layoutBlocks(block, db2, padding = 8) {
2204
+ log.debug(`abc85 layout blocks (=>layoutBlocks) ${block.id} x: ${block?.size?.x} y: ${block?.size?.y} width: ${block?.size?.width}`);
2205
+ const columns = block.columns ?? -1;
2206
+ log.debug("layoutBlocks columns abc95", block.id, "=>", columns, block);
2207
+ if (block.children && block.children.length > 0) {
2208
+ const width = block?.children[0]?.size?.width ?? 0;
2209
+ const widthOfChildren = block.children.length * width + (block.children.length - 1) * padding;
2210
+ log.debug("widthOfChildren 88", widthOfChildren, "posX");
2211
+ const rowHeights = /* @__PURE__ */ new Map();
2212
+ {
2213
+ let colPos = 0;
2214
+ for (const child of block.children) {
2215
+ if (!child.size) continue;
2216
+ const { py } = calculateBlockPosition(columns, colPos);
2217
+ const currentMax = rowHeights.get(py) ?? 0;
2218
+ if (child.size.height > currentMax) rowHeights.set(py, child.size.height);
2219
+ let filled = child?.widthInColumns ?? 1;
2220
+ if (columns > 0) filled = Math.min(filled, columns - colPos % columns);
2221
+ colPos += filled;
2222
+ }
2223
+ }
2224
+ const rowYOffsets = /* @__PURE__ */ new Map();
2225
+ {
2226
+ let offset = 0;
2227
+ const rows = [...rowHeights.keys()].sort((a, b) => a - b);
2228
+ for (const row of rows) {
2229
+ rowYOffsets.set(row, offset);
2230
+ offset += (rowHeights.get(row) ?? 0) + padding;
2231
+ }
2232
+ }
2233
+ let columnPos = 0;
2234
+ log.debug("abc91 block?.size?.x", block.id, block?.size?.x);
2235
+ let startingPosX = block?.size?.x ? block?.size?.x + (-block?.size?.width / 2 || 0) : -padding;
2236
+ let rowPos = 0;
2237
+ for (const child of block.children) {
2238
+ const parent = block;
2239
+ if (!child.size) continue;
2240
+ const { width: width2, height } = child.size;
2241
+ const { px, py } = calculateBlockPosition(columns, columnPos);
2242
+ if (py != rowPos) {
2243
+ rowPos = py;
2244
+ startingPosX = block?.size?.x ? block?.size?.x + (-block?.size?.width / 2 || 0) : -padding;
2245
+ log.debug("New row in layout for block", block.id, " and child ", child.id, rowPos);
2246
+ }
2247
+ log.debug(`abc89 layout blocks (child) id: ${child.id} Pos: ${columnPos} (px, py) ${px},${py} (${parent?.size?.x},${parent?.size?.y}) parent: ${parent.id} width: ${width2}${padding}`);
2248
+ if (parent.size) {
2249
+ const halfWidth = width2 / 2;
2250
+ child.size.x = startingPosX + padding + halfWidth;
2251
+ log.debug(`abc91 layout blocks (calc) px, pyid:${child.id} startingPos=X${startingPosX} new startingPosX${child.size.x} ${halfWidth} padding=${padding} width=${width2} halfWidth=${halfWidth} => x:${child.size.x} y:${child.size.y} ${child.widthInColumns} (width * (child?.w || 1)) / 2 ${width2 * (child?.widthInColumns ?? 1) / 2}`);
2252
+ startingPosX = child.size.x + halfWidth;
2253
+ const rowYOffset = rowYOffsets.get(py) ?? 0;
2254
+ const rowHeight = rowHeights.get(py) ?? height;
2255
+ child.size.y = parent.size.y - parent.size.height / 2 + rowYOffset + rowHeight / 2 + padding;
2256
+ log.debug(`abc88 layout blocks (calc) px, pyid:${child.id}startingPosX${startingPosX}${padding}${halfWidth}=>x:${child.size.x}y:${child.size.y}${child.widthInColumns}(width * (child?.w || 1)) / 2${width2 * (child?.widthInColumns ?? 1) / 2}`);
2257
+ }
2258
+ if (child.children) layoutBlocks(child, db2, padding);
2259
+ let columnsFilled = child?.widthInColumns ?? 1;
2260
+ if (columns > 0) columnsFilled = Math.min(columnsFilled, columns - columnPos % columns);
2261
+ columnPos += columnsFilled;
2262
+ log.debug("abc88 columnsPos", child, columnPos);
2263
+ }
2264
+ }
2265
+ log.debug(`layout blocks (<==layoutBlocks) ${block.id} x: ${block?.size?.x} y: ${block?.size?.y} width: ${block?.size?.width}`);
2266
+ }
2267
+ __name(layoutBlocks, "layoutBlocks");
2268
+ function findBounds(block, { minX, minY, maxX, maxY } = {
2269
+ minX: 0,
2270
+ minY: 0,
2271
+ maxX: 0,
2272
+ maxY: 0
2273
+ }) {
2274
+ if (block.size && block.id !== "root") {
2275
+ const { x, y, width, height } = block.size;
2276
+ if (x - width / 2 < minX) minX = x - width / 2;
2277
+ if (y - height / 2 < minY) minY = y - height / 2;
2278
+ if (x + width / 2 > maxX) maxX = x + width / 2;
2279
+ if (y + height / 2 > maxY) maxY = y + height / 2;
2280
+ }
2281
+ if (block.children) for (const child of block.children) ({minX, minY, maxX, maxY} = findBounds(child, {
2282
+ minX,
2283
+ minY,
2284
+ maxX,
2285
+ maxY
2286
+ }));
2287
+ return {
2288
+ minX,
2289
+ minY,
2290
+ maxX,
2291
+ maxY
2292
+ };
2293
+ }
2294
+ __name(findBounds, "findBounds");
2295
+ function layout(db2) {
2296
+ const root = db2.getBlock("root");
2297
+ if (!root) return;
2298
+ const padding = getConfig2()?.block?.padding ?? 8;
2299
+ setBlockSizes(root, db2, 0, 0, padding);
2300
+ layoutBlocks(root, db2, padding);
2301
+ log.debug("getBlocks", JSON.stringify(root, null, 2));
2302
+ const { minX, minY, maxX, maxY } = findBounds(root);
2303
+ const height = maxY - minY;
2304
+ return {
2305
+ x: minX,
2306
+ y: minY,
2307
+ width: maxX - minX,
2308
+ height
2309
+ };
2310
+ }
2311
+ __name(layout, "layout");
2312
+ function getNodeFromBlock(block, db2, positioned = false) {
2313
+ const vertex = block;
2314
+ let classStr = "default";
2315
+ if ((vertex?.classes?.length || 0) > 0) classStr = (vertex?.classes ?? []).join(" ");
2316
+ classStr = classStr + " flowchart-label";
2317
+ const cssCompiledStyles = (vertex?.classes ?? []).flatMap((className) => db2.getClasses().get(className)?.styles ?? []);
2318
+ let radius = 0;
2319
+ let shape = "rect";
2320
+ let padding;
2321
+ switch (vertex.type) {
2322
+ case "round":
2323
+ radius = 5;
2324
+ shape = "rect";
2325
+ break;
2326
+ case "composite":
2327
+ radius = 0;
2328
+ shape = "composite";
2329
+ padding = 0;
2330
+ break;
2331
+ case "square":
2332
+ shape = "rect";
2333
+ break;
2334
+ case "diamond":
2335
+ shape = "question";
2336
+ break;
2337
+ case "hexagon":
2338
+ shape = "hexagon";
2339
+ break;
2340
+ case "block_arrow":
2341
+ shape = "block_arrow";
2342
+ break;
2343
+ case "odd":
2344
+ shape = "rect_left_inv_arrow";
2345
+ break;
2346
+ case "lean_right":
2347
+ shape = "lean_right";
2348
+ break;
2349
+ case "lean_left":
2350
+ shape = "lean_left";
2351
+ break;
2352
+ case "trapezoid":
2353
+ shape = "trapezoid";
2354
+ break;
2355
+ case "inv_trapezoid":
2356
+ shape = "inv_trapezoid";
2357
+ break;
2358
+ case "rect_left_inv_arrow":
2359
+ shape = "rect_left_inv_arrow";
2360
+ break;
2361
+ case "circle":
2362
+ shape = "circle";
2363
+ break;
2364
+ case "ellipse":
2365
+ shape = "ellipse";
2366
+ break;
2367
+ case "stadium":
2368
+ shape = "stadium";
2369
+ break;
2370
+ case "subroutine":
2371
+ shape = "subroutine";
2372
+ break;
2373
+ case "cylinder":
2374
+ shape = "cylinder";
2375
+ break;
2376
+ case "group":
2377
+ shape = "rect";
2378
+ break;
2379
+ case "doublecircle":
2380
+ shape = "doublecircle";
2381
+ break;
2382
+ default: shape = "rect";
2383
+ }
2384
+ const styles = getStylesFromArray(vertex?.styles ?? []);
2385
+ const vertexText = vertex.label;
2386
+ const bounds = vertex.size ?? {
2387
+ width: 0,
2388
+ height: 0,
2389
+ x: 0,
2390
+ y: 0
2391
+ };
2392
+ const dbDiagramId = db2.getDiagramId();
2393
+ return {
2394
+ labelStyle: styles.labelStyle,
2395
+ shape,
2396
+ label: vertexText,
2397
+ labelText: vertexText,
2398
+ rx: radius,
2399
+ ry: radius,
2400
+ class: classStr,
2401
+ cssClasses: classStr,
2402
+ cssStyles: vertex?.styles ?? [],
2403
+ cssCompiledStyles,
2404
+ style: styles.style,
2405
+ id: vertex.id,
2406
+ domId: dbDiagramId ? `${dbDiagramId}-${vertex.id}` : vertex.id,
2407
+ isGroup: false,
2408
+ directions: vertex.directions,
2409
+ width: bounds.width || void 0,
2410
+ height: bounds.height || void 0,
2411
+ wrappingWidth: bounds.width || Number.POSITIVE_INFINITY,
2412
+ x: bounds.x,
2413
+ y: bounds.y,
2414
+ positioned,
2415
+ intersect: void 0,
2416
+ padding: padding ?? getConfig()?.block?.padding ?? 0,
2417
+ widthInColumns: vertex.widthInColumns ?? 1,
2418
+ colorIndex: vertex.colorIndex,
2419
+ look: getConfig().look
2420
+ };
2421
+ }
2422
+ __name(getNodeFromBlock, "getNodeFromBlock");
2423
+ async function calculateBlockSize(elem, block, db2) {
2424
+ const node = getNodeFromBlock(block, db2, false);
2425
+ if (block.type === "group") return;
2426
+ const nodeEl = await insertNode(elem, node, { config: getConfig() });
2427
+ const boundingBox = nodeEl.node()?.getBBox() ?? {
2428
+ width: 0,
2429
+ height: 0
2430
+ };
2431
+ const obj = db2.getBlock(node.id);
2432
+ obj.size = {
2433
+ width: boundingBox.width,
2434
+ height: boundingBox.height,
2435
+ x: 0,
2436
+ y: 0,
2437
+ node: nodeEl
2438
+ };
2439
+ db2.setBlock(obj);
2440
+ nodeEl.remove();
2441
+ }
2442
+ __name(calculateBlockSize, "calculateBlockSize");
2443
+ async function insertBlockPositioned(elem, block, db2) {
2444
+ const node = getNodeFromBlock(block, db2, true);
2445
+ if (db2.getBlock(node.id).type !== "space") {
2446
+ const config = getConfig();
2447
+ const el = await insertNode(elem, node, { config });
2448
+ if (node.colorIndex !== void 0) stampColorSlot(el, node.colorIndex, config.theme, config.themeVariables?.borderColorArray);
2449
+ block.intersect = node?.intersect;
2450
+ positionNode(node);
2451
+ }
2452
+ }
2453
+ __name(insertBlockPositioned, "insertBlockPositioned");
2454
+ async function performOperations(elem, blocks2, db2, operation) {
2455
+ for (const block of blocks2) {
2456
+ await operation(elem, block, db2);
2457
+ if (block.children) await performOperations(elem, block.children, db2, operation);
2458
+ }
2459
+ }
2460
+ __name(performOperations, "performOperations");
2461
+ async function calculateBlockSizes(elem, blocks2, db2) {
2462
+ await performOperations(elem, blocks2, db2, calculateBlockSize);
2463
+ }
2464
+ __name(calculateBlockSizes, "calculateBlockSizes");
2465
+ async function insertBlocks(elem, blocks2, db2) {
2466
+ await performOperations(elem, blocks2, db2, insertBlockPositioned);
2467
+ }
2468
+ __name(insertBlocks, "insertBlocks");
2469
+ async function insertEdges(elem, edges, blocks2, db2, id) {
2470
+ const g = new Graph({
2471
+ multigraph: true,
2472
+ compound: true
2473
+ });
2474
+ g.setGraph({
2475
+ rankdir: "TB",
2476
+ nodesep: 10,
2477
+ ranksep: 10,
2478
+ marginx: 8,
2479
+ marginy: 8
2480
+ });
2481
+ for (const block of blocks2) if (block.size) g.setNode(block.id, {
2482
+ width: block.size.width,
2483
+ height: block.size.height,
2484
+ intersect: block.intersect
2485
+ });
2486
+ for (const edge of edges) if (edge.start && edge.end) {
2487
+ const startBlock = db2.getBlock(edge.start);
2488
+ const endBlock = db2.getBlock(edge.end);
2489
+ if (startBlock?.size && endBlock?.size) {
2490
+ const start = startBlock.size;
2491
+ const end = endBlock.size;
2492
+ const points = [
2493
+ {
2494
+ x: start.x,
2495
+ y: start.y
2496
+ },
2497
+ {
2498
+ x: start.x + (end.x - start.x) / 2,
2499
+ y: start.y + (end.y - start.y) / 2
2500
+ },
2501
+ {
2502
+ x: end.x,
2503
+ y: end.y
2504
+ }
2505
+ ];
2506
+ const prefixedEdgeId = id ? `${id}-${edge.id}` : edge.id;
2507
+ const dynamicClasses = `${edge.thickness === "thick" ? "edge-thickness-thick" : "edge-thickness-normal"} ${edge.pattern === "dotted" ? "edge-pattern-dotted" : "edge-pattern-solid"} flowchart-link LS-a1 LE-b1`;
2508
+ insertEdge(elem, {
2509
+ ...edge,
2510
+ id: prefixedEdgeId,
2511
+ arrowTypeEnd: edge.arrowTypeEnd,
2512
+ arrowTypeStart: edge.arrowTypeStart,
2513
+ points,
2514
+ classes: dynamicClasses
2515
+ }, {}, "block", g.node(edge.start), g.node(edge.end), id);
2516
+ if (edge.label) {
2517
+ await insertEdgeLabel(elem, {
2518
+ ...edge,
2519
+ label: edge.label,
2520
+ labelStyle: "stroke: #333; stroke-width: 1.5px;fill:none;",
2521
+ arrowTypeEnd: edge.arrowTypeEnd,
2522
+ arrowTypeStart: edge.arrowTypeStart,
2523
+ points,
2524
+ classes: dynamicClasses
2525
+ });
2526
+ positionEdgeLabel({
2527
+ ...edge,
2528
+ x: points[1].x,
2529
+ y: points[1].y
2530
+ }, { originalPath: points });
2531
+ }
2532
+ }
2533
+ }
2534
+ }
2535
+ __name(insertEdges, "insertEdges");
2536
+ var diagram = {
2537
+ parser: block_default,
2538
+ db: blockDB_default,
2539
+ renderer: {
2540
+ draw: /* @__PURE__ */ __name(async function(text, id, _version, diagObj) {
2541
+ const { securityLevel, block: conf } = getConfig();
2542
+ const db2 = diagObj.db;
2543
+ db2.setDiagramId(id);
2544
+ let sandboxElement;
2545
+ if (securityLevel === "sandbox") sandboxElement = select_default("#i" + id);
2546
+ const root = securityLevel === "sandbox" ? select_default(sandboxElement.nodes()[0].contentDocument.body) : select_default("body");
2547
+ const svg = securityLevel === "sandbox" ? root.select(`[id="${id}"]`) : select_default(`[id="${id}"]`);
2548
+ insertLookDefs(svg, getConfig());
2549
+ markers_default(svg, [
2550
+ "point",
2551
+ "circle",
2552
+ "cross"
2553
+ ], diagObj.type, id);
2554
+ const bl = db2.getBlocks();
2555
+ const blArr = db2.getBlocksFlat();
2556
+ const edges = db2.getEdges();
2557
+ const nodes = svg.insert("g").attr("class", "block");
2558
+ await calculateBlockSizes(nodes, bl, db2);
2559
+ const bounds = layout(db2);
2560
+ await insertBlocks(nodes, bl, db2);
2561
+ await insertEdges(nodes, edges, blArr, db2, id);
2562
+ const renderedBounds = nodes.node()?.getBBox();
2563
+ const bounds2 = renderedBounds && Number.isFinite(renderedBounds.width) && Number.isFinite(renderedBounds.height) ? renderedBounds : bounds;
2564
+ if (bounds2) {
2565
+ const magicFactor = Math.max(1, Math.round(.125 * (bounds2.width / bounds2.height)));
2566
+ const height = bounds2.height + magicFactor + 10;
2567
+ const width = bounds2.width + 10;
2568
+ const { useMaxWidth } = conf;
2569
+ configureSvgSize(svg, height, width, !!useMaxWidth);
2570
+ log.debug("Here Bounds", bounds, bounds2);
2571
+ svg.attr("viewBox", `${bounds2.x - 5} ${bounds2.y - 5} ${bounds2.width + 10} ${bounds2.height + 10}`);
2572
+ }
2573
+ }, "draw"),
2574
+ getClasses: /* @__PURE__ */ __name(function(text, diagObj) {
2575
+ return diagObj.db.getClasses();
2576
+ }, "getClasses")
2577
+ },
2578
+ styles: styles_default
2579
+ };
2580
+
2581
+ //#endregion
2582
+ export { diagram };