es-toolkit 1.50.0-dev.2060 → 1.50.0-dev.2062

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.
@@ -1,8 +1,8 @@
1
- (function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports):typeof define==`function`&&define.amd?define([`exports`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e._={}))})(this,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(...e){if(e.length===0)return[[]];let t=1;for(let n=0;n<e.length;n++)t*=e[n].length;if(t===0)return[];let n=e.length,r=Array(t);for(let i=0;i<t;i++){let t=Array(n),a=i;for(let r=n-1;r>=0;r--){let n=e[r],i=n.length;t[r]=n[a%i],a=Math.floor(a/i)}r[i]=t}return r}function n(e,t){if(!Number.isInteger(t)||t<=0)throw Error(`Size must be an integer greater than zero.`);let n=Math.ceil(e.length/t),r=Array(n);for(let i=0;i<n;i++){let n=i*t,a=n+t;r[i]=e.slice(n,a)}return r}function r(e,t){let n=[],r;for(let i=0;i<e.length;i++){let a=t(e[i]);i===0||a!==r?n.push([e[i]]):n[n.length-1].push(e[i]),r=a}return n}function i(e,t){if(!Number.isInteger(t)||t<0)throw Error(`r must be a non-negative integer.`);let n=e.length;if(t>n)return[];if(t===0)return[[]];let r=Array(t);for(let e=0;e<t;e++)r[e]=e;let i=[];for(;;){let a=Array(t);for(let n=0;n<t;n++)a[n]=e[r[n]];i.push(a);let o=t-1;for(;o>=0&&r[o]===o+n-t;)o--;if(o<0)return i;r[o]++;for(let e=o+1;e<t;e++)r[e]=r[e-1]+1}}function a(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n];r&&t.push(r)}return t}function o(e,t){let n=new Set(t);return e.filter(e=>!n.has(e))}function s(e,t,n){let r=new Set(t.map(e=>n(e)));return e.filter(e=>!r.has(n(e)))}function c(e,t,n){return e.filter(e=>t.every(t=>!n(e,t)))}function l(e,t){return t=Math.max(t,0),e.slice(t)}function u(e,t){return t=Math.min(-t,0),t===0?e.slice():e.slice(0,t)}function d(e,t){for(let n=e.length-1;n>=0;n--)if(!t(e[n],n,e))return e.slice(0,n+1);return[]}function f(e,t){let n=e.findIndex((e,n,r)=>!t(e,n,r));return n===-1?[]:e.slice(n)}function p(e,t,n=0,r=e.length){let i=e.length,a=Math.max(n>=0?n:i+n,0),o=Math.min(r>=0?r:i+r,i);for(let n=a;n<o;n++)e[n]=t;return e}var m=class{capacity;available;deferredTasks=[];constructor(e){this.capacity=e,this.available=e}async acquire(){if(this.available>0){this.available--;return}return new Promise(e=>{this.deferredTasks.push(e)})}release(){let e=this.deferredTasks.shift();if(e!=null){e();return}this.available<this.capacity&&this.available++}};function h(e,t){let n=new m(t);return async function(...t){try{return await n.acquire(),await e.apply(this,t)}finally{n.release()}}}async function ee(e,t,n){n?.concurrency!=null&&(t=h(t,n.concurrency));let r=await Promise.all(e.map(t));return e.filter((e,t)=>r[t])}function te(e,t=1){let n=[],r=Math.floor(t),i=(e,t)=>{for(let a=0;a<e.length;a++){let o=e[a];Array.isArray(o)&&t<r?i(o,t+1):n.push(o)}};return i(e,0),n}async function ne(e,t,n){return n?.concurrency!=null&&(t=h(t,n.concurrency)),te(await Promise.all(e.map(t)))}async function re(e,t,n){n?.concurrency!=null&&(t=h(t,n.concurrency)),await Promise.all(e.map(t))}function ie(e,t){let n={};for(let r=0;r<e.length;r++){let i=e[r],a=t(i,r,e);Object.hasOwn(n,a)||(n[a]=[]),n[a].push(i)}return n}function ae(e){return e[0]}function oe(e){return e.slice(0,-1)}function se(e,t){let n=new Set(t);return e.filter(e=>n.has(e))}function ce(e,t,n){let r=[],i=new Set(t.map(n));for(let t=0;t<e.length;t++){let a=e[t],o=n(a);i.has(o)&&(r.push(a),i.delete(o))}return r}function le(e,t,n){return e.filter(e=>t.some(t=>n(e,t)))}function ue(e,t){return o(t,e).length===0}function de(e,t,n){return c(t,e,n).length===0}function fe(e){return e[e.length-1]}function pe(e,t,n){return n?.concurrency!=null&&(t=h(t,n.concurrency)),Promise.all(e.map(t))}function me(e,t){let n=new Set(t),r=0;for(let t=0;t<e.length;t++)if(!n.has(e[t])){if(!Object.hasOwn(e,t)){delete e[r++];continue}e[r++]=e[t]}return e.length=r,e}async function he(e,t,n){let r=0;n??(n=e[0],r=1);let i=n;for(let n=r;n<e.length;n++)i=await t(i,e[n],n,e);return i}function ge(e,t){let n=e.slice(),r=[],i=0;for(let a=0;a<e.length;a++){if(t(e[a],a,n)){r.push(e[a]);continue}if(!Object.hasOwn(e,a)){delete e[i++];continue}e[i++]=e[a]}return e.length=i,r}function _e(e){return e[Math.floor(Math.random()*e.length)]}function ve(e,t){if(t??(t=e,e=0),e>=t)throw Error(`Invalid input: The maximum value must be greater than the minimum value.`);return Math.random()*(t-e)+e}function ye(e,t){return Math.floor(ve(e,t))}function be(e,t){if(t>e.length)throw Error(`Size must be less than or equal to the length of array.`);let n=Array(t),r=new Set;for(let i=e.length-t,a=0;i<e.length;i++,a++){let t=ye(0,i+1);r.has(t)&&(t=i),r.add(t),n[a]=e[t]}return n}function xe(e){let t=e.slice();for(let e=t.length-1;e>=1;e--){let n=Math.floor(Math.random()*(e+1));[t[e],t[n]]=[t[n],t[e]]}return t}function Se(e){return e.slice(1)}function Ce(e,t){return e.slice(0,t)}function we(e,t){return t<=0||e.length===0?[]:e.slice(-t)}function Te(e,t,n=0,r=e.length){let i=e.length,a=Math.max(n>=0?n:i+n,0),o=Math.min(r>=0?r:i+r,i),s=e.slice();for(let e=a;e<o;e++)s[e]=t;return s}function g(e){return[...new Set(e)]}function Ee(e,t){let n=new Map;for(let r=0;r<e.length;r++){let i=e[r],a=t(i,r,e);n.has(a)||n.set(a,i)}return Array.from(n.values())}function De(e,t){let n=[];for(let r=0;r<e.length;r++){let i=e[r];n.every(e=>!t(e,i))&&n.push(i)}return n}function Oe(e){let t=0;for(let n=0;n<e.length;n++)e[n].length>t&&(t=e[n].length);let n=Array(t);for(let r=0;r<t;r++){n[r]=Array(e.length);for(let t=0;t<e.length;t++)n[r][t]=e[t][r]}return n}function ke(e,t,n=1,{partialWindows:r=!1}={}){if(t<=0||!Number.isInteger(t))throw Error(`Size must be a positive integer.`);if(n<=0||!Number.isInteger(n))throw Error(`Step must be a positive integer.`);let i=[],a=r?e.length:e.length-t+1;for(let r=0;r<a;r+=n)i.push(e.slice(r,r+t));return i}function Ae(e,...t){return o(e,t)}function je(...e){let t=0;for(let n=0;n<e.length;n++)e[n].length>t&&(t=e[n].length);let n=e.length,r=Array(t);for(let i=0;i<t;++i){let t=Array(n);for(let r=0;r<n;++r)t[r]=e[r][i];r[i]=t}return r}let Me=typeof globalThis==`object`&&globalThis||typeof window==`object`&&window||typeof self==`object`&&self||typeof global==`object`&&global||(function(){return this})(),Ne=Me.DOMException===void 0?Error:Me.DOMException;var Pe=class extends Ne{constructor(e=`The operation was aborted`){super(e)}},Fe=class extends Ne{constructor(e=`The operation was timed out`){super(e)}};function Ie(e,t){if(!Number.isInteger(e)||e<0)throw Error(`n must be a non-negative integer.`);let n=0;return(...r)=>{if(++n>=e)return t(...r)}}function Le(e,t){return function(...n){return e.apply(this,n.slice(0,t))}}async function Re(){}function ze(e,t,{signal:n,edges:r}={}){let i,a=null,o=r!=null&&r.includes(`leading`),s=r==null||r.includes(`trailing`),c=()=>{a!==null&&(e.apply(i,a),i=void 0,a=null)},l=()=>{s&&c(),p()},u=null,d=()=>{u!=null&&clearTimeout(u),u=setTimeout(()=>{u=null,l()},t)},f=()=>{u!==null&&(clearTimeout(u),u=null)},p=()=>{f(),i=void 0,a=null},m=()=>{c()},h=function(...e){if(n?.aborted)return;i=this,a=e;let t=u==null;d(),o&&t&&c()};return h.schedule=d,h.cancel=p,h.flush=m,n?.addEventListener(`abort`,p,{once:!0}),h}function Be(...e){return function(...t){let n=e.length?e[0].apply(this,t):t[0];for(let t=1;t<e.length;t++)n=e[t].call(this,n);return n}}function Ve(...e){return Be(...e.reverse())}function _(e){return e}function He(e){return((...t)=>!e(...t))}function Ue(){}function We(e){let t=!1,n;return function(...r){return t||(t=!0,n=e(...r)),n}}function Ge(e,...t){return Ke(e,qe,...t)}function Ke(e,t,...n){let r=function(...r){let i=0,a=n.slice().map(e=>e===t?r[i++]:e),o=r.slice(i);return e.apply(this,a.concat(o))};return e.prototype&&(r.prototype=Object.create(e.prototype)),r}let qe=Symbol(`partial.placeholder`);Ge.placeholder=qe;function Je(e,...t){return Ye(e,Xe,...t)}function Ye(e,t,...n){let r=function(...r){let i=n.filter(e=>e===t).length,a=Math.max(r.length-i,0),o=r.slice(0,a),s=a,c=n.slice().map(e=>e===t?r[s++]:e);return e.apply(this,o.concat(c))};return e.prototype&&(r.prototype=Object.create(e.prototype)),r}let Xe=Symbol(`partialRight.placeholder`);Je.placeholder=Xe;function Ze(e,t=e.length-1){return function(...n){let r=n.slice(t),i=n.slice(0,t);for(;i.length<t;)i.push(void 0);return e.apply(this,[...i,r])}}function Qe(e,{signal:t}={}){return new Promise((n,r)=>{let i=()=>{r(new Pe)},a=()=>{clearTimeout(o),i()};if(t?.aborted)return i();let o=setTimeout(()=>{t?.removeEventListener(`abort`,a),n()},e);t?.addEventListener(`abort`,a,{once:!0})})}let $e=()=>!0;async function et(e,t){let n,r,i,a;typeof t==`number`?(n=0,r=t,i=void 0,a=$e):(n=t?.delay??0,r=t?.retries??1/0,i=t?.signal,a=t?.shouldRetry??$e);let o;for(let t=0;t<=r;t++){if(i?.aborted)throw o??Error(`The retry operation was aborted due to an abort signal.`);try{return await e()}catch(e){if(o=e,!a(e,t))throw e;t<r&&await Qe(typeof n==`function`?n(t,o):n)}}throw o}function tt(e){if(e.length===0)return NaN;let t=e.slice().sort((e,t)=>e-t),n=Math.floor(t.length/2);return t.length%2==0?(t[n-1]+t[n])/2:t[n]}function nt(e,t){return tt(e.map(e=>t(e)))}function rt(e,t){if(Number.isNaN(Number(t)))throw Error(`Expected percentile to be a number but got "${t}".`);if(t<0)throw Error(`Expected percentile to be >= 0 but got "${t}".`);if(t>100)throw Error(`Expected percentile to be <= 100 but got "${t}".`);if(e.length===0)return NaN;let n=e.slice().sort((e,t)=>(Number.isNaN(e)?-1/0:e)-(Number.isNaN(t)?-1/0:t));return t===0?n[0]:n[Math.ceil(n.length*(t/100))-1]}function it(e,t,n=1){if(t??(t=e,e=0),!Number.isInteger(n)||n===0)throw Error(`The step value must be a non-zero integer.`);let r=Math.max(Math.ceil((t-e)/n),0),i=Array(r);for(let t=0;t<r;t++)i[t]=e+t*n;return i}function v(e){return e==null||typeof e!=`object`&&typeof e!=`function`}function at(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function ot(e){if(v(e))return e;if(Array.isArray(e)||at(e)||e instanceof ArrayBuffer||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer)return e.slice(0);let t=Object.getPrototypeOf(e);if(t==null)return Object.assign(Object.create(t),e);let n=t.constructor;if(e instanceof Date||e instanceof Map||e instanceof Set)return new n(e);if(e instanceof RegExp){let t=new n(e);return t.lastIndex=e.lastIndex,t}if(e instanceof DataView)return new n(e.buffer.slice(0));if(e instanceof Error){let t;return t=e instanceof AggregateError?new n(e.errors,e.message,{cause:e.cause}):new n(e.message,{cause:e.cause}),t.stack=e.stack,Object.assign(t,e),t}return typeof File<`u`&&e instanceof File?new n([e],e.name,{type:e.type,lastModified:e.lastModified}):typeof e==`object`?Object.assign(Object.create(t),e):e}function st(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function y(e){return e==null?e===void 0?`[object Undefined]`:`[object Null]`:Object.prototype.toString.call(e)}let ct=`[object RegExp]`,lt=`[object String]`,ut=`[object Number]`,dt=`[object Boolean]`,ft=`[object Arguments]`,pt=`[object Symbol]`,mt=`[object Date]`,ht=`[object Map]`,gt=`[object Set]`,_t=`[object Array]`,vt=`[object ArrayBuffer]`,yt=`[object Object]`,bt=`[object DataView]`,xt=`[object Uint8Array]`,St=`[object Uint8ClampedArray]`,Ct=`[object Uint16Array]`,wt=`[object Uint32Array]`,Tt=`[object Int8Array]`,Et=`[object Int16Array]`,Dt=`[object Int32Array]`,Ot=`[object Float32Array]`,kt=`[object Float64Array]`;function b(e){return Me.Buffer!==void 0&&Me.Buffer.isBuffer(e)}function At(e,t){return x(e,void 0,e,new Map,t)}function x(e,t,n,r=new Map,i=void 0){let a=i?.(e,t,n,r);if(a!==void 0)return a;if(v(e))return e;if(r.has(e))return r.get(e);if(Array.isArray(e)){let t=Array(e.length);r.set(e,t);for(let a=0;a<e.length;a++)t[a]=x(e[a],a,n,r,i);return Object.hasOwn(e,`index`)&&(t.index=e.index),Object.hasOwn(e,`input`)&&(t.input=e.input),t}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){let t=new RegExp(e.source,e.flags);return t.lastIndex=e.lastIndex,t}if(e instanceof Map){let t=new Map;r.set(e,t);for(let[a,o]of e)t.set(a,x(o,a,n,r,i));return t}if(e instanceof Set){let t=new Set;r.set(e,t);for(let a of e)t.add(x(a,void 0,n,r,i));return t}if(b(e))return e.subarray();if(at(e)){let t=new(Object.getPrototypeOf(e)).constructor(e.length);r.set(e,t);for(let a=0;a<e.length;a++)t[a]=x(e[a],a,n,r,i);return t}if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){let t=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return r.set(e,t),S(t,e,n,r,i),t}if(typeof File<`u`&&e instanceof File){let t=new File([e],e.name,{type:e.type});return r.set(e,t),S(t,e,n,r,i),t}if(typeof Blob<`u`&&e instanceof Blob){let t=new Blob([e],{type:e.type});return r.set(e,t),S(t,e,n,r,i),t}if(e instanceof Error){let t=structuredClone(e);return r.set(e,t),t.message=e.message,t.name=e.name,t.stack=e.stack,t.cause=e.cause,t.constructor=e.constructor,S(t,e,n,r,i),t}if(e instanceof Boolean){let t=new Boolean(e.valueOf());return r.set(e,t),S(t,e,n,r,i),t}if(e instanceof Number){let t=new Number(e.valueOf());return r.set(e,t),S(t,e,n,r,i),t}if(e instanceof String){let t=new String(e.valueOf());return r.set(e,t),S(t,e,n,r,i),t}if(typeof e==`object`&&jt(e)){let t=Object.create(Object.getPrototypeOf(e));return r.set(e,t),S(t,e,n,r,i),t}return e}function S(e,t,n=e,r,i){let a=[...Object.keys(t),...st(t)];for(let o=0;o<a.length;o++){let s=a[o],c=Object.getOwnPropertyDescriptor(e,s);(c==null||c.writable)&&(e[s]=x(t[s],s,n,r,i))}}function jt(e){switch(y(e)){case ft:case _t:case vt:case bt:case dt:case mt:case Ot:case kt:case Tt:case Et:case Dt:case ht:case ut:case yt:case ct:case gt:case lt:case pt:case xt:case St:case Ct:case wt:return!0;default:return!1}}function Mt(e){return x(e,void 0,e,new Map,void 0)}function Nt(e){if(typeof e!=`object`||!e)return e;Object.freeze(e);let t=Object.keys(e);for(let n=0;n<t.length;n++){let r=e[t[n]];typeof r==`object`&&r&&!Object.isFrozen(r)&&Nt(r)}return e}function Pt(e,t){return Object.keys(e).find(n=>t(e[n],n,e))}function C(e){if(!e||typeof e!=`object`)return!1;let t=Object.getPrototypeOf(e);return t===null||t===Object.prototype||Object.getPrototypeOf(t)===null?Object.prototype.toString.call(e)===`[object Object]`:!1}function Ft(e,{delimiter:t=`.`,preserveArrays:n=!1}={}){return It(e,``,t,n)}function It(e,t,n,r){let i={},a=Object.keys(e);for(let o=0;o<a.length;o++){let s=a[o],c=e[s],l=t?`${t}${n}${s}`:s;if(C(c)&&Object.keys(c).length>0){Object.assign(i,It(c,l,n,r));continue}if(Array.isArray(c)&&!r&&c.length>0){Object.assign(i,It(c,l,n,r));continue}i[l]=c}return i}function Lt(e){let t={},n=Object.keys(e);for(let r=0;r<n.length;r++){let i=n[r],a=e[i];t[a]=i}return t}function Rt(e,t){let n={},r=Object.keys(e);for(let i=0;i<r.length;i++){let a=r[i],o=e[a];n[t(o,a,e)]=o}return n}function zt(e,t){let n={},r=Object.keys(e);for(let i=0;i<r.length;i++){let a=r[i],o=e[a];n[a]=t(o,a,e)}return n}function Bt(e){return C(e)||Array.isArray(e)}function w(e){return e===`__proto__`}function T(e,t,n){let r=Object.keys(t);for(let i=0;i<r.length;i++){let a=r[i];if(w(a))continue;let o=t[a],s=e[a],c=n(s,o,a,e,t);c===void 0?Bt(o)&&Bt(s)?e[a]=T(s,o,n):Array.isArray(o)?e[a]=T([],o,n):C(o)?e[a]=T({},o,n):(s===void 0||o!==void 0)&&(e[a]=o):e[a]=c}return e}function Vt(e,t){let n=Object.keys(e).sort(t),r={};for(let t=0;t<n.length;t++){let i=n[t];r[i]=e[i]}return r}function E(e){return Array.isArray(e)}function Ht(e){return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}let Ut=/\p{Lu}?\p{Ll}+|[0-9]+|\p{Lu}+(?!\p{Ll})|\p{Emoji_Presentation}|\p{Extended_Pictographic}|\p{L}+/gu;function Wt(e){return Array.from(e.match(Ut)??[])}function Gt(e){let t=Wt(e);if(t.length===0)return``;let[n,...r]=t;return`${n.toLowerCase()}${r.map(e=>Ht(e)).join(``)}`}function Kt(e){if(E(e))return e.map(e=>Kt(e));if(C(e)){let t={},n=Object.keys(e);for(let r=0;r<n.length;r++){let i=n[r],a=Gt(i);t[a]=Kt(e[i])}return t}return e}function D(e){if(typeof e!=`object`||!e)return!1;if(Object.getPrototypeOf(e)===null)return!0;if(Object.prototype.toString.call(e)!==`[object Object]`){let t=e[Symbol.toStringTag];return t==null||!Object.getOwnPropertyDescriptor(e,Symbol.toStringTag)?.writable?!1:e.toString()===`[object ${t}]`}let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function qt(e){return Wt(e).map(e=>e.toUpperCase()).join(`_`)}function Jt(e){if(E(e))return e.map(e=>Jt(e));if(D(e)){let t={},n=Object.keys(e);for(let r=0;r<n.length;r++){let i=n[r],a=qt(i);t[a]=Jt(e[i])}return t}return e}function Yt(e){return Wt(e).map(e=>e.toLowerCase()).join(`-`)}function Xt(e){if(E(e))return e.map(e=>Xt(e));if(D(e)){let t={},n=Object.keys(e);for(let r=0;r<n.length;r++){let i=n[r],a=Yt(i);t[a]=Xt(e[i])}return t}return e}function Zt(e,t){return T(Mt(e),t,function e(t,n){if(Bt(n)&&Bt(t))return T(ot(t),n,e);if(Array.isArray(n))return T([],n,e);if(C(n))return T({},n,e)})}function Qt(e){return Wt(e).map(e=>Ht(e)).join(``)}function $t(e){if(E(e))return e.map(e=>$t(e));if(D(e)){let t={},n=Object.keys(e);for(let r=0;r<n.length;r++){let i=n[r],a=Qt(i);t[a]=$t(e[i])}return t}return e}function en(e){return Wt(e).map(e=>e.toLowerCase()).join(`_`)}function tn(e){if(E(e))return e.map(e=>tn(e));if(D(e)){let t={},n=Object.keys(e);for(let r=0;r<n.length;r++){let i=n[r],a=en(i);t[a]=tn(e[i])}return t}return e}function nn(e){return e instanceof ArrayBuffer}function rn(e){return typeof Blob>`u`?!1:e instanceof Blob}function an(){return typeof window<`u`&&window?.document!=null}function on(e){return e instanceof Date}function sn(e){return C(e)&&Object.keys(e).length===0}function O(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}function cn(e,t,n){return ln(e,t,void 0,void 0,void 0,void 0,n)}function ln(e,t,n,r,i,a,o){let s=o(e,t,n,r,i,a);if(s!==void 0)return s;if(typeof e==typeof t)switch(typeof e){case`bigint`:case`string`:case`boolean`:case`symbol`:case`undefined`:return e===t;case`number`:return e===t||Object.is(e,t);case`function`:return e===t;case`object`:return un(e,t,a,o)}return un(e,t,a,o)}function un(e,t,n,r){if(Object.is(e,t))return!0;let i=y(e),a=y(t);if(i===`[object Arguments]`&&(i=yt),a===`[object Arguments]`&&(a=yt),i!==a)return!1;switch(i){case lt:return e.toString()===t.toString();case ut:return O(e.valueOf(),t.valueOf());case dt:case mt:case pt:return Object.is(e.valueOf(),t.valueOf());case ct:return e.source===t.source&&e.flags===t.flags;case`[object Function]`:return e===t}n??=new Map;let o=n.get(e),s=n.get(t);if(o!=null&&s!=null)return o===t;n.set(e,t),n.set(t,e);try{switch(i){case ht:if(e.size!==t.size)return!1;for(let[i,a]of e.entries())if(!t.has(i)||!ln(a,t.get(i),i,e,t,n,r))return!1;return!0;case gt:{if(e.size!==t.size)return!1;let i=Array.from(e.values()),a=Array.from(t.values());for(let o=0;o<i.length;o++){let s=i[o],c=a.findIndex(i=>ln(s,i,void 0,e,t,n,r));if(c===-1)return!1;a.splice(c,1)}return!0}case _t:case xt:case St:case Ct:case wt:case`[object BigUint64Array]`:case Tt:case Et:case Dt:case`[object BigInt64Array]`:case Ot:case kt:if(b(e)!==b(t)||e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(!ln(e[i],t[i],i,e,t,n,r))return!1;return!0;case vt:return e.byteLength===t.byteLength?un(new Uint8Array(e),new Uint8Array(t),n,r):!1;case bt:return e.byteLength!==t.byteLength||e.byteOffset!==t.byteOffset?!1:un(new Uint8Array(e),new Uint8Array(t),n,r);case`[object Error]`:return e.name===t.name&&e.message===t.message;case yt:{if(!(un(e.constructor,t.constructor,n,r)||C(e)&&C(t)))return!1;let i=[...Object.keys(e),...st(e)],a=[...Object.keys(t),...st(t)];if(i.length!==a.length)return!1;for(let a=0;a<i.length;a++){let o=i[a],s=e[o];if(!Object.hasOwn(t,o))return!1;let c=t[o];if(!ln(s,c,o,e,t,n,r))return!1}return!0}default:return!1}}finally{n.delete(e),n.delete(t)}}function dn(e,t){return cn(e,t,Ue)}function fn(e){return typeof File>`u`?!1:rn(e)&&e instanceof File}function k(e){return typeof e==`function`}function pn(e){return e!=null&&typeof e[Symbol.iterator]==`function`}function mn(e){if(typeof e!=`string`)return!1;try{return JSON.parse(e),!0}catch{return!1}}function hn(e){switch(typeof e){case`object`:return e===null||gn(e)||_n(e);case`string`:case`number`:case`boolean`:return!0;default:return!1}}function gn(e){return Array.isArray(e)?e.every(e=>hn(e)):!1}function _n(e){if(!C(e))return!1;let t=Reflect.ownKeys(e);for(let n=0;n<t.length;n++){let r=t[n],i=e[r];if(typeof r!=`string`||!hn(i))return!1}return!0}function vn(e){return Number.isSafeInteger(e)&&e>=0}function yn(e){return e instanceof Map}function A(e){return e==null}function bn(){return typeof process<`u`&&process?.versions?.node!=null}function xn(e){return e!=null}function Sn(e){return e===null}function Cn(e){return e instanceof Promise}function wn(e){return e instanceof RegExp}function Tn(e){return e instanceof Set}function En(e){return typeof e==`symbol`}function Dn(e){return e===void 0}function On(e){return e instanceof WeakMap}function kn(e){return e instanceof WeakSet}async function An(e){let t=Object.keys(e),n=await Promise.all(t.map(t=>e[t])),r={};for(let e=0;e<t.length;e++)r[t[e]]=n[e];return r}var jn=class{semaphore=new m(1);get isLocked(){return this.semaphore.available===0}async acquire(){return this.semaphore.acquire()}release(){this.semaphore.release()}};function Mn(e,{signal:t}={}){return new Promise((n,r)=>{let i=()=>{clearTimeout(a)};if(t?.aborted)return;let a=setTimeout(()=>{t?.removeEventListener(`abort`,i),r(new Fe)},e);t?.addEventListener(`abort`,i,{once:!0})})}async function Nn(e,t,{signal:n}={}){return Promise.race([e(),Mn(t,{signal:n})])}let Pn=new Map([[`Æ`,`Ae`],[`Ð`,`D`],[`Ø`,`O`],[`Þ`,`Th`],[`ß`,`ss`],[`æ`,`ae`],[`ð`,`d`],[`ø`,`o`],[`þ`,`th`],[`Đ`,`D`],[`đ`,`d`],[`Ħ`,`H`],[`ħ`,`h`],[`ı`,`i`],[`IJ`,`IJ`],[`ij`,`ij`],[`ĸ`,`k`],[`Ŀ`,`L`],[`ŀ`,`l`],[`Ł`,`L`],[`ł`,`l`],[`ʼn`,`'n`],[`Ŋ`,`N`],[`ŋ`,`n`],[`Œ`,`Oe`],[`œ`,`oe`],[`Ŧ`,`T`],[`ŧ`,`t`],[`ſ`,`s`]]);function Fn(e){e=e.normalize(`NFD`);let t=``;for(let n=0;n<e.length;n++){let r=e[n];r>=`̀`&&r<=`ͯ`||r>=`⃐`&&r<=`⃿`||r>=`︠`&&r<=`︯`||(t+=Pn.get(r)??r)}return t}let In={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`};function Ln(e){return e.replace(/[&<>"']/g,e=>In[e])}function Rn(e){return e.replace(/[\\^$.*+?()[\]{}|]/g,`\\$&`)}function zn(e){return e.substring(0,1).toLowerCase()+e.substring(1)}function Bn(e){return[...e].reverse().join(``)}function Vn(e,t){if(t===void 0)return e.trimEnd();let n=e.length;switch(typeof t){case`string`:if(t.length!==1)throw Error(`The 'chars' parameter should be a single character string.`);for(;n>0&&e[n-1]===t;)n--;break;case`object`:for(;n>0&&t.includes(e[n-1]);)n--}return e.substring(0,n)}function Hn(e,t){if(t===void 0)return e.trimStart();let n=0;switch(typeof t){case`string`:if(t.length!==1)throw Error(`The 'chars' parameter should be a single character string.`);for(;n<e.length&&e[n]===t;)n++;break;case`object`:for(;n<e.length&&t.includes(e[n]);)n++}return e.substring(n)}function Un(e,t){return t===void 0?e.trim():Hn(Vn(e,t),t)}let Wn={"&amp;":`&`,"&lt;":`<`,"&gt;":`>`,"&quot;":`"`,"&#39;":`'`};function Gn(e){return e.replace(/&(?:amp|lt|gt|quot|#(0+)?39);/g,e=>Wn[e]||`'`)}function Kn(e){return e.substring(0,1).toUpperCase()+e.substring(1)}async function qn(e){try{return[null,await e()]}catch(e){return[e,null]}}function Jn(e,t){if(!e)throw typeof t==`string`?Error(t):t}function Yn(e){return arguments.length===0?[]:Array.isArray(e)?e:[e]}function j(e){return Array.isArray(e)?e:Array.from(e)}function M(e){return e!=null&&typeof e!=`function`&&vn(e.length)}function Xn(e,t=1){if(t=Math.max(Math.floor(t),0),t===0||!M(e)||Number.isNaN(t))return[];let r=j(e);return r.length===0?[]:isFinite(t)?n(r,t):[r]}function Zn(e){return M(e)?a(Array.from(e)):[]}function Qn(...e){return te(e)}let $n=/\.|(\[(?:[^[\]]*|(["'])(?:(?!\2)[^\\]|\\.)*?\2)\])/;function er(e){switch(typeof e){case`number`:case`symbol`:return!1;case`string`:return e===``||e.startsWith(`.`)||e.endsWith(`.`)?!1:$n.test(e);default:return!1}}function N(e){return typeof e==`string`||typeof e==`symbol`?e:Object.is(e?.valueOf?.(),-0)?`-0`:String(e)}function P(e){return e==null?``:tr(e)}function tr(e){if(typeof e==`string`)return e;if(Array.isArray(e))return e.map(tr).join(`,`);let t=String(e);return t===`0`&&Object.is(Number(e),-0)?`-0`:t}function F(e){if(Array.isArray(e))return e.map(N);if(typeof e==`symbol`)return[e];e=P(e);let t=[],n=e.length;if(n===0)return t;let r=0,i=``,a=``,o=!1,s=!1,c=/^-?\d+(?:\.\d+)?$/;for(e.charCodeAt(0)===46&&t.push(``);r<n;){let l=e[r];if(a)l===`\\`&&r+1<n?(r++,i+=e[r]):l===a?a=``:i+=l;else if(o)if(l===`"`||l===`'`)a=l,s=!0;else if(l===`]`){if(o=!1,!s&&i.includes(`.`)&&!c.test(i)){let e=i.split(`.`);for(let n=0;n<e.length;n++)e[n]!==``&&t.push(e[n])}else t.push(i);i=``}else i+=l;else if(l===`[`)o=!0,s=!1,i&&=(t.push(i),``);else if(l===`.`){i&&=(t.push(i),``);let n=e[r+1];(n===void 0||n===`.`)&&t.push(``)}else i+=l;r++}return i&&t.push(i),t}function I(e,t,n){if(e==null)return n;switch(typeof t){case`string`:{if(w(t))return n;let r=e[t];return r===void 0?er(t)&&!Object.hasOwn(e,t)?I(e,F(t),n):n:r}case`number`:case`symbol`:{typeof t==`number`&&(t=N(t));let r=e[t];return r===void 0?n:r}default:{if(Array.isArray(t))return nr(e,t,n);if(t=Object.is(t?.valueOf(),-0)?`-0`:String(t),w(t))return n;let r=e[t];return r===void 0?n:r}}}function nr(e,t,n){if(t.length===0)return n;let r=e;for(let e=0;e<t.length;e++){if(r==null||w(t[e]))return n;r=r[t[e]]}return r===void 0?n:r}function rr(e){return function(t){return I(t,e)}}function L(e){return e!==null&&(typeof e==`object`||typeof e==`function`)}function ir(e,t,n){return typeof n==`function`?ar(e,t,function e(t,r,i,a,o,s){let c=n(t,r,i,a,o,s);return c===void 0?ar(t,r,e,s,!1):!!c},new Map,!0):ir(e,t,()=>void 0)}function ar(e,t,n,r,i=!1){if(t===e)return!0;switch(typeof t){case`object`:return or(e,t,n,r);case`function`:return Object.keys(t).length>0?ar(e,{...t},n,r,i):O(e,t);default:return L(e)&&i?typeof t==`string`?t===``:!0:O(e,t)}}function or(e,t,n,r){if(t==null)return!0;if(Array.isArray(t))return cr(e,t,n,r);if(t instanceof Map)return sr(e,t,n,r);if(t instanceof Set)return lr(e,t,n,r);let i=Object.keys(t);if(e==null||v(e))return i.length===0;if(i.length===0)return!0;if(r?.has(t))return r.get(t)===e;r?.set(t,e);try{for(let a=0;a<i.length;a++){let o=i[a];if(!v(e)&&!(o in e)||t[o]===void 0&&e[o]!==void 0||t[o]===null&&e[o]!==null||!n(e[o],t[o],o,e,t,r))return!1}return!0}finally{r?.delete(t)}}function sr(e,t,n,r){if(t.size===0)return!0;if(!(e instanceof Map))return!1;for(let[i,a]of t.entries())if(n(e.get(i),a,i,e,t,r)===!1)return!1;return!0}function cr(e,t,n,r){if(t.length===0)return!0;if(!Array.isArray(e))return!1;let i=new Set;for(let a=0;a<t.length;a++){let o=t[a],s=!1;for(let c=0;c<e.length;c++){if(i.has(c))continue;let l=e[c],u=!1;if(n(l,o,a,e,t,r)&&(u=!0),u){i.add(c),s=!0;break}}if(!s)return!1}return!0}function lr(e,t,n,r){return t.size===0?!0:e instanceof Set?cr([...e],[...t],n,r):!1}function ur(e,t){return ir(e,t,()=>void 0)}function dr(e){return e=Mt(e),t=>ur(t,e)}function fr(e,t){return At(e,(n,r,i,a)=>{let o=t?.(n,r,i,a);if(o!==void 0)return o;if(typeof e==`object`){if(y(e)===`[object Object]`&&typeof e.constructor!=`function`){let t={};return a.set(e,t),S(t,e,i,a),t}switch(Object.prototype.toString.call(e)){case ut:case lt:case dt:{let t=new e.constructor(e?.valueOf());return S(t,e),t}case ft:{let t={};return S(t,e),t.length=e.length,t[Symbol.iterator]=e[Symbol.iterator],t}default:return}}})}function pr(e){return fr(e)}let mr=/^(?:0|[1-9]\d*)$/;function hr(e,t=2**53-1){switch(typeof e){case`number`:return Number.isInteger(e)&&e>=0&&e<t;case`symbol`:return!1;case`string`:return mr.test(e)}}function R(e){return typeof e==`object`&&!!e&&y(e)===`[object Arguments]`}function gr(e,t){let n;if(n=Array.isArray(t)?t:typeof t==`string`&&er(t)&&!(t in Object(e))?F(t):[t],n.length===0)return!1;let r=e;for(let e=0;e<n.length;e++){let t=n[e];if((r==null||!Object.hasOwn(r,t))&&!((Array.isArray(r)||R(r))&&hr(t)&&t<r.length))return!1;r=r[t]}return!0}function _r(e,t){switch(typeof e){case`object`:Object.is(e?.valueOf(),-0)&&(e=`-0`);break;case`number`:e=N(e);break}return t=pr(t),function(n){let r=I(n,e);return r===void 0?gr(n,e):t===void 0?r===void 0:ur(r,t)}}function z(e){if(e==null)return _;switch(typeof e){case`function`:return e;case`object`:return Array.isArray(e)&&e.length===2?_r(e[0],e[1]):dr(e);default:return rr(e)}}function vr(e,t){if(e==null)return{};let n=M(e)?Array.from(e):Object.values(e),r=z(t??void 0),i=Object.create(null);for(let e=0;e<n.length;e++){let t=n[e],a=r(t);i[a]=(i[a]??0)+1}return i}function yr(e){return e===0?0:e}function B(e){return typeof e==`object`&&!!e}function V(e){return B(e)&&M(e)}function br(e,...t){if(!V(e))return[];let n=Array.from(e),r=[];for(let e=0;e<t.length;e++){let n=t[e];V(n)&&r.push(...Array.from(n))}return o(n,r).map(yr)}function H(e){if(!(!M(e)||e.length===0))return fe(j(e))}function xr(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n];if(V(r))for(let e=0;e<r.length;e++)t.push(r[e])}return t}function Sr(e,...t){if(!V(e))return[];let n=H(t),r=xr(t);return V(n)?o(Array.from(e),r).map(yr):s(Array.from(e),r,z(n)).map(yr)}function Cr(e,...t){if(!V(e))return[];let n=H(t),r=xr(t);return typeof n==`function`?c(Array.from(e),r,n):o(Array.from(e),r)}function U(e){return typeof e==`symbol`||e instanceof Symbol}function W(e){return U(e)?NaN:Number(e)}function G(e){return e?(e=W(e),e===1/0||e===-1/0?(e<0?-1:1)*Number.MAX_VALUE:e===e?e:0):e===0?e:0}function K(e){let t=G(e),n=t%1;return n?t-n:t}function wr(e,t=1,n){return M(e)?(t=n?1:K(t),l(j(e),t)):[]}function Tr(e,t=1,n){return M(e)?(t=n?1:K(t),u(j(e),t)):[]}function Er(e,t=_){return M(e)?Dr(j(e),t):[]}function Dr(e,t){switch(typeof t){case`function`:return d(e,(e,n,r)=>!!t(e,n,r));case`object`:if(Array.isArray(t)&&t.length===2){let n=t[0],r=t[1];return d(e,_r(n,r))}else return d(e,dr(t));case`symbol`:case`number`:case`string`:return d(e,rr(t))}}function Or(e,t=_){return M(e)?kr(j(e),t):[]}function kr(e,t){switch(typeof t){case`function`:return f(e,(e,n,r)=>!!t(e,n,r));case`object`:if(Array.isArray(t)&&t.length===2){let n=t[0],r=t[1];return f(e,_r(n,r))}else return f(e,dr(t));case`number`:case`symbol`:case`string`:return f(e,rr(t))}}function Ar(e,t=_){if(!e)return e;let n=M(e)?it(0,e.length):Object.keys(e);for(let r=0;r<n.length;r++){let i=n[r],a=e[i];if(t(a,i,e)===!1)break}return e}function jr(e,t=_){if(!e)return e;let n=M(e)?it(0,e.length):Object.keys(e);for(let r=n.length-1;r>=0;r--){let i=n[r],a=e[i];if(t(a,i,e)===!1)break}return e}function q(e,t,n){return L(n)&&(typeof t==`number`&&M(n)&&hr(t)&&t<n.length||typeof t==`string`&&t in n)?O(n[t],e):!1}function Mr(e){return typeof e==`string`||e instanceof String}function Nr(e,t,n=0,r=e?e.length:0){return M(e)?Mr(e)?e:(n&&typeof n!=`number`&&q(e,t,n)&&(n=0,r=e.length),n=K(n),r=K(r),n||=0,r||=0,p(e,t,n,r)):[]}function Pr(e,t=_){if(!e)return[];if(t=z(t),!Array.isArray(e)){let n=[],r=Object.keys(e),i=M(e)?e.length:r.length;for(let a=0;a<i;a++){let i=r[a],o=e[i];t(o,i,e)&&n.push(o)}return n}let n=[],r=e.length;for(let i=0;i<r;i++){let r=e[i];t(r,i,e)&&n.push(r)}return n}function Fr(e,t=_,n=0){if(!e)return;n=K(n),n<0&&(n=Math.max(e.length+n,0));let r=z(t);if(!Array.isArray(e)){let t=Object.keys(e);for(let i=n;i<t.length;i++){let n=t[i],a=e[n];if(r(a,n,e))return a}return}return e.slice(n).find(r)}function J(e){return e}function Ir(e,t=J,n=0){if(!e)return-1;n=K(n),n<0&&(n=Math.max(e.length+n,0));let r=Array.from(e).slice(n),i=z(t),a=r.findIndex(i);return a===-1?-1:a+n}function Lr(e,t=_,n){if(!e)return;let r=Array.isArray(e)?e.length:Object.keys(e).length;n=K(n??r-1),n=n<0?Math.max(r+n,0):Math.min(n,r-1);let i=z(t);if(!Array.isArray(e)){let t=Object.keys(e);for(let r=n;r>=0;r--){let n=t[r],a=e[n];if(i(a,n,e))return a}return}return e.slice(0,n+1).findLast(i)}function Rr(e,t=_,n=e?e.length-1:0){if(!e)return-1;Number.isNaN(n)&&(n=0),n=n<0?Math.max(e.length+n,0):Math.min(n,e.length-1);let r=j(e).slice(0,n+1);switch(typeof t){case`function`:return r.findLastIndex(t);case`object`:if(Array.isArray(t)&&t.length===2){let e=t[0],n=t[1];return r.findLastIndex(_r(e,n))}else return r.findLastIndex(dr(t));case`number`:case`symbol`:case`string`:return r.findLastIndex(rr(t))}}function zr(e){if(M(e))return ae(j(e))}function Br(e,t=1){if(!M(e))return[];let n=[],r=Math.floor(t),i=(e,t)=>{for(let a=0;a<e.length;a++){let o=e[a];Vr(o)&&t<r?i(o,t+1):n.push(o)}};return i(Array.from(e),0),n}function Vr(e){return E(e)||R(e)||!!(e&&e[Symbol.isConcatSpreadable])}function Hr(e,t=_){if(!e)return[];let n=M(e)?it(0,e.length):Object.keys(e),r=z(t),i=Array(n.length);for(let t=0;t<n.length;t++){let a=n[t],o=e[a];i[t]=r(o,a,e)}return i}function Ur(e,t=_,n=1){return e==null?[]:Br(Hr(e,z(t)),n)}function Wr(e,t){return Ur(e,t,1)}function Gr(e,t){return Ur(e,t,1/0)}function Kr(e){return Br(e,1)}function qr(e){return Br(e,1/0)}function Jr(e,t=_){return e==null?{}:ie(M(e)?j(e):Object.values(e),z(t))}function Yr(e,t,n,r){if(e==null)return!1;if(n=r||!n?0:K(n),Mr(e))return n>e.length||t instanceof RegExp?!1:(n<0&&(n=Math.max(0,e.length+n)),e.includes(t,n));if(Array.isArray(e))return e.includes(t,n);if(M(e)){n<0&&(n=Math.max(0,e.length+n));for(let r=n;r<e.length;r++)if(O(e[r],t))return!0;return!1}let i=Object.keys(e);n<0&&(n=Math.max(0,i.length+n));for(let r=n;r<i.length;r++)if(O(Reflect.get(e,i[r]),t))return!0;return!1}function Xr(e,t,n){if(!M(e))return-1;if(Number.isNaN(t)){n=K(n??0),n<0&&(n=Math.max(0,e.length+n));for(let t=n;t<e.length;t++)if(Number.isNaN(e[t]))return t;return-1}return Array.from(e).indexOf(t,n)}function Zr(e){return M(e)?oe(Array.from(e)):[]}function Qr(...e){if(e.length===0||!V(e[0]))return[];let t=g(j(e[0]));for(let n=1;n<e.length;n++){let r=e[n];if(!V(r))return[];t=se(t,j(r))}return t}function $r(e,...t){if(!V(e))return[];let n=fe(t),r=!V(n),i=r?t.length-1:t.length,a=r?z(n):_,o=typeof n==`function`?e=>a(e):a;if(i<=0)return Ee(j(e),o);let s=g(j(e));for(let e=0;e<i;++e){let n=t[e];if(!V(n))return[];s=ce(s,j(n),o)}return s}function ei(e,...t){if(e==null)return[];let n=H(t),r=O,i=g;typeof n==`function`&&(r=n,i=e=>De(e,r),t.pop());let a=i(j(e));for(let e=0;e<t.length;++e){let n=t[e];if(n==null)return[];a=le(a,j(n),r)}return a}function ti(e,t,...n){if(A(e))return[];let r=M(e)?Array.from(e):Object.values(e),i=[];for(let e=0;e<r.length;e++){let a=r[e];if(k(t)){i.push(t.apply(a,n));continue}let o=I(a,t),s=a,c=Array.isArray(t)?t:F(t);c.length>1&&(s=I(a,c.slice(0,-1))),i.push(o?.apply(s,n))}return i}function ni(e,t){return M(e)?Array.from(e).join(t):``}function ri(e,t=_,n){let r=arguments.length>=3;if(!e)return n;let i,a=0;M(e)?(i=it(0,e.length),!r&&e.length>0&&(n=e[0],a+=1)):(i=Object.keys(e),!r&&i.length>0&&(n=e[i[0]],a+=1));for(let r=a;r<i.length;r++){let a=i[r],o=e[a];n=t(n,o,a,e)}return n}function ii(e,t){if(!M(e)&&!B(e))return{};let n=z(t??_);return ri(e,(e,t)=>{let r=n(t);return e[r]=t,e},{})}function ai(e,t,n){if(!M(e)||e.length===0)return-1;let r=e.length,i=n===void 0?r-1:K(n);if(n!==void 0&&(i=i<0?Math.max(r+i,0):Math.min(i,r-1)),Number.isNaN(t)){for(let t=i;t>=0;t--)if(Number.isNaN(e[t]))return t;return-1}for(let n=i;n>=0;n--)if(e[n]===t)return n;return-1}function oi(e,t=0){if(!(!M(e)||e.length===0))return t=K(t),t<0&&(t+=e.length),e[t]}function si(e){return typeof e==`symbol`?1:e===null?2:e===void 0?3:e===e?0:4}let ci=(e,t,n)=>{if(e!==t){let r=si(e),i=si(t);if(r===i&&r===0){if(e<t)return n===`desc`?1:-1;if(e>t)return n===`desc`?-1:1}return n===`desc`?i-r:r-i}return 0},li=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ui=/^\w*$/;function di(e,t){return Array.isArray(e)?!1:typeof e==`number`||typeof e==`boolean`||e==null||U(e)?!0:typeof e==`string`&&(ui.test(e)||!li.test(e))||t!=null&&Object.hasOwn(t,e)}function fi(e,t,n,r){if(e==null)return[];n=r?void 0:n,Array.isArray(e)||(e=M(e)?Array.from(e):Object.values(e)),Array.isArray(t)||(t=t==null?[null]:[t]),t.length===0&&(t=[null]),Array.isArray(n)||(n=n==null?[]:[n]),n=n.map(e=>String(e));let i=(e,t)=>{let n=e,r=0;for(;r<t.length&&n!=null;++r)n=n[t[r]];return r>0&&r===t.length?n:void 0},a=(e,t)=>{if(e==null)return t;if(t!=null)return typeof e==`object`&&`key`in e?Object.hasOwn(t,e.key)?t[e.key]:i(t,e.path):typeof e==`function`?e(t):Array.isArray(e)?i(t,e):t[e]},o=t.map(e=>(Array.isArray(e)&&e.length===1&&(e=e[0]),e==null||typeof e==`function`||Array.isArray(e)||di(e)?e:{key:e,path:F(e)}));return e.map(e=>({original:e,criteria:o.map(t=>a(t,e))})).slice().sort((e,t)=>{for(let r=0;r<o.length;r++){let i=ci(e.criteria[r],t.criteria[r],n[r]);if(i!==0)return i}return 0}).map(e=>e.original)}function pi(e,t=_){if(!e)return[[],[]];let n=M(e)?e:Object.values(e);t=z(t);let r=[],i=[];for(let e=0;e<n.length;e++){let a=n[e];t(a)?r.push(a):i.push(a)}return[r,i]}function mi(e,...t){return me(e,t)}function hi(e,t=[]){return A(t)?e:me(e,Array.from(t))}function gi(e,t,n){let r=z(n),i=new Set(Array.from(t).map(e=>r(e))),a=0;for(let t=0;t<e.length;t++){let n=r(e[t]);if(!i.has(n)){if(!Object.hasOwn(e,t)){delete e[a++];continue}e[a++]=e[t]}}return e.length=a,e}function _i(e,t){let n=e.length;t??=Array(n);for(let r=0;r<n;r++)t[r]=e[r];return t}function vi(e,t,n){if(e?.length==null||t?.length==null)return e;e===t&&(t=_i(t));let r=0;n??=(e,t)=>O(e,t);let i=Array.isArray(t)?t:Array.from(t),a=i.includes(void 0);for(let t=0;t<e.length;t++){if(t in e){i.some(r=>n(e[t],r))||(e[r++]=e[t]);continue}a||delete e[r++]}return e.length=r,e}function yi(e,...t){if(t.length===0)return[];let n=[];for(let e=0;e<t.length;e++){let r=t[e];if(!M(r)||Mr(r)){n.push(r);continue}for(let e=0;e<r.length;e++)n.push(r[e])}let r=[];for(let t=0;t<n.length;t++)r.push(I(e,n[t]));return r}function bi(e,t){if(e==null)return!0;switch(typeof t){case`symbol`:case`number`:case`object`:if(Array.isArray(t))return xi(e,t);if(typeof t==`number`?t=N(t):typeof t==`object`&&(t=Object.is(t?.valueOf(),-0)?`-0`:String(t)),w(t))return!1;if(e?.[t]===void 0)return!0;try{return delete e[t],!0}catch{return!1}case`string`:if(e?.[t]===void 0&&er(t)&&!Object.hasOwn(e,t))return xi(e,F(t));if(w(t))return!1;try{return delete e[t],!0}catch{return!1}}}function xi(e,t){let n=t.length===1?e:I(e,t.slice(0,-1)),r=t[t.length-1];if(n?.[r]===void 0)return!0;if(w(r))return!1;try{return delete n[r],!0}catch{return!1}}function Si(e,...t){let n=Br(t,1);if(!e)return Array(n.length);let r=yi(e,n),i=n.map(t=>hr(t,e.length)?Number(t):t).sort((e,t)=>t-e);for(let t of new Set(i)){if(hr(t,e.length)){Array.prototype.splice.call(e,t,1);continue}if(di(t,e)){delete e[N(t)];continue}bi(e,E(t)?t:F(t))}return r}function Ci(e,t=_,n){let r=arguments.length>=3;if(!e)return n;let i,a;M(e)?(i=it(0,e.length).reverse(),!r&&e.length>0?(n=e[e.length-1],a=1):a=0):(i=Object.keys(e).reverse(),!r&&i.length>0?(n=e[i[0]],a=1):a=0);for(let r=a;r<i.length;r++){let a=i[r],o=e[a];n=t(n,o,a,e)}return n}function wi(e){if(typeof e!=`function`)throw TypeError(`Expected a function`);return function(...t){return!e.apply(this,t)}}function Ti(e,t=_){return Pr(e,wi(z(t)))}function Ei(e,t=_){return ge(e,z(t))}function Di(e){return e==null?e:Array.prototype.reverse.call(e)}function Oi(e){if(e!=null)return M(e)?_e(j(e)):_e(Object.values(e))}function ki(e,t,n){return n===void 0&&(n=t,t=void 0),n!==void 0&&(n=W(n),e=Math.min(e,Number.isNaN(n)?0:n)),t!==void 0&&(t=W(t),e=Math.max(e,Number.isNaN(t)?0:t)),e}function Ai(e){return yn(e)}function ji(e){return Tn(e)}function Mi(e){return e==null?[]:M(e)||Ai(e)||ji(e)?Array.from(e):typeof e==`object`?pn(e)?Array.from(e):Object.values(e):[]}function Ni(e,t,n){let r=Mi(e);return t=(n?q(e,t,n):t===void 0)?1:K(t),t=ki(t,0,r.length),be(r,t)}function Pi(e){let t=e?.constructor;return e===(typeof t==`function`?t.prototype:Object.prototype)}function Y(e){return at(e)}function Fi(e,t){if(e=K(e),e<1||!Number.isSafeInteger(e))return[];let n=Array(e);for(let r=0;r<e;r++)n[r]=typeof t==`function`?t(r):r;return n}function X(e){if(M(e))return Ii(e);let t=Object.keys(Object(e));return Pi(e)?t.filter(e=>e!==`constructor`):t}function Ii(e){let t=Fi(e.length,e=>`${e}`),n=new Set(t);b(e)&&(n.add(`offset`),n.add(`parent`)),Y(e)&&(n.add(`buffer`),n.add(`byteLength`),n.add(`byteOffset`));let r=Object.keys(e).filter(e=>!n.has(e));return Array.isArray(e)?[...t,...r]:[...t.filter(t=>Object.hasOwn(e,t)),...r]}function Li(e){if(e==null)return[];let t=X(e),n=Array(t.length);for(let r=0;r<t.length;r++)n[r]=e[t[r]];return n}function Ri(e){return e==null}function zi(e){return Ri(e)?[]:E(e)?xe(e):M(e)?xe(Array.from(e)):B(e)?xe(Li(e)):[]}let Bi=RegExp(`[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]`),Vi=`\\ud800-\\udfff`,Hi=`[${Vi}]`,Ui=`[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]`,Wi=`\\ud83c[\\udffb-\\udfff]`,Gi=`(?:${Ui}|${Wi})`,Ki=`[^${Vi}]`,qi=`(?:\\ud83c[\\udde6-\\uddff]){2}`,Ji=`[\\ud800-\\udbff][\\udc00-\\udfff]`,Yi=`${Gi}?`,Xi=`[\\ufe0e\\ufe0f]?`,Zi=`(?:\\u200d(?:${[Ki,qi,Ji].join(`|`)})${Xi}${Yi})*`,Qi=Xi+Yi+Zi,$i=`(?:${[`${Ki}${Ui}?`,Ui,qi,Ji,Hi].join(`|`)})`,ea=RegExp(`${Wi}(?=${Wi})|${$i}${Qi}`,`g`);function ta(e){let t=0;for(ea.lastIndex=0;ea.test(e);)++t;return t}function na(e){return A(e)?0:typeof e==`string`?Bi.test(e)?ta(e):e.length:M(e)?e.length:e instanceof Map||e instanceof Set?e.size:Object.keys(e).length}function ra(e,t,n){if(!M(e))return[];let r=e.length;n===void 0?n=r:typeof n!=`number`&&q(e,t,n)&&(t=0,n=r),t=K(t),n=K(n),t=t<0?Math.max(r+t,0):Math.min(t,r),n=n<0?Math.max(r+n,0):Math.min(n,r);let i=Math.max(n-t,0),a=Array(i);for(let n=0;n<i;++n)a[n]=e[t+n];return a}function ia(e,t,n){if(!e)return!1;n&&q(e,t,n)&&(t=void 0),t??=_;let r=Array.isArray(e)?e:Object.values(e);switch(typeof t){case`function`:if(!Array.isArray(e)){let n=Object.keys(e);for(let r=0;r<n.length;r++){let i=n[r],a=e[i];if(t(a,i,e))return!0}return!1}for(let n=0;n<e.length;n++)if(t(e[n],n,e))return!0;return!1;case`object`:if(Array.isArray(t)&&t.length===2){let n=t[0],i=t[1],a=_r(n,i);if(Array.isArray(e)){for(let t=0;t<e.length;t++)if(a(e[t]))return!0;return!1}return r.some(a)}else{let n=dr(t);if(Array.isArray(e)){for(let t=0;t<e.length;t++)if(n(e[t]))return!0;return!1}return r.some(n)}case`number`:case`symbol`:case`string`:{let n=rr(t);if(Array.isArray(e)){for(let t=0;t<e.length;t++)if(n(e[t]))return!0;return!1}return r.some(n)}}}function aa(e,...t){let n=t.length;return n>1&&q(e,t[0],t[1])?t=[]:n>2&&q(t[0],t[1],t[2])&&(t=[t[0]]),fi(e,te(t),[`asc`])}function oa(e){return typeof e==`number`||B(e)&&y(e)===`[object Number]`}function sa(e){return oa(e)&&Number.isNaN(Number(e))}function ca(e,t,n=J,r){if(Ri(e)||e.length===0)return 0;let i=0,a=e.length,o=z(n),s=o(t),c=sa(s),l=Sn(s),u=U(s),d=Dn(s);for(;i<a;){let t,n=Math.floor((i+a)/2),f=o(e[n]),p=!Dn(f),m=Sn(f),h=!sa(f),ee=U(f);t=c?r||h:d?h&&(r||p):l?h&&p&&(r||!m):u?h&&p&&!m&&(r||!ee):m||ee?!1:r?f<=s:f<s,t?i=n+1:a=n}return Math.min(a,4294967294)}function la(e,t){if(A(e))return 0;let n=0,r=e.length;if(oa(t)&&t===t&&r<=2147483647){for(;n<r;){let i=n+r>>>1,a=e[i];!Sn(a)&&!En(a)&&a<t?n=i+1:r=i}return r}return ca(e,t,e=>e)}function ua(e,t){if(!e?.length)return-1;let n=la(e,t);return n<e.length&&O(e[n],t)?n:-1}function da(e,t,n){return ca(e,t,n,!0)}function fa(e,t){if(A(e))return 0;let n=e.length;if(!oa(t)||Number.isNaN(t)||n>2147483647)return da(e,t,e=>e);let r=0;for(;r<n;){let i=r+n>>>1,a=e[i];!Sn(a)&&!En(a)&&a<=t?r=i+1:n=i}return n}function pa(e,t){if(!e?.length)return-1;let n=fa(e,t)-1;return n>=0&&O(e[n],t)?n:-1}function ma(e){return M(e)?Se(j(e)):[]}function ha(e,t=1,n){return t=n||t===void 0?1:K(t),t<1||!M(e)?[]:Ce(j(e),t)}function ga(e,t=1,n){return t=n?1:K(t),t<=0||!M(e)?[]:we(j(e),t)}function _a(e,t){if(!M(e))return[];let n=j(e),r=n.findLastIndex(He(z(t??_)));return n.slice(r+1)}function va(e,t){if(!M(e))return[];let n=j(e),r=n.findIndex(wi(z(t??J)));return r===-1?n:n.slice(0,r)}function ya(...e){return g(Ur(e.filter(V),e=>Array.from(e),1))}function ba(...e){let t=fe(e),n=xr(e);return V(t)||t==null?g(n):Ee(n,Le(z(t),1)).map(yr)}function xa(...e){let t=fe(e),n=xr(e);return V(t)||t==null?g(n):De(n,t)}function Sa(e){return M(e)?g(Array.from(e)):[]}function Ca(e,t=_){return M(e)?Ee(Array.from(e),Le(z(t),1)).map(yr):[]}function wa(e,t){return M(e)?typeof t==`function`?De(Array.from(e),(e,n)=>t(n,e)):Sa(Array.from(e)):[]}function Ta(e){return!V(e)||!e.length?[]:(e=E(e)?e:Array.from(e),e=e.filter(e=>V(e)),Oe(e))}function Ea(e,t){if(!V(e)||!e.length)return[];let n=E(e)?Oe(e):Oe(Array.from(e,e=>Array.from(e)));if(!t)return n;let r=Array(n.length);for(let e=0;e<n.length;e++){let i=n[e];r[e]=t(...i)}return r}function Da(e,...t){return V(e)?Ae(Array.from(e),...t):[]}function Oa(...e){let t=new Map;for(let n=0;n<e.length;n++){let r=e[n];if(!V(r))continue;let i=new Set(Mi(r));for(let e of i)t.has(e)?t.set(e,t.get(e)+1):t.set(e,1)}let n=[];for(let[e,r]of t)r===1&&n.push(e);return n}function ka(...e){let t=H(e),n=_;!V(t)&&t!=null&&(n=z(t),e=e.slice(0,-1));let r=e.filter(V);return Sr(ba(...r,n),ba(...ke(r,2).map(([e,t])=>$r(e,t,n)),n),n)}function Aa(...e){let t=H(e),n=(e,t)=>e===t;typeof t==`function`&&(n=t,e=e.slice(0,-1));let r=e.filter(V);return Cr(xa(...r,n),xa(...ke(r,2).map(([e,t])=>ei(e,t,n)),n),n)}function ja(...e){return e.length?je(...e.filter(e=>V(e))):[]}let Ma=(e,t,n)=>{let r=e[t];(!(Object.hasOwn(e,t)&&O(r,n))||n===void 0&&!(t in e))&&(e[t]=n)};function Na(e=[],t=[]){e||=[],t||=[];let n={};for(let r=0;r<e.length;r++)Ma(n,e[r],t[r]);return n}function Pa(e){return e===`__proto__`||e===`constructor`||e===`prototype`}function Fa(e,t,n,r){if(e==null&&!L(e))return e;let i;i=di(t,e)?[t]:Array.isArray(t)?t:F(t);let a=n(I(e,i)),o=e;for(let t=0;t<i.length&&o!=null;t++){let n=N(i[t]);if(Pa(n))return e;let s;if(t===i.length-1)s=a;else{let a=o[n],c=r?.(a,n,e);s=c===void 0?L(a)?a:hr(i[t+1])?[]:{}:c}Ma(o,n,s),o=o[n]}return e}function Ia(e,t,n){return Fa(e,t,()=>n,()=>void 0)}function La(e,t){let n={};if(!M(e))return n;M(t)||(t=[]);let r=je(Array.from(e),Array.from(t));for(let e=0;e<r.length;e++){let[t,i]=r[e];t!=null&&Ia(n,t,i)}return n}function Ra(...e){let t=e.pop();if(k(t)||(e.push(t),t=void 0),!e?.length)return[];let n=Ta(e);return t==null?n:n.map(e=>t(...e))}function za(e,t){if(typeof t!=`function`)throw TypeError(`Expected a function`);return e=K(e),function(...n){if(--e<1)return t.apply(this,n)}}function Ba(e,t=e.length,n){return n&&(t=e.length),(Number.isNaN(t)||t<0)&&(t=0),Le(e,t)}function Va(e,...t){try{return e(...t)}catch(e){return e instanceof Error?e:Error(e)}}function Ha(e,t){if(typeof t!=`function`)throw TypeError(`Expected a function`);let n;return e=K(e),function(...r){return--e>0&&(n=t.apply(this,r)),e<=1&&t&&(t=void 0),n}}function Ua(e,t,...n){let r=function(...i){let a=[],o=0;for(let e=0;e<n.length;e++){let t=n[e];t===Ua.placeholder?a.push(i[o++]):a.push(t)}for(let e=o;e<i.length;e++)a.push(i[e]);return this instanceof r?new e(...a):e.apply(t,a)};return r}Ua.placeholder=Symbol(`bind.placeholder`);function Wa(e,t,...n){let r=function(...i){let a=[],o=0;for(let e=0;e<n.length;e++){let t=n[e];t===Wa.placeholder?a.push(i[o++]):a.push(t)}for(let e=o;e<i.length;e++)a.push(i[e]);return this instanceof r?new e[t](...a):e[t].apply(e,a)};return r}Wa.placeholder=Symbol(`bindKey.placeholder`);function Ga(e,t=e.length,n){t=n?e.length:t,t=Number.parseInt(t,10),(Number.isNaN(t)||t<1)&&(t=0);let r=function(...n){let i=n.filter(e=>e===Ga.placeholder),a=n.length-i.length;return a<t?Ka(e,t-a,n):this instanceof r?new e(...n):e.apply(this,n)};return r.placeholder=Ja,r}function Ka(e,t,n){function r(...i){let a=i.filter(e=>e===Ga.placeholder),o=i.length-a.length;return i=qa(i,n),o<t?Ka(e,t-o,i):this instanceof r?new e(...i):e.apply(this,i)}return r.placeholder=Ja,r}function qa(e,t){let n=[],r=0;for(let i=0;i<t.length;i++){let a=t[i];a===Ga.placeholder&&r<e.length?n.push(e[r++]):n.push(a)}for(let t=r;t<e.length;t++)n.push(e[t]);return n}let Ja=Symbol(`curry.placeholder`);Ga.placeholder=Ja;function Ya(e,t=e.length,n){t=n?e.length:t,t=Number.parseInt(t,10),(Number.isNaN(t)||t<1)&&(t=0);let r=function(...n){let i=n.filter(e=>e===Ya.placeholder),a=n.length-i.length;return a<t?Xa(e,t-a,n):this instanceof r?new e(...n):e.apply(this,n)};return r.placeholder=Qa,r}function Xa(e,t,n){function r(...i){let a=i.filter(e=>e===Ya.placeholder),o=i.length-a.length;return i=Za(i,n),o<t?Xa(e,t-o,i):this instanceof r?new e(...i):e.apply(this,i)}return r.placeholder=Qa,r}function Za(e,t){let n=t.filter(e=>e===Ya.placeholder).length,r=Math.max(e.length-n,0),i=[],a=0;for(let t=0;t<r;t++)i.push(e[a++]);for(let n=0;n<t.length;n++){let r=t[n];r===Ya.placeholder&&a<e.length?i.push(e[a++]):i.push(r)}return i}let Qa=Symbol(`curryRight.placeholder`);Ya.placeholder=Qa;function $a(e,t=0,n={}){typeof n!=`object`&&(n={});let{leading:r=!1,trailing:i=!0,maxWait:a}=n,o=[,,];r&&(o[0]=`leading`),i&&(o[1]=`trailing`);let s,c=null,l=ze(function(...t){s=e.apply(this,t),c=null},t,{edges:o}),u=function(...t){return a!=null&&(c===null&&(c=Date.now()),Date.now()-c>=a)?(s=e.apply(this,t),c=Date.now(),l.cancel(),l.schedule(),s):(l.apply(this,t),s)};return u.cancel=l.cancel,u.flush=()=>(l.flush(),s),u}function eo(e,...t){if(typeof e!=`function`)throw TypeError(`Expected a function`);return setTimeout(e,1,...t)}function to(e,t,...n){if(typeof e!=`function`)throw TypeError(`Expected a function`);return setTimeout(e,W(t)||0,...n)}function no(e){return function(...t){return e.apply(this,t.reverse())}}function ro(...e){let t=te(e,1);if(t.some(e=>typeof e!=`function`))throw TypeError(`Expected a function`);return Be(...t)}function io(...e){let t=te(e,1);if(t.some(e=>typeof e!=`function`))throw TypeError(`Expected a function`);return Ve(...t)}function ao(e,t){if(typeof e!=`function`||t!=null&&typeof t!=`function`)throw TypeError(`Expected a function`);let n=function(...r){let i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);let o=e.apply(this,r);return n.cache=a.set(i,o)||a,o};return n.cache=new(ao.Cache||Map),n}ao.Cache=Map;function oo(e=0){return function(...t){return t.at(K(e))}}function so(e){return We(e)}function co(e,...t){if(typeof e!=`function`)throw TypeError(`Expected a function`);let n=t.flat();return function(...t){let r=Math.min(t.length,n.length),i=[...t];for(let e=0;e<r;e++)i[e]=z(n[e]??_).call(this,t[e]);return e.apply(this,i)}}function lo(e,...t){return Ke(e,lo.placeholder,...t)}lo.placeholder=Symbol(`compat.partial.placeholder`);function uo(e,...t){return Ye(e,uo.placeholder,...t)}uo.placeholder=Symbol(`compat.partialRight.placeholder`);function fo(e,...t){let n=Kr(t);return function(...t){let r=n.map(e=>t[e]).slice(0,t.length);for(let e=r.length;e<t.length;e++)r.push(t[e]);return e.apply(this,r)}}function po(e,t=e.length-1){return t=Number.parseInt(t,10),(Number.isNaN(t)||t<0)&&(t=e.length-1),Ze(e,t)}function mo(e,t=0){return t=Number.parseInt(t,10),(Number.isNaN(t)||t<0)&&(t=0),function(...n){let r=n[t],i=n.slice(0,t);return r&&i.push(...r),e.apply(this,i)}}function ho(e,t=0,n={}){let{leading:r=!0,trailing:i=!0}=n;return $a(e,t,{leading:r,maxWait:t,trailing:i})}function go(e){return Ba(e,1)}function _o(e,t){return function(...n){return(k(t)?t:_).apply(this,[e,...n])}}function vo(e,t){return e===void 0&&t===void 0?0:e===void 0||t===void 0?e??t:(typeof e==`string`||typeof t==`string`?(e=P(e),t=P(t)):(e=W(e),t=W(t)),e+t)}function yo(e,t,n=0){if(t=Number(t),Object.is(t,-0)&&(t=`-0`),n=Math.min(Number.parseInt(n,10),292),n&&Number.isFinite(Number(t))){let[r,i=0]=t.toString().split(`e`),a=Math[e](Number(`${r}e${Number(i)+n}`));Object.is(a,-0)&&(a=`-0`);let[o,s=0]=a.toString().split(`e`);return Number(`${o}e${Number(s)-n}`)}return Math[e](Number(t))}function bo(e,t=0){return yo(`ceil`,e,t)}function xo(e,t){return e===void 0&&t===void 0?1:e===void 0||t===void 0?e??t:(typeof e==`string`||typeof t==`string`?(e=P(e),t=P(t)):(e=W(e),t=W(t)),e/t)}function So(e,t=0){return yo(`floor`,e,t)}function Co(e,t,n){return t=G(t),n===void 0?(n=t,t=0):n=G(n),e=W(e),e>=Math.min(t,n)&&e<Math.max(t,n)}function wo(e){if(!e||e.length===0)return;let t;for(let n=0;n<e.length;n++){let r=e[n];r==null||Number.isNaN(r)||typeof r==`symbol`||(t===void 0||r>t)&&(t=r)}return t}function To(e,t=_){if(e==null)return;let n=j(e);if(n.length===0)return;let r=z(t),i,a;for(let e=0;e<n.length;e++){let t=n[e],o=r(t,e,n);o==null||Number.isNaN(o)||typeof o==`symbol`||(a===void 0||o>a)&&(a=o,i=t)}return i}function Eo(e,t){if(!e||!e.length)return 0;t!=null&&(t=z(t));let n;for(let r=0;r<e.length;r++){let i=t?t(e[r]):e[r];i!==void 0&&(n===void 0?n=i:n+=i)}return n}function Do(e){return Eo(e)}function Oo(e){let t=e?e.length:0;return t===0?NaN:Do(e)/t}function ko(e,t){let n=e==null?0:e.length;return n?Eo(e,z(t??_))/n:NaN}function Ao(e){if(!e||e.length===0)return;let t;for(let n=0;n<e.length;n++){let r=e[n];r==null||Number.isNaN(r)||typeof r==`symbol`||(t===void 0||r<t)&&(t=r)}return t}function jo(e,t=_){if(e==null)return;let n=j(e);if(n.length===0)return;let r=z(t),i,a;for(let e=0;e<n.length;e++){let t=n[e],o=r(t,e,n);o==null||Number.isNaN(o)||typeof o==`symbol`||(a===void 0||o<a)&&(a=o,i=t)}return i}function Mo(e,t){return e===void 0&&t===void 0?1:e===void 0||t===void 0?e??t:(typeof e==`string`||typeof t==`string`?(e=P(e),t=P(t)):(e=W(e),t=W(t)),e*t)}function No(e,t=0,n){return n&&(t=0),Number.parseInt(P(e),t)}function Po(...e){let t=0,n=1,r=!1;switch(e.length){case 1:typeof e[0]==`boolean`?r=e[0]:n=e[0];break;case 2:if(typeof e[1]==`boolean`){n=e[0],r=e[1];break}else t=e[0],n=e[1];case 3:typeof e[2]==`object`&&e[2]!=null&&e[2][e[1]]===e[0]?(t=0,n=e[0],r=!1):(t=e[0],n=e[1],r=e[2])}return typeof t!=`number`&&(t=Number(t)),typeof n!=`number`&&(n=Number(n)),t||=0,n||=0,t>n&&([t,n]=[n,t]),!r&&(!Number.isInteger(t)||!Number.isInteger(n))&&(r=!0),t=ki(t,-(2**53-1),2**53-1),n=ki(n,-(2**53-1),2**53-1),t===n?t:r?ve(t,n):ye(t,n+1)}function Fo(e,t,n){n&&typeof n!=`number`&&q(e,t,n)&&(t=n=void 0),e=G(e),t===void 0?(t=e,e=0):t=G(t),n=n===void 0?e<t?1:-1:G(n);let r=Math.max(Math.ceil((t-e)/(n||1)),0),i=Array(r);for(let t=0;t<r;t++)i[t]=e,e+=n;return i}function Io(e,t,n){n&&typeof n!=`number`&&q(e,t,n)&&(t=n=void 0),e=G(e),t===void 0?(t=e,e=0):t=G(t),n=n===void 0?e<t?1:-1:G(n);let r=Math.max(Math.ceil((t-e)/(n||1)),0),i=Array(r);for(let t=r-1;t>=0;t--)i[t]=e,e+=n;return i}function Lo(e,t=0){return yo(`round`,e,t)}function Ro(e,t){return e===void 0&&t===void 0?0:e===void 0||t===void 0?e??t:(typeof e==`string`||typeof t==`string`?(e=P(e),t=P(t)):(e=W(e),t=W(t)),e-t)}function zo(...e){}function Bo(e,...t){for(let n=0;n<t.length;n++)Vo(e,t[n]);return e}function Vo(e,t){let n=X(t);for(let r=0;r<n.length;r++){let i=n[r];(!(i in e)||!O(e[i],t[i]))&&(e[i]=t[i])}}function Z(e){if(e==null)return[];switch(typeof e){case`object`:case`function`:return M(e)?Wo(e):Pi(e)?Uo(e):Ho(e);default:return Ho(Object(e))}}function Ho(e){let t=[];for(let n in e)t.push(n);return t}function Uo(e){return Ho(e).filter(e=>e!==`constructor`)}function Wo(e){let t=Fi(e.length,e=>`${e}`),n=new Set(t);b(e)&&(n.add(`offset`),n.add(`parent`)),Y(e)&&(n.add(`buffer`),n.add(`byteLength`),n.add(`byteOffset`));let r=Ho(e).filter(e=>!n.has(e));return Array.isArray(e)?[...t,...r]:[...t.filter(t=>Object.hasOwn(e,t)),...r]}function Go(e,...t){for(let n=0;n<t.length;n++)Ko(e,t[n]);return e}function Ko(e,t){let n=Z(t);for(let r=0;r<n.length;r++){let i=n[r];(!(i in e)||!O(e[i],t[i]))&&(e[i]=t[i])}}function qo(e,...t){let n=t[t.length-1];typeof n==`function`?t.pop():n=void 0;for(let r=0;r<t.length;r++)Jo(e,t[r],n);return e}function Jo(e,t,n){let r=Z(t);for(let i=0;i<r.length;i++){let a=r[i],o=e[a],s=t[a],c=n?.(o,s,a,e,t)??s;(!(a in e)||!O(o,c))&&(e[a]=c)}}function Yo(e,...t){let n=t[t.length-1];typeof n==`function`?t.pop():n=void 0;for(let r=0;r<t.length;r++)Xo(e,t[r],n);return e}function Xo(e,t,n){let r=X(t);for(let i=0;i<r.length;i++){let a=r[i],o=e[a],s=t[a],c=n?.(o,s,a,e,t)??s;(!(a in e)||!O(o,c))&&(e[a]=c)}}function Zo(e){if(v(e))return e;let t=y(e);if(!Qo(e))return{};if(E(e)){let t=Array.from(e);return e.length>0&&typeof e[0]==`string`&&Object.hasOwn(e,`index`)&&(t.index=e.index,t.input=e.input),t}if(Y(e)){let t=e,n=t.constructor;return new n(t.buffer,t.byteOffset,t.length)}if(t===`[object ArrayBuffer]`)return new ArrayBuffer(e.byteLength);if(t===`[object DataView]`){let t=e,n=t.buffer,r=t.byteOffset,i=t.byteLength,a=new ArrayBuffer(i),o=new Uint8Array(n,r,i);return new Uint8Array(a).set(o),new DataView(a)}if(t===`[object Boolean]`||t===`[object Number]`||t===`[object String]`){let n=e.constructor,r=new n(e.valueOf());return t===`[object String]`?ts(r,e):$o(r,e),r}if(t===`[object Date]`)return new Date(Number(e));if(t===`[object RegExp]`){let t=e,n=new RegExp(t.source,t.flags);return n.lastIndex=t.lastIndex,n}if(t===`[object Symbol]`)return Object(Symbol.prototype.valueOf.call(e));if(t===`[object Map]`){let t=e,n=new Map;return t.forEach((e,t)=>{n.set(t,e)}),n}if(t===`[object Set]`){let t=e,n=new Set;return t.forEach(e=>{n.add(e)}),n}if(t===`[object Arguments]`){let t=e,n={};return $o(n,t),n.length=t.length,n[Symbol.iterator]=t[Symbol.iterator],n}let n={};return ns(n,e),$o(n,e),es(n,e),n}function Qo(e){switch(y(e)){case ft:case _t:case vt:case bt:case dt:case mt:case Ot:case kt:case Tt:case Et:case Dt:case ht:case ut:case yt:case ct:case gt:case lt:case pt:case xt:case St:case Ct:case wt:return!0;default:return!1}}function $o(e,t){for(let n in t)Object.hasOwn(t,n)&&(e[n]=t[n])}function es(e,t){let n=Object.getOwnPropertySymbols(t);for(let r=0;r<n.length;r++){let i=n[r];Object.prototype.propertyIsEnumerable.call(t,i)&&(e[i]=t[i])}}function ts(e,t){let n=t.valueOf().length;for(let r in t)Object.hasOwn(t,r)&&(Number.isNaN(Number(r))||Number(r)>=n)&&(e[r]=t[r])}function ns(e,t){let n=Object.getPrototypeOf(t);n!==null&&typeof t.constructor==`function`&&Object.setPrototypeOf(e,n)}function rs(e,t){if(!t)return Zo(e);let n=t(e);return n===void 0?Zo(e):n}function is(e,t){let n=L(e)?Object.create(e):{};if(t!=null){let e=X(t);for(let r=0;r<e.length;r++){let i=e[r],a=t[i];Ma(n,i,a)}}return n}function as(e,...t){e=Object(e);let n=Object.prototype,r=t.length,i=r>2?t[2]:void 0;i&&q(t[0],t[1],i)&&(r=1);for(let i=0;i<r;i++){if(A(t[i]))continue;let r=t[i],a=Object.keys(r);for(let t=0;t<a.length;t++){let i=a[t],o=e[i];(o===void 0||!Object.hasOwn(e,i)&&O(o,n[i]))&&(e[i]=r[i])}}return e}function os(e,...t){e=Object(e);for(let n=0;n<t.length;n++){let r=t[n];r!=null&&ss(e,r,new WeakMap)}return e}function ss(e,t,n){for(let r in t){let i=t[r],a=e[r];if(a===void 0||!Object.hasOwn(e,r)){e[r]=cs(i,n);continue}n.get(i)!==a&&ls(a,i,n)}}function cs(e,t){if(t.has(e))return t.get(e);if(D(e)){let n={};return t.set(e,n),ss(n,e,t),n}return e}function ls(e,t,n){if(D(e)&&D(t)){n.set(t,e),ss(e,t,n);return}Array.isArray(e)&&Array.isArray(t)&&(n.set(t,e),us(e,t,n))}function us(e,t,n){let r=Math.min(t.length,e.length);for(let i=0;i<r;i++)D(e[i])&&D(t[i])&&ss(e[i],t[i],n);for(let n=r;n<t.length;n++)e.push(t[n])}function ds(e){let t=Array(e.size),n=e.keys(),r=e.values();for(let e=0;e<t.length;e++)t[e]=[n.next().value,r.next().value];return t}function fs(e){let t=Array(e.size),n=e.values();for(let e=0;e<t.length;e++){let r=n.next().value;t[e]=[r,r]}return t}function ps(e){if(e==null)return[];if(e instanceof Set)return fs(e);if(e instanceof Map)return ds(e);let t=X(e),n=Array(t.length);for(let r=0;r<t.length;r++){let i=t[r];n[r]=[i,e[i]]}return n}function ms(e){if(e==null)return[];if(e instanceof Set)return fs(e);if(e instanceof Map)return ds(e);let t=Z(e),n=Array(t.length);for(let r=0;r<t.length;r++){let i=t[r];n[r]=[i,e[i]]}return n}function hs(e,t){if(L(e))return Pt(e,z(t??J))}function gs(e,t){if(!L(e))return;let n=z(t??J);return Object.keys(e).findLast(t=>n(e[t],t,e))}function _s(e,t=_){if(e==null)return e;for(let n in e)if(t(e[n],n,e)===!1)break;return e}function vs(e,t=_){if(e==null)return e;let n=[];for(let t in e)n.push(t);for(let r=n.length-1;r>=0;r--){let i=n[r];if(t(e[i],i,e)===!1)break}return e}function ys(e,t=_){if(e==null)return e;let n=Object(e),r=X(e);for(let e=0;e<r.length;++e){let i=r[e];if(t(n[i],i,n)===!1)break}return e}function bs(e,t=_){if(e==null)return e;let n=Object(e),r=X(e);for(let e=r.length-1;e>=0;--e){let i=r[e];if(t(n[i],i,n)===!1)break}return e}function xs(e){if(!M(e))return{};let t={};for(let n=0;n<e.length;n++){let[r,i]=e[n];t[r]=i}return t}function Ss(e){return e==null?[]:X(e).filter(t=>typeof e[t]==`function`)}function Cs(e){if(e==null)return[];let t=[];for(let n in e)k(e[n])&&t.push(n);return t}function ws(e,t){if(e==null)return!1;let n;if(n=Array.isArray(t)?t:typeof t==`string`&&er(t)&&!(t in Object(e))?F(t):[t],n.length===0)return!1;let r=e;for(let e=0;e<n.length;e++){let t=n[e];if((r==null||!(t in Object(r)))&&!((Array.isArray(r)||R(r))&&hr(t)&&t<r.length))return!1;r=r[t]}return!0}function Ts(e){return Lt(e)}function Es(e,t){let n={};if(A(e))return n;t??=_;let r=Object.keys(e),i=z(t);for(let t=0;t<r.length;t++){let a=r[t],o=e[a],s=i(o);Array.isArray(n[s])?n[s].push(a):n[s]=[a]}return n}function Ds(e,t=_){return e==null?{}:Rt(e,z(t))}function Os(e,t=_){return e==null?{}:zt(e,z(t))}function ks(e,...t){let n=t.slice(0,-1),r=t[t.length-1],i=e;for(let e=0;e<n.length;e++){let t=n[e];i=As(i,t,r,new Map)}return i}function As(e,t,n,r){if(v(e)&&(e=Object(e)),typeof t!=`object`||!t)return e;if(r.has(t))return ot(r.get(t));if(r.set(t,e),Array.isArray(t)){t=t.slice();for(let e=0;e<t.length;e++)t[e]=t[e]??void 0}let i=[...Object.keys(t),...st(t)];for(let a=0;a<i.length;a++){let o=i[a];if(w(o))continue;let s=t[o],c=e[o];if(R(s)&&(s={...s}),R(c)&&(c={...c}),b(s)&&(s=pr(s)),Array.isArray(s))if(Array.isArray(c)){let e=[],t=Reflect.ownKeys(c);for(let n=0;n<t.length;n++){let r=t[n];e[r]=c[r]}c=e}else if(V(c)){let e=[];for(let t=0;t<c.length;t++)e[t]=c[t];c=e}else c=[];let l=n(c,s,o,e,t,r);l===void 0?Array.isArray(s)||B(c)&&B(s)&&(D(c)||D(s)||Y(c)||Y(s))?e[o]=As(c,s,n,r):c==null&&D(s)?e[o]=As({},s,n,r):c==null&&Y(s)?e[o]=pr(s):(c===void 0||s!==void 0)&&(e[o]=s):e[o]=l}return e}function js(e,...t){return ks(e,...t,Ue)}function Ms(e){let t=[];for(;e;)t.push(...st(e)),e=Object.getPrototypeOf(e);return t}function Ns(e,...t){if(e==null)return{};t=Kr(t);let n=Ps(e,t);for(let e=0;e<t.length;e++){let r=t[e];switch(typeof r){case`object`:if(Array.isArray(r))bi(n,r);else{let e=Array.from(r);for(let t=0;t<e.length;t++)bi(n,e[t])}break;case`string`:case`symbol`:case`number`:bi(n,r);break}}return n}function Ps(e,t){return t.some(e=>Array.isArray(e)||er(e))?Is(e):Fs(e)}function Fs(e){let t={},n=[...Z(e),...Ms(e)];for(let r=0;r<n.length;r++){let i=n[r];t[i]=e[i]}return t}function Is(e){let t={},n=[...Z(e),...Ms(e)];for(let r=0;r<n.length;r++){let i=n[r];t[i]=fr(e[i],e=>{if(!D(e))return e})}return t}function Ls(e,t){if(e==null)return{};let n={},r=z(t??J),i=[...Z(e),...Ms(e)];for(let t=0;t<i.length;t++){let a=U(i[t])?i[t]:i[t].toString(),o=e[a];r(o,a,e)||(n[a]=o)}return n}function Rs(e,...t){if(Ri(e))return{};let n={};for(let r=0;r<t.length;r++){let i=t[r];switch(typeof i){case`object`:Array.isArray(i)||(i=M(i)?Array.from(i):[i]);break;case`string`:case`symbol`:case`number`:i=[i];break}for(let t of i){let r=I(e,t);r===void 0&&!gr(e,t)||(typeof t==`string`&&Object.hasOwn(e,t)?n[t]=e[t]:Ia(n,t,r))}}return n}function zs(e,t){if(e==null)return{};let n=z(t??J),r={},i=M(e)?it(0,e.length):[...Z(e),...Ms(e)];for(let t=0;t<i.length;t++){let a=U(i[t])?i[t]:i[t].toString(),o=e[a];n(o,a,e)&&(r[a]=o)}return r}function Bs(e){return function(t){return I(e,t)}}function Vs(e,t,n){di(t,e)?t=[t]:Array.isArray(t)||(t=F(P(t)));let r=Math.max(t.length,1);for(let i=0;i<r;i++){let r=e?.[N(t[i])];if(r===void 0)return typeof n==`function`?n.call(e):n;e=typeof r==`function`?r.call(e):r}return e}function Hs(e,t,n,r){let i;return i=typeof r==`function`?r:()=>void 0,Fa(e,t,()=>n,i)}function Us(e,...t){return as(pr(e),...t)}function Ws(e){return b(e)}function Gs(e,t=_,n){let r=Array.isArray(e)||Ws(e)||Y(e);return t=z(t),n??=r?[]:L(e)&&k(e.constructor)?Object.create(Object.getPrototypeOf(e)):{},e==null||Ar(e,(e,r,i)=>t(n,e,r,i)),n}function Ks(e,t,n){return Fa(e,t,n,()=>void 0)}function qs(e){let t=Z(e),n=Array(t.length);for(let r=0;r<t.length;r++)n[r]=e[t[r]];return n}function Js(e){return typeof e==`function`}function Ys(e){return Number.isSafeInteger(e)&&e>=0}let Xs=Function.prototype.toString,Zs=RegExp(`^${Xs.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)}$`);function Qs(e){if(typeof e!=`function`)return!1;if(globalThis?.[`__core-js_shared__`]!=null)throw Error(`Unsupported core-js use. Try https://npms.io/search?q=ponyfill.`);return Zs.test(Xs.call(e))}function $s(e){return e===null}function ec(e){return Dn(e)}function tc(e,t){if(t==null)return!0;if(e==null)return Object.keys(t).length===0;let n=Object.keys(t);for(let r=0;r<n.length;r++){let i=n[r],a=t[i],o=e[i];if(o===void 0&&!(i in e)||typeof a==`function`&&!a(o))return!1}return!0}function nc(e){return e=Mt(e),function(t){return tc(t,e)}}function rc(e){return nn(e)}function ic(e){return typeof e==`boolean`||e instanceof Boolean}function ac(e){return on(e)}function oc(e){return B(e)&&e.nodeType===1&&!D(e)}function sc(e){if(e==null)return!0;if(M(e))return typeof e.splice!=`function`&&typeof e!=`string`&&!b(e)&&!Y(e)&&!R(e)?!1:e.length===0;if(typeof e==`object`||typeof e==`function`){if(e instanceof Map||e instanceof Set)return e.size===0;let t=Object.keys(e);return Pi(e)?t.filter(e=>e!==`constructor`).length===0:t.length===0}return!0}function cc(e,t,n){return typeof n!=`function`&&(n=()=>void 0),cn(e,t,(...r)=>{let i=n(...r);if(i!==void 0)return!!i;if(e instanceof Map&&t instanceof Map||e instanceof Set&&t instanceof Set)return cc(Array.from(e),Array.from(t),Ie(2,n))})}function lc(e){return y(e)===`[object Error]`}function uc(e){return Number.isFinite(e)}function dc(e){return Number.isInteger(e)}function fc(e){return wn(e)}function pc(e){return Number.isSafeInteger(e)}function mc(e){return On(e)}function hc(e){return kn(e)}function gc(e){return Ht(P(e))}function _c(e,...t){if(e==null||!L(e)||E(e)&&t.length===0)return e;let n=[];for(let e=0;e<t.length;e++){let r=t[e];E(r)?n.push(...r):r&&typeof r==`object`&&`length`in r?n.push(...Array.from(r)):n.push(r)}if(n.length===0)return e;for(let t=0;t<n.length;t++){let r=n[t],i=P(r),a=e[i];k(a)&&(e[i]=a.bind(e))}return e}function Q(e){return Fn(P(e))}let vc=`\\p{Lu}`,yc=`\\p{Ll}`,bc=`(?:[\\p{Lm}\\p{Lo}]\\p{M}*)`,xc=`(?:['’](?:d|ll|m|re|s|t|ve))?`,Sc=`(?:['’](?:D|LL|M|RE|S|T|VE))?`,Cc=`[\\p{Z}\\p{P}\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\xd7\\xf7]`,wc=`(?:${vc}|${bc})`,Tc=`(?:${yc}|${bc})`,Ec;function Dc(){return Ec??=RegExp([`${vc}?${yc}+${xc}(?=${Cc}|${vc}|$)`,`${wc}+${Sc}(?=${Cc}|${vc}${Tc}|$)`,`${vc}?${Tc}+${xc}`,`${vc}+${Sc}`,`\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])`,`\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])`,`\\d+`,`\\p{Emoji_Presentation}`,`\\p{Extended_Pictographic}`].join(`|`),`gu`),Ec}function $(e,t,n){let r=P(e);return(n||t===void 0)&&(t=Dc()),typeof t==`number`&&(t=t.toString()),Array.from(r.match(t)??[]).filter(e=>e!==``)}function Oc(e){return typeof e!=`string`&&(e=P(e)),e.replace(/['\u2019]/g,``)}function kc(e){let t=$(Oc(Q(e)));if(t.length===0)return``;let[n,...r]=t;return`${n.toLowerCase()}${r.map(e=>Ht(e)).join(``)}`}function Ac(e,t,n){return e==null||t==null?!1:(n??=e.length,e.endsWith(t,n))}function jc(e){return Ln(P(e))}function Mc(e){return Rn(P(e))}function Nc(e){return $(Oc(Q(e))).map(e=>e.toLowerCase()).join(`-`)}function Pc(e){return $(Oc(Q(e))).map(e=>e.toLowerCase()).join(` `)}function Fc(e){return zn(P(e))}function Ic(e){return Bi.test(e)?Array.from(e).length:e.length}function Lc(e,t){let n=Ic(t);if(n===0||e<1)return``;let r=t.repeat(Math.ceil(e/n));return Bi.test(r)?Array.from(r).slice(0,e).join(``):r.slice(0,e)}function Rc(e,t=0,n=` `){let r=P(e),i=K(t),a=Ic(r);if(i<=a)return r;let o=(i-a)/2,s=`${n}`;return Lc(Math.floor(o),s)+r+Lc(Math.ceil(o),s)}function zc(e,t=0,n=` `){let r=P(e),i=K(t),a=Ic(r);return i<=a?r:r+Lc(i-a,`${n}`)}function Bc(e,t=0,n=` `){let r=P(e),i=K(t),a=Ic(r);return i<=a?r:Lc(i-a,`${n}`)+r}let Vc=2**53-1;function Hc(e,t,n){return t=(n?q(e,t,n):t===void 0)?1:K(t),t<1||t>Vc?``:P(e).repeat(t)}function Uc(e,t,n){return arguments.length<3?P(e):P(e).replace(t,n)}function Wc(e){return $(Oc(Q(e))).map(e=>e.toLowerCase()).join(`_`)}function Gc(e,t,n){return P(e).split(t,n)}function Kc(e){let t=$(Oc(Q(e)).trim()),n=``;for(let e=0;e<t.length;e++){let r=t[e];n&&(n+=` `),r===r.toUpperCase()?n+=r:n+=r[0].toUpperCase()+r.slice(1).toLowerCase()}return n}function qc(e,t,n){return e==null||t==null?!1:(n??=0,e.startsWith(t,n))}let Jc=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Yc=/['\n\r\u2028\u2029\\]/g,Xc=/($^)/,Zc=new Map([[`\\`,`\\`],[`'`,`'`],[`
2
- `,`n`],[`\r`,`r`],[`\u2028`,`u2028`],[`\u2029`,`u2029`]]);function Qc(e){return`\\${Zc.get(e)}`}let $c=/<%=([\s\S]+?)%>/g,el={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:$c,variable:``,imports:{_:{escape:jc,template:tl}}};function tl(e,t,n){e=P(e),n&&q(e,t,n)&&(t=el),t=as({...t},el);let r=new RegExp([t.escape?.source??Xc.source,t.interpolate?.source??Xc.source,t.interpolate===$c?Jc.source:Xc.source,t.evaluate?.source??Xc.source,`$`].join(`|`),`g`),i=0,a=!1,o=`__p += ''`;for(let t of e.matchAll(r)){let[n,r,s,c,l]=t,{index:u}=t;o+=` + '${e.slice(i,u).replace(Yc,Qc)}'`,r&&(o+=` + _.escape(${r})`),s?o+=` + ((${s}) == null ? '' : ${s})`:c&&(o+=` + ((${c}) == null ? '' : ${c})`),l&&(o+=`;\n${l};\n __p += ''`,a=!0),i=u+n.length}let s=as({...t.imports},el.imports),c=Object.keys(s),l=Object.values(s),u=`//# sourceURL=${t.sourceURL?String(t.sourceURL).replace(/[\r\n]/g,` `):`es-toolkit.templateSource[${Date.now()}]`}\n`,d=`function(${t.variable||`obj`}) {
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports):typeof define==`function`&&define.amd?define([`exports`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e._={}))})(this,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(...e){if(e.length===0)return[[]];let t=1;for(let n=0;n<e.length;n++)t*=e[n].length;if(t===0)return[];let n=e.length,r=Array(t);for(let i=0;i<t;i++){let t=Array(n),a=i;for(let r=n-1;r>=0;r--){let n=e[r],i=n.length;t[r]=n[a%i],a=Math.floor(a/i)}r[i]=t}return r}function n(e,t){if(!Number.isInteger(t)||t<=0)throw Error(`Size must be an integer greater than zero.`);let n=Math.ceil(e.length/t),r=Array(n);for(let i=0;i<n;i++){let n=i*t,a=n+t;r[i]=e.slice(n,a)}return r}function r(e,t){let n=[],r;for(let i=0;i<e.length;i++){let a=t(e[i]);i===0||a!==r?n.push([e[i]]):n[n.length-1].push(e[i]),r=a}return n}function i(e,t){if(!Number.isInteger(t)||t<0)throw Error(`r must be a non-negative integer.`);let n=e.length;if(t>n)return[];if(t===0)return[[]];let r=Array(t);for(let e=0;e<t;e++)r[e]=e;let i=[];for(;;){let a=Array(t);for(let n=0;n<t;n++)a[n]=e[r[n]];i.push(a);let o=t-1;for(;o>=0&&r[o]===o+n-t;)o--;if(o<0)return i;r[o]++;for(let e=o+1;e<t;e++)r[e]=r[e-1]+1}}function a(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n];r&&t.push(r)}return t}function o(e,t){let n=new Set(t);return e.filter(e=>!n.has(e))}function s(e,t,n){let r=new Set(t.map(e=>n(e)));return e.filter(e=>!r.has(n(e)))}function c(e,t,n){return e.filter(e=>t.every(t=>!n(e,t)))}function l(e,t){return t=Math.max(t,0),e.slice(t)}function u(e,t){return t=Math.min(-t,0),t===0?e.slice():e.slice(0,t)}function d(e,t){for(let n=e.length-1;n>=0;n--)if(!t(e[n],n,e))return e.slice(0,n+1);return[]}function f(e,t){let n=e.findIndex((e,n,r)=>!t(e,n,r));return n===-1?[]:e.slice(n)}function p(e,t,n=0,r=e.length){let i=e.length,a=Math.max(n>=0?n:i+n,0),o=Math.min(r>=0?r:i+r,i);for(let n=a;n<o;n++)e[n]=t;return e}var m=class{capacity;available;deferredTasks=[];constructor(e){this.capacity=e,this.available=e}async acquire(){if(this.available>0){this.available--;return}return new Promise(e=>{this.deferredTasks.push(e)})}release(){let e=this.deferredTasks.shift();if(e!=null){e();return}this.available<this.capacity&&this.available++}};function h(e,t){let n=new m(t);return async function(...t){try{return await n.acquire(),await e.apply(this,t)}finally{n.release()}}}async function ee(e,t,n){n?.concurrency!=null&&(t=h(t,n.concurrency));let r=await Promise.all(e.map(t));return e.filter((e,t)=>r[t])}function te(e,t=1){let n=[],r=Math.floor(t),i=(e,t)=>{for(let a=0;a<e.length;a++){let o=e[a];Array.isArray(o)&&t<r?i(o,t+1):n.push(o)}};return i(e,0),n}async function ne(e,t,n){return n?.concurrency!=null&&(t=h(t,n.concurrency)),te(await Promise.all(e.map(t)))}async function re(e,t,n){n?.concurrency!=null&&(t=h(t,n.concurrency)),await Promise.all(e.map(t))}function ie(e,t){let n={};for(let r=0;r<e.length;r++){let i=e[r],a=t(i,r,e);Object.hasOwn(n,a)||(n[a]=[]),n[a].push(i)}return n}function ae(e){return e[0]}function oe(e){return e.slice(0,-1)}function se(e,t){let n=new Set(t);return e.filter(e=>n.has(e))}function ce(e,t,n){let r=[],i=new Set(t.map(n));for(let t=0;t<e.length;t++){let a=e[t],o=n(a);i.has(o)&&(r.push(a),i.delete(o))}return r}function le(e,t,n){return e.filter(e=>t.some(t=>n(e,t)))}function ue(e,t){return o(t,e).length===0}function de(e,t,n){return c(t,e,n).length===0}function fe(e){return e[e.length-1]}function pe(e,t,n){return n?.concurrency!=null&&(t=h(t,n.concurrency)),Promise.all(e.map(t))}function me(e,t){let n=new Set(t),r=0;for(let t=0;t<e.length;t++)if(!n.has(e[t])){if(!Object.hasOwn(e,t)){delete e[r++];continue}e[r++]=e[t]}return e.length=r,e}async function he(e,t,n){let r=0;n??(n=e[0],r=1);let i=n;for(let n=r;n<e.length;n++)i=await t(i,e[n],n,e);return i}function ge(e,t){let n=e.slice(),r=[],i=0;for(let a=0;a<e.length;a++){if(t(e[a],a,n)){r.push(e[a]);continue}if(!Object.hasOwn(e,a)){delete e[i++];continue}e[i++]=e[a]}return e.length=i,r}function _e(e){return e[Math.floor(Math.random()*e.length)]}function ve(e,t){if(t??(t=e,e=0),e>=t)throw Error(`Invalid input: The maximum value must be greater than the minimum value.`);return Math.random()*(t-e)+e}function ye(e,t){return Math.floor(ve(e,t))}function be(e,t){if(t>e.length)throw Error(`Size must be less than or equal to the length of array.`);let n=Array(t),r=new Set;for(let i=e.length-t,a=0;i<e.length;i++,a++){let t=ye(0,i+1);r.has(t)&&(t=i),r.add(t),n[a]=e[t]}return n}function xe(e){let t=e.slice();for(let e=t.length-1;e>=1;e--){let n=Math.floor(Math.random()*(e+1));[t[e],t[n]]=[t[n],t[e]]}return t}function Se(e){return e.slice(1)}function Ce(e,t){return e.slice(0,t)}function we(e,t){return t<=0||e.length===0?[]:e.slice(-t)}function Te(e,t,n=0,r=e.length){let i=e.length,a=Math.max(n>=0?n:i+n,0),o=Math.min(r>=0?r:i+r,i),s=e.slice();for(let e=a;e<o;e++)s[e]=t;return s}function g(e){return[...new Set(e)]}function Ee(e,t){let n=new Map;for(let r=0;r<e.length;r++){let i=e[r],a=t(i,r,e);n.has(a)||n.set(a,i)}return Array.from(n.values())}function De(e,t){let n=[];for(let r=0;r<e.length;r++){let i=e[r];n.every(e=>!t(e,i))&&n.push(i)}return n}function Oe(e){let t=0;for(let n=0;n<e.length;n++)e[n].length>t&&(t=e[n].length);let n=Array(t);for(let r=0;r<t;r++){n[r]=Array(e.length);for(let t=0;t<e.length;t++)n[r][t]=e[t][r]}return n}function ke(e,t,n=1,{partialWindows:r=!1}={}){if(t<=0||!Number.isInteger(t))throw Error(`Size must be a positive integer.`);if(n<=0||!Number.isInteger(n))throw Error(`Step must be a positive integer.`);let i=[],a=r?e.length:e.length-t+1;for(let r=0;r<a;r+=n)i.push(e.slice(r,r+t));return i}function Ae(e,...t){return o(e,t)}function je(...e){let t=0;for(let n=0;n<e.length;n++)e[n].length>t&&(t=e[n].length);let n=e.length,r=Array(t);for(let i=0;i<t;++i){let t=Array(n);for(let r=0;r<n;++r)t[r]=e[r][i];r[i]=t}return r}let Me=typeof globalThis==`object`&&globalThis||typeof window==`object`&&window||typeof self==`object`&&self||typeof global==`object`&&global||(function(){return this})(),Ne=Me.DOMException===void 0?Error:Me.DOMException;var Pe=class extends Ne{constructor(e=`The operation was aborted`){super(e)}},Fe=class extends Ne{constructor(e=`The operation was timed out`){super(e)}};function Ie(e,t){if(!Number.isInteger(e)||e<0)throw Error(`n must be a non-negative integer.`);let n=0;return(...r)=>{if(++n>=e)return t(...r)}}function Le(e,t){return function(...n){return e.apply(this,n.slice(0,t))}}async function Re(){}function ze(e,t,{signal:n,edges:r}={}){let i,a=null,o=r!=null&&r.includes(`leading`),s=r==null||r.includes(`trailing`),c=()=>{a!==null&&(e.apply(i,a),i=void 0,a=null)},l=()=>{s&&c(),p()},u=null,d=()=>{u!=null&&clearTimeout(u),u=setTimeout(()=>{u=null,l()},t)},f=()=>{u!==null&&(clearTimeout(u),u=null)},p=()=>{f(),i=void 0,a=null},m=()=>{c()},h=function(...e){if(n?.aborted)return;i=this,a=e;let t=u==null;d(),o&&t&&c()};return h.schedule=d,h.cancel=p,h.flush=m,n?.addEventListener(`abort`,p,{once:!0}),h}function Be(...e){return function(...t){let n=e.length?e[0].apply(this,t):t[0];for(let t=1;t<e.length;t++)n=e[t].call(this,n);return n}}function Ve(...e){return Be(...e.reverse())}function _(e){return e}function He(e){return((...t)=>!e(...t))}function Ue(){}function We(e){let t=!1,n;return function(...r){return t||(t=!0,n=e(...r)),n}}function Ge(e,...t){return Ke(e,qe,...t)}function Ke(e,t,...n){let r=function(...r){let i=0,a=n.slice().map(e=>e===t?r[i++]:e),o=r.slice(i);return e.apply(this,a.concat(o))};return e.prototype&&(r.prototype=Object.create(e.prototype)),r}let qe=Symbol(`partial.placeholder`);Ge.placeholder=qe;function Je(e,...t){return Ye(e,Xe,...t)}function Ye(e,t,...n){let r=function(...r){let i=n.filter(e=>e===t).length,a=Math.max(r.length-i,0),o=r.slice(0,a),s=a,c=n.slice().map(e=>e===t?r[s++]:e);return e.apply(this,o.concat(c))};return e.prototype&&(r.prototype=Object.create(e.prototype)),r}let Xe=Symbol(`partialRight.placeholder`);Je.placeholder=Xe;function Ze(e,t=e.length-1){return function(...n){let r=n.slice(t),i=n.slice(0,t);for(;i.length<t;)i.push(void 0);return e.apply(this,[...i,r])}}function Qe(e,{signal:t}={}){return new Promise((n,r)=>{let i=()=>{r(new Pe)},a=()=>{clearTimeout(o),i()};if(t?.aborted)return i();let o=setTimeout(()=>{t?.removeEventListener(`abort`,a),n()},e);t?.addEventListener(`abort`,a,{once:!0})})}let $e=()=>!0;async function et(e,t){let n,r,i,a;typeof t==`number`?(n=0,r=t,i=void 0,a=$e):(n=t?.delay??0,r=t?.retries??1/0,i=t?.signal,a=t?.shouldRetry??$e);let o;for(let t=0;t<=r;t++){if(i?.aborted)throw o??Error(`The retry operation was aborted due to an abort signal.`);try{return await e()}catch(e){if(o=e,!a(e,t))throw e;t<r&&await Qe(typeof n==`function`?n(t,o):n)}}throw o}function tt(e){if(e.length===0)return NaN;let t=e.slice().sort((e,t)=>e-t),n=Math.floor(t.length/2);return t.length%2==0?(t[n-1]+t[n])/2:t[n]}function nt(e,t){return tt(e.map(e=>t(e)))}function rt(e,t){if(Number.isNaN(Number(t)))throw Error(`Expected percentile to be a number but got "${t}".`);if(t<0)throw Error(`Expected percentile to be >= 0 but got "${t}".`);if(t>100)throw Error(`Expected percentile to be <= 100 but got "${t}".`);if(e.length===0)return NaN;let n=e.slice().sort((e,t)=>(Number.isNaN(e)?-1/0:e)-(Number.isNaN(t)?-1/0:t));return t===0?n[0]:n[Math.ceil(n.length*(t/100))-1]}function it(e,t,n=1){if(t??(t=e,e=0),!Number.isInteger(n)||n===0)throw Error(`The step value must be a non-zero integer.`);let r=Math.max(Math.ceil((t-e)/n),0),i=Array(r);for(let t=0;t<r;t++)i[t]=e+t*n;return i}function at(e){return e==null||typeof e!=`object`&&typeof e!=`function`}function ot(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function st(e){if(at(e))return e;if(Array.isArray(e)||ot(e)||e instanceof ArrayBuffer||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer)return e.slice(0);let t=Object.getPrototypeOf(e);if(t==null)return Object.assign(Object.create(t),e);let n=t.constructor;if(e instanceof Date||e instanceof Map||e instanceof Set)return new n(e);if(e instanceof RegExp){let t=new n(e);return t.lastIndex=e.lastIndex,t}if(e instanceof DataView)return new n(e.buffer.slice(0));if(e instanceof Error){let t;return t=e instanceof AggregateError?new n(e.errors,e.message,{cause:e.cause}):new n(e.message,{cause:e.cause}),t.stack=e.stack,Object.assign(t,e),t}return typeof File<`u`&&e instanceof File?new n([e],e.name,{type:e.type,lastModified:e.lastModified}):typeof e==`object`?Object.assign(Object.create(t),e):e}function ct(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function v(e){return e==null?e===void 0?`[object Undefined]`:`[object Null]`:Object.prototype.toString.call(e)}let lt=`[object RegExp]`,ut=`[object String]`,dt=`[object Number]`,ft=`[object Boolean]`,pt=`[object Arguments]`,mt=`[object Symbol]`,ht=`[object Date]`,gt=`[object Map]`,_t=`[object Set]`,vt=`[object Array]`,yt=`[object ArrayBuffer]`,bt=`[object Object]`,xt=`[object DataView]`,St=`[object Uint8Array]`,Ct=`[object Uint8ClampedArray]`,wt=`[object Uint16Array]`,Tt=`[object Uint32Array]`,Et=`[object Int8Array]`,Dt=`[object Int16Array]`,Ot=`[object Int32Array]`,kt=`[object Float32Array]`,At=`[object Float64Array]`;function y(e){return Me.Buffer!==void 0&&Me.Buffer.isBuffer(e)}function jt(e,t){return b(e,void 0,e,new Map,t)}function b(e,t,n,r=new Map,i=void 0){let a=i?.(e,t,n,r);if(a!==void 0)return a;if(at(e))return e;if(r.has(e))return r.get(e);if(Array.isArray(e)){let t=Array(e.length);r.set(e,t);for(let a=0;a<e.length;a++)t[a]=b(e[a],a,n,r,i);return Object.hasOwn(e,`index`)&&(t.index=e.index),Object.hasOwn(e,`input`)&&(t.input=e.input),t}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){let t=new RegExp(e.source,e.flags);return t.lastIndex=e.lastIndex,t}if(e instanceof Map){let t=new Map;r.set(e,t);for(let[a,o]of e)t.set(a,b(o,a,n,r,i));return t}if(e instanceof Set){let t=new Set;r.set(e,t);for(let a of e)t.add(b(a,void 0,n,r,i));return t}if(y(e))return e.subarray();if(ot(e)){let t=new(Object.getPrototypeOf(e)).constructor(e.length);r.set(e,t);for(let a=0;a<e.length;a++)t[a]=b(e[a],a,n,r,i);return t}if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){let t=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return r.set(e,t),x(t,e,n,r,i),t}if(typeof File<`u`&&e instanceof File){let t=new File([e],e.name,{type:e.type});return r.set(e,t),x(t,e,n,r,i),t}if(typeof Blob<`u`&&e instanceof Blob){let t=new Blob([e],{type:e.type});return r.set(e,t),x(t,e,n,r,i),t}if(e instanceof Error){let t=structuredClone(e);return r.set(e,t),t.message=e.message,t.name=e.name,t.stack=e.stack,t.cause=e.cause,t.constructor=e.constructor,x(t,e,n,r,i),t}if(e instanceof Boolean){let t=new Boolean(e.valueOf());return r.set(e,t),x(t,e,n,r,i),t}if(e instanceof Number){let t=new Number(e.valueOf());return r.set(e,t),x(t,e,n,r,i),t}if(e instanceof String){let t=new String(e.valueOf());return r.set(e,t),x(t,e,n,r,i),t}if(typeof e==`object`&&Mt(e)){let t=Object.create(Object.getPrototypeOf(e));return r.set(e,t),x(t,e,n,r,i),t}return e}function x(e,t,n=e,r,i){let a=[...Object.keys(t),...ct(t)];for(let o=0;o<a.length;o++){let s=a[o],c=Object.getOwnPropertyDescriptor(e,s);(c==null||c.writable)&&(e[s]=b(t[s],s,n,r,i))}}function Mt(e){switch(v(e)){case pt:case vt:case yt:case xt:case ft:case ht:case kt:case At:case Et:case Dt:case Ot:case gt:case dt:case bt:case lt:case _t:case ut:case mt:case St:case Ct:case wt:case Tt:return!0;default:return!1}}function Nt(e){return b(e,void 0,e,new Map,void 0)}function Pt(e){if(typeof e!=`object`||!e)return e;Object.freeze(e);let t=Object.keys(e);for(let n=0;n<t.length;n++){let r=e[t[n]];typeof r==`object`&&r&&!Object.isFrozen(r)&&Pt(r)}return e}function Ft(e,t){return Object.keys(e).find(n=>t(e[n],n,e))}function S(e){if(!e||typeof e!=`object`)return!1;let t=Object.getPrototypeOf(e);return t===null||t===Object.prototype||Object.getPrototypeOf(t)===null?Object.prototype.toString.call(e)===`[object Object]`:!1}function It(e,{delimiter:t=`.`,preserveArrays:n=!1}={}){return Lt(e,``,t,n)}function Lt(e,t,n,r){let i={},a=Object.keys(e);for(let o=0;o<a.length;o++){let s=a[o],c=e[s],l=t?`${t}${n}${s}`:s;if(S(c)&&Object.keys(c).length>0){Object.assign(i,Lt(c,l,n,r));continue}if(Array.isArray(c)&&!r&&c.length>0){Object.assign(i,Lt(c,l,n,r));continue}i[l]=c}return i}function Rt(e){let t={},n=Object.keys(e);for(let r=0;r<n.length;r++){let i=n[r],a=e[i];t[a]=i}return t}function zt(e,t){let n={},r=Object.keys(e);for(let i=0;i<r.length;i++){let a=r[i],o=e[a];n[t(o,a,e)]=o}return n}async function Bt(e,t,n){let r={},i=Object.keys(e);return n?.concurrency&&(t=h(t,n.concurrency)),await Promise.all(i.map(async n=>{let i=e[n];r[await t(i,n,e)]=i})),r}function Vt(e,t){let n={},r=Object.keys(e);for(let i=0;i<r.length;i++){let a=r[i],o=e[a];n[a]=t(o,a,e)}return n}async function Ht(e,t,n){let r={},i=Object.keys(e);return n?.concurrency&&(t=h(t,n.concurrency)),await Promise.all(i.map(async n=>{r[n]=await t(e[n],n,e)})),r}function Ut(e){return S(e)||Array.isArray(e)}function C(e){return e===`__proto__`}function w(e,t,n){let r=Object.keys(t);for(let i=0;i<r.length;i++){let a=r[i];if(C(a))continue;let o=t[a],s=e[a],c=n(s,o,a,e,t);c===void 0?Ut(o)&&Ut(s)?e[a]=w(s,o,n):Array.isArray(o)?e[a]=w([],o,n):S(o)?e[a]=w({},o,n):(s===void 0||o!==void 0)&&(e[a]=o):e[a]=c}return e}function Wt(e,t){let n=Object.keys(e).sort(t),r={};for(let t=0;t<n.length;t++){let i=n[t];r[i]=e[i]}return r}function T(e){return Array.isArray(e)}function Gt(e){return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}let Kt=/\p{Lu}?\p{Ll}+|[0-9]+|\p{Lu}+(?!\p{Ll})|\p{Emoji_Presentation}|\p{Extended_Pictographic}|\p{L}+/gu;function qt(e){return Array.from(e.match(Kt)??[])}function Jt(e){let t=qt(e);if(t.length===0)return``;let[n,...r]=t;return`${n.toLowerCase()}${r.map(e=>Gt(e)).join(``)}`}function Yt(e){if(T(e))return e.map(e=>Yt(e));if(S(e)){let t={},n=Object.keys(e);for(let r=0;r<n.length;r++){let i=n[r],a=Jt(i);t[a]=Yt(e[i])}return t}return e}function E(e){if(typeof e!=`object`||!e)return!1;if(Object.getPrototypeOf(e)===null)return!0;if(Object.prototype.toString.call(e)!==`[object Object]`){let t=e[Symbol.toStringTag];return t==null||!Object.getOwnPropertyDescriptor(e,Symbol.toStringTag)?.writable?!1:e.toString()===`[object ${t}]`}let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function Xt(e){return qt(e).map(e=>e.toUpperCase()).join(`_`)}function Zt(e){if(T(e))return e.map(e=>Zt(e));if(E(e)){let t={},n=Object.keys(e);for(let r=0;r<n.length;r++){let i=n[r],a=Xt(i);t[a]=Zt(e[i])}return t}return e}function Qt(e){return qt(e).map(e=>e.toLowerCase()).join(`-`)}function $t(e){if(T(e))return e.map(e=>$t(e));if(E(e)){let t={},n=Object.keys(e);for(let r=0;r<n.length;r++){let i=n[r],a=Qt(i);t[a]=$t(e[i])}return t}return e}function en(e,t){return w(Nt(e),t,function e(t,n){if(Ut(n)&&Ut(t))return w(st(t),n,e);if(Array.isArray(n))return w([],n,e);if(S(n))return w({},n,e)})}function tn(e){return qt(e).map(e=>Gt(e)).join(``)}function nn(e){if(T(e))return e.map(e=>nn(e));if(E(e)){let t={},n=Object.keys(e);for(let r=0;r<n.length;r++){let i=n[r],a=tn(i);t[a]=nn(e[i])}return t}return e}function rn(e){return qt(e).map(e=>e.toLowerCase()).join(`_`)}function an(e){if(T(e))return e.map(e=>an(e));if(E(e)){let t={},n=Object.keys(e);for(let r=0;r<n.length;r++){let i=n[r],a=rn(i);t[a]=an(e[i])}return t}return e}function on(e){return e instanceof ArrayBuffer}function sn(e){return typeof Blob>`u`?!1:e instanceof Blob}function cn(){return typeof window<`u`&&window?.document!=null}function ln(e){return e instanceof Date}function un(e){return S(e)&&Object.keys(e).length===0}function D(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}function dn(e,t,n){return fn(e,t,void 0,void 0,void 0,void 0,n)}function fn(e,t,n,r,i,a,o){let s=o(e,t,n,r,i,a);if(s!==void 0)return s;if(typeof e==typeof t)switch(typeof e){case`bigint`:case`string`:case`boolean`:case`symbol`:case`undefined`:return e===t;case`number`:return e===t||Object.is(e,t);case`function`:return e===t;case`object`:return pn(e,t,a,o)}return pn(e,t,a,o)}function pn(e,t,n,r){if(Object.is(e,t))return!0;let i=v(e),a=v(t);if(i===`[object Arguments]`&&(i=bt),a===`[object Arguments]`&&(a=bt),i!==a)return!1;switch(i){case ut:return e.toString()===t.toString();case dt:return D(e.valueOf(),t.valueOf());case ft:case ht:case mt:return Object.is(e.valueOf(),t.valueOf());case lt:return e.source===t.source&&e.flags===t.flags;case`[object Function]`:return e===t}n??=new Map;let o=n.get(e),s=n.get(t);if(o!=null&&s!=null)return o===t;n.set(e,t),n.set(t,e);try{switch(i){case gt:if(e.size!==t.size)return!1;for(let[i,a]of e.entries())if(!t.has(i)||!fn(a,t.get(i),i,e,t,n,r))return!1;return!0;case _t:{if(e.size!==t.size)return!1;let i=Array.from(e.values()),a=Array.from(t.values());for(let o=0;o<i.length;o++){let s=i[o],c=a.findIndex(i=>fn(s,i,void 0,e,t,n,r));if(c===-1)return!1;a.splice(c,1)}return!0}case vt:case St:case Ct:case wt:case Tt:case`[object BigUint64Array]`:case Et:case Dt:case Ot:case`[object BigInt64Array]`:case kt:case At:if(y(e)!==y(t)||e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(!fn(e[i],t[i],i,e,t,n,r))return!1;return!0;case yt:return e.byteLength===t.byteLength?pn(new Uint8Array(e),new Uint8Array(t),n,r):!1;case xt:return e.byteLength!==t.byteLength||e.byteOffset!==t.byteOffset?!1:pn(new Uint8Array(e),new Uint8Array(t),n,r);case`[object Error]`:return e.name===t.name&&e.message===t.message;case bt:{if(!(pn(e.constructor,t.constructor,n,r)||S(e)&&S(t)))return!1;let i=[...Object.keys(e),...ct(e)],a=[...Object.keys(t),...ct(t)];if(i.length!==a.length)return!1;for(let a=0;a<i.length;a++){let o=i[a],s=e[o];if(!Object.hasOwn(t,o))return!1;let c=t[o];if(!fn(s,c,o,e,t,n,r))return!1}return!0}default:return!1}}finally{n.delete(e),n.delete(t)}}function mn(e,t){return dn(e,t,Ue)}function hn(e){return typeof File>`u`?!1:sn(e)&&e instanceof File}function O(e){return typeof e==`function`}function gn(e){return e!=null&&typeof e[Symbol.iterator]==`function`}function _n(e){if(typeof e!=`string`)return!1;try{return JSON.parse(e),!0}catch{return!1}}function vn(e){switch(typeof e){case`object`:return e===null||yn(e)||bn(e);case`string`:case`number`:case`boolean`:return!0;default:return!1}}function yn(e){return Array.isArray(e)?e.every(e=>vn(e)):!1}function bn(e){if(!S(e))return!1;let t=Reflect.ownKeys(e);for(let n=0;n<t.length;n++){let r=t[n],i=e[r];if(typeof r!=`string`||!vn(i))return!1}return!0}function xn(e){return Number.isSafeInteger(e)&&e>=0}function Sn(e){return e instanceof Map}function k(e){return e==null}function Cn(){return typeof process<`u`&&process?.versions?.node!=null}function wn(e){return e!=null}function Tn(e){return e===null}function En(e){return e instanceof Promise}function Dn(e){return e instanceof RegExp}function On(e){return e instanceof Set}function kn(e){return typeof e==`symbol`}function An(e){return e===void 0}function jn(e){return e instanceof WeakMap}function Mn(e){return e instanceof WeakSet}async function Nn(e){let t=Object.keys(e),n=await Promise.all(t.map(t=>e[t])),r={};for(let e=0;e<t.length;e++)r[t[e]]=n[e];return r}var Pn=class{semaphore=new m(1);get isLocked(){return this.semaphore.available===0}async acquire(){return this.semaphore.acquire()}release(){this.semaphore.release()}};function Fn(e,{signal:t}={}){return new Promise((n,r)=>{let i=()=>{clearTimeout(a)};if(t?.aborted)return;let a=setTimeout(()=>{t?.removeEventListener(`abort`,i),r(new Fe)},e);t?.addEventListener(`abort`,i,{once:!0})})}async function In(e,t,{signal:n}={}){return Promise.race([e(),Fn(t,{signal:n})])}let Ln=new Map([[`Æ`,`Ae`],[`Ð`,`D`],[`Ø`,`O`],[`Þ`,`Th`],[`ß`,`ss`],[`æ`,`ae`],[`ð`,`d`],[`ø`,`o`],[`þ`,`th`],[`Đ`,`D`],[`đ`,`d`],[`Ħ`,`H`],[`ħ`,`h`],[`ı`,`i`],[`IJ`,`IJ`],[`ij`,`ij`],[`ĸ`,`k`],[`Ŀ`,`L`],[`ŀ`,`l`],[`Ł`,`L`],[`ł`,`l`],[`ʼn`,`'n`],[`Ŋ`,`N`],[`ŋ`,`n`],[`Œ`,`Oe`],[`œ`,`oe`],[`Ŧ`,`T`],[`ŧ`,`t`],[`ſ`,`s`]]);function Rn(e){e=e.normalize(`NFD`);let t=``;for(let n=0;n<e.length;n++){let r=e[n];r>=`̀`&&r<=`ͯ`||r>=`⃐`&&r<=`⃿`||r>=`︠`&&r<=`︯`||(t+=Ln.get(r)??r)}return t}let zn={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`};function Bn(e){return e.replace(/[&<>"']/g,e=>zn[e])}function Vn(e){return e.replace(/[\\^$.*+?()[\]{}|]/g,`\\$&`)}function Hn(e){return e.substring(0,1).toLowerCase()+e.substring(1)}function Un(e){return[...e].reverse().join(``)}function Wn(e,t){if(t===void 0)return e.trimEnd();let n=e.length;switch(typeof t){case`string`:if(t.length!==1)throw Error(`The 'chars' parameter should be a single character string.`);for(;n>0&&e[n-1]===t;)n--;break;case`object`:for(;n>0&&t.includes(e[n-1]);)n--}return e.substring(0,n)}function Gn(e,t){if(t===void 0)return e.trimStart();let n=0;switch(typeof t){case`string`:if(t.length!==1)throw Error(`The 'chars' parameter should be a single character string.`);for(;n<e.length&&e[n]===t;)n++;break;case`object`:for(;n<e.length&&t.includes(e[n]);)n++}return e.substring(n)}function Kn(e,t){return t===void 0?e.trim():Gn(Wn(e,t),t)}let qn={"&amp;":`&`,"&lt;":`<`,"&gt;":`>`,"&quot;":`"`,"&#39;":`'`};function Jn(e){return e.replace(/&(?:amp|lt|gt|quot|#(0+)?39);/g,e=>qn[e]||`'`)}function Yn(e){return e.substring(0,1).toUpperCase()+e.substring(1)}async function Xn(e){try{return[null,await e()]}catch(e){return[e,null]}}function Zn(e,t){if(!e)throw typeof t==`string`?Error(t):t}function Qn(e){return arguments.length===0?[]:Array.isArray(e)?e:[e]}function A(e){return Array.isArray(e)?e:Array.from(e)}function j(e){return e!=null&&typeof e!=`function`&&xn(e.length)}function $n(e,t=1){if(t=Math.max(Math.floor(t),0),t===0||!j(e)||Number.isNaN(t))return[];let r=A(e);return r.length===0?[]:isFinite(t)?n(r,t):[r]}function er(e){return j(e)?a(Array.from(e)):[]}function tr(...e){return te(e)}let nr=/\.|(\[(?:[^[\]]*|(["'])(?:(?!\2)[^\\]|\\.)*?\2)\])/;function rr(e){switch(typeof e){case`number`:case`symbol`:return!1;case`string`:return e===``||e.startsWith(`.`)||e.endsWith(`.`)?!1:nr.test(e);default:return!1}}function M(e){return typeof e==`string`||typeof e==`symbol`?e:Object.is(e?.valueOf?.(),-0)?`-0`:String(e)}function N(e){return e==null?``:ir(e)}function ir(e){if(typeof e==`string`)return e;if(Array.isArray(e))return e.map(ir).join(`,`);let t=String(e);return t===`0`&&Object.is(Number(e),-0)?`-0`:t}function P(e){if(Array.isArray(e))return e.map(M);if(typeof e==`symbol`)return[e];e=N(e);let t=[],n=e.length;if(n===0)return t;let r=0,i=``,a=``,o=!1,s=!1,c=/^-?\d+(?:\.\d+)?$/;for(e.charCodeAt(0)===46&&t.push(``);r<n;){let l=e[r];if(a)l===`\\`&&r+1<n?(r++,i+=e[r]):l===a?a=``:i+=l;else if(o)if(l===`"`||l===`'`)a=l,s=!0;else if(l===`]`){if(o=!1,!s&&i.includes(`.`)&&!c.test(i)){let e=i.split(`.`);for(let n=0;n<e.length;n++)e[n]!==``&&t.push(e[n])}else t.push(i);i=``}else i+=l;else if(l===`[`)o=!0,s=!1,i&&=(t.push(i),``);else if(l===`.`){i&&=(t.push(i),``);let n=e[r+1];(n===void 0||n===`.`)&&t.push(``)}else i+=l;r++}return i&&t.push(i),t}function F(e,t,n){if(e==null)return n;switch(typeof t){case`string`:{if(C(t))return n;let r=e[t];return r===void 0?rr(t)&&!Object.hasOwn(e,t)?F(e,P(t),n):n:r}case`number`:case`symbol`:{typeof t==`number`&&(t=M(t));let r=e[t];return r===void 0?n:r}default:{if(Array.isArray(t))return ar(e,t,n);if(t=Object.is(t?.valueOf(),-0)?`-0`:String(t),C(t))return n;let r=e[t];return r===void 0?n:r}}}function ar(e,t,n){if(t.length===0)return n;let r=e;for(let e=0;e<t.length;e++){if(r==null||C(t[e]))return n;r=r[t[e]]}return r===void 0?n:r}function or(e){return function(t){return F(t,e)}}function I(e){return e!==null&&(typeof e==`object`||typeof e==`function`)}function sr(e,t,n){return typeof n==`function`?cr(e,t,function e(t,r,i,a,o,s){let c=n(t,r,i,a,o,s);return c===void 0?cr(t,r,e,s,!1):!!c},new Map,!0):sr(e,t,()=>void 0)}function cr(e,t,n,r,i=!1){if(t===e)return!0;switch(typeof t){case`object`:return lr(e,t,n,r,i);case`function`:return Object.keys(t).length>0?cr(e,{...t},n,r,i):D(e,t);default:return I(e)&&i?typeof t==`string`?t===``:!0:D(e,t)}}function lr(e,t,n,r,i=!1){if(t==null)return!0;if(Array.isArray(t))return dr(e,t,n,r);if(t instanceof Map)return ur(e,t,n,r);if(t instanceof Set)return fr(e,t,n,r);let a=Object.keys(t);if(e==null)return i&&a.length===0;if(i)at(e)&&(e=Object(e));else{let t=v(e);if(t!==`[object Object]`&&t!==`[object Arguments]`)return!1}if(a.length===0)return!0;if(r?.has(t))return r.get(t)===e;r?.set(t,e);try{for(let i=0;i<a.length;i++){let o=a[i];if(!(o in e)||t[o]===void 0&&e[o]!==void 0||t[o]===null&&e[o]!==null||!n(e[o],t[o],o,e,t,r))return!1}return!0}finally{r?.delete(t)}}function ur(e,t,n,r){if(t.size===0)return!0;if(!(e instanceof Map))return!1;for(let[i,a]of t.entries())if(n(e.get(i),a,i,e,t,r)===!1)return!1;return!0}function dr(e,t,n,r){if(t.length===0)return!0;if(!Array.isArray(e))return!1;let i=new Set;for(let a=0;a<t.length;a++){let o=t[a],s=!1;for(let c=0;c<e.length;c++){if(i.has(c))continue;let l=e[c],u=!1;if(n(l,o,a,e,t,r)&&(u=!0),u){i.add(c),s=!0;break}}if(!s)return!1}return!0}function fr(e,t,n,r){return t.size===0?!0:e instanceof Set?dr([...e],[...t],n,r):!1}function pr(e,t){return sr(e,t,()=>void 0)}function L(e){return e=Nt(e),t=>pr(t,e)}function mr(e,t){return jt(e,(n,r,i,a)=>{let o=t?.(n,r,i,a);if(o!==void 0)return o;if(typeof e==`object`){if(v(e)===`[object Object]`&&typeof e.constructor!=`function`){let t={};return a.set(e,t),x(t,e,i,a),t}switch(Object.prototype.toString.call(e)){case dt:case ut:case ft:{let t=new e.constructor(e?.valueOf());return x(t,e),t}case pt:{let t={};return x(t,e),t.length=e.length,t[Symbol.iterator]=e[Symbol.iterator],t}default:return}}})}function hr(e){return mr(e)}let gr=/^(?:0|[1-9]\d*)$/;function _r(e,t=2**53-1){switch(typeof e){case`number`:return Number.isInteger(e)&&e>=0&&e<t;case`symbol`:return!1;case`string`:return gr.test(e)}}function R(e){return typeof e==`object`&&!!e&&v(e)===`[object Arguments]`}function vr(e,t){let n;if(n=Array.isArray(t)?t:typeof t==`string`&&rr(t)&&!(t in Object(e))?P(t):[t],n.length===0)return!1;let r=e;for(let e=0;e<n.length;e++){let t=n[e];if((r==null||!Object.hasOwn(r,t))&&!((Array.isArray(r)||R(r))&&_r(t)&&t<r.length))return!1;r=r[t]}return!0}function yr(e,t){switch(typeof e){case`object`:Object.is(e?.valueOf(),-0)&&(e=`-0`);break;case`number`:e=M(e);break}return t=hr(t),function(n){let r=F(n,e);return r===void 0?vr(n,e):t===void 0?r===void 0:pr(r,t)}}function z(e){if(e==null)return _;switch(typeof e){case`function`:return e;case`object`:return Array.isArray(e)&&e.length===2?yr(e[0],e[1]):L(e);default:return or(e)}}function br(e,t){if(e==null)return{};let n=j(e)?Array.from(e):Object.values(e),r=z(t??void 0),i=Object.create(null);for(let e=0;e<n.length;e++){let t=n[e],a=r(t);i[a]=(i[a]??0)+1}return i}function xr(e){return e===0?0:e}function B(e){return typeof e==`object`&&!!e}function V(e){return B(e)&&j(e)}function Sr(e,...t){if(!V(e))return[];let n=Array.from(e),r=[];for(let e=0;e<t.length;e++){let n=t[e];V(n)&&r.push(...Array.from(n))}return o(n,r).map(xr)}function H(e){if(!(!j(e)||e.length===0))return fe(A(e))}function Cr(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n];if(V(r))for(let e=0;e<r.length;e++)t.push(r[e])}return t}function wr(e,...t){if(!V(e))return[];let n=H(t),r=Cr(t);return V(n)?o(Array.from(e),r).map(xr):s(Array.from(e),r,z(n)).map(xr)}function Tr(e,...t){if(!V(e))return[];let n=H(t),r=Cr(t);return typeof n==`function`?c(Array.from(e),r,n):o(Array.from(e),r)}function U(e){return typeof e==`symbol`||e instanceof Symbol}function W(e){return U(e)?NaN:Number(e)}function G(e){return e?(e=W(e),e===1/0||e===-1/0?(e<0?-1:1)*Number.MAX_VALUE:e===e?e:0):e===0?e:0}function K(e){let t=G(e),n=t%1;return n?t-n:t}function Er(e,t=1,n){return j(e)?(t=n?1:K(t),l(A(e),t)):[]}function Dr(e,t=1,n){return j(e)?(t=n?1:K(t),u(A(e),t)):[]}function Or(e,t=_){return j(e)?kr(A(e),t):[]}function kr(e,t){switch(typeof t){case`function`:return d(e,(e,n,r)=>!!t(e,n,r));case`object`:if(Array.isArray(t)&&t.length===2){let n=t[0],r=t[1];return d(e,yr(n,r))}else return d(e,L(t));case`symbol`:case`number`:case`string`:return d(e,or(t))}}function Ar(e,t=_){return j(e)?jr(A(e),t):[]}function jr(e,t){switch(typeof t){case`function`:return f(e,(e,n,r)=>!!t(e,n,r));case`object`:if(Array.isArray(t)&&t.length===2){let n=t[0],r=t[1];return f(e,yr(n,r))}else return f(e,L(t));case`number`:case`symbol`:case`string`:return f(e,or(t))}}function Mr(e,t=_){if(!e)return e;let n=j(e)?it(0,e.length):Object.keys(e);for(let r=0;r<n.length;r++){let i=n[r],a=e[i];if(t(a,i,e)===!1)break}return e}function Nr(e,t=_){if(!e)return e;let n=j(e)?it(0,e.length):Object.keys(e);for(let r=n.length-1;r>=0;r--){let i=n[r],a=e[i];if(t(a,i,e)===!1)break}return e}function q(e,t,n){return I(n)&&(typeof t==`number`&&j(n)&&_r(t)&&t<n.length||typeof t==`string`&&t in n)?D(n[t],e):!1}function Pr(e){return typeof e==`string`||e instanceof String}function Fr(e,t,n=0,r=e?e.length:0){return j(e)?Pr(e)?e:(n&&typeof n!=`number`&&q(e,t,n)&&(n=0,r=e.length),n=K(n),r=K(r),n||=0,r||=0,p(e,t,n,r)):[]}function Ir(e,t=_){if(!e)return[];if(t=z(t),!Array.isArray(e)){let n=[],r=Object.keys(e),i=j(e)?e.length:r.length;for(let a=0;a<i;a++){let i=r[a],o=e[i];t(o,i,e)&&n.push(o)}return n}let n=[],r=e.length;for(let i=0;i<r;i++){let r=e[i];t(r,i,e)&&n.push(r)}return n}function Lr(e,t=_,n=0){if(!e)return;n=K(n),n<0&&(n=Math.max(e.length+n,0));let r=z(t);if(!Array.isArray(e)){let t=Object.keys(e);for(let i=n;i<t.length;i++){let n=t[i],a=e[n];if(r(a,n,e))return a}return}return e.slice(n).find(r)}function J(e){return e}function Rr(e,t=J,n=0){if(!e)return-1;n=K(n),n<0&&(n=Math.max(e.length+n,0));let r=Array.from(e).slice(n),i=z(t),a=r.findIndex(i);return a===-1?-1:a+n}function zr(e,t=_,n){if(!e)return;let r=Array.isArray(e)?e.length:Object.keys(e).length;n=K(n??r-1),n=n<0?Math.max(r+n,0):Math.min(n,r-1);let i=z(t);if(!Array.isArray(e)){let t=Object.keys(e);for(let r=n;r>=0;r--){let n=t[r],a=e[n];if(i(a,n,e))return a}return}return e.slice(0,n+1).findLast(i)}function Br(e,t=_,n=e?e.length-1:0){if(!e)return-1;Number.isNaN(n)&&(n=0),n=n<0?Math.max(e.length+n,0):Math.min(n,e.length-1);let r=A(e).slice(0,n+1);switch(typeof t){case`function`:return r.findLastIndex(t);case`object`:if(Array.isArray(t)&&t.length===2){let e=t[0],n=t[1];return r.findLastIndex(yr(e,n))}else return r.findLastIndex(L(t));case`number`:case`symbol`:case`string`:return r.findLastIndex(or(t))}}function Vr(e){if(j(e))return ae(A(e))}function Hr(e,t=1){if(!j(e))return[];let n=[],r=Math.floor(t),i=(e,t)=>{for(let a=0;a<e.length;a++){let o=e[a];Ur(o)&&t<r?i(o,t+1):n.push(o)}};return i(Array.from(e),0),n}function Ur(e){return T(e)||R(e)||!!(e&&e[Symbol.isConcatSpreadable])}function Wr(e,t=_){if(!e)return[];let n=j(e)?it(0,e.length):Object.keys(e),r=z(t),i=Array(n.length);for(let t=0;t<n.length;t++){let a=n[t],o=e[a];i[t]=r(o,a,e)}return i}function Gr(e,t=_,n=1){return e==null?[]:Hr(Wr(e,z(t)),n)}function Kr(e,t){return Gr(e,t,1)}function qr(e,t){return Gr(e,t,1/0)}function Jr(e){return Hr(e,1)}function Yr(e){return Hr(e,1/0)}function Xr(e,t=_){return e==null?{}:ie(j(e)?A(e):Object.values(e),z(t))}function Zr(e,t,n,r){if(e==null)return!1;if(n=r||!n?0:K(n),Pr(e))return n>e.length||t instanceof RegExp?!1:(n<0&&(n=Math.max(0,e.length+n)),e.includes(t,n));if(Array.isArray(e))return e.includes(t,n);if(j(e)){n<0&&(n=Math.max(0,e.length+n));for(let r=n;r<e.length;r++)if(D(e[r],t))return!0;return!1}let i=Object.keys(e);n<0&&(n=Math.max(0,i.length+n));for(let r=n;r<i.length;r++)if(D(Reflect.get(e,i[r]),t))return!0;return!1}function Qr(e,t,n){if(!j(e))return-1;if(Number.isNaN(t)){n=K(n??0),n<0&&(n=Math.max(0,e.length+n));for(let t=n;t<e.length;t++)if(Number.isNaN(e[t]))return t;return-1}return Array.from(e).indexOf(t,n)}function $r(e){return j(e)?oe(Array.from(e)):[]}function ei(...e){if(e.length===0||!V(e[0]))return[];let t=g(A(e[0]));for(let n=1;n<e.length;n++){let r=e[n];if(!V(r))return[];t=se(t,A(r))}return t}function ti(e,...t){if(!V(e))return[];let n=fe(t),r=!V(n),i=r?t.length-1:t.length,a=r?z(n):_,o=typeof n==`function`?e=>a(e):a;if(i<=0)return Ee(A(e),o);let s=g(A(e));for(let e=0;e<i;++e){let n=t[e];if(!V(n))return[];s=ce(s,A(n),o)}return s}function ni(e,...t){if(e==null)return[];let n=H(t),r=D,i=g;typeof n==`function`&&(r=n,i=e=>De(e,r),t.pop());let a=i(A(e));for(let e=0;e<t.length;++e){let n=t[e];if(n==null)return[];a=le(a,A(n),r)}return a}function ri(e,t,...n){if(k(e))return[];let r=j(e)?Array.from(e):Object.values(e),i=[];for(let e=0;e<r.length;e++){let a=r[e];if(O(t)){i.push(t.apply(a,n));continue}let o=F(a,t),s=a,c=Array.isArray(t)?t:P(t);c.length>1&&(s=F(a,c.slice(0,-1))),i.push(o?.apply(s,n))}return i}function ii(e,t){return j(e)?Array.from(e).join(t):``}function ai(e,t=_,n){let r=arguments.length>=3;if(!e)return n;let i,a=0;j(e)?(i=it(0,e.length),!r&&e.length>0&&(n=e[0],a+=1)):(i=Object.keys(e),!r&&i.length>0&&(n=e[i[0]],a+=1));for(let r=a;r<i.length;r++){let a=i[r],o=e[a];n=t(n,o,a,e)}return n}function oi(e,t){if(!j(e)&&!B(e))return{};let n=z(t??_);return ai(e,(e,t)=>{let r=n(t);return e[r]=t,e},{})}function si(e,t,n){if(!j(e)||e.length===0)return-1;let r=e.length,i=n===void 0?r-1:K(n);if(n!==void 0&&(i=i<0?Math.max(r+i,0):Math.min(i,r-1)),Number.isNaN(t)){for(let t=i;t>=0;t--)if(Number.isNaN(e[t]))return t;return-1}for(let n=i;n>=0;n--)if(e[n]===t)return n;return-1}function ci(e,t=0){if(!(!j(e)||e.length===0))return t=K(t),t<0&&(t+=e.length),e[t]}function li(e){return typeof e==`symbol`?1:e===null?2:e===void 0?3:e===e?0:4}let ui=(e,t,n)=>{if(e!==t){let r=li(e),i=li(t);if(r===i&&r===0){if(e<t)return n===`desc`?1:-1;if(e>t)return n===`desc`?-1:1}return n===`desc`?i-r:r-i}return 0},di=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,fi=/^\w*$/;function pi(e,t){return Array.isArray(e)?!1:typeof e==`number`||typeof e==`boolean`||e==null||U(e)?!0:typeof e==`string`&&(fi.test(e)||!di.test(e))||t!=null&&Object.hasOwn(t,e)}function mi(e,t,n,r){if(e==null)return[];n=r?void 0:n,Array.isArray(e)||(e=j(e)?Array.from(e):Object.values(e)),Array.isArray(t)||(t=t==null?[null]:[t]),t.length===0&&(t=[null]),Array.isArray(n)||(n=n==null?[]:[n]),n=n.map(e=>String(e));let i=(e,t)=>{let n=e,r=0;for(;r<t.length&&n!=null;++r)n=n[t[r]];return r>0&&r===t.length?n:void 0},a=(e,t)=>{if(e==null)return t;if(t!=null)return typeof e==`object`&&`key`in e?Object.hasOwn(t,e.key)?t[e.key]:i(t,e.path):typeof e==`function`?e(t):Array.isArray(e)?i(t,e):t[e]},o=t.map(e=>(Array.isArray(e)&&e.length===1&&(e=e[0]),e==null||typeof e==`function`||Array.isArray(e)||pi(e)?e:{key:e,path:P(e)}));return e.map(e=>({original:e,criteria:o.map(t=>a(t,e))})).slice().sort((e,t)=>{for(let r=0;r<o.length;r++){let i=ui(e.criteria[r],t.criteria[r],n[r]);if(i!==0)return i}return 0}).map(e=>e.original)}function hi(e,t=_){if(!e)return[[],[]];let n=j(e)?e:Object.values(e);t=z(t);let r=[],i=[];for(let e=0;e<n.length;e++){let a=n[e];t(a)?r.push(a):i.push(a)}return[r,i]}function gi(e,...t){return me(e,t)}function _i(e,t=[]){return k(t)?e:me(e,Array.from(t))}function vi(e,t,n){let r=z(n),i=new Set(Array.from(t).map(e=>r(e))),a=0;for(let t=0;t<e.length;t++){let n=r(e[t]);if(!i.has(n)){if(!Object.hasOwn(e,t)){delete e[a++];continue}e[a++]=e[t]}}return e.length=a,e}function yi(e,t){let n=e.length;t??=Array(n);for(let r=0;r<n;r++)t[r]=e[r];return t}function bi(e,t,n){if(e?.length==null||t?.length==null)return e;e===t&&(t=yi(t));let r=0;n??=(e,t)=>D(e,t);let i=Array.isArray(t)?t:Array.from(t),a=i.includes(void 0);for(let t=0;t<e.length;t++){if(t in e){i.some(r=>n(e[t],r))||(e[r++]=e[t]);continue}a||delete e[r++]}return e.length=r,e}function xi(e,...t){if(t.length===0)return[];let n=[];for(let e=0;e<t.length;e++){let r=t[e];if(!j(r)||Pr(r)){n.push(r);continue}for(let e=0;e<r.length;e++)n.push(r[e])}let r=[];for(let t=0;t<n.length;t++)r.push(F(e,n[t]));return r}function Si(e,t){if(e==null)return!0;switch(typeof t){case`symbol`:case`number`:case`object`:if(Array.isArray(t))return Ci(e,t);if(typeof t==`number`?t=M(t):typeof t==`object`&&(t=Object.is(t?.valueOf(),-0)?`-0`:String(t)),C(t))return!1;if(e?.[t]===void 0)return!0;try{return delete e[t],!0}catch{return!1}case`string`:if(e?.[t]===void 0&&rr(t)&&!Object.hasOwn(e,t))return Ci(e,P(t));if(C(t))return!1;try{return delete e[t],!0}catch{return!1}}}function Ci(e,t){let n=t.length===1?e:F(e,t.slice(0,-1)),r=t[t.length-1];if(n?.[r]===void 0)return!0;if(C(r))return!1;try{return delete n[r],!0}catch{return!1}}function wi(e,...t){let n=Hr(t,1);if(!e)return Array(n.length);let r=xi(e,n),i=n.map(t=>_r(t,e.length)?Number(t):t).sort((e,t)=>t-e);for(let t of new Set(i)){if(_r(t,e.length)){Array.prototype.splice.call(e,t,1);continue}if(pi(t,e)){delete e[M(t)];continue}Si(e,T(t)?t:P(t))}return r}function Ti(e,t=_,n){let r=arguments.length>=3;if(!e)return n;let i,a;j(e)?(i=it(0,e.length).reverse(),!r&&e.length>0?(n=e[e.length-1],a=1):a=0):(i=Object.keys(e).reverse(),!r&&i.length>0?(n=e[i[0]],a=1):a=0);for(let r=a;r<i.length;r++){let a=i[r],o=e[a];n=t(n,o,a,e)}return n}function Ei(e){if(typeof e!=`function`)throw TypeError(`Expected a function`);return function(...t){return!e.apply(this,t)}}function Di(e,t=_){return Ir(e,Ei(z(t)))}function Oi(e,t=_){return ge(e,z(t))}function ki(e){return e==null?e:Array.prototype.reverse.call(e)}function Ai(e){if(e!=null)return j(e)?_e(A(e)):_e(Object.values(e))}function ji(e,t,n){return n===void 0&&(n=t,t=void 0),n!==void 0&&(n=W(n),e=Math.min(e,Number.isNaN(n)?0:n)),t!==void 0&&(t=W(t),e=Math.max(e,Number.isNaN(t)?0:t)),e}function Mi(e){return Sn(e)}function Ni(e){return On(e)}function Pi(e){return e==null?[]:j(e)||Mi(e)||Ni(e)?Array.from(e):typeof e==`object`?gn(e)?Array.from(e):Object.values(e):[]}function Fi(e,t,n){let r=Pi(e);return t=(n?q(e,t,n):t===void 0)?1:K(t),t=ji(t,0,r.length),be(r,t)}function Ii(e){let t=e?.constructor;return e===(typeof t==`function`?t.prototype:Object.prototype)}function Y(e){return ot(e)}function Li(e,t){if(e=K(e),e<1||!Number.isSafeInteger(e))return[];let n=Array(e);for(let r=0;r<e;r++)n[r]=typeof t==`function`?t(r):r;return n}function X(e){if(j(e))return Ri(e);let t=Object.keys(Object(e));return Ii(e)?t.filter(e=>e!==`constructor`):t}function Ri(e){let t=Li(e.length,e=>`${e}`),n=new Set(t);y(e)&&(n.add(`offset`),n.add(`parent`)),Y(e)&&(n.add(`buffer`),n.add(`byteLength`),n.add(`byteOffset`));let r=Object.keys(e).filter(e=>!n.has(e));return Array.isArray(e)?[...t,...r]:[...t.filter(t=>Object.hasOwn(e,t)),...r]}function zi(e){if(e==null)return[];let t=X(e),n=Array(t.length);for(let r=0;r<t.length;r++)n[r]=e[t[r]];return n}function Bi(e){return e==null}function Vi(e){return Bi(e)?[]:T(e)?xe(e):j(e)?xe(Array.from(e)):B(e)?xe(zi(e)):[]}let Hi=RegExp(`[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]`),Ui=`\\ud800-\\udfff`,Wi=`[${Ui}]`,Gi=`[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]`,Ki=`\\ud83c[\\udffb-\\udfff]`,qi=`(?:${Gi}|${Ki})`,Ji=`[^${Ui}]`,Yi=`(?:\\ud83c[\\udde6-\\uddff]){2}`,Xi=`[\\ud800-\\udbff][\\udc00-\\udfff]`,Zi=`${qi}?`,Qi=`[\\ufe0e\\ufe0f]?`,$i=`(?:\\u200d(?:${[Ji,Yi,Xi].join(`|`)})${Qi}${Zi})*`,ea=Qi+Zi+$i,ta=`(?:${[`${Ji}${Gi}?`,Gi,Yi,Xi,Wi].join(`|`)})`,na=RegExp(`${Ki}(?=${Ki})|${ta}${ea}`,`g`);function ra(e){let t=0;for(na.lastIndex=0;na.test(e);)++t;return t}function ia(e){return k(e)?0:typeof e==`string`?Hi.test(e)?ra(e):e.length:j(e)?e.length:e instanceof Map||e instanceof Set?e.size:Object.keys(e).length}function aa(e,t,n){if(!j(e))return[];let r=e.length;n===void 0?n=r:typeof n!=`number`&&q(e,t,n)&&(t=0,n=r),t=K(t),n=K(n),t=t<0?Math.max(r+t,0):Math.min(t,r),n=n<0?Math.max(r+n,0):Math.min(n,r);let i=Math.max(n-t,0),a=Array(i);for(let n=0;n<i;++n)a[n]=e[t+n];return a}function oa(e,t,n){if(!e)return!1;n&&q(e,t,n)&&(t=void 0),t??=_;let r=Array.isArray(e)?e:Object.values(e);switch(typeof t){case`function`:if(!Array.isArray(e)){let n=Object.keys(e);for(let r=0;r<n.length;r++){let i=n[r],a=e[i];if(t(a,i,e))return!0}return!1}for(let n=0;n<e.length;n++)if(t(e[n],n,e))return!0;return!1;case`object`:if(Array.isArray(t)&&t.length===2){let n=t[0],i=t[1],a=yr(n,i);if(Array.isArray(e)){for(let t=0;t<e.length;t++)if(a(e[t]))return!0;return!1}return r.some(a)}else{let n=L(t);if(Array.isArray(e)){for(let t=0;t<e.length;t++)if(n(e[t]))return!0;return!1}return r.some(n)}case`number`:case`symbol`:case`string`:{let n=or(t);if(Array.isArray(e)){for(let t=0;t<e.length;t++)if(n(e[t]))return!0;return!1}return r.some(n)}}}function sa(e,...t){let n=t.length;return n>1&&q(e,t[0],t[1])?t=[]:n>2&&q(t[0],t[1],t[2])&&(t=[t[0]]),mi(e,te(t),[`asc`])}function ca(e){return typeof e==`number`||B(e)&&v(e)===`[object Number]`}function la(e){return ca(e)&&Number.isNaN(Number(e))}function ua(e,t,n=J,r){if(Bi(e)||e.length===0)return 0;let i=0,a=e.length,o=z(n),s=o(t),c=la(s),l=Tn(s),u=U(s),d=An(s);for(;i<a;){let t,n=Math.floor((i+a)/2),f=o(e[n]),p=!An(f),m=Tn(f),h=!la(f),ee=U(f);t=c?r||h:d?h&&(r||p):l?h&&p&&(r||!m):u?h&&p&&!m&&(r||!ee):m||ee?!1:r?f<=s:f<s,t?i=n+1:a=n}return Math.min(a,4294967294)}function da(e,t){if(k(e))return 0;let n=0,r=e.length;if(ca(t)&&t===t&&r<=2147483647){for(;n<r;){let i=n+r>>>1,a=e[i];!Tn(a)&&!kn(a)&&a<t?n=i+1:r=i}return r}return ua(e,t,e=>e)}function fa(e,t){if(!e?.length)return-1;let n=da(e,t);return n<e.length&&D(e[n],t)?n:-1}function pa(e,t,n){return ua(e,t,n,!0)}function ma(e,t){if(k(e))return 0;let n=e.length;if(!ca(t)||Number.isNaN(t)||n>2147483647)return pa(e,t,e=>e);let r=0;for(;r<n;){let i=r+n>>>1,a=e[i];!Tn(a)&&!kn(a)&&a<=t?r=i+1:n=i}return n}function ha(e,t){if(!e?.length)return-1;let n=ma(e,t)-1;return n>=0&&D(e[n],t)?n:-1}function ga(e){return j(e)?Se(A(e)):[]}function _a(e,t=1,n){return t=n||t===void 0?1:K(t),t<1||!j(e)?[]:Ce(A(e),t)}function va(e,t=1,n){return t=n?1:K(t),t<=0||!j(e)?[]:we(A(e),t)}function ya(e,t){if(!j(e))return[];let n=A(e),r=n.findLastIndex(He(z(t??_)));return n.slice(r+1)}function ba(e,t){if(!j(e))return[];let n=A(e),r=n.findIndex(Ei(z(t??J)));return r===-1?n:n.slice(0,r)}function xa(...e){return g(Gr(e.filter(V),e=>Array.from(e),1))}function Sa(...e){let t=fe(e),n=Cr(e);return V(t)||t==null?g(n):Ee(n,Le(z(t),1)).map(xr)}function Ca(...e){let t=fe(e),n=Cr(e);return V(t)||t==null?g(n):De(n,t)}function wa(e){return j(e)?g(Array.from(e)):[]}function Ta(e,t=_){return j(e)?Ee(Array.from(e),Le(z(t),1)).map(xr):[]}function Ea(e,t){return j(e)?typeof t==`function`?De(Array.from(e),(e,n)=>t(n,e)):wa(Array.from(e)):[]}function Da(e){return!V(e)||!e.length?[]:(e=T(e)?e:Array.from(e),e=e.filter(e=>V(e)),Oe(e))}function Oa(e,t){if(!V(e)||!e.length)return[];let n=T(e)?Oe(e):Oe(Array.from(e,e=>Array.from(e)));if(!t)return n;let r=Array(n.length);for(let e=0;e<n.length;e++){let i=n[e];r[e]=t(...i)}return r}function ka(e,...t){return V(e)?Ae(Array.from(e),...t):[]}function Aa(...e){let t=new Map;for(let n=0;n<e.length;n++){let r=e[n];if(!V(r))continue;let i=new Set(Pi(r));for(let e of i)t.has(e)?t.set(e,t.get(e)+1):t.set(e,1)}let n=[];for(let[e,r]of t)r===1&&n.push(e);return n}function ja(...e){let t=H(e),n=_;!V(t)&&t!=null&&(n=z(t),e=e.slice(0,-1));let r=e.filter(V);return wr(Sa(...r,n),Sa(...ke(r,2).map(([e,t])=>ti(e,t,n)),n),n)}function Ma(...e){let t=H(e),n=(e,t)=>e===t;typeof t==`function`&&(n=t,e=e.slice(0,-1));let r=e.filter(V);return Tr(Ca(...r,n),Ca(...ke(r,2).map(([e,t])=>ni(e,t,n)),n),n)}function Na(...e){return e.length?je(...e.filter(e=>V(e))):[]}let Pa=(e,t,n)=>{let r=e[t];(!(Object.hasOwn(e,t)&&D(r,n))||n===void 0&&!(t in e))&&(e[t]=n)};function Fa(e=[],t=[]){e||=[],t||=[];let n={};for(let r=0;r<e.length;r++)Pa(n,e[r],t[r]);return n}function Ia(e){return e===`__proto__`||e===`constructor`||e===`prototype`}function La(e,t,n,r){if(e==null&&!I(e))return e;let i;i=pi(t,e)?[t]:Array.isArray(t)?t:P(t);let a=n(F(e,i)),o=e;for(let t=0;t<i.length&&o!=null;t++){let n=M(i[t]);if(Ia(n))return e;let s;if(t===i.length-1)s=a;else{let a=o[n],c=r?.(a,n,e);s=c===void 0?I(a)?a:_r(i[t+1])?[]:{}:c}Pa(o,n,s),o=o[n]}return e}function Ra(e,t,n){return La(e,t,()=>n,()=>void 0)}function za(e,t){let n={};if(!j(e))return n;j(t)||(t=[]);let r=je(Array.from(e),Array.from(t));for(let e=0;e<r.length;e++){let[t,i]=r[e];t!=null&&Ra(n,t,i)}return n}function Ba(...e){let t=e.pop();if(O(t)||(e.push(t),t=void 0),!e?.length)return[];let n=Da(e);return t==null?n:n.map(e=>t(...e))}function Va(e,t){if(typeof t!=`function`)throw TypeError(`Expected a function`);return e=K(e),function(...n){if(--e<1)return t.apply(this,n)}}function Ha(e,t=e.length,n){return n&&(t=e.length),(Number.isNaN(t)||t<0)&&(t=0),Le(e,t)}function Ua(e,...t){try{return e(...t)}catch(e){return e instanceof Error?e:Error(e)}}function Wa(e,t){if(typeof t!=`function`)throw TypeError(`Expected a function`);let n;return e=K(e),function(...r){return--e>0&&(n=t.apply(this,r)),e<=1&&t&&(t=void 0),n}}function Ga(e,t,...n){let r=function(...i){let a=[],o=0;for(let e=0;e<n.length;e++){let t=n[e];t===Ga.placeholder?a.push(i[o++]):a.push(t)}for(let e=o;e<i.length;e++)a.push(i[e]);return this instanceof r?new e(...a):e.apply(t,a)};return r}Ga.placeholder=Symbol(`bind.placeholder`);function Ka(e,t,...n){let r=function(...i){let a=[],o=0;for(let e=0;e<n.length;e++){let t=n[e];t===Ka.placeholder?a.push(i[o++]):a.push(t)}for(let e=o;e<i.length;e++)a.push(i[e]);return this instanceof r?new e[t](...a):e[t].apply(e,a)};return r}Ka.placeholder=Symbol(`bindKey.placeholder`);function qa(e,t=e.length,n){t=n?e.length:t,t=Number.parseInt(t,10),(Number.isNaN(t)||t<1)&&(t=0);let r=function(...n){let i=n.filter(e=>e===qa.placeholder),a=n.length-i.length;return a<t?Ja(e,t-a,n):this instanceof r?new e(...n):e.apply(this,n)};return r.placeholder=Xa,r}function Ja(e,t,n){function r(...i){let a=i.filter(e=>e===qa.placeholder),o=i.length-a.length;return i=Ya(i,n),o<t?Ja(e,t-o,i):this instanceof r?new e(...i):e.apply(this,i)}return r.placeholder=Xa,r}function Ya(e,t){let n=[],r=0;for(let i=0;i<t.length;i++){let a=t[i];a===qa.placeholder&&r<e.length?n.push(e[r++]):n.push(a)}for(let t=r;t<e.length;t++)n.push(e[t]);return n}let Xa=Symbol(`curry.placeholder`);qa.placeholder=Xa;function Za(e,t=e.length,n){t=n?e.length:t,t=Number.parseInt(t,10),(Number.isNaN(t)||t<1)&&(t=0);let r=function(...n){let i=n.filter(e=>e===Za.placeholder),a=n.length-i.length;return a<t?Qa(e,t-a,n):this instanceof r?new e(...n):e.apply(this,n)};return r.placeholder=eo,r}function Qa(e,t,n){function r(...i){let a=i.filter(e=>e===Za.placeholder),o=i.length-a.length;return i=$a(i,n),o<t?Qa(e,t-o,i):this instanceof r?new e(...i):e.apply(this,i)}return r.placeholder=eo,r}function $a(e,t){let n=t.filter(e=>e===Za.placeholder).length,r=Math.max(e.length-n,0),i=[],a=0;for(let t=0;t<r;t++)i.push(e[a++]);for(let n=0;n<t.length;n++){let r=t[n];r===Za.placeholder&&a<e.length?i.push(e[a++]):i.push(r)}return i}let eo=Symbol(`curryRight.placeholder`);Za.placeholder=eo;function to(e,t=0,n={}){typeof n!=`object`&&(n={});let{leading:r=!1,trailing:i=!0,maxWait:a}=n,o=[,,];r&&(o[0]=`leading`),i&&(o[1]=`trailing`);let s,c=null,l=ze(function(...t){s=e.apply(this,t),c=null},t,{edges:o}),u=function(...t){return a!=null&&(c===null&&(c=Date.now()),Date.now()-c>=a)?(s=e.apply(this,t),c=Date.now(),l.cancel(),l.schedule(),s):(l.apply(this,t),s)};return u.cancel=l.cancel,u.flush=()=>(l.flush(),s),u}function no(e,...t){if(typeof e!=`function`)throw TypeError(`Expected a function`);return setTimeout(e,1,...t)}function ro(e,t,...n){if(typeof e!=`function`)throw TypeError(`Expected a function`);return setTimeout(e,W(t)||0,...n)}function io(e){return function(...t){return e.apply(this,t.reverse())}}function ao(...e){let t=te(e,1);if(t.some(e=>typeof e!=`function`))throw TypeError(`Expected a function`);return Be(...t)}function oo(...e){let t=te(e,1);if(t.some(e=>typeof e!=`function`))throw TypeError(`Expected a function`);return Ve(...t)}function so(e,t){if(typeof e!=`function`||t!=null&&typeof t!=`function`)throw TypeError(`Expected a function`);let n=function(...r){let i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);let o=e.apply(this,r);return n.cache=a.set(i,o)||a,o};return n.cache=new(so.Cache||Map),n}so.Cache=Map;function co(e=0){return function(...t){return t.at(K(e))}}function lo(e){return We(e)}function uo(e,...t){if(typeof e!=`function`)throw TypeError(`Expected a function`);let n=t.flat();return function(...t){let r=Math.min(t.length,n.length),i=[...t];for(let e=0;e<r;e++)i[e]=z(n[e]??_).call(this,t[e]);return e.apply(this,i)}}function fo(e,...t){return Ke(e,fo.placeholder,...t)}fo.placeholder=Symbol(`compat.partial.placeholder`);function po(e,...t){return Ye(e,po.placeholder,...t)}po.placeholder=Symbol(`compat.partialRight.placeholder`);function mo(e,...t){let n=Jr(t);return function(...t){let r=n.map(e=>t[e]).slice(0,t.length);for(let e=r.length;e<t.length;e++)r.push(t[e]);return e.apply(this,r)}}function ho(e,t=e.length-1){return t=Number.parseInt(t,10),(Number.isNaN(t)||t<0)&&(t=e.length-1),Ze(e,t)}function go(e,t=0){return t=Number.parseInt(t,10),(Number.isNaN(t)||t<0)&&(t=0),function(...n){let r=n[t],i=n.slice(0,t);return r&&i.push(...r),e.apply(this,i)}}function _o(e,t=0,n={}){let{leading:r=!0,trailing:i=!0}=n;return to(e,t,{leading:r,maxWait:t,trailing:i})}function vo(e){return Ha(e,1)}function yo(e,t){return function(...n){return(O(t)?t:_).apply(this,[e,...n])}}function bo(e,t){return e===void 0&&t===void 0?0:e===void 0||t===void 0?e??t:(typeof e==`string`||typeof t==`string`?(e=N(e),t=N(t)):(e=W(e),t=W(t)),e+t)}function xo(e,t,n=0){if(t=Number(t),Object.is(t,-0)&&(t=`-0`),n=Math.min(Number.parseInt(n,10),292),n&&Number.isFinite(Number(t))){let[r,i=0]=t.toString().split(`e`),a=Math[e](Number(`${r}e${Number(i)+n}`));Object.is(a,-0)&&(a=`-0`);let[o,s=0]=a.toString().split(`e`);return Number(`${o}e${Number(s)-n}`)}return Math[e](Number(t))}function So(e,t=0){return xo(`ceil`,e,t)}function Co(e,t){return e===void 0&&t===void 0?1:e===void 0||t===void 0?e??t:(typeof e==`string`||typeof t==`string`?(e=N(e),t=N(t)):(e=W(e),t=W(t)),e/t)}function wo(e,t=0){return xo(`floor`,e,t)}function To(e,t,n){return t=G(t),n===void 0?(n=t,t=0):n=G(n),e=W(e),e>=Math.min(t,n)&&e<Math.max(t,n)}function Eo(e){if(!e||e.length===0)return;let t;for(let n=0;n<e.length;n++){let r=e[n];r==null||Number.isNaN(r)||typeof r==`symbol`||(t===void 0||r>t)&&(t=r)}return t}function Do(e,t=_){if(e==null)return;let n=A(e);if(n.length===0)return;let r=z(t),i,a;for(let e=0;e<n.length;e++){let t=n[e],o=r(t,e,n);o==null||Number.isNaN(o)||typeof o==`symbol`||(a===void 0||o>a)&&(a=o,i=t)}return i}function Oo(e,t){if(!e||!e.length)return 0;t!=null&&(t=z(t));let n;for(let r=0;r<e.length;r++){let i=t?t(e[r]):e[r];i!==void 0&&(n===void 0?n=i:n+=i)}return n}function ko(e){return Oo(e)}function Ao(e){let t=e?e.length:0;return t===0?NaN:ko(e)/t}function jo(e,t){let n=e==null?0:e.length;return n?Oo(e,z(t??_))/n:NaN}function Mo(e){if(!e||e.length===0)return;let t;for(let n=0;n<e.length;n++){let r=e[n];r==null||Number.isNaN(r)||typeof r==`symbol`||(t===void 0||r<t)&&(t=r)}return t}function No(e,t=_){if(e==null)return;let n=A(e);if(n.length===0)return;let r=z(t),i,a;for(let e=0;e<n.length;e++){let t=n[e],o=r(t,e,n);o==null||Number.isNaN(o)||typeof o==`symbol`||(a===void 0||o<a)&&(a=o,i=t)}return i}function Po(e,t){return e===void 0&&t===void 0?1:e===void 0||t===void 0?e??t:(typeof e==`string`||typeof t==`string`?(e=N(e),t=N(t)):(e=W(e),t=W(t)),e*t)}function Fo(e,t=0,n){return n&&(t=0),Number.parseInt(N(e),t)}function Io(...e){let t=0,n=1,r=!1;switch(e.length){case 1:typeof e[0]==`boolean`?r=e[0]:n=e[0];break;case 2:if(typeof e[1]==`boolean`){n=e[0],r=e[1];break}else t=e[0],n=e[1];case 3:typeof e[2]==`object`&&e[2]!=null&&e[2][e[1]]===e[0]?(t=0,n=e[0],r=!1):(t=e[0],n=e[1],r=e[2])}return typeof t!=`number`&&(t=Number(t)),typeof n!=`number`&&(n=Number(n)),t||=0,n||=0,t>n&&([t,n]=[n,t]),!r&&(!Number.isInteger(t)||!Number.isInteger(n))&&(r=!0),t=ji(t,-(2**53-1),2**53-1),n=ji(n,-(2**53-1),2**53-1),t===n?t:r?ve(t,n):ye(t,n+1)}function Lo(e,t,n){n&&typeof n!=`number`&&q(e,t,n)&&(t=n=void 0),e=G(e),t===void 0?(t=e,e=0):t=G(t),n=n===void 0?e<t?1:-1:G(n);let r=Math.max(Math.ceil((t-e)/(n||1)),0),i=Array(r);for(let t=0;t<r;t++)i[t]=e,e+=n;return i}function Ro(e,t,n){n&&typeof n!=`number`&&q(e,t,n)&&(t=n=void 0),e=G(e),t===void 0?(t=e,e=0):t=G(t),n=n===void 0?e<t?1:-1:G(n);let r=Math.max(Math.ceil((t-e)/(n||1)),0),i=Array(r);for(let t=r-1;t>=0;t--)i[t]=e,e+=n;return i}function zo(e,t=0){return xo(`round`,e,t)}function Bo(e,t){return e===void 0&&t===void 0?0:e===void 0||t===void 0?e??t:(typeof e==`string`||typeof t==`string`?(e=N(e),t=N(t)):(e=W(e),t=W(t)),e-t)}function Vo(...e){}function Ho(e,...t){for(let n=0;n<t.length;n++)Uo(e,t[n]);return e}function Uo(e,t){let n=X(t);for(let r=0;r<n.length;r++){let i=n[r];(!(i in e)||!D(e[i],t[i]))&&(e[i]=t[i])}}function Z(e){if(e==null)return[];switch(typeof e){case`object`:case`function`:return j(e)?Ko(e):Ii(e)?Go(e):Wo(e);default:return Wo(Object(e))}}function Wo(e){let t=[];for(let n in e)t.push(n);return t}function Go(e){return Wo(e).filter(e=>e!==`constructor`)}function Ko(e){let t=Li(e.length,e=>`${e}`),n=new Set(t);y(e)&&(n.add(`offset`),n.add(`parent`)),Y(e)&&(n.add(`buffer`),n.add(`byteLength`),n.add(`byteOffset`));let r=Wo(e).filter(e=>!n.has(e));return Array.isArray(e)?[...t,...r]:[...t.filter(t=>Object.hasOwn(e,t)),...r]}function qo(e,...t){for(let n=0;n<t.length;n++)Jo(e,t[n]);return e}function Jo(e,t){let n=Z(t);for(let r=0;r<n.length;r++){let i=n[r];(!(i in e)||!D(e[i],t[i]))&&(e[i]=t[i])}}function Yo(e,...t){let n=t[t.length-1];typeof n==`function`?t.pop():n=void 0;for(let r=0;r<t.length;r++)Xo(e,t[r],n);return e}function Xo(e,t,n){let r=Z(t);for(let i=0;i<r.length;i++){let a=r[i],o=e[a],s=t[a],c=n?.(o,s,a,e,t)??s;(!(a in e)||!D(o,c))&&(e[a]=c)}}function Zo(e,...t){let n=t[t.length-1];typeof n==`function`?t.pop():n=void 0;for(let r=0;r<t.length;r++)Qo(e,t[r],n);return e}function Qo(e,t,n){let r=X(t);for(let i=0;i<r.length;i++){let a=r[i],o=e[a],s=t[a],c=n?.(o,s,a,e,t)??s;(!(a in e)||!D(o,c))&&(e[a]=c)}}function $o(e){if(at(e))return e;let t=v(e);if(!es(e))return{};if(T(e)){let t=Array.from(e);return e.length>0&&typeof e[0]==`string`&&Object.hasOwn(e,`index`)&&(t.index=e.index,t.input=e.input),t}if(Y(e)){let t=e,n=t.constructor;return new n(t.buffer,t.byteOffset,t.length)}if(t===`[object ArrayBuffer]`)return new ArrayBuffer(e.byteLength);if(t===`[object DataView]`){let t=e,n=t.buffer,r=t.byteOffset,i=t.byteLength,a=new ArrayBuffer(i),o=new Uint8Array(n,r,i);return new Uint8Array(a).set(o),new DataView(a)}if(t===`[object Boolean]`||t===`[object Number]`||t===`[object String]`){let n=e.constructor,r=new n(e.valueOf());return t===`[object String]`?rs(r,e):ts(r,e),r}if(t===`[object Date]`)return new Date(Number(e));if(t===`[object RegExp]`){let t=e,n=new RegExp(t.source,t.flags);return n.lastIndex=t.lastIndex,n}if(t===`[object Symbol]`)return Object(Symbol.prototype.valueOf.call(e));if(t===`[object Map]`){let t=e,n=new Map;return t.forEach((e,t)=>{n.set(t,e)}),n}if(t===`[object Set]`){let t=e,n=new Set;return t.forEach(e=>{n.add(e)}),n}if(t===`[object Arguments]`){let t=e,n={};return ts(n,t),n.length=t.length,n[Symbol.iterator]=t[Symbol.iterator],n}let n={};return is(n,e),ts(n,e),ns(n,e),n}function es(e){switch(v(e)){case pt:case vt:case yt:case xt:case ft:case ht:case kt:case At:case Et:case Dt:case Ot:case gt:case dt:case bt:case lt:case _t:case ut:case mt:case St:case Ct:case wt:case Tt:return!0;default:return!1}}function ts(e,t){for(let n in t)Object.hasOwn(t,n)&&(e[n]=t[n])}function ns(e,t){let n=Object.getOwnPropertySymbols(t);for(let r=0;r<n.length;r++){let i=n[r];Object.prototype.propertyIsEnumerable.call(t,i)&&(e[i]=t[i])}}function rs(e,t){let n=t.valueOf().length;for(let r in t)Object.hasOwn(t,r)&&(Number.isNaN(Number(r))||Number(r)>=n)&&(e[r]=t[r])}function is(e,t){let n=Object.getPrototypeOf(t);n!==null&&typeof t.constructor==`function`&&Object.setPrototypeOf(e,n)}function as(e,t){if(!t)return $o(e);let n=t(e);return n===void 0?$o(e):n}function os(e,t){let n=I(e)?Object.create(e):{};if(t!=null){let e=X(t);for(let r=0;r<e.length;r++){let i=e[r],a=t[i];Pa(n,i,a)}}return n}function ss(e,...t){e=Object(e);let n=Object.prototype,r=t.length,i=r>2?t[2]:void 0;i&&q(t[0],t[1],i)&&(r=1);for(let i=0;i<r;i++){if(k(t[i]))continue;let r=t[i],a=Object.keys(r);for(let t=0;t<a.length;t++){let i=a[t],o=e[i];(o===void 0||!Object.hasOwn(e,i)&&D(o,n[i]))&&(e[i]=r[i])}}return e}function cs(e,...t){e=Object(e);for(let n=0;n<t.length;n++){let r=t[n];r!=null&&ls(e,r,new WeakMap)}return e}function ls(e,t,n){for(let r in t){let i=t[r],a=e[r];if(a===void 0||!Object.hasOwn(e,r)){e[r]=us(i,n);continue}n.get(i)!==a&&ds(a,i,n)}}function us(e,t){if(t.has(e))return t.get(e);if(E(e)){let n={};return t.set(e,n),ls(n,e,t),n}return e}function ds(e,t,n){if(E(e)&&E(t)){n.set(t,e),ls(e,t,n);return}Array.isArray(e)&&Array.isArray(t)&&(n.set(t,e),fs(e,t,n))}function fs(e,t,n){let r=Math.min(t.length,e.length);for(let i=0;i<r;i++)E(e[i])&&E(t[i])&&ls(e[i],t[i],n);for(let n=r;n<t.length;n++)e.push(t[n])}function ps(e){let t=Array(e.size),n=e.keys(),r=e.values();for(let e=0;e<t.length;e++)t[e]=[n.next().value,r.next().value];return t}function ms(e){let t=Array(e.size),n=e.values();for(let e=0;e<t.length;e++){let r=n.next().value;t[e]=[r,r]}return t}function hs(e){if(e==null)return[];if(e instanceof Set)return ms(e);if(e instanceof Map)return ps(e);let t=X(e),n=Array(t.length);for(let r=0;r<t.length;r++){let i=t[r];n[r]=[i,e[i]]}return n}function gs(e){if(e==null)return[];if(e instanceof Set)return ms(e);if(e instanceof Map)return ps(e);let t=Z(e),n=Array(t.length);for(let r=0;r<t.length;r++){let i=t[r];n[r]=[i,e[i]]}return n}function _s(e,t){if(I(e))return Ft(e,z(t??J))}function vs(e,t){if(!I(e))return;let n=z(t??J);return Object.keys(e).findLast(t=>n(e[t],t,e))}function ys(e,t=_){if(e==null)return e;for(let n in e)if(t(e[n],n,e)===!1)break;return e}function bs(e,t=_){if(e==null)return e;let n=[];for(let t in e)n.push(t);for(let r=n.length-1;r>=0;r--){let i=n[r];if(t(e[i],i,e)===!1)break}return e}function xs(e,t=_){if(e==null)return e;let n=Object(e),r=X(e);for(let e=0;e<r.length;++e){let i=r[e];if(t(n[i],i,n)===!1)break}return e}function Ss(e,t=_){if(e==null)return e;let n=Object(e),r=X(e);for(let e=r.length-1;e>=0;--e){let i=r[e];if(t(n[i],i,n)===!1)break}return e}function Cs(e){if(!j(e))return{};let t={};for(let n=0;n<e.length;n++){let[r,i]=e[n];t[r]=i}return t}function ws(e){return e==null?[]:X(e).filter(t=>typeof e[t]==`function`)}function Ts(e){if(e==null)return[];let t=[];for(let n in e)O(e[n])&&t.push(n);return t}function Es(e,t){if(e==null)return!1;let n;if(n=Array.isArray(t)?t:typeof t==`string`&&rr(t)&&!(t in Object(e))?P(t):[t],n.length===0)return!1;let r=e;for(let e=0;e<n.length;e++){let t=n[e];if((r==null||!(t in Object(r)))&&!((Array.isArray(r)||R(r))&&_r(t)&&t<r.length))return!1;r=r[t]}return!0}function Ds(e){return Rt(e)}function Os(e,t){let n={};if(k(e))return n;t??=_;let r=Object.keys(e),i=z(t);for(let t=0;t<r.length;t++){let a=r[t],o=e[a],s=i(o);Array.isArray(n[s])?n[s].push(a):n[s]=[a]}return n}function ks(e,t=_){return e==null?{}:zt(e,z(t))}function As(e,t=_){return e==null?{}:Vt(e,z(t))}function js(e,...t){let n=t.slice(0,-1),r=t[t.length-1],i=e;for(let e=0;e<n.length;e++){let t=n[e];i=Ms(i,t,r,new Map)}return i}function Ms(e,t,n,r){if(at(e)&&(e=Object(e)),typeof t!=`object`||!t)return e;if(r.has(t))return st(r.get(t));if(r.set(t,e),Array.isArray(t)){t=t.slice();for(let e=0;e<t.length;e++)t[e]=t[e]??void 0}let i=[...Object.keys(t),...ct(t)];for(let a=0;a<i.length;a++){let o=i[a];if(C(o))continue;let s=t[o],c=e[o];if(R(s)&&(s={...s}),R(c)&&(c={...c}),y(s)&&(s=hr(s)),Array.isArray(s))if(Array.isArray(c)){let e=[],t=Reflect.ownKeys(c);for(let n=0;n<t.length;n++){let r=t[n];e[r]=c[r]}c=e}else if(V(c)){let e=[];for(let t=0;t<c.length;t++)e[t]=c[t];c=e}else c=[];let l=n(c,s,o,e,t,r);l===void 0?Array.isArray(s)||B(c)&&B(s)&&(E(c)||E(s)||Y(c)||Y(s))?e[o]=Ms(c,s,n,r):c==null&&E(s)?e[o]=Ms({},s,n,r):c==null&&Y(s)?e[o]=hr(s):(c===void 0||s!==void 0)&&(e[o]=s):e[o]=l}return e}function Ns(e,...t){return js(e,...t,Ue)}function Ps(e){let t=[];for(;e;)t.push(...ct(e)),e=Object.getPrototypeOf(e);return t}function Fs(e,...t){if(e==null)return{};t=Jr(t);let n=Is(e,t);for(let e=0;e<t.length;e++){let r=t[e];switch(typeof r){case`object`:if(Array.isArray(r))Si(n,r);else{let e=Array.from(r);for(let t=0;t<e.length;t++)Si(n,e[t])}break;case`string`:case`symbol`:case`number`:Si(n,r);break}}return n}function Is(e,t){return t.some(e=>Array.isArray(e)||rr(e))?Rs(e):Ls(e)}function Ls(e){let t={},n=[...Z(e),...Ps(e)];for(let r=0;r<n.length;r++){let i=n[r];t[i]=e[i]}return t}function Rs(e){let t={},n=[...Z(e),...Ps(e)];for(let r=0;r<n.length;r++){let i=n[r];t[i]=mr(e[i],e=>{if(!E(e))return e})}return t}function zs(e,t){if(e==null)return{};let n={},r=z(t??J),i=[...Z(e),...Ps(e)];for(let t=0;t<i.length;t++){let a=U(i[t])?i[t]:i[t].toString(),o=e[a];r(o,a,e)||(n[a]=o)}return n}function Bs(e,...t){if(Bi(e))return{};let n={};for(let r=0;r<t.length;r++){let i=t[r];switch(typeof i){case`object`:Array.isArray(i)||(i=j(i)?Array.from(i):[i]);break;case`string`:case`symbol`:case`number`:i=[i];break}for(let t of i){let r=F(e,t);r===void 0&&!vr(e,t)||(typeof t==`string`&&Object.hasOwn(e,t)?n[t]=e[t]:Ra(n,t,r))}}return n}function Vs(e,t){if(e==null)return{};let n=z(t??J),r={},i=j(e)?it(0,e.length):[...Z(e),...Ps(e)];for(let t=0;t<i.length;t++){let a=U(i[t])?i[t]:i[t].toString(),o=e[a];n(o,a,e)&&(r[a]=o)}return r}function Hs(e){return function(t){return F(e,t)}}function Us(e,t,n){pi(t,e)?t=[t]:Array.isArray(t)||(t=P(N(t)));let r=Math.max(t.length,1);for(let i=0;i<r;i++){let r=e?.[M(t[i])];if(r===void 0)return typeof n==`function`?n.call(e):n;e=typeof r==`function`?r.call(e):r}return e}function Ws(e,t,n,r){let i;return i=typeof r==`function`?r:()=>void 0,La(e,t,()=>n,i)}function Gs(e,...t){return ss(hr(e),...t)}function Ks(e){return y(e)}function qs(e,t=_,n){let r=Array.isArray(e)||Ks(e)||Y(e);return t=z(t),n??=r?[]:I(e)&&O(e.constructor)?Object.create(Object.getPrototypeOf(e)):{},e==null||Mr(e,(e,r,i)=>t(n,e,r,i)),n}function Js(e,t,n){return La(e,t,n,()=>void 0)}function Ys(e){let t=Z(e),n=Array(t.length);for(let r=0;r<t.length;r++)n[r]=e[t[r]];return n}function Xs(e){return typeof e==`function`}function Zs(e){return Number.isSafeInteger(e)&&e>=0}let Qs=Function.prototype.toString,$s=RegExp(`^${Qs.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)}$`);function ec(e){if(typeof e!=`function`)return!1;if(globalThis?.[`__core-js_shared__`]!=null)throw Error(`Unsupported core-js use. Try https://npms.io/search?q=ponyfill.`);return $s.test(Qs.call(e))}function tc(e){return e===null}function nc(e){return An(e)}function rc(e,t){if(t==null)return!0;if(e==null)return Object.keys(t).length===0;let n=Object.keys(t);for(let r=0;r<n.length;r++){let i=n[r],a=t[i],o=e[i];if(o===void 0&&!(i in e)||typeof a==`function`&&!a(o))return!1}return!0}function ic(e){return e=Nt(e),function(t){return rc(t,e)}}function ac(e){return on(e)}function oc(e){return typeof e==`boolean`||e instanceof Boolean}function sc(e){return ln(e)}function cc(e){return B(e)&&e.nodeType===1&&!E(e)}function lc(e){if(e==null)return!0;if(j(e))return typeof e.splice!=`function`&&typeof e!=`string`&&!y(e)&&!Y(e)&&!R(e)?!1:e.length===0;if(typeof e==`object`||typeof e==`function`){if(e instanceof Map||e instanceof Set)return e.size===0;let t=Object.keys(e);return Ii(e)?t.filter(e=>e!==`constructor`).length===0:t.length===0}return!0}function uc(e,t,n){return typeof n!=`function`&&(n=()=>void 0),dn(e,t,(...r)=>{let i=n(...r);if(i!==void 0)return!!i;if(e instanceof Map&&t instanceof Map||e instanceof Set&&t instanceof Set)return uc(Array.from(e),Array.from(t),Ie(2,n))})}function dc(e){return v(e)===`[object Error]`}function fc(e){return Number.isFinite(e)}function pc(e){return Number.isInteger(e)}function mc(e){return Dn(e)}function hc(e){return Number.isSafeInteger(e)}function gc(e){return jn(e)}function _c(e){return Mn(e)}function vc(e){return Gt(N(e))}function yc(e,...t){if(e==null||!I(e)||T(e)&&t.length===0)return e;let n=[];for(let e=0;e<t.length;e++){let r=t[e];T(r)?n.push(...r):r&&typeof r==`object`&&`length`in r?n.push(...Array.from(r)):n.push(r)}if(n.length===0)return e;for(let t=0;t<n.length;t++){let r=n[t],i=N(r),a=e[i];O(a)&&(e[i]=a.bind(e))}return e}function Q(e){return Rn(N(e))}let bc=`\\p{Lu}`,xc=`\\p{Ll}`,Sc=`(?:[\\p{Lm}\\p{Lo}]\\p{M}*)`,Cc=`(?:['’](?:d|ll|m|re|s|t|ve))?`,wc=`(?:['’](?:D|LL|M|RE|S|T|VE))?`,Tc=`[\\p{Z}\\p{P}\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\xd7\\xf7]`,Ec=`(?:${bc}|${Sc})`,Dc=`(?:${xc}|${Sc})`,Oc;function kc(){return Oc??=RegExp([`${bc}?${xc}+${Cc}(?=${Tc}|${bc}|$)`,`${Ec}+${wc}(?=${Tc}|${bc}${Dc}|$)`,`${bc}?${Dc}+${Cc}`,`${bc}+${wc}`,`\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])`,`\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])`,`\\d+`,`\\p{Emoji_Presentation}`,`\\p{Extended_Pictographic}`].join(`|`),`gu`),Oc}function $(e,t,n){let r=N(e);return(n||t===void 0)&&(t=kc()),typeof t==`number`&&(t=t.toString()),Array.from(r.match(t)??[]).filter(e=>e!==``)}function Ac(e){return typeof e!=`string`&&(e=N(e)),e.replace(/['\u2019]/g,``)}function jc(e){let t=$(Ac(Q(e)));if(t.length===0)return``;let[n,...r]=t;return`${n.toLowerCase()}${r.map(e=>Gt(e)).join(``)}`}function Mc(e,t,n){return e==null||t==null?!1:(n??=e.length,e.endsWith(t,n))}function Nc(e){return Bn(N(e))}function Pc(e){return Vn(N(e))}function Fc(e){return $(Ac(Q(e))).map(e=>e.toLowerCase()).join(`-`)}function Ic(e){return $(Ac(Q(e))).map(e=>e.toLowerCase()).join(` `)}function Lc(e){return Hn(N(e))}function Rc(e){return Hi.test(e)?Array.from(e).length:e.length}function zc(e,t){let n=Rc(t);if(n===0||e<1)return``;let r=t.repeat(Math.ceil(e/n));return Hi.test(r)?Array.from(r).slice(0,e).join(``):r.slice(0,e)}function Bc(e,t=0,n=` `){let r=N(e),i=K(t),a=Rc(r);if(i<=a)return r;let o=(i-a)/2,s=`${n}`;return zc(Math.floor(o),s)+r+zc(Math.ceil(o),s)}function Vc(e,t=0,n=` `){let r=N(e),i=K(t),a=Rc(r);return i<=a?r:r+zc(i-a,`${n}`)}function Hc(e,t=0,n=` `){let r=N(e),i=K(t),a=Rc(r);return i<=a?r:zc(i-a,`${n}`)+r}let Uc=2**53-1;function Wc(e,t,n){return t=(n?q(e,t,n):t===void 0)?1:K(t),t<1||t>Uc?``:N(e).repeat(t)}function Gc(e,t,n){return arguments.length<3?N(e):N(e).replace(t,n)}function Kc(e){return $(Ac(Q(e))).map(e=>e.toLowerCase()).join(`_`)}function qc(e,t,n){return N(e).split(t,n)}function Jc(e){let t=$(Ac(Q(e)).trim()),n=``;for(let e=0;e<t.length;e++){let r=t[e];n&&(n+=` `),r===r.toUpperCase()?n+=r:n+=r[0].toUpperCase()+r.slice(1).toLowerCase()}return n}function Yc(e,t,n){return e==null||t==null?!1:(n??=0,e.startsWith(t,n))}let Xc=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Zc=/['\n\r\u2028\u2029\\]/g,Qc=/($^)/,$c=new Map([[`\\`,`\\`],[`'`,`'`],[`
2
+ `,`n`],[`\r`,`r`],[`\u2028`,`u2028`],[`\u2029`,`u2029`]]);function el(e){return`\\${$c.get(e)}`}let tl=/<%=([\s\S]+?)%>/g,nl={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:tl,variable:``,imports:{_:{escape:Nc,template:rl}}};function rl(e,t,n){e=N(e),n&&q(e,t,n)&&(t=nl),t=ss({...t},nl);let r=new RegExp([t.escape?.source??Qc.source,t.interpolate?.source??Qc.source,t.interpolate===tl?Xc.source:Qc.source,t.evaluate?.source??Qc.source,`$`].join(`|`),`g`),i=0,a=!1,o=`__p += ''`;for(let t of e.matchAll(r)){let[n,r,s,c,l]=t,{index:u}=t;o+=` + '${e.slice(i,u).replace(Zc,el)}'`,r&&(o+=` + _.escape(${r})`),s?o+=` + ((${s}) == null ? '' : ${s})`:c&&(o+=` + ((${c}) == null ? '' : ${c})`),l&&(o+=`;\n${l};\n __p += ''`,a=!0),i=u+n.length}let s=ss({...t.imports},nl.imports),c=Object.keys(s),l=Object.values(s),u=`//# sourceURL=${t.sourceURL?String(t.sourceURL).replace(/[\r\n]/g,` `):`es-toolkit.templateSource[${Date.now()}]`}\n`,d=`function(${t.variable||`obj`}) {
3
3
  let __p = '';
4
4
  ${t.variable?``:`if (obj == null) { obj = {}; }`}
5
5
  ${a?`function print() { __p += Array.prototype.join.call(arguments, ''); }`:``}
6
6
  ${t.variable?o:`with(obj) {\n${o}\n}`}
7
7
  return __p;
8
- }`,f=Va(()=>Function(...c,`${u}return ${d}`)(...l));if(f.source=d,f instanceof Error)throw f;return f}let nl=el;function rl(e){return P(e).toLowerCase()}function il(e){return P(e).toUpperCase()}function al(e,t,n){if(e==null)return``;if(n!=null||t==null)return e.toString().trim();switch(typeof t){case`object`:return Array.isArray(t)?Un(e,t.flatMap(e=>e.toString().split(``))):Un(e,t.toString().split(``));default:return Un(e,t.toString().split(``))}}function ol(e,t,n){return e==null?``:n!=null||t==null?e.toString().trimEnd():Vn(e,t.toString().split(``))}function sl(e,t,n){return e==null?``:n!=null||t==null?e.toString().trimStart():Hn(e,t.toString().split(``))}function cl(e,t){e=e==null?``:`${e}`;let n=30,r=`...`;L(t)&&(n=ll(t.length),r=`omission`in t?`${t.omission}`:`...`);let i=e.length,a=Array.from(r).length,o=Math.max(n-a,0),s;if(Bi.test(e)&&(s=Array.from(e),i=s.length),n>=i)return e;if(i<=a)return r;let c=s===void 0?e.slice(0,o):s?.slice(0,o).join(``),l=t?.separator;if(!l)return c+=r,c;let u=l instanceof RegExp?l.source:l,d=`u`+(l instanceof RegExp?l.flags.replace(`u`,``):``),f=RegExp(`(?<result>.*(?:(?!${u}).))(?:${u})`,d).exec(c);return(f?.groups?f.groups.result:c)+r}function ll(e){return e==null?30:e<=0?0:e}function ul(e){return Gn(P(e))}function dl(e){return $(Oc(Q(e))).map(e=>e.toUpperCase()).join(` `)}function fl(e){return Kn(P(e))}function pl(e){let t=e.length,n=e.map(e=>{let t=e[0],n=e[1];if(!k(n))throw TypeError(`Expected a function`);return[z(t),n]});return function(...e){for(let r=0;r<t;r++){let t=n[r],i=t[0],a=t[1];if(i.apply(this,e))return a.apply(this,e)}}}function ml(e){return()=>e}function hl(e,t){return e==null||Number.isNaN(e)?t:e}function gl(e,t){return typeof e==`string`&&typeof t==`string`?e>t:W(e)>W(t)}function _l(e,t){return typeof e==`string`&&typeof t==`string`?e>=t:W(e)>=W(t)}function vl(e,t,...n){if(n=n.flat(1),e!=null)switch(typeof t){case`string`:return typeof e==`object`&&Object.hasOwn(e,t)?yl(e,[t],n):yl(e,F(t),n);case`number`:case`symbol`:return yl(e,[t],n);default:return Array.isArray(t)?yl(e,t,n):yl(e,[t],n)}}function yl(e,t,n){let r=I(e,t.slice(0,-1),e);if(r==null)return;let i=H(t),a=i?.valueOf();return i=typeof a==`number`?N(a):String(i),I(r,i)?.apply(r,n)}function bl(e,t){return typeof e==`string`&&typeof t==`string`?e<t:W(e)<W(t)}function xl(e,t){return typeof e==`string`&&typeof t==`string`?e<=t:W(e)<=W(t)}function Sl(e,...t){return function(n){return vl(n,e,t)}}function Cl(e,...t){return function(n){return vl(e,n,t)}}function wl(){return Date.now()}function Tl(...e){e.length===1&&Array.isArray(e[0])&&(e=e[0]);let t=e.map(e=>z(e));return function(...e){return t.map(t=>t.apply(this,e))}}function El(...e){return function(...t){for(let n=0;n<e.length;++n){let r=e[n];if(!Array.isArray(r)){if(!z(r).apply(this,t))return!1;continue}for(let e=0;e<r.length;++e)if(!z(r[e]).apply(this,t))return!1}return!0}}function Dl(...e){return function(...t){for(let n=0;n<e.length;++n){let r=e[n];if(!Array.isArray(r)){if(z(r).apply(this,t))return!0;continue}for(let e=0;e<r.length;++e)if(z(r[e]).apply(this,t))return!0}return!1}}function Ol(){return[]}function kl(){return!1}function Al(){return{}}function jl(){return``}function Ml(){return!0}function Nl(e){return e==null?0:ki(K(e),0,4294967295)}function Pl(e){let t={},n=Z(e);for(let r=0;r<n.length;r++){let i=n[r],a=e[i];i===`__proto__`?Object.defineProperty(t,i,{configurable:!0,enumerable:!0,value:a,writable:!0}):t[i]=a}return t}function Fl(e){return e==null?0:ki(K(e),-Vc,Vc)}let Il=0;function Ll(e=``){return`${e}${++Il}`}function Rl(e,t,n){if(!e)return!0;n&&q(e,t,n)&&(t=void 0);let r=z(t??_);if(!M(e)){let t=Object.keys(e);for(let n=0;n<t.length;n++){let i=t[n],a=e[i];if(!r(a,i,e))return!1}return!0}for(let t=0;t<e.length;t++)if(!r(e[t],t,e))return!1;return!0}e.AbortError=Pe,e.Mutex=jn,e.Semaphore=m,e.TimeoutError=Fe,e.add=vo,e.after=za,e.allKeyed=An,e.ary=Ba,e.assert=Jn,e.invariant=Jn,e.assign=Bo,e.assignIn=Go,e.extend=Go,e.assignInWith=qo,e.extendWith=qo,e.assignWith=Yo,e.asyncNoop=Re,e.at=yi,e.attempt=Va,e.attemptAsync=qn,e.before=Ha,e.bind=Ua,e.bindAll=_c,e.bindKey=Wa,e.camelCase=kc,e.capitalize=gc,e.cartesianProduct=t,e.castArray=Yn,e.ceil=bo,e.chunk=Xn,e.chunkBy=r,e.clamp=ki,e.clone=Zo,e.cloneDeep=pr,e.cloneDeepWith=fr,e.cloneWith=rs,e.combinations=i,e.compact=Zn,e.concat=Qn,e.cond=pl,e.conforms=nc,e.conformsTo=tc,e.constant=ml,e.constantCase=qt,e.countBy=vr,e.create=is,e.curry=Ga,e.curryRight=Ya,e.debounce=$a,e.deburr=Q,e.deepFreeze=Nt,e.defaultTo=hl,e.defaults=as,e.defaultsDeep=os,e.defer=eo,e.delay=to,e.difference=br,e.differenceBy=Sr,e.differenceWith=Cr,e.divide=xo,e.drop=wr,e.dropRight=Tr,e.dropRightWhile=Er,e.dropWhile=Or,e.each=Ar,e.forEach=Ar,e.eachRight=jr,e.forEachRight=jr,e.endsWith=Ac,e.eq=O,e.escape=jc,e.escapeRegExp=Mc,e.every=Rl,e.fill=Nr,e.filter=Pr,e.filterAsync=ee,e.find=Fr,e.findIndex=Ir,e.findKey=hs,e.findLast=Lr,e.findLastIndex=Rr,e.findLastKey=gs,e.first=zr,e.head=zr,e.flatMap=Wr,e.flatMapAsync=ne,e.flatMapDeep=Gr,e.flatMapDepth=Ur,e.flatten=Kr,e.flattenDeep=qr,e.flattenDepth=Br,e.flattenObject=Ft,e.flip=no,e.floor=So,e.flow=ro,e.flowRight=io,e.forEachAsync=re,e.forIn=_s,e.forInRight=vs,e.forOwn=ys,e.forOwnRight=bs,e.fromPairs=xs,e.functions=Ss,e.functionsIn=Cs,e.get=I,e.groupBy=Jr,e.gt=gl,e.gte=_l,e.has=gr,e.hasIn=ws,e.identity=J,e.inRange=Co,e.includes=Yr,e.indexOf=Xr,e.initial=Zr,e.intersection=Qr,e.intersectionBy=$r,e.intersectionWith=ei,e.invert=Ts,e.invertBy=Es,e.invoke=vl,e.invokeMap=ti,e.isArguments=R,e.isArray=E,e.isArrayBuffer=rc,e.isArrayLike=M,e.isArrayLikeObject=V,e.isBlob=rn,e.isBoolean=ic,e.isBrowser=an,e.isBuffer=Ws,e.isDate=ac,e.isElement=oc,e.isEmpty=sc,e.isEmptyObject=sn,e.isEqual=dn,e.isEqualWith=cc,e.isError=lc,e.isFile=fn,e.isFinite=uc,e.isFunction=Js,e.isInteger=dc,e.isIterable=pn,e.isJSON=mn,e.isJSONArray=gn,e.isJSONObject=_n,e.isJSONValue=hn,e.isLength=Ys,e.isMap=Ai,e.isMatch=ur,e.isMatchWith=ir,e.isNaN=sa,e.isNative=Qs,e.isNil=Ri,e.isNode=bn,e.isNotNil=xn,e.isNull=$s,e.isNumber=oa,e.isObject=L,e.isObjectLike=B,e.isPlainObject=D,e.isPrimitive=v,e.isPromise=Cn,e.isRegExp=fc,e.isSafeInteger=pc,e.isSet=ji,e.isString=Mr,e.isSubset=ue,e.isSubsetWith=de,e.isSymbol=U,e.isTypedArray=Y,e.isUndefined=ec,e.isWeakMap=mc,e.isWeakSet=hc,e.iteratee=z,e.join=ni,e.kebabCase=Nc,e.keyBy=ii,e.keys=X,e.keysIn=Z,e.last=H,e.lastIndexOf=ai,e.limitAsync=h,e.lowerCase=Pc,e.lowerFirst=Fc,e.lt=bl,e.lte=xl,e.map=Hr,e.mapAsync=pe,e.mapKeys=Ds,e.mapValues=Os,e.matches=dr,e.matchesProperty=_r,e.max=wo,e.maxBy=To,e.mean=Oo,e.meanBy=ko,e.median=tt,e.medianBy=nt,e.memoize=ao,e.merge=js,e.mergeWith=ks,e.method=Sl,e.methodOf=Cl,e.min=Ao,e.minBy=jo,e.multiply=Mo,e.negate=wi,e.noop=zo,e.now=wl,e.nth=oi,e.nthArg=oo,e.omit=Ns,e.omitBy=Ls,e.once=so,e.orderBy=fi,e.over=Tl,e.overArgs=co,e.overEvery=El,e.overSome=Dl,e.pad=Rc,e.padEnd=zc,e.padStart=Bc,e.parseInt=No,e.partial=lo,e.partialRight=uo,e.partition=pi,e.pascalCase=Qt,e.percentile=rt,e.pick=Rs,e.pickBy=zs,e.property=rr,e.propertyOf=Bs,e.pull=mi,e.pullAll=hi,e.pullAllBy=gi,e.pullAllWith=vi,e.pullAt=Si,e.random=Po,e.randomInt=ye,e.range=Fo,e.rangeRight=Io,e.rearg=fo,e.reduce=ri,e.reduceAsync=he,e.reduceRight=Ci,e.reject=Ti,e.remove=Ei,e.repeat=Hc,e.replace=Uc,e.rest=po,e.result=Vs,e.retry=et,e.reverse=Di,e.reverseString=Bn,e.round=Lo,e.sample=Oi,e.sampleSize=Ni,e.set=Ia,e.setWith=Hs,e.shuffle=zi,e.size=na,e.slice=ra,e.snakeCase=Wc,e.some=ia,e.sortBy=aa,e.sortKeys=Vt,e.sortedIndex=la,e.sortedIndexBy=ca,e.sortedIndexOf=ua,e.sortedLastIndex=fa,e.sortedLastIndexBy=da,e.sortedLastIndexOf=pa,e.split=Gc,e.spread=mo,e.startCase=Kc,e.startsWith=qc,e.stubArray=Ol,e.stubFalse=kl,e.stubObject=Al,e.stubString=jl,e.stubTrue=Ml,e.subtract=Ro,e.sum=Do,e.sumBy=Eo,e.tail=ma,e.take=ha,e.takeRight=ga,e.takeRightWhile=_a,e.takeWhile=va,e.template=tl,e.templateSettings=nl,e.throttle=ho,e.timeout=Mn,e.times=Fi,e.toArray=Mi,e.toCamelCaseKeys=Kt,e.toConstantCaseKeys=Jt,e.toDefaulted=Us,e.toFilled=Te,e.toFinite=G,e.toInteger=K,e.toKebabCaseKeys=Xt,e.toLength=Nl,e.toLower=rl,e.toMerged=Zt,e.toNumber=W,e.toPairs=ps,e.toPairsIn=ms,e.toPascalCaseKeys=$t,e.toPath=F,e.toPlainObject=Pl,e.toSafeInteger=Fl,e.toSnakeCaseKeys=tn,e.toString=P,e.toUpper=il,e.transform=Gs,e.trim=al,e.trimEnd=ol,e.trimStart=sl,e.truncate=cl,e.unary=go,e.unescape=ul,e.union=ya,e.unionBy=ba,e.unionWith=xa,e.uniq=Sa,e.uniqBy=Ca,e.uniqWith=wa,e.uniqueId=Ll,e.unset=bi,e.unzip=Ta,e.unzipWith=Ea,e.update=Ks,e.updateWith=Fa,e.upperCase=dl,e.upperFirst=fl,e.values=Li,e.valuesIn=qs,e.windowed=ke,e.withTimeout=Nn,e.without=Da,e.words=$,e.wrap=_o,e.xor=Oa,e.xorBy=ka,e.xorWith=Aa,e.zip=ja,e.zipObject=Na,e.zipObjectDeep=La,e.zipWith=Ra});
8
+ }`,f=Ua(()=>Function(...c,`${u}return ${d}`)(...l));if(f.source=d,f instanceof Error)throw f;return f}let il=nl;function al(e){return N(e).toLowerCase()}function ol(e){return N(e).toUpperCase()}function sl(e,t,n){if(e==null)return``;if(n!=null||t==null)return e.toString().trim();switch(typeof t){case`object`:return Array.isArray(t)?Kn(e,t.flatMap(e=>e.toString().split(``))):Kn(e,t.toString().split(``));default:return Kn(e,t.toString().split(``))}}function cl(e,t,n){return e==null?``:n!=null||t==null?e.toString().trimEnd():Wn(e,t.toString().split(``))}function ll(e,t,n){return e==null?``:n!=null||t==null?e.toString().trimStart():Gn(e,t.toString().split(``))}function ul(e,t){e=e==null?``:`${e}`;let n=30,r=`...`;I(t)&&(n=dl(t.length),r=`omission`in t?`${t.omission}`:`...`);let i=e.length,a=Array.from(r).length,o=Math.max(n-a,0),s;if(Hi.test(e)&&(s=Array.from(e),i=s.length),n>=i)return e;if(i<=a)return r;let c=s===void 0?e.slice(0,o):s?.slice(0,o).join(``),l=t?.separator;if(!l)return c+=r,c;let u=l instanceof RegExp?l.source:l,d=`u`+(l instanceof RegExp?l.flags.replace(`u`,``):``),f=RegExp(`(?<result>.*(?:(?!${u}).))(?:${u})`,d).exec(c);return(f?.groups?f.groups.result:c)+r}function dl(e){return e==null?30:e<=0?0:e}function fl(e){return Jn(N(e))}function pl(e){return $(Ac(Q(e))).map(e=>e.toUpperCase()).join(` `)}function ml(e){return Yn(N(e))}function hl(e){let t=e.length,n=e.map(e=>{let t=e[0],n=e[1];if(!O(n))throw TypeError(`Expected a function`);return[z(t),n]});return function(...e){for(let r=0;r<t;r++){let t=n[r],i=t[0],a=t[1];if(i.apply(this,e))return a.apply(this,e)}}}function gl(e){return()=>e}function _l(e,t){return e==null||Number.isNaN(e)?t:e}function vl(e,t){return typeof e==`string`&&typeof t==`string`?e>t:W(e)>W(t)}function yl(e,t){return typeof e==`string`&&typeof t==`string`?e>=t:W(e)>=W(t)}function bl(e,t,...n){if(n=n.flat(1),e!=null)switch(typeof t){case`string`:return typeof e==`object`&&Object.hasOwn(e,t)?xl(e,[t],n):xl(e,P(t),n);case`number`:case`symbol`:return xl(e,[t],n);default:return Array.isArray(t)?xl(e,t,n):xl(e,[t],n)}}function xl(e,t,n){let r=F(e,t.slice(0,-1),e);if(r==null)return;let i=H(t),a=i?.valueOf();return i=typeof a==`number`?M(a):String(i),F(r,i)?.apply(r,n)}function Sl(e,t){return typeof e==`string`&&typeof t==`string`?e<t:W(e)<W(t)}function Cl(e,t){return typeof e==`string`&&typeof t==`string`?e<=t:W(e)<=W(t)}function wl(e,...t){return function(n){return bl(n,e,t)}}function Tl(e,...t){return function(n){return bl(e,n,t)}}function El(){return Date.now()}function Dl(...e){e.length===1&&Array.isArray(e[0])&&(e=e[0]);let t=e.map(e=>z(e));return function(...e){return t.map(t=>t.apply(this,e))}}function Ol(...e){return function(...t){for(let n=0;n<e.length;++n){let r=e[n];if(!Array.isArray(r)){if(!z(r).apply(this,t))return!1;continue}for(let e=0;e<r.length;++e)if(!z(r[e]).apply(this,t))return!1}return!0}}function kl(...e){return function(...t){for(let n=0;n<e.length;++n){let r=e[n];if(!Array.isArray(r)){if(z(r).apply(this,t))return!0;continue}for(let e=0;e<r.length;++e)if(z(r[e]).apply(this,t))return!0}return!1}}function Al(){return[]}function jl(){return!1}function Ml(){return{}}function Nl(){return``}function Pl(){return!0}function Fl(e){return e==null?0:ji(K(e),0,4294967295)}function Il(e){let t={},n=Z(e);for(let r=0;r<n.length;r++){let i=n[r],a=e[i];i===`__proto__`?Object.defineProperty(t,i,{configurable:!0,enumerable:!0,value:a,writable:!0}):t[i]=a}return t}function Ll(e){return e==null?0:ji(K(e),-Uc,Uc)}let Rl=0;function zl(e=``){return`${e}${++Rl}`}function Bl(e,t,n){if(!e)return!0;n&&q(e,t,n)&&(t=void 0);let r=z(t??_);if(!j(e)){let t=Object.keys(e);for(let n=0;n<t.length;n++){let i=t[n],a=e[i];if(!r(a,i,e))return!1}return!0}for(let t=0;t<e.length;t++)if(!r(e[t],t,e))return!1;return!0}e.AbortError=Pe,e.Mutex=Pn,e.Semaphore=m,e.TimeoutError=Fe,e.add=bo,e.after=Va,e.allKeyed=Nn,e.ary=Ha,e.assert=Zn,e.invariant=Zn,e.assign=Ho,e.assignIn=qo,e.extend=qo,e.assignInWith=Yo,e.extendWith=Yo,e.assignWith=Zo,e.asyncNoop=Re,e.at=xi,e.attempt=Ua,e.attemptAsync=Xn,e.before=Wa,e.bind=Ga,e.bindAll=yc,e.bindKey=Ka,e.camelCase=jc,e.capitalize=vc,e.cartesianProduct=t,e.castArray=Qn,e.ceil=So,e.chunk=$n,e.chunkBy=r,e.clamp=ji,e.clone=$o,e.cloneDeep=hr,e.cloneDeepWith=mr,e.cloneWith=as,e.combinations=i,e.compact=er,e.concat=tr,e.cond=hl,e.conforms=ic,e.conformsTo=rc,e.constant=gl,e.constantCase=Xt,e.countBy=br,e.create=os,e.curry=qa,e.curryRight=Za,e.debounce=to,e.deburr=Q,e.deepFreeze=Pt,e.defaultTo=_l,e.defaults=ss,e.defaultsDeep=cs,e.defer=no,e.delay=ro,e.difference=Sr,e.differenceBy=wr,e.differenceWith=Tr,e.divide=Co,e.drop=Er,e.dropRight=Dr,e.dropRightWhile=Or,e.dropWhile=Ar,e.each=Mr,e.forEach=Mr,e.eachRight=Nr,e.forEachRight=Nr,e.endsWith=Mc,e.eq=D,e.escape=Nc,e.escapeRegExp=Pc,e.every=Bl,e.fill=Fr,e.filter=Ir,e.filterAsync=ee,e.find=Lr,e.findIndex=Rr,e.findKey=_s,e.findLast=zr,e.findLastIndex=Br,e.findLastKey=vs,e.first=Vr,e.head=Vr,e.flatMap=Kr,e.flatMapAsync=ne,e.flatMapDeep=qr,e.flatMapDepth=Gr,e.flatten=Jr,e.flattenDeep=Yr,e.flattenDepth=Hr,e.flattenObject=It,e.flip=io,e.floor=wo,e.flow=ao,e.flowRight=oo,e.forEachAsync=re,e.forIn=ys,e.forInRight=bs,e.forOwn=xs,e.forOwnRight=Ss,e.fromPairs=Cs,e.functions=ws,e.functionsIn=Ts,e.get=F,e.groupBy=Xr,e.gt=vl,e.gte=yl,e.has=vr,e.hasIn=Es,e.identity=J,e.inRange=To,e.includes=Zr,e.indexOf=Qr,e.initial=$r,e.intersection=ei,e.intersectionBy=ti,e.intersectionWith=ni,e.invert=Ds,e.invertBy=Os,e.invoke=bl,e.invokeMap=ri,e.isArguments=R,e.isArray=T,e.isArrayBuffer=ac,e.isArrayLike=j,e.isArrayLikeObject=V,e.isBlob=sn,e.isBoolean=oc,e.isBrowser=cn,e.isBuffer=Ks,e.isDate=sc,e.isElement=cc,e.isEmpty=lc,e.isEmptyObject=un,e.isEqual=mn,e.isEqualWith=uc,e.isError=dc,e.isFile=hn,e.isFinite=fc,e.isFunction=Xs,e.isInteger=pc,e.isIterable=gn,e.isJSON=_n,e.isJSONArray=yn,e.isJSONObject=bn,e.isJSONValue=vn,e.isLength=Zs,e.isMap=Mi,e.isMatch=pr,e.isMatchWith=sr,e.isNaN=la,e.isNative=ec,e.isNil=Bi,e.isNode=Cn,e.isNotNil=wn,e.isNull=tc,e.isNumber=ca,e.isObject=I,e.isObjectLike=B,e.isPlainObject=E,e.isPrimitive=at,e.isPromise=En,e.isRegExp=mc,e.isSafeInteger=hc,e.isSet=Ni,e.isString=Pr,e.isSubset=ue,e.isSubsetWith=de,e.isSymbol=U,e.isTypedArray=Y,e.isUndefined=nc,e.isWeakMap=gc,e.isWeakSet=_c,e.iteratee=z,e.join=ii,e.kebabCase=Fc,e.keyBy=oi,e.keys=X,e.keysIn=Z,e.last=H,e.lastIndexOf=si,e.limitAsync=h,e.lowerCase=Ic,e.lowerFirst=Lc,e.lt=Sl,e.lte=Cl,e.map=Wr,e.mapAsync=pe,e.mapKeys=ks,e.mapKeysAsync=Bt,e.mapValues=As,e.mapValuesAsync=Ht,e.matches=L,e.matchesProperty=yr,e.max=Eo,e.maxBy=Do,e.mean=Ao,e.meanBy=jo,e.median=tt,e.medianBy=nt,e.memoize=so,e.merge=Ns,e.mergeWith=js,e.method=wl,e.methodOf=Tl,e.min=Mo,e.minBy=No,e.multiply=Po,e.negate=Ei,e.noop=Vo,e.now=El,e.nth=ci,e.nthArg=co,e.omit=Fs,e.omitBy=zs,e.once=lo,e.orderBy=mi,e.over=Dl,e.overArgs=uo,e.overEvery=Ol,e.overSome=kl,e.pad=Bc,e.padEnd=Vc,e.padStart=Hc,e.parseInt=Fo,e.partial=fo,e.partialRight=po,e.partition=hi,e.pascalCase=tn,e.percentile=rt,e.pick=Bs,e.pickBy=Vs,e.property=or,e.propertyOf=Hs,e.pull=gi,e.pullAll=_i,e.pullAllBy=vi,e.pullAllWith=bi,e.pullAt=wi,e.random=Io,e.randomInt=ye,e.range=Lo,e.rangeRight=Ro,e.rearg=mo,e.reduce=ai,e.reduceAsync=he,e.reduceRight=Ti,e.reject=Di,e.remove=Oi,e.repeat=Wc,e.replace=Gc,e.rest=ho,e.result=Us,e.retry=et,e.reverse=ki,e.reverseString=Un,e.round=zo,e.sample=Ai,e.sampleSize=Fi,e.set=Ra,e.setWith=Ws,e.shuffle=Vi,e.size=ia,e.slice=aa,e.snakeCase=Kc,e.some=oa,e.sortBy=sa,e.sortKeys=Wt,e.sortedIndex=da,e.sortedIndexBy=ua,e.sortedIndexOf=fa,e.sortedLastIndex=ma,e.sortedLastIndexBy=pa,e.sortedLastIndexOf=ha,e.split=qc,e.spread=go,e.startCase=Jc,e.startsWith=Yc,e.stubArray=Al,e.stubFalse=jl,e.stubObject=Ml,e.stubString=Nl,e.stubTrue=Pl,e.subtract=Bo,e.sum=ko,e.sumBy=Oo,e.tail=ga,e.take=_a,e.takeRight=va,e.takeRightWhile=ya,e.takeWhile=ba,e.template=rl,e.templateSettings=il,e.throttle=_o,e.timeout=Fn,e.times=Li,e.toArray=Pi,e.toCamelCaseKeys=Yt,e.toConstantCaseKeys=Zt,e.toDefaulted=Gs,e.toFilled=Te,e.toFinite=G,e.toInteger=K,e.toKebabCaseKeys=$t,e.toLength=Fl,e.toLower=al,e.toMerged=en,e.toNumber=W,e.toPairs=hs,e.toPairsIn=gs,e.toPascalCaseKeys=nn,e.toPath=P,e.toPlainObject=Il,e.toSafeInteger=Ll,e.toSnakeCaseKeys=an,e.toString=N,e.toUpper=ol,e.transform=qs,e.trim=sl,e.trimEnd=cl,e.trimStart=ll,e.truncate=ul,e.unary=vo,e.unescape=fl,e.union=xa,e.unionBy=Sa,e.unionWith=Ca,e.uniq=wa,e.uniqBy=Ta,e.uniqWith=Ea,e.uniqueId=zl,e.unset=Si,e.unzip=Da,e.unzipWith=Oa,e.update=Js,e.updateWith=La,e.upperCase=pl,e.upperFirst=ml,e.values=zi,e.valuesIn=Ys,e.windowed=ke,e.withTimeout=In,e.without=ka,e.words=$,e.wrap=yo,e.xor=Aa,e.xorBy=ja,e.xorWith=Ma,e.zip=Na,e.zipObject=Fa,e.zipObjectDeep=za,e.zipWith=Ba});
@@ -1,4 +1,6 @@
1
1
  const require_isPrimitive = require("../../predicate/isPrimitive.js");
