es-toolkit 1.15.1 → 1.16.0

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.
Files changed (99) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/_chunk/{initial-CBsbzo.js → initial-y0QrPY.js} +28 -0
  3. package/dist/_chunk/{isFunction-D0hq6d.js → isFunction-aCEz9d.js} +5 -7
  4. package/dist/_chunk/{isObjectLike-BeLCsr.js → toMerged-BGwYW5.js} +25 -0
  5. package/dist/_internal/compareValues.mjs +11 -0
  6. package/dist/array/index.d.mts +1 -0
  7. package/dist/array/index.d.ts +1 -0
  8. package/dist/array/index.js +3 -11
  9. package/dist/array/index.mjs +1 -0
  10. package/dist/array/orderBy.mjs +2 -9
  11. package/dist/array/sortBy.d.mts +35 -0
  12. package/dist/array/sortBy.d.ts +35 -0
  13. package/dist/array/sortBy.mjs +19 -0
  14. package/dist/browser.global.js +1 -1
  15. package/dist/browser.global.js.map +1 -1
  16. package/dist/compat/_internal/getSymbols.mjs +1 -2
  17. package/dist/compat/_internal/toKey.mjs +13 -0
  18. package/dist/compat/array/find.d.mts +122 -0
  19. package/dist/compat/array/find.d.ts +122 -0
  20. package/dist/compat/array/find.mjs +42 -0
  21. package/dist/compat/array/findIndex.d.mts +62 -0
  22. package/dist/compat/array/findIndex.d.ts +62 -0
  23. package/dist/compat/array/findIndex.mjs +26 -0
  24. package/dist/compat/array/indexOf.d.mts +21 -0
  25. package/dist/compat/array/indexOf.d.ts +21 -0
  26. package/dist/compat/array/indexOf.mjs +20 -0
  27. package/dist/compat/function/ary.d.mts +2 -1
  28. package/dist/compat/function/ary.d.ts +2 -1
  29. package/dist/compat/function/bind.d.mts +3 -1
  30. package/dist/compat/function/bind.d.ts +3 -1
  31. package/dist/compat/function/rest.d.mts +33 -0
  32. package/dist/compat/function/rest.d.ts +33 -0
  33. package/dist/compat/function/rest.mjs +11 -0
  34. package/dist/compat/index.d.mts +13 -0
  35. package/dist/compat/index.d.ts +13 -0
  36. package/dist/compat/index.js +413 -259
  37. package/dist/compat/index.mjs +13 -0
  38. package/dist/compat/object/get.mjs +2 -4
  39. package/dist/compat/object/has.d.mts +32 -0
  40. package/dist/compat/object/has.d.ts +32 -0
  41. package/dist/compat/object/has.mjs +34 -0
  42. package/dist/compat/object/merge.d.mts +1 -0
  43. package/dist/compat/object/merge.d.ts +1 -0
  44. package/dist/compat/object/mergeWith.d.mts +6 -0
  45. package/dist/compat/object/mergeWith.d.ts +6 -0
  46. package/dist/compat/object/mergeWith.mjs +0 -3
  47. package/dist/compat/object/set.mjs +1 -5
  48. package/dist/compat/predicate/isArrayLike.mjs +1 -2
  49. package/dist/compat/predicate/isString.d.mts +20 -0
  50. package/dist/compat/predicate/isString.d.ts +20 -0
  51. package/dist/compat/predicate/isString.mjs +13 -0
  52. package/dist/compat/predicate/matchesProperty.d.mts +28 -0
  53. package/dist/compat/predicate/matchesProperty.d.ts +28 -0
  54. package/dist/compat/predicate/matchesProperty.mjs +22 -0
  55. package/dist/compat/string/padEnd.d.mts +20 -0
  56. package/dist/compat/string/padEnd.d.ts +20 -0
  57. package/dist/compat/string/padEnd.mjs +5 -0
  58. package/dist/function/ary.d.mts +1 -1
  59. package/dist/function/ary.d.ts +1 -1
  60. package/dist/function/index.d.mts +4 -0
  61. package/dist/function/index.d.ts +4 -0
  62. package/dist/function/index.js +76 -0
  63. package/dist/function/index.mjs +4 -0
  64. package/dist/function/memoize.d.mts +87 -0
  65. package/dist/function/memoize.d.ts +87 -0
  66. package/dist/function/memoize.mjs +16 -0
  67. package/dist/function/partial.d.mts +33 -0
  68. package/dist/function/partial.d.ts +33 -0
  69. package/dist/function/partial.mjs +23 -0
  70. package/dist/function/partialRight.d.mts +33 -0
  71. package/dist/function/partialRight.d.ts +33 -0
  72. package/dist/function/partialRight.mjs +25 -0
  73. package/dist/function/rest.d.mts +33 -0
  74. package/dist/function/rest.d.ts +33 -0
  75. package/dist/function/rest.mjs +12 -0
  76. package/dist/function/unary.d.mts +1 -1
  77. package/dist/function/unary.d.ts +1 -1
  78. package/dist/index.d.mts +7 -0
  79. package/dist/index.d.ts +7 -0
  80. package/dist/index.js +21 -14
  81. package/dist/index.mjs +7 -0
  82. package/dist/object/index.d.mts +1 -0
  83. package/dist/object/index.d.ts +1 -0
  84. package/dist/object/index.js +14 -32
  85. package/dist/object/index.mjs +1 -0
  86. package/dist/object/toMerged.d.mts +45 -0
  87. package/dist/object/toMerged.d.ts +45 -0
  88. package/dist/object/toMerged.mjs +8 -0
  89. package/dist/predicate/index.d.mts +1 -0
  90. package/dist/predicate/index.d.ts +1 -0
  91. package/dist/predicate/index.js +6 -1
  92. package/dist/predicate/index.mjs +1 -0
  93. package/dist/predicate/isEqual.mjs +4 -5
  94. package/dist/predicate/isString.d.mts +20 -0
  95. package/dist/predicate/isString.d.ts +20 -0
  96. package/dist/predicate/isString.mjs +5 -0
  97. package/dist/string/camelCase.mjs +2 -2
  98. package/dist/string/index.js +2 -2
  99. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # es-toolkit Changelog
2
2
 
