@byloth/core 2.0.2 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,13 +1,13 @@
1
- var De = Object.defineProperty;
2
- var ze = (i, t, e) => t in i ? De(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
3
- var a = (i, t, e) => ze(i, typeof t != "symbol" ? t + "" : t, e);
4
- const Oe = typeof window < "u" && typeof window.document < "u";
1
+ var Ye = Object.defineProperty;
2
+ var Le = (i, n, e) => n in i ? Ye(i, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[n] = e;
3
+ var a = (i, n, e) => Le(i, typeof n != "symbol" ? n + "" : n, e);
4
+ const De = typeof window < "u" && typeof window.document < "u";
5
5
  var I;
6
- const We = typeof process < "u" && !!((I = process.versions) != null && I.node);
6
+ const nt = typeof process < "u" && !!((I = process.versions) != null && I.node);
7
7
  var A;
8
- const Ue = typeof self == "object" && ((A = self.constructor) == null ? void 0 : A.name) === "DedicatedWorkerGlobalScope";
8
+ const st = typeof self == "object" && ((A = self.constructor) == null ? void 0 : A.name) === "DedicatedWorkerGlobalScope";
9
9
  var N, O;
10
- class u extends (O = Error, N = Symbol.toStringTag, O) {
10
+ class c extends (O = Error, N = Symbol.toStringTag, O) {
11
11
  /**
12
12
  * Initializes a new instance of the {@link Exception} class.
13
13
  *
@@ -24,14 +24,14 @@ class u extends (O = Error, N = Symbol.toStringTag, O) {
24
24
  * @param cause The previous caught error that caused this one, if any.
25
25
  * @param name The name of the exception. Default is `"Exception"`.
26
26
  */
27
- constructor(e, n, s = "Exception") {
27
+ constructor(e, t, s = "Exception") {
28
28
  super(e);
29
29
  a(this, N, "Exception");
30
- this.cause = n, this.name = s, n && (n instanceof Error ? this.stack += `
30
+ this.cause = t, this.name = s, t && (t instanceof Error ? this.stack += `
31
31
 
32
- Caused by ${n.stack}` : this.stack += `
32
+ Caused by ${t.stack}` : this.stack += `
33
33
 
34
- Caused by ${n}`);
34
+ Caused by ${t}`);
35
35
  }
36
36
  /**
37
37
  * A static method to convert a generic caught error, ensuring it's an instance of the {@link Exception} class.
@@ -56,17 +56,17 @@ Caused by ${n}`);
56
56
  * @returns An instance of the {@link Exception} class.
57
57
  */
58
58
  static FromUnknown(e) {
59
- if (e instanceof u)
59
+ if (e instanceof c)
60
60
  return e;
61
61
  if (e instanceof Error) {
62
- const n = new u(e.message);
63
- return n.stack = e.stack, n.name = e.name, n;
62
+ const t = new c(e.message);
63
+ return t.stack = e.stack, t.name = e.name, t;
64
64
  }
65
- return new u(`${e}`);
65
+ return new c(`${e}`);
66
66
  }
67
67
  }
68
- var $, q;
69
- class x extends (q = u, $ = Symbol.toStringTag, q) {
68
+ var $, z;
69
+ class g extends (z = c, $ = Symbol.toStringTag, z) {
70
70
  /**
71
71
  * Initializes a new instance of the {@link FatalErrorException} class.
72
72
  *
@@ -83,14 +83,14 @@ class x extends (q = u, $ = Symbol.toStringTag, q) {
83
83
  * @param cause The previous caught error that caused this one, if any.
84
84
  * @param name The name of the exception. Default is `"FatalErrorException"`.
85
85
  */
86
- constructor(e, n, s = "FatalErrorException") {
86
+ constructor(e, t, s = "FatalErrorException") {
87
87
  e === void 0 && (e = "The program has encountered an unrecoverable error and cannot continue as expected. Please, try again later. If the problem persists, contact the support team.");
88
- super(e, n, s);
88
+ super(e, t, s);
89
89
  a(this, $, "FatalErrorException");
90
90
  }
91
91
  }
92
- var D, z;
93
- class Be extends (z = x, D = Symbol.toStringTag, z) {
92
+ var q, D;
93
+ class Ve extends (D = g, q = Symbol.toStringTag, D) {
94
94
  /**
95
95
  * Initializes a new instance of the {@link NotImplementedException} class.
96
96
  *
@@ -107,14 +107,14 @@ class Be extends (z = x, D = Symbol.toStringTag, z) {
107
107
  * @param cause The previous caught error that caused this one, if any.
108
108
  * @param name The name of the exception. Default is `"NotImplementedException"`.
109
109
  */
110
- constructor(e, n, s = "NotImplementedException") {
110
+ constructor(e, t, s = "NotImplementedException") {
111
111
  e === void 0 && (e = "This feature isn't implemented yet. Please, try again later.");
112
- super(e, n, s);
113
- a(this, D, "NotImplementedException");
112
+ super(e, t, s);
113
+ a(this, q, "NotImplementedException");
114
114
  }
115
115
  }
116
116
  var B, J;
117
- class $e extends (J = u, B = Symbol.toStringTag, J) {
117
+ class Be extends (J = c, B = Symbol.toStringTag, J) {
118
118
  /**
119
119
  * Initializes a new instance of the {@link FileException} class.
120
120
  *
@@ -131,13 +131,13 @@ class $e extends (J = u, B = Symbol.toStringTag, J) {
131
131
  * @param cause The previous caught error that caused this one, if any.
132
132
  * @param name The name of the exception. Default is `"FileException"`.
133
133
  */
134
- constructor(e, n, s = "FileException") {
135
- super(e, n, s);
134
+ constructor(e, t, s = "FileException") {
135
+ super(e, t, s);
136
136
  a(this, B, "FileException");
137
137
  }
138
138
  }
139
139
  var Y, L;
140
- class et extends (L = $e, Y = Symbol.toStringTag, L) {
140
+ class rt extends (L = Be, Y = Symbol.toStringTag, L) {
141
141
  /**
142
142
  * Initializes a new instance of the {@link FileExistsException} class.
143
143
  *
@@ -154,13 +154,13 @@ class et extends (L = $e, Y = Symbol.toStringTag, L) {
154
154
  * @param cause The previous caught error that caused this one, if any.
155
155
  * @param name The name of the exception. Default is `"FileExistsException"`.
156
156
  */
157
- constructor(e, n, s = "FileExistsException") {
158
- super(e, n, s);
157
+ constructor(e, t, s = "FileExistsException") {
158
+ super(e, t, s);
159
159
  a(this, Y, "FileExistsException");
160
160
  }
161
161
  }
162
- var G, K;
163
- class tt extends (K = $e, G = Symbol.toStringTag, K) {
162
+ var V, G;
163
+ class it extends (G = Be, V = Symbol.toStringTag, G) {
164
164
  /**
165
165
  * Initializes a new instance of the {@link FileNotFoundException} class.
166
166
  *
@@ -177,13 +177,13 @@ class tt extends (K = $e, G = Symbol.toStringTag, K) {
177
177
  * @param cause The previous caught error that caused this one, if any.
178
178
  * @param name The name of the exception. Default is `"FileNotFoundException"`.
179
179
  */
180
- constructor(e, n, s = "FileNotFoundException") {
181
- super(e, n, s);
182
- a(this, G, "FileNotFoundException");
180
+ constructor(e, t, s = "FileNotFoundException") {
181
+ super(e, t, s);
182
+ a(this, V, "FileNotFoundException");
183
183
  }
184
184
  }
185
- var H, Q;
186
- class _ extends (Q = u, H = Symbol.toStringTag, Q) {
185
+ var K, H;
186
+ class y extends (H = c, K = Symbol.toStringTag, H) {
187
187
  /**
188
188
  * Initializes a new instance of the {@link KeyException} class.
189
189
  *
@@ -200,13 +200,13 @@ class _ extends (Q = u, H = Symbol.toStringTag, Q) {
200
200
  * @param cause The previous caught error that caused this one, if any.
201
201
  * @param name The name of the exception. Default is `"KeyException"`.
202
202
  */
203
- constructor(e, n, s = "KeyException") {
204
- super(e, n, s);
205
- a(this, H, "KeyException");
203
+ constructor(e, t, s = "KeyException") {
204
+ super(e, t, s);
205
+ a(this, K, "KeyException");
206
206
  }
207
207
  }
208
- var V, X;
209
- class nt extends (X = u, V = Symbol.toStringTag, X) {
208
+ var Q, X;
209
+ class ot extends (X = c, Q = Symbol.toStringTag, X) {
210
210
  /**
211
211
  * Initializes a new instance of the {@link NetworkException} class.
212
212
  *
@@ -223,13 +223,13 @@ class nt extends (X = u, V = Symbol.toStringTag, X) {
223
223
  * @param cause The previous caught error that caused this one, if any.
224
224
  * @param name The name of the exception. Default is `"NetworkException"`.
225
225
  */
226
- constructor(e, n, s = "NetworkException") {
227
- super(e, n, s);
228
- a(this, V, "NetworkException");
226
+ constructor(e, t, s = "NetworkException") {
227
+ super(e, t, s);
228
+ a(this, Q, "NetworkException");
229
229
  }
230
230
  }
231
231
  var Z, W;
232
- class st extends (W = u, Z = Symbol.toStringTag, W) {
232
+ class at extends (W = c, Z = Symbol.toStringTag, W) {
233
233
  /**
234
234
  * Initializes a new instance of the {@link PermissionException} class.
235
235
  *
@@ -246,13 +246,13 @@ class st extends (W = u, Z = Symbol.toStringTag, W) {
246
246
  * @param cause The previous caught error that caused this one, if any.
247
247
  * @param name The name of the exception. Default is `"PermissionException"`.
248
248
  */
249
- constructor(e, n, s = "PermissionException") {
250
- super(e, n, s);
249
+ constructor(e, t, s = "PermissionException") {
250
+ super(e, t, s);
251
251
  a(this, Z, "PermissionException");
252
252
  }
253
253
  }
254
254
  var U, ee;
255
- class C extends (ee = u, U = Symbol.toStringTag, ee) {
255
+ class C extends (ee = c, U = Symbol.toStringTag, ee) {
256
256
  /**
257
257
  * Initializes a new instance of the {@link ReferenceException} class.
258
258
  *
@@ -269,13 +269,13 @@ class C extends (ee = u, U = Symbol.toStringTag, ee) {
269
269
  * @param cause The previous caught error that caused this one, if any.
270
270
  * @param name The name of the exception. Default is `"ReferenceException"`.
271
271
  */
272
- constructor(e, n, s = "ReferenceException") {
273
- super(e, n, s);
272
+ constructor(e, t, s = "ReferenceException") {
273
+ super(e, t, s);
274
274
  a(this, U, "ReferenceException");
275
275
  }
276
276
  }
277
277
  var te, ne;
278
- class y extends (ne = u, te = Symbol.toStringTag, ne) {
278
+ class p extends (ne = c, te = Symbol.toStringTag, ne) {
279
279
  /**
280
280
  * Initializes a new instance of the {@link RuntimeException} class.
281
281
  *
@@ -292,13 +292,13 @@ class y extends (ne = u, te = Symbol.toStringTag, ne) {
292
292
  * @param cause The previous caught error that caused this one, if any.
293
293
  * @param name The name of the exception. Default is `"RuntimeException"`.
294
294
  */
295
- constructor(e, n, s = "RuntimeException") {
296
- super(e, n, s);
295
+ constructor(e, t, s = "RuntimeException") {
296
+ super(e, t, s);
297
297
  a(this, te, "RuntimeException");
298
298
  }
299
299
  }
300
300
  var se, re;
301
- class Je extends (re = y, se = Symbol.toStringTag, re) {
301
+ class Ge extends (re = p, se = Symbol.toStringTag, re) {
302
302
  /**
303
303
  * Initializes a new instance of the {@link EnvironmentException} class.
304
304
  *
@@ -315,13 +315,13 @@ class Je extends (re = y, se = Symbol.toStringTag, re) {
315
315
  * @param cause The previous caught error that caused this one, if any.
316
316
  * @param name The name of the exception. Default is `"EnvironmentException"`.
317
317
  */
318
- constructor(e, n, s = "EnvironmentException") {
319
- super(e, n, s);
318
+ constructor(e, t, s = "EnvironmentException") {
319
+ super(e, t, s);
320
320
  a(this, se, "EnvironmentException");
321
321
  }
322
322
  }
323
323
  var ie, oe;
324
- class Ye extends (oe = u, ie = Symbol.toStringTag, oe) {
324
+ class Ke extends (oe = c, ie = Symbol.toStringTag, oe) {
325
325
  /**
326
326
  * Initializes a new instance of the {@link TimeoutException} class.
327
327
  *
@@ -338,13 +338,13 @@ class Ye extends (oe = u, ie = Symbol.toStringTag, oe) {
338
338
  * @param cause The previous caught error that caused this one, if any.
339
339
  * @param name The name of the exception. Default is `"TimeoutException"`.
340
340
  */
341
- constructor(e, n, s = "TimeoutException") {
342
- super(e, n, s);
341
+ constructor(e, t, s = "TimeoutException") {
342
+ super(e, t, s);
343
343
  a(this, ie, "TimeoutException");
344
344
  }
345
345
  }
346
346
  var ae, le;
347
- class rt extends (le = u, ae = Symbol.toStringTag, le) {
347
+ class lt extends (le = c, ae = Symbol.toStringTag, le) {
348
348
  /**
349
349
  * Initializes a new instance of the {@link TypeException} class.
350
350
  *
@@ -361,13 +361,13 @@ class rt extends (le = u, ae = Symbol.toStringTag, le) {
361
361
  * @param cause The previous caught error that caused this one, if any.
362
362
  * @param name The name of the exception. Default is `"TypeException"`.
363
363
  */
364
- constructor(e, n, s = "TypeException") {
365
- super(e, n, s);
364
+ constructor(e, t, s = "TypeException") {
365
+ super(e, t, s);
366
366
  a(this, ae, "TypeException");
367
367
  }
368
368
  }
369
- var ce, ue;
370
- class d extends (ue = u, ce = Symbol.toStringTag, ue) {
369
+ var ue, ce;
370
+ class d extends (ce = c, ue = Symbol.toStringTag, ce) {
371
371
  /**
372
372
  * Initializes a new instance of the {@link ValueException} class.
373
373
  *
@@ -384,9 +384,9 @@ class d extends (ue = u, ce = Symbol.toStringTag, ue) {
384
384
  * @param cause The previous caught error that caused this one, if any.
385
385
  * @param name The name of the exception. Default is `"ValueException"`.
386
386
  */
387
- constructor(e, n, s = "ValueException") {
388
- super(e, n, s);
389
- a(this, ce, "ValueException");
387
+ constructor(e, t, s = "ValueException") {
388
+ super(e, t, s);
389
+ a(this, ue, "ValueException");
390
390
  }
391
391
  }
392
392
  var he, fe;
@@ -407,20 +407,20 @@ class b extends (fe = d, he = Symbol.toStringTag, fe) {
407
407
  * @param cause The previous caught error that caused this one, if any.
408
408
  * @param name The name of the exception. Default is `"RangeException"`.
409
409
  */
410
- constructor(e, n, s = "RangeException") {
411
- super(e, n, s);
410
+ constructor(e, t, s = "RangeException") {
411
+ super(e, t, s);
412
412
  a(this, he, "RangeException");
413
413
  }
414
414
  }
415
415
  var de;
416
- class c {
417
- constructor(t) {
416
+ class u {
417
+ constructor(n) {
418
418
  /**
419
419
  * The native {@link Iterator} object that is being wrapped by this instance.
420
420
  */
421
421
  a(this, "_iterator");
422
422
  a(this, de, "SmartIterator");
423
- t instanceof Function ? this._iterator = t() : Symbol.iterator in t ? this._iterator = t[Symbol.iterator]() : this._iterator = t;
423
+ n instanceof Function ? this._iterator = n() : Symbol.iterator in n ? this._iterator = n[Symbol.iterator]() : this._iterator = n;
424
424
  }
425
425
  /**
426
426
  * Determines whether all elements of the iterator satisfy a given condition.
@@ -451,13 +451,13 @@ class c {
451
451
  *
452
452
  * @returns `true` if all elements satisfy the condition, `false` otherwise.
453
453
  */
454
- every(t) {
454
+ every(n) {
455
455
  let e = 0;
456
456
  for (; ; ) {
457
- const n = this._iterator.next();
458
- if (n.done)
457
+ const t = this._iterator.next();
458
+ if (t.done)
459
459
  return !0;
460
- if (!t(n.value, e))
460
+ if (!n(t.value, e))
461
461
  return !1;
462
462
  e += 1;
463
463
  }
@@ -491,26 +491,26 @@ class c {
491
491
  *
492
492
  * @returns `true` if any element satisfies the condition, `false` otherwise.
493
493
  */
494
- some(t) {
494
+ some(n) {
495
495
  let e = 0;
496
496
  for (; ; ) {
497
- const n = this._iterator.next();
498
- if (n.done)
497
+ const t = this._iterator.next();
498
+ if (t.done)
499
499
  return !1;
500
- if (t(n.value, e))
500
+ if (n(t.value, e))
501
501
  return !0;
502
502
  e += 1;
503
503
  }
504
504
  }
505
- filter(t) {
505
+ filter(n) {
506
506
  const e = this._iterator;
507
- return new c(function* () {
508
- let n = 0;
507
+ return new u(function* () {
508
+ let t = 0;
509
509
  for (; ; ) {
510
510
  const s = e.next();
511
511
  if (s.done)
512
512
  return s.value;
513
- t(s.value, n) && (yield s.value), n += 1;
513
+ n(s.value, t) && (yield s.value), t += 1;
514
514
  }
515
515
  });
516
516
  }
@@ -545,31 +545,31 @@ class c {
545
545
  *
546
546
  * @returns A new {@link SmartIterator} containing the transformed elements.
547
547
  */
548
- map(t) {
548
+ map(n) {
549
549
  const e = this._iterator;
550
- return new c(function* () {
551
- let n = 0;
550
+ return new u(function* () {
551
+ let t = 0;
552
552
  for (; ; ) {
553
553
  const s = e.next();
554
554
  if (s.done)
555
555
  return s.value;
556
- yield t(s.value, n), n += 1;
556
+ yield n(s.value, t), t += 1;
557
557
  }
558
558
  });
559
559
  }
560
- reduce(t, e) {
561
- let n = 0, s = e;
560
+ reduce(n, e) {
561
+ let t = 0, s = e;
562
562
  if (s === void 0) {
563
563
  const r = this._iterator.next();
564
564
  if (r.done)
565
565
  throw new d("Cannot reduce an empty iterator without an initial value.");
566
- s = r.value, n += 1;
566
+ s = r.value, t += 1;
567
567
  }
568
568
  for (; ; ) {
569
569
  const r = this._iterator.next();
570
570
  if (r.done)
571
571
  return s;
572
- s = t(s, r.value, n), n += 1;
572
+ s = n(s, r.value, t), t += 1;
573
573
  }
574
574
  }
575
575
  /**
@@ -603,21 +603,21 @@ class c {
603
603
  *
604
604
  * @returns A new {@link SmartIterator} containing the flattened elements.
605
605
  */
606
- flatMap(t) {
606
+ flatMap(n) {
607
607
  const e = this._iterator;
608
- return new c(function* () {
609
- let n = 0;
608
+ return new u(function* () {
609
+ let t = 0;
610
610
  for (; ; ) {
611
611
  const s = e.next();
612
612
  if (s.done)
613
613
  return s.value;
614
- const r = t(s.value, n);
614
+ const r = n(s.value, t);
615
615
  if (r instanceof Array)
616
616
  for (const o of r)
617
617
  yield o;
618
618
  else
619
619
  yield r;
620
- n += 1;
620
+ t += 1;
621
621
  }
622
622
  });
623
623
  }
@@ -652,14 +652,14 @@ class c {
652
652
  *
653
653
  * @returns A new {@link SmartIterator} containing the remaining elements.
654
654
  */
655
- drop(t) {
655
+ drop(n) {
656
656
  const e = this._iterator;
657
- return new c(function* () {
658
- let n = 0;
659
- for (; n < t; ) {
657
+ return new u(function* () {
658
+ let t = 0;
659
+ for (; t < n; ) {
660
660
  if (e.next().done)
661
661
  return;
662
- n += 1;
662
+ t += 1;
663
663
  }
664
664
  for (; ; ) {
665
665
  const s = e.next();
@@ -701,26 +701,26 @@ class c {
701
701
  *
702
702
  * @returns A new {@link SmartIterator} containing the taken elements.
703
703
  */
704
- take(t) {
704
+ take(n) {
705
705
  const e = this._iterator;
706
- return new c(function* () {
707
- let n = 0;
708
- for (; n < t; ) {
706
+ return new u(function* () {
707
+ let t = 0;
708
+ for (; t < n; ) {
709
709
  const s = e.next();
710
710
  if (s.done)
711
711
  return s.value;
712
- yield s.value, n += 1;
712
+ yield s.value, t += 1;
713
713
  }
714
714
  });
715
715
  }
716
- find(t) {
716
+ find(n) {
717
717
  let e = 0;
718
718
  for (; ; ) {
719
- const n = this._iterator.next();
720
- if (n.done)
719
+ const t = this._iterator.next();
720
+ if (t.done)
721
721
  return;
722
- if (t(n.value, e))
723
- return n.value;
722
+ if (n(t.value, e))
723
+ return t.value;
724
724
  e += 1;
725
725
  }
726
726
  }
@@ -750,7 +750,7 @@ class c {
750
750
  * @returns A new {@link SmartIterator} containing the enumerated elements.
751
751
  */
752
752
  enumerate() {
753
- return this.map((t, e) => [e, t]);
753
+ return this.map((n, e) => [e, n]);
754
754
  }
755
755
  /**
756
756
  * Removes all duplicate elements from the iterator.
@@ -778,14 +778,14 @@ class c {
778
778
  * @returns A new {@link SmartIterator} containing only the unique elements.
779
779
  */
780
780
  unique() {
781
- const t = this._iterator;
782
- return new c(function* () {
781
+ const n = this._iterator;
782
+ return new u(function* () {
783
783
  const e = /* @__PURE__ */ new Set();
784
784
  for (; ; ) {
785
- const n = t.next();
786
- if (n.done)
787
- return n.value;
788
- e.has(n.value) || (e.add(n.value), yield n.value);
785
+ const t = n.next();
786
+ if (t.done)
787
+ return t.value;
788
+ e.has(t.value) || (e.add(t.value), yield t.value);
789
789
  }
790
790
  });
791
791
  }
@@ -810,11 +810,11 @@ class c {
810
810
  * @returns The number of elements in the iterator.
811
811
  */
812
812
  count() {
813
- let t = 0;
813
+ let n = 0;
814
814
  for (; ; ) {
815
815
  if (this._iterator.next().done)
816
- return t;
817
- t += 1;
816
+ return n;
817
+ n += 1;
818
818
  }
819
819
  }
820
820
  /**
@@ -839,13 +839,13 @@ class c {
839
839
  *
840
840
  * @param iteratee The function to apply to each element of the iterator.
841
841
  */
842
- forEach(t) {
842
+ forEach(n) {
843
843
  let e = 0;
844
844
  for (; ; ) {
845
- const n = this._iterator.next();
846
- if (n.done)
845
+ const t = this._iterator.next();
846
+ if (t.done)
847
847
  return;
848
- t(n.value, e), e += 1;
848
+ n(t.value, e), e += 1;
849
849
  }
850
850
  }
851
851
  /**
@@ -877,8 +877,8 @@ class c {
877
877
  *
878
878
  * @returns The result of the iteration, containing the value of the operation.
879
879
  */
880
- next(...t) {
881
- return this._iterator.next(...t);
880
+ next(...n) {
881
+ return this._iterator.next(...n);
882
882
  }
883
883
  /**
884
884
  * An utility method that may be used to close the iterator gracefully,
@@ -912,8 +912,8 @@ class c {
912
912
  *
913
913
  * @returns The result of the iterator.
914
914
  */
915
- return(t) {
916
- return this._iterator.return ? this._iterator.return(t) : { done: !0, value: t };
915
+ return(n) {
916
+ return this._iterator.return ? this._iterator.return(n) : { done: !0, value: n };
917
917
  }
918
918
  /**
919
919
  * An utility method that may be used to close the iterator due to an error,
@@ -956,10 +956,10 @@ class c {
956
956
  *
957
957
  * @returns The final result of the iterator.
958
958
  */
959
- throw(t) {
959
+ throw(n) {
960
960
  if (this._iterator.throw)
961
- return this._iterator.throw(t);
962
- throw t;
961
+ return this._iterator.throw(n);
962
+ throw n;
963
963
  }
964
964
  /**
965
965
  * An utility method that aggregates the elements of the iterator using a given key function.
@@ -991,8 +991,8 @@ class c {
991
991
  *
992
992
  * @returns A new instance of the {@link AggregatedIterator} class containing the grouped elements.
993
993
  */
994
- groupBy(t) {
995
- return new g(this.map((e, n) => [t(e, n), e]));
994
+ groupBy(n) {
995
+ return new x(this.map((e, t) => [n(e, t), e]));
996
996
  }
997
997
  /**
998
998
  * Materializes the iterator into an array.
@@ -1026,14 +1026,14 @@ class c {
1026
1026
  }
1027
1027
  var we;
1028
1028
  we = Symbol.toStringTag;
1029
- const p = class p {
1030
- constructor(t) {
1029
+ const _ = class _ {
1030
+ constructor(n) {
1031
1031
  /**
1032
1032
  * The internal {@link SmartIterator} object that holds the reduced elements.
1033
1033
  */
1034
1034
  a(this, "_elements");
1035
1035
  a(this, we, "ReducedIterator");
1036
- this._elements = new c(t);
1036
+ this._elements = new u(n);
1037
1037
  }
1038
1038
  /**
1039
1039
  * Determines whether all elements of the reduced iterator satisfy the given condition.
@@ -1066,9 +1066,9 @@ const p = class p {
1066
1066
  *
1067
1067
  * @returns `true` if all elements satisfy the condition, `false` otherwise.
1068
1068
  */
1069
- every(t) {
1070
- for (const [e, [n, s]] of this._elements.enumerate())
1071
- if (!t(n, s, e))
1069
+ every(n) {
1070
+ for (const [e, [t, s]] of this._elements.enumerate())
1071
+ if (!n(t, s, e))
1072
1072
  return !1;
1073
1073
  return !0;
1074
1074
  }
@@ -1103,17 +1103,17 @@ const p = class p {
1103
1103
  *
1104
1104
  * @returns `true` if any element satisfies the condition, `false` otherwise.
1105
1105
  */
1106
- some(t) {
1107
- for (const [e, [n, s]] of this._elements.enumerate())
1108
- if (t(n, s, e))
1106
+ some(n) {
1107
+ for (const [e, [t, s]] of this._elements.enumerate())
1108
+ if (n(t, s, e))
1109
1109
  return !0;
1110
1110
  return !1;
1111
1111
  }
1112
- filter(t) {
1112
+ filter(n) {
1113
1113
  const e = this._elements.enumerate();
1114
- return new p(function* () {
1115
- for (const [n, [s, r]] of e)
1116
- t(s, r, n) && (yield [s, r]);
1114
+ return new _(function* () {
1115
+ for (const [t, [s, r]] of e)
1116
+ n(s, r, t) && (yield [s, r]);
1117
1117
  });
1118
1118
  }
1119
1119
  /**
@@ -1149,23 +1149,23 @@ const p = class p {
1149
1149
  *
1150
1150
  * @returns A new {@link ReducedIterator} containing the transformed elements.
1151
1151
  */
1152
- map(t) {
1152
+ map(n) {
1153
1153
  const e = this._elements.enumerate();
1154
- return new p(function* () {
1155
- for (const [n, [s, r]] of e)
1156
- yield [s, t(s, r, n)];
1154
+ return new _(function* () {
1155
+ for (const [t, [s, r]] of e)
1156
+ yield [s, n(s, r, t)];
1157
1157
  });
1158
1158
  }
1159
- reduce(t, e) {
1160
- let n = 0, s = e;
1159
+ reduce(n, e) {
1160
+ let t = 0, s = e;
1161
1161
  if (s === void 0) {
1162
1162
  const r = this._elements.next();
1163
1163
  if (r.done)
1164
1164
  throw new d("Cannot reduce an empty iterator without an initial value.");
1165
- s = r.value[1], n += 1;
1165
+ s = r.value[1], t += 1;
1166
1166
  }
1167
1167
  for (const [r, o] of this._elements)
1168
- s = t(r, s, o, n), n += 1;
1168
+ s = n(r, s, o, t), t += 1;
1169
1169
  return s;
1170
1170
  }
1171
1171
  /**
@@ -1201,11 +1201,11 @@ const p = class p {
1201
1201
  *
1202
1202
  * @returns A new {@link AggregatedIterator} containing the flattened elements.
1203
1203
  */
1204
- flatMap(t) {
1204
+ flatMap(n) {
1205
1205
  const e = this._elements.enumerate();
1206
- return new g(function* () {
1207
- for (const [n, [s, r]] of e) {
1208
- const o = t(s, r, n);
1206
+ return new x(function* () {
1207
+ for (const [t, [s, r]] of e) {
1208
+ const o = n(s, r, t);
1209
1209
  if (o instanceof Array)
1210
1210
  for (const l of o)
1211
1211
  yield [s, l];
@@ -1247,11 +1247,11 @@ const p = class p {
1247
1247
  *
1248
1248
  * @returns A new {@link ReducedIterator} containing the remaining elements.
1249
1249
  */
1250
- drop(t) {
1250
+ drop(n) {
1251
1251
  const e = this._elements.enumerate();
1252
- return new p(function* () {
1253
- for (const [n, [s, r]] of e)
1254
- n >= t && (yield [s, r]);
1252
+ return new _(function* () {
1253
+ for (const [t, [s, r]] of e)
1254
+ t >= n && (yield [s, r]);
1255
1255
  });
1256
1256
  }
1257
1257
  /**
@@ -1289,19 +1289,19 @@ const p = class p {
1289
1289
  *
1290
1290
  * @returns A new {@link ReducedIterator} containing the taken elements.
1291
1291
  */
1292
- take(t) {
1292
+ take(n) {
1293
1293
  const e = this._elements.enumerate();
1294
- return new p(function* () {
1295
- for (const [n, [s, r]] of e) {
1296
- if (n >= t)
1294
+ return new _(function* () {
1295
+ for (const [t, [s, r]] of e) {
1296
+ if (t >= n)
1297
1297
  break;
1298
1298
  yield [s, r];
1299
1299
  }
1300
1300
  });
1301
1301
  }
1302
- find(t) {
1303
- for (const [e, [n, s]] of this._elements.enumerate())
1304
- if (t(n, s, e))
1302
+ find(n) {
1303
+ for (const [e, [t, s]] of this._elements.enumerate())
1304
+ if (n(t, s, e))
1305
1305
  return s;
1306
1306
  }
1307
1307
  /**
@@ -1332,7 +1332,7 @@ const p = class p {
1332
1332
  * @returns A new {@link ReducedIterator} object containing the enumerated elements.
1333
1333
  */
1334
1334
  enumerate() {
1335
- return this.map((t, e, n) => [n, e]);
1335
+ return this.map((n, e, t) => [t, e]);
1336
1336
  }
1337
1337
  /**
1338
1338
  * Removes all duplicate elements from the reduced iterator.
@@ -1360,11 +1360,11 @@ const p = class p {
1360
1360
  * @returns A new {@link ReducedIterator} containing only the unique elements.
1361
1361
  */
1362
1362
  unique() {
1363
- const t = this._elements;
1364
- return new p(function* () {
1363
+ const n = this._elements;
1364
+ return new _(function* () {
1365
1365
  const e = /* @__PURE__ */ new Set();
1366
- for (const [n, s] of t)
1367
- e.has(s) || (e.add(s), yield [n, s]);
1366
+ for (const [t, s] of n)
1367
+ e.has(s) || (e.add(s), yield [t, s]);
1368
1368
  });
1369
1369
  }
1370
1370
  /**
@@ -1390,10 +1390,10 @@ const p = class p {
1390
1390
  * @returns The number of elements in the iterator.
1391
1391
  */
1392
1392
  count() {
1393
- let t = 0;
1393
+ let n = 0;
1394
1394
  for (const e of this._elements)
1395
- t += 1;
1396
- return t;
1395
+ n += 1;
1396
+ return n;
1397
1397
  }
1398
1398
  /**
1399
1399
  * Iterates over all elements of the reduced iterator.
@@ -1420,9 +1420,9 @@ const p = class p {
1420
1420
  *
1421
1421
  * @param iteratee The function to apply to each element of the reduced iterator.
1422
1422
  */
1423
- forEach(t) {
1424
- for (const [e, [n, s]] of this._elements.enumerate())
1425
- t(n, s, e);
1423
+ forEach(n) {
1424
+ for (const [e, [t, s]] of this._elements.enumerate())
1425
+ n(t, s, e);
1426
1426
  }
1427
1427
  /**
1428
1428
  * Reaggregates the elements of the reduced iterator.
@@ -1455,11 +1455,11 @@ const p = class p {
1455
1455
  *
1456
1456
  * @returns A new {@link AggregatedIterator} containing the elements reorganized by the new keys.
1457
1457
  */
1458
- reorganizeBy(t) {
1458
+ reorganizeBy(n) {
1459
1459
  const e = this._elements.enumerate();
1460
- return new g(function* () {
1461
- for (const [n, [s, r]] of e)
1462
- yield [t(s, r, n), r];
1460
+ return new x(function* () {
1461
+ for (const [t, [s, r]] of e)
1462
+ yield [n(s, r, t), r];
1463
1463
  });
1464
1464
  }
1465
1465
  /**
@@ -1490,9 +1490,9 @@ const p = class p {
1490
1490
  * @returns A new {@link SmartIterator} containing all the keys of the iterator.
1491
1491
  */
1492
1492
  keys() {
1493
- const t = this._elements;
1494
- return new c(function* () {
1495
- for (const [e] of t)
1493
+ const n = this._elements;
1494
+ return new u(function* () {
1495
+ for (const [e] of n)
1496
1496
  yield e;
1497
1497
  });
1498
1498
  }
@@ -1555,10 +1555,10 @@ const p = class p {
1555
1555
  * @returns A new {@link SmartIterator} containing all the values of the iterator.
1556
1556
  */
1557
1557
  values() {
1558
- const t = this._elements;
1559
- return new c(function* () {
1560
- for (const [e, n] of t)
1561
- yield n;
1558
+ const n = this._elements;
1559
+ return new u(function* () {
1560
+ for (const [e, t] of n)
1561
+ yield t;
1562
1562
  });
1563
1563
  }
1564
1564
  /**
@@ -1634,17 +1634,17 @@ const p = class p {
1634
1634
  return Object.fromEntries(this.entries());
1635
1635
  }
1636
1636
  };
1637
- let h = p;
1637
+ let h = _;
1638
1638
  var me;
1639
1639
  me = Symbol.toStringTag;
1640
1640
  const w = class w {
1641
- constructor(t) {
1641
+ constructor(n) {
1642
1642
  /**
1643
1643
  * The internal {@link SmartAsyncIterator} object that holds the elements to aggregate.
1644
1644
  */
1645
1645
  a(this, "_elements");
1646
1646
  a(this, me, "AggregatedAsyncIterator");
1647
- this._elements = new f(t);
1647
+ this._elements = new f(n);
1648
1648
  }
1649
1649
  /**
1650
1650
  * Determines whether all elements of each group of the iterator satisfy a given condition.
@@ -1677,15 +1677,15 @@ const w = class w {
1677
1677
  * @returns
1678
1678
  * A {@link Promise} resolving to a new {@link ReducedIterator} containing the boolean results for each group.
1679
1679
  */
1680
- async every(t) {
1680
+ async every(n) {
1681
1681
  const e = /* @__PURE__ */ new Map();
1682
- for await (const [n, s] of this._elements) {
1683
- const [r, o] = e.get(n) ?? [0, !0];
1684
- o && e.set(n, [r + 1, await t(n, s, r)]);
1682
+ for await (const [t, s] of this._elements) {
1683
+ const [r, o] = e.get(t) ?? [0, !0];
1684
+ o && e.set(t, [r + 1, await n(t, s, r)]);
1685
1685
  }
1686
1686
  return new h(function* () {
1687
- for (const [n, [s, r]] of e)
1688
- yield [n, r];
1687
+ for (const [t, [s, r]] of e)
1688
+ yield [t, r];
1689
1689
  });
1690
1690
  }
1691
1691
  /**
@@ -1719,24 +1719,24 @@ const w = class w {
1719
1719
  * @returns
1720
1720
  * A {@link Promise} resolving to a new {@link ReducedIterator} containing the boolean results for each group.
1721
1721
  */
1722
- async some(t) {
1722
+ async some(n) {
1723
1723
  const e = /* @__PURE__ */ new Map();
1724
- for await (const [n, s] of this._elements) {
1725
- const [r, o] = e.get(n) ?? [0, !1];
1726
- o || e.set(n, [r + 1, await t(n, s, r)]);
1724
+ for await (const [t, s] of this._elements) {
1725
+ const [r, o] = e.get(t) ?? [0, !1];
1726
+ o || e.set(t, [r + 1, await n(t, s, r)]);
1727
1727
  }
1728
1728
  return new h(function* () {
1729
- for (const [n, [s, r]] of e)
1730
- yield [n, r];
1729
+ for (const [t, [s, r]] of e)
1730
+ yield [t, r];
1731
1731
  });
1732
1732
  }
1733
- filter(t) {
1733
+ filter(n) {
1734
1734
  const e = this._elements;
1735
1735
  return new w(async function* () {
1736
- const n = /* @__PURE__ */ new Map();
1736
+ const t = /* @__PURE__ */ new Map();
1737
1737
  for await (const [s, r] of e) {
1738
- const o = n.get(s) ?? 0;
1739
- await t(s, r, o) && (yield [s, r]), n.set(s, o + 1);
1738
+ const o = t.get(s) ?? 0;
1739
+ await n(s, r, o) && (yield [s, r]), t.set(s, o + 1);
1740
1740
  }
1741
1741
  });
1742
1742
  }
@@ -1772,32 +1772,32 @@ const w = class w {
1772
1772
  *
1773
1773
  * @returns A new {@link AggregatedAsyncIterator} containing the transformed elements.
1774
1774
  */
1775
- map(t) {
1775
+ map(n) {
1776
1776
  const e = this._elements;
1777
1777
  return new w(async function* () {
1778
- const n = /* @__PURE__ */ new Map();
1778
+ const t = /* @__PURE__ */ new Map();
1779
1779
  for await (const [s, r] of e) {
1780
- const o = n.get(s) ?? 0;
1781
- yield [s, await t(s, r, o)], n.set(s, o + 1);
1780
+ const o = t.get(s) ?? 0;
1781
+ yield [s, await n(s, r, o)], t.set(s, o + 1);
1782
1782
  }
1783
1783
  });
1784
1784
  }
1785
- async reduce(t, e) {
1786
- const n = /* @__PURE__ */ new Map();
1785
+ async reduce(n, e) {
1786
+ const t = /* @__PURE__ */ new Map();
1787
1787
  for await (const [s, r] of this._elements) {
1788
1788
  let o, l;
1789
- if (n.has(s))
1790
- [o, l] = n.get(s);
1789
+ if (t.has(s))
1790
+ [o, l] = t.get(s);
1791
1791
  else if (e !== void 0)
1792
1792
  o = 0, e instanceof Function ? l = await e(s) : l = await e;
1793
1793
  else {
1794
- n.set(s, [0, r]);
1794
+ t.set(s, [0, r]);
1795
1795
  continue;
1796
1796
  }
1797
- n.set(s, [o + 1, await t(s, l, r, o)]);
1797
+ t.set(s, [o + 1, await n(s, l, r, o)]);
1798
1798
  }
1799
1799
  return new h(function* () {
1800
- for (const [s, [r, o]] of n)
1800
+ for (const [s, [r, o]] of t)
1801
1801
  yield [s, o];
1802
1802
  });
1803
1803
  }
@@ -1837,18 +1837,18 @@ const w = class w {
1837
1837
  *
1838
1838
  * @returns A new {@link AggregatedAsyncIterator} containing the transformed elements.
1839
1839
  */
1840
- flatMap(t) {
1840
+ flatMap(n) {
1841
1841
  const e = this._elements;
1842
1842
  return new w(async function* () {
1843
- const n = /* @__PURE__ */ new Map();
1843
+ const t = /* @__PURE__ */ new Map();
1844
1844
  for await (const [s, r] of e) {
1845
- const o = n.get(s) ?? 0, l = await t(s, r, o);
1845
+ const o = t.get(s) ?? 0, l = await n(s, r, o);
1846
1846
  if (l instanceof Array)
1847
- for (const v of l)
1848
- yield [s, v];
1847
+ for (const k of l)
1848
+ yield [s, k];
1849
1849
  else
1850
1850
  yield [s, l];
1851
- n.set(s, o + 1);
1851
+ t.set(s, o + 1);
1852
1852
  }
1853
1853
  });
1854
1854
  }
@@ -1881,14 +1881,14 @@ const w = class w {
1881
1881
  *
1882
1882
  * @returns A new {@link AggregatedAsyncIterator} containing the remaining elements.
1883
1883
  */
1884
- drop(t) {
1884
+ drop(n) {
1885
1885
  const e = this._elements;
1886
1886
  return new w(async function* () {
1887
- const n = /* @__PURE__ */ new Map();
1887
+ const t = /* @__PURE__ */ new Map();
1888
1888
  for await (const [s, r] of e) {
1889
- const o = n.get(s) ?? 0;
1890
- if (o < t) {
1891
- n.set(s, o + 1);
1889
+ const o = t.get(s) ?? 0;
1890
+ if (o < n) {
1891
+ t.set(s, o + 1);
1892
1892
  continue;
1893
1893
  }
1894
1894
  yield [s, r];
@@ -1924,25 +1924,25 @@ const w = class w {
1924
1924
  *
1925
1925
  * @returns A new {@link AggregatedAsyncIterator} containing the taken elements.
1926
1926
  */
1927
- take(t) {
1927
+ take(n) {
1928
1928
  const e = this._elements;
1929
1929
  return new w(async function* () {
1930
- const n = /* @__PURE__ */ new Map();
1930
+ const t = /* @__PURE__ */ new Map();
1931
1931
  for await (const [s, r] of e) {
1932
- const o = n.get(s) ?? 0;
1933
- o >= t || (yield [s, r], n.set(s, o + 1));
1932
+ const o = t.get(s) ?? 0;
1933
+ o >= n || (yield [s, r], t.set(s, o + 1));
1934
1934
  }
1935
1935
  });
1936
1936
  }
1937
- async find(t) {
1937
+ async find(n) {
1938
1938
  const e = /* @__PURE__ */ new Map();
1939
- for await (const [n, s] of this._elements) {
1940
- let [r, o] = e.get(n) ?? [0, void 0];
1941
- o === void 0 && (await t(n, s, r) && (o = s), e.set(n, [r + 1, o]));
1939
+ for await (const [t, s] of this._elements) {
1940
+ let [r, o] = e.get(t) ?? [0, void 0];
1941
+ o === void 0 && (await n(t, s, r) && (o = s), e.set(t, [r + 1, o]));
1942
1942
  }
1943
1943
  return new h(function* () {
1944
- for (const [n, [s, r]] of e)
1945
- yield [n, r];
1944
+ for (const [t, [s, r]] of e)
1945
+ yield [t, r];
1946
1946
  });
1947
1947
  }
1948
1948
  /**
@@ -1972,7 +1972,7 @@ const w = class w {
1972
1972
  * @returns A new {@link AggregatedAsyncIterator} containing the enumerated elements.
1973
1973
  */
1974
1974
  enumerate() {
1975
- return this.map((t, e, n) => [n, e]);
1975
+ return this.map((n, e, t) => [t, e]);
1976
1976
  }
1977
1977
  /**
1978
1978
  * Removes all duplicate elements from within each group of the iterator.
@@ -2001,12 +2001,12 @@ const w = class w {
2001
2001
  * @returns A new {@link AggregatedAsyncIterator} containing only the unique elements.
2002
2002
  */
2003
2003
  unique() {
2004
- const t = this._elements;
2004
+ const n = this._elements;
2005
2005
  return new w(async function* () {
2006
2006
  const e = /* @__PURE__ */ new Map();
2007
- for await (const [n, s] of t) {
2008
- const r = e.get(n) ?? /* @__PURE__ */ new Set();
2009
- r.has(s) || (r.add(s), e.set(n, r), yield [n, s]);
2007
+ for await (const [t, s] of n) {
2008
+ const r = e.get(t) ?? /* @__PURE__ */ new Set();
2009
+ r.has(s) || (r.add(s), e.set(t, r), yield [t, s]);
2010
2010
  }
2011
2011
  });
2012
2012
  }
@@ -2033,14 +2033,14 @@ const w = class w {
2033
2033
  * A {@link Promise} resolving to a new {@link ReducedIterator} containing the number of elements for each group.
2034
2034
  */
2035
2035
  async count() {
2036
- const t = /* @__PURE__ */ new Map();
2036
+ const n = /* @__PURE__ */ new Map();
2037
2037
  for await (const [e] of this._elements) {
2038
- const n = t.get(e) ?? 0;
2039
- t.set(e, n + 1);
2038
+ const t = n.get(e) ?? 0;
2039
+ n.set(e, t + 1);
2040
2040
  }
2041
2041
  return new h(function* () {
2042
- for (const [e, n] of t)
2043
- yield [e, n];
2042
+ for (const [e, t] of n)
2043
+ yield [e, t];
2044
2044
  });
2045
2045
  }
2046
2046
  /**
@@ -2069,11 +2069,11 @@ const w = class w {
2069
2069
  *
2070
2070
  * @returns A {@link Promise} that will resolve once the iteration is complete.
2071
2071
  */
2072
- async forEach(t) {
2072
+ async forEach(n) {
2073
2073
  const e = /* @__PURE__ */ new Map();
2074
- for await (const [n, s] of this._elements) {
2075
- const r = e.get(n) ?? 0;
2076
- await t(n, s, r), e.set(n, r + 1);
2074
+ for await (const [t, s] of this._elements) {
2075
+ const r = e.get(t) ?? 0;
2076
+ await n(t, s, r), e.set(t, r + 1);
2077
2077
  }
2078
2078
  }
2079
2079
  /**
@@ -2107,13 +2107,13 @@ const w = class w {
2107
2107
  *
2108
2108
  * @returns A new {@link AggregatedAsyncIterator} containing the elements reorganized by the new keys.
2109
2109
  */
2110
- reorganizeBy(t) {
2110
+ reorganizeBy(n) {
2111
2111
  const e = this._elements;
2112
2112
  return new w(async function* () {
2113
- const n = /* @__PURE__ */ new Map();
2113
+ const t = /* @__PURE__ */ new Map();
2114
2114
  for await (const [s, r] of e) {
2115
- const o = n.get(s) ?? 0;
2116
- yield [await t(s, r, o), r], n.set(s, o + 1);
2115
+ const o = t.get(s) ?? 0;
2116
+ yield [await n(s, r, o), r], t.set(s, o + 1);
2117
2117
  }
2118
2118
  });
2119
2119
  }
@@ -2144,11 +2144,11 @@ const w = class w {
2144
2144
  * @returns A new {@link SmartAsyncIterator} containing all the keys of the iterator.
2145
2145
  */
2146
2146
  keys() {
2147
- const t = this._elements;
2147
+ const n = this._elements;
2148
2148
  return new f(async function* () {
2149
2149
  const e = /* @__PURE__ */ new Set();
2150
- for await (const [n] of t)
2151
- e.has(n) || (e.add(n), yield n);
2150
+ for await (const [t] of n)
2151
+ e.has(t) || (e.add(t), yield t);
2152
2152
  });
2153
2153
  }
2154
2154
  /**
@@ -2208,10 +2208,10 @@ const w = class w {
2208
2208
  * @returns A new {@link SmartAsyncIterator} containing all the values of the iterator.
2209
2209
  */
2210
2210
  values() {
2211
- const t = this._elements;
2211
+ const n = this._elements;
2212
2212
  return new f(async function* () {
2213
- for await (const [e, n] of t)
2214
- yield n;
2213
+ for await (const [e, t] of n)
2214
+ yield t;
2215
2215
  });
2216
2216
  }
2217
2217
  /**
@@ -2235,8 +2235,8 @@ const w = class w {
2235
2235
  * @returns A {@link Promise} resolving to an {@link Array} containing all the values of the iterator.
2236
2236
  */
2237
2237
  async toArray() {
2238
- const t = await this.toMap();
2239
- return Array.from(t.values());
2238
+ const n = await this.toMap();
2239
+ return Array.from(n.values());
2240
2240
  }
2241
2241
  /**
2242
2242
  * Materializes the iterator into a map.
@@ -2259,12 +2259,12 @@ const w = class w {
2259
2259
  * @returns A {@link Promise} resolving to a {@link Map} containing all the entries of the iterator.
2260
2260
  */
2261
2261
  async toMap() {
2262
- const t = /* @__PURE__ */ new Map();
2263
- for await (const [e, n] of this._elements) {
2264
- const s = t.get(e) ?? [];
2265
- s.push(n), t.set(e, s);
2262
+ const n = /* @__PURE__ */ new Map();
2263
+ for await (const [e, t] of this._elements) {
2264
+ const s = n.get(e) ?? [];
2265
+ s.push(t), n.set(e, s);
2266
2266
  }
2267
- return t;
2267
+ return n;
2268
2268
  }
2269
2269
  /**
2270
2270
  * Materializes the iterator into an object.
@@ -2287,54 +2287,54 @@ const w = class w {
2287
2287
  * @returns A {@link Promise} resolving to an object containing all the entries of the iterator.
2288
2288
  */
2289
2289
  async toObject() {
2290
- const t = {};
2291
- for await (const [e, n] of this._elements) {
2292
- const s = t[e] ?? [];
2293
- s.push(n), t[e] = s;
2290
+ const n = {};
2291
+ for await (const [e, t] of this._elements) {
2292
+ const s = n[e] ?? [];
2293
+ s.push(t), n[e] = s;
2294
2294
  }
2295
- return t;
2295
+ return n;
2296
2296
  }
2297
2297
  };
2298
- let T = w;
2299
- var ye;
2298
+ let E = w;
2299
+ var pe;
2300
2300
  class f {
2301
- constructor(t) {
2301
+ constructor(n) {
2302
2302
  /**
2303
2303
  * The native {@link AsyncIterator} object that is being wrapped by this instance.
2304
2304
  */
2305
2305
  a(this, "_iterator");
2306
- a(this, ye, "SmartAsyncIterator");
2307
- if (t instanceof Function) {
2308
- const e = t();
2306
+ a(this, pe, "SmartAsyncIterator");
2307
+ if (n instanceof Function) {
2308
+ const e = n();
2309
2309
  Symbol.asyncIterator in e ? this._iterator = e : this._iterator = async function* () {
2310
- let n = [];
2310
+ let t = [];
2311
2311
  for (; ; ) {
2312
- const s = e.next(...n);
2312
+ const s = e.next(...t);
2313
2313
  if (s.done)
2314
2314
  return s.value;
2315
- n = [yield s.value];
2315
+ t = [yield s.value];
2316
2316
  }
2317
2317
  }();
2318
- } else if (Symbol.asyncIterator in t)
2319
- this._iterator = t[Symbol.asyncIterator]();
2320
- else if (Symbol.iterator in t) {
2321
- const e = t[Symbol.iterator]();
2318
+ } else if (Symbol.asyncIterator in n)
2319
+ this._iterator = n[Symbol.asyncIterator]();
2320
+ else if (Symbol.iterator in n) {
2321
+ const e = n[Symbol.iterator]();
2322
2322
  this._iterator = async function* () {
2323
2323
  for (; ; ) {
2324
- const n = e.next();
2325
- if (n.done)
2326
- return n.value;
2327
- yield n.value;
2324
+ const t = e.next();
2325
+ if (t.done)
2326
+ return t.value;
2327
+ yield t.value;
2328
2328
  }
2329
2329
  }();
2330
2330
  } else
2331
2331
  this._iterator = async function* () {
2332
2332
  let e = [];
2333
2333
  for (; ; ) {
2334
- const n = await t.next(...e);
2335
- if (n.done)
2336
- return n.value;
2337
- e = [yield n.value];
2334
+ const t = await n.next(...e);
2335
+ if (t.done)
2336
+ return t.value;
2337
+ e = [yield t.value];
2338
2338
  }
2339
2339
  }();
2340
2340
  }
@@ -2368,13 +2368,13 @@ class f {
2368
2368
  * @returns
2369
2369
  * A {@link Promise} that will resolve to `true` if all elements satisfy the condition, `false` otherwise.
2370
2370
  */
2371
- async every(t) {
2371
+ async every(n) {
2372
2372
  let e = 0;
2373
2373
  for (; ; ) {
2374
- const n = await this._iterator.next();
2375
- if (n.done)
2374
+ const t = await this._iterator.next();
2375
+ if (t.done)
2376
2376
  return !0;
2377
- if (!await t(n.value, e))
2377
+ if (!await n(t.value, e))
2378
2378
  return !1;
2379
2379
  e += 1;
2380
2380
  }
@@ -2409,26 +2409,26 @@ class f {
2409
2409
  * @returns
2410
2410
  * A {@link Promise} that will resolve to `true` if any element satisfies the condition, `false` otherwise.
2411
2411
  */
2412
- async some(t) {
2412
+ async some(n) {
2413
2413
  let e = 0;
2414
2414
  for (; ; ) {
2415
- const n = await this._iterator.next();
2416
- if (n.done)
2415
+ const t = await this._iterator.next();
2416
+ if (t.done)
2417
2417
  return !1;
2418
- if (await t(n.value, e))
2418
+ if (await n(t.value, e))
2419
2419
  return !0;
2420
2420
  e += 1;
2421
2421
  }
2422
2422
  }
2423
- filter(t) {
2423
+ filter(n) {
2424
2424
  const e = this._iterator;
2425
2425
  return new f(async function* () {
2426
- let n = 0;
2426
+ let t = 0;
2427
2427
  for (; ; ) {
2428
2428
  const s = await e.next();
2429
2429
  if (s.done)
2430
2430
  return s.value;
2431
- await t(s.value, n) && (yield s.value), n += 1;
2431
+ await n(s.value, t) && (yield s.value), t += 1;
2432
2432
  }
2433
2433
  });
2434
2434
  }
@@ -2463,31 +2463,31 @@ class f {
2463
2463
  *
2464
2464
  * @returns A new {@link SmartAsyncIterator} containing the transformed elements.
2465
2465
  */
2466
- map(t) {
2466
+ map(n) {
2467
2467
  const e = this._iterator;
2468
2468
  return new f(async function* () {
2469
- let n = 0;
2469
+ let t = 0;
2470
2470
  for (; ; ) {
2471
2471
  const s = await e.next();
2472
2472
  if (s.done)
2473
2473
  return s.value;
2474
- yield await t(s.value, n), n += 1;
2474
+ yield await n(s.value, t), t += 1;
2475
2475
  }
2476
2476
  });
2477
2477
  }
2478
- async reduce(t, e) {
2479
- let n = 0, s = e;
2478
+ async reduce(n, e) {
2479
+ let t = 0, s = e;
2480
2480
  if (s === void 0) {
2481
2481
  const r = await this._iterator.next();
2482
2482
  if (r.done)
2483
2483
  throw new d("Cannot reduce an empty iterator without an initial value.");
2484
- s = r.value, n += 1;
2484
+ s = r.value, t += 1;
2485
2485
  }
2486
2486
  for (; ; ) {
2487
2487
  const r = await this._iterator.next();
2488
2488
  if (r.done)
2489
2489
  return s;
2490
- s = await t(s, r.value, n), n += 1;
2490
+ s = await n(s, r.value, t), t += 1;
2491
2491
  }
2492
2492
  }
2493
2493
  /**
@@ -2521,21 +2521,21 @@ class f {
2521
2521
  *
2522
2522
  * @returns A new {@link SmartAsyncIterator} containing the flattened elements.
2523
2523
  */
2524
- flatMap(t) {
2524
+ flatMap(n) {
2525
2525
  const e = this._iterator;
2526
2526
  return new f(async function* () {
2527
- let n = 0;
2527
+ let t = 0;
2528
2528
  for (; ; ) {
2529
2529
  const s = await e.next();
2530
2530
  if (s.done)
2531
2531
  return s.value;
2532
- const r = await t(s.value, n);
2532
+ const r = await n(s.value, t);
2533
2533
  if (r instanceof Array)
2534
2534
  for (const o of r)
2535
2535
  yield o;
2536
2536
  else
2537
2537
  yield r;
2538
- n += 1;
2538
+ t += 1;
2539
2539
  }
2540
2540
  });
2541
2541
  }
@@ -2570,14 +2570,14 @@ class f {
2570
2570
  *
2571
2571
  * @returns A new {@link SmartAsyncIterator} containing the remaining elements.
2572
2572
  */
2573
- drop(t) {
2573
+ drop(n) {
2574
2574
  const e = this._iterator;
2575
2575
  return new f(async function* () {
2576
- let n = 0;
2577
- for (; n < t; ) {
2576
+ let t = 0;
2577
+ for (; t < n; ) {
2578
2578
  if ((await e.next()).done)
2579
2579
  return;
2580
- n += 1;
2580
+ t += 1;
2581
2581
  }
2582
2582
  for (; ; ) {
2583
2583
  const s = await e.next();
@@ -2619,26 +2619,26 @@ class f {
2619
2619
  *
2620
2620
  * @returns A new {@link SmartAsyncIterator} containing the taken elements.
2621
2621
  */
2622
- take(t) {
2622
+ take(n) {
2623
2623
  const e = this._iterator;
2624
2624
  return new f(async function* () {
2625
- let n = 0;
2626
- for (; n < t; ) {
2625
+ let t = 0;
2626
+ for (; t < n; ) {
2627
2627
  const s = await e.next();
2628
2628
  if (s.done)
2629
2629
  return s.value;
2630
- yield s.value, n += 1;
2630
+ yield s.value, t += 1;
2631
2631
  }
2632
2632
  });
2633
2633
  }
2634
- async find(t) {
2634
+ async find(n) {
2635
2635
  let e = 0;
2636
2636
  for (; ; ) {
2637
- const n = await this._iterator.next();
2638
- if (n.done)
2637
+ const t = await this._iterator.next();
2638
+ if (t.done)
2639
2639
  return;
2640
- if (await t(n.value, e))
2641
- return n.value;
2640
+ if (await n(t.value, e))
2641
+ return t.value;
2642
2642
  e += 1;
2643
2643
  }
2644
2644
  }
@@ -2671,7 +2671,7 @@ class f {
2671
2671
  * @returns A new {@link SmartAsyncIterator} containing the enumerated elements.
2672
2672
  */
2673
2673
  enumerate() {
2674
- return this.map((t, e) => [e, t]);
2674
+ return this.map((n, e) => [e, n]);
2675
2675
  }
2676
2676
  /**
2677
2677
  * Removes all duplicate elements from the iterator.
@@ -2699,14 +2699,14 @@ class f {
2699
2699
  * @returns A new {@link SmartAsyncIterator} containing only the unique elements.
2700
2700
  */
2701
2701
  unique() {
2702
- const t = this._iterator;
2702
+ const n = this._iterator;
2703
2703
  return new f(async function* () {
2704
2704
  const e = /* @__PURE__ */ new Set();
2705
2705
  for (; ; ) {
2706
- const n = await t.next();
2707
- if (n.done)
2708
- return n.value;
2709
- e.has(n.value) || (e.add(n.value), yield n.value);
2706
+ const t = await n.next();
2707
+ if (t.done)
2708
+ return t.value;
2709
+ e.has(t.value) || (e.add(t.value), yield t.value);
2710
2710
  }
2711
2711
  });
2712
2712
  }
@@ -2731,11 +2731,11 @@ class f {
2731
2731
  * @returns A {@link Promise} that will resolve to the number of elements in the iterator.
2732
2732
  */
2733
2733
  async count() {
2734
- let t = 0;
2734
+ let n = 0;
2735
2735
  for (; ; ) {
2736
2736
  if ((await this._iterator.next()).done)
2737
- return t;
2738
- t += 1;
2737
+ return n;
2738
+ n += 1;
2739
2739
  }
2740
2740
  }
2741
2741
  /**
@@ -2762,13 +2762,13 @@ class f {
2762
2762
  *
2763
2763
  * @returns A {@link Promise} that will resolve once the iteration is complete.
2764
2764
  */
2765
- async forEach(t) {
2765
+ async forEach(n) {
2766
2766
  let e = 0;
2767
2767
  for (; ; ) {
2768
- const n = await this._iterator.next();
2769
- if (n.done)
2768
+ const t = await this._iterator.next();
2769
+ if (t.done)
2770
2770
  return;
2771
- await t(n.value, e), e += 1;
2771
+ await n(t.value, e), e += 1;
2772
2772
  }
2773
2773
  }
2774
2774
  /**
@@ -2801,8 +2801,8 @@ class f {
2801
2801
  * @returns
2802
2802
  * A {@link Promise} that will resolve to the result of the iteration, containing the value of the operation.
2803
2803
  */
2804
- next(...t) {
2805
- return this._iterator.next(...t);
2804
+ next(...n) {
2805
+ return this._iterator.next(...n);
2806
2806
  }
2807
2807
  /**
2808
2808
  * An utility method that may be used to close the iterator gracefully,
@@ -2836,8 +2836,8 @@ class f {
2836
2836
  *
2837
2837
  * @returns A {@link Promise} that will resolve to the final result of the iterator.
2838
2838
  */
2839
- async return(t) {
2840
- const e = await t;
2839
+ async return(n) {
2840
+ const e = await n;
2841
2841
  return this._iterator.return ? await this._iterator.return(e) : { done: !0, value: e };
2842
2842
  }
2843
2843
  /**
@@ -2881,10 +2881,10 @@ class f {
2881
2881
  *
2882
2882
  * @returns A {@link Promise} that will resolve to the final result of the iterator.
2883
2883
  */
2884
- throw(t) {
2884
+ throw(n) {
2885
2885
  if (this._iterator.throw)
2886
- return this._iterator.throw(t);
2887
- throw t;
2886
+ return this._iterator.throw(n);
2887
+ throw n;
2888
2888
  }
2889
2889
  /**
2890
2890
  * An utility method that aggregates the elements of the iterator using a given key function.
@@ -2916,8 +2916,8 @@ class f {
2916
2916
  *
2917
2917
  * @returns A new instance of the {@link AggregatedAsyncIterator} class containing the grouped elements.
2918
2918
  */
2919
- groupBy(t) {
2920
- return new T(this.map(async (e, n) => [await t(e, n), e]));
2919
+ groupBy(n) {
2920
+ return new E(this.map(async (e, t) => [await n(e, t), e]));
2921
2921
  }
2922
2922
  /**
2923
2923
  * Materializes the iterator into an array.
@@ -2945,20 +2945,20 @@ class f {
2945
2945
  toArray() {
2946
2946
  return Array.fromAsync(this);
2947
2947
  }
2948
- [(ye = Symbol.toStringTag, Symbol.asyncIterator)]() {
2948
+ [(pe = Symbol.toStringTag, Symbol.asyncIterator)]() {
2949
2949
  return this;
2950
2950
  }
2951
2951
  }
2952
- var _e;
2953
- _e = Symbol.toStringTag;
2952
+ var ye;
2953
+ ye = Symbol.toStringTag;
2954
2954
  const m = class m {
2955
- constructor(t) {
2955
+ constructor(n) {
2956
2956
  /**
2957
2957
  * The internal {@link SmartIterator} object that holds the elements to aggregate.
2958
2958
  */
2959
2959
  a(this, "_elements");
2960
- a(this, _e, "AggregatedIterator");
2961
- this._elements = new c(t);
2960
+ a(this, ye, "AggregatedIterator");
2961
+ this._elements = new u(n);
2962
2962
  }
2963
2963
  /**
2964
2964
  * Determines whether all elements of each group of the iterator satisfy a given condition.
@@ -2990,15 +2990,15 @@ const m = class m {
2990
2990
  *
2991
2991
  * @returns A new {@link ReducedIterator} containing the boolean results for each group.
2992
2992
  */
2993
- every(t) {
2993
+ every(n) {
2994
2994
  const e = /* @__PURE__ */ new Map();
2995
- for (const [n, s] of this._elements) {
2996
- const [r, o] = e.get(n) ?? [0, !0];
2997
- o && e.set(n, [r + 1, t(n, s, r)]);
2995
+ for (const [t, s] of this._elements) {
2996
+ const [r, o] = e.get(t) ?? [0, !0];
2997
+ o && e.set(t, [r + 1, n(t, s, r)]);
2998
2998
  }
2999
2999
  return new h(function* () {
3000
- for (const [n, [s, r]] of e)
3001
- yield [n, r];
3000
+ for (const [t, [s, r]] of e)
3001
+ yield [t, r];
3002
3002
  });
3003
3003
  }
3004
3004
  /**
@@ -3031,24 +3031,24 @@ const m = class m {
3031
3031
  *
3032
3032
  * @returns A {@link ReducedIterator} containing the boolean results for each group.
3033
3033
  */
3034
- some(t) {
3034
+ some(n) {
3035
3035
  const e = /* @__PURE__ */ new Map();
3036
- for (const [n, s] of this._elements) {
3037
- const [r, o] = e.get(n) ?? [0, !1];
3038
- o || e.set(n, [r + 1, t(n, s, r)]);
3036
+ for (const [t, s] of this._elements) {
3037
+ const [r, o] = e.get(t) ?? [0, !1];
3038
+ o || e.set(t, [r + 1, n(t, s, r)]);
3039
3039
  }
3040
3040
  return new h(function* () {
3041
- for (const [n, [s, r]] of e)
3042
- yield [n, r];
3041
+ for (const [t, [s, r]] of e)
3042
+ yield [t, r];
3043
3043
  });
3044
3044
  }
3045
- filter(t) {
3045
+ filter(n) {
3046
3046
  const e = this._elements;
3047
3047
  return new m(function* () {
3048
- const n = /* @__PURE__ */ new Map();
3048
+ const t = /* @__PURE__ */ new Map();
3049
3049
  for (const [s, r] of e) {
3050
- const o = n.get(s) ?? 0;
3051
- t(s, r, o) && (yield [s, r]), n.set(s, o + 1);
3050
+ const o = t.get(s) ?? 0;
3051
+ n(s, r, o) && (yield [s, r]), t.set(s, o + 1);
3052
3052
  }
3053
3053
  });
3054
3054
  }
@@ -3084,32 +3084,32 @@ const m = class m {
3084
3084
  *
3085
3085
  * @returns A new {@link AggregatedIterator} containing the transformed elements.
3086
3086
  */
3087
- map(t) {
3087
+ map(n) {
3088
3088
  const e = this._elements;
3089
3089
  return new m(function* () {
3090
- const n = /* @__PURE__ */ new Map();
3090
+ const t = /* @__PURE__ */ new Map();
3091
3091
  for (const [s, r] of e) {
3092
- const o = n.get(s) ?? 0;
3093
- yield [s, t(s, r, o)], n.set(s, o + 1);
3092
+ const o = t.get(s) ?? 0;
3093
+ yield [s, n(s, r, o)], t.set(s, o + 1);
3094
3094
  }
3095
3095
  });
3096
3096
  }
3097
- reduce(t, e) {
3098
- const n = /* @__PURE__ */ new Map();
3097
+ reduce(n, e) {
3098
+ const t = /* @__PURE__ */ new Map();
3099
3099
  for (const [s, r] of this._elements) {
3100
3100
  let o, l;
3101
- if (n.has(s))
3102
- [o, l] = n.get(s);
3101
+ if (t.has(s))
3102
+ [o, l] = t.get(s);
3103
3103
  else if (e !== void 0)
3104
3104
  o = 0, e instanceof Function ? l = e(s) : l = e;
3105
3105
  else {
3106
- n.set(s, [0, r]);
3106
+ t.set(s, [0, r]);
3107
3107
  continue;
3108
3108
  }
3109
- n.set(s, [o + 1, t(s, l, r, o)]);
3109
+ t.set(s, [o + 1, n(s, l, r, o)]);
3110
3110
  }
3111
3111
  return new h(function* () {
3112
- for (const [s, [r, o]] of n)
3112
+ for (const [s, [r, o]] of t)
3113
3113
  yield [s, o];
3114
3114
  });
3115
3115
  }
@@ -3149,18 +3149,18 @@ const m = class m {
3149
3149
  *
3150
3150
  * @returns A new {@link AggregatedIterator} containing the transformed elements.
3151
3151
  */
3152
- flatMap(t) {
3152
+ flatMap(n) {
3153
3153
  const e = this._elements;
3154
3154
  return new m(function* () {
3155
- const n = /* @__PURE__ */ new Map();
3155
+ const t = /* @__PURE__ */ new Map();
3156
3156
  for (const [s, r] of e) {
3157
- const o = n.get(s) ?? 0, l = t(s, r, o);
3157
+ const o = t.get(s) ?? 0, l = n(s, r, o);
3158
3158
  if (l instanceof Array)
3159
- for (const v of l)
3160
- yield [s, v];
3159
+ for (const k of l)
3160
+ yield [s, k];
3161
3161
  else
3162
3162
  yield [s, l];
3163
- n.set(s, o + 1);
3163
+ t.set(s, o + 1);
3164
3164
  }
3165
3165
  });
3166
3166
  }
@@ -3193,14 +3193,14 @@ const m = class m {
3193
3193
  *
3194
3194
  * @returns A new {@link AggregatedIterator} containing the remaining elements.
3195
3195
  */
3196
- drop(t) {
3196
+ drop(n) {
3197
3197
  const e = this._elements;
3198
3198
  return new m(function* () {
3199
- const n = /* @__PURE__ */ new Map();
3199
+ const t = /* @__PURE__ */ new Map();
3200
3200
  for (const [s, r] of e) {
3201
- const o = n.get(s) ?? 0;
3202
- if (o < t) {
3203
- n.set(s, o + 1);
3201
+ const o = t.get(s) ?? 0;
3202
+ if (o < n) {
3203
+ t.set(s, o + 1);
3204
3204
  continue;
3205
3205
  }
3206
3206
  yield [s, r];
@@ -3236,25 +3236,25 @@ const m = class m {
3236
3236
  *
3237
3237
  * @returns A new {@link AggregatedIterator} containing the taken elements.
3238
3238
  */
3239
- take(t) {
3239
+ take(n) {
3240
3240
  const e = this._elements;
3241
3241
  return new m(function* () {
3242
- const n = /* @__PURE__ */ new Map();
3242
+ const t = /* @__PURE__ */ new Map();
3243
3243
  for (const [s, r] of e) {
3244
- const o = n.get(s) ?? 0;
3245
- o >= t || (yield [s, r], n.set(s, o + 1));
3244
+ const o = t.get(s) ?? 0;
3245
+ o >= n || (yield [s, r], t.set(s, o + 1));
3246
3246
  }
3247
3247
  });
3248
3248
  }
3249
- find(t) {
3249
+ find(n) {
3250
3250
  const e = /* @__PURE__ */ new Map();
3251
- for (const [n, s] of this._elements) {
3252
- let [r, o] = e.get(n) ?? [0, void 0];
3253
- o === void 0 && (t(n, s, r) && (o = s), e.set(n, [r + 1, o]));
3251
+ for (const [t, s] of this._elements) {
3252
+ let [r, o] = e.get(t) ?? [0, void 0];
3253
+ o === void 0 && (n(t, s, r) && (o = s), e.set(t, [r + 1, o]));
3254
3254
  }
3255
3255
  return new h(function* () {
3256
- for (const [n, [s, r]] of e)
3257
- yield [n, r];
3256
+ for (const [t, [s, r]] of e)
3257
+ yield [t, r];
3258
3258
  });
3259
3259
  }
3260
3260
  /**
@@ -3284,7 +3284,7 @@ const m = class m {
3284
3284
  * @returns A new {@link AggregatedIterator} containing the enumerated elements.
3285
3285
  */
3286
3286
  enumerate() {
3287
- return this.map((t, e, n) => [n, e]);
3287
+ return this.map((n, e, t) => [t, e]);
3288
3288
  }
3289
3289
  /**
3290
3290
  * Removes all duplicate elements from within each group of the iterator.
@@ -3313,12 +3313,12 @@ const m = class m {
3313
3313
  * @returns A new {@link AggregatedIterator} containing only the unique elements.
3314
3314
  */
3315
3315
  unique() {
3316
- const t = this._elements;
3316
+ const n = this._elements;
3317
3317
  return new m(function* () {
3318
3318
  const e = /* @__PURE__ */ new Map();
3319
- for (const [n, s] of t) {
3320
- const r = e.get(n) ?? /* @__PURE__ */ new Set();
3321
- r.has(s) || (r.add(s), e.set(n, r), yield [n, s]);
3319
+ for (const [t, s] of n) {
3320
+ const r = e.get(t) ?? /* @__PURE__ */ new Set();
3321
+ r.has(s) || (r.add(s), e.set(t, r), yield [t, s]);
3322
3322
  }
3323
3323
  });
3324
3324
  }
@@ -3344,14 +3344,14 @@ const m = class m {
3344
3344
  * @returns A new {@link ReducedIterator} containing the number of elements for each group.
3345
3345
  */
3346
3346
  count() {
3347
- const t = /* @__PURE__ */ new Map();
3347
+ const n = /* @__PURE__ */ new Map();
3348
3348
  for (const [e] of this._elements) {
3349
- const n = t.get(e) ?? 0;
3350
- t.set(e, n + 1);
3349
+ const t = n.get(e) ?? 0;
3350
+ n.set(e, t + 1);
3351
3351
  }
3352
3352
  return new h(function* () {
3353
- for (const [e, n] of t)
3354
- yield [e, n];
3353
+ for (const [e, t] of n)
3354
+ yield [e, t];
3355
3355
  });
3356
3356
  }
3357
3357
  /**
@@ -3378,11 +3378,11 @@ const m = class m {
3378
3378
  *
3379
3379
  * @param iteratee The function to execute for each element of the iterator.
3380
3380
  */
3381
- forEach(t) {
3381
+ forEach(n) {
3382
3382
  const e = /* @__PURE__ */ new Map();
3383
- for (const [n, s] of this._elements) {
3384
- const r = e.get(n) ?? 0;
3385
- t(n, s, r), e.set(n, r + 1);
3383
+ for (const [t, s] of this._elements) {
3384
+ const r = e.get(t) ?? 0;
3385
+ n(t, s, r), e.set(t, r + 1);
3386
3386
  }
3387
3387
  }
3388
3388
  /**
@@ -3416,13 +3416,13 @@ const m = class m {
3416
3416
  *
3417
3417
  * @returns A new {@link AggregatedIterator} containing the elements reorganized by the new keys.
3418
3418
  */
3419
- reorganizeBy(t) {
3419
+ reorganizeBy(n) {
3420
3420
  const e = this._elements;
3421
3421
  return new m(function* () {
3422
- const n = /* @__PURE__ */ new Map();
3422
+ const t = /* @__PURE__ */ new Map();
3423
3423
  for (const [s, r] of e) {
3424
- const o = n.get(s) ?? 0;
3425
- yield [t(s, r, o), r], n.set(s, o + 1);
3424
+ const o = t.get(s) ?? 0;
3425
+ yield [n(s, r, o), r], t.set(s, o + 1);
3426
3426
  }
3427
3427
  });
3428
3428
  }
@@ -3453,11 +3453,11 @@ const m = class m {
3453
3453
  * @returns A new {@link SmartIterator} containing all the keys of the iterator.
3454
3454
  */
3455
3455
  keys() {
3456
- const t = this._elements;
3457
- return new c(function* () {
3456
+ const n = this._elements;
3457
+ return new u(function* () {
3458
3458
  const e = /* @__PURE__ */ new Set();
3459
- for (const [n] of t)
3460
- e.has(n) || (e.add(n), yield n);
3459
+ for (const [t] of n)
3460
+ e.has(t) || (e.add(t), yield t);
3461
3461
  });
3462
3462
  }
3463
3463
  /**
@@ -3517,10 +3517,10 @@ const m = class m {
3517
3517
  * @returns A new {@link SmartIterator} containing all the values of the iterator.
3518
3518
  */
3519
3519
  values() {
3520
- const t = this._elements;
3521
- return new c(function* () {
3522
- for (const [e, n] of t)
3523
- yield n;
3520
+ const n = this._elements;
3521
+ return new u(function* () {
3522
+ for (const [e, t] of n)
3523
+ yield t;
3524
3524
  });
3525
3525
  }
3526
3526
  /**
@@ -3544,8 +3544,8 @@ const m = class m {
3544
3544
  * @returns An {@link Array} of arrays containing the elements of the iterator.
3545
3545
  */
3546
3546
  toArray() {
3547
- const t = this.toMap();
3548
- return Array.from(t.values());
3547
+ const n = this.toMap();
3548
+ return Array.from(n.values());
3549
3549
  }
3550
3550
  /**
3551
3551
  * Materializes the iterator into a map.
@@ -3568,12 +3568,12 @@ const m = class m {
3568
3568
  * @returns A {@link Map} containing the elements of the iterator.
3569
3569
  */
3570
3570
  toMap() {
3571
- const t = /* @__PURE__ */ new Map();
3572
- for (const [e, n] of this._elements) {
3573
- const s = t.get(e) ?? [];
3574
- s.push(n), t.set(e, s);
3571
+ const n = /* @__PURE__ */ new Map();
3572
+ for (const [e, t] of this._elements) {
3573
+ const s = n.get(e) ?? [];
3574
+ s.push(t), n.set(e, s);
3575
3575
  }
3576
- return t;
3576
+ return n;
3577
3577
  }
3578
3578
  /**
3579
3579
  * Materializes the iterator into an object.
@@ -3596,31 +3596,31 @@ const m = class m {
3596
3596
  * @returns An {@link Object} containing the elements of the iterator.
3597
3597
  */
3598
3598
  toObject() {
3599
- const t = {};
3600
- for (const [e, n] of this._elements) {
3601
- const s = t[e] ?? [];
3602
- s.push(n), t[e] = s;
3599
+ const n = {};
3600
+ for (const [e, t] of this._elements) {
3601
+ const s = n[e] ?? [];
3602
+ s.push(t), n[e] = s;
3603
3603
  }
3604
- return t;
3604
+ return n;
3605
3605
  }
3606
3606
  };
3607
- let g = m;
3608
- const Le = Function;
3609
- var pe, be;
3610
- class Ge extends (be = Le, pe = Symbol.toStringTag, be) {
3607
+ let x = m;
3608
+ const He = Function;
3609
+ var _e, be;
3610
+ class Qe extends (be = He, _e = Symbol.toStringTag, be) {
3611
3611
  /**
3612
3612
  * Initializes a new instance of the {@link CallableObject} class.
3613
3613
  */
3614
3614
  constructor() {
3615
3615
  super("return this._invoke(...arguments);");
3616
- a(this, pe, "CallableObject");
3616
+ a(this, _e, "CallableObject");
3617
3617
  const e = this.bind(this);
3618
3618
  return Object.setPrototypeOf(this, e), e;
3619
3619
  }
3620
3620
  }
3621
- var xe;
3622
- xe = Symbol.toStringTag;
3623
- class E {
3621
+ var ge;
3622
+ ge = Symbol.toStringTag;
3623
+ class v {
3624
3624
  /**
3625
3625
  * Initializes a new instance of the {@link Publisher} class.
3626
3626
  *
@@ -3639,7 +3639,7 @@ class E {
3639
3639
  * The values are the arrays of the subscribers themselves.
3640
3640
  */
3641
3641
  a(this, "_subscribers");
3642
- a(this, xe, "Publisher");
3642
+ a(this, ge, "Publisher");
3643
3643
  this._subscribers = /* @__PURE__ */ new Map();
3644
3644
  }
3645
3645
  /**
@@ -3688,12 +3688,12 @@ class E {
3688
3688
  *
3689
3689
  * @returns An array containing the return values of all the subscribers.
3690
3690
  */
3691
- publish(t, ...e) {
3692
- const n = this._subscribers.get(t);
3693
- return n ? n.slice().map((s) => s(...e)) : [];
3691
+ publish(n, ...e) {
3692
+ const t = this._subscribers.get(n);
3693
+ return t ? t.slice().map((s) => s(...e)) : [];
3694
3694
  }
3695
3695
  /**
3696
- * Subscribes a new subscriber to an event.
3696
+ * Subscribes to an event and adds a subscriber to be executed when the event is published.
3697
3697
  *
3698
3698
  * ---
3699
3699
  *
@@ -3712,22 +3712,22 @@ class E {
3712
3712
  * @template K The key of the map containing the callback signature to subscribe.
3713
3713
  *
3714
3714
  * @param event The name of the event to subscribe to.
3715
- * @param subscriber The subscriber to add to the event.
3715
+ * @param subscriber The subscriber to execute when the event is published.
3716
3716
  *
3717
- * @returns A function that can be used to unsubscribe the subscriber.
3717
+ * @returns A function that can be used to unsubscribe the subscriber from the event.
3718
3718
  */
3719
- subscribe(t, e) {
3720
- this._subscribers.has(t) || this._subscribers.set(t, []);
3721
- const n = this._subscribers.get(t);
3722
- return n.push(e), () => {
3723
- const s = n.indexOf(e);
3719
+ subscribe(n, e) {
3720
+ this._subscribers.has(n) || this._subscribers.set(n, []);
3721
+ const t = this._subscribers.get(n);
3722
+ return t.push(e), () => {
3723
+ const s = t.indexOf(e);
3724
3724
  if (s < 0)
3725
3725
  throw new C("Unable to unsubscribe the required subscriber. The subscription was already unsubscribed.");
3726
- n.splice(s, 1);
3726
+ t.splice(s, 1);
3727
3727
  };
3728
3728
  }
3729
3729
  /**
3730
- * Unsubscribes a subscriber from an event.
3730
+ * Unsubscribes from an event and removes a subscriber from being executed when the event is published.
3731
3731
  *
3732
3732
  * ---
3733
3733
  *
@@ -3746,21 +3746,21 @@ class E {
3746
3746
  * @param event The name of the event to unsubscribe from.
3747
3747
  * @param subscriber The subscriber to remove from the event.
3748
3748
  */
3749
- unsubscribe(t, e) {
3750
- const n = this._subscribers.get(t);
3751
- if (!n)
3749
+ unsubscribe(n, e) {
3750
+ const t = this._subscribers.get(n);
3751
+ if (!t)
3752
3752
  return;
3753
- const s = n.indexOf(e);
3753
+ const s = t.indexOf(e);
3754
3754
  if (s < 0)
3755
3755
  throw new C("Unable to unsubscribe the required subscriber. The subscription was already unsubscribed or was never subscribed.");
3756
- n.splice(s, 1);
3756
+ t.splice(s, 1);
3757
3757
  }
3758
3758
  }
3759
- const Ke = () => {
3759
+ const Xe = () => {
3760
3760
  };
3761
- var ge, ve;
3762
- class it extends (ve = Ge, ge = Symbol.toStringTag, ve) {
3763
- constructor(e, n = "default") {
3761
+ var xe, ve;
3762
+ class ut extends (ve = Qe, xe = Symbol.toStringTag, ve) {
3763
+ constructor(e, t = "default") {
3764
3764
  super();
3765
3765
  /**
3766
3766
  * The currently selected implementation of the callback.
@@ -3792,12 +3792,12 @@ class it extends (ve = Ge, ge = Symbol.toStringTag, ve) {
3792
3792
  * The function that will be called by the extended class when the object is invoked as a function.
3793
3793
  */
3794
3794
  a(this, "_invoke");
3795
- a(this, ge, "SwitchableCallback");
3796
- this._callbacks = /* @__PURE__ */ new Map(), this._isEnabled = !0, e ? this._callbacks.set(n, e) : (n = "", e = () => {
3797
- throw new Be(
3795
+ a(this, xe, "SwitchableCallback");
3796
+ this._callbacks = /* @__PURE__ */ new Map(), this._isEnabled = !0, e ? this._callbacks.set(t, e) : (t = "", e = () => {
3797
+ throw new Ve(
3798
3798
  "The `SwitchableCallback` has no callback defined yet. Did you forget to call the `register` method?"
3799
3799
  );
3800
- }), this._key = n, this._callback = e, this._invoke = (...s) => this._callback(...s);
3800
+ }), this._key = t, this._callback = e, this._invoke = (...s) => this._callback(...s);
3801
3801
  }
3802
3802
  /**
3803
3803
  * A flag indicating whether the callback is enabled or not.
@@ -3839,16 +3839,16 @@ class it extends (ve = Ge, ge = Symbol.toStringTag, ve) {
3839
3839
  enable(e) {
3840
3840
  if (e === void 0) {
3841
3841
  if (!this._key)
3842
- throw new _(
3842
+ throw new y(
3843
3843
  "The `SwitchableCallback` has no callback defined yet. Did you forget to call the `register` method?"
3844
3844
  );
3845
3845
  e = this._key;
3846
3846
  } else if (e) {
3847
3847
  if (!this._callbacks.has(e))
3848
- throw new _(`The key '${e}' doesn't yet have any associated callback.`);
3849
- } else throw new _("The key must be a non-empty string.");
3848
+ throw new y(`The key '${e}' doesn't yet have any associated callback.`);
3849
+ } else throw new y("The key must be a non-empty string.");
3850
3850
  if (this._isEnabled)
3851
- throw new y("The `SwitchableCallback` is already enabled.");
3851
+ throw new p("The `SwitchableCallback` is already enabled.");
3852
3852
  this._callback = this._callbacks.get(e), this._isEnabled = !0;
3853
3853
  }
3854
3854
  /**
@@ -3866,8 +3866,8 @@ class it extends (ve = Ge, ge = Symbol.toStringTag, ve) {
3866
3866
  */
3867
3867
  disable() {
3868
3868
  if (!this._isEnabled)
3869
- throw new y("The `SwitchableCallback` is already disabled.");
3870
- this._callback = Ke, this._isEnabled = !1;
3869
+ throw new p("The `SwitchableCallback` is already disabled.");
3870
+ this._callback = Xe, this._isEnabled = !1;
3871
3871
  }
3872
3872
  /**
3873
3873
  * Registers a new implementation for the callback.
@@ -3889,12 +3889,12 @@ class it extends (ve = Ge, ge = Symbol.toStringTag, ve) {
3889
3889
  * @param key The key that will be associated with the implementation.
3890
3890
  * @param callback The implementation to register.
3891
3891
  */
3892
- register(e, n) {
3892
+ register(e, t) {
3893
3893
  if (this._callbacks.size === 0)
3894
- this._key = e, this._callback = n;
3894
+ this._key = e, this._callback = t;
3895
3895
  else if (this._callbacks.has(e))
3896
- throw new _(`The key '${e}' has already been used for another callback.`);
3897
- this._callbacks.set(e, n);
3896
+ throw new y(`The key '${e}' has already been used for another callback.`);
3897
+ this._callbacks.set(e, t);
3898
3898
  }
3899
3899
  /**
3900
3900
  * Unregisters an implementation for the callback.
@@ -3916,9 +3916,9 @@ class it extends (ve = Ge, ge = Symbol.toStringTag, ve) {
3916
3916
  */
3917
3917
  unregister(e) {
3918
3918
  if (this._key === e)
3919
- throw new _("Unable to unregister the currently selected callback.");
3919
+ throw new y("Unable to unregister the currently selected callback.");
3920
3920
  if (!this._callbacks.has(e))
3921
- throw new _(`The key '${e}' doesn't yet have any associated callback.`);
3921
+ throw new y(`The key '${e}' doesn't yet have any associated callback.`);
3922
3922
  this._callbacks.delete(e);
3923
3923
  }
3924
3924
  /**
@@ -3941,13 +3941,320 @@ class it extends (ve = Ge, ge = Symbol.toStringTag, ve) {
3941
3941
  */
3942
3942
  switch(e) {
3943
3943
  if (!this._callbacks.has(e))
3944
- throw new _(`The key '${e}' doesn't yet have any associated callback.`);
3944
+ throw new y(`The key '${e}' doesn't yet have any associated callback.`);
3945
3945
  this._key !== e && (this._key = e, this._isEnabled && (this._callback = this._callbacks.get(e)));
3946
3946
  }
3947
3947
  }
3948
- var ke;
3949
- ke = Symbol.toStringTag;
3950
- class ot {
3948
+ var ke, Se;
3949
+ class ct extends (Se = Map, ke = Symbol.toStringTag, Se) {
3950
+ /**
3951
+ * Initializes a new instance of the {@link MapView} class.
3952
+ *
3953
+ * ---
3954
+ *
3955
+ * @example
3956
+ * ```ts
3957
+ * const map = new MapView<string, number>([["key1", 2], ["key2", 4], ["key3", 8]]);
3958
+ * ```
3959
+ *
3960
+ * ---
3961
+ *
3962
+ * @param iterable An optional iterable of key-value pairs to initialize the {@link Map} with.
3963
+ */
3964
+ constructor(e) {
3965
+ super();
3966
+ /**
3967
+ * The internal {@link Publisher} instance used to publish events.
3968
+ */
3969
+ a(this, "_publisher");
3970
+ a(this, ke, "MapView");
3971
+ if (this._publisher = new v(), e)
3972
+ for (const [t, s] of e)
3973
+ this.set(t, s);
3974
+ }
3975
+ /**
3976
+ * Adds a new entry with a specified key and value to the {@link Map}.
3977
+ * If an entry with the same key already exists, the entry will be overwritten with the new value.
3978
+ *
3979
+ * ---
3980
+ *
3981
+ * @example
3982
+ * ```ts
3983
+ * const map = new MapView<string, number>();
3984
+ * map.set("key1", 2)
3985
+ * .set("key2", 4)
3986
+ * .set("key3", 8);
3987
+ *
3988
+ * console.log(map); // MapView { "key1" => 2, "key2" => 4, "key3" => 8 }
3989
+ * ```
3990
+ *
3991
+ * ---
3992
+ *
3993
+ * @param key The key of the entry to add.
3994
+ * @param value The value of the entry to add.
3995
+ *
3996
+ * @returns The current instance of the {@link MapView} class.
3997
+ */
3998
+ set(e, t) {
3999
+ return super.set(e, t), this._publisher.publish("entry:add", e, t), this;
4000
+ }
4001
+ /**
4002
+ * Removes an entry with a specified key from the {@link Map}.
4003
+ *
4004
+ * ---
4005
+ *
4006
+ * @example
4007
+ * ```ts
4008
+ * const map = new MapView<string, number>([["key1", 2], ["key2", 4], ["key3", 8]]);
4009
+ * map.delete("key2"); // true
4010
+ * map.delete("key4"); // false
4011
+ *
4012
+ * console.log(map); // MapView { "key1" => 2, "key3" => 8 }
4013
+ * ```
4014
+ *
4015
+ * ---
4016
+ *
4017
+ * @param key The key of the entry to remove.
4018
+ *
4019
+ * @returns `true` if the entry existed and has been removed; otherwise `false` if the entry doesn't exist.
4020
+ */
4021
+ delete(e) {
4022
+ const t = super.delete(e);
4023
+ return t && this._publisher.publish("entry:remove", e), t;
4024
+ }
4025
+ /**
4026
+ * Removes all entries from the {@link Map}.
4027
+ *
4028
+ * ---
4029
+ *
4030
+ * @example
4031
+ * ```ts
4032
+ * const map = new MapView<string, number>([["key1", 2], ["key2", 4], ["key3", 8]]);
4033
+ * map.clear();
4034
+ *
4035
+ * console.log(map); // MapView { }
4036
+ * ```
4037
+ */
4038
+ clear() {
4039
+ const e = this.size;
4040
+ super.clear(), e > 0 && this._publisher.publish("collection:clear");
4041
+ }
4042
+ /**
4043
+ * Subscribes to an event and adds a callback to be executed when the event is published.
4044
+ *
4045
+ * ---
4046
+ *
4047
+ * @example
4048
+ * ```ts
4049
+ * const map = new MapView<string, number>();
4050
+ * const unsubscribe = map.subscribe("entry:add", (key: string, value: number) =>
4051
+ * {
4052
+ * if (key === "answer") { unsubscribe(); }
4053
+ * console.log(`Added ${key}: ${value}`);
4054
+ * });
4055
+ *
4056
+ * map.set("key1", 2); // Added key1: 2
4057
+ * map.set("answer", 42); // Added answer: 42
4058
+ * map.set("key2", 4);
4059
+ * map.set("key3", 8);
4060
+ * ```
4061
+ *
4062
+ * ---
4063
+ *
4064
+ * @template T The key of the map containing the callback signature to subscribe.
4065
+ *
4066
+ * @param event The name of the event to subscribe to.
4067
+ * @param callback The callback to execute when the event is published.
4068
+ *
4069
+ * @returns A function that can be used to unsubscribe the callback from the event.
4070
+ */
4071
+ subscribe(e, t) {
4072
+ return this._publisher.subscribe(e, t);
4073
+ }
4074
+ /**
4075
+ * Unsubscribes from an event and removes a callback from being executed when the event is published.
4076
+ *
4077
+ * ---
4078
+ *
4079
+ * @example
4080
+ * ```ts
4081
+ * const callback = (key: string, value: number) => console.log(`Added ${key}: ${value}`);
4082
+ * const map = new MapView<string, number>();
4083
+ *
4084
+ * map.subscribe("entry:add", callback);
4085
+ * map.set("key1", 2); // Added key1: 2
4086
+ *
4087
+ * map.unsubscribe("entry:add", callback);
4088
+ * map.set("key2", 4);
4089
+ * ```
4090
+ *
4091
+ * ---
4092
+ *
4093
+ * @template T The key of the map containing the callback signature to unsubscribe.
4094
+ *
4095
+ * @param event The name of the event to unsubscribe from.
4096
+ * @param callback The callback to remove from the event.
4097
+ */
4098
+ unsubscribe(e, t) {
4099
+ this._publisher.unsubscribe(e, t);
4100
+ }
4101
+ }
4102
+ var Te, Ee;
4103
+ class ht extends (Ee = Set, Te = Symbol.toStringTag, Ee) {
4104
+ /**
4105
+ * Initializes a new instance of the {@link SetView} class.
4106
+ *
4107
+ * ---
4108
+ *
4109
+ * @example
4110
+ * ```ts
4111
+ * const set = new SetView<number>([2, 4, 8]);
4112
+ * ```
4113
+ *
4114
+ * ---
4115
+ *
4116
+ * @param iterable An optional iterable of values to initialize the {@link Set} with.
4117
+ */
4118
+ constructor(e) {
4119
+ super();
4120
+ /**
4121
+ * The internal {@link Publisher} instance used to publish events.
4122
+ */
4123
+ a(this, "_publisher");
4124
+ a(this, Te, "SetView");
4125
+ if (this._publisher = new v(), e)
4126
+ for (const t of e)
4127
+ this.add(t);
4128
+ }
4129
+ /**
4130
+ * Appends a new element with a specified value to the end of the {@link Set}.
4131
+ * If the value already exists, it will not be added again.
4132
+ *
4133
+ * ---
4134
+ *
4135
+ * @example
4136
+ * ```ts
4137
+ * const set = new SetView<number>();
4138
+ * set.add(2)
4139
+ * .add(4)
4140
+ * .add(8);
4141
+ *
4142
+ * console.log(set); // SetView(4) { 2, 4, 8 }
4143
+ * ```
4144
+ *
4145
+ * ---
4146
+ *
4147
+ * @param value The value to add.
4148
+ *
4149
+ * @returns The current instance of the {@link SetView} class.
4150
+ */
4151
+ add(e) {
4152
+ return super.add(e), this._publisher.publish("entry:add", e), this;
4153
+ }
4154
+ /**
4155
+ * Removes the specified value from the {@link Set}.
4156
+ *
4157
+ * ---
4158
+ *
4159
+ * @example
4160
+ * ```ts
4161
+ * const set = new SetView<number>([2, 4, 8]);
4162
+ * set.delete(4); // true
4163
+ * set.delete(16); // false
4164
+ *
4165
+ * console.log(set); // SetView(2) { 2, 8 }
4166
+ * ```
4167
+ *
4168
+ * ---
4169
+ *
4170
+ * @param value The value to remove.
4171
+ *
4172
+ * @returns `true` if the entry existed and has been removed; otherwise `false` if the entry doesn't exist.
4173
+ */
4174
+ delete(e) {
4175
+ const t = super.delete(e);
4176
+ return t && this._publisher.publish("entry:remove", e), t;
4177
+ }
4178
+ /**
4179
+ * Removes all entries from the {@link Set}.
4180
+ *
4181
+ * ---
4182
+ *
4183
+ * @example
4184
+ * ```ts
4185
+ * const set = new SetView<number>([2, 4, 8]);
4186
+ * set.clear();
4187
+ *
4188
+ * console.log(set); // SetView(0) { }
4189
+ * ```
4190
+ */
4191
+ clear() {
4192
+ const e = this.size;
4193
+ super.clear(), e > 0 && this._publisher.publish("collection:clear");
4194
+ }
4195
+ /**
4196
+ * Subscribes to an event and adds a callback to be executed when the event is published.
4197
+ *
4198
+ * ---
4199
+ *
4200
+ * @example
4201
+ * ```ts
4202
+ * const set = new SetView<number>();
4203
+ * const unsubscribe = set.subscribe("entry:add", (value: number) =>
4204
+ * {
4205
+ * if (value === 42) { unsubscribe(); }
4206
+ * console.log(`Added ${value}`);
4207
+ * });
4208
+ *
4209
+ * set.add(2); // Added 2
4210
+ * set.add(42); // Added 42
4211
+ * set.add(4);
4212
+ * set.add(8);
4213
+ * ```
4214
+ *
4215
+ * ---
4216
+ *
4217
+ * @template K The key of the map containing the callback signature to subscribe.
4218
+ *
4219
+ * @param event The name of the event to subscribe to.
4220
+ * @param callback The callback to execute when the event is published.
4221
+ *
4222
+ * @returns A function that can be used to unsubscribe the callback from the event.
4223
+ */
4224
+ subscribe(e, t) {
4225
+ return this._publisher.subscribe(e, t);
4226
+ }
4227
+ /**
4228
+ * Unsubscribes from an event and removes a callback from being executed when the event is published.
4229
+ *
4230
+ * ---
4231
+ *
4232
+ * @example
4233
+ * ```ts
4234
+ * const callback = (value: number) => console.log(`Added ${value}`);
4235
+ * const set = new SetView<number>();
4236
+ *
4237
+ * set.subscribe("entry:add", callback);
4238
+ * set.add(2); // Added 2
4239
+ *
4240
+ * set.unsubscribe("entry:add", callback);
4241
+ * set.add(4);
4242
+ * ```
4243
+ *
4244
+ * ---
4245
+ *
4246
+ * @template K The key of the map containing the callback signature to unsubscribe.
4247
+ *
4248
+ * @param event The name of the event to unsubscribe from.
4249
+ * @param callback The callback to remove from the event.
4250
+ */
4251
+ unsubscribe(e, t) {
4252
+ this._publisher.unsubscribe(e, t);
4253
+ }
4254
+ }
4255
+ var Me;
4256
+ Me = Symbol.toStringTag;
4257
+ class ft {
3951
4258
  /**
3952
4259
  * Initializes a new instance of the {@link JSONStorage} class.
3953
4260
  * It cannot be instantiated outside of a browser environment or an {@link EnvironmentException} is thrown.
@@ -3965,7 +4272,7 @@ class ot {
3965
4272
  * Whether to prefer the {@link localStorage} over the {@link sessionStorage} when calling an ambivalent method.
3966
4273
  * If omitted, it defaults to `true` to prefer the persistent storage.
3967
4274
  */
3968
- constructor(t = !0) {
4275
+ constructor(n = !0) {
3969
4276
  /**
3970
4277
  * Whether to prefer the {@link localStorage} over the {@link sessionStorage} when calling an ambivalent method.
3971
4278
  *
@@ -3981,41 +4288,41 @@ class ot {
3981
4288
  * A reference to the persistent {@link localStorage} storage.
3982
4289
  */
3983
4290
  a(this, "_persistent");
3984
- a(this, ke, "JSONStorage");
3985
- if (!Oe)
3986
- throw new Je(
4291
+ a(this, Me, "JSONStorage");
4292
+ if (!De)
4293
+ throw new Ge(
3987
4294
  "The `JSONStorage` class can only be instantiated within a browser environment."
3988
4295
  );
3989
- this._preferPersistence = t, this._volatile = window.sessionStorage, this._persistent = window.localStorage;
4296
+ this._preferPersistence = n, this._volatile = window.sessionStorage, this._persistent = window.localStorage;
3990
4297
  }
3991
- _get(t, e, n) {
3992
- const s = t.getItem(e);
4298
+ _get(n, e, t) {
4299
+ const s = n.getItem(e);
3993
4300
  if (s)
3994
4301
  try {
3995
4302
  return JSON.parse(s);
3996
4303
  } catch {
3997
4304
  console.warn(
3998
4305
  `The "${s}" value for "${e}" property cannot be parsed. Clearing the storage...`
3999
- ), t.removeItem(e);
4306
+ ), n.removeItem(e);
4000
4307
  }
4001
- return n;
4308
+ return t;
4002
4309
  }
4003
- _set(t, e, n) {
4004
- const s = JSON.stringify(n);
4005
- s ? t.setItem(e, s) : t.removeItem(e);
4310
+ _set(n, e, t) {
4311
+ const s = JSON.stringify(t);
4312
+ s ? n.setItem(e, s) : n.removeItem(e);
4006
4313
  }
4007
- get(t, e, n = this._preferPersistence) {
4008
- const s = n ? this._persistent : this._volatile;
4009
- return this._get(s, t, e);
4314
+ get(n, e, t = this._preferPersistence) {
4315
+ const s = t ? this._persistent : this._volatile;
4316
+ return this._get(s, n, e);
4010
4317
  }
4011
- recall(t, e) {
4012
- return this._get(this._volatile, t, e);
4318
+ recall(n, e) {
4319
+ return this._get(this._volatile, n, e);
4013
4320
  }
4014
- retrieve(t, e) {
4015
- return this.recall(t) ?? this.read(t, e);
4321
+ retrieve(n, e) {
4322
+ return this.recall(n) ?? this.read(n, e);
4016
4323
  }
4017
- read(t, e) {
4018
- return this._get(this._persistent, t, e);
4324
+ read(n, e) {
4325
+ return this._get(this._persistent, n, e);
4019
4326
  }
4020
4327
  /**
4021
4328
  * Checks whether the value with the specified key exists within the default storage.
@@ -4039,8 +4346,8 @@ class ot {
4039
4346
  *
4040
4347
  * @returns `true` if the key exists, `false` otherwise.
4041
4348
  */
4042
- has(t, e) {
4043
- return (e ? this._persistent : this._volatile).getItem(t) !== null;
4349
+ has(n, e) {
4350
+ return (e ? this._persistent : this._volatile).getItem(n) !== null;
4044
4351
  }
4045
4352
  /**
4046
4353
  * Checks whether the value with the specified key exists within the volatile {@link sessionStorage}.
@@ -4061,8 +4368,8 @@ class ot {
4061
4368
  *
4062
4369
  * @returns `true` if the key exists, `false` otherwise.
4063
4370
  */
4064
- knows(t) {
4065
- return this._volatile.getItem(t) !== null;
4371
+ knows(n) {
4372
+ return this._volatile.getItem(n) !== null;
4066
4373
  }
4067
4374
  /**
4068
4375
  * Checks whether the value with the specified key exists looking first in the
@@ -4084,8 +4391,8 @@ class ot {
4084
4391
  *
4085
4392
  * @returns `true` if the key exists, `false` otherwise.
4086
4393
  */
4087
- find(t) {
4088
- return this.knows(t) ?? this.exists(t);
4394
+ find(n) {
4395
+ return this.knows(n) ?? this.exists(n);
4089
4396
  }
4090
4397
  /**
4091
4398
  * Checks whether the value with the specified key exists within the persistent {@link localStorage}.
@@ -4106,8 +4413,8 @@ class ot {
4106
4413
  *
4107
4414
  * @returns `true` if the key exists, `false` otherwise.
4108
4415
  */
4109
- exists(t) {
4110
- return this._persistent.getItem(t) !== null;
4416
+ exists(n) {
4417
+ return this._persistent.getItem(n) !== null;
4111
4418
  }
4112
4419
  /**
4113
4420
  * Sets the value with the specified key in the default storage.
@@ -4132,9 +4439,9 @@ class ot {
4132
4439
  * Whether to prefer the persistent {@link localStorage} over the volatile {@link sessionStorage}.
4133
4440
  * If omitted, it defaults to the `preferPersistence` value set in the constructor.
4134
4441
  */
4135
- set(t, e, n = this._preferPersistence) {
4136
- const s = n ? this._persistent : this._volatile;
4137
- this._set(s, t, e);
4442
+ set(n, e, t = this._preferPersistence) {
4443
+ const s = t ? this._persistent : this._volatile;
4444
+ this._set(s, n, e);
4138
4445
  }
4139
4446
  /**
4140
4447
  * Sets the value with the specified key in the volatile {@link sessionStorage}.
@@ -4156,8 +4463,8 @@ class ot {
4156
4463
  * @param key The key of the value to set.
4157
4464
  * @param newValue The new value to set. If it's `undefined` or omitted, the key is removed instead.
4158
4465
  */
4159
- remember(t, e) {
4160
- this._set(this._volatile, t, e);
4466
+ remember(n, e) {
4467
+ this._set(this._volatile, n, e);
4161
4468
  }
4162
4469
  /**
4163
4470
  * Sets the value with the specified key in the persistent {@link localStorage}.
@@ -4179,8 +4486,8 @@ class ot {
4179
4486
  * @param key The key of the value to set.
4180
4487
  * @param newValue The new value to set. If it's `undefined` or omitted, the key is removed instead.
4181
4488
  */
4182
- write(t, e) {
4183
- this._set(this._persistent, t, e);
4489
+ write(n, e) {
4490
+ this._set(this._persistent, n, e);
4184
4491
  }
4185
4492
  /**
4186
4493
  * Removes the value with the specified key from the default storage.
@@ -4199,8 +4506,8 @@ class ot {
4199
4506
  * Whether to prefer the persistent {@link localStorage} over the volatile {@link sessionStorage}.
4200
4507
  * If omitted, it defaults to the `preferPersistence` value set in the constructor.
4201
4508
  */
4202
- delete(t, e) {
4203
- (e ? this._persistent : this._volatile).removeItem(t);
4509
+ delete(n, e) {
4510
+ (e ? this._persistent : this._volatile).removeItem(n);
4204
4511
  }
4205
4512
  /**
4206
4513
  * Removes the value with the specified key from the volatile {@link sessionStorage}.
@@ -4216,8 +4523,8 @@ class ot {
4216
4523
  *
4217
4524
  * @param key The key of the value to remove.
4218
4525
  */
4219
- forget(t) {
4220
- this._volatile.removeItem(t);
4526
+ forget(n) {
4527
+ this._volatile.removeItem(n);
4221
4528
  }
4222
4529
  /**
4223
4530
  * Removes the value with the specified key from the persistent {@link localStorage}.
@@ -4233,8 +4540,8 @@ class ot {
4233
4540
  *
4234
4541
  * @param key The key of the value to remove.
4235
4542
  */
4236
- erase(t) {
4237
- this._persistent.removeItem(t);
4543
+ erase(n) {
4544
+ this._persistent.removeItem(n);
4238
4545
  }
4239
4546
  /**
4240
4547
  * Removes the value with the specified key from both the
@@ -4251,12 +4558,12 @@ class ot {
4251
4558
  *
4252
4559
  * @param key The key of the value to remove.
4253
4560
  */
4254
- clear(t) {
4255
- this._volatile.removeItem(t), this._persistent.removeItem(t);
4561
+ clear(n) {
4562
+ this._volatile.removeItem(n), this._persistent.removeItem(n);
4256
4563
  }
4257
4564
  }
4258
- var Se;
4259
- Se = Symbol.toStringTag;
4565
+ var Re;
4566
+ Re = Symbol.toStringTag;
4260
4567
  const R = class R {
4261
4568
  /**
4262
4569
  * Initializes a new instance of the {@link SmartPromise} class.
@@ -4277,7 +4584,7 @@ const R = class R {
4277
4584
  * The function responsible for eventually resolving or rejecting the promise.
4278
4585
  * Similarly to the native {@link Promise} object, it's immediately executed after the promise is created.
4279
4586
  */
4280
- constructor(t) {
4587
+ constructor(n) {
4281
4588
  /**
4282
4589
  * A flag indicating whether the promise is still pending or not.
4283
4590
  *
@@ -4303,12 +4610,12 @@ const R = class R {
4303
4610
  * The native {@link Promise} object wrapped by this instance.
4304
4611
  */
4305
4612
  a(this, "_promise");
4306
- a(this, Se, "SmartPromise");
4613
+ a(this, Re, "SmartPromise");
4307
4614
  this._isPending = !0, this._isFulfilled = !1, this._isRejected = !1;
4308
- const e = (s) => (this._isPending = !1, this._isFulfilled = !0, s), n = (s) => {
4615
+ const e = (s) => (this._isPending = !1, this._isFulfilled = !0, s), t = (s) => {
4309
4616
  throw this._isPending = !1, this._isRejected = !0, s;
4310
4617
  };
4311
- this._promise = new Promise(t).then(e, n);
4618
+ this._promise = new Promise(n).then(e, t);
4312
4619
  }
4313
4620
  /**
4314
4621
  * Wraps a new {@link SmartPromise} object around an existing native {@link Promise} object.
@@ -4333,8 +4640,8 @@ const R = class R {
4333
4640
  *
4334
4641
  * @returns A new {@link SmartPromise} object that wraps the provided promise.
4335
4642
  */
4336
- static FromPromise(t) {
4337
- return new R((e, n) => t.then(e, n));
4643
+ static FromPromise(n) {
4644
+ return new R((e, t) => n.then(e, t));
4338
4645
  }
4339
4646
  /**
4340
4647
  * A flag indicating whether the promise is still pending or not.
@@ -4354,11 +4661,11 @@ const R = class R {
4354
4661
  get isRejected() {
4355
4662
  return this._isRejected;
4356
4663
  }
4357
- then(t, e) {
4358
- return this._promise.then(t, e);
4664
+ then(n, e) {
4665
+ return this._promise.then(n, e);
4359
4666
  }
4360
- catch(t) {
4361
- return this._promise.catch(t);
4667
+ catch(n) {
4668
+ return this._promise.catch(n);
4362
4669
  }
4363
4670
  /**
4364
4671
  * Attaches a callback that executes right after the promise is settled, regardless of the outcome.
@@ -4386,13 +4693,13 @@ const R = class R {
4386
4693
  *
4387
4694
  * @returns A new {@link Promise} that executes the callback once the promise is settled.
4388
4695
  */
4389
- finally(t) {
4390
- return this._promise.finally(t);
4696
+ finally(n) {
4697
+ return this._promise.finally(n);
4391
4698
  }
4392
4699
  };
4393
- let k = R;
4394
- var Te, Ee;
4395
- class He extends (Ee = k, Te = Symbol.toStringTag, Ee) {
4700
+ let S = R;
4701
+ var Fe, Pe;
4702
+ class Ze extends (Pe = S, Fe = Symbol.toStringTag, Pe) {
4396
4703
  /**
4397
4704
  * Initializes a new instance of the {@link DeferredPromise} class.
4398
4705
  *
@@ -4408,7 +4715,7 @@ class He extends (Ee = k, Te = Symbol.toStringTag, Ee) {
4408
4715
  * @param onFulfilled The callback to execute once the promise is fulfilled.
4409
4716
  * @param onRejected The callback to execute once the promise is rejected.
4410
4717
  */
4411
- constructor(e, n) {
4718
+ constructor(e, t) {
4412
4719
  let s, r;
4413
4720
  super((o, l) => {
4414
4721
  s = o, r = l;
@@ -4427,8 +4734,8 @@ class He extends (Ee = k, Te = Symbol.toStringTag, Ee) {
4427
4734
  * If you're looking for the public and readonly property, use the {@link DeferredPromise.reject} getter instead.
4428
4735
  */
4429
4736
  a(this, "_reject");
4430
- a(this, Te, "DeferredPromise");
4431
- this._promise = this._promise.then(e, n), this._resolve = s, this._reject = r;
4737
+ a(this, Fe, "DeferredPromise");
4738
+ this._promise = this._promise.then(e, t), this._resolve = s, this._reject = r;
4432
4739
  }
4433
4740
  /**
4434
4741
  * The exposed function that allows to reject the promise.
@@ -4466,8 +4773,8 @@ class He extends (Ee = k, Te = Symbol.toStringTag, Ee) {
4466
4773
  return e.then(this.resolve, this.reject), this;
4467
4774
  }
4468
4775
  }
4469
- var Me, Re;
4470
- class at extends (Re = k, Me = Symbol.toStringTag, Re) {
4776
+ var Ce, je;
4777
+ class dt extends (je = S, Ce = Symbol.toStringTag, je) {
4471
4778
  /**
4472
4779
  * Initializes a new instance of the {@link TimedPromise} class.
4473
4780
  *
@@ -4490,52 +4797,52 @@ class at extends (Re = k, Me = Symbol.toStringTag, Re) {
4490
4797
  *
4491
4798
  * @param timeout The maximum time in milliseconds that the operation can take before timing out.
4492
4799
  */
4493
- constructor(e, n) {
4800
+ constructor(e, t) {
4494
4801
  super((s, r) => {
4495
- const o = (S) => {
4496
- clearTimeout(P), s(S);
4497
- }, l = (S) => {
4498
- clearTimeout(P), r(S);
4499
- }, P = setTimeout(() => l(new Ye("The operation has timed out.")), n);
4802
+ const o = (T) => {
4803
+ clearTimeout(P), s(T);
4804
+ }, l = (T) => {
4805
+ clearTimeout(P), r(T);
4806
+ }, P = setTimeout(() => l(new Ke("The operation has timed out.")), t);
4500
4807
  e(o, l);
4501
4808
  });
4502
- a(this, Me, "TimedPromise");
4809
+ a(this, Ce, "TimedPromise");
4503
4810
  }
4504
4811
  }
4505
- var M = /* @__PURE__ */ ((i) => (i[i.Millisecond = 1] = "Millisecond", i[i.Second = 1e3] = "Second", i[i.Minute = 6e4] = "Minute", i[i.Hour = 36e5] = "Hour", i[i.Day = 864e5] = "Day", i[i.Week = 6048e5] = "Week", i[i.Month = 2592e6] = "Month", i[i.Year = 31536e6] = "Year", i))(M || {}), Qe = /* @__PURE__ */ ((i) => (i[i.Sunday = 0] = "Sunday", i[i.Monday = 1] = "Monday", i[i.Tuesday = 2] = "Tuesday", i[i.Wednesday = 3] = "Wednesday", i[i.Thursday = 4] = "Thursday", i[i.Friday = 5] = "Friday", i[i.Saturday = 6] = "Saturday", i))(Qe || {});
4506
- function lt(i, t, e = 864e5) {
4507
- let n;
4508
- return i = new Date(i), t = new Date(t), i < t ? n = Math.floor : n = Math.ceil, n((t.getTime() - i.getTime()) / e);
4812
+ var M = /* @__PURE__ */ ((i) => (i[i.Millisecond = 1] = "Millisecond", i[i.Second = 1e3] = "Second", i[i.Minute = 6e4] = "Minute", i[i.Hour = 36e5] = "Hour", i[i.Day = 864e5] = "Day", i[i.Week = 6048e5] = "Week", i[i.Month = 2592e6] = "Month", i[i.Year = 31536e6] = "Year", i))(M || {}), We = /* @__PURE__ */ ((i) => (i[i.Sunday = 0] = "Sunday", i[i.Monday = 1] = "Monday", i[i.Tuesday = 2] = "Tuesday", i[i.Wednesday = 3] = "Wednesday", i[i.Thursday = 4] = "Thursday", i[i.Friday = 5] = "Friday", i[i.Saturday = 6] = "Saturday", i))(We || {});
4813
+ function wt(i, n, e = 864e5) {
4814
+ let t;
4815
+ return i = new Date(i), n = new Date(n), i < n ? t = Math.floor : t = Math.ceil, t((n.getTime() - i.getTime()) / e);
4509
4816
  }
4510
- function ct(i, t, e = 864e5) {
4511
- if (i = new Date(i), t = new Date(t), i >= t)
4817
+ function mt(i, n, e = 864e5) {
4818
+ if (i = new Date(i), n = new Date(n), i >= n)
4512
4819
  throw new b("The end date must be greater than the start date.");
4513
- return new c(function* () {
4514
- const n = t.getTime();
4820
+ return new u(function* () {
4821
+ const t = n.getTime();
4515
4822
  let s = i.getTime();
4516
- for (; s < n; )
4823
+ for (; s < t; )
4517
4824
  yield new Date(s), s += e;
4518
4825
  });
4519
4826
  }
4520
- function Ve(i, t = 864e5) {
4521
- if (t <= 1)
4827
+ function Ue(i, n = 864e5) {
4828
+ if (n <= 1)
4522
4829
  throw new b(
4523
4830
  "Rounding a timestamp by milliseconds or less makes no sense.Use the timestamp value directly instead."
4524
4831
  );
4525
- if (t > 864e5)
4832
+ if (n > 864e5)
4526
4833
  throw new b(
4527
4834
  "Rounding by more than a day leads to unexpected results. Consider using other methods to round dates by weeks, months or years."
4528
4835
  );
4529
- return i = new Date(i), new Date(Math.floor(i.getTime() / t) * t);
4836
+ return i = new Date(i), new Date(Math.floor(i.getTime() / n) * n);
4530
4837
  }
4531
- function ut(i, t = 0) {
4838
+ function pt(i, n = 0) {
4532
4839
  i = new Date(i);
4533
- const e = 7 - t, n = (i.getUTCDay() + e) % 7, s = i.getTime() - 864e5 * n;
4534
- return Ve(new Date(s));
4840
+ const e = 7 - n, t = (i.getUTCDay() + e) % 7, s = i.getTime() - 864e5 * t;
4841
+ return Ue(new Date(s));
4535
4842
  }
4536
- var Fe;
4537
- Fe = Symbol.toStringTag;
4538
- class qe {
4843
+ var Ie;
4844
+ Ie = Symbol.toStringTag;
4845
+ class Je {
4539
4846
  /**
4540
4847
  * Initializes a new instance of the {@link GameLoop} class.
4541
4848
  *
@@ -4552,7 +4859,7 @@ class qe {
4552
4859
  * @param msIfNotBrowser
4553
4860
  * The interval in milliseconds that will be used if the current environment isn't a browser. Default is `40`.
4554
4861
  */
4555
- constructor(t, e = 40) {
4862
+ constructor(n, e = 40) {
4556
4863
  /**
4557
4864
  * The handle of the interval or the animation frame, depending on the environment.
4558
4865
  * It's used to stop the game loop when the {@link GameLoop._stop} method is called.
@@ -4592,14 +4899,14 @@ class qe {
4592
4899
  * {@link cancelAnimationFrame} or the {@link clearInterval} function.
4593
4900
  */
4594
4901
  a(this, "_stop");
4595
- a(this, Fe, "GameLoop");
4596
- this._startTime = 0, this._isRunning = !1, Oe ? (this._start = () => {
4597
- t(this.elapsedTime), this._handle = window.requestAnimationFrame(this._start);
4902
+ a(this, Ie, "GameLoop");
4903
+ this._startTime = 0, this._isRunning = !1, De ? (this._start = () => {
4904
+ n(this.elapsedTime), this._handle = window.requestAnimationFrame(this._start);
4598
4905
  }, this._stop = () => window.cancelAnimationFrame(this._handle)) : (console.warn(
4599
4906
  `Not a browser environment detected. Using setInterval@${e}ms instead of requestAnimationFrame...`
4600
4907
  ), this._start = () => {
4601
- this._handle = setInterval(() => t(this.elapsedTime), e);
4602
- }, this._stop = () => clearInterval(this._handle)), this._publisher = new E();
4908
+ this._handle = setInterval(() => n(this.elapsedTime), e);
4909
+ }, this._stop = () => clearInterval(this._handle)), this._publisher = new v();
4603
4910
  }
4604
4911
  /**
4605
4912
  * The time when the game loop has started.
@@ -4639,10 +4946,10 @@ class qe {
4639
4946
  *
4640
4947
  * @param elapsedTime The elapsed time to set as default when the game loop starts. Default is `0`.
4641
4948
  */
4642
- start(t = 0) {
4949
+ start(n = 0) {
4643
4950
  if (this._isRunning)
4644
- throw new y("The game loop has already been started.");
4645
- this._startTime = performance.now() - t, this._start(), this._isRunning = !0, this._publisher.publish("start");
4951
+ throw new p("The game loop has already been started.");
4952
+ this._startTime = performance.now() - n, this._start(), this._isRunning = !0, this._publisher.publish("start");
4646
4953
  }
4647
4954
  /**
4648
4955
  * Stops the execution of the game loop.
@@ -4659,9 +4966,9 @@ class qe {
4659
4966
  */
4660
4967
  stop() {
4661
4968
  if (!this._isRunning)
4662
- throw new y("The game loop had already stopped or hadn't yet started.");
4969
+ throw new p("The game loop had already stopped or hadn't yet started.");
4663
4970
  if (!this._handle)
4664
- throw new x();
4971
+ throw new g();
4665
4972
  this._stop(), this._handle = void 0, this._isRunning = !1, this._publisher.publish("stop");
4666
4973
  }
4667
4974
  /**
@@ -4680,8 +4987,8 @@ class qe {
4680
4987
  *
4681
4988
  * @returns A function that can be used to unsubscribe from the event.
4682
4989
  */
4683
- onStart(t) {
4684
- return this._publisher.subscribe("start", t);
4990
+ onStart(n) {
4991
+ return this._publisher.subscribe("start", n);
4685
4992
  }
4686
4993
  /**
4687
4994
  * Subscribes to the `stop` event of the game loop.
@@ -4699,12 +5006,12 @@ class qe {
4699
5006
  *
4700
5007
  * @returns A function that can be used to unsubscribe from the event.
4701
5008
  */
4702
- onStop(t) {
4703
- return this._publisher.subscribe("stop", t);
5009
+ onStop(n) {
5010
+ return this._publisher.subscribe("stop", n);
4704
5011
  }
4705
5012
  }
4706
- var Pe, Ce;
4707
- class ht extends (Ce = qe, Pe = Symbol.toStringTag, Ce) {
5013
+ var Ae, Ne;
5014
+ class yt extends (Ne = Je, Ae = Symbol.toStringTag, Ne) {
4708
5015
  /**
4709
5016
  * Initializes a new instance of the {@link Clock} class.
4710
5017
  *
@@ -4722,13 +5029,13 @@ class ht extends (Ce = qe, Pe = Symbol.toStringTag, Ce) {
4722
5029
  * `TimeUnit.Second` by default.
4723
5030
  */
4724
5031
  constructor(e = M.Second) {
4725
- super((n) => this._publisher.publish("tick", n), e);
5032
+ super((t) => this._publisher.publish("tick", t), e);
4726
5033
  /**
4727
5034
  * The {@link Publisher} object that will be used to publish the events of the clock.
4728
5035
  */
4729
5036
  a(this, "_publisher");
4730
- a(this, Pe, "Clock");
4731
- this._publisher = new E();
5037
+ a(this, Ae, "Clock");
5038
+ this._publisher = new v();
4732
5039
  }
4733
5040
  /**
4734
5041
  * Starts the execution of the clock.
@@ -4749,7 +5056,7 @@ class ht extends (Ce = qe, Pe = Symbol.toStringTag, Ce) {
4749
5056
  */
4750
5057
  start(e = 0) {
4751
5058
  if (this._isRunning)
4752
- throw new y("The clock has already been started.");
5059
+ throw new p("The clock has already been started.");
4753
5060
  this._startTime = performance.now() - e, this._start(), this._isRunning = !0, this._publisher.publish("start");
4754
5061
  }
4755
5062
  /**
@@ -4767,9 +5074,9 @@ class ht extends (Ce = qe, Pe = Symbol.toStringTag, Ce) {
4767
5074
  */
4768
5075
  stop() {
4769
5076
  if (!this._isRunning)
4770
- throw new y("The clock had already stopped or hadn't yet started.");
5077
+ throw new p("The clock had already stopped or hadn't yet started.");
4771
5078
  if (!this._handle)
4772
- throw new x();
5079
+ throw new g();
4773
5080
  this._stop(), this._handle = void 0, this._isRunning = !1, this._publisher.publish("stop");
4774
5081
  }
4775
5082
  /**
@@ -4796,19 +5103,19 @@ class ht extends (Ce = qe, Pe = Symbol.toStringTag, Ce) {
4796
5103
  *
4797
5104
  * @returns A function that can be used to unsubscribe from the event.
4798
5105
  */
4799
- onTick(e, n = 0) {
4800
- if (n < 0)
5106
+ onTick(e, t = 0) {
5107
+ if (t < 0)
4801
5108
  throw new b("The tick step must be a non-negative number.");
4802
- if (n === 0)
5109
+ if (t === 0)
4803
5110
  return this._publisher.subscribe("tick", e);
4804
5111
  let s = 0;
4805
5112
  return this._publisher.subscribe("tick", (r) => {
4806
- r - s < n || (e(r), s = r);
5113
+ r - s < t || (e(r), s = r);
4807
5114
  });
4808
5115
  }
4809
5116
  }
4810
- var je, Ie;
4811
- class ft extends (Ie = qe, je = Symbol.toStringTag, Ie) {
5117
+ var Oe, $e;
5118
+ class _t extends ($e = Je, Oe = Symbol.toStringTag, $e) {
4812
5119
  /**
4813
5120
  * Initializes a new instance of the {@link Countdown} class.
4814
5121
  *
@@ -4828,11 +5135,11 @@ class ft extends (Ie = qe, je = Symbol.toStringTag, Ie) {
4828
5135
  * The interval in milliseconds at which the countdown will tick if the environment is not a browser.
4829
5136
  * `TimeUnit.Second` by default.
4830
5137
  */
4831
- constructor(e, n = M.Second) {
5138
+ constructor(e, t = M.Second) {
4832
5139
  super(() => {
4833
5140
  const r = this.remainingTime;
4834
5141
  r <= 0 ? (this._deferrerStop(), this._publisher.publish("tick", 0), this._publisher.publish("expire")) : this._publisher.publish("tick", r);
4835
- }, n);
5142
+ }, t);
4836
5143
  /**
4837
5144
  * The {@link Publisher} object that will be used to publish the events of the countdown.
4838
5145
  */
@@ -4848,8 +5155,8 @@ class ft extends (Ie = qe, je = Symbol.toStringTag, Ie) {
4848
5155
  * The {@link DeferredPromise} that will be resolved or rejected when the countdown expires or stops.
4849
5156
  */
4850
5157
  a(this, "_deferrer");
4851
- a(this, je, "Countdown");
4852
- this._publisher = new E(), this._duration = e;
5158
+ a(this, Oe, "Countdown");
5159
+ this._publisher = new v(), this._duration = e;
4853
5160
  }
4854
5161
  /**
4855
5162
  * The total duration of the countdown in milliseconds.
@@ -4878,9 +5185,9 @@ class ft extends (Ie = qe, je = Symbol.toStringTag, Ie) {
4878
5185
  */
4879
5186
  _deferrerStop(e) {
4880
5187
  if (!this._isRunning)
4881
- throw new y("The countdown hadn't yet started.");
5188
+ throw new p("The countdown hadn't yet started.");
4882
5189
  if (!this._deferrer)
4883
- throw new x();
5190
+ throw new g();
4884
5191
  this._stop(), this._handle = void 0, this._isRunning = !1, e !== void 0 ? this._deferrer.reject(e) : this._deferrer.resolve(), this._deferrer = void 0;
4885
5192
  }
4886
5193
  /**
@@ -4906,10 +5213,10 @@ class ft extends (Ie = qe, je = Symbol.toStringTag, Ie) {
4906
5213
  */
4907
5214
  start(e = this.duration) {
4908
5215
  if (this._isRunning)
4909
- throw new y("The countdown had already stopped or hadn't yet started.");
5216
+ throw new p("The countdown had already stopped or hadn't yet started.");
4910
5217
  if (this._deferrer)
4911
- throw new x();
4912
- return this._deferrer = new He(), super.start(this.duration - e), this._publisher.publish("start"), this._deferrer;
5218
+ throw new g();
5219
+ return this._deferrer = new Ze(), super.start(this.duration - e), this._publisher.publish("start"), this._deferrer;
4913
5220
  }
4914
5221
  /**
4915
5222
  * Stops the execution of the countdown.
@@ -4979,22 +5286,22 @@ class ft extends (Ie = qe, je = Symbol.toStringTag, Ie) {
4979
5286
  *
4980
5287
  * @returns A function that can be used to unsubscribe from the event.
4981
5288
  */
4982
- onTick(e, n = 0) {
4983
- if (n < 0)
5289
+ onTick(e, t = 0) {
5290
+ if (t < 0)
4984
5291
  throw new b("The tick step must be a non-negative number.");
4985
- if (n === 0)
5292
+ if (t === 0)
4986
5293
  return this._publisher.subscribe("tick", e);
4987
5294
  let s = this.remainingTime;
4988
5295
  return this._publisher.subscribe("tick", (r) => {
4989
- s - r < n || (e(r), s = r);
5296
+ s - r < t || (e(r), s = r);
4990
5297
  });
4991
5298
  }
4992
5299
  }
4993
- var Ae;
4994
- Ae = Symbol.toStringTag;
4995
- class dt {
5300
+ var ze;
5301
+ ze = Symbol.toStringTag;
5302
+ class bt {
4996
5303
  constructor() {
4997
- a(this, Ae, "Curve");
5304
+ a(this, ze, "Curve");
4998
5305
  }
4999
5306
  /**
5000
5307
  * Generates a given number of values following a linear curve.
@@ -5016,11 +5323,11 @@ class dt {
5016
5323
  *
5017
5324
  * @returns A {@link SmartIterator} object that generates the values following a linear curve.
5018
5325
  */
5019
- static Linear(t) {
5020
- const e = t - 1;
5021
- return new c(function* () {
5022
- for (let n = 0; n < t; n += 1)
5023
- yield n / e;
5326
+ static Linear(n) {
5327
+ const e = n - 1;
5328
+ return new u(function* () {
5329
+ for (let t = 0; t < n; t += 1)
5330
+ yield t / e;
5024
5331
  });
5025
5332
  }
5026
5333
  /**
@@ -5051,21 +5358,21 @@ class dt {
5051
5358
  *
5052
5359
  * @returns A {@link SmartIterator} object that generates the values following an exponential curve.
5053
5360
  */
5054
- static Exponential(t, e = 2) {
5361
+ static Exponential(n, e = 2) {
5055
5362
  if (e < 0)
5056
5363
  throw new d("The base of the exponential curve cannot be negative.");
5057
- const n = t - 1;
5058
- return new c(function* () {
5059
- for (let s = 0; s < t; s += 1)
5060
- yield Math.pow(s / n, e);
5364
+ const t = n - 1;
5365
+ return new u(function* () {
5366
+ for (let s = 0; s < n; s += 1)
5367
+ yield Math.pow(s / t, e);
5061
5368
  });
5062
5369
  }
5063
5370
  }
5064
- var Ne;
5065
- Ne = Symbol.toStringTag;
5371
+ var qe;
5372
+ qe = Symbol.toStringTag;
5066
5373
  const F = class F {
5067
5374
  constructor() {
5068
- a(this, Ne, "Random");
5375
+ a(this, qe, "Random");
5069
5376
  }
5070
5377
  /**
5071
5378
  * Generates a random boolean value.
@@ -5089,14 +5396,14 @@ const F = class F {
5089
5396
  *
5090
5397
  * @returns A random boolean value.
5091
5398
  */
5092
- static Boolean(t = 0.5) {
5093
- return Math.random() < t;
5399
+ static Boolean(n = 0.5) {
5400
+ return Math.random() < n;
5094
5401
  }
5095
- static Integer(t, e) {
5096
- return Math.floor(e === void 0 ? Math.random() * t : Math.random() * (e - t) + t);
5402
+ static Integer(n, e) {
5403
+ return Math.floor(e === void 0 ? Math.random() * n : Math.random() * (e - n) + n);
5097
5404
  }
5098
- static Decimal(t, e) {
5099
- return t === void 0 ? Math.random() : e === void 0 ? Math.random() * t : Math.random() * (e - t) + t;
5405
+ static Decimal(n, e) {
5406
+ return n === void 0 ? Math.random() : e === void 0 ? Math.random() * n : Math.random() * (e - n) + n;
5100
5407
  }
5101
5408
  /**
5102
5409
  * Picks a random valid index from a given array of elements.
@@ -5112,10 +5419,10 @@ const F = class F {
5112
5419
  *
5113
5420
  * @returns A valid random index from the given array.
5114
5421
  */
5115
- static Index(t) {
5116
- if (t.length === 0)
5422
+ static Index(n) {
5423
+ if (n.length === 0)
5117
5424
  throw new d("You must provide at least one element.");
5118
- return this.Integer(t.length);
5425
+ return this.Integer(n.length);
5119
5426
  }
5120
5427
  /**
5121
5428
  * Picks a random element from a given array of elements.
@@ -5131,89 +5438,89 @@ const F = class F {
5131
5438
  *
5132
5439
  * @returns A random element from the given array.
5133
5440
  */
5134
- static Choice(t) {
5135
- return t[F.Index(t)];
5441
+ static Choice(n) {
5442
+ return n[F.Index(n)];
5136
5443
  }
5137
5444
  };
5138
5445
  let j = F;
5139
- function wt(i) {
5140
- return new Promise((t) => setTimeout(t, i));
5446
+ function gt(i) {
5447
+ return new Promise((n) => setTimeout(n, i));
5141
5448
  }
5142
- function mt() {
5449
+ function xt() {
5143
5450
  return new Promise((i) => requestAnimationFrame(() => i()));
5144
5451
  }
5145
- function yt() {
5452
+ function vt() {
5146
5453
  return new Promise((i) => setTimeout(i));
5147
5454
  }
5148
- function _t(i, t = "text/javascript") {
5149
- return new Promise((e, n) => {
5455
+ function kt(i, n = "text/javascript") {
5456
+ return new Promise((e, t) => {
5150
5457
  const s = document.createElement("script");
5151
- s.async = !0, s.defer = !0, s.src = i, s.type = t, s.onload = (r) => e(), s.onerror = (r) => n(r), document.body.appendChild(s);
5458
+ s.async = !0, s.defer = !0, s.src = i, s.type = n, s.onload = (r) => e(), s.onerror = (r) => t(r), document.body.appendChild(s);
5152
5459
  });
5153
5460
  }
5154
- function pt(...i) {
5155
- return new c(function* () {
5156
- for (const t of i)
5157
- for (const e of t)
5461
+ function St(...i) {
5462
+ return new u(function* () {
5463
+ for (const n of i)
5464
+ for (const e of n)
5158
5465
  yield e;
5159
5466
  });
5160
5467
  }
5161
- function bt(i) {
5468
+ function Tt(i) {
5162
5469
  if (i instanceof Array)
5163
5470
  return i.length;
5164
- let t = 0;
5471
+ let n = 0;
5165
5472
  for (const e of i)
5166
- t += 1;
5167
- return t;
5473
+ n += 1;
5474
+ return n;
5168
5475
  }
5169
- function xt(i) {
5170
- return new c(function* () {
5171
- let t = 0;
5476
+ function Et(i) {
5477
+ return new u(function* () {
5478
+ let n = 0;
5172
5479
  for (const e of i)
5173
- yield [t, e], t += 1;
5480
+ yield [n, e], n += 1;
5174
5481
  });
5175
5482
  }
5176
- function gt(i, t, e = 1) {
5483
+ function Mt(i, n, e = 1) {
5177
5484
  if (e <= 0)
5178
5485
  throw new b(
5179
5486
  "Step must be always a positive number, even when generating numbers in reverse order."
5180
5487
  );
5181
- return t === void 0 && (t = i, i = 0), i > t ? new c(function* () {
5182
- for (let n = i; n > t; n -= e)
5183
- yield n;
5184
- }) : new c(function* () {
5185
- for (let n = i; n < t; n += e)
5186
- yield n;
5488
+ return n === void 0 && (n = i, i = 0), i > n ? new u(function* () {
5489
+ for (let t = i; t > n; t -= e)
5490
+ yield t;
5491
+ }) : new u(function* () {
5492
+ for (let t = i; t < n; t += e)
5493
+ yield t;
5187
5494
  });
5188
5495
  }
5189
- function vt(i) {
5190
- const t = Array.from(i);
5191
- for (let e = t.length - 1; e > 0; e -= 1) {
5192
- const n = Math.floor(Math.random() * (e + 1));
5193
- [t[e], t[n]] = [t[n], t[e]];
5496
+ function Rt(i) {
5497
+ const n = Array.from(i);
5498
+ for (let e = n.length - 1; e > 0; e -= 1) {
5499
+ const t = Math.floor(Math.random() * (e + 1));
5500
+ [n[e], n[t]] = [n[t], n[e]];
5194
5501
  }
5195
- return t;
5502
+ return n;
5196
5503
  }
5197
- function kt(i) {
5198
- return new c(function* () {
5199
- const t = /* @__PURE__ */ new Set();
5504
+ function Ft(i) {
5505
+ return new u(function* () {
5506
+ const n = /* @__PURE__ */ new Set();
5200
5507
  for (const e of i)
5201
- t.has(e) || (t.add(e), yield e);
5508
+ n.has(e) || (n.add(e), yield e);
5202
5509
  });
5203
5510
  }
5204
- function Xe(i, t) {
5205
- const e = i[Symbol.iterator](), n = t[Symbol.iterator]();
5206
- return new c(function* () {
5511
+ function et(i, n) {
5512
+ const e = i[Symbol.iterator](), t = n[Symbol.iterator]();
5513
+ return new u(function* () {
5207
5514
  for (; ; ) {
5208
- const s = e.next(), r = n.next();
5515
+ const s = e.next(), r = t.next();
5209
5516
  if (s.done || r.done)
5210
5517
  break;
5211
5518
  yield [s.value, r.value];
5212
5519
  }
5213
5520
  });
5214
5521
  }
5215
- function St(i, t) {
5216
- if (t === void 0) {
5522
+ function Pt(i, n) {
5523
+ if (n === void 0) {
5217
5524
  let r = 0, o = 0;
5218
5525
  for (const l of i)
5219
5526
  r += l, o += 1;
@@ -5221,94 +5528,96 @@ function St(i, t) {
5221
5528
  throw new d("You must provide at least one value.");
5222
5529
  return r / o;
5223
5530
  }
5224
- let e = 0, n = 0, s = 0;
5225
- for (const [r, o] of Xe(i, t)) {
5531
+ let e = 0, t = 0, s = 0;
5532
+ for (const [r, o] of et(i, n)) {
5226
5533
  if (o <= 0)
5227
5534
  throw new d(`The weight for the value #${s} must be greater than zero.`);
5228
- e += r * o, n += o, s += 1;
5535
+ e += r * o, t += o, s += 1;
5229
5536
  }
5230
5537
  if (s === 0)
5231
5538
  throw new d("You must provide at least one value and weight.");
5232
- if (n <= 0)
5539
+ if (t <= 0)
5233
5540
  throw new d("The sum of weights must be greater than zero.");
5234
- return e / n;
5541
+ return e / t;
5235
5542
  }
5236
- function Tt(i) {
5237
- let t = 0;
5543
+ function Ct(i) {
5544
+ let n = 0;
5238
5545
  for (let e = 0; e < i.length; e += 1) {
5239
- const n = i.charCodeAt(e);
5240
- t = (t << 5) - t + n, t |= 0;
5546
+ const t = i.charCodeAt(e);
5547
+ n = (n << 5) - n + t, n |= 0;
5241
5548
  }
5242
- return t;
5549
+ return n;
5243
5550
  }
5244
- function Et(i) {
5245
- let t = 0;
5551
+ function jt(i) {
5552
+ let n = 0;
5246
5553
  for (const e of i)
5247
- t += e;
5248
- return t;
5554
+ n += e;
5555
+ return n;
5249
5556
  }
5250
- function Mt(i) {
5557
+ function It(i) {
5251
5558
  return `${i.charAt(0).toUpperCase()}${i.slice(1)}`;
5252
5559
  }
5253
- const Rt = "2.0.2";
5560
+ const At = "2.1.0";
5254
5561
  export {
5255
- T as AggregatedAsyncIterator,
5256
- g as AggregatedIterator,
5257
- Ge as CallableObject,
5258
- ht as Clock,
5259
- ft as Countdown,
5260
- dt as Curve,
5261
- He as DeferredPromise,
5262
- Je as EnvironmentException,
5263
- u as Exception,
5264
- x as FatalErrorException,
5265
- $e as FileException,
5266
- et as FileExistsException,
5267
- tt as FileNotFoundException,
5268
- qe as GameLoop,
5269
- ot as JSONStorage,
5270
- _ as KeyException,
5271
- nt as NetworkException,
5272
- Be as NotImplementedException,
5273
- st as PermissionException,
5274
- E as Publisher,
5562
+ E as AggregatedAsyncIterator,
5563
+ x as AggregatedIterator,
5564
+ Qe as CallableObject,
5565
+ yt as Clock,
5566
+ _t as Countdown,
5567
+ bt as Curve,
5568
+ Ze as DeferredPromise,
5569
+ Ge as EnvironmentException,
5570
+ c as Exception,
5571
+ g as FatalErrorException,
5572
+ Be as FileException,
5573
+ rt as FileExistsException,
5574
+ it as FileNotFoundException,
5575
+ Je as GameLoop,
5576
+ ft as JSONStorage,
5577
+ y as KeyException,
5578
+ ct as MapView,
5579
+ ot as NetworkException,
5580
+ Ve as NotImplementedException,
5581
+ at as PermissionException,
5582
+ v as Publisher,
5275
5583
  j as Random,
5276
5584
  b as RangeException,
5277
5585
  h as ReducedIterator,
5278
5586
  C as ReferenceException,
5279
- y as RuntimeException,
5587
+ p as RuntimeException,
5588
+ ht as SetView,
5280
5589
  f as SmartAsyncIterator,
5281
- c as SmartIterator,
5282
- k as SmartPromise,
5283
- it as SwitchableCallback,
5590
+ u as SmartIterator,
5591
+ S as SmartPromise,
5592
+ ut as SwitchableCallback,
5284
5593
  M as TimeUnit,
5285
- at as TimedPromise,
5286
- Ye as TimeoutException,
5287
- rt as TypeException,
5288
- Rt as VERSION,
5594
+ dt as TimedPromise,
5595
+ Ke as TimeoutException,
5596
+ lt as TypeException,
5597
+ At as VERSION,
5289
5598
  d as ValueException,
5290
- Qe as WeekDay,
5291
- St as average,
5292
- Mt as capitalize,
5293
- pt as chain,
5294
- bt as count,
5295
- lt as dateDifference,
5296
- ct as dateRange,
5297
- Ve as dateRound,
5298
- wt as delay,
5299
- xt as enumerate,
5300
- ut as getWeek,
5301
- Tt as hash,
5302
- Oe as isBrowser,
5303
- We as isNode,
5304
- Ue as isWorker,
5305
- _t as loadScript,
5306
- mt as nextAnimationFrame,
5307
- gt as range,
5308
- vt as shuffle,
5309
- Et as sum,
5310
- kt as unique,
5311
- yt as yieldToEventLoop,
5312
- Xe as zip
5599
+ We as WeekDay,
5600
+ Pt as average,
5601
+ It as capitalize,
5602
+ St as chain,
5603
+ Tt as count,
5604
+ wt as dateDifference,
5605
+ mt as dateRange,
5606
+ Ue as dateRound,
5607
+ gt as delay,
5608
+ Et as enumerate,
5609
+ pt as getWeek,
5610
+ Ct as hash,
5611
+ De as isBrowser,
5612
+ nt as isNode,
5613
+ st as isWorker,
5614
+ kt as loadScript,
5615
+ xt as nextAnimationFrame,
5616
+ Mt as range,
5617
+ Rt as shuffle,
5618
+ jt as sum,
5619
+ Ft as unique,
5620
+ vt as yieldToEventLoop,
5621
+ et as zip
5313
5622
  };
5314
- //# sourceMappingURL=core.js.map
5623
+ //# sourceMappingURL=core.esm.js.map