@tolki/arr 1.0.1 → 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 +351 -262
- package/package.json +7 -7
package/dist/arr.js
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { InvalidArgumentException as h, ItemNotFoundException as fe, MultipleItemsFoundException as pe, arrayValueMessage as me, arrayableItems as g, arrayableValues as _, castableToArray as he, compareValues as v, createSortSpecComparator as ge, cssListItemToString as _e, defineKey as y, getAccessibleValues as b, isArray as x, isBoolean as S, isFalsy as C, isFunction as w, isInteger as ve, isIntegerLikeKey as T, isIterable as E, isMap as D, isNull as O, isNumber as k, isObject as A, isPhpArrayKey as ye, isPhpFalsy as j, isPhpNumeric as M, isPlainObject as N, isPrototypeObject as P, isString as F, isSymbol as be, isUndefined as I, isWeakMap as xe, keyedEntries as Se, looseEqual as L, operatorMatch as R, phpArrayKey as z, phpComputedKey as Ce, phpSortComparator as we, phpStringCast as Te, phpTypeName as B, phpValueMatch as V, phpValueMatcher as Ee, readMapKey as De, resolvePadLength as Oe, resolveSliceRange as ke, resolveSpliceRange as Ae, resolveTakeCount as je, strictEqual as H, toPhpKeyString as U, writeMapKey as Me } from "@tolki/utils";
|
|
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";
|
|
6
5
|
// src/arr.ts
|
|
7
|
-
|
|
6
|
+
function Me(e, t) {
|
|
7
|
+
return ge((e, t) => f(e, t))(e, t);
|
|
8
|
+
}
|
|
9
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
8
10
|
function W(e) {
|
|
9
11
|
return x(e);
|
|
10
12
|
}
|
|
11
|
-
|
|
13
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
14
|
+
function Ne(e) {
|
|
12
15
|
return x(e);
|
|
13
16
|
}
|
|
14
17
|
function G(e) {
|
|
@@ -17,12 +20,12 @@ function G(e) {
|
|
|
17
20
|
function K(e) {
|
|
18
21
|
return !N(e) && A(e) && w(e.all) ? e.all() : e;
|
|
19
22
|
}
|
|
20
|
-
function
|
|
23
|
+
function Pe(e, t, n = !1) {
|
|
21
24
|
let r = [...e];
|
|
22
25
|
if (O(t) || I(t)) return r;
|
|
23
|
-
let i =
|
|
26
|
+
let i = k(t) ? [String(t)] : String(t).split("."), a = r, o = n ? i : i.slice(0, -1);
|
|
24
27
|
for (let [e, t] of o.entries()) {
|
|
25
|
-
let i = D(a) ?
|
|
28
|
+
let i = D(a) ? Ee(a, t) : Object.hasOwn(a, t) ? {
|
|
26
29
|
found: !0,
|
|
27
30
|
value: a[t]
|
|
28
31
|
} : { found: !1 };
|
|
@@ -42,25 +45,29 @@ function Fe(e, t, n = !1) {
|
|
|
42
45
|
configurable: !0
|
|
43
46
|
});
|
|
44
47
|
}
|
|
45
|
-
D(a) ?
|
|
48
|
+
D(a) ? je(a, t, c) : y(a, t, c), a = c;
|
|
46
49
|
}
|
|
47
50
|
return r;
|
|
48
51
|
}
|
|
49
|
-
|
|
50
|
-
|
|
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);
|
|
52
56
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
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));
|
|
56
61
|
return r;
|
|
57
62
|
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
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.`);
|
|
61
67
|
return r;
|
|
62
68
|
}
|
|
63
|
-
|
|
69
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
70
|
+
function Re(e, t, n) {
|
|
64
71
|
if (t <= 0) return [];
|
|
65
72
|
if (n) {
|
|
66
73
|
let n = [];
|
|
@@ -77,83 +84,96 @@ function ze(e, t, n) {
|
|
|
77
84
|
}
|
|
78
85
|
return r;
|
|
79
86
|
}
|
|
80
|
-
|
|
87
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
88
|
+
function ze(e, t) {
|
|
81
89
|
let n = [], r = [];
|
|
82
90
|
for (let [i, a] of e.entries()) r.length > 0 && j(t(a, i, r)) && (n.push(r), r = []), r.push(a);
|
|
83
91
|
return r.length > 0 && n.push(r), n;
|
|
84
92
|
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
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)));
|
|
88
97
|
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
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 });
|
|
92
102
|
let r = [];
|
|
93
103
|
for (let e of n) x(e) && r.push(...e);
|
|
94
104
|
return r;
|
|
95
105
|
}
|
|
96
|
-
|
|
97
|
-
|
|
106
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
107
|
+
function He(e, t) {
|
|
108
|
+
let n = g(t);
|
|
98
109
|
if (e.length !== n.length) throw Error("array_combine(): Argument #1 ($keys) and argument #2 ($values) must have the same number of elements");
|
|
99
110
|
let r = {};
|
|
100
111
|
for (let t = 0; t < e.length; t++) y(r, U(e[t]), n[t]);
|
|
101
112
|
return r;
|
|
102
113
|
}
|
|
103
|
-
|
|
104
|
-
|
|
114
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
115
|
+
function Ue(...e) {
|
|
116
|
+
return t(...e.map((e, t) => ({ [t]: e }))).map((e) => Object.values(e));
|
|
105
117
|
}
|
|
106
|
-
|
|
118
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
119
|
+
function We(e) {
|
|
107
120
|
return [e.map((e, t) => t), e.slice()];
|
|
108
121
|
}
|
|
109
|
-
|
|
122
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
123
|
+
function Ge(e, t = "", n = Infinity) {
|
|
110
124
|
return ee(e, t, n);
|
|
111
125
|
}
|
|
112
|
-
function
|
|
113
|
-
return e.split(".").every(
|
|
126
|
+
function Ke(e) {
|
|
127
|
+
return e.split(".").every(ae);
|
|
114
128
|
}
|
|
115
|
-
|
|
129
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
130
|
+
function qe(e) {
|
|
116
131
|
let t = /* @__PURE__ */ new Map(), n = 0;
|
|
117
|
-
for (let [r] of
|
|
118
|
-
if (!
|
|
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.`);
|
|
119
134
|
let e = r.split(".");
|
|
120
135
|
for (let r = 0; r < e.length; r++) {
|
|
121
136
|
let i = e.slice(0, r).join("."), a = Number(e[r]), o = t.get(i) ?? 0;
|
|
122
|
-
if (!(a <= o) && (n += a - o, t.set(i, a), n >
|
|
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.`);
|
|
123
138
|
}
|
|
124
139
|
}
|
|
125
|
-
return
|
|
140
|
+
return ue(e);
|
|
126
141
|
}
|
|
127
|
-
|
|
128
|
-
|
|
142
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
143
|
+
function Je(...e) {
|
|
144
|
+
return Ye(...e);
|
|
129
145
|
}
|
|
130
|
-
function
|
|
131
|
-
let t =
|
|
146
|
+
function Ye(...e) {
|
|
147
|
+
let t = s(...e), n = [];
|
|
132
148
|
for (let [e, r] of Object.entries(t)) if (T(e)) {
|
|
133
149
|
for (; n.length < Number(e);) n.push(void 0);
|
|
134
150
|
n.push(r);
|
|
135
151
|
}
|
|
136
152
|
return n;
|
|
137
153
|
}
|
|
138
|
-
function
|
|
154
|
+
function Xe(e, ...t) {
|
|
139
155
|
return P(e) || e.unshift(...t), e;
|
|
140
156
|
}
|
|
141
|
-
|
|
142
|
-
|
|
157
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
158
|
+
function Ze(e, t) {
|
|
159
|
+
return /* @__PURE__ */ q(e, t);
|
|
143
160
|
}
|
|
144
|
-
|
|
161
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
162
|
+
function Qe(e, t, n = !1) {
|
|
145
163
|
let r = x(t) ? t : [t];
|
|
146
164
|
return e.filter((e) => !r.some((t) => n ? e === t : L(e, t)));
|
|
147
165
|
}
|
|
148
|
-
|
|
166
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
167
|
+
function $e(e, t) {
|
|
149
168
|
let n = z(U(t));
|
|
150
169
|
return k(n) && Object.hasOwn(e, n);
|
|
151
170
|
}
|
|
152
|
-
|
|
153
|
-
|
|
171
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
172
|
+
function et(e, t, r) {
|
|
173
|
+
let i = () => I(r) ? null : w(r) ? r() : r;
|
|
154
174
|
if (O(e) || I(e)) return i();
|
|
155
175
|
let a = K(e);
|
|
156
|
-
if (D(a) || N(a) && !E(a)) return
|
|
176
|
+
if (D(a) || N(a) && !E(a)) return n(a, t, r);
|
|
157
177
|
let o = x(a), s = o ? a : G(a);
|
|
158
178
|
if (!t) {
|
|
159
179
|
if (o) {
|
|
@@ -163,35 +183,37 @@ function tt(e, t, n) {
|
|
|
163
183
|
for (let e of s) return e;
|
|
164
184
|
return i();
|
|
165
185
|
}
|
|
166
|
-
let c = E(a) && !o ? a : G(
|
|
186
|
+
let c = E(a) && !o ? a : G(st(a)), l = 0;
|
|
167
187
|
for (let e of c) if (!j(t(e, l++))) return e;
|
|
168
188
|
return i();
|
|
169
189
|
}
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
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();
|
|
173
194
|
let a = K(e);
|
|
174
|
-
if (D(a) || N(a) && !E(a)) return
|
|
195
|
+
if (D(a) || N(a) && !E(a)) return r(a, t, n);
|
|
175
196
|
let o = x(a), s = o ? a : G(a);
|
|
176
197
|
if (!t) {
|
|
177
198
|
if (o) {
|
|
178
199
|
let e = a;
|
|
179
|
-
return e.length === 0 ?
|
|
200
|
+
return e.length === 0 ? i() : e[e.length - 1];
|
|
180
201
|
}
|
|
181
202
|
let e, t = !1;
|
|
182
203
|
for (let n of s) e = n, t = !0;
|
|
183
|
-
return t ? e :
|
|
204
|
+
return t ? e : i();
|
|
184
205
|
}
|
|
185
206
|
if (o) {
|
|
186
207
|
let e = a;
|
|
187
208
|
for (let n = e.length - 1; n >= 0; n--) if (!j(t(e[n], n))) return e[n];
|
|
188
|
-
return
|
|
209
|
+
return i();
|
|
189
210
|
}
|
|
190
211
|
let c = 0, l = !1, u;
|
|
191
212
|
for (let e of s) j(t(e, c)) || (u = e, l = !0), c++;
|
|
192
|
-
return l ? u :
|
|
213
|
+
return l ? u : i();
|
|
193
214
|
}
|
|
194
|
-
|
|
215
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
216
|
+
function nt(e, t) {
|
|
195
217
|
if (!e || t === 0) return [];
|
|
196
218
|
let n = e.length;
|
|
197
219
|
if (n === 0) return [];
|
|
@@ -199,9 +221,10 @@ function rt(e, t) {
|
|
|
199
221
|
let r = Math.abs(t);
|
|
200
222
|
return r >= n ? e.slice() : e.slice(n - r);
|
|
201
223
|
}
|
|
202
|
-
|
|
224
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
225
|
+
function rt(e, t = Infinity) {
|
|
203
226
|
let n = [];
|
|
204
|
-
if (
|
|
227
|
+
if (!/* @__PURE__ */ W(e)) return n;
|
|
205
228
|
for (let r of e) {
|
|
206
229
|
let e = K(r);
|
|
207
230
|
if (!x(e) && !N(e)) {
|
|
@@ -209,69 +232,78 @@ function it(e, t = Infinity) {
|
|
|
209
232
|
continue;
|
|
210
233
|
}
|
|
211
234
|
let i = x(e) ? e : Object.values(e);
|
|
212
|
-
for (let e of t === 1 ? i :
|
|
235
|
+
for (let e of t === 1 ? i : /* @__PURE__ */ rt(i, t - 1)) n.push(e);
|
|
213
236
|
}
|
|
214
237
|
return n;
|
|
215
238
|
}
|
|
216
|
-
|
|
217
|
-
|
|
239
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
240
|
+
function it(e) {
|
|
241
|
+
if (!/* @__PURE__ */ W(e)) return {};
|
|
218
242
|
let t = {};
|
|
219
243
|
for (let n = 0; n < e.length; n++) {
|
|
220
244
|
let r = e[n];
|
|
221
|
-
|
|
245
|
+
ve(r) && y(t, String(r), n);
|
|
222
246
|
}
|
|
223
247
|
return t;
|
|
224
248
|
}
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
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.`);
|
|
228
253
|
return r;
|
|
229
254
|
}
|
|
255
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
230
256
|
function q(e, t) {
|
|
231
|
-
return
|
|
257
|
+
return ne(e, t);
|
|
232
258
|
}
|
|
233
|
-
|
|
234
|
-
|
|
259
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
260
|
+
function ot(e) {
|
|
261
|
+
return st(e);
|
|
235
262
|
}
|
|
236
|
-
function
|
|
263
|
+
function st(e) {
|
|
237
264
|
if (x(e)) return e.slice();
|
|
238
265
|
if (D(e)) {
|
|
239
266
|
let t = {};
|
|
240
267
|
for (let [n, r] of e) y(t, String(n), r);
|
|
241
268
|
return t;
|
|
242
269
|
}
|
|
243
|
-
if (
|
|
270
|
+
if (be(e)) throw Error("WeakMap values cannot be enumerated in JavaScript; cannot convert to array of values.");
|
|
244
271
|
if (E(e)) return [...e];
|
|
245
272
|
if (!O(e) && A(e)) return e;
|
|
246
|
-
throw new
|
|
273
|
+
throw new m("Items cannot be represented by a scalar value.");
|
|
247
274
|
}
|
|
248
|
-
|
|
275
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
276
|
+
function ct(e, t, n = null) {
|
|
249
277
|
if (O(t) || I(t)) return x(e) ? e : w(n) ? n() : n;
|
|
250
278
|
if (!x(e)) return w(n) ? n() : n;
|
|
251
|
-
let r =
|
|
279
|
+
let r = d(e, t, null);
|
|
252
280
|
return O(r) ? w(n) ? n() : n : r;
|
|
253
281
|
}
|
|
282
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
254
283
|
function J(e, t) {
|
|
255
284
|
let n = x(t) ? t : [t];
|
|
256
|
-
if (
|
|
257
|
-
for (let t of n) if (O(t) || I(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;
|
|
258
287
|
return !0;
|
|
259
288
|
}
|
|
260
|
-
|
|
289
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
290
|
+
function lt(e, t) {
|
|
261
291
|
let n = x(t) ? t : [t];
|
|
262
|
-
if (
|
|
263
|
-
for (let t of n) if (
|
|
292
|
+
if (!/* @__PURE__ */ W(e) || n.length === 0) return !1;
|
|
293
|
+
for (let t of n) if (!/* @__PURE__ */ J(e, t)) return !1;
|
|
264
294
|
return !0;
|
|
265
295
|
}
|
|
266
|
-
|
|
296
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
297
|
+
function ut(e, t) {
|
|
267
298
|
if (O(t)) return !1;
|
|
268
299
|
let n = x(t) ? t : [t];
|
|
269
|
-
if (n.length === 0 ||
|
|
270
|
-
for (let t of n) if (J(e, t)) return !0;
|
|
300
|
+
if (n.length === 0 || !/* @__PURE__ */ W(e)) return !1;
|
|
301
|
+
for (let t of n) if (/* @__PURE__ */ J(e, t)) return !0;
|
|
271
302
|
return !1;
|
|
272
303
|
}
|
|
273
|
-
|
|
274
|
-
|
|
304
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
305
|
+
function dt(e, t) {
|
|
306
|
+
if (/* @__PURE__ */ W(e)) {
|
|
275
307
|
let n = b(e);
|
|
276
308
|
for (let e = 0; e < n.length; e++) if (j(t(n[e], e))) return !1;
|
|
277
309
|
return !0;
|
|
@@ -281,8 +313,9 @@ function ft(e, t) {
|
|
|
281
313
|
for (let r of G(e)) if (j(t(r, n++))) return !1;
|
|
282
314
|
return !0;
|
|
283
315
|
}
|
|
284
|
-
|
|
285
|
-
|
|
316
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
317
|
+
function ft(e, t) {
|
|
318
|
+
if (/* @__PURE__ */ W(e)) {
|
|
286
319
|
let n = b(e);
|
|
287
320
|
for (let e = 0; e < n.length; e++) if (!j(t(n[e], e))) return !0;
|
|
288
321
|
return !1;
|
|
@@ -292,13 +325,15 @@ function pt(e, t) {
|
|
|
292
325
|
for (let r of G(e)) if (!j(t(r, n++))) return !0;
|
|
293
326
|
return !1;
|
|
294
327
|
}
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
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.`);
|
|
298
332
|
return r;
|
|
299
333
|
}
|
|
300
|
-
|
|
301
|
-
|
|
334
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
335
|
+
function mt(e, t, n = "") {
|
|
336
|
+
let r = b(e).map((e) => we(e));
|
|
302
337
|
if (n === "") return r.join(t);
|
|
303
338
|
let i = r.length;
|
|
304
339
|
if (i === 0) return "";
|
|
@@ -306,63 +341,71 @@ function ht(e, t, n = "") {
|
|
|
306
341
|
let a = r.slice(0, -1).join(t), o = r[i - 1];
|
|
307
342
|
return a + n + o;
|
|
308
343
|
}
|
|
309
|
-
|
|
310
|
-
|
|
344
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
345
|
+
function ht(e, t) {
|
|
346
|
+
if (!/* @__PURE__ */ W(e)) return {};
|
|
311
347
|
let n = e, r = {};
|
|
312
348
|
for (let [e, i] of n.entries()) {
|
|
313
|
-
let n = w(t) ? t(i, e) :
|
|
314
|
-
y(r,
|
|
349
|
+
let n = w(t) ? t(i, e) : f(i, t);
|
|
350
|
+
y(r, ye(n) ? n : z(n), i);
|
|
315
351
|
}
|
|
316
352
|
return r;
|
|
317
353
|
}
|
|
318
|
-
|
|
354
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
355
|
+
function gt(e, t) {
|
|
319
356
|
let n = b(e), r = {};
|
|
320
357
|
for (let e = 0; e < n.length; e++) r[t + e] = n[e];
|
|
321
358
|
return r;
|
|
322
359
|
}
|
|
323
|
-
|
|
324
|
-
|
|
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));
|
|
325
363
|
return n.filter((e, t) => i.has(String(t)));
|
|
326
364
|
}
|
|
327
|
-
|
|
365
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
366
|
+
function vt(e, t, n = !1) {
|
|
328
367
|
let r = x(t) ? t : [t];
|
|
329
368
|
return e.filter((e) => r.some((t) => n ? e === t : L(e, t)));
|
|
330
369
|
}
|
|
331
|
-
|
|
332
|
-
|
|
370
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
371
|
+
function yt(e, t) {
|
|
372
|
+
let n = o({ ...b(e) }, t);
|
|
333
373
|
return Object.values(n);
|
|
334
374
|
}
|
|
335
|
-
|
|
336
|
-
|
|
375
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
376
|
+
function bt(e, t, n = null) {
|
|
377
|
+
if (!/* @__PURE__ */ W(e)) return [];
|
|
337
378
|
let r = I(t) ? null : t, i = e, a = O(n) || I(n) ? [] : {};
|
|
338
379
|
for (let e of i) {
|
|
339
380
|
let t;
|
|
340
|
-
if (t = w(r) ? r(e) :
|
|
381
|
+
if (t = w(r) ? r(e) : se(e, te(r)), O(n) || I(n)) {
|
|
341
382
|
a.push(t);
|
|
342
383
|
continue;
|
|
343
384
|
}
|
|
344
|
-
let i = w(n) ? n(e) :
|
|
345
|
-
y(a,
|
|
385
|
+
let i = w(n) ? n(e) : se(e, te(n));
|
|
386
|
+
y(a, Se(i, { stringables: !0 }), t);
|
|
346
387
|
}
|
|
347
388
|
return a;
|
|
348
389
|
}
|
|
349
|
-
function
|
|
350
|
-
if (
|
|
390
|
+
function xt(e, t = 1) {
|
|
391
|
+
if (!/* @__PURE__ */ W(e) || P(e)) return t === 1 ? null : [];
|
|
351
392
|
let n = e;
|
|
352
393
|
if (n.length === 0) return t === 1 ? null : [];
|
|
353
394
|
if (t === 1) return n.pop();
|
|
354
395
|
if (t < 1) return [];
|
|
355
|
-
let r = [], i =
|
|
396
|
+
let r = [], i = Ae(t, n.length);
|
|
356
397
|
for (let e = 0; e < i; e++) r.push(n.pop());
|
|
357
398
|
return r;
|
|
358
399
|
}
|
|
359
|
-
|
|
400
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
401
|
+
function St(e, t) {
|
|
360
402
|
let n = b(e), r = [];
|
|
361
403
|
for (let e = 0; e < n.length; e++) r.push(t(n[e], e));
|
|
362
404
|
return r;
|
|
363
405
|
}
|
|
364
|
-
|
|
365
|
-
|
|
406
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
407
|
+
function Ct(e, t) {
|
|
408
|
+
if (!/* @__PURE__ */ W(e)) return {};
|
|
366
409
|
let n = e, r = {};
|
|
367
410
|
for (let e = 0; e < n.length; e++) {
|
|
368
411
|
let i = t(n[e], e);
|
|
@@ -370,23 +413,26 @@ function wt(e, t) {
|
|
|
370
413
|
}
|
|
371
414
|
return r;
|
|
372
415
|
}
|
|
373
|
-
|
|
416
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
417
|
+
function wt(e, t) {
|
|
374
418
|
let n = b(e), r = [];
|
|
375
419
|
for (let e = 0; e < n.length; e++) {
|
|
376
|
-
let i = n[e], a = K(i), o = x(a) ? a : l(
|
|
420
|
+
let i = n[e], a = K(i), o = x(a) ? a : c(l(a));
|
|
377
421
|
r.push(t(...o, e));
|
|
378
422
|
}
|
|
379
423
|
return r;
|
|
380
424
|
}
|
|
381
|
-
|
|
425
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
426
|
+
function Tt(e, t, ...n) {
|
|
382
427
|
let r = b(e);
|
|
383
428
|
if (n.length === 0) return [t, ...r];
|
|
384
|
-
let
|
|
385
|
-
return z(n[0]) === 0 ? Object.values(
|
|
429
|
+
let a = i({ ...Array.from(r) }, t, ...n);
|
|
430
|
+
return z(n[0]) === 0 ? Object.values(a) : a;
|
|
386
431
|
}
|
|
387
|
-
|
|
432
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
433
|
+
function Et(e, t, n = null) {
|
|
388
434
|
let r = () => w(n) ? n() : n;
|
|
389
|
-
if (
|
|
435
|
+
if (!/* @__PURE__ */ W(e)) return {
|
|
390
436
|
value: r(),
|
|
391
437
|
data: []
|
|
392
438
|
};
|
|
@@ -397,7 +443,7 @@ function Dt(e, t, n = null) {
|
|
|
397
443
|
data: t
|
|
398
444
|
};
|
|
399
445
|
}
|
|
400
|
-
let i = he(e), { found: a, value: o } =
|
|
446
|
+
let i = he(e), { found: a, value: o } = re(i, t);
|
|
401
447
|
if (C(a)) {
|
|
402
448
|
let e = i.slice();
|
|
403
449
|
return {
|
|
@@ -407,10 +453,11 @@ function Dt(e, t, n = null) {
|
|
|
407
453
|
}
|
|
408
454
|
return {
|
|
409
455
|
value: o,
|
|
410
|
-
data: q(i, t)
|
|
456
|
+
data: /* @__PURE__ */ q(i, t)
|
|
411
457
|
};
|
|
412
458
|
}
|
|
413
|
-
|
|
459
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
460
|
+
function Dt(e) {
|
|
414
461
|
if (O(e) || I(e)) return "";
|
|
415
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 = "") => {
|
|
416
463
|
let a = [];
|
|
@@ -442,15 +489,16 @@ function Ot(e) {
|
|
|
442
489
|
};
|
|
443
490
|
return r(e).join("&");
|
|
444
491
|
}
|
|
445
|
-
|
|
492
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
493
|
+
function Ot(e, t, n = !1) {
|
|
446
494
|
let r = !O(t) && !I(t);
|
|
447
495
|
if (!x(e)) return r ? [] : null;
|
|
448
496
|
let i = e, a = i.length, o = r ? t : 1;
|
|
449
|
-
if (R(o, ">", a)) throw new
|
|
497
|
+
if (R(o, ">", a)) throw new m(`You requested ${U(o)} items, but there are only ${a} items available.`);
|
|
450
498
|
if (a === 0 || r && R(o, "<=", 0)) return [];
|
|
451
|
-
let s =
|
|
499
|
+
let s = kt(o), c = [], l = Array.from({ length: a }, (e, t) => t);
|
|
452
500
|
for (let e = 0; e < s; e++) {
|
|
453
|
-
let e =
|
|
501
|
+
let e = p(0, l.length - 1);
|
|
454
502
|
c.push(l[e]), l.splice(e, 1);
|
|
455
503
|
}
|
|
456
504
|
if (c.sort((e, t) => e - t), !r) return i[c[0]];
|
|
@@ -461,50 +509,57 @@ function kt(e, t, n = !1) {
|
|
|
461
509
|
}
|
|
462
510
|
return c.map((e) => i[e]);
|
|
463
511
|
}
|
|
464
|
-
function
|
|
512
|
+
function kt(e) {
|
|
465
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`);
|
|
466
514
|
let t = Math.trunc(Number(e));
|
|
467
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)");
|
|
468
516
|
return t;
|
|
469
517
|
}
|
|
470
|
-
function
|
|
471
|
-
if (t < 0) throw new
|
|
518
|
+
function At(e, t = 1) {
|
|
519
|
+
if (t < 0) throw new m("Number of shifted items may not be less than zero.");
|
|
472
520
|
if (t === 0) return [];
|
|
473
|
-
if (
|
|
521
|
+
if (!/* @__PURE__ */ W(e) || P(e)) return t === 1 ? null : [];
|
|
474
522
|
let n = e;
|
|
475
523
|
if (n.length === 0) return t === 1 ? null : [];
|
|
476
524
|
if (t === 1) return n.shift();
|
|
477
|
-
let r = [], i =
|
|
525
|
+
let r = [], i = Ae(t, n.length);
|
|
478
526
|
for (let e = 0; e < i; e++) r.push(n.shift());
|
|
479
527
|
return r;
|
|
480
528
|
}
|
|
481
|
-
|
|
482
|
-
|
|
529
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
530
|
+
function jt(e, t, n) {
|
|
531
|
+
return le(e, t, n);
|
|
483
532
|
}
|
|
484
|
-
|
|
485
|
-
|
|
533
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
534
|
+
function Mt(e, t, ...n) {
|
|
535
|
+
return oe(x(e) ? Pe(e, t, !0) : e, t, ...n);
|
|
486
536
|
}
|
|
487
|
-
|
|
537
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
538
|
+
function Nt(e) {
|
|
488
539
|
let t = b(e).slice();
|
|
489
540
|
for (let e = t.length - 1; e > 0; e--) {
|
|
490
|
-
let n =
|
|
541
|
+
let n = p(0, e);
|
|
491
542
|
[t[e], t[n]] = [t[n], t[e]];
|
|
492
543
|
}
|
|
493
544
|
return t;
|
|
494
545
|
}
|
|
495
|
-
|
|
546
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
547
|
+
function Pt(e, t) {
|
|
496
548
|
let n = $(t);
|
|
497
|
-
return
|
|
549
|
+
return /* @__PURE__ */ Ft(b(e), (e, t) => j(n(e, t)));
|
|
498
550
|
}
|
|
499
|
-
|
|
551
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
552
|
+
function Ft(e, t) {
|
|
500
553
|
let n = b(e), r = $(t), i = n.findIndex((e, t) => j(r(e, t)));
|
|
501
554
|
return n.slice(i === -1 ? n.length : i);
|
|
502
555
|
}
|
|
556
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
503
557
|
function It(e, t, n = null) {
|
|
504
|
-
if (
|
|
505
|
-
let r = e.slice(), { start: i, end: a } =
|
|
558
|
+
if (!/* @__PURE__ */ W(e)) return [];
|
|
559
|
+
let r = e.slice(), { start: i, end: a } = Oe(r.length, t, n);
|
|
506
560
|
return r.slice(i, a);
|
|
507
561
|
}
|
|
562
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
508
563
|
function Lt(e, t) {
|
|
509
564
|
let n = b(e);
|
|
510
565
|
if (n.length === 0) throw new fe();
|
|
@@ -522,8 +577,8 @@ function Lt(e, t) {
|
|
|
522
577
|
return r[0];
|
|
523
578
|
}
|
|
524
579
|
function Rt(e, t, n = !1) {
|
|
525
|
-
let r = t.map((e) =>
|
|
526
|
-
return e.sort(
|
|
580
|
+
let r = t.map((e) => Me(e, n));
|
|
581
|
+
return e.sort(Ce((e, t) => {
|
|
527
582
|
for (let n of r) {
|
|
528
583
|
let r = n(e, t);
|
|
529
584
|
if (r !== 0) return r;
|
|
@@ -531,114 +586,124 @@ function Rt(e, t, n = !1) {
|
|
|
531
586
|
return 0;
|
|
532
587
|
}));
|
|
533
588
|
}
|
|
589
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
534
590
|
function zt(e, t = null) {
|
|
535
591
|
let n = b(e).slice();
|
|
536
592
|
if (x(t)) return Rt(n, t);
|
|
537
|
-
if (C(t)) return n.sort((e, t) =>
|
|
593
|
+
if (C(t)) return n.sort((e, t) => _(e, t));
|
|
538
594
|
if (F(t)) return n.sort((e, n) => {
|
|
539
|
-
let r =
|
|
540
|
-
return
|
|
595
|
+
let r = f(e, t), i = f(n, t);
|
|
596
|
+
return _(r, i);
|
|
541
597
|
});
|
|
542
598
|
if (w(t)) {
|
|
543
599
|
let e = n.map((e, n) => ({
|
|
544
600
|
value: e,
|
|
545
601
|
sortKey: t(e, n)
|
|
546
602
|
}));
|
|
547
|
-
return e.sort((e, t) =>
|
|
603
|
+
return e.sort((e, t) => _(e.sortKey, t.sortKey)), e.map((e) => e.value);
|
|
548
604
|
}
|
|
549
605
|
return n;
|
|
550
606
|
}
|
|
607
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
551
608
|
function Bt(e, t) {
|
|
552
609
|
let n = b(e).slice();
|
|
553
610
|
if (x(t)) return Rt(n, t, !0);
|
|
554
|
-
if (C(t)) return n.sort((e, t) =>
|
|
611
|
+
if (C(t)) return n.sort((e, t) => _(t, e));
|
|
555
612
|
if (F(t)) return n.sort((e, n) => {
|
|
556
|
-
let r =
|
|
557
|
-
return
|
|
613
|
+
let r = f(e, t), i = f(n, t);
|
|
614
|
+
return _(i, r);
|
|
558
615
|
});
|
|
559
616
|
if (w(t)) {
|
|
560
617
|
let e = n.map((e, n) => ({
|
|
561
618
|
value: e,
|
|
562
619
|
sortKey: t(e, n)
|
|
563
620
|
}));
|
|
564
|
-
return e.sort((e, t) =>
|
|
621
|
+
return e.sort((e, t) => _(t.sortKey, e.sortKey)), e.map((e) => e.value);
|
|
565
622
|
}
|
|
566
623
|
return n;
|
|
567
624
|
}
|
|
625
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
568
626
|
function Vt(e, t = !1) {
|
|
569
|
-
return
|
|
570
|
-
}
|
|
571
|
-
function
|
|
572
|
-
let
|
|
573
|
-
if (
|
|
574
|
-
let
|
|
575
|
-
if (
|
|
576
|
-
for (let e = 0; e <
|
|
577
|
-
let t =
|
|
578
|
-
(x(t) || N(t)) && (
|
|
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));
|
|
579
637
|
}
|
|
580
|
-
|
|
581
|
-
let
|
|
582
|
-
return
|
|
638
|
+
r.sort((e, t) => {
|
|
639
|
+
let r = _(e, t);
|
|
640
|
+
return n ? -r : r;
|
|
583
641
|
});
|
|
584
642
|
} else {
|
|
585
|
-
let e = Object.entries(
|
|
586
|
-
for (let [t,
|
|
643
|
+
let e = Object.entries(r);
|
|
644
|
+
for (let [t, i] of e) (x(i) || N(i)) && y(r, t, Y(i, n));
|
|
587
645
|
let t = {};
|
|
588
|
-
if (e.every(([e], t) => e === String(t))) return e.map(([e]) =>
|
|
589
|
-
let
|
|
590
|
-
return
|
|
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;
|
|
591
649
|
}).forEach((e, n) => {
|
|
592
650
|
y(t, String(n), e);
|
|
593
651
|
}), t;
|
|
594
|
-
let
|
|
595
|
-
let
|
|
596
|
-
return
|
|
652
|
+
let i = e.sort(([e], [t]) => {
|
|
653
|
+
let r = _(e, t);
|
|
654
|
+
return n ? -r : r;
|
|
597
655
|
});
|
|
598
|
-
for (let [e] of
|
|
599
|
-
|
|
656
|
+
for (let [e] of i) y(t, e, r[e]);
|
|
657
|
+
r = t;
|
|
600
658
|
}
|
|
601
|
-
return
|
|
659
|
+
return r;
|
|
602
660
|
}
|
|
603
|
-
|
|
604
|
-
|
|
661
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
662
|
+
function Ht(e) {
|
|
663
|
+
return Y(e, "Descending");
|
|
605
664
|
}
|
|
606
665
|
function Ut(e, t, n, ...r) {
|
|
607
|
-
if (
|
|
666
|
+
if (!/* @__PURE__ */ W(e) || P(e)) return [];
|
|
608
667
|
let i = [];
|
|
609
|
-
for (let e of r) W(e) || A(e) ? i.push(...Object.values(e)) : i.push(e);
|
|
610
|
-
let { start: a, count: o } =
|
|
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);
|
|
611
670
|
return e.splice(a, o, ...i);
|
|
612
671
|
}
|
|
613
|
-
|
|
672
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
673
|
+
function X(e, t) {
|
|
614
674
|
let n = b(e), r = $(t), i = n.findIndex((e, t) => !j(r(e, t)));
|
|
615
675
|
return n.slice(0, i === -1 ? n.length : i);
|
|
616
676
|
}
|
|
617
|
-
|
|
677
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
678
|
+
function Wt(e, t) {
|
|
618
679
|
let n = $(t);
|
|
619
|
-
return
|
|
680
|
+
return /* @__PURE__ */ X(b(e), (e, t) => j(n(e, t)));
|
|
620
681
|
}
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
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.`);
|
|
624
686
|
return r;
|
|
625
687
|
}
|
|
626
|
-
|
|
627
|
-
|
|
688
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
689
|
+
function Kt(e) {
|
|
690
|
+
if (!/* @__PURE__ */ W(e) && !A(e)) return "";
|
|
628
691
|
let t;
|
|
629
692
|
t = x(e) ? { ...e } : e;
|
|
630
693
|
let n = [];
|
|
631
|
-
for (let [e, r] of Object.entries(t)) M(e) ? n.push(
|
|
694
|
+
for (let [e, r] of Object.entries(t)) M(e) ? n.push(v(r)) : j(r) || n.push(e);
|
|
632
695
|
return n.join(" ");
|
|
633
696
|
}
|
|
634
|
-
|
|
635
|
-
|
|
697
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
698
|
+
function qt(e) {
|
|
699
|
+
if (!/* @__PURE__ */ W(e) && !A(e)) return "";
|
|
636
700
|
let t;
|
|
637
701
|
t = x(e) ? { ...e } : e;
|
|
638
702
|
let n = [];
|
|
639
|
-
for (let [e, r] of Object.entries(t)) M(e) ? n.push(
|
|
703
|
+
for (let [e, r] of Object.entries(t)) M(e) ? n.push(de(v(r), ";")) : j(r) || n.push(de(e, ";"));
|
|
640
704
|
return n.join(" ");
|
|
641
705
|
}
|
|
706
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
642
707
|
function Z(e, t) {
|
|
643
708
|
let n = b(e), r = [];
|
|
644
709
|
for (let e = 0; e < n.length; e++) {
|
|
@@ -647,35 +712,41 @@ function Z(e, t) {
|
|
|
647
712
|
}
|
|
648
713
|
return r;
|
|
649
714
|
}
|
|
650
|
-
|
|
651
|
-
|
|
715
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
716
|
+
function Jt(e, t) {
|
|
717
|
+
return /* @__PURE__ */ Z(e, (e, n) => j(t(e, n)));
|
|
652
718
|
}
|
|
653
|
-
|
|
719
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
720
|
+
function Yt(e, t) {
|
|
654
721
|
let n = b(e);
|
|
655
|
-
for (let [e, r] of Object.entries(
|
|
722
|
+
for (let [e, r] of Object.entries(h(t))) if (T(e)) {
|
|
656
723
|
for (; n.length < Number(e);) n.push(void 0);
|
|
657
724
|
n[Number(e)] = r;
|
|
658
725
|
}
|
|
659
726
|
return n;
|
|
660
727
|
}
|
|
661
|
-
|
|
662
|
-
|
|
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 = [];
|
|
663
731
|
for (let [e, t] of Object.entries(i)) {
|
|
664
|
-
for (;
|
|
665
|
-
|
|
732
|
+
for (; o.length < Number(e);) o.push(void 0);
|
|
733
|
+
o.push(t);
|
|
666
734
|
}
|
|
667
|
-
return
|
|
735
|
+
return o;
|
|
668
736
|
}
|
|
669
|
-
|
|
737
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
738
|
+
function Zt(e) {
|
|
670
739
|
return b(e).slice().reverse();
|
|
671
740
|
}
|
|
672
|
-
|
|
673
|
-
|
|
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);
|
|
674
744
|
if (o <= a) return i;
|
|
675
745
|
let s = o - a, c = Array(s).fill(n);
|
|
676
746
|
return r < 0 ? [...c, ...i] : [...i, ...c];
|
|
677
747
|
}
|
|
678
|
-
|
|
748
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
749
|
+
function $t(e, t) {
|
|
679
750
|
let n = b(e), r = [], i = [];
|
|
680
751
|
for (let e = 0; e < n.length; e++) {
|
|
681
752
|
let a = n[e];
|
|
@@ -683,18 +754,20 @@ function en(e, t) {
|
|
|
683
754
|
}
|
|
684
755
|
return [r, i];
|
|
685
756
|
}
|
|
686
|
-
|
|
687
|
-
|
|
757
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
758
|
+
function en(e) {
|
|
759
|
+
return /* @__PURE__ */ Z(e, (e) => !O(e));
|
|
688
760
|
}
|
|
689
|
-
function
|
|
690
|
-
return w(e) ? e : (r) => R(
|
|
761
|
+
function tn(e, t, n) {
|
|
762
|
+
return w(e) ? e : (r) => R(nn(r, e), t, n);
|
|
691
763
|
}
|
|
692
|
-
function
|
|
693
|
-
return O(t) || I(t) ? e :
|
|
764
|
+
function nn(e, t) {
|
|
765
|
+
return O(t) || I(t) ? e : f(e, t) ?? null;
|
|
694
766
|
}
|
|
767
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
695
768
|
function Q(e, t, ...n) {
|
|
696
769
|
let [r, i] = n;
|
|
697
|
-
if (n.length > 1 || n.length === 1 && !S(r) && !I(r)) return Q(e,
|
|
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));
|
|
698
771
|
let a = r === !0;
|
|
699
772
|
if (!x(e)) return !1;
|
|
700
773
|
if (w(t)) {
|
|
@@ -704,86 +777,102 @@ function Q(e, t, ...n) {
|
|
|
704
777
|
}
|
|
705
778
|
return a ? e.some((e) => H(e, t)) : e.some((e) => L(e, t));
|
|
706
779
|
}
|
|
707
|
-
|
|
708
|
-
|
|
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));
|
|
709
783
|
}
|
|
710
|
-
|
|
784
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
785
|
+
function an(e, t) {
|
|
711
786
|
return x(e) ? w(t) ? e.filter((e, n) => !j(t(e, n))) : e.filter((e) => !j(e)) : [];
|
|
712
787
|
}
|
|
713
|
-
|
|
788
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
789
|
+
function on(e) {
|
|
714
790
|
return O(e) ? [] : x(e) ? e : [e];
|
|
715
791
|
}
|
|
716
|
-
|
|
717
|
-
|
|
792
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
793
|
+
function sn(e) {
|
|
794
|
+
return /* @__PURE__ */ W(e) ? Array.from(e.keys()) : [];
|
|
718
795
|
}
|
|
719
|
-
|
|
720
|
-
|
|
796
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
797
|
+
function cn(e) {
|
|
798
|
+
return /* @__PURE__ */ W(e) ? Array.from(e.values()) : [];
|
|
721
799
|
}
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
800
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
801
|
+
function ln(e, t) {
|
|
802
|
+
if (!/* @__PURE__ */ W(e)) return [];
|
|
803
|
+
let n = g(t), r = Te(n), i = [];
|
|
725
804
|
for (let t of e) r(t) || i.push(t);
|
|
726
805
|
return i;
|
|
727
806
|
}
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
807
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
808
|
+
function un(e, t) {
|
|
809
|
+
if (!/* @__PURE__ */ W(e)) return [];
|
|
810
|
+
let n = h(t);
|
|
731
811
|
return b(e).filter((e, t) => !Object.hasOwn(n, t) || !V(e, n[t]));
|
|
732
812
|
}
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
813
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
814
|
+
function dn(e, t) {
|
|
815
|
+
if (!/* @__PURE__ */ W(e)) return [];
|
|
816
|
+
let n = h(t);
|
|
736
817
|
return b(e).filter((e, t) => !Object.hasOwn(n, t));
|
|
737
818
|
}
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
819
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
820
|
+
function fn(e, t, n) {
|
|
821
|
+
if (!/* @__PURE__ */ W(e)) return [];
|
|
822
|
+
let r = g(t);
|
|
741
823
|
return b(e).filter((e) => !r.some((t) => n(e, t)));
|
|
742
824
|
}
|
|
743
|
-
|
|
744
|
-
|
|
825
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
826
|
+
function pn(e, t, n) {
|
|
827
|
+
return hn(e, t, n, !0);
|
|
745
828
|
}
|
|
746
|
-
|
|
747
|
-
|
|
829
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
830
|
+
function mn(e, t, n) {
|
|
831
|
+
return hn(e, t, n, !1);
|
|
748
832
|
}
|
|
749
|
-
function
|
|
750
|
-
if (
|
|
751
|
-
let i =
|
|
833
|
+
function hn(e, t, n, r) {
|
|
834
|
+
if (!/* @__PURE__ */ W(e)) return [];
|
|
835
|
+
let i = h(t), a = Object.keys(i);
|
|
752
836
|
return b(e).filter((e, t) => {
|
|
753
837
|
let o = a.find((e) => n(t, z(e)));
|
|
754
838
|
return o === void 0 || r && !V(i[o], e);
|
|
755
839
|
});
|
|
756
840
|
}
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
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 = [];
|
|
760
845
|
if (w(n)) {
|
|
761
846
|
for (let e of r) i.some((t) => n(e, t)) && a.push(e);
|
|
762
847
|
return a;
|
|
763
848
|
}
|
|
764
|
-
let o =
|
|
849
|
+
let o = Te(i);
|
|
765
850
|
for (let e of r) o(e) && a.push(e);
|
|
766
851
|
return a;
|
|
767
852
|
}
|
|
768
|
-
|
|
769
|
-
|
|
853
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
854
|
+
function _n(e, t, n) {
|
|
855
|
+
return /* @__PURE__ */ gn(e, t, n);
|
|
770
856
|
}
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
857
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
858
|
+
function vn(e, t) {
|
|
859
|
+
if (!/* @__PURE__ */ W(e)) return [];
|
|
860
|
+
let n = h(t);
|
|
774
861
|
return b(e).filter((e, t) => Object.hasOwn(n, t) && V(e, n[t]));
|
|
775
862
|
}
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
863
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
864
|
+
function yn(e, t, n) {
|
|
865
|
+
if (!/* @__PURE__ */ W(e)) return [];
|
|
866
|
+
let r = Object.entries(h(t));
|
|
779
867
|
return b(e).filter((e, t) => r.some(([r, i]) => n(t, z(r)) && V(e, i)));
|
|
780
868
|
}
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
869
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
870
|
+
function bn(e, t) {
|
|
871
|
+
if (!/* @__PURE__ */ W(e)) return [];
|
|
872
|
+
let n = h(t);
|
|
784
873
|
return b(e).filter((e, t) => Object.hasOwn(n, t));
|
|
785
874
|
}
|
|
786
875
|
function $(e) {
|
|
787
876
|
return w(e) ? e : (t) => H(t, e);
|
|
788
877
|
}
|
|
789
|
-
export { W as accessible,
|
|
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 };
|