@tencent-ai/codebuddy-code 1.24.0-next.f2e76f0.20251105 → 1.25.0-next.fadc360.20251106
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +248 -4
- package/dist/codebuddy.js +4 -4
- package/package.json +1 -1
- package/product.cloudhosted.json +2 -2
- package/product.internal.json +2 -2
- package/product.ioa.json +2 -2
- package/product.json +2 -2
- package/product.selfhosted.json +2 -2
- package/dist/338.codebuddy.js +0 -1
- package/dist/344.codebuddy.js +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tencent-ai/codebuddy-code",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.25.0-next.fadc360.20251106",
|
|
4
4
|
"description": "Use CodeBuddy, Tencent's AI assistant, right from your terminal. CodeBuddy can understand your codebase, edit files, run terminal commands, and handle entire workflows for you.",
|
|
5
5
|
"main": "lib/node/index.js",
|
|
6
6
|
"typings": "lib/node/index.d.ts",
|
package/product.cloudhosted.json
CHANGED
|
@@ -175,6 +175,6 @@
|
|
|
175
175
|
"productFeatures": {
|
|
176
176
|
"BillingNotice": false
|
|
177
177
|
},
|
|
178
|
-
"commit": "
|
|
179
|
-
"date": "2025-11-
|
|
178
|
+
"commit": "fadc360b7f351430500730afcb2965fd27656ae8",
|
|
179
|
+
"date": "2025-11-05T16:04:55.004Z"
|
|
180
180
|
}
|
package/product.internal.json
CHANGED
|
@@ -192,6 +192,6 @@
|
|
|
192
192
|
"productFeatures": {
|
|
193
193
|
"BillingNotice": false
|
|
194
194
|
},
|
|
195
|
-
"commit": "
|
|
196
|
-
"date": "2025-11-
|
|
195
|
+
"commit": "fadc360b7f351430500730afcb2965fd27656ae8",
|
|
196
|
+
"date": "2025-11-05T16:04:52.799Z"
|
|
197
197
|
}
|
package/product.ioa.json
CHANGED
|
@@ -333,6 +333,6 @@
|
|
|
333
333
|
"productFeatures": {
|
|
334
334
|
"BillingNotice": false
|
|
335
335
|
},
|
|
336
|
-
"commit": "
|
|
337
|
-
"date": "2025-11-
|
|
336
|
+
"commit": "fadc360b7f351430500730afcb2965fd27656ae8",
|
|
337
|
+
"date": "2025-11-05T16:04:53.906Z"
|
|
338
338
|
}
|
package/product.json
CHANGED
|
@@ -692,6 +692,6 @@
|
|
|
692
692
|
"description": "tool-skill-description"
|
|
693
693
|
}
|
|
694
694
|
],
|
|
695
|
-
"commit": "
|
|
696
|
-
"date": "2025-11-
|
|
695
|
+
"commit": "fadc360b7f351430500730afcb2965fd27656ae8",
|
|
696
|
+
"date": "2025-11-05T16:04:51.699Z"
|
|
697
697
|
}
|
package/product.selfhosted.json
CHANGED
|
@@ -145,6 +145,6 @@
|
|
|
145
145
|
"productFeatures": {
|
|
146
146
|
"BillingNotice": false
|
|
147
147
|
},
|
|
148
|
-
"commit": "
|
|
149
|
-
"date": "2025-11-
|
|
148
|
+
"commit": "fadc360b7f351430500730afcb2965fd27656ae8",
|
|
149
|
+
"date": "2025-11-05T16:04:56.101Z"
|
|
150
150
|
}
|
package/dist/338.codebuddy.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";exports.id=338,exports.ids=[338],exports.modules={81338:(t,e,i)=>{i.r(e),i.d(e,{Header:()=>Header,Pack:()=>Pack,PackJob:()=>PackJob,PackSync:()=>PackSync,Parser:()=>Parser,Pax:()=>Pax,ReadEntry:()=>ReadEntry,Unpack:()=>Unpack,UnpackSync:()=>UnpackSync,WriteEntry:()=>WriteEntry,WriteEntrySync:()=>WriteEntrySync,WriteEntryTar:()=>WriteEntryTar,c:()=>Oe,create:()=>Oe,extract:()=>Ei,filesFilter:()=>filesFilter,list:()=>xt,r:()=>wi,replace:()=>wi,t:()=>xt,types:()=>s,u:()=>gi,update:()=>gi,x:()=>Ei});var s={};i.r(s),i.d(s,{code:()=>J,isCode:()=>isCode,isName:()=>isName,name:()=>X});var r=i(24434),n=i(79896),h=i(26022);const o=n.writev,a=Symbol("_autoClose"),l=Symbol("_close"),c=Symbol("_ended"),d=Symbol("_fd"),u=Symbol("_finished"),m=Symbol("_flags"),p=Symbol("_flush"),f=Symbol("_handleChunk"),y=Symbol("_makeBuf"),b=Symbol("_mode"),E=Symbol("_needDrain"),w=Symbol("_onerror"),g=Symbol("_onopen"),R=Symbol("_onread"),_=Symbol("_onwrite"),S=Symbol("_open"),v=Symbol("_path"),O=Symbol("_pos"),k=Symbol("_queue"),T=Symbol("_read"),L=Symbol("_readSize"),N=Symbol("_reading"),A=Symbol("_remain"),D=Symbol("_size"),I=Symbol("_write"),x=Symbol("_writing"),F=Symbol("_defaultFlag"),P=Symbol("_errored");class ReadStream extends h.n_{[P]=!1;[d];[v];[L];[N]=!1;[D];[A];[a];constructor(t,e){if(super(e=e||{}),this.readable=!0,this.writable=!1,"string"!=typeof t)throw new TypeError("path must be a string");this[P]=!1,this[d]="number"==typeof e.fd?e.fd:void 0,this[v]=t,this[L]=e.readSize||16777216,this[N]=!1,this[D]="number"==typeof e.size?e.size:1/0,this[A]=this[D],this[a]="boolean"!=typeof e.autoClose||e.autoClose,"number"==typeof this[d]?this[T]():this[S]()}get fd(){return this[d]}get path(){return this[v]}write(){throw new TypeError("this is a readable stream")}end(){throw new TypeError("this is a readable stream")}[S](){n.open(this[v],"r",((t,e)=>this[g](t,e)))}[g](t,e){t?this[w](t):(this[d]=e,this.emit("open",e),this[T]())}[y](){return Buffer.allocUnsafe(Math.min(this[L],this[A]))}[T](){if(!this[N]){this[N]=!0;const t=this[y]();if(0===t.length)return process.nextTick((()=>this[R](null,0,t)));n.read(this[d],t,0,t.length,null,((t,e,i)=>this[R](t,e,i)))}}[R](t,e,i){this[N]=!1,t?this[w](t):this[f](e,i)&&this[T]()}[l](){if(this[a]&&"number"==typeof this[d]){const t=this[d];this[d]=void 0,n.close(t,(t=>t?this.emit("error",t):this.emit("close")))}}[w](t){this[N]=!0,this[l](),this.emit("error",t)}[f](t,e){let i=!1;return this[A]-=t,t>0&&(i=super.write(t<e.length?e.subarray(0,t):e)),(0===t||this[A]<=0)&&(i=!1,this[l](),super.end()),i}emit(t,...e){switch(t){case"prefinish":case"finish":return!1;case"drain":return"number"==typeof this[d]&&this[T](),!1;case"error":return!this[P]&&(this[P]=!0,super.emit(t,...e));default:return super.emit(t,...e)}}}class ReadStreamSync extends ReadStream{[S](){let t=!0;try{this[g](null,n.openSync(this[v],"r")),t=!1}finally{t&&this[l]()}}[T](){let t=!0;try{if(!this[N]){for(this[N]=!0;;){const t=this[y](),e=0===t.length?0:n.readSync(this[d],t,0,t.length,null);if(!this[f](e,t))break}this[N]=!1}t=!1}finally{t&&this[l]()}}[l](){if(this[a]&&"number"==typeof this[d]){const t=this[d];this[d]=void 0,n.closeSync(t),this.emit("close")}}}class WriteStream extends r{readable=!1;writable=!0;[P]=!1;[x]=!1;[c]=!1;[k]=[];[E]=!1;[v];[b];[a];[d];[F];[m];[u]=!1;[O];constructor(t,e){super(e=e||{}),this[v]=t,this[d]="number"==typeof e.fd?e.fd:void 0,this[b]=void 0===e.mode?438:e.mode,this[O]="number"==typeof e.start?e.start:void 0,this[a]="boolean"!=typeof e.autoClose||e.autoClose;const i=void 0!==this[O]?"r+":"w";this[F]=void 0===e.flags,this[m]=void 0===e.flags?i:e.flags,void 0===this[d]&&this[S]()}emit(t,...e){if("error"===t){if(this[P])return!1;this[P]=!0}return super.emit(t,...e)}get fd(){return this[d]}get path(){return this[v]}[w](t){this[l](),this[x]=!0,this.emit("error",t)}[S](){n.open(this[v],this[m],this[b],((t,e)=>this[g](t,e)))}[g](t,e){this[F]&&"r+"===this[m]&&t&&"ENOENT"===t.code?(this[m]="w",this[S]()):t?this[w](t):(this[d]=e,this.emit("open",e),this[x]||this[p]())}end(t,e){return t&&this.write(t,e),this[c]=!0,this[x]||this[k].length||"number"!=typeof this[d]||this[_](null,0),this}write(t,e){return"string"==typeof t&&(t=Buffer.from(t,e)),this[c]?(this.emit("error",new Error("write() after end()")),!1):void 0===this[d]||this[x]||this[k].length?(this[k].push(t),this[E]=!0,!1):(this[x]=!0,this[I](t),!0)}[I](t){n.write(this[d],t,0,t.length,this[O],((t,e)=>this[_](t,e)))}[_](t,e){t?this[w](t):(void 0!==this[O]&&"number"==typeof e&&(this[O]+=e),this[k].length?this[p]():(this[x]=!1,this[c]&&!this[u]?(this[u]=!0,this[l](),this.emit("finish")):this[E]&&(this[E]=!1,this.emit("drain"))))}[p](){if(0===this[k].length)this[c]&&this[_](null,0);else if(1===this[k].length)this[I](this[k].pop());else{const t=this[k];this[k]=[],o(this[d],t,this[O],((t,e)=>this[_](t,e)))}}[l](){if(this[a]&&"number"==typeof this[d]){const t=this[d];this[d]=void 0,n.close(t,(t=>t?this.emit("error",t):this.emit("close")))}}}class WriteStreamSync extends WriteStream{[S](){let t;if(this[F]&&"r+"===this[m])try{t=n.openSync(this[v],this[m],this[b])}catch(t){if("ENOENT"===t?.code)return this[m]="w",this[S]();throw t}else t=n.openSync(this[v],this[m],this[b]);this[g](null,t)}[l](){if(this[a]&&"number"==typeof this[d]){const t=this[d];this[d]=void 0,n.closeSync(t),this.emit("close")}}[I](t){let e=!0;try{this[_](null,n.writeSync(this[d],t,0,t.length,this[O])),e=!1}finally{if(e)try{this[l]()}catch{}}}}var C=i(76760),B=i(73024),M=i(16928);const z=new Map([["C","cwd"],["f","file"],["z","gzip"],["P","preservePaths"],["U","unlink"],["strip-components","strip"],["stripComponents","strip"],["keep-newer","newer"],["keepNewer","newer"],["keep-newer-files","newer"],["keepNewerFiles","newer"],["k","keep"],["keep-existing","keep"],["keepExisting","keep"],["m","noMtime"],["no-mtime","noMtime"],["p","preserveOwner"],["L","follow"],["h","follow"],["onentry","onReadEntry"]]),dealiasKey=t=>{const e=z.get(t);return e||t},dealias=(t={})=>{if(!t)return{};const e={};for(const[i,s]of Object.entries(t)){e[dealiasKey(i)]=s}return void 0===e.chmod&&!1===e.noChmod&&(e.chmod=!0),delete e.noChmod,e},makeCommand=(t,e,i,s,r)=>Object.assign(((n=[],h,o)=>{Array.isArray(n)&&(h=n,n={}),"function"==typeof h&&(o=h,h=void 0),h=h?Array.from(h):[];const a=dealias(n);if(r?.(a,h),(l=a).sync&&l.file){if("function"==typeof o)throw new TypeError("callback not supported for sync tar functions");return t(a,h)}if((t=>!t.sync&&!!t.file)(a)){const t=e(a,h),i=o||void 0;return i?t.then((()=>i()),i):t}if((t=>!!t.sync&&!t.file)(a)){if("function"==typeof o)throw new TypeError("callback not supported for sync tar functions");return i(a,h)}if((t=>!t.sync&&!t.file)(a)){if("function"==typeof o)throw new TypeError("callback only supported with file option");return s(a,h)}throw new Error("impossible options??");var l}),{syncFile:t,asyncFile:e,syncNoFile:i,asyncNoFile:s,validate:r});var U=i(42613),H=i(20181),W=i(43106),Z=i.t(W,2);const j=W.constants||{ZLIB_VERNUM:4736},G=Object.freeze(Object.assign(Object.create(null),{Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_VERSION_ERROR:-6,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,DEFLATE:1,INFLATE:2,GZIP:3,GUNZIP:4,DEFLATERAW:5,INFLATERAW:6,UNZIP:7,BROTLI_DECODE:8,BROTLI_ENCODE:9,Z_MIN_WINDOWBITS:8,Z_MAX_WINDOWBITS:15,Z_DEFAULT_WINDOWBITS:15,Z_MIN_CHUNK:64,Z_MAX_CHUNK:1/0,Z_DEFAULT_CHUNK:16384,Z_MIN_MEMLEVEL:1,Z_MAX_MEMLEVEL:9,Z_DEFAULT_MEMLEVEL:8,Z_MIN_LEVEL:-1,Z_MAX_LEVEL:9,Z_DEFAULT_LEVEL:-1,BROTLI_OPERATION_PROCESS:0,BROTLI_OPERATION_FLUSH:1,BROTLI_OPERATION_FINISH:2,BROTLI_OPERATION_EMIT_METADATA:3,BROTLI_MODE_GENERIC:0,BROTLI_MODE_TEXT:1,BROTLI_MODE_FONT:2,BROTLI_DEFAULT_MODE:0,BROTLI_MIN_QUALITY:0,BROTLI_MAX_QUALITY:11,BROTLI_DEFAULT_QUALITY:11,BROTLI_MIN_WINDOW_BITS:10,BROTLI_MAX_WINDOW_BITS:24,BROTLI_LARGE_MAX_WINDOW_BITS:30,BROTLI_DEFAULT_WINDOW:22,BROTLI_MIN_INPUT_BLOCK_BITS:16,BROTLI_MAX_INPUT_BLOCK_BITS:24,BROTLI_PARAM_MODE:0,BROTLI_PARAM_QUALITY:1,BROTLI_PARAM_LGWIN:2,BROTLI_PARAM_LGBLOCK:3,BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING:4,BROTLI_PARAM_SIZE_HINT:5,BROTLI_PARAM_LARGE_WINDOW:6,BROTLI_PARAM_NPOSTFIX:7,BROTLI_PARAM_NDIRECT:8,BROTLI_DECODER_RESULT_ERROR:0,BROTLI_DECODER_RESULT_SUCCESS:1,BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT:2,BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION:0,BROTLI_DECODER_PARAM_LARGE_WINDOW:1,BROTLI_DECODER_NO_ERROR:0,BROTLI_DECODER_SUCCESS:1,BROTLI_DECODER_NEEDS_MORE_INPUT:2,BROTLI_DECODER_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE:-1,BROTLI_DECODER_ERROR_FORMAT_RESERVED:-2,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE:-3,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET:-4,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME:-5,BROTLI_DECODER_ERROR_FORMAT_CL_SPACE:-6,BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE:-7,BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT:-8,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1:-9,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2:-10,BROTLI_DECODER_ERROR_FORMAT_TRANSFORM:-11,BROTLI_DECODER_ERROR_FORMAT_DICTIONARY:-12,BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS:-13,BROTLI_DECODER_ERROR_FORMAT_PADDING_1:-14,BROTLI_DECODER_ERROR_FORMAT_PADDING_2:-15,BROTLI_DECODER_ERROR_FORMAT_DISTANCE:-16,BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET:-19,BROTLI_DECODER_ERROR_INVALID_ARGUMENTS:-20,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES:-21,BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS:-22,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP:-25,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1:-26,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2:-27,BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES:-30,BROTLI_DECODER_ERROR_UNREACHABLE:-31},j)),Y=H.Buffer.concat,V=Object.getOwnPropertyDescriptor(H.Buffer,"concat"),noop=t=>t,$=!0===V?.writable||void 0!==V?.set?t=>{H.Buffer.concat=t?noop:Y}:t=>{},K=Symbol("_superWrite");class ZlibError extends Error{code;errno;constructor(t){super("zlib: "+t.message),this.code=t.code,this.errno=t.errno,this.code||(this.code="ZLIB_ERROR"),this.message="zlib: "+t.message,Error.captureStackTrace(this,this.constructor)}get name(){return"ZlibError"}}const q=Symbol("flushFlag");class ZlibBase extends h.n_{#t=!1;#e=!1;#i;#s;#r;#n;#h;get sawError(){return this.#t}get handle(){return this.#n}get flushFlag(){return this.#i}constructor(t,e){if(!t||"object"!=typeof t)throw new TypeError("invalid options for ZlibBase constructor");super(t),this.#i=t.flush??0,this.#s=t.finishFlush??0,this.#r=t.fullFlushFlag??0;try{this.#n=new Z[e](t)}catch(t){throw new ZlibError(t)}this.#h=t=>{this.#t||(this.#t=!0,this.close(),this.emit("error",t))},this.#n?.on("error",(t=>this.#h(new ZlibError(t)))),this.once("end",(()=>this.close))}close(){this.#n&&(this.#n.close(),this.#n=void 0,this.emit("close"))}reset(){if(!this.#t)return U(this.#n,"zlib binding closed"),this.#n.reset?.()}flush(t){this.ended||("number"!=typeof t&&(t=this.#r),this.write(Object.assign(H.Buffer.alloc(0),{[q]:t})))}end(t,e,i){return"function"==typeof t&&(i=t,e=void 0,t=void 0),"function"==typeof e&&(i=e,e=void 0),t&&(e?this.write(t,e):this.write(t)),this.flush(this.#s),this.#e=!0,super.end(i)}get ended(){return this.#e}[K](t){return super.write(t)}write(t,e,i){if("function"==typeof e&&(i=e,e="utf8"),"string"==typeof t&&(t=H.Buffer.from(t,e)),this.#t)return;U(this.#n,"zlib binding closed");const s=this.#n._handle,r=s.close;s.close=()=>{};const n=this.#n.close;let h,o;this.#n.close=()=>{},$(!0);try{const e="number"==typeof t[q]?t[q]:this.#i;h=this.#n._processChunk(t,e),$(!1)}catch(t){$(!1),this.#h(new ZlibError(t))}finally{this.#n&&(this.#n._handle=s,s.close=r,this.#n.close=n,this.#n.removeAllListeners("error"))}if(this.#n&&this.#n.on("error",(t=>this.#h(new ZlibError(t)))),h)if(Array.isArray(h)&&h.length>0){const t=h[0];o=this[K](H.Buffer.from(t));for(let t=1;t<h.length;t++)o=this[K](h[t])}else o=this[K](H.Buffer.from(h));return i&&i(),o}}class Zlib extends ZlibBase{#o;#a;constructor(t,e){(t=t||{}).flush=t.flush||G.Z_NO_FLUSH,t.finishFlush=t.finishFlush||G.Z_FINISH,t.fullFlushFlag=G.Z_FULL_FLUSH,super(t,e),this.#o=t.level,this.#a=t.strategy}params(t,e){if(!this.sawError){if(!this.handle)throw new Error("cannot switch params when binding is closed");if(!this.handle.params)throw new Error("not supported in this implementation");if(this.#o!==t||this.#a!==e){this.flush(G.Z_SYNC_FLUSH),U(this.handle,"zlib binding closed");const i=this.handle.flush;this.handle.flush=(t,e)=>{"function"==typeof t&&(e=t,t=this.flushFlag),this.flush(t),e?.()};try{this.handle.params(t,e)}finally{this.handle.flush=i}this.handle&&(this.#o=t,this.#a=e)}}}}class Gzip extends Zlib{#l;constructor(t){super(t,"Gzip"),this.#l=t&&!!t.portable}[K](t){return this.#l?(this.#l=!1,t[9]=255,super[K](t)):super[K](t)}}class Unzip extends Zlib{constructor(t){super(t,"Unzip")}}class Brotli extends ZlibBase{constructor(t,e){(t=t||{}).flush=t.flush||G.BROTLI_OPERATION_PROCESS,t.finishFlush=t.finishFlush||G.BROTLI_OPERATION_FINISH,t.fullFlushFlag=G.BROTLI_OPERATION_FLUSH,super(t,e)}}class BrotliCompress extends Brotli{constructor(t){super(t,"BrotliCompress")}}class BrotliDecompress extends Brotli{constructor(t){super(t,"BrotliDecompress")}}class Yallist{tail;head;length=0;static create(t=[]){return new Yallist(t)}constructor(t=[]){for(const e of t)this.push(e)}*[Symbol.iterator](){for(let t=this.head;t;t=t.next)yield t.value}removeNode(t){if(t.list!==this)throw new Error("removing node which does not belong to this list");const e=t.next,i=t.prev;return e&&(e.prev=i),i&&(i.next=e),t===this.head&&(this.head=e),t===this.tail&&(this.tail=i),this.length--,t.next=void 0,t.prev=void 0,t.list=void 0,e}unshiftNode(t){if(t===this.head)return;t.list&&t.list.removeNode(t);const e=this.head;t.list=this,t.next=e,e&&(e.prev=t),this.head=t,this.tail||(this.tail=t),this.length++}pushNode(t){if(t===this.tail)return;t.list&&t.list.removeNode(t);const e=this.tail;t.list=this,t.prev=e,e&&(e.next=t),this.tail=t,this.head||(this.head=t),this.length++}push(...t){for(let e=0,i=t.length;e<i;e++)push(this,t[e]);return this.length}unshift(...t){for(var e=0,i=t.length;e<i;e++)unshift(this,t[e]);return this.length}pop(){if(!this.tail)return;const t=this.tail.value,e=this.tail;return this.tail=this.tail.prev,this.tail?this.tail.next=void 0:this.head=void 0,e.list=void 0,this.length--,t}shift(){if(!this.head)return;const t=this.head.value,e=this.head;return this.head=this.head.next,this.head?this.head.prev=void 0:this.tail=void 0,e.list=void 0,this.length--,t}forEach(t,e){e=e||this;for(let i=this.head,s=0;i;s++)t.call(e,i.value,s,this),i=i.next}forEachReverse(t,e){e=e||this;for(let i=this.tail,s=this.length-1;i;s--)t.call(e,i.value,s,this),i=i.prev}get(t){let e=0,i=this.head;for(;i&&e<t;e++)i=i.next;if(e===t&&i)return i.value}getReverse(t){let e=0,i=this.tail;for(;i&&e<t;e++)i=i.prev;if(e===t&&i)return i.value}map(t,e){e=e||this;const i=new Yallist;for(let s=this.head;s;)i.push(t.call(e,s.value,this)),s=s.next;return i}mapReverse(t,e){e=e||this;var i=new Yallist;for(let s=this.tail;s;)i.push(t.call(e,s.value,this)),s=s.prev;return i}reduce(t,e){let i,s=this.head;if(arguments.length>1)i=e;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");s=this.head.next,i=this.head.value}for(var r=0;s;r++)i=t(i,s.value,r),s=s.next;return i}reduceReverse(t,e){let i,s=this.tail;if(arguments.length>1)i=e;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");s=this.tail.prev,i=this.tail.value}for(let e=this.length-1;s;e--)i=t(i,s.value,e),s=s.prev;return i}toArray(){const t=new Array(this.length);for(let e=0,i=this.head;i;e++)t[e]=i.value,i=i.next;return t}toArrayReverse(){const t=new Array(this.length);for(let e=0,i=this.tail;i;e++)t[e]=i.value,i=i.prev;return t}slice(t=0,e=this.length){e<0&&(e+=this.length),t<0&&(t+=this.length);const i=new Yallist;if(e<t||e<0)return i;t<0&&(t=0),e>this.length&&(e=this.length);let s=this.head,r=0;for(r=0;s&&r<t;r++)s=s.next;for(;s&&r<e;r++,s=s.next)i.push(s.value);return i}sliceReverse(t=0,e=this.length){e<0&&(e+=this.length),t<0&&(t+=this.length);const i=new Yallist;if(e<t||e<0)return i;t<0&&(t=0),e>this.length&&(e=this.length);let s=this.length,r=this.tail;for(;r&&s>e;s--)r=r.prev;for(;r&&s>t;s--,r=r.prev)i.push(r.value);return i}splice(t,e=0,...i){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);let s=this.head;for(let e=0;s&&e<t;e++)s=s.next;const r=[];for(let t=0;s&&t<e;t++)r.push(s.value),s=this.removeNode(s);s?s!==this.tail&&(s=s.prev):s=this.tail;for(const t of i)s=insertAfter(this,s,t);return r}reverse(){const t=this.head,e=this.tail;for(let e=t;e;e=e.prev){const t=e.prev;e.prev=e.next,e.next=t}return this.head=e,this.tail=t,this}}function insertAfter(t,e,i){const s=e,r=e?e.next:t.head,n=new Node(i,s,r,t);return void 0===n.next&&(t.tail=n),void 0===n.prev&&(t.head=n),t.length++,n}function push(t,e){t.tail=new Node(e,t.tail,void 0,t),t.head||(t.head=t.tail),t.length++}function unshift(t,e){t.head=new Node(e,void 0,t.head,t),t.tail||(t.tail=t.head),t.length++}class Node{list;next;prev;value;constructor(t,e,i,s){this.list=s,this.value=t,e?(e.next=this,this.prev=e):this.prev=void 0,i?(i.prev=this,this.next=i):this.next=void 0}}const encodePositive=(t,e)=>{e[0]=128;for(var i=e.length;i>1;i--)e[i-1]=255&t,t=Math.floor(t/256)},encodeNegative=(t,e)=>{e[0]=255;var i=!1;t*=-1;for(var s=e.length;s>1;s--){var r=255&t;t=Math.floor(t/256),i?e[s-1]=onesComp(r):0===r?e[s-1]=0:(i=!0,e[s-1]=twosComp(r))}},twos=t=>{for(var e=t.length,i=0,s=!1,r=e-1;r>-1;r--){var n,h=Number(t[r]);s?n=onesComp(h):0===h?n=h:(s=!0,n=twosComp(h)),0!==n&&(i-=n*Math.pow(256,e-r-1))}return i},pos=t=>{for(var e=t.length,i=0,s=e-1;s>-1;s--){var r=Number(t[s]);0!==r&&(i+=r*Math.pow(256,e-s-1))}return i},onesComp=t=>255&(255^t),twosComp=t=>1+(255^t)&255,isCode=t=>X.has(t),isName=t=>J.has(t),X=new Map([["0","File"],["","OldFile"],["1","Link"],["2","SymbolicLink"],["3","CharacterDevice"],["4","BlockDevice"],["5","Directory"],["6","FIFO"],["7","ContiguousFile"],["g","GlobalExtendedHeader"],["x","ExtendedHeader"],["A","SolarisACL"],["D","GNUDumpDir"],["I","Inode"],["K","NextFileHasLongLinkpath"],["L","NextFileHasLongPath"],["M","ContinuationFile"],["N","OldGnuLongPath"],["S","SparseFile"],["V","TapeVolumeHeader"],["X","OldExtendedHeader"]]),J=new Map(Array.from(X).map((t=>[t[1],t[0]])));class Header{cksumValid=!1;needPax=!1;nullBlock=!1;block;path;mode;uid;gid;size;cksum;#c="Unsupported";linkpath;uname;gname;devmaj=0;devmin=0;atime;ctime;mtime;charset;comment;constructor(t,e=0,i,s){Buffer.isBuffer(t)?this.decode(t,e||0,i,s):t&&this.#d(t)}decode(t,e,i,s){if(e||(e=0),!(t&&t.length>=e+512))throw new Error("need 512 bytes for header");this.path=decString(t,e,100),this.mode=decNumber(t,e+100,8),this.uid=decNumber(t,e+108,8),this.gid=decNumber(t,e+116,8),this.size=decNumber(t,e+124,12),this.mtime=decDate(t,e+136,12),this.cksum=decNumber(t,e+148,12),s&&this.#d(s,!0),i&&this.#d(i);const r=decString(t,e+156,1);if(isCode(r)&&(this.#c=r||"0"),"0"===this.#c&&"/"===this.path.slice(-1)&&(this.#c="5"),"5"===this.#c&&(this.size=0),this.linkpath=decString(t,e+157,100),"ustar\x0000"===t.subarray(e+257,e+265).toString())if(this.uname=decString(t,e+265,32),this.gname=decString(t,e+297,32),this.devmaj=decNumber(t,e+329,8)??0,this.devmin=decNumber(t,e+337,8)??0,0!==t[e+475]){const i=decString(t,e+345,155);this.path=i+"/"+this.path}else{const i=decString(t,e+345,130);i&&(this.path=i+"/"+this.path),this.atime=decDate(t,e+476,12),this.ctime=decDate(t,e+488,12)}let n=256;for(let i=e;i<e+148;i++)n+=t[i];for(let i=e+156;i<e+512;i++)n+=t[i];this.cksumValid=n===this.cksum,void 0===this.cksum&&256===n&&(this.nullBlock=!0)}#d(t,e=!1){Object.assign(this,Object.fromEntries(Object.entries(t).filter((([t,i])=>!(null==i||"path"===t&&e||"linkpath"===t&&e||"global"===t)))))}encode(t,e=0){if(t||(t=this.block=Buffer.alloc(512)),"Unsupported"===this.#c&&(this.#c="0"),!(t.length>=e+512))throw new Error("need 512 bytes for header");const i=this.ctime||this.atime?130:155,s=splitPrefix(this.path||"",i),r=s[0],n=s[1];this.needPax=!!s[2],this.needPax=encString(t,e,100,r)||this.needPax,this.needPax=encNumber(t,e+100,8,this.mode)||this.needPax,this.needPax=encNumber(t,e+108,8,this.uid)||this.needPax,this.needPax=encNumber(t,e+116,8,this.gid)||this.needPax,this.needPax=encNumber(t,e+124,12,this.size)||this.needPax,this.needPax=encDate(t,e+136,12,this.mtime)||this.needPax,t[e+156]=this.#c.charCodeAt(0),this.needPax=encString(t,e+157,100,this.linkpath)||this.needPax,t.write("ustar\x0000",e+257,8),this.needPax=encString(t,e+265,32,this.uname)||this.needPax,this.needPax=encString(t,e+297,32,this.gname)||this.needPax,this.needPax=encNumber(t,e+329,8,this.devmaj)||this.needPax,this.needPax=encNumber(t,e+337,8,this.devmin)||this.needPax,this.needPax=encString(t,e+345,i,n)||this.needPax,0!==t[e+475]?this.needPax=encString(t,e+345,155,n)||this.needPax:(this.needPax=encString(t,e+345,130,n)||this.needPax,this.needPax=encDate(t,e+476,12,this.atime)||this.needPax,this.needPax=encDate(t,e+488,12,this.ctime)||this.needPax);let h=256;for(let i=e;i<e+148;i++)h+=t[i];for(let i=e+156;i<e+512;i++)h+=t[i];return this.cksum=h,encNumber(t,e+148,8,this.cksum),this.cksumValid=!0,this.needPax}get type(){return"Unsupported"===this.#c?this.#c:X.get(this.#c)}get typeKey(){return this.#c}set type(t){const e=String(J.get(t));if(isCode(e)||"Unsupported"===e)this.#c=e;else{if(!isCode(t))throw new TypeError("invalid entry type: "+t);this.#c=t}}}const splitPrefix=(t,e)=>{const i=100;let s,r=t,n="";const h=C.posix.parse(t).root||".";if(Buffer.byteLength(r)<i)s=[r,n,!1];else{n=C.posix.dirname(r),r=C.posix.basename(r);do{Buffer.byteLength(r)<=i&&Buffer.byteLength(n)<=e?s=[r,n,!1]:Buffer.byteLength(r)>i&&Buffer.byteLength(n)<=e?s=[r.slice(0,99),n,!0]:(r=C.posix.join(C.posix.basename(n),r),n=C.posix.dirname(n))}while(n!==h&&void 0===s);s||(s=[t.slice(0,99),"",!0])}return s},decString=(t,e,i)=>t.subarray(e,e+i).toString("utf8").replace(/\0.*/,""),decDate=(t,e,i)=>numToDate(decNumber(t,e,i)),numToDate=t=>void 0===t?void 0:new Date(1e3*t),decNumber=(t,e,i)=>128&Number(t[e])?(t=>{const e=t[0],i=128===e?pos(t.subarray(1,t.length)):255===e?twos(t):null;if(null===i)throw Error("invalid base256 encoding");if(!Number.isSafeInteger(i))throw Error("parsed number outside of javascript safe integer range");return i})(t.subarray(e,e+i)):decSmallNumber(t,e,i),decSmallNumber=(t,e,i)=>{return s=parseInt(t.subarray(e,e+i).toString("utf8").replace(/\0.*$/,"").trim(),8),isNaN(s)?void 0:s;var s},Q={12:8589934591,8:2097151},encNumber=(t,e,i,s)=>void 0!==s&&(s>Q[i]||s<0?(((t,e)=>{if(!Number.isSafeInteger(t))throw Error("cannot encode number outside of javascript safe integer range");t<0?encodeNegative(t,e):encodePositive(t,e)})(s,t.subarray(e,e+i)),!0):(encSmallNumber(t,e,i,s),!1)),encSmallNumber=(t,e,i,s)=>t.write(octalString(s,i),e,i,"ascii"),octalString=(t,e)=>padOctal(Math.floor(t).toString(8),e),padOctal=(t,e)=>(t.length===e-1?t:new Array(e-t.length-1).join("0")+t+" ")+"\0",encDate=(t,e,i,s)=>void 0!==s&&encNumber(t,e,i,s.getTime()/1e3),tt=new Array(156).join("\0"),encString=(t,e,i,s)=>void 0!==s&&(t.write(s+tt,e,i,"utf8"),s.length!==Buffer.byteLength(s)||s.length>i);class Pax{atime;mtime;ctime;charset;comment;gid;uid;gname;uname;linkpath;dev;ino;nlink;path;size;mode;global;constructor(t,e=!1){this.atime=t.atime,this.charset=t.charset,this.comment=t.comment,this.ctime=t.ctime,this.dev=t.dev,this.gid=t.gid,this.global=e,this.gname=t.gname,this.ino=t.ino,this.linkpath=t.linkpath,this.mtime=t.mtime,this.nlink=t.nlink,this.path=t.path,this.size=t.size,this.uid=t.uid,this.uname=t.uname}encode(){const t=this.encodeBody();if(""===t)return Buffer.allocUnsafe(0);const e=Buffer.byteLength(t),i=512*Math.ceil(1+e/512),s=Buffer.allocUnsafe(i);for(let t=0;t<512;t++)s[t]=0;new Header({path:("PaxHeader/"+(0,C.basename)(this.path??"")).slice(0,99),mode:this.mode||420,uid:this.uid,gid:this.gid,size:e,mtime:this.mtime,type:this.global?"GlobalExtendedHeader":"ExtendedHeader",linkpath:"",uname:this.uname||"",gname:this.gname||"",devmaj:0,devmin:0,atime:this.atime,ctime:this.ctime}).encode(s),s.write(t,512,e,"utf8");for(let t=e+512;t<s.length;t++)s[t]=0;return s}encodeBody(){return this.encodeField("path")+this.encodeField("ctime")+this.encodeField("atime")+this.encodeField("dev")+this.encodeField("ino")+this.encodeField("nlink")+this.encodeField("charset")+this.encodeField("comment")+this.encodeField("gid")+this.encodeField("gname")+this.encodeField("linkpath")+this.encodeField("mtime")+this.encodeField("size")+this.encodeField("uid")+this.encodeField("uname")}encodeField(t){if(void 0===this[t])return"";const e=this[t],i=" "+("dev"===t||"ino"===t||"nlink"===t?"SCHILY.":"")+t+"="+(e instanceof Date?e.getTime()/1e3:e)+"\n",s=Buffer.byteLength(i);let r=Math.floor(Math.log(s)/Math.log(10))+1;s+r>=Math.pow(10,r)&&(r+=1);return r+s+i}static parse(t,e,i=!1){return new Pax(merge(parseKV(t),e),i)}}const merge=(t,e)=>e?Object.assign({},e,t):t,parseKV=t=>t.replace(/\n$/,"").split("\n").reduce(parseKVLine,Object.create(null)),parseKVLine=(t,e)=>{const i=parseInt(e,10);if(i!==Buffer.byteLength(e)+1)return t;const s=(e=e.slice((i+" ").length)).split("="),r=s.shift();if(!r)return t;const n=r.replace(/^SCHILY\.(dev|ino|nlink)/,"$1"),h=s.join("=");return t[n]=/^([A-Z]+\.)?([mac]|birth|creation)time$/.test(n)?new Date(1e3*Number(h)):/^[0-9]+$/.test(h)?+h:h,t},et="win32"!==(process.env.TESTING_TAR_FAKE_PLATFORM||process.platform)?t=>t:t=>t&&t.replace(/\\/g,"/");class ReadEntry extends h.n_{extended;globalExtended;header;startBlockSize;blockRemain;remain;type;meta=!1;ignore=!1;path;mode;uid;gid;uname;gname;size=0;mtime;atime;ctime;linkpath;dev;ino;nlink;invalid=!1;absolute;unsupported=!1;constructor(t,e,i){switch(super({}),this.pause(),this.extended=e,this.globalExtended=i,this.header=t,this.remain=t.size??0,this.startBlockSize=512*Math.ceil(this.remain/512),this.blockRemain=this.startBlockSize,this.type=t.type,this.type){case"File":case"OldFile":case"Link":case"SymbolicLink":case"CharacterDevice":case"BlockDevice":case"Directory":case"FIFO":case"ContiguousFile":case"GNUDumpDir":break;case"NextFileHasLongLinkpath":case"NextFileHasLongPath":case"OldGnuLongPath":case"GlobalExtendedHeader":case"ExtendedHeader":case"OldExtendedHeader":this.meta=!0;break;default:this.ignore=!0}if(!t.path)throw new Error("no path provided for tar.ReadEntry");this.path=et(t.path),this.mode=t.mode,this.mode&&(this.mode=4095&this.mode),this.uid=t.uid,this.gid=t.gid,this.uname=t.uname,this.gname=t.gname,this.size=this.remain,this.mtime=t.mtime,this.atime=t.atime,this.ctime=t.ctime,this.linkpath=t.linkpath?et(t.linkpath):void 0,this.uname=t.uname,this.gname=t.gname,e&&this.#d(e),i&&this.#d(i,!0)}write(t){const e=t.length;if(e>this.blockRemain)throw new Error("writing more to entry than is appropriate");const i=this.remain,s=this.blockRemain;return this.remain=Math.max(0,i-e),this.blockRemain=Math.max(0,s-e),!!this.ignore||(i>=e?super.write(t):super.write(t.subarray(0,i)))}#d(t,e=!1){t.path&&(t.path=et(t.path)),t.linkpath&&(t.linkpath=et(t.linkpath)),Object.assign(this,Object.fromEntries(Object.entries(t).filter((([t,i])=>!(null==i||"path"===t&&e)))))}}const warnMethod=(t,e,i,s={})=>{t.file&&(s.file=t.file),t.cwd&&(s.cwd=t.cwd),s.code=i instanceof Error&&i.code||e,s.tarCode=e,t.strict||!1===s.recoverable?i instanceof Error?t.emit("error",Object.assign(i,s)):t.emit("error",Object.assign(new Error(`${e}: ${i}`),s)):(i instanceof Error&&(s=Object.assign(i,s),i=i.message),t.emit("warn",e,i,s))},it=Buffer.from([31,139]),st=Symbol("state"),rt=Symbol("writeEntry"),nt=Symbol("readEntry"),ht=Symbol("nextEntry"),ot=Symbol("processEntry"),at=Symbol("extendedHeader"),lt=Symbol("globalExtendedHeader"),ct=Symbol("meta"),dt=Symbol("emitMeta"),ut=Symbol("buffer"),mt=Symbol("queue"),pt=Symbol("ended"),ft=Symbol("emittedEnd"),yt=Symbol("emit"),bt=Symbol("unzip"),Et=Symbol("consumeChunk"),wt=Symbol("consumeChunkSub"),gt=Symbol("consumeBody"),Rt=Symbol("consumeMeta"),_t=Symbol("consumeHeader"),St=Symbol("consuming"),vt=Symbol("bufferConcat"),Ot=Symbol("maybeEnd"),kt=Symbol("writing"),Tt=Symbol("aborted"),Lt=Symbol("onDone"),Nt=Symbol("sawValidEntry"),At=Symbol("sawNullBlock"),Dt=Symbol("sawEOF"),It=Symbol("closeStream"),parse_noop=()=>!0;class Parser extends r.EventEmitter{file;strict;maxMetaEntrySize;filter;brotli;writable=!0;readable=!1;[mt]=new Yallist;[ut];[nt];[rt];[st]="begin";[ct]="";[at];[lt];[pt]=!1;[bt];[Tt]=!1;[Nt];[At]=!1;[Dt]=!1;[kt]=!1;[St]=!1;[ft]=!1;constructor(t={}){super(),this.file=t.file||"",this.on(Lt,(()=>{"begin"!==this[st]&&!1!==this[Nt]||this.warn("TAR_BAD_ARCHIVE","Unrecognized archive format")})),t.ondone?this.on(Lt,t.ondone):this.on(Lt,(()=>{this.emit("prefinish"),this.emit("finish"),this.emit("end")})),this.strict=!!t.strict,this.maxMetaEntrySize=t.maxMetaEntrySize||1048576,this.filter="function"==typeof t.filter?t.filter:parse_noop;const e=t.file&&(t.file.endsWith(".tar.br")||t.file.endsWith(".tbr"));this.brotli=t.gzip||void 0===t.brotli?!!e&&void 0:t.brotli,this.on("end",(()=>this[It]())),"function"==typeof t.onwarn&&this.on("warn",t.onwarn),"function"==typeof t.onReadEntry&&this.on("entry",t.onReadEntry)}warn(t,e,i={}){warnMethod(this,t,e,i)}[_t](t,e){let i;void 0===this[Nt]&&(this[Nt]=!1);try{i=new Header(t,e,this[at],this[lt])}catch(t){return this.warn("TAR_ENTRY_INVALID",t)}if(i.nullBlock)this[At]?(this[Dt]=!0,"begin"===this[st]&&(this[st]="header"),this[yt]("eof")):(this[At]=!0,this[yt]("nullBlock"));else if(this[At]=!1,i.cksumValid)if(i.path){const t=i.type;if(/^(Symbolic)?Link$/.test(t)&&!i.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath required",{header:i});else if(/^(Symbolic)?Link$/.test(t)||/^(Global)?ExtendedHeader$/.test(t)||!i.linkpath){const t=this[rt]=new ReadEntry(i,this[at],this[lt]);if(!this[Nt])if(t.remain){const onend=()=>{t.invalid||(this[Nt]=!0)};t.on("end",onend)}else this[Nt]=!0;t.meta?t.size>this.maxMetaEntrySize?(t.ignore=!0,this[yt]("ignoredEntry",t),this[st]="ignore",t.resume()):t.size>0&&(this[ct]="",t.on("data",(t=>this[ct]+=t)),this[st]="meta"):(this[at]=void 0,t.ignore=t.ignore||!this.filter(t.path,t),t.ignore?(this[yt]("ignoredEntry",t),this[st]=t.remain?"ignore":"header",t.resume()):(t.remain?this[st]="body":(this[st]="header",t.end()),this[nt]?this[mt].push(t):(this[mt].push(t),this[ht]())))}else this.warn("TAR_ENTRY_INVALID","linkpath forbidden",{header:i})}else this.warn("TAR_ENTRY_INVALID","path is required",{header:i});else this.warn("TAR_ENTRY_INVALID","checksum failure",{header:i})}[It](){queueMicrotask((()=>this.emit("close")))}[ot](t){let e=!0;if(t)if(Array.isArray(t)){const[e,...i]=t;this.emit(e,...i)}else this[nt]=t,this.emit("entry",t),t.emittedEnd||(t.on("end",(()=>this[ht]())),e=!1);else this[nt]=void 0,e=!1;return e}[ht](){do{}while(this[ot](this[mt].shift()));if(!this[mt].length){const t=this[nt];!t||t.flowing||t.size===t.remain?this[kt]||this.emit("drain"):t.once("drain",(()=>this.emit("drain")))}}[gt](t,e){const i=this[rt];if(!i)throw new Error("attempt to consume body without entry??");const s=i.blockRemain??0,r=s>=t.length&&0===e?t:t.subarray(e,e+s);return i.write(r),i.blockRemain||(this[st]="header",this[rt]=void 0,i.end()),r.length}[Rt](t,e){const i=this[rt],s=this[gt](t,e);return!this[rt]&&i&&this[dt](i),s}[yt](t,e,i){this[mt].length||this[nt]?this[mt].push([t,e,i]):this.emit(t,e,i)}[dt](t){switch(this[yt]("meta",this[ct]),t.type){case"ExtendedHeader":case"OldExtendedHeader":this[at]=Pax.parse(this[ct],this[at],!1);break;case"GlobalExtendedHeader":this[lt]=Pax.parse(this[ct],this[lt],!0);break;case"NextFileHasLongPath":case"OldGnuLongPath":{const t=this[at]??Object.create(null);this[at]=t,t.path=this[ct].replace(/\0.*/,"");break}case"NextFileHasLongLinkpath":{const t=this[at]||Object.create(null);this[at]=t,t.linkpath=this[ct].replace(/\0.*/,"");break}default:throw new Error("unknown meta: "+t.type)}}abort(t){this[Tt]=!0,this.emit("abort",t),this.warn("TAR_ABORT",t,{recoverable:!1})}write(t,e,i){if("function"==typeof e&&(i=e,e=void 0),"string"==typeof t&&(t=Buffer.from(t,"string"==typeof e?e:"utf8")),this[Tt])return i?.(),!1;if((void 0===this[bt]||void 0===this.brotli&&!1===this[bt])&&t){if(this[ut]&&(t=Buffer.concat([this[ut],t]),this[ut]=void 0),t.length<it.length)return this[ut]=t,i?.(),!0;for(let e=0;void 0===this[bt]&&e<it.length;e++)t[e]!==it[e]&&(this[bt]=!1);const e=void 0===this.brotli;if(!1===this[bt]&&e)if(t.length<512){if(!this[pt])return this[ut]=t,i?.(),!0;this.brotli=!0}else try{new Header(t.subarray(0,512)),this.brotli=!1}catch(t){this.brotli=!0}if(void 0===this[bt]||!1===this[bt]&&this.brotli){const e=this[pt];this[pt]=!1,this[bt]=void 0===this[bt]?new Unzip({}):new BrotliDecompress({}),this[bt].on("data",(t=>this[Et](t))),this[bt].on("error",(t=>this.abort(t))),this[bt].on("end",(()=>{this[pt]=!0,this[Et]()})),this[kt]=!0;const s=!!this[bt][e?"end":"write"](t);return this[kt]=!1,i?.(),s}}this[kt]=!0,this[bt]?this[bt].write(t):this[Et](t),this[kt]=!1;const s=!this[mt].length&&(!this[nt]||this[nt].flowing);return s||this[mt].length||this[nt]?.once("drain",(()=>this.emit("drain"))),i?.(),s}[vt](t){t&&!this[Tt]&&(this[ut]=this[ut]?Buffer.concat([this[ut],t]):t)}[Ot](){if(this[pt]&&!this[ft]&&!this[Tt]&&!this[St]){this[ft]=!0;const t=this[rt];if(t&&t.blockRemain){const e=this[ut]?this[ut].length:0;this.warn("TAR_BAD_ARCHIVE",`Truncated input (needed ${t.blockRemain} more bytes, only ${e} available)`,{entry:t}),this[ut]&&t.write(this[ut]),t.end()}this[yt](Lt)}}[Et](t){if(this[St]&&t)this[vt](t);else if(t||this[ut]){if(t){if(this[St]=!0,this[ut]){this[vt](t);const e=this[ut];this[ut]=void 0,this[wt](e)}else this[wt](t);for(;this[ut]&&this[ut]?.length>=512&&!this[Tt]&&!this[Dt];){const t=this[ut];this[ut]=void 0,this[wt](t)}this[St]=!1}}else this[Ot]();this[ut]&&!this[pt]||this[Ot]()}[wt](t){let e=0;const i=t.length;for(;e+512<=i&&!this[Tt]&&!this[Dt];)switch(this[st]){case"begin":case"header":this[_t](t,e),e+=512;break;case"ignore":case"body":e+=this[gt](t,e);break;case"meta":e+=this[Rt](t,e);break;default:throw new Error("invalid state: "+this[st])}e<i&&(this[ut]?this[ut]=Buffer.concat([t.subarray(e),this[ut]]):this[ut]=t.subarray(e))}end(t,e,i){return"function"==typeof t&&(i=t,e=void 0,t=void 0),"function"==typeof e&&(i=e,e=void 0),"string"==typeof t&&(t=Buffer.from(t,e)),i&&this.once("finish",i),this[Tt]||(this[bt]?(t&&this[bt].write(t),this[bt].end()):(this[pt]=!0,void 0===this.brotli&&(t=t||Buffer.alloc(0)),t&&this.write(t),this[Ot]())),this}}const stripTrailingSlashes=t=>{let e=t.length-1,i=-1;for(;e>-1&&"/"===t.charAt(e);)i=e,e--;return-1===i?t:t.slice(0,i)},filesFilter=(t,e)=>{const i=new Map(e.map((t=>[stripTrailingSlashes(t),!0]))),s=t.filter,mapHas=(t,e="")=>{const s=e||(0,M.parse)(t).root||".";let r;if(t===s)r=!1;else{const e=i.get(t);r=void 0!==e?e:mapHas((0,M.dirname)(t),s)}return i.set(t,r),r};t.filter=s?(t,e)=>s(t,e)&&mapHas(stripTrailingSlashes(t)):t=>mapHas(stripTrailingSlashes(t))},xt=makeCommand((t=>{const e=new Parser(t),i=t.file;let s;try{const r=B.statSync(i),n=t.maxReadSize||16777216;if(r.size<n)e.end(B.readFileSync(i));else{let t=0;const h=Buffer.allocUnsafe(n);for(s=B.openSync(i,"r");t<r.size;){const i=B.readSync(s,h,0,n,t);t+=i,e.write(h.subarray(0,i))}e.end()}}finally{if("number"==typeof s)try{B.closeSync(s)}catch(t){}}}),((t,e)=>{const i=new Parser(t),s=t.maxReadSize||16777216,r=t.file;return new Promise(((t,e)=>{i.on("error",e),i.on("end",t),B.stat(r,((t,n)=>{if(t)e(t);else{const t=new ReadStream(r,{readSize:s,size:n.size});t.on("error",e),t.pipe(i)}}))}))}),(t=>new Parser(t)),(t=>new Parser(t)),((t,e)=>{e?.length&&filesFilter(t,e),t.noResume||(t=>{const e=t.onReadEntry;t.onReadEntry=e?t=>{e(t),t.resume()}:t=>t.resume()})(t)})),modeFix=(t,e,i)=>(t&=4095,i&&(t=-19&t|384),e&&(256&t&&(t|=64),32&t&&(t|=8),4&t&&(t|=1)),t),{isAbsolute:Ft,parse:Pt}=C.win32,stripAbsolutePath=t=>{let e="",i=Pt(t);for(;Ft(t)||i.root;){const s="/"===t.charAt(0)&&"//?/"!==t.slice(0,4)?"/":i.root;t=t.slice(s.length),e+=s,i=Pt(t)}return[e,t]},Ct=["|","<",">","?",":"],Bt=Ct.map((t=>String.fromCharCode(61440+t.charCodeAt(0)))),Mt=new Map(Ct.map(((t,e)=>[t,Bt[e]]))),zt=new Map(Bt.map(((t,e)=>[t,Ct[e]]))),winchars_encode=t=>Ct.reduce(((t,e)=>t.split(e).join(Mt.get(e))),t),prefixPath=(t,e)=>e?(t=et(t).replace(/^\.(\/|$)/,""),stripTrailingSlashes(e)+"/"+t):et(t),Ut=Symbol("process"),Ht=Symbol("file"),Wt=Symbol("directory"),Zt=Symbol("symlink"),jt=Symbol("hardlink"),Gt=Symbol("header"),Yt=Symbol("read"),Vt=Symbol("lstat"),$t=Symbol("onlstat"),Kt=Symbol("onread"),qt=Symbol("onreadlink"),Xt=Symbol("openfile"),Jt=Symbol("onopenfile"),Qt=Symbol("close"),te=Symbol("mode"),ee=Symbol("awaitDrain"),ie=Symbol("ondrain"),se=Symbol("prefix");class WriteEntry extends h.n_{path;portable;myuid=process.getuid&&process.getuid()||0;myuser=process.env.USER||"";maxReadSize;linkCache;statCache;preservePaths;cwd;strict;mtime;noPax;noMtime;prefix;fd;blockLen=0;blockRemain=0;buf;pos=0;remain=0;length=0;offset=0;win32;absolute;header;type;linkpath;stat;onWriteEntry;#u=!1;constructor(t,e={}){const i=dealias(e);super(),this.path=et(t),this.portable=!!i.portable,this.maxReadSize=i.maxReadSize||16777216,this.linkCache=i.linkCache||new Map,this.statCache=i.statCache||new Map,this.preservePaths=!!i.preservePaths,this.cwd=et(i.cwd||process.cwd()),this.strict=!!i.strict,this.noPax=!!i.noPax,this.noMtime=!!i.noMtime,this.mtime=i.mtime,this.prefix=i.prefix?et(i.prefix):void 0,this.onWriteEntry=i.onWriteEntry,"function"==typeof i.onwarn&&this.on("warn",i.onwarn);let s=!1;if(!this.preservePaths){const[t,e]=stripAbsolutePath(this.path);t&&"string"==typeof e&&(this.path=e,s=t)}var r;this.win32=!!i.win32||"win32"===process.platform,this.win32&&(this.path=(r=this.path.replace(/\\/g,"/"),Bt.reduce(((t,e)=>t.split(e).join(zt.get(e))),r)),t=t.replace(/\\/g,"/")),this.absolute=et(i.absolute||M.resolve(this.cwd,t)),""===this.path&&(this.path="./"),s&&this.warn("TAR_ENTRY_INFO",`stripping ${s} from absolute path`,{entry:this,path:s+this.path});const n=this.statCache.get(this.absolute);n?this[$t](n):this[Vt]()}warn(t,e,i={}){return warnMethod(this,t,e,i)}emit(t,...e){return"error"===t&&(this.#u=!0),super.emit(t,...e)}[Vt](){n.lstat(this.absolute,((t,e)=>{if(t)return this.emit("error",t);this[$t](e)}))}[$t](t){this.statCache.set(this.absolute,t),this.stat=t,t.isFile()||(t.size=0),this.type=getType(t),this.emit("stat",t),this[Ut]()}[Ut](){switch(this.type){case"File":return this[Ht]();case"Directory":return this[Wt]();case"SymbolicLink":return this[Zt]();default:return this.end()}}[te](t){return modeFix(t,"Directory"===this.type,this.portable)}[se](t){return prefixPath(t,this.prefix)}[Gt](){if(!this.stat)throw new Error("cannot write header before stat");"Directory"===this.type&&this.portable&&(this.noMtime=!0),this.onWriteEntry?.(this),this.header=new Header({path:this[se](this.path),linkpath:"Link"===this.type&&void 0!==this.linkpath?this[se](this.linkpath):this.linkpath,mode:this[te](this.stat.mode),uid:this.portable?void 0:this.stat.uid,gid:this.portable?void 0:this.stat.gid,size:this.stat.size,mtime:this.noMtime?void 0:this.mtime||this.stat.mtime,type:"Unsupported"===this.type?void 0:this.type,uname:this.portable?void 0:this.stat.uid===this.myuid?this.myuser:"",atime:this.portable?void 0:this.stat.atime,ctime:this.portable?void 0:this.stat.ctime}),this.header.encode()&&!this.noPax&&super.write(new Pax({atime:this.portable?void 0:this.header.atime,ctime:this.portable?void 0:this.header.ctime,gid:this.portable?void 0:this.header.gid,mtime:this.noMtime?void 0:this.mtime||this.header.mtime,path:this[se](this.path),linkpath:"Link"===this.type&&void 0!==this.linkpath?this[se](this.linkpath):this.linkpath,size:this.header.size,uid:this.portable?void 0:this.header.uid,uname:this.portable?void 0:this.header.uname,dev:this.portable?void 0:this.stat.dev,ino:this.portable?void 0:this.stat.ino,nlink:this.portable?void 0:this.stat.nlink}).encode());const t=this.header?.block;if(!t)throw new Error("failed to encode header");super.write(t)}[Wt](){if(!this.stat)throw new Error("cannot create directory entry without stat");"/"!==this.path.slice(-1)&&(this.path+="/"),this.stat.size=0,this[Gt](),this.end()}[Zt](){n.readlink(this.absolute,((t,e)=>{if(t)return this.emit("error",t);this[qt](e)}))}[qt](t){this.linkpath=et(t),this[Gt](),this.end()}[jt](t){if(!this.stat)throw new Error("cannot create link entry without stat");this.type="Link",this.linkpath=et(M.relative(this.cwd,t)),this.stat.size=0,this[Gt](),this.end()}[Ht](){if(!this.stat)throw new Error("cannot create file entry without stat");if(this.stat.nlink>1){const t=`${this.stat.dev}:${this.stat.ino}`,e=this.linkCache.get(t);if(0===e?.indexOf(this.cwd))return this[jt](e);this.linkCache.set(t,this.absolute)}if(this[Gt](),0===this.stat.size)return this.end();this[Xt]()}[Xt](){n.open(this.absolute,"r",((t,e)=>{if(t)return this.emit("error",t);this[Jt](e)}))}[Jt](t){if(this.fd=t,this.#u)return this[Qt]();if(!this.stat)throw new Error("should stat before calling onopenfile");this.blockLen=512*Math.ceil(this.stat.size/512),this.blockRemain=this.blockLen;const e=Math.min(this.blockLen,this.maxReadSize);this.buf=Buffer.allocUnsafe(e),this.offset=0,this.pos=0,this.remain=this.stat.size,this.length=this.buf.length,this[Yt]()}[Yt](){const{fd:t,buf:e,offset:i,length:s,pos:r}=this;if(void 0===t||void 0===e)throw new Error("cannot read file without first opening");n.read(t,e,i,s,r,((t,e)=>{if(t)return this[Qt]((()=>this.emit("error",t)));this[Kt](e)}))}[Qt](t=()=>{}){void 0!==this.fd&&n.close(this.fd,t)}[Kt](t){if(t<=0&&this.remain>0){const t=Object.assign(new Error("encountered unexpected EOF"),{path:this.absolute,syscall:"read",code:"EOF"});return this[Qt]((()=>this.emit("error",t)))}if(t>this.remain){const t=Object.assign(new Error("did not encounter expected EOF"),{path:this.absolute,syscall:"read",code:"EOF"});return this[Qt]((()=>this.emit("error",t)))}if(!this.buf)throw new Error("should have created buffer prior to reading");if(t===this.remain)for(let e=t;e<this.length&&t<this.blockRemain;e++)this.buf[e+this.offset]=0,t++,this.remain++;const e=0===this.offset&&t===this.buf.length?this.buf:this.buf.subarray(this.offset,this.offset+t);this.write(e)?this[ie]():this[ee]((()=>this[ie]()))}[ee](t){this.once("drain",t)}write(t,e,i){if("function"==typeof e&&(i=e,e=void 0),"string"==typeof t&&(t=Buffer.from(t,"string"==typeof e?e:"utf8")),this.blockRemain<t.length){const t=Object.assign(new Error("writing more data than expected"),{path:this.absolute});return this.emit("error",t)}return this.remain-=t.length,this.blockRemain-=t.length,this.pos+=t.length,this.offset+=t.length,super.write(t,null,i)}[ie](){if(!this.remain)return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),this[Qt]((t=>t?this.emit("error",t):this.end()));if(!this.buf)throw new Error("buffer lost somehow in ONDRAIN");this.offset>=this.length&&(this.buf=Buffer.allocUnsafe(Math.min(this.blockRemain,this.buf.length)),this.offset=0),this.length=this.buf.length-this.offset,this[Yt]()}}class WriteEntrySync extends WriteEntry{sync=!0;[Vt](){this[$t](n.lstatSync(this.absolute))}[Zt](){this[qt](n.readlinkSync(this.absolute))}[Xt](){this[Jt](n.openSync(this.absolute,"r"))}[Yt](){let t=!0;try{const{fd:e,buf:i,offset:s,length:r,pos:h}=this;if(void 0===e||void 0===i)throw new Error("fd and buf must be set in READ method");const o=n.readSync(e,i,s,r,h);this[Kt](o),t=!1}finally{if(t)try{this[Qt]((()=>{}))}catch(t){}}}[ee](t){t()}[Qt](t=()=>{}){void 0!==this.fd&&n.closeSync(this.fd),t()}}class WriteEntryTar extends h.n_{blockLen=0;blockRemain=0;buf=0;pos=0;remain=0;length=0;preservePaths;portable;strict;noPax;noMtime;readEntry;type;prefix;path;mode;uid;gid;uname;gname;header;mtime;atime;ctime;linkpath;size;onWriteEntry;warn(t,e,i={}){return warnMethod(this,t,e,i)}constructor(t,e={}){const i=dealias(e);super(),this.preservePaths=!!i.preservePaths,this.portable=!!i.portable,this.strict=!!i.strict,this.noPax=!!i.noPax,this.noMtime=!!i.noMtime,this.onWriteEntry=i.onWriteEntry,this.readEntry=t;const{type:s}=t;if("Unsupported"===s)throw new Error("writing entry that should be ignored");this.type=s,"Directory"===this.type&&this.portable&&(this.noMtime=!0),this.prefix=i.prefix,this.path=et(t.path),this.mode=void 0!==t.mode?this[te](t.mode):void 0,this.uid=this.portable?void 0:t.uid,this.gid=this.portable?void 0:t.gid,this.uname=this.portable?void 0:t.uname,this.gname=this.portable?void 0:t.gname,this.size=t.size,this.mtime=this.noMtime?void 0:i.mtime||t.mtime,this.atime=this.portable?void 0:t.atime,this.ctime=this.portable?void 0:t.ctime,this.linkpath=void 0!==t.linkpath?et(t.linkpath):void 0,"function"==typeof i.onwarn&&this.on("warn",i.onwarn);let r=!1;if(!this.preservePaths){const[t,e]=stripAbsolutePath(this.path);t&&"string"==typeof e&&(this.path=e,r=t)}this.remain=t.size,this.blockRemain=t.startBlockSize,this.onWriteEntry?.(this),this.header=new Header({path:this[se](this.path),linkpath:"Link"===this.type&&void 0!==this.linkpath?this[se](this.linkpath):this.linkpath,mode:this.mode,uid:this.portable?void 0:this.uid,gid:this.portable?void 0:this.gid,size:this.size,mtime:this.noMtime?void 0:this.mtime,type:this.type,uname:this.portable?void 0:this.uname,atime:this.portable?void 0:this.atime,ctime:this.portable?void 0:this.ctime}),r&&this.warn("TAR_ENTRY_INFO",`stripping ${r} from absolute path`,{entry:this,path:r+this.path}),this.header.encode()&&!this.noPax&&super.write(new Pax({atime:this.portable?void 0:this.atime,ctime:this.portable?void 0:this.ctime,gid:this.portable?void 0:this.gid,mtime:this.noMtime?void 0:this.mtime,path:this[se](this.path),linkpath:"Link"===this.type&&void 0!==this.linkpath?this[se](this.linkpath):this.linkpath,size:this.size,uid:this.portable?void 0:this.uid,uname:this.portable?void 0:this.uname,dev:this.portable?void 0:this.readEntry.dev,ino:this.portable?void 0:this.readEntry.ino,nlink:this.portable?void 0:this.readEntry.nlink}).encode());const n=this.header?.block;if(!n)throw new Error("failed to encode header");super.write(n),t.pipe(this)}[se](t){return prefixPath(t,this.prefix)}[te](t){return modeFix(t,"Directory"===this.type,this.portable)}write(t,e,i){"function"==typeof e&&(i=e,e=void 0),"string"==typeof t&&(t=Buffer.from(t,"string"==typeof e?e:"utf8"));const s=t.length;if(s>this.blockRemain)throw new Error("writing more to entry than is appropriate");return this.blockRemain-=s,super.write(t,i)}end(t,e,i){return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),"function"==typeof t&&(i=t,e=void 0,t=void 0),"function"==typeof e&&(i=e,e=void 0),"string"==typeof t&&(t=Buffer.from(t,e??"utf8")),i&&this.once("finish",i),t?super.end(t,i):super.end(i),this}}const getType=t=>t.isFile()?"File":t.isDirectory()?"Directory":t.isSymbolicLink()?"SymbolicLink":"Unsupported";class PackJob{path;absolute;entry;stat;readdir;pending=!1;ignore=!1;piped=!1;constructor(t,e){this.path=t||"./",this.absolute=e}}const re=Buffer.alloc(1024),ne=Symbol("onStat"),he=Symbol("ended"),oe=Symbol("queue"),ae=Symbol("current"),le=Symbol("process"),ce=Symbol("processing"),de=Symbol("processJob"),ue=Symbol("jobs"),me=Symbol("jobDone"),pe=Symbol("addFSEntry"),fe=Symbol("addTarEntry"),ye=Symbol("stat"),be=Symbol("readdir"),Ee=Symbol("onreaddir"),we=Symbol("pipe"),ge=Symbol("entry"),Re=Symbol("entryOpt"),_e=Symbol("writeEntryClass"),Se=Symbol("write"),ve=Symbol("ondrain");class Pack extends h.n_{opt;cwd;maxReadSize;preservePaths;strict;noPax;prefix;linkCache;statCache;file;portable;zip;readdirCache;noDirRecurse;follow;noMtime;mtime;filter;jobs;[_e];onWriteEntry;[oe];[ue]=0;[ce]=!1;[he]=!1;constructor(t={}){if(super(),this.opt=t,this.file=t.file||"",this.cwd=t.cwd||process.cwd(),this.maxReadSize=t.maxReadSize,this.preservePaths=!!t.preservePaths,this.strict=!!t.strict,this.noPax=!!t.noPax,this.prefix=et(t.prefix||""),this.linkCache=t.linkCache||new Map,this.statCache=t.statCache||new Map,this.readdirCache=t.readdirCache||new Map,this.onWriteEntry=t.onWriteEntry,this[_e]=WriteEntry,"function"==typeof t.onwarn&&this.on("warn",t.onwarn),this.portable=!!t.portable,t.gzip||t.brotli){if(t.gzip&&t.brotli)throw new TypeError("gzip and brotli are mutually exclusive");if(t.gzip&&("object"!=typeof t.gzip&&(t.gzip={}),this.portable&&(t.gzip.portable=!0),this.zip=new Gzip(t.gzip)),t.brotli&&("object"!=typeof t.brotli&&(t.brotli={}),this.zip=new BrotliCompress(t.brotli)),!this.zip)throw new Error("impossible");const e=this.zip;e.on("data",(t=>super.write(t))),e.on("end",(()=>super.end())),e.on("drain",(()=>this[ve]())),this.on("resume",(()=>e.resume()))}else this.on("drain",this[ve]);this.noDirRecurse=!!t.noDirRecurse,this.follow=!!t.follow,this.noMtime=!!t.noMtime,t.mtime&&(this.mtime=t.mtime),this.filter="function"==typeof t.filter?t.filter:()=>!0,this[oe]=new Yallist,this[ue]=0,this.jobs=Number(t.jobs)||4,this[ce]=!1,this[he]=!1}[Se](t){return super.write(t)}add(t){return this.write(t),this}end(t,e,i){return"function"==typeof t&&(i=t,t=void 0),"function"==typeof e&&(i=e,e=void 0),t&&this.add(t),this[he]=!0,this[le](),i&&i(),this}write(t){if(this[he])throw new Error("write after end");return t instanceof ReadEntry?this[fe](t):this[pe](t),this.flowing}[fe](t){const e=et(M.resolve(this.cwd,t.path));if(this.filter(t.path,t)){const i=new PackJob(t.path,e);i.entry=new WriteEntryTar(t,this[Re](i)),i.entry.on("end",(()=>this[me](i))),this[ue]+=1,this[oe].push(i)}else t.resume();this[le]()}[pe](t){const e=et(M.resolve(this.cwd,t));this[oe].push(new PackJob(t,e)),this[le]()}[ye](t){t.pending=!0,this[ue]+=1;const e=this.follow?"stat":"lstat";n[e](t.absolute,((e,i)=>{t.pending=!1,this[ue]-=1,e?this.emit("error",e):this[ne](t,i)}))}[ne](t,e){this.statCache.set(t.absolute,e),t.stat=e,this.filter(t.path,e)||(t.ignore=!0),this[le]()}[be](t){t.pending=!0,this[ue]+=1,n.readdir(t.absolute,((e,i)=>{if(t.pending=!1,this[ue]-=1,e)return this.emit("error",e);this[Ee](t,i)}))}[Ee](t,e){this.readdirCache.set(t.absolute,e),t.readdir=e,this[le]()}[le](){if(!this[ce]){this[ce]=!0;for(let t=this[oe].head;t&&this[ue]<this.jobs;t=t.next)if(this[de](t.value),t.value.ignore){const e=t.next;this[oe].removeNode(t),t.next=e}this[ce]=!1,this[he]&&!this[oe].length&&0===this[ue]&&(this.zip?this.zip.end(re):(super.write(re),super.end()))}}get[ae](){return this[oe]&&this[oe].head&&this[oe].head.value}[me](t){this[oe].shift(),this[ue]-=1,this[le]()}[de](t){if(!t.pending)if(t.entry)t!==this[ae]||t.piped||this[we](t);else{if(!t.stat){const e=this.statCache.get(t.absolute);e?this[ne](t,e):this[ye](t)}if(t.stat&&!t.ignore){if(!this.noDirRecurse&&t.stat.isDirectory()&&!t.readdir){const e=this.readdirCache.get(t.absolute);if(e?this[Ee](t,e):this[be](t),!t.readdir)return}t.entry=this[ge](t),t.entry?t!==this[ae]||t.piped||this[we](t):t.ignore=!0}}}[Re](t){return{onwarn:(t,e,i)=>this.warn(t,e,i),noPax:this.noPax,cwd:this.cwd,absolute:t.absolute,preservePaths:this.preservePaths,maxReadSize:this.maxReadSize,strict:this.strict,portable:this.portable,linkCache:this.linkCache,statCache:this.statCache,noMtime:this.noMtime,mtime:this.mtime,prefix:this.prefix,onWriteEntry:this.onWriteEntry}}[ge](t){this[ue]+=1;try{return new this[_e](t.path,this[Re](t)).on("end",(()=>this[me](t))).on("error",(t=>this.emit("error",t)))}catch(t){this.emit("error",t)}}[ve](){this[ae]&&this[ae].entry&&this[ae].entry.resume()}[we](t){t.piped=!0,t.readdir&&t.readdir.forEach((e=>{const i=t.path,s="./"===i?"":i.replace(/\/*$/,"/");this[pe](s+e)}));const e=t.entry,i=this.zip;if(!e)throw new Error("cannot pipe without source");i?e.on("data",(t=>{i.write(t)||e.pause()})):e.on("data",(t=>{super.write(t)||e.pause()}))}pause(){return this.zip&&this.zip.pause(),super.pause()}warn(t,e,i={}){warnMethod(this,t,e,i)}}class PackSync extends Pack{sync=!0;constructor(t){super(t),this[_e]=WriteEntrySync}pause(){}resume(){}[ye](t){const e=this.follow?"statSync":"lstatSync";this[ne](t,n[e](t.absolute))}[be](t){this[Ee](t,n.readdirSync(t.absolute))}[we](t){const e=t.entry,i=this.zip;if(t.readdir&&t.readdir.forEach((e=>{const i=t.path,s="./"===i?"":i.replace(/\/*$/,"/");this[pe](s+e)})),!e)throw new Error("Cannot pipe without source");i?e.on("data",(t=>{i.write(t)})):e.on("data",(t=>{super[Se](t)}))}}const addFilesSync=(t,e)=>{e.forEach((e=>{"@"===e.charAt(0)?xt({file:C.resolve(t.cwd,e.slice(1)),sync:!0,noResume:!0,onReadEntry:e=>t.add(e)}):t.add(e)})),t.end()},addFilesAsync=async(t,e)=>{for(let i=0;i<e.length;i++){const s=String(e[i]);"@"===s.charAt(0)?await xt({file:C.resolve(String(t.cwd),s.slice(1)),noResume:!0,onReadEntry:e=>{t.add(e)}}):t.add(s)}t.end()},Oe=makeCommand(((t,e)=>{const i=new PackSync(t),s=new WriteStreamSync(t.file,{mode:t.mode||438});i.pipe(s),addFilesSync(i,e)}),((t,e)=>{const i=new Pack(t),s=new WriteStream(t.file,{mode:t.mode||438});i.pipe(s);const r=new Promise(((t,e)=>{s.on("error",e),s.on("close",t),i.on("error",e)}));return addFilesAsync(i,e),r}),((t,e)=>{const i=new PackSync(t);return addFilesSync(i,e),i}),((t,e)=>{const i=new Pack(t);return addFilesAsync(i,e),i}),((t,e)=>{if(!e?.length)throw new TypeError("no paths specified to add to archive")}));var ke=i(34589),Te=i(77598);const Le="win32"===(process.env.__FAKE_PLATFORM__||process.platform),{O_CREAT:Ne,O_TRUNC:Ae,O_WRONLY:De}=n.constants,Ie=Number(process.env.__FAKE_FS_O_FILENAME__)||n.constants.UV_FS_O_FILEMAP||0,xe=Ie|Ae|Ne|De,Fe=Le&&!!Ie?t=>t<524288?xe:"w":()=>"w",lchownSync=(t,e,i)=>{try{return B.lchownSync(t,e,i)}catch(t){if("ENOENT"!==t?.code)throw t}},chown=(t,e,i,s)=>{B.lchown(t,e,i,(t=>{s(t&&"ENOENT"!==t?.code?t:null)}))},chownrKid=(t,e,i,s,r)=>{if(e.isDirectory())chownr(C.resolve(t,e.name),i,s,(n=>{if(n)return r(n);const h=C.resolve(t,e.name);chown(h,i,s,r)}));else{const n=C.resolve(t,e.name);chown(n,i,s,r)}},chownr=(t,e,i,s)=>{B.readdir(t,{withFileTypes:!0},((r,n)=>{if(r){if("ENOENT"===r.code)return s();if("ENOTDIR"!==r.code&&"ENOTSUP"!==r.code)return s(r)}if(r||!n.length)return chown(t,e,i,s);let h=n.length,o=null;const then=r=>{if(!o)return r?s(o=r):0==--h?chown(t,e,i,s):void 0};for(const s of n)chownrKid(t,s,e,i,then)}))},chownrKidSync=(t,e,i,s)=>{e.isDirectory()&&chownrSync(C.resolve(t,e.name),i,s),lchownSync(C.resolve(t,e.name),i,s)},chownrSync=(t,e,i)=>{let s;try{s=B.readdirSync(t,{withFileTypes:!0})}catch(s){const r=s;if("ENOENT"===r?.code)return;if("ENOTDIR"===r?.code||"ENOTSUP"===r?.code)return lchownSync(t,e,i);throw r}for(const r of s)chownrKidSync(t,r,e,i);return lchownSync(t,e,i)},optsArg=t=>{if(t)if("object"==typeof t)t={mode:511,...t};else if("number"==typeof t)t={mode:t};else{if("string"!=typeof t)throw new TypeError("invalid options argument");t={mode:parseInt(t,8)}}else t={mode:511};const e=t,i=t.fs||{};return t.mkdir=t.mkdir||i.mkdir||n.mkdir,t.mkdirAsync=t.mkdirAsync?t.mkdirAsync:async(t,i)=>new Promise(((s,r)=>e.mkdir(t,i,((t,e)=>t?r(t):s(e))))),t.stat=t.stat||i.stat||n.stat,t.statAsync=t.statAsync?t.statAsync:async t=>new Promise(((i,s)=>e.stat(t,((t,e)=>t?s(t):i(e))))),t.statSync=t.statSync||i.statSync||n.statSync,t.mkdirSync=t.mkdirSync||i.mkdirSync||n.mkdirSync,e},mkdirp_manual_mkdirpManualSync=(t,e,i)=>{const s=(0,M.dirname)(t),r={...optsArg(e),recursive:!1};if(s===t)try{return r.mkdirSync(t,r)}catch(t){if(t&&"EISDIR"!==t.code)throw t;return}try{return r.mkdirSync(t,r),i||t}catch(e){const n=e;if(n&&"ENOENT"===n.code)return mkdirp_manual_mkdirpManualSync(t,r,mkdirp_manual_mkdirpManualSync(s,r,i));if(n&&"EEXIST"!==n.code&&n&&"EROFS"!==n.code)throw e;try{if(!r.statSync(t).isDirectory())throw e}catch(t){throw e}}},Pe=Object.assign((async(t,e,i)=>{const s=optsArg(e);s.recursive=!1;const r=(0,M.dirname)(t);return r===t?s.mkdirAsync(t,s).catch((t=>{if(t&&"EISDIR"!==t.code)throw t})):s.mkdirAsync(t,s).then((()=>i||t),(async e=>{const n=e;if(n&&"ENOENT"===n.code)return Pe(r,s).then((e=>Pe(t,s,e)));if(n&&"EEXIST"!==n.code&&"EROFS"!==n.code)throw e;return s.statAsync(t).then((t=>{if(t.isDirectory())return i;throw e}),(()=>{throw e}))}))}),{sync:mkdirp_manual_mkdirpManualSync}),findMade=async(t,e,i)=>{if(i!==e)return t.statAsync(e).then((t=>t.isDirectory()?i:void 0),(i=>i&&"ENOENT"===i.code?findMade(t,(0,M.dirname)(e),e):void 0))},findMadeSync=(t,e,i)=>{if(i!==e)try{return t.statSync(e).isDirectory()?i:void 0}catch(i){return i&&"ENOENT"===i.code?findMadeSync(t,(0,M.dirname)(e),e):void 0}},mkdirp_native_mkdirpNativeSync=(t,e)=>{const i=optsArg(e);i.recursive=!0;if((0,M.dirname)(t)===t)return i.mkdirSync(t,i);const s=findMadeSync(i,t);try{return i.mkdirSync(t,i),s}catch(e){if(e&&"ENOENT"===e.code)return mkdirp_manual_mkdirpManualSync(t,i);throw e}},Ce=Object.assign((async(t,e)=>{const i={...optsArg(e),recursive:!0};return(0,M.dirname)(t)===t?await i.mkdirAsync(t,i):findMade(i,t).then((e=>i.mkdirAsync(t,i).then((t=>e||t)).catch((e=>{if(e&&"ENOENT"===e.code)return Pe(t,i);throw e}))))}),{sync:mkdirp_native_mkdirpNativeSync}),Be=process.env.__TESTING_MKDIRP_PLATFORM__||process.platform,pathArg=t=>{if(/\0/.test(t))throw Object.assign(new TypeError("path must be a string without null bytes"),{path:t,code:"ERR_INVALID_ARG_VALUE"});if(t=(0,M.resolve)(t),"win32"===Be){const e=/[*|"<>?:]/,{root:i}=(0,M.parse)(t);if(e.test(t.substring(i.length)))throw Object.assign(new Error("Illegal characters in path."),{path:t,code:"EINVAL"})}return t},Me=(process.env.__TESTING_MKDIRP_NODE_VERSION__||process.version).replace(/^v/,"").split("."),ze=+Me[0]>10||10==+Me[0]&&+Me[1]>=12,Ue=ze?t=>optsArg(t).mkdirSync===n.mkdirSync:()=>!1,He=Object.assign(ze?t=>optsArg(t).mkdir===n.mkdir:()=>!1,{sync:Ue}),mkdirpSync=(t,e)=>{t=pathArg(t);const i=optsArg(e);return Ue(i)?mkdirp_native_mkdirpNativeSync(t,i):mkdirp_manual_mkdirpManualSync(t,i)},We=Object.assign((async(t,e)=>{t=pathArg(t);const i=optsArg(e);return He(i)?Ce(t,i):Pe(t,i)}),{mkdirpSync,mkdirpNative:Ce,mkdirpNativeSync:mkdirp_native_mkdirpNativeSync,mkdirpManual:Pe,mkdirpManualSync:mkdirp_manual_mkdirpManualSync,sync:mkdirpSync,native:Ce,nativeSync:mkdirp_native_mkdirpNativeSync,manual:Pe,manualSync:mkdirp_manual_mkdirpManualSync,useNative:He,useNativeSync:Ue});class CwdError extends Error{path;code;syscall="chdir";constructor(t,e){super(`${e}: Cannot cd into '${t}'`),this.path=t,this.code=e}get name(){return"CwdError"}}class SymlinkError extends Error{path;symlink;syscall="symlink";code="TAR_SYMLINK_ERROR";constructor(t,e){super("TAR_SYMLINK_ERROR: Cannot extract through symbolic link"),this.symlink=t,this.path=e}get name(){return"SymlinkError"}}const cGet=(t,e)=>t.get(et(e)),cSet=(t,e,i)=>t.set(et(e),i),mkdir=(t,e,i)=>{t=et(t);const s=e.umask??18,r=448|e.mode,h=!!(r&s),o=e.uid,a=e.gid,l="number"==typeof o&&"number"==typeof a&&(o!==e.processUid||a!==e.processGid),c=e.preserve,d=e.unlink,u=e.cache,m=et(e.cwd),done=(e,s)=>{e?i(e):(cSet(u,t,!0),s&&l?chownr(s,o,a,(t=>done(t))):h?n.chmod(t,r,i):i())};if(u&&!0===cGet(u,t))return done();if(t===m)return((t,e)=>{n.stat(t,((i,s)=>{!i&&s.isDirectory()||(i=new CwdError(t,i?.code||"ENOTDIR")),e(i)}))})(t,done);if(c)return We(t,{mode:r}).then((t=>done(null,t??void 0)),done);const p=et(C.relative(m,t)).split("/");mkdir_(m,p,r,u,d,m,void 0,done)},mkdir_=(t,e,i,s,r,h,o,a)=>{if(!e.length)return a(null,o);const l=e.shift(),c=et(C.resolve(t+"/"+l));if(cGet(s,c))return mkdir_(c,e,i,s,r,h,o,a);n.mkdir(c,i,onmkdir(c,e,i,s,r,h,o,a))},onmkdir=(t,e,i,s,r,h,o,a)=>l=>{l?n.lstat(t,((c,d)=>{if(c)c.path=c.path&&et(c.path),a(c);else if(d.isDirectory())mkdir_(t,e,i,s,r,h,o,a);else if(r)n.unlink(t,(l=>{if(l)return a(l);n.mkdir(t,i,onmkdir(t,e,i,s,r,h,o,a))}));else{if(d.isSymbolicLink())return a(new SymlinkError(t,t+"/"+e.join("/")));a(l)}})):mkdir_(t,e,i,s,r,h,o=o||t,a)},mkdirSync=(t,e)=>{t=et(t);const i=e.umask??18,s=448|e.mode,r=!!(s&i),h=e.uid,o=e.gid,a="number"==typeof h&&"number"==typeof o&&(h!==e.processUid||o!==e.processGid),l=e.preserve,c=e.unlink,d=e.cache,u=et(e.cwd),done=e=>{cSet(d,t,!0),e&&a&&chownrSync(e,h,o),r&&n.chmodSync(t,s)};if(d&&!0===cGet(d,t))return done();if(t===u)return(t=>{let e,i=!1;try{i=n.statSync(t).isDirectory()}catch(t){e=t?.code}finally{if(!i)throw new CwdError(t,e??"ENOTDIR")}})(u),done();if(l)return done(mkdirpSync(t,s)??void 0);const m=et(C.relative(u,t)).split("/");let p;for(let t=m.shift(),e=u;t&&(e+="/"+t);t=m.shift())if(e=et(C.resolve(e)),!cGet(d,e))try{n.mkdirSync(e,s),p=p||e,cSet(d,e,!0)}catch(t){const i=n.lstatSync(e);if(i.isDirectory()){cSet(d,e,!0);continue}if(c){n.unlinkSync(e),n.mkdirSync(e,s),p=p||e,cSet(d,e,!0);continue}if(i.isSymbolicLink())return new SymlinkError(e,e+"/"+m.join("/"))}return done(p)},Ze=Object.create(null),{hasOwnProperty:je}=Object.prototype,normalizeUnicode=t=>(je.call(Ze,t)||(Ze[t]=t.normalize("NFD")),Ze[t]),Ge="win32"===(process.env.TESTING_TAR_FAKE_PLATFORM||process.platform);class PathReservations{#m=new Map;#p=new Map;#f=new Set;reserve(t,e){t=Ge?["win32 parallelization disabled"]:t.map((t=>stripTrailingSlashes((0,C.join)(normalizeUnicode(t))).toLowerCase()));const i=new Set(t.map((t=>(t=>{const e=t.split("/").slice(0,-1).reduce(((t,e)=>{const i=t[t.length-1];return void 0!==i&&(e=(0,C.join)(i,e)),t.push(e||"/"),t}),[]);return e})(t))).reduce(((t,e)=>t.concat(e))));this.#p.set(e,{dirs:i,paths:t});for(const i of t){const t=this.#m.get(i);t?t.push(e):this.#m.set(i,[e])}for(const t of i){const i=this.#m.get(t);if(i){const t=i[i.length-1];t instanceof Set?t.add(e):i.push(new Set([e]))}else this.#m.set(t,[new Set([e])])}return this.#y(e)}#b(t){const e=this.#p.get(t);if(!e)throw new Error("function does not have any path reservations");return{paths:e.paths.map((t=>this.#m.get(t))),dirs:[...e.dirs].map((t=>this.#m.get(t)))}}check(t){const{paths:e,dirs:i}=this.#b(t);return e.every((e=>e&&e[0]===t))&&i.every((e=>e&&e[0]instanceof Set&&e[0].has(t)))}#y(t){return!(this.#f.has(t)||!this.check(t))&&(this.#f.add(t),t((()=>this.#E(t))),!0)}#E(t){if(!this.#f.has(t))return!1;const e=this.#p.get(t);if(!e)throw new Error("invalid reservation");const{paths:i,dirs:s}=e,r=new Set;for(const e of i){const i=this.#m.get(e);if(!i||i?.[0]!==t)continue;const s=i[1];if(s)if(i.shift(),"function"==typeof s)r.add(s);else for(const t of s)r.add(t);else this.#m.delete(e)}for(const e of s){const i=this.#m.get(e),s=i?.[0];if(i&&s instanceof Set)if(1!==s.size||1!==i.length)if(1===s.size){i.shift();const t=i[0];"function"==typeof t&&r.add(t)}else s.delete(t);else this.#m.delete(e)}return this.#f.delete(t),r.forEach((t=>this.#y(t))),!0}}const Ye=Symbol("onEntry"),Ve=Symbol("checkFs"),$e=Symbol("checkFs2"),Ke=Symbol("pruneCache"),qe=Symbol("isReusable"),Xe=Symbol("makeFs"),Je=Symbol("file"),Qe=Symbol("directory"),ti=Symbol("link"),ei=Symbol("symlink"),ii=Symbol("hardlink"),si=Symbol("unsupported"),ri=Symbol("checkPath"),ni=Symbol("mkdir"),hi=Symbol("onError"),oi=Symbol("pending"),ai=Symbol("pend"),li=Symbol("unpend"),ci=Symbol("ended"),di=Symbol("maybeClose"),ui=Symbol("skip"),mi=Symbol("doChown"),pi=Symbol("uid"),fi=Symbol("gid"),yi=Symbol("checkedCwd"),bi="win32"===(process.env.TESTING_TAR_FAKE_PLATFORM||process.platform),uint32=(t,e,i)=>void 0!==t&&t===t>>>0?t:void 0!==e&&e===e>>>0?e:i,cacheKeyNormalize=t=>stripTrailingSlashes(et(normalizeUnicode(t))).toLowerCase();class Unpack extends Parser{[ci]=!1;[yi]=!1;[oi]=0;reservations=new PathReservations;transform;writable=!0;readable=!1;dirCache;uid;gid;setOwner;preserveOwner;processGid;processUid;maxDepth;forceChown;win32;newer;keep;noMtime;preservePaths;unlink;cwd;strip;processUmask;umask;dmode;fmode;chmod;constructor(t={}){if(t.ondone=()=>{this[ci]=!0,this[di]()},super(t),this.transform=t.transform,this.dirCache=t.dirCache||new Map,this.chmod=!!t.chmod,"number"==typeof t.uid||"number"==typeof t.gid){if("number"!=typeof t.uid||"number"!=typeof t.gid)throw new TypeError("cannot set owner without number uid and gid");if(t.preserveOwner)throw new TypeError("cannot preserve owner in archive and also set owner explicitly");this.uid=t.uid,this.gid=t.gid,this.setOwner=!0}else this.uid=void 0,this.gid=void 0,this.setOwner=!1;void 0===t.preserveOwner&&"number"!=typeof t.uid?this.preserveOwner=!(!process.getuid||0!==process.getuid()):this.preserveOwner=!!t.preserveOwner,this.processUid=(this.preserveOwner||this.setOwner)&&process.getuid?process.getuid():void 0,this.processGid=(this.preserveOwner||this.setOwner)&&process.getgid?process.getgid():void 0,this.maxDepth="number"==typeof t.maxDepth?t.maxDepth:1024,this.forceChown=!0===t.forceChown,this.win32=!!t.win32||bi,this.newer=!!t.newer,this.keep=!!t.keep,this.noMtime=!!t.noMtime,this.preservePaths=!!t.preservePaths,this.unlink=!!t.unlink,this.cwd=et(C.resolve(t.cwd||process.cwd())),this.strip=Number(t.strip)||0,this.processUmask=this.chmod?"number"==typeof t.processUmask?t.processUmask:process.umask():0,this.umask="number"==typeof t.umask?t.umask:this.processUmask,this.dmode=t.dmode||511&~this.umask,this.fmode=t.fmode||438&~this.umask,this.on("entry",(t=>this[Ye](t)))}warn(t,e,i={}){return"TAR_BAD_ARCHIVE"!==t&&"TAR_ABORT"!==t||(i.recoverable=!1),super.warn(t,e,i)}[di](){this[ci]&&0===this[oi]&&(this.emit("prefinish"),this.emit("finish"),this.emit("end"))}[ri](t){const e=et(t.path),i=e.split("/");if(this.strip){if(i.length<this.strip)return!1;if("Link"===t.type){const e=et(String(t.linkpath)).split("/");if(!(e.length>=this.strip))return!1;t.linkpath=e.slice(this.strip).join("/")}i.splice(0,this.strip),t.path=i.join("/")}if(isFinite(this.maxDepth)&&i.length>this.maxDepth)return this.warn("TAR_ENTRY_ERROR","path excessively deep",{entry:t,path:e,depth:i.length,maxDepth:this.maxDepth}),!1;if(!this.preservePaths){if(i.includes("..")||bi&&/^[a-z]:\.\.$/i.test(i[0]??""))return this.warn("TAR_ENTRY_ERROR","path contains '..'",{entry:t,path:e}),!1;const[s,r]=stripAbsolutePath(e);s&&(t.path=String(r),this.warn("TAR_ENTRY_INFO",`stripping ${s} from absolute path`,{entry:t,path:e}))}if(C.isAbsolute(t.path)?t.absolute=et(C.resolve(t.path)):t.absolute=et(C.resolve(this.cwd,t.path)),!this.preservePaths&&"string"==typeof t.absolute&&0!==t.absolute.indexOf(this.cwd+"/")&&t.absolute!==this.cwd)return this.warn("TAR_ENTRY_ERROR","path escaped extraction target",{entry:t,path:et(t.path),resolvedPath:t.absolute,cwd:this.cwd}),!1;if(t.absolute===this.cwd&&"Directory"!==t.type&&"GNUDumpDir"!==t.type)return!1;if(this.win32){const{root:e}=C.win32.parse(String(t.absolute));t.absolute=e+winchars_encode(String(t.absolute).slice(e.length));const{root:i}=C.win32.parse(t.path);t.path=i+winchars_encode(t.path.slice(i.length))}return!0}[Ye](t){if(!this[ri](t))return t.resume();switch(ke.equal(typeof t.absolute,"string"),t.type){case"Directory":case"GNUDumpDir":t.mode&&(t.mode=448|t.mode);case"File":case"OldFile":case"ContiguousFile":case"Link":case"SymbolicLink":return this[Ve](t);default:return this[si](t)}}[hi](t,e){"CwdError"===t.name?this.emit("error",t):(this.warn("TAR_ENTRY_ERROR",t,{entry:e}),this[li](),e.resume())}[ni](t,e,i){mkdir(et(t),{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cache:this.dirCache,cwd:this.cwd,mode:e},i)}[mi](t){return this.forceChown||this.preserveOwner&&("number"==typeof t.uid&&t.uid!==this.processUid||"number"==typeof t.gid&&t.gid!==this.processGid)||"number"==typeof this.uid&&this.uid!==this.processUid||"number"==typeof this.gid&&this.gid!==this.processGid}[pi](t){return uint32(this.uid,t.uid,this.processUid)}[fi](t){return uint32(this.gid,t.gid,this.processGid)}[Je](t,e){const i="number"==typeof t.mode?4095&t.mode:this.fmode,s=new WriteStream(String(t.absolute),{flags:Fe(t.size),mode:i,autoClose:!1});s.on("error",(i=>{s.fd&&B.close(s.fd,(()=>{})),s.write=()=>!0,this[hi](i,t),e()}));let r=1;const done=i=>{if(i)return s.fd&&B.close(s.fd,(()=>{})),this[hi](i,t),void e();0==--r&&void 0!==s.fd&&B.close(s.fd,(i=>{i?this[hi](i,t):this[li](),e()}))};s.on("finish",(()=>{const e=String(t.absolute),i=s.fd;if("number"==typeof i&&t.mtime&&!this.noMtime){r++;const s=t.atime||new Date,n=t.mtime;B.futimes(i,s,n,(t=>t?B.utimes(e,s,n,(e=>done(e&&t))):done()))}if("number"==typeof i&&this[mi](t)){r++;const s=this[pi](t),n=this[fi](t);"number"==typeof s&&"number"==typeof n&&B.fchown(i,s,n,(t=>t?B.chown(e,s,n,(e=>done(e&&t))):done()))}done()}));const n=this.transform&&this.transform(t)||t;n!==t&&(n.on("error",(i=>{this[hi](i,t),e()})),t.pipe(n)),n.pipe(s)}[Qe](t,e){const i="number"==typeof t.mode?4095&t.mode:this.dmode;this[ni](String(t.absolute),i,(i=>{if(i)return this[hi](i,t),void e();let s=1;const done=()=>{0==--s&&(e(),this[li](),t.resume())};t.mtime&&!this.noMtime&&(s++,B.utimes(String(t.absolute),t.atime||new Date,t.mtime,done)),this[mi](t)&&(s++,B.chown(String(t.absolute),Number(this[pi](t)),Number(this[fi](t)),done)),done()}))}[si](t){t.unsupported=!0,this.warn("TAR_ENTRY_UNSUPPORTED",`unsupported entry type: ${t.type}`,{entry:t}),t.resume()}[ei](t,e){this[ti](t,String(t.linkpath),"symlink",e)}[ii](t,e){const i=et(C.resolve(this.cwd,String(t.linkpath)));this[ti](t,i,"link",e)}[ai](){this[oi]++}[li](){this[oi]--,this[di]()}[ui](t){this[li](),t.resume()}[qe](t,e){return"File"===t.type&&!this.unlink&&e.isFile()&&e.nlink<=1&&!bi}[Ve](t){this[ai]();const e=[t.path];t.linkpath&&e.push(t.linkpath),this.reservations.reserve(e,(e=>this[$e](t,e)))}[Ke](t){"SymbolicLink"===t.type?(t=>{for(const e of t.keys())t.delete(e)})(this.dirCache):"Directory"!==t.type&&((t,e)=>{e=cacheKeyNormalize(e);for(const i of t.keys()){const s=cacheKeyNormalize(i);s!==e&&0!==s.indexOf(e+"/")||t.delete(i)}})(this.dirCache,String(t.absolute))}[$e](t,e){this[Ke](t);const done=i=>{this[Ke](t),e(i)},checkCwd=()=>{this[ni](this.cwd,this.dmode,(e=>{if(e)return this[hi](e,t),void done();this[yi]=!0,start()}))},start=()=>{if(t.absolute!==this.cwd){const e=et(C.dirname(String(t.absolute)));if(e!==this.cwd)return this[ni](e,this.dmode,(e=>{if(e)return this[hi](e,t),void done();afterMakeParent()}))}afterMakeParent()},afterMakeParent=()=>{B.lstat(String(t.absolute),((e,i)=>{if(i&&(this.keep||this.newer&&i.mtime>(t.mtime??i.mtime)))return this[ui](t),void done();if(e||this[qe](t,i))return this[Xe](null,t,done);if(i.isDirectory()){if("Directory"===t.type){const afterChmod=e=>this[Xe](e??null,t,done);return this.chmod&&t.mode&&(4095&i.mode)!==t.mode?B.chmod(String(t.absolute),Number(t.mode),afterChmod):afterChmod()}if(t.absolute!==this.cwd)return B.rmdir(String(t.absolute),(e=>this[Xe](e??null,t,done)))}if(t.absolute===this.cwd)return this[Xe](null,t,done);((t,e)=>{if(!bi)return B.unlink(t,e);const i=t+".DELETE."+(0,Te.randomBytes)(16).toString("hex");B.rename(t,i,(t=>{if(t)return e(t);B.unlink(i,e)}))})(String(t.absolute),(e=>this[Xe](e??null,t,done)))}))};this[yi]?start():checkCwd()}[Xe](t,e,i){if(t)return this[hi](t,e),void i();switch(e.type){case"File":case"OldFile":case"ContiguousFile":return this[Je](e,i);case"Link":return this[ii](e,i);case"SymbolicLink":return this[ei](e,i);case"Directory":case"GNUDumpDir":return this[Qe](e,i)}}[ti](t,e,i,s){B[i](e,String(t.absolute),(e=>{e?this[hi](e,t):(this[li](),t.resume()),s()}))}}const callSync=t=>{try{return[null,t()]}catch(t){return[t,null]}};class UnpackSync extends Unpack{sync=!0;[Xe](t,e){return super[Xe](t,e,(()=>{}))}[Ve](t){if(this[Ke](t),!this[yi]){const e=this[ni](this.cwd,this.dmode);if(e)return this[hi](e,t);this[yi]=!0}if(t.absolute!==this.cwd){const e=et(C.dirname(String(t.absolute)));if(e!==this.cwd){const i=this[ni](e,this.dmode);if(i)return this[hi](i,t)}}const[e,i]=callSync((()=>B.lstatSync(String(t.absolute))));if(i&&(this.keep||this.newer&&i.mtime>(t.mtime??i.mtime)))return this[ui](t);if(e||this[qe](t,i))return this[Xe](null,t);if(i.isDirectory()){if("Directory"===t.type){const e=this.chmod&&t.mode&&(4095&i.mode)!==t.mode,[s]=e?callSync((()=>{B.chmodSync(String(t.absolute),Number(t.mode))})):[];return this[Xe](s,t)}const[e]=callSync((()=>B.rmdirSync(String(t.absolute))));this[Xe](e,t)}const[s]=t.absolute===this.cwd?[]:callSync((()=>(t=>{if(!bi)return B.unlinkSync(t);const e=t+".DELETE."+(0,Te.randomBytes)(16).toString("hex");B.renameSync(t,e),B.unlinkSync(e)})(String(t.absolute))));this[Xe](s,t)}[Je](t,e){const i="number"==typeof t.mode?4095&t.mode:this.fmode,oner=i=>{let r;try{B.closeSync(s)}catch(t){r=t}(i||r)&&this[hi](i||r,t),e()};let s;try{s=B.openSync(String(t.absolute),Fe(t.size),i)}catch(t){return oner(t)}const r=this.transform&&this.transform(t)||t;r!==t&&(r.on("error",(e=>this[hi](e,t))),t.pipe(r)),r.on("data",(t=>{try{B.writeSync(s,t,0,t.length)}catch(t){oner(t)}})),r.on("end",(()=>{let e=null;if(t.mtime&&!this.noMtime){const i=t.atime||new Date,r=t.mtime;try{B.futimesSync(s,i,r)}catch(s){try{B.utimesSync(String(t.absolute),i,r)}catch(t){e=s}}}if(this[mi](t)){const i=this[pi](t),r=this[fi](t);try{B.fchownSync(s,Number(i),Number(r))}catch(s){try{B.chownSync(String(t.absolute),Number(i),Number(r))}catch(t){e=e||s}}}oner(e)}))}[Qe](t,e){const i="number"==typeof t.mode?4095&t.mode:this.dmode,s=this[ni](String(t.absolute),i);if(s)return this[hi](s,t),void e();if(t.mtime&&!this.noMtime)try{B.utimesSync(String(t.absolute),t.atime||new Date,t.mtime)}catch(s){}if(this[mi](t))try{B.chownSync(String(t.absolute),Number(this[pi](t)),Number(this[fi](t)))}catch(s){}e(),t.resume()}[ni](t,e){try{return mkdirSync(et(t),{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cache:this.dirCache,cwd:this.cwd,mode:e})}catch(t){return t}}[ti](t,e,i,s){const r=`${i}Sync`;try{B[r](e,String(t.absolute)),s(),t.resume()}catch(e){return this[hi](e,t)}}}const Ei=makeCommand((t=>{const e=new UnpackSync(t),i=t.file,s=B.statSync(i),r=t.maxReadSize||16777216;new ReadStreamSync(i,{readSize:r,size:s.size}).pipe(e)}),((t,e)=>{const i=new Unpack(t),s=t.maxReadSize||16777216,r=t.file;return new Promise(((t,e)=>{i.on("error",e),i.on("close",t),B.stat(r,((t,n)=>{if(t)e(t);else{const t=new ReadStream(r,{readSize:s,size:n.size});t.on("error",e),t.pipe(i)}}))}))}),(t=>new UnpackSync(t)),(t=>new Unpack(t)),((t,e)=>{e?.length&&filesFilter(t,e)})),streamSync=(t,e,i,s,r)=>{const n=new WriteStreamSync(t.file,{fd:s,start:i});e.pipe(n),replace_addFilesSync(e,r)},replace_addFilesSync=(t,e)=>{e.forEach((e=>{"@"===e.charAt(0)?xt({file:C.resolve(t.cwd,e.slice(1)),sync:!0,noResume:!0,onReadEntry:e=>t.add(e)}):t.add(e)})),t.end()},replace_addFilesAsync=async(t,e)=>{for(let i=0;i<e.length;i++){const s=String(e[i]);"@"===s.charAt(0)?await xt({file:C.resolve(String(t.cwd),s.slice(1)),noResume:!0,onReadEntry:e=>t.add(e)}):t.add(s)}t.end()},wi=makeCommand(((t,e)=>{const i=new PackSync(t);let s,r,n=!0;try{try{s=B.openSync(t.file,"r+")}catch(e){if("ENOENT"!==e?.code)throw e;s=B.openSync(t.file,"w+")}const h=B.fstatSync(s),o=Buffer.alloc(512);t:for(r=0;r<h.size;r+=512){for(let t=0,e=0;t<512;t+=e){if(e=B.readSync(s,o,t,o.length-t,r+t),0===r&&31===o[0]&&139===o[1])throw new Error("cannot append to compressed archives");if(!e)break t}const e=new Header(o);if(!e.cksumValid)break;const i=512*Math.ceil((e.size||0)/512);if(r+i+512>h.size)break;r+=i,t.mtimeCache&&e.mtime&&t.mtimeCache.set(String(e.path),e.mtime)}n=!1,streamSync(t,i,r,s,e)}finally{if(n)try{B.closeSync(s)}catch(t){}}}),((t,e)=>{e=Array.from(e);const i=new Pack(t),s=new Promise(((s,r)=>{i.on("error",r);let n="r+";const onopen=(h,o)=>h&&"ENOENT"===h.code&&"r+"===n?(n="w+",B.open(t.file,n,onopen)):h||!o?r(h):void B.fstat(o,((n,h)=>{if(n)return B.close(o,(()=>r(n)));((e,i,s)=>{const cb=(t,i)=>{t?B.close(e,(e=>s(t))):s(null,i)};let r=0;if(0===i)return cb(null,0);let n=0;const h=Buffer.alloc(512),onread=(s,o)=>{if(s||void 0===o)return cb(s);if(n+=o,n<512&&o)return B.read(e,h,n,h.length-n,r+n,onread);if(0===r&&31===h[0]&&139===h[1])return cb(new Error("cannot append to compressed archives"));if(n<512)return cb(null,r);const a=new Header(h);if(!a.cksumValid)return cb(null,r);const l=512*Math.ceil((a.size??0)/512);return r+l+512>i?cb(null,r):(r+=l+512,r>=i?cb(null,r):(t.mtimeCache&&a.mtime&&t.mtimeCache.set(String(a.path),a.mtime),n=0,void B.read(e,h,0,512,r,onread)))};B.read(e,h,0,512,r,onread)})(o,h.size,((n,h)=>{if(n)return r(n);const a=new WriteStream(t.file,{fd:o,start:h});i.pipe(a),a.on("error",r),a.on("close",s),replace_addFilesAsync(i,e)}))}));B.open(t.file,n,onopen)}));return s}),(()=>{throw new TypeError("file is required")}),(()=>{throw new TypeError("file is required")}),((t,e)=>{if(!t.file)throw new TypeError("file is required");if(t.gzip||t.brotli||t.file.endsWith(".br")||t.file.endsWith(".tbr"))throw new TypeError("cannot append to compressed archives");if(!e?.length)throw new TypeError("no paths specified to add/replace")})),gi=makeCommand(wi.syncFile,wi.asyncFile,wi.syncNoFile,wi.asyncNoFile,((t,e=[])=>{wi.validate?.(t,e),mtimeFilter(t)})),mtimeFilter=t=>{const e=t.filter;t.mtimeCache||(t.mtimeCache=new Map),t.filter=e?(i,s)=>e(i,s)&&!((t.mtimeCache?.get(i)??s.mtime??0)>(s.mtime??0)):(e,i)=>!((t.mtimeCache?.get(e)??i.mtime??0)>(i.mtime??0))}}};
|
package/dist/344.codebuddy.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";exports.id=344,exports.ids=[344],exports.modules={45344:(t,e,s)=>{s.r(e),s.d(e,{Glob:()=>Glob,Ignore:()=>Ignore,escape:()=>escape_escape,glob:()=>tt,globIterate:()=>globIterate,globIterateSync:()=>globIterateSync,globStream:()=>globStream,globStreamSync:()=>globStreamSync,globSync:()=>globSync,hasMagic:()=>hasMagic,iterate:()=>Y,iterateSync:()=>X,stream:()=>K,streamSync:()=>J,sync:()=>Q,unescape:()=>unescape_unescape});var i=s(14213);const assertValidPattern=t=>{if("string"!=typeof t)throw new TypeError("invalid pattern");if(t.length>65536)throw new TypeError("pattern is too long")},r={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},braceEscape=t=>t.replace(/[[\]\\-]/g,"\\$&"),rangesToString=t=>t.join(""),parseClass=(t,e)=>{const s=e;if("["!==t.charAt(s))throw new Error("not in a brace expression");const i=[],n=[];let h=s+1,o=!1,a=!1,l=!1,c=!1,p=s,d="";t:for(;h<t.length;){const e=t.charAt(h);if("!"!==e&&"^"!==e||h!==s+1){if("]"===e&&o&&!l){p=h+1;break}if(o=!0,"\\"!==e||l){if("["===e&&!l)for(const[e,[o,l,c]]of Object.entries(r))if(t.startsWith(e,h)){if(d)return["$.",!1,t.length-s,!0];h+=e.length,c?n.push(o):i.push(o),a=a||l;continue t}l=!1,d?(e>d?i.push(braceEscape(d)+"-"+braceEscape(e)):e===d&&i.push(braceEscape(e)),d="",h++):t.startsWith("-]",h+1)?(i.push(braceEscape(e+"-")),h+=2):t.startsWith("-",h+1)?(d=e,h+=2):(i.push(braceEscape(e)),h++)}else l=!0,h++}else c=!0,h++}if(p<h)return["",!1,0,!1];if(!i.length&&!n.length)return["$.",!1,t.length-s,!0];if(0===n.length&&1===i.length&&/^\\?.$/.test(i[0])&&!c){const t=2===i[0].length?i[0].slice(-1):i[0];return[(u=t,u.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")),!1,p-s,!1]}var u;const f="["+(c?"^":"")+rangesToString(i)+"]",g="["+(c?"":"^")+rangesToString(n)+"]";return[i.length&&n.length?"("+f+"|"+g+")":i.length?f:g,a,p-s,!0]},unescape_unescape=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/\[([^\/\\])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"),n=new Set(["!","?","+","*","@"]),isExtglobType=t=>n.has(t),h="(?!\\.)",o=new Set(["[","."]),a=new Set(["..","."]),l=new Set("().*{}+?[]^$\\!"),c="[^/]",p=c+"*?",d=c+"+?";class AST{type;#t;#e;#s=!1;#i=[];#r;#n;#h;#o=!1;#a;#l;#c=!1;constructor(t,e,s={}){this.type=t,t&&(this.#e=!0),this.#r=e,this.#t=this.#r?this.#r.#t:this,this.#a=this.#t===this?s:this.#t.#a,this.#h=this.#t===this?[]:this.#t.#h,"!"!==t||this.#t.#o||this.#h.push(this),this.#n=this.#r?this.#r.#i.length:0}get hasMagic(){if(void 0!==this.#e)return this.#e;for(const t of this.#i)if("string"!=typeof t&&(t.type||t.hasMagic))return this.#e=!0;return this.#e}toString(){return void 0!==this.#l?this.#l:this.type?this.#l=this.type+"("+this.#i.map((t=>String(t))).join("|")+")":this.#l=this.#i.map((t=>String(t))).join("")}#p(){if(this!==this.#t)throw new Error("should only call on root");if(this.#o)return this;let t;for(this.toString(),this.#o=!0;t=this.#h.pop();){if("!"!==t.type)continue;let e=t,s=e.#r;for(;s;){for(let i=e.#n+1;!s.type&&i<s.#i.length;i++)for(const e of t.#i){if("string"==typeof e)throw new Error("string part in extglob AST??");e.copyIn(s.#i[i])}e=s,s=e.#r}}return this}push(...t){for(const e of t)if(""!==e){if("string"!=typeof e&&!(e instanceof AST&&e.#r===this))throw new Error("invalid part: "+e);this.#i.push(e)}}toJSON(){const t=null===this.type?this.#i.slice().map((t=>"string"==typeof t?t:t.toJSON())):[this.type,...this.#i.map((t=>t.toJSON()))];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===this.#t||this.#t.#o&&"!"===this.#r?.type)&&t.push({}),t}isStart(){if(this.#t===this)return!0;if(!this.#r?.isStart())return!1;if(0===this.#n)return!0;const t=this.#r;for(let e=0;e<this.#n;e++){const s=t.#i[e];if(!(s instanceof AST&&"!"===s.type))return!1}return!0}isEnd(){if(this.#t===this)return!0;if("!"===this.#r?.type)return!0;if(!this.#r?.isEnd())return!1;if(!this.type)return this.#r?.isEnd();const t=this.#r?this.#r.#i.length:0;return this.#n===t-1}copyIn(t){"string"==typeof t?this.push(t):this.push(t.clone(this))}clone(t){const e=new AST(this.type,t);for(const t of this.#i)e.copyIn(t);return e}static#d(t,e,s,i){let r=!1,n=!1,h=-1,o=!1;if(null===e.type){let a=s,l="";for(;a<t.length;){const s=t.charAt(a++);if(r||"\\"===s)r=!r,l+=s;else if(n)a===h+1?"^"!==s&&"!"!==s||(o=!0):"]"!==s||a===h+2&&o||(n=!1),l+=s;else if("["!==s)if(i.noext||!isExtglobType(s)||"("!==t.charAt(a))l+=s;else{e.push(l),l="";const r=new AST(s,e);a=AST.#d(t,r,a,i),e.push(r)}else n=!0,h=a,o=!1,l+=s}return e.push(l),a}let a=s+1,l=new AST(null,e);const c=[];let p="";for(;a<t.length;){const s=t.charAt(a++);if(r||"\\"===s)r=!r,p+=s;else if(n)a===h+1?"^"!==s&&"!"!==s||(o=!0):"]"!==s||a===h+2&&o||(n=!1),p+=s;else if("["!==s)if(isExtglobType(s)&&"("===t.charAt(a)){l.push(p),p="";const e=new AST(s,l);l.push(e),a=AST.#d(t,e,a,i)}else if("|"!==s){if(")"===s)return""===p&&0===e.#i.length&&(e.#c=!0),l.push(p),p="",e.push(...c,l),a;p+=s}else l.push(p),p="",c.push(l),l=new AST(null,e);else n=!0,h=a,o=!1,p+=s}return e.type=null,e.#e=void 0,e.#i=[t.substring(s-1)],a}static fromGlob(t,e={}){const s=new AST(null,void 0,e);return AST.#d(t,s,0,e),s}toMMPattern(){if(this!==this.#t)return this.#t.toMMPattern();const t=this.toString(),[e,s,i,r]=this.toRegExpSource();if(!(i||this.#e||this.#a.nocase&&!this.#a.nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return s;const n=(this.#a.nocase?"i":"")+(r?"u":"");return Object.assign(new RegExp(`^${e}$`,n),{_src:e,_glob:t})}get options(){return this.#a}toRegExpSource(t){const e=t??!!this.#a.dot;if(this.#t===this&&this.#p(),!this.type){const s=this.isStart()&&this.isEnd(),i=this.#i.map((e=>{const[i,r,n,h]="string"==typeof e?AST.#u(e,this.#e,s):e.toRegExpSource(t);return this.#e=this.#e||n,this.#s=this.#s||h,i})).join("");let r="";if(this.isStart()&&"string"==typeof this.#i[0]){if(!(1===this.#i.length&&a.has(this.#i[0]))){const s=o,n=e&&s.has(i.charAt(0))||i.startsWith("\\.")&&s.has(i.charAt(2))||i.startsWith("\\.\\.")&&s.has(i.charAt(4)),a=!e&&!t&&s.has(i.charAt(0));r=n?"(?!(?:^|/)\\.\\.?(?:$|/))":a?h:""}}let n="";this.isEnd()&&this.#t.#o&&"!"===this.#r?.type&&(n="(?:$|\\/)");return[r+i+n,unescape_unescape(i),this.#e=!!this.#e,this.#s]}const s="*"===this.type||"+"===this.type,i="!"===this.type?"(?:(?!(?:":"(?:";let r=this.#f(e);if(this.isStart()&&this.isEnd()&&!r&&"!"!==this.type){const t=this.toString();return this.#i=[t],this.type=null,this.#e=void 0,[t,unescape_unescape(this.toString()),!1,!1]}let n=!s||t||e?"":this.#f(!0);n===r&&(n=""),n&&(r=`(?:${r})(?:${n})*?`);let l="";if("!"===this.type&&this.#c)l=(this.isStart()&&!e?h:"")+d;else{l=i+r+("!"===this.type?"))"+(!this.isStart()||e||t?"":h)+p+")":"@"===this.type?")":"?"===this.type?")?":"+"===this.type&&n?")":"*"===this.type&&n?")?":`)${this.type}`)}return[l,unescape_unescape(r),this.#e=!!this.#e,this.#s]}#f(t){return this.#i.map((e=>{if("string"==typeof e)throw new Error("string type in extglob ast??");const[s,i,r,n]=e.toRegExpSource(t);return this.#s=this.#s||n,s})).filter((t=>!(this.isStart()&&this.isEnd()&&!t))).join("|")}static#u(t,e,s=!1){let i=!1,r="",n=!1;for(let h=0;h<t.length;h++){const o=t.charAt(h);if(i)i=!1,r+=(l.has(o)?"\\":"")+o;else if("\\"!==o){if("["===o){const[s,i,o,a]=parseClass(t,h);if(o){r+=s,n=n||i,h+=o-1,e=e||a;continue}}"*"!==o?"?"!==o?r+=o.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"):(r+=c,e=!0):(r+=s&&"*"===t?d:p,e=!0)}else h===t.length-1?r+="\\\\":i=!0}return[r,unescape_unescape(t),!!e,n]}}const escape_escape=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/[?*()[\]]/g,"[$&]"):t.replace(/[?*()[\]\\]/g,"\\$&"),minimatch=(t,e,s={})=>(assertValidPattern(e),!(!s.nocomment&&"#"===e.charAt(0))&&new Minimatch(e,s).match(t)),u=/^\*+([^+@!?\*\[\(]*)$/,starDotExtTest=t=>e=>!e.startsWith(".")&&e.endsWith(t),starDotExtTestDot=t=>e=>e.endsWith(t),starDotExtTestNocase=t=>(t=t.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(t)),starDotExtTestNocaseDot=t=>(t=t.toLowerCase(),e=>e.toLowerCase().endsWith(t)),f=/^\*+\.\*+$/,starDotStarTest=t=>!t.startsWith(".")&&t.includes("."),starDotStarTestDot=t=>"."!==t&&".."!==t&&t.includes("."),g=/^\.\*+$/,dotStarTest=t=>"."!==t&&".."!==t&&t.startsWith("."),m=/^\*+$/,starTest=t=>0!==t.length&&!t.startsWith("."),starTestDot=t=>0!==t.length&&"."!==t&&".."!==t,w=/^\?+([^+@!?\*\[\(]*)?$/,qmarksTestNocase=([t,e=""])=>{const s=qmarksTestNoExt([t]);return e?(e=e.toLowerCase(),t=>s(t)&&t.toLowerCase().endsWith(e)):s},qmarksTestNocaseDot=([t,e=""])=>{const s=qmarksTestNoExtDot([t]);return e?(e=e.toLowerCase(),t=>s(t)&&t.toLowerCase().endsWith(e)):s},qmarksTestDot=([t,e=""])=>{const s=qmarksTestNoExtDot([t]);return e?t=>s(t)&&t.endsWith(e):s},qmarksTest=([t,e=""])=>{const s=qmarksTestNoExt([t]);return e?t=>s(t)&&t.endsWith(e):s},qmarksTestNoExt=([t])=>{const e=t.length;return t=>t.length===e&&!t.startsWith(".")},qmarksTestNoExtDot=([t])=>{const e=t.length;return t=>t.length===e&&"."!==t&&".."!==t},y="object"==typeof process&&process?"object"==typeof process.env&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix";minimatch.sep="win32"===y?{sep:"\\"}.sep:{sep:"/"}.sep;const S=Symbol("globstar **");minimatch.GLOBSTAR=S;minimatch.filter=(t,e={})=>s=>minimatch(s,t,e);const ext=(t,e={})=>Object.assign({},t,e);minimatch.defaults=t=>{if(!t||"object"!=typeof t||!Object.keys(t).length)return minimatch;const e=minimatch;return Object.assign(((s,i,r={})=>e(s,i,ext(t,r))),{Minimatch:class Minimatch extends e.Minimatch{constructor(e,s={}){super(e,ext(t,s))}static defaults(s){return e.defaults(ext(t,s)).Minimatch}},AST:class AST extends e.AST{constructor(e,s,i={}){super(e,s,ext(t,i))}static fromGlob(s,i={}){return e.AST.fromGlob(s,ext(t,i))}},unescape:(s,i={})=>e.unescape(s,ext(t,i)),escape:(s,i={})=>e.escape(s,ext(t,i)),filter:(s,i={})=>e.filter(s,ext(t,i)),defaults:s=>e.defaults(ext(t,s)),makeRe:(s,i={})=>e.makeRe(s,ext(t,i)),braceExpand:(s,i={})=>e.braceExpand(s,ext(t,i)),match:(s,i,r={})=>e.match(s,i,ext(t,r)),sep:e.sep,GLOBSTAR:S})};const braceExpand=(t,e={})=>(assertValidPattern(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:(0,i.f)(t));minimatch.braceExpand=braceExpand;minimatch.makeRe=(t,e={})=>new Minimatch(t,e).makeRe();minimatch.match=(t,e,s={})=>{const i=new Minimatch(e,s);return t=t.filter((t=>i.match(t))),i.options.nonull&&!t.length&&t.push(e),t};const b=/[?*]|[+@!]\(.*?\)|\[|\]/;class Minimatch{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(t,e={}){assertValidPattern(t),e=e||{},this.options=e,this.pattern=t,this.platform=e.platform||y,this.isWindows="win32"===this.platform,this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||!1===e.allowWindowsEscape,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!e.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!e.nonegate,this.comment=!1,this.empty=!1,this.partial=!!e.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=void 0!==e.windowsNoMagicRoot?e.windowsNoMagicRoot:!(!this.isWindows||!this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(const t of this.set)for(const e of t)if("string"!=typeof e)return!0;return!1}debug(...t){}make(){const t=this.pattern,e=this.options;if(!e.nocomment&&"#"===t.charAt(0))return void(this.comment=!0);if(!t)return void(this.empty=!0);this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],e.debug&&(this.debug=(...t)=>console.error(...t)),this.debug(this.pattern,this.globSet);const s=this.globSet.map((t=>this.slashSplit(t)));this.globParts=this.preprocess(s),this.debug(this.pattern,this.globParts);let i=this.globParts.map(((t,e,s)=>{if(this.isWindows&&this.windowsNoMagicRoot){const e=!(""!==t[0]||""!==t[1]||"?"!==t[2]&&b.test(t[2])||b.test(t[3])),s=/^[a-z]:/i.test(t[0]);if(e)return[...t.slice(0,4),...t.slice(4).map((t=>this.parse(t)))];if(s)return[t[0],...t.slice(1).map((t=>this.parse(t)))]}return t.map((t=>this.parse(t)))}));if(this.debug(this.pattern,i),this.set=i.filter((t=>-1===t.indexOf(!1))),this.isWindows)for(let t=0;t<this.set.length;t++){const e=this.set[t];""===e[0]&&""===e[1]&&"?"===this.globParts[t][2]&&"string"==typeof e[3]&&/^[a-z]:$/i.test(e[3])&&(e[2]="?")}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar)for(let e=0;e<t.length;e++)for(let s=0;s<t[e].length;s++)"**"===t[e][s]&&(t[e][s]="*");const{optimizationLevel:e=1}=this.options;return e>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):t=e>=1?this.levelOneOptimize(t):this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map((t=>{let e=-1;for(;-1!==(e=t.indexOf("**",e+1));){let s=e;for(;"**"===t[s+1];)s++;s!==e&&t.splice(e,s-e)}return t}))}levelOneOptimize(t){return t.map((t=>0===(t=t.reduce(((t,e)=>{const s=t[t.length-1];return"**"===e&&"**"===s?t:".."===e&&s&&".."!==s&&"."!==s&&"**"!==s?(t.pop(),t):(t.push(e),t)}),[])).length?[""]:t))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let e=!1;do{if(e=!1,!this.preserveMultipleSlashes){for(let s=1;s<t.length-1;s++){const i=t[s];1===s&&""===i&&""===t[0]||("."!==i&&""!==i||(e=!0,t.splice(s,1),s--))}"."!==t[0]||2!==t.length||"."!==t[1]&&""!==t[1]||(e=!0,t.pop())}let s=0;for(;-1!==(s=t.indexOf("..",s+1));){const i=t[s-1];i&&"."!==i&&".."!==i&&"**"!==i&&(e=!0,t.splice(s-1,2),s-=2)}}while(e);return 0===t.length?[""]:t}firstPhasePreProcess(t){let e=!1;do{e=!1;for(let s of t){let i=-1;for(;-1!==(i=s.indexOf("**",i+1));){let r=i;for(;"**"===s[r+1];)r++;r>i&&s.splice(i+1,r-i);let n=s[i+1];const h=s[i+2],o=s[i+3];if(".."!==n)continue;if(!h||"."===h||".."===h||!o||"."===o||".."===o)continue;e=!0,s.splice(i,1);const a=s.slice(0);a[i]="**",t.push(a),i--}if(!this.preserveMultipleSlashes){for(let t=1;t<s.length-1;t++){const i=s[t];1===t&&""===i&&""===s[0]||("."!==i&&""!==i||(e=!0,s.splice(t,1),t--))}"."!==s[0]||2!==s.length||"."!==s[1]&&""!==s[1]||(e=!0,s.pop())}let r=0;for(;-1!==(r=s.indexOf("..",r+1));){const t=s[r-1];if(t&&"."!==t&&".."!==t&&"**"!==t){e=!0;const t=1===r&&"**"===s[r+1]?["."]:[];s.splice(r-1,2,...t),0===s.length&&s.push(""),r-=2}}}}while(e);return t}secondPhasePreProcess(t){for(let e=0;e<t.length-1;e++)for(let s=e+1;s<t.length;s++){const i=this.partsMatch(t[e],t[s],!this.preserveMultipleSlashes);if(i){t[e]=[],t[s]=i;break}}return t.filter((t=>t.length))}partsMatch(t,e,s=!1){let i=0,r=0,n=[],h="";for(;i<t.length&&r<e.length;)if(t[i]===e[r])n.push("b"===h?e[r]:t[i]),i++,r++;else if(s&&"**"===t[i]&&e[r]===t[i+1])n.push(t[i]),i++;else if(s&&"**"===e[r]&&t[i]===e[r+1])n.push(e[r]),r++;else if("*"!==t[i]||!e[r]||!this.options.dot&&e[r].startsWith(".")||"**"===e[r]){if("*"!==e[r]||!t[i]||!this.options.dot&&t[i].startsWith(".")||"**"===t[i])return!1;if("a"===h)return!1;h="b",n.push(e[r]),i++,r++}else{if("b"===h)return!1;h="a",n.push(t[i]),i++,r++}return t.length===e.length&&n}parseNegate(){if(this.nonegate)return;const t=this.pattern;let e=!1,s=0;for(let i=0;i<t.length&&"!"===t.charAt(i);i++)e=!e,s++;s&&(this.pattern=t.slice(s)),this.negate=e}matchOne(t,e,s=!1){const i=this.options;if(this.isWindows){const s="string"==typeof t[0]&&/^[a-z]:$/i.test(t[0]),i=!s&&""===t[0]&&""===t[1]&&"?"===t[2]&&/^[a-z]:$/i.test(t[3]),r="string"==typeof e[0]&&/^[a-z]:$/i.test(e[0]),n=i?3:s?0:void 0,h=!r&&""===e[0]&&""===e[1]&&"?"===e[2]&&"string"==typeof e[3]&&/^[a-z]:$/i.test(e[3])?3:r?0:void 0;if("number"==typeof n&&"number"==typeof h){const[s,i]=[t[n],e[h]];s.toLowerCase()===i.toLowerCase()&&(e[h]=s,h>n?e=e.slice(h):n>h&&(t=t.slice(n)))}}const{optimizationLevel:r=1}=this.options;r>=2&&(t=this.levelTwoFileOptimize(t)),this.debug("matchOne",this,{file:t,pattern:e}),this.debug("matchOne",t.length,e.length);for(var n=0,h=0,o=t.length,a=e.length;n<o&&h<a;n++,h++){this.debug("matchOne loop");var l=e[h],c=t[n];if(this.debug(e,l,c),!1===l)return!1;if(l===S){this.debug("GLOBSTAR",[e,l,c]);var p=n,d=h+1;if(d===a){for(this.debug("** at the end");n<o;n++)if("."===t[n]||".."===t[n]||!i.dot&&"."===t[n].charAt(0))return!1;return!0}for(;p<o;){var u=t[p];if(this.debug("\nglobstar while",t,p,e,d,u),this.matchOne(t.slice(p),e.slice(d),s))return this.debug("globstar found match!",p,o,u),!0;if("."===u||".."===u||!i.dot&&"."===u.charAt(0)){this.debug("dot detected!",t,p,e,d);break}this.debug("globstar swallow a segment, and continue"),p++}return!(!s||(this.debug("\n>>> no match, partial?",t,p,e,d),p!==o))}let r;if("string"==typeof l?(r=c===l,this.debug("string match",l,c,r)):(r=l.test(c),this.debug("pattern match",l,c,r)),!r)return!1}if(n===o&&h===a)return!0;if(n===o)return s;if(h===a)return n===o-1&&""===t[n];throw new Error("wtf?")}braceExpand(){return braceExpand(this.pattern,this.options)}parse(t){assertValidPattern(t);const e=this.options;if("**"===t)return S;if(""===t)return"";let s,i=null;(s=t.match(m))?i=e.dot?starTestDot:starTest:(s=t.match(u))?i=(e.nocase?e.dot?starDotExtTestNocaseDot:starDotExtTestNocase:e.dot?starDotExtTestDot:starDotExtTest)(s[1]):(s=t.match(w))?i=(e.nocase?e.dot?qmarksTestNocaseDot:qmarksTestNocase:e.dot?qmarksTestDot:qmarksTest)(s):(s=t.match(f))?i=e.dot?starDotStarTestDot:starDotStarTest:(s=t.match(g))&&(i=dotStarTest);const r=AST.fromGlob(t,this.options).toMMPattern();return i&&"object"==typeof r&&Reflect.defineProperty(r,"test",{value:i}),r}makeRe(){if(this.regexp||!1===this.regexp)return this.regexp;const t=this.set;if(!t.length)return this.regexp=!1,this.regexp;const e=this.options,s=e.noglobstar?"[^/]*?":e.dot?"(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?":"(?:(?!(?:\\/|^)\\.).)*?",i=new Set(e.nocase?["i"]:[]);let r=t.map((t=>{const e=t.map((t=>{if(t instanceof RegExp)for(const e of t.flags.split(""))i.add(e);return"string"==typeof t?t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"):t===S?S:t._src}));return e.forEach(((t,i)=>{const r=e[i+1],n=e[i-1];t===S&&n!==S&&(void 0===n?void 0!==r&&r!==S?e[i+1]="(?:\\/|"+s+"\\/)?"+r:e[i]=s:void 0===r?e[i-1]=n+"(?:\\/|"+s+")?":r!==S&&(e[i-1]=n+"(?:\\/|\\/"+s+"\\/)"+r,e[i+1]=S))})),e.filter((t=>t!==S)).join("/")})).join("|");const[n,h]=t.length>1?["(?:",")"]:["",""];r="^"+n+r+h+"$",this.negate&&(r="^(?!"+r+").+$");try{this.regexp=new RegExp(r,[...i].join(""))}catch(t){this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t,e=this.partial){if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return""===t;if("/"===t&&e)return!0;const s=this.options;this.isWindows&&(t=t.split("\\").join("/"));const i=this.slashSplit(t);this.debug(this.pattern,"split",i);const r=this.set;this.debug(this.pattern,"set",r);let n=i[i.length-1];if(!n)for(let t=i.length-2;!n&&t>=0;t--)n=i[t];for(let t=0;t<r.length;t++){const h=r[t];let o=i;s.matchBase&&1===h.length&&(o=[n]);if(this.matchOne(o,h,e))return!!s.flipNegate||!this.negate}return!s.flipNegate&&this.negate}static defaults(t){return minimatch.defaults(t).Minimatch}}minimatch.AST=AST,minimatch.Minimatch=Minimatch,minimatch.escape=escape_escape,minimatch.unescape=unescape_unescape;var v=s(73136);const k="object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date,x=new Set,C="object"==typeof process&&process?process:{},emitWarning=(t,e,s,i)=>{"function"==typeof C.emitWarning?C.emitWarning(t,e,s,i):console.error(`[${s}] ${e}: ${t}`)};let T=globalThis.AbortController,A=globalThis.AbortSignal;if(void 0===T){A=class AbortSignal{onabort;_onabort=[];reason;aborted=!1;addEventListener(t,e){this._onabort.push(e)}},T=class AbortController{constructor(){warnACPolyfill()}signal=new A;abort(t){if(!this.signal.aborted){this.signal.reason=t,this.signal.aborted=!0;for(const e of this.signal._onabort)e(t);this.signal.onabort?.(t)}}};let t="1"!==C.env?.LRU_CACHE_IGNORE_AC_WARNING;const warnACPolyfill=()=>{t&&(t=!1,emitWarning("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",warnACPolyfill))}}Symbol("type");const isPosInt=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),getUintArray=t=>isPosInt(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?ZeroArray:null:null;class ZeroArray extends Array{constructor(t){super(t),this.fill(0)}}class Stack{heap;length;static#g=!1;static create(t){const e=getUintArray(t);if(!e)return[];Stack.#g=!0;const s=new Stack(t,e);return Stack.#g=!1,s}constructor(t,e){if(!Stack.#g)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new e(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}}class LRUCache{#m;#w;#y;#S;#b;#v;#k;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#x;#C;#T;#A;#L;#E;#F;#M;#P;#R;#z;#O;#D;#N;#W;#_;#I;#B;static unsafeExposeInternals(t){return{starts:t.#D,ttls:t.#N,sizes:t.#O,keyMap:t.#T,keyList:t.#A,valList:t.#L,next:t.#E,prev:t.#F,get head(){return t.#M},get tail(){return t.#P},free:t.#R,isBackgroundFetch:e=>t.#G(e),backgroundFetch:(e,s,i,r)=>t.#U(e,s,i,r),moveToTail:e=>t.#j(e),indexes:e=>t.#$(e),rindexes:e=>t.#H(e),isStale:e=>t.#q(e)}}get max(){return this.#m}get maxSize(){return this.#w}get calculatedSize(){return this.#C}get size(){return this.#x}get fetchMethod(){return this.#v}get memoMethod(){return this.#k}get dispose(){return this.#y}get onInsert(){return this.#S}get disposeAfter(){return this.#b}constructor(t){const{max:e=0,ttl:s,ttlResolution:i=1,ttlAutopurge:r,updateAgeOnGet:n,updateAgeOnHas:h,allowStale:o,dispose:a,onInsert:l,disposeAfter:c,noDisposeOnSet:p,noUpdateTTL:d,maxSize:u=0,maxEntrySize:f=0,sizeCalculation:g,fetchMethod:m,memoMethod:w,noDeleteOnFetchRejection:y,noDeleteOnStaleGet:S,allowStaleOnFetchRejection:b,allowStaleOnFetchAbort:v,ignoreFetchAbort:k}=t;if(0!==e&&!isPosInt(e))throw new TypeError("max option must be a nonnegative integer");const C=e?getUintArray(e):Array;if(!C)throw new Error("invalid max value: "+e);if(this.#m=e,this.#w=u,this.maxEntrySize=f||this.#w,this.sizeCalculation=g,this.sizeCalculation){if(!this.#w&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if("function"!=typeof this.sizeCalculation)throw new TypeError("sizeCalculation set to non-function")}if(void 0!==w&&"function"!=typeof w)throw new TypeError("memoMethod must be a function if defined");if(this.#k=w,void 0!==m&&"function"!=typeof m)throw new TypeError("fetchMethod must be a function if specified");if(this.#v=m,this.#_=!!m,this.#T=new Map,this.#A=new Array(e).fill(void 0),this.#L=new Array(e).fill(void 0),this.#E=new C(e),this.#F=new C(e),this.#M=0,this.#P=0,this.#R=Stack.create(e),this.#x=0,this.#C=0,"function"==typeof a&&(this.#y=a),"function"==typeof l&&(this.#S=l),"function"==typeof c?(this.#b=c,this.#z=[]):(this.#b=void 0,this.#z=void 0),this.#W=!!this.#y,this.#B=!!this.#S,this.#I=!!this.#b,this.noDisposeOnSet=!!p,this.noUpdateTTL=!!d,this.noDeleteOnFetchRejection=!!y,this.allowStaleOnFetchRejection=!!b,this.allowStaleOnFetchAbort=!!v,this.ignoreFetchAbort=!!k,0!==this.maxEntrySize){if(0!==this.#w&&!isPosInt(this.#w))throw new TypeError("maxSize must be a positive integer if specified");if(!isPosInt(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#Z()}if(this.allowStale=!!o,this.noDeleteOnStaleGet=!!S,this.updateAgeOnGet=!!n,this.updateAgeOnHas=!!h,this.ttlResolution=isPosInt(i)||0===i?i:1,this.ttlAutopurge=!!r,this.ttl=s||0,this.ttl){if(!isPosInt(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#V()}if(0===this.#m&&0===this.ttl&&0===this.#w)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#m&&!this.#w){const t="LRU_CACHE_UNBOUNDED";if((t=>!x.has(t))(t)){x.add(t);emitWarning("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",t,LRUCache)}}}getRemainingTTL(t){return this.#T.has(t)?1/0:0}#V(){const t=new ZeroArray(this.#m),e=new ZeroArray(this.#m);this.#N=t,this.#D=e,this.#J=(s,i,r=k.now())=>{if(e[s]=0!==i?r:0,t[s]=i,0!==i&&this.ttlAutopurge){const t=setTimeout((()=>{this.#q(s)&&this.#K(this.#A[s],"expire")}),i+1);t.unref&&t.unref()}},this.#X=s=>{e[s]=0!==t[s]?k.now():0},this.#Y=(i,r)=>{if(t[r]){const n=t[r],h=e[r];if(!n||!h)return;i.ttl=n,i.start=h,i.now=s||getNow();const o=i.now-h;i.remainingTTL=n-o}};let s=0;const getNow=()=>{const t=k.now();if(this.ttlResolution>0){s=t;const e=setTimeout((()=>s=0),this.ttlResolution);e.unref&&e.unref()}return t};this.getRemainingTTL=i=>{const r=this.#T.get(i);if(void 0===r)return 0;const n=t[r],h=e[r];if(!n||!h)return 1/0;return n-((s||getNow())-h)},this.#q=i=>{const r=e[i],n=t[i];return!!n&&!!r&&(s||getNow())-r>n}}#X=()=>{};#Y=()=>{};#J=()=>{};#q=()=>!1;#Z(){const t=new ZeroArray(this.#m);this.#C=0,this.#O=t,this.#Q=e=>{this.#C-=t[e],t[e]=0},this.#tt=(t,e,s,i)=>{if(this.#G(e))return 0;if(!isPosInt(s)){if(!i)throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");if("function"!=typeof i)throw new TypeError("sizeCalculation must be a function");if(s=i(e,t),!isPosInt(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}return s},this.#et=(e,s,i)=>{if(t[e]=s,this.#w){const s=this.#w-t[e];for(;this.#C>s;)this.#st(!0)}this.#C+=t[e],i&&(i.entrySize=s,i.totalCalculatedSize=this.#C)}}#Q=t=>{};#et=(t,e,s)=>{};#tt=(t,e,s,i)=>{if(s||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#$({allowStale:t=this.allowStale}={}){if(this.#x)for(let e=this.#P;this.#it(e)&&(!t&&this.#q(e)||(yield e),e!==this.#M);)e=this.#F[e]}*#H({allowStale:t=this.allowStale}={}){if(this.#x)for(let e=this.#M;this.#it(e)&&(!t&&this.#q(e)||(yield e),e!==this.#P);)e=this.#E[e]}#it(t){return void 0!==t&&this.#T.get(this.#A[t])===t}*entries(){for(const t of this.#$())void 0===this.#L[t]||void 0===this.#A[t]||this.#G(this.#L[t])||(yield[this.#A[t],this.#L[t]])}*rentries(){for(const t of this.#H())void 0===this.#L[t]||void 0===this.#A[t]||this.#G(this.#L[t])||(yield[this.#A[t],this.#L[t]])}*keys(){for(const t of this.#$()){const e=this.#A[t];void 0===e||this.#G(this.#L[t])||(yield e)}}*rkeys(){for(const t of this.#H()){const e=this.#A[t];void 0===e||this.#G(this.#L[t])||(yield e)}}*values(){for(const t of this.#$()){void 0===this.#L[t]||this.#G(this.#L[t])||(yield this.#L[t])}}*rvalues(){for(const t of this.#H()){void 0===this.#L[t]||this.#G(this.#L[t])||(yield this.#L[t])}}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(t,e={}){for(const s of this.#$()){const i=this.#L[s],r=this.#G(i)?i.__staleWhileFetching:i;if(void 0!==r&&t(r,this.#A[s],this))return this.get(this.#A[s],e)}}forEach(t,e=this){for(const s of this.#$()){const i=this.#L[s],r=this.#G(i)?i.__staleWhileFetching:i;void 0!==r&&t.call(e,r,this.#A[s],this)}}rforEach(t,e=this){for(const s of this.#H()){const i=this.#L[s],r=this.#G(i)?i.__staleWhileFetching:i;void 0!==r&&t.call(e,r,this.#A[s],this)}}purgeStale(){let t=!1;for(const e of this.#H({allowStale:!0}))this.#q(e)&&(this.#K(this.#A[e],"expire"),t=!0);return t}info(t){const e=this.#T.get(t);if(void 0===e)return;const s=this.#L[e],i=this.#G(s)?s.__staleWhileFetching:s;if(void 0===i)return;const r={value:i};if(this.#N&&this.#D){const t=this.#N[e],s=this.#D[e];if(t&&s){const e=t-(k.now()-s);r.ttl=e,r.start=Date.now()}}return this.#O&&(r.size=this.#O[e]),r}dump(){const t=[];for(const e of this.#$({allowStale:!0})){const s=this.#A[e],i=this.#L[e],r=this.#G(i)?i.__staleWhileFetching:i;if(void 0===r||void 0===s)continue;const n={value:r};if(this.#N&&this.#D){n.ttl=this.#N[e];const t=k.now()-this.#D[e];n.start=Math.floor(Date.now()-t)}this.#O&&(n.size=this.#O[e]),t.unshift([s,n])}return t}load(t){this.clear();for(const[e,s]of t){if(s.start){const t=Date.now()-s.start;s.start=k.now()-t}this.set(e,s.value,s)}}set(t,e,s={}){if(void 0===e)return this.delete(t),this;const{ttl:i=this.ttl,start:r,noDisposeOnSet:n=this.noDisposeOnSet,sizeCalculation:h=this.sizeCalculation,status:o}=s;let{noUpdateTTL:a=this.noUpdateTTL}=s;const l=this.#tt(t,e,s.size||0,h);if(this.maxEntrySize&&l>this.maxEntrySize)return o&&(o.set="miss",o.maxEntrySizeExceeded=!0),this.#K(t,"set"),this;let c=0===this.#x?void 0:this.#T.get(t);if(void 0===c)c=0===this.#x?this.#P:0!==this.#R.length?this.#R.pop():this.#x===this.#m?this.#st(!1):this.#x,this.#A[c]=t,this.#L[c]=e,this.#T.set(t,c),this.#E[this.#P]=c,this.#F[c]=this.#P,this.#P=c,this.#x++,this.#et(c,l,o),o&&(o.set="add"),a=!1,this.#B&&this.#S?.(e,t,"add");else{this.#j(c);const s=this.#L[c];if(e!==s){if(this.#_&&this.#G(s)){s.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:e}=s;void 0===e||n||(this.#W&&this.#y?.(e,t,"set"),this.#I&&this.#z?.push([e,t,"set"]))}else n||(this.#W&&this.#y?.(s,t,"set"),this.#I&&this.#z?.push([s,t,"set"]));if(this.#Q(c),this.#et(c,l,o),this.#L[c]=e,o){o.set="replace";const t=s&&this.#G(s)?s.__staleWhileFetching:s;void 0!==t&&(o.oldValue=t)}}else o&&(o.set="update");this.#B&&this.onInsert?.(e,t,e===s?"update":"replace")}if(0===i||this.#N||this.#V(),this.#N&&(a||this.#J(c,i,r),o&&this.#Y(o,c)),!n&&this.#I&&this.#z){const t=this.#z;let e;for(;e=t?.shift();)this.#b?.(...e)}return this}pop(){try{for(;this.#x;){const t=this.#L[this.#M];if(this.#st(!0),this.#G(t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(void 0!==t)return t}}finally{if(this.#I&&this.#z){const t=this.#z;let e;for(;e=t?.shift();)this.#b?.(...e)}}}#st(t){const e=this.#M,s=this.#A[e],i=this.#L[e];return this.#_&&this.#G(i)?i.__abortController.abort(new Error("evicted")):(this.#W||this.#I)&&(this.#W&&this.#y?.(i,s,"evict"),this.#I&&this.#z?.push([i,s,"evict"])),this.#Q(e),t&&(this.#A[e]=void 0,this.#L[e]=void 0,this.#R.push(e)),1===this.#x?(this.#M=this.#P=0,this.#R.length=0):this.#M=this.#E[e],this.#T.delete(s),this.#x--,e}has(t,e={}){const{updateAgeOnHas:s=this.updateAgeOnHas,status:i}=e,r=this.#T.get(t);if(void 0!==r){const t=this.#L[r];if(this.#G(t)&&void 0===t.__staleWhileFetching)return!1;if(!this.#q(r))return s&&this.#X(r),i&&(i.has="hit",this.#Y(i,r)),!0;i&&(i.has="stale",this.#Y(i,r))}else i&&(i.has="miss");return!1}peek(t,e={}){const{allowStale:s=this.allowStale}=e,i=this.#T.get(t);if(void 0===i||!s&&this.#q(i))return;const r=this.#L[i];return this.#G(r)?r.__staleWhileFetching:r}#U(t,e,s,i){const r=void 0===e?void 0:this.#L[e];if(this.#G(r))return r;const n=new T,{signal:h}=s;h?.addEventListener("abort",(()=>n.abort(h.reason)),{signal:n.signal});const o={signal:n.signal,options:s,context:i},cb=(i,r=!1)=>{const{aborted:h}=n.signal,l=s.ignoreFetchAbort&&void 0!==i;if(s.status&&(h&&!r?(s.status.fetchAborted=!0,s.status.fetchError=n.signal.reason,l&&(s.status.fetchAbortIgnored=!0)):s.status.fetchResolved=!0),h&&!l&&!r)return fetchFail(n.signal.reason);const c=a;return this.#L[e]===a&&(void 0===i?c.__staleWhileFetching?this.#L[e]=c.__staleWhileFetching:this.#K(t,"fetch"):(s.status&&(s.status.fetchUpdated=!0),this.set(t,i,o.options))),i},fetchFail=i=>{const{aborted:r}=n.signal,h=r&&s.allowStaleOnFetchAbort,o=h||s.allowStaleOnFetchRejection,l=o||s.noDeleteOnFetchRejection,c=a;if(this.#L[e]===a){!l||void 0===c.__staleWhileFetching?this.#K(t,"fetch"):h||(this.#L[e]=c.__staleWhileFetching)}if(o)return s.status&&void 0!==c.__staleWhileFetching&&(s.status.returnedStale=!0),c.__staleWhileFetching;if(c.__returned===c)throw i};s.status&&(s.status.fetchDispatched=!0);const a=new Promise(((e,i)=>{const h=this.#v?.(t,r,o);h&&h instanceof Promise&&h.then((t=>e(void 0===t?void 0:t)),i),n.signal.addEventListener("abort",(()=>{s.ignoreFetchAbort&&!s.allowStaleOnFetchAbort||(e(void 0),s.allowStaleOnFetchAbort&&(e=t=>cb(t,!0)))}))})).then(cb,(t=>(s.status&&(s.status.fetchRejected=!0,s.status.fetchError=t),fetchFail(t)))),l=Object.assign(a,{__abortController:n,__staleWhileFetching:r,__returned:void 0});return void 0===e?(this.set(t,l,{...o.options,status:void 0}),e=this.#T.get(t)):this.#L[e]=l,l}#G(t){if(!this.#_)return!1;const e=t;return!!e&&e instanceof Promise&&e.hasOwnProperty("__staleWhileFetching")&&e.__abortController instanceof T}async fetch(t,e={}){const{allowStale:s=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,ttl:n=this.ttl,noDisposeOnSet:h=this.noDisposeOnSet,size:o=0,sizeCalculation:a=this.sizeCalculation,noUpdateTTL:l=this.noUpdateTTL,noDeleteOnFetchRejection:c=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:p=this.allowStaleOnFetchRejection,ignoreFetchAbort:d=this.ignoreFetchAbort,allowStaleOnFetchAbort:u=this.allowStaleOnFetchAbort,context:f,forceRefresh:g=!1,status:m,signal:w}=e;if(!this.#_)return m&&(m.fetch="get"),this.get(t,{allowStale:s,updateAgeOnGet:i,noDeleteOnStaleGet:r,status:m});const y={allowStale:s,updateAgeOnGet:i,noDeleteOnStaleGet:r,ttl:n,noDisposeOnSet:h,size:o,sizeCalculation:a,noUpdateTTL:l,noDeleteOnFetchRejection:c,allowStaleOnFetchRejection:p,allowStaleOnFetchAbort:u,ignoreFetchAbort:d,status:m,signal:w};let S=this.#T.get(t);if(void 0===S){m&&(m.fetch="miss");const e=this.#U(t,S,y,f);return e.__returned=e}{const e=this.#L[S];if(this.#G(e)){const t=s&&void 0!==e.__staleWhileFetching;return m&&(m.fetch="inflight",t&&(m.returnedStale=!0)),t?e.__staleWhileFetching:e.__returned=e}const r=this.#q(S);if(!g&&!r)return m&&(m.fetch="hit"),this.#j(S),i&&this.#X(S),m&&this.#Y(m,S),e;const n=this.#U(t,S,y,f),h=void 0!==n.__staleWhileFetching&&s;return m&&(m.fetch=r?"stale":"refresh",h&&r&&(m.returnedStale=!0)),h?n.__staleWhileFetching:n.__returned=n}}async forceFetch(t,e={}){const s=await this.fetch(t,e);if(void 0===s)throw new Error("fetch() returned undefined");return s}memo(t,e={}){const s=this.#k;if(!s)throw new Error("no memoMethod provided to constructor");const{context:i,forceRefresh:r,...n}=e,h=this.get(t,n);if(!r&&void 0!==h)return h;const o=s(t,h,{options:n,context:i});return this.set(t,o,n),o}get(t,e={}){const{allowStale:s=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,status:n}=e,h=this.#T.get(t);if(void 0!==h){const e=this.#L[h],o=this.#G(e);return n&&this.#Y(n,h),this.#q(h)?(n&&(n.get="stale"),o?(n&&s&&void 0!==e.__staleWhileFetching&&(n.returnedStale=!0),s?e.__staleWhileFetching:void 0):(r||this.#K(t,"expire"),n&&s&&(n.returnedStale=!0),s?e:void 0)):(n&&(n.get="hit"),o?e.__staleWhileFetching:(this.#j(h),i&&this.#X(h),e))}n&&(n.get="miss")}#rt(t,e){this.#F[e]=t,this.#E[t]=e}#j(t){t!==this.#P&&(t===this.#M?this.#M=this.#E[t]:this.#rt(this.#F[t],this.#E[t]),this.#rt(this.#P,t),this.#P=t)}delete(t){return this.#K(t,"delete")}#K(t,e){let s=!1;if(0!==this.#x){const i=this.#T.get(t);if(void 0!==i)if(s=!0,1===this.#x)this.#nt(e);else{this.#Q(i);const s=this.#L[i];if(this.#G(s)?s.__abortController.abort(new Error("deleted")):(this.#W||this.#I)&&(this.#W&&this.#y?.(s,t,e),this.#I&&this.#z?.push([s,t,e])),this.#T.delete(t),this.#A[i]=void 0,this.#L[i]=void 0,i===this.#P)this.#P=this.#F[i];else if(i===this.#M)this.#M=this.#E[i];else{const t=this.#F[i];this.#E[t]=this.#E[i];const e=this.#E[i];this.#F[e]=this.#F[i]}this.#x--,this.#R.push(i)}}if(this.#I&&this.#z?.length){const t=this.#z;let e;for(;e=t?.shift();)this.#b?.(...e)}return s}clear(){return this.#nt("delete")}#nt(t){for(const e of this.#H({allowStale:!0})){const s=this.#L[e];if(this.#G(s))s.__abortController.abort(new Error("deleted"));else{const i=this.#A[e];this.#W&&this.#y?.(s,i,t),this.#I&&this.#z?.push([s,i,t])}}if(this.#T.clear(),this.#L.fill(void 0),this.#A.fill(void 0),this.#N&&this.#D&&(this.#N.fill(0),this.#D.fill(0)),this.#O&&this.#O.fill(0),this.#M=0,this.#P=0,this.#R.length=0,this.#C=0,this.#x=0,this.#I&&this.#z){const t=this.#z;let e;for(;e=t?.shift();)this.#b?.(...e)}}}var L=s(76760),E=s(79896),F=s(73024),M=s.t(F,2),P=s(51455),R=s(26022);const z=E.realpathSync.native,O={lstatSync:E.lstatSync,readdir:E.readdir,readdirSync:E.readdirSync,readlinkSync:E.readlinkSync,realpathSync:z,promises:{lstat:P.lstat,readdir:P.readdir,readlink:P.readlink,realpath:P.realpath}},fsFromOption=t=>t&&t!==O&&t!==M?{...O,...t,promises:{...O.promises,...t.promises||{}}}:O,D=/^\\\\\?\\([a-z]:)\\?$/i,N=/[\\\/]/,W=10,_=15,I=-16,B=128,G=256,U=512,entToType=t=>t.isFile()?8:t.isDirectory()?4:t.isSymbolicLink()?W:t.isCharacterDevice()?2:t.isBlockDevice()?6:t.isSocket()?12:t.isFIFO()?1:0,j=new Map,normalize=t=>{const e=j.get(t);if(e)return e;const s=t.normalize("NFKD");return j.set(t,s),s},$=new Map,normalizeNocase=t=>{const e=$.get(t);if(e)return e;const s=normalize(t.toLowerCase());return $.set(t,s),s};class ResolveCache extends LRUCache{constructor(){super({max:256})}}class ChildrenCache extends LRUCache{constructor(t=16384){super({maxSize:t,sizeCalculation:t=>t.length+1})}}const H=Symbol("PathScurry setAsCwd");class PathBase{name;root;roots;parent;nocase;isCWD=!1;#ht;#ot;get dev(){return this.#ot}#at;get mode(){return this.#at}#lt;get nlink(){return this.#lt}#ct;get uid(){return this.#ct}#pt;get gid(){return this.#pt}#dt;get rdev(){return this.#dt}#ut;get blksize(){return this.#ut}#ft;get ino(){return this.#ft}#x;get size(){return this.#x}#gt;get blocks(){return this.#gt}#mt;get atimeMs(){return this.#mt}#wt;get mtimeMs(){return this.#wt}#yt;get ctimeMs(){return this.#yt}#St;get birthtimeMs(){return this.#St}#bt;get atime(){return this.#bt}#vt;get mtime(){return this.#vt}#kt;get ctime(){return this.#kt}#xt;get birthtime(){return this.#xt}#Ct;#Tt;#At;#Lt;#Et;#Ft;#Mt;#Pt;#Rt;#zt;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(t,e=0,s,i,r,n,h){this.name=t,this.#Ct=r?normalizeNocase(t):normalize(t),this.#Mt=1023&e,this.nocase=r,this.roots=i,this.root=s||this,this.#Pt=n,this.#At=h.fullpath,this.#Et=h.relative,this.#Ft=h.relativePosix,this.parent=h.parent,this.parent?this.#ht=this.parent.#ht:this.#ht=fsFromOption(h.fs)}depth(){return void 0!==this.#Tt?this.#Tt:this.parent?this.#Tt=this.parent.depth()+1:this.#Tt=0}childrenCache(){return this.#Pt}resolve(t){if(!t)return this;const e=this.getRootString(t),s=t.substring(e.length).split(this.splitSep);return e?this.getRoot(e).#Ot(s):this.#Ot(s)}#Ot(t){let e=this;for(const s of t)e=e.child(s);return e}children(){const t=this.#Pt.get(this);if(t)return t;const e=Object.assign([],{provisional:0});return this.#Pt.set(this,e),this.#Mt&=-17,e}child(t,e){if(""===t||"."===t)return this;if(".."===t)return this.parent||this;const s=this.children(),i=this.nocase?normalizeNocase(t):normalize(t);for(const t of s)if(t.#Ct===i)return t;const r=this.parent?this.sep:"",n=this.#At?this.#At+r+t:void 0,h=this.newChild(t,0,{...e,parent:this,fullpath:n});return this.canReaddir()||(h.#Mt|=B),s.push(h),h}relative(){if(this.isCWD)return"";if(void 0!==this.#Et)return this.#Et;const t=this.name,e=this.parent;if(!e)return this.#Et=this.name;const s=e.relative();return s+(s&&e.parent?this.sep:"")+t}relativePosix(){if("/"===this.sep)return this.relative();if(this.isCWD)return"";if(void 0!==this.#Ft)return this.#Ft;const t=this.name,e=this.parent;if(!e)return this.#Ft=this.fullpathPosix();const s=e.relativePosix();return s+(s&&e.parent?"/":"")+t}fullpath(){if(void 0!==this.#At)return this.#At;const t=this.name,e=this.parent;if(!e)return this.#At=this.name;const s=e.fullpath()+(e.parent?this.sep:"")+t;return this.#At=s}fullpathPosix(){if(void 0!==this.#Lt)return this.#Lt;if("/"===this.sep)return this.#Lt=this.fullpath();if(!this.parent){const t=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(t)?this.#Lt=`//?/${t}`:this.#Lt=t}const t=this.parent,e=t.fullpathPosix(),s=e+(e&&t.parent?"/":"")+this.name;return this.#Lt=s}isUnknown(){return!(this.#Mt&_)}isType(t){return this[`is${t}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return 8==(this.#Mt&_)}isDirectory(){return 4==(this.#Mt&_)}isCharacterDevice(){return 2==(this.#Mt&_)}isBlockDevice(){return 6==(this.#Mt&_)}isFIFO(){return 1==(this.#Mt&_)}isSocket(){return 12==(this.#Mt&_)}isSymbolicLink(){return(this.#Mt&W)===W}lstatCached(){return 32&this.#Mt?this:void 0}readlinkCached(){return this.#Rt}realpathCached(){return this.#zt}readdirCached(){const t=this.children();return t.slice(0,t.provisional)}canReadlink(){if(this.#Rt)return!0;if(!this.parent)return!1;const t=this.#Mt&_;return!(0!==t&&t!==W||this.#Mt&G||this.#Mt&B)}calledReaddir(){return!!(16&this.#Mt)}isENOENT(){return!!(this.#Mt&B)}isNamed(t){return this.nocase?this.#Ct===normalizeNocase(t):this.#Ct===normalize(t)}async readlink(){const t=this.#Rt;if(t)return t;if(this.canReadlink()&&this.parent)try{const t=await this.#ht.promises.readlink(this.fullpath()),e=(await this.parent.realpath())?.resolve(t);if(e)return this.#Rt=e}catch(t){return void this.#Dt(t.code)}}readlinkSync(){const t=this.#Rt;if(t)return t;if(this.canReadlink()&&this.parent)try{const t=this.#ht.readlinkSync(this.fullpath()),e=this.parent.realpathSync()?.resolve(t);if(e)return this.#Rt=e}catch(t){return void this.#Dt(t.code)}}#Nt(t){this.#Mt|=16;for(let e=t.provisional;e<t.length;e++){const s=t[e];s&&s.#Wt()}}#Wt(){this.#Mt&B||(this.#Mt=(this.#Mt|B)&I,this.#_t())}#_t(){const t=this.children();t.provisional=0;for(const e of t)e.#Wt()}#It(){this.#Mt|=U,this.#Bt()}#Bt(){if(64&this.#Mt)return;let t=this.#Mt;4==(t&_)&&(t&=I),this.#Mt=64|t,this.#_t()}#Gt(t=""){"ENOTDIR"===t||"EPERM"===t?this.#Bt():"ENOENT"===t?this.#Wt():this.children().provisional=0}#Ut(t=""){if("ENOTDIR"===t){this.parent.#Bt()}else"ENOENT"===t&&this.#Wt()}#Dt(t=""){let e=this.#Mt;e|=G,"ENOENT"===t&&(e|=B),"EINVAL"!==t&&"UNKNOWN"!==t||(e&=I),this.#Mt=e,"ENOTDIR"===t&&this.parent&&this.parent.#Bt()}#jt(t,e){return this.#$t(t,e)||this.#Ht(t,e)}#Ht(t,e){const s=entToType(t),i=this.newChild(t.name,s,{parent:this}),r=i.#Mt&_;return 4!==r&&r!==W&&0!==r&&(i.#Mt|=64),e.unshift(i),e.provisional++,i}#$t(t,e){for(let s=e.provisional;s<e.length;s++){const i=e[s];if((this.nocase?normalizeNocase(t.name):normalize(t.name))===i.#Ct)return this.#qt(t,i,s,e)}}#qt(t,e,s,i){const r=e.name;return e.#Mt=e.#Mt&I|entToType(t),r!==t.name&&(e.name=t.name),s!==i.provisional&&(s===i.length-1?i.pop():i.splice(s,1),i.unshift(e)),i.provisional++,e}async lstat(){if(!(this.#Mt&B))try{return this.#Zt(await this.#ht.promises.lstat(this.fullpath())),this}catch(t){this.#Ut(t.code)}}lstatSync(){if(!(this.#Mt&B))try{return this.#Zt(this.#ht.lstatSync(this.fullpath())),this}catch(t){this.#Ut(t.code)}}#Zt(t){const{atime:e,atimeMs:s,birthtime:i,birthtimeMs:r,blksize:n,blocks:h,ctime:o,ctimeMs:a,dev:l,gid:c,ino:p,mode:d,mtime:u,mtimeMs:f,nlink:g,rdev:m,size:w,uid:y}=t;this.#bt=e,this.#mt=s,this.#xt=i,this.#St=r,this.#ut=n,this.#gt=h,this.#kt=o,this.#yt=a,this.#ot=l,this.#pt=c,this.#ft=p,this.#at=d,this.#vt=u,this.#wt=f,this.#lt=g,this.#dt=m,this.#x=w,this.#ct=y;const S=entToType(t);this.#Mt=this.#Mt&I|S|32,0!==S&&4!==S&&S!==W&&(this.#Mt|=64)}#Vt=[];#Jt=!1;#Kt(t){this.#Jt=!1;const e=this.#Vt.slice();this.#Vt.length=0,e.forEach((e=>e(null,t)))}readdirCB(t,e=!1){if(!this.canReaddir())return void(e?t(null,[]):queueMicrotask((()=>t(null,[]))));const s=this.children();if(this.calledReaddir()){const i=s.slice(0,s.provisional);return void(e?t(null,i):queueMicrotask((()=>t(null,i))))}if(this.#Vt.push(t),this.#Jt)return;this.#Jt=!0;const i=this.fullpath();this.#ht.readdir(i,{withFileTypes:!0},((t,e)=>{if(t)this.#Gt(t.code),s.provisional=0;else{for(const t of e)this.#jt(t,s);this.#Nt(s)}this.#Kt(s.slice(0,s.provisional))}))}#Xt;async readdir(){if(!this.canReaddir())return[];const t=this.children();if(this.calledReaddir())return t.slice(0,t.provisional);const e=this.fullpath();if(this.#Xt)await this.#Xt;else{let resolve=()=>{};this.#Xt=new Promise((t=>resolve=t));try{for(const s of await this.#ht.promises.readdir(e,{withFileTypes:!0}))this.#jt(s,t);this.#Nt(t)}catch(e){this.#Gt(e.code),t.provisional=0}this.#Xt=void 0,resolve()}return t.slice(0,t.provisional)}readdirSync(){if(!this.canReaddir())return[];const t=this.children();if(this.calledReaddir())return t.slice(0,t.provisional);const e=this.fullpath();try{for(const s of this.#ht.readdirSync(e,{withFileTypes:!0}))this.#jt(s,t);this.#Nt(t)}catch(e){this.#Gt(e.code),t.provisional=0}return t.slice(0,t.provisional)}canReaddir(){if(704&this.#Mt)return!1;const t=_&this.#Mt;return 0===t||4===t||t===W}shouldWalk(t,e){return!(4&~this.#Mt)&&!(704&this.#Mt)&&!t.has(this)&&(!e||e(this))}async realpath(){if(this.#zt)return this.#zt;if(!(896&this.#Mt))try{const t=await this.#ht.promises.realpath(this.fullpath());return this.#zt=this.resolve(t)}catch(t){this.#It()}}realpathSync(){if(this.#zt)return this.#zt;if(!(896&this.#Mt))try{const t=this.#ht.realpathSync(this.fullpath());return this.#zt=this.resolve(t)}catch(t){this.#It()}}[H](t){if(t===this)return;t.isCWD=!1,this.isCWD=!0;const e=new Set([]);let s=[],i=this;for(;i&&i.parent;)e.add(i),i.#Et=s.join(this.sep),i.#Ft=s.join("/"),i=i.parent,s.push("..");for(i=t;i&&i.parent&&!e.has(i);)i.#Et=void 0,i.#Ft=void 0,i=i.parent}}class PathWin32 extends PathBase{sep="\\";splitSep=N;constructor(t,e=0,s,i,r,n,h){super(t,e,s,i,r,n,h)}newChild(t,e=0,s={}){return new PathWin32(t,e,this.root,this.roots,this.nocase,this.childrenCache(),s)}getRootString(t){return L.win32.parse(t).root}getRoot(t){if((t=(t=>t.replace(/\//g,"\\").replace(D,"$1\\"))(t.toUpperCase()))===this.root.name)return this.root;for(const[e,s]of Object.entries(this.roots))if(this.sameRoot(t,e))return this.roots[t]=s;return this.roots[t]=new PathScurryWin32(t,this).root}sameRoot(t,e=this.root.name){return(t=t.toUpperCase().replace(/\//g,"\\").replace(D,"$1\\"))===e}}class PathPosix extends PathBase{splitSep="/";sep="/";constructor(t,e=0,s,i,r,n,h){super(t,e,s,i,r,n,h)}getRootString(t){return t.startsWith("/")?"/":""}getRoot(t){return this.root}newChild(t,e=0,s={}){return new PathPosix(t,e,this.root,this.roots,this.nocase,this.childrenCache(),s)}}class PathScurryBase{root;rootPath;roots;cwd;#Yt;#Qt;#Pt;nocase;#ht;constructor(t=process.cwd(),e,s,{nocase:i,childrenCacheSize:r=16384,fs:n=O}={}){this.#ht=fsFromOption(n),(t instanceof URL||t.startsWith("file://"))&&(t=(0,v.fileURLToPath)(t));const h=e.resolve(t);this.roots=Object.create(null),this.rootPath=this.parseRootPath(h),this.#Yt=new ResolveCache,this.#Qt=new ResolveCache,this.#Pt=new ChildrenCache(r);const o=h.substring(this.rootPath.length).split(s);if(1!==o.length||o[0]||o.pop(),void 0===i)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=i,this.root=this.newRoot(this.#ht),this.roots[this.rootPath]=this.root;let a=this.root,l=o.length-1;const c=e.sep;let p=this.rootPath,d=!1;for(const t of o){const e=l--;a=a.child(t,{relative:new Array(e).fill("..").join(c),relativePosix:new Array(e).fill("..").join("/"),fullpath:p+=(d?"":c)+t}),d=!0}this.cwd=a}depth(t=this.cwd){return"string"==typeof t&&(t=this.cwd.resolve(t)),t.depth()}childrenCache(){return this.#Pt}resolve(...t){let e="";for(let s=t.length-1;s>=0;s--){const i=t[s];if(i&&"."!==i&&(e=e?`${i}/${e}`:i,this.isAbsolute(i)))break}const s=this.#Yt.get(e);if(void 0!==s)return s;const i=this.cwd.resolve(e).fullpath();return this.#Yt.set(e,i),i}resolvePosix(...t){let e="";for(let s=t.length-1;s>=0;s--){const i=t[s];if(i&&"."!==i&&(e=e?`${i}/${e}`:i,this.isAbsolute(i)))break}const s=this.#Qt.get(e);if(void 0!==s)return s;const i=this.cwd.resolve(e).fullpathPosix();return this.#Qt.set(e,i),i}relative(t=this.cwd){return"string"==typeof t&&(t=this.cwd.resolve(t)),t.relative()}relativePosix(t=this.cwd){return"string"==typeof t&&(t=this.cwd.resolve(t)),t.relativePosix()}basename(t=this.cwd){return"string"==typeof t&&(t=this.cwd.resolve(t)),t.name}dirname(t=this.cwd){return"string"==typeof t&&(t=this.cwd.resolve(t)),(t.parent||t).fullpath()}async readdir(t=this.cwd,e={withFileTypes:!0}){"string"==typeof t?t=this.cwd.resolve(t):t instanceof PathBase||(e=t,t=this.cwd);const{withFileTypes:s}=e;if(t.canReaddir()){const e=await t.readdir();return s?e:e.map((t=>t.name))}return[]}readdirSync(t=this.cwd,e={withFileTypes:!0}){"string"==typeof t?t=this.cwd.resolve(t):t instanceof PathBase||(e=t,t=this.cwd);const{withFileTypes:s=!0}=e;return t.canReaddir()?s?t.readdirSync():t.readdirSync().map((t=>t.name)):[]}async lstat(t=this.cwd){return"string"==typeof t&&(t=this.cwd.resolve(t)),t.lstat()}lstatSync(t=this.cwd){return"string"==typeof t&&(t=this.cwd.resolve(t)),t.lstatSync()}async readlink(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){"string"==typeof t?t=this.cwd.resolve(t):t instanceof PathBase||(e=t.withFileTypes,t=this.cwd);const s=await t.readlink();return e?s:s?.fullpath()}readlinkSync(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){"string"==typeof t?t=this.cwd.resolve(t):t instanceof PathBase||(e=t.withFileTypes,t=this.cwd);const s=t.readlinkSync();return e?s:s?.fullpath()}async realpath(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){"string"==typeof t?t=this.cwd.resolve(t):t instanceof PathBase||(e=t.withFileTypes,t=this.cwd);const s=await t.realpath();return e?s:s?.fullpath()}realpathSync(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){"string"==typeof t?t=this.cwd.resolve(t):t instanceof PathBase||(e=t.withFileTypes,t=this.cwd);const s=t.realpathSync();return e?s:s?.fullpath()}async walk(t=this.cwd,e={}){"string"==typeof t?t=this.cwd.resolve(t):t instanceof PathBase||(e=t,t=this.cwd);const{withFileTypes:s=!0,follow:i=!1,filter:r,walkFilter:n}=e,h=[];r&&!r(t)||h.push(s?t:t.fullpath());const o=new Set,walk=(t,e)=>{o.add(t),t.readdirCB(((t,a)=>{if(t)return e(t);let l=a.length;if(!l)return e();const next=()=>{0==--l&&e()};for(const t of a)r&&!r(t)||h.push(s?t:t.fullpath()),i&&t.isSymbolicLink()?t.realpath().then((t=>t?.isUnknown()?t.lstat():t)).then((t=>t?.shouldWalk(o,n)?walk(t,next):next())):t.shouldWalk(o,n)?walk(t,next):next()}),!0)},a=t;return new Promise(((t,e)=>{walk(a,(s=>{if(s)return e(s);t(h)}))}))}walkSync(t=this.cwd,e={}){"string"==typeof t?t=this.cwd.resolve(t):t instanceof PathBase||(e=t,t=this.cwd);const{withFileTypes:s=!0,follow:i=!1,filter:r,walkFilter:n}=e,h=[];r&&!r(t)||h.push(s?t:t.fullpath());const o=new Set([t]);for(const t of o){const e=t.readdirSync();for(const t of e){r&&!r(t)||h.push(s?t:t.fullpath());let e=t;if(t.isSymbolicLink()){if(!i||!(e=t.realpathSync()))continue;e.isUnknown()&&e.lstatSync()}e.shouldWalk(o,n)&&o.add(e)}}return h}[Symbol.asyncIterator](){return this.iterate()}iterate(t=this.cwd,e={}){return"string"==typeof t?t=this.cwd.resolve(t):t instanceof PathBase||(e=t,t=this.cwd),this.stream(t,e)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(t=this.cwd,e={}){"string"==typeof t?t=this.cwd.resolve(t):t instanceof PathBase||(e=t,t=this.cwd);const{withFileTypes:s=!0,follow:i=!1,filter:r,walkFilter:n}=e;r&&!r(t)||(yield s?t:t.fullpath());const h=new Set([t]);for(const t of h){const e=t.readdirSync();for(const t of e){r&&!r(t)||(yield s?t:t.fullpath());let e=t;if(t.isSymbolicLink()){if(!i||!(e=t.realpathSync()))continue;e.isUnknown()&&e.lstatSync()}e.shouldWalk(h,n)&&h.add(e)}}}stream(t=this.cwd,e={}){"string"==typeof t?t=this.cwd.resolve(t):t instanceof PathBase||(e=t,t=this.cwd);const{withFileTypes:s=!0,follow:i=!1,filter:r,walkFilter:n}=e,h=new R.n_({objectMode:!0});r&&!r(t)||h.write(s?t:t.fullpath());const o=new Set,a=[t];let l=0;const process=()=>{let t=!1;for(;!t;){const e=a.shift();if(!e)return void(0===l&&h.end());l++,o.add(e);const onReaddir=(e,p,d=!1)=>{if(e)return h.emit("error",e);if(i&&!d){const t=[];for(const e of p)e.isSymbolicLink()&&t.push(e.realpath().then((t=>t?.isUnknown()?t.lstat():t)));if(t.length)return void Promise.all(t).then((()=>onReaddir(null,p,!0)))}for(const e of p)!e||r&&!r(e)||h.write(s?e:e.fullpath())||(t=!0);l--;for(const t of p){const e=t.realpathCached()||t;e.shouldWalk(o,n)&&a.push(e)}t&&!h.flowing?h.once("drain",process):c||process()};let c=!0;e.readdirCB(onReaddir,!0),c=!1}};return process(),h}streamSync(t=this.cwd,e={}){"string"==typeof t?t=this.cwd.resolve(t):t instanceof PathBase||(e=t,t=this.cwd);const{withFileTypes:s=!0,follow:i=!1,filter:r,walkFilter:n}=e,h=new R.n_({objectMode:!0}),o=new Set;r&&!r(t)||h.write(s?t:t.fullpath());const a=[t];let l=0;const process=()=>{let t=!1;for(;!t;){const e=a.shift();if(!e)return void(0===l&&h.end());l++,o.add(e);const c=e.readdirSync();for(const e of c)r&&!r(e)||h.write(s?e:e.fullpath())||(t=!0);l--;for(const t of c){let e=t;if(t.isSymbolicLink()){if(!i||!(e=t.realpathSync()))continue;e.isUnknown()&&e.lstatSync()}e.shouldWalk(o,n)&&a.push(e)}}t&&!h.flowing&&h.once("drain",process)};return process(),h}chdir(t=this.cwd){const e=this.cwd;this.cwd="string"==typeof t?this.cwd.resolve(t):t,this.cwd[H](e)}}class PathScurryWin32 extends PathScurryBase{sep="\\";constructor(t=process.cwd(),e={}){const{nocase:s=!0}=e;super(t,L.win32,"\\",{...e,nocase:s}),this.nocase=s;for(let t=this.cwd;t;t=t.parent)t.nocase=this.nocase}parseRootPath(t){return L.win32.parse(t).root.toUpperCase()}newRoot(t){return new PathWin32(this.rootPath,4,void 0,this.roots,this.nocase,this.childrenCache(),{fs:t})}isAbsolute(t){return t.startsWith("/")||t.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(t)}}class PathScurryPosix extends PathScurryBase{sep="/";constructor(t=process.cwd(),e={}){const{nocase:s=!1}=e;super(t,L.posix,"/",{...e,nocase:s}),this.nocase=s}parseRootPath(t){return"/"}newRoot(t){return new PathPosix(this.rootPath,4,void 0,this.roots,this.nocase,this.childrenCache(),{fs:t})}isAbsolute(t){return t.startsWith("/")}}class PathScurryDarwin extends PathScurryPosix{constructor(t=process.cwd(),e={}){const{nocase:s=!0}=e;super(t,{...e,nocase:s})}}process.platform;const q="win32"===process.platform?PathScurryWin32:"darwin"===process.platform?PathScurryDarwin:PathScurryPosix;class Pattern{#te;#ee;#se;length;#ie;#re;#ne;#he;#oe;#ae;#le=!0;constructor(t,e,s,i){if(!(t.length>=1))throw new TypeError("empty pattern list");if(!(e.length>=1))throw new TypeError("empty glob list");if(e.length!==t.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=t.length,s<0||s>=this.length)throw new TypeError("index out of range");if(this.#te=t,this.#ee=e,this.#se=s,this.#ie=i,0===this.#se)if(this.isUNC()){const[t,e,s,i,...r]=this.#te,[n,h,o,a,...l]=this.#ee;""===r[0]&&(r.shift(),l.shift());const c=[t,e,s,i,""].join("/"),p=[n,h,o,a,""].join("/");this.#te=[c,...r],this.#ee=[p,...l],this.length=this.#te.length}else if(this.isDrive()||this.isAbsolute()){const[t,...e]=this.#te,[s,...i]=this.#ee;""===e[0]&&(e.shift(),i.shift());const r=t+"/",n=s+"/";this.#te=[r,...e],this.#ee=[n,...i],this.length=this.#te.length}}pattern(){return this.#te[this.#se]}isString(){return"string"==typeof this.#te[this.#se]}isGlobstar(){return this.#te[this.#se]===S}isRegExp(){return this.#te[this.#se]instanceof RegExp}globString(){return this.#ne=this.#ne||(0===this.#se?this.isAbsolute()?this.#ee[0]+this.#ee.slice(1).join("/"):this.#ee.join("/"):this.#ee.slice(this.#se).join("/"))}hasMore(){return this.length>this.#se+1}rest(){return void 0!==this.#re?this.#re:this.hasMore()?(this.#re=new Pattern(this.#te,this.#ee,this.#se+1,this.#ie),this.#re.#ae=this.#ae,this.#re.#oe=this.#oe,this.#re.#he=this.#he,this.#re):this.#re=null}isUNC(){const t=this.#te;return void 0!==this.#oe?this.#oe:this.#oe="win32"===this.#ie&&0===this.#se&&""===t[0]&&""===t[1]&&"string"==typeof t[2]&&!!t[2]&&"string"==typeof t[3]&&!!t[3]}isDrive(){const t=this.#te;return void 0!==this.#he?this.#he:this.#he="win32"===this.#ie&&0===this.#se&&this.length>1&&"string"==typeof t[0]&&/^[a-z]:$/i.test(t[0])}isAbsolute(){const t=this.#te;return void 0!==this.#ae?this.#ae:this.#ae=""===t[0]&&t.length>1||this.isDrive()||this.isUNC()}root(){const t=this.#te[0];return"string"==typeof t&&this.isAbsolute()&&0===this.#se?t:""}checkFollowGlobstar(){return!(0===this.#se||!this.isGlobstar()||!this.#le)}markFollowGlobstar(){return!(0===this.#se||!this.isGlobstar()||!this.#le)&&(this.#le=!1,!0)}}const Z="object"==typeof process&&process&&"string"==typeof process.platform?process.platform:"linux";class Ignore{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(t,{nobrace:e,nocase:s,noext:i,noglobstar:r,platform:n=Z}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=n,this.mmopts={dot:!0,nobrace:e,nocase:s,noext:i,noglobstar:r,optimizationLevel:2,platform:n,nocomment:!0,nonegate:!0};for(const e of t)this.add(e)}add(t){const e=new Minimatch(t,this.mmopts);for(let t=0;t<e.set.length;t++){const s=e.set[t],i=e.globParts[t];if(!s||!i)throw new Error("invalid pattern object");for(;"."===s[0]&&"."===i[0];)s.shift(),i.shift();const r=new Pattern(s,i,0,this.platform),n=new Minimatch(r.globString(),this.mmopts),h="**"===i[i.length-1],o=r.isAbsolute();o?this.absolute.push(n):this.relative.push(n),h&&(o?this.absoluteChildren.push(n):this.relativeChildren.push(n))}}ignored(t){const e=t.fullpath(),s=`${e}/`,i=t.relative()||".",r=`${i}/`;for(const t of this.relative)if(t.match(i)||t.match(r))return!0;for(const t of this.absolute)if(t.match(e)||t.match(s))return!0;return!1}childrenIgnored(t){const e=t.fullpath()+"/",s=(t.relative()||".")+"/";for(const t of this.relativeChildren)if(t.match(s))return!0;for(const t of this.absoluteChildren)if(t.match(e))return!0;return!1}}class HasWalkedCache{store;constructor(t=new Map){this.store=t}copy(){return new HasWalkedCache(new Map(this.store))}hasWalked(t,e){return this.store.get(t.fullpath())?.has(e.globString())}storeWalked(t,e){const s=t.fullpath(),i=this.store.get(s);i?i.add(e.globString()):this.store.set(s,new Set([e.globString()]))}}class MatchRecord{store=new Map;add(t,e,s){const i=(e?2:0)|(s?1:0),r=this.store.get(t);this.store.set(t,void 0===r?i:i&r)}entries(){return[...this.store.entries()].map((([t,e])=>[t,!!(2&e),!!(1&e)]))}}class SubWalks{store=new Map;add(t,e){if(!t.canReaddir())return;const s=this.store.get(t);s?s.find((t=>t.globString()===e.globString()))||s.push(e):this.store.set(t,[e])}get(t){const e=this.store.get(t);if(!e)throw new Error("attempting to walk unknown path");return e}entries(){return this.keys().map((t=>[t,this.store.get(t)]))}keys(){return[...this.store.keys()].filter((t=>t.canReaddir()))}}class Processor{hasWalkedCache;matches=new MatchRecord;subwalks=new SubWalks;patterns;follow;dot;opts;constructor(t,e){this.opts=t,this.follow=!!t.follow,this.dot=!!t.dot,this.hasWalkedCache=e?e.copy():new HasWalkedCache}processPatterns(t,e){this.patterns=e;const s=e.map((e=>[t,e]));for(let[t,e]of s){this.hasWalkedCache.storeWalked(t,e);const s=e.root(),i=e.isAbsolute()&&!1!==this.opts.absolute;if(s){t=t.resolve("/"===s&&void 0!==this.opts.root?this.opts.root:s);const i=e.rest();if(!i){this.matches.add(t,!0,!1);continue}e=i}if(t.isENOENT())continue;let r,n,h=!1;for(;"string"==typeof(r=e.pattern())&&(n=e.rest());){const s=t.resolve(r);t=s,e=n,h=!0}if(r=e.pattern(),n=e.rest(),h){if(this.hasWalkedCache.hasWalked(t,e))continue;this.hasWalkedCache.storeWalked(t,e)}if("string"!=typeof r)if(r===S){(!t.isSymbolicLink()||this.follow||e.checkFollowGlobstar())&&this.subwalks.add(t,e);const s=n?.pattern(),r=n?.rest();if(n&&(""!==s&&"."!==s||r)){if(".."===s){const e=t.parent||t;r?this.hasWalkedCache.hasWalked(e,r)||this.subwalks.add(e,r):this.matches.add(e,i,!0)}}else this.matches.add(t,i,""===s||"."===s)}else r instanceof RegExp&&this.subwalks.add(t,e);else{const e=".."===r||""===r||"."===r;this.matches.add(t.resolve(r),i,e)}}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new Processor(this.opts,this.hasWalkedCache)}filterEntries(t,e){const s=this.subwalks.get(t),i=this.child();for(const t of e)for(const e of s){const s=e.isAbsolute(),r=e.pattern(),n=e.rest();r===S?i.testGlobstar(t,e,n,s):r instanceof RegExp?i.testRegExp(t,r,n,s):i.testString(t,r,n,s)}return i}testGlobstar(t,e,s,i){if(!this.dot&&t.name.startsWith(".")||(e.hasMore()||this.matches.add(t,i,!1),t.canReaddir()&&(this.follow||!t.isSymbolicLink()?this.subwalks.add(t,e):t.isSymbolicLink()&&(s&&e.checkFollowGlobstar()?this.subwalks.add(t,s):e.markFollowGlobstar()&&this.subwalks.add(t,e)))),s){const e=s.pattern();if("string"==typeof e&&".."!==e&&""!==e&&"."!==e)this.testString(t,e,s.rest(),i);else if(".."===e){const e=t.parent||t;this.subwalks.add(e,s)}else e instanceof RegExp&&this.testRegExp(t,e,s.rest(),i)}}testRegExp(t,e,s,i){e.test(t.name)&&(s?this.subwalks.add(t,s):this.matches.add(t,i,!1))}testString(t,e,s,i){t.isNamed(e)&&(s?this.subwalks.add(t,s):this.matches.add(t,i,!1))}}class GlobUtil{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#ce=[];#pe;#de;signal;maxDepth;includeChildMatches;constructor(t,e,s){if(this.patterns=t,this.path=e,this.opts=s,this.#de=s.posix||"win32"!==s.platform?"/":"\\",this.includeChildMatches=!1!==s.includeChildMatches,(s.ignore||!this.includeChildMatches)&&(this.#pe=((t,e)=>"string"==typeof t?new Ignore([t],e):Array.isArray(t)?new Ignore(t,e):t)(s.ignore??[],s),!this.includeChildMatches&&"function"!=typeof this.#pe.add)){throw new Error("cannot ignore child matches, ignore lacks add() method.")}this.maxDepth=s.maxDepth||1/0,s.signal&&(this.signal=s.signal,this.signal.addEventListener("abort",(()=>{this.#ce.length=0})))}#ue(t){return this.seen.has(t)||!!this.#pe?.ignored?.(t)}#fe(t){return!!this.#pe?.childrenIgnored?.(t)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;let t;for(this.paused=!1;!this.paused&&(t=this.#ce.shift());)t()}onResume(t){this.signal?.aborted||(this.paused?this.#ce.push(t):t())}async matchCheck(t,e){if(e&&this.opts.nodir)return;let s;if(this.opts.realpath){if(s=t.realpathCached()||await t.realpath(),!s)return;t=s}const i=t.isUnknown()||this.opts.stat?await t.lstat():t;if(this.opts.follow&&this.opts.nodir&&i?.isSymbolicLink()){const t=await i.realpath();t&&(t.isUnknown()||this.opts.stat)&&await t.lstat()}return this.matchCheckTest(i,e)}matchCheckTest(t,e){return!t||!(this.maxDepth===1/0||t.depth()<=this.maxDepth)||e&&!t.canReaddir()||this.opts.nodir&&t.isDirectory()||this.opts.nodir&&this.opts.follow&&t.isSymbolicLink()&&t.realpathCached()?.isDirectory()||this.#ue(t)?void 0:t}matchCheckSync(t,e){if(e&&this.opts.nodir)return;let s;if(this.opts.realpath){if(s=t.realpathCached()||t.realpathSync(),!s)return;t=s}const i=t.isUnknown()||this.opts.stat?t.lstatSync():t;if(this.opts.follow&&this.opts.nodir&&i?.isSymbolicLink()){const t=i.realpathSync();t&&(t?.isUnknown()||this.opts.stat)&&t.lstatSync()}return this.matchCheckTest(i,e)}matchFinish(t,e){if(this.#ue(t))return;if(!this.includeChildMatches&&this.#pe?.add){const e=`${t.relativePosix()}/**`;this.#pe.add(e)}const s=void 0===this.opts.absolute?e:this.opts.absolute;this.seen.add(t);const i=this.opts.mark&&t.isDirectory()?this.#de:"";if(this.opts.withFileTypes)this.matchEmit(t);else if(s){const e=this.opts.posix?t.fullpathPosix():t.fullpath();this.matchEmit(e+i)}else{const e=this.opts.posix?t.relativePosix():t.relative(),s=this.opts.dotRelative&&!e.startsWith(".."+this.#de)?"."+this.#de:"";this.matchEmit(e?s+e+i:"."+i)}}async match(t,e,s){const i=await this.matchCheck(t,s);i&&this.matchFinish(i,e)}matchSync(t,e,s){const i=this.matchCheckSync(t,s);i&&this.matchFinish(i,e)}walkCB(t,e,s){this.signal?.aborted&&s(),this.walkCB2(t,e,new Processor(this.opts),s)}walkCB2(t,e,s,i){if(this.#fe(t))return i();if(this.signal?.aborted&&i(),this.paused)return void this.onResume((()=>this.walkCB2(t,e,s,i)));s.processPatterns(t,e);let r=1;const next=()=>{0==--r&&i()};for(const[t,e,i]of s.matches.entries())this.#ue(t)||(r++,this.match(t,e,i).then((()=>next())));for(const t of s.subwalkTargets()){if(this.maxDepth!==1/0&&t.depth()>=this.maxDepth)continue;r++;const e=t.readdirCached();t.calledReaddir()?this.walkCB3(t,e,s,next):t.readdirCB(((e,i)=>this.walkCB3(t,i,s,next)),!0)}next()}walkCB3(t,e,s,i){s=s.filterEntries(t,e);let r=1;const next=()=>{0==--r&&i()};for(const[t,e,i]of s.matches.entries())this.#ue(t)||(r++,this.match(t,e,i).then((()=>next())));for(const[t,e]of s.subwalks.entries())r++,this.walkCB2(t,e,s.child(),next);next()}walkCBSync(t,e,s){this.signal?.aborted&&s(),this.walkCB2Sync(t,e,new Processor(this.opts),s)}walkCB2Sync(t,e,s,i){if(this.#fe(t))return i();if(this.signal?.aborted&&i(),this.paused)return void this.onResume((()=>this.walkCB2Sync(t,e,s,i)));s.processPatterns(t,e);let r=1;const next=()=>{0==--r&&i()};for(const[t,e,i]of s.matches.entries())this.#ue(t)||this.matchSync(t,e,i);for(const t of s.subwalkTargets()){if(this.maxDepth!==1/0&&t.depth()>=this.maxDepth)continue;r++;const e=t.readdirSync();this.walkCB3Sync(t,e,s,next)}next()}walkCB3Sync(t,e,s,i){s=s.filterEntries(t,e);let r=1;const next=()=>{0==--r&&i()};for(const[t,e,i]of s.matches.entries())this.#ue(t)||this.matchSync(t,e,i);for(const[t,e]of s.subwalks.entries())r++,this.walkCB2Sync(t,e,s.child(),next);next()}}class GlobWalker extends GlobUtil{matches=new Set;constructor(t,e,s){super(t,e,s)}matchEmit(t){this.matches.add(t)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise(((t,e)=>{this.walkCB(this.path,this.patterns,(()=>{this.signal?.aborted?e(this.signal.reason):t(this.matches)}))})),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,(()=>{if(this.signal?.aborted)throw this.signal.reason})),this.matches}}class GlobStream extends GlobUtil{results;constructor(t,e,s){super(t,e,s),this.results=new R.n_({signal:this.signal,objectMode:!0}),this.results.on("drain",(()=>this.resume())),this.results.on("resume",(()=>this.resume()))}matchEmit(t){this.results.write(t),this.results.flowing||this.pause()}stream(){const t=this.path;return t.isUnknown()?t.lstat().then((()=>{this.walkCB(t,this.patterns,(()=>this.results.end()))})):this.walkCB(t,this.patterns,(()=>this.results.end())),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,(()=>this.results.end())),this.results}}const V="object"==typeof process&&process&&"string"==typeof process.platform?process.platform:"linux";class Glob{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(t,e){if(!e)throw new TypeError("glob options required");if(this.withFileTypes=!!e.withFileTypes,this.signal=e.signal,this.follow=!!e.follow,this.dot=!!e.dot,this.dotRelative=!!e.dotRelative,this.nodir=!!e.nodir,this.mark=!!e.mark,e.cwd?(e.cwd instanceof URL||e.cwd.startsWith("file://"))&&(e.cwd=(0,v.fileURLToPath)(e.cwd)):this.cwd="",this.cwd=e.cwd||"",this.root=e.root,this.magicalBraces=!!e.magicalBraces,this.nobrace=!!e.nobrace,this.noext=!!e.noext,this.realpath=!!e.realpath,this.absolute=e.absolute,this.includeChildMatches=!1!==e.includeChildMatches,this.noglobstar=!!e.noglobstar,this.matchBase=!!e.matchBase,this.maxDepth="number"==typeof e.maxDepth?e.maxDepth:1/0,this.stat=!!e.stat,this.ignore=e.ignore,this.withFileTypes&&void 0!==this.absolute)throw new Error("cannot set absolute and withFileTypes:true");if("string"==typeof t&&(t=[t]),this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||!1===e.allowWindowsEscape,this.windowsPathsNoEscape&&(t=t.map((t=>t.replace(/\\/g,"/")))),this.matchBase){if(e.noglobstar)throw new TypeError("base matching requires globstar");t=t.map((t=>t.includes("/")?t:`./**/${t}`))}if(this.pattern=t,this.platform=e.platform||V,this.opts={...e,platform:this.platform},e.scurry){if(this.scurry=e.scurry,void 0!==e.nocase&&e.nocase!==e.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{const t="win32"===e.platform?PathScurryWin32:"darwin"===e.platform?PathScurryDarwin:e.platform?PathScurryPosix:q;this.scurry=new t(this.cwd,{nocase:e.nocase,fs:e.fs})}this.nocase=this.scurry.nocase;const s="darwin"===this.platform||"win32"===this.platform,i={...e,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:s,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},r=this.pattern.map((t=>new Minimatch(t,i))),[n,h]=r.reduce(((t,e)=>(t[0].push(...e.set),t[1].push(...e.globParts),t)),[[],[]]);this.patterns=n.map(((t,e)=>{const s=h[e];if(!s)throw new Error("invalid pattern object");return new Pattern(t,s,0,this.platform)}))}async walk(){return[...await new GlobWalker(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new GlobWalker(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new GlobStream(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new GlobStream(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}}const hasMagic=(t,e={})=>{Array.isArray(t)||(t=[t]);for(const s of t)if(new Minimatch(s,e).hasMagic())return!0;return!1};function globStreamSync(t,e={}){return new Glob(t,e).streamSync()}function globStream(t,e={}){return new Glob(t,e).stream()}function globSync(t,e={}){return new Glob(t,e).walkSync()}async function glob_(t,e={}){return new Glob(t,e).walk()}function globIterateSync(t,e={}){return new Glob(t,e).iterateSync()}function globIterate(t,e={}){return new Glob(t,e).iterate()}const J=globStreamSync,K=Object.assign(globStream,{sync:globStreamSync}),X=globIterateSync,Y=Object.assign(globIterate,{sync:globIterateSync}),Q=Object.assign(globSync,{stream:globStreamSync,iterate:globIterateSync}),tt=Object.assign(glob_,{glob:glob_,globSync,sync:Q,globStream,stream:K,globStreamSync,streamSync:J,globIterate,iterate:Y,globIterateSync,iterateSync:X,Glob,hasMagic,escape:escape_escape,unescape:unescape_unescape});tt.glob=tt}};
|