@byloth/core 1.2.0-rc.3 → 1.2.1-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core.js +399 -217
- package/dist/core.js.map +1 -1
- package/dist/core.umd.cjs +2 -2
- package/dist/core.umd.cjs.map +1 -1
- package/package.json +4 -4
- package/src/index.ts +13 -2
- package/src/models/aggregators/_index.old.ts +384 -0
- package/src/models/aggregators/aggregated-iterator.ts +214 -0
- package/src/models/aggregators/index.ts +45 -0
- package/src/models/aggregators/reduced-iterator.ts +59 -0
- package/src/models/aggregators/types.ts +2 -0
- package/src/models/index.ts +14 -3
- package/src/models/smart-iterator.ts +79 -33
- package/src/types.ts +2 -1
- package/src/utils/iterator.ts +19 -4
package/dist/core.js
CHANGED
|
@@ -1,15 +1,297 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
1
|
+
var d = Object.defineProperty;
|
|
2
|
+
var _ = (s, e, t) => e in s ? d(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
|
|
3
|
+
var u = (s, e, t) => (_(s, typeof e != "symbol" ? e + "" : e, t), t);
|
|
4
|
+
class f extends Error {
|
|
5
|
+
static FromUnknown(e) {
|
|
6
|
+
if (e instanceof f)
|
|
7
|
+
return e;
|
|
8
|
+
if (e instanceof Error) {
|
|
9
|
+
const t = new f(e.message);
|
|
10
|
+
return t.stack = e.stack, t.name = e.name, t;
|
|
11
|
+
}
|
|
12
|
+
return new f(`${e}`);
|
|
13
|
+
}
|
|
14
|
+
constructor(e, t, r = "Exception") {
|
|
15
|
+
super(e), this.cause = t, this.name = r, t && (t instanceof Error ? this.stack += `
|
|
16
|
+
|
|
17
|
+
Caused by ${t.stack}` : this.stack += `
|
|
18
|
+
|
|
19
|
+
Caused by ${t}`);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
class l {
|
|
23
|
+
constructor(e) {
|
|
24
|
+
u(this, "_iterator");
|
|
25
|
+
u(this, "return");
|
|
26
|
+
u(this, "throw");
|
|
27
|
+
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));
|
|
28
|
+
}
|
|
29
|
+
every(e) {
|
|
30
|
+
let t = 0;
|
|
31
|
+
for (; ; ) {
|
|
32
|
+
const r = this._iterator.next();
|
|
33
|
+
if (r.done)
|
|
34
|
+
return !0;
|
|
35
|
+
if (!e(r.value, t))
|
|
36
|
+
return !1;
|
|
37
|
+
t += 1;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
some(e) {
|
|
41
|
+
let t = 0;
|
|
42
|
+
for (; ; ) {
|
|
43
|
+
const r = this._iterator.next();
|
|
44
|
+
if (r.done)
|
|
45
|
+
return !1;
|
|
46
|
+
if (e(r.value, t))
|
|
47
|
+
return !0;
|
|
48
|
+
t += 1;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
filter(e) {
|
|
52
|
+
const t = this._iterator;
|
|
53
|
+
return new l(function* () {
|
|
54
|
+
let r = 0;
|
|
55
|
+
for (; ; ) {
|
|
56
|
+
const n = t.next();
|
|
57
|
+
if (n.done)
|
|
58
|
+
return n.value;
|
|
59
|
+
e(n.value, r) && (yield n.value), r += 1;
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
map(e) {
|
|
64
|
+
const t = this._iterator;
|
|
65
|
+
return new l(function* () {
|
|
66
|
+
let r = 0;
|
|
67
|
+
for (; ; ) {
|
|
68
|
+
const n = t.next();
|
|
69
|
+
if (n.done)
|
|
70
|
+
return n.value;
|
|
71
|
+
yield e(n.value, r), r += 1;
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
reduce(e, t) {
|
|
76
|
+
let r = 0, n = t;
|
|
77
|
+
if (n === void 0) {
|
|
78
|
+
const o = this._iterator.next();
|
|
79
|
+
if (o.done)
|
|
80
|
+
throw new TypeError("Reduce of empty iterator with no initial value");
|
|
81
|
+
n = o.value, r += 1;
|
|
82
|
+
}
|
|
83
|
+
for (; ; ) {
|
|
84
|
+
const o = this._iterator.next();
|
|
85
|
+
if (o.done)
|
|
86
|
+
return n;
|
|
87
|
+
n = e(n, o.value, r), r += 1;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
enumerate() {
|
|
91
|
+
return this.map((e, t) => [t, e]);
|
|
92
|
+
}
|
|
93
|
+
unique() {
|
|
94
|
+
const e = this._iterator;
|
|
95
|
+
return new l(function* () {
|
|
96
|
+
const t = /* @__PURE__ */ new Set();
|
|
97
|
+
for (; ; ) {
|
|
98
|
+
const r = e.next();
|
|
99
|
+
if (r.done)
|
|
100
|
+
return r.value;
|
|
101
|
+
t.has(r.value) || (t.add(r.value), yield r.value);
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
count() {
|
|
106
|
+
let e = 0;
|
|
107
|
+
for (; ; ) {
|
|
108
|
+
if (this._iterator.next().done)
|
|
109
|
+
return e;
|
|
110
|
+
e += 1;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
forEach(e) {
|
|
114
|
+
let t = 0;
|
|
115
|
+
for (; ; ) {
|
|
116
|
+
const r = this._iterator.next();
|
|
117
|
+
if (r.done)
|
|
118
|
+
return;
|
|
119
|
+
e(r.value, t), t += 1;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
next(...e) {
|
|
123
|
+
return this._iterator.next(...e);
|
|
124
|
+
}
|
|
125
|
+
toArray() {
|
|
126
|
+
return Array.from(this);
|
|
127
|
+
}
|
|
128
|
+
[Symbol.iterator]() {
|
|
129
|
+
return this;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
class c {
|
|
133
|
+
constructor(e) {
|
|
134
|
+
u(this, "_elements");
|
|
135
|
+
this._elements = new l(e);
|
|
136
|
+
}
|
|
137
|
+
filter(e) {
|
|
138
|
+
const t = this._elements;
|
|
139
|
+
return new c(function* () {
|
|
140
|
+
for (const [r, [n, o]] of t.enumerate())
|
|
141
|
+
e(n, o, r) && (yield [n, o]);
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
map(e) {
|
|
145
|
+
const t = this._elements;
|
|
146
|
+
return new c(function* () {
|
|
147
|
+
for (const [r, [n, o]] of t.enumerate())
|
|
148
|
+
yield [n, e(n, o, r)];
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
toArray() {
|
|
152
|
+
return Array.from(this.toMap().values());
|
|
153
|
+
}
|
|
154
|
+
toMap() {
|
|
155
|
+
return new Map(this._elements.toArray());
|
|
156
|
+
}
|
|
157
|
+
toObject() {
|
|
158
|
+
return Object.fromEntries(this._elements.toArray());
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
class h {
|
|
162
|
+
constructor(e) {
|
|
163
|
+
u(this, "_elements");
|
|
164
|
+
this._elements = new l(e);
|
|
165
|
+
}
|
|
166
|
+
every(e) {
|
|
167
|
+
const t = /* @__PURE__ */ new Map();
|
|
168
|
+
for (const [r, n] of this._elements) {
|
|
169
|
+
const [o, i] = t.get(r) ?? [0, !0];
|
|
170
|
+
i && t.set(r, [o + 1, e(r, n, o)]);
|
|
171
|
+
}
|
|
172
|
+
return new c(function* () {
|
|
173
|
+
for (const [r, [n, o]] of t)
|
|
174
|
+
yield [r, o];
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
some(e) {
|
|
178
|
+
const t = /* @__PURE__ */ new Map();
|
|
179
|
+
for (const [r, n] of this._elements) {
|
|
180
|
+
const [o, i] = t.get(r) ?? [0, !1];
|
|
181
|
+
i || t.set(r, [o + 1, e(r, n, o)]);
|
|
182
|
+
}
|
|
183
|
+
return new c(function* () {
|
|
184
|
+
for (const [r, [n, o]] of t)
|
|
185
|
+
yield [r, o];
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
filter(e) {
|
|
189
|
+
const t = this._elements;
|
|
190
|
+
return new h(function* () {
|
|
191
|
+
const r = /* @__PURE__ */ new Map();
|
|
192
|
+
for (const [n, o] of t) {
|
|
193
|
+
const i = r.get(n) ?? 0;
|
|
194
|
+
r.set(n, i + 1), e(n, o, i) && (yield [n, o]);
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
map(e) {
|
|
199
|
+
const t = this._elements;
|
|
200
|
+
return new h(function* () {
|
|
201
|
+
const r = /* @__PURE__ */ new Map();
|
|
202
|
+
for (const [n, o] of t) {
|
|
203
|
+
const i = r.get(n) ?? 0;
|
|
204
|
+
r.set(n, i + 1), yield [n, e(n, o, i)];
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
reduce(e, t) {
|
|
209
|
+
const r = /* @__PURE__ */ new Map();
|
|
210
|
+
for (const [n, o] of this._elements) {
|
|
211
|
+
let i, a;
|
|
212
|
+
if (r.has(n))
|
|
213
|
+
[i, a] = r.get(n), i += 1;
|
|
214
|
+
else if (t !== void 0)
|
|
215
|
+
i = 0, a = t;
|
|
216
|
+
else {
|
|
217
|
+
r.set(n, [0, o]);
|
|
218
|
+
continue;
|
|
219
|
+
}
|
|
220
|
+
a = e(n, a, o, i), r.set(n, [i, a]);
|
|
221
|
+
}
|
|
222
|
+
return new c(function* () {
|
|
223
|
+
for (const [n, [o, i]] of r)
|
|
224
|
+
yield [n, i];
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
unique() {
|
|
228
|
+
const e = this._elements;
|
|
229
|
+
return new h(function* () {
|
|
230
|
+
const t = /* @__PURE__ */ new Map();
|
|
231
|
+
for (const [r, n] of e) {
|
|
232
|
+
const o = t.get(r) ?? /* @__PURE__ */ new Set();
|
|
233
|
+
o.has(n) || (o.add(n), t.set(r, o), yield [r, n]);
|
|
234
|
+
}
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
count() {
|
|
238
|
+
const e = /* @__PURE__ */ new Map();
|
|
239
|
+
for (const [t] of this._elements) {
|
|
240
|
+
const r = e.get(t) ?? 0;
|
|
241
|
+
e.set(t, r + 1);
|
|
242
|
+
}
|
|
243
|
+
return new c(function* () {
|
|
244
|
+
for (const [t, r] of e)
|
|
245
|
+
yield [t, r];
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
toArray() {
|
|
249
|
+
return Array.from(this.toMap().values());
|
|
250
|
+
}
|
|
251
|
+
toMap() {
|
|
252
|
+
const e = /* @__PURE__ */ new Map();
|
|
253
|
+
for (const [t, r] of this._elements) {
|
|
254
|
+
const n = e.get(t) ?? [];
|
|
255
|
+
n.push(r), e.set(t, n);
|
|
256
|
+
}
|
|
257
|
+
return e;
|
|
258
|
+
}
|
|
259
|
+
toObject() {
|
|
260
|
+
const e = {};
|
|
261
|
+
for (const [t, r] of this._elements) {
|
|
262
|
+
const n = e[t] ?? [];
|
|
263
|
+
n.push(r), e[t] = n;
|
|
264
|
+
}
|
|
265
|
+
return e;
|
|
266
|
+
}
|
|
267
|
+
}
|
|
4
268
|
class m {
|
|
269
|
+
constructor(e) {
|
|
270
|
+
u(this, "_elements");
|
|
271
|
+
this._elements = new l(e);
|
|
272
|
+
}
|
|
273
|
+
filter(e) {
|
|
274
|
+
return new m(this._elements.filter(e));
|
|
275
|
+
}
|
|
276
|
+
map(e) {
|
|
277
|
+
return new m(this._elements.map(e));
|
|
278
|
+
}
|
|
279
|
+
unique() {
|
|
280
|
+
return new m(this._elements.unique());
|
|
281
|
+
}
|
|
282
|
+
byKey(e) {
|
|
283
|
+
return new h(this._elements.map((t, r) => [e(t, r), t]));
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
class p {
|
|
5
287
|
constructor(e, t) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
let
|
|
10
|
-
this._promise = new Promise((
|
|
11
|
-
|
|
12
|
-
}).then(e, t), this._resolve =
|
|
288
|
+
u(this, "_resolve");
|
|
289
|
+
u(this, "_reject");
|
|
290
|
+
u(this, "_promise");
|
|
291
|
+
let r, n;
|
|
292
|
+
this._promise = new Promise((o, i) => {
|
|
293
|
+
r = o, n = i;
|
|
294
|
+
}).then(e, t), this._resolve = r, this._reject = n;
|
|
13
295
|
}
|
|
14
296
|
get resolve() {
|
|
15
297
|
return this._resolve;
|
|
@@ -33,32 +315,14 @@ class m {
|
|
|
33
315
|
return "DeferredPromise";
|
|
34
316
|
}
|
|
35
317
|
}
|
|
36
|
-
class
|
|
37
|
-
static FromUnknown(e) {
|
|
38
|
-
if (e instanceof l)
|
|
39
|
-
return e;
|
|
40
|
-
if (e instanceof Error) {
|
|
41
|
-
const t = new l(e.message);
|
|
42
|
-
return t.stack = e.stack, t.name = e.name, t;
|
|
43
|
-
}
|
|
44
|
-
return new l(`${e}`);
|
|
45
|
-
}
|
|
46
|
-
constructor(e, t, s = "Exception") {
|
|
47
|
-
super(e), this.cause = t, this.name = s, t && (t instanceof Error ? this.stack += `
|
|
48
|
-
|
|
49
|
-
Caused by ${t.stack}` : this.stack += `
|
|
50
|
-
|
|
51
|
-
Caused by ${t}`);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
class v {
|
|
318
|
+
class x {
|
|
55
319
|
constructor(e = !0) {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
320
|
+
u(this, "_preferPersistence");
|
|
321
|
+
u(this, "_volatile");
|
|
322
|
+
u(this, "_persistent");
|
|
59
323
|
this._preferPersistence = e, this._volatile = window.sessionStorage, this._persistent = window.localStorage;
|
|
60
324
|
}
|
|
61
|
-
_get(e, t,
|
|
325
|
+
_get(e, t, r) {
|
|
62
326
|
const n = e.getItem(t);
|
|
63
327
|
if (n)
|
|
64
328
|
try {
|
|
@@ -68,14 +332,14 @@ class v {
|
|
|
68
332
|
`The "${n}" value for "${t}" property cannot be parsed. Clearing the storage...`
|
|
69
333
|
), e.removeItem(t);
|
|
70
334
|
}
|
|
71
|
-
return
|
|
335
|
+
return r;
|
|
72
336
|
}
|
|
73
|
-
_set(e, t,
|
|
74
|
-
const n = JSON.stringify(
|
|
337
|
+
_set(e, t, r) {
|
|
338
|
+
const n = JSON.stringify(r);
|
|
75
339
|
n ? e.setItem(t, n) : e.removeItem(t);
|
|
76
340
|
}
|
|
77
|
-
get(e, t,
|
|
78
|
-
const n =
|
|
341
|
+
get(e, t, r = this._preferPersistence) {
|
|
342
|
+
const n = r ? this._persistent : this._volatile;
|
|
79
343
|
return this._get(n, e, t);
|
|
80
344
|
}
|
|
81
345
|
recall(e, t) {
|
|
@@ -137,8 +401,8 @@ class v {
|
|
|
137
401
|
* @param newValue The new value to set.
|
|
138
402
|
* @param persistent Whether to use the persistent `localStorage` or the volatile `sessionStorage`.
|
|
139
403
|
*/
|
|
140
|
-
set(e, t,
|
|
141
|
-
const n =
|
|
404
|
+
set(e, t, r = this._preferPersistence) {
|
|
405
|
+
const n = r ? this._persistent : this._volatile;
|
|
142
406
|
this._set(n, e, t);
|
|
143
407
|
}
|
|
144
408
|
/**
|
|
@@ -186,94 +450,9 @@ class v {
|
|
|
186
450
|
this._volatile.removeItem(e), this._persistent.removeItem(e);
|
|
187
451
|
}
|
|
188
452
|
}
|
|
189
|
-
class
|
|
190
|
-
constructor(e) {
|
|
191
|
-
o(this, "_iterator");
|
|
192
|
-
o(this, "return");
|
|
193
|
-
o(this, "throw");
|
|
194
|
-
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));
|
|
195
|
-
}
|
|
196
|
-
every(e) {
|
|
197
|
-
let t = 0;
|
|
198
|
-
for (; ; ) {
|
|
199
|
-
const s = this._iterator.next();
|
|
200
|
-
if (s.done)
|
|
201
|
-
return !0;
|
|
202
|
-
if (!e(s.value, t))
|
|
203
|
-
return !1;
|
|
204
|
-
t += 1;
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
some(e) {
|
|
208
|
-
let t = 0;
|
|
209
|
-
for (; ; ) {
|
|
210
|
-
const s = this._iterator.next();
|
|
211
|
-
if (s.done)
|
|
212
|
-
return !1;
|
|
213
|
-
if (e(s.value, t))
|
|
214
|
-
return !0;
|
|
215
|
-
t += 1;
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
filter(e) {
|
|
219
|
-
let t = 0;
|
|
220
|
-
const s = this._iterator;
|
|
221
|
-
return new u({
|
|
222
|
-
*[Symbol.iterator]() {
|
|
223
|
-
for (; ; ) {
|
|
224
|
-
const n = s.next();
|
|
225
|
-
if (n.done)
|
|
226
|
-
return n.value;
|
|
227
|
-
e(n.value, t) && (yield n.value), t += 1;
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
});
|
|
231
|
-
}
|
|
232
|
-
map(e) {
|
|
233
|
-
let t = 0;
|
|
234
|
-
const s = this._iterator;
|
|
235
|
-
return new u({
|
|
236
|
-
*[Symbol.iterator]() {
|
|
237
|
-
for (; ; ) {
|
|
238
|
-
const n = s.next();
|
|
239
|
-
if (n.done)
|
|
240
|
-
return n.value;
|
|
241
|
-
yield e(n.value, t), t += 1;
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
});
|
|
245
|
-
}
|
|
246
|
-
reduce(e, t) {
|
|
247
|
-
let s = 0, n = t;
|
|
248
|
-
for (; ; ) {
|
|
249
|
-
const i = this._iterator.next();
|
|
250
|
-
if (i.done)
|
|
251
|
-
return n;
|
|
252
|
-
n = e(n, i.value, s), s += 1;
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
forEach(e) {
|
|
256
|
-
let t = 0;
|
|
257
|
-
for (; ; ) {
|
|
258
|
-
const s = this._iterator.next();
|
|
259
|
-
if (s.done)
|
|
260
|
-
return;
|
|
261
|
-
e(s.value, t), t += 1;
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
next(...e) {
|
|
265
|
-
return this._iterator.next(...e);
|
|
266
|
-
}
|
|
267
|
-
toArray() {
|
|
268
|
-
return [...this];
|
|
269
|
-
}
|
|
270
|
-
[Symbol.iterator]() {
|
|
271
|
-
return this;
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
class w {
|
|
453
|
+
class b {
|
|
275
454
|
constructor() {
|
|
276
|
-
|
|
455
|
+
u(this, "_subscribers");
|
|
277
456
|
this._subscribers = [];
|
|
278
457
|
}
|
|
279
458
|
add(e) {
|
|
@@ -282,150 +461,153 @@ class w {
|
|
|
282
461
|
remove(e) {
|
|
283
462
|
const t = this._subscribers.indexOf(e);
|
|
284
463
|
if (t < 0)
|
|
285
|
-
throw new
|
|
464
|
+
throw new f("Unable to remove the requested subscriber. It was not found.");
|
|
286
465
|
this._subscribers.splice(t, 1);
|
|
287
466
|
}
|
|
288
467
|
call(...e) {
|
|
289
468
|
return this._subscribers.slice().map((t) => t(...e));
|
|
290
469
|
}
|
|
291
470
|
}
|
|
292
|
-
async function g(
|
|
293
|
-
return new Promise((e, t) => setTimeout(e,
|
|
471
|
+
async function g(s) {
|
|
472
|
+
return new Promise((e, t) => setTimeout(e, s));
|
|
294
473
|
}
|
|
295
|
-
async function
|
|
296
|
-
return new Promise((
|
|
474
|
+
async function k() {
|
|
475
|
+
return new Promise((s, e) => requestAnimationFrame(() => s()));
|
|
297
476
|
}
|
|
298
|
-
var
|
|
299
|
-
function
|
|
300
|
-
return Math.floor((e.getTime() -
|
|
477
|
+
var w = /* @__PURE__ */ ((s) => (s[s.Second = 1e3] = "Second", s[s.Minute = 6e4] = "Minute", s[s.Hour = 36e5] = "Hour", s[s.Day = 864e5] = "Day", s[s.Week = 6048e5] = "Week", s[s.Month = 2592e6] = "Month", s[s.Year = 31536e6] = "Year", s))(w || {});
|
|
478
|
+
function M(s, e, t = 864e5) {
|
|
479
|
+
return Math.floor((e.getTime() - s.getTime()) / t);
|
|
301
480
|
}
|
|
302
|
-
function
|
|
303
|
-
return new
|
|
304
|
-
const
|
|
305
|
-
let n =
|
|
306
|
-
for (; n <
|
|
481
|
+
function S(s, e, t = 864e5) {
|
|
482
|
+
return new l(function* () {
|
|
483
|
+
const r = e.getTime();
|
|
484
|
+
let n = s.getTime();
|
|
485
|
+
for (; n < r; )
|
|
307
486
|
yield new Date(n), n += t;
|
|
308
487
|
});
|
|
309
488
|
}
|
|
310
|
-
function
|
|
311
|
-
return new Date(Math.floor(
|
|
489
|
+
function j(s, e = 864e5) {
|
|
490
|
+
return new Date(Math.floor(s.getTime() / e) * e);
|
|
312
491
|
}
|
|
313
|
-
async function
|
|
314
|
-
return new Promise((t,
|
|
492
|
+
async function A(s, e = "text/javascript") {
|
|
493
|
+
return new Promise((t, r) => {
|
|
315
494
|
const n = document.createElement("script");
|
|
316
|
-
n.async = !0, n.defer = !0, n.src =
|
|
495
|
+
n.async = !0, n.defer = !0, n.src = s, n.type = e, n.onload = () => t(), n.onerror = () => r(), document.body.appendChild(n);
|
|
317
496
|
});
|
|
318
497
|
}
|
|
319
|
-
function
|
|
320
|
-
if (Array.isArray(
|
|
321
|
-
return
|
|
498
|
+
function T(s) {
|
|
499
|
+
if (Array.isArray(s))
|
|
500
|
+
return s.length;
|
|
322
501
|
let e = 0;
|
|
323
|
-
for (const t of
|
|
502
|
+
for (const t of s)
|
|
324
503
|
e += 1;
|
|
325
504
|
return e;
|
|
326
505
|
}
|
|
327
|
-
function
|
|
328
|
-
return new
|
|
329
|
-
e === void 0 && (e =
|
|
330
|
-
for (let
|
|
331
|
-
yield
|
|
506
|
+
function I(s, e, t = 1) {
|
|
507
|
+
return new l(function* () {
|
|
508
|
+
e === void 0 && (e = s, s = 0), s > e && (t = t ?? -1);
|
|
509
|
+
for (let r = s; r < e; r += t)
|
|
510
|
+
yield r;
|
|
332
511
|
});
|
|
333
512
|
}
|
|
334
|
-
function
|
|
335
|
-
const e =
|
|
513
|
+
function P(s) {
|
|
514
|
+
const e = Array.from(s);
|
|
336
515
|
for (let t = e.length - 1; t > 0; t -= 1) {
|
|
337
|
-
const
|
|
338
|
-
[e[t], e[
|
|
516
|
+
const r = Math.floor(Math.random() * (t + 1));
|
|
517
|
+
[e[t], e[r]] = [e[r], e[t]];
|
|
339
518
|
}
|
|
340
519
|
return e;
|
|
341
520
|
}
|
|
342
|
-
function
|
|
343
|
-
return new
|
|
521
|
+
function q(s) {
|
|
522
|
+
return new l(function* () {
|
|
344
523
|
const e = /* @__PURE__ */ new Set();
|
|
345
|
-
for (const t of
|
|
524
|
+
for (const t of s)
|
|
346
525
|
e.has(t) || (e.add(t), yield t);
|
|
347
526
|
});
|
|
348
527
|
}
|
|
349
|
-
function
|
|
350
|
-
return new
|
|
351
|
-
const t =
|
|
528
|
+
function y(s, e) {
|
|
529
|
+
return new l(function* () {
|
|
530
|
+
const t = s[Symbol.iterator](), r = e[Symbol.iterator]();
|
|
352
531
|
for (; ; ) {
|
|
353
|
-
const n = t.next(),
|
|
354
|
-
if (n.done ||
|
|
532
|
+
const n = t.next(), o = r.next();
|
|
533
|
+
if (n.done || o.done)
|
|
355
534
|
break;
|
|
356
|
-
yield [n.value,
|
|
535
|
+
yield [n.value, o.value];
|
|
357
536
|
}
|
|
358
537
|
});
|
|
359
538
|
}
|
|
360
|
-
function
|
|
539
|
+
function E(s, e) {
|
|
361
540
|
if (e === void 0) {
|
|
362
|
-
let n = 0,
|
|
363
|
-
for (const
|
|
364
|
-
n +=
|
|
365
|
-
return n /
|
|
366
|
-
}
|
|
367
|
-
let t = 0,
|
|
368
|
-
for (const [n,
|
|
369
|
-
t += n *
|
|
370
|
-
return t /
|
|
541
|
+
let n = 0, o = 0;
|
|
542
|
+
for (const i of s)
|
|
543
|
+
n += i, o += 1;
|
|
544
|
+
return n / o;
|
|
545
|
+
}
|
|
546
|
+
let t = 0, r = 0;
|
|
547
|
+
for (const [n, o] of y(s, e))
|
|
548
|
+
t += n * o, r += o;
|
|
549
|
+
return t / r;
|
|
371
550
|
}
|
|
372
|
-
function
|
|
551
|
+
function O(s) {
|
|
373
552
|
let e = 0;
|
|
374
|
-
for (let t = 0; t <
|
|
375
|
-
const
|
|
376
|
-
e = (e << 5) - e +
|
|
553
|
+
for (let t = 0; t < s.length; t++) {
|
|
554
|
+
const r = s.charCodeAt(t);
|
|
555
|
+
e = (e << 5) - e + r, e |= 0;
|
|
377
556
|
}
|
|
378
557
|
return e;
|
|
379
558
|
}
|
|
380
|
-
function
|
|
381
|
-
if (e === void 0 && (e =
|
|
382
|
-
return
|
|
383
|
-
let
|
|
559
|
+
function $(s = 1, e, t) {
|
|
560
|
+
if (e === void 0 && (e = s, s = 0), s === e)
|
|
561
|
+
return s;
|
|
562
|
+
let r;
|
|
384
563
|
if (t === !0)
|
|
385
|
-
|
|
564
|
+
r = (n) => n;
|
|
386
565
|
else if (t === void 0)
|
|
387
|
-
Math.abs(e -
|
|
566
|
+
Math.abs(e - s) <= 1 ? r = (n) => n : r = Math.floor;
|
|
388
567
|
else if (t === !1)
|
|
389
|
-
|
|
568
|
+
r = Math.floor;
|
|
390
569
|
else {
|
|
391
570
|
const n = 10 ** t;
|
|
392
|
-
|
|
571
|
+
r = (o) => Math.floor(o * n) / n;
|
|
393
572
|
}
|
|
394
|
-
return
|
|
573
|
+
return r(Math.random() * (e - s) + s);
|
|
395
574
|
}
|
|
396
|
-
function
|
|
575
|
+
function C(s) {
|
|
397
576
|
let e = 0;
|
|
398
|
-
for (const t of
|
|
577
|
+
for (const t of s)
|
|
399
578
|
e += t;
|
|
400
579
|
return e;
|
|
401
580
|
}
|
|
402
|
-
function
|
|
403
|
-
return `${
|
|
581
|
+
function R(s) {
|
|
582
|
+
return `${s.charAt(0).toUpperCase()}${s.slice(1)}`;
|
|
404
583
|
}
|
|
405
|
-
const
|
|
584
|
+
const F = "1.2.1-rc.1";
|
|
406
585
|
export {
|
|
407
|
-
|
|
408
|
-
m as
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
586
|
+
h as AggregatedIterator,
|
|
587
|
+
m as Aggregator,
|
|
588
|
+
w as DateUnit,
|
|
589
|
+
p as DeferredPromise,
|
|
590
|
+
f as Exception,
|
|
591
|
+
x as JsonStorage,
|
|
592
|
+
c as ReducedIterator,
|
|
593
|
+
l as SmartIterator,
|
|
594
|
+
b as Subscribers,
|
|
595
|
+
F as VERSION,
|
|
596
|
+
E as average,
|
|
597
|
+
R as capitalize,
|
|
598
|
+
T as count,
|
|
599
|
+
M as dateDifference,
|
|
600
|
+
S as dateRange,
|
|
601
|
+
j as dateRound,
|
|
420
602
|
g as delay,
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
603
|
+
O as hash,
|
|
604
|
+
A as loadScript,
|
|
605
|
+
k as nextAnimationFrame,
|
|
606
|
+
$ as random,
|
|
607
|
+
I as range,
|
|
608
|
+
P as shuffle,
|
|
609
|
+
C as sum,
|
|
610
|
+
q as unique,
|
|
611
|
+
y as zip
|
|
430
612
|
};
|
|
431
613
|
//# sourceMappingURL=core.js.map
|