es-toolkit 1.46.1-dev.1801 → 1.46.1-dev.1803
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/array/cartesianProduct.d.mts +75 -0
- package/dist/array/cartesianProduct.d.ts +75 -0
- package/dist/array/cartesianProduct.js +23 -0
- package/dist/array/cartesianProduct.mjs +23 -0
- package/dist/array/combinations.d.mts +35 -0
- package/dist/array/combinations.d.ts +35 -0
- package/dist/array/combinations.js +53 -0
- package/dist/array/combinations.mjs +53 -0
- package/dist/array/index.d.mts +3 -1
- package/dist/array/index.d.ts +3 -1
- package/dist/array/index.js +4 -0
- package/dist/array/index.mjs +3 -1
- package/dist/browser.global.js +3 -3
- package/dist/index.d.mts +4 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +6 -0
- package/dist/index.mjs +4 -1
- package/dist/promise/allKeyed.d.mts +31 -0
- package/dist/promise/allKeyed.d.ts +31 -0
- package/dist/promise/allKeyed.js +37 -0
- package/dist/promise/allKeyed.mjs +37 -0
- package/dist/promise/index.d.mts +2 -1
- package/dist/promise/index.d.ts +2 -1
- package/dist/promise/index.js +2 -0
- package/dist/promise/index.mjs +2 -1
- package/package.json +1 -1
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
//#region src/array/cartesianProduct.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Computes the [Cartesian product](https://en.wikipedia.org/wiki/Cartesian_product) of the input arrays.
|
|
4
|
+
*
|
|
5
|
+
* @template T
|
|
6
|
+
* @param {readonly T[]} arr1 - The array to take the product of.
|
|
7
|
+
* @returns {Array<[T]>} An array of single-element tuples.
|
|
8
|
+
*/
|
|
9
|
+
declare function cartesianProduct<T>(arr1: readonly T[]): Array<[T]>;
|
|
10
|
+
/**
|
|
11
|
+
* Computes the [Cartesian product](https://en.wikipedia.org/wiki/Cartesian_product) of the input arrays.
|
|
12
|
+
*
|
|
13
|
+
* @template T, U
|
|
14
|
+
* @param {readonly T[]} arr1 - The first array to take the product of.
|
|
15
|
+
* @param {readonly U[]} arr2 - The second array to take the product of.
|
|
16
|
+
* @returns {Array<[T, U]>} An array of tuples representing the Cartesian product.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* cartesianProduct([1, 2], ['a', 'b']);
|
|
20
|
+
* // => [[1, 'a'], [1, 'b'], [2, 'a'], [2, 'b']]
|
|
21
|
+
*/
|
|
22
|
+
declare function cartesianProduct<T, U>(arr1: readonly T[], arr2: readonly U[]): Array<[T, U]>;
|
|
23
|
+
/**
|
|
24
|
+
* Computes the [Cartesian product](https://en.wikipedia.org/wiki/Cartesian_product) of the input arrays.
|
|
25
|
+
*
|
|
26
|
+
* @template T, U, V
|
|
27
|
+
* @param {readonly T[]} arr1 - The first array to take the product of.
|
|
28
|
+
* @param {readonly U[]} arr2 - The second array to take the product of.
|
|
29
|
+
* @param {readonly V[]} arr3 - The third array to take the product of.
|
|
30
|
+
* @returns {Array<[T, U, V]>} An array of tuples representing the Cartesian product.
|
|
31
|
+
*/
|
|
32
|
+
declare function cartesianProduct<T, U, V>(arr1: readonly T[], arr2: readonly U[], arr3: readonly V[]): Array<[T, U, V]>;
|
|
33
|
+
/**
|
|
34
|
+
* Computes the [Cartesian product](https://en.wikipedia.org/wiki/Cartesian_product) of the input arrays.
|
|
35
|
+
*
|
|
36
|
+
* @template T, U, V, W
|
|
37
|
+
* @param {readonly T[]} arr1 - The first array to take the product of.
|
|
38
|
+
* @param {readonly U[]} arr2 - The second array to take the product of.
|
|
39
|
+
* @param {readonly V[]} arr3 - The third array to take the product of.
|
|
40
|
+
* @param {readonly W[]} arr4 - The fourth array to take the product of.
|
|
41
|
+
* @returns {Array<[T, U, V, W]>} An array of tuples representing the Cartesian product.
|
|
42
|
+
*/
|
|
43
|
+
declare function cartesianProduct<T, U, V, W>(arr1: readonly T[], arr2: readonly U[], arr3: readonly V[], arr4: readonly W[]): Array<[T, U, V, W]>;
|
|
44
|
+
/**
|
|
45
|
+
* Computes the [Cartesian product](https://en.wikipedia.org/wiki/Cartesian_product) of the input arrays.
|
|
46
|
+
*
|
|
47
|
+
* Returns every possible tuple formed by picking one element from each input array, in lexicographic order.
|
|
48
|
+
* The rightmost array advances fastest, like the digits of an odometer.
|
|
49
|
+
*
|
|
50
|
+
* If no arrays are passed, the result is `[[]]` (a single empty tuple).
|
|
51
|
+
* If any input array is empty, the result is `[]`.
|
|
52
|
+
*
|
|
53
|
+
* @template T
|
|
54
|
+
* @param {Array<readonly T[]>} arrs - The arrays to take the product of.
|
|
55
|
+
* @returns {T[][]} An array of tuples representing the Cartesian product.
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* cartesianProduct([1, 2], ['a', 'b']);
|
|
59
|
+
* // => [[1, 'a'], [1, 'b'], [2, 'a'], [2, 'b']]
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* cartesianProduct([0, 1], [0, 1], [0, 1]);
|
|
63
|
+
* // => [[0,0,0], [0,0,1], [0,1,0], [0,1,1], [1,0,0], [1,0,1], [1,1,0], [1,1,1]]
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* cartesianProduct([1, 2, 3], []);
|
|
67
|
+
* // => []
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* cartesianProduct();
|
|
71
|
+
* // => [[]]
|
|
72
|
+
*/
|
|
73
|
+
declare function cartesianProduct<T>(...arrs: Array<readonly T[]>): T[][];
|
|
74
|
+
//#endregion
|
|
75
|
+
export { cartesianProduct };
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
//#region src/array/cartesianProduct.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Computes the [Cartesian product](https://en.wikipedia.org/wiki/Cartesian_product) of the input arrays.
|
|
4
|
+
*
|
|
5
|
+
* @template T
|
|
6
|
+
* @param {readonly T[]} arr1 - The array to take the product of.
|
|
7
|
+
* @returns {Array<[T]>} An array of single-element tuples.
|
|
8
|
+
*/
|
|
9
|
+
declare function cartesianProduct<T>(arr1: readonly T[]): Array<[T]>;
|
|
10
|
+
/**
|
|
11
|
+
* Computes the [Cartesian product](https://en.wikipedia.org/wiki/Cartesian_product) of the input arrays.
|
|
12
|
+
*
|
|
13
|
+
* @template T, U
|
|
14
|
+
* @param {readonly T[]} arr1 - The first array to take the product of.
|
|
15
|
+
* @param {readonly U[]} arr2 - The second array to take the product of.
|
|
16
|
+
* @returns {Array<[T, U]>} An array of tuples representing the Cartesian product.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* cartesianProduct([1, 2], ['a', 'b']);
|
|
20
|
+
* // => [[1, 'a'], [1, 'b'], [2, 'a'], [2, 'b']]
|
|
21
|
+
*/
|
|
22
|
+
declare function cartesianProduct<T, U>(arr1: readonly T[], arr2: readonly U[]): Array<[T, U]>;
|
|
23
|
+
/**
|
|
24
|
+
* Computes the [Cartesian product](https://en.wikipedia.org/wiki/Cartesian_product) of the input arrays.
|
|
25
|
+
*
|
|
26
|
+
* @template T, U, V
|
|
27
|
+
* @param {readonly T[]} arr1 - The first array to take the product of.
|
|
28
|
+
* @param {readonly U[]} arr2 - The second array to take the product of.
|
|
29
|
+
* @param {readonly V[]} arr3 - The third array to take the product of.
|
|
30
|
+
* @returns {Array<[T, U, V]>} An array of tuples representing the Cartesian product.
|
|
31
|
+
*/
|
|
32
|
+
declare function cartesianProduct<T, U, V>(arr1: readonly T[], arr2: readonly U[], arr3: readonly V[]): Array<[T, U, V]>;
|
|
33
|
+
/**
|
|
34
|
+
* Computes the [Cartesian product](https://en.wikipedia.org/wiki/Cartesian_product) of the input arrays.
|
|
35
|
+
*
|
|
36
|
+
* @template T, U, V, W
|
|
37
|
+
* @param {readonly T[]} arr1 - The first array to take the product of.
|
|
38
|
+
* @param {readonly U[]} arr2 - The second array to take the product of.
|
|
39
|
+
* @param {readonly V[]} arr3 - The third array to take the product of.
|
|
40
|
+
* @param {readonly W[]} arr4 - The fourth array to take the product of.
|
|
41
|
+
* @returns {Array<[T, U, V, W]>} An array of tuples representing the Cartesian product.
|
|
42
|
+
*/
|
|
43
|
+
declare function cartesianProduct<T, U, V, W>(arr1: readonly T[], arr2: readonly U[], arr3: readonly V[], arr4: readonly W[]): Array<[T, U, V, W]>;
|
|
44
|
+
/**
|
|
45
|
+
* Computes the [Cartesian product](https://en.wikipedia.org/wiki/Cartesian_product) of the input arrays.
|
|
46
|
+
*
|
|
47
|
+
* Returns every possible tuple formed by picking one element from each input array, in lexicographic order.
|
|
48
|
+
* The rightmost array advances fastest, like the digits of an odometer.
|
|
49
|
+
*
|
|
50
|
+
* If no arrays are passed, the result is `[[]]` (a single empty tuple).
|
|
51
|
+
* If any input array is empty, the result is `[]`.
|
|
52
|
+
*
|
|
53
|
+
* @template T
|
|
54
|
+
* @param {Array<readonly T[]>} arrs - The arrays to take the product of.
|
|
55
|
+
* @returns {T[][]} An array of tuples representing the Cartesian product.
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* cartesianProduct([1, 2], ['a', 'b']);
|
|
59
|
+
* // => [[1, 'a'], [1, 'b'], [2, 'a'], [2, 'b']]
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* cartesianProduct([0, 1], [0, 1], [0, 1]);
|
|
63
|
+
* // => [[0,0,0], [0,0,1], [0,1,0], [0,1,1], [1,0,0], [1,0,1], [1,1,0], [1,1,1]]
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* cartesianProduct([1, 2, 3], []);
|
|
67
|
+
* // => []
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* cartesianProduct();
|
|
71
|
+
* // => [[]]
|
|
72
|
+
*/
|
|
73
|
+
declare function cartesianProduct<T>(...arrs: Array<readonly T[]>): T[][];
|
|
74
|
+
//#endregion
|
|
75
|
+
export { cartesianProduct };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//#region src/array/cartesianProduct.ts
|
|
2
|
+
function cartesianProduct(...arrs) {
|
|
3
|
+
if (arrs.length === 0) return [[]];
|
|
4
|
+
let total = 1;
|
|
5
|
+
for (let i = 0; i < arrs.length; i++) total *= arrs[i].length;
|
|
6
|
+
if (total === 0) return [];
|
|
7
|
+
const n = arrs.length;
|
|
8
|
+
const result = Array(total);
|
|
9
|
+
for (let i = 0; i < total; i++) {
|
|
10
|
+
const tuple = Array(n);
|
|
11
|
+
let idx = i;
|
|
12
|
+
for (let j = n - 1; j >= 0; j--) {
|
|
13
|
+
const arr = arrs[j];
|
|
14
|
+
const len = arr.length;
|
|
15
|
+
tuple[j] = arr[idx % len];
|
|
16
|
+
idx = Math.floor(idx / len);
|
|
17
|
+
}
|
|
18
|
+
result[i] = tuple;
|
|
19
|
+
}
|
|
20
|
+
return result;
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
exports.cartesianProduct = cartesianProduct;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//#region src/array/cartesianProduct.ts
|
|
2
|
+
function cartesianProduct(...arrs) {
|
|
3
|
+
if (arrs.length === 0) return [[]];
|
|
4
|
+
let total = 1;
|
|
5
|
+
for (let i = 0; i < arrs.length; i++) total *= arrs[i].length;
|
|
6
|
+
if (total === 0) return [];
|
|
7
|
+
const n = arrs.length;
|
|
8
|
+
const result = Array(total);
|
|
9
|
+
for (let i = 0; i < total; i++) {
|
|
10
|
+
const tuple = Array(n);
|
|
11
|
+
let idx = i;
|
|
12
|
+
for (let j = n - 1; j >= 0; j--) {
|
|
13
|
+
const arr = arrs[j];
|
|
14
|
+
const len = arr.length;
|
|
15
|
+
tuple[j] = arr[idx % len];
|
|
16
|
+
idx = Math.floor(idx / len);
|
|
17
|
+
}
|
|
18
|
+
result[i] = tuple;
|
|
19
|
+
}
|
|
20
|
+
return result;
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
export { cartesianProduct };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
//#region src/array/combinations.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Returns all `r`-length combinations of elements from the input array.
|
|
4
|
+
*
|
|
5
|
+
* Combinations are emitted in lexicographic order based on the position of elements in the input array.
|
|
6
|
+
* Elements are treated as unique by position, not by value, so duplicates in the input may produce
|
|
7
|
+
* combinations that look identical.
|
|
8
|
+
*
|
|
9
|
+
* The number of combinations is `n! / r! / (n - r)!` when `0 <= r <= n`, and zero when `r > n`.
|
|
10
|
+
*
|
|
11
|
+
* @template T
|
|
12
|
+
* @param {readonly T[]} arr - The input array.
|
|
13
|
+
* @param {number} r - The length of each combination. Must be a non-negative integer.
|
|
14
|
+
* @returns {T[][]} An array of `r`-length combinations.
|
|
15
|
+
* @throws {Error} If `r` is not a non-negative integer.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* combinations(['A', 'B', 'C', 'D'], 2);
|
|
19
|
+
* // => [['A','B'], ['A','C'], ['A','D'], ['B','C'], ['B','D'], ['C','D']]
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* combinations([1, 2, 3, 4], 3);
|
|
23
|
+
* // => [[1,2,3], [1,2,4], [1,3,4], [2,3,4]]
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* combinations([1, 2, 3], 0);
|
|
27
|
+
* // => [[]]
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* combinations([1, 2], 5);
|
|
31
|
+
* // => []
|
|
32
|
+
*/
|
|
33
|
+
declare function combinations<T>(arr: readonly T[], r: number): T[][];
|
|
34
|
+
//#endregion
|
|
35
|
+
export { combinations };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
//#region src/array/combinations.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Returns all `r`-length combinations of elements from the input array.
|
|
4
|
+
*
|
|
5
|
+
* Combinations are emitted in lexicographic order based on the position of elements in the input array.
|
|
6
|
+
* Elements are treated as unique by position, not by value, so duplicates in the input may produce
|
|
7
|
+
* combinations that look identical.
|
|
8
|
+
*
|
|
9
|
+
* The number of combinations is `n! / r! / (n - r)!` when `0 <= r <= n`, and zero when `r > n`.
|
|
10
|
+
*
|
|
11
|
+
* @template T
|
|
12
|
+
* @param {readonly T[]} arr - The input array.
|
|
13
|
+
* @param {number} r - The length of each combination. Must be a non-negative integer.
|
|
14
|
+
* @returns {T[][]} An array of `r`-length combinations.
|
|
15
|
+
* @throws {Error} If `r` is not a non-negative integer.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* combinations(['A', 'B', 'C', 'D'], 2);
|
|
19
|
+
* // => [['A','B'], ['A','C'], ['A','D'], ['B','C'], ['B','D'], ['C','D']]
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* combinations([1, 2, 3, 4], 3);
|
|
23
|
+
* // => [[1,2,3], [1,2,4], [1,3,4], [2,3,4]]
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* combinations([1, 2, 3], 0);
|
|
27
|
+
* // => [[]]
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* combinations([1, 2], 5);
|
|
31
|
+
* // => []
|
|
32
|
+
*/
|
|
33
|
+
declare function combinations<T>(arr: readonly T[], r: number): T[][];
|
|
34
|
+
//#endregion
|
|
35
|
+
export { combinations };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
//#region src/array/combinations.ts
|
|
2
|
+
/**
|
|
3
|
+
* Returns all `r`-length combinations of elements from the input array.
|
|
4
|
+
*
|
|
5
|
+
* Combinations are emitted in lexicographic order based on the position of elements in the input array.
|
|
6
|
+
* Elements are treated as unique by position, not by value, so duplicates in the input may produce
|
|
7
|
+
* combinations that look identical.
|
|
8
|
+
*
|
|
9
|
+
* The number of combinations is `n! / r! / (n - r)!` when `0 <= r <= n`, and zero when `r > n`.
|
|
10
|
+
*
|
|
11
|
+
* @template T
|
|
12
|
+
* @param {readonly T[]} arr - The input array.
|
|
13
|
+
* @param {number} r - The length of each combination. Must be a non-negative integer.
|
|
14
|
+
* @returns {T[][]} An array of `r`-length combinations.
|
|
15
|
+
* @throws {Error} If `r` is not a non-negative integer.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* combinations(['A', 'B', 'C', 'D'], 2);
|
|
19
|
+
* // => [['A','B'], ['A','C'], ['A','D'], ['B','C'], ['B','D'], ['C','D']]
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* combinations([1, 2, 3, 4], 3);
|
|
23
|
+
* // => [[1,2,3], [1,2,4], [1,3,4], [2,3,4]]
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* combinations([1, 2, 3], 0);
|
|
27
|
+
* // => [[]]
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* combinations([1, 2], 5);
|
|
31
|
+
* // => []
|
|
32
|
+
*/
|
|
33
|
+
function combinations(arr, r) {
|
|
34
|
+
if (!Number.isInteger(r) || r < 0) throw new Error("r must be a non-negative integer.");
|
|
35
|
+
const n = arr.length;
|
|
36
|
+
if (r > n) return [];
|
|
37
|
+
if (r === 0) return [[]];
|
|
38
|
+
const indices = Array(r);
|
|
39
|
+
for (let i = 0; i < r; i++) indices[i] = i;
|
|
40
|
+
const result = [];
|
|
41
|
+
while (true) {
|
|
42
|
+
const tuple = Array(r);
|
|
43
|
+
for (let i = 0; i < r; i++) tuple[i] = arr[indices[i]];
|
|
44
|
+
result.push(tuple);
|
|
45
|
+
let i = r - 1;
|
|
46
|
+
while (i >= 0 && indices[i] === i + n - r) i--;
|
|
47
|
+
if (i < 0) return result;
|
|
48
|
+
indices[i]++;
|
|
49
|
+
for (let j = i + 1; j < r; j++) indices[j] = indices[j - 1] + 1;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
//#endregion
|
|
53
|
+
exports.combinations = combinations;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
//#region src/array/combinations.ts
|
|
2
|
+
/**
|
|
3
|
+
* Returns all `r`-length combinations of elements from the input array.
|
|
4
|
+
*
|
|
5
|
+
* Combinations are emitted in lexicographic order based on the position of elements in the input array.
|
|
6
|
+
* Elements are treated as unique by position, not by value, so duplicates in the input may produce
|
|
7
|
+
* combinations that look identical.
|
|
8
|
+
*
|
|
9
|
+
* The number of combinations is `n! / r! / (n - r)!` when `0 <= r <= n`, and zero when `r > n`.
|
|
10
|
+
*
|
|
11
|
+
* @template T
|
|
12
|
+
* @param {readonly T[]} arr - The input array.
|
|
13
|
+
* @param {number} r - The length of each combination. Must be a non-negative integer.
|
|
14
|
+
* @returns {T[][]} An array of `r`-length combinations.
|
|
15
|
+
* @throws {Error} If `r` is not a non-negative integer.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* combinations(['A', 'B', 'C', 'D'], 2);
|
|
19
|
+
* // => [['A','B'], ['A','C'], ['A','D'], ['B','C'], ['B','D'], ['C','D']]
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* combinations([1, 2, 3, 4], 3);
|
|
23
|
+
* // => [[1,2,3], [1,2,4], [1,3,4], [2,3,4]]
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* combinations([1, 2, 3], 0);
|
|
27
|
+
* // => [[]]
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* combinations([1, 2], 5);
|
|
31
|
+
* // => []
|
|
32
|
+
*/
|
|
33
|
+
function combinations(arr, r) {
|
|
34
|
+
if (!Number.isInteger(r) || r < 0) throw new Error("r must be a non-negative integer.");
|
|
35
|
+
const n = arr.length;
|
|
36
|
+
if (r > n) return [];
|
|
37
|
+
if (r === 0) return [[]];
|
|
38
|
+
const indices = Array(r);
|
|
39
|
+
for (let i = 0; i < r; i++) indices[i] = i;
|
|
40
|
+
const result = [];
|
|
41
|
+
while (true) {
|
|
42
|
+
const tuple = Array(r);
|
|
43
|
+
for (let i = 0; i < r; i++) tuple[i] = arr[indices[i]];
|
|
44
|
+
result.push(tuple);
|
|
45
|
+
let i = r - 1;
|
|
46
|
+
while (i >= 0 && indices[i] === i + n - r) i--;
|
|
47
|
+
if (i < 0) return result;
|
|
48
|
+
indices[i]++;
|
|
49
|
+
for (let j = i + 1; j < r; j++) indices[j] = indices[j - 1] + 1;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
//#endregion
|
|
53
|
+
export { combinations };
|
package/dist/array/index.d.mts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { at } from "./at.mjs";
|
|
2
|
+
import { cartesianProduct } from "./cartesianProduct.mjs";
|
|
2
3
|
import { chunk } from "./chunk.mjs";
|
|
4
|
+
import { combinations } from "./combinations.mjs";
|
|
3
5
|
import { compact } from "./compact.mjs";
|
|
4
6
|
import { countBy } from "./countBy.mjs";
|
|
5
7
|
import { difference } from "./difference.mjs";
|
|
@@ -64,4 +66,4 @@ import { xorWith } from "./xorWith.mjs";
|
|
|
64
66
|
import { zip } from "./zip.mjs";
|
|
65
67
|
import { zipObject } from "./zipObject.mjs";
|
|
66
68
|
import { zipWith } from "./zipWith.mjs";
|
|
67
|
-
export { at, chunk, compact, countBy, difference, differenceBy, differenceWith, drop, dropRight, dropRightWhile, dropWhile, fill, filterAsync, flatMap, flatMapAsync, flatMapDeep, flatten, flattenDeep, forEachAsync, forEachRight, groupBy, head, initial, intersection, intersectionBy, intersectionWith, isSubset, isSubsetWith, keyBy, last, limitAsync, mapAsync, maxBy, minBy, orderBy, partition, pull, pullAt, reduceAsync, remove, sample, sampleSize, shuffle, sortBy, tail, take, takeRight, takeRightWhile, takeWhile, toFilled, union, unionBy, unionWith, uniq, uniqBy, uniqWith, unzip, unzipWith, windowed, without, xor, xorBy, xorWith, zip, zipObject, zipWith };
|
|
69
|
+
export { at, cartesianProduct, chunk, combinations, compact, countBy, difference, differenceBy, differenceWith, drop, dropRight, dropRightWhile, dropWhile, fill, filterAsync, flatMap, flatMapAsync, flatMapDeep, flatten, flattenDeep, forEachAsync, forEachRight, groupBy, head, initial, intersection, intersectionBy, intersectionWith, isSubset, isSubsetWith, keyBy, last, limitAsync, mapAsync, maxBy, minBy, orderBy, partition, pull, pullAt, reduceAsync, remove, sample, sampleSize, shuffle, sortBy, tail, take, takeRight, takeRightWhile, takeWhile, toFilled, union, unionBy, unionWith, uniq, uniqBy, uniqWith, unzip, unzipWith, windowed, without, xor, xorBy, xorWith, zip, zipObject, zipWith };
|
package/dist/array/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { at } from "./at.js";
|
|
2
|
+
import { cartesianProduct } from "./cartesianProduct.js";
|
|
2
3
|
import { chunk } from "./chunk.js";
|
|
4
|
+
import { combinations } from "./combinations.js";
|
|
3
5
|
import { compact } from "./compact.js";
|
|
4
6
|
import { countBy } from "./countBy.js";
|
|
5
7
|
import { difference } from "./difference.js";
|
|
@@ -64,4 +66,4 @@ import { xorWith } from "./xorWith.js";
|
|
|
64
66
|
import { zip } from "./zip.js";
|
|
65
67
|
import { zipObject } from "./zipObject.js";
|
|
66
68
|
import { zipWith } from "./zipWith.js";
|
|
67
|
-
export { at, chunk, compact, countBy, difference, differenceBy, differenceWith, drop, dropRight, dropRightWhile, dropWhile, fill, filterAsync, flatMap, flatMapAsync, flatMapDeep, flatten, flattenDeep, forEachAsync, forEachRight, groupBy, head, initial, intersection, intersectionBy, intersectionWith, isSubset, isSubsetWith, keyBy, last, limitAsync, mapAsync, maxBy, minBy, orderBy, partition, pull, pullAt, reduceAsync, remove, sample, sampleSize, shuffle, sortBy, tail, take, takeRight, takeRightWhile, takeWhile, toFilled, union, unionBy, unionWith, uniq, uniqBy, uniqWith, unzip, unzipWith, windowed, without, xor, xorBy, xorWith, zip, zipObject, zipWith };
|
|
69
|
+
export { at, cartesianProduct, chunk, combinations, compact, countBy, difference, differenceBy, differenceWith, drop, dropRight, dropRightWhile, dropWhile, fill, filterAsync, flatMap, flatMapAsync, flatMapDeep, flatten, flattenDeep, forEachAsync, forEachRight, groupBy, head, initial, intersection, intersectionBy, intersectionWith, isSubset, isSubsetWith, keyBy, last, limitAsync, mapAsync, maxBy, minBy, orderBy, partition, pull, pullAt, reduceAsync, remove, sample, sampleSize, shuffle, sortBy, tail, take, takeRight, takeRightWhile, takeWhile, toFilled, union, unionBy, unionWith, uniq, uniqBy, uniqWith, unzip, unzipWith, windowed, without, xor, xorBy, xorWith, zip, zipObject, zipWith };
|
package/dist/array/index.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_at = require("./at.js");
|
|
3
|
+
const require_cartesianProduct = require("./cartesianProduct.js");
|
|
3
4
|
const require_chunk = require("./chunk.js");
|
|
5
|
+
const require_combinations = require("./combinations.js");
|
|
4
6
|
const require_compact = require("./compact.js");
|
|
5
7
|
const require_countBy = require("./countBy.js");
|
|
6
8
|
const require_difference = require("./difference.js");
|
|
@@ -66,7 +68,9 @@ const require_zip = require("./zip.js");
|
|
|
66
68
|
const require_zipObject = require("./zipObject.js");
|
|
67
69
|
const require_zipWith = require("./zipWith.js");
|
|
68
70
|
exports.at = require_at.at;
|
|
71
|
+
exports.cartesianProduct = require_cartesianProduct.cartesianProduct;
|
|
69
72
|
exports.chunk = require_chunk.chunk;
|
|
73
|
+
exports.combinations = require_combinations.combinations;
|
|
70
74
|
exports.compact = require_compact.compact;
|
|
71
75
|
exports.countBy = require_countBy.countBy;
|
|
72
76
|
exports.difference = require_difference.difference;
|
package/dist/array/index.mjs
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { at } from "./at.mjs";
|
|
2
|
+
import { cartesianProduct } from "./cartesianProduct.mjs";
|
|
2
3
|
import { chunk } from "./chunk.mjs";
|
|
4
|
+
import { combinations } from "./combinations.mjs";
|
|
3
5
|
import { compact } from "./compact.mjs";
|
|
4
6
|
import { countBy } from "./countBy.mjs";
|
|
5
7
|
import { difference } from "./difference.mjs";
|
|
@@ -64,4 +66,4 @@ import { xorWith } from "./xorWith.mjs";
|
|
|
64
66
|
import { zip } from "./zip.mjs";
|
|
65
67
|
import { zipObject } from "./zipObject.mjs";
|
|
66
68
|
import { zipWith } from "./zipWith.mjs";
|
|
67
|
-
export { at, chunk, compact, countBy, difference, differenceBy, differenceWith, drop, dropRight, dropRightWhile, dropWhile, fill, filterAsync, flatMap, flatMapAsync, flatMapDeep, flatten, flattenDeep, forEachAsync, forEachRight, groupBy, head, initial, intersection, intersectionBy, intersectionWith, isSubset, isSubsetWith, keyBy, last, limitAsync, mapAsync, maxBy, minBy, orderBy, partition, pull, pullAt, reduceAsync, remove, sample, sampleSize, shuffle, sortBy, tail, take, takeRight, takeRightWhile, takeWhile, toFilled, union, unionBy, unionWith, uniq, uniqBy, uniqWith, unzip, unzipWith, windowed, without, xor, xorBy, xorWith, zip, zipObject, zipWith };
|
|
69
|
+
export { at, cartesianProduct, chunk, combinations, compact, countBy, difference, differenceBy, differenceWith, drop, dropRight, dropRightWhile, dropWhile, fill, filterAsync, flatMap, flatMapAsync, flatMapDeep, flatten, flattenDeep, forEachAsync, forEachRight, groupBy, head, initial, intersection, intersectionBy, intersectionWith, isSubset, isSubsetWith, keyBy, last, limitAsync, mapAsync, maxBy, minBy, orderBy, partition, pull, pullAt, reduceAsync, remove, sample, sampleSize, shuffle, sortBy, tail, take, takeRight, takeRightWhile, takeWhile, toFilled, union, unionBy, unionWith, uniq, uniqBy, uniqWith, unzip, unzipWith, windowed, without, xor, xorBy, xorWith, zip, zipObject, zipWith };
|
package/dist/browser.global.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports):typeof define==`function`&&define.amd?define([`exports`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e._={}))})(this,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e,t){if(!Number.isInteger(t)||t<=0)throw Error(`Size must be an integer greater than zero.`);let n=Math.ceil(e.length/t),r=Array(n);for(let i=0;i<n;i++){let n=i*t,a=n+t;r[i]=e.slice(n,a)}return r}function n(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n];r&&t.push(r)}return t}function r(e,t){let n=new Set(t);return e.filter(e=>!n.has(e))}function i(e,t,n){let r=new Set(t.map(e=>n(e)));return e.filter(e=>!r.has(n(e)))}function a(e,t,n){return e.filter(e=>t.every(t=>!n(e,t)))}function o(e,t){return t=Math.max(t,0),e.slice(t)}function s(e,t){return t=Math.min(-t,0),t===0?e.slice():e.slice(0,t)}function c(e,t){for(let n=e.length-1;n>=0;n--)if(!t(e[n],n,e))return e.slice(0,n+1);return[]}function l(e,t){let n=e.findIndex((e,n,r)=>!t(e,n,r));return n===-1?[]:e.slice(n)}function u(e,t,n=0,r=e.length){let i=e.length,a=Math.max(n>=0?n:i+n,0),o=Math.min(r>=0?r:i+r,i);for(let n=a;n<o;n++)e[n]=t;return e}var d=class{capacity;available;deferredTasks=[];constructor(e){this.capacity=e,this.available=e}async acquire(){if(this.available>0){this.available--;return}return new Promise(e=>{this.deferredTasks.push(e)})}release(){let e=this.deferredTasks.shift();if(e!=null){e();return}this.available<this.capacity&&this.available++}};function f(e,t){let n=new d(t);return async function(...t){try{return await n.acquire(),await e.apply(this,t)}finally{n.release()}}}async function p(e,t,n){n?.concurrency!=null&&(t=f(t,n.concurrency));let r=await Promise.all(e.map(t));return e.filter((e,t)=>r[t])}function m(e,t=1){let n=[],r=Math.floor(t),i=(e,t)=>{for(let a=0;a<e.length;a++){let o=e[a];Array.isArray(o)&&t<r?i(o,t+1):n.push(o)}};return i(e,0),n}async function h(e,t,n){return n?.concurrency!=null&&(t=f(t,n.concurrency)),m(await Promise.all(e.map(t)))}async function ee(e,t,n){n?.concurrency!=null&&(t=f(t,n.concurrency)),await Promise.all(e.map(t))}function te(e,t){let n={};for(let r=0;r<e.length;r++){let i=e[r],a=t(i,r,e);Object.hasOwn(n,a)||(n[a]=[]),n[a].push(i)}return n}function ne(e){return e[0]}function re(e){return e.slice(0,-1)}function ie(e,t){let n=new Set(t);return e.filter(e=>n.has(e))}function ae(e,t,n){let r=[],i=new Set(t.map(n));for(let t=0;t<e.length;t++){let a=e[t],o=n(a);i.has(o)&&(r.push(a),i.delete(o))}return r}function oe(e,t,n){return e.filter(e=>t.some(t=>n(e,t)))}function se(e,t){return r(t,e).length===0}function ce(e,t,n){return a(t,e,n).length===0}function le(e){return e[e.length-1]}function ue(e,t,n){return n?.concurrency!=null&&(t=f(t,n.concurrency)),Promise.all(e.map(t))}function de(e,t){if(e.length===0)return;let n=e[0],r=t(n,0,e);for(let i=1;i<e.length;i++){let a=e[i],o=t(a,i,e);o>r&&(r=o,n=a)}return n}function fe(e,t){if(e.length===0)return;let n=e[0],r=t(n,0,e);for(let i=1;i<e.length;i++){let a=e[i],o=t(a,i,e);o<r&&(r=o,n=a)}return n}function pe(e,t){let n=new Set(t),r=0;for(let t=0;t<e.length;t++)if(!n.has(e[t])){if(!Object.hasOwn(e,t)){delete e[r++];continue}e[r++]=e[t]}return e.length=r,e}async function me(e,t,n){let r=0;n??(n=e[0],r=1);let i=n;for(let n=r;n<e.length;n++)i=await t(i,e[n],n,e);return i}function he(e,t){let n=e.slice(),r=[],i=0;for(let a=0;a<e.length;a++){if(t(e[a],a,n)){r.push(e[a]);continue}if(!Object.hasOwn(e,a)){delete e[i++];continue}e[i++]=e[a]}return e.length=i,r}function ge(e){return e[Math.floor(Math.random()*e.length)]}function _e(e,t){if(t??(t=e,e=0),e>=t)throw Error(`Invalid input: The maximum value must be greater than the minimum value.`);return Math.random()*(t-e)+e}function ve(e,t){return Math.floor(_e(e,t))}function ye(e,t){if(t>e.length)throw Error(`Size must be less than or equal to the length of array.`);let n=Array(t),r=new Set;for(let i=e.length-t,a=0;i<e.length;i++,a++){let t=ve(0,i+1);r.has(t)&&(t=i),r.add(t),n[a]=e[t]}return n}function be(e){let t=e.slice();for(let e=t.length-1;e>=1;e--){let n=Math.floor(Math.random()*(e+1));[t[e],t[n]]=[t[n],t[e]]}return t}function xe(e){return e.slice(1)}function g(e){return typeof e==`symbol`||e instanceof Symbol}function _(e){return g(e)?NaN:Number(e)}function v(e){return e?(e=_(e),e===1/0||e===-1/0?(e<0?-1:1)*Number.MAX_VALUE:e===e?e:0):e===0?e:0}function y(e){let t=v(e),n=t%1;return n?t-n:t}function Se(e,t,n){return t=n||t===void 0?1:y(t),e.slice(0,t)}function Ce(e,t,n){return t=n||t===void 0?1:y(t),t<=0||e.length===0?[]:e.slice(-t)}function we(e,t,n=0,r=e.length){let i=e.length,a=Math.max(n>=0?n:i+n,0),o=Math.min(r>=0?r:i+r,i),s=e.slice();for(let e=a;e<o;e++)s[e]=t;return s}function Te(e){return[...new Set(e)]}function Ee(e,t){let n=new Map;for(let r=0;r<e.length;r++){let i=e[r],a=t(i,r,e);n.has(a)||n.set(a,i)}return Array.from(n.values())}function De(e,t){let n=[];for(let r=0;r<e.length;r++){let i=e[r];n.every(e=>!t(e,i))&&n.push(i)}return n}function Oe(e){let t=0;for(let n=0;n<e.length;n++)e[n].length>t&&(t=e[n].length);let n=Array(t);for(let r=0;r<t;r++){n[r]=Array(e.length);for(let t=0;t<e.length;t++)n[r][t]=e[t][r]}return n}function ke(e,t,n=1,{partialWindows:r=!1}={}){if(t<=0||!Number.isInteger(t))throw Error(`Size must be a positive integer.`);if(n<=0||!Number.isInteger(n))throw Error(`Step must be a positive integer.`);let i=[],a=r?e.length:e.length-t+1;for(let r=0;r<a;r+=n)i.push(e.slice(r,r+t));return i}function Ae(e,...t){return r(e,t)}function je(...e){let t=0;for(let n=0;n<e.length;n++)e[n].length>t&&(t=e[n].length);let n=e.length,r=Array(t);for(let i=0;i<t;++i){let t=Array(n);for(let r=0;r<n;++r)t[r]=e[r][i];r[i]=t}return r}let Me=typeof globalThis==`object`&&globalThis||typeof window==`object`&&window||typeof self==`object`&&self||typeof global==`object`&&global||(function(){return this})()||Function(`return this`)(),Ne=Me.DOMException===void 0?Error:Me.DOMException;var Pe=class extends Ne{constructor(e=`The operation was aborted`){super(e)}},Fe=class extends Ne{constructor(e=`The operation was timed out`){super(e)}};function Ie(e,t){if(!Number.isInteger(e)||e<0)throw Error(`n must be a non-negative integer.`);let n=0;return(...r)=>{if(++n>=e)return t(...r)}}function Le(e,t){return function(...n){return e.apply(this,n.slice(0,t))}}async function Re(){}function ze(e,t,{signal:n,edges:r}={}){let i,a=null,o=r!=null&&r.includes(`leading`),s=r==null||r.includes(`trailing`),c=()=>{a!==null&&(e.apply(i,a),i=void 0,a=null)},l=()=>{s&&c(),p()},u=null,d=()=>{u!=null&&clearTimeout(u),u=setTimeout(()=>{u=null,l()},t)},f=()=>{u!==null&&(clearTimeout(u),u=null)},p=()=>{f(),i=void 0,a=null},m=()=>{c()},h=function(...e){if(n?.aborted)return;i=this,a=e;let t=u==null;d(),o&&t&&c()};return h.schedule=d,h.cancel=p,h.flush=m,n?.addEventListener(`abort`,p,{once:!0}),h}function Be(...e){return function(...t){let n=e.length?e[0].apply(this,t):t[0];for(let t=1;t<e.length;t++)n=e[t].call(this,n);return n}}function Ve(...e){return Be(...e.reverse())}function b(e){return e}function He(e){return((...t)=>!e(...t))}function Ue(){}function We(e){let t=!1,n;return function(...r){return t||(t=!0,n=e(...r)),n}}function Ge(e,...t){return Ke(e,qe,...t)}function Ke(e,t,...n){let r=function(...r){let i=0,a=n.slice().map(e=>e===t?r[i++]:e),o=r.slice(i);return e.apply(this,a.concat(o))};return e.prototype&&(r.prototype=Object.create(e.prototype)),r}let qe=Symbol(`partial.placeholder`);Ge.placeholder=qe;function Je(e,...t){return Ye(e,Xe,...t)}function Ye(e,t,...n){let r=function(...r){let i=n.filter(e=>e===t).length,a=Math.max(r.length-i,0),o=r.slice(0,a),s=a,c=n.slice().map(e=>e===t?r[s++]:e);return e.apply(this,o.concat(c))};return e.prototype&&(r.prototype=Object.create(e.prototype)),r}let Xe=Symbol(`partialRight.placeholder`);Je.placeholder=Xe;function Ze(e,t=e.length-1){return function(...n){let r=n.slice(t),i=n.slice(0,t);for(;i.length<t;)i.push(void 0);return e.apply(this,[...i,r])}}function Qe(e,{signal:t}={}){return new Promise((n,r)=>{let i=()=>{r(new Pe)},a=()=>{clearTimeout(o),i()};if(t?.aborted)return i();let o=setTimeout(()=>{t?.removeEventListener(`abort`,a),n()},e);t?.addEventListener(`abort`,a,{once:!0})})}let $e=()=>!0;async function et(e,t){let n,r,i,a;typeof t==`number`?(n=0,r=t,i=void 0,a=$e):(n=t?.delay??0,r=t?.retries??1/0,i=t?.signal,a=t?.shouldRetry??$e);let o;for(let t=0;t<=r;t++){if(i?.aborted)throw o??Error(`The retry operation was aborted due to an abort signal.`);try{return await e()}catch(e){if(o=e,!a(e,t))throw e;await Qe(typeof n==`function`?n(t):n)}}throw o}function tt(e,t,n){if(n??(n=t,t=0),t>=n)throw Error(`The maximum value must be greater than the minimum value.`);return t<=e&&e<n}function nt(e,t){let n=0;for(let r=0;r<e.length;r++)n+=t(e[r],r);return n}function rt(e,t){return nt(e,e=>t(e))/e.length}function it(e){if(e.length===0)return NaN;let t=e.slice().sort((e,t)=>e-t),n=Math.floor(t.length/2);return t.length%2==0?(t[n-1]+t[n])/2:t[n]}function at(e,t){return it(e.map(e=>t(e)))}function ot(e,t){if(Number.isNaN(Number(t)))throw Error(`Expected percentile to be a number but got "${t}".`);if(t<0)throw Error(`Expected percentile to be >= 0 but got "${t}".`);if(t>100)throw Error(`Expected percentile to be <= 100 but got "${t}".`);if(e.length===0)return NaN;let n=e.slice().sort((e,t)=>(Number.isNaN(e)?-1/0:e)-(Number.isNaN(t)?-1/0:t));return t===0?n[0]:n[Math.ceil(n.length*(t/100))-1]}function st(e,t,n=1){if(t??(t=e,e=0),!Number.isInteger(n)||n===0)throw Error(`The step value must be a non-zero integer.`);let r=Math.max(Math.ceil((t-e)/n),0),i=Array(r);for(let t=0;t<r;t++)i[t]=e+t*n;return i}function x(e){return e==null||typeof e!=`object`&&typeof e!=`function`}function ct(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function lt(e){if(x(e))return e;if(Array.isArray(e)||ct(e)||e instanceof ArrayBuffer||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer)return e.slice(0);let t=Object.getPrototypeOf(e);if(t==null)return Object.assign(Object.create(t),e);let n=t.constructor;if(e instanceof Date||e instanceof Map||e instanceof Set)return new n(e);if(e instanceof RegExp){let t=new n(e);return t.lastIndex=e.lastIndex,t}if(e instanceof DataView)return new n(e.buffer.slice(0));if(e instanceof Error){let t;return t=e instanceof AggregateError?new n(e.errors,e.message,{cause:e.cause}):new n(e.message,{cause:e.cause}),t.stack=e.stack,Object.assign(t,e),t}return typeof File<`u`&&e instanceof File?new n([e],e.name,{type:e.type,lastModified:e.lastModified}):typeof e==`object`?Object.assign(Object.create(t),e):e}function ut(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function S(e){return e==null?e===void 0?`[object Undefined]`:`[object Null]`:Object.prototype.toString.call(e)}let dt=`[object RegExp]`,ft=`[object String]`,pt=`[object Number]`,mt=`[object Boolean]`,ht=`[object Arguments]`,gt=`[object Symbol]`,_t=`[object Date]`,vt=`[object Map]`,yt=`[object Set]`,bt=`[object Array]`,xt=`[object ArrayBuffer]`,St=`[object Object]`,Ct=`[object DataView]`,wt=`[object Uint8Array]`,Tt=`[object Uint8ClampedArray]`,Et=`[object Uint16Array]`,Dt=`[object Uint32Array]`,Ot=`[object Int8Array]`,kt=`[object Int16Array]`,At=`[object Int32Array]`,jt=`[object Float32Array]`,Mt=`[object Float64Array]`;function C(e){return Me.Buffer!==void 0&&Me.Buffer.isBuffer(e)}function Nt(e,t){return w(e,void 0,e,new Map,t)}function w(e,t,n,r=new Map,i=void 0){let a=i?.(e,t,n,r);if(a!==void 0)return a;if(x(e))return e;if(r.has(e))return r.get(e);if(Array.isArray(e)){let t=Array(e.length);r.set(e,t);for(let a=0;a<e.length;a++)t[a]=w(e[a],a,n,r,i);return Object.hasOwn(e,`index`)&&(t.index=e.index),Object.hasOwn(e,`input`)&&(t.input=e.input),t}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){let t=new RegExp(e.source,e.flags);return t.lastIndex=e.lastIndex,t}if(e instanceof Map){let t=new Map;r.set(e,t);for(let[a,o]of e)t.set(a,w(o,a,n,r,i));return t}if(e instanceof Set){let t=new Set;r.set(e,t);for(let a of e)t.add(w(a,void 0,n,r,i));return t}if(C(e))return e.subarray();if(ct(e)){let t=new(Object.getPrototypeOf(e)).constructor(e.length);r.set(e,t);for(let a=0;a<e.length;a++)t[a]=w(e[a],a,n,r,i);return t}if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){let t=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return r.set(e,t),T(t,e,n,r,i),t}if(typeof File<`u`&&e instanceof File){let t=new File([e],e.name,{type:e.type});return r.set(e,t),T(t,e,n,r,i),t}if(typeof Blob<`u`&&e instanceof Blob){let t=new Blob([e],{type:e.type});return r.set(e,t),T(t,e,n,r,i),t}if(e instanceof Error){let t=structuredClone(e);return r.set(e,t),t.message=e.message,t.name=e.name,t.stack=e.stack,t.cause=e.cause,t.constructor=e.constructor,T(t,e,n,r,i),t}if(e instanceof Boolean){let t=new Boolean(e.valueOf());return r.set(e,t),T(t,e,n,r,i),t}if(e instanceof Number){let t=new Number(e.valueOf());return r.set(e,t),T(t,e,n,r,i),t}if(e instanceof String){let t=new String(e.valueOf());return r.set(e,t),T(t,e,n,r,i),t}if(typeof e==`object`&&Pt(e)){let t=Object.create(Object.getPrototypeOf(e));return r.set(e,t),T(t,e,n,r,i),t}return e}function T(e,t,n=e,r,i){let a=[...Object.keys(t),...ut(t)];for(let o=0;o<a.length;o++){let s=a[o],c=Object.getOwnPropertyDescriptor(e,s);(c==null||c.writable)&&(e[s]=w(t[s],s,n,r,i))}}function Pt(e){switch(S(e)){case ht:case bt:case xt:case Ct:case mt:case _t:case jt:case Mt:case Ot:case kt:case At:case vt:case pt:case St:case dt:case yt:case ft:case gt:case wt:case Tt:case Et:case Dt:return!0;default:return!1}}function Ft(e){return w(e,void 0,e,new Map,void 0)}function It(e,t){return Object.keys(e).find(n=>t(e[n],n,e))}function E(e){if(!e||typeof e!=`object`)return!1;let t=Object.getPrototypeOf(e);return t===null||t===Object.prototype||Object.getPrototypeOf(t)===null?Object.prototype.toString.call(e)===`[object Object]`:!1}function Lt(e,{delimiter:t=`.`}={}){return Rt(e,``,t)}function Rt(e,t,n){let r={},i=Object.keys(e);for(let a=0;a<i.length;a++){let o=i[a],s=e[o],c=t?`${t}${n}${o}`:o;if(E(s)&&Object.keys(s).length>0){Object.assign(r,Rt(s,c,n));continue}if(Array.isArray(s)&&s.length>0){Object.assign(r,Rt(s,c,n));continue}r[c]=s}return r}function zt(e){let t={},n=Object.keys(e);for(let r=0;r<n.length;r++){let i=n[r],a=e[i];t[a]=i}return t}function Bt(e,t){let n={},r=Object.keys(e);for(let i=0;i<r.length;i++){let a=r[i],o=e[a];n[t(o,a,e)]=o}return n}function Vt(e,t){let n={},r=Object.keys(e);for(let i=0;i<r.length;i++){let a=r[i],o=e[a];n[a]=t(o,a,e)}return n}function D(e){return e===`__proto__`}function O(e,t,n){let r=Object.keys(t);for(let i=0;i<r.length;i++){let a=r[i];if(D(a))continue;let o=t[a],s=e[a],c=n(s,o,a,e,t);c===void 0?Array.isArray(o)?Array.isArray(s)?e[a]=O(s,o,n):e[a]=O([],o,n):E(o)?E(s)?e[a]=O(s,o,n):e[a]=O({},o,n):(s===void 0||o!==void 0)&&(e[a]=o):e[a]=c}return e}function k(e){return Array.isArray(e)}function Ht(e){return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}let Ut=/\p{Lu}?\p{Ll}+|[0-9]+|\p{Lu}+(?!\p{Ll})|\p{Emoji_Presentation}|\p{Extended_Pictographic}|\p{L}+/gu;function A(e){return Array.from(e.match(Ut)??[])}function Wt(e){let t=A(e);if(t.length===0)return``;let[n,...r]=t;return`${n.toLowerCase()}${r.map(e=>Ht(e)).join(``)}`}function Gt(e){if(k(e))return e.map(e=>Gt(e));if(E(e)){let t={},n=Object.keys(e);for(let r=0;r<n.length;r++){let i=n[r],a=Wt(i);t[a]=Gt(e[i])}return t}return e}function Kt(e,t){return O(lt(e),t,function e(t,n){if(Array.isArray(n))return O(Array.isArray(t)?lt(t):[],n,e);if(E(n))return E(t)?O(lt(t),n,e):O({},n,e)})}function j(e){if(typeof e!=`object`||!e)return!1;if(Object.getPrototypeOf(e)===null)return!0;if(Object.prototype.toString.call(e)!==`[object Object]`){let t=e[Symbol.toStringTag];return t==null||!Object.getOwnPropertyDescriptor(e,Symbol.toStringTag)?.writable?!1:e.toString()===`[object ${t}]`}let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function qt(e){return A(e).map(e=>e.toLowerCase()).join(`_`)}function Jt(e){if(k(e))return e.map(e=>Jt(e));if(j(e)){let t={},n=Object.keys(e);for(let r=0;r<n.length;r++){let i=n[r],a=qt(i);t[a]=Jt(e[i])}return t}return e}function Yt(e){return e instanceof ArrayBuffer}function Xt(e){return typeof Blob>`u`?!1:e instanceof Blob}function Zt(){return typeof window<`u`&&window?.document!=null}function Qt(e){return e instanceof Date}function $t(e){return E(e)&&Object.keys(e).length===0}function M(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}function en(e,t,n){return tn(e,t,void 0,void 0,void 0,void 0,n)}function tn(e,t,n,r,i,a,o){let s=o(e,t,n,r,i,a);if(s!==void 0)return s;if(typeof e==typeof t)switch(typeof e){case`bigint`:case`string`:case`boolean`:case`symbol`:case`undefined`:return e===t;case`number`:return e===t||Object.is(e,t);case`function`:return e===t;case`object`:return nn(e,t,a,o)}return nn(e,t,a,o)}function nn(e,t,n,r){if(Object.is(e,t))return!0;let i=S(e),a=S(t);if(i===`[object Arguments]`&&(i=St),a===`[object Arguments]`&&(a=St),i!==a)return!1;switch(i){case ft:return e.toString()===t.toString();case pt:return M(e.valueOf(),t.valueOf());case mt:case _t:case gt:return Object.is(e.valueOf(),t.valueOf());case dt:return e.source===t.source&&e.flags===t.flags;case`[object Function]`:return e===t}n??=new Map;let o=n.get(e),s=n.get(t);if(o!=null&&s!=null)return o===t;n.set(e,t),n.set(t,e);try{switch(i){case vt:if(e.size!==t.size)return!1;for(let[i,a]of e.entries())if(!t.has(i)||!tn(a,t.get(i),i,e,t,n,r))return!1;return!0;case yt:{if(e.size!==t.size)return!1;let i=Array.from(e.values()),a=Array.from(t.values());for(let o=0;o<i.length;o++){let s=i[o],c=a.findIndex(i=>tn(s,i,void 0,e,t,n,r));if(c===-1)return!1;a.splice(c,1)}return!0}case bt:case wt:case Tt:case Et:case Dt:case`[object BigUint64Array]`:case Ot:case kt:case At:case`[object BigInt64Array]`:case jt:case Mt:if(C(e)!==C(t)||e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(!tn(e[i],t[i],i,e,t,n,r))return!1;return!0;case xt:return e.byteLength===t.byteLength?nn(new Uint8Array(e),new Uint8Array(t),n,r):!1;case Ct:return e.byteLength!==t.byteLength||e.byteOffset!==t.byteOffset?!1:nn(new Uint8Array(e),new Uint8Array(t),n,r);case`[object Error]`:return e.name===t.name&&e.message===t.message;case St:{if(!(nn(e.constructor,t.constructor,n,r)||E(e)&&E(t)))return!1;let i=[...Object.keys(e),...ut(e)],a=[...Object.keys(t),...ut(t)];if(i.length!==a.length)return!1;for(let a=0;a<i.length;a++){let o=i[a],s=e[o];if(!Object.hasOwn(t,o))return!1;let c=t[o];if(!tn(s,c,o,e,t,n,r))return!1}return!0}default:return!1}}finally{n.delete(e),n.delete(t)}}function rn(e,t){return en(e,t,Ue)}function an(e){return typeof File>`u`?!1:Xt(e)&&e instanceof File}function N(e){return typeof e==`function`}function on(e){if(typeof e!=`string`)return!1;try{return JSON.parse(e),!0}catch{return!1}}function sn(e){switch(typeof e){case`object`:return e===null||cn(e)||ln(e);case`string`:case`number`:case`boolean`:return!0;default:return!1}}function cn(e){return Array.isArray(e)?e.every(e=>sn(e)):!1}function ln(e){if(!E(e))return!1;let t=Reflect.ownKeys(e);for(let n=0;n<t.length;n++){let r=t[n],i=e[r];if(typeof r!=`string`||!sn(i))return!1}return!0}function un(e){return Number.isSafeInteger(e)&&e>=0}function dn(e){return e instanceof Map}function P(e){return e==null}function fn(){return typeof process<`u`&&process?.versions?.node!=null}function pn(e){return e!=null}function mn(e){return e===null}function hn(e){return e instanceof Promise}function gn(e){return e instanceof RegExp}function _n(e){return e instanceof Set}function vn(e){return typeof e==`symbol`}function yn(e){return e===void 0}function bn(e){return e instanceof WeakMap}function xn(e){return e instanceof WeakSet}var Sn=class{semaphore=new d(1);get isLocked(){return this.semaphore.available===0}async acquire(){return this.semaphore.acquire()}release(){this.semaphore.release()}};async function Cn(e){throw await Qe(e),new Fe}async function wn(e,t){return Promise.race([e(),Cn(t)])}function Tn(e){return A(e).map(e=>e.toUpperCase()).join(`_`)}let En=new Map([[`Æ`,`Ae`],[`Ð`,`D`],[`Ø`,`O`],[`Þ`,`Th`],[`ß`,`ss`],[`æ`,`ae`],[`ð`,`d`],[`ø`,`o`],[`þ`,`th`],[`Đ`,`D`],[`đ`,`d`],[`Ħ`,`H`],[`ħ`,`h`],[`ı`,`i`],[`IJ`,`IJ`],[`ij`,`ij`],[`ĸ`,`k`],[`Ŀ`,`L`],[`ŀ`,`l`],[`Ł`,`L`],[`ł`,`l`],[`ʼn`,`'n`],[`Ŋ`,`N`],[`ŋ`,`n`],[`Œ`,`Oe`],[`œ`,`oe`],[`Ŧ`,`T`],[`ŧ`,`t`],[`ſ`,`s`]]);function Dn(e){e=e.normalize(`NFD`);let t=``;for(let n=0;n<e.length;n++){let r=e[n];r>=`̀`&&r<=`ͯ`||r>=`︠`&&r<=`︣`||(t+=En.get(r)??r)}return t}let On={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`};function kn(e){return e.replace(/[&<>"']/g,e=>On[e])}function An(e){return e.replace(/[\\^$.*+?()[\]{}|]/g,`\\$&`)}function jn(e){return A(e).map(e=>e.toLowerCase()).join(`-`)}function Mn(e){return A(e).map(e=>e.toLowerCase()).join(` `)}function Nn(e){return e.substring(0,1).toLowerCase()+e.substring(1)}function Pn(e,t,n=` `){return e.padStart(Math.floor((t-e.length)/2)+e.length,n).padEnd(t,n)}function Fn(e){return A(e).map(e=>Ht(e)).join(``)}function In(e){return[...e].reverse().join(``)}function Ln(e,t){if(t===void 0)return e.trimEnd();let n=e.length;switch(typeof t){case`string`:if(t.length!==1)throw Error(`The 'chars' parameter should be a single character string.`);for(;n>0&&e[n-1]===t;)n--;break;case`object`:for(;n>0&&t.includes(e[n-1]);)n--}return e.substring(0,n)}function Rn(e,t){if(t===void 0)return e.trimStart();let n=0;switch(typeof t){case`string`:for(;n<e.length&&e[n]===t;)n++;break;case`object`:for(;n<e.length&&t.includes(e[n]);)n++}return e.substring(n)}function zn(e,t){return t===void 0?e.trim():Rn(Ln(e,t),t)}let Bn={"&":`&`,"<":`<`,">":`>`,""":`"`,"'":`'`};function Vn(e){return e.replace(/&(?:amp|lt|gt|quot|#(0+)?39);/g,e=>Bn[e]||`'`)}function Hn(e){let t=A(e),n=``;for(let e=0;e<t.length;e++)n+=t[e].toUpperCase(),e<t.length-1&&(n+=` `);return n}function Un(e){return e.substring(0,1).toUpperCase()+e.substring(1)}async function Wn(e){try{return[null,await e()]}catch(e){return[e,null]}}function Gn(e,t){if(!e)throw typeof t==`string`?Error(t):t}function Kn(e){return arguments.length===0?[]:Array.isArray(e)?e:[e]}function F(e){return Array.isArray(e)?e:Array.from(e)}function I(e){return e!=null&&typeof e!=`function`&&un(e.length)}function qn(e,n=1){return n=Math.max(Math.floor(n),0),n===0||!I(e)?[]:t(F(e),n)}function Jn(e){return I(e)?n(Array.from(e)):[]}function Yn(...e){return m(e)}function Xn(e){switch(typeof e){case`number`:case`symbol`:return!1;case`string`:return e.includes(`.`)||e.includes(`[`)||e.includes(`]`)}}function L(e){return typeof e==`string`||typeof e==`symbol`?e:Object.is(e?.valueOf?.(),-0)?`-0`:String(e)}function R(e){if(e==null)return``;if(typeof e==`string`)return e;if(Array.isArray(e))return e.map(R).join(`,`);let t=String(e);return t===`0`&&Object.is(Number(e),-0)?`-0`:t}function z(e){if(Array.isArray(e))return e.map(L);if(typeof e==`symbol`)return[e];e=R(e);let t=[],n=e.length;if(n===0)return t;let r=0,i=``,a=``,o=!1;for(e.charCodeAt(0)===46&&(t.push(``),r++);r<n;){let s=e[r];a?s===`\\`&&r+1<n?(r++,i+=e[r]):s===a?a=``:i+=s:o?s===`"`||s===`'`?a=s:s===`]`?(o=!1,t.push(i),i=``):i+=s:s===`[`?(o=!0,i&&=(t.push(i),``)):s===`.`?i&&=(t.push(i),``):i+=s,r++}return i&&t.push(i),t}function B(e,t,n){if(e==null)return n;switch(typeof t){case`string`:{if(D(t))return n;let r=e[t];return r===void 0?Xn(t)?B(e,z(t),n):n:r}case`number`:case`symbol`:{typeof t==`number`&&(t=L(t));let r=e[t];return r===void 0?n:r}default:{if(Array.isArray(t))return Zn(e,t,n);if(t=Object.is(t?.valueOf(),-0)?`-0`:String(t),D(t))return n;let r=e[t];return r===void 0?n:r}}}function Zn(e,t,n){if(t.length===0)return n;let r=e;for(let e=0;e<t.length;e++){if(r==null||D(t[e]))return n;r=r[t[e]]}return r===void 0?n:r}function V(e){return function(t){return B(t,e)}}function H(e){return e!==null&&(typeof e==`object`||typeof e==`function`)}function Qn(e,t,n){return typeof n==`function`?$n(e,t,function e(t,r,i,a,o,s){let c=n(t,r,i,a,o,s);return c===void 0?$n(t,r,e,s):!!c},new Map):Qn(e,t,()=>void 0)}function $n(e,t,n,r){if(t===e)return!0;switch(typeof t){case`object`:return er(e,t,n,r);case`function`:return Object.keys(t).length>0?$n(e,{...t},n,r):M(e,t);default:return H(e)?typeof t==`string`?t===``:!0:M(e,t)}}function er(e,t,n,r){if(t==null)return!0;if(Array.isArray(t))return nr(e,t,n,r);if(t instanceof Map)return tr(e,t,n,r);if(t instanceof Set)return rr(e,t,n,r);let i=Object.keys(t);if(e==null||x(e))return i.length===0;if(i.length===0)return!0;if(r?.has(t))return r.get(t)===e;r?.set(t,e);try{for(let a=0;a<i.length;a++){let o=i[a];if(!x(e)&&!(o in e)||t[o]===void 0&&e[o]!==void 0||t[o]===null&&e[o]!==null||!n(e[o],t[o],o,e,t,r))return!1}return!0}finally{r?.delete(t)}}function tr(e,t,n,r){if(t.size===0)return!0;if(!(e instanceof Map))return!1;for(let[i,a]of t.entries())if(n(e.get(i),a,i,e,t,r)===!1)return!1;return!0}function nr(e,t,n,r){if(t.length===0)return!0;if(!Array.isArray(e))return!1;let i=new Set;for(let a=0;a<t.length;a++){let o=t[a],s=!1;for(let c=0;c<e.length;c++){if(i.has(c))continue;let l=e[c],u=!1;if(n(l,o,a,e,t,r)&&(u=!0),u){i.add(c),s=!0;break}}if(!s)return!1}return!0}function rr(e,t,n,r){return t.size===0?!0:e instanceof Set?nr([...e],[...t],n,r):!1}function ir(e,t){return Qn(e,t,()=>void 0)}function U(e){return e=Ft(e),t=>ir(t,e)}function ar(e,t){return Nt(e,(n,r,i,a)=>{let o=t?.(n,r,i,a);if(o!==void 0)return o;if(typeof e==`object`){if(S(e)===`[object Object]`&&typeof e.constructor!=`function`){let t={};return a.set(e,t),T(t,e,i,a),t}switch(Object.prototype.toString.call(e)){case pt:case ft:case mt:{let t=new e.constructor(e?.valueOf());return T(t,e),t}case ht:{let t={};return T(t,e),t.length=e.length,t[Symbol.iterator]=e[Symbol.iterator],t}default:return}}})}function or(e){return ar(e)}let sr=/^(?:0|[1-9]\d*)$/;function cr(e,t=2**53-1){switch(typeof e){case`number`:return Number.isInteger(e)&&e>=0&&e<t;case`symbol`:return!1;case`string`:return sr.test(e)}}function lr(e){return typeof e==`object`&&!!e&&S(e)===`[object Arguments]`}function ur(e,t){let n;if(n=Array.isArray(t)?t:typeof t==`string`&&Xn(t)&&e?.[t]==null?z(t):[t],n.length===0)return!1;let r=e;for(let e=0;e<n.length;e++){let t=n[e];if((r==null||!Object.hasOwn(r,t))&&!((Array.isArray(r)||lr(r))&&cr(t)&&t<r.length))return!1;r=r[t]}return!0}function W(e,t){switch(typeof e){case`object`:Object.is(e?.valueOf(),-0)&&(e=`-0`);break;case`number`:e=L(e);break}return t=or(t),function(n){let r=B(n,e);return r===void 0?ur(n,e):t===void 0?r===void 0:ir(r,t)}}function G(e){if(e==null)return b;switch(typeof e){case`function`:return e;case`object`:return Array.isArray(e)&&e.length===2?W(e[0],e[1]):U(e);case`string`:case`symbol`:case`number`:return V(e)}}function dr(e,t){if(e==null)return{};let n=I(e)?Array.from(e):Object.values(e),r=G(t??void 0),i=Object.create(null);for(let e=0;e<n.length;e++){let t=n[e],a=r(t);i[a]=(i[a]??0)+1}return i}function K(e){return typeof e==`object`&&!!e}function q(e){return K(e)&&I(e)}function fr(e,...t){if(!q(e))return[];let n=F(e),i=[];for(let e=0;e<t.length;e++){let n=t[e];q(n)&&i.push(...Array.from(n))}return r(n,i)}function J(e){if(I(e))return le(F(e))}function pr(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n];if(q(r))for(let e=0;e<r.length;e++)t.push(r[e])}return t}function mr(e,...t){if(!q(e))return[];let n=J(t),a=pr(t);return q(n)?r(Array.from(e),a):i(Array.from(e),a,G(n))}function hr(e,...t){if(!q(e))return[];let n=J(t),i=pr(t);return typeof n==`function`?a(Array.from(e),i,n):r(Array.from(e),i)}function gr(e,t=1,n){return I(e)?(t=n?1:y(t),o(F(e),t)):[]}function _r(e,t=1,n){return I(e)?(t=n?1:y(t),s(F(e),t)):[]}function vr(e,t=b){return I(e)?yr(Array.from(e),t):[]}function yr(e,t){switch(typeof t){case`function`:return c(e,(e,n,r)=>!!t(e,n,r));case`object`:if(Array.isArray(t)&&t.length===2){let n=t[0],r=t[1];return c(e,W(n,r))}else return c(e,U(t));case`symbol`:case`number`:case`string`:return c(e,V(t))}}function br(e,t=b){return I(e)?xr(F(e),t):[]}function xr(e,t){switch(typeof t){case`function`:return l(e,(e,n,r)=>!!t(e,n,r));case`object`:if(Array.isArray(t)&&t.length===2){let n=t[0],r=t[1];return l(e,W(n,r))}else return l(e,U(t));case`number`:case`symbol`:case`string`:return l(e,V(t))}}function Sr(e,t=b){if(!e)return e;let n=I(e)||Array.isArray(e)?st(0,e.length):Object.keys(e);for(let r=0;r<n.length;r++){let i=n[r],a=e[i];if(t(a,i,e)===!1)break}return e}function Cr(e,t=b){if(!e)return e;let n=I(e)?st(0,e.length):Object.keys(e);for(let r=n.length-1;r>=0;r--){let i=n[r],a=e[i];if(t(a,i,e)===!1)break}return e}function Y(e,t,n){return H(n)&&(typeof t==`number`&&I(n)&&cr(t)&&t<n.length||typeof t==`string`&&t in n)?M(n[t],e):!1}function wr(e,t,n){if(!e)return!0;n&&Y(e,t,n)&&(t=void 0),t||=b;let r;switch(typeof t){case`function`:r=t;break;case`object`:if(Array.isArray(t)&&t.length===2){let e=t[0],n=t[1];r=W(e,n)}else r=U(t);break;case`symbol`:case`number`:case`string`:r=V(t)}if(!I(e)){let t=Object.keys(e);for(let n=0;n<t.length;n++){let i=t[n],a=e[i];if(!r(a,i,e))return!1}return!0}for(let t=0;t<e.length;t++)if(!r(e[t],t,e))return!1;return!0}function Tr(e){return typeof e==`string`||e instanceof String}function Er(e,t,n=0,r=e?e.length:0){return I(e)?Tr(e)?e:(n=Math.floor(n),r=Math.floor(r),n||=0,r||=0,u(e,t,n,r)):[]}function Dr(e,t=b){if(!e)return[];if(t=G(t),!Array.isArray(e)){let n=[],r=Object.keys(e),i=I(e)?e.length:r.length;for(let a=0;a<i;a++){let i=r[a],o=e[i];t(o,i,e)&&n.push(o)}return n}let n=[],r=e.length;for(let i=0;i<r;i++){let r=e[i];t(r,i,e)&&n.push(r)}return n}function Or(e,t=b,n=0){if(!e)return;n<0&&(n=Math.max(e.length+n,0));let r=G(t);if(!Array.isArray(e)){let t=Object.keys(e);for(let i=n;i<t.length;i++){let n=t[i],a=e[n];if(r(a,n,e))return a}return}return e.slice(n).find(r)}function X(e){return e}function kr(e,t=X,n=0){if(!e)return-1;n<0&&(n=Math.max(e.length+n,0));let r=Array.from(e).slice(n),i=-1;switch(typeof t){case`function`:i=r.findIndex(t);break;case`object`:if(Array.isArray(t)&&t.length===2){let e=t[0],n=t[1];i=r.findIndex(W(e,n))}else i=r.findIndex(U(t));break;case`number`:case`symbol`:case`string`:i=r.findIndex(V(t))}return i===-1?-1:i+n}function Ar(e,t=b,n){if(!e)return;let r=Array.isArray(e)?e.length:Object.keys(e).length;n=y(n??r-1),n=n<0?Math.max(r+n,0):Math.min(n,r-1);let i=G(t);if(!Array.isArray(e)){let t=Object.keys(e);for(let r=n;r>=0;r--){let n=t[r],a=e[n];if(i(a,n,e))return a}return}return e.slice(0,n+1).findLast(i)}function jr(e,t=b,n=e?e.length-1:0){if(!e)return-1;n=n<0?Math.max(e.length+n,0):Math.min(n,e.length-1);let r=F(e).slice(0,n+1);switch(typeof t){case`function`:return r.findLastIndex(t);case`object`:if(Array.isArray(t)&&t.length===2){let e=t[0],n=t[1];return r.findLastIndex(W(e,n))}else return r.findLastIndex(U(t));case`number`:case`symbol`:case`string`:return r.findLastIndex(V(t))}}function Mr(e){if(I(e))return ne(F(e))}function Nr(e,t=1){let n=[],r=Math.floor(t);if(!I(e))return n;let i=(e,t)=>{for(let a=0;a<e.length;a++){let o=e[a];t<r&&(Array.isArray(o)||o?.[Symbol.isConcatSpreadable]||typeof o==`object`&&o&&Object.prototype.toString.call(o)===`[object Arguments]`)?i(Array.isArray(o)?o:Array.from(o),t+1):n.push(o)}};return i(Array.from(e),0),n}function Pr(e,t=1){return Nr(e,t)}function Fr(e,t){if(!e)return[];let n=I(e)||Array.isArray(e)?st(0,e.length):Object.keys(e),r=G(t??b),i=Array(n.length);for(let t=0;t<n.length;t++){let a=n[t],o=e[a];i[t]=r(o,a,e)}return i}function Ir(e,t){return P(e)?[]:Pr(P(t)?Fr(e):Fr(e,t),1)}function Lr(e,t=b,n=1){return e==null?[]:Nr(Fr(e,G(t)),n)}function Rr(e,t){return Lr(e,t,1/0)}function zr(e){return Pr(e,1/0)}function Br(e,t){return e==null?{}:te(I(e)?Array.from(e):Object.values(e),G(t??b))}function Vr(e,t,n,r){if(e==null)return!1;if(n=r||!n?0:y(n),Tr(e))return n>e.length||t instanceof RegExp?!1:(n<0&&(n=Math.max(0,e.length+n)),e.includes(t,n));if(Array.isArray(e))return e.includes(t,n);let i=Object.keys(e);n<0&&(n=Math.max(0,i.length+n));for(let r=n;r<i.length;r++)if(M(Reflect.get(e,i[r]),t))return!0;return!1}function Hr(e,t,n){if(!I(e))return-1;if(Number.isNaN(t)){n??=0,n<0&&(n=Math.max(0,e.length+n));for(let t=n;t<e.length;t++)if(Number.isNaN(e[t]))return t;return-1}return Array.from(e).indexOf(t,n)}function Ur(e){return I(e)?re(Array.from(e)):[]}function Wr(...e){if(e.length===0||!q(e[0]))return[];let t=Te(Array.from(e[0]));for(let n=1;n<e.length;n++){let r=e[n];if(!q(r))return[];t=ie(t,Array.from(r))}return t}function Gr(e,...t){if(!q(e))return[];let n=le(t);if(n===void 0)return Array.from(e);let r=Te(Array.from(e)),i=q(n)?t.length:t.length-1;for(let e=0;e<i;++e){let i=t[e];if(!q(i))return[];q(n)?r=ae(r,Array.from(i),b):typeof n==`function`?r=ae(r,Array.from(i),e=>n(e)):typeof n==`string`&&(r=ae(r,Array.from(i),V(n)))}return r}function Kr(e){return I(e)?Te(Array.from(e)):[]}function qr(e,...t){if(e==null)return[];let n=J(t),r=M,i=Kr;typeof n==`function`&&(r=n,i=Jr,t.pop());let a=i(Array.from(e));for(let e=0;e<t.length;++e){let n=t[e];if(n==null)return[];a=oe(a,Array.from(n),r)}return a}function Jr(e){let t=[],n=new Set;for(let r=0;r<e.length;r++){let i=e[r];n.has(i)||(t.push(i),n.add(i))}return t}function Yr(e,t,...n){if(P(e))return[];let r=I(e)?Array.from(e):Object.values(e),i=[];for(let e=0;e<r.length;e++){let a=r[e];if(N(t)){i.push(t.apply(a,n));continue}let o=B(a,t),s=a;if(Array.isArray(t)){let e=t.slice(0,-1);e.length>0&&(s=B(a,e))}else typeof t==`string`&&t.includes(`.`)&&(s=B(a,t.split(`.`).slice(0,-1).join(`.`)));i.push(o?.apply(s,n))}return i}function Xr(e,t){return I(e)?Array.from(e).join(t):``}function Zr(e,t=b,n){if(!e)return n;let r,i=0;I(e)?(r=st(0,e.length),n==null&&e.length>0&&(n=e[0],i+=1)):(r=Object.keys(e),n??(n=e[r[0]],i+=1));for(let a=i;a<r.length;a++){let i=r[a],o=e[i];n=t(n,o,i,e)}return n}function Qr(e,t){if(!I(e)&&!K(e))return{};let n=G(t??b);return Zr(e,(e,t)=>{let r=n(t);return e[r]=t,e},{})}function $r(e,t,n){if(!I(e)||e.length===0)return-1;let r=e.length,i=n??r-1;if(n!=null&&(i=i<0?Math.max(r+i,0):Math.min(i,r-1)),Number.isNaN(t)){for(let t=i;t>=0;t--)if(Number.isNaN(e[t]))return t}return Array.from(e).lastIndexOf(t,i)}function ei(e,t=0){if(!(!q(e)||e.length===0))return t=y(t),t<0&&(t+=e.length),e[t]}function ti(e){return typeof e==`symbol`?1:e===null?2:e===void 0?3:e===e?0:4}let ni=(e,t,n)=>{if(e!==t){let r=ti(e),i=ti(t);if(r===i&&r===0){if(e<t)return n===`desc`?1:-1;if(e>t)return n===`desc`?-1:1}return n===`desc`?i-r:r-i}return 0},ri=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ii=/^\w*$/;function ai(e,t){return Array.isArray(e)?!1:typeof e==`number`||typeof e==`boolean`||e==null||g(e)?!0:typeof e==`string`&&(ii.test(e)||!ri.test(e))||t!=null&&Object.hasOwn(t,e)}function oi(e,t,n,r){if(e==null)return[];n=r?void 0:n,Array.isArray(e)||(e=Object.values(e)),Array.isArray(t)||(t=t==null?[null]:[t]),t.length===0&&(t=[null]),Array.isArray(n)||(n=n==null?[]:[n]),n=n.map(e=>String(e));let i=(e,t)=>{let n=e;for(let e=0;e<t.length&&n!=null;++e)n=n[t[e]];return n},a=(e,t)=>t==null||e==null?t:typeof e==`object`&&`key`in e?Object.hasOwn(t,e.key)?t[e.key]:i(t,e.path):typeof e==`function`?e(t):Array.isArray(e)?i(t,e):typeof t==`object`?t[e]:t,o=t.map(e=>(Array.isArray(e)&&e.length===1&&(e=e[0]),e==null||typeof e==`function`||Array.isArray(e)||ai(e)?e:{key:e,path:z(e)}));return e.map(e=>({original:e,criteria:o.map(t=>a(t,e))})).slice().sort((e,t)=>{for(let r=0;r<o.length;r++){let i=ni(e.criteria[r],t.criteria[r],n[r]);if(i!==0)return i}return 0}).map(e=>e.original)}function si(e,t=b){if(!e)return[[],[]];let n=I(e)?e:Object.values(e);t=G(t);let r=[],i=[];for(let e=0;e<n.length;e++){let a=n[e];t(a)?r.push(a):i.push(a)}return[r,i]}function ci(e,...t){return pe(e,t)}function li(e,t=[]){return pe(e,Array.from(t))}function ui(e,t,n){let r=G(n),i=new Set(Array.from(t).map(e=>r(e))),a=0;for(let t=0;t<e.length;t++){let n=r(e[t]);if(!i.has(n)){if(!Object.hasOwn(e,t)){delete e[a++];continue}e[a++]=e[t]}}return e.length=a,e}function di(e,t){let n=e.length;t??=Array(n);for(let r=0;r<n;r++)t[r]=e[r];return t}function fi(e,t,n){if(e?.length==null||t?.length==null)return e;e===t&&(t=di(t));let r=0;n??=(e,t)=>M(e,t);let i=Array.isArray(t)?t:Array.from(t),a=i.includes(void 0);for(let t=0;t<e.length;t++){if(t in e){i.some(r=>n(e[t],r))||(e[r++]=e[t]);continue}a||delete e[r++]}return e.length=r,e}function pi(e,...t){if(t.length===0)return[];let n=[];for(let e=0;e<t.length;e++){let r=t[e];if(!I(r)||Tr(r)){n.push(r);continue}for(let e=0;e<r.length;e++)n.push(r[e])}let r=[];for(let t=0;t<n.length;t++)r.push(B(e,n[t]));return r}function mi(e,t){if(e==null)return!0;switch(typeof t){case`symbol`:case`number`:case`object`:if(Array.isArray(t))return hi(e,t);if(typeof t==`number`?t=L(t):typeof t==`object`&&(t=Object.is(t?.valueOf(),-0)?`-0`:String(t)),D(t))return!1;if(e?.[t]===void 0)return!0;try{return delete e[t],!0}catch{return!1}case`string`:if(e?.[t]===void 0&&Xn(t))return hi(e,z(t));if(D(t))return!1;try{return delete e[t],!0}catch{return!1}}}function hi(e,t){let n=t.length===1?e:B(e,t.slice(0,-1)),r=t[t.length-1];if(n?.[r]===void 0)return!0;if(D(r))return!1;try{return delete n[r],!0}catch{return!1}}function gi(e,...t){let n=Pr(t,1);if(!e)return Array(n.length);let r=pi(e,n),i=n.map(t=>cr(t,e.length)?Number(t):t).sort((e,t)=>t-e);for(let t of new Set(i)){if(cr(t,e.length)){Array.prototype.splice.call(e,t,1);continue}if(ai(t,e)){delete e[L(t)];continue}mi(e,k(t)?t:z(t))}return r}function _i(e,t=b,n){if(!e)return n;let r,i;I(e)?(r=st(0,e.length).reverse(),n==null&&e.length>0?(n=e[e.length-1],i=1):i=0):(r=Object.keys(e).reverse(),n==null?(n=e[r[0]],i=1):i=0);for(let a=i;a<r.length;a++){let i=r[a],o=e[i];n=t(n,o,i,e)}return n}function vi(e){if(typeof e!=`function`)throw TypeError(`Expected a function`);return function(...t){return!e.apply(this,t)}}function yi(e,t=b){return Dr(e,vi(G(t)))}function bi(e,t=b){return he(e,G(t))}function xi(e){return e==null?e:e.reverse()}function Si(e){if(e!=null)return I(e)?ge(F(e)):ge(Object.values(e))}function Ci(e,t,n){return n===void 0&&(n=t,t=void 0),n!==void 0&&(n=_(n),e=Math.min(e,Number.isNaN(n)?0:n)),t!==void 0&&(t=_(t),e=Math.max(e,Number.isNaN(t)?0:t)),e}function wi(e){return dn(e)}function Ti(e){return e==null?[]:I(e)||wi(e)?Array.from(e):typeof e==`object`?Object.values(e):[]}function Ei(e,t,n){let r=Ti(e);return t=(n?Y(e,t,n):t===void 0)?1:Ci(y(t),0,r.length),ye(r,t)}function Di(e){return e==null?[]:Object.values(e)}function Oi(e){return e==null}function ki(e){return Oi(e)?[]:k(e)?be(e):I(e)?be(Array.from(e)):K(e)?be(Di(e)):[]}function Ai(e){return P(e)?0:e instanceof Map||e instanceof Set?e.size:Object.keys(e).length}function ji(e,t,n){if(!I(e))return[];let r=e.length;n===void 0?n=r:typeof n!=`number`&&Y(e,t,n)&&(t=0,n=r),t=y(t),n=y(n),t=t<0?Math.max(r+t,0):Math.min(t,r),n=n<0?Math.max(r+n,0):Math.min(n,r);let i=Math.max(n-t,0),a=Array(i);for(let n=0;n<i;++n)a[n]=e[t+n];return a}function Mi(e,t,n){if(!e)return!1;n!=null&&(t=void 0),t??=b;let r=Array.isArray(e)?e:Object.values(e);switch(typeof t){case`function`:if(!Array.isArray(e)){let n=Object.keys(e);for(let r=0;r<n.length;r++){let i=n[r],a=e[i];if(t(a,i,e))return!0}return!1}for(let n=0;n<e.length;n++)if(t(e[n],n,e))return!0;return!1;case`object`:if(Array.isArray(t)&&t.length===2){let n=t[0],i=t[1],a=W(n,i);if(Array.isArray(e)){for(let t=0;t<e.length;t++)if(a(e[t]))return!0;return!1}return r.some(a)}else{let n=U(t);if(Array.isArray(e)){for(let t=0;t<e.length;t++)if(n(e[t]))return!0;return!1}return r.some(n)}case`number`:case`symbol`:case`string`:{let n=V(t);if(Array.isArray(e)){for(let t=0;t<e.length;t++)if(n(e[t]))return!0;return!1}return r.some(n)}}}function Ni(e,...t){let n=t.length;return n>1&&Y(e,t[0],t[1])?t=[]:n>2&&Y(t[0],t[1],t[2])&&(t=[t[0]]),oi(e,m(t),[`asc`])}function Pi(e){return Number.isNaN(e)}function Fi(e,t,n=X,r){if(Oi(e)||e.length===0)return 0;let i=0,a=e.length,o=G(n),s=o(t),c=Pi(s),l=mn(s),u=g(s),d=yn(s);for(;i<a;){let t,n=Math.floor((i+a)/2),f=o(e[n]),p=!yn(f),m=mn(f),h=!Pi(f),ee=g(f);t=c?r||h:d?h&&(r||p):l?h&&p&&(r||!m):u?h&&p&&!m&&(r||!ee):m||ee?!1:r?f<=s:f<s,t?i=n+1:a=n}return Math.min(a,4294967294)}function Ii(e){return typeof e==`number`||e instanceof Number}function Li(e,t){if(P(e))return 0;let n=0,r=e.length;if(Ii(t)&&t===t&&r<=2147483647){for(;n<r;){let i=n+r>>>1,a=e[i];!mn(a)&&!vn(a)&&a<t?n=i+1:r=i}return r}return Fi(e,t,e=>e)}function Ri(e,t){if(!e?.length)return-1;let n=Li(e,t);return n<e.length&&M(e[n],t)?n:-1}function zi(e,t,n){return Fi(e,t,n,!0)}function Bi(e,t){if(P(e))return 0;let n=e.length;if(!Ii(t)||Number.isNaN(t)||n>2147483647)return zi(e,t,e=>e);let r=0;for(;r<n;){let i=r+n>>>1,a=e[i];!mn(a)&&!vn(a)&&a<=t?r=i+1:n=i}return n}function Vi(e,t){if(!e?.length)return-1;let n=Bi(e,t)-1;return n>=0&&M(e[n],t)?n:-1}function Hi(e){return I(e)?xe(F(e)):[]}function Ui(e,t=1,n){return t=n?1:y(t),t<1||!I(e)?[]:Se(F(e),t)}function Wi(e,t=1,n){return t=n?1:y(t),t<=0||!I(e)?[]:Ce(F(e),t)}function Gi(e,t){if(!q(e))return[];let n=F(e),r=n.findLastIndex(He(G(t??b)));return n.slice(r+1)}function Ki(e,t){if(!q(e))return[];let n=F(e),r=n.findIndex(vi(G(t??X)));return r===-1?n:n.slice(0,r)}function qi(...e){return Te(Lr(e.filter(q),e=>Array.from(e),1))}function Ji(...e){let t=le(e),n=pr(e);return q(t)||t==null?Te(n):Ee(n,Le(G(t),1))}function Yi(...e){let t=le(e),n=pr(e);return q(t)||t==null?Te(n):De(n,t)}function Xi(e,t=b){return q(e)?Ee(Array.from(e),Le(G(t),1)):[]}function Zi(e,t){return I(e)?typeof t==`function`?De(Array.from(e),t):Kr(Array.from(e)):[]}function Qi(e){return!q(e)||!e.length?[]:(e=k(e)?e:Array.from(e),e=e.filter(e=>q(e)),Oe(e))}function $i(e,t){if(!q(e)||!e.length)return[];let n=k(e)?Oe(e):Oe(Array.from(e,e=>Array.from(e)));if(!t)return n;let r=Array(n.length);for(let e=0;e<n.length;e++){let i=n[e];r[e]=t(...i)}return r}function ea(e,...t){return q(e)?Ae(Array.from(e),...t):[]}function ta(...e){let t=new Map;for(let n=0;n<e.length;n++){let r=e[n];if(!q(r))continue;let i=new Set(Ti(r));for(let e of i)t.has(e)?t.set(e,t.get(e)+1):t.set(e,1)}let n=[];for(let[e,r]of t)r===1&&n.push(e);return n}function na(...e){let t=J(e),n=b;!q(t)&&t!=null&&(n=G(t),e=e.slice(0,-1));let r=e.filter(q);return mr(Ji(...r,n),Ji(...ke(r,2).map(([e,t])=>Gr(e,t,n)),n),n)}function ra(...e){let t=J(e),n=(e,t)=>e===t;typeof t==`function`&&(n=t,e=e.slice(0,-1));let r=e.filter(q);return hr(Yi(...r,n),Yi(...ke(r,2).map(([e,t])=>qr(e,t,n)),n),n)}function ia(...e){return e.length?je(...e.filter(e=>q(e))):[]}let aa=(e,t,n)=>{let r=e[t];(!(Object.hasOwn(e,t)&&M(r,n))||n===void 0&&!(t in e))&&(e[t]=n)};function oa(e=[],t=[]){let n={};for(let r=0;r<e.length;r++)aa(n,e[r],t[r]);return n}function sa(e,t,n,r){if(e==null&&!H(e))return e;let i;i=ai(t,e)?[t]:Array.isArray(t)?t:z(t);let a=n(B(e,i)),o=e;for(let t=0;t<i.length&&o!=null;t++){let n=L(i[t]);if(D(n))continue;let s;if(t===i.length-1)s=a;else{let a=o[n],c=r?.(a,n,e);s=c===void 0?H(a)?a:cr(i[t+1])?[]:{}:c}aa(o,n,s),o=o[n]}return e}function ca(e,t,n){return sa(e,t,()=>n,()=>void 0)}function la(e,t){let n={};if(!I(e))return n;I(t)||(t=[]);let r=je(Array.from(e),Array.from(t));for(let e=0;e<r.length;e++){let[t,i]=r[e];t!=null&&ca(n,t,i)}return n}function ua(...e){let t=e.pop();if(N(t)||(e.push(t),t=void 0),!e?.length)return[];let n=Qi(e);return t==null?n:n.map(e=>t(...e))}function da(e,t){if(typeof t!=`function`)throw TypeError(`Expected a function`);return e=y(e),function(...n){if(--e<1)return t.apply(this,n)}}function fa(e,t=e.length,n){return n&&(t=e.length),(Number.isNaN(t)||t<0)&&(t=0),Le(e,t)}function pa(e,...t){try{return e(...t)}catch(e){return e instanceof Error?e:Error(e)}}function ma(e,t){if(typeof t!=`function`)throw TypeError(`Expected a function`);let n;return e=y(e),function(...r){return--e>0&&(n=t.apply(this,r)),e<=1&&t&&(t=void 0),n}}function ha(e,t,...n){let r=function(...i){let a=[],o=0;for(let e=0;e<n.length;e++){let t=n[e];t===ha.placeholder?a.push(i[o++]):a.push(t)}for(let e=o;e<i.length;e++)a.push(i[e]);return this instanceof r?new e(...a):e.apply(t,a)};return r}ha.placeholder=Symbol(`bind.placeholder`);function ga(e,t,...n){let r=function(...i){let a=[],o=0;for(let e=0;e<n.length;e++){let t=n[e];t===ga.placeholder?a.push(i[o++]):a.push(t)}for(let e=o;e<i.length;e++)a.push(i[e]);return this instanceof r?new e[t](...a):e[t].apply(e,a)};return r}ga.placeholder=Symbol(`bindKey.placeholder`);function _a(e,t=e.length,n){t=n?e.length:t,t=Number.parseInt(t,10),(Number.isNaN(t)||t<1)&&(t=0);let r=function(...n){let i=n.filter(e=>e===_a.placeholder),a=n.length-i.length;return a<t?va(e,t-a,n):this instanceof r?new e(...n):e.apply(this,n)};return r.placeholder=ba,r}function va(e,t,n){function r(...i){let a=i.filter(e=>e===_a.placeholder),o=i.length-a.length;return i=ya(i,n),o<t?va(e,t-o,i):this instanceof r?new e(...i):e.apply(this,i)}return r.placeholder=ba,r}function ya(e,t){let n=[],r=0;for(let i=0;i<t.length;i++){let a=t[i];a===_a.placeholder&&r<e.length?n.push(e[r++]):n.push(a)}for(let t=r;t<e.length;t++)n.push(e[t]);return n}let ba=Symbol(`curry.placeholder`);_a.placeholder=ba;function xa(e,t=e.length,n){t=n?e.length:t,t=Number.parseInt(t,10),(Number.isNaN(t)||t<1)&&(t=0);let r=function(...n){let i=n.filter(e=>e===xa.placeholder),a=n.length-i.length;return a<t?Sa(e,t-a,n):this instanceof r?new e(...n):e.apply(this,n)};return r.placeholder=wa,r}function Sa(e,t,n){function r(...i){let a=i.filter(e=>e===xa.placeholder),o=i.length-a.length;return i=Ca(i,n),o<t?Sa(e,t-o,i):this instanceof r?new e(...i):e.apply(this,i)}return r.placeholder=wa,r}function Ca(e,t){let n=t.filter(e=>e===xa.placeholder).length,r=Math.max(e.length-n,0),i=[],a=0;for(let t=0;t<r;t++)i.push(e[a++]);for(let n=0;n<t.length;n++){let r=t[n];r===xa.placeholder&&a<e.length?i.push(e[a++]):i.push(r)}return i}let wa=Symbol(`curryRight.placeholder`);xa.placeholder=wa;function Ta(e,t=0,n={}){typeof n!=`object`&&(n={});let{leading:r=!1,trailing:i=!0,maxWait:a}=n,o=[,,];r&&(o[0]=`leading`),i&&(o[1]=`trailing`);let s,c=null,l=ze(function(...t){s=e.apply(this,t),c=null},t,{edges:o}),u=function(...t){return a!=null&&(c===null&&(c=Date.now()),Date.now()-c>=a)?(s=e.apply(this,t),c=Date.now(),l.cancel(),l.schedule(),s):(l.apply(this,t),s)};return u.cancel=l.cancel,u.flush=()=>(l.flush(),s),u}function Ea(e,...t){if(typeof e!=`function`)throw TypeError(`Expected a function`);return setTimeout(e,1,...t)}function Da(e,t,...n){if(typeof e!=`function`)throw TypeError(`Expected a function`);return setTimeout(e,_(t)||0,...n)}function Oa(e){return function(...t){return e.apply(this,t.reverse())}}function ka(...e){let t=m(e,1);if(t.some(e=>typeof e!=`function`))throw TypeError(`Expected a function`);return Be(...t)}function Aa(...e){let t=m(e,1);if(t.some(e=>typeof e!=`function`))throw TypeError(`Expected a function`);return Ve(...t)}function ja(e,t){if(typeof e!=`function`||t!=null&&typeof t!=`function`)throw TypeError(`Expected a function`);let n=function(...r){let i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);let o=e.apply(this,r);return n.cache=a.set(i,o)||a,o};return n.cache=new(ja.Cache||Map),n}ja.Cache=Map;function Ma(e=0){return function(...t){return t.at(y(e))}}function Na(e){return We(e)}function Pa(e,...t){if(typeof e!=`function`)throw TypeError(`Expected a function`);let n=t.flat();return function(...t){let r=Math.min(t.length,n.length),i=[...t];for(let e=0;e<r;e++)i[e]=G(n[e]??b).call(this,t[e]);return e.apply(this,i)}}function Fa(e,...t){return Ke(e,Fa.placeholder,...t)}Fa.placeholder=Symbol(`compat.partial.placeholder`);function Ia(e,...t){return Ye(e,Ia.placeholder,...t)}Ia.placeholder=Symbol(`compat.partialRight.placeholder`);function La(e,...t){let n=Nr(t);return function(...t){let r=n.map(e=>t[e]).slice(0,t.length);for(let e=r.length;e<t.length;e++)r.push(t[e]);return e.apply(this,r)}}function Ra(e,t=e.length-1){return t=Number.parseInt(t,10),(Number.isNaN(t)||t<0)&&(t=e.length-1),Ze(e,t)}function za(e,t=0){return t=Number.parseInt(t,10),(Number.isNaN(t)||t<0)&&(t=0),function(...n){let r=n[t],i=n.slice(0,t);return r&&i.push(...r),e.apply(this,i)}}function Ba(e,t=0,n={}){let{leading:r=!0,trailing:i=!0}=n;return Ta(e,t,{leading:r,maxWait:t,trailing:i})}function Va(e){return fa(e,1)}function Ha(e,t){return function(...n){return(N(t)?t:b).apply(this,[e,...n])}}function Ua(e,t){return e===void 0&&t===void 0?0:e===void 0||t===void 0?e??t:(typeof e==`string`||typeof t==`string`?(e=R(e),t=R(t)):(e=_(e),t=_(t)),e+t)}function Wa(e,t,n=0){if(t=Number(t),Object.is(t,-0)&&(t=`-0`),n=Math.min(Number.parseInt(n,10),292),n){let[r,i=0]=t.toString().split(`e`),a=Math[e](Number(`${r}e${Number(i)+n}`));Object.is(a,-0)&&(a=`-0`);let[o,s=0]=a.toString().split(`e`);return Number(`${o}e${Number(s)-n}`)}return Math[e](Number(t))}function Ga(e,t=0){return Wa(`ceil`,e,t)}function Ka(e,t){return e===void 0&&t===void 0?1:e===void 0||t===void 0?e??t:(typeof e==`string`||typeof t==`string`?(e=R(e),t=R(t)):(e=_(e),t=_(t)),e/t)}function qa(e,t=0){return Wa(`floor`,e,t)}function Ja(e,t,n){return t||=0,n!=null&&!n&&(n=0),t!=null&&typeof t!=`number`&&(t=Number(t)),n==null&&t===0||(n!=null&&typeof n!=`number`&&(n=Number(n)),n!=null&&t>n&&([t,n]=[n,t]),t===n)?!1:tt(e,t,n)}function Ya(e){if(!e||e.length===0)return;let t;for(let n=0;n<e.length;n++){let r=e[n];r==null||Number.isNaN(r)||typeof r==`symbol`||(t===void 0||r>t)&&(t=r)}return t}function Xa(e,t){if(e!=null)return de(Array.from(e),G(t??b))}function Za(e,t){if(!e||!e.length)return 0;t!=null&&(t=G(t));let n;for(let r=0;r<e.length;r++){let i=t?t(e[r]):e[r];i!==void 0&&(n===void 0?n=i:n+=i)}return n}function Qa(e){return Za(e)}function $a(e){let t=e?e.length:0;return t===0?NaN:Qa(e)/t}function eo(e,t){return e==null?NaN:rt(Array.from(e),G(t??b))}function to(e){if(!e||e.length===0)return;let t;for(let n=0;n<e.length;n++){let r=e[n];r==null||Number.isNaN(r)||typeof r==`symbol`||(t===void 0||r<t)&&(t=r)}return t}function no(e,t){if(e!=null)return fe(Array.from(e),G(t??b))}function ro(e,t){return e===void 0&&t===void 0?1:e===void 0||t===void 0?e??t:(typeof e==`string`||typeof t==`string`?(e=R(e),t=R(t)):(e=_(e),t=_(t)),e*t)}function io(e,t=0,n){return n&&(t=0),Number.parseInt(e,t)}function ao(...e){let t=0,n=1,r=!1;switch(e.length){case 1:typeof e[0]==`boolean`?r=e[0]:n=e[0];break;case 2:typeof e[1]==`boolean`?(n=e[0],r=e[1]):(t=e[0],n=e[1]);case 3:typeof e[2]==`object`&&e[2]!=null&&e[2][e[1]]===e[0]?(t=0,n=e[0],r=!1):(t=e[0],n=e[1],r=e[2])}return typeof t!=`number`&&(t=Number(t)),typeof n!=`number`&&(t=Number(n)),t||=0,n||=0,t>n&&([t,n]=[n,t]),t=Ci(t,-(2**53-1),2**53-1),n=Ci(n,-(2**53-1),2**53-1),t===n?t:r?_e(t,n+1):ve(t,n+1)}function oo(e,t,n){n&&typeof n!=`number`&&Y(e,t,n)&&(t=n=void 0),e=v(e),t===void 0?(t=e,e=0):t=v(t),n=n===void 0?e<t?1:-1:v(n);let r=Math.max(Math.ceil((t-e)/(n||1)),0),i=Array(r);for(let t=0;t<r;t++)i[t]=e,e+=n;return i}function so(e,t,n){n&&typeof n!=`number`&&Y(e,t,n)&&(t=n=void 0),e=v(e),t===void 0?(t=e,e=0):t=v(t),n=n===void 0?e<t?1:-1:v(n);let r=Math.max(Math.ceil((t-e)/(n||1)),0),i=Array(r);for(let t=r-1;t>=0;t--)i[t]=e,e+=n;return i}function co(e,t=0){return Wa(`round`,e,t)}function lo(e,t){return e===void 0&&t===void 0?0:e===void 0||t===void 0?e??t:(typeof e==`string`||typeof t==`string`?(e=R(e),t=R(t)):(e=_(e),t=_(t)),e-t)}function uo(...e){}function fo(e){let t=e?.constructor;return e===(typeof t==`function`?t.prototype:Object.prototype)}function Z(e){return ct(e)}function po(e,t){if(e=y(e),e<1||!Number.isSafeInteger(e))return[];let n=Array(e);for(let r=0;r<e;r++)n[r]=typeof t==`function`?t(r):r;return n}function Q(e){if(I(e))return mo(e);let t=Object.keys(Object(e));return fo(e)?t.filter(e=>e!==`constructor`):t}function mo(e){let t=po(e.length,e=>`${e}`),n=new Set(t);C(e)&&(n.add(`offset`),n.add(`parent`)),Z(e)&&(n.add(`buffer`),n.add(`byteLength`),n.add(`byteOffset`));let r=Object.keys(e).filter(e=>!n.has(e));return Array.isArray(e)?[...t,...r]:[...t.filter(t=>Object.hasOwn(e,t)),...r]}function ho(e,...t){for(let n=0;n<t.length;n++)go(e,t[n]);return e}function go(e,t){let n=Q(t);for(let r=0;r<n.length;r++){let i=n[r];(!(i in e)||!M(e[i],t[i]))&&(e[i]=t[i])}}function $(e){if(e==null)return[];switch(typeof e){case`object`:case`function`:return I(e)?yo(e):fo(e)?vo(e):_o(e);default:return _o(Object(e))}}function _o(e){let t=[];for(let n in e)t.push(n);return t}function vo(e){return _o(e).filter(e=>e!==`constructor`)}function yo(e){let t=po(e.length,e=>`${e}`),n=new Set(t);C(e)&&(n.add(`offset`),n.add(`parent`)),Z(e)&&(n.add(`buffer`),n.add(`byteLength`),n.add(`byteOffset`));let r=_o(e).filter(e=>!n.has(e));return Array.isArray(e)?[...t,...r]:[...t.filter(t=>Object.hasOwn(e,t)),...r]}function bo(e,...t){for(let n=0;n<t.length;n++)xo(e,t[n]);return e}function xo(e,t){let n=$(t);for(let r=0;r<n.length;r++){let i=n[r];(!(i in e)||!M(e[i],t[i]))&&(e[i]=t[i])}}function So(e,...t){let n=t[t.length-1];typeof n==`function`?t.pop():n=void 0;for(let r=0;r<t.length;r++)Co(e,t[r],n);return e}function Co(e,t,n){let r=$(t);for(let i=0;i<r.length;i++){let a=r[i],o=e[a],s=t[a],c=n?.(o,s,a,e,t)??s;(!(a in e)||!M(o,c))&&(e[a]=c)}}function wo(e,...t){let n=t[t.length-1];typeof n==`function`?t.pop():n=void 0;for(let r=0;r<t.length;r++)To(e,t[r],n);return e}function To(e,t,n){let r=Q(t);for(let i=0;i<r.length;i++){let a=r[i],o=e[a],s=t[a],c=n?.(o,s,a,e,t)??s;(!(a in e)||!M(o,c))&&(e[a]=c)}}function Eo(e){if(x(e))return e;let t=S(e);if(!Do(e))return{};if(k(e)){let t=Array.from(e);return e.length>0&&typeof e[0]==`string`&&Object.hasOwn(e,`index`)&&(t.index=e.index,t.input=e.input),t}if(Z(e)){let t=e,n=t.constructor;return new n(t.buffer,t.byteOffset,t.length)}if(t===`[object ArrayBuffer]`)return new ArrayBuffer(e.byteLength);if(t===`[object DataView]`){let t=e,n=t.buffer,r=t.byteOffset,i=t.byteLength,a=new ArrayBuffer(i),o=new Uint8Array(n,r,i);return new Uint8Array(a).set(o),new DataView(a)}if(t===`[object Boolean]`||t===`[object Number]`||t===`[object String]`){let n=e.constructor,r=new n(e.valueOf());return t===`[object String]`?Ao(r,e):Oo(r,e),r}if(t===`[object Date]`)return new Date(Number(e));if(t===`[object RegExp]`){let t=e,n=new RegExp(t.source,t.flags);return n.lastIndex=t.lastIndex,n}if(t===`[object Symbol]`)return Object(Symbol.prototype.valueOf.call(e));if(t===`[object Map]`){let t=e,n=new Map;return t.forEach((e,t)=>{n.set(t,e)}),n}if(t===`[object Set]`){let t=e,n=new Set;return t.forEach(e=>{n.add(e)}),n}if(t===`[object Arguments]`){let t=e,n={};return Oo(n,t),n.length=t.length,n[Symbol.iterator]=t[Symbol.iterator],n}let n={};return jo(n,e),Oo(n,e),ko(n,e),n}function Do(e){switch(S(e)){case ht:case bt:case xt:case Ct:case mt:case _t:case jt:case Mt:case Ot:case kt:case At:case vt:case pt:case St:case dt:case yt:case ft:case gt:case wt:case Tt:case Et:case Dt:return!0;default:return!1}}function Oo(e,t){for(let n in t)Object.hasOwn(t,n)&&(e[n]=t[n])}function ko(e,t){let n=Object.getOwnPropertySymbols(t);for(let r=0;r<n.length;r++){let i=n[r];Object.prototype.propertyIsEnumerable.call(t,i)&&(e[i]=t[i])}}function Ao(e,t){let n=t.valueOf().length;for(let r in t)Object.hasOwn(t,r)&&(Number.isNaN(Number(r))||Number(r)>=n)&&(e[r]=t[r])}function jo(e,t){let n=Object.getPrototypeOf(t);n!==null&&typeof t.constructor==`function`&&Object.setPrototypeOf(e,n)}function Mo(e,t){if(!t)return Eo(e);let n=t(e);return n===void 0?Eo(e):n}function No(e,t){let n=H(e)?Object.create(e):{};if(t!=null){let e=Q(t);for(let r=0;r<e.length;r++){let i=e[r],a=t[i];aa(n,i,a)}}return n}function Po(e,...t){e=Object(e);let n=Object.prototype,r=t.length,i=r>2?t[2]:void 0;i&&Y(t[0],t[1],i)&&(r=1);for(let i=0;i<r;i++){if(P(t[i]))continue;let r=t[i],a=Object.keys(r);for(let t=0;t<a.length;t++){let i=a[t],o=e[i];(o===void 0||!Object.hasOwn(e,i)&&M(o,n[i]))&&(e[i]=r[i])}}return e}function Fo(e,...t){e=Object(e);for(let n=0;n<t.length;n++){let r=t[n];r!=null&&Io(e,r,new WeakMap)}return e}function Io(e,t,n){for(let r in t){let i=t[r],a=e[r];if(a===void 0||!Object.hasOwn(e,r)){e[r]=Lo(i,n);continue}n.get(i)!==a&&Ro(a,i,n)}}function Lo(e,t){if(t.has(e))return t.get(e);if(j(e)){let n={};return t.set(e,n),Io(n,e,t),n}return e}function Ro(e,t,n){if(j(e)&&j(t)){n.set(t,e),Io(e,t,n);return}Array.isArray(e)&&Array.isArray(t)&&(n.set(t,e),zo(e,t,n))}function zo(e,t,n){let r=Math.min(t.length,e.length);for(let i=0;i<r;i++)j(e[i])&&j(t[i])&&Io(e[i],t[i],n);for(let n=r;n<t.length;n++)e.push(t[n])}function Bo(e,t){if(H(e))return It(e,G(t??X))}function Vo(e,t){if(!H(e))return;let n=G(t??X);return Object.keys(e).findLast(t=>n(e[t],t,e))}function Ho(e,t=b){if(e==null)return e;for(let n in e)if(t(e[n],n,e)===!1)break;return e}function Uo(e,t=b){if(e==null)return e;let n=[];for(let t in e)n.push(t);for(let r=n.length-1;r>=0;r--){let i=n[r];if(t(e[i],i,e)===!1)break}return e}function Wo(e,t=b){if(e==null)return e;let n=Object(e),r=Q(e);for(let e=0;e<r.length;++e){let i=r[e];if(t(n[i],i,n)===!1)break}return e}function Go(e,t=b){if(e==null)return e;let n=Object(e),r=Q(e);for(let e=r.length-1;e>=0;--e){let i=r[e];if(t(n[i],i,n)===!1)break}return e}function Ko(e){if(!I(e))return{};let t={};for(let n=0;n<e.length;n++){let[r,i]=e[n];t[r]=i}return t}function qo(e){return e==null?[]:Q(e).filter(t=>typeof e[t]==`function`)}function Jo(e){if(e==null)return[];let t=[];for(let n in e)N(e[n])&&t.push(n);return t}function Yo(e,t){if(e==null)return!1;let n;if(n=Array.isArray(t)?t:typeof t==`string`&&Xn(t)&&e[t]==null?z(t):[t],n.length===0)return!1;let r=e;for(let e=0;e<n.length;e++){let t=n[e];if((r==null||!(t in Object(r)))&&!((Array.isArray(r)||lr(r))&&cr(t)&&t<r.length))return!1;r=r[t]}return!0}function Xo(e){return zt(e)}function Zo(e,t){let n={};if(P(e))return n;t??=b;let r=Object.keys(e),i=G(t);for(let t=0;t<r.length;t++){let a=r[t],o=e[a],s=i(o);Array.isArray(n[s])?n[s].push(a):n[s]=[a]}return n}function Qo(e,t=b){return e==null?{}:Bt(e,G(t))}function $o(e,t=b){return e==null?{}:Vt(e,G(t))}function es(e,...t){let n=t.slice(0,-1),r=t[t.length-1],i=e;for(let e=0;e<n.length;e++){let t=n[e];i=ts(i,t,r,new Map)}return i}function ts(e,t,n,r){if(x(e)&&(e=Object(e)),typeof t!=`object`||!t)return e;if(r.has(t))return lt(r.get(t));if(r.set(t,e),Array.isArray(t)){t=t.slice();for(let e=0;e<t.length;e++)t[e]=t[e]??void 0}let i=[...Object.keys(t),...ut(t)];for(let a=0;a<i.length;a++){let o=i[a];if(D(o))continue;let s=t[o],c=e[o];if(lr(s)&&(s={...s}),lr(c)&&(c={...c}),C(s)&&(s=or(s)),Array.isArray(s))if(Array.isArray(c)){let e=[],t=Reflect.ownKeys(c);for(let n=0;n<t.length;n++){let r=t[n];e[r]=c[r]}c=e}else if(q(c)){let e=[];for(let t=0;t<c.length;t++)e[t]=c[t];c=e}else c=[];let l=n(c,s,o,e,t,r);l===void 0?Array.isArray(s)||K(c)&&K(s)&&(j(c)||j(s)||Z(c)||Z(s))?e[o]=ts(c,s,n,r):c==null&&j(s)?e[o]=ts({},s,n,r):c==null&&Z(s)?e[o]=or(s):(c===void 0||s!==void 0)&&(e[o]=s):e[o]=l}return e}function ns(e,...t){return es(e,...t,Ue)}function rs(e){let t=[];for(;e;)t.push(...ut(e)),e=Object.getPrototypeOf(e);return t}function is(e,...t){if(e==null)return{};t=Nr(t);let n=as(e,t);for(let e=0;e<t.length;e++){let r=t[e];switch(typeof r){case`object`:Array.isArray(r)||(r=Array.from(r));for(let e=0;e<r.length;e++){let t=r[e];mi(n,t)}break;case`string`:case`symbol`:case`number`:mi(n,r);break}}return n}function as(e,t){return t.some(e=>Array.isArray(e)||Xn(e))?ss(e):os(e)}function os(e){let t={},n=[...$(e),...rs(e)];for(let r=0;r<n.length;r++){let i=n[r];t[i]=e[i]}return t}function ss(e){let t={},n=[...$(e),...rs(e)];for(let r=0;r<n.length;r++){let i=n[r];t[i]=ar(e[i],e=>{if(!j(e))return e})}return t}function cs(e,t){if(e==null)return{};let n={},r=G(t??X),i=[...$(e),...rs(e)];for(let t=0;t<i.length;t++){let a=g(i[t])?i[t]:i[t].toString(),o=e[a];r(o,a,e)||(n[a]=o)}return n}function ls(e,...t){if(Oi(e))return{};let n={};for(let r=0;r<t.length;r++){let i=t[r];switch(typeof i){case`object`:Array.isArray(i)||(i=I(i)?Array.from(i):[i]);break;case`string`:case`symbol`:case`number`:i=[i];break}for(let t of i){let r=B(e,t);r===void 0&&!ur(e,t)||(typeof t==`string`&&Object.hasOwn(e,t)?n[t]=r:ca(n,t,r))}}return n}function us(e,t){if(e==null)return{};let n=G(t??X),r={},i=I(e)?st(0,e.length):[...$(e),...rs(e)];for(let t=0;t<i.length;t++){let a=g(i[t])?i[t]:i[t].toString(),o=e[a];n(o,a,e)&&(r[a]=o)}return r}function ds(e){return function(t){return B(e,t)}}function fs(e,t,n){ai(t,e)?t=[t]:Array.isArray(t)||(t=z(R(t)));let r=Math.max(t.length,1);for(let i=0;i<r;i++){let r=e?.[L(t[i])];if(r===void 0)return typeof n==`function`?n.call(e):n;e=typeof r==`function`?r.call(e):r}return e}function ps(e,t,n,r){let i;return i=typeof r==`function`?r:()=>void 0,sa(e,t,()=>n,i)}function ms(e,...t){return Po(or(e),...t)}function hs(e){let t=Array(e.size),n=e.keys(),r=e.values();for(let e=0;e<t.length;e++)t[e]=[n.next().value,r.next().value];return t}function gs(e){let t=Array(e.size),n=e.values();for(let e=0;e<t.length;e++){let r=n.next().value;t[e]=[r,r]}return t}function _s(e){if(e==null)return[];if(e instanceof Set)return gs(e);if(e instanceof Map)return hs(e);let t=Q(e),n=Array(t.length);for(let r=0;r<t.length;r++){let i=t[r];n[r]=[i,e[i]]}return n}function vs(e){if(e==null)return[];if(e instanceof Set)return gs(e);if(e instanceof Map)return hs(e);let t=$(e),n=Array(t.length);for(let r=0;r<t.length;r++){let i=t[r];n[r]=[i,e[i]]}return n}function ys(e){return C(e)}function bs(e,t=b,n){let r=Array.isArray(e)||ys(e)||Z(e);return t=G(t),n??=r?[]:H(e)&&N(e.constructor)?Object.create(Object.getPrototypeOf(e)):{},e==null||Sr(e,(e,r,i)=>t(n,e,r,i)),n}function xs(e,t,n){return sa(e,t,n,()=>void 0)}function Ss(e){let t=$(e),n=Array(t.length);for(let r=0;r<t.length;r++)n[r]=e[t[r]];return n}function Cs(e){return typeof e==`function`}function ws(e){return Number.isSafeInteger(e)&&e>=0}let Ts=Function.prototype.toString,Es=RegExp(`^${Ts.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)}$`);function Ds(e){if(typeof e!=`function`)return!1;if(globalThis?.[`__core-js_shared__`]!=null)throw Error(`Unsupported core-js use. Try https://npms.io/search?q=ponyfill.`);return Es.test(Ts.call(e))}function Os(e){return e===null}function ks(e){return yn(e)}function As(e,t){if(t==null)return!0;if(e==null)return Object.keys(t).length===0;let n=Object.keys(t);for(let r=0;r<n.length;r++){let i=n[r],a=t[i],o=e[i];if(o===void 0&&!(i in e)||typeof a==`function`&&!a(o))return!1}return!0}function js(e){return e=Ft(e),function(t){return As(t,e)}}function Ms(e){return Yt(e)}function Ns(e){return typeof e==`boolean`||e instanceof Boolean}function Ps(e){return Qt(e)}function Fs(e){return K(e)&&e.nodeType===1&&!j(e)}function Is(e){if(e==null)return!0;if(I(e))return typeof e.splice!=`function`&&typeof e!=`string`&&!C(e)&&!Z(e)&&!lr(e)?!1:e.length===0;if(typeof e==`object`){if(e instanceof Map||e instanceof Set)return e.size===0;let t=Object.keys(e);return fo(e)?t.filter(e=>e!==`constructor`).length===0:t.length===0}return!0}function Ls(e,t,n){return typeof n!=`function`&&(n=()=>void 0),en(e,t,(...r)=>{let i=n(...r);if(i!==void 0)return!!i;if(e instanceof Map&&t instanceof Map||e instanceof Set&&t instanceof Set)return Ls(Array.from(e),Array.from(t),Ie(2,n))})}function Rs(e){return S(e)===`[object Error]`}function zs(e){return Number.isFinite(e)}function Bs(e){return Number.isInteger(e)}function Vs(e){return gn(e)}function Hs(e){return Number.isSafeInteger(e)}function Us(e){return _n(e)}function Ws(e){return bn(e)}function Gs(e){return xn(e)}function Ks(e){return Ht(R(e))}function qs(e,...t){if(e==null||!H(e)||k(e)&&t.length===0)return e;let n=[];for(let e=0;e<t.length;e++){let r=t[e];k(r)?n.push(...r):r&&typeof r==`object`&&`length`in r?n.push(...Array.from(r)):n.push(r)}if(n.length===0)return e;for(let t=0;t<n.length;t++){let r=n[t],i=R(r),a=e[i];N(a)&&(e[i]=a.bind(e))}return e}function Js(e){return Dn(R(e))}function Ys(e){return typeof e!=`string`&&(e=R(e)),e.replace(/['\u2019]/g,``)}function Xs(e){return Wt(Ys(Js(e)))}function Zs(e,t,n){return e==null||t==null?!1:(n??=e.length,e.endsWith(t,n))}function Qs(e){return kn(R(e))}function $s(e){return An(R(e))}function ec(e){return jn(Ys(Js(e)))}function tc(e){return Mn(Ys(Js(e)))}function nc(e){return Nn(R(e))}function rc(e,t,n){return Pn(R(e),t,n)}function ic(e,t=0,n=` `){return R(e).padEnd(t,n)}function ac(e,t=0,n=` `){return R(e).padStart(t,n)}let oc=2**53-1;function sc(e,t,n){return t=(n?Y(e,t,n):t===void 0)?1:y(t),t<1||t>oc?``:R(e).repeat(t)}function cc(e,t,n){return arguments.length<3?R(e):R(e).replace(t,n)}function lc(e){return qt(Ys(Js(e)))}function uc(e,t,n){return R(e).split(t,n)}function dc(e){let t=A(Ys(Js(e)).trim()),n=``;for(let e=0;e<t.length;e++){let r=t[e];n&&(n+=` `),r===r.toUpperCase()?n+=r:n+=r[0].toUpperCase()+r.slice(1).toLowerCase()}return n}function fc(e,t,n){return e==null||t==null?!1:(n??=0,e.startsWith(t,n))}let pc=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,mc=/['\n\r\u2028\u2029\\]/g,hc=/($^)/,gc=new Map([[`\\`,`\\`],[`'`,`'`],[`
|
|
2
|
-
`,`n`],[`\r`,`r`],[`\u2028`,`u2028`],[`\u2029`,`u2029`]]);function
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports):typeof define==`function`&&define.amd?define([`exports`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e._={}))})(this,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(...e){if(e.length===0)return[[]];let t=1;for(let n=0;n<e.length;n++)t*=e[n].length;if(t===0)return[];let n=e.length,r=Array(t);for(let i=0;i<t;i++){let t=Array(n),a=i;for(let r=n-1;r>=0;r--){let n=e[r],i=n.length;t[r]=n[a%i],a=Math.floor(a/i)}r[i]=t}return r}function n(e,t){if(!Number.isInteger(t)||t<=0)throw Error(`Size must be an integer greater than zero.`);let n=Math.ceil(e.length/t),r=Array(n);for(let i=0;i<n;i++){let n=i*t,a=n+t;r[i]=e.slice(n,a)}return r}function r(e,t){if(!Number.isInteger(t)||t<0)throw Error(`r must be a non-negative integer.`);let n=e.length;if(t>n)return[];if(t===0)return[[]];let r=Array(t);for(let e=0;e<t;e++)r[e]=e;let i=[];for(;;){let a=Array(t);for(let n=0;n<t;n++)a[n]=e[r[n]];i.push(a);let o=t-1;for(;o>=0&&r[o]===o+n-t;)o--;if(o<0)return i;r[o]++;for(let e=o+1;e<t;e++)r[e]=r[e-1]+1}}function i(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n];r&&t.push(r)}return t}function a(e,t){let n=new Set(t);return e.filter(e=>!n.has(e))}function o(e,t,n){let r=new Set(t.map(e=>n(e)));return e.filter(e=>!r.has(n(e)))}function s(e,t,n){return e.filter(e=>t.every(t=>!n(e,t)))}function c(e,t){return t=Math.max(t,0),e.slice(t)}function l(e,t){return t=Math.min(-t,0),t===0?e.slice():e.slice(0,t)}function u(e,t){for(let n=e.length-1;n>=0;n--)if(!t(e[n],n,e))return e.slice(0,n+1);return[]}function d(e,t){let n=e.findIndex((e,n,r)=>!t(e,n,r));return n===-1?[]:e.slice(n)}function f(e,t,n=0,r=e.length){let i=e.length,a=Math.max(n>=0?n:i+n,0),o=Math.min(r>=0?r:i+r,i);for(let n=a;n<o;n++)e[n]=t;return e}var p=class{capacity;available;deferredTasks=[];constructor(e){this.capacity=e,this.available=e}async acquire(){if(this.available>0){this.available--;return}return new Promise(e=>{this.deferredTasks.push(e)})}release(){let e=this.deferredTasks.shift();if(e!=null){e();return}this.available<this.capacity&&this.available++}};function m(e,t){let n=new p(t);return async function(...t){try{return await n.acquire(),await e.apply(this,t)}finally{n.release()}}}async function h(e,t,n){n?.concurrency!=null&&(t=m(t,n.concurrency));let r=await Promise.all(e.map(t));return e.filter((e,t)=>r[t])}function g(e,t=1){let n=[],r=Math.floor(t),i=(e,t)=>{for(let a=0;a<e.length;a++){let o=e[a];Array.isArray(o)&&t<r?i(o,t+1):n.push(o)}};return i(e,0),n}async function ee(e,t,n){return n?.concurrency!=null&&(t=m(t,n.concurrency)),g(await Promise.all(e.map(t)))}async function te(e,t,n){n?.concurrency!=null&&(t=m(t,n.concurrency)),await Promise.all(e.map(t))}function ne(e,t){let n={};for(let r=0;r<e.length;r++){let i=e[r],a=t(i,r,e);Object.hasOwn(n,a)||(n[a]=[]),n[a].push(i)}return n}function re(e){return e[0]}function ie(e){return e.slice(0,-1)}function ae(e,t){let n=new Set(t);return e.filter(e=>n.has(e))}function oe(e,t,n){let r=[],i=new Set(t.map(n));for(let t=0;t<e.length;t++){let a=e[t],o=n(a);i.has(o)&&(r.push(a),i.delete(o))}return r}function se(e,t,n){return e.filter(e=>t.some(t=>n(e,t)))}function ce(e,t){return a(t,e).length===0}function le(e,t,n){return s(t,e,n).length===0}function ue(e){return e[e.length-1]}function de(e,t,n){return n?.concurrency!=null&&(t=m(t,n.concurrency)),Promise.all(e.map(t))}function fe(e,t){if(e.length===0)return;let n=e[0],r=t(n,0,e);for(let i=1;i<e.length;i++){let a=e[i],o=t(a,i,e);o>r&&(r=o,n=a)}return n}function pe(e,t){if(e.length===0)return;let n=e[0],r=t(n,0,e);for(let i=1;i<e.length;i++){let a=e[i],o=t(a,i,e);o<r&&(r=o,n=a)}return n}function me(e,t){let n=new Set(t),r=0;for(let t=0;t<e.length;t++)if(!n.has(e[t])){if(!Object.hasOwn(e,t)){delete e[r++];continue}e[r++]=e[t]}return e.length=r,e}async function he(e,t,n){let r=0;n??(n=e[0],r=1);let i=n;for(let n=r;n<e.length;n++)i=await t(i,e[n],n,e);return i}function ge(e,t){let n=e.slice(),r=[],i=0;for(let a=0;a<e.length;a++){if(t(e[a],a,n)){r.push(e[a]);continue}if(!Object.hasOwn(e,a)){delete e[i++];continue}e[i++]=e[a]}return e.length=i,r}function _e(e){return e[Math.floor(Math.random()*e.length)]}function ve(e,t){if(t??(t=e,e=0),e>=t)throw Error(`Invalid input: The maximum value must be greater than the minimum value.`);return Math.random()*(t-e)+e}function ye(e,t){return Math.floor(ve(e,t))}function be(e,t){if(t>e.length)throw Error(`Size must be less than or equal to the length of array.`);let n=Array(t),r=new Set;for(let i=e.length-t,a=0;i<e.length;i++,a++){let t=ye(0,i+1);r.has(t)&&(t=i),r.add(t),n[a]=e[t]}return n}function xe(e){let t=e.slice();for(let e=t.length-1;e>=1;e--){let n=Math.floor(Math.random()*(e+1));[t[e],t[n]]=[t[n],t[e]]}return t}function Se(e){return e.slice(1)}function _(e){return typeof e==`symbol`||e instanceof Symbol}function v(e){return _(e)?NaN:Number(e)}function y(e){return e?(e=v(e),e===1/0||e===-1/0?(e<0?-1:1)*Number.MAX_VALUE:e===e?e:0):e===0?e:0}function b(e){let t=y(e),n=t%1;return n?t-n:t}function Ce(e,t,n){return t=n||t===void 0?1:b(t),e.slice(0,t)}function we(e,t,n){return t=n||t===void 0?1:b(t),t<=0||e.length===0?[]:e.slice(-t)}function Te(e,t,n=0,r=e.length){let i=e.length,a=Math.max(n>=0?n:i+n,0),o=Math.min(r>=0?r:i+r,i),s=e.slice();for(let e=a;e<o;e++)s[e]=t;return s}function Ee(e){return[...new Set(e)]}function De(e,t){let n=new Map;for(let r=0;r<e.length;r++){let i=e[r],a=t(i,r,e);n.has(a)||n.set(a,i)}return Array.from(n.values())}function Oe(e,t){let n=[];for(let r=0;r<e.length;r++){let i=e[r];n.every(e=>!t(e,i))&&n.push(i)}return n}function ke(e){let t=0;for(let n=0;n<e.length;n++)e[n].length>t&&(t=e[n].length);let n=Array(t);for(let r=0;r<t;r++){n[r]=Array(e.length);for(let t=0;t<e.length;t++)n[r][t]=e[t][r]}return n}function Ae(e,t,n=1,{partialWindows:r=!1}={}){if(t<=0||!Number.isInteger(t))throw Error(`Size must be a positive integer.`);if(n<=0||!Number.isInteger(n))throw Error(`Step must be a positive integer.`);let i=[],a=r?e.length:e.length-t+1;for(let r=0;r<a;r+=n)i.push(e.slice(r,r+t));return i}function je(e,...t){return a(e,t)}function Me(...e){let t=0;for(let n=0;n<e.length;n++)e[n].length>t&&(t=e[n].length);let n=e.length,r=Array(t);for(let i=0;i<t;++i){let t=Array(n);for(let r=0;r<n;++r)t[r]=e[r][i];r[i]=t}return r}let Ne=typeof globalThis==`object`&&globalThis||typeof window==`object`&&window||typeof self==`object`&&self||typeof global==`object`&&global||(function(){return this})()||Function(`return this`)(),Pe=Ne.DOMException===void 0?Error:Ne.DOMException;var Fe=class extends Pe{constructor(e=`The operation was aborted`){super(e)}},Ie=class extends Pe{constructor(e=`The operation was timed out`){super(e)}};function Le(e,t){if(!Number.isInteger(e)||e<0)throw Error(`n must be a non-negative integer.`);let n=0;return(...r)=>{if(++n>=e)return t(...r)}}function Re(e,t){return function(...n){return e.apply(this,n.slice(0,t))}}async function ze(){}function Be(e,t,{signal:n,edges:r}={}){let i,a=null,o=r!=null&&r.includes(`leading`),s=r==null||r.includes(`trailing`),c=()=>{a!==null&&(e.apply(i,a),i=void 0,a=null)},l=()=>{s&&c(),p()},u=null,d=()=>{u!=null&&clearTimeout(u),u=setTimeout(()=>{u=null,l()},t)},f=()=>{u!==null&&(clearTimeout(u),u=null)},p=()=>{f(),i=void 0,a=null},m=()=>{c()},h=function(...e){if(n?.aborted)return;i=this,a=e;let t=u==null;d(),o&&t&&c()};return h.schedule=d,h.cancel=p,h.flush=m,n?.addEventListener(`abort`,p,{once:!0}),h}function Ve(...e){return function(...t){let n=e.length?e[0].apply(this,t):t[0];for(let t=1;t<e.length;t++)n=e[t].call(this,n);return n}}function He(...e){return Ve(...e.reverse())}function x(e){return e}function Ue(e){return((...t)=>!e(...t))}function We(){}function Ge(e){let t=!1,n;return function(...r){return t||(t=!0,n=e(...r)),n}}function Ke(e,...t){return qe(e,Je,...t)}function qe(e,t,...n){let r=function(...r){let i=0,a=n.slice().map(e=>e===t?r[i++]:e),o=r.slice(i);return e.apply(this,a.concat(o))};return e.prototype&&(r.prototype=Object.create(e.prototype)),r}let Je=Symbol(`partial.placeholder`);Ke.placeholder=Je;function Ye(e,...t){return Xe(e,Ze,...t)}function Xe(e,t,...n){let r=function(...r){let i=n.filter(e=>e===t).length,a=Math.max(r.length-i,0),o=r.slice(0,a),s=a,c=n.slice().map(e=>e===t?r[s++]:e);return e.apply(this,o.concat(c))};return e.prototype&&(r.prototype=Object.create(e.prototype)),r}let Ze=Symbol(`partialRight.placeholder`);Ye.placeholder=Ze;function Qe(e,t=e.length-1){return function(...n){let r=n.slice(t),i=n.slice(0,t);for(;i.length<t;)i.push(void 0);return e.apply(this,[...i,r])}}function $e(e,{signal:t}={}){return new Promise((n,r)=>{let i=()=>{r(new Fe)},a=()=>{clearTimeout(o),i()};if(t?.aborted)return i();let o=setTimeout(()=>{t?.removeEventListener(`abort`,a),n()},e);t?.addEventListener(`abort`,a,{once:!0})})}let et=()=>!0;async function tt(e,t){let n,r,i,a;typeof t==`number`?(n=0,r=t,i=void 0,a=et):(n=t?.delay??0,r=t?.retries??1/0,i=t?.signal,a=t?.shouldRetry??et);let o;for(let t=0;t<=r;t++){if(i?.aborted)throw o??Error(`The retry operation was aborted due to an abort signal.`);try{return await e()}catch(e){if(o=e,!a(e,t))throw e;await $e(typeof n==`function`?n(t):n)}}throw o}function nt(e,t,n){if(n??(n=t,t=0),t>=n)throw Error(`The maximum value must be greater than the minimum value.`);return t<=e&&e<n}function rt(e,t){let n=0;for(let r=0;r<e.length;r++)n+=t(e[r],r);return n}function it(e,t){return rt(e,e=>t(e))/e.length}function at(e){if(e.length===0)return NaN;let t=e.slice().sort((e,t)=>e-t),n=Math.floor(t.length/2);return t.length%2==0?(t[n-1]+t[n])/2:t[n]}function ot(e,t){return at(e.map(e=>t(e)))}function st(e,t){if(Number.isNaN(Number(t)))throw Error(`Expected percentile to be a number but got "${t}".`);if(t<0)throw Error(`Expected percentile to be >= 0 but got "${t}".`);if(t>100)throw Error(`Expected percentile to be <= 100 but got "${t}".`);if(e.length===0)return NaN;let n=e.slice().sort((e,t)=>(Number.isNaN(e)?-1/0:e)-(Number.isNaN(t)?-1/0:t));return t===0?n[0]:n[Math.ceil(n.length*(t/100))-1]}function ct(e,t,n=1){if(t??(t=e,e=0),!Number.isInteger(n)||n===0)throw Error(`The step value must be a non-zero integer.`);let r=Math.max(Math.ceil((t-e)/n),0),i=Array(r);for(let t=0;t<r;t++)i[t]=e+t*n;return i}function lt(e){return e==null||typeof e!=`object`&&typeof e!=`function`}function ut(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function dt(e){if(lt(e))return e;if(Array.isArray(e)||ut(e)||e instanceof ArrayBuffer||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer)return e.slice(0);let t=Object.getPrototypeOf(e);if(t==null)return Object.assign(Object.create(t),e);let n=t.constructor;if(e instanceof Date||e instanceof Map||e instanceof Set)return new n(e);if(e instanceof RegExp){let t=new n(e);return t.lastIndex=e.lastIndex,t}if(e instanceof DataView)return new n(e.buffer.slice(0));if(e instanceof Error){let t;return t=e instanceof AggregateError?new n(e.errors,e.message,{cause:e.cause}):new n(e.message,{cause:e.cause}),t.stack=e.stack,Object.assign(t,e),t}return typeof File<`u`&&e instanceof File?new n([e],e.name,{type:e.type,lastModified:e.lastModified}):typeof e==`object`?Object.assign(Object.create(t),e):e}function ft(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function S(e){return e==null?e===void 0?`[object Undefined]`:`[object Null]`:Object.prototype.toString.call(e)}let pt=`[object RegExp]`,mt=`[object String]`,ht=`[object Number]`,gt=`[object Boolean]`,_t=`[object Arguments]`,vt=`[object Symbol]`,yt=`[object Date]`,bt=`[object Map]`,xt=`[object Set]`,St=`[object Array]`,Ct=`[object ArrayBuffer]`,wt=`[object Object]`,Tt=`[object DataView]`,Et=`[object Uint8Array]`,Dt=`[object Uint8ClampedArray]`,Ot=`[object Uint16Array]`,kt=`[object Uint32Array]`,At=`[object Int8Array]`,jt=`[object Int16Array]`,Mt=`[object Int32Array]`,Nt=`[object Float32Array]`,Pt=`[object Float64Array]`;function C(e){return Ne.Buffer!==void 0&&Ne.Buffer.isBuffer(e)}function Ft(e,t){return w(e,void 0,e,new Map,t)}function w(e,t,n,r=new Map,i=void 0){let a=i?.(e,t,n,r);if(a!==void 0)return a;if(lt(e))return e;if(r.has(e))return r.get(e);if(Array.isArray(e)){let t=Array(e.length);r.set(e,t);for(let a=0;a<e.length;a++)t[a]=w(e[a],a,n,r,i);return Object.hasOwn(e,`index`)&&(t.index=e.index),Object.hasOwn(e,`input`)&&(t.input=e.input),t}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){let t=new RegExp(e.source,e.flags);return t.lastIndex=e.lastIndex,t}if(e instanceof Map){let t=new Map;r.set(e,t);for(let[a,o]of e)t.set(a,w(o,a,n,r,i));return t}if(e instanceof Set){let t=new Set;r.set(e,t);for(let a of e)t.add(w(a,void 0,n,r,i));return t}if(C(e))return e.subarray();if(ut(e)){let t=new(Object.getPrototypeOf(e)).constructor(e.length);r.set(e,t);for(let a=0;a<e.length;a++)t[a]=w(e[a],a,n,r,i);return t}if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){let t=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return r.set(e,t),T(t,e,n,r,i),t}if(typeof File<`u`&&e instanceof File){let t=new File([e],e.name,{type:e.type});return r.set(e,t),T(t,e,n,r,i),t}if(typeof Blob<`u`&&e instanceof Blob){let t=new Blob([e],{type:e.type});return r.set(e,t),T(t,e,n,r,i),t}if(e instanceof Error){let t=structuredClone(e);return r.set(e,t),t.message=e.message,t.name=e.name,t.stack=e.stack,t.cause=e.cause,t.constructor=e.constructor,T(t,e,n,r,i),t}if(e instanceof Boolean){let t=new Boolean(e.valueOf());return r.set(e,t),T(t,e,n,r,i),t}if(e instanceof Number){let t=new Number(e.valueOf());return r.set(e,t),T(t,e,n,r,i),t}if(e instanceof String){let t=new String(e.valueOf());return r.set(e,t),T(t,e,n,r,i),t}if(typeof e==`object`&&It(e)){let t=Object.create(Object.getPrototypeOf(e));return r.set(e,t),T(t,e,n,r,i),t}return e}function T(e,t,n=e,r,i){let a=[...Object.keys(t),...ft(t)];for(let o=0;o<a.length;o++){let s=a[o],c=Object.getOwnPropertyDescriptor(e,s);(c==null||c.writable)&&(e[s]=w(t[s],s,n,r,i))}}function It(e){switch(S(e)){case _t:case St:case Ct:case Tt:case gt:case yt:case Nt:case Pt:case At:case jt:case Mt:case bt:case ht:case wt:case pt:case xt:case mt:case vt:case Et:case Dt:case Ot:case kt:return!0;default:return!1}}function Lt(e){return w(e,void 0,e,new Map,void 0)}function Rt(e,t){return Object.keys(e).find(n=>t(e[n],n,e))}function E(e){if(!e||typeof e!=`object`)return!1;let t=Object.getPrototypeOf(e);return t===null||t===Object.prototype||Object.getPrototypeOf(t)===null?Object.prototype.toString.call(e)===`[object Object]`:!1}function zt(e,{delimiter:t=`.`}={}){return Bt(e,``,t)}function Bt(e,t,n){let r={},i=Object.keys(e);for(let a=0;a<i.length;a++){let o=i[a],s=e[o],c=t?`${t}${n}${o}`:o;if(E(s)&&Object.keys(s).length>0){Object.assign(r,Bt(s,c,n));continue}if(Array.isArray(s)&&s.length>0){Object.assign(r,Bt(s,c,n));continue}r[c]=s}return r}function Vt(e){let t={},n=Object.keys(e);for(let r=0;r<n.length;r++){let i=n[r],a=e[i];t[a]=i}return t}function Ht(e,t){let n={},r=Object.keys(e);for(let i=0;i<r.length;i++){let a=r[i],o=e[a];n[t(o,a,e)]=o}return n}function Ut(e,t){let n={},r=Object.keys(e);for(let i=0;i<r.length;i++){let a=r[i],o=e[a];n[a]=t(o,a,e)}return n}function D(e){return e===`__proto__`}function O(e,t,n){let r=Object.keys(t);for(let i=0;i<r.length;i++){let a=r[i];if(D(a))continue;let o=t[a],s=e[a],c=n(s,o,a,e,t);c===void 0?Array.isArray(o)?Array.isArray(s)?e[a]=O(s,o,n):e[a]=O([],o,n):E(o)?E(s)?e[a]=O(s,o,n):e[a]=O({},o,n):(s===void 0||o!==void 0)&&(e[a]=o):e[a]=c}return e}function k(e){return Array.isArray(e)}function Wt(e){return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}let Gt=/\p{Lu}?\p{Ll}+|[0-9]+|\p{Lu}+(?!\p{Ll})|\p{Emoji_Presentation}|\p{Extended_Pictographic}|\p{L}+/gu;function A(e){return Array.from(e.match(Gt)??[])}function Kt(e){let t=A(e);if(t.length===0)return``;let[n,...r]=t;return`${n.toLowerCase()}${r.map(e=>Wt(e)).join(``)}`}function qt(e){if(k(e))return e.map(e=>qt(e));if(E(e)){let t={},n=Object.keys(e);for(let r=0;r<n.length;r++){let i=n[r],a=Kt(i);t[a]=qt(e[i])}return t}return e}function Jt(e,t){return O(dt(e),t,function e(t,n){if(Array.isArray(n))return O(Array.isArray(t)?dt(t):[],n,e);if(E(n))return E(t)?O(dt(t),n,e):O({},n,e)})}function j(e){if(typeof e!=`object`||!e)return!1;if(Object.getPrototypeOf(e)===null)return!0;if(Object.prototype.toString.call(e)!==`[object Object]`){let t=e[Symbol.toStringTag];return t==null||!Object.getOwnPropertyDescriptor(e,Symbol.toStringTag)?.writable?!1:e.toString()===`[object ${t}]`}let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function Yt(e){return A(e).map(e=>e.toLowerCase()).join(`_`)}function Xt(e){if(k(e))return e.map(e=>Xt(e));if(j(e)){let t={},n=Object.keys(e);for(let r=0;r<n.length;r++){let i=n[r],a=Yt(i);t[a]=Xt(e[i])}return t}return e}function Zt(e){return e instanceof ArrayBuffer}function Qt(e){return typeof Blob>`u`?!1:e instanceof Blob}function $t(){return typeof window<`u`&&window?.document!=null}function en(e){return e instanceof Date}function tn(e){return E(e)&&Object.keys(e).length===0}function M(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}function nn(e,t,n){return rn(e,t,void 0,void 0,void 0,void 0,n)}function rn(e,t,n,r,i,a,o){let s=o(e,t,n,r,i,a);if(s!==void 0)return s;if(typeof e==typeof t)switch(typeof e){case`bigint`:case`string`:case`boolean`:case`symbol`:case`undefined`:return e===t;case`number`:return e===t||Object.is(e,t);case`function`:return e===t;case`object`:return an(e,t,a,o)}return an(e,t,a,o)}function an(e,t,n,r){if(Object.is(e,t))return!0;let i=S(e),a=S(t);if(i===`[object Arguments]`&&(i=wt),a===`[object Arguments]`&&(a=wt),i!==a)return!1;switch(i){case mt:return e.toString()===t.toString();case ht:return M(e.valueOf(),t.valueOf());case gt:case yt:case vt:return Object.is(e.valueOf(),t.valueOf());case pt:return e.source===t.source&&e.flags===t.flags;case`[object Function]`:return e===t}n??=new Map;let o=n.get(e),s=n.get(t);if(o!=null&&s!=null)return o===t;n.set(e,t),n.set(t,e);try{switch(i){case bt:if(e.size!==t.size)return!1;for(let[i,a]of e.entries())if(!t.has(i)||!rn(a,t.get(i),i,e,t,n,r))return!1;return!0;case xt:{if(e.size!==t.size)return!1;let i=Array.from(e.values()),a=Array.from(t.values());for(let o=0;o<i.length;o++){let s=i[o],c=a.findIndex(i=>rn(s,i,void 0,e,t,n,r));if(c===-1)return!1;a.splice(c,1)}return!0}case St:case Et:case Dt:case Ot:case kt:case`[object BigUint64Array]`:case At:case jt:case Mt:case`[object BigInt64Array]`:case Nt:case Pt:if(C(e)!==C(t)||e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(!rn(e[i],t[i],i,e,t,n,r))return!1;return!0;case Ct:return e.byteLength===t.byteLength?an(new Uint8Array(e),new Uint8Array(t),n,r):!1;case Tt:return e.byteLength!==t.byteLength||e.byteOffset!==t.byteOffset?!1:an(new Uint8Array(e),new Uint8Array(t),n,r);case`[object Error]`:return e.name===t.name&&e.message===t.message;case wt:{if(!(an(e.constructor,t.constructor,n,r)||E(e)&&E(t)))return!1;let i=[...Object.keys(e),...ft(e)],a=[...Object.keys(t),...ft(t)];if(i.length!==a.length)return!1;for(let a=0;a<i.length;a++){let o=i[a],s=e[o];if(!Object.hasOwn(t,o))return!1;let c=t[o];if(!rn(s,c,o,e,t,n,r))return!1}return!0}default:return!1}}finally{n.delete(e),n.delete(t)}}function on(e,t){return nn(e,t,We)}function sn(e){return typeof File>`u`?!1:Qt(e)&&e instanceof File}function N(e){return typeof e==`function`}function cn(e){if(typeof e!=`string`)return!1;try{return JSON.parse(e),!0}catch{return!1}}function ln(e){switch(typeof e){case`object`:return e===null||un(e)||dn(e);case`string`:case`number`:case`boolean`:return!0;default:return!1}}function un(e){return Array.isArray(e)?e.every(e=>ln(e)):!1}function dn(e){if(!E(e))return!1;let t=Reflect.ownKeys(e);for(let n=0;n<t.length;n++){let r=t[n],i=e[r];if(typeof r!=`string`||!ln(i))return!1}return!0}function fn(e){return Number.isSafeInteger(e)&&e>=0}function pn(e){return e instanceof Map}function P(e){return e==null}function mn(){return typeof process<`u`&&process?.versions?.node!=null}function hn(e){return e!=null}function gn(e){return e===null}function _n(e){return e instanceof Promise}function vn(e){return e instanceof RegExp}function yn(e){return e instanceof Set}function bn(e){return typeof e==`symbol`}function xn(e){return e===void 0}function Sn(e){return e instanceof WeakMap}function Cn(e){return e instanceof WeakSet}async function wn(e){let t=Object.keys(e),n=await Promise.all(t.map(t=>e[t])),r={};for(let e=0;e<t.length;e++)r[t[e]]=n[e];return r}var Tn=class{semaphore=new p(1);get isLocked(){return this.semaphore.available===0}async acquire(){return this.semaphore.acquire()}release(){this.semaphore.release()}};async function En(e){throw await $e(e),new Ie}async function Dn(e,t){return Promise.race([e(),En(t)])}function On(e){return A(e).map(e=>e.toUpperCase()).join(`_`)}let kn=new Map([[`Æ`,`Ae`],[`Ð`,`D`],[`Ø`,`O`],[`Þ`,`Th`],[`ß`,`ss`],[`æ`,`ae`],[`ð`,`d`],[`ø`,`o`],[`þ`,`th`],[`Đ`,`D`],[`đ`,`d`],[`Ħ`,`H`],[`ħ`,`h`],[`ı`,`i`],[`IJ`,`IJ`],[`ij`,`ij`],[`ĸ`,`k`],[`Ŀ`,`L`],[`ŀ`,`l`],[`Ł`,`L`],[`ł`,`l`],[`ʼn`,`'n`],[`Ŋ`,`N`],[`ŋ`,`n`],[`Œ`,`Oe`],[`œ`,`oe`],[`Ŧ`,`T`],[`ŧ`,`t`],[`ſ`,`s`]]);function An(e){e=e.normalize(`NFD`);let t=``;for(let n=0;n<e.length;n++){let r=e[n];r>=`̀`&&r<=`ͯ`||r>=`︠`&&r<=`︣`||(t+=kn.get(r)??r)}return t}let jn={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`};function Mn(e){return e.replace(/[&<>"']/g,e=>jn[e])}function Nn(e){return e.replace(/[\\^$.*+?()[\]{}|]/g,`\\$&`)}function Pn(e){return A(e).map(e=>e.toLowerCase()).join(`-`)}function Fn(e){return A(e).map(e=>e.toLowerCase()).join(` `)}function In(e){return e.substring(0,1).toLowerCase()+e.substring(1)}function Ln(e,t,n=` `){return e.padStart(Math.floor((t-e.length)/2)+e.length,n).padEnd(t,n)}function Rn(e){return A(e).map(e=>Wt(e)).join(``)}function zn(e){return[...e].reverse().join(``)}function Bn(e,t){if(t===void 0)return e.trimEnd();let n=e.length;switch(typeof t){case`string`:if(t.length!==1)throw Error(`The 'chars' parameter should be a single character string.`);for(;n>0&&e[n-1]===t;)n--;break;case`object`:for(;n>0&&t.includes(e[n-1]);)n--}return e.substring(0,n)}function Vn(e,t){if(t===void 0)return e.trimStart();let n=0;switch(typeof t){case`string`:for(;n<e.length&&e[n]===t;)n++;break;case`object`:for(;n<e.length&&t.includes(e[n]);)n++}return e.substring(n)}function Hn(e,t){return t===void 0?e.trim():Vn(Bn(e,t),t)}let Un={"&":`&`,"<":`<`,">":`>`,""":`"`,"'":`'`};function Wn(e){return e.replace(/&(?:amp|lt|gt|quot|#(0+)?39);/g,e=>Un[e]||`'`)}function Gn(e){let t=A(e),n=``;for(let e=0;e<t.length;e++)n+=t[e].toUpperCase(),e<t.length-1&&(n+=` `);return n}function Kn(e){return e.substring(0,1).toUpperCase()+e.substring(1)}async function qn(e){try{return[null,await e()]}catch(e){return[e,null]}}function Jn(e,t){if(!e)throw typeof t==`string`?Error(t):t}function Yn(e){return arguments.length===0?[]:Array.isArray(e)?e:[e]}function F(e){return Array.isArray(e)?e:Array.from(e)}function I(e){return e!=null&&typeof e!=`function`&&fn(e.length)}function Xn(e,t=1){return t=Math.max(Math.floor(t),0),t===0||!I(e)?[]:n(F(e),t)}function Zn(e){return I(e)?i(Array.from(e)):[]}function Qn(...e){return g(e)}function $n(e){switch(typeof e){case`number`:case`symbol`:return!1;case`string`:return e.includes(`.`)||e.includes(`[`)||e.includes(`]`)}}function L(e){return typeof e==`string`||typeof e==`symbol`?e:Object.is(e?.valueOf?.(),-0)?`-0`:String(e)}function R(e){if(e==null)return``;if(typeof e==`string`)return e;if(Array.isArray(e))return e.map(R).join(`,`);let t=String(e);return t===`0`&&Object.is(Number(e),-0)?`-0`:t}function z(e){if(Array.isArray(e))return e.map(L);if(typeof e==`symbol`)return[e];e=R(e);let t=[],n=e.length;if(n===0)return t;let r=0,i=``,a=``,o=!1;for(e.charCodeAt(0)===46&&(t.push(``),r++);r<n;){let s=e[r];a?s===`\\`&&r+1<n?(r++,i+=e[r]):s===a?a=``:i+=s:o?s===`"`||s===`'`?a=s:s===`]`?(o=!1,t.push(i),i=``):i+=s:s===`[`?(o=!0,i&&=(t.push(i),``)):s===`.`?i&&=(t.push(i),``):i+=s,r++}return i&&t.push(i),t}function B(e,t,n){if(e==null)return n;switch(typeof t){case`string`:{if(D(t))return n;let r=e[t];return r===void 0?$n(t)?B(e,z(t),n):n:r}case`number`:case`symbol`:{typeof t==`number`&&(t=L(t));let r=e[t];return r===void 0?n:r}default:{if(Array.isArray(t))return er(e,t,n);if(t=Object.is(t?.valueOf(),-0)?`-0`:String(t),D(t))return n;let r=e[t];return r===void 0?n:r}}}function er(e,t,n){if(t.length===0)return n;let r=e;for(let e=0;e<t.length;e++){if(r==null||D(t[e]))return n;r=r[t[e]]}return r===void 0?n:r}function V(e){return function(t){return B(t,e)}}function H(e){return e!==null&&(typeof e==`object`||typeof e==`function`)}function tr(e,t,n){return typeof n==`function`?nr(e,t,function e(t,r,i,a,o,s){let c=n(t,r,i,a,o,s);return c===void 0?nr(t,r,e,s):!!c},new Map):tr(e,t,()=>void 0)}function nr(e,t,n,r){if(t===e)return!0;switch(typeof t){case`object`:return rr(e,t,n,r);case`function`:return Object.keys(t).length>0?nr(e,{...t},n,r):M(e,t);default:return H(e)?typeof t==`string`?t===``:!0:M(e,t)}}function rr(e,t,n,r){if(t==null)return!0;if(Array.isArray(t))return ar(e,t,n,r);if(t instanceof Map)return ir(e,t,n,r);if(t instanceof Set)return or(e,t,n,r);let i=Object.keys(t);if(e==null||lt(e))return i.length===0;if(i.length===0)return!0;if(r?.has(t))return r.get(t)===e;r?.set(t,e);try{for(let a=0;a<i.length;a++){let o=i[a];if(!lt(e)&&!(o in e)||t[o]===void 0&&e[o]!==void 0||t[o]===null&&e[o]!==null||!n(e[o],t[o],o,e,t,r))return!1}return!0}finally{r?.delete(t)}}function ir(e,t,n,r){if(t.size===0)return!0;if(!(e instanceof Map))return!1;for(let[i,a]of t.entries())if(n(e.get(i),a,i,e,t,r)===!1)return!1;return!0}function ar(e,t,n,r){if(t.length===0)return!0;if(!Array.isArray(e))return!1;let i=new Set;for(let a=0;a<t.length;a++){let o=t[a],s=!1;for(let c=0;c<e.length;c++){if(i.has(c))continue;let l=e[c],u=!1;if(n(l,o,a,e,t,r)&&(u=!0),u){i.add(c),s=!0;break}}if(!s)return!1}return!0}function or(e,t,n,r){return t.size===0?!0:e instanceof Set?ar([...e],[...t],n,r):!1}function sr(e,t){return tr(e,t,()=>void 0)}function U(e){return e=Lt(e),t=>sr(t,e)}function cr(e,t){return Ft(e,(n,r,i,a)=>{let o=t?.(n,r,i,a);if(o!==void 0)return o;if(typeof e==`object`){if(S(e)===`[object Object]`&&typeof e.constructor!=`function`){let t={};return a.set(e,t),T(t,e,i,a),t}switch(Object.prototype.toString.call(e)){case ht:case mt:case gt:{let t=new e.constructor(e?.valueOf());return T(t,e),t}case _t:{let t={};return T(t,e),t.length=e.length,t[Symbol.iterator]=e[Symbol.iterator],t}default:return}}})}function lr(e){return cr(e)}let ur=/^(?:0|[1-9]\d*)$/;function dr(e,t=2**53-1){switch(typeof e){case`number`:return Number.isInteger(e)&&e>=0&&e<t;case`symbol`:return!1;case`string`:return ur.test(e)}}function fr(e){return typeof e==`object`&&!!e&&S(e)===`[object Arguments]`}function pr(e,t){let n;if(n=Array.isArray(t)?t:typeof t==`string`&&$n(t)&&e?.[t]==null?z(t):[t],n.length===0)return!1;let r=e;for(let e=0;e<n.length;e++){let t=n[e];if((r==null||!Object.hasOwn(r,t))&&!((Array.isArray(r)||fr(r))&&dr(t)&&t<r.length))return!1;r=r[t]}return!0}function W(e,t){switch(typeof e){case`object`:Object.is(e?.valueOf(),-0)&&(e=`-0`);break;case`number`:e=L(e);break}return t=lr(t),function(n){let r=B(n,e);return r===void 0?pr(n,e):t===void 0?r===void 0:sr(r,t)}}function G(e){if(e==null)return x;switch(typeof e){case`function`:return e;case`object`:return Array.isArray(e)&&e.length===2?W(e[0],e[1]):U(e);case`string`:case`symbol`:case`number`:return V(e)}}function mr(e,t){if(e==null)return{};let n=I(e)?Array.from(e):Object.values(e),r=G(t??void 0),i=Object.create(null);for(let e=0;e<n.length;e++){let t=n[e],a=r(t);i[a]=(i[a]??0)+1}return i}function K(e){return typeof e==`object`&&!!e}function q(e){return K(e)&&I(e)}function hr(e,...t){if(!q(e))return[];let n=F(e),r=[];for(let e=0;e<t.length;e++){let n=t[e];q(n)&&r.push(...Array.from(n))}return a(n,r)}function J(e){if(I(e))return ue(F(e))}function gr(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n];if(q(r))for(let e=0;e<r.length;e++)t.push(r[e])}return t}function _r(e,...t){if(!q(e))return[];let n=J(t),r=gr(t);return q(n)?a(Array.from(e),r):o(Array.from(e),r,G(n))}function vr(e,...t){if(!q(e))return[];let n=J(t),r=gr(t);return typeof n==`function`?s(Array.from(e),r,n):a(Array.from(e),r)}function yr(e,t=1,n){return I(e)?(t=n?1:b(t),c(F(e),t)):[]}function br(e,t=1,n){return I(e)?(t=n?1:b(t),l(F(e),t)):[]}function xr(e,t=x){return I(e)?Sr(Array.from(e),t):[]}function Sr(e,t){switch(typeof t){case`function`:return u(e,(e,n,r)=>!!t(e,n,r));case`object`:if(Array.isArray(t)&&t.length===2){let n=t[0],r=t[1];return u(e,W(n,r))}else return u(e,U(t));case`symbol`:case`number`:case`string`:return u(e,V(t))}}function Cr(e,t=x){return I(e)?wr(F(e),t):[]}function wr(e,t){switch(typeof t){case`function`:return d(e,(e,n,r)=>!!t(e,n,r));case`object`:if(Array.isArray(t)&&t.length===2){let n=t[0],r=t[1];return d(e,W(n,r))}else return d(e,U(t));case`number`:case`symbol`:case`string`:return d(e,V(t))}}function Tr(e,t=x){if(!e)return e;let n=I(e)||Array.isArray(e)?ct(0,e.length):Object.keys(e);for(let r=0;r<n.length;r++){let i=n[r],a=e[i];if(t(a,i,e)===!1)break}return e}function Er(e,t=x){if(!e)return e;let n=I(e)?ct(0,e.length):Object.keys(e);for(let r=n.length-1;r>=0;r--){let i=n[r],a=e[i];if(t(a,i,e)===!1)break}return e}function Y(e,t,n){return H(n)&&(typeof t==`number`&&I(n)&&dr(t)&&t<n.length||typeof t==`string`&&t in n)?M(n[t],e):!1}function Dr(e,t,n){if(!e)return!0;n&&Y(e,t,n)&&(t=void 0),t||=x;let r;switch(typeof t){case`function`:r=t;break;case`object`:if(Array.isArray(t)&&t.length===2){let e=t[0],n=t[1];r=W(e,n)}else r=U(t);break;case`symbol`:case`number`:case`string`:r=V(t)}if(!I(e)){let t=Object.keys(e);for(let n=0;n<t.length;n++){let i=t[n],a=e[i];if(!r(a,i,e))return!1}return!0}for(let t=0;t<e.length;t++)if(!r(e[t],t,e))return!1;return!0}function Or(e){return typeof e==`string`||e instanceof String}function kr(e,t,n=0,r=e?e.length:0){return I(e)?Or(e)?e:(n=Math.floor(n),r=Math.floor(r),n||=0,r||=0,f(e,t,n,r)):[]}function Ar(e,t=x){if(!e)return[];if(t=G(t),!Array.isArray(e)){let n=[],r=Object.keys(e),i=I(e)?e.length:r.length;for(let a=0;a<i;a++){let i=r[a],o=e[i];t(o,i,e)&&n.push(o)}return n}let n=[],r=e.length;for(let i=0;i<r;i++){let r=e[i];t(r,i,e)&&n.push(r)}return n}function jr(e,t=x,n=0){if(!e)return;n<0&&(n=Math.max(e.length+n,0));let r=G(t);if(!Array.isArray(e)){let t=Object.keys(e);for(let i=n;i<t.length;i++){let n=t[i],a=e[n];if(r(a,n,e))return a}return}return e.slice(n).find(r)}function X(e){return e}function Mr(e,t=X,n=0){if(!e)return-1;n<0&&(n=Math.max(e.length+n,0));let r=Array.from(e).slice(n),i=-1;switch(typeof t){case`function`:i=r.findIndex(t);break;case`object`:if(Array.isArray(t)&&t.length===2){let e=t[0],n=t[1];i=r.findIndex(W(e,n))}else i=r.findIndex(U(t));break;case`number`:case`symbol`:case`string`:i=r.findIndex(V(t))}return i===-1?-1:i+n}function Nr(e,t=x,n){if(!e)return;let r=Array.isArray(e)?e.length:Object.keys(e).length;n=b(n??r-1),n=n<0?Math.max(r+n,0):Math.min(n,r-1);let i=G(t);if(!Array.isArray(e)){let t=Object.keys(e);for(let r=n;r>=0;r--){let n=t[r],a=e[n];if(i(a,n,e))return a}return}return e.slice(0,n+1).findLast(i)}function Pr(e,t=x,n=e?e.length-1:0){if(!e)return-1;n=n<0?Math.max(e.length+n,0):Math.min(n,e.length-1);let r=F(e).slice(0,n+1);switch(typeof t){case`function`:return r.findLastIndex(t);case`object`:if(Array.isArray(t)&&t.length===2){let e=t[0],n=t[1];return r.findLastIndex(W(e,n))}else return r.findLastIndex(U(t));case`number`:case`symbol`:case`string`:return r.findLastIndex(V(t))}}function Fr(e){if(I(e))return re(F(e))}function Ir(e,t=1){let n=[],r=Math.floor(t);if(!I(e))return n;let i=(e,t)=>{for(let a=0;a<e.length;a++){let o=e[a];t<r&&(Array.isArray(o)||o?.[Symbol.isConcatSpreadable]||typeof o==`object`&&o&&Object.prototype.toString.call(o)===`[object Arguments]`)?i(Array.isArray(o)?o:Array.from(o),t+1):n.push(o)}};return i(Array.from(e),0),n}function Lr(e,t=1){return Ir(e,t)}function Rr(e,t){if(!e)return[];let n=I(e)||Array.isArray(e)?ct(0,e.length):Object.keys(e),r=G(t??x),i=Array(n.length);for(let t=0;t<n.length;t++){let a=n[t],o=e[a];i[t]=r(o,a,e)}return i}function zr(e,t){return P(e)?[]:Lr(P(t)?Rr(e):Rr(e,t),1)}function Br(e,t=x,n=1){return e==null?[]:Ir(Rr(e,G(t)),n)}function Vr(e,t){return Br(e,t,1/0)}function Hr(e){return Lr(e,1/0)}function Ur(e,t){return e==null?{}:ne(I(e)?Array.from(e):Object.values(e),G(t??x))}function Wr(e,t,n,r){if(e==null)return!1;if(n=r||!n?0:b(n),Or(e))return n>e.length||t instanceof RegExp?!1:(n<0&&(n=Math.max(0,e.length+n)),e.includes(t,n));if(Array.isArray(e))return e.includes(t,n);let i=Object.keys(e);n<0&&(n=Math.max(0,i.length+n));for(let r=n;r<i.length;r++)if(M(Reflect.get(e,i[r]),t))return!0;return!1}function Gr(e,t,n){if(!I(e))return-1;if(Number.isNaN(t)){n??=0,n<0&&(n=Math.max(0,e.length+n));for(let t=n;t<e.length;t++)if(Number.isNaN(e[t]))return t;return-1}return Array.from(e).indexOf(t,n)}function Kr(e){return I(e)?ie(Array.from(e)):[]}function qr(...e){if(e.length===0||!q(e[0]))return[];let t=Ee(Array.from(e[0]));for(let n=1;n<e.length;n++){let r=e[n];if(!q(r))return[];t=ae(t,Array.from(r))}return t}function Jr(e,...t){if(!q(e))return[];let n=ue(t);if(n===void 0)return Array.from(e);let r=Ee(Array.from(e)),i=q(n)?t.length:t.length-1;for(let e=0;e<i;++e){let i=t[e];if(!q(i))return[];q(n)?r=oe(r,Array.from(i),x):typeof n==`function`?r=oe(r,Array.from(i),e=>n(e)):typeof n==`string`&&(r=oe(r,Array.from(i),V(n)))}return r}function Yr(e){return I(e)?Ee(Array.from(e)):[]}function Xr(e,...t){if(e==null)return[];let n=J(t),r=M,i=Yr;typeof n==`function`&&(r=n,i=Zr,t.pop());let a=i(Array.from(e));for(let e=0;e<t.length;++e){let n=t[e];if(n==null)return[];a=se(a,Array.from(n),r)}return a}function Zr(e){let t=[],n=new Set;for(let r=0;r<e.length;r++){let i=e[r];n.has(i)||(t.push(i),n.add(i))}return t}function Qr(e,t,...n){if(P(e))return[];let r=I(e)?Array.from(e):Object.values(e),i=[];for(let e=0;e<r.length;e++){let a=r[e];if(N(t)){i.push(t.apply(a,n));continue}let o=B(a,t),s=a;if(Array.isArray(t)){let e=t.slice(0,-1);e.length>0&&(s=B(a,e))}else typeof t==`string`&&t.includes(`.`)&&(s=B(a,t.split(`.`).slice(0,-1).join(`.`)));i.push(o?.apply(s,n))}return i}function $r(e,t){return I(e)?Array.from(e).join(t):``}function ei(e,t=x,n){if(!e)return n;let r,i=0;I(e)?(r=ct(0,e.length),n==null&&e.length>0&&(n=e[0],i+=1)):(r=Object.keys(e),n??(n=e[r[0]],i+=1));for(let a=i;a<r.length;a++){let i=r[a],o=e[i];n=t(n,o,i,e)}return n}function ti(e,t){if(!I(e)&&!K(e))return{};let n=G(t??x);return ei(e,(e,t)=>{let r=n(t);return e[r]=t,e},{})}function ni(e,t,n){if(!I(e)||e.length===0)return-1;let r=e.length,i=n??r-1;if(n!=null&&(i=i<0?Math.max(r+i,0):Math.min(i,r-1)),Number.isNaN(t)){for(let t=i;t>=0;t--)if(Number.isNaN(e[t]))return t}return Array.from(e).lastIndexOf(t,i)}function ri(e,t=0){if(!(!q(e)||e.length===0))return t=b(t),t<0&&(t+=e.length),e[t]}function ii(e){return typeof e==`symbol`?1:e===null?2:e===void 0?3:e===e?0:4}let ai=(e,t,n)=>{if(e!==t){let r=ii(e),i=ii(t);if(r===i&&r===0){if(e<t)return n===`desc`?1:-1;if(e>t)return n===`desc`?-1:1}return n===`desc`?i-r:r-i}return 0},oi=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,si=/^\w*$/;function ci(e,t){return Array.isArray(e)?!1:typeof e==`number`||typeof e==`boolean`||e==null||_(e)?!0:typeof e==`string`&&(si.test(e)||!oi.test(e))||t!=null&&Object.hasOwn(t,e)}function li(e,t,n,r){if(e==null)return[];n=r?void 0:n,Array.isArray(e)||(e=Object.values(e)),Array.isArray(t)||(t=t==null?[null]:[t]),t.length===0&&(t=[null]),Array.isArray(n)||(n=n==null?[]:[n]),n=n.map(e=>String(e));let i=(e,t)=>{let n=e;for(let e=0;e<t.length&&n!=null;++e)n=n[t[e]];return n},a=(e,t)=>t==null||e==null?t:typeof e==`object`&&`key`in e?Object.hasOwn(t,e.key)?t[e.key]:i(t,e.path):typeof e==`function`?e(t):Array.isArray(e)?i(t,e):typeof t==`object`?t[e]:t,o=t.map(e=>(Array.isArray(e)&&e.length===1&&(e=e[0]),e==null||typeof e==`function`||Array.isArray(e)||ci(e)?e:{key:e,path:z(e)}));return e.map(e=>({original:e,criteria:o.map(t=>a(t,e))})).slice().sort((e,t)=>{for(let r=0;r<o.length;r++){let i=ai(e.criteria[r],t.criteria[r],n[r]);if(i!==0)return i}return 0}).map(e=>e.original)}function ui(e,t=x){if(!e)return[[],[]];let n=I(e)?e:Object.values(e);t=G(t);let r=[],i=[];for(let e=0;e<n.length;e++){let a=n[e];t(a)?r.push(a):i.push(a)}return[r,i]}function di(e,...t){return me(e,t)}function fi(e,t=[]){return me(e,Array.from(t))}function pi(e,t,n){let r=G(n),i=new Set(Array.from(t).map(e=>r(e))),a=0;for(let t=0;t<e.length;t++){let n=r(e[t]);if(!i.has(n)){if(!Object.hasOwn(e,t)){delete e[a++];continue}e[a++]=e[t]}}return e.length=a,e}function mi(e,t){let n=e.length;t??=Array(n);for(let r=0;r<n;r++)t[r]=e[r];return t}function hi(e,t,n){if(e?.length==null||t?.length==null)return e;e===t&&(t=mi(t));let r=0;n??=(e,t)=>M(e,t);let i=Array.isArray(t)?t:Array.from(t),a=i.includes(void 0);for(let t=0;t<e.length;t++){if(t in e){i.some(r=>n(e[t],r))||(e[r++]=e[t]);continue}a||delete e[r++]}return e.length=r,e}function gi(e,...t){if(t.length===0)return[];let n=[];for(let e=0;e<t.length;e++){let r=t[e];if(!I(r)||Or(r)){n.push(r);continue}for(let e=0;e<r.length;e++)n.push(r[e])}let r=[];for(let t=0;t<n.length;t++)r.push(B(e,n[t]));return r}function _i(e,t){if(e==null)return!0;switch(typeof t){case`symbol`:case`number`:case`object`:if(Array.isArray(t))return vi(e,t);if(typeof t==`number`?t=L(t):typeof t==`object`&&(t=Object.is(t?.valueOf(),-0)?`-0`:String(t)),D(t))return!1;if(e?.[t]===void 0)return!0;try{return delete e[t],!0}catch{return!1}case`string`:if(e?.[t]===void 0&&$n(t))return vi(e,z(t));if(D(t))return!1;try{return delete e[t],!0}catch{return!1}}}function vi(e,t){let n=t.length===1?e:B(e,t.slice(0,-1)),r=t[t.length-1];if(n?.[r]===void 0)return!0;if(D(r))return!1;try{return delete n[r],!0}catch{return!1}}function yi(e,...t){let n=Lr(t,1);if(!e)return Array(n.length);let r=gi(e,n),i=n.map(t=>dr(t,e.length)?Number(t):t).sort((e,t)=>t-e);for(let t of new Set(i)){if(dr(t,e.length)){Array.prototype.splice.call(e,t,1);continue}if(ci(t,e)){delete e[L(t)];continue}_i(e,k(t)?t:z(t))}return r}function bi(e,t=x,n){if(!e)return n;let r,i;I(e)?(r=ct(0,e.length).reverse(),n==null&&e.length>0?(n=e[e.length-1],i=1):i=0):(r=Object.keys(e).reverse(),n==null?(n=e[r[0]],i=1):i=0);for(let a=i;a<r.length;a++){let i=r[a],o=e[i];n=t(n,o,i,e)}return n}function xi(e){if(typeof e!=`function`)throw TypeError(`Expected a function`);return function(...t){return!e.apply(this,t)}}function Si(e,t=x){return Ar(e,xi(G(t)))}function Ci(e,t=x){return ge(e,G(t))}function wi(e){return e==null?e:e.reverse()}function Ti(e){if(e!=null)return I(e)?_e(F(e)):_e(Object.values(e))}function Ei(e,t,n){return n===void 0&&(n=t,t=void 0),n!==void 0&&(n=v(n),e=Math.min(e,Number.isNaN(n)?0:n)),t!==void 0&&(t=v(t),e=Math.max(e,Number.isNaN(t)?0:t)),e}function Di(e){return pn(e)}function Oi(e){return e==null?[]:I(e)||Di(e)?Array.from(e):typeof e==`object`?Object.values(e):[]}function ki(e,t,n){let r=Oi(e);return t=(n?Y(e,t,n):t===void 0)?1:Ei(b(t),0,r.length),be(r,t)}function Ai(e){return e==null?[]:Object.values(e)}function ji(e){return e==null}function Mi(e){return ji(e)?[]:k(e)?xe(e):I(e)?xe(Array.from(e)):K(e)?xe(Ai(e)):[]}function Ni(e){return P(e)?0:e instanceof Map||e instanceof Set?e.size:Object.keys(e).length}function Pi(e,t,n){if(!I(e))return[];let r=e.length;n===void 0?n=r:typeof n!=`number`&&Y(e,t,n)&&(t=0,n=r),t=b(t),n=b(n),t=t<0?Math.max(r+t,0):Math.min(t,r),n=n<0?Math.max(r+n,0):Math.min(n,r);let i=Math.max(n-t,0),a=Array(i);for(let n=0;n<i;++n)a[n]=e[t+n];return a}function Fi(e,t,n){if(!e)return!1;n!=null&&(t=void 0),t??=x;let r=Array.isArray(e)?e:Object.values(e);switch(typeof t){case`function`:if(!Array.isArray(e)){let n=Object.keys(e);for(let r=0;r<n.length;r++){let i=n[r],a=e[i];if(t(a,i,e))return!0}return!1}for(let n=0;n<e.length;n++)if(t(e[n],n,e))return!0;return!1;case`object`:if(Array.isArray(t)&&t.length===2){let n=t[0],i=t[1],a=W(n,i);if(Array.isArray(e)){for(let t=0;t<e.length;t++)if(a(e[t]))return!0;return!1}return r.some(a)}else{let n=U(t);if(Array.isArray(e)){for(let t=0;t<e.length;t++)if(n(e[t]))return!0;return!1}return r.some(n)}case`number`:case`symbol`:case`string`:{let n=V(t);if(Array.isArray(e)){for(let t=0;t<e.length;t++)if(n(e[t]))return!0;return!1}return r.some(n)}}}function Ii(e,...t){let n=t.length;return n>1&&Y(e,t[0],t[1])?t=[]:n>2&&Y(t[0],t[1],t[2])&&(t=[t[0]]),li(e,g(t),[`asc`])}function Li(e){return Number.isNaN(e)}function Ri(e,t,n=X,r){if(ji(e)||e.length===0)return 0;let i=0,a=e.length,o=G(n),s=o(t),c=Li(s),l=gn(s),u=_(s),d=xn(s);for(;i<a;){let t,n=Math.floor((i+a)/2),f=o(e[n]),p=!xn(f),m=gn(f),h=!Li(f),g=_(f);t=c?r||h:d?h&&(r||p):l?h&&p&&(r||!m):u?h&&p&&!m&&(r||!g):m||g?!1:r?f<=s:f<s,t?i=n+1:a=n}return Math.min(a,4294967294)}function zi(e){return typeof e==`number`||e instanceof Number}function Bi(e,t){if(P(e))return 0;let n=0,r=e.length;if(zi(t)&&t===t&&r<=2147483647){for(;n<r;){let i=n+r>>>1,a=e[i];!gn(a)&&!bn(a)&&a<t?n=i+1:r=i}return r}return Ri(e,t,e=>e)}function Vi(e,t){if(!e?.length)return-1;let n=Bi(e,t);return n<e.length&&M(e[n],t)?n:-1}function Hi(e,t,n){return Ri(e,t,n,!0)}function Ui(e,t){if(P(e))return 0;let n=e.length;if(!zi(t)||Number.isNaN(t)||n>2147483647)return Hi(e,t,e=>e);let r=0;for(;r<n;){let i=r+n>>>1,a=e[i];!gn(a)&&!bn(a)&&a<=t?r=i+1:n=i}return n}function Wi(e,t){if(!e?.length)return-1;let n=Ui(e,t)-1;return n>=0&&M(e[n],t)?n:-1}function Gi(e){return I(e)?Se(F(e)):[]}function Ki(e,t=1,n){return t=n?1:b(t),t<1||!I(e)?[]:Ce(F(e),t)}function qi(e,t=1,n){return t=n?1:b(t),t<=0||!I(e)?[]:we(F(e),t)}function Ji(e,t){if(!q(e))return[];let n=F(e),r=n.findLastIndex(Ue(G(t??x)));return n.slice(r+1)}function Yi(e,t){if(!q(e))return[];let n=F(e),r=n.findIndex(xi(G(t??X)));return r===-1?n:n.slice(0,r)}function Xi(...e){return Ee(Br(e.filter(q),e=>Array.from(e),1))}function Zi(...e){let t=ue(e),n=gr(e);return q(t)||t==null?Ee(n):De(n,Re(G(t),1))}function Qi(...e){let t=ue(e),n=gr(e);return q(t)||t==null?Ee(n):Oe(n,t)}function $i(e,t=x){return q(e)?De(Array.from(e),Re(G(t),1)):[]}function ea(e,t){return I(e)?typeof t==`function`?Oe(Array.from(e),t):Yr(Array.from(e)):[]}function ta(e){return!q(e)||!e.length?[]:(e=k(e)?e:Array.from(e),e=e.filter(e=>q(e)),ke(e))}function na(e,t){if(!q(e)||!e.length)return[];let n=k(e)?ke(e):ke(Array.from(e,e=>Array.from(e)));if(!t)return n;let r=Array(n.length);for(let e=0;e<n.length;e++){let i=n[e];r[e]=t(...i)}return r}function ra(e,...t){return q(e)?je(Array.from(e),...t):[]}function ia(...e){let t=new Map;for(let n=0;n<e.length;n++){let r=e[n];if(!q(r))continue;let i=new Set(Oi(r));for(let e of i)t.has(e)?t.set(e,t.get(e)+1):t.set(e,1)}let n=[];for(let[e,r]of t)r===1&&n.push(e);return n}function aa(...e){let t=J(e),n=x;!q(t)&&t!=null&&(n=G(t),e=e.slice(0,-1));let r=e.filter(q);return _r(Zi(...r,n),Zi(...Ae(r,2).map(([e,t])=>Jr(e,t,n)),n),n)}function oa(...e){let t=J(e),n=(e,t)=>e===t;typeof t==`function`&&(n=t,e=e.slice(0,-1));let r=e.filter(q);return vr(Qi(...r,n),Qi(...Ae(r,2).map(([e,t])=>Xr(e,t,n)),n),n)}function sa(...e){return e.length?Me(...e.filter(e=>q(e))):[]}let ca=(e,t,n)=>{let r=e[t];(!(Object.hasOwn(e,t)&&M(r,n))||n===void 0&&!(t in e))&&(e[t]=n)};function la(e=[],t=[]){let n={};for(let r=0;r<e.length;r++)ca(n,e[r],t[r]);return n}function ua(e,t,n,r){if(e==null&&!H(e))return e;let i;i=ci(t,e)?[t]:Array.isArray(t)?t:z(t);let a=n(B(e,i)),o=e;for(let t=0;t<i.length&&o!=null;t++){let n=L(i[t]);if(D(n))continue;let s;if(t===i.length-1)s=a;else{let a=o[n],c=r?.(a,n,e);s=c===void 0?H(a)?a:dr(i[t+1])?[]:{}:c}ca(o,n,s),o=o[n]}return e}function da(e,t,n){return ua(e,t,()=>n,()=>void 0)}function fa(e,t){let n={};if(!I(e))return n;I(t)||(t=[]);let r=Me(Array.from(e),Array.from(t));for(let e=0;e<r.length;e++){let[t,i]=r[e];t!=null&&da(n,t,i)}return n}function pa(...e){let t=e.pop();if(N(t)||(e.push(t),t=void 0),!e?.length)return[];let n=ta(e);return t==null?n:n.map(e=>t(...e))}function ma(e,t){if(typeof t!=`function`)throw TypeError(`Expected a function`);return e=b(e),function(...n){if(--e<1)return t.apply(this,n)}}function ha(e,t=e.length,n){return n&&(t=e.length),(Number.isNaN(t)||t<0)&&(t=0),Re(e,t)}function ga(e,...t){try{return e(...t)}catch(e){return e instanceof Error?e:Error(e)}}function _a(e,t){if(typeof t!=`function`)throw TypeError(`Expected a function`);let n;return e=b(e),function(...r){return--e>0&&(n=t.apply(this,r)),e<=1&&t&&(t=void 0),n}}function va(e,t,...n){let r=function(...i){let a=[],o=0;for(let e=0;e<n.length;e++){let t=n[e];t===va.placeholder?a.push(i[o++]):a.push(t)}for(let e=o;e<i.length;e++)a.push(i[e]);return this instanceof r?new e(...a):e.apply(t,a)};return r}va.placeholder=Symbol(`bind.placeholder`);function ya(e,t,...n){let r=function(...i){let a=[],o=0;for(let e=0;e<n.length;e++){let t=n[e];t===ya.placeholder?a.push(i[o++]):a.push(t)}for(let e=o;e<i.length;e++)a.push(i[e]);return this instanceof r?new e[t](...a):e[t].apply(e,a)};return r}ya.placeholder=Symbol(`bindKey.placeholder`);function ba(e,t=e.length,n){t=n?e.length:t,t=Number.parseInt(t,10),(Number.isNaN(t)||t<1)&&(t=0);let r=function(...n){let i=n.filter(e=>e===ba.placeholder),a=n.length-i.length;return a<t?xa(e,t-a,n):this instanceof r?new e(...n):e.apply(this,n)};return r.placeholder=Ca,r}function xa(e,t,n){function r(...i){let a=i.filter(e=>e===ba.placeholder),o=i.length-a.length;return i=Sa(i,n),o<t?xa(e,t-o,i):this instanceof r?new e(...i):e.apply(this,i)}return r.placeholder=Ca,r}function Sa(e,t){let n=[],r=0;for(let i=0;i<t.length;i++){let a=t[i];a===ba.placeholder&&r<e.length?n.push(e[r++]):n.push(a)}for(let t=r;t<e.length;t++)n.push(e[t]);return n}let Ca=Symbol(`curry.placeholder`);ba.placeholder=Ca;function wa(e,t=e.length,n){t=n?e.length:t,t=Number.parseInt(t,10),(Number.isNaN(t)||t<1)&&(t=0);let r=function(...n){let i=n.filter(e=>e===wa.placeholder),a=n.length-i.length;return a<t?Ta(e,t-a,n):this instanceof r?new e(...n):e.apply(this,n)};return r.placeholder=Da,r}function Ta(e,t,n){function r(...i){let a=i.filter(e=>e===wa.placeholder),o=i.length-a.length;return i=Ea(i,n),o<t?Ta(e,t-o,i):this instanceof r?new e(...i):e.apply(this,i)}return r.placeholder=Da,r}function Ea(e,t){let n=t.filter(e=>e===wa.placeholder).length,r=Math.max(e.length-n,0),i=[],a=0;for(let t=0;t<r;t++)i.push(e[a++]);for(let n=0;n<t.length;n++){let r=t[n];r===wa.placeholder&&a<e.length?i.push(e[a++]):i.push(r)}return i}let Da=Symbol(`curryRight.placeholder`);wa.placeholder=Da;function Oa(e,t=0,n={}){typeof n!=`object`&&(n={});let{leading:r=!1,trailing:i=!0,maxWait:a}=n,o=[,,];r&&(o[0]=`leading`),i&&(o[1]=`trailing`);let s,c=null,l=Be(function(...t){s=e.apply(this,t),c=null},t,{edges:o}),u=function(...t){return a!=null&&(c===null&&(c=Date.now()),Date.now()-c>=a)?(s=e.apply(this,t),c=Date.now(),l.cancel(),l.schedule(),s):(l.apply(this,t),s)};return u.cancel=l.cancel,u.flush=()=>(l.flush(),s),u}function ka(e,...t){if(typeof e!=`function`)throw TypeError(`Expected a function`);return setTimeout(e,1,...t)}function Aa(e,t,...n){if(typeof e!=`function`)throw TypeError(`Expected a function`);return setTimeout(e,v(t)||0,...n)}function ja(e){return function(...t){return e.apply(this,t.reverse())}}function Ma(...e){let t=g(e,1);if(t.some(e=>typeof e!=`function`))throw TypeError(`Expected a function`);return Ve(...t)}function Na(...e){let t=g(e,1);if(t.some(e=>typeof e!=`function`))throw TypeError(`Expected a function`);return He(...t)}function Pa(e,t){if(typeof e!=`function`||t!=null&&typeof t!=`function`)throw TypeError(`Expected a function`);let n=function(...r){let i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);let o=e.apply(this,r);return n.cache=a.set(i,o)||a,o};return n.cache=new(Pa.Cache||Map),n}Pa.Cache=Map;function Fa(e=0){return function(...t){return t.at(b(e))}}function Ia(e){return Ge(e)}function La(e,...t){if(typeof e!=`function`)throw TypeError(`Expected a function`);let n=t.flat();return function(...t){let r=Math.min(t.length,n.length),i=[...t];for(let e=0;e<r;e++)i[e]=G(n[e]??x).call(this,t[e]);return e.apply(this,i)}}function Ra(e,...t){return qe(e,Ra.placeholder,...t)}Ra.placeholder=Symbol(`compat.partial.placeholder`);function za(e,...t){return Xe(e,za.placeholder,...t)}za.placeholder=Symbol(`compat.partialRight.placeholder`);function Ba(e,...t){let n=Ir(t);return function(...t){let r=n.map(e=>t[e]).slice(0,t.length);for(let e=r.length;e<t.length;e++)r.push(t[e]);return e.apply(this,r)}}function Va(e,t=e.length-1){return t=Number.parseInt(t,10),(Number.isNaN(t)||t<0)&&(t=e.length-1),Qe(e,t)}function Ha(e,t=0){return t=Number.parseInt(t,10),(Number.isNaN(t)||t<0)&&(t=0),function(...n){let r=n[t],i=n.slice(0,t);return r&&i.push(...r),e.apply(this,i)}}function Ua(e,t=0,n={}){let{leading:r=!0,trailing:i=!0}=n;return Oa(e,t,{leading:r,maxWait:t,trailing:i})}function Wa(e){return ha(e,1)}function Ga(e,t){return function(...n){return(N(t)?t:x).apply(this,[e,...n])}}function Ka(e,t){return e===void 0&&t===void 0?0:e===void 0||t===void 0?e??t:(typeof e==`string`||typeof t==`string`?(e=R(e),t=R(t)):(e=v(e),t=v(t)),e+t)}function qa(e,t,n=0){if(t=Number(t),Object.is(t,-0)&&(t=`-0`),n=Math.min(Number.parseInt(n,10),292),n){let[r,i=0]=t.toString().split(`e`),a=Math[e](Number(`${r}e${Number(i)+n}`));Object.is(a,-0)&&(a=`-0`);let[o,s=0]=a.toString().split(`e`);return Number(`${o}e${Number(s)-n}`)}return Math[e](Number(t))}function Ja(e,t=0){return qa(`ceil`,e,t)}function Ya(e,t){return e===void 0&&t===void 0?1:e===void 0||t===void 0?e??t:(typeof e==`string`||typeof t==`string`?(e=R(e),t=R(t)):(e=v(e),t=v(t)),e/t)}function Xa(e,t=0){return qa(`floor`,e,t)}function Za(e,t,n){return t||=0,n!=null&&!n&&(n=0),t!=null&&typeof t!=`number`&&(t=Number(t)),n==null&&t===0||(n!=null&&typeof n!=`number`&&(n=Number(n)),n!=null&&t>n&&([t,n]=[n,t]),t===n)?!1:nt(e,t,n)}function Qa(e){if(!e||e.length===0)return;let t;for(let n=0;n<e.length;n++){let r=e[n];r==null||Number.isNaN(r)||typeof r==`symbol`||(t===void 0||r>t)&&(t=r)}return t}function $a(e,t){if(e!=null)return fe(Array.from(e),G(t??x))}function eo(e,t){if(!e||!e.length)return 0;t!=null&&(t=G(t));let n;for(let r=0;r<e.length;r++){let i=t?t(e[r]):e[r];i!==void 0&&(n===void 0?n=i:n+=i)}return n}function to(e){return eo(e)}function no(e){let t=e?e.length:0;return t===0?NaN:to(e)/t}function ro(e,t){return e==null?NaN:it(Array.from(e),G(t??x))}function io(e){if(!e||e.length===0)return;let t;for(let n=0;n<e.length;n++){let r=e[n];r==null||Number.isNaN(r)||typeof r==`symbol`||(t===void 0||r<t)&&(t=r)}return t}function ao(e,t){if(e!=null)return pe(Array.from(e),G(t??x))}function oo(e,t){return e===void 0&&t===void 0?1:e===void 0||t===void 0?e??t:(typeof e==`string`||typeof t==`string`?(e=R(e),t=R(t)):(e=v(e),t=v(t)),e*t)}function so(e,t=0,n){return n&&(t=0),Number.parseInt(e,t)}function co(...e){let t=0,n=1,r=!1;switch(e.length){case 1:typeof e[0]==`boolean`?r=e[0]:n=e[0];break;case 2:typeof e[1]==`boolean`?(n=e[0],r=e[1]):(t=e[0],n=e[1]);case 3:typeof e[2]==`object`&&e[2]!=null&&e[2][e[1]]===e[0]?(t=0,n=e[0],r=!1):(t=e[0],n=e[1],r=e[2])}return typeof t!=`number`&&(t=Number(t)),typeof n!=`number`&&(t=Number(n)),t||=0,n||=0,t>n&&([t,n]=[n,t]),t=Ei(t,-(2**53-1),2**53-1),n=Ei(n,-(2**53-1),2**53-1),t===n?t:r?ve(t,n+1):ye(t,n+1)}function lo(e,t,n){n&&typeof n!=`number`&&Y(e,t,n)&&(t=n=void 0),e=y(e),t===void 0?(t=e,e=0):t=y(t),n=n===void 0?e<t?1:-1:y(n);let r=Math.max(Math.ceil((t-e)/(n||1)),0),i=Array(r);for(let t=0;t<r;t++)i[t]=e,e+=n;return i}function uo(e,t,n){n&&typeof n!=`number`&&Y(e,t,n)&&(t=n=void 0),e=y(e),t===void 0?(t=e,e=0):t=y(t),n=n===void 0?e<t?1:-1:y(n);let r=Math.max(Math.ceil((t-e)/(n||1)),0),i=Array(r);for(let t=r-1;t>=0;t--)i[t]=e,e+=n;return i}function fo(e,t=0){return qa(`round`,e,t)}function po(e,t){return e===void 0&&t===void 0?0:e===void 0||t===void 0?e??t:(typeof e==`string`||typeof t==`string`?(e=R(e),t=R(t)):(e=v(e),t=v(t)),e-t)}function mo(...e){}function ho(e){let t=e?.constructor;return e===(typeof t==`function`?t.prototype:Object.prototype)}function Z(e){return ut(e)}function go(e,t){if(e=b(e),e<1||!Number.isSafeInteger(e))return[];let n=Array(e);for(let r=0;r<e;r++)n[r]=typeof t==`function`?t(r):r;return n}function Q(e){if(I(e))return _o(e);let t=Object.keys(Object(e));return ho(e)?t.filter(e=>e!==`constructor`):t}function _o(e){let t=go(e.length,e=>`${e}`),n=new Set(t);C(e)&&(n.add(`offset`),n.add(`parent`)),Z(e)&&(n.add(`buffer`),n.add(`byteLength`),n.add(`byteOffset`));let r=Object.keys(e).filter(e=>!n.has(e));return Array.isArray(e)?[...t,...r]:[...t.filter(t=>Object.hasOwn(e,t)),...r]}function vo(e,...t){for(let n=0;n<t.length;n++)yo(e,t[n]);return e}function yo(e,t){let n=Q(t);for(let r=0;r<n.length;r++){let i=n[r];(!(i in e)||!M(e[i],t[i]))&&(e[i]=t[i])}}function $(e){if(e==null)return[];switch(typeof e){case`object`:case`function`:return I(e)?So(e):ho(e)?xo(e):bo(e);default:return bo(Object(e))}}function bo(e){let t=[];for(let n in e)t.push(n);return t}function xo(e){return bo(e).filter(e=>e!==`constructor`)}function So(e){let t=go(e.length,e=>`${e}`),n=new Set(t);C(e)&&(n.add(`offset`),n.add(`parent`)),Z(e)&&(n.add(`buffer`),n.add(`byteLength`),n.add(`byteOffset`));let r=bo(e).filter(e=>!n.has(e));return Array.isArray(e)?[...t,...r]:[...t.filter(t=>Object.hasOwn(e,t)),...r]}function Co(e,...t){for(let n=0;n<t.length;n++)wo(e,t[n]);return e}function wo(e,t){let n=$(t);for(let r=0;r<n.length;r++){let i=n[r];(!(i in e)||!M(e[i],t[i]))&&(e[i]=t[i])}}function To(e,...t){let n=t[t.length-1];typeof n==`function`?t.pop():n=void 0;for(let r=0;r<t.length;r++)Eo(e,t[r],n);return e}function Eo(e,t,n){let r=$(t);for(let i=0;i<r.length;i++){let a=r[i],o=e[a],s=t[a],c=n?.(o,s,a,e,t)??s;(!(a in e)||!M(o,c))&&(e[a]=c)}}function Do(e,...t){let n=t[t.length-1];typeof n==`function`?t.pop():n=void 0;for(let r=0;r<t.length;r++)Oo(e,t[r],n);return e}function Oo(e,t,n){let r=Q(t);for(let i=0;i<r.length;i++){let a=r[i],o=e[a],s=t[a],c=n?.(o,s,a,e,t)??s;(!(a in e)||!M(o,c))&&(e[a]=c)}}function ko(e){if(lt(e))return e;let t=S(e);if(!Ao(e))return{};if(k(e)){let t=Array.from(e);return e.length>0&&typeof e[0]==`string`&&Object.hasOwn(e,`index`)&&(t.index=e.index,t.input=e.input),t}if(Z(e)){let t=e,n=t.constructor;return new n(t.buffer,t.byteOffset,t.length)}if(t===`[object ArrayBuffer]`)return new ArrayBuffer(e.byteLength);if(t===`[object DataView]`){let t=e,n=t.buffer,r=t.byteOffset,i=t.byteLength,a=new ArrayBuffer(i),o=new Uint8Array(n,r,i);return new Uint8Array(a).set(o),new DataView(a)}if(t===`[object Boolean]`||t===`[object Number]`||t===`[object String]`){let n=e.constructor,r=new n(e.valueOf());return t===`[object String]`?No(r,e):jo(r,e),r}if(t===`[object Date]`)return new Date(Number(e));if(t===`[object RegExp]`){let t=e,n=new RegExp(t.source,t.flags);return n.lastIndex=t.lastIndex,n}if(t===`[object Symbol]`)return Object(Symbol.prototype.valueOf.call(e));if(t===`[object Map]`){let t=e,n=new Map;return t.forEach((e,t)=>{n.set(t,e)}),n}if(t===`[object Set]`){let t=e,n=new Set;return t.forEach(e=>{n.add(e)}),n}if(t===`[object Arguments]`){let t=e,n={};return jo(n,t),n.length=t.length,n[Symbol.iterator]=t[Symbol.iterator],n}let n={};return Po(n,e),jo(n,e),Mo(n,e),n}function Ao(e){switch(S(e)){case _t:case St:case Ct:case Tt:case gt:case yt:case Nt:case Pt:case At:case jt:case Mt:case bt:case ht:case wt:case pt:case xt:case mt:case vt:case Et:case Dt:case Ot:case kt:return!0;default:return!1}}function jo(e,t){for(let n in t)Object.hasOwn(t,n)&&(e[n]=t[n])}function Mo(e,t){let n=Object.getOwnPropertySymbols(t);for(let r=0;r<n.length;r++){let i=n[r];Object.prototype.propertyIsEnumerable.call(t,i)&&(e[i]=t[i])}}function No(e,t){let n=t.valueOf().length;for(let r in t)Object.hasOwn(t,r)&&(Number.isNaN(Number(r))||Number(r)>=n)&&(e[r]=t[r])}function Po(e,t){let n=Object.getPrototypeOf(t);n!==null&&typeof t.constructor==`function`&&Object.setPrototypeOf(e,n)}function Fo(e,t){if(!t)return ko(e);let n=t(e);return n===void 0?ko(e):n}function Io(e,t){let n=H(e)?Object.create(e):{};if(t!=null){let e=Q(t);for(let r=0;r<e.length;r++){let i=e[r],a=t[i];ca(n,i,a)}}return n}function Lo(e,...t){e=Object(e);let n=Object.prototype,r=t.length,i=r>2?t[2]:void 0;i&&Y(t[0],t[1],i)&&(r=1);for(let i=0;i<r;i++){if(P(t[i]))continue;let r=t[i],a=Object.keys(r);for(let t=0;t<a.length;t++){let i=a[t],o=e[i];(o===void 0||!Object.hasOwn(e,i)&&M(o,n[i]))&&(e[i]=r[i])}}return e}function Ro(e,...t){e=Object(e);for(let n=0;n<t.length;n++){let r=t[n];r!=null&&zo(e,r,new WeakMap)}return e}function zo(e,t,n){for(let r in t){let i=t[r],a=e[r];if(a===void 0||!Object.hasOwn(e,r)){e[r]=Bo(i,n);continue}n.get(i)!==a&&Vo(a,i,n)}}function Bo(e,t){if(t.has(e))return t.get(e);if(j(e)){let n={};return t.set(e,n),zo(n,e,t),n}return e}function Vo(e,t,n){if(j(e)&&j(t)){n.set(t,e),zo(e,t,n);return}Array.isArray(e)&&Array.isArray(t)&&(n.set(t,e),Ho(e,t,n))}function Ho(e,t,n){let r=Math.min(t.length,e.length);for(let i=0;i<r;i++)j(e[i])&&j(t[i])&&zo(e[i],t[i],n);for(let n=r;n<t.length;n++)e.push(t[n])}function Uo(e,t){if(H(e))return Rt(e,G(t??X))}function Wo(e,t){if(!H(e))return;let n=G(t??X);return Object.keys(e).findLast(t=>n(e[t],t,e))}function Go(e,t=x){if(e==null)return e;for(let n in e)if(t(e[n],n,e)===!1)break;return e}function Ko(e,t=x){if(e==null)return e;let n=[];for(let t in e)n.push(t);for(let r=n.length-1;r>=0;r--){let i=n[r];if(t(e[i],i,e)===!1)break}return e}function qo(e,t=x){if(e==null)return e;let n=Object(e),r=Q(e);for(let e=0;e<r.length;++e){let i=r[e];if(t(n[i],i,n)===!1)break}return e}function Jo(e,t=x){if(e==null)return e;let n=Object(e),r=Q(e);for(let e=r.length-1;e>=0;--e){let i=r[e];if(t(n[i],i,n)===!1)break}return e}function Yo(e){if(!I(e))return{};let t={};for(let n=0;n<e.length;n++){let[r,i]=e[n];t[r]=i}return t}function Xo(e){return e==null?[]:Q(e).filter(t=>typeof e[t]==`function`)}function Zo(e){if(e==null)return[];let t=[];for(let n in e)N(e[n])&&t.push(n);return t}function Qo(e,t){if(e==null)return!1;let n;if(n=Array.isArray(t)?t:typeof t==`string`&&$n(t)&&e[t]==null?z(t):[t],n.length===0)return!1;let r=e;for(let e=0;e<n.length;e++){let t=n[e];if((r==null||!(t in Object(r)))&&!((Array.isArray(r)||fr(r))&&dr(t)&&t<r.length))return!1;r=r[t]}return!0}function $o(e){return Vt(e)}function es(e,t){let n={};if(P(e))return n;t??=x;let r=Object.keys(e),i=G(t);for(let t=0;t<r.length;t++){let a=r[t],o=e[a],s=i(o);Array.isArray(n[s])?n[s].push(a):n[s]=[a]}return n}function ts(e,t=x){return e==null?{}:Ht(e,G(t))}function ns(e,t=x){return e==null?{}:Ut(e,G(t))}function rs(e,...t){let n=t.slice(0,-1),r=t[t.length-1],i=e;for(let e=0;e<n.length;e++){let t=n[e];i=is(i,t,r,new Map)}return i}function is(e,t,n,r){if(lt(e)&&(e=Object(e)),typeof t!=`object`||!t)return e;if(r.has(t))return dt(r.get(t));if(r.set(t,e),Array.isArray(t)){t=t.slice();for(let e=0;e<t.length;e++)t[e]=t[e]??void 0}let i=[...Object.keys(t),...ft(t)];for(let a=0;a<i.length;a++){let o=i[a];if(D(o))continue;let s=t[o],c=e[o];if(fr(s)&&(s={...s}),fr(c)&&(c={...c}),C(s)&&(s=lr(s)),Array.isArray(s))if(Array.isArray(c)){let e=[],t=Reflect.ownKeys(c);for(let n=0;n<t.length;n++){let r=t[n];e[r]=c[r]}c=e}else if(q(c)){let e=[];for(let t=0;t<c.length;t++)e[t]=c[t];c=e}else c=[];let l=n(c,s,o,e,t,r);l===void 0?Array.isArray(s)||K(c)&&K(s)&&(j(c)||j(s)||Z(c)||Z(s))?e[o]=is(c,s,n,r):c==null&&j(s)?e[o]=is({},s,n,r):c==null&&Z(s)?e[o]=lr(s):(c===void 0||s!==void 0)&&(e[o]=s):e[o]=l}return e}function as(e,...t){return rs(e,...t,We)}function os(e){let t=[];for(;e;)t.push(...ft(e)),e=Object.getPrototypeOf(e);return t}function ss(e,...t){if(e==null)return{};t=Ir(t);let n=cs(e,t);for(let e=0;e<t.length;e++){let r=t[e];switch(typeof r){case`object`:Array.isArray(r)||(r=Array.from(r));for(let e=0;e<r.length;e++){let t=r[e];_i(n,t)}break;case`string`:case`symbol`:case`number`:_i(n,r);break}}return n}function cs(e,t){return t.some(e=>Array.isArray(e)||$n(e))?us(e):ls(e)}function ls(e){let t={},n=[...$(e),...os(e)];for(let r=0;r<n.length;r++){let i=n[r];t[i]=e[i]}return t}function us(e){let t={},n=[...$(e),...os(e)];for(let r=0;r<n.length;r++){let i=n[r];t[i]=cr(e[i],e=>{if(!j(e))return e})}return t}function ds(e,t){if(e==null)return{};let n={},r=G(t??X),i=[...$(e),...os(e)];for(let t=0;t<i.length;t++){let a=_(i[t])?i[t]:i[t].toString(),o=e[a];r(o,a,e)||(n[a]=o)}return n}function fs(e,...t){if(ji(e))return{};let n={};for(let r=0;r<t.length;r++){let i=t[r];switch(typeof i){case`object`:Array.isArray(i)||(i=I(i)?Array.from(i):[i]);break;case`string`:case`symbol`:case`number`:i=[i];break}for(let t of i){let r=B(e,t);r===void 0&&!pr(e,t)||(typeof t==`string`&&Object.hasOwn(e,t)?n[t]=r:da(n,t,r))}}return n}function ps(e,t){if(e==null)return{};let n=G(t??X),r={},i=I(e)?ct(0,e.length):[...$(e),...os(e)];for(let t=0;t<i.length;t++){let a=_(i[t])?i[t]:i[t].toString(),o=e[a];n(o,a,e)&&(r[a]=o)}return r}function ms(e){return function(t){return B(e,t)}}function hs(e,t,n){ci(t,e)?t=[t]:Array.isArray(t)||(t=z(R(t)));let r=Math.max(t.length,1);for(let i=0;i<r;i++){let r=e?.[L(t[i])];if(r===void 0)return typeof n==`function`?n.call(e):n;e=typeof r==`function`?r.call(e):r}return e}function gs(e,t,n,r){let i;return i=typeof r==`function`?r:()=>void 0,ua(e,t,()=>n,i)}function _s(e,...t){return Lo(lr(e),...t)}function vs(e){let t=Array(e.size),n=e.keys(),r=e.values();for(let e=0;e<t.length;e++)t[e]=[n.next().value,r.next().value];return t}function ys(e){let t=Array(e.size),n=e.values();for(let e=0;e<t.length;e++){let r=n.next().value;t[e]=[r,r]}return t}function bs(e){if(e==null)return[];if(e instanceof Set)return ys(e);if(e instanceof Map)return vs(e);let t=Q(e),n=Array(t.length);for(let r=0;r<t.length;r++){let i=t[r];n[r]=[i,e[i]]}return n}function xs(e){if(e==null)return[];if(e instanceof Set)return ys(e);if(e instanceof Map)return vs(e);let t=$(e),n=Array(t.length);for(let r=0;r<t.length;r++){let i=t[r];n[r]=[i,e[i]]}return n}function Ss(e){return C(e)}function Cs(e,t=x,n){let r=Array.isArray(e)||Ss(e)||Z(e);return t=G(t),n??=r?[]:H(e)&&N(e.constructor)?Object.create(Object.getPrototypeOf(e)):{},e==null||Tr(e,(e,r,i)=>t(n,e,r,i)),n}function ws(e,t,n){return ua(e,t,n,()=>void 0)}function Ts(e){let t=$(e),n=Array(t.length);for(let r=0;r<t.length;r++)n[r]=e[t[r]];return n}function Es(e){return typeof e==`function`}function Ds(e){return Number.isSafeInteger(e)&&e>=0}let Os=Function.prototype.toString,ks=RegExp(`^${Os.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)}$`);function As(e){if(typeof e!=`function`)return!1;if(globalThis?.[`__core-js_shared__`]!=null)throw Error(`Unsupported core-js use. Try https://npms.io/search?q=ponyfill.`);return ks.test(Os.call(e))}function js(e){return e===null}function Ms(e){return xn(e)}function Ns(e,t){if(t==null)return!0;if(e==null)return Object.keys(t).length===0;let n=Object.keys(t);for(let r=0;r<n.length;r++){let i=n[r],a=t[i],o=e[i];if(o===void 0&&!(i in e)||typeof a==`function`&&!a(o))return!1}return!0}function Ps(e){return e=Lt(e),function(t){return Ns(t,e)}}function Fs(e){return Zt(e)}function Is(e){return typeof e==`boolean`||e instanceof Boolean}function Ls(e){return en(e)}function Rs(e){return K(e)&&e.nodeType===1&&!j(e)}function zs(e){if(e==null)return!0;if(I(e))return typeof e.splice!=`function`&&typeof e!=`string`&&!C(e)&&!Z(e)&&!fr(e)?!1:e.length===0;if(typeof e==`object`){if(e instanceof Map||e instanceof Set)return e.size===0;let t=Object.keys(e);return ho(e)?t.filter(e=>e!==`constructor`).length===0:t.length===0}return!0}function Bs(e,t,n){return typeof n!=`function`&&(n=()=>void 0),nn(e,t,(...r)=>{let i=n(...r);if(i!==void 0)return!!i;if(e instanceof Map&&t instanceof Map||e instanceof Set&&t instanceof Set)return Bs(Array.from(e),Array.from(t),Le(2,n))})}function Vs(e){return S(e)===`[object Error]`}function Hs(e){return Number.isFinite(e)}function Us(e){return Number.isInteger(e)}function Ws(e){return vn(e)}function Gs(e){return Number.isSafeInteger(e)}function Ks(e){return yn(e)}function qs(e){return Sn(e)}function Js(e){return Cn(e)}function Ys(e){return Wt(R(e))}function Xs(e,...t){if(e==null||!H(e)||k(e)&&t.length===0)return e;let n=[];for(let e=0;e<t.length;e++){let r=t[e];k(r)?n.push(...r):r&&typeof r==`object`&&`length`in r?n.push(...Array.from(r)):n.push(r)}if(n.length===0)return e;for(let t=0;t<n.length;t++){let r=n[t],i=R(r),a=e[i];N(a)&&(e[i]=a.bind(e))}return e}function Zs(e){return An(R(e))}function Qs(e){return typeof e!=`string`&&(e=R(e)),e.replace(/['\u2019]/g,``)}function $s(e){return Kt(Qs(Zs(e)))}function ec(e,t,n){return e==null||t==null?!1:(n??=e.length,e.endsWith(t,n))}function tc(e){return Mn(R(e))}function nc(e){return Nn(R(e))}function rc(e){return Pn(Qs(Zs(e)))}function ic(e){return Fn(Qs(Zs(e)))}function ac(e){return In(R(e))}function oc(e,t,n){return Ln(R(e),t,n)}function sc(e,t=0,n=` `){return R(e).padEnd(t,n)}function cc(e,t=0,n=` `){return R(e).padStart(t,n)}let lc=2**53-1;function uc(e,t,n){return t=(n?Y(e,t,n):t===void 0)?1:b(t),t<1||t>lc?``:R(e).repeat(t)}function dc(e,t,n){return arguments.length<3?R(e):R(e).replace(t,n)}function fc(e){return Yt(Qs(Zs(e)))}function pc(e,t,n){return R(e).split(t,n)}function mc(e){let t=A(Qs(Zs(e)).trim()),n=``;for(let e=0;e<t.length;e++){let r=t[e];n&&(n+=` `),r===r.toUpperCase()?n+=r:n+=r[0].toUpperCase()+r.slice(1).toLowerCase()}return n}function hc(e,t,n){return e==null||t==null?!1:(n??=0,e.startsWith(t,n))}let gc=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,_c=/['\n\r\u2028\u2029\\]/g,vc=/($^)/,yc=new Map([[`\\`,`\\`],[`'`,`'`],[`
|
|
2
|
+
`,`n`],[`\r`,`r`],[`\u2028`,`u2028`],[`\u2029`,`u2029`]]);function bc(e){return`\\${yc.get(e)}`}let xc=/<%=([\s\S]+?)%>/g,Sc={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:xc,variable:``,imports:{_:{escape:tc,template:Cc}}};function Cc(e,t,n){e=R(e),n&&(t=Sc),t=Lo({...t},Sc);let r=new RegExp([t.escape?.source??vc.source,t.interpolate?.source??vc.source,t.interpolate===xc?gc.source:vc.source,t.evaluate?.source??vc.source,`$`].join(`|`),`g`),i=0,a=!1,o=`__p += ''`;for(let t of e.matchAll(r)){let[n,r,s,c,l]=t,{index:u}=t;o+=` + '${e.slice(i,u).replace(_c,bc)}'`,r&&(o+=` + _.escape(${r})`),s?o+=` + ((${s}) == null ? '' : ${s})`:c&&(o+=` + ((${c}) == null ? '' : ${c})`),l&&(o+=`;\n${l};\n __p += ''`,a=!0),i=u+n.length}let s=Lo({...t.imports},Sc.imports),c=Object.keys(s),l=Object.values(s),u=`//# sourceURL=${t.sourceURL?String(t.sourceURL).replace(/[\r\n]/g,` `):`es-toolkit.templateSource[${Date.now()}]`}\n`,d=`function(${t.variable||`obj`}) {
|
|
3
3
|
let __p = '';
|
|
4
4
|
${t.variable?``:`if (obj == null) { obj = {}; }`}
|
|
5
5
|
${a?`function print() { __p += Array.prototype.join.call(arguments, ''); }`:``}
|
|
6
6
|
${t.variable?o:`with(obj) {\n${o}\n}`}
|
|
7
7
|
return __p;
|
|
8
|
-
}`,f=
|
|
8
|
+
}`,f=ga(()=>Function(...c,`${u}return ${d}`)(...l));if(f.source=d,f instanceof Error)throw f;return f}function wc(e){return R(e).toLowerCase()}function Tc(e){return R(e).toUpperCase()}function Ec(e,t,n){if(e==null)return``;if(n!=null||t==null)return e.toString().trim();switch(typeof t){case`object`:return Array.isArray(t)?Hn(e,t.flatMap(e=>e.toString().split(``))):Hn(e,t.toString().split(``));default:return Hn(e,t.toString().split(``))}}function Dc(e,t,n){return e==null?``:n!=null||t==null?e.toString().trimEnd():Bn(e,t.toString().split(``))}function Oc(e,t,n){return e==null?``:n!=null||t==null?e.toString().trimStart():Vn(e,t.toString().split(``))}let kc=/[\u200d\ud800-\udfff\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff\ufe0e\ufe0f]/;function Ac(e,t){e=e==null?``:`${e}`;let n=30,r=`...`;H(t)&&(n=jc(t.length),r=`omission`in t?`${t.omission}`:`...`);let i=e.length,a=Array.from(r).length,o=Math.max(n-a,0),s;if(kc.test(e)&&(s=Array.from(e),i=s.length),n>=i)return e;if(i<=a)return r;let c=s===void 0?e.slice(0,o):s?.slice(0,o).join(``),l=t?.separator;if(!l)return c+=r,c;let u=l instanceof RegExp?l.source:l,d=`u`+(l instanceof RegExp?l.flags.replace(`u`,``):``),f=RegExp(`(?<result>.*(?:(?!${u}).))(?:${u})`,d).exec(c);return(f?.groups?f.groups.result:c)+r}function jc(e){return e==null?30:e<=0?0:e}function Mc(e){return Wn(R(e))}function Nc(e){return Gn(Qs(Zs(e)))}function Pc(e){return Kn(R(e))}let Fc=`\\p{Lu}`,Ic=`\\p{Ll}`,Lc=`(?:[\\p{Lm}\\p{Lo}]\\p{M}*)`,Rc=`(?:['’](?:d|ll|m|re|s|t|ve))?`,zc=`(?:['’](?:D|LL|M|RE|S|T|VE))?`,Bc=`[\\p{Z}\\p{P}\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\xd7\\xf7]`,Vc=`(?:${Fc}|${Lc})`,Hc=`(?:${Ic}|${Lc})`,Uc=RegExp([`${Fc}?${Ic}+${Rc}(?=${Bc}|${Fc}|$)`,`${Vc}+${zc}(?=${Bc}|${Fc}${Hc}|$)`,`${Fc}?${Hc}+${Rc}`,`${Fc}+${zc}`,`\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])`,`\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])`,`\\d+`,`\\p{Emoji_Presentation}`,`\\p{Extended_Pictographic}`].join(`|`),`gu`);function Wc(e,t=Uc,n){let r=R(e);return n&&(t=Uc),typeof t==`number`&&(t=t.toString()),Array.from(r.match(t)??[]).filter(e=>e!==``)}function Gc(e){let t=e.length,n=e.map(e=>{let t=e[0],n=e[1];if(!N(n))throw TypeError(`Expected a function`);return[G(t),n]});return function(...e){for(let r=0;r<t;r++){let t=n[r],i=t[0],a=t[1];if(i.apply(this,e))return a.apply(this,e)}}}function Kc(e){return()=>e}function qc(e,t){return e==null||Number.isNaN(e)?t:e}function Jc(e,t){return typeof e==`string`&&typeof t==`string`?e>t:v(e)>v(t)}function Yc(e,t){return typeof e==`string`&&typeof t==`string`?e>=t:v(e)>=v(t)}function Xc(e,t,...n){if(n=n.flat(1),e!=null)switch(typeof t){case`string`:return typeof e==`object`&&Object.hasOwn(e,t)?Zc(e,[t],n):Zc(e,z(t),n);case`number`:case`symbol`:return Zc(e,[t],n);default:return Array.isArray(t)?Zc(e,t,n):Zc(e,[t],n)}}function Zc(e,t,n){let r=B(e,t.slice(0,-1),e);if(r==null)return;let i=J(t),a=i?.valueOf();return i=typeof a==`number`?L(a):String(i),B(r,i)?.apply(r,n)}function Qc(e,t){return typeof e==`string`&&typeof t==`string`?e<t:v(e)<v(t)}function $c(e,t){return typeof e==`string`&&typeof t==`string`?e<=t:v(e)<=v(t)}function el(e,...t){return function(n){return Xc(n,e,t)}}function tl(e,...t){return function(n){return Xc(e,n,t)}}function nl(){return Date.now()}function rl(...e){e.length===1&&Array.isArray(e[0])&&(e=e[0]);let t=e.map(e=>G(e));return function(...e){return t.map(t=>t.apply(this,e))}}function il(...e){return function(...t){for(let n=0;n<e.length;++n){let r=e[n];if(!Array.isArray(r)){if(!G(r).apply(this,t))return!1;continue}for(let e=0;e<r.length;++e)if(!G(r[e]).apply(this,t))return!1}return!0}}function al(...e){return function(...t){for(let n=0;n<e.length;++n){let r=e[n];if(!Array.isArray(r)){if(G(r).apply(this,t))return!0;continue}for(let e=0;e<r.length;++e)if(G(r[e]).apply(this,t))return!0}return!1}}function ol(){return[]}function sl(){return!1}function cl(){return{}}function ll(){return``}function ul(){return!0}function dl(e){return e==null?0:Ei(Math.floor(Number(e)),0,4294967295)}function fl(e){let t={},n=$(e);for(let r=0;r<n.length;r++){let i=n[r],a=e[i];i===`__proto__`?Object.defineProperty(t,i,{configurable:!0,enumerable:!0,value:a,writable:!0}):t[i]=a}return t}function pl(e){return e==null?0:Ei(b(e),-lc,lc)}let ml=0;function hl(e=``){return`${e}${++ml}`}e.AbortError=Fe,e.Mutex=Tn,e.Semaphore=p,e.TimeoutError=Ie,e.add=Ka,e.after=ma,e.allKeyed=wn,e.ary=ha,e.assert=Jn,e.invariant=Jn,e.assign=vo,e.assignIn=Co,e.extend=Co,e.assignInWith=To,e.extendWith=To,e.assignWith=Do,e.asyncNoop=ze,e.at=gi,e.attempt=ga,e.attemptAsync=qn,e.before=_a,e.bind=va,e.bindAll=Xs,e.bindKey=ya,e.camelCase=$s,e.capitalize=Ys,e.cartesianProduct=t,e.castArray=Yn,e.ceil=Ja,e.chunk=Xn,e.clamp=Ei,e.clone=ko,e.cloneDeep=lr,e.cloneDeepWith=cr,e.cloneWith=Fo,e.combinations=r,e.compact=Zn,e.concat=Qn,e.cond=Gc,e.conforms=Ps,e.conformsTo=Ns,e.constant=Kc,e.constantCase=On,e.countBy=mr,e.create=Io,e.curry=ba,e.curryRight=wa,e.debounce=Oa,e.deburr=Zs,e.defaultTo=qc,e.defaults=Lo,e.defaultsDeep=Ro,e.defer=ka,e.delay=Aa,e.difference=hr,e.differenceBy=_r,e.differenceWith=vr,e.divide=Ya,e.drop=yr,e.dropRight=br,e.dropRightWhile=xr,e.dropWhile=Cr,e.each=Tr,e.forEach=Tr,e.eachRight=Er,e.forEachRight=Er,e.endsWith=ec,e.eq=M,e.escape=tc,e.escapeRegExp=nc,e.every=Dr,e.fill=kr,e.filter=Ar,e.filterAsync=h,e.find=jr,e.findIndex=Mr,e.findKey=Uo,e.findLast=Nr,e.findLastIndex=Pr,e.findLastKey=Wo,e.first=Fr,e.head=Fr,e.flatMap=zr,e.flatMapAsync=ee,e.flatMapDeep=Vr,e.flatMapDepth=Br,e.flatten=Ir,e.flattenDeep=Hr,e.flattenDepth=Lr,e.flattenObject=zt,e.flip=ja,e.floor=Xa,e.flow=Ma,e.flowRight=Na,e.forEachAsync=te,e.forIn=Go,e.forInRight=Ko,e.forOwn=qo,e.forOwnRight=Jo,e.fromPairs=Yo,e.functions=Xo,e.functionsIn=Zo,e.get=B,e.groupBy=Ur,e.gt=Jc,e.gte=Yc,e.has=pr,e.hasIn=Qo,e.identity=X,e.inRange=Za,e.includes=Wr,e.indexOf=Gr,e.initial=Kr,e.intersection=qr,e.intersectionBy=Jr,e.intersectionWith=Xr,e.invert=$o,e.invertBy=es,e.invoke=Xc,e.invokeMap=Qr,e.isArguments=fr,e.isArray=k,e.isArrayBuffer=Fs,e.isArrayLike=I,e.isArrayLikeObject=q,e.isBlob=Qt,e.isBoolean=Is,e.isBrowser=$t,e.isBuffer=Ss,e.isDate=Ls,e.isElement=Rs,e.isEmpty=zs,e.isEmptyObject=tn,e.isEqual=on,e.isEqualWith=Bs,e.isError=Vs,e.isFile=sn,e.isFinite=Hs,e.isFunction=Es,e.isInteger=Us,e.isJSON=cn,e.isJSONArray=un,e.isJSONObject=dn,e.isJSONValue=ln,e.isLength=Ds,e.isMap=Di,e.isMatch=sr,e.isMatchWith=tr,e.isNaN=Li,e.isNative=As,e.isNil=ji,e.isNode=mn,e.isNotNil=hn,e.isNull=js,e.isNumber=zi,e.isObject=H,e.isObjectLike=K,e.isPlainObject=j,e.isPrimitive=lt,e.isPromise=_n,e.isRegExp=Ws,e.isSafeInteger=Gs,e.isSet=Ks,e.isString=Or,e.isSubset=ce,e.isSubsetWith=le,e.isSymbol=_,e.isTypedArray=Z,e.isUndefined=Ms,e.isWeakMap=qs,e.isWeakSet=Js,e.iteratee=G,e.join=$r,e.kebabCase=rc,e.keyBy=ti,e.keys=Q,e.keysIn=$,e.last=J,e.lastIndexOf=ni,e.limitAsync=m,e.lowerCase=ic,e.lowerFirst=ac,e.lt=Qc,e.lte=$c,e.map=Rr,e.mapAsync=de,e.mapKeys=ts,e.mapValues=ns,e.matches=U,e.matchesProperty=W,e.max=Qa,e.maxBy=$a,e.mean=no,e.meanBy=ro,e.median=at,e.medianBy=ot,e.memoize=Pa,e.merge=as,e.mergeWith=rs,e.method=el,e.methodOf=tl,e.min=io,e.minBy=ao,e.multiply=oo,e.negate=xi,e.noop=mo,e.now=nl,e.nth=ri,e.nthArg=Fa,e.omit=ss,e.omitBy=ds,e.once=Ia,e.orderBy=li,e.over=rl,e.overArgs=La,e.overEvery=il,e.overSome=al,e.pad=oc,e.padEnd=sc,e.padStart=cc,e.parseInt=so,e.partial=Ra,e.partialRight=za,e.partition=ui,e.pascalCase=Rn,e.percentile=st,e.pick=fs,e.pickBy=ps,e.property=V,e.propertyOf=ms,e.pull=di,e.pullAll=fi,e.pullAllBy=pi,e.pullAllWith=hi,e.pullAt=yi,e.random=co,e.randomInt=ye,e.range=lo,e.rangeRight=uo,e.rearg=Ba,e.reduce=ei,e.reduceAsync=he,e.reduceRight=bi,e.reject=Si,e.remove=Ci,e.repeat=uc,e.replace=dc,e.rest=Va,e.result=hs,e.retry=tt,e.reverse=wi,e.reverseString=zn,e.round=fo,e.sample=Ti,e.sampleSize=ki,e.set=da,e.setWith=gs,e.shuffle=Mi,e.size=Ni,e.slice=Pi,e.snakeCase=fc,e.some=Fi,e.sortBy=Ii,e.sortedIndex=Bi,e.sortedIndexBy=Ri,e.sortedIndexOf=Vi,e.sortedLastIndex=Ui,e.sortedLastIndexBy=Hi,e.sortedLastIndexOf=Wi,e.split=pc,e.spread=Ha,e.startCase=mc,e.startsWith=hc,e.stubArray=ol,e.stubFalse=sl,e.stubObject=cl,e.stubString=ll,e.stubTrue=ul,e.subtract=po,e.sum=to,e.sumBy=eo,e.tail=Gi,e.take=Ki,e.takeRight=qi,e.takeRightWhile=Ji,e.takeWhile=Yi,e.template=Cc,e.templateSettings=Sc,e.throttle=Ua,e.timeout=En,e.times=go,e.toArray=Oi,e.toCamelCaseKeys=qt,e.toDefaulted=_s,e.toFilled=Te,e.toFinite=y,e.toInteger=b,e.toLength=dl,e.toLower=wc,e.toMerged=Jt,e.toNumber=v,e.toPairs=bs,e.toPairsIn=xs,e.toPath=z,e.toPlainObject=fl,e.toSafeInteger=pl,e.toSnakeCaseKeys=Xt,e.toString=R,e.toUpper=Tc,e.transform=Cs,e.trim=Ec,e.trimEnd=Dc,e.trimStart=Oc,e.truncate=Ac,e.unary=Wa,e.unescape=Mc,e.union=Xi,e.unionBy=Zi,e.unionWith=Qi,e.uniq=Yr,e.uniqBy=$i,e.uniqWith=ea,e.uniqueId=hl,e.unset=_i,e.unzip=ta,e.unzipWith=na,e.update=ws,e.updateWith=ua,e.upperCase=Nc,e.upperFirst=Pc,e.values=Ai,e.valuesIn=Ts,e.windowed=Ae,e.withTimeout=Dn,e.without=ra,e.words=Wc,e.wrap=Ga,e.xor=ia,e.xorBy=aa,e.xorWith=oa,e.zip=sa,e.zipObject=la,e.zipObjectDeep=fa,e.zipWith=pa});
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { at } from "./array/at.mjs";
|
|
2
|
+
import { cartesianProduct } from "./array/cartesianProduct.mjs";
|
|
2
3
|
import { chunk } from "./array/chunk.mjs";
|
|
4
|
+
import { combinations } from "./array/combinations.mjs";
|
|
3
5
|
import { compact } from "./array/compact.mjs";
|
|
4
6
|
import { countBy } from "./array/countBy.mjs";
|
|
5
7
|
import { difference } from "./array/difference.mjs";
|
|
@@ -150,6 +152,7 @@ import { isTypedArray } from "./predicate/isTypedArray.mjs";
|
|
|
150
152
|
import { isUndefined } from "./predicate/isUndefined.mjs";
|
|
151
153
|
import { isWeakMap } from "./predicate/isWeakMap.mjs";
|
|
152
154
|
import { isWeakSet } from "./predicate/isWeakSet.mjs";
|
|
155
|
+
import { allKeyed } from "./promise/allKeyed.mjs";
|
|
153
156
|
import { delay } from "./promise/delay.mjs";
|
|
154
157
|
import { Mutex } from "./promise/mutex.mjs";
|
|
155
158
|
import { Semaphore } from "./promise/semaphore.mjs";
|
|
@@ -179,4 +182,4 @@ import { words } from "./string/words.mjs";
|
|
|
179
182
|
import { attempt } from "./util/attempt.mjs";
|
|
180
183
|
import { attemptAsync } from "./util/attemptAsync.mjs";
|
|
181
184
|
import { invariant } from "./util/invariant.mjs";
|
|
182
|
-
export { AbortError, DebounceOptions, DebouncedFunction, MemoizeCache, Mutex, Semaphore, ThrottleOptions, ThrottledFunction, TimeoutError, after, ary, invariant as assert, asyncNoop, at, attempt, attemptAsync, before, camelCase, capitalize, chunk, clamp, clone, cloneDeep, cloneDeepWith, compact, constantCase, countBy, curry, curryRight, debounce, deburr, delay, difference, differenceBy, differenceWith, drop, dropRight, dropRightWhile, dropWhile, escape, escapeRegExp, fill, filterAsync, findKey, flatMap, flatMapAsync, flatMapDeep, flatten, flattenDeep, flattenObject, flow, flowRight, forEachAsync, forEachRight, groupBy, head, identity, inRange, initial, intersection, intersectionBy, intersectionWith, invariant, invert, isArrayBuffer, isBlob, isBoolean, isBrowser, isBuffer, isDate, isEmptyObject, isEqual, isEqualWith, isError, isFile, isFunction, isJSON, isJSONArray, isJSONObject, isJSONValue, isLength, isMap, isNil, isNode, isNotNil, isNull, isNumber, isPlainObject, isPrimitive, isPromise, isRegExp, isSet, isString, isSubset, isSubsetWith, isSymbol, isTypedArray, isUndefined, isWeakMap, isWeakSet, kebabCase, keyBy, last, limitAsync, lowerCase, lowerFirst, mapAsync, mapKeys, mapValues, maxBy, mean, meanBy, median, medianBy, memoize, merge, mergeWith, minBy, negate, noop, omit, omitBy, once, orderBy, pad, partial, partialRight, partition, pascalCase, percentile, pick, pickBy, pull, pullAt, random, randomInt, range, rangeRight, reduceAsync, remove, rest, retry, reverseString, round, sample, sampleSize, shuffle, snakeCase, sortBy, spread, startCase, sum, sumBy, tail, take, takeRight, takeRightWhile, takeWhile, throttle, timeout, toCamelCaseKeys, toFilled, toMerged, toSnakeCaseKeys, trim, trimEnd, trimStart, unary, unescape, union, unionBy, unionWith, uniq, uniqBy, uniqWith, unzip, unzipWith, upperCase, upperFirst, windowed, withTimeout, without, words, xor, xorBy, xorWith, zip, zipObject, zipWith };
|
|
185
|
+
export { AbortError, DebounceOptions, DebouncedFunction, MemoizeCache, Mutex, Semaphore, ThrottleOptions, ThrottledFunction, TimeoutError, after, allKeyed, ary, invariant as assert, asyncNoop, at, attempt, attemptAsync, before, camelCase, capitalize, cartesianProduct, chunk, clamp, clone, cloneDeep, cloneDeepWith, combinations, compact, constantCase, countBy, curry, curryRight, debounce, deburr, delay, difference, differenceBy, differenceWith, drop, dropRight, dropRightWhile, dropWhile, escape, escapeRegExp, fill, filterAsync, findKey, flatMap, flatMapAsync, flatMapDeep, flatten, flattenDeep, flattenObject, flow, flowRight, forEachAsync, forEachRight, groupBy, head, identity, inRange, initial, intersection, intersectionBy, intersectionWith, invariant, invert, isArrayBuffer, isBlob, isBoolean, isBrowser, isBuffer, isDate, isEmptyObject, isEqual, isEqualWith, isError, isFile, isFunction, isJSON, isJSONArray, isJSONObject, isJSONValue, isLength, isMap, isNil, isNode, isNotNil, isNull, isNumber, isPlainObject, isPrimitive, isPromise, isRegExp, isSet, isString, isSubset, isSubsetWith, isSymbol, isTypedArray, isUndefined, isWeakMap, isWeakSet, kebabCase, keyBy, last, limitAsync, lowerCase, lowerFirst, mapAsync, mapKeys, mapValues, maxBy, mean, meanBy, median, medianBy, memoize, merge, mergeWith, minBy, negate, noop, omit, omitBy, once, orderBy, pad, partial, partialRight, partition, pascalCase, percentile, pick, pickBy, pull, pullAt, random, randomInt, range, rangeRight, reduceAsync, remove, rest, retry, reverseString, round, sample, sampleSize, shuffle, snakeCase, sortBy, spread, startCase, sum, sumBy, tail, take, takeRight, takeRightWhile, takeWhile, throttle, timeout, toCamelCaseKeys, toFilled, toMerged, toSnakeCaseKeys, trim, trimEnd, trimStart, unary, unescape, union, unionBy, unionWith, uniq, uniqBy, uniqWith, unzip, unzipWith, upperCase, upperFirst, windowed, withTimeout, without, words, xor, xorBy, xorWith, zip, zipObject, zipWith };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { at } from "./array/at.js";
|
|
2
|
+
import { cartesianProduct } from "./array/cartesianProduct.js";
|
|
2
3
|
import { chunk } from "./array/chunk.js";
|
|
4
|
+
import { combinations } from "./array/combinations.js";
|
|
3
5
|
import { compact } from "./array/compact.js";
|
|
4
6
|
import { countBy } from "./array/countBy.js";
|
|
5
7
|
import { difference } from "./array/difference.js";
|
|
@@ -150,6 +152,7 @@ import { isTypedArray } from "./predicate/isTypedArray.js";
|
|
|
150
152
|
import { isUndefined } from "./predicate/isUndefined.js";
|
|
151
153
|
import { isWeakMap } from "./predicate/isWeakMap.js";
|
|
152
154
|
import { isWeakSet } from "./predicate/isWeakSet.js";
|
|
155
|
+
import { allKeyed } from "./promise/allKeyed.js";
|
|
153
156
|
import { delay } from "./promise/delay.js";
|
|
154
157
|
import { Mutex } from "./promise/mutex.js";
|
|
155
158
|
import { Semaphore } from "./promise/semaphore.js";
|
|
@@ -179,4 +182,4 @@ import { words } from "./string/words.js";
|
|
|
179
182
|
import { attempt } from "./util/attempt.js";
|
|
180
183
|
import { attemptAsync } from "./util/attemptAsync.js";
|
|
181
184
|
import { invariant } from "./util/invariant.js";
|
|
182
|
-
export { AbortError, DebounceOptions, DebouncedFunction, MemoizeCache, Mutex, Semaphore, ThrottleOptions, ThrottledFunction, TimeoutError, after, ary, invariant as assert, asyncNoop, at, attempt, attemptAsync, before, camelCase, capitalize, chunk, clamp, clone, cloneDeep, cloneDeepWith, compact, constantCase, countBy, curry, curryRight, debounce, deburr, delay, difference, differenceBy, differenceWith, drop, dropRight, dropRightWhile, dropWhile, escape, escapeRegExp, fill, filterAsync, findKey, flatMap, flatMapAsync, flatMapDeep, flatten, flattenDeep, flattenObject, flow, flowRight, forEachAsync, forEachRight, groupBy, head, identity, inRange, initial, intersection, intersectionBy, intersectionWith, invariant, invert, isArrayBuffer, isBlob, isBoolean, isBrowser, isBuffer, isDate, isEmptyObject, isEqual, isEqualWith, isError, isFile, isFunction, isJSON, isJSONArray, isJSONObject, isJSONValue, isLength, isMap, isNil, isNode, isNotNil, isNull, isNumber, isPlainObject, isPrimitive, isPromise, isRegExp, isSet, isString, isSubset, isSubsetWith, isSymbol, isTypedArray, isUndefined, isWeakMap, isWeakSet, kebabCase, keyBy, last, limitAsync, lowerCase, lowerFirst, mapAsync, mapKeys, mapValues, maxBy, mean, meanBy, median, medianBy, memoize, merge, mergeWith, minBy, negate, noop, omit, omitBy, once, orderBy, pad, partial, partialRight, partition, pascalCase, percentile, pick, pickBy, pull, pullAt, random, randomInt, range, rangeRight, reduceAsync, remove, rest, retry, reverseString, round, sample, sampleSize, shuffle, snakeCase, sortBy, spread, startCase, sum, sumBy, tail, take, takeRight, takeRightWhile, takeWhile, throttle, timeout, toCamelCaseKeys, toFilled, toMerged, toSnakeCaseKeys, trim, trimEnd, trimStart, unary, unescape, union, unionBy, unionWith, uniq, uniqBy, uniqWith, unzip, unzipWith, upperCase, upperFirst, windowed, withTimeout, without, words, xor, xorBy, xorWith, zip, zipObject, zipWith };
|
|
185
|
+
export { AbortError, DebounceOptions, DebouncedFunction, MemoizeCache, Mutex, Semaphore, ThrottleOptions, ThrottledFunction, TimeoutError, after, allKeyed, ary, invariant as assert, asyncNoop, at, attempt, attemptAsync, before, camelCase, capitalize, cartesianProduct, chunk, clamp, clone, cloneDeep, cloneDeepWith, combinations, compact, constantCase, countBy, curry, curryRight, debounce, deburr, delay, difference, differenceBy, differenceWith, drop, dropRight, dropRightWhile, dropWhile, escape, escapeRegExp, fill, filterAsync, findKey, flatMap, flatMapAsync, flatMapDeep, flatten, flattenDeep, flattenObject, flow, flowRight, forEachAsync, forEachRight, groupBy, head, identity, inRange, initial, intersection, intersectionBy, intersectionWith, invariant, invert, isArrayBuffer, isBlob, isBoolean, isBrowser, isBuffer, isDate, isEmptyObject, isEqual, isEqualWith, isError, isFile, isFunction, isJSON, isJSONArray, isJSONObject, isJSONValue, isLength, isMap, isNil, isNode, isNotNil, isNull, isNumber, isPlainObject, isPrimitive, isPromise, isRegExp, isSet, isString, isSubset, isSubsetWith, isSymbol, isTypedArray, isUndefined, isWeakMap, isWeakSet, kebabCase, keyBy, last, limitAsync, lowerCase, lowerFirst, mapAsync, mapKeys, mapValues, maxBy, mean, meanBy, median, medianBy, memoize, merge, mergeWith, minBy, negate, noop, omit, omitBy, once, orderBy, pad, partial, partialRight, partition, pascalCase, percentile, pick, pickBy, pull, pullAt, random, randomInt, range, rangeRight, reduceAsync, remove, rest, retry, reverseString, round, sample, sampleSize, shuffle, snakeCase, sortBy, spread, startCase, sum, sumBy, tail, take, takeRight, takeRightWhile, takeWhile, throttle, timeout, toCamelCaseKeys, toFilled, toMerged, toSnakeCaseKeys, trim, trimEnd, trimStart, unary, unescape, union, unionBy, unionWith, uniq, uniqBy, uniqWith, unzip, unzipWith, upperCase, upperFirst, windowed, withTimeout, without, words, xor, xorBy, xorWith, zip, zipObject, zipWith };
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_at = require("./array/at.js");
|
|
3
|
+
const require_cartesianProduct = require("./array/cartesianProduct.js");
|
|
3
4
|
const require_chunk = require("./array/chunk.js");
|
|
5
|
+
const require_combinations = require("./array/combinations.js");
|
|
4
6
|
const require_compact = require("./array/compact.js");
|
|
5
7
|
const require_countBy = require("./array/countBy.js");
|
|
6
8
|
const require_difference = require("./array/difference.js");
|
|
@@ -163,6 +165,7 @@ const require_isUndefined = require("./predicate/isUndefined.js");
|
|
|
163
165
|
const require_isWeakMap = require("./predicate/isWeakMap.js");
|
|
164
166
|
const require_isWeakSet = require("./predicate/isWeakSet.js");
|
|
165
167
|
require("./predicate/index.js");
|
|
168
|
+
const require_allKeyed = require("./promise/allKeyed.js");
|
|
166
169
|
const require_mutex = require("./promise/mutex.js");
|
|
167
170
|
const require_timeout = require("./promise/timeout.js");
|
|
168
171
|
const require_withTimeout = require("./promise/withTimeout.js");
|
|
@@ -194,6 +197,7 @@ exports.Mutex = require_mutex.Mutex;
|
|
|
194
197
|
exports.Semaphore = require_semaphore.Semaphore;
|
|
195
198
|
exports.TimeoutError = require_TimeoutError.TimeoutError;
|
|
196
199
|
exports.after = require_after.after;
|
|
200
|
+
exports.allKeyed = require_allKeyed.allKeyed;
|
|
197
201
|
exports.ary = require_ary.ary;
|
|
198
202
|
exports.assert = require_invariant.invariant;
|
|
199
203
|
exports.asyncNoop = require_asyncNoop.asyncNoop;
|
|
@@ -203,11 +207,13 @@ exports.attemptAsync = require_attemptAsync.attemptAsync;
|
|
|
203
207
|
exports.before = require_before.before;
|
|
204
208
|
exports.camelCase = require_camelCase.camelCase;
|
|
205
209
|
exports.capitalize = require_capitalize.capitalize;
|
|
210
|
+
exports.cartesianProduct = require_cartesianProduct.cartesianProduct;
|
|
206
211
|
exports.chunk = require_chunk.chunk;
|
|
207
212
|
exports.clamp = require_clamp.clamp;
|
|
208
213
|
exports.clone = require_clone.clone;
|
|
209
214
|
exports.cloneDeep = require_cloneDeep.cloneDeep;
|
|
210
215
|
exports.cloneDeepWith = require_cloneDeepWith.cloneDeepWith;
|
|
216
|
+
exports.combinations = require_combinations.combinations;
|
|
211
217
|
exports.compact = require_compact.compact;
|
|
212
218
|
exports.constantCase = require_constantCase.constantCase;
|
|
213
219
|
exports.countBy = require_countBy.countBy;
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { at } from "./array/at.mjs";
|
|
2
|
+
import { cartesianProduct } from "./array/cartesianProduct.mjs";
|
|
2
3
|
import { chunk } from "./array/chunk.mjs";
|
|
4
|
+
import { combinations } from "./array/combinations.mjs";
|
|
3
5
|
import { compact } from "./array/compact.mjs";
|
|
4
6
|
import { countBy } from "./array/countBy.mjs";
|
|
5
7
|
import { difference } from "./array/difference.mjs";
|
|
@@ -162,6 +164,7 @@ import { isUndefined } from "./predicate/isUndefined.mjs";
|
|
|
162
164
|
import { isWeakMap } from "./predicate/isWeakMap.mjs";
|
|
163
165
|
import { isWeakSet } from "./predicate/isWeakSet.mjs";
|
|
164
166
|
import "./predicate/index.mjs";
|
|
167
|
+
import { allKeyed } from "./promise/allKeyed.mjs";
|
|
165
168
|
import { Mutex } from "./promise/mutex.mjs";
|
|
166
169
|
import { timeout } from "./promise/timeout.mjs";
|
|
167
170
|
import { withTimeout } from "./promise/withTimeout.mjs";
|
|
@@ -188,4 +191,4 @@ import { attempt } from "./util/attempt.mjs";
|
|
|
188
191
|
import { attemptAsync } from "./util/attemptAsync.mjs";
|
|
189
192
|
import { invariant } from "./util/invariant.mjs";
|
|
190
193
|
import "./util/index.mjs";
|
|
191
|
-
export { AbortError, Mutex, Semaphore, TimeoutError, after, ary, invariant as assert, asyncNoop, at, attempt, attemptAsync, before, camelCase, capitalize, chunk, clamp, clone, cloneDeep, cloneDeepWith, compact, constantCase, countBy, curry, curryRight, debounce, deburr, delay, difference, differenceBy, differenceWith, drop, dropRight, dropRightWhile, dropWhile, escape, escapeRegExp, fill, filterAsync, findKey, flatMap, flatMapAsync, flatMapDeep, flatten, flattenDeep, flattenObject, flow, flowRight, forEachAsync, forEachRight, groupBy, head, identity, inRange, initial, intersection, intersectionBy, intersectionWith, invariant, invert, isArrayBuffer, isBlob, isBoolean, isBrowser, isBuffer, isDate, isEmptyObject, isEqual, isEqualWith, isError, isFile, isFunction, isJSON, isJSONArray, isJSONObject, isJSONValue, isLength, isMap, isNil, isNode, isNotNil, isNull, isNumber, isPlainObject, isPrimitive, isPromise, isRegExp, isSet, isString, isSubset, isSubsetWith, isSymbol, isTypedArray, isUndefined, isWeakMap, isWeakSet, kebabCase, keyBy, last, limitAsync, lowerCase, lowerFirst, mapAsync, mapKeys, mapValues, maxBy, mean, meanBy, median, medianBy, memoize, merge, mergeWith, minBy, negate, noop, omit, omitBy, once, orderBy, pad, partial, partialRight, partition, pascalCase, percentile, pick, pickBy, pull, pullAt, random, randomInt, range, rangeRight, reduceAsync, remove, rest, retry, reverseString, round, sample, sampleSize, shuffle, snakeCase, sortBy, spread, startCase, sum, sumBy, tail, take, takeRight, takeRightWhile, takeWhile, throttle, timeout, toCamelCaseKeys, toFilled, toMerged, toSnakeCaseKeys, trim, trimEnd, trimStart, unary, unescape, union, unionBy, unionWith, uniq, uniqBy, uniqWith, unzip, unzipWith, upperCase, upperFirst, windowed, withTimeout, without, words, xor, xorBy, xorWith, zip, zipObject, zipWith };
|
|
194
|
+
export { AbortError, Mutex, Semaphore, TimeoutError, after, allKeyed, ary, invariant as assert, asyncNoop, at, attempt, attemptAsync, before, camelCase, capitalize, cartesianProduct, chunk, clamp, clone, cloneDeep, cloneDeepWith, combinations, compact, constantCase, countBy, curry, curryRight, debounce, deburr, delay, difference, differenceBy, differenceWith, drop, dropRight, dropRightWhile, dropWhile, escape, escapeRegExp, fill, filterAsync, findKey, flatMap, flatMapAsync, flatMapDeep, flatten, flattenDeep, flattenObject, flow, flowRight, forEachAsync, forEachRight, groupBy, head, identity, inRange, initial, intersection, intersectionBy, intersectionWith, invariant, invert, isArrayBuffer, isBlob, isBoolean, isBrowser, isBuffer, isDate, isEmptyObject, isEqual, isEqualWith, isError, isFile, isFunction, isJSON, isJSONArray, isJSONObject, isJSONValue, isLength, isMap, isNil, isNode, isNotNil, isNull, isNumber, isPlainObject, isPrimitive, isPromise, isRegExp, isSet, isString, isSubset, isSubsetWith, isSymbol, isTypedArray, isUndefined, isWeakMap, isWeakSet, kebabCase, keyBy, last, limitAsync, lowerCase, lowerFirst, mapAsync, mapKeys, mapValues, maxBy, mean, meanBy, median, medianBy, memoize, merge, mergeWith, minBy, negate, noop, omit, omitBy, once, orderBy, pad, partial, partialRight, partition, pascalCase, percentile, pick, pickBy, pull, pullAt, random, randomInt, range, rangeRight, reduceAsync, remove, rest, retry, reverseString, round, sample, sampleSize, shuffle, snakeCase, sortBy, spread, startCase, sum, sumBy, tail, take, takeRight, takeRightWhile, takeWhile, throttle, timeout, toCamelCaseKeys, toFilled, toMerged, toSnakeCaseKeys, trim, trimEnd, trimStart, unary, unescape, union, unionBy, unionWith, uniq, uniqBy, uniqWith, unzip, unzipWith, upperCase, upperFirst, windowed, withTimeout, without, words, xor, xorBy, xorWith, zip, zipObject, zipWith };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
//#region src/promise/allKeyed.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Resolves an object of promises concurrently, returning an object with the same keys and resolved values.
|
|
4
|
+
*
|
|
5
|
+
* Similar to `Promise.all`, but accepts an object of promises instead of an array,
|
|
6
|
+
* preserving the keys in the result. This makes it easy to destructure the resolved values
|
|
7
|
+
* by name instead of relying on positional indices.
|
|
8
|
+
*
|
|
9
|
+
* Based on the [TC39 `Promise.allKeyed` proposal](https://github.com/tc39/proposal-await-dictionary).
|
|
10
|
+
*
|
|
11
|
+
* @template T - A record type where each value is a promise or a value.
|
|
12
|
+
* @param {T} tasks - An object whose values are promises (or plain values) to resolve concurrently.
|
|
13
|
+
* @returns {Promise<{ [K in keyof T]: Awaited<T[K]> }>} A promise that resolves to an object with the same keys and resolved values.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* const { user, posts } = await allKeyed({
|
|
17
|
+
* user: fetchUser(),
|
|
18
|
+
* posts: fetchPosts(),
|
|
19
|
+
* });
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* // Plain values are also supported
|
|
23
|
+
* const result = await allKeyed({
|
|
24
|
+
* a: Promise.resolve(1),
|
|
25
|
+
* b: 2,
|
|
26
|
+
* });
|
|
27
|
+
* // { a: 1, b: 2 }
|
|
28
|
+
*/
|
|
29
|
+
declare function allKeyed<T extends Record<string, unknown>>(tasks: T): Promise<{ [K in keyof T]: Awaited<T[K]> }>;
|
|
30
|
+
//#endregion
|
|
31
|
+
export { allKeyed };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
//#region src/promise/allKeyed.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Resolves an object of promises concurrently, returning an object with the same keys and resolved values.
|
|
4
|
+
*
|
|
5
|
+
* Similar to `Promise.all`, but accepts an object of promises instead of an array,
|
|
6
|
+
* preserving the keys in the result. This makes it easy to destructure the resolved values
|
|
7
|
+
* by name instead of relying on positional indices.
|
|
8
|
+
*
|
|
9
|
+
* Based on the [TC39 `Promise.allKeyed` proposal](https://github.com/tc39/proposal-await-dictionary).
|
|
10
|
+
*
|
|
11
|
+
* @template T - A record type where each value is a promise or a value.
|
|
12
|
+
* @param {T} tasks - An object whose values are promises (or plain values) to resolve concurrently.
|
|
13
|
+
* @returns {Promise<{ [K in keyof T]: Awaited<T[K]> }>} A promise that resolves to an object with the same keys and resolved values.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* const { user, posts } = await allKeyed({
|
|
17
|
+
* user: fetchUser(),
|
|
18
|
+
* posts: fetchPosts(),
|
|
19
|
+
* });
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* // Plain values are also supported
|
|
23
|
+
* const result = await allKeyed({
|
|
24
|
+
* a: Promise.resolve(1),
|
|
25
|
+
* b: 2,
|
|
26
|
+
* });
|
|
27
|
+
* // { a: 1, b: 2 }
|
|
28
|
+
*/
|
|
29
|
+
declare function allKeyed<T extends Record<string, unknown>>(tasks: T): Promise<{ [K in keyof T]: Awaited<T[K]> }>;
|
|
30
|
+
//#endregion
|
|
31
|
+
export { allKeyed };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
//#region src/promise/allKeyed.ts
|
|
2
|
+
/**
|
|
3
|
+
* Resolves an object of promises concurrently, returning an object with the same keys and resolved values.
|
|
4
|
+
*
|
|
5
|
+
* Similar to `Promise.all`, but accepts an object of promises instead of an array,
|
|
6
|
+
* preserving the keys in the result. This makes it easy to destructure the resolved values
|
|
7
|
+
* by name instead of relying on positional indices.
|
|
8
|
+
*
|
|
9
|
+
* Based on the [TC39 `Promise.allKeyed` proposal](https://github.com/tc39/proposal-await-dictionary).
|
|
10
|
+
*
|
|
11
|
+
* @template T - A record type where each value is a promise or a value.
|
|
12
|
+
* @param {T} tasks - An object whose values are promises (or plain values) to resolve concurrently.
|
|
13
|
+
* @returns {Promise<{ [K in keyof T]: Awaited<T[K]> }>} A promise that resolves to an object with the same keys and resolved values.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* const { user, posts } = await allKeyed({
|
|
17
|
+
* user: fetchUser(),
|
|
18
|
+
* posts: fetchPosts(),
|
|
19
|
+
* });
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* // Plain values are also supported
|
|
23
|
+
* const result = await allKeyed({
|
|
24
|
+
* a: Promise.resolve(1),
|
|
25
|
+
* b: 2,
|
|
26
|
+
* });
|
|
27
|
+
* // { a: 1, b: 2 }
|
|
28
|
+
*/
|
|
29
|
+
async function allKeyed(tasks) {
|
|
30
|
+
const keys = Object.keys(tasks);
|
|
31
|
+
const values = await Promise.all(keys.map((key) => tasks[key]));
|
|
32
|
+
const result = {};
|
|
33
|
+
for (let i = 0; i < keys.length; i++) result[keys[i]] = values[i];
|
|
34
|
+
return result;
|
|
35
|
+
}
|
|
36
|
+
//#endregion
|
|
37
|
+
exports.allKeyed = allKeyed;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
//#region src/promise/allKeyed.ts
|
|
2
|
+
/**
|
|
3
|
+
* Resolves an object of promises concurrently, returning an object with the same keys and resolved values.
|
|
4
|
+
*
|
|
5
|
+
* Similar to `Promise.all`, but accepts an object of promises instead of an array,
|
|
6
|
+
* preserving the keys in the result. This makes it easy to destructure the resolved values
|
|
7
|
+
* by name instead of relying on positional indices.
|
|
8
|
+
*
|
|
9
|
+
* Based on the [TC39 `Promise.allKeyed` proposal](https://github.com/tc39/proposal-await-dictionary).
|
|
10
|
+
*
|
|
11
|
+
* @template T - A record type where each value is a promise or a value.
|
|
12
|
+
* @param {T} tasks - An object whose values are promises (or plain values) to resolve concurrently.
|
|
13
|
+
* @returns {Promise<{ [K in keyof T]: Awaited<T[K]> }>} A promise that resolves to an object with the same keys and resolved values.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* const { user, posts } = await allKeyed({
|
|
17
|
+
* user: fetchUser(),
|
|
18
|
+
* posts: fetchPosts(),
|
|
19
|
+
* });
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* // Plain values are also supported
|
|
23
|
+
* const result = await allKeyed({
|
|
24
|
+
* a: Promise.resolve(1),
|
|
25
|
+
* b: 2,
|
|
26
|
+
* });
|
|
27
|
+
* // { a: 1, b: 2 }
|
|
28
|
+
*/
|
|
29
|
+
async function allKeyed(tasks) {
|
|
30
|
+
const keys = Object.keys(tasks);
|
|
31
|
+
const values = await Promise.all(keys.map((key) => tasks[key]));
|
|
32
|
+
const result = {};
|
|
33
|
+
for (let i = 0; i < keys.length; i++) result[keys[i]] = values[i];
|
|
34
|
+
return result;
|
|
35
|
+
}
|
|
36
|
+
//#endregion
|
|
37
|
+
export { allKeyed };
|
package/dist/promise/index.d.mts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { allKeyed } from "./allKeyed.mjs";
|
|
1
2
|
import { delay } from "./delay.mjs";
|
|
2
3
|
import { Mutex } from "./mutex.mjs";
|
|
3
4
|
import { Semaphore } from "./semaphore.mjs";
|
|
4
5
|
import { timeout } from "./timeout.mjs";
|
|
5
6
|
import { withTimeout } from "./withTimeout.mjs";
|
|
6
|
-
export { Mutex, Semaphore, delay, timeout, withTimeout };
|
|
7
|
+
export { Mutex, Semaphore, allKeyed, delay, timeout, withTimeout };
|
package/dist/promise/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { allKeyed } from "./allKeyed.js";
|
|
1
2
|
import { delay } from "./delay.js";
|
|
2
3
|
import { Mutex } from "./mutex.js";
|
|
3
4
|
import { Semaphore } from "./semaphore.js";
|
|
4
5
|
import { timeout } from "./timeout.js";
|
|
5
6
|
import { withTimeout } from "./withTimeout.js";
|
|
6
|
-
export { Mutex, Semaphore, delay, timeout, withTimeout };
|
|
7
|
+
export { Mutex, Semaphore, allKeyed, delay, timeout, withTimeout };
|
package/dist/promise/index.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_semaphore = require("./semaphore.js");
|
|
3
3
|
const require_delay = require("./delay.js");
|
|
4
|
+
const require_allKeyed = require("./allKeyed.js");
|
|
4
5
|
const require_mutex = require("./mutex.js");
|
|
5
6
|
const require_timeout = require("./timeout.js");
|
|
6
7
|
const require_withTimeout = require("./withTimeout.js");
|
|
7
8
|
exports.Mutex = require_mutex.Mutex;
|
|
8
9
|
exports.Semaphore = require_semaphore.Semaphore;
|
|
10
|
+
exports.allKeyed = require_allKeyed.allKeyed;
|
|
9
11
|
exports.delay = require_delay.delay;
|
|
10
12
|
exports.timeout = require_timeout.timeout;
|
|
11
13
|
exports.withTimeout = require_withTimeout.withTimeout;
|
package/dist/promise/index.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Semaphore } from "./semaphore.mjs";
|
|
2
2
|
import { delay } from "./delay.mjs";
|
|
3
|
+
import { allKeyed } from "./allKeyed.mjs";
|
|
3
4
|
import { Mutex } from "./mutex.mjs";
|
|
4
5
|
import { timeout } from "./timeout.mjs";
|
|
5
6
|
import { withTimeout } from "./withTimeout.mjs";
|
|
6
|
-
export { Mutex, Semaphore, delay, timeout, withTimeout };
|
|
7
|
+
export { Mutex, Semaphore, allKeyed, delay, timeout, withTimeout };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "es-toolkit",
|
|
3
|
-
"version": "1.46.1-dev.
|
|
3
|
+
"version": "1.46.1-dev.1803+0813a3fd",
|
|
4
4
|
"description": "A state-of-the-art, high-performance JavaScript utility library with a small bundle size and strong type annotations.",
|
|
5
5
|
"homepage": "https://es-toolkit.dev",
|
|
6
6
|
"bugs": "https://github.com/toss/es-toolkit/issues",
|