@turbo/workspaces 2.7.2-canary.0 → 2.7.2-canary.1

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/dist/cli.js CHANGED
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
- "use strict";var Nl=Object.create;var ai=Object.defineProperty;var Ml=Object.getOwnPropertyDescriptor;var Il=Object.getOwnPropertyNames;var jl=Object.getPrototypeOf,Ul=Object.prototype.hasOwnProperty;var ql=(r,e)=>()=>(r&&(e=r(r=0)),e);var y=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),$l=(r,e)=>{for(var t in e)ai(r,t,{get:e[t],enumerable:!0})},Wl=(r,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Il(e))!Ul.call(r,i)&&i!==t&&ai(r,i,{get:()=>e[i],enumerable:!(s=Ml(e,i))||s.enumerable});return r};var A=(r,e,t)=>(t=r!=null?Nl(jl(r)):{},Wl(e||!r||!r.__esModule?ai(t,"default",{value:r,enumerable:!0}):t,r));var u=ql(()=>{});var wo=y((Xm,ke)=>{u();function ci(r){return ke.exports=ci=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ke.exports.__esModule=!0,ke.exports.default=ke.exports,ci(r)}ke.exports=ci,ke.exports.__esModule=!0,ke.exports.default=ke.exports});var So=y((Qm,_e)=>{u();var Fo=wo().default;function bo(){"use strict";_e.exports=bo=function(){return e},_e.exports.__esModule=!0,_e.exports.default=_e.exports;var r,e={},t=Object.prototype,s=t.hasOwnProperty,i=Object.defineProperty||function(g,m,D){g[m]=D.value},n=typeof Symbol=="function"?Symbol:{},o=n.iterator||"@@iterator",a=n.asyncIterator||"@@asyncIterator",l=n.toStringTag||"@@toStringTag";function c(g,m,D){return Object.defineProperty(g,m,{value:D,enumerable:!0,configurable:!0,writable:!0}),g[m]}try{c({},"")}catch{c=function(D,C,b){return D[C]=b}}function h(g,m,D,C){var b=m&&m.prototype instanceof x?m:x,F=Object.create(b.prototype),T=new oi(C||[]);return i(F,"_invoke",{value:Tl(g,D,T)}),F}function d(g,m,D){try{return{type:"normal",arg:g.call(m,D)}}catch(C){return{type:"throw",arg:C}}}e.wrap=h;var p="suspendedStart",E="suspendedYield",w="executing",P="completed",S={};function x(){}function ft(){}function Ee(){}var si={};c(si,o,function(){return this});var ii=Object.getPrototypeOf,Ir=ii&&ii(ii(ui([])));Ir&&Ir!==t&&s.call(Ir,o)&&(si=Ir);var Lt=Ee.prototype=x.prototype=Object.create(si);function Ao(g){["next","throw","return"].forEach(function(m){c(g,m,function(D){return this._invoke(m,D)})})}function jr(g,m){function D(b,F,T,G){var H=d(g[b],g,F);if(H.type!=="throw"){var pt=H.arg,Ge=pt.value;return Ge&&Fo(Ge)=="object"&&s.call(Ge,"__await")?m.resolve(Ge.__await).then(function(mt){D("next",mt,T,G)},function(mt){D("throw",mt,T,G)}):m.resolve(Ge).then(function(mt){pt.value=mt,T(pt)},function(mt){return D("throw",mt,T,G)})}G(H.arg)}var C;i(this,"_invoke",{value:function(F,T){function G(){return new m(function(H,pt){D(F,T,H,pt)})}return C=C?C.then(G,G):G()}})}function Tl(g,m,D){var C=p;return function(b,F){if(C===w)throw new Error("Generator is already running");if(C===P){if(b==="throw")throw F;return{value:r,done:!0}}for(D.method=b,D.arg=F;;){var T=D.delegate;if(T){var G=Co(T,D);if(G){if(G===S)continue;return G}}if(D.method==="next")D.sent=D._sent=D.arg;else if(D.method==="throw"){if(C===p)throw C=P,D.arg;D.dispatchException(D.arg)}else D.method==="return"&&D.abrupt("return",D.arg);C=w;var H=d(g,m,D);if(H.type==="normal"){if(C=D.done?P:E,H.arg===S)continue;return{value:H.arg,done:D.done}}H.type==="throw"&&(C=P,D.method="throw",D.arg=H.arg)}}}function Co(g,m){var D=m.method,C=g.iterator[D];if(C===r)return m.delegate=null,D==="throw"&&g.iterator.return&&(m.method="return",m.arg=r,Co(g,m),m.method==="throw")||D!=="return"&&(m.method="throw",m.arg=new TypeError("The iterator does not provide a '"+D+"' method")),S;var b=d(C,g.iterator,m.arg);if(b.type==="throw")return m.method="throw",m.arg=b.arg,m.delegate=null,S;var F=b.arg;return F?F.done?(m[g.resultName]=F.value,m.next=g.nextLoc,m.method!=="return"&&(m.method="next",m.arg=r),m.delegate=null,S):F:(m.method="throw",m.arg=new TypeError("iterator result is not an object"),m.delegate=null,S)}function Ll(g){var m={tryLoc:g[0]};1 in g&&(m.catchLoc=g[1]),2 in g&&(m.finallyLoc=g[2],m.afterLoc=g[3]),this.tryEntries.push(m)}function ni(g){var m=g.completion||{};m.type="normal",delete m.arg,g.completion=m}function oi(g){this.tryEntries=[{tryLoc:"root"}],g.forEach(Ll,this),this.reset(!0)}function ui(g){if(g||g===""){var m=g[o];if(m)return m.call(g);if(typeof g.next=="function")return g;if(!isNaN(g.length)){var D=-1,C=function b(){for(;++D<g.length;)if(s.call(g,D))return b.value=g[D],b.done=!1,b;return b.value=r,b.done=!0,b};return C.next=C}}throw new TypeError(Fo(g)+" is not iterable")}return ft.prototype=Ee,i(Lt,"constructor",{value:Ee,configurable:!0}),i(Ee,"constructor",{value:ft,configurable:!0}),ft.displayName=c(Ee,l,"GeneratorFunction"),e.isGeneratorFunction=function(g){var m=typeof g=="function"&&g.constructor;return!!m&&(m===ft||(m.displayName||m.name)==="GeneratorFunction")},e.mark=function(g){return Object.setPrototypeOf?Object.setPrototypeOf(g,Ee):(g.__proto__=Ee,c(g,l,"GeneratorFunction")),g.prototype=Object.create(Lt),g},e.awrap=function(g){return{__await:g}},Ao(jr.prototype),c(jr.prototype,a,function(){return this}),e.AsyncIterator=jr,e.async=function(g,m,D,C,b){b===void 0&&(b=Promise);var F=new jr(h(g,m,D,C),b);return e.isGeneratorFunction(m)?F:F.next().then(function(T){return T.done?T.value:F.next()})},Ao(Lt),c(Lt,l,"Generator"),c(Lt,o,function(){return this}),c(Lt,"toString",function(){return"[object Generator]"}),e.keys=function(g){var m=Object(g),D=[];for(var C in m)D.push(C);return D.reverse(),function b(){for(;D.length;){var F=D.pop();if(F in m)return b.value=F,b.done=!1,b}return b.done=!0,b}},e.values=ui,oi.prototype={constructor:oi,reset:function(m){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(ni),!m)for(var D in this)D.charAt(0)==="t"&&s.call(this,D)&&!isNaN(+D.slice(1))&&(this[D]=r)},stop:function(){this.done=!0;var m=this.tryEntries[0].completion;if(m.type==="throw")throw m.arg;return this.rval},dispatchException:function(m){if(this.done)throw m;var D=this;function C(pt,Ge){return T.type="throw",T.arg=m,D.next=pt,Ge&&(D.method="next",D.arg=r),!!Ge}for(var b=this.tryEntries.length-1;b>=0;--b){var F=this.tryEntries[b],T=F.completion;if(F.tryLoc==="root")return C("end");if(F.tryLoc<=this.prev){var G=s.call(F,"catchLoc"),H=s.call(F,"finallyLoc");if(G&&H){if(this.prev<F.catchLoc)return C(F.catchLoc,!0);if(this.prev<F.finallyLoc)return C(F.finallyLoc)}else if(G){if(this.prev<F.catchLoc)return C(F.catchLoc,!0)}else{if(!H)throw new Error("try statement without catch or finally");if(this.prev<F.finallyLoc)return C(F.finallyLoc)}}}},abrupt:function(m,D){for(var C=this.tryEntries.length-1;C>=0;--C){var b=this.tryEntries[C];if(b.tryLoc<=this.prev&&s.call(b,"finallyLoc")&&this.prev<b.finallyLoc){var F=b;break}}F&&(m==="break"||m==="continue")&&F.tryLoc<=D&&D<=F.finallyLoc&&(F=null);var T=F?F.completion:{};return T.type=m,T.arg=D,F?(this.method="next",this.next=F.finallyLoc,S):this.complete(T)},complete:function(m,D){if(m.type==="throw")throw m.arg;return m.type==="break"||m.type==="continue"?this.next=m.arg:m.type==="return"?(this.rval=this.arg=m.arg,this.method="return",this.next="end"):m.type==="normal"&&D&&(this.next=D),S},finish:function(m){for(var D=this.tryEntries.length-1;D>=0;--D){var C=this.tryEntries[D];if(C.finallyLoc===m)return this.complete(C.completion,C.afterLoc),ni(C),S}},catch:function(m){for(var D=this.tryEntries.length-1;D>=0;--D){var C=this.tryEntries[D];if(C.tryLoc===m){var b=C.completion;if(b.type==="throw"){var F=b.arg;ni(C)}return F}}throw new Error("illegal catch attempt")},delegateYield:function(m,D,C){return this.delegate={iterator:ui(m),resultName:D,nextLoc:C},this.method==="next"&&(this.arg=r),S}},e}_e.exports=bo,_e.exports.__esModule=!0,_e.exports.default=_e.exports});var _o=y((ed,ko)=>{u();var Ur=So()();ko.exports=Ur;try{regeneratorRuntime=Ur}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=Ur:Function("r","regeneratorRuntime = r")(Ur)}});var Ro=y((wd,Di)=>{"use strict";u();var vo=(r,...e)=>new Promise(t=>{t(r(...e))});Di.exports=vo;Di.exports.default=vo});var xo=y((Fd,gi)=>{"use strict";u();var zl=Ro(),Bo=r=>{if(!((Number.isInteger(r)||r===1/0)&&r>0))return Promise.reject(new TypeError("Expected `concurrency` to be a number from 1 and up"));let e=[],t=0,s=()=>{t--,e.length>0&&e.shift()()},i=(a,l,...c)=>{t++;let h=zl(a,...c);l(h),h.then(s,s)},n=(a,l,...c)=>{t<r?i(a,l,...c):e.push(i.bind(null,a,l,...c))},o=(a,...l)=>new Promise(c=>n(a,c,...l));return Object.defineProperties(o,{activeCount:{get:()=>t},pendingCount:{get:()=>e.length},clearQueue:{value:()=>{e.length=0}}}),o};gi.exports=Bo;gi.exports.default=Bo});var To=y((bd,Ei)=>{"use strict";u();var Oo=xo(),qr=class extends Error{constructor(e){super(),this.value=e}},Gl=async(r,e)=>e(await r),Hl=async r=>{let e=await Promise.all(r);if(e[1]===!0)throw new qr(e[0]);return!1},Po=async(r,e,t)=>{t={concurrency:1/0,preserveOrder:!0,...t};let s=Oo(t.concurrency),i=[...r].map(o=>[o,s(Gl,o,e)]),n=Oo(t.preserveOrder?1:1/0);try{await Promise.all(i.map(o=>n(Hl,o)))}catch(o){if(o instanceof qr)return o.value;throw o}};Ei.exports=Po;Ei.exports.default=Po});var Uo=y((Sd,yi)=>{"use strict";u();var Lo=require("path"),$r=require("fs"),{promisify:No}=require("util"),Jl=To(),Vl=No($r.stat),Yl=No($r.lstat),Mo={directory:"isDirectory",file:"isFile"};function Io({type:r}){if(!(r in Mo))throw new Error(`Invalid type specified: ${r}`)}var jo=(r,e)=>r===void 0||e[Mo[r]]();yi.exports=async(r,e)=>{e={cwd:process.cwd(),type:"file",allowSymlinks:!0,...e},Io(e);let t=e.allowSymlinks?Vl:Yl;return Jl(r,async s=>{try{let i=await t(Lo.resolve(e.cwd,s));return jo(e.type,i)}catch{return!1}},e)};yi.exports.sync=(r,e)=>{e={cwd:process.cwd(),allowSymlinks:!0,type:"file",...e},Io(e);let t=e.allowSymlinks?$r.statSync:$r.lstatSync;for(let s of r)try{let i=t(Lo.resolve(e.cwd,s));if(jo(e.type,i))return s}catch{}}});var $o=y((kd,Ai)=>{"use strict";u();var qo=require("fs"),{promisify:Kl}=require("util"),Zl=Kl(qo.access);Ai.exports=async r=>{try{return await Zl(r),!0}catch{return!1}};Ai.exports.sync=r=>{try{return qo.accessSync(r),!0}catch{return!1}}});var zo=y((_d,Mt)=>{"use strict";u();var He=require("path"),Wr=Uo(),Wo=$o(),Ci=Symbol("findUp.stop");Mt.exports=async(r,e={})=>{let t=He.resolve(e.cwd||""),{root:s}=He.parse(t),i=[].concat(r),n=async o=>{if(typeof r!="function")return Wr(i,o);let a=await r(o.cwd);return typeof a=="string"?Wr([a],o):a};for(;;){let o=await n({...e,cwd:t});if(o===Ci)return;if(o)return He.resolve(t,o);if(t===s)return;t=He.dirname(t)}};Mt.exports.sync=(r,e={})=>{let t=He.resolve(e.cwd||""),{root:s}=He.parse(t),i=[].concat(r),n=o=>{if(typeof r!="function")return Wr.sync(i,o);let a=r(o.cwd);return typeof a=="string"?Wr.sync([a],o):a};for(;;){let o=n({...e,cwd:t});if(o===Ci)return;if(o)return He.resolve(t,o);if(t===s)return;t=He.dirname(t)}};Mt.exports.exists=Wo;Mt.exports.sync.exists=Wo.sync;Mt.exports.stop=Ci});var Ut=y((Zd,su)=>{"use strict";u();var ru=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"]]);su.exports=r=>r?Object.keys(r).map(e=>[ru.has(e)?ru.get(e):e,r[e]]).reduce((e,t)=>(e[t[0]]=t[1],e),Object.create(null)):{}});var Kr=y((Xd,fu)=>{"use strict";u();var iu=typeof process=="object"&&process?process:{stdout:null,stderr:null},bh=require("events"),nu=require("stream"),ou=require("string_decoder").StringDecoder,Re=Symbol("EOF"),Be=Symbol("maybeEmitEnd"),Je=Symbol("emittedEnd"),Gr=Symbol("emittingEnd"),Dr=Symbol("emittedError"),Hr=Symbol("closed"),uu=Symbol("read"),Jr=Symbol("flush"),au=Symbol("flushChunk"),V=Symbol("encoding"),xe=Symbol("decoder"),Vr=Symbol("flowing"),gr=Symbol("paused"),qt=Symbol("resume"),L=Symbol("buffer"),ye=Symbol("pipes"),I=Symbol("bufferLength"),Si=Symbol("bufferPush"),ki=Symbol("bufferShift"),U=Symbol("objectMode"),q=Symbol("destroyed"),_i=Symbol("emitData"),cu=Symbol("emitEnd"),vi=Symbol("emitEnd2"),Oe=Symbol("async"),Er=r=>Promise.resolve().then(r),lu=global._MP_NO_ITERATOR_SYMBOLS_!=="1",Sh=lu&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),kh=lu&&Symbol.iterator||Symbol("iterator not implemented"),_h=r=>r==="end"||r==="finish"||r==="prefinish",vh=r=>r instanceof ArrayBuffer||typeof r=="object"&&r.constructor&&r.constructor.name==="ArrayBuffer"&&r.byteLength>=0,Rh=r=>!Buffer.isBuffer(r)&&ArrayBuffer.isView(r),Yr=class{constructor(e,t,s){this.src=e,this.dest=t,this.opts=s,this.ondrain=()=>e[qt](),t.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},Ri=class extends Yr{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,t,s){super(e,t,s),this.proxyErrors=i=>t.emit("error",i),e.on("error",this.proxyErrors)}};fu.exports=class hu extends nu{constructor(e){super(),this[Vr]=!1,this[gr]=!1,this[ye]=[],this[L]=[],this[U]=e&&e.objectMode||!1,this[U]?this[V]=null:this[V]=e&&e.encoding||null,this[V]==="buffer"&&(this[V]=null),this[Oe]=e&&!!e.async||!1,this[xe]=this[V]?new ou(this[V]):null,this[Re]=!1,this[Je]=!1,this[Gr]=!1,this[Hr]=!1,this[Dr]=null,this.writable=!0,this.readable=!0,this[I]=0,this[q]=!1,e&&e.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[L]}),e&&e.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[ye]})}get bufferLength(){return this[I]}get encoding(){return this[V]}set encoding(e){if(this[U])throw new Error("cannot set encoding in objectMode");if(this[V]&&e!==this[V]&&(this[xe]&&this[xe].lastNeed||this[I]))throw new Error("cannot change encoding");this[V]!==e&&(this[xe]=e?new ou(e):null,this[L].length&&(this[L]=this[L].map(t=>this[xe].write(t)))),this[V]=e}setEncoding(e){this.encoding=e}get objectMode(){return this[U]}set objectMode(e){this[U]=this[U]||!!e}get async(){return this[Oe]}set async(e){this[Oe]=this[Oe]||!!e}write(e,t,s){if(this[Re])throw new Error("write after end");if(this[q])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof t=="function"&&(s=t,t="utf8"),t||(t="utf8");let i=this[Oe]?Er:n=>n();return!this[U]&&!Buffer.isBuffer(e)&&(Rh(e)?e=Buffer.from(e.buffer,e.byteOffset,e.byteLength):vh(e)?e=Buffer.from(e):typeof e!="string"&&(this.objectMode=!0)),this[U]?(this.flowing&&this[I]!==0&&this[Jr](!0),this.flowing?this.emit("data",e):this[Si](e),this[I]!==0&&this.emit("readable"),s&&i(s),this.flowing):e.length?(typeof e=="string"&&!(t===this[V]&&!this[xe].lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[V]&&(e=this[xe].write(e)),this.flowing&&this[I]!==0&&this[Jr](!0),this.flowing?this.emit("data",e):this[Si](e),this[I]!==0&&this.emit("readable"),s&&i(s),this.flowing):(this[I]!==0&&this.emit("readable"),s&&i(s),this.flowing)}read(e){if(this[q])return null;if(this[I]===0||e===0||e>this[I])return this[Be](),null;this[U]&&(e=null),this[L].length>1&&!this[U]&&(this.encoding?this[L]=[this[L].join("")]:this[L]=[Buffer.concat(this[L],this[I])]);let t=this[uu](e||null,this[L][0]);return this[Be](),t}[uu](e,t){return e===t.length||e===null?this[ki]():(this[L][0]=t.slice(e),t=t.slice(0,e),this[I]-=e),this.emit("data",t),!this[L].length&&!this[Re]&&this.emit("drain"),t}end(e,t,s){return typeof e=="function"&&(s=e,e=null),typeof t=="function"&&(s=t,t="utf8"),e&&this.write(e,t),s&&this.once("end",s),this[Re]=!0,this.writable=!1,(this.flowing||!this[gr])&&this[Be](),this}[qt](){this[q]||(this[gr]=!1,this[Vr]=!0,this.emit("resume"),this[L].length?this[Jr]():this[Re]?this[Be]():this.emit("drain"))}resume(){return this[qt]()}pause(){this[Vr]=!1,this[gr]=!0}get destroyed(){return this[q]}get flowing(){return this[Vr]}get paused(){return this[gr]}[Si](e){this[U]?this[I]+=1:this[I]+=e.length,this[L].push(e)}[ki](){return this[L].length&&(this[U]?this[I]-=1:this[I]-=this[L][0].length),this[L].shift()}[Jr](e){do;while(this[au](this[ki]()));!e&&!this[L].length&&!this[Re]&&this.emit("drain")}[au](e){return e?(this.emit("data",e),this.flowing):!1}pipe(e,t){if(this[q])return;let s=this[Je];return t=t||{},e===iu.stdout||e===iu.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,s?t.end&&e.end():(this[ye].push(t.proxyErrors?new Ri(this,e,t):new Yr(this,e,t)),this[Oe]?Er(()=>this[qt]()):this[qt]()),e}unpipe(e){let t=this[ye].find(s=>s.dest===e);t&&(this[ye].splice(this[ye].indexOf(t),1),t.unpipe())}addListener(e,t){return this.on(e,t)}on(e,t){let s=super.on(e,t);return e==="data"&&!this[ye].length&&!this.flowing?this[qt]():e==="readable"&&this[I]!==0?super.emit("readable"):_h(e)&&this[Je]?(super.emit(e),this.removeAllListeners(e)):e==="error"&&this[Dr]&&(this[Oe]?Er(()=>t.call(this,this[Dr])):t.call(this,this[Dr])),s}get emittedEnd(){return this[Je]}[Be](){!this[Gr]&&!this[Je]&&!this[q]&&this[L].length===0&&this[Re]&&(this[Gr]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Hr]&&this.emit("close"),this[Gr]=!1)}emit(e,t,...s){if(e!=="error"&&e!=="close"&&e!==q&&this[q])return;if(e==="data")return t?this[Oe]?Er(()=>this[_i](t)):this[_i](t):!1;if(e==="end")return this[cu]();if(e==="close"){if(this[Hr]=!0,!this[Je]&&!this[q])return;let n=super.emit("close");return this.removeAllListeners("close"),n}else if(e==="error"){this[Dr]=t;let n=super.emit("error",t);return this[Be](),n}else if(e==="resume"){let n=super.emit("resume");return this[Be](),n}else if(e==="finish"||e==="prefinish"){let n=super.emit(e);return this.removeAllListeners(e),n}let i=super.emit(e,t,...s);return this[Be](),i}[_i](e){for(let s of this[ye])s.dest.write(e)===!1&&this.pause();let t=super.emit("data",e);return this[Be](),t}[cu](){this[Je]||(this[Je]=!0,this.readable=!1,this[Oe]?Er(()=>this[vi]()):this[vi]())}[vi](){if(this[xe]){let t=this[xe].end();if(t){for(let s of this[ye])s.dest.write(t);super.emit("data",t)}}for(let t of this[ye])t.end();let e=super.emit("end");return this.removeAllListeners("end"),e}collect(){let e=[];this[U]||(e.dataLength=0);let t=this.promise();return this.on("data",s=>{e.push(s),this[U]||(e.dataLength+=s.length)}),t.then(()=>e)}concat(){return this[U]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then(e=>this[U]?Promise.reject(new Error("cannot concat in objectMode")):this[V]?e.join(""):Buffer.concat(e,e.dataLength))}promise(){return new Promise((e,t)=>{this.on(q,()=>t(new Error("stream destroyed"))),this.on("error",s=>t(s)),this.on("end",()=>e())})}[Sh](){return{next:()=>{let t=this.read();if(t!==null)return Promise.resolve({done:!1,value:t});if(this[Re])return Promise.resolve({done:!0});let s=null,i=null,n=c=>{this.removeListener("data",o),this.removeListener("end",a),i(c)},o=c=>{this.removeListener("error",n),this.removeListener("end",a),this.pause(),s({value:c,done:!!this[Re]})},a=()=>{this.removeListener("error",n),this.removeListener("data",o),s({done:!0})},l=()=>n(new Error("stream destroyed"));return new Promise((c,h)=>{i=h,s=c,this.once(q,l),this.once("error",n),this.once("end",a),this.once("data",o)})}}}[kh](){return{next:()=>{let t=this.read();return{value:t,done:t===null}}}}destroy(e){return this[q]?(e?this.emit("error",e):this.emit(q),this):(this[q]=!0,this[L].length=0,this[I]=0,typeof this.close=="function"&&!this[Hr]&&this.close(),e?this.emit("error",e):this.emit(q),this)}static isStream(e){return!!e&&(e instanceof hu||e instanceof nu||e instanceof bh&&(typeof e.pipe=="function"||typeof e.write=="function"&&typeof e.end=="function"))}}});var mu=y((Qd,pu)=>{u();var Bh=require("zlib").constants||{ZLIB_VERNUM:4736};pu.exports=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},Bh))});var Li=y((e0,Fu)=>{"use strict";u();var du=typeof process=="object"&&process?process:{stdout:null,stderr:null},xh=require("events"),Du=require("stream"),gu=require("string_decoder").StringDecoder,Pe=Symbol("EOF"),Te=Symbol("maybeEmitEnd"),Ve=Symbol("emittedEnd"),Zr=Symbol("emittingEnd"),yr=Symbol("emittedError"),Xr=Symbol("closed"),Eu=Symbol("read"),Qr=Symbol("flush"),yu=Symbol("flushChunk"),Y=Symbol("encoding"),Le=Symbol("decoder"),es=Symbol("flowing"),Ar=Symbol("paused"),$t=Symbol("resume"),j=Symbol("bufferLength"),Bi=Symbol("bufferPush"),xi=Symbol("bufferShift"),$=Symbol("objectMode"),W=Symbol("destroyed"),Oi=Symbol("emitData"),Au=Symbol("emitEnd"),Pi=Symbol("emitEnd2"),Ne=Symbol("async"),Cr=r=>Promise.resolve().then(r),Cu=global._MP_NO_ITERATOR_SYMBOLS_!=="1",Oh=Cu&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),Ph=Cu&&Symbol.iterator||Symbol("iterator not implemented"),Th=r=>r==="end"||r==="finish"||r==="prefinish",Lh=r=>r instanceof ArrayBuffer||typeof r=="object"&&r.constructor&&r.constructor.name==="ArrayBuffer"&&r.byteLength>=0,Nh=r=>!Buffer.isBuffer(r)&&ArrayBuffer.isView(r),ts=class{constructor(e,t,s){this.src=e,this.dest=t,this.opts=s,this.ondrain=()=>e[$t](),t.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},Ti=class extends ts{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,t,s){super(e,t,s),this.proxyErrors=i=>t.emit("error",i),e.on("error",this.proxyErrors)}};Fu.exports=class wu extends Du{constructor(e){super(),this[es]=!1,this[Ar]=!1,this.pipes=[],this.buffer=[],this[$]=e&&e.objectMode||!1,this[$]?this[Y]=null:this[Y]=e&&e.encoding||null,this[Y]==="buffer"&&(this[Y]=null),this[Ne]=e&&!!e.async||!1,this[Le]=this[Y]?new gu(this[Y]):null,this[Pe]=!1,this[Ve]=!1,this[Zr]=!1,this[Xr]=!1,this[yr]=null,this.writable=!0,this.readable=!0,this[j]=0,this[W]=!1}get bufferLength(){return this[j]}get encoding(){return this[Y]}set encoding(e){if(this[$])throw new Error("cannot set encoding in objectMode");if(this[Y]&&e!==this[Y]&&(this[Le]&&this[Le].lastNeed||this[j]))throw new Error("cannot change encoding");this[Y]!==e&&(this[Le]=e?new gu(e):null,this.buffer.length&&(this.buffer=this.buffer.map(t=>this[Le].write(t)))),this[Y]=e}setEncoding(e){this.encoding=e}get objectMode(){return this[$]}set objectMode(e){this[$]=this[$]||!!e}get async(){return this[Ne]}set async(e){this[Ne]=this[Ne]||!!e}write(e,t,s){if(this[Pe])throw new Error("write after end");if(this[W])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof t=="function"&&(s=t,t="utf8"),t||(t="utf8");let i=this[Ne]?Cr:n=>n();return!this[$]&&!Buffer.isBuffer(e)&&(Nh(e)?e=Buffer.from(e.buffer,e.byteOffset,e.byteLength):Lh(e)?e=Buffer.from(e):typeof e!="string"&&(this.objectMode=!0)),this[$]?(this.flowing&&this[j]!==0&&this[Qr](!0),this.flowing?this.emit("data",e):this[Bi](e),this[j]!==0&&this.emit("readable"),s&&i(s),this.flowing):e.length?(typeof e=="string"&&!(t===this[Y]&&!this[Le].lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[Y]&&(e=this[Le].write(e)),this.flowing&&this[j]!==0&&this[Qr](!0),this.flowing?this.emit("data",e):this[Bi](e),this[j]!==0&&this.emit("readable"),s&&i(s),this.flowing):(this[j]!==0&&this.emit("readable"),s&&i(s),this.flowing)}read(e){if(this[W])return null;if(this[j]===0||e===0||e>this[j])return this[Te](),null;this[$]&&(e=null),this.buffer.length>1&&!this[$]&&(this.encoding?this.buffer=[this.buffer.join("")]:this.buffer=[Buffer.concat(this.buffer,this[j])]);let t=this[Eu](e||null,this.buffer[0]);return this[Te](),t}[Eu](e,t){return e===t.length||e===null?this[xi]():(this.buffer[0]=t.slice(e),t=t.slice(0,e),this[j]-=e),this.emit("data",t),!this.buffer.length&&!this[Pe]&&this.emit("drain"),t}end(e,t,s){return typeof e=="function"&&(s=e,e=null),typeof t=="function"&&(s=t,t="utf8"),e&&this.write(e,t),s&&this.once("end",s),this[Pe]=!0,this.writable=!1,(this.flowing||!this[Ar])&&this[Te](),this}[$t](){this[W]||(this[Ar]=!1,this[es]=!0,this.emit("resume"),this.buffer.length?this[Qr]():this[Pe]?this[Te]():this.emit("drain"))}resume(){return this[$t]()}pause(){this[es]=!1,this[Ar]=!0}get destroyed(){return this[W]}get flowing(){return this[es]}get paused(){return this[Ar]}[Bi](e){this[$]?this[j]+=1:this[j]+=e.length,this.buffer.push(e)}[xi](){return this.buffer.length&&(this[$]?this[j]-=1:this[j]-=this.buffer[0].length),this.buffer.shift()}[Qr](e){do;while(this[yu](this[xi]()));!e&&!this.buffer.length&&!this[Pe]&&this.emit("drain")}[yu](e){return e?(this.emit("data",e),this.flowing):!1}pipe(e,t){if(this[W])return;let s=this[Ve];return t=t||{},e===du.stdout||e===du.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,s?t.end&&e.end():(this.pipes.push(t.proxyErrors?new Ti(this,e,t):new ts(this,e,t)),this[Ne]?Cr(()=>this[$t]()):this[$t]()),e}unpipe(e){let t=this.pipes.find(s=>s.dest===e);t&&(this.pipes.splice(this.pipes.indexOf(t),1),t.unpipe())}addListener(e,t){return this.on(e,t)}on(e,t){let s=super.on(e,t);return e==="data"&&!this.pipes.length&&!this.flowing?this[$t]():e==="readable"&&this[j]!==0?super.emit("readable"):Th(e)&&this[Ve]?(super.emit(e),this.removeAllListeners(e)):e==="error"&&this[yr]&&(this[Ne]?Cr(()=>t.call(this,this[yr])):t.call(this,this[yr])),s}get emittedEnd(){return this[Ve]}[Te](){!this[Zr]&&!this[Ve]&&!this[W]&&this.buffer.length===0&&this[Pe]&&(this[Zr]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Xr]&&this.emit("close"),this[Zr]=!1)}emit(e,t,...s){if(e!=="error"&&e!=="close"&&e!==W&&this[W])return;if(e==="data")return t?this[Ne]?Cr(()=>this[Oi](t)):this[Oi](t):!1;if(e==="end")return this[Au]();if(e==="close"){if(this[Xr]=!0,!this[Ve]&&!this[W])return;let n=super.emit("close");return this.removeAllListeners("close"),n}else if(e==="error"){this[yr]=t;let n=super.emit("error",t);return this[Te](),n}else if(e==="resume"){let n=super.emit("resume");return this[Te](),n}else if(e==="finish"||e==="prefinish"){let n=super.emit(e);return this.removeAllListeners(e),n}let i=super.emit(e,t,...s);return this[Te](),i}[Oi](e){for(let s of this.pipes)s.dest.write(e)===!1&&this.pause();let t=super.emit("data",e);return this[Te](),t}[Au](){this[Ve]||(this[Ve]=!0,this.readable=!1,this[Ne]?Cr(()=>this[Pi]()):this[Pi]())}[Pi](){if(this[Le]){let t=this[Le].end();if(t){for(let s of this.pipes)s.dest.write(t);super.emit("data",t)}}for(let t of this.pipes)t.end();let e=super.emit("end");return this.removeAllListeners("end"),e}collect(){let e=[];this[$]||(e.dataLength=0);let t=this.promise();return this.on("data",s=>{e.push(s),this[$]||(e.dataLength+=s.length)}),t.then(()=>e)}concat(){return this[$]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then(e=>this[$]?Promise.reject(new Error("cannot concat in objectMode")):this[Y]?e.join(""):Buffer.concat(e,e.dataLength))}promise(){return new Promise((e,t)=>{this.on(W,()=>t(new Error("stream destroyed"))),this.on("error",s=>t(s)),this.on("end",()=>e())})}[Oh](){return{next:()=>{let t=this.read();if(t!==null)return Promise.resolve({done:!1,value:t});if(this[Pe])return Promise.resolve({done:!0});let s=null,i=null,n=c=>{this.removeListener("data",o),this.removeListener("end",a),i(c)},o=c=>{this.removeListener("error",n),this.removeListener("end",a),this.pause(),s({value:c,done:!!this[Pe]})},a=()=>{this.removeListener("error",n),this.removeListener("data",o),s({done:!0})},l=()=>n(new Error("stream destroyed"));return new Promise((c,h)=>{i=h,s=c,this.once(W,l),this.once("error",n),this.once("end",a),this.once("data",o)})}}}[Ph](){return{next:()=>{let t=this.read();return{value:t,done:t===null}}}}destroy(e){return this[W]?(e?this.emit("error",e):this.emit(W),this):(this[W]=!0,this.buffer.length=0,this[j]=0,typeof this.close=="function"&&!this[Xr]&&this.close(),e?this.emit("error",e):this.emit(W),this)}static isStream(e){return!!e&&(e instanceof wu||e instanceof Du||e instanceof xh&&(typeof e.pipe=="function"||typeof e.write=="function"&&typeof e.end=="function"))}}});var Zi=y(Q=>{"use strict";u();var Ui=require("assert"),Ye=require("buffer").Buffer,ku=require("zlib"),Dt=Q.constants=mu(),Mh=Li(),bu=Ye.concat,gt=Symbol("_superWrite"),zt=class extends Error{constructor(e){super("zlib: "+e.message),this.code=e.code,this.errno=e.errno,this.code||(this.code="ZLIB_ERROR"),this.message="zlib: "+e.message,Error.captureStackTrace(this,this.constructor)}get name(){return"ZlibError"}},Ih=Symbol("opts"),wr=Symbol("flushFlag"),Su=Symbol("finishFlushFlag"),Ki=Symbol("fullFlushFlag"),B=Symbol("handle"),rs=Symbol("onError"),Wt=Symbol("sawError"),Ni=Symbol("level"),Mi=Symbol("strategy"),Ii=Symbol("ended"),t0=Symbol("_defaultFullFlush"),ss=class extends Mh{constructor(e,t){if(!e||typeof e!="object")throw new TypeError("invalid options for ZlibBase constructor");super(e),this[Wt]=!1,this[Ii]=!1,this[Ih]=e,this[wr]=e.flush,this[Su]=e.finishFlush;try{this[B]=new ku[t](e)}catch(s){throw new zt(s)}this[rs]=s=>{this[Wt]||(this[Wt]=!0,this.close(),this.emit("error",s))},this[B].on("error",s=>this[rs](new zt(s))),this.once("end",()=>this.close)}close(){this[B]&&(this[B].close(),this[B]=null,this.emit("close"))}reset(){if(!this[Wt])return Ui(this[B],"zlib binding closed"),this[B].reset()}flush(e){this.ended||(typeof e!="number"&&(e=this[Ki]),this.write(Object.assign(Ye.alloc(0),{[wr]:e})))}end(e,t,s){return e&&this.write(e,t),this.flush(this[Su]),this[Ii]=!0,super.end(null,null,s)}get ended(){return this[Ii]}write(e,t,s){if(typeof t=="function"&&(s=t,t="utf8"),typeof e=="string"&&(e=Ye.from(e,t)),this[Wt])return;Ui(this[B],"zlib binding closed");let i=this[B]._handle,n=i.close;i.close=()=>{};let o=this[B].close;this[B].close=()=>{},Ye.concat=c=>c;let a;try{let c=typeof e[wr]=="number"?e[wr]:this[wr];a=this[B]._processChunk(e,c),Ye.concat=bu}catch(c){Ye.concat=bu,this[rs](new zt(c))}finally{this[B]&&(this[B]._handle=i,i.close=n,this[B].close=o,this[B].removeAllListeners("error"))}this[B]&&this[B].on("error",c=>this[rs](new zt(c)));let l;if(a)if(Array.isArray(a)&&a.length>0){l=this[gt](Ye.from(a[0]));for(let c=1;c<a.length;c++)l=this[gt](a[c])}else l=this[gt](Ye.from(a));return s&&s(),l}[gt](e){return super.write(e)}},Me=class extends ss{constructor(e,t){e=e||{},e.flush=e.flush||Dt.Z_NO_FLUSH,e.finishFlush=e.finishFlush||Dt.Z_FINISH,super(e,t),this[Ki]=Dt.Z_FULL_FLUSH,this[Ni]=e.level,this[Mi]=e.strategy}params(e,t){if(!this[Wt]){if(!this[B])throw new Error("cannot switch params when binding is closed");if(!this[B].params)throw new Error("not supported in this implementation");if(this[Ni]!==e||this[Mi]!==t){this.flush(Dt.Z_SYNC_FLUSH),Ui(this[B],"zlib binding closed");let s=this[B].flush;this[B].flush=(i,n)=>{this.flush(i),n()};try{this[B].params(e,t)}finally{this[B].flush=s}this[B]&&(this[Ni]=e,this[Mi]=t)}}}},qi=class extends Me{constructor(e){super(e,"Deflate")}},$i=class extends Me{constructor(e){super(e,"Inflate")}},ji=Symbol("_portable"),Wi=class extends Me{constructor(e){super(e,"Gzip"),this[ji]=e&&!!e.portable}[gt](e){return this[ji]?(this[ji]=!1,e[9]=255,super[gt](e)):super[gt](e)}},zi=class extends Me{constructor(e){super(e,"Gunzip")}},Gi=class extends Me{constructor(e){super(e,"DeflateRaw")}},Hi=class extends Me{constructor(e){super(e,"InflateRaw")}},Ji=class extends Me{constructor(e){super(e,"Unzip")}},is=class extends ss{constructor(e,t){e=e||{},e.flush=e.flush||Dt.BROTLI_OPERATION_PROCESS,e.finishFlush=e.finishFlush||Dt.BROTLI_OPERATION_FINISH,super(e,t),this[Ki]=Dt.BROTLI_OPERATION_FLUSH}},Vi=class extends is{constructor(e){super(e,"BrotliCompress")}},Yi=class extends is{constructor(e){super(e,"BrotliDecompress")}};Q.Deflate=qi;Q.Inflate=$i;Q.Gzip=Wi;Q.Gunzip=zi;Q.DeflateRaw=Gi;Q.InflateRaw=Hi;Q.Unzip=Ji;typeof ku.BrotliCompress=="function"?(Q.BrotliCompress=Vi,Q.BrotliDecompress=Yi):Q.BrotliCompress=Q.BrotliDecompress=class{constructor(){throw new Error("Brotli is not supported in this version of Node.js")}}});var Gt=y((i0,_u)=>{u();var jh=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform;_u.exports=jh!=="win32"?r=>r:r=>r&&r.replace(/\\/g,"/")});var ns=y((o0,vu)=>{"use strict";u();var Uh=Kr(),Xi=Gt(),Qi=Symbol("slurp");vu.exports=class extends Uh{constructor(e,t,s){switch(super(),this.pause(),this.extended=t,this.globalExtended=s,this.header=e,this.startBlockSize=512*Math.ceil(e.size/512),this.blockRemain=this.startBlockSize,this.remain=e.size,this.type=e.type,this.meta=!1,this.ignore=!1,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}this.path=Xi(e.path),this.mode=e.mode,this.mode&&(this.mode=this.mode&4095),this.uid=e.uid,this.gid=e.gid,this.uname=e.uname,this.gname=e.gname,this.size=e.size,this.mtime=e.mtime,this.atime=e.atime,this.ctime=e.ctime,this.linkpath=Xi(e.linkpath),this.uname=e.uname,this.gname=e.gname,t&&this[Qi](t),s&&this[Qi](s,!0)}write(e){let t=e.length;if(t>this.blockRemain)throw new Error("writing more to entry than is appropriate");let s=this.remain,i=this.blockRemain;return this.remain=Math.max(0,s-t),this.blockRemain=Math.max(0,i-t),this.ignore?!0:s>=t?super.write(e):super.write(e.slice(0,s))}[Qi](e,t){for(let s in e)e[s]!==null&&e[s]!==void 0&&!(t&&s==="path")&&(this[s]=s==="path"||s==="linkpath"?Xi(e[s]):e[s])}}});var en=y(os=>{"use strict";u();os.name=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"]]);os.code=new Map(Array.from(os.name).map(r=>[r[1],r[0]]))});var Ou=y((a0,xu)=>{"use strict";u();var qh=(r,e)=>{if(Number.isSafeInteger(r))r<0?Wh(r,e):$h(r,e);else throw Error("cannot encode number outside of javascript safe integer range");return e},$h=(r,e)=>{e[0]=128;for(var t=e.length;t>1;t--)e[t-1]=r&255,r=Math.floor(r/256)},Wh=(r,e)=>{e[0]=255;var t=!1;r=r*-1;for(var s=e.length;s>1;s--){var i=r&255;r=Math.floor(r/256),t?e[s-1]=Ru(i):i===0?e[s-1]=0:(t=!0,e[s-1]=Bu(i))}},zh=r=>{let e=r[0],t=e===128?Hh(r.slice(1,r.length)):e===255?Gh(r):null;if(t===null)throw Error("invalid base256 encoding");if(!Number.isSafeInteger(t))throw Error("parsed number outside of javascript safe integer range");return t},Gh=r=>{for(var e=r.length,t=0,s=!1,i=e-1;i>-1;i--){var n=r[i],o;s?o=Ru(n):n===0?o=n:(s=!0,o=Bu(n)),o!==0&&(t-=o*Math.pow(256,e-i-1))}return t},Hh=r=>{for(var e=r.length,t=0,s=e-1;s>-1;s--){var i=r[s];i!==0&&(t+=i*Math.pow(256,e-s-1))}return t},Ru=r=>(255^r)&255,Bu=r=>(255^r)+1&255;xu.exports={encode:qh,parse:zh}});var Jt=y((c0,Tu)=>{"use strict";u();var tn=en(),Ht=require("path").posix,Pu=Ou(),rn=Symbol("slurp"),ee=Symbol("type"),on=class{constructor(e,t,s,i){this.cksumValid=!1,this.needPax=!1,this.nullBlock=!1,this.block=null,this.path=null,this.mode=null,this.uid=null,this.gid=null,this.size=null,this.mtime=null,this.cksum=null,this[ee]="0",this.linkpath=null,this.uname=null,this.gname=null,this.devmaj=0,this.devmin=0,this.atime=null,this.ctime=null,Buffer.isBuffer(e)?this.decode(e,t||0,s,i):e&&this.set(e)}decode(e,t,s,i){if(t||(t=0),!e||!(e.length>=t+512))throw new Error("need 512 bytes for header");if(this.path=Et(e,t,100),this.mode=Ke(e,t+100,8),this.uid=Ke(e,t+108,8),this.gid=Ke(e,t+116,8),this.size=Ke(e,t+124,12),this.mtime=sn(e,t+136,12),this.cksum=Ke(e,t+148,12),this[rn](s),this[rn](i,!0),this[ee]=Et(e,t+156,1),this[ee]===""&&(this[ee]="0"),this[ee]==="0"&&this.path.slice(-1)==="/"&&(this[ee]="5"),this[ee]==="5"&&(this.size=0),this.linkpath=Et(e,t+157,100),e.slice(t+257,t+265).toString()==="ustar\x0000")if(this.uname=Et(e,t+265,32),this.gname=Et(e,t+297,32),this.devmaj=Ke(e,t+329,8),this.devmin=Ke(e,t+337,8),e[t+475]!==0){let o=Et(e,t+345,155);this.path=o+"/"+this.path}else{let o=Et(e,t+345,130);o&&(this.path=o+"/"+this.path),this.atime=sn(e,t+476,12),this.ctime=sn(e,t+488,12)}let n=8*32;for(let o=t;o<t+148;o++)n+=e[o];for(let o=t+156;o<t+512;o++)n+=e[o];this.cksumValid=n===this.cksum,this.cksum===null&&n===8*32&&(this.nullBlock=!0)}[rn](e,t){for(let s in e)e[s]!==null&&e[s]!==void 0&&!(t&&s==="path")&&(this[s]=e[s])}encode(e,t){if(e||(e=this.block=Buffer.alloc(512),t=0),t||(t=0),!(e.length>=t+512))throw new Error("need 512 bytes for header");let s=this.ctime||this.atime?130:155,i=Jh(this.path||"",s),n=i[0],o=i[1];this.needPax=i[2],this.needPax=yt(e,t,100,n)||this.needPax,this.needPax=Ze(e,t+100,8,this.mode)||this.needPax,this.needPax=Ze(e,t+108,8,this.uid)||this.needPax,this.needPax=Ze(e,t+116,8,this.gid)||this.needPax,this.needPax=Ze(e,t+124,12,this.size)||this.needPax,this.needPax=nn(e,t+136,12,this.mtime)||this.needPax,e[t+156]=this[ee].charCodeAt(0),this.needPax=yt(e,t+157,100,this.linkpath)||this.needPax,e.write("ustar\x0000",t+257,8),this.needPax=yt(e,t+265,32,this.uname)||this.needPax,this.needPax=yt(e,t+297,32,this.gname)||this.needPax,this.needPax=Ze(e,t+329,8,this.devmaj)||this.needPax,this.needPax=Ze(e,t+337,8,this.devmin)||this.needPax,this.needPax=yt(e,t+345,s,o)||this.needPax,e[t+475]!==0?this.needPax=yt(e,t+345,155,o)||this.needPax:(this.needPax=yt(e,t+345,130,o)||this.needPax,this.needPax=nn(e,t+476,12,this.atime)||this.needPax,this.needPax=nn(e,t+488,12,this.ctime)||this.needPax);let a=8*32;for(let l=t;l<t+148;l++)a+=e[l];for(let l=t+156;l<t+512;l++)a+=e[l];return this.cksum=a,Ze(e,t+148,8,this.cksum),this.cksumValid=!0,this.needPax}set(e){for(let t in e)e[t]!==null&&e[t]!==void 0&&(this[t]=e[t])}get type(){return tn.name.get(this[ee])||this[ee]}get typeKey(){return this[ee]}set type(e){tn.code.has(e)?this[ee]=tn.code.get(e):this[ee]=e}},Jh=(r,e)=>{let s=r,i="",n,o=Ht.parse(r).root||".";if(Buffer.byteLength(s)<100)n=[s,i,!1];else{i=Ht.dirname(s),s=Ht.basename(s);do Buffer.byteLength(s)<=100&&Buffer.byteLength(i)<=e?n=[s,i,!1]:Buffer.byteLength(s)>100&&Buffer.byteLength(i)<=e?n=[s.slice(0,100-1),i,!0]:(s=Ht.join(Ht.basename(i),s),i=Ht.dirname(i));while(i!==o&&!n);n||(n=[r.slice(0,100-1),"",!0])}return n},Et=(r,e,t)=>r.slice(e,e+t).toString("utf8").replace(/\0.*/,""),sn=(r,e,t)=>Vh(Ke(r,e,t)),Vh=r=>r===null?null:new Date(r*1e3),Ke=(r,e,t)=>r[e]&128?Pu.parse(r.slice(e,e+t)):Kh(r,e,t),Yh=r=>isNaN(r)?null:r,Kh=(r,e,t)=>Yh(parseInt(r.slice(e,e+t).toString("utf8").replace(/\0.*$/,"").trim(),8)),Zh={12:8589934591,8:2097151},Ze=(r,e,t,s)=>s===null?!1:s>Zh[t]||s<0?(Pu.encode(s,r.slice(e,e+t)),!0):(Xh(r,e,t,s),!1),Xh=(r,e,t,s)=>r.write(Qh(s,t),e,t,"ascii"),Qh=(r,e)=>ef(Math.floor(r).toString(8),e),ef=(r,e)=>(r.length===e-1?r:new Array(e-r.length-1).join("0")+r+" ")+"\0",nn=(r,e,t,s)=>s===null?!1:Ze(r,e,t,s.getTime()/1e3),tf=new Array(156).join("\0"),yt=(r,e,t,s)=>s===null?!1:(r.write(s+tf,e,t,"utf8"),s.length!==Buffer.byteLength(s)||s.length>t);Tu.exports=on});var us=y((l0,Lu)=>{"use strict";u();var rf=Jt(),sf=require("path"),Fr=class{constructor(e,t){this.atime=e.atime||null,this.charset=e.charset||null,this.comment=e.comment||null,this.ctime=e.ctime||null,this.gid=e.gid||null,this.gname=e.gname||null,this.linkpath=e.linkpath||null,this.mtime=e.mtime||null,this.path=e.path||null,this.size=e.size||null,this.uid=e.uid||null,this.uname=e.uname||null,this.dev=e.dev||null,this.ino=e.ino||null,this.nlink=e.nlink||null,this.global=t||!1}encode(){let e=this.encodeBody();if(e==="")return null;let t=Buffer.byteLength(e),s=512*Math.ceil(1+t/512),i=Buffer.allocUnsafe(s);for(let n=0;n<512;n++)i[n]=0;new rf({path:("PaxHeader/"+sf.basename(this.path)).slice(0,99),mode:this.mode||420,uid:this.uid||null,gid:this.gid||null,size:t,mtime:this.mtime||null,type:this.global?"GlobalExtendedHeader":"ExtendedHeader",linkpath:"",uname:this.uname||"",gname:this.gname||"",devmaj:0,devmin:0,atime:this.atime||null,ctime:this.ctime||null}).encode(i),i.write(e,512,t,"utf8");for(let n=t+512;n<i.length;n++)i[n]=0;return i}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(e){if(this[e]===null||this[e]===void 0)return"";let t=this[e]instanceof Date?this[e].getTime()/1e3:this[e],s=" "+(e==="dev"||e==="ino"||e==="nlink"?"SCHILY.":"")+e+"="+t+`
3
- `,i=Buffer.byteLength(s),n=Math.floor(Math.log(i)/Math.log(10))+1;return i+n>=Math.pow(10,n)&&(n+=1),n+i+s}};Fr.parse=(r,e,t)=>new Fr(nf(of(r),e),t);var nf=(r,e)=>e?Object.keys(r).reduce((t,s)=>(t[s]=r[s],t),e):r,of=r=>r.replace(/\n$/,"").split(`
4
- `).reduce(uf,Object.create(null)),uf=(r,e)=>{let t=parseInt(e,10);if(t!==Buffer.byteLength(e)+1)return r;e=e.slice((t+" ").length);let s=e.split("="),i=s.shift().replace(/^SCHILY\.(dev|ino|nlink)/,"$1");if(!i)return r;let n=s.join("=");return r[i]=/^([A-Z]+\.)?([mac]|birth|creation)time$/.test(i)?new Date(n*1e3):/^[0-9]+$/.test(n)?+n:n,r};Lu.exports=Fr});var Vt=y((h0,Nu)=>{u();Nu.exports=r=>{let e=r.length-1,t=-1;for(;e>-1&&r.charAt(e)==="/";)t=e,e--;return t===-1?r:r.slice(0,t)}});var as=y((f0,Mu)=>{"use strict";u();Mu.exports=r=>class extends r{warn(e,t,s={}){this.file&&(s.file=this.file),this.cwd&&(s.cwd=this.cwd),s.code=t instanceof Error&&t.code||e,s.tarCode=e,!this.strict&&s.recoverable!==!1?(t instanceof Error&&(s=Object.assign(t,s),t=t.message),this.emit("warn",s.tarCode,t,s)):t instanceof Error?this.emit("error",Object.assign(t,s)):this.emit("error",Object.assign(new Error(`${e}: ${t}`),s))}}});var an=y((m0,Iu)=>{"use strict";u();var cs=["|","<",">","?",":"],un=cs.map(r=>String.fromCharCode(61440+r.charCodeAt(0))),af=new Map(cs.map((r,e)=>[r,un[e]])),cf=new Map(un.map((r,e)=>[r,cs[e]]));Iu.exports={encode:r=>cs.reduce((e,t)=>e.split(t).join(af.get(t)),r),decode:r=>un.reduce((e,t)=>e.split(t).join(cf.get(t)),r)}});var cn=y((d0,Uu)=>{u();var{isAbsolute:lf,parse:ju}=require("path").win32;Uu.exports=r=>{let e="",t=ju(r);for(;lf(r)||t.root;){let s=r.charAt(0)==="/"&&r.slice(0,4)!=="//?/"?"/":t.root;r=r.slice(s.length),e+=s,t=ju(r)}return[e,r]}});var $u=y((D0,qu)=>{"use strict";u();qu.exports=(r,e,t)=>(r&=4095,t&&(r=(r|384)&-19),e&&(r&256&&(r|=64),r&32&&(r|=8),r&4&&(r|=1)),r)});var yn=y((y0,ra)=>{"use strict";u();var Yu=Kr(),Ku=us(),Zu=Jt(),Ce=require("fs"),Wu=require("path"),Ae=Gt(),hf=Vt(),Xu=(r,e)=>e?(r=Ae(r).replace(/^\.(\/|$)/,""),hf(e)+"/"+r):Ae(r),ff=16*1024*1024,zu=Symbol("process"),Gu=Symbol("file"),Hu=Symbol("directory"),hn=Symbol("symlink"),Ju=Symbol("hardlink"),br=Symbol("header"),ls=Symbol("read"),fn=Symbol("lstat"),hs=Symbol("onlstat"),pn=Symbol("onread"),mn=Symbol("onreadlink"),dn=Symbol("openfile"),Dn=Symbol("onopenfile"),Xe=Symbol("close"),fs=Symbol("mode"),gn=Symbol("awaitDrain"),ln=Symbol("ondrain"),we=Symbol("prefix"),Vu=Symbol("hadError"),Qu=as(),pf=an(),ea=cn(),ta=$u(),ps=Qu(class extends Yu{constructor(e,t){if(t=t||{},super(t),typeof e!="string")throw new TypeError("path is required");this.path=Ae(e),this.portable=!!t.portable,this.myuid=process.getuid&&process.getuid()||0,this.myuser=process.env.USER||"",this.maxReadSize=t.maxReadSize||ff,this.linkCache=t.linkCache||new Map,this.statCache=t.statCache||new Map,this.preservePaths=!!t.preservePaths,this.cwd=Ae(t.cwd||process.cwd()),this.strict=!!t.strict,this.noPax=!!t.noPax,this.noMtime=!!t.noMtime,this.mtime=t.mtime||null,this.prefix=t.prefix?Ae(t.prefix):null,this.fd=null,this.blockLen=null,this.blockRemain=null,this.buf=null,this.offset=null,this.length=null,this.pos=null,this.remain=null,typeof t.onwarn=="function"&&this.on("warn",t.onwarn);let s=!1;if(!this.preservePaths){let[i,n]=ea(this.path);i&&(this.path=n,s=i)}this.win32=!!t.win32||process.platform==="win32",this.win32&&(this.path=pf.decode(this.path.replace(/\\/g,"/")),e=e.replace(/\\/g,"/")),this.absolute=Ae(t.absolute||Wu.resolve(this.cwd,e)),this.path===""&&(this.path="./"),s&&this.warn("TAR_ENTRY_INFO",`stripping ${s} from absolute path`,{entry:this,path:s+this.path}),this.statCache.has(this.absolute)?this[hs](this.statCache.get(this.absolute)):this[fn]()}emit(e,...t){return e==="error"&&(this[Vu]=!0),super.emit(e,...t)}[fn](){Ce.lstat(this.absolute,(e,t)=>{if(e)return this.emit("error",e);this[hs](t)})}[hs](e){this.statCache.set(this.absolute,e),this.stat=e,e.isFile()||(e.size=0),this.type=df(e),this.emit("stat",e),this[zu]()}[zu](){switch(this.type){case"File":return this[Gu]();case"Directory":return this[Hu]();case"SymbolicLink":return this[hn]();default:return this.end()}}[fs](e){return ta(e,this.type==="Directory",this.portable)}[we](e){return Xu(e,this.prefix)}[br](){this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.header=new Zu({path:this[we](this.path),linkpath:this.type==="Link"?this[we](this.linkpath):this.linkpath,mode:this[fs](this.stat.mode),uid:this.portable?null:this.stat.uid,gid:this.portable?null:this.stat.gid,size:this.stat.size,mtime:this.noMtime?null:this.mtime||this.stat.mtime,type:this.type,uname:this.portable?null:this.stat.uid===this.myuid?this.myuser:"",atime:this.portable?null:this.stat.atime,ctime:this.portable?null:this.stat.ctime}),this.header.encode()&&!this.noPax&&super.write(new Ku({atime:this.portable?null:this.header.atime,ctime:this.portable?null:this.header.ctime,gid:this.portable?null:this.header.gid,mtime:this.noMtime?null:this.mtime||this.header.mtime,path:this[we](this.path),linkpath:this.type==="Link"?this[we](this.linkpath):this.linkpath,size:this.header.size,uid:this.portable?null:this.header.uid,uname:this.portable?null:this.header.uname,dev:this.portable?null:this.stat.dev,ino:this.portable?null:this.stat.ino,nlink:this.portable?null:this.stat.nlink}).encode()),super.write(this.header.block)}[Hu](){this.path.slice(-1)!=="/"&&(this.path+="/"),this.stat.size=0,this[br](),this.end()}[hn](){Ce.readlink(this.absolute,(e,t)=>{if(e)return this.emit("error",e);this[mn](t)})}[mn](e){this.linkpath=Ae(e),this[br](),this.end()}[Ju](e){this.type="Link",this.linkpath=Ae(Wu.relative(this.cwd,e)),this.stat.size=0,this[br](),this.end()}[Gu](){if(this.stat.nlink>1){let e=this.stat.dev+":"+this.stat.ino;if(this.linkCache.has(e)){let t=this.linkCache.get(e);if(t.indexOf(this.cwd)===0)return this[Ju](t)}this.linkCache.set(e,this.absolute)}if(this[br](),this.stat.size===0)return this.end();this[dn]()}[dn](){Ce.open(this.absolute,"r",(e,t)=>{if(e)return this.emit("error",e);this[Dn](t)})}[Dn](e){if(this.fd=e,this[Vu])return this[Xe]();this.blockLen=512*Math.ceil(this.stat.size/512),this.blockRemain=this.blockLen;let t=Math.min(this.blockLen,this.maxReadSize);this.buf=Buffer.allocUnsafe(t),this.offset=0,this.pos=0,this.remain=this.stat.size,this.length=this.buf.length,this[ls]()}[ls](){let{fd:e,buf:t,offset:s,length:i,pos:n}=this;Ce.read(e,t,s,i,n,(o,a)=>{if(o)return this[Xe](()=>this.emit("error",o));this[pn](a)})}[Xe](e){Ce.close(this.fd,e)}[pn](e){if(e<=0&&this.remain>0){let i=new Error("encountered unexpected EOF");return i.path=this.absolute,i.syscall="read",i.code="EOF",this[Xe](()=>this.emit("error",i))}if(e>this.remain){let i=new Error("did not encounter expected EOF");return i.path=this.absolute,i.syscall="read",i.code="EOF",this[Xe](()=>this.emit("error",i))}if(e===this.remain)for(let i=e;i<this.length&&e<this.blockRemain;i++)this.buf[i+this.offset]=0,e++,this.remain++;let t=this.offset===0&&e===this.buf.length?this.buf:this.buf.slice(this.offset,this.offset+e);this.write(t)?this[ln]():this[gn](()=>this[ln]())}[gn](e){this.once("drain",e)}write(e){if(this.blockRemain<e.length){let t=new Error("writing more data than expected");return t.path=this.absolute,this.emit("error",t)}return this.remain-=e.length,this.blockRemain-=e.length,this.pos+=e.length,this.offset+=e.length,super.write(e)}[ln](){if(!this.remain)return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),this[Xe](e=>e?this.emit("error",e):this.end());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[ls]()}}),En=class extends ps{[fn](){this[hs](Ce.lstatSync(this.absolute))}[hn](){this[mn](Ce.readlinkSync(this.absolute))}[dn](){this[Dn](Ce.openSync(this.absolute,"r"))}[ls](){let e=!0;try{let{fd:t,buf:s,offset:i,length:n,pos:o}=this,a=Ce.readSync(t,s,i,n,o);this[pn](a),e=!1}finally{if(e)try{this[Xe](()=>{})}catch{}}}[gn](e){e()}[Xe](e){Ce.closeSync(this.fd),e()}},mf=Qu(class extends Yu{constructor(e,t){t=t||{},super(t),this.preservePaths=!!t.preservePaths,this.portable=!!t.portable,this.strict=!!t.strict,this.noPax=!!t.noPax,this.noMtime=!!t.noMtime,this.readEntry=e,this.type=e.type,this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.prefix=t.prefix||null,this.path=Ae(e.path),this.mode=this[fs](e.mode),this.uid=this.portable?null:e.uid,this.gid=this.portable?null:e.gid,this.uname=this.portable?null:e.uname,this.gname=this.portable?null:e.gname,this.size=e.size,this.mtime=this.noMtime?null:t.mtime||e.mtime,this.atime=this.portable?null:e.atime,this.ctime=this.portable?null:e.ctime,this.linkpath=Ae(e.linkpath),typeof t.onwarn=="function"&&this.on("warn",t.onwarn);let s=!1;if(!this.preservePaths){let[i,n]=ea(this.path);i&&(this.path=n,s=i)}this.remain=e.size,this.blockRemain=e.startBlockSize,this.header=new Zu({path:this[we](this.path),linkpath:this.type==="Link"?this[we](this.linkpath):this.linkpath,mode:this.mode,uid:this.portable?null:this.uid,gid:this.portable?null:this.gid,size:this.size,mtime:this.noMtime?null:this.mtime,type:this.type,uname:this.portable?null:this.uname,atime:this.portable?null:this.atime,ctime:this.portable?null:this.ctime}),s&&this.warn("TAR_ENTRY_INFO",`stripping ${s} from absolute path`,{entry:this,path:s+this.path}),this.header.encode()&&!this.noPax&&super.write(new Ku({atime:this.portable?null:this.atime,ctime:this.portable?null:this.ctime,gid:this.portable?null:this.gid,mtime:this.noMtime?null:this.mtime,path:this[we](this.path),linkpath:this.type==="Link"?this[we](this.linkpath):this.linkpath,size:this.size,uid:this.portable?null:this.uid,uname:this.portable?null:this.uname,dev:this.portable?null:this.readEntry.dev,ino:this.portable?null:this.readEntry.ino,nlink:this.portable?null:this.readEntry.nlink}).encode()),super.write(this.header.block),e.pipe(this)}[we](e){return Xu(e,this.prefix)}[fs](e){return ta(e,this.type==="Directory",this.portable)}write(e){let t=e.length;if(t>this.blockRemain)throw new Error("writing more to entry than is appropriate");return this.blockRemain-=t,super.write(e)}end(){return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),super.end()}});ps.Sync=En;ps.Tar=mf;var df=r=>r.isFile()?"File":r.isDirectory()?"Directory":r.isSymbolicLink()?"SymbolicLink":"Unsupported";ra.exports=ps});var ia=y((A0,sa)=>{"use strict";u();sa.exports=function(r){r.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}});var An=y((C0,na)=>{"use strict";u();na.exports=k;k.Node=At;k.create=k;function k(r){var e=this;if(e instanceof k||(e=new k),e.tail=null,e.head=null,e.length=0,r&&typeof r.forEach=="function")r.forEach(function(i){e.push(i)});else if(arguments.length>0)for(var t=0,s=arguments.length;t<s;t++)e.push(arguments[t]);return e}k.prototype.removeNode=function(r){if(r.list!==this)throw new Error("removing node which does not belong to this list");var e=r.next,t=r.prev;return e&&(e.prev=t),t&&(t.next=e),r===this.head&&(this.head=e),r===this.tail&&(this.tail=t),r.list.length--,r.next=null,r.prev=null,r.list=null,e};k.prototype.unshiftNode=function(r){if(r!==this.head){r.list&&r.list.removeNode(r);var e=this.head;r.list=this,r.next=e,e&&(e.prev=r),this.head=r,this.tail||(this.tail=r),this.length++}};k.prototype.pushNode=function(r){if(r!==this.tail){r.list&&r.list.removeNode(r);var e=this.tail;r.list=this,r.prev=e,e&&(e.next=r),this.tail=r,this.head||(this.head=r),this.length++}};k.prototype.push=function(){for(var r=0,e=arguments.length;r<e;r++)gf(this,arguments[r]);return this.length};k.prototype.unshift=function(){for(var r=0,e=arguments.length;r<e;r++)Ef(this,arguments[r]);return this.length};k.prototype.pop=function(){if(!!this.tail){var r=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,r}};k.prototype.shift=function(){if(!!this.head){var r=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,r}};k.prototype.forEach=function(r,e){e=e||this;for(var t=this.head,s=0;t!==null;s++)r.call(e,t.value,s,this),t=t.next};k.prototype.forEachReverse=function(r,e){e=e||this;for(var t=this.tail,s=this.length-1;t!==null;s--)r.call(e,t.value,s,this),t=t.prev};k.prototype.get=function(r){for(var e=0,t=this.head;t!==null&&e<r;e++)t=t.next;if(e===r&&t!==null)return t.value};k.prototype.getReverse=function(r){for(var e=0,t=this.tail;t!==null&&e<r;e++)t=t.prev;if(e===r&&t!==null)return t.value};k.prototype.map=function(r,e){e=e||this;for(var t=new k,s=this.head;s!==null;)t.push(r.call(e,s.value,this)),s=s.next;return t};k.prototype.mapReverse=function(r,e){e=e||this;for(var t=new k,s=this.tail;s!==null;)t.push(r.call(e,s.value,this)),s=s.prev;return t};k.prototype.reduce=function(r,e){var t,s=this.head;if(arguments.length>1)t=e;else if(this.head)s=this.head.next,t=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=0;s!==null;i++)t=r(t,s.value,i),s=s.next;return t};k.prototype.reduceReverse=function(r,e){var t,s=this.tail;if(arguments.length>1)t=e;else if(this.tail)s=this.tail.prev,t=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=this.length-1;s!==null;i--)t=r(t,s.value,i),s=s.prev;return t};k.prototype.toArray=function(){for(var r=new Array(this.length),e=0,t=this.head;t!==null;e++)r[e]=t.value,t=t.next;return r};k.prototype.toArrayReverse=function(){for(var r=new Array(this.length),e=0,t=this.tail;t!==null;e++)r[e]=t.value,t=t.prev;return r};k.prototype.slice=function(r,e){e=e||this.length,e<0&&(e+=this.length),r=r||0,r<0&&(r+=this.length);var t=new k;if(e<r||e<0)return t;r<0&&(r=0),e>this.length&&(e=this.length);for(var s=0,i=this.head;i!==null&&s<r;s++)i=i.next;for(;i!==null&&s<e;s++,i=i.next)t.push(i.value);return t};k.prototype.sliceReverse=function(r,e){e=e||this.length,e<0&&(e+=this.length),r=r||0,r<0&&(r+=this.length);var t=new k;if(e<r||e<0)return t;r<0&&(r=0),e>this.length&&(e=this.length);for(var s=this.length,i=this.tail;i!==null&&s>e;s--)i=i.prev;for(;i!==null&&s>r;s--,i=i.prev)t.push(i.value);return t};k.prototype.splice=function(r,e,...t){r>this.length&&(r=this.length-1),r<0&&(r=this.length+r);for(var s=0,i=this.head;i!==null&&s<r;s++)i=i.next;for(var n=[],s=0;i&&s<e;s++)n.push(i.value),i=this.removeNode(i);i===null&&(i=this.tail),i!==this.head&&i!==this.tail&&(i=i.prev);for(var s=0;s<t.length;s++)i=Df(this,i,t[s]);return n};k.prototype.reverse=function(){for(var r=this.head,e=this.tail,t=r;t!==null;t=t.prev){var s=t.prev;t.prev=t.next,t.next=s}return this.head=e,this.tail=r,this};function Df(r,e,t){var s=e===r.head?new At(t,null,e,r):new At(t,e,e.next,r);return s.next===null&&(r.tail=s),s.prev===null&&(r.head=s),r.length++,s}function gf(r,e){r.tail=new At(e,r.tail,null,r),r.head||(r.head=r.tail),r.length++}function Ef(r,e){r.head=new At(e,null,r.head,r),r.tail||(r.tail=r.head),r.length++}function At(r,e,t,s){if(!(this instanceof At))return new At(r,e,t,s);this.list=s,this.value=r,e?(e.next=this,this.prev=e):this.prev=null,t?(t.prev=this,this.next=t):this.next=null}try{ia()(k)}catch{}});var ws=y((F0,fa)=>{"use strict";u();var As=class{constructor(e,t){this.path=e||"./",this.absolute=t,this.entry=null,this.stat=null,this.readdir=null,this.pending=!1,this.ignore=!1,this.piped=!1}},yf=Kr(),Af=Zi(),Cf=ns(),Rn=yn(),wf=Rn.Sync,Ff=Rn.Tar,bf=An(),oa=Buffer.alloc(1024),Ds=Symbol("onStat"),ms=Symbol("ended"),Fe=Symbol("queue"),Yt=Symbol("current"),Ct=Symbol("process"),ds=Symbol("processing"),ua=Symbol("processJob"),be=Symbol("jobs"),Cn=Symbol("jobDone"),gs=Symbol("addFSEntry"),aa=Symbol("addTarEntry"),Sn=Symbol("stat"),kn=Symbol("readdir"),Es=Symbol("onreaddir"),ys=Symbol("pipe"),ca=Symbol("entry"),wn=Symbol("entryOpt"),_n=Symbol("writeEntryClass"),ha=Symbol("write"),Fn=Symbol("ondrain"),Cs=require("fs"),la=require("path"),Sf=as(),bn=Gt(),Bn=Sf(class extends yf{constructor(e){super(e),e=e||Object.create(null),this.opt=e,this.file=e.file||"",this.cwd=e.cwd||process.cwd(),this.maxReadSize=e.maxReadSize,this.preservePaths=!!e.preservePaths,this.strict=!!e.strict,this.noPax=!!e.noPax,this.prefix=bn(e.prefix||""),this.linkCache=e.linkCache||new Map,this.statCache=e.statCache||new Map,this.readdirCache=e.readdirCache||new Map,this[_n]=Rn,typeof e.onwarn=="function"&&this.on("warn",e.onwarn),this.portable=!!e.portable,this.zip=null,e.gzip?(typeof e.gzip!="object"&&(e.gzip={}),this.portable&&(e.gzip.portable=!0),this.zip=new Af.Gzip(e.gzip),this.zip.on("data",t=>super.write(t)),this.zip.on("end",t=>super.end()),this.zip.on("drain",t=>this[Fn]()),this.on("resume",t=>this.zip.resume())):this.on("drain",this[Fn]),this.noDirRecurse=!!e.noDirRecurse,this.follow=!!e.follow,this.noMtime=!!e.noMtime,this.mtime=e.mtime||null,this.filter=typeof e.filter=="function"?e.filter:t=>!0,this[Fe]=new bf,this[be]=0,this.jobs=+e.jobs||4,this[ds]=!1,this[ms]=!1}[ha](e){return super.write(e)}add(e){return this.write(e),this}end(e){return e&&this.write(e),this[ms]=!0,this[Ct](),this}write(e){if(this[ms])throw new Error("write after end");return e instanceof Cf?this[aa](e):this[gs](e),this.flowing}[aa](e){let t=bn(la.resolve(this.cwd,e.path));if(!this.filter(e.path,e))e.resume();else{let s=new As(e.path,t,!1);s.entry=new Ff(e,this[wn](s)),s.entry.on("end",i=>this[Cn](s)),this[be]+=1,this[Fe].push(s)}this[Ct]()}[gs](e){let t=bn(la.resolve(this.cwd,e));this[Fe].push(new As(e,t)),this[Ct]()}[Sn](e){e.pending=!0,this[be]+=1;let t=this.follow?"stat":"lstat";Cs[t](e.absolute,(s,i)=>{e.pending=!1,this[be]-=1,s?this.emit("error",s):this[Ds](e,i)})}[Ds](e,t){this.statCache.set(e.absolute,t),e.stat=t,this.filter(e.path,t)||(e.ignore=!0),this[Ct]()}[kn](e){e.pending=!0,this[be]+=1,Cs.readdir(e.absolute,(t,s)=>{if(e.pending=!1,this[be]-=1,t)return this.emit("error",t);this[Es](e,s)})}[Es](e,t){this.readdirCache.set(e.absolute,t),e.readdir=t,this[Ct]()}[Ct](){if(!this[ds]){this[ds]=!0;for(let e=this[Fe].head;e!==null&&this[be]<this.jobs;e=e.next)if(this[ua](e.value),e.value.ignore){let t=e.next;this[Fe].removeNode(e),e.next=t}this[ds]=!1,this[ms]&&!this[Fe].length&&this[be]===0&&(this.zip?this.zip.end(oa):(super.write(oa),super.end()))}}get[Yt](){return this[Fe]&&this[Fe].head&&this[Fe].head.value}[Cn](e){this[Fe].shift(),this[be]-=1,this[Ct]()}[ua](e){if(!e.pending){if(e.entry){e===this[Yt]&&!e.piped&&this[ys](e);return}if(e.stat||(this.statCache.has(e.absolute)?this[Ds](e,this.statCache.get(e.absolute)):this[Sn](e)),!!e.stat&&!e.ignore&&!(!this.noDirRecurse&&e.stat.isDirectory()&&!e.readdir&&(this.readdirCache.has(e.absolute)?this[Es](e,this.readdirCache.get(e.absolute)):this[kn](e),!e.readdir))){if(e.entry=this[ca](e),!e.entry){e.ignore=!0;return}e===this[Yt]&&!e.piped&&this[ys](e)}}}[wn](e){return{onwarn:(t,s,i)=>this.warn(t,s,i),noPax:this.noPax,cwd:this.cwd,absolute:e.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}}[ca](e){this[be]+=1;try{return new this[_n](e.path,this[wn](e)).on("end",()=>this[Cn](e)).on("error",t=>this.emit("error",t))}catch(t){this.emit("error",t)}}[Fn](){this[Yt]&&this[Yt].entry&&this[Yt].entry.resume()}[ys](e){e.piped=!0,e.readdir&&e.readdir.forEach(i=>{let n=e.path,o=n==="./"?"":n.replace(/\/*$/,"/");this[gs](o+i)});let t=e.entry,s=this.zip;s?t.on("data",i=>{s.write(i)||t.pause()}):t.on("data",i=>{super.write(i)||t.pause()})}pause(){return this.zip&&this.zip.pause(),super.pause()}}),vn=class extends Bn{constructor(e){super(e),this[_n]=wf}pause(){}resume(){}[Sn](e){let t=this.follow?"statSync":"lstatSync";this[Ds](e,Cs[t](e.absolute))}[kn](e,t){this[Es](e,Cs.readdirSync(e.absolute))}[ys](e){let t=e.entry,s=this.zip;e.readdir&&e.readdir.forEach(i=>{let n=e.path,o=n==="./"?"":n.replace(/\/*$/,"/");this[gs](o+i)}),s?t.on("data",i=>{s.write(i)}):t.on("data",i=>{super[ha](i)})}};Bn.Sync=vn;fa.exports=Bn});var sr=y(kr=>{"use strict";u();var kf=Li(),_f=require("events").EventEmitter,K=require("fs"),Pn=K.writev;if(!Pn){let r=process.binding("fs"),e=r.FSReqWrap||r.FSReqCallback;Pn=(t,s,i,n)=>{let o=(l,c)=>n(l,c,s),a=new e;a.oncomplete=o,r.writeBuffers(t,s,i,a)}}var tr=Symbol("_autoClose"),de=Symbol("_close"),Sr=Symbol("_ended"),R=Symbol("_fd"),pa=Symbol("_finished"),et=Symbol("_flags"),xn=Symbol("_flush"),Tn=Symbol("_handleChunk"),Ln=Symbol("_makeBuf"),_s=Symbol("_mode"),Fs=Symbol("_needDrain"),Qt=Symbol("_onerror"),rr=Symbol("_onopen"),On=Symbol("_onread"),Zt=Symbol("_onwrite"),tt=Symbol("_open"),Ie=Symbol("_path"),wt=Symbol("_pos"),Se=Symbol("_queue"),Xt=Symbol("_read"),ma=Symbol("_readSize"),Qe=Symbol("_reading"),bs=Symbol("_remain"),da=Symbol("_size"),Ss=Symbol("_write"),Kt=Symbol("_writing"),ks=Symbol("_defaultFlag"),er=Symbol("_errored"),vs=class extends kf{constructor(e,t){if(t=t||{},super(t),this.readable=!0,this.writable=!1,typeof e!="string")throw new TypeError("path must be a string");this[er]=!1,this[R]=typeof t.fd=="number"?t.fd:null,this[Ie]=e,this[ma]=t.readSize||16*1024*1024,this[Qe]=!1,this[da]=typeof t.size=="number"?t.size:1/0,this[bs]=this[da],this[tr]=typeof t.autoClose=="boolean"?t.autoClose:!0,typeof this[R]=="number"?this[Xt]():this[tt]()}get fd(){return this[R]}get path(){return this[Ie]}write(){throw new TypeError("this is a readable stream")}end(){throw new TypeError("this is a readable stream")}[tt](){K.open(this[Ie],"r",(e,t)=>this[rr](e,t))}[rr](e,t){e?this[Qt](e):(this[R]=t,this.emit("open",t),this[Xt]())}[Ln](){return Buffer.allocUnsafe(Math.min(this[ma],this[bs]))}[Xt](){if(!this[Qe]){this[Qe]=!0;let e=this[Ln]();if(e.length===0)return process.nextTick(()=>this[On](null,0,e));K.read(this[R],e,0,e.length,null,(t,s,i)=>this[On](t,s,i))}}[On](e,t,s){this[Qe]=!1,e?this[Qt](e):this[Tn](t,s)&&this[Xt]()}[de](){if(this[tr]&&typeof this[R]=="number"){let e=this[R];this[R]=null,K.close(e,t=>t?this.emit("error",t):this.emit("close"))}}[Qt](e){this[Qe]=!0,this[de](),this.emit("error",e)}[Tn](e,t){let s=!1;return this[bs]-=e,e>0&&(s=super.write(e<t.length?t.slice(0,e):t)),(e===0||this[bs]<=0)&&(s=!1,this[de](),super.end()),s}emit(e,t){switch(e){case"prefinish":case"finish":break;case"drain":typeof this[R]=="number"&&this[Xt]();break;case"error":return this[er]?void 0:(this[er]=!0,super.emit(e,t));default:return super.emit(e,t)}}},Nn=class extends vs{[tt](){let e=!0;try{this[rr](null,K.openSync(this[Ie],"r")),e=!1}finally{e&&this[de]()}}[Xt](){let e=!0;try{if(!this[Qe]){this[Qe]=!0;do{let t=this[Ln](),s=t.length===0?0:K.readSync(this[R],t,0,t.length,null);if(!this[Tn](s,t))break}while(!0);this[Qe]=!1}e=!1}finally{e&&this[de]()}}[de](){if(this[tr]&&typeof this[R]=="number"){let e=this[R];this[R]=null,K.closeSync(e),this.emit("close")}}},Rs=class extends _f{constructor(e,t){t=t||{},super(t),this.readable=!1,this.writable=!0,this[er]=!1,this[Kt]=!1,this[Sr]=!1,this[Fs]=!1,this[Se]=[],this[Ie]=e,this[R]=typeof t.fd=="number"?t.fd:null,this[_s]=t.mode===void 0?438:t.mode,this[wt]=typeof t.start=="number"?t.start:null,this[tr]=typeof t.autoClose=="boolean"?t.autoClose:!0;let s=this[wt]!==null?"r+":"w";this[ks]=t.flags===void 0,this[et]=this[ks]?s:t.flags,this[R]===null&&this[tt]()}emit(e,t){if(e==="error"){if(this[er])return;this[er]=!0}return super.emit(e,t)}get fd(){return this[R]}get path(){return this[Ie]}[Qt](e){this[de](),this[Kt]=!0,this.emit("error",e)}[tt](){K.open(this[Ie],this[et],this[_s],(e,t)=>this[rr](e,t))}[rr](e,t){this[ks]&&this[et]==="r+"&&e&&e.code==="ENOENT"?(this[et]="w",this[tt]()):e?this[Qt](e):(this[R]=t,this.emit("open",t),this[xn]())}end(e,t){return e&&this.write(e,t),this[Sr]=!0,!this[Kt]&&!this[Se].length&&typeof this[R]=="number"&&this[Zt](null,0),this}write(e,t){return typeof e=="string"&&(e=Buffer.from(e,t)),this[Sr]?(this.emit("error",new Error("write() after end()")),!1):this[R]===null||this[Kt]||this[Se].length?(this[Se].push(e),this[Fs]=!0,!1):(this[Kt]=!0,this[Ss](e),!0)}[Ss](e){K.write(this[R],e,0,e.length,this[wt],(t,s)=>this[Zt](t,s))}[Zt](e,t){e?this[Qt](e):(this[wt]!==null&&(this[wt]+=t),this[Se].length?this[xn]():(this[Kt]=!1,this[Sr]&&!this[pa]?(this[pa]=!0,this[de](),this.emit("finish")):this[Fs]&&(this[Fs]=!1,this.emit("drain"))))}[xn](){if(this[Se].length===0)this[Sr]&&this[Zt](null,0);else if(this[Se].length===1)this[Ss](this[Se].pop());else{let e=this[Se];this[Se]=[],Pn(this[R],e,this[wt],(t,s)=>this[Zt](t,s))}}[de](){if(this[tr]&&typeof this[R]=="number"){let e=this[R];this[R]=null,K.close(e,t=>t?this.emit("error",t):this.emit("close"))}}},Mn=class extends Rs{[tt](){let e;if(this[ks]&&this[et]==="r+")try{e=K.openSync(this[Ie],this[et],this[_s])}catch(t){if(t.code==="ENOENT")return this[et]="w",this[tt]();throw t}else e=K.openSync(this[Ie],this[et],this[_s]);this[rr](null,e)}[de](){if(this[tr]&&typeof this[R]=="number"){let e=this[R];this[R]=null,K.closeSync(e),this.emit("close")}}[Ss](e){let t=!0;try{this[Zt](null,K.writeSync(this[R],e,0,e.length,this[wt])),t=!1}finally{if(t)try{this[de]()}catch{}}}};kr.ReadStream=vs;kr.ReadStreamSync=Nn;kr.WriteStream=Rs;kr.WriteStreamSync=Mn});var Ns=y((k0,Fa)=>{"use strict";u();var vf=as(),Rf=Jt(),Bf=require("events"),xf=An(),Of=1024*1024,Pf=ns(),Da=us(),Tf=Zi(),{nextTick:Lf}=require("process"),In=Buffer.from([31,139]),oe=Symbol("state"),Ft=Symbol("writeEntry"),je=Symbol("readEntry"),jn=Symbol("nextEntry"),ga=Symbol("processEntry"),ue=Symbol("extendedHeader"),_r=Symbol("globalExtendedHeader"),rt=Symbol("meta"),Ea=Symbol("emitMeta"),O=Symbol("buffer"),Ue=Symbol("queue"),bt=Symbol("ended"),ya=Symbol("emittedEnd"),St=Symbol("emit"),Z=Symbol("unzip"),Bs=Symbol("consumeChunk"),xs=Symbol("consumeChunkSub"),Un=Symbol("consumeBody"),Aa=Symbol("consumeMeta"),Ca=Symbol("consumeHeader"),Os=Symbol("consuming"),qn=Symbol("bufferConcat"),$n=Symbol("maybeEnd"),vr=Symbol("writing"),st=Symbol("aborted"),Ps=Symbol("onDone"),kt=Symbol("sawValidEntry"),Ts=Symbol("sawNullBlock"),Ls=Symbol("sawEOF"),wa=Symbol("closeStream"),Nf=r=>!0;Fa.exports=vf(class extends Bf{constructor(e){e=e||{},super(e),this.file=e.file||"",this[kt]=null,this.on(Ps,t=>{(this[oe]==="begin"||this[kt]===!1)&&this.warn("TAR_BAD_ARCHIVE","Unrecognized archive format")}),e.ondone?this.on(Ps,e.ondone):this.on(Ps,t=>{this.emit("prefinish"),this.emit("finish"),this.emit("end")}),this.strict=!!e.strict,this.maxMetaEntrySize=e.maxMetaEntrySize||Of,this.filter=typeof e.filter=="function"?e.filter:Nf,this.writable=!0,this.readable=!1,this[Ue]=new xf,this[O]=null,this[je]=null,this[Ft]=null,this[oe]="begin",this[rt]="",this[ue]=null,this[_r]=null,this[bt]=!1,this[Z]=null,this[st]=!1,this[Ts]=!1,this[Ls]=!1,this.on("end",()=>this[wa]()),typeof e.onwarn=="function"&&this.on("warn",e.onwarn),typeof e.onentry=="function"&&this.on("entry",e.onentry)}[Ca](e,t){this[kt]===null&&(this[kt]=!1);let s;try{s=new Rf(e,t,this[ue],this[_r])}catch(i){return this.warn("TAR_ENTRY_INVALID",i)}if(s.nullBlock)this[Ts]?(this[Ls]=!0,this[oe]==="begin"&&(this[oe]="header"),this[St]("eof")):(this[Ts]=!0,this[St]("nullBlock"));else if(this[Ts]=!1,!s.cksumValid)this.warn("TAR_ENTRY_INVALID","checksum failure",{header:s});else if(!s.path)this.warn("TAR_ENTRY_INVALID","path is required",{header:s});else{let i=s.type;if(/^(Symbolic)?Link$/.test(i)&&!s.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath required",{header:s});else if(!/^(Symbolic)?Link$/.test(i)&&s.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath forbidden",{header:s});else{let n=this[Ft]=new Pf(s,this[ue],this[_r]);if(!this[kt])if(n.remain){let o=()=>{n.invalid||(this[kt]=!0)};n.on("end",o)}else this[kt]=!0;n.meta?n.size>this.maxMetaEntrySize?(n.ignore=!0,this[St]("ignoredEntry",n),this[oe]="ignore",n.resume()):n.size>0&&(this[rt]="",n.on("data",o=>this[rt]+=o),this[oe]="meta"):(this[ue]=null,n.ignore=n.ignore||!this.filter(n.path,n),n.ignore?(this[St]("ignoredEntry",n),this[oe]=n.remain?"ignore":"header",n.resume()):(n.remain?this[oe]="body":(this[oe]="header",n.end()),this[je]?this[Ue].push(n):(this[Ue].push(n),this[jn]())))}}}[wa](){Lf(()=>this.emit("close"))}[ga](e){let t=!0;return e?Array.isArray(e)?this.emit.apply(this,e):(this[je]=e,this.emit("entry",e),e.emittedEnd||(e.on("end",s=>this[jn]()),t=!1)):(this[je]=null,t=!1),t}[jn](){do;while(this[ga](this[Ue].shift()));if(!this[Ue].length){let e=this[je];!e||e.flowing||e.size===e.remain?this[vr]||this.emit("drain"):e.once("drain",s=>this.emit("drain"))}}[Un](e,t){let s=this[Ft],i=s.blockRemain,n=i>=e.length&&t===0?e:e.slice(t,t+i);return s.write(n),s.blockRemain||(this[oe]="header",this[Ft]=null,s.end()),n.length}[Aa](e,t){let s=this[Ft],i=this[Un](e,t);return this[Ft]||this[Ea](s),i}[St](e,t,s){!this[Ue].length&&!this[je]?this.emit(e,t,s):this[Ue].push([e,t,s])}[Ea](e){switch(this[St]("meta",this[rt]),e.type){case"ExtendedHeader":case"OldExtendedHeader":this[ue]=Da.parse(this[rt],this[ue],!1);break;case"GlobalExtendedHeader":this[_r]=Da.parse(this[rt],this[_r],!0);break;case"NextFileHasLongPath":case"OldGnuLongPath":this[ue]=this[ue]||Object.create(null),this[ue].path=this[rt].replace(/\0.*/,"");break;case"NextFileHasLongLinkpath":this[ue]=this[ue]||Object.create(null),this[ue].linkpath=this[rt].replace(/\0.*/,"");break;default:throw new Error("unknown meta: "+e.type)}}abort(e){this[st]=!0,this.emit("abort",e),this.warn("TAR_ABORT",e,{recoverable:!1})}write(e){if(this[st])return;if(this[Z]===null&&e){if(this[O]&&(e=Buffer.concat([this[O],e]),this[O]=null),e.length<In.length)return this[O]=e,!0;for(let s=0;this[Z]===null&&s<In.length;s++)e[s]!==In[s]&&(this[Z]=!1);if(this[Z]===null){let s=this[bt];this[bt]=!1,this[Z]=new Tf.Unzip,this[Z].on("data",n=>this[Bs](n)),this[Z].on("error",n=>this.abort(n)),this[Z].on("end",n=>{this[bt]=!0,this[Bs]()}),this[vr]=!0;let i=this[Z][s?"end":"write"](e);return this[vr]=!1,i}}this[vr]=!0,this[Z]?this[Z].write(e):this[Bs](e),this[vr]=!1;let t=this[Ue].length?!1:this[je]?this[je].flowing:!0;return!t&&!this[Ue].length&&this[je].once("drain",s=>this.emit("drain")),t}[qn](e){e&&!this[st]&&(this[O]=this[O]?Buffer.concat([this[O],e]):e)}[$n](){if(this[bt]&&!this[ya]&&!this[st]&&!this[Os]){this[ya]=!0;let e=this[Ft];if(e&&e.blockRemain){let t=this[O]?this[O].length:0;this.warn("TAR_BAD_ARCHIVE",`Truncated input (needed ${e.blockRemain} more bytes, only ${t} available)`,{entry:e}),this[O]&&e.write(this[O]),e.end()}this[St](Ps)}}[Bs](e){if(this[Os])this[qn](e);else if(!e&&!this[O])this[$n]();else{if(this[Os]=!0,this[O]){this[qn](e);let t=this[O];this[O]=null,this[xs](t)}else this[xs](e);for(;this[O]&&this[O].length>=512&&!this[st]&&!this[Ls];){let t=this[O];this[O]=null,this[xs](t)}this[Os]=!1}(!this[O]||this[bt])&&this[$n]()}[xs](e){let t=0,s=e.length;for(;t+512<=s&&!this[st]&&!this[Ls];)switch(this[oe]){case"begin":case"header":this[Ca](e,t),t+=512;break;case"ignore":case"body":t+=this[Un](e,t);break;case"meta":t+=this[Aa](e,t);break;default:throw new Error("invalid state: "+this[oe])}t<s&&(this[O]?this[O]=Buffer.concat([e.slice(t),this[O]]):this[O]=e.slice(t))}end(e){this[st]||(this[Z]?this[Z].end(e):(this[bt]=!0,this.write(e)))}})});var Ms=y((_0,_a)=>{"use strict";u();var Mf=Ut(),Sa=Ns(),ir=require("fs"),If=sr(),ba=require("path"),Wn=Vt();_a.exports=(r,e,t)=>{typeof r=="function"?(t=r,e=null,r={}):Array.isArray(r)&&(e=r,r={}),typeof e=="function"&&(t=e,e=null),e?e=Array.from(e):e=[];let s=Mf(r);if(s.sync&&typeof t=="function")throw new TypeError("callback not supported for sync tar functions");if(!s.file&&typeof t=="function")throw new TypeError("callback only supported with file option");return e.length&&Uf(s,e),s.noResume||jf(s),s.file&&s.sync?qf(s):s.file?$f(s,t):ka(s)};var jf=r=>{let e=r.onentry;r.onentry=e?t=>{e(t),t.resume()}:t=>t.resume()},Uf=(r,e)=>{let t=new Map(e.map(n=>[Wn(n),!0])),s=r.filter,i=(n,o)=>{let a=o||ba.parse(n).root||".",l=n===a?!1:t.has(n)?t.get(n):i(ba.dirname(n),a);return t.set(n,l),l};r.filter=s?(n,o)=>s(n,o)&&i(Wn(n)):n=>i(Wn(n))},qf=r=>{let e=ka(r),t=r.file,s=!0,i;try{let n=ir.statSync(t),o=r.maxReadSize||16*1024*1024;if(n.size<o)e.end(ir.readFileSync(t));else{let a=0,l=Buffer.allocUnsafe(o);for(i=ir.openSync(t,"r");a<n.size;){let c=ir.readSync(i,l,0,o,a);a+=c,e.write(l.slice(0,c))}e.end()}s=!1}finally{if(s&&i)try{ir.closeSync(i)}catch{}}},$f=(r,e)=>{let t=new Sa(r),s=r.maxReadSize||16*1024*1024,i=r.file,n=new Promise((o,a)=>{t.on("error",a),t.on("end",o),ir.stat(i,(l,c)=>{if(l)a(l);else{let h=new If.ReadStream(i,{readSize:s,size:c.size});h.on("error",a),h.pipe(t)}})});return e?n.then(e,e):n},ka=r=>new Sa(r)});var Pa=y((v0,Oa)=>{"use strict";u();var Wf=Ut(),Is=ws(),va=sr(),Ra=Ms(),Ba=require("path");Oa.exports=(r,e,t)=>{if(typeof e=="function"&&(t=e),Array.isArray(r)&&(e=r,r={}),!e||!Array.isArray(e)||!e.length)throw new TypeError("no files or directories specified");e=Array.from(e);let s=Wf(r);if(s.sync&&typeof t=="function")throw new TypeError("callback not supported for sync tar functions");if(!s.file&&typeof t=="function")throw new TypeError("callback only supported with file option");return s.file&&s.sync?zf(s,e):s.file?Gf(s,e,t):s.sync?Hf(s,e):Jf(s,e)};var zf=(r,e)=>{let t=new Is.Sync(r),s=new va.WriteStreamSync(r.file,{mode:r.mode||438});t.pipe(s),xa(t,e)},Gf=(r,e,t)=>{let s=new Is(r),i=new va.WriteStream(r.file,{mode:r.mode||438});s.pipe(i);let n=new Promise((o,a)=>{i.on("error",a),i.on("close",o),s.on("error",a)});return zn(s,e),t?n.then(t,t):n},xa=(r,e)=>{e.forEach(t=>{t.charAt(0)==="@"?Ra({file:Ba.resolve(r.cwd,t.slice(1)),sync:!0,noResume:!0,onentry:s=>r.add(s)}):r.add(t)}),r.end()},zn=(r,e)=>{for(;e.length;){let t=e.shift();if(t.charAt(0)==="@")return Ra({file:Ba.resolve(r.cwd,t.slice(1)),noResume:!0,onentry:s=>r.add(s)}).then(s=>zn(r,e));r.add(t)}r.end()},Hf=(r,e)=>{let t=new Is.Sync(r);return xa(t,e),t},Jf=(r,e)=>{let t=new Is(r);return zn(t,e),t}});var Gn=y((R0,Ua)=>{"use strict";u();var Vf=Ut(),Ta=ws(),te=require("fs"),La=sr(),Na=Ms(),Ma=require("path"),Ia=Jt();Ua.exports=(r,e,t)=>{let s=Vf(r);if(!s.file)throw new TypeError("file is required");if(s.gzip)throw new TypeError("cannot append to compressed archives");if(!e||!Array.isArray(e)||!e.length)throw new TypeError("no files or directories specified");return e=Array.from(e),s.sync?Yf(s,e):Zf(s,e,t)};var Yf=(r,e)=>{let t=new Ta.Sync(r),s=!0,i,n;try{try{i=te.openSync(r.file,"r+")}catch(l){if(l.code==="ENOENT")i=te.openSync(r.file,"w+");else throw l}let o=te.fstatSync(i),a=Buffer.alloc(512);e:for(n=0;n<o.size;n+=512){for(let h=0,d=0;h<512;h+=d){if(d=te.readSync(i,a,h,a.length-h,n+h),n===0&&a[0]===31&&a[1]===139)throw new Error("cannot append to compressed archives");if(!d)break e}let l=new Ia(a);if(!l.cksumValid)break;let c=512*Math.ceil(l.size/512);if(n+c+512>o.size)break;n+=c,r.mtimeCache&&r.mtimeCache.set(l.path,l.mtime)}s=!1,Kf(r,t,n,i,e)}finally{if(s)try{te.closeSync(i)}catch{}}},Kf=(r,e,t,s,i)=>{let n=new La.WriteStreamSync(r.file,{fd:s,start:t});e.pipe(n),Xf(e,i)},Zf=(r,e,t)=>{e=Array.from(e);let s=new Ta(r),i=(o,a,l)=>{let c=(w,P)=>{w?te.close(o,S=>l(w)):l(null,P)},h=0;if(a===0)return c(null,0);let d=0,p=Buffer.alloc(512),E=(w,P)=>{if(w)return c(w);if(d+=P,d<512&&P)return te.read(o,p,d,p.length-d,h+d,E);if(h===0&&p[0]===31&&p[1]===139)return c(new Error("cannot append to compressed archives"));if(d<512)return c(null,h);let S=new Ia(p);if(!S.cksumValid)return c(null,h);let x=512*Math.ceil(S.size/512);if(h+x+512>a||(h+=x+512,h>=a))return c(null,h);r.mtimeCache&&r.mtimeCache.set(S.path,S.mtime),d=0,te.read(o,p,0,512,h,E)};te.read(o,p,0,512,h,E)},n=new Promise((o,a)=>{s.on("error",a);let l="r+",c=(h,d)=>{if(h&&h.code==="ENOENT"&&l==="r+")return l="w+",te.open(r.file,l,c);if(h)return a(h);te.fstat(d,(p,E)=>{if(p)return te.close(d,()=>a(p));i(d,E.size,(w,P)=>{if(w)return a(w);let S=new La.WriteStream(r.file,{fd:d,start:P});s.pipe(S),S.on("error",a),S.on("close",o),ja(s,e)})})};te.open(r.file,l,c)});return t?n.then(t,t):n},Xf=(r,e)=>{e.forEach(t=>{t.charAt(0)==="@"?Na({file:Ma.resolve(r.cwd,t.slice(1)),sync:!0,noResume:!0,onentry:s=>r.add(s)}):r.add(t)}),r.end()},ja=(r,e)=>{for(;e.length;){let t=e.shift();if(t.charAt(0)==="@")return Na({file:Ma.resolve(r.cwd,t.slice(1)),noResume:!0,onentry:s=>r.add(s)}).then(s=>ja(r,e));r.add(t)}r.end()}});var $a=y((B0,qa)=>{"use strict";u();var Qf=Ut(),ep=Gn();qa.exports=(r,e,t)=>{let s=Qf(r);if(!s.file)throw new TypeError("file is required");if(s.gzip)throw new TypeError("cannot append to compressed archives");if(!e||!Array.isArray(e)||!e.length)throw new TypeError("no files or directories specified");return e=Array.from(e),tp(s),ep(s,e,t)};var tp=r=>{let e=r.filter;r.mtimeCache||(r.mtimeCache=new Map),r.filter=e?(t,s)=>e(t,s)&&!(r.mtimeCache.get(t)>s.mtime):(t,s)=>!(r.mtimeCache.get(t)>s.mtime)}});var Ga=y((x0,za)=>{u();var{promisify:Wa}=require("util"),it=require("fs"),rp=r=>{if(!r)r={mode:511,fs:it};else if(typeof r=="object")r={mode:511,fs:it,...r};else if(typeof r=="number")r={mode:r,fs:it};else if(typeof r=="string")r={mode:parseInt(r,8),fs:it};else throw new TypeError("invalid options argument");return r.mkdir=r.mkdir||r.fs.mkdir||it.mkdir,r.mkdirAsync=Wa(r.mkdir),r.stat=r.stat||r.fs.stat||it.stat,r.statAsync=Wa(r.stat),r.statSync=r.statSync||r.fs.statSync||it.statSync,r.mkdirSync=r.mkdirSync||r.fs.mkdirSync||it.mkdirSync,r};za.exports=rp});var Ja=y((O0,Ha)=>{u();var sp=process.env.__TESTING_MKDIRP_PLATFORM__||process.platform,{resolve:ip,parse:np}=require("path"),op=r=>{if(/\0/.test(r))throw Object.assign(new TypeError("path must be a string without null bytes"),{path:r,code:"ERR_INVALID_ARG_VALUE"});if(r=ip(r),sp==="win32"){let e=/[*|"<>?:]/,{root:t}=np(r);if(e.test(r.substr(t.length)))throw Object.assign(new Error("Illegal characters in path."),{path:r,code:"EINVAL"})}return r};Ha.exports=op});var Xa=y((P0,Za)=>{u();var{dirname:Va}=require("path"),Ya=(r,e,t=void 0)=>t===e?Promise.resolve():r.statAsync(e).then(s=>s.isDirectory()?t:void 0,s=>s.code==="ENOENT"?Ya(r,Va(e),e):void 0),Ka=(r,e,t=void 0)=>{if(t!==e)try{return r.statSync(e).isDirectory()?t:void 0}catch(s){return s.code==="ENOENT"?Ka(r,Va(e),e):void 0}};Za.exports={findMade:Ya,findMadeSync:Ka}});var Vn=y((T0,ec)=>{u();var{dirname:Qa}=require("path"),Hn=(r,e,t)=>{e.recursive=!1;let s=Qa(r);return s===r?e.mkdirAsync(r,e).catch(i=>{if(i.code!=="EISDIR")throw i}):e.mkdirAsync(r,e).then(()=>t||r,i=>{if(i.code==="ENOENT")return Hn(s,e).then(n=>Hn(r,e,n));if(i.code!=="EEXIST"&&i.code!=="EROFS")throw i;return e.statAsync(r).then(n=>{if(n.isDirectory())return t;throw i},()=>{throw i})})},Jn=(r,e,t)=>{let s=Qa(r);if(e.recursive=!1,s===r)try{return e.mkdirSync(r,e)}catch(i){if(i.code!=="EISDIR")throw i;return}try{return e.mkdirSync(r,e),t||r}catch(i){if(i.code==="ENOENT")return Jn(r,e,Jn(s,e,t));if(i.code!=="EEXIST"&&i.code!=="EROFS")throw i;try{if(!e.statSync(r).isDirectory())throw i}catch{throw i}}};ec.exports={mkdirpManual:Hn,mkdirpManualSync:Jn}});var sc=y((L0,rc)=>{u();var{dirname:tc}=require("path"),{findMade:up,findMadeSync:ap}=Xa(),{mkdirpManual:cp,mkdirpManualSync:lp}=Vn(),hp=(r,e)=>(e.recursive=!0,tc(r)===r?e.mkdirAsync(r,e):up(e,r).then(s=>e.mkdirAsync(r,e).then(()=>s).catch(i=>{if(i.code==="ENOENT")return cp(r,e);throw i}))),fp=(r,e)=>{if(e.recursive=!0,tc(r)===r)return e.mkdirSync(r,e);let s=ap(e,r);try{return e.mkdirSync(r,e),s}catch(i){if(i.code==="ENOENT")return lp(r,e);throw i}};rc.exports={mkdirpNative:hp,mkdirpNativeSync:fp}});var uc=y((N0,oc)=>{u();var ic=require("fs"),pp=process.env.__TESTING_MKDIRP_NODE_VERSION__||process.version,Yn=pp.replace(/^v/,"").split("."),nc=+Yn[0]>10||+Yn[0]==10&&+Yn[1]>=12,mp=nc?r=>r.mkdir===ic.mkdir:()=>!1,dp=nc?r=>r.mkdirSync===ic.mkdirSync:()=>!1;oc.exports={useNative:mp,useNativeSync:dp}});var pc=y((M0,fc)=>{u();var nr=Ga(),or=Ja(),{mkdirpNative:ac,mkdirpNativeSync:cc}=sc(),{mkdirpManual:lc,mkdirpManualSync:hc}=Vn(),{useNative:Dp,useNativeSync:gp}=uc(),ur=(r,e)=>(r=or(r),e=nr(e),Dp(e)?ac(r,e):lc(r,e)),Ep=(r,e)=>(r=or(r),e=nr(e),gp(e)?cc(r,e):hc(r,e));ur.sync=Ep;ur.native=(r,e)=>ac(or(r),nr(e));ur.manual=(r,e)=>lc(or(r),nr(e));ur.nativeSync=(r,e)=>cc(or(r),nr(e));ur.manualSync=(r,e)=>hc(or(r),nr(e));fc.exports=ur});var Ac=y((I0,yc)=>{"use strict";u();var ae=require("fs"),_t=require("path"),yp=ae.lchown?"lchown":"chown",Ap=ae.lchownSync?"lchownSync":"chownSync",dc=ae.lchown&&!process.version.match(/v1[1-9]+\./)&&!process.version.match(/v10\.[6-9]/),mc=(r,e,t)=>{try{return ae[Ap](r,e,t)}catch(s){if(s.code!=="ENOENT")throw s}},Cp=(r,e,t)=>{try{return ae.chownSync(r,e,t)}catch(s){if(s.code!=="ENOENT")throw s}},wp=dc?(r,e,t,s)=>i=>{!i||i.code!=="EISDIR"?s(i):ae.chown(r,e,t,s)}:(r,e,t,s)=>s,Kn=dc?(r,e,t)=>{try{return mc(r,e,t)}catch(s){if(s.code!=="EISDIR")throw s;Cp(r,e,t)}}:(r,e,t)=>mc(r,e,t),Fp=process.version,Dc=(r,e,t)=>ae.readdir(r,e,t),bp=(r,e)=>ae.readdirSync(r,e);/^v4\./.test(Fp)&&(Dc=(r,e,t)=>ae.readdir(r,t));var js=(r,e,t,s)=>{ae[yp](r,e,t,wp(r,e,t,i=>{s(i&&i.code!=="ENOENT"?i:null)}))},gc=(r,e,t,s,i)=>{if(typeof e=="string")return ae.lstat(_t.resolve(r,e),(n,o)=>{if(n)return i(n.code!=="ENOENT"?n:null);o.name=e,gc(r,o,t,s,i)});if(e.isDirectory())Zn(_t.resolve(r,e.name),t,s,n=>{if(n)return i(n);let o=_t.resolve(r,e.name);js(o,t,s,i)});else{let n=_t.resolve(r,e.name);js(n,t,s,i)}},Zn=(r,e,t,s)=>{Dc(r,{withFileTypes:!0},(i,n)=>{if(i){if(i.code==="ENOENT")return s();if(i.code!=="ENOTDIR"&&i.code!=="ENOTSUP")return s(i)}if(i||!n.length)return js(r,e,t,s);let o=n.length,a=null,l=c=>{if(!a){if(c)return s(a=c);if(--o===0)return js(r,e,t,s)}};n.forEach(c=>gc(r,c,e,t,l))})},Sp=(r,e,t,s)=>{if(typeof e=="string")try{let i=ae.lstatSync(_t.resolve(r,e));i.name=e,e=i}catch(i){if(i.code==="ENOENT")return;throw i}e.isDirectory()&&Ec(_t.resolve(r,e.name),t,s),Kn(_t.resolve(r,e.name),t,s)},Ec=(r,e,t)=>{let s;try{s=bp(r,{withFileTypes:!0})}catch(i){if(i.code==="ENOENT")return;if(i.code==="ENOTDIR"||i.code==="ENOTSUP")return Kn(r,e,t);throw i}return s&&s.length&&s.forEach(i=>Sp(r,i,e,t)),Kn(r,e,t)};yc.exports=Zn;Zn.sync=Ec});var bc=y((j0,Xn)=>{"use strict";u();var Cc=pc(),ce=require("fs"),Us=require("path"),wc=Ac(),De=Gt(),qs=class extends Error{constructor(e,t){super("Cannot extract through symbolic link"),this.path=t,this.symlink=e}get name(){return"SylinkError"}},$s=class extends Error{constructor(e,t){super(t+": Cannot cd into '"+e+"'"),this.path=e,this.code=t}get name(){return"CwdError"}},Ws=(r,e)=>r.get(De(e)),Rr=(r,e,t)=>r.set(De(e),t),kp=(r,e)=>{ce.stat(r,(t,s)=>{(t||!s.isDirectory())&&(t=new $s(r,t&&t.code||"ENOTDIR")),e(t)})};Xn.exports=(r,e,t)=>{r=De(r);let s=e.umask,i=e.mode|448,n=(i&s)!==0,o=e.uid,a=e.gid,l=typeof o=="number"&&typeof a=="number"&&(o!==e.processUid||a!==e.processGid),c=e.preserve,h=e.unlink,d=e.cache,p=De(e.cwd),E=(S,x)=>{S?t(S):(Rr(d,r,!0),x&&l?wc(x,o,a,ft=>E(ft)):n?ce.chmod(r,i,t):t())};if(d&&Ws(d,r)===!0)return E();if(r===p)return kp(r,E);if(c)return Cc(r,{mode:i}).then(S=>E(null,S),E);let P=De(Us.relative(p,r)).split("/");zs(p,P,i,d,h,p,null,E)};var zs=(r,e,t,s,i,n,o,a)=>{if(!e.length)return a(null,o);let l=e.shift(),c=De(Us.resolve(r+"/"+l));if(Ws(s,c))return zs(c,e,t,s,i,n,o,a);ce.mkdir(c,t,Fc(c,e,t,s,i,n,o,a))},Fc=(r,e,t,s,i,n,o,a)=>l=>{l?ce.lstat(r,(c,h)=>{if(c)c.path=c.path&&De(c.path),a(c);else if(h.isDirectory())zs(r,e,t,s,i,n,o,a);else if(i)ce.unlink(r,d=>{if(d)return a(d);ce.mkdir(r,t,Fc(r,e,t,s,i,n,o,a))});else{if(h.isSymbolicLink())return a(new qs(r,r+"/"+e.join("/")));a(l)}}):(o=o||r,zs(r,e,t,s,i,n,o,a))},_p=r=>{let e=!1,t="ENOTDIR";try{e=ce.statSync(r).isDirectory()}catch(s){t=s.code}finally{if(!e)throw new $s(r,t)}};Xn.exports.sync=(r,e)=>{r=De(r);let t=e.umask,s=e.mode|448,i=(s&t)!==0,n=e.uid,o=e.gid,a=typeof n=="number"&&typeof o=="number"&&(n!==e.processUid||o!==e.processGid),l=e.preserve,c=e.unlink,h=e.cache,d=De(e.cwd),p=S=>{Rr(h,r,!0),S&&a&&wc.sync(S,n,o),i&&ce.chmodSync(r,s)};if(h&&Ws(h,r)===!0)return p();if(r===d)return _p(d),p();if(l)return p(Cc.sync(r,s));let w=De(Us.relative(d,r)).split("/"),P=null;for(let S=w.shift(),x=d;S&&(x+="/"+S);S=w.shift())if(x=De(Us.resolve(x)),!Ws(h,x))try{ce.mkdirSync(x,s),P=P||x,Rr(h,x,!0)}catch{let Ee=ce.lstatSync(x);if(Ee.isDirectory()){Rr(h,x,!0);continue}else if(c){ce.unlinkSync(x),ce.mkdirSync(x,s),P=P||x,Rr(h,x,!0);continue}else if(Ee.isSymbolicLink())return new qs(x,x+"/"+w.join("/"))}return p(P)}});var eo=y((U0,Sc)=>{u();var Qn=Object.create(null),{hasOwnProperty:vp}=Object.prototype;Sc.exports=r=>(vp.call(Qn,r)||(Qn[r]=r.normalize("NFKD")),Qn[r])});var Rc=y((q0,vc)=>{u();var kc=require("assert"),Rp=eo(),Bp=Vt(),{join:_c}=require("path"),xp=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,Op=xp==="win32";vc.exports=()=>{let r=new Map,e=new Map,t=c=>c.split("/").slice(0,-1).reduce((d,p)=>(d.length&&(p=_c(d[d.length-1],p)),d.push(p||"/"),d),[]),s=new Set,i=c=>{let h=e.get(c);if(!h)throw new Error("function does not have any path reservations");return{paths:h.paths.map(d=>r.get(d)),dirs:[...h.dirs].map(d=>r.get(d))}},n=c=>{let{paths:h,dirs:d}=i(c);return h.every(p=>p[0]===c)&&d.every(p=>p[0]instanceof Set&&p[0].has(c))},o=c=>s.has(c)||!n(c)?!1:(s.add(c),c(()=>a(c)),!0),a=c=>{if(!s.has(c))return!1;let{paths:h,dirs:d}=e.get(c),p=new Set;return h.forEach(E=>{let w=r.get(E);kc.equal(w[0],c),w.length===1?r.delete(E):(w.shift(),typeof w[0]=="function"?p.add(w[0]):w[0].forEach(P=>p.add(P)))}),d.forEach(E=>{let w=r.get(E);kc(w[0]instanceof Set),w[0].size===1&&w.length===1?r.delete(E):w[0].size===1?(w.shift(),p.add(w[0])):w[0].delete(c)}),s.delete(c),p.forEach(E=>o(E)),!0};return{check:n,reserve:(c,h)=>{c=Op?["win32 parallelization disabled"]:c.map(p=>Rp(Bp(_c(p))).toLowerCase());let d=new Set(c.map(p=>t(p)).reduce((p,E)=>p.concat(E)));return e.set(h,{dirs:d,paths:c}),c.forEach(p=>{let E=r.get(p);E?E.push(h):r.set(p,[h])}),d.forEach(p=>{let E=r.get(p);E?E[E.length-1]instanceof Set?E[E.length-1].add(h):E.push(new Set([h])):r.set(p,[new Set([h])])}),o(h)}}}});var Oc=y(($0,xc)=>{u();var Pp=process.env.__FAKE_PLATFORM__||process.platform,Tp=Pp==="win32",Lp=global.__FAKE_TESTING_FS__||require("fs"),{O_CREAT:Np,O_TRUNC:Mp,O_WRONLY:Ip,UV_FS_O_FILEMAP:Bc=0}=Lp.constants,jp=Tp&&!!Bc,Up=512*1024,qp=Bc|Mp|Np|Ip;xc.exports=jp?r=>r<Up?qp:"w":()=>"w"});var co=y((W0,Hc)=>{"use strict";u();var $p=require("assert"),Wp=Ns(),_=require("fs"),zp=sr(),qe=require("path"),Wc=bc(),Pc=an(),Gp=Rc(),Hp=cn(),re=Gt(),Jp=Vt(),Vp=eo(),Tc=Symbol("onEntry"),so=Symbol("checkFs"),Lc=Symbol("checkFs2"),Js=Symbol("pruneCache"),io=Symbol("isReusable"),le=Symbol("makeFs"),no=Symbol("file"),oo=Symbol("directory"),Vs=Symbol("link"),Nc=Symbol("symlink"),Mc=Symbol("hardlink"),Ic=Symbol("unsupported"),jc=Symbol("checkPath"),nt=Symbol("mkdir"),z=Symbol("onError"),Gs=Symbol("pending"),Uc=Symbol("pend"),ar=Symbol("unpend"),to=Symbol("ended"),ro=Symbol("maybeClose"),uo=Symbol("skip"),Br=Symbol("doChown"),xr=Symbol("uid"),Or=Symbol("gid"),Pr=Symbol("checkedCwd"),zc=require("crypto"),Gc=Oc(),Yp=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,Tr=Yp==="win32",Kp=(r,e)=>{if(!Tr)return _.unlink(r,e);let t=r+".DELETE."+zc.randomBytes(16).toString("hex");_.rename(r,t,s=>{if(s)return e(s);_.unlink(t,e)})},Zp=r=>{if(!Tr)return _.unlinkSync(r);let e=r+".DELETE."+zc.randomBytes(16).toString("hex");_.renameSync(r,e),_.unlinkSync(e)},qc=(r,e,t)=>r===r>>>0?r:e===e>>>0?e:t,$c=r=>Vp(Jp(re(r))).toLowerCase(),Xp=(r,e)=>{e=$c(e);for(let t of r.keys()){let s=$c(t);(s===e||s.indexOf(e+"/")===0)&&r.delete(t)}},Qp=r=>{for(let e of r.keys())r.delete(e)},Lr=class extends Wp{constructor(e){if(e||(e={}),e.ondone=t=>{this[to]=!0,this[ro]()},super(e),this[Pr]=!1,this.reservations=Gp(),this.transform=typeof e.transform=="function"?e.transform:null,this.writable=!0,this.readable=!1,this[Gs]=0,this[to]=!1,this.dirCache=e.dirCache||new Map,typeof e.uid=="number"||typeof e.gid=="number"){if(typeof e.uid!="number"||typeof e.gid!="number")throw new TypeError("cannot set owner without number uid and gid");if(e.preserveOwner)throw new TypeError("cannot preserve owner in archive and also set owner explicitly");this.uid=e.uid,this.gid=e.gid,this.setOwner=!0}else this.uid=null,this.gid=null,this.setOwner=!1;e.preserveOwner===void 0&&typeof e.uid!="number"?this.preserveOwner=process.getuid&&process.getuid()===0:this.preserveOwner=!!e.preserveOwner,this.processUid=(this.preserveOwner||this.setOwner)&&process.getuid?process.getuid():null,this.processGid=(this.preserveOwner||this.setOwner)&&process.getgid?process.getgid():null,this.forceChown=e.forceChown===!0,this.win32=!!e.win32||Tr,this.newer=!!e.newer,this.keep=!!e.keep,this.noMtime=!!e.noMtime,this.preservePaths=!!e.preservePaths,this.unlink=!!e.unlink,this.cwd=re(qe.resolve(e.cwd||process.cwd())),this.strip=+e.strip||0,this.processUmask=e.noChmod?0:process.umask(),this.umask=typeof e.umask=="number"?e.umask:this.processUmask,this.dmode=e.dmode||511&~this.umask,this.fmode=e.fmode||438&~this.umask,this.on("entry",t=>this[Tc](t))}warn(e,t,s={}){return(e==="TAR_BAD_ARCHIVE"||e==="TAR_ABORT")&&(s.recoverable=!1),super.warn(e,t,s)}[ro](){this[to]&&this[Gs]===0&&(this.emit("prefinish"),this.emit("finish"),this.emit("end"))}[jc](e){if(this.strip){let t=re(e.path).split("/");if(t.length<this.strip)return!1;if(e.path=t.slice(this.strip).join("/"),e.type==="Link"){let s=re(e.linkpath).split("/");if(s.length>=this.strip)e.linkpath=s.slice(this.strip).join("/");else return!1}}if(!this.preservePaths){let t=re(e.path),s=t.split("/");if(s.includes("..")||Tr&&/^[a-z]:\.\.$/i.test(s[0]))return this.warn("TAR_ENTRY_ERROR","path contains '..'",{entry:e,path:t}),!1;let[i,n]=Hp(t);i&&(e.path=n,this.warn("TAR_ENTRY_INFO",`stripping ${i} from absolute path`,{entry:e,path:t}))}if(qe.isAbsolute(e.path)?e.absolute=re(qe.resolve(e.path)):e.absolute=re(qe.resolve(this.cwd,e.path)),!this.preservePaths&&e.absolute.indexOf(this.cwd+"/")!==0&&e.absolute!==this.cwd)return this.warn("TAR_ENTRY_ERROR","path escaped extraction target",{entry:e,path:re(e.path),resolvedPath:e.absolute,cwd:this.cwd}),!1;if(e.absolute===this.cwd&&e.type!=="Directory"&&e.type!=="GNUDumpDir")return!1;if(this.win32){let{root:t}=qe.win32.parse(e.absolute);e.absolute=t+Pc.encode(e.absolute.slice(t.length));let{root:s}=qe.win32.parse(e.path);e.path=s+Pc.encode(e.path.slice(s.length))}return!0}[Tc](e){if(!this[jc](e))return e.resume();switch($p.equal(typeof e.absolute,"string"),e.type){case"Directory":case"GNUDumpDir":e.mode&&(e.mode=e.mode|448);case"File":case"OldFile":case"ContiguousFile":case"Link":case"SymbolicLink":return this[so](e);case"CharacterDevice":case"BlockDevice":case"FIFO":default:return this[Ic](e)}}[z](e,t){e.name==="CwdError"?this.emit("error",e):(this.warn("TAR_ENTRY_ERROR",e,{entry:t}),this[ar](),t.resume())}[nt](e,t,s){Wc(re(e),{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:t,noChmod:this.noChmod},s)}[Br](e){return this.forceChown||this.preserveOwner&&(typeof e.uid=="number"&&e.uid!==this.processUid||typeof e.gid=="number"&&e.gid!==this.processGid)||typeof this.uid=="number"&&this.uid!==this.processUid||typeof this.gid=="number"&&this.gid!==this.processGid}[xr](e){return qc(this.uid,e.uid,this.processUid)}[Or](e){return qc(this.gid,e.gid,this.processGid)}[no](e,t){let s=e.mode&4095||this.fmode,i=new zp.WriteStream(e.absolute,{flags:Gc(e.size),mode:s,autoClose:!1});i.on("error",l=>{i.fd&&_.close(i.fd,()=>{}),i.write=()=>!0,this[z](l,e),t()});let n=1,o=l=>{if(l){i.fd&&_.close(i.fd,()=>{}),this[z](l,e),t();return}--n===0&&_.close(i.fd,c=>{c?this[z](c,e):this[ar](),t()})};i.on("finish",l=>{let c=e.absolute,h=i.fd;if(e.mtime&&!this.noMtime){n++;let d=e.atime||new Date,p=e.mtime;_.futimes(h,d,p,E=>E?_.utimes(c,d,p,w=>o(w&&E)):o())}if(this[Br](e)){n++;let d=this[xr](e),p=this[Or](e);_.fchown(h,d,p,E=>E?_.chown(c,d,p,w=>o(w&&E)):o())}o()});let a=this.transform&&this.transform(e)||e;a!==e&&(a.on("error",l=>{this[z](l,e),t()}),e.pipe(a)),a.pipe(i)}[oo](e,t){let s=e.mode&4095||this.dmode;this[nt](e.absolute,s,i=>{if(i){this[z](i,e),t();return}let n=1,o=a=>{--n===0&&(t(),this[ar](),e.resume())};e.mtime&&!this.noMtime&&(n++,_.utimes(e.absolute,e.atime||new Date,e.mtime,o)),this[Br](e)&&(n++,_.chown(e.absolute,this[xr](e),this[Or](e),o)),o()})}[Ic](e){e.unsupported=!0,this.warn("TAR_ENTRY_UNSUPPORTED",`unsupported entry type: ${e.type}`,{entry:e}),e.resume()}[Nc](e,t){this[Vs](e,e.linkpath,"symlink",t)}[Mc](e,t){let s=re(qe.resolve(this.cwd,e.linkpath));this[Vs](e,s,"link",t)}[Uc](){this[Gs]++}[ar](){this[Gs]--,this[ro]()}[uo](e){this[ar](),e.resume()}[io](e,t){return e.type==="File"&&!this.unlink&&t.isFile()&&t.nlink<=1&&!Tr}[so](e){this[Uc]();let t=[e.path];e.linkpath&&t.push(e.linkpath),this.reservations.reserve(t,s=>this[Lc](e,s))}[Js](e){e.type==="SymbolicLink"?Qp(this.dirCache):e.type!=="Directory"&&Xp(this.dirCache,e.absolute)}[Lc](e,t){this[Js](e);let s=a=>{this[Js](e),t(a)},i=()=>{this[nt](this.cwd,this.dmode,a=>{if(a){this[z](a,e),s();return}this[Pr]=!0,n()})},n=()=>{if(e.absolute!==this.cwd){let a=re(qe.dirname(e.absolute));if(a!==this.cwd)return this[nt](a,this.dmode,l=>{if(l){this[z](l,e),s();return}o()})}o()},o=()=>{_.lstat(e.absolute,(a,l)=>{if(l&&(this.keep||this.newer&&l.mtime>e.mtime)){this[uo](e),s();return}if(a||this[io](e,l))return this[le](null,e,s);if(l.isDirectory()){if(e.type==="Directory"){let c=!this.noChmod&&e.mode&&(l.mode&4095)!==e.mode,h=d=>this[le](d,e,s);return c?_.chmod(e.absolute,e.mode,h):h()}if(e.absolute!==this.cwd)return _.rmdir(e.absolute,c=>this[le](c,e,s))}if(e.absolute===this.cwd)return this[le](null,e,s);Kp(e.absolute,c=>this[le](c,e,s))})};this[Pr]?n():i()}[le](e,t,s){if(e){this[z](e,t),s();return}switch(t.type){case"File":case"OldFile":case"ContiguousFile":return this[no](t,s);case"Link":return this[Mc](t,s);case"SymbolicLink":return this[Nc](t,s);case"Directory":case"GNUDumpDir":return this[oo](t,s)}}[Vs](e,t,s,i){_[s](t,e.absolute,n=>{n?this[z](n,e):(this[ar](),e.resume()),i()})}},Hs=r=>{try{return[null,r()]}catch(e){return[e,null]}},ao=class extends Lr{[le](e,t){return super[le](e,t,()=>{})}[so](e){if(this[Js](e),!this[Pr]){let n=this[nt](this.cwd,this.dmode);if(n)return this[z](n,e);this[Pr]=!0}if(e.absolute!==this.cwd){let n=re(qe.dirname(e.absolute));if(n!==this.cwd){let o=this[nt](n,this.dmode);if(o)return this[z](o,e)}}let[t,s]=Hs(()=>_.lstatSync(e.absolute));if(s&&(this.keep||this.newer&&s.mtime>e.mtime))return this[uo](e);if(t||this[io](e,s))return this[le](null,e);if(s.isDirectory()){if(e.type==="Directory"){let o=!this.noChmod&&e.mode&&(s.mode&4095)!==e.mode,[a]=o?Hs(()=>{_.chmodSync(e.absolute,e.mode)}):[];return this[le](a,e)}let[n]=Hs(()=>_.rmdirSync(e.absolute));this[le](n,e)}let[i]=e.absolute===this.cwd?[]:Hs(()=>Zp(e.absolute));this[le](i,e)}[no](e,t){let s=e.mode&4095||this.fmode,i=a=>{let l;try{_.closeSync(n)}catch(c){l=c}(a||l)&&this[z](a||l,e),t()},n;try{n=_.openSync(e.absolute,Gc(e.size),s)}catch(a){return i(a)}let o=this.transform&&this.transform(e)||e;o!==e&&(o.on("error",a=>this[z](a,e)),e.pipe(o)),o.on("data",a=>{try{_.writeSync(n,a,0,a.length)}catch(l){i(l)}}),o.on("end",a=>{let l=null;if(e.mtime&&!this.noMtime){let c=e.atime||new Date,h=e.mtime;try{_.futimesSync(n,c,h)}catch(d){try{_.utimesSync(e.absolute,c,h)}catch{l=d}}}if(this[Br](e)){let c=this[xr](e),h=this[Or](e);try{_.fchownSync(n,c,h)}catch(d){try{_.chownSync(e.absolute,c,h)}catch{l=l||d}}}i(l)})}[oo](e,t){let s=e.mode&4095||this.dmode,i=this[nt](e.absolute,s);if(i){this[z](i,e),t();return}if(e.mtime&&!this.noMtime)try{_.utimesSync(e.absolute,e.atime||new Date,e.mtime)}catch{}if(this[Br](e))try{_.chownSync(e.absolute,this[xr](e),this[Or](e))}catch{}t(),e.resume()}[nt](e,t){try{return Wc.sync(re(e),{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:t})}catch(s){return s}}[Vs](e,t,s,i){try{_[s+"Sync"](t,e.absolute),i(),e.resume()}catch(n){return this[z](n,e)}}};Lr.Sync=ao;Hc.exports=Lr});var Zc=y((z0,Kc)=>{"use strict";u();var em=Ut(),Ys=co(),Vc=require("fs"),Yc=sr(),Jc=require("path"),lo=Vt();Kc.exports=(r,e,t)=>{typeof r=="function"?(t=r,e=null,r={}):Array.isArray(r)&&(e=r,r={}),typeof e=="function"&&(t=e,e=null),e?e=Array.from(e):e=[];let s=em(r);if(s.sync&&typeof t=="function")throw new TypeError("callback not supported for sync tar functions");if(!s.file&&typeof t=="function")throw new TypeError("callback only supported with file option");return e.length&&tm(s,e),s.file&&s.sync?rm(s):s.file?sm(s,t):s.sync?im(s):nm(s)};var tm=(r,e)=>{let t=new Map(e.map(n=>[lo(n),!0])),s=r.filter,i=(n,o)=>{let a=o||Jc.parse(n).root||".",l=n===a?!1:t.has(n)?t.get(n):i(Jc.dirname(n),a);return t.set(n,l),l};r.filter=s?(n,o)=>s(n,o)&&i(lo(n)):n=>i(lo(n))},rm=r=>{let e=new Ys.Sync(r),t=r.file,s=Vc.statSync(t),i=r.maxReadSize||16*1024*1024;new Yc.ReadStreamSync(t,{readSize:i,size:s.size}).pipe(e)},sm=(r,e)=>{let t=new Ys(r),s=r.maxReadSize||16*1024*1024,i=r.file,n=new Promise((o,a)=>{t.on("error",a),t.on("close",o),Vc.stat(i,(l,c)=>{if(l)a(l);else{let h=new Yc.ReadStream(i,{readSize:s,size:c.size});h.on("error",a),h.pipe(t)}})});return e?n.then(e,e):n},im=r=>new Ys.Sync(r),nm=r=>new Ys(r)});var Xc=y(N=>{"use strict";u();N.c=N.create=Pa();N.r=N.replace=Gn();N.t=N.list=Ms();N.u=N.update=$a();N.x=N.extract=Zc();N.Pack=ws();N.Unpack=co();N.Parse=Ns();N.ReadEntry=ns();N.WriteEntry=yn();N.Header=Jt();N.Pax=us();N.types=en()});var el=y((Y0,Qc)=>{u();function he(r,e){typeof e=="boolean"&&(e={forever:e}),this._originalTimeouts=JSON.parse(JSON.stringify(r)),this._timeouts=r,this._options=e||{},this._maxRetryTime=e&&e.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}Qc.exports=he;he.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)};he.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null};he.prototype.retry=function(r){if(this._timeout&&clearTimeout(this._timeout),!r)return!1;var e=new Date().getTime();if(r&&e-this._operationStart>=this._maxRetryTime)return this._errors.push(r),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(r);var t=this._timeouts.shift();if(t===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),t=this._cachedTimeouts.slice(-1);else return!1;var s=this;return this._timer=setTimeout(function(){s._attempts++,s._operationTimeoutCb&&(s._timeout=setTimeout(function(){s._operationTimeoutCb(s._attempts)},s._operationTimeout),s._options.unref&&s._timeout.unref()),s._fn(s._attempts)},t),this._options.unref&&this._timer.unref(),!0};he.prototype.attempt=function(r,e){this._fn=r,e&&(e.timeout&&(this._operationTimeout=e.timeout),e.cb&&(this._operationTimeoutCb=e.cb));var t=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){t._operationTimeoutCb()},t._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};he.prototype.try=function(r){console.log("Using RetryOperation.try() is deprecated"),this.attempt(r)};he.prototype.start=function(r){console.log("Using RetryOperation.start() is deprecated"),this.attempt(r)};he.prototype.start=he.prototype.try;he.prototype.errors=function(){return this._errors};he.prototype.attempts=function(){return this._attempts};he.prototype.mainError=function(){if(this._errors.length===0)return null;for(var r={},e=null,t=0,s=0;s<this._errors.length;s++){var i=this._errors[s],n=i.message,o=(r[n]||0)+1;r[n]=o,o>=t&&(e=i,t=o)}return e}});var tl=y(vt=>{u();var fm=el();vt.operation=function(r){var e=vt.timeouts(r);return new fm(e,{forever:r&&(r.forever||r.retries===1/0),unref:r&&r.unref,maxRetryTime:r&&r.maxRetryTime})};vt.timeouts=function(r){if(r instanceof Array)return[].concat(r);var e={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var t in r)e[t]=r[t];if(e.minTimeout>e.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var s=[],i=0;i<e.retries;i++)s.push(this.createTimeout(i,e));return r&&r.forever&&!s.length&&s.push(this.createTimeout(i,e)),s.sort(function(n,o){return n-o}),s};vt.createTimeout=function(r,e){var t=e.randomize?Math.random()+1:1,s=Math.round(t*Math.max(e.minTimeout,1)*Math.pow(e.factor,r));return s=Math.min(s,e.maxTimeout),s};vt.wrap=function(r,e,t){if(e instanceof Array&&(t=e,e=null),!t){t=[];for(var s in r)typeof r[s]=="function"&&t.push(s)}for(var i=0;i<t.length;i++){var n=t[i],o=r[n];r[n]=function(l){var c=vt.operation(e),h=Array.prototype.slice.call(arguments,1),d=h.pop();h.push(function(p){c.retry(p)||(p&&(arguments[0]=c.mainError()),d.apply(this,arguments))}),c.attempt(function(){l.apply(r,h)})}.bind(r,o),r[n].options=e}}});var sl=y((Z0,rl)=>{u();rl.exports=tl()});var nl=y((X0,il)=>{u();var pm=sl();function mm(r,e){function t(s,i){var n=e||{},o;"randomize"in n||(n.randomize=!0),o=pm.operation(n);function a(h){i(h||new Error("Aborted"))}function l(h,d){if(h.bail){a(h);return}o.retry(h)?n.onRetry&&n.onRetry(h,d):i(o.mainError())}function c(h){var d;try{d=r(a,h)}catch(p){l(p,h);return}Promise.resolve(d).then(s).catch(function(E){l(E,h)})}o.attempt(c)}return new Promise(t)}il.exports=mm});u();var yo=A(require("picocolors")),Pl=require("commander");u();u();u();var Xl=A(_o());u();u();function li(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}u();u();function mr(r){return mr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},mr(r)}u();function hi(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function fi(r,e){if(e&&(mr(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return hi(r)}u();function dt(r){return dt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},dt(r)}u();u();function ve(r,e){return ve=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(s,i){return s.__proto__=i,s},ve(r,e)}function pi(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),e&&ve(r,e)}u();u();function mi(r){return Function.toString.call(r).indexOf("[native code]")!==-1}u();u();function di(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Nt(r,e,t){return di()?Nt=Reflect.construct.bind():Nt=function(i,n,o){var a=[null];a.push.apply(a,n);var l=Function.bind.apply(i,a),c=new l;return o&&ve(c,o.prototype),c},Nt.apply(null,arguments)}function dr(r){var e=typeof Map=="function"?new Map:void 0;return dr=function(s){if(s===null||!mi(s))return s;if(typeof s!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(s))return e.get(s);e.set(s,i)}function i(){return Nt(s,arguments,dt(this).constructor)}return i.prototype=Object.create(s.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),ve(i,s)},dr(r)}var Go=A(zo());var Ql=A(require("fs-extra")),Ld=function(r){pi(e,r);function e(t){var s;return li(this,e),s=fi(this,dt(e).call(this,"No package.json could be found upwards from the directory ".concat(t))),s.directory=t,s}return e}(dr(Error));u();u();var eh=A(require("fs")),th=A(require("path"));u();var dh=A(require("fs")),Dh=A(require("path")),gh=A(require("js-yaml")),Eh=require("fast-glob");var me={};$l(me,{bold:()=>uh,dimmed:()=>ch,error:()=>jt,grey:()=>lh,info:()=>oh,item:()=>hh,log:()=>X,turboBlue:()=>It,turboGradient:()=>nh,turboLoader:()=>Xo,turboRed:()=>Ko,underline:()=>ah,warn:()=>Fi,yellow:()=>Zo});u();var J=require("picocolors"),Ho=A(require("ora")),Jo=A(require("gradient-string")),Vo="#0099F7",Yo="#F11712",ih="#FFFF00",wi=r=>{let e=fh(r);return t=>`\x1B[38;5;${e}m${t}${(0,J.reset)("")}`},nh=(0,Jo.default)(Vo,Yo),It=wi(Vo),Ko=wi(Yo),Zo=wi(ih),Xo=r=>(0,Ho.default)({text:r,spinner:{frames:[" ",It("> "),It(">> "),It(">>>")]}}),oh=(...r)=>{X(It((0,J.bold)(">>>")),r.join(" "))},uh=(...r)=>{X((0,J.bold)(r.join(" ")))},ah=(...r)=>{X((0,J.underline)(r.join(" ")))},ch=(...r)=>{X((0,J.dim)(r.join(" ")))},lh=(...r)=>{X((0,J.gray)(r.join(" ")))},hh=(...r)=>{X(It((0,J.bold)(" \u2022")),r.join(" "))},X=(...r)=>{console.log(...r)},Fi=(...r)=>{console.error(Zo((0,J.bold)(">>>")),r.join(" "))},jt=(...r)=>{console.error(Ko((0,J.bold)(">>>")),r.join(" "))};function fh(r){let e=parseInt(r.slice(1),16),t=Math.floor(e/(256*256))%256,s=Math.floor(e/256)%256,i=e%256;return 16+36*Math.round(t/255*5)+6*Math.round(s/255*5)+Math.round(i/255*5)}u();var Qo=A(require("os")),eu=A(require("execa")),yh=5e3;async function zr(r,e=[],t){let s={cwd:Qo.default.tmpdir(),env:{COREPACK_ENABLE_STRICT:"0"},timeout:yh,...t};try{let{stdout:i}=await(0,eu.default)(r,e,s);return i.trim()}catch{return}}async function bi(){let[r,e,t,s]=await Promise.all([zr("yarnpkg",["--version"],{cwd:"."}),zr("npm",["--version"]),zr("pnpm",["--version"]),zr("bun",["--version"])]);return{yarn:r,pnpm:t,npm:e,bun:s}}u();var Ah=A(require("fs-extra"));u();var Ch=A(require("path")),wh=A(require("fs-extra")),Fh=A(require("picocolors"));u();var om=require("stream"),um=require("stream/promises"),am=require("zlib"),Ks=require("fs"),Zs=require("path"),cm=require("child_process"),lm=A(Xc());u();var hm=A(require("fs-extra"));u();var Cm=A(require("path")),wm=A(nl()),Fm=A(require("picocolors")),bm=A(require("fs-extra"));u();u();var Xs=A(require("picocolors")),ol=A(require("update-check"));function ho(r){let{packageInfo:e,upgradeCommand:t}=r,s=(0,ol.default)(e).catch(()=>null);return async function(n=0){try{let o=await s;if(o!=null&&o.latest){X(),X(Xs.default.yellow(Xs.default.bold(`A new version of \`${e.name}\` is available!`)));let a=typeof t=="function"?await t():t;a&&X(`You can update by running: ${Xs.default.cyan(a)}`),X()}process.exit(n)}catch(o){process.env.DEBUG&&jt("Update check failed:",o),process.exit(n)}}}u();var fo={name:"@turbo/workspaces",version:"2.7.2-canary.0",description:"Tools for working with package managers",homepage:"https://turborepo.com",license:"MIT",repository:{type:"git",url:"https://github.com/vercel/turborepo",directory:"packages/turbo-workspaces"},bugs:{url:"https://github.com/vercel/turborepo/issues"},bin:"dist/cli.js",module:"dist/index.mjs",main:"dist/index.js",types:"dist/index.d.ts",scripts:{build:"tsup",dev:"tsup --watch",test:"jest",lint:"eslint src/","check-types":"tsc --noEmit","lint:prettier":"prettier -c . --cache --ignore-path=../../.prettierignore"},dependencies:{commander:"10.0.0",execa:"5.1.1","fast-glob":"3.2.12","fs-extra":"10.1.0","gradient-string":"2.0.1",inquirer:"8.2.4","js-yaml":"4.1.0",ora:"4.1.1",picocolors:"1.0.1",semver:"7.6.2","update-check":"1.5.4"},devDependencies:{"@jest/globals":"29.7.0","@turbo/eslint-config":"workspace:*","@turbo/test-utils":"workspace:*","@turbo/tsconfig":"workspace:*","@turbo/utils":"workspace:*","@types/fs-extra":"9.0.13","@types/gradient-string":"1.1.2","@types/inquirer":"7.3.3","@types/js-yaml":"4.0.5","@types/node":"18.17.4","@types/semver":"7.5.8",jest:"29.7.0","ts-jest":"29.2.5",tsup:"5.12.9",typescript:"5.5.4"},files:["dist"],publishConfig:{access:"public"}};u();u();var ti=A(require("path")),bl=A(require("inquirer")),ze=A(require("picocolors"));u();var se=A(require("picocolors")),ul=A(require("gradient-string")),cr=2,ot=class{constructor({interactive:e,dry:t}={}){this.interactive=e!=null?e:!0,this.dry=t!=null?t:!1,this.step=1}logger(...e){this.interactive&&console.log(...e)}indented(e,...t){this.logger(" ".repeat(cr*e),...t)}header(e){this.blankLine(),this.logger(se.default.bold(e))}installerFrames(){let e=`${" ".repeat(cr)} - ${this.dry?se.default.yellow("SKIPPED | "):se.default.green("OK | ")}`;return[`${e} `,`${e}> `,`${e}>> `,`${e}>>>`]}gradient(e){return(0,ul.default)("#0099F7","#F11712")(e.toString())}hero(){this.logger(se.default.bold(this.gradient(`
2
+ "use strict";var Il=Object.create;var ai=Object.defineProperty;var jl=Object.getOwnPropertyDescriptor;var Ul=Object.getOwnPropertyNames;var $l=Object.getPrototypeOf,ql=Object.prototype.hasOwnProperty;var Wl=(r,e)=>()=>(r&&(e=r(r=0)),e);var y=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),zl=(r,e)=>{for(var t in e)ai(r,t,{get:e[t],enumerable:!0})},Gl=(r,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Ul(e))!ql.call(r,i)&&i!==t&&ai(r,i,{get:()=>e[i],enumerable:!(s=jl(e,i))||s.enumerable});return r};var A=(r,e,t)=>(t=r!=null?Il($l(r)):{},Gl(e||!r||!r.__esModule?ai(t,"default",{value:r,enumerable:!0}):t,r));var u=Wl(()=>{});var Co=y((ed,ke)=>{u();function ci(r){return ke.exports=ci=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ke.exports.__esModule=!0,ke.exports.default=ke.exports,ci(r)}ke.exports=ci,ke.exports.__esModule=!0,ke.exports.default=ke.exports});var So=y((td,_e)=>{u();var Fo=Co().default;function bo(){"use strict";_e.exports=bo=function(){return e},_e.exports.__esModule=!0,_e.exports.default=_e.exports;var r,e={},t=Object.prototype,s=t.hasOwnProperty,i=Object.defineProperty||function(g,m,D){g[m]=D.value},n=typeof Symbol=="function"?Symbol:{},o=n.iterator||"@@iterator",a=n.asyncIterator||"@@asyncIterator",l=n.toStringTag||"@@toStringTag";function c(g,m,D){return Object.defineProperty(g,m,{value:D,enumerable:!0,configurable:!0,writable:!0}),g[m]}try{c({},"")}catch{c=function(D,w,b){return D[w]=b}}function h(g,m,D,w){var b=m&&m.prototype instanceof x?m:x,F=Object.create(b.prototype),T=new oi(w||[]);return i(F,"_invoke",{value:Nl(g,D,T)}),F}function d(g,m,D){try{return{type:"normal",arg:g.call(m,D)}}catch(w){return{type:"throw",arg:w}}}e.wrap=h;var p="suspendedStart",E="suspendedYield",C="executing",P="completed",S={};function x(){}function ft(){}function Ee(){}var si={};c(si,o,function(){return this});var ii=Object.getPrototypeOf,Ir=ii&&ii(ii(ui([])));Ir&&Ir!==t&&s.call(Ir,o)&&(si=Ir);var Lt=Ee.prototype=x.prototype=Object.create(si);function Ao(g){["next","throw","return"].forEach(function(m){c(g,m,function(D){return this._invoke(m,D)})})}function jr(g,m){function D(b,F,T,G){var H=d(g[b],g,F);if(H.type!=="throw"){var pt=H.arg,Ge=pt.value;return Ge&&Fo(Ge)=="object"&&s.call(Ge,"__await")?m.resolve(Ge.__await).then(function(mt){D("next",mt,T,G)},function(mt){D("throw",mt,T,G)}):m.resolve(Ge).then(function(mt){pt.value=mt,T(pt)},function(mt){return D("throw",mt,T,G)})}G(H.arg)}var w;i(this,"_invoke",{value:function(F,T){function G(){return new m(function(H,pt){D(F,T,H,pt)})}return w=w?w.then(G,G):G()}})}function Nl(g,m,D){var w=p;return function(b,F){if(w===C)throw new Error("Generator is already running");if(w===P){if(b==="throw")throw F;return{value:r,done:!0}}for(D.method=b,D.arg=F;;){var T=D.delegate;if(T){var G=wo(T,D);if(G){if(G===S)continue;return G}}if(D.method==="next")D.sent=D._sent=D.arg;else if(D.method==="throw"){if(w===p)throw w=P,D.arg;D.dispatchException(D.arg)}else D.method==="return"&&D.abrupt("return",D.arg);w=C;var H=d(g,m,D);if(H.type==="normal"){if(w=D.done?P:E,H.arg===S)continue;return{value:H.arg,done:D.done}}H.type==="throw"&&(w=P,D.method="throw",D.arg=H.arg)}}}function wo(g,m){var D=m.method,w=g.iterator[D];if(w===r)return m.delegate=null,D==="throw"&&g.iterator.return&&(m.method="return",m.arg=r,wo(g,m),m.method==="throw")||D!=="return"&&(m.method="throw",m.arg=new TypeError("The iterator does not provide a '"+D+"' method")),S;var b=d(w,g.iterator,m.arg);if(b.type==="throw")return m.method="throw",m.arg=b.arg,m.delegate=null,S;var F=b.arg;return F?F.done?(m[g.resultName]=F.value,m.next=g.nextLoc,m.method!=="return"&&(m.method="next",m.arg=r),m.delegate=null,S):F:(m.method="throw",m.arg=new TypeError("iterator result is not an object"),m.delegate=null,S)}function Ml(g){var m={tryLoc:g[0]};1 in g&&(m.catchLoc=g[1]),2 in g&&(m.finallyLoc=g[2],m.afterLoc=g[3]),this.tryEntries.push(m)}function ni(g){var m=g.completion||{};m.type="normal",delete m.arg,g.completion=m}function oi(g){this.tryEntries=[{tryLoc:"root"}],g.forEach(Ml,this),this.reset(!0)}function ui(g){if(g||g===""){var m=g[o];if(m)return m.call(g);if(typeof g.next=="function")return g;if(!isNaN(g.length)){var D=-1,w=function b(){for(;++D<g.length;)if(s.call(g,D))return b.value=g[D],b.done=!1,b;return b.value=r,b.done=!0,b};return w.next=w}}throw new TypeError(Fo(g)+" is not iterable")}return ft.prototype=Ee,i(Lt,"constructor",{value:Ee,configurable:!0}),i(Ee,"constructor",{value:ft,configurable:!0}),ft.displayName=c(Ee,l,"GeneratorFunction"),e.isGeneratorFunction=function(g){var m=typeof g=="function"&&g.constructor;return!!m&&(m===ft||(m.displayName||m.name)==="GeneratorFunction")},e.mark=function(g){return Object.setPrototypeOf?Object.setPrototypeOf(g,Ee):(g.__proto__=Ee,c(g,l,"GeneratorFunction")),g.prototype=Object.create(Lt),g},e.awrap=function(g){return{__await:g}},Ao(jr.prototype),c(jr.prototype,a,function(){return this}),e.AsyncIterator=jr,e.async=function(g,m,D,w,b){b===void 0&&(b=Promise);var F=new jr(h(g,m,D,w),b);return e.isGeneratorFunction(m)?F:F.next().then(function(T){return T.done?T.value:F.next()})},Ao(Lt),c(Lt,l,"Generator"),c(Lt,o,function(){return this}),c(Lt,"toString",function(){return"[object Generator]"}),e.keys=function(g){var m=Object(g),D=[];for(var w in m)D.push(w);return D.reverse(),function b(){for(;D.length;){var F=D.pop();if(F in m)return b.value=F,b.done=!1,b}return b.done=!0,b}},e.values=ui,oi.prototype={constructor:oi,reset:function(m){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(ni),!m)for(var D in this)D.charAt(0)==="t"&&s.call(this,D)&&!isNaN(+D.slice(1))&&(this[D]=r)},stop:function(){this.done=!0;var m=this.tryEntries[0].completion;if(m.type==="throw")throw m.arg;return this.rval},dispatchException:function(m){if(this.done)throw m;var D=this;function w(pt,Ge){return T.type="throw",T.arg=m,D.next=pt,Ge&&(D.method="next",D.arg=r),!!Ge}for(var b=this.tryEntries.length-1;b>=0;--b){var F=this.tryEntries[b],T=F.completion;if(F.tryLoc==="root")return w("end");if(F.tryLoc<=this.prev){var G=s.call(F,"catchLoc"),H=s.call(F,"finallyLoc");if(G&&H){if(this.prev<F.catchLoc)return w(F.catchLoc,!0);if(this.prev<F.finallyLoc)return w(F.finallyLoc)}else if(G){if(this.prev<F.catchLoc)return w(F.catchLoc,!0)}else{if(!H)throw new Error("try statement without catch or finally");if(this.prev<F.finallyLoc)return w(F.finallyLoc)}}}},abrupt:function(m,D){for(var w=this.tryEntries.length-1;w>=0;--w){var b=this.tryEntries[w];if(b.tryLoc<=this.prev&&s.call(b,"finallyLoc")&&this.prev<b.finallyLoc){var F=b;break}}F&&(m==="break"||m==="continue")&&F.tryLoc<=D&&D<=F.finallyLoc&&(F=null);var T=F?F.completion:{};return T.type=m,T.arg=D,F?(this.method="next",this.next=F.finallyLoc,S):this.complete(T)},complete:function(m,D){if(m.type==="throw")throw m.arg;return m.type==="break"||m.type==="continue"?this.next=m.arg:m.type==="return"?(this.rval=this.arg=m.arg,this.method="return",this.next="end"):m.type==="normal"&&D&&(this.next=D),S},finish:function(m){for(var D=this.tryEntries.length-1;D>=0;--D){var w=this.tryEntries[D];if(w.finallyLoc===m)return this.complete(w.completion,w.afterLoc),ni(w),S}},catch:function(m){for(var D=this.tryEntries.length-1;D>=0;--D){var w=this.tryEntries[D];if(w.tryLoc===m){var b=w.completion;if(b.type==="throw"){var F=b.arg;ni(w)}return F}}throw new Error("illegal catch attempt")},delegateYield:function(m,D,w){return this.delegate={iterator:ui(m),resultName:D,nextLoc:w},this.method==="next"&&(this.arg=r),S}},e}_e.exports=bo,_e.exports.__esModule=!0,_e.exports.default=_e.exports});var _o=y((rd,ko)=>{u();var Ur=So()();ko.exports=Ur;try{regeneratorRuntime=Ur}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=Ur:Function("r","regeneratorRuntime = r")(Ur)}});var Ro=y((bd,Di)=>{"use strict";u();var vo=(r,...e)=>new Promise(t=>{t(r(...e))});Di.exports=vo;Di.exports.default=vo});var xo=y((Sd,gi)=>{"use strict";u();var Hl=Ro(),Bo=r=>{if(!((Number.isInteger(r)||r===1/0)&&r>0))return Promise.reject(new TypeError("Expected `concurrency` to be a number from 1 and up"));let e=[],t=0,s=()=>{t--,e.length>0&&e.shift()()},i=(a,l,...c)=>{t++;let h=Hl(a,...c);l(h),h.then(s,s)},n=(a,l,...c)=>{t<r?i(a,l,...c):e.push(i.bind(null,a,l,...c))},o=(a,...l)=>new Promise(c=>n(a,c,...l));return Object.defineProperties(o,{activeCount:{get:()=>t},pendingCount:{get:()=>e.length},clearQueue:{value:()=>{e.length=0}}}),o};gi.exports=Bo;gi.exports.default=Bo});var To=y((kd,Ei)=>{"use strict";u();var Oo=xo(),$r=class extends Error{constructor(e){super(),this.value=e}},Jl=async(r,e)=>e(await r),Vl=async r=>{let e=await Promise.all(r);if(e[1]===!0)throw new $r(e[0]);return!1},Po=async(r,e,t)=>{t={concurrency:1/0,preserveOrder:!0,...t};let s=Oo(t.concurrency),i=[...r].map(o=>[o,s(Jl,o,e)]),n=Oo(t.preserveOrder?1:1/0);try{await Promise.all(i.map(o=>n(Vl,o)))}catch(o){if(o instanceof $r)return o.value;throw o}};Ei.exports=Po;Ei.exports.default=Po});var Uo=y((_d,yi)=>{"use strict";u();var Lo=require("path"),qr=require("fs"),{promisify:No}=require("util"),Yl=To(),Kl=No(qr.stat),Zl=No(qr.lstat),Mo={directory:"isDirectory",file:"isFile"};function Io({type:r}){if(!(r in Mo))throw new Error(`Invalid type specified: ${r}`)}var jo=(r,e)=>r===void 0||e[Mo[r]]();yi.exports=async(r,e)=>{e={cwd:process.cwd(),type:"file",allowSymlinks:!0,...e},Io(e);let t=e.allowSymlinks?Kl:Zl;return Yl(r,async s=>{try{let i=await t(Lo.resolve(e.cwd,s));return jo(e.type,i)}catch{return!1}},e)};yi.exports.sync=(r,e)=>{e={cwd:process.cwd(),allowSymlinks:!0,type:"file",...e},Io(e);let t=e.allowSymlinks?qr.statSync:qr.lstatSync;for(let s of r)try{let i=t(Lo.resolve(e.cwd,s));if(jo(e.type,i))return s}catch{}}});var qo=y((vd,Ai)=>{"use strict";u();var $o=require("fs"),{promisify:Xl}=require("util"),Ql=Xl($o.access);Ai.exports=async r=>{try{return await Ql(r),!0}catch{return!1}};Ai.exports.sync=r=>{try{return $o.accessSync(r),!0}catch{return!1}}});var zo=y((Rd,Mt)=>{"use strict";u();var He=require("path"),Wr=Uo(),Wo=qo(),wi=Symbol("findUp.stop");Mt.exports=async(r,e={})=>{let t=He.resolve(e.cwd||""),{root:s}=He.parse(t),i=[].concat(r),n=async o=>{if(typeof r!="function")return Wr(i,o);let a=await r(o.cwd);return typeof a=="string"?Wr([a],o):a};for(;;){let o=await n({...e,cwd:t});if(o===wi)return;if(o)return He.resolve(t,o);if(t===s)return;t=He.dirname(t)}};Mt.exports.sync=(r,e={})=>{let t=He.resolve(e.cwd||""),{root:s}=He.parse(t),i=[].concat(r),n=o=>{if(typeof r!="function")return Wr.sync(i,o);let a=r(o.cwd);return typeof a=="string"?Wr.sync([a],o):a};for(;;){let o=n({...e,cwd:t});if(o===wi)return;if(o)return He.resolve(t,o);if(t===s)return;t=He.dirname(t)}};Mt.exports.exists=Wo;Mt.exports.sync.exists=Wo.sync;Mt.exports.stop=wi});var Ut=y((Qd,su)=>{"use strict";u();var ru=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"]]);su.exports=r=>r?Object.keys(r).map(e=>[ru.has(e)?ru.get(e):e,r[e]]).reduce((e,t)=>(e[t[0]]=t[1],e),Object.create(null)):{}});var Kr=y((e0,fu)=>{"use strict";u();var iu=typeof process=="object"&&process?process:{stdout:null,stderr:null},kh=require("events"),nu=require("stream"),ou=require("string_decoder").StringDecoder,Re=Symbol("EOF"),Be=Symbol("maybeEmitEnd"),Je=Symbol("emittedEnd"),Gr=Symbol("emittingEnd"),Dr=Symbol("emittedError"),Hr=Symbol("closed"),uu=Symbol("read"),Jr=Symbol("flush"),au=Symbol("flushChunk"),V=Symbol("encoding"),xe=Symbol("decoder"),Vr=Symbol("flowing"),gr=Symbol("paused"),$t=Symbol("resume"),L=Symbol("buffer"),ye=Symbol("pipes"),I=Symbol("bufferLength"),Si=Symbol("bufferPush"),ki=Symbol("bufferShift"),U=Symbol("objectMode"),$=Symbol("destroyed"),_i=Symbol("emitData"),cu=Symbol("emitEnd"),vi=Symbol("emitEnd2"),Oe=Symbol("async"),Er=r=>Promise.resolve().then(r),lu=global._MP_NO_ITERATOR_SYMBOLS_!=="1",_h=lu&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),vh=lu&&Symbol.iterator||Symbol("iterator not implemented"),Rh=r=>r==="end"||r==="finish"||r==="prefinish",Bh=r=>r instanceof ArrayBuffer||typeof r=="object"&&r.constructor&&r.constructor.name==="ArrayBuffer"&&r.byteLength>=0,xh=r=>!Buffer.isBuffer(r)&&ArrayBuffer.isView(r),Yr=class{constructor(e,t,s){this.src=e,this.dest=t,this.opts=s,this.ondrain=()=>e[$t](),t.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},Ri=class extends Yr{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,t,s){super(e,t,s),this.proxyErrors=i=>t.emit("error",i),e.on("error",this.proxyErrors)}};fu.exports=class hu extends nu{constructor(e){super(),this[Vr]=!1,this[gr]=!1,this[ye]=[],this[L]=[],this[U]=e&&e.objectMode||!1,this[U]?this[V]=null:this[V]=e&&e.encoding||null,this[V]==="buffer"&&(this[V]=null),this[Oe]=e&&!!e.async||!1,this[xe]=this[V]?new ou(this[V]):null,this[Re]=!1,this[Je]=!1,this[Gr]=!1,this[Hr]=!1,this[Dr]=null,this.writable=!0,this.readable=!0,this[I]=0,this[$]=!1,e&&e.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[L]}),e&&e.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[ye]})}get bufferLength(){return this[I]}get encoding(){return this[V]}set encoding(e){if(this[U])throw new Error("cannot set encoding in objectMode");if(this[V]&&e!==this[V]&&(this[xe]&&this[xe].lastNeed||this[I]))throw new Error("cannot change encoding");this[V]!==e&&(this[xe]=e?new ou(e):null,this[L].length&&(this[L]=this[L].map(t=>this[xe].write(t)))),this[V]=e}setEncoding(e){this.encoding=e}get objectMode(){return this[U]}set objectMode(e){this[U]=this[U]||!!e}get async(){return this[Oe]}set async(e){this[Oe]=this[Oe]||!!e}write(e,t,s){if(this[Re])throw new Error("write after end");if(this[$])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof t=="function"&&(s=t,t="utf8"),t||(t="utf8");let i=this[Oe]?Er:n=>n();return!this[U]&&!Buffer.isBuffer(e)&&(xh(e)?e=Buffer.from(e.buffer,e.byteOffset,e.byteLength):Bh(e)?e=Buffer.from(e):typeof e!="string"&&(this.objectMode=!0)),this[U]?(this.flowing&&this[I]!==0&&this[Jr](!0),this.flowing?this.emit("data",e):this[Si](e),this[I]!==0&&this.emit("readable"),s&&i(s),this.flowing):e.length?(typeof e=="string"&&!(t===this[V]&&!this[xe].lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[V]&&(e=this[xe].write(e)),this.flowing&&this[I]!==0&&this[Jr](!0),this.flowing?this.emit("data",e):this[Si](e),this[I]!==0&&this.emit("readable"),s&&i(s),this.flowing):(this[I]!==0&&this.emit("readable"),s&&i(s),this.flowing)}read(e){if(this[$])return null;if(this[I]===0||e===0||e>this[I])return this[Be](),null;this[U]&&(e=null),this[L].length>1&&!this[U]&&(this.encoding?this[L]=[this[L].join("")]:this[L]=[Buffer.concat(this[L],this[I])]);let t=this[uu](e||null,this[L][0]);return this[Be](),t}[uu](e,t){return e===t.length||e===null?this[ki]():(this[L][0]=t.slice(e),t=t.slice(0,e),this[I]-=e),this.emit("data",t),!this[L].length&&!this[Re]&&this.emit("drain"),t}end(e,t,s){return typeof e=="function"&&(s=e,e=null),typeof t=="function"&&(s=t,t="utf8"),e&&this.write(e,t),s&&this.once("end",s),this[Re]=!0,this.writable=!1,(this.flowing||!this[gr])&&this[Be](),this}[$t](){this[$]||(this[gr]=!1,this[Vr]=!0,this.emit("resume"),this[L].length?this[Jr]():this[Re]?this[Be]():this.emit("drain"))}resume(){return this[$t]()}pause(){this[Vr]=!1,this[gr]=!0}get destroyed(){return this[$]}get flowing(){return this[Vr]}get paused(){return this[gr]}[Si](e){this[U]?this[I]+=1:this[I]+=e.length,this[L].push(e)}[ki](){return this[L].length&&(this[U]?this[I]-=1:this[I]-=this[L][0].length),this[L].shift()}[Jr](e){do;while(this[au](this[ki]()));!e&&!this[L].length&&!this[Re]&&this.emit("drain")}[au](e){return e?(this.emit("data",e),this.flowing):!1}pipe(e,t){if(this[$])return;let s=this[Je];return t=t||{},e===iu.stdout||e===iu.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,s?t.end&&e.end():(this[ye].push(t.proxyErrors?new Ri(this,e,t):new Yr(this,e,t)),this[Oe]?Er(()=>this[$t]()):this[$t]()),e}unpipe(e){let t=this[ye].find(s=>s.dest===e);t&&(this[ye].splice(this[ye].indexOf(t),1),t.unpipe())}addListener(e,t){return this.on(e,t)}on(e,t){let s=super.on(e,t);return e==="data"&&!this[ye].length&&!this.flowing?this[$t]():e==="readable"&&this[I]!==0?super.emit("readable"):Rh(e)&&this[Je]?(super.emit(e),this.removeAllListeners(e)):e==="error"&&this[Dr]&&(this[Oe]?Er(()=>t.call(this,this[Dr])):t.call(this,this[Dr])),s}get emittedEnd(){return this[Je]}[Be](){!this[Gr]&&!this[Je]&&!this[$]&&this[L].length===0&&this[Re]&&(this[Gr]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Hr]&&this.emit("close"),this[Gr]=!1)}emit(e,t,...s){if(e!=="error"&&e!=="close"&&e!==$&&this[$])return;if(e==="data")return t?this[Oe]?Er(()=>this[_i](t)):this[_i](t):!1;if(e==="end")return this[cu]();if(e==="close"){if(this[Hr]=!0,!this[Je]&&!this[$])return;let n=super.emit("close");return this.removeAllListeners("close"),n}else if(e==="error"){this[Dr]=t;let n=super.emit("error",t);return this[Be](),n}else if(e==="resume"){let n=super.emit("resume");return this[Be](),n}else if(e==="finish"||e==="prefinish"){let n=super.emit(e);return this.removeAllListeners(e),n}let i=super.emit(e,t,...s);return this[Be](),i}[_i](e){for(let s of this[ye])s.dest.write(e)===!1&&this.pause();let t=super.emit("data",e);return this[Be](),t}[cu](){this[Je]||(this[Je]=!0,this.readable=!1,this[Oe]?Er(()=>this[vi]()):this[vi]())}[vi](){if(this[xe]){let t=this[xe].end();if(t){for(let s of this[ye])s.dest.write(t);super.emit("data",t)}}for(let t of this[ye])t.end();let e=super.emit("end");return this.removeAllListeners("end"),e}collect(){let e=[];this[U]||(e.dataLength=0);let t=this.promise();return this.on("data",s=>{e.push(s),this[U]||(e.dataLength+=s.length)}),t.then(()=>e)}concat(){return this[U]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then(e=>this[U]?Promise.reject(new Error("cannot concat in objectMode")):this[V]?e.join(""):Buffer.concat(e,e.dataLength))}promise(){return new Promise((e,t)=>{this.on($,()=>t(new Error("stream destroyed"))),this.on("error",s=>t(s)),this.on("end",()=>e())})}[_h](){return{next:()=>{let t=this.read();if(t!==null)return Promise.resolve({done:!1,value:t});if(this[Re])return Promise.resolve({done:!0});let s=null,i=null,n=c=>{this.removeListener("data",o),this.removeListener("end",a),i(c)},o=c=>{this.removeListener("error",n),this.removeListener("end",a),this.pause(),s({value:c,done:!!this[Re]})},a=()=>{this.removeListener("error",n),this.removeListener("data",o),s({done:!0})},l=()=>n(new Error("stream destroyed"));return new Promise((c,h)=>{i=h,s=c,this.once($,l),this.once("error",n),this.once("end",a),this.once("data",o)})}}}[vh](){return{next:()=>{let t=this.read();return{value:t,done:t===null}}}}destroy(e){return this[$]?(e?this.emit("error",e):this.emit($),this):(this[$]=!0,this[L].length=0,this[I]=0,typeof this.close=="function"&&!this[Hr]&&this.close(),e?this.emit("error",e):this.emit($),this)}static isStream(e){return!!e&&(e instanceof hu||e instanceof nu||e instanceof kh&&(typeof e.pipe=="function"||typeof e.write=="function"&&typeof e.end=="function"))}}});var mu=y((t0,pu)=>{u();var Oh=require("zlib").constants||{ZLIB_VERNUM:4736};pu.exports=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},Oh))});var Li=y((r0,Fu)=>{"use strict";u();var du=typeof process=="object"&&process?process:{stdout:null,stderr:null},Ph=require("events"),Du=require("stream"),gu=require("string_decoder").StringDecoder,Pe=Symbol("EOF"),Te=Symbol("maybeEmitEnd"),Ve=Symbol("emittedEnd"),Zr=Symbol("emittingEnd"),yr=Symbol("emittedError"),Xr=Symbol("closed"),Eu=Symbol("read"),Qr=Symbol("flush"),yu=Symbol("flushChunk"),Y=Symbol("encoding"),Le=Symbol("decoder"),es=Symbol("flowing"),Ar=Symbol("paused"),qt=Symbol("resume"),j=Symbol("bufferLength"),Bi=Symbol("bufferPush"),xi=Symbol("bufferShift"),q=Symbol("objectMode"),W=Symbol("destroyed"),Oi=Symbol("emitData"),Au=Symbol("emitEnd"),Pi=Symbol("emitEnd2"),Ne=Symbol("async"),wr=r=>Promise.resolve().then(r),wu=global._MP_NO_ITERATOR_SYMBOLS_!=="1",Th=wu&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),Lh=wu&&Symbol.iterator||Symbol("iterator not implemented"),Nh=r=>r==="end"||r==="finish"||r==="prefinish",Mh=r=>r instanceof ArrayBuffer||typeof r=="object"&&r.constructor&&r.constructor.name==="ArrayBuffer"&&r.byteLength>=0,Ih=r=>!Buffer.isBuffer(r)&&ArrayBuffer.isView(r),ts=class{constructor(e,t,s){this.src=e,this.dest=t,this.opts=s,this.ondrain=()=>e[qt](),t.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},Ti=class extends ts{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,t,s){super(e,t,s),this.proxyErrors=i=>t.emit("error",i),e.on("error",this.proxyErrors)}};Fu.exports=class Cu extends Du{constructor(e){super(),this[es]=!1,this[Ar]=!1,this.pipes=[],this.buffer=[],this[q]=e&&e.objectMode||!1,this[q]?this[Y]=null:this[Y]=e&&e.encoding||null,this[Y]==="buffer"&&(this[Y]=null),this[Ne]=e&&!!e.async||!1,this[Le]=this[Y]?new gu(this[Y]):null,this[Pe]=!1,this[Ve]=!1,this[Zr]=!1,this[Xr]=!1,this[yr]=null,this.writable=!0,this.readable=!0,this[j]=0,this[W]=!1}get bufferLength(){return this[j]}get encoding(){return this[Y]}set encoding(e){if(this[q])throw new Error("cannot set encoding in objectMode");if(this[Y]&&e!==this[Y]&&(this[Le]&&this[Le].lastNeed||this[j]))throw new Error("cannot change encoding");this[Y]!==e&&(this[Le]=e?new gu(e):null,this.buffer.length&&(this.buffer=this.buffer.map(t=>this[Le].write(t)))),this[Y]=e}setEncoding(e){this.encoding=e}get objectMode(){return this[q]}set objectMode(e){this[q]=this[q]||!!e}get async(){return this[Ne]}set async(e){this[Ne]=this[Ne]||!!e}write(e,t,s){if(this[Pe])throw new Error("write after end");if(this[W])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof t=="function"&&(s=t,t="utf8"),t||(t="utf8");let i=this[Ne]?wr:n=>n();return!this[q]&&!Buffer.isBuffer(e)&&(Ih(e)?e=Buffer.from(e.buffer,e.byteOffset,e.byteLength):Mh(e)?e=Buffer.from(e):typeof e!="string"&&(this.objectMode=!0)),this[q]?(this.flowing&&this[j]!==0&&this[Qr](!0),this.flowing?this.emit("data",e):this[Bi](e),this[j]!==0&&this.emit("readable"),s&&i(s),this.flowing):e.length?(typeof e=="string"&&!(t===this[Y]&&!this[Le].lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[Y]&&(e=this[Le].write(e)),this.flowing&&this[j]!==0&&this[Qr](!0),this.flowing?this.emit("data",e):this[Bi](e),this[j]!==0&&this.emit("readable"),s&&i(s),this.flowing):(this[j]!==0&&this.emit("readable"),s&&i(s),this.flowing)}read(e){if(this[W])return null;if(this[j]===0||e===0||e>this[j])return this[Te](),null;this[q]&&(e=null),this.buffer.length>1&&!this[q]&&(this.encoding?this.buffer=[this.buffer.join("")]:this.buffer=[Buffer.concat(this.buffer,this[j])]);let t=this[Eu](e||null,this.buffer[0]);return this[Te](),t}[Eu](e,t){return e===t.length||e===null?this[xi]():(this.buffer[0]=t.slice(e),t=t.slice(0,e),this[j]-=e),this.emit("data",t),!this.buffer.length&&!this[Pe]&&this.emit("drain"),t}end(e,t,s){return typeof e=="function"&&(s=e,e=null),typeof t=="function"&&(s=t,t="utf8"),e&&this.write(e,t),s&&this.once("end",s),this[Pe]=!0,this.writable=!1,(this.flowing||!this[Ar])&&this[Te](),this}[qt](){this[W]||(this[Ar]=!1,this[es]=!0,this.emit("resume"),this.buffer.length?this[Qr]():this[Pe]?this[Te]():this.emit("drain"))}resume(){return this[qt]()}pause(){this[es]=!1,this[Ar]=!0}get destroyed(){return this[W]}get flowing(){return this[es]}get paused(){return this[Ar]}[Bi](e){this[q]?this[j]+=1:this[j]+=e.length,this.buffer.push(e)}[xi](){return this.buffer.length&&(this[q]?this[j]-=1:this[j]-=this.buffer[0].length),this.buffer.shift()}[Qr](e){do;while(this[yu](this[xi]()));!e&&!this.buffer.length&&!this[Pe]&&this.emit("drain")}[yu](e){return e?(this.emit("data",e),this.flowing):!1}pipe(e,t){if(this[W])return;let s=this[Ve];return t=t||{},e===du.stdout||e===du.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,s?t.end&&e.end():(this.pipes.push(t.proxyErrors?new Ti(this,e,t):new ts(this,e,t)),this[Ne]?wr(()=>this[qt]()):this[qt]()),e}unpipe(e){let t=this.pipes.find(s=>s.dest===e);t&&(this.pipes.splice(this.pipes.indexOf(t),1),t.unpipe())}addListener(e,t){return this.on(e,t)}on(e,t){let s=super.on(e,t);return e==="data"&&!this.pipes.length&&!this.flowing?this[qt]():e==="readable"&&this[j]!==0?super.emit("readable"):Nh(e)&&this[Ve]?(super.emit(e),this.removeAllListeners(e)):e==="error"&&this[yr]&&(this[Ne]?wr(()=>t.call(this,this[yr])):t.call(this,this[yr])),s}get emittedEnd(){return this[Ve]}[Te](){!this[Zr]&&!this[Ve]&&!this[W]&&this.buffer.length===0&&this[Pe]&&(this[Zr]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Xr]&&this.emit("close"),this[Zr]=!1)}emit(e,t,...s){if(e!=="error"&&e!=="close"&&e!==W&&this[W])return;if(e==="data")return t?this[Ne]?wr(()=>this[Oi](t)):this[Oi](t):!1;if(e==="end")return this[Au]();if(e==="close"){if(this[Xr]=!0,!this[Ve]&&!this[W])return;let n=super.emit("close");return this.removeAllListeners("close"),n}else if(e==="error"){this[yr]=t;let n=super.emit("error",t);return this[Te](),n}else if(e==="resume"){let n=super.emit("resume");return this[Te](),n}else if(e==="finish"||e==="prefinish"){let n=super.emit(e);return this.removeAllListeners(e),n}let i=super.emit(e,t,...s);return this[Te](),i}[Oi](e){for(let s of this.pipes)s.dest.write(e)===!1&&this.pause();let t=super.emit("data",e);return this[Te](),t}[Au](){this[Ve]||(this[Ve]=!0,this.readable=!1,this[Ne]?wr(()=>this[Pi]()):this[Pi]())}[Pi](){if(this[Le]){let t=this[Le].end();if(t){for(let s of this.pipes)s.dest.write(t);super.emit("data",t)}}for(let t of this.pipes)t.end();let e=super.emit("end");return this.removeAllListeners("end"),e}collect(){let e=[];this[q]||(e.dataLength=0);let t=this.promise();return this.on("data",s=>{e.push(s),this[q]||(e.dataLength+=s.length)}),t.then(()=>e)}concat(){return this[q]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then(e=>this[q]?Promise.reject(new Error("cannot concat in objectMode")):this[Y]?e.join(""):Buffer.concat(e,e.dataLength))}promise(){return new Promise((e,t)=>{this.on(W,()=>t(new Error("stream destroyed"))),this.on("error",s=>t(s)),this.on("end",()=>e())})}[Th](){return{next:()=>{let t=this.read();if(t!==null)return Promise.resolve({done:!1,value:t});if(this[Pe])return Promise.resolve({done:!0});let s=null,i=null,n=c=>{this.removeListener("data",o),this.removeListener("end",a),i(c)},o=c=>{this.removeListener("error",n),this.removeListener("end",a),this.pause(),s({value:c,done:!!this[Pe]})},a=()=>{this.removeListener("error",n),this.removeListener("data",o),s({done:!0})},l=()=>n(new Error("stream destroyed"));return new Promise((c,h)=>{i=h,s=c,this.once(W,l),this.once("error",n),this.once("end",a),this.once("data",o)})}}}[Lh](){return{next:()=>{let t=this.read();return{value:t,done:t===null}}}}destroy(e){return this[W]?(e?this.emit("error",e):this.emit(W),this):(this[W]=!0,this.buffer.length=0,this[j]=0,typeof this.close=="function"&&!this[Xr]&&this.close(),e?this.emit("error",e):this.emit(W),this)}static isStream(e){return!!e&&(e instanceof Cu||e instanceof Du||e instanceof Ph&&(typeof e.pipe=="function"||typeof e.write=="function"&&typeof e.end=="function"))}}});var Zi=y(Q=>{"use strict";u();var Ui=require("assert"),Ye=require("buffer").Buffer,ku=require("zlib"),Dt=Q.constants=mu(),jh=Li(),bu=Ye.concat,gt=Symbol("_superWrite"),zt=class extends Error{constructor(e){super("zlib: "+e.message),this.code=e.code,this.errno=e.errno,this.code||(this.code="ZLIB_ERROR"),this.message="zlib: "+e.message,Error.captureStackTrace(this,this.constructor)}get name(){return"ZlibError"}},Uh=Symbol("opts"),Cr=Symbol("flushFlag"),Su=Symbol("finishFlushFlag"),Ki=Symbol("fullFlushFlag"),B=Symbol("handle"),rs=Symbol("onError"),Wt=Symbol("sawError"),Ni=Symbol("level"),Mi=Symbol("strategy"),Ii=Symbol("ended"),s0=Symbol("_defaultFullFlush"),ss=class extends jh{constructor(e,t){if(!e||typeof e!="object")throw new TypeError("invalid options for ZlibBase constructor");super(e),this[Wt]=!1,this[Ii]=!1,this[Uh]=e,this[Cr]=e.flush,this[Su]=e.finishFlush;try{this[B]=new ku[t](e)}catch(s){throw new zt(s)}this[rs]=s=>{this[Wt]||(this[Wt]=!0,this.close(),this.emit("error",s))},this[B].on("error",s=>this[rs](new zt(s))),this.once("end",()=>this.close)}close(){this[B]&&(this[B].close(),this[B]=null,this.emit("close"))}reset(){if(!this[Wt])return Ui(this[B],"zlib binding closed"),this[B].reset()}flush(e){this.ended||(typeof e!="number"&&(e=this[Ki]),this.write(Object.assign(Ye.alloc(0),{[Cr]:e})))}end(e,t,s){return e&&this.write(e,t),this.flush(this[Su]),this[Ii]=!0,super.end(null,null,s)}get ended(){return this[Ii]}write(e,t,s){if(typeof t=="function"&&(s=t,t="utf8"),typeof e=="string"&&(e=Ye.from(e,t)),this[Wt])return;Ui(this[B],"zlib binding closed");let i=this[B]._handle,n=i.close;i.close=()=>{};let o=this[B].close;this[B].close=()=>{},Ye.concat=c=>c;let a;try{let c=typeof e[Cr]=="number"?e[Cr]:this[Cr];a=this[B]._processChunk(e,c),Ye.concat=bu}catch(c){Ye.concat=bu,this[rs](new zt(c))}finally{this[B]&&(this[B]._handle=i,i.close=n,this[B].close=o,this[B].removeAllListeners("error"))}this[B]&&this[B].on("error",c=>this[rs](new zt(c)));let l;if(a)if(Array.isArray(a)&&a.length>0){l=this[gt](Ye.from(a[0]));for(let c=1;c<a.length;c++)l=this[gt](a[c])}else l=this[gt](Ye.from(a));return s&&s(),l}[gt](e){return super.write(e)}},Me=class extends ss{constructor(e,t){e=e||{},e.flush=e.flush||Dt.Z_NO_FLUSH,e.finishFlush=e.finishFlush||Dt.Z_FINISH,super(e,t),this[Ki]=Dt.Z_FULL_FLUSH,this[Ni]=e.level,this[Mi]=e.strategy}params(e,t){if(!this[Wt]){if(!this[B])throw new Error("cannot switch params when binding is closed");if(!this[B].params)throw new Error("not supported in this implementation");if(this[Ni]!==e||this[Mi]!==t){this.flush(Dt.Z_SYNC_FLUSH),Ui(this[B],"zlib binding closed");let s=this[B].flush;this[B].flush=(i,n)=>{this.flush(i),n()};try{this[B].params(e,t)}finally{this[B].flush=s}this[B]&&(this[Ni]=e,this[Mi]=t)}}}},$i=class extends Me{constructor(e){super(e,"Deflate")}},qi=class extends Me{constructor(e){super(e,"Inflate")}},ji=Symbol("_portable"),Wi=class extends Me{constructor(e){super(e,"Gzip"),this[ji]=e&&!!e.portable}[gt](e){return this[ji]?(this[ji]=!1,e[9]=255,super[gt](e)):super[gt](e)}},zi=class extends Me{constructor(e){super(e,"Gunzip")}},Gi=class extends Me{constructor(e){super(e,"DeflateRaw")}},Hi=class extends Me{constructor(e){super(e,"InflateRaw")}},Ji=class extends Me{constructor(e){super(e,"Unzip")}},is=class extends ss{constructor(e,t){e=e||{},e.flush=e.flush||Dt.BROTLI_OPERATION_PROCESS,e.finishFlush=e.finishFlush||Dt.BROTLI_OPERATION_FINISH,super(e,t),this[Ki]=Dt.BROTLI_OPERATION_FLUSH}},Vi=class extends is{constructor(e){super(e,"BrotliCompress")}},Yi=class extends is{constructor(e){super(e,"BrotliDecompress")}};Q.Deflate=$i;Q.Inflate=qi;Q.Gzip=Wi;Q.Gunzip=zi;Q.DeflateRaw=Gi;Q.InflateRaw=Hi;Q.Unzip=Ji;typeof ku.BrotliCompress=="function"?(Q.BrotliCompress=Vi,Q.BrotliDecompress=Yi):Q.BrotliCompress=Q.BrotliDecompress=class{constructor(){throw new Error("Brotli is not supported in this version of Node.js")}}});var Gt=y((o0,_u)=>{u();var $h=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform;_u.exports=$h!=="win32"?r=>r:r=>r&&r.replace(/\\/g,"/")});var ns=y((a0,vu)=>{"use strict";u();var qh=Kr(),Xi=Gt(),Qi=Symbol("slurp");vu.exports=class extends qh{constructor(e,t,s){switch(super(),this.pause(),this.extended=t,this.globalExtended=s,this.header=e,this.startBlockSize=512*Math.ceil(e.size/512),this.blockRemain=this.startBlockSize,this.remain=e.size,this.type=e.type,this.meta=!1,this.ignore=!1,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}this.path=Xi(e.path),this.mode=e.mode,this.mode&&(this.mode=this.mode&4095),this.uid=e.uid,this.gid=e.gid,this.uname=e.uname,this.gname=e.gname,this.size=e.size,this.mtime=e.mtime,this.atime=e.atime,this.ctime=e.ctime,this.linkpath=Xi(e.linkpath),this.uname=e.uname,this.gname=e.gname,t&&this[Qi](t),s&&this[Qi](s,!0)}write(e){let t=e.length;if(t>this.blockRemain)throw new Error("writing more to entry than is appropriate");let s=this.remain,i=this.blockRemain;return this.remain=Math.max(0,s-t),this.blockRemain=Math.max(0,i-t),this.ignore?!0:s>=t?super.write(e):super.write(e.slice(0,s))}[Qi](e,t){for(let s in e)e[s]!==null&&e[s]!==void 0&&!(t&&s==="path")&&(this[s]=s==="path"||s==="linkpath"?Xi(e[s]):e[s])}}});var en=y(os=>{"use strict";u();os.name=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"]]);os.code=new Map(Array.from(os.name).map(r=>[r[1],r[0]]))});var Ou=y((l0,xu)=>{"use strict";u();var Wh=(r,e)=>{if(Number.isSafeInteger(r))r<0?Gh(r,e):zh(r,e);else throw Error("cannot encode number outside of javascript safe integer range");return e},zh=(r,e)=>{e[0]=128;for(var t=e.length;t>1;t--)e[t-1]=r&255,r=Math.floor(r/256)},Gh=(r,e)=>{e[0]=255;var t=!1;r=r*-1;for(var s=e.length;s>1;s--){var i=r&255;r=Math.floor(r/256),t?e[s-1]=Ru(i):i===0?e[s-1]=0:(t=!0,e[s-1]=Bu(i))}},Hh=r=>{let e=r[0],t=e===128?Vh(r.slice(1,r.length)):e===255?Jh(r):null;if(t===null)throw Error("invalid base256 encoding");if(!Number.isSafeInteger(t))throw Error("parsed number outside of javascript safe integer range");return t},Jh=r=>{for(var e=r.length,t=0,s=!1,i=e-1;i>-1;i--){var n=r[i],o;s?o=Ru(n):n===0?o=n:(s=!0,o=Bu(n)),o!==0&&(t-=o*Math.pow(256,e-i-1))}return t},Vh=r=>{for(var e=r.length,t=0,s=e-1;s>-1;s--){var i=r[s];i!==0&&(t+=i*Math.pow(256,e-s-1))}return t},Ru=r=>(255^r)&255,Bu=r=>(255^r)+1&255;xu.exports={encode:Wh,parse:Hh}});var Jt=y((h0,Tu)=>{"use strict";u();var tn=en(),Ht=require("path").posix,Pu=Ou(),rn=Symbol("slurp"),ee=Symbol("type"),on=class{constructor(e,t,s,i){this.cksumValid=!1,this.needPax=!1,this.nullBlock=!1,this.block=null,this.path=null,this.mode=null,this.uid=null,this.gid=null,this.size=null,this.mtime=null,this.cksum=null,this[ee]="0",this.linkpath=null,this.uname=null,this.gname=null,this.devmaj=0,this.devmin=0,this.atime=null,this.ctime=null,Buffer.isBuffer(e)?this.decode(e,t||0,s,i):e&&this.set(e)}decode(e,t,s,i){if(t||(t=0),!e||!(e.length>=t+512))throw new Error("need 512 bytes for header");if(this.path=Et(e,t,100),this.mode=Ke(e,t+100,8),this.uid=Ke(e,t+108,8),this.gid=Ke(e,t+116,8),this.size=Ke(e,t+124,12),this.mtime=sn(e,t+136,12),this.cksum=Ke(e,t+148,12),this[rn](s),this[rn](i,!0),this[ee]=Et(e,t+156,1),this[ee]===""&&(this[ee]="0"),this[ee]==="0"&&this.path.slice(-1)==="/"&&(this[ee]="5"),this[ee]==="5"&&(this.size=0),this.linkpath=Et(e,t+157,100),e.slice(t+257,t+265).toString()==="ustar\x0000")if(this.uname=Et(e,t+265,32),this.gname=Et(e,t+297,32),this.devmaj=Ke(e,t+329,8),this.devmin=Ke(e,t+337,8),e[t+475]!==0){let o=Et(e,t+345,155);this.path=o+"/"+this.path}else{let o=Et(e,t+345,130);o&&(this.path=o+"/"+this.path),this.atime=sn(e,t+476,12),this.ctime=sn(e,t+488,12)}let n=8*32;for(let o=t;o<t+148;o++)n+=e[o];for(let o=t+156;o<t+512;o++)n+=e[o];this.cksumValid=n===this.cksum,this.cksum===null&&n===8*32&&(this.nullBlock=!0)}[rn](e,t){for(let s in e)e[s]!==null&&e[s]!==void 0&&!(t&&s==="path")&&(this[s]=e[s])}encode(e,t){if(e||(e=this.block=Buffer.alloc(512),t=0),t||(t=0),!(e.length>=t+512))throw new Error("need 512 bytes for header");let s=this.ctime||this.atime?130:155,i=Yh(this.path||"",s),n=i[0],o=i[1];this.needPax=i[2],this.needPax=yt(e,t,100,n)||this.needPax,this.needPax=Ze(e,t+100,8,this.mode)||this.needPax,this.needPax=Ze(e,t+108,8,this.uid)||this.needPax,this.needPax=Ze(e,t+116,8,this.gid)||this.needPax,this.needPax=Ze(e,t+124,12,this.size)||this.needPax,this.needPax=nn(e,t+136,12,this.mtime)||this.needPax,e[t+156]=this[ee].charCodeAt(0),this.needPax=yt(e,t+157,100,this.linkpath)||this.needPax,e.write("ustar\x0000",t+257,8),this.needPax=yt(e,t+265,32,this.uname)||this.needPax,this.needPax=yt(e,t+297,32,this.gname)||this.needPax,this.needPax=Ze(e,t+329,8,this.devmaj)||this.needPax,this.needPax=Ze(e,t+337,8,this.devmin)||this.needPax,this.needPax=yt(e,t+345,s,o)||this.needPax,e[t+475]!==0?this.needPax=yt(e,t+345,155,o)||this.needPax:(this.needPax=yt(e,t+345,130,o)||this.needPax,this.needPax=nn(e,t+476,12,this.atime)||this.needPax,this.needPax=nn(e,t+488,12,this.ctime)||this.needPax);let a=8*32;for(let l=t;l<t+148;l++)a+=e[l];for(let l=t+156;l<t+512;l++)a+=e[l];return this.cksum=a,Ze(e,t+148,8,this.cksum),this.cksumValid=!0,this.needPax}set(e){for(let t in e)e[t]!==null&&e[t]!==void 0&&(this[t]=e[t])}get type(){return tn.name.get(this[ee])||this[ee]}get typeKey(){return this[ee]}set type(e){tn.code.has(e)?this[ee]=tn.code.get(e):this[ee]=e}},Yh=(r,e)=>{let s=r,i="",n,o=Ht.parse(r).root||".";if(Buffer.byteLength(s)<100)n=[s,i,!1];else{i=Ht.dirname(s),s=Ht.basename(s);do Buffer.byteLength(s)<=100&&Buffer.byteLength(i)<=e?n=[s,i,!1]:Buffer.byteLength(s)>100&&Buffer.byteLength(i)<=e?n=[s.slice(0,100-1),i,!0]:(s=Ht.join(Ht.basename(i),s),i=Ht.dirname(i));while(i!==o&&!n);n||(n=[r.slice(0,100-1),"",!0])}return n},Et=(r,e,t)=>r.slice(e,e+t).toString("utf8").replace(/\0.*/,""),sn=(r,e,t)=>Kh(Ke(r,e,t)),Kh=r=>r===null?null:new Date(r*1e3),Ke=(r,e,t)=>r[e]&128?Pu.parse(r.slice(e,e+t)):Xh(r,e,t),Zh=r=>isNaN(r)?null:r,Xh=(r,e,t)=>Zh(parseInt(r.slice(e,e+t).toString("utf8").replace(/\0.*$/,"").trim(),8)),Qh={12:8589934591,8:2097151},Ze=(r,e,t,s)=>s===null?!1:s>Qh[t]||s<0?(Pu.encode(s,r.slice(e,e+t)),!0):(ef(r,e,t,s),!1),ef=(r,e,t,s)=>r.write(tf(s,t),e,t,"ascii"),tf=(r,e)=>rf(Math.floor(r).toString(8),e),rf=(r,e)=>(r.length===e-1?r:new Array(e-r.length-1).join("0")+r+" ")+"\0",nn=(r,e,t,s)=>s===null?!1:Ze(r,e,t,s.getTime()/1e3),sf=new Array(156).join("\0"),yt=(r,e,t,s)=>s===null?!1:(r.write(s+sf,e,t,"utf8"),s.length!==Buffer.byteLength(s)||s.length>t);Tu.exports=on});var us=y((f0,Lu)=>{"use strict";u();var nf=Jt(),of=require("path"),Fr=class{constructor(e,t){this.atime=e.atime||null,this.charset=e.charset||null,this.comment=e.comment||null,this.ctime=e.ctime||null,this.gid=e.gid||null,this.gname=e.gname||null,this.linkpath=e.linkpath||null,this.mtime=e.mtime||null,this.path=e.path||null,this.size=e.size||null,this.uid=e.uid||null,this.uname=e.uname||null,this.dev=e.dev||null,this.ino=e.ino||null,this.nlink=e.nlink||null,this.global=t||!1}encode(){let e=this.encodeBody();if(e==="")return null;let t=Buffer.byteLength(e),s=512*Math.ceil(1+t/512),i=Buffer.allocUnsafe(s);for(let n=0;n<512;n++)i[n]=0;new nf({path:("PaxHeader/"+of.basename(this.path)).slice(0,99),mode:this.mode||420,uid:this.uid||null,gid:this.gid||null,size:t,mtime:this.mtime||null,type:this.global?"GlobalExtendedHeader":"ExtendedHeader",linkpath:"",uname:this.uname||"",gname:this.gname||"",devmaj:0,devmin:0,atime:this.atime||null,ctime:this.ctime||null}).encode(i),i.write(e,512,t,"utf8");for(let n=t+512;n<i.length;n++)i[n]=0;return i}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(e){if(this[e]===null||this[e]===void 0)return"";let t=this[e]instanceof Date?this[e].getTime()/1e3:this[e],s=" "+(e==="dev"||e==="ino"||e==="nlink"?"SCHILY.":"")+e+"="+t+`
3
+ `,i=Buffer.byteLength(s),n=Math.floor(Math.log(i)/Math.log(10))+1;return i+n>=Math.pow(10,n)&&(n+=1),n+i+s}};Fr.parse=(r,e,t)=>new Fr(uf(af(r),e),t);var uf=(r,e)=>e?Object.keys(r).reduce((t,s)=>(t[s]=r[s],t),e):r,af=r=>r.replace(/\n$/,"").split(`
4
+ `).reduce(cf,Object.create(null)),cf=(r,e)=>{let t=parseInt(e,10);if(t!==Buffer.byteLength(e)+1)return r;e=e.slice((t+" ").length);let s=e.split("="),i=s.shift().replace(/^SCHILY\.(dev|ino|nlink)/,"$1");if(!i)return r;let n=s.join("=");return r[i]=/^([A-Z]+\.)?([mac]|birth|creation)time$/.test(i)?new Date(n*1e3):/^[0-9]+$/.test(n)?+n:n,r};Lu.exports=Fr});var Vt=y((p0,Nu)=>{u();Nu.exports=r=>{let e=r.length-1,t=-1;for(;e>-1&&r.charAt(e)==="/";)t=e,e--;return t===-1?r:r.slice(0,t)}});var as=y((m0,Mu)=>{"use strict";u();Mu.exports=r=>class extends r{warn(e,t,s={}){this.file&&(s.file=this.file),this.cwd&&(s.cwd=this.cwd),s.code=t instanceof Error&&t.code||e,s.tarCode=e,!this.strict&&s.recoverable!==!1?(t instanceof Error&&(s=Object.assign(t,s),t=t.message),this.emit("warn",s.tarCode,t,s)):t instanceof Error?this.emit("error",Object.assign(t,s)):this.emit("error",Object.assign(new Error(`${e}: ${t}`),s))}}});var an=y((D0,Iu)=>{"use strict";u();var cs=["|","<",">","?",":"],un=cs.map(r=>String.fromCharCode(61440+r.charCodeAt(0))),lf=new Map(cs.map((r,e)=>[r,un[e]])),hf=new Map(un.map((r,e)=>[r,cs[e]]));Iu.exports={encode:r=>cs.reduce((e,t)=>e.split(t).join(lf.get(t)),r),decode:r=>un.reduce((e,t)=>e.split(t).join(hf.get(t)),r)}});var cn=y((g0,Uu)=>{u();var{isAbsolute:ff,parse:ju}=require("path").win32;Uu.exports=r=>{let e="",t=ju(r);for(;ff(r)||t.root;){let s=r.charAt(0)==="/"&&r.slice(0,4)!=="//?/"?"/":t.root;r=r.slice(s.length),e+=s,t=ju(r)}return[e,r]}});var qu=y((E0,$u)=>{"use strict";u();$u.exports=(r,e,t)=>(r&=4095,t&&(r=(r|384)&-19),e&&(r&256&&(r|=64),r&32&&(r|=8),r&4&&(r|=1)),r)});var yn=y((w0,ra)=>{"use strict";u();var Yu=Kr(),Ku=us(),Zu=Jt(),we=require("fs"),Wu=require("path"),Ae=Gt(),pf=Vt(),Xu=(r,e)=>e?(r=Ae(r).replace(/^\.(\/|$)/,""),pf(e)+"/"+r):Ae(r),mf=16*1024*1024,zu=Symbol("process"),Gu=Symbol("file"),Hu=Symbol("directory"),hn=Symbol("symlink"),Ju=Symbol("hardlink"),br=Symbol("header"),ls=Symbol("read"),fn=Symbol("lstat"),hs=Symbol("onlstat"),pn=Symbol("onread"),mn=Symbol("onreadlink"),dn=Symbol("openfile"),Dn=Symbol("onopenfile"),Xe=Symbol("close"),fs=Symbol("mode"),gn=Symbol("awaitDrain"),ln=Symbol("ondrain"),Ce=Symbol("prefix"),Vu=Symbol("hadError"),Qu=as(),df=an(),ea=cn(),ta=qu(),ps=Qu(class extends Yu{constructor(e,t){if(t=t||{},super(t),typeof e!="string")throw new TypeError("path is required");this.path=Ae(e),this.portable=!!t.portable,this.myuid=process.getuid&&process.getuid()||0,this.myuser=process.env.USER||"",this.maxReadSize=t.maxReadSize||mf,this.linkCache=t.linkCache||new Map,this.statCache=t.statCache||new Map,this.preservePaths=!!t.preservePaths,this.cwd=Ae(t.cwd||process.cwd()),this.strict=!!t.strict,this.noPax=!!t.noPax,this.noMtime=!!t.noMtime,this.mtime=t.mtime||null,this.prefix=t.prefix?Ae(t.prefix):null,this.fd=null,this.blockLen=null,this.blockRemain=null,this.buf=null,this.offset=null,this.length=null,this.pos=null,this.remain=null,typeof t.onwarn=="function"&&this.on("warn",t.onwarn);let s=!1;if(!this.preservePaths){let[i,n]=ea(this.path);i&&(this.path=n,s=i)}this.win32=!!t.win32||process.platform==="win32",this.win32&&(this.path=df.decode(this.path.replace(/\\/g,"/")),e=e.replace(/\\/g,"/")),this.absolute=Ae(t.absolute||Wu.resolve(this.cwd,e)),this.path===""&&(this.path="./"),s&&this.warn("TAR_ENTRY_INFO",`stripping ${s} from absolute path`,{entry:this,path:s+this.path}),this.statCache.has(this.absolute)?this[hs](this.statCache.get(this.absolute)):this[fn]()}emit(e,...t){return e==="error"&&(this[Vu]=!0),super.emit(e,...t)}[fn](){we.lstat(this.absolute,(e,t)=>{if(e)return this.emit("error",e);this[hs](t)})}[hs](e){this.statCache.set(this.absolute,e),this.stat=e,e.isFile()||(e.size=0),this.type=gf(e),this.emit("stat",e),this[zu]()}[zu](){switch(this.type){case"File":return this[Gu]();case"Directory":return this[Hu]();case"SymbolicLink":return this[hn]();default:return this.end()}}[fs](e){return ta(e,this.type==="Directory",this.portable)}[Ce](e){return Xu(e,this.prefix)}[br](){this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.header=new Zu({path:this[Ce](this.path),linkpath:this.type==="Link"?this[Ce](this.linkpath):this.linkpath,mode:this[fs](this.stat.mode),uid:this.portable?null:this.stat.uid,gid:this.portable?null:this.stat.gid,size:this.stat.size,mtime:this.noMtime?null:this.mtime||this.stat.mtime,type:this.type,uname:this.portable?null:this.stat.uid===this.myuid?this.myuser:"",atime:this.portable?null:this.stat.atime,ctime:this.portable?null:this.stat.ctime}),this.header.encode()&&!this.noPax&&super.write(new Ku({atime:this.portable?null:this.header.atime,ctime:this.portable?null:this.header.ctime,gid:this.portable?null:this.header.gid,mtime:this.noMtime?null:this.mtime||this.header.mtime,path:this[Ce](this.path),linkpath:this.type==="Link"?this[Ce](this.linkpath):this.linkpath,size:this.header.size,uid:this.portable?null:this.header.uid,uname:this.portable?null:this.header.uname,dev:this.portable?null:this.stat.dev,ino:this.portable?null:this.stat.ino,nlink:this.portable?null:this.stat.nlink}).encode()),super.write(this.header.block)}[Hu](){this.path.slice(-1)!=="/"&&(this.path+="/"),this.stat.size=0,this[br](),this.end()}[hn](){we.readlink(this.absolute,(e,t)=>{if(e)return this.emit("error",e);this[mn](t)})}[mn](e){this.linkpath=Ae(e),this[br](),this.end()}[Ju](e){this.type="Link",this.linkpath=Ae(Wu.relative(this.cwd,e)),this.stat.size=0,this[br](),this.end()}[Gu](){if(this.stat.nlink>1){let e=this.stat.dev+":"+this.stat.ino;if(this.linkCache.has(e)){let t=this.linkCache.get(e);if(t.indexOf(this.cwd)===0)return this[Ju](t)}this.linkCache.set(e,this.absolute)}if(this[br](),this.stat.size===0)return this.end();this[dn]()}[dn](){we.open(this.absolute,"r",(e,t)=>{if(e)return this.emit("error",e);this[Dn](t)})}[Dn](e){if(this.fd=e,this[Vu])return this[Xe]();this.blockLen=512*Math.ceil(this.stat.size/512),this.blockRemain=this.blockLen;let t=Math.min(this.blockLen,this.maxReadSize);this.buf=Buffer.allocUnsafe(t),this.offset=0,this.pos=0,this.remain=this.stat.size,this.length=this.buf.length,this[ls]()}[ls](){let{fd:e,buf:t,offset:s,length:i,pos:n}=this;we.read(e,t,s,i,n,(o,a)=>{if(o)return this[Xe](()=>this.emit("error",o));this[pn](a)})}[Xe](e){we.close(this.fd,e)}[pn](e){if(e<=0&&this.remain>0){let i=new Error("encountered unexpected EOF");return i.path=this.absolute,i.syscall="read",i.code="EOF",this[Xe](()=>this.emit("error",i))}if(e>this.remain){let i=new Error("did not encounter expected EOF");return i.path=this.absolute,i.syscall="read",i.code="EOF",this[Xe](()=>this.emit("error",i))}if(e===this.remain)for(let i=e;i<this.length&&e<this.blockRemain;i++)this.buf[i+this.offset]=0,e++,this.remain++;let t=this.offset===0&&e===this.buf.length?this.buf:this.buf.slice(this.offset,this.offset+e);this.write(t)?this[ln]():this[gn](()=>this[ln]())}[gn](e){this.once("drain",e)}write(e){if(this.blockRemain<e.length){let t=new Error("writing more data than expected");return t.path=this.absolute,this.emit("error",t)}return this.remain-=e.length,this.blockRemain-=e.length,this.pos+=e.length,this.offset+=e.length,super.write(e)}[ln](){if(!this.remain)return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),this[Xe](e=>e?this.emit("error",e):this.end());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[ls]()}}),En=class extends ps{[fn](){this[hs](we.lstatSync(this.absolute))}[hn](){this[mn](we.readlinkSync(this.absolute))}[dn](){this[Dn](we.openSync(this.absolute,"r"))}[ls](){let e=!0;try{let{fd:t,buf:s,offset:i,length:n,pos:o}=this,a=we.readSync(t,s,i,n,o);this[pn](a),e=!1}finally{if(e)try{this[Xe](()=>{})}catch{}}}[gn](e){e()}[Xe](e){we.closeSync(this.fd),e()}},Df=Qu(class extends Yu{constructor(e,t){t=t||{},super(t),this.preservePaths=!!t.preservePaths,this.portable=!!t.portable,this.strict=!!t.strict,this.noPax=!!t.noPax,this.noMtime=!!t.noMtime,this.readEntry=e,this.type=e.type,this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.prefix=t.prefix||null,this.path=Ae(e.path),this.mode=this[fs](e.mode),this.uid=this.portable?null:e.uid,this.gid=this.portable?null:e.gid,this.uname=this.portable?null:e.uname,this.gname=this.portable?null:e.gname,this.size=e.size,this.mtime=this.noMtime?null:t.mtime||e.mtime,this.atime=this.portable?null:e.atime,this.ctime=this.portable?null:e.ctime,this.linkpath=Ae(e.linkpath),typeof t.onwarn=="function"&&this.on("warn",t.onwarn);let s=!1;if(!this.preservePaths){let[i,n]=ea(this.path);i&&(this.path=n,s=i)}this.remain=e.size,this.blockRemain=e.startBlockSize,this.header=new Zu({path:this[Ce](this.path),linkpath:this.type==="Link"?this[Ce](this.linkpath):this.linkpath,mode:this.mode,uid:this.portable?null:this.uid,gid:this.portable?null:this.gid,size:this.size,mtime:this.noMtime?null:this.mtime,type:this.type,uname:this.portable?null:this.uname,atime:this.portable?null:this.atime,ctime:this.portable?null:this.ctime}),s&&this.warn("TAR_ENTRY_INFO",`stripping ${s} from absolute path`,{entry:this,path:s+this.path}),this.header.encode()&&!this.noPax&&super.write(new Ku({atime:this.portable?null:this.atime,ctime:this.portable?null:this.ctime,gid:this.portable?null:this.gid,mtime:this.noMtime?null:this.mtime,path:this[Ce](this.path),linkpath:this.type==="Link"?this[Ce](this.linkpath):this.linkpath,size:this.size,uid:this.portable?null:this.uid,uname:this.portable?null:this.uname,dev:this.portable?null:this.readEntry.dev,ino:this.portable?null:this.readEntry.ino,nlink:this.portable?null:this.readEntry.nlink}).encode()),super.write(this.header.block),e.pipe(this)}[Ce](e){return Xu(e,this.prefix)}[fs](e){return ta(e,this.type==="Directory",this.portable)}write(e){let t=e.length;if(t>this.blockRemain)throw new Error("writing more to entry than is appropriate");return this.blockRemain-=t,super.write(e)}end(){return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),super.end()}});ps.Sync=En;ps.Tar=Df;var gf=r=>r.isFile()?"File":r.isDirectory()?"Directory":r.isSymbolicLink()?"SymbolicLink":"Unsupported";ra.exports=ps});var ia=y((C0,sa)=>{"use strict";u();sa.exports=function(r){r.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}});var An=y((F0,na)=>{"use strict";u();na.exports=k;k.Node=At;k.create=k;function k(r){var e=this;if(e instanceof k||(e=new k),e.tail=null,e.head=null,e.length=0,r&&typeof r.forEach=="function")r.forEach(function(i){e.push(i)});else if(arguments.length>0)for(var t=0,s=arguments.length;t<s;t++)e.push(arguments[t]);return e}k.prototype.removeNode=function(r){if(r.list!==this)throw new Error("removing node which does not belong to this list");var e=r.next,t=r.prev;return e&&(e.prev=t),t&&(t.next=e),r===this.head&&(this.head=e),r===this.tail&&(this.tail=t),r.list.length--,r.next=null,r.prev=null,r.list=null,e};k.prototype.unshiftNode=function(r){if(r!==this.head){r.list&&r.list.removeNode(r);var e=this.head;r.list=this,r.next=e,e&&(e.prev=r),this.head=r,this.tail||(this.tail=r),this.length++}};k.prototype.pushNode=function(r){if(r!==this.tail){r.list&&r.list.removeNode(r);var e=this.tail;r.list=this,r.prev=e,e&&(e.next=r),this.tail=r,this.head||(this.head=r),this.length++}};k.prototype.push=function(){for(var r=0,e=arguments.length;r<e;r++)yf(this,arguments[r]);return this.length};k.prototype.unshift=function(){for(var r=0,e=arguments.length;r<e;r++)Af(this,arguments[r]);return this.length};k.prototype.pop=function(){if(!!this.tail){var r=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,r}};k.prototype.shift=function(){if(!!this.head){var r=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,r}};k.prototype.forEach=function(r,e){e=e||this;for(var t=this.head,s=0;t!==null;s++)r.call(e,t.value,s,this),t=t.next};k.prototype.forEachReverse=function(r,e){e=e||this;for(var t=this.tail,s=this.length-1;t!==null;s--)r.call(e,t.value,s,this),t=t.prev};k.prototype.get=function(r){for(var e=0,t=this.head;t!==null&&e<r;e++)t=t.next;if(e===r&&t!==null)return t.value};k.prototype.getReverse=function(r){for(var e=0,t=this.tail;t!==null&&e<r;e++)t=t.prev;if(e===r&&t!==null)return t.value};k.prototype.map=function(r,e){e=e||this;for(var t=new k,s=this.head;s!==null;)t.push(r.call(e,s.value,this)),s=s.next;return t};k.prototype.mapReverse=function(r,e){e=e||this;for(var t=new k,s=this.tail;s!==null;)t.push(r.call(e,s.value,this)),s=s.prev;return t};k.prototype.reduce=function(r,e){var t,s=this.head;if(arguments.length>1)t=e;else if(this.head)s=this.head.next,t=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=0;s!==null;i++)t=r(t,s.value,i),s=s.next;return t};k.prototype.reduceReverse=function(r,e){var t,s=this.tail;if(arguments.length>1)t=e;else if(this.tail)s=this.tail.prev,t=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=this.length-1;s!==null;i--)t=r(t,s.value,i),s=s.prev;return t};k.prototype.toArray=function(){for(var r=new Array(this.length),e=0,t=this.head;t!==null;e++)r[e]=t.value,t=t.next;return r};k.prototype.toArrayReverse=function(){for(var r=new Array(this.length),e=0,t=this.tail;t!==null;e++)r[e]=t.value,t=t.prev;return r};k.prototype.slice=function(r,e){e=e||this.length,e<0&&(e+=this.length),r=r||0,r<0&&(r+=this.length);var t=new k;if(e<r||e<0)return t;r<0&&(r=0),e>this.length&&(e=this.length);for(var s=0,i=this.head;i!==null&&s<r;s++)i=i.next;for(;i!==null&&s<e;s++,i=i.next)t.push(i.value);return t};k.prototype.sliceReverse=function(r,e){e=e||this.length,e<0&&(e+=this.length),r=r||0,r<0&&(r+=this.length);var t=new k;if(e<r||e<0)return t;r<0&&(r=0),e>this.length&&(e=this.length);for(var s=this.length,i=this.tail;i!==null&&s>e;s--)i=i.prev;for(;i!==null&&s>r;s--,i=i.prev)t.push(i.value);return t};k.prototype.splice=function(r,e,...t){r>this.length&&(r=this.length-1),r<0&&(r=this.length+r);for(var s=0,i=this.head;i!==null&&s<r;s++)i=i.next;for(var n=[],s=0;i&&s<e;s++)n.push(i.value),i=this.removeNode(i);i===null&&(i=this.tail),i!==this.head&&i!==this.tail&&(i=i.prev);for(var s=0;s<t.length;s++)i=Ef(this,i,t[s]);return n};k.prototype.reverse=function(){for(var r=this.head,e=this.tail,t=r;t!==null;t=t.prev){var s=t.prev;t.prev=t.next,t.next=s}return this.head=e,this.tail=r,this};function Ef(r,e,t){var s=e===r.head?new At(t,null,e,r):new At(t,e,e.next,r);return s.next===null&&(r.tail=s),s.prev===null&&(r.head=s),r.length++,s}function yf(r,e){r.tail=new At(e,r.tail,null,r),r.head||(r.head=r.tail),r.length++}function Af(r,e){r.head=new At(e,null,r.head,r),r.tail||(r.tail=r.head),r.length++}function At(r,e,t,s){if(!(this instanceof At))return new At(r,e,t,s);this.list=s,this.value=r,e?(e.next=this,this.prev=e):this.prev=null,t?(t.prev=this,this.next=t):this.next=null}try{ia()(k)}catch{}});var Cs=y((S0,fa)=>{"use strict";u();var As=class{constructor(e,t){this.path=e||"./",this.absolute=t,this.entry=null,this.stat=null,this.readdir=null,this.pending=!1,this.ignore=!1,this.piped=!1}},wf=Kr(),Cf=Zi(),Ff=ns(),Rn=yn(),bf=Rn.Sync,Sf=Rn.Tar,kf=An(),oa=Buffer.alloc(1024),Ds=Symbol("onStat"),ms=Symbol("ended"),Fe=Symbol("queue"),Yt=Symbol("current"),wt=Symbol("process"),ds=Symbol("processing"),ua=Symbol("processJob"),be=Symbol("jobs"),wn=Symbol("jobDone"),gs=Symbol("addFSEntry"),aa=Symbol("addTarEntry"),Sn=Symbol("stat"),kn=Symbol("readdir"),Es=Symbol("onreaddir"),ys=Symbol("pipe"),ca=Symbol("entry"),Cn=Symbol("entryOpt"),_n=Symbol("writeEntryClass"),ha=Symbol("write"),Fn=Symbol("ondrain"),ws=require("fs"),la=require("path"),_f=as(),bn=Gt(),Bn=_f(class extends wf{constructor(e){super(e),e=e||Object.create(null),this.opt=e,this.file=e.file||"",this.cwd=e.cwd||process.cwd(),this.maxReadSize=e.maxReadSize,this.preservePaths=!!e.preservePaths,this.strict=!!e.strict,this.noPax=!!e.noPax,this.prefix=bn(e.prefix||""),this.linkCache=e.linkCache||new Map,this.statCache=e.statCache||new Map,this.readdirCache=e.readdirCache||new Map,this[_n]=Rn,typeof e.onwarn=="function"&&this.on("warn",e.onwarn),this.portable=!!e.portable,this.zip=null,e.gzip?(typeof e.gzip!="object"&&(e.gzip={}),this.portable&&(e.gzip.portable=!0),this.zip=new Cf.Gzip(e.gzip),this.zip.on("data",t=>super.write(t)),this.zip.on("end",t=>super.end()),this.zip.on("drain",t=>this[Fn]()),this.on("resume",t=>this.zip.resume())):this.on("drain",this[Fn]),this.noDirRecurse=!!e.noDirRecurse,this.follow=!!e.follow,this.noMtime=!!e.noMtime,this.mtime=e.mtime||null,this.filter=typeof e.filter=="function"?e.filter:t=>!0,this[Fe]=new kf,this[be]=0,this.jobs=+e.jobs||4,this[ds]=!1,this[ms]=!1}[ha](e){return super.write(e)}add(e){return this.write(e),this}end(e){return e&&this.write(e),this[ms]=!0,this[wt](),this}write(e){if(this[ms])throw new Error("write after end");return e instanceof Ff?this[aa](e):this[gs](e),this.flowing}[aa](e){let t=bn(la.resolve(this.cwd,e.path));if(!this.filter(e.path,e))e.resume();else{let s=new As(e.path,t,!1);s.entry=new Sf(e,this[Cn](s)),s.entry.on("end",i=>this[wn](s)),this[be]+=1,this[Fe].push(s)}this[wt]()}[gs](e){let t=bn(la.resolve(this.cwd,e));this[Fe].push(new As(e,t)),this[wt]()}[Sn](e){e.pending=!0,this[be]+=1;let t=this.follow?"stat":"lstat";ws[t](e.absolute,(s,i)=>{e.pending=!1,this[be]-=1,s?this.emit("error",s):this[Ds](e,i)})}[Ds](e,t){this.statCache.set(e.absolute,t),e.stat=t,this.filter(e.path,t)||(e.ignore=!0),this[wt]()}[kn](e){e.pending=!0,this[be]+=1,ws.readdir(e.absolute,(t,s)=>{if(e.pending=!1,this[be]-=1,t)return this.emit("error",t);this[Es](e,s)})}[Es](e,t){this.readdirCache.set(e.absolute,t),e.readdir=t,this[wt]()}[wt](){if(!this[ds]){this[ds]=!0;for(let e=this[Fe].head;e!==null&&this[be]<this.jobs;e=e.next)if(this[ua](e.value),e.value.ignore){let t=e.next;this[Fe].removeNode(e),e.next=t}this[ds]=!1,this[ms]&&!this[Fe].length&&this[be]===0&&(this.zip?this.zip.end(oa):(super.write(oa),super.end()))}}get[Yt](){return this[Fe]&&this[Fe].head&&this[Fe].head.value}[wn](e){this[Fe].shift(),this[be]-=1,this[wt]()}[ua](e){if(!e.pending){if(e.entry){e===this[Yt]&&!e.piped&&this[ys](e);return}if(e.stat||(this.statCache.has(e.absolute)?this[Ds](e,this.statCache.get(e.absolute)):this[Sn](e)),!!e.stat&&!e.ignore&&!(!this.noDirRecurse&&e.stat.isDirectory()&&!e.readdir&&(this.readdirCache.has(e.absolute)?this[Es](e,this.readdirCache.get(e.absolute)):this[kn](e),!e.readdir))){if(e.entry=this[ca](e),!e.entry){e.ignore=!0;return}e===this[Yt]&&!e.piped&&this[ys](e)}}}[Cn](e){return{onwarn:(t,s,i)=>this.warn(t,s,i),noPax:this.noPax,cwd:this.cwd,absolute:e.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}}[ca](e){this[be]+=1;try{return new this[_n](e.path,this[Cn](e)).on("end",()=>this[wn](e)).on("error",t=>this.emit("error",t))}catch(t){this.emit("error",t)}}[Fn](){this[Yt]&&this[Yt].entry&&this[Yt].entry.resume()}[ys](e){e.piped=!0,e.readdir&&e.readdir.forEach(i=>{let n=e.path,o=n==="./"?"":n.replace(/\/*$/,"/");this[gs](o+i)});let t=e.entry,s=this.zip;s?t.on("data",i=>{s.write(i)||t.pause()}):t.on("data",i=>{super.write(i)||t.pause()})}pause(){return this.zip&&this.zip.pause(),super.pause()}}),vn=class extends Bn{constructor(e){super(e),this[_n]=bf}pause(){}resume(){}[Sn](e){let t=this.follow?"statSync":"lstatSync";this[Ds](e,ws[t](e.absolute))}[kn](e,t){this[Es](e,ws.readdirSync(e.absolute))}[ys](e){let t=e.entry,s=this.zip;e.readdir&&e.readdir.forEach(i=>{let n=e.path,o=n==="./"?"":n.replace(/\/*$/,"/");this[gs](o+i)}),s?t.on("data",i=>{s.write(i)}):t.on("data",i=>{super[ha](i)})}};Bn.Sync=vn;fa.exports=Bn});var sr=y(kr=>{"use strict";u();var vf=Li(),Rf=require("events").EventEmitter,K=require("fs"),Pn=K.writev;if(!Pn){let r=process.binding("fs"),e=r.FSReqWrap||r.FSReqCallback;Pn=(t,s,i,n)=>{let o=(l,c)=>n(l,c,s),a=new e;a.oncomplete=o,r.writeBuffers(t,s,i,a)}}var tr=Symbol("_autoClose"),de=Symbol("_close"),Sr=Symbol("_ended"),R=Symbol("_fd"),pa=Symbol("_finished"),et=Symbol("_flags"),xn=Symbol("_flush"),Tn=Symbol("_handleChunk"),Ln=Symbol("_makeBuf"),_s=Symbol("_mode"),Fs=Symbol("_needDrain"),Qt=Symbol("_onerror"),rr=Symbol("_onopen"),On=Symbol("_onread"),Zt=Symbol("_onwrite"),tt=Symbol("_open"),Ie=Symbol("_path"),Ct=Symbol("_pos"),Se=Symbol("_queue"),Xt=Symbol("_read"),ma=Symbol("_readSize"),Qe=Symbol("_reading"),bs=Symbol("_remain"),da=Symbol("_size"),Ss=Symbol("_write"),Kt=Symbol("_writing"),ks=Symbol("_defaultFlag"),er=Symbol("_errored"),vs=class extends vf{constructor(e,t){if(t=t||{},super(t),this.readable=!0,this.writable=!1,typeof e!="string")throw new TypeError("path must be a string");this[er]=!1,this[R]=typeof t.fd=="number"?t.fd:null,this[Ie]=e,this[ma]=t.readSize||16*1024*1024,this[Qe]=!1,this[da]=typeof t.size=="number"?t.size:1/0,this[bs]=this[da],this[tr]=typeof t.autoClose=="boolean"?t.autoClose:!0,typeof this[R]=="number"?this[Xt]():this[tt]()}get fd(){return this[R]}get path(){return this[Ie]}write(){throw new TypeError("this is a readable stream")}end(){throw new TypeError("this is a readable stream")}[tt](){K.open(this[Ie],"r",(e,t)=>this[rr](e,t))}[rr](e,t){e?this[Qt](e):(this[R]=t,this.emit("open",t),this[Xt]())}[Ln](){return Buffer.allocUnsafe(Math.min(this[ma],this[bs]))}[Xt](){if(!this[Qe]){this[Qe]=!0;let e=this[Ln]();if(e.length===0)return process.nextTick(()=>this[On](null,0,e));K.read(this[R],e,0,e.length,null,(t,s,i)=>this[On](t,s,i))}}[On](e,t,s){this[Qe]=!1,e?this[Qt](e):this[Tn](t,s)&&this[Xt]()}[de](){if(this[tr]&&typeof this[R]=="number"){let e=this[R];this[R]=null,K.close(e,t=>t?this.emit("error",t):this.emit("close"))}}[Qt](e){this[Qe]=!0,this[de](),this.emit("error",e)}[Tn](e,t){let s=!1;return this[bs]-=e,e>0&&(s=super.write(e<t.length?t.slice(0,e):t)),(e===0||this[bs]<=0)&&(s=!1,this[de](),super.end()),s}emit(e,t){switch(e){case"prefinish":case"finish":break;case"drain":typeof this[R]=="number"&&this[Xt]();break;case"error":return this[er]?void 0:(this[er]=!0,super.emit(e,t));default:return super.emit(e,t)}}},Nn=class extends vs{[tt](){let e=!0;try{this[rr](null,K.openSync(this[Ie],"r")),e=!1}finally{e&&this[de]()}}[Xt](){let e=!0;try{if(!this[Qe]){this[Qe]=!0;do{let t=this[Ln](),s=t.length===0?0:K.readSync(this[R],t,0,t.length,null);if(!this[Tn](s,t))break}while(!0);this[Qe]=!1}e=!1}finally{e&&this[de]()}}[de](){if(this[tr]&&typeof this[R]=="number"){let e=this[R];this[R]=null,K.closeSync(e),this.emit("close")}}},Rs=class extends Rf{constructor(e,t){t=t||{},super(t),this.readable=!1,this.writable=!0,this[er]=!1,this[Kt]=!1,this[Sr]=!1,this[Fs]=!1,this[Se]=[],this[Ie]=e,this[R]=typeof t.fd=="number"?t.fd:null,this[_s]=t.mode===void 0?438:t.mode,this[Ct]=typeof t.start=="number"?t.start:null,this[tr]=typeof t.autoClose=="boolean"?t.autoClose:!0;let s=this[Ct]!==null?"r+":"w";this[ks]=t.flags===void 0,this[et]=this[ks]?s:t.flags,this[R]===null&&this[tt]()}emit(e,t){if(e==="error"){if(this[er])return;this[er]=!0}return super.emit(e,t)}get fd(){return this[R]}get path(){return this[Ie]}[Qt](e){this[de](),this[Kt]=!0,this.emit("error",e)}[tt](){K.open(this[Ie],this[et],this[_s],(e,t)=>this[rr](e,t))}[rr](e,t){this[ks]&&this[et]==="r+"&&e&&e.code==="ENOENT"?(this[et]="w",this[tt]()):e?this[Qt](e):(this[R]=t,this.emit("open",t),this[xn]())}end(e,t){return e&&this.write(e,t),this[Sr]=!0,!this[Kt]&&!this[Se].length&&typeof this[R]=="number"&&this[Zt](null,0),this}write(e,t){return typeof e=="string"&&(e=Buffer.from(e,t)),this[Sr]?(this.emit("error",new Error("write() after end()")),!1):this[R]===null||this[Kt]||this[Se].length?(this[Se].push(e),this[Fs]=!0,!1):(this[Kt]=!0,this[Ss](e),!0)}[Ss](e){K.write(this[R],e,0,e.length,this[Ct],(t,s)=>this[Zt](t,s))}[Zt](e,t){e?this[Qt](e):(this[Ct]!==null&&(this[Ct]+=t),this[Se].length?this[xn]():(this[Kt]=!1,this[Sr]&&!this[pa]?(this[pa]=!0,this[de](),this.emit("finish")):this[Fs]&&(this[Fs]=!1,this.emit("drain"))))}[xn](){if(this[Se].length===0)this[Sr]&&this[Zt](null,0);else if(this[Se].length===1)this[Ss](this[Se].pop());else{let e=this[Se];this[Se]=[],Pn(this[R],e,this[Ct],(t,s)=>this[Zt](t,s))}}[de](){if(this[tr]&&typeof this[R]=="number"){let e=this[R];this[R]=null,K.close(e,t=>t?this.emit("error",t):this.emit("close"))}}},Mn=class extends Rs{[tt](){let e;if(this[ks]&&this[et]==="r+")try{e=K.openSync(this[Ie],this[et],this[_s])}catch(t){if(t.code==="ENOENT")return this[et]="w",this[tt]();throw t}else e=K.openSync(this[Ie],this[et],this[_s]);this[rr](null,e)}[de](){if(this[tr]&&typeof this[R]=="number"){let e=this[R];this[R]=null,K.closeSync(e),this.emit("close")}}[Ss](e){let t=!0;try{this[Zt](null,K.writeSync(this[R],e,0,e.length,this[Ct])),t=!1}finally{if(t)try{this[de]()}catch{}}}};kr.ReadStream=vs;kr.ReadStreamSync=Nn;kr.WriteStream=Rs;kr.WriteStreamSync=Mn});var Ns=y((v0,Fa)=>{"use strict";u();var Bf=as(),xf=Jt(),Of=require("events"),Pf=An(),Tf=1024*1024,Lf=ns(),Da=us(),Nf=Zi(),{nextTick:Mf}=require("process"),In=Buffer.from([31,139]),oe=Symbol("state"),Ft=Symbol("writeEntry"),je=Symbol("readEntry"),jn=Symbol("nextEntry"),ga=Symbol("processEntry"),ue=Symbol("extendedHeader"),_r=Symbol("globalExtendedHeader"),rt=Symbol("meta"),Ea=Symbol("emitMeta"),O=Symbol("buffer"),Ue=Symbol("queue"),bt=Symbol("ended"),ya=Symbol("emittedEnd"),St=Symbol("emit"),Z=Symbol("unzip"),Bs=Symbol("consumeChunk"),xs=Symbol("consumeChunkSub"),Un=Symbol("consumeBody"),Aa=Symbol("consumeMeta"),wa=Symbol("consumeHeader"),Os=Symbol("consuming"),$n=Symbol("bufferConcat"),qn=Symbol("maybeEnd"),vr=Symbol("writing"),st=Symbol("aborted"),Ps=Symbol("onDone"),kt=Symbol("sawValidEntry"),Ts=Symbol("sawNullBlock"),Ls=Symbol("sawEOF"),Ca=Symbol("closeStream"),If=r=>!0;Fa.exports=Bf(class extends Of{constructor(e){e=e||{},super(e),this.file=e.file||"",this[kt]=null,this.on(Ps,t=>{(this[oe]==="begin"||this[kt]===!1)&&this.warn("TAR_BAD_ARCHIVE","Unrecognized archive format")}),e.ondone?this.on(Ps,e.ondone):this.on(Ps,t=>{this.emit("prefinish"),this.emit("finish"),this.emit("end")}),this.strict=!!e.strict,this.maxMetaEntrySize=e.maxMetaEntrySize||Tf,this.filter=typeof e.filter=="function"?e.filter:If,this.writable=!0,this.readable=!1,this[Ue]=new Pf,this[O]=null,this[je]=null,this[Ft]=null,this[oe]="begin",this[rt]="",this[ue]=null,this[_r]=null,this[bt]=!1,this[Z]=null,this[st]=!1,this[Ts]=!1,this[Ls]=!1,this.on("end",()=>this[Ca]()),typeof e.onwarn=="function"&&this.on("warn",e.onwarn),typeof e.onentry=="function"&&this.on("entry",e.onentry)}[wa](e,t){this[kt]===null&&(this[kt]=!1);let s;try{s=new xf(e,t,this[ue],this[_r])}catch(i){return this.warn("TAR_ENTRY_INVALID",i)}if(s.nullBlock)this[Ts]?(this[Ls]=!0,this[oe]==="begin"&&(this[oe]="header"),this[St]("eof")):(this[Ts]=!0,this[St]("nullBlock"));else if(this[Ts]=!1,!s.cksumValid)this.warn("TAR_ENTRY_INVALID","checksum failure",{header:s});else if(!s.path)this.warn("TAR_ENTRY_INVALID","path is required",{header:s});else{let i=s.type;if(/^(Symbolic)?Link$/.test(i)&&!s.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath required",{header:s});else if(!/^(Symbolic)?Link$/.test(i)&&s.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath forbidden",{header:s});else{let n=this[Ft]=new Lf(s,this[ue],this[_r]);if(!this[kt])if(n.remain){let o=()=>{n.invalid||(this[kt]=!0)};n.on("end",o)}else this[kt]=!0;n.meta?n.size>this.maxMetaEntrySize?(n.ignore=!0,this[St]("ignoredEntry",n),this[oe]="ignore",n.resume()):n.size>0&&(this[rt]="",n.on("data",o=>this[rt]+=o),this[oe]="meta"):(this[ue]=null,n.ignore=n.ignore||!this.filter(n.path,n),n.ignore?(this[St]("ignoredEntry",n),this[oe]=n.remain?"ignore":"header",n.resume()):(n.remain?this[oe]="body":(this[oe]="header",n.end()),this[je]?this[Ue].push(n):(this[Ue].push(n),this[jn]())))}}}[Ca](){Mf(()=>this.emit("close"))}[ga](e){let t=!0;return e?Array.isArray(e)?this.emit.apply(this,e):(this[je]=e,this.emit("entry",e),e.emittedEnd||(e.on("end",s=>this[jn]()),t=!1)):(this[je]=null,t=!1),t}[jn](){do;while(this[ga](this[Ue].shift()));if(!this[Ue].length){let e=this[je];!e||e.flowing||e.size===e.remain?this[vr]||this.emit("drain"):e.once("drain",s=>this.emit("drain"))}}[Un](e,t){let s=this[Ft],i=s.blockRemain,n=i>=e.length&&t===0?e:e.slice(t,t+i);return s.write(n),s.blockRemain||(this[oe]="header",this[Ft]=null,s.end()),n.length}[Aa](e,t){let s=this[Ft],i=this[Un](e,t);return this[Ft]||this[Ea](s),i}[St](e,t,s){!this[Ue].length&&!this[je]?this.emit(e,t,s):this[Ue].push([e,t,s])}[Ea](e){switch(this[St]("meta",this[rt]),e.type){case"ExtendedHeader":case"OldExtendedHeader":this[ue]=Da.parse(this[rt],this[ue],!1);break;case"GlobalExtendedHeader":this[_r]=Da.parse(this[rt],this[_r],!0);break;case"NextFileHasLongPath":case"OldGnuLongPath":this[ue]=this[ue]||Object.create(null),this[ue].path=this[rt].replace(/\0.*/,"");break;case"NextFileHasLongLinkpath":this[ue]=this[ue]||Object.create(null),this[ue].linkpath=this[rt].replace(/\0.*/,"");break;default:throw new Error("unknown meta: "+e.type)}}abort(e){this[st]=!0,this.emit("abort",e),this.warn("TAR_ABORT",e,{recoverable:!1})}write(e){if(this[st])return;if(this[Z]===null&&e){if(this[O]&&(e=Buffer.concat([this[O],e]),this[O]=null),e.length<In.length)return this[O]=e,!0;for(let s=0;this[Z]===null&&s<In.length;s++)e[s]!==In[s]&&(this[Z]=!1);if(this[Z]===null){let s=this[bt];this[bt]=!1,this[Z]=new Nf.Unzip,this[Z].on("data",n=>this[Bs](n)),this[Z].on("error",n=>this.abort(n)),this[Z].on("end",n=>{this[bt]=!0,this[Bs]()}),this[vr]=!0;let i=this[Z][s?"end":"write"](e);return this[vr]=!1,i}}this[vr]=!0,this[Z]?this[Z].write(e):this[Bs](e),this[vr]=!1;let t=this[Ue].length?!1:this[je]?this[je].flowing:!0;return!t&&!this[Ue].length&&this[je].once("drain",s=>this.emit("drain")),t}[$n](e){e&&!this[st]&&(this[O]=this[O]?Buffer.concat([this[O],e]):e)}[qn](){if(this[bt]&&!this[ya]&&!this[st]&&!this[Os]){this[ya]=!0;let e=this[Ft];if(e&&e.blockRemain){let t=this[O]?this[O].length:0;this.warn("TAR_BAD_ARCHIVE",`Truncated input (needed ${e.blockRemain} more bytes, only ${t} available)`,{entry:e}),this[O]&&e.write(this[O]),e.end()}this[St](Ps)}}[Bs](e){if(this[Os])this[$n](e);else if(!e&&!this[O])this[qn]();else{if(this[Os]=!0,this[O]){this[$n](e);let t=this[O];this[O]=null,this[xs](t)}else this[xs](e);for(;this[O]&&this[O].length>=512&&!this[st]&&!this[Ls];){let t=this[O];this[O]=null,this[xs](t)}this[Os]=!1}(!this[O]||this[bt])&&this[qn]()}[xs](e){let t=0,s=e.length;for(;t+512<=s&&!this[st]&&!this[Ls];)switch(this[oe]){case"begin":case"header":this[wa](e,t),t+=512;break;case"ignore":case"body":t+=this[Un](e,t);break;case"meta":t+=this[Aa](e,t);break;default:throw new Error("invalid state: "+this[oe])}t<s&&(this[O]?this[O]=Buffer.concat([e.slice(t),this[O]]):this[O]=e.slice(t))}end(e){this[st]||(this[Z]?this[Z].end(e):(this[bt]=!0,this.write(e)))}})});var Ms=y((R0,_a)=>{"use strict";u();var jf=Ut(),Sa=Ns(),ir=require("fs"),Uf=sr(),ba=require("path"),Wn=Vt();_a.exports=(r,e,t)=>{typeof r=="function"?(t=r,e=null,r={}):Array.isArray(r)&&(e=r,r={}),typeof e=="function"&&(t=e,e=null),e?e=Array.from(e):e=[];let s=jf(r);if(s.sync&&typeof t=="function")throw new TypeError("callback not supported for sync tar functions");if(!s.file&&typeof t=="function")throw new TypeError("callback only supported with file option");return e.length&&qf(s,e),s.noResume||$f(s),s.file&&s.sync?Wf(s):s.file?zf(s,t):ka(s)};var $f=r=>{let e=r.onentry;r.onentry=e?t=>{e(t),t.resume()}:t=>t.resume()},qf=(r,e)=>{let t=new Map(e.map(n=>[Wn(n),!0])),s=r.filter,i=(n,o)=>{let a=o||ba.parse(n).root||".",l=n===a?!1:t.has(n)?t.get(n):i(ba.dirname(n),a);return t.set(n,l),l};r.filter=s?(n,o)=>s(n,o)&&i(Wn(n)):n=>i(Wn(n))},Wf=r=>{let e=ka(r),t=r.file,s=!0,i;try{let n=ir.statSync(t),o=r.maxReadSize||16*1024*1024;if(n.size<o)e.end(ir.readFileSync(t));else{let a=0,l=Buffer.allocUnsafe(o);for(i=ir.openSync(t,"r");a<n.size;){let c=ir.readSync(i,l,0,o,a);a+=c,e.write(l.slice(0,c))}e.end()}s=!1}finally{if(s&&i)try{ir.closeSync(i)}catch{}}},zf=(r,e)=>{let t=new Sa(r),s=r.maxReadSize||16*1024*1024,i=r.file,n=new Promise((o,a)=>{t.on("error",a),t.on("end",o),ir.stat(i,(l,c)=>{if(l)a(l);else{let h=new Uf.ReadStream(i,{readSize:s,size:c.size});h.on("error",a),h.pipe(t)}})});return e?n.then(e,e):n},ka=r=>new Sa(r)});var Pa=y((B0,Oa)=>{"use strict";u();var Gf=Ut(),Is=Cs(),va=sr(),Ra=Ms(),Ba=require("path");Oa.exports=(r,e,t)=>{if(typeof e=="function"&&(t=e),Array.isArray(r)&&(e=r,r={}),!e||!Array.isArray(e)||!e.length)throw new TypeError("no files or directories specified");e=Array.from(e);let s=Gf(r);if(s.sync&&typeof t=="function")throw new TypeError("callback not supported for sync tar functions");if(!s.file&&typeof t=="function")throw new TypeError("callback only supported with file option");return s.file&&s.sync?Hf(s,e):s.file?Jf(s,e,t):s.sync?Vf(s,e):Yf(s,e)};var Hf=(r,e)=>{let t=new Is.Sync(r),s=new va.WriteStreamSync(r.file,{mode:r.mode||438});t.pipe(s),xa(t,e)},Jf=(r,e,t)=>{let s=new Is(r),i=new va.WriteStream(r.file,{mode:r.mode||438});s.pipe(i);let n=new Promise((o,a)=>{i.on("error",a),i.on("close",o),s.on("error",a)});return zn(s,e),t?n.then(t,t):n},xa=(r,e)=>{e.forEach(t=>{t.charAt(0)==="@"?Ra({file:Ba.resolve(r.cwd,t.slice(1)),sync:!0,noResume:!0,onentry:s=>r.add(s)}):r.add(t)}),r.end()},zn=(r,e)=>{for(;e.length;){let t=e.shift();if(t.charAt(0)==="@")return Ra({file:Ba.resolve(r.cwd,t.slice(1)),noResume:!0,onentry:s=>r.add(s)}).then(s=>zn(r,e));r.add(t)}r.end()},Vf=(r,e)=>{let t=new Is.Sync(r);return xa(t,e),t},Yf=(r,e)=>{let t=new Is(r);return zn(t,e),t}});var Gn=y((x0,Ua)=>{"use strict";u();var Kf=Ut(),Ta=Cs(),te=require("fs"),La=sr(),Na=Ms(),Ma=require("path"),Ia=Jt();Ua.exports=(r,e,t)=>{let s=Kf(r);if(!s.file)throw new TypeError("file is required");if(s.gzip)throw new TypeError("cannot append to compressed archives");if(!e||!Array.isArray(e)||!e.length)throw new TypeError("no files or directories specified");return e=Array.from(e),s.sync?Zf(s,e):Qf(s,e,t)};var Zf=(r,e)=>{let t=new Ta.Sync(r),s=!0,i,n;try{try{i=te.openSync(r.file,"r+")}catch(l){if(l.code==="ENOENT")i=te.openSync(r.file,"w+");else throw l}let o=te.fstatSync(i),a=Buffer.alloc(512);e:for(n=0;n<o.size;n+=512){for(let h=0,d=0;h<512;h+=d){if(d=te.readSync(i,a,h,a.length-h,n+h),n===0&&a[0]===31&&a[1]===139)throw new Error("cannot append to compressed archives");if(!d)break e}let l=new Ia(a);if(!l.cksumValid)break;let c=512*Math.ceil(l.size/512);if(n+c+512>o.size)break;n+=c,r.mtimeCache&&r.mtimeCache.set(l.path,l.mtime)}s=!1,Xf(r,t,n,i,e)}finally{if(s)try{te.closeSync(i)}catch{}}},Xf=(r,e,t,s,i)=>{let n=new La.WriteStreamSync(r.file,{fd:s,start:t});e.pipe(n),ep(e,i)},Qf=(r,e,t)=>{e=Array.from(e);let s=new Ta(r),i=(o,a,l)=>{let c=(C,P)=>{C?te.close(o,S=>l(C)):l(null,P)},h=0;if(a===0)return c(null,0);let d=0,p=Buffer.alloc(512),E=(C,P)=>{if(C)return c(C);if(d+=P,d<512&&P)return te.read(o,p,d,p.length-d,h+d,E);if(h===0&&p[0]===31&&p[1]===139)return c(new Error("cannot append to compressed archives"));if(d<512)return c(null,h);let S=new Ia(p);if(!S.cksumValid)return c(null,h);let x=512*Math.ceil(S.size/512);if(h+x+512>a||(h+=x+512,h>=a))return c(null,h);r.mtimeCache&&r.mtimeCache.set(S.path,S.mtime),d=0,te.read(o,p,0,512,h,E)};te.read(o,p,0,512,h,E)},n=new Promise((o,a)=>{s.on("error",a);let l="r+",c=(h,d)=>{if(h&&h.code==="ENOENT"&&l==="r+")return l="w+",te.open(r.file,l,c);if(h)return a(h);te.fstat(d,(p,E)=>{if(p)return te.close(d,()=>a(p));i(d,E.size,(C,P)=>{if(C)return a(C);let S=new La.WriteStream(r.file,{fd:d,start:P});s.pipe(S),S.on("error",a),S.on("close",o),ja(s,e)})})};te.open(r.file,l,c)});return t?n.then(t,t):n},ep=(r,e)=>{e.forEach(t=>{t.charAt(0)==="@"?Na({file:Ma.resolve(r.cwd,t.slice(1)),sync:!0,noResume:!0,onentry:s=>r.add(s)}):r.add(t)}),r.end()},ja=(r,e)=>{for(;e.length;){let t=e.shift();if(t.charAt(0)==="@")return Na({file:Ma.resolve(r.cwd,t.slice(1)),noResume:!0,onentry:s=>r.add(s)}).then(s=>ja(r,e));r.add(t)}r.end()}});var qa=y((O0,$a)=>{"use strict";u();var tp=Ut(),rp=Gn();$a.exports=(r,e,t)=>{let s=tp(r);if(!s.file)throw new TypeError("file is required");if(s.gzip)throw new TypeError("cannot append to compressed archives");if(!e||!Array.isArray(e)||!e.length)throw new TypeError("no files or directories specified");return e=Array.from(e),sp(s),rp(s,e,t)};var sp=r=>{let e=r.filter;r.mtimeCache||(r.mtimeCache=new Map),r.filter=e?(t,s)=>e(t,s)&&!(r.mtimeCache.get(t)>s.mtime):(t,s)=>!(r.mtimeCache.get(t)>s.mtime)}});var Ga=y((P0,za)=>{u();var{promisify:Wa}=require("util"),it=require("fs"),ip=r=>{if(!r)r={mode:511,fs:it};else if(typeof r=="object")r={mode:511,fs:it,...r};else if(typeof r=="number")r={mode:r,fs:it};else if(typeof r=="string")r={mode:parseInt(r,8),fs:it};else throw new TypeError("invalid options argument");return r.mkdir=r.mkdir||r.fs.mkdir||it.mkdir,r.mkdirAsync=Wa(r.mkdir),r.stat=r.stat||r.fs.stat||it.stat,r.statAsync=Wa(r.stat),r.statSync=r.statSync||r.fs.statSync||it.statSync,r.mkdirSync=r.mkdirSync||r.fs.mkdirSync||it.mkdirSync,r};za.exports=ip});var Ja=y((T0,Ha)=>{u();var np=process.env.__TESTING_MKDIRP_PLATFORM__||process.platform,{resolve:op,parse:up}=require("path"),ap=r=>{if(/\0/.test(r))throw Object.assign(new TypeError("path must be a string without null bytes"),{path:r,code:"ERR_INVALID_ARG_VALUE"});if(r=op(r),np==="win32"){let e=/[*|"<>?:]/,{root:t}=up(r);if(e.test(r.substr(t.length)))throw Object.assign(new Error("Illegal characters in path."),{path:r,code:"EINVAL"})}return r};Ha.exports=ap});var Xa=y((L0,Za)=>{u();var{dirname:Va}=require("path"),Ya=(r,e,t=void 0)=>t===e?Promise.resolve():r.statAsync(e).then(s=>s.isDirectory()?t:void 0,s=>s.code==="ENOENT"?Ya(r,Va(e),e):void 0),Ka=(r,e,t=void 0)=>{if(t!==e)try{return r.statSync(e).isDirectory()?t:void 0}catch(s){return s.code==="ENOENT"?Ka(r,Va(e),e):void 0}};Za.exports={findMade:Ya,findMadeSync:Ka}});var Vn=y((N0,ec)=>{u();var{dirname:Qa}=require("path"),Hn=(r,e,t)=>{e.recursive=!1;let s=Qa(r);return s===r?e.mkdirAsync(r,e).catch(i=>{if(i.code!=="EISDIR")throw i}):e.mkdirAsync(r,e).then(()=>t||r,i=>{if(i.code==="ENOENT")return Hn(s,e).then(n=>Hn(r,e,n));if(i.code!=="EEXIST"&&i.code!=="EROFS")throw i;return e.statAsync(r).then(n=>{if(n.isDirectory())return t;throw i},()=>{throw i})})},Jn=(r,e,t)=>{let s=Qa(r);if(e.recursive=!1,s===r)try{return e.mkdirSync(r,e)}catch(i){if(i.code!=="EISDIR")throw i;return}try{return e.mkdirSync(r,e),t||r}catch(i){if(i.code==="ENOENT")return Jn(r,e,Jn(s,e,t));if(i.code!=="EEXIST"&&i.code!=="EROFS")throw i;try{if(!e.statSync(r).isDirectory())throw i}catch{throw i}}};ec.exports={mkdirpManual:Hn,mkdirpManualSync:Jn}});var sc=y((M0,rc)=>{u();var{dirname:tc}=require("path"),{findMade:cp,findMadeSync:lp}=Xa(),{mkdirpManual:hp,mkdirpManualSync:fp}=Vn(),pp=(r,e)=>(e.recursive=!0,tc(r)===r?e.mkdirAsync(r,e):cp(e,r).then(s=>e.mkdirAsync(r,e).then(()=>s).catch(i=>{if(i.code==="ENOENT")return hp(r,e);throw i}))),mp=(r,e)=>{if(e.recursive=!0,tc(r)===r)return e.mkdirSync(r,e);let s=lp(e,r);try{return e.mkdirSync(r,e),s}catch(i){if(i.code==="ENOENT")return fp(r,e);throw i}};rc.exports={mkdirpNative:pp,mkdirpNativeSync:mp}});var uc=y((I0,oc)=>{u();var ic=require("fs"),dp=process.env.__TESTING_MKDIRP_NODE_VERSION__||process.version,Yn=dp.replace(/^v/,"").split("."),nc=+Yn[0]>10||+Yn[0]==10&&+Yn[1]>=12,Dp=nc?r=>r.mkdir===ic.mkdir:()=>!1,gp=nc?r=>r.mkdirSync===ic.mkdirSync:()=>!1;oc.exports={useNative:Dp,useNativeSync:gp}});var pc=y((j0,fc)=>{u();var nr=Ga(),or=Ja(),{mkdirpNative:ac,mkdirpNativeSync:cc}=sc(),{mkdirpManual:lc,mkdirpManualSync:hc}=Vn(),{useNative:Ep,useNativeSync:yp}=uc(),ur=(r,e)=>(r=or(r),e=nr(e),Ep(e)?ac(r,e):lc(r,e)),Ap=(r,e)=>(r=or(r),e=nr(e),yp(e)?cc(r,e):hc(r,e));ur.sync=Ap;ur.native=(r,e)=>ac(or(r),nr(e));ur.manual=(r,e)=>lc(or(r),nr(e));ur.nativeSync=(r,e)=>cc(or(r),nr(e));ur.manualSync=(r,e)=>hc(or(r),nr(e));fc.exports=ur});var Ac=y((U0,yc)=>{"use strict";u();var ae=require("fs"),_t=require("path"),wp=ae.lchown?"lchown":"chown",Cp=ae.lchownSync?"lchownSync":"chownSync",dc=ae.lchown&&!process.version.match(/v1[1-9]+\./)&&!process.version.match(/v10\.[6-9]/),mc=(r,e,t)=>{try{return ae[Cp](r,e,t)}catch(s){if(s.code!=="ENOENT")throw s}},Fp=(r,e,t)=>{try{return ae.chownSync(r,e,t)}catch(s){if(s.code!=="ENOENT")throw s}},bp=dc?(r,e,t,s)=>i=>{!i||i.code!=="EISDIR"?s(i):ae.chown(r,e,t,s)}:(r,e,t,s)=>s,Kn=dc?(r,e,t)=>{try{return mc(r,e,t)}catch(s){if(s.code!=="EISDIR")throw s;Fp(r,e,t)}}:(r,e,t)=>mc(r,e,t),Sp=process.version,Dc=(r,e,t)=>ae.readdir(r,e,t),kp=(r,e)=>ae.readdirSync(r,e);/^v4\./.test(Sp)&&(Dc=(r,e,t)=>ae.readdir(r,t));var js=(r,e,t,s)=>{ae[wp](r,e,t,bp(r,e,t,i=>{s(i&&i.code!=="ENOENT"?i:null)}))},gc=(r,e,t,s,i)=>{if(typeof e=="string")return ae.lstat(_t.resolve(r,e),(n,o)=>{if(n)return i(n.code!=="ENOENT"?n:null);o.name=e,gc(r,o,t,s,i)});if(e.isDirectory())Zn(_t.resolve(r,e.name),t,s,n=>{if(n)return i(n);let o=_t.resolve(r,e.name);js(o,t,s,i)});else{let n=_t.resolve(r,e.name);js(n,t,s,i)}},Zn=(r,e,t,s)=>{Dc(r,{withFileTypes:!0},(i,n)=>{if(i){if(i.code==="ENOENT")return s();if(i.code!=="ENOTDIR"&&i.code!=="ENOTSUP")return s(i)}if(i||!n.length)return js(r,e,t,s);let o=n.length,a=null,l=c=>{if(!a){if(c)return s(a=c);if(--o===0)return js(r,e,t,s)}};n.forEach(c=>gc(r,c,e,t,l))})},_p=(r,e,t,s)=>{if(typeof e=="string")try{let i=ae.lstatSync(_t.resolve(r,e));i.name=e,e=i}catch(i){if(i.code==="ENOENT")return;throw i}e.isDirectory()&&Ec(_t.resolve(r,e.name),t,s),Kn(_t.resolve(r,e.name),t,s)},Ec=(r,e,t)=>{let s;try{s=kp(r,{withFileTypes:!0})}catch(i){if(i.code==="ENOENT")return;if(i.code==="ENOTDIR"||i.code==="ENOTSUP")return Kn(r,e,t);throw i}return s&&s.length&&s.forEach(i=>_p(r,i,e,t)),Kn(r,e,t)};yc.exports=Zn;Zn.sync=Ec});var bc=y(($0,Xn)=>{"use strict";u();var wc=pc(),ce=require("fs"),Us=require("path"),Cc=Ac(),De=Gt(),$s=class extends Error{constructor(e,t){super("Cannot extract through symbolic link"),this.path=t,this.symlink=e}get name(){return"SylinkError"}},qs=class extends Error{constructor(e,t){super(t+": Cannot cd into '"+e+"'"),this.path=e,this.code=t}get name(){return"CwdError"}},Ws=(r,e)=>r.get(De(e)),Rr=(r,e,t)=>r.set(De(e),t),vp=(r,e)=>{ce.stat(r,(t,s)=>{(t||!s.isDirectory())&&(t=new qs(r,t&&t.code||"ENOTDIR")),e(t)})};Xn.exports=(r,e,t)=>{r=De(r);let s=e.umask,i=e.mode|448,n=(i&s)!==0,o=e.uid,a=e.gid,l=typeof o=="number"&&typeof a=="number"&&(o!==e.processUid||a!==e.processGid),c=e.preserve,h=e.unlink,d=e.cache,p=De(e.cwd),E=(S,x)=>{S?t(S):(Rr(d,r,!0),x&&l?Cc(x,o,a,ft=>E(ft)):n?ce.chmod(r,i,t):t())};if(d&&Ws(d,r)===!0)return E();if(r===p)return vp(r,E);if(c)return wc(r,{mode:i}).then(S=>E(null,S),E);let P=De(Us.relative(p,r)).split("/");zs(p,P,i,d,h,p,null,E)};var zs=(r,e,t,s,i,n,o,a)=>{if(!e.length)return a(null,o);let l=e.shift(),c=De(Us.resolve(r+"/"+l));if(Ws(s,c))return zs(c,e,t,s,i,n,o,a);ce.mkdir(c,t,Fc(c,e,t,s,i,n,o,a))},Fc=(r,e,t,s,i,n,o,a)=>l=>{l?ce.lstat(r,(c,h)=>{if(c)c.path=c.path&&De(c.path),a(c);else if(h.isDirectory())zs(r,e,t,s,i,n,o,a);else if(i)ce.unlink(r,d=>{if(d)return a(d);ce.mkdir(r,t,Fc(r,e,t,s,i,n,o,a))});else{if(h.isSymbolicLink())return a(new $s(r,r+"/"+e.join("/")));a(l)}}):(o=o||r,zs(r,e,t,s,i,n,o,a))},Rp=r=>{let e=!1,t="ENOTDIR";try{e=ce.statSync(r).isDirectory()}catch(s){t=s.code}finally{if(!e)throw new qs(r,t)}};Xn.exports.sync=(r,e)=>{r=De(r);let t=e.umask,s=e.mode|448,i=(s&t)!==0,n=e.uid,o=e.gid,a=typeof n=="number"&&typeof o=="number"&&(n!==e.processUid||o!==e.processGid),l=e.preserve,c=e.unlink,h=e.cache,d=De(e.cwd),p=S=>{Rr(h,r,!0),S&&a&&Cc.sync(S,n,o),i&&ce.chmodSync(r,s)};if(h&&Ws(h,r)===!0)return p();if(r===d)return Rp(d),p();if(l)return p(wc.sync(r,s));let C=De(Us.relative(d,r)).split("/"),P=null;for(let S=C.shift(),x=d;S&&(x+="/"+S);S=C.shift())if(x=De(Us.resolve(x)),!Ws(h,x))try{ce.mkdirSync(x,s),P=P||x,Rr(h,x,!0)}catch{let Ee=ce.lstatSync(x);if(Ee.isDirectory()){Rr(h,x,!0);continue}else if(c){ce.unlinkSync(x),ce.mkdirSync(x,s),P=P||x,Rr(h,x,!0);continue}else if(Ee.isSymbolicLink())return new $s(x,x+"/"+C.join("/"))}return p(P)}});var eo=y((q0,Sc)=>{u();var Qn=Object.create(null),{hasOwnProperty:Bp}=Object.prototype;Sc.exports=r=>(Bp.call(Qn,r)||(Qn[r]=r.normalize("NFKD")),Qn[r])});var Rc=y((W0,vc)=>{u();var kc=require("assert"),xp=eo(),Op=Vt(),{join:_c}=require("path"),Pp=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,Tp=Pp==="win32";vc.exports=()=>{let r=new Map,e=new Map,t=c=>c.split("/").slice(0,-1).reduce((d,p)=>(d.length&&(p=_c(d[d.length-1],p)),d.push(p||"/"),d),[]),s=new Set,i=c=>{let h=e.get(c);if(!h)throw new Error("function does not have any path reservations");return{paths:h.paths.map(d=>r.get(d)),dirs:[...h.dirs].map(d=>r.get(d))}},n=c=>{let{paths:h,dirs:d}=i(c);return h.every(p=>p[0]===c)&&d.every(p=>p[0]instanceof Set&&p[0].has(c))},o=c=>s.has(c)||!n(c)?!1:(s.add(c),c(()=>a(c)),!0),a=c=>{if(!s.has(c))return!1;let{paths:h,dirs:d}=e.get(c),p=new Set;return h.forEach(E=>{let C=r.get(E);kc.equal(C[0],c),C.length===1?r.delete(E):(C.shift(),typeof C[0]=="function"?p.add(C[0]):C[0].forEach(P=>p.add(P)))}),d.forEach(E=>{let C=r.get(E);kc(C[0]instanceof Set),C[0].size===1&&C.length===1?r.delete(E):C[0].size===1?(C.shift(),p.add(C[0])):C[0].delete(c)}),s.delete(c),p.forEach(E=>o(E)),!0};return{check:n,reserve:(c,h)=>{c=Tp?["win32 parallelization disabled"]:c.map(p=>xp(Op(_c(p))).toLowerCase());let d=new Set(c.map(p=>t(p)).reduce((p,E)=>p.concat(E)));return e.set(h,{dirs:d,paths:c}),c.forEach(p=>{let E=r.get(p);E?E.push(h):r.set(p,[h])}),d.forEach(p=>{let E=r.get(p);E?E[E.length-1]instanceof Set?E[E.length-1].add(h):E.push(new Set([h])):r.set(p,[new Set([h])])}),o(h)}}}});var Oc=y((z0,xc)=>{u();var Lp=process.env.__FAKE_PLATFORM__||process.platform,Np=Lp==="win32",Mp=global.__FAKE_TESTING_FS__||require("fs"),{O_CREAT:Ip,O_TRUNC:jp,O_WRONLY:Up,UV_FS_O_FILEMAP:Bc=0}=Mp.constants,$p=Np&&!!Bc,qp=512*1024,Wp=Bc|jp|Ip|Up;xc.exports=$p?r=>r<qp?Wp:"w":()=>"w"});var co=y((G0,Hc)=>{"use strict";u();var zp=require("assert"),Gp=Ns(),_=require("fs"),Hp=sr(),$e=require("path"),Wc=bc(),Pc=an(),Jp=Rc(),Vp=cn(),re=Gt(),Yp=Vt(),Kp=eo(),Tc=Symbol("onEntry"),so=Symbol("checkFs"),Lc=Symbol("checkFs2"),Js=Symbol("pruneCache"),io=Symbol("isReusable"),le=Symbol("makeFs"),no=Symbol("file"),oo=Symbol("directory"),Vs=Symbol("link"),Nc=Symbol("symlink"),Mc=Symbol("hardlink"),Ic=Symbol("unsupported"),jc=Symbol("checkPath"),nt=Symbol("mkdir"),z=Symbol("onError"),Gs=Symbol("pending"),Uc=Symbol("pend"),ar=Symbol("unpend"),to=Symbol("ended"),ro=Symbol("maybeClose"),uo=Symbol("skip"),Br=Symbol("doChown"),xr=Symbol("uid"),Or=Symbol("gid"),Pr=Symbol("checkedCwd"),zc=require("crypto"),Gc=Oc(),Zp=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,Tr=Zp==="win32",Xp=(r,e)=>{if(!Tr)return _.unlink(r,e);let t=r+".DELETE."+zc.randomBytes(16).toString("hex");_.rename(r,t,s=>{if(s)return e(s);_.unlink(t,e)})},Qp=r=>{if(!Tr)return _.unlinkSync(r);let e=r+".DELETE."+zc.randomBytes(16).toString("hex");_.renameSync(r,e),_.unlinkSync(e)},$c=(r,e,t)=>r===r>>>0?r:e===e>>>0?e:t,qc=r=>Kp(Yp(re(r))).toLowerCase(),em=(r,e)=>{e=qc(e);for(let t of r.keys()){let s=qc(t);(s===e||s.indexOf(e+"/")===0)&&r.delete(t)}},tm=r=>{for(let e of r.keys())r.delete(e)},Lr=class extends Gp{constructor(e){if(e||(e={}),e.ondone=t=>{this[to]=!0,this[ro]()},super(e),this[Pr]=!1,this.reservations=Jp(),this.transform=typeof e.transform=="function"?e.transform:null,this.writable=!0,this.readable=!1,this[Gs]=0,this[to]=!1,this.dirCache=e.dirCache||new Map,typeof e.uid=="number"||typeof e.gid=="number"){if(typeof e.uid!="number"||typeof e.gid!="number")throw new TypeError("cannot set owner without number uid and gid");if(e.preserveOwner)throw new TypeError("cannot preserve owner in archive and also set owner explicitly");this.uid=e.uid,this.gid=e.gid,this.setOwner=!0}else this.uid=null,this.gid=null,this.setOwner=!1;e.preserveOwner===void 0&&typeof e.uid!="number"?this.preserveOwner=process.getuid&&process.getuid()===0:this.preserveOwner=!!e.preserveOwner,this.processUid=(this.preserveOwner||this.setOwner)&&process.getuid?process.getuid():null,this.processGid=(this.preserveOwner||this.setOwner)&&process.getgid?process.getgid():null,this.forceChown=e.forceChown===!0,this.win32=!!e.win32||Tr,this.newer=!!e.newer,this.keep=!!e.keep,this.noMtime=!!e.noMtime,this.preservePaths=!!e.preservePaths,this.unlink=!!e.unlink,this.cwd=re($e.resolve(e.cwd||process.cwd())),this.strip=+e.strip||0,this.processUmask=e.noChmod?0:process.umask(),this.umask=typeof e.umask=="number"?e.umask:this.processUmask,this.dmode=e.dmode||511&~this.umask,this.fmode=e.fmode||438&~this.umask,this.on("entry",t=>this[Tc](t))}warn(e,t,s={}){return(e==="TAR_BAD_ARCHIVE"||e==="TAR_ABORT")&&(s.recoverable=!1),super.warn(e,t,s)}[ro](){this[to]&&this[Gs]===0&&(this.emit("prefinish"),this.emit("finish"),this.emit("end"))}[jc](e){if(this.strip){let t=re(e.path).split("/");if(t.length<this.strip)return!1;if(e.path=t.slice(this.strip).join("/"),e.type==="Link"){let s=re(e.linkpath).split("/");if(s.length>=this.strip)e.linkpath=s.slice(this.strip).join("/");else return!1}}if(!this.preservePaths){let t=re(e.path),s=t.split("/");if(s.includes("..")||Tr&&/^[a-z]:\.\.$/i.test(s[0]))return this.warn("TAR_ENTRY_ERROR","path contains '..'",{entry:e,path:t}),!1;let[i,n]=Vp(t);i&&(e.path=n,this.warn("TAR_ENTRY_INFO",`stripping ${i} from absolute path`,{entry:e,path:t}))}if($e.isAbsolute(e.path)?e.absolute=re($e.resolve(e.path)):e.absolute=re($e.resolve(this.cwd,e.path)),!this.preservePaths&&e.absolute.indexOf(this.cwd+"/")!==0&&e.absolute!==this.cwd)return this.warn("TAR_ENTRY_ERROR","path escaped extraction target",{entry:e,path:re(e.path),resolvedPath:e.absolute,cwd:this.cwd}),!1;if(e.absolute===this.cwd&&e.type!=="Directory"&&e.type!=="GNUDumpDir")return!1;if(this.win32){let{root:t}=$e.win32.parse(e.absolute);e.absolute=t+Pc.encode(e.absolute.slice(t.length));let{root:s}=$e.win32.parse(e.path);e.path=s+Pc.encode(e.path.slice(s.length))}return!0}[Tc](e){if(!this[jc](e))return e.resume();switch(zp.equal(typeof e.absolute,"string"),e.type){case"Directory":case"GNUDumpDir":e.mode&&(e.mode=e.mode|448);case"File":case"OldFile":case"ContiguousFile":case"Link":case"SymbolicLink":return this[so](e);case"CharacterDevice":case"BlockDevice":case"FIFO":default:return this[Ic](e)}}[z](e,t){e.name==="CwdError"?this.emit("error",e):(this.warn("TAR_ENTRY_ERROR",e,{entry:t}),this[ar](),t.resume())}[nt](e,t,s){Wc(re(e),{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:t,noChmod:this.noChmod},s)}[Br](e){return this.forceChown||this.preserveOwner&&(typeof e.uid=="number"&&e.uid!==this.processUid||typeof e.gid=="number"&&e.gid!==this.processGid)||typeof this.uid=="number"&&this.uid!==this.processUid||typeof this.gid=="number"&&this.gid!==this.processGid}[xr](e){return $c(this.uid,e.uid,this.processUid)}[Or](e){return $c(this.gid,e.gid,this.processGid)}[no](e,t){let s=e.mode&4095||this.fmode,i=new Hp.WriteStream(e.absolute,{flags:Gc(e.size),mode:s,autoClose:!1});i.on("error",l=>{i.fd&&_.close(i.fd,()=>{}),i.write=()=>!0,this[z](l,e),t()});let n=1,o=l=>{if(l){i.fd&&_.close(i.fd,()=>{}),this[z](l,e),t();return}--n===0&&_.close(i.fd,c=>{c?this[z](c,e):this[ar](),t()})};i.on("finish",l=>{let c=e.absolute,h=i.fd;if(e.mtime&&!this.noMtime){n++;let d=e.atime||new Date,p=e.mtime;_.futimes(h,d,p,E=>E?_.utimes(c,d,p,C=>o(C&&E)):o())}if(this[Br](e)){n++;let d=this[xr](e),p=this[Or](e);_.fchown(h,d,p,E=>E?_.chown(c,d,p,C=>o(C&&E)):o())}o()});let a=this.transform&&this.transform(e)||e;a!==e&&(a.on("error",l=>{this[z](l,e),t()}),e.pipe(a)),a.pipe(i)}[oo](e,t){let s=e.mode&4095||this.dmode;this[nt](e.absolute,s,i=>{if(i){this[z](i,e),t();return}let n=1,o=a=>{--n===0&&(t(),this[ar](),e.resume())};e.mtime&&!this.noMtime&&(n++,_.utimes(e.absolute,e.atime||new Date,e.mtime,o)),this[Br](e)&&(n++,_.chown(e.absolute,this[xr](e),this[Or](e),o)),o()})}[Ic](e){e.unsupported=!0,this.warn("TAR_ENTRY_UNSUPPORTED",`unsupported entry type: ${e.type}`,{entry:e}),e.resume()}[Nc](e,t){this[Vs](e,e.linkpath,"symlink",t)}[Mc](e,t){let s=re($e.resolve(this.cwd,e.linkpath));this[Vs](e,s,"link",t)}[Uc](){this[Gs]++}[ar](){this[Gs]--,this[ro]()}[uo](e){this[ar](),e.resume()}[io](e,t){return e.type==="File"&&!this.unlink&&t.isFile()&&t.nlink<=1&&!Tr}[so](e){this[Uc]();let t=[e.path];e.linkpath&&t.push(e.linkpath),this.reservations.reserve(t,s=>this[Lc](e,s))}[Js](e){e.type==="SymbolicLink"?tm(this.dirCache):e.type!=="Directory"&&em(this.dirCache,e.absolute)}[Lc](e,t){this[Js](e);let s=a=>{this[Js](e),t(a)},i=()=>{this[nt](this.cwd,this.dmode,a=>{if(a){this[z](a,e),s();return}this[Pr]=!0,n()})},n=()=>{if(e.absolute!==this.cwd){let a=re($e.dirname(e.absolute));if(a!==this.cwd)return this[nt](a,this.dmode,l=>{if(l){this[z](l,e),s();return}o()})}o()},o=()=>{_.lstat(e.absolute,(a,l)=>{if(l&&(this.keep||this.newer&&l.mtime>e.mtime)){this[uo](e),s();return}if(a||this[io](e,l))return this[le](null,e,s);if(l.isDirectory()){if(e.type==="Directory"){let c=!this.noChmod&&e.mode&&(l.mode&4095)!==e.mode,h=d=>this[le](d,e,s);return c?_.chmod(e.absolute,e.mode,h):h()}if(e.absolute!==this.cwd)return _.rmdir(e.absolute,c=>this[le](c,e,s))}if(e.absolute===this.cwd)return this[le](null,e,s);Xp(e.absolute,c=>this[le](c,e,s))})};this[Pr]?n():i()}[le](e,t,s){if(e){this[z](e,t),s();return}switch(t.type){case"File":case"OldFile":case"ContiguousFile":return this[no](t,s);case"Link":return this[Mc](t,s);case"SymbolicLink":return this[Nc](t,s);case"Directory":case"GNUDumpDir":return this[oo](t,s)}}[Vs](e,t,s,i){_[s](t,e.absolute,n=>{n?this[z](n,e):(this[ar](),e.resume()),i()})}},Hs=r=>{try{return[null,r()]}catch(e){return[e,null]}},ao=class extends Lr{[le](e,t){return super[le](e,t,()=>{})}[so](e){if(this[Js](e),!this[Pr]){let n=this[nt](this.cwd,this.dmode);if(n)return this[z](n,e);this[Pr]=!0}if(e.absolute!==this.cwd){let n=re($e.dirname(e.absolute));if(n!==this.cwd){let o=this[nt](n,this.dmode);if(o)return this[z](o,e)}}let[t,s]=Hs(()=>_.lstatSync(e.absolute));if(s&&(this.keep||this.newer&&s.mtime>e.mtime))return this[uo](e);if(t||this[io](e,s))return this[le](null,e);if(s.isDirectory()){if(e.type==="Directory"){let o=!this.noChmod&&e.mode&&(s.mode&4095)!==e.mode,[a]=o?Hs(()=>{_.chmodSync(e.absolute,e.mode)}):[];return this[le](a,e)}let[n]=Hs(()=>_.rmdirSync(e.absolute));this[le](n,e)}let[i]=e.absolute===this.cwd?[]:Hs(()=>Qp(e.absolute));this[le](i,e)}[no](e,t){let s=e.mode&4095||this.fmode,i=a=>{let l;try{_.closeSync(n)}catch(c){l=c}(a||l)&&this[z](a||l,e),t()},n;try{n=_.openSync(e.absolute,Gc(e.size),s)}catch(a){return i(a)}let o=this.transform&&this.transform(e)||e;o!==e&&(o.on("error",a=>this[z](a,e)),e.pipe(o)),o.on("data",a=>{try{_.writeSync(n,a,0,a.length)}catch(l){i(l)}}),o.on("end",a=>{let l=null;if(e.mtime&&!this.noMtime){let c=e.atime||new Date,h=e.mtime;try{_.futimesSync(n,c,h)}catch(d){try{_.utimesSync(e.absolute,c,h)}catch{l=d}}}if(this[Br](e)){let c=this[xr](e),h=this[Or](e);try{_.fchownSync(n,c,h)}catch(d){try{_.chownSync(e.absolute,c,h)}catch{l=l||d}}}i(l)})}[oo](e,t){let s=e.mode&4095||this.dmode,i=this[nt](e.absolute,s);if(i){this[z](i,e),t();return}if(e.mtime&&!this.noMtime)try{_.utimesSync(e.absolute,e.atime||new Date,e.mtime)}catch{}if(this[Br](e))try{_.chownSync(e.absolute,this[xr](e),this[Or](e))}catch{}t(),e.resume()}[nt](e,t){try{return Wc.sync(re(e),{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:t})}catch(s){return s}}[Vs](e,t,s,i){try{_[s+"Sync"](t,e.absolute),i(),e.resume()}catch(n){return this[z](n,e)}}};Lr.Sync=ao;Hc.exports=Lr});var Zc=y((H0,Kc)=>{"use strict";u();var rm=Ut(),Ys=co(),Vc=require("fs"),Yc=sr(),Jc=require("path"),lo=Vt();Kc.exports=(r,e,t)=>{typeof r=="function"?(t=r,e=null,r={}):Array.isArray(r)&&(e=r,r={}),typeof e=="function"&&(t=e,e=null),e?e=Array.from(e):e=[];let s=rm(r);if(s.sync&&typeof t=="function")throw new TypeError("callback not supported for sync tar functions");if(!s.file&&typeof t=="function")throw new TypeError("callback only supported with file option");return e.length&&sm(s,e),s.file&&s.sync?im(s):s.file?nm(s,t):s.sync?om(s):um(s)};var sm=(r,e)=>{let t=new Map(e.map(n=>[lo(n),!0])),s=r.filter,i=(n,o)=>{let a=o||Jc.parse(n).root||".",l=n===a?!1:t.has(n)?t.get(n):i(Jc.dirname(n),a);return t.set(n,l),l};r.filter=s?(n,o)=>s(n,o)&&i(lo(n)):n=>i(lo(n))},im=r=>{let e=new Ys.Sync(r),t=r.file,s=Vc.statSync(t),i=r.maxReadSize||16*1024*1024;new Yc.ReadStreamSync(t,{readSize:i,size:s.size}).pipe(e)},nm=(r,e)=>{let t=new Ys(r),s=r.maxReadSize||16*1024*1024,i=r.file,n=new Promise((o,a)=>{t.on("error",a),t.on("close",o),Vc.stat(i,(l,c)=>{if(l)a(l);else{let h=new Yc.ReadStream(i,{readSize:s,size:c.size});h.on("error",a),h.pipe(t)}})});return e?n.then(e,e):n},om=r=>new Ys.Sync(r),um=r=>new Ys(r)});var Xc=y(N=>{"use strict";u();N.c=N.create=Pa();N.r=N.replace=Gn();N.t=N.list=Ms();N.u=N.update=qa();N.x=N.extract=Zc();N.Pack=Cs();N.Unpack=co();N.Parse=Ns();N.ReadEntry=ns();N.WriteEntry=yn();N.Header=Jt();N.Pax=us();N.types=en()});var rl=y((Z0,tl)=>{u();function he(r,e){typeof e=="boolean"&&(e={forever:e}),this._originalTimeouts=JSON.parse(JSON.stringify(r)),this._timeouts=r,this._options=e||{},this._maxRetryTime=e&&e.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}tl.exports=he;he.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)};he.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null};he.prototype.retry=function(r){if(this._timeout&&clearTimeout(this._timeout),!r)return!1;var e=new Date().getTime();if(r&&e-this._operationStart>=this._maxRetryTime)return this._errors.push(r),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(r);var t=this._timeouts.shift();if(t===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),t=this._cachedTimeouts.slice(-1);else return!1;var s=this;return this._timer=setTimeout(function(){s._attempts++,s._operationTimeoutCb&&(s._timeout=setTimeout(function(){s._operationTimeoutCb(s._attempts)},s._operationTimeout),s._options.unref&&s._timeout.unref()),s._fn(s._attempts)},t),this._options.unref&&this._timer.unref(),!0};he.prototype.attempt=function(r,e){this._fn=r,e&&(e.timeout&&(this._operationTimeout=e.timeout),e.cb&&(this._operationTimeoutCb=e.cb));var t=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){t._operationTimeoutCb()},t._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};he.prototype.try=function(r){console.log("Using RetryOperation.try() is deprecated"),this.attempt(r)};he.prototype.start=function(r){console.log("Using RetryOperation.start() is deprecated"),this.attempt(r)};he.prototype.start=he.prototype.try;he.prototype.errors=function(){return this._errors};he.prototype.attempts=function(){return this._attempts};he.prototype.mainError=function(){if(this._errors.length===0)return null;for(var r={},e=null,t=0,s=0;s<this._errors.length;s++){var i=this._errors[s],n=i.message,o=(r[n]||0)+1;r[n]=o,o>=t&&(e=i,t=o)}return e}});var sl=y(vt=>{u();var mm=rl();vt.operation=function(r){var e=vt.timeouts(r);return new mm(e,{forever:r&&(r.forever||r.retries===1/0),unref:r&&r.unref,maxRetryTime:r&&r.maxRetryTime})};vt.timeouts=function(r){if(r instanceof Array)return[].concat(r);var e={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var t in r)e[t]=r[t];if(e.minTimeout>e.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var s=[],i=0;i<e.retries;i++)s.push(this.createTimeout(i,e));return r&&r.forever&&!s.length&&s.push(this.createTimeout(i,e)),s.sort(function(n,o){return n-o}),s};vt.createTimeout=function(r,e){var t=e.randomize?Math.random()+1:1,s=Math.round(t*Math.max(e.minTimeout,1)*Math.pow(e.factor,r));return s=Math.min(s,e.maxTimeout),s};vt.wrap=function(r,e,t){if(e instanceof Array&&(t=e,e=null),!t){t=[];for(var s in r)typeof r[s]=="function"&&t.push(s)}for(var i=0;i<t.length;i++){var n=t[i],o=r[n];r[n]=function(l){var c=vt.operation(e),h=Array.prototype.slice.call(arguments,1),d=h.pop();h.push(function(p){c.retry(p)||(p&&(arguments[0]=c.mainError()),d.apply(this,arguments))}),c.attempt(function(){l.apply(r,h)})}.bind(r,o),r[n].options=e}}});var nl=y((Q0,il)=>{u();il.exports=sl()});var ul=y((eD,ol)=>{u();var dm=nl();function Dm(r,e){function t(s,i){var n=e||{},o;"randomize"in n||(n.randomize=!0),o=dm.operation(n);function a(h){i(h||new Error("Aborted"))}function l(h,d){if(h.bail){a(h);return}o.retry(h)?n.onRetry&&n.onRetry(h,d):i(o.mainError())}function c(h){var d;try{d=r(a,h)}catch(p){l(p,h);return}Promise.resolve(d).then(s).catch(function(E){l(E,h)})}o.attempt(c)}return new Promise(t)}ol.exports=Dm});u();var yo=A(require("picocolors")),Ll=require("commander");u();u();u();var eh=A(_o());u();u();function li(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}u();u();function mr(r){return mr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},mr(r)}u();function hi(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function fi(r,e){if(e&&(mr(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return hi(r)}u();function dt(r){return dt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},dt(r)}u();u();function ve(r,e){return ve=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(s,i){return s.__proto__=i,s},ve(r,e)}function pi(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),e&&ve(r,e)}u();u();function mi(r){return Function.toString.call(r).indexOf("[native code]")!==-1}u();u();function di(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Nt(r,e,t){return di()?Nt=Reflect.construct.bind():Nt=function(i,n,o){var a=[null];a.push.apply(a,n);var l=Function.bind.apply(i,a),c=new l;return o&&ve(c,o.prototype),c},Nt.apply(null,arguments)}function dr(r){var e=typeof Map=="function"?new Map:void 0;return dr=function(s){if(s===null||!mi(s))return s;if(typeof s!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(s))return e.get(s);e.set(s,i)}function i(){return Nt(s,arguments,dt(this).constructor)}return i.prototype=Object.create(s.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),ve(i,s)},dr(r)}var Go=A(zo());var th=A(require("fs-extra")),Md=function(r){pi(e,r);function e(t){var s;return li(this,e),s=fi(this,dt(e).call(this,"No package.json could be found upwards from the directory ".concat(t))),s.directory=t,s}return e}(dr(Error));u();u();var rh=A(require("fs")),sh=A(require("path"));u();var gh=A(require("fs")),Eh=A(require("path")),yh=A(require("js-yaml")),Ah=require("fast-glob");var me={};zl(me,{bold:()=>ch,dimmed:()=>hh,error:()=>jt,grey:()=>fh,info:()=>ah,item:()=>ph,log:()=>X,turboBlue:()=>It,turboGradient:()=>uh,turboLoader:()=>Xo,turboRed:()=>Ko,underline:()=>lh,warn:()=>Fi,yellow:()=>Zo});u();var J=require("picocolors"),Ho=A(require("ora")),Jo=A(require("gradient-string")),Vo="#0099F7",Yo="#F11712",oh="#FFFF00",Ci=r=>{let e=mh(r);return t=>`\x1B[38;5;${e}m${t}${(0,J.reset)("")}`},uh=(0,Jo.default)(Vo,Yo),It=Ci(Vo),Ko=Ci(Yo),Zo=Ci(oh),Xo=r=>(0,Ho.default)({text:r,spinner:{frames:[" ",It("> "),It(">> "),It(">>>")]}}),ah=(...r)=>{X(It((0,J.bold)(">>>")),r.join(" "))},ch=(...r)=>{X((0,J.bold)(r.join(" ")))},lh=(...r)=>{X((0,J.underline)(r.join(" ")))},hh=(...r)=>{X((0,J.dim)(r.join(" ")))},fh=(...r)=>{X((0,J.gray)(r.join(" ")))},ph=(...r)=>{X(It((0,J.bold)(" \u2022")),r.join(" "))},X=(...r)=>{console.log(...r)},Fi=(...r)=>{console.error(Zo((0,J.bold)(">>>")),r.join(" "))},jt=(...r)=>{console.error(Ko((0,J.bold)(">>>")),r.join(" "))};function mh(r){let e=parseInt(r.slice(1),16),t=Math.floor(e/(256*256))%256,s=Math.floor(e/256)%256,i=e%256;return 16+36*Math.round(t/255*5)+6*Math.round(s/255*5)+Math.round(i/255*5)}u();var Qo=A(require("os")),eu=A(require("execa")),wh=5e3;async function zr(r,e=[],t){let s={cwd:Qo.default.tmpdir(),env:{COREPACK_ENABLE_STRICT:"0"},timeout:wh,...t};try{let{stdout:i}=await(0,eu.default)(r,e,s);return i.trim()}catch{return}}async function bi(){let[r,e,t,s]=await Promise.all([zr("yarnpkg",["--version"],{cwd:"."}),zr("npm",["--version"]),zr("pnpm",["--version"]),zr("bun",["--version"])]);return{yarn:r,pnpm:t,npm:e,bun:s}}u();var Ch=A(require("fs-extra"));u();var Fh=A(require("path")),bh=A(require("fs-extra")),Sh=A(require("picocolors"));u();var am=require("stream"),cm=require("stream/promises"),lm=require("zlib"),Ks=require("fs"),Qc=require("fs/promises"),Zs=require("path"),hm=require("os"),fm=require("child_process"),el=A(Xc());u();var pm=A(require("fs-extra"));u();var Fm=A(require("path")),bm=A(ul()),Sm=A(require("picocolors")),km=A(require("fs-extra"));u();u();var Xs=A(require("picocolors")),al=A(require("update-check"));function ho(r){let{packageInfo:e,upgradeCommand:t}=r,s=(0,al.default)(e).catch(()=>null);return async function(n=0){try{let o=await s;if(o!=null&&o.latest){X(),X(Xs.default.yellow(Xs.default.bold(`A new version of \`${e.name}\` is available!`)));let a=typeof t=="function"?await t():t;a&&X(`You can update by running: ${Xs.default.cyan(a)}`),X()}process.exit(n)}catch(o){process.env.DEBUG&&jt("Update check failed:",o),process.exit(n)}}}u();var fo={name:"@turbo/workspaces",version:"2.7.2-canary.1",description:"Tools for working with package managers",homepage:"https://turborepo.com",license:"MIT",repository:{type:"git",url:"https://github.com/vercel/turborepo",directory:"packages/turbo-workspaces"},bugs:{url:"https://github.com/vercel/turborepo/issues"},bin:"dist/cli.js",module:"dist/index.mjs",main:"dist/index.js",types:"dist/index.d.ts",scripts:{build:"tsup",dev:"tsup --watch",test:"jest",lint:"eslint src/","check-types":"tsc --noEmit","lint:prettier":"prettier -c . --cache --ignore-path=../../.prettierignore"},dependencies:{commander:"10.0.0",execa:"5.1.1","fast-glob":"3.2.12","fs-extra":"10.1.0","gradient-string":"2.0.1",inquirer:"8.2.4","js-yaml":"4.1.0",ora:"4.1.1",picocolors:"1.0.1",semver:"7.6.2","update-check":"1.5.4"},devDependencies:{"@jest/globals":"29.7.0","@turbo/eslint-config":"workspace:*","@turbo/test-utils":"workspace:*","@turbo/tsconfig":"workspace:*","@turbo/utils":"workspace:*","@types/fs-extra":"9.0.13","@types/gradient-string":"1.1.2","@types/inquirer":"7.3.3","@types/js-yaml":"4.0.5","@types/node":"18.17.4","@types/semver":"7.5.8",jest:"29.7.0","ts-jest":"29.2.5",tsup:"5.12.9",typescript:"5.5.4"},files:["dist"],publishConfig:{access:"public"}};u();u();var ti=A(require("path")),kl=A(require("inquirer")),ze=A(require("picocolors"));u();var se=A(require("picocolors")),cl=A(require("gradient-string")),cr=2,ot=class{constructor({interactive:e,dry:t}={}){this.interactive=e!=null?e:!0,this.dry=t!=null?t:!1,this.step=1}logger(...e){this.interactive&&console.log(...e)}indented(e,...t){this.logger(" ".repeat(cr*e),...t)}header(e){this.blankLine(),this.logger(se.default.bold(e))}installerFrames(){let e=`${" ".repeat(cr)} - ${this.dry?se.default.yellow("SKIPPED | "):se.default.green("OK | ")}`;return[`${e} `,`${e}> `,`${e}>> `,`${e}>>>`]}gradient(e){return(0,cl.default)("#0099F7","#F11712")(e.toString())}hero(){this.logger(se.default.bold(this.gradient(`
5
5
  >>> TURBOREPO
6
- `)))}info(...e){this.logger(...e)}mainStep(e){this.blankLine(),this.logger(`${this.step}. ${se.default.underline(e)}`),this.step+=1}subStep(...e){this.logger(" ".repeat(cr),"-",this.dry?se.default.yellow("SKIPPED |"):se.default.green("OK |"),...e)}subStepFailure(...e){this.logger(" ".repeat(cr),"-",se.default.red("ERROR |"),...e)}rootHeader(){this.blankLine(),this.indented(2,"Root:")}rootStep(...e){this.logger(" ".repeat(cr*3),"-",this.dry?se.default.yellow("SKIPPED |"):se.default.green("OK |"),...e)}workspaceHeader(){this.blankLine(),this.indented(2,"Workspaces:")}workspaceStep(...e){this.logger(" ".repeat(cr*3),"-",this.dry?se.default.yellow("SKIPPED |"):se.default.green("OK |"),...e)}blankLine(){this.logger()}error(...e){console.error(...e)}};u();var $e=A(require("path")),al=A(require("execa")),ie=require("fs-extra"),cl=require("fast-glob"),ll=A(require("js-yaml"));u();var v=class extends Error{constructor(t,s){var i;super(t);this.name="ConvertError",this.type=(i=s==null?void 0:s.type)!=null?i:"unknown",Error.captureStackTrace(this,v)}};var km=/^(?!_)(?<manager>.+)@(?<version>.+)$/;function M({workspaceRoot:r}){let e=$e.default.join(r,"package.json");try{return(0,ie.readJsonSync)(e,"utf8")}catch(t){if(t&&typeof t=="object"&&"code"in t){if(t.code==="ENOENT")throw new v(`no "package.json" found at ${r}`,{type:"package_json-missing"});if(t.code==="EJSONPARSE")throw new v(`failed to parse "package.json" at ${r}`,{type:"package_json-parse_error"})}throw new Error(`unexpected error reading "package.json" at ${r}`)}}function ut({workspaceRoot:r}){let{packageManager:e}=M({workspaceRoot:r});if(e)try{let t=km.exec(e);if(t){let[s,i]=t;return i}}catch{}}function We({workspaceRoot:r}){let e=M({workspaceRoot:r}),t=$e.default.basename(r),{name:s=t,description:i}=e;return{name:s,description:i}}function po({workspaceRoot:r}){let e=$e.default.join(r,"pnpm-workspace.yaml");if((0,ie.existsSync)(e))try{let t=ll.default.load((0,ie.readFileSync)(e,"utf8"));if(t instanceof Object&&"packages"in t&&Array.isArray(t.packages))return t.packages}catch{throw new v(`failed to parse ${e}`,{type:"pnpm-workspace_parse_error"})}return[]}function at({root:r,lockFile:e,workspaceConfig:t}){let s=n=>$e.default.join(r,n),i={root:r,lockfile:s(e),packageJson:s("package.json"),nodeModules:s("node_modules")};return t&&(i.workspaceConfig=s(t)),i}function lr({workspaces:r}){var e;return r?Array.isArray(r)?r:"packages"in r?(e=r.packages)!=null?e:[]:[]:[]}function ct({workspaceRoot:r,workspaceGlobs:e}){if(!e)return[];let t=e.filter(s=>s.startsWith("!")).map(s=>s.slice(1));return e.filter(s=>!s.startsWith("!")).flatMap(s=>{let i=[`${s}/package.json`];return(0,cl.sync)(i,{onlyFiles:!0,absolute:!0,cwd:r,ignore:["**/node_modules/**",...t]})}).map(s=>{let i=$e.default.dirname(s),{name:n,description:o}=We({workspaceRoot:i});return{name:n,description:o,paths:{root:i,packageJson:s,nodeModules:$e.default.join(i,"node_modules")}}})}function lt({directory:r}){let e=$e.default.resolve(process.cwd(),r);return{exists:(0,ie.existsSync)(e),absolute:e}}function fe({packageManager:r,action:e,project:t}){let s=t.workspaceData.globs.length>0;return`${e==="remove"?"Removing":"Adding"} ${r} ${s?"workspaces":""} ${e==="remove"?"from":"to"} ${t.name}`}function hl({project:r}){let e=t=>!(t.includes("*")&&(t.includes("**")||t.split("/").slice(0,-1).join("/").includes("*"))||["!","[","]","{","}"].some(s=>t.includes(s)));return r.workspaceData.globs.every(e)}function ne({project:r,options:e}){e!=null&&e.dry||(0,ie.rmSync)(r.paths.lockfile,{force:!0})}async function Qs({project:r,options:e}){if(!(e!=null&&e.dry)&&(0,ie.existsSync)(r.paths.lockfile))try{let{stdout:t}=await(0,al.default)("bun",["bun.lockb"],{stdin:"ignore",cwd:r.paths.root,preferLocal:!0,shell:process.platform==="win32"});await(0,ie.writeFile)($e.default.join(r.paths.root,"yarn.lock"),t)}catch{}finally{(0,ie.rmSync)(r.paths.lockfile,{force:!0})}}u();u();u();var Rt=A(require("path")),ge=A(require("fs-extra")),dl=A(require("execa"));u();var fl=A(require("path")),pl=A(require("fs-extra")),ml=A(require("picocolors"));function _m({dependencyList:r,project:e,to:t}){let s=[];return e.workspaceData.workspaces.forEach(i=>{let{name:n}=i;if(r[n]){let o=r[n],a=o.startsWith("workspace:")?o.slice(10):o;r[n]=t.name==="pnpm"?`workspace:${a}`:a,s.push(n)}}),{dependencyList:r,updated:s}}function pe({project:r,workspace:e,to:t,logger:s,options:i}){if(["yarn","npm","bun"].includes(t.name)&&["yarn","npm","bun"].includes(r.packageManager))return;let n=M({workspaceRoot:e.paths.root}),o={dependencies:[],devDependencies:[],peerDependencies:[],optionalDependencies:[]},a=["dependencies","devDependencies","peerDependencies","optionalDependencies"];a.forEach(d=>{let p=n[d];if(p){let{updated:E,dependencyList:w}=_m({dependencyList:p,project:r,to:t});n[d]=w,o[d]=E}});let l=d=>{let p=o[d].length;if(p>0)return`${ml.default.green(p.toString())} ${d}`},c=a.map(l).filter(Boolean),h=`./${fl.default.relative(r.paths.root,e.paths.packageJson)}`;if(c.length>=1){let d="updating";c.forEach((p,E)=>{c.length===1?d+=` ${p} in ${h}`:E===c.length-1?d+=`and ${p} in ${h}`:d+=` ${p}, `}),s.workspaceStep(d)}else s.workspaceStep(`no workspace dependencies found in ${h}`);i!=null&&i.dry||pl.default.writeJSONSync(e.paths.packageJson,n,{spaces:2})}var ht={name:"pnpm",lock:"pnpm-lock.yaml"};async function Dl(r){let e=Rt.default.join(r.workspaceRoot,ht.lock),t=Rt.default.join(r.workspaceRoot,"pnpm-workspace.yaml"),s=ut({workspaceRoot:r.workspaceRoot});return ge.default.existsSync(e)||ge.default.existsSync(t)||s===ht.name}async function vm(r){if(!await Dl(r))throw new v("Not a pnpm project",{type:"package_manager-unexpected"});let{name:t,description:s}=We(r);return{name:t,description:s,packageManager:ht.name,paths:at({root:r.workspaceRoot,lockFile:ht.lock,workspaceConfig:"pnpm-workspace.yaml"}),workspaceData:{globs:po(r),workspaces:ct({workspaceGlobs:po(r),...r})}}}async function Rm(r){let{project:e,to:t,logger:s,options:i}=r,n=e.workspaceData.globs.length>0;s.mainStep(fe({action:"create",packageManager:ht.name,project:e}));let o=M({workspaceRoot:e.paths.root});s.rootHeader(),o.packageManager=`${t.name}@${t.version}`,s.rootStep(`adding "packageManager" field to ${e.name} root "package.json"`),i!=null&&i.dry||(ge.default.writeJSONSync(e.paths.packageJson,o,{spaces:2}),n&&(s.rootStep('adding "pnpm-workspace.yaml"'),ge.default.writeFileSync(Rt.default.join(e.paths.root,"pnpm-workspace.yaml"),`packages:
6
+ `)))}info(...e){this.logger(...e)}mainStep(e){this.blankLine(),this.logger(`${this.step}. ${se.default.underline(e)}`),this.step+=1}subStep(...e){this.logger(" ".repeat(cr),"-",this.dry?se.default.yellow("SKIPPED |"):se.default.green("OK |"),...e)}subStepFailure(...e){this.logger(" ".repeat(cr),"-",se.default.red("ERROR |"),...e)}rootHeader(){this.blankLine(),this.indented(2,"Root:")}rootStep(...e){this.logger(" ".repeat(cr*3),"-",this.dry?se.default.yellow("SKIPPED |"):se.default.green("OK |"),...e)}workspaceHeader(){this.blankLine(),this.indented(2,"Workspaces:")}workspaceStep(...e){this.logger(" ".repeat(cr*3),"-",this.dry?se.default.yellow("SKIPPED |"):se.default.green("OK |"),...e)}blankLine(){this.logger()}error(...e){console.error(...e)}};u();var qe=A(require("path")),ll=A(require("execa")),ie=require("fs-extra"),hl=require("fast-glob"),fl=A(require("js-yaml"));u();var v=class extends Error{constructor(t,s){var i;super(t);this.name="ConvertError",this.type=(i=s==null?void 0:s.type)!=null?i:"unknown",Error.captureStackTrace(this,v)}};var vm=/^(?!_)(?<manager>.+)@(?<version>.+)$/;function M({workspaceRoot:r}){let e=qe.default.join(r,"package.json");try{return(0,ie.readJsonSync)(e,"utf8")}catch(t){if(t&&typeof t=="object"&&"code"in t){if(t.code==="ENOENT")throw new v(`no "package.json" found at ${r}`,{type:"package_json-missing"});if(t.code==="EJSONPARSE")throw new v(`failed to parse "package.json" at ${r}`,{type:"package_json-parse_error"})}throw new Error(`unexpected error reading "package.json" at ${r}`)}}function ut({workspaceRoot:r}){let{packageManager:e}=M({workspaceRoot:r});if(e)try{let t=vm.exec(e);if(t){let[s,i]=t;return i}}catch{}}function We({workspaceRoot:r}){let e=M({workspaceRoot:r}),t=qe.default.basename(r),{name:s=t,description:i}=e;return{name:s,description:i}}function po({workspaceRoot:r}){let e=qe.default.join(r,"pnpm-workspace.yaml");if((0,ie.existsSync)(e))try{let t=fl.default.load((0,ie.readFileSync)(e,"utf8"));if(t instanceof Object&&"packages"in t&&Array.isArray(t.packages))return t.packages}catch{throw new v(`failed to parse ${e}`,{type:"pnpm-workspace_parse_error"})}return[]}function at({root:r,lockFile:e,workspaceConfig:t}){let s=n=>qe.default.join(r,n),i={root:r,lockfile:s(e),packageJson:s("package.json"),nodeModules:s("node_modules")};return t&&(i.workspaceConfig=s(t)),i}function lr({workspaces:r}){var e;return r?Array.isArray(r)?r:"packages"in r?(e=r.packages)!=null?e:[]:[]:[]}function ct({workspaceRoot:r,workspaceGlobs:e}){if(!e)return[];let t=e.filter(s=>s.startsWith("!")).map(s=>s.slice(1));return e.filter(s=>!s.startsWith("!")).flatMap(s=>{let i=[`${s}/package.json`];return(0,hl.sync)(i,{onlyFiles:!0,absolute:!0,cwd:r,ignore:["**/node_modules/**",...t]})}).map(s=>{let i=qe.default.dirname(s),{name:n,description:o}=We({workspaceRoot:i});return{name:n,description:o,paths:{root:i,packageJson:s,nodeModules:qe.default.join(i,"node_modules")}}})}function lt({directory:r}){let e=qe.default.resolve(process.cwd(),r);return{exists:(0,ie.existsSync)(e),absolute:e}}function fe({packageManager:r,action:e,project:t}){let s=t.workspaceData.globs.length>0;return`${e==="remove"?"Removing":"Adding"} ${r} ${s?"workspaces":""} ${e==="remove"?"from":"to"} ${t.name}`}function pl({project:r}){let e=t=>!(t.includes("*")&&(t.includes("**")||t.split("/").slice(0,-1).join("/").includes("*"))||["!","[","]","{","}"].some(s=>t.includes(s)));return r.workspaceData.globs.every(e)}function ne({project:r,options:e}){e!=null&&e.dry||(0,ie.rmSync)(r.paths.lockfile,{force:!0})}async function Qs({project:r,options:e}){if(!(e!=null&&e.dry)&&(0,ie.existsSync)(r.paths.lockfile))try{let{stdout:t}=await(0,ll.default)("bun",["bun.lockb"],{stdin:"ignore",cwd:r.paths.root,preferLocal:!0,shell:process.platform==="win32"});await(0,ie.writeFile)(qe.default.join(r.paths.root,"yarn.lock"),t)}catch{}finally{(0,ie.rmSync)(r.paths.lockfile,{force:!0})}}u();u();u();var Rt=A(require("path")),ge=A(require("fs-extra")),gl=A(require("execa"));u();var ml=A(require("path")),dl=A(require("fs-extra")),Dl=A(require("picocolors"));function Rm({dependencyList:r,project:e,to:t}){let s=[];return e.workspaceData.workspaces.forEach(i=>{let{name:n}=i;if(r[n]){let o=r[n],a=o.startsWith("workspace:")?o.slice(10):o;r[n]=t.name==="pnpm"?`workspace:${a}`:a,s.push(n)}}),{dependencyList:r,updated:s}}function pe({project:r,workspace:e,to:t,logger:s,options:i}){if(["yarn","npm","bun"].includes(t.name)&&["yarn","npm","bun"].includes(r.packageManager))return;let n=M({workspaceRoot:e.paths.root}),o={dependencies:[],devDependencies:[],peerDependencies:[],optionalDependencies:[]},a=["dependencies","devDependencies","peerDependencies","optionalDependencies"];a.forEach(d=>{let p=n[d];if(p){let{updated:E,dependencyList:C}=Rm({dependencyList:p,project:r,to:t});n[d]=C,o[d]=E}});let l=d=>{let p=o[d].length;if(p>0)return`${Dl.default.green(p.toString())} ${d}`},c=a.map(l).filter(Boolean),h=`./${ml.default.relative(r.paths.root,e.paths.packageJson)}`;if(c.length>=1){let d="updating";c.forEach((p,E)=>{c.length===1?d+=` ${p} in ${h}`:E===c.length-1?d+=`and ${p} in ${h}`:d+=` ${p}, `}),s.workspaceStep(d)}else s.workspaceStep(`no workspace dependencies found in ${h}`);i!=null&&i.dry||dl.default.writeJSONSync(e.paths.packageJson,n,{spaces:2})}var ht={name:"pnpm",lock:"pnpm-lock.yaml"};async function El(r){let e=Rt.default.join(r.workspaceRoot,ht.lock),t=Rt.default.join(r.workspaceRoot,"pnpm-workspace.yaml"),s=ut({workspaceRoot:r.workspaceRoot});return ge.default.existsSync(e)||ge.default.existsSync(t)||s===ht.name}async function Bm(r){if(!await El(r))throw new v("Not a pnpm project",{type:"package_manager-unexpected"});let{name:t,description:s}=We(r);return{name:t,description:s,packageManager:ht.name,paths:at({root:r.workspaceRoot,lockFile:ht.lock,workspaceConfig:"pnpm-workspace.yaml"}),workspaceData:{globs:po(r),workspaces:ct({workspaceGlobs:po(r),...r})}}}async function xm(r){let{project:e,to:t,logger:s,options:i}=r,n=e.workspaceData.globs.length>0;s.mainStep(fe({action:"create",packageManager:ht.name,project:e}));let o=M({workspaceRoot:e.paths.root});s.rootHeader(),o.packageManager=`${t.name}@${t.version}`,s.rootStep(`adding "packageManager" field to ${e.name} root "package.json"`),i!=null&&i.dry||(ge.default.writeJSONSync(e.paths.packageJson,o,{spaces:2}),n&&(s.rootStep('adding "pnpm-workspace.yaml"'),ge.default.writeFileSync(Rt.default.join(e.paths.root,"pnpm-workspace.yaml"),`packages:
7
7
  ${e.workspaceData.globs.map(a=>` - "${a}"`).join(`
8
- `)}`))),n&&(pe({workspace:{name:"root",paths:e.paths},project:e,to:t,logger:s,options:i}),s.workspaceHeader(),e.workspaceData.workspaces.forEach(a=>{pe({workspace:a,project:e,to:t,logger:s,options:i})}))}async function Bm(r){let{project:e,logger:t,options:s}=r,i=e.workspaceData.globs.length>0;t.mainStep(fe({action:"remove",packageManager:ht.name,project:e}));let n=M({workspaceRoot:e.paths.root});if(e.paths.workspaceConfig&&i&&(t.subStep('removing "pnpm-workspace.yaml"'),s!=null&&s.dry||ge.default.rmSync(e.paths.workspaceConfig,{force:!0})),t.subStep(`removing "packageManager" field in ${e.name} root "package.json"`),delete n.packageManager,!(s!=null&&s.dry)){ge.default.writeJSONSync(e.paths.packageJson,n,{spaces:2});let o=[e.paths.nodeModules,...e.workspaceData.workspaces.map(a=>a.paths.nodeModules)];try{t.subStep('removing "node_modules"'),await Promise.all(o.map(a=>ge.default.rm(a,{recursive:!0,force:!0})))}catch{throw new v("Failed to remove node_modules",{type:"error_removing_node_modules"})}}}async function xm(r){let{project:e,logger:t,options:s}=r;t.subStep(`removing ${Rt.default.relative(e.paths.root,e.paths.lockfile)}`),s!=null&&s.dry||ge.default.rmSync(e.paths.lockfile,{force:!0})}async function Om(r){let{project:e,options:t,logger:s}=r,i=()=>{s.subStep(`converting ${Rt.default.relative(e.paths.root,e.paths.lockfile)} to ${ht.lock}`)},n=async()=>{if(!(t!=null&&t.dry)&&ge.default.existsSync(e.paths.lockfile))try{await(0,dl.default)(ht.name,["import"],{stdio:"ignore",cwd:e.paths.root,preferLocal:!0,shell:process.platform==="win32"})}catch{}finally{ne({project:e,options:t})}};switch(e.packageManager){case"pnpm":break;case"bun":i(),await Qs({project:e,options:t}),await n(),ge.default.rmSync(Rt.default.join(e.paths.root,"yarn.lock"),{force:!0});break;case"npm":i(),await n();break;case"yarn":i(),await n();break}}var gl={detect:Dl,read:vm,create:Rm,remove:Bm,clean:xm,convertLock:Om};u();var Nr=A(require("path")),Bt=A(require("fs-extra"));var hr={name:"npm",lock:"package-lock.json"};async function El(r){let e=Nr.default.join(r.workspaceRoot,hr.lock),t=ut({workspaceRoot:r.workspaceRoot});return Bt.default.existsSync(e)||t===hr.name}async function Pm(r){if(!await El(r))throw new v("Not an npm project",{type:"package_manager-unexpected"});let t=M(r),{name:s,description:i}=We(r),n=lr({workspaces:t.workspaces});return{name:s,description:i,packageManager:hr.name,paths:at({root:r.workspaceRoot,lockFile:hr.lock}),workspaceData:{globs:n,workspaces:ct({workspaceGlobs:n,...r})}}}async function Tm(r){let{project:e,options:t,to:s,logger:i}=r,n=e.workspaceData.globs.length>0;i.mainStep(fe({packageManager:hr.name,action:"create",project:e}));let o=M({workspaceRoot:e.paths.root});i.rootHeader(),i.rootStep(`adding "packageManager" field to ${Nr.default.relative(e.paths.root,e.paths.packageJson)}`),o.packageManager=`${s.name}@${s.version}`,n?(i.rootStep(`adding "workspaces" field to ${Nr.default.relative(e.paths.root,e.paths.packageJson)}`),o.workspaces=e.workspaceData.globs,t!=null&&t.dry||Bt.default.writeJSONSync(e.paths.packageJson,o,{spaces:2}),pe({workspace:{name:"root",paths:e.paths},project:e,to:s,logger:i,options:t}),i.workspaceHeader(),e.workspaceData.workspaces.forEach(a=>{pe({workspace:a,project:e,to:s,logger:i,options:t})})):t!=null&&t.dry||Bt.default.writeJSONSync(e.paths.packageJson,o,{spaces:2})}async function Lm(r){let{project:e,logger:t,options:s}=r,i=e.workspaceData.globs.length>0;t.mainStep(fe({packageManager:hr.name,action:"remove",project:e}));let n=M({workspaceRoot:e.paths.root});if(i&&(t.subStep(`removing "workspaces" field in ${e.name} root "package.json"`),delete n.workspaces),t.subStep(`removing "packageManager" field in ${e.name} root "package.json"`),delete n.packageManager,!(s!=null&&s.dry)){Bt.default.writeJSONSync(e.paths.packageJson,n,{spaces:2});let o=[e.paths.nodeModules,...e.workspaceData.workspaces.map(a=>a.paths.nodeModules)];try{t.subStep('removing "node_modules"'),await Promise.all(o.map(a=>Bt.default.rm(a,{recursive:!0,force:!0})))}catch{throw new v("Failed to remove node_modules",{type:"error_removing_node_modules"})}}}async function Nm(r){let{project:e,logger:t,options:s}=r;t.subStep(`removing ${Nr.default.relative(e.paths.root,e.paths.lockfile)}`),s!=null&&s.dry||Bt.default.rmSync(e.paths.lockfile,{force:!0})}async function Mm(r){let{project:e,options:t}=r;switch(e.packageManager){case"pnpm":ne({project:e,options:t});break;case"bun":ne({project:e,options:t});break;case"npm":break;case"yarn":ne({project:e,options:t});break}}var yl={detect:El,read:Pm,create:Tm,remove:Lm,clean:Nm,convertLock:Mm};u();var fr=A(require("path")),xt=A(require("fs-extra"));var Ot={name:"yarn",lock:"yarn.lock"};async function Al(r){let e=fr.default.join(r.workspaceRoot,Ot.lock),t=ut({workspaceRoot:r.workspaceRoot});return xt.default.existsSync(e)||t===Ot.name}async function Im(r){if(!await Al(r))throw new v("Not a yarn project",{type:"package_manager-unexpected"});let t=M(r),{name:s,description:i}=We(r),n=lr({workspaces:t.workspaces});return{name:s,description:i,packageManager:Ot.name,paths:at({root:r.workspaceRoot,lockFile:Ot.lock}),workspaceData:{globs:n,workspaces:ct({workspaceGlobs:n,...r})}}}async function jm(r){let{project:e,to:t,logger:s,options:i}=r,n=e.workspaceData.globs.length>0;s.mainStep(fe({packageManager:Ot.name,action:"create",project:e}));let o=M({workspaceRoot:e.paths.root});s.rootHeader(),s.rootStep(`adding "packageManager" field to ${fr.default.relative(e.paths.root,e.paths.packageJson)}`),o.packageManager=`${t.name}@${t.version}`,n?(s.rootStep(`adding "workspaces" field to ${fr.default.relative(e.paths.root,e.paths.packageJson)}`),o.workspaces=e.workspaceData.globs,i!=null&&i.dry||xt.default.writeJSONSync(e.paths.packageJson,o,{spaces:2}),pe({workspace:{name:"root",paths:e.paths},project:e,to:t,logger:s,options:i}),s.workspaceHeader(),e.workspaceData.workspaces.forEach(a=>{pe({workspace:a,project:e,to:t,logger:s,options:i})})):i!=null&&i.dry||xt.default.writeJSONSync(e.paths.packageJson,o,{spaces:2})}async function Um(r){let{project:e,logger:t,options:s}=r,i=e.workspaceData.globs.length>0;t.mainStep(fe({packageManager:Ot.name,action:"remove",project:e}));let n=M({workspaceRoot:e.paths.root});if(i&&(t.subStep(`removing "workspaces" field in ${e.name} root "package.json"`),delete n.workspaces),t.subStep(`removing "packageManager" field in ${e.name} root "package.json"`),delete n.packageManager,!(s!=null&&s.dry)){xt.default.writeJSONSync(e.paths.packageJson,n,{spaces:2});let o=[e.paths.nodeModules,...e.workspaceData.workspaces.map(a=>a.paths.nodeModules)];try{t.subStep('removing "node_modules"'),await Promise.all(o.map(a=>xt.default.rm(a,{recursive:!0,force:!0})))}catch{throw new v("Failed to remove node_modules",{type:"error_removing_node_modules"})}}}async function qm(r){let{project:e,logger:t,options:s}=r;t.subStep(`removing ${fr.default.relative(e.paths.root,e.paths.lockfile)}`),s!=null&&s.dry||xt.default.rmSync(e.paths.lockfile,{force:!0})}async function $m(r){let{project:e,options:t,logger:s}=r,i=()=>{s.subStep(`converting ${fr.default.relative(e.paths.root,e.paths.lockfile)} to ${Ot.lock}`)};switch(e.packageManager){case"pnpm":ne({project:e,options:t});break;case"bun":i(),await Qs({project:e,options:t});break;case"npm":ne({project:e,options:t});break;case"yarn":break}}var Cl={detect:Al,read:Im,create:jm,remove:Um,clean:qm,convertLock:$m};u();var Mr=A(require("path")),Pt=A(require("fs-extra"));var pr={name:"bun",lock:"bun.lockb"};async function wl(r){let e=Mr.default.join(r.workspaceRoot,pr.lock),t=ut({workspaceRoot:r.workspaceRoot});return Pt.default.existsSync(e)||t===pr.name}async function Wm(r){if(!await wl(r))throw new v("Not a bun project",{type:"package_manager-unexpected"});let t=M(r),{name:s,description:i}=We(r),n=lr({workspaces:t.workspaces});return{name:s,description:i,packageManager:pr.name,paths:at({root:r.workspaceRoot,lockFile:pr.lock}),workspaceData:{globs:n,workspaces:ct({workspaceGlobs:n,...r})}}}async function zm(r){let{project:e,to:t,logger:s,options:i}=r,n=e.workspaceData.globs.length>0;if(!hl({project:e}))throw new v("Unable to convert project to bun - workspace globs unsupported",{type:"bun-workspace_glob_error"});s.mainStep(fe({packageManager:pr.name,action:"create",project:e}));let o=M({workspaceRoot:e.paths.root});s.rootHeader(),s.rootStep(`adding "packageManager" field to ${Mr.default.relative(e.paths.root,e.paths.packageJson)}`),o.packageManager=`${t.name}@${t.version}`,n?(s.rootStep(`adding "workspaces" field to ${Mr.default.relative(e.paths.root,e.paths.packageJson)}`),o.workspaces=e.workspaceData.globs,i!=null&&i.dry||Pt.default.writeJSONSync(e.paths.packageJson,o,{spaces:2}),pe({workspace:{name:"root",paths:e.paths},project:e,to:t,logger:s,options:i}),s.workspaceHeader(),e.workspaceData.workspaces.forEach(a=>{pe({workspace:a,project:e,to:t,logger:s,options:i})})):i!=null&&i.dry||Pt.default.writeJSONSync(e.paths.packageJson,o,{spaces:2})}async function Gm(r){let{project:e,logger:t,options:s}=r,i=e.workspaceData.globs.length>0;t.mainStep(fe({packageManager:pr.name,action:"remove",project:e}));let n=M({workspaceRoot:e.paths.root});if(i&&(t.subStep(`removing "workspaces" field in ${e.name} root "package.json"`),delete n.workspaces),t.subStep(`removing "packageManager" field in ${e.name} root "package.json"`),delete n.packageManager,!(s!=null&&s.dry)){Pt.default.writeJSONSync(e.paths.packageJson,n,{spaces:2});let o=[e.paths.nodeModules,...e.workspaceData.workspaces.map(a=>a.paths.nodeModules)];try{t.subStep('removing "node_modules"'),await Promise.all(o.map(a=>Pt.default.rm(a,{recursive:!0,force:!0})))}catch{throw new v("Failed to remove node_modules",{type:"error_removing_node_modules"})}}}async function Hm(r){let{project:e,logger:t,options:s}=r;t.subStep(`removing ${Mr.default.relative(e.paths.root,e.paths.lockfile)}`),s!=null&&s.dry||Pt.default.rmSync(e.paths.lockfile,{force:!0})}async function Jm(r){let{project:e,options:t}=r;switch(e.packageManager){case"pnpm":ne({project:e,options:t});break;case"bun":break;case"npm":ne({project:e,options:t});break;case"yarn":ne({project:e,options:t});break}}var Fl={detect:wl,read:Wm,create:zm,remove:Gm,clean:Hm,convertLock:Jm};var Tt={pnpm:gl,yarn:Cl,npm:yl,bun:Fl};async function ei({root:r}){let{exists:e,absolute:t}=lt({directory:r});if(!e)throw new v(`Could not find directory at ${t}. Ensure the directory exists.`,{type:"invalid_directory"});for(let{detect:s,read:i}of Object.values(Tt))if(await s({workspaceRoot:t}))return i({workspaceRoot:t});throw new v("Could not determine package manager. Add `packageManager` to `package.json` or ensure a lockfile is present.",{type:"package_manager-unable_to_detect"})}async function mo(r){let e=new ot;e.hero();let t=await bl.default.prompt({type:"input",name:"directoryInput",message:"Where is the root of the repo?",when:!r,default:".",validate:p=>{let{exists:E,absolute:w}=lt({directory:p});return E?!0:`Directory ${ze.default.dim(`(${w})`)} does not exist`},filter:p=>p.trim()}),{directoryInput:s=r}=t,{exists:i,absolute:n}=lt({directory:s});if(!i)return e.error(`Directory ${ze.default.dim(`(${n})`)} does not exist`),process.exit(1);let o=await ei({root:n}),a=o.workspaceData.workspaces.length,l=a>0,c={};o.workspaceData.workspaces.forEach(p=>{let w=ti.default.relative(n,p.paths.root).split(ti.default.sep)[0];w in c||(c[w]=[]),c[w].push(p)});let h=p=>`${p.name} (${ze.default.italic(`./${ti.default.relative(n,p.paths.root)}`)})`,d=({number:p,dir:E,workspaces:w})=>{e.indented(2,`${p}. ${ze.default.bold(E)}`),w.forEach((P,S)=>{e.indented(3,`${S+1}. ${h(P)}`)})};e.header("Repository Summary"),e.indented(1,`${ze.default.underline(o.name)}:`),e.indented(1,`Package Manager: ${ze.default.bold(ze.default.italic(o.packageManager))}`),l&&(e.indented(1,`Workspaces (${ze.default.bold(a.toString())}):`),Object.keys(c).forEach((p,E)=>{d({number:E+1,workspaces:c[p],dir:p})}),e.blankLine())}u();var Do=A(require("inquirer")),go=A(require("picocolors"));u();var Bl=A(require("picocolors"));u();var kl=A(require("execa")),_l=A(require("ora")),vl=require("semver");var Sl={npm:[{name:"npm",template:"npm",command:"npm",installArgs:["install"],version:"latest",executable:"npx",semver:"*",default:!0}],pnpm:[{name:"pnpm6",template:"pnpm",command:"pnpm",installArgs:["install"],version:"latest-6",executable:"pnpx",semver:"6.x"},{name:"pnpm",template:"pnpm",command:"pnpm",installArgs:["install","--fix-lockfile"],version:"latest",executable:"pnpm dlx",semver:">=7",default:!0}],yarn:[{name:"yarn",template:"yarn",command:"yarn",installArgs:["install"],version:"1.x",executable:"npx",semver:"<2",default:!0},{name:"berry",template:"berry",command:"yarn",installArgs:["install","--no-immutable"],version:"stable",executable:"yarn dlx",semver:">=2"}],bun:[{name:"bun",template:"bun",command:"bun",installArgs:["install"],version:"latest",executable:"bunx",semver:"^1.0.1",default:!0}]};function Vm(r){let{version:e,name:t}=r;return e?Sl[t].find(s=>(0,vl.satisfies)(e,s.semver)):Sl[t].find(s=>s.default)}async function Rl(r){let{to:e,logger:t,options:s}=r,i=t!=null?t:new ot(s),n=Vm(e);if(!n)throw new v("Unsupported package manager version.",{type:"package_manager-unsupported_version"});if(i.subStep(`running "${n.command} ${n.installArgs.join(" ")}"`),!(s!=null&&s.dry)){let o;i.interactive&&(o=(0,_l.default)({text:"installing dependencies...",spinner:{frames:i.installerFrames()}}).start());try{await(0,kl.default)(n.command,n.installArgs,{cwd:r.project.paths.root,preferLocal:!0,shell:process.platform==="win32"}),o&&o.stop(),i.subStep("dependencies installed")}catch(a){throw i.subStepFailure("failed to install dependencies"),a}}}async function xl({project:r,convertTo:e,logger:t,options:s}){if(t.header(`Converting project from ${r.packageManager} to ${e.name}.`),!(s!=null&&s.ignoreUnchangedPackageManager)){if(r.packageManager===e.name)throw new v("You are already using this package manager",{type:"package_manager-already_in_use"});if(!e.version)throw new v(`${e.name} is not installed, or could not be located`,{type:"package_manager-could_not_be_found"})}let i=e;s!=null&&s.ignoreUnchangedPackageManager||await Tt[r.packageManager].remove({project:r,to:i,logger:t,options:s}),await Tt[i.name].create({project:r,to:i,logger:t,options:s}),t.mainStep("Installing dependencies"),s!=null&&s.skipInstall?t.subStep(Bl.default.yellow("Skipping install")):(await Tt[i.name].convertLock({project:r,to:i,logger:t,options:s}),await Rl({project:r,to:i,logger:t,options:s})),t.mainStep(`Cleaning up ${r.packageManager} workspaces`),r.packageManager!==e.name&&await Tt[r.packageManager].clean({project:r,logger:t})}function Ym({packageManager:r,currentWorkspaceManger:e,availablePackageManagers:t}){return e===r?"already in use":t[r]?!1:"not installed"}async function Eo(r,e,t){let s=new ot(t);s.hero(),s.header("Welcome, let's convert your project."),s.blankLine();let i=await Do.default.prompt({type:"input",name:"directoryInput",message:"Where is the root of your repo?",when:!r,default:".",validate:p=>{let{exists:E,absolute:w}=lt({directory:p});return E?!0:`Directory ${go.default.dim(`(${w})`)} does not exist`},filter:p=>p.trim()}),{directoryInput:n=r}=i,{exists:o,absolute:a}=lt({directory:n});if(!o)return s.error(`Directory ${go.default.dim(`(${a})`)} does not exist`),process.exit(1);let[l,c]=await Promise.all([ei({root:a}),bi()]),h=await Do.default.prompt({name:"packageManagerInput",type:"list",message:`Convert from ${l.packageManager} to:`,when:!e||!Object.keys(c).includes(e),choices:[{pm:"npm",label:"npm"},{pm:"pnpm",label:"pnpm"},{pm:"yarn",label:"yarn"},{pm:"bun",label:"Bun (beta)"}].map(({pm:p,label:E})=>({name:E,value:p,disabled:Ym({packageManager:p,currentWorkspaceManger:l.packageManager,availablePackageManagers:c})}))}),{packageManagerInput:d=e}=h;await xl({project:l,convertTo:{name:d,version:c[d]},logger:s,options:t})}var Ol=ho({packageInfo:fo}),ri=new Pl.Command;ri.name("@turbo/workspaces").description("Tools for working with package manager workspaces").version(fo.version,"-v, --version","output the current version");ri.command("convert").description("Convert project between workspace managers").argument("[path]","Project root").argument("[package-manager]","Package manager to convert to").option("--skip-install","Do not run a package manager install after conversion",!1).option("--ignore-unchanged-package-manager","Prevent script failure if the package manager is unchanged",!1).option("--dry","Dry run (no changes are made to files)",!1).option("--force","Bypass Git safety checks and forcibly run conversion",!1).action(Eo);ri.command("summary").description("Display a summary of the specified project").argument("[path]","Project root").action(mo);ri.parseAsync().then(()=>Ol()).catch(async r=>{me.log(),r instanceof v?me.log(yo.default.red(r.message)):(me.log(yo.default.red("Unexpected error. Please report it as a bug:")),me.log(r)),me.log(),await Ol(1)});
8
+ `)}`))),n&&(pe({workspace:{name:"root",paths:e.paths},project:e,to:t,logger:s,options:i}),s.workspaceHeader(),e.workspaceData.workspaces.forEach(a=>{pe({workspace:a,project:e,to:t,logger:s,options:i})}))}async function Om(r){let{project:e,logger:t,options:s}=r,i=e.workspaceData.globs.length>0;t.mainStep(fe({action:"remove",packageManager:ht.name,project:e}));let n=M({workspaceRoot:e.paths.root});if(e.paths.workspaceConfig&&i&&(t.subStep('removing "pnpm-workspace.yaml"'),s!=null&&s.dry||ge.default.rmSync(e.paths.workspaceConfig,{force:!0})),t.subStep(`removing "packageManager" field in ${e.name} root "package.json"`),delete n.packageManager,!(s!=null&&s.dry)){ge.default.writeJSONSync(e.paths.packageJson,n,{spaces:2});let o=[e.paths.nodeModules,...e.workspaceData.workspaces.map(a=>a.paths.nodeModules)];try{t.subStep('removing "node_modules"'),await Promise.all(o.map(a=>ge.default.rm(a,{recursive:!0,force:!0})))}catch{throw new v("Failed to remove node_modules",{type:"error_removing_node_modules"})}}}async function Pm(r){let{project:e,logger:t,options:s}=r;t.subStep(`removing ${Rt.default.relative(e.paths.root,e.paths.lockfile)}`),s!=null&&s.dry||ge.default.rmSync(e.paths.lockfile,{force:!0})}async function Tm(r){let{project:e,options:t,logger:s}=r,i=()=>{s.subStep(`converting ${Rt.default.relative(e.paths.root,e.paths.lockfile)} to ${ht.lock}`)},n=async()=>{if(!(t!=null&&t.dry)&&ge.default.existsSync(e.paths.lockfile))try{await(0,gl.default)(ht.name,["import"],{stdio:"ignore",cwd:e.paths.root,preferLocal:!0,shell:process.platform==="win32"})}catch{}finally{ne({project:e,options:t})}};switch(e.packageManager){case"pnpm":break;case"bun":i(),await Qs({project:e,options:t}),await n(),ge.default.rmSync(Rt.default.join(e.paths.root,"yarn.lock"),{force:!0});break;case"npm":i(),await n();break;case"yarn":i(),await n();break}}var yl={detect:El,read:Bm,create:xm,remove:Om,clean:Pm,convertLock:Tm};u();var Nr=A(require("path")),Bt=A(require("fs-extra"));var hr={name:"npm",lock:"package-lock.json"};async function Al(r){let e=Nr.default.join(r.workspaceRoot,hr.lock),t=ut({workspaceRoot:r.workspaceRoot});return Bt.default.existsSync(e)||t===hr.name}async function Lm(r){if(!await Al(r))throw new v("Not an npm project",{type:"package_manager-unexpected"});let t=M(r),{name:s,description:i}=We(r),n=lr({workspaces:t.workspaces});return{name:s,description:i,packageManager:hr.name,paths:at({root:r.workspaceRoot,lockFile:hr.lock}),workspaceData:{globs:n,workspaces:ct({workspaceGlobs:n,...r})}}}async function Nm(r){let{project:e,options:t,to:s,logger:i}=r,n=e.workspaceData.globs.length>0;i.mainStep(fe({packageManager:hr.name,action:"create",project:e}));let o=M({workspaceRoot:e.paths.root});i.rootHeader(),i.rootStep(`adding "packageManager" field to ${Nr.default.relative(e.paths.root,e.paths.packageJson)}`),o.packageManager=`${s.name}@${s.version}`,n?(i.rootStep(`adding "workspaces" field to ${Nr.default.relative(e.paths.root,e.paths.packageJson)}`),o.workspaces=e.workspaceData.globs,t!=null&&t.dry||Bt.default.writeJSONSync(e.paths.packageJson,o,{spaces:2}),pe({workspace:{name:"root",paths:e.paths},project:e,to:s,logger:i,options:t}),i.workspaceHeader(),e.workspaceData.workspaces.forEach(a=>{pe({workspace:a,project:e,to:s,logger:i,options:t})})):t!=null&&t.dry||Bt.default.writeJSONSync(e.paths.packageJson,o,{spaces:2})}async function Mm(r){let{project:e,logger:t,options:s}=r,i=e.workspaceData.globs.length>0;t.mainStep(fe({packageManager:hr.name,action:"remove",project:e}));let n=M({workspaceRoot:e.paths.root});if(i&&(t.subStep(`removing "workspaces" field in ${e.name} root "package.json"`),delete n.workspaces),t.subStep(`removing "packageManager" field in ${e.name} root "package.json"`),delete n.packageManager,!(s!=null&&s.dry)){Bt.default.writeJSONSync(e.paths.packageJson,n,{spaces:2});let o=[e.paths.nodeModules,...e.workspaceData.workspaces.map(a=>a.paths.nodeModules)];try{t.subStep('removing "node_modules"'),await Promise.all(o.map(a=>Bt.default.rm(a,{recursive:!0,force:!0})))}catch{throw new v("Failed to remove node_modules",{type:"error_removing_node_modules"})}}}async function Im(r){let{project:e,logger:t,options:s}=r;t.subStep(`removing ${Nr.default.relative(e.paths.root,e.paths.lockfile)}`),s!=null&&s.dry||Bt.default.rmSync(e.paths.lockfile,{force:!0})}async function jm(r){let{project:e,options:t}=r;switch(e.packageManager){case"pnpm":ne({project:e,options:t});break;case"bun":ne({project:e,options:t});break;case"npm":break;case"yarn":ne({project:e,options:t});break}}var wl={detect:Al,read:Lm,create:Nm,remove:Mm,clean:Im,convertLock:jm};u();var fr=A(require("path")),xt=A(require("fs-extra"));var Ot={name:"yarn",lock:"yarn.lock"};async function Cl(r){let e=fr.default.join(r.workspaceRoot,Ot.lock),t=ut({workspaceRoot:r.workspaceRoot});return xt.default.existsSync(e)||t===Ot.name}async function Um(r){if(!await Cl(r))throw new v("Not a yarn project",{type:"package_manager-unexpected"});let t=M(r),{name:s,description:i}=We(r),n=lr({workspaces:t.workspaces});return{name:s,description:i,packageManager:Ot.name,paths:at({root:r.workspaceRoot,lockFile:Ot.lock}),workspaceData:{globs:n,workspaces:ct({workspaceGlobs:n,...r})}}}async function $m(r){let{project:e,to:t,logger:s,options:i}=r,n=e.workspaceData.globs.length>0;s.mainStep(fe({packageManager:Ot.name,action:"create",project:e}));let o=M({workspaceRoot:e.paths.root});s.rootHeader(),s.rootStep(`adding "packageManager" field to ${fr.default.relative(e.paths.root,e.paths.packageJson)}`),o.packageManager=`${t.name}@${t.version}`,n?(s.rootStep(`adding "workspaces" field to ${fr.default.relative(e.paths.root,e.paths.packageJson)}`),o.workspaces=e.workspaceData.globs,i!=null&&i.dry||xt.default.writeJSONSync(e.paths.packageJson,o,{spaces:2}),pe({workspace:{name:"root",paths:e.paths},project:e,to:t,logger:s,options:i}),s.workspaceHeader(),e.workspaceData.workspaces.forEach(a=>{pe({workspace:a,project:e,to:t,logger:s,options:i})})):i!=null&&i.dry||xt.default.writeJSONSync(e.paths.packageJson,o,{spaces:2})}async function qm(r){let{project:e,logger:t,options:s}=r,i=e.workspaceData.globs.length>0;t.mainStep(fe({packageManager:Ot.name,action:"remove",project:e}));let n=M({workspaceRoot:e.paths.root});if(i&&(t.subStep(`removing "workspaces" field in ${e.name} root "package.json"`),delete n.workspaces),t.subStep(`removing "packageManager" field in ${e.name} root "package.json"`),delete n.packageManager,!(s!=null&&s.dry)){xt.default.writeJSONSync(e.paths.packageJson,n,{spaces:2});let o=[e.paths.nodeModules,...e.workspaceData.workspaces.map(a=>a.paths.nodeModules)];try{t.subStep('removing "node_modules"'),await Promise.all(o.map(a=>xt.default.rm(a,{recursive:!0,force:!0})))}catch{throw new v("Failed to remove node_modules",{type:"error_removing_node_modules"})}}}async function Wm(r){let{project:e,logger:t,options:s}=r;t.subStep(`removing ${fr.default.relative(e.paths.root,e.paths.lockfile)}`),s!=null&&s.dry||xt.default.rmSync(e.paths.lockfile,{force:!0})}async function zm(r){let{project:e,options:t,logger:s}=r,i=()=>{s.subStep(`converting ${fr.default.relative(e.paths.root,e.paths.lockfile)} to ${Ot.lock}`)};switch(e.packageManager){case"pnpm":ne({project:e,options:t});break;case"bun":i(),await Qs({project:e,options:t});break;case"npm":ne({project:e,options:t});break;case"yarn":break}}var Fl={detect:Cl,read:Um,create:$m,remove:qm,clean:Wm,convertLock:zm};u();var Mr=A(require("path")),Pt=A(require("fs-extra"));var pr={name:"bun",lock:"bun.lockb"};async function bl(r){let e=Mr.default.join(r.workspaceRoot,pr.lock),t=ut({workspaceRoot:r.workspaceRoot});return Pt.default.existsSync(e)||t===pr.name}async function Gm(r){if(!await bl(r))throw new v("Not a bun project",{type:"package_manager-unexpected"});let t=M(r),{name:s,description:i}=We(r),n=lr({workspaces:t.workspaces});return{name:s,description:i,packageManager:pr.name,paths:at({root:r.workspaceRoot,lockFile:pr.lock}),workspaceData:{globs:n,workspaces:ct({workspaceGlobs:n,...r})}}}async function Hm(r){let{project:e,to:t,logger:s,options:i}=r,n=e.workspaceData.globs.length>0;if(!pl({project:e}))throw new v("Unable to convert project to bun - workspace globs unsupported",{type:"bun-workspace_glob_error"});s.mainStep(fe({packageManager:pr.name,action:"create",project:e}));let o=M({workspaceRoot:e.paths.root});s.rootHeader(),s.rootStep(`adding "packageManager" field to ${Mr.default.relative(e.paths.root,e.paths.packageJson)}`),o.packageManager=`${t.name}@${t.version}`,n?(s.rootStep(`adding "workspaces" field to ${Mr.default.relative(e.paths.root,e.paths.packageJson)}`),o.workspaces=e.workspaceData.globs,i!=null&&i.dry||Pt.default.writeJSONSync(e.paths.packageJson,o,{spaces:2}),pe({workspace:{name:"root",paths:e.paths},project:e,to:t,logger:s,options:i}),s.workspaceHeader(),e.workspaceData.workspaces.forEach(a=>{pe({workspace:a,project:e,to:t,logger:s,options:i})})):i!=null&&i.dry||Pt.default.writeJSONSync(e.paths.packageJson,o,{spaces:2})}async function Jm(r){let{project:e,logger:t,options:s}=r,i=e.workspaceData.globs.length>0;t.mainStep(fe({packageManager:pr.name,action:"remove",project:e}));let n=M({workspaceRoot:e.paths.root});if(i&&(t.subStep(`removing "workspaces" field in ${e.name} root "package.json"`),delete n.workspaces),t.subStep(`removing "packageManager" field in ${e.name} root "package.json"`),delete n.packageManager,!(s!=null&&s.dry)){Pt.default.writeJSONSync(e.paths.packageJson,n,{spaces:2});let o=[e.paths.nodeModules,...e.workspaceData.workspaces.map(a=>a.paths.nodeModules)];try{t.subStep('removing "node_modules"'),await Promise.all(o.map(a=>Pt.default.rm(a,{recursive:!0,force:!0})))}catch{throw new v("Failed to remove node_modules",{type:"error_removing_node_modules"})}}}async function Vm(r){let{project:e,logger:t,options:s}=r;t.subStep(`removing ${Mr.default.relative(e.paths.root,e.paths.lockfile)}`),s!=null&&s.dry||Pt.default.rmSync(e.paths.lockfile,{force:!0})}async function Ym(r){let{project:e,options:t}=r;switch(e.packageManager){case"pnpm":ne({project:e,options:t});break;case"bun":break;case"npm":ne({project:e,options:t});break;case"yarn":ne({project:e,options:t});break}}var Sl={detect:bl,read:Gm,create:Hm,remove:Jm,clean:Vm,convertLock:Ym};var Tt={pnpm:yl,yarn:Fl,npm:wl,bun:Sl};async function ei({root:r}){let{exists:e,absolute:t}=lt({directory:r});if(!e)throw new v(`Could not find directory at ${t}. Ensure the directory exists.`,{type:"invalid_directory"});for(let{detect:s,read:i}of Object.values(Tt))if(await s({workspaceRoot:t}))return i({workspaceRoot:t});throw new v("Could not determine package manager. Add `packageManager` to `package.json` or ensure a lockfile is present.",{type:"package_manager-unable_to_detect"})}async function mo(r){let e=new ot;e.hero();let t=await kl.default.prompt({type:"input",name:"directoryInput",message:"Where is the root of the repo?",when:!r,default:".",validate:p=>{let{exists:E,absolute:C}=lt({directory:p});return E?!0:`Directory ${ze.default.dim(`(${C})`)} does not exist`},filter:p=>p.trim()}),{directoryInput:s=r}=t,{exists:i,absolute:n}=lt({directory:s});if(!i)return e.error(`Directory ${ze.default.dim(`(${n})`)} does not exist`),process.exit(1);let o=await ei({root:n}),a=o.workspaceData.workspaces.length,l=a>0,c={};o.workspaceData.workspaces.forEach(p=>{let C=ti.default.relative(n,p.paths.root).split(ti.default.sep)[0];C in c||(c[C]=[]),c[C].push(p)});let h=p=>`${p.name} (${ze.default.italic(`./${ti.default.relative(n,p.paths.root)}`)})`,d=({number:p,dir:E,workspaces:C})=>{e.indented(2,`${p}. ${ze.default.bold(E)}`),C.forEach((P,S)=>{e.indented(3,`${S+1}. ${h(P)}`)})};e.header("Repository Summary"),e.indented(1,`${ze.default.underline(o.name)}:`),e.indented(1,`Package Manager: ${ze.default.bold(ze.default.italic(o.packageManager))}`),l&&(e.indented(1,`Workspaces (${ze.default.bold(a.toString())}):`),Object.keys(c).forEach((p,E)=>{d({number:E+1,workspaces:c[p],dir:p})}),e.blankLine())}u();var Do=A(require("inquirer")),go=A(require("picocolors"));u();var Ol=A(require("picocolors"));u();var vl=A(require("execa")),Rl=A(require("ora")),Bl=require("semver");var _l={npm:[{name:"npm",template:"npm",command:"npm",installArgs:["install"],version:"latest",executable:"npx",semver:"*",default:!0}],pnpm:[{name:"pnpm6",template:"pnpm",command:"pnpm",installArgs:["install"],version:"latest-6",executable:"pnpx",semver:"6.x"},{name:"pnpm",template:"pnpm",command:"pnpm",installArgs:["install","--fix-lockfile"],version:"latest",executable:"pnpm dlx",semver:">=7",default:!0}],yarn:[{name:"yarn",template:"yarn",command:"yarn",installArgs:["install"],version:"1.x",executable:"npx",semver:"<2",default:!0},{name:"berry",template:"berry",command:"yarn",installArgs:["install","--no-immutable"],version:"stable",executable:"yarn dlx",semver:">=2"}],bun:[{name:"bun",template:"bun",command:"bun",installArgs:["install"],version:"latest",executable:"bunx",semver:"^1.0.1",default:!0}]};function Km(r){let{version:e,name:t}=r;return e?_l[t].find(s=>(0,Bl.satisfies)(e,s.semver)):_l[t].find(s=>s.default)}async function xl(r){let{to:e,logger:t,options:s}=r,i=t!=null?t:new ot(s),n=Km(e);if(!n)throw new v("Unsupported package manager version.",{type:"package_manager-unsupported_version"});if(i.subStep(`running "${n.command} ${n.installArgs.join(" ")}"`),!(s!=null&&s.dry)){let o;i.interactive&&(o=(0,Rl.default)({text:"installing dependencies...",spinner:{frames:i.installerFrames()}}).start());try{await(0,vl.default)(n.command,n.installArgs,{cwd:r.project.paths.root,preferLocal:!0,shell:process.platform==="win32"}),o&&o.stop(),i.subStep("dependencies installed")}catch(a){throw i.subStepFailure("failed to install dependencies"),a}}}async function Pl({project:r,convertTo:e,logger:t,options:s}){if(t.header(`Converting project from ${r.packageManager} to ${e.name}.`),!(s!=null&&s.ignoreUnchangedPackageManager)){if(r.packageManager===e.name)throw new v("You are already using this package manager",{type:"package_manager-already_in_use"});if(!e.version)throw new v(`${e.name} is not installed, or could not be located`,{type:"package_manager-could_not_be_found"})}let i=e;s!=null&&s.ignoreUnchangedPackageManager||await Tt[r.packageManager].remove({project:r,to:i,logger:t,options:s}),await Tt[i.name].create({project:r,to:i,logger:t,options:s}),t.mainStep("Installing dependencies"),s!=null&&s.skipInstall?t.subStep(Ol.default.yellow("Skipping install")):(await Tt[i.name].convertLock({project:r,to:i,logger:t,options:s}),await xl({project:r,to:i,logger:t,options:s})),t.mainStep(`Cleaning up ${r.packageManager} workspaces`),r.packageManager!==e.name&&await Tt[r.packageManager].clean({project:r,logger:t})}function Zm({packageManager:r,currentWorkspaceManger:e,availablePackageManagers:t}){return e===r?"already in use":t[r]?!1:"not installed"}async function Eo(r,e,t){let s=new ot(t);s.hero(),s.header("Welcome, let's convert your project."),s.blankLine();let i=await Do.default.prompt({type:"input",name:"directoryInput",message:"Where is the root of your repo?",when:!r,default:".",validate:p=>{let{exists:E,absolute:C}=lt({directory:p});return E?!0:`Directory ${go.default.dim(`(${C})`)} does not exist`},filter:p=>p.trim()}),{directoryInput:n=r}=i,{exists:o,absolute:a}=lt({directory:n});if(!o)return s.error(`Directory ${go.default.dim(`(${a})`)} does not exist`),process.exit(1);let[l,c]=await Promise.all([ei({root:a}),bi()]),h=await Do.default.prompt({name:"packageManagerInput",type:"list",message:`Convert from ${l.packageManager} to:`,when:!e||!Object.keys(c).includes(e),choices:[{pm:"npm",label:"npm"},{pm:"pnpm",label:"pnpm"},{pm:"yarn",label:"yarn"},{pm:"bun",label:"Bun (beta)"}].map(({pm:p,label:E})=>({name:E,value:p,disabled:Zm({packageManager:p,currentWorkspaceManger:l.packageManager,availablePackageManagers:c})}))}),{packageManagerInput:d=e}=h;await Pl({project:l,convertTo:{name:d,version:c[d]},logger:s,options:t})}var Tl=ho({packageInfo:fo}),ri=new Ll.Command;ri.name("@turbo/workspaces").description("Tools for working with package manager workspaces").version(fo.version,"-v, --version","output the current version");ri.command("convert").description("Convert project between workspace managers").argument("[path]","Project root").argument("[package-manager]","Package manager to convert to").option("--skip-install","Do not run a package manager install after conversion",!1).option("--ignore-unchanged-package-manager","Prevent script failure if the package manager is unchanged",!1).option("--dry","Dry run (no changes are made to files)",!1).option("--force","Bypass Git safety checks and forcibly run conversion",!1).action(Eo);ri.command("summary").description("Display a summary of the specified project").argument("[path]","Project root").action(mo);ri.parseAsync().then(()=>Tl()).catch(async r=>{me.log(),r instanceof v?me.log(yo.default.red(r.message)):(me.log(yo.default.red("Unexpected error. Please report it as a bug:")),me.log(r)),me.log(),await Tl(1)});
9
9
  /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */