varL={hasSubscribers:!1},S=L,A=L;import("node:diagnostics_channel").then(c=>{S=c.channel("lru-cache:metrics"),A=c.tracingChannel("lru-cache")}).catch(()=>{});varM=typeofperformance=="object"&&performance&&typeofperformance.now=="function"?performance:Date;varD=()=>S.hasSubscribers||A.hasSubscribers,j=newSet,I=typeofprocess=="object"&&process?process:{},P=(c,e,t,i)=>{typeofI.emitWarning=="function"?I.emitWarning(c,e,t,i):console.error(`[${t}] ${e}: ${c}`)},k=c=>!j.has(c);varT=c=>!!c&&c===Math.floor(c)&&c>0&&isFinite(c),G=c=>T(c)?c<=Math.pow(2,8)?Uint8Array:c<=Math.pow(2,16)?Uint16Array:c<=Math.pow(2,32)?Uint32Array:c<=Number.MAX_SAFE_INTEGER?O:null:null,O=classextendsArray{constructor(e){super(e),this.fill(0)}},R=classc{heap;length;static#o=!1;staticcreate(e){lett=G(e);if(!t)return[];c.#o=!0;leti=newc(e,t);returnc.#o=!1,i}constructor(e,t){if(!c.#o)thrownewTypeError("instantiate Stack using Stack.create(n)");this.heap=newt(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){returnthis.heap[--this.length]}},U=classc{#o;#c;#S;#O;#w;#M;#I;#m;getperf(){returnthis.#m}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;backgroundFetchSize;#n;#b;#s;#i;#t;#l;#u;#a;#h;#y;#r;#_;#F;#d;#g;#T;#U;#f;#x;staticunsafeExposeInternals(e){return{starts:e.#F,ttls:e.#d,autopurgeTimers:e.#g,sizes:e.#_,keyMap:e.#s,keyList:e.#i,valList:e.#t,next:e.#l,prev:e.#u,gethead(){returne.#a},gettail(){returne.#h},free:e.#y,isBackgroundFetch:t=>e.#e(t),backgroundFetch:(t,i,s,n)=>e.#P(t,i,s,n),moveToTail:t=>e.#L(t),indexes:t=>e.#A(t),rindexes:t=>e.#z(t),isStale:t=>e.#p(t)}}getmax(){returnthis.#o}getmaxSize(){returnthis.#c}getcalculatedSize(){returnthis.#b}getsize(){returnthis.#n}getfetchMethod(){returnthis.#M}getmemoMethod(){returnthis.#I}getdispose(){returnthis.#S}getonInsert(){returnthis.#O}getdisposeAfter(){returnthis.#w}constructor(e){let{max:t=0,ttl:i,ttlResolution:s=1,ttlAutopurge:n,updateAgeOnGet:r,updateAgeOnHas:h,allowStale:a,dispose:o,onInsert:d,disposeAfter:y,noDisposeOnSet:_,noUpdateTTL:u,maxSize:g=0,maxEntrySize:f=0,sizeCalculation:b,fetchMethod:l,memoMethod:w,noDeleteOnFetchRejection:F,noDeleteOnStaleGet:m,allowStaleOnFetchRejection:p,allowStaleOnFetchAbort:z,ignoreFetchAbort:E,backgroundFetchSize:C=1,perf:v}=e;if(this.backgroundFetchSize=C,v!==void0&&typeofv?.now!="function")thrownewTypeError("perf option must have a now() method if specified");if(this.#m=v??M,t!==0&&!T(t))thrownewTypeError("max option must be a nonnegative integer");letW=t?G(t):Array;if(!W)thrownewError("invalid max value: "+t);if(this.#o=t,this.#c=g,this.maxEntrySize=f||this.#c,this.sizeCalculation=b,this.sizeCalculation){if(!this.#c&&!this.maxEntrySize)thrownewTypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeofthis.sizeCalculation!="function")thrownewTypeError("sizeCalculation set to non-function")}if(w!==void0&&typeofw!="function")thrownewTypeError("memoMethod must be a function if defined");if(this.#I=w,l!==void0&&typeofl!="function")thrownewTypeError("fetchMethod must be a function if specified");if(this.#M=l,this.#U=!!l,this.#s=newMap,this.#i=Array.from({length:t}).fill(void0),this.#t=Array.from({length:t}).fill(void0),this.#l=newW(t),this.#u=newW(t),this.#a=0,this.#h=0,this.#y=R.create(t),this.#n=0,this.#b=0,typeofo=="function"&&(this.#S=o),typeofd=="function"&&(this.#O=d),typeofy=="function"?(this.#w=y,this.#r=[]):(this.#w=void0,this.#r=void0),this.#T=!!this.#S,this.#x=!!this.#O,this.#f=!!this.#w,this.noDisposeOnSet=!!_,this.noUpdateTTL=!!u,this.noDeleteOnFetchRejection=!!F,this.allowStaleOnFetchRejection=!!p,this.allowStaleOnFetchAbort=!!z,this.ignoreFetchAbort=!!E,this.maxEntrySize!==0){if(this.#c!==0&&!T(this.#c))thrownewTypeError("maxSize must be a positive integer if specified");if(!T(this.maxEntrySize))thrownewTypeError("maxEntrySizemustbeapositivei