UNPKG

@e2b/cli

Version:

CLI for managing e2b sandbox templates

3 lines 2.95 MB
#!/usr/bin/env -S node --enable-source-maps "use strict";var ule=Object.create;var Fm=Object.defineProperty;var dle=Object.getOwnPropertyDescriptor;var fle=Object.getOwnPropertyNames;var ple=Object.getPrototypeOf,mle=Object.prototype.hasOwnProperty;var Fw=(t,e)=>()=>(t&&(e=t(t=0)),e);var _=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Zb=(t,e)=>{for(var r in e)Fm(t,r,{get:e[r],enumerable:!0})},kw=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of fle(e))!mle.call(t,i)&&i!==r&&Fm(t,i,{get:()=>e[i],enumerable:!(n=dle(e,i))||n.enumerable});return t};var J=(t,e,r)=>(r=t!=null?ule(ple(t)):{},kw(e||!t||!t.__esModule?Fm(r,"default",{value:t,enumerable:!0}):r,t)),Bw=t=>kw(Fm({},"__esModule",{value:!0}),t);var hle,importMetaUrl,u=Fw(()=>{"use strict";hle=()=>typeof document>"u"?new URL(`file:${__filename}`).href:document.currentScript&&document.currentScript.src||new URL("main.js",document.baseURI).href,importMetaUrl=hle()});var Gw=_((sqe,Uw)=>{"use strict";u();var ua=require("constants"),_le=process.cwd,km=null,gle=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return km||(km=_le.call(process)),km};try{process.cwd()}catch{}typeof process.chdir=="function"&&(Jb=process.chdir,process.chdir=function(t){km=null,Jb.call(process,t)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,Jb));var Jb;Uw.exports=Ele;function Ele(t){ua.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&e(t),t.lutimes||r(t),t.chown=s(t.chown),t.fchown=s(t.fchown),t.lchown=s(t.lchown),t.chmod=n(t.chmod),t.fchmod=n(t.fchmod),t.lchmod=n(t.lchmod),t.chownSync=a(t.chownSync),t.fchownSync=a(t.fchownSync),t.lchownSync=a(t.lchownSync),t.chmodSync=i(t.chmodSync),t.fchmodSync=i(t.fchmodSync),t.lchmodSync=i(t.lchmodSync),t.stat=o(t.stat),t.fstat=o(t.fstat),t.lstat=o(t.lstat),t.statSync=c(t.statSync),t.fstatSync=c(t.fstatSync),t.lstatSync=c(t.lstatSync),t.chmod&&!t.lchmod&&(t.lchmod=function(d,f,m){m&&process.nextTick(m)},t.lchmodSync=function(){}),t.chown&&!t.lchown&&(t.lchown=function(d,f,m,p){p&&process.nextTick(p)},t.lchownSync=function(){}),gle==="win32"&&(t.rename=typeof t.rename!="function"?t.rename:function(d){function f(m,p,h){var g=Date.now(),S=0;d(m,p,function b(C){if(C&&(C.code==="EACCES"||C.code==="EPERM"||C.code==="EBUSY")&&Date.now()-g<6e4){setTimeout(function(){t.stat(p,function(D,N){D&&D.code==="ENOENT"?d(m,p,b):h(C)})},S),S<100&&(S+=10);return}h&&h(C)})}return Object.setPrototypeOf&&Object.setPrototypeOf(f,d),f}(t.rename)),t.read=typeof t.read!="function"?t.read:function(d){function f(m,p,h,g,S,b){var C;if(b&&typeof b=="function"){var D=0;C=function(N,U,z){if(N&&N.code==="EAGAIN"&&D<10)return D++,d.call(t,m,p,h,g,S,C);b.apply(this,arguments)}}return d.call(t,m,p,h,g,S,C)}return Object.setPrototypeOf&&Object.setPrototypeOf(f,d),f}(t.read),t.readSync=typeof t.readSync!="function"?t.readSync:function(d){return function(f,m,p,h,g){for(var S=0;;)try{return d.call(t,f,m,p,h,g)}catch(b){if(b.code==="EAGAIN"&&S<10){S++;continue}throw b}}}(t.readSync);function e(d){d.lchmod=function(f,m,p){d.open(f,ua.O_WRONLY|ua.O_SYMLINK,m,function(h,g){if(h){p&&p(h);return}d.fchmod(g,m,function(S){d.close(g,function(b){p&&p(S||b)})})})},d.lchmodSync=function(f,m){var p=d.openSync(f,ua.O_WRONLY|ua.O_SYMLINK,m),h=!0,g;try{g=d.fchmodSync(p,m),h=!1}finally{if(h)try{d.closeSync(p)}catch{}else d.closeSync(p)}return g}}function r(d){ua.hasOwnProperty("O_SYMLINK")&&d.futimes?(d.lutimes=function(f,m,p,h){d.open(f,ua.O_SYMLINK,function(g,S){if(g){h&&h(g);return}d.futimes(S,m,p,function(b){d.close(S,function(C){h&&h(b||C)})})})},d.lutimesSync=function(f,m,p){var h=d.openSync(f,ua.O_SYMLINK),g,S=!0;try{g=d.futimesSync(h,m,p),S=!1}finally{if(S)try{d.closeSync(h)}catch{}else d.closeSync(h)}return g}):d.futimes&&(d.lutimes=function(f,m,p,h){h&&process.nextTick(h)},d.lutimesSync=function(){})}function n(d){return d&&function(f,m,p){return d.call(t,f,m,function(h){l(h)&&(h=null),p&&p.apply(this,arguments)})}}function i(d){return d&&function(f,m){try{return d.call(t,f,m)}catch(p){if(!l(p))throw p}}}function s(d){return d&&function(f,m,p,h){return d.call(t,f,m,p,function(g){l(g)&&(g=null),h&&h.apply(this,arguments)})}}function a(d){return d&&function(f,m,p){try{return d.call(t,f,m,p)}catch(h){if(!l(h))throw h}}}function o(d){return d&&function(f,m,p){typeof m=="function"&&(p=m,m=null);function h(g,S){S&&(S.uid<0&&(S.uid+=4294967296),S.gid<0&&(S.gid+=4294967296)),p&&p.apply(this,arguments)}return m?d.call(t,f,m,h):d.call(t,f,h)}}function c(d){return d&&function(f,m){var p=m?d.call(t,f,m):d.call(t,f);return p&&(p.uid<0&&(p.uid+=4294967296),p.gid<0&&(p.gid+=4294967296)),p}}function l(d){if(!d||d.code==="ENOSYS")return!0;var f=!process.getuid||process.getuid()!==0;return!!(f&&(d.code==="EINVAL"||d.code==="EPERM"))}}});var $w=_((oqe,qw)=>{"use strict";u();var Hw=require("stream").Stream;qw.exports=Sle;function Sle(t){return{ReadStream:e,WriteStream:r};function e(n,i){if(!(this instanceof e))return new e(n,i);Hw.call(this);var s=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,i=i||{};for(var a=Object.keys(i),o=0,c=a.length;o<c;o++){var l=a[o];this[l]=i[l]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){s._read()});return}t.open(this.path,this.flags,this.mode,function(d,f){if(d){s.emit("error",d),s.readable=!1;return}s.fd=f,s.emit("open",f),s._read()})}function r(n,i){if(!(this instanceof r))return new r(n,i);Hw.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,i=i||{};for(var s=Object.keys(i),a=0,o=s.length;a<o;a++){var c=s[a];this[c]=i[c]}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=t.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}});var Vw=_((lqe,Yw)=>{"use strict";u();Yw.exports=Tle;var ble=Object.getPrototypeOf||function(t){return t.__proto__};function Tle(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var e={__proto__:ble(t)};else var e=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}});var jw=_((dqe,rT)=>{"use strict";u();var Wt=require("fs"),yle=Gw(),xle=$w(),Cle=Vw(),Bm=require("util"),Pr,Gm;typeof Symbol=="function"&&typeof Symbol.for=="function"?(Pr=Symbol.for("graceful-fs.queue"),Gm=Symbol.for("graceful-fs.previous")):(Pr="___graceful-fs.queue",Gm="___graceful-fs.previous");function Dle(){}function zw(t,e){Object.defineProperty(t,Pr,{get:function(){return e}})}var Eo=Dle;Bm.debuglog?Eo=Bm.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Eo=function(){var t=Bm.format.apply(Bm,arguments);t="GFS4: "+t.split(/\n/).join(` GFS4: `),console.error(t)});Wt[Pr]||(Ww=global[Pr]||[],zw(Wt,Ww),Wt.close=function(t){function e(r,n){return t.call(Wt,r,function(i){i||Kw(),typeof n=="function"&&n.apply(this,arguments)})}return Object.defineProperty(e,Gm,{value:t}),e}(Wt.close),Wt.closeSync=function(t){function e(r){t.apply(Wt,arguments),Kw()}return Object.defineProperty(e,Gm,{value:t}),e}(Wt.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){Eo(Wt[Pr]),require("assert").equal(Wt[Pr].length,0)}));var Ww;global[Pr]||zw(global,Wt[Pr]);rT.exports=eT(Cle(Wt));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!Wt.__patched&&(rT.exports=eT(Wt),Wt.__patched=!0);function eT(t){yle(t),t.gracefulify=eT,t.createReadStream=U,t.createWriteStream=z;var e=t.readFile;t.readFile=r;function r(R,v,G){return typeof v=="function"&&(G=v,v=null),te(R,v,G);function te(se,oe,re,ge){return e(se,oe,function(le){le&&(le.code==="EMFILE"||le.code==="ENFILE")?qc([te,[se,oe,re],le,ge||Date.now(),Date.now()]):typeof re=="function"&&re.apply(this,arguments)})}}var n=t.writeFile;t.writeFile=i;function i(R,v,G,te){return typeof G=="function"&&(te=G,G=null),se(R,v,G,te);function se(oe,re,ge,le,Ee){return n(oe,re,ge,function(be){be&&(be.code==="EMFILE"||be.code==="ENFILE")?qc([se,[oe,re,ge,le],be,Ee||Date.now(),Date.now()]):typeof le=="function"&&le.apply(this,arguments)})}}var s=t.appendFile;s&&(t.appendFile=a);function a(R,v,G,te){return typeof G=="function"&&(te=G,G=null),se(R,v,G,te);function se(oe,re,ge,le,Ee){return s(oe,re,ge,function(be){be&&(be.code==="EMFILE"||be.code==="ENFILE")?qc([se,[oe,re,ge,le],be,Ee||Date.now(),Date.now()]):typeof le=="function"&&le.apply(this,arguments)})}}var o=t.copyFile;o&&(t.copyFile=c);function c(R,v,G,te){return typeof G=="function"&&(te=G,G=0),se(R,v,G,te);function se(oe,re,ge,le,Ee){return o(oe,re,ge,function(be){be&&(be.code==="EMFILE"||be.code==="ENFILE")?qc([se,[oe,re,ge,le],be,Ee||Date.now(),Date.now()]):typeof le=="function"&&le.apply(this,arguments)})}}var l=t.readdir;t.readdir=f;var d=/^v[0-5]\./;function f(R,v,G){typeof v=="function"&&(G=v,v=null);var te=d.test(process.version)?function(re,ge,le,Ee){return l(re,se(re,ge,le,Ee))}:function(re,ge,le,Ee){return l(re,ge,se(re,ge,le,Ee))};return te(R,v,G);function se(oe,re,ge,le){return function(Ee,be){Ee&&(Ee.code==="EMFILE"||Ee.code==="ENFILE")?qc([te,[oe,re,ge],Ee,le||Date.now(),Date.now()]):(be&&be.sort&&be.sort(),typeof ge=="function"&&ge.call(this,Ee,be))}}}if(process.version.substr(0,4)==="v0.8"){var m=xle(t);b=m.ReadStream,D=m.WriteStream}var p=t.ReadStream;p&&(b.prototype=Object.create(p.prototype),b.prototype.open=C);var h=t.WriteStream;h&&(D.prototype=Object.create(h.prototype),D.prototype.open=N),Object.defineProperty(t,"ReadStream",{get:function(){return b},set:function(R){b=R},enumerable:!0,configurable:!0}),Object.defineProperty(t,"WriteStream",{get:function(){return D},set:function(R){D=R},enumerable:!0,configurable:!0});var g=b;Object.defineProperty(t,"FileReadStream",{get:function(){return g},set:function(R){g=R},enumerable:!0,configurable:!0});var S=D;Object.defineProperty(t,"FileWriteStream",{get:function(){return S},set:function(R){S=R},enumerable:!0,configurable:!0});function b(R,v){return this instanceof b?(p.apply(this,arguments),this):b.apply(Object.create(b.prototype),arguments)}function C(){var R=this;w(R.path,R.flags,R.mode,function(v,G){v?(R.autoClose&&R.destroy(),R.emit("error",v)):(R.fd=G,R.emit("open",G),R.read())})}function D(R,v){return this instanceof D?(h.apply(this,arguments),this):D.apply(Object.create(D.prototype),arguments)}function N(){var R=this;w(R.path,R.flags,R.mode,function(v,G){v?(R.destroy(),R.emit("error",v)):(R.fd=G,R.emit("open",G))})}function U(R,v){return new t.ReadStream(R,v)}function z(R,v){return new t.WriteStream(R,v)}var q=t.open;t.open=w;function w(R,v,G,te){return typeof G=="function"&&(te=G,G=null),se(R,v,G,te);function se(oe,re,ge,le,Ee){return q(oe,re,ge,function(be,ut){be&&(be.code==="EMFILE"||be.code==="ENFILE")?qc([se,[oe,re,ge,le],be,Ee||Date.now(),Date.now()]):typeof le=="function"&&le.apply(this,arguments)})}}return t}function qc(t){Eo("ENQUEUE",t[0].name,t[1]),Wt[Pr].push(t),tT()}var Um;function Kw(){for(var t=Date.now(),e=0;e<Wt[Pr].length;++e)Wt[Pr][e].length>2&&(Wt[Pr][e][3]=t,Wt[Pr][e][4]=t);tT()}function tT(){if(clearTimeout(Um),Um=void 0,Wt[Pr].length!==0){var t=Wt[Pr].shift(),e=t[0],r=t[1],n=t[2],i=t[3],s=t[4];if(i===void 0)Eo("RETRY",e.name,r),e.apply(null,r);else if(Date.now()-i>=6e4){Eo("TIMEOUT",e.name,r);var a=r.pop();typeof a=="function"&&a.call(null,n)}else{var o=Date.now()-s,c=Math.max(s-i,1),l=Math.min(c*1.2,100);o>=l?(Eo("RETRY",e.name,r),e.apply(null,r.concat([i]))):Wt[Pr].push(t)}Um===void 0&&(Um=setTimeout(tT,0))}}});var Zw=_((Eqe,nT)=>{"use strict";u();(function(){var t;function e(r,n){var i=this instanceof e?this:t;if(i.reset(n),typeof r=="string"&&r.length>0&&i.hash(r),i!==this)return i}e.prototype.hash=function(r){var n,i,s,a,o;switch(o=r.length,this.len+=o,i=this.k1,s=0,this.rem){case 0:i^=o>s?r.charCodeAt(s++)&65535:0;case 1:i^=o>s?(r.charCodeAt(s++)&65535)<<8:0;case 2:i^=o>s?(r.charCodeAt(s++)&65535)<<16:0;case 3:i^=o>s?(r.charCodeAt(s)&255)<<24:0,i^=o>s?(r.charCodeAt(s++)&65280)>>8:0}if(this.rem=o+this.rem&3,o-=this.rem,o>0){for(n=this.h1;i=i*11601+(i&65535)*3432906752&4294967295,i=i<<15|i>>>17,i=i*13715+(i&65535)*461832192&4294967295,n^=i,n=n<<13|n>>>19,n=n*5+3864292196&4294967295,!(s>=o);)i=r.charCodeAt(s++)&65535^(r.charCodeAt(s++)&65535)<<8^(r.charCodeAt(s++)&65535)<<16,a=r.charCodeAt(s++),i^=(a&255)<<24^(a&65280)>>8;switch(i=0,this.rem){case 3:i^=(r.charCodeAt(s+2)&65535)<<16;case 2:i^=(r.charCodeAt(s+1)&65535)<<8;case 1:i^=r.charCodeAt(s)&65535}this.h1=n}return this.k1=i,this},e.prototype.result=function(){var r,n;return r=this.k1,n=this.h1,r>0&&(r=r*11601+(r&65535)*3432906752&4294967295,r=r<<15|r>>>17,r=r*13715+(r&65535)*461832192&4294967295,n^=r),n^=this.len,n^=n>>>16,n=n*51819+(n&65535)*2246770688&4294967295,n^=n>>>13,n=n*44597+(n&65535)*3266445312&4294967295,n^=n>>>16,n>>>0},e.prototype.reset=function(r){return this.h1=typeof r=="number"?r:0,this.rem=this.k1=this.len=0,this},t=new e,typeof nT<"u"?nT.exports=e:this.MurmurHash3=e})()});var Jw=_((bqe,Hm)=>{"use strict";u();Hm.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];process.platform!=="win32"&&Hm.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&Hm.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var Vm=_((yqe,Wc)=>{"use strict";u();var Mt=global.process,bo=function(t){return t&&typeof t=="object"&&typeof t.removeListener=="function"&&typeof t.emit=="function"&&typeof t.reallyExit=="function"&&typeof t.listeners=="function"&&typeof t.kill=="function"&&typeof t.pid=="number"&&typeof t.on=="function"};bo(Mt)?(eL=require("assert"),Yc=Jw(),tL=/^win/i.test(Mt.platform),rd=require("events"),typeof rd!="function"&&(rd=rd.EventEmitter),Mt.__signal_exit_emitter__?Cr=Mt.__signal_exit_emitter__:(Cr=Mt.__signal_exit_emitter__=new rd,Cr.count=0,Cr.emitted={}),Cr.infinite||(Cr.setMaxListeners(1/0),Cr.infinite=!0),Wc.exports=function(t,e){if(!bo(global.process))return function(){};eL.equal(typeof t,"function","a callback must be provided for exit handler"),Vc===!1&&iT();var r="exit";e&&e.alwaysLast&&(r="afterexit");var n=function(){Cr.removeListener(r,t),Cr.listeners("exit").length===0&&Cr.listeners("afterexit").length===0&&qm()};return Cr.on(r,t),n},qm=function(){!Vc||!bo(global.process)||(Vc=!1,Yc.forEach(function(e){try{Mt.removeListener(e,$m[e])}catch{}}),Mt.emit=Ym,Mt.reallyExit=sT,Cr.count-=1)},Wc.exports.unload=qm,To=function(e,r,n){Cr.emitted[e]||(Cr.emitted[e]=!0,Cr.emit(e,r,n))},$m={},Yc.forEach(function(t){$m[t]=function(){if(bo(global.process)){var r=Mt.listeners(t);r.length===Cr.count&&(qm(),To("exit",null,t),To("afterexit",null,t),tL&&t==="SIGHUP"&&(t="SIGINT"),Mt.kill(Mt.pid,t))}}}),Wc.exports.signals=function(){return Yc},Vc=!1,iT=function(){Vc||!bo(global.process)||(Vc=!0,Cr.count+=1,Yc=Yc.filter(function(e){try{return Mt.on(e,$m[e]),!0}catch{return!1}}),Mt.emit=nL,Mt.reallyExit=rL)},Wc.exports.load=iT,sT=Mt.reallyExit,rL=function(e){bo(global.process)&&(Mt.exitCode=e||0,To("exit",Mt.exitCode,null),To("afterexit",Mt.exitCode,null),sT.call(Mt,Mt.exitCode))},Ym=Mt.emit,nL=function(e,r){if(e==="exit"&&bo(global.process)){r!==void 0&&(Mt.exitCode=r);var n=Ym.apply(this,arguments);return To("exit",Mt.exitCode,null),To("afterexit",Mt.exitCode,null),n}else return Ym.apply(this,arguments)}):Wc.exports=function(){return function(){}};var eL,Yc,tL,rd,Cr,qm,To,$m,Vc,iT,sT,rL,Ym,nL});var oT=_((Cqe,aL)=>{"use strict";u();aL.exports=aT;aT.strict=iL;aT.loose=sL;var Ole=Object.prototype.toString,Nle={"[object Int8Array]":!0,"[object Int16Array]":!0,"[object Int32Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Uint16Array]":!0,"[object Uint32Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0};function aT(t){return iL(t)||sL(t)}function iL(t){return t instanceof Int8Array||t instanceof Int16Array||t instanceof Int32Array||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Uint16Array||t instanceof Uint32Array||t instanceof Float32Array||t instanceof Float64Array}function sL(t){return Nle[Ole.call(t)]}});var cL=_((Aqe,oL)=>{"use strict";u();var vle=oT().strict;oL.exports=function(e){if(vle(e)){var r=Buffer.from(e.buffer);return e.byteLength!==e.buffer.byteLength&&(r=r.slice(e.byteOffset,e.byteOffset+e.byteLength)),r}else return Buffer.from(e)}});var fL=_((Oqe,nd)=>{"use strict";u();nd.exports=kle;nd.exports.sync=Ble;nd.exports._getTmpname=cT;nd.exports._cleanupOnExit=lT;var Ft=require("fs"),Ile=Zw(),lL=Vm(),wle=require("path"),uL=oT(),dL=cL(),{promisify:Qn}=require("util"),fa={},Lle=function(){try{return require("worker_threads").threadId}catch{return 0}}(),Ple=0;function cT(t){return t+"."+Ile(__filename).hash(String(process.pid)).hash(String(Lle)).hash(String(++Ple)).result()}function lT(t){return()=>{try{Ft.unlinkSync(typeof t=="function"?t():t)}catch{}}}function Mle(t){return new Promise(e=>{fa[t]||(fa[t]=[]),fa[t].push(e),fa[t].length===1&&e()})}function Wm(t){return t.code==="ENOSYS"||(!process.getuid||process.getuid()!==0)&&(t.code==="EINVAL"||t.code==="EPERM")}async function Fle(t,e,r={}){typeof r=="string"&&(r={encoding:r});let n,i,s=lL(lT(()=>i)),a=wle.resolve(t);try{await Mle(a);let o=await Qn(Ft.realpath)(t).catch(()=>t);if(i=cT(o),!r.mode||!r.chown){let c=await Qn(Ft.stat)(o).catch(()=>{});c&&(r.mode==null&&(r.mode=c.mode),r.chown==null&&process.getuid&&(r.chown={uid:c.uid,gid:c.gid}))}n=await Qn(Ft.open)(i,"w",r.mode),r.tmpfileCreated&&await r.tmpfileCreated(i),uL(e)&&(e=dL(e)),Buffer.isBuffer(e)?await Qn(Ft.write)(n,e,0,e.length,0):e!=null&&await Qn(Ft.write)(n,String(e),0,String(r.encoding||"utf8")),r.fsync!==!1&&await Qn(Ft.fsync)(n),await Qn(Ft.close)(n),n=null,r.chown&&await Qn(Ft.chown)(i,r.chown.uid,r.chown.gid).catch(c=>{if(!Wm(c))throw c}),r.mode&&await Qn(Ft.chmod)(i,r.mode).catch(c=>{if(!Wm(c))throw c}),await Qn(Ft.rename)(i,o)}finally{n&&await Qn(Ft.close)(n).catch(()=>{}),s(),await Qn(Ft.unlink)(i).catch(()=>{}),fa[a].shift(),fa[a].length>0?fa[a][0]():delete fa[a]}}function kle(t,e,r,n){r instanceof Function&&(n=r,r={});let i=Fle(t,e,r);return n&&i.then(n,n),i}function Ble(t,e,r){typeof r=="string"?r={encoding:r}:r||(r={});try{t=Ft.realpathSync(t)}catch{}let n=cT(t);if(!r.mode||!r.chown)try{let c=Ft.statSync(t);r=Object.assign({},r),r.mode||(r.mode=c.mode),!r.chown&&process.getuid&&(r.chown={uid:c.uid,gid:c.gid})}catch{}let i,s=lT(n),a=lL(s),o=!0;try{if(i=Ft.openSync(n,"w",r.mode||438),r.tmpfileCreated&&r.tmpfileCreated(n),uL(e)&&(e=dL(e)),Buffer.isBuffer(e)?Ft.writeSync(i,e,0,e.length,0):e!=null&&Ft.writeSync(i,String(e),0,String(r.encoding||"utf8")),r.fsync!==!1&&Ft.fsyncSync(i),Ft.closeSync(i),i=null,r.chown)try{Ft.chownSync(n,r.chown.uid,r.chown.gid)}catch(c){if(!Wm(c))throw c}if(r.mode)try{Ft.chmodSync(n,r.mode)}catch(c){if(!Wm(c))throw c}Ft.renameSync(n,t),o=!1}finally{if(i)try{Ft.closeSync(i)}catch{}a(),o&&s()}}});var mL=_((vqe,pL)=>{"use strict";u();pL.exports=t=>{let e=typeof t;return t!==null&&(e==="object"||e==="function")}});var _L=_((wqe,hL)=>{"use strict";u();var yo=mL(),Ule=new Set(["__proto__","prototype","constructor"]),Gle=t=>!t.some(e=>Ule.has(e));function Km(t){let e=t.split("."),r=[];for(let n=0;n<e.length;n++){let i=e[n];for(;i[i.length-1]==="\\"&&e[n+1]!==void 0;)i=i.slice(0,-1)+".",i+=e[++n];r.push(i)}return Gle(r)?r:[]}hL.exports={get(t,e,r){if(!yo(t)||typeof e!="string")return r===void 0?t:r;let n=Km(e);if(n.length!==0){for(let i=0;i<n.length;i++)if(t=t[n[i]],t==null){if(i!==n.length-1)return r;break}return t===void 0?r:t}},set(t,e,r){if(!yo(t)||typeof e!="string")return t;let n=t,i=Km(e);for(let s=0;s<i.length;s++){let a=i[s];yo(t[a])||(t[a]={}),s===i.length-1&&(t[a]=r),t=t[a]}return n},delete(t,e){if(!yo(t)||typeof e!="string")return!1;let r=Km(e);for(let n=0;n<r.length;n++){let i=r[n];if(n===r.length-1)return delete t[i],!0;if(t=t[i],!yo(t))return!1}},has(t,e){if(!yo(t)||typeof e!="string")return!1;let r=Km(e);if(r.length===0)return!1;for(let n=0;n<r.length;n++)if(yo(t)){if(!(r[n]in t))return!1;t=t[r[n]]}else return!1;return!0}}});var od=_((r$e,FL)=>{"use strict";u();var pue="2.0.0",mue=Number.MAX_SAFE_INTEGER||9007199254740991,hue=16,_ue=250,gue=["major","premajor","minor","preminor","patch","prepatch","prerelease"];FL.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:hue,MAX_SAFE_BUILD_LENGTH:_ue,MAX_SAFE_INTEGER:mue,RELEASE_TYPES:gue,SEMVER_SPEC_VERSION:pue,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var cd=_((i$e,kL)=>{"use strict";u();var Eue=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};kL.exports=Eue});var Xc=_((ji,BL)=>{"use strict";u();var{MAX_SAFE_COMPONENT_LENGTH:gT,MAX_SAFE_BUILD_LENGTH:Sue,MAX_LENGTH:bue}=od(),Tue=cd();ji=BL.exports={};var yue=ji.re=[],xue=ji.safeRe=[],xe=ji.src=[],Cue=ji.safeSrc=[],Ce=ji.t={},Due=0,ET="[a-zA-Z0-9-]",Aue=[["\\s",1],["\\d",bue],[ET,Sue]],Rue=t=>{for(let[e,r]of Aue)t=t.split(`${e}*`).join(`${e}{0,${r}}`).split(`${e}+`).join(`${e}{1,${r}}`);return t},Ke=(t,e,r)=>{let n=Rue(e),i=Due++;Tue(t,i,e),Ce[t]=i,xe[i]=e,Cue[i]=n,yue[i]=new RegExp(e,r?"g":void 0),xue[i]=new RegExp(n,r?"g":void 0)};Ke("NUMERICIDENTIFIER","0|[1-9]\\d*");Ke("NUMERICIDENTIFIERLOOSE","\\d+");Ke("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${ET}*`);Ke("MAINVERSION",`(${xe[Ce.NUMERICIDENTIFIER]})\\.(${xe[Ce.NUMERICIDENTIFIER]})\\.(${xe[Ce.NUMERICIDENTIFIER]})`);Ke("MAINVERSIONLOOSE",`(${xe[Ce.NUMERICIDENTIFIERLOOSE]})\\.(${xe[Ce.NUMERICIDENTIFIERLOOSE]})\\.(${xe[Ce.NUMERICIDENTIFIERLOOSE]})`);Ke("PRERELEASEIDENTIFIER",`(?:${xe[Ce.NUMERICIDENTIFIER]}|${xe[Ce.NONNUMERICIDENTIFIER]})`);Ke("PRERELEASEIDENTIFIERLOOSE",`(?:${xe[Ce.NUMERICIDENTIFIERLOOSE]}|${xe[Ce.NONNUMERICIDENTIFIER]})`);Ke("PRERELEASE",`(?:-(${xe[Ce.PRERELEASEIDENTIFIER]}(?:\\.${xe[Ce.PRERELEASEIDENTIFIER]})*))`);Ke("PRERELEASELOOSE",`(?:-?(${xe[Ce.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${xe[Ce.PRERELEASEIDENTIFIERLOOSE]})*))`);Ke("BUILDIDENTIFIER",`${ET}+`);Ke("BUILD",`(?:\\+(${xe[Ce.BUILDIDENTIFIER]}(?:\\.${xe[Ce.BUILDIDENTIFIER]})*))`);Ke("FULLPLAIN",`v?${xe[Ce.MAINVERSION]}${xe[Ce.PRERELEASE]}?${xe[Ce.BUILD]}?`);Ke("FULL",`^${xe[Ce.FULLPLAIN]}$`);Ke("LOOSEPLAIN",`[v=\\s]*${xe[Ce.MAINVERSIONLOOSE]}${xe[Ce.PRERELEASELOOSE]}?${xe[Ce.BUILD]}?`);Ke("LOOSE",`^${xe[Ce.LOOSEPLAIN]}$`);Ke("GTLT","((?:<|>)?=?)");Ke("XRANGEIDENTIFIERLOOSE",`${xe[Ce.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);Ke("XRANGEIDENTIFIER",`${xe[Ce.NUMERICIDENTIFIER]}|x|X|\\*`);Ke("XRANGEPLAIN",`[v=\\s]*(${xe[Ce.XRANGEIDENTIFIER]})(?:\\.(${xe[Ce.XRANGEIDENTIFIER]})(?:\\.(${xe[Ce.XRANGEIDENTIFIER]})(?:${xe[Ce.PRERELEASE]})?${xe[Ce.BUILD]}?)?)?`);Ke("XRANGEPLAINLOOSE",`[v=\\s]*(${xe[Ce.XRANGEIDENTIFIERLOOSE]})(?:\\.(${xe[Ce.XRANGEIDENTIFIERLOOSE]})(?:\\.(${xe[Ce.XRANGEIDENTIFIERLOOSE]})(?:${xe[Ce.PRERELEASELOOSE]})?${xe[Ce.BUILD]}?)?)?`);Ke("XRANGE",`^${xe[Ce.GTLT]}\\s*${xe[Ce.XRANGEPLAIN]}$`);Ke("XRANGELOOSE",`^${xe[Ce.GTLT]}\\s*${xe[Ce.XRANGEPLAINLOOSE]}$`);Ke("COERCEPLAIN",`(^|[^\\d])(\\d{1,${gT}})(?:\\.(\\d{1,${gT}}))?(?:\\.(\\d{1,${gT}}))?`);Ke("COERCE",`${xe[Ce.COERCEPLAIN]}(?:$|[^\\d])`);Ke("COERCEFULL",xe[Ce.COERCEPLAIN]+`(?:${xe[Ce.PRERELEASE]})?(?:${xe[Ce.BUILD]})?(?:$|[^\\d])`);Ke("COERCERTL",xe[Ce.COERCE],!0);Ke("COERCERTLFULL",xe[Ce.COERCEFULL],!0);Ke("LONETILDE","(?:~>?)");Ke("TILDETRIM",`(\\s*)${xe[Ce.LONETILDE]}\\s+`,!0);ji.tildeTrimReplace="$1~";Ke("TILDE",`^${xe[Ce.LONETILDE]}${xe[Ce.XRANGEPLAIN]}$`);Ke("TILDELOOSE",`^${xe[Ce.LONETILDE]}${xe[Ce.XRANGEPLAINLOOSE]}$`);Ke("LONECARET","(?:\\^)");Ke("CARETTRIM",`(\\s*)${xe[Ce.LONECARET]}\\s+`,!0);ji.caretTrimReplace="$1^";Ke("CARET",`^${xe[Ce.LONECARET]}${xe[Ce.XRANGEPLAIN]}$`);Ke("CARETLOOSE",`^${xe[Ce.LONECARET]}${xe[Ce.XRANGEPLAINLOOSE]}$`);Ke("COMPARATORLOOSE",`^${xe[Ce.GTLT]}\\s*(${xe[Ce.LOOSEPLAIN]})$|^$`);Ke("COMPARATOR",`^${xe[Ce.GTLT]}\\s*(${xe[Ce.FULLPLAIN]})$|^$`);Ke("COMPARATORTRIM",`(\\s*)${xe[Ce.GTLT]}\\s*(${xe[Ce.LOOSEPLAIN]}|${xe[Ce.XRANGEPLAIN]})`,!0);ji.comparatorTrimReplace="$1$2$3";Ke("HYPHENRANGE",`^\\s*(${xe[Ce.XRANGEPLAIN]})\\s+-\\s+(${xe[Ce.XRANGEPLAIN]})\\s*$`);Ke("HYPHENRANGELOOSE",`^\\s*(${xe[Ce.XRANGEPLAINLOOSE]})\\s+-\\s+(${xe[Ce.XRANGEPLAINLOOSE]})\\s*$`);Ke("STAR","(<|>)?=?\\s*\\*");Ke("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");Ke("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var Zm=_((o$e,UL)=>{"use strict";u();var Oue=Object.freeze({loose:!0}),Nue=Object.freeze({}),vue=t=>t?typeof t!="object"?Oue:t:Nue;UL.exports=vue});var ST=_((l$e,qL)=>{"use strict";u();var GL=/^[0-9]+$/,HL=(t,e)=>{let r=GL.test(t),n=GL.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:t<e?-1:1},Iue=(t,e)=>HL(e,t);qL.exports={compareIdentifiers:HL,rcompareIdentifiers:Iue}});var Kr=_((d$e,WL)=>{"use strict";u();var Jm=cd(),{MAX_LENGTH:$L,MAX_SAFE_INTEGER:eh}=od(),{safeRe:YL,safeSrc:VL,t:th}=Xc(),wue=Zm(),{compareIdentifiers:Zc}=ST(),bT=class t{constructor(e,r){if(r=wue(r),e instanceof t){if(e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>$L)throw new TypeError(`version is longer than ${$L} characters`);Jm("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let n=e.trim().match(r.loose?YL[th.LOOSE]:YL[th.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>eh||this.major<0)throw new TypeError("Invalid major version");if(this.minor>eh||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>eh||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){let s=+i;if(s>=0&&s<eh)return s}return i}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(Jm("SemVer.compare",this.version,this.options,e),!(e instanceof t)){if(typeof e=="string"&&e===this.version)return 0;e=new t(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof t||(e=new t(e,this.options)),Zc(this.major,e.major)||Zc(this.minor,e.minor)||Zc(this.patch,e.patch)}comparePre(e){if(e instanceof t||(e=new t(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let r=0;do{let n=this.prerelease[r],i=e.prerelease[r];if(Jm("prerelease compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return Zc(n,i)}while(++r)}compareBuild(e){e instanceof t||(e=new t(e,this.options));let r=0;do{let n=this.build[r],i=e.build[r];if(Jm("build compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return Zc(n,i)}while(++r)}inc(e,r,n){if(e.startsWith("pre")){if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(r){let i=new RegExp(`^${this.options.loose?VL[th.PRERELEASELOOSE]:VL[th.PRERELEASE]}$`),s=`-${r}`.match(i);if(!s||s[1]!==r)throw new Error(`invalid identifier: ${r}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,n),this.inc("pre",r,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,n),this.inc("pre",r,n);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let i=Number(n)?1:0;if(this.prerelease.length===0)this.prerelease=[i];else{let s=this.prerelease.length;for(;--s>=0;)typeof this.prerelease[s]=="number"&&(this.prerelease[s]++,s=-2);if(s===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(r){let s=[r,i];n===!1&&(s=[r]),Zc(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=s):this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};WL.exports=bT});var Co=_((p$e,zL)=>{"use strict";u();var KL=Kr(),Lue=(t,e,r=!1)=>{if(t instanceof KL)return t;try{return new KL(t,e)}catch(n){if(!r)return null;throw n}};zL.exports=Lue});var QL=_((h$e,jL)=>{"use strict";u();var Pue=Co(),Mue=(t,e)=>{let r=Pue(t,e);return r?r.version:null};jL.exports=Mue});var ZL=_((g$e,XL)=>{"use strict";u();var Fue=Co(),kue=(t,e)=>{let r=Fue(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null};XL.exports=kue});var t9=_((S$e,e9)=>{"use strict";u();var JL=Kr(),Bue=(t,e,r,n,i)=>{typeof r=="string"&&(i=n,n=r,r=void 0);try{return new JL(t instanceof JL?t.version:t,r).inc(e,n,i).version}catch{return null}};e9.exports=Bue});var i9=_((T$e,n9)=>{"use strict";u();var r9=Co(),Uue=(t,e)=>{let r=r9(t,null,!0),n=r9(e,null,!0),i=r.compare(n);if(i===0)return null;let s=i>0,a=s?r:n,o=s?n:r,c=!!a.prerelease.length;if(!!o.prerelease.length&&!c){if(!o.patch&&!o.minor)return"major";if(o.compareMain(a)===0)return o.minor&&!o.patch?"minor":"patch"}let d=c?"pre":"";return r.major!==n.major?d+"major":r.minor!==n.minor?d+"minor":r.patch!==n.patch?d+"patch":"prerelease"};n9.exports=Uue});var a9=_((x$e,s9)=>{"use strict";u();var Gue=Kr(),Hue=(t,e)=>new Gue(t,e).major;s9.exports=Hue});var c9=_((D$e,o9)=>{"use strict";u();var que=Kr(),$ue=(t,e)=>new que(t,e).minor;o9.exports=$ue});var u9=_((R$e,l9)=>{"use strict";u();var Yue=Kr(),Vue=(t,e)=>new Yue(t,e).patch;l9.exports=Vue});var f9=_((N$e,d9)=>{"use strict";u();var Wue=Co(),Kue=(t,e)=>{let r=Wue(t,e);return r&&r.prerelease.length?r.prerelease:null};d9.exports=Kue});var Zn=_((I$e,m9)=>{"use strict";u();var p9=Kr(),zue=(t,e,r)=>new p9(t,r).compare(new p9(e,r));m9.exports=zue});var _9=_((L$e,h9)=>{"use strict";u();var jue=Zn(),Que=(t,e,r)=>jue(e,t,r);h9.exports=Que});var E9=_((M$e,g9)=>{"use strict";u();var Xue=Zn(),Zue=(t,e)=>Xue(t,e,!0);g9.exports=Zue});var rh=_((k$e,b9)=>{"use strict";u();var S9=Kr(),Jue=(t,e,r)=>{let n=new S9(t,r),i=new S9(e,r);return n.compare(i)||n.compareBuild(i)};b9.exports=Jue});var y9=_((U$e,T9)=>{"use strict";u();var ede=rh(),tde=(t,e)=>t.sort((r,n)=>ede(r,n,e));T9.exports=tde});var C9=_((H$e,x9)=>{"use strict";u();var rde=rh(),nde=(t,e)=>t.sort((r,n)=>rde(n,r,e));x9.exports=nde});var ld=_(($$e,D9)=>{"use strict";u();var ide=Zn(),sde=(t,e,r)=>ide(t,e,r)>0;D9.exports=sde});var nh=_((V$e,A9)=>{"use strict";u();var ade=Zn(),ode=(t,e,r)=>ade(t,e,r)<0;A9.exports=ode});var TT=_((K$e,R9)=>{"use strict";u();var cde=Zn(),lde=(t,e,r)=>cde(t,e,r)===0;R9.exports=lde});var yT=_((j$e,O9)=>{"use strict";u();var ude=Zn(),dde=(t,e,r)=>ude(t,e,r)!==0;O9.exports=dde});var ih=_((X$e,N9)=>{"use strict";u();var fde=Zn(),pde=(t,e,r)=>fde(t,e,r)>=0;N9.exports=pde});var sh=_((J$e,v9)=>{"use strict";u();var mde=Zn(),hde=(t,e,r)=>mde(t,e,r)<=0;v9.exports=hde});var xT=_((tYe,I9)=>{"use strict";u();var _de=TT(),gde=yT(),Ede=ld(),Sde=ih(),bde=nh(),Tde=sh(),yde=(t,e,r,n)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t===r;case"!==":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t!==r;case"":case"=":case"==":return _de(t,r,n);case"!=":return gde(t,r,n);case">":return Ede(t,r,n);case">=":return Sde(t,r,n);case"<":return bde(t,r,n);case"<=":return Tde(t,r,n);default:throw new TypeError(`Invalid operator: ${e}`)}};I9.exports=yde});var L9=_((nYe,w9)=>{"use strict";u();var xde=Kr(),Cde=Co(),{safeRe:ah,t:oh}=Xc(),Dde=(t,e)=>{if(t instanceof xde)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let r=null;if(!e.rtl)r=t.match(e.includePrerelease?ah[oh.COERCEFULL]:ah[oh.COERCE]);else{let c=e.includePrerelease?ah[oh.COERCERTLFULL]:ah[oh.COERCERTL],l;for(;(l=c.exec(t))&&(!r||r.index+r[0].length!==t.length);)(!r||l.index+l[0].length!==r.index+r[0].length)&&(r=l),c.lastIndex=l.index+l[1].length+l[2].length;c.lastIndex=-1}if(r===null)return null;let n=r[2],i=r[3]||"0",s=r[4]||"0",a=e.includePrerelease&&r[5]?`-${r[5]}`:"",o=e.includePrerelease&&r[6]?`+${r[6]}`:"";return Cde(`${n}.${i}.${s}${a}${o}`,e)};w9.exports=Dde});var M9=_((sYe,P9)=>{"use strict";u();var CT=class{constructor(){this.max=1e3,this.map=new Map}get(e){let r=this.map.get(e);if(r!==void 0)return this.map.delete(e),this.map.set(e,r),r}delete(e){return this.map.delete(e)}set(e,r){if(!this.delete(e)&&r!==void 0){if(this.map.size>=this.max){let i=this.map.keys().next().value;this.delete(i)}this.map.set(e,r)}return this}};P9.exports=CT});var Jn=_((oYe,U9)=>{"use strict";u();var Ade=/\s+/g,DT=class t{constructor(e,r){if(r=Ode(r),e instanceof t)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new t(e.raw,r);if(e instanceof AT)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=e.trim().replace(Ade," "),this.set=this.raw.split("||").map(n=>this.parseRange(n.trim())).filter(n=>n.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let n=this.set[0];if(this.set=this.set.filter(i=>!k9(i[0])),this.set.length===0)this.set=[n];else if(this.set.length>1){for(let i of this.set)if(i.length===1&&Mde(i[0])){this.set=[i];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");let r=this.set[e];for(let n=0;n<r.length;n++)n>0&&(this.formatted+=" "),this.formatted+=r[n].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let n=((this.options.includePrerelease&&Lde)|(this.options.loose&&Pde))+":"+e,i=F9.get(n);if(i)return i;let s=this.options.loose,a=s?yn[nn.HYPHENRANGELOOSE]:yn[nn.HYPHENRANGE];e=e.replace(a,Vde(this.options.includePrerelease)),Nt("hyphen replace",e),e=e.replace(yn[nn.COMPARATORTRIM],vde),Nt("comparator trim",e),e=e.replace(yn[nn.TILDETRIM],Ide),Nt("tilde trim",e),e=e.replace(yn[nn.CARETTRIM],wde),Nt("caret trim",e);let o=e.split(" ").map(f=>Fde(f,this.options)).join(" ").split(/\s+/).map(f=>Yde(f,this.options));s&&(o=o.filter(f=>(Nt("loose invalid filter",f,this.options),!!f.match(yn[nn.COMPARATORLOOSE])))),Nt("range list",o);let c=new Map,l=o.map(f=>new AT(f,this.options));for(let f of l){if(k9(f))return[f];c.set(f.value,f)}c.size>1&&c.has("")&&c.delete("");let d=[...c.values()];return F9.set(n,d),d}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(n=>B9(n,r)&&e.set.some(i=>B9(i,r)&&n.every(s=>i.every(a=>s.intersects(a,r)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new Nde(e,this.options)}catch{return!1}for(let r=0;r<this.set.length;r++)if(Wde(this.set[r],e,this.options))return!0;return!1}};U9.exports=DT;var Rde=M9(),F9=new Rde,Ode=Zm(),AT=ud(),Nt=cd(),Nde=Kr(),{safeRe:yn,t:nn,comparatorTrimReplace:vde,tildeTrimReplace:Ide,caretTrimReplace:wde}=Xc(),{FLAG_INCLUDE_PRERELEASE:Lde,FLAG_LOOSE:Pde}=od(),k9=t=>t.value==="<0.0.0-0",Mde=t=>t.value==="",B9=(t,e)=>{let r=!0,n=t.slice(),i=n.pop();for(;r&&n.length;)r=n.every(s=>i.intersects(s,e)),i=n.pop();return r},Fde=(t,e)=>(Nt("comp",t,e),t=Ude(t,e),Nt("caret",t),t=kde(t,e),Nt("tildes",t),t=Hde(t,e),Nt("xrange",t),t=$de(t,e),Nt("stars",t),t),sn=t=>!t||t.toLowerCase()==="x"||t==="*",kde=(t,e)=>t.trim().split(/\s+/).map(r=>Bde(r,e)).join(" "),Bde=(t,e)=>{let r=e.loose?yn[nn.TILDELOOSE]:yn[nn.TILDE];return t.replace(r,(n,i,s,a,o)=>{Nt("tilde",t,n,i,s,a,o);let c;return sn(i)?c="":sn(s)?c=`>=${i}.0.0 <${+i+1}.0.0-0`:sn(a)?c=`>=${i}.${s}.0 <${i}.${+s+1}.0-0`:o?(Nt("replaceTilde pr",o),c=`>=${i}.${s}.${a}-${o} <${i}.${+s+1}.0-0`):c=`>=${i}.${s}.${a} <${i}.${+s+1}.0-0`,Nt("tilde return",c),c})},Ude=(t,e)=>t.trim().split(/\s+/).map(r=>Gde(r,e)).join(" "),Gde=(t,e)=>{Nt("caret",t,e);let r=e.loose?yn[nn.CARETLOOSE]:yn[nn.CARET],n=e.includePrerelease?"-0":"";return t.replace(r,(i,s,a,o,c)=>{Nt("caret",t,i,s,a,o,c);let l;return sn(s)?l="":sn(a)?l=`>=${s}.0.0${n} <${+s+1}.0.0-0`:sn(o)?s==="0"?l=`>=${s}.${a}.0${n} <${s}.${+a+1}.0-0`:l=`>=${s}.${a}.0${n} <${+s+1}.0.0-0`:c?(Nt("replaceCaret pr",c),s==="0"?a==="0"?l=`>=${s}.${a}.${o}-${c} <${s}.${a}.${+o+1}-0`:l=`>=${s}.${a}.${o}-${c} <${s}.${+a+1}.0-0`:l=`>=${s}.${a}.${o}-${c} <${+s+1}.0.0-0`):(Nt("no pr"),s==="0"?a==="0"?l=`>=${s}.${a}.${o}${n} <${s}.${a}.${+o+1}-0`:l=`>=${s}.${a}.${o}${n} <${s}.${+a+1}.0-0`:l=`>=${s}.${a}.${o} <${+s+1}.0.0-0`),Nt("caret return",l),l})},Hde=(t,e)=>(Nt("replaceXRanges",t,e),t.split(/\s+/).map(r=>qde(r,e)).join(" ")),qde=(t,e)=>{t=t.trim();let r=e.loose?yn[nn.XRANGELOOSE]:yn[nn.XRANGE];return t.replace(r,(n,i,s,a,o,c)=>{Nt("xRange",t,n,i,s,a,o,c);let l=sn(s),d=l||sn(a),f=d||sn(o),m=f;return i==="="&&m&&(i=""),c=e.includePrerelease?"-0":"",l?i===">"||i==="<"?n="<0.0.0-0":n="*":i&&m?(d&&(a=0),o=0,i===">"?(i=">=",d?(s=+s+1,a=0,o=0):(a=+a+1,o=0)):i==="<="&&(i="<",d?s=+s+1:a=+a+1),i==="<"&&(c="-0"),n=`${i+s}.${a}.${o}${c}`):d?n=`>=${s}.0.0${c} <${+s+1}.0.0-0`:f&&(n=`>=${s}.${a}.0${c} <${s}.${+a+1}.0-0`),Nt("xRange return",n),n})},$de=(t,e)=>(Nt("replaceStars",t,e),t.trim().replace(yn[nn.STAR],"")),Yde=(t,e)=>(Nt("replaceGTE0",t,e),t.trim().replace(yn[e.includePrerelease?nn.GTE0PRE:nn.GTE0],"")),Vde=t=>(e,r,n,i,s,a,o,c,l,d,f,m)=>(sn(n)?r="":sn(i)?r=`>=${n}.0.0${t?"-0":""}`:sn(s)?r=`>=${n}.${i}.0${t?"-0":""}`:a?r=`>=${r}`:r=`>=${r}${t?"-0":""}`,sn(l)?c="":sn(d)?c=`<${+l+1}.0.0-0`:sn(f)?c=`<${l}.${+d+1}.0-0`:m?c=`<=${l}.${d}.${f}-${m}`:t?c=`<${l}.${d}.${+f+1}-0`:c=`<=${c}`,`${r} ${c}`.trim()),Wde=(t,e,r)=>{for(let n=0;n<t.length;n++)if(!t[n].test(e))return!1;if(e.prerelease.length&&!r.includePrerelease){for(let n=0;n<t.length;n++)if(Nt(t[n].semver),t[n].semver!==AT.ANY&&t[n].semver.prerelease.length>0){let i=t[n].semver;if(i.major===e.major&&i.minor===e.minor&&i.patch===e.patch)return!0}return!1}return!0}});var ud=_((lYe,V9)=>{"use strict";u();var dd=Symbol("SemVer ANY"),NT=class t{static get ANY(){return dd}constructor(e,r){if(r=G9(r),e instanceof t){if(e.loose===!!r.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),OT("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===dd?this.value="":this.value=this.operator+this.semver.version,OT("comp",this)}parse(e){let r=this.options.loose?H9[q9.COMPARATORLOOSE]:H9[q9.COMPARATOR],n=e.match(r);if(!n)throw new TypeError(`Invalid comparator: ${e}`);this.operator=n[1]!==void 0?n[1]:"",this.operator==="="&&(this.operator=""),n[2]?this.semver=new $9(n[2],this.options.loose):this.semver=dd}toString(){return this.value}test(e){if(OT("Comparator.test",e,this.options.loose),this.semver===dd||e===dd)return!0;if(typeof e=="string")try{e=new $9(e,this.options)}catch{return!1}return RT(e,this.operator,this.semver,this.options)}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new Y9(e.value,r).test(this.value):e.operator===""?e.value===""?!0:new Y9(this.value,r).test(e.semver):(r=G9(r),r.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!r.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||RT(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||RT(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};V9.exports=NT;var G9=Zm(),{safeRe:H9,t:q9}=Xc(),RT=xT(),OT=cd(),$9=Kr(),Y9=Jn()});var fd=_((dYe,W9)=>{"use strict";u();var Kde=Jn(),zde=(t,e,r)=>{try{e=new Kde(e,r)}catch{return!1}return e.test(t)};W9.exports=zde});var z9=_((pYe,K9)=>{"use strict";u();var jde=Jn(),Qde=(t,e)=>new jde(t,e).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));K9.exports=Qde});var Q9=_((hYe,j9)=>{"use strict";u();var Xde=Kr(),Zde=Jn(),Jde=(t,e,r)=>{let n=null,i=null,s=null;try{s=new Zde(e,r)}catch{return null}return t.forEach(a=>{s.test(a)&&(!n||i.compare(a)===-1)&&(n=a,i=new Xde(n,r))}),n};j9.exports=Jde});var Z9=_((gYe,X9)=>{"use strict";u();var efe=Kr(),tfe=Jn(),rfe=(t,e,r)=>{let n=null,i=null,s=null;try{s=new tfe(e,r)}catch{return null}return t.forEach(a=>{s.test(a)&&(!n||i.compare(a)===1)&&(n=a,i=new efe(n,r))}),n};X9.exports=rfe});var t5=_((SYe,e5)=>{"use strict";u();var vT=Kr(),nfe=Jn(),J9=ld(),ife=(t,e)=>{t=new nfe(t,e);let r=new vT("0.0.0");if(t.test(r)||(r=new vT("0.0.0-0"),t.test(r)))return r;r=null;for(let n=0;n<t.set.length;++n){let i=t.set[n],s=null;i.forEach(a=>{let o=new vT(a.semver.version);switch(a.operator){case">":o.prerelease.length===0?o.patch++:o.prerelease.push(0),o.raw=o.format();case"":case">=":(!s||J9(o,s))&&(s=o);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${a.operator}`)}}),s&&(!r||J9(r,s))&&(r=s)}return r&&t.test(r)?r:null};e5.exports=ife});var n5=_((TYe,r5)=>{"use strict";u();var sfe=Jn(),afe=(t,e)=>{try{return new sfe(t,e).range||"*"}catch{return null}};r5.exports=afe});var ch=_((xYe,o5)=>{"use strict";u();var ofe=Kr(),a5=ud(),{ANY:cfe}=a5,lfe=Jn(),ufe=fd(),i5=ld(),s5=nh(),dfe=sh(),ffe=ih(),pfe=(t,e,r,n)=>{t=new ofe(t,n),e=new lfe(e,n);let i,s,a,o,c;switch(r){case">":i=i5,s=dfe,a=s5,o=">",c=">=";break;case"<":i=s5,s=ffe,a=i5,o="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(ufe(t,e,n))return!1;for(let l=0;l<e.set.length;++l){let d=e.set[l],f=null,m=null;if(d.forEach(p=>{p.semver===cfe&&(p=new a5(">=0.0.0")),f=f||p,m=m||p,i(p.semver,f.semver,n)?f=p:a(p.semver,m.semver,n)&&(m=p)}),f.operator===o||f.operator===c||(!m.operator||m.operator===o)&&s(t,m.semver))return!1;if(m.operator===c&&a(t,m.semver))return!1}return!0};o5.exports=pfe});var l5=_((DYe,c5)=>{"use strict";u();var mfe=ch(),hfe=(t,e,r)=>mfe(t,e,">",r);c5.exports=hfe});var d5=_((RYe,u5)=>{"use strict";u();var _fe=ch(),gfe=(t,e,r)=>_fe(t,e,"<",r);u5.exports=gfe});var m5=_((NYe,p5)=>{"use strict";u();var f5=Jn(),Efe=(t,e,r)=>(t=new f5(t,r),e=new f5(e,r),t.intersects(e,r));p5.exports=Efe});var _5=_((IYe,h5)=>{"use strict";u();var Sfe=fd(),bfe=Zn();h5.exports=(t,e,r)=>{let n=[],i=null,s=null,a=t.sort((d,f)=>bfe(d,f,r));for(let d of a)Sfe(d,e,r)?(s=d,i||(i=d)):(s&&n.push([i,s]),s=null,i=null);i&&n.push([i,null]);let o=[];for(let[d,f]of n)d===f?o.push(d):!f&&d===a[0]?o.push("*"):f?d===a[0]?o.push(`<=${f}`):o.push(`${d} - ${f}`):o.push(`>=${d}`);let c=o.join(" || "),l=typeof e.raw=="string"?e.raw:String(e);return c.length<l.length?c:e}});var y5=_((LYe,T5)=>{"use strict";u();var g5=Jn(),wT=ud(),{ANY:IT}=wT,pd=fd(),LT=Zn(),Tfe=(t,e,r={})=>{if(t===e)return!0;t=new g5(t,r),e=new g5(e,r);let n=!1;e:for(let i of t.set){for(let s of e.set){let a=xfe(i,s,r);if(n=n||a!==null,a)continue e}if(n)return!1}return!0},yfe=[new wT(">=0.0.0-0")],E5=[new wT(">=0.0.0")],xfe=(t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===IT){if(e.length===1&&e[0].semver===IT)return!0;r.includePrerelease?t=yfe:t=E5}if(e.length===1&&e[0].semver===IT){if(r.includePrerelease)return!0;e=E5}let n=new Set,i,s;for(let p of t)p.operator===">"||p.operator===">="?i=S5(i,p,r):p.operator==="<"||p.operator==="<="?s=b5(s,p,r):n.add(p.semver);if(n.size>1)return null;let a;if(i&&s){if(a=LT(i.semver,s.semver,r),a>0)return null;if(a===0&&(i.operator!==">="||s.operator!=="<="))return null}for(let p of n){if(i&&!pd(p,String(i),r)||s&&!pd(p,String(s),r))return null;for(let h of e)if(!pd(p,String(h),r))return!1;return!0}let o,c,l,d,f=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1,m=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1;f&&f.prerelease.length===1&&s.operator==="<"&&f.prerelease[0]===0&&(f=!1);for(let p of e){if(d=d||p.operator===">"||p.operator===">=",l=l||p.operator==="<"||p.operator==="<=",i){if(m&&p.semver.prerelease&&p.semver.prerelease.length&&p.semver.major===m.major&&p.semver.minor===m.minor&&p.semver.patch===m.patch&&(m=!1),p.operator===">"||p.operator===">="){if(o=S5(i,p,r),o===p&&o!==i)return!1}else if(i.operator===">="&&!pd(i.semver,String(p),r))return!1}if(s){if(f&&p.semver.prerelease&&p.semver.prerelease.length&&p.semver.major===f.major&&p.semver.minor===f.minor&&p.semver.patch===f.patch&&(f=!1),p.operator==="<"||p.operator==="<="){if(c=b5(s,p,r),c===p&&c!==s)return!1}else if(s.operator==="<="&&!pd(s.semver,String(p),r))return!1}if(!p.operator&&(s||i)&&a!==0)return!1}return!(i&&l&&!s&&a!==0||s&&d&&!i&&a!==0||m||f)},S5=(t,e,r)=>{if(!t)return e;let n=LT(t.semver,e.semver,r);return n>0?t:n<0||e.operator===">"&&t.operator===">="?e:t},b5=(t,e,r)=>{if(!t)return e;let n=LT(t.semver,e.semver,r);return n<0?t:n>0||e.operator==="<"&&t.operator==="<="?e:t};T5.exports=Tfe});var MT=_((MYe,D5)=>{"use strict";u();var PT=Xc(),x5=od(),Cfe=Kr(),C5=ST(),Dfe=Co(),Afe=QL(),Rfe=ZL(),Ofe=t9(),Nfe=i9(),vfe=a9(),Ife=c9(),wfe=u9(),Lfe=f9(),Pfe=Zn(),Mfe=_9(),Ffe=E9(),kfe=rh(),Bfe=y9(),Ufe=C9(),Gfe=ld(),Hfe=nh(),qfe=TT(),$fe=yT(),Yfe=ih(),Vfe=sh(),Wfe=xT(),Kfe=L9(),zfe=ud(),jfe=Jn(),Qfe=fd(),Xfe=z9(),Zfe=Q9(),Jfe=Z9(),epe=t5(),tpe=n5(),rpe=ch(),npe=l5(),ipe=d5(),spe=m5(),ape=_5(),ope=y5();D5.exports={parse:Dfe,valid:Afe,clean:Rfe,inc:Ofe,diff:Nfe,major:vfe,minor:Ife,patch:wfe,prerelease:Lfe,compare:Pfe,rcompare:Mfe,compareLoose:Ffe,compareBuild:kfe,sort:Bfe,rsort:Ufe,gt:Gfe,lt:Hfe,eq:qfe,neq:$fe,gte:Yfe,lte:Vfe,cmp:Wfe,coerce:Kfe,Comparator:zfe,Range:jfe,satisfies:Qfe,toComparators:Xfe,maxSatisfying:Zfe,minSatisfying:Jfe,minVersion:epe,validRange:tpe,outside:rpe,gtr:npe,ltr:ipe,intersects:spe,simplifyRange:ape,subset:ope,SemVer:Cfe,re:PT.re,src:PT.src,tokens:PT.t,SEMVER_SPEC_VERSION:x5.SEMVER_SPEC_VERSION,RELEASE_TYPES:x5.RELEASE_TYPES,compareIdentifiers:C5.compareIdentifiers,rcompareIdentifiers:C5.rcompareIdentifiers}});var N5=_((UT,GT)=>{"use strict";u();Object.defineProperty(UT,"__esModule",{value:!0});function Tpe(t){return t.encrypted}var BT=(t,e)=>{let r;typeof e=="function"?r={connect:e}:r=e;let n=typeof r.connect=="function",i=typeof r.secureConnect=="function",s=typeof r.close=="function",a=()=>{n&&r.connect(),Tpe(t)&&i&&(t.authorized?r.secureConnect():t.authorizationError||t.once("secureConnect",r.secureConnect)),s&&t.once("close",r.close)};t.writable&&!t.connecting?a():t.connecting?t.once("connect",a):t.destroyed&&s&&r.close(t._hadError)};UT.default=BT;GT.exports=BT;GT.exports.default=BT});var M5=_((XYe,P5)=>{"use strict";u();var{PassThrough:Ope}=require("stream");P5.exports=t=>{t={...t};let{array:e}=t,{encoding:r}=t,n=r==="buffer",i=!1;e?i=!(r||n):r=r||"utf8",n&&(r=null);let s=new Ope({objectMode:i});r&&s.setEncoding(r);let a=0,o=[];return s.on("data",c=>{o.push(c),i?a=o.length:a+=c.length}),s.getBufferedValue=()=>e?o:n?Buffer.concat(o,a):o.join(""),s.getBufferedLength=()=>a,s}});var Sd=_((JYe,Ed)=>{"use strict";u();var{constants:Npe}=require("buffer"),vpe=require("stream"),{promisify:Ipe}=require("util"),wpe=M5(),Lpe=Ipe(vpe.pipeline),mh=class extends Error{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}};async function $T(t,e){if(!t)throw new Error("Expected a stream");e={maxBuffer:1/0,...e};let{maxBuffer:r}=e,n=wpe(e);return await new Promise((i,s)=>{let a=o=>{o&&n.getBufferedLength()<=Npe.MAX_LENGTH&&(o.bufferedData=n.getBufferedValue()),s(o)};(async()=>{try{await Lpe(t,n),i()}catch(o){a(o)}})(),n.on("data",()=>{n.getBufferedLength()>r&&a(new mh)})}),n.getBufferedValue()}Ed.exports=$T;Ed.exports.buffer=(t,e)=>$T(t,{...e,encoding:"buffer"});Ed.exports.array=(t,e)=>$T(t,{...e,array:!0});Ed.exports.MaxBufferError=mh});var k5=_((rVe,F5)=>{"use strict";u();var Ppe=new Set([200,203,204,206,300,301,308,404,405,410,414,501]),Mpe=new Set([200,203,204,300,301,302,303,307,308,404,405,410,414,501]),Fpe=new Set([500,502,503,504]),kpe={date:!0,connection:!0,"keep-alive":!0,"proxy-authenticate":!0,"proxy-authorization":!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0},Bpe={"content-length":!0,"content-encoding":!0,"transfer-encoding":!0,"content-range":!0};function Do(t){let e=parseInt(t,10);return isFinite(e)?e:0}function Upe(t){return t?Fpe.has(t.status):!0}function YT(t){let e={};if(!t)return e;let r=t.trim().split(/,/);for(let n of r){let[i,s]=n.split(/=/,2);e[i.trim()]=s===void 0?!0:s.trim().replace(/^"|"$/g,"")}return e}function Gpe(t){let e=[];for(let r in t){let n=t[r];e.push(n===!0?r:r+"="+n)}if(e.length)return e.join(", ")}F5.exports=class{constructor(e,r,{shared:n,cacheHeuristic:i,immutableMinTimeToLive:s,ignoreCargoCult:a,_fromObject:o}={}){if(o){this._fromObject(o);return}if(!r||!r.headers)throw Error("Response headers missing");this._assertRequestHasHeaders(e),this._responseTime=this.now(),thi