@likec4/core 1.47.0 → 1.48.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 (181) hide show
  1. package/LICENSE +1 -1
  2. package/dist/_chunks/Builder.view-element.mjs +3284 -0
  3. package/dist/_chunks/LikeC4Model.d.mts +1287 -0
  4. package/dist/_chunks/LikeC4Styles.mjs +691 -0
  5. package/dist/_chunks/RichText.d.mts +84 -0
  6. package/dist/_chunks/RichText.mjs +148 -0
  7. package/dist/_chunks/_aux.d.mts +289 -0
  8. package/dist/_chunks/_aux.mjs +18 -0
  9. package/dist/_chunks/_types.d.mts +781 -0
  10. package/dist/_chunks/_types2.d.mts +38 -0
  11. package/dist/_chunks/assignTagColors.mjs +24 -0
  12. package/dist/_chunks/calcDriftsFromSnapshot.mjs +379 -0
  13. package/dist/_chunks/connection.mjs +0 -0
  14. package/dist/_chunks/const.d.mts +43 -0
  15. package/dist/_chunks/const.mjs +33 -0
  16. package/dist/_chunks/expression-model.d.mts +192 -0
  17. package/dist/_chunks/expression-model.mjs +103 -0
  18. package/dist/_chunks/expression.d.mts +347 -0
  19. package/dist/_chunks/expression.mjs +107 -0
  20. package/dist/_chunks/find.d.mts +82 -0
  21. package/dist/_chunks/find.mjs +646 -0
  22. package/dist/_chunks/find2.d.mts +78 -0
  23. package/dist/_chunks/find2.mjs +287 -0
  24. package/dist/_chunks/fqnRef.d.mts +58 -0
  25. package/dist/_chunks/fqnRef.mjs +41 -0
  26. package/dist/_chunks/geometry.mjs +335 -0
  27. package/dist/_chunks/index.d.mts +169 -0
  28. package/dist/_chunks/index2.d.mts +937 -0
  29. package/dist/_chunks/index3.d.mts +146 -0
  30. package/dist/_chunks/index4.d.mts +62 -0
  31. package/dist/_chunks/index5.d.mts +42 -0
  32. package/dist/_chunks/index6.d.mts +43 -0
  33. package/dist/{shared/core.OtRNdMxy.d.mts → _chunks/index7.d.mts} +113 -197
  34. package/dist/_chunks/index8.d.mts +144 -0
  35. package/dist/_chunks/invariant.mjs +18 -0
  36. package/dist/_chunks/iterable.mjs +146 -0
  37. package/dist/_chunks/libs/@mantine/colors-generator.mjs +3416 -0
  38. package/dist/_chunks/libs/@ungap/structured-clone.mjs +213 -0
  39. package/dist/_chunks/libs/bail.mjs +14 -0
  40. package/dist/_chunks/libs/ccount.mjs +25 -0
  41. package/dist/_chunks/libs/character-entities-html4.mjs +263 -0
  42. package/dist/_chunks/libs/character-entities-legacy.mjs +117 -0
  43. package/dist/_chunks/libs/character-entities.mjs +2136 -0
  44. package/dist/_chunks/libs/comma-separated-tokens.mjs +18 -0
  45. package/dist/_chunks/libs/decode-named-character-reference.mjs +21 -0
  46. package/dist/_chunks/libs/defu.mjs +42 -0
  47. package/dist/_chunks/libs/devlop.mjs +5 -0
  48. package/dist/_chunks/libs/escape-string-regexp.mjs +8 -0
  49. package/dist/_chunks/libs/extend.mjs +77 -0
  50. package/dist/_chunks/libs/graphology-dag.mjs +703 -0
  51. package/dist/_chunks/libs/graphology-types.d.mts +601 -0
  52. package/dist/_chunks/libs/graphology.d.mts +6 -0
  53. package/dist/_chunks/libs/graphology.mjs +4565 -0
  54. package/dist/_chunks/libs/hast-util-sanitize.mjs +863 -0
  55. package/dist/_chunks/libs/hast-util-to-html.mjs +2696 -0
  56. package/dist/_chunks/libs/is-plain-obj.mjs +9 -0
  57. package/dist/_chunks/libs/longest-streak.mjs +30 -0
  58. package/dist/_chunks/libs/markdown-table.mjs +290 -0
  59. package/dist/_chunks/libs/mdast-util-find-and-replace.mjs +653 -0
  60. package/dist/_chunks/libs/mdast-util-from-markdown.mjs +8522 -0
  61. package/dist/_chunks/libs/mdast-util-gfm.mjs +2393 -0
  62. package/dist/_chunks/libs/mdast-util-to-hast.mjs +1803 -0
  63. package/dist/_chunks/libs/micromark-extension-gfm.mjs +2243 -0
  64. package/dist/_chunks/libs/mnemonist.d.mts +254 -0
  65. package/dist/_chunks/libs/mnemonist.mjs +1978 -0
  66. package/dist/_chunks/libs/natural-compare-lite.mjs +42 -0
  67. package/dist/_chunks/libs/rehype-sanitize.mjs +29 -0
  68. package/dist/_chunks/libs/rehype-stringify.mjs +34 -0
  69. package/dist/_chunks/libs/remark-gfm.mjs +36 -0
  70. package/dist/_chunks/libs/remark-github-blockquote-alert.mjs +100 -0
  71. package/dist/_chunks/libs/remark-parse.mjs +39 -0
  72. package/dist/_chunks/libs/remark-rehype.mjs +171 -0
  73. package/dist/_chunks/libs/remeda.mjs +702 -0
  74. package/dist/_chunks/libs/trough.mjs +158 -0
  75. package/dist/_chunks/libs/unified.mjs +2212 -0
  76. package/dist/_chunks/mnemonist.d.mts +1 -0
  77. package/dist/_chunks/mnemonist.mjs +0 -0
  78. package/dist/_chunks/model.mjs +1898 -0
  79. package/dist/_chunks/model2.mjs +0 -0
  80. package/dist/_chunks/relationships-view.mjs +132 -0
  81. package/dist/_chunks/rolldown-runtime.mjs +42 -0
  82. package/dist/{shared/core.C_3y3eqV.d.mts → _chunks/scalar.d.mts} +13 -43
  83. package/dist/_chunks/scalar.mjs +84 -0
  84. package/dist/_chunks/utils.mjs +483 -0
  85. package/dist/builder/index.d.mts +11 -775
  86. package/dist/builder/index.mjs +631 -1022
  87. package/dist/compute-view/index.d.mts +85 -56
  88. package/dist/compute-view/index.mjs +247 -214
  89. package/dist/compute-view/relationships-view/index.d.mts +16 -51
  90. package/dist/compute-view/relationships-view/index.mjs +6 -184
  91. package/dist/geometry/index.d.mts +2 -109
  92. package/dist/geometry/index.mjs +2 -327
  93. package/dist/index.d.mts +18 -20
  94. package/dist/index.mjs +27 -18
  95. package/dist/model/connection/deployment/index.d.mts +12 -15
  96. package/dist/model/connection/deployment/index.mjs +9 -2
  97. package/dist/model/connection/index.d.mts +14 -75
  98. package/dist/model/connection/index.mjs +10 -3
  99. package/dist/model/connection/model/index.d.mts +12 -15
  100. package/dist/model/connection/model/index.mjs +8 -2
  101. package/dist/model/index.d.mts +15 -57
  102. package/dist/model/index.mjs +11 -4
  103. package/dist/styles/index.d.mts +9 -117
  104. package/dist/styles/index.mjs +26 -59
  105. package/dist/types/RichText.d.mts +3 -0
  106. package/dist/types/RichText.mjs +7 -0
  107. package/dist/types/_aux.d.mts +3 -4
  108. package/dist/types/_aux.mjs +2 -7
  109. package/dist/types/expression-model.d.mts +6 -190
  110. package/dist/types/expression-model.mjs +6 -108
  111. package/dist/types/expression.d.mts +5 -6
  112. package/dist/types/expression.mjs +6 -112
  113. package/dist/types/fqnRef.d.mts +4 -60
  114. package/dist/types/fqnRef.mjs +6 -44
  115. package/dist/types/index.d.mts +9 -47
  116. package/dist/types/index.mjs +14 -16
  117. package/dist/types/scalar.d.mts +2 -2
  118. package/dist/types/scalar.mjs +7 -4
  119. package/dist/utils/graphology/index.d.mts +2 -1864
  120. package/dist/utils/graphology/index.mjs +3 -1
  121. package/dist/utils/index.d.mts +11 -124
  122. package/dist/utils/index.mjs +16 -43
  123. package/dist/utils/iterable/index.d.mts +9 -132
  124. package/dist/utils/iterable/index.mjs +2 -61
  125. package/dist/utils/mnemonist.d.mts +2 -0
  126. package/dist/utils/mnemonist.mjs +12 -0
  127. package/package.json +17 -22
  128. package/compute-view/relationships/package.json +0 -4
  129. package/dist/shared/core.3ZhnKAlZ.mjs +0 -106
  130. package/dist/shared/core.78IWAHAE.mjs +0 -332
  131. package/dist/shared/core.B85MJLTf.mjs +0 -5
  132. package/dist/shared/core.BFd1lU9R.mjs +0 -29
  133. package/dist/shared/core.BKlholso.mjs +0 -3
  134. package/dist/shared/core.BNN-3vPH.mjs +0 -1255
  135. package/dist/shared/core.BPGOjone.d.mts +0 -46
  136. package/dist/shared/core.BP_QHEXs.mjs +0 -785
  137. package/dist/shared/core.BbE4y-yl.mjs +0 -177
  138. package/dist/shared/core.Bdy3hhTc.mjs +0 -28382
  139. package/dist/shared/core.BfCKSW-g.d.mts +0 -1266
  140. package/dist/shared/core.BhNcrwzK.mjs +0 -7
  141. package/dist/shared/core.BkVA6gjl.mjs +0 -5
  142. package/dist/shared/core.BoYfZOBm.mjs +0 -3
  143. package/dist/shared/core.BsSXS-_R.mjs +0 -7
  144. package/dist/shared/core.C3JowhaZ.mjs +0 -32
  145. package/dist/shared/core.C4x8aaWa.mjs +0 -27
  146. package/dist/shared/core.CAgYpDtM.d.mts +0 -98
  147. package/dist/shared/core.CHf8VEa3.mjs +0 -1206
  148. package/dist/shared/core.CLSZtnFh.mjs +0 -69
  149. package/dist/shared/core.CbT8JVYL.mjs +0 -5
  150. package/dist/shared/core.CdNCAwq7.mjs +0 -176
  151. package/dist/shared/core.CmGY9blO.mjs +0 -6717
  152. package/dist/shared/core.CmPXpJ8l.mjs +0 -21
  153. package/dist/shared/core.Coi_LOUZ.mjs +0 -7
  154. package/dist/shared/core.CqAJJpK_.mjs +0 -3
  155. package/dist/shared/core.CywrQs86.d.mts +0 -31
  156. package/dist/shared/core.D00YbOhQ.d.mts +0 -300
  157. package/dist/shared/core.D0WZutNd.mjs +0 -94
  158. package/dist/shared/core.D4npX2q8.mjs +0 -18
  159. package/dist/shared/core.DB0Ue5Wx.d.mts +0 -70
  160. package/dist/shared/core.DC5IAaDT.d.mts +0 -334
  161. package/dist/shared/core.DE9qzhn8.d.mts +0 -83
  162. package/dist/shared/core.DGcIbsj4.mjs +0 -3946
  163. package/dist/shared/core.DH7TXqXf.mjs +0 -136
  164. package/dist/shared/core.DKhRkHRN.d.mts +0 -41
  165. package/dist/shared/core.DRJma0Ol.mjs +0 -22
  166. package/dist/shared/core.DU5SRqNF.mjs +0 -2209
  167. package/dist/shared/core.DXhDWKFZ.d.mts +0 -3
  168. package/dist/shared/core.DbfO90vF.mjs +0 -434
  169. package/dist/shared/core.DcS-0zys.mjs +0 -10
  170. package/dist/shared/core.Dh119QSP.mjs +0 -4995
  171. package/dist/shared/core.DjcWextK.mjs +0 -1371
  172. package/dist/shared/core.Dojz4bvg.d.mts +0 -504
  173. package/dist/shared/core.FZ305VYd.mjs +0 -21
  174. package/dist/shared/core.RfnaEmgA.mjs +0 -7
  175. package/dist/shared/core.btEq3i3f.mjs +0 -300
  176. package/dist/shared/core.oSV6SRfk.mjs +0 -13
  177. package/dist/shared/core.om36dXXW.mjs +0 -41
  178. package/dist/shared/core.osFs8tU7.d.mts +0 -466
  179. package/dist/shared/core.q10OP9oJ.mjs +0 -5
  180. package/dist/shared/core.tpvDGvdC.d.mts +0 -87
  181. package/dist/shared/core.uFk_o9X6.mjs +0 -13
