@byloth/core 2.0.0-rc.3 → 2.0.0-rc.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/core.js CHANGED
@@ -1,426 +1,415 @@
1
- var P = Object.defineProperty;
2
- var j = (i, e, t) => e in i ? P(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
3
- var u = (i, e, t) => j(i, typeof e != "symbol" ? e + "" : e, t);
4
- const S = typeof window < "u" && typeof window.document < "u";
5
- var b;
6
- const $ = typeof process < "u" && ((b = process.versions) == null ? void 0 : b.node);
7
- var k;
8
- const A = typeof self == "object" && ((k = self.constructor) == null ? void 0 : k.name) === "DedicatedWorkerGlobalScope";
9
- class f extends Error {
1
+ var Ie = Object.defineProperty;
2
+ var Ae = (i, t, e) => t in i ? Ie(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
3
+ var a = (i, t, e) => Ae(i, typeof t != "symbol" ? t + "" : t, e);
4
+ const Me = typeof window < "u" && typeof window.document < "u";
5
+ var F;
6
+ const Je = typeof process < "u" && ((F = process.versions) == null ? void 0 : F.node);
7
+ var P;
8
+ const Ve = typeof self == "object" && ((P = self.constructor) == null ? void 0 : P.name) === "DedicatedWorkerGlobalScope";
9
+ var j, I;
10
+ class c extends (I = Error, j = Symbol.toStringTag, I) {
11
+ constructor(e, n, r = "Exception") {
12
+ super(e);
13
+ a(this, j, "Exception");
14
+ this.cause = n, this.name = r, n && (n instanceof Error ? this.stack += `
15
+
16
+ Caused by ${n.stack}` : this.stack += `
17
+
18
+ Caused by ${n}`);
19
+ }
10
20
  static FromUnknown(e) {
11
- if (e instanceof f)
21
+ if (e instanceof c)
12
22
  return e;
13
23
  if (e instanceof Error) {
14
- const t = new f(e.message);
15
- return t.stack = e.stack, t.name = e.name, t;
24
+ const n = new c(e.message);
25
+ return n.stack = e.stack, n.name = e.name, n;
16
26
  }
17
- return new f(`${e}`);
18
- }
19
- constructor(e, t, n = "Exception") {
20
- super(e), this.cause = t, this.name = n, t && (t instanceof Error ? this.stack += `
21
-
22
- Caused by ${t.stack}` : this.stack += `
23
-
24
- Caused by ${t}`);
25
- }
26
- get [Symbol.toStringTag]() {
27
- return "Exception";
27
+ return new c(`${e}`);
28
28
  }
29
29
  }
30
- class _ extends f {
31
- constructor(e, t, n = "FatalErrorException") {
32
- 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."), super(e, t, n);
33
- }
34
- get [Symbol.toStringTag]() {
35
- return "FatalErrorException";
30
+ var A, C;
31
+ class x extends (C = c, A = Symbol.toStringTag, C) {
32
+ constructor(e, n, r = "FatalErrorException") {
33
+ 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.");
34
+ super(e, n, r);
35
+ a(this, A, "FatalErrorException");
36
36
  }
37
37
  }
38
- class J extends _ {
39
- constructor(e, t, n = "NotImplementedException") {
40
- e === void 0 && (e = "This feature is not implemented yet. Please, try again later."), super(e, t, n);
41
- }
42
- get [Symbol.toStringTag]() {
43
- return "NotImplementedException";
38
+ var D, O;
39
+ class We extends (O = x, D = Symbol.toStringTag, O) {
40
+ constructor(e, n, r = "NotImplementedException") {
41
+ e === void 0 && (e = "This feature is not implemented yet. Please, try again later.");
42
+ super(e, n, r);
43
+ a(this, D, "NotImplementedException");
44
44
  }
45
45
  }
46
- class E extends f {
47
- constructor(e, t, n = "FileException") {
48
- super(e, t, n);
49
- }
50
- get [Symbol.toStringTag]() {
51
- return "FileException";
46
+ var q, N;
47
+ class Re extends (N = c, q = Symbol.toStringTag, N) {
48
+ constructor(e, n, r = "FileException") {
49
+ super(e, n, r);
50
+ a(this, q, "FileException");
52
51
  }
53
52
  }
54
- class V extends E {
55
- constructor(e, t, n = "FileExistsException") {
56
- super(e, t, n);
57
- }
58
- get [Symbol.toStringTag]() {
59
- return "FileExistsException";
53
+ var $, J;
54
+ class Ye extends (J = Re, $ = Symbol.toStringTag, J) {
55
+ constructor(e, n, r = "FileExistsException") {
56
+ super(e, n, r);
57
+ a(this, $, "FileExistsException");
60
58
  }
61
59
  }
62
- class W extends E {
63
- constructor(e, t, n = "FileNotFoundException") {
64
- super(e, t, n);
65
- }
66
- get [Symbol.toStringTag]() {
67
- return "FileNotFoundException";
60
+ var V, W;
61
+ class ze extends (W = Re, V = Symbol.toStringTag, W) {
62
+ constructor(e, n, r = "FileNotFoundException") {
63
+ super(e, n, r);
64
+ a(this, V, "FileNotFoundException");
68
65
  }
69
66
  }
70
- class Y extends f {
71
- constructor(e, t, n = "KeyException") {
72
- super(e, t, n);
73
- }
74
- get [Symbol.toStringTag]() {
75
- return "KeyException";
67
+ var Y, z;
68
+ class Be extends (z = c, Y = Symbol.toStringTag, z) {
69
+ constructor(e, n, r = "KeyException") {
70
+ super(e, n, r);
71
+ a(this, Y, "KeyException");
76
72
  }
77
73
  }
78
- class z extends f {
79
- constructor(e, t, n = "NetworkException") {
80
- super(e, t, n);
81
- }
82
- get [Symbol.toStringTag]() {
83
- return "NetworkException";
74
+ var B, G;
75
+ class Ge extends (G = c, B = Symbol.toStringTag, G) {
76
+ constructor(e, n, r = "NetworkException") {
77
+ super(e, n, r);
78
+ a(this, B, "NetworkException");
84
79
  }
85
80
  }
86
- class B extends f {
87
- constructor(e, t, n = "PermissionException") {
88
- super(e, t, n);
89
- }
90
- get [Symbol.toStringTag]() {
91
- return "PermissionException";
81
+ var K, H;
82
+ class Ke extends (H = c, K = Symbol.toStringTag, H) {
83
+ constructor(e, n, r = "PermissionException") {
84
+ super(e, n, r);
85
+ a(this, K, "PermissionException");
92
86
  }
93
87
  }
94
- class D extends f {
95
- constructor(e, t, n = "ReferenceException") {
96
- super(e, t, n);
97
- }
98
- get [Symbol.toStringTag]() {
99
- return "ReferenceException";
88
+ var L, Q;
89
+ class Ce extends (Q = c, L = Symbol.toStringTag, Q) {
90
+ constructor(e, n, r = "ReferenceException") {
91
+ super(e, n, r);
92
+ a(this, L, "ReferenceException");
100
93
  }
101
94
  }
102
- class y extends f {
103
- constructor(e, t, n = "RuntimeException") {
104
- super(e, t, n);
105
- }
106
- get [Symbol.toStringTag]() {
107
- return "RuntimeException";
95
+ var X, Z;
96
+ class p extends (Z = c, X = Symbol.toStringTag, Z) {
97
+ constructor(e, n, r = "RuntimeException") {
98
+ super(e, n, r);
99
+ a(this, X, "RuntimeException");
108
100
  }
109
101
  }
110
- class C extends y {
111
- constructor(e, t, n = "EnvironmentException") {
112
- super(e, t, n);
113
- }
114
- get [Symbol.toStringTag]() {
115
- return "EnvironmentException";
102
+ var U, ee;
103
+ class De extends (ee = p, U = Symbol.toStringTag, ee) {
104
+ constructor(e, n, r = "EnvironmentException") {
105
+ super(e, n, r);
106
+ a(this, U, "EnvironmentException");
116
107
  }
117
108
  }
118
- class O extends f {
119
- constructor(e, t, n = "TimeoutException") {
120
- super(e, t, n);
121
- }
122
- get [Symbol.toStringTag]() {
123
- return "TimeoutException";
109
+ var te, ne;
110
+ class Oe extends (ne = c, te = Symbol.toStringTag, ne) {
111
+ constructor(e, n, r = "TimeoutException") {
112
+ super(e, n, r);
113
+ a(this, te, "TimeoutException");
124
114
  }
125
115
  }
126
- class K extends f {
127
- constructor(e, t, n = "TypeException") {
128
- super(e, t, n);
129
- }
130
- get [Symbol.toStringTag]() {
131
- return "TypeException";
116
+ var re, se;
117
+ class He extends (se = c, re = Symbol.toStringTag, se) {
118
+ constructor(e, n, r = "TypeException") {
119
+ super(e, n, r);
120
+ a(this, re, "TypeException");
132
121
  }
133
122
  }
134
- class m extends f {
135
- constructor(e, t, n = "ValueException") {
136
- super(e, t, n);
137
- }
138
- get [Symbol.toStringTag]() {
139
- return "ValueException";
123
+ var ie, oe;
124
+ class d extends (oe = c, ie = Symbol.toStringTag, oe) {
125
+ constructor(e, n, r = "ValueException") {
126
+ super(e, n, r);
127
+ a(this, ie, "ValueException");
140
128
  }
141
129
  }
142
- class T extends m {
143
- constructor(e, t, n = "RangeException") {
144
- super(e, t, n);
145
- }
146
- get [Symbol.toStringTag]() {
147
- return "RangeException";
130
+ var ae, ue;
131
+ class Fe extends (ue = d, ae = Symbol.toStringTag, ue) {
132
+ constructor(e, n, r = "RangeException") {
133
+ super(e, n, r);
134
+ a(this, ae, "RangeException");
148
135
  }
149
136
  }
137
+ var le;
150
138
  class l {
151
- constructor(e) {
152
- u(this, "_iterator");
153
- u(this, "return");
154
- u(this, "throw");
155
- e instanceof Function ? this._iterator = e() : Symbol.iterator in e ? this._iterator = e[Symbol.iterator]() : this._iterator = e, this._iterator.return && (this.return = (t) => this._iterator.return(t)), this._iterator.throw && (this.throw = (t) => this._iterator.throw(t));
156
- }
157
- every(e) {
158
- let t = 0;
139
+ constructor(t) {
140
+ a(this, "_iterator");
141
+ a(this, "return");
142
+ a(this, "throw");
143
+ a(this, le, "SmartIterator");
144
+ t instanceof Function ? this._iterator = t() : Symbol.iterator in t ? this._iterator = t[Symbol.iterator]() : this._iterator = t, this._iterator.return && (this.return = (e) => this._iterator.return(e)), this._iterator.throw && (this.throw = (e) => this._iterator.throw(e));
145
+ }
146
+ every(t) {
147
+ let e = 0;
159
148
  for (; ; ) {
160
149
  const n = this._iterator.next();
161
150
  if (n.done)
162
151
  return !0;
163
- if (!e(n.value, t))
152
+ if (!t(n.value, e))
164
153
  return !1;
165
- t += 1;
154
+ e += 1;
166
155
  }
167
156
  }
168
- some(e) {
169
- let t = 0;
157
+ some(t) {
158
+ let e = 0;
170
159
  for (; ; ) {
171
160
  const n = this._iterator.next();
172
161
  if (n.done)
173
162
  return !1;
174
- if (e(n.value, t))
163
+ if (t(n.value, e))
175
164
  return !0;
176
- t += 1;
165
+ e += 1;
177
166
  }
178
167
  }
179
- filter(e) {
180
- const t = this._iterator;
168
+ filter(t) {
169
+ const e = this._iterator;
181
170
  return new l(function* () {
182
171
  let n = 0;
183
172
  for (; ; ) {
184
- const r = t.next();
173
+ const r = e.next();
185
174
  if (r.done)
186
175
  return r.value;
187
- e(r.value, n) && (yield r.value), n += 1;
176
+ t(r.value, n) && (yield r.value), n += 1;
188
177
  }
189
178
  });
190
179
  }
191
- map(e) {
192
- const t = this._iterator;
180
+ map(t) {
181
+ const e = this._iterator;
193
182
  return new l(function* () {
194
183
  let n = 0;
195
184
  for (; ; ) {
196
- const r = t.next();
185
+ const r = e.next();
197
186
  if (r.done)
198
187
  return r.value;
199
- yield e(r.value, n), n += 1;
188
+ yield t(r.value, n), n += 1;
200
189
  }
201
190
  });
202
191
  }
203
- reduce(e, t) {
204
- let n = 0, r = t;
192
+ reduce(t, e) {
193
+ let n = 0, r = e;
205
194
  if (r === void 0) {
206
195
  const s = this._iterator.next();
207
196
  if (s.done)
208
- throw new m("Cannot reduce an empty iterator without an initial value.");
197
+ throw new d("Cannot reduce an empty iterator without an initial value.");
209
198
  r = s.value, n += 1;
210
199
  }
211
200
  for (; ; ) {
212
201
  const s = this._iterator.next();
213
202
  if (s.done)
214
203
  return r;
215
- r = e(r, s.value, n), n += 1;
204
+ r = t(r, s.value, n), n += 1;
216
205
  }
217
206
  }
218
- flatMap(e) {
219
- const t = this._iterator;
207
+ flatMap(t) {
208
+ const e = this._iterator;
220
209
  return new l(function* () {
221
210
  let n = 0;
222
211
  for (; ; ) {
223
- const r = t.next();
212
+ const r = e.next();
224
213
  if (r.done)
225
214
  return r.value;
226
- const s = e(r.value, n);
215
+ const s = t(r.value, n);
227
216
  for (const o of s)
228
217
  yield o;
229
218
  n += 1;
230
219
  }
231
220
  });
232
221
  }
233
- drop(e) {
234
- const t = this._iterator;
222
+ drop(t) {
223
+ const e = this._iterator;
235
224
  return new l(function* () {
236
225
  let n = 0;
237
- for (; n < e; ) {
238
- if (t.next().done)
226
+ for (; n < t; ) {
227
+ if (e.next().done)
239
228
  return;
240
229
  n += 1;
241
230
  }
242
231
  for (; ; ) {
243
- const r = t.next();
232
+ const r = e.next();
244
233
  if (r.done)
245
234
  return r.value;
246
235
  yield r.value;
247
236
  }
248
237
  });
249
238
  }
250
- take(e) {
251
- const t = this._iterator;
239
+ take(t) {
240
+ const e = this._iterator;
252
241
  return new l(function* () {
253
242
  let n = 0;
254
- for (; n < e; ) {
255
- const r = t.next();
243
+ for (; n < t; ) {
244
+ const r = e.next();
256
245
  if (r.done)
257
246
  return r.value;
258
247
  yield r.value, n += 1;
259
248
  }
260
249
  });
261
250
  }
262
- find(e) {
263
- let t = 0;
251
+ find(t) {
252
+ let e = 0;
264
253
  for (; ; ) {
265
254
  const n = this._iterator.next();
266
255
  if (n.done)
267
256
  return;
268
- if (e(n.value, t))
257
+ if (t(n.value, e))
269
258
  return n.value;
270
- t += 1;
259
+ e += 1;
271
260
  }
272
261
  }
273
262
  enumerate() {
274
- return this.map((e, t) => [t, e]);
263
+ return this.map((t, e) => [e, t]);
275
264
  }
276
265
  unique() {
277
- const e = this._iterator;
266
+ const t = this._iterator;
278
267
  return new l(function* () {
279
- const t = /* @__PURE__ */ new Set();
268
+ const e = /* @__PURE__ */ new Set();
280
269
  for (; ; ) {
281
- const n = e.next();
270
+ const n = t.next();
282
271
  if (n.done)
283
272
  return n.value;
284
- t.has(n.value) || (t.add(n.value), yield n.value);
273
+ e.has(n.value) || (e.add(n.value), yield n.value);
285
274
  }
286
275
  });
287
276
  }
288
277
  count() {
289
- let e = 0;
278
+ let t = 0;
290
279
  for (; ; ) {
291
280
  if (this._iterator.next().done)
292
- return e;
293
- e += 1;
281
+ return t;
282
+ t += 1;
294
283
  }
295
284
  }
296
- forEach(e) {
297
- let t = 0;
285
+ forEach(t) {
286
+ let e = 0;
298
287
  for (; ; ) {
299
288
  const n = this._iterator.next();
300
289
  if (n.done)
301
290
  return;
302
- e(n.value, t), t += 1;
291
+ t(n.value, e), e += 1;
303
292
  }
304
293
  }
305
- next(...e) {
306
- return this._iterator.next(...e);
294
+ next(...t) {
295
+ return this._iterator.next(...t);
307
296
  }
308
- groupBy(e) {
309
- return new d(this.map((t, n) => [e(t, n), t]));
297
+ groupBy(t) {
298
+ return new g(this.map((e, n) => [t(e, n), e]));
310
299
  }
311
300
  toArray() {
312
301
  return Array.from(this);
313
302
  }
314
- get [Symbol.toStringTag]() {
315
- return "SmartIterator";
316
- }
317
- [Symbol.iterator]() {
303
+ [(le = Symbol.toStringTag, Symbol.iterator)]() {
318
304
  return this;
319
305
  }
320
306
  }
321
- class c {
322
- constructor(e) {
323
- u(this, "_elements");
324
- this._elements = new l(e);
325
- }
326
- every(e) {
327
- for (const [t, [n, r]] of this._elements.enumerate())
328
- if (!e(n, r, t))
307
+ var ce;
308
+ ce = Symbol.toStringTag;
309
+ const y = class y {
310
+ constructor(t) {
311
+ a(this, "_elements");
312
+ a(this, ce, "ReducedIterator");
313
+ this._elements = new l(t);
314
+ }
315
+ every(t) {
316
+ for (const [e, [n, r]] of this._elements.enumerate())
317
+ if (!t(n, r, e))
329
318
  return !1;
330
319
  return !0;
331
320
  }
332
- some(e) {
333
- for (const [t, [n, r]] of this._elements.enumerate())
334
- if (e(n, r, t))
321
+ some(t) {
322
+ for (const [e, [n, r]] of this._elements.enumerate())
323
+ if (t(n, r, e))
335
324
  return !0;
336
325
  return !1;
337
326
  }
338
- filter(e) {
339
- const t = this._elements.enumerate();
340
- return new c(function* () {
341
- for (const [n, [r, s]] of t)
342
- e(r, s, n) && (yield [r, s]);
327
+ filter(t) {
328
+ const e = this._elements.enumerate();
329
+ return new y(function* () {
330
+ for (const [n, [r, s]] of e)
331
+ t(r, s, n) && (yield [r, s]);
343
332
  });
344
333
  }
345
- map(e) {
346
- const t = this._elements.enumerate();
347
- return new c(function* () {
348
- for (const [n, [r, s]] of t)
349
- yield [r, e(r, s, n)];
334
+ map(t) {
335
+ const e = this._elements.enumerate();
336
+ return new y(function* () {
337
+ for (const [n, [r, s]] of e)
338
+ yield [r, t(r, s, n)];
350
339
  });
351
340
  }
352
- reduce(e, t) {
353
- let n = 0, r = t;
341
+ reduce(t, e) {
342
+ let n = 0, r = e;
354
343
  if (r === void 0) {
355
344
  const s = this._elements.next();
356
345
  if (s.done)
357
- throw new m("Cannot reduce an empty iterator without an initial value.");
346
+ throw new d("Cannot reduce an empty iterator without an initial value.");
358
347
  r = s.value[1], n += 1;
359
348
  }
360
349
  for (const [s, o] of this._elements)
361
- r = e(s, r, o, n), n += 1;
350
+ r = t(s, r, o, n), n += 1;
362
351
  return r;
363
352
  }
364
- flatMap(e) {
365
- const t = this._elements.enumerate();
366
- return new d(function* () {
367
- for (const [n, [r, s]] of t)
368
- for (const o of e(r, s, n))
353
+ flatMap(t) {
354
+ const e = this._elements.enumerate();
355
+ return new g(function* () {
356
+ for (const [n, [r, s]] of e)
357
+ for (const o of t(r, s, n))
369
358
  yield [r, o];
370
359
  });
371
360
  }
372
- drop(e) {
373
- const t = this._elements.enumerate();
374
- return new c(function* () {
375
- for (const [n, [r, s]] of t)
376
- n >= e && (yield [r, s]);
361
+ drop(t) {
362
+ const e = this._elements.enumerate();
363
+ return new y(function* () {
364
+ for (const [n, [r, s]] of e)
365
+ n >= t && (yield [r, s]);
377
366
  });
378
367
  }
379
- take(e) {
380
- const t = this._elements.enumerate();
381
- return new c(function* () {
382
- for (const [n, [r, s]] of t) {
383
- if (n >= e)
368
+ take(t) {
369
+ const e = this._elements.enumerate();
370
+ return new y(function* () {
371
+ for (const [n, [r, s]] of e) {
372
+ if (n >= t)
384
373
  break;
385
374
  yield [r, s];
386
375
  }
387
376
  });
388
377
  }
389
378
  enumerate() {
390
- return this.map((e, t, n) => [n, t]);
379
+ return this.map((t, e, n) => [n, e]);
391
380
  }
392
381
  unique() {
393
- const e = this._elements;
394
- return new c(function* () {
395
- const t = /* @__PURE__ */ new Set();
396
- for (const [n, r] of e)
397
- t.has(r) || (t.add(r), yield [n, r]);
382
+ const t = this._elements;
383
+ return new y(function* () {
384
+ const e = /* @__PURE__ */ new Set();
385
+ for (const [n, r] of t)
386
+ e.has(r) || (e.add(r), yield [n, r]);
398
387
  });
399
388
  }
400
389
  count() {
401
- let e = 0;
402
- for (const t of this._elements)
403
- e += 1;
404
- return e;
390
+ let t = 0;
391
+ for (const e of this._elements)
392
+ t += 1;
393
+ return t;
405
394
  }
406
- forEach(e) {
407
- for (const [t, [n, r]] of this._elements.enumerate())
408
- e(n, r, t);
395
+ forEach(t) {
396
+ for (const [e, [n, r]] of this._elements.enumerate())
397
+ t(n, r, e);
409
398
  }
410
399
  keys() {
411
- const e = this._elements;
400
+ const t = this._elements;
412
401
  return new l(function* () {
413
- for (const [t] of e)
414
- yield t;
402
+ for (const [e] of t)
403
+ yield e;
415
404
  });
416
405
  }
417
406
  items() {
418
407
  return this._elements;
419
408
  }
420
409
  values() {
421
- const e = this._elements;
410
+ const t = this._elements;
422
411
  return new l(function* () {
423
- for (const [t, n] of e)
412
+ for (const [e, n] of t)
424
413
  yield n;
425
414
  });
426
415
  }
@@ -433,95 +422,96 @@ class c {
433
422
  toObject() {
434
423
  return Object.fromEntries(this.items());
435
424
  }
436
- get [Symbol.toStringTag]() {
437
- return "ReducedIterator";
438
- }
439
- }
440
- class w {
441
- constructor(e) {
442
- u(this, "_elements");
443
- this._elements = new h(e);
444
- }
445
- async every(e) {
446
- const t = /* @__PURE__ */ new Map();
425
+ };
426
+ let f = y;
427
+ var fe;
428
+ fe = Symbol.toStringTag;
429
+ const m = class m {
430
+ constructor(t) {
431
+ a(this, "_elements");
432
+ a(this, fe, "AggregatedAsyncIterator");
433
+ this._elements = new h(t);
434
+ }
435
+ async every(t) {
436
+ const e = /* @__PURE__ */ new Map();
447
437
  for await (const [n, r] of this._elements) {
448
- const [s, o] = t.get(n) ?? [0, !0];
449
- o && t.set(n, [s + 1, await e(n, r, s)]);
438
+ const [s, o] = e.get(n) ?? [0, !0];
439
+ o && e.set(n, [s + 1, await t(n, r, s)]);
450
440
  }
451
- return new c(function* () {
452
- for (const [n, [r, s]] of t)
441
+ return new f(function* () {
442
+ for (const [n, [r, s]] of e)
453
443
  yield [n, s];
454
444
  });
455
445
  }
456
- async some(e) {
457
- const t = /* @__PURE__ */ new Map();
446
+ async some(t) {
447
+ const e = /* @__PURE__ */ new Map();
458
448
  for await (const [n, r] of this._elements) {
459
- const [s, o] = t.get(n) ?? [0, !1];
460
- o || t.set(n, [s + 1, await e(n, r, s)]);
449
+ const [s, o] = e.get(n) ?? [0, !1];
450
+ o || e.set(n, [s + 1, await t(n, r, s)]);
461
451
  }
462
- return new c(function* () {
463
- for (const [n, [r, s]] of t)
452
+ return new f(function* () {
453
+ for (const [n, [r, s]] of e)
464
454
  yield [n, s];
465
455
  });
466
456
  }
467
- filter(e) {
468
- const t = this._elements;
469
- return new w(async function* () {
457
+ filter(t) {
458
+ const e = this._elements;
459
+ return new m(async function* () {
470
460
  const n = /* @__PURE__ */ new Map();
471
- for await (const [r, s] of t) {
461
+ for await (const [r, s] of e) {
472
462
  const o = n.get(r) ?? 0;
473
- await e(r, s, o) && (yield [r, s]), n.set(r, o + 1);
463
+ await t(r, s, o) && (yield [r, s]), n.set(r, o + 1);
474
464
  }
475
465
  });
476
466
  }
477
- map(e) {
478
- const t = this._elements;
479
- return new w(async function* () {
467
+ map(t) {
468
+ const e = this._elements;
469
+ return new m(async function* () {
480
470
  const n = /* @__PURE__ */ new Map();
481
- for await (const [r, s] of t) {
471
+ for await (const [r, s] of e) {
482
472
  const o = n.get(r) ?? 0;
483
- yield [r, await e(r, s, o)], n.set(r, o + 1);
473
+ yield [r, await t(r, s, o)], n.set(r, o + 1);
484
474
  }
485
475
  });
486
476
  }
487
- async reduce(e, t) {
477
+ async reduce(t, e) {
488
478
  const n = /* @__PURE__ */ new Map();
489
479
  for await (const [r, s] of this._elements) {
490
- let o, a;
480
+ let o, u;
491
481
  if (n.has(r))
492
- [o, a] = n.get(r);
493
- else if (t !== void 0)
494
- o = 0, a = await t(r);
482
+ [o, u] = n.get(r);
483
+ else if (e !== void 0)
484
+ o = 0, u = await e(r);
495
485
  else {
496
486
  n.set(r, [0, s]);
497
487
  continue;
498
488
  }
499
- n.set(r, [o + 1, await e(r, a, s, o)]);
489
+ n.set(r, [o + 1, await t(r, u, s, o)]);
500
490
  }
501
- return new c(function* () {
491
+ return new f(function* () {
502
492
  for (const [r, [s, o]] of n)
503
493
  yield [r, o];
504
494
  });
505
495
  }
506
- flatMap(e) {
507
- const t = this._elements;
508
- return new w(async function* () {
496
+ flatMap(t) {
497
+ const e = this._elements;
498
+ return new m(async function* () {
509
499
  const n = /* @__PURE__ */ new Map();
510
- for await (const [r, s] of t) {
511
- const o = n.get(r) ?? 0, a = await e(r, s, o);
512
- for await (const p of a)
513
- yield [r, p];
500
+ for await (const [r, s] of e) {
501
+ const o = n.get(r) ?? 0, u = await t(r, s, o);
502
+ for await (const _ of u)
503
+ yield [r, _];
514
504
  n.set(r, o + 1);
515
505
  }
516
506
  });
517
507
  }
518
- drop(e) {
519
- const t = this._elements;
520
- return new w(async function* () {
508
+ drop(t) {
509
+ const e = this._elements;
510
+ return new m(async function* () {
521
511
  const n = /* @__PURE__ */ new Map();
522
- for await (const [r, s] of t) {
512
+ for await (const [r, s] of e) {
523
513
  const o = n.get(r) ?? 0;
524
- if (o < e) {
514
+ if (o < t) {
525
515
  n.set(r, o + 1);
526
516
  continue;
527
517
  }
@@ -529,14 +519,14 @@ class w {
529
519
  }
530
520
  });
531
521
  }
532
- take(e) {
533
- const t = this._elements;
534
- return new w(async function* () {
522
+ take(t) {
523
+ const e = this._elements;
524
+ return new m(async function* () {
535
525
  const n = /* @__PURE__ */ new Map();
536
- for await (const [r, s] of t) {
526
+ for await (const [r, s] of e) {
537
527
  const o = n.get(r) ?? 0;
538
- if (o >= e) {
539
- if (n.values().every((a) => a >= e))
528
+ if (o >= t) {
529
+ if (n.values().every((u) => u >= t))
540
530
  break;
541
531
  continue;
542
532
  }
@@ -544,110 +534,110 @@ class w {
544
534
  }
545
535
  });
546
536
  }
547
- async find(e) {
548
- const t = /* @__PURE__ */ new Map();
537
+ async find(t) {
538
+ const e = /* @__PURE__ */ new Map();
549
539
  for await (const [n, r] of this._elements) {
550
- let [s, o] = t.get(n) ?? [0, void 0];
551
- o === void 0 && (await e(n, r, s) && (o = r), t.set(n, [s + 1, o]));
540
+ let [s, o] = e.get(n) ?? [0, void 0];
541
+ o === void 0 && (await t(n, r, s) && (o = r), e.set(n, [s + 1, o]));
552
542
  }
553
- return new c(function* () {
554
- for (const [n, [r, s]] of t)
543
+ return new f(function* () {
544
+ for (const [n, [r, s]] of e)
555
545
  yield [n, s];
556
546
  });
557
547
  }
558
548
  unique() {
559
- const e = this._elements;
560
- return new w(async function* () {
561
- const t = /* @__PURE__ */ new Map();
562
- for await (const [n, r] of e) {
563
- const s = t.get(n) ?? /* @__PURE__ */ new Set();
564
- s.has(r) || (s.add(r), t.set(n, s), yield [n, r]);
549
+ const t = this._elements;
550
+ return new m(async function* () {
551
+ const e = /* @__PURE__ */ new Map();
552
+ for await (const [n, r] of t) {
553
+ const s = e.get(n) ?? /* @__PURE__ */ new Set();
554
+ s.has(r) || (s.add(r), e.set(n, s), yield [n, r]);
565
555
  }
566
556
  });
567
557
  }
568
558
  async count() {
569
- const e = /* @__PURE__ */ new Map();
570
- for await (const [t] of this._elements) {
571
- const n = e.get(t) ?? 0;
572
- e.set(t, n + 1);
559
+ const t = /* @__PURE__ */ new Map();
560
+ for await (const [e] of this._elements) {
561
+ const n = t.get(e) ?? 0;
562
+ t.set(e, n + 1);
573
563
  }
574
- return new c(function* () {
575
- for (const [t, n] of e)
576
- yield [t, n];
564
+ return new f(function* () {
565
+ for (const [e, n] of t)
566
+ yield [e, n];
577
567
  });
578
568
  }
579
- async forEach(e) {
580
- const t = /* @__PURE__ */ new Map();
569
+ async forEach(t) {
570
+ const e = /* @__PURE__ */ new Map();
581
571
  for await (const [n, r] of this._elements) {
582
- const s = t.get(n) ?? 0;
583
- e(n, r, s), t.set(n, s + 1);
572
+ const s = e.get(n) ?? 0;
573
+ t(n, r, s), e.set(n, s + 1);
584
574
  }
585
575
  }
586
576
  keys() {
587
- const e = this._elements;
577
+ const t = this._elements;
588
578
  return new h(async function* () {
589
- const t = /* @__PURE__ */ new Set();
590
- for await (const [n] of e)
591
- t.has(n) || (t.add(n), yield n);
579
+ const e = /* @__PURE__ */ new Set();
580
+ for await (const [n] of t)
581
+ e.has(n) || (e.add(n), yield n);
592
582
  });
593
583
  }
594
584
  items() {
595
585
  return this._elements;
596
586
  }
597
587
  values() {
598
- const e = this._elements;
588
+ const t = this._elements;
599
589
  return new h(async function* () {
600
- for await (const [t, n] of e)
590
+ for await (const [e, n] of t)
601
591
  yield n;
602
592
  });
603
593
  }
604
594
  async toArray() {
605
- const e = await this.toMap();
606
- return Array.from(e.values());
595
+ const t = await this.toMap();
596
+ return Array.from(t.values());
607
597
  }
608
598
  async toMap() {
609
- const e = /* @__PURE__ */ new Map();
610
- for await (const [t, n] of this._elements) {
611
- const r = e.get(t) ?? [];
612
- r.push(n), e.set(t, r);
599
+ const t = /* @__PURE__ */ new Map();
600
+ for await (const [e, n] of this._elements) {
601
+ const r = t.get(e) ?? [];
602
+ r.push(n), t.set(e, r);
613
603
  }
614
- return e;
604
+ return t;
615
605
  }
616
606
  async toObject() {
617
- const e = {};
618
- for await (const [t, n] of this._elements) {
619
- const r = e[t] ?? [];
620
- r.push(n), e[t] = r;
607
+ const t = {};
608
+ for await (const [e, n] of this._elements) {
609
+ const r = t[e] ?? [];
610
+ r.push(n), t[e] = r;
621
611
  }
622
- return e;
612
+ return t;
623
613
  }
624
- get [Symbol.toStringTag]() {
625
- return "AggregatedAsyncIterator";
626
- }
627
- }
614
+ };
615
+ let S = m;
616
+ var he;
628
617
  class h {
629
- constructor(e) {
630
- u(this, "_iterator");
631
- u(this, "return");
632
- u(this, "throw");
633
- if (e instanceof Function) {
634
- const t = e();
635
- Symbol.asyncIterator in t ? this._iterator = t : this._iterator = async function* () {
618
+ constructor(t) {
619
+ a(this, "_iterator");
620
+ a(this, "return");
621
+ a(this, "throw");
622
+ a(this, he, "SmartAsyncIterator");
623
+ if (t instanceof Function) {
624
+ const e = t();
625
+ Symbol.asyncIterator in e ? this._iterator = e : this._iterator = async function* () {
636
626
  let n = [];
637
627
  for (; ; ) {
638
- const r = t.next(...n);
628
+ const r = e.next(...n);
639
629
  if (r.done)
640
630
  return r.value;
641
631
  n = [yield r.value];
642
632
  }
643
633
  }();
644
- } else if (Symbol.asyncIterator in e)
645
- this._iterator = e[Symbol.asyncIterator]();
646
- else if (Symbol.iterator in e) {
647
- const t = e[Symbol.iterator]();
634
+ } else if (Symbol.asyncIterator in t)
635
+ this._iterator = t[Symbol.asyncIterator]();
636
+ else if (Symbol.iterator in t) {
637
+ const e = t[Symbol.iterator]();
648
638
  this._iterator = async function* () {
649
639
  for (; ; ) {
650
- const n = t.next();
640
+ const n = e.next();
651
641
  if (n.done)
652
642
  return n.value;
653
643
  yield n.value;
@@ -655,265 +645,265 @@ class h {
655
645
  }();
656
646
  } else
657
647
  this._iterator = async function* () {
658
- let t = [];
648
+ let e = [];
659
649
  for (; ; ) {
660
- const n = await e.next(...t);
650
+ const n = await t.next(...e);
661
651
  if (n.done)
662
652
  return n.value;
663
- t = [yield n.value];
653
+ e = [yield n.value];
664
654
  }
665
655
  }();
666
- this._iterator.return && (this.return = (t) => this._iterator.return(t)), this._iterator.throw && (this.throw = (t) => this._iterator.throw(t));
656
+ this._iterator.return && (this.return = (e) => this._iterator.return(e)), this._iterator.throw && (this.throw = (e) => this._iterator.throw(e));
667
657
  }
668
- async every(e) {
669
- let t = 0;
658
+ async every(t) {
659
+ let e = 0;
670
660
  for (; ; ) {
671
661
  const n = await this._iterator.next();
672
662
  if (n.done)
673
663
  return !0;
674
- if (!await e(n.value, t))
664
+ if (!await t(n.value, e))
675
665
  return !1;
676
- t += 1;
666
+ e += 1;
677
667
  }
678
668
  }
679
- async some(e) {
680
- let t = 0;
669
+ async some(t) {
670
+ let e = 0;
681
671
  for (; ; ) {
682
672
  const n = await this._iterator.next();
683
673
  if (n.done)
684
674
  return !1;
685
- if (await e(n.value, t))
675
+ if (await t(n.value, e))
686
676
  return !0;
687
- t += 1;
677
+ e += 1;
688
678
  }
689
679
  }
690
- filter(e) {
691
- const t = this._iterator;
680
+ filter(t) {
681
+ const e = this._iterator;
692
682
  return new h(async function* () {
693
683
  let n = 0;
694
684
  for (; ; ) {
695
- const r = await t.next();
685
+ const r = await e.next();
696
686
  if (r.done)
697
687
  return r.value;
698
- await e(r.value, n) && (yield r.value), n += 1;
688
+ await t(r.value, n) && (yield r.value), n += 1;
699
689
  }
700
690
  });
701
691
  }
702
- map(e) {
703
- const t = this._iterator;
692
+ map(t) {
693
+ const e = this._iterator;
704
694
  return new h(async function* () {
705
695
  let n = 0;
706
696
  for (; ; ) {
707
- const r = await t.next();
697
+ const r = await e.next();
708
698
  if (r.done)
709
699
  return r.value;
710
- yield await e(r.value, n), n += 1;
700
+ yield await t(r.value, n), n += 1;
711
701
  }
712
702
  });
713
703
  }
714
- async reduce(e, t) {
715
- let n = 0, r = t;
704
+ async reduce(t, e) {
705
+ let n = 0, r = e;
716
706
  if (r === void 0) {
717
707
  const s = await this._iterator.next();
718
708
  if (s.done)
719
- throw new m("Cannot reduce an empty iterator without an initial value.");
709
+ throw new d("Cannot reduce an empty iterator without an initial value.");
720
710
  r = s.value, n += 1;
721
711
  }
722
712
  for (; ; ) {
723
713
  const s = await this._iterator.next();
724
714
  if (s.done)
725
715
  return r;
726
- r = await e(r, s.value, n), n += 1;
716
+ r = await t(r, s.value, n), n += 1;
727
717
  }
728
718
  }
729
- flatMap(e) {
730
- const t = this._iterator;
719
+ flatMap(t) {
720
+ const e = this._iterator;
731
721
  return new h(async function* () {
732
722
  let n = 0;
733
723
  for (; ; ) {
734
- const r = await t.next();
724
+ const r = await e.next();
735
725
  if (r.done)
736
726
  return r.value;
737
- const s = await e(r.value, n);
727
+ const s = await t(r.value, n);
738
728
  for await (const o of s)
739
729
  yield o;
740
730
  n += 1;
741
731
  }
742
732
  });
743
733
  }
744
- drop(e) {
745
- const t = this._iterator;
734
+ drop(t) {
735
+ const e = this._iterator;
746
736
  return new h(async function* () {
747
737
  let n = 0;
748
- for (; n < e; ) {
749
- if ((await t.next()).done)
738
+ for (; n < t; ) {
739
+ if ((await e.next()).done)
750
740
  return;
751
741
  n += 1;
752
742
  }
753
743
  for (; ; ) {
754
- const r = await t.next();
744
+ const r = await e.next();
755
745
  if (r.done)
756
746
  return r.value;
757
747
  yield r.value;
758
748
  }
759
749
  });
760
750
  }
761
- take(e) {
762
- const t = this._iterator;
751
+ take(t) {
752
+ const e = this._iterator;
763
753
  return new h(async function* () {
764
754
  let n = 0;
765
- for (; n < e; ) {
766
- const r = await t.next();
755
+ for (; n < t; ) {
756
+ const r = await e.next();
767
757
  if (r.done)
768
758
  return r.value;
769
759
  yield r.value, n += 1;
770
760
  }
771
761
  });
772
762
  }
773
- async find(e) {
774
- let t = 0;
763
+ async find(t) {
764
+ let e = 0;
775
765
  for (; ; ) {
776
766
  const n = await this._iterator.next();
777
767
  if (n.done)
778
768
  return;
779
- if (await e(n.value, t))
769
+ if (await t(n.value, e))
780
770
  return n.value;
781
- t += 1;
771
+ e += 1;
782
772
  }
783
773
  }
784
774
  enumerate() {
785
- return this.map((e, t) => [t, e]);
775
+ return this.map((t, e) => [e, t]);
786
776
  }
787
777
  unique() {
788
- const e = this._iterator;
778
+ const t = this._iterator;
789
779
  return new h(async function* () {
790
- const t = /* @__PURE__ */ new Set();
780
+ const e = /* @__PURE__ */ new Set();
791
781
  for (; ; ) {
792
- const n = await e.next();
782
+ const n = await t.next();
793
783
  if (n.done)
794
784
  return n.value;
795
- t.has(n.value) || (t.add(n.value), yield n.value);
785
+ e.has(n.value) || (e.add(n.value), yield n.value);
796
786
  }
797
787
  });
798
788
  }
799
789
  async count() {
800
- let e = 0;
790
+ let t = 0;
801
791
  for (; ; ) {
802
792
  if ((await this._iterator.next()).done)
803
- return e;
804
- e += 1;
793
+ return t;
794
+ t += 1;
805
795
  }
806
796
  }
807
- async forEach(e) {
808
- let t = 0;
797
+ async forEach(t) {
798
+ let e = 0;
809
799
  for (; ; ) {
810
800
  const n = await this._iterator.next();
811
801
  if (n.done)
812
802
  return;
813
- await e(n.value, t), t += 1;
803
+ await t(n.value, e), e += 1;
814
804
  }
815
805
  }
816
- next(...e) {
817
- return this._iterator.next(...e);
806
+ next(...t) {
807
+ return this._iterator.next(...t);
818
808
  }
819
- groupBy(e) {
820
- return new w(this.map(async (t, n) => [await e(t, n), t]));
809
+ groupBy(t) {
810
+ return new S(this.map(async (e, n) => [await t(e, n), e]));
821
811
  }
822
812
  toArray() {
823
813
  return Array.fromAsync(this);
824
814
  }
825
- get [Symbol.toStringTag]() {
826
- return "SmartAsyncIterator";
827
- }
828
- [Symbol.asyncIterator]() {
815
+ [(he = Symbol.toStringTag, Symbol.asyncIterator)]() {
829
816
  return this;
830
817
  }
831
818
  }
832
- class d {
833
- constructor(e) {
834
- u(this, "_elements");
835
- this._elements = new l(e);
836
- }
837
- every(e) {
838
- const t = /* @__PURE__ */ new Map();
819
+ var de;
820
+ de = Symbol.toStringTag;
821
+ const w = class w {
822
+ constructor(t) {
823
+ a(this, "_elements");
824
+ a(this, de, "AggregatedIterator");
825
+ this._elements = new l(t);
826
+ }
827
+ every(t) {
828
+ const e = /* @__PURE__ */ new Map();
839
829
  for (const [n, r] of this._elements) {
840
- const [s, o] = t.get(n) ?? [0, !0];
841
- o && t.set(n, [s + 1, e(n, r, s)]);
830
+ const [s, o] = e.get(n) ?? [0, !0];
831
+ o && e.set(n, [s + 1, t(n, r, s)]);
842
832
  }
843
- return new c(function* () {
844
- for (const [n, [r, s]] of t)
833
+ return new f(function* () {
834
+ for (const [n, [r, s]] of e)
845
835
  yield [n, s];
846
836
  });
847
837
  }
848
- some(e) {
849
- const t = /* @__PURE__ */ new Map();
838
+ some(t) {
839
+ const e = /* @__PURE__ */ new Map();
850
840
  for (const [n, r] of this._elements) {
851
- const [s, o] = t.get(n) ?? [0, !1];
852
- o || t.set(n, [s + 1, e(n, r, s)]);
841
+ const [s, o] = e.get(n) ?? [0, !1];
842
+ o || e.set(n, [s + 1, t(n, r, s)]);
853
843
  }
854
- return new c(function* () {
855
- for (const [n, [r, s]] of t)
844
+ return new f(function* () {
845
+ for (const [n, [r, s]] of e)
856
846
  yield [n, s];
857
847
  });
858
848
  }
859
- filter(e) {
860
- const t = this._elements;
861
- return new d(function* () {
849
+ filter(t) {
850
+ const e = this._elements;
851
+ return new w(function* () {
862
852
  const n = /* @__PURE__ */ new Map();
863
- for (const [r, s] of t) {
853
+ for (const [r, s] of e) {
864
854
  const o = n.get(r) ?? 0;
865
- e(r, s, o) && (yield [r, s]), n.set(r, o + 1);
855
+ t(r, s, o) && (yield [r, s]), n.set(r, o + 1);
866
856
  }
867
857
  });
868
858
  }
869
- map(e) {
870
- const t = this._elements;
871
- return new d(function* () {
859
+ map(t) {
860
+ const e = this._elements;
861
+ return new w(function* () {
872
862
  const n = /* @__PURE__ */ new Map();
873
- for (const [r, s] of t) {
863
+ for (const [r, s] of e) {
874
864
  const o = n.get(r) ?? 0;
875
- yield [r, e(r, s, o)], n.set(r, o + 1);
865
+ yield [r, t(r, s, o)], n.set(r, o + 1);
876
866
  }
877
867
  });
878
868
  }
879
- reduce(e, t) {
869
+ reduce(t, e) {
880
870
  const n = /* @__PURE__ */ new Map();
881
871
  for (const [r, s] of this._elements) {
882
- let o, a;
872
+ let o, u;
883
873
  if (n.has(r))
884
- [o, a] = n.get(r);
885
- else if (t !== void 0)
886
- o = 0, a = t(r);
874
+ [o, u] = n.get(r);
875
+ else if (e !== void 0)
876
+ o = 0, u = e(r);
887
877
  else {
888
878
  n.set(r, [0, s]);
889
879
  continue;
890
880
  }
891
- n.set(r, [o + 1, e(r, a, s, o)]);
881
+ n.set(r, [o + 1, t(r, u, s, o)]);
892
882
  }
893
- return new c(function* () {
883
+ return new f(function* () {
894
884
  for (const [r, [s, o]] of n)
895
885
  yield [r, o];
896
886
  });
897
887
  }
898
- flatMap(e) {
899
- const t = this._elements;
900
- return new d(function* () {
888
+ flatMap(t) {
889
+ const e = this._elements;
890
+ return new w(function* () {
901
891
  const n = /* @__PURE__ */ new Map();
902
- for (const [r, s] of t) {
903
- const o = n.get(r) ?? 0, a = e(r, s, o);
904
- for (const p of a)
905
- yield [r, p];
892
+ for (const [r, s] of e) {
893
+ const o = n.get(r) ?? 0, u = t(r, s, o);
894
+ for (const _ of u)
895
+ yield [r, _];
906
896
  n.set(r, o + 1);
907
897
  }
908
898
  });
909
899
  }
910
- drop(e) {
911
- const t = this._elements;
912
- return new d(function* () {
900
+ drop(t) {
901
+ const e = this._elements;
902
+ return new w(function* () {
913
903
  const n = /* @__PURE__ */ new Map();
914
- for (const [r, s] of t) {
904
+ for (const [r, s] of e) {
915
905
  const o = n.get(r) ?? 0;
916
- if (o < e) {
906
+ if (o < t) {
917
907
  n.set(r, o + 1);
918
908
  continue;
919
909
  }
@@ -921,14 +911,14 @@ class d {
921
911
  }
922
912
  });
923
913
  }
924
- take(e) {
925
- const t = this._elements;
926
- return new d(function* () {
914
+ take(t) {
915
+ const e = this._elements;
916
+ return new w(function* () {
927
917
  const n = /* @__PURE__ */ new Map();
928
- for (const [r, s] of t) {
918
+ for (const [r, s] of e) {
929
919
  const o = n.get(r) ?? 0;
930
- if (o >= e) {
931
- if (n.values().every((a) => a >= e))
920
+ if (o >= t) {
921
+ if (n.values().every((u) => u >= t))
932
922
  break;
933
923
  continue;
934
924
  }
@@ -936,119 +926,120 @@ class d {
936
926
  }
937
927
  });
938
928
  }
939
- find(e) {
940
- const t = /* @__PURE__ */ new Map();
929
+ find(t) {
930
+ const e = /* @__PURE__ */ new Map();
941
931
  for (const [n, r] of this._elements) {
942
- let [s, o] = t.get(n) ?? [0, void 0];
943
- o === void 0 && (e(n, r, s) && (o = r), t.set(n, [s + 1, o]));
932
+ let [s, o] = e.get(n) ?? [0, void 0];
933
+ o === void 0 && (t(n, r, s) && (o = r), e.set(n, [s + 1, o]));
944
934
  }
945
- return new c(function* () {
946
- for (const [n, [r, s]] of t)
935
+ return new f(function* () {
936
+ for (const [n, [r, s]] of e)
947
937
  yield [n, s];
948
938
  });
949
939
  }
950
940
  enumerate() {
951
- return this.map((e, t, n) => [n, t]);
941
+ return this.map((t, e, n) => [n, e]);
952
942
  }
953
943
  unique() {
954
- const e = this._elements;
955
- return new d(function* () {
956
- const t = /* @__PURE__ */ new Map();
957
- for (const [n, r] of e) {
958
- const s = t.get(n) ?? /* @__PURE__ */ new Set();
959
- s.has(r) || (s.add(r), t.set(n, s), yield [n, r]);
944
+ const t = this._elements;
945
+ return new w(function* () {
946
+ const e = /* @__PURE__ */ new Map();
947
+ for (const [n, r] of t) {
948
+ const s = e.get(n) ?? /* @__PURE__ */ new Set();
949
+ s.has(r) || (s.add(r), e.set(n, s), yield [n, r]);
960
950
  }
961
951
  });
962
952
  }
963
953
  count() {
964
- const e = /* @__PURE__ */ new Map();
965
- for (const [t] of this._elements) {
966
- const n = e.get(t) ?? 0;
967
- e.set(t, n + 1);
954
+ const t = /* @__PURE__ */ new Map();
955
+ for (const [e] of this._elements) {
956
+ const n = t.get(e) ?? 0;
957
+ t.set(e, n + 1);
968
958
  }
969
- return new c(function* () {
970
- for (const [t, n] of e)
971
- yield [t, n];
959
+ return new f(function* () {
960
+ for (const [e, n] of t)
961
+ yield [e, n];
972
962
  });
973
963
  }
974
- forEach(e) {
975
- const t = /* @__PURE__ */ new Map();
964
+ forEach(t) {
965
+ const e = /* @__PURE__ */ new Map();
976
966
  for (const [n, r] of this._elements) {
977
- const s = t.get(n) ?? 0;
978
- e(n, r, s), t.set(n, s + 1);
967
+ const s = e.get(n) ?? 0;
968
+ t(n, r, s), e.set(n, s + 1);
979
969
  }
980
970
  }
981
971
  keys() {
982
- const e = this._elements;
972
+ const t = this._elements;
983
973
  return new l(function* () {
984
- const t = /* @__PURE__ */ new Set();
985
- for (const [n] of e)
986
- t.has(n) || (t.add(n), yield n);
974
+ const e = /* @__PURE__ */ new Set();
975
+ for (const [n] of t)
976
+ e.has(n) || (e.add(n), yield n);
987
977
  });
988
978
  }
989
979
  items() {
990
980
  return this._elements;
991
981
  }
992
982
  values() {
993
- const e = this._elements;
983
+ const t = this._elements;
994
984
  return new l(function* () {
995
- for (const [t, n] of e)
985
+ for (const [e, n] of t)
996
986
  yield n;
997
987
  });
998
988
  }
999
989
  toArray() {
1000
- const e = this.toMap();
1001
- return Array.from(e.values());
990
+ const t = this.toMap();
991
+ return Array.from(t.values());
1002
992
  }
1003
993
  toMap() {
1004
- const e = /* @__PURE__ */ new Map();
1005
- for (const [t, n] of this._elements) {
1006
- const r = e.get(t) ?? [];
1007
- r.push(n), e.set(t, r);
994
+ const t = /* @__PURE__ */ new Map();
995
+ for (const [e, n] of this._elements) {
996
+ const r = t.get(e) ?? [];
997
+ r.push(n), t.set(e, r);
1008
998
  }
1009
- return e;
999
+ return t;
1010
1000
  }
1011
1001
  toObject() {
1012
- const e = {};
1013
- for (const [t, n] of this._elements) {
1014
- const r = e[t] ?? [];
1015
- r.push(n), e[t] = r;
1002
+ const t = {};
1003
+ for (const [e, n] of this._elements) {
1004
+ const r = t[e] ?? [];
1005
+ r.push(n), t[e] = r;
1016
1006
  }
1017
- return e;
1018
- }
1019
- get [Symbol.toStringTag]() {
1020
- return "AggregatedIterator";
1007
+ return t;
1021
1008
  }
1009
+ };
1010
+ let g = w;
1011
+ var b = /* @__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))(b || {});
1012
+ function Le(i, t, e = 864e5) {
1013
+ return i = new Date(i), t = new Date(t), Math.floor((t.getTime() - i.getTime()) / e);
1022
1014
  }
1023
- var x = /* @__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))(x || {});
1024
- function G(i, e, t = 864e5) {
1025
- return i = new Date(i), e = new Date(e), Math.floor((e.getTime() - i.getTime()) / t);
1026
- }
1027
- function H(i, e, t = 864e5) {
1028
- return i = new Date(i), e = new Date(e), new l(function* () {
1029
- const n = e.getTime();
1015
+ function Qe(i, t, e = 864e5) {
1016
+ return i = new Date(i), t = new Date(t), new l(function* () {
1017
+ const n = t.getTime();
1030
1018
  let r = i.getTime();
1031
1019
  for (; r < n; )
1032
- yield new Date(r), r += t;
1020
+ yield new Date(r), r += e;
1033
1021
  });
1034
1022
  }
1035
- function L(i, e = 864e5) {
1036
- return i = new Date(i), new Date(Math.floor(i.getTime() / e) * e);
1023
+ function Xe(i, t = 864e5) {
1024
+ return i = new Date(i), new Date(Math.floor(i.getTime() / t) * t);
1037
1025
  }
1038
- class M {
1039
- constructor(e, t = 30) {
1040
- u(this, "_handle");
1041
- u(this, "_startTime");
1042
- u(this, "_isRunning");
1043
- u(this, "_start");
1044
- u(this, "_stop");
1045
- this._startTime = 0, this._isRunning = !1, S ? (this._start = () => {
1046
- e(this.elapsedTime), this._handle = window.requestAnimationFrame(this._start);
1026
+ var me;
1027
+ me = Symbol.toStringTag;
1028
+ class Pe {
1029
+ constructor(t, e = 30) {
1030
+ a(this, "_handle");
1031
+ a(this, "_startTime");
1032
+ a(this, "_isRunning");
1033
+ a(this, "_start");
1034
+ a(this, "_stop");
1035
+ a(this, me, "GameLoop");
1036
+ this._startTime = 0, this._isRunning = !1, Me ? (this._start = () => {
1037
+ t(this.elapsedTime), this._handle = window.requestAnimationFrame(this._start);
1047
1038
  }, this._stop = () => window.cancelAnimationFrame(this._handle)) : (console.warn(
1048
- `Not a browser environment detected. Using setInterval@${t}fps instead of requestAnimationFrame...`
1039
+ `Not a browser environment detected. Using setInterval@${e}fps instead of requestAnimationFrame...`
1049
1040
  ), this._start = () => {
1050
- const n = x.Second / t;
1051
- this._handle = setInterval(() => e(this.elapsedTime), n);
1041
+ const n = b.Second / e;
1042
+ this._handle = setInterval(() => t(this.elapsedTime), n);
1052
1043
  }, this._stop = () => clearInterval(this._handle));
1053
1044
  }
1054
1045
  get startTime() {
@@ -1060,58 +1051,61 @@ class M {
1060
1051
  get elapsedTime() {
1061
1052
  return performance.now() - this._startTime;
1062
1053
  }
1063
- start(e = 0) {
1054
+ start(t = 0) {
1064
1055
  if (this._isRunning)
1065
- throw new y("The game loop has already been started.");
1066
- this._startTime = performance.now() - e, this._start(), this._isRunning = !0;
1056
+ throw new p("The game loop has already been started.");
1057
+ this._startTime = performance.now() - t, this._start(), this._isRunning = !0;
1067
1058
  }
1068
1059
  stop() {
1069
1060
  if (!this._isRunning)
1070
- throw new y("The game loop hadn't yet started.");
1061
+ throw new p("The game loop hadn't yet started.");
1071
1062
  if (!this._handle)
1072
- throw new _();
1063
+ throw new x();
1073
1064
  this._stop(), this._handle = void 0, this._isRunning = !1;
1074
1065
  }
1075
1066
  }
1076
- class Q {
1077
- constructor(e = !0) {
1078
- u(this, "_preferPersistence");
1079
- u(this, "_volatile");
1080
- u(this, "_persistent");
1081
- if (this._preferPersistence = e, !S)
1082
- throw new C(
1067
+ var we;
1068
+ we = Symbol.toStringTag;
1069
+ class Ze {
1070
+ constructor(t = !0) {
1071
+ a(this, "_preferPersistence");
1072
+ a(this, "_volatile");
1073
+ a(this, "_persistent");
1074
+ a(this, we, "JSONStorage");
1075
+ if (this._preferPersistence = t, !Me)
1076
+ throw new De(
1083
1077
  "The `JSONStorage` class can only be instantiated within a browser environment."
1084
1078
  );
1085
1079
  this._volatile = window.sessionStorage, this._persistent = window.localStorage;
1086
1080
  }
1087
- _get(e, t, n) {
1088
- const r = e.getItem(t);
1081
+ _get(t, e, n) {
1082
+ const r = t.getItem(e);
1089
1083
  if (r)
1090
1084
  try {
1091
1085
  return JSON.parse(r);
1092
1086
  } catch {
1093
1087
  console.warn(
1094
- `The "${r}" value for "${t}" property cannot be parsed. Clearing the storage...`
1095
- ), e.removeItem(t);
1088
+ `The "${r}" value for "${e}" property cannot be parsed. Clearing the storage...`
1089
+ ), t.removeItem(e);
1096
1090
  }
1097
1091
  return n;
1098
1092
  }
1099
- _set(e, t, n) {
1093
+ _set(t, e, n) {
1100
1094
  const r = JSON.stringify(n);
1101
- r ? e.setItem(t, r) : e.removeItem(t);
1095
+ r ? t.setItem(e, r) : t.removeItem(e);
1102
1096
  }
1103
- get(e, t, n = this._preferPersistence) {
1097
+ get(t, e, n = this._preferPersistence) {
1104
1098
  const r = n ? this._persistent : this._volatile;
1105
- return this._get(r, e, t);
1099
+ return this._get(r, t, e);
1106
1100
  }
1107
- recall(e, t) {
1108
- return this._get(this._volatile, e, t);
1101
+ recall(t, e) {
1102
+ return this._get(this._volatile, t, e);
1109
1103
  }
1110
- retrieve(e, t) {
1111
- return this.recall(e) ?? this.read(e, t);
1104
+ retrieve(t, e) {
1105
+ return this.recall(t) ?? this.read(t, e);
1112
1106
  }
1113
- read(e, t) {
1114
- return this._get(this._persistent, e, t);
1107
+ read(t, e) {
1108
+ return this._get(this._persistent, t, e);
1115
1109
  }
1116
1110
  /**
1117
1111
  * Checks whether the property with the specified name exists in the corresponding storage.
@@ -1121,8 +1115,8 @@ class Q {
1121
1115
  *
1122
1116
  * @returns `true` if the property exists, `false` otherwise.
1123
1117
  */
1124
- has(e, t) {
1125
- return (t ? this._persistent : this._volatile).getItem(e) !== null;
1118
+ has(t, e) {
1119
+ return (e ? this._persistent : this._volatile).getItem(t) !== null;
1126
1120
  }
1127
1121
  /**
1128
1122
  * Checks whether the property with the specified name exists in the volatile `sessionStorage`.
@@ -1131,8 +1125,8 @@ class Q {
1131
1125
  *
1132
1126
  * @returns `true` if the property exists, `false` otherwise.
1133
1127
  */
1134
- knows(e) {
1135
- return this._volatile.getItem(e) !== null;
1128
+ knows(t) {
1129
+ return this._volatile.getItem(t) !== null;
1136
1130
  }
1137
1131
  /**
1138
1132
  * Checks whether the property with the specified name exists looking first in the
@@ -1142,8 +1136,8 @@ class Q {
1142
1136
  *
1143
1137
  * @returns `true` if the property exists, `false` otherwise.
1144
1138
  */
1145
- find(e) {
1146
- return this.knows(e) ?? this.exists(e);
1139
+ find(t) {
1140
+ return this.knows(t) ?? this.exists(t);
1147
1141
  }
1148
1142
  /**
1149
1143
  * Checks whether the property with the specified name exists in the persistent `localStorage`.
@@ -1152,8 +1146,8 @@ class Q {
1152
1146
  *
1153
1147
  * @returns `true` if the property exists, `false` otherwise.
1154
1148
  */
1155
- exists(e) {
1156
- return this._persistent.getItem(e) !== null;
1149
+ exists(t) {
1150
+ return this._persistent.getItem(t) !== null;
1157
1151
  }
1158
1152
  /**
1159
1153
  * Sets the value with the specified name in the corresponding storage.
@@ -1163,9 +1157,9 @@ class Q {
1163
1157
  * @param newValue The new value to set.
1164
1158
  * @param persistent Whether to use the persistent `localStorage` or the volatile `sessionStorage`.
1165
1159
  */
1166
- set(e, t, n = this._preferPersistence) {
1160
+ set(t, e, n = this._preferPersistence) {
1167
1161
  const r = n ? this._persistent : this._volatile;
1168
- this._set(r, e, t);
1162
+ this._set(r, t, e);
1169
1163
  }
1170
1164
  /**
1171
1165
  * Sets the value with the specified name in the volatile `sessionStorage`.
@@ -1174,8 +1168,8 @@ class Q {
1174
1168
  * @param propertyName The name of the property to set.
1175
1169
  * @param newValue The new value to set.
1176
1170
  */
1177
- remember(e, t) {
1178
- this._set(this._volatile, e, t);
1171
+ remember(t, e) {
1172
+ this._set(this._volatile, t, e);
1179
1173
  }
1180
1174
  /**
1181
1175
  * Sets the value with the specified name in the persistent `localStorage`.
@@ -1184,51 +1178,51 @@ class Q {
1184
1178
  * @param propertyName The name of the property to set.
1185
1179
  * @param newValue The new value to set.
1186
1180
  */
1187
- write(e, t) {
1188
- this._set(this._persistent, e, t);
1181
+ write(t, e) {
1182
+ this._set(this._persistent, t, e);
1189
1183
  }
1190
1184
  /**
1191
1185
  * Removes the value with the specified name from the volatile `sessionStorage`.
1192
1186
  *
1193
1187
  * @param propertyName The name of the property to remove.
1194
1188
  */
1195
- forget(e) {
1196
- this._volatile.removeItem(e);
1189
+ forget(t) {
1190
+ this._volatile.removeItem(t);
1197
1191
  }
1198
1192
  /**
1199
1193
  * Removes the value with the specified name from the persistent `localStorage`.
1200
1194
  *
1201
1195
  * @param propertyName The name of the property to remove.
1202
1196
  */
1203
- erase(e) {
1204
- this._persistent.removeItem(e);
1197
+ erase(t) {
1198
+ this._persistent.removeItem(t);
1205
1199
  }
1206
1200
  /**
1207
1201
  * Removes the value with the specified name from all the storages.
1208
1202
  *
1209
1203
  * @param propertyName The name of the property to remove.
1210
1204
  */
1211
- clear(e) {
1212
- this._volatile.removeItem(e), this._persistent.removeItem(e);
1213
- }
1214
- get [Symbol.toStringTag]() {
1215
- return "JSONStorage";
1205
+ clear(t) {
1206
+ this._volatile.removeItem(t), this._persistent.removeItem(t);
1216
1207
  }
1217
1208
  }
1218
- class v {
1219
- constructor(e) {
1220
- u(this, "_isPending");
1221
- u(this, "_isFulfilled");
1222
- u(this, "_isRejected");
1223
- u(this, "_promise");
1209
+ var ye;
1210
+ ye = Symbol.toStringTag;
1211
+ const E = class E {
1212
+ constructor(t) {
1213
+ a(this, "_isPending");
1214
+ a(this, "_isFulfilled");
1215
+ a(this, "_isRejected");
1216
+ a(this, "_promise");
1217
+ a(this, ye, "SmartPromise");
1224
1218
  this._isPending = !0, this._isFulfilled = !1, this._isRejected = !1;
1225
- const t = (r) => (this._isPending = !1, this._isFulfilled = !0, r), n = (r) => {
1219
+ const e = (r) => (this._isPending = !1, this._isFulfilled = !0, r), n = (r) => {
1226
1220
  throw this._isPending = !1, this._isRejected = !0, r;
1227
1221
  };
1228
- this._promise = new Promise(e).then(t, n);
1222
+ this._promise = new Promise(t).then(e, n);
1229
1223
  }
1230
- static FromPromise(e) {
1231
- return new v((t, n) => e.then(t, n));
1224
+ static FromPromise(t) {
1225
+ return new E((e, n) => t.then(e, n));
1232
1226
  }
1233
1227
  get isPending() {
1234
1228
  return this._isPending;
@@ -1239,28 +1233,28 @@ class v {
1239
1233
  get isRejected() {
1240
1234
  return this._isRejected;
1241
1235
  }
1242
- then(e, t) {
1243
- return this._promise.then(e, t);
1236
+ then(t, e) {
1237
+ return this._promise.then(t, e);
1244
1238
  }
1245
- catch(e) {
1246
- return this._promise.catch(e);
1239
+ catch(t) {
1240
+ return this._promise.catch(t);
1247
1241
  }
1248
- finally(e) {
1249
- return this._promise.finally(e);
1242
+ finally(t) {
1243
+ return this._promise.finally(t);
1250
1244
  }
1251
- get [Symbol.toStringTag]() {
1252
- return "SmartPromise";
1253
- }
1254
- }
1255
- class q extends v {
1256
- constructor(t, n) {
1245
+ };
1246
+ let v = E;
1247
+ var pe, _e;
1248
+ class qe extends (_e = v, pe = Symbol.toStringTag, _e) {
1249
+ constructor(e, n) {
1257
1250
  let r, s;
1258
- super((o, a) => {
1259
- r = o, s = a;
1251
+ super((o, u) => {
1252
+ r = o, s = u;
1260
1253
  });
1261
- u(this, "_resolve");
1262
- u(this, "_reject");
1263
- this._promise.then(t, n), this._resolve = r, this._reject = s;
1254
+ a(this, "_resolve");
1255
+ a(this, "_reject");
1256
+ a(this, pe, "DeferredPromise");
1257
+ this._promise.then(e, n), this._resolve = r, this._reject = s;
1264
1258
  }
1265
1259
  get resolve() {
1266
1260
  return this._resolve;
@@ -1268,85 +1262,85 @@ class q extends v {
1268
1262
  get reject() {
1269
1263
  return this._reject;
1270
1264
  }
1271
- watch(t) {
1272
- return t.then(this.resolve, this.reject), this;
1273
- }
1274
- get [Symbol.toStringTag]() {
1275
- return "DeferredPromise";
1265
+ watch(e) {
1266
+ return e.then(this.resolve, this.reject), this;
1276
1267
  }
1277
1268
  }
1278
- class X extends v {
1279
- constructor(e, t) {
1280
- super((n, r) => {
1281
- const s = (g) => {
1282
- clearTimeout(p), n(g);
1283
- }, o = (g) => {
1284
- clearTimeout(p), r(g);
1285
- }, p = setTimeout(() => o(new O("The operation has timed out.")), t);
1286
- e(s, o);
1269
+ var xe, ge;
1270
+ class Ue extends (ge = v, xe = Symbol.toStringTag, ge) {
1271
+ constructor(e, n) {
1272
+ super((r, s) => {
1273
+ const o = (k) => {
1274
+ clearTimeout(M), r(k);
1275
+ }, u = (k) => {
1276
+ clearTimeout(M), s(k);
1277
+ }, M = setTimeout(() => u(new Oe("The operation has timed out.")), n);
1278
+ e(o, u);
1287
1279
  });
1288
- }
1289
- get [Symbol.toStringTag]() {
1290
- return "TimedPromise";
1280
+ a(this, xe, "TimedPromise");
1291
1281
  }
1292
1282
  }
1293
- class F {
1283
+ var ve;
1284
+ ve = Symbol.toStringTag;
1285
+ class je {
1294
1286
  constructor() {
1295
- u(this, "_subscribers");
1287
+ a(this, "_subscribers");
1288
+ a(this, ve, "Publisher");
1296
1289
  this._subscribers = [];
1297
1290
  }
1298
- subscribe(e) {
1299
- return this._subscribers.push(e), () => {
1300
- const t = this._subscribers.indexOf(e);
1301
- if (t < 0)
1302
- throw new D("Unable to unsubscribe the required subscriber. The subscription was already unsubscribed.");
1303
- this._subscribers.splice(t, 1);
1291
+ subscribe(t) {
1292
+ return this._subscribers.push(t), () => {
1293
+ const e = this._subscribers.indexOf(t);
1294
+ if (e < 0)
1295
+ throw new Ce("Unable to unsubscribe the required subscriber. The subscription was already unsubscribed.");
1296
+ this._subscribers.splice(e, 1);
1304
1297
  };
1305
1298
  }
1306
- publish(...e) {
1307
- return this._subscribers.slice().map((t) => t(...e));
1308
- }
1309
- get [Symbol.toStringTag]() {
1310
- return "Publisher";
1299
+ publish(...t) {
1300
+ return this._subscribers.slice().map((e) => e(...t));
1311
1301
  }
1312
1302
  }
1313
- class Z extends M {
1314
- constructor(t = x.Second) {
1315
- super((n) => this._publisher.publish(n), t);
1316
- u(this, "_publisher");
1317
- this._publisher = new F();
1303
+ var be, ke;
1304
+ class et extends (ke = Pe, be = Symbol.toStringTag, ke) {
1305
+ constructor(e = b.Second) {
1306
+ super((n) => this._publisher.publish(n), e);
1307
+ a(this, "_publisher");
1308
+ a(this, be, "Clock");
1309
+ this._publisher = new je();
1318
1310
  }
1319
- start(t = 0) {
1311
+ start(e = 0) {
1320
1312
  if (this._isRunning)
1321
- throw new y("The clock has already been started.");
1322
- super.start(t);
1313
+ throw new p("The clock has already been started.");
1314
+ super.start(e);
1323
1315
  }
1324
1316
  stop() {
1325
1317
  if (!this._isRunning)
1326
- throw new y("The clock hadn't yet started.");
1318
+ throw new p("The clock hadn't yet started.");
1327
1319
  super.stop();
1328
1320
  }
1329
- onTick(t, n = 0) {
1321
+ onTick(e, n = 0) {
1330
1322
  if (n < 0)
1331
- throw new T("The tick step must be a non-negative number.");
1323
+ throw new Fe("The tick step must be a non-negative number.");
1332
1324
  if (n === 0)
1333
- return this._publisher.subscribe(t);
1325
+ return this._publisher.subscribe(e);
1334
1326
  let r = 0;
1335
1327
  return this._publisher.subscribe((s) => {
1336
- s - r < n || (t(s), r = s);
1328
+ s - r < n || (e(s), r = s);
1337
1329
  });
1338
1330
  }
1339
1331
  }
1340
- class U extends M {
1341
- constructor(t, n = x.Second) {
1332
+ var Se, Ee;
1333
+ class tt extends (Ee = Pe, Se = Symbol.toStringTag, Ee) {
1334
+ constructor(e, n = b.Second) {
1342
1335
  super(() => {
1343
1336
  const s = this.remainingTime;
1344
1337
  this._publisher.publish(s), s <= 0 && this.stop();
1345
1338
  }, n);
1346
- u(this, "_deferrer");
1347
- u(this, "_publisher");
1348
- u(this, "_duration");
1349
- this._publisher = new F(), this._duration = t;
1339
+ a(this, "_deferrer");
1340
+ a(this, "_publisher");
1341
+ a(this, "_duration");
1342
+ a(this, Se, "Countdown");
1343
+ this._publisher = new je(), this._duration = e;
1350
1344
  }
1351
1345
  get duration() {
1352
1346
  return this._duration;
@@ -1354,210 +1348,213 @@ class U extends M {
1354
1348
  get remainingTime() {
1355
1349
  return this._duration - this.elapsedTime;
1356
1350
  }
1357
- start(t = this.duration) {
1351
+ start(e = this.duration) {
1358
1352
  if (this._isRunning)
1359
- throw new y("The countdown has already been started.");
1353
+ throw new p("The countdown has already been started.");
1360
1354
  if (this._deferrer)
1361
- throw new _();
1362
- return this._deferrer = new q(), super.start(this.duration - t), this._deferrer;
1355
+ throw new x();
1356
+ return this._deferrer = new qe(), super.start(this.duration - e), this._deferrer;
1363
1357
  }
1364
- stop(t) {
1358
+ stop(e) {
1365
1359
  if (!this._isRunning)
1366
- throw new y("The countdown hadn't yet started.");
1360
+ throw new p("The countdown hadn't yet started.");
1367
1361
  if (!this._deferrer)
1368
- throw new _();
1369
- super.stop(), t !== void 0 ? this._deferrer.reject(t) : this._deferrer.resolve(), this._deferrer = void 0;
1362
+ throw new x();
1363
+ super.stop(), e !== void 0 ? this._deferrer.reject(e) : this._deferrer.resolve(), this._deferrer = void 0;
1370
1364
  }
1371
- onTick(t, n = 0) {
1365
+ onTick(e, n = 0) {
1372
1366
  if (n < 0)
1373
- throw new T("The tick step must be a non-negative number.");
1367
+ throw new Fe("The tick step must be a non-negative number.");
1374
1368
  if (n === 0)
1375
- return this._publisher.subscribe(t);
1369
+ return this._publisher.subscribe(e);
1376
1370
  let r = 0;
1377
1371
  return this._publisher.subscribe((s) => {
1378
- r - s < n || (t(s), r = s);
1372
+ r - s < n || (e(s), r = s);
1379
1373
  });
1380
1374
  }
1381
1375
  }
1382
- class R {
1383
- static Boolean(e = 0.5) {
1384
- return Math.random() < e;
1376
+ var Te;
1377
+ Te = Symbol.toStringTag;
1378
+ const T = class T {
1379
+ constructor() {
1380
+ a(this, Te, "Random");
1385
1381
  }
1386
- static Integer(e, t) {
1387
- return Math.floor(t === void 0 ? Math.random() * e : Math.random() * (t - e) + e);
1382
+ static Boolean(t = 0.5) {
1383
+ return Math.random() < t;
1388
1384
  }
1389
- static Decimal(e, t) {
1390
- return e === void 0 ? Math.random() : t === void 0 ? Math.random() * e : Math.random() * (t - e) + e;
1385
+ static Integer(t, e) {
1386
+ return Math.floor(e === void 0 ? Math.random() * t : Math.random() * (e - t) + t);
1391
1387
  }
1392
- static Index(e) {
1393
- if (e.length === 0)
1394
- throw new m("You must provide at least one element.");
1395
- return this.Integer(e.length);
1388
+ static Decimal(t, e) {
1389
+ return t === void 0 ? Math.random() : e === void 0 ? Math.random() * t : Math.random() * (e - t) + t;
1396
1390
  }
1397
- static Choice(e) {
1398
- return e[R.Index(e)];
1391
+ static Index(t) {
1392
+ if (t.length === 0)
1393
+ throw new d("You must provide at least one element.");
1394
+ return this.Integer(t.length);
1399
1395
  }
1400
- // eslint-disable-next-line no-useless-constructor
1401
- constructor() {
1396
+ static Choice(t) {
1397
+ return t[T.Index(t)];
1402
1398
  }
1399
+ };
1400
+ let R = T;
1401
+ function nt(i) {
1402
+ return new Promise((t) => setTimeout(t, i));
1403
1403
  }
1404
- function ee(i) {
1405
- return new Promise((e) => setTimeout(e, i));
1406
- }
1407
- function te() {
1404
+ function rt() {
1408
1405
  return new Promise((i) => requestAnimationFrame(() => i()));
1409
1406
  }
1410
- function ne(i, e = "text/javascript") {
1411
- return new Promise((t, n) => {
1407
+ function st(i, t = "text/javascript") {
1408
+ return new Promise((e, n) => {
1412
1409
  const r = document.createElement("script");
1413
- r.async = !0, r.defer = !0, r.src = i, r.type = e, r.onload = () => t(), r.onerror = () => n(), document.body.appendChild(r);
1410
+ r.async = !0, r.defer = !0, r.src = i, r.type = t, r.onload = () => e(), r.onerror = () => n(), document.body.appendChild(r);
1414
1411
  });
1415
1412
  }
1416
- function re(...i) {
1413
+ function it(...i) {
1417
1414
  return new l(function* () {
1418
- for (const e of i)
1419
- for (const t of e)
1420
- yield t;
1415
+ for (const t of i)
1416
+ for (const e of t)
1417
+ yield e;
1421
1418
  });
1422
1419
  }
1423
- function se(i) {
1420
+ function ot(i) {
1424
1421
  if (Array.isArray(i))
1425
1422
  return i.length;
1426
- let e = 0;
1427
- for (const t of i)
1428
- e += 1;
1429
- return e;
1423
+ let t = 0;
1424
+ for (const e of i)
1425
+ t += 1;
1426
+ return t;
1430
1427
  }
1431
- function ie(i) {
1428
+ function at(i) {
1432
1429
  return new l(function* () {
1433
- let e = 0;
1434
- for (const t of i)
1435
- yield [e, t], e += 1;
1430
+ let t = 0;
1431
+ for (const e of i)
1432
+ yield [t, e], t += 1;
1436
1433
  });
1437
1434
  }
1438
- function oe(i, e, t = 1) {
1435
+ function ut(i, t, e = 1) {
1439
1436
  return new l(function* () {
1440
- e === void 0 && (e = i, i = 0), i > e && (t = t ?? -1);
1441
- for (let n = i; n < e; n += t)
1437
+ t === void 0 && (t = i, i = 0), i > t && (e = e ?? -1);
1438
+ for (let n = i; n < t; n += e)
1442
1439
  yield n;
1443
1440
  });
1444
1441
  }
1445
- function ue(i) {
1446
- const e = Array.from(i);
1447
- for (let t = e.length - 1; t > 0; t -= 1) {
1448
- const n = Math.floor(Math.random() * (t + 1));
1449
- [e[t], e[n]] = [e[n], e[t]];
1442
+ function lt(i) {
1443
+ const t = Array.from(i);
1444
+ for (let e = t.length - 1; e > 0; e -= 1) {
1445
+ const n = Math.floor(Math.random() * (e + 1));
1446
+ [t[e], t[n]] = [t[n], t[e]];
1450
1447
  }
1451
- return e;
1448
+ return t;
1452
1449
  }
1453
- function ae(i) {
1450
+ function ct(i) {
1454
1451
  return new l(function* () {
1455
- const e = /* @__PURE__ */ new Set();
1456
- for (const t of i)
1457
- e.has(t) || (e.add(t), yield t);
1452
+ const t = /* @__PURE__ */ new Set();
1453
+ for (const e of i)
1454
+ t.has(e) || (t.add(e), yield e);
1458
1455
  });
1459
1456
  }
1460
- function I(i, e) {
1457
+ function Ne(i, t) {
1461
1458
  return new l(function* () {
1462
- const t = i[Symbol.iterator](), n = e[Symbol.iterator]();
1459
+ const e = i[Symbol.iterator](), n = t[Symbol.iterator]();
1463
1460
  for (; ; ) {
1464
- const r = t.next(), s = n.next();
1461
+ const r = e.next(), s = n.next();
1465
1462
  if (r.done || s.done)
1466
1463
  break;
1467
1464
  yield [r.value, s.value];
1468
1465
  }
1469
1466
  });
1470
1467
  }
1471
- function le(i, e) {
1472
- if (e === void 0) {
1468
+ function ft(i, t) {
1469
+ if (t === void 0) {
1473
1470
  let s = 0, o = 0;
1474
- for (const a of i)
1475
- s += a, o += 1;
1471
+ for (const u of i)
1472
+ s += u, o += 1;
1476
1473
  if (o === 0)
1477
- throw new m("You must provide at least one value.");
1474
+ throw new d("You must provide at least one value.");
1478
1475
  return s / o;
1479
1476
  }
1480
- let t = 0, n = 0, r = 0;
1481
- for (const [s, o] of I(i, e)) {
1477
+ let e = 0, n = 0, r = 0;
1478
+ for (const [s, o] of Ne(i, t)) {
1482
1479
  if (o <= 0)
1483
- throw new m(`The weight for the value #${r} must be greater than zero.`);
1484
- t += s * o, n += o, r += 1;
1480
+ throw new d(`The weight for the value #${r} must be greater than zero.`);
1481
+ e += s * o, n += o, r += 1;
1485
1482
  }
1486
1483
  if (r === 0)
1487
- throw new m("You must provide at least one value and weight.");
1484
+ throw new d("You must provide at least one value and weight.");
1488
1485
  if (n > 0)
1489
- throw new m("The sum of weights must be greater than zero.");
1490
- return t / n;
1486
+ throw new d("The sum of weights must be greater than zero.");
1487
+ return e / n;
1491
1488
  }
1492
- function ce(i) {
1493
- let e = 0;
1494
- for (let t = 0; t < i.length; t += 1) {
1495
- const n = i.charCodeAt(t);
1496
- e = (e << 5) - e + n, e |= 0;
1489
+ function ht(i) {
1490
+ let t = 0;
1491
+ for (let e = 0; e < i.length; e += 1) {
1492
+ const n = i.charCodeAt(e);
1493
+ t = (t << 5) - t + n, t |= 0;
1497
1494
  }
1498
- return e;
1495
+ return t;
1499
1496
  }
1500
- function fe(i) {
1501
- let e = 0;
1502
- for (const t of i)
1503
- e += t;
1504
- return e;
1497
+ function dt(i) {
1498
+ let t = 0;
1499
+ for (const e of i)
1500
+ t += e;
1501
+ return t;
1505
1502
  }
1506
- function he(i) {
1503
+ function mt(i) {
1507
1504
  return `${i.charAt(0).toUpperCase()}${i.slice(1)}`;
1508
1505
  }
1509
- const de = "2.0.0-rc.3";
1506
+ const wt = "2.0.0-rc.4";
1510
1507
  export {
1511
- w as AggregatedAsyncIterator,
1512
- d as AggregatedIterator,
1513
- Z as Clock,
1514
- U as Countdown,
1515
- q as DeferredPromise,
1516
- f as Exception,
1517
- _ as FatalErrorException,
1518
- E as FileException,
1519
- V as FileExistsException,
1520
- W as FileNotFoundException,
1521
- M as GameLoop,
1522
- Q as JSONStorage,
1523
- Y as KeyException,
1524
- z as NetworkException,
1525
- J as NotImplementedException,
1526
- B as PermissionException,
1527
- F as Publisher,
1508
+ S as AggregatedAsyncIterator,
1509
+ g as AggregatedIterator,
1510
+ et as Clock,
1511
+ tt as Countdown,
1512
+ qe as DeferredPromise,
1513
+ c as Exception,
1514
+ x as FatalErrorException,
1515
+ Re as FileException,
1516
+ Ye as FileExistsException,
1517
+ ze as FileNotFoundException,
1518
+ Pe as GameLoop,
1519
+ Ze as JSONStorage,
1520
+ Be as KeyException,
1521
+ Ge as NetworkException,
1522
+ We as NotImplementedException,
1523
+ Ke as PermissionException,
1524
+ je as Publisher,
1528
1525
  R as Random,
1529
- T as RangeException,
1530
- c as ReducedIterator,
1531
- D as ReferenceException,
1532
- y as RuntimeException,
1526
+ Fe as RangeException,
1527
+ f as ReducedIterator,
1528
+ Ce as ReferenceException,
1529
+ p as RuntimeException,
1533
1530
  h as SmartAsyncIterator,
1534
1531
  l as SmartIterator,
1535
1532
  v as SmartPromise,
1536
- x as TimeUnit,
1537
- X as TimedPromise,
1538
- O as TimeoutException,
1539
- K as TypeException,
1540
- de as VERSION,
1541
- m as ValueException,
1542
- le as average,
1543
- he as capitalize,
1544
- re as chain,
1545
- se as count,
1546
- G as dateDifference,
1547
- H as dateRange,
1548
- L as dateRound,
1549
- ee as delay,
1550
- ie as enumerate,
1551
- ce as hash,
1552
- S as isBrowser,
1553
- $ as isNode,
1554
- A as isWebWorker,
1555
- ne as loadScript,
1556
- te as nextAnimationFrame,
1557
- oe as range,
1558
- ue as shuffle,
1559
- fe as sum,
1560
- ae as unique,
1561
- I as zip
1533
+ b as TimeUnit,
1534
+ Ue as TimedPromise,
1535
+ Oe as TimeoutException,
1536
+ He as TypeException,
1537
+ wt as VERSION,
1538
+ d as ValueException,
1539
+ ft as average,
1540
+ mt as capitalize,
1541
+ it as chain,
1542
+ ot as count,
1543
+ Le as dateDifference,
1544
+ Qe as dateRange,
1545
+ Xe as dateRound,
1546
+ nt as delay,
1547
+ at as enumerate,
1548
+ ht as hash,
1549
+ Me as isBrowser,
1550
+ Je as isNode,
1551
+ Ve as isWebWorker,
1552
+ st as loadScript,
1553
+ rt as nextAnimationFrame,
1554
+ ut as range,
1555
+ lt as shuffle,
1556
+ dt as sum,
1557
+ ct as unique,
1558
+ Ne as zip
1562
1559
  };
1563
1560
  //# sourceMappingURL=core.js.map