godash-diagrams 0.0.1

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.
@@ -0,0 +1,4524 @@
1
+ var Ir = "@@__IMMUTABLE_INDEXED__@@";
2
+ function Z(r) {
3
+ return !!(r && // @ts-expect-error: maybeIndexed is typed as `{}`, need to change in 6.0 to `maybeIndexed && typeof maybeIndexed === 'object' && IS_INDEXED_SYMBOL in maybeIndexed`
4
+ r[Ir]);
5
+ }
6
+ var qr = "@@__IMMUTABLE_KEYED__@@";
7
+ function T(r) {
8
+ return !!(r && // @ts-expect-error: maybeKeyed is typed as `{}`, need to change in 6.0 to `maybeKeyed && typeof maybeKeyed === 'object' && IS_KEYED_SYMBOL in maybeKeyed`
9
+ r[qr]);
10
+ }
11
+ function wn(r) {
12
+ return T(r) || Z(r);
13
+ }
14
+ var Go = "@@__IMMUTABLE_ITERABLE__@@";
15
+ function W(r) {
16
+ return !!(r && // @ts-expect-error: maybeCollection is typed as `{}`, need to change in 6.0 to `maybeCollection && typeof maybeCollection === 'object' && IS_COLLECTION_SYMBOL in maybeCollection`
17
+ r[Go]);
18
+ }
19
+ var j = function(t) {
20
+ return W(t) ? t : D(t);
21
+ }, Q = /* @__PURE__ */ (function(r) {
22
+ function t(e) {
23
+ return T(e) ? e : St(e);
24
+ }
25
+ return r && (t.__proto__ = r), t.prototype = Object.create(r && r.prototype), t.prototype.constructor = t, t;
26
+ })(j), Mt = /* @__PURE__ */ (function(r) {
27
+ function t(e) {
28
+ return Z(e) ? e : et(e);
29
+ }
30
+ return r && (t.__proto__ = r), t.prototype = Object.create(r && r.prototype), t.prototype.constructor = t, t;
31
+ })(j), Dt = /* @__PURE__ */ (function(r) {
32
+ function t(e) {
33
+ return W(e) && !wn(e) ? e : Ut(e);
34
+ }
35
+ return r && (t.__proto__ = r), t.prototype = Object.create(r && r.prototype), t.prototype.constructor = t, t;
36
+ })(j);
37
+ j.Keyed = Q;
38
+ j.Indexed = Mt;
39
+ j.Set = Dt;
40
+ var Ft = 0, Y = 1, X = 2, hn = typeof Symbol == "function" && Symbol.iterator, Wo = "@@iterator", Or = hn || Wo, w = function(t) {
41
+ this.next = t;
42
+ };
43
+ w.prototype.toString = function() {
44
+ return "[Iterator]";
45
+ };
46
+ w.KEYS = Ft;
47
+ w.VALUES = Y;
48
+ w.ENTRIES = X;
49
+ w.prototype.inspect = w.prototype.toSource = function() {
50
+ return this.toString();
51
+ };
52
+ w.prototype[Or] = function() {
53
+ return this;
54
+ };
55
+ function R(r, t, e, n) {
56
+ var i = r === Ft ? t : r === Y ? e : [t, e];
57
+ return n ? n.value = i : n = {
58
+ // @ts-expect-error ensure value is not undefined
59
+ value: i,
60
+ done: !1
61
+ }, n;
62
+ }
63
+ function x() {
64
+ return { value: void 0, done: !0 };
65
+ }
66
+ function Yo(r) {
67
+ return Array.isArray(r) ? !0 : !!zr(r);
68
+ }
69
+ function ei(r) {
70
+ return !!(r && // @ts-expect-error: maybeIterator is typed as `{}`
71
+ typeof r.next == "function");
72
+ }
73
+ function pn(r) {
74
+ var t = zr(r);
75
+ return t && t.call(r);
76
+ }
77
+ function zr(r) {
78
+ var t = r && // @ts-expect-error: maybeIterator is typed as `{}`
79
+ (hn && r[hn] || // @ts-expect-error: maybeIterator is typed as `{}`
80
+ r[Wo]);
81
+ if (typeof t == "function")
82
+ return t;
83
+ }
84
+ function ns(r) {
85
+ var t = zr(r);
86
+ return t && t === r.entries;
87
+ }
88
+ function is(r) {
89
+ var t = zr(r);
90
+ return t && t === r.keys;
91
+ }
92
+ var cr = "delete", M = 5, K = 1 << M, P = K - 1, S = {};
93
+ function _n() {
94
+ return { value: !1 };
95
+ }
96
+ function V(r) {
97
+ r && (r.value = !0);
98
+ }
99
+ function bn() {
100
+ }
101
+ function $t(r) {
102
+ return r.size === void 0 && (r.size = r.__iterate(Xo)), r.size;
103
+ }
104
+ function yt(r, t) {
105
+ if (typeof t != "number") {
106
+ var e = t >>> 0;
107
+ if ("" + e !== t || e === 4294967295)
108
+ return NaN;
109
+ t = e;
110
+ }
111
+ return t < 0 ? $t(r) + t : t;
112
+ }
113
+ function Xo() {
114
+ return !0;
115
+ }
116
+ function Tr(r, t, e) {
117
+ return (r === 0 && !Vo(r) || e !== void 0 && r <= -e) && (t === void 0 || e !== void 0 && t >= e);
118
+ }
119
+ function hr(r, t) {
120
+ return Jo(r, t, 0);
121
+ }
122
+ function Rr(r, t) {
123
+ return Jo(r, t, t);
124
+ }
125
+ function Jo(r, t, e) {
126
+ return r === void 0 ? e : Vo(r) ? t === 1 / 0 ? t : Math.max(0, t + r) | 0 : t === void 0 || t === r ? r : Math.min(t, r) | 0;
127
+ }
128
+ function Vo(r) {
129
+ return r < 0 || r === 0 && 1 / r === -1 / 0;
130
+ }
131
+ var Zo = "@@__IMMUTABLE_RECORD__@@";
132
+ function Et(r) {
133
+ return !!(r && // @ts-expect-error: maybeRecord is typed as `{}`, need to change in 6.0 to `maybeRecord && typeof maybeRecord === 'object' && IS_RECORD_SYMBOL in maybeRecord`
134
+ r[Zo]);
135
+ }
136
+ function ct(r) {
137
+ return W(r) || Et(r);
138
+ }
139
+ var gt = "@@__IMMUTABLE_ORDERED__@@";
140
+ function ut(r) {
141
+ return !!(r && // @ts-expect-error: maybeOrdered is typed as `{}`, need to change in 6.0 to `maybeOrdered && typeof maybeOrdered === 'object' && IS_ORDERED_SYMBOL in maybeOrdered`
142
+ r[gt]);
143
+ }
144
+ var Qo = "@@__IMMUTABLE_SEQ__@@";
145
+ function In(r) {
146
+ return !!(r && // @ts-expect-error: maybeSeq is typed as `{}`, need to change in 6.0 to `maybeSeq && typeof maybeSeq === 'object' && MAYBE_SEQ_SYMBOL in maybeSeq`
147
+ r[Qo]);
148
+ }
149
+ var Ht = Object.prototype.hasOwnProperty;
150
+ function ta(r) {
151
+ return Array.isArray(r) || typeof r == "string" ? !0 : r && typeof r == "object" && // @ts-expect-error check that `'length' in value &&`
152
+ Number.isInteger(r.length) && // @ts-expect-error check that `'length' in value &&`
153
+ r.length >= 0 && // @ts-expect-error check that `'length' in value &&`
154
+ (r.length === 0 ? (
155
+ // Only {length: 0} is considered Array-like.
156
+ Object.keys(r).length === 1
157
+ ) : (
158
+ // An object is only Array-like if it has a property where the last value
159
+ // in the array-like may be found (which could be undefined).
160
+ // @ts-expect-error check that `'length' in value &&`
161
+ r.hasOwnProperty(r.length - 1)
162
+ ));
163
+ }
164
+ var D = /* @__PURE__ */ (function(r) {
165
+ function t(e) {
166
+ return e == null ? Mn() : ct(e) ? e.toSeq() : as(e);
167
+ }
168
+ return r && (t.__proto__ = r), t.prototype = Object.create(r && r.prototype), t.prototype.constructor = t, t.prototype.toSeq = function() {
169
+ return this;
170
+ }, t.prototype.toString = function() {
171
+ return this.__toString("Seq {", "}");
172
+ }, t.prototype.cacheResult = function() {
173
+ return !this._cache && this.__iterateUncached && (this._cache = this.entrySeq().toArray(), this.size = this._cache.length), this;
174
+ }, t.prototype.__iterate = function(n, i) {
175
+ var o = this._cache;
176
+ if (o) {
177
+ for (var a = o.length, s = 0; s !== a; ) {
178
+ var u = o[i ? a - ++s : s++];
179
+ if (n(u[1], u[0], this) === !1)
180
+ break;
181
+ }
182
+ return s;
183
+ }
184
+ return this.__iterateUncached(n, i);
185
+ }, t.prototype.__iterator = function(n, i) {
186
+ var o = this._cache;
187
+ if (o) {
188
+ var a = o.length, s = 0;
189
+ return new w(function() {
190
+ if (s === a)
191
+ return x();
192
+ var u = o[i ? a - ++s : s++];
193
+ return R(n, u[0], u[1]);
194
+ });
195
+ }
196
+ return this.__iteratorUncached(n, i);
197
+ }, t;
198
+ })(j), St = /* @__PURE__ */ (function(r) {
199
+ function t(e) {
200
+ return e == null ? Mn().toKeyedSeq() : W(e) ? T(e) ? e.toSeq() : e.fromEntrySeq() : Et(e) ? e.toSeq() : En(e);
201
+ }
202
+ return r && (t.__proto__ = r), t.prototype = Object.create(r && r.prototype), t.prototype.constructor = t, t.prototype.toKeyedSeq = function() {
203
+ return this;
204
+ }, t;
205
+ })(D), et = /* @__PURE__ */ (function(r) {
206
+ function t(e) {
207
+ return e == null ? Mn() : W(e) ? T(e) ? e.entrySeq() : e.toIndexedSeq() : Et(e) ? e.toSeq().entrySeq() : ra(e);
208
+ }
209
+ return r && (t.__proto__ = r), t.prototype = Object.create(r && r.prototype), t.prototype.constructor = t, t.of = function() {
210
+ return t(arguments);
211
+ }, t.prototype.toIndexedSeq = function() {
212
+ return this;
213
+ }, t.prototype.toString = function() {
214
+ return this.__toString("Seq [", "]");
215
+ }, t;
216
+ })(D), Ut = /* @__PURE__ */ (function(r) {
217
+ function t(e) {
218
+ return (W(e) && !wn(e) ? e : et(e)).toSetSeq();
219
+ }
220
+ return r && (t.__proto__ = r), t.prototype = Object.create(r && r.prototype), t.prototype.constructor = t, t.of = function() {
221
+ return t(arguments);
222
+ }, t.prototype.toSetSeq = function() {
223
+ return this;
224
+ }, t;
225
+ })(D);
226
+ D.isSeq = In;
227
+ D.Keyed = St;
228
+ D.Set = Ut;
229
+ D.Indexed = et;
230
+ D.prototype[Qo] = !0;
231
+ var Bt = /* @__PURE__ */ (function(r) {
232
+ function t(e) {
233
+ this._array = e, this.size = e.length;
234
+ }
235
+ return r && (t.__proto__ = r), t.prototype = Object.create(r && r.prototype), t.prototype.constructor = t, t.prototype.get = function(n, i) {
236
+ return this.has(n) ? this._array[yt(this, n)] : i;
237
+ }, t.prototype.__iterate = function(n, i) {
238
+ for (var o = this._array, a = o.length, s = 0; s !== a; ) {
239
+ var u = i ? a - ++s : s++;
240
+ if (n(o[u], u, this) === !1)
241
+ break;
242
+ }
243
+ return s;
244
+ }, t.prototype.__iterator = function(n, i) {
245
+ var o = this._array, a = o.length, s = 0;
246
+ return new w(function() {
247
+ if (s === a)
248
+ return x();
249
+ var u = i ? a - ++s : s++;
250
+ return R(n, u, o[u]);
251
+ });
252
+ }, t;
253
+ })(et), qn = /* @__PURE__ */ (function(r) {
254
+ function t(e) {
255
+ var n = Object.keys(e).concat(
256
+ Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(e) : []
257
+ );
258
+ this._object = e, this._keys = n, this.size = n.length;
259
+ }
260
+ return r && (t.__proto__ = r), t.prototype = Object.create(r && r.prototype), t.prototype.constructor = t, t.prototype.get = function(n, i) {
261
+ return i !== void 0 && !this.has(n) ? i : this._object[n];
262
+ }, t.prototype.has = function(n) {
263
+ return Ht.call(this._object, n);
264
+ }, t.prototype.__iterate = function(n, i) {
265
+ for (var o = this._object, a = this._keys, s = a.length, u = 0; u !== s; ) {
266
+ var f = a[i ? s - ++u : u++];
267
+ if (n(o[f], f, this) === !1)
268
+ break;
269
+ }
270
+ return u;
271
+ }, t.prototype.__iterator = function(n, i) {
272
+ var o = this._object, a = this._keys, s = a.length, u = 0;
273
+ return new w(function() {
274
+ if (u === s)
275
+ return x();
276
+ var f = a[i ? s - ++u : u++];
277
+ return R(n, f, o[f]);
278
+ });
279
+ }, t;
280
+ })(St);
281
+ qn.prototype[gt] = !0;
282
+ var os = /* @__PURE__ */ (function(r) {
283
+ function t(e) {
284
+ this._collection = e, this.size = e.length || e.size;
285
+ }
286
+ return r && (t.__proto__ = r), t.prototype = Object.create(r && r.prototype), t.prototype.constructor = t, t.prototype.__iterateUncached = function(n, i) {
287
+ if (i)
288
+ return this.cacheResult().__iterate(n, i);
289
+ var o = this._collection, a = pn(o), s = 0;
290
+ if (ei(a))
291
+ for (var u; !(u = a.next()).done && n(u.value, s++, this) !== !1; )
292
+ ;
293
+ return s;
294
+ }, t.prototype.__iteratorUncached = function(n, i) {
295
+ if (i)
296
+ return this.cacheResult().__iterator(n, i);
297
+ var o = this._collection, a = pn(o);
298
+ if (!ei(a))
299
+ return new w(x);
300
+ var s = 0;
301
+ return new w(function() {
302
+ var u = a.next();
303
+ return u.done ? u : R(n, s++, u.value);
304
+ });
305
+ }, t;
306
+ })(et), ni;
307
+ function Mn() {
308
+ return ni || (ni = new Bt([]));
309
+ }
310
+ function En(r) {
311
+ var t = On(r);
312
+ if (t)
313
+ return t.fromEntrySeq();
314
+ if (typeof r == "object")
315
+ return new qn(r);
316
+ throw new TypeError(
317
+ "Expected Array or collection object of [k, v] entries, or keyed object: " + r
318
+ );
319
+ }
320
+ function ra(r) {
321
+ var t = On(r);
322
+ if (t)
323
+ return t;
324
+ throw new TypeError(
325
+ "Expected Array or collection object of values: " + r
326
+ );
327
+ }
328
+ function as(r) {
329
+ var t = On(r);
330
+ if (t)
331
+ return ns(r) ? t.fromEntrySeq() : is(r) ? t.toSetSeq() : t;
332
+ if (typeof r == "object")
333
+ return new qn(r);
334
+ throw new TypeError(
335
+ "Expected Array or collection object of values, or keyed object: " + r
336
+ );
337
+ }
338
+ function On(r) {
339
+ return ta(r) ? new Bt(r) : Yo(r) ? new os(r) : void 0;
340
+ }
341
+ function pr() {
342
+ return this.__ensureOwner();
343
+ }
344
+ function _r() {
345
+ return this.__ownerID ? this : this.__ensureOwner(new bn());
346
+ }
347
+ var Yt = typeof Math.imul == "function" && Math.imul(4294967295, 2) === -2 ? Math.imul : function(t, e) {
348
+ t |= 0, e |= 0;
349
+ var n = t & 65535, i = e & 65535;
350
+ return n * i + ((t >>> 16) * i + n * (e >>> 16) << 16 >>> 0) | 0;
351
+ };
352
+ function Ar(r) {
353
+ return r >>> 1 & 1073741824 | r & 3221225471;
354
+ }
355
+ var ss = Object.prototype.valueOf;
356
+ function F(r) {
357
+ if (r == null)
358
+ return ii(r);
359
+ if (typeof r.hashCode == "function")
360
+ return Ar(r.hashCode(r));
361
+ var t = _s(r);
362
+ if (t == null)
363
+ return ii(t);
364
+ switch (typeof t) {
365
+ case "boolean":
366
+ return t ? 1108378657 : 1108378656;
367
+ case "number":
368
+ return us(t);
369
+ case "string":
370
+ return t.length > ds ? fs(t) : dn(t);
371
+ case "object":
372
+ case "function":
373
+ return hs(t);
374
+ case "symbol":
375
+ return cs(t);
376
+ default:
377
+ if (typeof t.toString == "function")
378
+ return dn(t.toString());
379
+ throw new Error("Value type " + typeof t + " cannot be hashed.");
380
+ }
381
+ }
382
+ function ii(r) {
383
+ return r === null ? 1108378658 : (
384
+ /* undefined */
385
+ 1108378659
386
+ );
387
+ }
388
+ function us(r) {
389
+ if (r !== r || r === 1 / 0)
390
+ return 0;
391
+ var t = r | 0;
392
+ for (t !== r && (t ^= r * 4294967295); r > 4294967295; )
393
+ r /= 4294967295, t ^= r;
394
+ return Ar(t);
395
+ }
396
+ function fs(r) {
397
+ var t = Fr[r];
398
+ return t === void 0 && (t = dn(r), Dr === ls && (Dr = 0, Fr = {}), Dr++, Fr[r] = t), t;
399
+ }
400
+ function dn(r) {
401
+ for (var t = 0, e = 0; e < r.length; e++)
402
+ t = 31 * t + r.charCodeAt(e) | 0;
403
+ return Ar(t);
404
+ }
405
+ function cs(r) {
406
+ var t = si[r];
407
+ return t !== void 0 || (t = ea(), si[r] = t), t;
408
+ }
409
+ function hs(r) {
410
+ var t;
411
+ if (ln && (t = vn.get(r), t !== void 0) || (t = r[It], t !== void 0) || !ai && (t = r.propertyIsEnumerable && r.propertyIsEnumerable[It], t !== void 0 || (t = ps(r), t !== void 0)))
412
+ return t;
413
+ if (t = ea(), ln)
414
+ vn.set(r, t);
415
+ else {
416
+ if (oi !== void 0 && oi(r) === !1)
417
+ throw new Error("Non-extensible objects are not allowed as keys.");
418
+ if (ai)
419
+ Object.defineProperty(r, It, {
420
+ enumerable: !1,
421
+ configurable: !1,
422
+ writable: !1,
423
+ value: t
424
+ });
425
+ else if (r.propertyIsEnumerable !== void 0 && r.propertyIsEnumerable === r.constructor.prototype.propertyIsEnumerable)
426
+ r.propertyIsEnumerable = function() {
427
+ return this.constructor.prototype.propertyIsEnumerable.apply(
428
+ this,
429
+ // eslint-disable-next-line prefer-rest-params
430
+ arguments
431
+ );
432
+ }, r.propertyIsEnumerable[It] = t;
433
+ else if (r.nodeType !== void 0)
434
+ r[It] = t;
435
+ else
436
+ throw new Error("Unable to set a non-enumerable property on object.");
437
+ }
438
+ return t;
439
+ }
440
+ var oi = Object.isExtensible, ai = (function() {
441
+ try {
442
+ return Object.defineProperty({}, "@", {}), !0;
443
+ } catch {
444
+ return !1;
445
+ }
446
+ })();
447
+ function ps(r) {
448
+ if (r && r.nodeType > 0)
449
+ switch (r.nodeType) {
450
+ case 1:
451
+ return r.uniqueID;
452
+ case 9:
453
+ return r.documentElement && r.documentElement.uniqueID;
454
+ }
455
+ }
456
+ function _s(r) {
457
+ return r.valueOf !== ss && typeof r.valueOf == "function" ? (
458
+ // @ts-expect-error weird the "obj" parameter as `valueOf` should not have a parameter
459
+ r.valueOf(r)
460
+ ) : r;
461
+ }
462
+ function ea() {
463
+ var r = ++Nr;
464
+ return Nr & 1073741824 && (Nr = 0), r;
465
+ }
466
+ var ln = typeof WeakMap == "function", vn;
467
+ ln && (vn = /* @__PURE__ */ new WeakMap());
468
+ var si = /* @__PURE__ */ Object.create(null), Nr = 0, It = "__immutablehash__";
469
+ typeof Symbol == "function" && (It = Symbol(It));
470
+ var ds = 16, ls = 255, Dr = 0, Fr = {}, Cr = /* @__PURE__ */ (function(r) {
471
+ function t(e, n) {
472
+ this._iter = e, this._useKeys = n, this.size = e.size;
473
+ }
474
+ return r && (t.__proto__ = r), t.prototype = Object.create(r && r.prototype), t.prototype.constructor = t, t.prototype.get = function(n, i) {
475
+ return this._iter.get(n, i);
476
+ }, t.prototype.has = function(n) {
477
+ return this._iter.has(n);
478
+ }, t.prototype.valueSeq = function() {
479
+ return this._iter.valueSeq();
480
+ }, t.prototype.reverse = function() {
481
+ var n = this, i = zn(this, !0);
482
+ return this._useKeys || (i.valueSeq = function() {
483
+ return n._iter.toSeq().reverse();
484
+ }), i;
485
+ }, t.prototype.map = function(n, i) {
486
+ var o = this, a = sa(this, n, i);
487
+ return this._useKeys || (a.valueSeq = function() {
488
+ return o._iter.toSeq().map(n, i);
489
+ }), a;
490
+ }, t.prototype.__iterate = function(n, i) {
491
+ var o = this;
492
+ return this._iter.__iterate(function(a, s) {
493
+ return n(a, s, o);
494
+ }, i);
495
+ }, t.prototype.__iterator = function(n, i) {
496
+ return this._iter.__iterator(n, i);
497
+ }, t;
498
+ })(St);
499
+ Cr.prototype[gt] = !0;
500
+ var na = /* @__PURE__ */ (function(r) {
501
+ function t(e) {
502
+ this._iter = e, this.size = e.size;
503
+ }
504
+ return r && (t.__proto__ = r), t.prototype = Object.create(r && r.prototype), t.prototype.constructor = t, t.prototype.includes = function(n) {
505
+ return this._iter.includes(n);
506
+ }, t.prototype.__iterate = function(n, i) {
507
+ var o = this, a = 0;
508
+ return i && $t(this), this._iter.__iterate(
509
+ function(s) {
510
+ return n(s, i ? o.size - ++a : a++, o);
511
+ },
512
+ i
513
+ );
514
+ }, t.prototype.__iterator = function(n, i) {
515
+ var o = this, a = this._iter.__iterator(Y, i), s = 0;
516
+ return i && $t(this), new w(function() {
517
+ var u = a.next();
518
+ return u.done ? u : R(
519
+ n,
520
+ i ? o.size - ++s : s++,
521
+ u.value,
522
+ u
523
+ );
524
+ });
525
+ }, t;
526
+ })(et), ia = /* @__PURE__ */ (function(r) {
527
+ function t(e) {
528
+ this._iter = e, this.size = e.size;
529
+ }
530
+ return r && (t.__proto__ = r), t.prototype = Object.create(r && r.prototype), t.prototype.constructor = t, t.prototype.has = function(n) {
531
+ return this._iter.includes(n);
532
+ }, t.prototype.__iterate = function(n, i) {
533
+ var o = this;
534
+ return this._iter.__iterate(function(a) {
535
+ return n(a, a, o);
536
+ }, i);
537
+ }, t.prototype.__iterator = function(n, i) {
538
+ var o = this._iter.__iterator(Y, i);
539
+ return new w(function() {
540
+ var a = o.next();
541
+ return a.done ? a : R(n, a.value, a.value, a);
542
+ });
543
+ }, t;
544
+ })(Ut), oa = /* @__PURE__ */ (function(r) {
545
+ function t(e) {
546
+ this._iter = e, this.size = e.size;
547
+ }
548
+ return r && (t.__proto__ = r), t.prototype = Object.create(r && r.prototype), t.prototype.constructor = t, t.prototype.entrySeq = function() {
549
+ return this._iter.toSeq();
550
+ }, t.prototype.__iterate = function(n, i) {
551
+ var o = this;
552
+ return this._iter.__iterate(function(a) {
553
+ if (a) {
554
+ fi(a);
555
+ var s = W(a);
556
+ return n(
557
+ s ? a.get(1) : a[1],
558
+ s ? a.get(0) : a[0],
559
+ o
560
+ );
561
+ }
562
+ }, i);
563
+ }, t.prototype.__iterator = function(n, i) {
564
+ var o = this._iter.__iterator(Y, i);
565
+ return new w(function() {
566
+ for (; ; ) {
567
+ var a = o.next();
568
+ if (a.done)
569
+ return a;
570
+ var s = a.value;
571
+ if (s) {
572
+ fi(s);
573
+ var u = W(s);
574
+ return R(
575
+ n,
576
+ u ? s.get(0) : s[0],
577
+ u ? s.get(1) : s[1],
578
+ a
579
+ );
580
+ }
581
+ }
582
+ });
583
+ }, t;
584
+ })(St);
585
+ na.prototype.cacheResult = Cr.prototype.cacheResult = ia.prototype.cacheResult = oa.prototype.cacheResult = An;
586
+ function aa(r) {
587
+ var t = ht(r);
588
+ return t._iter = r, t.size = r.size, t.flip = function() {
589
+ return r;
590
+ }, t.reverse = function() {
591
+ var e = r.reverse.apply(this);
592
+ return e.flip = function() {
593
+ return r.reverse();
594
+ }, e;
595
+ }, t.has = function(e) {
596
+ return r.includes(e);
597
+ }, t.includes = function(e) {
598
+ return r.has(e);
599
+ }, t.cacheResult = An, t.__iterateUncached = function(e, n) {
600
+ var i = this;
601
+ return r.__iterate(function(o, a) {
602
+ return e(a, o, i) !== !1;
603
+ }, n);
604
+ }, t.__iteratorUncached = function(e, n) {
605
+ if (e === X) {
606
+ var i = r.__iterator(e, n);
607
+ return new w(function() {
608
+ var o = i.next();
609
+ if (!o.done) {
610
+ var a = o.value[0];
611
+ o.value[0] = o.value[1], o.value[1] = a;
612
+ }
613
+ return o;
614
+ });
615
+ }
616
+ return r.__iterator(
617
+ e === Y ? Ft : Y,
618
+ n
619
+ );
620
+ }, t;
621
+ }
622
+ function sa(r, t, e) {
623
+ var n = ht(r);
624
+ return n.size = r.size, n.has = function(i) {
625
+ return r.has(i);
626
+ }, n.get = function(i, o) {
627
+ var a = r.get(i, S);
628
+ return a === S ? o : t.call(e, a, i, r);
629
+ }, n.__iterateUncached = function(i, o) {
630
+ var a = this;
631
+ return r.__iterate(
632
+ function(s, u, f) {
633
+ return i(t.call(e, s, u, f), u, a) !== !1;
634
+ },
635
+ o
636
+ );
637
+ }, n.__iteratorUncached = function(i, o) {
638
+ var a = r.__iterator(X, o);
639
+ return new w(function() {
640
+ var s = a.next();
641
+ if (s.done)
642
+ return s;
643
+ var u = s.value, f = u[0];
644
+ return R(
645
+ i,
646
+ f,
647
+ t.call(e, u[1], f, r),
648
+ s
649
+ );
650
+ });
651
+ }, n;
652
+ }
653
+ function zn(r, t) {
654
+ var e = this, n = ht(r);
655
+ return n._iter = r, n.size = r.size, n.reverse = function() {
656
+ return r;
657
+ }, r.flip && (n.flip = function() {
658
+ var i = aa(r);
659
+ return i.reverse = function() {
660
+ return r.flip();
661
+ }, i;
662
+ }), n.get = function(i, o) {
663
+ return r.get(t ? i : -1 - i, o);
664
+ }, n.has = function(i) {
665
+ return r.has(t ? i : -1 - i);
666
+ }, n.includes = function(i) {
667
+ return r.includes(i);
668
+ }, n.cacheResult = An, n.__iterate = function(i, o) {
669
+ var a = this, s = 0;
670
+ return o && $t(r), r.__iterate(
671
+ function(u, f) {
672
+ return i(u, t ? f : o ? a.size - ++s : s++, a);
673
+ },
674
+ !o
675
+ );
676
+ }, n.__iterator = function(i, o) {
677
+ var a = 0;
678
+ o && $t(r);
679
+ var s = r.__iterator(X, !o);
680
+ return new w(function() {
681
+ var u = s.next();
682
+ if (u.done)
683
+ return u;
684
+ var f = u.value;
685
+ return R(
686
+ i,
687
+ t ? f[0] : o ? e.size - ++a : a++,
688
+ f[1],
689
+ u
690
+ );
691
+ });
692
+ }, n;
693
+ }
694
+ function ua(r, t, e, n) {
695
+ var i = ht(r);
696
+ return n && (i.has = function(o) {
697
+ var a = r.get(o, S);
698
+ return a !== S && !!t.call(e, a, o, r);
699
+ }, i.get = function(o, a) {
700
+ var s = r.get(o, S);
701
+ return s !== S && t.call(e, s, o, r) ? s : a;
702
+ }), i.__iterateUncached = function(o, a) {
703
+ var s = this, u = 0;
704
+ return r.__iterate(function(f, c, h) {
705
+ if (t.call(e, f, c, h))
706
+ return u++, o(f, n ? c : u - 1, s);
707
+ }, a), u;
708
+ }, i.__iteratorUncached = function(o, a) {
709
+ var s = r.__iterator(X, a), u = 0;
710
+ return new w(function() {
711
+ for (; ; ) {
712
+ var f = s.next();
713
+ if (f.done)
714
+ return f;
715
+ var c = f.value, h = c[0], p = c[1];
716
+ if (t.call(e, p, h, r))
717
+ return R(o, n ? h : u++, p, f);
718
+ }
719
+ });
720
+ }, i;
721
+ }
722
+ function vs(r, t, e) {
723
+ var n = U().asMutable();
724
+ return r.__iterate(function(i, o) {
725
+ n.update(t.call(e, i, o, r), 0, function(a) {
726
+ return a + 1;
727
+ });
728
+ }), n.asImmutable();
729
+ }
730
+ function ys(r, t, e) {
731
+ var n = T(r), i = (ut(r) ? dt() : U()).asMutable();
732
+ r.__iterate(function(a, s) {
733
+ i.update(
734
+ t.call(e, a, s, r),
735
+ function(u) {
736
+ return u = u || [], u.push(n ? [s, a] : a), u;
737
+ }
738
+ );
739
+ });
740
+ var o = Rn(r);
741
+ return i.map(function(a) {
742
+ return q(r, o(a));
743
+ }).asImmutable();
744
+ }
745
+ function gs(r, t, e) {
746
+ var n = T(r), i = [[], []];
747
+ r.__iterate(function(a, s) {
748
+ i[t.call(e, a, s, r) ? 1 : 0].push(
749
+ n ? [s, a] : a
750
+ );
751
+ });
752
+ var o = Rn(r);
753
+ return i.map(function(a) {
754
+ return q(r, o(a));
755
+ });
756
+ }
757
+ function Tn(r, t, e, n) {
758
+ var i = r.size;
759
+ if (Tr(t, e, i))
760
+ return r;
761
+ if (typeof i > "u" && (t < 0 || e < 0))
762
+ return Tn(r.toSeq().cacheResult(), t, e, n);
763
+ var o = hr(t, i), a = Rr(e, i), s = a - o, u;
764
+ s === s && (u = s < 0 ? 0 : s);
765
+ var f = ht(r);
766
+ return f.size = u === 0 ? u : r.size && u || void 0, !n && In(r) && u >= 0 && (f.get = function(c, h) {
767
+ return c = yt(this, c), c >= 0 && c < u ? r.get(c + o, h) : h;
768
+ }), f.__iterateUncached = function(c, h) {
769
+ var p = this;
770
+ if (u === 0)
771
+ return 0;
772
+ if (h)
773
+ return this.cacheResult().__iterate(c, h);
774
+ var _ = 0, d = !0, v = 0;
775
+ return r.__iterate(function(I, y) {
776
+ if (!(d && (d = _++ < o)))
777
+ return v++, c(I, n ? y : v - 1, p) !== !1 && v !== u;
778
+ }), v;
779
+ }, f.__iteratorUncached = function(c, h) {
780
+ if (u !== 0 && h)
781
+ return this.cacheResult().__iterator(c, h);
782
+ if (u === 0)
783
+ return new w(x);
784
+ var p = r.__iterator(c, h), _ = 0, d = 0;
785
+ return new w(function() {
786
+ for (; _++ < o; )
787
+ p.next();
788
+ if (++d > u)
789
+ return x();
790
+ var v = p.next();
791
+ return n || c === Y || v.done ? v : c === Ft ? R(c, d - 1, void 0, v) : R(c, d - 1, v.value[1], v);
792
+ });
793
+ }, f;
794
+ }
795
+ function ms(r, t, e) {
796
+ var n = ht(r);
797
+ return n.__iterateUncached = function(i, o) {
798
+ var a = this;
799
+ if (o)
800
+ return this.cacheResult().__iterate(i, o);
801
+ var s = 0;
802
+ return r.__iterate(
803
+ function(u, f, c) {
804
+ return t.call(e, u, f, c) && ++s && i(u, f, a);
805
+ }
806
+ ), s;
807
+ }, n.__iteratorUncached = function(i, o) {
808
+ var a = this;
809
+ if (o)
810
+ return this.cacheResult().__iterator(i, o);
811
+ var s = r.__iterator(X, o), u = !0;
812
+ return new w(function() {
813
+ if (!u)
814
+ return x();
815
+ var f = s.next();
816
+ if (f.done)
817
+ return f;
818
+ var c = f.value, h = c[0], p = c[1];
819
+ return t.call(e, p, h, a) ? i === X ? f : R(i, h, p, f) : (u = !1, x());
820
+ });
821
+ }, n;
822
+ }
823
+ function fa(r, t, e, n) {
824
+ var i = ht(r);
825
+ return i.__iterateUncached = function(o, a) {
826
+ var s = this;
827
+ if (a)
828
+ return this.cacheResult().__iterate(o, a);
829
+ var u = !0, f = 0;
830
+ return r.__iterate(function(c, h, p) {
831
+ if (!(u && (u = t.call(e, c, h, p))))
832
+ return f++, o(c, n ? h : f - 1, s);
833
+ }), f;
834
+ }, i.__iteratorUncached = function(o, a) {
835
+ var s = this;
836
+ if (a)
837
+ return this.cacheResult().__iterator(o, a);
838
+ var u = r.__iterator(X, a), f = !0, c = 0;
839
+ return new w(function() {
840
+ var h, p, _;
841
+ do {
842
+ if (h = u.next(), h.done)
843
+ return n || o === Y ? h : o === Ft ? R(o, c++, void 0, h) : R(o, c++, h.value[1], h);
844
+ var d = h.value;
845
+ p = d[0], _ = d[1], f && (f = t.call(e, _, p, s));
846
+ } while (f);
847
+ return o === X ? h : R(o, p, _, h);
848
+ });
849
+ }, i;
850
+ }
851
+ var Ss = /* @__PURE__ */ (function(r) {
852
+ function t(e) {
853
+ this._wrappedIterables = e.flatMap(function(n) {
854
+ return n._wrappedIterables ? n._wrappedIterables : [n];
855
+ }), this.size = this._wrappedIterables.reduce(function(n, i) {
856
+ if (n !== void 0) {
857
+ var o = i.size;
858
+ if (o !== void 0)
859
+ return n + o;
860
+ }
861
+ }, 0), this[qr] = this._wrappedIterables[0][qr], this[Ir] = this._wrappedIterables[0][Ir], this[gt] = this._wrappedIterables[0][gt];
862
+ }
863
+ return r && (t.__proto__ = r), t.prototype = Object.create(r && r.prototype), t.prototype.constructor = t, t.prototype.__iterateUncached = function(n, i) {
864
+ if (this._wrappedIterables.length !== 0) {
865
+ if (i)
866
+ return this.cacheResult().__iterate(n, i);
867
+ for (var o = 0, a = T(this), s = a ? X : Y, u = this._wrappedIterables[o].__iterator(
868
+ s,
869
+ i
870
+ ), f = !0, c = 0; f; ) {
871
+ for (var h = u.next(); h.done; ) {
872
+ if (o++, o === this._wrappedIterables.length)
873
+ return c;
874
+ u = this._wrappedIterables[o].__iterator(
875
+ s,
876
+ i
877
+ ), h = u.next();
878
+ }
879
+ var p = a ? n(h.value[1], h.value[0], this) : n(h.value, c, this);
880
+ f = p !== !1, c++;
881
+ }
882
+ return c;
883
+ }
884
+ }, t.prototype.__iteratorUncached = function(n, i) {
885
+ var o = this;
886
+ if (this._wrappedIterables.length === 0)
887
+ return new w(x);
888
+ if (i)
889
+ return this.cacheResult().__iterator(n, i);
890
+ var a = 0, s = this._wrappedIterables[a].__iterator(
891
+ n,
892
+ i
893
+ );
894
+ return new w(function() {
895
+ for (var u = s.next(); u.done; ) {
896
+ if (a++, a === o._wrappedIterables.length)
897
+ return u;
898
+ s = o._wrappedIterables[a].__iterator(
899
+ n,
900
+ i
901
+ ), u = s.next();
902
+ }
903
+ return u;
904
+ });
905
+ }, t;
906
+ })(D);
907
+ function ws(r, t) {
908
+ var e = T(r), n = [r].concat(t).map(function(o) {
909
+ return W(o) ? e && (o = Q(o)) : o = e ? En(o) : ra(Array.isArray(o) ? o : [o]), o;
910
+ }).filter(function(o) {
911
+ return o.size !== 0;
912
+ });
913
+ if (n.length === 0)
914
+ return r;
915
+ if (n.length === 1) {
916
+ var i = n[0];
917
+ if (i === r || e && T(i) || Z(r) && Z(i))
918
+ return i;
919
+ }
920
+ return new Ss(n);
921
+ }
922
+ function ca(r, t, e) {
923
+ var n = ht(r);
924
+ return n.__iterateUncached = function(i, o) {
925
+ if (o)
926
+ return this.cacheResult().__iterate(i, o);
927
+ var a = 0, s = !1;
928
+ function u(f, c) {
929
+ f.__iterate(function(h, p) {
930
+ return (!t || c < t) && W(h) ? u(h, c + 1) : (a++, i(h, e ? p : a - 1, n) === !1 && (s = !0)), !s;
931
+ }, o);
932
+ }
933
+ return u(r, 0), a;
934
+ }, n.__iteratorUncached = function(i, o) {
935
+ if (o)
936
+ return this.cacheResult().__iterator(i, o);
937
+ var a = r.__iterator(i, o), s = [], u = 0;
938
+ return new w(function() {
939
+ for (; a; ) {
940
+ var f = a.next();
941
+ if (f.done !== !1) {
942
+ a = s.pop();
943
+ continue;
944
+ }
945
+ var c = f.value;
946
+ if (i === X && (c = c[1]), (!t || s.length < t) && W(c))
947
+ s.push(a), a = c.__iterator(i, o);
948
+ else
949
+ return e ? f : R(i, u++, c, f);
950
+ }
951
+ return x();
952
+ });
953
+ }, n;
954
+ }
955
+ function bs(r, t, e) {
956
+ var n = Rn(r);
957
+ return r.toSeq().map(function(i, o) {
958
+ return n(t.call(e, i, o, r));
959
+ }).flatten(!0);
960
+ }
961
+ function Is(r, t) {
962
+ var e = ht(r);
963
+ return e.size = r.size && r.size * 2 - 1, e.__iterateUncached = function(n, i) {
964
+ var o = this, a = 0;
965
+ return r.__iterate(
966
+ function(s) {
967
+ return (!a || n(t, a++, o) !== !1) && n(s, a++, o) !== !1;
968
+ },
969
+ i
970
+ ), a;
971
+ }, e.__iteratorUncached = function(n, i) {
972
+ var o = r.__iterator(Y, i), a = 0, s;
973
+ return new w(function() {
974
+ return (!s || a % 2) && (s = o.next(), s.done) ? s : a % 2 ? R(n, a++, t) : R(n, a++, s.value, s);
975
+ });
976
+ }, e;
977
+ }
978
+ function kt(r, t, e) {
979
+ t || (t = ha);
980
+ var n = T(r), i = 0, o = r.toSeq().map(function(a, s) {
981
+ return [s, a, i++, e ? e(a, s, r) : a];
982
+ }).valueSeq().toArray();
983
+ return o.sort(function(a, s) {
984
+ return t(a[3], s[3]) || a[2] - s[2];
985
+ }).forEach(
986
+ n ? function(a, s) {
987
+ o[s].length = 2;
988
+ } : function(a, s) {
989
+ o[s] = a[1];
990
+ }
991
+ ), n ? St(o) : Z(r) ? et(o) : Ut(o);
992
+ }
993
+ function vr(r, t, e) {
994
+ if (t || (t = ha), e) {
995
+ var n = r.toSeq().map(function(i, o) {
996
+ return [i, e(i, o, r)];
997
+ }).reduce(function(i, o) {
998
+ return ui(t, i[1], o[1]) ? o : i;
999
+ });
1000
+ return n && n[0];
1001
+ }
1002
+ return r.reduce(function(i, o) {
1003
+ return ui(t, i, o) ? o : i;
1004
+ });
1005
+ }
1006
+ function ui(r, t, e) {
1007
+ var n = r(e, t);
1008
+ return n === 0 && e !== t && (e == null || e !== e) || n > 0;
1009
+ }
1010
+ function yr(r, t, e, n) {
1011
+ var i = ht(r), o = new Bt(e).map(function(a) {
1012
+ return a.size;
1013
+ });
1014
+ return i.size = n ? o.max() : o.min(), i.__iterate = function(a, s) {
1015
+ for (var u = this.__iterator(Y, s), f, c = 0; !(f = u.next()).done && a(f.value, c++, this) !== !1; )
1016
+ ;
1017
+ return c;
1018
+ }, i.__iteratorUncached = function(a, s) {
1019
+ var u = e.map(
1020
+ function(h) {
1021
+ return h = j(h), pn(s ? h.reverse() : h);
1022
+ }
1023
+ ), f = 0, c = !1;
1024
+ return new w(function() {
1025
+ var h;
1026
+ return c || (h = u.map(function(p) {
1027
+ return p.next();
1028
+ }), c = n ? h.every(function(p) {
1029
+ return p.done;
1030
+ }) : h.some(function(p) {
1031
+ return p.done;
1032
+ })), c ? x() : R(
1033
+ a,
1034
+ f++,
1035
+ t.apply(
1036
+ null,
1037
+ h.map(function(p) {
1038
+ return p.value;
1039
+ })
1040
+ )
1041
+ );
1042
+ });
1043
+ }, i;
1044
+ }
1045
+ function q(r, t) {
1046
+ return r === t ? r : In(r) ? t : r.constructor(t);
1047
+ }
1048
+ function fi(r) {
1049
+ if (r !== Object(r))
1050
+ throw new TypeError("Expected [K, V] tuple: " + r);
1051
+ }
1052
+ function Rn(r) {
1053
+ return T(r) ? Q : Z(r) ? Mt : Dt;
1054
+ }
1055
+ function ht(r) {
1056
+ return Object.create(
1057
+ (T(r) ? St : Z(r) ? et : Ut).prototype
1058
+ );
1059
+ }
1060
+ function An() {
1061
+ return this._iter.cacheResult ? (this._iter.cacheResult(), this.size = this._iter.size, this) : D.prototype.cacheResult.call(this);
1062
+ }
1063
+ function ha(r, t) {
1064
+ return r === void 0 && t === void 0 ? 0 : r === void 0 ? 1 : t === void 0 ? -1 : r > t ? 1 : r < t ? -1 : 0;
1065
+ }
1066
+ function ci(r) {
1067
+ return !!(r && // @ts-expect-error: maybeValue is typed as `{}`
1068
+ typeof r.equals == "function" && // @ts-expect-error: maybeValue is typed as `{}`
1069
+ typeof r.hashCode == "function");
1070
+ }
1071
+ function G(r, t) {
1072
+ if (r === t || r !== r && t !== t)
1073
+ return !0;
1074
+ if (!r || !t)
1075
+ return !1;
1076
+ if (typeof r.valueOf == "function" && typeof t.valueOf == "function") {
1077
+ if (r = r.valueOf(), t = t.valueOf(), r === t || r !== r && t !== t)
1078
+ return !0;
1079
+ if (!r || !t)
1080
+ return !1;
1081
+ }
1082
+ return !!(ci(r) && ci(t) && r.equals(t));
1083
+ }
1084
+ function pa(r, t, e, n) {
1085
+ return Kt(
1086
+ // @ts-expect-error Index signature for type string is missing in type V[]
1087
+ r,
1088
+ [t],
1089
+ e,
1090
+ n
1091
+ );
1092
+ }
1093
+ function _a() {
1094
+ for (var r = [], t = arguments.length; t--; ) r[t] = arguments[t];
1095
+ return la(this, r);
1096
+ }
1097
+ function da(r) {
1098
+ for (var t = [], e = arguments.length - 1; e-- > 0; ) t[e] = arguments[e + 1];
1099
+ if (typeof r != "function")
1100
+ throw new TypeError("Invalid merger function: " + r);
1101
+ return la(this, t, r);
1102
+ }
1103
+ function la(r, t, e) {
1104
+ for (var n = [], i = 0; i < t.length; i++) {
1105
+ var o = Q(t[i]);
1106
+ o.size !== 0 && n.push(o);
1107
+ }
1108
+ return n.length === 0 ? r : r.toSeq().size === 0 && !r.__ownerID && n.length === 1 ? Et(r) ? r : r.constructor(n[0]) : r.withMutations(function(a) {
1109
+ for (var s = e ? function(f, c) {
1110
+ pa(
1111
+ a,
1112
+ c,
1113
+ S,
1114
+ function(h) {
1115
+ return h === S ? f : e(h, f, c);
1116
+ }
1117
+ );
1118
+ } : function(f, c) {
1119
+ a.set(c, f);
1120
+ }, u = 0; u < n.length; u++)
1121
+ n[u].forEach(s);
1122
+ });
1123
+ }
1124
+ var qs = Object.prototype.toString;
1125
+ function Ms(r) {
1126
+ if (!r || typeof r != "object" || qs.call(r) !== "[object Object]")
1127
+ return !1;
1128
+ var t = Object.getPrototypeOf(r);
1129
+ if (t === null)
1130
+ return !0;
1131
+ for (var e = t, n = Object.getPrototypeOf(t); n !== null; )
1132
+ e = n, n = Object.getPrototypeOf(e);
1133
+ return e === t;
1134
+ }
1135
+ function mt(r) {
1136
+ return typeof r == "object" && (ct(r) || Array.isArray(r) || Ms(r));
1137
+ }
1138
+ function ot(r, t) {
1139
+ t = t || 0;
1140
+ for (var e = Math.max(0, r.length - t), n = new Array(e), i = 0; i < e; i++)
1141
+ n[i] = r[i + t];
1142
+ return n;
1143
+ }
1144
+ function Mr(r) {
1145
+ if (Array.isArray(r))
1146
+ return ot(r);
1147
+ var t = {};
1148
+ for (var e in r)
1149
+ Ht.call(r, e) && (t[e] = r[e]);
1150
+ return t;
1151
+ }
1152
+ function Cn(r, t, e) {
1153
+ return $n(r, t, Es(e));
1154
+ }
1155
+ function $n(r, t, e) {
1156
+ if (!mt(r))
1157
+ throw new TypeError(
1158
+ "Cannot merge into non-data-structure value: " + r
1159
+ );
1160
+ if (ct(r))
1161
+ return typeof e == "function" && r.mergeWith ? r.mergeWith.apply(r, [e].concat(t)) : r.merge ? r.merge.apply(r, t) : r.concat.apply(r, t);
1162
+ for (var n = Array.isArray(r), i = r, o = n ? Mt : Q, a = n ? function(u) {
1163
+ i === r && (i = Mr(i)), i.push(u);
1164
+ } : function(u, f) {
1165
+ var c = Ht.call(i, f), h = c && e ? e(i[f], u, f) : u;
1166
+ (!c || h !== i[f]) && (i === r && (i = Mr(i)), i[f] = h);
1167
+ }, s = 0; s < t.length; s++)
1168
+ o(t[s]).forEach(a);
1169
+ return i;
1170
+ }
1171
+ function Es(r) {
1172
+ function t(e, n, i) {
1173
+ return mt(e) && mt(n) && Os(e, n) ? $n(e, [n], t) : r ? r(e, n, i) : n;
1174
+ }
1175
+ return t;
1176
+ }
1177
+ function Os(r, t) {
1178
+ var e = D(r), n = D(t);
1179
+ return Z(e) === Z(n) && T(e) === T(n);
1180
+ }
1181
+ function va() {
1182
+ for (var r = [], t = arguments.length; t--; ) r[t] = arguments[t];
1183
+ return Cn(this, r);
1184
+ }
1185
+ function ya(r) {
1186
+ for (var t = [], e = arguments.length - 1; e-- > 0; ) t[e] = arguments[e + 1];
1187
+ return Cn(this, t, r);
1188
+ }
1189
+ function Bn(r) {
1190
+ for (var t = [], e = arguments.length - 1; e-- > 0; ) t[e] = arguments[e + 1];
1191
+ return Kt(
1192
+ this,
1193
+ r,
1194
+ st(),
1195
+ function(n) {
1196
+ return Cn(n, t);
1197
+ }
1198
+ );
1199
+ }
1200
+ function kn(r) {
1201
+ for (var t = [], e = arguments.length - 1; e-- > 0; ) t[e] = arguments[e + 1];
1202
+ return Kt(this, r, st(), function(n) {
1203
+ return $n(n, t);
1204
+ });
1205
+ }
1206
+ function zs(r, t, e) {
1207
+ return Kt(r, t, S, function() {
1208
+ return e;
1209
+ });
1210
+ }
1211
+ function jn(r, t) {
1212
+ return zs(this, r, t);
1213
+ }
1214
+ function Ln(r, t, e) {
1215
+ return arguments.length === 1 ? r(this) : pa(this, r, t, e);
1216
+ }
1217
+ function Pn(r, t, e) {
1218
+ return Kt(this, r, t, e);
1219
+ }
1220
+ function xn() {
1221
+ return this.__altered;
1222
+ }
1223
+ function dr(r) {
1224
+ var t = this.asMutable();
1225
+ return r(t), t.wasAltered() ? t.__ensureOwner(this.__ownerID) : this;
1226
+ }
1227
+ var ga = "@@__IMMUTABLE_MAP__@@";
1228
+ function Nn(r) {
1229
+ return !!(r && // @ts-expect-error: maybeMap is typed as `{}`, need to change in 6.0 to `maybeMap && typeof maybeMap === 'object' && IS_MAP_SYMBOL in maybeMap`
1230
+ r[ga]);
1231
+ }
1232
+ function Zt(r, t) {
1233
+ if (!r)
1234
+ throw new Error(t);
1235
+ }
1236
+ function H(r) {
1237
+ Zt(r !== 1 / 0, "Cannot perform this action with an infinite size.");
1238
+ }
1239
+ var U = /* @__PURE__ */ (function(r) {
1240
+ function t(e) {
1241
+ return e == null ? st() : Nn(e) && !ut(e) ? e : st().withMutations(function(n) {
1242
+ var i = r(e);
1243
+ H(i.size), i.forEach(function(o, a) {
1244
+ return n.set(a, o);
1245
+ });
1246
+ });
1247
+ }
1248
+ return r && (t.__proto__ = r), t.prototype = Object.create(r && r.prototype), t.prototype.constructor = t, t.prototype.toString = function() {
1249
+ return this.__toString("Map {", "}");
1250
+ }, t.prototype.get = function(n, i) {
1251
+ return this._root ? this._root.get(0, void 0, n, i) : i;
1252
+ }, t.prototype.set = function(n, i) {
1253
+ return _i(this, n, i);
1254
+ }, t.prototype.remove = function(n) {
1255
+ return _i(this, n, S);
1256
+ }, t.prototype.deleteAll = function(n) {
1257
+ var i = j(n);
1258
+ return i.size === 0 ? this : this.withMutations(function(o) {
1259
+ i.forEach(function(a) {
1260
+ return o.remove(a);
1261
+ });
1262
+ });
1263
+ }, t.prototype.clear = function() {
1264
+ return this.size === 0 ? this : this.__ownerID ? (this.size = 0, this._root = null, this.__hash = void 0, this.__altered = !0, this) : st();
1265
+ }, t.prototype.sort = function(n) {
1266
+ return dt(kt(this, n));
1267
+ }, t.prototype.sortBy = function(n, i) {
1268
+ return dt(kt(this, i, n));
1269
+ }, t.prototype.map = function(n, i) {
1270
+ var o = this;
1271
+ return this.withMutations(function(a) {
1272
+ a.forEach(function(s, u) {
1273
+ a.set(u, n.call(i, s, u, o));
1274
+ });
1275
+ });
1276
+ }, t.prototype.__iterator = function(n, i) {
1277
+ return new Ts(this, n, i);
1278
+ }, t.prototype.__iterate = function(n, i) {
1279
+ var o = this, a = 0;
1280
+ return this._root && this._root.iterate(function(s) {
1281
+ return a++, n(s[1], s[0], o);
1282
+ }, i), a;
1283
+ }, t.prototype.__ensureOwner = function(n) {
1284
+ return n === this.__ownerID ? this : n ? Dn(this.size, this._root, n, this.__hash) : this.size === 0 ? st() : (this.__ownerID = n, this.__altered = !1, this);
1285
+ }, t;
1286
+ })(Q);
1287
+ U.isMap = Nn;
1288
+ var z = U.prototype;
1289
+ z[ga] = !0;
1290
+ z[cr] = z.remove;
1291
+ z.removeAll = z.deleteAll;
1292
+ z.setIn = jn;
1293
+ z.removeIn = z.deleteIn = Un;
1294
+ z.update = Ln;
1295
+ z.updateIn = Pn;
1296
+ z.merge = z.concat = _a;
1297
+ z.mergeWith = da;
1298
+ z.mergeDeep = va;
1299
+ z.mergeDeepWith = ya;
1300
+ z.mergeIn = kn;
1301
+ z.mergeDeepIn = Bn;
1302
+ z.withMutations = dr;
1303
+ z.wasAltered = xn;
1304
+ z.asImmutable = pr;
1305
+ z["@@transducer/init"] = z.asMutable = _r;
1306
+ z["@@transducer/step"] = function(r, t) {
1307
+ return r.set(t[0], t[1]);
1308
+ };
1309
+ z["@@transducer/result"] = function(r) {
1310
+ return r.asImmutable();
1311
+ };
1312
+ var rr = function(t, e) {
1313
+ this.ownerID = t, this.entries = e;
1314
+ };
1315
+ rr.prototype.get = function(t, e, n, i) {
1316
+ for (var o = this.entries, a = 0, s = o.length; a < s; a++)
1317
+ if (G(n, o[a][0]))
1318
+ return o[a][1];
1319
+ return i;
1320
+ };
1321
+ rr.prototype.update = function(t, e, n, i, o, a, s) {
1322
+ for (var u = o === S, f = this.entries, c = 0, h = f.length; c < h && !G(i, f[c][0]); c++)
1323
+ ;
1324
+ var p = c < h;
1325
+ if (p ? f[c][1] === o : u)
1326
+ return this;
1327
+ if (V(s), (u || !p) && V(a), !(u && f.length === 1)) {
1328
+ if (!p && !u && f.length >= ks)
1329
+ return Rs(t, f, i, o);
1330
+ var _ = t && t === this.ownerID, d = _ ? f : ot(f);
1331
+ return p ? u ? c === h - 1 ? d.pop() : d[c] = d.pop() : d[c] = [i, o] : d.push([i, o]), _ ? (this.entries = d, this) : new rr(t, d);
1332
+ }
1333
+ };
1334
+ var jt = function(t, e, n) {
1335
+ this.ownerID = t, this.bitmap = e, this.nodes = n;
1336
+ };
1337
+ jt.prototype.get = function(t, e, n, i) {
1338
+ e === void 0 && (e = F(n));
1339
+ var o = 1 << ((t === 0 ? e : e >>> t) & P), a = this.bitmap;
1340
+ return (a & o) === 0 ? i : this.nodes[ma(a & o - 1)].get(
1341
+ t + M,
1342
+ e,
1343
+ n,
1344
+ i
1345
+ );
1346
+ };
1347
+ jt.prototype.update = function(t, e, n, i, o, a, s) {
1348
+ n === void 0 && (n = F(i));
1349
+ var u = (e === 0 ? n : n >>> e) & P, f = 1 << u, c = this.bitmap, h = (c & f) !== 0;
1350
+ if (!h && o === S)
1351
+ return this;
1352
+ var p = ma(c & f - 1), _ = this.nodes, d = h ? _[p] : void 0, v = Fn(
1353
+ d,
1354
+ t,
1355
+ e + M,
1356
+ n,
1357
+ i,
1358
+ o,
1359
+ a,
1360
+ s
1361
+ );
1362
+ if (v === d)
1363
+ return this;
1364
+ if (!h && v && _.length >= js)
1365
+ return Cs(t, _, c, u, v);
1366
+ if (h && !v && _.length === 2 && di(_[p ^ 1]))
1367
+ return _[p ^ 1];
1368
+ if (h && v && _.length === 1 && di(v))
1369
+ return v;
1370
+ var I = t && t === this.ownerID, y = h ? v ? c : c ^ f : c | f, m = h ? v ? Sa(_, p, v, I) : Bs(_, p, I) : $s(_, p, v, I);
1371
+ return I ? (this.bitmap = y, this.nodes = m, this) : new jt(t, y, m);
1372
+ };
1373
+ var er = function(t, e, n) {
1374
+ this.ownerID = t, this.count = e, this.nodes = n;
1375
+ };
1376
+ er.prototype.get = function(t, e, n, i) {
1377
+ e === void 0 && (e = F(n));
1378
+ var o = (t === 0 ? e : e >>> t) & P, a = this.nodes[o];
1379
+ return a ? a.get(t + M, e, n, i) : i;
1380
+ };
1381
+ er.prototype.update = function(t, e, n, i, o, a, s) {
1382
+ n === void 0 && (n = F(i));
1383
+ var u = (e === 0 ? n : n >>> e) & P, f = o === S, c = this.nodes, h = c[u];
1384
+ if (f && !h)
1385
+ return this;
1386
+ var p = Fn(
1387
+ h,
1388
+ t,
1389
+ e + M,
1390
+ n,
1391
+ i,
1392
+ o,
1393
+ a,
1394
+ s
1395
+ );
1396
+ if (p === h)
1397
+ return this;
1398
+ var _ = this.count;
1399
+ if (!h)
1400
+ _++;
1401
+ else if (!p && (_--, _ < Ls))
1402
+ return As(t, c, _, u);
1403
+ var d = t && t === this.ownerID, v = Sa(c, u, p, d);
1404
+ return d ? (this.count = _, this.nodes = v, this) : new er(t, _, v);
1405
+ };
1406
+ var Lt = function(t, e, n) {
1407
+ this.ownerID = t, this.keyHash = e, this.entries = n;
1408
+ };
1409
+ Lt.prototype.get = function(t, e, n, i) {
1410
+ for (var o = this.entries, a = 0, s = o.length; a < s; a++)
1411
+ if (G(n, o[a][0]))
1412
+ return o[a][1];
1413
+ return i;
1414
+ };
1415
+ Lt.prototype.update = function(t, e, n, i, o, a, s) {
1416
+ n === void 0 && (n = F(i));
1417
+ var u = o === S;
1418
+ if (n !== this.keyHash)
1419
+ return u ? this : (V(s), V(a), Hn(this, t, e, n, [i, o]));
1420
+ for (var f = this.entries, c = 0, h = f.length; c < h && !G(i, f[c][0]); c++)
1421
+ ;
1422
+ var p = c < h;
1423
+ if (p ? f[c][1] === o : u)
1424
+ return this;
1425
+ if (V(s), (u || !p) && V(a), u && h === 2)
1426
+ return new _t(t, this.keyHash, f[c ^ 1]);
1427
+ var _ = t && t === this.ownerID, d = _ ? f : ot(f);
1428
+ return p ? u ? c === h - 1 ? d.pop() : d[c] = d.pop() : d[c] = [i, o] : d.push([i, o]), _ ? (this.entries = d, this) : new Lt(t, this.keyHash, d);
1429
+ };
1430
+ var _t = function(t, e, n) {
1431
+ this.ownerID = t, this.keyHash = e, this.entry = n;
1432
+ };
1433
+ _t.prototype.get = function(t, e, n, i) {
1434
+ return G(n, this.entry[0]) ? this.entry[1] : i;
1435
+ };
1436
+ _t.prototype.update = function(t, e, n, i, o, a, s) {
1437
+ var u = o === S, f = G(i, this.entry[0]);
1438
+ if (f ? o === this.entry[1] : u)
1439
+ return this;
1440
+ if (V(s), u) {
1441
+ V(a);
1442
+ return;
1443
+ }
1444
+ return f ? t && t === this.ownerID ? (this.entry[1] = o, this) : new _t(t, this.keyHash, [i, o]) : (V(a), Hn(this, t, e, F(i), [i, o]));
1445
+ };
1446
+ rr.prototype.iterate = Lt.prototype.iterate = function(r, t) {
1447
+ for (var e = this.entries, n = 0, i = e.length - 1; n <= i; n++)
1448
+ if (r(e[t ? i - n : n]) === !1)
1449
+ return !1;
1450
+ };
1451
+ jt.prototype.iterate = er.prototype.iterate = function(r, t) {
1452
+ for (var e = this.nodes, n = 0, i = e.length - 1; n <= i; n++) {
1453
+ var o = e[t ? i - n : n];
1454
+ if (o && o.iterate(r, t) === !1)
1455
+ return !1;
1456
+ }
1457
+ };
1458
+ _t.prototype.iterate = function(r, t) {
1459
+ return r(this.entry);
1460
+ };
1461
+ var Ts = /* @__PURE__ */ (function(r) {
1462
+ function t(e, n, i) {
1463
+ this._type = n, this._reverse = i, this._stack = e._root && hi(e._root);
1464
+ }
1465
+ return r && (t.__proto__ = r), t.prototype = Object.create(r && r.prototype), t.prototype.constructor = t, t.prototype.next = function() {
1466
+ for (var n = this._type, i = this._stack; i; ) {
1467
+ var o = i.node, a = i.index++, s = void 0;
1468
+ if (o.entry) {
1469
+ if (a === 0)
1470
+ return Hr(n, o.entry);
1471
+ } else if (o.entries) {
1472
+ if (s = o.entries.length - 1, a <= s)
1473
+ return Hr(
1474
+ n,
1475
+ o.entries[this._reverse ? s - a : a]
1476
+ );
1477
+ } else if (s = o.nodes.length - 1, a <= s) {
1478
+ var u = o.nodes[this._reverse ? s - a : a];
1479
+ if (u) {
1480
+ if (u.entry)
1481
+ return Hr(n, u.entry);
1482
+ i = this._stack = hi(u, i);
1483
+ }
1484
+ continue;
1485
+ }
1486
+ i = this._stack = this._stack.__prev;
1487
+ }
1488
+ return x();
1489
+ }, t;
1490
+ })(w);
1491
+ function Hr(r, t) {
1492
+ return R(r, t[0], t[1]);
1493
+ }
1494
+ function hi(r, t) {
1495
+ return {
1496
+ node: r,
1497
+ index: 0,
1498
+ __prev: t
1499
+ };
1500
+ }
1501
+ function Dn(r, t, e, n) {
1502
+ var i = Object.create(z);
1503
+ return i.size = r, i._root = t, i.__ownerID = e, i.__hash = n, i.__altered = !1, i;
1504
+ }
1505
+ var pi;
1506
+ function st() {
1507
+ return pi || (pi = Dn(0));
1508
+ }
1509
+ function _i(r, t, e) {
1510
+ var n, i;
1511
+ if (r._root) {
1512
+ var o = _n(), a = _n();
1513
+ if (n = Fn(
1514
+ r._root,
1515
+ r.__ownerID,
1516
+ 0,
1517
+ void 0,
1518
+ t,
1519
+ e,
1520
+ o,
1521
+ a
1522
+ ), !a.value)
1523
+ return r;
1524
+ i = r.size + (o.value ? e === S ? -1 : 1 : 0);
1525
+ } else {
1526
+ if (e === S)
1527
+ return r;
1528
+ i = 1, n = new rr(r.__ownerID, [[t, e]]);
1529
+ }
1530
+ return r.__ownerID ? (r.size = i, r._root = n, r.__hash = void 0, r.__altered = !0, r) : n ? Dn(i, n) : st();
1531
+ }
1532
+ function Fn(r, t, e, n, i, o, a, s) {
1533
+ return r ? r.update(
1534
+ t,
1535
+ e,
1536
+ n,
1537
+ i,
1538
+ o,
1539
+ a,
1540
+ s
1541
+ ) : o === S ? r : (V(s), V(a), new _t(t, n, [i, o]));
1542
+ }
1543
+ function di(r) {
1544
+ return r.constructor === _t || r.constructor === Lt;
1545
+ }
1546
+ function Hn(r, t, e, n, i) {
1547
+ if (r.keyHash === n)
1548
+ return new Lt(t, n, [r.entry, i]);
1549
+ var o = (e === 0 ? r.keyHash : r.keyHash >>> e) & P, a = (e === 0 ? n : n >>> e) & P, s, u = o === a ? [Hn(r, t, e + M, n, i)] : (s = new _t(t, n, i), o < a ? [r, s] : [s, r]);
1550
+ return new jt(t, 1 << o | 1 << a, u);
1551
+ }
1552
+ function Rs(r, t, e, n) {
1553
+ r || (r = new bn());
1554
+ for (var i = new _t(r, F(e), [e, n]), o = 0; o < t.length; o++) {
1555
+ var a = t[o];
1556
+ i = i.update(r, 0, void 0, a[0], a[1]);
1557
+ }
1558
+ return i;
1559
+ }
1560
+ function As(r, t, e, n) {
1561
+ for (var i = 0, o = 0, a = new Array(e), s = 0, u = 1, f = t.length; s < f; s++, u <<= 1) {
1562
+ var c = t[s];
1563
+ c !== void 0 && s !== n && (i |= u, a[o++] = c);
1564
+ }
1565
+ return new jt(r, i, a);
1566
+ }
1567
+ function Cs(r, t, e, n, i) {
1568
+ for (var o = 0, a = new Array(K), s = 0; e !== 0; s++, e >>>= 1)
1569
+ a[s] = e & 1 ? t[o++] : void 0;
1570
+ return a[n] = i, new er(r, o + 1, a);
1571
+ }
1572
+ function ma(r) {
1573
+ return r -= r >> 1 & 1431655765, r = (r & 858993459) + (r >> 2 & 858993459), r = r + (r >> 4) & 252645135, r += r >> 8, r += r >> 16, r & 127;
1574
+ }
1575
+ function Sa(r, t, e, n) {
1576
+ var i = n ? r : ot(r);
1577
+ return i[t] = e, i;
1578
+ }
1579
+ function $s(r, t, e, n) {
1580
+ var i = r.length + 1;
1581
+ if (n && t + 1 === i)
1582
+ return r[t] = e, r;
1583
+ for (var o = new Array(i), a = 0, s = 0; s < i; s++)
1584
+ s === t ? (o[s] = e, a = -1) : o[s] = r[s + a];
1585
+ return o;
1586
+ }
1587
+ function Bs(r, t, e) {
1588
+ var n = r.length - 1;
1589
+ if (e && t === n)
1590
+ return r.pop(), r;
1591
+ for (var i = new Array(n), o = 0, a = 0; a < n; a++)
1592
+ a === t && (o = 1), i[a] = r[a + o];
1593
+ return i;
1594
+ }
1595
+ var ks = K / 4, js = K / 2, Ls = K / 4;
1596
+ function wa(r) {
1597
+ if (ta(r) && typeof r != "string")
1598
+ return r;
1599
+ if (ut(r))
1600
+ return r.toArray();
1601
+ throw new TypeError("Invalid keyPath: expected Ordered Collection or Array: " + r);
1602
+ }
1603
+ function nr(r) {
1604
+ try {
1605
+ return typeof r == "string" ? JSON.stringify(r) : String(r);
1606
+ } catch {
1607
+ return JSON.stringify(r);
1608
+ }
1609
+ }
1610
+ function Ps(r, t) {
1611
+ return ct(r) ? (
1612
+ // @ts-expect-error key might be a number or symbol, which is not handled be Record key type
1613
+ r.has(t)
1614
+ ) : (
1615
+ // @ts-expect-error key might be anything else than PropertyKey, and will return false in that case but runtime is OK
1616
+ mt(r) && Ht.call(r, t)
1617
+ );
1618
+ }
1619
+ function ba(r, t, e) {
1620
+ return ct(r) ? r.get(t, e) : Ps(r, t) ? (
1621
+ // @ts-expect-error weird "get" here,
1622
+ typeof r.get == "function" ? (
1623
+ // @ts-expect-error weird "get" here,
1624
+ r.get(t)
1625
+ ) : (
1626
+ // @ts-expect-error key is unknown here,
1627
+ r[t]
1628
+ )
1629
+ ) : e;
1630
+ }
1631
+ function xs(r, t) {
1632
+ if (!mt(r))
1633
+ throw new TypeError("Cannot update non-data-structure value: " + r);
1634
+ if (ct(r)) {
1635
+ if (!r.remove)
1636
+ throw new TypeError("Cannot update immutable value without .remove() method: " + r);
1637
+ return r.remove(t);
1638
+ }
1639
+ if (!Ht.call(r, t))
1640
+ return r;
1641
+ var e = Mr(r);
1642
+ return Array.isArray(e) ? e.splice(t, 1) : delete e[t], e;
1643
+ }
1644
+ function Ns(r, t, e) {
1645
+ if (!mt(r))
1646
+ throw new TypeError("Cannot update non-data-structure value: " + r);
1647
+ if (ct(r)) {
1648
+ if (!r.set)
1649
+ throw new TypeError("Cannot update immutable value without .set() method: " + r);
1650
+ return r.set(t, e);
1651
+ }
1652
+ if (Ht.call(r, t) && e === r[t])
1653
+ return r;
1654
+ var n = Mr(r);
1655
+ return n[t] = e, n;
1656
+ }
1657
+ function Kt(r, t, e, n) {
1658
+ n || (n = e, e = void 0);
1659
+ var i = Ia(
1660
+ ct(r),
1661
+ // @ts-expect-error type issues with Record and mixed types
1662
+ r,
1663
+ wa(t),
1664
+ 0,
1665
+ e,
1666
+ n
1667
+ );
1668
+ return i === S ? e : i;
1669
+ }
1670
+ function Ia(r, t, e, n, i, o) {
1671
+ var a = t === S;
1672
+ if (n === e.length) {
1673
+ var s = a ? i : t, u = o(s);
1674
+ return u === s ? t : u;
1675
+ }
1676
+ if (!a && !mt(t))
1677
+ throw new TypeError("Cannot update within non-data-structure value in path [" + Array.from(e).slice(0, n).map(nr) + "]: " + t);
1678
+ var f = e[n], c = a ? S : ba(t, f, S), h = Ia(
1679
+ c === S ? r : ct(c),
1680
+ // @ts-expect-error mixed type
1681
+ c,
1682
+ e,
1683
+ n + 1,
1684
+ i,
1685
+ o
1686
+ );
1687
+ return h === c ? t : h === S ? xs(t, f) : Ns(a ? r ? st() : {} : t, f, h);
1688
+ }
1689
+ function Ds(r, t) {
1690
+ return Kt(r, t, function() {
1691
+ return S;
1692
+ });
1693
+ }
1694
+ function Un(r) {
1695
+ return Ds(this, r);
1696
+ }
1697
+ var qa = "@@__IMMUTABLE_LIST__@@";
1698
+ function Ma(r) {
1699
+ return !!(r && // @ts-expect-error: maybeList is typed as `{}`, need to change in 6.0 to `maybeList && typeof maybeList === 'object' && IS_LIST_SYMBOL in maybeList`
1700
+ r[qa]);
1701
+ }
1702
+ var $r = /* @__PURE__ */ (function(r) {
1703
+ function t(e) {
1704
+ var n = br();
1705
+ if (e == null)
1706
+ return n;
1707
+ if (Ma(e))
1708
+ return e;
1709
+ var i = r(e), o = i.size;
1710
+ return o === 0 ? n : (H(o), o > 0 && o < K ? ir(0, o, M, null, new vt(i.toArray())) : n.withMutations(function(a) {
1711
+ a.setSize(o), i.forEach(function(s, u) {
1712
+ return a.set(u, s);
1713
+ });
1714
+ }));
1715
+ }
1716
+ return r && (t.__proto__ = r), t.prototype = Object.create(r && r.prototype), t.prototype.constructor = t, t.of = function() {
1717
+ return this(arguments);
1718
+ }, t.prototype.toString = function() {
1719
+ return this.__toString("List [", "]");
1720
+ }, t.prototype.get = function(n, i) {
1721
+ if (n = yt(this, n), n >= 0 && n < this.size) {
1722
+ n += this._origin;
1723
+ var o = Ea(this, n);
1724
+ return o && o.array[n & P];
1725
+ }
1726
+ return i;
1727
+ }, t.prototype.set = function(n, i) {
1728
+ return Fs(this, n, i);
1729
+ }, t.prototype.remove = function(n) {
1730
+ return this.has(n) ? n === 0 ? this.shift() : n === this.size - 1 ? this.pop() : this.splice(n, 1) : this;
1731
+ }, t.prototype.insert = function(n, i) {
1732
+ return this.splice(n, 0, i);
1733
+ }, t.prototype.clear = function() {
1734
+ return this.size === 0 ? this : this.__ownerID ? (this.size = this._origin = this._capacity = 0, this._level = M, this._root = this._tail = this.__hash = void 0, this.__altered = !0, this) : br();
1735
+ }, t.prototype.push = function() {
1736
+ var n = arguments, i = this.size;
1737
+ return this.withMutations(function(o) {
1738
+ lt(o, 0, i + n.length);
1739
+ for (var a = 0; a < n.length; a++)
1740
+ o.set(i + a, n[a]);
1741
+ });
1742
+ }, t.prototype.pop = function() {
1743
+ return lt(this, 0, -1);
1744
+ }, t.prototype.unshift = function() {
1745
+ var n = arguments;
1746
+ return this.withMutations(function(i) {
1747
+ lt(i, -n.length);
1748
+ for (var o = 0; o < n.length; o++)
1749
+ i.set(o, n[o]);
1750
+ });
1751
+ }, t.prototype.shift = function() {
1752
+ return lt(this, 1);
1753
+ }, t.prototype.shuffle = function(n) {
1754
+ return n === void 0 && (n = Math.random), this.withMutations(function(i) {
1755
+ for (var o = i.size, a, s; o; )
1756
+ a = Math.floor(n() * o--), s = i.get(a), i.set(a, i.get(o)), i.set(o, s);
1757
+ });
1758
+ }, t.prototype.concat = function() {
1759
+ for (var n = arguments, i = [], o = 0; o < arguments.length; o++) {
1760
+ var a = n[o], s = r(
1761
+ typeof a != "string" && Yo(a) ? a : [a]
1762
+ );
1763
+ s.size !== 0 && i.push(s);
1764
+ }
1765
+ return i.length === 0 ? this : this.size === 0 && !this.__ownerID && i.length === 1 ? this.constructor(i[0]) : this.withMutations(function(u) {
1766
+ i.forEach(function(f) {
1767
+ return f.forEach(function(c) {
1768
+ return u.push(c);
1769
+ });
1770
+ });
1771
+ });
1772
+ }, t.prototype.setSize = function(n) {
1773
+ return lt(this, 0, n);
1774
+ }, t.prototype.map = function(n, i) {
1775
+ var o = this;
1776
+ return this.withMutations(function(a) {
1777
+ for (var s = 0; s < o.size; s++)
1778
+ a.set(s, n.call(i, a.get(s), s, o));
1779
+ });
1780
+ }, t.prototype.slice = function(n, i) {
1781
+ var o = this.size;
1782
+ return Tr(n, i, o) ? this : lt(
1783
+ this,
1784
+ hr(n, o),
1785
+ Rr(i, o)
1786
+ );
1787
+ }, t.prototype.__iterator = function(n, i) {
1788
+ var o = i ? this.size : 0, a = li(this, i);
1789
+ return new w(function() {
1790
+ var s = a();
1791
+ return s === Qt ? x() : R(n, i ? --o : o++, s);
1792
+ });
1793
+ }, t.prototype.__iterate = function(n, i) {
1794
+ for (var o = i ? this.size : 0, a = li(this, i), s; (s = a()) !== Qt && n(s, i ? --o : o++, this) !== !1; )
1795
+ ;
1796
+ return o;
1797
+ }, t.prototype.__ensureOwner = function(n) {
1798
+ return n === this.__ownerID ? this : n ? ir(
1799
+ this._origin,
1800
+ this._capacity,
1801
+ this._level,
1802
+ this._root,
1803
+ this._tail,
1804
+ n,
1805
+ this.__hash
1806
+ ) : this.size === 0 ? br() : (this.__ownerID = n, this.__altered = !1, this);
1807
+ }, t;
1808
+ })(Mt);
1809
+ $r.isList = Ma;
1810
+ var $ = $r.prototype;
1811
+ $[qa] = !0;
1812
+ $[cr] = $.remove;
1813
+ $.merge = $.concat;
1814
+ $.setIn = jn;
1815
+ $.deleteIn = $.removeIn = Un;
1816
+ $.update = Ln;
1817
+ $.updateIn = Pn;
1818
+ $.mergeIn = kn;
1819
+ $.mergeDeepIn = Bn;
1820
+ $.withMutations = dr;
1821
+ $.wasAltered = xn;
1822
+ $.asImmutable = pr;
1823
+ $["@@transducer/init"] = $.asMutable = _r;
1824
+ $["@@transducer/step"] = function(r, t) {
1825
+ return r.push(t);
1826
+ };
1827
+ $["@@transducer/result"] = function(r) {
1828
+ return r.asImmutable();
1829
+ };
1830
+ var vt = function(t, e) {
1831
+ this.array = t, this.ownerID = e;
1832
+ };
1833
+ vt.prototype.removeBefore = function(t, e, n) {
1834
+ if ((n & (1 << e + M) - 1) === 0 || this.array.length === 0)
1835
+ return this;
1836
+ var i = n >>> e & P;
1837
+ if (i >= this.array.length)
1838
+ return new vt([], t);
1839
+ var o = i === 0, a;
1840
+ if (e > 0) {
1841
+ var s = this.array[i];
1842
+ if (a = s && s.removeBefore(t, e - M, n), a === s && o)
1843
+ return this;
1844
+ }
1845
+ if (o && !a)
1846
+ return this;
1847
+ var u = Pt(this, t);
1848
+ if (!o)
1849
+ for (var f = 0; f < i; f++)
1850
+ u.array[f] = void 0;
1851
+ return a && (u.array[i] = a), u;
1852
+ };
1853
+ vt.prototype.removeAfter = function(t, e, n) {
1854
+ if (n === (e ? 1 << e + M : K) || this.array.length === 0)
1855
+ return this;
1856
+ var i = n - 1 >>> e & P;
1857
+ if (i >= this.array.length)
1858
+ return this;
1859
+ var o;
1860
+ if (e > 0) {
1861
+ var a = this.array[i];
1862
+ if (o = a && a.removeAfter(t, e - M, n), o === a && i === this.array.length - 1)
1863
+ return this;
1864
+ }
1865
+ var s = Pt(this, t);
1866
+ return s.array.splice(i + 1), o && (s.array[i] = o), s;
1867
+ };
1868
+ var Qt = {};
1869
+ function li(r, t) {
1870
+ var e = r._origin, n = r._capacity, i = or(n), o = r._tail;
1871
+ return a(r._root, r._level, 0);
1872
+ function a(f, c, h) {
1873
+ return c === 0 ? s(f, h) : u(f, c, h);
1874
+ }
1875
+ function s(f, c) {
1876
+ var h = c === i ? o && o.array : f && f.array, p = c > e ? 0 : e - c, _ = n - c;
1877
+ return _ > K && (_ = K), function() {
1878
+ if (p === _)
1879
+ return Qt;
1880
+ var d = t ? --_ : p++;
1881
+ return h && h[d];
1882
+ };
1883
+ }
1884
+ function u(f, c, h) {
1885
+ var p, _ = f && f.array, d = h > e ? 0 : e - h >> c, v = (n - h >> c) + 1;
1886
+ return v > K && (v = K), function() {
1887
+ for (; ; ) {
1888
+ if (p) {
1889
+ var I = p();
1890
+ if (I !== Qt)
1891
+ return I;
1892
+ p = null;
1893
+ }
1894
+ if (d === v)
1895
+ return Qt;
1896
+ var y = t ? --v : d++;
1897
+ p = a(
1898
+ _ && _[y],
1899
+ c - M,
1900
+ h + (y << c)
1901
+ );
1902
+ }
1903
+ };
1904
+ }
1905
+ }
1906
+ function ir(r, t, e, n, i, o, a) {
1907
+ var s = Object.create($);
1908
+ return s.size = t - r, s._origin = r, s._capacity = t, s._level = e, s._root = n, s._tail = i, s.__ownerID = o, s.__hash = a, s.__altered = !1, s;
1909
+ }
1910
+ function br() {
1911
+ return ir(0, 0, M);
1912
+ }
1913
+ function Fs(r, t, e) {
1914
+ if (t = yt(r, t), t !== t)
1915
+ return r;
1916
+ if (t >= r.size || t < 0)
1917
+ return r.withMutations(function(a) {
1918
+ t < 0 ? lt(a, t).set(0, e) : lt(a, 0, t + 1).set(t, e);
1919
+ });
1920
+ t += r._origin;
1921
+ var n = r._tail, i = r._root, o = _n();
1922
+ return t >= or(r._capacity) ? n = yn(n, r.__ownerID, 0, t, e, o) : i = yn(
1923
+ i,
1924
+ r.__ownerID,
1925
+ r._level,
1926
+ t,
1927
+ e,
1928
+ o
1929
+ ), o.value ? r.__ownerID ? (r._root = i, r._tail = n, r.__hash = void 0, r.__altered = !0, r) : ir(r._origin, r._capacity, r._level, i, n) : r;
1930
+ }
1931
+ function yn(r, t, e, n, i, o) {
1932
+ var a = n >>> e & P, s = r && a < r.array.length;
1933
+ if (!s && i === void 0)
1934
+ return r;
1935
+ var u;
1936
+ if (e > 0) {
1937
+ var f = r && r.array[a], c = yn(
1938
+ f,
1939
+ t,
1940
+ e - M,
1941
+ n,
1942
+ i,
1943
+ o
1944
+ );
1945
+ return c === f ? r : (u = Pt(r, t), u.array[a] = c, u);
1946
+ }
1947
+ return s && r.array[a] === i ? r : (o && V(o), u = Pt(r, t), i === void 0 && a === u.array.length - 1 ? u.array.pop() : u.array[a] = i, u);
1948
+ }
1949
+ function Pt(r, t) {
1950
+ return t && r && t === r.ownerID ? r : new vt(r ? r.array.slice() : [], t);
1951
+ }
1952
+ function Ea(r, t) {
1953
+ if (t >= or(r._capacity))
1954
+ return r._tail;
1955
+ if (t < 1 << r._level + M) {
1956
+ for (var e = r._root, n = r._level; e && n > 0; )
1957
+ e = e.array[t >>> n & P], n -= M;
1958
+ return e;
1959
+ }
1960
+ }
1961
+ function lt(r, t, e) {
1962
+ t !== void 0 && (t |= 0), e !== void 0 && (e |= 0);
1963
+ var n = r.__ownerID || new bn(), i = r._origin, o = r._capacity, a = i + t, s = e === void 0 ? o : e < 0 ? o + e : i + e;
1964
+ if (a === i && s === o)
1965
+ return r;
1966
+ if (a >= s)
1967
+ return r.clear();
1968
+ for (var u = r._level, f = r._root, c = 0; a + c < 0; )
1969
+ f = new vt(
1970
+ f && f.array.length ? [void 0, f] : [],
1971
+ n
1972
+ ), u += M, c += 1 << u;
1973
+ c && (a += c, i += c, s += c, o += c);
1974
+ for (var h = or(o), p = or(s); p >= 1 << u + M; )
1975
+ f = new vt(
1976
+ f && f.array.length ? [f] : [],
1977
+ n
1978
+ ), u += M;
1979
+ var _ = r._tail, d = p < h ? Ea(r, s - 1) : p > h ? new vt([], n) : _;
1980
+ if (_ && p > h && a < o && _.array.length) {
1981
+ f = Pt(f, n);
1982
+ for (var v = f, I = u; I > M; I -= M) {
1983
+ var y = h >>> I & P;
1984
+ v = v.array[y] = Pt(v.array[y], n);
1985
+ }
1986
+ v.array[h >>> M & P] = _;
1987
+ }
1988
+ if (s < o && (d = d && d.removeAfter(n, 0, s)), a >= p)
1989
+ a -= p, s -= p, u = M, f = null, d = d && d.removeBefore(n, 0, a);
1990
+ else if (a > i || p < h) {
1991
+ for (c = 0; f; ) {
1992
+ var m = a >>> u & P;
1993
+ if (m !== p >>> u & P)
1994
+ break;
1995
+ m && (c += (1 << u) * m), u -= M, f = f.array[m];
1996
+ }
1997
+ f && a > i && (f = f.removeBefore(n, u, a - c)), f && p < h && (f = f.removeAfter(
1998
+ n,
1999
+ u,
2000
+ p - c
2001
+ )), c && (a -= c, s -= c);
2002
+ }
2003
+ return r.__ownerID ? (r.size = s - a, r._origin = a, r._capacity = s, r._level = u, r._root = f, r._tail = d, r.__hash = void 0, r.__altered = !0, r) : ir(a, s, u, f, d);
2004
+ }
2005
+ function or(r) {
2006
+ return r < K ? 0 : r - 1 >>> M << M;
2007
+ }
2008
+ function Oa(r) {
2009
+ return Nn(r) && ut(r);
2010
+ }
2011
+ var dt = /* @__PURE__ */ (function(r) {
2012
+ function t(e) {
2013
+ return e == null ? Xt() : Oa(e) ? e : Xt().withMutations(function(n) {
2014
+ var i = Q(e);
2015
+ H(i.size), i.forEach(function(o, a) {
2016
+ return n.set(a, o);
2017
+ });
2018
+ });
2019
+ }
2020
+ return r && (t.__proto__ = r), t.prototype = Object.create(r && r.prototype), t.prototype.constructor = t, t.of = function() {
2021
+ return this(arguments);
2022
+ }, t.prototype.toString = function() {
2023
+ return this.__toString("OrderedMap {", "}");
2024
+ }, t.prototype.get = function(n, i) {
2025
+ var o = this._map.get(n);
2026
+ return o !== void 0 ? this._list.get(o)[1] : i;
2027
+ }, t.prototype.clear = function() {
2028
+ return this.size === 0 ? this : this.__ownerID ? (this.size = 0, this._map.clear(), this._list.clear(), this.__altered = !0, this) : Xt();
2029
+ }, t.prototype.set = function(n, i) {
2030
+ return yi(this, n, i);
2031
+ }, t.prototype.remove = function(n) {
2032
+ return yi(this, n, S);
2033
+ }, t.prototype.__iterate = function(n, i) {
2034
+ var o = this;
2035
+ return this._list.__iterate(
2036
+ function(a) {
2037
+ return a && n(a[1], a[0], o);
2038
+ },
2039
+ i
2040
+ );
2041
+ }, t.prototype.__iterator = function(n, i) {
2042
+ return this._list.fromEntrySeq().__iterator(n, i);
2043
+ }, t.prototype.__ensureOwner = function(n) {
2044
+ if (n === this.__ownerID)
2045
+ return this;
2046
+ var i = this._map.__ensureOwner(n), o = this._list.__ensureOwner(n);
2047
+ return n ? Kn(i, o, n, this.__hash) : this.size === 0 ? Xt() : (this.__ownerID = n, this.__altered = !1, this._map = i, this._list = o, this);
2048
+ }, t;
2049
+ })(U);
2050
+ dt.isOrderedMap = Oa;
2051
+ dt.prototype[gt] = !0;
2052
+ dt.prototype[cr] = dt.prototype.remove;
2053
+ function Kn(r, t, e, n) {
2054
+ var i = Object.create(dt.prototype);
2055
+ return i.size = r ? r.size : 0, i._map = r, i._list = t, i.__ownerID = e, i.__hash = n, i.__altered = !1, i;
2056
+ }
2057
+ var vi;
2058
+ function Xt() {
2059
+ return vi || (vi = Kn(st(), br()));
2060
+ }
2061
+ function yi(r, t, e) {
2062
+ var n = r._map, i = r._list, o = n.get(t), a = o !== void 0, s, u;
2063
+ if (e === S) {
2064
+ if (!a)
2065
+ return r;
2066
+ i.size >= K && i.size >= n.size * 2 ? (u = i.filter(function(f, c) {
2067
+ return f !== void 0 && o !== c;
2068
+ }), s = u.toKeyedSeq().map(function(f) {
2069
+ return f[0];
2070
+ }).flip().toMap(), r.__ownerID && (s.__ownerID = u.__ownerID = r.__ownerID)) : (s = n.remove(t), u = o === i.size - 1 ? i.pop() : i.set(o, void 0));
2071
+ } else if (a) {
2072
+ if (e === i.get(o)[1])
2073
+ return r;
2074
+ s = n, u = i.set(o, [t, e]);
2075
+ } else
2076
+ s = n.set(t, i.size), u = i.set(i.size, [t, e]);
2077
+ return r.__ownerID ? (r.size = s.size, r._map = s, r._list = u, r.__hash = void 0, r.__altered = !0, r) : Kn(s, u);
2078
+ }
2079
+ var za = "@@__IMMUTABLE_STACK__@@";
2080
+ function gn(r) {
2081
+ return !!(r && // @ts-expect-error: maybeStack is typed as `{}`, need to change in 6.0 to `maybeStack && typeof maybeStack === 'object' && MAYBE_STACK_SYMBOL in maybeStack`
2082
+ r[za]);
2083
+ }
2084
+ var Gn = /* @__PURE__ */ (function(r) {
2085
+ function t(e) {
2086
+ return e == null ? gr() : gn(e) ? e : gr().pushAll(e);
2087
+ }
2088
+ return r && (t.__proto__ = r), t.prototype = Object.create(r && r.prototype), t.prototype.constructor = t, t.of = function() {
2089
+ return this(arguments);
2090
+ }, t.prototype.toString = function() {
2091
+ return this.__toString("Stack [", "]");
2092
+ }, t.prototype.get = function(n, i) {
2093
+ var o = this._head;
2094
+ for (n = yt(this, n); o && n--; )
2095
+ o = o.next;
2096
+ return o ? o.value : i;
2097
+ }, t.prototype.peek = function() {
2098
+ return this._head && this._head.value;
2099
+ }, t.prototype.push = function() {
2100
+ var n = arguments;
2101
+ if (arguments.length === 0)
2102
+ return this;
2103
+ for (var i = this.size + arguments.length, o = this._head, a = arguments.length - 1; a >= 0; a--)
2104
+ o = {
2105
+ value: n[a],
2106
+ next: o
2107
+ };
2108
+ return this.__ownerID ? (this.size = i, this._head = o, this.__hash = void 0, this.__altered = !0, this) : Jt(i, o);
2109
+ }, t.prototype.pushAll = function(n) {
2110
+ if (n = r(n), n.size === 0)
2111
+ return this;
2112
+ if (this.size === 0 && gn(n))
2113
+ return n;
2114
+ H(n.size);
2115
+ var i = this.size, o = this._head;
2116
+ return n.__iterate(
2117
+ function(a) {
2118
+ i++, o = {
2119
+ value: a,
2120
+ next: o
2121
+ };
2122
+ },
2123
+ /* reverse */
2124
+ !0
2125
+ ), this.__ownerID ? (this.size = i, this._head = o, this.__hash = void 0, this.__altered = !0, this) : Jt(i, o);
2126
+ }, t.prototype.pop = function() {
2127
+ return this.slice(1);
2128
+ }, t.prototype.clear = function() {
2129
+ return this.size === 0 ? this : this.__ownerID ? (this.size = 0, this._head = void 0, this.__hash = void 0, this.__altered = !0, this) : gr();
2130
+ }, t.prototype.slice = function(n, i) {
2131
+ if (Tr(n, i, this.size))
2132
+ return this;
2133
+ var o = hr(n, this.size), a = Rr(i, this.size);
2134
+ if (a !== this.size)
2135
+ return r.prototype.slice.call(this, n, i);
2136
+ for (var s = this.size - o, u = this._head; o--; )
2137
+ u = u.next;
2138
+ return this.__ownerID ? (this.size = s, this._head = u, this.__hash = void 0, this.__altered = !0, this) : Jt(s, u);
2139
+ }, t.prototype.__ensureOwner = function(n) {
2140
+ return n === this.__ownerID ? this : n ? Jt(this.size, this._head, n, this.__hash) : this.size === 0 ? gr() : (this.__ownerID = n, this.__altered = !1, this);
2141
+ }, t.prototype.__iterate = function(n, i) {
2142
+ var o = this;
2143
+ if (i)
2144
+ return new Bt(this.toArray()).__iterate(
2145
+ function(u, f) {
2146
+ return n(u, f, o);
2147
+ },
2148
+ i
2149
+ );
2150
+ for (var a = 0, s = this._head; s && n(s.value, a++, this) !== !1; )
2151
+ s = s.next;
2152
+ return a;
2153
+ }, t.prototype.__iterator = function(n, i) {
2154
+ if (i)
2155
+ return new Bt(this.toArray()).__iterator(n, i);
2156
+ var o = 0, a = this._head;
2157
+ return new w(function() {
2158
+ if (a) {
2159
+ var s = a.value;
2160
+ return a = a.next, R(n, o++, s);
2161
+ }
2162
+ return x();
2163
+ });
2164
+ }, t;
2165
+ })(Mt);
2166
+ Gn.isStack = gn;
2167
+ var N = Gn.prototype;
2168
+ N[za] = !0;
2169
+ N.shift = N.pop;
2170
+ N.unshift = N.push;
2171
+ N.unshiftAll = N.pushAll;
2172
+ N.withMutations = dr;
2173
+ N.wasAltered = xn;
2174
+ N.asImmutable = pr;
2175
+ N["@@transducer/init"] = N.asMutable = _r;
2176
+ N["@@transducer/step"] = function(r, t) {
2177
+ return r.unshift(t);
2178
+ };
2179
+ N["@@transducer/result"] = function(r) {
2180
+ return r.asImmutable();
2181
+ };
2182
+ function Jt(r, t, e, n) {
2183
+ var i = Object.create(N);
2184
+ return i.size = r, i._head = t, i.__ownerID = e, i.__hash = n, i.__altered = !1, i;
2185
+ }
2186
+ var gi;
2187
+ function gr() {
2188
+ return gi || (gi = Jt(0));
2189
+ }
2190
+ function mi(r, t, e, n, i, o) {
2191
+ return H(r.size), r.__iterate(function(a, s, u) {
2192
+ i ? (i = !1, e = a) : e = t.call(n, e, a, s, u);
2193
+ }, o), e;
2194
+ }
2195
+ function Hs(r, t) {
2196
+ return t;
2197
+ }
2198
+ function Us(r, t) {
2199
+ return [t, r];
2200
+ }
2201
+ function Ur(r) {
2202
+ return function() {
2203
+ for (var t = [], e = arguments.length; e--; ) t[e] = arguments[e];
2204
+ return !r.apply(this, t);
2205
+ };
2206
+ }
2207
+ function Si(r) {
2208
+ return function() {
2209
+ for (var t = [], e = arguments.length; e--; ) t[e] = arguments[e];
2210
+ return -r.apply(this, t);
2211
+ };
2212
+ }
2213
+ function wi(r, t) {
2214
+ return r < t ? 1 : r > t ? -1 : 0;
2215
+ }
2216
+ function Ta(r, t) {
2217
+ if (r === t)
2218
+ return !0;
2219
+ if (!W(t) || // @ts-expect-error size should exists on Collection
2220
+ r.size !== void 0 && t.size !== void 0 && r.size !== t.size || // @ts-expect-error __hash exists on Collection
2221
+ r.__hash !== void 0 && // @ts-expect-error __hash exists on Collection
2222
+ t.__hash !== void 0 && // @ts-expect-error __hash exists on Collection
2223
+ r.__hash !== t.__hash || T(r) !== T(t) || Z(r) !== Z(t) || // @ts-expect-error Range extends Collection, which implements [Symbol.iterator], so it is valid
2224
+ ut(r) !== ut(t))
2225
+ return !1;
2226
+ if (r.size === 0 && t.size === 0)
2227
+ return !0;
2228
+ var e = !wn(r);
2229
+ if (ut(r)) {
2230
+ var n = r.entries();
2231
+ return t.every(function(u, f) {
2232
+ var c = n.next().value;
2233
+ return c && G(c[1], u) && (e || G(c[0], f));
2234
+ }) && n.next().done;
2235
+ }
2236
+ var i = !1;
2237
+ if (r.size === void 0)
2238
+ if (t.size === void 0)
2239
+ typeof r.cacheResult == "function" && r.cacheResult();
2240
+ else {
2241
+ i = !0;
2242
+ var o = r;
2243
+ r = t, t = o;
2244
+ }
2245
+ var a = !0, s = (
2246
+ // @ts-expect-error b is Range | Repeat | Collection<unknown, unknown> as it may have been flipped, and __iterate is valid
2247
+ t.__iterate(function(u, f) {
2248
+ if (e ? (
2249
+ // @ts-expect-error has exists on Collection
2250
+ !r.has(u)
2251
+ ) : i ? (
2252
+ // @ts-expect-error type of `get` does not "catch" the version with `notSetValue`
2253
+ !G(u, r.get(f, S))
2254
+ ) : (
2255
+ // @ts-expect-error type of `get` does not "catch" the version with `notSetValue`
2256
+ !G(r.get(f, S), u)
2257
+ ))
2258
+ return a = !1, !1;
2259
+ })
2260
+ );
2261
+ return a && // @ts-expect-error size should exists on Collection
2262
+ r.size === s;
2263
+ }
2264
+ var Ks = /* @__PURE__ */ (function(r) {
2265
+ function t(e, n, i) {
2266
+ if (i === void 0 && (i = 1), !(this instanceof t))
2267
+ return new t(e, n, i);
2268
+ if (Zt(i !== 0, "Cannot step a Range by 0"), Zt(
2269
+ e !== void 0,
2270
+ "You must define a start value when using Range"
2271
+ ), Zt(
2272
+ n !== void 0,
2273
+ "You must define an end value when using Range"
2274
+ ), i = Math.abs(i), n < e && (i = -i), this._start = e, this._end = n, this._step = i, this.size = Math.max(0, Math.ceil((n - e) / i - 1) + 1), this.size === 0) {
2275
+ if (Kr)
2276
+ return Kr;
2277
+ Kr = this;
2278
+ }
2279
+ }
2280
+ return r && (t.__proto__ = r), t.prototype = Object.create(r && r.prototype), t.prototype.constructor = t, t.prototype.toString = function() {
2281
+ return this.size === 0 ? "Range []" : "Range [ " + this._start + "..." + this._end + (this._step !== 1 ? " by " + this._step : "") + " ]";
2282
+ }, t.prototype.get = function(n, i) {
2283
+ return this.has(n) ? this._start + yt(this, n) * this._step : i;
2284
+ }, t.prototype.includes = function(n) {
2285
+ var i = (n - this._start) / this._step;
2286
+ return i >= 0 && i < this.size && i === Math.floor(i);
2287
+ }, t.prototype.slice = function(n, i) {
2288
+ return Tr(n, i, this.size) ? this : (n = hr(n, this.size), i = Rr(i, this.size), i <= n ? new t(0, 0) : new t(
2289
+ this.get(n, this._end),
2290
+ this.get(i, this._end),
2291
+ this._step
2292
+ ));
2293
+ }, t.prototype.indexOf = function(n) {
2294
+ var i = n - this._start;
2295
+ if (i % this._step === 0) {
2296
+ var o = i / this._step;
2297
+ if (o >= 0 && o < this.size)
2298
+ return o;
2299
+ }
2300
+ return -1;
2301
+ }, t.prototype.lastIndexOf = function(n) {
2302
+ return this.indexOf(n);
2303
+ }, t.prototype.__iterate = function(n, i) {
2304
+ for (var o = this.size, a = this._step, s = i ? this._start + (o - 1) * a : this._start, u = 0; u !== o && n(s, i ? o - ++u : u++, this) !== !1; )
2305
+ s += i ? -a : a;
2306
+ return u;
2307
+ }, t.prototype.__iterator = function(n, i) {
2308
+ var o = this.size, a = this._step, s = i ? this._start + (o - 1) * a : this._start, u = 0;
2309
+ return new w(function() {
2310
+ if (u === o)
2311
+ return x();
2312
+ var f = s;
2313
+ return s += i ? -a : a, R(n, i ? o - ++u : u++, f);
2314
+ });
2315
+ }, t.prototype.equals = function(n) {
2316
+ return n instanceof t ? this._start === n._start && this._end === n._end && this._step === n._step : Ta(this, n);
2317
+ }, t;
2318
+ })(et), Kr, Ra = "@@__IMMUTABLE_SET__@@";
2319
+ function Wn(r) {
2320
+ return !!(r && // @ts-expect-error: maybeSet is typed as `{}`, need to change in 6.0 to `maybeSeq && typeof maybeSet === 'object' && MAYBE_SET_SYMBOL in maybeSet`
2321
+ r[Ra]);
2322
+ }
2323
+ var ft = /* @__PURE__ */ (function(r) {
2324
+ function t(e) {
2325
+ return e == null ? Vt() : Wn(e) && !ut(e) ? e : Vt().withMutations(function(n) {
2326
+ var i = r(e);
2327
+ H(i.size), i.forEach(function(o) {
2328
+ return n.add(o);
2329
+ });
2330
+ });
2331
+ }
2332
+ return r && (t.__proto__ = r), t.prototype = Object.create(r && r.prototype), t.prototype.constructor = t, t.of = function() {
2333
+ return this(arguments);
2334
+ }, t.fromKeys = function(n) {
2335
+ return this(Q(n).keySeq());
2336
+ }, t.intersect = function(n) {
2337
+ return n = j(n).toArray(), n.length ? k.intersect.apply(t(n.pop()), n) : Vt();
2338
+ }, t.union = function(n) {
2339
+ return n = j(n).toArray(), n.length ? k.union.apply(t(n.pop()), n) : Vt();
2340
+ }, t.prototype.toString = function() {
2341
+ return this.__toString("Set {", "}");
2342
+ }, t.prototype.has = function(n) {
2343
+ return this._map.has(n);
2344
+ }, t.prototype.add = function(n) {
2345
+ return mr(this, this._map.set(n, n));
2346
+ }, t.prototype.remove = function(n) {
2347
+ return mr(this, this._map.remove(n));
2348
+ }, t.prototype.clear = function() {
2349
+ return mr(this, this._map.clear());
2350
+ }, t.prototype.map = function(n, i) {
2351
+ var o = this, a = !1, s = mr(
2352
+ this,
2353
+ this._map.mapEntries(function(u) {
2354
+ var f = u[1], c = n.call(i, f, f, o);
2355
+ return c !== f && (a = !0), [c, c];
2356
+ }, i)
2357
+ );
2358
+ return a ? s : this;
2359
+ }, t.prototype.union = function() {
2360
+ for (var n = [], i = arguments.length; i--; ) n[i] = arguments[i];
2361
+ return n = n.filter(function(o) {
2362
+ return o.size !== 0;
2363
+ }), n.length === 0 ? this : this.size === 0 && !this.__ownerID && n.length === 1 ? this.constructor(n[0]) : this.withMutations(function(o) {
2364
+ for (var a = 0; a < n.length; a++)
2365
+ typeof n[a] == "string" ? o.add(n[a]) : r(n[a]).forEach(function(s) {
2366
+ return o.add(s);
2367
+ });
2368
+ });
2369
+ }, t.prototype.intersect = function() {
2370
+ for (var n = [], i = arguments.length; i--; ) n[i] = arguments[i];
2371
+ if (n.length === 0)
2372
+ return this;
2373
+ n = n.map(function(a) {
2374
+ return r(a);
2375
+ });
2376
+ var o = [];
2377
+ return this.forEach(function(a) {
2378
+ n.every(function(s) {
2379
+ return s.includes(a);
2380
+ }) || o.push(a);
2381
+ }), this.withMutations(function(a) {
2382
+ o.forEach(function(s) {
2383
+ a.remove(s);
2384
+ });
2385
+ });
2386
+ }, t.prototype.subtract = function() {
2387
+ for (var n = [], i = arguments.length; i--; ) n[i] = arguments[i];
2388
+ if (n.length === 0)
2389
+ return this;
2390
+ n = n.map(function(a) {
2391
+ return r(a);
2392
+ });
2393
+ var o = [];
2394
+ return this.forEach(function(a) {
2395
+ n.some(function(s) {
2396
+ return s.includes(a);
2397
+ }) && o.push(a);
2398
+ }), this.withMutations(function(a) {
2399
+ o.forEach(function(s) {
2400
+ a.remove(s);
2401
+ });
2402
+ });
2403
+ }, t.prototype.sort = function(n) {
2404
+ return ar(kt(this, n));
2405
+ }, t.prototype.sortBy = function(n, i) {
2406
+ return ar(kt(this, i, n));
2407
+ }, t.prototype.wasAltered = function() {
2408
+ return this._map.wasAltered();
2409
+ }, t.prototype.__iterate = function(n, i) {
2410
+ var o = this;
2411
+ return this._map.__iterate(function(a) {
2412
+ return n(a, a, o);
2413
+ }, i);
2414
+ }, t.prototype.__iterator = function(n, i) {
2415
+ return this._map.__iterator(n, i);
2416
+ }, t.prototype.__ensureOwner = function(n) {
2417
+ if (n === this.__ownerID)
2418
+ return this;
2419
+ var i = this._map.__ensureOwner(n);
2420
+ return n ? this.__make(i, n) : this.size === 0 ? this.__empty() : (this.__ownerID = n, this._map = i, this);
2421
+ }, t;
2422
+ })(Dt);
2423
+ ft.isSet = Wn;
2424
+ var k = ft.prototype;
2425
+ k[Ra] = !0;
2426
+ k[cr] = k.remove;
2427
+ k.merge = k.concat = k.union;
2428
+ k.withMutations = dr;
2429
+ k.asImmutable = pr;
2430
+ k["@@transducer/init"] = k.asMutable = _r;
2431
+ k["@@transducer/step"] = function(r, t) {
2432
+ return r.add(t);
2433
+ };
2434
+ k["@@transducer/result"] = function(r) {
2435
+ return r.asImmutable();
2436
+ };
2437
+ k.__empty = Vt;
2438
+ k.__make = Aa;
2439
+ function mr(r, t) {
2440
+ return r.__ownerID ? (r.size = t.size, r._map = t, r) : t === r._map ? r : t.size === 0 ? r.__empty() : r.__make(t);
2441
+ }
2442
+ function Aa(r, t) {
2443
+ var e = Object.create(k);
2444
+ return e.size = r ? r.size : 0, e._map = r, e.__ownerID = t, e;
2445
+ }
2446
+ var bi;
2447
+ function Vt() {
2448
+ return bi || (bi = Aa(st()));
2449
+ }
2450
+ function Ca(r, t, e) {
2451
+ for (var n = wa(t), i = 0; i !== n.length; )
2452
+ if (r = ba(r, n[i++], S), r === S)
2453
+ return e;
2454
+ return r;
2455
+ }
2456
+ function $a(r, t) {
2457
+ return Ca(this, r, t);
2458
+ }
2459
+ function Gs(r, t) {
2460
+ return Ca(r, t, S) !== S;
2461
+ }
2462
+ function Ws(r) {
2463
+ return Gs(this, r);
2464
+ }
2465
+ function Ba() {
2466
+ H(this.size);
2467
+ var r = {};
2468
+ return this.__iterate(function(t, e) {
2469
+ r[e] = t;
2470
+ }), r;
2471
+ }
2472
+ function Er(r) {
2473
+ if (!r || typeof r != "object")
2474
+ return r;
2475
+ if (!W(r)) {
2476
+ if (!mt(r))
2477
+ return r;
2478
+ r = D(r);
2479
+ }
2480
+ if (T(r)) {
2481
+ var t = {};
2482
+ return r.__iterate(function(n, i) {
2483
+ t[i] = Er(n);
2484
+ }), t;
2485
+ }
2486
+ var e = [];
2487
+ return r.__iterate(function(n) {
2488
+ e.push(Er(n));
2489
+ }), e;
2490
+ }
2491
+ function Ys(r) {
2492
+ if (r.size === 1 / 0)
2493
+ return 0;
2494
+ var t = ut(r), e = T(r), n = t ? 1 : 0;
2495
+ return r.__iterate(e ? t ? function(i, o) {
2496
+ n = 31 * n + Ii(F(i), F(o)) | 0;
2497
+ } : function(i, o) {
2498
+ n = n + Ii(F(i), F(o)) | 0;
2499
+ } : t ? function(i) {
2500
+ n = 31 * n + F(i) | 0;
2501
+ } : function(i) {
2502
+ n = n + F(i) | 0;
2503
+ }), Xs(r.size, n);
2504
+ }
2505
+ function Xs(r, t) {
2506
+ return t = Yt(t, 3432918353), t = Yt(t << 15 | t >>> -15, 461845907), t = Yt(t << 13 | t >>> -13, 5), t = (t + 3864292196 | 0) ^ r, t = Yt(t ^ t >>> 16, 2246822507), t = Yt(t ^ t >>> 13, 3266489909), t = Ar(t ^ t >>> 16), t;
2507
+ }
2508
+ function Ii(r, t) {
2509
+ return r ^ t + 2654435769 + (r << 6) + (r >> 2) | 0;
2510
+ }
2511
+ function Ot(r, t) {
2512
+ var e = function(n) {
2513
+ r.prototype[n] = t[n];
2514
+ };
2515
+ return Object.keys(t).forEach(e), Object.getOwnPropertySymbols && Object.getOwnPropertySymbols(t).forEach(e), r;
2516
+ }
2517
+ j.Iterator = w;
2518
+ Ot(j, {
2519
+ // ### Conversion to other types
2520
+ toArray: function() {
2521
+ H(this.size);
2522
+ var t = new Array(this.size || 0), e = T(this), n = 0;
2523
+ return this.__iterate(function(i, o) {
2524
+ t[n++] = e ? [o, i] : i;
2525
+ }), t;
2526
+ },
2527
+ toIndexedSeq: function() {
2528
+ return new na(this);
2529
+ },
2530
+ toJS: function() {
2531
+ return Er(this);
2532
+ },
2533
+ toKeyedSeq: function() {
2534
+ return new Cr(this, !0);
2535
+ },
2536
+ toMap: function() {
2537
+ return U(this.toKeyedSeq());
2538
+ },
2539
+ toObject: Ba,
2540
+ toOrderedMap: function() {
2541
+ return dt(this.toKeyedSeq());
2542
+ },
2543
+ toOrderedSet: function() {
2544
+ return ar(T(this) ? this.valueSeq() : this);
2545
+ },
2546
+ toSet: function() {
2547
+ return ft(T(this) ? this.valueSeq() : this);
2548
+ },
2549
+ toSetSeq: function() {
2550
+ return new ia(this);
2551
+ },
2552
+ toSeq: function() {
2553
+ return Z(this) ? this.toIndexedSeq() : T(this) ? this.toKeyedSeq() : this.toSetSeq();
2554
+ },
2555
+ toStack: function() {
2556
+ return Gn(T(this) ? this.valueSeq() : this);
2557
+ },
2558
+ toList: function() {
2559
+ return $r(T(this) ? this.valueSeq() : this);
2560
+ },
2561
+ // ### Common JavaScript methods and properties
2562
+ toString: function() {
2563
+ return "[Collection]";
2564
+ },
2565
+ __toString: function(t, e) {
2566
+ return this.size === 0 ? t + e : t + " " + this.toSeq().map(this.__toStringMapper).join(", ") + " " + e;
2567
+ },
2568
+ // ### ES6 Collection methods (ES6 Array and Map)
2569
+ concat: function() {
2570
+ for (var t = [], e = arguments.length; e--; ) t[e] = arguments[e];
2571
+ return q(this, ws(this, t));
2572
+ },
2573
+ includes: function(t) {
2574
+ return this.some(function(e) {
2575
+ return G(e, t);
2576
+ });
2577
+ },
2578
+ entries: function() {
2579
+ return this.__iterator(X);
2580
+ },
2581
+ every: function(t, e) {
2582
+ H(this.size);
2583
+ var n = !0;
2584
+ return this.__iterate(function(i, o, a) {
2585
+ if (!t.call(e, i, o, a))
2586
+ return n = !1, !1;
2587
+ }), n;
2588
+ },
2589
+ filter: function(t, e) {
2590
+ return q(this, ua(this, t, e, !0));
2591
+ },
2592
+ partition: function(t, e) {
2593
+ return gs(this, t, e);
2594
+ },
2595
+ find: function(t, e, n) {
2596
+ var i = this.findEntry(t, e);
2597
+ return i ? i[1] : n;
2598
+ },
2599
+ forEach: function(t, e) {
2600
+ return H(this.size), this.__iterate(e ? t.bind(e) : t);
2601
+ },
2602
+ join: function(t) {
2603
+ H(this.size), t = t !== void 0 ? "" + t : ",";
2604
+ var e = "", n = !0;
2605
+ return this.__iterate(function(i) {
2606
+ n ? n = !1 : e += t, e += i != null ? i.toString() : "";
2607
+ }), e;
2608
+ },
2609
+ keys: function() {
2610
+ return this.__iterator(Ft);
2611
+ },
2612
+ map: function(t, e) {
2613
+ return q(this, sa(this, t, e));
2614
+ },
2615
+ reduce: function(t, e, n) {
2616
+ return mi(
2617
+ this,
2618
+ t,
2619
+ e,
2620
+ n,
2621
+ arguments.length < 2,
2622
+ !1
2623
+ );
2624
+ },
2625
+ reduceRight: function(t, e, n) {
2626
+ return mi(
2627
+ this,
2628
+ t,
2629
+ e,
2630
+ n,
2631
+ arguments.length < 2,
2632
+ !0
2633
+ );
2634
+ },
2635
+ reverse: function() {
2636
+ return q(this, zn(this, !0));
2637
+ },
2638
+ slice: function(t, e) {
2639
+ return q(this, Tn(this, t, e, !0));
2640
+ },
2641
+ some: function(t, e) {
2642
+ H(this.size);
2643
+ var n = !1;
2644
+ return this.__iterate(function(i, o, a) {
2645
+ if (t.call(e, i, o, a))
2646
+ return n = !0, !1;
2647
+ }), n;
2648
+ },
2649
+ sort: function(t) {
2650
+ return q(this, kt(this, t));
2651
+ },
2652
+ values: function() {
2653
+ return this.__iterator(Y);
2654
+ },
2655
+ // ### More sequential methods
2656
+ butLast: function() {
2657
+ return this.slice(0, -1);
2658
+ },
2659
+ isEmpty: function() {
2660
+ return this.size !== void 0 ? this.size === 0 : !this.some(function() {
2661
+ return !0;
2662
+ });
2663
+ },
2664
+ count: function(t, e) {
2665
+ return $t(
2666
+ t ? this.toSeq().filter(t, e) : this
2667
+ );
2668
+ },
2669
+ countBy: function(t, e) {
2670
+ return vs(this, t, e);
2671
+ },
2672
+ equals: function(t) {
2673
+ return Ta(this, t);
2674
+ },
2675
+ entrySeq: function() {
2676
+ var t = this;
2677
+ if (t._cache)
2678
+ return new Bt(t._cache);
2679
+ var e = t.toSeq().map(Us).toIndexedSeq();
2680
+ return e.fromEntrySeq = function() {
2681
+ return t.toSeq();
2682
+ }, e;
2683
+ },
2684
+ filterNot: function(t, e) {
2685
+ return this.filter(Ur(t), e);
2686
+ },
2687
+ findEntry: function(t, e, n) {
2688
+ var i = n;
2689
+ return this.__iterate(function(o, a, s) {
2690
+ if (t.call(e, o, a, s))
2691
+ return i = [a, o], !1;
2692
+ }), i;
2693
+ },
2694
+ findKey: function(t, e) {
2695
+ var n = this.findEntry(t, e);
2696
+ return n && n[0];
2697
+ },
2698
+ findLast: function(t, e, n) {
2699
+ return this.toKeyedSeq().reverse().find(t, e, n);
2700
+ },
2701
+ findLastEntry: function(t, e, n) {
2702
+ return this.toKeyedSeq().reverse().findEntry(t, e, n);
2703
+ },
2704
+ findLastKey: function(t, e) {
2705
+ return this.toKeyedSeq().reverse().findKey(t, e);
2706
+ },
2707
+ first: function(t) {
2708
+ return this.find(Xo, null, t);
2709
+ },
2710
+ flatMap: function(t, e) {
2711
+ return q(this, bs(this, t, e));
2712
+ },
2713
+ flatten: function(t) {
2714
+ return q(this, ca(this, t, !0));
2715
+ },
2716
+ fromEntrySeq: function() {
2717
+ return new oa(this);
2718
+ },
2719
+ get: function(t, e) {
2720
+ return this.find(function(n, i) {
2721
+ return G(i, t);
2722
+ }, void 0, e);
2723
+ },
2724
+ getIn: $a,
2725
+ groupBy: function(t, e) {
2726
+ return ys(this, t, e);
2727
+ },
2728
+ has: function(t) {
2729
+ return this.get(t, S) !== S;
2730
+ },
2731
+ hasIn: Ws,
2732
+ isSubset: function(t) {
2733
+ return t = typeof t.includes == "function" ? t : j(t), this.every(function(e) {
2734
+ return t.includes(e);
2735
+ });
2736
+ },
2737
+ isSuperset: function(t) {
2738
+ return t = typeof t.isSubset == "function" ? t : j(t), t.isSubset(this);
2739
+ },
2740
+ keyOf: function(t) {
2741
+ return this.findKey(function(e) {
2742
+ return G(e, t);
2743
+ });
2744
+ },
2745
+ keySeq: function() {
2746
+ return this.toSeq().map(Hs).toIndexedSeq();
2747
+ },
2748
+ last: function(t) {
2749
+ return this.toSeq().reverse().first(t);
2750
+ },
2751
+ lastKeyOf: function(t) {
2752
+ return this.toKeyedSeq().reverse().keyOf(t);
2753
+ },
2754
+ max: function(t) {
2755
+ return vr(this, t);
2756
+ },
2757
+ maxBy: function(t, e) {
2758
+ return vr(this, e, t);
2759
+ },
2760
+ min: function(t) {
2761
+ return vr(
2762
+ this,
2763
+ t ? Si(t) : wi
2764
+ );
2765
+ },
2766
+ minBy: function(t, e) {
2767
+ return vr(
2768
+ this,
2769
+ e ? Si(e) : wi,
2770
+ t
2771
+ );
2772
+ },
2773
+ rest: function() {
2774
+ return this.slice(1);
2775
+ },
2776
+ skip: function(t) {
2777
+ return t === 0 ? this : this.slice(Math.max(0, t));
2778
+ },
2779
+ skipLast: function(t) {
2780
+ return t === 0 ? this : this.slice(0, -Math.max(0, t));
2781
+ },
2782
+ skipWhile: function(t, e) {
2783
+ return q(this, fa(this, t, e, !0));
2784
+ },
2785
+ skipUntil: function(t, e) {
2786
+ return this.skipWhile(Ur(t), e);
2787
+ },
2788
+ sortBy: function(t, e) {
2789
+ return q(this, kt(this, e, t));
2790
+ },
2791
+ take: function(t) {
2792
+ return this.slice(0, Math.max(0, t));
2793
+ },
2794
+ takeLast: function(t) {
2795
+ return this.slice(-Math.max(0, t));
2796
+ },
2797
+ takeWhile: function(t, e) {
2798
+ return q(this, ms(this, t, e));
2799
+ },
2800
+ takeUntil: function(t, e) {
2801
+ return this.takeWhile(Ur(t), e);
2802
+ },
2803
+ update: function(t) {
2804
+ return t(this);
2805
+ },
2806
+ valueSeq: function() {
2807
+ return this.toIndexedSeq();
2808
+ },
2809
+ // ### Hashable Object
2810
+ hashCode: function() {
2811
+ return this.__hash || (this.__hash = Ys(this));
2812
+ }
2813
+ // ### Internal
2814
+ // abstract __iterate(fn, reverse)
2815
+ // abstract __iterator(type, reverse)
2816
+ });
2817
+ var L = j.prototype;
2818
+ L[Go] = !0;
2819
+ L[Or] = L.values;
2820
+ L.toJSON = L.toArray;
2821
+ L.__toStringMapper = nr;
2822
+ L.inspect = L.toSource = function() {
2823
+ return this.toString();
2824
+ };
2825
+ L.chain = L.flatMap;
2826
+ L.contains = L.includes;
2827
+ Ot(Q, {
2828
+ // ### More sequential methods
2829
+ flip: function() {
2830
+ return q(this, aa(this));
2831
+ },
2832
+ mapEntries: function(t, e) {
2833
+ var n = this, i = 0;
2834
+ return q(
2835
+ this,
2836
+ this.toSeq().map(function(o, a) {
2837
+ return t.call(e, [a, o], i++, n);
2838
+ }).fromEntrySeq()
2839
+ );
2840
+ },
2841
+ mapKeys: function(t, e) {
2842
+ var n = this;
2843
+ return q(
2844
+ this,
2845
+ this.toSeq().flip().map(function(i, o) {
2846
+ return t.call(e, i, o, n);
2847
+ }).flip()
2848
+ );
2849
+ }
2850
+ });
2851
+ var lr = Q.prototype;
2852
+ lr[qr] = !0;
2853
+ lr[Or] = L.entries;
2854
+ lr.toJSON = Ba;
2855
+ lr.__toStringMapper = function(r, t) {
2856
+ return nr(t) + ": " + nr(r);
2857
+ };
2858
+ Ot(Mt, {
2859
+ // ### Conversion to other types
2860
+ toKeyedSeq: function() {
2861
+ return new Cr(this, !1);
2862
+ },
2863
+ // ### ES6 Collection methods (ES6 Array and Map)
2864
+ filter: function(t, e) {
2865
+ return q(this, ua(this, t, e, !1));
2866
+ },
2867
+ findIndex: function(t, e) {
2868
+ var n = this.findEntry(t, e);
2869
+ return n ? n[0] : -1;
2870
+ },
2871
+ indexOf: function(t) {
2872
+ var e = this.keyOf(t);
2873
+ return e === void 0 ? -1 : e;
2874
+ },
2875
+ lastIndexOf: function(t) {
2876
+ var e = this.lastKeyOf(t);
2877
+ return e === void 0 ? -1 : e;
2878
+ },
2879
+ reverse: function() {
2880
+ return q(this, zn(this, !1));
2881
+ },
2882
+ slice: function(t, e) {
2883
+ return q(this, Tn(this, t, e, !1));
2884
+ },
2885
+ splice: function(t, e) {
2886
+ var n = arguments.length;
2887
+ if (e = Math.max(e || 0, 0), n === 0 || n === 2 && !e)
2888
+ return this;
2889
+ t = hr(t, t < 0 ? this.count() : this.size);
2890
+ var i = this.slice(0, t);
2891
+ return q(
2892
+ this,
2893
+ n === 1 ? i : i.concat(ot(arguments, 2), this.slice(t + e))
2894
+ );
2895
+ },
2896
+ // ### More collection methods
2897
+ findLastIndex: function(t, e) {
2898
+ var n = this.findLastEntry(t, e);
2899
+ return n ? n[0] : -1;
2900
+ },
2901
+ first: function(t) {
2902
+ return this.get(0, t);
2903
+ },
2904
+ flatten: function(t) {
2905
+ return q(this, ca(this, t, !1));
2906
+ },
2907
+ get: function(t, e) {
2908
+ return t = yt(this, t), t < 0 || this.size === 1 / 0 || this.size !== void 0 && t > this.size ? e : this.find(function(n, i) {
2909
+ return i === t;
2910
+ }, void 0, e);
2911
+ },
2912
+ has: function(t) {
2913
+ return t = yt(this, t), t >= 0 && (this.size !== void 0 ? this.size === 1 / 0 || t < this.size : this.indexOf(t) !== -1);
2914
+ },
2915
+ interpose: function(t) {
2916
+ return q(this, Is(this, t));
2917
+ },
2918
+ interleave: function() {
2919
+ var t = [this].concat(ot(arguments)), e = yr(this.toSeq(), et.of, t), n = e.flatten(!0);
2920
+ return e.size && (n.size = e.size * t.length), q(this, n);
2921
+ },
2922
+ keySeq: function() {
2923
+ return Ks(0, this.size);
2924
+ },
2925
+ last: function(t) {
2926
+ return this.get(-1, t);
2927
+ },
2928
+ skipWhile: function(t, e) {
2929
+ return q(this, fa(this, t, e, !1));
2930
+ },
2931
+ zip: function() {
2932
+ var t = [this].concat(ot(arguments));
2933
+ return q(this, yr(this, qi, t));
2934
+ },
2935
+ zipAll: function() {
2936
+ var t = [this].concat(ot(arguments));
2937
+ return q(this, yr(this, qi, t, !0));
2938
+ },
2939
+ zipWith: function(t) {
2940
+ var e = ot(arguments);
2941
+ return e[0] = this, q(this, yr(this, t, e));
2942
+ }
2943
+ });
2944
+ var Gt = Mt.prototype;
2945
+ Gt[Ir] = !0;
2946
+ Gt[gt] = !0;
2947
+ Ot(Dt, {
2948
+ // ### ES6 Collection methods (ES6 Array and Map)
2949
+ get: function(t, e) {
2950
+ return this.has(t) ? t : e;
2951
+ },
2952
+ includes: function(t) {
2953
+ return this.has(t);
2954
+ },
2955
+ // ### More sequential methods
2956
+ keySeq: function() {
2957
+ return this.valueSeq();
2958
+ }
2959
+ });
2960
+ var xt = Dt.prototype;
2961
+ xt.has = L.includes;
2962
+ xt.contains = xt.includes;
2963
+ xt.keys = xt.values;
2964
+ Ot(St, lr);
2965
+ Ot(et, Gt);
2966
+ Ot(Ut, xt);
2967
+ function qi() {
2968
+ return ot(arguments);
2969
+ }
2970
+ function ka(r) {
2971
+ return Wn(r) && ut(r);
2972
+ }
2973
+ var ar = /* @__PURE__ */ (function(r) {
2974
+ function t(e) {
2975
+ return e == null ? mn() : ka(e) ? e : mn().withMutations(function(n) {
2976
+ var i = Dt(e);
2977
+ H(i.size), i.forEach(function(o) {
2978
+ return n.add(o);
2979
+ });
2980
+ });
2981
+ }
2982
+ return r && (t.__proto__ = r), t.prototype = Object.create(r && r.prototype), t.prototype.constructor = t, t.of = function() {
2983
+ return this(arguments);
2984
+ }, t.fromKeys = function(n) {
2985
+ return this(Q(n).keySeq());
2986
+ }, t.prototype.toString = function() {
2987
+ return this.__toString("OrderedSet {", "}");
2988
+ }, t;
2989
+ })(ft);
2990
+ ar.isOrderedSet = ka;
2991
+ var zt = ar.prototype;
2992
+ zt[gt] = !0;
2993
+ zt.zip = Gt.zip;
2994
+ zt.zipWith = Gt.zipWith;
2995
+ zt.zipAll = Gt.zipAll;
2996
+ zt.__empty = mn;
2997
+ zt.__make = ja;
2998
+ function ja(r, t) {
2999
+ var e = Object.create(zt);
3000
+ return e.size = r ? r.size : 0, e._map = r, e.__ownerID = t, e;
3001
+ }
3002
+ var Mi;
3003
+ function mn() {
3004
+ return Mi || (Mi = ja(Xt()));
3005
+ }
3006
+ function Js(r) {
3007
+ if (Et(r))
3008
+ throw new Error(
3009
+ "Can not call `Record` with an immutable Record as default values. Use a plain javascript object instead."
3010
+ );
3011
+ if (ct(r))
3012
+ throw new Error(
3013
+ "Can not call `Record` with an immutable Collection as default values. Use a plain javascript object instead."
3014
+ );
3015
+ if (r === null || typeof r != "object")
3016
+ throw new Error(
3017
+ "Can not call `Record` with a non-object as default values. Use a plain javascript object instead."
3018
+ );
3019
+ }
3020
+ var A = function(t, e) {
3021
+ var n;
3022
+ Js(t);
3023
+ var i = function(s) {
3024
+ var u = this;
3025
+ if (s instanceof i)
3026
+ return s;
3027
+ if (!(this instanceof i))
3028
+ return new i(s);
3029
+ if (!n) {
3030
+ n = !0;
3031
+ var f = Object.keys(t), c = o._indices = {};
3032
+ o._name = e, o._keys = f, o._defaultValues = t;
3033
+ for (var h = 0; h < f.length; h++) {
3034
+ var p = f[h];
3035
+ c[p] = h, o[p] ? typeof console == "object" && console.warn && console.warn(
3036
+ "Cannot define " + Xn(this) + ' with property "' + p + '" since that property name is part of the Record API.'
3037
+ ) : Vs(o, p);
3038
+ }
3039
+ }
3040
+ return this.__ownerID = void 0, this._values = $r().withMutations(function(_) {
3041
+ _.setSize(u._keys.length), Q(s).forEach(function(d, v) {
3042
+ _.set(u._indices[v], d === u._defaultValues[v] ? void 0 : d);
3043
+ });
3044
+ }), this;
3045
+ }, o = i.prototype = Object.create(O);
3046
+ return o.constructor = i, e && (i.displayName = e), i;
3047
+ };
3048
+ A.prototype.toString = function() {
3049
+ for (var t = Xn(this) + " { ", e = this._keys, n, i = 0, o = e.length; i !== o; i++)
3050
+ n = e[i], t += (i ? ", " : "") + n + ": " + nr(this.get(n));
3051
+ return t + " }";
3052
+ };
3053
+ A.prototype.equals = function(t) {
3054
+ return this === t || Et(t) && Nt(this).equals(Nt(t));
3055
+ };
3056
+ A.prototype.hashCode = function() {
3057
+ return Nt(this).hashCode();
3058
+ };
3059
+ A.prototype.has = function(t) {
3060
+ return this._indices.hasOwnProperty(t);
3061
+ };
3062
+ A.prototype.get = function(t, e) {
3063
+ if (!this.has(t))
3064
+ return e;
3065
+ var n = this._indices[t], i = this._values.get(n);
3066
+ return i === void 0 ? this._defaultValues[t] : i;
3067
+ };
3068
+ A.prototype.set = function(t, e) {
3069
+ if (this.has(t)) {
3070
+ var n = this._values.set(
3071
+ this._indices[t],
3072
+ e === this._defaultValues[t] ? void 0 : e
3073
+ );
3074
+ if (n !== this._values && !this.__ownerID)
3075
+ return Yn(this, n);
3076
+ }
3077
+ return this;
3078
+ };
3079
+ A.prototype.remove = function(t) {
3080
+ return this.set(t);
3081
+ };
3082
+ A.prototype.clear = function() {
3083
+ var t = this._values.clear().setSize(this._keys.length);
3084
+ return this.__ownerID ? this : Yn(this, t);
3085
+ };
3086
+ A.prototype.wasAltered = function() {
3087
+ return this._values.wasAltered();
3088
+ };
3089
+ A.prototype.toSeq = function() {
3090
+ return Nt(this);
3091
+ };
3092
+ A.prototype.toJS = function() {
3093
+ return Er(this);
3094
+ };
3095
+ A.prototype.entries = function() {
3096
+ return this.__iterator(X);
3097
+ };
3098
+ A.prototype.__iterator = function(t, e) {
3099
+ return Nt(this).__iterator(t, e);
3100
+ };
3101
+ A.prototype.__iterate = function(t, e) {
3102
+ return Nt(this).__iterate(t, e);
3103
+ };
3104
+ A.prototype.__ensureOwner = function(t) {
3105
+ if (t === this.__ownerID)
3106
+ return this;
3107
+ var e = this._values.__ensureOwner(t);
3108
+ return t ? Yn(this, e, t) : (this.__ownerID = t, this._values = e, this);
3109
+ };
3110
+ A.isRecord = Et;
3111
+ A.getDescriptiveName = Xn;
3112
+ var O = A.prototype;
3113
+ O[Zo] = !0;
3114
+ O[cr] = O.remove;
3115
+ O.deleteIn = O.removeIn = Un;
3116
+ O.getIn = $a;
3117
+ O.hasIn = L.hasIn;
3118
+ O.merge = _a;
3119
+ O.mergeWith = da;
3120
+ O.mergeIn = kn;
3121
+ O.mergeDeep = va;
3122
+ O.mergeDeepWith = ya;
3123
+ O.mergeDeepIn = Bn;
3124
+ O.setIn = jn;
3125
+ O.update = Ln;
3126
+ O.updateIn = Pn;
3127
+ O.withMutations = dr;
3128
+ O.asMutable = _r;
3129
+ O.asImmutable = pr;
3130
+ O[Or] = O.entries;
3131
+ O.toJSON = O.toObject = L.toObject;
3132
+ O.inspect = O.toSource = function() {
3133
+ return this.toString();
3134
+ };
3135
+ function Yn(r, t, e) {
3136
+ var n = Object.create(Object.getPrototypeOf(r));
3137
+ return n._values = t, n.__ownerID = e, n;
3138
+ }
3139
+ function Xn(r) {
3140
+ return r.constructor.displayName || r.constructor.name || "Record";
3141
+ }
3142
+ function Nt(r) {
3143
+ return En(r._keys.map(function(t) {
3144
+ return [t, r.get(t)];
3145
+ }));
3146
+ }
3147
+ function Vs(r, t) {
3148
+ try {
3149
+ Object.defineProperty(r, t, {
3150
+ get: function() {
3151
+ return this.get(t);
3152
+ },
3153
+ set: function(e) {
3154
+ Zt(this.__ownerID, "Cannot set on an immutable record."), this.set(t, e);
3155
+ }
3156
+ });
3157
+ } catch {
3158
+ }
3159
+ }
3160
+ var Sr = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
3161
+ function Zs(r) {
3162
+ return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
3163
+ }
3164
+ var Gr, Ei;
3165
+ function La() {
3166
+ if (Ei) return Gr;
3167
+ Ei = 1;
3168
+ function r(t, e) {
3169
+ for (var n = -1, i = e.length, o = t.length; ++n < i; )
3170
+ t[o + n] = e[n];
3171
+ return t;
3172
+ }
3173
+ return Gr = r, Gr;
3174
+ }
3175
+ var Wr, Oi;
3176
+ function Qs() {
3177
+ if (Oi) return Wr;
3178
+ Oi = 1;
3179
+ var r = typeof Sr == "object" && Sr && Sr.Object === Object && Sr;
3180
+ return Wr = r, Wr;
3181
+ }
3182
+ var Yr, zi;
3183
+ function Jn() {
3184
+ if (zi) return Yr;
3185
+ zi = 1;
3186
+ var r = Qs(), t = typeof self == "object" && self && self.Object === Object && self, e = r || t || Function("return this")();
3187
+ return Yr = e, Yr;
3188
+ }
3189
+ var Xr, Ti;
3190
+ function Br() {
3191
+ if (Ti) return Xr;
3192
+ Ti = 1;
3193
+ var r = Jn(), t = r.Symbol;
3194
+ return Xr = t, Xr;
3195
+ }
3196
+ var Jr, Ri;
3197
+ function tu() {
3198
+ if (Ri) return Jr;
3199
+ Ri = 1;
3200
+ var r = Br(), t = Object.prototype, e = t.hasOwnProperty, n = t.toString, i = r ? r.toStringTag : void 0;
3201
+ function o(a) {
3202
+ var s = e.call(a, i), u = a[i];
3203
+ try {
3204
+ a[i] = void 0;
3205
+ var f = !0;
3206
+ } catch {
3207
+ }
3208
+ var c = n.call(a);
3209
+ return f && (s ? a[i] = u : delete a[i]), c;
3210
+ }
3211
+ return Jr = o, Jr;
3212
+ }
3213
+ var Vr, Ai;
3214
+ function ru() {
3215
+ if (Ai) return Vr;
3216
+ Ai = 1;
3217
+ var r = Object.prototype, t = r.toString;
3218
+ function e(n) {
3219
+ return t.call(n);
3220
+ }
3221
+ return Vr = e, Vr;
3222
+ }
3223
+ var Zr, Ci;
3224
+ function Vn() {
3225
+ if (Ci) return Zr;
3226
+ Ci = 1;
3227
+ var r = Br(), t = tu(), e = ru(), n = "[object Null]", i = "[object Undefined]", o = r ? r.toStringTag : void 0;
3228
+ function a(s) {
3229
+ return s == null ? s === void 0 ? i : n : o && o in Object(s) ? t(s) : e(s);
3230
+ }
3231
+ return Zr = a, Zr;
3232
+ }
3233
+ var Qr, $i;
3234
+ function Zn() {
3235
+ if ($i) return Qr;
3236
+ $i = 1;
3237
+ function r(t) {
3238
+ return t != null && typeof t == "object";
3239
+ }
3240
+ return Qr = r, Qr;
3241
+ }
3242
+ var te, Bi;
3243
+ function eu() {
3244
+ if (Bi) return te;
3245
+ Bi = 1;
3246
+ var r = Vn(), t = Zn(), e = "[object Arguments]";
3247
+ function n(i) {
3248
+ return t(i) && r(i) == e;
3249
+ }
3250
+ return te = n, te;
3251
+ }
3252
+ var re, ki;
3253
+ function Pa() {
3254
+ if (ki) return re;
3255
+ ki = 1;
3256
+ var r = eu(), t = Zn(), e = Object.prototype, n = e.hasOwnProperty, i = e.propertyIsEnumerable, o = r(/* @__PURE__ */ (function() {
3257
+ return arguments;
3258
+ })()) ? r : function(a) {
3259
+ return t(a) && n.call(a, "callee") && !i.call(a, "callee");
3260
+ };
3261
+ return re = o, re;
3262
+ }
3263
+ var ee, ji;
3264
+ function Wt() {
3265
+ if (ji) return ee;
3266
+ ji = 1;
3267
+ var r = Array.isArray;
3268
+ return ee = r, ee;
3269
+ }
3270
+ var ne, Li;
3271
+ function nu() {
3272
+ if (Li) return ne;
3273
+ Li = 1;
3274
+ var r = Br(), t = Pa(), e = Wt(), n = r ? r.isConcatSpreadable : void 0;
3275
+ function i(o) {
3276
+ return e(o) || t(o) || !!(n && o && o[n]);
3277
+ }
3278
+ return ne = i, ne;
3279
+ }
3280
+ var ie, Pi;
3281
+ function iu() {
3282
+ if (Pi) return ie;
3283
+ Pi = 1;
3284
+ var r = La(), t = nu();
3285
+ function e(n, i, o, a, s) {
3286
+ var u = -1, f = n.length;
3287
+ for (o || (o = t), s || (s = []); ++u < f; ) {
3288
+ var c = n[u];
3289
+ i > 0 && o(c) ? i > 1 ? e(c, i - 1, o, a, s) : r(s, c) : a || (s[s.length] = c);
3290
+ }
3291
+ return s;
3292
+ }
3293
+ return ie = e, ie;
3294
+ }
3295
+ var oe, xi;
3296
+ function ou() {
3297
+ if (xi) return oe;
3298
+ xi = 1;
3299
+ function r(t, e) {
3300
+ var n = -1, i = t.length;
3301
+ for (e || (e = Array(i)); ++n < i; )
3302
+ e[n] = t[n];
3303
+ return e;
3304
+ }
3305
+ return oe = r, oe;
3306
+ }
3307
+ var ae, Ni;
3308
+ function au() {
3309
+ if (Ni) return ae;
3310
+ Ni = 1;
3311
+ var r = La(), t = iu(), e = ou(), n = Wt();
3312
+ function i() {
3313
+ var o = arguments.length;
3314
+ if (!o)
3315
+ return [];
3316
+ for (var a = Array(o - 1), s = arguments[0], u = o; u--; )
3317
+ a[u - 1] = arguments[u];
3318
+ return r(n(s) ? e(s) : [s], t(a, 1));
3319
+ }
3320
+ return ae = i, ae;
3321
+ }
3322
+ au();
3323
+ var se, Di;
3324
+ function su() {
3325
+ if (Di) return se;
3326
+ Di = 1;
3327
+ function r(t, e) {
3328
+ return t != null && e in Object(t);
3329
+ }
3330
+ return se = r, se;
3331
+ }
3332
+ var ue, Fi;
3333
+ function kr() {
3334
+ if (Fi) return ue;
3335
+ Fi = 1;
3336
+ var r = Vn(), t = Zn(), e = "[object Symbol]";
3337
+ function n(i) {
3338
+ return typeof i == "symbol" || t(i) && r(i) == e;
3339
+ }
3340
+ return ue = n, ue;
3341
+ }
3342
+ var fe, Hi;
3343
+ function uu() {
3344
+ if (Hi) return fe;
3345
+ Hi = 1;
3346
+ var r = Wt(), t = kr(), e = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, n = /^\w*$/;
3347
+ function i(o, a) {
3348
+ if (r(o))
3349
+ return !1;
3350
+ var s = typeof o;
3351
+ return s == "number" || s == "symbol" || s == "boolean" || o == null || t(o) ? !0 : n.test(o) || !e.test(o) || a != null && o in Object(a);
3352
+ }
3353
+ return fe = i, fe;
3354
+ }
3355
+ var ce, Ui;
3356
+ function Qn() {
3357
+ if (Ui) return ce;
3358
+ Ui = 1;
3359
+ function r(t) {
3360
+ var e = typeof t;
3361
+ return t != null && (e == "object" || e == "function");
3362
+ }
3363
+ return ce = r, ce;
3364
+ }
3365
+ var he, Ki;
3366
+ function fu() {
3367
+ if (Ki) return he;
3368
+ Ki = 1;
3369
+ var r = Vn(), t = Qn(), e = "[object AsyncFunction]", n = "[object Function]", i = "[object GeneratorFunction]", o = "[object Proxy]";
3370
+ function a(s) {
3371
+ if (!t(s))
3372
+ return !1;
3373
+ var u = r(s);
3374
+ return u == n || u == i || u == e || u == o;
3375
+ }
3376
+ return he = a, he;
3377
+ }
3378
+ var pe, Gi;
3379
+ function cu() {
3380
+ if (Gi) return pe;
3381
+ Gi = 1;
3382
+ var r = Jn(), t = r["__core-js_shared__"];
3383
+ return pe = t, pe;
3384
+ }
3385
+ var _e, Wi;
3386
+ function hu() {
3387
+ if (Wi) return _e;
3388
+ Wi = 1;
3389
+ var r = cu(), t = (function() {
3390
+ var n = /[^.]+$/.exec(r && r.keys && r.keys.IE_PROTO || "");
3391
+ return n ? "Symbol(src)_1." + n : "";
3392
+ })();
3393
+ function e(n) {
3394
+ return !!t && t in n;
3395
+ }
3396
+ return _e = e, _e;
3397
+ }
3398
+ var de, Yi;
3399
+ function pu() {
3400
+ if (Yi) return de;
3401
+ Yi = 1;
3402
+ var r = Function.prototype, t = r.toString;
3403
+ function e(n) {
3404
+ if (n != null) {
3405
+ try {
3406
+ return t.call(n);
3407
+ } catch {
3408
+ }
3409
+ try {
3410
+ return n + "";
3411
+ } catch {
3412
+ }
3413
+ }
3414
+ return "";
3415
+ }
3416
+ return de = e, de;
3417
+ }
3418
+ var le, Xi;
3419
+ function _u() {
3420
+ if (Xi) return le;
3421
+ Xi = 1;
3422
+ var r = fu(), t = hu(), e = Qn(), n = pu(), i = /[\\^$.*+?()[\]{}|]/g, o = /^\[object .+?Constructor\]$/, a = Function.prototype, s = Object.prototype, u = a.toString, f = s.hasOwnProperty, c = RegExp(
3423
+ "^" + u.call(f).replace(i, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
3424
+ );
3425
+ function h(p) {
3426
+ if (!e(p) || t(p))
3427
+ return !1;
3428
+ var _ = r(p) ? c : o;
3429
+ return _.test(n(p));
3430
+ }
3431
+ return le = h, le;
3432
+ }
3433
+ var ve, Ji;
3434
+ function du() {
3435
+ if (Ji) return ve;
3436
+ Ji = 1;
3437
+ function r(t, e) {
3438
+ return t?.[e];
3439
+ }
3440
+ return ve = r, ve;
3441
+ }
3442
+ var ye, Vi;
3443
+ function xa() {
3444
+ if (Vi) return ye;
3445
+ Vi = 1;
3446
+ var r = _u(), t = du();
3447
+ function e(n, i) {
3448
+ var o = t(n, i);
3449
+ return r(o) ? o : void 0;
3450
+ }
3451
+ return ye = e, ye;
3452
+ }
3453
+ var ge, Zi;
3454
+ function jr() {
3455
+ if (Zi) return ge;
3456
+ Zi = 1;
3457
+ var r = xa(), t = r(Object, "create");
3458
+ return ge = t, ge;
3459
+ }
3460
+ var me, Qi;
3461
+ function lu() {
3462
+ if (Qi) return me;
3463
+ Qi = 1;
3464
+ var r = jr();
3465
+ function t() {
3466
+ this.__data__ = r ? r(null) : {}, this.size = 0;
3467
+ }
3468
+ return me = t, me;
3469
+ }
3470
+ var Se, to;
3471
+ function vu() {
3472
+ if (to) return Se;
3473
+ to = 1;
3474
+ function r(t) {
3475
+ var e = this.has(t) && delete this.__data__[t];
3476
+ return this.size -= e ? 1 : 0, e;
3477
+ }
3478
+ return Se = r, Se;
3479
+ }
3480
+ var we, ro;
3481
+ function yu() {
3482
+ if (ro) return we;
3483
+ ro = 1;
3484
+ var r = jr(), t = "__lodash_hash_undefined__", e = Object.prototype, n = e.hasOwnProperty;
3485
+ function i(o) {
3486
+ var a = this.__data__;
3487
+ if (r) {
3488
+ var s = a[o];
3489
+ return s === t ? void 0 : s;
3490
+ }
3491
+ return n.call(a, o) ? a[o] : void 0;
3492
+ }
3493
+ return we = i, we;
3494
+ }
3495
+ var be, eo;
3496
+ function gu() {
3497
+ if (eo) return be;
3498
+ eo = 1;
3499
+ var r = jr(), t = Object.prototype, e = t.hasOwnProperty;
3500
+ function n(i) {
3501
+ var o = this.__data__;
3502
+ return r ? o[i] !== void 0 : e.call(o, i);
3503
+ }
3504
+ return be = n, be;
3505
+ }
3506
+ var Ie, no;
3507
+ function mu() {
3508
+ if (no) return Ie;
3509
+ no = 1;
3510
+ var r = jr(), t = "__lodash_hash_undefined__";
3511
+ function e(n, i) {
3512
+ var o = this.__data__;
3513
+ return this.size += this.has(n) ? 0 : 1, o[n] = r && i === void 0 ? t : i, this;
3514
+ }
3515
+ return Ie = e, Ie;
3516
+ }
3517
+ var qe, io;
3518
+ function Su() {
3519
+ if (io) return qe;
3520
+ io = 1;
3521
+ var r = lu(), t = vu(), e = yu(), n = gu(), i = mu();
3522
+ function o(a) {
3523
+ var s = -1, u = a == null ? 0 : a.length;
3524
+ for (this.clear(); ++s < u; ) {
3525
+ var f = a[s];
3526
+ this.set(f[0], f[1]);
3527
+ }
3528
+ }
3529
+ return o.prototype.clear = r, o.prototype.delete = t, o.prototype.get = e, o.prototype.has = n, o.prototype.set = i, qe = o, qe;
3530
+ }
3531
+ var Me, oo;
3532
+ function wu() {
3533
+ if (oo) return Me;
3534
+ oo = 1;
3535
+ function r() {
3536
+ this.__data__ = [], this.size = 0;
3537
+ }
3538
+ return Me = r, Me;
3539
+ }
3540
+ var Ee, ao;
3541
+ function bu() {
3542
+ if (ao) return Ee;
3543
+ ao = 1;
3544
+ function r(t, e) {
3545
+ return t === e || t !== t && e !== e;
3546
+ }
3547
+ return Ee = r, Ee;
3548
+ }
3549
+ var Oe, so;
3550
+ function Lr() {
3551
+ if (so) return Oe;
3552
+ so = 1;
3553
+ var r = bu();
3554
+ function t(e, n) {
3555
+ for (var i = e.length; i--; )
3556
+ if (r(e[i][0], n))
3557
+ return i;
3558
+ return -1;
3559
+ }
3560
+ return Oe = t, Oe;
3561
+ }
3562
+ var ze, uo;
3563
+ function Iu() {
3564
+ if (uo) return ze;
3565
+ uo = 1;
3566
+ var r = Lr(), t = Array.prototype, e = t.splice;
3567
+ function n(i) {
3568
+ var o = this.__data__, a = r(o, i);
3569
+ if (a < 0)
3570
+ return !1;
3571
+ var s = o.length - 1;
3572
+ return a == s ? o.pop() : e.call(o, a, 1), --this.size, !0;
3573
+ }
3574
+ return ze = n, ze;
3575
+ }
3576
+ var Te, fo;
3577
+ function qu() {
3578
+ if (fo) return Te;
3579
+ fo = 1;
3580
+ var r = Lr();
3581
+ function t(e) {
3582
+ var n = this.__data__, i = r(n, e);
3583
+ return i < 0 ? void 0 : n[i][1];
3584
+ }
3585
+ return Te = t, Te;
3586
+ }
3587
+ var Re, co;
3588
+ function Mu() {
3589
+ if (co) return Re;
3590
+ co = 1;
3591
+ var r = Lr();
3592
+ function t(e) {
3593
+ return r(this.__data__, e) > -1;
3594
+ }
3595
+ return Re = t, Re;
3596
+ }
3597
+ var Ae, ho;
3598
+ function Eu() {
3599
+ if (ho) return Ae;
3600
+ ho = 1;
3601
+ var r = Lr();
3602
+ function t(e, n) {
3603
+ var i = this.__data__, o = r(i, e);
3604
+ return o < 0 ? (++this.size, i.push([e, n])) : i[o][1] = n, this;
3605
+ }
3606
+ return Ae = t, Ae;
3607
+ }
3608
+ var Ce, po;
3609
+ function Ou() {
3610
+ if (po) return Ce;
3611
+ po = 1;
3612
+ var r = wu(), t = Iu(), e = qu(), n = Mu(), i = Eu();
3613
+ function o(a) {
3614
+ var s = -1, u = a == null ? 0 : a.length;
3615
+ for (this.clear(); ++s < u; ) {
3616
+ var f = a[s];
3617
+ this.set(f[0], f[1]);
3618
+ }
3619
+ }
3620
+ return o.prototype.clear = r, o.prototype.delete = t, o.prototype.get = e, o.prototype.has = n, o.prototype.set = i, Ce = o, Ce;
3621
+ }
3622
+ var $e, _o;
3623
+ function zu() {
3624
+ if (_o) return $e;
3625
+ _o = 1;
3626
+ var r = xa(), t = Jn(), e = r(t, "Map");
3627
+ return $e = e, $e;
3628
+ }
3629
+ var Be, lo;
3630
+ function Tu() {
3631
+ if (lo) return Be;
3632
+ lo = 1;
3633
+ var r = Su(), t = Ou(), e = zu();
3634
+ function n() {
3635
+ this.size = 0, this.__data__ = {
3636
+ hash: new r(),
3637
+ map: new (e || t)(),
3638
+ string: new r()
3639
+ };
3640
+ }
3641
+ return Be = n, Be;
3642
+ }
3643
+ var ke, vo;
3644
+ function Ru() {
3645
+ if (vo) return ke;
3646
+ vo = 1;
3647
+ function r(t) {
3648
+ var e = typeof t;
3649
+ return e == "string" || e == "number" || e == "symbol" || e == "boolean" ? t !== "__proto__" : t === null;
3650
+ }
3651
+ return ke = r, ke;
3652
+ }
3653
+ var je, yo;
3654
+ function Pr() {
3655
+ if (yo) return je;
3656
+ yo = 1;
3657
+ var r = Ru();
3658
+ function t(e, n) {
3659
+ var i = e.__data__;
3660
+ return r(n) ? i[typeof n == "string" ? "string" : "hash"] : i.map;
3661
+ }
3662
+ return je = t, je;
3663
+ }
3664
+ var Le, go;
3665
+ function Au() {
3666
+ if (go) return Le;
3667
+ go = 1;
3668
+ var r = Pr();
3669
+ function t(e) {
3670
+ var n = r(this, e).delete(e);
3671
+ return this.size -= n ? 1 : 0, n;
3672
+ }
3673
+ return Le = t, Le;
3674
+ }
3675
+ var Pe, mo;
3676
+ function Cu() {
3677
+ if (mo) return Pe;
3678
+ mo = 1;
3679
+ var r = Pr();
3680
+ function t(e) {
3681
+ return r(this, e).get(e);
3682
+ }
3683
+ return Pe = t, Pe;
3684
+ }
3685
+ var xe, So;
3686
+ function $u() {
3687
+ if (So) return xe;
3688
+ So = 1;
3689
+ var r = Pr();
3690
+ function t(e) {
3691
+ return r(this, e).has(e);
3692
+ }
3693
+ return xe = t, xe;
3694
+ }
3695
+ var Ne, wo;
3696
+ function Bu() {
3697
+ if (wo) return Ne;
3698
+ wo = 1;
3699
+ var r = Pr();
3700
+ function t(e, n) {
3701
+ var i = r(this, e), o = i.size;
3702
+ return i.set(e, n), this.size += i.size == o ? 0 : 1, this;
3703
+ }
3704
+ return Ne = t, Ne;
3705
+ }
3706
+ var De, bo;
3707
+ function ku() {
3708
+ if (bo) return De;
3709
+ bo = 1;
3710
+ var r = Tu(), t = Au(), e = Cu(), n = $u(), i = Bu();
3711
+ function o(a) {
3712
+ var s = -1, u = a == null ? 0 : a.length;
3713
+ for (this.clear(); ++s < u; ) {
3714
+ var f = a[s];
3715
+ this.set(f[0], f[1]);
3716
+ }
3717
+ }
3718
+ return o.prototype.clear = r, o.prototype.delete = t, o.prototype.get = e, o.prototype.has = n, o.prototype.set = i, De = o, De;
3719
+ }
3720
+ var Fe, Io;
3721
+ function ju() {
3722
+ if (Io) return Fe;
3723
+ Io = 1;
3724
+ var r = ku(), t = "Expected a function";
3725
+ function e(n, i) {
3726
+ if (typeof n != "function" || i != null && typeof i != "function")
3727
+ throw new TypeError(t);
3728
+ var o = function() {
3729
+ var a = arguments, s = i ? i.apply(this, a) : a[0], u = o.cache;
3730
+ if (u.has(s))
3731
+ return u.get(s);
3732
+ var f = n.apply(this, a);
3733
+ return o.cache = u.set(s, f) || u, f;
3734
+ };
3735
+ return o.cache = new (e.Cache || r)(), o;
3736
+ }
3737
+ return e.Cache = r, Fe = e, Fe;
3738
+ }
3739
+ var He, qo;
3740
+ function Lu() {
3741
+ if (qo) return He;
3742
+ qo = 1;
3743
+ var r = ju(), t = 500;
3744
+ function e(n) {
3745
+ var i = r(n, function(a) {
3746
+ return o.size === t && o.clear(), a;
3747
+ }), o = i.cache;
3748
+ return i;
3749
+ }
3750
+ return He = e, He;
3751
+ }
3752
+ var Ue, Mo;
3753
+ function Pu() {
3754
+ if (Mo) return Ue;
3755
+ Mo = 1;
3756
+ var r = Lu(), t = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, e = /\\(\\)?/g, n = r(function(i) {
3757
+ var o = [];
3758
+ return i.charCodeAt(0) === 46 && o.push(""), i.replace(t, function(a, s, u, f) {
3759
+ o.push(u ? f.replace(e, "$1") : s || a);
3760
+ }), o;
3761
+ });
3762
+ return Ue = n, Ue;
3763
+ }
3764
+ var Ke, Eo;
3765
+ function xu() {
3766
+ if (Eo) return Ke;
3767
+ Eo = 1;
3768
+ function r(t, e) {
3769
+ for (var n = -1, i = t == null ? 0 : t.length, o = Array(i); ++n < i; )
3770
+ o[n] = e(t[n], n, t);
3771
+ return o;
3772
+ }
3773
+ return Ke = r, Ke;
3774
+ }
3775
+ var Ge, Oo;
3776
+ function Nu() {
3777
+ if (Oo) return Ge;
3778
+ Oo = 1;
3779
+ var r = Br(), t = xu(), e = Wt(), n = kr(), i = r ? r.prototype : void 0, o = i ? i.toString : void 0;
3780
+ function a(s) {
3781
+ if (typeof s == "string")
3782
+ return s;
3783
+ if (e(s))
3784
+ return t(s, a) + "";
3785
+ if (n(s))
3786
+ return o ? o.call(s) : "";
3787
+ var u = s + "";
3788
+ return u == "0" && 1 / s == -1 / 0 ? "-0" : u;
3789
+ }
3790
+ return Ge = a, Ge;
3791
+ }
3792
+ var We, zo;
3793
+ function Du() {
3794
+ if (zo) return We;
3795
+ zo = 1;
3796
+ var r = Nu();
3797
+ function t(e) {
3798
+ return e == null ? "" : r(e);
3799
+ }
3800
+ return We = t, We;
3801
+ }
3802
+ var Ye, To;
3803
+ function Fu() {
3804
+ if (To) return Ye;
3805
+ To = 1;
3806
+ var r = Wt(), t = uu(), e = Pu(), n = Du();
3807
+ function i(o, a) {
3808
+ return r(o) ? o : t(o, a) ? [o] : e(n(o));
3809
+ }
3810
+ return Ye = i, Ye;
3811
+ }
3812
+ var Xe, Ro;
3813
+ function Hu() {
3814
+ if (Ro) return Xe;
3815
+ Ro = 1;
3816
+ var r = 9007199254740991, t = /^(?:0|[1-9]\d*)$/;
3817
+ function e(n, i) {
3818
+ var o = typeof n;
3819
+ return i = i ?? r, !!i && (o == "number" || o != "symbol" && t.test(n)) && n > -1 && n % 1 == 0 && n < i;
3820
+ }
3821
+ return Xe = e, Xe;
3822
+ }
3823
+ var Je, Ao;
3824
+ function Uu() {
3825
+ if (Ao) return Je;
3826
+ Ao = 1;
3827
+ var r = 9007199254740991;
3828
+ function t(e) {
3829
+ return typeof e == "number" && e > -1 && e % 1 == 0 && e <= r;
3830
+ }
3831
+ return Je = t, Je;
3832
+ }
3833
+ var Ve, Co;
3834
+ function Ku() {
3835
+ if (Co) return Ve;
3836
+ Co = 1;
3837
+ var r = kr();
3838
+ function t(e) {
3839
+ if (typeof e == "string" || r(e))
3840
+ return e;
3841
+ var n = e + "";
3842
+ return n == "0" && 1 / e == -1 / 0 ? "-0" : n;
3843
+ }
3844
+ return Ve = t, Ve;
3845
+ }
3846
+ var Ze, $o;
3847
+ function Gu() {
3848
+ if ($o) return Ze;
3849
+ $o = 1;
3850
+ var r = Fu(), t = Pa(), e = Wt(), n = Hu(), i = Uu(), o = Ku();
3851
+ function a(s, u, f) {
3852
+ u = r(u, s);
3853
+ for (var c = -1, h = u.length, p = !1; ++c < h; ) {
3854
+ var _ = o(u[c]);
3855
+ if (!(p = s != null && f(s, _)))
3856
+ break;
3857
+ s = s[_];
3858
+ }
3859
+ return p || ++c != h ? p : (h = s == null ? 0 : s.length, !!h && i(h) && n(_, h) && (e(s) || t(s)));
3860
+ }
3861
+ return Ze = a, Ze;
3862
+ }
3863
+ var Qe, Bo;
3864
+ function Wu() {
3865
+ if (Bo) return Qe;
3866
+ Bo = 1;
3867
+ var r = su(), t = Gu();
3868
+ function e(n, i) {
3869
+ return n != null && t(n, i, r);
3870
+ }
3871
+ return Qe = e, Qe;
3872
+ }
3873
+ Wu();
3874
+ var tn, ko;
3875
+ function Yu() {
3876
+ if (ko) return tn;
3877
+ ko = 1;
3878
+ var r = Math.max, t = Math.min;
3879
+ function e(n, i, o) {
3880
+ return n >= t(i, o) && n < r(i, o);
3881
+ }
3882
+ return tn = e, tn;
3883
+ }
3884
+ var rn, jo;
3885
+ function Xu() {
3886
+ if (jo) return rn;
3887
+ jo = 1;
3888
+ var r = /\s/;
3889
+ function t(e) {
3890
+ for (var n = e.length; n-- && r.test(e.charAt(n)); )
3891
+ ;
3892
+ return n;
3893
+ }
3894
+ return rn = t, rn;
3895
+ }
3896
+ var en, Lo;
3897
+ function Ju() {
3898
+ if (Lo) return en;
3899
+ Lo = 1;
3900
+ var r = Xu(), t = /^\s+/;
3901
+ function e(n) {
3902
+ return n && n.slice(0, r(n) + 1).replace(t, "");
3903
+ }
3904
+ return en = e, en;
3905
+ }
3906
+ var nn, Po;
3907
+ function Na() {
3908
+ if (Po) return nn;
3909
+ Po = 1;
3910
+ var r = Ju(), t = Qn(), e = kr(), n = NaN, i = /^[-+]0x[0-9a-f]+$/i, o = /^0b[01]+$/i, a = /^0o[0-7]+$/i, s = parseInt;
3911
+ function u(f) {
3912
+ if (typeof f == "number")
3913
+ return f;
3914
+ if (e(f))
3915
+ return n;
3916
+ if (t(f)) {
3917
+ var c = typeof f.valueOf == "function" ? f.valueOf() : f;
3918
+ f = t(c) ? c + "" : c;
3919
+ }
3920
+ if (typeof f != "string")
3921
+ return f === 0 ? f : +f;
3922
+ f = r(f);
3923
+ var h = o.test(f);
3924
+ return h || a.test(f) ? s(f.slice(2), h ? 2 : 8) : i.test(f) ? n : +f;
3925
+ }
3926
+ return nn = u, nn;
3927
+ }
3928
+ var on, xo;
3929
+ function Da() {
3930
+ if (xo) return on;
3931
+ xo = 1;
3932
+ var r = Na(), t = 1 / 0, e = 17976931348623157e292;
3933
+ function n(i) {
3934
+ if (!i)
3935
+ return i === 0 ? i : 0;
3936
+ if (i = r(i), i === t || i === -t) {
3937
+ var o = i < 0 ? -1 : 1;
3938
+ return o * e;
3939
+ }
3940
+ return i === i ? i : 0;
3941
+ }
3942
+ return on = n, on;
3943
+ }
3944
+ var an, No;
3945
+ function Vu() {
3946
+ if (No) return an;
3947
+ No = 1;
3948
+ var r = Yu(), t = Da(), e = Na();
3949
+ function n(i, o, a) {
3950
+ return o = t(o), a === void 0 ? (a = o, o = 0) : a = t(a), i = e(i), r(i, o, a);
3951
+ }
3952
+ return an = n, an;
3953
+ }
3954
+ var Zu = Vu();
3955
+ const Qu = /* @__PURE__ */ Zs(Zu);
3956
+ var sn, Do;
3957
+ function Fa() {
3958
+ if (Do) return sn;
3959
+ Do = 1;
3960
+ var r = Da();
3961
+ function t(e) {
3962
+ var n = r(e), i = n % 1;
3963
+ return n === n ? i ? n - i : n : 0;
3964
+ }
3965
+ return sn = t, sn;
3966
+ }
3967
+ var un, Fo;
3968
+ function tf() {
3969
+ if (Fo) return un;
3970
+ Fo = 1;
3971
+ var r = Fa();
3972
+ function t(e) {
3973
+ return typeof e == "number" && e == r(e);
3974
+ }
3975
+ return un = t, un;
3976
+ }
3977
+ tf();
3978
+ var fn, Ho;
3979
+ function rf() {
3980
+ if (Ho) return fn;
3981
+ Ho = 1;
3982
+ function r(t, e, n) {
3983
+ var i = -1, o = t.length;
3984
+ e < 0 && (e = -e > o ? 0 : o + e), n = n > o ? o : n, n < 0 && (n += o), o = e > n ? 0 : n - e >>> 0, e >>>= 0;
3985
+ for (var a = Array(o); ++i < o; )
3986
+ a[i] = t[i + e];
3987
+ return a;
3988
+ }
3989
+ return fn = r, fn;
3990
+ }
3991
+ var cn, Uo;
3992
+ function ef() {
3993
+ if (Uo) return cn;
3994
+ Uo = 1;
3995
+ var r = rf(), t = Fa();
3996
+ function e(n, i, o) {
3997
+ return n && n.length ? (i = o || i === void 0 ? 1 : t(i), r(n, 0, i < 0 ? 0 : i)) : [];
3998
+ }
3999
+ return cn = e, cn;
4000
+ }
4001
+ ef();
4002
+ const sr = "black", ur = "white", tt = null;
4003
+ class Ha extends A({ dimensions: 19, moves: U() }, "Board") {
4004
+ constructor(t = 19, ...e) {
4005
+ super({
4006
+ dimensions: t,
4007
+ moves: U(
4008
+ e.map((n) => [n.coordinate, n.color])
4009
+ )
4010
+ });
4011
+ }
4012
+ toMap(t = null) {
4013
+ const e = {
4014
+ [sr]: sr,
4015
+ [ur]: ur,
4016
+ [tt]: tt
4017
+ }, n = t || e;
4018
+ return Array(this.dimensions).fill(tt).map(
4019
+ (i, o) => Array(this.dimensions).fill(tt).map(
4020
+ (a, s) => {
4021
+ const u = this.moves.get(rt(s, o), tt);
4022
+ return n[u] || e[u];
4023
+ }
4024
+ )
4025
+ );
4026
+ }
4027
+ }
4028
+ function Ua(...r) {
4029
+ return Reflect.construct(Ha, r);
4030
+ }
4031
+ Ua.prototype = Ha.prototype;
4032
+ class Ka extends A({ x: 0, y: 0 }, "Coordinate") {
4033
+ constructor(t, e) {
4034
+ super({ x: t, y: e });
4035
+ }
4036
+ }
4037
+ function rt(...r) {
4038
+ return Reflect.construct(Ka, r);
4039
+ }
4040
+ rt.prototype = Ka.prototype;
4041
+ class Ga extends A({ coordinate: rt(), color: tt }, "Move") {
4042
+ constructor(t, e) {
4043
+ super({ coordinate: t, color: e });
4044
+ }
4045
+ }
4046
+ function Wa(...r) {
4047
+ return Reflect.construct(Ga, r);
4048
+ }
4049
+ Wa.prototype = Ga.prototype;
4050
+ rt(4, 4);
4051
+ rt(6, 6);
4052
+ rt(9, 9);
4053
+ function nf(r, t) {
4054
+ const { x: e, y: n } = t, i = (o) => Qu(o, r.dimensions);
4055
+ return ft.of(
4056
+ rt(e, n + 1),
4057
+ rt(e, n - 1),
4058
+ rt(e + 1, n),
4059
+ rt(e - 1, n)
4060
+ ).filter((o) => i(o.x) && i(o.y));
4061
+ }
4062
+ function xr(r, t, e) {
4063
+ const n = e === void 0 ? r.moves.get(t, tt) : e;
4064
+ return nf(r, t).filter((i) => r.moves.get(i, tt) === n);
4065
+ }
4066
+ function Ya(r, t) {
4067
+ let e = ft(), n = ft.of(t);
4068
+ for (; !n.isEmpty(); ) {
4069
+ const i = n.first(), o = xr(r, i);
4070
+ e = e.add(i), n = n.rest().union(o.subtract(e));
4071
+ }
4072
+ return e;
4073
+ }
4074
+ function Xa(r) {
4075
+ return r === sr ? ur : r === ur ? sr : tt;
4076
+ }
4077
+ function of(r, t) {
4078
+ return Ya(r, t).reduce(
4079
+ (e, n) => e.union(
4080
+ xr(r, n, tt)
4081
+ ),
4082
+ ft()
4083
+ );
4084
+ }
4085
+ function Sn(r, t) {
4086
+ return of(r, t).size;
4087
+ }
4088
+ function Ja(r, t) {
4089
+ const e = Sn(
4090
+ r.setIn(["moves", t.coordinate], t.color),
4091
+ t.coordinate
4092
+ ) > 0, n = xr(
4093
+ r,
4094
+ t.coordinate,
4095
+ Xa(t.color)
4096
+ ).some((i) => Sn(r, i) === 1);
4097
+ return e || n;
4098
+ }
4099
+ function af(r, t) {
4100
+ return r.setIn(
4101
+ ["moves"],
4102
+ t.reduce(
4103
+ (e, n) => e.delete(n),
4104
+ r.moves
4105
+ )
4106
+ );
4107
+ }
4108
+ function sf(r, t) {
4109
+ if (!Ja(r, t))
4110
+ throw new Error("Not a valid position");
4111
+ if (r.moves.has(t.coordinate))
4112
+ throw new Error("There is already a stone there");
4113
+ const e = xr(
4114
+ r,
4115
+ t.coordinate,
4116
+ Xa(t.color)
4117
+ ).reduce(
4118
+ (n, i) => n.union(
4119
+ Sn(r, i) === 1 ? Ya(r, i) : ft()
4120
+ ),
4121
+ ft()
4122
+ );
4123
+ return af(r, e).setIn(
4124
+ ["moves", t.coordinate],
4125
+ t.color
4126
+ );
4127
+ }
4128
+ const wt = {
4129
+ BLACK: sr,
4130
+ Board: Ua,
4131
+ Coordinate: rt,
4132
+ EMPTY: tt,
4133
+ Move: Wa,
4134
+ WHITE: ur,
4135
+ addMove: sf,
4136
+ isLegalMove: Ja
4137
+ }, J = wt.BLACK, Ko = wt.Board, fr = wt.Coordinate, tr = wt.EMPTY, qt = wt.Move, at = wt.WHITE, Ct = wt.addMove, Va = wt.isLegalMove;
4138
+ function wr(r) {
4139
+ return `
4140
+ <div style="background: #fee2e2; color: #991b1b; padding: 1rem; border-radius: 4px;">${r}</div>
4141
+ `;
4142
+ }
4143
+ function ti(r, t, e) {
4144
+ const n = r.dimensions, i = t ?? n, o = e ?? n, a = 30, s = a, u = a * 0.4, f = n === o, c = n === i, h = (f ? o - 1 : o) * a + s * 2, p = (c ? i - 1 : i) * a + s * 2;
4145
+ let _ = `<svg width="${h}" height="${p}" xmlns="http://www.w3.org/2000/svg">`;
4146
+ _ += `<rect width="${h}" height="${p}" fill="#dcb35c"/>`;
4147
+ const d = o < n, v = i < n, I = s + (d ? o : o - 1) * a, y = s + (v ? i : i - 1) * a;
4148
+ for (let l = 0; l < o; l++) {
4149
+ const g = s + l * a;
4150
+ _ += `<line x1="${g}" y1="${s}" x2="${g}" y2="${y}" stroke="#000" stroke-width="1"/>`;
4151
+ }
4152
+ for (let l = 0; l < i; l++) {
4153
+ const g = s + l * a;
4154
+ _ += `<line x1="${s}" y1="${g}" x2="${I}" y2="${g}" stroke="#000" stroke-width="1"/>`;
4155
+ }
4156
+ const m = [];
4157
+ n === 9 ? m.push([2, 2], [2, 6], [4, 4], [6, 2], [6, 6]) : n === 13 ? m.push([3, 3], [3, 9], [6, 6], [9, 3], [9, 9]) : n === 19 && m.push([3, 3], [3, 9], [3, 15], [9, 3], [9, 9], [9, 15], [15, 3], [15, 9], [15, 15]);
4158
+ for (const [l, g] of m)
4159
+ if (l < i && g < o) {
4160
+ const b = s + g * a, B = s + l * a;
4161
+ _ += `<circle cx="${b}" cy="${B}" r="3" fill="#000"/>`;
4162
+ }
4163
+ for (let l = 0; l < i; l++)
4164
+ for (let g = 0; g < o; g++) {
4165
+ const b = r.moves.get(fr(l, g), tr);
4166
+ if (b !== tr) {
4167
+ const B = s + g * a, C = s + l * a;
4168
+ b === J ? _ += `<circle cx="${B}" cy="${C}" r="${u}" fill="#000" stroke="#000" stroke-width="1"/>` : b === at && (_ += `<circle cx="${B}" cy="${C}" r="${u}" fill="#fff" stroke="#000" stroke-width="1"/>`);
4169
+ }
4170
+ }
4171
+ return _ += "</svg>", _;
4172
+ }
4173
+ class it extends Error {
4174
+ constructor(t) {
4175
+ super(t), this.name = "ValidationError";
4176
+ }
4177
+ }
4178
+ function Za(r, t) {
4179
+ const e = {};
4180
+ let n = null, i = !1;
4181
+ for (let o = t; o < r.length; o++) {
4182
+ const a = r[o].trim();
4183
+ if (a === "") continue;
4184
+ const s = a.indexOf(":");
4185
+ if (s > 0) {
4186
+ const u = a.substring(0, s).trim(), f = a.substring(s + 1).trim();
4187
+ e[u] = f, n = u, i = f === "";
4188
+ } else n && i && (Array.isArray(e[n]) ? e[n].push(a) : e[n] = [a]);
4189
+ }
4190
+ return e;
4191
+ }
4192
+ function ri(r, t = {}) {
4193
+ const { allowEmpty: e = !1, validateCharacters: n = !0 } = t;
4194
+ let i = 1;
4195
+ for (; i < r.length && r[i].trim() === ""; )
4196
+ i++;
4197
+ if (i >= r.length)
4198
+ throw new it("No board definition or options found");
4199
+ const o = [];
4200
+ let a = i;
4201
+ for (let y = i; y < r.length; y++) {
4202
+ const m = r[y];
4203
+ if (m.trim() === "") {
4204
+ a = y;
4205
+ break;
4206
+ }
4207
+ if (m.indexOf(":") > 0) {
4208
+ a = y;
4209
+ break;
4210
+ }
4211
+ o.push(m), a = y + 1;
4212
+ }
4213
+ const s = Za(r, a);
4214
+ let u;
4215
+ if (s.size) {
4216
+ const y = s.size;
4217
+ if (Array.isArray(y))
4218
+ throw new it("Size option cannot have multiple values");
4219
+ const m = parseInt(y, 10);
4220
+ if (isNaN(m) || m <= 1 || m > 19)
4221
+ throw new it("Size must be a positive integer greater than 1 and less than or equal to 19");
4222
+ u = m;
4223
+ }
4224
+ if (o.length === 0) {
4225
+ if (!e)
4226
+ throw new it("Board definition is required");
4227
+ if (!u)
4228
+ throw new it('Empty board requires a "size" option');
4229
+ return {
4230
+ board: Ko(u),
4231
+ rowCount: u,
4232
+ columnCount: u,
4233
+ configStartIndex: a,
4234
+ otherMarks: {}
4235
+ };
4236
+ }
4237
+ const f = o.map((y) => y.replace(/\s/g, "").length), c = f[0];
4238
+ if (!f.every((y) => y === c))
4239
+ throw new it("All board rows must have the same number of non-space characters");
4240
+ const h = o.length, p = o[0].replace(/\s/g, "").length, _ = h === p;
4241
+ if (u && (h > u || p > u))
4242
+ throw new it(`Board dimensions (${h}x${p}) exceed specified size (${u})`);
4243
+ if (!_ && !u)
4244
+ throw new it(`Rectangle boards require a "size" option (found ${h}x${p} board)`);
4245
+ u || (u = h);
4246
+ const d = [], v = {};
4247
+ for (let y = 0; y < o.length; y++) {
4248
+ const m = o[y];
4249
+ let l = 0;
4250
+ for (let g = 0; g < m.length; g++) {
4251
+ const b = m[g];
4252
+ if (b === " ") continue;
4253
+ const B = /^[.+XOxo]$/.test(b);
4254
+ if (n && !B)
4255
+ throw new it(`Invalid board character '${b}' at row ${y + 1}, col ${l + 1}. Valid characters: . or + (empty), X or x (black stone), O or o (white stone)`);
4256
+ let C = tr;
4257
+ b === "X" || b === "x" ? C = J : b === "O" || b === "o" ? C = at : b === "." || b === "+" ? C = tr : n || (v[b] || (v[b] = []), v[b].push(fr(y, l))), C !== tr && d.push(qt(fr(y, l), C)), l++;
4258
+ }
4259
+ }
4260
+ return {
4261
+ board: Ko(u, ...d),
4262
+ rowCount: h,
4263
+ columnCount: p,
4264
+ configStartIndex: a,
4265
+ otherMarks: v
4266
+ };
4267
+ }
4268
+ const nt = {
4269
+ Success: "success",
4270
+ Failure: "failure",
4271
+ Incomplete: "incomplete"
4272
+ };
4273
+ class Qa {
4274
+ parsedBoard;
4275
+ element;
4276
+ constructor(t, e) {
4277
+ this.element = t, this.parsedBoard = ri(e, {});
4278
+ }
4279
+ render() {
4280
+ const t = this.element, { board: e, rowCount: n, columnCount: i } = this.parsedBoard, o = ti(e, n, i);
4281
+ t.innerHTML = o;
4282
+ }
4283
+ }
4284
+ class ts {
4285
+ parsedBoard;
4286
+ element;
4287
+ toPlay;
4288
+ sequenceTree;
4289
+ result;
4290
+ currentTree;
4291
+ playedMoves;
4292
+ currentBoard;
4293
+ isBlackTurn;
4294
+ constructor(t, e) {
4295
+ this.element = t;
4296
+ const n = ri(e, { allowEmpty: !1, validateCharacters: !1 });
4297
+ for (const [l, g] of Object.entries(n.otherMarks))
4298
+ if (g.length > 1)
4299
+ throw new Error(`Mark '${l}' appears at multiple coordinates. Each mark must be unique.`);
4300
+ const i = Za(e, n.configStartIndex), o = i.black, a = i.white, s = o ? Array.isArray(o) ? o : o.split(",").map((l) => l.trim()).filter((l) => l.length > 0) : [], u = a ? Array.isArray(a) ? a : a.split(",").map((l) => l.trim()).filter((l) => l.length > 0) : [], f = new Set(u), c = s.filter((l) => f.has(l));
4301
+ if (c.length > 0)
4302
+ throw new Error(`Marks cannot appear in both black and white: ${c.join(", ")}`);
4303
+ const h = new Set(Object.keys(n.otherMarks));
4304
+ for (const l of s)
4305
+ if (!h.has(l))
4306
+ throw new Error(`Black mark '${l}' does not appear in the board`);
4307
+ for (const l of u)
4308
+ if (!h.has(l))
4309
+ throw new Error(`White mark '${l}' does not appear in the board`);
4310
+ const p = i["to-play"], _ = p ? (Array.isArray(p) ? p[0] : p).toLowerCase() : "";
4311
+ if (_ && _ !== "black" && _ !== "white")
4312
+ throw new Error(`Invalid to-play value '${_}'. Must be 'black' or 'white'`);
4313
+ this.toPlay = _ === "white" ? at : J;
4314
+ let d = n.board;
4315
+ for (const l of s) {
4316
+ const g = n.otherMarks[l];
4317
+ for (const b of g)
4318
+ d = Ct(d, qt(b, J));
4319
+ }
4320
+ for (const l of u) {
4321
+ const g = n.otherMarks[l];
4322
+ for (const b of g)
4323
+ d = Ct(d, qt(b, at));
4324
+ }
4325
+ this.parsedBoard = { ...n, board: d }, this.result = nt.Incomplete, this.currentTree = U(), this.playedMoves = [], this.currentBoard = d, this.isBlackTurn = this.toPlay === J;
4326
+ const v = (l, g) => {
4327
+ const b = l.split(">").map((E) => E.trim()).filter((E) => E.length > 0);
4328
+ for (const E of b)
4329
+ if (!n.otherMarks[E])
4330
+ throw new Error(`${g} '${l}': mark '${E}' does not appear in the board`);
4331
+ let B = d, C = this.toPlay;
4332
+ for (let E = 0; E < b.length; E++) {
4333
+ const pt = b[E], bt = n.otherMarks[pt][0], Rt = qt(bt, C);
4334
+ if (!Va(B, Rt))
4335
+ throw new Error(`${g} '${l}': move ${E + 1} (${pt}) is illegal`);
4336
+ try {
4337
+ B = Ct(B, Rt);
4338
+ } catch (At) {
4339
+ const es = At instanceof Error ? At.message : String(At);
4340
+ throw new Error(`${g} '${l}': move ${E + 1} (${pt}) failed - ${es}`);
4341
+ }
4342
+ C = C === J ? at : J;
4343
+ }
4344
+ }, I = i.solutions, y = [];
4345
+ if (I) {
4346
+ const l = Array.isArray(I) ? I : [I];
4347
+ for (const g of l)
4348
+ v(g, "Solution"), y.push({ sequence: g, isSolution: !0 });
4349
+ }
4350
+ const m = i.sequences;
4351
+ if (m) {
4352
+ const l = Array.isArray(m) ? m : [m];
4353
+ for (const g of l)
4354
+ v(g, "Sequence"), y.push({ sequence: g, isSolution: !1 });
4355
+ }
4356
+ this.sequenceTree = U();
4357
+ for (const { sequence: l, isSolution: g } of y) {
4358
+ const b = l.split(">").map((E) => E.trim()).filter((E) => E.length > 0), B = [];
4359
+ for (const E of b)
4360
+ B.push(n.otherMarks[E][0]);
4361
+ let C = U();
4362
+ for (let E = B.length - 1; E >= 0; E--) {
4363
+ const pt = B[E], Tt = E === B.length - 1;
4364
+ let bt;
4365
+ Tt ? bt = g ? nt.Success : nt.Failure : bt = nt.Incomplete;
4366
+ const Rt = {
4367
+ result: bt,
4368
+ children: C
4369
+ };
4370
+ C = U().set(pt, Rt);
4371
+ }
4372
+ this.sequenceTree = this.mergeSequenceTrees(this.sequenceTree, C);
4373
+ }
4374
+ this.currentTree = this.sequenceTree;
4375
+ }
4376
+ mergeSequenceTrees(t, e) {
4377
+ return e.reduce((n, i, o) => {
4378
+ const a = n.get(o);
4379
+ if (a) {
4380
+ const s = this.mergeSequenceTrees(a.children, i.children), c = {
4381
+ result: s.size > 0 ? nt.Incomplete : a.result,
4382
+ children: s
4383
+ };
4384
+ return n.set(o, c);
4385
+ } else
4386
+ return n.set(o, i);
4387
+ }, t);
4388
+ }
4389
+ handleUserMove(t) {
4390
+ const e = this.currentTree.get(t), n = this.isBlackTurn ? J : at, i = qt(t, n);
4391
+ if (this.playedMoves.push(i), this.currentBoard = Ct(this.currentBoard, i), this.isBlackTurn = !this.isBlackTurn, !e) {
4392
+ this.result !== nt.Success && (this.result = nt.Failure), this.currentTree = U(), this.render();
4393
+ return;
4394
+ }
4395
+ this.currentTree = e.children, this.result = e.result, this.render(), e.children.size > 0 && setTimeout(() => this.playComputerResponse(), 500);
4396
+ }
4397
+ playComputerResponse() {
4398
+ const t = Array.from(this.currentTree.entries());
4399
+ if (t.length === 0) return;
4400
+ const e = Math.floor(Math.random() * t.length), [n, i] = t[e], o = this.isBlackTurn ? J : at, a = qt(n, o);
4401
+ this.playedMoves.push(a), this.currentBoard = Ct(this.currentBoard, a), this.isBlackTurn = !this.isBlackTurn, this.currentTree = i.children, this.result = i.result, this.render();
4402
+ }
4403
+ reset() {
4404
+ this.currentTree = this.sequenceTree, this.playedMoves = [], this.currentBoard = this.parsedBoard.board, this.isBlackTurn = this.toPlay === J, this.result = nt.Incomplete, this.render();
4405
+ }
4406
+ render() {
4407
+ const t = this.element, { rowCount: e, columnCount: n } = this.parsedBoard;
4408
+ let o = ti(this.currentBoard, e, n);
4409
+ const a = `reset-${Math.random().toString(36).substr(2, 9)}`, s = "padding: 0.5rem 1rem; margin: 0.5rem 0.25rem; border: 1px solid #ccc; border-radius: 4px; background: #fff; cursor: pointer; font-size: 0.9rem;";
4410
+ o += '<div style="margin-top: 1rem; display: flex; align-items: center;">', o += `<button id="${a}" style="${s}">Reset</button>`, this.result === nt.Success ? o += '<span style="margin-left: 1rem; font-weight: 600; font-size: 1.1rem; color: #155724;">Success!</span>' : this.result === nt.Failure && (o += '<span style="margin-left: 1rem; font-weight: 600; font-size: 1.1rem; color: #721c24;">Incorrect</span>'), o += "</div>", t.innerHTML = o;
4411
+ const u = t.querySelector("svg");
4412
+ u && (u.style.cursor = "pointer", u.addEventListener("click", (c) => {
4413
+ const h = c, p = u.getBoundingClientRect(), _ = h.clientX - p.left, d = h.clientY - p.top, v = 30, I = v, y = Math.round((_ - I) / v), m = Math.round((d - I) / v);
4414
+ if (m >= 0 && m < e && y >= 0 && y < n) {
4415
+ const l = fr(m, y);
4416
+ this.handleUserMove(l);
4417
+ }
4418
+ }));
4419
+ const f = document.getElementById(a);
4420
+ f && f.addEventListener("click", () => this.reset());
4421
+ }
4422
+ }
4423
+ class rs {
4424
+ parsedBoard;
4425
+ element;
4426
+ currentBoard;
4427
+ initialBoard;
4428
+ history;
4429
+ currentMoveIndex;
4430
+ // -1 means no moves yet
4431
+ isBlackTurn;
4432
+ constructor(t, e) {
4433
+ this.element = t, this.parsedBoard = ri(e, { allowEmpty: !0 }), this.initialBoard = this.parsedBoard.board, this.currentBoard = this.parsedBoard.board, this.history = [], this.currentMoveIndex = -1, this.isBlackTurn = !0;
4434
+ }
4435
+ rebuildBoard() {
4436
+ let t = this.initialBoard;
4437
+ for (let e = 0; e <= this.currentMoveIndex; e++) {
4438
+ const n = this.history[e];
4439
+ n.type === "move" && (t = Ct(t, n.move));
4440
+ }
4441
+ if (this.currentBoard = t, this.currentMoveIndex === -1)
4442
+ this.isBlackTurn = !0;
4443
+ else {
4444
+ const e = this.history[this.currentMoveIndex], n = e.type === "move" ? e.move.color : e.color;
4445
+ this.isBlackTurn = n === at;
4446
+ }
4447
+ }
4448
+ undo() {
4449
+ this.currentMoveIndex >= 0 && (this.currentMoveIndex--, this.rebuildBoard(), this.render());
4450
+ }
4451
+ redo() {
4452
+ this.currentMoveIndex < this.history.length - 1 && (this.currentMoveIndex++, this.rebuildBoard(), this.render());
4453
+ }
4454
+ pass() {
4455
+ this.history = this.history.slice(0, this.currentMoveIndex + 1);
4456
+ const t = this.isBlackTurn ? J : at;
4457
+ this.history.push({ type: "pass", color: t }), this.currentMoveIndex++, this.isBlackTurn = !this.isBlackTurn, this.render();
4458
+ }
4459
+ reset() {
4460
+ this.history = [], this.currentMoveIndex = -1, this.currentBoard = this.initialBoard, this.isBlackTurn = !0, this.render();
4461
+ }
4462
+ render() {
4463
+ const t = this.element, { rowCount: e, columnCount: n } = this.parsedBoard, i = ti(this.currentBoard, e, n), o = `turn-info-${Math.random().toString(36).substr(2, 9)}`, a = `undo-${Math.random().toString(36).substr(2, 9)}`, s = `redo-${Math.random().toString(36).substr(2, 9)}`, u = `pass-${Math.random().toString(36).substr(2, 9)}`, f = `reset-${Math.random().toString(36).substr(2, 9)}`;
4464
+ let c = '<div class="freeplay-container">';
4465
+ c += `<div id="${o}" style="margin-bottom: 1rem; padding: 0.5rem; font-weight: 600; font-size: 1.1rem;">${this.isBlackTurn ? "Black" : "White"} to play</div>`, c += i;
4466
+ const h = "padding: 0.5rem 1rem; margin: 0.5rem 0.25rem; border: 1px solid #ccc; border-radius: 4px; background: #fff; cursor: pointer; font-size: 0.9rem;", p = "padding: 0.5rem 1rem; margin: 0.5rem 0.25rem; border: 1px solid #ccc; border-radius: 4px; background: #f0f0f0; cursor: not-allowed; font-size: 0.9rem; color: #999;";
4467
+ c += '<div style="margin-top: 1rem;">', c += `<button id="${a}" style="${this.currentMoveIndex >= 0 ? h : p}" ${this.currentMoveIndex < 0 ? "disabled" : ""}>← Undo</button>`, c += `<button id="${s}" style="${this.currentMoveIndex < this.history.length - 1 ? h : p}" ${this.currentMoveIndex >= this.history.length - 1 ? "disabled" : ""}>Redo →</button>`, c += `<button id="${u}" style="${h}">Pass</button>`, c += `<button id="${f}" style="${h}">Reset</button>`, c += "</div>", c += "</div>", t.innerHTML = c;
4468
+ const _ = t.querySelector("svg"), d = document.getElementById(a), v = document.getElementById(s), I = document.getElementById(u), y = document.getElementById(f);
4469
+ _ && (_.style.cursor = "pointer", _.addEventListener("click", (m) => {
4470
+ const l = m, g = _.getBoundingClientRect(), b = l.clientX - g.left, B = l.clientY - g.top, C = 30, E = C, pt = Math.round((b - E) / C), Tt = Math.round((B - E) / C);
4471
+ if (Tt >= 0 && Tt < e && pt >= 0 && pt < n) {
4472
+ const bt = fr(Tt, pt), Rt = this.isBlackTurn ? J : at, At = qt(bt, Rt);
4473
+ Va(this.currentBoard, At) && (this.history = this.history.slice(0, this.currentMoveIndex + 1), this.history.push({ type: "move", move: At }), this.currentMoveIndex++, this.rebuildBoard(), this.render());
4474
+ }
4475
+ })), d && d.addEventListener("click", () => this.undo()), v && v.addEventListener("click", () => this.redo()), I && I.addEventListener("click", () => this.pass()), y && y.addEventListener("click", () => this.reset());
4476
+ }
4477
+ }
4478
+ const uf = {
4479
+ static: Qa,
4480
+ freeplay: rs,
4481
+ problem: ts
4482
+ }, hf = "0.0.0", ff = ".godash-diagram";
4483
+ function cf(r, t) {
4484
+ const e = t.split(`
4485
+ `);
4486
+ if (e.length === 0) {
4487
+ r.innerHTML = wr("Empty diagram source");
4488
+ return;
4489
+ }
4490
+ const n = e[0].trim();
4491
+ try {
4492
+ let i;
4493
+ switch (n) {
4494
+ case "static":
4495
+ i = new Qa(r, e);
4496
+ break;
4497
+ case "freeplay":
4498
+ i = new rs(r, e);
4499
+ break;
4500
+ case "problem":
4501
+ i = new ts(r, e);
4502
+ break;
4503
+ default:
4504
+ r.innerHTML = wr(`Unsupported diagram type "${n}". Supported types: ${Object.keys(uf).join(", ")}`);
4505
+ return;
4506
+ }
4507
+ i.render();
4508
+ } catch (i) {
4509
+ i instanceof it ? r.innerHTML = wr(i.message) : r.innerHTML = wr(i instanceof Error ? i.message : String(i));
4510
+ }
4511
+ }
4512
+ function pf(r, t) {
4513
+ const e = r ?? ff, n = document.querySelectorAll(e);
4514
+ if (n.length === 0)
4515
+ throw new Error(`No elements found for selector: ${e}`);
4516
+ n.forEach((i) => {
4517
+ const o = t?.diagramSource ?? i.textContent ?? "";
4518
+ cf(i, o);
4519
+ });
4520
+ }
4521
+ export {
4522
+ pf as init,
4523
+ hf as version
4524
+ };