@@ -0,0 +1,703 @@
1
+ import { t as __commonJSMin } from "../rolldown-runtime.mjs";
2
+
3
+ //#region ../../node_modules/.pnpm/obliterator@2.0.5/node_modules/obliterator/support.js
4
+ var require_support = /* @__PURE__ */ __commonJSMin(((exports) => {
5
+ exports.ARRAY_BUFFER_SUPPORT = typeof ArrayBuffer !== "undefined";
6
+ exports.SYMBOL_SUPPORT = typeof Symbol !== "undefined";
7
+ }));
8
+
9
+ //#endregion
10
+ //#region ../../node_modules/.pnpm/obliterator@2.0.5/node_modules/obliterator/foreach.js
11
+ var require_foreach = /* @__PURE__ */ __commonJSMin(((exports, module) => {
12
+ /**
13
+ * Obliterator ForEach Function
14
+ * =============================
15
+ *
16
+ * Helper function used to easily iterate over mixed values.
17
+ */
18
+ var support = require_support();
19
+ var ARRAY_BUFFER_SUPPORT = support.ARRAY_BUFFER_SUPPORT;
20
+ var SYMBOL_SUPPORT = support.SYMBOL_SUPPORT;
21
+ /**
22
+ * Function able to iterate over almost any iterable JS value.
23
+ *
24
+ * @param {any} iterable - Iterable value.
25
+ * @param {function} callback - Callback function.
26
+ */
27
+ module.exports = function forEach(iterable, callback) {
28
+ var iterator, k, i, l, s;
29
+ if (!iterable) throw new Error("obliterator/forEach: invalid iterable.");
30
+ if (typeof callback !== "function") throw new Error("obliterator/forEach: expecting a callback.");
31
+ if (Array.isArray(iterable) || ARRAY_BUFFER_SUPPORT && ArrayBuffer.isView(iterable) || typeof iterable === "string" || iterable.toString() === "[object Arguments]") {
32
+ for (i = 0, l = iterable.length; i < l; i++) callback(iterable[i], i);
33
+ return;
34
+ }
35
+ if (typeof iterable.forEach === "function") {
36
+ iterable.forEach(callback);
37
+ return;
38
+ }
39
+ if (SYMBOL_SUPPORT && Symbol.iterator in iterable && typeof iterable.next !== "function") iterable = iterable[Symbol.iterator]();
40
+ if (typeof iterable.next === "function") {
41
+ iterator = iterable;
42
+ i = 0;
43
+ while (s = iterator.next(), s.done !== true) {
44
+ callback(s.value, i);
45
+ i++;
46
+ }
47
+ return;
48
+ }
49
+ for (k in iterable) if (iterable.hasOwnProperty(k)) callback(iterable[k], k);
50
+ };
51
+ }));
52
+
53
+ //#endregion
54
+ //#region ../../node_modules/.pnpm/obliterator@2.0.5/node_modules/obliterator/iterator.js
55
+ var require_iterator = /* @__PURE__ */ __commonJSMin(((exports, module) => {
56
+ /**
57
+ * Obliterator Iterator Class
58
+ * ===========================
59
+ *
60
+ * Simple class representing the library's iterators.
61
+ */
62
+ /**
63
+ * Iterator class.
64
+ *
65
+ * @constructor
66
+ * @param {function} next - Next function.
67
+ */
68
+ function Iterator(next) {
69
+ if (typeof next !== "function") throw new Error("obliterator/iterator: expecting a function!");
70
+ this.next = next;
71
+ }
72
+ /**
73
+ * If symbols are supported, we add `next` to `Symbol.iterator`.
74
+ */
75
+ if (typeof Symbol !== "undefined") Iterator.prototype[Symbol.iterator] = function() {
76
+ return this;
77
+ };
78
+ /**
79
+ * Returning an iterator of the given values.
80
+ *
81
+ * @param {any...} values - Values.
82
+ * @return {Iterator}
83
+ */
84
+ Iterator.of = function() {
85
+ var args = arguments, l = args.length, i = 0;
86
+ return new Iterator(function() {
87
+ if (i >= l) return { done: true };
88
+ return {
89
+ done: false,
90
+ value: args[i++]
91
+ };
92
+ });
93
+ };
94
+ /**
95
+ * Returning an empty iterator.
96
+ *
97
+ * @return {Iterator}
98
+ */
99
+ Iterator.empty = function() {
100
+ return new Iterator(function() {
101
+ return { done: true };
102
+ });
103
+ };
104
+ /**
105
+ * Returning an iterator over the given indexed sequence.
106
+ *
107
+ * @param {string|Array} sequence - Target sequence.
108
+ * @return {Iterator}
109
+ */
110
+ Iterator.fromSequence = function(sequence) {
111
+ var i = 0, l = sequence.length;
112
+ return new Iterator(function() {
113
+ if (i >= l) return { done: true };
114
+ return {
115
+ done: false,
116
+ value: sequence[i++]
117
+ };
118
+ });
119
+ };
120
+ /**
121
+ * Returning whether the given value is an iterator.
122
+ *
123
+ * @param {any} value - Value.
124
+ * @return {boolean}
125
+ */
126
+ Iterator.is = function(value) {
127
+ if (value instanceof Iterator) return true;
128
+ return typeof value === "object" && value !== null && typeof value.next === "function";
129
+ };
130
+ /**
131
+ * Exporting.
132
+ */
133
+ module.exports = Iterator;
134
+ }));
135
+
136
+ //#endregion
137
+ //#region ../../node_modules/.pnpm/mnemonist@0.40.3_patch_hash=70301b9c235e13bc146bb9528b7979c278952196d5dac8048ab3850adac8f4cf/node_modules/mnemonist/utils/typed-arrays.js
138
+ var require_typed_arrays = /* @__PURE__ */ __commonJSMin(((exports) => {
139
+ /**
140
+ * Mnemonist Typed Array Helpers
141
+ * ==============================
142
+ *
143
+ * Miscellaneous helpers related to typed arrays.
144
+ */
145
+ /**
146
+ * When using an unsigned integer array to store pointers, one might want to
147
+ * choose the optimal word size in regards to the actual numbers of pointers
148
+ * to store.
149
+ *
150
+ * This helpers does just that.
151
+ *
152
+ * @param {number} size - Expected size of the array to map.
153
+ * @return {TypedArray}
154
+ */
155
+ var MAX_8BIT_INTEGER = Math.pow(2, 8) - 1, MAX_16BIT_INTEGER = Math.pow(2, 16) - 1, MAX_32BIT_INTEGER = Math.pow(2, 32) - 1;
156
+ var MAX_SIGNED_8BIT_INTEGER = Math.pow(2, 7) - 1, MAX_SIGNED_16BIT_INTEGER = Math.pow(2, 15) - 1, MAX_SIGNED_32BIT_INTEGER = Math.pow(2, 31) - 1;
157
+ exports.getPointerArray = function(size) {
158
+ var maxIndex = size - 1;
159
+ if (maxIndex <= MAX_8BIT_INTEGER) return Uint8Array;
160
+ if (maxIndex <= MAX_16BIT_INTEGER) return Uint16Array;
161
+ if (maxIndex <= MAX_32BIT_INTEGER) return Uint32Array;
162
+ throw new Error("mnemonist: Pointer Array of size > 4294967295 is not supported.");
163
+ };
164
+ exports.getSignedPointerArray = function(size) {
165
+ var maxIndex = size - 1;
166
+ if (maxIndex <= MAX_SIGNED_8BIT_INTEGER) return Int8Array;
167
+ if (maxIndex <= MAX_SIGNED_16BIT_INTEGER) return Int16Array;
168
+ if (maxIndex <= MAX_SIGNED_32BIT_INTEGER) return Int32Array;
169
+ return Float64Array;
170
+ };
171
+ /**
172
+ * Function returning the minimal type able to represent the given number.
173
+ *
174
+ * @param {number} value - Value to test.
175
+ * @return {TypedArrayClass}
176
+ */
177
+ exports.getNumberType = function(value) {
178
+ if (value === (value | 0)) if (Math.sign(value) === -1) {
179
+ if (value <= 127 && value >= -128) return Int8Array;
180
+ if (value <= 32767 && value >= -32768) return Int16Array;
181
+ return Int32Array;
182
+ } else {
183
+ if (value <= 255) return Uint8Array;
184
+ if (value <= 65535) return Uint16Array;
185
+ return Uint32Array;
186
+ }
187
+ return Float64Array;
188
+ };
189
+ /**
190
+ * Function returning the minimal type able to represent the given array
191
+ * of JavaScript numbers.
192
+ *
193
+ * @param {array} array - Array to represent.
194
+ * @param {function} getter - Optional getter.
195
+ * @return {TypedArrayClass}
196
+ */
197
+ var TYPE_PRIORITY = {
198
+ Uint8Array: 1,
199
+ Int8Array: 2,
200
+ Uint16Array: 3,
201
+ Int16Array: 4,
202
+ Uint32Array: 5,
203
+ Int32Array: 6,
204
+ Float32Array: 7,
205
+ Float64Array: 8
206
+ };
207
+ exports.getMinimalRepresentation = function(array, getter) {
208
+ var maxType = null, maxPriority = 0, p, t, v, i, l;
209
+ for (i = 0, l = array.length; i < l; i++) {
210
+ v = getter ? getter(array[i]) : array[i];
211
+ t = exports.getNumberType(v);
212
+ p = TYPE_PRIORITY[t.name];
213
+ if (p > maxPriority) {
214
+ maxPriority = p;
215
+ maxType = t;
216
+ }
217
+ }
218
+ return maxType;
219
+ };
220
+ /**
221
+ * Function returning whether the given value is a typed array.
222
+ *
223
+ * @param {any} value - Value to test.
224
+ * @return {boolean}
225
+ */
226
+ exports.isTypedArray = function(value) {
227
+ return typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView(value);
228
+ };
229
+ /**
230
+ * Function used to concat byte arrays.
231
+ *
232
+ * @param {...ByteArray}
233
+ * @return {ByteArray}
234
+ */
235
+ exports.concat = function() {
236
+ var length = 0, i, o, l;
237
+ for (i = 0, l = arguments.length; i < l; i++) length += arguments[i].length;
238
+ var array = new arguments[0].constructor(length);
239
+ for (i = 0, o = 0; i < l; i++) {
240
+ array.set(arguments[i], o);
241
+ o += arguments[i].length;
242
+ }
243
+ return array;
244
+ };
245
+ /**
246
+ * Function used to initialize a byte array of indices.
247
+ *
248
+ * @param {number} length - Length of target.
249
+ * @return {ByteArray}
250
+ */
251
+ exports.indices = function(length) {
252
+ var array = new (exports.getPointerArray(length))(length);
253
+ for (var i = 0; i < length; i++) array[i] = i;
254
+ return array;
255
+ };
256
+ }));
257
+
258
+ //#endregion
259
+ //#region ../../node_modules/.pnpm/mnemonist@0.40.3_patch_hash=70301b9c235e13bc146bb9528b7979c278952196d5dac8048ab3850adac8f4cf/node_modules/mnemonist/utils/iterables.js
260
+ var require_iterables = /* @__PURE__ */ __commonJSMin(((exports) => {
261
+ /**
262
+ * Mnemonist Iterable Function
263
+ * ============================
264
+ *
265
+ * Harmonized iteration helpers over mixed iterable targets.
266
+ */
267
+ var forEach = require_foreach();
268
+ var typed = require_typed_arrays();
269
+ /**
270
+ * Function used to determine whether the given object supports array-like
271
+ * random access.
272
+ *
273
+ * @param {any} target - Target object.
274
+ * @return {boolean}
275
+ */
276
+ function isArrayLike(target) {
277
+ return Array.isArray(target) || typed.isTypedArray(target);
278
+ }
279
+ /**
280
+ * Function used to guess the length of the structure over which we are going
281
+ * to iterate.
282
+ *
283
+ * @param {any} target - Target object.
284
+ * @return {number|undefined}
285
+ */
286
+ function guessLength(target) {
287
+ if (typeof target.length === "number") return target.length;
288
+ if (typeof target.size === "number") return target.size;
289
+ }
290
+ /**
291
+ * Function used to convert an iterable to an array.
292
+ *
293
+ * @param {any} target - Iteration target.
294
+ * @return {array}
295
+ */
296
+ function toArray(target) {
297
+ var l = guessLength(target);
298
+ var array = typeof l === "number" ? new Array(l) : [];
299
+ var i = 0;
300
+ forEach(target, function(value) {
301
+ array[i++] = value;
302
+ });
303
+ return array;
304
+ }
305
+ /**
306
+ * Same as above but returns a supplementary indices array.
307
+ *
308
+ * @param {any} target - Iteration target.
309
+ * @return {array}
310
+ */
311
+ function toArrayWithIndices(target) {
312
+ var l = guessLength(target);
313
+ var IndexArray = typeof l === "number" ? typed.getPointerArray(l) : Array;
314
+ var array = typeof l === "number" ? new Array(l) : [];
315
+ var indices = typeof l === "number" ? new IndexArray(l) : [];
316
+ var i = 0;
317
+ forEach(target, function(value) {
318
+ array[i] = value;
319
+ indices[i] = i++;
320
+ });
321
+ return [array, indices];
322
+ }
323
+ /**
324
+ * Exporting.
325
+ */
326
+ exports.isArrayLike = isArrayLike;
327
+ exports.guessLength = guessLength;
328
+ exports.toArray = toArray;
329
+ exports.toArrayWithIndices = toArrayWithIndices;
330
+ }));
331
+
332
+ //#endregion
333
+ //#region ../../node_modules/.pnpm/graphology-utils@2.5.2_graphology-types@0.24.8/node_modules/graphology-utils/is-graph.js
334
+ var require_is_graph = /* @__PURE__ */ __commonJSMin(((exports, module) => {
335
+ /**
336
+ * Graphology isGraph
337
+ * ===================
338
+ *
339
+ * Very simple function aiming at ensuring the given variable is a
340
+ * graphology instance.
341
+ */
342
+ /**
343
+ * Checking the value is a graphology instance.
344
+ *
345
+ * @param {any} value - Target value.
346
+ * @return {boolean}
347
+ */
348
+ module.exports = function isGraph(value) {
349
+ return value !== null && typeof value === "object" && typeof value.addUndirectedEdgeWithKey === "function" && typeof value.dropNode === "function" && typeof value.multi === "boolean";
350
+ };
351
+ }));
352
+
353
+ //#endregion
354
+ //#region ../../node_modules/.pnpm/mnemonist@0.40.3_patch_hash=70301b9c235e13bc146bb9528b7979c278952196d5dac8048ab3850adac8f4cf/node_modules/mnemonist/fixed-deque.js
355
+ var require_fixed_deque = /* @__PURE__ */ __commonJSMin(((exports, module) => {
356
+ /**
357
+ * Mnemonist FixedDeque
358
+ * =====================
359
+ *
360
+ * Fixed capacity double-ended queue implemented as ring deque.
361
+ */
362
+ var iterables = require_iterables(), Iterator = require_iterator();
363
+ /**
364
+ * FixedDeque.
365
+ *
366
+ * @constructor
367
+ */
368
+ function FixedDeque(ArrayClass, capacity) {
369
+ if (arguments.length < 2) throw new Error("mnemonist/fixed-deque: expecting an Array class and a capacity.");
370
+ if (typeof capacity !== "number" || capacity <= 0) throw new Error("mnemonist/fixed-deque: `capacity` should be a positive number.");
371
+ this.ArrayClass = ArrayClass;
372
+ this.capacity = capacity;
373
+ this.items = new ArrayClass(this.capacity);
374
+ this.clear();
375
+ }
376
+ /**
377
+ * Method used to clear the structure.
378
+ *
379
+ * @return {undefined}
380
+ */
381
+ FixedDeque.prototype.clear = function() {
382
+ this.start = 0;
383
+ this.size = 0;
384
+ };
385
+ /**
386
+ * Method used to append a value to the deque.
387
+ *
388
+ * @param {any} item - Item to append.
389
+ * @return {number} - Returns the new size of the deque.
390
+ */
391
+ FixedDeque.prototype.push = function(item) {
392
+ if (this.size === this.capacity) throw new Error("mnemonist/fixed-deque.push: deque capacity (" + this.capacity + ") exceeded!");
393
+ var index = this.start + this.size;
394
+ if (index >= this.capacity) index -= this.capacity;
395
+ this.items[index] = item;
396
+ return ++this.size;
397
+ };
398
+ /**
399
+ * Method used to prepend a value to the deque.
400
+ *
401
+ * @param {any} item - Item to prepend.
402
+ * @return {number} - Returns the new size of the deque.
403
+ */
404
+ FixedDeque.prototype.unshift = function(item) {
405
+ if (this.size === this.capacity) throw new Error("mnemonist/fixed-deque.unshift: deque capacity (" + this.capacity + ") exceeded!");
406
+ var index = this.start - 1;
407
+ if (this.start === 0) index = this.capacity - 1;
408
+ this.items[index] = item;
409
+ this.start = index;
410
+ return ++this.size;
411
+ };
412
+ /**
413
+ * Method used to pop the deque.
414
+ *
415
+ * @return {any} - Returns the popped item.
416
+ */
417
+ FixedDeque.prototype.pop = function() {
418
+ if (this.size === 0) return;
419
+ this.size--;
420
+ var index = this.start + this.size;
421
+ if (index >= this.capacity) index -= this.capacity;
422
+ return this.items[index];
423
+ };
424
+ /**
425
+ * Method used to shift the deque.
426
+ *
427
+ * @return {any} - Returns the shifted item.
428
+ */
429
+ FixedDeque.prototype.shift = function() {
430
+ if (this.size === 0) return;
431
+ var index = this.start;
432
+ this.size--;
433
+ this.start++;
434
+ if (this.start === this.capacity) this.start = 0;
435
+ return this.items[index];
436
+ };
437
+ /**
438
+ * Method used to peek the first value of the deque.
439
+ *
440
+ * @return {any}
441
+ */
442
+ FixedDeque.prototype.peekFirst = function() {
443
+ if (this.size === 0) return;
444
+ return this.items[this.start];
445
+ };
446
+ /**
447
+ * Method used to peek the last value of the deque.
448
+ *
449
+ * @return {any}
450
+ */
451
+ FixedDeque.prototype.peekLast = function() {
452
+ if (this.size === 0) return;
453
+ var index = this.start + this.size - 1;
454
+ if (index >= this.capacity) index -= this.capacity;
455
+ return this.items[index];
456
+ };
457
+ /**
458
+ * Method used to get the desired value of the deque.
459
+ *
460
+ * @param {number} index
461
+ * @return {any}
462
+ */
463
+ FixedDeque.prototype.get = function(index) {
464
+ if (this.size === 0 || index >= this.capacity) return;
465
+ index = this.start + index;
466
+ if (index >= this.capacity) index -= this.capacity;
467
+ return this.items[index];
468
+ };
469
+ /**
470
+ * Method used to iterate over the deque.
471
+ *
472
+ * @param {function} callback - Function to call for each item.
473
+ * @param {object} scope - Optional scope.
474
+ * @return {undefined}
475
+ */
476
+ FixedDeque.prototype.forEach = function(callback, scope) {
477
+ scope = arguments.length > 1 ? scope : this;
478
+ var c = this.capacity, l = this.size, i = this.start, j = 0;
479
+ while (j < l) {
480
+ callback.call(scope, this.items[i], j, this);
481
+ i++;
482
+ j++;
483
+ if (i === c) i = 0;
484
+ }
485
+ };
486
+ /**
487
+ * Method used to convert the deque to a JavaScript array.
488
+ *
489
+ * @return {array}
490
+ */
491
+ FixedDeque.prototype.toArray = function() {
492
+ var offset = this.start + this.size;
493
+ if (offset < this.capacity) return this.items.slice(this.start, offset);
494
+ var array = new this.ArrayClass(this.size), c = this.capacity, l = this.size, i = this.start, j = 0;
495
+ while (j < l) {
496
+ array[j] = this.items[i];
497
+ i++;
498
+ j++;
499
+ if (i === c) i = 0;
500
+ }
501
+ return array;
502
+ };
503
+ /**
504
+ * Method used to create an iterator over the deque's values.
505
+ *
506
+ * @return {Iterator}
507
+ */
508
+ FixedDeque.prototype.values = function() {
509
+ var items = this.items, c = this.capacity, l = this.size, i = this.start, j = 0;
510
+ return new Iterator(function() {
511
+ if (j >= l) return { done: true };
512
+ var value = items[i];
513
+ i++;
514
+ j++;
515
+ if (i === c) i = 0;
516
+ return {
517
+ value,
518
+ done: false
519
+ };
520
+ });
521
+ };
522
+ /**
523
+ * Method used to create an iterator over the deque's entries.
524
+ *
525
+ * @return {Iterator}
526
+ */
527
+ FixedDeque.prototype.entries = function() {
528
+ var items = this.items, c = this.capacity, l = this.size, i = this.start, j = 0;
529
+ return new Iterator(function() {
530
+ if (j >= l) return { done: true };
531
+ var value = items[i];
532
+ i++;
533
+ if (i === c) i = 0;
534
+ return {
535
+ value: [j++, value],
536
+ done: false
537
+ };
538
+ });
539
+ };
540
+ /**
541
+ * Attaching the #.values method to Symbol.iterator if possible.
542
+ */
543
+ if (typeof Symbol !== "undefined") FixedDeque.prototype[Symbol.iterator] = FixedDeque.prototype.values;
544
+ /**
545
+ * Convenience known methods.
546
+ */
547
+ FixedDeque.prototype.inspect = function() {
548
+ var array = this.toArray();
549
+ array.type = this.ArrayClass.name;
550
+ array.capacity = this.capacity;
551
+ Object.defineProperty(array, "constructor", {
552
+ value: FixedDeque,
553
+ enumerable: false
554
+ });
555
+ return array;
556
+ };
557
+ if (typeof Symbol !== "undefined") FixedDeque.prototype[Symbol.for("nodejs.util.inspect.custom")] = FixedDeque.prototype.inspect;
558
+ /**
559
+ * Static @.from function taking an arbitrary iterable & converting it into
560
+ * a deque.
561
+ *
562
+ * @param {Iterable} iterable - Target iterable.
563
+ * @param {function} ArrayClass - Array class to use.
564
+ * @param {number} capacity - Desired capacity.
565
+ * @return {FiniteStack}
566
+ */
567
+ FixedDeque.from = function(iterable, ArrayClass, capacity) {
568
+ if (arguments.length < 3) {
569
+ capacity = iterables.guessLength(iterable);
570
+ if (typeof capacity !== "number") throw new Error("mnemonist/fixed-deque.from: could not guess iterable length. Please provide desired capacity as last argument.");
571
+ }
572
+ var deque = new FixedDeque(ArrayClass, capacity);
573
+ if (iterables.isArrayLike(iterable)) {
574
+ var i, l;
575
+ for (i = 0, l = iterable.length; i < l; i++) deque.items[i] = iterable[i];
576
+ deque.size = l;
577
+ return deque;
578
+ }
579
+ iterables.forEach(iterable, function(value) {
580
+ deque.push(value);
581
+ });
582
+ return deque;
583
+ };
584
+ /**
585
+ * Exporting.
586
+ */
587
+ module.exports = FixedDeque;
588
+ }));
589
+
590
+ //#endregion
591
+ //#region ../../node_modules/.pnpm/graphology-dag@0.4.1_graphology-types@0.24.8/node_modules/graphology-dag/topological-sort.js
592
+ var require_topological_sort = /* @__PURE__ */ __commonJSMin(((exports) => {
593
+ /**
594
+ * Graphology Topological Sort
595
+ * ============================
596
+ *
597
+ * Function performing topological sort over the given DAG using Kahn's
598
+ * algorithm.
599
+ *
600
+ * This function also works on disconnected graphs.
601
+ *
602
+ * [Reference]:
603
+ * https://en.wikipedia.org/wiki/Topological_sorting
604
+ */
605
+ const isGraph = require_is_graph();
606
+ const FixedDeque = require_fixed_deque();
607
+ function simpleInDegree(graph, node) {
608
+ let degree = 0;
609
+ graph.forEachInNeighbor(node, () => {
610
+ degree++;
611
+ });
612
+ return degree;
613
+ }
614
+ function forEachNodeInTopologicalOrder(graph, callback) {
615
+ if (!isGraph(graph)) throw new Error("graphology-dag/topological-sort: the given graph is not a valid graphology instance.");
616
+ if (graph.type === "undirected" || graph.undirectedSize !== 0) throw new Error("graphology-dag/topological-sort: cannot work if graph is not directed.");
617
+ if (graph.order === 0) return;
618
+ const queue = new FixedDeque(Array, graph.order);
619
+ const inDegrees = {};
620
+ let total = 0;
621
+ graph.forEachNode((node, attr) => {
622
+ const inDegree = graph.multi ? simpleInDegree(graph, node) : graph.inDegree(node);
623
+ if (inDegree === 0) queue.push([
624
+ node,
625
+ attr,
626
+ 0
627
+ ]);
628
+ else {
629
+ inDegrees[node] = inDegree;
630
+ total += inDegree;
631
+ }
632
+ });
633
+ let currentGeneration = 0;
634
+ function neighborCallback(neighbor, attr) {
635
+ const neighborInDegree = --inDegrees[neighbor];
636
+ total--;
637
+ if (neighborInDegree === 0) queue.push([
638
+ neighbor,
639
+ attr,
640
+ currentGeneration + 1
641
+ ]);
642
+ inDegrees[neighbor] = neighborInDegree;
643
+ }
644
+ while (queue.size !== 0) {
645
+ const [node, attr, gen] = queue.shift();
646
+ currentGeneration = gen;
647
+ callback(node, attr, gen);
648
+ graph.forEachOutNeighbor(node, neighborCallback);
649
+ }
650
+ if (total !== 0) throw new Error("graphology-dag/topological-sort: given graph is not acyclic.");
651
+ }
652
+ function topologicalSort(graph) {
653
+ if (!isGraph(graph)) throw new Error("graphology-dag/topological-sort: the given graph is not a valid graphology instance.");
654
+ const sortedNodes = new Array(graph.order);
655
+ let i = 0;
656
+ forEachNodeInTopologicalOrder(graph, (node) => {
657
+ sortedNodes[i++] = node;
658
+ });
659
+ return sortedNodes;
660
+ }
661
+ /**
662
+ * Exporting.
663
+ */
664
+ exports.topologicalSort = topologicalSort;
665
+ }));
666
+
667
+ //#endregion
668
+ //#region ../../node_modules/.pnpm/graphology-dag@0.4.1_graphology-types@0.24.8/node_modules/graphology-dag/will-create-cycle.js
669
+ var require_will_create_cycle = /* @__PURE__ */ __commonJSMin(((exports, module) => {
670
+ /**
671
+ * Graphology Cycle Creation Checker
672
+ * ==================================
673
+ *
674
+ * Function returning whether adding the given directed edge to a DAG will
675
+ * create a cycle.
676
+ *
677
+ * Note that this function requires the given graph to be a valid DAG forest
678
+ * and will not check it beforehand for performance reasons.
679
+ */
680
+ const isGraph = require_is_graph();
681
+ module.exports = function willCreateCycle(graph, source, target) {
682
+ if (!isGraph(graph)) throw new Error("graphology-dag/will-create-cycle: the given graph is not a valid graphology instance.");
683
+ source = "" + source;
684
+ target = "" + target;
685
+ if (source === target) return true;
686
+ if (!graph.hasNode(source) || !graph.hasNode(target)) return false;
687
+ if (graph.hasDirectedEdge(source, target)) return false;
688
+ if (graph.hasDirectedEdge(target, source)) return true;
689
+ const stack = graph.outNeighbors(target);
690
+ function push(neighbor) {
691
+ stack.push(neighbor);
692
+ }
693
+ while (stack.length !== 0) {
694
+ const node = stack.pop();
695
+ if (node === source) return true;
696
+ graph.forEachOutNeighbor(node, push);
697
+ }
698
+ return false;
699
+ };
700
+ }));
701
+
702
+ //#endregion
703
+ export { require_iterator as a, require_typed_arrays as i, require_topological_sort as n, require_foreach as o, require_iterables as r, require_will_create_cycle as t };