@turbo/workspaces 2.7.2-canary.0 → 2.7.2-canary.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-7IDDFLAH.mjs → chunk-2WSM2AFM.mjs} +5 -5
- package/dist/cli.js +5 -5
- package/dist/cli.mjs +1 -1
- package/dist/index.js +5 -5
- package/dist/index.mjs +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
"use strict";var Dl=Object.create;var Tr=Object.defineProperty;var gl=Object.getOwnPropertyDescriptor;var El=Object.getOwnPropertyNames;var yl=Object.getPrototypeOf,Al=Object.prototype.hasOwnProperty;var Cl=(r,e)=>()=>(r&&(e=r(r=0)),e);var E=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),wl=(r,e)=>{for(var t in e)Tr(r,t,{get:e[t],enumerable:!0})},ao=(r,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of El(e))!Al.call(r,i)&&i!==t&&Tr(r,i,{get:()=>e[i],enumerable:!(s=gl(e,i))||s.enumerable});return r};var w=(r,e,t)=>(t=r!=null?Dl(yl(r)):{},ao(e||!r||!r.__esModule?Tr(t,"default",{value:r,enumerable:!0}):t,r)),Fl=r=>ao(Tr({},"__esModule",{value:!0}),r);var u=Cl(()=>{});var co=E((vm,Fe)=>{u();function ti(r){return Fe.exports=ti=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},Fe.exports.__esModule=!0,Fe.exports.default=Fe.exports,ti(r)}Fe.exports=ti,Fe.exports.__esModule=!0,Fe.exports.default=Fe.exports});var fo=E((Bm,be)=>{u();var lo=co().default;function ho(){"use strict";be.exports=ho=function(){return e},be.exports.__esModule=!0,be.exports.default=be.exports;var r,e={},t=Object.prototype,s=t.hasOwnProperty,i=Object.defineProperty||function(g,p,d){g[p]=d.value},n=typeof Symbol=="function"?Symbol:{},o=n.iterator||"@@iterator",a=n.asyncIterator||"@@asyncIterator",l=n.toStringTag||"@@toStringTag";function c(g,p,d){return Object.defineProperty(g,p,{value:d,enumerable:!0,configurable:!0,writable:!0}),g[p]}try{c({},"")}catch{c=function(d,y,F){return d[y]=F}}function h(g,p,d,y){var F=p&&p.prototype instanceof x?p:x,C=Object.create(F.prototype),T=new Qs(y||[]);return i(C,"_invoke",{value:ml(g,d,T)}),C}function m(g,p,d){try{return{type:"normal",arg:g.call(p,d)}}catch(y){return{type:"throw",arg:y}}}e.wrap=h;var D="suspendedStart",A="suspendedYield",b="executing",P="completed",S={};function x(){}function ut(){}function de(){}var Ks={};c(Ks,o,function(){return this});var Zs=Object.getPrototypeOf,Or=Zs&&Zs(Zs(ei([])));Or&&Or!==t&&s.call(Or,o)&&(Ks=Or);var vt=de.prototype=x.prototype=Object.create(Ks);function oo(g){["next","throw","return"].forEach(function(p){c(g,p,function(d){return this._invoke(p,d)})})}function Pr(g,p){function d(F,C,T,G){var H=m(g[F],g,C);if(H.type!=="throw"){var at=H.arg,$e=at.value;return $e&&lo($e)=="object"&&s.call($e,"__await")?p.resolve($e.__await).then(function(ct){d("next",ct,T,G)},function(ct){d("throw",ct,T,G)}):p.resolve($e).then(function(ct){at.value=ct,T(at)},function(ct){return d("throw",ct,T,G)})}G(H.arg)}var y;i(this,"_invoke",{value:function(C,T){function G(){return new p(function(H,at){d(C,T,H,at)})}return y=y?y.then(G,G):G()}})}function ml(g,p,d){var y=D;return function(F,C){if(y===b)throw new Error("Generator is already running");if(y===P){if(F==="throw")throw C;return{value:r,done:!0}}for(d.method=F,d.arg=C;;){var T=d.delegate;if(T){var G=uo(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(y===D)throw y=P,d.arg;d.dispatchException(d.arg)}else d.method==="return"&&d.abrupt("return",d.arg);y=b;var H=m(g,p,d);if(H.type==="normal"){if(y=d.done?P:A,H.arg===S)continue;return{value:H.arg,done:d.done}}H.type==="throw"&&(y=P,d.method="throw",d.arg=H.arg)}}}function uo(g,p){var d=p.method,y=g.iterator[d];if(y===r)return p.delegate=null,d==="throw"&&g.iterator.return&&(p.method="return",p.arg=r,uo(g,p),p.method==="throw")||d!=="return"&&(p.method="throw",p.arg=new TypeError("The iterator does not provide a '"+d+"' method")),S;var F=m(y,g.iterator,p.arg);if(F.type==="throw")return p.method="throw",p.arg=F.arg,p.delegate=null,S;var C=F.arg;return C?C.done?(p[g.resultName]=C.value,p.next=g.nextLoc,p.method!=="return"&&(p.method="next",p.arg=r),p.delegate=null,S):C:(p.method="throw",p.arg=new TypeError("iterator result is not an object"),p.delegate=null,S)}function dl(g){var p={tryLoc:g[0]};1 in g&&(p.catchLoc=g[1]),2 in g&&(p.finallyLoc=g[2],p.afterLoc=g[3]),this.tryEntries.push(p)}function Xs(g){var p=g.completion||{};p.type="normal",delete p.arg,g.completion=p}function Qs(g){this.tryEntries=[{tryLoc:"root"}],g.forEach(dl,this),this.reset(!0)}function ei(g){if(g||g===""){var p=g[o];if(p)return p.call(g);if(typeof g.next=="function")return g;if(!isNaN(g.length)){var d=-1,y=function F(){for(;++d<g.length;)if(s.call(g,d))return F.value=g[d],F.done=!1,F;return F.value=r,F.done=!0,F};return y.next=y}}throw new TypeError(lo(g)+" is not iterable")}return ut.prototype=de,i(vt,"constructor",{value:de,configurable:!0}),i(de,"constructor",{value:ut,configurable:!0}),ut.displayName=c(de,l,"GeneratorFunction"),e.isGeneratorFunction=function(g){var p=typeof g=="function"&&g.constructor;return!!p&&(p===ut||(p.displayName||p.name)==="GeneratorFunction")},e.mark=function(g){return Object.setPrototypeOf?Object.setPrototypeOf(g,de):(g.__proto__=de,c(g,l,"GeneratorFunction")),g.prototype=Object.create(vt),g},e.awrap=function(g){return{__await:g}},oo(Pr.prototype),c(Pr.prototype,a,function(){return this}),e.AsyncIterator=Pr,e.async=function(g,p,d,y,F){F===void 0&&(F=Promise);var C=new Pr(h(g,p,d,y),F);return e.isGeneratorFunction(p)?C:C.next().then(function(T){return T.done?T.value:C.next()})},oo(vt),c(vt,l,"Generator"),c(vt,o,function(){return this}),c(vt,"toString",function(){return"[object Generator]"}),e.keys=function(g){var p=Object(g),d=[];for(var y in p)d.push(y);return d.reverse(),function F(){for(;d.length;){var C=d.pop();if(C in p)return F.value=C,F.done=!1,F}return F.done=!0,F}},e.values=ei,Qs.prototype={constructor:Qs,reset:function(p){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(Xs),!p)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 p=this.tryEntries[0].completion;if(p.type==="throw")throw p.arg;return this.rval},dispatchException:function(p){if(this.done)throw p;var d=this;function y(at,$e){return T.type="throw",T.arg=p,d.next=at,$e&&(d.method="next",d.arg=r),!!$e}for(var F=this.tryEntries.length-1;F>=0;--F){var C=this.tryEntries[F],T=C.completion;if(C.tryLoc==="root")return y("end");if(C.tryLoc<=this.prev){var G=s.call(C,"catchLoc"),H=s.call(C,"finallyLoc");if(G&&H){if(this.prev<C.catchLoc)return y(C.catchLoc,!0);if(this.prev<C.finallyLoc)return y(C.finallyLoc)}else if(G){if(this.prev<C.catchLoc)return y(C.catchLoc,!0)}else{if(!H)throw new Error("try statement without catch or finally");if(this.prev<C.finallyLoc)return y(C.finallyLoc)}}}},abrupt:function(p,d){for(var y=this.tryEntries.length-1;y>=0;--y){var F=this.tryEntries[y];if(F.tryLoc<=this.prev&&s.call(F,"finallyLoc")&&this.prev<F.finallyLoc){var C=F;break}}C&&(p==="break"||p==="continue")&&C.tryLoc<=d&&d<=C.finallyLoc&&(C=null);var T=C?C.completion:{};return T.type=p,T.arg=d,C?(this.method="next",this.next=C.finallyLoc,S):this.complete(T)},complete:function(p,d){if(p.type==="throw")throw p.arg;return p.type==="break"||p.type==="continue"?this.next=p.arg:p.type==="return"?(this.rval=this.arg=p.arg,this.method="return",this.next="end"):p.type==="normal"&&d&&(this.next=d),S},finish:function(p){for(var d=this.tryEntries.length-1;d>=0;--d){var y=this.tryEntries[d];if(y.finallyLoc===p)return this.complete(y.completion,y.afterLoc),Xs(y),S}},catch:function(p){for(var d=this.tryEntries.length-1;d>=0;--d){var y=this.tryEntries[d];if(y.tryLoc===p){var F=y.completion;if(F.type==="throw"){var C=F.arg;Xs(y)}return C}}throw new Error("illegal catch attempt")},delegateYield:function(p,d,y){return this.delegate={iterator:ei(p),resultName:d,nextLoc:y},this.method==="next"&&(this.arg=r),S}},e}be.exports=ho,be.exports.__esModule=!0,be.exports.default=be.exports});var mo=E((xm,po)=>{u();var Nr=fo()();po.exports=Nr;try{regeneratorRuntime=Nr}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=Nr:Function("r","regeneratorRuntime = r")(Nr)}});var go=E((Qm,ai)=>{"use strict";u();var Do=(r,...e)=>new Promise(t=>{t(r(...e))});ai.exports=Do;ai.exports.default=Do});var yo=E((ed,ci)=>{"use strict";u();var bl=go(),Eo=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=bl(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};ci.exports=Eo;ci.exports.default=Eo});var wo=E((td,li)=>{"use strict";u();var Ao=yo(),Lr=class extends Error{constructor(e){super(),this.value=e}},Sl=async(r,e)=>e(await r),kl=async r=>{let e=await Promise.all(r);if(e[1]===!0)throw new Lr(e[0]);return!1},Co=async(r,e,t)=>{t={concurrency:1/0,preserveOrder:!0,...t};let s=Ao(t.concurrency),i=[...r].map(o=>[o,s(Sl,o,e)]),n=Ao(t.preserveOrder?1:1/0);try{await Promise.all(i.map(o=>n(kl,o)))}catch(o){if(o instanceof Lr)return o.value;throw o}};li.exports=Co;li.exports.default=Co});var Ro=E((rd,hi)=>{"use strict";u();var Fo=require("path"),Ir=require("fs"),{promisify:bo}=require("util"),_l=wo(),Rl=bo(Ir.stat),vl=bo(Ir.lstat),So={directory:"isDirectory",file:"isFile"};function ko({type:r}){if(!(r in So))throw new Error(`Invalid type specified: ${r}`)}var _o=(r,e)=>r===void 0||e[So[r]]();hi.exports=async(r,e)=>{e={cwd:process.cwd(),type:"file",allowSymlinks:!0,...e},ko(e);let t=e.allowSymlinks?Rl:vl;return _l(r,async s=>{try{let i=await t(Fo.resolve(e.cwd,s));return _o(e.type,i)}catch{return!1}},e)};hi.exports.sync=(r,e)=>{e={cwd:process.cwd(),allowSymlinks:!0,type:"file",...e},ko(e);let t=e.allowSymlinks?Ir.statSync:Ir.lstatSync;for(let s of r)try{let i=t(Fo.resolve(e.cwd,s));if(_o(e.type,i))return s}catch{}}});var Bo=E((sd,fi)=>{"use strict";u();var vo=require("fs"),{promisify:Bl}=require("util"),xl=Bl(vo.access);fi.exports=async r=>{try{return await xl(r),!0}catch{return!1}};fi.exports.sync=r=>{try{return vo.accessSync(r),!0}catch{return!1}}});var Oo=E((id,xt)=>{"use strict";u();var We=require("path"),Mr=Ro(),xo=Bo(),pi=Symbol("findUp.stop");xt.exports=async(r,e={})=>{let t=We.resolve(e.cwd||""),{root:s}=We.parse(t),i=[].concat(r),n=async o=>{if(typeof r!="function")return Mr(i,o);let a=await r(o.cwd);return typeof a=="string"?Mr([a],o):a};for(;;){let o=await n({...e,cwd:t});if(o===pi)return;if(o)return We.resolve(t,o);if(t===s)return;t=We.dirname(t)}};xt.exports.sync=(r,e={})=>{let t=We.resolve(e.cwd||""),{root:s}=We.parse(t),i=[].concat(r),n=o=>{if(typeof r!="function")return Mr.sync(i,o);let a=r(o.cwd);return typeof a=="string"?Mr.sync([a],o):a};for(;;){let o=n({...e,cwd:t});if(o===pi)return;if(o)return We.resolve(t,o);if(t===s)return;t=We.dirname(t)}};xt.exports.exists=xo;xt.exports.sync.exists=xo.sync;xt.exports.stop=pi});var Pt=E((Od,qo)=>{"use strict";u();var Uo=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"]]);qo.exports=r=>r?Object.keys(r).map(e=>[Uo.has(e)?Uo.get(e):e,r[e]]).reduce((e,t)=>(e[t[0]]=t[1],e),Object.create(null)):{}});var Hr=E((Pd,Ko)=>{"use strict";u();var $o=typeof process=="object"&&process?process:{stdout:null,stderr:null},Ql=require("events"),Wo=require("stream"),zo=require("string_decoder").StringDecoder,ke=Symbol("EOF"),_e=Symbol("maybeEmitEnd"),ze=Symbol("emittedEnd"),qr=Symbol("emittingEnd"),lr=Symbol("emittedError"),$r=Symbol("closed"),Go=Symbol("read"),Wr=Symbol("flush"),Ho=Symbol("flushChunk"),J=Symbol("encoding"),Re=Symbol("decoder"),zr=Symbol("flowing"),hr=Symbol("paused"),Tt=Symbol("resume"),N=Symbol("buffer"),De=Symbol("pipes"),M=Symbol("bufferLength"),gi=Symbol("bufferPush"),Ei=Symbol("bufferShift"),U=Symbol("objectMode"),q=Symbol("destroyed"),yi=Symbol("emitData"),Jo=Symbol("emitEnd"),Ai=Symbol("emitEnd2"),ve=Symbol("async"),fr=r=>Promise.resolve().then(r),Vo=global._MP_NO_ITERATOR_SYMBOLS_!=="1",eh=Vo&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),th=Vo&&Symbol.iterator||Symbol("iterator not implemented"),rh=r=>r==="end"||r==="finish"||r==="prefinish",sh=r=>r instanceof ArrayBuffer||typeof r=="object"&&r.constructor&&r.constructor.name==="ArrayBuffer"&&r.byteLength>=0,ih=r=>!Buffer.isBuffer(r)&&ArrayBuffer.isView(r),Gr=class{constructor(e,t,s){this.src=e,this.dest=t,this.opts=s,this.ondrain=()=>e[Tt](),t.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},Ci=class extends Gr{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)}};Ko.exports=class Yo extends Wo{constructor(e){super(),this[zr]=!1,this[hr]=!1,this[De]=[],this[N]=[],this[U]=e&&e.objectMode||!1,this[U]?this[J]=null:this[J]=e&&e.encoding||null,this[J]==="buffer"&&(this[J]=null),this[ve]=e&&!!e.async||!1,this[Re]=this[J]?new zo(this[J]):null,this[ke]=!1,this[ze]=!1,this[qr]=!1,this[$r]=!1,this[lr]=null,this.writable=!0,this.readable=!0,this[M]=0,this[q]=!1,e&&e.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[N]}),e&&e.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[De]})}get bufferLength(){return this[M]}get encoding(){return this[J]}set encoding(e){if(this[U])throw new Error("cannot set encoding in objectMode");if(this[J]&&e!==this[J]&&(this[Re]&&this[Re].lastNeed||this[M]))throw new Error("cannot change encoding");this[J]!==e&&(this[Re]=e?new zo(e):null,this[N].length&&(this[N]=this[N].map(t=>this[Re].write(t)))),this[J]=e}setEncoding(e){this.encoding=e}get objectMode(){return this[U]}set objectMode(e){this[U]=this[U]||!!e}get async(){return this[ve]}set async(e){this[ve]=this[ve]||!!e}write(e,t,s){if(this[ke])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[ve]?fr:n=>n();return!this[U]&&!Buffer.isBuffer(e)&&(ih(e)?e=Buffer.from(e.buffer,e.byteOffset,e.byteLength):sh(e)?e=Buffer.from(e):typeof e!="string"&&(this.objectMode=!0)),this[U]?(this.flowing&&this[M]!==0&&this[Wr](!0),this.flowing?this.emit("data",e):this[gi](e),this[M]!==0&&this.emit("readable"),s&&i(s),this.flowing):e.length?(typeof e=="string"&&!(t===this[J]&&!this[Re].lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[J]&&(e=this[Re].write(e)),this.flowing&&this[M]!==0&&this[Wr](!0),this.flowing?this.emit("data",e):this[gi](e),this[M]!==0&&this.emit("readable"),s&&i(s),this.flowing):(this[M]!==0&&this.emit("readable"),s&&i(s),this.flowing)}read(e){if(this[q])return null;if(this[M]===0||e===0||e>this[M])return this[_e](),null;this[U]&&(e=null),this[N].length>1&&!this[U]&&(this.encoding?this[N]=[this[N].join("")]:this[N]=[Buffer.concat(this[N],this[M])]);let t=this[Go](e||null,this[N][0]);return this[_e](),t}[Go](e,t){return e===t.length||e===null?this[Ei]():(this[N][0]=t.slice(e),t=t.slice(0,e),this[M]-=e),this.emit("data",t),!this[N].length&&!this[ke]&&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[ke]=!0,this.writable=!1,(this.flowing||!this[hr])&&this[_e](),this}[Tt](){this[q]||(this[hr]=!1,this[zr]=!0,this.emit("resume"),this[N].length?this[Wr]():this[ke]?this[_e]():this.emit("drain"))}resume(){return this[Tt]()}pause(){this[zr]=!1,this[hr]=!0}get destroyed(){return this[q]}get flowing(){return this[zr]}get paused(){return this[hr]}[gi](e){this[U]?this[M]+=1:this[M]+=e.length,this[N].push(e)}[Ei](){return this[N].length&&(this[U]?this[M]-=1:this[M]-=this[N][0].length),this[N].shift()}[Wr](e){do;while(this[Ho](this[Ei]()));!e&&!this[N].length&&!this[ke]&&this.emit("drain")}[Ho](e){return e?(this.emit("data",e),this.flowing):!1}pipe(e,t){if(this[q])return;let s=this[ze];return t=t||{},e===$o.stdout||e===$o.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,s?t.end&&e.end():(this[De].push(t.proxyErrors?new Ci(this,e,t):new Gr(this,e,t)),this[ve]?fr(()=>this[Tt]()):this[Tt]()),e}unpipe(e){let t=this[De].find(s=>s.dest===e);t&&(this[De].splice(this[De].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[De].length&&!this.flowing?this[Tt]():e==="readable"&&this[M]!==0?super.emit("readable"):rh(e)&&this[ze]?(super.emit(e),this.removeAllListeners(e)):e==="error"&&this[lr]&&(this[ve]?fr(()=>t.call(this,this[lr])):t.call(this,this[lr])),s}get emittedEnd(){return this[ze]}[_e](){!this[qr]&&!this[ze]&&!this[q]&&this[N].length===0&&this[ke]&&(this[qr]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[$r]&&this.emit("close"),this[qr]=!1)}emit(e,t,...s){if(e!=="error"&&e!=="close"&&e!==q&&this[q])return;if(e==="data")return t?this[ve]?fr(()=>this[yi](t)):this[yi](t):!1;if(e==="end")return this[Jo]();if(e==="close"){if(this[$r]=!0,!this[ze]&&!this[q])return;let n=super.emit("close");return this.removeAllListeners("close"),n}else if(e==="error"){this[lr]=t;let n=super.emit("error",t);return this[_e](),n}else if(e==="resume"){let n=super.emit("resume");return this[_e](),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[_e](),i}[yi](e){for(let s of this[De])s.dest.write(e)===!1&&this.pause();let t=super.emit("data",e);return this[_e](),t}[Jo](){this[ze]||(this[ze]=!0,this.readable=!1,this[ve]?fr(()=>this[Ai]()):this[Ai]())}[Ai](){if(this[Re]){let t=this[Re].end();if(t){for(let s of this[De])s.dest.write(t);super.emit("data",t)}}for(let t of this[De])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[J]?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())})}[eh](){return{next:()=>{let t=this.read();if(t!==null)return Promise.resolve({done:!1,value:t});if(this[ke])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[ke]})},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)})}}}[th](){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[N].length=0,this[M]=0,typeof this.close=="function"&&!this[$r]&&this.close(),e?this.emit("error",e):this.emit(q),this)}static isStream(e){return!!e&&(e instanceof Yo||e instanceof Wo||e instanceof Ql&&(typeof e.pipe=="function"||typeof e.write=="function"&&typeof e.end=="function"))}}});var Xo=E((Td,Zo)=>{u();var nh=require("zlib").constants||{ZLIB_VERNUM:4736};Zo.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},nh))});var _i=E((Nd,uu)=>{"use strict";u();var Qo=typeof process=="object"&&process?process:{stdout:null,stderr:null},oh=require("events"),eu=require("stream"),tu=require("string_decoder").StringDecoder,Be=Symbol("EOF"),xe=Symbol("maybeEmitEnd"),Ge=Symbol("emittedEnd"),Jr=Symbol("emittingEnd"),pr=Symbol("emittedError"),Vr=Symbol("closed"),ru=Symbol("read"),Yr=Symbol("flush"),su=Symbol("flushChunk"),V=Symbol("encoding"),Oe=Symbol("decoder"),Kr=Symbol("flowing"),mr=Symbol("paused"),Nt=Symbol("resume"),j=Symbol("bufferLength"),wi=Symbol("bufferPush"),Fi=Symbol("bufferShift"),$=Symbol("objectMode"),W=Symbol("destroyed"),bi=Symbol("emitData"),iu=Symbol("emitEnd"),Si=Symbol("emitEnd2"),Pe=Symbol("async"),dr=r=>Promise.resolve().then(r),nu=global._MP_NO_ITERATOR_SYMBOLS_!=="1",uh=nu&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),ah=nu&&Symbol.iterator||Symbol("iterator not implemented"),ch=r=>r==="end"||r==="finish"||r==="prefinish",lh=r=>r instanceof ArrayBuffer||typeof r=="object"&&r.constructor&&r.constructor.name==="ArrayBuffer"&&r.byteLength>=0,hh=r=>!Buffer.isBuffer(r)&&ArrayBuffer.isView(r),Zr=class{constructor(e,t,s){this.src=e,this.dest=t,this.opts=s,this.ondrain=()=>e[Nt](),t.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},ki=class extends Zr{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)}};uu.exports=class ou extends eu{constructor(e){super(),this[Kr]=!1,this[mr]=!1,this.pipes=[],this.buffer=[],this[$]=e&&e.objectMode||!1,this[$]?this[V]=null:this[V]=e&&e.encoding||null,this[V]==="buffer"&&(this[V]=null),this[Pe]=e&&!!e.async||!1,this[Oe]=this[V]?new tu(this[V]):null,this[Be]=!1,this[Ge]=!1,this[Jr]=!1,this[Vr]=!1,this[pr]=null,this.writable=!0,this.readable=!0,this[j]=0,this[W]=!1}get bufferLength(){return this[j]}get encoding(){return this[V]}set encoding(e){if(this[$])throw new Error("cannot set encoding in objectMode");if(this[V]&&e!==this[V]&&(this[Oe]&&this[Oe].lastNeed||this[j]))throw new Error("cannot change encoding");this[V]!==e&&(this[Oe]=e?new tu(e):null,this.buffer.length&&(this.buffer=this.buffer.map(t=>this[Oe].write(t)))),this[V]=e}setEncoding(e){this.encoding=e}get objectMode(){return this[$]}set objectMode(e){this[$]=this[$]||!!e}get async(){return this[Pe]}set async(e){this[Pe]=this[Pe]||!!e}write(e,t,s){if(this[Be])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[Pe]?dr:n=>n();return!this[$]&&!Buffer.isBuffer(e)&&(hh(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[Yr](!0),this.flowing?this.emit("data",e):this[wi](e),this[j]!==0&&this.emit("readable"),s&&i(s),this.flowing):e.length?(typeof e=="string"&&!(t===this[V]&&!this[Oe].lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[V]&&(e=this[Oe].write(e)),this.flowing&&this[j]!==0&&this[Yr](!0),this.flowing?this.emit("data",e):this[wi](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[xe](),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[ru](e||null,this.buffer[0]);return this[xe](),t}[ru](e,t){return e===t.length||e===null?this[Fi]():(this.buffer[0]=t.slice(e),t=t.slice(0,e),this[j]-=e),this.emit("data",t),!this.buffer.length&&!this[Be]&&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[Be]=!0,this.writable=!1,(this.flowing||!this[mr])&&this[xe](),this}[Nt](){this[W]||(this[mr]=!1,this[Kr]=!0,this.emit("resume"),this.buffer.length?this[Yr]():this[Be]?this[xe]():this.emit("drain"))}resume(){return this[Nt]()}pause(){this[Kr]=!1,this[mr]=!0}get destroyed(){return this[W]}get flowing(){return this[Kr]}get paused(){return this[mr]}[wi](e){this[$]?this[j]+=1:this[j]+=e.length,this.buffer.push(e)}[Fi](){return this.buffer.length&&(this[$]?this[j]-=1:this[j]-=this.buffer[0].length),this.buffer.shift()}[Yr](e){do;while(this[su](this[Fi]()));!e&&!this.buffer.length&&!this[Be]&&this.emit("drain")}[su](e){return e?(this.emit("data",e),this.flowing):!1}pipe(e,t){if(this[W])return;let s=this[Ge];return t=t||{},e===Qo.stdout||e===Qo.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,s?t.end&&e.end():(this.pipes.push(t.proxyErrors?new ki(this,e,t):new Zr(this,e,t)),this[Pe]?dr(()=>this[Nt]()):this[Nt]()),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[Nt]():e==="readable"&&this[j]!==0?super.emit("readable"):ch(e)&&this[Ge]?(super.emit(e),this.removeAllListeners(e)):e==="error"&&this[pr]&&(this[Pe]?dr(()=>t.call(this,this[pr])):t.call(this,this[pr])),s}get emittedEnd(){return this[Ge]}[xe](){!this[Jr]&&!this[Ge]&&!this[W]&&this.buffer.length===0&&this[Be]&&(this[Jr]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Vr]&&this.emit("close"),this[Jr]=!1)}emit(e,t,...s){if(e!=="error"&&e!=="close"&&e!==W&&this[W])return;if(e==="data")return t?this[Pe]?dr(()=>this[bi](t)):this[bi](t):!1;if(e==="end")return this[iu]();if(e==="close"){if(this[Vr]=!0,!this[Ge]&&!this[W])return;let n=super.emit("close");return this.removeAllListeners("close"),n}else if(e==="error"){this[pr]=t;let n=super.emit("error",t);return this[xe](),n}else if(e==="resume"){let n=super.emit("resume");return this[xe](),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[xe](),i}[bi](e){for(let s of this.pipes)s.dest.write(e)===!1&&this.pause();let t=super.emit("data",e);return this[xe](),t}[iu](){this[Ge]||(this[Ge]=!0,this.readable=!1,this[Pe]?dr(()=>this[Si]()):this[Si]())}[Si](){if(this[Oe]){let t=this[Oe].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[V]?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())})}[uh](){return{next:()=>{let t=this.read();if(t!==null)return Promise.resolve({done:!1,value:t});if(this[Be])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[Be]})},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)})}}}[ah](){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[Vr]&&this.close(),e?this.emit("error",e):this.emit(W),this)}static isStream(e){return!!e&&(e instanceof ou||e instanceof eu||e instanceof oh&&(typeof e.pipe=="function"||typeof e.write=="function"&&typeof e.end=="function"))}}});var Wi=E(Z=>{"use strict";u();var Oi=require("assert"),He=require("buffer").Buffer,lu=require("zlib"),ht=Z.constants=Xo(),fh=_i(),au=He.concat,ft=Symbol("_superWrite"),It=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"}},ph=Symbol("opts"),Dr=Symbol("flushFlag"),cu=Symbol("finishFlushFlag"),$i=Symbol("fullFlushFlag"),B=Symbol("handle"),Xr=Symbol("onError"),Lt=Symbol("sawError"),Ri=Symbol("level"),vi=Symbol("strategy"),Bi=Symbol("ended"),Ld=Symbol("_defaultFullFlush"),Qr=class extends fh{constructor(e,t){if(!e||typeof e!="object")throw new TypeError("invalid options for ZlibBase constructor");super(e),this[Lt]=!1,this[Bi]=!1,this[ph]=e,this[Dr]=e.flush,this[cu]=e.finishFlush;try{this[B]=new lu[t](e)}catch(s){throw new It(s)}this[Xr]=s=>{this[Lt]||(this[Lt]=!0,this.close(),this.emit("error",s))},this[B].on("error",s=>this[Xr](new It(s))),this.once("end",()=>this.close)}close(){this[B]&&(this[B].close(),this[B]=null,this.emit("close"))}reset(){if(!this[Lt])return Oi(this[B],"zlib binding closed"),this[B].reset()}flush(e){this.ended||(typeof e!="number"&&(e=this[$i]),this.write(Object.assign(He.alloc(0),{[Dr]:e})))}end(e,t,s){return e&&this.write(e,t),this.flush(this[cu]),this[Bi]=!0,super.end(null,null,s)}get ended(){return this[Bi]}write(e,t,s){if(typeof t=="function"&&(s=t,t="utf8"),typeof e=="string"&&(e=He.from(e,t)),this[Lt])return;Oi(this[B],"zlib binding closed");let i=this[B]._handle,n=i.close;i.close=()=>{};let o=this[B].close;this[B].close=()=>{},He.concat=c=>c;let a;try{let c=typeof e[Dr]=="number"?e[Dr]:this[Dr];a=this[B]._processChunk(e,c),He.concat=au}catch(c){He.concat=au,this[Xr](new It(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[Xr](new It(c)));let l;if(a)if(Array.isArray(a)&&a.length>0){l=this[ft](He.from(a[0]));for(let c=1;c<a.length;c++)l=this[ft](a[c])}else l=this[ft](He.from(a));return s&&s(),l}[ft](e){return super.write(e)}},Te=class extends Qr{constructor(e,t){e=e||{},e.flush=e.flush||ht.Z_NO_FLUSH,e.finishFlush=e.finishFlush||ht.Z_FINISH,super(e,t),this[$i]=ht.Z_FULL_FLUSH,this[Ri]=e.level,this[vi]=e.strategy}params(e,t){if(!this[Lt]){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[Ri]!==e||this[vi]!==t){this.flush(ht.Z_SYNC_FLUSH),Oi(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[Ri]=e,this[vi]=t)}}}},Pi=class extends Te{constructor(e){super(e,"Deflate")}},Ti=class extends Te{constructor(e){super(e,"Inflate")}},xi=Symbol("_portable"),Ni=class extends Te{constructor(e){super(e,"Gzip"),this[xi]=e&&!!e.portable}[ft](e){return this[xi]?(this[xi]=!1,e[9]=255,super[ft](e)):super[ft](e)}},Li=class extends Te{constructor(e){super(e,"Gunzip")}},Ii=class extends Te{constructor(e){super(e,"DeflateRaw")}},Mi=class extends Te{constructor(e){super(e,"InflateRaw")}},ji=class extends Te{constructor(e){super(e,"Unzip")}},es=class extends Qr{constructor(e,t){e=e||{},e.flush=e.flush||ht.BROTLI_OPERATION_PROCESS,e.finishFlush=e.finishFlush||ht.BROTLI_OPERATION_FINISH,super(e,t),this[$i]=ht.BROTLI_OPERATION_FLUSH}},Ui=class extends es{constructor(e){super(e,"BrotliCompress")}},qi=class extends es{constructor(e){super(e,"BrotliDecompress")}};Z.Deflate=Pi;Z.Inflate=Ti;Z.Gzip=Ni;Z.Gunzip=Li;Z.DeflateRaw=Ii;Z.InflateRaw=Mi;Z.Unzip=ji;typeof lu.BrotliCompress=="function"?(Z.BrotliCompress=Ui,Z.BrotliDecompress=qi):Z.BrotliCompress=Z.BrotliDecompress=class{constructor(){throw new Error("Brotli is not supported in this version of Node.js")}}});var Mt=E((jd,hu)=>{u();var mh=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform;hu.exports=mh!=="win32"?r=>r:r=>r&&r.replace(/\\/g,"/")});var ts=E((qd,fu)=>{"use strict";u();var dh=Hr(),zi=Mt(),Gi=Symbol("slurp");fu.exports=class extends dh{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=zi(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=zi(e.linkpath),this.uname=e.uname,this.gname=e.gname,t&&this[Gi](t),s&&this[Gi](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))}[Gi](e,t){for(let s in e)e[s]!==null&&e[s]!==void 0&&!(t&&s==="path")&&(this[s]=s==="path"||s==="linkpath"?zi(e[s]):e[s])}}});var Hi=E(rs=>{"use strict";u();rs.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"]]);rs.code=new Map(Array.from(rs.name).map(r=>[r[1],r[0]]))});var Du=E((Wd,du)=>{"use strict";u();var Dh=(r,e)=>{if(Number.isSafeInteger(r))r<0?Eh(r,e):gh(r,e);else throw Error("cannot encode number outside of javascript safe integer range");return e},gh=(r,e)=>{e[0]=128;for(var t=e.length;t>1;t--)e[t-1]=r&255,r=Math.floor(r/256)},Eh=(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]=pu(i):i===0?e[s-1]=0:(t=!0,e[s-1]=mu(i))}},yh=r=>{let e=r[0],t=e===128?Ch(r.slice(1,r.length)):e===255?Ah(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},Ah=r=>{for(var e=r.length,t=0,s=!1,i=e-1;i>-1;i--){var n=r[i],o;s?o=pu(n):n===0?o=n:(s=!0,o=mu(n)),o!==0&&(t-=o*Math.pow(256,e-i-1))}return t},Ch=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},pu=r=>(255^r)&255,mu=r=>(255^r)+1&255;du.exports={encode:Dh,parse:yh}});var Ut=E((zd,Eu)=>{"use strict";u();var Ji=Hi(),jt=require("path").posix,gu=Du(),Vi=Symbol("slurp"),X=Symbol("type"),Zi=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[X]="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=pt(e,t,100),this.mode=Je(e,t+100,8),this.uid=Je(e,t+108,8),this.gid=Je(e,t+116,8),this.size=Je(e,t+124,12),this.mtime=Yi(e,t+136,12),this.cksum=Je(e,t+148,12),this[Vi](s),this[Vi](i,!0),this[X]=pt(e,t+156,1),this[X]===""&&(this[X]="0"),this[X]==="0"&&this.path.slice(-1)==="/"&&(this[X]="5"),this[X]==="5"&&(this.size=0),this.linkpath=pt(e,t+157,100),e.slice(t+257,t+265).toString()==="ustar\x0000")if(this.uname=pt(e,t+265,32),this.gname=pt(e,t+297,32),this.devmaj=Je(e,t+329,8),this.devmin=Je(e,t+337,8),e[t+475]!==0){let o=pt(e,t+345,155);this.path=o+"/"+this.path}else{let o=pt(e,t+345,130);o&&(this.path=o+"/"+this.path),this.atime=Yi(e,t+476,12),this.ctime=Yi(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)}[Vi](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=wh(this.path||"",s),n=i[0],o=i[1];this.needPax=i[2],this.needPax=mt(e,t,100,n)||this.needPax,this.needPax=Ve(e,t+100,8,this.mode)||this.needPax,this.needPax=Ve(e,t+108,8,this.uid)||this.needPax,this.needPax=Ve(e,t+116,8,this.gid)||this.needPax,this.needPax=Ve(e,t+124,12,this.size)||this.needPax,this.needPax=Ki(e,t+136,12,this.mtime)||this.needPax,e[t+156]=this[X].charCodeAt(0),this.needPax=mt(e,t+157,100,this.linkpath)||this.needPax,e.write("ustar\x0000",t+257,8),this.needPax=mt(e,t+265,32,this.uname)||this.needPax,this.needPax=mt(e,t+297,32,this.gname)||this.needPax,this.needPax=Ve(e,t+329,8,this.devmaj)||this.needPax,this.needPax=Ve(e,t+337,8,this.devmin)||this.needPax,this.needPax=mt(e,t+345,s,o)||this.needPax,e[t+475]!==0?this.needPax=mt(e,t+345,155,o)||this.needPax:(this.needPax=mt(e,t+345,130,o)||this.needPax,this.needPax=Ki(e,t+476,12,this.atime)||this.needPax,this.needPax=Ki(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,Ve(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 Ji.name.get(this[X])||this[X]}get typeKey(){return this[X]}set type(e){Ji.code.has(e)?this[X]=Ji.code.get(e):this[X]=e}},wh=(r,e)=>{let s=r,i="",n,o=jt.parse(r).root||".";if(Buffer.byteLength(s)<100)n=[s,i,!1];else{i=jt.dirname(s),s=jt.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=jt.join(jt.basename(i),s),i=jt.dirname(i));while(i!==o&&!n);n||(n=[r.slice(0,100-1),"",!0])}return n},pt=(r,e,t)=>r.slice(e,e+t).toString("utf8").replace(/\0.*/,""),Yi=(r,e,t)=>Fh(Je(r,e,t)),Fh=r=>r===null?null:new Date(r*1e3),Je=(r,e,t)=>r[e]&128?gu.parse(r.slice(e,e+t)):Sh(r,e,t),bh=r=>isNaN(r)?null:r,Sh=(r,e,t)=>bh(parseInt(r.slice(e,e+t).toString("utf8").replace(/\0.*$/,"").trim(),8)),kh={12:8589934591,8:2097151},Ve=(r,e,t,s)=>s===null?!1:s>kh[t]||s<0?(gu.encode(s,r.slice(e,e+t)),!0):(_h(r,e,t,s),!1),_h=(r,e,t,s)=>r.write(Rh(s,t),e,t,"ascii"),Rh=(r,e)=>vh(Math.floor(r).toString(8),e),vh=(r,e)=>(r.length===e-1?r:new Array(e-r.length-1).join("0")+r+" ")+"\0",Ki=(r,e,t,s)=>s===null?!1:Ve(r,e,t,s.getTime()/1e3),Bh=new Array(156).join("\0"),mt=(r,e,t,s)=>s===null?!1:(r.write(s+Bh,e,t,"utf8"),s.length!==Buffer.byteLength(s)||s.length>t);Eu.exports=Zi});var ss=E((Gd,yu)=>{"use strict";u();var xh=Ut(),Oh=require("path"),gr=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 xh({path:("PaxHeader/"+Oh.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+`
|
|
2
|
-
`,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}};gr.parse=(r,e,t)=>new gr(
|
|
3
|
-
`).reduce(Nh,Object.create(null)),Nh=(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};yu.exports=gr});var qt=E((Hd,Au)=>{u();Au.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 is=E((Jd,Cu)=>{"use strict";u();Cu.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 Qi=E((Yd,wu)=>{"use strict";u();var ns=["|","<",">","?",":"],Xi=ns.map(r=>String.fromCharCode(61440+r.charCodeAt(0))),Lh=new Map(ns.map((r,e)=>[r,Xi[e]])),Ih=new Map(Xi.map((r,e)=>[r,ns[e]]));wu.exports={encode:r=>ns.reduce((e,t)=>e.split(t).join(Lh.get(t)),r),decode:r=>Xi.reduce((e,t)=>e.split(t).join(Ih.get(t)),r)}});var en=E((Kd,bu)=>{u();var{isAbsolute:Mh,parse:Fu}=require("path").win32;bu.exports=r=>{let e="",t=Fu(r);for(;Mh(r)||t.root;){let s=r.charAt(0)==="/"&&r.slice(0,4)!=="//?/"?"/":t.root;r=r.slice(s.length),e+=s,t=Fu(r)}return[e,r]}});var ku=E((Zd,Su)=>{"use strict";u();Su.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 hn=E((e0,Uu)=>{"use strict";u();var Pu=Hr(),Tu=ss(),Nu=Ut(),Ee=require("fs"),_u=require("path"),ge=Mt(),jh=qt(),Lu=(r,e)=>e?(r=ge(r).replace(/^\.(\/|$)/,""),jh(e)+"/"+r):ge(r),Uh=16*1024*1024,Ru=Symbol("process"),vu=Symbol("file"),Bu=Symbol("directory"),rn=Symbol("symlink"),xu=Symbol("hardlink"),Er=Symbol("header"),os=Symbol("read"),sn=Symbol("lstat"),us=Symbol("onlstat"),nn=Symbol("onread"),on=Symbol("onreadlink"),un=Symbol("openfile"),an=Symbol("onopenfile"),Ye=Symbol("close"),as=Symbol("mode"),cn=Symbol("awaitDrain"),tn=Symbol("ondrain"),ye=Symbol("prefix"),Ou=Symbol("hadError"),Iu=is(),qh=Qi(),Mu=en(),ju=ku(),cs=Iu(class extends Pu{constructor(e,t){if(t=t||{},super(t),typeof e!="string")throw new TypeError("path is required");this.path=ge(e),this.portable=!!t.portable,this.myuid=process.getuid&&process.getuid()||0,this.myuser=process.env.USER||"",this.maxReadSize=t.maxReadSize||Uh,this.linkCache=t.linkCache||new Map,this.statCache=t.statCache||new Map,this.preservePaths=!!t.preservePaths,this.cwd=ge(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?ge(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]=Mu(this.path);i&&(this.path=n,s=i)}this.win32=!!t.win32||process.platform==="win32",this.win32&&(this.path=qh.decode(this.path.replace(/\\/g,"/")),e=e.replace(/\\/g,"/")),this.absolute=ge(t.absolute||_u.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[us](this.statCache.get(this.absolute)):this[sn]()}emit(e,...t){return e==="error"&&(this[Ou]=!0),super.emit(e,...t)}[sn](){Ee.lstat(this.absolute,(e,t)=>{if(e)return this.emit("error",e);this[us](t)})}[us](e){this.statCache.set(this.absolute,e),this.stat=e,e.isFile()||(e.size=0),this.type=Wh(e),this.emit("stat",e),this[Ru]()}[Ru](){switch(this.type){case"File":return this[vu]();case"Directory":return this[Bu]();case"SymbolicLink":return this[rn]();default:return this.end()}}[as](e){return ju(e,this.type==="Directory",this.portable)}[ye](e){return Lu(e,this.prefix)}[Er](){this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.header=new Nu({path:this[ye](this.path),linkpath:this.type==="Link"?this[ye](this.linkpath):this.linkpath,mode:this[as](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 Tu({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[ye](this.path),linkpath:this.type==="Link"?this[ye](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)}[Bu](){this.path.slice(-1)!=="/"&&(this.path+="/"),this.stat.size=0,this[Er](),this.end()}[rn](){Ee.readlink(this.absolute,(e,t)=>{if(e)return this.emit("error",e);this[on](t)})}[on](e){this.linkpath=ge(e),this[Er](),this.end()}[xu](e){this.type="Link",this.linkpath=ge(_u.relative(this.cwd,e)),this.stat.size=0,this[Er](),this.end()}[vu](){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[xu](t)}this.linkCache.set(e,this.absolute)}if(this[Er](),this.stat.size===0)return this.end();this[un]()}[un](){Ee.open(this.absolute,"r",(e,t)=>{if(e)return this.emit("error",e);this[an](t)})}[an](e){if(this.fd=e,this[Ou])return this[Ye]();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[os]()}[os](){let{fd:e,buf:t,offset:s,length:i,pos:n}=this;Ee.read(e,t,s,i,n,(o,a)=>{if(o)return this[Ye](()=>this.emit("error",o));this[nn](a)})}[Ye](e){Ee.close(this.fd,e)}[nn](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[Ye](()=>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[Ye](()=>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[tn]():this[cn](()=>this[tn]())}[cn](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)}[tn](){if(!this.remain)return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),this[Ye](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[os]()}}),ln=class extends cs{[sn](){this[us](Ee.lstatSync(this.absolute))}[rn](){this[on](Ee.readlinkSync(this.absolute))}[un](){this[an](Ee.openSync(this.absolute,"r"))}[os](){let e=!0;try{let{fd:t,buf:s,offset:i,length:n,pos:o}=this,a=Ee.readSync(t,s,i,n,o);this[nn](a),e=!1}finally{if(e)try{this[Ye](()=>{})}catch{}}}[cn](e){e()}[Ye](e){Ee.closeSync(this.fd),e()}},$h=Iu(class extends Pu{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=ge(e.path),this.mode=this[as](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=ge(e.linkpath),typeof t.onwarn=="function"&&this.on("warn",t.onwarn);let s=!1;if(!this.preservePaths){let[i,n]=Mu(this.path);i&&(this.path=n,s=i)}this.remain=e.size,this.blockRemain=e.startBlockSize,this.header=new Nu({path:this[ye](this.path),linkpath:this.type==="Link"?this[ye](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 Tu({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[ye](this.path),linkpath:this.type==="Link"?this[ye](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)}[ye](e){return Lu(e,this.prefix)}[as](e){return ju(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()}});cs.Sync=ln;cs.Tar=$h;var Wh=r=>r.isFile()?"File":r.isDirectory()?"Directory":r.isSymbolicLink()?"SymbolicLink":"Unsupported";Uu.exports=cs});var $u=E((t0,qu)=>{"use strict";u();qu.exports=function(r){r.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}});var fn=E((r0,Wu)=>{"use strict";u();Wu.exports=k;k.Node=dt;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++)Gh(this,arguments[r]);return this.length};k.prototype.unshift=function(){for(var r=0,e=arguments.length;r<e;r++)Hh(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=zh(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 zh(r,e,t){var s=e===r.head?new dt(t,null,e,r):new dt(t,e,e.next,r);return s.next===null&&(r.tail=s),s.prev===null&&(r.head=s),r.length++,s}function Gh(r,e){r.tail=new dt(e,r.tail,null,r),r.head||(r.head=r.tail),r.length++}function Hh(r,e){r.head=new dt(e,null,r.head,r),r.tail||(r.tail=r.head),r.length++}function dt(r,e,t,s){if(!(this instanceof dt))return new dt(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{$u()(k)}catch{}});var Es=E((i0,Ku)=>{"use strict";u();var Ds=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}},Jh=Hr(),Vh=Wi(),Yh=ts(),Cn=hn(),Kh=Cn.Sync,Zh=Cn.Tar,Xh=fn(),zu=Buffer.alloc(1024),fs=Symbol("onStat"),ls=Symbol("ended"),Ae=Symbol("queue"),$t=Symbol("current"),Dt=Symbol("process"),hs=Symbol("processing"),Gu=Symbol("processJob"),Ce=Symbol("jobs"),pn=Symbol("jobDone"),ps=Symbol("addFSEntry"),Hu=Symbol("addTarEntry"),gn=Symbol("stat"),En=Symbol("readdir"),ms=Symbol("onreaddir"),ds=Symbol("pipe"),Ju=Symbol("entry"),mn=Symbol("entryOpt"),yn=Symbol("writeEntryClass"),Yu=Symbol("write"),dn=Symbol("ondrain"),gs=require("fs"),Vu=require("path"),Qh=is(),Dn=Mt(),wn=Qh(class extends Jh{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=Dn(e.prefix||""),this.linkCache=e.linkCache||new Map,this.statCache=e.statCache||new Map,this.readdirCache=e.readdirCache||new Map,this[yn]=Cn,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 Vh.Gzip(e.gzip),this.zip.on("data",t=>super.write(t)),this.zip.on("end",t=>super.end()),this.zip.on("drain",t=>this[dn]()),this.on("resume",t=>this.zip.resume())):this.on("drain",this[dn]),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[Ae]=new Xh,this[Ce]=0,this.jobs=+e.jobs||4,this[hs]=!1,this[ls]=!1}[Yu](e){return super.write(e)}add(e){return this.write(e),this}end(e){return e&&this.write(e),this[ls]=!0,this[Dt](),this}write(e){if(this[ls])throw new Error("write after end");return e instanceof Yh?this[Hu](e):this[ps](e),this.flowing}[Hu](e){let t=Dn(Vu.resolve(this.cwd,e.path));if(!this.filter(e.path,e))e.resume();else{let s=new Ds(e.path,t,!1);s.entry=new Zh(e,this[mn](s)),s.entry.on("end",i=>this[pn](s)),this[Ce]+=1,this[Ae].push(s)}this[Dt]()}[ps](e){let t=Dn(Vu.resolve(this.cwd,e));this[Ae].push(new Ds(e,t)),this[Dt]()}[gn](e){e.pending=!0,this[Ce]+=1;let t=this.follow?"stat":"lstat";gs[t](e.absolute,(s,i)=>{e.pending=!1,this[Ce]-=1,s?this.emit("error",s):this[fs](e,i)})}[fs](e,t){this.statCache.set(e.absolute,t),e.stat=t,this.filter(e.path,t)||(e.ignore=!0),this[Dt]()}[En](e){e.pending=!0,this[Ce]+=1,gs.readdir(e.absolute,(t,s)=>{if(e.pending=!1,this[Ce]-=1,t)return this.emit("error",t);this[ms](e,s)})}[ms](e,t){this.readdirCache.set(e.absolute,t),e.readdir=t,this[Dt]()}[Dt](){if(!this[hs]){this[hs]=!0;for(let e=this[Ae].head;e!==null&&this[Ce]<this.jobs;e=e.next)if(this[Gu](e.value),e.value.ignore){let t=e.next;this[Ae].removeNode(e),e.next=t}this[hs]=!1,this[ls]&&!this[Ae].length&&this[Ce]===0&&(this.zip?this.zip.end(zu):(super.write(zu),super.end()))}}get[$t](){return this[Ae]&&this[Ae].head&&this[Ae].head.value}[pn](e){this[Ae].shift(),this[Ce]-=1,this[Dt]()}[Gu](e){if(!e.pending){if(e.entry){e===this[$t]&&!e.piped&&this[ds](e);return}if(e.stat||(this.statCache.has(e.absolute)?this[fs](e,this.statCache.get(e.absolute)):this[gn](e)),!!e.stat&&!e.ignore&&!(!this.noDirRecurse&&e.stat.isDirectory()&&!e.readdir&&(this.readdirCache.has(e.absolute)?this[ms](e,this.readdirCache.get(e.absolute)):this[En](e),!e.readdir))){if(e.entry=this[Ju](e),!e.entry){e.ignore=!0;return}e===this[$t]&&!e.piped&&this[ds](e)}}}[mn](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}}[Ju](e){this[Ce]+=1;try{return new this[yn](e.path,this[mn](e)).on("end",()=>this[pn](e)).on("error",t=>this.emit("error",t))}catch(t){this.emit("error",t)}}[dn](){this[$t]&&this[$t].entry&&this[$t].entry.resume()}[ds](e){e.piped=!0,e.readdir&&e.readdir.forEach(i=>{let n=e.path,o=n==="./"?"":n.replace(/\/*$/,"/");this[ps](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()}}),An=class extends wn{constructor(e){super(e),this[yn]=Kh}pause(){}resume(){}[gn](e){let t=this.follow?"statSync":"lstatSync";this[fs](e,gs[t](e.absolute))}[En](e,t){this[ms](e,gs.readdirSync(e.absolute))}[ds](e){let t=e.entry,s=this.zip;e.readdir&&e.readdir.forEach(i=>{let n=e.path,o=n==="./"?"":n.replace(/\/*$/,"/");this[ps](o+i)}),s?t.on("data",i=>{s.write(i)}):t.on("data",i=>{super[Yu](i)})}};wn.Sync=An;Ku.exports=wn});var Kt=E(Ar=>{"use strict";u();var ef=_i(),tf=require("events").EventEmitter,Y=require("fs"),Sn=Y.writev;if(!Sn){let r=process.binding("fs"),e=r.FSReqWrap||r.FSReqCallback;Sn=(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 Vt=Symbol("_autoClose"),fe=Symbol("_close"),yr=Symbol("_ended"),v=Symbol("_fd"),Zu=Symbol("_finished"),Ze=Symbol("_flags"),Fn=Symbol("_flush"),kn=Symbol("_handleChunk"),_n=Symbol("_makeBuf"),Fs=Symbol("_mode"),ys=Symbol("_needDrain"),Ht=Symbol("_onerror"),Yt=Symbol("_onopen"),bn=Symbol("_onread"),zt=Symbol("_onwrite"),Xe=Symbol("_open"),Ne=Symbol("_path"),gt=Symbol("_pos"),we=Symbol("_queue"),Gt=Symbol("_read"),Xu=Symbol("_readSize"),Ke=Symbol("_reading"),As=Symbol("_remain"),Qu=Symbol("_size"),Cs=Symbol("_write"),Wt=Symbol("_writing"),ws=Symbol("_defaultFlag"),Jt=Symbol("_errored"),bs=class extends ef{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[Jt]=!1,this[v]=typeof t.fd=="number"?t.fd:null,this[Ne]=e,this[Xu]=t.readSize||16*1024*1024,this[Ke]=!1,this[Qu]=typeof t.size=="number"?t.size:1/0,this[As]=this[Qu],this[Vt]=typeof t.autoClose=="boolean"?t.autoClose:!0,typeof this[v]=="number"?this[Gt]():this[Xe]()}get fd(){return this[v]}get path(){return this[Ne]}write(){throw new TypeError("this is a readable stream")}end(){throw new TypeError("this is a readable stream")}[Xe](){Y.open(this[Ne],"r",(e,t)=>this[Yt](e,t))}[Yt](e,t){e?this[Ht](e):(this[v]=t,this.emit("open",t),this[Gt]())}[_n](){return Buffer.allocUnsafe(Math.min(this[Xu],this[As]))}[Gt](){if(!this[Ke]){this[Ke]=!0;let e=this[_n]();if(e.length===0)return process.nextTick(()=>this[bn](null,0,e));Y.read(this[v],e,0,e.length,null,(t,s,i)=>this[bn](t,s,i))}}[bn](e,t,s){this[Ke]=!1,e?this[Ht](e):this[kn](t,s)&&this[Gt]()}[fe](){if(this[Vt]&&typeof this[v]=="number"){let e=this[v];this[v]=null,Y.close(e,t=>t?this.emit("error",t):this.emit("close"))}}[Ht](e){this[Ke]=!0,this[fe](),this.emit("error",e)}[kn](e,t){let s=!1;return this[As]-=e,e>0&&(s=super.write(e<t.length?t.slice(0,e):t)),(e===0||this[As]<=0)&&(s=!1,this[fe](),super.end()),s}emit(e,t){switch(e){case"prefinish":case"finish":break;case"drain":typeof this[v]=="number"&&this[Gt]();break;case"error":return this[Jt]?void 0:(this[Jt]=!0,super.emit(e,t));default:return super.emit(e,t)}}},Rn=class extends bs{[Xe](){let e=!0;try{this[Yt](null,Y.openSync(this[Ne],"r")),e=!1}finally{e&&this[fe]()}}[Gt](){let e=!0;try{if(!this[Ke]){this[Ke]=!0;do{let t=this[_n](),s=t.length===0?0:Y.readSync(this[v],t,0,t.length,null);if(!this[kn](s,t))break}while(!0);this[Ke]=!1}e=!1}finally{e&&this[fe]()}}[fe](){if(this[Vt]&&typeof this[v]=="number"){let e=this[v];this[v]=null,Y.closeSync(e),this.emit("close")}}},Ss=class extends tf{constructor(e,t){t=t||{},super(t),this.readable=!1,this.writable=!0,this[Jt]=!1,this[Wt]=!1,this[yr]=!1,this[ys]=!1,this[we]=[],this[Ne]=e,this[v]=typeof t.fd=="number"?t.fd:null,this[Fs]=t.mode===void 0?438:t.mode,this[gt]=typeof t.start=="number"?t.start:null,this[Vt]=typeof t.autoClose=="boolean"?t.autoClose:!0;let s=this[gt]!==null?"r+":"w";this[ws]=t.flags===void 0,this[Ze]=this[ws]?s:t.flags,this[v]===null&&this[Xe]()}emit(e,t){if(e==="error"){if(this[Jt])return;this[Jt]=!0}return super.emit(e,t)}get fd(){return this[v]}get path(){return this[Ne]}[Ht](e){this[fe](),this[Wt]=!0,this.emit("error",e)}[Xe](){Y.open(this[Ne],this[Ze],this[Fs],(e,t)=>this[Yt](e,t))}[Yt](e,t){this[ws]&&this[Ze]==="r+"&&e&&e.code==="ENOENT"?(this[Ze]="w",this[Xe]()):e?this[Ht](e):(this[v]=t,this.emit("open",t),this[Fn]())}end(e,t){return e&&this.write(e,t),this[yr]=!0,!this[Wt]&&!this[we].length&&typeof this[v]=="number"&&this[zt](null,0),this}write(e,t){return typeof e=="string"&&(e=Buffer.from(e,t)),this[yr]?(this.emit("error",new Error("write() after end()")),!1):this[v]===null||this[Wt]||this[we].length?(this[we].push(e),this[ys]=!0,!1):(this[Wt]=!0,this[Cs](e),!0)}[Cs](e){Y.write(this[v],e,0,e.length,this[gt],(t,s)=>this[zt](t,s))}[zt](e,t){e?this[Ht](e):(this[gt]!==null&&(this[gt]+=t),this[we].length?this[Fn]():(this[Wt]=!1,this[yr]&&!this[Zu]?(this[Zu]=!0,this[fe](),this.emit("finish")):this[ys]&&(this[ys]=!1,this.emit("drain"))))}[Fn](){if(this[we].length===0)this[yr]&&this[zt](null,0);else if(this[we].length===1)this[Cs](this[we].pop());else{let e=this[we];this[we]=[],Sn(this[v],e,this[gt],(t,s)=>this[zt](t,s))}}[fe](){if(this[Vt]&&typeof this[v]=="number"){let e=this[v];this[v]=null,Y.close(e,t=>t?this.emit("error",t):this.emit("close"))}}},vn=class extends Ss{[Xe](){let e;if(this[ws]&&this[Ze]==="r+")try{e=Y.openSync(this[Ne],this[Ze],this[Fs])}catch(t){if(t.code==="ENOENT")return this[Ze]="w",this[Xe]();throw t}else e=Y.openSync(this[Ne],this[Ze],this[Fs]);this[Yt](null,e)}[fe](){if(this[Vt]&&typeof this[v]=="number"){let e=this[v];this[v]=null,Y.closeSync(e),this.emit("close")}}[Cs](e){let t=!0;try{this[zt](null,Y.writeSync(this[v],e,0,e.length,this[gt])),t=!1}finally{if(t)try{this[fe]()}catch{}}}};Ar.ReadStream=bs;Ar.ReadStreamSync=Rn;Ar.WriteStream=Ss;Ar.WriteStreamSync=vn});var Os=E((u0,ua)=>{"use strict";u();var rf=is(),sf=Ut(),nf=require("events"),of=fn(),uf=1024*1024,af=ts(),ea=ss(),cf=Wi(),{nextTick:lf}=require("process"),Bn=Buffer.from([31,139]),ie=Symbol("state"),Et=Symbol("writeEntry"),Le=Symbol("readEntry"),xn=Symbol("nextEntry"),ta=Symbol("processEntry"),ne=Symbol("extendedHeader"),Cr=Symbol("globalExtendedHeader"),Qe=Symbol("meta"),ra=Symbol("emitMeta"),O=Symbol("buffer"),Ie=Symbol("queue"),yt=Symbol("ended"),sa=Symbol("emittedEnd"),At=Symbol("emit"),K=Symbol("unzip"),ks=Symbol("consumeChunk"),_s=Symbol("consumeChunkSub"),On=Symbol("consumeBody"),ia=Symbol("consumeMeta"),na=Symbol("consumeHeader"),Rs=Symbol("consuming"),Pn=Symbol("bufferConcat"),Tn=Symbol("maybeEnd"),wr=Symbol("writing"),et=Symbol("aborted"),vs=Symbol("onDone"),Ct=Symbol("sawValidEntry"),Bs=Symbol("sawNullBlock"),xs=Symbol("sawEOF"),oa=Symbol("closeStream"),hf=r=>!0;ua.exports=rf(class extends nf{constructor(e){e=e||{},super(e),this.file=e.file||"",this[Ct]=null,this.on(vs,t=>{(this[ie]==="begin"||this[Ct]===!1)&&this.warn("TAR_BAD_ARCHIVE","Unrecognized archive format")}),e.ondone?this.on(vs,e.ondone):this.on(vs,t=>{this.emit("prefinish"),this.emit("finish"),this.emit("end")}),this.strict=!!e.strict,this.maxMetaEntrySize=e.maxMetaEntrySize||uf,this.filter=typeof e.filter=="function"?e.filter:hf,this.writable=!0,this.readable=!1,this[Ie]=new of,this[O]=null,this[Le]=null,this[Et]=null,this[ie]="begin",this[Qe]="",this[ne]=null,this[Cr]=null,this[yt]=!1,this[K]=null,this[et]=!1,this[Bs]=!1,this[xs]=!1,this.on("end",()=>this[oa]()),typeof e.onwarn=="function"&&this.on("warn",e.onwarn),typeof e.onentry=="function"&&this.on("entry",e.onentry)}[na](e,t){this[Ct]===null&&(this[Ct]=!1);let s;try{s=new sf(e,t,this[ne],this[Cr])}catch(i){return this.warn("TAR_ENTRY_INVALID",i)}if(s.nullBlock)this[Bs]?(this[xs]=!0,this[ie]==="begin"&&(this[ie]="header"),this[At]("eof")):(this[Bs]=!0,this[At]("nullBlock"));else if(this[Bs]=!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[Et]=new af(s,this[ne],this[Cr]);if(!this[Ct])if(n.remain){let o=()=>{n.invalid||(this[Ct]=!0)};n.on("end",o)}else this[Ct]=!0;n.meta?n.size>this.maxMetaEntrySize?(n.ignore=!0,this[At]("ignoredEntry",n),this[ie]="ignore",n.resume()):n.size>0&&(this[Qe]="",n.on("data",o=>this[Qe]+=o),this[ie]="meta"):(this[ne]=null,n.ignore=n.ignore||!this.filter(n.path,n),n.ignore?(this[At]("ignoredEntry",n),this[ie]=n.remain?"ignore":"header",n.resume()):(n.remain?this[ie]="body":(this[ie]="header",n.end()),this[Le]?this[Ie].push(n):(this[Ie].push(n),this[xn]())))}}}[oa](){lf(()=>this.emit("close"))}[ta](e){let t=!0;return e?Array.isArray(e)?this.emit.apply(this,e):(this[Le]=e,this.emit("entry",e),e.emittedEnd||(e.on("end",s=>this[xn]()),t=!1)):(this[Le]=null,t=!1),t}[xn](){do;while(this[ta](this[Ie].shift()));if(!this[Ie].length){let e=this[Le];!e||e.flowing||e.size===e.remain?this[wr]||this.emit("drain"):e.once("drain",s=>this.emit("drain"))}}[On](e,t){let s=this[Et],i=s.blockRemain,n=i>=e.length&&t===0?e:e.slice(t,t+i);return s.write(n),s.blockRemain||(this[ie]="header",this[Et]=null,s.end()),n.length}[ia](e,t){let s=this[Et],i=this[On](e,t);return this[Et]||this[ra](s),i}[At](e,t,s){!this[Ie].length&&!this[Le]?this.emit(e,t,s):this[Ie].push([e,t,s])}[ra](e){switch(this[At]("meta",this[Qe]),e.type){case"ExtendedHeader":case"OldExtendedHeader":this[ne]=ea.parse(this[Qe],this[ne],!1);break;case"GlobalExtendedHeader":this[Cr]=ea.parse(this[Qe],this[Cr],!0);break;case"NextFileHasLongPath":case"OldGnuLongPath":this[ne]=this[ne]||Object.create(null),this[ne].path=this[Qe].replace(/\0.*/,"");break;case"NextFileHasLongLinkpath":this[ne]=this[ne]||Object.create(null),this[ne].linkpath=this[Qe].replace(/\0.*/,"");break;default:throw new Error("unknown meta: "+e.type)}}abort(e){this[et]=!0,this.emit("abort",e),this.warn("TAR_ABORT",e,{recoverable:!1})}write(e){if(this[et])return;if(this[K]===null&&e){if(this[O]&&(e=Buffer.concat([this[O],e]),this[O]=null),e.length<Bn.length)return this[O]=e,!0;for(let s=0;this[K]===null&&s<Bn.length;s++)e[s]!==Bn[s]&&(this[K]=!1);if(this[K]===null){let s=this[yt];this[yt]=!1,this[K]=new cf.Unzip,this[K].on("data",n=>this[ks](n)),this[K].on("error",n=>this.abort(n)),this[K].on("end",n=>{this[yt]=!0,this[ks]()}),this[wr]=!0;let i=this[K][s?"end":"write"](e);return this[wr]=!1,i}}this[wr]=!0,this[K]?this[K].write(e):this[ks](e),this[wr]=!1;let t=this[Ie].length?!1:this[Le]?this[Le].flowing:!0;return!t&&!this[Ie].length&&this[Le].once("drain",s=>this.emit("drain")),t}[Pn](e){e&&!this[et]&&(this[O]=this[O]?Buffer.concat([this[O],e]):e)}[Tn](){if(this[yt]&&!this[sa]&&!this[et]&&!this[Rs]){this[sa]=!0;let e=this[Et];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[At](vs)}}[ks](e){if(this[Rs])this[Pn](e);else if(!e&&!this[O])this[Tn]();else{if(this[Rs]=!0,this[O]){this[Pn](e);let t=this[O];this[O]=null,this[_s](t)}else this[_s](e);for(;this[O]&&this[O].length>=512&&!this[et]&&!this[xs];){let t=this[O];this[O]=null,this[_s](t)}this[Rs]=!1}(!this[O]||this[yt])&&this[Tn]()}[_s](e){let t=0,s=e.length;for(;t+512<=s&&!this[et]&&!this[xs];)switch(this[ie]){case"begin":case"header":this[na](e,t),t+=512;break;case"ignore":case"body":t+=this[On](e,t);break;case"meta":t+=this[ia](e,t);break;default:throw new Error("invalid state: "+this[ie])}t<s&&(this[O]?this[O]=Buffer.concat([e.slice(t),this[O]]):this[O]=e.slice(t))}end(e){this[et]||(this[K]?this[K].end(e):(this[yt]=!0,this.write(e)))}})});var Ps=E((a0,ha)=>{"use strict";u();var ff=Pt(),ca=Os(),Zt=require("fs"),pf=Kt(),aa=require("path"),Nn=qt();ha.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=ff(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&&df(s,e),s.noResume||mf(s),s.file&&s.sync?Df(s):s.file?gf(s,t):la(s)};var mf=r=>{let e=r.onentry;r.onentry=e?t=>{e(t),t.resume()}:t=>t.resume()},df=(r,e)=>{let t=new Map(e.map(n=>[Nn(n),!0])),s=r.filter,i=(n,o)=>{let a=o||aa.parse(n).root||".",l=n===a?!1:t.has(n)?t.get(n):i(aa.dirname(n),a);return t.set(n,l),l};r.filter=s?(n,o)=>s(n,o)&&i(Nn(n)):n=>i(Nn(n))},Df=r=>{let e=la(r),t=r.file,s=!0,i;try{let n=Zt.statSync(t),o=r.maxReadSize||16*1024*1024;if(n.size<o)e.end(Zt.readFileSync(t));else{let a=0,l=Buffer.allocUnsafe(o);for(i=Zt.openSync(t,"r");a<n.size;){let c=Zt.readSync(i,l,0,o,a);a+=c,e.write(l.slice(0,c))}e.end()}s=!1}finally{if(s&&i)try{Zt.closeSync(i)}catch{}}},gf=(r,e)=>{let t=new ca(r),s=r.maxReadSize||16*1024*1024,i=r.file,n=new Promise((o,a)=>{t.on("error",a),t.on("end",o),Zt.stat(i,(l,c)=>{if(l)a(l);else{let h=new pf.ReadStream(i,{readSize:s,size:c.size});h.on("error",a),h.pipe(t)}})});return e?n.then(e,e):n},la=r=>new ca(r)});var ga=E((c0,Da)=>{"use strict";u();var Ef=Pt(),Ts=Es(),fa=Kt(),pa=Ps(),ma=require("path");Da.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=Ef(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?yf(s,e):s.file?Af(s,e,t):s.sync?Cf(s,e):wf(s,e)};var yf=(r,e)=>{let t=new Ts.Sync(r),s=new fa.WriteStreamSync(r.file,{mode:r.mode||438});t.pipe(s),da(t,e)},Af=(r,e,t)=>{let s=new Ts(r),i=new fa.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 Ln(s,e),t?n.then(t,t):n},da=(r,e)=>{e.forEach(t=>{t.charAt(0)==="@"?pa({file:ma.resolve(r.cwd,t.slice(1)),sync:!0,noResume:!0,onentry:s=>r.add(s)}):r.add(t)}),r.end()},Ln=(r,e)=>{for(;e.length;){let t=e.shift();if(t.charAt(0)==="@")return pa({file:ma.resolve(r.cwd,t.slice(1)),noResume:!0,onentry:s=>r.add(s)}).then(s=>Ln(r,e));r.add(t)}r.end()},Cf=(r,e)=>{let t=new Ts.Sync(r);return da(t,e),t},wf=(r,e)=>{let t=new Ts(r);return Ln(t,e),t}});var In=E((l0,ba)=>{"use strict";u();var Ff=Pt(),Ea=Es(),Q=require("fs"),ya=Kt(),Aa=Ps(),Ca=require("path"),wa=Ut();ba.exports=(r,e,t)=>{let s=Ff(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?bf(s,e):kf(s,e,t)};var bf=(r,e)=>{let t=new Ea.Sync(r),s=!0,i,n;try{try{i=Q.openSync(r.file,"r+")}catch(l){if(l.code==="ENOENT")i=Q.openSync(r.file,"w+");else throw l}let o=Q.fstatSync(i),a=Buffer.alloc(512);e:for(n=0;n<o.size;n+=512){for(let h=0,m=0;h<512;h+=m){if(m=Q.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(!m)break e}let l=new wa(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,Sf(r,t,n,i,e)}finally{if(s)try{Q.closeSync(i)}catch{}}},Sf=(r,e,t,s,i)=>{let n=new ya.WriteStreamSync(r.file,{fd:s,start:t});e.pipe(n),_f(e,i)},kf=(r,e,t)=>{e=Array.from(e);let s=new Ea(r),i=(o,a,l)=>{let c=(b,P)=>{b?Q.close(o,S=>l(b)):l(null,P)},h=0;if(a===0)return c(null,0);let m=0,D=Buffer.alloc(512),A=(b,P)=>{if(b)return c(b);if(m+=P,m<512&&P)return Q.read(o,D,m,D.length-m,h+m,A);if(h===0&&D[0]===31&&D[1]===139)return c(new Error("cannot append to compressed archives"));if(m<512)return c(null,h);let S=new wa(D);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),m=0,Q.read(o,D,0,512,h,A)};Q.read(o,D,0,512,h,A)},n=new Promise((o,a)=>{s.on("error",a);let l="r+",c=(h,m)=>{if(h&&h.code==="ENOENT"&&l==="r+")return l="w+",Q.open(r.file,l,c);if(h)return a(h);Q.fstat(m,(D,A)=>{if(D)return Q.close(m,()=>a(D));i(m,A.size,(b,P)=>{if(b)return a(b);let S=new ya.WriteStream(r.file,{fd:m,start:P});s.pipe(S),S.on("error",a),S.on("close",o),Fa(s,e)})})};Q.open(r.file,l,c)});return t?n.then(t,t):n},_f=(r,e)=>{e.forEach(t=>{t.charAt(0)==="@"?Aa({file:Ca.resolve(r.cwd,t.slice(1)),sync:!0,noResume:!0,onentry:s=>r.add(s)}):r.add(t)}),r.end()},Fa=(r,e)=>{for(;e.length;){let t=e.shift();if(t.charAt(0)==="@")return Aa({file:Ca.resolve(r.cwd,t.slice(1)),noResume:!0,onentry:s=>r.add(s)}).then(s=>Fa(r,e));r.add(t)}r.end()}});var ka=E((h0,Sa)=>{"use strict";u();var Rf=Pt(),vf=In();Sa.exports=(r,e,t)=>{let s=Rf(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),Bf(s),vf(s,e,t)};var Bf=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 va=E((f0,Ra)=>{u();var{promisify:_a}=require("util"),tt=require("fs"),xf=r=>{if(!r)r={mode:511,fs:tt};else if(typeof r=="object")r={mode:511,fs:tt,...r};else if(typeof r=="number")r={mode:r,fs:tt};else if(typeof r=="string")r={mode:parseInt(r,8),fs:tt};else throw new TypeError("invalid options argument");return r.mkdir=r.mkdir||r.fs.mkdir||tt.mkdir,r.mkdirAsync=_a(r.mkdir),r.stat=r.stat||r.fs.stat||tt.stat,r.statAsync=_a(r.stat),r.statSync=r.statSync||r.fs.statSync||tt.statSync,r.mkdirSync=r.mkdirSync||r.fs.mkdirSync||tt.mkdirSync,r};Ra.exports=xf});var xa=E((p0,Ba)=>{u();var Of=process.env.__TESTING_MKDIRP_PLATFORM__||process.platform,{resolve:Pf,parse:Tf}=require("path"),Nf=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=Pf(r),Of==="win32"){let e=/[*|"<>?:]/,{root:t}=Tf(r);if(e.test(r.substr(t.length)))throw Object.assign(new Error("Illegal characters in path."),{path:r,code:"EINVAL"})}return r};Ba.exports=Nf});var La=E((m0,Na)=>{u();var{dirname:Oa}=require("path"),Pa=(r,e,t=void 0)=>t===e?Promise.resolve():r.statAsync(e).then(s=>s.isDirectory()?t:void 0,s=>s.code==="ENOENT"?Pa(r,Oa(e),e):void 0),Ta=(r,e,t=void 0)=>{if(t!==e)try{return r.statSync(e).isDirectory()?t:void 0}catch(s){return s.code==="ENOENT"?Ta(r,Oa(e),e):void 0}};Na.exports={findMade:Pa,findMadeSync:Ta}});var Un=E((d0,Ma)=>{u();var{dirname:Ia}=require("path"),Mn=(r,e,t)=>{e.recursive=!1;let s=Ia(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 Mn(s,e).then(n=>Mn(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=Ia(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}}};Ma.exports={mkdirpManual:Mn,mkdirpManualSync:jn}});var qa=E((D0,Ua)=>{u();var{dirname:ja}=require("path"),{findMade:Lf,findMadeSync:If}=La(),{mkdirpManual:Mf,mkdirpManualSync:jf}=Un(),Uf=(r,e)=>(e.recursive=!0,ja(r)===r?e.mkdirAsync(r,e):Lf(e,r).then(s=>e.mkdirAsync(r,e).then(()=>s).catch(i=>{if(i.code==="ENOENT")return Mf(r,e);throw i}))),qf=(r,e)=>{if(e.recursive=!0,ja(r)===r)return e.mkdirSync(r,e);let s=If(e,r);try{return e.mkdirSync(r,e),s}catch(i){if(i.code==="ENOENT")return jf(r,e);throw i}};Ua.exports={mkdirpNative:Uf,mkdirpNativeSync:qf}});var Ga=E((g0,za)=>{u();var $a=require("fs"),$f=process.env.__TESTING_MKDIRP_NODE_VERSION__||process.version,qn=$f.replace(/^v/,"").split("."),Wa=+qn[0]>10||+qn[0]==10&&+qn[1]>=12,Wf=Wa?r=>r.mkdir===$a.mkdir:()=>!1,zf=Wa?r=>r.mkdirSync===$a.mkdirSync:()=>!1;za.exports={useNative:Wf,useNativeSync:zf}});var Za=E((E0,Ka)=>{u();var Xt=va(),Qt=xa(),{mkdirpNative:Ha,mkdirpNativeSync:Ja}=qa(),{mkdirpManual:Va,mkdirpManualSync:Ya}=Un(),{useNative:Gf,useNativeSync:Hf}=Ga(),er=(r,e)=>(r=Qt(r),e=Xt(e),Gf(e)?Ha(r,e):Va(r,e)),Jf=(r,e)=>(r=Qt(r),e=Xt(e),Hf(e)?Ja(r,e):Ya(r,e));er.sync=Jf;er.native=(r,e)=>Ha(Qt(r),Xt(e));er.manual=(r,e)=>Va(Qt(r),Xt(e));er.nativeSync=(r,e)=>Ja(Qt(r),Xt(e));er.manualSync=(r,e)=>Ya(Qt(r),Xt(e));Ka.exports=er});var ic=E((y0,sc)=>{"use strict";u();var oe=require("fs"),wt=require("path"),Vf=oe.lchown?"lchown":"chown",Yf=oe.lchownSync?"lchownSync":"chownSync",Qa=oe.lchown&&!process.version.match(/v1[1-9]+\./)&&!process.version.match(/v10\.[6-9]/),Xa=(r,e,t)=>{try{return oe[Yf](r,e,t)}catch(s){if(s.code!=="ENOENT")throw s}},Kf=(r,e,t)=>{try{return oe.chownSync(r,e,t)}catch(s){if(s.code!=="ENOENT")throw s}},Zf=Qa?(r,e,t,s)=>i=>{!i||i.code!=="EISDIR"?s(i):oe.chown(r,e,t,s)}:(r,e,t,s)=>s,$n=Qa?(r,e,t)=>{try{return Xa(r,e,t)}catch(s){if(s.code!=="EISDIR")throw s;Kf(r,e,t)}}:(r,e,t)=>Xa(r,e,t),Xf=process.version,ec=(r,e,t)=>oe.readdir(r,e,t),Qf=(r,e)=>oe.readdirSync(r,e);/^v4\./.test(Xf)&&(ec=(r,e,t)=>oe.readdir(r,t));var Ns=(r,e,t,s)=>{oe[Vf](r,e,t,Zf(r,e,t,i=>{s(i&&i.code!=="ENOENT"?i:null)}))},tc=(r,e,t,s,i)=>{if(typeof e=="string")return oe.lstat(wt.resolve(r,e),(n,o)=>{if(n)return i(n.code!=="ENOENT"?n:null);o.name=e,tc(r,o,t,s,i)});if(e.isDirectory())Wn(wt.resolve(r,e.name),t,s,n=>{if(n)return i(n);let o=wt.resolve(r,e.name);Ns(o,t,s,i)});else{let n=wt.resolve(r,e.name);Ns(n,t,s,i)}},Wn=(r,e,t,s)=>{ec(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 Ns(r,e,t,s);let o=n.length,a=null,l=c=>{if(!a){if(c)return s(a=c);if(--o===0)return Ns(r,e,t,s)}};n.forEach(c=>tc(r,c,e,t,l))})},ep=(r,e,t,s)=>{if(typeof e=="string")try{let i=oe.lstatSync(wt.resolve(r,e));i.name=e,e=i}catch(i){if(i.code==="ENOENT")return;throw i}e.isDirectory()&&rc(wt.resolve(r,e.name),t,s),$n(wt.resolve(r,e.name),t,s)},rc=(r,e,t)=>{let s;try{s=Qf(r,{withFileTypes:!0})}catch(i){if(i.code==="ENOENT")return;if(i.code==="ENOTDIR"||i.code==="ENOTSUP")return $n(r,e,t);throw i}return s&&s.length&&s.forEach(i=>ep(r,i,e,t)),$n(r,e,t)};sc.exports=Wn;Wn.sync=rc});var ac=E((A0,zn)=>{"use strict";u();var nc=Za(),ue=require("fs"),Ls=require("path"),oc=ic(),pe=Mt(),Is=class extends Error{constructor(e,t){super("Cannot extract through symbolic link"),this.path=t,this.symlink=e}get name(){return"SylinkError"}},Ms=class extends Error{constructor(e,t){super(t+": Cannot cd into '"+e+"'"),this.path=e,this.code=t}get name(){return"CwdError"}},js=(r,e)=>r.get(pe(e)),Fr=(r,e,t)=>r.set(pe(e),t),tp=(r,e)=>{ue.stat(r,(t,s)=>{(t||!s.isDirectory())&&(t=new Ms(r,t&&t.code||"ENOTDIR")),e(t)})};zn.exports=(r,e,t)=>{r=pe(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,m=e.cache,D=pe(e.cwd),A=(S,x)=>{S?t(S):(Fr(m,r,!0),x&&l?oc(x,o,a,ut=>A(ut)):n?ue.chmod(r,i,t):t())};if(m&&js(m,r)===!0)return A();if(r===D)return tp(r,A);if(c)return nc(r,{mode:i}).then(S=>A(null,S),A);let P=pe(Ls.relative(D,r)).split("/");Us(D,P,i,m,h,D,null,A)};var Us=(r,e,t,s,i,n,o,a)=>{if(!e.length)return a(null,o);let l=e.shift(),c=pe(Ls.resolve(r+"/"+l));if(js(s,c))return Us(c,e,t,s,i,n,o,a);ue.mkdir(c,t,uc(c,e,t,s,i,n,o,a))},uc=(r,e,t,s,i,n,o,a)=>l=>{l?ue.lstat(r,(c,h)=>{if(c)c.path=c.path&&pe(c.path),a(c);else if(h.isDirectory())Us(r,e,t,s,i,n,o,a);else if(i)ue.unlink(r,m=>{if(m)return a(m);ue.mkdir(r,t,uc(r,e,t,s,i,n,o,a))});else{if(h.isSymbolicLink())return a(new Is(r,r+"/"+e.join("/")));a(l)}}):(o=o||r,Us(r,e,t,s,i,n,o,a))},rp=r=>{let e=!1,t="ENOTDIR";try{e=ue.statSync(r).isDirectory()}catch(s){t=s.code}finally{if(!e)throw new Ms(r,t)}};zn.exports.sync=(r,e)=>{r=pe(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,m=pe(e.cwd),D=S=>{Fr(h,r,!0),S&&a&&oc.sync(S,n,o),i&&ue.chmodSync(r,s)};if(h&&js(h,r)===!0)return D();if(r===m)return rp(m),D();if(l)return D(nc.sync(r,s));let b=pe(Ls.relative(m,r)).split("/"),P=null;for(let S=b.shift(),x=m;S&&(x+="/"+S);S=b.shift())if(x=pe(Ls.resolve(x)),!js(h,x))try{ue.mkdirSync(x,s),P=P||x,Fr(h,x,!0)}catch{let de=ue.lstatSync(x);if(de.isDirectory()){Fr(h,x,!0);continue}else if(c){ue.unlinkSync(x),ue.mkdirSync(x,s),P=P||x,Fr(h,x,!0);continue}else if(de.isSymbolicLink())return new Is(x,x+"/"+b.join("/"))}return D(P)}});var Hn=E((C0,cc)=>{u();var Gn=Object.create(null),{hasOwnProperty:sp}=Object.prototype;cc.exports=r=>(sp.call(Gn,r)||(Gn[r]=r.normalize("NFKD")),Gn[r])});var pc=E((w0,fc)=>{u();var lc=require("assert"),ip=Hn(),np=qt(),{join:hc}=require("path"),op=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,up=op==="win32";fc.exports=()=>{let r=new Map,e=new Map,t=c=>c.split("/").slice(0,-1).reduce((m,D)=>(m.length&&(D=hc(m[m.length-1],D)),m.push(D||"/"),m),[]),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(m=>r.get(m)),dirs:[...h.dirs].map(m=>r.get(m))}},n=c=>{let{paths:h,dirs:m}=i(c);return h.every(D=>D[0]===c)&&m.every(D=>D[0]instanceof Set&&D[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:m}=e.get(c),D=new Set;return h.forEach(A=>{let b=r.get(A);lc.equal(b[0],c),b.length===1?r.delete(A):(b.shift(),typeof b[0]=="function"?D.add(b[0]):b[0].forEach(P=>D.add(P)))}),m.forEach(A=>{let b=r.get(A);lc(b[0]instanceof Set),b[0].size===1&&b.length===1?r.delete(A):b[0].size===1?(b.shift(),D.add(b[0])):b[0].delete(c)}),s.delete(c),D.forEach(A=>o(A)),!0};return{check:n,reserve:(c,h)=>{c=up?["win32 parallelization disabled"]:c.map(D=>ip(np(hc(D))).toLowerCase());let m=new Set(c.map(D=>t(D)).reduce((D,A)=>D.concat(A)));return e.set(h,{dirs:m,paths:c}),c.forEach(D=>{let A=r.get(D);A?A.push(h):r.set(D,[h])}),m.forEach(D=>{let A=r.get(D);A?A[A.length-1]instanceof Set?A[A.length-1].add(h):A.push(new Set([h])):r.set(D,[new Set([h])])}),o(h)}}}});var Dc=E((F0,dc)=>{u();var ap=process.env.__FAKE_PLATFORM__||process.platform,cp=ap==="win32",lp=global.__FAKE_TESTING_FS__||require("fs"),{O_CREAT:hp,O_TRUNC:fp,O_WRONLY:pp,UV_FS_O_FILEMAP:mc=0}=lp.constants,mp=cp&&!!mc,dp=512*1024,Dp=mc|fp|hp|pp;dc.exports=mp?r=>r<dp?Dp:"w":()=>"w"});var to=E((b0,Bc)=>{"use strict";u();var gp=require("assert"),Ep=Os(),_=require("fs"),yp=Kt(),Me=require("path"),_c=ac(),gc=Qi(),Ap=pc(),Cp=en(),ee=Mt(),wp=qt(),Fp=Hn(),Ec=Symbol("onEntry"),Yn=Symbol("checkFs"),yc=Symbol("checkFs2"),Ws=Symbol("pruneCache"),Kn=Symbol("isReusable"),ae=Symbol("makeFs"),Zn=Symbol("file"),Xn=Symbol("directory"),zs=Symbol("link"),Ac=Symbol("symlink"),Cc=Symbol("hardlink"),wc=Symbol("unsupported"),Fc=Symbol("checkPath"),rt=Symbol("mkdir"),z=Symbol("onError"),qs=Symbol("pending"),bc=Symbol("pend"),tr=Symbol("unpend"),Jn=Symbol("ended"),Vn=Symbol("maybeClose"),Qn=Symbol("skip"),br=Symbol("doChown"),Sr=Symbol("uid"),kr=Symbol("gid"),_r=Symbol("checkedCwd"),Rc=require("crypto"),vc=Dc(),bp=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,Rr=bp==="win32",Sp=(r,e)=>{if(!Rr)return _.unlink(r,e);let t=r+".DELETE."+Rc.randomBytes(16).toString("hex");_.rename(r,t,s=>{if(s)return e(s);_.unlink(t,e)})},kp=r=>{if(!Rr)return _.unlinkSync(r);let e=r+".DELETE."+Rc.randomBytes(16).toString("hex");_.renameSync(r,e),_.unlinkSync(e)},Sc=(r,e,t)=>r===r>>>0?r:e===e>>>0?e:t,kc=r=>Fp(wp(ee(r))).toLowerCase(),_p=(r,e)=>{e=kc(e);for(let t of r.keys()){let s=kc(t);(s===e||s.indexOf(e+"/")===0)&&r.delete(t)}},Rp=r=>{for(let e of r.keys())r.delete(e)},vr=class extends Ep{constructor(e){if(e||(e={}),e.ondone=t=>{this[Jn]=!0,this[Vn]()},super(e),this[_r]=!1,this.reservations=Ap(),this.transform=typeof e.transform=="function"?e.transform:null,this.writable=!0,this.readable=!1,this[qs]=0,this[Jn]=!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||Rr,this.newer=!!e.newer,this.keep=!!e.keep,this.noMtime=!!e.noMtime,this.preservePaths=!!e.preservePaths,this.unlink=!!e.unlink,this.cwd=ee(Me.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[Ec](t))}warn(e,t,s={}){return(e==="TAR_BAD_ARCHIVE"||e==="TAR_ABORT")&&(s.recoverable=!1),super.warn(e,t,s)}[Vn](){this[Jn]&&this[qs]===0&&(this.emit("prefinish"),this.emit("finish"),this.emit("end"))}[Fc](e){if(this.strip){let t=ee(e.path).split("/");if(t.length<this.strip)return!1;if(e.path=t.slice(this.strip).join("/"),e.type==="Link"){let s=ee(e.linkpath).split("/");if(s.length>=this.strip)e.linkpath=s.slice(this.strip).join("/");else return!1}}if(!this.preservePaths){let t=ee(e.path),s=t.split("/");if(s.includes("..")||Rr&&/^[a-z]:\.\.$/i.test(s[0]))return this.warn("TAR_ENTRY_ERROR","path contains '..'",{entry:e,path:t}),!1;let[i,n]=Cp(t);i&&(e.path=n,this.warn("TAR_ENTRY_INFO",`stripping ${i} from absolute path`,{entry:e,path:t}))}if(Me.isAbsolute(e.path)?e.absolute=ee(Me.resolve(e.path)):e.absolute=ee(Me.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:ee(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}=Me.win32.parse(e.absolute);e.absolute=t+gc.encode(e.absolute.slice(t.length));let{root:s}=Me.win32.parse(e.path);e.path=s+gc.encode(e.path.slice(s.length))}return!0}[Ec](e){if(!this[Fc](e))return e.resume();switch(gp.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[Yn](e);case"CharacterDevice":case"BlockDevice":case"FIFO":default:return this[wc](e)}}[z](e,t){e.name==="CwdError"?this.emit("error",e):(this.warn("TAR_ENTRY_ERROR",e,{entry:t}),this[tr](),t.resume())}[rt](e,t,s){_c(ee(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}[Sr](e){return Sc(this.uid,e.uid,this.processUid)}[kr](e){return Sc(this.gid,e.gid,this.processGid)}[Zn](e,t){let s=e.mode&4095||this.fmode,i=new yp.WriteStream(e.absolute,{flags:vc(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[tr](),t()})};i.on("finish",l=>{let c=e.absolute,h=i.fd;if(e.mtime&&!this.noMtime){n++;let m=e.atime||new Date,D=e.mtime;_.futimes(h,m,D,A=>A?_.utimes(c,m,D,b=>o(b&&A)):o())}if(this[br](e)){n++;let m=this[Sr](e),D=this[kr](e);_.fchown(h,m,D,A=>A?_.chown(c,m,D,b=>o(b&&A)):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)}[Xn](e,t){let s=e.mode&4095||this.dmode;this[rt](e.absolute,s,i=>{if(i){this[z](i,e),t();return}let n=1,o=a=>{--n===0&&(t(),this[tr](),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[Sr](e),this[kr](e),o)),o()})}[wc](e){e.unsupported=!0,this.warn("TAR_ENTRY_UNSUPPORTED",`unsupported entry type: ${e.type}`,{entry:e}),e.resume()}[Ac](e,t){this[zs](e,e.linkpath,"symlink",t)}[Cc](e,t){let s=ee(Me.resolve(this.cwd,e.linkpath));this[zs](e,s,"link",t)}[bc](){this[qs]++}[tr](){this[qs]--,this[Vn]()}[Qn](e){this[tr](),e.resume()}[Kn](e,t){return e.type==="File"&&!this.unlink&&t.isFile()&&t.nlink<=1&&!Rr}[Yn](e){this[bc]();let t=[e.path];e.linkpath&&t.push(e.linkpath),this.reservations.reserve(t,s=>this[yc](e,s))}[Ws](e){e.type==="SymbolicLink"?Rp(this.dirCache):e.type!=="Directory"&&_p(this.dirCache,e.absolute)}[yc](e,t){this[Ws](e);let s=a=>{this[Ws](e),t(a)},i=()=>{this[rt](this.cwd,this.dmode,a=>{if(a){this[z](a,e),s();return}this[_r]=!0,n()})},n=()=>{if(e.absolute!==this.cwd){let a=ee(Me.dirname(e.absolute));if(a!==this.cwd)return this[rt](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[Qn](e),s();return}if(a||this[Kn](e,l))return this[ae](null,e,s);if(l.isDirectory()){if(e.type==="Directory"){let c=!this.noChmod&&e.mode&&(l.mode&4095)!==e.mode,h=m=>this[ae](m,e,s);return c?_.chmod(e.absolute,e.mode,h):h()}if(e.absolute!==this.cwd)return _.rmdir(e.absolute,c=>this[ae](c,e,s))}if(e.absolute===this.cwd)return this[ae](null,e,s);Sp(e.absolute,c=>this[ae](c,e,s))})};this[_r]?n():i()}[ae](e,t,s){if(e){this[z](e,t),s();return}switch(t.type){case"File":case"OldFile":case"ContiguousFile":return this[Zn](t,s);case"Link":return this[Cc](t,s);case"SymbolicLink":return this[Ac](t,s);case"Directory":case"GNUDumpDir":return this[Xn](t,s)}}[zs](e,t,s,i){_[s](t,e.absolute,n=>{n?this[z](n,e):(this[tr](),e.resume()),i()})}},$s=r=>{try{return[null,r()]}catch(e){return[e,null]}},eo=class extends vr{[ae](e,t){return super[ae](e,t,()=>{})}[Yn](e){if(this[Ws](e),!this[_r]){let n=this[rt](this.cwd,this.dmode);if(n)return this[z](n,e);this[_r]=!0}if(e.absolute!==this.cwd){let n=ee(Me.dirname(e.absolute));if(n!==this.cwd){let o=this[rt](n,this.dmode);if(o)return this[z](o,e)}}let[t,s]=$s(()=>_.lstatSync(e.absolute));if(s&&(this.keep||this.newer&&s.mtime>e.mtime))return this[Qn](e);if(t||this[Kn](e,s))return this[ae](null,e);if(s.isDirectory()){if(e.type==="Directory"){let o=!this.noChmod&&e.mode&&(s.mode&4095)!==e.mode,[a]=o?$s(()=>{_.chmodSync(e.absolute,e.mode)}):[];return this[ae](a,e)}let[n]=$s(()=>_.rmdirSync(e.absolute));this[ae](n,e)}let[i]=e.absolute===this.cwd?[]:$s(()=>kp(e.absolute));this[ae](i,e)}[Zn](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,vc(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(m){try{_.utimesSync(e.absolute,c,h)}catch{l=m}}}if(this[br](e)){let c=this[Sr](e),h=this[kr](e);try{_.fchownSync(n,c,h)}catch(m){try{_.chownSync(e.absolute,c,h)}catch{l=l||m}}}i(l)})}[Xn](e,t){let s=e.mode&4095||this.dmode,i=this[rt](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[Sr](e),this[kr](e))}catch{}t(),e.resume()}[rt](e,t){try{return _c.sync(ee(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}}[zs](e,t,s,i){try{_[s+"Sync"](t,e.absolute),i(),e.resume()}catch(n){return this[z](n,e)}}};vr.Sync=eo;Bc.exports=vr});var Nc=E((S0,Tc)=>{"use strict";u();var vp=Pt(),Gs=to(),Oc=require("fs"),Pc=Kt(),xc=require("path"),ro=qt();Tc.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=vp(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&&Bp(s,e),s.file&&s.sync?xp(s):s.file?Op(s,t):s.sync?Pp(s):Tp(s)};var Bp=(r,e)=>{let t=new Map(e.map(n=>[ro(n),!0])),s=r.filter,i=(n,o)=>{let a=o||xc.parse(n).root||".",l=n===a?!1:t.has(n)?t.get(n):i(xc.dirname(n),a);return t.set(n,l),l};r.filter=s?(n,o)=>s(n,o)&&i(ro(n)):n=>i(ro(n))},xp=r=>{let e=new Gs.Sync(r),t=r.file,s=Oc.statSync(t),i=r.maxReadSize||16*1024*1024;new Pc.ReadStreamSync(t,{readSize:i,size:s.size}).pipe(e)},Op=(r,e)=>{let t=new Gs(r),s=r.maxReadSize||16*1024*1024,i=r.file,n=new Promise((o,a)=>{t.on("error",a),t.on("close",o),Oc.stat(i,(l,c)=>{if(l)a(l);else{let h=new Pc.ReadStream(i,{readSize:s,size:c.size});h.on("error",a),h.pipe(t)}})});return e?n.then(e,e):n},Pp=r=>new Gs.Sync(r),Tp=r=>new Gs(r)});var Lc=E(L=>{"use strict";u();L.c=L.create=ga();L.r=L.replace=In();L.t=L.list=Ps();L.u=L.update=ka();L.x=L.extract=Nc();L.Pack=Es();L.Unpack=to();L.Parse=Os();L.ReadEntry=ts();L.WriteEntry=hn();L.Header=Ut();L.Pax=ss();L.types=Hi()});var Mc=E((B0,Ic)=>{u();function ce(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))}Ic.exports=ce;ce.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)};ce.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null};ce.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};ce.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)};ce.prototype.try=function(r){console.log("Using RetryOperation.try() is deprecated"),this.attempt(r)};ce.prototype.start=function(r){console.log("Using RetryOperation.start() is deprecated"),this.attempt(r)};ce.prototype.start=ce.prototype.try;ce.prototype.errors=function(){return this._errors};ce.prototype.attempts=function(){return this._attempts};ce.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 jc=E(Ft=>{u();var qp=Mc();Ft.operation=function(r){var e=Ft.timeouts(r);return new qp(e,{forever:r&&(r.forever||r.retries===1/0),unref:r&&r.unref,maxRetryTime:r&&r.maxRetryTime})};Ft.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};Ft.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};Ft.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=Ft.operation(e),h=Array.prototype.slice.call(arguments,1),m=h.pop();h.push(function(D){c.retry(D)||(D&&(arguments[0]=c.mainError()),m.apply(this,arguments))}),c.attempt(function(){l.apply(r,h)})}.bind(r,o),r[n].options=e}}});var qc=E((O0,Uc)=>{u();Uc.exports=jc()});var Wc=E((P0,$c)=>{u();var $p=qc();function Wp(r,e){function t(s,i){var n=e||{},o;"randomize"in n||(n.randomize=!0),o=$p.operation(n);function a(h){i(h||new Error("Aborted"))}function l(h,m){if(h.bail){a(h);return}o.retry(h)?n.onRetry&&n.onRetry(h,m):i(o.mainError())}function c(h){var m;try{m=r(a,h)}catch(D){l(D,h);return}Promise.resolve(m).then(s).catch(function(A){l(A,h)})}o.attempt(c)}return new Promise(t)}$c.exports=Wp});var km={};wl(km,{ConvertError:()=>R,MANAGERS:()=>qe,convert:()=>Sm,getPackageManagerMeta:()=>no,getWorkspaceDetails:()=>io,install:()=>Ys});module.exports=Fl(km);u();u();u();u();var Ol=w(mo());u();u();function ri(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}u();u();function ar(r){return ar=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},ar(r)}u();function si(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function ii(r,e){if(e&&(ar(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return si(r)}u();function lt(r){return lt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},lt(r)}u();u();function Se(r,e){return Se=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(s,i){return s.__proto__=i,s},Se(r,e)}function ni(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&&Se(r,e)}u();u();function oi(r){return Function.toString.call(r).indexOf("[native code]")!==-1}u();u();function ui(){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 Bt(r,e,t){return ui()?Bt=Reflect.construct.bind():Bt=function(i,n,o){var a=[null];a.push.apply(a,n);var l=Function.bind.apply(i,a),c=new l;return o&&Se(c,o.prototype),c},Bt.apply(null,arguments)}function cr(r){var e=typeof Map=="function"?new Map:void 0;return cr=function(s){if(s===null||!oi(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 Bt(s,arguments,lt(this).constructor)}return i.prototype=Object.create(s.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Se(i,s)},cr(r)}var Po=w(Oo());var Pl=w(require("fs-extra")),fd=function(r){ni(e,r);function e(t){var s;return ri(this,e),s=ii(this,lt(e).call(this,"No package.json could be found upwards from the directory ".concat(t))),s.directory=t,s}return e}(cr(Error));u();u();var Tl=w(require("fs")),Nl=w(require("path"));u();var zl=w(require("fs")),Gl=w(require("path")),Hl=w(require("js-yaml")),Jl=require("fast-glob");u();var Ot=require("picocolors"),Ml=w(require("ora")),To=w(require("gradient-string")),No="#0099F7",Lo="#F11712",jl="#FFFF00",mi=r=>{let e=Ul(r);return t=>`\x1B[38;5;${e}m${t}${(0,Ot.reset)("")}`},Cd=(0,To.default)(No,Lo),wd=mi(No),Fd=mi(Lo),bd=mi(jl);function Ul(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 Io=w(require("os")),Mo=w(require("execa")),Vl=5e3;async function Ur(r,e=[],t){let s={cwd:Io.default.tmpdir(),env:{COREPACK_ENABLE_STRICT:"0"},timeout:Vl,...t};try{let{stdout:i}=await(0,Mo.default)(r,e,s);return i.trim()}catch{return}}async function Di(){let[r,e,t,s]=await Promise.all([Ur("yarnpkg",["--version"],{cwd:"."}),Ur("npm",["--version"]),Ur("pnpm",["--version"]),Ur("bun",["--version"])]);return{yarn:r,pnpm:t,npm:e,bun:s}}u();var Yl=w(require("fs-extra"));u();var Kl=w(require("path")),Zl=w(require("fs-extra")),Xl=w(require("picocolors"));u();var Np=require("stream"),Lp=require("stream/promises"),Ip=require("zlib"),Hs=require("fs"),Js=require("path"),Mp=require("child_process"),jp=w(Lc());u();var Up=w(require("fs-extra"));u();var Zp=w(require("path")),Xp=w(Wc()),Qp=w(require("picocolors")),em=w(require("fs-extra"));u();u();var tm=w(require("picocolors")),rm=w(require("update-check"));u();u();u();var R=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,R)}};u();u();var bt=w(require("path")),me=w(require("fs-extra")),Xc=w(require("execa"));u();var Yc=w(require("path")),Kc=w(require("fs-extra")),Zc=w(require("picocolors"));u();var je=w(require("path")),zc=w(require("execa")),te=require("fs-extra"),Gc=require("fast-glob"),Hc=w(require("js-yaml"));var sm=/^(?!_)(?<manager>.+)@(?<version>.+)$/;function I({workspaceRoot:r}){let e=je.default.join(r,"package.json");try{return(0,te.readJsonSync)(e,"utf8")}catch(t){if(t&&typeof t=="object"&&"code"in t){if(t.code==="ENOENT")throw new R(`no "package.json" found at ${r}`,{type:"package_json-missing"});if(t.code==="EJSONPARSE")throw new R(`failed to parse "package.json" at ${r}`,{type:"package_json-parse_error"})}throw new Error(`unexpected error reading "package.json" at ${r}`)}}function st({workspaceRoot:r}){let{packageManager:e}=I({workspaceRoot:r});if(e)try{let t=sm.exec(e);if(t){let[s,i]=t;return i}}catch{}}function Ue({workspaceRoot:r}){let e=I({workspaceRoot:r}),t=je.default.basename(r),{name:s=t,description:i}=e;return{name:s,description:i}}function so({workspaceRoot:r}){let e=je.default.join(r,"pnpm-workspace.yaml");if((0,te.existsSync)(e))try{let t=Hc.default.load((0,te.readFileSync)(e,"utf8"));if(t instanceof Object&&"packages"in t&&Array.isArray(t.packages))return t.packages}catch{throw new R(`failed to parse ${e}`,{type:"pnpm-workspace_parse_error"})}return[]}function it({root:r,lockFile:e,workspaceConfig:t}){let s=n=>je.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 rr({workspaces:r}){var e;return r?Array.isArray(r)?r:"packages"in r?(e=r.packages)!=null?e:[]:[]:[]}function nt({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,Gc.sync)(i,{onlyFiles:!0,absolute:!0,cwd:r,ignore:["**/node_modules/**",...t]})}).map(s=>{let i=je.default.dirname(s),{name:n,description:o}=Ue({workspaceRoot:i});return{name:n,description:o,paths:{root:i,packageJson:s,nodeModules:je.default.join(i,"node_modules")}}})}function Jc({directory:r}){let e=je.default.resolve(process.cwd(),r);return{exists:(0,te.existsSync)(e),absolute:e}}function le({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 Vc({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 re({project:r,options:e}){e!=null&&e.dry||(0,te.rmSync)(r.paths.lockfile,{force:!0})}async function Vs({project:r,options:e}){if(!(e!=null&&e.dry)&&(0,te.existsSync)(r.paths.lockfile))try{let{stdout:t}=await(0,zc.default)("bun",["bun.lockb"],{stdin:"ignore",cwd:r.paths.root,preferLocal:!0,shell:process.platform==="win32"});await(0,te.writeFile)(je.default.join(r.paths.root,"yarn.lock"),t)}catch{}finally{(0,te.rmSync)(r.paths.lockfile,{force:!0})}}function im({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 he({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=I({workspaceRoot:e.paths.root}),o={dependencies:[],devDependencies:[],peerDependencies:[],optionalDependencies:[]},a=["dependencies","devDependencies","peerDependencies","optionalDependencies"];a.forEach(m=>{let D=n[m];if(D){let{updated:A,dependencyList:b}=im({dependencyList:D,project:r,to:t});n[m]=b,o[m]=A}});let l=m=>{let D=o[m].length;if(D>0)return`${Zc.default.green(D.toString())} ${m}`},c=a.map(l).filter(Boolean),h=`./${Yc.default.relative(r.paths.root,e.paths.packageJson)}`;if(c.length>=1){let m="updating";c.forEach((D,A)=>{c.length===1?m+=` ${D} in ${h}`:A===c.length-1?m+=`and ${D} in ${h}`:m+=` ${D}, `}),s.workspaceStep(m)}else s.workspaceStep(`no workspace dependencies found in ${h}`);i!=null&&i.dry||Kc.default.writeJSONSync(e.paths.packageJson,n,{spaces:2})}var ot={name:"pnpm",lock:"pnpm-lock.yaml"};async function Qc(r){let e=bt.default.join(r.workspaceRoot,ot.lock),t=bt.default.join(r.workspaceRoot,"pnpm-workspace.yaml"),s=st({workspaceRoot:r.workspaceRoot});return me.default.existsSync(e)||me.default.existsSync(t)||s===ot.name}async function nm(r){if(!await Qc(r))throw new R("Not a pnpm project",{type:"package_manager-unexpected"});let{name:t,description:s}=Ue(r);return{name:t,description:s,packageManager:ot.name,paths:it({root:r.workspaceRoot,lockFile:ot.lock,workspaceConfig:"pnpm-workspace.yaml"}),workspaceData:{globs:so(r),workspaces:nt({workspaceGlobs:so(r),...r})}}}async function om(r){let{project:e,to:t,logger:s,options:i}=r,n=e.workspaceData.globs.length>0;s.mainStep(le({action:"create",packageManager:ot.name,project:e}));let o=I({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||(me.default.writeJSONSync(e.paths.packageJson,o,{spaces:2}),n&&(s.rootStep('adding "pnpm-workspace.yaml"'),me.default.writeFileSync(bt.default.join(e.paths.root,"pnpm-workspace.yaml"),`packages:
|
|
1
|
+
"use strict";var El=Object.create;var Tr=Object.defineProperty;var yl=Object.getOwnPropertyDescriptor;var Al=Object.getOwnPropertyNames;var Cl=Object.getPrototypeOf,wl=Object.prototype.hasOwnProperty;var Fl=(r,e)=>()=>(r&&(e=r(r=0)),e);var E=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),bl=(r,e)=>{for(var t in e)Tr(r,t,{get:e[t],enumerable:!0})},ao=(r,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Al(e))!wl.call(r,i)&&i!==t&&Tr(r,i,{get:()=>e[i],enumerable:!(s=yl(e,i))||s.enumerable});return r};var w=(r,e,t)=>(t=r!=null?El(Cl(r)):{},ao(e||!r||!r.__esModule?Tr(t,"default",{value:r,enumerable:!0}):t,r)),Sl=r=>ao(Tr({},"__esModule",{value:!0}),r);var u=Fl(()=>{});var co=E((xm,Fe)=>{u();function ti(r){return Fe.exports=ti=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},Fe.exports.__esModule=!0,Fe.exports.default=Fe.exports,ti(r)}Fe.exports=ti,Fe.exports.__esModule=!0,Fe.exports.default=Fe.exports});var fo=E((Om,be)=>{u();var lo=co().default;function ho(){"use strict";be.exports=ho=function(){return e},be.exports.__esModule=!0,be.exports.default=be.exports;var r,e={},t=Object.prototype,s=t.hasOwnProperty,i=Object.defineProperty||function(g,p,d){g[p]=d.value},n=typeof Symbol=="function"?Symbol:{},o=n.iterator||"@@iterator",a=n.asyncIterator||"@@asyncIterator",l=n.toStringTag||"@@toStringTag";function c(g,p,d){return Object.defineProperty(g,p,{value:d,enumerable:!0,configurable:!0,writable:!0}),g[p]}try{c({},"")}catch{c=function(d,y,F){return d[y]=F}}function h(g,p,d,y){var F=p&&p.prototype instanceof x?p:x,C=Object.create(F.prototype),T=new Qs(y||[]);return i(C,"_invoke",{value:Dl(g,d,T)}),C}function m(g,p,d){try{return{type:"normal",arg:g.call(p,d)}}catch(y){return{type:"throw",arg:y}}}e.wrap=h;var D="suspendedStart",A="suspendedYield",b="executing",P="completed",S={};function x(){}function ut(){}function de(){}var Ks={};c(Ks,o,function(){return this});var Zs=Object.getPrototypeOf,Or=Zs&&Zs(Zs(ei([])));Or&&Or!==t&&s.call(Or,o)&&(Ks=Or);var vt=de.prototype=x.prototype=Object.create(Ks);function oo(g){["next","throw","return"].forEach(function(p){c(g,p,function(d){return this._invoke(p,d)})})}function Pr(g,p){function d(F,C,T,G){var H=m(g[F],g,C);if(H.type!=="throw"){var at=H.arg,$e=at.value;return $e&&lo($e)=="object"&&s.call($e,"__await")?p.resolve($e.__await).then(function(ct){d("next",ct,T,G)},function(ct){d("throw",ct,T,G)}):p.resolve($e).then(function(ct){at.value=ct,T(at)},function(ct){return d("throw",ct,T,G)})}G(H.arg)}var y;i(this,"_invoke",{value:function(C,T){function G(){return new p(function(H,at){d(C,T,H,at)})}return y=y?y.then(G,G):G()}})}function Dl(g,p,d){var y=D;return function(F,C){if(y===b)throw new Error("Generator is already running");if(y===P){if(F==="throw")throw C;return{value:r,done:!0}}for(d.method=F,d.arg=C;;){var T=d.delegate;if(T){var G=uo(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(y===D)throw y=P,d.arg;d.dispatchException(d.arg)}else d.method==="return"&&d.abrupt("return",d.arg);y=b;var H=m(g,p,d);if(H.type==="normal"){if(y=d.done?P:A,H.arg===S)continue;return{value:H.arg,done:d.done}}H.type==="throw"&&(y=P,d.method="throw",d.arg=H.arg)}}}function uo(g,p){var d=p.method,y=g.iterator[d];if(y===r)return p.delegate=null,d==="throw"&&g.iterator.return&&(p.method="return",p.arg=r,uo(g,p),p.method==="throw")||d!=="return"&&(p.method="throw",p.arg=new TypeError("The iterator does not provide a '"+d+"' method")),S;var F=m(y,g.iterator,p.arg);if(F.type==="throw")return p.method="throw",p.arg=F.arg,p.delegate=null,S;var C=F.arg;return C?C.done?(p[g.resultName]=C.value,p.next=g.nextLoc,p.method!=="return"&&(p.method="next",p.arg=r),p.delegate=null,S):C:(p.method="throw",p.arg=new TypeError("iterator result is not an object"),p.delegate=null,S)}function gl(g){var p={tryLoc:g[0]};1 in g&&(p.catchLoc=g[1]),2 in g&&(p.finallyLoc=g[2],p.afterLoc=g[3]),this.tryEntries.push(p)}function Xs(g){var p=g.completion||{};p.type="normal",delete p.arg,g.completion=p}function Qs(g){this.tryEntries=[{tryLoc:"root"}],g.forEach(gl,this),this.reset(!0)}function ei(g){if(g||g===""){var p=g[o];if(p)return p.call(g);if(typeof g.next=="function")return g;if(!isNaN(g.length)){var d=-1,y=function F(){for(;++d<g.length;)if(s.call(g,d))return F.value=g[d],F.done=!1,F;return F.value=r,F.done=!0,F};return y.next=y}}throw new TypeError(lo(g)+" is not iterable")}return ut.prototype=de,i(vt,"constructor",{value:de,configurable:!0}),i(de,"constructor",{value:ut,configurable:!0}),ut.displayName=c(de,l,"GeneratorFunction"),e.isGeneratorFunction=function(g){var p=typeof g=="function"&&g.constructor;return!!p&&(p===ut||(p.displayName||p.name)==="GeneratorFunction")},e.mark=function(g){return Object.setPrototypeOf?Object.setPrototypeOf(g,de):(g.__proto__=de,c(g,l,"GeneratorFunction")),g.prototype=Object.create(vt),g},e.awrap=function(g){return{__await:g}},oo(Pr.prototype),c(Pr.prototype,a,function(){return this}),e.AsyncIterator=Pr,e.async=function(g,p,d,y,F){F===void 0&&(F=Promise);var C=new Pr(h(g,p,d,y),F);return e.isGeneratorFunction(p)?C:C.next().then(function(T){return T.done?T.value:C.next()})},oo(vt),c(vt,l,"Generator"),c(vt,o,function(){return this}),c(vt,"toString",function(){return"[object Generator]"}),e.keys=function(g){var p=Object(g),d=[];for(var y in p)d.push(y);return d.reverse(),function F(){for(;d.length;){var C=d.pop();if(C in p)return F.value=C,F.done=!1,F}return F.done=!0,F}},e.values=ei,Qs.prototype={constructor:Qs,reset:function(p){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(Xs),!p)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 p=this.tryEntries[0].completion;if(p.type==="throw")throw p.arg;return this.rval},dispatchException:function(p){if(this.done)throw p;var d=this;function y(at,$e){return T.type="throw",T.arg=p,d.next=at,$e&&(d.method="next",d.arg=r),!!$e}for(var F=this.tryEntries.length-1;F>=0;--F){var C=this.tryEntries[F],T=C.completion;if(C.tryLoc==="root")return y("end");if(C.tryLoc<=this.prev){var G=s.call(C,"catchLoc"),H=s.call(C,"finallyLoc");if(G&&H){if(this.prev<C.catchLoc)return y(C.catchLoc,!0);if(this.prev<C.finallyLoc)return y(C.finallyLoc)}else if(G){if(this.prev<C.catchLoc)return y(C.catchLoc,!0)}else{if(!H)throw new Error("try statement without catch or finally");if(this.prev<C.finallyLoc)return y(C.finallyLoc)}}}},abrupt:function(p,d){for(var y=this.tryEntries.length-1;y>=0;--y){var F=this.tryEntries[y];if(F.tryLoc<=this.prev&&s.call(F,"finallyLoc")&&this.prev<F.finallyLoc){var C=F;break}}C&&(p==="break"||p==="continue")&&C.tryLoc<=d&&d<=C.finallyLoc&&(C=null);var T=C?C.completion:{};return T.type=p,T.arg=d,C?(this.method="next",this.next=C.finallyLoc,S):this.complete(T)},complete:function(p,d){if(p.type==="throw")throw p.arg;return p.type==="break"||p.type==="continue"?this.next=p.arg:p.type==="return"?(this.rval=this.arg=p.arg,this.method="return",this.next="end"):p.type==="normal"&&d&&(this.next=d),S},finish:function(p){for(var d=this.tryEntries.length-1;d>=0;--d){var y=this.tryEntries[d];if(y.finallyLoc===p)return this.complete(y.completion,y.afterLoc),Xs(y),S}},catch:function(p){for(var d=this.tryEntries.length-1;d>=0;--d){var y=this.tryEntries[d];if(y.tryLoc===p){var F=y.completion;if(F.type==="throw"){var C=F.arg;Xs(y)}return C}}throw new Error("illegal catch attempt")},delegateYield:function(p,d,y){return this.delegate={iterator:ei(p),resultName:d,nextLoc:y},this.method==="next"&&(this.arg=r),S}},e}be.exports=ho,be.exports.__esModule=!0,be.exports.default=be.exports});var mo=E((Pm,po)=>{u();var Nr=fo()();po.exports=Nr;try{regeneratorRuntime=Nr}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=Nr:Function("r","regeneratorRuntime = r")(Nr)}});var go=E((td,ai)=>{"use strict";u();var Do=(r,...e)=>new Promise(t=>{t(r(...e))});ai.exports=Do;ai.exports.default=Do});var yo=E((rd,ci)=>{"use strict";u();var kl=go(),Eo=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=kl(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};ci.exports=Eo;ci.exports.default=Eo});var wo=E((sd,li)=>{"use strict";u();var Ao=yo(),Lr=class extends Error{constructor(e){super(),this.value=e}},_l=async(r,e)=>e(await r),Rl=async r=>{let e=await Promise.all(r);if(e[1]===!0)throw new Lr(e[0]);return!1},Co=async(r,e,t)=>{t={concurrency:1/0,preserveOrder:!0,...t};let s=Ao(t.concurrency),i=[...r].map(o=>[o,s(_l,o,e)]),n=Ao(t.preserveOrder?1:1/0);try{await Promise.all(i.map(o=>n(Rl,o)))}catch(o){if(o instanceof Lr)return o.value;throw o}};li.exports=Co;li.exports.default=Co});var Ro=E((id,hi)=>{"use strict";u();var Fo=require("path"),Mr=require("fs"),{promisify:bo}=require("util"),vl=wo(),Bl=bo(Mr.stat),xl=bo(Mr.lstat),So={directory:"isDirectory",file:"isFile"};function ko({type:r}){if(!(r in So))throw new Error(`Invalid type specified: ${r}`)}var _o=(r,e)=>r===void 0||e[So[r]]();hi.exports=async(r,e)=>{e={cwd:process.cwd(),type:"file",allowSymlinks:!0,...e},ko(e);let t=e.allowSymlinks?Bl:xl;return vl(r,async s=>{try{let i=await t(Fo.resolve(e.cwd,s));return _o(e.type,i)}catch{return!1}},e)};hi.exports.sync=(r,e)=>{e={cwd:process.cwd(),allowSymlinks:!0,type:"file",...e},ko(e);let t=e.allowSymlinks?Mr.statSync:Mr.lstatSync;for(let s of r)try{let i=t(Fo.resolve(e.cwd,s));if(_o(e.type,i))return s}catch{}}});var Bo=E((nd,fi)=>{"use strict";u();var vo=require("fs"),{promisify:Ol}=require("util"),Pl=Ol(vo.access);fi.exports=async r=>{try{return await Pl(r),!0}catch{return!1}};fi.exports.sync=r=>{try{return vo.accessSync(r),!0}catch{return!1}}});var Oo=E((od,xt)=>{"use strict";u();var We=require("path"),Ir=Ro(),xo=Bo(),pi=Symbol("findUp.stop");xt.exports=async(r,e={})=>{let t=We.resolve(e.cwd||""),{root:s}=We.parse(t),i=[].concat(r),n=async o=>{if(typeof r!="function")return Ir(i,o);let a=await r(o.cwd);return typeof a=="string"?Ir([a],o):a};for(;;){let o=await n({...e,cwd:t});if(o===pi)return;if(o)return We.resolve(t,o);if(t===s)return;t=We.dirname(t)}};xt.exports.sync=(r,e={})=>{let t=We.resolve(e.cwd||""),{root:s}=We.parse(t),i=[].concat(r),n=o=>{if(typeof r!="function")return Ir.sync(i,o);let a=r(o.cwd);return typeof a=="string"?Ir.sync([a],o):a};for(;;){let o=n({...e,cwd:t});if(o===pi)return;if(o)return We.resolve(t,o);if(t===s)return;t=We.dirname(t)}};xt.exports.exists=xo;xt.exports.sync.exists=xo.sync;xt.exports.stop=pi});var Pt=E((Td,qo)=>{"use strict";u();var Uo=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"]]);qo.exports=r=>r?Object.keys(r).map(e=>[Uo.has(e)?Uo.get(e):e,r[e]]).reduce((e,t)=>(e[t[0]]=t[1],e),Object.create(null)):{}});var Hr=E((Nd,Ko)=>{"use strict";u();var $o=typeof process=="object"&&process?process:{stdout:null,stderr:null},th=require("events"),Wo=require("stream"),zo=require("string_decoder").StringDecoder,ke=Symbol("EOF"),_e=Symbol("maybeEmitEnd"),ze=Symbol("emittedEnd"),qr=Symbol("emittingEnd"),lr=Symbol("emittedError"),$r=Symbol("closed"),Go=Symbol("read"),Wr=Symbol("flush"),Ho=Symbol("flushChunk"),J=Symbol("encoding"),Re=Symbol("decoder"),zr=Symbol("flowing"),hr=Symbol("paused"),Tt=Symbol("resume"),N=Symbol("buffer"),De=Symbol("pipes"),I=Symbol("bufferLength"),gi=Symbol("bufferPush"),Ei=Symbol("bufferShift"),U=Symbol("objectMode"),q=Symbol("destroyed"),yi=Symbol("emitData"),Jo=Symbol("emitEnd"),Ai=Symbol("emitEnd2"),ve=Symbol("async"),fr=r=>Promise.resolve().then(r),Vo=global._MP_NO_ITERATOR_SYMBOLS_!=="1",rh=Vo&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),sh=Vo&&Symbol.iterator||Symbol("iterator not implemented"),ih=r=>r==="end"||r==="finish"||r==="prefinish",nh=r=>r instanceof ArrayBuffer||typeof r=="object"&&r.constructor&&r.constructor.name==="ArrayBuffer"&&r.byteLength>=0,oh=r=>!Buffer.isBuffer(r)&&ArrayBuffer.isView(r),Gr=class{constructor(e,t,s){this.src=e,this.dest=t,this.opts=s,this.ondrain=()=>e[Tt](),t.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},Ci=class extends Gr{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)}};Ko.exports=class Yo extends Wo{constructor(e){super(),this[zr]=!1,this[hr]=!1,this[De]=[],this[N]=[],this[U]=e&&e.objectMode||!1,this[U]?this[J]=null:this[J]=e&&e.encoding||null,this[J]==="buffer"&&(this[J]=null),this[ve]=e&&!!e.async||!1,this[Re]=this[J]?new zo(this[J]):null,this[ke]=!1,this[ze]=!1,this[qr]=!1,this[$r]=!1,this[lr]=null,this.writable=!0,this.readable=!0,this[I]=0,this[q]=!1,e&&e.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[N]}),e&&e.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[De]})}get bufferLength(){return this[I]}get encoding(){return this[J]}set encoding(e){if(this[U])throw new Error("cannot set encoding in objectMode");if(this[J]&&e!==this[J]&&(this[Re]&&this[Re].lastNeed||this[I]))throw new Error("cannot change encoding");this[J]!==e&&(this[Re]=e?new zo(e):null,this[N].length&&(this[N]=this[N].map(t=>this[Re].write(t)))),this[J]=e}setEncoding(e){this.encoding=e}get objectMode(){return this[U]}set objectMode(e){this[U]=this[U]||!!e}get async(){return this[ve]}set async(e){this[ve]=this[ve]||!!e}write(e,t,s){if(this[ke])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[ve]?fr:n=>n();return!this[U]&&!Buffer.isBuffer(e)&&(oh(e)?e=Buffer.from(e.buffer,e.byteOffset,e.byteLength):nh(e)?e=Buffer.from(e):typeof e!="string"&&(this.objectMode=!0)),this[U]?(this.flowing&&this[I]!==0&&this[Wr](!0),this.flowing?this.emit("data",e):this[gi](e),this[I]!==0&&this.emit("readable"),s&&i(s),this.flowing):e.length?(typeof e=="string"&&!(t===this[J]&&!this[Re].lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[J]&&(e=this[Re].write(e)),this.flowing&&this[I]!==0&&this[Wr](!0),this.flowing?this.emit("data",e):this[gi](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[_e](),null;this[U]&&(e=null),this[N].length>1&&!this[U]&&(this.encoding?this[N]=[this[N].join("")]:this[N]=[Buffer.concat(this[N],this[I])]);let t=this[Go](e||null,this[N][0]);return this[_e](),t}[Go](e,t){return e===t.length||e===null?this[Ei]():(this[N][0]=t.slice(e),t=t.slice(0,e),this[I]-=e),this.emit("data",t),!this[N].length&&!this[ke]&&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[ke]=!0,this.writable=!1,(this.flowing||!this[hr])&&this[_e](),this}[Tt](){this[q]||(this[hr]=!1,this[zr]=!0,this.emit("resume"),this[N].length?this[Wr]():this[ke]?this[_e]():this.emit("drain"))}resume(){return this[Tt]()}pause(){this[zr]=!1,this[hr]=!0}get destroyed(){return this[q]}get flowing(){return this[zr]}get paused(){return this[hr]}[gi](e){this[U]?this[I]+=1:this[I]+=e.length,this[N].push(e)}[Ei](){return this[N].length&&(this[U]?this[I]-=1:this[I]-=this[N][0].length),this[N].shift()}[Wr](e){do;while(this[Ho](this[Ei]()));!e&&!this[N].length&&!this[ke]&&this.emit("drain")}[Ho](e){return e?(this.emit("data",e),this.flowing):!1}pipe(e,t){if(this[q])return;let s=this[ze];return t=t||{},e===$o.stdout||e===$o.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,s?t.end&&e.end():(this[De].push(t.proxyErrors?new Ci(this,e,t):new Gr(this,e,t)),this[ve]?fr(()=>this[Tt]()):this[Tt]()),e}unpipe(e){let t=this[De].find(s=>s.dest===e);t&&(this[De].splice(this[De].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[De].length&&!this.flowing?this[Tt]():e==="readable"&&this[I]!==0?super.emit("readable"):ih(e)&&this[ze]?(super.emit(e),this.removeAllListeners(e)):e==="error"&&this[lr]&&(this[ve]?fr(()=>t.call(this,this[lr])):t.call(this,this[lr])),s}get emittedEnd(){return this[ze]}[_e](){!this[qr]&&!this[ze]&&!this[q]&&this[N].length===0&&this[ke]&&(this[qr]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[$r]&&this.emit("close"),this[qr]=!1)}emit(e,t,...s){if(e!=="error"&&e!=="close"&&e!==q&&this[q])return;if(e==="data")return t?this[ve]?fr(()=>this[yi](t)):this[yi](t):!1;if(e==="end")return this[Jo]();if(e==="close"){if(this[$r]=!0,!this[ze]&&!this[q])return;let n=super.emit("close");return this.removeAllListeners("close"),n}else if(e==="error"){this[lr]=t;let n=super.emit("error",t);return this[_e](),n}else if(e==="resume"){let n=super.emit("resume");return this[_e](),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[_e](),i}[yi](e){for(let s of this[De])s.dest.write(e)===!1&&this.pause();let t=super.emit("data",e);return this[_e](),t}[Jo](){this[ze]||(this[ze]=!0,this.readable=!1,this[ve]?fr(()=>this[Ai]()):this[Ai]())}[Ai](){if(this[Re]){let t=this[Re].end();if(t){for(let s of this[De])s.dest.write(t);super.emit("data",t)}}for(let t of this[De])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[J]?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())})}[rh](){return{next:()=>{let t=this.read();if(t!==null)return Promise.resolve({done:!1,value:t});if(this[ke])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[ke]})},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)})}}}[sh](){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[N].length=0,this[I]=0,typeof this.close=="function"&&!this[$r]&&this.close(),e?this.emit("error",e):this.emit(q),this)}static isStream(e){return!!e&&(e instanceof Yo||e instanceof Wo||e instanceof th&&(typeof e.pipe=="function"||typeof e.write=="function"&&typeof e.end=="function"))}}});var Xo=E((Ld,Zo)=>{u();var uh=require("zlib").constants||{ZLIB_VERNUM:4736};Zo.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},uh))});var _i=E((Md,uu)=>{"use strict";u();var Qo=typeof process=="object"&&process?process:{stdout:null,stderr:null},ah=require("events"),eu=require("stream"),tu=require("string_decoder").StringDecoder,Be=Symbol("EOF"),xe=Symbol("maybeEmitEnd"),Ge=Symbol("emittedEnd"),Jr=Symbol("emittingEnd"),pr=Symbol("emittedError"),Vr=Symbol("closed"),ru=Symbol("read"),Yr=Symbol("flush"),su=Symbol("flushChunk"),V=Symbol("encoding"),Oe=Symbol("decoder"),Kr=Symbol("flowing"),mr=Symbol("paused"),Nt=Symbol("resume"),j=Symbol("bufferLength"),wi=Symbol("bufferPush"),Fi=Symbol("bufferShift"),$=Symbol("objectMode"),W=Symbol("destroyed"),bi=Symbol("emitData"),iu=Symbol("emitEnd"),Si=Symbol("emitEnd2"),Pe=Symbol("async"),dr=r=>Promise.resolve().then(r),nu=global._MP_NO_ITERATOR_SYMBOLS_!=="1",ch=nu&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),lh=nu&&Symbol.iterator||Symbol("iterator not implemented"),hh=r=>r==="end"||r==="finish"||r==="prefinish",fh=r=>r instanceof ArrayBuffer||typeof r=="object"&&r.constructor&&r.constructor.name==="ArrayBuffer"&&r.byteLength>=0,ph=r=>!Buffer.isBuffer(r)&&ArrayBuffer.isView(r),Zr=class{constructor(e,t,s){this.src=e,this.dest=t,this.opts=s,this.ondrain=()=>e[Nt](),t.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},ki=class extends Zr{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)}};uu.exports=class ou extends eu{constructor(e){super(),this[Kr]=!1,this[mr]=!1,this.pipes=[],this.buffer=[],this[$]=e&&e.objectMode||!1,this[$]?this[V]=null:this[V]=e&&e.encoding||null,this[V]==="buffer"&&(this[V]=null),this[Pe]=e&&!!e.async||!1,this[Oe]=this[V]?new tu(this[V]):null,this[Be]=!1,this[Ge]=!1,this[Jr]=!1,this[Vr]=!1,this[pr]=null,this.writable=!0,this.readable=!0,this[j]=0,this[W]=!1}get bufferLength(){return this[j]}get encoding(){return this[V]}set encoding(e){if(this[$])throw new Error("cannot set encoding in objectMode");if(this[V]&&e!==this[V]&&(this[Oe]&&this[Oe].lastNeed||this[j]))throw new Error("cannot change encoding");this[V]!==e&&(this[Oe]=e?new tu(e):null,this.buffer.length&&(this.buffer=this.buffer.map(t=>this[Oe].write(t)))),this[V]=e}setEncoding(e){this.encoding=e}get objectMode(){return this[$]}set objectMode(e){this[$]=this[$]||!!e}get async(){return this[Pe]}set async(e){this[Pe]=this[Pe]||!!e}write(e,t,s){if(this[Be])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[Pe]?dr:n=>n();return!this[$]&&!Buffer.isBuffer(e)&&(ph(e)?e=Buffer.from(e.buffer,e.byteOffset,e.byteLength):fh(e)?e=Buffer.from(e):typeof e!="string"&&(this.objectMode=!0)),this[$]?(this.flowing&&this[j]!==0&&this[Yr](!0),this.flowing?this.emit("data",e):this[wi](e),this[j]!==0&&this.emit("readable"),s&&i(s),this.flowing):e.length?(typeof e=="string"&&!(t===this[V]&&!this[Oe].lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[V]&&(e=this[Oe].write(e)),this.flowing&&this[j]!==0&&this[Yr](!0),this.flowing?this.emit("data",e):this[wi](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[xe](),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[ru](e||null,this.buffer[0]);return this[xe](),t}[ru](e,t){return e===t.length||e===null?this[Fi]():(this.buffer[0]=t.slice(e),t=t.slice(0,e),this[j]-=e),this.emit("data",t),!this.buffer.length&&!this[Be]&&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[Be]=!0,this.writable=!1,(this.flowing||!this[mr])&&this[xe](),this}[Nt](){this[W]||(this[mr]=!1,this[Kr]=!0,this.emit("resume"),this.buffer.length?this[Yr]():this[Be]?this[xe]():this.emit("drain"))}resume(){return this[Nt]()}pause(){this[Kr]=!1,this[mr]=!0}get destroyed(){return this[W]}get flowing(){return this[Kr]}get paused(){return this[mr]}[wi](e){this[$]?this[j]+=1:this[j]+=e.length,this.buffer.push(e)}[Fi](){return this.buffer.length&&(this[$]?this[j]-=1:this[j]-=this.buffer[0].length),this.buffer.shift()}[Yr](e){do;while(this[su](this[Fi]()));!e&&!this.buffer.length&&!this[Be]&&this.emit("drain")}[su](e){return e?(this.emit("data",e),this.flowing):!1}pipe(e,t){if(this[W])return;let s=this[Ge];return t=t||{},e===Qo.stdout||e===Qo.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,s?t.end&&e.end():(this.pipes.push(t.proxyErrors?new ki(this,e,t):new Zr(this,e,t)),this[Pe]?dr(()=>this[Nt]()):this[Nt]()),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[Nt]():e==="readable"&&this[j]!==0?super.emit("readable"):hh(e)&&this[Ge]?(super.emit(e),this.removeAllListeners(e)):e==="error"&&this[pr]&&(this[Pe]?dr(()=>t.call(this,this[pr])):t.call(this,this[pr])),s}get emittedEnd(){return this[Ge]}[xe](){!this[Jr]&&!this[Ge]&&!this[W]&&this.buffer.length===0&&this[Be]&&(this[Jr]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Vr]&&this.emit("close"),this[Jr]=!1)}emit(e,t,...s){if(e!=="error"&&e!=="close"&&e!==W&&this[W])return;if(e==="data")return t?this[Pe]?dr(()=>this[bi](t)):this[bi](t):!1;if(e==="end")return this[iu]();if(e==="close"){if(this[Vr]=!0,!this[Ge]&&!this[W])return;let n=super.emit("close");return this.removeAllListeners("close"),n}else if(e==="error"){this[pr]=t;let n=super.emit("error",t);return this[xe](),n}else if(e==="resume"){let n=super.emit("resume");return this[xe](),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[xe](),i}[bi](e){for(let s of this.pipes)s.dest.write(e)===!1&&this.pause();let t=super.emit("data",e);return this[xe](),t}[iu](){this[Ge]||(this[Ge]=!0,this.readable=!1,this[Pe]?dr(()=>this[Si]()):this[Si]())}[Si](){if(this[Oe]){let t=this[Oe].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[V]?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())})}[ch](){return{next:()=>{let t=this.read();if(t!==null)return Promise.resolve({done:!1,value:t});if(this[Be])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[Be]})},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[Vr]&&this.close(),e?this.emit("error",e):this.emit(W),this)}static isStream(e){return!!e&&(e instanceof ou||e instanceof eu||e instanceof ah&&(typeof e.pipe=="function"||typeof e.write=="function"&&typeof e.end=="function"))}}});var Wi=E(Z=>{"use strict";u();var Oi=require("assert"),He=require("buffer").Buffer,lu=require("zlib"),ht=Z.constants=Xo(),mh=_i(),au=He.concat,ft=Symbol("_superWrite"),Mt=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"}},dh=Symbol("opts"),Dr=Symbol("flushFlag"),cu=Symbol("finishFlushFlag"),$i=Symbol("fullFlushFlag"),B=Symbol("handle"),Xr=Symbol("onError"),Lt=Symbol("sawError"),Ri=Symbol("level"),vi=Symbol("strategy"),Bi=Symbol("ended"),Id=Symbol("_defaultFullFlush"),Qr=class extends mh{constructor(e,t){if(!e||typeof e!="object")throw new TypeError("invalid options for ZlibBase constructor");super(e),this[Lt]=!1,this[Bi]=!1,this[dh]=e,this[Dr]=e.flush,this[cu]=e.finishFlush;try{this[B]=new lu[t](e)}catch(s){throw new Mt(s)}this[Xr]=s=>{this[Lt]||(this[Lt]=!0,this.close(),this.emit("error",s))},this[B].on("error",s=>this[Xr](new Mt(s))),this.once("end",()=>this.close)}close(){this[B]&&(this[B].close(),this[B]=null,this.emit("close"))}reset(){if(!this[Lt])return Oi(this[B],"zlib binding closed"),this[B].reset()}flush(e){this.ended||(typeof e!="number"&&(e=this[$i]),this.write(Object.assign(He.alloc(0),{[Dr]:e})))}end(e,t,s){return e&&this.write(e,t),this.flush(this[cu]),this[Bi]=!0,super.end(null,null,s)}get ended(){return this[Bi]}write(e,t,s){if(typeof t=="function"&&(s=t,t="utf8"),typeof e=="string"&&(e=He.from(e,t)),this[Lt])return;Oi(this[B],"zlib binding closed");let i=this[B]._handle,n=i.close;i.close=()=>{};let o=this[B].close;this[B].close=()=>{},He.concat=c=>c;let a;try{let c=typeof e[Dr]=="number"?e[Dr]:this[Dr];a=this[B]._processChunk(e,c),He.concat=au}catch(c){He.concat=au,this[Xr](new Mt(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[Xr](new Mt(c)));let l;if(a)if(Array.isArray(a)&&a.length>0){l=this[ft](He.from(a[0]));for(let c=1;c<a.length;c++)l=this[ft](a[c])}else l=this[ft](He.from(a));return s&&s(),l}[ft](e){return super.write(e)}},Te=class extends Qr{constructor(e,t){e=e||{},e.flush=e.flush||ht.Z_NO_FLUSH,e.finishFlush=e.finishFlush||ht.Z_FINISH,super(e,t),this[$i]=ht.Z_FULL_FLUSH,this[Ri]=e.level,this[vi]=e.strategy}params(e,t){if(!this[Lt]){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[Ri]!==e||this[vi]!==t){this.flush(ht.Z_SYNC_FLUSH),Oi(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[Ri]=e,this[vi]=t)}}}},Pi=class extends Te{constructor(e){super(e,"Deflate")}},Ti=class extends Te{constructor(e){super(e,"Inflate")}},xi=Symbol("_portable"),Ni=class extends Te{constructor(e){super(e,"Gzip"),this[xi]=e&&!!e.portable}[ft](e){return this[xi]?(this[xi]=!1,e[9]=255,super[ft](e)):super[ft](e)}},Li=class extends Te{constructor(e){super(e,"Gunzip")}},Mi=class extends Te{constructor(e){super(e,"DeflateRaw")}},Ii=class extends Te{constructor(e){super(e,"InflateRaw")}},ji=class extends Te{constructor(e){super(e,"Unzip")}},es=class extends Qr{constructor(e,t){e=e||{},e.flush=e.flush||ht.BROTLI_OPERATION_PROCESS,e.finishFlush=e.finishFlush||ht.BROTLI_OPERATION_FINISH,super(e,t),this[$i]=ht.BROTLI_OPERATION_FLUSH}},Ui=class extends es{constructor(e){super(e,"BrotliCompress")}},qi=class extends es{constructor(e){super(e,"BrotliDecompress")}};Z.Deflate=Pi;Z.Inflate=Ti;Z.Gzip=Ni;Z.Gunzip=Li;Z.DeflateRaw=Mi;Z.InflateRaw=Ii;Z.Unzip=ji;typeof lu.BrotliCompress=="function"?(Z.BrotliCompress=Ui,Z.BrotliDecompress=qi):Z.BrotliCompress=Z.BrotliDecompress=class{constructor(){throw new Error("Brotli is not supported in this version of Node.js")}}});var It=E((qd,hu)=>{u();var Dh=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform;hu.exports=Dh!=="win32"?r=>r:r=>r&&r.replace(/\\/g,"/")});var ts=E((Wd,fu)=>{"use strict";u();var gh=Hr(),zi=It(),Gi=Symbol("slurp");fu.exports=class extends gh{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=zi(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=zi(e.linkpath),this.uname=e.uname,this.gname=e.gname,t&&this[Gi](t),s&&this[Gi](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))}[Gi](e,t){for(let s in e)e[s]!==null&&e[s]!==void 0&&!(t&&s==="path")&&(this[s]=s==="path"||s==="linkpath"?zi(e[s]):e[s])}}});var Hi=E(rs=>{"use strict";u();rs.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"]]);rs.code=new Map(Array.from(rs.name).map(r=>[r[1],r[0]]))});var Du=E((Gd,du)=>{"use strict";u();var Eh=(r,e)=>{if(Number.isSafeInteger(r))r<0?Ah(r,e):yh(r,e);else throw Error("cannot encode number outside of javascript safe integer range");return e},yh=(r,e)=>{e[0]=128;for(var t=e.length;t>1;t--)e[t-1]=r&255,r=Math.floor(r/256)},Ah=(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]=pu(i):i===0?e[s-1]=0:(t=!0,e[s-1]=mu(i))}},Ch=r=>{let e=r[0],t=e===128?Fh(r.slice(1,r.length)):e===255?wh(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},wh=r=>{for(var e=r.length,t=0,s=!1,i=e-1;i>-1;i--){var n=r[i],o;s?o=pu(n):n===0?o=n:(s=!0,o=mu(n)),o!==0&&(t-=o*Math.pow(256,e-i-1))}return t},Fh=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},pu=r=>(255^r)&255,mu=r=>(255^r)+1&255;du.exports={encode:Eh,parse:Ch}});var Ut=E((Hd,Eu)=>{"use strict";u();var Ji=Hi(),jt=require("path").posix,gu=Du(),Vi=Symbol("slurp"),X=Symbol("type"),Zi=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[X]="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=pt(e,t,100),this.mode=Je(e,t+100,8),this.uid=Je(e,t+108,8),this.gid=Je(e,t+116,8),this.size=Je(e,t+124,12),this.mtime=Yi(e,t+136,12),this.cksum=Je(e,t+148,12),this[Vi](s),this[Vi](i,!0),this[X]=pt(e,t+156,1),this[X]===""&&(this[X]="0"),this[X]==="0"&&this.path.slice(-1)==="/"&&(this[X]="5"),this[X]==="5"&&(this.size=0),this.linkpath=pt(e,t+157,100),e.slice(t+257,t+265).toString()==="ustar\x0000")if(this.uname=pt(e,t+265,32),this.gname=pt(e,t+297,32),this.devmaj=Je(e,t+329,8),this.devmin=Je(e,t+337,8),e[t+475]!==0){let o=pt(e,t+345,155);this.path=o+"/"+this.path}else{let o=pt(e,t+345,130);o&&(this.path=o+"/"+this.path),this.atime=Yi(e,t+476,12),this.ctime=Yi(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)}[Vi](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=bh(this.path||"",s),n=i[0],o=i[1];this.needPax=i[2],this.needPax=mt(e,t,100,n)||this.needPax,this.needPax=Ve(e,t+100,8,this.mode)||this.needPax,this.needPax=Ve(e,t+108,8,this.uid)||this.needPax,this.needPax=Ve(e,t+116,8,this.gid)||this.needPax,this.needPax=Ve(e,t+124,12,this.size)||this.needPax,this.needPax=Ki(e,t+136,12,this.mtime)||this.needPax,e[t+156]=this[X].charCodeAt(0),this.needPax=mt(e,t+157,100,this.linkpath)||this.needPax,e.write("ustar\x0000",t+257,8),this.needPax=mt(e,t+265,32,this.uname)||this.needPax,this.needPax=mt(e,t+297,32,this.gname)||this.needPax,this.needPax=Ve(e,t+329,8,this.devmaj)||this.needPax,this.needPax=Ve(e,t+337,8,this.devmin)||this.needPax,this.needPax=mt(e,t+345,s,o)||this.needPax,e[t+475]!==0?this.needPax=mt(e,t+345,155,o)||this.needPax:(this.needPax=mt(e,t+345,130,o)||this.needPax,this.needPax=Ki(e,t+476,12,this.atime)||this.needPax,this.needPax=Ki(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,Ve(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 Ji.name.get(this[X])||this[X]}get typeKey(){return this[X]}set type(e){Ji.code.has(e)?this[X]=Ji.code.get(e):this[X]=e}},bh=(r,e)=>{let s=r,i="",n,o=jt.parse(r).root||".";if(Buffer.byteLength(s)<100)n=[s,i,!1];else{i=jt.dirname(s),s=jt.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=jt.join(jt.basename(i),s),i=jt.dirname(i));while(i!==o&&!n);n||(n=[r.slice(0,100-1),"",!0])}return n},pt=(r,e,t)=>r.slice(e,e+t).toString("utf8").replace(/\0.*/,""),Yi=(r,e,t)=>Sh(Je(r,e,t)),Sh=r=>r===null?null:new Date(r*1e3),Je=(r,e,t)=>r[e]&128?gu.parse(r.slice(e,e+t)):_h(r,e,t),kh=r=>isNaN(r)?null:r,_h=(r,e,t)=>kh(parseInt(r.slice(e,e+t).toString("utf8").replace(/\0.*$/,"").trim(),8)),Rh={12:8589934591,8:2097151},Ve=(r,e,t,s)=>s===null?!1:s>Rh[t]||s<0?(gu.encode(s,r.slice(e,e+t)),!0):(vh(r,e,t,s),!1),vh=(r,e,t,s)=>r.write(Bh(s,t),e,t,"ascii"),Bh=(r,e)=>xh(Math.floor(r).toString(8),e),xh=(r,e)=>(r.length===e-1?r:new Array(e-r.length-1).join("0")+r+" ")+"\0",Ki=(r,e,t,s)=>s===null?!1:Ve(r,e,t,s.getTime()/1e3),Oh=new Array(156).join("\0"),mt=(r,e,t,s)=>s===null?!1:(r.write(s+Oh,e,t,"utf8"),s.length!==Buffer.byteLength(s)||s.length>t);Eu.exports=Zi});var ss=E((Jd,yu)=>{"use strict";u();var Ph=Ut(),Th=require("path"),gr=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 Ph({path:("PaxHeader/"+Th.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+`
|
|
2
|
+
`,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}};gr.parse=(r,e,t)=>new gr(Nh(Lh(r),e),t);var Nh=(r,e)=>e?Object.keys(r).reduce((t,s)=>(t[s]=r[s],t),e):r,Lh=r=>r.replace(/\n$/,"").split(`
|
|
3
|
+
`).reduce(Mh,Object.create(null)),Mh=(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};yu.exports=gr});var qt=E((Vd,Au)=>{u();Au.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 is=E((Yd,Cu)=>{"use strict";u();Cu.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 Qi=E((Zd,wu)=>{"use strict";u();var ns=["|","<",">","?",":"],Xi=ns.map(r=>String.fromCharCode(61440+r.charCodeAt(0))),Ih=new Map(ns.map((r,e)=>[r,Xi[e]])),jh=new Map(Xi.map((r,e)=>[r,ns[e]]));wu.exports={encode:r=>ns.reduce((e,t)=>e.split(t).join(Ih.get(t)),r),decode:r=>Xi.reduce((e,t)=>e.split(t).join(jh.get(t)),r)}});var en=E((Xd,bu)=>{u();var{isAbsolute:Uh,parse:Fu}=require("path").win32;bu.exports=r=>{let e="",t=Fu(r);for(;Uh(r)||t.root;){let s=r.charAt(0)==="/"&&r.slice(0,4)!=="//?/"?"/":t.root;r=r.slice(s.length),e+=s,t=Fu(r)}return[e,r]}});var ku=E((Qd,Su)=>{"use strict";u();Su.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 hn=E((r0,Uu)=>{"use strict";u();var Pu=Hr(),Tu=ss(),Nu=Ut(),Ee=require("fs"),_u=require("path"),ge=It(),qh=qt(),Lu=(r,e)=>e?(r=ge(r).replace(/^\.(\/|$)/,""),qh(e)+"/"+r):ge(r),$h=16*1024*1024,Ru=Symbol("process"),vu=Symbol("file"),Bu=Symbol("directory"),rn=Symbol("symlink"),xu=Symbol("hardlink"),Er=Symbol("header"),os=Symbol("read"),sn=Symbol("lstat"),us=Symbol("onlstat"),nn=Symbol("onread"),on=Symbol("onreadlink"),un=Symbol("openfile"),an=Symbol("onopenfile"),Ye=Symbol("close"),as=Symbol("mode"),cn=Symbol("awaitDrain"),tn=Symbol("ondrain"),ye=Symbol("prefix"),Ou=Symbol("hadError"),Mu=is(),Wh=Qi(),Iu=en(),ju=ku(),cs=Mu(class extends Pu{constructor(e,t){if(t=t||{},super(t),typeof e!="string")throw new TypeError("path is required");this.path=ge(e),this.portable=!!t.portable,this.myuid=process.getuid&&process.getuid()||0,this.myuser=process.env.USER||"",this.maxReadSize=t.maxReadSize||$h,this.linkCache=t.linkCache||new Map,this.statCache=t.statCache||new Map,this.preservePaths=!!t.preservePaths,this.cwd=ge(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?ge(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]=Iu(this.path);i&&(this.path=n,s=i)}this.win32=!!t.win32||process.platform==="win32",this.win32&&(this.path=Wh.decode(this.path.replace(/\\/g,"/")),e=e.replace(/\\/g,"/")),this.absolute=ge(t.absolute||_u.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[us](this.statCache.get(this.absolute)):this[sn]()}emit(e,...t){return e==="error"&&(this[Ou]=!0),super.emit(e,...t)}[sn](){Ee.lstat(this.absolute,(e,t)=>{if(e)return this.emit("error",e);this[us](t)})}[us](e){this.statCache.set(this.absolute,e),this.stat=e,e.isFile()||(e.size=0),this.type=Gh(e),this.emit("stat",e),this[Ru]()}[Ru](){switch(this.type){case"File":return this[vu]();case"Directory":return this[Bu]();case"SymbolicLink":return this[rn]();default:return this.end()}}[as](e){return ju(e,this.type==="Directory",this.portable)}[ye](e){return Lu(e,this.prefix)}[Er](){this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.header=new Nu({path:this[ye](this.path),linkpath:this.type==="Link"?this[ye](this.linkpath):this.linkpath,mode:this[as](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 Tu({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[ye](this.path),linkpath:this.type==="Link"?this[ye](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)}[Bu](){this.path.slice(-1)!=="/"&&(this.path+="/"),this.stat.size=0,this[Er](),this.end()}[rn](){Ee.readlink(this.absolute,(e,t)=>{if(e)return this.emit("error",e);this[on](t)})}[on](e){this.linkpath=ge(e),this[Er](),this.end()}[xu](e){this.type="Link",this.linkpath=ge(_u.relative(this.cwd,e)),this.stat.size=0,this[Er](),this.end()}[vu](){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[xu](t)}this.linkCache.set(e,this.absolute)}if(this[Er](),this.stat.size===0)return this.end();this[un]()}[un](){Ee.open(this.absolute,"r",(e,t)=>{if(e)return this.emit("error",e);this[an](t)})}[an](e){if(this.fd=e,this[Ou])return this[Ye]();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[os]()}[os](){let{fd:e,buf:t,offset:s,length:i,pos:n}=this;Ee.read(e,t,s,i,n,(o,a)=>{if(o)return this[Ye](()=>this.emit("error",o));this[nn](a)})}[Ye](e){Ee.close(this.fd,e)}[nn](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[Ye](()=>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[Ye](()=>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[tn]():this[cn](()=>this[tn]())}[cn](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)}[tn](){if(!this.remain)return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),this[Ye](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[os]()}}),ln=class extends cs{[sn](){this[us](Ee.lstatSync(this.absolute))}[rn](){this[on](Ee.readlinkSync(this.absolute))}[un](){this[an](Ee.openSync(this.absolute,"r"))}[os](){let e=!0;try{let{fd:t,buf:s,offset:i,length:n,pos:o}=this,a=Ee.readSync(t,s,i,n,o);this[nn](a),e=!1}finally{if(e)try{this[Ye](()=>{})}catch{}}}[cn](e){e()}[Ye](e){Ee.closeSync(this.fd),e()}},zh=Mu(class extends Pu{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=ge(e.path),this.mode=this[as](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=ge(e.linkpath),typeof t.onwarn=="function"&&this.on("warn",t.onwarn);let s=!1;if(!this.preservePaths){let[i,n]=Iu(this.path);i&&(this.path=n,s=i)}this.remain=e.size,this.blockRemain=e.startBlockSize,this.header=new Nu({path:this[ye](this.path),linkpath:this.type==="Link"?this[ye](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 Tu({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[ye](this.path),linkpath:this.type==="Link"?this[ye](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)}[ye](e){return Lu(e,this.prefix)}[as](e){return ju(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()}});cs.Sync=ln;cs.Tar=zh;var Gh=r=>r.isFile()?"File":r.isDirectory()?"Directory":r.isSymbolicLink()?"SymbolicLink":"Unsupported";Uu.exports=cs});var $u=E((s0,qu)=>{"use strict";u();qu.exports=function(r){r.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}});var fn=E((i0,Wu)=>{"use strict";u();Wu.exports=k;k.Node=dt;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++)Jh(this,arguments[r]);return this.length};k.prototype.unshift=function(){for(var r=0,e=arguments.length;r<e;r++)Vh(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=Hh(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 Hh(r,e,t){var s=e===r.head?new dt(t,null,e,r):new dt(t,e,e.next,r);return s.next===null&&(r.tail=s),s.prev===null&&(r.head=s),r.length++,s}function Jh(r,e){r.tail=new dt(e,r.tail,null,r),r.head||(r.head=r.tail),r.length++}function Vh(r,e){r.head=new dt(e,null,r.head,r),r.tail||(r.tail=r.head),r.length++}function dt(r,e,t,s){if(!(this instanceof dt))return new dt(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{$u()(k)}catch{}});var Es=E((o0,Ku)=>{"use strict";u();var Ds=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}},Yh=Hr(),Kh=Wi(),Zh=ts(),Cn=hn(),Xh=Cn.Sync,Qh=Cn.Tar,ef=fn(),zu=Buffer.alloc(1024),fs=Symbol("onStat"),ls=Symbol("ended"),Ae=Symbol("queue"),$t=Symbol("current"),Dt=Symbol("process"),hs=Symbol("processing"),Gu=Symbol("processJob"),Ce=Symbol("jobs"),pn=Symbol("jobDone"),ps=Symbol("addFSEntry"),Hu=Symbol("addTarEntry"),gn=Symbol("stat"),En=Symbol("readdir"),ms=Symbol("onreaddir"),ds=Symbol("pipe"),Ju=Symbol("entry"),mn=Symbol("entryOpt"),yn=Symbol("writeEntryClass"),Yu=Symbol("write"),dn=Symbol("ondrain"),gs=require("fs"),Vu=require("path"),tf=is(),Dn=It(),wn=tf(class extends Yh{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=Dn(e.prefix||""),this.linkCache=e.linkCache||new Map,this.statCache=e.statCache||new Map,this.readdirCache=e.readdirCache||new Map,this[yn]=Cn,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 Kh.Gzip(e.gzip),this.zip.on("data",t=>super.write(t)),this.zip.on("end",t=>super.end()),this.zip.on("drain",t=>this[dn]()),this.on("resume",t=>this.zip.resume())):this.on("drain",this[dn]),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[Ae]=new ef,this[Ce]=0,this.jobs=+e.jobs||4,this[hs]=!1,this[ls]=!1}[Yu](e){return super.write(e)}add(e){return this.write(e),this}end(e){return e&&this.write(e),this[ls]=!0,this[Dt](),this}write(e){if(this[ls])throw new Error("write after end");return e instanceof Zh?this[Hu](e):this[ps](e),this.flowing}[Hu](e){let t=Dn(Vu.resolve(this.cwd,e.path));if(!this.filter(e.path,e))e.resume();else{let s=new Ds(e.path,t,!1);s.entry=new Qh(e,this[mn](s)),s.entry.on("end",i=>this[pn](s)),this[Ce]+=1,this[Ae].push(s)}this[Dt]()}[ps](e){let t=Dn(Vu.resolve(this.cwd,e));this[Ae].push(new Ds(e,t)),this[Dt]()}[gn](e){e.pending=!0,this[Ce]+=1;let t=this.follow?"stat":"lstat";gs[t](e.absolute,(s,i)=>{e.pending=!1,this[Ce]-=1,s?this.emit("error",s):this[fs](e,i)})}[fs](e,t){this.statCache.set(e.absolute,t),e.stat=t,this.filter(e.path,t)||(e.ignore=!0),this[Dt]()}[En](e){e.pending=!0,this[Ce]+=1,gs.readdir(e.absolute,(t,s)=>{if(e.pending=!1,this[Ce]-=1,t)return this.emit("error",t);this[ms](e,s)})}[ms](e,t){this.readdirCache.set(e.absolute,t),e.readdir=t,this[Dt]()}[Dt](){if(!this[hs]){this[hs]=!0;for(let e=this[Ae].head;e!==null&&this[Ce]<this.jobs;e=e.next)if(this[Gu](e.value),e.value.ignore){let t=e.next;this[Ae].removeNode(e),e.next=t}this[hs]=!1,this[ls]&&!this[Ae].length&&this[Ce]===0&&(this.zip?this.zip.end(zu):(super.write(zu),super.end()))}}get[$t](){return this[Ae]&&this[Ae].head&&this[Ae].head.value}[pn](e){this[Ae].shift(),this[Ce]-=1,this[Dt]()}[Gu](e){if(!e.pending){if(e.entry){e===this[$t]&&!e.piped&&this[ds](e);return}if(e.stat||(this.statCache.has(e.absolute)?this[fs](e,this.statCache.get(e.absolute)):this[gn](e)),!!e.stat&&!e.ignore&&!(!this.noDirRecurse&&e.stat.isDirectory()&&!e.readdir&&(this.readdirCache.has(e.absolute)?this[ms](e,this.readdirCache.get(e.absolute)):this[En](e),!e.readdir))){if(e.entry=this[Ju](e),!e.entry){e.ignore=!0;return}e===this[$t]&&!e.piped&&this[ds](e)}}}[mn](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}}[Ju](e){this[Ce]+=1;try{return new this[yn](e.path,this[mn](e)).on("end",()=>this[pn](e)).on("error",t=>this.emit("error",t))}catch(t){this.emit("error",t)}}[dn](){this[$t]&&this[$t].entry&&this[$t].entry.resume()}[ds](e){e.piped=!0,e.readdir&&e.readdir.forEach(i=>{let n=e.path,o=n==="./"?"":n.replace(/\/*$/,"/");this[ps](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()}}),An=class extends wn{constructor(e){super(e),this[yn]=Xh}pause(){}resume(){}[gn](e){let t=this.follow?"statSync":"lstatSync";this[fs](e,gs[t](e.absolute))}[En](e,t){this[ms](e,gs.readdirSync(e.absolute))}[ds](e){let t=e.entry,s=this.zip;e.readdir&&e.readdir.forEach(i=>{let n=e.path,o=n==="./"?"":n.replace(/\/*$/,"/");this[ps](o+i)}),s?t.on("data",i=>{s.write(i)}):t.on("data",i=>{super[Yu](i)})}};wn.Sync=An;Ku.exports=wn});var Kt=E(Ar=>{"use strict";u();var rf=_i(),sf=require("events").EventEmitter,Y=require("fs"),Sn=Y.writev;if(!Sn){let r=process.binding("fs"),e=r.FSReqWrap||r.FSReqCallback;Sn=(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 Vt=Symbol("_autoClose"),fe=Symbol("_close"),yr=Symbol("_ended"),v=Symbol("_fd"),Zu=Symbol("_finished"),Ze=Symbol("_flags"),Fn=Symbol("_flush"),kn=Symbol("_handleChunk"),_n=Symbol("_makeBuf"),Fs=Symbol("_mode"),ys=Symbol("_needDrain"),Ht=Symbol("_onerror"),Yt=Symbol("_onopen"),bn=Symbol("_onread"),zt=Symbol("_onwrite"),Xe=Symbol("_open"),Ne=Symbol("_path"),gt=Symbol("_pos"),we=Symbol("_queue"),Gt=Symbol("_read"),Xu=Symbol("_readSize"),Ke=Symbol("_reading"),As=Symbol("_remain"),Qu=Symbol("_size"),Cs=Symbol("_write"),Wt=Symbol("_writing"),ws=Symbol("_defaultFlag"),Jt=Symbol("_errored"),bs=class extends rf{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[Jt]=!1,this[v]=typeof t.fd=="number"?t.fd:null,this[Ne]=e,this[Xu]=t.readSize||16*1024*1024,this[Ke]=!1,this[Qu]=typeof t.size=="number"?t.size:1/0,this[As]=this[Qu],this[Vt]=typeof t.autoClose=="boolean"?t.autoClose:!0,typeof this[v]=="number"?this[Gt]():this[Xe]()}get fd(){return this[v]}get path(){return this[Ne]}write(){throw new TypeError("this is a readable stream")}end(){throw new TypeError("this is a readable stream")}[Xe](){Y.open(this[Ne],"r",(e,t)=>this[Yt](e,t))}[Yt](e,t){e?this[Ht](e):(this[v]=t,this.emit("open",t),this[Gt]())}[_n](){return Buffer.allocUnsafe(Math.min(this[Xu],this[As]))}[Gt](){if(!this[Ke]){this[Ke]=!0;let e=this[_n]();if(e.length===0)return process.nextTick(()=>this[bn](null,0,e));Y.read(this[v],e,0,e.length,null,(t,s,i)=>this[bn](t,s,i))}}[bn](e,t,s){this[Ke]=!1,e?this[Ht](e):this[kn](t,s)&&this[Gt]()}[fe](){if(this[Vt]&&typeof this[v]=="number"){let e=this[v];this[v]=null,Y.close(e,t=>t?this.emit("error",t):this.emit("close"))}}[Ht](e){this[Ke]=!0,this[fe](),this.emit("error",e)}[kn](e,t){let s=!1;return this[As]-=e,e>0&&(s=super.write(e<t.length?t.slice(0,e):t)),(e===0||this[As]<=0)&&(s=!1,this[fe](),super.end()),s}emit(e,t){switch(e){case"prefinish":case"finish":break;case"drain":typeof this[v]=="number"&&this[Gt]();break;case"error":return this[Jt]?void 0:(this[Jt]=!0,super.emit(e,t));default:return super.emit(e,t)}}},Rn=class extends bs{[Xe](){let e=!0;try{this[Yt](null,Y.openSync(this[Ne],"r")),e=!1}finally{e&&this[fe]()}}[Gt](){let e=!0;try{if(!this[Ke]){this[Ke]=!0;do{let t=this[_n](),s=t.length===0?0:Y.readSync(this[v],t,0,t.length,null);if(!this[kn](s,t))break}while(!0);this[Ke]=!1}e=!1}finally{e&&this[fe]()}}[fe](){if(this[Vt]&&typeof this[v]=="number"){let e=this[v];this[v]=null,Y.closeSync(e),this.emit("close")}}},Ss=class extends sf{constructor(e,t){t=t||{},super(t),this.readable=!1,this.writable=!0,this[Jt]=!1,this[Wt]=!1,this[yr]=!1,this[ys]=!1,this[we]=[],this[Ne]=e,this[v]=typeof t.fd=="number"?t.fd:null,this[Fs]=t.mode===void 0?438:t.mode,this[gt]=typeof t.start=="number"?t.start:null,this[Vt]=typeof t.autoClose=="boolean"?t.autoClose:!0;let s=this[gt]!==null?"r+":"w";this[ws]=t.flags===void 0,this[Ze]=this[ws]?s:t.flags,this[v]===null&&this[Xe]()}emit(e,t){if(e==="error"){if(this[Jt])return;this[Jt]=!0}return super.emit(e,t)}get fd(){return this[v]}get path(){return this[Ne]}[Ht](e){this[fe](),this[Wt]=!0,this.emit("error",e)}[Xe](){Y.open(this[Ne],this[Ze],this[Fs],(e,t)=>this[Yt](e,t))}[Yt](e,t){this[ws]&&this[Ze]==="r+"&&e&&e.code==="ENOENT"?(this[Ze]="w",this[Xe]()):e?this[Ht](e):(this[v]=t,this.emit("open",t),this[Fn]())}end(e,t){return e&&this.write(e,t),this[yr]=!0,!this[Wt]&&!this[we].length&&typeof this[v]=="number"&&this[zt](null,0),this}write(e,t){return typeof e=="string"&&(e=Buffer.from(e,t)),this[yr]?(this.emit("error",new Error("write() after end()")),!1):this[v]===null||this[Wt]||this[we].length?(this[we].push(e),this[ys]=!0,!1):(this[Wt]=!0,this[Cs](e),!0)}[Cs](e){Y.write(this[v],e,0,e.length,this[gt],(t,s)=>this[zt](t,s))}[zt](e,t){e?this[Ht](e):(this[gt]!==null&&(this[gt]+=t),this[we].length?this[Fn]():(this[Wt]=!1,this[yr]&&!this[Zu]?(this[Zu]=!0,this[fe](),this.emit("finish")):this[ys]&&(this[ys]=!1,this.emit("drain"))))}[Fn](){if(this[we].length===0)this[yr]&&this[zt](null,0);else if(this[we].length===1)this[Cs](this[we].pop());else{let e=this[we];this[we]=[],Sn(this[v],e,this[gt],(t,s)=>this[zt](t,s))}}[fe](){if(this[Vt]&&typeof this[v]=="number"){let e=this[v];this[v]=null,Y.close(e,t=>t?this.emit("error",t):this.emit("close"))}}},vn=class extends Ss{[Xe](){let e;if(this[ws]&&this[Ze]==="r+")try{e=Y.openSync(this[Ne],this[Ze],this[Fs])}catch(t){if(t.code==="ENOENT")return this[Ze]="w",this[Xe]();throw t}else e=Y.openSync(this[Ne],this[Ze],this[Fs]);this[Yt](null,e)}[fe](){if(this[Vt]&&typeof this[v]=="number"){let e=this[v];this[v]=null,Y.closeSync(e),this.emit("close")}}[Cs](e){let t=!0;try{this[zt](null,Y.writeSync(this[v],e,0,e.length,this[gt])),t=!1}finally{if(t)try{this[fe]()}catch{}}}};Ar.ReadStream=bs;Ar.ReadStreamSync=Rn;Ar.WriteStream=Ss;Ar.WriteStreamSync=vn});var Os=E((c0,ua)=>{"use strict";u();var nf=is(),of=Ut(),uf=require("events"),af=fn(),cf=1024*1024,lf=ts(),ea=ss(),hf=Wi(),{nextTick:ff}=require("process"),Bn=Buffer.from([31,139]),ie=Symbol("state"),Et=Symbol("writeEntry"),Le=Symbol("readEntry"),xn=Symbol("nextEntry"),ta=Symbol("processEntry"),ne=Symbol("extendedHeader"),Cr=Symbol("globalExtendedHeader"),Qe=Symbol("meta"),ra=Symbol("emitMeta"),O=Symbol("buffer"),Me=Symbol("queue"),yt=Symbol("ended"),sa=Symbol("emittedEnd"),At=Symbol("emit"),K=Symbol("unzip"),ks=Symbol("consumeChunk"),_s=Symbol("consumeChunkSub"),On=Symbol("consumeBody"),ia=Symbol("consumeMeta"),na=Symbol("consumeHeader"),Rs=Symbol("consuming"),Pn=Symbol("bufferConcat"),Tn=Symbol("maybeEnd"),wr=Symbol("writing"),et=Symbol("aborted"),vs=Symbol("onDone"),Ct=Symbol("sawValidEntry"),Bs=Symbol("sawNullBlock"),xs=Symbol("sawEOF"),oa=Symbol("closeStream"),pf=r=>!0;ua.exports=nf(class extends uf{constructor(e){e=e||{},super(e),this.file=e.file||"",this[Ct]=null,this.on(vs,t=>{(this[ie]==="begin"||this[Ct]===!1)&&this.warn("TAR_BAD_ARCHIVE","Unrecognized archive format")}),e.ondone?this.on(vs,e.ondone):this.on(vs,t=>{this.emit("prefinish"),this.emit("finish"),this.emit("end")}),this.strict=!!e.strict,this.maxMetaEntrySize=e.maxMetaEntrySize||cf,this.filter=typeof e.filter=="function"?e.filter:pf,this.writable=!0,this.readable=!1,this[Me]=new af,this[O]=null,this[Le]=null,this[Et]=null,this[ie]="begin",this[Qe]="",this[ne]=null,this[Cr]=null,this[yt]=!1,this[K]=null,this[et]=!1,this[Bs]=!1,this[xs]=!1,this.on("end",()=>this[oa]()),typeof e.onwarn=="function"&&this.on("warn",e.onwarn),typeof e.onentry=="function"&&this.on("entry",e.onentry)}[na](e,t){this[Ct]===null&&(this[Ct]=!1);let s;try{s=new of(e,t,this[ne],this[Cr])}catch(i){return this.warn("TAR_ENTRY_INVALID",i)}if(s.nullBlock)this[Bs]?(this[xs]=!0,this[ie]==="begin"&&(this[ie]="header"),this[At]("eof")):(this[Bs]=!0,this[At]("nullBlock"));else if(this[Bs]=!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[Et]=new lf(s,this[ne],this[Cr]);if(!this[Ct])if(n.remain){let o=()=>{n.invalid||(this[Ct]=!0)};n.on("end",o)}else this[Ct]=!0;n.meta?n.size>this.maxMetaEntrySize?(n.ignore=!0,this[At]("ignoredEntry",n),this[ie]="ignore",n.resume()):n.size>0&&(this[Qe]="",n.on("data",o=>this[Qe]+=o),this[ie]="meta"):(this[ne]=null,n.ignore=n.ignore||!this.filter(n.path,n),n.ignore?(this[At]("ignoredEntry",n),this[ie]=n.remain?"ignore":"header",n.resume()):(n.remain?this[ie]="body":(this[ie]="header",n.end()),this[Le]?this[Me].push(n):(this[Me].push(n),this[xn]())))}}}[oa](){ff(()=>this.emit("close"))}[ta](e){let t=!0;return e?Array.isArray(e)?this.emit.apply(this,e):(this[Le]=e,this.emit("entry",e),e.emittedEnd||(e.on("end",s=>this[xn]()),t=!1)):(this[Le]=null,t=!1),t}[xn](){do;while(this[ta](this[Me].shift()));if(!this[Me].length){let e=this[Le];!e||e.flowing||e.size===e.remain?this[wr]||this.emit("drain"):e.once("drain",s=>this.emit("drain"))}}[On](e,t){let s=this[Et],i=s.blockRemain,n=i>=e.length&&t===0?e:e.slice(t,t+i);return s.write(n),s.blockRemain||(this[ie]="header",this[Et]=null,s.end()),n.length}[ia](e,t){let s=this[Et],i=this[On](e,t);return this[Et]||this[ra](s),i}[At](e,t,s){!this[Me].length&&!this[Le]?this.emit(e,t,s):this[Me].push([e,t,s])}[ra](e){switch(this[At]("meta",this[Qe]),e.type){case"ExtendedHeader":case"OldExtendedHeader":this[ne]=ea.parse(this[Qe],this[ne],!1);break;case"GlobalExtendedHeader":this[Cr]=ea.parse(this[Qe],this[Cr],!0);break;case"NextFileHasLongPath":case"OldGnuLongPath":this[ne]=this[ne]||Object.create(null),this[ne].path=this[Qe].replace(/\0.*/,"");break;case"NextFileHasLongLinkpath":this[ne]=this[ne]||Object.create(null),this[ne].linkpath=this[Qe].replace(/\0.*/,"");break;default:throw new Error("unknown meta: "+e.type)}}abort(e){this[et]=!0,this.emit("abort",e),this.warn("TAR_ABORT",e,{recoverable:!1})}write(e){if(this[et])return;if(this[K]===null&&e){if(this[O]&&(e=Buffer.concat([this[O],e]),this[O]=null),e.length<Bn.length)return this[O]=e,!0;for(let s=0;this[K]===null&&s<Bn.length;s++)e[s]!==Bn[s]&&(this[K]=!1);if(this[K]===null){let s=this[yt];this[yt]=!1,this[K]=new hf.Unzip,this[K].on("data",n=>this[ks](n)),this[K].on("error",n=>this.abort(n)),this[K].on("end",n=>{this[yt]=!0,this[ks]()}),this[wr]=!0;let i=this[K][s?"end":"write"](e);return this[wr]=!1,i}}this[wr]=!0,this[K]?this[K].write(e):this[ks](e),this[wr]=!1;let t=this[Me].length?!1:this[Le]?this[Le].flowing:!0;return!t&&!this[Me].length&&this[Le].once("drain",s=>this.emit("drain")),t}[Pn](e){e&&!this[et]&&(this[O]=this[O]?Buffer.concat([this[O],e]):e)}[Tn](){if(this[yt]&&!this[sa]&&!this[et]&&!this[Rs]){this[sa]=!0;let e=this[Et];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[At](vs)}}[ks](e){if(this[Rs])this[Pn](e);else if(!e&&!this[O])this[Tn]();else{if(this[Rs]=!0,this[O]){this[Pn](e);let t=this[O];this[O]=null,this[_s](t)}else this[_s](e);for(;this[O]&&this[O].length>=512&&!this[et]&&!this[xs];){let t=this[O];this[O]=null,this[_s](t)}this[Rs]=!1}(!this[O]||this[yt])&&this[Tn]()}[_s](e){let t=0,s=e.length;for(;t+512<=s&&!this[et]&&!this[xs];)switch(this[ie]){case"begin":case"header":this[na](e,t),t+=512;break;case"ignore":case"body":t+=this[On](e,t);break;case"meta":t+=this[ia](e,t);break;default:throw new Error("invalid state: "+this[ie])}t<s&&(this[O]?this[O]=Buffer.concat([e.slice(t),this[O]]):this[O]=e.slice(t))}end(e){this[et]||(this[K]?this[K].end(e):(this[yt]=!0,this.write(e)))}})});var Ps=E((l0,ha)=>{"use strict";u();var mf=Pt(),ca=Os(),Zt=require("fs"),df=Kt(),aa=require("path"),Nn=qt();ha.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&&gf(s,e),s.noResume||Df(s),s.file&&s.sync?Ef(s):s.file?yf(s,t):la(s)};var Df=r=>{let e=r.onentry;r.onentry=e?t=>{e(t),t.resume()}:t=>t.resume()},gf=(r,e)=>{let t=new Map(e.map(n=>[Nn(n),!0])),s=r.filter,i=(n,o)=>{let a=o||aa.parse(n).root||".",l=n===a?!1:t.has(n)?t.get(n):i(aa.dirname(n),a);return t.set(n,l),l};r.filter=s?(n,o)=>s(n,o)&&i(Nn(n)):n=>i(Nn(n))},Ef=r=>{let e=la(r),t=r.file,s=!0,i;try{let n=Zt.statSync(t),o=r.maxReadSize||16*1024*1024;if(n.size<o)e.end(Zt.readFileSync(t));else{let a=0,l=Buffer.allocUnsafe(o);for(i=Zt.openSync(t,"r");a<n.size;){let c=Zt.readSync(i,l,0,o,a);a+=c,e.write(l.slice(0,c))}e.end()}s=!1}finally{if(s&&i)try{Zt.closeSync(i)}catch{}}},yf=(r,e)=>{let t=new ca(r),s=r.maxReadSize||16*1024*1024,i=r.file,n=new Promise((o,a)=>{t.on("error",a),t.on("end",o),Zt.stat(i,(l,c)=>{if(l)a(l);else{let h=new df.ReadStream(i,{readSize:s,size:c.size});h.on("error",a),h.pipe(t)}})});return e?n.then(e,e):n},la=r=>new ca(r)});var ga=E((h0,Da)=>{"use strict";u();var Af=Pt(),Ts=Es(),fa=Kt(),pa=Ps(),ma=require("path");Da.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=Af(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?Cf(s,e):s.file?wf(s,e,t):s.sync?Ff(s,e):bf(s,e)};var Cf=(r,e)=>{let t=new Ts.Sync(r),s=new fa.WriteStreamSync(r.file,{mode:r.mode||438});t.pipe(s),da(t,e)},wf=(r,e,t)=>{let s=new Ts(r),i=new fa.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 Ln(s,e),t?n.then(t,t):n},da=(r,e)=>{e.forEach(t=>{t.charAt(0)==="@"?pa({file:ma.resolve(r.cwd,t.slice(1)),sync:!0,noResume:!0,onentry:s=>r.add(s)}):r.add(t)}),r.end()},Ln=(r,e)=>{for(;e.length;){let t=e.shift();if(t.charAt(0)==="@")return pa({file:ma.resolve(r.cwd,t.slice(1)),noResume:!0,onentry:s=>r.add(s)}).then(s=>Ln(r,e));r.add(t)}r.end()},Ff=(r,e)=>{let t=new Ts.Sync(r);return da(t,e),t},bf=(r,e)=>{let t=new Ts(r);return Ln(t,e),t}});var Mn=E((f0,ba)=>{"use strict";u();var Sf=Pt(),Ea=Es(),Q=require("fs"),ya=Kt(),Aa=Ps(),Ca=require("path"),wa=Ut();ba.exports=(r,e,t)=>{let s=Sf(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?kf(s,e):Rf(s,e,t)};var kf=(r,e)=>{let t=new Ea.Sync(r),s=!0,i,n;try{try{i=Q.openSync(r.file,"r+")}catch(l){if(l.code==="ENOENT")i=Q.openSync(r.file,"w+");else throw l}let o=Q.fstatSync(i),a=Buffer.alloc(512);e:for(n=0;n<o.size;n+=512){for(let h=0,m=0;h<512;h+=m){if(m=Q.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(!m)break e}let l=new wa(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,_f(r,t,n,i,e)}finally{if(s)try{Q.closeSync(i)}catch{}}},_f=(r,e,t,s,i)=>{let n=new ya.WriteStreamSync(r.file,{fd:s,start:t});e.pipe(n),vf(e,i)},Rf=(r,e,t)=>{e=Array.from(e);let s=new Ea(r),i=(o,a,l)=>{let c=(b,P)=>{b?Q.close(o,S=>l(b)):l(null,P)},h=0;if(a===0)return c(null,0);let m=0,D=Buffer.alloc(512),A=(b,P)=>{if(b)return c(b);if(m+=P,m<512&&P)return Q.read(o,D,m,D.length-m,h+m,A);if(h===0&&D[0]===31&&D[1]===139)return c(new Error("cannot append to compressed archives"));if(m<512)return c(null,h);let S=new wa(D);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),m=0,Q.read(o,D,0,512,h,A)};Q.read(o,D,0,512,h,A)},n=new Promise((o,a)=>{s.on("error",a);let l="r+",c=(h,m)=>{if(h&&h.code==="ENOENT"&&l==="r+")return l="w+",Q.open(r.file,l,c);if(h)return a(h);Q.fstat(m,(D,A)=>{if(D)return Q.close(m,()=>a(D));i(m,A.size,(b,P)=>{if(b)return a(b);let S=new ya.WriteStream(r.file,{fd:m,start:P});s.pipe(S),S.on("error",a),S.on("close",o),Fa(s,e)})})};Q.open(r.file,l,c)});return t?n.then(t,t):n},vf=(r,e)=>{e.forEach(t=>{t.charAt(0)==="@"?Aa({file:Ca.resolve(r.cwd,t.slice(1)),sync:!0,noResume:!0,onentry:s=>r.add(s)}):r.add(t)}),r.end()},Fa=(r,e)=>{for(;e.length;){let t=e.shift();if(t.charAt(0)==="@")return Aa({file:Ca.resolve(r.cwd,t.slice(1)),noResume:!0,onentry:s=>r.add(s)}).then(s=>Fa(r,e));r.add(t)}r.end()}});var ka=E((p0,Sa)=>{"use strict";u();var Bf=Pt(),xf=Mn();Sa.exports=(r,e,t)=>{let s=Bf(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),Of(s),xf(s,e,t)};var Of=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 va=E((m0,Ra)=>{u();var{promisify:_a}=require("util"),tt=require("fs"),Pf=r=>{if(!r)r={mode:511,fs:tt};else if(typeof r=="object")r={mode:511,fs:tt,...r};else if(typeof r=="number")r={mode:r,fs:tt};else if(typeof r=="string")r={mode:parseInt(r,8),fs:tt};else throw new TypeError("invalid options argument");return r.mkdir=r.mkdir||r.fs.mkdir||tt.mkdir,r.mkdirAsync=_a(r.mkdir),r.stat=r.stat||r.fs.stat||tt.stat,r.statAsync=_a(r.stat),r.statSync=r.statSync||r.fs.statSync||tt.statSync,r.mkdirSync=r.mkdirSync||r.fs.mkdirSync||tt.mkdirSync,r};Ra.exports=Pf});var xa=E((d0,Ba)=>{u();var Tf=process.env.__TESTING_MKDIRP_PLATFORM__||process.platform,{resolve:Nf,parse:Lf}=require("path"),Mf=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=Nf(r),Tf==="win32"){let e=/[*|"<>?:]/,{root:t}=Lf(r);if(e.test(r.substr(t.length)))throw Object.assign(new Error("Illegal characters in path."),{path:r,code:"EINVAL"})}return r};Ba.exports=Mf});var La=E((D0,Na)=>{u();var{dirname:Oa}=require("path"),Pa=(r,e,t=void 0)=>t===e?Promise.resolve():r.statAsync(e).then(s=>s.isDirectory()?t:void 0,s=>s.code==="ENOENT"?Pa(r,Oa(e),e):void 0),Ta=(r,e,t=void 0)=>{if(t!==e)try{return r.statSync(e).isDirectory()?t:void 0}catch(s){return s.code==="ENOENT"?Ta(r,Oa(e),e):void 0}};Na.exports={findMade:Pa,findMadeSync:Ta}});var Un=E((g0,Ia)=>{u();var{dirname:Ma}=require("path"),In=(r,e,t)=>{e.recursive=!1;let s=Ma(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 In(s,e).then(n=>In(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=Ma(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}}};Ia.exports={mkdirpManual:In,mkdirpManualSync:jn}});var qa=E((E0,Ua)=>{u();var{dirname:ja}=require("path"),{findMade:If,findMadeSync:jf}=La(),{mkdirpManual:Uf,mkdirpManualSync:qf}=Un(),$f=(r,e)=>(e.recursive=!0,ja(r)===r?e.mkdirAsync(r,e):If(e,r).then(s=>e.mkdirAsync(r,e).then(()=>s).catch(i=>{if(i.code==="ENOENT")return Uf(r,e);throw i}))),Wf=(r,e)=>{if(e.recursive=!0,ja(r)===r)return e.mkdirSync(r,e);let s=jf(e,r);try{return e.mkdirSync(r,e),s}catch(i){if(i.code==="ENOENT")return qf(r,e);throw i}};Ua.exports={mkdirpNative:$f,mkdirpNativeSync:Wf}});var Ga=E((y0,za)=>{u();var $a=require("fs"),zf=process.env.__TESTING_MKDIRP_NODE_VERSION__||process.version,qn=zf.replace(/^v/,"").split("."),Wa=+qn[0]>10||+qn[0]==10&&+qn[1]>=12,Gf=Wa?r=>r.mkdir===$a.mkdir:()=>!1,Hf=Wa?r=>r.mkdirSync===$a.mkdirSync:()=>!1;za.exports={useNative:Gf,useNativeSync:Hf}});var Za=E((A0,Ka)=>{u();var Xt=va(),Qt=xa(),{mkdirpNative:Ha,mkdirpNativeSync:Ja}=qa(),{mkdirpManual:Va,mkdirpManualSync:Ya}=Un(),{useNative:Jf,useNativeSync:Vf}=Ga(),er=(r,e)=>(r=Qt(r),e=Xt(e),Jf(e)?Ha(r,e):Va(r,e)),Yf=(r,e)=>(r=Qt(r),e=Xt(e),Vf(e)?Ja(r,e):Ya(r,e));er.sync=Yf;er.native=(r,e)=>Ha(Qt(r),Xt(e));er.manual=(r,e)=>Va(Qt(r),Xt(e));er.nativeSync=(r,e)=>Ja(Qt(r),Xt(e));er.manualSync=(r,e)=>Ya(Qt(r),Xt(e));Ka.exports=er});var ic=E((C0,sc)=>{"use strict";u();var oe=require("fs"),wt=require("path"),Kf=oe.lchown?"lchown":"chown",Zf=oe.lchownSync?"lchownSync":"chownSync",Qa=oe.lchown&&!process.version.match(/v1[1-9]+\./)&&!process.version.match(/v10\.[6-9]/),Xa=(r,e,t)=>{try{return oe[Zf](r,e,t)}catch(s){if(s.code!=="ENOENT")throw s}},Xf=(r,e,t)=>{try{return oe.chownSync(r,e,t)}catch(s){if(s.code!=="ENOENT")throw s}},Qf=Qa?(r,e,t,s)=>i=>{!i||i.code!=="EISDIR"?s(i):oe.chown(r,e,t,s)}:(r,e,t,s)=>s,$n=Qa?(r,e,t)=>{try{return Xa(r,e,t)}catch(s){if(s.code!=="EISDIR")throw s;Xf(r,e,t)}}:(r,e,t)=>Xa(r,e,t),ep=process.version,ec=(r,e,t)=>oe.readdir(r,e,t),tp=(r,e)=>oe.readdirSync(r,e);/^v4\./.test(ep)&&(ec=(r,e,t)=>oe.readdir(r,t));var Ns=(r,e,t,s)=>{oe[Kf](r,e,t,Qf(r,e,t,i=>{s(i&&i.code!=="ENOENT"?i:null)}))},tc=(r,e,t,s,i)=>{if(typeof e=="string")return oe.lstat(wt.resolve(r,e),(n,o)=>{if(n)return i(n.code!=="ENOENT"?n:null);o.name=e,tc(r,o,t,s,i)});if(e.isDirectory())Wn(wt.resolve(r,e.name),t,s,n=>{if(n)return i(n);let o=wt.resolve(r,e.name);Ns(o,t,s,i)});else{let n=wt.resolve(r,e.name);Ns(n,t,s,i)}},Wn=(r,e,t,s)=>{ec(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 Ns(r,e,t,s);let o=n.length,a=null,l=c=>{if(!a){if(c)return s(a=c);if(--o===0)return Ns(r,e,t,s)}};n.forEach(c=>tc(r,c,e,t,l))})},rp=(r,e,t,s)=>{if(typeof e=="string")try{let i=oe.lstatSync(wt.resolve(r,e));i.name=e,e=i}catch(i){if(i.code==="ENOENT")return;throw i}e.isDirectory()&&rc(wt.resolve(r,e.name),t,s),$n(wt.resolve(r,e.name),t,s)},rc=(r,e,t)=>{let s;try{s=tp(r,{withFileTypes:!0})}catch(i){if(i.code==="ENOENT")return;if(i.code==="ENOTDIR"||i.code==="ENOTSUP")return $n(r,e,t);throw i}return s&&s.length&&s.forEach(i=>rp(r,i,e,t)),$n(r,e,t)};sc.exports=Wn;Wn.sync=rc});var ac=E((w0,zn)=>{"use strict";u();var nc=Za(),ue=require("fs"),Ls=require("path"),oc=ic(),pe=It(),Ms=class extends Error{constructor(e,t){super("Cannot extract through symbolic link"),this.path=t,this.symlink=e}get name(){return"SylinkError"}},Is=class extends Error{constructor(e,t){super(t+": Cannot cd into '"+e+"'"),this.path=e,this.code=t}get name(){return"CwdError"}},js=(r,e)=>r.get(pe(e)),Fr=(r,e,t)=>r.set(pe(e),t),sp=(r,e)=>{ue.stat(r,(t,s)=>{(t||!s.isDirectory())&&(t=new Is(r,t&&t.code||"ENOTDIR")),e(t)})};zn.exports=(r,e,t)=>{r=pe(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,m=e.cache,D=pe(e.cwd),A=(S,x)=>{S?t(S):(Fr(m,r,!0),x&&l?oc(x,o,a,ut=>A(ut)):n?ue.chmod(r,i,t):t())};if(m&&js(m,r)===!0)return A();if(r===D)return sp(r,A);if(c)return nc(r,{mode:i}).then(S=>A(null,S),A);let P=pe(Ls.relative(D,r)).split("/");Us(D,P,i,m,h,D,null,A)};var Us=(r,e,t,s,i,n,o,a)=>{if(!e.length)return a(null,o);let l=e.shift(),c=pe(Ls.resolve(r+"/"+l));if(js(s,c))return Us(c,e,t,s,i,n,o,a);ue.mkdir(c,t,uc(c,e,t,s,i,n,o,a))},uc=(r,e,t,s,i,n,o,a)=>l=>{l?ue.lstat(r,(c,h)=>{if(c)c.path=c.path&&pe(c.path),a(c);else if(h.isDirectory())Us(r,e,t,s,i,n,o,a);else if(i)ue.unlink(r,m=>{if(m)return a(m);ue.mkdir(r,t,uc(r,e,t,s,i,n,o,a))});else{if(h.isSymbolicLink())return a(new Ms(r,r+"/"+e.join("/")));a(l)}}):(o=o||r,Us(r,e,t,s,i,n,o,a))},ip=r=>{let e=!1,t="ENOTDIR";try{e=ue.statSync(r).isDirectory()}catch(s){t=s.code}finally{if(!e)throw new Is(r,t)}};zn.exports.sync=(r,e)=>{r=pe(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,m=pe(e.cwd),D=S=>{Fr(h,r,!0),S&&a&&oc.sync(S,n,o),i&&ue.chmodSync(r,s)};if(h&&js(h,r)===!0)return D();if(r===m)return ip(m),D();if(l)return D(nc.sync(r,s));let b=pe(Ls.relative(m,r)).split("/"),P=null;for(let S=b.shift(),x=m;S&&(x+="/"+S);S=b.shift())if(x=pe(Ls.resolve(x)),!js(h,x))try{ue.mkdirSync(x,s),P=P||x,Fr(h,x,!0)}catch{let de=ue.lstatSync(x);if(de.isDirectory()){Fr(h,x,!0);continue}else if(c){ue.unlinkSync(x),ue.mkdirSync(x,s),P=P||x,Fr(h,x,!0);continue}else if(de.isSymbolicLink())return new Ms(x,x+"/"+b.join("/"))}return D(P)}});var Hn=E((F0,cc)=>{u();var Gn=Object.create(null),{hasOwnProperty:np}=Object.prototype;cc.exports=r=>(np.call(Gn,r)||(Gn[r]=r.normalize("NFKD")),Gn[r])});var pc=E((b0,fc)=>{u();var lc=require("assert"),op=Hn(),up=qt(),{join:hc}=require("path"),ap=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,cp=ap==="win32";fc.exports=()=>{let r=new Map,e=new Map,t=c=>c.split("/").slice(0,-1).reduce((m,D)=>(m.length&&(D=hc(m[m.length-1],D)),m.push(D||"/"),m),[]),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(m=>r.get(m)),dirs:[...h.dirs].map(m=>r.get(m))}},n=c=>{let{paths:h,dirs:m}=i(c);return h.every(D=>D[0]===c)&&m.every(D=>D[0]instanceof Set&&D[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:m}=e.get(c),D=new Set;return h.forEach(A=>{let b=r.get(A);lc.equal(b[0],c),b.length===1?r.delete(A):(b.shift(),typeof b[0]=="function"?D.add(b[0]):b[0].forEach(P=>D.add(P)))}),m.forEach(A=>{let b=r.get(A);lc(b[0]instanceof Set),b[0].size===1&&b.length===1?r.delete(A):b[0].size===1?(b.shift(),D.add(b[0])):b[0].delete(c)}),s.delete(c),D.forEach(A=>o(A)),!0};return{check:n,reserve:(c,h)=>{c=cp?["win32 parallelization disabled"]:c.map(D=>op(up(hc(D))).toLowerCase());let m=new Set(c.map(D=>t(D)).reduce((D,A)=>D.concat(A)));return e.set(h,{dirs:m,paths:c}),c.forEach(D=>{let A=r.get(D);A?A.push(h):r.set(D,[h])}),m.forEach(D=>{let A=r.get(D);A?A[A.length-1]instanceof Set?A[A.length-1].add(h):A.push(new Set([h])):r.set(D,[new Set([h])])}),o(h)}}}});var Dc=E((S0,dc)=>{u();var lp=process.env.__FAKE_PLATFORM__||process.platform,hp=lp==="win32",fp=global.__FAKE_TESTING_FS__||require("fs"),{O_CREAT:pp,O_TRUNC:mp,O_WRONLY:dp,UV_FS_O_FILEMAP:mc=0}=fp.constants,Dp=hp&&!!mc,gp=512*1024,Ep=mc|mp|pp|dp;dc.exports=Dp?r=>r<gp?Ep:"w":()=>"w"});var to=E((k0,Bc)=>{"use strict";u();var yp=require("assert"),Ap=Os(),_=require("fs"),Cp=Kt(),Ie=require("path"),_c=ac(),gc=Qi(),wp=pc(),Fp=en(),ee=It(),bp=qt(),Sp=Hn(),Ec=Symbol("onEntry"),Yn=Symbol("checkFs"),yc=Symbol("checkFs2"),Ws=Symbol("pruneCache"),Kn=Symbol("isReusable"),ae=Symbol("makeFs"),Zn=Symbol("file"),Xn=Symbol("directory"),zs=Symbol("link"),Ac=Symbol("symlink"),Cc=Symbol("hardlink"),wc=Symbol("unsupported"),Fc=Symbol("checkPath"),rt=Symbol("mkdir"),z=Symbol("onError"),qs=Symbol("pending"),bc=Symbol("pend"),tr=Symbol("unpend"),Jn=Symbol("ended"),Vn=Symbol("maybeClose"),Qn=Symbol("skip"),br=Symbol("doChown"),Sr=Symbol("uid"),kr=Symbol("gid"),_r=Symbol("checkedCwd"),Rc=require("crypto"),vc=Dc(),kp=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,Rr=kp==="win32",_p=(r,e)=>{if(!Rr)return _.unlink(r,e);let t=r+".DELETE."+Rc.randomBytes(16).toString("hex");_.rename(r,t,s=>{if(s)return e(s);_.unlink(t,e)})},Rp=r=>{if(!Rr)return _.unlinkSync(r);let e=r+".DELETE."+Rc.randomBytes(16).toString("hex");_.renameSync(r,e),_.unlinkSync(e)},Sc=(r,e,t)=>r===r>>>0?r:e===e>>>0?e:t,kc=r=>Sp(bp(ee(r))).toLowerCase(),vp=(r,e)=>{e=kc(e);for(let t of r.keys()){let s=kc(t);(s===e||s.indexOf(e+"/")===0)&&r.delete(t)}},Bp=r=>{for(let e of r.keys())r.delete(e)},vr=class extends Ap{constructor(e){if(e||(e={}),e.ondone=t=>{this[Jn]=!0,this[Vn]()},super(e),this[_r]=!1,this.reservations=wp(),this.transform=typeof e.transform=="function"?e.transform:null,this.writable=!0,this.readable=!1,this[qs]=0,this[Jn]=!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||Rr,this.newer=!!e.newer,this.keep=!!e.keep,this.noMtime=!!e.noMtime,this.preservePaths=!!e.preservePaths,this.unlink=!!e.unlink,this.cwd=ee(Ie.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[Ec](t))}warn(e,t,s={}){return(e==="TAR_BAD_ARCHIVE"||e==="TAR_ABORT")&&(s.recoverable=!1),super.warn(e,t,s)}[Vn](){this[Jn]&&this[qs]===0&&(this.emit("prefinish"),this.emit("finish"),this.emit("end"))}[Fc](e){if(this.strip){let t=ee(e.path).split("/");if(t.length<this.strip)return!1;if(e.path=t.slice(this.strip).join("/"),e.type==="Link"){let s=ee(e.linkpath).split("/");if(s.length>=this.strip)e.linkpath=s.slice(this.strip).join("/");else return!1}}if(!this.preservePaths){let t=ee(e.path),s=t.split("/");if(s.includes("..")||Rr&&/^[a-z]:\.\.$/i.test(s[0]))return this.warn("TAR_ENTRY_ERROR","path contains '..'",{entry:e,path:t}),!1;let[i,n]=Fp(t);i&&(e.path=n,this.warn("TAR_ENTRY_INFO",`stripping ${i} from absolute path`,{entry:e,path:t}))}if(Ie.isAbsolute(e.path)?e.absolute=ee(Ie.resolve(e.path)):e.absolute=ee(Ie.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:ee(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}=Ie.win32.parse(e.absolute);e.absolute=t+gc.encode(e.absolute.slice(t.length));let{root:s}=Ie.win32.parse(e.path);e.path=s+gc.encode(e.path.slice(s.length))}return!0}[Ec](e){if(!this[Fc](e))return e.resume();switch(yp.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[Yn](e);case"CharacterDevice":case"BlockDevice":case"FIFO":default:return this[wc](e)}}[z](e,t){e.name==="CwdError"?this.emit("error",e):(this.warn("TAR_ENTRY_ERROR",e,{entry:t}),this[tr](),t.resume())}[rt](e,t,s){_c(ee(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}[Sr](e){return Sc(this.uid,e.uid,this.processUid)}[kr](e){return Sc(this.gid,e.gid,this.processGid)}[Zn](e,t){let s=e.mode&4095||this.fmode,i=new Cp.WriteStream(e.absolute,{flags:vc(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[tr](),t()})};i.on("finish",l=>{let c=e.absolute,h=i.fd;if(e.mtime&&!this.noMtime){n++;let m=e.atime||new Date,D=e.mtime;_.futimes(h,m,D,A=>A?_.utimes(c,m,D,b=>o(b&&A)):o())}if(this[br](e)){n++;let m=this[Sr](e),D=this[kr](e);_.fchown(h,m,D,A=>A?_.chown(c,m,D,b=>o(b&&A)):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)}[Xn](e,t){let s=e.mode&4095||this.dmode;this[rt](e.absolute,s,i=>{if(i){this[z](i,e),t();return}let n=1,o=a=>{--n===0&&(t(),this[tr](),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[Sr](e),this[kr](e),o)),o()})}[wc](e){e.unsupported=!0,this.warn("TAR_ENTRY_UNSUPPORTED",`unsupported entry type: ${e.type}`,{entry:e}),e.resume()}[Ac](e,t){this[zs](e,e.linkpath,"symlink",t)}[Cc](e,t){let s=ee(Ie.resolve(this.cwd,e.linkpath));this[zs](e,s,"link",t)}[bc](){this[qs]++}[tr](){this[qs]--,this[Vn]()}[Qn](e){this[tr](),e.resume()}[Kn](e,t){return e.type==="File"&&!this.unlink&&t.isFile()&&t.nlink<=1&&!Rr}[Yn](e){this[bc]();let t=[e.path];e.linkpath&&t.push(e.linkpath),this.reservations.reserve(t,s=>this[yc](e,s))}[Ws](e){e.type==="SymbolicLink"?Bp(this.dirCache):e.type!=="Directory"&&vp(this.dirCache,e.absolute)}[yc](e,t){this[Ws](e);let s=a=>{this[Ws](e),t(a)},i=()=>{this[rt](this.cwd,this.dmode,a=>{if(a){this[z](a,e),s();return}this[_r]=!0,n()})},n=()=>{if(e.absolute!==this.cwd){let a=ee(Ie.dirname(e.absolute));if(a!==this.cwd)return this[rt](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[Qn](e),s();return}if(a||this[Kn](e,l))return this[ae](null,e,s);if(l.isDirectory()){if(e.type==="Directory"){let c=!this.noChmod&&e.mode&&(l.mode&4095)!==e.mode,h=m=>this[ae](m,e,s);return c?_.chmod(e.absolute,e.mode,h):h()}if(e.absolute!==this.cwd)return _.rmdir(e.absolute,c=>this[ae](c,e,s))}if(e.absolute===this.cwd)return this[ae](null,e,s);_p(e.absolute,c=>this[ae](c,e,s))})};this[_r]?n():i()}[ae](e,t,s){if(e){this[z](e,t),s();return}switch(t.type){case"File":case"OldFile":case"ContiguousFile":return this[Zn](t,s);case"Link":return this[Cc](t,s);case"SymbolicLink":return this[Ac](t,s);case"Directory":case"GNUDumpDir":return this[Xn](t,s)}}[zs](e,t,s,i){_[s](t,e.absolute,n=>{n?this[z](n,e):(this[tr](),e.resume()),i()})}},$s=r=>{try{return[null,r()]}catch(e){return[e,null]}},eo=class extends vr{[ae](e,t){return super[ae](e,t,()=>{})}[Yn](e){if(this[Ws](e),!this[_r]){let n=this[rt](this.cwd,this.dmode);if(n)return this[z](n,e);this[_r]=!0}if(e.absolute!==this.cwd){let n=ee(Ie.dirname(e.absolute));if(n!==this.cwd){let o=this[rt](n,this.dmode);if(o)return this[z](o,e)}}let[t,s]=$s(()=>_.lstatSync(e.absolute));if(s&&(this.keep||this.newer&&s.mtime>e.mtime))return this[Qn](e);if(t||this[Kn](e,s))return this[ae](null,e);if(s.isDirectory()){if(e.type==="Directory"){let o=!this.noChmod&&e.mode&&(s.mode&4095)!==e.mode,[a]=o?$s(()=>{_.chmodSync(e.absolute,e.mode)}):[];return this[ae](a,e)}let[n]=$s(()=>_.rmdirSync(e.absolute));this[ae](n,e)}let[i]=e.absolute===this.cwd?[]:$s(()=>Rp(e.absolute));this[ae](i,e)}[Zn](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,vc(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(m){try{_.utimesSync(e.absolute,c,h)}catch{l=m}}}if(this[br](e)){let c=this[Sr](e),h=this[kr](e);try{_.fchownSync(n,c,h)}catch(m){try{_.chownSync(e.absolute,c,h)}catch{l=l||m}}}i(l)})}[Xn](e,t){let s=e.mode&4095||this.dmode,i=this[rt](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[Sr](e),this[kr](e))}catch{}t(),e.resume()}[rt](e,t){try{return _c.sync(ee(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}}[zs](e,t,s,i){try{_[s+"Sync"](t,e.absolute),i(),e.resume()}catch(n){return this[z](n,e)}}};vr.Sync=eo;Bc.exports=vr});var Nc=E((_0,Tc)=>{"use strict";u();var xp=Pt(),Gs=to(),Oc=require("fs"),Pc=Kt(),xc=require("path"),ro=qt();Tc.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=xp(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&&Op(s,e),s.file&&s.sync?Pp(s):s.file?Tp(s,t):s.sync?Np(s):Lp(s)};var Op=(r,e)=>{let t=new Map(e.map(n=>[ro(n),!0])),s=r.filter,i=(n,o)=>{let a=o||xc.parse(n).root||".",l=n===a?!1:t.has(n)?t.get(n):i(xc.dirname(n),a);return t.set(n,l),l};r.filter=s?(n,o)=>s(n,o)&&i(ro(n)):n=>i(ro(n))},Pp=r=>{let e=new Gs.Sync(r),t=r.file,s=Oc.statSync(t),i=r.maxReadSize||16*1024*1024;new Pc.ReadStreamSync(t,{readSize:i,size:s.size}).pipe(e)},Tp=(r,e)=>{let t=new Gs(r),s=r.maxReadSize||16*1024*1024,i=r.file,n=new Promise((o,a)=>{t.on("error",a),t.on("close",o),Oc.stat(i,(l,c)=>{if(l)a(l);else{let h=new Pc.ReadStream(i,{readSize:s,size:c.size});h.on("error",a),h.pipe(t)}})});return e?n.then(e,e):n},Np=r=>new Gs.Sync(r),Lp=r=>new Gs(r)});var Lc=E(L=>{"use strict";u();L.c=L.create=ga();L.r=L.replace=Mn();L.t=L.list=Ps();L.u=L.update=ka();L.x=L.extract=Nc();L.Pack=Es();L.Unpack=to();L.Parse=Os();L.ReadEntry=ts();L.WriteEntry=hn();L.Header=Ut();L.Pax=ss();L.types=Hi()});var Uc=E((O0,jc)=>{u();function ce(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))}jc.exports=ce;ce.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)};ce.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null};ce.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};ce.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)};ce.prototype.try=function(r){console.log("Using RetryOperation.try() is deprecated"),this.attempt(r)};ce.prototype.start=function(r){console.log("Using RetryOperation.start() is deprecated"),this.attempt(r)};ce.prototype.start=ce.prototype.try;ce.prototype.errors=function(){return this._errors};ce.prototype.attempts=function(){return this._attempts};ce.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 qc=E(Ft=>{u();var Wp=Uc();Ft.operation=function(r){var e=Ft.timeouts(r);return new Wp(e,{forever:r&&(r.forever||r.retries===1/0),unref:r&&r.unref,maxRetryTime:r&&r.maxRetryTime})};Ft.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};Ft.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};Ft.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=Ft.operation(e),h=Array.prototype.slice.call(arguments,1),m=h.pop();h.push(function(D){c.retry(D)||(D&&(arguments[0]=c.mainError()),m.apply(this,arguments))}),c.attempt(function(){l.apply(r,h)})}.bind(r,o),r[n].options=e}}});var Wc=E((T0,$c)=>{u();$c.exports=qc()});var Gc=E((N0,zc)=>{u();var zp=Wc();function Gp(r,e){function t(s,i){var n=e||{},o;"randomize"in n||(n.randomize=!0),o=zp.operation(n);function a(h){i(h||new Error("Aborted"))}function l(h,m){if(h.bail){a(h);return}o.retry(h)?n.onRetry&&n.onRetry(h,m):i(o.mainError())}function c(h){var m;try{m=r(a,h)}catch(D){l(D,h);return}Promise.resolve(m).then(s).catch(function(A){l(A,h)})}o.attempt(c)}return new Promise(t)}zc.exports=Gp});var Rm={};bl(Rm,{ConvertError:()=>R,MANAGERS:()=>qe,convert:()=>_m,getPackageManagerMeta:()=>no,getWorkspaceDetails:()=>io,install:()=>Ys});module.exports=Sl(Rm);u();u();u();u();var Tl=w(mo());u();u();function ri(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}u();u();function ar(r){return ar=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},ar(r)}u();function si(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function ii(r,e){if(e&&(ar(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return si(r)}u();function lt(r){return lt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},lt(r)}u();u();function Se(r,e){return Se=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(s,i){return s.__proto__=i,s},Se(r,e)}function ni(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&&Se(r,e)}u();u();function oi(r){return Function.toString.call(r).indexOf("[native code]")!==-1}u();u();function ui(){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 Bt(r,e,t){return ui()?Bt=Reflect.construct.bind():Bt=function(i,n,o){var a=[null];a.push.apply(a,n);var l=Function.bind.apply(i,a),c=new l;return o&&Se(c,o.prototype),c},Bt.apply(null,arguments)}function cr(r){var e=typeof Map=="function"?new Map:void 0;return cr=function(s){if(s===null||!oi(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 Bt(s,arguments,lt(this).constructor)}return i.prototype=Object.create(s.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Se(i,s)},cr(r)}var Po=w(Oo());var Nl=w(require("fs-extra")),md=function(r){ni(e,r);function e(t){var s;return ri(this,e),s=ii(this,lt(e).call(this,"No package.json could be found upwards from the directory ".concat(t))),s.directory=t,s}return e}(cr(Error));u();u();var Ll=w(require("fs")),Ml=w(require("path"));u();var Hl=w(require("fs")),Jl=w(require("path")),Vl=w(require("js-yaml")),Yl=require("fast-glob");u();var Ot=require("picocolors"),Ul=w(require("ora")),To=w(require("gradient-string")),No="#0099F7",Lo="#F11712",ql="#FFFF00",mi=r=>{let e=$l(r);return t=>`\x1B[38;5;${e}m${t}${(0,Ot.reset)("")}`},Fd=(0,To.default)(No,Lo),bd=mi(No),Sd=mi(Lo),kd=mi(ql);function $l(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 Mo=w(require("os")),Io=w(require("execa")),Kl=5e3;async function Ur(r,e=[],t){let s={cwd:Mo.default.tmpdir(),env:{COREPACK_ENABLE_STRICT:"0"},timeout:Kl,...t};try{let{stdout:i}=await(0,Io.default)(r,e,s);return i.trim()}catch{return}}async function Di(){let[r,e,t,s]=await Promise.all([Ur("yarnpkg",["--version"],{cwd:"."}),Ur("npm",["--version"]),Ur("pnpm",["--version"]),Ur("bun",["--version"])]);return{yarn:r,pnpm:t,npm:e,bun:s}}u();var Zl=w(require("fs-extra"));u();var Xl=w(require("path")),Ql=w(require("fs-extra")),eh=w(require("picocolors"));u();var Mp=require("stream"),Ip=require("stream/promises"),jp=require("zlib"),Hs=require("fs"),Mc=require("fs/promises"),Js=require("path"),Up=require("os"),qp=require("child_process"),Ic=w(Lc());u();var $p=w(require("fs-extra"));u();var Qp=w(require("path")),em=w(Gc()),tm=w(require("picocolors")),rm=w(require("fs-extra"));u();u();var sm=w(require("picocolors")),im=w(require("update-check"));u();u();u();var R=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,R)}};u();u();var bt=w(require("path")),me=w(require("fs-extra")),el=w(require("execa"));u();var Zc=w(require("path")),Xc=w(require("fs-extra")),Qc=w(require("picocolors"));u();var je=w(require("path")),Hc=w(require("execa")),te=require("fs-extra"),Jc=require("fast-glob"),Vc=w(require("js-yaml"));var nm=/^(?!_)(?<manager>.+)@(?<version>.+)$/;function M({workspaceRoot:r}){let e=je.default.join(r,"package.json");try{return(0,te.readJsonSync)(e,"utf8")}catch(t){if(t&&typeof t=="object"&&"code"in t){if(t.code==="ENOENT")throw new R(`no "package.json" found at ${r}`,{type:"package_json-missing"});if(t.code==="EJSONPARSE")throw new R(`failed to parse "package.json" at ${r}`,{type:"package_json-parse_error"})}throw new Error(`unexpected error reading "package.json" at ${r}`)}}function st({workspaceRoot:r}){let{packageManager:e}=M({workspaceRoot:r});if(e)try{let t=nm.exec(e);if(t){let[s,i]=t;return i}}catch{}}function Ue({workspaceRoot:r}){let e=M({workspaceRoot:r}),t=je.default.basename(r),{name:s=t,description:i}=e;return{name:s,description:i}}function so({workspaceRoot:r}){let e=je.default.join(r,"pnpm-workspace.yaml");if((0,te.existsSync)(e))try{let t=Vc.default.load((0,te.readFileSync)(e,"utf8"));if(t instanceof Object&&"packages"in t&&Array.isArray(t.packages))return t.packages}catch{throw new R(`failed to parse ${e}`,{type:"pnpm-workspace_parse_error"})}return[]}function it({root:r,lockFile:e,workspaceConfig:t}){let s=n=>je.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 rr({workspaces:r}){var e;return r?Array.isArray(r)?r:"packages"in r?(e=r.packages)!=null?e:[]:[]:[]}function nt({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,Jc.sync)(i,{onlyFiles:!0,absolute:!0,cwd:r,ignore:["**/node_modules/**",...t]})}).map(s=>{let i=je.default.dirname(s),{name:n,description:o}=Ue({workspaceRoot:i});return{name:n,description:o,paths:{root:i,packageJson:s,nodeModules:je.default.join(i,"node_modules")}}})}function Yc({directory:r}){let e=je.default.resolve(process.cwd(),r);return{exists:(0,te.existsSync)(e),absolute:e}}function le({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 Kc({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 re({project:r,options:e}){e!=null&&e.dry||(0,te.rmSync)(r.paths.lockfile,{force:!0})}async function Vs({project:r,options:e}){if(!(e!=null&&e.dry)&&(0,te.existsSync)(r.paths.lockfile))try{let{stdout:t}=await(0,Hc.default)("bun",["bun.lockb"],{stdin:"ignore",cwd:r.paths.root,preferLocal:!0,shell:process.platform==="win32"});await(0,te.writeFile)(je.default.join(r.paths.root,"yarn.lock"),t)}catch{}finally{(0,te.rmSync)(r.paths.lockfile,{force:!0})}}function om({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 he({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(m=>{let D=n[m];if(D){let{updated:A,dependencyList:b}=om({dependencyList:D,project:r,to:t});n[m]=b,o[m]=A}});let l=m=>{let D=o[m].length;if(D>0)return`${Qc.default.green(D.toString())} ${m}`},c=a.map(l).filter(Boolean),h=`./${Zc.default.relative(r.paths.root,e.paths.packageJson)}`;if(c.length>=1){let m="updating";c.forEach((D,A)=>{c.length===1?m+=` ${D} in ${h}`:A===c.length-1?m+=`and ${D} in ${h}`:m+=` ${D}, `}),s.workspaceStep(m)}else s.workspaceStep(`no workspace dependencies found in ${h}`);i!=null&&i.dry||Xc.default.writeJSONSync(e.paths.packageJson,n,{spaces:2})}var ot={name:"pnpm",lock:"pnpm-lock.yaml"};async function tl(r){let e=bt.default.join(r.workspaceRoot,ot.lock),t=bt.default.join(r.workspaceRoot,"pnpm-workspace.yaml"),s=st({workspaceRoot:r.workspaceRoot});return me.default.existsSync(e)||me.default.existsSync(t)||s===ot.name}async function um(r){if(!await tl(r))throw new R("Not a pnpm project",{type:"package_manager-unexpected"});let{name:t,description:s}=Ue(r);return{name:t,description:s,packageManager:ot.name,paths:it({root:r.workspaceRoot,lockFile:ot.lock,workspaceConfig:"pnpm-workspace.yaml"}),workspaceData:{globs:so(r),workspaces:nt({workspaceGlobs:so(r),...r})}}}async function am(r){let{project:e,to:t,logger:s,options:i}=r,n=e.workspaceData.globs.length>0;s.mainStep(le({action:"create",packageManager:ot.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||(me.default.writeJSONSync(e.paths.packageJson,o,{spaces:2}),n&&(s.rootStep('adding "pnpm-workspace.yaml"'),me.default.writeFileSync(bt.default.join(e.paths.root,"pnpm-workspace.yaml"),`packages:
|
|
4
4
|
${e.workspaceData.globs.map(a=>` - "${a}"`).join(`
|
|
5
|
-
`)}`))),n&&(he({workspace:{name:"root",paths:e.paths},project:e,to:t,logger:s,options:i}),s.workspaceHeader(),e.workspaceData.workspaces.forEach(a=>{he({workspace:a,project:e,to:t,logger:s,options:i})}))}async function um(r){let{project:e,logger:t,options:s}=r,i=e.workspaceData.globs.length>0;t.mainStep(le({action:"remove",packageManager:ot.name,project:e}));let n=I({workspaceRoot:e.paths.root});if(e.paths.workspaceConfig&&i&&(t.subStep('removing "pnpm-workspace.yaml"'),s!=null&&s.dry||me.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)){me.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=>me.default.rm(a,{recursive:!0,force:!0})))}catch{throw new R("Failed to remove node_modules",{type:"error_removing_node_modules"})}}}async function am(r){let{project:e,logger:t,options:s}=r;t.subStep(`removing ${bt.default.relative(e.paths.root,e.paths.lockfile)}`),s!=null&&s.dry||me.default.rmSync(e.paths.lockfile,{force:!0})}async function cm(r){let{project:e,options:t,logger:s}=r,i=()=>{s.subStep(`converting ${bt.default.relative(e.paths.root,e.paths.lockfile)} to ${ot.lock}`)},n=async()=>{if(!(t!=null&&t.dry)&&me.default.existsSync(e.paths.lockfile))try{await(0,Xc.default)(ot.name,["import"],{stdio:"ignore",cwd:e.paths.root,preferLocal:!0,shell:process.platform==="win32"})}catch{}finally{re({project:e,options:t})}};switch(e.packageManager){case"pnpm":break;case"bun":i(),await Vs({project:e,options:t}),await n(),me.default.rmSync(bt.default.join(e.paths.root,"yarn.lock"),{force:!0});break;case"npm":i(),await n();break;case"yarn":i(),await n();break}}var el={detect:Qc,read:nm,create:om,remove:um,clean:am,convertLock:cm};u();var Br=w(require("path")),St=w(require("fs-extra"));var sr={name:"npm",lock:"package-lock.json"};async function tl(r){let e=Br.default.join(r.workspaceRoot,sr.lock),t=st({workspaceRoot:r.workspaceRoot});return St.default.existsSync(e)||t===sr.name}async function lm(r){if(!await tl(r))throw new R("Not an npm project",{type:"package_manager-unexpected"});let t=I(r),{name:s,description:i}=Ue(r),n=rr({workspaces:t.workspaces});return{name:s,description:i,packageManager:sr.name,paths:it({root:r.workspaceRoot,lockFile:sr.lock}),workspaceData:{globs:n,workspaces:nt({workspaceGlobs:n,...r})}}}async function hm(r){let{project:e,options:t,to:s,logger:i}=r,n=e.workspaceData.globs.length>0;i.mainStep(le({packageManager:sr.name,action:"create",project:e}));let o=I({workspaceRoot:e.paths.root});i.rootHeader(),i.rootStep(`adding "packageManager" field to ${Br.default.relative(e.paths.root,e.paths.packageJson)}`),o.packageManager=`${s.name}@${s.version}`,n?(i.rootStep(`adding "workspaces" field to ${Br.default.relative(e.paths.root,e.paths.packageJson)}`),o.workspaces=e.workspaceData.globs,t!=null&&t.dry||St.default.writeJSONSync(e.paths.packageJson,o,{spaces:2}),he({workspace:{name:"root",paths:e.paths},project:e,to:s,logger:i,options:t}),i.workspaceHeader(),e.workspaceData.workspaces.forEach(a=>{he({workspace:a,project:e,to:s,logger:i,options:t})})):t!=null&&t.dry||St.default.writeJSONSync(e.paths.packageJson,o,{spaces:2})}async function fm(r){let{project:e,logger:t,options:s}=r,i=e.workspaceData.globs.length>0;t.mainStep(le({packageManager:sr.name,action:"remove",project:e}));let n=I({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)){St.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=>St.default.rm(a,{recursive:!0,force:!0})))}catch{throw new R("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 ${Br.default.relative(e.paths.root,e.paths.lockfile)}`),s!=null&&s.dry||St.default.rmSync(e.paths.lockfile,{force:!0})}async function mm(r){let{project:e,options:t}=r;switch(e.packageManager){case"pnpm":re({project:e,options:t});break;case"bun":re({project:e,options:t});break;case"npm":break;case"yarn":re({project:e,options:t});break}}var rl={detect:tl,read:lm,create:hm,remove:fm,clean:pm,convertLock:mm};u();var ir=w(require("path")),kt=w(require("fs-extra"));var _t={name:"yarn",lock:"yarn.lock"};async function sl(r){let e=ir.default.join(r.workspaceRoot,_t.lock),t=st({workspaceRoot:r.workspaceRoot});return kt.default.existsSync(e)||t===_t.name}async function dm(r){if(!await sl(r))throw new R("Not a yarn project",{type:"package_manager-unexpected"});let t=I(r),{name:s,description:i}=Ue(r),n=rr({workspaces:t.workspaces});return{name:s,description:i,packageManager:_t.name,paths:it({root:r.workspaceRoot,lockFile:_t.lock}),workspaceData:{globs:n,workspaces:nt({workspaceGlobs:n,...r})}}}async function Dm(r){let{project:e,to:t,logger:s,options:i}=r,n=e.workspaceData.globs.length>0;s.mainStep(le({packageManager:_t.name,action:"create",project:e}));let o=I({workspaceRoot:e.paths.root});s.rootHeader(),s.rootStep(`adding "packageManager" field to ${ir.default.relative(e.paths.root,e.paths.packageJson)}`),o.packageManager=`${t.name}@${t.version}`,n?(s.rootStep(`adding "workspaces" field to ${ir.default.relative(e.paths.root,e.paths.packageJson)}`),o.workspaces=e.workspaceData.globs,i!=null&&i.dry||kt.default.writeJSONSync(e.paths.packageJson,o,{spaces:2}),he({workspace:{name:"root",paths:e.paths},project:e,to:t,logger:s,options:i}),s.workspaceHeader(),e.workspaceData.workspaces.forEach(a=>{he({workspace:a,project:e,to:t,logger:s,options:i})})):i!=null&&i.dry||kt.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(le({packageManager:_t.name,action:"remove",project:e}));let n=I({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)){kt.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=>kt.default.rm(a,{recursive:!0,force:!0})))}catch{throw new R("Failed to remove node_modules",{type:"error_removing_node_modules"})}}}async function Em(r){let{project:e,logger:t,options:s}=r;t.subStep(`removing ${ir.default.relative(e.paths.root,e.paths.lockfile)}`),s!=null&&s.dry||kt.default.rmSync(e.paths.lockfile,{force:!0})}async function ym(r){let{project:e,options:t,logger:s}=r,i=()=>{s.subStep(`converting ${ir.default.relative(e.paths.root,e.paths.lockfile)} to ${_t.lock}`)};switch(e.packageManager){case"pnpm":re({project:e,options:t});break;case"bun":i(),await Vs({project:e,options:t});break;case"npm":re({project:e,options:t});break;case"yarn":break}}var il={detect:sl,read:dm,create:Dm,remove:gm,clean:Em,convertLock:ym};u();var xr=w(require("path")),Rt=w(require("fs-extra"));var nr={name:"bun",lock:"bun.lockb"};async function nl(r){let e=xr.default.join(r.workspaceRoot,nr.lock),t=st({workspaceRoot:r.workspaceRoot});return Rt.default.existsSync(e)||t===nr.name}async function Am(r){if(!await nl(r))throw new R("Not a bun project",{type:"package_manager-unexpected"});let t=I(r),{name:s,description:i}=Ue(r),n=rr({workspaces:t.workspaces});return{name:s,description:i,packageManager:nr.name,paths:it({root:r.workspaceRoot,lockFile:nr.lock}),workspaceData:{globs:n,workspaces:nt({workspaceGlobs:n,...r})}}}async function Cm(r){let{project:e,to:t,logger:s,options:i}=r,n=e.workspaceData.globs.length>0;if(!Vc({project:e}))throw new R("Unable to convert project to bun - workspace globs unsupported",{type:"bun-workspace_glob_error"});s.mainStep(le({packageManager:nr.name,action:"create",project:e}));let o=I({workspaceRoot:e.paths.root});s.rootHeader(),s.rootStep(`adding "packageManager" field to ${xr.default.relative(e.paths.root,e.paths.packageJson)}`),o.packageManager=`${t.name}@${t.version}`,n?(s.rootStep(`adding "workspaces" field to ${xr.default.relative(e.paths.root,e.paths.packageJson)}`),o.workspaces=e.workspaceData.globs,i!=null&&i.dry||Rt.default.writeJSONSync(e.paths.packageJson,o,{spaces:2}),he({workspace:{name:"root",paths:e.paths},project:e,to:t,logger:s,options:i}),s.workspaceHeader(),e.workspaceData.workspaces.forEach(a=>{he({workspace:a,project:e,to:t,logger:s,options:i})})):i!=null&&i.dry||Rt.default.writeJSONSync(e.paths.packageJson,o,{spaces:2})}async function wm(r){let{project:e,logger:t,options:s}=r,i=e.workspaceData.globs.length>0;t.mainStep(le({packageManager:nr.name,action:"remove",project:e}));let n=I({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)){Rt.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=>Rt.default.rm(a,{recursive:!0,force:!0})))}catch{throw new R("Failed to remove node_modules",{type:"error_removing_node_modules"})}}}async function Fm(r){let{project:e,logger:t,options:s}=r;t.subStep(`removing ${xr.default.relative(e.paths.root,e.paths.lockfile)}`),s!=null&&s.dry||Rt.default.rmSync(e.paths.lockfile,{force:!0})}async function bm(r){let{project:e,options:t}=r;switch(e.packageManager){case"pnpm":re({project:e,options:t});break;case"bun":break;case"npm":re({project:e,options:t});break;case"yarn":re({project:e,options:t});break}}var ol={detect:nl,read:Am,create:Cm,remove:wm,clean:Fm,convertLock:bm};var qe={pnpm:el,yarn:il,npm:rl,bun:ol};async function io({root:r}){let{exists:e,absolute:t}=Jc({directory:r});if(!e)throw new R(`Could not find directory at ${t}. Ensure the directory exists.`,{type:"invalid_directory"});for(let{detect:s,read:i}of Object.values(qe))if(await s({workspaceRoot:t}))return i({workspaceRoot:t});throw new R("Could not determine package manager. Add `packageManager` to `package.json` or ensure a lockfile is present.",{type:"package_manager-unable_to_detect"})}u();var fl=w(require("picocolors"));u();var cl=w(require("execa")),ll=w(require("ora")),hl=require("semver");u();var se=w(require("picocolors")),ul=w(require("gradient-string")),or=2,ur=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(or*e),...t)}header(e){this.blankLine(),this.logger(se.default.bold(e))}installerFrames(){let e=`${" ".repeat(or)} - ${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(`
|
|
5
|
+
`)}`))),n&&(he({workspace:{name:"root",paths:e.paths},project:e,to:t,logger:s,options:i}),s.workspaceHeader(),e.workspaceData.workspaces.forEach(a=>{he({workspace:a,project:e,to:t,logger:s,options:i})}))}async function cm(r){let{project:e,logger:t,options:s}=r,i=e.workspaceData.globs.length>0;t.mainStep(le({action:"remove",packageManager:ot.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||me.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)){me.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=>me.default.rm(a,{recursive:!0,force:!0})))}catch{throw new R("Failed to remove node_modules",{type:"error_removing_node_modules"})}}}async function lm(r){let{project:e,logger:t,options:s}=r;t.subStep(`removing ${bt.default.relative(e.paths.root,e.paths.lockfile)}`),s!=null&&s.dry||me.default.rmSync(e.paths.lockfile,{force:!0})}async function hm(r){let{project:e,options:t,logger:s}=r,i=()=>{s.subStep(`converting ${bt.default.relative(e.paths.root,e.paths.lockfile)} to ${ot.lock}`)},n=async()=>{if(!(t!=null&&t.dry)&&me.default.existsSync(e.paths.lockfile))try{await(0,el.default)(ot.name,["import"],{stdio:"ignore",cwd:e.paths.root,preferLocal:!0,shell:process.platform==="win32"})}catch{}finally{re({project:e,options:t})}};switch(e.packageManager){case"pnpm":break;case"bun":i(),await Vs({project:e,options:t}),await n(),me.default.rmSync(bt.default.join(e.paths.root,"yarn.lock"),{force:!0});break;case"npm":i(),await n();break;case"yarn":i(),await n();break}}var rl={detect:tl,read:um,create:am,remove:cm,clean:lm,convertLock:hm};u();var Br=w(require("path")),St=w(require("fs-extra"));var sr={name:"npm",lock:"package-lock.json"};async function sl(r){let e=Br.default.join(r.workspaceRoot,sr.lock),t=st({workspaceRoot:r.workspaceRoot});return St.default.existsSync(e)||t===sr.name}async function fm(r){if(!await sl(r))throw new R("Not an npm project",{type:"package_manager-unexpected"});let t=M(r),{name:s,description:i}=Ue(r),n=rr({workspaces:t.workspaces});return{name:s,description:i,packageManager:sr.name,paths:it({root:r.workspaceRoot,lockFile:sr.lock}),workspaceData:{globs:n,workspaces:nt({workspaceGlobs:n,...r})}}}async function pm(r){let{project:e,options:t,to:s,logger:i}=r,n=e.workspaceData.globs.length>0;i.mainStep(le({packageManager:sr.name,action:"create",project:e}));let o=M({workspaceRoot:e.paths.root});i.rootHeader(),i.rootStep(`adding "packageManager" field to ${Br.default.relative(e.paths.root,e.paths.packageJson)}`),o.packageManager=`${s.name}@${s.version}`,n?(i.rootStep(`adding "workspaces" field to ${Br.default.relative(e.paths.root,e.paths.packageJson)}`),o.workspaces=e.workspaceData.globs,t!=null&&t.dry||St.default.writeJSONSync(e.paths.packageJson,o,{spaces:2}),he({workspace:{name:"root",paths:e.paths},project:e,to:s,logger:i,options:t}),i.workspaceHeader(),e.workspaceData.workspaces.forEach(a=>{he({workspace:a,project:e,to:s,logger:i,options:t})})):t!=null&&t.dry||St.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(le({packageManager:sr.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)){St.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=>St.default.rm(a,{recursive:!0,force:!0})))}catch{throw new R("Failed to remove node_modules",{type:"error_removing_node_modules"})}}}async function dm(r){let{project:e,logger:t,options:s}=r;t.subStep(`removing ${Br.default.relative(e.paths.root,e.paths.lockfile)}`),s!=null&&s.dry||St.default.rmSync(e.paths.lockfile,{force:!0})}async function Dm(r){let{project:e,options:t}=r;switch(e.packageManager){case"pnpm":re({project:e,options:t});break;case"bun":re({project:e,options:t});break;case"npm":break;case"yarn":re({project:e,options:t});break}}var il={detect:sl,read:fm,create:pm,remove:mm,clean:dm,convertLock:Dm};u();var ir=w(require("path")),kt=w(require("fs-extra"));var _t={name:"yarn",lock:"yarn.lock"};async function nl(r){let e=ir.default.join(r.workspaceRoot,_t.lock),t=st({workspaceRoot:r.workspaceRoot});return kt.default.existsSync(e)||t===_t.name}async function gm(r){if(!await nl(r))throw new R("Not a yarn project",{type:"package_manager-unexpected"});let t=M(r),{name:s,description:i}=Ue(r),n=rr({workspaces:t.workspaces});return{name:s,description:i,packageManager:_t.name,paths:it({root:r.workspaceRoot,lockFile:_t.lock}),workspaceData:{globs:n,workspaces:nt({workspaceGlobs:n,...r})}}}async function Em(r){let{project:e,to:t,logger:s,options:i}=r,n=e.workspaceData.globs.length>0;s.mainStep(le({packageManager:_t.name,action:"create",project:e}));let o=M({workspaceRoot:e.paths.root});s.rootHeader(),s.rootStep(`adding "packageManager" field to ${ir.default.relative(e.paths.root,e.paths.packageJson)}`),o.packageManager=`${t.name}@${t.version}`,n?(s.rootStep(`adding "workspaces" field to ${ir.default.relative(e.paths.root,e.paths.packageJson)}`),o.workspaces=e.workspaceData.globs,i!=null&&i.dry||kt.default.writeJSONSync(e.paths.packageJson,o,{spaces:2}),he({workspace:{name:"root",paths:e.paths},project:e,to:t,logger:s,options:i}),s.workspaceHeader(),e.workspaceData.workspaces.forEach(a=>{he({workspace:a,project:e,to:t,logger:s,options:i})})):i!=null&&i.dry||kt.default.writeJSONSync(e.paths.packageJson,o,{spaces:2})}async function ym(r){let{project:e,logger:t,options:s}=r,i=e.workspaceData.globs.length>0;t.mainStep(le({packageManager:_t.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)){kt.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=>kt.default.rm(a,{recursive:!0,force:!0})))}catch{throw new R("Failed to remove node_modules",{type:"error_removing_node_modules"})}}}async function Am(r){let{project:e,logger:t,options:s}=r;t.subStep(`removing ${ir.default.relative(e.paths.root,e.paths.lockfile)}`),s!=null&&s.dry||kt.default.rmSync(e.paths.lockfile,{force:!0})}async function Cm(r){let{project:e,options:t,logger:s}=r,i=()=>{s.subStep(`converting ${ir.default.relative(e.paths.root,e.paths.lockfile)} to ${_t.lock}`)};switch(e.packageManager){case"pnpm":re({project:e,options:t});break;case"bun":i(),await Vs({project:e,options:t});break;case"npm":re({project:e,options:t});break;case"yarn":break}}var ol={detect:nl,read:gm,create:Em,remove:ym,clean:Am,convertLock:Cm};u();var xr=w(require("path")),Rt=w(require("fs-extra"));var nr={name:"bun",lock:"bun.lockb"};async function ul(r){let e=xr.default.join(r.workspaceRoot,nr.lock),t=st({workspaceRoot:r.workspaceRoot});return Rt.default.existsSync(e)||t===nr.name}async function wm(r){if(!await ul(r))throw new R("Not a bun project",{type:"package_manager-unexpected"});let t=M(r),{name:s,description:i}=Ue(r),n=rr({workspaces:t.workspaces});return{name:s,description:i,packageManager:nr.name,paths:it({root:r.workspaceRoot,lockFile:nr.lock}),workspaceData:{globs:n,workspaces:nt({workspaceGlobs:n,...r})}}}async function Fm(r){let{project:e,to:t,logger:s,options:i}=r,n=e.workspaceData.globs.length>0;if(!Kc({project:e}))throw new R("Unable to convert project to bun - workspace globs unsupported",{type:"bun-workspace_glob_error"});s.mainStep(le({packageManager:nr.name,action:"create",project:e}));let o=M({workspaceRoot:e.paths.root});s.rootHeader(),s.rootStep(`adding "packageManager" field to ${xr.default.relative(e.paths.root,e.paths.packageJson)}`),o.packageManager=`${t.name}@${t.version}`,n?(s.rootStep(`adding "workspaces" field to ${xr.default.relative(e.paths.root,e.paths.packageJson)}`),o.workspaces=e.workspaceData.globs,i!=null&&i.dry||Rt.default.writeJSONSync(e.paths.packageJson,o,{spaces:2}),he({workspace:{name:"root",paths:e.paths},project:e,to:t,logger:s,options:i}),s.workspaceHeader(),e.workspaceData.workspaces.forEach(a=>{he({workspace:a,project:e,to:t,logger:s,options:i})})):i!=null&&i.dry||Rt.default.writeJSONSync(e.paths.packageJson,o,{spaces:2})}async function bm(r){let{project:e,logger:t,options:s}=r,i=e.workspaceData.globs.length>0;t.mainStep(le({packageManager:nr.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)){Rt.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=>Rt.default.rm(a,{recursive:!0,force:!0})))}catch{throw new R("Failed to remove node_modules",{type:"error_removing_node_modules"})}}}async function Sm(r){let{project:e,logger:t,options:s}=r;t.subStep(`removing ${xr.default.relative(e.paths.root,e.paths.lockfile)}`),s!=null&&s.dry||Rt.default.rmSync(e.paths.lockfile,{force:!0})}async function km(r){let{project:e,options:t}=r;switch(e.packageManager){case"pnpm":re({project:e,options:t});break;case"bun":break;case"npm":re({project:e,options:t});break;case"yarn":re({project:e,options:t});break}}var al={detect:ul,read:wm,create:Fm,remove:bm,clean:Sm,convertLock:km};var qe={pnpm:rl,yarn:ol,npm:il,bun:al};async function io({root:r}){let{exists:e,absolute:t}=Yc({directory:r});if(!e)throw new R(`Could not find directory at ${t}. Ensure the directory exists.`,{type:"invalid_directory"});for(let{detect:s,read:i}of Object.values(qe))if(await s({workspaceRoot:t}))return i({workspaceRoot:t});throw new R("Could not determine package manager. Add `packageManager` to `package.json` or ensure a lockfile is present.",{type:"package_manager-unable_to_detect"})}u();var ml=w(require("picocolors"));u();var hl=w(require("execa")),fl=w(require("ora")),pl=require("semver");u();var se=w(require("picocolors")),cl=w(require("gradient-string")),or=2,ur=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(or*e),...t)}header(e){this.blankLine(),this.logger(se.default.bold(e))}installerFrames(){let e=`${" ".repeat(or)} - ${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(`
|
|
6
6
|
>>> TURBOREPO
|
|
7
|
-
`)))}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(or),"-",this.dry?se.default.yellow("SKIPPED |"):se.default.green("OK |"),...e)}subStepFailure(...e){this.logger(" ".repeat(or),"-",se.default.red("ERROR |"),...e)}rootHeader(){this.blankLine(),this.indented(2,"Root:")}rootStep(...e){this.logger(" ".repeat(or*3),"-",this.dry?se.default.yellow("SKIPPED |"):se.default.green("OK |"),...e)}workspaceHeader(){this.blankLine(),this.indented(2,"Workspaces:")}workspaceStep(...e){this.logger(" ".repeat(or*3),"-",this.dry?se.default.yellow("SKIPPED |"):se.default.green("OK |"),...e)}blankLine(){this.logger()}error(...e){console.error(...e)}};var
|
|
7
|
+
`)))}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(or),"-",this.dry?se.default.yellow("SKIPPED |"):se.default.green("OK |"),...e)}subStepFailure(...e){this.logger(" ".repeat(or),"-",se.default.red("ERROR |"),...e)}rootHeader(){this.blankLine(),this.indented(2,"Root:")}rootStep(...e){this.logger(" ".repeat(or*3),"-",this.dry?se.default.yellow("SKIPPED |"):se.default.green("OK |"),...e)}workspaceHeader(){this.blankLine(),this.indented(2,"Workspaces:")}workspaceStep(...e){this.logger(" ".repeat(or*3),"-",this.dry?se.default.yellow("SKIPPED |"):se.default.green("OK |"),...e)}blankLine(){this.logger()}error(...e){console.error(...e)}};var ll={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 no(r){let{version:e,name:t}=r;return e?ll[t].find(s=>(0,pl.satisfies)(e,s.semver)):ll[t].find(s=>s.default)}async function Ys(r){let{to:e,logger:t,options:s}=r,i=t!=null?t:new ur(s),n=no(e);if(!n)throw new R("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,fl.default)({text:"installing dependencies...",spinner:{frames:i.installerFrames()}}).start());try{await(0,hl.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 dl({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 R("You are already using this package manager",{type:"package_manager-already_in_use"});if(!e.version)throw new R(`${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 qe[r.packageManager].remove({project:r,to:i,logger:t,options:s}),await qe[i.name].create({project:r,to:i,logger:t,options:s}),t.mainStep("Installing dependencies"),s!=null&&s.skipInstall?t.subStep(ml.default.yellow("Skipping install")):(await qe[i.name].convertLock({project:r,to:i,logger:t,options:s}),await Ys({project:r,to:i,logger:t,options:s})),t.mainStep(`Cleaning up ${r.packageManager} workspaces`),r.packageManager!==e.name&&await qe[r.packageManager].clean({project:r,logger:t})}async function _m({root:r,to:e,options:t}){let s=new ur({...t,interactive:!1}),[i,n]=await Promise.all([io({root:r}),Di()]);await dl({project:i,convertTo:{name:e,version:n[e]},logger:s,options:t})}0&&(module.exports={ConvertError,MANAGERS,convert,getPackageManagerMeta,getWorkspaceDetails,install});
|
|
8
8
|
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|