sliccy 1.15.0 → 1.15.2

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 +1 @@
1
- import{_ as e}from"./__vite-browser-external-D7Ct-6yo.js";import{g as r}from"./index-BibHrLnR.js";const a=r(e);export{a as r};
1
+ import{_ as e}from"./__vite-browser-external-D7Ct-6yo.js";import{g as r}from"./index-Cym9vzvm.js";const a=r(e);export{a as r};
@@ -1,2 +1,2 @@
1
- import{c as u}from"./index-BibHrLnR.js";const l=["/workspace","/shared"];async function d(s){const t=[],e=new Set;for(const r of l)await s.exists(r)&&await p(s,r,t,e);return t}async function p(s,t,e,r){for await(const n of s.walk(t)){if(!n.endsWith(".bsh")||r.has(n))continue;r.add(n);const i=g(n);if(!i)continue;const a=await s.readFile(n,{encoding:"utf-8"}),c=typeof a=="string"?a:new TextDecoder().decode(a),f=m(c);e.push({path:n,hostnamePattern:i,matchPatterns:f})}}function g(s){const t=s.split("/").pop()??"";if(!t.endsWith(".bsh"))return null;const e=t.slice(0,-4);return e?e.startsWith("-.")?"*"+e.slice(1):e:null}function m(s){const t=s.split(`
1
+ import{c as u}from"./index-Cym9vzvm.js";const l=["/workspace","/shared"];async function d(s){const t=[],e=new Set;for(const r of l)await s.exists(r)&&await p(s,r,t,e);return t}async function p(s,t,e,r){for await(const n of s.walk(t)){if(!n.endsWith(".bsh")||r.has(n))continue;r.add(n);const i=g(n);if(!i)continue;const a=await s.readFile(n,{encoding:"utf-8"}),c=typeof a=="string"?a:new TextDecoder().decode(a),f=m(c);e.push({path:n,hostnamePattern:i,matchPatterns:f})}}function g(s){const t=s.split("/").pop()??"";if(!t.endsWith(".bsh"))return null;const e=t.slice(0,-4);return e?e.startsWith("-.")?"*"+e.slice(1):e:null}function m(s){const t=s.split(`
2
2
  `).slice(0,10),e=[];for(const r of t){const n=r.match(/^\s*\/\/\s*@match\s+(.+)$/);n&&e.push(n[1].trim())}return e}function h(s,t){if(t.startsWith("*.")){const e=t.slice(1);return s.endsWith(e)&&s.length>e.length}return s===t}function v(s,t){try{const e=new URL(s),r=t.match(/^(\*|https?):\/\/([^/]+)(\/.*)?$/);if(!r)return!1;const[,n,i,a]=r;return n!=="*"&&e.protocol.slice(0,-1)!==n||!h(e.hostname,i)?!1:a?x(e.pathname+e.search,a):!0}catch{return!1}}function x(s,t){const e="^"+t.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*")+"$";return new RegExp(e).test(s)}function w(s,t){try{const e=new URL(t);return s.filter(r=>h(e.hostname,r.hostnamePattern)?r.matchPatterns.length>0?r.matchPatterns.some(n=>v(t,n)):!0:!1)}catch{return[]}}const o=u("bsh-watchdog");class S{transport;fs;execute;discoveryIntervalMs;entries=[];discoveryTimer=null;running=!1;executing=new Set;constructor(t){this.transport=t.transport,this.fs=t.fs,this.execute=t.execute,this.discoveryIntervalMs=t.discoveryIntervalMs??3e4}async start(){this.running||(this.running=!0,await this.discover(),this.discoveryTimer=setInterval(()=>{this.discover()},this.discoveryIntervalMs),this.transport.on("Page.frameNavigated",this.onFrameNavigated),o.info("BSH watchdog started",{scriptCount:this.entries.length}))}stop(){this.running&&(this.running=!1,this.transport.off("Page.frameNavigated",this.onFrameNavigated),this.discoveryTimer&&(clearInterval(this.discoveryTimer),this.discoveryTimer=null),this.entries=[],this.executing.clear(),o.info("BSH watchdog stopped"))}async discover(){try{this.entries=await d(this.fs),o.debug("BSH discovery complete",{count:this.entries.length})}catch(t){o.error("BSH discovery failed",{error:t instanceof Error?t.message:String(t)})}}getEntries(){return this.entries}onFrameNavigated=t=>{const e=t.frame;if(e?.parentId||!e?.url)return;const r=e.url;if(!r.startsWith("http://")&&!r.startsWith("https://")||this.entries.length===0)return;const n=w(this.entries,r);if(n.length!==0)for(const i of n){const a=`${i.path}::${r}`;this.executing.has(a)||(this.executing.add(a),o.info("BSH watchdog executing script",{script:i.path,url:r}),this.execute(i.path).then(c=>{c.exitCode!==0?o.warn("BSH script failed",{script:i.path,url:r,exitCode:c.exitCode,stderr:c.stderr.slice(0,200)}):o.info("BSH script completed",{script:i.path,url:r})}).catch(c=>{o.error("BSH script execution error",{script:i.path,url:r,error:c instanceof Error?c.message:String(c)})}).finally(()=>{this.executing.delete(a)}))}}}export{S as BshWatchdog};
@@ -1,4 +1,4 @@
1
- import{i as F,r as g,a as A,b as L,d as T,e as _,h as C,j as D,k as P}from"./index-BibHrLnR.js";import{M as b,l as V,S as B,m as X,n as Y,o as q,p as z,q as U,W as Z,s as G,u as J,v as Q,w as N,x as ee,y as se,z as ie}from"./index-BibHrLnR.js";function I(s){return s.startsWith("/")?{valid:!1,error:`Absolute path not allowed: ${s}`}:s.split("/").some(l=>l==="..")?{valid:!1,error:`Path traversal not allowed: ${s}`}:s.includes("%2e%2e")||s.includes("%2E%2E")?{valid:!1,error:`Encoded path traversal not allowed: ${s}`}:{valid:!0}}async function x(s,i){const l=i.split("/").filter(Boolean);let o="";for(const e of l){o+="/"+e;try{await s.mkdir(o)}catch{}}}async function O(s,i,l="/workspace/skills"){const o=`${l}/${i}`;await F(s);let e;try{e=await g(s,o)}catch(d){return{success:!1,skill:i,version:"unknown",error:`Failed to read manifest: ${d instanceof Error?d.message:String(d)}`}}if(e.skill!==i)return{success:!1,skill:i,version:e.version,error:`Manifest skill name "${e.skill}" does not match directory name "${i}"`};const p=await A(s);if(p.includes(e.skill))return{success:!1,skill:e.skill,version:e.version,error:`Skill "${e.skill}" is already installed`};const u=L(e,p);if(!u.ok)return{success:!1,skill:e.skill,version:e.version,error:`Missing dependencies: ${u.missing.join(", ")}`};const t=T(e,p);if(!t.ok)return{success:!1,skill:e.skill,version:e.version,error:`Conflicting skills: ${t.conflicting.join(", ")}`};const c={},h=[];try{if(e.adds&&e.adds.length>0)for(const n of e.adds){const k=I(n);if(!k.valid)return{success:!1,skill:e.skill,version:e.version,error:k.error};const $=`${o}/add/${n}`,a=`/${n}`;try{const r=a.substring(0,a.lastIndexOf("/"));r&&await x(s,r),await s.copyFile($,a),h.push(n);const f=await s.readTextFile(a);c[n]=await _(f)}catch(r){return{success:!1,skill:e.skill,version:e.version,error:`Failed to copy ${n}: ${r instanceof Error?r.message:String(r)}`}}}if(e.modifies&&e.modifies.length>0)for(const n of e.modifies){const k=I(n);if(!k.valid)return{success:!1,skill:e.skill,version:e.version,error:k.error};const $=`${o}/modify/${n}`;try{const a=await s.readTextFile($);let r="";try{r=await s.readTextFile(`/${n}`)}catch{}let f;if(a.includes("// APPEND_AFTER:")){const w=a.split(`
1
+ import{i as F,r as g,a as A,b as L,d as T,e as _,h as C,j as D,k as P}from"./index-Cym9vzvm.js";import{M as b,l as V,S as B,m as X,n as Y,o as q,p as z,q as U,W as Z,s as G,u as J,v as Q,w as N,x as ee,y as se,z as ie}from"./index-Cym9vzvm.js";function I(s){return s.startsWith("/")?{valid:!1,error:`Absolute path not allowed: ${s}`}:s.split("/").some(l=>l==="..")?{valid:!1,error:`Path traversal not allowed: ${s}`}:s.includes("%2e%2e")||s.includes("%2E%2E")?{valid:!1,error:`Encoded path traversal not allowed: ${s}`}:{valid:!0}}async function x(s,i){const l=i.split("/").filter(Boolean);let o="";for(const e of l){o+="/"+e;try{await s.mkdir(o)}catch{}}}async function O(s,i,l="/workspace/skills"){const o=`${l}/${i}`;await F(s);let e;try{e=await g(s,o)}catch(d){return{success:!1,skill:i,version:"unknown",error:`Failed to read manifest: ${d instanceof Error?d.message:String(d)}`}}if(e.skill!==i)return{success:!1,skill:i,version:e.version,error:`Manifest skill name "${e.skill}" does not match directory name "${i}"`};const p=await A(s);if(p.includes(e.skill))return{success:!1,skill:e.skill,version:e.version,error:`Skill "${e.skill}" is already installed`};const u=L(e,p);if(!u.ok)return{success:!1,skill:e.skill,version:e.version,error:`Missing dependencies: ${u.missing.join(", ")}`};const t=T(e,p);if(!t.ok)return{success:!1,skill:e.skill,version:e.version,error:`Conflicting skills: ${t.conflicting.join(", ")}`};const c={},h=[];try{if(e.adds&&e.adds.length>0)for(const n of e.adds){const k=I(n);if(!k.valid)return{success:!1,skill:e.skill,version:e.version,error:k.error};const $=`${o}/add/${n}`,a=`/${n}`;try{const r=a.substring(0,a.lastIndexOf("/"));r&&await x(s,r),await s.copyFile($,a),h.push(n);const f=await s.readTextFile(a);c[n]=await _(f)}catch(r){return{success:!1,skill:e.skill,version:e.version,error:`Failed to copy ${n}: ${r instanceof Error?r.message:String(r)}`}}}if(e.modifies&&e.modifies.length>0)for(const n of e.modifies){const k=I(n);if(!k.valid)return{success:!1,skill:e.skill,version:e.version,error:k.error};const $=`${o}/modify/${n}`;try{const a=await s.readTextFile($);let r="";try{r=await s.readTextFile(`/${n}`)}catch{}let f;if(a.includes("// APPEND_AFTER:")){const w=a.split(`
2
2
  `),v=w.find(S=>S.includes("// APPEND_AFTER:"))?.split("// APPEND_AFTER:")[1]?.trim(),m=w.filter(S=>!S.includes("// APPEND_AFTER:")).join(`
3
3
  `);if(v&&r.includes(v)){const S=r.indexOf(v)+v.length,E=r.indexOf(`
4
4
  `,S);if(E===-1){const y=r.endsWith(`
@@ -1 +1 @@
1
- import{t as z,f as x}from"./index-BibHrLnR.js";class T{marshaller;serializer;deserializer;serdeContext;defaultContentType;constructor({marshaller:i,serializer:n,deserializer:o,serdeContext:c,defaultContentType:y}){this.marshaller=i,this.serializer=n,this.deserializer=o,this.serdeContext=c,this.defaultContentType=y}async serializeEventStream({eventStream:i,requestSchema:n,initialRequest:o}){const c=this.marshaller,y=n.getEventStreamMember(),p=n.getMemberSchema(y),d=this.serializer,u=this.defaultContentType,h=Symbol("initialRequestMarker"),S={async*[Symbol.asyncIterator](){if(o){const r={":event-type":{type:"string",value:"initial-request"},":message-type":{type:"string",value:"event"},":content-type":{type:"string",value:u}};d.write(n,o);const t=d.flush();yield{[h]:!0,headers:r,body:t}}for await(const r of i)yield r}};return c.serialize(S,r=>{if(r[h])return{headers:r.headers,body:r.body};const t=Object.keys(r).find(s=>s!=="__type")??"",{additionalHeaders:e,body:a,eventType:l,explicitPayloadContentType:m}=this.writeEventBody(t,p,r);return{headers:{":event-type":{type:"string",value:l},":message-type":{type:"string",value:"event"},":content-type":{type:"string",value:m??u},...e},body:a}})}async deserializeEventStream({response:i,responseSchema:n,initialResponseContainer:o}){const c=this.marshaller,y=n.getEventStreamMember(),d=n.getMemberSchema(y).getMemberSchemas(),u=Symbol("initialResponseMarker"),h=c.deserialize(i.body,async t=>{const e=Object.keys(t).find(l=>l!=="__type")??"",a=t[e].body;if(e==="initial-response"){const l=await this.deserializer.read(n,a);return delete l[y],{[u]:!0,...l}}else if(e in d){const l=d[e];if(l.isStructSchema()){const m={};let f=!1;for(const[s,g]of l.structIterator()){const{eventHeader:v,eventPayload:w}=g.getMergedTraits();if(f=f||!!(v||w),w)g.isBlobSchema()?m[s]=a:g.isStringSchema()?m[s]=(this.serdeContext?.utf8Encoder??z)(a):g.isStructSchema()&&(m[s]=await this.deserializer.read(g,a));else if(v){const b=t[e].headers[s]?.value;b!=null&&(g.isNumericSchema()?b&&typeof b=="object"&&"bytes"in b?m[s]=BigInt(b.toString()):m[s]=Number(b):m[s]=b)}}if(f)return{[e]:m};if(a.byteLength===0)return{[e]:{}}}return{[e]:await this.deserializer.read(l,a)}}else return{$unknown:t}}),S=h[Symbol.asyncIterator](),r=await S.next();if(r.done)return h;if(r.value?.[u]){if(!n)throw new Error("@smithy::core/protocols - initial-response event encountered in event stream but no response schema given.");for(const[t,e]of Object.entries(r.value))o[t]=e}return{async*[Symbol.asyncIterator](){for(r?.value?.[u]||(yield r.value);;){const{done:t,value:e}=await S.next();if(t)break;yield e}}}}writeEventBody(i,n,o){const c=this.serializer;let y=i,p=null,d;const u=n.getSchema()[4].includes(i),h={};if(u){const t=n.getMemberSchema(i);if(t.isStructSchema()){for(const[e,a]of t.structIterator()){const{eventHeader:l,eventPayload:m}=a.getMergedTraits();if(m)p=e;else if(l){const f=o[i][e];let s="binary";a.isNumericSchema()?(-2)**31<=f&&f<=2**31-1?s="integer":s="long":a.isTimestampSchema()?s="timestamp":a.isStringSchema()?s="string":a.isBooleanSchema()&&(s="boolean"),f!=null&&(h[e]={type:s,value:f},delete o[i][e])}}if(p!==null){const e=t.getMemberSchema(p);e.isBlobSchema()?d="application/octet-stream":e.isStringSchema()&&(d="text/plain"),c.write(e,o[i][p])}else c.write(t,o[i])}else if(t.isUnitSchema())c.write(t,{});else throw new Error("@smithy/core/event-streams - non-struct member not supported in event stream union.")}else{const[t,e]=o[i];y=t,c.write(15,e)}const S=c.flush();return{body:typeof S=="string"?(this.serdeContext?.utf8Decoder??x)(S):S,eventType:y,explicitPayloadContentType:d,additionalHeaders:h}}}export{T as EventStreamSerde};
1
+ import{t as z,f as x}from"./index-Cym9vzvm.js";class T{marshaller;serializer;deserializer;serdeContext;defaultContentType;constructor({marshaller:i,serializer:n,deserializer:o,serdeContext:c,defaultContentType:y}){this.marshaller=i,this.serializer=n,this.deserializer=o,this.serdeContext=c,this.defaultContentType=y}async serializeEventStream({eventStream:i,requestSchema:n,initialRequest:o}){const c=this.marshaller,y=n.getEventStreamMember(),p=n.getMemberSchema(y),d=this.serializer,u=this.defaultContentType,h=Symbol("initialRequestMarker"),S={async*[Symbol.asyncIterator](){if(o){const r={":event-type":{type:"string",value:"initial-request"},":message-type":{type:"string",value:"event"},":content-type":{type:"string",value:u}};d.write(n,o);const t=d.flush();yield{[h]:!0,headers:r,body:t}}for await(const r of i)yield r}};return c.serialize(S,r=>{if(r[h])return{headers:r.headers,body:r.body};const t=Object.keys(r).find(s=>s!=="__type")??"",{additionalHeaders:e,body:a,eventType:l,explicitPayloadContentType:m}=this.writeEventBody(t,p,r);return{headers:{":event-type":{type:"string",value:l},":message-type":{type:"string",value:"event"},":content-type":{type:"string",value:m??u},...e},body:a}})}async deserializeEventStream({response:i,responseSchema:n,initialResponseContainer:o}){const c=this.marshaller,y=n.getEventStreamMember(),d=n.getMemberSchema(y).getMemberSchemas(),u=Symbol("initialResponseMarker"),h=c.deserialize(i.body,async t=>{const e=Object.keys(t).find(l=>l!=="__type")??"",a=t[e].body;if(e==="initial-response"){const l=await this.deserializer.read(n,a);return delete l[y],{[u]:!0,...l}}else if(e in d){const l=d[e];if(l.isStructSchema()){const m={};let f=!1;for(const[s,g]of l.structIterator()){const{eventHeader:v,eventPayload:w}=g.getMergedTraits();if(f=f||!!(v||w),w)g.isBlobSchema()?m[s]=a:g.isStringSchema()?m[s]=(this.serdeContext?.utf8Encoder??z)(a):g.isStructSchema()&&(m[s]=await this.deserializer.read(g,a));else if(v){const b=t[e].headers[s]?.value;b!=null&&(g.isNumericSchema()?b&&typeof b=="object"&&"bytes"in b?m[s]=BigInt(b.toString()):m[s]=Number(b):m[s]=b)}}if(f)return{[e]:m};if(a.byteLength===0)return{[e]:{}}}return{[e]:await this.deserializer.read(l,a)}}else return{$unknown:t}}),S=h[Symbol.asyncIterator](),r=await S.next();if(r.done)return h;if(r.value?.[u]){if(!n)throw new Error("@smithy::core/protocols - initial-response event encountered in event stream but no response schema given.");for(const[t,e]of Object.entries(r.value))o[t]=e}return{async*[Symbol.asyncIterator](){for(r?.value?.[u]||(yield r.value);;){const{done:t,value:e}=await S.next();if(t)break;yield e}}}}writeEventBody(i,n,o){const c=this.serializer;let y=i,p=null,d;const u=n.getSchema()[4].includes(i),h={};if(u){const t=n.getMemberSchema(i);if(t.isStructSchema()){for(const[e,a]of t.structIterator()){const{eventHeader:l,eventPayload:m}=a.getMergedTraits();if(m)p=e;else if(l){const f=o[i][e];let s="binary";a.isNumericSchema()?(-2)**31<=f&&f<=2**31-1?s="integer":s="long":a.isTimestampSchema()?s="timestamp":a.isStringSchema()?s="string":a.isBooleanSchema()&&(s="boolean"),f!=null&&(h[e]={type:s,value:f},delete o[i][e])}}if(p!==null){const e=t.getMemberSchema(p);e.isBlobSchema()?d="application/octet-stream":e.isStringSchema()&&(d="text/plain"),c.write(e,o[i][p])}else c.write(t,o[i])}else if(t.isUnitSchema())c.write(t,{});else throw new Error("@smithy/core/event-streams - non-struct member not supported in event stream union.")}else{const[t,e]=o[i];y=t,c.write(15,e)}const S=c.flush();return{body:typeof S=="string"?(this.serdeContext?.utf8Decoder??x)(S):S,eventType:y,explicitPayloadContentType:d,additionalHeaders:h}}}export{T as EventStreamSerde};
@@ -1,4 +1,4 @@
1
- import{g as aI,K as kQ,L as MQ,A as GQ}from"./index-BibHrLnR.js";import{h as NQ,c as mQ,s as UQ}from"./stream-lEC9OYG2.js";import{r as rA}from"./___vite-browser-external_commonjs-proxy-Dn-12QWY.js";function LQ(h,d){for(var w=0;w<d.length;w++){const s=d[w];if(typeof s!="string"&&!Array.isArray(s)){for(const F in s)if(F!=="default"&&!(F in h)){const C=Object.getOwnPropertyDescriptor(s,F);C&&Object.defineProperty(h,F,C.get?C:{enumerable:!0,get:()=>s[F]})}}}return Object.freeze(Object.defineProperty(h,Symbol.toStringTag,{value:"Module"}))}var XA={};const De=aI(NQ),ce=aI(mQ);var lI,CC;function JQ(){if(CC)return lI;CC=1;const h=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,w=typeof AbortController=="function"?AbortController:class{constructor(){this.signal=new C}abort(o=new Error("This operation was aborted")){this.signal.reason=this.signal.reason||o,this.signal.aborted=!0,this.signal.dispatchEvent({type:"abort",target:this.signal})}},s=typeof AbortSignal=="function",F=typeof w.AbortSignal=="function",C=s?AbortSignal:F?w.AbortController:class{constructor(){this.reason=void 0,this.aborted=!1,this._listeners=[]}dispatchEvent(o){o.type==="abort"&&(this.aborted=!0,this.onabort(o),this._listeners.forEach(u=>u(o),this))}onabort(){}addEventListener(o,u){o==="abort"&&this._listeners.push(u)}removeEventListener(o,u){o==="abort"&&(this._listeners=this._listeners.filter(D=>D!==u))}},n=new Set,c=(a,o)=>{const u=`LRU_CACHE_OPTION_${a}`;I(u)&&g(u,`${a} option`,`options.${o}`,r)},E=(a,o)=>{const u=`LRU_CACHE_METHOD_${a}`;if(I(u)){const{prototype:D}=r,{get:f}=Object.getOwnPropertyDescriptor(D,a);g(u,`${a} method`,`cache.${o}()`,f)}},A=(a,o)=>{const u=`LRU_CACHE_PROPERTY_${a}`;if(I(u)){const{prototype:D}=r,{get:f}=Object.getOwnPropertyDescriptor(D,a);g(u,`${a} property`,`cache.${o}`,f)}},e=(...a)=>{typeof process=="object"&&process&&typeof process.emitWarning=="function"?process.emitWarning(...a):console.error(...a)},I=a=>!n.has(a),g=(a,o,u,D)=>{n.add(a);const f=`The ${o} is deprecated. Please use ${u} instead.`;e(f,"DeprecationWarning",a,D)},i=a=>a&&a===Math.floor(a)&&a>0&&isFinite(a),Q=a=>i(a)?a<=Math.pow(2,8)?Uint8Array:a<=Math.pow(2,16)?Uint16Array:a<=Math.pow(2,32)?Uint32Array:a<=Number.MAX_SAFE_INTEGER?B:null:null;class B extends Array{constructor(o){super(o),this.fill(0)}}class t{constructor(o){if(o===0)return[];const u=Q(o);this.heap=new u(o),this.length=0}push(o){this.heap[this.length++]=o}pop(){return this.heap[--this.length]}}class r{constructor(o={}){const{max:u=0,ttl:D,ttlResolution:f=1,ttlAutopurge:y,updateAgeOnGet:p,updateAgeOnHas:S,allowStale:R,dispose:N,disposeAfter:U,noDisposeOnSet:J,noUpdateTTL:x,maxSize:X=0,maxEntrySize:CA=0,sizeCalculation:z,fetchMethod:_,fetchContext:iA,noDeleteOnFetchRejection:uA,noDeleteOnStaleGet:DA,allowStaleOnFetchRejection:Z,allowStaleOnFetchAbort:RA,ignoreFetchAbort:UA}=o,{length:pA,maxAge:tA,stale:FA}=o instanceof r?{}:o;if(u!==0&&!i(u))throw new TypeError("max option must be a nonnegative integer");const HA=u?Q(u):Array;if(!HA)throw new Error("invalid max value: "+u);if(this.max=u,this.maxSize=X,this.maxEntrySize=CA||this.maxSize,this.sizeCalculation=z||pA,this.sizeCalculation){if(!this.maxSize&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(this.fetchMethod=_||null,this.fetchMethod&&typeof this.fetchMethod!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.fetchContext=iA,!this.fetchMethod&&iA!==void 0)throw new TypeError("cannot set fetchContext without fetchMethod");if(this.keyMap=new Map,this.keyList=new Array(u).fill(null),this.valList=new Array(u).fill(null),this.next=new HA(u),this.prev=new HA(u),this.head=0,this.tail=0,this.free=new t(u),this.initialFill=1,this.size=0,typeof N=="function"&&(this.dispose=N),typeof U=="function"?(this.disposeAfter=U,this.disposed=[]):(this.disposeAfter=null,this.disposed=null),this.noDisposeOnSet=!!J,this.noUpdateTTL=!!x,this.noDeleteOnFetchRejection=!!uA,this.allowStaleOnFetchRejection=!!Z,this.allowStaleOnFetchAbort=!!RA,this.ignoreFetchAbort=!!UA,this.maxEntrySize!==0){if(this.maxSize!==0&&!i(this.maxSize))throw new TypeError("maxSize must be a positive integer if specified");if(!i(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.initializeSizeTracking()}if(this.allowStale=!!R||!!FA,this.noDeleteOnStaleGet=!!DA,this.updateAgeOnGet=!!p,this.updateAgeOnHas=!!S,this.ttlResolution=i(f)||f===0?f:1,this.ttlAutopurge=!!y,this.ttl=D||tA||0,this.ttl){if(!i(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.initializeTTLTracking()}if(this.max===0&&this.ttl===0&&this.maxSize===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.max&&!this.maxSize){const ZA="LRU_CACHE_UNBOUNDED";I(ZA)&&(n.add(ZA),e("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",ZA,r))}FA&&c("stale","allowStale"),tA&&c("maxAge","ttl"),pA&&c("length","sizeCalculation")}getRemainingTTL(o){return this.has(o,{updateAgeOnHas:!1})?1/0:0}initializeTTLTracking(){this.ttls=new B(this.max),this.starts=new B(this.max),this.setItemTTL=(D,f,y=h.now())=>{if(this.starts[D]=f!==0?y:0,this.ttls[D]=f,f!==0&&this.ttlAutopurge){const p=setTimeout(()=>{this.isStale(D)&&this.delete(this.keyList[D])},f+1);p.unref&&p.unref()}},this.updateItemAge=D=>{this.starts[D]=this.ttls[D]!==0?h.now():0},this.statusTTL=(D,f)=>{D&&(D.ttl=this.ttls[f],D.start=this.starts[f],D.now=o||u(),D.remainingTTL=D.now+D.ttl-D.start)};let o=0;const u=()=>{const D=h.now();if(this.ttlResolution>0){o=D;const f=setTimeout(()=>o=0,this.ttlResolution);f.unref&&f.unref()}return D};this.getRemainingTTL=D=>{const f=this.keyMap.get(D);return f===void 0?0:this.ttls[f]===0||this.starts[f]===0?1/0:this.starts[f]+this.ttls[f]-(o||u())},this.isStale=D=>this.ttls[D]!==0&&this.starts[D]!==0&&(o||u())-this.starts[D]>this.ttls[D]}updateItemAge(o){}statusTTL(o,u){}setItemTTL(o,u,D){}isStale(o){return!1}initializeSizeTracking(){this.calculatedSize=0,this.sizes=new B(this.max),this.removeItemSize=o=>{this.calculatedSize-=this.sizes[o],this.sizes[o]=0},this.requireSize=(o,u,D,f)=>{if(this.isBackgroundFetch(u))return 0;if(!i(D))if(f){if(typeof f!="function")throw new TypeError("sizeCalculation must be a function");if(D=f(u,o),!i(D))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return D},this.addItemSize=(o,u,D)=>{if(this.sizes[o]=u,this.maxSize){const f=this.maxSize-this.sizes[o];for(;this.calculatedSize>f;)this.evict(!0)}this.calculatedSize+=this.sizes[o],D&&(D.entrySize=u,D.totalCalculatedSize=this.calculatedSize)}}removeItemSize(o){}addItemSize(o,u){}requireSize(o,u,D,f){if(D||f)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache")}*indexes({allowStale:o=this.allowStale}={}){if(this.size)for(let u=this.tail;!(!this.isValidIndex(u)||((o||!this.isStale(u))&&(yield u),u===this.head));)u=this.prev[u]}*rindexes({allowStale:o=this.allowStale}={}){if(this.size)for(let u=this.head;!(!this.isValidIndex(u)||((o||!this.isStale(u))&&(yield u),u===this.tail));)u=this.next[u]}isValidIndex(o){return o!==void 0&&this.keyMap.get(this.keyList[o])===o}*entries(){for(const o of this.indexes())this.valList[o]!==void 0&&this.keyList[o]!==void 0&&!this.isBackgroundFetch(this.valList[o])&&(yield[this.keyList[o],this.valList[o]])}*rentries(){for(const o of this.rindexes())this.valList[o]!==void 0&&this.keyList[o]!==void 0&&!this.isBackgroundFetch(this.valList[o])&&(yield[this.keyList[o],this.valList[o]])}*keys(){for(const o of this.indexes())this.keyList[o]!==void 0&&!this.isBackgroundFetch(this.valList[o])&&(yield this.keyList[o])}*rkeys(){for(const o of this.rindexes())this.keyList[o]!==void 0&&!this.isBackgroundFetch(this.valList[o])&&(yield this.keyList[o])}*values(){for(const o of this.indexes())this.valList[o]!==void 0&&!this.isBackgroundFetch(this.valList[o])&&(yield this.valList[o])}*rvalues(){for(const o of this.rindexes())this.valList[o]!==void 0&&!this.isBackgroundFetch(this.valList[o])&&(yield this.valList[o])}[Symbol.iterator](){return this.entries()}find(o,u){for(const D of this.indexes()){const f=this.valList[D],y=this.isBackgroundFetch(f)?f.__staleWhileFetching:f;if(y!==void 0&&o(y,this.keyList[D],this))return this.get(this.keyList[D],u)}}forEach(o,u=this){for(const D of this.indexes()){const f=this.valList[D],y=this.isBackgroundFetch(f)?f.__staleWhileFetching:f;y!==void 0&&o.call(u,y,this.keyList[D],this)}}rforEach(o,u=this){for(const D of this.rindexes()){const f=this.valList[D],y=this.isBackgroundFetch(f)?f.__staleWhileFetching:f;y!==void 0&&o.call(u,y,this.keyList[D],this)}}get prune(){return E("prune","purgeStale"),this.purgeStale}purgeStale(){let o=!1;for(const u of this.rindexes({allowStale:!0}))this.isStale(u)&&(this.delete(this.keyList[u]),o=!0);return o}dump(){const o=[];for(const u of this.indexes({allowStale:!0})){const D=this.keyList[u],f=this.valList[u],y=this.isBackgroundFetch(f)?f.__staleWhileFetching:f;if(y===void 0)continue;const p={value:y};if(this.ttls){p.ttl=this.ttls[u];const S=h.now()-this.starts[u];p.start=Math.floor(Date.now()-S)}this.sizes&&(p.size=this.sizes[u]),o.unshift([D,p])}return o}load(o){this.clear();for(const[u,D]of o){if(D.start){const f=Date.now()-D.start;D.start=h.now()-f}this.set(u,D.value,D)}}dispose(o,u,D){}set(o,u,{ttl:D=this.ttl,start:f,noDisposeOnSet:y=this.noDisposeOnSet,size:p=0,sizeCalculation:S=this.sizeCalculation,noUpdateTTL:R=this.noUpdateTTL,status:N}={}){if(p=this.requireSize(o,u,p,S),this.maxEntrySize&&p>this.maxEntrySize)return N&&(N.set="miss",N.maxEntrySizeExceeded=!0),this.delete(o),this;let U=this.size===0?void 0:this.keyMap.get(o);if(U===void 0)U=this.newIndex(),this.keyList[U]=o,this.valList[U]=u,this.keyMap.set(o,U),this.next[this.tail]=U,this.prev[U]=this.tail,this.tail=U,this.size++,this.addItemSize(U,p,N),N&&(N.set="add"),R=!1;else{this.moveToTail(U);const J=this.valList[U];if(u!==J){if(this.isBackgroundFetch(J)?J.__abortController.abort(new Error("replaced")):y||(this.dispose(J,o,"set"),this.disposeAfter&&this.disposed.push([J,o,"set"])),this.removeItemSize(U),this.valList[U]=u,this.addItemSize(U,p,N),N){N.set="replace";const x=J&&this.isBackgroundFetch(J)?J.__staleWhileFetching:J;x!==void 0&&(N.oldValue=x)}}else N&&(N.set="update")}if(D!==0&&this.ttl===0&&!this.ttls&&this.initializeTTLTracking(),R||this.setItemTTL(U,D,f),this.statusTTL(N,U),this.disposeAfter)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return this}newIndex(){return this.size===0?this.tail:this.size===this.max&&this.max!==0?this.evict(!1):this.free.length!==0?this.free.pop():this.initialFill++}pop(){if(this.size){const o=this.valList[this.head];return this.evict(!0),o}}evict(o){const u=this.head,D=this.keyList[u],f=this.valList[u];return this.isBackgroundFetch(f)?f.__abortController.abort(new Error("evicted")):(this.dispose(f,D,"evict"),this.disposeAfter&&this.disposed.push([f,D,"evict"])),this.removeItemSize(u),o&&(this.keyList[u]=null,this.valList[u]=null,this.free.push(u)),this.head=this.next[u],this.keyMap.delete(D),this.size--,u}has(o,{updateAgeOnHas:u=this.updateAgeOnHas,status:D}={}){const f=this.keyMap.get(o);if(f!==void 0)if(this.isStale(f))D&&(D.has="stale",this.statusTTL(D,f));else return u&&this.updateItemAge(f),D&&(D.has="hit"),this.statusTTL(D,f),!0;else D&&(D.has="miss");return!1}peek(o,{allowStale:u=this.allowStale}={}){const D=this.keyMap.get(o);if(D!==void 0&&(u||!this.isStale(D))){const f=this.valList[D];return this.isBackgroundFetch(f)?f.__staleWhileFetching:f}}backgroundFetch(o,u,D,f){const y=u===void 0?void 0:this.valList[u];if(this.isBackgroundFetch(y))return y;const p=new w;D.signal&&D.signal.addEventListener("abort",()=>p.abort(D.signal.reason));const S={signal:p.signal,options:D,context:f},R=(X,CA=!1)=>{const{aborted:z}=p.signal,_=D.ignoreFetchAbort&&X!==void 0;return D.status&&(z&&!CA?(D.status.fetchAborted=!0,D.status.fetchError=p.signal.reason,_&&(D.status.fetchAbortIgnored=!0)):D.status.fetchResolved=!0),z&&!_&&!CA?U(p.signal.reason):(this.valList[u]===x&&(X===void 0?x.__staleWhileFetching?this.valList[u]=x.__staleWhileFetching:this.delete(o):(D.status&&(D.status.fetchUpdated=!0),this.set(o,X,S.options))),X)},N=X=>(D.status&&(D.status.fetchRejected=!0,D.status.fetchError=X),U(X)),U=X=>{const{aborted:CA}=p.signal,z=CA&&D.allowStaleOnFetchAbort,_=z||D.allowStaleOnFetchRejection,iA=_||D.noDeleteOnFetchRejection;if(this.valList[u]===x&&(!iA||x.__staleWhileFetching===void 0?this.delete(o):z||(this.valList[u]=x.__staleWhileFetching)),_)return D.status&&x.__staleWhileFetching!==void 0&&(D.status.returnedStale=!0),x.__staleWhileFetching;if(x.__returned===x)throw X},J=(X,CA)=>{this.fetchMethod(o,y,S).then(z=>X(z),CA),p.signal.addEventListener("abort",()=>{(!D.ignoreFetchAbort||D.allowStaleOnFetchAbort)&&(X(),D.allowStaleOnFetchAbort&&(X=z=>R(z,!0)))})};D.status&&(D.status.fetchDispatched=!0);const x=new Promise(J).then(R,N);return x.__abortController=p,x.__staleWhileFetching=y,x.__returned=null,u===void 0?(this.set(o,x,{...S.options,status:void 0}),u=this.keyMap.get(o)):this.valList[u]=x,x}isBackgroundFetch(o){return o&&typeof o=="object"&&typeof o.then=="function"&&Object.prototype.hasOwnProperty.call(o,"__staleWhileFetching")&&Object.prototype.hasOwnProperty.call(o,"__returned")&&(o.__returned===o||o.__returned===null)}async fetch(o,{allowStale:u=this.allowStale,updateAgeOnGet:D=this.updateAgeOnGet,noDeleteOnStaleGet:f=this.noDeleteOnStaleGet,ttl:y=this.ttl,noDisposeOnSet:p=this.noDisposeOnSet,size:S=0,sizeCalculation:R=this.sizeCalculation,noUpdateTTL:N=this.noUpdateTTL,noDeleteOnFetchRejection:U=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:J=this.allowStaleOnFetchRejection,ignoreFetchAbort:x=this.ignoreFetchAbort,allowStaleOnFetchAbort:X=this.allowStaleOnFetchAbort,fetchContext:CA=this.fetchContext,forceRefresh:z=!1,status:_,signal:iA}={}){if(!this.fetchMethod)return _&&(_.fetch="get"),this.get(o,{allowStale:u,updateAgeOnGet:D,noDeleteOnStaleGet:f,status:_});const uA={allowStale:u,updateAgeOnGet:D,noDeleteOnStaleGet:f,ttl:y,noDisposeOnSet:p,size:S,sizeCalculation:R,noUpdateTTL:N,noDeleteOnFetchRejection:U,allowStaleOnFetchRejection:J,allowStaleOnFetchAbort:X,ignoreFetchAbort:x,status:_,signal:iA};let DA=this.keyMap.get(o);if(DA===void 0){_&&(_.fetch="miss");const Z=this.backgroundFetch(o,DA,uA,CA);return Z.__returned=Z}else{const Z=this.valList[DA];if(this.isBackgroundFetch(Z)){const FA=u&&Z.__staleWhileFetching!==void 0;return _&&(_.fetch="inflight",FA&&(_.returnedStale=!0)),FA?Z.__staleWhileFetching:Z.__returned=Z}const RA=this.isStale(DA);if(!z&&!RA)return _&&(_.fetch="hit"),this.moveToTail(DA),D&&this.updateItemAge(DA),this.statusTTL(_,DA),Z;const UA=this.backgroundFetch(o,DA,uA,CA),pA=UA.__staleWhileFetching!==void 0,tA=pA&&u;return _&&(_.fetch=pA&&RA?"stale":"refresh",tA&&RA&&(_.returnedStale=!0)),tA?UA.__staleWhileFetching:UA.__returned=UA}}get(o,{allowStale:u=this.allowStale,updateAgeOnGet:D=this.updateAgeOnGet,noDeleteOnStaleGet:f=this.noDeleteOnStaleGet,status:y}={}){const p=this.keyMap.get(o);if(p!==void 0){const S=this.valList[p],R=this.isBackgroundFetch(S);return this.statusTTL(y,p),this.isStale(p)?(y&&(y.get="stale"),R?(y&&(y.returnedStale=u&&S.__staleWhileFetching!==void 0),u?S.__staleWhileFetching:void 0):(f||this.delete(o),y&&(y.returnedStale=u),u?S:void 0)):(y&&(y.get="hit"),R?S.__staleWhileFetching:(this.moveToTail(p),D&&this.updateItemAge(p),S))}else y&&(y.get="miss")}connect(o,u){this.prev[u]=o,this.next[o]=u}moveToTail(o){o!==this.tail&&(o===this.head?this.head=this.next[o]:this.connect(this.prev[o],this.next[o]),this.connect(this.tail,o),this.tail=o)}get del(){return E("del","delete"),this.delete}delete(o){let u=!1;if(this.size!==0){const D=this.keyMap.get(o);if(D!==void 0)if(u=!0,this.size===1)this.clear();else{this.removeItemSize(D);const f=this.valList[D];this.isBackgroundFetch(f)?f.__abortController.abort(new Error("deleted")):(this.dispose(f,o,"delete"),this.disposeAfter&&this.disposed.push([f,o,"delete"])),this.keyMap.delete(o),this.keyList[D]=null,this.valList[D]=null,D===this.tail?this.tail=this.prev[D]:D===this.head?this.head=this.next[D]:(this.next[this.prev[D]]=this.next[D],this.prev[this.next[D]]=this.prev[D]),this.size--,this.free.push(D)}}if(this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return u}clear(){for(const o of this.rindexes({allowStale:!0})){const u=this.valList[o];if(this.isBackgroundFetch(u))u.__abortController.abort(new Error("deleted"));else{const D=this.keyList[o];this.dispose(u,D,"delete"),this.disposeAfter&&this.disposed.push([u,D,"delete"])}}if(this.keyMap.clear(),this.valList.fill(null),this.keyList.fill(null),this.ttls&&(this.ttls.fill(0),this.starts.fill(0)),this.sizes&&this.sizes.fill(0),this.head=0,this.tail=0,this.initialFill=1,this.free.length=0,this.calculatedSize=0,this.size=0,this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift())}get reset(){return E("reset","clear"),this.clear}get length(){return A("length","size"),this.size}static get AbortController(){return w}static get AbortSignal(){return C}}return lI=r,lI}var jA={},vA={},BC;function KQ(){if(BC)return vA;BC=1;var h=vA&&vA.__createBinding||(Object.create?(function(E,A,e,I){I===void 0&&(I=e);var g=Object.getOwnPropertyDescriptor(A,e);(!g||("get"in g?!A.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return A[e]}}),Object.defineProperty(E,I,g)}):(function(E,A,e,I){I===void 0&&(I=e),E[I]=A[e]})),d=vA&&vA.__setModuleDefault||(Object.create?(function(E,A){Object.defineProperty(E,"default",{enumerable:!0,value:A})}):function(E,A){E.default=A}),w=vA&&vA.__importStar||function(E){if(E&&E.__esModule)return E;var A={};if(E!=null)for(var e in E)e!=="default"&&Object.prototype.hasOwnProperty.call(E,e)&&h(A,E,e);return d(A,E),A};Object.defineProperty(vA,"__esModule",{value:!0}),vA.req=vA.json=vA.toBuffer=void 0;const s=w(De),F=w(ce);async function C(E){let A=0;const e=[];for await(const I of E)A+=I.length,e.push(I);return Buffer.concat(e,A)}vA.toBuffer=C;async function n(E){const e=(await C(E)).toString("utf8");try{return JSON.parse(e)}catch(I){const g=I;throw g.message+=` (input: ${e})`,g}}vA.json=n;function c(E,A={}){const I=((typeof E=="string"?E:E.href).startsWith("https:")?F:s).request(E,A),g=new Promise((i,Q)=>{I.once("response",i).once("error",Q).end()});return I.then=g.then.bind(g),I}return vA.req=c,vA}var tC;function he(){return tC||(tC=1,(function(h){var d=jA&&jA.__createBinding||(Object.create?(function(e,I,g,i){i===void 0&&(i=g);var Q=Object.getOwnPropertyDescriptor(I,g);(!Q||("get"in Q?!I.__esModule:Q.writable||Q.configurable))&&(Q={enumerable:!0,get:function(){return I[g]}}),Object.defineProperty(e,i,Q)}):(function(e,I,g,i){i===void 0&&(i=g),e[i]=I[g]})),w=jA&&jA.__setModuleDefault||(Object.create?(function(e,I){Object.defineProperty(e,"default",{enumerable:!0,value:I})}):function(e,I){e.default=I}),s=jA&&jA.__importStar||function(e){if(e&&e.__esModule)return e;var I={};if(e!=null)for(var g in e)g!=="default"&&Object.prototype.hasOwnProperty.call(e,g)&&d(I,e,g);return w(I,e),I},F=jA&&jA.__exportStar||function(e,I){for(var g in e)g!=="default"&&!Object.prototype.hasOwnProperty.call(I,g)&&d(I,e,g)};Object.defineProperty(h,"__esModule",{value:!0}),h.Agent=void 0;const C=s(rA),n=s(De),c=ce;F(KQ(),h);const E=Symbol("AgentBaseInternalState");class A extends n.Agent{constructor(I){super(I),this[E]={}}isSecureEndpoint(I){if(I){if(typeof I.secureEndpoint=="boolean")return I.secureEndpoint;if(typeof I.protocol=="string")return I.protocol==="https:"}const{stack:g}=new Error;return typeof g!="string"?!1:g.split(`
1
+ import{g as aI,K as kQ,L as MQ,A as GQ}from"./index-Cym9vzvm.js";import{h as NQ,c as mQ,s as UQ}from"./stream-lEC9OYG2.js";import{r as rA}from"./___vite-browser-external_commonjs-proxy-C2JfZAW0.js";function LQ(h,d){for(var w=0;w<d.length;w++){const s=d[w];if(typeof s!="string"&&!Array.isArray(s)){for(const F in s)if(F!=="default"&&!(F in h)){const C=Object.getOwnPropertyDescriptor(s,F);C&&Object.defineProperty(h,F,C.get?C:{enumerable:!0,get:()=>s[F]})}}}return Object.freeze(Object.defineProperty(h,Symbol.toStringTag,{value:"Module"}))}var XA={};const De=aI(NQ),ce=aI(mQ);var lI,CC;function JQ(){if(CC)return lI;CC=1;const h=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,w=typeof AbortController=="function"?AbortController:class{constructor(){this.signal=new C}abort(o=new Error("This operation was aborted")){this.signal.reason=this.signal.reason||o,this.signal.aborted=!0,this.signal.dispatchEvent({type:"abort",target:this.signal})}},s=typeof AbortSignal=="function",F=typeof w.AbortSignal=="function",C=s?AbortSignal:F?w.AbortController:class{constructor(){this.reason=void 0,this.aborted=!1,this._listeners=[]}dispatchEvent(o){o.type==="abort"&&(this.aborted=!0,this.onabort(o),this._listeners.forEach(u=>u(o),this))}onabort(){}addEventListener(o,u){o==="abort"&&this._listeners.push(u)}removeEventListener(o,u){o==="abort"&&(this._listeners=this._listeners.filter(D=>D!==u))}},n=new Set,c=(a,o)=>{const u=`LRU_CACHE_OPTION_${a}`;I(u)&&g(u,`${a} option`,`options.${o}`,r)},E=(a,o)=>{const u=`LRU_CACHE_METHOD_${a}`;if(I(u)){const{prototype:D}=r,{get:f}=Object.getOwnPropertyDescriptor(D,a);g(u,`${a} method`,`cache.${o}()`,f)}},A=(a,o)=>{const u=`LRU_CACHE_PROPERTY_${a}`;if(I(u)){const{prototype:D}=r,{get:f}=Object.getOwnPropertyDescriptor(D,a);g(u,`${a} property`,`cache.${o}`,f)}},e=(...a)=>{typeof process=="object"&&process&&typeof process.emitWarning=="function"?process.emitWarning(...a):console.error(...a)},I=a=>!n.has(a),g=(a,o,u,D)=>{n.add(a);const f=`The ${o} is deprecated. Please use ${u} instead.`;e(f,"DeprecationWarning",a,D)},i=a=>a&&a===Math.floor(a)&&a>0&&isFinite(a),Q=a=>i(a)?a<=Math.pow(2,8)?Uint8Array:a<=Math.pow(2,16)?Uint16Array:a<=Math.pow(2,32)?Uint32Array:a<=Number.MAX_SAFE_INTEGER?B:null:null;class B extends Array{constructor(o){super(o),this.fill(0)}}class t{constructor(o){if(o===0)return[];const u=Q(o);this.heap=new u(o),this.length=0}push(o){this.heap[this.length++]=o}pop(){return this.heap[--this.length]}}class r{constructor(o={}){const{max:u=0,ttl:D,ttlResolution:f=1,ttlAutopurge:y,updateAgeOnGet:p,updateAgeOnHas:S,allowStale:R,dispose:N,disposeAfter:U,noDisposeOnSet:J,noUpdateTTL:x,maxSize:X=0,maxEntrySize:CA=0,sizeCalculation:z,fetchMethod:_,fetchContext:iA,noDeleteOnFetchRejection:uA,noDeleteOnStaleGet:DA,allowStaleOnFetchRejection:Z,allowStaleOnFetchAbort:RA,ignoreFetchAbort:UA}=o,{length:pA,maxAge:tA,stale:FA}=o instanceof r?{}:o;if(u!==0&&!i(u))throw new TypeError("max option must be a nonnegative integer");const HA=u?Q(u):Array;if(!HA)throw new Error("invalid max value: "+u);if(this.max=u,this.maxSize=X,this.maxEntrySize=CA||this.maxSize,this.sizeCalculation=z||pA,this.sizeCalculation){if(!this.maxSize&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(this.fetchMethod=_||null,this.fetchMethod&&typeof this.fetchMethod!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.fetchContext=iA,!this.fetchMethod&&iA!==void 0)throw new TypeError("cannot set fetchContext without fetchMethod");if(this.keyMap=new Map,this.keyList=new Array(u).fill(null),this.valList=new Array(u).fill(null),this.next=new HA(u),this.prev=new HA(u),this.head=0,this.tail=0,this.free=new t(u),this.initialFill=1,this.size=0,typeof N=="function"&&(this.dispose=N),typeof U=="function"?(this.disposeAfter=U,this.disposed=[]):(this.disposeAfter=null,this.disposed=null),this.noDisposeOnSet=!!J,this.noUpdateTTL=!!x,this.noDeleteOnFetchRejection=!!uA,this.allowStaleOnFetchRejection=!!Z,this.allowStaleOnFetchAbort=!!RA,this.ignoreFetchAbort=!!UA,this.maxEntrySize!==0){if(this.maxSize!==0&&!i(this.maxSize))throw new TypeError("maxSize must be a positive integer if specified");if(!i(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.initializeSizeTracking()}if(this.allowStale=!!R||!!FA,this.noDeleteOnStaleGet=!!DA,this.updateAgeOnGet=!!p,this.updateAgeOnHas=!!S,this.ttlResolution=i(f)||f===0?f:1,this.ttlAutopurge=!!y,this.ttl=D||tA||0,this.ttl){if(!i(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.initializeTTLTracking()}if(this.max===0&&this.ttl===0&&this.maxSize===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.max&&!this.maxSize){const ZA="LRU_CACHE_UNBOUNDED";I(ZA)&&(n.add(ZA),e("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",ZA,r))}FA&&c("stale","allowStale"),tA&&c("maxAge","ttl"),pA&&c("length","sizeCalculation")}getRemainingTTL(o){return this.has(o,{updateAgeOnHas:!1})?1/0:0}initializeTTLTracking(){this.ttls=new B(this.max),this.starts=new B(this.max),this.setItemTTL=(D,f,y=h.now())=>{if(this.starts[D]=f!==0?y:0,this.ttls[D]=f,f!==0&&this.ttlAutopurge){const p=setTimeout(()=>{this.isStale(D)&&this.delete(this.keyList[D])},f+1);p.unref&&p.unref()}},this.updateItemAge=D=>{this.starts[D]=this.ttls[D]!==0?h.now():0},this.statusTTL=(D,f)=>{D&&(D.ttl=this.ttls[f],D.start=this.starts[f],D.now=o||u(),D.remainingTTL=D.now+D.ttl-D.start)};let o=0;const u=()=>{const D=h.now();if(this.ttlResolution>0){o=D;const f=setTimeout(()=>o=0,this.ttlResolution);f.unref&&f.unref()}return D};this.getRemainingTTL=D=>{const f=this.keyMap.get(D);return f===void 0?0:this.ttls[f]===0||this.starts[f]===0?1/0:this.starts[f]+this.ttls[f]-(o||u())},this.isStale=D=>this.ttls[D]!==0&&this.starts[D]!==0&&(o||u())-this.starts[D]>this.ttls[D]}updateItemAge(o){}statusTTL(o,u){}setItemTTL(o,u,D){}isStale(o){return!1}initializeSizeTracking(){this.calculatedSize=0,this.sizes=new B(this.max),this.removeItemSize=o=>{this.calculatedSize-=this.sizes[o],this.sizes[o]=0},this.requireSize=(o,u,D,f)=>{if(this.isBackgroundFetch(u))return 0;if(!i(D))if(f){if(typeof f!="function")throw new TypeError("sizeCalculation must be a function");if(D=f(u,o),!i(D))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return D},this.addItemSize=(o,u,D)=>{if(this.sizes[o]=u,this.maxSize){const f=this.maxSize-this.sizes[o];for(;this.calculatedSize>f;)this.evict(!0)}this.calculatedSize+=this.sizes[o],D&&(D.entrySize=u,D.totalCalculatedSize=this.calculatedSize)}}removeItemSize(o){}addItemSize(o,u){}requireSize(o,u,D,f){if(D||f)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache")}*indexes({allowStale:o=this.allowStale}={}){if(this.size)for(let u=this.tail;!(!this.isValidIndex(u)||((o||!this.isStale(u))&&(yield u),u===this.head));)u=this.prev[u]}*rindexes({allowStale:o=this.allowStale}={}){if(this.size)for(let u=this.head;!(!this.isValidIndex(u)||((o||!this.isStale(u))&&(yield u),u===this.tail));)u=this.next[u]}isValidIndex(o){return o!==void 0&&this.keyMap.get(this.keyList[o])===o}*entries(){for(const o of this.indexes())this.valList[o]!==void 0&&this.keyList[o]!==void 0&&!this.isBackgroundFetch(this.valList[o])&&(yield[this.keyList[o],this.valList[o]])}*rentries(){for(const o of this.rindexes())this.valList[o]!==void 0&&this.keyList[o]!==void 0&&!this.isBackgroundFetch(this.valList[o])&&(yield[this.keyList[o],this.valList[o]])}*keys(){for(const o of this.indexes())this.keyList[o]!==void 0&&!this.isBackgroundFetch(this.valList[o])&&(yield this.keyList[o])}*rkeys(){for(const o of this.rindexes())this.keyList[o]!==void 0&&!this.isBackgroundFetch(this.valList[o])&&(yield this.keyList[o])}*values(){for(const o of this.indexes())this.valList[o]!==void 0&&!this.isBackgroundFetch(this.valList[o])&&(yield this.valList[o])}*rvalues(){for(const o of this.rindexes())this.valList[o]!==void 0&&!this.isBackgroundFetch(this.valList[o])&&(yield this.valList[o])}[Symbol.iterator](){return this.entries()}find(o,u){for(const D of this.indexes()){const f=this.valList[D],y=this.isBackgroundFetch(f)?f.__staleWhileFetching:f;if(y!==void 0&&o(y,this.keyList[D],this))return this.get(this.keyList[D],u)}}forEach(o,u=this){for(const D of this.indexes()){const f=this.valList[D],y=this.isBackgroundFetch(f)?f.__staleWhileFetching:f;y!==void 0&&o.call(u,y,this.keyList[D],this)}}rforEach(o,u=this){for(const D of this.rindexes()){const f=this.valList[D],y=this.isBackgroundFetch(f)?f.__staleWhileFetching:f;y!==void 0&&o.call(u,y,this.keyList[D],this)}}get prune(){return E("prune","purgeStale"),this.purgeStale}purgeStale(){let o=!1;for(const u of this.rindexes({allowStale:!0}))this.isStale(u)&&(this.delete(this.keyList[u]),o=!0);return o}dump(){const o=[];for(const u of this.indexes({allowStale:!0})){const D=this.keyList[u],f=this.valList[u],y=this.isBackgroundFetch(f)?f.__staleWhileFetching:f;if(y===void 0)continue;const p={value:y};if(this.ttls){p.ttl=this.ttls[u];const S=h.now()-this.starts[u];p.start=Math.floor(Date.now()-S)}this.sizes&&(p.size=this.sizes[u]),o.unshift([D,p])}return o}load(o){this.clear();for(const[u,D]of o){if(D.start){const f=Date.now()-D.start;D.start=h.now()-f}this.set(u,D.value,D)}}dispose(o,u,D){}set(o,u,{ttl:D=this.ttl,start:f,noDisposeOnSet:y=this.noDisposeOnSet,size:p=0,sizeCalculation:S=this.sizeCalculation,noUpdateTTL:R=this.noUpdateTTL,status:N}={}){if(p=this.requireSize(o,u,p,S),this.maxEntrySize&&p>this.maxEntrySize)return N&&(N.set="miss",N.maxEntrySizeExceeded=!0),this.delete(o),this;let U=this.size===0?void 0:this.keyMap.get(o);if(U===void 0)U=this.newIndex(),this.keyList[U]=o,this.valList[U]=u,this.keyMap.set(o,U),this.next[this.tail]=U,this.prev[U]=this.tail,this.tail=U,this.size++,this.addItemSize(U,p,N),N&&(N.set="add"),R=!1;else{this.moveToTail(U);const J=this.valList[U];if(u!==J){if(this.isBackgroundFetch(J)?J.__abortController.abort(new Error("replaced")):y||(this.dispose(J,o,"set"),this.disposeAfter&&this.disposed.push([J,o,"set"])),this.removeItemSize(U),this.valList[U]=u,this.addItemSize(U,p,N),N){N.set="replace";const x=J&&this.isBackgroundFetch(J)?J.__staleWhileFetching:J;x!==void 0&&(N.oldValue=x)}}else N&&(N.set="update")}if(D!==0&&this.ttl===0&&!this.ttls&&this.initializeTTLTracking(),R||this.setItemTTL(U,D,f),this.statusTTL(N,U),this.disposeAfter)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return this}newIndex(){return this.size===0?this.tail:this.size===this.max&&this.max!==0?this.evict(!1):this.free.length!==0?this.free.pop():this.initialFill++}pop(){if(this.size){const o=this.valList[this.head];return this.evict(!0),o}}evict(o){const u=this.head,D=this.keyList[u],f=this.valList[u];return this.isBackgroundFetch(f)?f.__abortController.abort(new Error("evicted")):(this.dispose(f,D,"evict"),this.disposeAfter&&this.disposed.push([f,D,"evict"])),this.removeItemSize(u),o&&(this.keyList[u]=null,this.valList[u]=null,this.free.push(u)),this.head=this.next[u],this.keyMap.delete(D),this.size--,u}has(o,{updateAgeOnHas:u=this.updateAgeOnHas,status:D}={}){const f=this.keyMap.get(o);if(f!==void 0)if(this.isStale(f))D&&(D.has="stale",this.statusTTL(D,f));else return u&&this.updateItemAge(f),D&&(D.has="hit"),this.statusTTL(D,f),!0;else D&&(D.has="miss");return!1}peek(o,{allowStale:u=this.allowStale}={}){const D=this.keyMap.get(o);if(D!==void 0&&(u||!this.isStale(D))){const f=this.valList[D];return this.isBackgroundFetch(f)?f.__staleWhileFetching:f}}backgroundFetch(o,u,D,f){const y=u===void 0?void 0:this.valList[u];if(this.isBackgroundFetch(y))return y;const p=new w;D.signal&&D.signal.addEventListener("abort",()=>p.abort(D.signal.reason));const S={signal:p.signal,options:D,context:f},R=(X,CA=!1)=>{const{aborted:z}=p.signal,_=D.ignoreFetchAbort&&X!==void 0;return D.status&&(z&&!CA?(D.status.fetchAborted=!0,D.status.fetchError=p.signal.reason,_&&(D.status.fetchAbortIgnored=!0)):D.status.fetchResolved=!0),z&&!_&&!CA?U(p.signal.reason):(this.valList[u]===x&&(X===void 0?x.__staleWhileFetching?this.valList[u]=x.__staleWhileFetching:this.delete(o):(D.status&&(D.status.fetchUpdated=!0),this.set(o,X,S.options))),X)},N=X=>(D.status&&(D.status.fetchRejected=!0,D.status.fetchError=X),U(X)),U=X=>{const{aborted:CA}=p.signal,z=CA&&D.allowStaleOnFetchAbort,_=z||D.allowStaleOnFetchRejection,iA=_||D.noDeleteOnFetchRejection;if(this.valList[u]===x&&(!iA||x.__staleWhileFetching===void 0?this.delete(o):z||(this.valList[u]=x.__staleWhileFetching)),_)return D.status&&x.__staleWhileFetching!==void 0&&(D.status.returnedStale=!0),x.__staleWhileFetching;if(x.__returned===x)throw X},J=(X,CA)=>{this.fetchMethod(o,y,S).then(z=>X(z),CA),p.signal.addEventListener("abort",()=>{(!D.ignoreFetchAbort||D.allowStaleOnFetchAbort)&&(X(),D.allowStaleOnFetchAbort&&(X=z=>R(z,!0)))})};D.status&&(D.status.fetchDispatched=!0);const x=new Promise(J).then(R,N);return x.__abortController=p,x.__staleWhileFetching=y,x.__returned=null,u===void 0?(this.set(o,x,{...S.options,status:void 0}),u=this.keyMap.get(o)):this.valList[u]=x,x}isBackgroundFetch(o){return o&&typeof o=="object"&&typeof o.then=="function"&&Object.prototype.hasOwnProperty.call(o,"__staleWhileFetching")&&Object.prototype.hasOwnProperty.call(o,"__returned")&&(o.__returned===o||o.__returned===null)}async fetch(o,{allowStale:u=this.allowStale,updateAgeOnGet:D=this.updateAgeOnGet,noDeleteOnStaleGet:f=this.noDeleteOnStaleGet,ttl:y=this.ttl,noDisposeOnSet:p=this.noDisposeOnSet,size:S=0,sizeCalculation:R=this.sizeCalculation,noUpdateTTL:N=this.noUpdateTTL,noDeleteOnFetchRejection:U=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:J=this.allowStaleOnFetchRejection,ignoreFetchAbort:x=this.ignoreFetchAbort,allowStaleOnFetchAbort:X=this.allowStaleOnFetchAbort,fetchContext:CA=this.fetchContext,forceRefresh:z=!1,status:_,signal:iA}={}){if(!this.fetchMethod)return _&&(_.fetch="get"),this.get(o,{allowStale:u,updateAgeOnGet:D,noDeleteOnStaleGet:f,status:_});const uA={allowStale:u,updateAgeOnGet:D,noDeleteOnStaleGet:f,ttl:y,noDisposeOnSet:p,size:S,sizeCalculation:R,noUpdateTTL:N,noDeleteOnFetchRejection:U,allowStaleOnFetchRejection:J,allowStaleOnFetchAbort:X,ignoreFetchAbort:x,status:_,signal:iA};let DA=this.keyMap.get(o);if(DA===void 0){_&&(_.fetch="miss");const Z=this.backgroundFetch(o,DA,uA,CA);return Z.__returned=Z}else{const Z=this.valList[DA];if(this.isBackgroundFetch(Z)){const FA=u&&Z.__staleWhileFetching!==void 0;return _&&(_.fetch="inflight",FA&&(_.returnedStale=!0)),FA?Z.__staleWhileFetching:Z.__returned=Z}const RA=this.isStale(DA);if(!z&&!RA)return _&&(_.fetch="hit"),this.moveToTail(DA),D&&this.updateItemAge(DA),this.statusTTL(_,DA),Z;const UA=this.backgroundFetch(o,DA,uA,CA),pA=UA.__staleWhileFetching!==void 0,tA=pA&&u;return _&&(_.fetch=pA&&RA?"stale":"refresh",tA&&RA&&(_.returnedStale=!0)),tA?UA.__staleWhileFetching:UA.__returned=UA}}get(o,{allowStale:u=this.allowStale,updateAgeOnGet:D=this.updateAgeOnGet,noDeleteOnStaleGet:f=this.noDeleteOnStaleGet,status:y}={}){const p=this.keyMap.get(o);if(p!==void 0){const S=this.valList[p],R=this.isBackgroundFetch(S);return this.statusTTL(y,p),this.isStale(p)?(y&&(y.get="stale"),R?(y&&(y.returnedStale=u&&S.__staleWhileFetching!==void 0),u?S.__staleWhileFetching:void 0):(f||this.delete(o),y&&(y.returnedStale=u),u?S:void 0)):(y&&(y.get="hit"),R?S.__staleWhileFetching:(this.moveToTail(p),D&&this.updateItemAge(p),S))}else y&&(y.get="miss")}connect(o,u){this.prev[u]=o,this.next[o]=u}moveToTail(o){o!==this.tail&&(o===this.head?this.head=this.next[o]:this.connect(this.prev[o],this.next[o]),this.connect(this.tail,o),this.tail=o)}get del(){return E("del","delete"),this.delete}delete(o){let u=!1;if(this.size!==0){const D=this.keyMap.get(o);if(D!==void 0)if(u=!0,this.size===1)this.clear();else{this.removeItemSize(D);const f=this.valList[D];this.isBackgroundFetch(f)?f.__abortController.abort(new Error("deleted")):(this.dispose(f,o,"delete"),this.disposeAfter&&this.disposed.push([f,o,"delete"])),this.keyMap.delete(o),this.keyList[D]=null,this.valList[D]=null,D===this.tail?this.tail=this.prev[D]:D===this.head?this.head=this.next[D]:(this.next[this.prev[D]]=this.next[D],this.prev[this.next[D]]=this.prev[D]),this.size--,this.free.push(D)}}if(this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return u}clear(){for(const o of this.rindexes({allowStale:!0})){const u=this.valList[o];if(this.isBackgroundFetch(u))u.__abortController.abort(new Error("deleted"));else{const D=this.keyList[o];this.dispose(u,D,"delete"),this.disposeAfter&&this.disposed.push([u,D,"delete"])}}if(this.keyMap.clear(),this.valList.fill(null),this.keyList.fill(null),this.ttls&&(this.ttls.fill(0),this.starts.fill(0)),this.sizes&&this.sizes.fill(0),this.head=0,this.tail=0,this.initialFill=1,this.free.length=0,this.calculatedSize=0,this.size=0,this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift())}get reset(){return E("reset","clear"),this.clear}get length(){return A("length","size"),this.size}static get AbortController(){return w}static get AbortSignal(){return C}}return lI=r,lI}var jA={},vA={},BC;function KQ(){if(BC)return vA;BC=1;var h=vA&&vA.__createBinding||(Object.create?(function(E,A,e,I){I===void 0&&(I=e);var g=Object.getOwnPropertyDescriptor(A,e);(!g||("get"in g?!A.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return A[e]}}),Object.defineProperty(E,I,g)}):(function(E,A,e,I){I===void 0&&(I=e),E[I]=A[e]})),d=vA&&vA.__setModuleDefault||(Object.create?(function(E,A){Object.defineProperty(E,"default",{enumerable:!0,value:A})}):function(E,A){E.default=A}),w=vA&&vA.__importStar||function(E){if(E&&E.__esModule)return E;var A={};if(E!=null)for(var e in E)e!=="default"&&Object.prototype.hasOwnProperty.call(E,e)&&h(A,E,e);return d(A,E),A};Object.defineProperty(vA,"__esModule",{value:!0}),vA.req=vA.json=vA.toBuffer=void 0;const s=w(De),F=w(ce);async function C(E){let A=0;const e=[];for await(const I of E)A+=I.length,e.push(I);return Buffer.concat(e,A)}vA.toBuffer=C;async function n(E){const e=(await C(E)).toString("utf8");try{return JSON.parse(e)}catch(I){const g=I;throw g.message+=` (input: ${e})`,g}}vA.json=n;function c(E,A={}){const I=((typeof E=="string"?E:E.href).startsWith("https:")?F:s).request(E,A),g=new Promise((i,Q)=>{I.once("response",i).once("error",Q).end()});return I.then=g.then.bind(g),I}return vA.req=c,vA}var tC;function he(){return tC||(tC=1,(function(h){var d=jA&&jA.__createBinding||(Object.create?(function(e,I,g,i){i===void 0&&(i=g);var Q=Object.getOwnPropertyDescriptor(I,g);(!Q||("get"in Q?!I.__esModule:Q.writable||Q.configurable))&&(Q={enumerable:!0,get:function(){return I[g]}}),Object.defineProperty(e,i,Q)}):(function(e,I,g,i){i===void 0&&(i=g),e[i]=I[g]})),w=jA&&jA.__setModuleDefault||(Object.create?(function(e,I){Object.defineProperty(e,"default",{enumerable:!0,value:I})}):function(e,I){e.default=I}),s=jA&&jA.__importStar||function(e){if(e&&e.__esModule)return e;var I={};if(e!=null)for(var g in e)g!=="default"&&Object.prototype.hasOwnProperty.call(e,g)&&d(I,e,g);return w(I,e),I},F=jA&&jA.__exportStar||function(e,I){for(var g in e)g!=="default"&&!Object.prototype.hasOwnProperty.call(I,g)&&d(I,e,g)};Object.defineProperty(h,"__esModule",{value:!0}),h.Agent=void 0;const C=s(rA),n=s(De),c=ce;F(KQ(),h);const E=Symbol("AgentBaseInternalState");class A extends n.Agent{constructor(I){super(I),this[E]={}}isSecureEndpoint(I){if(I){if(typeof I.secureEndpoint=="boolean")return I.secureEndpoint;if(typeof I.protocol=="string")return I.protocol==="https:"}const{stack:g}=new Error;return typeof g!="string"?!1:g.split(`
2
2
  `).some(i=>i.indexOf("(https.js:")!==-1||i.indexOf("node:https:")!==-1)}incrementSockets(I){if(this.maxSockets===1/0&&this.maxTotalSockets===1/0)return null;this.sockets[I]||(this.sockets[I]=[]);const g=new C.Socket({writable:!1});return this.sockets[I].push(g),this.totalSocketCount++,g}decrementSockets(I,g){if(!this.sockets[I]||g===null)return;const i=this.sockets[I],Q=i.indexOf(g);Q!==-1&&(i.splice(Q,1),this.totalSocketCount--,i.length===0&&delete this.sockets[I])}getName(I){return this.isSecureEndpoint(I)?c.Agent.prototype.getName.call(this,I):super.getName(I)}createSocket(I,g,i){const Q={...g,secureEndpoint:this.isSecureEndpoint(g)},B=this.getName(Q),t=this.incrementSockets(B);Promise.resolve().then(()=>this.connect(I,Q)).then(r=>{if(this.decrementSockets(B,t),r instanceof n.Agent)try{return r.addRequest(I,Q)}catch(a){return i(a)}this[E].currentSocket=r,super.createSocket(I,g,i)},r=>{this.decrementSockets(B,t),i(r)})}createConnection(){const I=this[E].currentSocket;if(this[E].currentSocket=void 0,!I)throw new Error("No socket was returned in the `connect()` function");return I}get defaultPort(){return this[E].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(I){this[E]&&(this[E].defaultPort=I)}get protocol(){return this[E].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(I){this[E]&&(this[E].protocol=I)}}h.Agent=A})(jA)),jA}var ye={exports:{}},wI,QC;function HQ(){if(QC)return wI;QC=1;var h=1e3,d=h*60,w=d*60,s=w*24,F=s*7,C=s*365.25;wI=function(e,I){I=I||{};var g=typeof e;if(g==="string"&&e.length>0)return n(e);if(g==="number"&&isFinite(e))return I.long?E(e):c(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function n(e){if(e=String(e),!(e.length>100)){var I=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(I){var g=parseFloat(I[1]),i=(I[2]||"ms").toLowerCase();switch(i){case"years":case"year":case"yrs":case"yr":case"y":return g*C;case"weeks":case"week":case"w":return g*F;case"days":case"day":case"d":return g*s;case"hours":case"hour":case"hrs":case"hr":case"h":return g*w;case"minutes":case"minute":case"mins":case"min":case"m":return g*d;case"seconds":case"second":case"secs":case"sec":case"s":return g*h;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return g;default:return}}}}function c(e){var I=Math.abs(e);return I>=s?Math.round(e/s)+"d":I>=w?Math.round(e/w)+"h":I>=d?Math.round(e/d)+"m":I>=h?Math.round(e/h)+"s":e+"ms"}function E(e){var I=Math.abs(e);return I>=s?A(e,I,s,"day"):I>=w?A(e,I,w,"hour"):I>=d?A(e,I,d,"minute"):I>=h?A(e,I,h,"second"):e+" ms"}function A(e,I,g,i){var Q=I>=g*1.5;return Math.round(e/g)+" "+i+(Q?"s":"")}return wI}var fI,iC;function YQ(){if(iC)return fI;iC=1;function h(d){s.debug=s,s.default=s,s.coerce=A,s.disable=c,s.enable=C,s.enabled=E,s.humanize=HQ(),s.destroy=e,Object.keys(d).forEach(I=>{s[I]=d[I]}),s.names=[],s.skips=[],s.formatters={};function w(I){let g=0;for(let i=0;i<I.length;i++)g=(g<<5)-g+I.charCodeAt(i),g|=0;return s.colors[Math.abs(g)%s.colors.length]}s.selectColor=w;function s(I){let g,i=null,Q,B;function t(...r){if(!t.enabled)return;const a=t,o=Number(new Date),u=o-(g||o);a.diff=u,a.prev=g,a.curr=o,g=o,r[0]=s.coerce(r[0]),typeof r[0]!="string"&&r.unshift("%O");let D=0;r[0]=r[0].replace(/%([a-zA-Z%])/g,(y,p)=>{if(y==="%%")return"%";D++;const S=s.formatters[p];if(typeof S=="function"){const R=r[D];y=S.call(a,R),r.splice(D,1),D--}return y}),s.formatArgs.call(a,r),(a.log||s.log).apply(a,r)}return t.namespace=I,t.useColors=s.useColors(),t.color=s.selectColor(I),t.extend=F,t.destroy=s.destroy,Object.defineProperty(t,"enabled",{enumerable:!0,configurable:!1,get:()=>i!==null?i:(Q!==s.namespaces&&(Q=s.namespaces,B=s.enabled(I)),B),set:r=>{i=r}}),typeof s.init=="function"&&s.init(t),t}function F(I,g){const i=s(this.namespace+(typeof g>"u"?":":g)+I);return i.log=this.log,i}function C(I){s.save(I),s.namespaces=I,s.names=[],s.skips=[];const g=(typeof I=="string"?I:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const i of g)i[0]==="-"?s.skips.push(i.slice(1)):s.names.push(i)}function n(I,g){let i=0,Q=0,B=-1,t=0;for(;i<I.length;)if(Q<g.length&&(g[Q]===I[i]||g[Q]==="*"))g[Q]==="*"?(B=Q,t=i,Q++):(i++,Q++);else if(B!==-1)Q=B+1,t++,i=t;else return!1;for(;Q<g.length&&g[Q]==="*";)Q++;return Q===g.length}function c(){const I=[...s.names,...s.skips.map(g=>"-"+g)].join(",");return s.enable(""),I}function E(I){for(const g of s.skips)if(n(I,g))return!1;for(const g of s.names)if(n(I,g))return!0;return!1}function A(I){return I instanceof Error?I.stack||I.message:I}function e(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return s.enable(s.load()),s}return fI=h,fI}var EC;function vQ(){return EC||(EC=1,(function(h,d){var w={};d.formatArgs=F,d.save=C,d.load=n,d.useColors=s,d.storage=c(),d.destroy=(()=>{let A=!1;return()=>{A||(A=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),d.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function s(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let A;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(A=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(A[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function F(A){if(A[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+A[0]+(this.useColors?"%c ":" ")+"+"+h.exports.humanize(this.diff),!this.useColors)return;const e="color: "+this.color;A.splice(1,0,e,"color: inherit");let I=0,g=0;A[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(I++,i==="%c"&&(g=I))}),A.splice(g,0,e)}d.log=console.debug||console.log||(()=>{});function C(A){try{A?d.storage.setItem("debug",A):d.storage.removeItem("debug")}catch{}}function n(){let A;try{A=d.storage.getItem("debug")||d.storage.getItem("DEBUG")}catch{}return!A&&typeof process<"u"&&"env"in process&&(A=w.DEBUG),A}function c(){try{return localStorage}catch{}}h.exports=YQ()(d);const{formatters:E}=h.exports;E.j=function(A){try{return JSON.stringify(A)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}})(ye,ye.exports)),ye.exports}var dI={},rC;function bQ(){if(rC)return dI;rC=1;var h={},d=rA.parse,w={ftp:21,gopher:70,http:80,https:443,ws:80,wss:443},s=String.prototype.endsWith||function(c){return c.length<=this.length&&this.indexOf(c,this.length-c.length)!==-1};function F(c){var E=typeof c=="string"?d(c):c||{},A=E.protocol,e=E.host,I=E.port;if(typeof e!="string"||!e||typeof A!="string"||(A=A.split(":",1)[0],e=e.replace(/:\d*$/,""),I=parseInt(I)||w[A]||0,!C(e,I)))return"";var g=n("npm_config_"+A+"_proxy")||n(A+"_proxy")||n("npm_config_proxy")||n("all_proxy");return g&&g.indexOf("://")===-1&&(g=A+"://"+g),g}function C(c,E){var A=(n("npm_config_no_proxy")||n("no_proxy")).toLowerCase();return A?A==="*"?!1:A.split(/[,\s]/).every(function(e){if(!e)return!0;var I=e.match(/^(.+):(\d+)$/),g=I?I[1]:e,i=I?parseInt(I[2]):0;return i&&i!==E?!0:/^[.*]/.test(g)?(g.charAt(0)==="*"&&(g=g.slice(1)),!s.call(c,g)):c!==g}):!0}function n(c){return h[c.toLowerCase()]||h[c.toUpperCase()]||""}return dI.getProxyForUrl=F,dI}var PA={},pe={exports:{}},FI,sC;function xQ(){if(sC)return FI;sC=1;var h=1e3,d=h*60,w=d*60,s=w*24,F=s*7,C=s*365.25;FI=function(e,I){I=I||{};var g=typeof e;if(g==="string"&&e.length>0)return n(e);if(g==="number"&&isFinite(e))return I.long?E(e):c(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function n(e){if(e=String(e),!(e.length>100)){var I=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(I){var g=parseFloat(I[1]),i=(I[2]||"ms").toLowerCase();switch(i){case"years":case"year":case"yrs":case"yr":case"y":return g*C;case"weeks":case"week":case"w":return g*F;case"days":case"day":case"d":return g*s;case"hours":case"hour":case"hrs":case"hr":case"h":return g*w;case"minutes":case"minute":case"mins":case"min":case"m":return g*d;case"seconds":case"second":case"secs":case"sec":case"s":return g*h;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return g;default:return}}}}function c(e){var I=Math.abs(e);return I>=s?Math.round(e/s)+"d":I>=w?Math.round(e/w)+"h":I>=d?Math.round(e/d)+"m":I>=h?Math.round(e/h)+"s":e+"ms"}function E(e){var I=Math.abs(e);return I>=s?A(e,I,s,"day"):I>=w?A(e,I,w,"hour"):I>=d?A(e,I,d,"minute"):I>=h?A(e,I,h,"second"):e+" ms"}function A(e,I,g,i){var Q=I>=g*1.5;return Math.round(e/g)+" "+i+(Q?"s":"")}return FI}var yI,nC;function TQ(){if(nC)return yI;nC=1;function h(d){s.debug=s,s.default=s,s.coerce=A,s.disable=c,s.enable=C,s.enabled=E,s.humanize=xQ(),s.destroy=e,Object.keys(d).forEach(I=>{s[I]=d[I]}),s.names=[],s.skips=[],s.formatters={};function w(I){let g=0;for(let i=0;i<I.length;i++)g=(g<<5)-g+I.charCodeAt(i),g|=0;return s.colors[Math.abs(g)%s.colors.length]}s.selectColor=w;function s(I){let g,i=null,Q,B;function t(...r){if(!t.enabled)return;const a=t,o=Number(new Date),u=o-(g||o);a.diff=u,a.prev=g,a.curr=o,g=o,r[0]=s.coerce(r[0]),typeof r[0]!="string"&&r.unshift("%O");let D=0;r[0]=r[0].replace(/%([a-zA-Z%])/g,(y,p)=>{if(y==="%%")return"%";D++;const S=s.formatters[p];if(typeof S=="function"){const R=r[D];y=S.call(a,R),r.splice(D,1),D--}return y}),s.formatArgs.call(a,r),(a.log||s.log).apply(a,r)}return t.namespace=I,t.useColors=s.useColors(),t.color=s.selectColor(I),t.extend=F,t.destroy=s.destroy,Object.defineProperty(t,"enabled",{enumerable:!0,configurable:!1,get:()=>i!==null?i:(Q!==s.namespaces&&(Q=s.namespaces,B=s.enabled(I)),B),set:r=>{i=r}}),typeof s.init=="function"&&s.init(t),t}function F(I,g){const i=s(this.namespace+(typeof g>"u"?":":g)+I);return i.log=this.log,i}function C(I){s.save(I),s.namespaces=I,s.names=[],s.skips=[];const g=(typeof I=="string"?I:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const i of g)i[0]==="-"?s.skips.push(i.slice(1)):s.names.push(i)}function n(I,g){let i=0,Q=0,B=-1,t=0;for(;i<I.length;)if(Q<g.length&&(g[Q]===I[i]||g[Q]==="*"))g[Q]==="*"?(B=Q,t=i,Q++):(i++,Q++);else if(B!==-1)Q=B+1,t++,i=t;else return!1;for(;Q<g.length&&g[Q]==="*";)Q++;return Q===g.length}function c(){const I=[...s.names,...s.skips.map(g=>"-"+g)].join(",");return s.enable(""),I}function E(I){for(const g of s.skips)if(n(I,g))return!1;for(const g of s.names)if(n(I,g))return!0;return!1}function A(I){return I instanceof Error?I.stack||I.message:I}function e(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return s.enable(s.load()),s}return yI=h,yI}var oC;function PQ(){return oC||(oC=1,(function(h,d){var w={};d.formatArgs=F,d.save=C,d.load=n,d.useColors=s,d.storage=c(),d.destroy=(()=>{let A=!1;return()=>{A||(A=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),d.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function s(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let A;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(A=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(A[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function F(A){if(A[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+A[0]+(this.useColors?"%c ":" ")+"+"+h.exports.humanize(this.diff),!this.useColors)return;const e="color: "+this.color;A.splice(1,0,e,"color: inherit");let I=0,g=0;A[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(I++,i==="%c"&&(g=I))}),A.splice(g,0,e)}d.log=console.debug||console.log||(()=>{});function C(A){try{A?d.storage.setItem("debug",A):d.storage.removeItem("debug")}catch{}}function n(){let A;try{A=d.storage.getItem("debug")||d.storage.getItem("DEBUG")}catch{}return!A&&typeof process<"u"&&"env"in process&&(A=w.DEBUG),A}function c(){try{return localStorage}catch{}}h.exports=TQ()(d);const{formatters:E}=h.exports;E.j=function(A){try{return JSON.stringify(A)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}})(pe,pe.exports)),pe.exports}var Se={exports:{}},aC;function uI(){if(aC)return Se.exports;aC=1;var h=typeof Reflect=="object"?Reflect:null,d=h&&typeof h.apply=="function"?h.apply:function(D,f,y){return Function.prototype.apply.call(D,f,y)},w;h&&typeof h.ownKeys=="function"?w=h.ownKeys:Object.getOwnPropertySymbols?w=function(D){return Object.getOwnPropertyNames(D).concat(Object.getOwnPropertySymbols(D))}:w=function(D){return Object.getOwnPropertyNames(D)};function s(u){console&&console.warn&&console.warn(u)}var F=Number.isNaN||function(D){return D!==D};function C(){C.init.call(this)}Se.exports=C,Se.exports.once=r,C.EventEmitter=C,C.prototype._events=void 0,C.prototype._eventsCount=0,C.prototype._maxListeners=void 0;var n=10;function c(u){if(typeof u!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof u)}Object.defineProperty(C,"defaultMaxListeners",{enumerable:!0,get:function(){return n},set:function(u){if(typeof u!="number"||u<0||F(u))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+u+".");n=u}}),C.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},C.prototype.setMaxListeners=function(D){if(typeof D!="number"||D<0||F(D))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+D+".");return this._maxListeners=D,this};function E(u){return u._maxListeners===void 0?C.defaultMaxListeners:u._maxListeners}C.prototype.getMaxListeners=function(){return E(this)},C.prototype.emit=function(D){for(var f=[],y=1;y<arguments.length;y++)f.push(arguments[y]);var p=D==="error",S=this._events;if(S!==void 0)p=p&&S.error===void 0;else if(!p)return!1;if(p){var R;if(f.length>0&&(R=f[0]),R instanceof Error)throw R;var N=new Error("Unhandled error."+(R?" ("+R.message+")":""));throw N.context=R,N}var U=S[D];if(U===void 0)return!1;if(typeof U=="function")d(U,this,f);else for(var J=U.length,x=Q(U,J),y=0;y<J;++y)d(x[y],this,f);return!0};function A(u,D,f,y){var p,S,R;if(c(f),S=u._events,S===void 0?(S=u._events=Object.create(null),u._eventsCount=0):(S.newListener!==void 0&&(u.emit("newListener",D,f.listener?f.listener:f),S=u._events),R=S[D]),R===void 0)R=S[D]=f,++u._eventsCount;else if(typeof R=="function"?R=S[D]=y?[f,R]:[R,f]:y?R.unshift(f):R.push(f),p=E(u),p>0&&R.length>p&&!R.warned){R.warned=!0;var N=new Error("Possible EventEmitter memory leak detected. "+R.length+" "+String(D)+" listeners added. Use emitter.setMaxListeners() to increase limit");N.name="MaxListenersExceededWarning",N.emitter=u,N.type=D,N.count=R.length,s(N)}return u}C.prototype.addListener=function(D,f){return A(this,D,f,!1)},C.prototype.on=C.prototype.addListener,C.prototype.prependListener=function(D,f){return A(this,D,f,!0)};function e(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function I(u,D,f){var y={fired:!1,wrapFn:void 0,target:u,type:D,listener:f},p=e.bind(y);return p.listener=f,y.wrapFn=p,p}C.prototype.once=function(D,f){return c(f),this.on(D,I(this,D,f)),this},C.prototype.prependOnceListener=function(D,f){return c(f),this.prependListener(D,I(this,D,f)),this},C.prototype.removeListener=function(D,f){var y,p,S,R,N;if(c(f),p=this._events,p===void 0)return this;if(y=p[D],y===void 0)return this;if(y===f||y.listener===f)--this._eventsCount===0?this._events=Object.create(null):(delete p[D],p.removeListener&&this.emit("removeListener",D,y.listener||f));else if(typeof y!="function"){for(S=-1,R=y.length-1;R>=0;R--)if(y[R]===f||y[R].listener===f){N=y[R].listener,S=R;break}if(S<0)return this;S===0?y.shift():B(y,S),y.length===1&&(p[D]=y[0]),p.removeListener!==void 0&&this.emit("removeListener",D,N||f)}return this},C.prototype.off=C.prototype.removeListener,C.prototype.removeAllListeners=function(D){var f,y,p;if(y=this._events,y===void 0)return this;if(y.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):y[D]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete y[D]),this;if(arguments.length===0){var S=Object.keys(y),R;for(p=0;p<S.length;++p)R=S[p],R!=="removeListener"&&this.removeAllListeners(R);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(f=y[D],typeof f=="function")this.removeListener(D,f);else if(f!==void 0)for(p=f.length-1;p>=0;p--)this.removeListener(D,f[p]);return this};function g(u,D,f){var y=u._events;if(y===void 0)return[];var p=y[D];return p===void 0?[]:typeof p=="function"?f?[p.listener||p]:[p]:f?t(p):Q(p,p.length)}C.prototype.listeners=function(D){return g(this,D,!0)},C.prototype.rawListeners=function(D){return g(this,D,!1)},C.listenerCount=function(u,D){return typeof u.listenerCount=="function"?u.listenerCount(D):i.call(u,D)},C.prototype.listenerCount=i;function i(u){var D=this._events;if(D!==void 0){var f=D[u];if(typeof f=="function")return 1;if(f!==void 0)return f.length}return 0}C.prototype.eventNames=function(){return this._eventsCount>0?w(this._events):[]};function Q(u,D){for(var f=new Array(D),y=0;y<D;++y)f[y]=u[y];return f}function B(u,D){for(;D+1<u.length;D++)u[D]=u[D+1];u.pop()}function t(u){for(var D=new Array(u.length),f=0;f<D.length;++f)D[f]=u[f].listener||u[f];return D}function r(u,D){return new Promise(function(f,y){function p(R){u.removeListener(D,S),y(R)}function S(){typeof u.removeListener=="function"&&u.removeListener("error",p),f([].slice.call(arguments))}o(u,D,S,{once:!0}),D!=="error"&&a(u,p,{once:!0})})}function a(u,D,f){typeof u.on=="function"&&o(u,"error",D,f)}function o(u,D,f,y){if(typeof u.on=="function")y.once?u.once(D,f):u.on(D,f);else if(typeof u.addEventListener=="function")u.addEventListener(D,function p(S){y.once&&u.removeEventListener(D,p),f(S)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof u)}return Se.exports}var uC;function Vt(){if(uC)return PA;uC=1;var h=PA&&PA.__createBinding||(Object.create?(function(i,Q,B,t){t===void 0&&(t=B);var r=Object.getOwnPropertyDescriptor(Q,B);(!r||("get"in r?!Q.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return Q[B]}}),Object.defineProperty(i,t,r)}):(function(i,Q,B,t){t===void 0&&(t=B),i[t]=Q[B]})),d=PA&&PA.__setModuleDefault||(Object.create?(function(i,Q){Object.defineProperty(i,"default",{enumerable:!0,value:Q})}):function(i,Q){i.default=Q}),w=PA&&PA.__importStar||function(i){if(i&&i.__esModule)return i;var Q={};if(i!=null)for(var B in i)B!=="default"&&Object.prototype.hasOwnProperty.call(i,B)&&h(Q,i,B);return d(Q,i),Q},s=PA&&PA.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(PA,"__esModule",{value:!0}),PA.HttpProxyAgent=void 0;const F=w(rA),C=w(rA),n=s(PQ()),c=uI(),E=he(),A=rA,e=(0,n.default)("http-proxy-agent");class I extends E.Agent{constructor(Q,B){super(B),this.proxy=typeof Q=="string"?new A.URL(Q):Q,this.proxyHeaders=B?.headers??{},e("Creating new HttpProxyAgent instance: %o",this.proxy.href);const t=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),r=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={...B?g(B,"headers"):null,host:t,port:r}}addRequest(Q,B){Q._header=null,this.setRequestProps(Q,B),super.addRequest(Q,B)}setRequestProps(Q,B){const{proxy:t}=this,r=B.secureEndpoint?"https:":"http:",a=Q.getHeader("host")||"localhost",o=`${r}//${a}`,u=new A.URL(Q.path,o);B.port!==80&&(u.port=String(B.port)),Q.path=String(u);const D=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders};if(t.username||t.password){const f=`${decodeURIComponent(t.username)}:${decodeURIComponent(t.password)}`;D["Proxy-Authorization"]=`Basic ${Buffer.from(f).toString("base64")}`}D["Proxy-Connection"]||(D["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(const f of Object.keys(D)){const y=D[f];y&&Q.setHeader(f,y)}}async connect(Q,B){Q._header=null,Q.path.includes("://")||this.setRequestProps(Q,B);let t,r;e("Regenerating stored HTTP header string for request"),Q._implicitHeader(),Q.outputData&&Q.outputData.length>0&&(e("Patching connection write() output buffer with updated header"),t=Q.outputData[0].data,r=t.indexOf(`\r
3
3
  \r
4
4
  `)+4,Q.outputData[0].data=Q._header+t.substring(r),e("Output buffer: %o",Q.outputData[0].data));let a;return this.proxy.protocol==="https:"?(e("Creating `tls.Socket`: %o",this.connectOpts),a=C.connect(this.connectOpts)):(e("Creating `net.Socket`: %o",this.connectOpts),a=F.connect(this.connectOpts)),await(0,c.once)(a,"connect"),a}}I.protocols=["http","https"],PA.HttpProxyAgent=I;function g(i,...Q){const B={};let t;for(t in i)Q.includes(t)||(B[t]=i[t]);return B}return PA}var qA={},Re={exports:{}},pI,DC;function qQ(){if(DC)return pI;DC=1;var h=1e3,d=h*60,w=d*60,s=w*24,F=s*7,C=s*365.25;pI=function(e,I){I=I||{};var g=typeof e;if(g==="string"&&e.length>0)return n(e);if(g==="number"&&isFinite(e))return I.long?E(e):c(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function n(e){if(e=String(e),!(e.length>100)){var I=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(I){var g=parseFloat(I[1]),i=(I[2]||"ms").toLowerCase();switch(i){case"years":case"year":case"yrs":case"yr":case"y":return g*C;case"weeks":case"week":case"w":return g*F;case"days":case"day":case"d":return g*s;case"hours":case"hour":case"hrs":case"hr":case"h":return g*w;case"minutes":case"minute":case"mins":case"min":case"m":return g*d;case"seconds":case"second":case"secs":case"sec":case"s":return g*h;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return g;default:return}}}}function c(e){var I=Math.abs(e);return I>=s?Math.round(e/s)+"d":I>=w?Math.round(e/w)+"h":I>=d?Math.round(e/d)+"m":I>=h?Math.round(e/h)+"s":e+"ms"}function E(e){var I=Math.abs(e);return I>=s?A(e,I,s,"day"):I>=w?A(e,I,w,"hour"):I>=d?A(e,I,d,"minute"):I>=h?A(e,I,h,"second"):e+" ms"}function A(e,I,g,i){var Q=I>=g*1.5;return Math.round(e/g)+" "+i+(Q?"s":"")}return pI}var SI,cC;function OQ(){if(cC)return SI;cC=1;function h(d){s.debug=s,s.default=s,s.coerce=A,s.disable=c,s.enable=C,s.enabled=E,s.humanize=qQ(),s.destroy=e,Object.keys(d).forEach(I=>{s[I]=d[I]}),s.names=[],s.skips=[],s.formatters={};function w(I){let g=0;for(let i=0;i<I.length;i++)g=(g<<5)-g+I.charCodeAt(i),g|=0;return s.colors[Math.abs(g)%s.colors.length]}s.selectColor=w;function s(I){let g,i=null,Q,B;function t(...r){if(!t.enabled)return;const a=t,o=Number(new Date),u=o-(g||o);a.diff=u,a.prev=g,a.curr=o,g=o,r[0]=s.coerce(r[0]),typeof r[0]!="string"&&r.unshift("%O");let D=0;r[0]=r[0].replace(/%([a-zA-Z%])/g,(y,p)=>{if(y==="%%")return"%";D++;const S=s.formatters[p];if(typeof S=="function"){const R=r[D];y=S.call(a,R),r.splice(D,1),D--}return y}),s.formatArgs.call(a,r),(a.log||s.log).apply(a,r)}return t.namespace=I,t.useColors=s.useColors(),t.color=s.selectColor(I),t.extend=F,t.destroy=s.destroy,Object.defineProperty(t,"enabled",{enumerable:!0,configurable:!1,get:()=>i!==null?i:(Q!==s.namespaces&&(Q=s.namespaces,B=s.enabled(I)),B),set:r=>{i=r}}),typeof s.init=="function"&&s.init(t),t}function F(I,g){const i=s(this.namespace+(typeof g>"u"?":":g)+I);return i.log=this.log,i}function C(I){s.save(I),s.namespaces=I,s.names=[],s.skips=[];const g=(typeof I=="string"?I:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const i of g)i[0]==="-"?s.skips.push(i.slice(1)):s.names.push(i)}function n(I,g){let i=0,Q=0,B=-1,t=0;for(;i<I.length;)if(Q<g.length&&(g[Q]===I[i]||g[Q]==="*"))g[Q]==="*"?(B=Q,t=i,Q++):(i++,Q++);else if(B!==-1)Q=B+1,t++,i=t;else return!1;for(;Q<g.length&&g[Q]==="*";)Q++;return Q===g.length}function c(){const I=[...s.names,...s.skips.map(g=>"-"+g)].join(",");return s.enable(""),I}function E(I){for(const g of s.skips)if(n(I,g))return!1;for(const g of s.names)if(n(I,g))return!0;return!1}function A(I){return I instanceof Error?I.stack||I.message:I}function e(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return s.enable(s.load()),s}return SI=h,SI}var hC;function Zt(){return hC||(hC=1,(function(h,d){var w={};d.formatArgs=F,d.save=C,d.load=n,d.useColors=s,d.storage=c(),d.destroy=(()=>{let A=!1;return()=>{A||(A=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),d.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function s(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let A;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(A=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(A[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function F(A){if(A[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+A[0]+(this.useColors?"%c ":" ")+"+"+h.exports.humanize(this.diff),!this.useColors)return;const e="color: "+this.color;A.splice(1,0,e,"color: inherit");let I=0,g=0;A[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(I++,i==="%c"&&(g=I))}),A.splice(g,0,e)}d.log=console.debug||console.log||(()=>{});function C(A){try{A?d.storage.setItem("debug",A):d.storage.removeItem("debug")}catch{}}function n(){let A;try{A=d.storage.getItem("debug")||d.storage.getItem("DEBUG")}catch{}return!A&&typeof process<"u"&&"env"in process&&(A=w.DEBUG),A}function c(){try{return localStorage}catch{}}h.exports=OQ()(d);const{formatters:E}=h.exports;E.j=function(A){try{return JSON.stringify(A)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}})(Re,Re.exports)),Re.exports}var cg={},lC;function WQ(){if(lC)return cg;lC=1;var h=cg&&cg.__importDefault||function(F){return F&&F.__esModule?F:{default:F}};Object.defineProperty(cg,"__esModule",{value:!0}),cg.parseProxyResponse=void 0;const w=(0,h(Zt()).default)("https-proxy-agent:parse-proxy-response");function s(F){return new Promise((C,n)=>{let c=0;const E=[];function A(){const Q=F.read();Q?i(Q):F.once("readable",A)}function e(){F.removeListener("end",I),F.removeListener("error",g),F.removeListener("readable",A)}function I(){e(),w("onend"),n(new Error("Proxy connection ended before receiving CONNECT response"))}function g(Q){e(),w("onerror %o",Q),n(Q)}function i(Q){E.push(Q),c+=Q.length;const B=Buffer.concat(E,c),t=B.indexOf(`\r