var _=function(e){"use strict";function at(e,t){const r=new Array(t.length),n=e.length;for(let i=0;i!r.has(e)))}function differenceBy$1(e,t,r){const n=new Set(t.map((e=>r(e))));return e.filter((e=>!n.has(r(e))))}function differenceWith(e,t,r){return e.filter((e=>t.every((t=>!r(e,t)))))}function dropRightWhile$1(e,t){for(let r=e.length-1;r>=0;r--)if(!t(e[r],r,e))return e.slice(0,r+1);return[]}function dropWhile$1(e,t){const r=e.findIndex(((e,r,n)=>!t(e,r,n)));return-1===r?[]:e.slice(r)}function flatten$1(e,t=1){const r=[],n=Math.floor(t),recursive=(e,t)=>{for(let i=0;ir.has(e)))}function intersectionBy$1(e,t,r){const n=new Set(t.map(r));return e.filter((e=>n.has(r(e))))}function intersectionWith(e,t,r){return e.filter((e=>t.some((t=>r(e,t)))))}function last$1(e){return e[e.length-1]}function sample$1(e){return e[Math.floor(Math.random()*e.length)]}function random$1(e,t){if(null==t){t=e;e=0}if(e>=t)throw new Error("Invalid input: The maximum value must be greater than the minimum value.");return Math.random()*(t-e)+e}function randomInt(e,t){return Math.floor(random$1(e,t))}function uniq$1(e){return Array.from(new Set(e))}function uniqBy$1(e,t){const r=new Map;for(let n=0;n!t(e,i)))&&r.push(i)}return r}function unionWith(e,t,r){return uniqWith(e.concat(t),r)}function unzip$1(e){let t=0;for(let r=0;rt&&(t=e[r].length);const r=new Array(t);for(let n=0;nt&&(t=e[r].length);const r=e.length,n=Array(t);for(let i=0;i{if(++r>=e)return t(...n)}}function ary$1(e,t){return function(...r){return e.apply(this,r.slice(0,t))}}function debounce$1(e,t,{signal:r,edges:n}={}){let i,o=null;const u=null!=n&&n.includes("leading"),c=null==n||n.includes("trailing"),invoke=()=>{if(null!==o){e.apply(i,o);i=void 0;o=null}};let s=null;const schedule=()=>{null!=s&&clearTimeout(s);s=setTimeout((()=>{s=null;(()=>{c&&invoke();cancel()})()}),t)},cancelTimer=()=>{if(null!==s){clearTimeout(s);s=null}},cancel=()=>{cancelTimer();i=void 0;o=null},debounced=function(...e){if(r?.aborted)return;i=this;o=e;const t=null==s;schedule();u&&t&&invoke()};debounced.schedule=schedule;debounced.cancel=cancel;debounced.flush=()=>{cancelTimer();invoke()};r?.addEventListener("abort",cancel,{once:!0});return debounced}function flow$1(...e){return function(...t){let r=e.length?e[0].apply(this,t):t[0];for(let t=1;te===r)).length,o=Math.max(n.length-i,0),u=[];let c=0;for(let e=0;ee-t)),r=Math.floor(t.length/2);return t.length%2==0?(t[r-1]+t[r])/2:t[r]}function range(e,t,r=1){if(null==t){t=e;e=0}if(!Number.isInteger(r)||0===r)throw new Error("The step value must be a non-zero integer.");const n=Math.max(Math.ceil((t-e)/r),0),i=new Array(n);for(let t=0;tObject.prototype.propertyIsEnumerable.call(e,t)))}function cloneDeep$1(e){return cloneDeepImpl(e)}function cloneDeepImpl(e,t=new Map){if(isPrimitive(e))return e;if(t.has(e))return t.get(e);if(Array.isArray(e)){const r=new Array(e.length);t.set(e,r);for(let n=0;n0)Object.assign(r,flattenObjectImpl(u,c));else if(Array.isArray(u))for(let e=0;eisEqualWithImpl(u,n,void 0,e,t,r,M)));if(-1===c)return!1;i.splice(c,1)}return!0}case p:case d:case A:case j:case O:case w:case $:case S:case k:case N:case E:case v:if("undefined"!=typeof Buffer&&Buffer.isBuffer(e)!==Buffer.isBuffer(t))return!1;if(e.length!==t.length)return!1;for(let n=0;nisJSONValue(e)))}function isJSONObject(e){if(!isPlainObject$1(e))return!1;const t=Reflect.ownKeys(e);for(let r=0;r=0}function isNil$1(e){return null==e}function delay(e,{signal:t}={}){return new Promise(((r,n)=>{const abortError=()=>{n(new AbortError)},abortHandler=()=>{clearTimeout(i);abortError()};if(t?.aborted)return abortError();const i=setTimeout((()=>{t?.removeEventListener("abort",abortHandler);r()}),e);t?.addEventListener("abort",abortHandler,{once:!0})}))}async function timeout(e){await delay(e);throw new TimeoutError}function capitalize(e){return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}const M=/\p{Lu}?\p{Ll}+|[0-9]+|\p{Lu}+(?!\p{Ll})|\p{Emoji_Presentation}|\p{Extended_Pictographic}|\p{L}+/gu;function words(e){return Array.from(e.match(M)??[])}const I=new Map(Object.entries({Æ:"Ae",Ð:"D",Ø:"O",Þ:"Th",ß:"ss",æ:"ae",ð:"d",ø:"o",þ:"th",Đ:"D",đ:"d",Ħ:"H",ħ:"h",ı:"i",IJ:"IJ",ij:"ij",ĸ:"k",Ŀ:"L",ŀ:"l",Ł:"L",ł:"l",ʼn:"'n",Ŋ:"N",ŋ:"n",Œ:"Oe",œ:"oe",Ŧ:"T",ŧ:"t",ſ:"s"}));const B={"&":"&","<":"<",">":">",'"':""","'":"'"};function trimEnd$1(e,t){if(void 0===t)return e.trimEnd();let r=e.length;switch(typeof t){case"string":for(;r>0&&e[r-1]===t;)r--;break;case"object":for(;r>0&&t.includes(e[r-1]);)r--}return e.substring(0,r)}function trimStart$1(e,t){if(void 0===t)return e.trimStart();let r=0;switch(typeof t){case"string":for(;r",""":'"',"'":"'"};function toArray(e){return Array.isArray(e)?e:Array.from(e)}function isArrayLike(e){return null!=e&&"function"!=typeof e&&isLength(e.length)}function isArrayLikeObject(e){return isObjectLike(e)&&isArrayLike(e)}function last(e){if(isArrayLike(e))return last$1(toArray(e))}function isDeepKey(e){switch(typeof e){case"number":case"symbol":return!1;case"string":return e.includes(".")||e.includes("[")||e.includes("]")}}function toKey(e){return Object.is(e,-0)?"-0":e.toString()}function toPath(e){const t=[],r=e.length;if(0===r)return t;let n=0,i="",o="",u=!1;if(46===e.charCodeAt(0)){t.push("");n++}for(;n0&&isMatch(e,{...t});default:return isObject(e)?!t:eq(e,t)}}function isArrayMatch(e,t){if(0===t.length)return!0;if(!Array.isArray(e))return!1;const r=new Set;for(let n=0;nisMatch(e,i)&&!r.has(t)));if(-1===o)return!1;r.add(o)}return!0}function matches(e){e=cloneDeep$1(e);return t=>isMatch(t,e)}function cloneDeep(e){if("object"!=typeof e)return cloneDeep$1(e);switch(Object.prototype.toString.call(e)){case o:case i:case u:{const t=new e.constructor(e?.valueOf());copyProperties(t,e);return t}case c:{const t={};copyProperties(t,e);t.length=e.length;t[Symbol.iterator]=e[Symbol.iterator];return t}default:return cloneDeep$1(e)}}const W=/^(?:0|[1-9]\d*)$/;function isIndex(e){switch(typeof e){case"number":return Number.isInteger(e)&&e>=0&&e{for(let i=0;i{if(e!==t){if("string"==typeof e&&"string"==typeof t)return"desc"===r?t.localeCompare(e):e.localeCompare(t);const n=getPriority(e),i=getPriority(t);if(n===i&&0===n){if(et)return"desc"===r?-1:1}return"desc"===r?i-n:n-i}return 0},x=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,P=/^\w*$/;function orderBy(e,t,r,n){if(null==e)return[];r=n?void 0:r;Array.isArray(e)||(e=Object.values(e));Array.isArray(t)||(t=null==t?[null]:[t]);0===t.length&&(t=[null]);Array.isArray(r)||(r=null==r?[]:[r]);r=r.map((e=>String(e)));const getValueByNestedPath=(e,t)=>{let r=e;for(let e=0;e{Array.isArray(e)&&1===e.length&&(e=e[0]);return null==e||"function"==typeof e||Array.isArray(e)||function isKey(e,t){return!Array.isArray(e)&&(!("number"!=typeof e&&"boolean"!=typeof e&&null!=e&&!isSymbol(e))||"string"==typeof e&&(P.test(e)||!x.test(e))||null!=t)}(e)?e:{key:e,path:toPath(e)}}));return e.map((e=>({original:e,criteria:i.map((t=>((e,t)=>null==t||null==e?t:"object"==typeof e&&"key"in e?Object.hasOwn(t,e.key)?t[e.key]:getValueByNestedPath(t,e.path):"function"==typeof e?e(t):Array.isArray(e)?getValueByNestedPath(t,e):"object"==typeof t?t[e]:t)(t,e)))}))).slice().sort(((e,t)=>{for(let n=0;ne.original))}function set(e,t,r){const n=Array.isArray(t)?t:"string"==typeof t?toPath(t):[t];let i=e;for(let e=0;ee===curry.placeholder)),i=r.length-n.length;return ie===curry.placeholder)),o=n.length-i.length;n=function composeArgs$1(e,t){const r=[];let n=0;for(let i=0;ie===curryRight.placeholder)),i=r.length-n.length;return ie===curryRight.placeholder)),o=n.length-i.length;n=function composeArgs(e,t){const r=t.filter((e=>e===curryRight.placeholder)).length,n=Math.max(e.length-r,0),i=[];let o=0;for(let t=0;t=u){s=e.apply(this,t);a=Date.now();l.cancel();l.schedule();return s}l.apply(this,t);return s};debounced.cancel=l.cancel;debounced.flush=()=>{l.flush();return s};return debounced}function decimalAdjust(e,t,r=0){t=Number(t);Object.is(t,-0)&&(t="-0");if(r=Math.min(Number.parseInt(r,10),292)){const[n,i=0]=t.toString().split("e");let o=Math[e](Number(`${n}e${Number(i)+r}`));Object.is(o,-0)&&(o="-0");const[u,c=0]=o.toString().split("e");return Number(`${u}e${Number(c)-r}`)}return Math[e](Number(t))}function clamp(e,t,r){Number.isNaN(t)&&(t=0);Number.isNaN(r)&&(r=0);return function clamp$1(e,t,r){return null==r?Math.min(e,t):Math.min(Math.max(e,t),r)}(e,t,r)}function sumBy(e,t){if(!e||!e.length)return 0;null!=t&&(t=iteratee(t));let r=t?t(e[0]):e[0];for(let n=1;n"']/g,(e=>B[e]))}(toString(e))}const q=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,z=/['\n\r\u2028\u2029\\]/g,F=/($^)/,K=new Map([["\\","\\"],["'","'"],["\n","n"],["\r","r"],["\u2028","u2028"],["\u2029","u2029"]]);function escapeString(e){return`\\${K.get(e)}`}const U={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:"",imports:{_:{escape,template}}};function template(e,t,r){e=toString(e);r&&(t=U);t=defaults({...t},U);const n=new RegExp([t.escape?.source??F.source,t.interpolate?.source??F.source,t.interpolate?q.source:F.source,t.evaluate?.source??F.source,"$"].join("|"),"g");let i=0,o=!1,u="__p += ''";for(const t of e.matchAll(n)){const[r,n,c,s,a]=t,{index:l}=t;u+=` + '${e.slice(i,l).replace(z,escapeString)}'`;n&&(u+=` + _.escape(${n})`);c?u+=` + ((${c}) == null ? '' : ${c})`:s&&(u+=` + ((${s}) == null ? '' : ${s})`);if(a){u+=`;\n${a};\n __p += ''`;o=!0}i=l+r.length}const c=defaults({...t.imports},U.imports),s=Object.keys(c),a=Object.values(c),l=`//# sourceURL=${t.sourceURL?String(t.sourceURL).replace(/[\r\n]/g," "):`es-toolkit.templateSource[${Date.now()}]`}\n`,f=`function(${t.variable||"obj"}) {\n let __p = '';\n ${t.variable?"":"if (obj == null) { obj = {}; }"}\n ${o?"function print() { __p += Array.prototype.join.call(arguments, ''); }":""}\n ${t.variable?u:`with(obj) {\n${u}\n}`}\n return __p;\n }`,p=attempt((()=>new Function(...s,`${l}return ${f}`)(...a)));p.source=f;if(p instanceof Error)throw p;return p}const V=Number.MAX_SAFE_INTEGER;let J=0;e.AbortError=AbortError;e.TimeoutError=TimeoutError;e.after=after;e.ary=function ary(e,t=e.length,r){r&&(t=e.length);(Number.isNaN(t)||t<0)&&(t=0);return ary$1(e,t)};e.at=at;e.attempt=attempt;e.before=function before(e,t){if("function"!=typeof t)throw new TypeError("Expected a function");let r;e=toInteger(e);return function(...n){--e>0&&(r=t.apply(this,n));e<=1&&t&&(t=void 0);return r}};e.bind=bind;e.bindKey=bindKey;e.camelCase=function camelCase(e){return function camelCase$1(e){const t=words(e);if(0===t.length)return"";const[r,...n]=t;return`${r.toLowerCase()}${n.map((e=>capitalize(e))).join("")}`}(normalizeForCase(e))};e.capitalize=capitalize;e.castArray=function castArray(e){return 0===arguments.length?[]:Array.isArray(e)?e:[e]};e.ceil=function ceil(e,t=0){return decimalAdjust("ceil",e,t)};e.chunk=function chunk(e,t=1){return 0!==(t=Math.max(Math.floor(t),0))&&isArrayLike(e)?function chunk$1(e,t){if(!Number.isInteger(t)||t<=0)throw new Error("Size must be an integer greater than zero.");const r=Math.ceil(e.length/t),n=Array(r);for(let i=0;ie};e.constantCase=function constantCase(e){return words(e).map((e=>e.toUpperCase())).join("_")};e.countBy=function countBy(e,t){const r={};for(let n=0;n="̀"&&n<="ͯ"||n>="︠"&&n<="︣"||(t+=I.get(n)??n)}return t};e.defaultTo=function defaultTo(e,t){return null==e||Number.isNaN(e)?t:e};e.defaults=defaults;e.defer=function defer(e,...t){if("function"!=typeof e)throw new TypeError("Expected a function");return setTimeout(e,1,...t)};e.delay=delay;e.difference=function difference(e,...t){if(!isArrayLikeObject(e))return[];const r=toArray(e),n=[];for(let e=0;eBoolean(t(e,r,n))));case"object":if(Array.isArray(t)&&2===t.length){return dropRightWhile$1(e,matchesProperty(t[0],t[1]))}return dropRightWhile$1(e,matches(t));case"string":return dropRightWhile$1(e,property(t))}}(Array.from(e),t):[]};e.dropWhile=function dropWhile(e,t){return isArrayLike(e)?function dropWhileImpl(e,t){switch(typeof t){case"function":return dropWhile$1(e,((e,r,n)=>Boolean(t(e,r,n))));case"object":if(Array.isArray(t)&&2===t.length){return dropWhile$1(e,matchesProperty(t[0],t[1]))}return dropWhile$1(e,matches(t));case"string":return dropWhile$1(e,property(t))}}(toArray(e),t):[]};e.each=forEach;e.endsWith=function endsWith(e,t,r=e.length){return e.endsWith(t,r)};e.eq=eq;e.escape=escape;e.escapeRegExp=function escapeRegExp(e){return e.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&")};e.every=function every(e,t,r){if(!e)return!0;const n=Array.isArray(e)?e:Object.values(e);r&&isIterateeCall(e,t,r)&&(t=void 0);t||(t=identity);switch(typeof t){case"function":if(!Array.isArray(e)){const r=Object.keys(e);for(let n=0;n=0?r:i+r,0),u=Math.min(n>=0?n:i+n,i);for(let r=o;rt(e[r],r,e)))};e.findLastIndex=function findLastIndex(e,t,r=(e?e.length-1:0)){if(!e)return-1;r=r<0?Math.max(e.length+r,0):Math.min(r,e.length-1);const n=toArray(e).slice(0,r+1);switch(typeof t){case"function":return n.findLastIndex(t);case"object":if(Array.isArray(t)&&2===t.length){const e=t[0],r=t[1];return n.findLastIndex(matchesProperty(e,r))}return n.findLastIndex(matches(t));case"string":return n.findLastIndex(property(t))}};e.first=head;e.flatMap=function flatMap(e,t,r=1){return flatten$1(e.map((e=>t(e))),r)};e.flatMapDeep=function flatMapDeep(e,t){return function flattenDeep$1(e){return flatten$1(e,1/0)}(e.map((e=>t(e))))};e.flatten=flatten;e.flattenDeep=function flattenDeep(e){return flatten(e,1/0)};e.flattenDepth=function flattenDepth(e,t=1){return flatten(e,t)};e.flattenObject=function flattenObject(e){return flattenObjectImpl(e)};e.flip=function flip(e){return function(...t){return e.apply(this,t.reverse())}};e.floor=function floor(e,t=0){return decimalAdjust("floor",e,t)};e.flow=function flow(...e){const t=flatten$1(e,1);if(t.some((e=>"function"!=typeof e)))throw new TypeError("Expected a function");return flow$1(...t)};e.flowRight=function flowRight(...e){const t=flatten$1(e,1);if(t.some((e=>"function"!=typeof e)))throw new TypeError("Expected a function");return function flowRight$1(...e){return flow$1(...e.reverse())}(...t)};e.forEach=forEach;e.forEachRight=function forEachRight(e,t){for(let r=e.length-1;r>=0;r--){t(e[r],r,e)}};e.fromPairs=function fromPairs(e){if(!(isArrayLike(e)||e instanceof Map))return{};const t={};for(const[r,n]of e)t[r]=n;return t};e.get=get;e.groupBy=function groupBy(e,t){const r=Object.create(null);for(let n=0;nr&&([t,r]=[r,t]);return t!==r&&function inRange$1(e,t,r){if(null==r){r=t;t=0}if(t>=r)throw new Error("The maximum value must be greater than the minimum value.");return t<=e&&ee.length||t instanceof RegExp)return!1;r<0&&(r=Math.max(0,e.length+r));return e.includes(t,r)}if(Array.isArray(e))return e.includes(t,r);const i=Object.keys(e);r<0&&(r=Math.max(0,i.length+r));for(let n=r;nr(e))):"string"==typeof r&&(n=intersectionBy$1(n,Array.from(i),property(r)))}return n};e.intersectionWith=intersectionWith;e.invariant=function invariant(e,t){if(!e)throw new Error(t)};e.invert=function invert(e){const t={},r=Object.keys(e);for(let n=0;n"constructor"!==e)).length:0===t.length}return!0};e.isEqual=function isEqual(e,t){return isEqualWith$1(e,t,noop)};e.isEqualWith=function isEqualWith(e,t,r=noop){"function"!=typeof r&&(r=noop);return isEqualWith$1(e,t,((...n)=>{const i=r(...n);return void 0!==i?Boolean(i):e instanceof Map&&t instanceof Map||e instanceof Set&&t instanceof Set?isEqualWith(Array.from(e),Array.from(t),after(2,r)):void 0}))};e.isError=function isError(e){return"[object Error]"===getTag(e)};e.isFile=function isFile(e){return"undefined"!=typeof File&&(isBlob(e)&&e instanceof File)};e.isFinite=function isFinite(e){return Number.isFinite(e)};e.isFunction=function isFunction(e){return"function"==typeof e};e.isInteger=function isInteger(e){return Number.isInteger(e)};e.isJSONArray=isJSONArray;e.isJSONObject=isJSONObject;e.isJSONValue=isJSONValue;e.isLength=isLength;e.isMap=function isMap(e){return function isMap$1(e){return e instanceof Map}(e)};e.isMatch=isMatch;e.isNaN=function isNaN(e){return Number.isNaN(e)};e.isNil=isNil;e.isNotNil=function isNotNil(e){return null!=e};e.isNull=function isNull(e){return null===e};e.isNumber=function isNumber(e){return"number"==typeof e||e instanceof Number};e.isObject=isObject;e.isObjectLike=isObjectLike;e.isPlainObject=isPlainObject;e.isPrimitive=isPrimitive;e.isRegExp=function isRegExp(e){return function isRegExp$1(e){return e instanceof RegExp}(e)};e.isSafeInteger=function isSafeInteger(e){return Number.isSafeInteger(e)};e.isSet=function isSet(e){return function isSet$1(e){return e instanceof Set}(e)};e.isString=isString;e.isSubset=function isSubset(e,t){return 0===difference$1(t,e).length};e.isSubsetWith=function isSubsetWith(e,t,r){return 0===differenceWith(t,e,r).length};e.isSymbol=isSymbol;e.isTypedArray=isTypedArray;e.isUndefined=function isUndefined(e){return void 0===e};e.isWeakMap=function isWeakMap(e){return function isWeakMap$1(e){return e instanceof WeakMap}(e)};e.isWeakSet=function isWeakSet(e){return function isWeakSet$1(e){return e instanceof WeakSet}(e)};e.iteratee=iteratee;e.join=function join(e,t=","){return isArrayLike(e)?Array.from(e).join(t):""};e.kebabCase=function kebabCase(e){return function kebabCase$1(e){return words(e).map((e=>e.toLowerCase())).join("-")}(normalizeForCase(e))};e.keyBy=function keyBy(e,t){const r={};for(let n=0;ne.toLowerCase())).join(" ")}(normalizeForCase(e))};e.lowerFirst=function lowerFirst(e){return e.substring(0,1).toLowerCase()+e.substring(1)};e.mapKeys=function mapKeys(e,t){switch(typeof(t=t??identity)){case"string":case"symbol":case"number":case"object":return mapKeys$1(e,property(t));case"function":return mapKeys$1(e,t)}};e.mapValues=function mapValues(e,t){switch(typeof(t=t??identity)){case"string":case"symbol":case"number":case"object":return mapValues$1(e,property(t));case"function":return mapValues$1(e,t)}};e.matches=matches;e.matchesProperty=matchesProperty;e.max=function max(e=[]){let t,r=e[0];for(let n=0;nt){t=i;r=i}}return r};e.maxBy=function maxBy(e,t){let r=e[0],n=-1/0;for(let i=0;in){n=u;r=o}}return r};e.mean=mean;e.meanBy=function meanBy(e,t){return mean(e.map((e=>t(e))))};e.median=median;e.medianBy=function medianBy(e,t){return median(e.map((e=>t(e))))};e.memoize=function memoize(e,t={}){const{cache:r=new Map,getCacheKey:n}=t,memoizedFn=function(t){const i=n?n(t):t;if(r.has(i))return r.get(i);const o=e.call(this,t);r.set(i,o);return o};memoizedFn.cache=r;return memoizedFn};e.merge=function merge(e,...t){return mergeWith(e,...t,noop)};e.mergeWith=mergeWith;e.min=function min(e=[]){let t,r=e[0];for(let n=0;n!e(...t)};e.noop=noop;e.omit=function omit(e,...t){if(null==e)return{};const r=cloneDeep$1(e);for(let e=0;ecapitalize(e))).join("")};e.pick=function pick(e,...t){if(isNil(e))return{};const r={};for(let n=0;nt-e)));for(const t of n)e.splice(t,1);return r};e.random=function random(...e){let t=0,r=1,n=!1;switch(e.length){case 1:"boolean"==typeof e[0]?n=e[0]:r=e[0];break;case 2:if("boolean"==typeof e[1]){r=e[0];n=e[1]}else{t=e[0];r=e[1]}case 3:if("object"==typeof e[2]&&null!=e[2]&&e[2][e[1]]===e[0]){t=0;r=e[0];n=!1}else{t=e[0];r=e[1];n=e[2]}}"number"!=typeof t&&(t=Number(t));"number"!=typeof r&&(t=Number(r));t||(t=0);r||(r=0);t>r&&([t,r]=[r,t]);t=clamp(t,-Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER);r=clamp(r,-Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER);return t===r?t:n?random$1(t,r+1):randomInt(t,r+1)};e.randomInt=randomInt;e.range=range;e.rangeRight=function rangeRight(e,t,r=1){if(null==t){t=e;e=0}if(!Number.isInteger(r)||0===r)throw new Error("The step value must be a non-zero integer.");const n=Math.max(Math.ceil((t-e)/r),0),i=new Array(n);for(let t=0;tt[e])).slice(0,t.length);for(let e=n.length;ee.length)throw new Error("Size must be less than or equal to the length of array.");const r=new Array(t),n=new Set;for(let i=e.length-t,o=0;i=1;e--){const r=Math.floor(Math.random()*(e+1));[t[e],t[r]]=[t[r],t[e]]}return t};e.size=function size(e){return isNil$1(e)?0:e instanceof Map||e instanceof Set?e.size:Object.keys(e).length};e.slice=function slice(e,t,r){if(!isArrayLike(e))return[];const n=e.length;if(void 0===r)r=n;else if("number"!=typeof r&&isIterateeCall(e,t,r)){t=0;r=n}t=toInteger(t);r=toInteger(r);t=t<0?Math.max(n+t,0):Math.min(t,n);r=r<0?Math.max(n+r,0):Math.min(r,n);const i=Math.max(r-t,0),o=new Array(i);for(let r=0;re.toLowerCase())).join("_")}(normalizeForCase(e))};e.some=function some(e,t,r){if(!e)return!1;null!=r&&(t=void 0);t||(t=identity);const n=Array.isArray(e)?e:Object.values(e);switch(typeof t){case"function":if(!Array.isArray(e)){const r=Object.keys(e);for(let n=0;n1&&isIterateeCall(e,t[0],t[1])?t=[]:r>2&&isIterateeCall(t[0],t[1],t[2])&&(t=[t[0]]);return orderBy(e,flatten$1(t),["asc"])};e.spread=function spread(e,t=0){t=Number.parseInt(t,10);(Number.isNaN(t)||t<0)&&(t=0);return function(...r){const n=r[t],i=r.slice(0,t);n&&i.push(...n);return e.apply(this,i)}};e.startCase=function startCase(e){const t=words(normalizeForCase(e).trim());let r="";for(let e=0;e=0;r--)if(!t(e[r]))return e.slice(r+1);return e.slice()};e.takeWhile=function takeWhile(e,t){const r=[];for(let n=0;n=0?r:i+r,0),u=Math.min(n>=0?n:i+n,i),c=e.slice();for(let e=o;ee.toString()))):trim$1(e,t.toString().split(""))}};e.trimEnd=function trimEnd(e,t,r){if(null==e)return"";if(null!=r||null==t)return e.toString().trimEnd();switch(typeof t){case"string":return trimEnd$1(e,t.toString().split(""));case"object":return Array.isArray(t)?trimEnd$1(e,t.map((e=>e.toString()))):trimEnd$1(e,t.toString().split(""))}};e.trimStart=function trimStart(e,t,r){if(null==e)return"";if(null!=r||null==t)return e.toString().trimStart();switch(typeof t){case"string":return trimStart$1(e,t.toString().split(""));case"object":return Array.isArray(t)?trimStart$1(e,t.map((e=>e.toString()))):trimStart$1(e,t.toString().split(""))}};e.unary=function unary(e){return ary$1(e,1)};e.unescape=function unescape(e){return e.replace(/&(?:amp|lt|gt|quot|#(0+)?39);/g,(e=>L[e]||"'"))};e.union=function union(...e){return uniq$1(flatten(e.filter(isArrayLikeObject),1))};e.unionBy=unionBy;e.unionWith=unionWith;e.uniq=function uniq(e){return isArrayLike(e)?uniq$1(Array.from(e)):[]};e.uniqBy=function uniqBy(e,...t){if(!isArrayLikeObject(e))return[];const r=last(t);if(void 0===r)return Array.from(e);const n=flatten(t.slice(0,-1).filter(isArrayLikeObject)),i=[...Array.from(e),...n];return isArrayLikeObject(r)?uniq$1(i):uniqBy$1(i,iteratee(r))};e.uniqWith=uniqWith;e.uniqueId=function uniqueId(e=""){return`${e}${++J}`};e.unset=unset;e.unzip=function unzip(e){return isArrayLikeObject(e)&&e.length?Array.isArray(e)?unzip$1(e):unzip$1(Array.from(e,(e=>Array.from(e)))):[]};e.unzipWith=function unzipWith(e,t){const r=Math.max(...e.map((e=>e.length))),n=new Array(r);for(let i=0;iisArrayLikeObject(e)))):[]};e.zipObject=function zipObject(e,t){const r={};for(let n=0;ne.length))),o=Array(i);for(let e=0;et[e]));o[e]=n(...t)}return o};Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});return e}({}); //# sourceMappingURL=browser.global.js.map