@tolki/arr 1.0.0 → 1.0.2
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/README.md +13 -3
- package/dist/arr.d.ts +35 -31
- package/dist/arr.d.ts.map +1 -1
- package/dist/arr.js +876 -1182
- package/dist/index.js +1 -95
- package/package.json +9 -8
package/dist/arr.js
CHANGED
|
@@ -1,1184 +1,878 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
function
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
function
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
function
|
|
144
|
-
|
|
145
|
-
}
|
|
146
|
-
function
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
function
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
return I.length === 0 ? r() : I[I.length - 1];
|
|
241
|
-
}
|
|
242
|
-
let f, m = !1;
|
|
243
|
-
for (const I of i)
|
|
244
|
-
f = I, m = !0;
|
|
245
|
-
return m ? f : r();
|
|
246
|
-
}
|
|
247
|
-
if (s) {
|
|
248
|
-
const f = o;
|
|
249
|
-
for (let m = f.length - 1; m >= 0; m--)
|
|
250
|
-
if (!v(n(f[m], m)))
|
|
251
|
-
return f[m];
|
|
252
|
-
return r();
|
|
253
|
-
}
|
|
254
|
-
let u = 0, c = !1, h;
|
|
255
|
-
for (const f of i)
|
|
256
|
-
v(n(f, u)) || (h = f, c = !0), u++;
|
|
257
|
-
return c ? h : r();
|
|
258
|
-
}
|
|
259
|
-
function Pn(e, n) {
|
|
260
|
-
if (!e || n === 0)
|
|
261
|
-
return [];
|
|
262
|
-
const t = e.length;
|
|
263
|
-
if (t === 0)
|
|
264
|
-
return [];
|
|
265
|
-
if (n > 0)
|
|
266
|
-
return n >= t ? e.slice() : e.slice(0, n);
|
|
267
|
-
const r = Math.abs(n);
|
|
268
|
-
return r >= t ? e.slice() : e.slice(t - r);
|
|
269
|
-
}
|
|
270
|
-
function nn(e, n = 1 / 0) {
|
|
271
|
-
const t = [];
|
|
272
|
-
if (!a(e))
|
|
273
|
-
return t;
|
|
274
|
-
for (const r of e) {
|
|
275
|
-
const o = R(r);
|
|
276
|
-
if (!l(o) && !A(o)) {
|
|
277
|
-
t.push(o);
|
|
278
|
-
continue;
|
|
279
|
-
}
|
|
280
|
-
const s = l(o) ? o : Object.values(o);
|
|
281
|
-
for (const i of n === 1 ? s : nn(s, n - 1))
|
|
282
|
-
t.push(i);
|
|
283
|
-
}
|
|
284
|
-
return t;
|
|
285
|
-
}
|
|
286
|
-
function Cn(e) {
|
|
287
|
-
if (!a(e))
|
|
288
|
-
return {};
|
|
289
|
-
const n = {};
|
|
290
|
-
for (let t = 0; t < e.length; t++) {
|
|
291
|
-
const r = e[t];
|
|
292
|
-
se(r) && d(n, String(r), t);
|
|
293
|
-
}
|
|
294
|
-
return n;
|
|
295
|
-
}
|
|
296
|
-
function Rn(e, n, t = null) {
|
|
297
|
-
const r = M(e, n, t);
|
|
298
|
-
if (!oe(r))
|
|
299
|
-
throw new j(
|
|
300
|
-
`Array value for key [${n}] must be a float, ${L(r)} found.`
|
|
301
|
-
);
|
|
302
|
-
return r;
|
|
303
|
-
}
|
|
304
|
-
function le(e, n) {
|
|
305
|
-
return Ee(e, n);
|
|
306
|
-
}
|
|
307
|
-
function Un(e) {
|
|
308
|
-
return he(e);
|
|
309
|
-
}
|
|
310
|
-
function he(e) {
|
|
311
|
-
if (l(e))
|
|
312
|
-
return e.slice();
|
|
313
|
-
if (x(e)) {
|
|
314
|
-
const n = {};
|
|
315
|
-
for (const [t, r] of e)
|
|
316
|
-
d(n, String(t), r);
|
|
317
|
-
return n;
|
|
318
|
-
}
|
|
319
|
-
if (Te(e))
|
|
320
|
-
throw new Error(
|
|
321
|
-
"WeakMap values cannot be enumerated in JavaScript; cannot convert to array of values."
|
|
322
|
-
);
|
|
323
|
-
if (S(e))
|
|
324
|
-
return [...e];
|
|
325
|
-
if (!g(e) && w(e))
|
|
326
|
-
return e;
|
|
327
|
-
throw new j(
|
|
328
|
-
"Items cannot be represented by a scalar value."
|
|
329
|
-
);
|
|
330
|
-
}
|
|
331
|
-
function Dn(e, n, t = null) {
|
|
332
|
-
if (g(n) || y(n))
|
|
333
|
-
return l(e) ? e : b(t) ? t() : t;
|
|
334
|
-
if (!l(e))
|
|
335
|
-
return b(t) ? t() : t;
|
|
336
|
-
const r = M(e, n, null);
|
|
337
|
-
return g(r) ? b(t) ? t() : t : r;
|
|
338
|
-
}
|
|
339
|
-
function pe(e, n) {
|
|
340
|
-
const t = l(n) ? n : [n];
|
|
341
|
-
if (!a(e) || t.length === 0)
|
|
342
|
-
return !1;
|
|
343
|
-
for (const r of t)
|
|
344
|
-
if (g(r) || y(r) || !Ne(e, r))
|
|
345
|
-
return !1;
|
|
346
|
-
return !0;
|
|
347
|
-
}
|
|
348
|
-
function Ln(e, n) {
|
|
349
|
-
const t = l(n) ? n : [n];
|
|
350
|
-
if (!a(e) || t.length === 0)
|
|
351
|
-
return !1;
|
|
352
|
-
for (const r of t)
|
|
353
|
-
if (!pe(e, r))
|
|
354
|
-
return !1;
|
|
355
|
-
return !0;
|
|
356
|
-
}
|
|
357
|
-
function Wn(e, n) {
|
|
358
|
-
if (g(n))
|
|
359
|
-
return !1;
|
|
360
|
-
const t = l(n) ? n : [n];
|
|
361
|
-
if (t.length === 0 || !a(e))
|
|
362
|
-
return !1;
|
|
363
|
-
for (const r of t)
|
|
364
|
-
if (pe(e, r))
|
|
365
|
-
return !0;
|
|
366
|
-
return !1;
|
|
367
|
-
}
|
|
368
|
-
function Tn(e, n) {
|
|
369
|
-
if (a(e)) {
|
|
370
|
-
const r = p(e);
|
|
371
|
-
for (let o = 0; o < r.length; o++)
|
|
372
|
-
if (v(n(r[o], o)))
|
|
373
|
-
return !1;
|
|
374
|
-
return !0;
|
|
375
|
-
}
|
|
376
|
-
if (!S(e) && !w(e))
|
|
377
|
-
return !1;
|
|
378
|
-
let t = 0;
|
|
379
|
-
for (const r of P(e))
|
|
380
|
-
if (v(n(r, t++)))
|
|
381
|
-
return !1;
|
|
382
|
-
return !0;
|
|
383
|
-
}
|
|
384
|
-
function Vn(e, n) {
|
|
385
|
-
if (a(e)) {
|
|
386
|
-
const r = p(e);
|
|
387
|
-
for (let o = 0; o < r.length; o++)
|
|
388
|
-
if (!v(n(r[o], o)))
|
|
389
|
-
return !0;
|
|
390
|
-
return !1;
|
|
391
|
-
}
|
|
392
|
-
if (!S(e) && !w(e))
|
|
393
|
-
return !1;
|
|
394
|
-
let t = 0;
|
|
395
|
-
for (const r of P(e))
|
|
396
|
-
if (!v(n(r, t++)))
|
|
397
|
-
return !0;
|
|
398
|
-
return !1;
|
|
399
|
-
}
|
|
400
|
-
function _n(e, n, t = null) {
|
|
401
|
-
const r = M(e, n, t);
|
|
402
|
-
if (!Ve(r))
|
|
403
|
-
throw new j(
|
|
404
|
-
`Array value for key [${n}] must be an integer, ${L(r)} found.`
|
|
405
|
-
);
|
|
406
|
-
return r;
|
|
407
|
-
}
|
|
408
|
-
function Fn(e, n, t = "") {
|
|
409
|
-
const o = p(e).map((c) => _e(c));
|
|
410
|
-
if (t === "")
|
|
411
|
-
return o.join(n);
|
|
412
|
-
const s = o.length;
|
|
413
|
-
if (s === 0)
|
|
414
|
-
return "";
|
|
415
|
-
if (s === 1)
|
|
416
|
-
return o[0];
|
|
417
|
-
const i = o.slice(0, -1).join(n), u = o[s - 1];
|
|
418
|
-
return i + t + u;
|
|
419
|
-
}
|
|
420
|
-
function Jn(e, n) {
|
|
421
|
-
if (!a(e))
|
|
422
|
-
return {};
|
|
423
|
-
const t = e, r = {};
|
|
424
|
-
for (const [o, s] of t.entries()) {
|
|
425
|
-
const i = b(n) ? n(s, o) : $(s, n);
|
|
426
|
-
d(
|
|
427
|
-
r,
|
|
428
|
-
Fe(i) ? i : C(i),
|
|
429
|
-
s
|
|
430
|
-
);
|
|
431
|
-
}
|
|
432
|
-
return r;
|
|
433
|
-
}
|
|
434
|
-
function Bn(e, n) {
|
|
435
|
-
const t = p(e), r = {};
|
|
436
|
-
for (let o = 0; o < t.length; o++)
|
|
437
|
-
r[n + o] = t[o];
|
|
438
|
-
return r;
|
|
439
|
-
}
|
|
440
|
-
function Qn(e, n) {
|
|
441
|
-
const t = p(e), r = l(n) ? n : g(n) ? [] : [n], o = new Set(r.filter(se).map(String));
|
|
442
|
-
return t.filter((s, i) => o.has(String(i)));
|
|
443
|
-
}
|
|
444
|
-
function Xn(e, n, t = !1) {
|
|
445
|
-
const r = l(n) ? n : [n];
|
|
446
|
-
return e.filter((o) => r.some(
|
|
447
|
-
(s) => t ? o === s : W(o, s)
|
|
448
|
-
));
|
|
449
|
-
}
|
|
450
|
-
function qn(e, n) {
|
|
451
|
-
const t = $e(
|
|
452
|
-
{ ...p(e) },
|
|
453
|
-
n
|
|
454
|
-
);
|
|
455
|
-
return Object.values(t);
|
|
456
|
-
}
|
|
457
|
-
function zn(e, n, t = null) {
|
|
458
|
-
if (!a(e))
|
|
459
|
-
return [];
|
|
460
|
-
const r = y(n) ? null : n, o = e, s = g(t) || y(t) ? [] : {};
|
|
461
|
-
for (const i of o) {
|
|
462
|
-
let u;
|
|
463
|
-
if (b(r) ? u = r(i) : u = Z(
|
|
464
|
-
i,
|
|
465
|
-
G(
|
|
466
|
-
r
|
|
467
|
-
)
|
|
468
|
-
), g(t) || y(t)) {
|
|
469
|
-
s.push(u);
|
|
470
|
-
continue;
|
|
471
|
-
}
|
|
472
|
-
const c = b(t) ? t(i) : Z(
|
|
473
|
-
i,
|
|
474
|
-
G(t)
|
|
475
|
-
);
|
|
476
|
-
d(
|
|
477
|
-
s,
|
|
478
|
-
Je(c, { stringables: !0 }),
|
|
479
|
-
u
|
|
480
|
-
);
|
|
481
|
-
}
|
|
482
|
-
return s;
|
|
483
|
-
}
|
|
484
|
-
function Yn(e, n = 1) {
|
|
485
|
-
if (!a(e) || E(e))
|
|
486
|
-
return n === 1 ? null : [];
|
|
487
|
-
const t = e;
|
|
488
|
-
if (t.length === 0)
|
|
489
|
-
return n === 1 ? null : [];
|
|
490
|
-
if (n === 1)
|
|
491
|
-
return t.pop();
|
|
492
|
-
if (n < 1)
|
|
493
|
-
return [];
|
|
494
|
-
const r = [], o = ie(n, t.length);
|
|
495
|
-
for (let s = 0; s < o; s++)
|
|
496
|
-
r.push(t.pop());
|
|
497
|
-
return r;
|
|
498
|
-
}
|
|
499
|
-
function Hn(e, n) {
|
|
500
|
-
const t = p(e), r = [];
|
|
501
|
-
for (let o = 0; o < t.length; o++)
|
|
502
|
-
r.push(n(t[o], o));
|
|
503
|
-
return r;
|
|
504
|
-
}
|
|
505
|
-
function Zn(e, n) {
|
|
506
|
-
if (!a(e))
|
|
507
|
-
return {};
|
|
508
|
-
const t = e, r = {};
|
|
509
|
-
for (let o = 0; o < t.length; o++) {
|
|
510
|
-
const s = n(t[o], o);
|
|
511
|
-
for (const [i, u] of Object.entries(s))
|
|
512
|
-
d(
|
|
513
|
-
r,
|
|
514
|
-
i,
|
|
515
|
-
u
|
|
516
|
-
);
|
|
517
|
-
}
|
|
518
|
-
return r;
|
|
519
|
-
}
|
|
520
|
-
function Gn(e, n) {
|
|
521
|
-
const t = p(e), r = [];
|
|
522
|
-
for (let o = 0; o < t.length; o++) {
|
|
523
|
-
const s = t[o], i = R(s), u = l(i) ? i : Ae(je(i));
|
|
524
|
-
r.push(n(...u, o));
|
|
525
|
-
}
|
|
526
|
-
return r;
|
|
527
|
-
}
|
|
528
|
-
function kn(e, n, ...t) {
|
|
529
|
-
const r = p(e);
|
|
530
|
-
if (t.length === 0)
|
|
531
|
-
return [n, ...r];
|
|
532
|
-
const o = Ke({ ...Array.from(r) }, n, ...t);
|
|
533
|
-
return C(t[0]) === 0 ? Object.values(o) : o;
|
|
534
|
-
}
|
|
535
|
-
function et(e, n, t = null) {
|
|
536
|
-
const r = () => b(t) ? t() : t;
|
|
537
|
-
if (!a(e))
|
|
538
|
-
return { value: r(), data: [] };
|
|
539
|
-
if (g(n) || y(n)) {
|
|
540
|
-
const c = ee(e).slice();
|
|
541
|
-
return { value: r(), data: c };
|
|
542
|
-
}
|
|
543
|
-
const o = ee(e), { found: s, value: i } = Pe(o, n);
|
|
544
|
-
if (z(s)) {
|
|
545
|
-
const c = o.slice();
|
|
546
|
-
return { value: r(), data: c };
|
|
547
|
-
}
|
|
548
|
-
const u = le(o, n);
|
|
549
|
-
return {
|
|
550
|
-
value: i,
|
|
551
|
-
data: u
|
|
552
|
-
};
|
|
553
|
-
}
|
|
554
|
-
function nt(e) {
|
|
555
|
-
if (g(e) || y(e))
|
|
556
|
-
return "";
|
|
557
|
-
const n = (o) => encodeURIComponent(o).replace(
|
|
558
|
-
/[!'()*]/g,
|
|
559
|
-
(s) => `%${s.charCodeAt(0).toString(16).toUpperCase()}`
|
|
560
|
-
), t = (o) => Q(o) ? o ? "1" : "0" : String(o), r = (o, s = "") => {
|
|
561
|
-
const i = [];
|
|
562
|
-
if (l(o))
|
|
563
|
-
for (let u = 0; u < o.length; u++) {
|
|
564
|
-
const c = s ? `${s}[${u}]` : String(u), h = o[u];
|
|
565
|
-
if (!g(h) && !y(h))
|
|
566
|
-
if (l(h) || w(h))
|
|
567
|
-
i.push(...r(h, c));
|
|
568
|
-
else {
|
|
569
|
-
const f = n(c);
|
|
570
|
-
i.push(
|
|
571
|
-
`${f}=${n(t(h))}`
|
|
572
|
-
);
|
|
573
|
-
}
|
|
574
|
-
}
|
|
575
|
-
else if (w(o) && !g(o))
|
|
576
|
-
for (const [u, c] of Object.entries(o)) {
|
|
577
|
-
const h = s ? `${s}[${u}]` : u;
|
|
578
|
-
if (!g(c) && !y(c))
|
|
579
|
-
if (l(c) || w(c))
|
|
580
|
-
i.push(...r(c, h));
|
|
581
|
-
else {
|
|
582
|
-
const f = n(h);
|
|
583
|
-
i.push(
|
|
584
|
-
`${f}=${n(t(c))}`
|
|
585
|
-
);
|
|
586
|
-
}
|
|
587
|
-
}
|
|
588
|
-
else {
|
|
589
|
-
const c = n(s || "0");
|
|
590
|
-
i.push(
|
|
591
|
-
`${c}=${n(t(o))}`
|
|
592
|
-
);
|
|
593
|
-
}
|
|
594
|
-
return i;
|
|
595
|
-
};
|
|
596
|
-
return r(e).join("&");
|
|
597
|
-
}
|
|
598
|
-
function tt(e, n, t = !1) {
|
|
599
|
-
const r = !g(n) && !y(n);
|
|
600
|
-
if (!l(e))
|
|
601
|
-
return r ? [] : null;
|
|
602
|
-
const o = e, s = o.length, i = r ? n : 1;
|
|
603
|
-
if (J(i, ">", s))
|
|
604
|
-
throw new j(
|
|
605
|
-
`You requested ${X(i)} items, but there are only ${s} items available.`
|
|
606
|
-
);
|
|
607
|
-
if (s === 0 || r && J(i, "<=", 0))
|
|
608
|
-
return [];
|
|
609
|
-
const u = tn(i), c = [], h = Array.from({ length: s }, (f, m) => m);
|
|
610
|
-
for (let f = 0; f < u; f++) {
|
|
611
|
-
const m = re(0, h.length - 1);
|
|
612
|
-
c.push(h[m]), h.splice(m, 1);
|
|
613
|
-
}
|
|
614
|
-
if (c.sort((f, m) => f - m), !r)
|
|
615
|
-
return o[c[0]];
|
|
616
|
-
if (t) {
|
|
617
|
-
const f = {};
|
|
618
|
-
for (const m of c)
|
|
619
|
-
f[m] = o[m];
|
|
620
|
-
return f;
|
|
621
|
-
} else
|
|
622
|
-
return c.map((f) => o[f]);
|
|
623
|
-
}
|
|
624
|
-
function tn(e) {
|
|
625
|
-
if (N(e) ? !Y(e) : Number.isNaN(e))
|
|
626
|
-
throw new TypeError(
|
|
627
|
-
`Random\\Randomizer::pickArrayKeys(): Argument #2 ($num) must be of type int, ${N(e) ? "string" : "float"} given`
|
|
628
|
-
);
|
|
629
|
-
const n = Math.trunc(Number(e));
|
|
630
|
-
if (n < 1)
|
|
631
|
-
throw new Error(
|
|
632
|
-
"Random\\Randomizer::pickArrayKeys(): Argument #2 ($num) must be between 1 and the number of elements in argument #1 ($array)"
|
|
633
|
-
);
|
|
634
|
-
return n;
|
|
635
|
-
}
|
|
636
|
-
function rt(e, n = 1) {
|
|
637
|
-
if (n < 0)
|
|
638
|
-
throw new j(
|
|
639
|
-
"Number of shifted items may not be less than zero."
|
|
640
|
-
);
|
|
641
|
-
if (n === 0)
|
|
642
|
-
return [];
|
|
643
|
-
if (!a(e) || E(e))
|
|
644
|
-
return n === 1 ? null : [];
|
|
645
|
-
const t = e;
|
|
646
|
-
if (t.length === 0)
|
|
647
|
-
return n === 1 ? null : [];
|
|
648
|
-
if (n === 1)
|
|
649
|
-
return t.shift();
|
|
650
|
-
const r = [], o = ie(n, t.length);
|
|
651
|
-
for (let s = 0; s < o; s++)
|
|
652
|
-
r.push(t.shift());
|
|
653
|
-
return r;
|
|
654
|
-
}
|
|
655
|
-
function ot(e, n, t) {
|
|
656
|
-
return Ce(e, n, t);
|
|
657
|
-
}
|
|
658
|
-
function st(e, n, ...t) {
|
|
659
|
-
return Re(
|
|
660
|
-
l(e) ? fe(e, n, !0) : e,
|
|
661
|
-
n,
|
|
662
|
-
...t
|
|
663
|
-
);
|
|
664
|
-
}
|
|
1
|
+
import { collapse as e, crossJoin as t, first as n, last as r, prepend as i, replaceRecursive as a, select as o, union as s, values as c, wrap as l } from "@tolki/obj";
|
|
2
|
+
import { MAX_UNDOT_INDEX as u, dotFlatten as ee, explodePluckPath as te, forgetKeys as ne, getMixedValue as d, getNestedValue as f, getRaw as re, hasMixed as ie, isCanonicalUndotIndex as ae, pushWithPath as oe, resolvePluckPath as se, setMixed as ce, setMixedImmutable as le, undotExpandArray as ue } from "@tolki/path";
|
|
3
|
+
import { finish as de, randomInt as p } from "@tolki/str";
|
|
4
|
+
import { InvalidArgumentException as m, ItemNotFoundException as fe, MultipleItemsFoundException as pe, arrayValueMessage as me, arrayableItems as h, arrayableValues as g, castableToArray as he, compareValues as _, createSortSpecComparator as ge, cssListItemToString as v, defineKey as y, getAccessibleValues as b, isArray as x, isBoolean as S, isFalsy as C, isFunction as w, isInteger as _e, isIntegerLikeKey as T, isIterable as E, isMap as D, isNull as O, isNumber as k, isObject as A, isPhpArrayKey as ve, isPhpFalsy as j, isPhpNumeric as M, isPlainObject as N, isPrototypeObject as P, isString as F, isSymbol as ye, isUndefined as I, isWeakMap as be, keyedEntries as xe, looseEqual as L, operatorMatch as R, phpArrayKey as z, phpComputedKey as Se, phpSortComparator as Ce, phpStringCast as we, phpTypeName as B, phpValueMatch as V, phpValueMatcher as Te, readMapKey as Ee, resolvePadLength as De, resolveSliceRange as Oe, resolveSpliceRange as ke, resolveTakeCount as Ae, strictEqual as H, toPhpKeyString as U, writeMapKey as je } from "@tolki/utils";
|
|
5
|
+
// src/arr.ts
|
|
6
|
+
function Me(e, t) {
|
|
7
|
+
return ge((e, t) => f(e, t))(e, t);
|
|
8
|
+
}
|
|
9
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
10
|
+
function W(e) {
|
|
11
|
+
return x(e);
|
|
12
|
+
}
|
|
13
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
14
|
+
function Ne(e) {
|
|
15
|
+
return x(e);
|
|
16
|
+
}
|
|
17
|
+
function G(e) {
|
|
18
|
+
return A(e) && !E(e) ? Object.values(e) : e;
|
|
19
|
+
}
|
|
20
|
+
function K(e) {
|
|
21
|
+
return !N(e) && A(e) && w(e.all) ? e.all() : e;
|
|
22
|
+
}
|
|
23
|
+
function Pe(e, t, n = !1) {
|
|
24
|
+
let r = [...e];
|
|
25
|
+
if (O(t) || I(t)) return r;
|
|
26
|
+
let i = k(t) ? [String(t)] : String(t).split("."), a = r, o = n ? i : i.slice(0, -1);
|
|
27
|
+
for (let [e, t] of o.entries()) {
|
|
28
|
+
let i = D(a) ? Ee(a, t) : Object.hasOwn(a, t) ? {
|
|
29
|
+
found: !0,
|
|
30
|
+
value: a[t]
|
|
31
|
+
} : { found: !1 };
|
|
32
|
+
if (!i.found) return r;
|
|
33
|
+
let s = i.value;
|
|
34
|
+
if (!x(s) && !N(s) && !D(s) || P(s) && n && e === o.length - 1 && !x(s)) return r;
|
|
35
|
+
let c;
|
|
36
|
+
if (P(s)) c = x(s) ? [] : {};
|
|
37
|
+
else if (D(s)) c = new Map(s);
|
|
38
|
+
else {
|
|
39
|
+
c = x(s) ? [...s] : {};
|
|
40
|
+
let e = s;
|
|
41
|
+
for (let t of Reflect.ownKeys(s)) Object.hasOwn(c, t) || Object.defineProperty(c, t, {
|
|
42
|
+
value: e[t],
|
|
43
|
+
writable: !0,
|
|
44
|
+
enumerable: Object.prototype.propertyIsEnumerable.call(s, t),
|
|
45
|
+
configurable: !0
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
D(a) ? je(a, t, c) : y(a, t, c), a = c;
|
|
49
|
+
}
|
|
50
|
+
return r;
|
|
51
|
+
}
|
|
52
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
53
|
+
function Fe(e, t, n) {
|
|
54
|
+
let r = d(e, t);
|
|
55
|
+
return !O(r) && !I(r) ? [...e] : ce(Pe(e, t), t, n);
|
|
56
|
+
}
|
|
57
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
58
|
+
function Ie(e, t, n = null) {
|
|
59
|
+
let r = d(e, t, n);
|
|
60
|
+
if (!x(r)) throw new m(me(r, t));
|
|
61
|
+
return r;
|
|
62
|
+
}
|
|
63
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
64
|
+
function Le(e, t, n = null) {
|
|
65
|
+
let r = d(e, t, n);
|
|
66
|
+
if (!S(r)) throw new m(`Array value for key [${t}] must be a boolean, ${B(r)} found.`);
|
|
67
|
+
return r;
|
|
68
|
+
}
|
|
69
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
70
|
+
function Re(e, t, n) {
|
|
71
|
+
if (t <= 0) return [];
|
|
72
|
+
if (n) {
|
|
73
|
+
let n = [];
|
|
74
|
+
for (let r = 0; r < e.length; r += t) {
|
|
75
|
+
let i = e.slice(r, r + t).map((e, t) => [r + t, e]);
|
|
76
|
+
n.push(Object.fromEntries(i));
|
|
77
|
+
}
|
|
78
|
+
return n;
|
|
79
|
+
}
|
|
80
|
+
let r = [];
|
|
81
|
+
for (let n = 0; n < e.length; n += t) {
|
|
82
|
+
let i = e.slice(n, n + t);
|
|
83
|
+
r.push(i);
|
|
84
|
+
}
|
|
85
|
+
return r;
|
|
86
|
+
}
|
|
87
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
88
|
+
function ze(e, t) {
|
|
89
|
+
let n = [], r = [];
|
|
90
|
+
for (let [i, a] of e.entries()) r.length > 0 && j(t(a, i, r)) && (n.push(r), r = []), r.push(a);
|
|
91
|
+
return r.length > 0 && n.push(r), n;
|
|
92
|
+
}
|
|
93
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
94
|
+
function Be(e, t) {
|
|
95
|
+
let n = w(t) ? t : (e) => O(t) || I(t) ? e : f(e, t);
|
|
96
|
+
return /* @__PURE__ */ ze(e, (e, t, r) => L(n(e, t), n(r[r.length - 1], t - 1)));
|
|
97
|
+
}
|
|
98
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
99
|
+
function Ve(t) {
|
|
100
|
+
let n = t.map((e) => K(e));
|
|
101
|
+
if (n.some((e) => N(e))) return e({ ...t });
|
|
102
|
+
let r = [];
|
|
103
|
+
for (let e of n) x(e) && r.push(...e);
|
|
104
|
+
return r;
|
|
105
|
+
}
|
|
106
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
107
|
+
function He(e, t) {
|
|
108
|
+
let n = g(t);
|
|
109
|
+
if (e.length !== n.length) throw Error("array_combine(): Argument #1 ($keys) and argument #2 ($values) must have the same number of elements");
|
|
110
|
+
let r = {};
|
|
111
|
+
for (let t = 0; t < e.length; t++) y(r, U(e[t]), n[t]);
|
|
112
|
+
return r;
|
|
113
|
+
}
|
|
114
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
115
|
+
function Ue(...e) {
|
|
116
|
+
return t(...e.map((e, t) => ({ [t]: e }))).map((e) => Object.values(e));
|
|
117
|
+
}
|
|
118
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
119
|
+
function We(e) {
|
|
120
|
+
return [e.map((e, t) => t), e.slice()];
|
|
121
|
+
}
|
|
122
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
123
|
+
function Ge(e, t = "", n = Infinity) {
|
|
124
|
+
return ee(e, t, n);
|
|
125
|
+
}
|
|
126
|
+
function Ke(e) {
|
|
127
|
+
return e.split(".").every(ae);
|
|
128
|
+
}
|
|
129
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
130
|
+
function qe(e) {
|
|
131
|
+
let t = /* @__PURE__ */ new Map(), n = 0;
|
|
132
|
+
for (let [r] of xe(e ?? {})) {
|
|
133
|
+
if (!Ke(r)) throw TypeError(`Arr.undot cannot build an array from the key "${r}": every dot segment must be a canonical decimal integer (no leading zeros, sign, or exponent) from 0 up to ${u}. Use Obj.undot for string keys.`);
|
|
134
|
+
let e = r.split(".");
|
|
135
|
+
for (let r = 0; r < e.length; r++) {
|
|
136
|
+
let i = e.slice(0, r).join("."), a = Number(e[r]), o = t.get(i) ?? 0;
|
|
137
|
+
if (!(a <= o) && (n += a - o, t.set(i, a), n > u)) throw TypeError(`Arr.undot cannot build an array: these keys' combined container indices exceed the ${u} budget.`);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
return ue(e);
|
|
141
|
+
}
|
|
142
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
143
|
+
function Je(...e) {
|
|
144
|
+
return Ye(...e);
|
|
145
|
+
}
|
|
146
|
+
function Ye(...e) {
|
|
147
|
+
let t = s(...e), n = [];
|
|
148
|
+
for (let [e, r] of Object.entries(t)) if (T(e)) {
|
|
149
|
+
for (; n.length < Number(e);) n.push(void 0);
|
|
150
|
+
n.push(r);
|
|
151
|
+
}
|
|
152
|
+
return n;
|
|
153
|
+
}
|
|
154
|
+
function Xe(e, ...t) {
|
|
155
|
+
return P(e) || e.unshift(...t), e;
|
|
156
|
+
}
|
|
157
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
158
|
+
function Ze(e, t) {
|
|
159
|
+
return /* @__PURE__ */ q(e, t);
|
|
160
|
+
}
|
|
161
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
162
|
+
function Qe(e, t, n = !1) {
|
|
163
|
+
let r = x(t) ? t : [t];
|
|
164
|
+
return e.filter((e) => !r.some((t) => n ? e === t : L(e, t)));
|
|
165
|
+
}
|
|
166
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
167
|
+
function $e(e, t) {
|
|
168
|
+
let n = z(U(t));
|
|
169
|
+
return k(n) && Object.hasOwn(e, n);
|
|
170
|
+
}
|
|
171
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
172
|
+
function et(e, t, r) {
|
|
173
|
+
let i = () => I(r) ? null : w(r) ? r() : r;
|
|
174
|
+
if (O(e) || I(e)) return i();
|
|
175
|
+
let a = K(e);
|
|
176
|
+
if (D(a) || N(a) && !E(a)) return n(a, t, r);
|
|
177
|
+
let o = x(a), s = o ? a : G(a);
|
|
178
|
+
if (!t) {
|
|
179
|
+
if (o) {
|
|
180
|
+
let e = a;
|
|
181
|
+
return e.length === 0 ? i() : e[0];
|
|
182
|
+
}
|
|
183
|
+
for (let e of s) return e;
|
|
184
|
+
return i();
|
|
185
|
+
}
|
|
186
|
+
let c = E(a) && !o ? a : G(st(a)), l = 0;
|
|
187
|
+
for (let e of c) if (!j(t(e, l++))) return e;
|
|
188
|
+
return i();
|
|
189
|
+
}
|
|
190
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
191
|
+
function tt(e, t, n) {
|
|
192
|
+
let i = () => I(n) ? null : w(n) ? n() : n;
|
|
193
|
+
if (O(e) || I(e)) return i();
|
|
194
|
+
let a = K(e);
|
|
195
|
+
if (D(a) || N(a) && !E(a)) return r(a, t, n);
|
|
196
|
+
let o = x(a), s = o ? a : G(a);
|
|
197
|
+
if (!t) {
|
|
198
|
+
if (o) {
|
|
199
|
+
let e = a;
|
|
200
|
+
return e.length === 0 ? i() : e[e.length - 1];
|
|
201
|
+
}
|
|
202
|
+
let e, t = !1;
|
|
203
|
+
for (let n of s) e = n, t = !0;
|
|
204
|
+
return t ? e : i();
|
|
205
|
+
}
|
|
206
|
+
if (o) {
|
|
207
|
+
let e = a;
|
|
208
|
+
for (let n = e.length - 1; n >= 0; n--) if (!j(t(e[n], n))) return e[n];
|
|
209
|
+
return i();
|
|
210
|
+
}
|
|
211
|
+
let c = 0, l = !1, u;
|
|
212
|
+
for (let e of s) j(t(e, c)) || (u = e, l = !0), c++;
|
|
213
|
+
return l ? u : i();
|
|
214
|
+
}
|
|
215
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
216
|
+
function nt(e, t) {
|
|
217
|
+
if (!e || t === 0) return [];
|
|
218
|
+
let n = e.length;
|
|
219
|
+
if (n === 0) return [];
|
|
220
|
+
if (t > 0) return t >= n ? e.slice() : e.slice(0, t);
|
|
221
|
+
let r = Math.abs(t);
|
|
222
|
+
return r >= n ? e.slice() : e.slice(n - r);
|
|
223
|
+
}
|
|
224
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
225
|
+
function rt(e, t = Infinity) {
|
|
226
|
+
let n = [];
|
|
227
|
+
if (!/* @__PURE__ */ W(e)) return n;
|
|
228
|
+
for (let r of e) {
|
|
229
|
+
let e = K(r);
|
|
230
|
+
if (!x(e) && !N(e)) {
|
|
231
|
+
n.push(e);
|
|
232
|
+
continue;
|
|
233
|
+
}
|
|
234
|
+
let i = x(e) ? e : Object.values(e);
|
|
235
|
+
for (let e of t === 1 ? i : /* @__PURE__ */ rt(i, t - 1)) n.push(e);
|
|
236
|
+
}
|
|
237
|
+
return n;
|
|
238
|
+
}
|
|
239
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
665
240
|
function it(e) {
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
}
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
}
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
function
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
}
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
}
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
}
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
}
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
}
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
}
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
}
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
}
|
|
241
|
+
if (!/* @__PURE__ */ W(e)) return {};
|
|
242
|
+
let t = {};
|
|
243
|
+
for (let n = 0; n < e.length; n++) {
|
|
244
|
+
let r = e[n];
|
|
245
|
+
ve(r) && y(t, String(r), n);
|
|
246
|
+
}
|
|
247
|
+
return t;
|
|
248
|
+
}
|
|
249
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
250
|
+
function at(e, t, n = null) {
|
|
251
|
+
let r = d(e, t, n);
|
|
252
|
+
if (!k(r)) throw new m(`Array value for key [${t}] must be a float, ${B(r)} found.`);
|
|
253
|
+
return r;
|
|
254
|
+
}
|
|
255
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
256
|
+
function q(e, t) {
|
|
257
|
+
return ne(e, t);
|
|
258
|
+
}
|
|
259
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
260
|
+
function ot(e) {
|
|
261
|
+
return st(e);
|
|
262
|
+
}
|
|
263
|
+
function st(e) {
|
|
264
|
+
if (x(e)) return e.slice();
|
|
265
|
+
if (D(e)) {
|
|
266
|
+
let t = {};
|
|
267
|
+
for (let [n, r] of e) y(t, String(n), r);
|
|
268
|
+
return t;
|
|
269
|
+
}
|
|
270
|
+
if (be(e)) throw Error("WeakMap values cannot be enumerated in JavaScript; cannot convert to array of values.");
|
|
271
|
+
if (E(e)) return [...e];
|
|
272
|
+
if (!O(e) && A(e)) return e;
|
|
273
|
+
throw new m("Items cannot be represented by a scalar value.");
|
|
274
|
+
}
|
|
275
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
276
|
+
function ct(e, t, n = null) {
|
|
277
|
+
if (O(t) || I(t)) return x(e) ? e : w(n) ? n() : n;
|
|
278
|
+
if (!x(e)) return w(n) ? n() : n;
|
|
279
|
+
let r = d(e, t, null);
|
|
280
|
+
return O(r) ? w(n) ? n() : n : r;
|
|
281
|
+
}
|
|
282
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
283
|
+
function J(e, t) {
|
|
284
|
+
let n = x(t) ? t : [t];
|
|
285
|
+
if (!/* @__PURE__ */ W(e) || n.length === 0) return !1;
|
|
286
|
+
for (let t of n) if (O(t) || I(t) || !ie(e, t)) return !1;
|
|
287
|
+
return !0;
|
|
288
|
+
}
|
|
289
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
290
|
+
function lt(e, t) {
|
|
291
|
+
let n = x(t) ? t : [t];
|
|
292
|
+
if (!/* @__PURE__ */ W(e) || n.length === 0) return !1;
|
|
293
|
+
for (let t of n) if (!/* @__PURE__ */ J(e, t)) return !1;
|
|
294
|
+
return !0;
|
|
295
|
+
}
|
|
296
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
297
|
+
function ut(e, t) {
|
|
298
|
+
if (O(t)) return !1;
|
|
299
|
+
let n = x(t) ? t : [t];
|
|
300
|
+
if (n.length === 0 || !/* @__PURE__ */ W(e)) return !1;
|
|
301
|
+
for (let t of n) if (/* @__PURE__ */ J(e, t)) return !0;
|
|
302
|
+
return !1;
|
|
303
|
+
}
|
|
304
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
305
|
+
function dt(e, t) {
|
|
306
|
+
if (/* @__PURE__ */ W(e)) {
|
|
307
|
+
let n = b(e);
|
|
308
|
+
for (let e = 0; e < n.length; e++) if (j(t(n[e], e))) return !1;
|
|
309
|
+
return !0;
|
|
310
|
+
}
|
|
311
|
+
if (!E(e) && !A(e)) return !1;
|
|
312
|
+
let n = 0;
|
|
313
|
+
for (let r of G(e)) if (j(t(r, n++))) return !1;
|
|
314
|
+
return !0;
|
|
315
|
+
}
|
|
316
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
317
|
+
function ft(e, t) {
|
|
318
|
+
if (/* @__PURE__ */ W(e)) {
|
|
319
|
+
let n = b(e);
|
|
320
|
+
for (let e = 0; e < n.length; e++) if (!j(t(n[e], e))) return !0;
|
|
321
|
+
return !1;
|
|
322
|
+
}
|
|
323
|
+
if (!E(e) && !A(e)) return !1;
|
|
324
|
+
let n = 0;
|
|
325
|
+
for (let r of G(e)) if (!j(t(r, n++))) return !0;
|
|
326
|
+
return !1;
|
|
327
|
+
}
|
|
328
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
329
|
+
function pt(e, t, n = null) {
|
|
330
|
+
let r = d(e, t, n);
|
|
331
|
+
if (!_e(r)) throw new m(`Array value for key [${t}] must be an integer, ${B(r)} found.`);
|
|
332
|
+
return r;
|
|
333
|
+
}
|
|
334
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
335
|
+
function mt(e, t, n = "") {
|
|
336
|
+
let r = b(e).map((e) => we(e));
|
|
337
|
+
if (n === "") return r.join(t);
|
|
338
|
+
let i = r.length;
|
|
339
|
+
if (i === 0) return "";
|
|
340
|
+
if (i === 1) return r[0];
|
|
341
|
+
let a = r.slice(0, -1).join(t), o = r[i - 1];
|
|
342
|
+
return a + n + o;
|
|
343
|
+
}
|
|
344
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
345
|
+
function ht(e, t) {
|
|
346
|
+
if (!/* @__PURE__ */ W(e)) return {};
|
|
347
|
+
let n = e, r = {};
|
|
348
|
+
for (let [e, i] of n.entries()) {
|
|
349
|
+
let n = w(t) ? t(i, e) : f(i, t);
|
|
350
|
+
y(r, ye(n) ? n : z(n), i);
|
|
351
|
+
}
|
|
352
|
+
return r;
|
|
353
|
+
}
|
|
354
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
355
|
+
function gt(e, t) {
|
|
356
|
+
let n = b(e), r = {};
|
|
357
|
+
for (let e = 0; e < n.length; e++) r[t + e] = n[e];
|
|
358
|
+
return r;
|
|
359
|
+
}
|
|
360
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
361
|
+
function _t(e, t) {
|
|
362
|
+
let n = b(e), r = x(t) ? t : O(t) ? [] : [t], i = new Set(r.filter(ve).map(String));
|
|
363
|
+
return n.filter((e, t) => i.has(String(t)));
|
|
364
|
+
}
|
|
365
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
366
|
+
function vt(e, t, n = !1) {
|
|
367
|
+
let r = x(t) ? t : [t];
|
|
368
|
+
return e.filter((e) => r.some((t) => n ? e === t : L(e, t)));
|
|
369
|
+
}
|
|
370
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
371
|
+
function yt(e, t) {
|
|
372
|
+
let n = o({ ...b(e) }, t);
|
|
373
|
+
return Object.values(n);
|
|
374
|
+
}
|
|
375
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
376
|
+
function bt(e, t, n = null) {
|
|
377
|
+
if (!/* @__PURE__ */ W(e)) return [];
|
|
378
|
+
let r = I(t) ? null : t, i = e, a = O(n) || I(n) ? [] : {};
|
|
379
|
+
for (let e of i) {
|
|
380
|
+
let t;
|
|
381
|
+
if (t = w(r) ? r(e) : se(e, te(r)), O(n) || I(n)) {
|
|
382
|
+
a.push(t);
|
|
383
|
+
continue;
|
|
384
|
+
}
|
|
385
|
+
let i = w(n) ? n(e) : se(e, te(n));
|
|
386
|
+
y(a, Se(i, { stringables: !0 }), t);
|
|
387
|
+
}
|
|
388
|
+
return a;
|
|
389
|
+
}
|
|
390
|
+
function xt(e, t = 1) {
|
|
391
|
+
if (!/* @__PURE__ */ W(e) || P(e)) return t === 1 ? null : [];
|
|
392
|
+
let n = e;
|
|
393
|
+
if (n.length === 0) return t === 1 ? null : [];
|
|
394
|
+
if (t === 1) return n.pop();
|
|
395
|
+
if (t < 1) return [];
|
|
396
|
+
let r = [], i = Ae(t, n.length);
|
|
397
|
+
for (let e = 0; e < i; e++) r.push(n.pop());
|
|
398
|
+
return r;
|
|
399
|
+
}
|
|
400
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
401
|
+
function St(e, t) {
|
|
402
|
+
let n = b(e), r = [];
|
|
403
|
+
for (let e = 0; e < n.length; e++) r.push(t(n[e], e));
|
|
404
|
+
return r;
|
|
405
|
+
}
|
|
406
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
407
|
+
function Ct(e, t) {
|
|
408
|
+
if (!/* @__PURE__ */ W(e)) return {};
|
|
409
|
+
let n = e, r = {};
|
|
410
|
+
for (let e = 0; e < n.length; e++) {
|
|
411
|
+
let i = t(n[e], e);
|
|
412
|
+
for (let [e, t] of Object.entries(i)) y(r, e, t);
|
|
413
|
+
}
|
|
414
|
+
return r;
|
|
415
|
+
}
|
|
416
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
417
|
+
function wt(e, t) {
|
|
418
|
+
let n = b(e), r = [];
|
|
419
|
+
for (let e = 0; e < n.length; e++) {
|
|
420
|
+
let i = n[e], a = K(i), o = x(a) ? a : c(l(a));
|
|
421
|
+
r.push(t(...o, e));
|
|
422
|
+
}
|
|
423
|
+
return r;
|
|
424
|
+
}
|
|
425
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
426
|
+
function Tt(e, t, ...n) {
|
|
427
|
+
let r = b(e);
|
|
428
|
+
if (n.length === 0) return [t, ...r];
|
|
429
|
+
let a = i({ ...Array.from(r) }, t, ...n);
|
|
430
|
+
return z(n[0]) === 0 ? Object.values(a) : a;
|
|
431
|
+
}
|
|
432
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
433
|
+
function Et(e, t, n = null) {
|
|
434
|
+
let r = () => w(n) ? n() : n;
|
|
435
|
+
if (!/* @__PURE__ */ W(e)) return {
|
|
436
|
+
value: r(),
|
|
437
|
+
data: []
|
|
438
|
+
};
|
|
439
|
+
if (O(t) || I(t)) {
|
|
440
|
+
let t = he(e).slice();
|
|
441
|
+
return {
|
|
442
|
+
value: r(),
|
|
443
|
+
data: t
|
|
444
|
+
};
|
|
445
|
+
}
|
|
446
|
+
let i = he(e), { found: a, value: o } = re(i, t);
|
|
447
|
+
if (C(a)) {
|
|
448
|
+
let e = i.slice();
|
|
449
|
+
return {
|
|
450
|
+
value: r(),
|
|
451
|
+
data: e
|
|
452
|
+
};
|
|
453
|
+
}
|
|
454
|
+
return {
|
|
455
|
+
value: o,
|
|
456
|
+
data: /* @__PURE__ */ q(i, t)
|
|
457
|
+
};
|
|
458
|
+
}
|
|
459
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
460
|
+
function Dt(e) {
|
|
461
|
+
if (O(e) || I(e)) return "";
|
|
462
|
+
let t = (e) => encodeURIComponent(e).replace(/[!'()*]/g, (e) => `%${e.charCodeAt(0).toString(16).toUpperCase()}`), n = (e) => S(e) ? e ? "1" : "0" : String(e), r = (e, i = "") => {
|
|
463
|
+
let a = [];
|
|
464
|
+
if (x(e)) for (let o = 0; o < e.length; o++) {
|
|
465
|
+
let s = i ? `${i}[${o}]` : String(o), c = e[o];
|
|
466
|
+
if (!O(c) && !I(c)) {
|
|
467
|
+
if (x(c) || A(c)) a.push(...r(c, s));
|
|
468
|
+
else {
|
|
469
|
+
let e = t(s);
|
|
470
|
+
a.push(`${e}=${t(n(c))}`);
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
else if (A(e) && !O(e)) for (let [o, s] of Object.entries(e)) {
|
|
475
|
+
let e = i ? `${i}[${o}]` : o;
|
|
476
|
+
if (!O(s) && !I(s)) {
|
|
477
|
+
if (x(s) || A(s)) a.push(...r(s, e));
|
|
478
|
+
else {
|
|
479
|
+
let r = t(e);
|
|
480
|
+
a.push(`${r}=${t(n(s))}`);
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
else {
|
|
485
|
+
let r = t(i || "0");
|
|
486
|
+
a.push(`${r}=${t(n(e))}`);
|
|
487
|
+
}
|
|
488
|
+
return a;
|
|
489
|
+
};
|
|
490
|
+
return r(e).join("&");
|
|
491
|
+
}
|
|
492
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
493
|
+
function Ot(e, t, n = !1) {
|
|
494
|
+
let r = !O(t) && !I(t);
|
|
495
|
+
if (!x(e)) return r ? [] : null;
|
|
496
|
+
let i = e, a = i.length, o = r ? t : 1;
|
|
497
|
+
if (R(o, ">", a)) throw new m(`You requested ${U(o)} items, but there are only ${a} items available.`);
|
|
498
|
+
if (a === 0 || r && R(o, "<=", 0)) return [];
|
|
499
|
+
let s = kt(o), c = [], l = Array.from({ length: a }, (e, t) => t);
|
|
500
|
+
for (let e = 0; e < s; e++) {
|
|
501
|
+
let e = p(0, l.length - 1);
|
|
502
|
+
c.push(l[e]), l.splice(e, 1);
|
|
503
|
+
}
|
|
504
|
+
if (c.sort((e, t) => e - t), !r) return i[c[0]];
|
|
505
|
+
if (n) {
|
|
506
|
+
let e = {};
|
|
507
|
+
for (let t of c) e[t] = i[t];
|
|
508
|
+
return e;
|
|
509
|
+
}
|
|
510
|
+
return c.map((e) => i[e]);
|
|
511
|
+
}
|
|
512
|
+
function kt(e) {
|
|
513
|
+
if (F(e) ? !M(e) : Number.isNaN(e)) throw TypeError(`Random\\Randomizer::pickArrayKeys(): Argument #2 ($num) must be of type int, ${F(e) ? "string" : "float"} given`);
|
|
514
|
+
let t = Math.trunc(Number(e));
|
|
515
|
+
if (t < 1) throw Error("Random\\Randomizer::pickArrayKeys(): Argument #2 ($num) must be between 1 and the number of elements in argument #1 ($array)");
|
|
516
|
+
return t;
|
|
517
|
+
}
|
|
518
|
+
function At(e, t = 1) {
|
|
519
|
+
if (t < 0) throw new m("Number of shifted items may not be less than zero.");
|
|
520
|
+
if (t === 0) return [];
|
|
521
|
+
if (!/* @__PURE__ */ W(e) || P(e)) return t === 1 ? null : [];
|
|
522
|
+
let n = e;
|
|
523
|
+
if (n.length === 0) return t === 1 ? null : [];
|
|
524
|
+
if (t === 1) return n.shift();
|
|
525
|
+
let r = [], i = Ae(t, n.length);
|
|
526
|
+
for (let e = 0; e < i; e++) r.push(n.shift());
|
|
527
|
+
return r;
|
|
528
|
+
}
|
|
529
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
530
|
+
function jt(e, t, n) {
|
|
531
|
+
return le(e, t, n);
|
|
532
|
+
}
|
|
533
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
534
|
+
function Mt(e, t, ...n) {
|
|
535
|
+
return oe(x(e) ? Pe(e, t, !0) : e, t, ...n);
|
|
536
|
+
}
|
|
537
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
538
|
+
function Nt(e) {
|
|
539
|
+
let t = b(e).slice();
|
|
540
|
+
for (let e = t.length - 1; e > 0; e--) {
|
|
541
|
+
let n = p(0, e);
|
|
542
|
+
[t[e], t[n]] = [t[n], t[e]];
|
|
543
|
+
}
|
|
544
|
+
return t;
|
|
545
|
+
}
|
|
546
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
547
|
+
function Pt(e, t) {
|
|
548
|
+
let n = $(t);
|
|
549
|
+
return /* @__PURE__ */ Ft(b(e), (e, t) => j(n(e, t)));
|
|
550
|
+
}
|
|
551
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
552
|
+
function Ft(e, t) {
|
|
553
|
+
let n = b(e), r = $(t), i = n.findIndex((e, t) => j(r(e, t)));
|
|
554
|
+
return n.slice(i === -1 ? n.length : i);
|
|
555
|
+
}
|
|
556
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
557
|
+
function It(e, t, n = null) {
|
|
558
|
+
if (!/* @__PURE__ */ W(e)) return [];
|
|
559
|
+
let r = e.slice(), { start: i, end: a } = Oe(r.length, t, n);
|
|
560
|
+
return r.slice(i, a);
|
|
561
|
+
}
|
|
562
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
563
|
+
function Lt(e, t) {
|
|
564
|
+
let n = b(e);
|
|
565
|
+
if (n.length === 0) throw new fe();
|
|
566
|
+
let r;
|
|
567
|
+
if (t) {
|
|
568
|
+
r = [];
|
|
569
|
+
for (let e = 0; e < n.length; e++) {
|
|
570
|
+
let i = n[e];
|
|
571
|
+
j(t(i, e)) || r.push(i);
|
|
572
|
+
}
|
|
573
|
+
} else r = n.slice();
|
|
574
|
+
let i = r.length;
|
|
575
|
+
if (i === 0) throw new fe();
|
|
576
|
+
if (i > 1) throw new pe(i);
|
|
577
|
+
return r[0];
|
|
578
|
+
}
|
|
579
|
+
function Rt(e, t, n = !1) {
|
|
580
|
+
let r = t.map((e) => Me(e, n));
|
|
581
|
+
return e.sort(Ce((e, t) => {
|
|
582
|
+
for (let n of r) {
|
|
583
|
+
let r = n(e, t);
|
|
584
|
+
if (r !== 0) return r;
|
|
585
|
+
}
|
|
586
|
+
return 0;
|
|
587
|
+
}));
|
|
588
|
+
}
|
|
589
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
590
|
+
function zt(e, t = null) {
|
|
591
|
+
let n = b(e).slice();
|
|
592
|
+
if (x(t)) return Rt(n, t);
|
|
593
|
+
if (C(t)) return n.sort((e, t) => _(e, t));
|
|
594
|
+
if (F(t)) return n.sort((e, n) => {
|
|
595
|
+
let r = f(e, t), i = f(n, t);
|
|
596
|
+
return _(r, i);
|
|
597
|
+
});
|
|
598
|
+
if (w(t)) {
|
|
599
|
+
let e = n.map((e, n) => ({
|
|
600
|
+
value: e,
|
|
601
|
+
sortKey: t(e, n)
|
|
602
|
+
}));
|
|
603
|
+
return e.sort((e, t) => _(e.sortKey, t.sortKey)), e.map((e) => e.value);
|
|
604
|
+
}
|
|
605
|
+
return n;
|
|
606
|
+
}
|
|
607
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
608
|
+
function Bt(e, t) {
|
|
609
|
+
let n = b(e).slice();
|
|
610
|
+
if (x(t)) return Rt(n, t, !0);
|
|
611
|
+
if (C(t)) return n.sort((e, t) => _(t, e));
|
|
612
|
+
if (F(t)) return n.sort((e, n) => {
|
|
613
|
+
let r = f(e, t), i = f(n, t);
|
|
614
|
+
return _(i, r);
|
|
615
|
+
});
|
|
616
|
+
if (w(t)) {
|
|
617
|
+
let e = n.map((e, n) => ({
|
|
618
|
+
value: e,
|
|
619
|
+
sortKey: t(e, n)
|
|
620
|
+
}));
|
|
621
|
+
return e.sort((e, t) => _(t.sortKey, e.sortKey)), e.map((e) => e.value);
|
|
622
|
+
}
|
|
623
|
+
return n;
|
|
624
|
+
}
|
|
625
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
626
|
+
function Vt(e, t = !1) {
|
|
627
|
+
return Y(e, t);
|
|
628
|
+
}
|
|
629
|
+
function Y(e, t) {
|
|
630
|
+
let n = t === !0 || t === "Descending";
|
|
631
|
+
if (!/* @__PURE__ */ W(e) && !A(e)) return e;
|
|
632
|
+
let r;
|
|
633
|
+
if (r = x(e) ? e.slice() : { ...e }, x(r)) {
|
|
634
|
+
for (let e = 0; e < r.length; e++) {
|
|
635
|
+
let t = r[e];
|
|
636
|
+
(x(t) || N(t)) && (r[e] = Y(t, n));
|
|
637
|
+
}
|
|
638
|
+
r.sort((e, t) => {
|
|
639
|
+
let r = _(e, t);
|
|
640
|
+
return n ? -r : r;
|
|
641
|
+
});
|
|
642
|
+
} else {
|
|
643
|
+
let e = Object.entries(r);
|
|
644
|
+
for (let [t, i] of e) (x(i) || N(i)) && y(r, t, Y(i, n));
|
|
645
|
+
let t = {};
|
|
646
|
+
if (e.every(([e], t) => e === String(t))) return e.map(([e]) => r[e]).sort((e, t) => {
|
|
647
|
+
let r = _(e, t);
|
|
648
|
+
return n ? -r : r;
|
|
649
|
+
}).forEach((e, n) => {
|
|
650
|
+
y(t, String(n), e);
|
|
651
|
+
}), t;
|
|
652
|
+
let i = e.sort(([e], [t]) => {
|
|
653
|
+
let r = _(e, t);
|
|
654
|
+
return n ? -r : r;
|
|
655
|
+
});
|
|
656
|
+
for (let [e] of i) y(t, e, r[e]);
|
|
657
|
+
r = t;
|
|
658
|
+
}
|
|
659
|
+
return r;
|
|
660
|
+
}
|
|
661
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
662
|
+
function Ht(e) {
|
|
663
|
+
return Y(e, "Descending");
|
|
664
|
+
}
|
|
665
|
+
function Ut(e, t, n, ...r) {
|
|
666
|
+
if (!/* @__PURE__ */ W(e) || P(e)) return [];
|
|
667
|
+
let i = [];
|
|
668
|
+
for (let e of r) /* @__PURE__ */ W(e) || A(e) ? i.push(...Object.values(e)) : i.push(e);
|
|
669
|
+
let { start: a, count: o } = ke(e.length, t, n);
|
|
670
|
+
return e.splice(a, o, ...i);
|
|
671
|
+
}
|
|
672
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
673
|
+
function X(e, t) {
|
|
674
|
+
let n = b(e), r = $(t), i = n.findIndex((e, t) => !j(r(e, t)));
|
|
675
|
+
return n.slice(0, i === -1 ? n.length : i);
|
|
676
|
+
}
|
|
677
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
678
|
+
function Wt(e, t) {
|
|
679
|
+
let n = $(t);
|
|
680
|
+
return /* @__PURE__ */ X(b(e), (e, t) => j(n(e, t)));
|
|
681
|
+
}
|
|
682
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
683
|
+
function Gt(e, t, n = null) {
|
|
684
|
+
let r = d(e, t, n);
|
|
685
|
+
if (!F(r)) throw new m(`Array value for key [${t}] must be a string, ${B(r)} found.`);
|
|
686
|
+
return r;
|
|
687
|
+
}
|
|
688
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
935
689
|
function Kt(e) {
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
function
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
function
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
}
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
}
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
}
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
function
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
}
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
}
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
function
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
pe as has,
|
|
1126
|
-
Ln as hasAll,
|
|
1127
|
-
Wn as hasAny,
|
|
1128
|
-
_n as integer,
|
|
1129
|
-
un as intersect,
|
|
1130
|
-
Wt as intersectAssoc,
|
|
1131
|
-
Tt as intersectAssocUsing,
|
|
1132
|
-
Vt as intersectByKeys,
|
|
1133
|
-
Lt as intersectUsing,
|
|
1134
|
-
Fn as join,
|
|
1135
|
-
Jn as keyBy,
|
|
1136
|
-
Mt as keys,
|
|
1137
|
-
Nn as last,
|
|
1138
|
-
Hn as map,
|
|
1139
|
-
Gn as mapSpread,
|
|
1140
|
-
Zn as mapWithKeys,
|
|
1141
|
-
Qn as only,
|
|
1142
|
-
Xn as onlyValues,
|
|
1143
|
-
At as pad,
|
|
1144
|
-
jt as partition,
|
|
1145
|
-
zn as pluck,
|
|
1146
|
-
Yn as pop,
|
|
1147
|
-
kn as prepend,
|
|
1148
|
-
Bn as prependKeysWith,
|
|
1149
|
-
et as pull,
|
|
1150
|
-
st as push,
|
|
1151
|
-
nt as query,
|
|
1152
|
-
tt as random,
|
|
1153
|
-
wt as reject,
|
|
1154
|
-
dt as replace,
|
|
1155
|
-
Ot as replaceRecursive,
|
|
1156
|
-
$t as reverse,
|
|
1157
|
-
qn as select,
|
|
1158
|
-
ot as set,
|
|
1159
|
-
rt as shift,
|
|
1160
|
-
it as shuffle,
|
|
1161
|
-
ut as skipUntil,
|
|
1162
|
-
rn as skipWhile,
|
|
1163
|
-
ct as slice,
|
|
1164
|
-
ft as sole,
|
|
1165
|
-
Vn as some,
|
|
1166
|
-
lt as sort,
|
|
1167
|
-
ht as sortDesc,
|
|
1168
|
-
pt as sortRecursive,
|
|
1169
|
-
at as sortRecursiveDesc,
|
|
1170
|
-
mt as splice,
|
|
1171
|
-
vt as string,
|
|
1172
|
-
Pn as take,
|
|
1173
|
-
on as takeUntil,
|
|
1174
|
-
gt as takeWhile,
|
|
1175
|
-
yt as toCssClasses,
|
|
1176
|
-
bt as toCssStyles,
|
|
1177
|
-
jn as undot,
|
|
1178
|
-
Kn as union,
|
|
1179
|
-
In as unshift,
|
|
1180
|
-
Et as values,
|
|
1181
|
-
me as where,
|
|
1182
|
-
Kt as whereNotNull,
|
|
1183
|
-
St as wrap
|
|
1184
|
-
};
|
|
690
|
+
if (!/* @__PURE__ */ W(e) && !A(e)) return "";
|
|
691
|
+
let t;
|
|
692
|
+
t = x(e) ? { ...e } : e;
|
|
693
|
+
let n = [];
|
|
694
|
+
for (let [e, r] of Object.entries(t)) M(e) ? n.push(v(r)) : j(r) || n.push(e);
|
|
695
|
+
return n.join(" ");
|
|
696
|
+
}
|
|
697
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
698
|
+
function qt(e) {
|
|
699
|
+
if (!/* @__PURE__ */ W(e) && !A(e)) return "";
|
|
700
|
+
let t;
|
|
701
|
+
t = x(e) ? { ...e } : e;
|
|
702
|
+
let n = [];
|
|
703
|
+
for (let [e, r] of Object.entries(t)) M(e) ? n.push(de(v(r), ";")) : j(r) || n.push(de(e, ";"));
|
|
704
|
+
return n.join(" ");
|
|
705
|
+
}
|
|
706
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
707
|
+
function Z(e, t) {
|
|
708
|
+
let n = b(e), r = [];
|
|
709
|
+
for (let e = 0; e < n.length; e++) {
|
|
710
|
+
let i = n[e];
|
|
711
|
+
j(t(i, e)) || r.push(i);
|
|
712
|
+
}
|
|
713
|
+
return r;
|
|
714
|
+
}
|
|
715
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
716
|
+
function Jt(e, t) {
|
|
717
|
+
return /* @__PURE__ */ Z(e, (e, n) => j(t(e, n)));
|
|
718
|
+
}
|
|
719
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
720
|
+
function Yt(e, t) {
|
|
721
|
+
let n = b(e);
|
|
722
|
+
for (let [e, r] of Object.entries(h(t))) if (T(e)) {
|
|
723
|
+
for (; n.length < Number(e);) n.push(void 0);
|
|
724
|
+
n[Number(e)] = r;
|
|
725
|
+
}
|
|
726
|
+
return n;
|
|
727
|
+
}
|
|
728
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
729
|
+
function Xt(e, t) {
|
|
730
|
+
let n = b(e), r = Object.fromEntries(Object.entries(h(t)).filter(([e]) => T(e))), i = a({ ...n }, r), o = [];
|
|
731
|
+
for (let [e, t] of Object.entries(i)) {
|
|
732
|
+
for (; o.length < Number(e);) o.push(void 0);
|
|
733
|
+
o.push(t);
|
|
734
|
+
}
|
|
735
|
+
return o;
|
|
736
|
+
}
|
|
737
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
738
|
+
function Zt(e) {
|
|
739
|
+
return b(e).slice().reverse();
|
|
740
|
+
}
|
|
741
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
742
|
+
function Qt(e, t, n) {
|
|
743
|
+
let r = De(t), i = b(e), a = i.length, o = Math.abs(r);
|
|
744
|
+
if (o <= a) return i;
|
|
745
|
+
let s = o - a, c = Array(s).fill(n);
|
|
746
|
+
return r < 0 ? [...c, ...i] : [...i, ...c];
|
|
747
|
+
}
|
|
748
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
749
|
+
function $t(e, t) {
|
|
750
|
+
let n = b(e), r = [], i = [];
|
|
751
|
+
for (let e = 0; e < n.length; e++) {
|
|
752
|
+
let a = n[e];
|
|
753
|
+
j(t(a, e)) ? i.push(a) : r.push(a);
|
|
754
|
+
}
|
|
755
|
+
return [r, i];
|
|
756
|
+
}
|
|
757
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
758
|
+
function en(e) {
|
|
759
|
+
return /* @__PURE__ */ Z(e, (e) => !O(e));
|
|
760
|
+
}
|
|
761
|
+
function tn(e, t, n) {
|
|
762
|
+
return w(e) ? e : (r) => R(nn(r, e), t, n);
|
|
763
|
+
}
|
|
764
|
+
function nn(e, t) {
|
|
765
|
+
return O(t) || I(t) ? e : f(e, t) ?? null;
|
|
766
|
+
}
|
|
767
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
768
|
+
function Q(e, t, ...n) {
|
|
769
|
+
let [r, i] = n;
|
|
770
|
+
if (n.length > 1 || n.length === 1 && !S(r) && !I(r)) return /* @__PURE__ */ Q(e, tn(t, n.length > 1 ? String(r) : "=", n.length > 1 ? i : r));
|
|
771
|
+
let a = r === !0;
|
|
772
|
+
if (!x(e)) return !1;
|
|
773
|
+
if (w(t)) {
|
|
774
|
+
let n = t;
|
|
775
|
+
for (let [t, r] of e.entries()) if (!j(n(r, t))) return !0;
|
|
776
|
+
return !1;
|
|
777
|
+
}
|
|
778
|
+
return a ? e.some((e) => H(e, t)) : e.some((e) => L(e, t));
|
|
779
|
+
}
|
|
780
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
781
|
+
function rn(e, t, n) {
|
|
782
|
+
return I(n) ? /* @__PURE__ */ Q(e, t, !0) : /* @__PURE__ */ Q(e, (e) => H(nn(e, t), n));
|
|
783
|
+
}
|
|
784
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
785
|
+
function an(e, t) {
|
|
786
|
+
return x(e) ? w(t) ? e.filter((e, n) => !j(t(e, n))) : e.filter((e) => !j(e)) : [];
|
|
787
|
+
}
|
|
788
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
789
|
+
function on(e) {
|
|
790
|
+
return O(e) ? [] : x(e) ? e : [e];
|
|
791
|
+
}
|
|
792
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
793
|
+
function sn(e) {
|
|
794
|
+
return /* @__PURE__ */ W(e) ? Array.from(e.keys()) : [];
|
|
795
|
+
}
|
|
796
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
797
|
+
function cn(e) {
|
|
798
|
+
return /* @__PURE__ */ W(e) ? Array.from(e.values()) : [];
|
|
799
|
+
}
|
|
800
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
801
|
+
function ln(e, t) {
|
|
802
|
+
if (!/* @__PURE__ */ W(e)) return [];
|
|
803
|
+
let n = g(t), r = Te(n), i = [];
|
|
804
|
+
for (let t of e) r(t) || i.push(t);
|
|
805
|
+
return i;
|
|
806
|
+
}
|
|
807
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
808
|
+
function un(e, t) {
|
|
809
|
+
if (!/* @__PURE__ */ W(e)) return [];
|
|
810
|
+
let n = h(t);
|
|
811
|
+
return b(e).filter((e, t) => !Object.hasOwn(n, t) || !V(e, n[t]));
|
|
812
|
+
}
|
|
813
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
814
|
+
function dn(e, t) {
|
|
815
|
+
if (!/* @__PURE__ */ W(e)) return [];
|
|
816
|
+
let n = h(t);
|
|
817
|
+
return b(e).filter((e, t) => !Object.hasOwn(n, t));
|
|
818
|
+
}
|
|
819
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
820
|
+
function fn(e, t, n) {
|
|
821
|
+
if (!/* @__PURE__ */ W(e)) return [];
|
|
822
|
+
let r = g(t);
|
|
823
|
+
return b(e).filter((e) => !r.some((t) => n(e, t)));
|
|
824
|
+
}
|
|
825
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
826
|
+
function pn(e, t, n) {
|
|
827
|
+
return hn(e, t, n, !0);
|
|
828
|
+
}
|
|
829
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
830
|
+
function mn(e, t, n) {
|
|
831
|
+
return hn(e, t, n, !1);
|
|
832
|
+
}
|
|
833
|
+
function hn(e, t, n, r) {
|
|
834
|
+
if (!/* @__PURE__ */ W(e)) return [];
|
|
835
|
+
let i = h(t), a = Object.keys(i);
|
|
836
|
+
return b(e).filter((e, t) => {
|
|
837
|
+
let o = a.find((e) => n(t, z(e)));
|
|
838
|
+
return o === void 0 || r && !V(i[o], e);
|
|
839
|
+
});
|
|
840
|
+
}
|
|
841
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
842
|
+
function gn(e, t, n = null) {
|
|
843
|
+
if (!/* @__PURE__ */ W(e)) return [];
|
|
844
|
+
let r = b(e), i = g(t), a = [];
|
|
845
|
+
if (w(n)) {
|
|
846
|
+
for (let e of r) i.some((t) => n(e, t)) && a.push(e);
|
|
847
|
+
return a;
|
|
848
|
+
}
|
|
849
|
+
let o = Te(i);
|
|
850
|
+
for (let e of r) o(e) && a.push(e);
|
|
851
|
+
return a;
|
|
852
|
+
}
|
|
853
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
854
|
+
function _n(e, t, n) {
|
|
855
|
+
return /* @__PURE__ */ gn(e, t, n);
|
|
856
|
+
}
|
|
857
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
858
|
+
function vn(e, t) {
|
|
859
|
+
if (!/* @__PURE__ */ W(e)) return [];
|
|
860
|
+
let n = h(t);
|
|
861
|
+
return b(e).filter((e, t) => Object.hasOwn(n, t) && V(e, n[t]));
|
|
862
|
+
}
|
|
863
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
864
|
+
function yn(e, t, n) {
|
|
865
|
+
if (!/* @__PURE__ */ W(e)) return [];
|
|
866
|
+
let r = Object.entries(h(t));
|
|
867
|
+
return b(e).filter((e, t) => r.some(([r, i]) => n(t, z(r)) && V(e, i)));
|
|
868
|
+
}
|
|
869
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
870
|
+
function bn(e, t) {
|
|
871
|
+
if (!/* @__PURE__ */ W(e)) return [];
|
|
872
|
+
let n = h(t);
|
|
873
|
+
return b(e).filter((e, t) => Object.hasOwn(n, t));
|
|
874
|
+
}
|
|
875
|
+
function $(e) {
|
|
876
|
+
return w(e) ? e : (t) => H(t, e);
|
|
877
|
+
}
|
|
878
|
+
export { W as accessible, Fe as add, Ie as arrayItem, Ne as arrayable, Le as boolean, Re as chunk, Be as chunkBy, ze as chunkWhile, Ve as collapse, He as combine, Q as contains, rn as containsStrict, Ue as crossJoin, ln as diff, un as diffAssoc, pn as diffAssocUsing, dn as diffKeys, mn as diffKeysUsing, fn as diffUsing, We as divide, Ge as dot, dt as every, Ze as except, Qe as exceptValues, $e as exists, an as filter, et as first, rt as flatten, it as flip, at as float, q as forget, ot as from, ct as get, J as has, lt as hasAll, ut as hasAny, pt as integer, gn as intersect, vn as intersectAssoc, yn as intersectAssocUsing, bn as intersectByKeys, _n as intersectUsing, mt as join, ht as keyBy, sn as keys, tt as last, St as map, wt as mapSpread, Ct as mapWithKeys, _t as only, vt as onlyValues, Qt as pad, $t as partition, bt as pluck, xt as pop, Tt as prepend, gt as prependKeysWith, Et as pull, Mt as push, Dt as query, Ot as random, Jt as reject, Yt as replace, Xt as replaceRecursive, Zt as reverse, yt as select, jt as set, At as shift, Nt as shuffle, Pt as skipUntil, Ft as skipWhile, It as slice, Lt as sole, ft as some, zt as sort, Bt as sortDesc, Vt as sortRecursive, Ht as sortRecursiveDesc, Ut as splice, Gt as string, nt as take, X as takeUntil, Wt as takeWhile, Kt as toCssClasses, qt as toCssStyles, qe as undot, Je as union, Xe as unshift, cn as values, Z as where, en as whereNotNull, on as wrap };
|