es-toolkit 1.49.0-dev.1919 → 1.49.0-dev.1922

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){if(e.length===0)return;let n=e[0],r=-1/0;for(let i=0;i<e.length;i++){let a=e[i],o=t(a,i,e);if(Number.isNaN(o))return a;o>r&&(r=o,n=a)}return n}function he(e,t){if(e.length===0)return;let n=e[0],r=1/0;for(let i=0;i<e.length;i++){let a=e[i],o=t(a,i,e);if(Number.isNaN(o))return a;o<r&&(r=o,n=a)}return n}function ge(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 _e(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 ve(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 ye(e){return e[Math.floor(Math.random()*e.length)]}function be(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 xe(e,t){return Math.floor(be(e,t))}function Se(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=xe(0,i+1);r.has(t)&&(t=i),r.add(t),n[a]=e[t]}return n}function Ce(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 we(e){return e.slice(1)}function Te(e,t){return e.slice(0,t)}function Ee(e,t){return t<=0||e.length===0?[]:e.slice(-t)}function De(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 Oe(e){return[...new Set(e)]}function ke(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 Ae(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 je(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 Me(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 Ne(e,...t){return o(e,t)}function Pe(...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 Fe=typeof globalThis==`object`&&globalThis||typeof window==`object`&&window||typeof self==`object`&&self||typeof global==`object`&&global||(function(){return this})(),Ie=Fe.DOMException===void 0?Error:Fe.DOMException;var Le=class extends Ie{constructor(e=`The operation was aborted`){super(e)}},Re=class extends Ie{constructor(e=`The operation was timed out`){super(e)}};function ze(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 Be(e,t){return function(...n){return e.apply(this,n.slice(0,t))}}async function Ve(){}function He(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 Ue(...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 We(...e){return Ue(...e.reverse())}function g(e){return e}function Ge(e){return((...t)=>!e(...t))}function Ke(){}function qe(e){let t=!1,n;return function(...r){return t||(t=!0,n=e(...r)),n}}function Je(e,...t){return Ye(e,Xe,...t)}function Ye(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 Xe=Symbol(`partial.placeholder`);Je.placeholder=Xe;function Ze(e,...t){return Qe(e,$e,...t)}function Qe(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 $e=Symbol(`partialRight.placeholder`);Ze.placeholder=$e;function et(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 tt(e,{signal:t}={}){return new Promise((n,r)=>{let i=()=>{r(new Le)},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 nt=()=>!0;async function rt(e,t){let n,r,i,a;typeof t==`number`?(n=0,r=t,i=void 0,a=nt):(n=t?.delay??0,r=t?.retries??1/0,i=t?.signal,a=t?.shouldRetry??nt);let o;for(let t=0;t<=r;t++){if(i?.aborted)throw o??Error(`The retry operation was aborted due to an abort signal.`);try{return await e()}catch(e){if(o=e,!a(e,t))throw e;await tt(typeof n==`function`?n(t):n)}}throw o}function it(e,t,n){if(n??(n=t,t=0),t>=n)throw Error(`The maximum value must be greater than the minimum value.`);return t<=e&&e<n}function at(e,t){let n=0;for(let r=0;r<e.length;r++)n+=t(e[r],r);return n}function ot(e,t){return at(e,e=>t(e))/e.length}function st(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 ct(e,t){return st(e.map(e=>t(e)))}function lt(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 ut(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 _(e){return e==null||typeof e!=`object`&&typeof e!=`function`}function dt(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function ft(e){if(_(e))return e;if(Array.isArray(e)||dt(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 pt(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 mt=`[object RegExp]`,ht=`[object String]`,gt=`[object Number]`,_t=`[object Boolean]`,vt=`[object Arguments]`,yt=`[object Symbol]`,bt=`[object Date]`,xt=`[object Map]`,St=`[object Set]`,Ct=`[object Array]`,wt=`[object ArrayBuffer]`,Tt=`[object Object]`,Et=`[object DataView]`,Dt=`[object Uint8Array]`,Ot=`[object Uint8ClampedArray]`,kt=`[object Uint16Array]`,At=`[object Uint32Array]`,jt=`[object Int8Array]`,Mt=`[object Int16Array]`,Nt=`[object Int32Array]`,Pt=`[object Float32Array]`,Ft=`[object Float64Array]`;function y(e){return Fe.Buffer!==void 0&&Fe.Buffer.isBuffer(e)}function It(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(_(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(dt(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`&&Lt(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),...pt(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 Lt(e){switch(v(e)){case vt:case Ct:case wt:case Et:case _t:case bt:case Pt:case Ft:case jt:case Mt:case Nt:case xt:case gt:case Tt:case mt:case St:case ht:case yt:case Dt:case Ot:case kt:case At:return!0;default:return!1}}function Rt(e){return b(e,void 0,e,new Map,void 0)}function zt(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 Bt(e,{delimiter:t=`.`}={}){return Vt(e,``,t)}function Vt(e,t,n){let r={},i=Object.keys(e);for(let a=0;a<i.length;a++){let o=i[a],s=e[o],c=t?`${t}${n}${o}`:o;if(S(s)&&Object.keys(s).length>0){Object.assign(r,Vt(s,c,n));continue}if(Array.isArray(s)&&s.length>0){Object.assign(r,Vt(s,c,n));continue}r[c]=s}return r}function Ht(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 Ut(e,t){let n={},r=Object.keys(e);for(let i=0;i<r.length;i++){let a=r[i],o=e[a];n[t(o,a,e)]=o}return n}function Wt(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 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?Array.isArray(o)?Array.isArray(s)?e[a]=w(s,o,n):e[a]=w([],o,n):S(o)?S(s)?e[a]=w(s,o,n):e[a]=w({},o,n):(s===void 0||o!==void 0)&&(e[a]=o):e[a]=c}return e}function Gt(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 Kt(e){return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}let qt=/\p{Lu}?\p{Ll}+|[0-9]+|\p{Lu}+(?!\p{Ll})|\p{Emoji_Presentation}|\p{Extended_Pictographic}|\p{L}+/gu;function E(e){return Array.from(e.match(qt)??[])}function Jt(e){let t=E(e);if(t.length===0)return``;let[n,...r]=t;return`${n.toLowerCase()}${r.map(e=>Kt(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 Xt(e,t){return w(Rt(e),t,function e(t,n){if(Array.isArray(n))return w(Array.isArray(t)?ft(t):[],n,e);if(S(n))return S(t)?w(ft(t),n,e):w({},n,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 Zt(e){return E(e).map(e=>e.toLowerCase()).join(`_`)}function Qt(e){if(T(e))return e.map(e=>Qt(e));if(D(e)){let t={},n=Object.keys(e);for(let r=0;r<n.length;r++){let i=n[r],a=Zt(i);t[a]=Qt(e[i])}return t}return e}function $t(e){return e instanceof ArrayBuffer}function en(e){return typeof Blob>`u`?!1:e instanceof Blob}function tn(){return typeof window<`u`&&window?.document!=null}function nn(e){return e instanceof Date}function rn(e){return S(e)&&Object.keys(e).length===0}function O(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}function an(e,t,n){return on(e,t,void 0,void 0,void 0,void 0,n)}function on(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 sn(e,t,a,o)}return sn(e,t,a,o)}function sn(e,t,n,r){if(Object.is(e,t))return!0;let i=v(e),a=v(t);if(i===`[object Arguments]`&&(i=Tt),a===`[object Arguments]`&&(a=Tt),i!==a)return!1;switch(i){case ht:return e.toString()===t.toString();case gt:return O(e.valueOf(),t.valueOf());case _t:case bt:case yt:return Object.is(e.valueOf(),t.valueOf());case mt: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 xt:if(e.size!==t.size)return!1;for(let[i,a]of e.entries())if(!t.has(i)||!on(a,t.get(i),i,e,t,n,r))return!1;return!0;case St:{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=>on(s,i,void 0,e,t,n,r));if(c===-1)return!1;a.splice(c,1)}return!0}case Ct:case Dt:case Ot:case kt:case At:case`[object BigUint64Array]`:case jt:case Mt:case Nt:case`[object BigInt64Array]`:case Pt:case Ft:if(y(e)!==y(t)||e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(!on(e[i],t[i],i,e,t,n,r))return!1;return!0;case wt:return e.byteLength===t.byteLength?sn(new Uint8Array(e),new Uint8Array(t),n,r):!1;case Et:return e.byteLength!==t.byteLength||e.byteOffset!==t.byteOffset?!1:sn(new Uint8Array(e),new Uint8Array(t),n,r);case`[object Error]`:return e.name===t.name&&e.message===t.message;case Tt:{if(!(sn(e.constructor,t.constructor,n,r)||S(e)&&S(t)))return!1;let i=[...Object.keys(e),...pt(e)],a=[...Object.keys(t),...pt(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(!on(s,c,o,e,t,n,r))return!1}return!0}default:return!1}}finally{n.delete(e),n.delete(t)}}function cn(e,t){return an(e,t,Ke)}function ln(e){return typeof File>`u`?!1:en(e)&&e instanceof File}function k(e){return typeof e==`function`}function un(e){return e!=null&&typeof e[Symbol.iterator]==`function`}function dn(e){if(typeof e!=`string`)return!1;try{return JSON.parse(e),!0}catch{return!1}}function fn(e){switch(typeof e){case`object`:return e===null||pn(e)||mn(e);case`string`:case`number`:case`boolean`:return!0;default:return!1}}function pn(e){return Array.isArray(e)?e.every(e=>fn(e)):!1}function mn(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`||!fn(i))return!1}return!0}function hn(e){return Number.isSafeInteger(e)&&e>=0}function gn(e){return e instanceof Map}function A(e){return e==null}function _n(){return typeof process<`u`&&process?.versions?.node!=null}function vn(e){return e!=null}function yn(e){return e===null}function bn(e){return e instanceof Promise}function xn(e){return e instanceof RegExp}function Sn(e){return e instanceof Set}function Cn(e){return typeof e==`symbol`}function wn(e){return e===void 0}function Tn(e){return e instanceof WeakMap}function En(e){return e instanceof WeakSet}async function Dn(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 On=class{semaphore=new m(1);get isLocked(){return this.semaphore.available===0}async acquire(){return this.semaphore.acquire()}release(){this.semaphore.release()}};function kn(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 Re)},e);t?.addEventListener(`abort`,i,{once:!0})})}async function An(e,t,{signal:n}={}){return Promise.race([e(),kn(t,{signal:n})])}function jn(e){return E(e).map(e=>e.toUpperCase()).join(`_`)}let Mn=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 Nn(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+=Mn.get(r)??r)}return t}let Pn={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`};function Fn(e){return e.replace(/[&<>"']/g,e=>Pn[e])}function In(e){return e.replace(/[\\^$.*+?()[\]{}|]/g,`\\$&`)}function Ln(e){return E(e).map(e=>e.toLowerCase()).join(`-`)}function Rn(e){return E(e).map(e=>e.toLowerCase()).join(` `)}function zn(e){return e.substring(0,1).toLowerCase()+e.substring(1)}function Bn(e,t,n=` `){return e.padStart(Math.floor((t-e.length)/2)+e.length,n).padEnd(t,n)}function Vn(e){return E(e).map(e=>Kt(e)).join(``)}function Hn(e){return[...e].reverse().join(``)}function Un(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 Wn(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 Gn(e,t){return t===void 0?e.trim():Wn(Un(e,t),t)}let Kn={"&amp;":`&`,"&lt;":`<`,"&gt;":`>`,"&quot;":`"`,"&#39;":`'`};function qn(e){return e.replace(/&(?:amp|lt|gt|quot|#(0+)?39);/g,e=>Kn[e]||`'`)}function Jn(e){let t=E(e),n=``;for(let e=0;e<t.length;e++)n+=t[e].toUpperCase(),e<t.length-1&&(n+=` `);return n}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 j(e){return Array.isArray(e)?e:Array.from(e)}function M(e){return e!=null&&typeof e!=`function`&&hn(e.length)}function $n(e,t=1){if(t=Math.max(Math.floor(t),0),t===0||!M(e)||Number.isNaN(t))return[];let r=j(e);return isFinite(t)?n(r,t):[r]}function er(e){return M(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 N(e){return typeof e==`string`||typeof e==`symbol`?e:Object.is(e?.valueOf?.(),-0)?`-0`:String(e)}function P(e){if(e==null)return``;if(typeof e==`string`)return e;if(Array.isArray(e))return e.map(P).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;for(e.charCodeAt(0)===46&&t.push(``);r<n;){let s=e[r];if(a)s===`\\`&&r+1<n?(r++,i+=e[r]):s===a?a=``:i+=s;else if(o)s===`"`||s===`'`?a=s:s===`]`?(o=!1,t.push(i),i=``):i+=s;else if(s===`[`)o=!0,i&&=(t.push(i),``);else if(s===`.`){i&&=(t.push(i),``);let n=e[r+1];(n===void 0||n===`.`)&&t.push(``)}else i+=s;r++}return i&&t.push(i),t}function I(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)?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 ir(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 ir(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 L(e){return function(t){return I(t,e)}}function R(e){return e!==null&&(typeof e==`object`||typeof e==`function`)}function ar(e,t,n){return typeof n==`function`?or(e,t,function e(t,r,i,a,o,s){let c=n(t,r,i,a,o,s);return c===void 0?or(t,r,e,s,!1):!!c},new Map,!0):ar(e,t,()=>void 0)}function or(e,t,n,r,i=!1){if(t===e)return!0;switch(typeof t){case`object`:return sr(e,t,n,r);case`function`:return Object.keys(t).length>0?or(e,{...t},n,r,i):O(e,t);default:return R(e)&&i?typeof t==`string`?t===``:!0:O(e,t)}}function sr(e,t,n,r){if(t==null)return!0;if(Array.isArray(t))return lr(e,t,n,r);if(t instanceof Map)return cr(e,t,n,r);if(t instanceof Set)return ur(e,t,n,r);let i=Object.keys(t);if(e==null||_(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(!_(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 cr(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 lr(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 ur(e,t,n,r){return t.size===0?!0:e instanceof Set?lr([...e],[...t],n,r):!1}function dr(e,t){return ar(e,t,()=>void 0)}function z(e){return e=Rt(e),t=>dr(t,e)}function fr(e,t){return It(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 gt:case ht:case _t:{let t=new e.constructor(e?.valueOf());return x(t,e),t}case vt:{let t={};return x(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 gr(e){return typeof e==`object`&&!!e&&v(e)===`[object Arguments]`}function _r(e,t){let n;if(n=Array.isArray(t)?t:typeof t==`string`&&rr(t)&&e?.[t]==null?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)||gr(r))&&hr(t)&&t<r.length))return!1;r=r[t]}return!0}function B(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?_r(n,e):t===void 0?r===void 0:dr(r,t)}}function V(e){if(e==null)return g;switch(typeof e){case`function`:return e;case`object`:return Array.isArray(e)&&e.length===2?B(e[0],e[1]):z(e);case`string`:case`symbol`:case`number`:return L(e)}}function vr(e,t){if(e==null)return{};let n=M(e)?Array.from(e):Object.values(e),r=V(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 H(e){return typeof e==`object`&&!!e}function U(e){return H(e)&&M(e)}function yr(e,...t){if(!U(e))return[];let n=Array.from(e),r=[];for(let e=0;e<t.length;e++){let n=t[e];U(n)&&r.push(...Array.from(n))}return o(n,r)}function W(e){if(M(e))return fe(j(e))}function br(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n];if(U(r))for(let e=0;e<r.length;e++)t.push(r[e])}return t}function xr(e,...t){if(!U(e))return[];let n=W(t),r=br(t);return U(n)?o(Array.from(e),r):s(Array.from(e),r,V(n))}function Sr(e,...t){if(!U(e))return[];let n=W(t),r=br(t);return typeof n==`function`?c(Array.from(e),r,n):o(Array.from(e),r)}function G(e){return typeof e==`symbol`||e instanceof Symbol}function K(e){return G(e)?NaN:Number(e)}function q(e){return e?(e=K(e),e===1/0||e===-1/0?(e<0?-1:1)*Number.MAX_VALUE:e===e?e:0):e===0?e:0}function J(e){let t=q(e),n=t%1;return n?t-n:t}function Cr(e,t=1,n){return M(e)?(t=n?1:J(t),l(j(e),t)):[]}function wr(e,t=1,n){return M(e)?(t=n?1:J(t),u(j(e),t)):[]}function Tr(e,t=g){return M(e)?Er(j(e),t):[]}function Er(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,B(n,r))}else return d(e,z(t));case`symbol`:case`number`:case`string`:return d(e,L(t))}}function Dr(e,t=g){return M(e)?Or(j(e),t):[]}function Or(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,B(n,r))}else return f(e,z(t));case`number`:case`symbol`:case`string`:return f(e,L(t))}}function kr(e,t=g){if(!e)return e;let n=M(e)||Array.isArray(e)?ut(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 Ar(e,t=g){if(!e)return e;let n=M(e)?ut(0,e.length):Object.keys(e);for(let r=n.length-1;r>=0;r--){let i=n[r],a=e[i];if(t(a,i,e)===!1)break}return e}function Y(e,t,n){return R(n)&&(typeof t==`number`&&M(n)&&hr(t)&&t<n.length||typeof t==`string`&&t in n)?O(n[t],e):!1}function jr(e,t,n){if(!e)return!0;n&&Y(e,t,n)&&(t=void 0),t||=g;let r;switch(typeof t){case`function`:r=t;break;case`object`:if(Array.isArray(t)&&t.length===2){let e=t[0],n=t[1];r=B(e,n)}else r=z(t);break;case`symbol`:case`number`:case`string`:r=L(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}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=Math.floor(n),r=Math.floor(r),n||=0,r||=0,p(e,t,n,r)):[]}function Pr(e,t=g){if(!e)return[];if(t=V(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=g,n=0){if(!e)return;n<0&&(n=Math.max(e.length+n,0));let r=V(t);if(!Array.isArray(e)){let t=Object.keys(e);for(let i=n;i<t.length;i++){let n=t[i],a=e[n];if(r(a,n,e))return a}return}return e.slice(n).find(r)}function X(e){return e}function Ir(e,t=X,n=0){if(!e)return-1;Number.isNaN(n)&&(n=0),n<0&&(n=Math.max(e.length+n,0));let r=Array.from(e).slice(n),i=-1;switch(typeof t){case`function`:i=r.findIndex(t);break;case`object`:if(Array.isArray(t)&&t.length===2){let e=t[0],n=t[1];i=r.findIndex(B(e,n))}else i=r.findIndex(z(t));break;case`number`:case`symbol`:case`string`:i=r.findIndex(L(t))}return i===-1?-1:i+n}function Lr(e,t=g,n){if(!e)return;let r=Array.isArray(e)?e.length:Object.keys(e).length;n=J(n??r-1),n=n<0?Math.max(r+n,0):Math.min(n,r-1);let i=V(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=g,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(B(e,n))}else return r.findLastIndex(z(t));case`number`:case`symbol`:case`string`:return r.findLastIndex(L(t))}}function zr(e){if(M(e))return ae(j(e))}function Br(e,t=1){let n=[],r=Math.floor(t);if(!M(e))return n;let i=(e,t)=>{for(let a=0;a<e.length;a++){let o=e[a];t<r&&(Array.isArray(o)||o?.[Symbol.isConcatSpreadable]||typeof o==`object`&&o&&Object.prototype.toString.call(o)===`[object Arguments]`)?i(Array.isArray(o)?o:Array.from(o),t+1):n.push(o)}};return i(Array.from(e),0),n}function Vr(e,t=1){return Br(e,t)}function Hr(e,t){if(!e)return[];let n=M(e)||Array.isArray(e)?ut(0,e.length):Object.keys(e),r=V(t??g),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){return A(e)?[]:Vr(A(t)?Hr(e):Hr(e,t),1)}function Wr(e,t=g,n=1){return e==null?[]:Br(Hr(e,V(t)),n)}function Gr(e,t){return Wr(e,t,1/0)}function Kr(e){return Vr(e,1/0)}function qr(e,t){return e==null?{}:ie(M(e)?Array.from(e):Object.values(e),V(t??g))}function Jr(e,t,n,r){if(e==null)return!1;if(n=r||!n?0:J(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);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 Yr(e,t,n){if(!M(e))return-1;if(Number.isNaN(t)){n??=0,n<0&&(n=Math.max(0,e.length+n));for(let t=n;t<e.length;t++)if(Number.isNaN(e[t]))return t;return-1}return Array.from(e).indexOf(t,n)}function Xr(e){return M(e)?oe(Array.from(e)):[]}function Zr(...e){if(e.length===0||!U(e[0]))return[];let t=Oe(Array.from(e[0]));for(let n=1;n<e.length;n++){let r=e[n];if(!U(r))return[];t=se(t,Array.from(r))}return t}function Qr(e,...t){if(!U(e))return[];let n=fe(t);if(n===void 0)return Array.from(e);let r=Oe(Array.from(e)),i=U(n)?t.length:t.length-1;for(let e=0;e<i;++e){let i=t[e];if(!U(i))return[];U(n)?r=ce(r,Array.from(i),g):typeof n==`function`?r=ce(r,Array.from(i),e=>n(e)):typeof n==`string`&&(r=ce(r,Array.from(i),L(n)))}return r}function $r(e){return M(e)?Oe(Array.from(e)):[]}function ei(e,...t){if(e==null)return[];let n=W(t),r=O,i=$r;typeof n==`function`&&(r=n,i=ti,t.pop());let a=i(Array.from(e));for(let e=0;e<t.length;++e){let n=t[e];if(n==null)return[];a=le(a,Array.from(n),r)}return a}function ti(e){let t=[],n=new Set;for(let r=0;r<e.length;r++){let i=e[r];n.has(i)||(t.push(i),n.add(i))}return t}function ni(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 ri(e,t){return M(e)?Array.from(e).join(t):``}function ii(e,t=g,n){let r=arguments.length>=3;if(!e)return n;let i,a=0;M(e)?(i=ut(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 ai(e,t){if(!M(e)&&!H(e))return{};let n=V(t??g);return ii(e,(e,t)=>{let r=n(t);return e[r]=t,e},{})}function oi(e,t,n){if(!M(e)||e.length===0)return-1;let r=e.length,i=n===void 0?r-1:J(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 Array.from(e).lastIndexOf(t,i)}function si(e,t=0){if(!(!M(e)||e.length===0))return t=J(t),t<0&&(t+=e.length),e[t]}function ci(e){return typeof e==`symbol`?1:e===null?2:e===void 0?3:e===e?0:4}let li=(e,t,n)=>{if(e!==t){let r=ci(e),i=ci(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},ui=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,di=/^\w*$/;function fi(e,t){return Array.isArray(e)?!1:typeof e==`number`||typeof e==`boolean`||e==null||G(e)?!0:typeof e==`string`&&(di.test(e)||!ui.test(e))||t!=null&&Object.hasOwn(t,e)}function pi(e,t,n,r){if(e==null)return[];n=r?void 0:n,Array.isArray(e)||(e=Object.values(e)),Array.isArray(t)||(t=t==null?[null]:[t]),t.length===0&&(t=[null]),Array.isArray(n)||(n=n==null?[]:[n]),n=n.map(e=>String(e));let i=(e,t)=>{let n=e;for(let e=0;e<t.length&&n!=null;++e)n=n[t[e]];return n},a=(e,t)=>t==null||e==null?t:typeof e==`object`&&`key`in e?Object.hasOwn(t,e.key)?t[e.key]:i(t,e.path):typeof e==`function`?e(t):Array.isArray(e)?i(t,e):typeof t==`object`?t[e]:t,o=t.map(e=>(Array.isArray(e)&&e.length===1&&(e=e[0]),e==null||typeof e==`function`||Array.isArray(e)||fi(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=li(e.criteria[r],t.criteria[r],n[r]);if(i!==0)return i}return 0}).map(e=>e.original)}function mi(e,t=g){if(!e)return[[],[]];let n=M(e)?e:Object.values(e);t=V(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 hi(e,...t){return ge(e,t)}function gi(e,t=[]){return ge(e,Array.from(t))}function _i(e,t,n){let r=V(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 vi(e,t){let n=e.length;t??=Array(n);for(let r=0;r<n;r++)t[r]=e[r];return t}function yi(e,t,n){if(e?.length==null||t?.length==null)return e;e===t&&(t=vi(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 bi(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 xi(e,t){if(e==null)return!0;switch(typeof t){case`symbol`:case`number`:case`object`:if(Array.isArray(t))return Si(e,t);if(typeof t==`number`?t=N(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 Si(e,F(t));if(C(t))return!1;try{return delete e[t],!0}catch{return!1}}}function Si(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(C(r))return!1;try{return delete n[r],!0}catch{return!1}}function Ci(e,...t){let n=Vr(t,1);if(!e)return Array(n.length);let r=bi(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(fi(t,e)){delete e[N(t)];continue}xi(e,T(t)?t:F(t))}return r}function wi(e,t=g,n){let r=arguments.length>=3;if(!e)return n;let i,a;M(e)?(i=ut(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 Ti(e){if(typeof e!=`function`)throw TypeError(`Expected a function`);return function(...t){return!e.apply(this,t)}}function Ei(e,t=g){return Pr(e,Ti(V(t)))}function Di(e,t=g){return ve(e,V(t))}function Oi(e){return e==null?e:e.reverse()}function ki(e){if(e!=null)return M(e)?ye(j(e)):ye(Object.values(e))}function Ai(e,t,n){return n===void 0&&(n=t,t=void 0),n!==void 0&&(n=K(n),e=Math.min(e,Number.isNaN(n)?0:n)),t!==void 0&&(t=K(t),e=Math.max(e,Number.isNaN(t)?0:t)),e}function ji(e){return gn(e)}function Mi(e){return e==null?[]:M(e)||ji(e)?Array.from(e):typeof e==`object`?Object.values(e):[]}function Ni(e,t,n){let r=Mi(e);return t=(n?Y(e,t,n):t===void 0)?1:Ai(J(t),0,r.length),Se(r,t)}function Pi(e){return e==null?[]:Object.values(e)}function Fi(e){return e==null}function Ii(e){return Fi(e)?[]:T(e)?Ce(e):M(e)?Ce(Array.from(e)):H(e)?Ce(Pi(e)):[]}function Li(e){return A(e)?0:M(e)?e.length:e instanceof Map||e instanceof Set?e.size:Object.keys(e).length}function Ri(e,t,n){if(!M(e))return[];let r=e.length;n===void 0?n=r:typeof n!=`number`&&Y(e,t,n)&&(t=0,n=r),t=J(t),n=J(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 zi(e,t,n){if(!e)return!1;n!=null&&(t=void 0),t??=g;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=B(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=z(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=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)}}}function Bi(e,...t){let n=t.length;return n>1&&Y(e,t[0],t[1])?t=[]:n>2&&Y(t[0],t[1],t[2])&&(t=[t[0]]),pi(e,te(t),[`asc`])}function Vi(e){return typeof e==`number`||H(e)&&v(e)===`[object Number]`}function Hi(e){return Vi(e)&&Number.isNaN(Number(e))}function Ui(e,t,n=X,r){if(Fi(e)||e.length===0)return 0;let i=0,a=e.length,o=V(n),s=o(t),c=Hi(s),l=yn(s),u=G(s),d=wn(s);for(;i<a;){let t,n=Math.floor((i+a)/2),f=o(e[n]),p=!wn(f),m=yn(f),h=!Hi(f),ee=G(f);t=c?r||h:d?h&&(r||p):l?h&&p&&(r||!m):u?h&&p&&!m&&(r||!ee):m||ee?!1:r?f<=s:f<s,t?i=n+1:a=n}return Math.min(a,4294967294)}function Wi(e,t){if(A(e))return 0;let n=0,r=e.length;if(Vi(t)&&t===t&&r<=2147483647){for(;n<r;){let i=n+r>>>1,a=e[i];!yn(a)&&!Cn(a)&&a<t?n=i+1:r=i}return r}return Ui(e,t,e=>e)}function Gi(e,t){if(!e?.length)return-1;let n=Wi(e,t);return n<e.length&&O(e[n],t)?n:-1}function Ki(e,t,n){return Ui(e,t,n,!0)}function qi(e,t){if(A(e))return 0;let n=e.length;if(!Vi(t)||Number.isNaN(t)||n>2147483647)return Ki(e,t,e=>e);let r=0;for(;r<n;){let i=r+n>>>1,a=e[i];!yn(a)&&!Cn(a)&&a<=t?r=i+1:n=i}return n}function Ji(e,t){if(!e?.length)return-1;let n=qi(e,t)-1;return n>=0&&O(e[n],t)?n:-1}function Yi(e){return M(e)?we(j(e)):[]}function Xi(e,t=1,n){return t=n||t===void 0?1:J(t),t<1||!M(e)?[]:Te(j(e),t)}function Zi(e,t=1,n){return t=n?1:J(t),t<=0||!M(e)?[]:Ee(j(e),t)}function Qi(e,t){if(!U(e))return[];let n=j(e),r=n.findLastIndex(Ge(V(t??g)));return n.slice(r+1)}function $i(e,t){if(!U(e))return[];let n=j(e),r=n.findIndex(Ti(V(t??X)));return r===-1?n:n.slice(0,r)}function ea(...e){return Oe(Wr(e.filter(U),e=>Array.from(e),1))}function ta(...e){let t=fe(e),n=br(e);return U(t)||t==null?Oe(n):ke(n,Be(V(t),1))}function na(...e){let t=fe(e),n=br(e);return U(t)||t==null?Oe(n):Ae(n,t)}function ra(e,t=g){return U(e)?ke(Array.from(e),Be(V(t),1)):[]}function ia(e,t){return M(e)?typeof t==`function`?Ae(Array.from(e),(e,n)=>t(n,e)):$r(Array.from(e)):[]}function aa(e){return!U(e)||!e.length?[]:(e=T(e)?e:Array.from(e),e=e.filter(e=>U(e)),je(e))}function oa(e,t){if(!U(e)||!e.length)return[];let n=T(e)?je(e):je(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 sa(e,...t){return U(e)?Ne(Array.from(e),...t):[]}function ca(...e){let t=new Map;for(let n=0;n<e.length;n++){let r=e[n];if(!U(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 la(...e){let t=W(e),n=g;!U(t)&&t!=null&&(n=V(t),e=e.slice(0,-1));let r=e.filter(U);return xr(ta(...r,n),ta(...Me(r,2).map(([e,t])=>Qr(e,t,n)),n),n)}function ua(...e){let t=W(e),n=(e,t)=>e===t;typeof t==`function`&&(n=t,e=e.slice(0,-1));let r=e.filter(U);return Sr(na(...r,n),na(...Me(r,2).map(([e,t])=>ei(e,t,n)),n),n)}function da(...e){return e.length?Pe(...e.filter(e=>U(e))):[]}let fa=(e,t,n)=>{let r=e[t];(!(Object.hasOwn(e,t)&&O(r,n))||n===void 0&&!(t in e))&&(e[t]=n)};function pa(e=[],t=[]){let n={};for(let r=0;r<e.length;r++)fa(n,e[r],t[r]);return n}function ma(e,t,n,r){if(e==null&&!R(e))return e;let i;i=fi(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(C(n))continue;let s;if(t===i.length-1)s=a;else{let a=o[n],c=r?.(a,n,e);s=c===void 0?R(a)?a:hr(i[t+1])?[]:{}:c}fa(o,n,s),o=o[n]}return e}function ha(e,t,n){return ma(e,t,()=>n,()=>void 0)}function ga(e,t){let n={};if(!M(e))return n;M(t)||(t=[]);let r=Pe(Array.from(e),Array.from(t));for(let e=0;e<r.length;e++){let[t,i]=r[e];t!=null&&ha(n,t,i)}return n}function _a(...e){let t=e.pop();if(k(t)||(e.push(t),t=void 0),!e?.length)return[];let n=aa(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=J(e),function(...n){if(--e<1)return t.apply(this,n)}}function ya(e,t=e.length,n){return n&&(t=e.length),(Number.isNaN(t)||t<0)&&(t=0),Be(e,t)}function ba(e,...t){try{return e(...t)}catch(e){return e instanceof Error?e:Error(e)}}function xa(e,t){if(typeof t!=`function`)throw TypeError(`Expected a function`);let n;return e=J(e),function(...r){return--e>0&&(n=t.apply(this,r)),e<=1&&t&&(t=void 0),n}}function Sa(e,t,...n){let r=function(...i){let a=[],o=0;for(let e=0;e<n.length;e++){let t=n[e];t===Sa.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}Sa.placeholder=Symbol(`bind.placeholder`);function Ca(e,t,...n){let r=function(...i){let a=[],o=0;for(let e=0;e<n.length;e++){let t=n[e];t===Ca.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}Ca.placeholder=Symbol(`bindKey.placeholder`);function wa(e,t=e.length,n){t=n?e.length:t,t=Number.parseInt(t,10),(Number.isNaN(t)||t<1)&&(t=0);let r=function(...n){let i=n.filter(e=>e===wa.placeholder),a=n.length-i.length;return a<t?Ta(e,t-a,n):this instanceof r?new e(...n):e.apply(this,n)};return r.placeholder=Da,r}function Ta(e,t,n){function r(...i){let a=i.filter(e=>e===wa.placeholder),o=i.length-a.length;return i=Ea(i,n),o<t?Ta(e,t-o,i):this instanceof r?new e(...i):e.apply(this,i)}return r.placeholder=Da,r}function Ea(e,t){let n=[],r=0;for(let i=0;i<t.length;i++){let a=t[i];a===wa.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 Da=Symbol(`curry.placeholder`);wa.placeholder=Da;function Oa(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===Oa.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===Oa.placeholder),o=i.length-a.length;return i=Aa(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 Aa(e,t){let n=t.filter(e=>e===Oa.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===Oa.placeholder&&a<e.length?i.push(e[a++]):i.push(r)}return i}let ja=Symbol(`curryRight.placeholder`);Oa.placeholder=ja;function Ma(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=He(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 Na(e,...t){if(typeof e!=`function`)throw TypeError(`Expected a function`);return setTimeout(e,1,...t)}function Pa(e,t,...n){if(typeof e!=`function`)throw TypeError(`Expected a function`);return setTimeout(e,K(t)||0,...n)}function Fa(e){return function(...t){return e.apply(this,t.reverse())}}function Ia(...e){let t=te(e,1);if(t.some(e=>typeof e!=`function`))throw TypeError(`Expected a function`);return Ue(...t)}function La(...e){let t=te(e,1);if(t.some(e=>typeof e!=`function`))throw TypeError(`Expected a function`);return We(...t)}function Ra(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(Ra.Cache||Map),n}Ra.Cache=Map;function za(e=0){return function(...t){return t.at(J(e))}}function Ba(e){return qe(e)}function Va(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]=V(n[e]??g).call(this,t[e]);return e.apply(this,i)}}function Ha(e,...t){return Ye(e,Ha.placeholder,...t)}Ha.placeholder=Symbol(`compat.partial.placeholder`);function Ua(e,...t){return Qe(e,Ua.placeholder,...t)}Ua.placeholder=Symbol(`compat.partialRight.placeholder`);function Wa(e,...t){let n=Br(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 Ga(e,t=e.length-1){return t=Number.parseInt(t,10),(Number.isNaN(t)||t<0)&&(t=e.length-1),et(e,t)}function Ka(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 qa(e,t=0,n={}){let{leading:r=!0,trailing:i=!0}=n;return Ma(e,t,{leading:r,maxWait:t,trailing:i})}function Ja(e){return ya(e,1)}function Ya(e,t){return function(...n){return(k(t)?t:g).apply(this,[e,...n])}}function Xa(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=K(e),t=K(t)),e+t)}function Za(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 Qa(e,t=0){return Za(`ceil`,e,t)}function $a(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=K(e),t=K(t)),e/t)}function eo(e,t=0){return Za(`floor`,e,t)}function to(e,t,n){return t||=0,n!=null&&!n&&(n=0),t!=null&&typeof t!=`number`&&(t=Number(t)),n==null&&t===0||(n!=null&&typeof n!=`number`&&(n=Number(n)),n!=null&&t>n&&([t,n]=[n,t]),t===n)?!1:it(e,t,n)}function no(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 ro(e,t){if(e!=null)return me(Array.from(e),V(t??g))}function io(e,t){if(!e||!e.length)return 0;t!=null&&(t=V(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 ao(e){return io(e)}function oo(e){let t=e?e.length:0;return t===0?NaN:ao(e)/t}function so(e,t){return e==null?NaN:ot(Array.from(e),V(t??g))}function co(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 lo(e,t){if(e!=null)return he(Array.from(e),V(t??g))}function uo(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=K(e),t=K(t)),e*t)}function fo(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=Ai(t,-(2**53-1),2**53-1),n=Ai(n,-(2**53-1),2**53-1),t===n?t:r?be(t,n):xe(t,n+1)}function mo(e,t,n){n&&typeof n!=`number`&&Y(e,t,n)&&(t=n=void 0),e=q(e),t===void 0?(t=e,e=0):t=q(t),n=n===void 0?e<t?1:-1:q(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 ho(e,t,n){n&&typeof n!=`number`&&Y(e,t,n)&&(t=n=void 0),e=q(e),t===void 0?(t=e,e=0):t=q(t),n=n===void 0?e<t?1:-1:q(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 go(e,t=0){return Za(`round`,e,t)}function _o(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=K(e),t=K(t)),e-t)}function vo(...e){}function yo(e){let t=e?.constructor;return e===(typeof t==`function`?t.prototype:Object.prototype)}function Z(e){return dt(e)}function bo(e,t){if(e=J(e),e<1||!Number.isSafeInteger(e))return[];let n=Array(e);for(let r=0;r<e;r++)n[r]=typeof t==`function`?t(r):r;return n}function Q(e){if(M(e))return xo(e);let t=Object.keys(Object(e));return yo(e)?t.filter(e=>e!==`constructor`):t}function xo(e){let t=bo(e.length,e=>`${e}`),n=new Set(t);y(e)&&(n.add(`offset`),n.add(`parent`)),Z(e)&&(n.add(`buffer`),n.add(`byteLength`),n.add(`byteOffset`));let r=Object.keys(e).filter(e=>!n.has(e));return Array.isArray(e)?[...t,...r]:[...t.filter(t=>Object.hasOwn(e,t)),...r]}function So(e,...t){for(let n=0;n<t.length;n++)Co(e,t[n]);return e}function Co(e,t){let n=Q(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 $(e){if(e==null)return[];switch(typeof e){case`object`:case`function`:return M(e)?Eo(e):yo(e)?To(e):wo(e);default:return wo(Object(e))}}function wo(e){let t=[];for(let n in e)t.push(n);return t}function To(e){return wo(e).filter(e=>e!==`constructor`)}function Eo(e){let t=bo(e.length,e=>`${e}`),n=new Set(t);y(e)&&(n.add(`offset`),n.add(`parent`)),Z(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 Do(e,...t){for(let n=0;n<t.length;n++)Oo(e,t[n]);return e}function Oo(e,t){let n=$(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 ko(e,...t){let n=t[t.length-1];typeof n==`function`?t.pop():n=void 0;for(let r=0;r<t.length;r++)Ao(e,t[r],n);return e}function Ao(e,t,n){let r=$(t);for(let i=0;i<r.length;i++){let a=r[i],o=e[a],s=t[a],c=n?.(o,s,a,e,t)??s;(!(a in e)||!O(o,c))&&(e[a]=c)}}function jo(e,...t){let n=t[t.length-1];typeof n==`function`?t.pop():n=void 0;for(let r=0;r<t.length;r++)Mo(e,t[r],n);return e}function Mo(e,t,n){let r=Q(t);for(let i=0;i<r.length;i++){let a=r[i],o=e[a],s=t[a],c=n?.(o,s,a,e,t)??s;(!(a in e)||!O(o,c))&&(e[a]=c)}}function No(e){if(_(e))return e;let t=v(e);if(!Po(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(Z(e)){let t=e,n=t.constructor;return new n(t.buffer,t.byteOffset,t.length)}if(t===`[object ArrayBuffer]`)return new ArrayBuffer(e.byteLength);if(t===`[object DataView]`){let t=e,n=t.buffer,r=t.byteOffset,i=t.byteLength,a=new ArrayBuffer(i),o=new Uint8Array(n,r,i);return new Uint8Array(a).set(o),new DataView(a)}if(t===`[object Boolean]`||t===`[object Number]`||t===`[object String]`){let n=e.constructor,r=new n(e.valueOf());return t===`[object String]`?Lo(r,e):Fo(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 Fo(n,t),n.length=t.length,n[Symbol.iterator]=t[Symbol.iterator],n}let n={};return Ro(n,e),Fo(n,e),Io(n,e),n}function Po(e){switch(v(e)){case vt:case Ct:case wt:case Et:case _t:case bt:case Pt:case Ft:case jt:case Mt:case Nt:case xt:case gt:case Tt:case mt:case St:case ht:case yt:case Dt:case Ot:case kt:case At:return!0;default:return!1}}function Fo(e,t){for(let n in t)Object.hasOwn(t,n)&&(e[n]=t[n])}function Io(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 Lo(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 Ro(e,t){let n=Object.getPrototypeOf(t);n!==null&&typeof t.constructor==`function`&&Object.setPrototypeOf(e,n)}function zo(e,t){if(!t)return No(e);let n=t(e);return n===void 0?No(e):n}function Bo(e,t){let n=R(e)?Object.create(e):{};if(t!=null){let e=Q(t);for(let r=0;r<e.length;r++){let i=e[r],a=t[i];fa(n,i,a)}}return n}function Vo(e,...t){e=Object(e);let n=Object.prototype,r=t.length,i=r>2?t[2]:void 0;i&&Y(t[0],t[1],i)&&(r=1);for(let i=0;i<r;i++){if(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 Ho(e,...t){e=Object(e);for(let n=0;n<t.length;n++){let r=t[n];r!=null&&Uo(e,r,new WeakMap)}return e}function Uo(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]=Wo(i,n);continue}n.get(i)!==a&&Go(a,i,n)}}function Wo(e,t){if(t.has(e))return t.get(e);if(D(e)){let n={};return t.set(e,n),Uo(n,e,t),n}return e}function Go(e,t,n){if(D(e)&&D(t)){n.set(t,e),Uo(e,t,n);return}Array.isArray(e)&&Array.isArray(t)&&(n.set(t,e),Ko(e,t,n))}function Ko(e,t,n){let r=Math.min(t.length,e.length);for(let i=0;i<r;i++)D(e[i])&&D(t[i])&&Uo(e[i],t[i],n);for(let n=r;n<t.length;n++)e.push(t[n])}function qo(e,t){if(R(e))return zt(e,V(t??X))}function Jo(e,t){if(!R(e))return;let n=V(t??X);return Object.keys(e).findLast(t=>n(e[t],t,e))}function Yo(e,t=g){if(e==null)return e;for(let n in e)if(t(e[n],n,e)===!1)break;return e}function Xo(e,t=g){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 Zo(e,t=g){if(e==null)return e;let n=Object(e),r=Q(e);for(let e=0;e<r.length;++e){let i=r[e];if(t(n[i],i,n)===!1)break}return e}function Qo(e,t=g){if(e==null)return e;let n=Object(e),r=Q(e);for(let e=r.length-1;e>=0;--e){let i=r[e];if(t(n[i],i,n)===!1)break}return e}function $o(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 es(e){return e==null?[]:Q(e).filter(t=>typeof e[t]==`function`)}function ts(e){if(e==null)return[];let t=[];for(let n in e)k(e[n])&&t.push(n);return t}function ns(e,t){if(e==null)return!1;let n;if(n=Array.isArray(t)?t:typeof t==`string`&&rr(t)&&e[t]==null?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)||gr(r))&&hr(t)&&t<r.length))return!1;r=r[t]}return!0}function rs(e){return Ht(e)}function is(e,t){let n={};if(A(e))return n;t??=g;let r=Object.keys(e),i=V(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 as(e,t=g){return e==null?{}:Ut(e,V(t))}function os(e,t=g){return e==null?{}:Wt(e,V(t))}function ss(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=cs(i,t,r,new Map)}return i}function cs(e,t,n,r){if(_(e)&&(e=Object(e)),typeof t!=`object`||!t)return e;if(r.has(t))return ft(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),...pt(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(gr(s)&&(s={...s}),gr(c)&&(c={...c}),y(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(U(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)||H(c)&&H(s)&&(D(c)||D(s)||Z(c)||Z(s))?e[o]=cs(c,s,n,r):c==null&&D(s)?e[o]=cs({},s,n,r):c==null&&Z(s)?e[o]=pr(s):(c===void 0||s!==void 0)&&(e[o]=s):e[o]=l}return e}function ls(e,...t){return ss(e,...t,Ke)}function us(e){let t=[];for(;e;)t.push(...pt(e)),e=Object.getPrototypeOf(e);return t}function ds(e,...t){if(e==null)return{};t=Br(t);let n=fs(e,t);for(let e=0;e<t.length;e++){let r=t[e];switch(typeof r){case`object`:Array.isArray(r)||(r=Array.from(r));for(let e=0;e<r.length;e++){let t=r[e];xi(n,t)}break;case`string`:case`symbol`:case`number`:xi(n,r);break}}return n}function fs(e,t){return t.some(e=>Array.isArray(e)||rr(e))?ms(e):ps(e)}function ps(e){let t={},n=[...$(e),...us(e)];for(let r=0;r<n.length;r++){let i=n[r];t[i]=e[i]}return t}function ms(e){let t={},n=[...$(e),...us(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 hs(e,t){if(e==null)return{};let n={},r=V(t??X),i=[...$(e),...us(e)];for(let t=0;t<i.length;t++){let a=G(i[t])?i[t]:i[t].toString(),o=e[a];r(o,a,e)||(n[a]=o)}return n}function gs(e,...t){if(Fi(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&&!_r(e,t)||(typeof t==`string`&&Object.hasOwn(e,t)?n[t]=e[t]:ha(n,t,r))}}return n}function _s(e,t){if(e==null)return{};let n=V(t??X),r={},i=M(e)?ut(0,e.length):[...$(e),...us(e)];for(let t=0;t<i.length;t++){let a=G(i[t])?i[t]:i[t].toString(),o=e[a];n(o,a,e)&&(r[a]=o)}return r}function vs(e){return function(t){return I(e,t)}}function ys(e,t,n){fi(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 bs(e,t,n,r){let i;return i=typeof r==`function`?r:()=>void 0,ma(e,t,()=>n,i)}function xs(e,...t){return Vo(pr(e),...t)}function Ss(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 Cs(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 ws(e){if(e==null)return[];if(e instanceof Set)return Cs(e);if(e instanceof Map)return Ss(e);let t=Q(e),n=Array(t.length);for(let r=0;r<t.length;r++){let i=t[r];n[r]=[i,e[i]]}return n}function Ts(e){if(e==null)return[];if(e instanceof Set)return Cs(e);if(e instanceof Map)return Ss(e);let t=$(e),n=Array(t.length);for(let r=0;r<t.length;r++){let i=t[r];n[r]=[i,e[i]]}return n}function Es(e){return y(e)}function Ds(e,t=g,n){let r=Array.isArray(e)||Es(e)||Z(e);return t=V(t),n??=r?[]:R(e)&&k(e.constructor)?Object.create(Object.getPrototypeOf(e)):{},e==null||kr(e,(e,r,i)=>t(n,e,r,i)),n}function Os(e,t,n){return ma(e,t,n,()=>void 0)}function ks(e){let t=$(e),n=Array(t.length);for(let r=0;r<t.length;r++)n[r]=e[t[r]];return n}function As(e){return typeof e==`function`}function js(e){return Number.isSafeInteger(e)&&e>=0}let Ms=Function.prototype.toString,Ns=RegExp(`^${Ms.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)}$`);function Ps(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 Ns.test(Ms.call(e))}function Fs(e){return e===null}function Is(e){return wn(e)}function Ls(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 Rs(e){return e=Rt(e),function(t){return Ls(t,e)}}function zs(e){return $t(e)}function Bs(e){return typeof e==`boolean`||e instanceof Boolean}function Vs(e){return nn(e)}function Hs(e){return H(e)&&e.nodeType===1&&!D(e)}function Us(e){if(e==null)return!0;if(M(e))return typeof e.splice!=`function`&&typeof e!=`string`&&!y(e)&&!Z(e)&&!gr(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 yo(e)?t.filter(e=>e!==`constructor`).length===0:t.length===0}return!0}function Ws(e,t,n){return typeof n!=`function`&&(n=()=>void 0),an(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 Ws(Array.from(e),Array.from(t),ze(2,n))})}function Gs(e){return v(e)===`[object Error]`}function Ks(e){return Number.isFinite(e)}function qs(e){return Number.isInteger(e)}function Js(e){return xn(e)}function Ys(e){return Number.isSafeInteger(e)}function Xs(e){return Sn(e)}function Zs(e){return Tn(e)}function Qs(e){return En(e)}function $s(e){return Kt(P(e))}function ec(e,...t){if(e==null||!R(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=P(r),a=e[i];k(a)&&(e[i]=a.bind(e))}return e}function tc(e){return Nn(P(e))}function nc(e){return typeof e!=`string`&&(e=P(e)),e.replace(/['\u2019]/g,``)}function rc(e){return Jt(nc(tc(e)))}function ic(e,t,n){return e==null||t==null?!1:(n??=e.length,e.endsWith(t,n))}function ac(e){return Fn(P(e))}function oc(e){return In(P(e))}function sc(e){return Ln(nc(tc(e)))}function cc(e){return Rn(nc(tc(e)))}function lc(e){return zn(P(e))}function uc(e,t,n){return Bn(P(e),t,n)}function dc(e,t=0,n=` `){return P(e).padEnd(t,n)}function fc(e,t=0,n=` `){return P(e).padStart(t,n)}let pc=2**53-1;function mc(e,t,n){return t=(n?Y(e,t,n):t===void 0)?1:J(t),t<1||t>pc?``:P(e).repeat(t)}function hc(e,t,n){return arguments.length<3?P(e):P(e).replace(t,n)}function gc(e){return Zt(nc(tc(e)))}function _c(e,t,n){return P(e).split(t,n)}function vc(e){let t=E(nc(tc(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 bc=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,xc=/['\n\r\u2028\u2029\\]/g,Sc=/($^)/,Cc=new Map([[`\\`,`\\`],[`'`,`'`],[`
2
- `,`n`],[`\r`,`r`],[`\u2028`,`u2028`],[`\u2029`,`u2029`]]);function wc(e){return`\\${Cc.get(e)}`}let Tc=/<%=([\s\S]+?)%>/g,Ec={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:Tc,variable:``,imports:{_:{escape:ac,template:Dc}}};function Dc(e,t,n){e=P(e),n&&(t=Ec),t=Vo({...t},Ec);let r=new RegExp([t.escape?.source??Sc.source,t.interpolate?.source??Sc.source,t.interpolate===Tc?bc.source:Sc.source,t.evaluate?.source??Sc.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(xc,wc)}'`,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=Vo({...t.imports},Ec.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){if(e.length===0)return;let n=e[0],r=-1/0;for(let i=0;i<e.length;i++){let a=e[i],o=t(a,i,e);if(Number.isNaN(o))return a;o>r&&(r=o,n=a)}return n}function he(e,t){if(e.length===0)return;let n=e[0],r=1/0;for(let i=0;i<e.length;i++){let a=e[i],o=t(a,i,e);if(Number.isNaN(o))return a;o<r&&(r=o,n=a)}return n}function ge(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 _e(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 ve(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 ye(e){return e[Math.floor(Math.random()*e.length)]}function be(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 xe(e,t){return Math.floor(be(e,t))}function Se(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=xe(0,i+1);r.has(t)&&(t=i),r.add(t),n[a]=e[t]}return n}function Ce(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 we(e){return e.slice(1)}function Te(e,t){return e.slice(0,t)}function Ee(e,t){return t<=0||e.length===0?[]:e.slice(-t)}function De(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 Oe(e){return[...new Set(e)]}function ke(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 Ae(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 je(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 Me(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 Ne(e,...t){return o(e,t)}function Pe(...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 Fe=typeof globalThis==`object`&&globalThis||typeof window==`object`&&window||typeof self==`object`&&self||typeof global==`object`&&global||(function(){return this})(),Ie=Fe.DOMException===void 0?Error:Fe.DOMException;var Le=class extends Ie{constructor(e=`The operation was aborted`){super(e)}},Re=class extends Ie{constructor(e=`The operation was timed out`){super(e)}};function ze(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 Be(e,t){return function(...n){return e.apply(this,n.slice(0,t))}}async function Ve(){}function He(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 Ue(...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 We(...e){return Ue(...e.reverse())}function g(e){return e}function Ge(e){return((...t)=>!e(...t))}function Ke(){}function qe(e){let t=!1,n;return function(...r){return t||(t=!0,n=e(...r)),n}}function Je(e,...t){return Ye(e,Xe,...t)}function Ye(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 Xe=Symbol(`partial.placeholder`);Je.placeholder=Xe;function Ze(e,...t){return Qe(e,$e,...t)}function Qe(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 $e=Symbol(`partialRight.placeholder`);Ze.placeholder=$e;function et(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 tt(e,{signal:t}={}){return new Promise((n,r)=>{let i=()=>{r(new Le)},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 nt=()=>!0;async function rt(e,t){let n,r,i,a;typeof t==`number`?(n=0,r=t,i=void 0,a=nt):(n=t?.delay??0,r=t?.retries??1/0,i=t?.signal,a=t?.shouldRetry??nt);let o;for(let t=0;t<=r;t++){if(i?.aborted)throw o??Error(`The retry operation was aborted due to an abort signal.`);try{return await e()}catch(e){if(o=e,!a(e,t))throw e;await tt(typeof n==`function`?n(t):n)}}throw o}function it(e,t){let n=0;for(let r=0;r<e.length;r++)n+=t(e[r],r);return n}function at(e,t){return it(e,e=>t(e))/e.length}function ot(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 st(e,t){return ot(e.map(e=>t(e)))}function ct(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 lt(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 _(e){return e==null||typeof e!=`object`&&typeof e!=`function`}function ut(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function dt(e){if(_(e))return e;if(Array.isArray(e)||ut(e)||e instanceof ArrayBuffer||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer)return e.slice(0);let t=Object.getPrototypeOf(e);if(t==null)return Object.assign(Object.create(t),e);let n=t.constructor;if(e instanceof Date||e instanceof Map||e instanceof Set)return new n(e);if(e instanceof RegExp){let t=new n(e);return t.lastIndex=e.lastIndex,t}if(e instanceof DataView)return new n(e.buffer.slice(0));if(e instanceof Error){let t;return t=e instanceof AggregateError?new n(e.errors,e.message,{cause:e.cause}):new n(e.message,{cause:e.cause}),t.stack=e.stack,Object.assign(t,e),t}return typeof File<`u`&&e instanceof File?new n([e],e.name,{type:e.type,lastModified:e.lastModified}):typeof e==`object`?Object.assign(Object.create(t),e):e}function ft(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function v(e){return e==null?e===void 0?`[object Undefined]`:`[object Null]`:Object.prototype.toString.call(e)}let pt=`[object RegExp]`,mt=`[object String]`,ht=`[object Number]`,gt=`[object Boolean]`,_t=`[object Arguments]`,vt=`[object Symbol]`,yt=`[object Date]`,bt=`[object Map]`,xt=`[object Set]`,St=`[object Array]`,Ct=`[object ArrayBuffer]`,wt=`[object Object]`,Tt=`[object DataView]`,Et=`[object Uint8Array]`,Dt=`[object Uint8ClampedArray]`,Ot=`[object Uint16Array]`,kt=`[object Uint32Array]`,At=`[object Int8Array]`,jt=`[object Int16Array]`,Mt=`[object Int32Array]`,Nt=`[object Float32Array]`,Pt=`[object Float64Array]`;function y(e){return Fe.Buffer!==void 0&&Fe.Buffer.isBuffer(e)}function Ft(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(_(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(ut(e)){let t=new(Object.getPrototypeOf(e)).constructor(e.length);r.set(e,t);for(let a=0;a<e.length;a++)t[a]=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`&&It(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),...ft(t)];for(let o=0;o<a.length;o++){let s=a[o],c=Object.getOwnPropertyDescriptor(e,s);(c==null||c.writable)&&(e[s]=b(t[s],s,n,r,i))}}function It(e){switch(v(e)){case _t:case St:case Ct:case Tt:case gt:case yt:case Nt:case Pt:case At:case jt:case Mt:case bt:case ht:case wt:case pt:case xt:case mt:case vt:case Et:case Dt:case Ot:case kt:return!0;default:return!1}}function Lt(e){return b(e,void 0,e,new Map,void 0)}function Rt(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 zt(e,{delimiter:t=`.`}={}){return Bt(e,``,t)}function Bt(e,t,n){let r={},i=Object.keys(e);for(let a=0;a<i.length;a++){let o=i[a],s=e[o],c=t?`${t}${n}${o}`:o;if(S(s)&&Object.keys(s).length>0){Object.assign(r,Bt(s,c,n));continue}if(Array.isArray(s)&&s.length>0){Object.assign(r,Bt(s,c,n));continue}r[c]=s}return r}function Vt(e){let t={},n=Object.keys(e);for(let r=0;r<n.length;r++){let i=n[r],a=e[i];t[a]=i}return t}function Ht(e,t){let n={},r=Object.keys(e);for(let i=0;i<r.length;i++){let a=r[i],o=e[a];n[t(o,a,e)]=o}return n}function Ut(e,t){let n={},r=Object.keys(e);for(let i=0;i<r.length;i++){let a=r[i],o=e[a];n[a]=t(o,a,e)}return n}function 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?Array.isArray(o)?Array.isArray(s)?e[a]=w(s,o,n):e[a]=w([],o,n):S(o)?S(s)?e[a]=w(s,o,n):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 E(e){return Array.from(e.match(Kt)??[])}function qt(e){let t=E(e);if(t.length===0)return``;let[n,...r]=t;return`${n.toLowerCase()}${r.map(e=>Gt(e)).join(``)}`}function Jt(e){if(T(e))return e.map(e=>Jt(e));if(S(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,t){return w(Lt(e),t,function e(t,n){if(Array.isArray(n))return w(Array.isArray(t)?dt(t):[],n,e);if(S(n))return S(t)?w(dt(t),n,e):w({},n,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 Xt(e){return E(e).map(e=>e.toLowerCase()).join(`_`)}function Zt(e){if(T(e))return e.map(e=>Zt(e));if(D(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 e instanceof ArrayBuffer}function $t(e){return typeof Blob>`u`?!1:e instanceof Blob}function en(){return typeof window<`u`&&window?.document!=null}function tn(e){return e instanceof Date}function nn(e){return S(e)&&Object.keys(e).length===0}function O(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}function rn(e,t,n){return an(e,t,void 0,void 0,void 0,void 0,n)}function an(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 on(e,t,a,o)}return on(e,t,a,o)}function on(e,t,n,r){if(Object.is(e,t))return!0;let i=v(e),a=v(t);if(i===`[object Arguments]`&&(i=wt),a===`[object Arguments]`&&(a=wt),i!==a)return!1;switch(i){case mt:return e.toString()===t.toString();case ht:return O(e.valueOf(),t.valueOf());case gt:case yt:case vt:return Object.is(e.valueOf(),t.valueOf());case pt:return e.source===t.source&&e.flags===t.flags;case`[object Function]`:return e===t}n??=new Map;let o=n.get(e),s=n.get(t);if(o!=null&&s!=null)return o===t;n.set(e,t),n.set(t,e);try{switch(i){case bt:if(e.size!==t.size)return!1;for(let[i,a]of e.entries())if(!t.has(i)||!an(a,t.get(i),i,e,t,n,r))return!1;return!0;case xt:{if(e.size!==t.size)return!1;let i=Array.from(e.values()),a=Array.from(t.values());for(let o=0;o<i.length;o++){let s=i[o],c=a.findIndex(i=>an(s,i,void 0,e,t,n,r));if(c===-1)return!1;a.splice(c,1)}return!0}case St:case Et:case Dt:case Ot:case kt:case`[object BigUint64Array]`:case At:case jt:case Mt:case`[object BigInt64Array]`:case Nt:case Pt:if(y(e)!==y(t)||e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(!an(e[i],t[i],i,e,t,n,r))return!1;return!0;case Ct:return e.byteLength===t.byteLength?on(new Uint8Array(e),new Uint8Array(t),n,r):!1;case Tt:return e.byteLength!==t.byteLength||e.byteOffset!==t.byteOffset?!1:on(new Uint8Array(e),new Uint8Array(t),n,r);case`[object Error]`:return e.name===t.name&&e.message===t.message;case wt:{if(!(on(e.constructor,t.constructor,n,r)||S(e)&&S(t)))return!1;let i=[...Object.keys(e),...ft(e)],a=[...Object.keys(t),...ft(t)];if(i.length!==a.length)return!1;for(let a=0;a<i.length;a++){let o=i[a],s=e[o];if(!Object.hasOwn(t,o))return!1;let c=t[o];if(!an(s,c,o,e,t,n,r))return!1}return!0}default:return!1}}finally{n.delete(e),n.delete(t)}}function sn(e,t){return rn(e,t,Ke)}function cn(e){return typeof File>`u`?!1:$t(e)&&e instanceof File}function k(e){return typeof e==`function`}function ln(e){return e!=null&&typeof e[Symbol.iterator]==`function`}function un(e){if(typeof e!=`string`)return!1;try{return JSON.parse(e),!0}catch{return!1}}function dn(e){switch(typeof e){case`object`:return e===null||fn(e)||pn(e);case`string`:case`number`:case`boolean`:return!0;default:return!1}}function fn(e){return Array.isArray(e)?e.every(e=>dn(e)):!1}function pn(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`||!dn(i))return!1}return!0}function mn(e){return Number.isSafeInteger(e)&&e>=0}function hn(e){return e instanceof Map}function A(e){return e==null}function gn(){return typeof process<`u`&&process?.versions?.node!=null}function _n(e){return e!=null}function vn(e){return e===null}function yn(e){return e instanceof Promise}function bn(e){return e instanceof RegExp}function xn(e){return e instanceof Set}function Sn(e){return typeof e==`symbol`}function Cn(e){return e===void 0}function wn(e){return e instanceof WeakMap}function Tn(e){return e instanceof WeakSet}async function En(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 Dn=class{semaphore=new m(1);get isLocked(){return this.semaphore.available===0}async acquire(){return this.semaphore.acquire()}release(){this.semaphore.release()}};function On(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 Re)},e);t?.addEventListener(`abort`,i,{once:!0})})}async function kn(e,t,{signal:n}={}){return Promise.race([e(),On(t,{signal:n})])}function An(e){return E(e).map(e=>e.toUpperCase()).join(`_`)}let jn=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 Mn(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+=jn.get(r)??r)}return t}let Nn={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`};function Pn(e){return e.replace(/[&<>"']/g,e=>Nn[e])}function Fn(e){return e.replace(/[\\^$.*+?()[\]{}|]/g,`\\$&`)}function In(e){return E(e).map(e=>e.toLowerCase()).join(`-`)}function Ln(e){return E(e).map(e=>e.toLowerCase()).join(` `)}function Rn(e){return e.substring(0,1).toLowerCase()+e.substring(1)}function zn(e,t,n=` `){return e.padStart(Math.floor((t-e.length)/2)+e.length,n).padEnd(t,n)}function Bn(e){return E(e).map(e=>Gt(e)).join(``)}function Vn(e){return[...e].reverse().join(``)}function Hn(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 Un(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 Wn(e,t){return t===void 0?e.trim():Un(Hn(e,t),t)}let Gn={"&amp;":`&`,"&lt;":`<`,"&gt;":`>`,"&quot;":`"`,"&#39;":`'`};function Kn(e){return e.replace(/&(?:amp|lt|gt|quot|#(0+)?39);/g,e=>Gn[e]||`'`)}function qn(e){let t=E(e),n=``;for(let e=0;e<t.length;e++)n+=t[e].toUpperCase(),e<t.length-1&&(n+=` `);return n}function Jn(e){return e.substring(0,1).toUpperCase()+e.substring(1)}async function Yn(e){try{return[null,await e()]}catch(e){return[e,null]}}function Xn(e,t){if(!e)throw typeof t==`string`?Error(t):t}function Zn(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`&&mn(e.length)}function Qn(e,t=1){if(t=Math.max(Math.floor(t),0),t===0||!M(e)||Number.isNaN(t))return[];let r=j(e);return isFinite(t)?n(r,t):[r]}function $n(e){return M(e)?a(Array.from(e)):[]}function er(...e){return te(e)}let tr=/\.|(\[(?:[^[\]]*|(["'])(?:(?!\2)[^\\]|\\.)*?\2)\])/;function nr(e){switch(typeof e){case`number`:case`symbol`:return!1;case`string`:return e===``||e.startsWith(`.`)||e.endsWith(`.`)?!1:tr.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){if(e==null)return``;if(typeof e==`string`)return e;if(Array.isArray(e))return e.map(P).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;for(e.charCodeAt(0)===46&&t.push(``);r<n;){let s=e[r];if(a)s===`\\`&&r+1<n?(r++,i+=e[r]):s===a?a=``:i+=s;else if(o)s===`"`||s===`'`?a=s:s===`]`?(o=!1,t.push(i),i=``):i+=s;else if(s===`[`)o=!0,i&&=(t.push(i),``);else if(s===`.`){i&&=(t.push(i),``);let n=e[r+1];(n===void 0||n===`.`)&&t.push(``)}else i+=s;r++}return i&&t.push(i),t}function I(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?nr(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 rr(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 rr(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 L(e){return function(t){return I(t,e)}}function R(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 R(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||_(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(!_(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 z(e){return e=Lt(e),t=>ur(t,e)}function dr(e,t){return Ft(e,(n,r,i,a)=>{let o=t?.(n,r,i,a);if(o!==void 0)return o;if(typeof e==`object`){if(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 ht:case mt:case gt:{let t=new e.constructor(e?.valueOf());return x(t,e),t}case _t:{let t={};return x(t,e),t.length=e.length,t[Symbol.iterator]=e[Symbol.iterator],t}default:return}}})}function fr(e){return dr(e)}let pr=/^(?:0|[1-9]\d*)$/;function mr(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 pr.test(e)}}function hr(e){return typeof e==`object`&&!!e&&v(e)===`[object Arguments]`}function gr(e,t){let n;if(n=Array.isArray(t)?t:typeof t==`string`&&nr(t)&&e?.[t]==null?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)||hr(r))&&mr(t)&&t<r.length))return!1;r=r[t]}return!0}function B(e,t){switch(typeof e){case`object`:Object.is(e?.valueOf(),-0)&&(e=`-0`);break;case`number`:e=N(e);break}return t=fr(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 V(e){if(e==null)return g;switch(typeof e){case`function`:return e;case`object`:return Array.isArray(e)&&e.length===2?B(e[0],e[1]):z(e);case`string`:case`symbol`:case`number`:return L(e)}}function _r(e,t){if(e==null)return{};let n=M(e)?Array.from(e):Object.values(e),r=V(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 H(e){return typeof e==`object`&&!!e}function U(e){return H(e)&&M(e)}function vr(e,...t){if(!U(e))return[];let n=Array.from(e),r=[];for(let e=0;e<t.length;e++){let n=t[e];U(n)&&r.push(...Array.from(n))}return o(n,r)}function W(e){if(M(e))return fe(j(e))}function yr(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n];if(U(r))for(let e=0;e<r.length;e++)t.push(r[e])}return t}function br(e,...t){if(!U(e))return[];let n=W(t),r=yr(t);return U(n)?o(Array.from(e),r):s(Array.from(e),r,V(n))}function xr(e,...t){if(!U(e))return[];let n=W(t),r=yr(t);return typeof n==`function`?c(Array.from(e),r,n):o(Array.from(e),r)}function G(e){return typeof e==`symbol`||e instanceof Symbol}function K(e){return G(e)?NaN:Number(e)}function q(e){return e?(e=K(e),e===1/0||e===-1/0?(e<0?-1:1)*Number.MAX_VALUE:e===e?e:0):e===0?e:0}function J(e){let t=q(e),n=t%1;return n?t-n:t}function Sr(e,t=1,n){return M(e)?(t=n?1:J(t),l(j(e),t)):[]}function Cr(e,t=1,n){return M(e)?(t=n?1:J(t),u(j(e),t)):[]}function wr(e,t=g){return M(e)?Tr(j(e),t):[]}function Tr(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,B(n,r))}else return d(e,z(t));case`symbol`:case`number`:case`string`:return d(e,L(t))}}function Er(e,t=g){return M(e)?Dr(j(e),t):[]}function Dr(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,B(n,r))}else return f(e,z(t));case`number`:case`symbol`:case`string`:return f(e,L(t))}}function Or(e,t=g){if(!e)return e;let n=M(e)||Array.isArray(e)?lt(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 kr(e,t=g){if(!e)return e;let n=M(e)?lt(0,e.length):Object.keys(e);for(let r=n.length-1;r>=0;r--){let i=n[r],a=e[i];if(t(a,i,e)===!1)break}return e}function Y(e,t,n){return R(n)&&(typeof t==`number`&&M(n)&&mr(t)&&t<n.length||typeof t==`string`&&t in n)?O(n[t],e):!1}function Ar(e,t,n){if(!e)return!0;n&&Y(e,t,n)&&(t=void 0),t||=g;let r;switch(typeof t){case`function`:r=t;break;case`object`:if(Array.isArray(t)&&t.length===2){let e=t[0],n=t[1];r=B(e,n)}else r=z(t);break;case`symbol`:case`number`:case`string`:r=L(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}function jr(e){return typeof e==`string`||e instanceof String}function Mr(e,t,n=0,r=e?e.length:0){return M(e)?jr(e)?e:(n=Math.floor(n),r=Math.floor(r),n||=0,r||=0,p(e,t,n,r)):[]}function Nr(e,t=g){if(!e)return[];if(t=V(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 Pr(e,t=g,n=0){if(!e)return;n<0&&(n=Math.max(e.length+n,0));let r=V(t);if(!Array.isArray(e)){let t=Object.keys(e);for(let i=n;i<t.length;i++){let n=t[i],a=e[n];if(r(a,n,e))return a}return}return e.slice(n).find(r)}function X(e){return e}function Fr(e,t=X,n=0){if(!e)return-1;Number.isNaN(n)&&(n=0),n<0&&(n=Math.max(e.length+n,0));let r=Array.from(e).slice(n),i=-1;switch(typeof t){case`function`:i=r.findIndex(t);break;case`object`:if(Array.isArray(t)&&t.length===2){let e=t[0],n=t[1];i=r.findIndex(B(e,n))}else i=r.findIndex(z(t));break;case`number`:case`symbol`:case`string`:i=r.findIndex(L(t))}return i===-1?-1:i+n}function Ir(e,t=g,n){if(!e)return;let r=Array.isArray(e)?e.length:Object.keys(e).length;n=J(n??r-1),n=n<0?Math.max(r+n,0):Math.min(n,r-1);let i=V(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 Lr(e,t=g,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(B(e,n))}else return r.findLastIndex(z(t));case`number`:case`symbol`:case`string`:return r.findLastIndex(L(t))}}function Rr(e){if(M(e))return ae(j(e))}function zr(e,t=1){let n=[],r=Math.floor(t);if(!M(e))return n;let i=(e,t)=>{for(let a=0;a<e.length;a++){let o=e[a];t<r&&(Array.isArray(o)||o?.[Symbol.isConcatSpreadable]||typeof o==`object`&&o&&Object.prototype.toString.call(o)===`[object Arguments]`)?i(Array.isArray(o)?o:Array.from(o),t+1):n.push(o)}};return i(Array.from(e),0),n}function Br(e,t=1){return zr(e,t)}function Vr(e,t){if(!e)return[];let n=M(e)||Array.isArray(e)?lt(0,e.length):Object.keys(e),r=V(t??g),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 Hr(e,t){return A(e)?[]:Br(A(t)?Vr(e):Vr(e,t),1)}function Ur(e,t=g,n=1){return e==null?[]:zr(Vr(e,V(t)),n)}function Wr(e,t){return Ur(e,t,1/0)}function Gr(e){return Br(e,1/0)}function Kr(e,t){return e==null?{}:ie(M(e)?Array.from(e):Object.values(e),V(t??g))}function qr(e,t,n,r){if(e==null)return!1;if(n=r||!n?0:J(n),jr(e))return n>e.length||t instanceof RegExp?!1:(n<0&&(n=Math.max(0,e.length+n)),e.includes(t,n));if(Array.isArray(e))return e.includes(t,n);let i=Object.keys(e);n<0&&(n=Math.max(0,i.length+n));for(let r=n;r<i.length;r++)if(O(Reflect.get(e,i[r]),t))return!0;return!1}function Jr(e,t,n){if(!M(e))return-1;if(Number.isNaN(t)){n??=0,n<0&&(n=Math.max(0,e.length+n));for(let t=n;t<e.length;t++)if(Number.isNaN(e[t]))return t;return-1}return Array.from(e).indexOf(t,n)}function Yr(e){return M(e)?oe(Array.from(e)):[]}function Xr(...e){if(e.length===0||!U(e[0]))return[];let t=Oe(Array.from(e[0]));for(let n=1;n<e.length;n++){let r=e[n];if(!U(r))return[];t=se(t,Array.from(r))}return t}function Zr(e,...t){if(!U(e))return[];let n=fe(t);if(n===void 0)return Array.from(e);let r=Oe(Array.from(e)),i=U(n)?t.length:t.length-1;for(let e=0;e<i;++e){let i=t[e];if(!U(i))return[];U(n)?r=ce(r,Array.from(i),g):typeof n==`function`?r=ce(r,Array.from(i),e=>n(e)):typeof n==`string`&&(r=ce(r,Array.from(i),L(n)))}return r}function Qr(e){return M(e)?Oe(Array.from(e)):[]}function $r(e,...t){if(e==null)return[];let n=W(t),r=O,i=Qr;typeof n==`function`&&(r=n,i=ei,t.pop());let a=i(Array.from(e));for(let e=0;e<t.length;++e){let n=t[e];if(n==null)return[];a=le(a,Array.from(n),r)}return a}function ei(e){let t=[],n=new Set;for(let r=0;r<e.length;r++){let i=e[r];n.has(i)||(t.push(i),n.add(i))}return t}function 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=g,n){let r=arguments.length>=3;if(!e)return n;let i,a=0;M(e)?(i=lt(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)&&!H(e))return{};let n=V(t??g);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:J(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 Array.from(e).lastIndexOf(t,i)}function oi(e,t=0){if(!(!M(e)||e.length===0))return t=J(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||G(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=Object.values(e)),Array.isArray(t)||(t=t==null?[null]:[t]),t.length===0&&(t=[null]),Array.isArray(n)||(n=n==null?[]:[n]),n=n.map(e=>String(e));let i=(e,t)=>{let n=e;for(let e=0;e<t.length&&n!=null;++e)n=n[t[e]];return n},a=(e,t)=>t==null||e==null?t:typeof e==`object`&&`key`in e?Object.hasOwn(t,e.key)?t[e.key]:i(t,e.path):typeof e==`function`?e(t):Array.isArray(e)?i(t,e):typeof t==`object`?t[e]:t,o=t.map(e=>(Array.isArray(e)&&e.length===1&&(e=e[0]),e==null||typeof e==`function`||Array.isArray(e)||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=g){if(!e)return[[],[]];let n=M(e)?e:Object.values(e);t=V(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 ge(e,t)}function hi(e,t=[]){return ge(e,Array.from(t))}function gi(e,t,n){let r=V(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)||jr(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)),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&&nr(t)&&!Object.hasOwn(e,t))return xi(e,F(t));if(C(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(C(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=>mr(t,e.length)?Number(t):t).sort((e,t)=>t-e);for(let t of new Set(i)){if(mr(t,e.length)){Array.prototype.splice.call(e,t,1);continue}if(di(t,e)){delete e[N(t)];continue}bi(e,T(t)?t:F(t))}return r}function Ci(e,t=g,n){let r=arguments.length>=3;if(!e)return n;let i,a;M(e)?(i=lt(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=g){return Nr(e,wi(V(t)))}function Ei(e,t=g){return ve(e,V(t))}function Di(e){return e==null?e:e.reverse()}function Oi(e){if(e!=null)return M(e)?ye(j(e)):ye(Object.values(e))}function ki(e,t,n){return n===void 0&&(n=t,t=void 0),n!==void 0&&(n=K(n),e=Math.min(e,Number.isNaN(n)?0:n)),t!==void 0&&(t=K(t),e=Math.max(e,Number.isNaN(t)?0:t)),e}function Ai(e){return hn(e)}function ji(e){return e==null?[]:M(e)||Ai(e)?Array.from(e):typeof e==`object`?Object.values(e):[]}function Mi(e,t,n){let r=ji(e);return t=(n?Y(e,t,n):t===void 0)?1:ki(J(t),0,r.length),Se(r,t)}function Ni(e){return e==null?[]:Object.values(e)}function Pi(e){return e==null}function Fi(e){return Pi(e)?[]:T(e)?Ce(e):M(e)?Ce(Array.from(e)):H(e)?Ce(Ni(e)):[]}function Ii(e){return A(e)?0:M(e)?e.length:e instanceof Map||e instanceof Set?e.size:Object.keys(e).length}function Li(e,t,n){if(!M(e))return[];let r=e.length;n===void 0?n=r:typeof n!=`number`&&Y(e,t,n)&&(t=0,n=r),t=J(t),n=J(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 Ri(e,t,n){if(!e)return!1;n!=null&&(t=void 0),t??=g;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=B(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=z(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=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)}}}function zi(e,...t){let n=t.length;return n>1&&Y(e,t[0],t[1])?t=[]:n>2&&Y(t[0],t[1],t[2])&&(t=[t[0]]),fi(e,te(t),[`asc`])}function Bi(e){return typeof e==`number`||H(e)&&v(e)===`[object Number]`}function Vi(e){return Bi(e)&&Number.isNaN(Number(e))}function Hi(e,t,n=X,r){if(Pi(e)||e.length===0)return 0;let i=0,a=e.length,o=V(n),s=o(t),c=Vi(s),l=vn(s),u=G(s),d=Cn(s);for(;i<a;){let t,n=Math.floor((i+a)/2),f=o(e[n]),p=!Cn(f),m=vn(f),h=!Vi(f),ee=G(f);t=c?r||h:d?h&&(r||p):l?h&&p&&(r||!m):u?h&&p&&!m&&(r||!ee):m||ee?!1:r?f<=s:f<s,t?i=n+1:a=n}return Math.min(a,4294967294)}function Ui(e,t){if(A(e))return 0;let n=0,r=e.length;if(Bi(t)&&t===t&&r<=2147483647){for(;n<r;){let i=n+r>>>1,a=e[i];!vn(a)&&!Sn(a)&&a<t?n=i+1:r=i}return r}return Hi(e,t,e=>e)}function Wi(e,t){if(!e?.length)return-1;let n=Ui(e,t);return n<e.length&&O(e[n],t)?n:-1}function Gi(e,t,n){return Hi(e,t,n,!0)}function Ki(e,t){if(A(e))return 0;let n=e.length;if(!Bi(t)||Number.isNaN(t)||n>2147483647)return Gi(e,t,e=>e);let r=0;for(;r<n;){let i=r+n>>>1,a=e[i];!vn(a)&&!Sn(a)&&a<=t?r=i+1:n=i}return n}function qi(e,t){if(!e?.length)return-1;let n=Ki(e,t)-1;return n>=0&&O(e[n],t)?n:-1}function Ji(e){return M(e)?we(j(e)):[]}function Yi(e,t=1,n){return t=n||t===void 0?1:J(t),t<1||!M(e)?[]:Te(j(e),t)}function Xi(e,t=1,n){return t=n?1:J(t),t<=0||!M(e)?[]:Ee(j(e),t)}function Zi(e,t){if(!U(e))return[];let n=j(e),r=n.findLastIndex(Ge(V(t??g)));return n.slice(r+1)}function Qi(e,t){if(!U(e))return[];let n=j(e),r=n.findIndex(wi(V(t??X)));return r===-1?n:n.slice(0,r)}function $i(...e){return Oe(Ur(e.filter(U),e=>Array.from(e),1))}function ea(...e){let t=fe(e),n=yr(e);return U(t)||t==null?Oe(n):ke(n,Be(V(t),1))}function ta(...e){let t=fe(e),n=yr(e);return U(t)||t==null?Oe(n):Ae(n,t)}function na(e,t=g){return U(e)?ke(Array.from(e),Be(V(t),1)):[]}function ra(e,t){return M(e)?typeof t==`function`?Ae(Array.from(e),(e,n)=>t(n,e)):Qr(Array.from(e)):[]}function ia(e){return!U(e)||!e.length?[]:(e=T(e)?e:Array.from(e),e=e.filter(e=>U(e)),je(e))}function aa(e,t){if(!U(e)||!e.length)return[];let n=T(e)?je(e):je(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 oa(e,...t){return U(e)?Ne(Array.from(e),...t):[]}function sa(...e){let t=new Map;for(let n=0;n<e.length;n++){let r=e[n];if(!U(r))continue;let i=new Set(ji(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 ca(...e){let t=W(e),n=g;!U(t)&&t!=null&&(n=V(t),e=e.slice(0,-1));let r=e.filter(U);return br(ea(...r,n),ea(...Me(r,2).map(([e,t])=>Zr(e,t,n)),n),n)}function la(...e){let t=W(e),n=(e,t)=>e===t;typeof t==`function`&&(n=t,e=e.slice(0,-1));let r=e.filter(U);return xr(ta(...r,n),ta(...Me(r,2).map(([e,t])=>$r(e,t,n)),n),n)}function ua(...e){return e.length?Pe(...e.filter(e=>U(e))):[]}let da=(e,t,n)=>{let r=e[t];(!(Object.hasOwn(e,t)&&O(r,n))||n===void 0&&!(t in e))&&(e[t]=n)};function fa(e=[],t=[]){let n={};for(let r=0;r<e.length;r++)da(n,e[r],t[r]);return n}function pa(e,t,n,r){if(e==null&&!R(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(C(n))continue;let s;if(t===i.length-1)s=a;else{let a=o[n],c=r?.(a,n,e);s=c===void 0?R(a)?a:mr(i[t+1])?[]:{}:c}da(o,n,s),o=o[n]}return e}function ma(e,t,n){return pa(e,t,()=>n,()=>void 0)}function ha(e,t){let n={};if(!M(e))return n;M(t)||(t=[]);let r=Pe(Array.from(e),Array.from(t));for(let e=0;e<r.length;e++){let[t,i]=r[e];t!=null&&ma(n,t,i)}return n}function ga(...e){let t=e.pop();if(k(t)||(e.push(t),t=void 0),!e?.length)return[];let n=ia(e);return t==null?n:n.map(e=>t(...e))}function _a(e,t){if(typeof t!=`function`)throw TypeError(`Expected a function`);return e=J(e),function(...n){if(--e<1)return t.apply(this,n)}}function va(e,t=e.length,n){return n&&(t=e.length),(Number.isNaN(t)||t<0)&&(t=0),Be(e,t)}function ya(e,...t){try{return e(...t)}catch(e){return e instanceof Error?e:Error(e)}}function ba(e,t){if(typeof t!=`function`)throw TypeError(`Expected a function`);let n;return e=J(e),function(...r){return--e>0&&(n=t.apply(this,r)),e<=1&&t&&(t=void 0),n}}function xa(e,t,...n){let r=function(...i){let a=[],o=0;for(let e=0;e<n.length;e++){let t=n[e];t===xa.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}xa.placeholder=Symbol(`bind.placeholder`);function Sa(e,t,...n){let r=function(...i){let a=[],o=0;for(let e=0;e<n.length;e++){let t=n[e];t===Sa.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}Sa.placeholder=Symbol(`bindKey.placeholder`);function Ca(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===Ca.placeholder),a=n.length-i.length;return a<t?wa(e,t-a,n):this instanceof r?new e(...n):e.apply(this,n)};return r.placeholder=Ea,r}function wa(e,t,n){function r(...i){let a=i.filter(e=>e===Ca.placeholder),o=i.length-a.length;return i=Ta(i,n),o<t?wa(e,t-o,i):this instanceof r?new e(...i):e.apply(this,i)}return r.placeholder=Ea,r}function Ta(e,t){let n=[],r=0;for(let i=0;i<t.length;i++){let a=t[i];a===Ca.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 Ea=Symbol(`curry.placeholder`);Ca.placeholder=Ea;function Da(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===Da.placeholder),a=n.length-i.length;return a<t?Oa(e,t-a,n):this instanceof r?new e(...n):e.apply(this,n)};return r.placeholder=Aa,r}function Oa(e,t,n){function r(...i){let a=i.filter(e=>e===Da.placeholder),o=i.length-a.length;return i=ka(i,n),o<t?Oa(e,t-o,i):this instanceof r?new e(...i):e.apply(this,i)}return r.placeholder=Aa,r}function ka(e,t){let n=t.filter(e=>e===Da.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===Da.placeholder&&a<e.length?i.push(e[a++]):i.push(r)}return i}let Aa=Symbol(`curryRight.placeholder`);Da.placeholder=Aa;function ja(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=He(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 Ma(e,...t){if(typeof e!=`function`)throw TypeError(`Expected a function`);return setTimeout(e,1,...t)}function Na(e,t,...n){if(typeof e!=`function`)throw TypeError(`Expected a function`);return setTimeout(e,K(t)||0,...n)}function Pa(e){return function(...t){return e.apply(this,t.reverse())}}function Fa(...e){let t=te(e,1);if(t.some(e=>typeof e!=`function`))throw TypeError(`Expected a function`);return Ue(...t)}function Ia(...e){let t=te(e,1);if(t.some(e=>typeof e!=`function`))throw TypeError(`Expected a function`);return We(...t)}function La(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(La.Cache||Map),n}La.Cache=Map;function Ra(e=0){return function(...t){return t.at(J(e))}}function za(e){return qe(e)}function Ba(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]=V(n[e]??g).call(this,t[e]);return e.apply(this,i)}}function Va(e,...t){return Ye(e,Va.placeholder,...t)}Va.placeholder=Symbol(`compat.partial.placeholder`);function Ha(e,...t){return Qe(e,Ha.placeholder,...t)}Ha.placeholder=Symbol(`compat.partialRight.placeholder`);function Ua(e,...t){let n=zr(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 Wa(e,t=e.length-1){return t=Number.parseInt(t,10),(Number.isNaN(t)||t<0)&&(t=e.length-1),et(e,t)}function Ga(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 Ka(e,t=0,n={}){let{leading:r=!0,trailing:i=!0}=n;return ja(e,t,{leading:r,maxWait:t,trailing:i})}function qa(e){return va(e,1)}function Ja(e,t){return function(...n){return(k(t)?t:g).apply(this,[e,...n])}}function Ya(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=K(e),t=K(t)),e+t)}function Xa(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 Za(e,t=0){return Xa(`ceil`,e,t)}function Qa(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=K(e),t=K(t)),e/t)}function $a(e,t=0){return Xa(`floor`,e,t)}function eo(e,t,n){return t=q(t),n===void 0?(n=t,t=0):n=q(n),e=K(e),e>=Math.min(t,n)&&e<Math.max(t,n)}function to(e){if(!e||e.length===0)return;let t;for(let n=0;n<e.length;n++){let r=e[n];r==null||Number.isNaN(r)||typeof r==`symbol`||(t===void 0||r>t)&&(t=r)}return t}function no(e,t){if(e!=null)return me(Array.from(e),V(t??g))}function ro(e,t){if(!e||!e.length)return 0;t!=null&&(t=V(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 io(e){return ro(e)}function ao(e){let t=e?e.length:0;return t===0?NaN:io(e)/t}function oo(e,t){return e==null?NaN:at(Array.from(e),V(t??g))}function so(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 co(e,t){if(e!=null)return he(Array.from(e),V(t??g))}function lo(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=K(e),t=K(t)),e*t)}function uo(e,t=0,n){return n&&(t=0),Number.parseInt(P(e),t)}function fo(...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?be(t,n):xe(t,n+1)}function po(e,t,n){n&&typeof n!=`number`&&Y(e,t,n)&&(t=n=void 0),e=q(e),t===void 0?(t=e,e=0):t=q(t),n=n===void 0?e<t?1:-1:q(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 mo(e,t,n){n&&typeof n!=`number`&&Y(e,t,n)&&(t=n=void 0),e=q(e),t===void 0?(t=e,e=0):t=q(t),n=n===void 0?e<t?1:-1:q(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 ho(e,t=0){return Xa(`round`,e,t)}function go(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=K(e),t=K(t)),e-t)}function _o(...e){}function vo(e){let t=e?.constructor;return e===(typeof t==`function`?t.prototype:Object.prototype)}function Z(e){return ut(e)}function yo(e,t){if(e=J(e),e<1||!Number.isSafeInteger(e))return[];let n=Array(e);for(let r=0;r<e;r++)n[r]=typeof t==`function`?t(r):r;return n}function Q(e){if(M(e))return bo(e);let t=Object.keys(Object(e));return vo(e)?t.filter(e=>e!==`constructor`):t}function bo(e){let t=yo(e.length,e=>`${e}`),n=new Set(t);y(e)&&(n.add(`offset`),n.add(`parent`)),Z(e)&&(n.add(`buffer`),n.add(`byteLength`),n.add(`byteOffset`));let r=Object.keys(e).filter(e=>!n.has(e));return Array.isArray(e)?[...t,...r]:[...t.filter(t=>Object.hasOwn(e,t)),...r]}function xo(e,...t){for(let n=0;n<t.length;n++)So(e,t[n]);return e}function So(e,t){let n=Q(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 $(e){if(e==null)return[];switch(typeof e){case`object`:case`function`:return M(e)?To(e):vo(e)?wo(e):Co(e);default:return Co(Object(e))}}function Co(e){let t=[];for(let n in e)t.push(n);return t}function wo(e){return Co(e).filter(e=>e!==`constructor`)}function To(e){let t=yo(e.length,e=>`${e}`),n=new Set(t);y(e)&&(n.add(`offset`),n.add(`parent`)),Z(e)&&(n.add(`buffer`),n.add(`byteLength`),n.add(`byteOffset`));let r=Co(e).filter(e=>!n.has(e));return Array.isArray(e)?[...t,...r]:[...t.filter(t=>Object.hasOwn(e,t)),...r]}function Eo(e,...t){for(let n=0;n<t.length;n++)Do(e,t[n]);return e}function Do(e,t){let n=$(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 Oo(e,...t){let n=t[t.length-1];typeof n==`function`?t.pop():n=void 0;for(let r=0;r<t.length;r++)ko(e,t[r],n);return e}function ko(e,t,n){let r=$(t);for(let i=0;i<r.length;i++){let a=r[i],o=e[a],s=t[a],c=n?.(o,s,a,e,t)??s;(!(a in e)||!O(o,c))&&(e[a]=c)}}function Ao(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=Q(t);for(let i=0;i<r.length;i++){let a=r[i],o=e[a],s=t[a],c=n?.(o,s,a,e,t)??s;(!(a in e)||!O(o,c))&&(e[a]=c)}}function Mo(e){if(_(e))return e;let t=v(e);if(!No(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(Z(e)){let t=e,n=t.constructor;return new n(t.buffer,t.byteOffset,t.length)}if(t===`[object ArrayBuffer]`)return new ArrayBuffer(e.byteLength);if(t===`[object DataView]`){let t=e,n=t.buffer,r=t.byteOffset,i=t.byteLength,a=new ArrayBuffer(i),o=new Uint8Array(n,r,i);return new Uint8Array(a).set(o),new DataView(a)}if(t===`[object Boolean]`||t===`[object Number]`||t===`[object String]`){let n=e.constructor,r=new n(e.valueOf());return t===`[object String]`?Io(r,e):Po(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 Po(n,t),n.length=t.length,n[Symbol.iterator]=t[Symbol.iterator],n}let n={};return Lo(n,e),Po(n,e),Fo(n,e),n}function No(e){switch(v(e)){case _t:case St:case Ct:case Tt:case gt:case yt:case Nt:case Pt:case At:case jt:case Mt:case bt:case ht:case wt:case pt:case xt:case mt:case vt:case Et:case Dt:case Ot:case kt:return!0;default:return!1}}function Po(e,t){for(let n in t)Object.hasOwn(t,n)&&(e[n]=t[n])}function Fo(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 Io(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 Lo(e,t){let n=Object.getPrototypeOf(t);n!==null&&typeof t.constructor==`function`&&Object.setPrototypeOf(e,n)}function Ro(e,t){if(!t)return Mo(e);let n=t(e);return n===void 0?Mo(e):n}function zo(e,t){let n=R(e)?Object.create(e):{};if(t!=null){let e=Q(t);for(let r=0;r<e.length;r++){let i=e[r],a=t[i];da(n,i,a)}}return n}function Bo(e,...t){e=Object(e);let n=Object.prototype,r=t.length,i=r>2?t[2]:void 0;i&&Y(t[0],t[1],i)&&(r=1);for(let i=0;i<r;i++){if(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 Vo(e,...t){e=Object(e);for(let n=0;n<t.length;n++){let r=t[n];r!=null&&Ho(e,r,new WeakMap)}return e}function Ho(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]=Uo(i,n);continue}n.get(i)!==a&&Wo(a,i,n)}}function Uo(e,t){if(t.has(e))return t.get(e);if(D(e)){let n={};return t.set(e,n),Ho(n,e,t),n}return e}function Wo(e,t,n){if(D(e)&&D(t)){n.set(t,e),Ho(e,t,n);return}Array.isArray(e)&&Array.isArray(t)&&(n.set(t,e),Go(e,t,n))}function Go(e,t,n){let r=Math.min(t.length,e.length);for(let i=0;i<r;i++)D(e[i])&&D(t[i])&&Ho(e[i],t[i],n);for(let n=r;n<t.length;n++)e.push(t[n])}function Ko(e,t){if(R(e))return Rt(e,V(t??X))}function qo(e,t){if(!R(e))return;let n=V(t??X);return Object.keys(e).findLast(t=>n(e[t],t,e))}function Jo(e,t=g){if(e==null)return e;for(let n in e)if(t(e[n],n,e)===!1)break;return e}function Yo(e,t=g){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 Xo(e,t=g){if(e==null)return e;let n=Object(e),r=Q(e);for(let e=0;e<r.length;++e){let i=r[e];if(t(n[i],i,n)===!1)break}return e}function Zo(e,t=g){if(e==null)return e;let n=Object(e),r=Q(e);for(let e=r.length-1;e>=0;--e){let i=r[e];if(t(n[i],i,n)===!1)break}return e}function Qo(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 $o(e){return e==null?[]:Q(e).filter(t=>typeof e[t]==`function`)}function es(e){if(e==null)return[];let t=[];for(let n in e)k(e[n])&&t.push(n);return t}function ts(e,t){if(e==null)return!1;let n;if(n=Array.isArray(t)?t:typeof t==`string`&&nr(t)&&e[t]==null?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)||hr(r))&&mr(t)&&t<r.length))return!1;r=r[t]}return!0}function ns(e){return Vt(e)}function rs(e,t){let n={};if(A(e))return n;t??=g;let r=Object.keys(e),i=V(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 is(e,t=g){return e==null?{}:Ht(e,V(t))}function as(e,t=g){return e==null?{}:Ut(e,V(t))}function os(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=ss(i,t,r,new Map)}return i}function ss(e,t,n,r){if(_(e)&&(e=Object(e)),typeof t!=`object`||!t)return e;if(r.has(t))return dt(r.get(t));if(r.set(t,e),Array.isArray(t)){t=t.slice();for(let e=0;e<t.length;e++)t[e]=t[e]??void 0}let i=[...Object.keys(t),...ft(t)];for(let a=0;a<i.length;a++){let o=i[a];if(C(o))continue;let s=t[o],c=e[o];if(hr(s)&&(s={...s}),hr(c)&&(c={...c}),y(s)&&(s=fr(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(U(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)||H(c)&&H(s)&&(D(c)||D(s)||Z(c)||Z(s))?e[o]=ss(c,s,n,r):c==null&&D(s)?e[o]=ss({},s,n,r):c==null&&Z(s)?e[o]=fr(s):(c===void 0||s!==void 0)&&(e[o]=s):e[o]=l}return e}function cs(e,...t){return os(e,...t,Ke)}function ls(e){let t=[];for(;e;)t.push(...ft(e)),e=Object.getPrototypeOf(e);return t}function us(e,...t){if(e==null)return{};t=zr(t);let n=ds(e,t);for(let e=0;e<t.length;e++){let r=t[e];switch(typeof r){case`object`:Array.isArray(r)||(r=Array.from(r));for(let e=0;e<r.length;e++){let t=r[e];bi(n,t)}break;case`string`:case`symbol`:case`number`:bi(n,r);break}}return n}function ds(e,t){return t.some(e=>Array.isArray(e)||nr(e))?ps(e):fs(e)}function fs(e){let t={},n=[...$(e),...ls(e)];for(let r=0;r<n.length;r++){let i=n[r];t[i]=e[i]}return t}function ps(e){let t={},n=[...$(e),...ls(e)];for(let r=0;r<n.length;r++){let i=n[r];t[i]=dr(e[i],e=>{if(!D(e))return e})}return t}function ms(e,t){if(e==null)return{};let n={},r=V(t??X),i=[...$(e),...ls(e)];for(let t=0;t<i.length;t++){let a=G(i[t])?i[t]:i[t].toString(),o=e[a];r(o,a,e)||(n[a]=o)}return n}function hs(e,...t){if(Pi(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]:ma(n,t,r))}}return n}function gs(e,t){if(e==null)return{};let n=V(t??X),r={},i=M(e)?lt(0,e.length):[...$(e),...ls(e)];for(let t=0;t<i.length;t++){let a=G(i[t])?i[t]:i[t].toString(),o=e[a];n(o,a,e)&&(r[a]=o)}return r}function _s(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 ys(e,t,n,r){let i;return i=typeof r==`function`?r:()=>void 0,pa(e,t,()=>n,i)}function bs(e,...t){return Bo(fr(e),...t)}function xs(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 Ss(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 Cs(e){if(e==null)return[];if(e instanceof Set)return Ss(e);if(e instanceof Map)return xs(e);let t=Q(e),n=Array(t.length);for(let r=0;r<t.length;r++){let i=t[r];n[r]=[i,e[i]]}return n}function ws(e){if(e==null)return[];if(e instanceof Set)return Ss(e);if(e instanceof Map)return xs(e);let t=$(e),n=Array(t.length);for(let r=0;r<t.length;r++){let i=t[r];n[r]=[i,e[i]]}return n}function Ts(e){return y(e)}function Es(e,t=g,n){let r=Array.isArray(e)||Ts(e)||Z(e);return t=V(t),n??=r?[]:R(e)&&k(e.constructor)?Object.create(Object.getPrototypeOf(e)):{},e==null||Or(e,(e,r,i)=>t(n,e,r,i)),n}function Ds(e,t,n){return pa(e,t,n,()=>void 0)}function Os(e){let t=$(e),n=Array(t.length);for(let r=0;r<t.length;r++)n[r]=e[t[r]];return n}function ks(e){return typeof e==`function`}function As(e){return Number.isSafeInteger(e)&&e>=0}let js=Function.prototype.toString,Ms=RegExp(`^${js.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)}$`);function Ns(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 Ms.test(js.call(e))}function Ps(e){return e===null}function Fs(e){return Cn(e)}function Is(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 Ls(e){return e=Lt(e),function(t){return Is(t,e)}}function Rs(e){return Qt(e)}function zs(e){return typeof e==`boolean`||e instanceof Boolean}function Bs(e){return tn(e)}function Vs(e){return H(e)&&e.nodeType===1&&!D(e)}function Hs(e){if(e==null)return!0;if(M(e))return typeof e.splice!=`function`&&typeof e!=`string`&&!y(e)&&!Z(e)&&!hr(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 vo(e)?t.filter(e=>e!==`constructor`).length===0:t.length===0}return!0}function Us(e,t,n){return typeof n!=`function`&&(n=()=>void 0),rn(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 Us(Array.from(e),Array.from(t),ze(2,n))})}function Ws(e){return v(e)===`[object Error]`}function Gs(e){return Number.isFinite(e)}function Ks(e){return Number.isInteger(e)}function qs(e){return bn(e)}function Js(e){return Number.isSafeInteger(e)}function Ys(e){return xn(e)}function Xs(e){return wn(e)}function Zs(e){return Tn(e)}function Qs(e){return Gt(P(e))}function $s(e,...t){if(e==null||!R(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=P(r),a=e[i];k(a)&&(e[i]=a.bind(e))}return e}function ec(e){return Mn(P(e))}function tc(e){return typeof e!=`string`&&(e=P(e)),e.replace(/['\u2019]/g,``)}function nc(e){return qt(tc(ec(e)))}function rc(e,t,n){return e==null||t==null?!1:(n??=e.length,e.endsWith(t,n))}function ic(e){return Pn(P(e))}function ac(e){return Fn(P(e))}function oc(e){return In(tc(ec(e)))}function sc(e){return Ln(tc(ec(e)))}function cc(e){return Rn(P(e))}function lc(e,t,n){return zn(P(e),t,n)}function uc(e,t=0,n=` `){return P(e).padEnd(t,n)}function dc(e,t=0,n=` `){return P(e).padStart(t,n)}let fc=2**53-1;function pc(e,t,n){return t=(n?Y(e,t,n):t===void 0)?1:J(t),t<1||t>fc?``:P(e).repeat(t)}function mc(e,t,n){return arguments.length<3?P(e):P(e).replace(t,n)}function hc(e){return Xt(tc(ec(e)))}function gc(e,t,n){return P(e).split(t,n)}function _c(e){let t=E(tc(ec(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 vc(e,t,n){return e==null||t==null?!1:(n??=0,e.startsWith(t,n))}let yc=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,bc=/['\n\r\u2028\u2029\\]/g,xc=/($^)/,Sc=new Map([[`\\`,`\\`],[`'`,`'`],[`
2
+ `,`n`],[`\r`,`r`],[`\u2028`,`u2028`],[`\u2029`,`u2029`]]);function Cc(e){return`\\${Sc.get(e)}`}let wc=/<%=([\s\S]+?)%>/g,Tc={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:wc,variable:``,imports:{_:{escape:ic,template:Ec}}};function Ec(e,t,n){e=P(e),n&&(t=Tc),t=Bo({...t},Tc);let r=new RegExp([t.escape?.source??xc.source,t.interpolate?.source??xc.source,t.interpolate===wc?yc.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(bc,Cc)}'`,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=Bo({...t.imports},Tc.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=ba(()=>Function(...c,`${u}return ${d}`)(...l));if(f.source=d,f instanceof Error)throw f;return f}function Oc(e){return P(e).toLowerCase()}function kc(e){return P(e).toUpperCase()}function Ac(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)?Gn(e,t.flatMap(e=>e.toString().split(``))):Gn(e,t.toString().split(``));default:return Gn(e,t.toString().split(``))}}function jc(e,t,n){return e==null?``:n!=null||t==null?e.toString().trimEnd():Un(e,t.toString().split(``))}function Mc(e,t,n){return e==null?``:n!=null||t==null?e.toString().trimStart():Wn(e,t.toString().split(``))}let Nc=/[\u200d\ud800-\udfff\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff\ufe0e\ufe0f]/;function Pc(e,t){e=e==null?``:`${e}`;let n=30,r=`...`;R(t)&&(n=Fc(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(Nc.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 Fc(e){return e==null?30:e<=0?0:e}function Ic(e){return qn(P(e))}function Lc(e){return Jn(nc(tc(e)))}function Rc(e){return Yn(P(e))}let zc=`\\p{Lu}`,Bc=`\\p{Ll}`,Vc=`(?:[\\p{Lm}\\p{Lo}]\\p{M}*)`,Hc=`(?:['’](?:d|ll|m|re|s|t|ve))?`,Uc=`(?:['’](?:D|LL|M|RE|S|T|VE))?`,Wc=`[\\p{Z}\\p{P}\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\xd7\\xf7]`,Gc=`(?:${zc}|${Vc})`,Kc=`(?:${Bc}|${Vc})`,qc=RegExp([`${zc}?${Bc}+${Hc}(?=${Wc}|${zc}|$)`,`${Gc}+${Uc}(?=${Wc}|${zc}${Kc}|$)`,`${zc}?${Kc}+${Hc}`,`${zc}+${Uc}`,`\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])`,`\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])`,`\\d+`,`\\p{Emoji_Presentation}`,`\\p{Extended_Pictographic}`].join(`|`),`gu`);function Jc(e,t=qc,n){let r=P(e);return n&&(t=qc),typeof t==`number`&&(t=t.toString()),Array.from(r.match(t)??[]).filter(e=>e!==``)}function Yc(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[V(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 Xc(e){return()=>e}function Zc(e,t){return e==null||Number.isNaN(e)?t:e}function Qc(e,t){return typeof e==`string`&&typeof t==`string`?e>t:K(e)>K(t)}function $c(e,t){return typeof e==`string`&&typeof t==`string`?e>=t:K(e)>=K(t)}function el(e,t,...n){if(n=n.flat(1),e!=null)switch(typeof t){case`string`:return typeof e==`object`&&Object.hasOwn(e,t)?tl(e,[t],n):tl(e,F(t),n);case`number`:case`symbol`:return tl(e,[t],n);default:return Array.isArray(t)?tl(e,t,n):tl(e,[t],n)}}function tl(e,t,n){let r=I(e,t.slice(0,-1),e);if(r==null)return;let i=W(t),a=i?.valueOf();return i=typeof a==`number`?N(a):String(i),I(r,i)?.apply(r,n)}function nl(e,t){return typeof e==`string`&&typeof t==`string`?e<t:K(e)<K(t)}function rl(e,t){return typeof e==`string`&&typeof t==`string`?e<=t:K(e)<=K(t)}function il(e,...t){return function(n){return el(n,e,t)}}function al(e,...t){return function(n){return el(e,n,t)}}function ol(){return Date.now()}function sl(...e){e.length===1&&Array.isArray(e[0])&&(e=e[0]);let t=e.map(e=>V(e));return function(...e){return t.map(t=>t.apply(this,e))}}function cl(...e){return function(...t){for(let n=0;n<e.length;++n){let r=e[n];if(!Array.isArray(r)){if(!V(r).apply(this,t))return!1;continue}for(let e=0;e<r.length;++e)if(!V(r[e]).apply(this,t))return!1}return!0}}function ll(...e){return function(...t){for(let n=0;n<e.length;++n){let r=e[n];if(!Array.isArray(r)){if(V(r).apply(this,t))return!0;continue}for(let e=0;e<r.length;++e)if(V(r[e]).apply(this,t))return!0}return!1}}function ul(){return[]}function dl(){return!1}function fl(){return{}}function pl(){return``}function ml(){return!0}function hl(e){return e==null?0:Ai(J(e),0,4294967295)}function gl(e){let t={},n=$(e);for(let r=0;r<n.length;r++){let i=n[r],a=e[i];i===`__proto__`?Object.defineProperty(t,i,{configurable:!0,enumerable:!0,value:a,writable:!0}):t[i]=a}return t}function _l(e){return e==null?0:Ai(J(e),-pc,pc)}let vl=0;function yl(e=``){return`${e}${++vl}`}e.AbortError=Le,e.Mutex=On,e.Semaphore=m,e.TimeoutError=Re,e.add=Xa,e.after=va,e.allKeyed=Dn,e.ary=ya,e.assert=Zn,e.invariant=Zn,e.assign=So,e.assignIn=Do,e.extend=Do,e.assignInWith=ko,e.extendWith=ko,e.assignWith=jo,e.asyncNoop=Ve,e.at=bi,e.attempt=ba,e.attemptAsync=Xn,e.before=xa,e.bind=Sa,e.bindAll=ec,e.bindKey=Ca,e.camelCase=rc,e.capitalize=$s,e.cartesianProduct=t,e.castArray=Qn,e.ceil=Qa,e.chunk=$n,e.chunkBy=r,e.clamp=Ai,e.clone=No,e.cloneDeep=pr,e.cloneDeepWith=fr,e.cloneWith=zo,e.combinations=i,e.compact=er,e.concat=tr,e.cond=Yc,e.conforms=Rs,e.conformsTo=Ls,e.constant=Xc,e.constantCase=jn,e.countBy=vr,e.create=Bo,e.curry=wa,e.curryRight=Oa,e.debounce=Ma,e.deburr=tc,e.defaultTo=Zc,e.defaults=Vo,e.defaultsDeep=Ho,e.defer=Na,e.delay=Pa,e.difference=yr,e.differenceBy=xr,e.differenceWith=Sr,e.divide=$a,e.drop=Cr,e.dropRight=wr,e.dropRightWhile=Tr,e.dropWhile=Dr,e.each=kr,e.forEach=kr,e.eachRight=Ar,e.forEachRight=Ar,e.endsWith=ic,e.eq=O,e.escape=ac,e.escapeRegExp=oc,e.every=jr,e.fill=Nr,e.filter=Pr,e.filterAsync=ee,e.find=Fr,e.findIndex=Ir,e.findKey=qo,e.findLast=Lr,e.findLastIndex=Rr,e.findLastKey=Jo,e.first=zr,e.head=zr,e.flatMap=Ur,e.flatMapAsync=ne,e.flatMapDeep=Gr,e.flatMapDepth=Wr,e.flatten=Br,e.flattenDeep=Kr,e.flattenDepth=Vr,e.flattenObject=Bt,e.flip=Fa,e.floor=eo,e.flow=Ia,e.flowRight=La,e.forEachAsync=re,e.forIn=Yo,e.forInRight=Xo,e.forOwn=Zo,e.forOwnRight=Qo,e.fromPairs=$o,e.functions=es,e.functionsIn=ts,e.get=I,e.groupBy=qr,e.gt=Qc,e.gte=$c,e.has=_r,e.hasIn=ns,e.identity=X,e.inRange=to,e.includes=Jr,e.indexOf=Yr,e.initial=Xr,e.intersection=Zr,e.intersectionBy=Qr,e.intersectionWith=ei,e.invert=rs,e.invertBy=is,e.invoke=el,e.invokeMap=ni,e.isArguments=gr,e.isArray=T,e.isArrayBuffer=zs,e.isArrayLike=M,e.isArrayLikeObject=U,e.isBlob=en,e.isBoolean=Bs,e.isBrowser=tn,e.isBuffer=Es,e.isDate=Vs,e.isElement=Hs,e.isEmpty=Us,e.isEmptyObject=rn,e.isEqual=cn,e.isEqualWith=Ws,e.isError=Gs,e.isFile=ln,e.isFinite=Ks,e.isFunction=As,e.isInteger=qs,e.isIterable=un,e.isJSON=dn,e.isJSONArray=pn,e.isJSONObject=mn,e.isJSONValue=fn,e.isLength=js,e.isMap=ji,e.isMatch=dr,e.isMatchWith=ar,e.isNaN=Hi,e.isNative=Ps,e.isNil=Fi,e.isNode=_n,e.isNotNil=vn,e.isNull=Fs,e.isNumber=Vi,e.isObject=R,e.isObjectLike=H,e.isPlainObject=D,e.isPrimitive=_,e.isPromise=bn,e.isRegExp=Js,e.isSafeInteger=Ys,e.isSet=Xs,e.isString=Mr,e.isSubset=ue,e.isSubsetWith=de,e.isSymbol=G,e.isTypedArray=Z,e.isUndefined=Is,e.isWeakMap=Zs,e.isWeakSet=Qs,e.iteratee=V,e.join=ri,e.kebabCase=sc,e.keyBy=ai,e.keys=Q,e.keysIn=$,e.last=W,e.lastIndexOf=oi,e.limitAsync=h,e.lowerCase=cc,e.lowerFirst=lc,e.lt=nl,e.lte=rl,e.map=Hr,e.mapAsync=pe,e.mapKeys=as,e.mapValues=os,e.matches=z,e.matchesProperty=B,e.max=no,e.maxBy=ro,e.mean=oo,e.meanBy=so,e.median=st,e.medianBy=ct,e.memoize=Ra,e.merge=ls,e.mergeWith=ss,e.method=il,e.methodOf=al,e.min=co,e.minBy=lo,e.multiply=uo,e.negate=Ti,e.noop=vo,e.now=ol,e.nth=si,e.nthArg=za,e.omit=ds,e.omitBy=hs,e.once=Ba,e.orderBy=pi,e.over=sl,e.overArgs=Va,e.overEvery=cl,e.overSome=ll,e.pad=uc,e.padEnd=dc,e.padStart=fc,e.parseInt=fo,e.partial=Ha,e.partialRight=Ua,e.partition=mi,e.pascalCase=Vn,e.percentile=lt,e.pick=gs,e.pickBy=_s,e.property=L,e.propertyOf=vs,e.pull=hi,e.pullAll=gi,e.pullAllBy=_i,e.pullAllWith=yi,e.pullAt=Ci,e.random=po,e.randomInt=xe,e.range=mo,e.rangeRight=ho,e.rearg=Wa,e.reduce=ii,e.reduceAsync=_e,e.reduceRight=wi,e.reject=Ei,e.remove=Di,e.repeat=mc,e.replace=hc,e.rest=Ga,e.result=ys,e.retry=rt,e.reverse=Oi,e.reverseString=Hn,e.round=go,e.sample=ki,e.sampleSize=Ni,e.set=ha,e.setWith=bs,e.shuffle=Ii,e.size=Li,e.slice=Ri,e.snakeCase=gc,e.some=zi,e.sortBy=Bi,e.sortKeys=Gt,e.sortedIndex=Wi,e.sortedIndexBy=Ui,e.sortedIndexOf=Gi,e.sortedLastIndex=qi,e.sortedLastIndexBy=Ki,e.sortedLastIndexOf=Ji,e.split=_c,e.spread=Ka,e.startCase=vc,e.startsWith=yc,e.stubArray=ul,e.stubFalse=dl,e.stubObject=fl,e.stubString=pl,e.stubTrue=ml,e.subtract=_o,e.sum=ao,e.sumBy=io,e.tail=Yi,e.take=Xi,e.takeRight=Zi,e.takeRightWhile=Qi,e.takeWhile=$i,e.template=Dc,e.templateSettings=Ec,e.throttle=qa,e.timeout=kn,e.times=bo,e.toArray=Mi,e.toCamelCaseKeys=Yt,e.toDefaulted=xs,e.toFilled=De,e.toFinite=q,e.toInteger=J,e.toLength=hl,e.toLower=Oc,e.toMerged=Xt,e.toNumber=K,e.toPairs=ws,e.toPairsIn=Ts,e.toPath=F,e.toPlainObject=gl,e.toSafeInteger=_l,e.toSnakeCaseKeys=Qt,e.toString=P,e.toUpper=kc,e.transform=Ds,e.trim=Ac,e.trimEnd=jc,e.trimStart=Mc,e.truncate=Pc,e.unary=Ja,e.unescape=Ic,e.union=ea,e.unionBy=ta,e.unionWith=na,e.uniq=$r,e.uniqBy=ra,e.uniqWith=ia,e.uniqueId=yl,e.unset=xi,e.unzip=aa,e.unzipWith=oa,e.update=Os,e.updateWith=ma,e.upperCase=Lc,e.upperFirst=Rc,e.values=Pi,e.valuesIn=ks,e.windowed=Me,e.withTimeout=An,e.without=sa,e.words=Jc,e.wrap=Ya,e.xor=ca,e.xorBy=la,e.xorWith=ua,e.zip=da,e.zipObject=pa,e.zipObjectDeep=ga,e.zipWith=_a});
8
+ }`,f=ya(()=>Function(...c,`${u}return ${d}`)(...l));if(f.source=d,f instanceof Error)throw f;return f}function Dc(e){return P(e).toLowerCase()}function Oc(e){return P(e).toUpperCase()}function kc(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)?Wn(e,t.flatMap(e=>e.toString().split(``))):Wn(e,t.toString().split(``));default:return Wn(e,t.toString().split(``))}}function Ac(e,t,n){return e==null?``:n!=null||t==null?e.toString().trimEnd():Hn(e,t.toString().split(``))}function jc(e,t,n){return e==null?``:n!=null||t==null?e.toString().trimStart():Un(e,t.toString().split(``))}let Mc=/[\u200d\ud800-\udfff\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff\ufe0e\ufe0f]/;function Nc(e,t){e=e==null?``:`${e}`;let n=30,r=`...`;R(t)&&(n=Pc(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(Mc.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 Pc(e){return e==null?30:e<=0?0:e}function Fc(e){return Kn(P(e))}function Ic(e){return qn(tc(ec(e)))}function Lc(e){return Jn(P(e))}let Rc=`\\p{Lu}`,zc=`\\p{Ll}`,Bc=`(?:[\\p{Lm}\\p{Lo}]\\p{M}*)`,Vc=`(?:['’](?:d|ll|m|re|s|t|ve))?`,Hc=`(?:['’](?:D|LL|M|RE|S|T|VE))?`,Uc=`[\\p{Z}\\p{P}\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\xd7\\xf7]`,Wc=`(?:${Rc}|${Bc})`,Gc=`(?:${zc}|${Bc})`,Kc=RegExp([`${Rc}?${zc}+${Vc}(?=${Uc}|${Rc}|$)`,`${Wc}+${Hc}(?=${Uc}|${Rc}${Gc}|$)`,`${Rc}?${Gc}+${Vc}`,`${Rc}+${Hc}`,`\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])`,`\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])`,`\\d+`,`\\p{Emoji_Presentation}`,`\\p{Extended_Pictographic}`].join(`|`),`gu`);function qc(e,t=Kc,n){let r=P(e);return n&&(t=Kc),typeof t==`number`&&(t=t.toString()),Array.from(r.match(t)??[]).filter(e=>e!==``)}function Jc(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[V(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 Yc(e){return()=>e}function Xc(e,t){return e==null||Number.isNaN(e)?t:e}function Zc(e,t){return typeof e==`string`&&typeof t==`string`?e>t:K(e)>K(t)}function Qc(e,t){return typeof e==`string`&&typeof t==`string`?e>=t:K(e)>=K(t)}function $c(e,t,...n){if(n=n.flat(1),e!=null)switch(typeof t){case`string`:return typeof e==`object`&&Object.hasOwn(e,t)?el(e,[t],n):el(e,F(t),n);case`number`:case`symbol`:return el(e,[t],n);default:return Array.isArray(t)?el(e,t,n):el(e,[t],n)}}function el(e,t,n){let r=I(e,t.slice(0,-1),e);if(r==null)return;let i=W(t),a=i?.valueOf();return i=typeof a==`number`?N(a):String(i),I(r,i)?.apply(r,n)}function tl(e,t){return typeof e==`string`&&typeof t==`string`?e<t:K(e)<K(t)}function nl(e,t){return typeof e==`string`&&typeof t==`string`?e<=t:K(e)<=K(t)}function rl(e,...t){return function(n){return $c(n,e,t)}}function il(e,...t){return function(n){return $c(e,n,t)}}function al(){return Date.now()}function ol(...e){e.length===1&&Array.isArray(e[0])&&(e=e[0]);let t=e.map(e=>V(e));return function(...e){return t.map(t=>t.apply(this,e))}}function sl(...e){return function(...t){for(let n=0;n<e.length;++n){let r=e[n];if(!Array.isArray(r)){if(!V(r).apply(this,t))return!1;continue}for(let e=0;e<r.length;++e)if(!V(r[e]).apply(this,t))return!1}return!0}}function cl(...e){return function(...t){for(let n=0;n<e.length;++n){let r=e[n];if(!Array.isArray(r)){if(V(r).apply(this,t))return!0;continue}for(let e=0;e<r.length;++e)if(V(r[e]).apply(this,t))return!0}return!1}}function ll(){return[]}function ul(){return!1}function dl(){return{}}function fl(){return``}function pl(){return!0}function ml(e){return e==null?0:ki(J(e),0,4294967295)}function hl(e){let t={},n=$(e);for(let r=0;r<n.length;r++){let i=n[r],a=e[i];i===`__proto__`?Object.defineProperty(t,i,{configurable:!0,enumerable:!0,value:a,writable:!0}):t[i]=a}return t}function gl(e){return e==null?0:ki(J(e),-fc,fc)}let _l=0;function vl(e=``){return`${e}${++_l}`}e.AbortError=Le,e.Mutex=Dn,e.Semaphore=m,e.TimeoutError=Re,e.add=Ya,e.after=_a,e.allKeyed=En,e.ary=va,e.assert=Xn,e.invariant=Xn,e.assign=xo,e.assignIn=Eo,e.extend=Eo,e.assignInWith=Oo,e.extendWith=Oo,e.assignWith=Ao,e.asyncNoop=Ve,e.at=yi,e.attempt=ya,e.attemptAsync=Yn,e.before=ba,e.bind=xa,e.bindAll=$s,e.bindKey=Sa,e.camelCase=nc,e.capitalize=Qs,e.cartesianProduct=t,e.castArray=Zn,e.ceil=Za,e.chunk=Qn,e.chunkBy=r,e.clamp=ki,e.clone=Mo,e.cloneDeep=fr,e.cloneDeepWith=dr,e.cloneWith=Ro,e.combinations=i,e.compact=$n,e.concat=er,e.cond=Jc,e.conforms=Ls,e.conformsTo=Is,e.constant=Yc,e.constantCase=An,e.countBy=_r,e.create=zo,e.curry=Ca,e.curryRight=Da,e.debounce=ja,e.deburr=ec,e.defaultTo=Xc,e.defaults=Bo,e.defaultsDeep=Vo,e.defer=Ma,e.delay=Na,e.difference=vr,e.differenceBy=br,e.differenceWith=xr,e.divide=Qa,e.drop=Sr,e.dropRight=Cr,e.dropRightWhile=wr,e.dropWhile=Er,e.each=Or,e.forEach=Or,e.eachRight=kr,e.forEachRight=kr,e.endsWith=rc,e.eq=O,e.escape=ic,e.escapeRegExp=ac,e.every=Ar,e.fill=Mr,e.filter=Nr,e.filterAsync=ee,e.find=Pr,e.findIndex=Fr,e.findKey=Ko,e.findLast=Ir,e.findLastIndex=Lr,e.findLastKey=qo,e.first=Rr,e.head=Rr,e.flatMap=Hr,e.flatMapAsync=ne,e.flatMapDeep=Wr,e.flatMapDepth=Ur,e.flatten=zr,e.flattenDeep=Gr,e.flattenDepth=Br,e.flattenObject=zt,e.flip=Pa,e.floor=$a,e.flow=Fa,e.flowRight=Ia,e.forEachAsync=re,e.forIn=Jo,e.forInRight=Yo,e.forOwn=Xo,e.forOwnRight=Zo,e.fromPairs=Qo,e.functions=$o,e.functionsIn=es,e.get=I,e.groupBy=Kr,e.gt=Zc,e.gte=Qc,e.has=gr,e.hasIn=ts,e.identity=X,e.inRange=eo,e.includes=qr,e.indexOf=Jr,e.initial=Yr,e.intersection=Xr,e.intersectionBy=Zr,e.intersectionWith=$r,e.invert=ns,e.invertBy=rs,e.invoke=$c,e.invokeMap=ti,e.isArguments=hr,e.isArray=T,e.isArrayBuffer=Rs,e.isArrayLike=M,e.isArrayLikeObject=U,e.isBlob=$t,e.isBoolean=zs,e.isBrowser=en,e.isBuffer=Ts,e.isDate=Bs,e.isElement=Vs,e.isEmpty=Hs,e.isEmptyObject=nn,e.isEqual=sn,e.isEqualWith=Us,e.isError=Ws,e.isFile=cn,e.isFinite=Gs,e.isFunction=ks,e.isInteger=Ks,e.isIterable=ln,e.isJSON=un,e.isJSONArray=fn,e.isJSONObject=pn,e.isJSONValue=dn,e.isLength=As,e.isMap=Ai,e.isMatch=ur,e.isMatchWith=ir,e.isNaN=Vi,e.isNative=Ns,e.isNil=Pi,e.isNode=gn,e.isNotNil=_n,e.isNull=Ps,e.isNumber=Bi,e.isObject=R,e.isObjectLike=H,e.isPlainObject=D,e.isPrimitive=_,e.isPromise=yn,e.isRegExp=qs,e.isSafeInteger=Js,e.isSet=Ys,e.isString=jr,e.isSubset=ue,e.isSubsetWith=de,e.isSymbol=G,e.isTypedArray=Z,e.isUndefined=Fs,e.isWeakMap=Xs,e.isWeakSet=Zs,e.iteratee=V,e.join=ni,e.kebabCase=oc,e.keyBy=ii,e.keys=Q,e.keysIn=$,e.last=W,e.lastIndexOf=ai,e.limitAsync=h,e.lowerCase=sc,e.lowerFirst=cc,e.lt=tl,e.lte=nl,e.map=Vr,e.mapAsync=pe,e.mapKeys=is,e.mapValues=as,e.matches=z,e.matchesProperty=B,e.max=to,e.maxBy=no,e.mean=ao,e.meanBy=oo,e.median=ot,e.medianBy=st,e.memoize=La,e.merge=cs,e.mergeWith=os,e.method=rl,e.methodOf=il,e.min=so,e.minBy=co,e.multiply=lo,e.negate=wi,e.noop=_o,e.now=al,e.nth=oi,e.nthArg=Ra,e.omit=us,e.omitBy=ms,e.once=za,e.orderBy=fi,e.over=ol,e.overArgs=Ba,e.overEvery=sl,e.overSome=cl,e.pad=lc,e.padEnd=uc,e.padStart=dc,e.parseInt=uo,e.partial=Va,e.partialRight=Ha,e.partition=pi,e.pascalCase=Bn,e.percentile=ct,e.pick=hs,e.pickBy=gs,e.property=L,e.propertyOf=_s,e.pull=mi,e.pullAll=hi,e.pullAllBy=gi,e.pullAllWith=vi,e.pullAt=Si,e.random=fo,e.randomInt=xe,e.range=po,e.rangeRight=mo,e.rearg=Ua,e.reduce=ri,e.reduceAsync=_e,e.reduceRight=Ci,e.reject=Ti,e.remove=Ei,e.repeat=pc,e.replace=mc,e.rest=Wa,e.result=vs,e.retry=rt,e.reverse=Di,e.reverseString=Vn,e.round=ho,e.sample=Oi,e.sampleSize=Mi,e.set=ma,e.setWith=ys,e.shuffle=Fi,e.size=Ii,e.slice=Li,e.snakeCase=hc,e.some=Ri,e.sortBy=zi,e.sortKeys=Wt,e.sortedIndex=Ui,e.sortedIndexBy=Hi,e.sortedIndexOf=Wi,e.sortedLastIndex=Ki,e.sortedLastIndexBy=Gi,e.sortedLastIndexOf=qi,e.split=gc,e.spread=Ga,e.startCase=_c,e.startsWith=vc,e.stubArray=ll,e.stubFalse=ul,e.stubObject=dl,e.stubString=fl,e.stubTrue=pl,e.subtract=go,e.sum=io,e.sumBy=ro,e.tail=Ji,e.take=Yi,e.takeRight=Xi,e.takeRightWhile=Zi,e.takeWhile=Qi,e.template=Ec,e.templateSettings=Tc,e.throttle=Ka,e.timeout=On,e.times=yo,e.toArray=ji,e.toCamelCaseKeys=Jt,e.toDefaulted=bs,e.toFilled=De,e.toFinite=q,e.toInteger=J,e.toLength=ml,e.toLower=Dc,e.toMerged=Yt,e.toNumber=K,e.toPairs=Cs,e.toPairsIn=ws,e.toPath=F,e.toPlainObject=hl,e.toSafeInteger=gl,e.toSnakeCaseKeys=Zt,e.toString=P,e.toUpper=Oc,e.transform=Es,e.trim=kc,e.trimEnd=Ac,e.trimStart=jc,e.truncate=Nc,e.unary=qa,e.unescape=Fc,e.union=$i,e.unionBy=ea,e.unionWith=ta,e.uniq=Qr,e.uniqBy=na,e.uniqWith=ra,e.uniqueId=vl,e.unset=bi,e.unzip=ia,e.unzipWith=aa,e.update=Ds,e.updateWith=pa,e.upperCase=Ic,e.upperFirst=Lc,e.values=Ni,e.valuesIn=Os,e.windowed=Me,e.withTimeout=kn,e.without=oa,e.words=qc,e.wrap=Ja,e.xor=sa,e.xorBy=ca,e.xorWith=la,e.zip=ua,e.zipObject=fa,e.zipObjectDeep=ha,e.zipWith=ga});
@@ -2,16 +2,19 @@
2
2
  /**
3
3
  * Checks if the value is within a specified range.
4
4
  *
5
+ * If only `minimum` is provided, it is treated as the exclusive upper bound and the range starts at `0`.
6
+ * When the resolved bounds are out of order they are swapped, so the lower one is always inclusive
7
+ * and the higher one exclusive.
8
+ *
5
9
  * @param value The value to check.
6
10
  * @param minimum The lower bound of the range (inclusive).
7
11
  * @param maximum The upper bound of the range (exclusive).
8
12
  * @returns `true` if the value is within the specified range, otherwise `false`.
9
- * @throws {Error} Throws an error if the `minimum` is greater or equal than the `maximum`.
10
13
  *
11
14
  * @example
12
15
  * const result1 = inRange(3, 5); // result1 will be true.
13
16
  * const result2 = inRange(1, 2, 5); // result2 will be false.
14
- * const result3 = inRange(1, 5, 2); // If the minimum is greater or equal than the maximum, an error is thrown.
17
+ * const result3 = inRange(-2, -4); // result3 will be true, the range is [-4, 0).
15
18
  */
16
19
  declare function inRange(value: number, minimum: number, maximum?: number): boolean;
17
20
  //#endregion
@@ -2,16 +2,19 @@
2
2
  /**
3
3
  * Checks if the value is within a specified range.
4
4
  *
5
+ * If only `minimum` is provided, it is treated as the exclusive upper bound and the range starts at `0`.
6
+ * When the resolved bounds are out of order they are swapped, so the lower one is always inclusive
7
+ * and the higher one exclusive.
8
+ *
5
9
  * @param value The value to check.
6
10
  * @param minimum The lower bound of the range (inclusive).
7
11
  * @param maximum The upper bound of the range (exclusive).
8
12
  * @returns `true` if the value is within the specified range, otherwise `false`.
9
- * @throws {Error} Throws an error if the `minimum` is greater or equal than the `maximum`.
10
13
  *
11
14
  * @example
12
15
  * const result1 = inRange(3, 5); // result1 will be true.
13
16
  * const result2 = inRange(1, 2, 5); // result2 will be false.
14
- * const result3 = inRange(1, 5, 2); // If the minimum is greater or equal than the maximum, an error is thrown.
17
+ * const result3 = inRange(-2, -4); // result3 will be true, the range is [-4, 0).
15
18
  */
16
19
  declare function inRange(value: number, minimum: number, maximum?: number): boolean;
17
20
  //#endregion
@@ -1,28 +1,31 @@
1
- const require_inRange = require("../../math/inRange.js");
1
+ const require_toNumber = require("../util/toNumber.js");
2
+ const require_toFinite = require("../util/toFinite.js");
2
3
  //#region src/compat/math/inRange.ts
3
4
  /**
4
5
  * Checks if the value is within a specified range.
5
6
  *
7
+ * If only `minimum` is provided, it is treated as the exclusive upper bound and the range starts at `0`.
8
+ * When the resolved bounds are out of order they are swapped, so the lower one is always inclusive
9
+ * and the higher one exclusive.
10
+ *
6
11
  * @param value The value to check.
7
12
  * @param minimum The lower bound of the range (inclusive).
8
13
  * @param maximum The upper bound of the range (exclusive).
9
14
  * @returns `true` if the value is within the specified range, otherwise `false`.
10
- * @throws {Error} Throws an error if the `minimum` is greater or equal than the `maximum`.
11
15
  *
12
16
  * @example
13
17
  * const result1 = inRange(3, 5); // result1 will be true.
14
18
  * const result2 = inRange(1, 2, 5); // result2 will be false.
15
- * const result3 = inRange(1, 5, 2); // If the minimum is greater or equal than the maximum, an error is thrown.
19
+ * const result3 = inRange(-2, -4); // result3 will be true, the range is [-4, 0).
16
20
  */
17
21
  function inRange(value, minimum, maximum) {
18
- if (!minimum) minimum = 0;
19
- if (maximum != null && !maximum) maximum = 0;
20
- if (minimum != null && typeof minimum !== "number") minimum = Number(minimum);
21
- if (maximum == null && minimum === 0) return false;
22
- if (maximum != null && typeof maximum !== "number") maximum = Number(maximum);
23
- if (maximum != null && minimum > maximum) [minimum, maximum] = [maximum, minimum];
24
- if (minimum === maximum) return false;
25
- return require_inRange.inRange(value, minimum, maximum);
22
+ minimum = require_toFinite.toFinite(minimum);
23
+ if (maximum === void 0) {
24
+ maximum = minimum;
25
+ minimum = 0;
26
+ } else maximum = require_toFinite.toFinite(maximum);
27
+ value = require_toNumber.toNumber(value);
28
+ return value >= Math.min(minimum, maximum) && value < Math.max(minimum, maximum);
26
29
  }
27
30
  //#endregion
28
31
  exports.inRange = inRange;
@@ -1,28 +1,31 @@
1
- import { inRange as inRange$1 } from "../../math/inRange.mjs";
1
+ import { toNumber } from "../util/toNumber.mjs";
2
+ import { toFinite } from "../util/toFinite.mjs";
2
3
  //#region src/compat/math/inRange.ts
3
4
  /**
4
5
  * Checks if the value is within a specified range.
5
6
  *
7
+ * If only `minimum` is provided, it is treated as the exclusive upper bound and the range starts at `0`.
8
+ * When the resolved bounds are out of order they are swapped, so the lower one is always inclusive
9
+ * and the higher one exclusive.
10
+ *
6
11
  * @param value The value to check.
7
12
  * @param minimum The lower bound of the range (inclusive).
8
13
  * @param maximum The upper bound of the range (exclusive).
9
14
  * @returns `true` if the value is within the specified range, otherwise `false`.
10
- * @throws {Error} Throws an error if the `minimum` is greater or equal than the `maximum`.
11
15
  *
12
16
  * @example
13
17
  * const result1 = inRange(3, 5); // result1 will be true.
14
18
  * const result2 = inRange(1, 2, 5); // result2 will be false.
15
- * const result3 = inRange(1, 5, 2); // If the minimum is greater or equal than the maximum, an error is thrown.
19
+ * const result3 = inRange(-2, -4); // result3 will be true, the range is [-4, 0).
16
20
  */
17
21
  function inRange(value, minimum, maximum) {
18
- if (!minimum) minimum = 0;
19
- if (maximum != null && !maximum) maximum = 0;
20
- if (minimum != null && typeof minimum !== "number") minimum = Number(minimum);
21
- if (maximum == null && minimum === 0) return false;
22
- if (maximum != null && typeof maximum !== "number") maximum = Number(maximum);
23
- if (maximum != null && minimum > maximum) [minimum, maximum] = [maximum, minimum];
24
- if (minimum === maximum) return false;
25
- return inRange$1(value, minimum, maximum);
22
+ minimum = toFinite(minimum);
23
+ if (maximum === void 0) {
24
+ maximum = minimum;
25
+ minimum = 0;
26
+ } else maximum = toFinite(maximum);
27
+ value = toNumber(value);
28
+ return value >= Math.min(minimum, maximum) && value < Math.max(minimum, maximum);
26
29
  }
27
30
  //#endregion
28
31
  export { inRange };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "es-toolkit",
3
- "version": "1.49.0-dev.1919+a35816e7",
3
+ "version": "1.49.0-dev.1922+ac210c86",
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",