es-toolkit 1.13.1-dev.297 → 1.13.1-dev.299

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/index.mjs CHANGED
@@ -58,7 +58,7 @@ import {
58
58
  } from "./chunk-6CLH5YZ2.mjs";
59
59
  import {
60
60
  clone
61
- } from "./chunk-U4JGKZ56.mjs";
61
+ } from "./chunk-VRUTBJYS.mjs";
62
62
  import {
63
63
  flattenObject
64
64
  } from "./chunk-XGQWTHW6.mjs";
@@ -264,9 +264,6 @@ import {
264
264
  TimeoutError
265
265
  } from "./chunk-KIOYQRMQ.mjs";
266
266
  import "./chunk-236H5JZJ.mjs";
267
- import {
268
- negate
269
- } from "./chunk-BOOQBJN2.mjs";
270
267
  import {
271
268
  noop
272
269
  } from "./chunk-LKXCOLNY.mjs";
@@ -279,6 +276,9 @@ import {
279
276
  import {
280
277
  debounce
281
278
  } from "./chunk-3IP4JVLL.mjs";
279
+ import {
280
+ negate
281
+ } from "./chunk-BOOQBJN2.mjs";
282
282
  import "./chunk-24FKGR6U.mjs";
283
283
  export {
284
284
  AbortError,
@@ -51,7 +51,9 @@ function clone(obj) {
51
51
  return result;
52
52
  }
53
53
  if (typeof obj === "object") {
54
- return Object.assign({}, obj);
54
+ const prototype = Object.getPrototypeOf(obj);
55
+ const result = Object.create(prototype);
56
+ return Object.assign(result, obj);
55
57
  }
56
58
  return obj;
57
59
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/object/clone.ts"],"sourcesContent":["/**\n * Creates a shallow clone of the given object.\n *\n * @template T - The type of the object.\n * @param {T} obj - The object to clone.\n * @returns {T} - A shallow clone of the given object.\n *\n * @example\n * // Clone a primitive values\n * const num = 29;\n * const clonedNum = clone(num);\n * console.log(clonedNum); // 29\n * console.log(clonedNum === num) ; // true\n *\n * @example\n * // Clone an array\n * const arr = [1, 2, 3];\n * const clonedArr = clone(arr);\n * console.log(clonedArr); // [1, 2, 3]\n * console.log(clonedArr === arr); // false\n *\n * @example\n * // Clone an object\n * const obj = { a: 1, b: 'es-toolkit', c: [1, 2, 3] };\n * const clonedObj = clone(obj);\n * console.log(clonedObj); // { a: 1, b: 'es-toolkit', c: [1, 2, 3] }\n * console.log(clonedObj === obj); // false\n */\nexport function clone<T>(obj: T): T {\n if (isPrimitive(obj)) {\n return obj;\n }\n\n if (Array.isArray(obj)) {\n return obj.slice() as T;\n }\n\n if (obj instanceof Date) {\n return new Date(obj.getTime()) as T;\n }\n\n if (obj instanceof RegExp) {\n return new RegExp(obj.source, obj.flags) as T;\n }\n\n if (obj instanceof Map) {\n const result = new Map();\n for (const [key, value] of obj) {\n result.set(key, value);\n }\n return result as T;\n }\n\n if (obj instanceof Set) {\n const result = new Set();\n for (const value of obj) {\n result.add(value);\n }\n return result as T;\n }\n\n if (typeof obj === \"object\") {\n return Object.assign({}, obj) as T;\n }\n return obj;\n}\n\ntype Primitive = null | undefined | string | number | boolean | symbol | bigint;\n\nfunction isPrimitive(value: unknown): value is Primitive {\n return value == null ||\n (typeof value !== \"object\" && typeof value !== \"function\");\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA4BO,SAAS,MAAS,KAAW;AAClC,MAAI,YAAY,GAAG,GAAG;AACpB,WAAO;AAAA,EACT;AAEA,MAAI,MAAM,QAAQ,GAAG,GAAG;AACtB,WAAO,IAAI,MAAM;AAAA,EACnB;AAEA,MAAI,eAAe,MAAM;AACvB,WAAO,IAAI,KAAK,IAAI,QAAQ,CAAC;AAAA,EAC/B;AAEA,MAAI,eAAe,QAAQ;AACzB,WAAO,IAAI,OAAO,IAAI,QAAQ,IAAI,KAAK;AAAA,EACzC;AAEA,MAAI,eAAe,KAAK;AACtB,UAAM,SAAS,oBAAI,IAAI;AACvB,eAAW,CAAC,KAAK,KAAK,KAAK,KAAK;AAC9B,aAAO,IAAI,KAAK,KAAK;AAAA,IACvB;AACA,WAAO;AAAA,EACT;AAEA,MAAI,eAAe,KAAK;AACtB,UAAM,SAAS,oBAAI,IAAI;AACvB,eAAW,SAAS,KAAK;AACvB,aAAO,IAAI,KAAK;AAAA,IAClB;AACA,WAAO;AAAA,EACT;AAEA,MAAI,OAAO,QAAQ,UAAU;AAC3B,WAAO,OAAO,OAAO,CAAC,GAAG,GAAG;AAAA,EAC9B;AACA,SAAO;AACT;AAIA,SAAS,YAAY,OAAoC;AACvD,SAAO,SAAS,QACb,OAAO,UAAU,YAAY,OAAO,UAAU;AACnD;","names":[]}
1
+ {"version":3,"sources":["../../src/object/clone.ts"],"sourcesContent":["/**\n * Creates a shallow clone of the given object.\n *\n * @template T - The type of the object.\n * @param {T} obj - The object to clone.\n * @returns {T} - A shallow clone of the given object.\n *\n * @example\n * // Clone a primitive values\n * const num = 29;\n * const clonedNum = clone(num);\n * console.log(clonedNum); // 29\n * console.log(clonedNum === num) ; // true\n *\n * @example\n * // Clone an array\n * const arr = [1, 2, 3];\n * const clonedArr = clone(arr);\n * console.log(clonedArr); // [1, 2, 3]\n * console.log(clonedArr === arr); // false\n *\n * @example\n * // Clone an object\n * const obj = { a: 1, b: 'es-toolkit', c: [1, 2, 3] };\n * const clonedObj = clone(obj);\n * console.log(clonedObj); // { a: 1, b: 'es-toolkit', c: [1, 2, 3] }\n * console.log(clonedObj === obj); // false\n */\nexport function clone<T>(obj: T): T {\n if (isPrimitive(obj)) {\n return obj;\n }\n\n if (Array.isArray(obj)) {\n return obj.slice() as T;\n }\n\n if (obj instanceof Date) {\n return new Date(obj.getTime()) as T;\n }\n\n if (obj instanceof RegExp) {\n return new RegExp(obj.source, obj.flags) as T;\n }\n\n if (obj instanceof Map) {\n const result = new Map();\n for (const [key, value] of obj) {\n result.set(key, value);\n }\n return result as T;\n }\n\n if (obj instanceof Set) {\n const result = new Set();\n for (const value of obj) {\n result.add(value);\n }\n return result as T;\n }\n\n if (typeof obj === 'object') {\n const prototype = Object.getPrototypeOf(obj);\n const result = Object.create(prototype)\n return Object.assign(result, obj);\n }\n return obj;\n}\n\ntype Primitive = null | undefined | string | number | boolean | symbol | bigint;\n\nfunction isPrimitive(value: unknown): value is Primitive {\n return value == null || (typeof value !== 'object' && typeof value !== 'function');\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA4BO,SAAS,MAAS,KAAW;AAClC,MAAI,YAAY,GAAG,GAAG;AACpB,WAAO;AAAA,EACT;AAEA,MAAI,MAAM,QAAQ,GAAG,GAAG;AACtB,WAAO,IAAI,MAAM;AAAA,EACnB;AAEA,MAAI,eAAe,MAAM;AACvB,WAAO,IAAI,KAAK,IAAI,QAAQ,CAAC;AAAA,EAC/B;AAEA,MAAI,eAAe,QAAQ;AACzB,WAAO,IAAI,OAAO,IAAI,QAAQ,IAAI,KAAK;AAAA,EACzC;AAEA,MAAI,eAAe,KAAK;AACtB,UAAM,SAAS,oBAAI,IAAI;AACvB,eAAW,CAAC,KAAK,KAAK,KAAK,KAAK;AAC9B,aAAO,IAAI,KAAK,KAAK;AAAA,IACvB;AACA,WAAO;AAAA,EACT;AAEA,MAAI,eAAe,KAAK;AACtB,UAAM,SAAS,oBAAI,IAAI;AACvB,eAAW,SAAS,KAAK;AACvB,aAAO,IAAI,KAAK;AAAA,IAClB;AACA,WAAO;AAAA,EACT;AAEA,MAAI,OAAO,QAAQ,UAAU;AAC3B,UAAM,YAAY,OAAO,eAAe,GAAG;AAC3C,UAAM,SAAS,OAAO,OAAO,SAAS;AACtC,WAAO,OAAO,OAAO,QAAQ,GAAG;AAAA,EAClC;AACA,SAAO;AACT;AAIA,SAAS,YAAY,OAAoC;AACvD,SAAO,SAAS,QAAS,OAAO,UAAU,YAAY,OAAO,UAAU;AACzE;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  clone
3
- } from "../chunk-U4JGKZ56.mjs";
3
+ } from "../chunk-VRUTBJYS.mjs";
4
4
  import "../chunk-24FKGR6U.mjs";
5
5
  export {
6
6
  clone
@@ -127,7 +127,9 @@ function clone(obj) {
127
127
  return result;
128
128
  }
129
129
  if (typeof obj === "object") {
130
- return Object.assign({}, obj);
130
+ const prototype = Object.getPrototypeOf(obj);
131
+ const result = Object.create(prototype);
132
+ return Object.assign(result, obj);
131
133
  }
132
134
  return obj;
133
135
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/object/index.ts","../../src/object/omit.ts","../../src/object/omitBy.ts","../../src/object/pick.ts","../../src/object/pickBy.ts","../../src/object/invert.ts","../../src/object/clone.ts","../../src/predicate/isPlainObject.ts","../../src/object/flattenObject.ts"],"sourcesContent":["export { omit } from './omit.ts';\nexport { omitBy } from './omitBy.ts';\nexport { pick } from './pick.ts';\nexport { pickBy } from './pickBy.ts';\nexport { invert } from './invert.ts';\nexport { clone } from './clone.ts';\nexport { flattenObject } from './flattenObject.ts';","/**\n * Creates a new object with specified keys omitted.\n *\n * This function takes an object and an array of keys, and returns a new object that\n * excludes the properties corresponding to the specified keys.\n *\n * @template T - The type of object.\n * @template K - The type of keys in object.\n * @param {T} obj - The object to omit keys from.\n * @param {K[]} keys - An array of keys to be omitted from the object.\n * @returns {Omit<T, K>} A new object with the specified keys omitted.\n *\n * @example\n * const obj = { a: 1, b: 2, c: 3 };\n * const result = omit(obj, ['b', 'c']);\n * // result will be { a: 1 }\n */\nexport function omit<T extends Record<string, any>, K extends keyof T>(obj: T, keys: K[]): Omit<T, K> {\n const result = { ...obj };\n\n for (const key of keys) {\n delete result[key];\n }\n\n return result as Omit<T, K>;\n}\n","/**\n * Creates a new object composed of the properties that do not satisfy the predicate function.\n *\n * This function takes an object and a predicate function, and returns a new object that\n * includes only the properties for which the predicate function returns false.\n *\n * @template T - The type of object.\n * @param {T} obj - The object to omit properties from.\n * @param {(value: T[string], key: keyof T) => boolean} shouldOmit - A predicate function that determines\n * whether a property should be omitted. It takes the property's key and value as arguments and returns `true`\n * if the property should be omitted, and `false` otherwise.\n * @returns {Partial<T>} A new object with the properties that do not satisfy the predicate function.\n *\n * @example\n * const obj = { a: 1, b: 'omit', c: 3 };\n * const shouldOmit = (key, value) => typeof value === 'string';\n * const result = omitBy(obj, shouldOmit);\n * // result will be { a: 1, c: 3 }\n */\nexport function omitBy<T extends Record<string, any>>(\n obj: T,\n shouldOmit: (value: T[keyof T], key: keyof T) => boolean\n): Partial<T> {\n const result: Partial<T> = {};\n\n for (const [key, value] of Object.entries(obj)) {\n if (shouldOmit(value, key)) {\n continue;\n }\n\n (result as any)[key] = value;\n }\n\n return result;\n}\n","/**\n * Creates a new object composed of the picked object properties.\n *\n * This function takes an object and an array of keys, and returns a new object that\n * includes only the properties corresponding to the specified keys.\n *\n * @template T - The type of object.\n * @template K - The type of keys in object.\n * @param {T} obj - The object to pick keys from.\n * @param {K[]} keys - An array of keys to be picked from the object.\n * @returns {Pick<T, K>} A new object with the specified keys picked.\n *\n * @example\n * const obj = { a: 1, b: 2, c: 3 };\n * const result = pick(obj, ['a', 'c']);\n * // result will be { a: 1, c: 3 }\n */\nexport function pick<T extends Record<string, any>, K extends keyof T>(obj: T, keys: K[]): Pick<T, K> {\n const result = {} as Pick<T, K>;\n\n for (const key of keys) {\n result[key] = obj[key];\n }\n\n return result;\n}\n","/**\n * Creates a new object composed of the properties that satisfy the predicate function.\n *\n * This function takes an object and a predicate function, and returns a new object that\n * includes only the properties for which the predicate function returns true.\n *\n * @template T - The type of object.\n * @param {T} obj - The object to pick properties from.\n * @param {(value: T[keyof T], key: keyof T) => boolean} shouldPick - A predicate function that determines\n * whether a property should be picked. It takes the property's key and value as arguments and returns `true`\n * if the property should be picked, and `false` otherwise.\n * @returns {Partial<T>} A new object with the properties that satisfy the predicate function.\n *\n * @example\n * const obj = { a: 1, b: 'pick', c: 3 };\n * const shouldPick = (value) => typeof value === 'string';\n * const result = pickBy(obj, shouldPick);\n * // result will be { b: 'pick' }\n */\nexport function pickBy<T extends Record<string, any>>(\n obj: T,\n shouldPick: (value: T[keyof T], key: keyof T) => boolean\n): Partial<T> {\n const result: Partial<T> = {};\n\n for (const [key, value] of Object.entries(obj)) {\n if (!shouldPick(value, key)) {\n continue;\n }\n\n (result as any)[key] = value;\n }\n\n return result;\n}\n","/**\n * Inverts the keys and values of an object. The keys of the input object become the values of the output object and vice versa.\n *\n * This function takes an object and creates a new object by inverting its keys and values. If the input object has duplicate values,\n * the key of the last occurrence will be used as the value for the new key in the output object. It effectively creates a reverse mapping\n * of the input object's key-value pairs.\n *\n * @template K - Type of the keys in the input object (string, number, symbol)\n * @template V - Type of the values in the input object (string, number, symbol)\n * @param {Record<K, V>} obj - The input object whose keys and values are to be inverted\n * @returns {{ [key in V]: K }} - A new object with keys and values inverted\n *\n * @example\n * invert({ a: 1, b: 2, c: 3 }); // { 1: 'a', 2: 'b', 3: 'c' }\n * invert({ 1: 'a', 2: 'b', 3: 'c' }); // { a: '1', b: '2', c: '3' }\n * invert({ a: 1, 2: 'b', c: 3, 4: 'd' }); // { 1: 'a', b: '2', 3: 'c', d: '4' }\n * invert({ a: Symbol('sym1'), b: Symbol('sym2') }); // { [Symbol('sym1')]: 'a', [Symbol('sym2')]: 'b' }\n */\nexport function invert<K extends PropertyKey, V extends PropertyKey>(obj: Record<K, V>): { [key in V]: K } {\n const result = {} as { [key in V]: K };\n\n const keys = Object.keys(obj) as K[];\n \n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n const value = obj[key];\n result[value] = key;\n }\n\n return result;\n}\n","/**\n * Creates a shallow clone of the given object.\n *\n * @template T - The type of the object.\n * @param {T} obj - The object to clone.\n * @returns {T} - A shallow clone of the given object.\n *\n * @example\n * // Clone a primitive values\n * const num = 29;\n * const clonedNum = clone(num);\n * console.log(clonedNum); // 29\n * console.log(clonedNum === num) ; // true\n *\n * @example\n * // Clone an array\n * const arr = [1, 2, 3];\n * const clonedArr = clone(arr);\n * console.log(clonedArr); // [1, 2, 3]\n * console.log(clonedArr === arr); // false\n *\n * @example\n * // Clone an object\n * const obj = { a: 1, b: 'es-toolkit', c: [1, 2, 3] };\n * const clonedObj = clone(obj);\n * console.log(clonedObj); // { a: 1, b: 'es-toolkit', c: [1, 2, 3] }\n * console.log(clonedObj === obj); // false\n */\nexport function clone<T>(obj: T): T {\n if (isPrimitive(obj)) {\n return obj;\n }\n\n if (Array.isArray(obj)) {\n return obj.slice() as T;\n }\n\n if (obj instanceof Date) {\n return new Date(obj.getTime()) as T;\n }\n\n if (obj instanceof RegExp) {\n return new RegExp(obj.source, obj.flags) as T;\n }\n\n if (obj instanceof Map) {\n const result = new Map();\n for (const [key, value] of obj) {\n result.set(key, value);\n }\n return result as T;\n }\n\n if (obj instanceof Set) {\n const result = new Set();\n for (const value of obj) {\n result.add(value);\n }\n return result as T;\n }\n\n if (typeof obj === \"object\") {\n return Object.assign({}, obj) as T;\n }\n return obj;\n}\n\ntype Primitive = null | undefined | string | number | boolean | symbol | bigint;\n\nfunction isPrimitive(value: unknown): value is Primitive {\n return value == null ||\n (typeof value !== \"object\" && typeof value !== \"function\");\n}\n","/**\n * Checks if a given value is a plain object.\n * \n * @param {object} object - The value to check.\n * @returns {boolean} - True if the value is a plain object, otherwise false.\n * \n * @example\n * console.log(isPlainObject({})); // true\n * console.log(isPlainObject([])); // false\n * console.log(isPlainObject(null)); // false\n * console.log(isPlainObject(Object.create(null))); // true\n * console.log(Buffer.from('hello, world')); // false\n */\nexport function isPlainObject(object: object): boolean {\n if (typeof object !== 'object') {\n return false;\n }\n\n if (object == null) {\n return false;\n }\n\n if (Object.getPrototypeOf(object) === null) {\n return true;\n }\n\n if (object.toString() !== '[object Object]') {\n return false;\n }\n\n let proto = object;\n\n while (Object.getPrototypeOf(proto) !== null) {\n proto = Object.getPrototypeOf(proto);\n }\n\n return Object.getPrototypeOf(object) === proto;\n}","import { isPlainObject } from \"../predicate/isPlainObject.ts\";\n\n/**\n * Flattens a nested object into a single level object with dot-separated keys.\n * \n * @param {object} object - The object to flatten.\n * @returns {Record<string, any>} - The flattened object.\n * \n * @example\n * const nestedObject = {\n * a: {\n * b: {\n * c: 1\n * }\n * },\n * d: [2, 3]\n * };\n * \n * const flattened = flattenObject(nestedObject);\n * console.log(flattened); \n * // Output:\n * // {\n * // 'a.b.c': 1,\n * // 'd.0': 2,\n * // 'd.1': 3\n * // }\n */\nexport function flattenObject(object: object): Record<string, any> {\n return flattenObjectImpl(object);\n}\n\nfunction flattenObjectImpl(object: object, prefix = ''): Record<string, any> {\n const result: Record<string, any> = {};\n const keys = Object.keys(object);\n\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n const value = (object as any)[key];\n\n const prefixedKey = prefix ? `${prefix}.${key}` : key;\n\n if (isPlainObject(value) && Object.keys(value).length > 0) {\n Object.assign(result, flattenObjectImpl(value, prefixedKey));\n continue;\n }\n\n if (Array.isArray(value)) {\n for (let index = 0; index < value.length; index++) {\n result[`${prefixedKey}.${index}`] = value[index];\n }\n continue;\n }\n\n result[prefixedKey] = value;\n }\n\n return result;\n}"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACiBO,SAAS,KAAuD,KAAQ,MAAuB;AACpG,QAAM,SAAS,mBAAK;AAEpB,aAAW,OAAO,MAAM;AACtB,WAAO,OAAO,GAAG;AAAA,EACnB;AAEA,SAAO;AACT;;;ACNO,SAAS,OACd,KACA,YACY;AACZ,QAAM,SAAqB,CAAC;AAE5B,aAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,GAAG,GAAG;AAC9C,QAAI,WAAW,OAAO,GAAG,GAAG;AAC1B;AAAA,IACF;AAEA,IAAC,OAAe,GAAG,IAAI;AAAA,EACzB;AAEA,SAAO;AACT;;;ACjBO,SAAS,KAAuD,KAAQ,MAAuB;AACpG,QAAM,SAAS,CAAC;AAEhB,aAAW,OAAO,MAAM;AACtB,WAAO,GAAG,IAAI,IAAI,GAAG;AAAA,EACvB;AAEA,SAAO;AACT;;;ACNO,SAAS,OACd,KACA,YACY;AACZ,QAAM,SAAqB,CAAC;AAE5B,aAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,GAAG,GAAG;AAC9C,QAAI,CAAC,WAAW,OAAO,GAAG,GAAG;AAC3B;AAAA,IACF;AAEA,IAAC,OAAe,GAAG,IAAI;AAAA,EACzB;AAEA,SAAO;AACT;;;AChBO,SAAS,OAAqD,KAAsC;AACzG,QAAM,SAAS,CAAC;AAEhB,QAAM,OAAO,OAAO,KAAK,GAAG;AAE5B,WAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AACpC,UAAM,MAAM,KAAK,CAAC;AAClB,UAAM,QAAQ,IAAI,GAAG;AACrB,WAAO,KAAK,IAAI;AAAA,EAClB;AAEA,SAAO;AACT;;;ACFO,SAAS,MAAS,KAAW;AAClC,MAAI,YAAY,GAAG,GAAG;AACpB,WAAO;AAAA,EACT;AAEA,MAAI,MAAM,QAAQ,GAAG,GAAG;AACtB,WAAO,IAAI,MAAM;AAAA,EACnB;AAEA,MAAI,eAAe,MAAM;AACvB,WAAO,IAAI,KAAK,IAAI,QAAQ,CAAC;AAAA,EAC/B;AAEA,MAAI,eAAe,QAAQ;AACzB,WAAO,IAAI,OAAO,IAAI,QAAQ,IAAI,KAAK;AAAA,EACzC;AAEA,MAAI,eAAe,KAAK;AACtB,UAAM,SAAS,oBAAI,IAAI;AACvB,eAAW,CAAC,KAAK,KAAK,KAAK,KAAK;AAC9B,aAAO,IAAI,KAAK,KAAK;AAAA,IACvB;AACA,WAAO;AAAA,EACT;AAEA,MAAI,eAAe,KAAK;AACtB,UAAM,SAAS,oBAAI,IAAI;AACvB,eAAW,SAAS,KAAK;AACvB,aAAO,IAAI,KAAK;AAAA,IAClB;AACA,WAAO;AAAA,EACT;AAEA,MAAI,OAAO,QAAQ,UAAU;AAC3B,WAAO,OAAO,OAAO,CAAC,GAAG,GAAG;AAAA,EAC9B;AACA,SAAO;AACT;AAIA,SAAS,YAAY,OAAoC;AACvD,SAAO,SAAS,QACb,OAAO,UAAU,YAAY,OAAO,UAAU;AACnD;;;AC3DO,SAAS,cAAc,QAAyB;AACrD,MAAI,OAAO,WAAW,UAAU;AAC9B,WAAO;AAAA,EACT;AAEA,MAAI,UAAU,MAAM;AAClB,WAAO;AAAA,EACT;AAEA,MAAI,OAAO,eAAe,MAAM,MAAM,MAAM;AAC1C,WAAO;AAAA,EACT;AAEA,MAAI,OAAO,SAAS,MAAM,mBAAmB;AAC3C,WAAO;AAAA,EACT;AAEA,MAAI,QAAQ;AAEZ,SAAO,OAAO,eAAe,KAAK,MAAM,MAAM;AAC5C,YAAQ,OAAO,eAAe,KAAK;AAAA,EACrC;AAEA,SAAO,OAAO,eAAe,MAAM,MAAM;AAC3C;;;ACVO,SAAS,cAAc,QAAqC;AACjE,SAAO,kBAAkB,MAAM;AACjC;AAEA,SAAS,kBAAkB,QAAgB,SAAS,IAAyB;AAC3E,QAAM,SAA8B,CAAC;AACrC,QAAM,OAAO,OAAO,KAAK,MAAM;AAE/B,WAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AACpC,UAAM,MAAM,KAAK,CAAC;AAClB,UAAM,QAAS,OAAe,GAAG;AAEjC,UAAM,cAAc,SAAS,GAAG,MAAM,IAAI,GAAG,KAAK;AAElD,QAAI,cAAc,KAAK,KAAK,OAAO,KAAK,KAAK,EAAE,SAAS,GAAG;AACzD,aAAO,OAAO,QAAQ,kBAAkB,OAAO,WAAW,CAAC;AAC3D;AAAA,IACF;AAEA,QAAI,MAAM,QAAQ,KAAK,GAAG;AACxB,eAAS,QAAQ,GAAG,QAAQ,MAAM,QAAQ,SAAS;AACjD,eAAO,GAAG,WAAW,IAAI,KAAK,EAAE,IAAI,MAAM,KAAK;AAAA,MACjD;AACA;AAAA,IACF;AAEA,WAAO,WAAW,IAAI;AAAA,EACxB;AAEA,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../src/object/index.ts","../../src/object/omit.ts","../../src/object/omitBy.ts","../../src/object/pick.ts","../../src/object/pickBy.ts","../../src/object/invert.ts","../../src/object/clone.ts","../../src/predicate/isPlainObject.ts","../../src/object/flattenObject.ts"],"sourcesContent":["export { omit } from './omit.ts';\nexport { omitBy } from './omitBy.ts';\nexport { pick } from './pick.ts';\nexport { pickBy } from './pickBy.ts';\nexport { invert } from './invert.ts';\nexport { clone } from './clone.ts';\nexport { flattenObject } from './flattenObject.ts';","/**\n * Creates a new object with specified keys omitted.\n *\n * This function takes an object and an array of keys, and returns a new object that\n * excludes the properties corresponding to the specified keys.\n *\n * @template T - The type of object.\n * @template K - The type of keys in object.\n * @param {T} obj - The object to omit keys from.\n * @param {K[]} keys - An array of keys to be omitted from the object.\n * @returns {Omit<T, K>} A new object with the specified keys omitted.\n *\n * @example\n * const obj = { a: 1, b: 2, c: 3 };\n * const result = omit(obj, ['b', 'c']);\n * // result will be { a: 1 }\n */\nexport function omit<T extends Record<string, any>, K extends keyof T>(obj: T, keys: K[]): Omit<T, K> {\n const result = { ...obj };\n\n for (const key of keys) {\n delete result[key];\n }\n\n return result as Omit<T, K>;\n}\n","/**\n * Creates a new object composed of the properties that do not satisfy the predicate function.\n *\n * This function takes an object and a predicate function, and returns a new object that\n * includes only the properties for which the predicate function returns false.\n *\n * @template T - The type of object.\n * @param {T} obj - The object to omit properties from.\n * @param {(value: T[string], key: keyof T) => boolean} shouldOmit - A predicate function that determines\n * whether a property should be omitted. It takes the property's key and value as arguments and returns `true`\n * if the property should be omitted, and `false` otherwise.\n * @returns {Partial<T>} A new object with the properties that do not satisfy the predicate function.\n *\n * @example\n * const obj = { a: 1, b: 'omit', c: 3 };\n * const shouldOmit = (key, value) => typeof value === 'string';\n * const result = omitBy(obj, shouldOmit);\n * // result will be { a: 1, c: 3 }\n */\nexport function omitBy<T extends Record<string, any>>(\n obj: T,\n shouldOmit: (value: T[keyof T], key: keyof T) => boolean\n): Partial<T> {\n const result: Partial<T> = {};\n\n for (const [key, value] of Object.entries(obj)) {\n if (shouldOmit(value, key)) {\n continue;\n }\n\n (result as any)[key] = value;\n }\n\n return result;\n}\n","/**\n * Creates a new object composed of the picked object properties.\n *\n * This function takes an object and an array of keys, and returns a new object that\n * includes only the properties corresponding to the specified keys.\n *\n * @template T - The type of object.\n * @template K - The type of keys in object.\n * @param {T} obj - The object to pick keys from.\n * @param {K[]} keys - An array of keys to be picked from the object.\n * @returns {Pick<T, K>} A new object with the specified keys picked.\n *\n * @example\n * const obj = { a: 1, b: 2, c: 3 };\n * const result = pick(obj, ['a', 'c']);\n * // result will be { a: 1, c: 3 }\n */\nexport function pick<T extends Record<string, any>, K extends keyof T>(obj: T, keys: K[]): Pick<T, K> {\n const result = {} as Pick<T, K>;\n\n for (const key of keys) {\n result[key] = obj[key];\n }\n\n return result;\n}\n","/**\n * Creates a new object composed of the properties that satisfy the predicate function.\n *\n * This function takes an object and a predicate function, and returns a new object that\n * includes only the properties for which the predicate function returns true.\n *\n * @template T - The type of object.\n * @param {T} obj - The object to pick properties from.\n * @param {(value: T[keyof T], key: keyof T) => boolean} shouldPick - A predicate function that determines\n * whether a property should be picked. It takes the property's key and value as arguments and returns `true`\n * if the property should be picked, and `false` otherwise.\n * @returns {Partial<T>} A new object with the properties that satisfy the predicate function.\n *\n * @example\n * const obj = { a: 1, b: 'pick', c: 3 };\n * const shouldPick = (value) => typeof value === 'string';\n * const result = pickBy(obj, shouldPick);\n * // result will be { b: 'pick' }\n */\nexport function pickBy<T extends Record<string, any>>(\n obj: T,\n shouldPick: (value: T[keyof T], key: keyof T) => boolean\n): Partial<T> {\n const result: Partial<T> = {};\n\n for (const [key, value] of Object.entries(obj)) {\n if (!shouldPick(value, key)) {\n continue;\n }\n\n (result as any)[key] = value;\n }\n\n return result;\n}\n","/**\n * Inverts the keys and values of an object. The keys of the input object become the values of the output object and vice versa.\n *\n * This function takes an object and creates a new object by inverting its keys and values. If the input object has duplicate values,\n * the key of the last occurrence will be used as the value for the new key in the output object. It effectively creates a reverse mapping\n * of the input object's key-value pairs.\n *\n * @template K - Type of the keys in the input object (string, number, symbol)\n * @template V - Type of the values in the input object (string, number, symbol)\n * @param {Record<K, V>} obj - The input object whose keys and values are to be inverted\n * @returns {{ [key in V]: K }} - A new object with keys and values inverted\n *\n * @example\n * invert({ a: 1, b: 2, c: 3 }); // { 1: 'a', 2: 'b', 3: 'c' }\n * invert({ 1: 'a', 2: 'b', 3: 'c' }); // { a: '1', b: '2', c: '3' }\n * invert({ a: 1, 2: 'b', c: 3, 4: 'd' }); // { 1: 'a', b: '2', 3: 'c', d: '4' }\n * invert({ a: Symbol('sym1'), b: Symbol('sym2') }); // { [Symbol('sym1')]: 'a', [Symbol('sym2')]: 'b' }\n */\nexport function invert<K extends PropertyKey, V extends PropertyKey>(obj: Record<K, V>): { [key in V]: K } {\n const result = {} as { [key in V]: K };\n\n const keys = Object.keys(obj) as K[];\n \n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n const value = obj[key];\n result[value] = key;\n }\n\n return result;\n}\n","/**\n * Creates a shallow clone of the given object.\n *\n * @template T - The type of the object.\n * @param {T} obj - The object to clone.\n * @returns {T} - A shallow clone of the given object.\n *\n * @example\n * // Clone a primitive values\n * const num = 29;\n * const clonedNum = clone(num);\n * console.log(clonedNum); // 29\n * console.log(clonedNum === num) ; // true\n *\n * @example\n * // Clone an array\n * const arr = [1, 2, 3];\n * const clonedArr = clone(arr);\n * console.log(clonedArr); // [1, 2, 3]\n * console.log(clonedArr === arr); // false\n *\n * @example\n * // Clone an object\n * const obj = { a: 1, b: 'es-toolkit', c: [1, 2, 3] };\n * const clonedObj = clone(obj);\n * console.log(clonedObj); // { a: 1, b: 'es-toolkit', c: [1, 2, 3] }\n * console.log(clonedObj === obj); // false\n */\nexport function clone<T>(obj: T): T {\n if (isPrimitive(obj)) {\n return obj;\n }\n\n if (Array.isArray(obj)) {\n return obj.slice() as T;\n }\n\n if (obj instanceof Date) {\n return new Date(obj.getTime()) as T;\n }\n\n if (obj instanceof RegExp) {\n return new RegExp(obj.source, obj.flags) as T;\n }\n\n if (obj instanceof Map) {\n const result = new Map();\n for (const [key, value] of obj) {\n result.set(key, value);\n }\n return result as T;\n }\n\n if (obj instanceof Set) {\n const result = new Set();\n for (const value of obj) {\n result.add(value);\n }\n return result as T;\n }\n\n if (typeof obj === 'object') {\n const prototype = Object.getPrototypeOf(obj);\n const result = Object.create(prototype)\n return Object.assign(result, obj);\n }\n return obj;\n}\n\ntype Primitive = null | undefined | string | number | boolean | symbol | bigint;\n\nfunction isPrimitive(value: unknown): value is Primitive {\n return value == null || (typeof value !== 'object' && typeof value !== 'function');\n}\n","/**\n * Checks if a given value is a plain object.\n * \n * @param {object} object - The value to check.\n * @returns {boolean} - True if the value is a plain object, otherwise false.\n * \n * @example\n * console.log(isPlainObject({})); // true\n * console.log(isPlainObject([])); // false\n * console.log(isPlainObject(null)); // false\n * console.log(isPlainObject(Object.create(null))); // true\n * console.log(Buffer.from('hello, world')); // false\n */\nexport function isPlainObject(object: object): boolean {\n if (typeof object !== 'object') {\n return false;\n }\n\n if (object == null) {\n return false;\n }\n\n if (Object.getPrototypeOf(object) === null) {\n return true;\n }\n\n if (object.toString() !== '[object Object]') {\n return false;\n }\n\n let proto = object;\n\n while (Object.getPrototypeOf(proto) !== null) {\n proto = Object.getPrototypeOf(proto);\n }\n\n return Object.getPrototypeOf(object) === proto;\n}","import { isPlainObject } from \"../predicate/isPlainObject.ts\";\n\n/**\n * Flattens a nested object into a single level object with dot-separated keys.\n * \n * @param {object} object - The object to flatten.\n * @returns {Record<string, any>} - The flattened object.\n * \n * @example\n * const nestedObject = {\n * a: {\n * b: {\n * c: 1\n * }\n * },\n * d: [2, 3]\n * };\n * \n * const flattened = flattenObject(nestedObject);\n * console.log(flattened); \n * // Output:\n * // {\n * // 'a.b.c': 1,\n * // 'd.0': 2,\n * // 'd.1': 3\n * // }\n */\nexport function flattenObject(object: object): Record<string, any> {\n return flattenObjectImpl(object);\n}\n\nfunction flattenObjectImpl(object: object, prefix = ''): Record<string, any> {\n const result: Record<string, any> = {};\n const keys = Object.keys(object);\n\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n const value = (object as any)[key];\n\n const prefixedKey = prefix ? `${prefix}.${key}` : key;\n\n if (isPlainObject(value) && Object.keys(value).length > 0) {\n Object.assign(result, flattenObjectImpl(value, prefixedKey));\n continue;\n }\n\n if (Array.isArray(value)) {\n for (let index = 0; index < value.length; index++) {\n result[`${prefixedKey}.${index}`] = value[index];\n }\n continue;\n }\n\n result[prefixedKey] = value;\n }\n\n return result;\n}"],"mappings":"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","names":[]}
@@ -10,7 +10,7 @@ import {
10
10
  } from "../chunk-6CLH5YZ2.mjs";
11
11
  import {
12
12
  clone
13
- } from "../chunk-U4JGKZ56.mjs";
13
+ } from "../chunk-VRUTBJYS.mjs";
14
14
  import {
15
15
  flattenObject
16
16
  } from "../chunk-XGQWTHW6.mjs";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "es-toolkit",
3
3
  "description": "A state-of-the-art, high-performance JavaScript utility library with a small bundle size and strong type annotations.",
4
- "version": "1.13.1-dev.297+cbd4d3d0",
4
+ "version": "1.13.1-dev.299+cc06b2d7",
5
5
  "homepage": "https://es-toolkit.slash.page",
6
6
  "bugs": "https://github.com/toss/es-toolkit/issues",
7
7
  "repository": {
@@ -1,2 +1,2 @@
1
- "use strict";(()=>{var z=Object.defineProperty;var V=Object.getOwnPropertySymbols;var xt=Object.prototype.hasOwnProperty,yt=Object.prototype.propertyIsEnumerable;var N=(e,t,r)=>t in e?z(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,C=(e,t)=>{for(var r in t||(t={}))xt.call(t,r)&&N(e,r,t[r]);if(V)for(var r of V(t))yt.call(t,r)&&N(e,r,t[r]);return e};var ht=(e,t)=>{for(var r in t)z(e,r,{get:t[r],enumerable:!0})};var y=(e,t,r)=>new Promise((n,o)=>{var i=a=>{try{f(r.next(a))}catch(c){o(c)}},u=a=>{try{f(r.throw(a))}catch(c){o(c)}},f=a=>a.done?n(a.value):Promise.resolve(a.value).then(i,u);f((r=r.apply(e,t)).next())});var B={};ht(B,{AbortError:()=>p,TimeoutError:()=>T,camelCase:()=>Qe,capitalize:()=>D,chunk:()=>ot,clamp:()=>We,clone:()=>Ce,compact:()=>L,concat:()=>it,countBy:()=>q,debounce:()=>Ue,delay:()=>v,difference:()=>ut,differenceBy:()=>b,differenceWith:()=>g,drop:()=>$,dropRight:()=>G,dropRightWhile:()=>X,dropWhile:()=>Z,endsWith:()=>pt,fill:()=>H,first:()=>F,flatMap:()=>Y,flatten:()=>l,flattenDeep:()=>J,flattenObject:()=>Le,forEachRight:()=>Q,get:()=>st,groupBy:()=>ee,head:()=>F,inRange:()=>ve,initial:()=>Ae,intersection:()=>K,intersectionBy:()=>k,intersectionWith:()=>w,invert:()=>ze,isEqual:()=>M,isLength:()=>He,isNil:()=>$e,isNotNil:()=>Ge,isNull:()=>Xe,isPlainObject:()=>ct,isUndefined:()=>Ze,kebabCase:()=>tt,keyBy:()=>te,last:()=>Pe,lowerCase:()=>rt,max:()=>Tt,maxBy:()=>re,mean:()=>W,meanBy:()=>De,min:()=>dt,minBy:()=>ne,negate:()=>je,noop:()=>Re,omit:()=>Me,omitBy:()=>Be,once:()=>Ee,orderBy:()=>oe,partition:()=>ie,pick:()=>Ve,pickBy:()=>Ne,random:()=>P,randomInt:()=>A,range:()=>Fe,round:()=>Se,sample:()=>ue,sampleSize:()=>fe,set:()=>I,shuffle:()=>ae,snakeCase:()=>et,startCase:()=>nt,startsWith:()=>mt,sum:()=>d,sumBy:()=>Ie,tail:()=>ke,take:()=>le,takeRight:()=>se,takeRightWhile:()=>ce,takeWhile:()=>me,throttle:()=>Oe,toFilled:()=>we,union:()=>m,unionBy:()=>R,unionWith:()=>O,uniq:()=>U,uniqBy:()=>pe,uniqWith:()=>E,unzip:()=>Te,unzipWith:()=>de,withTimeout:()=>Je,without:()=>Ke,xor:()=>xe,xorBy:()=>ye,xorWith:()=>he,zip:()=>j,zipObject:()=>be,zipObjectDeep:()=>at,zipWith:()=>ge});function _(e,t){if(!Number.isInteger(t)||t<=0)throw new Error("Size must be an integer greater than zero.");let r=Math.ceil(e.length/t),n=Array(r);for(let o=0;o<r;o++){let i=o*t,u=i+t;n[o]=e.slice(i,u)}return n}function L(e){let t=[];for(let r of e)r&&t.push(r);return t}function q(e,t){var n;let r={};for(let o of e){let i=t(o);r[i]=((n=r[i])!=null?n:0)+1}return r}function h(e,t){let r=new Set(t);return e.filter(n=>!r.has(n))}function b(e,t,r){let n=new Set(t.map(o=>r(o)));return e.filter(o=>!n.has(r(o)))}function g(e,t,r){return e.filter(n=>t.every(o=>!r(n,o)))}function $(e,t){return t=Math.max(t,0),e.slice(t)}function G(e,t){return t=Math.min(-t,0),t===0?e.slice():e.slice(0,t)}function X(e,t){for(let r=e.length-1;r>=0;r--)if(!t(e[r]))return e.slice(0,r+1);return[]}function Z(e,t){let r=e.findIndex(n=>!t(n));return r===-1?[]:e.slice(r)}function H(e,t,r=0,n=e.length){let o=e.length,i=Math.max(r>=0?r:o+r,0),u=Math.min(n>=0?n:o+n,o);for(let f=i;f<u;f++)e[f]=t;return e}function l(e,t=1){let r=[],n=Math.floor(t),o=(i,u)=>{for(let f of i)Array.isArray(f)&&u<n?o(f,u+1):r.push(f)};return o(e,0),r}function Y(e,t,r=1){return l(e.map(n=>t(n)),r)}function J(e){return l(e,1/0)}function Q(e,t){for(let r=e.length-1;r>=0;r--){let n=e[r];t(n,r,e)}}function ee(e,t){let r={};for(let n of e){let o=t(n);r[o]==null&&(r[o]=[]),r[o].push(n)}return r}function K(e,t){let r=new Set(t);return e.filter(n=>r.has(n))}function k(e,t,r){let n=new Set(t.map(r));return e.filter(o=>n.has(r(o)))}function w(e,t,r){return e.filter(n=>t.some(o=>r(n,o)))}function te(e,t){let r={};for(let n of e){let o=t(n);r[o]=n}return r}function re(e,t){let r=e[0],n=-1/0;for(let o of e){let i=t(o);i>n&&(n=i,r=o)}return r}function ne(e,t){let r=e[0],n=1/0;for(let o of e){let i=t(o);i<n&&(n=i,r=o)}return r}function oe(e,t,r){let n=(i,u,f)=>i<u?f==="asc"?-1:1:i>u?f==="asc"?1:-1:0,o=t.map((i,u)=>r[u]||r[r.length-1]);return e.slice().sort((i,u)=>{for(let f=0;f<t.length;f++){let a=t[f],c=o[f],x=n(i[a],u[a],c);if(x!==0)return x}return 0})}function ie(e,t){let r=[],n=[];for(let o of e)t(o)?r.push(o):n.push(o);return[r,n]}function ue(e){let t=Math.floor(Math.random()*e.length);return e[t]}function P(e,t){if(t==null&&(t=e,e=0),e>=t)throw new Error("Invalid input: The maximum value must be greater than the minimum value.");return Math.random()*(t-e)+e}function A(e,t){return Math.floor(P(e,t))}function fe(e,t){if(t>e.length)throw new Error("Size must be less than or equal to the length of array.");let r=new Array(t),n=new Set;for(let o=e.length-t,i=0;o<e.length;o++,i++){let u=A(0,o+1);n.has(u)&&(u=o),n.add(u),r[i]=e[u]}return r}function ae(e){let t=e.slice();for(let r=t.length-1;r>=1;r--){let n=Math.floor(Math.random()*(r+1));[t[r],t[n]]=[t[n],t[r]]}return t}function le(e,t){return e.slice(0,t)}function se(e,t){return t===0?[]:e.slice(-t)}function ce(e,t){for(let r=e.length-1;r>=0;r--)if(!t(e[r]))return e.slice(r+1);return e.slice()}function me(e,t){let r=[];for(let n of e){if(!t(n))break;r.push(n)}return r}function U(e){return Array.from(new Set(e))}function m(e,t){return U(e.concat(t))}function R(e,t,r){let n=new Map;for(let o of[...e,...t]){let i=r(o);n.has(i)||n.set(i,o)}return Array.from(n.values())}function E(e,t){let r=[];for(let n of e)r.every(i=>!t(i,n))&&r.push(n);return r}function O(e,t,r){return E(e.concat(t),r)}function pe(e,t){let r=new Map;for(let n of e){let o=t(n);r.has(o)||r.set(o,n)}return Array.from(r.values())}function Te(e){let t=0;for(let n=0;n<e.length;n++)e[n].length>t&&(t=e[n].length);let r=new Array(t);for(let n=0;n<t;n++){r[n]=new Array(e.length);for(let o=0;o<e.length;o++)r[n][o]=e[o][n]}return r}function de(e,t){let r=Math.max(...e.map(o=>o.length)),n=new Array(r);for(let o=0;o<r;o++){let i=new Array(e.length);for(let u=0;u<e.length;u++)i[u]=e[u][o];n[o]=t(...i)}return n}function xe(e,t){return h(m(e,t),K(e,t))}function ye(e,t,r){let n=R(e,t,r),o=k(e,t,r);return b(n,o,r)}function he(e,t,r){let n=O(e,t,r),o=w(e,t,r);return g(n,o,r)}function j(...e){let t=[],r=Math.max(...e.map(n=>n.length));for(let n=0;n<r;n++){let o=[];for(let i of e)o.push(i[n]);t.push(o)}return t}function be(e,t){let r={};for(let n=0;n<e.length;n++)r[e[n]]=t[n];return r}function ge(e,...t){let r=[e,...t.slice(0,-1)],n=t[t.length-1],o=[],i=Math.max(...r.map(u=>u.length));for(let u=0;u<i;u++){let f=r.map(a=>a[u]);o.push(n(...f))}return o}function Ke(e,...t){let r=new Set(t);return e.filter(n=>!r.has(n))}function F(e){return e[0]}function ke(e){let t=e.length;if(t<=1)return[];let r=new Array(t-1);for(let n=1;n<t;n++)r[n-1]=e[n];return r}function we(e,t,r=0,n=e.length){let o=e.length,i=Math.max(r>=0?r:o+r,0),u=Math.min(n>=0?n:o+n,o),f=e.slice();for(let a=i;a<u;a++)f[a]=t;return f}function Pe(e){return e[e.length-1]}function Ae(e){return e.length<=1?[]:e.slice(0,-1)}var p=class extends Error{constructor(t="The operation was aborted"){super(t),this.name="AbortError"}};var T=class extends Error{constructor(t="The operation was timed out"){super(t),this.name="TimeoutError"}};function Ue(e,t,{signal:r}={}){let n=null,o=function(...u){n!==null&&clearTimeout(n),!(r!=null&&r.aborted)&&(n=setTimeout(()=>{e(...u),n=null},t))},i=function(){o.cancel()};return o.cancel=function(){n!==null&&(clearTimeout(n),n=null)},r==null||r.addEventListener("abort",i,{once:!0}),o}function Re(){}function Ee(e){let t=!1,r;return function(){if(t)return r;let n=e();return t=!0,r=n,n}}function Oe(e,t){let r;return function(...o){let i=Date.now();(r==null||i-r>=t)&&(r=i,e(...o))}}function je(e){return(...t)=>!e(...t)}function We(e,t,r){return r==null?Math.min(e,t):Math.min(Math.max(e,t),r)}function ve(e,t,r){if(r==null&&(r=t,t=0),t>=r)throw new Error("The maximum value must be greater than the minimum value.");return t<=e&&e<r}function d(e){let t=0;for(let r=0;r<e.length;r++)t+=e[r];return t}function W(e){return d(e)/e.length}function De(e,t){let r=e.map(n=>t(n));return W(r)}function Se(e,t=0){if(!Number.isInteger(t))throw new Error("Precision must be an integer.");let r=Math.pow(10,t);return Math.round(e*r)/r}function Ie(e,t){let r=e.map(n=>t(n));return d(r)}function Fe(e,t,r){if(t==null&&(t=e,e=0),r==null&&(r=1),!Number.isInteger(r)||r===0)throw new Error("The step value must be a non-zero integer.");let n=Math.max(Math.ceil((t-e)/r),0),o=new Array(n);for(let i=0;i<n;i++)o[i]=e+i*r;return o}function Me(e,t){let r=C({},e);for(let n of t)delete r[n];return r}function Be(e,t){let r={};for(let[n,o]of Object.entries(e))t(o,n)||(r[n]=o);return r}function Ve(e,t){let r={};for(let n of t)r[n]=e[n];return r}function Ne(e,t){let r={};for(let[n,o]of Object.entries(e))t(o,n)&&(r[n]=o);return r}function ze(e){let t={},r=Object.keys(e);for(let n=0;n<r.length;n++){let o=r[n],i=e[o];t[i]=o}return t}function Ce(e){if(bt(e))return e;if(Array.isArray(e))return e.slice();if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return new RegExp(e.source,e.flags);if(e instanceof Map){let t=new Map;for(let[r,n]of e)t.set(r,n);return t}if(e instanceof Set){let t=new Set;for(let r of e)t.add(r);return t}return typeof e=="object"?Object.assign({},e):e}function bt(e){return e==null||typeof e!="object"&&typeof e!="function"}function _e(e){if(typeof e!="object"||e==null)return!1;if(Object.getPrototypeOf(e)===null)return!0;if(e.toString()!=="[object Object]")return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function Le(e){return qe(e)}function qe(e,t=""){let r={},n=Object.keys(e);for(let o=0;o<n.length;o++){let i=n[o],u=e[i],f=t?`${t}.${i}`:i;if(_e(u)&&Object.keys(u).length>0){Object.assign(r,qe(u,f));continue}if(Array.isArray(u)){for(let a=0;a<u.length;a++)r[`${f}.${a}`]=u[a];continue}r[f]=u}return r}function M(e,t){if(Object.is(e,t))return!0;if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(e instanceof RegExp&&t instanceof RegExp)return e.source===t.source&&e.flags===t.flags;if(typeof e!="object"||typeof t!="object"||e===null||t===null)return!1;let r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length||m(r,n).length!==r.length)return!1;for(let o=0;o<r.length;o++){let i=r[o],u=e[i],f=t[i];if(!M(u,f))return!1}return!0}function $e(e){return e==null}function Ge(e){return e!=null}function Xe(e){return e===null}function Ze(e){return e===void 0}function He(e){return typeof e=="number"&&e>-1&&e%1===0&&e<=Number.MAX_SAFE_INTEGER}function v(e,{signal:t}={}){return new Promise((r,n)=>{let o=()=>{n(new p)},i=()=>{clearTimeout(u),o()};if(t!=null&&t.aborted)return o();let u=setTimeout(r,e);t==null||t.addEventListener("abort",i,{once:!0})})}function Ye(e){return y(this,null,function*(){throw yield v(e),new T})}function Je(e,t){return y(this,null,function*(){return Promise.race([e(),Ye(t)])})}var D=e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase();var gt=/[A-Z]?[a-z]+|[0-9]+|[A-Z]+(?![a-z])/g;function s(e){var t;return Array.from((t=e.match(gt))!=null?t:[])}function Qe(e){let t=s(e);if(t.length===0)return"";let[r,...n]=t;return`${r.toLowerCase()}${n.map(o=>D(o)).join("")}`}var et=e=>s(e).map(r=>r.toLowerCase()).join("_");var tt=e=>s(e).map(r=>r.toLowerCase()).join("-");var rt=e=>s(e).map(r=>r.toLowerCase()).join(" ");function nt(e){let t=s(e.trim()),r="";for(let n of t)r&&(r+=" "),n===n.toUpperCase()?r+=n:r+=n[0].toUpperCase()+n.slice(1).toLowerCase();return r}function ot(e,t=1){return t=Math.max(Math.floor(t),0),t===0?[]:_(e,t)}function it(...e){return l(e)}function ut(e,...t){let r=e,n=l(t);return h(r,n)}var Kt=/^(?:0|[1-9]\d*)$/;function ft(e){switch(typeof e){case"number":return Number.isInteger(e)&&e>=0&&e<Number.MAX_SAFE_INTEGER;case"symbol":return!1;case"string":return Kt.test(e)}}function S(e){let t=/\\(\\)?/g,r=RegExp(`[^.[\\]]+|\\[(?:([^"'][^[]*)|(["'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))`,"g"),n=[];e[0]==="."&&n.push("");let o,i=0,u=0;for(;(o=r.exec(e))!==null;){let[f,a,c,x]=o;c?f=x.replace(t,"$1"):a&&(f=a),n.push(f),r.lastIndex===i?r.lastIndex++:i=r.lastIndex}return n}function I(e,t,r){let n=Array.isArray(t)?t:typeof t=="string"?S(t):[t],o=e;for(let u=0;u<n.length-1;u++){let f=n[u],a=n[u+1];o[f]==null&&(o[f]=ft(a)?[]:{}),o=o[f]}let i=n[n.length-1];return o[i]=r,e}function at(e,t){let r={},n=j(e,t);for(let o=0;o<n.length;o++){let[i,u]=n[o];i!=null&&I(r,i,u)}return r}var kt=/^\w*$/,wt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/;function lt(e){switch(typeof e){case"number":case"symbol":return!1;case"string":return!kt.test(e)&&wt.test(e)}}function st(e,t,r){let n;if(Array.isArray(t)?n=t:typeof t=="string"&&lt(t)&&(e==null?void 0:e[t])==null?n=S(t):n=[t],n.length===0)return r;let o=e,i;for(i=0;i<n.length&&o!=null;i++){let u=n[i];Object.is(u.valueOf(),-0)&&(u="-0"),o=o[u]}return o===null&&i===n.length||o!=null?o:r}function ct(e){var r;if(typeof e!="object"||e==null)return!1;if(Object.getPrototypeOf(e)===null)return!0;if(e.toString()!=="[object Object]"){let n=e[Symbol.toStringTag];return n==null||!((r=Object.getOwnPropertyDescriptor(e,Symbol.toStringTag))!=null&&r.writable)?!1:e.toString()===`[object ${n}]`}let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}var mt=(e,t,r=0)=>e.startsWith(t,r);var pt=(e,t,r=e.length)=>e.endsWith(t,r);function Tt(e=[]){let t=e[0],r;for(let n of e)(r==null||n>r)&&(r=n,t=n);return t}function dt(e=[]){let t=e[0],r;for(let n of e)(r==null||n<r)&&(r=n,t=n);return t}window._=B;})();
1
+ "use strict";(()=>{var z=Object.defineProperty;var V=Object.getOwnPropertySymbols;var xt=Object.prototype.hasOwnProperty,yt=Object.prototype.propertyIsEnumerable;var N=(e,t,r)=>t in e?z(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,C=(e,t)=>{for(var r in t||(t={}))xt.call(t,r)&&N(e,r,t[r]);if(V)for(var r of V(t))yt.call(t,r)&&N(e,r,t[r]);return e};var ht=(e,t)=>{for(var r in t)z(e,r,{get:t[r],enumerable:!0})};var y=(e,t,r)=>new Promise((n,o)=>{var i=a=>{try{f(r.next(a))}catch(c){o(c)}},u=a=>{try{f(r.throw(a))}catch(c){o(c)}},f=a=>a.done?n(a.value):Promise.resolve(a.value).then(i,u);f((r=r.apply(e,t)).next())});var B={};ht(B,{AbortError:()=>p,TimeoutError:()=>T,camelCase:()=>Qe,capitalize:()=>D,chunk:()=>ot,clamp:()=>We,clone:()=>Ce,compact:()=>L,concat:()=>it,countBy:()=>q,debounce:()=>Ue,delay:()=>v,difference:()=>ut,differenceBy:()=>b,differenceWith:()=>g,drop:()=>$,dropRight:()=>G,dropRightWhile:()=>X,dropWhile:()=>Z,endsWith:()=>pt,fill:()=>H,first:()=>F,flatMap:()=>Y,flatten:()=>l,flattenDeep:()=>J,flattenObject:()=>Le,forEachRight:()=>Q,get:()=>st,groupBy:()=>ee,head:()=>F,inRange:()=>ve,initial:()=>Ae,intersection:()=>K,intersectionBy:()=>k,intersectionWith:()=>w,invert:()=>ze,isEqual:()=>M,isLength:()=>He,isNil:()=>$e,isNotNil:()=>Ge,isNull:()=>Xe,isPlainObject:()=>ct,isUndefined:()=>Ze,kebabCase:()=>tt,keyBy:()=>te,last:()=>Pe,lowerCase:()=>rt,max:()=>Tt,maxBy:()=>re,mean:()=>W,meanBy:()=>De,min:()=>dt,minBy:()=>ne,negate:()=>je,noop:()=>Re,omit:()=>Me,omitBy:()=>Be,once:()=>Ee,orderBy:()=>oe,partition:()=>ie,pick:()=>Ve,pickBy:()=>Ne,random:()=>P,randomInt:()=>A,range:()=>Fe,round:()=>Se,sample:()=>ue,sampleSize:()=>fe,set:()=>I,shuffle:()=>ae,snakeCase:()=>et,startCase:()=>nt,startsWith:()=>mt,sum:()=>d,sumBy:()=>Ie,tail:()=>ke,take:()=>le,takeRight:()=>se,takeRightWhile:()=>ce,takeWhile:()=>me,throttle:()=>Oe,toFilled:()=>we,union:()=>m,unionBy:()=>R,unionWith:()=>O,uniq:()=>U,uniqBy:()=>pe,uniqWith:()=>E,unzip:()=>Te,unzipWith:()=>de,withTimeout:()=>Je,without:()=>Ke,xor:()=>xe,xorBy:()=>ye,xorWith:()=>he,zip:()=>j,zipObject:()=>be,zipObjectDeep:()=>at,zipWith:()=>ge});function _(e,t){if(!Number.isInteger(t)||t<=0)throw new Error("Size must be an integer greater than zero.");let r=Math.ceil(e.length/t),n=Array(r);for(let o=0;o<r;o++){let i=o*t,u=i+t;n[o]=e.slice(i,u)}return n}function L(e){let t=[];for(let r of e)r&&t.push(r);return t}function q(e,t){var n;let r={};for(let o of e){let i=t(o);r[i]=((n=r[i])!=null?n:0)+1}return r}function h(e,t){let r=new Set(t);return e.filter(n=>!r.has(n))}function b(e,t,r){let n=new Set(t.map(o=>r(o)));return e.filter(o=>!n.has(r(o)))}function g(e,t,r){return e.filter(n=>t.every(o=>!r(n,o)))}function $(e,t){return t=Math.max(t,0),e.slice(t)}function G(e,t){return t=Math.min(-t,0),t===0?e.slice():e.slice(0,t)}function X(e,t){for(let r=e.length-1;r>=0;r--)if(!t(e[r]))return e.slice(0,r+1);return[]}function Z(e,t){let r=e.findIndex(n=>!t(n));return r===-1?[]:e.slice(r)}function H(e,t,r=0,n=e.length){let o=e.length,i=Math.max(r>=0?r:o+r,0),u=Math.min(n>=0?n:o+n,o);for(let f=i;f<u;f++)e[f]=t;return e}function l(e,t=1){let r=[],n=Math.floor(t),o=(i,u)=>{for(let f of i)Array.isArray(f)&&u<n?o(f,u+1):r.push(f)};return o(e,0),r}function Y(e,t,r=1){return l(e.map(n=>t(n)),r)}function J(e){return l(e,1/0)}function Q(e,t){for(let r=e.length-1;r>=0;r--){let n=e[r];t(n,r,e)}}function ee(e,t){let r={};for(let n of e){let o=t(n);r[o]==null&&(r[o]=[]),r[o].push(n)}return r}function K(e,t){let r=new Set(t);return e.filter(n=>r.has(n))}function k(e,t,r){let n=new Set(t.map(r));return e.filter(o=>n.has(r(o)))}function w(e,t,r){return e.filter(n=>t.some(o=>r(n,o)))}function te(e,t){let r={};for(let n of e){let o=t(n);r[o]=n}return r}function re(e,t){let r=e[0],n=-1/0;for(let o of e){let i=t(o);i>n&&(n=i,r=o)}return r}function ne(e,t){let r=e[0],n=1/0;for(let o of e){let i=t(o);i<n&&(n=i,r=o)}return r}function oe(e,t,r){let n=(i,u,f)=>i<u?f==="asc"?-1:1:i>u?f==="asc"?1:-1:0,o=t.map((i,u)=>r[u]||r[r.length-1]);return e.slice().sort((i,u)=>{for(let f=0;f<t.length;f++){let a=t[f],c=o[f],x=n(i[a],u[a],c);if(x!==0)return x}return 0})}function ie(e,t){let r=[],n=[];for(let o of e)t(o)?r.push(o):n.push(o);return[r,n]}function ue(e){let t=Math.floor(Math.random()*e.length);return e[t]}function P(e,t){if(t==null&&(t=e,e=0),e>=t)throw new Error("Invalid input: The maximum value must be greater than the minimum value.");return Math.random()*(t-e)+e}function A(e,t){return Math.floor(P(e,t))}function fe(e,t){if(t>e.length)throw new Error("Size must be less than or equal to the length of array.");let r=new Array(t),n=new Set;for(let o=e.length-t,i=0;o<e.length;o++,i++){let u=A(0,o+1);n.has(u)&&(u=o),n.add(u),r[i]=e[u]}return r}function ae(e){let t=e.slice();for(let r=t.length-1;r>=1;r--){let n=Math.floor(Math.random()*(r+1));[t[r],t[n]]=[t[n],t[r]]}return t}function le(e,t){return e.slice(0,t)}function se(e,t){return t===0?[]:e.slice(-t)}function ce(e,t){for(let r=e.length-1;r>=0;r--)if(!t(e[r]))return e.slice(r+1);return e.slice()}function me(e,t){let r=[];for(let n of e){if(!t(n))break;r.push(n)}return r}function U(e){return Array.from(new Set(e))}function m(e,t){return U(e.concat(t))}function R(e,t,r){let n=new Map;for(let o of[...e,...t]){let i=r(o);n.has(i)||n.set(i,o)}return Array.from(n.values())}function E(e,t){let r=[];for(let n of e)r.every(i=>!t(i,n))&&r.push(n);return r}function O(e,t,r){return E(e.concat(t),r)}function pe(e,t){let r=new Map;for(let n of e){let o=t(n);r.has(o)||r.set(o,n)}return Array.from(r.values())}function Te(e){let t=0;for(let n=0;n<e.length;n++)e[n].length>t&&(t=e[n].length);let r=new Array(t);for(let n=0;n<t;n++){r[n]=new Array(e.length);for(let o=0;o<e.length;o++)r[n][o]=e[o][n]}return r}function de(e,t){let r=Math.max(...e.map(o=>o.length)),n=new Array(r);for(let o=0;o<r;o++){let i=new Array(e.length);for(let u=0;u<e.length;u++)i[u]=e[u][o];n[o]=t(...i)}return n}function xe(e,t){return h(m(e,t),K(e,t))}function ye(e,t,r){let n=R(e,t,r),o=k(e,t,r);return b(n,o,r)}function he(e,t,r){let n=O(e,t,r),o=w(e,t,r);return g(n,o,r)}function j(...e){let t=[],r=Math.max(...e.map(n=>n.length));for(let n=0;n<r;n++){let o=[];for(let i of e)o.push(i[n]);t.push(o)}return t}function be(e,t){let r={};for(let n=0;n<e.length;n++)r[e[n]]=t[n];return r}function ge(e,...t){let r=[e,...t.slice(0,-1)],n=t[t.length-1],o=[],i=Math.max(...r.map(u=>u.length));for(let u=0;u<i;u++){let f=r.map(a=>a[u]);o.push(n(...f))}return o}function Ke(e,...t){let r=new Set(t);return e.filter(n=>!r.has(n))}function F(e){return e[0]}function ke(e){let t=e.length;if(t<=1)return[];let r=new Array(t-1);for(let n=1;n<t;n++)r[n-1]=e[n];return r}function we(e,t,r=0,n=e.length){let o=e.length,i=Math.max(r>=0?r:o+r,0),u=Math.min(n>=0?n:o+n,o),f=e.slice();for(let a=i;a<u;a++)f[a]=t;return f}function Pe(e){return e[e.length-1]}function Ae(e){return e.length<=1?[]:e.slice(0,-1)}var p=class extends Error{constructor(t="The operation was aborted"){super(t),this.name="AbortError"}};var T=class extends Error{constructor(t="The operation was timed out"){super(t),this.name="TimeoutError"}};function Ue(e,t,{signal:r}={}){let n=null,o=function(...u){n!==null&&clearTimeout(n),!(r!=null&&r.aborted)&&(n=setTimeout(()=>{e(...u),n=null},t))},i=function(){o.cancel()};return o.cancel=function(){n!==null&&(clearTimeout(n),n=null)},r==null||r.addEventListener("abort",i,{once:!0}),o}function Re(){}function Ee(e){let t=!1,r;return function(){if(t)return r;let n=e();return t=!0,r=n,n}}function Oe(e,t){let r;return function(...o){let i=Date.now();(r==null||i-r>=t)&&(r=i,e(...o))}}function je(e){return(...t)=>!e(...t)}function We(e,t,r){return r==null?Math.min(e,t):Math.min(Math.max(e,t),r)}function ve(e,t,r){if(r==null&&(r=t,t=0),t>=r)throw new Error("The maximum value must be greater than the minimum value.");return t<=e&&e<r}function d(e){let t=0;for(let r=0;r<e.length;r++)t+=e[r];return t}function W(e){return d(e)/e.length}function De(e,t){let r=e.map(n=>t(n));return W(r)}function Se(e,t=0){if(!Number.isInteger(t))throw new Error("Precision must be an integer.");let r=Math.pow(10,t);return Math.round(e*r)/r}function Ie(e,t){let r=e.map(n=>t(n));return d(r)}function Fe(e,t,r){if(t==null&&(t=e,e=0),r==null&&(r=1),!Number.isInteger(r)||r===0)throw new Error("The step value must be a non-zero integer.");let n=Math.max(Math.ceil((t-e)/r),0),o=new Array(n);for(let i=0;i<n;i++)o[i]=e+i*r;return o}function Me(e,t){let r=C({},e);for(let n of t)delete r[n];return r}function Be(e,t){let r={};for(let[n,o]of Object.entries(e))t(o,n)||(r[n]=o);return r}function Ve(e,t){let r={};for(let n of t)r[n]=e[n];return r}function Ne(e,t){let r={};for(let[n,o]of Object.entries(e))t(o,n)&&(r[n]=o);return r}function ze(e){let t={},r=Object.keys(e);for(let n=0;n<r.length;n++){let o=r[n],i=e[o];t[i]=o}return t}function Ce(e){if(bt(e))return e;if(Array.isArray(e))return e.slice();if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return new RegExp(e.source,e.flags);if(e instanceof Map){let t=new Map;for(let[r,n]of e)t.set(r,n);return t}if(e instanceof Set){let t=new Set;for(let r of e)t.add(r);return t}if(typeof e=="object"){let t=Object.getPrototypeOf(e),r=Object.create(t);return Object.assign(r,e)}return e}function bt(e){return e==null||typeof e!="object"&&typeof e!="function"}function _e(e){if(typeof e!="object"||e==null)return!1;if(Object.getPrototypeOf(e)===null)return!0;if(e.toString()!=="[object Object]")return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function Le(e){return qe(e)}function qe(e,t=""){let r={},n=Object.keys(e);for(let o=0;o<n.length;o++){let i=n[o],u=e[i],f=t?`${t}.${i}`:i;if(_e(u)&&Object.keys(u).length>0){Object.assign(r,qe(u,f));continue}if(Array.isArray(u)){for(let a=0;a<u.length;a++)r[`${f}.${a}`]=u[a];continue}r[f]=u}return r}function M(e,t){if(Object.is(e,t))return!0;if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(e instanceof RegExp&&t instanceof RegExp)return e.source===t.source&&e.flags===t.flags;if(typeof e!="object"||typeof t!="object"||e===null||t===null)return!1;let r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length||m(r,n).length!==r.length)return!1;for(let o=0;o<r.length;o++){let i=r[o],u=e[i],f=t[i];if(!M(u,f))return!1}return!0}function $e(e){return e==null}function Ge(e){return e!=null}function Xe(e){return e===null}function Ze(e){return e===void 0}function He(e){return typeof e=="number"&&e>-1&&e%1===0&&e<=Number.MAX_SAFE_INTEGER}function v(e,{signal:t}={}){return new Promise((r,n)=>{let o=()=>{n(new p)},i=()=>{clearTimeout(u),o()};if(t!=null&&t.aborted)return o();let u=setTimeout(r,e);t==null||t.addEventListener("abort",i,{once:!0})})}function Ye(e){return y(this,null,function*(){throw yield v(e),new T})}function Je(e,t){return y(this,null,function*(){return Promise.race([e(),Ye(t)])})}var D=e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase();var gt=/[A-Z]?[a-z]+|[0-9]+|[A-Z]+(?![a-z])/g;function s(e){var t;return Array.from((t=e.match(gt))!=null?t:[])}function Qe(e){let t=s(e);if(t.length===0)return"";let[r,...n]=t;return`${r.toLowerCase()}${n.map(o=>D(o)).join("")}`}var et=e=>s(e).map(r=>r.toLowerCase()).join("_");var tt=e=>s(e).map(r=>r.toLowerCase()).join("-");var rt=e=>s(e).map(r=>r.toLowerCase()).join(" ");function nt(e){let t=s(e.trim()),r="";for(let n of t)r&&(r+=" "),n===n.toUpperCase()?r+=n:r+=n[0].toUpperCase()+n.slice(1).toLowerCase();return r}function ot(e,t=1){return t=Math.max(Math.floor(t),0),t===0?[]:_(e,t)}function it(...e){return l(e)}function ut(e,...t){let r=e,n=l(t);return h(r,n)}var Kt=/^(?:0|[1-9]\d*)$/;function ft(e){switch(typeof e){case"number":return Number.isInteger(e)&&e>=0&&e<Number.MAX_SAFE_INTEGER;case"symbol":return!1;case"string":return Kt.test(e)}}function S(e){let t=/\\(\\)?/g,r=RegExp(`[^.[\\]]+|\\[(?:([^"'][^[]*)|(["'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))`,"g"),n=[];e[0]==="."&&n.push("");let o,i=0,u=0;for(;(o=r.exec(e))!==null;){let[f,a,c,x]=o;c?f=x.replace(t,"$1"):a&&(f=a),n.push(f),r.lastIndex===i?r.lastIndex++:i=r.lastIndex}return n}function I(e,t,r){let n=Array.isArray(t)?t:typeof t=="string"?S(t):[t],o=e;for(let u=0;u<n.length-1;u++){let f=n[u],a=n[u+1];o[f]==null&&(o[f]=ft(a)?[]:{}),o=o[f]}let i=n[n.length-1];return o[i]=r,e}function at(e,t){let r={},n=j(e,t);for(let o=0;o<n.length;o++){let[i,u]=n[o];i!=null&&I(r,i,u)}return r}var kt=/^\w*$/,wt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/;function lt(e){switch(typeof e){case"number":case"symbol":return!1;case"string":return!kt.test(e)&&wt.test(e)}}function st(e,t,r){let n;if(Array.isArray(t)?n=t:typeof t=="string"&&lt(t)&&(e==null?void 0:e[t])==null?n=S(t):n=[t],n.length===0)return r;let o=e,i;for(i=0;i<n.length&&o!=null;i++){let u=n[i];Object.is(u.valueOf(),-0)&&(u="-0"),o=o[u]}return o===null&&i===n.length||o!=null?o:r}function ct(e){var r;if(typeof e!="object"||e==null)return!1;if(Object.getPrototypeOf(e)===null)return!0;if(e.toString()!=="[object Object]"){let n=e[Symbol.toStringTag];return n==null||!((r=Object.getOwnPropertyDescriptor(e,Symbol.toStringTag))!=null&&r.writable)?!1:e.toString()===`[object ${n}]`}let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}var mt=(e,t,r=0)=>e.startsWith(t,r);var pt=(e,t,r=e.length)=>e.endsWith(t,r);function Tt(e=[]){let t=e[0],r;for(let n of e)(r==null||n>r)&&(r=n,t=n);return t}function dt(e=[]){let t=e[0],r;for(let n of e)(r==null||n<r)&&(r=n,t=n);return t}window._=B;})();
2
2
  //# sourceMappingURL=browser.global.js.map