@likec4/core 1.20.1 → 1.20.3
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.
- package/dist/builder/index.cjs +6 -6
- package/dist/builder/index.d.cts +3 -3
- package/dist/builder/index.d.mts +3 -3
- package/dist/builder/index.d.ts +3 -3
- package/dist/builder/index.mjs +6 -6
- package/dist/compute-view/index.cjs +5 -5
- package/dist/compute-view/index.d.cts +4 -4
- package/dist/compute-view/index.d.mts +4 -4
- package/dist/compute-view/index.d.ts +4 -4
- package/dist/compute-view/index.mjs +6 -6
- package/dist/index.cjs +71 -573
- package/dist/index.d.cts +9 -133
- package/dist/index.d.mts +9 -133
- package/dist/index.d.ts +9 -133
- package/dist/index.mjs +8 -512
- package/dist/model/index.cjs +1 -1
- package/dist/model/index.d.cts +5 -5
- package/dist/model/index.d.mts +5 -5
- package/dist/model/index.d.ts +5 -5
- package/dist/model/index.mjs +1 -1
- package/dist/shared/{core.DunIMHRf.mjs → core.0PxLtLpP.mjs} +1 -1
- package/dist/shared/{core.BvdNMbcA.d.cts → core.88YY6vtF.d.mts} +2 -2
- package/dist/shared/{core.CqCTxzMY.mjs → core.BG1hfxpq.mjs} +29 -620
- package/dist/shared/{core.ByNgh-mC.d.cts → core.BIZD3l1g.d.cts} +1 -1
- package/dist/shared/{core.D74xkKkG.d.ts → core.BJfn72tj.d.cts} +5 -0
- package/dist/shared/{core.D74xkKkG.d.cts → core.BJfn72tj.d.mts} +5 -0
- package/dist/shared/{core.D74xkKkG.d.mts → core.BJfn72tj.d.ts} +5 -0
- package/dist/shared/{core.M-JWF7SS.mjs → core.Bezy7K65.mjs} +1 -1
- package/dist/shared/{core.D_Gc58Gt.d.ts → core.Bs71hdR4.d.ts} +2 -1
- package/dist/shared/{core.D6-fWbM3.d.ts → core.BtISRjMA.d.ts} +1 -1
- package/dist/shared/{core.B72vUaNB.d.cts → core.C0ygs98j.d.cts} +2 -1
- package/dist/shared/core.CCyhaU-4.mjs +14819 -0
- package/dist/shared/{core.DsoCu540.cjs → core.CKYxnFEl.cjs} +1 -1
- package/dist/shared/{core.Damrzla-.d.ts → core.CNUzoKM7.d.ts} +2 -2
- package/dist/shared/{core.sLaWHBjR.d.mts → core.CajOK_t3.d.mts} +1 -1
- package/dist/shared/{core.BdbFkE_p.d.cts → core.Cmfo_N4F.d.mts} +3 -3
- package/dist/shared/{core.jy6z2iRn.d.mts → core.CwZmAghJ.d.cts} +3 -3
- package/dist/shared/{core.ZWiGANIJ.d.ts → core.D4wZW7zR.d.ts} +3 -3
- package/dist/shared/{core.BGus30EM.cjs → core.DRfrKNT6.cjs} +48 -643
- package/dist/shared/{core.gv1bMwCC.cjs → core.Db_OTRdC.cjs} +1 -1
- package/dist/shared/{core.Dfzrh1VA.d.mts → core.DjMYkPMQ.d.mts} +2 -1
- package/dist/shared/{core.m3rCQAv6.mjs → core.El-gigOM.mjs} +1 -1
- package/dist/shared/core.FACQZmma.cjs +14874 -0
- package/dist/shared/{core.BRuJ3Wzf.d.mts → core.Lh2RFJf1.d.cts} +2 -2
- package/dist/shared/{core.B2QYWlYe.cjs → core.uxHtIZaH.cjs} +1 -1
- package/dist/types/index.cjs +1 -1
- package/dist/types/index.d.cts +4 -4
- package/dist/types/index.d.mts +4 -4
- package/dist/types/index.d.ts +4 -4
- package/dist/types/index.mjs +1 -1
- package/dist/utils/index.cjs +6 -2
- package/dist/utils/index.d.cts +129 -145
- package/dist/utils/index.d.mts +129 -145
- package/dist/utils/index.d.ts +129 -145
- package/dist/utils/index.mjs +3 -3
- package/package.json +7 -6
- package/src/compute-view/deployment-view/clean-connections.ts +1 -1
- package/src/compute-view/deployment-view/stages/stage-final.ts +1 -1
- package/src/compute-view/element-view/__test__/fixture.ts +2 -0
- package/src/compute-view/element-view/compute.ts +1 -1
- package/src/compute-view/element-view/memory/memory.ts +3 -3
- package/src/compute-view/memory/ops.ts +1 -1
- package/src/compute-view/relationships-view/layout.ts +1 -1
- package/src/compute-view/relationships-view/utils.ts +1 -1
- package/src/compute-view/utils/applyCustomElementProperties.ts +9 -6
- package/src/compute-view/utils/applyViewRuleStyles.ts +7 -4
- package/src/index.ts +0 -8
- package/src/model/DeploymentModel.ts +1 -1
- package/src/model/LikeC4Model.ts +3 -3
- package/src/types/element.ts +7 -2
- package/src/types/expression.ts +1 -0
- package/src/utils/index.ts +2 -0
- package/src/utils/set.ts +5 -2
- package/dist/shared/core.BxvDITEI.mjs +0 -859
- package/dist/shared/core.C9DCnJh8.cjs +0 -908
- package/src/builder/Builder-style1.test-d.ts +0 -190
- package/src/builder/Builder-style2.test-d.ts +0 -175
- package/src/compute-view/utils/uniqueTags.test.ts +0 -42
- package/src/model/LikeC4Model.test-d.ts +0 -152
|
@@ -1,605 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const object_hash = require('./core.
|
|
4
|
-
const view = require('./core.
|
|
5
|
-
const chunkRAAYCPUM = require('./core.
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Mnemonist DefaultMap
|
|
9
|
-
* =====================
|
|
10
|
-
*
|
|
11
|
-
* JavaScript implementation of a default map that will return a constructed
|
|
12
|
-
* value any time one tries to access an inexisting key. It's quite similar
|
|
13
|
-
* to python's defaultdict.
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
var defaultMap;
|
|
17
|
-
var hasRequiredDefaultMap;
|
|
18
|
-
|
|
19
|
-
function requireDefaultMap () {
|
|
20
|
-
if (hasRequiredDefaultMap) return defaultMap;
|
|
21
|
-
hasRequiredDefaultMap = 1;
|
|
22
|
-
/**
|
|
23
|
-
* DefaultMap.
|
|
24
|
-
*
|
|
25
|
-
* @constructor
|
|
26
|
-
*/
|
|
27
|
-
function DefaultMap(factory) {
|
|
28
|
-
if (typeof factory !== 'function')
|
|
29
|
-
throw new Error('mnemonist/DefaultMap.constructor: expecting a function.');
|
|
30
|
-
|
|
31
|
-
this.items = new Map();
|
|
32
|
-
this.factory = factory;
|
|
33
|
-
this.size = 0;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Method used to clear the structure.
|
|
38
|
-
*
|
|
39
|
-
* @return {undefined}
|
|
40
|
-
*/
|
|
41
|
-
DefaultMap.prototype.clear = function() {
|
|
42
|
-
|
|
43
|
-
// Properties
|
|
44
|
-
this.items.clear();
|
|
45
|
-
this.size = 0;
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Method used to get the value set for given key. If the key does not exist,
|
|
50
|
-
* the value will be created using the provided factory.
|
|
51
|
-
*
|
|
52
|
-
* @param {any} key - Target key.
|
|
53
|
-
* @return {any}
|
|
54
|
-
*/
|
|
55
|
-
DefaultMap.prototype.get = function(key) {
|
|
56
|
-
var value = this.items.get(key);
|
|
57
|
-
|
|
58
|
-
if (typeof value === 'undefined') {
|
|
59
|
-
value = this.factory(key, this.size);
|
|
60
|
-
this.items.set(key, value);
|
|
61
|
-
this.size++;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
return value;
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* Method used to get the value set for given key. If the key does not exist,
|
|
69
|
-
* a value won't be created.
|
|
70
|
-
*
|
|
71
|
-
* @param {any} key - Target key.
|
|
72
|
-
* @return {any}
|
|
73
|
-
*/
|
|
74
|
-
DefaultMap.prototype.peek = function(key) {
|
|
75
|
-
return this.items.get(key);
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* Method used to set a value for given key.
|
|
80
|
-
*
|
|
81
|
-
* @param {any} key - Target key.
|
|
82
|
-
* @param {any} value - Value.
|
|
83
|
-
* @return {DefaultMap}
|
|
84
|
-
*/
|
|
85
|
-
DefaultMap.prototype.set = function(key, value) {
|
|
86
|
-
this.items.set(key, value);
|
|
87
|
-
this.size = this.items.size;
|
|
88
|
-
|
|
89
|
-
return this;
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* Method used to test the existence of a key in the map.
|
|
94
|
-
*
|
|
95
|
-
* @param {any} key - Target key.
|
|
96
|
-
* @return {boolean}
|
|
97
|
-
*/
|
|
98
|
-
DefaultMap.prototype.has = function(key) {
|
|
99
|
-
return this.items.has(key);
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* Method used to delete target key.
|
|
104
|
-
*
|
|
105
|
-
* @param {any} key - Target key.
|
|
106
|
-
* @return {boolean}
|
|
107
|
-
*/
|
|
108
|
-
DefaultMap.prototype.delete = function(key) {
|
|
109
|
-
var deleted = this.items.delete(key);
|
|
110
|
-
|
|
111
|
-
this.size = this.items.size;
|
|
112
|
-
|
|
113
|
-
return deleted;
|
|
114
|
-
};
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
* Method used to iterate over each of the key/value pairs.
|
|
118
|
-
*
|
|
119
|
-
* @param {function} callback - Function to call for each item.
|
|
120
|
-
* @param {object} scope - Optional scope.
|
|
121
|
-
* @return {undefined}
|
|
122
|
-
*/
|
|
123
|
-
DefaultMap.prototype.forEach = function(callback, scope) {
|
|
124
|
-
scope = arguments.length > 1 ? scope : this;
|
|
125
|
-
|
|
126
|
-
this.items.forEach(callback, scope);
|
|
127
|
-
};
|
|
128
|
-
|
|
129
|
-
/**
|
|
130
|
-
* Iterators.
|
|
131
|
-
*/
|
|
132
|
-
DefaultMap.prototype.entries = function() {
|
|
133
|
-
return this.items.entries();
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
DefaultMap.prototype.keys = function() {
|
|
137
|
-
return this.items.keys();
|
|
138
|
-
};
|
|
139
|
-
|
|
140
|
-
DefaultMap.prototype.values = function() {
|
|
141
|
-
return this.items.values();
|
|
142
|
-
};
|
|
143
|
-
|
|
144
|
-
/**
|
|
145
|
-
* Attaching the #.entries method to Symbol.iterator if possible.
|
|
146
|
-
*/
|
|
147
|
-
if (typeof Symbol !== 'undefined')
|
|
148
|
-
DefaultMap.prototype[Symbol.iterator] = DefaultMap.prototype.entries;
|
|
149
|
-
|
|
150
|
-
/**
|
|
151
|
-
* Convenience known methods.
|
|
152
|
-
*/
|
|
153
|
-
DefaultMap.prototype.inspect = function() {
|
|
154
|
-
return this.items;
|
|
155
|
-
};
|
|
156
|
-
|
|
157
|
-
if (typeof Symbol !== 'undefined')
|
|
158
|
-
DefaultMap.prototype[Symbol.for('nodejs.util.inspect.custom')] = DefaultMap.prototype.inspect;
|
|
159
|
-
|
|
160
|
-
/**
|
|
161
|
-
* Typical factories.
|
|
162
|
-
*/
|
|
163
|
-
DefaultMap.autoIncrement = function() {
|
|
164
|
-
var i = 0;
|
|
165
|
-
|
|
166
|
-
return function() {
|
|
167
|
-
return i++;
|
|
168
|
-
};
|
|
169
|
-
};
|
|
170
|
-
|
|
171
|
-
/**
|
|
172
|
-
* Exporting.
|
|
173
|
-
*/
|
|
174
|
-
defaultMap = DefaultMap;
|
|
175
|
-
return defaultMap;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
var defaultMapExports = requireDefaultMap();
|
|
179
|
-
const DefaultMap = /*@__PURE__*/object_hash.getDefaultExportFromCjs(defaultMapExports);
|
|
180
|
-
|
|
181
|
-
/**
|
|
182
|
-
* Obliterator Iterator Class
|
|
183
|
-
* ===========================
|
|
184
|
-
*
|
|
185
|
-
* Simple class representing the library's iterators.
|
|
186
|
-
*/
|
|
187
|
-
|
|
188
|
-
var iterator;
|
|
189
|
-
var hasRequiredIterator;
|
|
190
|
-
|
|
191
|
-
function requireIterator () {
|
|
192
|
-
if (hasRequiredIterator) return iterator;
|
|
193
|
-
hasRequiredIterator = 1;
|
|
194
|
-
/**
|
|
195
|
-
* Iterator class.
|
|
196
|
-
*
|
|
197
|
-
* @constructor
|
|
198
|
-
* @param {function} next - Next function.
|
|
199
|
-
*/
|
|
200
|
-
function Iterator(next) {
|
|
201
|
-
if (typeof next !== 'function')
|
|
202
|
-
throw new Error('obliterator/iterator: expecting a function!');
|
|
203
|
-
|
|
204
|
-
this.next = next;
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
/**
|
|
208
|
-
* If symbols are supported, we add `next` to `Symbol.iterator`.
|
|
209
|
-
*/
|
|
210
|
-
if (typeof Symbol !== 'undefined')
|
|
211
|
-
Iterator.prototype[Symbol.iterator] = function () {
|
|
212
|
-
return this;
|
|
213
|
-
};
|
|
214
|
-
|
|
215
|
-
/**
|
|
216
|
-
* Returning an iterator of the given values.
|
|
217
|
-
*
|
|
218
|
-
* @param {any...} values - Values.
|
|
219
|
-
* @return {Iterator}
|
|
220
|
-
*/
|
|
221
|
-
Iterator.of = function () {
|
|
222
|
-
var args = arguments,
|
|
223
|
-
l = args.length,
|
|
224
|
-
i = 0;
|
|
225
|
-
|
|
226
|
-
return new Iterator(function () {
|
|
227
|
-
if (i >= l) return {done: true};
|
|
228
|
-
|
|
229
|
-
return {done: false, value: args[i++]};
|
|
230
|
-
});
|
|
231
|
-
};
|
|
232
|
-
|
|
233
|
-
/**
|
|
234
|
-
* Returning an empty iterator.
|
|
235
|
-
*
|
|
236
|
-
* @return {Iterator}
|
|
237
|
-
*/
|
|
238
|
-
Iterator.empty = function () {
|
|
239
|
-
var iterator = new Iterator(function () {
|
|
240
|
-
return {done: true};
|
|
241
|
-
});
|
|
242
|
-
|
|
243
|
-
return iterator;
|
|
244
|
-
};
|
|
245
|
-
|
|
246
|
-
/**
|
|
247
|
-
* Returning an iterator over the given indexed sequence.
|
|
248
|
-
*
|
|
249
|
-
* @param {string|Array} sequence - Target sequence.
|
|
250
|
-
* @return {Iterator}
|
|
251
|
-
*/
|
|
252
|
-
Iterator.fromSequence = function (sequence) {
|
|
253
|
-
var i = 0,
|
|
254
|
-
l = sequence.length;
|
|
255
|
-
|
|
256
|
-
return new Iterator(function () {
|
|
257
|
-
if (i >= l) return {done: true};
|
|
258
|
-
|
|
259
|
-
return {done: false, value: sequence[i++]};
|
|
260
|
-
});
|
|
261
|
-
};
|
|
262
|
-
|
|
263
|
-
/**
|
|
264
|
-
* Returning whether the given value is an iterator.
|
|
265
|
-
*
|
|
266
|
-
* @param {any} value - Value.
|
|
267
|
-
* @return {boolean}
|
|
268
|
-
*/
|
|
269
|
-
Iterator.is = function (value) {
|
|
270
|
-
if (value instanceof Iterator) return true;
|
|
271
|
-
|
|
272
|
-
return (
|
|
273
|
-
typeof value === 'object' &&
|
|
274
|
-
value !== null &&
|
|
275
|
-
typeof value.next === 'function'
|
|
276
|
-
);
|
|
277
|
-
};
|
|
278
|
-
|
|
279
|
-
/**
|
|
280
|
-
* Exporting.
|
|
281
|
-
*/
|
|
282
|
-
iterator = Iterator;
|
|
283
|
-
return iterator;
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
var support = {};
|
|
287
|
-
|
|
288
|
-
var hasRequiredSupport;
|
|
289
|
-
|
|
290
|
-
function requireSupport () {
|
|
291
|
-
if (hasRequiredSupport) return support;
|
|
292
|
-
hasRequiredSupport = 1;
|
|
293
|
-
support.ARRAY_BUFFER_SUPPORT = typeof ArrayBuffer !== 'undefined';
|
|
294
|
-
support.SYMBOL_SUPPORT = typeof Symbol !== 'undefined';
|
|
295
|
-
return support;
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
/**
|
|
299
|
-
* Obliterator ForEach Function
|
|
300
|
-
* =============================
|
|
301
|
-
*
|
|
302
|
-
* Helper function used to easily iterate over mixed values.
|
|
303
|
-
*/
|
|
304
|
-
|
|
305
|
-
var foreach;
|
|
306
|
-
var hasRequiredForeach;
|
|
307
|
-
|
|
308
|
-
function requireForeach () {
|
|
309
|
-
if (hasRequiredForeach) return foreach;
|
|
310
|
-
hasRequiredForeach = 1;
|
|
311
|
-
var support = requireSupport();
|
|
312
|
-
|
|
313
|
-
var ARRAY_BUFFER_SUPPORT = support.ARRAY_BUFFER_SUPPORT;
|
|
314
|
-
var SYMBOL_SUPPORT = support.SYMBOL_SUPPORT;
|
|
315
|
-
|
|
316
|
-
/**
|
|
317
|
-
* Function able to iterate over almost any iterable JS value.
|
|
318
|
-
*
|
|
319
|
-
* @param {any} iterable - Iterable value.
|
|
320
|
-
* @param {function} callback - Callback function.
|
|
321
|
-
*/
|
|
322
|
-
foreach = function forEach(iterable, callback) {
|
|
323
|
-
var iterator, k, i, l, s;
|
|
324
|
-
|
|
325
|
-
if (!iterable) throw new Error('obliterator/forEach: invalid iterable.');
|
|
326
|
-
|
|
327
|
-
if (typeof callback !== 'function')
|
|
328
|
-
throw new Error('obliterator/forEach: expecting a callback.');
|
|
329
|
-
|
|
330
|
-
// The target is an array or a string or function arguments
|
|
331
|
-
if (
|
|
332
|
-
Array.isArray(iterable) ||
|
|
333
|
-
(ARRAY_BUFFER_SUPPORT && ArrayBuffer.isView(iterable)) ||
|
|
334
|
-
typeof iterable === 'string' ||
|
|
335
|
-
iterable.toString() === '[object Arguments]'
|
|
336
|
-
) {
|
|
337
|
-
for (i = 0, l = iterable.length; i < l; i++) callback(iterable[i], i);
|
|
338
|
-
return;
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
// The target has a #.forEach method
|
|
342
|
-
if (typeof iterable.forEach === 'function') {
|
|
343
|
-
iterable.forEach(callback);
|
|
344
|
-
return;
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
// The target is iterable
|
|
348
|
-
if (
|
|
349
|
-
SYMBOL_SUPPORT &&
|
|
350
|
-
Symbol.iterator in iterable &&
|
|
351
|
-
typeof iterable.next !== 'function'
|
|
352
|
-
) {
|
|
353
|
-
iterable = iterable[Symbol.iterator]();
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
// The target is an iterator
|
|
357
|
-
if (typeof iterable.next === 'function') {
|
|
358
|
-
iterator = iterable;
|
|
359
|
-
i = 0;
|
|
360
|
-
|
|
361
|
-
while (((s = iterator.next()), s.done !== true)) {
|
|
362
|
-
callback(s.value, i);
|
|
363
|
-
i++;
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
return;
|
|
367
|
-
}
|
|
368
|
-
|
|
369
|
-
// The target is a plain object
|
|
370
|
-
for (k in iterable) {
|
|
371
|
-
if (iterable.hasOwnProperty(k)) {
|
|
372
|
-
callback(iterable[k], k);
|
|
373
|
-
}
|
|
374
|
-
}
|
|
375
|
-
|
|
376
|
-
return;
|
|
377
|
-
};
|
|
378
|
-
return foreach;
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
/**
|
|
382
|
-
* Mnemonist Stack
|
|
383
|
-
* ================
|
|
384
|
-
*
|
|
385
|
-
* Stack implementation relying on JavaScript arrays, which are fast enough &
|
|
386
|
-
* correctly optimized for this kind of work.
|
|
387
|
-
*/
|
|
388
|
-
|
|
389
|
-
var stack;
|
|
390
|
-
var hasRequiredStack;
|
|
391
|
-
|
|
392
|
-
function requireStack () {
|
|
393
|
-
if (hasRequiredStack) return stack;
|
|
394
|
-
hasRequiredStack = 1;
|
|
395
|
-
var Iterator = requireIterator(),
|
|
396
|
-
forEach = requireForeach();
|
|
397
|
-
|
|
398
|
-
/**
|
|
399
|
-
* Stack
|
|
400
|
-
*
|
|
401
|
-
* @constructor
|
|
402
|
-
*/
|
|
403
|
-
function Stack() {
|
|
404
|
-
this.clear();
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
/**
|
|
408
|
-
* Method used to clear the stack.
|
|
409
|
-
*
|
|
410
|
-
* @return {undefined}
|
|
411
|
-
*/
|
|
412
|
-
Stack.prototype.clear = function() {
|
|
413
|
-
|
|
414
|
-
// Properties
|
|
415
|
-
this.items = [];
|
|
416
|
-
this.size = 0;
|
|
417
|
-
};
|
|
418
|
-
|
|
419
|
-
/**
|
|
420
|
-
* Method used to add an item to the stack.
|
|
421
|
-
*
|
|
422
|
-
* @param {any} item - Item to add.
|
|
423
|
-
* @return {number}
|
|
424
|
-
*/
|
|
425
|
-
Stack.prototype.push = function(item) {
|
|
426
|
-
this.items.push(item);
|
|
427
|
-
return ++this.size;
|
|
428
|
-
};
|
|
429
|
-
|
|
430
|
-
/**
|
|
431
|
-
* Method used to retrieve & remove the last item of the stack.
|
|
432
|
-
*
|
|
433
|
-
* @return {any}
|
|
434
|
-
*/
|
|
435
|
-
Stack.prototype.pop = function() {
|
|
436
|
-
if (this.size === 0)
|
|
437
|
-
return;
|
|
438
|
-
|
|
439
|
-
this.size--;
|
|
440
|
-
return this.items.pop();
|
|
441
|
-
};
|
|
442
|
-
|
|
443
|
-
/**
|
|
444
|
-
* Method used to get the last item of the stack.
|
|
445
|
-
*
|
|
446
|
-
* @return {any}
|
|
447
|
-
*/
|
|
448
|
-
Stack.prototype.peek = function() {
|
|
449
|
-
return this.items[this.size - 1];
|
|
450
|
-
};
|
|
451
|
-
|
|
452
|
-
/**
|
|
453
|
-
* Method used to iterate over the stack.
|
|
454
|
-
*
|
|
455
|
-
* @param {function} callback - Function to call for each item.
|
|
456
|
-
* @param {object} scope - Optional scope.
|
|
457
|
-
* @return {undefined}
|
|
458
|
-
*/
|
|
459
|
-
Stack.prototype.forEach = function(callback, scope) {
|
|
460
|
-
scope = arguments.length > 1 ? scope : this;
|
|
461
|
-
|
|
462
|
-
for (var i = 0, l = this.items.length; i < l; i++)
|
|
463
|
-
callback.call(scope, this.items[l - i - 1], i, this);
|
|
464
|
-
};
|
|
465
|
-
|
|
466
|
-
/**
|
|
467
|
-
* Method used to convert the stack to a JavaScript array.
|
|
468
|
-
*
|
|
469
|
-
* @return {array}
|
|
470
|
-
*/
|
|
471
|
-
Stack.prototype.toArray = function() {
|
|
472
|
-
var array = new Array(this.size),
|
|
473
|
-
l = this.size - 1,
|
|
474
|
-
i = this.size;
|
|
475
|
-
|
|
476
|
-
while (i--)
|
|
477
|
-
array[i] = this.items[l - i];
|
|
478
|
-
|
|
479
|
-
return array;
|
|
480
|
-
};
|
|
481
|
-
|
|
482
|
-
/**
|
|
483
|
-
* Method used to create an iterator over a stack's values.
|
|
484
|
-
*
|
|
485
|
-
* @return {Iterator}
|
|
486
|
-
*/
|
|
487
|
-
Stack.prototype.values = function() {
|
|
488
|
-
var items = this.items,
|
|
489
|
-
l = items.length,
|
|
490
|
-
i = 0;
|
|
491
|
-
|
|
492
|
-
return new Iterator(function() {
|
|
493
|
-
if (i >= l)
|
|
494
|
-
return {
|
|
495
|
-
done: true
|
|
496
|
-
};
|
|
497
|
-
|
|
498
|
-
var value = items[l - i - 1];
|
|
499
|
-
i++;
|
|
500
|
-
|
|
501
|
-
return {
|
|
502
|
-
value: value,
|
|
503
|
-
done: false
|
|
504
|
-
};
|
|
505
|
-
});
|
|
506
|
-
};
|
|
507
|
-
|
|
508
|
-
/**
|
|
509
|
-
* Method used to create an iterator over a stack's entries.
|
|
510
|
-
*
|
|
511
|
-
* @return {Iterator}
|
|
512
|
-
*/
|
|
513
|
-
Stack.prototype.entries = function() {
|
|
514
|
-
var items = this.items,
|
|
515
|
-
l = items.length,
|
|
516
|
-
i = 0;
|
|
517
|
-
|
|
518
|
-
return new Iterator(function() {
|
|
519
|
-
if (i >= l)
|
|
520
|
-
return {
|
|
521
|
-
done: true
|
|
522
|
-
};
|
|
523
|
-
|
|
524
|
-
var value = items[l - i - 1];
|
|
525
|
-
|
|
526
|
-
return {
|
|
527
|
-
value: [i++, value],
|
|
528
|
-
done: false
|
|
529
|
-
};
|
|
530
|
-
});
|
|
531
|
-
};
|
|
532
|
-
|
|
533
|
-
/**
|
|
534
|
-
* Attaching the #.values method to Symbol.iterator if possible.
|
|
535
|
-
*/
|
|
536
|
-
if (typeof Symbol !== 'undefined')
|
|
537
|
-
Stack.prototype[Symbol.iterator] = Stack.prototype.values;
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
/**
|
|
541
|
-
* Convenience known methods.
|
|
542
|
-
*/
|
|
543
|
-
Stack.prototype.toString = function() {
|
|
544
|
-
return this.toArray().join(',');
|
|
545
|
-
};
|
|
546
|
-
|
|
547
|
-
Stack.prototype.toJSON = function() {
|
|
548
|
-
return this.toArray();
|
|
549
|
-
};
|
|
550
|
-
|
|
551
|
-
Stack.prototype.inspect = function() {
|
|
552
|
-
var array = this.toArray();
|
|
553
|
-
|
|
554
|
-
// Trick so that node displays the name of the constructor
|
|
555
|
-
Object.defineProperty(array, 'constructor', {
|
|
556
|
-
value: Stack,
|
|
557
|
-
enumerable: false
|
|
558
|
-
});
|
|
559
|
-
|
|
560
|
-
return array;
|
|
561
|
-
};
|
|
562
|
-
|
|
563
|
-
if (typeof Symbol !== 'undefined')
|
|
564
|
-
Stack.prototype[Symbol.for('nodejs.util.inspect.custom')] = Stack.prototype.inspect;
|
|
565
|
-
|
|
566
|
-
/**
|
|
567
|
-
* Static @.from function taking an arbitrary iterable & converting it into
|
|
568
|
-
* a stack.
|
|
569
|
-
*
|
|
570
|
-
* @param {Iterable} iterable - Target iterable.
|
|
571
|
-
* @return {Stack}
|
|
572
|
-
*/
|
|
573
|
-
Stack.from = function(iterable) {
|
|
574
|
-
var stack = new Stack();
|
|
575
|
-
|
|
576
|
-
forEach(iterable, function(value) {
|
|
577
|
-
stack.push(value);
|
|
578
|
-
});
|
|
579
|
-
|
|
580
|
-
return stack;
|
|
581
|
-
};
|
|
582
|
-
|
|
583
|
-
/**
|
|
584
|
-
* Static @.of function taking an arbitrary number of arguments & converting it
|
|
585
|
-
* into a stack.
|
|
586
|
-
*
|
|
587
|
-
* @param {...any} args
|
|
588
|
-
* @return {Stack}
|
|
589
|
-
*/
|
|
590
|
-
Stack.of = function() {
|
|
591
|
-
return Stack.from(arguments);
|
|
592
|
-
};
|
|
593
|
-
|
|
594
|
-
/**
|
|
595
|
-
* Exporting.
|
|
596
|
-
*/
|
|
597
|
-
stack = Stack;
|
|
598
|
-
return stack;
|
|
599
|
-
}
|
|
600
|
-
|
|
601
|
-
var stackExports = requireStack();
|
|
602
|
-
const Stack = /*@__PURE__*/object_hash.getDefaultExportFromCjs(stackExports);
|
|
3
|
+
const object_hash = require('./core.FACQZmma.cjs');
|
|
4
|
+
const view = require('./core.uxHtIZaH.cjs');
|
|
5
|
+
const chunkRAAYCPUM = require('./core.CKYxnFEl.cjs');
|
|
603
6
|
|
|
604
7
|
function f(t,i){let o=i.length-t.length;if(o===1){let[n,...r]=i;return object_hash.x(n,{lazy:t,lazyArgs:r})}if(o===0){let n={lazy:t,lazyArgs:i};return Object.assign(e=>object_hash.x(e,n),n)}throw new Error("Wrong number of arguments")}
|
|
605
8
|
|
|
@@ -607,11 +10,11 @@ function r$3(...t){return chunkRAAYCPUM.u(Object.values,t)}
|
|
|
607
10
|
|
|
608
11
|
function d$5(...e){return e.length===2?(n,...r)=>t$5(n,...e,...r):t$5(...e)}var t$5=(e,n,r,...a)=>n(e,...a)?typeof r=="function"?r(e,...a):r.onTrue(e,...a):typeof r=="function"?e:r.onFalse(e,...a);
|
|
609
12
|
|
|
610
|
-
function i$8(...e){return f(o$8,e)}function o$8(){let e=new Set;return t=>e.has(t)?object_hash.s:(e.add(t),{done
|
|
13
|
+
function i$8(...e){return f(o$8,e)}function o$8(){let e=new Set;return t=>e.has(t)?object_hash.s:(e.add(t),{done:false,hasNext:true,next:t})}
|
|
611
14
|
|
|
612
|
-
function l$6(...e){return chunkRAAYCPUM.u(o$7,e,u$5)}var o$7=(e,r)=>r<0?[]:e.slice(0,r);function u$5(e){if(e<=0)return object_hash.a;let r=e;return a=>(r-=1,{done:r<=0,hasNext
|
|
15
|
+
function l$6(...e){return chunkRAAYCPUM.u(o$7,e,u$5)}var o$7=(e,r)=>r<0?[]:e.slice(0,r);function u$5(e){if(e<=0)return object_hash.a;let r=e;return a=>(r-=1,{done:r<=0,hasNext:true,next:a})}
|
|
613
16
|
|
|
614
|
-
var T$1={asc:(r,n)=>r>n,desc:(r,n)=>r<n};function s(r,n){let[e,...o]=n;if(!m$2(e)){let t=u$4(...o);return r(e,t)}let a=u$4(e,...o);return t=>r(t,a)}function u$4(r,n,...e){let o=typeof r=="function"?r:r[0],a=typeof r=="function"?"asc":r[1],{[a]:t}=T$1,i=n===
|
|
17
|
+
var T$1={asc:(r,n)=>r>n,desc:(r,n)=>r<n};function s(r,n){let[e,...o]=n;if(!m$2(e)){let t=u$4(...o);return r(e,t)}let a=u$4(e,...o);return t=>r(t,a)}function u$4(r,n,...e){let o=typeof r=="function"?r:r[0],a=typeof r=="function"?"asc":r[1],{[a]:t}=T$1,i=n===undefined?undefined:u$4(n,...e);return (y,c)=>{let p=o(y),l=o(c);return t(p,l)?1:t(l,p)?-1:i?.(y,c)??0}}function m$2(r){if(d$4(r))return true;if(typeof r!="object"||!Array.isArray(r))return false;let[n,e,...o]=r;return d$4(n)&&typeof e=="string"&&e in T$1&&o.length===0}var d$4=r=>typeof r=="function"&&r.length===1;
|
|
615
18
|
|
|
616
19
|
function m$1(...r){return chunkRAAYCPUM.u(o$6,r)}function o$6(r,t){let e=[...r];return e.sort(t),e}
|
|
617
20
|
|
|
@@ -633,7 +36,7 @@ function i$4(...n){return o=>object_hash.x(o,...n)}
|
|
|
633
36
|
|
|
634
37
|
function d$1(...e){return chunkRAAYCPUM.u(l$4,e)}function l$4(e,a){let t={...e};for(let[n,o]of Object.entries(t))a(o,n,e)&&delete t[n];return t}
|
|
635
38
|
|
|
636
|
-
function t$2(...n){return chunkRAAYCPUM.u(o$4,n)}var o$4=n=>n.length===1?n[0]:
|
|
39
|
+
function t$2(...n){return chunkRAAYCPUM.u(o$4,n)}var o$4=n=>n.length===1?n[0]:undefined;
|
|
637
40
|
|
|
638
41
|
function i$3(...e){return chunkRAAYCPUM.u(o$3,e)}function o$3(e,r){let a={};for(let[n,u]of Object.entries(e)){let l=r(u,n,e);a[n]=l;}return a}
|
|
639
42
|
|
|
@@ -645,21 +48,21 @@ function l$3(...n){return chunkRAAYCPUM.u(d,n)}function d(n,o){let e={};for(let[
|
|
|
645
48
|
|
|
646
49
|
function e$1(r){return typeof r=="number"&&!Number.isNaN(r)}
|
|
647
50
|
|
|
648
|
-
function n(e){return e===
|
|
51
|
+
function n(e){return e===undefined?true:typeof e=="string"||Array.isArray(e)?e.length===0:Object.keys(e).length===0}
|
|
649
52
|
|
|
650
53
|
function e(o){return typeof o=="boolean"}
|
|
651
54
|
|
|
652
|
-
function i$2(...e){return chunkRAAYCPUM.u(p,e)}var p=(e,a)=>{let n={};for(let[d,t]of e.entries()){let y=a(t,d,e);if(y!==
|
|
55
|
+
function i$2(...e){return chunkRAAYCPUM.u(p,e)}var p=(e,a)=>{let n={};for(let[d,t]of e.entries()){let y=a(t,d,e);if(y!==undefined){let{[y]:r}=n;r===undefined&&(r=[],n[y]=r),r.push(t);}}return n};
|
|
653
56
|
|
|
654
|
-
function k(...n){return chunkRAAYCPUM.u(u$2,n)}function u$2(n,e){if(n===e||Object.is(n,e))return
|
|
57
|
+
function k(...n){return chunkRAAYCPUM.u(u$2,n)}function u$2(n,e){if(n===e||Object.is(n,e))return true;if(typeof n!="object"||typeof e!="object"||n===null||e===null||Object.getPrototypeOf(n)!==Object.getPrototypeOf(e))return false;if(Array.isArray(n))return l$2(n,e);if(n instanceof Map)return a$1(n,e);if(n instanceof Set)return c(n,e);if(n instanceof Date)return n.getTime()===e.getTime();if(n instanceof RegExp)return n.toString()===e.toString();if(Object.keys(n).length!==Object.keys(e).length)return false;for(let[r,t]of Object.entries(n))if(!(r in e)||!u$2(t,e[r]))return false;return true}function l$2(n,e){if(n.length!==e.length)return false;for(let[r,t]of n.entries())if(!u$2(t,e[r]))return false;return true}function a$1(n,e){if(n.size!==e.size)return false;for(let[r,t]of n.entries())if(!e.has(r)||!u$2(t,e.get(r)))return false;return true}function c(n,e){if(n.size!==e.size)return false;let r=[...e];for(let t of n){let o=false;for(let[s,f]of r.entries())if(u$2(t,f)){o=true,r.splice(s,1);break}if(!o)return false}return true}
|
|
655
58
|
|
|
656
|
-
function u$1(...a){return chunkRAAYCPUM.u(o$2,a,l$1)}var o$2=(a,r)=>a.flatMap(r),l$1=a=>(r,t,y)=>{let n=a(r,t,y);return Array.isArray(n)?{done
|
|
59
|
+
function u$1(...a){return chunkRAAYCPUM.u(o$2,a,l$1)}var o$2=(a,r)=>a.flatMap(r),l$1=a=>(r,t,y)=>{let n=a(r,t,y);return Array.isArray(n)?{done:false,hasNext:true,hasMany:true,next:n}:{done:false,hasNext:true,next:n}};
|
|
657
60
|
|
|
658
|
-
function u(...e){return chunkRAAYCPUM.u(o$1,e,i$1)}function o$1(e,r){return e.forEach(r),e}var i$1=e=>(r,n,t)=>(e(r,n,t),{done
|
|
61
|
+
function u(...e){return chunkRAAYCPUM.u(o$1,e,i$1)}function o$1(e,r){return e.forEach(r),e}var i$1=e=>(r,n,t)=>(e(r,n,t),{done:false,hasNext:true,next:r});
|
|
659
62
|
|
|
660
63
|
function t$1(...r){return chunkRAAYCPUM.u(Object.entries,r)}
|
|
661
64
|
|
|
662
|
-
function T(...a){return chunkRAAYCPUM.u(l,a,y)}var l=(a,e)=>a.filter(e),y=a=>(e,t,o)=>a(e,t,o)?{done
|
|
65
|
+
function T(...a){return chunkRAAYCPUM.u(l,a,y)}var l=(a,e)=>a.filter(e),y=a=>(e,t,o)=>a(e,t,o)?{done:false,hasNext:true,next:e}:object_hash.s;
|
|
663
66
|
|
|
664
67
|
function o(...e){return chunkRAAYCPUM.u(t,e)}var t=(e,r)=>{for(let n=e.length-1;n>=0;n--){let a=e[n];if(r(a,n,e))return a}};
|
|
665
68
|
|
|
@@ -957,7 +360,7 @@ function requireGraphology_umd_min () {
|
|
|
957
360
|
if (hasRequiredGraphology_umd_min) return graphology_umd_min$1.exports;
|
|
958
361
|
hasRequiredGraphology_umd_min = 1;
|
|
959
362
|
(function (module, exports) {
|
|
960
|
-
!function(t,e){module.exports=e();}(graphology_umd_min,(function(){function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,r(t,e);}function n(t){return n=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},n(t)}function r(t,e){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},r(t,e)}function i(){if("undefined"==typeof Reflect||!Reflect.construct)return !1;if(Reflect.construct.sham)return !1;if("function"==typeof Proxy)return !0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return !1}}function o(t,e,n){return o=i()?Reflect.construct.bind():function(t,e,n){var i=[null];i.push.apply(i,e);var o=new(Function.bind.apply(t,i));return n&&r(o,n.prototype),o},o.apply(null,arguments)}function a(t){var e="function"==typeof Map?new Map:void 0;return a=function(t){if(null===t||(i=t,-1===Function.toString.call(i).indexOf("[native code]")))return t;var i;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,a);}function a(){return o(t,arguments,n(this).constructor)}return a.prototype=Object.create(t.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),r(a,t)},a(t)}function c(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var u=function(){for(var t=arguments[0],e=1,n=arguments.length;e<n;e++)if(arguments[e])for(var r in arguments[e])t[r]=arguments[e][r];return t};function d(t,e,n,r){var i=t._nodes.get(e),o=null;return i?o="mixed"===r?i.out&&i.out[n]||i.undirected&&i.undirected[n]:"directed"===r?i.out&&i.out[n]:i.undirected&&i.undirected[n]:o}function s(e){return "object"===t(e)&&null!==e}function h(t){var e;for(e in t)return !1;return !0}function p(t,e,n){Object.defineProperty(t,e,{enumerable:!1,configurable:!1,writable:!0,value:n});}function f(t,e,n){var r={enumerable:!0,configurable:!0};"function"==typeof n?r.get=n:(r.value=n,r.writable=!1),Object.defineProperty(t,e,r);}function l(t){return !!s(t)&&!(t.attributes&&!Array.isArray(t.attributes))}"function"==typeof Object.assign&&(u=Object.assign);var g,y={exports:{}},w="object"==typeof Reflect?Reflect:null,v=w&&"function"==typeof w.apply?w.apply:function(t,e,n){return Function.prototype.apply.call(t,e,n)};g=w&&"function"==typeof w.ownKeys?w.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var b=Number.isNaN||function(t){return t!=t};function m(){m.init.call(this);}y.exports=m,y.exports.once=function(t,e){return new Promise((function(n,r){function i(n){t.removeListener(e,o),r(n);}function o(){"function"==typeof t.removeListener&&t.removeListener("error",i),n([].slice.call(arguments));}U(t,e,o,{once:!0}),"error"!==e&&function(t,e,n){"function"==typeof t.on&&U(t,"error",e,n);}(t,i,{once:!0});}))},m.EventEmitter=m,m.prototype._events=void 0,m.prototype._eventsCount=0,m.prototype._maxListeners=void 0;var k=10;function _(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function G(t){return void 0===t._maxListeners?m.defaultMaxListeners:t._maxListeners}function x(t,e,n,r){var i,o,a,c;if(_(n),void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,n.listener?n.listener:n),o=t._events),a=o[e]),void 0===a)a=o[e]=n,++t._eventsCount;else if("function"==typeof a?a=o[e]=r?[n,a]:[a,n]:r?a.unshift(n):a.push(n),(i=G(t))>0&&a.length>i&&!a.warned){a.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=t,u.type=e,u.count=a.length,c=u,console&&console.warn&&console.warn(c);}return t}function E(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function A(t,e,n){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},i=E.bind(r);return i.listener=n,r.wrapFn=i,i}function L(t,e,n){var r=t._events;if(void 0===r)return [];var i=r[e];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(t){for(var e=new Array(t.length),n=0;n<e.length;++n)e[n]=t[n].listener||t[n];return e}(i):D(i,i.length)}function S(t){var e=this._events;if(void 0!==e){var n=e[t];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function D(t,e){for(var n=new Array(e),r=0;r<e;++r)n[r]=t[r];return n}function U(t,e,n,r){if("function"==typeof t.on)r.once?t.once(e,n):t.on(e,n);else {if("function"!=typeof t.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t);t.addEventListener(e,(function i(o){r.once&&t.removeEventListener(e,i),n(o);}));}}function N(t){if("function"!=typeof t)throw new Error("obliterator/iterator: expecting a function!");this.next=t;}Object.defineProperty(m,"defaultMaxListeners",{enumerable:!0,get:function(){return k},set:function(t){if("number"!=typeof t||t<0||b(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");k=t;}}),m.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0;},m.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||b(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},m.prototype.getMaxListeners=function(){return G(this)},m.prototype.emit=function(t){for(var e=[],n=1;n<arguments.length;n++)e.push(arguments[n]);var r="error"===t,i=this._events;if(void 0!==i)r=r&&void 0===i.error;else if(!r)return !1;if(r){var o;if(e.length>0&&(o=e[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var c=i[t];if(void 0===c)return !1;if("function"==typeof c)v(c,this,e);else {var u=c.length,d=D(c,u);for(n=0;n<u;++n)v(d[n],this,e);}return !0},m.prototype.addListener=function(t,e){return x(this,t,e,!1)},m.prototype.on=m.prototype.addListener,m.prototype.prependListener=function(t,e){return x(this,t,e,!0)},m.prototype.once=function(t,e){return _(e),this.on(t,A(this,t,e)),this},m.prototype.prependOnceListener=function(t,e){return _(e),this.prependListener(t,A(this,t,e)),this},m.prototype.removeListener=function(t,e){var n,r,i,o,a;if(_(e),void 0===(r=this._events))return this;if(void 0===(n=r[t]))return this;if(n===e||n.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete r[t],r.removeListener&&this.emit("removeListener",t,n.listener||e));else if("function"!=typeof n){for(i=-1,o=n.length-1;o>=0;o--)if(n[o]===e||n[o].listener===e){a=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop();}(n,i),1===n.length&&(r[t]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",t,a||e);}return this},m.prototype.off=m.prototype.removeListener,m.prototype.removeAllListeners=function(t){var e,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[t]),this;if(0===arguments.length){var i,o=Object.keys(n);for(r=0;r<o.length;++r)"removeListener"!==(i=o[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=n[t]))this.removeListener(t,e);else if(void 0!==e)for(r=e.length-1;r>=0;r--)this.removeListener(t,e[r]);return this},m.prototype.listeners=function(t){return L(this,t,!0)},m.prototype.rawListeners=function(t){return L(this,t,!1)},m.listenerCount=function(t,e){return "function"==typeof t.listenerCount?t.listenerCount(e):S.call(t,e)},m.prototype.listenerCount=S,m.prototype.eventNames=function(){return this._eventsCount>0?g(this._events):[]},"undefined"!=typeof Symbol&&(N.prototype[Symbol.iterator]=function(){return this}),N.of=function(){var t=arguments,e=t.length,n=0;return new N((function(){return n>=e?{done:!0}:{done:!1,value:t[n++]}}))},N.empty=function(){return new N((function(){return {done:!0}}))},N.fromSequence=function(t){var e=0,n=t.length;return new N((function(){return e>=n?{done:!0}:{done:!1,value:t[e++]}}))},N.is=function(t){return t instanceof N||"object"==typeof t&&null!==t&&"function"==typeof t.next};var O=N,j={};j.ARRAY_BUFFER_SUPPORT="undefined"!=typeof ArrayBuffer,j.SYMBOL_SUPPORT="undefined"!=typeof Symbol;var C=O,M=j,z=M.ARRAY_BUFFER_SUPPORT,W=M.SYMBOL_SUPPORT;var P=function(t){var e=function(t){return "string"==typeof t||Array.isArray(t)||z&&ArrayBuffer.isView(t)?C.fromSequence(t):"object"!=typeof t||null===t?null:W&&"function"==typeof t[Symbol.iterator]?t[Symbol.iterator]():"function"==typeof t.next?t:null}(t);if(!e)throw new Error("obliterator: target is not iterable nor a valid iterator.");return e},R=P,K=function(t,e){for(var n,r=arguments.length>1?e:1/0,i=r!==1/0?new Array(r):[],o=0,a=R(t);;){if(o===r)return i;if((n=a.next()).done)return o!==e&&(i.length=o),i;i[o++]=n.value;}},T=function(t){function n(e){var n;return (n=t.call(this)||this).name="GraphError",n.message=e,n}return e(n,t),n}(a(Error)),B=function(t){function n(e){var r;return (r=t.call(this,e)||this).name="InvalidArgumentsGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(c(r),n.prototype.constructor),r}return e(n,t),n}(T),F=function(t){function n(e){var r;return (r=t.call(this,e)||this).name="NotFoundGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(c(r),n.prototype.constructor),r}return e(n,t),n}(T),I=function(t){function n(e){var r;return (r=t.call(this,e)||this).name="UsageGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(c(r),n.prototype.constructor),r}return e(n,t),n}(T);function Y(t,e){this.key=t,this.attributes=e,this.clear();}function q(t,e){this.key=t,this.attributes=e,this.clear();}function J(t,e){this.key=t,this.attributes=e,this.clear();}function V(t,e,n,r,i){this.key=e,this.attributes=i,this.undirected=t,this.source=n,this.target=r;}Y.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.undirectedLoops=0,this.directedLoops=0,this.in={},this.out={},this.undirected={};},q.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.directedLoops=0,this.in={},this.out={};},J.prototype.clear=function(){this.undirectedDegree=0,this.undirectedLoops=0,this.undirected={};},V.prototype.attach=function(){var t="out",e="in";this.undirected&&(t=e="undirected");var n=this.source.key,r=this.target.key;this.source[t][r]=this,this.undirected&&n===r||(this.target[e][n]=this);},V.prototype.attachMulti=function(){var t="out",e="in",n=this.source.key,r=this.target.key;this.undirected&&(t=e="undirected");var i=this.source[t],o=i[r];if(void 0===o)return i[r]=this,void(this.undirected&&n===r||(this.target[e][n]=this));o.previous=this,this.next=o,i[r]=this,this.target[e][n]=this;},V.prototype.detach=function(){var t=this.source.key,e=this.target.key,n="out",r="in";this.undirected&&(n=r="undirected"),delete this.source[n][e],delete this.target[r][t];},V.prototype.detachMulti=function(){var t=this.source.key,e=this.target.key,n="out",r="in";this.undirected&&(n=r="undirected"),void 0===this.previous?void 0===this.next?(delete this.source[n][e],delete this.target[r][t]):(this.next.previous=void 0,this.source[n][e]=this.next,this.target[r][t]=this.next):(this.previous.next=this.next,void 0!==this.next&&(this.next.previous=this.previous));};function H(t,e,n,r,i,o,a){var c,u,d,s;if(r=""+r,0===n){if(!(c=t._nodes.get(r)))throw new F("Graph.".concat(e,': could not find the "').concat(r,'" node in the graph.'));d=i,s=o;}else if(3===n){if(i=""+i,!(u=t._edges.get(i)))throw new F("Graph.".concat(e,': could not find the "').concat(i,'" edge in the graph.'));var h=u.source.key,p=u.target.key;if(r===h)c=u.target;else {if(r!==p)throw new F("Graph.".concat(e,': the "').concat(r,'" node is not attached to the "').concat(i,'" edge (').concat(h,", ").concat(p,")."));c=u.source;}d=o,s=a;}else {if(!(u=t._edges.get(r)))throw new F("Graph.".concat(e,': could not find the "').concat(r,'" edge in the graph.'));c=1===n?u.source:u.target,d=i,s=o;}return [c,d,s]}var Q=[{name:function(t){return "get".concat(t,"Attribute")},attacher:function(t,e,n){t.prototype[e]=function(t,r,i){var o=H(this,e,n,t,r,i),a=o[0],c=o[1];return a.attributes[c]};}},{name:function(t){return "get".concat(t,"Attributes")},attacher:function(t,e,n){t.prototype[e]=function(t,r){return H(this,e,n,t,r)[0].attributes};}},{name:function(t){return "has".concat(t,"Attribute")},attacher:function(t,e,n){t.prototype[e]=function(t,r,i){var o=H(this,e,n,t,r,i),a=o[0],c=o[1];return a.attributes.hasOwnProperty(c)};}},{name:function(t){return "set".concat(t,"Attribute")},attacher:function(t,e,n){t.prototype[e]=function(t,r,i,o){var a=H(this,e,n,t,r,i,o),c=a[0],u=a[1],d=a[2];return c.attributes[u]=d,this.emit("nodeAttributesUpdated",{key:c.key,type:"set",attributes:c.attributes,name:u}),this};}},{name:function(t){return "update".concat(t,"Attribute")},attacher:function(t,e,n){t.prototype[e]=function(t,r,i,o){var a=H(this,e,n,t,r,i,o),c=a[0],u=a[1],d=a[2];if("function"!=typeof d)throw new B("Graph.".concat(e,": updater should be a function."));var s=c.attributes,h=d(s[u]);return s[u]=h,this.emit("nodeAttributesUpdated",{key:c.key,type:"set",attributes:c.attributes,name:u}),this};}},{name:function(t){return "remove".concat(t,"Attribute")},attacher:function(t,e,n){t.prototype[e]=function(t,r,i){var o=H(this,e,n,t,r,i),a=o[0],c=o[1];return delete a.attributes[c],this.emit("nodeAttributesUpdated",{key:a.key,type:"remove",attributes:a.attributes,name:c}),this};}},{name:function(t){return "replace".concat(t,"Attributes")},attacher:function(t,e,n){t.prototype[e]=function(t,r,i){var o=H(this,e,n,t,r,i),a=o[0],c=o[1];if(!s(c))throw new B("Graph.".concat(e,": provided attributes are not a plain object."));return a.attributes=c,this.emit("nodeAttributesUpdated",{key:a.key,type:"replace",attributes:a.attributes}),this};}},{name:function(t){return "merge".concat(t,"Attributes")},attacher:function(t,e,n){t.prototype[e]=function(t,r,i){var o=H(this,e,n,t,r,i),a=o[0],c=o[1];if(!s(c))throw new B("Graph.".concat(e,": provided attributes are not a plain object."));return u(a.attributes,c),this.emit("nodeAttributesUpdated",{key:a.key,type:"merge",attributes:a.attributes,data:c}),this};}},{name:function(t){return "update".concat(t,"Attributes")},attacher:function(t,e,n){t.prototype[e]=function(t,r,i){var o=H(this,e,n,t,r,i),a=o[0],c=o[1];if("function"!=typeof c)throw new B("Graph.".concat(e,": provided updater is not a function."));return a.attributes=c(a.attributes),this.emit("nodeAttributesUpdated",{key:a.key,type:"update",attributes:a.attributes}),this};}}];var X=[{name:function(t){return "get".concat(t,"Attribute")},attacher:function(t,e,n){t.prototype[e]=function(t,r){var i;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new I("Graph.".concat(e,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new I("Graph.".concat(e,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+t,a=""+r;if(r=arguments[2],!(i=d(this,o,a,n)))throw new F("Graph.".concat(e,': could not find an edge for the given path ("').concat(o,'" - "').concat(a,'").'))}else {if("mixed"!==n)throw new I("Graph.".concat(e,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(t=""+t,!(i=this._edges.get(t)))throw new F("Graph.".concat(e,': could not find the "').concat(t,'" edge in the graph.'))}return i.attributes[r]};}},{name:function(t){return "get".concat(t,"Attributes")},attacher:function(t,e,n){t.prototype[e]=function(t){var r;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new I("Graph.".concat(e,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>1){if(this.multi)throw new I("Graph.".concat(e,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var i=""+t,o=""+arguments[1];if(!(r=d(this,i,o,n)))throw new F("Graph.".concat(e,': could not find an edge for the given path ("').concat(i,'" - "').concat(o,'").'))}else {if("mixed"!==n)throw new I("Graph.".concat(e,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(t=""+t,!(r=this._edges.get(t)))throw new F("Graph.".concat(e,': could not find the "').concat(t,'" edge in the graph.'))}return r.attributes};}},{name:function(t){return "has".concat(t,"Attribute")},attacher:function(t,e,n){t.prototype[e]=function(t,r){var i;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new I("Graph.".concat(e,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new I("Graph.".concat(e,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+t,a=""+r;if(r=arguments[2],!(i=d(this,o,a,n)))throw new F("Graph.".concat(e,': could not find an edge for the given path ("').concat(o,'" - "').concat(a,'").'))}else {if("mixed"!==n)throw new I("Graph.".concat(e,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(t=""+t,!(i=this._edges.get(t)))throw new F("Graph.".concat(e,': could not find the "').concat(t,'" edge in the graph.'))}return i.attributes.hasOwnProperty(r)};}},{name:function(t){return "set".concat(t,"Attribute")},attacher:function(t,e,n){t.prototype[e]=function(t,r,i){var o;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new I("Graph.".concat(e,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new I("Graph.".concat(e,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var a=""+t,c=""+r;if(r=arguments[2],i=arguments[3],!(o=d(this,a,c,n)))throw new F("Graph.".concat(e,': could not find an edge for the given path ("').concat(a,'" - "').concat(c,'").'))}else {if("mixed"!==n)throw new I("Graph.".concat(e,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(t=""+t,!(o=this._edges.get(t)))throw new F("Graph.".concat(e,': could not find the "').concat(t,'" edge in the graph.'))}return o.attributes[r]=i,this.emit("edgeAttributesUpdated",{key:o.key,type:"set",attributes:o.attributes,name:r}),this};}},{name:function(t){return "update".concat(t,"Attribute")},attacher:function(t,e,n){t.prototype[e]=function(t,r,i){var o;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new I("Graph.".concat(e,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new I("Graph.".concat(e,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var a=""+t,c=""+r;if(r=arguments[2],i=arguments[3],!(o=d(this,a,c,n)))throw new F("Graph.".concat(e,': could not find an edge for the given path ("').concat(a,'" - "').concat(c,'").'))}else {if("mixed"!==n)throw new I("Graph.".concat(e,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(t=""+t,!(o=this._edges.get(t)))throw new F("Graph.".concat(e,': could not find the "').concat(t,'" edge in the graph.'))}if("function"!=typeof i)throw new B("Graph.".concat(e,": updater should be a function."));return o.attributes[r]=i(o.attributes[r]),this.emit("edgeAttributesUpdated",{key:o.key,type:"set",attributes:o.attributes,name:r}),this};}},{name:function(t){return "remove".concat(t,"Attribute")},attacher:function(t,e,n){t.prototype[e]=function(t,r){var i;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new I("Graph.".concat(e,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new I("Graph.".concat(e,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+t,a=""+r;if(r=arguments[2],!(i=d(this,o,a,n)))throw new F("Graph.".concat(e,': could not find an edge for the given path ("').concat(o,'" - "').concat(a,'").'))}else {if("mixed"!==n)throw new I("Graph.".concat(e,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(t=""+t,!(i=this._edges.get(t)))throw new F("Graph.".concat(e,': could not find the "').concat(t,'" edge in the graph.'))}return delete i.attributes[r],this.emit("edgeAttributesUpdated",{key:i.key,type:"remove",attributes:i.attributes,name:r}),this};}},{name:function(t){return "replace".concat(t,"Attributes")},attacher:function(t,e,n){t.prototype[e]=function(t,r){var i;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new I("Graph.".concat(e,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new I("Graph.".concat(e,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+t,a=""+r;if(r=arguments[2],!(i=d(this,o,a,n)))throw new F("Graph.".concat(e,': could not find an edge for the given path ("').concat(o,'" - "').concat(a,'").'))}else {if("mixed"!==n)throw new I("Graph.".concat(e,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(t=""+t,!(i=this._edges.get(t)))throw new F("Graph.".concat(e,': could not find the "').concat(t,'" edge in the graph.'))}if(!s(r))throw new B("Graph.".concat(e,": provided attributes are not a plain object."));return i.attributes=r,this.emit("edgeAttributesUpdated",{key:i.key,type:"replace",attributes:i.attributes}),this};}},{name:function(t){return "merge".concat(t,"Attributes")},attacher:function(t,e,n){t.prototype[e]=function(t,r){var i;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new I("Graph.".concat(e,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new I("Graph.".concat(e,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+t,a=""+r;if(r=arguments[2],!(i=d(this,o,a,n)))throw new F("Graph.".concat(e,': could not find an edge for the given path ("').concat(o,'" - "').concat(a,'").'))}else {if("mixed"!==n)throw new I("Graph.".concat(e,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(t=""+t,!(i=this._edges.get(t)))throw new F("Graph.".concat(e,': could not find the "').concat(t,'" edge in the graph.'))}if(!s(r))throw new B("Graph.".concat(e,": provided attributes are not a plain object."));return u(i.attributes,r),this.emit("edgeAttributesUpdated",{key:i.key,type:"merge",attributes:i.attributes,data:r}),this};}},{name:function(t){return "update".concat(t,"Attributes")},attacher:function(t,e,n){t.prototype[e]=function(t,r){var i;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new I("Graph.".concat(e,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new I("Graph.".concat(e,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+t,a=""+r;if(r=arguments[2],!(i=d(this,o,a,n)))throw new F("Graph.".concat(e,': could not find an edge for the given path ("').concat(o,'" - "').concat(a,'").'))}else {if("mixed"!==n)throw new I("Graph.".concat(e,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(t=""+t,!(i=this._edges.get(t)))throw new F("Graph.".concat(e,': could not find the "').concat(t,'" edge in the graph.'))}if("function"!=typeof r)throw new B("Graph.".concat(e,": provided updater is not a function."));return i.attributes=r(i.attributes),this.emit("edgeAttributesUpdated",{key:i.key,type:"update",attributes:i.attributes}),this};}}];var Z=O,$=P,tt=function(){var t=arguments,e=null,n=-1;return new Z((function(){for(var r=null;;){if(null===e){if(++n>=t.length)return {done:!0};e=$(t[n]);}if(!0!==(r=e.next()).done)break;e=null;}return r}))},et=[{name:"edges",type:"mixed"},{name:"inEdges",type:"directed",direction:"in"},{name:"outEdges",type:"directed",direction:"out"},{name:"inboundEdges",type:"mixed",direction:"in"},{name:"outboundEdges",type:"mixed",direction:"out"},{name:"directedEdges",type:"directed"},{name:"undirectedEdges",type:"undirected"}];function nt(t,e,n,r){var i=!1;for(var o in e)if(o!==r){var a=e[o];if(i=n(a.key,a.attributes,a.source.key,a.target.key,a.source.attributes,a.target.attributes,a.undirected),t&&i)return a.key}}function rt(t,e,n,r){var i,o,a,c=!1;for(var u in e)if(u!==r){i=e[u];do{if(o=i.source,a=i.target,c=n(i.key,i.attributes,o.key,a.key,o.attributes,a.attributes,i.undirected),t&&c)return i.key;i=i.next;}while(void 0!==i)}}function it(t,e){var n,r=Object.keys(t),i=r.length,o=0;return new O((function(){do{if(n)n=n.next;else {if(o>=i)return {done:!0};var a=r[o++];if(a===e){n=void 0;continue}n=t[a];}}while(!n);return {done:!1,value:{edge:n.key,attributes:n.attributes,source:n.source.key,target:n.target.key,sourceAttributes:n.source.attributes,targetAttributes:n.target.attributes,undirected:n.undirected}}}))}function ot(t,e,n,r){var i=e[n];if(i){var o=i.source,a=i.target;return r(i.key,i.attributes,o.key,a.key,o.attributes,a.attributes,i.undirected)&&t?i.key:void 0}}function at(t,e,n,r){var i=e[n];if(i){var o=!1;do{if(o=r(i.key,i.attributes,i.source.key,i.target.key,i.source.attributes,i.target.attributes,i.undirected),t&&o)return i.key;i=i.next;}while(void 0!==i)}}function ct(t,e){var n=t[e];return void 0!==n.next?new O((function(){if(!n)return {done:!0};var t={edge:n.key,attributes:n.attributes,source:n.source.key,target:n.target.key,sourceAttributes:n.source.attributes,targetAttributes:n.target.attributes,undirected:n.undirected};return n=n.next,{done:!1,value:t}})):O.of({edge:n.key,attributes:n.attributes,source:n.source.key,target:n.target.key,sourceAttributes:n.source.attributes,targetAttributes:n.target.attributes,undirected:n.undirected})}function ut(t,e){if(0===t.size)return [];if("mixed"===e||e===t.type)return "function"==typeof Array.from?Array.from(t._edges.keys()):K(t._edges.keys(),t._edges.size);for(var n,r,i="undirected"===e?t.undirectedSize:t.directedSize,o=new Array(i),a="undirected"===e,c=t._edges.values(),u=0;!0!==(n=c.next()).done;)(r=n.value).undirected===a&&(o[u++]=r.key);return o}function dt(t,e,n,r){if(0!==e.size)for(var i,o,a="mixed"!==n&&n!==e.type,c="undirected"===n,u=!1,d=e._edges.values();!0!==(i=d.next()).done;)if(o=i.value,!a||o.undirected===c){var s=o,h=s.key,p=s.attributes,f=s.source,l=s.target;if(u=r(h,p,f.key,l.key,f.attributes,l.attributes,o.undirected),t&&u)return h}}function st(t,e){if(0===t.size)return O.empty();var n="mixed"!==e&&e!==t.type,r="undirected"===e,i=t._edges.values();return new O((function(){for(var t,e;;){if((t=i.next()).done)return t;if(e=t.value,!n||e.undirected===r)break}return {value:{edge:e.key,attributes:e.attributes,source:e.source.key,target:e.target.key,sourceAttributes:e.source.attributes,targetAttributes:e.target.attributes,undirected:e.undirected},done:!1}}))}function ht(t,e,n,r,i,o){var a,c=e?rt:nt;if("undirected"!==n){if("out"!==r&&(a=c(t,i.in,o),t&&a))return a;if("in"!==r&&(a=c(t,i.out,o,r?void 0:i.key),t&&a))return a}if("directed"!==n&&(a=c(t,i.undirected,o),t&&a))return a}function pt(t,e,n,r){var i=[];return ht(!1,t,e,n,r,(function(t){i.push(t);})),i}function ft(t,e,n){var r=O.empty();return "undirected"!==t&&("out"!==e&&void 0!==n.in&&(r=tt(r,it(n.in))),"in"!==e&&void 0!==n.out&&(r=tt(r,it(n.out,e?void 0:n.key)))),"directed"!==t&&void 0!==n.undirected&&(r=tt(r,it(n.undirected))),r}function lt(t,e,n,r,i,o,a){var c,u=n?at:ot;if("undirected"!==e){if(void 0!==i.in&&"out"!==r&&(c=u(t,i.in,o,a),t&&c))return c;if(void 0!==i.out&&"in"!==r&&(r||i.key!==o)&&(c=u(t,i.out,o,a),t&&c))return c}if("directed"!==e&&void 0!==i.undirected&&(c=u(t,i.undirected,o,a),t&&c))return c}function gt(t,e,n,r,i){var o=[];return lt(!1,t,e,n,r,i,(function(t){o.push(t);})),o}function yt(t,e,n,r){var i=O.empty();return "undirected"!==t&&(void 0!==n.in&&"out"!==e&&r in n.in&&(i=tt(i,ct(n.in,r))),void 0!==n.out&&"in"!==e&&r in n.out&&(e||n.key!==r)&&(i=tt(i,ct(n.out,r)))),"directed"!==t&&void 0!==n.undirected&&r in n.undirected&&(i=tt(i,ct(n.undirected,r))),i}var wt=[{name:"neighbors",type:"mixed"},{name:"inNeighbors",type:"directed",direction:"in"},{name:"outNeighbors",type:"directed",direction:"out"},{name:"inboundNeighbors",type:"mixed",direction:"in"},{name:"outboundNeighbors",type:"mixed",direction:"out"},{name:"directedNeighbors",type:"directed"},{name:"undirectedNeighbors",type:"undirected"}];function vt(){this.A=null,this.B=null;}function bt(t,e,n,r,i){for(var o in r){var a=r[o],c=a.source,u=a.target,d=c===n?u:c;if(!e||!e.has(d.key)){var s=i(d.key,d.attributes);if(t&&s)return d.key}}}function mt(t,e,n,r,i){if("mixed"!==e){if("undirected"===e)return bt(t,null,r,r.undirected,i);if("string"==typeof n)return bt(t,null,r,r[n],i)}var o,a=new vt;if("undirected"!==e){if("out"!==n){if(o=bt(t,null,r,r.in,i),t&&o)return o;a.wrap(r.in);}if("in"!==n){if(o=bt(t,a,r,r.out,i),t&&o)return o;a.wrap(r.out);}}if("directed"!==e&&(o=bt(t,a,r,r.undirected,i),t&&o))return o}function kt(t,e,n){var r=Object.keys(n),i=r.length,o=0;return new O((function(){var a=null;do{if(o>=i)return t&&t.wrap(n),{done:!0};var c=n[r[o++]],u=c.source,d=c.target;a=u===e?d:u,t&&t.has(a.key)&&(a=null);}while(null===a);return {done:!1,value:{neighbor:a.key,attributes:a.attributes}}}))}function _t(t,e){var n=e.name,r=e.type,i=e.direction;t.prototype[n]=function(t){if("mixed"!==r&&"mixed"!==this.type&&r!==this.type)return [];t=""+t;var e=this._nodes.get(t);if(void 0===e)throw new F("Graph.".concat(n,': could not find the "').concat(t,'" node in the graph.'));return function(t,e,n){if("mixed"!==t){if("undirected"===t)return Object.keys(n.undirected);if("string"==typeof e)return Object.keys(n[e])}var r=[];return mt(!1,t,e,n,(function(t){r.push(t);})),r}("mixed"===r?this.type:r,i,e)};}function Gt(t,e){var n=e.name,r=e.type,i=e.direction,o=n.slice(0,-1)+"Entries";t.prototype[o]=function(t){if("mixed"!==r&&"mixed"!==this.type&&r!==this.type)return O.empty();t=""+t;var e=this._nodes.get(t);if(void 0===e)throw new F("Graph.".concat(o,': could not find the "').concat(t,'" node in the graph.'));return function(t,e,n){if("mixed"!==t){if("undirected"===t)return kt(null,n,n.undirected);if("string"==typeof e)return kt(null,n,n[e])}var r=O.empty(),i=new vt;return "undirected"!==t&&("out"!==e&&(r=tt(r,kt(i,n,n.in))),"in"!==e&&(r=tt(r,kt(i,n,n.out)))),"directed"!==t&&(r=tt(r,kt(i,n,n.undirected))),r}("mixed"===r?this.type:r,i,e)};}function xt(t,e,n,r,i){for(var o,a,c,u,d,s,h,p=r._nodes.values(),f=r.type;!0!==(o=p.next()).done;){var l=!1;if(a=o.value,"undirected"!==f)for(c in u=a.out){d=u[c];do{if(s=d.target,l=!0,h=i(a.key,s.key,a.attributes,s.attributes,d.key,d.attributes,d.undirected),t);d=d.next;}while(d)}if("directed"!==f)for(c in u=a.undirected)if(!(e&&a.key>c)){d=u[c];do{if((s=d.target).key!==c&&(s=d.source),l=!0,h=i(a.key,s.key,a.attributes,s.attributes,d.key,d.attributes,d.undirected),t);d=d.next;}while(d)}if(n&&!l&&(h=i(a.key,null,a.attributes,null,null,null,null),t));}}function Et(t){if(!s(t))throw new B('Graph.import: invalid serialized node. A serialized node should be a plain object with at least a "key" property.');if(!("key"in t))throw new B("Graph.import: serialized node is missing its key.");if("attributes"in t&&(!s(t.attributes)||null===t.attributes))throw new B("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.")}function At(t){if(!s(t))throw new B('Graph.import: invalid serialized edge. A serialized edge should be a plain object with at least a "source" & "target" property.');if(!("source"in t))throw new B("Graph.import: serialized edge is missing its source.");if(!("target"in t))throw new B("Graph.import: serialized edge is missing its target.");if("attributes"in t&&(!s(t.attributes)||null===t.attributes))throw new B("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.");if("undirected"in t&&"boolean"!=typeof t.undirected)throw new B("Graph.import: invalid undirectedness information. Undirected should be boolean or omitted.")}vt.prototype.wrap=function(t){null===this.A?this.A=t:null===this.B&&(this.B=t);},vt.prototype.has=function(t){return null!==this.A&&t in this.A||null!==this.B&&t in this.B};var Lt,St=(Lt=255&Math.floor(256*Math.random()),function(){return Lt++}),Dt=new Set(["directed","undirected","mixed"]),Ut=new Set(["domain","_events","_eventsCount","_maxListeners"]),Nt={allowSelfLoops:!0,multi:!1,type:"mixed"};function Ot(t,e,n){var r=new t.NodeDataClass(e,n);return t._nodes.set(e,r),t.emit("nodeAdded",{key:e,attributes:n}),r}function jt(t,e,n,r,i,o,a,c){if(!r&&"undirected"===t.type)throw new I("Graph.".concat(e,": you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead."));if(r&&"directed"===t.type)throw new I("Graph.".concat(e,": you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead."));if(c&&!s(c))throw new B("Graph.".concat(e,': invalid attributes. Expecting an object but got "').concat(c,'"'));if(o=""+o,a=""+a,c=c||{},!t.allowSelfLoops&&o===a)throw new I("Graph.".concat(e,': source & target are the same ("').concat(o,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var u=t._nodes.get(o),d=t._nodes.get(a);if(!u)throw new F("Graph.".concat(e,': source node "').concat(o,'" not found.'));if(!d)throw new F("Graph.".concat(e,': target node "').concat(a,'" not found.'));var h={key:null,undirected:r,source:o,target:a,attributes:c};if(n)i=t._edgeKeyGenerator();else if(i=""+i,t._edges.has(i))throw new I("Graph.".concat(e,': the "').concat(i,'" edge already exists in the graph.'));if(!t.multi&&(r?void 0!==u.undirected[a]:void 0!==u.out[a]))throw new I("Graph.".concat(e,': an edge linking "').concat(o,'" to "').concat(a,"\" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option."));var p=new V(r,i,u,d,c);t._edges.set(i,p);var f=o===a;return r?(u.undirectedDegree++,d.undirectedDegree++,f&&(u.undirectedLoops++,t._undirectedSelfLoopCount++)):(u.outDegree++,d.inDegree++,f&&(u.directedLoops++,t._directedSelfLoopCount++)),t.multi?p.attachMulti():p.attach(),r?t._undirectedSize++:t._directedSize++,h.key=i,t.emit("edgeAdded",h),i}function Ct(t,e,n,r,i,o,a,c,d){if(!r&&"undirected"===t.type)throw new I("Graph.".concat(e,": you cannot merge/update a directed edge to an undirected graph. Use the #.mergeEdge/#.updateEdge or #.addUndirectedEdge instead."));if(r&&"directed"===t.type)throw new I("Graph.".concat(e,": you cannot merge/update an undirected edge to a directed graph. Use the #.mergeEdge/#.updateEdge or #.addDirectedEdge instead."));if(c)if(d){if("function"!=typeof c)throw new B("Graph.".concat(e,': invalid updater function. Expecting a function but got "').concat(c,'"'))}else if(!s(c))throw new B("Graph.".concat(e,': invalid attributes. Expecting an object but got "').concat(c,'"'));var h;if(o=""+o,a=""+a,d&&(h=c,c=void 0),!t.allowSelfLoops&&o===a)throw new I("Graph.".concat(e,': source & target are the same ("').concat(o,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var p,f,l=t._nodes.get(o),g=t._nodes.get(a);if(!n&&(p=t._edges.get(i))){if(!(p.source.key===o&&p.target.key===a||r&&p.source.key===a&&p.target.key===o))throw new I("Graph.".concat(e,': inconsistency detected when attempting to merge the "').concat(i,'" edge with "').concat(o,'" source & "').concat(a,'" target vs. ("').concat(p.source.key,'", "').concat(p.target.key,'").'));f=p;}if(f||t.multi||!l||(f=r?l.undirected[a]:l.out[a]),f){var y=[f.key,!1,!1,!1];if(d?!h:!c)return y;if(d){var w=f.attributes;f.attributes=h(w),t.emit("edgeAttributesUpdated",{type:"replace",key:f.key,attributes:f.attributes});}else u(f.attributes,c),t.emit("edgeAttributesUpdated",{type:"merge",key:f.key,attributes:f.attributes,data:c});return y}c=c||{},d&&h&&(c=h(c));var v={key:null,undirected:r,source:o,target:a,attributes:c};if(n)i=t._edgeKeyGenerator();else if(i=""+i,t._edges.has(i))throw new I("Graph.".concat(e,': the "').concat(i,'" edge already exists in the graph.'));var b=!1,m=!1;l||(l=Ot(t,o,{}),b=!0,o===a&&(g=l,m=!0)),g||(g=Ot(t,a,{}),m=!0),p=new V(r,i,l,g,c),t._edges.set(i,p);var k=o===a;return r?(l.undirectedDegree++,g.undirectedDegree++,k&&(l.undirectedLoops++,t._undirectedSelfLoopCount++)):(l.outDegree++,g.inDegree++,k&&(l.directedLoops++,t._directedSelfLoopCount++)),t.multi?p.attachMulti():p.attach(),r?t._undirectedSize++:t._directedSize++,v.key=i,t.emit("edgeAdded",v),[i,!0,b,m]}function Mt(t,e){t._edges.delete(e.key);var n=e.source,r=e.target,i=e.attributes,o=e.undirected,a=n===r;o?(n.undirectedDegree--,r.undirectedDegree--,a&&(n.undirectedLoops--,t._undirectedSelfLoopCount--)):(n.outDegree--,r.inDegree--,a&&(n.directedLoops--,t._directedSelfLoopCount--)),t.multi?e.detachMulti():e.detach(),o?t._undirectedSize--:t._directedSize--,t.emit("edgeDropped",{key:e.key,attributes:i,source:n.key,target:r.key,undirected:o});}var zt=function(n){function r(t){var e;if(e=n.call(this)||this,"boolean"!=typeof(t=u({},Nt,t)).multi)throw new B("Graph.constructor: invalid 'multi' option. Expecting a boolean but got \"".concat(t.multi,'".'));if(!Dt.has(t.type))throw new B('Graph.constructor: invalid \'type\' option. Should be one of "mixed", "directed" or "undirected" but got "'.concat(t.type,'".'));if("boolean"!=typeof t.allowSelfLoops)throw new B("Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got \"".concat(t.allowSelfLoops,'".'));var r="mixed"===t.type?Y:"directed"===t.type?q:J;p(c(e),"NodeDataClass",r);var i="geid_"+St()+"_",o=0;return p(c(e),"_attributes",{}),p(c(e),"_nodes",new Map),p(c(e),"_edges",new Map),p(c(e),"_directedSize",0),p(c(e),"_undirectedSize",0),p(c(e),"_directedSelfLoopCount",0),p(c(e),"_undirectedSelfLoopCount",0),p(c(e),"_edgeKeyGenerator",(function(){var t;do{t=i+o++;}while(e._edges.has(t));return t})),p(c(e),"_options",t),Ut.forEach((function(t){return p(c(e),t,e[t])})),f(c(e),"order",(function(){return e._nodes.size})),f(c(e),"size",(function(){return e._edges.size})),f(c(e),"directedSize",(function(){return e._directedSize})),f(c(e),"undirectedSize",(function(){return e._undirectedSize})),f(c(e),"selfLoopCount",(function(){return e._directedSelfLoopCount+e._undirectedSelfLoopCount})),f(c(e),"directedSelfLoopCount",(function(){return e._directedSelfLoopCount})),f(c(e),"undirectedSelfLoopCount",(function(){return e._undirectedSelfLoopCount})),f(c(e),"multi",e._options.multi),f(c(e),"type",e._options.type),f(c(e),"allowSelfLoops",e._options.allowSelfLoops),f(c(e),"implementation",(function(){return "graphology"})),e}e(r,n);var i=r.prototype;return i._resetInstanceCounters=function(){this._directedSize=0,this._undirectedSize=0,this._directedSelfLoopCount=0,this._undirectedSelfLoopCount=0;},i.hasNode=function(t){return this._nodes.has(""+t)},i.hasDirectedEdge=function(t,e){if("undirected"===this.type)return !1;if(1===arguments.length){var n=""+t,r=this._edges.get(n);return !!r&&!r.undirected}if(2===arguments.length){t=""+t,e=""+e;var i=this._nodes.get(t);return !!i&&i.out.hasOwnProperty(e)}throw new B("Graph.hasDirectedEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},i.hasUndirectedEdge=function(t,e){if("directed"===this.type)return !1;if(1===arguments.length){var n=""+t,r=this._edges.get(n);return !!r&&r.undirected}if(2===arguments.length){t=""+t,e=""+e;var i=this._nodes.get(t);return !!i&&i.undirected.hasOwnProperty(e)}throw new B("Graph.hasDirectedEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},i.hasEdge=function(t,e){if(1===arguments.length){var n=""+t;return this._edges.has(n)}if(2===arguments.length){t=""+t,e=""+e;var r=this._nodes.get(t);return !!r&&(void 0!==r.out&&r.out.hasOwnProperty(e)||void 0!==r.undirected&&r.undirected.hasOwnProperty(e))}throw new B("Graph.hasEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},i.directedEdge=function(t,e){if("undirected"!==this.type){if(t=""+t,e=""+e,this.multi)throw new I("Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.");var n=this._nodes.get(t);if(!n)throw new F('Graph.directedEdge: could not find the "'.concat(t,'" source node in the graph.'));if(!this._nodes.has(e))throw new F('Graph.directedEdge: could not find the "'.concat(e,'" target node in the graph.'));var r=n.out&&n.out[e]||void 0;return r?r.key:void 0}},i.undirectedEdge=function(t,e){if("directed"!==this.type){if(t=""+t,e=""+e,this.multi)throw new I("Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.");var n=this._nodes.get(t);if(!n)throw new F('Graph.undirectedEdge: could not find the "'.concat(t,'" source node in the graph.'));if(!this._nodes.has(e))throw new F('Graph.undirectedEdge: could not find the "'.concat(e,'" target node in the graph.'));var r=n.undirected&&n.undirected[e]||void 0;return r?r.key:void 0}},i.edge=function(t,e){if(this.multi)throw new I("Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.");t=""+t,e=""+e;var n=this._nodes.get(t);if(!n)throw new F('Graph.edge: could not find the "'.concat(t,'" source node in the graph.'));if(!this._nodes.has(e))throw new F('Graph.edge: could not find the "'.concat(e,'" target node in the graph.'));var r=n.out&&n.out[e]||n.undirected&&n.undirected[e]||void 0;if(r)return r.key},i.areDirectedNeighbors=function(t,e){t=""+t,e=""+e;var n=this._nodes.get(t);if(!n)throw new F('Graph.areDirectedNeighbors: could not find the "'.concat(t,'" node in the graph.'));return "undirected"!==this.type&&(e in n.in||e in n.out)},i.areOutNeighbors=function(t,e){t=""+t,e=""+e;var n=this._nodes.get(t);if(!n)throw new F('Graph.areOutNeighbors: could not find the "'.concat(t,'" node in the graph.'));return "undirected"!==this.type&&e in n.out},i.areInNeighbors=function(t,e){t=""+t,e=""+e;var n=this._nodes.get(t);if(!n)throw new F('Graph.areInNeighbors: could not find the "'.concat(t,'" node in the graph.'));return "undirected"!==this.type&&e in n.in},i.areUndirectedNeighbors=function(t,e){t=""+t,e=""+e;var n=this._nodes.get(t);if(!n)throw new F('Graph.areUndirectedNeighbors: could not find the "'.concat(t,'" node in the graph.'));return "directed"!==this.type&&e in n.undirected},i.areNeighbors=function(t,e){t=""+t,e=""+e;var n=this._nodes.get(t);if(!n)throw new F('Graph.areNeighbors: could not find the "'.concat(t,'" node in the graph.'));return "undirected"!==this.type&&(e in n.in||e in n.out)||"directed"!==this.type&&e in n.undirected},i.areInboundNeighbors=function(t,e){t=""+t,e=""+e;var n=this._nodes.get(t);if(!n)throw new F('Graph.areInboundNeighbors: could not find the "'.concat(t,'" node in the graph.'));return "undirected"!==this.type&&e in n.in||"directed"!==this.type&&e in n.undirected},i.areOutboundNeighbors=function(t,e){t=""+t,e=""+e;var n=this._nodes.get(t);if(!n)throw new F('Graph.areOutboundNeighbors: could not find the "'.concat(t,'" node in the graph.'));return "undirected"!==this.type&&e in n.out||"directed"!==this.type&&e in n.undirected},i.inDegree=function(t){t=""+t;var e=this._nodes.get(t);if(!e)throw new F('Graph.inDegree: could not find the "'.concat(t,'" node in the graph.'));return "undirected"===this.type?0:e.inDegree},i.outDegree=function(t){t=""+t;var e=this._nodes.get(t);if(!e)throw new F('Graph.outDegree: could not find the "'.concat(t,'" node in the graph.'));return "undirected"===this.type?0:e.outDegree},i.directedDegree=function(t){t=""+t;var e=this._nodes.get(t);if(!e)throw new F('Graph.directedDegree: could not find the "'.concat(t,'" node in the graph.'));return "undirected"===this.type?0:e.inDegree+e.outDegree},i.undirectedDegree=function(t){t=""+t;var e=this._nodes.get(t);if(!e)throw new F('Graph.undirectedDegree: could not find the "'.concat(t,'" node in the graph.'));return "directed"===this.type?0:e.undirectedDegree},i.inboundDegree=function(t){t=""+t;var e=this._nodes.get(t);if(!e)throw new F('Graph.inboundDegree: could not find the "'.concat(t,'" node in the graph.'));var n=0;return "directed"!==this.type&&(n+=e.undirectedDegree),"undirected"!==this.type&&(n+=e.inDegree),n},i.outboundDegree=function(t){t=""+t;var e=this._nodes.get(t);if(!e)throw new F('Graph.outboundDegree: could not find the "'.concat(t,'" node in the graph.'));var n=0;return "directed"!==this.type&&(n+=e.undirectedDegree),"undirected"!==this.type&&(n+=e.outDegree),n},i.degree=function(t){t=""+t;var e=this._nodes.get(t);if(!e)throw new F('Graph.degree: could not find the "'.concat(t,'" node in the graph.'));var n=0;return "directed"!==this.type&&(n+=e.undirectedDegree),"undirected"!==this.type&&(n+=e.inDegree+e.outDegree),n},i.inDegreeWithoutSelfLoops=function(t){t=""+t;var e=this._nodes.get(t);if(!e)throw new F('Graph.inDegreeWithoutSelfLoops: could not find the "'.concat(t,'" node in the graph.'));return "undirected"===this.type?0:e.inDegree-e.directedLoops},i.outDegreeWithoutSelfLoops=function(t){t=""+t;var e=this._nodes.get(t);if(!e)throw new F('Graph.outDegreeWithoutSelfLoops: could not find the "'.concat(t,'" node in the graph.'));return "undirected"===this.type?0:e.outDegree-e.directedLoops},i.directedDegreeWithoutSelfLoops=function(t){t=""+t;var e=this._nodes.get(t);if(!e)throw new F('Graph.directedDegreeWithoutSelfLoops: could not find the "'.concat(t,'" node in the graph.'));return "undirected"===this.type?0:e.inDegree+e.outDegree-2*e.directedLoops},i.undirectedDegreeWithoutSelfLoops=function(t){t=""+t;var e=this._nodes.get(t);if(!e)throw new F('Graph.undirectedDegreeWithoutSelfLoops: could not find the "'.concat(t,'" node in the graph.'));return "directed"===this.type?0:e.undirectedDegree-2*e.undirectedLoops},i.inboundDegreeWithoutSelfLoops=function(t){t=""+t;var e=this._nodes.get(t);if(!e)throw new F('Graph.inboundDegreeWithoutSelfLoops: could not find the "'.concat(t,'" node in the graph.'));var n=0,r=0;return "directed"!==this.type&&(n+=e.undirectedDegree,r+=2*e.undirectedLoops),"undirected"!==this.type&&(n+=e.inDegree,r+=e.directedLoops),n-r},i.outboundDegreeWithoutSelfLoops=function(t){t=""+t;var e=this._nodes.get(t);if(!e)throw new F('Graph.outboundDegreeWithoutSelfLoops: could not find the "'.concat(t,'" node in the graph.'));var n=0,r=0;return "directed"!==this.type&&(n+=e.undirectedDegree,r+=2*e.undirectedLoops),"undirected"!==this.type&&(n+=e.outDegree,r+=e.directedLoops),n-r},i.degreeWithoutSelfLoops=function(t){t=""+t;var e=this._nodes.get(t);if(!e)throw new F('Graph.degreeWithoutSelfLoops: could not find the "'.concat(t,'" node in the graph.'));var n=0,r=0;return "directed"!==this.type&&(n+=e.undirectedDegree,r+=2*e.undirectedLoops),"undirected"!==this.type&&(n+=e.inDegree+e.outDegree,r+=2*e.directedLoops),n-r},i.source=function(t){t=""+t;var e=this._edges.get(t);if(!e)throw new F('Graph.source: could not find the "'.concat(t,'" edge in the graph.'));return e.source.key},i.target=function(t){t=""+t;var e=this._edges.get(t);if(!e)throw new F('Graph.target: could not find the "'.concat(t,'" edge in the graph.'));return e.target.key},i.extremities=function(t){t=""+t;var e=this._edges.get(t);if(!e)throw new F('Graph.extremities: could not find the "'.concat(t,'" edge in the graph.'));return [e.source.key,e.target.key]},i.opposite=function(t,e){t=""+t,e=""+e;var n=this._edges.get(e);if(!n)throw new F('Graph.opposite: could not find the "'.concat(e,'" edge in the graph.'));var r=n.source.key,i=n.target.key;if(t===r)return i;if(t===i)return r;throw new F('Graph.opposite: the "'.concat(t,'" node is not attached to the "').concat(e,'" edge (').concat(r,", ").concat(i,")."))},i.hasExtremity=function(t,e){t=""+t,e=""+e;var n=this._edges.get(t);if(!n)throw new F('Graph.hasExtremity: could not find the "'.concat(t,'" edge in the graph.'));return n.source.key===e||n.target.key===e},i.isUndirected=function(t){t=""+t;var e=this._edges.get(t);if(!e)throw new F('Graph.isUndirected: could not find the "'.concat(t,'" edge in the graph.'));return e.undirected},i.isDirected=function(t){t=""+t;var e=this._edges.get(t);if(!e)throw new F('Graph.isDirected: could not find the "'.concat(t,'" edge in the graph.'));return !e.undirected},i.isSelfLoop=function(t){t=""+t;var e=this._edges.get(t);if(!e)throw new F('Graph.isSelfLoop: could not find the "'.concat(t,'" edge in the graph.'));return e.source===e.target},i.addNode=function(t,e){var n=function(t,e,n){if(n&&!s(n))throw new B('Graph.addNode: invalid attributes. Expecting an object but got "'.concat(n,'"'));if(e=""+e,n=n||{},t._nodes.has(e))throw new I('Graph.addNode: the "'.concat(e,'" node already exist in the graph.'));var r=new t.NodeDataClass(e,n);return t._nodes.set(e,r),t.emit("nodeAdded",{key:e,attributes:n}),r}(this,t,e);return n.key},i.mergeNode=function(t,e){if(e&&!s(e))throw new B('Graph.mergeNode: invalid attributes. Expecting an object but got "'.concat(e,'"'));t=""+t,e=e||{};var n=this._nodes.get(t);return n?(e&&(u(n.attributes,e),this.emit("nodeAttributesUpdated",{type:"merge",key:t,attributes:n.attributes,data:e})),[t,!1]):(n=new this.NodeDataClass(t,e),this._nodes.set(t,n),this.emit("nodeAdded",{key:t,attributes:e}),[t,!0])},i.updateNode=function(t,e){if(e&&"function"!=typeof e)throw new B('Graph.updateNode: invalid updater function. Expecting a function but got "'.concat(e,'"'));t=""+t;var n=this._nodes.get(t);if(n){if(e){var r=n.attributes;n.attributes=e(r),this.emit("nodeAttributesUpdated",{type:"replace",key:t,attributes:n.attributes});}return [t,!1]}var i=e?e({}):{};return n=new this.NodeDataClass(t,i),this._nodes.set(t,n),this.emit("nodeAdded",{key:t,attributes:i}),[t,!0]},i.dropNode=function(t){t=""+t;var e,n=this._nodes.get(t);if(!n)throw new F('Graph.dropNode: could not find the "'.concat(t,'" node in the graph.'));if("undirected"!==this.type){for(var r in n.out){e=n.out[r];do{Mt(this,e),e=e.next;}while(e)}for(var i in n.in){e=n.in[i];do{Mt(this,e),e=e.next;}while(e)}}if("directed"!==this.type)for(var o in n.undirected){e=n.undirected[o];do{Mt(this,e),e=e.next;}while(e)}this._nodes.delete(t),this.emit("nodeDropped",{key:t,attributes:n.attributes});},i.dropEdge=function(t){var e;if(arguments.length>1){var n=""+arguments[0],r=""+arguments[1];if(!(e=d(this,n,r,this.type)))throw new F('Graph.dropEdge: could not find the "'.concat(n,'" -> "').concat(r,'" edge in the graph.'))}else if(t=""+t,!(e=this._edges.get(t)))throw new F('Graph.dropEdge: could not find the "'.concat(t,'" edge in the graph.'));return Mt(this,e),this},i.dropDirectedEdge=function(t,e){if(arguments.length<2)throw new I("Graph.dropDirectedEdge: it does not make sense to try and drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.");if(this.multi)throw new I("Graph.dropDirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");var n=d(this,t=""+t,e=""+e,"directed");if(!n)throw new F('Graph.dropDirectedEdge: could not find a "'.concat(t,'" -> "').concat(e,'" edge in the graph.'));return Mt(this,n),this},i.dropUndirectedEdge=function(t,e){if(arguments.length<2)throw new I("Graph.dropUndirectedEdge: it does not make sense to drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.");if(this.multi)throw new I("Graph.dropUndirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");var n=d(this,t,e,"undirected");if(!n)throw new F('Graph.dropUndirectedEdge: could not find a "'.concat(t,'" -> "').concat(e,'" edge in the graph.'));return Mt(this,n),this},i.clear=function(){this._edges.clear(),this._nodes.clear(),this._resetInstanceCounters(),this.emit("cleared");},i.clearEdges=function(){for(var t,e=this._nodes.values();!0!==(t=e.next()).done;)t.value.clear();this._edges.clear(),this._resetInstanceCounters(),this.emit("edgesCleared");},i.getAttribute=function(t){return this._attributes[t]},i.getAttributes=function(){return this._attributes},i.hasAttribute=function(t){return this._attributes.hasOwnProperty(t)},i.setAttribute=function(t,e){return this._attributes[t]=e,this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:t}),this},i.updateAttribute=function(t,e){if("function"!=typeof e)throw new B("Graph.updateAttribute: updater should be a function.");var n=this._attributes[t];return this._attributes[t]=e(n),this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:t}),this},i.removeAttribute=function(t){return delete this._attributes[t],this.emit("attributesUpdated",{type:"remove",attributes:this._attributes,name:t}),this},i.replaceAttributes=function(t){if(!s(t))throw new B("Graph.replaceAttributes: provided attributes are not a plain object.");return this._attributes=t,this.emit("attributesUpdated",{type:"replace",attributes:this._attributes}),this},i.mergeAttributes=function(t){if(!s(t))throw new B("Graph.mergeAttributes: provided attributes are not a plain object.");return u(this._attributes,t),this.emit("attributesUpdated",{type:"merge",attributes:this._attributes,data:t}),this},i.updateAttributes=function(t){if("function"!=typeof t)throw new B("Graph.updateAttributes: provided updater is not a function.");return this._attributes=t(this._attributes),this.emit("attributesUpdated",{type:"update",attributes:this._attributes}),this},i.updateEachNodeAttributes=function(t,e){if("function"!=typeof t)throw new B("Graph.updateEachNodeAttributes: expecting an updater function.");if(e&&!l(e))throw new B("Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");for(var n,r,i=this._nodes.values();!0!==(n=i.next()).done;)(r=n.value).attributes=t(r.key,r.attributes);this.emit("eachNodeAttributesUpdated",{hints:e||null});},i.updateEachEdgeAttributes=function(t,e){if("function"!=typeof t)throw new B("Graph.updateEachEdgeAttributes: expecting an updater function.");if(e&&!l(e))throw new B("Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");for(var n,r,i,o,a=this._edges.values();!0!==(n=a.next()).done;)i=(r=n.value).source,o=r.target,r.attributes=t(r.key,r.attributes,i.key,o.key,i.attributes,o.attributes,r.undirected);this.emit("eachEdgeAttributesUpdated",{hints:e||null});},i.forEachAdjacencyEntry=function(t){if("function"!=typeof t)throw new B("Graph.forEachAdjacencyEntry: expecting a callback.");xt(!1,!1,!1,this,t);},i.forEachAdjacencyEntryWithOrphans=function(t){if("function"!=typeof t)throw new B("Graph.forEachAdjacencyEntryWithOrphans: expecting a callback.");xt(!1,!1,!0,this,t);},i.forEachAssymetricAdjacencyEntry=function(t){if("function"!=typeof t)throw new B("Graph.forEachAssymetricAdjacencyEntry: expecting a callback.");xt(!1,!0,!1,this,t);},i.forEachAssymetricAdjacencyEntryWithOrphans=function(t){if("function"!=typeof t)throw new B("Graph.forEachAssymetricAdjacencyEntryWithOrphans: expecting a callback.");xt(!1,!0,!0,this,t);},i.nodes=function(){return "function"==typeof Array.from?Array.from(this._nodes.keys()):K(this._nodes.keys(),this._nodes.size)},i.forEachNode=function(t){if("function"!=typeof t)throw new B("Graph.forEachNode: expecting a callback.");for(var e,n,r=this._nodes.values();!0!==(e=r.next()).done;)t((n=e.value).key,n.attributes);},i.findNode=function(t){if("function"!=typeof t)throw new B("Graph.findNode: expecting a callback.");for(var e,n,r=this._nodes.values();!0!==(e=r.next()).done;)if(t((n=e.value).key,n.attributes))return n.key},i.mapNodes=function(t){if("function"!=typeof t)throw new B("Graph.mapNode: expecting a callback.");for(var e,n,r=this._nodes.values(),i=new Array(this.order),o=0;!0!==(e=r.next()).done;)n=e.value,i[o++]=t(n.key,n.attributes);return i},i.someNode=function(t){if("function"!=typeof t)throw new B("Graph.someNode: expecting a callback.");for(var e,n,r=this._nodes.values();!0!==(e=r.next()).done;)if(t((n=e.value).key,n.attributes))return !0;return !1},i.everyNode=function(t){if("function"!=typeof t)throw new B("Graph.everyNode: expecting a callback.");for(var e,n,r=this._nodes.values();!0!==(e=r.next()).done;)if(!t((n=e.value).key,n.attributes))return !1;return !0},i.filterNodes=function(t){if("function"!=typeof t)throw new B("Graph.filterNodes: expecting a callback.");for(var e,n,r=this._nodes.values(),i=[];!0!==(e=r.next()).done;)t((n=e.value).key,n.attributes)&&i.push(n.key);return i},i.reduceNodes=function(t,e){if("function"!=typeof t)throw new B("Graph.reduceNodes: expecting a callback.");if(arguments.length<2)throw new B("Graph.reduceNodes: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.");for(var n,r,i=e,o=this._nodes.values();!0!==(n=o.next()).done;)i=t(i,(r=n.value).key,r.attributes);return i},i.nodeEntries=function(){var t=this._nodes.values();return new O((function(){var e=t.next();if(e.done)return e;var n=e.value;return {value:{node:n.key,attributes:n.attributes},done:!1}}))},i.export=function(){var t=this,e=new Array(this._nodes.size),n=0;this._nodes.forEach((function(t,r){e[n++]=function(t,e){var n={key:t};return h(e.attributes)||(n.attributes=u({},e.attributes)),n}(r,t);}));var r=new Array(this._edges.size);return n=0,this._edges.forEach((function(e,i){r[n++]=function(t,e,n){var r={key:e,source:n.source.key,target:n.target.key};return h(n.attributes)||(r.attributes=u({},n.attributes)),"mixed"===t&&n.undirected&&(r.undirected=!0),r}(t.type,i,e);})),{options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops},attributes:this.getAttributes(),nodes:e,edges:r}},i.import=function(t){var e,n,i,o,a,c=this,u=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t instanceof r)return t.forEachNode((function(t,e){u?c.mergeNode(t,e):c.addNode(t,e);})),t.forEachEdge((function(t,e,n,r,i,o,a){u?a?c.mergeUndirectedEdgeWithKey(t,n,r,e):c.mergeDirectedEdgeWithKey(t,n,r,e):a?c.addUndirectedEdgeWithKey(t,n,r,e):c.addDirectedEdgeWithKey(t,n,r,e);})),this;if(!s(t))throw new B("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(t.attributes){if(!s(t.attributes))throw new B("Graph.import: invalid attributes. Expecting a plain object.");u?this.mergeAttributes(t.attributes):this.replaceAttributes(t.attributes);}if(t.nodes){if(i=t.nodes,!Array.isArray(i))throw new B("Graph.import: invalid nodes. Expecting an array.");for(e=0,n=i.length;e<n;e++){Et(o=i[e]);var d=o,h=d.key,p=d.attributes;u?this.mergeNode(h,p):this.addNode(h,p);}}if(t.edges){var f=!1;if("undirected"===this.type&&(f=!0),i=t.edges,!Array.isArray(i))throw new B("Graph.import: invalid edges. Expecting an array.");for(e=0,n=i.length;e<n;e++){At(a=i[e]);var l=a,g=l.source,y=l.target,w=l.attributes,v=l.undirected,b=void 0===v?f:v;"key"in a?(u?b?this.mergeUndirectedEdgeWithKey:this.mergeDirectedEdgeWithKey:b?this.addUndirectedEdgeWithKey:this.addDirectedEdgeWithKey).call(this,a.key,g,y,w):(u?b?this.mergeUndirectedEdge:this.mergeDirectedEdge:b?this.addUndirectedEdge:this.addDirectedEdge).call(this,g,y,w);}}return this},i.nullCopy=function(t){var e=new r(u({},this._options,t));return e.replaceAttributes(u({},this.getAttributes())),e},i.emptyCopy=function(t){var e=this.nullCopy(t);return this._nodes.forEach((function(t,n){var r=u({},t.attributes);t=new e.NodeDataClass(n,r),e._nodes.set(n,t);})),e},i.copy=function(t){if("string"==typeof(t=t||{}).type&&t.type!==this.type&&"mixed"!==t.type)throw new I('Graph.copy: cannot create an incompatible copy from "'.concat(this.type,'" type to "').concat(t.type,'" because this would mean losing information about the current graph.'));if("boolean"==typeof t.multi&&t.multi!==this.multi&&!0!==t.multi)throw new I("Graph.copy: cannot create an incompatible copy by downgrading a multi graph to a simple one because this would mean losing information about the current graph.");if("boolean"==typeof t.allowSelfLoops&&t.allowSelfLoops!==this.allowSelfLoops&&!0!==t.allowSelfLoops)throw new I("Graph.copy: cannot create an incompatible copy from a graph allowing self loops to one that does not because this would mean losing information about the current graph.");for(var e,n,r=this.emptyCopy(t),i=this._edges.values();!0!==(e=i.next()).done;)jt(r,"copy",!1,(n=e.value).undirected,n.key,n.source.key,n.target.key,u({},n.attributes));return r},i.toJSON=function(){return this.export()},i.toString=function(){return "[object Graph]"},i.inspect=function(){var e=this,n={};this._nodes.forEach((function(t,e){n[e]=t.attributes;}));var r={},i={};this._edges.forEach((function(t,n){var o,a=t.undirected?"--":"->",c="",u=t.source.key,d=t.target.key;t.undirected&&u>d&&(o=u,u=d,d=o);var s="(".concat(u,")").concat(a,"(").concat(d,")");n.startsWith("geid_")?e.multi&&(void 0===i[s]?i[s]=0:i[s]++,c+="".concat(i[s],". ")):c+="[".concat(n,"]: "),r[c+=s]=t.attributes;}));var o={};for(var a in this)this.hasOwnProperty(a)&&!Ut.has(a)&&"function"!=typeof this[a]&&"symbol"!==t(a)&&(o[a]=this[a]);return o.attributes=this._attributes,o.nodes=n,o.edges=r,p(o,"constructor",this.constructor),o},r}(y.exports.EventEmitter);"undefined"!=typeof Symbol&&(zt.prototype[Symbol.for("nodejs.util.inspect.custom")]=zt.prototype.inspect),[{name:function(t){return "".concat(t,"Edge")},generateKey:!0},{name:function(t){return "".concat(t,"DirectedEdge")},generateKey:!0,type:"directed"},{name:function(t){return "".concat(t,"UndirectedEdge")},generateKey:!0,type:"undirected"},{name:function(t){return "".concat(t,"EdgeWithKey")}},{name:function(t){return "".concat(t,"DirectedEdgeWithKey")},type:"directed"},{name:function(t){return "".concat(t,"UndirectedEdgeWithKey")},type:"undirected"}].forEach((function(t){["add","merge","update"].forEach((function(e){var n=t.name(e),r="add"===e?jt:Ct;t.generateKey?zt.prototype[n]=function(i,o,a){return r(this,n,!0,"undirected"===(t.type||this.type),null,i,o,a,"update"===e)}:zt.prototype[n]=function(i,o,a,c){return r(this,n,!1,"undirected"===(t.type||this.type),i,o,a,c,"update"===e)};}));})),function(t){Q.forEach((function(e){var n=e.name,r=e.attacher;r(t,n("Node"),0),r(t,n("Source"),1),r(t,n("Target"),2),r(t,n("Opposite"),3);}));}(zt),function(t){X.forEach((function(e){var n=e.name,r=e.attacher;r(t,n("Edge"),"mixed"),r(t,n("DirectedEdge"),"directed"),r(t,n("UndirectedEdge"),"undirected");}));}(zt),function(t){et.forEach((function(e){!function(t,e){var n=e.name,r=e.type,i=e.direction;t.prototype[n]=function(t,e){if("mixed"!==r&&"mixed"!==this.type&&r!==this.type)return [];if(!arguments.length)return ut(this,r);if(1===arguments.length){t=""+t;var o=this._nodes.get(t);if(void 0===o)throw new F("Graph.".concat(n,': could not find the "').concat(t,'" node in the graph.'));return pt(this.multi,"mixed"===r?this.type:r,i,o)}if(2===arguments.length){t=""+t,e=""+e;var a=this._nodes.get(t);if(!a)throw new F("Graph.".concat(n,': could not find the "').concat(t,'" source node in the graph.'));if(!this._nodes.has(e))throw new F("Graph.".concat(n,': could not find the "').concat(e,'" target node in the graph.'));return gt(r,this.multi,i,a,e)}throw new B("Graph.".concat(n,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))};}(t,e),function(t,e){var n=e.name,r=e.type,i=e.direction,o="forEach"+n[0].toUpperCase()+n.slice(1,-1);t.prototype[o]=function(t,e,n){if("mixed"===r||"mixed"===this.type||r===this.type){if(1===arguments.length)return dt(!1,this,r,n=t);if(2===arguments.length){t=""+t,n=e;var a=this._nodes.get(t);if(void 0===a)throw new F("Graph.".concat(o,': could not find the "').concat(t,'" node in the graph.'));return ht(!1,this.multi,"mixed"===r?this.type:r,i,a,n)}if(3===arguments.length){t=""+t,e=""+e;var c=this._nodes.get(t);if(!c)throw new F("Graph.".concat(o,': could not find the "').concat(t,'" source node in the graph.'));if(!this._nodes.has(e))throw new F("Graph.".concat(o,': could not find the "').concat(e,'" target node in the graph.'));return lt(!1,r,this.multi,i,c,e,n)}throw new B("Graph.".concat(o,": too many arguments (expecting 1, 2 or 3 and got ").concat(arguments.length,")."))}};var a="map"+n[0].toUpperCase()+n.slice(1);t.prototype[a]=function(){var t,e=Array.prototype.slice.call(arguments),n=e.pop();if(0===e.length){var i=0;"directed"!==r&&(i+=this.undirectedSize),"undirected"!==r&&(i+=this.directedSize),t=new Array(i);var a=0;e.push((function(e,r,i,o,c,u,d){t[a++]=n(e,r,i,o,c,u,d);}));}else t=[],e.push((function(e,r,i,o,a,c,u){t.push(n(e,r,i,o,a,c,u));}));return this[o].apply(this,e),t};var c="filter"+n[0].toUpperCase()+n.slice(1);t.prototype[c]=function(){var t=Array.prototype.slice.call(arguments),e=t.pop(),n=[];return t.push((function(t,r,i,o,a,c,u){e(t,r,i,o,a,c,u)&&n.push(t);})),this[o].apply(this,t),n};var u="reduce"+n[0].toUpperCase()+n.slice(1);t.prototype[u]=function(){var t,e,n=Array.prototype.slice.call(arguments);if(n.length<2||n.length>4)throw new B("Graph.".concat(u,": invalid number of arguments (expecting 2, 3 or 4 and got ").concat(n.length,")."));if("function"==typeof n[n.length-1]&&"function"!=typeof n[n.length-2])throw new B("Graph.".concat(u,": missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array."));2===n.length?(t=n[0],e=n[1],n=[]):3===n.length?(t=n[1],e=n[2],n=[n[0]]):4===n.length&&(t=n[2],e=n[3],n=[n[0],n[1]]);var r=e;return n.push((function(e,n,i,o,a,c,u){r=t(r,e,n,i,o,a,c,u);})),this[o].apply(this,n),r};}(t,e),function(t,e){var n=e.name,r=e.type,i=e.direction,o="find"+n[0].toUpperCase()+n.slice(1,-1);t.prototype[o]=function(t,e,n){if("mixed"!==r&&"mixed"!==this.type&&r!==this.type)return !1;if(1===arguments.length)return dt(!0,this,r,n=t);if(2===arguments.length){t=""+t,n=e;var a=this._nodes.get(t);if(void 0===a)throw new F("Graph.".concat(o,': could not find the "').concat(t,'" node in the graph.'));return ht(!0,this.multi,"mixed"===r?this.type:r,i,a,n)}if(3===arguments.length){t=""+t,e=""+e;var c=this._nodes.get(t);if(!c)throw new F("Graph.".concat(o,': could not find the "').concat(t,'" source node in the graph.'));if(!this._nodes.has(e))throw new F("Graph.".concat(o,': could not find the "').concat(e,'" target node in the graph.'));return lt(!0,r,this.multi,i,c,e,n)}throw new B("Graph.".concat(o,": too many arguments (expecting 1, 2 or 3 and got ").concat(arguments.length,")."))};var a="some"+n[0].toUpperCase()+n.slice(1,-1);t.prototype[a]=function(){var t=Array.prototype.slice.call(arguments),e=t.pop();return t.push((function(t,n,r,i,o,a,c){return e(t,n,r,i,o,a,c)})),!!this[o].apply(this,t)};var c="every"+n[0].toUpperCase()+n.slice(1,-1);t.prototype[c]=function(){var t=Array.prototype.slice.call(arguments),e=t.pop();return t.push((function(t,n,r,i,o,a,c){return !e(t,n,r,i,o,a,c)})),!this[o].apply(this,t)};}(t,e),function(t,e){var n=e.name,r=e.type,i=e.direction,o=n.slice(0,-1)+"Entries";t.prototype[o]=function(t,e){if("mixed"!==r&&"mixed"!==this.type&&r!==this.type)return O.empty();if(!arguments.length)return st(this,r);if(1===arguments.length){t=""+t;var n=this._nodes.get(t);if(!n)throw new F("Graph.".concat(o,': could not find the "').concat(t,'" node in the graph.'));return ft(r,i,n)}if(2===arguments.length){t=""+t,e=""+e;var a=this._nodes.get(t);if(!a)throw new F("Graph.".concat(o,': could not find the "').concat(t,'" source node in the graph.'));if(!this._nodes.has(e))throw new F("Graph.".concat(o,': could not find the "').concat(e,'" target node in the graph.'));return yt(r,i,a,e)}throw new B("Graph.".concat(o,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))};}(t,e);}));}(zt),function(t){wt.forEach((function(e){_t(t,e),function(t,e){var n=e.name,r=e.type,i=e.direction,o="forEach"+n[0].toUpperCase()+n.slice(1,-1);t.prototype[o]=function(t,e){if("mixed"===r||"mixed"===this.type||r===this.type){t=""+t;var n=this._nodes.get(t);if(void 0===n)throw new F("Graph.".concat(o,': could not find the "').concat(t,'" node in the graph.'));mt(!1,"mixed"===r?this.type:r,i,n,e);}};var a="map"+n[0].toUpperCase()+n.slice(1);t.prototype[a]=function(t,e){var n=[];return this[o](t,(function(t,r){n.push(e(t,r));})),n};var c="filter"+n[0].toUpperCase()+n.slice(1);t.prototype[c]=function(t,e){var n=[];return this[o](t,(function(t,r){e(t,r)&&n.push(t);})),n};var u="reduce"+n[0].toUpperCase()+n.slice(1);t.prototype[u]=function(t,e,n){if(arguments.length<3)throw new B("Graph.".concat(u,": missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array."));var r=n;return this[o](t,(function(t,n){r=e(r,t,n);})),r};}(t,e),function(t,e){var n=e.name,r=e.type,i=e.direction,o=n[0].toUpperCase()+n.slice(1,-1),a="find"+o;t.prototype[a]=function(t,e){if("mixed"===r||"mixed"===this.type||r===this.type){t=""+t;var n=this._nodes.get(t);if(void 0===n)throw new F("Graph.".concat(a,': could not find the "').concat(t,'" node in the graph.'));return mt(!0,"mixed"===r?this.type:r,i,n,e)}};var c="some"+o;t.prototype[c]=function(t,e){return !!this[a](t,e)};var u="every"+o;t.prototype[u]=function(t,e){return !this[a](t,(function(t,n){return !e(t,n)}))};}(t,e),Gt(t,e);}));}(zt);var Wt=function(t){function n(e){var n=u({type:"directed"},e);if("multi"in n&&!1!==n.multi)throw new B("DirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if("directed"!==n.type)throw new B('DirectedGraph.from: inconsistent "'+n.type+'" type in given options!');return t.call(this,n)||this}return e(n,t),n}(zt),Pt=function(t){function n(e){var n=u({type:"undirected"},e);if("multi"in n&&!1!==n.multi)throw new B("UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if("undirected"!==n.type)throw new B('UndirectedGraph.from: inconsistent "'+n.type+'" type in given options!');return t.call(this,n)||this}return e(n,t),n}(zt),Rt=function(t){function n(e){var n=u({multi:!0},e);if("multi"in n&&!0!==n.multi)throw new B("MultiGraph.from: inconsistent indication that the graph should be simple in given options!");return t.call(this,n)||this}return e(n,t),n}(zt),Kt=function(t){function n(e){var n=u({type:"directed",multi:!0},e);if("multi"in n&&!0!==n.multi)throw new B("MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if("directed"!==n.type)throw new B('MultiDirectedGraph.from: inconsistent "'+n.type+'" type in given options!');return t.call(this,n)||this}return e(n,t),n}(zt),Tt=function(t){function n(e){var n=u({type:"undirected",multi:!0},e);if("multi"in n&&!0!==n.multi)throw new B("MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if("undirected"!==n.type)throw new B('MultiUndirectedGraph.from: inconsistent "'+n.type+'" type in given options!');return t.call(this,n)||this}return e(n,t),n}(zt);function Bt(t){t.from=function(e,n){var r=u({},e.options,n),i=new t(r);return i.import(e),i};}return Bt(zt),Bt(Wt),Bt(Pt),Bt(Rt),Bt(Kt),Bt(Tt),zt.Graph=zt,zt.DirectedGraph=Wt,zt.UndirectedGraph=Pt,zt.MultiGraph=Rt,zt.MultiDirectedGraph=Kt,zt.MultiUndirectedGraph=Tt,zt.InvalidArgumentsGraphError=B,zt.NotFoundGraphError=F,zt.UsageGraphError=I,zt}));
|
|
363
|
+
!function(t,e){module.exports=e();}(graphology_umd_min,(function(){function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,r(t,e);}function n(t){return n=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},n(t)}function r(t,e){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},r(t,e)}function i(){if("undefined"==typeof Reflect||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if("function"==typeof Proxy)return true;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return false}}function o(t,e,n){return o=i()?Reflect.construct.bind():function(t,e,n){var i=[null];i.push.apply(i,e);var o=new(Function.bind.apply(t,i));return n&&r(o,n.prototype),o},o.apply(null,arguments)}function a(t){var e="function"==typeof Map?new Map:undefined;return a=function(t){if(null===t||(i=t,-1===Function.toString.call(i).indexOf("[native code]")))return t;var i;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(undefined!==e){if(e.has(t))return e.get(t);e.set(t,a);}function a(){return o(t,arguments,n(this).constructor)}return a.prototype=Object.create(t.prototype,{constructor:{value:a,enumerable:false,writable:true,configurable:true}}),r(a,t)},a(t)}function c(t){if(undefined===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var u=function(){for(var t=arguments[0],e=1,n=arguments.length;e<n;e++)if(arguments[e])for(var r in arguments[e])t[r]=arguments[e][r];return t};function d(t,e,n,r){var i=t._nodes.get(e),o=null;return i?o="mixed"===r?i.out&&i.out[n]||i.undirected&&i.undirected[n]:"directed"===r?i.out&&i.out[n]:i.undirected&&i.undirected[n]:o}function s(e){return "object"===t(e)&&null!==e}function h(t){var e;for(e in t)return false;return true}function p(t,e,n){Object.defineProperty(t,e,{enumerable:false,configurable:false,writable:true,value:n});}function f(t,e,n){var r={enumerable:true,configurable:true};"function"==typeof n?r.get=n:(r.value=n,r.writable=false),Object.defineProperty(t,e,r);}function l(t){return !!s(t)&&!(t.attributes&&!Array.isArray(t.attributes))}"function"==typeof Object.assign&&(u=Object.assign);var g,y={exports:{}},w="object"==typeof Reflect?Reflect:null,v=w&&"function"==typeof w.apply?w.apply:function(t,e,n){return Function.prototype.apply.call(t,e,n)};g=w&&"function"==typeof w.ownKeys?w.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var b=Number.isNaN||function(t){return t!=t};function m(){m.init.call(this);}y.exports=m,y.exports.once=function(t,e){return new Promise((function(n,r){function i(n){t.removeListener(e,o),r(n);}function o(){"function"==typeof t.removeListener&&t.removeListener("error",i),n([].slice.call(arguments));}U(t,e,o,{once:true}),"error"!==e&&function(t,e,n){"function"==typeof t.on&&U(t,"error",e,n);}(t,i,{once:true});}))},m.EventEmitter=m,m.prototype._events=undefined,m.prototype._eventsCount=0,m.prototype._maxListeners=undefined;var k=10;function _(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function G(t){return undefined===t._maxListeners?m.defaultMaxListeners:t._maxListeners}function x(t,e,n,r){var i,o,a,c;if(_(n),undefined===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(undefined!==o.newListener&&(t.emit("newListener",e,n.listener?n.listener:n),o=t._events),a=o[e]),undefined===a)a=o[e]=n,++t._eventsCount;else if("function"==typeof a?a=o[e]=r?[n,a]:[a,n]:r?a.unshift(n):a.push(n),(i=G(t))>0&&a.length>i&&!a.warned){a.warned=true;var u=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=t,u.type=e,u.count=a.length,c=u,console&&console.warn&&console.warn(c);}return t}function E(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=true,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function A(t,e,n){var r={fired:false,wrapFn:undefined,target:t,type:e,listener:n},i=E.bind(r);return i.listener=n,r.wrapFn=i,i}function L(t,e,n){var r=t._events;if(undefined===r)return [];var i=r[e];return undefined===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(t){for(var e=new Array(t.length),n=0;n<e.length;++n)e[n]=t[n].listener||t[n];return e}(i):D(i,i.length)}function S(t){var e=this._events;if(undefined!==e){var n=e[t];if("function"==typeof n)return 1;if(undefined!==n)return n.length}return 0}function D(t,e){for(var n=new Array(e),r=0;r<e;++r)n[r]=t[r];return n}function U(t,e,n,r){if("function"==typeof t.on)r.once?t.once(e,n):t.on(e,n);else {if("function"!=typeof t.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t);t.addEventListener(e,(function i(o){r.once&&t.removeEventListener(e,i),n(o);}));}}function N(t){if("function"!=typeof t)throw new Error("obliterator/iterator: expecting a function!");this.next=t;}Object.defineProperty(m,"defaultMaxListeners",{enumerable:true,get:function(){return k},set:function(t){if("number"!=typeof t||t<0||b(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");k=t;}}),m.init=function(){ undefined!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||undefined;},m.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||b(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},m.prototype.getMaxListeners=function(){return G(this)},m.prototype.emit=function(t){for(var e=[],n=1;n<arguments.length;n++)e.push(arguments[n]);var r="error"===t,i=this._events;if(undefined!==i)r=r&&undefined===i.error;else if(!r)return false;if(r){var o;if(e.length>0&&(o=e[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var c=i[t];if(undefined===c)return false;if("function"==typeof c)v(c,this,e);else {var u=c.length,d=D(c,u);for(n=0;n<u;++n)v(d[n],this,e);}return true},m.prototype.addListener=function(t,e){return x(this,t,e,false)},m.prototype.on=m.prototype.addListener,m.prototype.prependListener=function(t,e){return x(this,t,e,true)},m.prototype.once=function(t,e){return _(e),this.on(t,A(this,t,e)),this},m.prototype.prependOnceListener=function(t,e){return _(e),this.prependListener(t,A(this,t,e)),this},m.prototype.removeListener=function(t,e){var n,r,i,o,a;if(_(e),undefined===(r=this._events))return this;if(undefined===(n=r[t]))return this;if(n===e||n.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete r[t],r.removeListener&&this.emit("removeListener",t,n.listener||e));else if("function"!=typeof n){for(i=-1,o=n.length-1;o>=0;o--)if(n[o]===e||n[o].listener===e){a=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop();}(n,i),1===n.length&&(r[t]=n[0]),undefined!==r.removeListener&&this.emit("removeListener",t,a||e);}return this},m.prototype.off=m.prototype.removeListener,m.prototype.removeAllListeners=function(t){var e,n,r;if(undefined===(n=this._events))return this;if(undefined===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):undefined!==n[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[t]),this;if(0===arguments.length){var i,o=Object.keys(n);for(r=0;r<o.length;++r)"removeListener"!==(i=o[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=n[t]))this.removeListener(t,e);else if(undefined!==e)for(r=e.length-1;r>=0;r--)this.removeListener(t,e[r]);return this},m.prototype.listeners=function(t){return L(this,t,true)},m.prototype.rawListeners=function(t){return L(this,t,false)},m.listenerCount=function(t,e){return "function"==typeof t.listenerCount?t.listenerCount(e):S.call(t,e)},m.prototype.listenerCount=S,m.prototype.eventNames=function(){return this._eventsCount>0?g(this._events):[]},"undefined"!=typeof Symbol&&(N.prototype[Symbol.iterator]=function(){return this}),N.of=function(){var t=arguments,e=t.length,n=0;return new N((function(){return n>=e?{done:true}:{done:false,value:t[n++]}}))},N.empty=function(){return new N((function(){return {done:true}}))},N.fromSequence=function(t){var e=0,n=t.length;return new N((function(){return e>=n?{done:true}:{done:false,value:t[e++]}}))},N.is=function(t){return t instanceof N||"object"==typeof t&&null!==t&&"function"==typeof t.next};var O=N,j={};j.ARRAY_BUFFER_SUPPORT="undefined"!=typeof ArrayBuffer,j.SYMBOL_SUPPORT="undefined"!=typeof Symbol;var C=O,M=j,z=M.ARRAY_BUFFER_SUPPORT,W=M.SYMBOL_SUPPORT;var P=function(t){var e=function(t){return "string"==typeof t||Array.isArray(t)||z&&ArrayBuffer.isView(t)?C.fromSequence(t):"object"!=typeof t||null===t?null:W&&"function"==typeof t[Symbol.iterator]?t[Symbol.iterator]():"function"==typeof t.next?t:null}(t);if(!e)throw new Error("obliterator: target is not iterable nor a valid iterator.");return e},R=P,K=function(t,e){for(var n,r=arguments.length>1?e:1/0,i=r!==1/0?new Array(r):[],o=0,a=R(t);;){if(o===r)return i;if((n=a.next()).done)return o!==e&&(i.length=o),i;i[o++]=n.value;}},T=function(t){function n(e){var n;return (n=t.call(this)||this).name="GraphError",n.message=e,n}return e(n,t),n}(a(Error)),B=function(t){function n(e){var r;return (r=t.call(this,e)||this).name="InvalidArgumentsGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(c(r),n.prototype.constructor),r}return e(n,t),n}(T),F=function(t){function n(e){var r;return (r=t.call(this,e)||this).name="NotFoundGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(c(r),n.prototype.constructor),r}return e(n,t),n}(T),I=function(t){function n(e){var r;return (r=t.call(this,e)||this).name="UsageGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(c(r),n.prototype.constructor),r}return e(n,t),n}(T);function Y(t,e){this.key=t,this.attributes=e,this.clear();}function q(t,e){this.key=t,this.attributes=e,this.clear();}function J(t,e){this.key=t,this.attributes=e,this.clear();}function V(t,e,n,r,i){this.key=e,this.attributes=i,this.undirected=t,this.source=n,this.target=r;}Y.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.undirectedLoops=0,this.directedLoops=0,this.in={},this.out={},this.undirected={};},q.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.directedLoops=0,this.in={},this.out={};},J.prototype.clear=function(){this.undirectedDegree=0,this.undirectedLoops=0,this.undirected={};},V.prototype.attach=function(){var t="out",e="in";this.undirected&&(t=e="undirected");var n=this.source.key,r=this.target.key;this.source[t][r]=this,this.undirected&&n===r||(this.target[e][n]=this);},V.prototype.attachMulti=function(){var t="out",e="in",n=this.source.key,r=this.target.key;this.undirected&&(t=e="undirected");var i=this.source[t],o=i[r];if(undefined===o)return i[r]=this,void(this.undirected&&n===r||(this.target[e][n]=this));o.previous=this,this.next=o,i[r]=this,this.target[e][n]=this;},V.prototype.detach=function(){var t=this.source.key,e=this.target.key,n="out",r="in";this.undirected&&(n=r="undirected"),delete this.source[n][e],delete this.target[r][t];},V.prototype.detachMulti=function(){var t=this.source.key,e=this.target.key,n="out",r="in";this.undirected&&(n=r="undirected"),undefined===this.previous?undefined===this.next?(delete this.source[n][e],delete this.target[r][t]):(this.next.previous=undefined,this.source[n][e]=this.next,this.target[r][t]=this.next):(this.previous.next=this.next,undefined!==this.next&&(this.next.previous=this.previous));};function H(t,e,n,r,i,o,a){var c,u,d,s;if(r=""+r,0===n){if(!(c=t._nodes.get(r)))throw new F("Graph.".concat(e,': could not find the "').concat(r,'" node in the graph.'));d=i,s=o;}else if(3===n){if(i=""+i,!(u=t._edges.get(i)))throw new F("Graph.".concat(e,': could not find the "').concat(i,'" edge in the graph.'));var h=u.source.key,p=u.target.key;if(r===h)c=u.target;else {if(r!==p)throw new F("Graph.".concat(e,': the "').concat(r,'" node is not attached to the "').concat(i,'" edge (').concat(h,", ").concat(p,")."));c=u.source;}d=o,s=a;}else {if(!(u=t._edges.get(r)))throw new F("Graph.".concat(e,': could not find the "').concat(r,'" edge in the graph.'));c=1===n?u.source:u.target,d=i,s=o;}return [c,d,s]}var Q=[{name:function(t){return "get".concat(t,"Attribute")},attacher:function(t,e,n){t.prototype[e]=function(t,r,i){var o=H(this,e,n,t,r,i),a=o[0],c=o[1];return a.attributes[c]};}},{name:function(t){return "get".concat(t,"Attributes")},attacher:function(t,e,n){t.prototype[e]=function(t,r){return H(this,e,n,t,r)[0].attributes};}},{name:function(t){return "has".concat(t,"Attribute")},attacher:function(t,e,n){t.prototype[e]=function(t,r,i){var o=H(this,e,n,t,r,i),a=o[0],c=o[1];return a.attributes.hasOwnProperty(c)};}},{name:function(t){return "set".concat(t,"Attribute")},attacher:function(t,e,n){t.prototype[e]=function(t,r,i,o){var a=H(this,e,n,t,r,i,o),c=a[0],u=a[1],d=a[2];return c.attributes[u]=d,this.emit("nodeAttributesUpdated",{key:c.key,type:"set",attributes:c.attributes,name:u}),this};}},{name:function(t){return "update".concat(t,"Attribute")},attacher:function(t,e,n){t.prototype[e]=function(t,r,i,o){var a=H(this,e,n,t,r,i,o),c=a[0],u=a[1],d=a[2];if("function"!=typeof d)throw new B("Graph.".concat(e,": updater should be a function."));var s=c.attributes,h=d(s[u]);return s[u]=h,this.emit("nodeAttributesUpdated",{key:c.key,type:"set",attributes:c.attributes,name:u}),this};}},{name:function(t){return "remove".concat(t,"Attribute")},attacher:function(t,e,n){t.prototype[e]=function(t,r,i){var o=H(this,e,n,t,r,i),a=o[0],c=o[1];return delete a.attributes[c],this.emit("nodeAttributesUpdated",{key:a.key,type:"remove",attributes:a.attributes,name:c}),this};}},{name:function(t){return "replace".concat(t,"Attributes")},attacher:function(t,e,n){t.prototype[e]=function(t,r,i){var o=H(this,e,n,t,r,i),a=o[0],c=o[1];if(!s(c))throw new B("Graph.".concat(e,": provided attributes are not a plain object."));return a.attributes=c,this.emit("nodeAttributesUpdated",{key:a.key,type:"replace",attributes:a.attributes}),this};}},{name:function(t){return "merge".concat(t,"Attributes")},attacher:function(t,e,n){t.prototype[e]=function(t,r,i){var o=H(this,e,n,t,r,i),a=o[0],c=o[1];if(!s(c))throw new B("Graph.".concat(e,": provided attributes are not a plain object."));return u(a.attributes,c),this.emit("nodeAttributesUpdated",{key:a.key,type:"merge",attributes:a.attributes,data:c}),this};}},{name:function(t){return "update".concat(t,"Attributes")},attacher:function(t,e,n){t.prototype[e]=function(t,r,i){var o=H(this,e,n,t,r,i),a=o[0],c=o[1];if("function"!=typeof c)throw new B("Graph.".concat(e,": provided updater is not a function."));return a.attributes=c(a.attributes),this.emit("nodeAttributesUpdated",{key:a.key,type:"update",attributes:a.attributes}),this};}}];var X=[{name:function(t){return "get".concat(t,"Attribute")},attacher:function(t,e,n){t.prototype[e]=function(t,r){var i;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new I("Graph.".concat(e,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new I("Graph.".concat(e,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+t,a=""+r;if(r=arguments[2],!(i=d(this,o,a,n)))throw new F("Graph.".concat(e,': could not find an edge for the given path ("').concat(o,'" - "').concat(a,'").'))}else {if("mixed"!==n)throw new I("Graph.".concat(e,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(t=""+t,!(i=this._edges.get(t)))throw new F("Graph.".concat(e,': could not find the "').concat(t,'" edge in the graph.'))}return i.attributes[r]};}},{name:function(t){return "get".concat(t,"Attributes")},attacher:function(t,e,n){t.prototype[e]=function(t){var r;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new I("Graph.".concat(e,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>1){if(this.multi)throw new I("Graph.".concat(e,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var i=""+t,o=""+arguments[1];if(!(r=d(this,i,o,n)))throw new F("Graph.".concat(e,': could not find an edge for the given path ("').concat(i,'" - "').concat(o,'").'))}else {if("mixed"!==n)throw new I("Graph.".concat(e,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(t=""+t,!(r=this._edges.get(t)))throw new F("Graph.".concat(e,': could not find the "').concat(t,'" edge in the graph.'))}return r.attributes};}},{name:function(t){return "has".concat(t,"Attribute")},attacher:function(t,e,n){t.prototype[e]=function(t,r){var i;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new I("Graph.".concat(e,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new I("Graph.".concat(e,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+t,a=""+r;if(r=arguments[2],!(i=d(this,o,a,n)))throw new F("Graph.".concat(e,': could not find an edge for the given path ("').concat(o,'" - "').concat(a,'").'))}else {if("mixed"!==n)throw new I("Graph.".concat(e,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(t=""+t,!(i=this._edges.get(t)))throw new F("Graph.".concat(e,': could not find the "').concat(t,'" edge in the graph.'))}return i.attributes.hasOwnProperty(r)};}},{name:function(t){return "set".concat(t,"Attribute")},attacher:function(t,e,n){t.prototype[e]=function(t,r,i){var o;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new I("Graph.".concat(e,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new I("Graph.".concat(e,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var a=""+t,c=""+r;if(r=arguments[2],i=arguments[3],!(o=d(this,a,c,n)))throw new F("Graph.".concat(e,': could not find an edge for the given path ("').concat(a,'" - "').concat(c,'").'))}else {if("mixed"!==n)throw new I("Graph.".concat(e,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(t=""+t,!(o=this._edges.get(t)))throw new F("Graph.".concat(e,': could not find the "').concat(t,'" edge in the graph.'))}return o.attributes[r]=i,this.emit("edgeAttributesUpdated",{key:o.key,type:"set",attributes:o.attributes,name:r}),this};}},{name:function(t){return "update".concat(t,"Attribute")},attacher:function(t,e,n){t.prototype[e]=function(t,r,i){var o;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new I("Graph.".concat(e,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new I("Graph.".concat(e,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var a=""+t,c=""+r;if(r=arguments[2],i=arguments[3],!(o=d(this,a,c,n)))throw new F("Graph.".concat(e,': could not find an edge for the given path ("').concat(a,'" - "').concat(c,'").'))}else {if("mixed"!==n)throw new I("Graph.".concat(e,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(t=""+t,!(o=this._edges.get(t)))throw new F("Graph.".concat(e,': could not find the "').concat(t,'" edge in the graph.'))}if("function"!=typeof i)throw new B("Graph.".concat(e,": updater should be a function."));return o.attributes[r]=i(o.attributes[r]),this.emit("edgeAttributesUpdated",{key:o.key,type:"set",attributes:o.attributes,name:r}),this};}},{name:function(t){return "remove".concat(t,"Attribute")},attacher:function(t,e,n){t.prototype[e]=function(t,r){var i;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new I("Graph.".concat(e,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new I("Graph.".concat(e,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+t,a=""+r;if(r=arguments[2],!(i=d(this,o,a,n)))throw new F("Graph.".concat(e,': could not find an edge for the given path ("').concat(o,'" - "').concat(a,'").'))}else {if("mixed"!==n)throw new I("Graph.".concat(e,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(t=""+t,!(i=this._edges.get(t)))throw new F("Graph.".concat(e,': could not find the "').concat(t,'" edge in the graph.'))}return delete i.attributes[r],this.emit("edgeAttributesUpdated",{key:i.key,type:"remove",attributes:i.attributes,name:r}),this};}},{name:function(t){return "replace".concat(t,"Attributes")},attacher:function(t,e,n){t.prototype[e]=function(t,r){var i;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new I("Graph.".concat(e,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new I("Graph.".concat(e,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+t,a=""+r;if(r=arguments[2],!(i=d(this,o,a,n)))throw new F("Graph.".concat(e,': could not find an edge for the given path ("').concat(o,'" - "').concat(a,'").'))}else {if("mixed"!==n)throw new I("Graph.".concat(e,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(t=""+t,!(i=this._edges.get(t)))throw new F("Graph.".concat(e,': could not find the "').concat(t,'" edge in the graph.'))}if(!s(r))throw new B("Graph.".concat(e,": provided attributes are not a plain object."));return i.attributes=r,this.emit("edgeAttributesUpdated",{key:i.key,type:"replace",attributes:i.attributes}),this};}},{name:function(t){return "merge".concat(t,"Attributes")},attacher:function(t,e,n){t.prototype[e]=function(t,r){var i;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new I("Graph.".concat(e,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new I("Graph.".concat(e,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+t,a=""+r;if(r=arguments[2],!(i=d(this,o,a,n)))throw new F("Graph.".concat(e,': could not find an edge for the given path ("').concat(o,'" - "').concat(a,'").'))}else {if("mixed"!==n)throw new I("Graph.".concat(e,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(t=""+t,!(i=this._edges.get(t)))throw new F("Graph.".concat(e,': could not find the "').concat(t,'" edge in the graph.'))}if(!s(r))throw new B("Graph.".concat(e,": provided attributes are not a plain object."));return u(i.attributes,r),this.emit("edgeAttributesUpdated",{key:i.key,type:"merge",attributes:i.attributes,data:r}),this};}},{name:function(t){return "update".concat(t,"Attributes")},attacher:function(t,e,n){t.prototype[e]=function(t,r){var i;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new I("Graph.".concat(e,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new I("Graph.".concat(e,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+t,a=""+r;if(r=arguments[2],!(i=d(this,o,a,n)))throw new F("Graph.".concat(e,': could not find an edge for the given path ("').concat(o,'" - "').concat(a,'").'))}else {if("mixed"!==n)throw new I("Graph.".concat(e,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(t=""+t,!(i=this._edges.get(t)))throw new F("Graph.".concat(e,': could not find the "').concat(t,'" edge in the graph.'))}if("function"!=typeof r)throw new B("Graph.".concat(e,": provided updater is not a function."));return i.attributes=r(i.attributes),this.emit("edgeAttributesUpdated",{key:i.key,type:"update",attributes:i.attributes}),this};}}];var Z=O,$=P,tt=function(){var t=arguments,e=null,n=-1;return new Z((function(){for(var r=null;;){if(null===e){if(++n>=t.length)return {done:true};e=$(t[n]);}if(true!==(r=e.next()).done)break;e=null;}return r}))},et=[{name:"edges",type:"mixed"},{name:"inEdges",type:"directed",direction:"in"},{name:"outEdges",type:"directed",direction:"out"},{name:"inboundEdges",type:"mixed",direction:"in"},{name:"outboundEdges",type:"mixed",direction:"out"},{name:"directedEdges",type:"directed"},{name:"undirectedEdges",type:"undirected"}];function nt(t,e,n,r){var i=false;for(var o in e)if(o!==r){var a=e[o];if(i=n(a.key,a.attributes,a.source.key,a.target.key,a.source.attributes,a.target.attributes,a.undirected),t&&i)return a.key}}function rt(t,e,n,r){var i,o,a,c=false;for(var u in e)if(u!==r){i=e[u];do{if(o=i.source,a=i.target,c=n(i.key,i.attributes,o.key,a.key,o.attributes,a.attributes,i.undirected),t&&c)return i.key;i=i.next;}while(undefined!==i)}}function it(t,e){var n,r=Object.keys(t),i=r.length,o=0;return new O((function(){do{if(n)n=n.next;else {if(o>=i)return {done:true};var a=r[o++];if(a===e){n=undefined;continue}n=t[a];}}while(!n);return {done:false,value:{edge:n.key,attributes:n.attributes,source:n.source.key,target:n.target.key,sourceAttributes:n.source.attributes,targetAttributes:n.target.attributes,undirected:n.undirected}}}))}function ot(t,e,n,r){var i=e[n];if(i){var o=i.source,a=i.target;return r(i.key,i.attributes,o.key,a.key,o.attributes,a.attributes,i.undirected)&&t?i.key:undefined}}function at(t,e,n,r){var i=e[n];if(i){var o=false;do{if(o=r(i.key,i.attributes,i.source.key,i.target.key,i.source.attributes,i.target.attributes,i.undirected),t&&o)return i.key;i=i.next;}while(undefined!==i)}}function ct(t,e){var n=t[e];return undefined!==n.next?new O((function(){if(!n)return {done:true};var t={edge:n.key,attributes:n.attributes,source:n.source.key,target:n.target.key,sourceAttributes:n.source.attributes,targetAttributes:n.target.attributes,undirected:n.undirected};return n=n.next,{done:false,value:t}})):O.of({edge:n.key,attributes:n.attributes,source:n.source.key,target:n.target.key,sourceAttributes:n.source.attributes,targetAttributes:n.target.attributes,undirected:n.undirected})}function ut(t,e){if(0===t.size)return [];if("mixed"===e||e===t.type)return "function"==typeof Array.from?Array.from(t._edges.keys()):K(t._edges.keys(),t._edges.size);for(var n,r,i="undirected"===e?t.undirectedSize:t.directedSize,o=new Array(i),a="undirected"===e,c=t._edges.values(),u=0;true!==(n=c.next()).done;)(r=n.value).undirected===a&&(o[u++]=r.key);return o}function dt(t,e,n,r){if(0!==e.size)for(var i,o,a="mixed"!==n&&n!==e.type,c="undirected"===n,u=false,d=e._edges.values();true!==(i=d.next()).done;)if(o=i.value,!a||o.undirected===c){var s=o,h=s.key,p=s.attributes,f=s.source,l=s.target;if(u=r(h,p,f.key,l.key,f.attributes,l.attributes,o.undirected),t&&u)return h}}function st(t,e){if(0===t.size)return O.empty();var n="mixed"!==e&&e!==t.type,r="undirected"===e,i=t._edges.values();return new O((function(){for(var t,e;;){if((t=i.next()).done)return t;if(e=t.value,!n||e.undirected===r)break}return {value:{edge:e.key,attributes:e.attributes,source:e.source.key,target:e.target.key,sourceAttributes:e.source.attributes,targetAttributes:e.target.attributes,undirected:e.undirected},done:false}}))}function ht(t,e,n,r,i,o){var a,c=e?rt:nt;if("undirected"!==n){if("out"!==r&&(a=c(t,i.in,o),t&&a))return a;if("in"!==r&&(a=c(t,i.out,o,r?undefined:i.key),t&&a))return a}if("directed"!==n&&(a=c(t,i.undirected,o),t&&a))return a}function pt(t,e,n,r){var i=[];return ht(false,t,e,n,r,(function(t){i.push(t);})),i}function ft(t,e,n){var r=O.empty();return "undirected"!==t&&("out"!==e&&undefined!==n.in&&(r=tt(r,it(n.in))),"in"!==e&&undefined!==n.out&&(r=tt(r,it(n.out,e?undefined:n.key)))),"directed"!==t&&undefined!==n.undirected&&(r=tt(r,it(n.undirected))),r}function lt(t,e,n,r,i,o,a){var c,u=n?at:ot;if("undirected"!==e){if(undefined!==i.in&&"out"!==r&&(c=u(t,i.in,o,a),t&&c))return c;if(undefined!==i.out&&"in"!==r&&(r||i.key!==o)&&(c=u(t,i.out,o,a),t&&c))return c}if("directed"!==e&&undefined!==i.undirected&&(c=u(t,i.undirected,o,a),t&&c))return c}function gt(t,e,n,r,i){var o=[];return lt(false,t,e,n,r,i,(function(t){o.push(t);})),o}function yt(t,e,n,r){var i=O.empty();return "undirected"!==t&&(undefined!==n.in&&"out"!==e&&r in n.in&&(i=tt(i,ct(n.in,r))),undefined!==n.out&&"in"!==e&&r in n.out&&(e||n.key!==r)&&(i=tt(i,ct(n.out,r)))),"directed"!==t&&undefined!==n.undirected&&r in n.undirected&&(i=tt(i,ct(n.undirected,r))),i}var wt=[{name:"neighbors",type:"mixed"},{name:"inNeighbors",type:"directed",direction:"in"},{name:"outNeighbors",type:"directed",direction:"out"},{name:"inboundNeighbors",type:"mixed",direction:"in"},{name:"outboundNeighbors",type:"mixed",direction:"out"},{name:"directedNeighbors",type:"directed"},{name:"undirectedNeighbors",type:"undirected"}];function vt(){this.A=null,this.B=null;}function bt(t,e,n,r,i){for(var o in r){var a=r[o],c=a.source,u=a.target,d=c===n?u:c;if(!e||!e.has(d.key)){var s=i(d.key,d.attributes);if(t&&s)return d.key}}}function mt(t,e,n,r,i){if("mixed"!==e){if("undirected"===e)return bt(t,null,r,r.undirected,i);if("string"==typeof n)return bt(t,null,r,r[n],i)}var o,a=new vt;if("undirected"!==e){if("out"!==n){if(o=bt(t,null,r,r.in,i),t&&o)return o;a.wrap(r.in);}if("in"!==n){if(o=bt(t,a,r,r.out,i),t&&o)return o;a.wrap(r.out);}}if("directed"!==e&&(o=bt(t,a,r,r.undirected,i),t&&o))return o}function kt(t,e,n){var r=Object.keys(n),i=r.length,o=0;return new O((function(){var a=null;do{if(o>=i)return t&&t.wrap(n),{done:true};var c=n[r[o++]],u=c.source,d=c.target;a=u===e?d:u,t&&t.has(a.key)&&(a=null);}while(null===a);return {done:false,value:{neighbor:a.key,attributes:a.attributes}}}))}function _t(t,e){var n=e.name,r=e.type,i=e.direction;t.prototype[n]=function(t){if("mixed"!==r&&"mixed"!==this.type&&r!==this.type)return [];t=""+t;var e=this._nodes.get(t);if(undefined===e)throw new F("Graph.".concat(n,': could not find the "').concat(t,'" node in the graph.'));return function(t,e,n){if("mixed"!==t){if("undirected"===t)return Object.keys(n.undirected);if("string"==typeof e)return Object.keys(n[e])}var r=[];return mt(false,t,e,n,(function(t){r.push(t);})),r}("mixed"===r?this.type:r,i,e)};}function Gt(t,e){var n=e.name,r=e.type,i=e.direction,o=n.slice(0,-1)+"Entries";t.prototype[o]=function(t){if("mixed"!==r&&"mixed"!==this.type&&r!==this.type)return O.empty();t=""+t;var e=this._nodes.get(t);if(undefined===e)throw new F("Graph.".concat(o,': could not find the "').concat(t,'" node in the graph.'));return function(t,e,n){if("mixed"!==t){if("undirected"===t)return kt(null,n,n.undirected);if("string"==typeof e)return kt(null,n,n[e])}var r=O.empty(),i=new vt;return "undirected"!==t&&("out"!==e&&(r=tt(r,kt(i,n,n.in))),"in"!==e&&(r=tt(r,kt(i,n,n.out)))),"directed"!==t&&(r=tt(r,kt(i,n,n.undirected))),r}("mixed"===r?this.type:r,i,e)};}function xt(t,e,n,r,i){for(var o,a,c,u,d,s,h,p=r._nodes.values(),f=r.type;true!==(o=p.next()).done;){var l=false;if(a=o.value,"undirected"!==f)for(c in u=a.out){d=u[c];do{if(s=d.target,l=true,h=i(a.key,s.key,a.attributes,s.attributes,d.key,d.attributes,d.undirected),t);d=d.next;}while(d)}if("directed"!==f)for(c in u=a.undirected)if(!(e&&a.key>c)){d=u[c];do{if((s=d.target).key!==c&&(s=d.source),l=true,h=i(a.key,s.key,a.attributes,s.attributes,d.key,d.attributes,d.undirected),t);d=d.next;}while(d)}if(n&&!l&&(h=i(a.key,null,a.attributes,null,null,null,null),t));}}function Et(t){if(!s(t))throw new B('Graph.import: invalid serialized node. A serialized node should be a plain object with at least a "key" property.');if(!("key"in t))throw new B("Graph.import: serialized node is missing its key.");if("attributes"in t&&(!s(t.attributes)||null===t.attributes))throw new B("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.")}function At(t){if(!s(t))throw new B('Graph.import: invalid serialized edge. A serialized edge should be a plain object with at least a "source" & "target" property.');if(!("source"in t))throw new B("Graph.import: serialized edge is missing its source.");if(!("target"in t))throw new B("Graph.import: serialized edge is missing its target.");if("attributes"in t&&(!s(t.attributes)||null===t.attributes))throw new B("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.");if("undirected"in t&&"boolean"!=typeof t.undirected)throw new B("Graph.import: invalid undirectedness information. Undirected should be boolean or omitted.")}vt.prototype.wrap=function(t){null===this.A?this.A=t:null===this.B&&(this.B=t);},vt.prototype.has=function(t){return null!==this.A&&t in this.A||null!==this.B&&t in this.B};var Lt,St=(Lt=255&Math.floor(256*Math.random()),function(){return Lt++}),Dt=new Set(["directed","undirected","mixed"]),Ut=new Set(["domain","_events","_eventsCount","_maxListeners"]),Nt={allowSelfLoops:true,multi:false,type:"mixed"};function Ot(t,e,n){var r=new t.NodeDataClass(e,n);return t._nodes.set(e,r),t.emit("nodeAdded",{key:e,attributes:n}),r}function jt(t,e,n,r,i,o,a,c){if(!r&&"undirected"===t.type)throw new I("Graph.".concat(e,": you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead."));if(r&&"directed"===t.type)throw new I("Graph.".concat(e,": you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead."));if(c&&!s(c))throw new B("Graph.".concat(e,': invalid attributes. Expecting an object but got "').concat(c,'"'));if(o=""+o,a=""+a,c=c||{},!t.allowSelfLoops&&o===a)throw new I("Graph.".concat(e,': source & target are the same ("').concat(o,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var u=t._nodes.get(o),d=t._nodes.get(a);if(!u)throw new F("Graph.".concat(e,': source node "').concat(o,'" not found.'));if(!d)throw new F("Graph.".concat(e,': target node "').concat(a,'" not found.'));var h={key:null,undirected:r,source:o,target:a,attributes:c};if(n)i=t._edgeKeyGenerator();else if(i=""+i,t._edges.has(i))throw new I("Graph.".concat(e,': the "').concat(i,'" edge already exists in the graph.'));if(!t.multi&&(r?undefined!==u.undirected[a]:undefined!==u.out[a]))throw new I("Graph.".concat(e,': an edge linking "').concat(o,'" to "').concat(a,"\" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option."));var p=new V(r,i,u,d,c);t._edges.set(i,p);var f=o===a;return r?(u.undirectedDegree++,d.undirectedDegree++,f&&(u.undirectedLoops++,t._undirectedSelfLoopCount++)):(u.outDegree++,d.inDegree++,f&&(u.directedLoops++,t._directedSelfLoopCount++)),t.multi?p.attachMulti():p.attach(),r?t._undirectedSize++:t._directedSize++,h.key=i,t.emit("edgeAdded",h),i}function Ct(t,e,n,r,i,o,a,c,d){if(!r&&"undirected"===t.type)throw new I("Graph.".concat(e,": you cannot merge/update a directed edge to an undirected graph. Use the #.mergeEdge/#.updateEdge or #.addUndirectedEdge instead."));if(r&&"directed"===t.type)throw new I("Graph.".concat(e,": you cannot merge/update an undirected edge to a directed graph. Use the #.mergeEdge/#.updateEdge or #.addDirectedEdge instead."));if(c)if(d){if("function"!=typeof c)throw new B("Graph.".concat(e,': invalid updater function. Expecting a function but got "').concat(c,'"'))}else if(!s(c))throw new B("Graph.".concat(e,': invalid attributes. Expecting an object but got "').concat(c,'"'));var h;if(o=""+o,a=""+a,d&&(h=c,c=undefined),!t.allowSelfLoops&&o===a)throw new I("Graph.".concat(e,': source & target are the same ("').concat(o,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var p,f,l=t._nodes.get(o),g=t._nodes.get(a);if(!n&&(p=t._edges.get(i))){if(!(p.source.key===o&&p.target.key===a||r&&p.source.key===a&&p.target.key===o))throw new I("Graph.".concat(e,': inconsistency detected when attempting to merge the "').concat(i,'" edge with "').concat(o,'" source & "').concat(a,'" target vs. ("').concat(p.source.key,'", "').concat(p.target.key,'").'));f=p;}if(f||t.multi||!l||(f=r?l.undirected[a]:l.out[a]),f){var y=[f.key,false,false,false];if(d?!h:!c)return y;if(d){var w=f.attributes;f.attributes=h(w),t.emit("edgeAttributesUpdated",{type:"replace",key:f.key,attributes:f.attributes});}else u(f.attributes,c),t.emit("edgeAttributesUpdated",{type:"merge",key:f.key,attributes:f.attributes,data:c});return y}c=c||{},d&&h&&(c=h(c));var v={key:null,undirected:r,source:o,target:a,attributes:c};if(n)i=t._edgeKeyGenerator();else if(i=""+i,t._edges.has(i))throw new I("Graph.".concat(e,': the "').concat(i,'" edge already exists in the graph.'));var b=false,m=false;l||(l=Ot(t,o,{}),b=true,o===a&&(g=l,m=true)),g||(g=Ot(t,a,{}),m=true),p=new V(r,i,l,g,c),t._edges.set(i,p);var k=o===a;return r?(l.undirectedDegree++,g.undirectedDegree++,k&&(l.undirectedLoops++,t._undirectedSelfLoopCount++)):(l.outDegree++,g.inDegree++,k&&(l.directedLoops++,t._directedSelfLoopCount++)),t.multi?p.attachMulti():p.attach(),r?t._undirectedSize++:t._directedSize++,v.key=i,t.emit("edgeAdded",v),[i,true,b,m]}function Mt(t,e){t._edges.delete(e.key);var n=e.source,r=e.target,i=e.attributes,o=e.undirected,a=n===r;o?(n.undirectedDegree--,r.undirectedDegree--,a&&(n.undirectedLoops--,t._undirectedSelfLoopCount--)):(n.outDegree--,r.inDegree--,a&&(n.directedLoops--,t._directedSelfLoopCount--)),t.multi?e.detachMulti():e.detach(),o?t._undirectedSize--:t._directedSize--,t.emit("edgeDropped",{key:e.key,attributes:i,source:n.key,target:r.key,undirected:o});}var zt=function(n){function r(t){var e;if(e=n.call(this)||this,"boolean"!=typeof(t=u({},Nt,t)).multi)throw new B("Graph.constructor: invalid 'multi' option. Expecting a boolean but got \"".concat(t.multi,'".'));if(!Dt.has(t.type))throw new B('Graph.constructor: invalid \'type\' option. Should be one of "mixed", "directed" or "undirected" but got "'.concat(t.type,'".'));if("boolean"!=typeof t.allowSelfLoops)throw new B("Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got \"".concat(t.allowSelfLoops,'".'));var r="mixed"===t.type?Y:"directed"===t.type?q:J;p(c(e),"NodeDataClass",r);var i="geid_"+St()+"_",o=0;return p(c(e),"_attributes",{}),p(c(e),"_nodes",new Map),p(c(e),"_edges",new Map),p(c(e),"_directedSize",0),p(c(e),"_undirectedSize",0),p(c(e),"_directedSelfLoopCount",0),p(c(e),"_undirectedSelfLoopCount",0),p(c(e),"_edgeKeyGenerator",(function(){var t;do{t=i+o++;}while(e._edges.has(t));return t})),p(c(e),"_options",t),Ut.forEach((function(t){return p(c(e),t,e[t])})),f(c(e),"order",(function(){return e._nodes.size})),f(c(e),"size",(function(){return e._edges.size})),f(c(e),"directedSize",(function(){return e._directedSize})),f(c(e),"undirectedSize",(function(){return e._undirectedSize})),f(c(e),"selfLoopCount",(function(){return e._directedSelfLoopCount+e._undirectedSelfLoopCount})),f(c(e),"directedSelfLoopCount",(function(){return e._directedSelfLoopCount})),f(c(e),"undirectedSelfLoopCount",(function(){return e._undirectedSelfLoopCount})),f(c(e),"multi",e._options.multi),f(c(e),"type",e._options.type),f(c(e),"allowSelfLoops",e._options.allowSelfLoops),f(c(e),"implementation",(function(){return "graphology"})),e}e(r,n);var i=r.prototype;return i._resetInstanceCounters=function(){this._directedSize=0,this._undirectedSize=0,this._directedSelfLoopCount=0,this._undirectedSelfLoopCount=0;},i.hasNode=function(t){return this._nodes.has(""+t)},i.hasDirectedEdge=function(t,e){if("undirected"===this.type)return false;if(1===arguments.length){var n=""+t,r=this._edges.get(n);return !!r&&!r.undirected}if(2===arguments.length){t=""+t,e=""+e;var i=this._nodes.get(t);return !!i&&i.out.hasOwnProperty(e)}throw new B("Graph.hasDirectedEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},i.hasUndirectedEdge=function(t,e){if("directed"===this.type)return false;if(1===arguments.length){var n=""+t,r=this._edges.get(n);return !!r&&r.undirected}if(2===arguments.length){t=""+t,e=""+e;var i=this._nodes.get(t);return !!i&&i.undirected.hasOwnProperty(e)}throw new B("Graph.hasDirectedEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},i.hasEdge=function(t,e){if(1===arguments.length){var n=""+t;return this._edges.has(n)}if(2===arguments.length){t=""+t,e=""+e;var r=this._nodes.get(t);return !!r&&(undefined!==r.out&&r.out.hasOwnProperty(e)||undefined!==r.undirected&&r.undirected.hasOwnProperty(e))}throw new B("Graph.hasEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},i.directedEdge=function(t,e){if("undirected"!==this.type){if(t=""+t,e=""+e,this.multi)throw new I("Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.");var n=this._nodes.get(t);if(!n)throw new F('Graph.directedEdge: could not find the "'.concat(t,'" source node in the graph.'));if(!this._nodes.has(e))throw new F('Graph.directedEdge: could not find the "'.concat(e,'" target node in the graph.'));var r=n.out&&n.out[e]||undefined;return r?r.key:undefined}},i.undirectedEdge=function(t,e){if("directed"!==this.type){if(t=""+t,e=""+e,this.multi)throw new I("Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.");var n=this._nodes.get(t);if(!n)throw new F('Graph.undirectedEdge: could not find the "'.concat(t,'" source node in the graph.'));if(!this._nodes.has(e))throw new F('Graph.undirectedEdge: could not find the "'.concat(e,'" target node in the graph.'));var r=n.undirected&&n.undirected[e]||undefined;return r?r.key:undefined}},i.edge=function(t,e){if(this.multi)throw new I("Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.");t=""+t,e=""+e;var n=this._nodes.get(t);if(!n)throw new F('Graph.edge: could not find the "'.concat(t,'" source node in the graph.'));if(!this._nodes.has(e))throw new F('Graph.edge: could not find the "'.concat(e,'" target node in the graph.'));var r=n.out&&n.out[e]||n.undirected&&n.undirected[e]||undefined;if(r)return r.key},i.areDirectedNeighbors=function(t,e){t=""+t,e=""+e;var n=this._nodes.get(t);if(!n)throw new F('Graph.areDirectedNeighbors: could not find the "'.concat(t,'" node in the graph.'));return "undirected"!==this.type&&(e in n.in||e in n.out)},i.areOutNeighbors=function(t,e){t=""+t,e=""+e;var n=this._nodes.get(t);if(!n)throw new F('Graph.areOutNeighbors: could not find the "'.concat(t,'" node in the graph.'));return "undirected"!==this.type&&e in n.out},i.areInNeighbors=function(t,e){t=""+t,e=""+e;var n=this._nodes.get(t);if(!n)throw new F('Graph.areInNeighbors: could not find the "'.concat(t,'" node in the graph.'));return "undirected"!==this.type&&e in n.in},i.areUndirectedNeighbors=function(t,e){t=""+t,e=""+e;var n=this._nodes.get(t);if(!n)throw new F('Graph.areUndirectedNeighbors: could not find the "'.concat(t,'" node in the graph.'));return "directed"!==this.type&&e in n.undirected},i.areNeighbors=function(t,e){t=""+t,e=""+e;var n=this._nodes.get(t);if(!n)throw new F('Graph.areNeighbors: could not find the "'.concat(t,'" node in the graph.'));return "undirected"!==this.type&&(e in n.in||e in n.out)||"directed"!==this.type&&e in n.undirected},i.areInboundNeighbors=function(t,e){t=""+t,e=""+e;var n=this._nodes.get(t);if(!n)throw new F('Graph.areInboundNeighbors: could not find the "'.concat(t,'" node in the graph.'));return "undirected"!==this.type&&e in n.in||"directed"!==this.type&&e in n.undirected},i.areOutboundNeighbors=function(t,e){t=""+t,e=""+e;var n=this._nodes.get(t);if(!n)throw new F('Graph.areOutboundNeighbors: could not find the "'.concat(t,'" node in the graph.'));return "undirected"!==this.type&&e in n.out||"directed"!==this.type&&e in n.undirected},i.inDegree=function(t){t=""+t;var e=this._nodes.get(t);if(!e)throw new F('Graph.inDegree: could not find the "'.concat(t,'" node in the graph.'));return "undirected"===this.type?0:e.inDegree},i.outDegree=function(t){t=""+t;var e=this._nodes.get(t);if(!e)throw new F('Graph.outDegree: could not find the "'.concat(t,'" node in the graph.'));return "undirected"===this.type?0:e.outDegree},i.directedDegree=function(t){t=""+t;var e=this._nodes.get(t);if(!e)throw new F('Graph.directedDegree: could not find the "'.concat(t,'" node in the graph.'));return "undirected"===this.type?0:e.inDegree+e.outDegree},i.undirectedDegree=function(t){t=""+t;var e=this._nodes.get(t);if(!e)throw new F('Graph.undirectedDegree: could not find the "'.concat(t,'" node in the graph.'));return "directed"===this.type?0:e.undirectedDegree},i.inboundDegree=function(t){t=""+t;var e=this._nodes.get(t);if(!e)throw new F('Graph.inboundDegree: could not find the "'.concat(t,'" node in the graph.'));var n=0;return "directed"!==this.type&&(n+=e.undirectedDegree),"undirected"!==this.type&&(n+=e.inDegree),n},i.outboundDegree=function(t){t=""+t;var e=this._nodes.get(t);if(!e)throw new F('Graph.outboundDegree: could not find the "'.concat(t,'" node in the graph.'));var n=0;return "directed"!==this.type&&(n+=e.undirectedDegree),"undirected"!==this.type&&(n+=e.outDegree),n},i.degree=function(t){t=""+t;var e=this._nodes.get(t);if(!e)throw new F('Graph.degree: could not find the "'.concat(t,'" node in the graph.'));var n=0;return "directed"!==this.type&&(n+=e.undirectedDegree),"undirected"!==this.type&&(n+=e.inDegree+e.outDegree),n},i.inDegreeWithoutSelfLoops=function(t){t=""+t;var e=this._nodes.get(t);if(!e)throw new F('Graph.inDegreeWithoutSelfLoops: could not find the "'.concat(t,'" node in the graph.'));return "undirected"===this.type?0:e.inDegree-e.directedLoops},i.outDegreeWithoutSelfLoops=function(t){t=""+t;var e=this._nodes.get(t);if(!e)throw new F('Graph.outDegreeWithoutSelfLoops: could not find the "'.concat(t,'" node in the graph.'));return "undirected"===this.type?0:e.outDegree-e.directedLoops},i.directedDegreeWithoutSelfLoops=function(t){t=""+t;var e=this._nodes.get(t);if(!e)throw new F('Graph.directedDegreeWithoutSelfLoops: could not find the "'.concat(t,'" node in the graph.'));return "undirected"===this.type?0:e.inDegree+e.outDegree-2*e.directedLoops},i.undirectedDegreeWithoutSelfLoops=function(t){t=""+t;var e=this._nodes.get(t);if(!e)throw new F('Graph.undirectedDegreeWithoutSelfLoops: could not find the "'.concat(t,'" node in the graph.'));return "directed"===this.type?0:e.undirectedDegree-2*e.undirectedLoops},i.inboundDegreeWithoutSelfLoops=function(t){t=""+t;var e=this._nodes.get(t);if(!e)throw new F('Graph.inboundDegreeWithoutSelfLoops: could not find the "'.concat(t,'" node in the graph.'));var n=0,r=0;return "directed"!==this.type&&(n+=e.undirectedDegree,r+=2*e.undirectedLoops),"undirected"!==this.type&&(n+=e.inDegree,r+=e.directedLoops),n-r},i.outboundDegreeWithoutSelfLoops=function(t){t=""+t;var e=this._nodes.get(t);if(!e)throw new F('Graph.outboundDegreeWithoutSelfLoops: could not find the "'.concat(t,'" node in the graph.'));var n=0,r=0;return "directed"!==this.type&&(n+=e.undirectedDegree,r+=2*e.undirectedLoops),"undirected"!==this.type&&(n+=e.outDegree,r+=e.directedLoops),n-r},i.degreeWithoutSelfLoops=function(t){t=""+t;var e=this._nodes.get(t);if(!e)throw new F('Graph.degreeWithoutSelfLoops: could not find the "'.concat(t,'" node in the graph.'));var n=0,r=0;return "directed"!==this.type&&(n+=e.undirectedDegree,r+=2*e.undirectedLoops),"undirected"!==this.type&&(n+=e.inDegree+e.outDegree,r+=2*e.directedLoops),n-r},i.source=function(t){t=""+t;var e=this._edges.get(t);if(!e)throw new F('Graph.source: could not find the "'.concat(t,'" edge in the graph.'));return e.source.key},i.target=function(t){t=""+t;var e=this._edges.get(t);if(!e)throw new F('Graph.target: could not find the "'.concat(t,'" edge in the graph.'));return e.target.key},i.extremities=function(t){t=""+t;var e=this._edges.get(t);if(!e)throw new F('Graph.extremities: could not find the "'.concat(t,'" edge in the graph.'));return [e.source.key,e.target.key]},i.opposite=function(t,e){t=""+t,e=""+e;var n=this._edges.get(e);if(!n)throw new F('Graph.opposite: could not find the "'.concat(e,'" edge in the graph.'));var r=n.source.key,i=n.target.key;if(t===r)return i;if(t===i)return r;throw new F('Graph.opposite: the "'.concat(t,'" node is not attached to the "').concat(e,'" edge (').concat(r,", ").concat(i,")."))},i.hasExtremity=function(t,e){t=""+t,e=""+e;var n=this._edges.get(t);if(!n)throw new F('Graph.hasExtremity: could not find the "'.concat(t,'" edge in the graph.'));return n.source.key===e||n.target.key===e},i.isUndirected=function(t){t=""+t;var e=this._edges.get(t);if(!e)throw new F('Graph.isUndirected: could not find the "'.concat(t,'" edge in the graph.'));return e.undirected},i.isDirected=function(t){t=""+t;var e=this._edges.get(t);if(!e)throw new F('Graph.isDirected: could not find the "'.concat(t,'" edge in the graph.'));return !e.undirected},i.isSelfLoop=function(t){t=""+t;var e=this._edges.get(t);if(!e)throw new F('Graph.isSelfLoop: could not find the "'.concat(t,'" edge in the graph.'));return e.source===e.target},i.addNode=function(t,e){var n=function(t,e,n){if(n&&!s(n))throw new B('Graph.addNode: invalid attributes. Expecting an object but got "'.concat(n,'"'));if(e=""+e,n=n||{},t._nodes.has(e))throw new I('Graph.addNode: the "'.concat(e,'" node already exist in the graph.'));var r=new t.NodeDataClass(e,n);return t._nodes.set(e,r),t.emit("nodeAdded",{key:e,attributes:n}),r}(this,t,e);return n.key},i.mergeNode=function(t,e){if(e&&!s(e))throw new B('Graph.mergeNode: invalid attributes. Expecting an object but got "'.concat(e,'"'));t=""+t,e=e||{};var n=this._nodes.get(t);return n?(e&&(u(n.attributes,e),this.emit("nodeAttributesUpdated",{type:"merge",key:t,attributes:n.attributes,data:e})),[t,false]):(n=new this.NodeDataClass(t,e),this._nodes.set(t,n),this.emit("nodeAdded",{key:t,attributes:e}),[t,true])},i.updateNode=function(t,e){if(e&&"function"!=typeof e)throw new B('Graph.updateNode: invalid updater function. Expecting a function but got "'.concat(e,'"'));t=""+t;var n=this._nodes.get(t);if(n){if(e){var r=n.attributes;n.attributes=e(r),this.emit("nodeAttributesUpdated",{type:"replace",key:t,attributes:n.attributes});}return [t,false]}var i=e?e({}):{};return n=new this.NodeDataClass(t,i),this._nodes.set(t,n),this.emit("nodeAdded",{key:t,attributes:i}),[t,true]},i.dropNode=function(t){t=""+t;var e,n=this._nodes.get(t);if(!n)throw new F('Graph.dropNode: could not find the "'.concat(t,'" node in the graph.'));if("undirected"!==this.type){for(var r in n.out){e=n.out[r];do{Mt(this,e),e=e.next;}while(e)}for(var i in n.in){e=n.in[i];do{Mt(this,e),e=e.next;}while(e)}}if("directed"!==this.type)for(var o in n.undirected){e=n.undirected[o];do{Mt(this,e),e=e.next;}while(e)}this._nodes.delete(t),this.emit("nodeDropped",{key:t,attributes:n.attributes});},i.dropEdge=function(t){var e;if(arguments.length>1){var n=""+arguments[0],r=""+arguments[1];if(!(e=d(this,n,r,this.type)))throw new F('Graph.dropEdge: could not find the "'.concat(n,'" -> "').concat(r,'" edge in the graph.'))}else if(t=""+t,!(e=this._edges.get(t)))throw new F('Graph.dropEdge: could not find the "'.concat(t,'" edge in the graph.'));return Mt(this,e),this},i.dropDirectedEdge=function(t,e){if(arguments.length<2)throw new I("Graph.dropDirectedEdge: it does not make sense to try and drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.");if(this.multi)throw new I("Graph.dropDirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");var n=d(this,t=""+t,e=""+e,"directed");if(!n)throw new F('Graph.dropDirectedEdge: could not find a "'.concat(t,'" -> "').concat(e,'" edge in the graph.'));return Mt(this,n),this},i.dropUndirectedEdge=function(t,e){if(arguments.length<2)throw new I("Graph.dropUndirectedEdge: it does not make sense to drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.");if(this.multi)throw new I("Graph.dropUndirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");var n=d(this,t,e,"undirected");if(!n)throw new F('Graph.dropUndirectedEdge: could not find a "'.concat(t,'" -> "').concat(e,'" edge in the graph.'));return Mt(this,n),this},i.clear=function(){this._edges.clear(),this._nodes.clear(),this._resetInstanceCounters(),this.emit("cleared");},i.clearEdges=function(){for(var t,e=this._nodes.values();true!==(t=e.next()).done;)t.value.clear();this._edges.clear(),this._resetInstanceCounters(),this.emit("edgesCleared");},i.getAttribute=function(t){return this._attributes[t]},i.getAttributes=function(){return this._attributes},i.hasAttribute=function(t){return this._attributes.hasOwnProperty(t)},i.setAttribute=function(t,e){return this._attributes[t]=e,this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:t}),this},i.updateAttribute=function(t,e){if("function"!=typeof e)throw new B("Graph.updateAttribute: updater should be a function.");var n=this._attributes[t];return this._attributes[t]=e(n),this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:t}),this},i.removeAttribute=function(t){return delete this._attributes[t],this.emit("attributesUpdated",{type:"remove",attributes:this._attributes,name:t}),this},i.replaceAttributes=function(t){if(!s(t))throw new B("Graph.replaceAttributes: provided attributes are not a plain object.");return this._attributes=t,this.emit("attributesUpdated",{type:"replace",attributes:this._attributes}),this},i.mergeAttributes=function(t){if(!s(t))throw new B("Graph.mergeAttributes: provided attributes are not a plain object.");return u(this._attributes,t),this.emit("attributesUpdated",{type:"merge",attributes:this._attributes,data:t}),this},i.updateAttributes=function(t){if("function"!=typeof t)throw new B("Graph.updateAttributes: provided updater is not a function.");return this._attributes=t(this._attributes),this.emit("attributesUpdated",{type:"update",attributes:this._attributes}),this},i.updateEachNodeAttributes=function(t,e){if("function"!=typeof t)throw new B("Graph.updateEachNodeAttributes: expecting an updater function.");if(e&&!l(e))throw new B("Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");for(var n,r,i=this._nodes.values();true!==(n=i.next()).done;)(r=n.value).attributes=t(r.key,r.attributes);this.emit("eachNodeAttributesUpdated",{hints:e||null});},i.updateEachEdgeAttributes=function(t,e){if("function"!=typeof t)throw new B("Graph.updateEachEdgeAttributes: expecting an updater function.");if(e&&!l(e))throw new B("Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");for(var n,r,i,o,a=this._edges.values();true!==(n=a.next()).done;)i=(r=n.value).source,o=r.target,r.attributes=t(r.key,r.attributes,i.key,o.key,i.attributes,o.attributes,r.undirected);this.emit("eachEdgeAttributesUpdated",{hints:e||null});},i.forEachAdjacencyEntry=function(t){if("function"!=typeof t)throw new B("Graph.forEachAdjacencyEntry: expecting a callback.");xt(false,false,false,this,t);},i.forEachAdjacencyEntryWithOrphans=function(t){if("function"!=typeof t)throw new B("Graph.forEachAdjacencyEntryWithOrphans: expecting a callback.");xt(false,false,true,this,t);},i.forEachAssymetricAdjacencyEntry=function(t){if("function"!=typeof t)throw new B("Graph.forEachAssymetricAdjacencyEntry: expecting a callback.");xt(false,true,false,this,t);},i.forEachAssymetricAdjacencyEntryWithOrphans=function(t){if("function"!=typeof t)throw new B("Graph.forEachAssymetricAdjacencyEntryWithOrphans: expecting a callback.");xt(false,true,true,this,t);},i.nodes=function(){return "function"==typeof Array.from?Array.from(this._nodes.keys()):K(this._nodes.keys(),this._nodes.size)},i.forEachNode=function(t){if("function"!=typeof t)throw new B("Graph.forEachNode: expecting a callback.");for(var e,n,r=this._nodes.values();true!==(e=r.next()).done;)t((n=e.value).key,n.attributes);},i.findNode=function(t){if("function"!=typeof t)throw new B("Graph.findNode: expecting a callback.");for(var e,n,r=this._nodes.values();true!==(e=r.next()).done;)if(t((n=e.value).key,n.attributes))return n.key},i.mapNodes=function(t){if("function"!=typeof t)throw new B("Graph.mapNode: expecting a callback.");for(var e,n,r=this._nodes.values(),i=new Array(this.order),o=0;true!==(e=r.next()).done;)n=e.value,i[o++]=t(n.key,n.attributes);return i},i.someNode=function(t){if("function"!=typeof t)throw new B("Graph.someNode: expecting a callback.");for(var e,n,r=this._nodes.values();true!==(e=r.next()).done;)if(t((n=e.value).key,n.attributes))return true;return false},i.everyNode=function(t){if("function"!=typeof t)throw new B("Graph.everyNode: expecting a callback.");for(var e,n,r=this._nodes.values();true!==(e=r.next()).done;)if(!t((n=e.value).key,n.attributes))return false;return true},i.filterNodes=function(t){if("function"!=typeof t)throw new B("Graph.filterNodes: expecting a callback.");for(var e,n,r=this._nodes.values(),i=[];true!==(e=r.next()).done;)t((n=e.value).key,n.attributes)&&i.push(n.key);return i},i.reduceNodes=function(t,e){if("function"!=typeof t)throw new B("Graph.reduceNodes: expecting a callback.");if(arguments.length<2)throw new B("Graph.reduceNodes: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.");for(var n,r,i=e,o=this._nodes.values();true!==(n=o.next()).done;)i=t(i,(r=n.value).key,r.attributes);return i},i.nodeEntries=function(){var t=this._nodes.values();return new O((function(){var e=t.next();if(e.done)return e;var n=e.value;return {value:{node:n.key,attributes:n.attributes},done:false}}))},i.export=function(){var t=this,e=new Array(this._nodes.size),n=0;this._nodes.forEach((function(t,r){e[n++]=function(t,e){var n={key:t};return h(e.attributes)||(n.attributes=u({},e.attributes)),n}(r,t);}));var r=new Array(this._edges.size);return n=0,this._edges.forEach((function(e,i){r[n++]=function(t,e,n){var r={key:e,source:n.source.key,target:n.target.key};return h(n.attributes)||(r.attributes=u({},n.attributes)),"mixed"===t&&n.undirected&&(r.undirected=true),r}(t.type,i,e);})),{options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops},attributes:this.getAttributes(),nodes:e,edges:r}},i.import=function(t){var e,n,i,o,a,c=this,u=arguments.length>1&&undefined!==arguments[1]&&arguments[1];if(t instanceof r)return t.forEachNode((function(t,e){u?c.mergeNode(t,e):c.addNode(t,e);})),t.forEachEdge((function(t,e,n,r,i,o,a){u?a?c.mergeUndirectedEdgeWithKey(t,n,r,e):c.mergeDirectedEdgeWithKey(t,n,r,e):a?c.addUndirectedEdgeWithKey(t,n,r,e):c.addDirectedEdgeWithKey(t,n,r,e);})),this;if(!s(t))throw new B("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(t.attributes){if(!s(t.attributes))throw new B("Graph.import: invalid attributes. Expecting a plain object.");u?this.mergeAttributes(t.attributes):this.replaceAttributes(t.attributes);}if(t.nodes){if(i=t.nodes,!Array.isArray(i))throw new B("Graph.import: invalid nodes. Expecting an array.");for(e=0,n=i.length;e<n;e++){Et(o=i[e]);var d=o,h=d.key,p=d.attributes;u?this.mergeNode(h,p):this.addNode(h,p);}}if(t.edges){var f=false;if("undirected"===this.type&&(f=true),i=t.edges,!Array.isArray(i))throw new B("Graph.import: invalid edges. Expecting an array.");for(e=0,n=i.length;e<n;e++){At(a=i[e]);var l=a,g=l.source,y=l.target,w=l.attributes,v=l.undirected,b=undefined===v?f:v;"key"in a?(u?b?this.mergeUndirectedEdgeWithKey:this.mergeDirectedEdgeWithKey:b?this.addUndirectedEdgeWithKey:this.addDirectedEdgeWithKey).call(this,a.key,g,y,w):(u?b?this.mergeUndirectedEdge:this.mergeDirectedEdge:b?this.addUndirectedEdge:this.addDirectedEdge).call(this,g,y,w);}}return this},i.nullCopy=function(t){var e=new r(u({},this._options,t));return e.replaceAttributes(u({},this.getAttributes())),e},i.emptyCopy=function(t){var e=this.nullCopy(t);return this._nodes.forEach((function(t,n){var r=u({},t.attributes);t=new e.NodeDataClass(n,r),e._nodes.set(n,t);})),e},i.copy=function(t){if("string"==typeof(t=t||{}).type&&t.type!==this.type&&"mixed"!==t.type)throw new I('Graph.copy: cannot create an incompatible copy from "'.concat(this.type,'" type to "').concat(t.type,'" because this would mean losing information about the current graph.'));if("boolean"==typeof t.multi&&t.multi!==this.multi&&true!==t.multi)throw new I("Graph.copy: cannot create an incompatible copy by downgrading a multi graph to a simple one because this would mean losing information about the current graph.");if("boolean"==typeof t.allowSelfLoops&&t.allowSelfLoops!==this.allowSelfLoops&&true!==t.allowSelfLoops)throw new I("Graph.copy: cannot create an incompatible copy from a graph allowing self loops to one that does not because this would mean losing information about the current graph.");for(var e,n,r=this.emptyCopy(t),i=this._edges.values();true!==(e=i.next()).done;)jt(r,"copy",false,(n=e.value).undirected,n.key,n.source.key,n.target.key,u({},n.attributes));return r},i.toJSON=function(){return this.export()},i.toString=function(){return "[object Graph]"},i.inspect=function(){var e=this,n={};this._nodes.forEach((function(t,e){n[e]=t.attributes;}));var r={},i={};this._edges.forEach((function(t,n){var o,a=t.undirected?"--":"->",c="",u=t.source.key,d=t.target.key;t.undirected&&u>d&&(o=u,u=d,d=o);var s="(".concat(u,")").concat(a,"(").concat(d,")");n.startsWith("geid_")?e.multi&&(undefined===i[s]?i[s]=0:i[s]++,c+="".concat(i[s],". ")):c+="[".concat(n,"]: "),r[c+=s]=t.attributes;}));var o={};for(var a in this)this.hasOwnProperty(a)&&!Ut.has(a)&&"function"!=typeof this[a]&&"symbol"!==t(a)&&(o[a]=this[a]);return o.attributes=this._attributes,o.nodes=n,o.edges=r,p(o,"constructor",this.constructor),o},r}(y.exports.EventEmitter);"undefined"!=typeof Symbol&&(zt.prototype[Symbol.for("nodejs.util.inspect.custom")]=zt.prototype.inspect),[{name:function(t){return "".concat(t,"Edge")},generateKey:true},{name:function(t){return "".concat(t,"DirectedEdge")},generateKey:true,type:"directed"},{name:function(t){return "".concat(t,"UndirectedEdge")},generateKey:true,type:"undirected"},{name:function(t){return "".concat(t,"EdgeWithKey")}},{name:function(t){return "".concat(t,"DirectedEdgeWithKey")},type:"directed"},{name:function(t){return "".concat(t,"UndirectedEdgeWithKey")},type:"undirected"}].forEach((function(t){["add","merge","update"].forEach((function(e){var n=t.name(e),r="add"===e?jt:Ct;t.generateKey?zt.prototype[n]=function(i,o,a){return r(this,n,true,"undirected"===(t.type||this.type),null,i,o,a,"update"===e)}:zt.prototype[n]=function(i,o,a,c){return r(this,n,false,"undirected"===(t.type||this.type),i,o,a,c,"update"===e)};}));})),function(t){Q.forEach((function(e){var n=e.name,r=e.attacher;r(t,n("Node"),0),r(t,n("Source"),1),r(t,n("Target"),2),r(t,n("Opposite"),3);}));}(zt),function(t){X.forEach((function(e){var n=e.name,r=e.attacher;r(t,n("Edge"),"mixed"),r(t,n("DirectedEdge"),"directed"),r(t,n("UndirectedEdge"),"undirected");}));}(zt),function(t){et.forEach((function(e){!function(t,e){var n=e.name,r=e.type,i=e.direction;t.prototype[n]=function(t,e){if("mixed"!==r&&"mixed"!==this.type&&r!==this.type)return [];if(!arguments.length)return ut(this,r);if(1===arguments.length){t=""+t;var o=this._nodes.get(t);if(undefined===o)throw new F("Graph.".concat(n,': could not find the "').concat(t,'" node in the graph.'));return pt(this.multi,"mixed"===r?this.type:r,i,o)}if(2===arguments.length){t=""+t,e=""+e;var a=this._nodes.get(t);if(!a)throw new F("Graph.".concat(n,': could not find the "').concat(t,'" source node in the graph.'));if(!this._nodes.has(e))throw new F("Graph.".concat(n,': could not find the "').concat(e,'" target node in the graph.'));return gt(r,this.multi,i,a,e)}throw new B("Graph.".concat(n,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))};}(t,e),function(t,e){var n=e.name,r=e.type,i=e.direction,o="forEach"+n[0].toUpperCase()+n.slice(1,-1);t.prototype[o]=function(t,e,n){if("mixed"===r||"mixed"===this.type||r===this.type){if(1===arguments.length)return dt(false,this,r,n=t);if(2===arguments.length){t=""+t,n=e;var a=this._nodes.get(t);if(undefined===a)throw new F("Graph.".concat(o,': could not find the "').concat(t,'" node in the graph.'));return ht(false,this.multi,"mixed"===r?this.type:r,i,a,n)}if(3===arguments.length){t=""+t,e=""+e;var c=this._nodes.get(t);if(!c)throw new F("Graph.".concat(o,': could not find the "').concat(t,'" source node in the graph.'));if(!this._nodes.has(e))throw new F("Graph.".concat(o,': could not find the "').concat(e,'" target node in the graph.'));return lt(false,r,this.multi,i,c,e,n)}throw new B("Graph.".concat(o,": too many arguments (expecting 1, 2 or 3 and got ").concat(arguments.length,")."))}};var a="map"+n[0].toUpperCase()+n.slice(1);t.prototype[a]=function(){var t,e=Array.prototype.slice.call(arguments),n=e.pop();if(0===e.length){var i=0;"directed"!==r&&(i+=this.undirectedSize),"undirected"!==r&&(i+=this.directedSize),t=new Array(i);var a=0;e.push((function(e,r,i,o,c,u,d){t[a++]=n(e,r,i,o,c,u,d);}));}else t=[],e.push((function(e,r,i,o,a,c,u){t.push(n(e,r,i,o,a,c,u));}));return this[o].apply(this,e),t};var c="filter"+n[0].toUpperCase()+n.slice(1);t.prototype[c]=function(){var t=Array.prototype.slice.call(arguments),e=t.pop(),n=[];return t.push((function(t,r,i,o,a,c,u){e(t,r,i,o,a,c,u)&&n.push(t);})),this[o].apply(this,t),n};var u="reduce"+n[0].toUpperCase()+n.slice(1);t.prototype[u]=function(){var t,e,n=Array.prototype.slice.call(arguments);if(n.length<2||n.length>4)throw new B("Graph.".concat(u,": invalid number of arguments (expecting 2, 3 or 4 and got ").concat(n.length,")."));if("function"==typeof n[n.length-1]&&"function"!=typeof n[n.length-2])throw new B("Graph.".concat(u,": missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array."));2===n.length?(t=n[0],e=n[1],n=[]):3===n.length?(t=n[1],e=n[2],n=[n[0]]):4===n.length&&(t=n[2],e=n[3],n=[n[0],n[1]]);var r=e;return n.push((function(e,n,i,o,a,c,u){r=t(r,e,n,i,o,a,c,u);})),this[o].apply(this,n),r};}(t,e),function(t,e){var n=e.name,r=e.type,i=e.direction,o="find"+n[0].toUpperCase()+n.slice(1,-1);t.prototype[o]=function(t,e,n){if("mixed"!==r&&"mixed"!==this.type&&r!==this.type)return false;if(1===arguments.length)return dt(true,this,r,n=t);if(2===arguments.length){t=""+t,n=e;var a=this._nodes.get(t);if(undefined===a)throw new F("Graph.".concat(o,': could not find the "').concat(t,'" node in the graph.'));return ht(true,this.multi,"mixed"===r?this.type:r,i,a,n)}if(3===arguments.length){t=""+t,e=""+e;var c=this._nodes.get(t);if(!c)throw new F("Graph.".concat(o,': could not find the "').concat(t,'" source node in the graph.'));if(!this._nodes.has(e))throw new F("Graph.".concat(o,': could not find the "').concat(e,'" target node in the graph.'));return lt(true,r,this.multi,i,c,e,n)}throw new B("Graph.".concat(o,": too many arguments (expecting 1, 2 or 3 and got ").concat(arguments.length,")."))};var a="some"+n[0].toUpperCase()+n.slice(1,-1);t.prototype[a]=function(){var t=Array.prototype.slice.call(arguments),e=t.pop();return t.push((function(t,n,r,i,o,a,c){return e(t,n,r,i,o,a,c)})),!!this[o].apply(this,t)};var c="every"+n[0].toUpperCase()+n.slice(1,-1);t.prototype[c]=function(){var t=Array.prototype.slice.call(arguments),e=t.pop();return t.push((function(t,n,r,i,o,a,c){return !e(t,n,r,i,o,a,c)})),!this[o].apply(this,t)};}(t,e),function(t,e){var n=e.name,r=e.type,i=e.direction,o=n.slice(0,-1)+"Entries";t.prototype[o]=function(t,e){if("mixed"!==r&&"mixed"!==this.type&&r!==this.type)return O.empty();if(!arguments.length)return st(this,r);if(1===arguments.length){t=""+t;var n=this._nodes.get(t);if(!n)throw new F("Graph.".concat(o,': could not find the "').concat(t,'" node in the graph.'));return ft(r,i,n)}if(2===arguments.length){t=""+t,e=""+e;var a=this._nodes.get(t);if(!a)throw new F("Graph.".concat(o,': could not find the "').concat(t,'" source node in the graph.'));if(!this._nodes.has(e))throw new F("Graph.".concat(o,': could not find the "').concat(e,'" target node in the graph.'));return yt(r,i,a,e)}throw new B("Graph.".concat(o,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))};}(t,e);}));}(zt),function(t){wt.forEach((function(e){_t(t,e),function(t,e){var n=e.name,r=e.type,i=e.direction,o="forEach"+n[0].toUpperCase()+n.slice(1,-1);t.prototype[o]=function(t,e){if("mixed"===r||"mixed"===this.type||r===this.type){t=""+t;var n=this._nodes.get(t);if(undefined===n)throw new F("Graph.".concat(o,': could not find the "').concat(t,'" node in the graph.'));mt(false,"mixed"===r?this.type:r,i,n,e);}};var a="map"+n[0].toUpperCase()+n.slice(1);t.prototype[a]=function(t,e){var n=[];return this[o](t,(function(t,r){n.push(e(t,r));})),n};var c="filter"+n[0].toUpperCase()+n.slice(1);t.prototype[c]=function(t,e){var n=[];return this[o](t,(function(t,r){e(t,r)&&n.push(t);})),n};var u="reduce"+n[0].toUpperCase()+n.slice(1);t.prototype[u]=function(t,e,n){if(arguments.length<3)throw new B("Graph.".concat(u,": missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array."));var r=n;return this[o](t,(function(t,n){r=e(r,t,n);})),r};}(t,e),function(t,e){var n=e.name,r=e.type,i=e.direction,o=n[0].toUpperCase()+n.slice(1,-1),a="find"+o;t.prototype[a]=function(t,e){if("mixed"===r||"mixed"===this.type||r===this.type){t=""+t;var n=this._nodes.get(t);if(undefined===n)throw new F("Graph.".concat(a,': could not find the "').concat(t,'" node in the graph.'));return mt(true,"mixed"===r?this.type:r,i,n,e)}};var c="some"+o;t.prototype[c]=function(t,e){return !!this[a](t,e)};var u="every"+o;t.prototype[u]=function(t,e){return !this[a](t,(function(t,n){return !e(t,n)}))};}(t,e),Gt(t,e);}));}(zt);var Wt=function(t){function n(e){var n=u({type:"directed"},e);if("multi"in n&&false!==n.multi)throw new B("DirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if("directed"!==n.type)throw new B('DirectedGraph.from: inconsistent "'+n.type+'" type in given options!');return t.call(this,n)||this}return e(n,t),n}(zt),Pt=function(t){function n(e){var n=u({type:"undirected"},e);if("multi"in n&&false!==n.multi)throw new B("UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if("undirected"!==n.type)throw new B('UndirectedGraph.from: inconsistent "'+n.type+'" type in given options!');return t.call(this,n)||this}return e(n,t),n}(zt),Rt=function(t){function n(e){var n=u({multi:true},e);if("multi"in n&&true!==n.multi)throw new B("MultiGraph.from: inconsistent indication that the graph should be simple in given options!");return t.call(this,n)||this}return e(n,t),n}(zt),Kt=function(t){function n(e){var n=u({type:"directed",multi:true},e);if("multi"in n&&true!==n.multi)throw new B("MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if("directed"!==n.type)throw new B('MultiDirectedGraph.from: inconsistent "'+n.type+'" type in given options!');return t.call(this,n)||this}return e(n,t),n}(zt),Tt=function(t){function n(e){var n=u({type:"undirected",multi:true},e);if("multi"in n&&true!==n.multi)throw new B("MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if("undirected"!==n.type)throw new B('MultiUndirectedGraph.from: inconsistent "'+n.type+'" type in given options!');return t.call(this,n)||this}return e(n,t),n}(zt);function Bt(t){t.from=function(e,n){var r=u({},e.options,n),i=new t(r);return i.import(e),i};}return Bt(zt),Bt(Wt),Bt(Pt),Bt(Rt),Bt(Kt),Bt(Tt),zt.Graph=zt,zt.DirectedGraph=Wt,zt.UndirectedGraph=Pt,zt.MultiGraph=Rt,zt.MultiDirectedGraph=Kt,zt.MultiUndirectedGraph=Tt,zt.InvalidArgumentsGraphError=B,zt.NotFoundGraphError=F,zt.UsageGraphError=I,zt}));
|
|
961
364
|
|
|
962
365
|
} (graphology_umd_min$1));
|
|
963
366
|
return graphology_umd_min$1.exports;
|
|
@@ -1213,7 +616,7 @@ var hasRequiredIterables;
|
|
|
1213
616
|
function requireIterables () {
|
|
1214
617
|
if (hasRequiredIterables) return iterables;
|
|
1215
618
|
hasRequiredIterables = 1;
|
|
1216
|
-
var forEach = requireForeach();
|
|
619
|
+
var forEach = object_hash.requireForeach();
|
|
1217
620
|
|
|
1218
621
|
var typed = requireTypedArrays();
|
|
1219
622
|
|
|
@@ -1317,7 +720,7 @@ function requireFixedDeque () {
|
|
|
1317
720
|
if (hasRequiredFixedDeque) return fixedDeque;
|
|
1318
721
|
hasRequiredFixedDeque = 1;
|
|
1319
722
|
var iterables = requireIterables(),
|
|
1320
|
-
Iterator = requireIterator();
|
|
723
|
+
Iterator = object_hash.requireIterator();
|
|
1321
724
|
|
|
1322
725
|
/**
|
|
1323
726
|
* FixedDeque.
|
|
@@ -3438,7 +2841,7 @@ function treeFromMemoryState(memory, filter = "final") {
|
|
|
3438
2841
|
const sorted = object_hash.sortParentsFirst(object_hash.toArray(filter === "final" ? memory.final : memory.elements));
|
|
3439
2842
|
const connected = new Set(memory.connections.flatMap((c) => [c.source, c.target]));
|
|
3440
2843
|
const root = new Set(sorted);
|
|
3441
|
-
const parents = new DefaultMap(() => null);
|
|
2844
|
+
const parents = new object_hash.DefaultMap(() => null);
|
|
3442
2845
|
const children = sorted.reduce((acc, parent, index, all) => {
|
|
3443
2846
|
acc.set(
|
|
3444
2847
|
parent,
|
|
@@ -3454,7 +2857,7 @@ function treeFromMemoryState(memory, filter = "final") {
|
|
|
3454
2857
|
}, [])
|
|
3455
2858
|
);
|
|
3456
2859
|
return acc;
|
|
3457
|
-
}, new DefaultMap(() => []));
|
|
2860
|
+
}, new object_hash.DefaultMap(() => []));
|
|
3458
2861
|
return {
|
|
3459
2862
|
root,
|
|
3460
2863
|
connected,
|
|
@@ -3469,13 +2872,13 @@ let StageExclude$1 = class StageExclude extends AbstractStageExclude {
|
|
|
3469
2872
|
|
|
3470
2873
|
T((c) => c.nonEmpty());
|
|
3471
2874
|
function findCrossBoundarySameSourceOrTarget(connections) {
|
|
3472
|
-
const groupedByRelation = new DefaultMap(() => []);
|
|
2875
|
+
const groupedByRelation = new object_hash.DefaultMap(() => []);
|
|
3473
2876
|
for (const conn of connections) {
|
|
3474
2877
|
for (const relation of conn.relations.model) {
|
|
3475
2878
|
groupedByRelation.get(relation).push(conn);
|
|
3476
2879
|
}
|
|
3477
2880
|
}
|
|
3478
|
-
const excludedRelations = new DefaultMap(() => /* @__PURE__ */ new Set());
|
|
2881
|
+
const excludedRelations = new object_hash.DefaultMap(() => /* @__PURE__ */ new Set());
|
|
3479
2882
|
for (const [relation, sameRelationGroup] of groupedByRelation) {
|
|
3480
2883
|
if (!object_hash.i(sameRelationGroup, 2)) {
|
|
3481
2884
|
continue;
|
|
@@ -3792,6 +3195,9 @@ function applyViewRuleStyle(rule, predicates, nodes) {
|
|
|
3792
3195
|
if (object_hash.n(rule.style.opacity)) {
|
|
3793
3196
|
styleOverride = { ...styleOverride, opacity: rule.style.opacity };
|
|
3794
3197
|
}
|
|
3198
|
+
if (object_hash.n(rule.style.multiple)) {
|
|
3199
|
+
styleOverride = { ...styleOverride, multiple: rule.style.multiple };
|
|
3200
|
+
}
|
|
3795
3201
|
if (styleOverride) {
|
|
3796
3202
|
n.style = {
|
|
3797
3203
|
...n.style,
|
|
@@ -4509,7 +3915,7 @@ const WildcardPredicate$1 = {
|
|
|
4509
3915
|
function predicateToPatch(op, { expr, where, ...ctx }) {
|
|
4510
3916
|
switch (true) {
|
|
4511
3917
|
case view.FqnExpr.isModelRef(expr):
|
|
4512
|
-
return
|
|
3918
|
+
return undefined;
|
|
4513
3919
|
case view.FqnExpr.isDeploymentRef(expr):
|
|
4514
3920
|
return DeploymentRefPredicate[op]({ ...ctx, expr, where });
|
|
4515
3921
|
case view.FqnExpr.isWildcard(expr):
|
|
@@ -4867,7 +4273,7 @@ let StageFinal$1 = class StageFinal {
|
|
|
4867
4273
|
step2ProcessImplicits(memory) {
|
|
4868
4274
|
const implicits = object_hash.union(this.memory.elements, memory.elements);
|
|
4869
4275
|
const final = object_hash.union(memory.final, this.memory.explicits);
|
|
4870
|
-
const groupedByRelation = new DefaultMap(() => /* @__PURE__ */ new Set());
|
|
4276
|
+
const groupedByRelation = new object_hash.DefaultMap(() => /* @__PURE__ */ new Set());
|
|
4871
4277
|
for (const conn of memory.connections) {
|
|
4872
4278
|
if (conn.boundary) {
|
|
4873
4279
|
for (const relation of conn.relations.model) {
|
|
@@ -5079,7 +4485,7 @@ function applyCustomElementProperties(_rules, _nodes) {
|
|
|
5079
4485
|
for (const {
|
|
5080
4486
|
custom: { expr, ...props }
|
|
5081
4487
|
} of rules) {
|
|
5082
|
-
const { border, opacity, ...rest } = d$1(props, view.n);
|
|
4488
|
+
const { border, opacity, multiple, ...rest } = d$1(props, view.n);
|
|
5083
4489
|
const notEmpty = !n(rest);
|
|
5084
4490
|
const satisfies = elementExprToPredicate(expr);
|
|
5085
4491
|
nodes.forEach((node, i) => {
|
|
@@ -5094,12 +4500,15 @@ function applyCustomElementProperties(_rules, _nodes) {
|
|
|
5094
4500
|
};
|
|
5095
4501
|
}
|
|
5096
4502
|
let styleOverride;
|
|
5097
|
-
if (border !==
|
|
4503
|
+
if (border !== undefined) {
|
|
5098
4504
|
styleOverride = { border };
|
|
5099
4505
|
}
|
|
5100
|
-
if (opacity !==
|
|
4506
|
+
if (opacity !== undefined) {
|
|
5101
4507
|
styleOverride = { ...styleOverride, opacity };
|
|
5102
4508
|
}
|
|
4509
|
+
if (multiple !== undefined) {
|
|
4510
|
+
styleOverride = { ...styleOverride, multiple };
|
|
4511
|
+
}
|
|
5103
4512
|
if (styleOverride) {
|
|
5104
4513
|
node = {
|
|
5105
4514
|
...node,
|
|
@@ -5686,7 +5095,7 @@ class ActiveGroupMemory extends Memory {
|
|
|
5686
5095
|
static enter(memory, rule) {
|
|
5687
5096
|
const groupId = `@gr${memory.groups.length + 1}`;
|
|
5688
5097
|
if (memory instanceof ActiveGroupMemory) {
|
|
5689
|
-
const stack2 = Stack.from(memory.stack);
|
|
5098
|
+
const stack2 = object_hash.Stack.from([...memory.stack].reverse());
|
|
5690
5099
|
const state2 = memory.mutableState();
|
|
5691
5100
|
state2.groups.push(new NodesGroup(groupId, rule, memory.activeGroupId));
|
|
5692
5101
|
stack2.push(groupId);
|
|
@@ -5694,7 +5103,7 @@ class ActiveGroupMemory extends Memory {
|
|
|
5694
5103
|
}
|
|
5695
5104
|
const state = memory.mutableState();
|
|
5696
5105
|
state.groups.push(new NodesGroup(groupId, rule, null));
|
|
5697
|
-
const stack = Stack.of(groupId);
|
|
5106
|
+
const stack = object_hash.Stack.of(groupId);
|
|
5698
5107
|
return new ActiveGroupMemory(state, memory.scope, stack);
|
|
5699
5108
|
}
|
|
5700
5109
|
get activeGroupId() {
|
|
@@ -6799,7 +6208,7 @@ function assignElementsToGroups(memory) {
|
|
|
6799
6208
|
if (memory.groups.length === 0) {
|
|
6800
6209
|
return memory;
|
|
6801
6210
|
}
|
|
6802
|
-
const groupAssignments = new DefaultMap(() => /* @__PURE__ */ new Set());
|
|
6211
|
+
const groupAssignments = new object_hash.DefaultMap(() => /* @__PURE__ */ new Set());
|
|
6803
6212
|
const assignedTo = /* @__PURE__ */ new Map();
|
|
6804
6213
|
const isAncestorAssigned = (el) => {
|
|
6805
6214
|
for (const parent of el.ancestors()) {
|
|
@@ -6884,7 +6293,7 @@ function computeView(viewsource, likec4model) {
|
|
|
6884
6293
|
return {
|
|
6885
6294
|
isSuccess: false,
|
|
6886
6295
|
error: e instanceof Error ? e : new Error(`Unknown error: ${e}`),
|
|
6887
|
-
view:
|
|
6296
|
+
view: undefined
|
|
6888
6297
|
};
|
|
6889
6298
|
}
|
|
6890
6299
|
}
|
|
@@ -6937,19 +6346,19 @@ class LikeC4DeploymentModel {
|
|
|
6937
6346
|
// Parent element for given FQN
|
|
6938
6347
|
#parents = /* @__PURE__ */ new Map();
|
|
6939
6348
|
// Children elements for given FQN
|
|
6940
|
-
#children = new DefaultMap(() => /* @__PURE__ */ new Set());
|
|
6349
|
+
#children = new object_hash.DefaultMap(() => /* @__PURE__ */ new Set());
|
|
6941
6350
|
// Keep track of instances of the logical element
|
|
6942
|
-
#instancesOf = new DefaultMap(() => /* @__PURE__ */ new Set());
|
|
6351
|
+
#instancesOf = new object_hash.DefaultMap(() => /* @__PURE__ */ new Set());
|
|
6943
6352
|
#rootElements = /* @__PURE__ */ new Set();
|
|
6944
6353
|
#relations = /* @__PURE__ */ new Map();
|
|
6945
6354
|
// Incoming to an element or its descendants
|
|
6946
|
-
#incoming = new DefaultMap(() => /* @__PURE__ */ new Set());
|
|
6355
|
+
#incoming = new object_hash.DefaultMap(() => /* @__PURE__ */ new Set());
|
|
6947
6356
|
// Outgoing from an element or its descendants
|
|
6948
|
-
#outgoing = new DefaultMap(() => /* @__PURE__ */ new Set());
|
|
6357
|
+
#outgoing = new object_hash.DefaultMap(() => /* @__PURE__ */ new Set());
|
|
6949
6358
|
// Relationships inside the element, among descendants
|
|
6950
|
-
#internal = new DefaultMap(() => /* @__PURE__ */ new Set());
|
|
6359
|
+
#internal = new object_hash.DefaultMap(() => /* @__PURE__ */ new Set());
|
|
6951
6360
|
// readonly #views = new Map<ViewID, LikeC4ViewModel<M>>()
|
|
6952
|
-
#allTags = new DefaultMap(
|
|
6361
|
+
#allTags = new object_hash.DefaultMap(
|
|
6953
6362
|
() => /* @__PURE__ */ new Set()
|
|
6954
6363
|
);
|
|
6955
6364
|
#nestedElementsOfDeployment = /* @__PURE__ */ new Map();
|
|
@@ -7694,24 +7103,24 @@ class LikeC4Model {
|
|
|
7694
7103
|
}
|
|
7695
7104
|
}
|
|
7696
7105
|
/**
|
|
7697
|
-
*
|
|
7106
|
+
* Don't use in runtime, only for type inference
|
|
7698
7107
|
*/
|
|
7699
|
-
Aux;
|
|
7108
|
+
Aux = {};
|
|
7700
7109
|
#elements = /* @__PURE__ */ new Map();
|
|
7701
7110
|
// Parent element for given FQN
|
|
7702
7111
|
#parents = /* @__PURE__ */ new Map();
|
|
7703
7112
|
// Children elements for given FQN
|
|
7704
|
-
#children = new DefaultMap(() => /* @__PURE__ */ new Set());
|
|
7113
|
+
#children = new object_hash.DefaultMap(() => /* @__PURE__ */ new Set());
|
|
7705
7114
|
#rootElements = /* @__PURE__ */ new Set();
|
|
7706
7115
|
#relations = /* @__PURE__ */ new Map();
|
|
7707
7116
|
// Incoming to an element or its descendants
|
|
7708
|
-
#incoming = new DefaultMap(() => /* @__PURE__ */ new Set());
|
|
7117
|
+
#incoming = new object_hash.DefaultMap(() => /* @__PURE__ */ new Set());
|
|
7709
7118
|
// Outgoing from an element or its descendants
|
|
7710
|
-
#outgoing = new DefaultMap(() => /* @__PURE__ */ new Set());
|
|
7119
|
+
#outgoing = new object_hash.DefaultMap(() => /* @__PURE__ */ new Set());
|
|
7711
7120
|
// Relationships inside the element, among descendants
|
|
7712
|
-
#internal = new DefaultMap(() => /* @__PURE__ */ new Set());
|
|
7121
|
+
#internal = new object_hash.DefaultMap(() => /* @__PURE__ */ new Set());
|
|
7713
7122
|
#views = /* @__PURE__ */ new Map();
|
|
7714
|
-
#allTags = new DefaultMap(
|
|
7123
|
+
#allTags = new object_hash.DefaultMap(
|
|
7715
7124
|
() => /* @__PURE__ */ new Set()
|
|
7716
7125
|
);
|
|
7717
7126
|
deployment;
|
|
@@ -7982,7 +7391,6 @@ class LikeC4Model {
|
|
|
7982
7391
|
}
|
|
7983
7392
|
|
|
7984
7393
|
exports.ConnectionModel = ConnectionModel;
|
|
7985
|
-
exports.DefaultMap = DefaultMap;
|
|
7986
7394
|
exports.DeployedInstanceModel = DeployedInstanceModel;
|
|
7987
7395
|
exports.DeploymentConnectionModel = DeploymentConnectionModel;
|
|
7988
7396
|
exports.DeploymentNodeModel = DeploymentNodeModel;
|
|
@@ -7995,7 +7403,6 @@ exports.LikeC4Model = LikeC4Model;
|
|
|
7995
7403
|
exports.LikeC4ViewModel = LikeC4ViewModel;
|
|
7996
7404
|
exports.NodeModel = NodeModel;
|
|
7997
7405
|
exports.RelationshipModel = RelationshipModel;
|
|
7998
|
-
exports.Stack = Stack;
|
|
7999
7406
|
exports.computeView = computeView;
|
|
8000
7407
|
exports.computeViews = computeViews;
|
|
8001
7408
|
exports.d = d$2;
|
|
@@ -8018,8 +7425,6 @@ exports.isOutgoing = isOutgoing;
|
|
|
8018
7425
|
exports.l = l$3;
|
|
8019
7426
|
exports.mergeConnections = mergeConnections;
|
|
8020
7427
|
exports.r = r$3;
|
|
8021
|
-
exports.requireForeach = requireForeach;
|
|
8022
|
-
exports.requireIterator = requireIterator;
|
|
8023
7428
|
exports.sortConnectionsByBoundaryHierarchy = sortConnectionsByBoundaryHierarchy;
|
|
8024
7429
|
exports.sortDeepestFirst = sortDeepestFirst;
|
|
8025
7430
|
exports.topologicalSortExports = topologicalSortExports;
|