3
+ ## Version v1.16.0
4
+
5
+ Released on August 15th, 2024.
6
+
7
+ - Added support for [memoize](https://es-toolkit.slash.page/reference/function/memoize.html), [find](https://es-toolkit.slash.page/reference/compat/array/find.html), [findIndex](https://es-toolkit.slash.page/reference/compat/array/findIndex.html), [has](https://es-toolkit.slash.page/reference/compat/object/has.html), [partial](https://es-toolkit.slash.page/reference/function/partial.html), [partialRight](https://es-toolkit.slash.page/reference/function/partialRight.html), [sortBy](https://es-toolkit.slash.page/reference/array/sortBy.html), [isString](https://es-toolkit.slash.page/reference/predicate/isString.html), [rest](https://es-toolkit.slash.page/reference/function/rest.html), [padEnd](https://es-toolkit.slash.page/reference/compat/string/padEnd.html).
8
+
3
9
  ## Version v1.15.1
4
10
 
5
11
  Released on August 10th, 2024.
@@ -190,6 +190,16 @@ function minBy(items, getValue) {
190
190
  return minElement;
191
191
  }
192
192
 
193
+ function compareValues(a, b, order) {
194
+ if (a < b) {
195
+ return order === 'asc' ? -1 : 1;
196
+ }
197
+ if (a > b) {
198
+ return order === 'asc' ? 1 : -1;
199
+ }
200
+ return 0;
201
+ }
202
+
193
203
  function partition(arr, isInTruthy) {
194
204
  const truthy = [];
195
205
  const falsy = [];
@@ -204,6 +214,22 @@ function partition(arr, isInTruthy) {
204
214
  return [truthy, falsy];
205
215
  }
206
216
 
217
+ function sortBy(arr, criteria) {
218
+ return arr.slice().sort((a, b) => {
219
+ for (let i = 0; i < criteria.length; i++) {
220
+ const iteratee = criteria[i];
221
+ const iterateeIsFunction = typeof iteratee === 'function';
222
+ const valueA = iterateeIsFunction ? iteratee(a) : a[iteratee];
223
+ const valueB = iterateeIsFunction ? iteratee(b) : b[iteratee];
224
+ const result = compareValues(valueA, valueB, 'asc');
225
+ if (result !== 0) {
226
+ return result;
227
+ }
228
+ }
229
+ return 0;
230
+ });
231
+ }
232
+
207
233
  function sample(arr) {
208
234
  const randomIndex = Math.floor(Math.random() * arr.length);
209
235
  return arr[randomIndex];
@@ -439,6 +465,7 @@ function initial(arr) {
439
465
 
440
466
  exports.chunk = chunk;
441
467
  exports.compact = compact;
468
+ exports.compareValues = compareValues;
442
469
  exports.countBy = countBy;
443
470
  exports.difference = difference;
444
471
  exports.differenceBy = differenceBy;
@@ -466,6 +493,7 @@ exports.partition = partition;
466
493
  exports.sample = sample;
467
494
  exports.sampleSize = sampleSize;
468
495
  exports.shuffle = shuffle;
496
+ exports.sortBy = sortBy;
469
497
  exports.tail = tail;
470
498
  exports.take = take;
471
499
  exports.takeRight = takeRight;
@@ -30,8 +30,7 @@ const float32ArrayTag = '[object Float32Array]';
30
30
  const float64ArrayTag = '[object Float64Array]';
31
31
 
32
32
  function getSymbols(object) {
33
- return Object.getOwnPropertySymbols(object)
34
- .filter(symbol => object.propertyIsEnumerable(symbol));
33
+ return Object.getOwnPropertySymbols(object).filter(symbol => Object.prototype.propertyIsEnumerable.call(object, symbol));
35
34
  }
36
35
 
37
36
  function getTag(value) {
@@ -85,7 +84,7 @@ function areObjectsEqual(a, b, stack) {
85
84
  case numberTag: {
86
85
  const x = a.valueOf();
87
86
  const y = b.valueOf();
88
- return x === y || Number.isNaN(x) && Number.isNaN(y);
87
+ return x === y || (Number.isNaN(x) && Number.isNaN(y));
89
88
  }
90
89
  case booleanTag:
91
90
  case dateTag:
@@ -95,7 +94,7 @@ function areObjectsEqual(a, b, stack) {
95
94
  return a.source === b.source && a.flags === b.flags;
96
95
  }
97
96
  case functionTag: {
98
- return a == b;
97
+ return a === b;
99
98
  }
100
99
  }
101
100
  stack = stack ?? new Map();
@@ -178,8 +177,7 @@ function areObjectsEqual(a, b, stack) {
178
177
  return a.name === b.name && a.message === b.message;
179
178
  }
180
179
  case objectTag: {
181
- const areEqualInstances = areObjectsEqual(a.constructor, b.constructor, stack) ||
182
- (isTypedArray.isPlainObject(a) && isTypedArray.isPlainObject(b));
180
+ const areEqualInstances = areObjectsEqual(a.constructor, b.constructor, stack) || (isTypedArray.isPlainObject(a) && isTypedArray.isPlainObject(b));
183
181
  if (!areEqualInstances) {
184
182
  return false;
185
183
  }
@@ -191,7 +189,7 @@ function areObjectsEqual(a, b, stack) {
191
189
  for (let i = 0; i < aKeys.length; i++) {
192
190
  const propKey = aKeys[i];
193
191
  const aProp = a[propKey];
194
- if (!b.hasOwnProperty(propKey)) {
192
+ if (!Object.prototype.hasOwnProperty.call(b, propKey)) {
195
193
  return false;
196
194
  }
197
195
  const bProp = b[propKey];
@@ -249,6 +249,29 @@ function isObjectLike(value) {
249
249
  return typeof value === 'object' && value !== null;
250
250
  }
251
251
 
252
+ function merge(target, source) {
253
+ const sourceKeys = Object.keys(source);
254
+ for (let i = 0; i < sourceKeys.length; i++) {
255
+ const key = sourceKeys[i];
256
+ const sourceValue = source[key];
257
+ const targetValue = target[key];
258
+ if (Array.isArray(sourceValue)) {
259
+ target[key] = merge(targetValue ?? [], sourceValue);
260
+ }
261
+ else if (isObjectLike(targetValue) && isObjectLike(sourceValue)) {
262
+ target[key] = merge(targetValue ?? {}, sourceValue);
263
+ }
264
+ else if (targetValue === undefined || sourceValue !== undefined) {
265
+ target[key] = sourceValue;
266
+ }
267
+ }
268
+ return target;
269
+ }
270
+
271
+ function toMerged(target, source) {
272
+ return merge(cloneDeep(target), source);
273
+ }
274
+
252
275
  exports.clone = clone;
253
276
  exports.cloneDeep = cloneDeep;
254
277
  exports.copyProperties = copyProperties;
@@ -257,7 +280,9 @@ exports.invert = invert;
257
280
  exports.isObjectLike = isObjectLike;
258
281
  exports.mapKeys = mapKeys;
259
282
  exports.mapValues = mapValues;
283
+ exports.merge = merge;
260
284
  exports.omit = omit;
261
285
  exports.omitBy = omitBy;
262
286
  exports.pick = pick;
263
287
  exports.pickBy = pickBy;
288
+ exports.toMerged = toMerged;
@@ -0,0 +1,11 @@
1
+ function compareValues(a, b, order) {
2
+ if (a < b) {
3
+ return order === 'asc' ? -1 : 1;
4
+ }
5
+ if (a > b) {
6
+ return order === 'asc' ? 1 : -1;
7
+ }
8
+ return 0;
9
+ }
10
+
11
+ export { compareValues };
@@ -22,6 +22,7 @@ export { maxBy } from './maxBy.mjs';
22
22
  export { minBy } from './minBy.mjs';
23
23
  export { orderBy } from './orderBy.mjs';
24
24
  export { partition } from './partition.mjs';
25
+ export { sortBy } from './sortBy.mjs';
25
26
  export { sample } from './sample.mjs';
26
27
  export { sampleSize } from './sampleSize.mjs';
27
28
  export { shuffle } from './shuffle.mjs';
@@ -22,6 +22,7 @@ export { maxBy } from './maxBy.js';
22
22
  export { minBy } from './minBy.js';
23
23
  export { orderBy } from './orderBy.js';
24
24
  export { partition } from './partition.js';
25
+ export { sortBy } from './sortBy.js';
25
26
  export { sample } from './sample.js';
26
27
  export { sampleSize } from './sampleSize.js';
27
28
  export { shuffle } from './shuffle.js';
@@ -2,28 +2,19 @@
2
2
 
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
 
5
- const initial = require('../_chunk/initial-CBsbzo.js');
5
+ const initial = require('../_chunk/initial-y0QrPY.js');
6
6
 
7
7
  function flattenDeep(arr) {
8
8
  return initial.flatten(arr, Infinity);
9
9
  }
10
10
 
11
11
  function orderBy(collection, keys, orders) {
12
- const compareValues = (a, b, order) => {
13
- if (a < b) {
14
- return order === 'asc' ? -1 : 1;
15
- }
16
- if (a > b) {
17
- return order === 'asc' ? 1 : -1;
18
- }
19
- return 0;
20
- };
21
12
  const effectiveOrders = keys.map((_, index) => orders[index] || orders[orders.length - 1]);
22
13
  return collection.slice().sort((a, b) => {
23
14
  for (let i = 0; i < keys.length; i++) {
24
15
  const key = keys[i];
25
16
  const order = effectiveOrders[i];
26
- const result = compareValues(a[key], b[key], order);
17
+ const result = initial.compareValues(a[key], b[key], order);
27
18
  if (result !== 0) {
28
19
  return result;
29
20
  }
@@ -61,6 +52,7 @@ exports.partition = initial.partition;
61
52
  exports.sample = initial.sample;
62
53
  exports.sampleSize = initial.sampleSize;
63
54
  exports.shuffle = initial.shuffle;
55
+ exports.sortBy = initial.sortBy;
64
56
  exports.tail = initial.tail;
65
57
  exports.take = initial.take;
66
58
  exports.takeRight = initial.takeRight;
@@ -22,6 +22,7 @@ export { maxBy } from './maxBy.mjs';
22
22
  export { minBy } from './minBy.mjs';
23
23
  export { orderBy } from './orderBy.mjs';
24
24
  export { partition } from './partition.mjs';
25
+ export { sortBy } from './sortBy.mjs';
25
26
  export { sample } from './sample.mjs';
26
27
  export { sampleSize } from './sampleSize.mjs';
27
28
  export { shuffle } from './shuffle.mjs';
@@ -1,13 +1,6 @@
1
+ import { compareValues } from '../_internal/compareValues.mjs';
2
+
1
3
  function orderBy(collection, keys, orders) {
2
- const compareValues = (a, b, order) => {
3
- if (a < b) {
4
- return order === 'asc' ? -1 : 1;
5
- }
6
- if (a > b) {
7
- return order === 'asc' ? 1 : -1;
8
- }
9
- return 0;
10
- };
11
4
  const effectiveOrders = keys.map((_, index) => orders[index] || orders[orders.length - 1]);
12
5
  return collection.slice().sort((a, b) => {
13
6
  for (let i = 0; i < keys.length; i++) {
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Sorts an array of objects based on the given `criteria`.
3
+ *
4
+ * - If you provide keys, it sorts the objects by the values of those keys.
5
+ * - If you provide functions, it sorts based on the values returned by those functions.
6
+ *
7
+ * The function returns the array of objects sorted in ascending order.
8
+ * If two objects have the same value for the current criterion, it uses the next criterion to determine their order.
9
+ *
10
+ * @template T - The type of the objects in the array.
11
+ * @param {T[]} arr - The array of objects to be sorted.
12
+ * @param {Array<((item: T) => unknown) | keyof T>} criteria - The criteria for sorting. This can be an array of object keys or functions that return values used for sorting.
13
+ * @returns {T[]} - The sorted array.
14
+ *
15
+ * @example
16
+ * const users = [
17
+ * { user: 'foo', age: 24 },
18
+ * { user: 'bar', age: 7 },
19
+ * { user: 'foo ', age: 8 },
20
+ * { user: 'bar ', age: 29 },
21
+ * ];
22
+ *
23
+ * sortBy(users, ['user', 'age']);
24
+ * sortBy(users, [obj => obj.user, 'age']);
25
+ * // results will be:
26
+ * // [
27
+ * // { user : 'bar', age: 7 },
28
+ * // { user : 'bar', age: 29 },
29
+ * // { user : 'foo', age: 8 },
30
+ * // { user : 'foo', age: 24 },
31
+ * // ]
32
+ */
33
+ declare function sortBy<T extends object>(arr: T[], criteria: Array<((item: T) => unknown) | keyof T>): T[];
34
+
35
+ export { sortBy };
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Sorts an array of objects based on the given `criteria`.
3
+ *
4
+ * - If you provide keys, it sorts the objects by the values of those keys.
5
+ * - If you provide functions, it sorts based on the values returned by those functions.
6
+ *
7
+ * The function returns the array of objects sorted in ascending order.
8
+ * If two objects have the same value for the current criterion, it uses the next criterion to determine their order.
9
+ *
10
+ * @template T - The type of the objects in the array.
11
+ * @param {T[]} arr - The array of objects to be sorted.
12
+ * @param {Array<((item: T) => unknown) | keyof T>} criteria - The criteria for sorting. This can be an array of object keys or functions that return values used for sorting.
13
+ * @returns {T[]} - The sorted array.
14
+ *
15
+ * @example
16
+ * const users = [
17
+ * { user: 'foo', age: 24 },
18
+ * { user: 'bar', age: 7 },
19
+ * { user: 'foo ', age: 8 },
20
+ * { user: 'bar ', age: 29 },
21
+ * ];
22
+ *
23
+ * sortBy(users, ['user', 'age']);
24
+ * sortBy(users, [obj => obj.user, 'age']);
25
+ * // results will be:
26
+ * // [
27
+ * // { user : 'bar', age: 7 },
28
+ * // { user : 'bar', age: 29 },
29
+ * // { user : 'foo', age: 8 },
30
+ * // { user : 'foo', age: 24 },
31
+ * // ]
32
+ */
33
+ declare function sortBy<T extends object>(arr: T[], criteria: Array<((item: T) => unknown) | keyof T>): T[];
34
+
35
+ export { sortBy };
@@ -0,0 +1,19 @@
1
+ import { compareValues } from '../_internal/compareValues.mjs';
2
+
3
+ function sortBy(arr, criteria) {
4
+ return arr.slice().sort((a, b) => {
5
+ for (let i = 0; i < criteria.length; i++) {
6
+ const iteratee = criteria[i];
7
+ const iterateeIsFunction = typeof iteratee === 'function';
8
+ const valueA = iterateeIsFunction ? iteratee(a) : a[iteratee];
9
+ const valueB = iterateeIsFunction ? iteratee(b) : b[iteratee];
10
+ const result = compareValues(valueA, valueB, 'asc');
11
+ if (result !== 0) {
12
+ return result;
13
+ }
14
+ }
15
+ return 0;
16
+ });
17
+ }
18
+
19
+ export { sortBy };
@@ -1,2 +1,2 @@
1
- var _=function(t){"use strict";function difference$1(t,e){const n=new Set(e);return t.filter((t=>!n.has(t)))}function differenceBy(t,e,n){const r=new Set(e.map((t=>n(t))));return t.filter((t=>!r.has(n(t))))}function differenceWith(t,e,n){return t.filter((t=>e.every((e=>!n(t,e)))))}function flatten$1(t,e=1){const n=[],r=Math.floor(e),recursive=(t,e)=>{for(const o of t)Array.isArray(o)&&e<r?recursive(o,e+1):n.push(o)};recursive(t,0);return n}function intersection(t,e){const n=new Set(e);return t.filter((t=>n.has(t)))}function intersectionBy(t,e,n){const r=new Set(e.map(n));return t.filter((t=>r.has(n(t))))}function intersectionWith(t,e,n){return t.filter((t=>e.some((e=>n(t,e)))))}function random(t,e){if(null==e){e=t;t=0}if(t>=e)throw new Error("Invalid input: The maximum value must be greater than the minimum value.");return Math.random()*(e-t)+t}function randomInt(t,e){return Math.floor(random(t,e))}function uniq(t){return Array.from(new Set(t))}function union(t,e){return uniq(t.concat(e))}function unionBy(t,e,n){const r=new Map;for(const o of[...t,...e]){const t=n(o);r.has(t)||r.set(t,o)}return Array.from(r.values())}function uniqWith(t,e){const n=[];for(const r of t){n.every((t=>!e(t,r)))&&n.push(r)}return n}function unionWith(t,e,n){return uniqWith(t.concat(e),n)}function zip(...t){const e=[],n=Math.max(...t.map((t=>t.length)));for(let r=0;r<n;r++){const n=[];for(const e of t)n.push(e[r]);e.push(n)}return e}function head(t){return t[0]}class AbortError extends Error{constructor(t="The operation was aborted"){super(t);this.name="AbortError"}}class TimeoutError extends Error{constructor(t="The operation was timed out"){super(t);this.name="TimeoutError"}}function noop(){}function ary$1(t,e){return function(...n){return t.apply(this,n.slice(0,e))}}function sum(t){let e=0;for(let n=0;n<t.length;n++)e+=t[n];return e}function mean(t){return sum(t)/t.length}function clone(t){if(function isPrimitive$1(t){return null==t||"object"!=typeof t&&"function"!=typeof t}(t))return t;if(Array.isArray(t))return t.slice();if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp)return new RegExp(t.source,t.flags);if(t instanceof Map){const e=new Map;for(const[n,r]of t)e.set(n,r);return e}if(t instanceof Set){const e=new Set;for(const n of t)e.add(n);return e}if("object"==typeof t){const e=Object.getPrototypeOf(t),n=Object.create(e);return Object.assign(n,t)}return t}function isPlainObject$1(t){if("object"!=typeof t)return!1;if(null==t)return!1;if(null===Object.getPrototypeOf(t))return!0;if("[object Object]"!==t.toString())return!1;let e=t;for(;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function flattenObjectImpl(t,e=""){const n={},r=Object.keys(t);for(let o=0;o<r.length;o++){const i=r[o],c=t[i],s=e?`${e}.${i}`:i;if(isPlainObject$1(c)&&Object.keys(c).length>0)Object.assign(n,flattenObjectImpl(c,s));else if(Array.isArray(c))for(let t=0;t<c.length;t++)n[`${s}.${t}`]=c[t];else n[s]=c}return n}function mapKeys$1(t,e){const n={},r=Object.keys(t);for(let o=0;o<r.length;o++){const i=r[o],c=t[i];n[e(c,i,t)]=c}return n}function mapValues$1(t,e){const n={},r=Object.keys(t);for(let o=0;o<r.length;o++){const i=r[o],c=t[i];n[i]=e(c,i,t)}return n}function isPrimitive(t){return null==t||"object"!=typeof t&&"function"!=typeof t}function isTypedArray$1(t){return t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Uint16Array||t instanceof Uint32Array||t instanceof BigUint64Array||t instanceof Int8Array||t instanceof Int16Array||t instanceof Int32Array||t instanceof BigInt64Array||t instanceof Float32Array||t instanceof Float64Array}function cloneDeep$1(t){return cloneDeepImpl(t)}function cloneDeepImpl(t,e=new Map){if(isPrimitive(t))return t;if(e.has(t))return e.get(t);if(Array.isArray(t)){const n=new Array(t.length);e.set(t,n);for(let r=0;r<t.length;r++)n[r]=cloneDeepImpl(t[r],e);Object.prototype.hasOwnProperty.call(t,"index")&&(n.index=t.index);Object.prototype.hasOwnProperty.call(t,"input")&&(n.input=t.input);return n}if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp){const e=new RegExp(t.source,t.flags);e.lastIndex=t.lastIndex;return e}if(t instanceof Map){const n=new Map;e.set(t,n);for(const[r,o]of t.entries())n.set(r,cloneDeepImpl(o,e));return n}if(t instanceof Set){const n=new Set;e.set(t,n);for(const r of t.values())n.add(cloneDeepImpl(r,e));return n}if("undefined"!=typeof Buffer&&Buffer.isBuffer(t))return t.subarray();if(isTypedArray$1(t)){const n=new(Object.getPrototypeOf(t).constructor)(t.length);e.set(t,n);for(let r=0;r<t.length;r++)n[r]=cloneDeepImpl(t[r],e);return n}if(t instanceof ArrayBuffer||"undefined"!=typeof SharedArrayBuffer&&t instanceof SharedArrayBuffer)return t.slice(0);if(t instanceof DataView){const n=new DataView(t.buffer.slice(0));e.set(t,n);copyProperties(n,t,e);return n}if("undefined"!=typeof File&&t instanceof File){const n=new File([t],t.name,{type:t.type});e.set(t,n);copyProperties(n,t,e);return n}if(t instanceof Blob){const n=new Blob([t],{type:t.type});e.set(t,n);copyProperties(n,t,e);return n}if(t instanceof Error){const n=new t.constructor;e.set(t,n);n.message=t.message;n.name=t.name;n.stack=t.stack;n.cause=t.cause;copyProperties(n,t,e);return n}if("object"==typeof t&&null!==t){const n={};e.set(t,n);copyProperties(n,t,e);return n}return t}function copyProperties(t,e,n){const r=Object.keys(e);for(let o=0;o<r.length;o++){const i=r[o],c=Object.getOwnPropertyDescriptor(e,i);(c?.writable||c?.set)&&(t[i]=cloneDeepImpl(e[i],n))}}function isObjectLike(t){return"object"==typeof t&&null!==t}const e="[object RegExp]",n="[object String]",r="[object Number]",o="[object Boolean]",i="[object Arguments]",c="[object Symbol]",s="[object Date]",u="[object Map]",a="[object Set]",f="[object Array]",l="[object Function]",y="[object ArrayBuffer]",h="[object Object]",p="[object Error]",g="[object DataView]",m="[object Uint8Array]",b="[object Uint8ClampedArray]",d="[object Uint16Array]",j="[object Uint32Array]",A="[object BigUint64Array]",O="[object Int8Array]",w="[object Int16Array]",B="[object Int32Array]",S="[object BigInt64Array]",M="[object Float32Array]",W="[object Float64Array]";function getSymbols(t){return Object.getOwnPropertySymbols(t).filter((e=>t.propertyIsEnumerable(e)))}function getTag(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}function areObjectsEqual(t,E,P){if(Object.is(t,E))return!0;let $=getTag(t),x=getTag(E);$===i&&($=h);x===i&&(x=h);if($!==x)return!1;switch($){case n:return t.toString()===E.toString();case r:{const e=t.valueOf(),n=E.valueOf();return e===n||Number.isNaN(e)&&Number.isNaN(n)}case o:case s:case c:return Object.is(t.valueOf(),E.valueOf());case e:return t.source===E.source&&t.flags===E.flags;case l:return t==E}const I=(P=P??new Map).get(t),k=P.get(E);if(null!=I&&null!=k)return I===E;P.set(t,E);P.set(E,t);try{switch($){case u:if(t.size!==E.size)return!1;for(const[e,n]of t.entries())if(!E.has(e)||!areObjectsEqual(n,E.get(e),P))return!1;return!0;case a:{if(t.size!==E.size)return!1;const e=Array.from(t.values()),n=Array.from(E.values());for(let t=0;t<e.length;t++){const r=e[t],o=n.findIndex((t=>areObjectsEqual(r,t,P)));if(-1===o)return!1;n.splice(o,1)}return!0}case f:case m:case b:case d:case j:case A:case O:case w:case B:case S:case M:case W:if("undefined"!=typeof Buffer&&Buffer.isBuffer(t)!==Buffer.isBuffer(E))return!1;if(t.length!==E.length)return!1;for(let e=0;e<t.length;e++)if(!areObjectsEqual(t[e],E[e],P))return!1;return!0;case y:return t.byteLength===E.byteLength&&areObjectsEqual(new Uint8Array(t),new Uint8Array(E),P);case g:return t.byteLength===E.byteLength&&t.byteOffset===E.byteOffset&&areObjectsEqual(t.buffer,E.buffer,P);case p:return t.name===E.name&&t.message===E.message;case h:{if(!(areObjectsEqual(t.constructor,E.constructor,P)||isPlainObject$1(t)&&isPlainObject$1(E)))return!1;const e=[...Object.keys(t),...getSymbols(t)],n=[...Object.keys(E),...getSymbols(E)];if(e.length!==n.length)return!1;for(let n=0;n<e.length;n++){const r=e[n],o=t[r];if(!E.hasOwnProperty(r))return!1;if(!areObjectsEqual(o,E[r],P))return!1}return!0}default:return!1}}finally{P.delete(t);P.delete(E)}}function isNil(t){return null==t}function isLength(t){return Number.isSafeInteger(t)&&t>=0}function delay(t,{signal:e}={}){return new Promise(((n,r)=>{const abortError=()=>{r(new AbortError)};if(e?.aborted)return abortError();const o=setTimeout(n,t);e?.addEventListener("abort",(()=>{clearTimeout(o);abortError()}),{once:!0})}))}async function timeout(t){await delay(t);throw new TimeoutError}const capitalize=t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase(),E=/[A-Z]?[a-z]+|[0-9]+|[A-Z]+(?![a-z])/g;function getWords(t){return Array.from(t.match(E)??[])}function flatten(t,e=1){const n=[],r=Math.floor(e);if(!Array.isArray(t))return n;const recursive=(t,e)=>{for(const o of t)e<r&&(Array.isArray(o)||Boolean(o?.[Symbol.isConcatSpreadable])||null!==o&&"object"==typeof o&&"[object Arguments]"===Object.prototype.toString.call(o))?Array.isArray(o)?recursive(o,e+1):recursive(Array.from(o),e+1):n.push(o)};recursive(t,0);return n}function isSymbol(t){return"symbol"==typeof t||null!=t&&t instanceof Symbol}const P=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,$=/^\w*$/;function isKey(t,e){return!Array.isArray(t)&&(!("number"!=typeof t&&"boolean"!=typeof t&&null!=t&&!isSymbol(t))||("string"==typeof t&&($.test(t)||!P.test(t))||null!=e&&Object.hasOwn(e,t)))}function toPath(t){const e=/\\(\\)?/g,n=RegExp("[^.[\\]]+|\\[(?:([^\"'][^[]*)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))","g"),r=[];"."===t[0]&&r.push("");let o,i=0;for(;null!==(o=n.exec(t));){let t=o[0];const c=o[1],s=o[2],u=o[3];s?t=u.replace(e,"$1"):c&&(t=c);r.push(t);n.lastIndex===i?n.lastIndex++:i=n.lastIndex}return r}const x=/^(?:0|[1-9]\d*)$/;function isIndex(t){switch(typeof t){case"number":return Number.isInteger(t)&&t>=0&&t<Number.MAX_SAFE_INTEGER;case"symbol":return!1;case"string":return x.test(t)}}function set(t,e,n){const r=Array.isArray(e)?e:"string"==typeof e?toPath(e):[e];let o=t;for(let t=0;t<r.length-1;t++){const e=r[t],n=r[t+1];null==o[e]&&(o[e]=isIndex(n)?[]:{});o=o[e]}o[r[r.length-1]]=n;return t}function bind(t,e,...n){const binded=function(...r){const o=[];let i=0;for(let t=0;t<n.length;t++){const e=n[t];e===bind.placeholder?o.push(r[i++]):o.push(e)}for(let t=i;t<r.length;t++)o.push(r[t]);return this instanceof binded?new t(...o):t.apply(e,o)};return binded}const I=Symbol("bind.placeholder");bind.placeholder=I;const k=/^\w*$/,v=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/;function get(t,e,n){let r;r=Array.isArray(e)?e:"string"==typeof e&&function isDeepKey(t){switch(typeof t){case"number":case"symbol":return!1;case"string":return!k.test(t)&&v.test(t)}}(e)&&null==t?.[e]?toPath(e):[e];if(0===r.length)return n;let o,i=t;for(o=0;o<r.length&&null!=i;o++){let t=r[o];Object.is(t.valueOf(),-0)&&(t="-0");i=i[t]}return null===i&&o===r.length?i:i??n}function property(t){return function(e){return get(e,t)}}function identity(t){return t}function isArguments(t){return null!==t&&"object"==typeof t&&"[object Arguments]"===getTag(t)}function isPlainObject(t){if("object"!=typeof t)return!1;if(null==t)return!1;if(null===Object.getPrototypeOf(t))return!0;if("[object Object]"!==Object.prototype.toString.call(t)){const e=t[Symbol.toStringTag];if(null==e)return!1;return!!Object.getOwnPropertyDescriptor(t,Symbol.toStringTag)?.writable&&t.toString()===`[object ${e}]`}let e=t;for(;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function isTypedArray(t){return isTypedArray$1(t)}function cloneDeep(t){if("object"!=typeof t)return cloneDeep$1(t);switch(Object.prototype.toString.call(t)){case r:case n:case o:{const e=new t.constructor(t?.valueOf());copyProperties(e,t);return e}case i:{const e={};copyProperties(e,t);e.length=t.length;e[Symbol.iterator]=t[Symbol.iterator];return e}default:return cloneDeep$1(t)}}function mergeWith(t,...e){const n=e.slice(0,-1),r=e[e.length-1];let o=t;for(let e=0;e<n.length;e++){o=mergeWithDeep(t,n[e],r,new Map)}return o}function mergeWithDeep(t,e,n,r){if(null==e||"object"!=typeof e)return t;if(r.has(e))return clone(r.get(e));r.set(e,t);if(Array.isArray(e)){e=e.slice();for(let t=0;t<e.length;t++)e[t]=e[t]??void 0}const o=Object.keys(e);for(let i=0;i<o.length;i++){const c=o[i];let s=e[c],u=t[c];isArguments(s)&&(s={...s});isArguments(u)&&(u={...u});"undefined"!=typeof Buffer&&Buffer.isBuffer(s)&&(s=cloneDeep(s));Array.isArray(s)&&(u="object"==typeof u?Array.from(u??[]):[]);const a=n(u,s,c,t,e,r);null!=a?t[c]=a:Array.isArray(s)||isObjectLike(u)&&isObjectLike(s)?t[c]=mergeWithDeep(u,s,n,r):null==u&&Array.isArray(s)?t[c]=mergeWithDeep([],s,n,r):null==u&&isPlainObject(s)?t[c]=mergeWithDeep({},s,n,r):null==u&&isTypedArray(s)?t[c]=cloneDeep(s):void 0!==u&&void 0===s||(t[c]=s)}return t}function isArrayMatch(t,e){if(0===e.length)return!0;if(!Array.isArray(t))return!1;const n=new Set;for(let r=0;r<e.length;r++){const o=e[r],i=t.findIndex(((t,e)=>isMatch(t,o)&&!n.has(e)));if(-1===i)return!1;n.add(i)}return!0}function isMatch(t,e){if(e===t)return!0;switch(typeof e){case"object":{if(null==e)return!0;const n=Object.keys(e);if(null==t)return 0===n.length;if(Array.isArray(e))return isArrayMatch(t,e);if(e instanceof Map)return function isMapMatch(t,e){if(0===e.size)return!0;if(!(t instanceof Map))return!1;for(const[n,r]of e.entries())if(!isMatch(t.get(n),r))return!1;return!0}(t,e);if(e instanceof Set)return function isSetMatch(t,e){return 0===e.size||t instanceof Set&&isArrayMatch([...t],[...e])}(t,e);for(let r=0;r<n.length;r++){const o=n[r];if(!isPrimitive(t)&&!(o in t))return!1;if(void 0===e[o]&&void 0!==t[o])return!1;if(!isMatch(t[o],e[o]))return!1}return!0}case"function":return Object.keys(e).length>0&&isMatch(t,{...e});default:return!e}}t.AbortError=AbortError;t.TimeoutError=TimeoutError;t.after=(t,e)=>{if(!Number.isInteger(t)||t<0)throw new Error("n must be a non-negative integer.");let n=0;return(...r)=>{if(++n>=t)return e(...r)}};t.ary=function ary(t,e=t.length,n){n&&(e=t.length);(Number.isNaN(e)||e<0)&&(e=0);return ary$1(t,e)};t.before=(t,e)=>{if(!Number.isInteger(t)||t<0)throw new Error("n must be a non-negative integer.");let n=0;return(...r)=>{if(++n<t)return e(...r)}};t.bind=bind;t.camelCase=function camelCase(t){const e=getWords(t);if(0===e.length)return"";const[n,...r]=e;return`${n.toLowerCase()}${r.map((t=>capitalize(t))).join("")}`};t.capitalize=capitalize;t.chunk=function chunk(t,e=1){return 0===(e=Math.max(Math.floor(e),0))?[]:function chunk$1(t,e){if(!Number.isInteger(e)||e<=0)throw new Error("Size must be an integer greater than zero.");const n=Math.ceil(t.length/e),r=Array(n);for(let o=0;o<n;o++){const n=o*e,i=n+e;r[o]=t.slice(n,i)}return r}(t,e)};t.clamp=function clamp(t,e,n){return null==n?Math.min(t,e):Math.min(Math.max(t,e),n)};t.clone=clone;t.cloneDeep=cloneDeep$1;t.compact=function compact(t){const e=[];for(const n of t)n&&e.push(n);return e};t.concat=function concat(...t){return flatten$1(t)};t.countBy=function countBy(t,e){const n={};for(const r of t){const t=e(r);n[t]=(n[t]??0)+1}return n};t.debounce=function debounce(t,e,{signal:n}={}){let r=null;const debounced=function(...o){null!==r&&clearTimeout(r);n?.aborted||(r=setTimeout((()=>{t(...o);r=null}),e))};debounced.cancel=function(){if(null!==r){clearTimeout(r);r=null}};n?.addEventListener("abort",(function(){debounced.cancel()}),{once:!0});return debounced};t.delay=delay;t.difference=function difference(t,...e){return difference$1(t,flatten$1(e))};t.differenceBy=differenceBy;t.differenceWith=differenceWith;t.drop=function drop(t,e){e=Math.max(e,0);return t.slice(e)};t.dropRight=function dropRight(t,e){return 0===(e=Math.min(-e,0))?t.slice():t.slice(0,e)};t.dropRightWhile=function dropRightWhile(t,e){for(let n=t.length-1;n>=0;n--)if(!e(t[n]))return t.slice(0,n+1);return[]};t.dropWhile=function dropWhile(t,e){const n=t.findIndex((t=>!e(t)));return-1===n?[]:t.slice(n)};t.endsWith=(t,e,n=t.length)=>t.endsWith(e,n);t.fill=function fill(t,e,n=0,r=t.length){(n=Math.floor(n))||(n=0);(r=Math.floor(r))||(r=0);return function fill$1(t,e,n=0,r=t.length){const o=t.length,i=Math.max(n>=0?n:o+n,0),c=Math.min(r>=0?r:o+r,o);for(let n=i;n<c;n++)t[n]=e;return t}(t,e,n,r)};t.first=head;t.flatMap=function flatMap(t,e,n=1){return flatten$1(t.map((t=>e(t))),n)};t.flatten=flatten;t.flattenDeep=function flattenDeep(t){return flatten(t,1/0)};t.flattenDepth=function flattenDepth(t,e=1){return flatten(t,e)};t.flattenObject=function flattenObject(t){return flattenObjectImpl(t)};t.forEachRight=function forEachRight(t,e){for(let n=t.length-1;n>=0;n--){e(t[n],n,t)}};t.get=get;t.groupBy=function groupBy(t,e){const n={};for(const r of t){const t=e(r);null==n[t]&&(n[t]=[]);n[t].push(r)}return n};t.head=head;t.inRange=function inRange(t,e,n){if(null==n){n=e;e=0}if(e>=n)throw new Error("The maximum value must be greater than the minimum value.");return e<=t&&t<n};t.initial=function initial(t){return t.length<=1?[]:t.slice(0,-1)};t.intersection=intersection;t.intersectionBy=intersectionBy;t.intersectionWith=intersectionWith;t.invert=function invert(t){const e={},n=Object.keys(t);for(let r=0;r<n.length;r++){const o=n[r];e[t[o]]=o}return e};t.isArguments=isArguments;t.isArray=function isArray(t){return Array.isArray(t)};t.isArrayLike=function isArrayLike(t){return null!=t&&"function"!=typeof t&&isLength(t.length)};t.isBoolean=function isBoolean(t){return!0===t||!1===t||"object"==typeof t&&null!=t&&"[object Boolean]"===getTag(t)};t.isEqual=function isEqual(t,e){if(typeof t==typeof e)switch(typeof t){case"bigint":case"string":case"boolean":case"symbol":case"undefined":case"function":return t===e;case"number":return t===e||Object.is(t,e);case"object":return areObjectsEqual(t,e)}return areObjectsEqual(t,e)};t.isFunction=function isFunction(t){return"function"==typeof t};t.isLength=isLength;t.isMatch=isMatch;t.isNil=isNil;t.isNotNil=function isNotNil(t){return null!=t};t.isNull=function isNull(t){return null===t};t.isObjectLike=isObjectLike;t.isPlainObject=isPlainObject;t.isPrimitive=isPrimitive;t.isSubset=function isSubset(t,e){return 0===difference$1(e,t).length};t.isSymbol=isSymbol;t.isTypedArray=isTypedArray;t.isUndefined=function isUndefined(t){return void 0===t};t.kebabCase=t=>getWords(t).map((t=>t.toLowerCase())).join("-");t.keyBy=function keyBy(t,e){const n={};for(const r of t){n[e(r)]=r}return n};t.last=function last(t){return t[t.length-1]};t.lowerCase=t=>getWords(t).map((t=>t.toLowerCase())).join(" ");t.mapKeys=function mapKeys(t,e){switch(typeof(e=e??identity)){case"string":case"symbol":case"number":case"object":return mapKeys$1(t,property(e));case"function":return mapKeys$1(t,e)}};t.mapValues=function mapValues(t,e){switch(typeof(e=e??identity)){case"string":case"symbol":case"number":case"object":return mapValues$1(t,property(e));case"function":return mapValues$1(t,e)}};t.matches=function matches(t){t=cloneDeep$1(t);return e=>isMatch(e,t)};t.max=function max(t=[]){let e,n=t[0];for(const r of t)if(null==e||r>e){e=r;n=r}return n};t.maxBy=function maxBy(t,e){let n=t[0],r=-1/0;for(const o of t){const t=e(o);if(t>r){r=t;n=o}}return n};t.mean=mean;t.meanBy=function meanBy(t,e){return mean(t.map((t=>e(t))))};t.merge=function merge(t,...e){return mergeWith(t,...e,noop)};t.mergeWith=mergeWith;t.min=function min(t=[]){let e,n=t[0];for(const r of t)if(null==e||r<e){e=r;n=r}return n};t.minBy=function minBy(t,e){let n=t[0],r=1/0;for(const o of t){const t=e(o);if(t<r){r=t;n=o}}return n};t.negate=function negate(t){return(...e)=>!t(...e)};t.noop=noop;t.omit=function omit(t,e){const n={...t};for(const t of e)delete n[t];return n};t.omitBy=function omitBy(t,e){const n={};for(const[r,o]of Object.entries(t))e(o,r)||(n[r]=o);return n};t.once=function once(t){let e,n=!1;return function(){if(n)return e;const r=t();n=!0;e=r;return r}};t.orderBy=function orderBy(t,e,n){if(null==t)return[];Array.isArray(e)||(e=null==e?[]:[e]);Array.isArray(n)||(n=null==n?[]:[n]);const compareValues=(t,e,n)=>t<e?"desc"===n?1:-1:t>e?"desc"===n?-1:1:0,getValueByPath=(t,e)=>{if(Array.isArray(t)){let n=e;for(let e=0;e<t.length;e++)n=n[t[e]];return n}return e[t]};e=e.map((e=>function getPath(t,e){if(Array.isArray(t)){const n=[];for(let r=0;r<t.length;r++){const o=t[r];if(isKey(o,e)){e=e[o];n.push(o)}else{const t=toPath(o);for(let r=0;r<t.length;r++){e=e[t[r]];n.push(t[r])}}}return n}return isKey(t,e)?t:toPath(t)}(e,t[0])));return t.slice().sort(((t,r)=>{for(let o=0;o<e.length;o++){const i=e[o],c=getValueByPath(i,t),s=getValueByPath(i,r),u=String(n[o]),a=compareValues(c,s,u);if(0!==a)return a}return 0}))};t.padStart=function padStart(t,e=0,n=" "){return t.padStart(e,n)};t.partition=function partition(t,e){const n=[],r=[];for(const o of t)e(o)?n.push(o):r.push(o);return[n,r]};t.pascalCase=t=>getWords(t).map((t=>capitalize(t))).join("");t.pick=function pick(t,e){const n={};for(const r of e)n[r]=t[r];return n};t.pickBy=function pickBy(t,e){const n={};for(const[r,o]of Object.entries(t))e(o,r)&&(n[r]=o);return n};t.property=property;t.random=random;t.randomInt=randomInt;t.range=function range(t,e,n){if(null==e){e=t;t=0}null==n&&(n=1);if(!Number.isInteger(n)||0===n)throw new Error("The step value must be a non-zero integer.");const r=Math.max(Math.ceil((e-t)/n),0),o=new Array(r);for(let e=0;e<r;e++)o[e]=t+e*n;return o};t.round=function round(t,e=0){if(!Number.isInteger(e))throw new Error("Precision must be an integer.");const n=Math.pow(10,e);return Math.round(t*n)/n};t.sample=function sample(t){return t[Math.floor(Math.random()*t.length)]};t.sampleSize=function sampleSize(t,e){if(e>t.length)throw new Error("Size must be less than or equal to the length of array.");const n=new Array(e),r=new Set;for(let o=t.length-e,i=0;o<t.length;o++,i++){let e=randomInt(0,o+1);r.has(e)&&(e=o);r.add(e);n[i]=t[e]}return n};t.set=set;t.shuffle=function shuffle(t){const e=t.slice();for(let t=e.length-1;t>=1;t--){const n=Math.floor(Math.random()*(t+1));[e[t],e[n]]=[e[n],e[t]]}return e};t.size=function size(t){return isNil(t)?0:t instanceof Map||t instanceof Set?t.size:Object.keys(t).length};t.snakeCase=t=>getWords(t).map((t=>t.toLowerCase())).join("_");t.startCase=function startCase(t){const e=getWords(t.trim());let n="";for(const t of e){n&&(n+=" ");t===t.toUpperCase()?n+=t:n+=t[0].toUpperCase()+t.slice(1).toLowerCase()}return n};t.startsWith=(t,e,n=0)=>t.startsWith(e,n);t.sum=sum;t.sumBy=function sumBy(t,e){return sum(t.map((t=>e(t))))};t.tail=function tail(t){const e=t.length;if(e<=1)return[];const n=new Array(e-1);for(let r=1;r<e;r++)n[r-1]=t[r];return n};t.take=function take(t,e){return t.slice(0,e)};t.takeRight=function takeRight(t,e=1){return e<=0?[]:t.slice(-e)};t.takeRightWhile=function takeRightWhile(t,e){for(let n=t.length-1;n>=0;n--)if(!e(t[n]))return t.slice(n+1);return t.slice()};t.takeWhile=function takeWhile(t,e){const n=[];for(const r of t){if(!e(r))break;n.push(r)}return n};t.throttle=function throttle(t,e){let n;return function(...r){const o=Date.now();if(null==n||o-n>=e){n=o;t(...r)}}};t.toFilled=function toFilled(t,e,n=0,r=t.length){const o=t.length,i=Math.max(n>=0?n:o+n,0),c=Math.min(r>=0?r:o+r,o),s=t.slice();for(let t=i;t<c;t++)s[t]=e;return s};t.unary=function unary(t){return ary$1(t,1)};t.union=union;t.unionBy=unionBy;t.unionWith=unionWith;t.uniq=uniq;t.uniqBy=function uniqBy(t,e){const n=new Map;for(const r of t){const t=e(r);n.has(t)||n.set(t,r)}return Array.from(n.values())};t.uniqWith=uniqWith;t.unzip=function unzip(t){let e=0;for(let n=0;n<t.length;n++)t[n].length>e&&(e=t[n].length);const n=new Array(e);for(let r=0;r<e;r++){n[r]=new Array(t.length);for(let e=0;e<t.length;e++)n[r][e]=t[e][r]}return n};t.unzipWith=function unzipWith(t,e){const n=Math.max(...t.map((t=>t.length))),r=new Array(n);for(let o=0;o<n;o++){const n=new Array(t.length);for(let e=0;e<t.length;e++)n[e]=t[e][o];r[o]=e(...n)}return r};t.withTimeout=async function withTimeout(t,e){return Promise.race([t(),timeout(e)])};t.without=function without(t,...e){const n=new Set(e);return t.filter((t=>!n.has(t)))};t.xor=function xor(t,e){return difference$1(union(t,e),intersection(t,e))};t.xorBy=function xorBy(t,e,n){return differenceBy(unionBy(t,e,n),intersectionBy(t,e,n),n)};t.xorWith=function xorWith(t,e,n){return differenceWith(unionWith(t,e,n),intersectionWith(t,e,n),n)};t.zip=zip;t.zipObject=function zipObject(t,e){const n={};for(let r=0;r<t.length;r++)n[t[r]]=e[r];return n};t.zipObjectDeep=function zipObjectDeep(t,e){const n={},r=zip(t,e);for(let t=0;t<r.length;t++){const[e,o]=r[t];null!=e&&set(n,e,o)}return n};t.zipWith=function zipWith(t,...e){const n=[t,...e.slice(0,-1)],r=e[e.length-1],o=[],i=Math.max(...n.map((t=>t.length)));for(let t=0;t<i;t++){const e=n.map((e=>e[t]));o.push(r(...e))}return o};Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});return t}({});
1
+ var _=function(t){"use strict";function difference$1(t,e){const n=new Set(e);return t.filter((t=>!n.has(t)))}function differenceBy(t,e,n){const r=new Set(e.map((t=>n(t))));return t.filter((t=>!r.has(n(t))))}function differenceWith(t,e,n){return t.filter((t=>e.every((e=>!n(t,e)))))}function flatten$1(t,e=1){const n=[],r=Math.floor(e),recursive=(t,e)=>{for(const o of t)Array.isArray(o)&&e<r?recursive(o,e+1):n.push(o)};recursive(t,0);return n}function intersection(t,e){const n=new Set(e);return t.filter((t=>n.has(t)))}function intersectionBy(t,e,n){const r=new Set(e.map(n));return t.filter((t=>r.has(n(t))))}function intersectionWith(t,e,n){return t.filter((t=>e.some((e=>n(t,e)))))}function compareValues(t,e,n){return t<e?"asc"===n?-1:1:t>e?"asc"===n?1:-1:0}function random(t,e){if(null==e){e=t;t=0}if(t>=e)throw new Error("Invalid input: The maximum value must be greater than the minimum value.");return Math.random()*(e-t)+t}function randomInt(t,e){return Math.floor(random(t,e))}function uniq(t){return Array.from(new Set(t))}function union(t,e){return uniq(t.concat(e))}function unionBy(t,e,n){const r=new Map;for(const o of[...t,...e]){const t=n(o);r.has(t)||r.set(t,o)}return Array.from(r.values())}function uniqWith(t,e){const n=[];for(const r of t){n.every((t=>!e(t,r)))&&n.push(r)}return n}function unionWith(t,e,n){return uniqWith(t.concat(e),n)}function zip(...t){const e=[],n=Math.max(...t.map((t=>t.length)));for(let r=0;r<n;r++){const n=[];for(const e of t)n.push(e[r]);e.push(n)}return e}function head(t){return t[0]}class AbortError extends Error{constructor(t="The operation was aborted"){super(t);this.name="AbortError"}}class TimeoutError extends Error{constructor(t="The operation was timed out"){super(t);this.name="TimeoutError"}}function noop(){}function ary$1(t,e){return function(...n){return t.apply(this,n.slice(0,e))}}function partial(t,...e){return function(...n){const r=[];let o=0;for(let t=0;t<e.length;t++){const i=e[t];i===partial.placeholder?r.push(n[o++]):r.push(i)}for(let t=o;t<n.length;t++)r.push(n[t]);return t.apply(this,r)}}const e=Symbol("partial.placeholder");partial.placeholder=e;function partialRight(t,...e){return function(...r){const o=e.filter((t=>t===n)).length,i=Math.max(r.length-o,0),c=[];let s=0;for(let t=0;t<i;t++)c.push(r[s++]);for(let t=0;t<e.length;t++){const n=e[t];n===partialRight.placeholder?c.push(r[s++]):c.push(n)}return t.apply(this,c)}}const n=Symbol("partialRight.placeholder");partialRight.placeholder=n;function sum(t){let e=0;for(let n=0;n<t.length;n++)e+=t[n];return e}function mean(t){return sum(t)/t.length}function clone(t){if(function isPrimitive$1(t){return null==t||"object"!=typeof t&&"function"!=typeof t}(t))return t;if(Array.isArray(t))return t.slice();if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp)return new RegExp(t.source,t.flags);if(t instanceof Map){const e=new Map;for(const[n,r]of t)e.set(n,r);return e}if(t instanceof Set){const e=new Set;for(const n of t)e.add(n);return e}if("object"==typeof t){const e=Object.getPrototypeOf(t),n=Object.create(e);return Object.assign(n,t)}return t}function isPlainObject$1(t){if("object"!=typeof t)return!1;if(null==t)return!1;if(null===Object.getPrototypeOf(t))return!0;if("[object Object]"!==t.toString())return!1;let e=t;for(;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function flattenObjectImpl(t,e=""){const n={},r=Object.keys(t);for(let o=0;o<r.length;o++){const i=r[o],c=t[i],s=e?`${e}.${i}`:i;if(isPlainObject$1(c)&&Object.keys(c).length>0)Object.assign(n,flattenObjectImpl(c,s));else if(Array.isArray(c))for(let t=0;t<c.length;t++)n[`${s}.${t}`]=c[t];else n[s]=c}return n}function mapKeys$1(t,e){const n={},r=Object.keys(t);for(let o=0;o<r.length;o++){const i=r[o],c=t[i];n[e(c,i,t)]=c}return n}function mapValues$1(t,e){const n={},r=Object.keys(t);for(let o=0;o<r.length;o++){const i=r[o],c=t[i];n[i]=e(c,i,t)}return n}function isPrimitive(t){return null==t||"object"!=typeof t&&"function"!=typeof t}function isTypedArray$1(t){return t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Uint16Array||t instanceof Uint32Array||t instanceof BigUint64Array||t instanceof Int8Array||t instanceof Int16Array||t instanceof Int32Array||t instanceof BigInt64Array||t instanceof Float32Array||t instanceof Float64Array}function cloneDeep$1(t){return cloneDeepImpl(t)}function cloneDeepImpl(t,e=new Map){if(isPrimitive(t))return t;if(e.has(t))return e.get(t);if(Array.isArray(t)){const n=new Array(t.length);e.set(t,n);for(let r=0;r<t.length;r++)n[r]=cloneDeepImpl(t[r],e);Object.prototype.hasOwnProperty.call(t,"index")&&(n.index=t.index);Object.prototype.hasOwnProperty.call(t,"input")&&(n.input=t.input);return n}if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp){const e=new RegExp(t.source,t.flags);e.lastIndex=t.lastIndex;return e}if(t instanceof Map){const n=new Map;e.set(t,n);for(const[r,o]of t.entries())n.set(r,cloneDeepImpl(o,e));return n}if(t instanceof Set){const n=new Set;e.set(t,n);for(const r of t.values())n.add(cloneDeepImpl(r,e));return n}if("undefined"!=typeof Buffer&&Buffer.isBuffer(t))return t.subarray();if(isTypedArray$1(t)){const n=new(Object.getPrototypeOf(t).constructor)(t.length);e.set(t,n);for(let r=0;r<t.length;r++)n[r]=cloneDeepImpl(t[r],e);return n}if(t instanceof ArrayBuffer||"undefined"!=typeof SharedArrayBuffer&&t instanceof SharedArrayBuffer)return t.slice(0);if(t instanceof DataView){const n=new DataView(t.buffer.slice(0));e.set(t,n);copyProperties(n,t,e);return n}if("undefined"!=typeof File&&t instanceof File){const n=new File([t],t.name,{type:t.type});e.set(t,n);copyProperties(n,t,e);return n}if(t instanceof Blob){const n=new Blob([t],{type:t.type});e.set(t,n);copyProperties(n,t,e);return n}if(t instanceof Error){const n=new t.constructor;e.set(t,n);n.message=t.message;n.name=t.name;n.stack=t.stack;n.cause=t.cause;copyProperties(n,t,e);return n}if("object"==typeof t&&null!==t){const n={};e.set(t,n);copyProperties(n,t,e);return n}return t}function copyProperties(t,e,n){const r=Object.keys(e);for(let o=0;o<r.length;o++){const i=r[o],c=Object.getOwnPropertyDescriptor(e,i);(c?.writable||c?.set)&&(t[i]=cloneDeepImpl(e[i],n))}}function isObjectLike(t){return"object"==typeof t&&null!==t}function merge$1(t,e){const n=Object.keys(e);for(let r=0;r<n.length;r++){const o=n[r],i=e[o],c=t[o];Array.isArray(i)?t[o]=merge$1(c??[],i):isObjectLike(c)&&isObjectLike(i)?t[o]=merge$1(c??{},i):void 0!==c&&void 0===i||(t[o]=i)}return t}const r="[object RegExp]",o="[object String]",i="[object Number]",c="[object Boolean]",s="[object Arguments]",u="[object Symbol]",a="[object Date]",f="[object Map]",l="[object Set]",h="[object Array]",p="[object Function]",y="[object ArrayBuffer]",g="[object Object]",m="[object Error]",b="[object DataView]",d="[object Uint8Array]",j="[object Uint8ClampedArray]",A="[object Uint16Array]",O="[object Uint32Array]",w="[object BigUint64Array]",S="[object Int8Array]",M="[object Int16Array]",B="[object Int32Array]",x="[object BigInt64Array]",P="[object Float32Array]",E="[object Float64Array]";function getSymbols(t){return Object.getOwnPropertySymbols(t).filter((e=>Object.prototype.propertyIsEnumerable.call(t,e)))}function getTag(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}function areObjectsEqual(t,e,n){if(Object.is(t,e))return!0;let $=getTag(t),I=getTag(e);$===s&&($=g);I===s&&(I=g);if($!==I)return!1;switch($){case o:return t.toString()===e.toString();case i:{const n=t.valueOf(),r=e.valueOf();return n===r||Number.isNaN(n)&&Number.isNaN(r)}case c:case a:case u:return Object.is(t.valueOf(),e.valueOf());case r:return t.source===e.source&&t.flags===e.flags;case p:return t===e}const W=(n=n??new Map).get(t),v=n.get(e);if(null!=W&&null!=v)return W===e;n.set(t,e);n.set(e,t);try{switch($){case f:if(t.size!==e.size)return!1;for(const[r,o]of t.entries())if(!e.has(r)||!areObjectsEqual(o,e.get(r),n))return!1;return!0;case l:{if(t.size!==e.size)return!1;const r=Array.from(t.values()),o=Array.from(e.values());for(let t=0;t<r.length;t++){const e=r[t],i=o.findIndex((t=>areObjectsEqual(e,t,n)));if(-1===i)return!1;o.splice(i,1)}return!0}case h:case d:case j:case A:case O:case w:case S:case M:case B:case x:case P:case E:if("undefined"!=typeof Buffer&&Buffer.isBuffer(t)!==Buffer.isBuffer(e))return!1;if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(!areObjectsEqual(t[r],e[r],n))return!1;return!0;case y:return t.byteLength===e.byteLength&&areObjectsEqual(new Uint8Array(t),new Uint8Array(e),n);case b:return t.byteLength===e.byteLength&&t.byteOffset===e.byteOffset&&areObjectsEqual(t.buffer,e.buffer,n);case m:return t.name===e.name&&t.message===e.message;case g:{if(!(areObjectsEqual(t.constructor,e.constructor,n)||isPlainObject$1(t)&&isPlainObject$1(e)))return!1;const r=[...Object.keys(t),...getSymbols(t)],o=[...Object.keys(e),...getSymbols(e)];if(r.length!==o.length)return!1;for(let o=0;o<r.length;o++){const i=r[o],c=t[i];if(!Object.prototype.hasOwnProperty.call(e,i))return!1;if(!areObjectsEqual(c,e[i],n))return!1}return!0}default:return!1}}finally{n.delete(t);n.delete(e)}}function isNil(t){return null==t}function isLength(t){return Number.isSafeInteger(t)&&t>=0}function delay(t,{signal:e}={}){return new Promise(((n,r)=>{const abortError=()=>{r(new AbortError)};if(e?.aborted)return abortError();const o=setTimeout(n,t);e?.addEventListener("abort",(()=>{clearTimeout(o);abortError()}),{once:!0})}))}async function timeout(t){await delay(t);throw new TimeoutError}const capitalize=t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase(),$=/[A-Z]?[a-z]+|[0-9]+|[A-Z]+(?![a-z])/g;function getWords(t){return Array.from(t.match($)??[])}const I=/^\w*$/,W=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/;function isDeepKey(t){switch(typeof t){case"number":case"symbol":return!1;case"string":return!I.test(t)&&W.test(t)}}function isSymbol(t){return"symbol"==typeof t||null!=t&&t instanceof Symbol}function toKey(t){return"string"==typeof t||isSymbol(t)?t:Object.is(t?.valueOf(),-0)?"-0":`${t}`}function toPath(t){const e=/\\(\\)?/g,n=RegExp("[^.[\\]]+|\\[(?:([^\"'][^[]*)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))","g"),r=[];"."===t[0]&&r.push("");let o,i=0;for(;null!==(o=n.exec(t));){let t=o[0];const c=o[1],s=o[2],u=o[3];s?t=u.replace(e,"$1"):c&&(t=c);r.push(t);n.lastIndex===i?n.lastIndex++:i=n.lastIndex}return r}function get(t,e,n){let r;r=Array.isArray(e)?e:"string"==typeof e&&isDeepKey(e)&&null==t?.[e]?toPath(e):[e];if(0===r.length)return n;let o,i=t;for(o=0;o<r.length&&null!=i;o++){i=i[toKey(r[o])]}return null===i&&o===r.length?i:i??n}function property(t){return function(e){return get(e,t)}}function isArrayMatch(t,e){if(0===e.length)return!0;if(!Array.isArray(t))return!1;const n=new Set;for(let r=0;r<e.length;r++){const o=e[r],i=t.findIndex(((t,e)=>isMatch(t,o)&&!n.has(e)));if(-1===i)return!1;n.add(i)}return!0}function isMatch(t,e){if(e===t)return!0;switch(typeof e){case"object":{if(null==e)return!0;const n=Object.keys(e);if(null==t)return 0===n.length;if(Array.isArray(e))return isArrayMatch(t,e);if(e instanceof Map)return function isMapMatch(t,e){if(0===e.size)return!0;if(!(t instanceof Map))return!1;for(const[n,r]of e.entries())if(!isMatch(t.get(n),r))return!1;return!0}(t,e);if(e instanceof Set)return function isSetMatch(t,e){return 0===e.size||t instanceof Set&&isArrayMatch([...t],[...e])}(t,e);for(let r=0;r<n.length;r++){const o=n[r];if(!isPrimitive(t)&&!(o in t))return!1;if(void 0===e[o]&&void 0!==t[o])return!1;if(!isMatch(t[o],e[o]))return!1}return!0}case"function":return Object.keys(e).length>0&&isMatch(t,{...e});default:return!e}}function matches(t){t=cloneDeep$1(t);return e=>isMatch(e,t)}function cloneDeep(t){if("object"!=typeof t)return cloneDeep$1(t);switch(Object.prototype.toString.call(t)){case i:case o:case c:{const e=new t.constructor(t?.valueOf());copyProperties(e,t);return e}case s:{const e={};copyProperties(e,t);e.length=t.length;e[Symbol.iterator]=t[Symbol.iterator];return e}default:return cloneDeep$1(t)}}const v=/^(?:0|[1-9]\d*)$/;function isIndex(t){switch(typeof t){case"number":return Number.isInteger(t)&&t>=0&&t<Number.MAX_SAFE_INTEGER;case"symbol":return!1;case"string":return v.test(t)}}function isArguments(t){return null!==t&&"object"==typeof t&&"[object Arguments]"===getTag(t)}function has(t,e){let n;n=Array.isArray(e)?e:"string"==typeof e&&isDeepKey(e)&&null==t?.[e]?toPath(e):[e];if(0===n.length)return!1;let r=t;for(let t=0;t<n.length;t++){const e=n[t];if(null==r||!Object.prototype.hasOwnProperty.call(r,e)){if(!((Array.isArray(r)||isArguments(r))&&isIndex(e)&&e<r.length))return!1}r=r[e]}return!0}function matchesProperty(t,e){t=Array.isArray(t)?t:toKey(t);e=cloneDeep(e);return function(n){const r=get(n,t);return void 0===r?has(n,t):void 0===e?void 0===r:isMatch(r,e)}}function flatten(t,e=1){const n=[],r=Math.floor(e);if(!Array.isArray(t))return n;const recursive=(t,e)=>{for(const o of t)e<r&&(Array.isArray(o)||Boolean(o?.[Symbol.isConcatSpreadable])||null!==o&&"object"==typeof o&&"[object Arguments]"===Object.prototype.toString.call(o))?Array.isArray(o)?recursive(o,e+1):recursive(Array.from(o),e+1):n.push(o)};recursive(t,0);return n}const k=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,D=/^\w*$/;function isKey(t,e){return!Array.isArray(t)&&(!("number"!=typeof t&&"boolean"!=typeof t&&null!=t&&!isSymbol(t))||("string"==typeof t&&(D.test(t)||!k.test(t))||null!=e&&Object.hasOwn(e,t)))}function set(t,e,n){const r=Array.isArray(e)?e:"string"==typeof e?toPath(e):[e];let o=t;for(let t=0;t<r.length-1;t++){const e=r[t],n=r[t+1];null==o[e]&&(o[e]=isIndex(n)?[]:{});o=o[e]}o[r[r.length-1]]=n;return t}function bind(t,e,...n){const binded=function(...r){const o=[];let i=0;for(let t=0;t<n.length;t++){const e=n[t];e===bind.placeholder?o.push(r[i++]):o.push(e)}for(let t=i;t<r.length;t++)o.push(r[t]);return this instanceof binded?new t(...o):t.apply(e,o)};return binded}const N=Symbol("bind.placeholder");bind.placeholder=N;function identity(t){return t}function isPlainObject(t){if("object"!=typeof t)return!1;if(null==t)return!1;if(null===Object.getPrototypeOf(t))return!0;if("[object Object]"!==Object.prototype.toString.call(t)){const e=t[Symbol.toStringTag];if(null==e)return!1;return!!Object.getOwnPropertyDescriptor(t,Symbol.toStringTag)?.writable&&t.toString()===`[object ${e}]`}let e=t;for(;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function isTypedArray(t){return isTypedArray$1(t)}function mergeWith(t,...e){const n=e.slice(0,-1),r=e[e.length-1];let o=t;for(let e=0;e<n.length;e++){o=mergeWithDeep(t,n[e],r,new Map)}return o}function mergeWithDeep(t,e,n,r){if(null==e||"object"!=typeof e)return t;if(r.has(e))return clone(r.get(e));r.set(e,t);if(Array.isArray(e)){e=e.slice();for(let t=0;t<e.length;t++)e[t]=e[t]??void 0}const o=Object.keys(e);for(let i=0;i<o.length;i++){const c=o[i];let s=e[c],u=t[c];isArguments(s)&&(s={...s});isArguments(u)&&(u={...u});"undefined"!=typeof Buffer&&Buffer.isBuffer(s)&&(s=cloneDeep(s));Array.isArray(s)&&(u="object"==typeof u?Array.from(u??[]):[]);const a=n(u,s,c,t,e,r);null!=a?t[c]=a:Array.isArray(s)||isObjectLike(u)&&isObjectLike(s)?t[c]=mergeWithDeep(u,s,n,r):null==u&&isPlainObject(s)?t[c]=mergeWithDeep({},s,n,r):null==u&&isTypedArray(s)?t[c]=cloneDeep(s):void 0!==u&&void 0===s||(t[c]=s)}return t}t.AbortError=AbortError;t.TimeoutError=TimeoutError;t.after=(t,e)=>{if(!Number.isInteger(t)||t<0)throw new Error("n must be a non-negative integer.");let n=0;return(...r)=>{if(++n>=t)return e(...r)}};t.ary=function ary(t,e=t.length,n){n&&(e=t.length);(Number.isNaN(e)||e<0)&&(e=0);return ary$1(t,e)};t.before=(t,e)=>{if(!Number.isInteger(t)||t<0)throw new Error("n must be a non-negative integer.");let n=0;return(...r)=>{if(++n<t)return e(...r)}};t.bind=bind;t.camelCase=function camelCase(t){const e=getWords(t);if(0===e.length)return"";const[n,...r]=e;return`${n.toLowerCase()}${r.map((t=>capitalize(t))).join("")}`};t.capitalize=capitalize;t.chunk=function chunk(t,e=1){return 0===(e=Math.max(Math.floor(e),0))?[]:function chunk$1(t,e){if(!Number.isInteger(e)||e<=0)throw new Error("Size must be an integer greater than zero.");const n=Math.ceil(t.length/e),r=Array(n);for(let o=0;o<n;o++){const n=o*e,i=n+e;r[o]=t.slice(n,i)}return r}(t,e)};t.clamp=function clamp(t,e,n){return null==n?Math.min(t,e):Math.min(Math.max(t,e),n)};t.clone=clone;t.cloneDeep=cloneDeep$1;t.compact=function compact(t){const e=[];for(const n of t)n&&e.push(n);return e};t.concat=function concat(...t){return flatten$1(t)};t.countBy=function countBy(t,e){const n={};for(const r of t){const t=e(r);n[t]=(n[t]??0)+1}return n};t.debounce=function debounce(t,e,{signal:n}={}){let r=null;const debounced=function(...o){null!==r&&clearTimeout(r);n?.aborted||(r=setTimeout((()=>{t(...o);r=null}),e))};debounced.cancel=function(){if(null!==r){clearTimeout(r);r=null}};n?.addEventListener("abort",(function(){debounced.cancel()}),{once:!0});return debounced};t.delay=delay;t.difference=function difference(t,...e){return difference$1(t,flatten$1(e))};t.differenceBy=differenceBy;t.differenceWith=differenceWith;t.drop=function drop(t,e){e=Math.max(e,0);return t.slice(e)};t.dropRight=function dropRight(t,e){return 0===(e=Math.min(-e,0))?t.slice():t.slice(0,e)};t.dropRightWhile=function dropRightWhile(t,e){for(let n=t.length-1;n>=0;n--)if(!e(t[n]))return t.slice(0,n+1);return[]};t.dropWhile=function dropWhile(t,e){const n=t.findIndex((t=>!e(t)));return-1===n?[]:t.slice(n)};t.endsWith=(t,e,n=t.length)=>t.endsWith(e,n);t.fill=function fill(t,e,n=0,r=t.length){(n=Math.floor(n))||(n=0);(r=Math.floor(r))||(r=0);return function fill$1(t,e,n=0,r=t.length){const o=t.length,i=Math.max(n>=0?n:o+n,0),c=Math.min(r>=0?r:o+r,o);for(let n=i;n<c;n++)t[n]=e;return t}(t,e,n,r)};t.find=function find(t,e){let n=t;Array.isArray(t)||(n=Object.values(t));switch(typeof e){case"function":if(!Array.isArray(t)){const n=Object.entries(t);for(let r=0;r<n.length;r++){const o=n[r],i=o[0],c=o[1];if(e(c,i,t))return c}return}return n.find(e);case"object":if(Array.isArray(e)&&2===e.length){const t=e[0],r=e[1];return n.find(matchesProperty(t,r))}return n.find(matches(e));case"string":return n.find(property(e))}};t.findIndex=function findIndex(t,e){switch(typeof e){case"function":return t.findIndex(e);case"object":if(Array.isArray(e)&&2===e.length){const n=e[0],r=e[1];return t.findIndex(matchesProperty(n,r))}return t.findIndex(matches(e));case"string":return t.findIndex(property(e))}};t.first=head;t.flatMap=function flatMap(t,e,n=1){return flatten$1(t.map((t=>e(t))),n)};t.flatten=flatten;t.flattenDeep=function flattenDeep(t){return flatten(t,1/0)};t.flattenDepth=function flattenDepth(t,e=1){return flatten(t,e)};t.flattenObject=function flattenObject(t){return flattenObjectImpl(t)};t.forEachRight=function forEachRight(t,e){for(let n=t.length-1;n>=0;n--){e(t[n],n,t)}};t.get=get;t.groupBy=function groupBy(t,e){const n={};for(const r of t){const t=e(r);null==n[t]&&(n[t]=[]);n[t].push(r)}return n};t.has=has;t.head=head;t.inRange=function inRange(t,e,n){if(null==n){n=e;e=0}if(e>=n)throw new Error("The maximum value must be greater than the minimum value.");return e<=t&&t<n};t.indexOf=function indexOf(t,e,n){if(null==t)return-1;if(Number.isNaN(e)){(n=n??0)<0&&(n=Math.max(0,t.length+n));for(let e=n;e<t.length;e++)if(Number.isNaN(t[e]))return e;return-1}return t.indexOf(e,n)};t.initial=function initial(t){return t.length<=1?[]:t.slice(0,-1)};t.intersection=intersection;t.intersectionBy=intersectionBy;t.intersectionWith=intersectionWith;t.invert=function invert(t){const e={},n=Object.keys(t);for(let r=0;r<n.length;r++){const o=n[r];e[t[o]]=o}return e};t.isArguments=isArguments;t.isArray=function isArray(t){return Array.isArray(t)};t.isArrayLike=function isArrayLike(t){return null!=t&&"function"!=typeof t&&isLength(t.length)};t.isBoolean=function isBoolean(t){return!0===t||!1===t||"object"==typeof t&&null!=t&&"[object Boolean]"===getTag(t)};t.isEqual=function isEqual(t,e){if(typeof t==typeof e)switch(typeof t){case"bigint":case"string":case"boolean":case"symbol":case"undefined":case"function":return t===e;case"number":return t===e||Object.is(t,e);case"object":return areObjectsEqual(t,e)}return areObjectsEqual(t,e)};t.isFunction=function isFunction(t){return"function"==typeof t};t.isLength=isLength;t.isMatch=isMatch;t.isNil=isNil;t.isNotNil=function isNotNil(t){return null!=t};t.isNull=function isNull(t){return null===t};t.isObjectLike=isObjectLike;t.isPlainObject=isPlainObject;t.isPrimitive=isPrimitive;t.isString=function isString(t){return"string"==typeof t||"object"==typeof t&&null!=t&&"[object String]"===getTag(t)};t.isSubset=function isSubset(t,e){return 0===difference$1(e,t).length};t.isSymbol=isSymbol;t.isTypedArray=isTypedArray;t.isUndefined=function isUndefined(t){return void 0===t};t.kebabCase=t=>getWords(t).map((t=>t.toLowerCase())).join("-");t.keyBy=function keyBy(t,e){const n={};for(const r of t){n[e(r)]=r}return n};t.last=function last(t){return t[t.length-1]};t.lowerCase=t=>getWords(t).map((t=>t.toLowerCase())).join(" ");t.mapKeys=function mapKeys(t,e){switch(typeof(e=e??identity)){case"string":case"symbol":case"number":case"object":return mapKeys$1(t,property(e));case"function":return mapKeys$1(t,e)}};t.mapValues=function mapValues(t,e){switch(typeof(e=e??identity)){case"string":case"symbol":case"number":case"object":return mapValues$1(t,property(e));case"function":return mapValues$1(t,e)}};t.matches=matches;t.matchesProperty=matchesProperty;t.max=function max(t=[]){let e,n=t[0];for(const r of t)if(null==e||r>e){e=r;n=r}return n};t.maxBy=function maxBy(t,e){let n=t[0],r=-1/0;for(const o of t){const t=e(o);if(t>r){r=t;n=o}}return n};t.mean=mean;t.meanBy=function meanBy(t,e){return mean(t.map((t=>e(t))))};t.memoize=function memoize(t,e={}){const{cache:n=new Map,getCacheKey:r}=e,memoizedFn=function(e){const o=r?r(e):e;if(n.has(o))return n.get(o);const i=t.call(this,e);n.set(o,i);return i};memoizedFn.cache=n;return memoizedFn};t.merge=function merge(t,...e){return mergeWith(t,...e,noop)};t.mergeWith=mergeWith;t.min=function min(t=[]){let e,n=t[0];for(const r of t)if(null==e||r<e){e=r;n=r}return n};t.minBy=function minBy(t,e){let n=t[0],r=1/0;for(const o of t){const t=e(o);if(t<r){r=t;n=o}}return n};t.negate=function negate(t){return(...e)=>!t(...e)};t.noop=noop;t.omit=function omit(t,e){const n={...t};for(const t of e)delete n[t];return n};t.omitBy=function omitBy(t,e){const n={};for(const[r,o]of Object.entries(t))e(o,r)||(n[r]=o);return n};t.once=function once(t){let e,n=!1;return function(){if(n)return e;const r=t();n=!0;e=r;return r}};t.orderBy=function orderBy(t,e,n){if(null==t)return[];Array.isArray(e)||(e=null==e?[]:[e]);Array.isArray(n)||(n=null==n?[]:[n]);const compareValues=(t,e,n)=>t<e?"desc"===n?1:-1:t>e?"desc"===n?-1:1:0,getValueByPath=(t,e)=>{if(Array.isArray(t)){let n=e;for(let e=0;e<t.length;e++)n=n[t[e]];return n}return e[t]};e=e.map((e=>function getPath(t,e){if(Array.isArray(t)){const n=[];for(let r=0;r<t.length;r++){const o=t[r];if(isKey(o,e)){e=e[o];n.push(o)}else{const t=toPath(o);for(let r=0;r<t.length;r++){e=e[t[r]];n.push(t[r])}}}return n}return isKey(t,e)?t:toPath(t)}(e,t[0])));return t.slice().sort(((t,r)=>{for(let o=0;o<e.length;o++){const i=e[o],c=getValueByPath(i,t),s=getValueByPath(i,r),u=String(n[o]),a=compareValues(c,s,u);if(0!==a)return a}return 0}))};t.padEnd=function padEnd(t,e=0,n=" "){return t.padEnd(e,n)};t.padStart=function padStart(t,e=0,n=" "){return t.padStart(e,n)};t.partial=partial;t.partialRight=partialRight;t.partition=function partition(t,e){const n=[],r=[];for(const o of t)e(o)?n.push(o):r.push(o);return[n,r]};t.pascalCase=t=>getWords(t).map((t=>capitalize(t))).join("");t.pick=function pick(t,e){const n={};for(const r of e)n[r]=t[r];return n};t.pickBy=function pickBy(t,e){const n={};for(const[r,o]of Object.entries(t))e(o,r)&&(n[r]=o);return n};t.property=property;t.random=random;t.randomInt=randomInt;t.range=function range(t,e,n){if(null==e){e=t;t=0}null==n&&(n=1);if(!Number.isInteger(n)||0===n)throw new Error("The step value must be a non-zero integer.");const r=Math.max(Math.ceil((e-t)/n),0),o=new Array(r);for(let e=0;e<r;e++)o[e]=t+e*n;return o};t.rest=function rest(t,e=t.length-1){e=Number.parseInt(e,10);(Number.isNaN(e)||e<0)&&(e=t.length-1);return function rest$1(t,e=t.length-1){return function(...n){const r=n.slice(e),o=n.slice(0,e);for(;o.length<e;)o.push(void 0);return t.apply(this,[...o,r])}}(t,e)};t.round=function round(t,e=0){if(!Number.isInteger(e))throw new Error("Precision must be an integer.");const n=Math.pow(10,e);return Math.round(t*n)/n};t.sample=function sample(t){return t[Math.floor(Math.random()*t.length)]};t.sampleSize=function sampleSize(t,e){if(e>t.length)throw new Error("Size must be less than or equal to the length of array.");const n=new Array(e),r=new Set;for(let o=t.length-e,i=0;o<t.length;o++,i++){let e=randomInt(0,o+1);r.has(e)&&(e=o);r.add(e);n[i]=t[e]}return n};t.set=set;t.shuffle=function shuffle(t){const e=t.slice();for(let t=e.length-1;t>=1;t--){const n=Math.floor(Math.random()*(t+1));[e[t],e[n]]=[e[n],e[t]]}return e};t.size=function size(t){return isNil(t)?0:t instanceof Map||t instanceof Set?t.size:Object.keys(t).length};t.snakeCase=t=>getWords(t).map((t=>t.toLowerCase())).join("_");t.sortBy=function sortBy(t,e){return t.slice().sort(((t,n)=>{for(let r=0;r<e.length;r++){const o=e[r],i="function"==typeof o,c=compareValues(i?o(t):t[o],i?o(n):n[o],"asc");if(0!==c)return c}return 0}))};t.startCase=function startCase(t){const e=getWords(t.trim());let n="";for(const t of e){n&&(n+=" ");t===t.toUpperCase()?n+=t:n+=t[0].toUpperCase()+t.slice(1).toLowerCase()}return n};t.startsWith=(t,e,n=0)=>t.startsWith(e,n);t.sum=sum;t.sumBy=function sumBy(t,e){return sum(t.map((t=>e(t))))};t.tail=function tail(t){const e=t.length;if(e<=1)return[];const n=new Array(e-1);for(let r=1;r<e;r++)n[r-1]=t[r];return n};t.take=function take(t,e){return t.slice(0,e)};t.takeRight=function takeRight(t,e=1){return e<=0?[]:t.slice(-e)};t.takeRightWhile=function takeRightWhile(t,e){for(let n=t.length-1;n>=0;n--)if(!e(t[n]))return t.slice(n+1);return t.slice()};t.takeWhile=function takeWhile(t,e){const n=[];for(const r of t){if(!e(r))break;n.push(r)}return n};t.throttle=function throttle(t,e){let n;return function(...r){const o=Date.now();if(null==n||o-n>=e){n=o;t(...r)}}};t.toFilled=function toFilled(t,e,n=0,r=t.length){const o=t.length,i=Math.max(n>=0?n:o+n,0),c=Math.min(r>=0?r:o+r,o),s=t.slice();for(let t=i;t<c;t++)s[t]=e;return s};t.toMerged=function toMerged(t,e){return merge$1(cloneDeep$1(t),e)};t.unary=function unary(t){return ary$1(t,1)};t.union=union;t.unionBy=unionBy;t.unionWith=unionWith;t.uniq=uniq;t.uniqBy=function uniqBy(t,e){const n=new Map;for(const r of t){const t=e(r);n.has(t)||n.set(t,r)}return Array.from(n.values())};t.uniqWith=uniqWith;t.unzip=function unzip(t){let e=0;for(let n=0;n<t.length;n++)t[n].length>e&&(e=t[n].length);const n=new Array(e);for(let r=0;r<e;r++){n[r]=new Array(t.length);for(let e=0;e<t.length;e++)n[r][e]=t[e][r]}return n};t.unzipWith=function unzipWith(t,e){const n=Math.max(...t.map((t=>t.length))),r=new Array(n);for(let o=0;o<n;o++){const n=new Array(t.length);for(let e=0;e<t.length;e++)n[e]=t[e][o];r[o]=e(...n)}return r};t.withTimeout=async function withTimeout(t,e){return Promise.race([t(),timeout(e)])};t.without=function without(t,...e){const n=new Set(e);return t.filter((t=>!n.has(t)))};t.xor=function xor(t,e){return difference$1(union(t,e),intersection(t,e))};t.xorBy=function xorBy(t,e,n){return differenceBy(unionBy(t,e,n),intersectionBy(t,e,n),n)};t.xorWith=function xorWith(t,e,n){return differenceWith(unionWith(t,e,n),intersectionWith(t,e,n),n)};t.zip=zip;t.zipObject=function zipObject(t,e){const n={};for(let r=0;r<t.length;r++)n[t[r]]=e[r];return n};t.zipObjectDeep=function zipObjectDeep(t,e){const n={},r=zip(t,e);for(let t=0;t<r.length;t++){const[e,o]=r[t];null!=e&&set(n,e,o)}return n};t.zipWith=function zipWith(t,...e){const n=[t,...e.slice(0,-1)],r=e[e.length-1],o=[],i=Math.max(...n.map((t=>t.length)));for(let t=0;t<i;t++){const e=n.map((e=>e[t]));o.push(r(...e))}return o};Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});return t}({});
2
2
  //# sourceMappingURL=browser.global.js.map