@smythos/cli
Version:
SmythOS SRE Command Line Interface
37 lines • 112 kB
JavaScript
#!/usr/bin/env node
"use strict";var ie=Object.defineProperty;var a=(n,r)=>ie(n,"name",{value:r,configurable:!0});var process$1=require("node:process"),node_child_process=require("node:child_process"),require$$0$a=require("node:url"),path=require("node:path"),require$$0$6=require("node:util"),os=require("node:os"),index=require("./index2.cjs"),P=require("fs"),require$$0$1=require("constants"),require$$0$2=require("stream"),require$$0$3=require("util"),require$$0$4=require("assert"),require$$0$5=require("os"),sysPath=require("path"),fs$1=require("node:fs"),require$$0$7=require("events"),require$$0$8=require("url"),require$$0$9=require("http"),index$1=require("./index6.cjs"),_documentCurrentScript=typeof document<"u"?document.currentScript:null,polyfills$1,hasRequiredPolyfills$1;function requirePolyfills$1(){if(hasRequiredPolyfills$1)return polyfills$1;hasRequiredPolyfills$1=1;var n=require$$0$1,r=process.cwd,i=null,c=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return i||(i=r.call(process)),i};try{process.cwd()}catch{}if(typeof process.chdir=="function"){var h=process.chdir;process.chdir=function(o){i=null,h.call(process,o)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,h)}polyfills$1=l;function l(o){n.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&f(o),o.lutimes||m(o),o.chown=S(o.chown),o.fchown=S(o.fchown),o.lchown=S(o.lchown),o.chmod=p(o.chmod),o.fchmod=p(o.fchmod),o.lchmod=p(o.lchmod),o.chownSync=v(o.chownSync),o.fchownSync=v(o.fchownSync),o.lchownSync=v(o.lchownSync),o.chmodSync=d(o.chmodSync),o.fchmodSync=d(o.fchmodSync),o.lchmodSync=d(o.lchmodSync),o.stat=y(o.stat),o.fstat=y(o.fstat),o.lstat=y(o.lstat),o.statSync=w(o.statSync),o.fstatSync=w(o.fstatSync),o.lstatSync=w(o.lstatSync),o.chmod&&!o.lchmod&&(o.lchmod=function(s,g,E){E&&process.nextTick(E)},o.lchmodSync=function(){}),o.chown&&!o.lchown&&(o.lchown=function(s,g,E,_){_&&process.nextTick(_)},o.lchownSync=function(){}),c==="win32"&&(o.rename=typeof o.rename!="function"?o.rename:function(s){function g(E,_,O){var I=Date.now(),x=0;s(E,_,a(function A(F){if(F&&(F.code==="EACCES"||F.code==="EPERM"||F.code==="EBUSY")&&Date.now()-I<6e4){setTimeout(function(){o.stat(_,function(U,q){U&&U.code==="ENOENT"?s(E,_,A):O(F)})},x),x<100&&(x+=10);return}O&&O(F)},"CB"))}return a(g,"rename"),Object.setPrototypeOf&&Object.setPrototypeOf(g,s),g}(o.rename)),o.read=typeof o.read!="function"?o.read:function(s){function g(E,_,O,I,x,A){var F;if(A&&typeof A=="function"){var U=0;F=a(function(q,H,V){if(q&&q.code==="EAGAIN"&&U<10)return U++,s.call(o,E,_,O,I,x,F);A.apply(this,arguments)},"callback")}return s.call(o,E,_,O,I,x,F)}return a(g,"read"),Object.setPrototypeOf&&Object.setPrototypeOf(g,s),g}(o.read),o.readSync=typeof o.readSync!="function"?o.readSync:function(s){return function(g,E,_,O,I){for(var x=0;;)try{return s.call(o,g,E,_,O,I)}catch(A){if(A.code==="EAGAIN"&&x<10){x++;continue}throw A}}}(o.readSync);function f(s){s.lchmod=function(g,E,_){s.open(g,n.O_WRONLY|n.O_SYMLINK,E,function(O,I){if(O){_&&_(O);return}s.fchmod(I,E,function(x){s.close(I,function(A){_&&_(x||A)})})})},s.lchmodSync=function(g,E){var _=s.openSync(g,n.O_WRONLY|n.O_SYMLINK,E),O=!0,I;try{I=s.fchmodSync(_,E),O=!1}finally{if(O)try{s.closeSync(_)}catch{}else s.closeSync(_)}return I}}a(f,"patchLchmod");function m(s){n.hasOwnProperty("O_SYMLINK")&&s.futimes?(s.lutimes=function(g,E,_,O){s.open(g,n.O_SYMLINK,function(I,x){if(I){O&&O(I);return}s.futimes(x,E,_,function(A){s.close(x,function(F){O&&O(A||F)})})})},s.lutimesSync=function(g,E,_){var O=s.openSync(g,n.O_SYMLINK),I,x=!0;try{I=s.futimesSync(O,E,_),x=!1}finally{if(x)try{s.closeSync(O)}catch{}else s.closeSync(O)}return I}):s.futimes&&(s.lutimes=function(g,E,_,O){O&&process.nextTick(O)},s.lutimesSync=function(){})}a(m,"patchLutimes");function p(s){return s&&function(g,E,_){return s.call(o,g,E,function(O){b(O)&&(O=null),_&&_.apply(this,arguments)})}}a(p,"chmodFix");function d(s){return s&&function(g,E){try{return s.call(o,g,E)}catch(_){if(!b(_))throw _}}}a(d,"chmodFixSync");function S(s){return s&&function(g,E,_,O){return s.call(o,g,E,_,function(I){b(I)&&(I=null),O&&O.apply(this,arguments)})}}a(S,"chownFix");function v(s){return s&&function(g,E,_){try{return s.call(o,g,E,_)}catch(O){if(!b(O))throw O}}}a(v,"chownFixSync");function y(s){return s&&function(g,E,_){typeof E=="function"&&(_=E,E=null);function O(I,x){x&&(x.uid<0&&(x.uid+=4294967296),x.gid<0&&(x.gid+=4294967296)),_&&_.apply(this,arguments)}return a(O,"callback"),E?s.call(o,g,E,O):s.call(o,g,O)}}a(y,"statFix");function w(s){return s&&function(g,E){var _=E?s.call(o,g,E):s.call(o,g);return _&&(_.uid<0&&(_.uid+=4294967296),_.gid<0&&(_.gid+=4294967296)),_}}a(w,"statFixSync");function b(s){if(!s||s.code==="ENOSYS")return!0;var g=!process.getuid||process.getuid()!==0;return!!(g&&(s.code==="EINVAL"||s.code==="EPERM"))}a(b,"chownErOk")}return a(l,"patch"),polyfills$1}a(requirePolyfills$1,"requirePolyfills$1");var legacyStreams$1,hasRequiredLegacyStreams$1;function requireLegacyStreams$1(){if(hasRequiredLegacyStreams$1)return legacyStreams$1;hasRequiredLegacyStreams$1=1;var n=require$$0$2.Stream;legacyStreams$1=r;function r(i){return{ReadStream:c,WriteStream:h};function c(l,o){if(!(this instanceof c))return new c(l,o);n.call(this);var f=this;this.path=l,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,o=o||{};for(var m=Object.keys(o),p=0,d=m.length;p<d;p++){var S=m[p];this[S]=o[S]}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(){f._read()});return}i.open(this.path,this.flags,this.mode,function(v,y){if(v){f.emit("error",v),f.readable=!1;return}f.fd=y,f.emit("open",y),f._read()})}function h(l,o){if(!(this instanceof h))return new h(l,o);n.call(this),this.path=l,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,o=o||{};for(var f=Object.keys(o),m=0,p=f.length;m<p;m++){var d=f[m];this[d]=o[d]}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=i.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}return a(r,"legacy"),legacyStreams$1}a(requireLegacyStreams$1,"requireLegacyStreams$1");var clone_1$1,hasRequiredClone$1;function requireClone$1(){if(hasRequiredClone$1)return clone_1$1;hasRequiredClone$1=1,clone_1$1=r;var n=Object.getPrototypeOf||function(i){return i.__proto__};function r(i){if(i===null||typeof i!="object")return i;if(i instanceof Object)var c={__proto__:n(i)};else var c=Object.create(null);return Object.getOwnPropertyNames(i).forEach(function(h){Object.defineProperty(c,h,Object.getOwnPropertyDescriptor(i,h))}),c}return a(r,"clone"),clone_1$1}a(requireClone$1,"requireClone$1");var gracefulFs$1,hasRequiredGracefulFs$1;function requireGracefulFs$1(){if(hasRequiredGracefulFs$1)return gracefulFs$1;hasRequiredGracefulFs$1=1;var n=P,r=requirePolyfills$1(),i=requireLegacyStreams$1(),c=requireClone$1(),h=require$$0$3,l,o;typeof Symbol=="function"&&typeof Symbol.for=="function"?(l=Symbol.for("graceful-fs.queue"),o=Symbol.for("graceful-fs.previous")):(l="___graceful-fs.queue",o="___graceful-fs.previous");function f(){}a(f,"noop");function m(s,g){Object.defineProperty(s,l,{get:a(function(){return g},"get")})}a(m,"publishQueue");var p=f;if(h.debuglog?p=h.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(p=a(function(){var s=h.format.apply(h,arguments);s="GFS4: "+s.split(/\n/).join(`
GFS4: `),console.error(s)},"debug")),!n[l]){var d=index.commonjsGlobal[l]||[];m(n,d),n.close=function(s){function g(E,_){return s.call(n,E,function(O){O||w(),typeof _=="function"&&_.apply(this,arguments)})}return a(g,"close"),Object.defineProperty(g,o,{value:s}),g}(n.close),n.closeSync=function(s){function g(E){s.apply(n,arguments),w()}return a(g,"closeSync"),Object.defineProperty(g,o,{value:s}),g}(n.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){p(n[l]),require$$0$4.equal(n[l].length,0)})}index.commonjsGlobal[l]||m(index.commonjsGlobal,n[l]),gracefulFs$1=S(c(n)),process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!n.__patched&&(gracefulFs$1=S(n),n.__patched=!0);function S(s){r(s),s.gracefulify=S,s.createReadStream=ee,s.createWriteStream=te;var g=s.readFile;s.readFile=E;function E(R,N,C){return typeof N=="function"&&(C=N,N=null),j(R,N,C);function j(B,D,$,k){return g(B,D,function(T){T&&(T.code==="EMFILE"||T.code==="ENFILE")?v([j,[B,D,$],T,k||Date.now(),Date.now()]):typeof $=="function"&&$.apply(this,arguments)})}a(j,"go$readFile")}a(E,"readFile");var _=s.writeFile;s.writeFile=O;function O(R,N,C,j){return typeof C=="function"&&(j=C,C=null),B(R,N,C,j);function B(D,$,k,T,M){return _(D,$,k,function(L){L&&(L.code==="EMFILE"||L.code==="ENFILE")?v([B,[D,$,k,T],L,M||Date.now(),Date.now()]):typeof T=="function"&&T.apply(this,arguments)})}a(B,"go$writeFile")}a(O,"writeFile");var I=s.appendFile;I&&(s.appendFile=x);function x(R,N,C,j){return typeof C=="function"&&(j=C,C=null),B(R,N,C,j);function B(D,$,k,T,M){return I(D,$,k,function(L){L&&(L.code==="EMFILE"||L.code==="ENFILE")?v([B,[D,$,k,T],L,M||Date.now(),Date.now()]):typeof T=="function"&&T.apply(this,arguments)})}a(B,"go$appendFile")}a(x,"appendFile");var A=s.copyFile;A&&(s.copyFile=F);function F(R,N,C,j){return typeof C=="function"&&(j=C,C=0),B(R,N,C,j);function B(D,$,k,T,M){return A(D,$,k,function(L){L&&(L.code==="EMFILE"||L.code==="ENFILE")?v([B,[D,$,k,T],L,M||Date.now(),Date.now()]):typeof T=="function"&&T.apply(this,arguments)})}a(B,"go$copyFile")}a(F,"copyFile");var U=s.readdir;s.readdir=H;var q=/^v[0-5]\./;function H(R,N,C){typeof N=="function"&&(C=N,N=null);var j=q.test(process.version)?a(function($,k,T,M){return U($,B($,k,T,M))},"go$readdir"):a(function($,k,T,M){return U($,k,B($,k,T,M))},"go$readdir");return j(R,N,C);function B(D,$,k,T){return function(M,L){M&&(M.code==="EMFILE"||M.code==="ENFILE")?v([j,[D,$,k],M,T||Date.now(),Date.now()]):(L&&L.sort&&L.sort(),typeof k=="function"&&k.call(this,M,L))}}}if(a(H,"readdir"),process.version.substr(0,4)==="v0.8"){var V=i(s);W=V.ReadStream,G=V.WriteStream}var Y=s.ReadStream;Y&&(W.prototype=Object.create(Y.prototype),W.prototype.open=Q);var K=s.WriteStream;K&&(G.prototype=Object.create(K.prototype),G.prototype.open=Z),Object.defineProperty(s,"ReadStream",{get:a(function(){return W},"get"),set:a(function(R){W=R},"set"),enumerable:!0,configurable:!0}),Object.defineProperty(s,"WriteStream",{get:a(function(){return G},"get"),set:a(function(R){G=R},"set"),enumerable:!0,configurable:!0});var z=W;Object.defineProperty(s,"FileReadStream",{get:a(function(){return z},"get"),set:a(function(R){z=R},"set"),enumerable:!0,configurable:!0});var X=G;Object.defineProperty(s,"FileWriteStream",{get:a(function(){return X},"get"),set:a(function(R){X=R},"set"),enumerable:!0,configurable:!0});function W(R,N){return this instanceof W?(Y.apply(this,arguments),this):W.apply(Object.create(W.prototype),arguments)}a(W,"ReadStream");function Q(){var R=this;J(R.path,R.flags,R.mode,function(N,C){N?(R.autoClose&&R.destroy(),R.emit("error",N)):(R.fd=C,R.emit("open",C),R.read())})}a(Q,"ReadStream$open");function G(R,N){return this instanceof G?(K.apply(this,arguments),this):G.apply(Object.create(G.prototype),arguments)}a(G,"WriteStream");function Z(){var R=this;J(R.path,R.flags,R.mode,function(N,C){N?(R.destroy(),R.emit("error",N)):(R.fd=C,R.emit("open",C))})}a(Z,"WriteStream$open");function ee(R,N){return new s.ReadStream(R,N)}a(ee,"createReadStream");function te(R,N){return new s.WriteStream(R,N)}a(te,"createWriteStream");var re=s.open;s.open=J;function J(R,N,C,j){return typeof C=="function"&&(j=C,C=null),B(R,N,C,j);function B(D,$,k,T,M){return re(D,$,k,function(L,ne){L&&(L.code==="EMFILE"||L.code==="ENFILE")?v([B,[D,$,k,T],L,M||Date.now(),Date.now()]):typeof T=="function"&&T.apply(this,arguments)})}a(B,"go$open")}return a(J,"open"),s}a(S,"patch");function v(s){p("ENQUEUE",s[0].name,s[1]),n[l].push(s),b()}a(v,"enqueue");var y;function w(){for(var s=Date.now(),g=0;g<n[l].length;++g)n[l][g].length>2&&(n[l][g][3]=s,n[l][g][4]=s);b()}a(w,"resetQueue");function b(){if(clearTimeout(y),y=void 0,n[l].length!==0){var s=n[l].shift(),g=s[0],E=s[1],_=s[2],O=s[3],I=s[4];if(O===void 0)p("RETRY",g.name,E),g.apply(null,E);else if(Date.now()-O>=6e4){p("TIMEOUT",g.name,E);var x=E.pop();typeof x=="function"&&x.call(null,_)}else{var A=Date.now()-I,F=Math.max(I-O,1),U=Math.min(F*1.2,100);A>=U?(p("RETRY",g.name,E),g.apply(null,E.concat([O]))):n[l].push(s)}y===void 0&&(y=setTimeout(b,0))}}return a(b,"retry"),gracefulFs$1}a(requireGracefulFs$1,"requireGracefulFs$1");var gracefulFsExports=requireGracefulFs$1(),fs=index.getDefaultExportFromCjs(gracefulFsExports);const homeDirectory=require$$0$5.homedir(),{env}=process,xdgData=env.XDG_DATA_HOME||(homeDirectory?sysPath.join(homeDirectory,".local","share"):void 0),xdgConfig=env.XDG_CONFIG_HOME||(homeDirectory?sysPath.join(homeDirectory,".config"):void 0);env.XDG_STATE_HOME||homeDirectory&&sysPath.join(homeDirectory,".local","state");env.XDG_CACHE_HOME||homeDirectory&&sysPath.join(homeDirectory,".cache");env.XDG_RUNTIME_DIR;const xdgDataDirectories=(env.XDG_DATA_DIRS||"/usr/local/share/:/usr/share/").split(":");xdgData&&xdgDataDirectories.unshift(xdgData);const xdgConfigDirectories=(env.XDG_CONFIG_DIRS||"/etc/xdg").split(":");xdgConfig&&xdgConfigDirectories.unshift(xdgConfig);const attemptifyAsync=a((n,r)=>a(function(...c){return n.apply(void 0,c).catch(r)},"attemptified"),"attemptifyAsync"),attemptifySync=a((n,r)=>a(function(...c){try{return n.apply(void 0,c)}catch(h){return r(h)}},"attemptified"),"attemptifySync"),IS_USER_ROOT=process$1.getuid?!process$1.getuid():!1,LIMIT_FILES_DESCRIPTORS=1e4,NOOP=a(()=>{},"NOOP"),Handlers={isChangeErrorOk:a(n=>{if(!Handlers.isNodeError(n))return!1;const{code:r}=n;return r==="ENOSYS"||!IS_USER_ROOT&&(r==="EINVAL"||r==="EPERM")},"isChangeErrorOk"),isNodeError:a(n=>n instanceof Error,"isNodeError"),isRetriableError:a(n=>{if(!Handlers.isNodeError(n))return!1;const{code:r}=n;return r==="EMFILE"||r==="ENFILE"||r==="EAGAIN"||r==="EBUSY"||r==="EACCESS"||r==="EACCES"||r==="EACCS"||r==="EPERM"},"isRetriableError"),onChangeError:a(n=>{if(!Handlers.isNodeError(n))throw n;if(!Handlers.isChangeErrorOk(n))throw n},"onChangeError")};class RetryfyQueue{static{a(this,"RetryfyQueue")}constructor(){this.interval=25,this.intervalId=void 0,this.limit=LIMIT_FILES_DESCRIPTORS,this.queueActive=new Set,this.queueWaiting=new Set,this.init=()=>{this.intervalId||(this.intervalId=setInterval(this.tick,this.interval))},this.reset=()=>{this.intervalId&&(clearInterval(this.intervalId),delete this.intervalId)},this.add=r=>{this.queueWaiting.add(r),this.queueActive.size<this.limit/2?this.tick():this.init()},this.remove=r=>{this.queueWaiting.delete(r),this.queueActive.delete(r)},this.schedule=()=>new Promise(r=>{const i=a(()=>this.remove(c),"cleanup"),c=a(()=>r(i),"resolver");this.add(c)}),this.tick=()=>{if(!(this.queueActive.size>=this.limit)){if(!this.queueWaiting.size)return this.reset();for(const r of this.queueWaiting){if(this.queueActive.size>=this.limit)break;this.queueWaiting.delete(r),this.queueActive.add(r),r()}}}}}var RetryfyQueue$1=new RetryfyQueue;const retryifyAsync=a((n,r)=>a(function(c){return a(function h(...l){return RetryfyQueue$1.schedule().then(o=>{const f=a(p=>(o(),p),"onResolve"),m=a(p=>{if(o(),Date.now()>=c)throw p;if(r(p)){const d=Math.round(100*Math.random());return new Promise(v=>setTimeout(v,d)).then(()=>h.apply(void 0,l))}throw p},"onReject");return n.apply(void 0,l).then(f,m)})},"attempt")},"retrified"),"retryifyAsync"),retryifySync=a((n,r)=>a(function(c){return a(function h(...l){try{return n.apply(void 0,l)}catch(o){if(Date.now()>c)throw o;if(r(o))return h.apply(void 0,l);throw o}},"attempt")},"retrified"),"retryifySync"),FS={attempt:{chmod:attemptifyAsync(require$$0$6.promisify(fs$1.chmod),Handlers.onChangeError),chown:attemptifyAsync(require$$0$6.promisify(fs$1.chown),Handlers.onChangeError),close:attemptifyAsync(require$$0$6.promisify(fs$1.close),NOOP),fsync:attemptifyAsync(require$$0$6.promisify(fs$1.fsync),NOOP),mkdir:attemptifyAsync(require$$0$6.promisify(fs$1.mkdir),NOOP),realpath:attemptifyAsync(require$$0$6.promisify(fs$1.realpath),NOOP),stat:attemptifyAsync(require$$0$6.promisify(fs$1.stat),NOOP),unlink:attemptifyAsync(require$$0$6.promisify(fs$1.unlink),NOOP),chmodSync:attemptifySync(fs$1.chmodSync,Handlers.onChangeError),chownSync:attemptifySync(fs$1.chownSync,Handlers.onChangeError),closeSync:attemptifySync(fs$1.closeSync,NOOP),existsSync:attemptifySync(fs$1.existsSync,NOOP),fsyncSync:attemptifySync(fs$1.fsync,NOOP),mkdirSync:attemptifySync(fs$1.mkdirSync,NOOP),realpathSync:attemptifySync(fs$1.realpathSync,NOOP),statSync:attemptifySync(fs$1.statSync,NOOP),unlinkSync:attemptifySync(fs$1.unlinkSync,NOOP)},retry:{close:retryifyAsync(require$$0$6.promisify(fs$1.close),Handlers.isRetriableError),fsync:retryifyAsync(require$$0$6.promisify(fs$1.fsync),Handlers.isRetriableError),open:retryifyAsync(require$$0$6.promisify(fs$1.open),Handlers.isRetriableError),readFile:retryifyAsync(require$$0$6.promisify(fs$1.readFile),Handlers.isRetriableError),rename:retryifyAsync(require$$0$6.promisify(fs$1.rename),Handlers.isRetriableError),stat:retryifyAsync(require$$0$6.promisify(fs$1.stat),Handlers.isRetriableError),write:retryifyAsync(require$$0$6.promisify(fs$1.write),Handlers.isRetriableError),writeFile:retryifyAsync(require$$0$6.promisify(fs$1.writeFile),Handlers.isRetriableError),closeSync:retryifySync(fs$1.closeSync,Handlers.isRetriableError),fsyncSync:retryifySync(fs$1.fsyncSync,Handlers.isRetriableError),openSync:retryifySync(fs$1.openSync,Handlers.isRetriableError),readFileSync:retryifySync(fs$1.readFileSync,Handlers.isRetriableError),renameSync:retryifySync(fs$1.renameSync,Handlers.isRetriableError),statSync:retryifySync(fs$1.statSync,Handlers.isRetriableError),writeSync:retryifySync(fs$1.writeSync,Handlers.isRetriableError),writeFileSync:retryifySync(fs$1.writeFileSync,Handlers.isRetriableError)}},DEFAULT_ENCODING="utf8",DEFAULT_FILE_MODE=438,DEFAULT_FOLDER_MODE=511,DEFAULT_WRITE_OPTIONS={},DEFAULT_USER_UID=os.userInfo().uid,DEFAULT_USER_GID=os.userInfo().gid,DEFAULT_TIMEOUT_SYNC=1e3,IS_POSIX=!!process$1.getuid;process$1.getuid&&process$1.getuid();const LIMIT_BASENAME_LENGTH=128,isException=a(n=>n instanceof Error&&"code"in n,"isException"),isString=a(n=>typeof n=="string","isString"),isUndefined=a(n=>n===void 0,"isUndefined"),IS_LINUX=process$1.platform==="linux",IS_WINDOWS=process$1.platform==="win32",Signals=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];IS_WINDOWS||Signals.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");IS_LINUX&&Signals.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED");class Interceptor{static{a(this,"Interceptor")}constructor(){this.callbacks=new Set,this.exited=!1,this.exit=r=>{if(!this.exited){this.exited=!0;for(const i of this.callbacks)i();r&&(IS_WINDOWS&&r!=="SIGINT"&&r!=="SIGTERM"&&r!=="SIGKILL"?process$1.kill(process$1.pid,"SIGTERM"):process$1.kill(process$1.pid,r))}},this.hook=()=>{process$1.once("exit",()=>this.exit());for(const r of Signals)try{process$1.once(r,()=>this.exit(r))}catch{}},this.register=r=>(this.callbacks.add(r),()=>{this.callbacks.delete(r)}),this.hook()}}var Interceptor$1=new Interceptor;const whenExit=Interceptor$1.register,Temp={store:{},create:a(n=>{const r=`000000${Math.floor(Math.random()*16777215).toString(16)}`.slice(-6),h=`.tmp-${Date.now().toString().slice(-10)}${r}`;return`${n}${h}`},"create"),get:a((n,r,i=!0)=>{const c=Temp.truncate(r(n));return c in Temp.store?Temp.get(n,r,i):(Temp.store[c]=i,[c,a(()=>delete Temp.store[c],"disposer")])},"get"),purge:a(n=>{Temp.store[n]&&(delete Temp.store[n],FS.attempt.unlink(n))},"purge"),purgeSync:a(n=>{Temp.store[n]&&(delete Temp.store[n],FS.attempt.unlinkSync(n))},"purgeSync"),purgeSyncAll:a(()=>{for(const n in Temp.store)Temp.purgeSync(n)},"purgeSyncAll"),truncate:a(n=>{const r=path.basename(n);if(r.length<=LIMIT_BASENAME_LENGTH)return n;const i=/^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(r);if(!i)return n;const c=r.length-LIMIT_BASENAME_LENGTH;return`${n.slice(0,-r.length)}${i[1]}${i[2].slice(0,-c)}${i[3]}`},"truncate")};whenExit(Temp.purgeSyncAll);function writeFileSync(n,r,i=DEFAULT_WRITE_OPTIONS){if(isString(i))return writeFileSync(n,r,{encoding:i});const c=Date.now()+((i.timeout??DEFAULT_TIMEOUT_SYNC)||-1);let h=null,l=null,o=null;try{const f=FS.attempt.realpathSync(n),m=!!f;n=f||n,[l,h]=Temp.get(n,i.tmpCreate||Temp.create,i.tmpPurge!==!1);const p=IS_POSIX&&isUndefined(i.chown),d=isUndefined(i.mode);if(m&&(p||d)){const S=FS.attempt.statSync(n);S&&(i={...i},p&&(i.chown={uid:S.uid,gid:S.gid}),d&&(i.mode=S.mode))}if(!m){const S=path.dirname(n);FS.attempt.mkdirSync(S,{mode:DEFAULT_FOLDER_MODE,recursive:!0})}o=FS.retry.openSync(c)(l,"w",i.mode||DEFAULT_FILE_MODE),i.tmpCreated&&i.tmpCreated(l),isString(r)?FS.retry.writeSync(c)(o,r,0,i.encoding||DEFAULT_ENCODING):isUndefined(r)||FS.retry.writeSync(c)(o,r,0,r.length,0),i.fsync!==!1&&(i.fsyncWait!==!1?FS.retry.fsyncSync(c)(o):FS.attempt.fsync(o)),FS.retry.closeSync(c)(o),o=null,i.chown&&(i.chown.uid!==DEFAULT_USER_UID||i.chown.gid!==DEFAULT_USER_GID)&&FS.attempt.chownSync(l,i.chown.uid,i.chown.gid),i.mode&&i.mode!==DEFAULT_FILE_MODE&&FS.attempt.chmodSync(l,i.mode);try{FS.retry.renameSync(c)(l,n)}catch(S){if(!isException(S)||S.code!=="ENAMETOOLONG")throw S;FS.retry.renameSync(c)(l,Temp.truncate(n))}h(),l=null}finally{o&&FS.attempt.closeSync(o),l&&Temp.purge(l)}}a(writeFileSync,"writeFileSync");const isObject$1=a(n=>{const r=typeof n;return n!==null&&(r==="object"||r==="function")},"isObject$1"),disallowedKeys=new Set(["__proto__","prototype","constructor"]),digits=new Set("0123456789");function getPathSegments(n){const r=[];let i="",c="start",h=!1;for(const l of n)switch(l){case"\\":{if(c==="index")throw new Error("Invalid character in an index");if(c==="indexEnd")throw new Error("Invalid character after an index");h&&(i+=l),c="property",h=!h;break}case".":{if(c==="index")throw new Error("Invalid character in an index");if(c==="indexEnd"){c="property";break}if(h){h=!1,i+=l;break}if(disallowedKeys.has(i))return[];r.push(i),i="",c="property";break}case"[":{if(c==="index")throw new Error("Invalid character in an index");if(c==="indexEnd"){c="index";break}if(h){h=!1,i+=l;break}if(c==="property"){if(disallowedKeys.has(i))return[];r.push(i),i=""}c="index";break}case"]":{if(c==="index"){r.push(Number.parseInt(i,10)),i="",c="indexEnd";break}if(c==="indexEnd")throw new Error("Invalid character after an index")}default:{if(c==="index"&&!digits.has(l))throw new Error("Invalid character in an index");if(c==="indexEnd")throw new Error("Invalid character after an index");c==="start"&&(c="property"),h&&(h=!1,i+="\\"),i+=l}}switch(h&&(i+="\\"),c){case"property":{if(disallowedKeys.has(i))return[];r.push(i);break}case"index":throw new Error("Index was not closed");case"start":{r.push("");break}}return r}a(getPathSegments,"getPathSegments");function isStringIndex(n,r){if(typeof r!="number"&&Array.isArray(n)){const i=Number.parseInt(r,10);return Number.isInteger(i)&&n[i]===n[r]}return!1}a(isStringIndex,"isStringIndex");function assertNotStringIndex(n,r){if(isStringIndex(n,r))throw new Error("Cannot use string index")}a(assertNotStringIndex,"assertNotStringIndex");function getProperty(n,r,i){if(!isObject$1(n)||typeof r!="string")return i===void 0?n:i;const c=getPathSegments(r);if(c.length===0)return i;for(let h=0;h<c.length;h++){const l=c[h];if(isStringIndex(n,l)?n=h===c.length-1?void 0:null:n=n[l],n==null){if(h!==c.length-1)return i;break}}return n===void 0?i:n}a(getProperty,"getProperty");function setProperty(n,r,i){if(!isObject$1(n)||typeof r!="string")return n;const c=n,h=getPathSegments(r);for(let l=0;l<h.length;l++){const o=h[l];assertNotStringIndex(n,o),l===h.length-1?n[o]=i:isObject$1(n[o])||(n[o]=typeof h[l+1]=="number"?[]:{}),n=n[o]}return c}a(setProperty,"setProperty");function deleteProperty(n,r){if(!isObject$1(n)||typeof r!="string")return!1;const i=getPathSegments(r);for(let c=0;c<i.length;c++){const h=i[c];if(assertNotStringIndex(n,h),c===i.length-1)return delete n[h],!0;if(n=n[h],!isObject$1(n))return!1}}a(deleteProperty,"deleteProperty");function hasProperty(n,r){if(!isObject$1(n)||typeof r!="string")return!1;const i=getPathSegments(r);if(i.length===0)return!1;for(const c of i){if(!isObject$1(n)||!(c in n)||isStringIndex(n,c))return!1;n=n[c]}return!0}a(hasProperty,"hasProperty");function getConfigDirectory(n,r){const i=r?path.join(n,"config.json"):path.join("configstore",`${n}.json`),c=xdgConfig??fs.mkdtempSync(fs.realpathSync(os.tmpdir())+path.sep);return path.join(c,i)}a(getConfigDirectory,"getConfigDirectory");const permissionError="You don't have access to this file.",mkdirOptions={mode:448,recursive:!0},writeFileOptions={mode:384};class Configstore{static{a(this,"Configstore")}constructor(r,i,c={}){this._path=c.configPath??getConfigDirectory(r,c.globalConfigPath),i&&(this.all={...i,...this.all})}get all(){try{return JSON.parse(fs.readFileSync(this._path,"utf8"))}catch(r){if(r.code==="ENOENT")return{};if(r.code==="EACCES"&&(r.message=`${r.message}
${permissionError}
`),r.name==="SyntaxError")return writeFileSync(this._path,"",writeFileOptions),{};throw r}}set all(r){try{fs.mkdirSync(path.dirname(this._path),mkdirOptions),writeFileSync(this._path,JSON.stringify(r,void 0," "),writeFileOptions)}catch(i){throw i.code==="EACCES"&&(i.message=`${i.message}
${permissionError}
`),i}}get size(){return Object.keys(this.all||{}).length}get(r){return getProperty(this.all,r)}set(r,i){const c=this.all;if(arguments.length===1)for(const h of Object.keys(r))setProperty(c,h,r[h]);else setProperty(c,r,i);this.all=c}has(r){return hasProperty(this.all,r)}delete(r){const i=this.all;deleteProperty(i,r),this.all=i}clear(){this.all={}}get path(){return this._path}}var diffExports=index.requireDiff(),semverDiff=index.getDefaultExportFromCjs(diffExports),gtExports=index.requireGt(),semverGt=index.getDefaultExportFromCjs(gtExports);class HTTPError extends Error{static{a(this,"HTTPError")}response;request;options;constructor(r,i,c){const h=r.status||r.status===0?r.status:"",l=r.statusText||"",o=`${h} ${l}`.trim(),f=o?`status code ${o}`:"an unknown error";super(`Request failed with ${f}: ${i.method} ${i.url}`),this.name="HTTPError",this.response=r,this.request=i,this.options=c}}class TimeoutError extends Error{static{a(this,"TimeoutError")}request;constructor(r){super(`Request timed out: ${r.method} ${r.url}`),this.name="TimeoutError",this.request=r}}const supportsRequestStreams=(()=>{let n=!1,r=!1;const i=typeof globalThis.ReadableStream=="function",c=typeof globalThis.Request=="function";if(i&&c)try{r=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return n=!0,"half"}}).headers.has("Content-Type")}catch(h){if(h instanceof Error&&h.message==="unsupported BodyInit type")return!1;throw h}return n&&!r})(),supportsAbortController=typeof globalThis.AbortController=="function",supportsResponseStreams=typeof globalThis.ReadableStream=="function",supportsFormData=typeof globalThis.FormData=="function",requestMethods=["get","post","put","patch","head","delete"],responseTypes={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*"},maxSafeTimeout=2147483647,usualFormBoundarySize=new TextEncoder().encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,stop=Symbol("stop"),kyOptionKeys={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0},requestOptionsRegistry={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,dispatcher:!0,duplex:!0,priority:!0},getBodySize=a(n=>{if(!n)return 0;if(n instanceof FormData){let r=0;for(const[i,c]of n)r+=usualFormBoundarySize,r+=new TextEncoder().encode(`Content-Disposition: form-data; name="${i}"`).length,r+=typeof c=="string"?new TextEncoder().encode(c).length:c.size;return r}if(n instanceof Blob)return n.size;if(n instanceof ArrayBuffer)return n.byteLength;if(typeof n=="string")return new TextEncoder().encode(n).length;if(n instanceof URLSearchParams)return new TextEncoder().encode(n.toString()).length;if("byteLength"in n)return n.byteLength;if(typeof n=="object"&&n!==null)try{const r=JSON.stringify(n);return new TextEncoder().encode(r).length}catch{return 0}return 0},"getBodySize"),streamResponse=a((n,r)=>{const i=Number(n.headers.get("content-length"))||0;let c=0;return n.status===204?(r&&r({percent:1,totalBytes:i,transferredBytes:c},new Uint8Array),new Response(null,{status:n.status,statusText:n.statusText,headers:n.headers})):new Response(new ReadableStream({async start(h){const l=n.body.getReader();r&&r({percent:0,transferredBytes:0,totalBytes:i},new Uint8Array);async function o(){const{done:f,value:m}=await l.read();if(f){h.close();return}if(r){c+=m.byteLength;const p=i===0?0:c/i;r({percent:p,transferredBytes:c,totalBytes:i},m)}h.enqueue(m),await o()}a(o,"read"),await o()}}),{status:n.status,statusText:n.statusText,headers:n.headers})},"streamResponse"),streamRequest=a((n,r)=>{const i=getBodySize(n.body);let c=0;return new Request(n,{duplex:"half",body:new ReadableStream({async start(h){const l=n.body instanceof ReadableStream?n.body.getReader():new Response("").body.getReader();async function o(){const{done:f,value:m}=await l.read();if(f){r&&r({percent:1,transferredBytes:c,totalBytes:Math.max(i,c)},new Uint8Array),h.close();return}c+=m.byteLength;let p=i===0?0:c/i;(i<c||p===1)&&(p=.99),r&&r({percent:Number(p.toFixed(2)),transferredBytes:c,totalBytes:i},m),h.enqueue(m),await o()}a(o,"read"),await o()}})})},"streamRequest"),isObject=a(n=>n!==null&&typeof n=="object","isObject"),validateAndMerge=a((...n)=>{for(const r of n)if((!isObject(r)||Array.isArray(r))&&r!==void 0)throw new TypeError("The `options` argument must be an object");return deepMerge({},...n)},"validateAndMerge"),mergeHeaders=a((n={},r={})=>{const i=new globalThis.Headers(n),c=r instanceof globalThis.Headers,h=new globalThis.Headers(r);for(const[l,o]of h.entries())c&&o==="undefined"||o===void 0?i.delete(l):i.set(l,o);return i},"mergeHeaders");function newHookValue(n,r,i){return Object.hasOwn(r,i)&&r[i]===void 0?[]:deepMerge(n[i]??[],r[i]??[])}a(newHookValue,"newHookValue");const mergeHooks=a((n={},r={})=>({beforeRequest:newHookValue(n,r,"beforeRequest"),beforeRetry:newHookValue(n,r,"beforeRetry"),afterResponse:newHookValue(n,r,"afterResponse"),beforeError:newHookValue(n,r,"beforeError")}),"mergeHooks"),deepMerge=a((...n)=>{let r={},i={},c={};for(const h of n)if(Array.isArray(h))Array.isArray(r)||(r=[]),r=[...r,...h];else if(isObject(h)){for(let[l,o]of Object.entries(h))isObject(o)&&l in r&&(o=deepMerge(r[l],o)),r={...r,[l]:o};isObject(h.hooks)&&(c=mergeHooks(c,h.hooks),r.hooks=c),isObject(h.headers)&&(i=mergeHeaders(i,h.headers),r.headers=i)}return r},"deepMerge"),normalizeRequestMethod=a(n=>requestMethods.includes(n)?n.toUpperCase():n,"normalizeRequestMethod"),retryMethods=["get","put","head","delete","options","trace"],retryStatusCodes=[408,413,429,500,502,503,504],retryAfterStatusCodes=[413,429,503],defaultRetryOptions={limit:2,methods:retryMethods,statusCodes:retryStatusCodes,afterStatusCodes:retryAfterStatusCodes,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:a(n=>.3*2**(n-1)*1e3,"delay")},normalizeRetryOptions=a((n={})=>{if(typeof n=="number")return{...defaultRetryOptions,limit:n};if(n.methods&&!Array.isArray(n.methods))throw new Error("retry.methods must be an array");if(n.statusCodes&&!Array.isArray(n.statusCodes))throw new Error("retry.statusCodes must be an array");return{...defaultRetryOptions,...n}},"normalizeRetryOptions");async function timeout(n,r,i,c){return new Promise((h,l)=>{const o=setTimeout(()=>{i&&i.abort(),l(new TimeoutError(n))},c.timeout);c.fetch(n,r).then(h).catch(l).then(()=>{clearTimeout(o)})})}a(timeout,"timeout");async function delay(n,{signal:r}){return new Promise((i,c)=>{r&&(r.throwIfAborted(),r.addEventListener("abort",h,{once:!0}));function h(){clearTimeout(l),c(r.reason)}a(h,"abortHandler");const l=setTimeout(()=>{r?.removeEventListener("abort",h),i()},n)})}a(delay,"delay");const findUnknownOptions=a((n,r)=>{const i={};for(const c in r)!(c in requestOptionsRegistry)&&!(c in kyOptionKeys)&&!(c in n)&&(i[c]=r[c]);return i},"findUnknownOptions");class Ky{static{a(this,"Ky")}static create(r,i){const c=new Ky(r,i),h=a(async()=>{if(typeof c._options.timeout=="number"&&c._options.timeout>maxSafeTimeout)throw new RangeError(`The \`timeout\` option cannot be greater than ${maxSafeTimeout}`);await Promise.resolve();let f=await c._fetch();for(const m of c._options.hooks.afterResponse){const p=await m(c.request,c._options,c._decorateResponse(f.clone()));p instanceof globalThis.Response&&(f=p)}if(c._decorateResponse(f),!f.ok&&c._options.throwHttpErrors){let m=new HTTPError(f,c.request,c._options);for(const p of c._options.hooks.beforeError)m=await p(m);throw m}if(c._options.onDownloadProgress){if(typeof c._options.onDownloadProgress!="function")throw new TypeError("The `onDownloadProgress` option must be a function");if(!supportsResponseStreams)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");return streamResponse(f.clone(),c._options.onDownloadProgress)}return f},"function_"),o=(c._options.retry.methods.includes(c.request.method.toLowerCase())?c._retry(h):h()).finally(async()=>{c.request.bodyUsed||await c.request.body?.cancel()});for(const[f,m]of Object.entries(responseTypes))o[f]=async()=>{c.request.headers.set("accept",c.request.headers.get("accept")||m);const p=await o;if(f==="json"){if(p.status===204||(await p.clone().arrayBuffer()).byteLength===0)return"";if(i.parseJson)return i.parseJson(await p.text())}return p[f]()};return o}request;abortController;_retryCount=0;_input;_options;constructor(r,i={}){if(this._input=r,this._options={...i,headers:mergeHeaders(this._input.headers,i.headers),hooks:mergeHooks({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},i.hooks),method:normalizeRequestMethod(i.method??this._input.method??"GET"),prefixUrl:String(i.prefixUrl||""),retry:normalizeRetryOptions(i.retry),throwHttpErrors:i.throwHttpErrors!==!1,timeout:i.timeout??1e4,fetch:i.fetch??globalThis.fetch.bind(globalThis)},typeof this._input!="string"&&!(this._input instanceof URL||this._input instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(this._options.prefixUrl&&typeof this._input=="string"){if(this._input.startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");this._options.prefixUrl.endsWith("/")||(this._options.prefixUrl+="/"),this._input=this._options.prefixUrl+this._input}if(supportsAbortController){const c=this._options.signal??this._input.signal;this.abortController=new globalThis.AbortController,this._options.signal=c?AbortSignal.any([c,this.abortController.signal]):this.abortController.signal}if(supportsRequestStreams&&(this._options.duplex="half"),this._options.json!==void 0&&(this._options.body=this._options.stringifyJson?.(this._options.json)??JSON.stringify(this._options.json),this._options.headers.set("content-type",this._options.headers.get("content-type")??"application/json")),this.request=new globalThis.Request(this._input,this._options),this._options.searchParams){const h="?"+(typeof this._options.searchParams=="string"?this._options.searchParams.replace(/^\?/,""):new URLSearchParams(this._options.searchParams).toString()),l=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,h);(supportsFormData&&this._options.body instanceof globalThis.FormData||this._options.body instanceof URLSearchParams)&&!(this._options.headers&&this._options.headers["content-type"])&&this.request.headers.delete("content-type"),this.request=new globalThis.Request(new globalThis.Request(l,{...this.request}),this._options)}if(this._options.onUploadProgress){if(typeof this._options.onUploadProgress!="function")throw new TypeError("The `onUploadProgress` option must be a function");if(!supportsRequestStreams)throw new Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");this.request.body&&(this.request=streamRequest(this.request,this._options.onUploadProgress))}}_calculateRetryDelay(r){if(this._retryCount++,this._retryCount>this._options.retry.limit||r instanceof TimeoutError)throw r;if(r instanceof HTTPError){if(!this._options.retry.statusCodes.includes(r.response.status))throw r;const c=r.response.headers.get("Retry-After")??r.response.headers.get("RateLimit-Reset")??r.response.headers.get("X-RateLimit-Reset")??r.response.headers.get("X-Rate-Limit-Reset");if(c&&this._options.retry.afterStatusCodes.includes(r.response.status)){let h=Number(c)*1e3;Number.isNaN(h)?h=Date.parse(c)-Date.now():h>=Date.parse("2024-01-01")&&(h-=Date.now());const l=this._options.retry.maxRetryAfter??h;return h<l?h:l}if(r.response.status===413)throw r}const i=this._options.retry.delay(this._retryCount);return Math.min(this._options.retry.backoffLimit,i)}_decorateResponse(r){return this._options.parseJson&&(r.json=async()=>this._options.parseJson(await r.text())),r}async _retry(r){try{return await r()}catch(i){const c=Math.min(this._calculateRetryDelay(i),maxSafeTimeout);if(this._retryCount<1)throw i;await delay(c,{signal:this._options.signal});for(const h of this._options.hooks.beforeRetry)if(await h({request:this.request,options:this._options,error:i,retryCount:this._retryCount})===stop)return;return this._retry(r)}}async _fetch(){for(const c of this._options.hooks.beforeRequest){const h=await c(this.request,this._options);if(h instanceof Request){this.request=h;break}if(h instanceof Response)return h}const r=findUnknownOptions(this.request,this._options),i=this.request;return this.request=i.clone(),this._options.timeout===!1?this._options.fetch(i,r):timeout(i,r,this.abortController,this._options)}}/*! MIT License © Sindre Sorhus */const createInstance=a(n=>{const r=a((i,c)=>Ky.create(i,validateAndMerge(n,c)),"ky");for(const i of requestMethods)r[i]=(c,h)=>Ky.create(c,validateAndMerge(n,h,{method:i}));return r.create=i=>createInstance(validateAndMerge(i)),r.extend=i=>(typeof i=="function"&&(i=i(n??{})),createInstance(validateAndMerge(n,i))),r.stop=stop,r},"createInstance"),ky=createInstance();var utils={},ini$2={},hasRequiredIni$1;function requireIni$1(){if(hasRequiredIni$1)return ini$2;hasRequiredIni$1=1,ini$2.parse=ini$2.decode=c,ini$2.stringify=ini$2.encode=r,ini$2.safe=l,ini$2.unsafe=o;var n=typeof process<"u"&&process.platform==="win32"?`\r
`:`
`;function r(f,m){var p=[],d="";typeof m=="string"?m={section:m,whitespace:!1}:(m=m||{},m.whitespace=m.whitespace===!0);var S=m.whitespace?" = ":"=";return Object.keys(f).forEach(function(v,y,w){var b=f[v];b&&Array.isArray(b)?b.forEach(function(s){d+=l(v+"[]")+S+l(s)+`
`}):b&&typeof b=="object"?p.push(v):d+=l(v)+S+l(b)+n}),m.section&&d.length&&(d="["+l(m.section)+"]"+n+d),p.forEach(function(v,y,w){var b=i(v).join("\\."),s=(m.section?m.section+".":"")+b,g=r(f[v],{section:s,whitespace:m.whitespace});d.length&&g.length&&(d+=n),d+=g}),d}a(r,"encode");function i(f){return f.replace(/\1/g,"LITERAL\\1LITERAL").replace(/\\\./g,"").split(/\./).map(function(m){return m.replace(/\1/g,"\\.").replace(/\2LITERAL\\1LITERAL\2/g,"")})}a(i,"dotSplit");function c(f){var m={},p=m,d=null,S=/^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i,v=f.split(/[\r\n]+/g);return v.forEach(function(y,w,b){if(!(!y||y.match(/^\s*[;#]/))){var s=y.match(S);if(s){if(s[1]!==void 0){if(d=o(s[1]),d==="__proto__"){p={};return}p=m[d]=m[d]||{};return}var g=o(s[2]);if(g!=="__proto__"){var E=s[3]?o(s[4]):!0;switch(E){case"true":case"false":case"null":E=JSON.parse(E)}if(g.length>2&&g.slice(-2)==="[]"){if(g=g.substring(0,g.length-2),g==="__proto__")return;p[g]?Array.isArray(p[g])||(p[g]=[p[g]]):p[g]=[]}Array.isArray(p[g])?p[g].push(E):p[g]=E}}}}),Object.keys(m).filter(function(y,w,b){if(!m[y]||typeof m[y]!="object"||Array.isArray(m[y]))return!1;var s=i(y),g=m,E=s.pop(),_=E.replace(/\\\./g,".");return s.forEach(function(O,I,x){O!=="__proto__"&&((!g[O]||typeof g[O]!="object")&&(g[O]={}),g=g[O])}),g===m&&_===E?!1:(g[_]=m[y],!0)}).forEach(function(y,w,b){delete m[y]}),m}a(c,"decode");function h(f){return f.charAt(0)==='"'&&f.slice(-1)==='"'||f.charAt(0)==="'"&&f.slice(-1)==="'"}a(h,"isQuoted");function l(f){return typeof f!="string"||f.match(/[=\r\n]/)||f.match(/^\[/)||f.length>1&&h(f)||f!==f.trim()?JSON.stringify(f):f.replace(/;/g,"\\;").replace(/#/g,"\\#")}a(l,"safe");function o(f,m){if(f=(f||"").trim(),h(f)){f.charAt(0)==="'"&&(f=f.substr(1,f.length-2));try{f=JSON.parse(f)}catch{}}else{for(var p=!1,d="",S=0,v=f.length;S<v;S++){var y=f.charAt(S);if(p)"\\;#".indexOf(y)!==-1?d+=y:d+="\\"+y,p=!1;else{if(";#".indexOf(y)!==-1)break;y==="\\"?p=!0:d+=y}}return p&&(d+="\\"),d.trim()}return f}return a(o,"unsafe"),ini$2}a(requireIni$1,"requireIni$1");var stripJsonComments,hasRequiredStripJsonComments;function requireStripJsonComments(){if(hasRequiredStripJsonComments)return stripJsonComments;hasRequiredStripJsonComments=1;var n=1,r=2;function i(){return""}a(i,"stripWithoutWhitespace");function c(h,l,o){return h.slice(l,o).replace(/\S/g," ")}return a(c,"stripWithWhitespace"),stripJsonComments=a(function(h,l){l=l||{};for(var o,f,m=!1,p=!1,d=0,S="",v=l.whitespace===!1?i:c,y=0;y<h.length;y++){if(o=h[y],f=h[y+1],!p&&o==='"'){var w=h[y-1]==="\\"&&h[y-2]!=="\\";w||(m=!m)}if(!m){if(!p&&o+f==="//")S+=h.slice(d,y),d=y,p=n,y++;else if(p===n&&o+f===`\r
`){y++,p=!1,S+=v(h,d,y),d=y;continue}else if(p===n&&o===`
`)p=!1,S+=v(h,d,y),d=y;else if(!p&&o+f==="/*"){S+=h.slice(d,y),d=y,p=r,y++;continue}else if(p===r&&o+f==="*/"){y++,p=!1,S+=v(h,d,y+1),d=y+1;continue}}}return S+(p?v(h.substr(d)):h.substr(d))},"stripJsonComments"),stripJsonComments}a(requireStripJsonComments,"requireStripJsonComments");var hasRequiredUtils;function requireUtils(){if(hasRequiredUtils)return utils;hasRequiredUtils=1;var n=P,r=requireIni$1(),i=sysPath,c=requireStripJsonComments(),h=utils.parse=function(o){return/^\s*{/.test(o)?JSON.parse(c(o)):r.parse(o)},l=utils.file=function(){var o=[].slice.call(arguments).filter(function(p){return p!=null});for(var f in o)if(typeof o[f]!="string")return;var m=i.join.apply(null,o);try{return n.readFileSync(m,"utf-8")}catch{return}};return utils.json=function(){var o=l.apply(null,arguments);return o?h(o):null},utils.env=function(o,f){f=f||process.env;var m={},p=o.length;for(var d in f)if(d.toLowerCase().indexOf(o.toLowerCase())===0){for(var S=d.substring(p).split("__"),v;(v=S.indexOf(""))>-1;)S.splice(v,1);var y=m;S.forEach(a(function(b,s){!b||typeof y!="object"||(s===S.length-1&&(y[b]=f[d]),y[b]===void 0&&(y[b]={}),y=y[b])},"_buildSubObj"))}return m},utils.find=function(){var o=i.join.apply(null,[].slice.call(arguments));function f(m,p){var d=i.join(m,p);try{return n.statSync(d),d}catch{if(i.dirname(m)!==m)return f(i.dirname(m),p)}}return a(f,"find"),f(process.cwd(),o)},utils}a(requireUtils,"requireUtils");var deepExtend={exports:{}};/*!
* @description Recursive object extending
* @author Viacheslav Lotsmanov <lotsmanov89@gmail.com>
* @license MIT
*
* The MIT License (MIT)
*
* Copyright (c) 2013-2018 Viacheslav Lotsmanov
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/var hasRequiredDeepExtend;function requireDeepExtend(){if(hasRequiredDeepExtend)return deepExtend.exports;hasRequiredDeepExtend=1;function n(l){return l instanceof Buffer||l instanceof Date||l instanceof RegExp}a(n,"isSpecificValue");function r(l){if(l instanceof Buffer){var o=Buffer.alloc?Buffer.alloc(l.length):new Buffer(l.length);return l.copy(o),o}else{if(l instanceof Date)return new Date(l.getTime());if(l instanceof RegExp)return new RegExp(l);throw new Error("Unexpected situation")}}a(r,"cloneSpecificValue");function i(l){var o=[];return l.forEach(function(f,m){typeof f=="object"&&f!==null?Array.isArray(f)?o[m]=i(f):n(f)?o[m]=r(f):o[m]=h({},f):o[m]=f}),o}a(i,"deepCloneArray");function c(l,o){return o==="__proto__"?void 0:l[o]}a(c,"safeGetProperty");var h=deepExtend.exports=function(){if(arguments.length<1||typeof arguments[0]!="object")return!1;if(arguments.length<2)return arguments[0];var l=arguments[0],o=Array.prototype.slice.call(arguments,1),f,m;return o.forEach(function(p){typeof p!="object"||p===null||Array.isArray(p)||Object.keys(p).forEach(function(d){if(m=c(l,d),f=c(p,d),f!==l)if(typeof f!="object"||f===null){l[d]=f;return}else if(Array.isArray(f)){l[d]=i(f);return}else if(n(f)){l[d]=r(f);return}else if(typeof m!="object"||m===null||Array.isArray(m)){l[d]=h({},f);return}else{l[d]=h(m,f);return}})}),l};return deepExtend.exports}a(requireDeepExtend,"requireDeepExtend");var minimist,hasRequiredMinimist;function requireMinimist(){if(hasRequiredMinimist)return minimist;hasRequiredMinimist=1;function n(c,h){var l=c;h.slice(0,-1).forEach(function(f){l=l[f]||{}});var o=h[h.length-1];return o in l}a(n,"hasKey");function r(c){return typeof c=="number"||/^0x[0-9a-f]+$/i.test(c)?!0:/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(c)}a(r,"isNumber");function i(c,h){return h==="constructor"&&typeof c[h]=="function"||h==="__proto__"}return a(i,"isConstructorOrProto"),minimist=a(function(c,h){h||(h={});var l={bools:{},strings:{},unknownFn:null};typeof h.unknown=="function"&&(l.unknownFn=h.unknown),typeof h.boolean=="boolean"&&h.boolean?l.allBools=!0:[].concat(h.boolean).filter(Boolean).forEach(function(A){l.bools[A]=!0});var o={};function f(A){return o[A].some(function(F){return l.bools[F]})}a(f,"aliasIsBoolean"),Object.keys(h.alias||{}).forEach(function(A){o[A]=[].concat(h.alias[A]),o[A].forEach(function(F){o[F]=[A].concat(o[A].filter(function(U){return F!==U}))})}),[].concat(h.string).filter(Boolean).forEach(function(A){l.strings[A]=!0,o[A]&&[].concat(o[A]).forEach(function(F){l.strings[F]=!0})});var m=h.default||{},p={_:[]};function d(A,F){return l.allBools&&/^--[^=]+$/.test(F)||l.strings[A]||l.bools[A]||o[A]}a(d,"argDefined");function S(A,F,U){for(var q=A,H=0;H<F.length-1;H++){var V=F[H];if(i(q,V))return;q[V]===void 0&&(q[V]={}),(q[V]===Object.prototype||q[V]===Number.prototype||q[V]===String.prototype)&&(q[V]={}),q[V]===Array.prototype&&(q[V]=[]),q=q[V]}var Y=F[F.length-1];i(q,Y)||((q===Object.prototype||q===Number.prototype||q===String.prototype)&&(q={}),q===Array.prototype&&(q=[]),q[Y]===void 0||l.bools[Y]||typeof q[Y]=="boolean"?q[Y]=U:Array.isArray(q[Y])?q[Y].push(U):q[Y]=[q[Y],U])}a(S,"setKey");function v(A,F,U){if(!(U&&l.unknownFn&&!d(A,U)&&l.unknownFn(U)===!1)){var q=!l.strings[A]&&r(F)?Number(F):F;S(p,A.split("."),q),(o[A]||[]).forEach(function(H){S(p,H.split("."),q)})}}a(v,"setArg"),Object.keys(l.bools).forEach(function(A){v(A,m[A]===void 0?!1:m[A])});var y=[];c.indexOf("--")!==-1&&(y=c.slice(c.indexOf("--")+1),c=c.slice(0,c.indexOf("--")));for(var w=0;w<c.length;w++){var b=c[w],s,g;if(/^--.+=/.test(b)){var E=b.match(/^--([^=]+)=([\s\S]*)$/);s=E[1];var _=E[2];l.bools[s]&&(_=_!=="false"),v(s,_,b)}else if(/^--no-.+/.test(b))s=b.match(/^--no-(.+)/)[1],v(s,!1,b);else if(/^--.+/.test(b))s=b.match(/^--(.+)/)[1],g=c[w+1],g!==void 0&&!/^(-|--)[^-]/.test(g)&&!l.bools[s]&&!l.allBools&&(!o[s]||!f(s))?(v(s,g,b),w+=1):/^(true|false)$/.test(g)?(v(s,g==="true",b),w+=1):v(s,l.strings[s]?"":!0,b);else if(/^-[^-]+/.test(b)){for(var O=b.slice(1,-1).split(""),I=!1,x=0;x<O.length;x++){if(g=b.slice(x+2),g==="-"){v(O[x],g,b);continue}if(/[A-Za-z]/.test(O[x])&&g[0]==="="){v(O[x],g.slice(1),b),I=!0;break}if(/[A-Za-z]/.test(O[x])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(g)){v(O[x],g,b),I=!0;break}if(O[x+1]&&O[x+1].match(/\W/)){v(O[x],b.slice(x+2),b),I=!0;break}else v(O[x],l.strings[O[x]]?"":!0,b)}s=b.slice(-1)[0],!I&&s!=="-"&&(c[w+1]&&!/^(-|--)[^-]/.test(c[w+1])&&!l.bools[s]&&(!o[s]||!f(s))?(v(s,c[w+1],b),w+=1):c[w+1]&&/^(true|false)$/.test(c[w+1])?(v(s,c[w+1]==="true",b),w+=1):v(s,l.strings[s]?"":!0,b))}else if((!l.unknownFn||l.unknownFn(b)!==!1)&&p._.push(l.strings._||!r(b)?b:Number(b)),h.stopEarly){p._.push.apply(p._,c.slice(w+1));break}}return Object.keys(m).forEach(function(A){n(p,A.split("."))||(S(p,A.split("."),m[A]),(o[A]||[]).forEach(function(F){S(p,F.split("."),m[A])}))}),h["--"]?p["--"]=y.slice():y.forEach(function(A){p._.push(A)}),p},"minimist"),minimis