2
+ const require_getTag = require("../_internal/getTag.js");
3
+ require("../_internal/tags.js");
2
4
  const require_eq = require("../util/eq.js");
3
5
  const require_isObject = require("./isObject.js");
4
6
  //#region src/compat/predicate/isMatchWith.ts
@@ -19,7 +21,8 @@ const require_isObject = require("./isObject.js");
19
21
  * - **Primitives**: Matches using strict equality
20
22
  *
21
23
  * Special cases:
22
- * - Empty objects, arrays, Maps, and Sets always match any target
24
+ * - Empty arrays, Maps, and Sets always match any target
25
+ * - An empty object matches any target at the top level, but at nested levels it only matches object targets
23
26
  * - `null` and `undefined` source values have specific matching rules
24
27
  * - Circular references are handled using an internal stack to prevent infinite recursion
25
28
  *
@@ -82,7 +85,7 @@ function isMatchWith(target, source, compare) {
82
85
  function isMatchWithInternal(target, source, compare, stack, isRoot = false) {
83
86
  if (source === target) return true;
84
87
  switch (typeof source) {
85
- case "object": return isObjectMatch(target, source, compare, stack);
88
+ case "object": return isObjectMatch(target, source, compare, stack, isRoot);
86
89
  case "function":
87
90
  if (Object.keys(source).length > 0) return isMatchWithInternal(target, { ...source }, compare, stack, isRoot);
88
91
  return require_eq.eq(target, source);
@@ -95,20 +98,26 @@ function isMatchWithInternal(target, source, compare, stack, isRoot = false) {
95
98
  return require_eq.eq(target, source);
96
99
  }
97
100
  }
98
- function isObjectMatch(target, source, compare, stack) {
101
+ function isObjectMatch(target, source, compare, stack, isRoot = false) {
99
102
  if (source == null) return true;
100
103
  if (Array.isArray(source)) return isArrayMatch(target, source, compare, stack);
101
104
  if (source instanceof Map) return isMapMatch(target, source, compare, stack);
102
105
  if (source instanceof Set) return isSetMatch(target, source, compare, stack);
103
106
  const keys = Object.keys(source);
104
- if (target == null || require_isPrimitive.isPrimitive(target)) return keys.length === 0;
107
+ if (target == null) return isRoot && keys.length === 0;
108
+ if (isRoot) {
109
+ if (require_isPrimitive.isPrimitive(target)) target = Object(target);
110
+ } else {
111
+ const tag = require_getTag.getTag(target);
112
+ if (tag !== "[object Object]" && tag !== "[object Arguments]") return false;
113
+ }
105
114
  if (keys.length === 0) return true;
106
115
  if (stack?.has(source)) return stack.get(source) === target;
107
116
  stack?.set(source, target);
108
117
  try {
109
118
  for (let i = 0; i < keys.length; i++) {
110
119
  const key = keys[i];
111
- if (!require_isPrimitive.isPrimitive(target) && !(key in target)) return false;
120
+ if (!(key in target)) return false;
112
121
  if (source[key] === void 0 && target[key] !== void 0) return false;
113
122
  if (source[key] === null && target[key] !== null) return false;
114
123
  if (!compare(target[key], source[key], key, target, source, stack)) return false;
@@ -1,4 +1,6 @@
1
1
  import { isPrimitive } from "../../predicate/isPrimitive.mjs";
2
+ import { getTag } from "../_internal/getTag.mjs";
3
+ import "../_internal/tags.mjs";
2
4
  import { eq } from "../util/eq.mjs";
3
5
  import { isObject } from "./isObject.mjs";
4
6
  //#region src/compat/predicate/isMatchWith.ts
@@ -19,7 +21,8 @@ import { isObject } from "./isObject.mjs";
19
21
  * - **Primitives**: Matches using strict equality
20
22
  *
21
23
  * Special cases:
22
- * - Empty objects, arrays, Maps, and Sets always match any target
24
+ * - Empty arrays, Maps, and Sets always match any target
25
+ * - An empty object matches any target at the top level, but at nested levels it only matches object targets
23
26
  * - `null` and `undefined` source values have specific matching rules
24
27
  * - Circular references are handled using an internal stack to prevent infinite recursion
25
28
  *
@@ -82,7 +85,7 @@ function isMatchWith(target, source, compare) {
82
85
  function isMatchWithInternal(target, source, compare, stack, isRoot = false) {
83
86
  if (source === target) return true;
84
87
  switch (typeof source) {
85
- case "object": return isObjectMatch(target, source, compare, stack);
88
+ case "object": return isObjectMatch(target, source, compare, stack, isRoot);
86
89
  case "function":
87
90
  if (Object.keys(source).length > 0) return isMatchWithInternal(target, { ...source }, compare, stack, isRoot);
88
91
  return eq(target, source);
@@ -95,20 +98,26 @@ function isMatchWithInternal(target, source, compare, stack, isRoot = false) {
95
98
  return eq(target, source);
96
99
  }
97
100
  }
98
- function isObjectMatch(target, source, compare, stack) {
101
+ function isObjectMatch(target, source, compare, stack, isRoot = false) {
99
102
  if (source == null) return true;
100
103
  if (Array.isArray(source)) return isArrayMatch(target, source, compare, stack);
101
104
  if (source instanceof Map) return isMapMatch(target, source, compare, stack);
102
105
  if (source instanceof Set) return isSetMatch(target, source, compare, stack);
103
106
  const keys = Object.keys(source);
104
- if (target == null || isPrimitive(target)) return keys.length === 0;
107
+ if (target == null) return isRoot && keys.length === 0;
108
+ if (isRoot) {
109
+ if (isPrimitive(target)) target = Object(target);
110
+ } else {
111
+ const tag = getTag(target);
112
+ if (tag !== "[object Object]" && tag !== "[object Arguments]") return false;
113
+ }
105
114
  if (keys.length === 0) return true;
106
115
  if (stack?.has(source)) return stack.get(source) === target;
107
116
  stack?.set(source, target);
108
117
  try {
109
118
  for (let i = 0; i < keys.length; i++) {
110
119
  const key = keys[i];
111
- if (!isPrimitive(target) && !(key in target)) return false;
120
+ if (!(key in target)) return false;
112
121
  if (source[key] === void 0 && target[key] !== void 0) return false;
113
122
  if (source[key] === null && target[key] !== null) return false;
114
123
  if (!compare(target[key], source[key], key, target, source, stack)) return false;
package/dist/index.d.mts CHANGED
@@ -113,7 +113,9 @@ import { findKey } from "./object/findKey.mjs";
113
113
  import { flattenObject } from "./object/flattenObject.mjs";
114
114
  import { invert } from "./object/invert.mjs";
115
115
  import { mapKeys } from "./object/mapKeys.mjs";
116
+ import { mapKeysAsync } from "./object/mapKeysAsync.mjs";
116
117
  import { mapValues } from "./object/mapValues.mjs";
118
+ import { mapValuesAsync } from "./object/mapValuesAsync.mjs";
117
119
  import { merge } from "./object/merge.mjs";
118
120
  import { mergeWith } from "./object/mergeWith.mjs";
119
121
  import { omit } from "./object/omit.mjs";
@@ -189,4 +191,4 @@ import { words } from "./string/words.mjs";
189
191
  import { attempt } from "./util/attempt.mjs";
190
192
  import { attemptAsync } from "./util/attemptAsync.mjs";
191
193
  import { invariant } from "./util/invariant.mjs";
192
- export { AbortError, DebounceOptions, DebouncedFunction, MemoizeCache, Mutex, Semaphore, ThrottleOptions, ThrottledFunction, TimeoutError, after, allKeyed, ary, invariant as assert, asyncNoop, at, attempt, attemptAsync, before, camelCase, capitalize, cartesianProduct, chunk, chunkBy, clamp, clone, cloneDeep, cloneDeepWith, combinations, compact, constantCase, countBy, curry, curryRight, debounce, deburr, deepFreeze, delay, difference, differenceBy, differenceWith, drop, dropRight, dropRightWhile, dropWhile, escape, escapeRegExp, fill, filterAsync, findKey, flatMap, flatMapAsync, flatMapDeep, flatten, flattenDeep, flattenObject, flow, flowRight, forEachAsync, forEachRight, groupBy, head, identity, inRange, initial, intersection, intersectionBy, intersectionWith, invariant, invert, isArrayBuffer, isBlob, isBoolean, isBrowser, isBuffer, isDate, isEmptyObject, isEqual, isEqualWith, isError, isFile, isFunction, isIterable, isJSON, isJSONArray, isJSONObject, isJSONValue, isLength, isMap, isNil, isNode, isNotNil, isNull, isNumber, isPlainObject, isPrimitive, isPromise, isRegExp, isSet, isString, isSubset, isSubsetWith, isSymbol, isTypedArray, isUndefined, isWeakMap, isWeakSet, kebabCase, keyBy, last, limitAsync, lowerCase, lowerFirst, mapAsync, mapKeys, mapValues, maxBy, mean, meanBy, median, medianBy, memoize, merge, mergeWith, minBy, negate, noop, omit, omitBy, once, orderBy, pad, partial, partialRight, partition, pascalCase, percentile, pick, pickBy, pull, pullAt, random, randomInt, range, rangeRight, reduceAsync, remove, rest, retry, reverseString, round, sample, sampleSize, shuffle, snakeCase, sortBy, sortKeys, spread, startCase, sum, sumBy, tail, take, takeRight, takeRightWhile, takeWhile, throttle, timeout, toCamelCaseKeys, toConstantCaseKeys, toFilled, toKebabCaseKeys, toMerged, toPascalCaseKeys, toSnakeCaseKeys, trim, trimEnd, trimStart, unary, unescape, union, unionBy, unionWith, uniq, uniqBy, uniqWith, unzip, unzipWith, upperCase, upperFirst, windowed, withTimeout, without, words, xor, xorBy, xorWith, zip, zipObject, zipWith };
194
+ export { AbortError, DebounceOptions, DebouncedFunction, MemoizeCache, Mutex, Semaphore, ThrottleOptions, ThrottledFunction, TimeoutError, after, allKeyed, ary, invariant as assert, asyncNoop, at, attempt, attemptAsync, before, camelCase, capitalize, cartesianProduct, chunk, chunkBy, clamp, clone, cloneDeep, cloneDeepWith, combinations, compact, constantCase, countBy, curry, curryRight, debounce, deburr, deepFreeze, delay, difference, differenceBy, differenceWith, drop, dropRight, dropRightWhile, dropWhile, escape, escapeRegExp, fill, filterAsync, findKey, flatMap, flatMapAsync, flatMapDeep, flatten, flattenDeep, flattenObject, flow, flowRight, forEachAsync, forEachRight, groupBy, head, identity, inRange, initial, intersection, intersectionBy, intersectionWith, invariant, invert, isArrayBuffer, isBlob, isBoolean, isBrowser, isBuffer, isDate, isEmptyObject, isEqual, isEqualWith, isError, isFile, isFunction, isIterable, isJSON, isJSONArray, isJSONObject, isJSONValue, isLength, isMap, isNil, isNode, isNotNil, isNull, isNumber, isPlainObject, isPrimitive, isPromise, isRegExp, isSet, isString, isSubset, isSubsetWith, isSymbol, isTypedArray, isUndefined, isWeakMap, isWeakSet, kebabCase, keyBy, last, limitAsync, lowerCase, lowerFirst, mapAsync, mapKeys, mapKeysAsync, mapValues, mapValuesAsync, maxBy, mean, meanBy, median, medianBy, memoize, merge, mergeWith, minBy, negate, noop, omit, omitBy, once, orderBy, pad, partial, partialRight, partition, pascalCase, percentile, pick, pickBy, pull, pullAt, random, randomInt, range, rangeRight, reduceAsync, remove, rest, retry, reverseString, round, sample, sampleSize, shuffle, snakeCase, sortBy, sortKeys, spread, startCase, sum, sumBy, tail, take, takeRight, takeRightWhile, takeWhile, throttle, timeout, toCamelCaseKeys, toConstantCaseKeys, toFilled, toKebabCaseKeys, toMerged, toPascalCaseKeys, toSnakeCaseKeys, trim, trimEnd, trimStart, unary, unescape, union, unionBy, unionWith, uniq, uniqBy, uniqWith, unzip, unzipWith, upperCase, upperFirst, windowed, withTimeout, without, words, xor, xorBy, xorWith, zip, zipObject, zipWith };
package/dist/index.d.ts CHANGED
@@ -113,7 +113,9 @@ import { findKey } from "./object/findKey.js";
113
113
  import { flattenObject } from "./object/flattenObject.js";
114
114
  import { invert } from "./object/invert.js";
115
115
  import { mapKeys } from "./object/mapKeys.js";
116
+ import { mapKeysAsync } from "./object/mapKeysAsync.js";
116
117
  import { mapValues } from "./object/mapValues.js";
118
+ import { mapValuesAsync } from "./object/mapValuesAsync.js";
117
119
  import { merge } from "./object/merge.js";
118
120
  import { mergeWith } from "./object/mergeWith.js";
119
121
  import { omit } from "./object/omit.js";
@@ -189,4 +191,4 @@ import { words } from "./string/words.js";
189
191
  import { attempt } from "./util/attempt.js";
190
192
  import { attemptAsync } from "./util/attemptAsync.js";
191
193
  import { invariant } from "./util/invariant.js";
192
- export { AbortError, DebounceOptions, DebouncedFunction, MemoizeCache, Mutex, Semaphore, ThrottleOptions, ThrottledFunction, TimeoutError, after, allKeyed, ary, invariant as assert, asyncNoop, at, attempt, attemptAsync, before, camelCase, capitalize, cartesianProduct, chunk, chunkBy, clamp, clone, cloneDeep, cloneDeepWith, combinations, compact, constantCase, countBy, curry, curryRight, debounce, deburr, deepFreeze, delay, difference, differenceBy, differenceWith, drop, dropRight, dropRightWhile, dropWhile, escape, escapeRegExp, fill, filterAsync, findKey, flatMap, flatMapAsync, flatMapDeep, flatten, flattenDeep, flattenObject, flow, flowRight, forEachAsync, forEachRight, groupBy, head, identity, inRange, initial, intersection, intersectionBy, intersectionWith, invariant, invert, isArrayBuffer, isBlob, isBoolean, isBrowser, isBuffer, isDate, isEmptyObject, isEqual, isEqualWith, isError, isFile, isFunction, isIterable, isJSON, isJSONArray, isJSONObject, isJSONValue, isLength, isMap, isNil, isNode, isNotNil, isNull, isNumber, isPlainObject, isPrimitive, isPromise, isRegExp, isSet, isString, isSubset, isSubsetWith, isSymbol, isTypedArray, isUndefined, isWeakMap, isWeakSet, kebabCase, keyBy, last, limitAsync, lowerCase, lowerFirst, mapAsync, mapKeys, mapValues, maxBy, mean, meanBy, median, medianBy, memoize, merge, mergeWith, minBy, negate, noop, omit, omitBy, once, orderBy, pad, partial, partialRight, partition, pascalCase, percentile, pick, pickBy, pull, pullAt, random, randomInt, range, rangeRight, reduceAsync, remove, rest, retry, reverseString, round, sample, sampleSize, shuffle, snakeCase, sortBy, sortKeys, spread, startCase, sum, sumBy, tail, take, takeRight, takeRightWhile, takeWhile, throttle, timeout, toCamelCaseKeys, toConstantCaseKeys, toFilled, toKebabCaseKeys, toMerged, toPascalCaseKeys, toSnakeCaseKeys, trim, trimEnd, trimStart, unary, unescape, union, unionBy, unionWith, uniq, uniqBy, uniqWith, unzip, unzipWith, upperCase, upperFirst, windowed, withTimeout, without, words, xor, xorBy, xorWith, zip, zipObject, zipWith };
194
+ export { AbortError, DebounceOptions, DebouncedFunction, MemoizeCache, Mutex, Semaphore, ThrottleOptions, ThrottledFunction, TimeoutError, after, allKeyed, ary, invariant as assert, asyncNoop, at, attempt, attemptAsync, before, camelCase, capitalize, cartesianProduct, chunk, chunkBy, clamp, clone, cloneDeep, cloneDeepWith, combinations, compact, constantCase, countBy, curry, curryRight, debounce, deburr, deepFreeze, delay, difference, differenceBy, differenceWith, drop, dropRight, dropRightWhile, dropWhile, escape, escapeRegExp, fill, filterAsync, findKey, flatMap, flatMapAsync, flatMapDeep, flatten, flattenDeep, flattenObject, flow, flowRight, forEachAsync, forEachRight, groupBy, head, identity, inRange, initial, intersection, intersectionBy, intersectionWith, invariant, invert, isArrayBuffer, isBlob, isBoolean, isBrowser, isBuffer, isDate, isEmptyObject, isEqual, isEqualWith, isError, isFile, isFunction, isIterable, isJSON, isJSONArray, isJSONObject, isJSONValue, isLength, isMap, isNil, isNode, isNotNil, isNull, isNumber, isPlainObject, isPrimitive, isPromise, isRegExp, isSet, isString, isSubset, isSubsetWith, isSymbol, isTypedArray, isUndefined, isWeakMap, isWeakSet, kebabCase, keyBy, last, limitAsync, lowerCase, lowerFirst, mapAsync, mapKeys, mapKeysAsync, mapValues, mapValuesAsync, maxBy, mean, meanBy, median, medianBy, memoize, merge, mergeWith, minBy, negate, noop, omit, omitBy, once, orderBy, pad, partial, partialRight, partition, pascalCase, percentile, pick, pickBy, pull, pullAt, random, randomInt, range, rangeRight, reduceAsync, remove, rest, retry, reverseString, round, sample, sampleSize, shuffle, snakeCase, sortBy, sortKeys, spread, startCase, sum, sumBy, tail, take, takeRight, takeRightWhile, takeWhile, throttle, timeout, toCamelCaseKeys, toConstantCaseKeys, toFilled, toKebabCaseKeys, toMerged, toPascalCaseKeys, toSnakeCaseKeys, trim, trimEnd, trimStart, unary, unescape, union, unionBy, unionWith, uniq, uniqBy, uniqWith, unzip, unzipWith, upperCase, upperFirst, windowed, withTimeout, without, words, xor, xorBy, xorWith, zip, zipObject, zipWith };
package/dist/index.js CHANGED
@@ -123,7 +123,9 @@ const require_isPlainObject = require("./predicate/isPlainObject.js");
123
123
  const require_flattenObject = require("./object/flattenObject.js");
124
124
  const require_invert = require("./object/invert.js");
125
125
  const require_mapKeys = require("./object/mapKeys.js");
126
+ const require_mapKeysAsync = require("./object/mapKeysAsync.js");
126
127
  const require_mapValues = require("./object/mapValues.js");
128
+ const require_mapValuesAsync = require("./object/mapValuesAsync.js");
127
129
  const require_merge = require("./object/merge.js");
128
130
  const require_mergeWith = require("./object/mergeWith.js");
129
131
  const require_omit = require("./object/omit.js");
@@ -308,7 +310,9 @@ exports.lowerCase = require_lowerCase.lowerCase;
308
310
  exports.lowerFirst = require_lowerFirst.lowerFirst;
309
311
  exports.mapAsync = require_mapAsync.mapAsync;
310
312
  exports.mapKeys = require_mapKeys.mapKeys;
313
+ exports.mapKeysAsync = require_mapKeysAsync.mapKeysAsync;
311
314
  exports.mapValues = require_mapValues.mapValues;
315
+ exports.mapValuesAsync = require_mapValuesAsync.mapValuesAsync;
312
316
  exports.maxBy = require_maxBy.maxBy;
313
317
  exports.mean = require_mean.mean;
314
318
  exports.meanBy = require_meanBy.meanBy;
package/dist/index.mjs CHANGED
@@ -122,7 +122,9 @@ import { isPlainObject } from "./predicate/isPlainObject.mjs";
122
122
  import { flattenObject } from "./object/flattenObject.mjs";
123
123
  import { invert } from "./object/invert.mjs";
124
124
  import { mapKeys } from "./object/mapKeys.mjs";
125
+ import { mapKeysAsync } from "./object/mapKeysAsync.mjs";
125
126
  import { mapValues } from "./object/mapValues.mjs";
127
+ import { mapValuesAsync } from "./object/mapValuesAsync.mjs";
126
128
  import { merge } from "./object/merge.mjs";
127
129
  import { mergeWith } from "./object/mergeWith.mjs";
128
130
  import { omit } from "./object/omit.mjs";
@@ -198,4 +200,4 @@ import { attempt } from "./util/attempt.mjs";
198
200
  import { attemptAsync } from "./util/attemptAsync.mjs";
199
201
  import { invariant } from "./util/invariant.mjs";
200
202
  import "./util/index.mjs";
201
- export { AbortError, Mutex, Semaphore, TimeoutError, after, allKeyed, ary, invariant as assert, asyncNoop, at, attempt, attemptAsync, before, camelCase, capitalize, cartesianProduct, chunk, chunkBy, clamp, clone, cloneDeep, cloneDeepWith, combinations, compact, constantCase, countBy, curry, curryRight, debounce, deburr, deepFreeze, delay, difference, differenceBy, differenceWith, drop, dropRight, dropRightWhile, dropWhile, escape, escapeRegExp, fill, filterAsync, findKey, flatMap, flatMapAsync, flatMapDeep, flatten, flattenDeep, flattenObject, flow, flowRight, forEachAsync, forEachRight, groupBy, head, identity, inRange, initial, intersection, intersectionBy, intersectionWith, invariant, invert, isArrayBuffer, isBlob, isBoolean, isBrowser, isBuffer, isDate, isEmptyObject, isEqual, isEqualWith, isError, isFile, isFunction, isIterable, isJSON, isJSONArray, isJSONObject, isJSONValue, isLength, isMap, isNil, isNode, isNotNil, isNull, isNumber, isPlainObject, isPrimitive, isPromise, isRegExp, isSet, isString, isSubset, isSubsetWith, isSymbol, isTypedArray, isUndefined, isWeakMap, isWeakSet, kebabCase, keyBy, last, limitAsync, lowerCase, lowerFirst, mapAsync, mapKeys, mapValues, maxBy, mean, meanBy, median, medianBy, memoize, merge, mergeWith, minBy, negate, noop, omit, omitBy, once, orderBy, pad, partial, partialRight, partition, pascalCase, percentile, pick, pickBy, pull, pullAt, random, randomInt, range, rangeRight, reduceAsync, remove, rest, retry, reverseString, round, sample, sampleSize, shuffle, snakeCase, sortBy, sortKeys, spread, startCase, sum, sumBy, tail, take, takeRight, takeRightWhile, takeWhile, throttle, timeout, toCamelCaseKeys, toConstantCaseKeys, toFilled, toKebabCaseKeys, toMerged, toPascalCaseKeys, toSnakeCaseKeys, trim, trimEnd, trimStart, unary, unescape, union, unionBy, unionWith, uniq, uniqBy, uniqWith, unzip, unzipWith, upperCase, upperFirst, windowed, withTimeout, without, words, xor, xorBy, xorWith, zip, zipObject, zipWith };
203
+ export { AbortError, Mutex, Semaphore, TimeoutError, after, allKeyed, ary, invariant as assert, asyncNoop, at, attempt, attemptAsync, before, camelCase, capitalize, cartesianProduct, chunk, chunkBy, clamp, clone, cloneDeep, cloneDeepWith, combinations, compact, constantCase, countBy, curry, curryRight, debounce, deburr, deepFreeze, delay, difference, differenceBy, differenceWith, drop, dropRight, dropRightWhile, dropWhile, escape, escapeRegExp, fill, filterAsync, findKey, flatMap, flatMapAsync, flatMapDeep, flatten, flattenDeep, flattenObject, flow, flowRight, forEachAsync, forEachRight, groupBy, head, identity, inRange, initial, intersection, intersectionBy, intersectionWith, invariant, invert, isArrayBuffer, isBlob, isBoolean, isBrowser, isBuffer, isDate, isEmptyObject, isEqual, isEqualWith, isError, isFile, isFunction, isIterable, isJSON, isJSONArray, isJSONObject, isJSONValue, isLength, isMap, isNil, isNode, isNotNil, isNull, isNumber, isPlainObject, isPrimitive, isPromise, isRegExp, isSet, isString, isSubset, isSubsetWith, isSymbol, isTypedArray, isUndefined, isWeakMap, isWeakSet, kebabCase, keyBy, last, limitAsync, lowerCase, lowerFirst, mapAsync, mapKeys, mapKeysAsync, mapValues, mapValuesAsync, maxBy, mean, meanBy, median, medianBy, memoize, merge, mergeWith, minBy, negate, noop, omit, omitBy, once, orderBy, pad, partial, partialRight, partition, pascalCase, percentile, pick, pickBy, pull, pullAt, random, randomInt, range, rangeRight, reduceAsync, remove, rest, retry, reverseString, round, sample, sampleSize, shuffle, snakeCase, sortBy, sortKeys, spread, startCase, sum, sumBy, tail, take, takeRight, takeRightWhile, takeWhile, throttle, timeout, toCamelCaseKeys, toConstantCaseKeys, toFilled, toKebabCaseKeys, toMerged, toPascalCaseKeys, toSnakeCaseKeys, trim, trimEnd, trimStart, unary, unescape, union, unionBy, unionWith, uniq, uniqBy, uniqWith, unzip, unzipWith, upperCase, upperFirst, windowed, withTimeout, without, words, xor, xorBy, xorWith, zip, zipObject, zipWith };
@@ -6,7 +6,9 @@ import { findKey } from "./findKey.mjs";
6
6
  import { flattenObject } from "./flattenObject.mjs";
7
7
  import { invert } from "./invert.mjs";
8
8
  import { mapKeys } from "./mapKeys.mjs";
9
+ import { mapKeysAsync } from "./mapKeysAsync.mjs";
9
10
  import { mapValues } from "./mapValues.mjs";
11
+ import { mapValuesAsync } from "./mapValuesAsync.mjs";
10
12
  import { merge } from "./merge.mjs";
11
13
  import { mergeWith } from "./mergeWith.mjs";
12
14
  import { omit } from "./omit.mjs";
@@ -20,4 +22,4 @@ import { toKebabCaseKeys } from "./toKebabCaseKeys.mjs";
20
22
  import { toMerged } from "./toMerged.mjs";
21
23
  import { toPascalCaseKeys } from "./toPascalCaseKeys.mjs";
22
24
  import { toSnakeCaseKeys } from "./toSnakeCaseKeys.mjs";
23
- export { clone, cloneDeep, cloneDeepWith, deepFreeze, findKey, flattenObject, invert, mapKeys, mapValues, merge, mergeWith, omit, omitBy, pick, pickBy, sortKeys, toCamelCaseKeys, toConstantCaseKeys, toKebabCaseKeys, toMerged, toPascalCaseKeys, toSnakeCaseKeys };
25
+ export { clone, cloneDeep, cloneDeepWith, deepFreeze, findKey, flattenObject, invert, mapKeys, mapKeysAsync, mapValues, mapValuesAsync, merge, mergeWith, omit, omitBy, pick, pickBy, sortKeys, toCamelCaseKeys, toConstantCaseKeys, toKebabCaseKeys, toMerged, toPascalCaseKeys, toSnakeCaseKeys };
@@ -6,7 +6,9 @@ import { findKey } from "./findKey.js";
6
6
  import { flattenObject } from "./flattenObject.js";
7
7
  import { invert } from "./invert.js";
8
8
  import { mapKeys } from "./mapKeys.js";
9
+ import { mapKeysAsync } from "./mapKeysAsync.js";
9
10
  import { mapValues } from "./mapValues.js";
11
+ import { mapValuesAsync } from "./mapValuesAsync.js";
10
12
  import { merge } from "./merge.js";
11
13
  import { mergeWith } from "./mergeWith.js";
12
14
  import { omit } from "./omit.js";
@@ -20,4 +22,4 @@ import { toKebabCaseKeys } from "./toKebabCaseKeys.js";
20
22
  import { toMerged } from "./toMerged.js";
21
23
  import { toPascalCaseKeys } from "./toPascalCaseKeys.js";
22
24
  import { toSnakeCaseKeys } from "./toSnakeCaseKeys.js";
23
- export { clone, cloneDeep, cloneDeepWith, deepFreeze, findKey, flattenObject, invert, mapKeys, mapValues, merge, mergeWith, omit, omitBy, pick, pickBy, sortKeys, toCamelCaseKeys, toConstantCaseKeys, toKebabCaseKeys, toMerged, toPascalCaseKeys, toSnakeCaseKeys };
25
+ export { clone, cloneDeep, cloneDeepWith, deepFreeze, findKey, flattenObject, invert, mapKeys, mapKeysAsync, mapValues, mapValuesAsync, merge, mergeWith, omit, omitBy, pick, pickBy, sortKeys, toCamelCaseKeys, toConstantCaseKeys, toKebabCaseKeys, toMerged, toPascalCaseKeys, toSnakeCaseKeys };
@@ -7,7 +7,9 @@ const require_findKey = require("./findKey.js");
7
7
  const require_flattenObject = require("./flattenObject.js");
8
8
  const require_invert = require("./invert.js");
9
9
  const require_mapKeys = require("./mapKeys.js");
10
+ const require_mapKeysAsync = require("./mapKeysAsync.js");
10
11
  const require_mapValues = require("./mapValues.js");
12
+ const require_mapValuesAsync = require("./mapValuesAsync.js");
11
13
  const require_merge = require("./merge.js");
12
14
  const require_mergeWith = require("./mergeWith.js");
13
15
  const require_omit = require("./omit.js");
@@ -29,7 +31,9 @@ exports.findKey = require_findKey.findKey;
29
31
  exports.flattenObject = require_flattenObject.flattenObject;
30
32
  exports.invert = require_invert.invert;
31
33
  exports.mapKeys = require_mapKeys.mapKeys;
34
+ exports.mapKeysAsync = require_mapKeysAsync.mapKeysAsync;
32
35
  exports.mapValues = require_mapValues.mapValues;
36
+ exports.mapValuesAsync = require_mapValuesAsync.mapValuesAsync;
33
37
  exports.merge = require_merge.merge;
34
38
  exports.mergeWith = require_mergeWith.mergeWith;
35
39
  exports.omit = require_omit.omit;
@@ -6,7 +6,9 @@ import { findKey } from "./findKey.mjs";
6
6
  import { flattenObject } from "./flattenObject.mjs";
7
7
  import { invert } from "./invert.mjs";
8
8
  import { mapKeys } from "./mapKeys.mjs";
9
+ import { mapKeysAsync } from "./mapKeysAsync.mjs";
9
10
  import { mapValues } from "./mapValues.mjs";
11
+ import { mapValuesAsync } from "./mapValuesAsync.mjs";
10
12
  import { merge } from "./merge.mjs";
11
13
  import { mergeWith } from "./mergeWith.mjs";
12
14
  import { omit } from "./omit.mjs";
@@ -20,4 +22,4 @@ import { toKebabCaseKeys } from "./toKebabCaseKeys.mjs";
20
22
  import { toMerged } from "./toMerged.mjs";
21
23
  import { toPascalCaseKeys } from "./toPascalCaseKeys.mjs";
22
24
  import { toSnakeCaseKeys } from "./toSnakeCaseKeys.mjs";
23
- export { clone, cloneDeep, cloneDeepWith, deepFreeze, findKey, flattenObject, invert, mapKeys, mapValues, merge, mergeWith, omit, omitBy, pick, pickBy, sortKeys, toCamelCaseKeys, toConstantCaseKeys, toKebabCaseKeys, toMerged, toPascalCaseKeys, toSnakeCaseKeys };
25
+ export { clone, cloneDeep, cloneDeepWith, deepFreeze, findKey, flattenObject, invert, mapKeys, mapKeysAsync, mapValues, mapValuesAsync, merge, mergeWith, omit, omitBy, pick, pickBy, sortKeys, toCamelCaseKeys, toConstantCaseKeys, toKebabCaseKeys, toMerged, toPascalCaseKeys, toSnakeCaseKeys };
@@ -0,0 +1,25 @@
1
+ //#region src/object/mapKeysAsync.d.ts
2
+ interface MapKeysAsyncOptions {
3
+ concurrency?: number;
4
+ }
5
+ /**
6
+ * Creates a new object with the same values as the given object, but with keys generated
7
+ * by running each own enumerable property of the object through the async iteratee function.
8
+ *
9
+ * @template T - The type of the object.
10
+ * @template K - The type of the new keys generated by the iteratee function.
11
+ *
12
+ * @param {T} object - The object to iterate over.
13
+ * @param {(value: T[keyof T], key: keyof T, object: T) => Promise<K>} getNewKey - The async function invoked per own enumerable property.
14
+ * @param {MapKeysAsyncOptions} [options] Optional configuration object.
15
+ * @returns {Promise<Record<K, T[keyof T]>>} - A promise that resolves to the new mapped object.
16
+ *
17
+ * @example
18
+ * // Example usage:
19
+ * const obj = { a: 1, b: 2 };
20
+ * const result = await mapKeysAsync(obj, async (value, key) => key + value);
21
+ * console.log(result); // { a1: 1, b2: 2 }
22
+ */
23
+ declare function mapKeysAsync<T extends Record<PropertyKey, any>, K extends PropertyKey>(object: T, getNewKey: (value: T[keyof T], key: keyof T, object: T) => Promise<K>, options?: MapKeysAsyncOptions): Promise<Record<K, T[keyof T]>>;
24
+ //#endregion
25
+ export { mapKeysAsync };
@@ -0,0 +1,25 @@
1
+ //#region src/object/mapKeysAsync.d.ts
2
+ interface MapKeysAsyncOptions {
3
+ concurrency?: number;
4
+ }
5
+ /**
6
+ * Creates a new object with the same values as the given object, but with keys generated
7
+ * by running each own enumerable property of the object through the async iteratee function.
8
+ *
9
+ * @template T - The type of the object.
10
+ * @template K - The type of the new keys generated by the iteratee function.
11
+ *
12
+ * @param {T} object - The object to iterate over.
13
+ * @param {(value: T[keyof T], key: keyof T, object: T) => Promise<K>} getNewKey - The async function invoked per own enumerable property.
14
+ * @param {MapKeysAsyncOptions} [options] Optional configuration object.
15
+ * @returns {Promise<Record<K, T[keyof T]>>} - A promise that resolves to the new mapped object.
16
+ *
17
+ * @example
18
+ * // Example usage:
19
+ * const obj = { a: 1, b: 2 };
20
+ * const result = await mapKeysAsync(obj, async (value, key) => key + value);
21
+ * console.log(result); // { a1: 1, b2: 2 }
22
+ */
23
+ declare function mapKeysAsync<T extends Record<PropertyKey, any>, K extends PropertyKey>(object: T, getNewKey: (value: T[keyof T], key: keyof T, object: T) => Promise<K>, options?: MapKeysAsyncOptions): Promise<Record<K, T[keyof T]>>;
24
+ //#endregion
25
+ export { mapKeysAsync };
@@ -0,0 +1,32 @@
1
+ const require_limitAsync = require("../promise/limitAsync.js");
2
+ //#region src/object/mapKeysAsync.ts
3
+ /**
4
+ * Creates a new object with the same values as the given object, but with keys generated
5
+ * by running each own enumerable property of the object through the async iteratee function.
6
+ *
7
+ * @template T - The type of the object.
8
+ * @template K - The type of the new keys generated by the iteratee function.
9
+ *
10
+ * @param {T} object - The object to iterate over.
11
+ * @param {(value: T[keyof T], key: keyof T, object: T) => Promise<K>} getNewKey - The async function invoked per own enumerable property.
12
+ * @param {MapKeysAsyncOptions} [options] Optional configuration object.
13
+ * @returns {Promise<Record<K, T[keyof T]>>} - A promise that resolves to the new mapped object.
14
+ *
15
+ * @example
16
+ * // Example usage:
17
+ * const obj = { a: 1, b: 2 };
18
+ * const result = await mapKeysAsync(obj, async (value, key) => key + value);
19
+ * console.log(result); // { a1: 1, b2: 2 }
20
+ */
21
+ async function mapKeysAsync(object, getNewKey, options) {
22
+ const result = {};
23
+ const keys = Object.keys(object);
24
+ if (options?.concurrency) getNewKey = require_limitAsync.limitAsync(getNewKey, options.concurrency);
25
+ await Promise.all(keys.map(async (key) => {
26
+ const value = object[key];
27
+ result[await getNewKey(value, key, object)] = value;
28
+ }));
29
+ return result;
30
+ }
31
+ //#endregion
32
+ exports.mapKeysAsync = mapKeysAsync;
@@ -0,0 +1,32 @@
1
+ import { limitAsync } from "../promise/limitAsync.mjs";
2
+ //#region src/object/mapKeysAsync.ts
3
+ /**
4
+ * Creates a new object with the same values as the given object, but with keys generated
5
+ * by running each own enumerable property of the object through the async iteratee function.
6
+ *
7
+ * @template T - The type of the object.
8
+ * @template K - The type of the new keys generated by the iteratee function.
9
+ *
10
+ * @param {T} object - The object to iterate over.
11
+ * @param {(value: T[keyof T], key: keyof T, object: T) => Promise<K>} getNewKey - The async function invoked per own enumerable property.
12
+ * @param {MapKeysAsyncOptions} [options] Optional configuration object.
13
+ * @returns {Promise<Record<K, T[keyof T]>>} - A promise that resolves to the new mapped object.
14
+ *
15
+ * @example
16
+ * // Example usage:
17
+ * const obj = { a: 1, b: 2 };
18
+ * const result = await mapKeysAsync(obj, async (value, key) => key + value);
19
+ * console.log(result); // { a1: 1, b2: 2 }
20
+ */
21
+ async function mapKeysAsync(object, getNewKey, options) {
22
+ const result = {};
23
+ const keys = Object.keys(object);
24
+ if (options?.concurrency) getNewKey = limitAsync(getNewKey, options.concurrency);
25
+ await Promise.all(keys.map(async (key) => {
26
+ const value = object[key];
27
+ result[await getNewKey(value, key, object)] = value;
28
+ }));
29
+ return result;
30
+ }
31
+ //#endregion
32
+ export { mapKeysAsync };
@@ -0,0 +1,26 @@
1
+ //#region src/object/mapValuesAsync.d.ts
2
+ interface MapValuesAsyncOptions {
3
+ concurrency?: number;
4
+ }
5
+ /**
6
+ * Creates a new object with the same keys as the given object, but with values generated
7
+ * by running each own enumerable property of the object through the async iteratee function.
8
+ *
9
+ * @template T - The type of the object.
10
+ * @template K - The type of the keys in the object.
11
+ * @template V - The type of the new values generated by the async iteratee function.
12
+ *
13
+ * @param {T} object - The object to iterate over.
14
+ * @param {(value: T[K], key: K, object: T) => Promise<V>} getNewValue - The async function invoked per own enumerable property.
15
+ * @param {MapValuesAsyncOptions} [options] Optional configuration object.
16
+ * @returns {Promise<Record<K, V>>} - A promise that resolves to the new mapped object.
17
+ *
18
+ * @example
19
+ * // Example usage:
20
+ * const obj = { a: 1, b: 2 };
21
+ * const result = await mapValuesAsync(obj, async (value) => value * 2);
22
+ * console.log(result); // { a: 2, b: 4 }
23
+ */
24
+ declare function mapValuesAsync<T extends object, K extends keyof T, V>(object: T, getNewValue: (value: T[K], key: K, object: T) => Promise<V>, options?: MapValuesAsyncOptions): Promise<Record<K, V>>;
25
+ //#endregion
26
+ export { mapValuesAsync };
@@ -0,0 +1,26 @@
1
+ //#region src/object/mapValuesAsync.d.ts
2
+ interface MapValuesAsyncOptions {
3
+ concurrency?: number;
4
+ }
5
+ /**
6
+ * Creates a new object with the same keys as the given object, but with values generated
7
+ * by running each own enumerable property of the object through the async iteratee function.
8
+ *
9
+ * @template T - The type of the object.
10
+ * @template K - The type of the keys in the object.
11
+ * @template V - The type of the new values generated by the async iteratee function.
12
+ *
13
+ * @param {T} object - The object to iterate over.
14
+ * @param {(value: T[K], key: K, object: T) => Promise<V>} getNewValue - The async function invoked per own enumerable property.
15
+ * @param {MapValuesAsyncOptions} [options] Optional configuration object.
16
+ * @returns {Promise<Record<K, V>>} - A promise that resolves to the new mapped object.
17
+ *
18
+ * @example
19
+ * // Example usage:
20
+ * const obj = { a: 1, b: 2 };
21
+ * const result = await mapValuesAsync(obj, async (value) => value * 2);
22
+ * console.log(result); // { a: 2, b: 4 }
23
+ */
24
+ declare function mapValuesAsync<T extends object, K extends keyof T, V>(object: T, getNewValue: (value: T[K], key: K, object: T) => Promise<V>, options?: MapValuesAsyncOptions): Promise<Record<K, V>>;
25
+ //#endregion
26
+ export { mapValuesAsync };
@@ -0,0 +1,32 @@
1
+ const require_limitAsync = require("../promise/limitAsync.js");
2
+ //#region src/object/mapValuesAsync.ts
3
+ /**
4
+ * Creates a new object with the same keys as the given object, but with values generated
5
+ * by running each own enumerable property of the object through the async iteratee function.
6
+ *
7
+ * @template T - The type of the object.
8
+ * @template K - The type of the keys in the object.
9
+ * @template V - The type of the new values generated by the async iteratee function.
10
+ *
11
+ * @param {T} object - The object to iterate over.
12
+ * @param {(value: T[K], key: K, object: T) => Promise<V>} getNewValue - The async function invoked per own enumerable property.
13
+ * @param {MapValuesAsyncOptions} [options] Optional configuration object.
14
+ * @returns {Promise<Record<K, V>>} - A promise that resolves to the new mapped object.
15
+ *
16
+ * @example
17
+ * // Example usage:
18
+ * const obj = { a: 1, b: 2 };
19
+ * const result = await mapValuesAsync(obj, async (value) => value * 2);
20
+ * console.log(result); // { a: 2, b: 4 }
21
+ */
22
+ async function mapValuesAsync(object, getNewValue, options) {
23
+ const result = {};
24
+ const keys = Object.keys(object);
25
+ if (options?.concurrency) getNewValue = require_limitAsync.limitAsync(getNewValue, options.concurrency);
26
+ await Promise.all(keys.map(async (key) => {
27
+ result[key] = await getNewValue(object[key], key, object);
28
+ }));
29
+ return result;
30
+ }
31
+ //#endregion
32
+ exports.mapValuesAsync = mapValuesAsync;
@@ -0,0 +1,32 @@
1
+ import { limitAsync } from "../promise/limitAsync.mjs";
2
+ //#region src/object/mapValuesAsync.ts
3
+ /**
4
+ * Creates a new object with the same keys as the given object, but with values generated
5
+ * by running each own enumerable property of the object through the async iteratee function.
6
+ *
7
+ * @template T - The type of the object.
8
+ * @template K - The type of the keys in the object.
9
+ * @template V - The type of the new values generated by the async iteratee function.
10
+ *
11
+ * @param {T} object - The object to iterate over.
12
+ * @param {(value: T[K], key: K, object: T) => Promise<V>} getNewValue - The async function invoked per own enumerable property.
13
+ * @param {MapValuesAsyncOptions} [options] Optional configuration object.
14
+ * @returns {Promise<Record<K, V>>} - A promise that resolves to the new mapped object.
15
+ *
16
+ * @example
17
+ * // Example usage:
18
+ * const obj = { a: 1, b: 2 };
19
+ * const result = await mapValuesAsync(obj, async (value) => value * 2);
20
+ * console.log(result); // { a: 2, b: 4 }
21
+ */
22
+ async function mapValuesAsync(object, getNewValue, options) {
23
+ const result = {};
24
+ const keys = Object.keys(object);
25
+ if (options?.concurrency) getNewValue = limitAsync(getNewValue, options.concurrency);
26
+ await Promise.all(keys.map(async (key) => {
27
+ result[key] = await getNewValue(object[key], key, object);
28
+ }));
29
+ return result;
30
+ }
31
+ //#endregion
32
+ export { mapValuesAsync };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "es-toolkit",
3
- "version": "1.50.0-dev.2060+2a37b36c",
3
+ "version": "1.50.0-dev.2062+4c94c3df",
4
4
  "description": "A state-of-the-art, high-performance JavaScript utility library with a small bundle size and strong type annotations.",
5
5
  "homepage": "https://es-toolkit.dev",
6
6
  "bugs": "https://github.com/toss/es-toolkit/issues",