UNPKG

chromatic

Version:

Automate visual testing across browsers. Gather UI feedback. Versioned documentation.

58 lines 129 kB
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="135a90dc-036e-5be6-bc12-c43c90f42397")}catch(e){}}();
const e=require(`./chunk-gGpyby2o.cjs`),t=require(`./meow-CbdXCBsh.cjs`);let n=require(`fs`);n=e.a(n,1);let r=require(`path`);r=e.a(r,1);let i=require(`os`);i=e.a(i,1);let a=require(`tty`);a=e.a(a,1);let o=require(`events`);o=e.a(o,1);let s=require(`child_process`);s=e.a(s,1);let c=require(`node:util`),l=require(`node:child_process`);l=e.a(l,1);let u=require(`node:fs`);u=e.a(u,1);let d=require(`node:os`);d=e.a(d,1);let f=require(`node:path`);f=e.a(f,1);let p=require(`node:process`);p=e.a(p,1);let m=require(`node:fs/promises`);m=e.a(m,1);let h=require(`node:url`);h=e.a(h,1);let g=require(`node:buffer`),_=require(`node:timers/promises`),v=require(`stream`);v=e.a(v,1);let y=require(`fs/promises`);y=e.a(y,1);let ee=require(`readline`);ee=e.a(ee,1);const te=e=>e instanceof URL?(0,h.fileURLToPath)(e):e;async function b(e,{cwd:t=p.default.cwd(),type:n=`file`,stopAt:r}={}){let i=f.default.resolve(te(t)??``),{root:a}=f.default.parse(i);r=f.default.resolve(i,te(r??a));let o=f.default.isAbsolute(e);for(;i;){let t=o?e:f.default.join(i,e);try{let e=await m.default.stat(t);if(n===`file`&&e.isFile()||n===`directory`&&e.isDirectory())return t}catch{}if(i===r||i===a)break;i=f.default.dirname(i)}}var ne=t.d();const re=({oneBased:e,oneBasedLine:t=e,oneBasedColumn:n=e}={})=>[+!!t,+!!n];function ie(e,t,n){let r=t===0?-1:e.lastIndexOf(`
`,t-1),[i,a]=re(n);return{line:r===-1?i:e.slice(0,r+1).match(/\n/g).length+i,column:t-r-1+a}}function ae(e,t,n){if(typeof e!=`string`)throw TypeError(`Text parameter should be a string`);if(!Number.isInteger(t))throw TypeError(`Index parameter should be an integer`);if(t<0||t>e.length)throw RangeError(`Index out of bounds`);return ie(e,t,n)}const oe=e=>`\\u{${e.codePointAt(0).toString(16)}}`;var se=class e extends Error{name=`JSONError`;fileName;#e;#t;#n;#r;#i;constructor(t){if(typeof t==`string`)super(),this.#n=t;else{let{jsonParseError:e,fileName:n,input:r}=t;super(void 0,{cause:e}),this.#e=r,this.#t=e,this.fileName=n}Error.captureStackTrace?.(this,e)}get message(){this.#n??=`${le(this.#t.message)}${this.#e===``?` while parsing empty string`:``}`;let{codeFrame:e}=this;return`${this.#n}${this.fileName?` in ${this.fileName}`:``}${e?`\n\n${e}\n`:``}`}set message(e){this.#n=e}#a(e){if(!this.#t)return;let t=this.#e,n=ce(t,this.#t.message);if(n)return(0,ne.codeFrameColumns)(t,{start:n},{highlightCode:e})}get codeFrame(){return this.#r??=this.#a(!0),this.#r}get rawCodeFrame(){return this.#i??=this.#a(!1),this.#i}};const ce=(e,t)=>{let n=t.match(/in JSON at position (?<index>\d+)(?: \(line (?<line>\d+) column (?<column>\d+)\))?$/);if(!n)return;let{index:r,line:i,column:a}=n.groups;return i&&a?{line:Number(i),column:Number(a)}:ae(e,Number(r),{oneBased:!0})},le=e=>e.replace(/(?<=^Unexpected token )(?<quote>')?(.)\k<quote>/,(e,t,n)=>`"${n}"(${oe(n)})`);function ue(e,t,n){typeof t==`string`&&(n=t,t=void 0);try{return JSON.parse(e,t)}catch(t){throw new se({jsonParseError:t,fileName:n,input:e})}}var de=e.t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.LRUCache=void 0;let t=typeof performance==`object`&&performance&&typeof performance.now==`function`?performance:Date,n=new Set,r=typeof process==`object`&&process?process:{},i=(e,t,n,i)=>{typeof r.emitWarning==`function`?r.emitWarning(e,t,n,i):console.error(`[${n}] ${t}: ${e}`)},a=globalThis.AbortController,o=globalThis.AbortSignal;if(a===void 0){o=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(e,t){this._onabort.push(t)}},a=class{constructor(){t()}signal=new o;abort(e){if(!this.signal.aborted){this.signal.reason=e,this.signal.aborted=!0;for(let t of this.signal._onabort)t(e);this.signal.onabort?.(e)}}};let e=r.env?.LRU_CACHE_IGNORE_AC_WARNING!==`1`,t=()=>{e&&(e=!1,i("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.",`NO_ABORT_CONTROLLER`,`ENOTSUP`,t))}}let s=e=>!n.has(e),c=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),l=e=>c(e)?e<=2**8?Uint8Array:e<=2**16?Uint16Array:e<=2**32?Uint32Array:e<=2**53-1?u:null:null;var u=class extends Array{constructor(e){super(e),this.fill(0)}},d=class e{heap;length;static#e=!1;static create(t){let n=l(t);if(!n)return[];e.#e=!0;let r=new e(t,n);return e.#e=!1,r}constructor(t,n){if(!e.#e)throw TypeError(`instantiate Stack using Stack.create(n)`);this.heap=new n(t),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}};e.LRUCache=class e{#e;#t;#n;#r;#i;#a;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#o;#s;#c;#l;#u;#d;#f;#p;#m;#h;#g;#_;#v;#y;#b;#x;#S;static unsafeExposeInternals(e){return{starts:e.#v,ttls:e.#y,sizes:e.#_,keyMap:e.#c,keyList:e.#l,valList:e.#u,next:e.#d,prev:e.#f,get head(){return e.#p},get tail(){return e.#m},free:e.#h,isBackgroundFetch:t=>e.#L(t),backgroundFetch:(t,n,r,i)=>e.#I(t,n,r,i),moveToTail:t=>e.#z(t),indexes:t=>e.#M(t),rindexes:t=>e.#N(t),isStale:t=>e.#D(t)}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#s}get size(){return this.#o}get fetchMethod(){return this.#i}get memoMethod(){return this.#a}get dispose(){return this.#n}get disposeAfter(){return this.#r}constructor(t){let{max:r=0,ttl:a,ttlResolution:o=1,ttlAutopurge:u,updateAgeOnGet:f,updateAgeOnHas:p,allowStale:m,dispose:h,disposeAfter:g,noDisposeOnSet:_,noUpdateTTL:v,maxSize:y=0,maxEntrySize:ee=0,sizeCalculation:te,fetchMethod:b,memoMethod:ne,noDeleteOnFetchRejection:re,noDeleteOnStaleGet:ie,allowStaleOnFetchRejection:ae,allowStaleOnFetchAbort:oe,ignoreFetchAbort:se}=t;if(r!==0&&!c(r))throw TypeError(`max option must be a nonnegative integer`);let ce=r?l(r):Array;if(!ce)throw Error(`invalid max value: `+r);if(this.#e=r,this.#t=y,this.maxEntrySize=ee||this.#t,this.sizeCalculation=te,this.sizeCalculation){if(!this.#t&&!this.maxEntrySize)throw TypeError(`cannot set sizeCalculation without setting maxSize or maxEntrySize`);if(typeof this.sizeCalculation!=`function`)throw TypeError(`sizeCalculation set to non-function`)}if(ne!==void 0&&typeof ne!=`function`)throw TypeError(`memoMethod must be a function if defined`);if(this.#a=ne,b!==void 0&&typeof b!=`function`)throw TypeError(`fetchMethod must be a function if specified`);if(this.#i=b,this.#x=!!b,this.#c=new Map,this.#l=Array(r).fill(void 0),this.#u=Array(r).fill(void 0),this.#d=new ce(r),this.#f=new ce(r),this.#p=0,this.#m=0,this.#h=d.create(r),this.#o=0,this.#s=0,typeof h==`function`&&(this.#n=h),typeof g==`function`?(this.#r=g,this.#g=[]):(this.#r=void 0,this.#g=void 0),this.#b=!!this.#n,this.#S=!!this.#r,this.noDisposeOnSet=!!_,this.noUpdateTTL=!!v,this.noDeleteOnFetchRejection=!!re,this.allowStaleOnFetchRejection=!!ae,this.allowStaleOnFetchAbort=!!oe,this.ignoreFetchAbort=!!se,this.maxEntrySize!==0){if(this.#t!==0&&!c(this.#t))throw TypeError(`maxSize must be a positive integer if specified`);if(!c(this.maxEntrySize))throw TypeError(`maxEntrySize must be a positive integer if specified`);this.#O()}if(this.allowStale=!!m,this.noDeleteOnStaleGet=!!ie,this.updateAgeOnGet=!!f,this.updateAgeOnHas=!!p,this.ttlResolution=c(o)||o===0?o:1,this.ttlAutopurge=!!u,this.ttl=a||0,this.ttl){if(!c(this.ttl))throw TypeError(`ttl must be a positive integer if specified`);this.#C()}if(this.#e===0&&this.ttl===0&&this.#t===0)throw TypeError(`At least one of max, maxSize, or ttl is required`);if(!this.ttlAutopurge&&!this.#e&&!this.#t){let t=`LRU_CACHE_UNBOUNDED`;s(t)&&(n.add(t),i(`TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.`,`UnboundedCacheWarning`,t,e))}}getRemainingTTL(e){return this.#c.has(e)?1/0:0}#C(){let e=new u(this.#e),n=new u(this.#e);this.#y=e,this.#v=n,this.#E=(r,i,a=t.now())=>{if(n[r]=i===0?0:a,e[r]=i,i!==0&&this.ttlAutopurge){let e=setTimeout(()=>{this.#D(r)&&this.#B(this.#l[r],`expire`)},i+1);e.unref&&e.unref()}},this.#w=r=>{n[r]=e[r]===0?0:t.now()},this.#T=(t,a)=>{if(e[a]){let o=e[a],s=n[a];if(!o||!s)return;t.ttl=o,t.start=s,t.now=r||i(),t.remainingTTL=o-(t.now-s)}};let r=0,i=()=>{let e=t.now();if(this.ttlResolution>0){r=e;let t=setTimeout(()=>r=0,this.ttlResolution);t.unref&&t.unref()}return e};this.getRemainingTTL=t=>{let a=this.#c.get(t);if(a===void 0)return 0;let o=e[a],s=n[a];return!o||!s?1/0:o-((r||i())-s)},this.#D=t=>{let a=n[t],o=e[t];return!!o&&!!a&&(r||i())-a>o}}#w=()=>{};#T=()=>{};#E=()=>{};#D=()=>!1;#O(){let e=new u(this.#e);this.#s=0,this.#_=e,this.#k=t=>{this.#s-=e[t],e[t]=0},this.#j=(e,t,n,r)=>{if(this.#L(t))return 0;if(!c(n))if(r){if(typeof r!=`function`)throw TypeError(`sizeCalculation must be a function`);if(n=r(t,e),!c(n))throw TypeError(`sizeCalculation return invalid (expect positive integer)`)}else throw TypeError(`invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.`);return n},this.#A=(t,n,r)=>{if(e[t]=n,this.#t){let n=this.#t-e[t];for(;this.#s>n;)this.#F(!0)}this.#s+=e[t],r&&(r.entrySize=n,r.totalCalculatedSize=this.#s)}}#k=e=>{};#A=(e,t,n)=>{};#j=(e,t,n,r)=>{if(n||r)throw TypeError(`cannot set size without setting maxSize or maxEntrySize on cache`);return 0};*#M({allowStale:e=this.allowStale}={}){if(this.#o)for(let t=this.#m;!(!this.#P(t)||((e||!this.#D(t))&&(yield t),t===this.#p));)t=this.#f[t]}*#N({allowStale:e=this.allowStale}={}){if(this.#o)for(let t=this.#p;!(!this.#P(t)||((e||!this.#D(t))&&(yield t),t===this.#m));)t=this.#d[t]}#P(e){return e!==void 0&&this.#c.get(this.#l[e])===e}*entries(){for(let e of this.#M())this.#u[e]!==void 0&&this.#l[e]!==void 0&&!this.#L(this.#u[e])&&(yield[this.#l[e],this.#u[e]])}*rentries(){for(let e of this.#N())this.#u[e]!==void 0&&this.#l[e]!==void 0&&!this.#L(this.#u[e])&&(yield[this.#l[e],this.#u[e]])}*keys(){for(let e of this.#M()){let t=this.#l[e];t!==void 0&&!this.#L(this.#u[e])&&(yield t)}}*rkeys(){for(let e of this.#N()){let t=this.#l[e];t!==void 0&&!this.#L(this.#u[e])&&(yield t)}}*values(){for(let e of this.#M())this.#u[e]!==void 0&&!this.#L(this.#u[e])&&(yield this.#u[e])}*rvalues(){for(let e of this.#N())this.#u[e]!==void 0&&!this.#L(this.#u[e])&&(yield this.#u[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]=`LRUCache`;find(e,t={}){for(let n of this.#M()){let r=this.#u[n],i=this.#L(r)?r.__staleWhileFetching:r;if(i!==void 0&&e(i,this.#l[n],this))return this.get(this.#l[n],t)}}forEach(e,t=this){for(let n of this.#M()){let r=this.#u[n],i=this.#L(r)?r.__staleWhileFetching:r;i!==void 0&&e.call(t,i,this.#l[n],this)}}rforEach(e,t=this){for(let n of this.#N()){let r=this.#u[n],i=this.#L(r)?r.__staleWhileFetching:r;i!==void 0&&e.call(t,i,this.#l[n],this)}}purgeStale(){let e=!1;for(let t of this.#N({allowStale:!0}))this.#D(t)&&(this.#B(this.#l[t],`expire`),e=!0);return e}info(e){let n=this.#c.get(e);if(n===void 0)return;let r=this.#u[n],i=this.#L(r)?r.__staleWhileFetching:r;if(i===void 0)return;let a={value:i};if(this.#y&&this.#v){let e=this.#y[n],r=this.#v[n];e&&r&&(a.ttl=e-(t.now()-r),a.start=Date.now())}return this.#_&&(a.size=this.#_[n]),a}dump(){let e=[];for(let n of this.#M({allowStale:!0})){let r=this.#l[n],i=this.#u[n],a=this.#L(i)?i.__staleWhileFetching:i;if(a===void 0||r===void 0)continue;let o={value:a};if(this.#y&&this.#v){o.ttl=this.#y[n];let e=t.now()-this.#v[n];o.start=Math.floor(Date.now()-e)}this.#_&&(o.size=this.#_[n]),e.unshift([r,o])}return e}load(e){this.clear();for(let[n,r]of e){if(r.start){let e=Date.now()-r.start;r.start=t.now()-e}this.set(n,r.value,r)}}set(e,t,n={}){if(t===void 0)return this.delete(e),this;let{ttl:r=this.ttl,start:i,noDisposeOnSet:a=this.noDisposeOnSet,sizeCalculation:o=this.sizeCalculation,status:s}=n,{noUpdateTTL:c=this.noUpdateTTL}=n,l=this.#j(e,t,n.size||0,o);if(this.maxEntrySize&&l>this.maxEntrySize)return s&&(s.set=`miss`,s.maxEntrySizeExceeded=!0),this.#B(e,`set`),this;let u=this.#o===0?void 0:this.#c.get(e);if(u===void 0)u=this.#o===0?this.#m:this.#h.length===0?this.#o===this.#e?this.#F(!1):this.#o:this.#h.pop(),this.#l[u]=e,this.#u[u]=t,this.#c.set(e,u),this.#d[this.#m]=u,this.#f[u]=this.#m,this.#m=u,this.#o++,this.#A(u,l,s),s&&(s.set=`add`),c=!1;else{this.#z(u);let n=this.#u[u];if(t!==n){if(this.#x&&this.#L(n)){n.__abortController.abort(Error(`replaced`));let{__staleWhileFetching:t}=n;t!==void 0&&!a&&(this.#b&&this.#n?.(t,e,`set`),this.#S&&this.#g?.push([t,e,`set`]))}else a||(this.#b&&this.#n?.(n,e,`set`),this.#S&&this.#g?.push([n,e,`set`]));if(this.#k(u),this.#A(u,l,s),this.#u[u]=t,s){s.set=`replace`;let e=n&&this.#L(n)?n.__staleWhileFetching:n;e!==void 0&&(s.oldValue=e)}}else s&&(s.set=`update`)}if(r!==0&&!this.#y&&this.#C(),this.#y&&(c||this.#E(u,r,i),s&&this.#T(s,u)),!a&&this.#S&&this.#g){let e=this.#g,t;for(;t=e?.shift();)this.#r?.(...t)}return this}pop(){try{for(;this.#o;){let e=this.#u[this.#p];if(this.#F(!0),this.#L(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#S&&this.#g){let e=this.#g,t;for(;t=e?.shift();)this.#r?.(...t)}}}#F(e){let t=this.#p,n=this.#l[t],r=this.#u[t];return this.#x&&this.#L(r)?r.__abortController.abort(Error(`evicted`)):(this.#b||this.#S)&&(this.#b&&this.#n?.(r,n,`evict`),this.#S&&this.#g?.push([r,n,`evict`])),this.#k(t),e&&(this.#l[t]=void 0,this.#u[t]=void 0,this.#h.push(t)),this.#o===1?(this.#p=this.#m=0,this.#h.length=0):this.#p=this.#d[t],this.#c.delete(n),this.#o--,t}has(e,t={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:r}=t,i=this.#c.get(e);if(i!==void 0){let e=this.#u[i];if(this.#L(e)&&e.__staleWhileFetching===void 0)return!1;if(this.#D(i))r&&(r.has=`stale`,this.#T(r,i));else return n&&this.#w(i),r&&(r.has=`hit`,this.#T(r,i)),!0}else r&&(r.has=`miss`);return!1}peek(e,t={}){let{allowStale:n=this.allowStale}=t,r=this.#c.get(e);if(r===void 0||!n&&this.#D(r))return;let i=this.#u[r];return this.#L(i)?i.__staleWhileFetching:i}#I(e,t,n,r){let i=t===void 0?void 0:this.#u[t];if(this.#L(i))return i;let o=new a,{signal:s}=n;s?.addEventListener(`abort`,()=>o.abort(s.reason),{signal:o.signal});let c={signal:o.signal,options:n,context:r},l=(r,i=!1)=>{let{aborted:a}=o.signal,s=n.ignoreFetchAbort&&r!==void 0;if(n.status&&(a&&!i?(n.status.fetchAborted=!0,n.status.fetchError=o.signal.reason,s&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),a&&!s&&!i)return d(o.signal.reason);let l=p;return this.#u[t]===p&&(r===void 0?l.__staleWhileFetching?this.#u[t]=l.__staleWhileFetching:this.#B(e,`fetch`):(n.status&&(n.status.fetchUpdated=!0),this.set(e,r,c.options))),r},u=e=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=e),d(e)),d=r=>{let{aborted:i}=o.signal,a=i&&n.allowStaleOnFetchAbort,s=a||n.allowStaleOnFetchRejection,c=s||n.noDeleteOnFetchRejection,l=p;if(this.#u[t]===p&&(!c||l.__staleWhileFetching===void 0?this.#B(e,`fetch`):a||(this.#u[t]=l.__staleWhileFetching)),s)return n.status&&l.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),l.__staleWhileFetching;if(l.__returned===l)throw r},f=(t,r)=>{let a=this.#i?.(e,i,c);a&&a instanceof Promise&&a.then(e=>t(e===void 0?void 0:e),r),o.signal.addEventListener(`abort`,()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(t(void 0),n.allowStaleOnFetchAbort&&(t=e=>l(e,!0)))})};n.status&&(n.status.fetchDispatched=!0);let p=new Promise(f).then(l,u),m=Object.assign(p,{__abortController:o,__staleWhileFetching:i,__returned:void 0});return t===void 0?(this.set(e,m,{...c.options,status:void 0}),t=this.#c.get(e)):this.#u[t]=m,m}#L(e){if(!this.#x)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty(`__staleWhileFetching`)&&t.__abortController instanceof a}async fetch(e,t={}){let{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,ttl:a=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:s=0,sizeCalculation:c=this.sizeCalculation,noUpdateTTL:l=this.noUpdateTTL,noDeleteOnFetchRejection:u=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:d=this.allowStaleOnFetchRejection,ignoreFetchAbort:f=this.ignoreFetchAbort,allowStaleOnFetchAbort:p=this.allowStaleOnFetchAbort,context:m,forceRefresh:h=!1,status:g,signal:_}=t;if(!this.#x)return g&&(g.fetch=`get`),this.get(e,{allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:i,status:g});let v={allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:i,ttl:a,noDisposeOnSet:o,size:s,sizeCalculation:c,noUpdateTTL:l,noDeleteOnFetchRejection:u,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:p,ignoreFetchAbort:f,status:g,signal:_},y=this.#c.get(e);if(y===void 0){g&&(g.fetch=`miss`);let t=this.#I(e,y,v,m);return t.__returned=t}else{let t=this.#u[y];if(this.#L(t)){let e=n&&t.__staleWhileFetching!==void 0;return g&&(g.fetch=`inflight`,e&&(g.returnedStale=!0)),e?t.__staleWhileFetching:t.__returned=t}let i=this.#D(y);if(!h&&!i)return g&&(g.fetch=`hit`),this.#z(y),r&&this.#w(y),g&&this.#T(g,y),t;let a=this.#I(e,y,v,m),o=a.__staleWhileFetching!==void 0&&n;return g&&(g.fetch=i?`stale`:`refresh`,o&&i&&(g.returnedStale=!0)),o?a.__staleWhileFetching:a.__returned=a}}async forceFetch(e,t={}){let n=await this.fetch(e,t);if(n===void 0)throw Error(`fetch() returned undefined`);return n}memo(e,t={}){let n=this.#a;if(!n)throw Error(`no memoMethod provided to constructor`);let{context:r,forceRefresh:i,...a}=t,o=this.get(e,a);if(!i&&o!==void 0)return o;let s=n(e,o,{options:a,context:r});return this.set(e,s,a),s}get(e,t={}){let{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,status:a}=t,o=this.#c.get(e);if(o!==void 0){let t=this.#u[o],s=this.#L(t);return a&&this.#T(a,o),this.#D(o)?(a&&(a.get=`stale`),s?(a&&n&&t.__staleWhileFetching!==void 0&&(a.returnedStale=!0),n?t.__staleWhileFetching:void 0):(i||this.#B(e,`expire`),a&&n&&(a.returnedStale=!0),n?t:void 0)):(a&&(a.get=`hit`),s?t.__staleWhileFetching:(this.#z(o),r&&this.#w(o),t))}else a&&(a.get=`miss`)}#R(e,t){this.#f[t]=e,this.#d[e]=t}#z(e){e!==this.#m&&(e===this.#p?this.#p=this.#d[e]:this.#R(this.#f[e],this.#d[e]),this.#R(this.#m,e),this.#m=e)}delete(e){return this.#B(e,`delete`)}#B(e,t){let n=!1;if(this.#o!==0){let r=this.#c.get(e);if(r!==void 0)if(n=!0,this.#o===1)this.#V(t);else{this.#k(r);let n=this.#u[r];if(this.#L(n)?n.__abortController.abort(Error(`deleted`)):(this.#b||this.#S)&&(this.#b&&this.#n?.(n,e,t),this.#S&&this.#g?.push([n,e,t])),this.#c.delete(e),this.#l[r]=void 0,this.#u[r]=void 0,r===this.#m)this.#m=this.#f[r];else if(r===this.#p)this.#p=this.#d[r];else{let e=this.#f[r];this.#d[e]=this.#d[r];let t=this.#d[r];this.#f[t]=this.#f[r]}this.#o--,this.#h.push(r)}}if(this.#S&&this.#g?.length){let e=this.#g,t;for(;t=e?.shift();)this.#r?.(...t)}return n}clear(){return this.#V(`delete`)}#V(e){for(let t of this.#N({allowStale:!0})){let n=this.#u[t];if(this.#L(n))n.__abortController.abort(Error(`deleted`));else{let r=this.#l[t];this.#b&&this.#n?.(n,r,e),this.#S&&this.#g?.push([n,r,e])}}if(this.#c.clear(),this.#u.fill(void 0),this.#l.fill(void 0),this.#y&&this.#v&&(this.#y.fill(0),this.#v.fill(0)),this.#_&&this.#_.fill(0),this.#p=0,this.#m=0,this.#h.length=0,this.#s=0,this.#o=0,this.#S&&this.#g){let e=this.#g,t;for(;t=e?.shift();)this.#r?.(...t)}}}})),fe=e.t(((e,t)=>{let n=(...e)=>e.every(e=>e)?e.join(``):``,r=e=>e?encodeURIComponent(e):``,i=e=>e.toLowerCase().replace(/^\W+|\/|\W+$/g,``).replace(/\W+/g,`-`),a={sshtemplate:({domain:e,user:t,project:r,committish:i})=>`git@${e}:${t}/${r}.git${n(`#`,i)}`,sshurltemplate:({domain:e,user:t,project:r,committish:i})=>`git+ssh://git@${e}/${t}/${r}.git${n(`#`,i)}`,edittemplate:({domain:e,user:t,project:i,committish:a,editpath:o,path:s})=>`https://${e}/${t}/${i}${n(`/`,o,`/`,r(a||`HEAD`),`/`,s)}`,browsetemplate:({domain:e,user:t,project:i,committish:a,treepath:o})=>`https://${e}/${t}/${i}${n(`/`,o,`/`,r(a))}`,browsetreetemplate:({domain:e,user:t,project:i,committish:a,treepath:o,path:s,fragment:c,hashformat:l})=>`https://${e}/${t}/${i}/${o}/${r(a||`HEAD`)}/${s}${n(`#`,l(c||``))}`,browseblobtemplate:({domain:e,user:t,project:i,committish:a,blobpath:o,path:s,fragment:c,hashformat:l})=>`https://${e}/${t}/${i}/${o}/${r(a||`HEAD`)}/${s}${n(`#`,l(c||``))}`,docstemplate:({domain:e,user:t,project:i,treepath:a,committish:o})=>`https://${e}/${t}/${i}${n(`/`,a,`/`,r(o))}#readme`,httpstemplate:({auth:e,domain:t,user:r,project:i,committish:a})=>`git+https://${n(e,`@`)}${t}/${r}/${i}.git${n(`#`,a)}`,filetemplate:({domain:e,user:t,project:n,committish:i,path:a})=>`https://${e}/${t}/${n}/raw/${r(i||`HEAD`)}/${a}`,shortcuttemplate:({type:e,user:t,project:r,committish:i})=>`${e}:${t}/${r}${n(`#`,i)}`,pathtemplate:({user:e,project:t,committish:r})=>`${e}/${t}${n(`#`,r)}`,bugstemplate:({domain:e,user:t,project:n})=>`https://${e}/${t}/${n}/issues`,hashformat:i},o={};o.github={protocols:[`git:`,`http:`,`git+ssh:`,`git+https:`,`ssh:`,`https:`],domain:`github.com`,treepath:`tree`,blobpath:`blob`,editpath:`edit`,filetemplate:({auth:e,user:t,project:i,committish:a,path:o})=>`https://${n(e,`@`)}raw.githubusercontent.com/${t}/${i}/${r(a||`HEAD`)}/${o}`,gittemplate:({auth:e,domain:t,user:r,project:i,committish:a})=>`git://${n(e,`@`)}${t}/${r}/${i}.git${n(`#`,a)}`,tarballtemplate:({domain:e,user:t,project:n,committish:i})=>`https://codeload.${e}/${t}/${n}/tar.gz/${r(i||`HEAD`)}`,extract:e=>{let[,t,n,r,i]=e.pathname.split(`/`,5);if(!(r&&r!==`tree`)&&(r||(i=e.hash.slice(1)),n&&n.endsWith(`.git`)&&(n=n.slice(0,-4)),!(!t||!n)))return{user:t,project:n,committish:i}}},o.bitbucket={protocols:[`git+ssh:`,`git+https:`,`ssh:`,`https:`],domain:`bitbucket.org`,treepath:`src`,blobpath:`src`,editpath:`?mode=edit`,edittemplate:({domain:e,user:t,project:i,committish:a,treepath:o,path:s,editpath:c})=>`https://${e}/${t}/${i}${n(`/`,o,`/`,r(a||`HEAD`),`/`,s,c)}`,tarballtemplate:({domain:e,user:t,project:n,committish:i})=>`https://${e}/${t}/${n}/get/${r(i||`HEAD`)}.tar.gz`,extract:e=>{let[,t,n,r]=e.pathname.split(`/`,4);if(![`get`].includes(r)&&(n&&n.endsWith(`.git`)&&(n=n.slice(0,-4)),!(!t||!n)))return{user:t,project:n,committish:e.hash.slice(1)}}},o.gitlab={protocols:[`git+ssh:`,`git+https:`,`ssh:`,`https:`],domain:`gitlab.com`,treepath:`tree`,blobpath:`tree`,editpath:`-/edit`,httpstemplate:({auth:e,domain:t,user:r,project:i,committish:a})=>`git+https://${n(e,`@`)}${t}/${r}/${i}.git${n(`#`,a)}`,tarballtemplate:({domain:e,user:t,project:n,committish:i})=>`https://${e}/${t}/${n}/repository/archive.tar.gz?ref=${r(i||`HEAD`)}`,extract:e=>{let t=e.pathname.slice(1);if(t.includes(`/-/`)||t.includes(`/archive.tar.gz`))return;let n=t.split(`/`),r=n.pop();r.endsWith(`.git`)&&(r=r.slice(0,-4));let i=n.join(`/`);if(!(!i||!r))return{user:i,project:r,committish:e.hash.slice(1)}}},o.gist={protocols:[`git:`,`git+ssh:`,`git+https:`,`ssh:`,`https:`],domain:`gist.github.com`,editpath:`edit`,sshtemplate:({domain:e,project:t,committish:r})=>`git@${e}:${t}.git${n(`#`,r)}`,sshurltemplate:({domain:e,project:t,committish:r})=>`git+ssh://git@${e}/${t}.git${n(`#`,r)}`,edittemplate:({domain:e,user:t,project:i,committish:a,editpath:o})=>`https://${e}/${t}/${i}${n(`/`,r(a))}/${o}`,browsetemplate:({domain:e,project:t,committish:i})=>`https://${e}/${t}${n(`/`,r(i))}`,browsetreetemplate:({domain:e,project:t,committish:i,path:a,hashformat:o})=>`https://${e}/${t}${n(`/`,r(i))}${n(`#`,o(a))}`,browseblobtemplate:({domain:e,project:t,committish:i,path:a,hashformat:o})=>`https://${e}/${t}${n(`/`,r(i))}${n(`#`,o(a))}`,docstemplate:({domain:e,project:t,committish:i})=>`https://${e}/${t}${n(`/`,r(i))}`,httpstemplate:({domain:e,project:t,committish:r})=>`git+https://${e}/${t}.git${n(`#`,r)}`,filetemplate:({user:e,project:t,committish:i,path:a})=>`https://gist.githubusercontent.com/${e}/${t}/raw${n(`/`,r(i))}/${a}`,shortcuttemplate:({type:e,project:t,committish:r})=>`${e}:${t}${n(`#`,r)}`,pathtemplate:({project:e,committish:t})=>`${e}${n(`#`,t)}`,bugstemplate:({domain:e,project:t})=>`https://${e}/${t}`,gittemplate:({domain:e,project:t,committish:r})=>`git://${e}/${t}.git${n(`#`,r)}`,tarballtemplate:({project:e,committish:t})=>`https://codeload.github.com/gist/${e}/tar.gz/${r(t||`HEAD`)}`,extract:e=>{let[,t,n,r]=e.pathname.split(`/`,4);if(r!==`raw`){if(!n){if(!t)return;n=t,t=null}return n.endsWith(`.git`)&&(n=n.slice(0,-4)),{user:t,project:n,committish:e.hash.slice(1)}}},hashformat:function(e){return e&&`file-`+i(e)}},o.sourcehut={protocols:[`git+ssh:`,`https:`],domain:`git.sr.ht`,treepath:`tree`,blobpath:`tree`,filetemplate:({domain:e,user:t,project:n,committish:i,path:a})=>`https://${e}/${t}/${n}/blob/${r(i)||`HEAD`}/${a}`,httpstemplate:({domain:e,user:t,project:r,committish:i})=>`https://${e}/${t}/${r}.git${n(`#`,i)}`,tarballtemplate:({domain:e,user:t,project:n,committish:i})=>`https://${e}/${t}/${n}/archive/${r(i)||`HEAD`}.tar.gz`,bugstemplate:()=>null,extract:e=>{let[,t,n,r]=e.pathname.split(`/`,4);if(![`archive`].includes(r)&&(n&&n.endsWith(`.git`)&&(n=n.slice(0,-4)),!(!t||!n)))return{user:t,project:n,committish:e.hash.slice(1)}}};for(let[e,t]of Object.entries(o))o[e]=Object.assign({},a,t);t.exports=o})),pe=e.t(((e,t)=>{let n=require(`url`),r=(e,t,n)=>{let r=e.indexOf(n);return e.lastIndexOf(t,r>-1?r:1/0)},i=e=>{try{return new n.URL(e)}catch{}},a=(e,t)=>{let n=e.indexOf(`:`),r=e.slice(0,n+1);if(Object.prototype.hasOwnProperty.call(t,r))return e;let i=e.indexOf(`@`);return i>-1?i>n?`git+ssh://${e}`:e:e.indexOf(`//`)===n+1?e:`${e.slice(0,n+1)}//${e.slice(n+1)}`},o=e=>{let t=r(e,`@`,`#`),n=r(e,`:`,`#`);return n>t&&(e=e.slice(0,n)+`/`+e.slice(n+1)),r(e,`:`,`#`)===-1&&e.indexOf(`//`)===-1&&(e=`git+ssh://${e}`),e};t.exports=(e,t)=>{let n=t?a(e,t):e;return i(n)||i(o(n))}})),me=e.t(((e,t)=>{let n=pe(),r=e=>{let t=e.indexOf(`#`),n=e.indexOf(`/`),r=e.indexOf(`/`,n+1),i=e.indexOf(`:`),a=/\s/.exec(e),o=e.indexOf(`@`),s=!a||t>-1&&a.index>t,c=o===-1||t>-1&&o>t,l=i===-1||t>-1&&i>t,u=r===-1||t>-1&&r>t,d=n>0,f=t>-1?e[t-1]!==`/`:!e.endsWith(`/`),p=!e.startsWith(`.`);return s&&d&&f&&p&&c&&l&&u};t.exports=(e,t,{gitHosts:i,protocols:a})=>{if(!e)return;let o=n(r(e)?`github:${e}`:e,a);if(!o)return;let s=i.byShortcut[o.protocol],c=i.byDomain[o.hostname.startsWith(`www.`)?o.hostname.slice(4):o.hostname],l=s||c;if(!l)return;let u=i[s||c],d=null;a[o.protocol]?.auth&&(o.username||o.password)&&(d=`${o.username}${o.password?`:`+o.password:``}`);let f=null,p=null,m=null,h=null;try{if(s){let e=o.pathname.startsWith(`/`)?o.pathname.slice(1):o.pathname,t=e.indexOf(`@`);t>-1&&(e=e.slice(t+1));let n=e.lastIndexOf(`/`);n>-1?(p=decodeURIComponent(e.slice(0,n)),p||=null,m=decodeURIComponent(e.slice(n+1))):m=decodeURIComponent(e),m.endsWith(`.git`)&&(m=m.slice(0,-4)),o.hash&&(f=decodeURIComponent(o.hash.slice(1))),h=`shortcut`}else{if(!u.protocols.includes(o.protocol))return;let e=u.extract(o);if(!e)return;p=e.user&&decodeURIComponent(e.user),m=decodeURIComponent(e.project),f=decodeURIComponent(e.committish),h=a[o.protocol]?.name||o.protocol.slice(0,-1)}}catch(e){if(e instanceof URIError)return;throw e}return[l,p,d,m,f,h,t]}})),he=e.t(((e,t)=>{let{LRUCache:n}=de(),r=fe(),i=me(),a=pe(),o=new n({max:1e3});var s=class e{constructor(t,n,r,i,a,o,s={}){Object.assign(this,e.#e[t],{type:t,user:n,auth:r,project:i,committish:a,default:o,opts:s})}static#e={byShortcut:{},byDomain:{}};static#t={"git+ssh:":{name:`sshurl`},"ssh:":{name:`sshurl`},"git+https:":{name:`https`,auth:!0},"git:":{auth:!0},"http:":{auth:!0},"https:":{auth:!0},"git+http:":{auth:!0}};static addHost(t,n){e.#e[t]=n,e.#e.byDomain[n.domain]=t,e.#e.byShortcut[`${t}:`]=t,e.#t[`${t}:`]={name:t}}static fromUrl(t,n){if(typeof t!=`string`)return;let r=t+JSON.stringify(n||{});if(!o.has(r)){let a=i(t,n,{gitHosts:e.#e,protocols:e.#t});o.set(r,a?new e(...a):void 0)}return o.get(r)}static parseUrl(e){return a(e)}#n(e,t){if(typeof e!=`function`)return null;let n={...this,...this.opts,...t};n.path||=``,n.path.startsWith(`/`)&&(n.path=n.path.slice(1)),n.noCommittish&&(n.committish=null);let r=e(n);return n.noGitPlus&&r.startsWith(`git+`)?r.slice(4):r}hash(){return this.committish?`#${this.committish}`:``}ssh(e){return this.#n(this.sshtemplate,e)}sshurl(e){return this.#n(this.sshurltemplate,e)}browse(e,...t){return typeof e==`string`?typeof t[0]==`string`?this.#n(this.browsetreetemplate,{...t[1],fragment:t[0],path:e}):this.#n(this.browsetreetemplate,{...t[0],path:e}):this.#n(this.browsetemplate,e)}browseFile(e,...t){return typeof t[0]==`string`?this.#n(this.browseblobtemplate,{...t[1],fragment:t[0],path:e}):this.#n(this.browseblobtemplate,{...t[0],path:e})}docs(e){return this.#n(this.docstemplate,e)}bugs(e){return this.#n(this.bugstemplate,e)}https(e){return this.#n(this.httpstemplate,e)}git(e){return this.#n(this.gittemplate,e)}shortcut(e){return this.#n(this.shortcuttemplate,e)}path(e){return this.#n(this.pathtemplate,e)}tarball(e){return this.#n(this.tarballtemplate,{...e,noCommittish:!1})}file(e,t){return this.#n(this.filetemplate,{...t,path:e})}edit(e,t){return this.#n(this.edittemplate,{...t,path:e})}getDefaultRepresentation(){return this.default}toString(e){return this.default&&typeof this[this.default]==`function`?this[this.default](e):this.sshurl(e)}};for(let[e,t]of Object.entries(r))s.addHost(e,t);t.exports=s})),ge=e.t(((e,t)=>{t.exports=n;function n(e){if(!e||e===`ERROR: No README data found!`)return;e=e.trim().split(`
`);let t=0;for(;e[t]&&e[t].trim().match(/^(#|$)/);)t++;let n=e.length,r=t+1;for(;r<n&&e[r].trim();)r++;return e.slice(t,r).join(` `).trim()}})),_e=e.t(((e,t)=>{t.exports={topLevel:{dependancies:`dependencies`,dependecies:`dependencies`,depdenencies:`dependencies`,devEependencies:`devDependencies`,depends:`dependencies`,"dev-dependencies":`devDependencies`,devDependences:`devDependencies`,devDepenencies:`devDependencies`,devdependencies:`devDependencies`,repostitory:`repository`,repo:`repository`,prefereGlobal:`preferGlobal`,hompage:`homepage`,hampage:`homepage`,autohr:`author`,autor:`author`,contributers:`contributors`,publicationConfig:`publishConfig`,script:`scripts`},bugs:{web:`url`,name:`url`},script:{server:`start`,tests:`test`}}})),ve=e.t(((e,n)=>{var r=require(`semver/functions/valid.js`),i=require(`semver/functions/clean.js`),a=t.u(),o=he(),s=require(`node:module`),c=[`dependencies`,`devDependencies`,`optionalDependencies`],l=ge(),u=require(`url`),d=_e(),f=e=>e.includes(`@`)&&e.indexOf(`@`)<e.lastIndexOf(`.`);n.exports={warn:function(){},fixRepositoryField:function(e){if(e.repositories&&(this.warn(`repositories`),e.repository=e.repositories[0]),!e.repository)return this.warn(`missingRepository`);typeof e.repository==`string`&&(e.repository={type:`git`,url:e.repository});var t=e.repository.url||``;if(t){var n=o.fromUrl(t);n&&(t=e.repository.url=n.getDefaultRepresentation()===`shortcut`?n.https():n.toString())}t.match(/github.com\/[^/]+\/[^/]+\.git\.git$/)&&this.warn(`brokenGitUrl`,t)},fixTypos:function(e){Object.keys(d.topLevel).forEach(function(t){Object.prototype.hasOwnProperty.call(e,t)&&this.warn(`typo`,t,d.topLevel[t])},this)},fixScriptsField:function(e){if(e.scripts){if(typeof e.scripts!=`object`){this.warn(`nonObjectScripts`),delete e.scripts;return}Object.keys(e.scripts).forEach(function(t){typeof e.scripts[t]==`string`?d.script[t]&&!e.scripts[d.script[t]]&&this.warn(`typo`,t,d.script[t],`scripts`):(this.warn(`nonStringScript`),delete e.scripts[t])},this)}},fixFilesField:function(e){var t=e.files;t&&!Array.isArray(t)?(this.warn(`nonArrayFiles`),delete e.files):e.files&&=e.files.filter(function(e){return!e||typeof e!=`string`?(this.warn(`invalidFilename`,e),!1):!0},this)},fixBinField:function(e){if(e.bin&&typeof e.bin==`string`){var t={},n;(n=e.name.match(/^@[^/]+[/](.*)$/))?t[n[1]]=e.bin:t[e.name]=e.bin,e.bin=t}},fixManField:function(e){e.man&&typeof e.man==`string`&&(e.man=[e.man])},fixBundleDependenciesField:function(e){var t=`bundledDependencies`,n=`bundleDependencies`;e[t]&&!e[n]&&(e[n]=e[t],delete e[t]),e[n]&&!Array.isArray(e[n])?(this.warn(`nonArrayBundleDependencies`),delete e[n]):e[n]&&(e[n]=e[n].filter(function(t){return!t||typeof t!=`string`?(this.warn(`nonStringBundleDependency`,t),!1):(e.dependencies||={},Object.prototype.hasOwnProperty.call(e.dependencies,t)||(this.warn(`nonDependencyBundleDependency`,t),e.dependencies[t]=`*`),!0)},this))},fixDependencies:function(e){te(e,this.warn),y(e,this.warn),this.fixBundleDependenciesField(e),[`dependencies`,`devDependencies`].forEach(function(t){if(t in e){if(!e[t]||typeof e[t]!=`object`){this.warn(`nonObjectDependencies`,t),delete e[t];return}Object.keys(e[t]).forEach(function(n){var r=e[t][n];typeof r!=`string`&&(this.warn(`nonStringDependency`,n,JSON.stringify(r)),delete e[t][n]);var i=o.fromUrl(e[t][n]);i&&(e[t][n]=i.toString())},this)}},this)},fixModulesField:function(e){e.modules&&(this.warn(`deprecatedModules`),delete e.modules)},fixKeywordsField:function(e){typeof e.keywords==`string`&&(e.keywords=e.keywords.split(/,\s+/)),e.keywords&&!Array.isArray(e.keywords)?(delete e.keywords,this.warn(`nonArrayKeywords`)):e.keywords&&=e.keywords.filter(function(e){return typeof e!=`string`||!e?(this.warn(`nonStringKeyword`),!1):!0},this)},fixVersionField:function(e,t){var n=!t;if(!e.version)return e.version=``,!0;if(!r(e.version,n))throw Error(`Invalid version: "`+e.version+`"`);return e.version=i(e.version,n),!0},fixPeople:function(e){g(e,_),g(e,v)},fixNameField:function(e,t){typeof t==`boolean`?t={strict:t}:t===void 0&&(t={});var n=t.strict;if(!e.name&&!n){e.name=``;return}if(typeof e.name!=`string`)throw Error(`name field must be a string.`);n||(e.name=e.name.trim()),h(e.name,n,t.allowLegacyCase),s.builtinModules.includes(e.name)&&this.warn(`conflictingName`,e.name)},fixDescriptionField:function(e){e.description&&typeof e.description!=`string`&&(this.warn(`nonStringDescription`),delete e.description),e.readme&&!e.description&&(e.description=l(e.readme)),e.description===void 0&&delete e.description,e.description||this.warn(`missingDescription`)},fixReadmeField:function(e){e.readme||=(this.warn(`missingReadme`),`ERROR: No README data found!`)},fixBugsField:function(e){if(!e.bugs&&e.repository&&e.repository.url){var t=o.fromUrl(e.repository.url);t&&t.bugs()&&(e.bugs={url:t.bugs()})}else if(e.bugs){if(typeof e.bugs==`string`)f(e.bugs)?e.bugs={email:e.bugs}:u.parse(e.bugs).protocol?e.bugs={url:e.bugs}:this.warn(`nonEmailUrlBugsString`);else{b(e.bugs,this.warn);var n=e.bugs;e.bugs={},n.url&&(typeof n.url==`string`&&u.parse(n.url).protocol?e.bugs.url=n.url:this.warn(`nonUrlBugsUrlField`)),n.email&&(typeof n.email==`string`&&f(n.email)?e.bugs.email=n.email:this.warn(`nonEmailBugsEmailField`))}!e.bugs.email&&!e.bugs.url&&(delete e.bugs,this.warn(`emptyNormalizedBugs`))}},fixHomepageField:function(e){if(!e.homepage&&e.repository&&e.repository.url){var t=o.fromUrl(e.repository.url);t&&t.docs()&&(e.homepage=t.docs())}if(e.homepage){if(typeof e.homepage!=`string`)return this.warn(`nonUrlHomepage`),delete e.homepage;u.parse(e.homepage).protocol||(e.homepage=`http://`+e.homepage)}},fixLicenseField:function(e){let t=e.license||e.licence;if(!t)return this.warn(`missingLicense`);if(typeof t!=`string`||t.length<1||t.trim()===``||!a(t).validForNewPackages)return this.warn(`invalidLicense`)}};function p(e){if(e.charAt(0)!==`@`)return!1;var t=e.slice(1).split(`/`);return t.length===2?t[0]&&t[1]&&t[0]===encodeURIComponent(t[0])&&t[1]===encodeURIComponent(t[1]):!1}function m(e){return!e.match(/[/@\s+%:]/)&&e===encodeURIComponent(e)}function h(e,t,n){if(e.charAt(0)===`.`||!(p(e)||m(e))||t&&!n&&e!==e.toLowerCase()||e.toLowerCase()===`node_modules`||e.toLowerCase()===`favicon.ico`)throw Error(`Invalid name: `+JSON.stringify(e))}function g(e,t){return e.author&&=t(e.author),[`maintainers`,`contributors`].forEach(function(n){Array.isArray(e[n])&&(e[n]=e[n].map(t))}),e}function _(e){if(typeof e==`string`)return e;var t=e.name||``,n=e.url||e.web,r=n?` (`+n+`)`:``,i=e.email||e.mail;return t+(i?` <`+i+`>`:``)+r}function v(e){if(typeof e!=`string`)return e;var t=e.match(/^([^(<]+)/),n=e.match(/\(([^()]+)\)/),r=e.match(/<([^<>]+)>/),i={};return t&&t[0].trim()&&(i.name=t[0].trim()),r&&(i.email=r[1]),n&&(i.url=n[1]),i}function y(e){var t=e.optionalDependencies;if(t){var n=e.dependencies||{};Object.keys(t).forEach(function(e){n[e]=t[e]}),e.dependencies=n}}function ee(e,t,n){if(!e)return{};if(typeof e==`string`&&(e=e.trim().split(/[\n\r\s\t ,]+/)),!Array.isArray(e))return e;n(`deprecatedArrayDependencies`,t);var r={};return e.filter(function(e){return typeof e==`string`}).forEach(function(e){e=e.trim().split(/(:?[@\s><=])/);var t=e.shift(),n=e.join(``);n=n.trim(),n=n.replace(/^@/,``),r[t]=n}),r}function te(e,t){c.forEach(function(n){e[n]&&(e[n]=ee(e[n],n,t))})}function b(e,t){e&&Object.keys(e).forEach(function(n){d.bugs[n]&&(t(`typo`,n,d.bugs[n],`bugs`),e[d.bugs[n]]=e[n],delete e[n])})}})),ye=e.t(((e,t)=>{t.exports={repositories:`'repositories' (plural) Not supported. Please pick one as the 'repository' field`,missingRepository:`No repository field.`,brokenGitUrl:`Probably broken git url: %s`,nonObjectScripts:`scripts must be an object`,nonStringScript:`script values must be string commands`,nonArrayFiles:`Invalid 'files' member`,invalidFilename:`Invalid filename in 'files' list: %s`,nonArrayBundleDependencies:`Invalid 'bundleDependencies' list. Must be array of package names`,nonStringBundleDependency:`Invalid bundleDependencies member: %s`,nonDependencyBundleDependency:`Non-dependency in bundleDependencies: %s`,nonObjectDependencies:`%s field must be an object`,nonStringDependency:`Invalid dependency: %s %s`,deprecatedArrayDependencies:`specifying %s as array is deprecated`,deprecatedModules:`modules field is deprecated`,nonArrayKeywords:`keywords should be an array of strings`,nonStringKeyword:`keywords should be an array of strings`,conflictingName:`%s is also the name of a node core module.`,nonStringDescription:`'description' field should be a string`,missingDescription:`No description`,missingReadme:`No README data`,missingLicense:`No license field.`,nonEmailUrlBugsString:`Bug string field must be url, email, or {email,url}`,nonUrlBugsUrlField:`bugs.url field must be a string url. Deleted.`,nonEmailBugsEmailField:`bugs.email field must be a string email. Deleted.`,emptyNormalizedBugs:`Normalized value of bugs field is an empty object. Deleted.`,nonUrlHomepage:`homepage field must be a string url. Deleted.`,invalidLicense:`license should be a valid SPDX license expression`,typo:`%s should probably be %s.`}})),be=e.t(((e,t)=>{var n=require(`util`),r=ye();t.exports=function(){var e=Array.prototype.slice.call(arguments,0),t=e.shift();if(t===`typo`)return i.apply(null,e);var a=r[t]?r[t]:t+`: '%s'`;return e.unshift(a),n.format.apply(null,e)};function i(e,t,i){return i&&(e=i+`['`+e+`']`,t=i+`['`+t+`']`),n.format(r.typo,e,t)}})),xe=e.t(((e,t)=>{t.exports=s;var n=ve();s.fixer=n;var r=be(),i=[`name`,`version`,`description`,`repository`,`modules`,`scripts`,`files`,`bin`,`man`,`bugs`,`keywords`,`readme`,`homepage`,`license`],a=[`dependencies`,`people`,`typos`],o=i.map(function(e){return c(e)+`Field`});o=o.concat(a);function s(e,t,i){t===!0&&(t=null,i=!0),i||=!1,(!t||e.private)&&(t=function(){}),e.scripts&&e.scripts.install===`node-gyp rebuild`&&!e.scripts.preinstall&&(e.gypfile=!0),n.warn=function(){t(r.apply(null,arguments))},o.forEach(function(t){n[`fix`+c(t)](e,i)}),e._id=e.name+`@`+e.version}function c(e){return e.charAt(0).toUpperCase()+e.slice(1)}})),Se=e.a(xe(),1);function Ce(e){return e instanceof URL?(0,h.fileURLToPath)(e):e}const we=e=>f.default.resolve(Ce(e)??`.`,`package.json`),Te=(e,t)=>{let n=typeof e==`string`?ue(e):e;return t&&(0,Se.default)(n),n};async function Ee({cwd:e,normalize:t=!0}={}){return Te(await m.default.readFile(we(e),`utf8`),t)}async function De(e){let t=await b(`package.json`,e);if(t)return{packageJson:await Ee({...e,cwd:f.default.dirname(t)}),path:t}}var Oe=e.t(((e,t)=>{let n={to(e,t){return t?`[${t+1};${e+1}H`:`[${e+1}G`},move(e,t){let n=``;return e<0?n+=`[${-e}D`:e>0&&(n+=`[${e}C`),t<0?n+=`[${-t}A`:t>0&&(n+=`[${t}B`),n},up:(e=1)=>`[${e}A`,down:(e=1)=>`[${e}B`,forward:(e=1)=>`[${e}C`,backward:(e=1)=>`[${e}D`,nextLine:(e=1)=>`\x1B[E`.repeat(e),prevLine:(e=1)=>`\x1B[F`.repeat(e),left:`\x1B[G`,hide:`\x1B[?25l`,show:`\x1B[?25h`,save:`\x1B7`,restore:`\x1B8`};t.exports={cursor:n,scroll:{up:(e=1)=>`\x1B[S`.repeat(e),down:(e=1)=>`\x1B[T`.repeat(e)},erase:{screen:`\x1B[2J`,up:(e=1)=>`\x1B[1J`.repeat(e),down:(e=1)=>`\x1B[J`.repeat(e),line:`\x1B[2K`,lineEnd:`\x1B[K`,lineStart:`\x1B[1K`,lines(e){let t=``;for(let r=0;r<e;r++)t+=this.line+(r<e-1?n.up():``);return e&&(t+=n.left),t}},beep:`\x07`}}));function ke(e){return t=>t.length>1?`${e} run ${t[0]} -- ${t.slice(1).join(` `)}`:`${e} run ${t[0]}`}const Ae={agent:`yarn {0}`,run:`yarn run {0}`,install:`yarn install {0}`,frozen:`yarn install --frozen-lockfile`,global:`yarn global add {0}`,add:`yarn add {0}`,upgrade:`yarn upgrade {0}`,"upgrade-interactive":`yarn upgrade-interactive {0}`,execute:`npx {0}`,uninstall:`yarn remove {0}`,global_uninstall:`yarn global remove {0}`},je={agent:`pnpm {0}`,run:`pnpm run {0}`,install:`pnpm i {0}`,frozen:`pnpm i --frozen-lockfile`,global:`pnpm add -g {0}`,add:`pnpm add {0}`,upgrade:`pnpm update {0}`,"upgrade-interactive":`pnpm update -i {0}`,execute:`pnpm dlx {0}`,uninstall:`pnpm remove {0}`,global_uninstall:`pnpm remove --global {0}`},Me={agent:`bun {0}`,run:`bun run {0}`,install:`bun install {0}`,frozen:`bun install --no-save`,global:`bun add -g {0}`,add:`bun add {0}`,upgrade:`bun update {0}`,"upgrade-interactive":`bun update {0}`,execute:`bunx {0}`,uninstall:`bun remove {0}`,global_uninstall:`bun remove -g {0}`},Ne={npm:{agent:`npm {0}`,run:ke(`npm`),install:`npm i {0}`,frozen:`npm ci`,global:`npm i -g {0}`,add:`npm i {0}`,upgrade:`npm update {0}`,"upgrade-interactive":null,execute:`npx {0}`,uninstall:`npm uninstall {0}`,global_uninstall:`npm uninstall -g {0}`},yarn:Ae,"yarn@berry":{...Ae,frozen:`yarn install --immutable`,upgrade:`yarn up {0}`,"upgrade-interactive":`yarn up -i {0}`,execute:`yarn dlx {0}`,global:`npm i -g {0}`,global_uninstall:`npm uninstall -g {0}`},pnpm:je,"pnpm@6":{...je,run:ke(`pnpm`)},bun:Me},Pe=Object.keys(Ne),Fe={"bun.lockb":`bun`,"pnpm-lock.yaml":`pnpm`,"yarn.lock":`yarn`,"package-lock.json":`npm`,"npm-shrinkwrap.json":`npm`},Ie={bun:`https://bun.sh`,pnpm:`https://pnpm.io/installation`,"pnpm@6":`https://pnpm.io/6.x/installation`,yarn:`https://classic.yarnpkg.com/en/docs/install`,"yarn@berry":`https://yarnpkg.com/getting-started/install`,npm:`https://docs.npmjs.com/cli/v8/configuring-npm/install`};var x=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};function S(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}const{hasOwnProperty:Le}=Object.prototype,Re=(e,t={})=>{typeof t==`string`&&(t={section:t}),t.align=t.align===!0,t.newline=t.newline===!0,t.sort=t.sort===!0,t.whitespace=t.whitespace===!0||t.align===!0,t.platform=t.platform||typeof process<`u`&&process.platform,t.bracketedArray=t.bracketedArray!==!1;let n=t.platform===`win32`?`\r
`:`
`,r=t.whitespace?` = `:`=`,i=[],a=t.sort?Object.keys(e).sort():Object.keys(e),o=0;t.align&&(o=C(a.filter(t=>e[t]===null||Array.isArray(e[t])||typeof e[t]!=`object`).map(t=>Array.isArray(e[t])?`${t}[]`:t).concat([``]).reduce((e,t)=>C(e).length>=C(t).length?e:t)).length);let s=``,c=t.bracketedArray?`[]`:``;for(let t of a){let a=e[t];if(a&&Array.isArray(a))for(let e of a)s+=C(`${t}${c}`).padEnd(o,` `)+r+C(e)+n;else a&&typeof a==`object`?i.push(t):s+=C(t).padEnd(o,` `)+r+C(a)+n}t.section&&s.length&&(s=`[`+C(t.section)+`]`+(t.newline?n+n:n)+s);for(let r of i){let i=ze(r,`.`).join(`\\.`),a=(t.section?t.section+`.`:``)+i,o=Re(e[r],{...t,section:a});s.length&&o.length&&(s+=n),s+=o}return s};function ze(e,t){var n=0,r=0,i=0,a=[];do if(i=e.indexOf(t,n),i!==-1){if(n=i+t.length,i>0&&e[i-1]===`\\`)continue;a.push(e.slice(r,i)),r=i+t.length}while(i!==-1);return a.push(e.slice(r)),a}const Be=(e,t={})=>{t.bracketedArray=t.bracketedArray!==!1;let n=Object.create(null),r=n,i=null,a=/^\[([^\]]*)\]\s*$|^([^=]+)(=(.*))?$/i,o=e.split(/[\r\n]+/g),s={};for(let e of o){if(!e||e.match(/^\s*[;#]/)||e.match(/^\s*$/))continue;let o=e.match(a);if(!o)continue;if(o[1]!==void 0){if(i=He(o[1]),i===`__proto__`){r=Object.create(null);continue}r=n[i]=n[i]||Object.create(null);continue}let c=He(o[2]),l;t.bracketedArray?l=c.length>2&&c.slice(-2)===`[]`:(s[c]=(s?.[c]||0)+1,l=s[c]>1);let u=l?c.slice(0,-2):c;if(u===`__proto__`)continue;let d=o[3]?He(o[4]):!0,f=d===`true`||d===`false`||d===`null`?JSON.parse(d):d;l&&(Le.call(r,u)?Array.isArray(r[u])||(r[u]=[r[u]]):r[u]=[]),Array.isArray(r[u])?r[u].push(f):r[u]=f}let c=[];for(let e of Object.keys(n)){if(!Le.call(n,e)||typeof n[e]!=`object`||Array.isArray(n[e]))continue;let t=ze(e,`.`);r=n;let i=t.pop(),a=i.replace(/\\\./g,`.`);for(let e of t)e!==`__proto__`&&((!Le.call(r,e)||typeof r[e]!=`object`)&&(r[e]=Object.create(null)),r=r[e]);r===n&&a===i||(r[a]=n[e],c.push(e))}for(let e of c)delete n[e];return n},Ve=e=>e.startsWith(`"`)&&e.endsWith(`"`)||e.startsWith(`'`)&&e.endsWith(`'`),C=e=>typeof e!=`string`||e.match(/[=\r\n]/)||e.match(/^\[/)||e.length>1&&Ve(e)||e!==e.trim()?JSON.stringify(e):e.split(`;`).join(`\\;`).split(`#`).join(`\\#`),He=(e,t)=>{if(e=(e||``).trim(),Ve(e)){e.charAt(0)===`'`&&(e=e.slice(1,-1));try{e=JSON.parse(e)}catch{}}else{let t=!1,n=``;for(let r=0,i=e.length;r<i;r++){let i=e.charAt(r);if(t)`\\;#`.indexOf(i)===-1?n+=`\\`+i:n+=i,t=!1;else if(`;#`.indexOf(i)!==-1)break;else i===`\\`?t=!0:n+=i}return t&&(n+=`\\`),n.trim()}return e},Ue=S({parse:Be,decode:Be,stringify:Re,encode:Re,safe:C,unsafe:He});var w={exports:{}},We,Ge;function Ke(){if(Ge)return We;Ge=1,We=i,i.sync=a;var e=n.default;function t(e,t){var n=t.pathExt===void 0?process.env.PATHEXT:t.pathExt;if(!n||(n=n.split(`;`),n.indexOf(``)!==-1))return!0;for(var r=0;r<n.length;r++){var i=n[r].toLowerCase();if(i&&e.substr(-i.length).toLowerCase()===i)return!0}return!1}function r(e,n,r){return!e.isSymbolicLink()&&!e.isFile()?!1:t(n,r)}function i(t,n,i){e.stat(t,function(e,a){i(e,e?!1:r(a,t,n))})}function a(t,n){return r(e.statSync(t),t,n)}return We}var qe,Je;function Ye(){if(Je)return qe;Je=1,qe=t,t.sync=r;var e=n.default;function t(t,n,r){e.stat(t,function(e,t){r(e,e?!1:i(t,n))})}function r(t,n){return i(e.statSync(t),n)}function i(e,t){return e.isFile()&&a(e,t)}function a(e,t){var n=e.mode,r=e.uid,i=e.gid,a=t.uid===void 0?process.getuid&&process.getuid():t.uid,o=t.gid===void 0?process.getgid&&process.getgid():t.gid,s=64,c=8,l=1,u=s|c;return n&l||n&c&&i===o||n&s&&r===a||n&u&&a===0}return qe}var Xe=process.platform===`win32`||x.TESTING_WINDOWS?Ke():Ye(),Ze=Qe;Qe.sync=$e;function Qe(e,t,n){if(typeof t==`function`&&(n=t,t={}),!n){if(typeof Promise!=`function`)throw TypeError(`callback not provided`);return new Promise(function(n,r){Qe(e,t||{},function(e,t){e?r(e):n(t)})})}Xe(e,t||{},function(e,r){e&&(e.code===`EACCES`||t&&t.ignoreErrors)&&(e=null,r=!1),n(e,r)})}function $e(e,t){try{return Xe.sync(e,t||{})}catch(e){if(t&&t.ignoreErrors||e.code===`EACCES`)return!1;throw e}}const T=process.platform===`win32`||process.env.OSTYPE===`cygwin`||process.env.OSTYPE===`msys`,et=r.default,tt=T?`;`:`:`,nt=Ze,rt=e=>Object.assign(Error(`not found: ${e}`),{code:`ENOENT`}),it=(e,t)=>{let n=t.colon||tt,r=e.match(/\//)||T&&e.match(/\\/)?[``]:[...T?[process.cwd()]:[],...(t.path||process.env.PATH||``).split(n)],i=T?t.pathExt||process.env.PATHEXT||`.EXE;.CMD;.BAT;.COM`:``,a=T?i.split(n):[``];return T&&e.indexOf(`.`)!==-1&&a[0]!==``&&a.unshift(``),{pathEnv:r,pathExt:a,pathExtExe:i}},at=(e,t,n)=>{typeof t==`function`&&(n=t,t={}),t||={};let{pathEnv:r,pathExt:i,pathExtExe:a}=it(e,t),o=[],s=n=>new Promise((i,a)=>{if(n===r.length)return t.all&&o.length?i(o):a(rt(e));let s=r[n],l=/^".*"$/.test(s)?s.slice(1,-1):s,u=et.join(l,e);i(c(!l&&/^\.[\\\/]/.test(e)?e.slice(0,2)+u:u,n,0))}),c=(e,n,r)=>new Promise((l,u)=>{if(r===i.length)return l(s(n+1));let d=i[r];nt(e+d,{pathExt:a},(i,a)=>{if(!i&&a)if(t.all)o.push(e+d);else return l(e+d);return l(c(e,n,r+1))})});return n?s(0).then(e=>n(null,e),n):s(0)},ot=(e,t)=>{t||={};let{pathEnv:n,pathExt:r,pathExtExe:i}=it(e,t),a=[];for(let o=0;o<n.length;o++){let s=n[o],c=/^".*"$/.test(s)?s.slice(1,-1):s,l=et.join(c,e),u=!c&&/^\.[\\\/]/.test(e)?e.slice(0,2)+l:l;for(let e=0;e<r.length;e++){let n=u+r[e];try{if(nt.sync(n,{pathExt:i}))if(t.all)a.push(n);else return n}catch{}}}if(t.all&&a.length)return a;if(t.nothrow)return null;throw rt(e)};var st=at;at.sync=ot;var ct={exports:{}};const lt=(e={})=>{let t=e.env||process.env;return(e.platform||process.platform)===`win32`?Object.keys(t).reverse().find(e=>e.toUpperCase()===`PATH`)||`Path`:`PATH`};ct.exports=lt,ct.exports.default=lt;var ut=ct.exports;const dt=r.default,ft=st,pt=ut;function mt(e,t){let n=e.options.env||process.env,r=process.cwd(),i=e.options.cwd!=null,a=i&&process.chdir!==void 0&&!process.chdir.disabled;if(a)try{process.chdir(e.options.cwd)}catch{}let o;try{o=ft.sync(e.command,{path:n[pt({env:n})],pathExt:t?dt.delimiter:void 0})}catch{}finally{a&&process.chdir(r)}return o&&=dt.resolve(i?e.options.cwd:``,o),o}function ht(e){return mt(e)||mt(e,!0)}var gt=ht,_t={};const vt=/([()\][%!^"`<>&|;, *?])/g;function yt(e){return e=e.replace(vt,`^$1`),e}function bt(e,t){return e=`${e}`,e=e.replace(/(\\*)"/g,`$1$1\\"`),e=e.replace(/(\\*)$/,`$1$1`),e=`"${e}"`,e=e.replace(vt,`^$1`),t&&(e=e.replace(vt,`^$1`)),e}_t.command=yt,_t.argument=bt;const xt=/^#!(.*)/;var St=(e=``)=>{let t=e.match(xt);if(!t)return null;let[n,r]=t[0].replace(/#! ?/,``).split(` `),i=n.split(`/`).pop();return i===`env`?r:r?`${i} ${r}`:i};const Ct=n.default,wt=St;function Tt(e){let t=Buffer.alloc(150),n;try{n=Ct.openSync(e,`r`),Ct.readSync(n,t,0,150,0),Ct.closeSync(n)}catch{}return wt(t.toString())}var Et=Tt;const Dt=r.default,Ot=gt,kt=_t,At=Et,jt=process.platform===`win32`,Mt=/\.(?:com|exe)$/i,Nt=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function Pt(e){e.file=Ot(e);let t=e.file&&At(e.file);return t?(e.args.unshift(e.file),e.command=t,Ot(e)):e.file}function Ft(e){if(!jt)return e;let t=Pt(e),n=!Mt.test(t);if(e.options.forceShell||n){let n=Nt.test(t);e.command=Dt.normalize(e.command),e.command=kt.command(e.command),e.args=e.args.map(e=>kt.argument(e,n)),e.args=[`/d`,`/s`,`/c`,`"${[e.command].concat(e.args).join(` `)}"`],e.command=process.env.comspec||`cmd.exe`,e.options.windowsVerbatimArguments=!0}return e}function It(e,t,n){t&&!Array.isArray(t)&&(n=t,t=null),t=t?t.slice(0):[],n=Object.assign({},n);let r={command:e,args:t,options:n,file:void 0,original:{command:e,args:t}};return n.shell?r:Ft(r)}var Lt=It;const Rt=process.platform===`win32`;function zt(e,t){return Object.assign(Error(`${t} ${e.command} ENOENT`),{code:`ENOENT`,errno:`ENOENT`,syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function Bt(e,t){if(!Rt)return;let n=e.emit;e.emit=function(r,i){if(r===`exit`){let r=Vt(i,t);if(r)return n.call(e,`error`,r)}return n.apply(e,arguments)}}function Vt(e,t){return Rt&&e===1&&!t.file?zt(t.original,`spawn`):null}function Ht(e,t){return Rt&&e===1&&!t.file?zt(t.original,`spawnSync`):null}var Ut={hookChildProcess:Bt,verifyENOENT:Vt,verifyENOENTSync:Ht,notFoundError:zt};const Wt=s.default,Gt=Lt,Kt=Ut;function qt(e,t,n){let r=Gt(e,t,n),i=Wt.spawn(r.command,r.args,r.options);return Kt.hookChildProcess(i,r),i}function Jt(e,t,n){let r=Gt(e,t,n),i=Wt.spawnSync(r.command,r.args,r.options);return i.error=i.error||Kt.verifyENOENTSync(i.status,r),i}w.exports=qt,w.exports.spawn=qt,w.exports.sync=Jt,w.exports._parse=Gt,w.exports._enoent=Kt;var Yt=w.exports;const Xt=S(Yt);function Zt(e){let t=typeof e==`string`?`
`:10,n=typeof e==`string`?`\r`:13;return e[e.length-1]===t&&(e=e.slice(0,-1)),e[e.length-1]===n&&(e=e.slice(0,-1)),e}function Qt(e={}){let{env:t=process.env,platform:n=process.platform}=e;return n===`win32`?Object.keys(t).reverse().find(e=>e.toUpperCase()===`PATH`)||`Path`:`PATH`}function $t(e={}){let{cwd:t=p.default.cwd(),path:n=p.default.env[Qt()],execPath:r=p.default.execPath}=e,i,a=t instanceof URL?h.default.fileURLToPath(t):t,o=f.default.resolve(a),s=[];for(;i!==o;)s.push(f.default.join(o,`node_modules/.bin`)),i=o,o=f.default.resolve(o,`..`);return s.push(f.default.resolve(a,r,`..`)),[...s,n].join(f.default.delimiter)}function en({env:e=p.default.env,...t}={}){e={...e};let n=Qt({env:e});return t.path=e[n],e[n]=$t(t),e}const tn=(e,t,n,r)=>{if(n===`length`||n===`prototype`||n===`arguments`||n===`caller`)return;let i=Object.getOwnPropertyDescriptor(e,n),a=Object.getOwnPropertyDescriptor(t,n);!nn(i,a)&&r||Object.defineProperty(e,n,a)},nn=function(e,t){return e===void 0||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},rn=(e,t)=>{let n=Object.getPrototypeOf(t);n!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,n)},an=(e,t)=>`/* Wrapped ${e}*/\n${t}`,on=Object.getOwnPropertyDescriptor(Function.prototype,`toString`),sn=Object.getOwnPropertyDescriptor(Function.prototype.toString,`name`),cn=(e,t,n)=>{let r=n===``?``:`with ${n.trim()}() `,i=an.bind(null,r,t.toString());Object.defineProperty(i,`name`,sn),Object.defineProperty(e,`toString`,{...on,value:i})};function ln(e,t,{ignoreNonConfigurable:n=!1}={}){let{name:r}=e;for(let r of Reflect.ownKeys(t))tn(e,t,r,n);return rn(e,t),cn(e,t,r),e}const un=new WeakMap,dn=(e,t={})=>{if(typeof e!=`function`)throw TypeError(`Expected a function`);let n,r=0,i=e.displayName||e.name||`<anonymous>`,a=function(...o){if(un.set(a,++r),r===1)n=e.apply(this,o),e=null;else if(t.throw===!0)throw Error(`Function \`${i}\` can only be called once`);return n};return ln(a,e),un.set(a,r),a};dn.callCount=e=>{if(!un.has(e))throw Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return un.get(e)};const fn=()=>{let e=hn-mn+1;return Array.from({length:e},pn)},pn=(e,t)=>({name:`SIGRT${t+1}`,number:mn+t,action:`terminate`,description:`Application-specific signal (realtime)`,standard:`posix`}),mn=34,hn=64,gn=[{name:`SIGHUP`,number:1,action:`terminate`,description:`Terminal closed`,standard:`posix`},{name:`SIGINT`,number:2,action:`terminate`,description:`User interruption with CTRL-C`,standard:`ansi`},{name:`SIGQUIT`,number:3,action:`core`,description:`User interruption with CTRL-\\`,standard:`posix`},{name:`SIGILL`,number:4,action:`core`,description:`Invalid machine instruction`,standard:`ansi`},{name:`SIGTRAP`,number:5,action:`core`,description:`Debugger breakpoint`,standard:`posix`},{name:`SIGABRT`,number:6,action:`core`,description:`Aborted`,standard:`ansi`},{name:`SIGIOT`,number:6,action:`core`,description:`Aborted`,standard:`bsd`},{name:`SIGBUS`,number:7,action:`core`,description:`Bus error due to misaligned, non-existing address or paging error`,standard:`bsd`},{name:`SIGEMT`,number:7,action:`terminate`,description:`Command should be emulated but is not implemented`,standard:`other`},{name:`SIGFPE`,number:8,action:`core`,description:`Floating point arithmetic error`,standard:`ansi`},{name:`SIGKILL`,number:9,action:`terminate`,description:`Forced termination`,standard:`posix`,forced:!0},{name:`SIGUSR1`,number:10,action:`terminate`,description:`Application-specific signal`,standard:`posix`},{name:`SIGSEGV`,number:11,action:`core`,description:`Segmentation fault`,standard:`ansi`},{name:`SIGUSR2`,number:12,action:`terminate`,description:`Application-specific signal`,standard:`posix`},{name:`SIGPIPE`,number:13,action:`terminate`,description:`Broken pipe or socket`,standard:`posix`},{name:`SIGALRM`,number:14,action:`terminate`,description:`Timeout or timer`,standard:`posix`},{name:`SIGTERM`,number:15,action:`terminate`,description:`Termination`,standard:`ansi`},{name:`SIGSTKFLT`,number:16,action:`terminate`,description:`Stack is empty or overflowed`,standard:`other`},{name:`SIGCHLD`,number:17,action:`ignore`,description:`Child process terminated, paused or unpaused`,standard:`posix`},{name:`SIGCLD`,number:17,action:`ignore`,description:`Child process terminated, paused or unpaused`,standard:`other`},{name:`SIGCONT`,number:18,action:`unpause`,description:`Unpaused`,standard:`posix`,forced:!0},{name:`SIGSTOP`,number:19,action:`pause`,description:`Paused`,standard:`posix`,forced:!0},{name:`SIGTSTP`,number:20,action:`pause`,description:`Paused using CTRL-Z or "suspend"`,standard:`posix`},{name:`SIGTTIN`,number:21,action:`pause`,description:`Background process cannot read terminal input`,standard:`posix`},{name:`SIGBREAK`,number:21,action:`terminate`,description:`User interruption with CTRL-BREAK`,standard:`other`},{name:`SIGTTOU`,number:22,action:`pause`,description:`Background process cannot write to terminal output`,standard:`posix`},{name:`SIGURG`,number:23,action:`ignore`,description:`Socket received out-of-band data`,standard:`bsd`},{name:`SIGXCPU`,number:24,action:`core`,description:`Process timed out`,standard:`bsd`},{name:`SIGXFSZ`,number:25,action:`core`,description:`File too big`,standard:`bsd`},{name:`SIGVTALRM`,number:26,action:`terminate`,description:`Timeout or timer`,standard:`bsd`},{name:`SIGPROF`,number:27,action:`terminate`,description:`Timeout or timer`,standard:`bsd`},{name:`SIGWINCH`,number:28,action:`ignore`,description:`Terminal window size changed`,standard:`bsd`},{name:`SIGIO`,number:29,action:`terminate`,description:`I/O is available`,standard:`other`},{name:`SIGPOLL`,number:29,action:`terminate`,description:`Watched event`,standard:`other`},{name:`SIGINFO`,number:29,action:`ignore`,description:`Request for process information`,standard:`other`},{name:`SIGPWR`,number:30,action:`terminate`,description:`Device running out of power`,standard:`systemv`},{name:`SIGSYS`,number:31,action:`core`,description:`Invalid system call`,standard:`other`},{name:`SIGUNUSED`,number:31,action:`terminate`,description:`Invalid system call`,standard:`other`}],_n=()=>{let e=fn();return[...gn,...e].map(vn)},vn=({name:e,number:t,description:n,action:r,forced:i=!1,standard:a})=>{let{signals:{[e]:o}}=d.constants,s=o!==void 0;return{name:e,number:s?o:t,description:n,supported:s,action:r,forced:i,standard:a}},yn=()=>{let e=_n();return Object.fromEntries(e.map(bn))},bn=({name:e,number:t,description:n,supported:r,action:i,forced:a,standard:o})=>[e,{name:e,number:t,description:n,supported:r,action:i,forced:a,standard:o}],xn=yn(),Sn=()=>{let e=_n(),t=Array.from({length:65},(t,n)=>Cn(n,e));return Object.assign({},...t)},Cn=(e,t)=>{let n=wn(e,t);if(n===void 0)return{};let{name:r,description:i,supported:a,action:o,forced:s,standard:c}=n;return{[e]:{name:r,number:e,description:i,supported:a,action:o,forced:s,standard:c}}},wn=(e,t)=>{let n=t.find(({name:t})=>d.constants.signals[t]===e);return n===void 0?t.find(t=>t.number===e):n};Sn();const Tn=({timedOut:e,timeout:t,errorCode:n,signal:r,signalDescription:i,exitCode:a,isCanceled:o})=>e?`timed out after ${t} milliseconds`:o?`was canceled`:n===void 0?r===void 0?a===void 0?`failed`:`failed with exit code ${a}`:`was killed with ${r} (${i})`:`failed with ${n}`,En=({stdout:e,stderr:t,all:n,error:r,signal:i,exitCode:a,command:o,escapedCommand:s,timedOut:c,isCanceled:l,killed:u,parsed:{options:{timeout:d,cwd:f=p.default.cwd()}}})=>{a=a===null?void 0:a,i=i===null?void 0:i;let m=i===void 0?void 0:xn[i].description,h=`Command ${Tn({timedOut:c,timeout:d,errorCode:r&&r.code,signal:i,signalDescription:m,exitCode:a,isCanceled:l})}: ${o}`,g=Object.prototype.toString.call(r)===`[object Error]`,_=g?`${h}\n${r.message}`:h,v=[_,t,e].filter(Boolean).join(`
`);return g?(r.originalMessage=r.message,r.message=v):r=Error(v),r.shortMessage=_,r.command=o,r.escapedCommand=s,r.exitCode=a,r.signal=i,r.signalDescription=m,r.stdout=e,r.stderr=t,r.cwd=f,n!==void 0&&(r.all=n),`bufferedData`in r&&delete r.bufferedData,r.failed=!0,r.timedOut=!!c,r.isCanceled=l,r.killed=u&&!c,r},Dn=[`stdin`,`stdout`,`stderr`],On=e=>Dn.some(t=>e[t]!==void 0),kn=e=>{if(!e)return;let{stdio:t}=e;if(t===void 0)return Dn.map(t=>e[t]);if(On(e))throw Error(`It's not possible to provide \`stdio\` in combination with one of ${Dn.map(e=>`\`${e}\``).join(`, `)}`);if(typeof t==`string`)return t;if(!Array.isArray(t))throw TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);let n=Math.max(t.length,Dn.length);return Array.from({length:n},(e,n)=>t[n])},E=[];E.push(`SIGHUP`,`SIGINT`,`SIGTERM`),process.platform!==`win32`&&E.push(`SIGALRM`,`SIGABRT`,`SIGVTALRM`,`SIGXCPU`,`SIGXFSZ`,`SIGUSR2`,`SIGTRAP`,`SIGSYS`,`SIGQUIT`,`SIGIOT`),process.platform===`linux`&&E.push(`SIGIO`,`SIGPOLL`,`SIGPWR`,`SIGSTKFLT`);const An=e=>!!e&&typeof e==`object`&&typeof e.removeListener==`function`&&typeof e.emit==`function`&&typeof e.reallyExit==`function`&&typeof e.listeners==`function`&&typeof e.kill==`function`&&typeof e.pid==`number`&&typeof e.on==`function`,jn=Symbol.for(`signal-exit emitter`),Mn=globalThis,Nn=Object.defineProperty.bind(Object);var Pn=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(Mn[jn])return Mn[jn];Nn(Mn,jn,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,t){this.listeners[e].push(t)}removeListener(e,t){let n=this.listeners[e],r=n.indexOf(t);r!==-1&&(r===0&&n.length===1?n.length=0:n.splice(r,1))}emit(e,t,n){if(this.emitted[e])return!1;this.emitted[e]=!0;let r=!1;for(let i of this.listeners[e])r=i(t,n)===!0||r;return e===`exit`&&(r=this.emit(`afterExit`,t,n)||r),r}},Fn=class{};const In=e=>({onExit(t,n){return e.onExit(t,n)},load(){return e.load()},unload(){return e.unload()}});var Ln=class extends Fn{onExit(){return()=>{}}load(){}unload(){}},Rn=class extends Fn{#e=zn.platform===`win32`?`SIGINT`:`SIGHUP`;#t=new Pn;#n;#r;#i;#a={};#o=!1;constructor(e){super(),this.#n=e,this.#a={};for(let t of E)this.#a[t]=()=>{let n=this.#n.listeners(t),{count:r}=this.#t,i=e;if(typeof i.__signal_exit_emitter__==`object`&&typeof i.__signal_exit_emitter__.count==`number`&&(r+=i.__signal_exit_emitter__.count),n.length===r){this.unload();let n=this.#t.emit(`exit`,null,t),r=t===`SIGHUP`?this.#e:t;n||e.kill(e.pid,r)}};this.#i=e.reallyExit,this.#r=e.emit}onExit(e,t){if(!An(this.#n))return()=>{};this.#o===!1&&this.load();let n=t?.alwaysLast?`afterExit`:`exit`;return this.#t.on(n,e),()=>{this.#t.removeListener(n,e),this.#t.listeners.exit.length===0&&this.#t.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#o){this.#o=!0,this.#t.count+=1;for(let e of E)try{let t=this.#a[e];t&&this.#n.on(e,t)}catch{}this.#n.emit=(e,...t)=>this.#c(e,...t),this.#n.reallyExit=e=>this.#s(e)}}unload(){this.#o&&(this.#o=!1,E.forEach(e=>{let t=this.#a[e];if(!t)throw Error(`Listener not defined for signal: `+e);try{this.#n.removeListener(e,t)}catch{}}),this.#n.emit=this.#r,this.#n.reallyExit=this.#i,--this.#t.count)}#s(e){return An(this.#n)?(this.#n.exitCode=e||0,this.#t.emit(`exit`,this.#n.exitCode,null),this.#i.call(this.#n,this.#n.exitCode)):0}#c(e,...t){let n=this.#r;if(e===`exit`&&An(this.#n)){typeof t[0]==`number`&&(this.#n.exitCode=t[0]);let r=n.call(this.#n,e,...t);return this.#t.emit(`exit`,this.#n.exitCode,null),r}else return n.call(this.#n,e,...t)}};const zn=globalThis.process,{onExit:Bn,load:Vn,unload:Hn}=In(An(zn)?new Rn(zn):new Ln),Un=(e,t=`SIGTERM`,n={})=>{let r=e(t);return Wn(e,t,n,r),r},Wn=(e,t,n,r)=>{if(!Gn(t,n,r))return;let i=qn(n),a=setTimeout(()=>{e(`SIGKILL`)},i);a.unref&&a.unref()},Gn=(e,{forceKillAfterTimeout:t},n)=>Kn(e)&&t!==!1&&n,Kn=e=>e===d.default.constants.signals.SIGTERM||typeof e==`string`&&e.toUpperCase()===`SIGTERM`,qn=({forceKillAfterTimeout:e=!0})=>{if(e===!0)return 5e3;if(!Number.isFinite(e)||e<0)throw TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e},Jn=(e,t)=>{e.kill()&&(t.isCanceled=!0)},Yn=(e,t,n)=>{e.kill(t),n(Object.assign(Error(`Timed out`),{timedOut:!0,signal:t}))},Xn=(e,{timeout:t,killSignal:n=`SIGTERM`},r)=>{if(t===0||t===void 0)return r;let i,a=new Promise((r,a)=>{i=setTimeout(()=>{Yn(e,n,a)},t)}),o=r.finally(()=>{clearTimeout(i)});return Promise.race([a,o])},Zn=({timeout:e})=>{if(e!==void 0&&(!Number.isFinite(e)||e<0))throw TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)},Qn=async(e,{cleanup:t,detached:n},r)=>{if(!t||n)return r;let i=Bn(()=>{e.kill()});return r.finally(()=>{i()})};function $n(e){return typeof e==`object`&&!!e&&typeof e.pipe==`function`}function er(e){return $n(e)&&e.writable!==!1&&typeof e._write==`function`&&typeof e._writableState==`object`}const tr=e=>e instanceof l.ChildProcess&&typeof e.then==`function`,nr=(e,t,n)=>{if(typeof n==`string`)return e[t].pipe((0,u.createWriteStream)(n)),e;if(er(n))return e[t].pipe(n),e;if(!tr(n))throw TypeError(`The second argument must be a string, a stream or an Execa child process.`);if(!er(n.stdin))throw TypeError(`The target child process's stdin must be available.`);return e[t].pipe(n.stdin),n},rr=e=>{e.stdout!==null&&(e.pipeStdout=nr.bind(void 0,e,`stdout`)),e.stderr!==null&&(e.pipeStderr=nr.bind(void 0,e,`stderr`)),e.all!==void 0&&(e.pipeAll=nr.bind(void 0,e,`all`))},ir=async(e,{init:t,convertChunk:n,getSize:r,truncateChunk:i,addChunk:a,getFinalChunk:o,finalize:s},{maxBuffer:c=1/0}={})=>{if(!cr(e))throw Error(`The first argument must be a Readable, a ReadableStream, or an async iterable.`);let l=t();l.length=0;try{for await(let t of e)or({convertedChunk:n[lr(t)](t,l),state:l,getSize:r,truncateChunk:i,addChunk:a,maxBuffer:c});return ar({state:l,convertChunk:n,getSize:r,truncateChunk:i,addChunk:a,getFinalChunk:o,maxBuffer:c}),s(l)}catch(e){throw e.bufferedData=s(l),e}},ar=({state:e,getSize:t,truncateChunk:n,addChunk:r,getFinalChunk:i,maxBuffer:a})=>{let o=i(e);o!==void 0&&or({convertedChunk:o,state:e,getSize:t,truncateChunk:n,addChunk:r,maxBuffer:a})},or=({convertedChunk:e,state:t,getSize:n,truncateChunk:r,addChunk:i,maxBuffer:a})=>{let o=n(e),s=t.length+o;if(s<=a){sr(e,t,i,s);return}let c=r(e,a-t.length);throw c!==void 0&&sr(c,t,i,a),new dr},sr=(e,t,n,r)=>{t.contents=n(e,t,r),t.length=r},cr=e=>typeof e==`object`&&!!e&&typeof e[Symbol.asyncIterator]==`function`,lr=e=>{let t=typeof e;if(t===`string`)return`string`;if(t!==`object`||e===null)return`others`;if(globalThis.Buffer?.isBuffer(e))return`buffer`;let n=ur.call(e);return n===`[object ArrayBuffer]`?`arrayBuffer`:n===`[object DataView]`?`dataView`:Number.isInteger(e.byteLength)&&Number.isInteger(e.byteOffset)&&ur.call(e.buffer)===`[object ArrayBuffer]`?`typedArray`:`others`},{toString:ur}=Object.prototype;var dr=class extends Error{name=`MaxBufferError`;constructor(){super(`maxBuffer exceeded`)}};const fr=e=>e,pr=()=>void 0,mr=({contents:e})=>e,hr=e=>{throw Error(`Streams in object mode are not supported: ${String(e)}`)},gr=e=>e.length;async function _r(e,t){return ir(e,jr,t)}const vr=()=>({contents:new ArrayBuffer(0)}),yr=e=>br.encode(e),br=new TextEncoder,xr=e=>new Uint8Array(e),Sr=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),Cr=(e,t)=>e.slice(0,t),wr=(e,{contents:t,length:n},r)=>{let i=Ar()?Er(t,r):Tr(t,r);return new Uint8Array(i).set(e,n),i},Tr=(e,t)=>{if(t<=e.byteLength)return e;let n=new ArrayBuffer(Dr(t));return new Uint8Array(n).set(new Uint8Array(e),0),n},Er=(e,t)=>{if(t<=e.maxByteLength)return e.resize(t),e;let n=new ArrayBuffer(t,{maxByteLength:Dr(t)});return new Uint8Array(n).set(new Uint8Array(e),0),n},Dr=e=>Or**Math.ceil(Math.log(e)/Math.log(Or)),Or=2,kr=({contents:e,length:t})=>Ar()?e:e.slice(0,t),Ar=()=>`resize`in ArrayBuffer.prototype,jr={init:vr,convertChunk:{string:yr,buffer:xr,arrayBuffer:xr,dataView:Sr,typedArray:Sr,others:hr},getSize:gr,truncateChunk:Cr,addChunk:wr,getFinalChunk:pr,finalize:kr};async function Mr(e,t){if(!(`Buffer`in globalThis))throw Error(`getStreamAsBuffer() is only supported in Node.js`);try{return Nr(await _r(e,t))}catch(e){throw e.bufferedData!==void 0&&(e.bufferedData=Nr(e.bufferedData)),e}}const Nr=e=>globalThis.Buffer.from(e);async function Pr(e,t){return ir(e,Lr,t)}const Fr=()=>({contents:``,textDecoder:new TextDecoder}),Ir=(e,{textDecoder:t})=>t.decode(e,{stream:!0}),Lr={init:Fr,convertChunk:{string:fr,buffer:Ir,arrayBuffer:Ir,dataView:Ir,typedArray:Ir,others:hr},getSize:gr,truncateChunk:(e,t)=>e.slice(0,t),addChunk:(e,{contents:t})=>t+e,getFinalChunk:({textDecoder:e})=>{let t=e.decode();return t===``?void 0:t},finalize:mr},{PassThrough:Rr}=v.default,zr=S(function(){var e=[],t=new Rr({objectMode:!0});return t.setMaxListeners(0),t.add=n,t.isEmpty=r,t.on(`unpipe`,i),Array.prototype.slice.call(arguments).forEach(n),t;function n(r){return Array.isArray(r)?(r.forEach(n),this):(e.push(r),r.once(`end`,i.bind(null,r)),r.once(`error`,t.emit.bind(t,`error`)),r.pipe(t,{end:!1}),this)}function r(){return e.length==0}function i(n){e=e.filter(function(e){return e!==n}),!e.length&&t.readable&&t.end()}}),Br=e=>{if(e!==void 0)throw TypeError("The `input` and `inputFile` options cannot be both set.")},Vr=({input:e,inputFile:t})=>typeof t==`string`?(Br(e),(0,u.createReadStream)(t)):e,Hr=(e,t)=>{let n=Vr(t);n!==void 0&&($n(n)?n.pipe(e.stdin):e.stdin.end(n))},Ur=(e,{all:t})=>{if(!t||!e.stdout&&!e.stderr)return;let n=zr();return e.stdout&&n.add(e.stdout),e.stderr&&n.add(e.stderr),n},Wr=async(e,t)=>{if(!(!e||t===void 0)){await(0,_.setTimeout)(0),e.destroy();try{return await t}catch(e){return e.bufferedData}}},Gr=(e,{encoding:t,buffer:n,maxBuffer:r})=>{if(!(!e||!n))return t===`utf8`||t===`utf-8`?Pr(e,{maxBuffer:r}):t===null||t===`buffer`?Mr(e,{maxBuffer:r}):Kr(e,r,t)},Kr=async(e,t,n)=>(await Mr(e,{maxBuffer:t})).toString(n),qr=async({stdout:e,stderr:t,all:n},{encoding:r,buffer:i,maxBuffer:a},o)=>{let s=Gr(e,{encoding:r,buffer:i,maxBuffer:a}),c=Gr(t,{encoding:r,buffer:i,maxBuffer:a}),l=Gr(n,{encoding:r,buffer:i,maxBuffer:a*2});try{return await Promise.all([o,s,c,l])}catch(r){return Promise.all([{error:r,signal:r.signal,timedOut:r.timedOut},Wr(e,s),Wr(t,c),Wr(n,l)])}},Jr=(async()=>{})().constructor.prototype,Yr=[`then`,`catch`,`finally`].map(e=>[e,Reflect.getOwnPropertyDescriptor(Jr,e)]),Xr=(e,t)=>{for(let[n,r]of Yr){let i=typeof t==`function`?(...e)=>Reflect.apply(r.value,t(),e):r.value.bind(t);Reflect.defineProperty(e,n,{...r,value:i})}},Zr=e=>new Promise((t,n)=>{e.on(`exit`,(e,n)=>{t({exitCode:e,signal:n})}),e.on(`error`,e=>{n(e)}),e.stdin&&e.stdin.on(`error`,e=>{n(e)})}),Qr=(e,t=[])=>Array.isArray(t)?[e,...t]:[e],$r=/^[\w.-]+$/,ei=e=>typeof e!=`string`||$r.test(e)?e:`"${e.replaceAll(`"`,`\\"`)}"`,ti=(e,t)=>Qr(e,t).join(` `),ni=(e,t)=>Qr(e,t).map(e=>ei(e)).join(` `),ri=/ +/g,ii=e=>{let t=[];for(let n of e.trim().split(ri)){let e=t.at(-1);e&&e.endsWith(`\\`)?t[t.length-1]=`${e.slice(0,-1)} ${n}`:t.push(n)}return t},ai=(0,c.debuglog)(`execa`).enabled,oi=(e,t)=>String(e).padStart(t,`0`),si=()=>{let e=new Date;return`${oi(e.getHours(),2)}:${oi(e.getMinutes(),2)}:${oi(e.getSeconds(),2)}.${oi(e.getMilliseconds(),3)}`},ci=(e,{verbose:t})=>{t&&p.default.stderr.write(`[${si()}] ${e}\n`)},li=({env:e,extendEnv:t,preferLocal:n,localDir:r,execPath:i})=>{let a=t?{...p.default.env,...e}:e;return n?en({env:a,cwd:r,execPath:i}):a},ui=(e,t,n={})=>{let r=Xt._parse(e,t,n);return e=r.command,t=r.args,n=r.options,n={maxBuffer:1e8,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:n.cwd||p.default.cwd(),execPath:p.default.execPath,encoding:`utf8`,reject:!0,cleanup:!0,all:!1,windowsHide:!0,verbose:ai,...n},n.env=li(n),n.stdio=kn(n),p.default.platform===`win32`&&f.default.basename(e,`.exe`)===`cmd`&&t.unshift(`/q`),{file:e,args:t,options:n,parsed:r}},di=(e,t,n)=>typeof t!=`string`&&!g.Buffer.isBuffer(t)?n===void 0?void 0:``:e.stripFinalNewline?Zt(t):t;function fi(e,t,n){let r=ui(e,t,n),i=ti(e,t),a=ni(e,t);ci(a,r.options),Zn(r.options);let o;try{o=l.default.spawn(r.file,r.args,r.options)}catch(e){let t=new l.default.ChildProcess;return Xr(t,Promise.reject(En({error:e,stdout:``,stderr:``,all:``,command:i,escapedCommand:a,parsed:r,timedOut:!1,isCanceled:!1,killed:!1}))),t}let s=Zr(o),c=Xn(o,r.options,s),u=Qn(o,r.options,c);o.kill=Un.bind(null,o.kill.bind(o)),o.cancel=Jn.bind(null,o,{isCanceled:!1});let d=dn(async()=>{let[{error:e,exitCode:t,signal:n,timedOut:s},c,l,d]=await qr(o,r.options,u),f=di(r.options,c),p=di(r.options,l),m=di(r.options,d);if(e||t!==0||n!==null){let c=En({error:e,exitCode:t,signal:n,stdout:f,stderr:p,all:m,command:i,escapedCommand:a,parsed:r,timedOut:s,isCanceled:r.options.signal?r.options.signal.aborted:!1,killed:o.killed});if(!r.options.reject)return c;throw c}return{command:i,escapedCommand:a,exitCode:0,stdout:f,stderr:p,all:m,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}});return Hr(o,r.options),o.all=Ur(o,r.options),rr(o),Xr(o,d),o}function pi(e,t){let[n,...r]=ii(e);return fi(n,r,t)}var mi=class{value;next;constructor(e){this.value=e}},hi=class{#e;#t;#n;constructor(){this.clear()}enqueue(e){let t=new mi(e);this.#e?(this.#t.next=t,this.#t=t):(this.#e=t,this.#t=t),this.#n++}dequeue(){let e=this.#e;if(e)return this.#e=this.#e.next,this.#n--,e.value}clear(){this.#e=void 0,this.#t=void 0,this.#n=0}get size(){return this.#n}*[Symbol.iterator](){let e=this.#e;for(;e;)yield e.value,e=e.next}};function gi(e){if(!((Number.isInteger(e)||e===1/0)&&e>0))throw TypeError("Expected `concurrency` to be a number from 1 and up");let t=new hi,n=0,r=()=>{n--,t.size>0&&t.dequeue()()},i=async(e,t,i)=>{n++;let a=(async()=>e(...i))();t(a);try{await a}catch{}r()},a=(r,a,o)=>{t.enqueue(i.bind(void 0,r,a,o)),(async()=>{await Promise.resolve(),n<e&&t.size>0&&t.dequeue()()})()},o=(e,...t)=>new Promise(n=>{a(e,n,t)});return Object.defineProperties(o,{activeCount:{get:()=>n},pendingCount:{get:()=>t.size},clearQueue:{value:()=>{t.clear()}}}),o}var _i=class extends Error{constructor(e){super(),this.value=e}};const vi=async(e,t)=>t(await e),yi=async e=>{let t=await Promise.all(e);if(t[1]===!0)throw new _i(t[0]);return!1};async function bi(e,t,{concurrency:n=1/0,preserveOrder:r=!0}={}){let i=gi(n),a=[...e].map(e=>[e,i(vi,e,t)]),o=gi(r?1:1/0);try{await Promise.all(a.map(e=>o(yi,e)))}catch(e){if(e instanceof _i)return e.value;throw e}}const xi={directory:`isDirectory`,file:`isFile`};function Si(e){if(!Object.hasOwnProperty.call(xi,e))throw Error(`Invalid type specified: ${e}`)}const Ci=(e,t)=>t[xi[e]](),wi=e=>e instanceof URL?(0,h.fileURLToPath)(e):e;async function Ti(e,{cwd:t=p.default.cwd(),type:n=`file`,allowSymlinks:r=!0,concurrency:i,preserveOrder:a}={}){Si(n),t=wi(t);let o=r?u.promises.stat:u.promises.lstat;return bi(e,async e=>{try{return Ci(n,await o(f.default.resolve(t,e)))}catch{return!1}},{concurrency:i,preserveOrder:a})}const Ei=e=>e instanceof URL?(0,h.fileURLToPath)(e):e,Di=Symbol(`findUpStop`);async function Oi(e,t={}){let n=f.default.resolve(Ei(t.cwd)||``),{root:r}=f.default.parse(n),i=f.default.resolve(n,t.stopAt||r),a=t.limit||1/0,o=[e].flat(),s=async t=>{if(typeof e!=`function`)return Ti(o,t);let n=await e(t.cwd);return typeof n==`string`?Ti([n],t):n},c=[];for(;;){let e=await s({...t,cwd:n});if(e===Di||(e&&c.push(f.default.resolve(n,e)),n===i||c.length>=a))break;n=f.default.dirname(n)}return c}async function ki(e,t={}){return(await Oi(e,{...t,limit:1}))[0]}const Ai=process.env.TERM_PROGRAM===`Apple_Terminal`,D={};D.cursorTo=(e,t)=>{if(typeof e!=`number`)throw TypeError("The `x` argument is required");return typeof t==`number`?`\x1B[`+(t+1)+`;`+(e+1)+`H`:`\x1B[`+(e+1)+`G`},D.cursorMove=(e,t)=>{if(typeof e!=`number`)throw TypeError("The `x` argument is required");let n=``;return e<0?n+=`\x1B[`+-e+`D`:e>0&&(n+=`\x1B[`+e+`C`),t<0?n+=`\x1B[`+-t+`A`:t>0&&(n+=`\x1B[`+t+`B`),n},D.cursorUp=(e=1)=>`\x1B[`+e+`A`,D.cursorDown=(e=1)=>`\x1B[`+e+`B`,D.cursorForward=(e=1)=>`\x1B[`+e+`C`,D.cursorBackward=(e=1)=>`\x1B[`+e+`D`,D.cursorLeft=`\x1B[G`,D.cursorSavePosition=Ai?`\x1B7`:`\x1B[s`,D.cursorRestorePosition=Ai?`\x1B8`:`\x1B[u`,D.cursorGetPosition=`\x1B[6n`,D.cursorNextLine=`\x1B[E`,D.cursorPrevLine=`\x1B[F`,D.cursorHide=`\x1B[?25l`,D.cursorShow=`\x1B[?25h`,D.eraseLines=e=>{let t=``;for(let n=0;n<e;n++)t+=D.eraseLine+(n<e-1?D.cursorUp():``);return e&&(t+=D.cursorLeft),t},D.eraseEndLine=`\x1B[K`,D.eraseStartLine=`\x1B[1K`,D.eraseLine=`\x1B[2K`,D.eraseDown=`\x1B[J`,D.eraseUp=`\x1B[1J`,D.eraseScreen=`\x1B[2J`,D.scrollUp=`\x1B[S`,D.scrollDown=`\x1B[T`,D.clearScreen=`\x1Bc`,D.clearTerminal=process.platform===`win32`?`${D.eraseScreen}`:`${D.eraseScreen}`,D.beep=`\x07`,D.link=(e,t)=>[`\x1B]`,`8`,`;`,`;`,t,`\x07`,e,`\x1B]`,`8`,`;`,`;`,`\x07`].join(``),D.image=(e,t={})=>{let n=`\x1B]1337;File=inline=1`;return t.width&&(n+=`;width=${t.width}`),t.height&&(n+=`;height=${t.height}`),t.preserveAspectRatio===!1&&(n+=`;preserveAspectRatio=0`),n+`:`+e.toString(`base64`)+`\x07`},D.iTerm={setCwd:(e=process.cwd())=>`]50;CurrentDir=${e}`,annotation:(e,t={})=>{let n=`\x1B]1337;`,r=t.x!==void 0,i=t.y!==void 0;if((r||i)&&!(r&&i&&t.length!==void 0))throw Error("`x`, `y` and `length` must be defined when `x` or `y` is defined");return e=e.replace(/\|/g,``),n+=t.isHidden?`AddHiddenAnnotation=`:`AddAnnotation=`,t.length>0?n+=(r?[e,t.length,t.x,t.y]:[t.length,e]).join(`|`):n+=e,n+`\x07`}};var ji=(e,t=process.argv)=>{let n=e.startsWith(`-`)?``:e.length===1?`-`:`--`,r=t.indexOf(n+e),i=t.indexOf(`--`);return r!==-1&&(i===-1||r<i)};const Mi=i.default,Ni=a.default,O=ji,{env:k}=process;let A;O(`no-color`)||O(`no-colors`)||O(`color=false`)||O(`color=never`)?A=0:(O(`color`)||O(`colors`)||O(`color=true`)||O(`color=always`))&&(A=1),`FORCE_COLOR`in k&&(A=k.FORCE_COLOR===`true`?1:k.FORCE_COLOR===`false`?0:k.FORCE_COLOR.length===0?1:Math.min(parseInt(k.FORCE_COLOR,10),3));function Pi(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function Fi(e,t){if(A===0)return 0;if(O(`color=16m`)||O(`color=full`)||O(`color=truecolor`))return 3;if(O(`color=256`))return 2;if(e&&!t&&A===void 0)return 0;let n=A||0;if(k.TERM===`dumb`)return n;if(process.platform===`win32`){let e=Mi.release().split(`.`);return Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if(`CI`in k)return[`TRAVIS`,`CIRCLECI`,`APPVEYOR`,`GITLAB_CI`,`GITHUB_ACTIONS`,`BUILDKITE`].some(e=>e in k)||k.CI_NAME===`codeship`?1:n;if(`TEAMCITY_VERSION`in k)return+!!/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(k.TEAMCITY_VERSION);if(k.COLORTERM===`truecolor`)return 3;if(`TERM_PROGRAM`in k){let e=parseInt((k.TERM_PROGRAM_VERSION||``).split(`.`)[0],10);switch(k.TERM_PROGRAM){case`iTerm.app`:return e>=3?3:2;case`Apple_Terminal`:return 2}}return/-256(color)?$/i.test(k.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(k.TERM)||`COLORTERM`in k?1:n}function Ii(e){return Pi(Fi(e,e&&e.isTTY))}const Li={supportsColor:Ii,stdout:Pi(Fi(!0,Ni.isatty(1))),stderr:Pi(Fi(!0,Ni.isatty(2)))},j=ji;function Ri(e){if(/^\d{3,4}$/.test(e)){let t=/(\d{1,2})(\d{2})/.exec(e);return{major:0,minor:parseInt(t[1],10),patch:parseInt(t[2],10)}}let t=(e||``).split(`.`).map(e=>parseInt(e,10));return{major:t[0],minor:t[1],patch:t[2]}}function zi(e){let{env:t}=process;if(`FORCE_HYPERLINK`in t)return!(t.FORCE_HYPERLINK.length>0&&parseInt(t.FORCE_HYPERLINK,10)===0);if(j(`no-hyperlink`)||j(`no-hyperlinks`)||j(`hyperlink=false`)||j(`hyperlink=never`))return!1;if(j(`hyperlink=true`)||j(`hyperlink=always`))return!0;if(!Li.supportsColor(e)||e&&!e.isTTY||process.platform===`win32`)return!1;if(`NETLIFY`in t)return!0;if(`CI`in t||`TEAMCITY_VERSION`in t)return!1;if(`TERM_PROGRAM`in t){let e=Ri(t.TERM_PROGRAM_VERSION);switch(t.TERM_PROGRAM){case`iTerm.app`:return e.major===3?e.minor>=1:e.major>3}}if(`VTE_VERSION`in t){if(t.VTE_VERSION===`0.50.0`)return!1;let e=Ri(t.VTE_VERSION);return e.major>0||e.minor>=50}return!1}const Bi=S({supportsHyperlink:zi,stdout:zi(process.stdout),stderr:zi(process.stderr)});function M(e,t,{target:n=`stdout`,...r}={}){return Bi[n]?D.link(e,t):r.fallback===!1?e:typeof r.fallback==`function`?r.fallback(e,t):`${e} (\u200B${t}\u200B)`}M.isSupported=Bi.stdout,M.stderr=(e,t,n={})=>M(e,t,{target:`stderr`,...n}),M.stderr.isSupported=Bi.stderr;var Vi={};let Hi,Ui,Wi,Gi,Ki=!0;typeof process<`u`&&({FORCE_COLOR:Hi,NODE_DISABLE_COLORS:Ui,NO_COLOR:Wi,TERM:Gi}=process.env||{},Ki=process.stdout&&process.stdout.isTTY);const N={enabled:!Ui&&Wi==null&&Gi!==`dumb`&&(Hi!=null&&Hi!==`0`||Ki),reset:P(0,0),bold:P(1,22),dim:P(2,22),italic:P(3,23),underline:P(4,24),inverse:P(7,27),hidden:P(8,28),strikethrough:P(9,29),black:P(30,39),red:P(31,39),green:P(32,39),yellow:P(33,39),blue:P(34,39),magenta:P(35,39),cyan:P(36,39),white:P(37,39),gray:P(90,39),grey:P(90,39),bgBlack:P(40,49),bgRed:P(41,49),bgGreen:P(42,49),bgYellow:P(43,49),bgBlue:P(44,49),bgMagenta:P(45,49),bgCyan:P(46,49),bgWhite:P(47,49)};function qi(e,t){let n=0,r,i=``,a=``;for(;n<e.length;n++)r=e[n],i+=r.open,a+=r.close,~t.indexOf(r.close)&&(t=t.replace(r.rgx,r.close+r.open));return i+t+a}function Ji(e,t){let n={has:e,keys:t};return n.reset=N.reset.bind(n),n.bold=N.bold.bind(n),n.dim=N.dim.bind(n),n.italic=N.italic.bind(n),n.underline=N.underline.bind(n),n.inverse=N.inverse.bind(n),n.hidden=N.hidden.bind(n),n.strikethrough=N.strikethrough.bind(n),n.black=N.black.bind(n),n.red=N.red.bind(n),n.green=N.green.bind(n),n.yellow=N.yellow.bind(n),n.blue=N.blue.bind(n),n.magenta=N.magenta.bind(n),n.cyan=N.cyan.bind(n),n.white=N.white.bind(n),n.gray=N.gray.bind(n),n.grey=N.grey.bind(n),n.bgBlack=N.bgBlack.bind(n),n.bgRed=N.bgRed.bind(n),n.bgGreen=N.bgGreen.bind(n),n.bgYellow=N.bgYellow.bind(n),n.bgBlue=N.bgBlue.bind(n),n.bgMagenta=N.bgMagenta.bind(n),n.bgCyan=N.bgCyan.bind(n),n.bgWhite=N.bgWhite.bind(n),n}function P(e,t){let n={open:`\x1b[${e}m`,close:`\x1b[${t}m`,rgx:RegExp(`\\x1b\\[${t}m`,`g`)};return function(t){return this!==void 0&&this.has!==void 0?(~this.has.indexOf(e)||(this.has.push(e),this.keys.push(n)),t===void 0?this:N.enabled?qi(this.keys,t+``):t+``):t===void 0?Ji([e],[n]):N.enabled?qi([n],t+``):t+``}}var F=N,Yi=(e,t)=>{if(!(e.meta&&e.name!==`escape`)){if(e.ctrl)return e.name===`a`?`first`:e.name===`c`||e.name===`d`?`abort`:e.name===`e`?`last`:e.name===`g`?`reset`:e.name===`n`?`down`:e.name===`p`?`up`:void 0;if(t){if(e.name===`j`)return`down`;if(e.name===`k`)return`up`}return e.name===`return`||e.name===`enter`?`submit`:e.name===`backspace`?`delete`:e.name===`delete`?`deleteForward`:e.name===`abort`?`abort`:e.name===`escape`?`exit`:e.name===`tab`?`next`:e.name===`pagedown`?`nextPage`:e.name===`pageup`?`prevPage`:e.name===`home`?`home`:e.name===`end`?`end`:e.name===`up`?`up`:e.name===`down`?`down`:e.name===`right`?`right`:e.name===`left`?`left`:!1}},Xi=e=>{let t=[`[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)`,`(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))`].join(`|`),n=new RegExp(t,`g`);return typeof e==`string`?e.replace(n,``):e};const Zi={to(e,t){return t?`[${t+1};${e+1}H`:`[${e+1}G`},move(e,t){let n=``;return e<0?n+=`[${-e}D`:e>0&&(n+=`[${e}C`),t<0?n+=`[${-t}A`:t>0&&(n+=`[${t}B`),n},up:(e=1)=>`[${e}A`,down:(e=1)=>`[${e}B`,forward:(e=1)=>`[${e}C`,backward:(e=1)=>`[${e}D`,nextLine:(e=1)=>`\x1B[E`.repeat(e),prevLine:(e=1)=>`\x1B[F`.repeat(e),left:`\x1B[G`,hide:`\x1B[?25l`,show:`\x1B[?25h`,save:`\x1B7`,restore:`\x1B8`};var I={cursor:Zi,scroll:{up:(e=1)=>`\x1B[S`.repeat(e),down:(e=1)=>`\x1B[T`.repeat(e)},erase:{screen:`\x1B[2J`,up:(e=1)=>`\x1B[1J`.repeat(e),down:(e=1)=>`\x1B[J`.repeat(e),line:`\x1B[2K`,lineEnd:`\x1B[K`,lineStart:`\x1B[1K`,lines(e){let t=``;for(let n=0;n<e;n++)t+=this.line+(n<e-1?Zi.up():``);return e&&(t+=Zi.left),t}},beep:`\x07`};const Qi=Xi,{erase:$i,cursor:ea}=I,ta=e=>[...Qi(e)].length;var na=function(e,t){if(!t)return $i.line+ea.to(0);let n=0,r=e.split(/\r?\n/);for(let e of r)n+=1+Math.floor(Math.max(ta(e)-1,0)/t);return $i.lines(n)};const L={arrowUp:`↑`,arrowDown:`↓`,arrowLeft:`←`,arrowRight:`→`,radioOn:`◉`,radioOff:`◯`,tick:`✔`,cross:`✖`,ellipsis:`…`,pointerSmall:`›`,line:`─`,pointer:`❯`},ra={arrowUp:L.arrowUp,arrowDown:L.arrowDown,arrowLeft:L.arrowLeft,arrowRight:L.arrowRight,radioOn:`(*)`,radioOff:`( )`,tick:`√`,cross:`×`,ellipsis:`...`,pointerSmall:`»`,line:`─`,pointer:`>`};var ia=process.platform===`win32`?ra:L;const R=F,z=ia,aa=Object.freeze({password:{scale:1,render:e=>`*`.repeat(e.length)},emoji:{scale:2,render:e=>`😃`.repeat(e.length)},invisible:{scale:0,render:e=>``},default:{scale:1,render:e=>`${e}`}}),oa=e=>aa[e]||aa.default,sa=Object.freeze({aborted:R.red(z.cross),done:R.green(z.tick),exited:R.yellow(z.cross),default:R.cyan(`?`)});var ca={styles:aa,render:oa,symbols:sa,symbol:(e,t,n)=>t?sa.aborted:n?sa.exited:e?sa.done:sa.default,delimiter:e=>R.gray(e?z.ellipsis:z.pointerSmall),item:(e,t)=>R.gray(e?t?z.pointerSmall:`+`:z.line)};const la=Xi;var B={action:Yi,clear:na,style:ca,strip:Xi,figures:ia,lines:function(e,t){let n=String(la(e)||``).split(/\r?\n/);return t?n.map(e=>Math.ceil(e.length/t)).reduce((e,t)=>e+t):n.length},wrap:(e,t={})=>{let n=Number.isSafeInteger(parseInt(t.margin))?Array(parseInt(t.margin)).fill(` `).join(``):t.margin||``,r=t.width;return(e||``).split(/\r?\n/g).map(e=>e.split(/\s+/g).reduce((e,t)=>(t.length+n.length>=r||e[e.length-1].length+t.length+1<r?e[e.length-1]+=` ${t}`:e.push(`${n}${t}`),e),[n]).join(`
`)).join(`
`)},entriesToDisplay:(e,t,n)=>{n||=t;let r=Math.min(t-n,e-Math.floor(n/2));r<0&&(r=0);let i=Math.min(r+n,t);return{startIndex:r,endIndex:i}}};const ua=ee.default,{action:da}=B,fa=o.default,{beep:pa,cursor:ma}=I,ha=F;var V=class extends fa{constructor(e={}){super(),this.firstRender=!0,this.in=e.stdin||process.stdin,this.out=e.stdout||process.stdout,this.onRender=(e.onRender||(()=>void 0)).bind(this);let t=ua.createInterface({input:this.in,escapeCodeTimeout:50});ua.emitKeypressEvents(this.in,t),this.in.isTTY&&this.in.setRawMode(!0);let n=[`SelectPrompt`,`MultiselectPrompt`].indexOf(this.constructor.name)>-1,r=(e,t)=>{let r=da(t,n);r===!1?this._&&this._(e,t):typeof this[r]==`function`?this[r](t):this.bell()};this.close=()=>{this.out.write(ma.show),this.in.removeListener(`keypress`,r),this.in.isTTY&&this.in.setRawMode(!1),t.close(),this.emit(this.aborted?`abort`:this.exited?`exit`:`submit`,this.value),this.closed=!0},this.in.on(`keypress`,r)}fire(){this.emit(`state`,{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(pa)}render(){this.onRender(ha),this.firstRender&&=!1}};const ga=F,_a=V,{erase:va,cursor:ya}=I,{style:ba,clear:xa,lines:Sa,figures:Ca}=B;var wa=class extends _a{constructor(e={}){super(e),this.transform=ba.render(e.style),this.scale=this.transform.scale,this.msg=e.message,this.initial=e.initial||``,this.validator=e.validate||(()=>!0),this.value=``,this.errorMsg=e.error||`Please Enter A Valid Value`,this.cursor=Number(!!this.initial),this.cursorOffset=0,this.clear=xa(``,this.out.columns),this.render()}set value(e){!e&&this.initial?(this.placeholder=!0,this.rendered=ga.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(e)),this._value=e,this.fire()}get value(){return this._value}reset(){this.value=``,this.cursor=Number(!!this.initial),this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}async validate(){let e=await this.validator(this.value);typeof e==`string`&&(this.errorMsg=e,e=!1),this.error=!e}async submit(){if(this.value=this.value||this.initial,this.cursorOffset=0,this.cursor=this.rendered.length,await this.validate(),this.error){this.red=!0,this.fire(),this.render();return}this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(e){this.placeholder||(this.cursor+=e,this.cursorOffset+=e)}_(e,t){let n=this.value.slice(0,this.cursor),r=this.value.slice(this.cursor);this.value=`${n}${e}${r}`,this.red=!1,this.cursor=this.placeholder?0:n.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let e=this.value.slice(0,this.cursor-1),t=this.value.slice(this.cursor);this.value=`${e}${t}`,this.red=!1,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let e=this.value.slice(0,this.cursor),t=this.value.slice(this.cursor+1);this.value=`${e}${t}`,this.red=!1,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length,this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render()}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(ya.down(Sa(this.outputError,this.out.columns)-1)+xa(this.outputError,this.out.columns)),this.out.write(xa(this.outputText,this.out.columns))),super.render(),this.outputError=``,this.outputText=[ba.symbol(this.done,this.aborted),ga.bold(this.msg),ba.delimiter(this.done),this.red?ga.red(this.rendered):this.rendered].join(` `),this.error&&(this.outputError+=this.errorMsg.split(`
`).reduce((e,t,n)=>e+`\n${n?` `:Ca.pointerSmall} ${ga.red().italic(t)}`,``)),this.out.write(va.line+ya.to(0)+this.outputText+ya.save+this.outputError+ya.restore+ya.move(this.cursorOffset,0)))}};const H=F,Ta=V,{style:Ea,clear:Da,figures:Oa,wrap:ka,entriesToDisplay:Aa}=B,{cursor:ja}=I;var Ma=class extends Ta{constructor(e={}){super(e),this.msg=e.message,this.hint=e.hint||`- Use arrow-keys. Return to submit.`,this.warn=e.warn||`- This option is disabled`,this.cursor=e.initial||0,this.choices=e.choices.map((e,t)=>(typeof e==`string`&&(e={title:e,value:t}),{title:e&&(e.title||e.value||e),value:e&&(e.value===void 0?t:e.value),description:e&&e.description,selected:e&&e.selected,disabled:e&&e.disabled})),this.optionsPerPage=e.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=Da(``,this.out.columns),this.render()}moveCursor(e){this.cursor=e,this.value=this.choices[e].value,this.fire()}reset(){this.moveCursor(0),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
`),this.close()}submit(){this.selection.disabled?this.bell():(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
`),this.close())}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){this.cursor===0?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render()}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(e,t){if(e===` `)return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(ja.hide):this.out.write(Da(this.outputText,this.out.columns)),super.render();let{startIndex:e,endIndex:t}=Aa(this.cursor,this.choices.length,this.optionsPerPage);if(this.outputText=[Ea.symbol(this.done,this.aborted),H.bold(this.msg),Ea.delimiter(!1),this.done?this.selection.title:this.selection.disabled?H.yellow(this.warn):H.gray(this.hint)].join(` `),!this.done){this.outputText+=`
`;for(let n=e;n<t;n++){let r,i,a=``,o=this.choices[n];i=n===e&&e>0?Oa.arrowUp:n===t-1&&t<this.choices.length?Oa.arrowDown:` `,o.disabled?(r=this.cursor===n?H.gray().underline(o.title):H.strikethrough().gray(o.title),i=(this.cursor===n?H.bold().gray(Oa.pointer)+` `:`  `)+i):(r=this.cursor===n?H.cyan().underline(o.title):o.title,i=(this.cursor===n?H.cyan(Oa.pointer)+` `:`  `)+i,o.description&&this.cursor===n&&(a=` - ${o.description}`,(i.length+r.length+a.length>=this.out.columns||o.description.split(/\r?\n/).length>1)&&(a=`
`+ka(o.description,{margin:3,width:this.out.columns})))),this.outputText+=`${i} ${r}${H.gray(a)}\n`}}this.out.write(this.outputText)}};const Na=F,Pa=V,{style:Fa,clear:Ia}=B,{cursor:La,erase:Ra}=I;var za=class extends Pa{constructor(e={}){super(e),this.msg=e.message,this.value=!!e.initial,this.active=e.active||`on`,this.inactive=e.inactive||`off`,this.initialValue=this.value,this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
`),this.close()}submit(){this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}deactivate(){if(this.value===!1)return this.bell();this.value=!1,this.render()}activate(){if(this.value===!0)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(e,t){if(e===` `)this.value=!this.value;else if(e===`1`)this.value=!0;else if(e===`0`)this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(La.hide):this.out.write(Ia(this.outputText,this.out.columns)),super.render(),this.outputText=[Fa.symbol(this.done,this.aborted),Na.bold(this.msg),Fa.delimiter(this.done),this.value?this.inactive:Na.cyan().underline(this.inactive),Na.gray(`/`),this.value?Na.cyan().underline(this.active):this.active].join(` `),this.out.write(Ra.line+La.to(0)+this.outputText))}},U=class e{constructor({token:e,date:t,parts:n,locales:r}){this.token=e,this.date=t||new Date,this.parts=n||[this],this.locales=r||{}}up(){}down(){}next(){let t=this.parts.indexOf(this);return this.parts.find((n,r)=>r>t&&n instanceof e)}setTo(e){}prev(){let t=[].concat(this.parts).reverse(),n=t.indexOf(this);return t.find((t,r)=>r>n&&t instanceof e)}toString(){return String(this.date)}};const Ba=U;var Va=class extends Ba{constructor(e={}){super(e)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let e=this.date.getHours()>12?`pm`:`am`;return/\A/.test(this.token)?e.toUpperCase():e}};const Ha=U,Ua=e=>(e%=10,e===1?`st`:e===2?`nd`:e===3?`rd`:`th`);var Wa=class extends Ha{constructor(e={}){super(e)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(e){this.date.setDate(parseInt(e.substr(-2)))}toString(){let e=this.date.getDate(),t=this.date.getDay();return this.token===`DD`?String(e).padStart(2,`0`):this.token===`Do`?e+Ua(e):this.token===`d`?t+1:this.token===`ddd`?this.locales.weekdaysShort[t]:this.token===`dddd`?this.locales.weekdays[t]:e}};const Ga=U;var Ka=class extends Ga{constructor(e={}){super(e)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(e){this.date.setHours(parseInt(e.substr(-2)))}toString(){let e=this.date.getHours();return/h/.test(this.token)&&(e=e%12||12),this.token.length>1?String(e).padStart(2,`0`):e}};const qa=U;var Ja=class extends qa{constructor(e={}){super(e)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(e){this.date.setMilliseconds(parseInt(e.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,`0`).substr(0,this.token.length)}};const Ya=U;var Xa=class extends Ya{constructor(e={}){super(e)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(e){this.date.setMinutes(parseInt(e.substr(-2)))}toString(){let e=this.date.getMinutes();return this.token.length>1?String(e).padStart(2,`0`):e}};const Za=U;var Qa=class extends Za{constructor(e={}){super(e)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(e){e=parseInt(e.substr(-2))-1,this.date.setMonth(e<0?0:e)}toString(){let e=this.date.getMonth(),t=this.token.length;return t===2?String(e+1).padStart(2,`0`):t===3?this.locales.monthsShort[e]:t===4?this.locales.months[e]:String(e+1)}};const $a=U;var eo=class extends $a{constructor(e={}){super(e)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(e){this.date.setSeconds(parseInt(e.substr(-2)))}toString(){let e=this.date.getSeconds();return this.token.length>1?String(e).padStart(2,`0`):e}};const to=U;var no={DatePart:U,Meridiem:Va,Day:Wa,Hours:Ka,Milliseconds:Ja,Minutes:Xa,Month:Qa,Seconds:eo,Year:class extends to{constructor(e={}){super(e)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(e){this.date.setFullYear(e.substr(-4))}toString(){let e=String(this.date.getFullYear()).padStart(4,`0`);return this.token.length===2?e.substr(-2):e}}};const ro=F,io=V,{style:ao,clear:oo,figures:so}=B,{erase:co,cursor:lo}=I,{DatePart:uo,Meridiem:fo,Day:po,Hours:mo,Milliseconds:ho,Minutes:go,Month:_o,Seconds:vo,Year:yo}=no,bo=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g,xo={1:({token:e})=>e.replace(/\\(.)/g,`$1`),2:e=>new po(e),3:e=>new _o(e),4:e=>new yo(e),5:e=>new fo(e),6:e=>new mo(e),7:e=>new go(e),8:e=>new vo(e),9:e=>new ho(e)},So={months:`January,February,March,April,May,June,July,August,September,October,November,December`.split(`,`),monthsShort:`Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec`.split(`,`),weekdays:`Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday`.split(`,`),weekdaysShort:`Sun,Mon,Tue,Wed,Thu,Fri,Sat`.split(`,`)};var Co=class extends io{constructor(e={}){super(e),this.msg=e.message,this.cursor=0,this.typed=``,this.locales=Object.assign(So,e.locales),this._date=e.initial||new Date,this.errorMsg=e.error||`Please Enter A Valid Value`,this.validator=e.validate||(()=>!0),this.mask=e.mask||`YYYY-MM-DD HH:mm:ss`,this.clear=oo(``,this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(e){e&&this._date.setTime(e.getTime())}set mask(e){let t;for(this.parts=[];t=bo.exec(e);){let e=t.shift(),n=t.findIndex(e=>e!=null);this.parts.push(n in xo?xo[n]({token:t[n]||e,date:this.date,parts:this.parts,locales:this.locales}):t[n]||e)}let n=this.parts.reduce((e,t)=>(typeof t==`string`&&typeof e[e.length-1]==`string`?e[e.length-1]+=t:e.push(t),e),[]);this.parts.splice(0),this.parts.push(...n),this.reset()}moveCursor(e){this.typed=``,this.cursor=e,this.fire()}reset(){this.moveCursor(this.parts.findIndex(e=>e instanceof uo)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}async validate(){let e=await this.validator(this.value);typeof e==`string`&&(this.errorMsg=e,e=!1),this.error=!e}async submit(){if(await this.validate(),this.error){this.color=`red`,this.fire(),this.render();return}this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}up(){this.typed=``,this.parts[this.cursor].up(),this.render()}down(){this.typed=``,this.parts[this.cursor].down(),this.render()}left(){let e=this.parts[this.cursor].prev();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render()}right(){let e=this.parts[this.cursor].next();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render()}next(){let e=this.parts[this.cursor].next();this.moveCursor(e?this.parts.indexOf(e):this.parts.findIndex(e=>e instanceof uo)),this.render()}_(e){/\d/.test(e)&&(this.typed+=e,this.parts[this.cursor].setTo(this.typed),this.render())}render(){this.closed||(this.firstRender?this.out.write(lo.hide):this.out.write(oo(this.outputText,this.out.columns)),super.render(),this.outputText=[ao.symbol(this.done,this.aborted),ro.bold(this.msg),ao.delimiter(!1),this.parts.reduce((e,t,n)=>e.concat(n===this.cursor&&!this.done?ro.cyan().underline(t.toString()):t),[]).join(``)].join(` `),this.error&&(this.outputText+=this.errorMsg.split(`
`).reduce((e,t,n)=>e+`\n${n?` `:so.pointerSmall} ${ro.red().italic(t)}`,``)),this.out.write(co.line+lo.to(0)+this.outputText))}};const wo=F,To=V,{cursor:Eo,erase:Do}=I,{style:Oo,figures:ko,clear:Ao,lines:jo}=B,Mo=/[0-9]/,No=e=>e!==void 0,Po=(e,t)=>{let n=10**t;return Math.round(e*n)/n};var Fo=class extends To{constructor(e={}){super(e),this.transform=Oo.render(e.style),this.msg=e.message,this.initial=No(e.initial)?e.initial:``,this.float=!!e.float,this.round=e.round||2,this.inc=e.increment||1,this.min=No(e.min)?e.min:-1/0,this.max=No(e.max)?e.max:1/0,this.errorMsg=e.error||`Please Enter A Valid Value`,this.validator=e.validate||(()=>!0),this.color=`cyan`,this.value=``,this.typed=``,this.lastHit=0,this.render()}set value(e){!e&&e!==0?(this.placeholder=!0,this.rendered=wo.gray(this.transform.render(`${this.initial}`)),this._value=``):(this.placeholder=!1,this.rendered=this.transform.render(`${Po(e,this.round)}`),this._value=Po(e,this.round)),this.fire()}get value(){return this._value}parse(e){return this.float?parseFloat(e):parseInt(e)}valid(e){return e===`-`||e===`.`&&this.float||Mo.test(e)}reset(){this.typed=``,this.value=``,this.fire(),this.render()}exit(){this.abort()}abort(){let e=this.value;this.value=e===``?this.initial:e,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}async validate(){let e=await this.validator(this.value);typeof e==`string`&&(this.errorMsg=e,e=!1),this.error=!e}async submit(){if(await this.validate(),this.error){this.color=`red`,this.fire(),this.render();return}let e=this.value;this.value=e===``?this.initial:e,this.done=!0,this.aborted=!1,this.error=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}up(){if(this.typed=``,this.value===``&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color=`cyan`,this.fire(),this.render()}down(){if(this.typed=``,this.value===``&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color=`cyan`,this.fire(),this.render()}delete(){let e=this.value.toString();if(e.length===0)return this.bell();this.value=this.parse(e=e.slice(0,-1))||``,this.value!==``&&this.value<this.min&&(this.value=this.min),this.color=`cyan`,this.fire(),this.render()}next(){this.value=this.initial,this.fire(),this.render()}_(e,t){if(!this.valid(e))return this.bell();let n=Date.now();if(n-this.lastHit>1e3&&(this.typed=``),this.typed+=e,this.lastHit=n,this.color=`cyan`,e===`.`)return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.value<this.min&&(this.value=this.min),this.fire(),this.render()}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(Eo.down(jo(this.outputError,this.out.columns)-1)+Ao(this.outputError,this.out.columns)),this.out.write(Ao(this.outputText,this.out.columns))),super.render(),this.outputError=``,this.outputText=[Oo.symbol(this.done,this.aborted),wo.bold(this.msg),Oo.delimiter(this.done),!this.done||!this.done&&!this.placeholder?wo[this.color]().underline(this.rendered):this.rendered].join(` `),this.error&&(this.outputError+=this.errorMsg.split(`
`).reduce((e,t,n)=>e+`\n${n?` `:ko.pointerSmall} ${wo.red().italic(t)}`,``)),this.out.write(Do.line+Eo.to(0)+this.outputText+Eo.save+this.outputError+Eo.restore))}};const W=F,{cursor:Io}=I,Lo=V,{clear:Ro,figures:G,style:zo,wrap:Bo,entriesToDisplay:Vo}=B;var Ho=class extends Lo{constructor(e={}){super(e),this.msg=e.message,this.cursor=e.cursor||0,this.scrollIndex=e.cursor||0,this.hint=e.hint||``,this.warn=e.warn||`- This option is disabled -`,this.minSelected=e.min,this.showMinError=!1,this.maxChoices=e.max,this.instructions=e.instructions,this.optionsPerPage=e.optionsPerPage||10,this.value=e.choices.map((e,t)=>(typeof e==`string`&&(e={title:e,value:t}),{title:e&&(e.title||e.value||e),description:e&&e.description,value:e&&(e.value===void 0?t:e.value),selected:e&&e.selected,disabled:e&&e.disabled})),this.clear=Ro(``,this.out.columns),e.overrideRender||this.render()}reset(){this.value.map(e=>!e.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(e=>e.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
`),this.close()}submit(){let e=this.value.filter(e=>e.selected);this.minSelected&&e.length<this.minSelected?(this.showMinError=!0,this.render()):(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
`),this.close())}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.value.length,this.render()}up(){this.cursor===0?this.cursor=this.value.length-1:this.cursor--,this.render()}down(){this.cursor===this.value.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.value[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){let e=this.value[this.cursor];if(e.selected)e.selected=!1,this.render();else if(e.disabled||this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();else e.selected=!0,this.render()}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();let e=!this.value[this.cursor].selected;this.value.filter(e=>!e.disabled).forEach(t=>t.selected=e),this.render()}_(e,t){if(e===` `)this.handleSpaceToggle();else if(e===`a`)this.toggleAll();else return this.bell()}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions==`string`?this.instructions:`
Instructions:
    ${G.arrowUp}/${G.arrowDown}: Highlight option\n    ${G.arrowLeft}/${G.arrowRight}/[space]: Toggle selection\n`+(this.maxChoices===void 0?`    a: Toggle all
`:``)+`    enter/return: Complete answer`:``}renderOption(e,t,n,r){let i=(t.selected?W.green(G.radioOn):G.radioOff)+` `+r+` `,a,o;return t.disabled?a=e===n?W.gray().underline(t.title):W.strikethrough().gray(t.title):(a=e===n?W.cyan().underline(t.title):t.title,e===n&&t.description&&(o=` - ${t.description}`,(i.length+a.length+o.length>=this.out.columns||t.description.split(/\r?\n/).length>1)&&(o=`
`+Bo(t.description,{margin:i.length,width:this.out.columns})))),i+a+W.gray(o||``)}paginateOptions(e){if(e.length===0)return W.red(`No matches for this query.`);let{startIndex:t,endIndex:n}=Vo(this.cursor,e.length,this.optionsPerPage),r,i=[];for(let a=t;a<n;a++)r=a===t&&t>0?G.arrowUp:a===n-1&&n<e.length?G.arrowDown:` `,i.push(this.renderOption(this.cursor,e[a],a,r));return`
`+i.join(`
`)}renderOptions(e){return this.done?``:this.paginateOptions(e)}renderDoneOrInstructions(){if(this.done)return this.value.filter(e=>e.selected).map(e=>e.title).join(`, `);let e=[W.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&e.push(W.yellow(this.warn)),e.join(` `)}render(){if(this.closed)return;this.firstRender&&this.out.write(Io.hide),super.render();let e=[zo.symbol(this.done,this.aborted),W.bold(this.msg),zo.delimiter(!1),this.renderDoneOrInstructions()].join(` `);this.showMinError&&=(e+=W.red(`You must select a minimum of ${this.minSelected} choices.`),!1),e+=this.renderOptions(this.value),this.out.write(this.clear+e),this.clear=Ro(e,this.out.columns)}};const Uo=F,Wo=V,{erase:Go,cursor:Ko}=I,{style:qo,clear:Jo,figures:Yo,wrap:Xo,entriesToDisplay:Zo}=B,Qo=(e,t)=>e[t]&&(e[t].value||e[t].title||e[t]),$o=(e,t)=>e[t]&&(e[t].title||e[t].value||e[t]),es=(e,t)=>{let n=e.findIndex(e=>e.value===t||e.title===t);return n>-1?n:void 0};var ts=class extends Wo{constructor(e={}){super(e),this.msg=e.message,this.suggest=e.suggest,this.choices=e.choices,this.initial=typeof e.initial==`number`?e.initial:es(e.choices,e.initial),this.select=this.initial||e.cursor||0,this.i18n={noMatches:e.noMatches||`no matches found`},this.fallback=e.fallback||this.initial,this.clearFirst=e.clearFirst||!1,this.suggestions=[],this.input=``,this.limit=e.limit||10,this.cursor=0,this.transform=qo.render(e.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=Jo(``,this.out.columns),this.complete(this.render),this.render()}set fallback(e){this._fb=Number.isSafeInteger(parseInt(e))?parseInt(e):e}get fallback(){let e;return typeof this._fb==`number`?e=this.choices[this._fb]:typeof this._fb==`string`&&(e={title:this._fb}),e||this._fb||{title:this.i18n.noMatches}}moveSelect(e){this.select=e,this.suggestions.length>0?this.value=Qo(this.suggestions,e):this.value=this.fallback.value,this.fire()}async complete(e){let t=this.completing=this.suggest(this.input,this.choices),n=await t;if(this.completing!==t)return;this.suggestions=n.map((e,t,n)=>({title:$o(n,t),value:Qo(n,t),description:e.description})),this.completing=!1;let r=Math.max(n.length-1,0);this.moveSelect(Math.min(r,this.select)),e&&e()}reset(){this.input=``,this.complete(()=>{this.moveSelect(this.initial===void 0?0:this.initial),this.render()}),this.render()}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
`),this.close())}abort(){this.done=this.aborted=!0,this.exited=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}submit(){this.done=!0,this.aborted=this.exited=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}_(e,t){let n=this.input.slice(0,this.cursor),r=this.input.slice(this.cursor);this.input=`${n}${e}${r}`,this.cursor=n.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let e=this.input.slice(0,this.cursor-1),t=this.input.slice(this.cursor);this.input=`${e}${t}`,this.complete(this.render),--this.cursor,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let e=this.input.slice(0,this.cursor),t=this.input.slice(this.cursor+1);this.input=`${e}${t}`,this.complete(this.render),this.render()}first(){this.moveSelect(0),this.render()}last(){this.moveSelect(this.suggestions.length-1),this.render()}up(){this.select===0?this.moveSelect(this.suggestions.length-1):this.moveSelect(this.select-1),this.render()}down(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}next(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1)),this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0)),this.render()}left(){if(this.cursor<=0)return this.bell();--this.cursor,this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor+=1,this.render()}renderOption(e,t,n,r){let i,a=n?Yo.arrowUp:r?Yo.arrowDown:` `,o=t?Uo.cyan().underline(e.title):e.title;return a=(t?Uo.cyan(Yo.pointer)+` `:`  `)+a,e.description&&(i=` - ${e.description}`,(a.length+o.length+i.length>=this.out.columns||e.description.split(/\r?\n/).length>1)&&(i=`
`+Xo(e.description,{margin:3,width:this.out.columns}))),a+` `+o+Uo.gray(i||``)}render(){if(this.closed)return;this.firstRender?this.out.write(Ko.hide):this.out.write(Jo(this.outputText,this.out.columns)),super.render();let{startIndex:e,endIndex:t}=Zo(this.select,this.choices.length,this.limit);if(this.outputText=[qo.symbol(this.done,this.aborted,this.exited),Uo.bold(this.msg),qo.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(` `),!this.done){let n=this.suggestions.slice(e,t).map((n,r)=>this.renderOption(n,this.select===r+e,r===0&&e>0,r+e===t-1&&t<this.choices.length)).join(`
`);this.outputText+=`
`+(n||Uo.gray(this.fallback.title))}this.out.write(Go.line+Ko.to(0)+this.outputText)}};const K=F,{cursor:ns}=I,rs=Ho,{clear:is,style:as,figures:q}=B;var os=class extends rs{constructor(e={}){e.overrideRender=!0,super(e),this.inputValue=``,this.clear=is(``,this.out.columns),this.filteredOptions=this.value,this.render()}last(){this.cursor=this.filteredOptions.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render()}up(){this.cursor===0?this.cursor=this.filteredOptions.length-1:this.cursor--,this.render()}down(){this.cursor===this.filteredOptions.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.filteredOptions[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions())}updateFilteredOptions(){let e=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(e=>this.inputValue?!!(typeof e.title==`string`&&e.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof e.value==`string`&&e.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);let t=this.filteredOptions.findIndex(t=>t===e);this.cursor=t<0?0:t,this.render()}handleSpaceToggle(){let e=this.filteredOptions[this.cursor];if(e.selected)e.selected=!1,this.render();else if(e.disabled||this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();else e.selected=!0,this.render()}handleInputChange(e){this.inputValue+=e,this.updateFilteredOptions()}_(e,t){e===` `?this.handleSpaceToggle():this.handleInputChange(e)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions==`string`?this.instructions:`
Instructions:
    ${q.arrowUp}/${q.arrowDown}: Highlight option
    ${q.arrowLeft}/${q.arrowRight}/[space]: Toggle selection
    [a,b,c]/delete: Filter choices
    enter/return: Complete answer
`:``}renderCurrentInput(){return`
Filtered results for: ${this.inputValue?this.inputValue:K.gray(`Enter something to filter`)}\n`}renderOption(e,t,n,r){let i=(t.selected?K.green(q.radioOn):q.radioOff)+` `+r+` `,a;return a=t.disabled?e===n?K.gray().underline(t.title):K.strikethrough().gray(t.title):e===n?K.cyan().underline(t.title):t.title,i+a}renderDoneOrInstructions(){if(this.done)return this.value.filter(e=>e.selected).map(e=>e.title).join(`, `);let e=[K.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&e.push(K.yellow(this.warn)),e.join(` `)}render(){if(this.closed)return;this.firstRender&&this.out.write(ns.hide),super.render();let e=[as.symbol(this.done,this.aborted),K.bold(this.msg),as.delimiter(!1),this.renderDoneOrInstructions()].join(` `);this.showMinError&&=(e+=K.red(`You must select a minimum of ${this.minSelected} choices.`),!1),e+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+e),this.clear=is(e,this.out.columns)}};const ss=F,cs=V,{style:ls,clear:us}=B,{erase:ds,cursor:fs}=I;var ps={TextPrompt:wa,SelectPrompt:Ma,TogglePrompt:za,DatePrompt:Co,NumberPrompt:Fo,MultiselectPrompt:Ho,AutocompletePrompt:ts,AutocompleteMultiselectPrompt:os,ConfirmPrompt:class extends cs{constructor(e={}){super(e),this.msg=e.message,this.value=e.initial,this.initialValue=!!e.initial,this.yesMsg=e.yes||`yes`,this.yesOption=e.yesOption||`(Y/n)`,this.noMsg=e.no||`no`,this.noOption=e.noOption||`(y/N)`,this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
`),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}_(e,t){return e.toLowerCase()===`y`?(this.value=!0,this.submit()):e.toLowerCase()===`n`?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(fs.hide):this.out.write(us(this.outputText,this.out.columns)),super.render(),this.outputText=[ls.symbol(this.done,this.aborted),ss.bold(this.msg),ls.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:ss.gray(this.initialValue?this.yesOption:this.noOption)].join(` `),this.out.write(ds.line+fs.to(0)+this.outputText))}}};(function(e){let t=e,n=ps,r=e=>e;function i(e,t,i={}){return new Promise((a,o)=>{let s=new n[e](t),c=i.onAbort||r,l=i.onSubmit||r,u=i.onExit||r;s.on(`state`,t.onState||r),s.on(`submit`,e=>a(l(e))),s.on(`exit`,e=>a(u(e))),s.on(`abort`,e=>o(c(e)))})}t.text=e=>i(`TextPrompt`,e),t.password=e=>(e.style=`password`,t.text(e)),t.invisible=e=>(e.style=`invisible`,t.text(e)),t.number=e=>i(`NumberPrompt`,e),t.date=e=>i(`DatePrompt`,e),t.confirm=e=>i(`ConfirmPrompt`,e),t.list=e=>{let t=e.separator||`,`;return i(`TextPrompt`,e,{onSubmit:e=>e.split(t).map(e=>e.trim())})},t.toggle=e=>i(`TogglePrompt`,e),t.select=e=>i(`SelectPrompt`,e),t.multiselect=e=>{e.choices=[].concat(e.choices||[]);let t=e=>e.filter(e=>e.selected).map(e=>e.value);return i(`MultiselectPrompt`,e,{onAbort:t,onSubmit:t})},t.autocompleteMultiselect=e=>{e.choices=[].concat(e.choices||[]);let t=e=>e.filter(e=>e.selected).map(e=>e.value);return i(`AutocompleteMultiselectPrompt`,e,{onAbort:t,onSubmit:t})};let a=(e,t)=>Promise.resolve(t.filter(t=>t.title.slice(0,e.length).toLowerCase()===e.toLowerCase()));t.autocomplete=e=>(e.suggest=e.suggest||a,e.choices=[].concat(e.choices||[]),i(`AutocompletePrompt`,e))})(Vi);const ms=Vi,hs=[`suggest`,`format`,`onState`,`validate`,`onRender`,`type`],gs=()=>{};async function J(e=[],{onSubmit:t=gs,onCancel:n=gs}={}){let r={},i=J._override||{};e=[].concat(e);let a,o,s,c,l,u,d=async(e,t,n=!1)=>{if(!(!n&&e.validate&&e.validate(t)!==!0))return e.format?await e.format(t,r):t};for(o of e)if({name:c,type:l}=o,typeof l==`function`&&(l=await l(a,{...r},o),o.type=l),l){for(let e in o){if(hs.includes(e))continue;let t=o[e];o[e]=typeof t==`function`?await t(a,{...r},u):t}if(u=o,typeof o.message!=`string`)throw Error(`prompt message is required`);if({name:c,type:l}=o,ms[l]===void 0)throw Error(`prompt type (${l}) is not defined`);if(i[o.name]!==void 0&&(a=await d(o,i[o.name]),a!==void 0)){r[c]=a;continue}try{a=J._injected?_s(J._injected,o.initial):await ms[l](o),r[c]=a=await d(o,a,!0),s=await t(o,a,r)}catch{s=!await n(o,r)}if(s)return r}return r}function _s(e,t){let n=e.shift();if(n instanceof Error)throw n;return n===void 0?t:n}function vs(e){J._injected=(J._injected||[]).concat(e)}function ys(e){J._override=Object.assign({},e)}const bs=S(Object.assign(J,{prompt:J,prompts:ms,inject:vs,override:ys}));var xs={},Y={};Object.defineProperty(Y,`__esModule`,{value:!0}),Y.sync=Y.isexe=void 0;const Ss=n.default,Cs=y.default;Y.isexe=async(e,t={})=>{let{ignoreErrors:n=!1}=t;try{return ws(await(0,Cs.stat)(e),t)}catch(e){let t=e;if(n||t.code===`EACCES`)return!1;throw t}},Y.sync=(e,t={})=>{let{ignoreErrors:n=!1}=t;try{return ws((0,Ss.statSync)(e),t)}catch(e){let t=e;if(n||t.code===`EACCES`)return!1;throw t}};const ws=(e,t)=>e.isFile()&&Ts(e,t),Ts=(e,t)=>{let n=t.uid??process.getuid?.(),r=t.groups??process.getgroups?.()??[],i=t.gid??process.getgid?.()??r[0];if(n===void 0||i===void 0)throw Error(`cannot get uid or gid`);let a=new Set([i,...r]),o=e.mode,s=e.uid,c=e.gid;return!!(o&1||o&8&&a.has(c)||o&64&&s===n||o&72&&n===0)};var X={};Object.defineProperty(X,`__esModule`,{value:!0}),X.sync=X.isexe=void 0;const Es=n.default,Ds=y.default;X.isexe=async(e,t={})=>{let{ignoreErrors:n=!1}=t;try{return ks(await(0,Ds.stat)(e),e,t)}catch(e){let t=e;if(n||t.code===`EACCES`)return!1;throw t}},X.sync=(e,t={})=>{let{ignoreErrors:n=!1}=t;try{return ks((0,Es.statSync)(e),e,t)}catch(e){let t=e;if(n||t.code===`EACCES`)return!1;throw t}};const Os=(e,t)=>{let{pathExt:n=process.env.PATHEXT||``}=t,r=n.split(`;`);if(r.indexOf(``)!==-1)return!0;for(let t=0;t<r.length;t++){let n=r[t].toLowerCase(),i=e.substring(e.length-n.length).toLowerCase();if(n&&i===n)return!0}return!1},ks=(e,t,n)=>e.isFile()&&Os(t,n);var As={};Object.defineProperty(As,`__esModule`,{value:!0}),(function(e){var t=x&&x.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=x&&x.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,`default`,{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=x&&x.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var i in e)i!==`default`&&Object.prototype.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r},i=x&&x.__exportStar||function(e,n){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,`__esModule`,{value:!0}),e.sync=e.isexe=e.posix=e.win32=void 0;let a=r(Y);e.posix=a;let o=r(X);e.win32=o,i(As,e);let s=(process.env._ISEXE_TEST_PLATFORM_||process.platform)===`win32`?o:a;e.isexe=s.isexe,e.sync=s.sync})(xs);const{isexe:js,sync:Ms}=xs,{join:Ns,delimiter:Ps,sep:Fs,posix:Is}=r.default,Ls=process.platform===`win32`,Rs=new RegExp(`[${Is.sep}${Fs===Is.sep?``:Fs}]`.replace(/(\\)/g,`\\$1`)),zs=RegExp(`^\\.${Rs.source}`),Bs=e=>Object.assign(Error(`not found: ${e}`),{code:`ENOENT`}),Vs=(e,{path:t=process.env.PATH,pathExt:n=process.env.PATHEXT,delimiter:r=Ps})=>{let i=e.match(Rs)?[``]:[...Ls?[process.cwd()]:[],...(t||``).split(r)];if(Ls){let t=n||[`.EXE`,`.CMD`,`.BAT`,`.COM`].join(r),a=t.split(r).flatMap(e=>[e,e.toLowerCase()]);return e.includes(`.`)&&a[0]!==``&&a.unshift(``),{pathEnv:i,pathExt:a,pathExtExe:t}}return{pathEnv:i,pathExt:[``]}},Hs=(e,t)=>{let n=/^".*"$/.test(e)?e.slice(1,-1):e;return(!n&&zs.test(t)?t.slice(0,2):``)+Ns(n,t)},Us=async(e,t={})=>{let{pathEnv:n,pathExt:r,pathExtExe:i}=Vs(e,t),a=[];for(let o of n){let n=Hs(o,e);for(let e of r){let r=n+e;if(await js(r,{pathExt:i,ignoreErrors:!0})){if(!t.all)return r;a.push(r)}}}if(t.all&&a.length)return a;if(t.nothrow)return null;throw Bs(e)},Ws=(e,t={})=>{let{pathEnv:n,pathExt:r,pathExtExe:i}=Vs(e,t),a=[];for(let o of n){let n=Hs(o,e);for(let e of r){let r=n+e;if(Ms(r,{pathExt:i,ignoreErrors:!0})){if(!t.all)return r;a.push(r)}}}if(t.all&&a.length)return a;if(t.nothrow)return null;throw Bs(e)};var Gs=Us;Us.sync=Ws;const Ks=S(Gs);(0,f.join)(d.default.tmpdir(),`antfu-ni`);function qs(e,t){return e.slice().filter(e=>e!==t)}function Js(e){return Ks.sync(e,{nothrow:!0})!==null}async function Ys({autoInstall:e,programmatic:t,cwd:n}={}){let r=null,i=null,a=await ki(Object.keys(Fe),{cwd:n}),o;if(o=a?f.default.resolve(a,`../package.json`):await ki(`package.json`,{cwd:n}),o&&u.default.existsSync(o))try{let e=JSON.parse(u.default.readFileSync(o,`utf8`));if(typeof e.packageManager==`string`){let[n,a]=e.packageManager.replace(/^\^/,``).split(`@`);i=a,n===`yarn`&&Number.parseInt(a)>1?(r=`yarn@berry`,i=`berry`):n===`pnpm`&&Number.parseInt(a)<7?r=`pnpm@6`:n in Ne?r=n:t||console.warn(`[ni] Unknown packageManager:`,e.packageManager)}}catch{}if(!r&&a&&(r=Fe[f.default.basename(a)]),r&&!Js(r.split(`@`)[0])&&!t){if(!e){console.warn(`[ni] Detected ${r} but it doesn't seem to be installed.
`),p.default.env.CI&&p.default.exit(1);let{tryInstall:e}=await bs({name:`tryInstall`,type:`confirm`,message:`Would you like to globally install ${M(r,Ie[r])}?`});e||p.default.exit(1)}await pi(`npm i -g ${r.split(`@`)[0]}${i?`@${i}`:``}`,{stdio:`inherit`,cwd:n})}return r}const Xs=p.default.env.NI_CONFIG_FILE,Zs=p.default.platform===`win32`?p.default.env.USERPROFILE:p.default.env.HOME,Qs=f.default.join(Zs||`~/`,`.nirc`),$s=Xs||Qs,ec={defaultAgent:`prompt`,globalAgent:`npm`};let tc;async function nc(){if(!tc){tc=Object.assign({},ec,u.default.existsSync($s)?Ue.parse(u.default.readFileSync($s,`utf-8`)):null);let e=await Ys({programmatic:!0});e&&(tc.defaultAgent=e)}return tc}async function rc(e){let{defaultAgent:t}=await nc();return t===`prompt`&&(e||p.default.env.CI)?`npm`:t}async function ic(){let{globalAgent:e}=await nc();return e}var ac=class extends Error{constructor({agent:e,command:t}){super(`Command "${t}" is not support by agent "${e}"`)}};function Z(e,t,n=[]){if(!(e in Ne))throw Error(`Unsupported agent "${e}"`);let r=Ne[e][t];if(typeof r==`function`)return r(n);if(!r)throw new ac({agent:e,command:t});return r.replace(`{0}`,n.map(e=>!e.startsWith(`--`)&&e.includes(` `)?JSON.stringify(e):e).join(` `)).trim()}const oc=(e,t,n)=>(e===`bun`&&(t=t.map(e=>e===`-D`?`-d`:e)),t.includes(`-g`)?Z(e,`global`,qs(t,`-g`)):t.includes(`--frozen-if-present`)?(t=qs(t,`--frozen-if-present`),Z(e,n?.hasLock?`frozen`:`install`,t)):t.includes(`--frozen`)?Z(e,`frozen`,qs(t,`--frozen`)):t.length===0||t.every(e=>e.startsWith(`-`))?Z(e,`install`,t):Z(e,`add`,t)),sc=(e,t)=>(t.length===0&&t.push(`start`),t.includes(`--if-present`)&&(t=qs(t,`--if-present`),t[0]=`--if-present ${t[0]}`),Z(e,`run`,t)),cc=(e,t)=>Z(e,`agent`,t);let lc,uc,dc,fc,pc=!0;typeof process<`u`&&({FORCE_COLOR:lc,NODE_DISABLE_COLORS:uc,NO_COLOR:dc,TERM:fc}=process.env||{},pc=process.stdout&&process.stdout.isTTY);const Q={enabled:!uc&&dc==null&&fc!==`dumb`&&(lc!=null&&lc!==`0`||pc),reset:$(0,0),bold:$(1,22),dim:$(2,22),italic:$(3,23),underline:$(4,24),inverse:$(7,27),hidden:$(8,28),strikethrough:$(9,29),black:$(30,39),red:$(31,39),green:$(32,39),yellow:$(33,39),blue:$(34,39),magenta:$(35,39),cyan:$(36,39),white:$(37,39),gray:$(90,39),grey:$(90,39),bgBlack:$(40,49),bgRed:$(41,49),bgGreen:$(42,49),bgYellow:$(43,49),bgBlue:$(44,49),bgMagenta:$(45,49),bgCyan:$(46,49),bgWhite:$(47,49)};function mc(e,t){let n=0,r,i=``,a=``;for(;n<e.length;n++)r=e[n],i+=r.open,a+=r.close,~t.indexOf(r.close)&&(t=t.replace(r.rgx,r.close+r.open));return i+t+a}function hc(e,t){let n={has:e,keys:t};return n.reset=Q.reset.bind(n),n.bold=Q.bold.bind(n),n.dim=Q.dim.bind(n),n.italic=Q.italic.bind(n),n.underline=Q.underline.bind(n),n.inverse=Q.inverse.bind(n),n.hidden=Q.hidden.bind(n),n.strikethrough=Q.strikethrough.bind(n),n.black=Q.black.bind(n),n.red=Q.red.bind(n),n.green=Q.green.bind(n),n.yellow=Q.yellow.bind(n),n.blue=Q.blue.bind(n),n.magenta=Q.magenta.bind(n),n.cyan=Q.cyan.bind(n),n.white=Q.white.bind(n),n.gray=Q.gray.bind(n),n.grey=Q.grey.bind(n),n.bgBlack=Q.bgBlack.bind(n),n.bgRed=Q.bgRed.bind(n),n.bgGreen=Q.bgGreen.bind(n),n.bgYellow=Q.bgYellow.bind(n),n.bgBlue=Q.bgBlue.bind(n),n.bgMagenta=Q.bgMagenta.bind(n),n.bgCyan=Q.bgCyan.bind(n),n.bgWhite=Q.bgWhite.bind(n),n}function $(e,t){let n={open:`\x1b[${e}m`,close:`\x1b[${t}m`,rgx:RegExp(`\\x1b\\[${t}m`,`g`)};return function(t){return this!==void 0&&this.has!==void 0?(~this.has.indexOf(e)||(this.has.push(e),this.keys.push(n)),t===void 0?this:Q.enabled?mc(this.keys,t+``):t+``):t===void 0?hc([e],[n]):Q.enabled?mc([n],t+``):t+``}}async function gc(e,t,n={},r=n.cwd??p.default.cwd()){if(t.includes(`-g`))return await e(await ic(),t);let i=await Ys({...n,cwd:r})||await rc(n.programmatic);if(!(i===`prompt`&&(i=(await bs({name:`agent`,type:`select`,message:`Choose the agent`,choices:Pe.filter(e=>!e.includes(`@`)).map(e=>({title:e,value:e}))})).agent,!i)))return await e(i,t,{programmatic:n.programmatic,hasLock:!!i,cwd:r})}var _c=e.a(t.l()),vc=t.c(),yc=()=>(0,vc.dedent)(_c.default`
    ${t.i} {bold No package.json found}
    Chromatic only works from inside a JavaScript project.
    We expected to find a package.json somewhere up the directory tree.
    Are you sure you're running from your project directory?
  `);Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return sc}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return oc}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return gc}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return Oe}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return cc}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return De}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return yc}});
//# sourceMappingURL=noPackageJson-zIsQeKSL.cjs.map
//# debugId=135a90dc-036e-5be6-bc12-c43c90f42397