@nice-move/init 0.8.21 → 0.8.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,202 +0,0 @@
1
- import{__commonJSMin as e,__require as t,__toESM as n}from"./chunk-D0Fku8VQ.mjs";import{createRequire as r}from"node:module";import i,{isAbsolute as a,join as o,parse as s,resolve as c}from"node:path";import{fileURLToPath as l}from"node:url";import u,{execArgv as d,execPath as f,hrtime as p,platform as m}from"node:process";import h,{constants as g,type as _}from"node:os";import v from"node:tty";import y,{ChildProcess as b,execFile as x,execSync as S,spawn as C,spawnSync as w}from"node:child_process";import{appendFileSync as ee,createReadStream as te,createWriteStream as ne,readFileSync as re,readdirSync as ie,statSync as ae,writeFileSync as oe}from"node:fs";import{aborted as se,callbackify as ce,debuglog as le,inspect as ue,promisify as de,stripVTControlCharacters as fe}from"node:util";import{StringDecoder as pe}from"node:string_decoder";import{scheduler as me,setImmediate as he,setTimeout as ge}from"node:timers/promises";import{EventEmitter as _e,addAbortListener as ve,on as ye,once as T,setMaxListeners as be}from"node:events";import{serialize as xe}from"node:v8";import{finished as E}from"node:stream/promises";import{Duplex as Se,PassThrough as Ce,Readable as we,Transform as Te,Writable as Ee,getDefaultHighWaterMark as De}from"node:stream";import{Buffer as Oe}from"node:buffer";var D=e((exports=>{exports.fromCallback=function(e){return Object.defineProperty(function(...t){if(typeof t[t.length-1]==`function`)e.apply(this,t);else return new Promise((n,r)=>{t.push((e,t)=>e==null?n(t):r(e)),e.apply(this,t)})},`name`,{value:e.name})},exports.fromPromise=function(e){return Object.defineProperty(function(...t){let n=t[t.length-1];if(typeof n!=`function`)return e.apply(this,t);t.pop(),e.apply(this,t).then(e=>n(null,e),n)},`name`,{value:e.name})}})),ke=e(((exports,n)=>{var r=t(`constants`),i=process.cwd,a=null,o=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return a||(a=i.call(process)),a};try{process.cwd()}catch(e){}if(typeof process.chdir==`function`){var s=process.chdir;process.chdir=function(e){a=null,s.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,s)}n.exports=c;function c(e){r.hasOwnProperty(`O_SYMLINK`)&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&t(e),e.lutimes||n(e),e.chown=s(e.chown),e.fchown=s(e.fchown),e.lchown=s(e.lchown),e.chmod=i(e.chmod),e.fchmod=i(e.fchmod),e.lchmod=i(e.lchmod),e.chownSync=c(e.chownSync),e.fchownSync=c(e.fchownSync),e.lchownSync=c(e.lchownSync),e.chmodSync=a(e.chmodSync),e.fchmodSync=a(e.fchmodSync),e.lchmodSync=a(e.lchmodSync),e.stat=l(e.stat),e.fstat=l(e.fstat),e.lstat=l(e.lstat),e.statSync=u(e.statSync),e.fstatSync=u(e.fstatSync),e.lstatSync=u(e.lstatSync),e.chmod&&!e.lchmod&&(e.lchmod=function(e,t,n){n&&process.nextTick(n)},e.lchmodSync=function(){}),e.chown&&!e.lchown&&(e.lchown=function(e,t,n,r){r&&process.nextTick(r)},e.lchownSync=function(){}),o===`win32`&&(e.rename=typeof e.rename==`function`?(function(t){function n(n,r,i){var a=Date.now(),o=0;t(n,r,function s(c){if(c&&(c.code===`EACCES`||c.code===`EPERM`||c.code===`EBUSY`)&&Date.now()-a<6e4){setTimeout(function(){e.stat(r,function(e,a){e&&e.code===`ENOENT`?t(n,r,s):i(c)})},o),o<100&&(o+=10);return}i&&i(c)})}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n})(e.rename):e.rename),e.read=typeof e.read==`function`?(function(t){function n(n,r,i,a,o,s){var c;if(s&&typeof s==`function`){var l=0;c=function(u,d,f){if(u&&u.code===`EAGAIN`&&l<10)return l++,t.call(e,n,r,i,a,o,c);s.apply(this,arguments)}}return t.call(e,n,r,i,a,o,c)}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n})(e.read):e.read,e.readSync=typeof e.readSync==`function`?(function(t){return function(n,r,i,a,o){for(var s=0;;)try{return t.call(e,n,r,i,a,o)}catch(e){if(e.code===`EAGAIN`&&s<10){s++;continue}throw e}}})(e.readSync):e.readSync;function t(e){e.lchmod=function(t,n,i){e.open(t,r.O_WRONLY|r.O_SYMLINK,n,function(t,r){if(t){i&&i(t);return}e.fchmod(r,n,function(t){e.close(r,function(e){i&&i(t||e)})})})},e.lchmodSync=function(t,n){var i=e.openSync(t,r.O_WRONLY|r.O_SYMLINK,n),a=!0,o;try{o=e.fchmodSync(i,n),a=!1}finally{if(a)try{e.closeSync(i)}catch(e){}else e.closeSync(i)}return o}}function n(e){r.hasOwnProperty(`O_SYMLINK`)&&e.futimes?(e.lutimes=function(t,n,i,a){e.open(t,r.O_SYMLINK,function(t,r){if(t){a&&a(t);return}e.futimes(r,n,i,function(t){e.close(r,function(e){a&&a(t||e)})})})},e.lutimesSync=function(t,n,i){var a=e.openSync(t,r.O_SYMLINK),o,s=!0;try{o=e.futimesSync(a,n,i),s=!1}finally{if(s)try{e.closeSync(a)}catch(e){}else e.closeSync(a)}return o}):e.futimes&&(e.lutimes=function(e,t,n,r){r&&process.nextTick(r)},e.lutimesSync=function(){})}function i(t){return t&&function(n,r,i){return t.call(e,n,r,function(e){d(e)&&(e=null),i&&i.apply(this,arguments)})}}function a(t){return t&&function(n,r){try{return t.call(e,n,r)}catch(e){if(!d(e))throw e}}}function s(t){return t&&function(n,r,i,a){return t.call(e,n,r,i,function(e){d(e)&&(e=null),a&&a.apply(this,arguments)})}}function c(t){return t&&function(n,r,i){try{return t.call(e,n,r,i)}catch(e){if(!d(e))throw e}}}function l(t){return t&&function(n,r,i){typeof r==`function`&&(i=r,r=null);function a(e,t){t&&(t.uid<0&&(t.uid+=4294967296),t.gid<0&&(t.gid+=4294967296)),i&&i.apply(this,arguments)}return r?t.call(e,n,r,a):t.call(e,n,a)}}function u(t){return t&&function(n,r){var i=r?t.call(e,n,r):t.call(e,n);return i&&(i.uid<0&&(i.uid+=4294967296),i.gid<0&&(i.gid+=4294967296)),i}}function d(e){return!e||e.code===`ENOSYS`||(!process.getuid||process.getuid()!==0)&&(e.code===`EINVAL`||e.code===`EPERM`)}}})),Ae=e(((exports,n)=>{var r=t(`stream`).Stream;n.exports=i;function i(e){return{ReadStream:t,WriteStream:n};function t(n,i){if(!(this instanceof t))return new t(n,i);r.call(this);var a=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 o=Object.keys(i),s=0,c=o.length;s<c;s++){var l=o[s];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 Error(`start must be <= end`);this.pos=this.start}if(this.fd!==null){process.nextTick(function(){a._read()});return}e.open(this.path,this.flags,this.mode,function(e,t){if(e){a.emit(`error`,e),a.readable=!1;return}a.fd=t,a.emit(`open`,t),a._read()})}function n(t,i){if(!(this instanceof n))return new n(t,i);r.call(this),this.path=t,this.fd=null,this.writable=!0,this.flags=`w`,this.encoding=`binary`,this.mode=438,this.bytesWritten=0,i=i||{};for(var a=Object.keys(i),o=0,s=a.length;o<s;o++){var c=a[o];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 Error(`start must be >= zero`);this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}})),je=e(((exports,t)=>{t.exports=r;var n=Object.getPrototypeOf||function(e){return e.__proto__};function r(e){if(typeof e!=`object`||!e)return e;if(e instanceof Object)var t={__proto__:n(e)};else var t=Object.create(null);return Object.getOwnPropertyNames(e).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}),t}})),Me=e(((exports,n)=>{var r=t(`fs`),i=ke(),a=Ae(),o=je(),s=t(`util`),c,l;typeof Symbol==`function`&&typeof Symbol.for==`function`?(c=Symbol.for(`graceful-fs.queue`),l=Symbol.for(`graceful-fs.previous`)):(c=`___graceful-fs.queue`,l=`___graceful-fs.previous`);function u(){}function d(e,t){Object.defineProperty(e,c,{get:function(){return t}})}var f=u;if(s.debuglog?f=s.debuglog(`gfs4`):/\bgfs4\b/i.test(process.env.NODE_DEBUG||``)&&(f=function(){var e=s.format.apply(s,arguments);e=`GFS4: `+e.split(/\n/).join(`
2
- GFS4: `),console.error(e)}),!r[c]){var p=global[c]||[];d(r,p),r.close=(function(e){function t(t,n){return e.call(r,t,function(e){e||_(),typeof n==`function`&&n.apply(this,arguments)})}return Object.defineProperty(t,l,{value:e}),t})(r.close),r.closeSync=(function(e){function t(t){e.apply(r,arguments),_()}return Object.defineProperty(t,l,{value:e}),t})(r.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||``)&&process.on(`exit`,function(){f(r[c]),t(`assert`).equal(r[c].length,0)})}global[c]||d(global,r[c]),n.exports=m(o(r)),process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!r.__patched&&(n.exports=m(r),r.__patched=!0);function m(e){i(e),e.gracefulify=m,e.createReadStream=ee,e.createWriteStream=te;var t=e.readFile;e.readFile=n;function n(e,n,r){return typeof n==`function`&&(r=n,n=null),i(e,n,r);function i(e,n,r,a){return t(e,n,function(t){t&&(t.code===`EMFILE`||t.code===`ENFILE`)?h([i,[e,n,r],t,a||Date.now(),Date.now()]):typeof r==`function`&&r.apply(this,arguments)})}}var r=e.writeFile;e.writeFile=o;function o(e,t,n,i){return typeof n==`function`&&(i=n,n=null),a(e,t,n,i);function a(e,t,n,i,o){return r(e,t,n,function(r){r&&(r.code===`EMFILE`||r.code===`ENFILE`)?h([a,[e,t,n,i],r,o||Date.now(),Date.now()]):typeof i==`function`&&i.apply(this,arguments)})}}var s=e.appendFile;s&&(e.appendFile=c);function c(e,t,n,r){return typeof n==`function`&&(r=n,n=null),i(e,t,n,r);function i(e,t,n,r,a){return s(e,t,n,function(o){o&&(o.code===`EMFILE`||o.code===`ENFILE`)?h([i,[e,t,n,r],o,a||Date.now(),Date.now()]):typeof r==`function`&&r.apply(this,arguments)})}}var l=e.copyFile;l&&(e.copyFile=u);function u(e,t,n,r){return typeof n==`function`&&(r=n,n=0),i(e,t,n,r);function i(e,t,n,r,a){return l(e,t,n,function(o){o&&(o.code===`EMFILE`||o.code===`ENFILE`)?h([i,[e,t,n,r],o,a||Date.now(),Date.now()]):typeof r==`function`&&r.apply(this,arguments)})}}var d=e.readdir;e.readdir=p;var f=/^v[0-5]\./;function p(e,t,n){typeof t==`function`&&(n=t,t=null);var r=f.test(process.version)?function(e,t,n,r){return d(e,i(e,t,n,r))}:function(e,t,n,r){return d(e,t,i(e,t,n,r))};return r(e,t,n);function i(e,t,n,i){return function(a,o){a&&(a.code===`EMFILE`||a.code===`ENFILE`)?h([r,[e,t,n],a,i||Date.now(),Date.now()]):(o&&o.sort&&o.sort(),typeof n==`function`&&n.call(this,a,o))}}}if(process.version.substr(0,4)===`v0.8`){var g=a(e);x=g.ReadStream,C=g.WriteStream}var _=e.ReadStream;_&&(x.prototype=Object.create(_.prototype),x.prototype.open=S);var v=e.WriteStream;v&&(C.prototype=Object.create(v.prototype),C.prototype.open=w),Object.defineProperty(e,`ReadStream`,{get:function(){return x},set:function(e){x=e},enumerable:!0,configurable:!0}),Object.defineProperty(e,`WriteStream`,{get:function(){return C},set:function(e){C=e},enumerable:!0,configurable:!0});var y=x;Object.defineProperty(e,`FileReadStream`,{get:function(){return y},set:function(e){y=e},enumerable:!0,configurable:!0});var b=C;Object.defineProperty(e,`FileWriteStream`,{get:function(){return b},set:function(e){b=e},enumerable:!0,configurable:!0});function x(e,t){return this instanceof x?(_.apply(this,arguments),this):x.apply(Object.create(x.prototype),arguments)}function S(){var e=this;re(e.path,e.flags,e.mode,function(t,n){t?(e.autoClose&&e.destroy(),e.emit(`error`,t)):(e.fd=n,e.emit(`open`,n),e.read())})}function C(e,t){return this instanceof C?(v.apply(this,arguments),this):C.apply(Object.create(C.prototype),arguments)}function w(){var e=this;re(e.path,e.flags,e.mode,function(t,n){t?(e.destroy(),e.emit(`error`,t)):(e.fd=n,e.emit(`open`,n))})}function ee(t,n){return new e.ReadStream(t,n)}function te(t,n){return new e.WriteStream(t,n)}var ne=e.open;e.open=re;function re(e,t,n,r){return typeof n==`function`&&(r=n,n=null),i(e,t,n,r);function i(e,t,n,r,a){return ne(e,t,n,function(o,s){o&&(o.code===`EMFILE`||o.code===`ENFILE`)?h([i,[e,t,n,r],o,a||Date.now(),Date.now()]):typeof r==`function`&&r.apply(this,arguments)})}}return e}function h(e){f(`ENQUEUE`,e[0].name,e[1]),r[c].push(e),v()}var g;function _(){for(var e=Date.now(),t=0;t<r[c].length;++t)r[c][t].length>2&&(r[c][t][3]=e,r[c][t][4]=e);v()}function v(){if(clearTimeout(g),g=void 0,r[c].length!==0){var e=r[c].shift(),t=e[0],n=e[1],i=e[2],a=e[3],o=e[4];if(a===void 0)f(`RETRY`,t.name,n),t.apply(null,n);else if(Date.now()-a>=6e4){f(`TIMEOUT`,t.name,n);var s=n.pop();typeof s==`function`&&s.call(null,i)}else{var l=Date.now()-o,u=Math.max(o-a,1),d=Math.min(u*1.2,100);l>=d?(f(`RETRY`,t.name,n),t.apply(null,n.concat([a]))):r[c].push(e)}g===void 0&&(g=setTimeout(v,0))}}})),O=e((exports=>{let t=D().fromCallback,n=Me(),r=`access.appendFile.chmod.chown.close.copyFile.cp.fchmod.fchown.fdatasync.fstat.fsync.ftruncate.futimes.glob.lchmod.lchown.lutimes.link.lstat.mkdir.mkdtemp.open.opendir.readdir.readFile.readlink.realpath.rename.rm.rmdir.stat.statfs.symlink.truncate.unlink.utimes.writeFile`.split(`.`).filter(e=>typeof n[e]==`function`);Object.assign(exports,n),r.forEach(r=>{exports[r]=t(n[r])}),exports.exists=function(e,t){return typeof t==`function`?n.exists(e,t):new Promise(t=>n.exists(e,t))},exports.read=function(e,t,r,i,a,o){return typeof o==`function`?n.read(e,t,r,i,a,o):new Promise((o,s)=>{n.read(e,t,r,i,a,(e,t,n)=>{if(e)return s(e);o({bytesRead:t,buffer:n})})})},exports.write=function(e,t,...r){return typeof r[r.length-1]==`function`?n.write(e,t,...r):new Promise((i,a)=>{n.write(e,t,...r,(e,t,n)=>{if(e)return a(e);i({bytesWritten:t,buffer:n})})})},exports.readv=function(e,t,...r){return typeof r[r.length-1]==`function`?n.readv(e,t,...r):new Promise((i,a)=>{n.readv(e,t,...r,(e,t,n)=>{if(e)return a(e);i({bytesRead:t,buffers:n})})})},exports.writev=function(e,t,...r){return typeof r[r.length-1]==`function`?n.writev(e,t,...r):new Promise((i,a)=>{n.writev(e,t,...r,(e,t,n)=>{if(e)return a(e);i({bytesWritten:t,buffers:n})})})},typeof n.realpath.native==`function`?exports.realpath.native=t(n.realpath.native):process.emitWarning(`fs.realpath.native is not a function. Is fs being monkey-patched?`,`Warning`,`fs-extra-WARN0003`)})),Ne=e(((exports,n)=>{let r=t(`path`);n.exports.checkPath=function(e){if(process.platform===`win32`&&/[<>:"|?*]/.test(e.replace(r.parse(e).root,``))){let t=Error(`Path contains invalid characters: ${e}`);throw t.code=`EINVAL`,t}}})),Pe=e(((exports,t)=>{let n=O(),{checkPath:r}=Ne(),i=e=>typeof e==`number`?e:{mode:511,...e}.mode;t.exports.makeDir=async(e,t)=>(r(e),n.mkdir(e,{mode:i(t),recursive:!0})),t.exports.makeDirSync=(e,t)=>(r(e),n.mkdirSync(e,{mode:i(t),recursive:!0}))})),k=e(((exports,t)=>{let n=D().fromPromise,{makeDir:r,makeDirSync:i}=Pe(),a=n(r);t.exports={mkdirs:a,mkdirsSync:i,mkdirp:a,mkdirpSync:i,ensureDir:a,ensureDirSync:i}})),A=e(((exports,t)=>{let n=D().fromPromise,r=O();function i(e){return r.access(e).then(()=>!0).catch(()=>!1)}t.exports={pathExists:n(i),pathExistsSync:r.existsSync}})),Fe=e(((exports,t)=>{let n=O(),r=D().fromPromise;async function i(e,t,r){let i=await n.open(e,`r+`),a=null;try{await n.futimes(i,t,r)}finally{try{await n.close(i)}catch(e){a=e}}if(a)throw a}function a(e,t,r){let i=n.openSync(e,`r+`);return n.futimesSync(i,t,r),n.closeSync(i)}t.exports={utimesMillis:r(i),utimesMillisSync:a}})),Ie=e(((exports,n)=>{let r=O(),i=t(`path`),a=D().fromPromise;function o(e,t,n){let i=n.dereference?e=>r.stat(e,{bigint:!0}):e=>r.lstat(e,{bigint:!0});return Promise.all([i(e),i(t).catch(e=>{if(e.code===`ENOENT`)return null;throw e})]).then(([e,t])=>({srcStat:e,destStat:t}))}function s(e,t,n){let i,a=n.dereference?e=>r.statSync(e,{bigint:!0}):e=>r.lstatSync(e,{bigint:!0}),o=a(e);try{i=a(t)}catch(e){if(e.code===`ENOENT`)return{srcStat:o,destStat:null};throw e}return{srcStat:o,destStat:i}}async function c(e,t,n,r){let{srcStat:a,destStat:s}=await o(e,t,r);if(s){if(f(a,s)){let r=i.basename(e),o=i.basename(t);if(n===`move`&&r!==o&&r.toLowerCase()===o.toLowerCase())return{srcStat:a,destStat:s,isChangingCase:!0};throw Error(`Source and destination must not be the same.`)}if(a.isDirectory()&&!s.isDirectory())throw Error(`Cannot overwrite non-directory '${t}' with directory '${e}'.`);if(!a.isDirectory()&&s.isDirectory())throw Error(`Cannot overwrite directory '${t}' with non-directory '${e}'.`)}if(a.isDirectory()&&p(e,t))throw Error(m(e,t,n));return{srcStat:a,destStat:s}}function l(e,t,n,r){let{srcStat:a,destStat:o}=s(e,t,r);if(o){if(f(a,o)){let r=i.basename(e),s=i.basename(t);if(n===`move`&&r!==s&&r.toLowerCase()===s.toLowerCase())return{srcStat:a,destStat:o,isChangingCase:!0};throw Error(`Source and destination must not be the same.`)}if(a.isDirectory()&&!o.isDirectory())throw Error(`Cannot overwrite non-directory '${t}' with directory '${e}'.`);if(!a.isDirectory()&&o.isDirectory())throw Error(`Cannot overwrite directory '${t}' with non-directory '${e}'.`)}if(a.isDirectory()&&p(e,t))throw Error(m(e,t,n));return{srcStat:a,destStat:o}}async function u(e,t,n,a){let o=i.resolve(i.dirname(e)),s=i.resolve(i.dirname(n));if(s===o||s===i.parse(s).root)return;let c;try{c=await r.stat(s,{bigint:!0})}catch(e){if(e.code===`ENOENT`)return;throw e}if(f(t,c))throw Error(m(e,n,a));return u(e,t,s,a)}function d(e,t,n,a){let o=i.resolve(i.dirname(e)),s=i.resolve(i.dirname(n));if(s===o||s===i.parse(s).root)return;let c;try{c=r.statSync(s,{bigint:!0})}catch(e){if(e.code===`ENOENT`)return;throw e}if(f(t,c))throw Error(m(e,n,a));return d(e,t,s,a)}function f(e,t){return t.ino!==void 0&&t.dev!==void 0&&t.ino===e.ino&&t.dev===e.dev}function p(e,t){let n=i.resolve(e).split(i.sep).filter(e=>e),r=i.resolve(t).split(i.sep).filter(e=>e);return n.every((e,t)=>r[t]===e)}function m(e,t,n){return`Cannot ${n} '${e}' to a subdirectory of itself, '${t}'.`}n.exports={checkPaths:a(c),checkPathsSync:l,checkParentPaths:a(u),checkParentPathsSync:d,isSrcSubdir:p,areIdentical:f}})),Le=e(((exports,t)=>{async function n(e,t){let n=[];for await(let r of e)n.push(t(r).then(()=>null,e=>e??Error(`unknown error`)));await Promise.all(n.map(e=>e.then(e=>{if(e!==null)throw e})))}t.exports={asyncIteratorConcurrentProcess:n}})),Re=e(((exports,n)=>{let r=O(),i=t(`path`),{mkdirs:a}=k(),{pathExists:o}=A(),{utimesMillis:s}=Fe(),c=Ie(),{asyncIteratorConcurrentProcess:l}=Le();async function u(e,t,n={}){typeof n==`function`&&(n={filter:n}),n.clobber=`clobber`in n?!!n.clobber:!0,n.overwrite=`overwrite`in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&process.arch===`ia32`&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
3
-
4
- see https://github.com/jprichardson/node-fs-extra/issues/269`,`Warning`,`fs-extra-WARN0001`);let{srcStat:r,destStat:s}=await c.checkPaths(e,t,`copy`,n);if(await c.checkParentPaths(e,r,t,`copy`),!await d(e,t,n))return;let l=i.dirname(t);await o(l)||await a(l),await f(s,e,t,n)}async function d(e,t,n){return n.filter?n.filter(e,t):!0}async function f(e,t,n,i){let a=await(i.dereference?r.stat:r.lstat)(t);if(a.isDirectory())return _(a,e,t,n,i);if(a.isFile()||a.isCharacterDevice()||a.isBlockDevice())return p(a,e,t,n,i);if(a.isSymbolicLink())return v(e,t,n,i);throw a.isSocket()?Error(`Cannot copy a socket file: ${t}`):a.isFIFO()?Error(`Cannot copy a FIFO pipe: ${t}`):Error(`Unknown file: ${t}`)}async function p(e,t,n,i,a){if(!t)return m(e,n,i,a);if(a.overwrite)return await r.unlink(i),m(e,n,i,a);if(a.errorOnExist)throw Error(`'${i}' already exists`)}async function m(e,t,n,i){if(await r.copyFile(t,n),i.preserveTimestamps){h(e.mode)&&await g(n,e.mode);let i=await r.stat(t);await s(n,i.atime,i.mtime)}return r.chmod(n,e.mode)}function h(e){return(e&128)==0}function g(e,t){return r.chmod(e,t|128)}async function _(e,t,n,a,o){t||await r.mkdir(a),await l(await r.opendir(n),async e=>{let t=i.join(n,e.name),r=i.join(a,e.name);if(await d(t,r,o)){let{destStat:e}=await c.checkPaths(t,r,`copy`,o);await f(e,t,r,o)}}),t||await r.chmod(a,e.mode)}async function v(e,t,n,a){let o=await r.readlink(t);if(a.dereference&&(o=i.resolve(process.cwd(),o)),!e)return r.symlink(o,n);let s=null;try{s=await r.readlink(n)}catch(e){if(e.code===`EINVAL`||e.code===`UNKNOWN`)return r.symlink(o,n);throw e}if(a.dereference&&(s=i.resolve(process.cwd(),s)),c.isSrcSubdir(o,s))throw Error(`Cannot copy '${o}' to a subdirectory of itself, '${s}'.`);if(c.isSrcSubdir(s,o))throw Error(`Cannot overwrite '${s}' with '${o}'.`);return await r.unlink(n),r.symlink(o,n)}n.exports=u})),ze=e(((exports,n)=>{let r=Me(),i=t(`path`),a=k().mkdirsSync,o=Fe().utimesMillisSync,s=Ie();function c(e,t,n){typeof n==`function`&&(n={filter:n}),n=n||{},n.clobber=`clobber`in n?!!n.clobber:!0,n.overwrite=`overwrite`in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&process.arch===`ia32`&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
5
-
6
- see https://github.com/jprichardson/node-fs-extra/issues/269`,`Warning`,`fs-extra-WARN0002`);let{srcStat:o,destStat:c}=s.checkPathsSync(e,t,`copy`,n);if(s.checkParentPathsSync(e,o,t,`copy`),n.filter&&!n.filter(e,t))return;let u=i.dirname(t);return r.existsSync(u)||a(u),l(c,e,t,n)}function l(e,t,n,i){let a=(i.dereference?r.statSync:r.lstatSync)(t);if(a.isDirectory())return v(a,e,t,n,i);if(a.isFile()||a.isCharacterDevice()||a.isBlockDevice())return u(a,e,t,n,i);if(a.isSymbolicLink())return S(e,t,n,i);throw a.isSocket()?Error(`Cannot copy a socket file: ${t}`):a.isFIFO()?Error(`Cannot copy a FIFO pipe: ${t}`):Error(`Unknown file: ${t}`)}function u(e,t,n,r,i){return t?d(e,n,r,i):f(e,n,r,i)}function d(e,t,n,i){if(i.overwrite)return r.unlinkSync(n),f(e,t,n,i);if(i.errorOnExist)throw Error(`'${n}' already exists`)}function f(e,t,n,i){return r.copyFileSync(t,n),i.preserveTimestamps&&p(e.mode,t,n),g(n,e.mode)}function p(e,t,n){return m(e)&&h(n,e),_(t,n)}function m(e){return(e&128)==0}function h(e,t){return g(e,t|128)}function g(e,t){return r.chmodSync(e,t)}function _(e,t){let n=r.statSync(e);return o(t,n.atime,n.mtime)}function v(e,t,n,r,i){return t?b(n,r,i):y(e.mode,n,r,i)}function y(e,t,n,i){return r.mkdirSync(n),b(t,n,i),g(n,e)}function b(e,t,n){let i=r.opendirSync(e);try{let r;for(;(r=i.readSync())!==null;)x(r.name,e,t,n)}finally{i.closeSync()}}function x(e,t,n,r){let a=i.join(t,e),o=i.join(n,e);if(r.filter&&!r.filter(a,o))return;let{destStat:c}=s.checkPathsSync(a,o,`copy`,r);return l(c,a,o,r)}function S(e,t,n,a){let o=r.readlinkSync(t);if(a.dereference&&(o=i.resolve(process.cwd(),o)),e){let e;try{e=r.readlinkSync(n)}catch(e){if(e.code===`EINVAL`||e.code===`UNKNOWN`)return r.symlinkSync(o,n);throw e}if(a.dereference&&(e=i.resolve(process.cwd(),e)),s.isSrcSubdir(o,e))throw Error(`Cannot copy '${o}' to a subdirectory of itself, '${e}'.`);if(s.isSrcSubdir(e,o))throw Error(`Cannot overwrite '${e}' with '${o}'.`);return C(o,n)}else return r.symlinkSync(o,n)}function C(e,t){return r.unlinkSync(t),r.symlinkSync(e,t)}n.exports=c})),Be=e(((exports,t)=>{let n=D().fromPromise;t.exports={copy:n(Re()),copySync:ze()}})),Ve=e(((exports,t)=>{let n=Me(),r=D().fromCallback;function i(e,t){n.rm(e,{recursive:!0,force:!0},t)}function a(e){n.rmSync(e,{recursive:!0,force:!0})}t.exports={remove:r(i),removeSync:a}})),He=e(((exports,n)=>{let r=D().fromPromise,i=O(),a=t(`path`),o=k(),s=Ve(),c=r(async function(e){let t;try{t=await i.readdir(e)}catch{return o.mkdirs(e)}return Promise.all(t.map(t=>s.remove(a.join(e,t))))});function l(e){let t;try{t=i.readdirSync(e)}catch{return o.mkdirsSync(e)}t.forEach(t=>{t=a.join(e,t),s.removeSync(t)})}n.exports={emptyDirSync:l,emptydirSync:l,emptyDir:c,emptydir:c}})),Ue=e(((exports,n)=>{let r=D().fromPromise,i=t(`path`),a=O(),o=k();async function s(e){let t;try{t=await a.stat(e)}catch{}if(t&&t.isFile())return;let n=i.dirname(e),r=null;try{r=await a.stat(n)}catch(t){if(t.code===`ENOENT`){await o.mkdirs(n),await a.writeFile(e,``);return}else throw t}r.isDirectory()?await a.writeFile(e,``):await a.readdir(n)}function c(e){let t;try{t=a.statSync(e)}catch{}if(t&&t.isFile())return;let n=i.dirname(e);try{a.statSync(n).isDirectory()||a.readdirSync(n)}catch(e){if(e&&e.code===`ENOENT`)o.mkdirsSync(n);else throw e}a.writeFileSync(e,``)}n.exports={createFile:r(s),createFileSync:c}})),We=e(((exports,n)=>{let r=D().fromPromise,i=t(`path`),a=O(),o=k(),{pathExists:s}=A(),{areIdentical:c}=Ie();async function l(e,t){let n;try{n=await a.lstat(t)}catch{}let r;try{r=await a.lstat(e)}catch(e){throw e.message=e.message.replace(`lstat`,`ensureLink`),e}if(n&&c(r,n))return;let l=i.dirname(t);await s(l)||await o.mkdirs(l),await a.link(e,t)}function u(e,t){let n;try{n=a.lstatSync(t)}catch{}try{let t=a.lstatSync(e);if(n&&c(t,n))return}catch(e){throw e.message=e.message.replace(`lstat`,`ensureLink`),e}let r=i.dirname(t);return a.existsSync(r)||o.mkdirsSync(r),a.linkSync(e,t)}n.exports={createLink:r(l),createLinkSync:u}})),Ge=e(((exports,n)=>{let r=t(`path`),i=O(),{pathExists:a}=A(),o=D().fromPromise;async function s(e,t){if(r.isAbsolute(e)){try{await i.lstat(e)}catch(e){throw e.message=e.message.replace(`lstat`,`ensureSymlink`),e}return{toCwd:e,toDst:e}}let n=r.dirname(t),o=r.join(n,e);if(await a(o))return{toCwd:o,toDst:e};try{await i.lstat(e)}catch(e){throw e.message=e.message.replace(`lstat`,`ensureSymlink`),e}return{toCwd:e,toDst:r.relative(n,e)}}function c(e,t){if(r.isAbsolute(e)){if(!i.existsSync(e))throw Error(`absolute srcpath does not exist`);return{toCwd:e,toDst:e}}let n=r.dirname(t),a=r.join(n,e);if(i.existsSync(a))return{toCwd:a,toDst:e};if(!i.existsSync(e))throw Error(`relative srcpath does not exist`);return{toCwd:e,toDst:r.relative(n,e)}}n.exports={symlinkPaths:o(s),symlinkPathsSync:c}})),Ke=e(((exports,t)=>{let n=O(),r=D().fromPromise;async function i(e,t){if(t)return t;let r;try{r=await n.lstat(e)}catch{return`file`}return r&&r.isDirectory()?`dir`:`file`}function a(e,t){if(t)return t;let r;try{r=n.lstatSync(e)}catch{return`file`}return r&&r.isDirectory()?`dir`:`file`}t.exports={symlinkType:r(i),symlinkTypeSync:a}})),qe=e(((exports,n)=>{let r=D().fromPromise,i=t(`path`),a=O(),{mkdirs:o,mkdirsSync:s}=k(),{symlinkPaths:c,symlinkPathsSync:l}=Ge(),{symlinkType:u,symlinkTypeSync:d}=Ke(),{pathExists:f}=A(),{areIdentical:p}=Ie();async function m(e,t,n){let r;try{r=await a.lstat(t)}catch{}if(r&&r.isSymbolicLink()){let[n,r]=await Promise.all([a.stat(e),a.stat(t)]);if(p(n,r))return}let s=await c(e,t);e=s.toDst;let l=await u(s.toCwd,n),d=i.dirname(t);return await f(d)||await o(d),a.symlink(e,t,l)}function h(e,t,n){let r;try{r=a.lstatSync(t)}catch{}if(r&&r.isSymbolicLink()){let n=a.statSync(e),r=a.statSync(t);if(p(n,r))return}let o=l(e,t);e=o.toDst,n=d(o.toCwd,n);let c=i.dirname(t);return a.existsSync(c)||s(c),a.symlinkSync(e,t,n)}n.exports={createSymlink:r(m),createSymlinkSync:h}})),Je=e(((exports,t)=>{let{createFile:n,createFileSync:r}=Ue(),{createLink:i,createLinkSync:a}=We(),{createSymlink:o,createSymlinkSync:s}=qe();t.exports={createFile:n,createFileSync:r,ensureFile:n,ensureFileSync:r,createLink:i,createLinkSync:a,ensureLink:i,ensureLinkSync:a,createSymlink:o,createSymlinkSync:s,ensureSymlink:o,ensureSymlinkSync:s}})),Ye=e(((exports,t)=>{function n(e,{EOL:t=`
7
- `,finalEOL:n=!0,replacer:r=null,spaces:i}={}){let a=n?t:``;return JSON.stringify(e,r,i).replace(/\n/g,t)+a}function r(e){return Buffer.isBuffer(e)&&(e=e.toString(`utf8`)),e.replace(/^\uFEFF/,``)}t.exports={stringify:n,stripBom:r}})),Xe=e(((exports,n)=>{let r;try{r=Me()}catch(e){r=t(`fs`)}let i=D(),{stringify:a,stripBom:o}=Ye();async function s(e,t={}){typeof t==`string`&&(t={encoding:t});let n=t.fs||r,a=`throws`in t?t.throws:!0,s=await i.fromCallback(n.readFile)(e,t);s=o(s);let c;try{c=JSON.parse(s,t?t.reviver:null)}catch(t){if(a)throw t.message=`${e}: ${t.message}`,t;return null}return c}let c=i.fromPromise(s);function l(e,t={}){typeof t==`string`&&(t={encoding:t});let n=t.fs||r,i=`throws`in t?t.throws:!0;try{let r=n.readFileSync(e,t);return r=o(r),JSON.parse(r,t.reviver)}catch(t){if(i)throw t.message=`${e}: ${t.message}`,t;return null}}async function u(e,t,n={}){let o=n.fs||r,s=a(t,n);await i.fromCallback(o.writeFile)(e,s,n)}let d=i.fromPromise(u);function f(e,t,n={}){let i=n.fs||r,o=a(t,n);return i.writeFileSync(e,o,n)}n.exports={readFile:c,readFileSync:l,writeFile:d,writeFileSync:f}})),Ze=e(((exports,t)=>{let n=Xe();t.exports={readJson:n.readFile,readJsonSync:n.readFileSync,writeJson:n.writeFile,writeJsonSync:n.writeFileSync}})),Qe=e(((exports,n)=>{let r=D().fromPromise,i=O(),a=t(`path`),o=k(),s=A().pathExists;async function c(e,t,n=`utf-8`){let r=a.dirname(e);return await s(r)||await o.mkdirs(r),i.writeFile(e,t,n)}function l(e,...t){let n=a.dirname(e);i.existsSync(n)||o.mkdirsSync(n),i.writeFileSync(e,...t)}n.exports={outputFile:r(c),outputFileSync:l}})),$e=e(((exports,t)=>{let{stringify:n}=Ye(),{outputFile:r}=Qe();async function i(e,t,i={}){let a=n(t,i);await r(e,a,i)}t.exports=i})),et=e(((exports,t)=>{let{stringify:n}=Ye(),{outputFileSync:r}=Qe();function i(e,t,i){let a=n(t,i);r(e,a,i)}t.exports=i})),tt=e(((exports,t)=>{let n=D().fromPromise,r=Ze();r.outputJson=n($e()),r.outputJsonSync=et(),r.outputJSON=r.outputJson,r.outputJSONSync=r.outputJsonSync,r.writeJSON=r.writeJson,r.writeJSONSync=r.writeJsonSync,r.readJSON=r.readJson,r.readJSONSync=r.readJsonSync,t.exports=r})),nt=e(((exports,n)=>{let r=O(),i=t(`path`),{copy:a}=Be(),{remove:o}=Ve(),{mkdirp:s}=k(),{pathExists:c}=A(),l=Ie();async function u(e,t,n={}){let r=n.overwrite||n.clobber||!1,{srcStat:a,isChangingCase:o=!1}=await l.checkPaths(e,t,`move`,n);await l.checkParentPaths(e,a,t,`move`);let c=i.dirname(t);return i.parse(c).root!==c&&await s(c),d(e,t,r,o)}async function d(e,t,n,i){if(!i){if(n)await o(t);else if(await c(t))throw Error(`dest already exists.`)}try{await r.rename(e,t)}catch(r){if(r.code!==`EXDEV`)throw r;await f(e,t,n)}}async function f(e,t,n){return await a(e,t,{overwrite:n,errorOnExist:!0,preserveTimestamps:!0}),o(e)}n.exports=u})),rt=e(((exports,n)=>{let r=Me(),i=t(`path`),a=Be().copySync,o=Ve().removeSync,s=k().mkdirpSync,c=Ie();function l(e,t,n){n=n||{};let r=n.overwrite||n.clobber||!1,{srcStat:a,isChangingCase:o=!1}=c.checkPathsSync(e,t,`move`,n);return c.checkParentPathsSync(e,a,t,`move`),u(t)||s(i.dirname(t)),d(e,t,r,o)}function u(e){let t=i.dirname(e);return i.parse(t).root===t}function d(e,t,n,i){if(i)return f(e,t,n);if(n)return o(t),f(e,t,n);if(r.existsSync(t))throw Error(`dest already exists.`);return f(e,t,n)}function f(e,t,n){try{r.renameSync(e,t)}catch(r){if(r.code!==`EXDEV`)throw r;return p(e,t,n)}}function p(e,t,n){return a(e,t,{overwrite:n,errorOnExist:!0,preserveTimestamps:!0}),o(e)}n.exports=l})),it=e(((exports,t)=>{let n=D().fromPromise;t.exports={move:n(nt()),moveSync:rt()}})),at=n(e(((exports,t)=>{t.exports={...O(),...Be(),...He(),...Je(),...tt(),...k(),...it(),...Qe(),...A(),...Ve()}}))(),1);const ot=(e=0)=>t=>`\u001B[${t+e}m`,st=(e=0)=>t=>`\u001B[${38+e};5;${t}m`,ct=(e=0)=>(t,n,r)=>`\u001B[${38+e};2;${t};${n};${r}m`,j={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(j.modifier);const lt=Object.keys(j.color),ut=Object.keys(j.bgColor);[...lt,...ut];function dt(){let e=new Map;for(let[t,n]of Object.entries(j)){for(let[t,r]of Object.entries(n))j[t]={open:`\u001B[${r[0]}m`,close:`\u001B[${r[1]}m`},n[t]=j[t],e.set(r[0],r[1]);Object.defineProperty(j,t,{value:n,enumerable:!1})}return Object.defineProperty(j,`codes`,{value:e,enumerable:!1}),j.color.close=`\x1B[39m`,j.bgColor.close=`\x1B[49m`,j.color.ansi=ot(),j.color.ansi256=st(),j.color.ansi16m=ct(),j.bgColor.ansi=ot(10),j.bgColor.ansi256=st(10),j.bgColor.ansi16m=ct(10),Object.defineProperties(j,{rgbToAnsi256:{value(e,t,n){return e===t&&t===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(n/255*5)},enumerable:!1},hexToRgb:{value(e){let t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[n]=t;n.length===3&&(n=[...n].map(e=>e+e).join(``));let r=Number.parseInt(n,16);return[r>>16&255,r>>8&255,r&255]},enumerable:!1},hexToAnsi256:{value:e=>j.rgbToAnsi256(...j.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let t,n,r;if(e>=232)t=((e-232)*10+8)/255,n=t,r=t;else{e-=16;let i=e%36;t=Math.floor(e/36)/5,n=Math.floor(i/6)/5,r=i%6/5}let i=Math.max(t,n,r)*2;if(i===0)return 30;let a=30+(Math.round(r)<<2|Math.round(n)<<1|Math.round(t));return i===2&&(a+=60),a},enumerable:!1},rgbToAnsi:{value:(e,t,n)=>j.ansi256ToAnsi(j.rgbToAnsi256(e,t,n)),enumerable:!1},hexToAnsi:{value:e=>j.ansi256ToAnsi(j.hexToAnsi256(e)),enumerable:!1}}),j}var M=dt();function N(e,t=globalThis.Deno?globalThis.Deno.args:u.argv){let n=e.startsWith(`-`)?``:e.length===1?`-`:`--`,r=t.indexOf(n+e),i=t.indexOf(`--`);return r!==-1&&(i===-1||r<i)}const{env:P}=u;let ft;N(`no-color`)||N(`no-colors`)||N(`color=false`)||N(`color=never`)?ft=0:(N(`color`)||N(`colors`)||N(`color=true`)||N(`color=always`))&&(ft=1);function pt(){if(`FORCE_COLOR`in P)return P.FORCE_COLOR===`true`?1:P.FORCE_COLOR===`false`?0:P.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(P.FORCE_COLOR,10),3)}function mt(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function ht(e,{streamIsTTY:t,sniffFlags:n=!0}={}){let r=pt();r!==void 0&&(ft=r);let i=n?ft:r;if(i===0)return 0;if(n){if(N(`color=16m`)||N(`color=full`)||N(`color=truecolor`))return 3;if(N(`color=256`))return 2}if(`TF_BUILD`in P&&`AGENT_NAME`in P)return 1;if(e&&!t&&i===void 0)return 0;let a=i||0;if(P.TERM===`dumb`)return a;if(u.platform===`win32`){let e=h.release().split(`.`);return Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if(`CI`in P)return[`GITHUB_ACTIONS`,`GITEA_ACTIONS`,`CIRCLECI`].some(e=>e in P)?3:[`TRAVIS`,`APPVEYOR`,`GITLAB_CI`,`BUILDKITE`,`DRONE`].some(e=>e in P)||P.CI_NAME===`codeship`?1:a;if(`TEAMCITY_VERSION`in P)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(P.TEAMCITY_VERSION)?1:0;if(P.COLORTERM===`truecolor`||P.TERM===`xterm-kitty`||P.TERM===`xterm-ghostty`||P.TERM===`wezterm`)return 3;if(`TERM_PROGRAM`in P){let e=Number.parseInt((P.TERM_PROGRAM_VERSION||``).split(`.`)[0],10);switch(P.TERM_PROGRAM){case`iTerm.app`:return e>=3?3:2;case`Apple_Terminal`:return 2}}return/-256(color)?$/i.test(P.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(P.TERM)||`COLORTERM`in P?1:a}function gt(e,t={}){let n=ht(e,{streamIsTTY:e&&e.isTTY,...t});return mt(n)}var _t={stdout:gt({isTTY:v.isatty(1)}),stderr:gt({isTTY:v.isatty(2)})};function vt(e,t,n){let r=e.indexOf(t);if(r===-1)return e;let i=t.length,a=0,o=``;do o+=e.slice(a,r)+t+n,a=r+i,r=e.indexOf(t,a);while(r!==-1);return o+=e.slice(a),o}function yt(e,t,n,r){let i=0,a=``;do{let o=e[r-1]===`\r`;a+=e.slice(i,o?r-1:r)+t+(o?`\r
8
- `:`
9
- `)+n,i=r+1,r=e.indexOf(`
10
- `,i)}while(r!==-1);return a+=e.slice(i),a}const{stdout:bt,stderr:xt}=_t,St=Symbol(`GENERATOR`),Ct=Symbol(`STYLER`),wt=Symbol(`IS_EMPTY`),Tt=[`ansi`,`ansi`,`ansi256`,`ansi16m`],Et=Object.create(null),Dt=(e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw Error("The `level` option should be an integer from 0 to 3");let n=bt?bt.level:0;e.level=t.level===void 0?n:t.level},Ot=e=>{let t=(...e)=>e.join(` `);return Dt(t,e),Object.setPrototypeOf(t,kt.prototype),t};function kt(e){return Ot(e)}Object.setPrototypeOf(kt.prototype,Function.prototype);for(let[e,t]of Object.entries(M))Et[e]={get(){let n=Nt(this,Mt(t.open,t.close,this[Ct]),this[wt]);return Object.defineProperty(this,e,{value:n}),n}};Et.visible={get(){let e=Nt(this,this[Ct],!0);return Object.defineProperty(this,`visible`,{value:e}),e}};const At=(e,t,n,...r)=>e===`rgb`?t===`ansi16m`?M[n].ansi16m(...r):t===`ansi256`?M[n].ansi256(M.rgbToAnsi256(...r)):M[n].ansi(M.rgbToAnsi(...r)):e===`hex`?At(`rgb`,t,n,...M.hexToRgb(...r)):M[n][e](...r);for(let e of[`rgb`,`hex`,`ansi256`]){Et[e]={get(){let{level:t}=this;return function(...n){let r=Mt(At(e,Tt[t],`color`,...n),M.color.close,this[Ct]);return Nt(this,r,this[wt])}}};let t=`bg`+e[0].toUpperCase()+e.slice(1);Et[t]={get(){let{level:t}=this;return function(...n){let r=Mt(At(e,Tt[t],`bgColor`,...n),M.bgColor.close,this[Ct]);return Nt(this,r,this[wt])}}}}const jt=Object.defineProperties(()=>{},{...Et,level:{enumerable:!0,get(){return this[St].level},set(e){this[St].level=e}}}),Mt=(e,t,n)=>{let r,i;return n===void 0?(r=e,i=t):(r=n.openAll+e,i=t+n.closeAll),{open:e,close:t,openAll:r,closeAll:i,parent:n}},Nt=(e,t,n)=>{let r=(...e)=>Pt(r,e.length===1?``+e[0]:e.join(` `));return Object.setPrototypeOf(r,jt),r[St]=e,r[Ct]=t,r[wt]=n,r},Pt=(e,t)=>{if(e.level<=0||!t)return e[wt]?``:t;let n=e[Ct];if(n===void 0)return t;let{openAll:r,closeAll:i}=n;if(t.includes(`\x1B`))for(;n!==void 0;)t=vt(t,n.close,n.open),n=n.parent;let a=t.indexOf(`
11
- `);return a!==-1&&(t=yt(t,i,r,a)),r+t+i};Object.defineProperties(kt.prototype,Et);const Ft=kt();kt({level:xt?xt.level:0});var It=Ft;const Lt=r(`${process.cwd()}/`);function Rt(e){return e.startsWith(`file:`)?l(e):e}function zt(e,t=process.cwd()){if(e.startsWith(`~`))return Lt.resolve(e.replace(/^~/,``));let n=Rt(e);if(a(n))return n;let r=Rt(t);return c(r,n)}var Bt=class{constructor(){this.action=Promise.resolve()}onDone(e=e=>e){return this.action=this.action.then(e=>(this.temp=e,e)).then(e),this}onFail(e=()=>this.temp){return this.action=this.action.then(e=>(this.temp=e,e)).catch(e),this}then(e){return this.action.then(e)}catch(e){return this.action.catch(e)}finally(e){return this.action.finally(e)}};const Vt=new class{okay(...e){console.log(It.green(`✔`),...e)}fail(...e){console.log(It.red(`✘`),...e)}};function Ht({read:e,write:t}){return class extends Bt{constructor(e){super(),e&&(this.root=e)}config(e){return e!==void 0&&(this.option=e),this}source(t,n=this.root){if(!t)throw Error(`path cannot be empty`);return this.action=this.action.then(()=>{this.source=zt(t,n)}).then(()=>e(this.source)),this}output(e,n=this.root){return this.action=this.action.then(r=>{let i=zt(e===void 0?this.source:e,n);if(!i)throw Error(`path cannot be empty`);return this.source=i,t(i,r,this.option).then(()=>r)}),this}logger(...e){if(e.length===0)throw Error(`message cannot be empty`);return this.action=this.action.then(t=>(Vt.okay(...e),t),t=>{throw Vt.fail(...e),t}),this}}}const{readFile:Ut,readJson:Wt,outputFile:Gt,outputJson:Kt}=at.default,qt={spaces:2,replacer:null};function Jt(e){return Ut(e,{encoding:`utf8`})}function Yt(e,t){return Gt(e,t,{encoding:`utf8`})}function Xt(e,t,{pretty:n=!1}={}){return Kt(e,t,n?qt:void 0)}const F=Ht({read:Jt,write:Yt}),Zt=Ht({read:Wt,write:Xt});Ht({read:Jt,write:Xt}),Ht({read:Wt,write:Yt});const{cyan:I,red:Qt,green:$t}=It;var en=`# Created by nice-move
12
- root = true
13
-
14
- [*]
15
- charset = utf-8
16
- end_of_line = lf
17
- indent_size = 2
18
- indent_style = space
19
- insert_final_newline = true
20
- max_line_length = 80
21
- quote_type = single
22
- tab_width = 2
23
- trim_trailing_whitespace = true
24
- `;function tn(){return new F().onDone(()=>en).output(`.editorconfig`).logger(`Create/Overwrite`,I(`.editorconfig`)).catch(console.warn)}const nn=(e,t,n,r)=>{if(n===`length`||n===`prototype`||n===`arguments`||n===`caller`)return;let i=Object.getOwnPropertyDescriptor(e,n),a=Object.getOwnPropertyDescriptor(t,n);!rn(i,a)&&r||Object.defineProperty(e,n,a)},rn=function(e,t){return e===void 0||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},an=(e,t)=>{let n=Object.getPrototypeOf(t);n!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,n)},on=(e,t)=>`/* Wrapped ${e}*/\n${t}`,sn=Object.getOwnPropertyDescriptor(Function.prototype,`toString`),cn=Object.getOwnPropertyDescriptor(Function.prototype.toString,`name`),ln=(e,t,n)=>{let r=n===``?``:`with ${n.trim()}() `,i=on.bind(null,r,t.toString());Object.defineProperty(i,`name`,cn);let{writable:a,enumerable:o,configurable:s}=sn;Object.defineProperty(e,`toString`,{value:i,writable:a,enumerable:o,configurable:s})};function un(e,t,{ignoreNonConfigurable:n=!1}={}){let{name:r}=e;for(let r of Reflect.ownKeys(t))nn(e,t,r,n);return an(e,t),ln(e,t,r),e}const dn=new WeakMap,fn=(e,t={})=>{if(typeof e!=`function`)throw TypeError(`Expected a function`);let n,r=0,i=e.displayName||e.name||`<anonymous>`,a=function(...o){if(dn.set(a,++r),r===1)n=e.apply(this,o),e=void 0;else if(t.throw===!0)throw Error(`Function \`${i}\` can only be called once`);return n};return un(a,e),dn.set(a,r),a};fn.callCount=e=>{if(!dn.has(e))throw Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return dn.get(e)};var pn=fn;const mn=[];mn.push(`SIGHUP`,`SIGINT`,`SIGTERM`),process.platform!==`win32`&&mn.push(`SIGALRM`,`SIGABRT`,`SIGVTALRM`,`SIGXCPU`,`SIGXFSZ`,`SIGUSR2`,`SIGTRAP`,`SIGSYS`,`SIGQUIT`,`SIGIOT`),process.platform===`linux`&&mn.push(`SIGIO`,`SIGPOLL`,`SIGPWR`,`SIGSTKFLT`);const hn=e=>!!e&&typeof e==`object`&&typeof e.removeListener==`function`&&typeof e.emit==`function`&&typeof e.reallyExit==`function`&&typeof e.listeners==`function`&&typeof e.kill==`function`&&typeof e.pid==`number`&&typeof e.on==`function`,gn=Symbol.for(`signal-exit emitter`),_n=globalThis,vn=Object.defineProperty.bind(Object);var yn=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(_n[gn])return _n[gn];vn(_n,gn,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,t){this.listeners[e].push(t)}removeListener(e,t){let n=this.listeners[e],r=n.indexOf(t);r!==-1&&(r===0&&n.length===1?n.length=0:n.splice(r,1))}emit(e,t,n){if(this.emitted[e])return!1;this.emitted[e]=!0;let r=!1;for(let i of this.listeners[e])r=i(t,n)===!0||r;return e===`exit`&&(r=this.emit(`afterExit`,t,n)||r),r}},bn=class{};const xn=e=>({onExit(t,n){return e.onExit(t,n)},load(){return e.load()},unload(){return e.unload()}});var Sn=class extends bn{onExit(){return()=>{}}load(){}unload(){}},Cn=class extends bn{#hupSig=wn.platform===`win32`?`SIGINT`:`SIGHUP`;#emitter=new yn;#process;#originalProcessEmit;#originalProcessReallyExit;#sigListeners={};#loaded=!1;constructor(e){super(),this.#process=e,this.#sigListeners={};for(let t of mn)this.#sigListeners[t]=()=>{let n=this.#process.listeners(t),{count:r}=this.#emitter,i=e;if(typeof i.__signal_exit_emitter__==`object`&&typeof i.__signal_exit_emitter__.count==`number`&&(r+=i.__signal_exit_emitter__.count),n.length===r){this.unload();let n=this.#emitter.emit(`exit`,null,t),r=t===`SIGHUP`?this.#hupSig:t;n||e.kill(e.pid,r)}};this.#originalProcessReallyExit=e.reallyExit,this.#originalProcessEmit=e.emit}onExit(e,t){if(!hn(this.#process))return()=>{};this.#loaded===!1&&this.load();let n=t?.alwaysLast?`afterExit`:`exit`;return this.#emitter.on(n,e),()=>{this.#emitter.removeListener(n,e),this.#emitter.listeners.exit.length===0&&this.#emitter.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#loaded){this.#loaded=!0,this.#emitter.count+=1;for(let e of mn)try{let t=this.#sigListeners[e];t&&this.#process.on(e,t)}catch(e){}this.#process.emit=(e,...t)=>this.#processEmit(e,...t),this.#process.reallyExit=e=>this.#processReallyExit(e)}}unload(){this.#loaded&&(this.#loaded=!1,mn.forEach(e=>{let t=this.#sigListeners[e];if(!t)throw Error(`Listener not defined for signal: `+e);try{this.#process.removeListener(e,t)}catch(e){}}),this.#process.emit=this.#originalProcessEmit,this.#process.reallyExit=this.#originalProcessReallyExit,--this.#emitter.count)}#processReallyExit(e){return hn(this.#process)?(this.#process.exitCode=e||0,this.#emitter.emit(`exit`,this.#process.exitCode,null),this.#originalProcessReallyExit.call(this.#process,this.#process.exitCode)):0}#processEmit(e,...t){let n=this.#originalProcessEmit;if(e===`exit`&&hn(this.#process)){typeof t[0]==`number`&&(this.#process.exitCode=t[0]);let r=n.call(this.#process,e,...t);return this.#emitter.emit(`exit`,this.#process.exitCode,null),r}else return n.call(this.#process,e,...t)}};const wn=globalThis.process,{onExit:Tn,load:En,unload:Dn}=xn(hn(wn)?new Cn(wn):new Sn),On=u.stderr.isTTY?u.stderr:u.stdout.isTTY?u.stdout:void 0;var kn=On?pn(()=>{Tn(()=>{On.write(`\x1B[?25h`)},{alwaysLast:!0})}):()=>{};let An=!1;const jn={};jn.show=(e=u.stderr)=>{e.isTTY&&(An=!1,e.write(`\x1B[?25h`))},jn.hide=(e=u.stderr)=>{e.isTTY&&(kn(),An=!0,e.write(`\x1B[?25l`))},jn.toggle=(e,t)=>{e!==void 0&&(An=e),An?jn.show(t):jn.hide(t)};var Mn=jn,Nn={dots:{interval:80,frames:[`⠋`,`⠙`,`⠹`,`⠸`,`⠼`,`⠴`,`⠦`,`⠧`,`⠇`,`⠏`]},dots2:{interval:80,frames:[`⣾`,`⣽`,`⣻`,`⢿`,`⡿`,`⣟`,`⣯`,`⣷`]},dots3:{interval:80,frames:[`⠋`,`⠙`,`⠚`,`⠞`,`⠖`,`⠦`,`⠴`,`⠲`,`⠳`,`⠓`]},dots4:{interval:80,frames:[`⠄`,`⠆`,`⠇`,`⠋`,`⠙`,`⠸`,`⠰`,`⠠`,`⠰`,`⠸`,`⠙`,`⠋`,`⠇`,`⠆`]},dots5:{interval:80,frames:[`⠋`,`⠙`,`⠚`,`⠒`,`⠂`,`⠂`,`⠒`,`⠲`,`⠴`,`⠦`,`⠖`,`⠒`,`⠐`,`⠐`,`⠒`,`⠓`,`⠋`]},dots6:{interval:80,frames:[`⠁`,`⠉`,`⠙`,`⠚`,`⠒`,`⠂`,`⠂`,`⠒`,`⠲`,`⠴`,`⠤`,`⠄`,`⠄`,`⠤`,`⠴`,`⠲`,`⠒`,`⠂`,`⠂`,`⠒`,`⠚`,`⠙`,`⠉`,`⠁`]},dots7:{interval:80,frames:[`⠈`,`⠉`,`⠋`,`⠓`,`⠒`,`⠐`,`⠐`,`⠒`,`⠖`,`⠦`,`⠤`,`⠠`,`⠠`,`⠤`,`⠦`,`⠖`,`⠒`,`⠐`,`⠐`,`⠒`,`⠓`,`⠋`,`⠉`,`⠈`]},dots8:{interval:80,frames:`⠁.⠁.⠉.⠙.⠚.⠒.⠂.⠂.⠒.⠲.⠴.⠤.⠄.⠄.⠤.⠠.⠠.⠤.⠦.⠖.⠒.⠐.⠐.⠒.⠓.⠋.⠉.⠈.⠈`.split(`.`)},dots9:{interval:80,frames:[`⢹`,`⢺`,`⢼`,`⣸`,`⣇`,`⡧`,`⡗`,`⡏`]},dots10:{interval:80,frames:[`⢄`,`⢂`,`⢁`,`⡁`,`⡈`,`⡐`,`⡠`]},dots11:{interval:100,frames:[`⠁`,`⠂`,`⠄`,`⡀`,`⢀`,`⠠`,`⠐`,`⠈`]},dots12:{interval:80,frames:`⢀⠀.⡀⠀.⠄⠀.⢂⠀.⡂⠀.⠅⠀.⢃⠀.⡃⠀.⠍⠀.⢋⠀.⡋⠀.⠍⠁.⢋⠁.⡋⠁.⠍⠉.⠋⠉.⠋⠉.⠉⠙.⠉⠙.⠉⠩.⠈⢙.⠈⡙.⢈⠩.⡀⢙.⠄⡙.⢂⠩.⡂⢘.⠅⡘.⢃⠨.⡃⢐.⠍⡐.⢋⠠.⡋⢀.⠍⡁.⢋⠁.⡋⠁.⠍⠉.⠋⠉.⠋⠉.⠉⠙.⠉⠙.⠉⠩.⠈⢙.⠈⡙.⠈⠩.⠀⢙.⠀⡙.⠀⠩.⠀⢘.⠀⡘.⠀⠨.⠀⢐.⠀⡐.⠀⠠.⠀⢀.⠀⡀`.split(`.`)},dots13:{interval:80,frames:[`⣼`,`⣹`,`⢻`,`⠿`,`⡟`,`⣏`,`⣧`,`⣶`]},dots14:{interval:80,frames:[`⠉⠉`,`⠈⠙`,`⠀⠹`,`⠀⢸`,`⠀⣰`,`⢀⣠`,`⣀⣀`,`⣄⡀`,`⣆⠀`,`⡇⠀`,`⠏⠀`,`⠋⠁`]},dots8Bit:{interval:80,frames:`⠀.⠁.⠂.⠃.⠄.⠅.⠆.⠇.⡀.⡁.⡂.⡃.⡄.⡅.⡆.⡇.⠈.⠉.⠊.⠋.⠌.⠍.⠎.⠏.⡈.⡉.⡊.⡋.⡌.⡍.⡎.⡏.⠐.⠑.⠒.⠓.⠔.⠕.⠖.⠗.⡐.⡑.⡒.⡓.⡔.⡕.⡖.⡗.⠘.⠙.⠚.⠛.⠜.⠝.⠞.⠟.⡘.⡙.⡚.⡛.⡜.⡝.⡞.⡟.⠠.⠡.⠢.⠣.⠤.⠥.⠦.⠧.⡠.⡡.⡢.⡣.⡤.⡥.⡦.⡧.⠨.⠩.⠪.⠫.⠬.⠭.⠮.⠯.⡨.⡩.⡪.⡫.⡬.⡭.⡮.⡯.⠰.⠱.⠲.⠳.⠴.⠵.⠶.⠷.⡰.⡱.⡲.⡳.⡴.⡵.⡶.⡷.⠸.⠹.⠺.⠻.⠼.⠽.⠾.⠿.⡸.⡹.⡺.⡻.⡼.⡽.⡾.⡿.⢀.⢁.⢂.⢃.⢄.⢅.⢆.⢇.⣀.⣁.⣂.⣃.⣄.⣅.⣆.⣇.⢈.⢉.⢊.⢋.⢌.⢍.⢎.⢏.⣈.⣉.⣊.⣋.⣌.⣍.⣎.⣏.⢐.⢑.⢒.⢓.⢔.⢕.⢖.⢗.⣐.⣑.⣒.⣓.⣔.⣕.⣖.⣗.⢘.⢙.⢚.⢛.⢜.⢝.⢞.⢟.⣘.⣙.⣚.⣛.⣜.⣝.⣞.⣟.⢠.⢡.⢢.⢣.⢤.⢥.⢦.⢧.⣠.⣡.⣢.⣣.⣤.⣥.⣦.⣧.⢨.⢩.⢪.⢫.⢬.⢭.⢮.⢯.⣨.⣩.⣪.⣫.⣬.⣭.⣮.⣯.⢰.⢱.⢲.⢳.⢴.⢵.⢶.⢷.⣰.⣱.⣲.⣳.⣴.⣵.⣶.⣷.⢸.⢹.⢺.⢻.⢼.⢽.⢾.⢿.⣸.⣹.⣺.⣻.⣼.⣽.⣾.⣿`.split(`.`)},dotsCircle:{interval:80,frames:[`⢎ `,`⠎⠁`,`⠊⠑`,`⠈⠱`,` ⡱`,`⢀⡰`,`⢄⡠`,`⢆⡀`]},sand:{interval:80,frames:`⠁.⠂.⠄.⡀.⡈.⡐.⡠.⣀.⣁.⣂.⣄.⣌.⣔.⣤.⣥.⣦.⣮.⣶.⣷.⣿.⡿.⠿.⢟.⠟.⡛.⠛.⠫.⢋.⠋.⠍.⡉.⠉.⠑.⠡.⢁`.split(`.`)},line:{interval:130,frames:[`-`,`\\`,`|`,`/`]},line2:{interval:100,frames:[`⠂`,`-`,`–`,`—`,`–`,`-`]},pipe:{interval:100,frames:[`┤`,`┘`,`┴`,`└`,`├`,`┌`,`┬`,`┐`]},simpleDots:{interval:400,frames:[`. `,`.. `,`...`,` `]},simpleDotsScrolling:{interval:200,frames:[`. `,`.. `,`...`,` ..`,` .`,` `]},star:{interval:70,frames:[`✶`,`✸`,`✹`,`✺`,`✹`,`✷`]},star2:{interval:80,frames:[`+`,`x`,`*`]},flip:{interval:70,frames:[`_`,`_`,`_`,`-`,"`","`",`'`,`´`,`-`,`_`,`_`,`_`]},hamburger:{interval:100,frames:[`☱`,`☲`,`☴`]},growVertical:{interval:120,frames:[`▁`,`▃`,`▄`,`▅`,`▆`,`▇`,`▆`,`▅`,`▄`,`▃`]},growHorizontal:{interval:120,frames:[`▏`,`▎`,`▍`,`▌`,`▋`,`▊`,`▉`,`▊`,`▋`,`▌`,`▍`,`▎`]},balloon:{interval:140,frames:[` `,`.`,`o`,`O`,`@`,`*`,` `]},balloon2:{interval:120,frames:[`.`,`o`,`O`,`°`,`O`,`o`,`.`]},noise:{interval:100,frames:[`▓`,`▒`,`░`]},bounce:{interval:120,frames:[`⠁`,`⠂`,`⠄`,`⠂`]},boxBounce:{interval:120,frames:[`▖`,`▘`,`▝`,`▗`]},boxBounce2:{interval:100,frames:[`▌`,`▀`,`▐`,`▄`]},triangle:{interval:50,frames:[`◢`,`◣`,`◤`,`◥`]},binary:{interval:80,frames:[`010010`,`001100`,`100101`,`111010`,`111101`,`010111`,`101011`,`111000`,`110011`,`110101`]},arc:{interval:100,frames:[`◜`,`◠`,`◝`,`◞`,`◡`,`◟`]},circle:{interval:120,frames:[`◡`,`⊙`,`◠`]},squareCorners:{interval:180,frames:[`◰`,`◳`,`◲`,`◱`]},circleQuarters:{interval:120,frames:[`◴`,`◷`,`◶`,`◵`]},circleHalves:{interval:50,frames:[`◐`,`◓`,`◑`,`◒`]},squish:{interval:100,frames:[`╫`,`╪`]},toggle:{interval:250,frames:[`⊶`,`⊷`]},toggle2:{interval:80,frames:[`▫`,`▪`]},toggle3:{interval:120,frames:[`□`,`■`]},toggle4:{interval:100,frames:[`■`,`□`,`▪`,`▫`]},toggle5:{interval:100,frames:[`▮`,`▯`]},toggle6:{interval:300,frames:[`ဝ`,`၀`]},toggle7:{interval:80,frames:[`⦾`,`⦿`]},toggle8:{interval:100,frames:[`◍`,`◌`]},toggle9:{interval:100,frames:[`◉`,`◎`]},toggle10:{interval:100,frames:[`㊂`,`㊀`,`㊁`]},toggle11:{interval:50,frames:[`⧇`,`⧆`]},toggle12:{interval:120,frames:[`☗`,`☖`]},toggle13:{interval:80,frames:[`=`,`*`,`-`]},arrow:{interval:100,frames:[`←`,`↖`,`↑`,`↗`,`→`,`↘`,`↓`,`↙`]},arrow2:{interval:80,frames:[`⬆️ `,`↗️ `,`➡️ `,`↘️ `,`⬇️ `,`↙️ `,`⬅️ `,`↖️ `]},arrow3:{interval:120,frames:[`▹▹▹▹▹`,`▸▹▹▹▹`,`▹▸▹▹▹`,`▹▹▸▹▹`,`▹▹▹▸▹`,`▹▹▹▹▸`]},bouncingBar:{interval:80,frames:[`[ ]`,`[= ]`,`[== ]`,`[=== ]`,`[====]`,`[ ===]`,`[ ==]`,`[ =]`,`[ ]`,`[ =]`,`[ ==]`,`[ ===]`,`[====]`,`[=== ]`,`[== ]`,`[= ]`]},bouncingBall:{interval:80,frames:[`( ● )`,`( ● )`,`( ● )`,`( ● )`,`( ●)`,`( ● )`,`( ● )`,`( ● )`,`( ● )`,`(● )`]},smiley:{interval:200,frames:[`😄 `,`😝 `]},monkey:{interval:300,frames:[`🙈 `,`🙈 `,`🙉 `,`🙊 `]},hearts:{interval:100,frames:[`💛 `,`💙 `,`💜 `,`💚 `,`❤️ `]},clock:{interval:100,frames:[`🕛 `,`🕐 `,`🕑 `,`🕒 `,`🕓 `,`🕔 `,`🕕 `,`🕖 `,`🕗 `,`🕘 `,`🕙 `,`🕚 `]},earth:{interval:180,frames:[`🌍 `,`🌎 `,`🌏 `]},material:{interval:17,frames:`█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁.██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁.███▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁.████▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁.██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁.██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁.███████▁▁▁▁▁▁▁▁▁▁▁▁▁.████████▁▁▁▁▁▁▁▁▁▁▁▁.█████████▁▁▁▁▁▁▁▁▁▁▁.█████████▁▁▁▁▁▁▁▁▁▁▁.██████████▁▁▁▁▁▁▁▁▁▁.███████████▁▁▁▁▁▁▁▁▁.█████████████▁▁▁▁▁▁▁.██████████████▁▁▁▁▁▁.██████████████▁▁▁▁▁▁.▁██████████████▁▁▁▁▁.▁██████████████▁▁▁▁▁.▁██████████████▁▁▁▁▁.▁▁██████████████▁▁▁▁.▁▁▁██████████████▁▁▁.▁▁▁▁█████████████▁▁▁.▁▁▁▁██████████████▁▁.▁▁▁▁██████████████▁▁.▁▁▁▁▁██████████████▁.▁▁▁▁▁██████████████▁.▁▁▁▁▁██████████████▁.▁▁▁▁▁▁██████████████.▁▁▁▁▁▁██████████████.▁▁▁▁▁▁▁█████████████.▁▁▁▁▁▁▁█████████████.▁▁▁▁▁▁▁▁████████████.▁▁▁▁▁▁▁▁████████████.▁▁▁▁▁▁▁▁▁███████████.▁▁▁▁▁▁▁▁▁███████████.▁▁▁▁▁▁▁▁▁▁██████████.▁▁▁▁▁▁▁▁▁▁██████████.▁▁▁▁▁▁▁▁▁▁▁▁████████.▁▁▁▁▁▁▁▁▁▁▁▁▁███████.▁▁▁▁▁▁▁▁▁▁▁▁▁▁██████.▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████.▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████.█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████.██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███.██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███.███▁▁▁▁▁▁▁▁▁▁▁▁▁▁███.████▁▁▁▁▁▁▁▁▁▁▁▁▁▁██.█████▁▁▁▁▁▁▁▁▁▁▁▁▁▁█.█████▁▁▁▁▁▁▁▁▁▁▁▁▁▁█.██████▁▁▁▁▁▁▁▁▁▁▁▁▁█.████████▁▁▁▁▁▁▁▁▁▁▁▁.█████████▁▁▁▁▁▁▁▁▁▁▁.█████████▁▁▁▁▁▁▁▁▁▁▁.█████████▁▁▁▁▁▁▁▁▁▁▁.█████████▁▁▁▁▁▁▁▁▁▁▁.███████████▁▁▁▁▁▁▁▁▁.████████████▁▁▁▁▁▁▁▁.████████████▁▁▁▁▁▁▁▁.██████████████▁▁▁▁▁▁.██████████████▁▁▁▁▁▁.▁██████████████▁▁▁▁▁.▁██████████████▁▁▁▁▁.▁▁▁█████████████▁▁▁▁.▁▁▁▁▁████████████▁▁▁.▁▁▁▁▁████████████▁▁▁.▁▁▁▁▁▁███████████▁▁▁.▁▁▁▁▁▁▁▁█████████▁▁▁.▁▁▁▁▁▁▁▁█████████▁▁▁.▁▁▁▁▁▁▁▁▁█████████▁▁.▁▁▁▁▁▁▁▁▁█████████▁▁.▁▁▁▁▁▁▁▁▁▁█████████▁.▁▁▁▁▁▁▁▁▁▁▁████████▁.▁▁▁▁▁▁▁▁▁▁▁████████▁.▁▁▁▁▁▁▁▁▁▁▁▁███████▁.▁▁▁▁▁▁▁▁▁▁▁▁███████▁.▁▁▁▁▁▁▁▁▁▁▁▁▁███████.▁▁▁▁▁▁▁▁▁▁▁▁▁███████.▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████.▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████.▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████.▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████.▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███.▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███.▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██.▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██.▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██.▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█.▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█.▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█.▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁.▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁.▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁.▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁`.split(`.`)},moon:{interval:80,frames:[`🌑 `,`🌒 `,`🌓 `,`🌔 `,`🌕 `,`🌖 `,`🌗 `,`🌘 `]},runner:{interval:140,frames:[`🚶 `,`🏃 `]},pong:{interval:80,frames:`▐⠂ ▌.▐⠈ ▌.▐ ⠂ ▌.▐ ⠠ ▌.▐ ⡀ ▌.▐ ⠠ ▌.▐ ⠂ ▌.▐ ⠈ ▌.▐ ⠂ ▌.▐ ⠠ ▌.▐ ⡀ ▌.▐ ⠠ ▌.▐ ⠂ ▌.▐ ⠈ ▌.▐ ⠂▌.▐ ⠠▌.▐ ⡀▌.▐ ⠠ ▌.▐ ⠂ ▌.▐ ⠈ ▌.▐ ⠂ ▌.▐ ⠠ ▌.▐ ⡀ ▌.▐ ⠠ ▌.▐ ⠂ ▌.▐ ⠈ ▌.▐ ⠂ ▌.▐ ⠠ ▌.▐ ⡀ ▌.▐⠠ ▌`.split(`.`)},shark:{interval:120,frames:`▐|\\____________▌.▐_|\\___________▌.▐__|\\__________▌.▐___|\\_________▌.▐____|\\________▌.▐_____|\\_______▌.▐______|\\______▌.▐_______|\\_____▌.▐________|\\____▌.▐_________|\\___▌.▐__________|\\__▌.▐___________|\\_▌.▐____________|\\▌.▐____________/|▌.▐___________/|_▌.▐__________/|__▌.▐_________/|___▌.▐________/|____▌.▐_______/|_____▌.▐______/|______▌.▐_____/|_______▌.▐____/|________▌.▐___/|_________▌.▐__/|__________▌.▐_/|___________▌.▐/|____________▌`.split(`.`)},dqpb:{interval:100,frames:[`d`,`q`,`p`,`b`]},weather:{interval:100,frames:[`☀️ `,`☀️ `,`☀️ `,`🌤 `,`⛅️ `,`🌥 `,`☁️ `,`🌧 `,`🌨 `,`🌧 `,`🌨 `,`🌧 `,`🌨 `,`⛈ `,`🌨 `,`🌧 `,`🌨 `,`☁️ `,`🌥 `,`⛅️ `,`🌤 `,`☀️ `,`☀️ `]},christmas:{interval:400,frames:[`🌲`,`🎄`]},grenade:{interval:80,frames:[`، `,`′ `,` ´ `,` ‾ `,` ⸌`,` ⸊`,` |`,` ⁎`,` ⁕`,` ෴ `,` ⁓`,` `,` `,` `]},point:{interval:125,frames:[`∙∙∙`,`●∙∙`,`∙●∙`,`∙∙●`,`∙∙∙`]},layer:{interval:150,frames:[`-`,`=`,`≡`]},betaWave:{interval:80,frames:[`ρββββββ`,`βρβββββ`,`ββρββββ`,`βββρβββ`,`ββββρββ`,`βββββρβ`,`ββββββρ`]},fingerDance:{interval:160,frames:[`🤘 `,`🤟 `,`🖖 `,`✋ `,`🤚 `,`👆 `]},fistBump:{interval:80,frames:[`🤜    🤛 `,`🤜    🤛 `,`🤜    🤛 `,` 🤜  🤛  `,`  🤜🤛   `,` 🤜✨🤛   `,`🤜 ✨ 🤛  `]},soccerHeader:{interval:80,frames:[` 🧑⚽️ 🧑 `,`🧑 ⚽️ 🧑 `,`🧑 ⚽️ 🧑 `,`🧑 ⚽️ 🧑 `,`🧑 ⚽️ 🧑 `,`🧑 ⚽️ 🧑 `,`🧑 ⚽️🧑 `,`🧑 ⚽️ 🧑 `,`🧑 ⚽️ 🧑 `,`🧑 ⚽️ 🧑 `,`🧑 ⚽️ 🧑 `,`🧑 ⚽️ 🧑 `]},mindblown:{interval:160,frames:[`😐 `,`😐 `,`😮 `,`😮 `,`😦 `,`😦 `,`😧 `,`😧 `,`🤯 `,`💥 `,`✨ `,`  `,`  `,`  `]},speaker:{interval:160,frames:[`🔈 `,`🔉 `,`🔊 `,`🔉 `]},orangePulse:{interval:100,frames:[`🔸 `,`🔶 `,`🟠 `,`🟠 `,`🔶 `]},bluePulse:{interval:100,frames:[`🔹 `,`🔷 `,`🔵 `,`🔵 `,`🔷 `]},orangeBluePulse:{interval:100,frames:[`🔸 `,`🔶 `,`🟠 `,`🟠 `,`🔶 `,`🔹 `,`🔷 `,`🔵 `,`🔵 `,`🔷 `]},timeTravel:{interval:100,frames:[`🕛 `,`🕚 `,`🕙 `,`🕘 `,`🕗 `,`🕖 `,`🕕 `,`🕔 `,`🕓 `,`🕒 `,`🕑 `,`🕐 `]},aesthetic:{interval:80,frames:[`▰▱▱▱▱▱▱`,`▰▰▱▱▱▱▱`,`▰▰▰▱▱▱▱`,`▰▰▰▰▱▱▱`,`▰▰▰▰▰▱▱`,`▰▰▰▰▰▰▱`,`▰▰▰▰▰▰▰`,`▰▱▱▱▱▱▱`]},dwarfFortress:{interval:80,frames:` ██████£££ .☺██████£££ .☺██████£££ .☺▓█████£££ .☺▓█████£££ .☺▒█████£££ .☺▒█████£££ .☺░█████£££ .☺░█████£££ .☺ █████£££ . ☺█████£££ . ☺█████£££ . ☺▓████£££ . ☺▓████£££ . ☺▒████£££ . ☺▒████£££ . ☺░████£££ . ☺░████£££ . ☺ ████£££ . ☺████£££ . ☺████£££ . ☺▓███£££ . ☺▓███£££ . ☺▒███£££ . ☺▒███£££ . ☺░███£££ . ☺░███£££ . ☺ ███£££ . ☺███£££ . ☺███£££ . ☺▓██£££ . ☺▓██£££ . ☺▒██£££ . ☺▒██£££ . ☺░██£££ . ☺░██£££ . ☺ ██£££ . ☺██£££ . ☺██£££ . ☺▓█£££ . ☺▓█£££ . ☺▒█£££ . ☺▒█£££ . ☺░█£££ . ☺░█£££ . ☺ █£££ . ☺█£££ . ☺█£££ . ☺▓£££ . ☺▓£££ . ☺▒£££ . ☺▒£££ . ☺░£££ . ☺░£££ . ☺ £££ . ☺£££ . ☺£££ . ☺▓££ . ☺▓££ . ☺▒££ . ☺▒££ . ☺░££ . ☺░££ . ☺ ££ . ☺££ . ☺££ . ☺▓£ . ☺▓£ . ☺▒£ . ☺▒£ . ☺░£ . ☺░£ . ☺ £ . ☺£ . ☺£ . ☺▓ . ☺▓ . ☺▒ . ☺▒ . ☺░ . ☺░ . ☺ . ☺ &. ☺ ☼&. ☺ ☼ &. ☺☼ &. ☺☼ & . ‼ & . ☺ & . ‼ & . ☺ & . ‼ & . ☺ & .‼ & . & . & . & ░ . & ▒ . & ▓ . & £ . & ░£ . & ▒£ . & ▓£ . & ££ . & ░££ . & ▒££ .& ▓££ .& £££ . ░£££ . ▒£££ . ▓£££ . █£££ . ░█£££ . ▒█£££ . ▓█£££ . ██£££ . ░██£££ . ▒██£££ . ▓██£££ . ███£££ . ░███£££ . ▒███£££ . ▓███£££ . ████£££ . ░████£££ . ▒████£££ . ▓████£££ . █████£££ . ░█████£££ . ▒█████£££ . ▓█████£££ . ██████£££ . ██████£££ `.split(`.`)}},Pn=Nn;const Fn=v?.WriteStream?.prototype?.hasColors?.()??!1,L=(e,t)=>{if(!Fn)return e=>e;let n=`\u001B[${e}m`,r=`\u001B[${t}m`;return e=>{let i=e+``,a=i.indexOf(r);if(a===-1)return n+i+r;let o=n,s=0,c=(t===22?r:``)+n;for(;a!==-1;)o+=i.slice(s,a)+c,s=a+r.length,a=i.indexOf(r,s);return o+=i.slice(s)+r,o}};L(0,0);const In=L(1,22);L(2,22),L(3,23),L(4,24),L(53,55),L(7,27),L(8,28),L(9,29),L(30,39);const Ln=L(31,39),Rn=L(32,39),zn=L(33,39),Bn=L(34,39);L(35,39),L(36,39),L(37,39);const Vn=L(90,39);L(40,49),L(41,49),L(42,49),L(43,49),L(44,49),L(45,49),L(46,49),L(47,49),L(100,49);const Hn=L(91,39);L(92,39);const Un=L(93,39);L(94,39),L(95,39),L(96,39),L(97,39),L(101,49),L(102,49),L(103,49),L(104,49),L(105,49),L(106,49),L(107,49);function Wn(){let{env:e}=u,{TERM:t,TERM_PROGRAM:n}=e;return u.platform===`win32`?!!e.WT_SESSION||!!e.TERMINUS_SUBLIME||e.ConEmuTask===`{cmd::Cmder}`||n===`Terminus-Sublime`||n===`vscode`||t===`xterm-256color`||t===`alacritty`||t===`rxvt-unicode`||t===`rxvt-unicode-256color`||e.TERMINAL_EMULATOR===`JetBrains-JediTerm`:t!==`linux`}const Gn=Wn(),Kn=Bn(Gn?`ℹ`:`i`),qn=Rn(Gn?`✔`:`√`),Jn=zn(Gn?`⚠`:`‼`),Yn=Ln(Gn?`✖`:`×`);function Xn({onlyFirst:e=!1}={}){return RegExp(`(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]`,e?void 0:`g`)}const Zn=Xn();function Qn(e){if(typeof e!=`string`)throw TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(Zn,``)}function $n(e){return e===161||e===164||e===167||e===168||e===170||e===173||e===174||e>=176&&e<=180||e>=182&&e<=186||e>=188&&e<=191||e===198||e===208||e===215||e===216||e>=222&&e<=225||e===230||e>=232&&e<=234||e===236||e===237||e===240||e===242||e===243||e>=247&&e<=250||e===252||e===254||e===257||e===273||e===275||e===283||e===294||e===295||e===299||e>=305&&e<=307||e===312||e>=319&&e<=322||e===324||e>=328&&e<=331||e===333||e===338||e===339||e===358||e===359||e===363||e===462||e===464||e===466||e===468||e===470||e===472||e===474||e===476||e===593||e===609||e===708||e===711||e>=713&&e<=715||e===717||e===720||e>=728&&e<=731||e===733||e===735||e>=768&&e<=879||e>=913&&e<=929||e>=931&&e<=937||e>=945&&e<=961||e>=963&&e<=969||e===1025||e>=1040&&e<=1103||e===1105||e===8208||e>=8211&&e<=8214||e===8216||e===8217||e===8220||e===8221||e>=8224&&e<=8226||e>=8228&&e<=8231||e===8240||e===8242||e===8243||e===8245||e===8251||e===8254||e===8308||e===8319||e>=8321&&e<=8324||e===8364||e===8451||e===8453||e===8457||e===8467||e===8470||e===8481||e===8482||e===8486||e===8491||e===8531||e===8532||e>=8539&&e<=8542||e>=8544&&e<=8555||e>=8560&&e<=8569||e===8585||e>=8592&&e<=8601||e===8632||e===8633||e===8658||e===8660||e===8679||e===8704||e===8706||e===8707||e===8711||e===8712||e===8715||e===8719||e===8721||e===8725||e===8730||e>=8733&&e<=8736||e===8739||e===8741||e>=8743&&e<=8748||e===8750||e>=8756&&e<=8759||e===8764||e===8765||e===8776||e===8780||e===8786||e===8800||e===8801||e>=8804&&e<=8807||e===8810||e===8811||e===8814||e===8815||e===8834||e===8835||e===8838||e===8839||e===8853||e===8857||e===8869||e===8895||e===8978||e>=9312&&e<=9449||e>=9451&&e<=9547||e>=9552&&e<=9587||e>=9600&&e<=9615||e>=9618&&e<=9621||e===9632||e===9633||e>=9635&&e<=9641||e===9650||e===9651||e===9654||e===9655||e===9660||e===9661||e===9664||e===9665||e>=9670&&e<=9672||e===9675||e>=9678&&e<=9681||e>=9698&&e<=9701||e===9711||e===9733||e===9734||e===9737||e===9742||e===9743||e===9756||e===9758||e===9792||e===9794||e===9824||e===9825||e>=9827&&e<=9829||e>=9831&&e<=9834||e===9836||e===9837||e===9839||e===9886||e===9887||e===9919||e>=9926&&e<=9933||e>=9935&&e<=9939||e>=9941&&e<=9953||e===9955||e===9960||e===9961||e>=9963&&e<=9969||e===9972||e>=9974&&e<=9977||e===9979||e===9980||e===9982||e===9983||e===10045||e>=10102&&e<=10111||e>=11094&&e<=11097||e>=12872&&e<=12879||e>=57344&&e<=63743||e>=65024&&e<=65039||e===65533||e>=127232&&e<=127242||e>=127248&&e<=127277||e>=127280&&e<=127337||e>=127344&&e<=127373||e===127375||e===127376||e>=127387&&e<=127404||e>=917760&&e<=917999||e>=983040&&e<=1048573||e>=1048576&&e<=1114109}function er(e){return e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510}function tr(e){return e>=4352&&e<=4447||e===8986||e===8987||e===9001||e===9002||e>=9193&&e<=9196||e===9200||e===9203||e===9725||e===9726||e===9748||e===9749||e>=9776&&e<=9783||e>=9800&&e<=9811||e===9855||e>=9866&&e<=9871||e===9875||e===9889||e===9898||e===9899||e===9917||e===9918||e===9924||e===9925||e===9934||e===9940||e===9962||e===9970||e===9971||e===9973||e===9978||e===9981||e===9989||e===9994||e===9995||e===10024||e===10060||e===10062||e>=10067&&e<=10069||e===10071||e>=10133&&e<=10135||e===10160||e===10175||e===11035||e===11036||e===11088||e===11093||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e>=94192&&e<=94198||e>=94208&&e<=101589||e>=101631&&e<=101662||e>=101760&&e<=101874||e>=110576&&e<=110579||e>=110581&&e<=110587||e===110589||e===110590||e>=110592&&e<=110882||e===110898||e>=110928&&e<=110930||e===110933||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||e===126980||e===127183||e===127374||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e===127568||e===127569||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||e===127988||e>=127992&&e<=128062||e===128064||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||e===128378||e===128405||e===128406||e===128420||e>=128507&&e<=128591||e>=128640&&e<=128709||e===128716||e>=128720&&e<=128722||e>=128725&&e<=128728||e>=128732&&e<=128735||e===128747||e===128748||e>=128756&&e<=128764||e>=128992&&e<=129003||e===129008||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129674||e>=129678&&e<=129734||e===129736||e>=129741&&e<=129756||e>=129759&&e<=129770||e>=129775&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}function nr(e){if(!Number.isSafeInteger(e))throw TypeError(`Expected a code point, got \`${typeof e}\`.`)}function rr(e,{ambiguousAsWide:t=!1}={}){return nr(e),er(e)||tr(e)||t&&$n(e)?2:1}const ir=new Intl.Segmenter,ar=/^(?:\p{Default_Ignorable_Code_Point}|\p{Control}|\p{Mark}|\p{Surrogate})+$/v,or=/^[\p{Default_Ignorable_Code_Point}\p{Control}\p{Format}\p{Mark}\p{Surrogate}]+/v,sr=/^\p{RGI_Emoji}$/v;function cr(e){return e.replace(or,``)}function lr(e){return ar.test(e)}function ur(e,t){let n=0;if(e.length>1)for(let r of e.slice(1))r>=`＀`&&r<=`￯`&&(n+=rr(r.codePointAt(0),t));return n}function dr(e,t={}){if(typeof e!=`string`||e.length===0)return 0;let{ambiguousIsNarrow:n=!0,countAnsiEscapeCodes:r=!1}=t,i=e;if(r||(i=Qn(i)),i.length===0)return 0;let a=0,o={ambiguousAsWide:!n};for(let{segment:e}of ir.segment(i)){if(lr(e))continue;if(sr.test(e)){a+=2;continue}let t=cr(e).codePointAt(0);a+=rr(t,o),a+=ur(e,o)}return a}function fr({stream:e=process.stdout}={}){return!!(e&&e.isTTY&&process.env.TERM!==`dumb`&&!(`CI`in process.env))}var pr=new class{#activeCount=0;start(){this.#activeCount++,this.#activeCount===1&&this.#realStart()}stop(){if(this.#activeCount<=0)throw Error("`stop` called more times than `start`");this.#activeCount--,this.#activeCount===0&&this.#realStop()}#realStart(){u.platform===`win32`||!u.stdin.isTTY||(u.stdin.setRawMode(!0),u.stdin.on(`data`,this.#handleInput),u.stdin.resume())}#realStop(){u.stdin.isTTY&&(u.stdin.off(`data`,this.#handleInput),u.stdin.pause(),u.stdin.setRawMode(!1))}#handleInput(e){e[0]===3&&u.emit(`SIGINT`)}},mr=class{#linesToClear=0;#isDiscardingStdin=!1;#lineCount=0;#frameIndex=-1;#lastSpinnerFrameTime=0;#lastIndent=0;#options;#spinner;#stream;#id;#initialInterval;#isEnabled;#isSilent;#indent;#text;#prefixText;#suffixText;color;constructor(e){typeof e==`string`&&(e={text:e}),this.#options={color:`cyan`,stream:u.stderr,discardStdin:!0,hideCursor:!0,...e},this.color=this.#options.color,this.spinner=this.#options.spinner,this.#initialInterval=this.#options.interval,this.#stream=this.#options.stream,this.#isEnabled=typeof this.#options.isEnabled==`boolean`?this.#options.isEnabled:fr({stream:this.#stream}),this.#isSilent=typeof this.#options.isSilent==`boolean`?this.#options.isSilent:!1,this.text=this.#options.text,this.prefixText=this.#options.prefixText,this.suffixText=this.#options.suffixText,this.indent=this.#options.indent,u.env.NODE_ENV===`test`&&(this._stream=this.#stream,this._isEnabled=this.#isEnabled,Object.defineProperty(this,`_linesToClear`,{get(){return this.#linesToClear},set(e){this.#linesToClear=e}}),Object.defineProperty(this,`_frameIndex`,{get(){return this.#frameIndex}}),Object.defineProperty(this,`_lineCount`,{get(){return this.#lineCount}}))}get indent(){return this.#indent}set indent(e=0){if(!(e>=0&&Number.isInteger(e)))throw Error("The `indent` option must be an integer from 0 and up");this.#indent=e,this.#updateLineCount()}get interval(){return this.#initialInterval??this.#spinner.interval??100}get spinner(){return this.#spinner}set spinner(e){if(this.#frameIndex=-1,this.#initialInterval=void 0,typeof e==`object`){if(!Array.isArray(e.frames)||e.frames.length===0||e.frames.some(e=>typeof e!=`string`))throw Error("The given spinner must have a non-empty `frames` array of strings");if(e.interval!==void 0&&!(Number.isInteger(e.interval)&&e.interval>0))throw Error("`spinner.interval` must be a positive integer if provided");this.#spinner=e}else if(!Wn())this.#spinner=Pn.line;else if(e===void 0)this.#spinner=Pn.dots;else if(e!==`default`&&Pn[e])this.#spinner=Pn[e];else throw Error(`There is no built-in spinner named '${e}'. See https://github.com/sindresorhus/cli-spinners/blob/main/spinners.json for a full list.`)}get text(){return this.#text}set text(e=``){this.#text=e,this.#updateLineCount()}get prefixText(){return this.#prefixText}set prefixText(e=``){this.#prefixText=e,this.#updateLineCount()}get suffixText(){return this.#suffixText}set suffixText(e=``){this.#suffixText=e,this.#updateLineCount()}get isSpinning(){return this.#id!==void 0}#formatAffix(e,t,n=!1){let r=typeof e==`function`?e():e;return typeof r==`string`&&r!==``?n?t+r:r+t:``}#getFullPrefixText(e=this.#prefixText,t=` `){return this.#formatAffix(e,t,!1)}#getFullSuffixText(e=this.#suffixText,t=` `){return this.#formatAffix(e,t,!0)}#computeLineCountFrom(e,t){let n=0;for(let r of Qn(e).split(`
25
- `))n+=Math.max(1,Math.ceil(dr(r)/t));return n}#updateLineCount(){let e=this.#stream.columns??80,t=typeof this.#prefixText==`function`?``:this.#prefixText,n=typeof this.#suffixText==`function`?``:this.#suffixText,r=typeof t==`string`&&t!==``?t+` `:``,i=typeof n==`string`&&n!==``?` `+n:``,a=` `.repeat(this.#indent)+r+`-`+(typeof this.#text==`string`?` `+this.#text:``)+i;this.#lineCount=this.#computeLineCountFrom(a,e)}get isEnabled(){return this.#isEnabled&&!this.#isSilent}set isEnabled(e){if(typeof e!=`boolean`)throw TypeError("The `isEnabled` option must be a boolean");this.#isEnabled=e}get isSilent(){return this.#isSilent}set isSilent(e){if(typeof e!=`boolean`)throw TypeError("The `isSilent` option must be a boolean");this.#isSilent=e}frame(){let e=Date.now();(this.#frameIndex===-1||e-this.#lastSpinnerFrameTime>=this.interval)&&(this.#frameIndex=++this.#frameIndex%this.#spinner.frames.length,this.#lastSpinnerFrameTime=e);let{frames:t}=this.#spinner,n=t[this.#frameIndex];this.color&&(n=It[this.color](n));let r=this.#getFullPrefixText(this.#prefixText,` `),i=typeof this.text==`string`?` `+this.text:``,a=this.#getFullSuffixText(this.#suffixText,` `);return r+n+i+a}clear(){if(!this.#isEnabled||!this.#stream.isTTY)return this;this.#stream.cursorTo(0);for(let e=0;e<this.#linesToClear;e++)e>0&&this.#stream.moveCursor(0,-1),this.#stream.clearLine(1);return(this.#indent||this.#lastIndent!==this.#indent)&&this.#stream.cursorTo(this.#indent),this.#lastIndent=this.#indent,this.#linesToClear=0,this}render(){if(!this.#isEnabled||this.#isSilent)return this;this.clear();let e=this.frame(),t=this.#stream.columns??80,n=this.#computeLineCountFrom(e,t),r=this.#stream.rows;if(r&&r>1&&n>r){let t=e.split(`
26
- `),n=r-1;e=[...t.slice(0,n),`... (content truncated to fit terminal)`].join(`
27
- `)}return this.#stream.write(e),this.#linesToClear=this.#computeLineCountFrom(e,t),this}start(e){if(e&&(this.text=e),this.#isSilent)return this;if(!this.#isEnabled){let e=` `.repeat(this.#indent)+this.#getFullPrefixText(this.#prefixText,` `)+(this.text?`- ${this.text}`:``)+this.#getFullSuffixText(this.#suffixText,` `);return e.trim()!==``&&this.#stream.write(e+`
28
- `),this}return this.isSpinning?this:(this.#options.hideCursor&&Mn.hide(this.#stream),this.#options.discardStdin&&u.stdin.isTTY&&(this.#isDiscardingStdin=!0,pr.start()),this.render(),this.#id=setInterval(this.render.bind(this),this.interval),this)}stop(){return clearInterval(this.#id),this.#id=void 0,this.#frameIndex=0,this.#isEnabled&&(this.clear(),this.#options.hideCursor&&Mn.show(this.#stream)),this.#options.discardStdin&&u.stdin.isTTY&&this.#isDiscardingStdin&&(pr.stop(),this.#isDiscardingStdin=!1),this}succeed(e){return this.stopAndPersist({symbol:qn,text:e})}fail(e){return this.stopAndPersist({symbol:Yn,text:e})}warn(e){return this.stopAndPersist({symbol:Jn,text:e})}info(e){return this.stopAndPersist({symbol:Kn,text:e})}stopAndPersist(e={}){if(this.#isSilent)return this;let t=e.prefixText??this.#prefixText,n=this.#getFullPrefixText(t,` `),r=e.symbol??` `,i=e.text??this.text,a=typeof i==`string`?(r?` `:``)+i:``,o=e.suffixText??this.#suffixText,s=this.#getFullSuffixText(o,` `),c=n+r+a+s+`
29
- `;return this.stop(),this.#stream.write(c),this}};function hr(e){return new mr(e)}var gr=n(e(((exports,t)=>{t.exports=function(e){if(typeof e!=`object`)throw Error(`expected an author to be an object`);var t={name:[``,``],email:[`<`,`>`],url:[`(`,`)`]},r=``;for(var i in e.url&&(e.url=n(e.url)),t)e[i]&&(r+=t[i][0]+e[i]+t[i][1]+` `);return r.trim()};function n(e){return e.replace(/\/$/,``)}}))(),1);async function _r(e){let t=new AbortController,n=setTimeout(()=>t.abort(),5e3);try{let r=await fetch(e,{signal:t.signal});clearTimeout(n);let i=(await r.text()).trim();if(i)return i;throw Error(`template download fail`)}catch(e){throw clearTimeout(n),e.name===`AbortError`?Error(`request timeout`):e}}function vr(){return ie(process.cwd()).filter(e=>e!==`.git`).length===0}function yr(e){return e?e.trim():void 0}function br(){try{return{name:S(`git config user.name`).toString().trim(),email:S(`git config user.email`).toString().trim()}}catch{return{}}}async function xr(e){if(e)return e;let t=br();return t.name?(0,gr.default)(t):`Unknown`}async function Sr(e){return(await xr(e)).name||`Unknown`}function Cr(){try{return JSON.parse(re(o(process.cwd(),`package.json`)))}catch{return{}}}var wr=`# Created by nice-move
30
-
31
- * text=auto eol=lf
32
- `;const Tr={Windows_NT:`windows`,Linux:`linux`,Darwin:`macos`};async function Er(){await new F().onDone(()=>wr).output(`.gitattributes`).logger(`Create/Overwrite`,I(`.gitattributes`));let e=hr({text:"Downloading template from `gitignore.io`"}).start(),t=`Create/Overwrite ${I(`.gitignore`)}`;return new F().source(`.gitignore`).onFail().onDone((e=``)=>{let t=Tr[_()];return _r(`https://gitignore.io/api/ssh,certificates,node,${t}`).then(e=>`${e.replaceAll(/(www\.)?toptal\.com\/developers\/gitignore/g,`gitignore.io`).trim()}\n`).catch(()=>e||`node_modules
33
- `)}).output().then(()=>{e.stopAndPersist({symbol:$t(`√`),text:t})}).catch(n=>{e.stopAndPersist({symbol:Qt(`×`),text:`${t} - ${n.message}`})})}var Dr=`MIT License
34
-
35
- Copyright (c) {{year}} {{holder}}
36
-
37
- Permission is hereby granted, free of charge, to any person obtaining a copy
38
- of this software and associated documentation files (the "Software"), to deal
39
- in the Software without restriction, including without limitation the rights
40
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
41
- copies of the Software, and to permit persons to whom the Software is
42
- furnished to do so, subject to the following conditions:
43
-
44
- The above copyright notice and this permission notice shall be included in all
45
- copies or substantial portions of the Software.
46
-
47
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
48
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
49
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
50
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
51
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
52
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
53
- SOFTWARE.
54
- `,Or=`This is free and unencumbered software released into the public domain.
55
-
56
- Anyone is free to copy, modify, publish, use, compile, sell, or
57
- distribute this software, either in source code form or as a compiled
58
- binary, for any purpose, commercial or non-commercial, and by any
59
- means.
60
-
61
- In jurisdictions that recognize copyright laws, the author or authors
62
- of this software dedicate any and all copyright interest in the
63
- software to the public domain. We make this dedication for the benefit
64
- of the public at large and to the detriment of our heirs and
65
- successors. We intend this dedication to be an overt act of
66
- relinquishment in perpetuity of all present and future rights to this
67
- software under copyright law.
68
-
69
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
70
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
71
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
72
- IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
73
- OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
74
- ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
75
- OTHER DEALINGS IN THE SOFTWARE.
76
-
77
- For more information, please refer to <https://unlicense.org/>
78
- `;async function kr(){let{license:e,author:t=``}=Cr(),n=e===`MIT`;if(n||e===`Unlicense`){let e=await Sr(t);return new F().onDone(()=>n?Dr.replace(`{{year}}`,new Date().getFullYear()).replace(`{{holder}}`,e):Or).output(`LICENSE`).logger(`Create/Overwrite`,I(`LICENSE`)).catch(console.warn)}}const R={defaultMerge:Symbol(`deepmerge-ts: default merge`),skip:Symbol(`deepmerge-ts: skip`)};R.defaultMerge;function Ar(e,t){return t}function jr(e,t){return e.filter(e=>e!==void 0)}var Mr;(function(e){e[e.NOT=0]=`NOT`,e[e.RECORD=1]=`RECORD`,e[e.ARRAY=2]=`ARRAY`,e[e.SET=3]=`SET`,e[e.MAP=4]=`MAP`,e[e.OTHER=5]=`OTHER`})(Mr||(Mr={}));function Nr(e){return typeof e!=`object`||!e?0:Array.isArray(e)?2:Rr(e)?1:e instanceof Set?3:e instanceof Map?4:5}function Pr(e){let t=new Set;for(let n of e)for(let e of[...Object.keys(n),...Object.getOwnPropertySymbols(n)])t.add(e);return t}function Fr(e,t){return typeof e==`object`&&Object.prototype.propertyIsEnumerable.call(e,t)}function Ir(e){let t=0,n=e[0]?.[Symbol.iterator]();return{[Symbol.iterator](){return{next(){do{if(n===void 0)return{done:!0,value:void 0};let r=n.next();if(r.done===!0){t+=1,n=e[t]?.[Symbol.iterator]();continue}return{done:!1,value:r.value}}while(!0)}}}}}const Lr=[`[object Object]`,`[object Module]`];function Rr(e){if(!Lr.includes(Object.prototype.toString.call(e)))return!1;let{constructor:t}=e;if(t===void 0)return!0;let n=t.prototype;return!(typeof n!=`object`||!n||!Lr.includes(Object.prototype.toString.call(n))||!n.hasOwnProperty(`isPrototypeOf`))}function zr(e,t,n){let r={};for(let i of Pr(e)){let a=[];for(let t of e)Fr(t,i)&&a.push(t[i]);if(a.length===0)continue;let o=t.metaDataUpdater(n,{key:i,parents:e}),s=Jr(a,t,o);if(s===R.skip)continue;i===`__proto__`?Object.defineProperty(r,i,{value:s,configurable:!0,enumerable:!0,writable:!0}):r[i]=s}return r}function Br(e){return e.flat()}function Vr(e){return new Set(Ir(e))}function Hr(e){return new Map(Ir(e))}function Ur(e){return e.at(-1)}const Wr={mergeRecords:zr,mergeArrays:Br,mergeSets:Vr,mergeMaps:Hr,mergeOthers:Ur};function Gr(...e){return Kr({})(...e)}function Kr(e,t){let n=qr(e,r);function r(...e){return Jr(e,n,t)}return r}function qr(e,t){return{defaultMergeFunctions:Wr,mergeFunctions:{...Wr,...Object.fromEntries(Object.entries(e).filter(([e,t])=>Object.hasOwn(Wr,e)).map(([e,t])=>t===!1?[e,Wr.mergeOthers]:[e,t]))},metaDataUpdater:e.metaDataUpdater??Ar,deepmerge:t,useImplicitDefaultMerging:e.enableImplicitDefaultMerging??!1,filterValues:e.filterValues===!1?void 0:e.filterValues??jr,actions:R}}function Jr(e,t,n){let r=t.filterValues?.(e,n)??e;if(r.length===0)return;if(r.length===1)return $r(r,t,n);let i=Nr(r[0]);if(i!==0&&i!==5){for(let e=1;e<r.length;e++)if(Nr(r[e])!==i)return $r(r,t,n)}switch(i){case 1:return Yr(r,t,n);case 2:return Xr(r,t,n);case 3:return Zr(r,t,n);case 4:return Qr(r,t,n);default:return $r(r,t,n)}}function Yr(e,t,n){let r=t.mergeFunctions.mergeRecords(e,t,n);return r===R.defaultMerge||t.useImplicitDefaultMerging&&r===void 0&&t.mergeFunctions.mergeRecords!==t.defaultMergeFunctions.mergeRecords?t.defaultMergeFunctions.mergeRecords(e,t,n):r}function Xr(e,t,n){let r=t.mergeFunctions.mergeArrays(e,t,n);return r===R.defaultMerge||t.useImplicitDefaultMerging&&r===void 0&&t.mergeFunctions.mergeArrays!==t.defaultMergeFunctions.mergeArrays?t.defaultMergeFunctions.mergeArrays(e):r}function Zr(e,t,n){let r=t.mergeFunctions.mergeSets(e,t,n);return r===R.defaultMerge||t.useImplicitDefaultMerging&&r===void 0&&t.mergeFunctions.mergeSets!==t.defaultMergeFunctions.mergeSets?t.defaultMergeFunctions.mergeSets(e):r}function Qr(e,t,n){let r=t.mergeFunctions.mergeMaps(e,t,n);return r===R.defaultMerge||t.useImplicitDefaultMerging&&r===void 0&&t.mergeFunctions.mergeMaps!==t.defaultMergeFunctions.mergeMaps?t.defaultMergeFunctions.mergeMaps(e):r}function $r(e,t,n){let r=t.mergeFunctions.mergeOthers(e,t,n);return r===R.defaultMerge||t.useImplicitDefaultMerging&&r===void 0&&t.mergeFunctions.mergeOthers!==t.defaultMergeFunctions.mergeOthers?t.defaultMergeFunctions.mergeOthers(e):r}var ei=e(((exports,t)=>{t.exports=e=>{if(typeof e!=`object`||!e)throw TypeError(`Expected an object`);let t={};for(let[n,r]of Object.entries(e))t[r]=n;for(let n of Object.getOwnPropertySymbols(e)){let r=e[n];t[r]=n}return t}})),ti=e(((exports,t)=>{t.exports={4:`zh_CHS`,1025:`ar_SA`,1026:`bg_BG`,1027:`ca_ES`,1028:`zh_TW`,1029:`cs_CZ`,1030:`da_DK`,1031:`de_DE`,1032:`el_GR`,1033:`en_US`,1034:`es_ES`,1035:`fi_FI`,1036:`fr_FR`,1037:`he_IL`,1038:`hu_HU`,1039:`is_IS`,1040:`it_IT`,1041:`ja_JP`,1042:`ko_KR`,1043:`nl_NL`,1044:`nb_NO`,1045:`pl_PL`,1046:`pt_BR`,1047:`rm_CH`,1048:`ro_RO`,1049:`ru_RU`,1050:`hr_HR`,1051:`sk_SK`,1052:`sq_AL`,1053:`sv_SE`,1054:`th_TH`,1055:`tr_TR`,1056:`ur_PK`,1057:`id_ID`,1058:`uk_UA`,1059:`be_BY`,1060:`sl_SI`,1061:`et_EE`,1062:`lv_LV`,1063:`lt_LT`,1064:`tg_TJ`,1065:`fa_IR`,1066:`vi_VN`,1067:`hy_AM`,1069:`eu_ES`,1070:`wen_DE`,1071:`mk_MK`,1074:`tn_ZA`,1076:`xh_ZA`,1077:`zu_ZA`,1078:`af_ZA`,1079:`ka_GE`,1080:`fo_FO`,1081:`hi_IN`,1082:`mt_MT`,1083:`se_NO`,1086:`ms_MY`,1087:`kk_KZ`,1088:`ky_KG`,1089:`sw_KE`,1090:`tk_TM`,1092:`tt_RU`,1093:`bn_IN`,1094:`pa_IN`,1095:`gu_IN`,1096:`or_IN`,1097:`ta_IN`,1098:`te_IN`,1099:`kn_IN`,1100:`ml_IN`,1101:`as_IN`,1102:`mr_IN`,1103:`sa_IN`,1104:`mn_MN`,1105:`bo_CN`,1106:`cy_GB`,1107:`kh_KH`,1108:`lo_LA`,1109:`my_MM`,1110:`gl_ES`,1111:`kok_IN`,1114:`syr_SY`,1115:`si_LK`,1118:`am_ET`,1121:`ne_NP`,1122:`fy_NL`,1123:`ps_AF`,1124:`fil_PH`,1125:`div_MV`,1128:`ha_NG`,1130:`yo_NG`,1131:`quz_BO`,1132:`ns_ZA`,1133:`ba_RU`,1134:`lb_LU`,1135:`kl_GL`,1144:`ii_CN`,1146:`arn_CL`,1148:`moh_CA`,1150:`br_FR`,1152:`ug_CN`,1153:`mi_NZ`,1154:`oc_FR`,1155:`co_FR`,1156:`gsw_FR`,1157:`sah_RU`,1158:`qut_GT`,1159:`rw_RW`,1160:`wo_SN`,1164:`gbz_AF`,2049:`ar_IQ`,2052:`zh_CN`,2055:`de_CH`,2057:`en_GB`,2058:`es_MX`,2060:`fr_BE`,2064:`it_CH`,2067:`nl_BE`,2068:`nn_NO`,2070:`pt_PT`,2077:`sv_FI`,2080:`ur_IN`,2092:`az_AZ`,2094:`dsb_DE`,2107:`se_SE`,2108:`ga_IE`,2110:`ms_BN`,2115:`uz_UZ`,2128:`mn_CN`,2129:`bo_BT`,2141:`iu_CA`,2143:`tmz_DZ`,2155:`quz_EC`,3073:`ar_EG`,3076:`zh_HK`,3079:`de_AT`,3081:`en_AU`,3082:`es_ES`,3084:`fr_CA`,3098:`sr_SP`,3131:`se_FI`,3179:`quz_PE`,4097:`ar_LY`,4100:`zh_SG`,4103:`de_LU`,4105:`en_CA`,4106:`es_GT`,4108:`fr_CH`,4122:`hr_BA`,4155:`smj_NO`,5121:`ar_DZ`,5124:`zh_MO`,5127:`de_LI`,5129:`en_NZ`,5130:`es_CR`,5132:`fr_LU`,5179:`smj_SE`,6145:`ar_MA`,6153:`en_IE`,6154:`es_PA`,6156:`fr_MC`,6203:`sma_NO`,7169:`ar_TN`,7177:`en_ZA`,7178:`es_DO`,7194:`sr_BA`,7227:`sma_SE`,8193:`ar_OM`,8201:`en_JA`,8202:`es_VE`,8218:`bs_BA`,8251:`sms_FI`,9217:`ar_YE`,9225:`en_CB`,9226:`es_CO`,9275:`smn_FI`,10241:`ar_SY`,10249:`en_BZ`,10250:`es_PE`,11265:`ar_JO`,11273:`en_TT`,11274:`es_AR`,12289:`ar_LB`,12297:`en_ZW`,12298:`es_EC`,13313:`ar_KW`,13321:`en_PH`,13322:`es_CL`,14337:`ar_AE`,14346:`es_UR`,15361:`ar_BH`,15370:`es_PY`,16385:`ar_QA`,16394:`es_BO`,17417:`en_MY`,17418:`es_SV`,18441:`en_IN`,18442:`es_HN`,19466:`es_NI`,20490:`es_PR`,21514:`es_US`,31748:`zh_CHT`}})),ni=n(e((exports=>{let t=ei(),n=ti(),r=t(n);exports.from=e=>{if(typeof e!=`number`)throw TypeError(`Expected a number`);return n[e]},exports.all=new Proxy(r,{get(e,t){let n=e[t];if(n)return Number(n)}})}))(),1);const ri=de(y.execFile);async function ii(e,t){let n=await ri(e,t,{encoding:`utf8`});return n.stdout=n.stdout.trim(),n}const ai={spawn:!0},oi=`en-US`;async function si(e,t){return(await ii(e,t)).stdout}function ci(e=process.env){return e.LC_ALL||e.LC_MESSAGES||e.LANG||e.LANGUAGE}function li(e){let t={};for(let n of e.split(`
79
- `)){let[e,r]=n.split(`=`);t[e]=r.replace(/^"|"$/g,``)}return ci(t)}function ui(e){return e&&e.replace(/[.:].*/,``)}async function di(){return si(`locale`,[`-a`])}function fi(e,t=``){return t.includes(e)?e:oi}async function pi(){let e=await Promise.all([si(`defaults`,[`read`,`-globalDomain`,`AppleLocale`]),di()]);return fi(e[0],e[1])}async function mi(){return ui(li(await si(`locale`)))}async function hi(){let e=await si(`wmic`,[`os`,`get`,`locale`]),t=Number.parseInt(e.replace(`Locale`,``),16);return ni.from(t)}function gi(e){return e.replace(/_/,`-`)}const _i=new Map;async function vi(e=ai){if(_i.has(e.spawn))return _i.get(e.spawn);let t;try{let n=ci();t=n||e.spawn===!1?ui(n):process.platform===`win32`?await hi():process.platform===`darwin`?await pi():await mi()}catch{}let n=gi(t||oi);return _i.set(e.spawn,n),n}var z={"@bring-it/cli":`^0.11.0`,"@bring-it/npm":`^0.9.0`,"@cospaia/prettier-plugin-clojure":`^0.0.2`,"@vitest/ui":`^3.2.4`,eslint:`^9.35.0`,"find-workspaces":`^0.3.1`,garou:`^0.9.13`,postcss:`^8.5.6`,prettier:`~3.6.2`,"prettier-plugin-tailwindcss":`^0.6.14`,stylelint:`^16.24.0`,syncpack:`^13.0.4`,tsdown:`^0.15.1`,typescript:`~5.9.2`,vitest:`^3.2.4`,"@bring-it/sftp":`^0.7.0`,"@nice-move/init":`^0.8.21`,"@nice-move/syncpack-config":`^0.4.1`,"@playwright/test":`~1.55.0`,"@types/react":`~18.3.24`,react:`~18.3.1`,"react-dom":`~18.3.1`,tailwindcss:`^3.4.17`,vue:`~3.5.21`,yaml:`^2.8.1`,"@nice-move/eslint-config-base":`^0.13.3`,"@nice-move/stylelint-config":`^0.10.22`,"@nice-move/prettier-config":`^0.15.6`,"@nice-move/tsconfig":`^0.3.10`,"@nice-move/cli":`^0.11.26`,"@eslint/js":`^9.35.0`,chalk:`^5.6.2`,execa:`^9.6.0`,"fs-chain":`^10.0.0`,lodash:`^4.17.21`,settingz:`^0.2.0`,"sort-keys":`^6.0.0`,"eslint-plugin-react-hooks":`^5.2.0`,globals:`^16.4.0`,lts:`^22.18.0 || ^24.0.0`};const yi=`package.json`;async function bi(){await vi()===`zh-CN`&&new F().source(`.npmrc`).onFail().onDone((e=``)=>e.trim()&&/registry\s*=\s*["']?https:\/\/mirrors\.tencent\.com\/npm\/["']?/i.test(e)?e:`registry = https://mirrors.tencent.com/npm/\r${e}`).output().logger(`Set registry to China mirror in`,I(`.npmrc`)).catch(console.warn)}function xi(e){return new Zt().config({pretty:!0}).source(yi).onFail().onDone((t={})=>Gr({engines:{node:z.lts},publishConfig:e.private||t.private?void 0:{access:`public`,registry:`https://registry.npmjs.org/`}},t,e)).onDone(e=>(e.private===!0&&bi(),e)).output().logger(`Add project info to`,I(yi)).catch(console.warn)}async function Si(){let{name:e,description:t}=Cr();new F().source(`README.md`).onFail().onDone(n=>n||[`# ${e}`,t?`${t}.\n`:``].filter(Boolean).join(`
80
-
81
- `)).output().logger(`Create`,I(`README.md`)).catch(console.warn)}function B(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}const Ci=(e,t)=>{let n=Ei(wi(e));if(typeof n!=`string`)throw TypeError(`${t} must be a string or a file URL: ${n}.`);return n},wi=e=>Ti(e)?e.toString():e,Ti=e=>typeof e!=`string`&&e&&Object.getPrototypeOf(e)===String.prototype,Ei=e=>e instanceof URL?l(e):e,Di=(e,t=[],n={})=>{let r=Ci(e,`First argument`),[i,a]=B(t)?[[],t]:[t,n];if(!Array.isArray(i))throw TypeError(`Second argument must be either an array of arguments or an options object: ${i}`);if(i.some(e=>typeof e==`object`&&!!e))throw TypeError(`Second argument must be an array of strings: ${i}`);let o=i.map(String),s=o.find(e=>e.includes(`\0`));if(s!==void 0)throw TypeError(`Arguments cannot contain null bytes ("\\0"): ${s}`);if(!B(a))throw TypeError(`Last argument must be an options object: ${a}`);return[r,o,a]},{toString:Oi}=Object.prototype,ki=e=>Oi.call(e)===`[object ArrayBuffer]`,V=e=>Oi.call(e)===`[object Uint8Array]`,Ai=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),ji=new TextEncoder,Mi=e=>ji.encode(e),Ni=new TextDecoder,Pi=e=>Ni.decode(e),Fi=(e,t)=>Ii(e,t).join(``),Ii=(e,t)=>{if(t===`utf8`&&e.every(e=>typeof e==`string`))return e;let n=new pe(t),r=e.map(e=>typeof e==`string`?Mi(e):e).map(e=>n.write(e)),i=n.end();return i===``?r:[...r,i]},Li=e=>e.length===1&&V(e[0])?e[0]:zi(Ri(e)),Ri=e=>e.map(e=>typeof e==`string`?Mi(e):e),zi=e=>{let t=new Uint8Array(Bi(e)),n=0;for(let r of e)t.set(r,n),n+=r.length;return t},Bi=e=>{let t=0;for(let n of e)t+=n.length;return t},Vi=e=>Array.isArray(e)&&Array.isArray(e.raw),Hi=(e,t)=>{let n=[];for(let[r,i]of e.entries())n=Ui({templates:e,expressions:t,tokens:n,index:r,template:i});if(n.length===0)throw TypeError(`Template script must not be empty`);let[r,...i]=n;return[r,i,{}]},Ui=({templates:e,expressions:t,tokens:n,index:r,template:i})=>{if(i===void 0)throw TypeError(`Invalid backslash sequence: ${e.raw[r]}`);let{nextTokens:a,leadingWhitespaces:o,trailingWhitespaces:s}=Wi(i,e.raw[r]),c=qi(n,a,o);if(r===t.length)return c;let l=t[r],u=Array.isArray(l)?l.map(e=>Ji(e)):[Ji(l)];return qi(c,u,s)},Wi=(e,t)=>{if(t.length===0)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};let n=[],r=0,i=Gi.has(t[0]);for(let i=0,a=0;i<e.length;i+=1,a+=1){let o=t[a];if(Gi.has(o))r!==i&&n.push(e.slice(r,i)),r=i+1;else if(o===`\\`){let e=t[a+1];e===`
82
- `?(--i,a+=1):e===`u`&&t[a+2]===`{`?a=t.indexOf(`}`,a+3):a+=Ki[e]??1}}let a=r===e.length;return a||n.push(e.slice(r)),{nextTokens:n,leadingWhitespaces:i,trailingWhitespaces:a}},Gi=new Set([` `,` `,`\r`,`
83
- `]),Ki={x:3,u:5},qi=(e,t,n)=>n||e.length===0||t.length===0?[...e,...t]:[...e.slice(0,-1),`${e.at(-1)}${t[0]}`,...t.slice(1)],Ji=e=>{let t=typeof e;if(t===`string`)return e;if(t===`number`)return String(e);if(B(e)&&(`stdout`in e||`isMaxBuffer`in e))return Yi(e);throw e instanceof b||Object.prototype.toString.call(e)===`[object Promise]`?TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}."):TypeError(`Unexpected "${t}" in template expression`)},Yi=({stdout:e})=>{if(typeof e==`string`)return e;if(V(e))return Pi(e);throw e===void 0?TypeError(`Missing result.stdout in template expression. This is probably due to the previous subprocess' "stdout" option.`):TypeError(`Unexpected "${typeof e}" stdout in template expression`)},Xi=e=>Zi.includes(e),Zi=[u.stdin,u.stdout,u.stderr],H=[`stdin`,`stdout`,`stderr`],Qi=e=>H[e]??`stdio[${e}]`,$i=e=>{let t={...e};for(let n of da)t[n]=ea(e,n);return t},ea=(e,t)=>{let n=Array.from({length:ta(e)+1}),r=na(e[t],n,t);return la(r,t)},ta=({stdio:e})=>Array.isArray(e)?Math.max(e.length,H.length):H.length,na=(e,t,n)=>B(e)?ra(e,t,n):t.fill(e),ra=(e,t,n)=>{for(let r of Object.keys(e).sort(ia))for(let i of oa(r,n,t))t[i]=e[r];return t},ia=(e,t)=>aa(e)<aa(t)?1:-1,aa=e=>e===`stdout`||e===`stderr`?0:e===`all`?2:1,oa=(e,t,n)=>{if(e===`ipc`)return[n.length-1];let r=sa(e);if(r===void 0||r===0)throw TypeError(`"${t}.${e}" is invalid.
84
- It must be "${t}.stdout", "${t}.stderr", "${t}.all", "${t}.ipc", or "${t}.fd3", "${t}.fd4" (and so on).`);if(r>=n.length)throw TypeError(`"${t}.${e}" is invalid: that file descriptor does not exist.
85
- Please set the "stdio" option to ensure that file descriptor exists.`);return r===`all`?[1,2]:[r]},sa=e=>{if(e===`all`)return e;if(H.includes(e))return H.indexOf(e);let t=ca.exec(e);if(t!==null)return Number(t[1])},ca=/^fd(\d+)$/,la=(e,t)=>e.map(e=>e===void 0?ua[t]:e),ua={lines:!1,buffer:!0,maxBuffer:1e3*1e3*100,verbose:le(`execa`).enabled?`full`:`none`,stripFinalNewline:!0},da=[`lines`,`buffer`,`maxBuffer`,`verbose`,`stripFinalNewline`],fa=(e,t)=>t===`ipc`?e.at(-1):e[t],pa=({verbose:e},t)=>ga(e,t)!==`none`,ma=({verbose:e},t)=>![`none`,`short`].includes(ga(e,t)),ha=({verbose:e},t)=>{let n=ga(e,t);return va(n)?n:void 0},ga=(e,t)=>t===void 0?_a(e):fa(e,t),_a=e=>e.find(e=>va(e))??ya.findLast(t=>e.includes(t)),va=e=>typeof e==`function`,ya=[`none`,`short`,`full`],ba=(e,t)=>{let n=[e,...t],r=n.join(` `),i=n.map(e=>Da(Sa(e))).join(` `);return{command:r,escapedCommand:i}},xa=e=>fe(e).split(`
86
- `).map(e=>Sa(e)).join(`
87
- `),Sa=e=>e.replaceAll(wa,e=>Ca(e)),Ca=e=>{let t=Ta[e];if(t!==void 0)return t;let n=e.codePointAt(0),r=n.toString(16);return n<=Ea?`\\u${r.padStart(4,`0`)}`:`\\U${r}`},wa=(()=>{try{return RegExp(`\\p{Separator}|\\p{Other}`,`gu`)}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}})(),Ta={" ":` `,"\b":`\\b`,"\f":`\\f`,"\n":`\\n`,"\r":`\\r`," ":`\\t`},Ea=65535,Da=e=>Oa.test(e)?e:m===`win32`?`"${e.replaceAll(`"`,`""`)}"`:`'${e.replaceAll(`'`,`'\\''`)}'`,Oa=/^[\w./-]+$/,ka={circleQuestionMark:`(?)`,questionMarkPrefix:`(?)`,square:`█`,squareDarkShade:`▓`,squareMediumShade:`▒`,squareLightShade:`░`,squareTop:`▀`,squareBottom:`▄`,squareLeft:`▌`,squareRight:`▐`,squareCenter:`■`,bullet:`●`,dot:`․`,ellipsis:`…`,pointerSmall:`›`,triangleUp:`▲`,triangleUpSmall:`▴`,triangleDown:`▼`,triangleDownSmall:`▾`,triangleLeftSmall:`◂`,triangleRightSmall:`▸`,home:`⌂`,heart:`♥`,musicNote:`♪`,musicNoteBeamed:`♫`,arrowUp:`↑`,arrowDown:`↓`,arrowLeft:`←`,arrowRight:`→`,arrowLeftRight:`↔`,arrowUpDown:`↕`,almostEqual:`≈`,notEqual:`≠`,lessOrEqual:`≤`,greaterOrEqual:`≥`,identical:`≡`,infinity:`∞`,subscriptZero:`₀`,subscriptOne:`₁`,subscriptTwo:`₂`,subscriptThree:`₃`,subscriptFour:`₄`,subscriptFive:`₅`,subscriptSix:`₆`,subscriptSeven:`₇`,subscriptEight:`₈`,subscriptNine:`₉`,oneHalf:`½`,oneThird:`⅓`,oneQuarter:`¼`,oneFifth:`⅕`,oneSixth:`⅙`,oneEighth:`⅛`,twoThirds:`⅔`,twoFifths:`⅖`,threeQuarters:`¾`,threeFifths:`⅗`,threeEighths:`⅜`,fourFifths:`⅘`,fiveSixths:`⅚`,fiveEighths:`⅝`,sevenEighths:`⅞`,line:`─`,lineBold:`━`,lineDouble:`═`,lineDashed0:`┄`,lineDashed1:`┅`,lineDashed2:`┈`,lineDashed3:`┉`,lineDashed4:`╌`,lineDashed5:`╍`,lineDashed6:`╴`,lineDashed7:`╶`,lineDashed8:`╸`,lineDashed9:`╺`,lineDashed10:`╼`,lineDashed11:`╾`,lineDashed12:`−`,lineDashed13:`–`,lineDashed14:`‐`,lineDashed15:`⁃`,lineVertical:`│`,lineVerticalBold:`┃`,lineVerticalDouble:`║`,lineVerticalDashed0:`┆`,lineVerticalDashed1:`┇`,lineVerticalDashed2:`┊`,lineVerticalDashed3:`┋`,lineVerticalDashed4:`╎`,lineVerticalDashed5:`╏`,lineVerticalDashed6:`╵`,lineVerticalDashed7:`╷`,lineVerticalDashed8:`╹`,lineVerticalDashed9:`╻`,lineVerticalDashed10:`╽`,lineVerticalDashed11:`╿`,lineDownLeft:`┐`,lineDownLeftArc:`╮`,lineDownBoldLeftBold:`┓`,lineDownBoldLeft:`┒`,lineDownLeftBold:`┑`,lineDownDoubleLeftDouble:`╗`,lineDownDoubleLeft:`╖`,lineDownLeftDouble:`╕`,lineDownRight:`┌`,lineDownRightArc:`╭`,lineDownBoldRightBold:`┏`,lineDownBoldRight:`┎`,lineDownRightBold:`┍`,lineDownDoubleRightDouble:`╔`,lineDownDoubleRight:`╓`,lineDownRightDouble:`╒`,lineUpLeft:`┘`,lineUpLeftArc:`╯`,lineUpBoldLeftBold:`┛`,lineUpBoldLeft:`┚`,lineUpLeftBold:`┙`,lineUpDoubleLeftDouble:`╝`,lineUpDoubleLeft:`╜`,lineUpLeftDouble:`╛`,lineUpRight:`└`,lineUpRightArc:`╰`,lineUpBoldRightBold:`┗`,lineUpBoldRight:`┖`,lineUpRightBold:`┕`,lineUpDoubleRightDouble:`╚`,lineUpDoubleRight:`╙`,lineUpRightDouble:`╘`,lineUpDownLeft:`┤`,lineUpBoldDownBoldLeftBold:`┫`,lineUpBoldDownBoldLeft:`┨`,lineUpDownLeftBold:`┥`,lineUpBoldDownLeftBold:`┩`,lineUpDownBoldLeftBold:`┪`,lineUpDownBoldLeft:`┧`,lineUpBoldDownLeft:`┦`,lineUpDoubleDownDoubleLeftDouble:`╣`,lineUpDoubleDownDoubleLeft:`╢`,lineUpDownLeftDouble:`╡`,lineUpDownRight:`├`,lineUpBoldDownBoldRightBold:`┣`,lineUpBoldDownBoldRight:`┠`,lineUpDownRightBold:`┝`,lineUpBoldDownRightBold:`┡`,lineUpDownBoldRightBold:`┢`,lineUpDownBoldRight:`┟`,lineUpBoldDownRight:`┞`,lineUpDoubleDownDoubleRightDouble:`╠`,lineUpDoubleDownDoubleRight:`╟`,lineUpDownRightDouble:`╞`,lineDownLeftRight:`┬`,lineDownBoldLeftBoldRightBold:`┳`,lineDownLeftBoldRightBold:`┯`,lineDownBoldLeftRight:`┰`,lineDownBoldLeftBoldRight:`┱`,lineDownBoldLeftRightBold:`┲`,lineDownLeftRightBold:`┮`,lineDownLeftBoldRight:`┭`,lineDownDoubleLeftDoubleRightDouble:`╦`,lineDownDoubleLeftRight:`╥`,lineDownLeftDoubleRightDouble:`╤`,lineUpLeftRight:`┴`,lineUpBoldLeftBoldRightBold:`┻`,lineUpLeftBoldRightBold:`┷`,lineUpBoldLeftRight:`┸`,lineUpBoldLeftBoldRight:`┹`,lineUpBoldLeftRightBold:`┺`,lineUpLeftRightBold:`┶`,lineUpLeftBoldRight:`┵`,lineUpDoubleLeftDoubleRightDouble:`╩`,lineUpDoubleLeftRight:`╨`,lineUpLeftDoubleRightDouble:`╧`,lineUpDownLeftRight:`┼`,lineUpBoldDownBoldLeftBoldRightBold:`╋`,lineUpDownBoldLeftBoldRightBold:`╈`,lineUpBoldDownLeftBoldRightBold:`╇`,lineUpBoldDownBoldLeftRightBold:`╊`,lineUpBoldDownBoldLeftBoldRight:`╉`,lineUpBoldDownLeftRight:`╀`,lineUpDownBoldLeftRight:`╁`,lineUpDownLeftBoldRight:`┽`,lineUpDownLeftRightBold:`┾`,lineUpBoldDownBoldLeftRight:`╂`,lineUpDownLeftBoldRightBold:`┿`,lineUpBoldDownLeftBoldRight:`╃`,lineUpBoldDownLeftRightBold:`╄`,lineUpDownBoldLeftBoldRight:`╅`,lineUpDownBoldLeftRightBold:`╆`,lineUpDoubleDownDoubleLeftDoubleRightDouble:`╬`,lineUpDoubleDownDoubleLeftRight:`╫`,lineUpDownLeftDoubleRightDouble:`╪`,lineCross:`╳`,lineBackslash:`╲`,lineSlash:`╱`},Aa={tick:`✔`,info:`ℹ`,warning:`⚠`,cross:`✘`,squareSmall:`◻`,squareSmallFilled:`◼`,circle:`◯`,circleFilled:`◉`,circleDotted:`◌`,circleDouble:`◎`,circleCircle:`ⓞ`,circleCross:`ⓧ`,circlePipe:`Ⓘ`,radioOn:`◉`,radioOff:`◯`,checkboxOn:`☒`,checkboxOff:`☐`,checkboxCircleOn:`ⓧ`,checkboxCircleOff:`Ⓘ`,pointer:`❯`,triangleUpOutline:`△`,triangleLeft:`◀`,triangleRight:`▶`,lozenge:`◆`,lozengeOutline:`◇`,hamburger:`☰`,smiley:`㋡`,mustache:`෴`,star:`★`,play:`▶`,nodejs:`⬢`,oneSeventh:`⅐`,oneNinth:`⅑`,oneTenth:`⅒`},ja={tick:`√`,info:`i`,warning:`‼`,cross:`×`,squareSmall:`□`,squareSmallFilled:`■`,circle:`( )`,circleFilled:`(*)`,circleDotted:`( )`,circleDouble:`( )`,circleCircle:`(○)`,circleCross:`(×)`,circlePipe:`(│)`,radioOn:`(*)`,radioOff:`( )`,checkboxOn:`[×]`,checkboxOff:`[ ]`,checkboxCircleOn:`(×)`,checkboxCircleOff:`( )`,pointer:`>`,triangleUpOutline:`∆`,triangleLeft:`◄`,triangleRight:`►`,lozenge:`♦`,lozengeOutline:`◊`,hamburger:`≡`,smiley:`☺`,mustache:`┌─┐`,star:`✶`,play:`►`,nodejs:`♦`,oneSeventh:`1/7`,oneNinth:`1/9`,oneTenth:`1/10`},Ma={...ka,...Aa},Na={...ka,...ja};var Pa=Wn()?Ma:Na;Object.entries(Aa);const Fa=({type:e,message:t,timestamp:n,piped:r,commandId:i,result:{failed:a=!1}={},options:{reject:o=!0}})=>{let s=Ia(n),c=za[e]({failed:a,reject:o,piped:r}),l=Va[e]({reject:o});return`${Vn(`[${s}]`)} ${Vn(`[${i}]`)} ${l(c)} ${l(t)}`},Ia=e=>`${La(e.getHours(),2)}:${La(e.getMinutes(),2)}:${La(e.getSeconds(),2)}.${La(e.getMilliseconds(),3)}`,La=(e,t)=>String(e).padStart(t,`0`),Ra=({failed:e,reject:t})=>e?t?Pa.cross:Pa.warning:Pa.tick,za={command:({piped:e})=>e?`|`:`$`,output:()=>` `,ipc:()=>`*`,error:Ra,duration:Ra},Ba=e=>e,Va={command:()=>In,output:()=>Ba,ipc:()=>Ba,error:({reject:e})=>e?Hn:Un,duration:()=>Vn},Ha=(e,t,n)=>{let r=ha(t,n);return e.map(({verboseLine:e,verboseObject:t})=>Ua(e,t,r)).filter(e=>e!==void 0).map(e=>Wa(e)).join(``)},Ua=(e,t,n)=>{if(n===void 0)return e;let r=n(e,t);if(typeof r==`string`)return r},Wa=e=>e.endsWith(`
88
- `)?e:`${e}\n`,Ga=({type:e,verboseMessage:t,fdNumber:n,verboseInfo:r,result:i})=>{let a=Ka({type:e,result:i,verboseInfo:r}),o=qa(t,a),s=Ha(o,r,n);s!==``&&console.warn(s.slice(0,-1))},Ka=({type:e,result:t,verboseInfo:{escapedCommand:n,commandId:r,rawOptions:{piped:i=!1,...a}}})=>({type:e,escapedCommand:n,commandId:`${r}`,timestamp:new Date,piped:i,result:t,options:a}),qa=(e,t)=>e.split(`
89
- `).map(e=>Ja({...t,message:e})),Ja=e=>({verboseLine:Fa(e),verboseObject:e}),Ya=e=>{let t=typeof e==`string`?e:ue(e);return xa(t).replaceAll(` `,` `.repeat(Xa))},Xa=2,Za=(e,t)=>{pa(t)&&Ga({type:`command`,verboseMessage:e,verboseInfo:t})},Qa=(e,t,n)=>{to(e);let r=$a(e);return{verbose:e,escapedCommand:t,commandId:r,rawOptions:n}},$a=e=>pa({verbose:e})?eo++:void 0;let eo=0n;const to=e=>{for(let t of e){if(t===!1)throw TypeError(`The "verbose: false" option was renamed to "verbose: 'none'".`);if(t===!0)throw TypeError(`The "verbose: true" option was renamed to "verbose: 'short'".`);if(!ya.includes(t)&&!va(t)){let e=ya.map(e=>`'${e}'`).join(`, `);throw TypeError(`The "verbose" option must not be ${t}. Allowed values are: ${e} or a function.`)}}},no=()=>p.bigint(),ro=e=>Number(p.bigint()-e)/1e6,io=(e,t,n)=>{let r=no(),{command:i,escapedCommand:a}=ba(e,t),o=ea(n,`verbose`),s=Qa(o,a,{...n});return Za(a,s),{command:i,escapedCommand:a,startTime:r,verboseInfo:s}};var ao=e(((exports,n)=>{n.exports=o,o.sync=s;var r=t(`fs`);function i(e,t){var n=t.pathExt===void 0?process.env.PATHEXT:t.pathExt;if(!n||(n=n.split(`;`),n.indexOf(``)!==-1))return!0;for(var r=0;r<n.length;r++){var i=n[r].toLowerCase();if(i&&e.substr(-i.length).toLowerCase()===i)return!0}return!1}function a(e,t,n){return!e.isSymbolicLink()&&!e.isFile()?!1:i(t,n)}function o(e,t,n){r.stat(e,function(r,i){n(r,r?!1:a(i,e,t))})}function s(e,t){return a(r.statSync(e),e,t)}})),oo=e(((exports,n)=>{n.exports=i,i.sync=a;var r=t(`fs`);function i(e,t,n){r.stat(e,function(e,r){n(e,e?!1:o(r,t))})}function a(e,t){return o(r.statSync(e),t)}function o(e,t){return e.isFile()&&s(e,t)}function s(e,t){var n=e.mode,r=e.uid,i=e.gid,a=t.uid===void 0?process.getuid&&process.getuid():t.uid,o=t.gid===void 0?process.getgid&&process.getgid():t.gid,s=64,c=8,l=1,u=s|c;return n&l||n&c&&i===o||n&s&&r===a||n&u&&a===0}})),so=e(((exports,n)=>{t(`fs`);var r=process.platform===`win32`||global.TESTING_WINDOWS?ao():oo();n.exports=i,i.sync=a;function i(e,t,n){if(typeof t==`function`&&(n=t,t={}),!n){if(typeof Promise!=`function`)throw TypeError(`callback not provided`);return new Promise(function(n,r){i(e,t||{},function(e,t){e?r(e):n(t)})})}r(e,t||{},function(e,r){e&&(e.code===`EACCES`||t&&t.ignoreErrors)&&(e=null,r=!1),n(e,r)})}function a(e,t){try{return r.sync(e,t||{})}catch(e){if(t&&t.ignoreErrors||e.code===`EACCES`)return!1;throw e}}})),co=e(((exports,n)=>{let r=process.platform===`win32`||process.env.OSTYPE===`cygwin`||process.env.OSTYPE===`msys`,i=t(`path`),a=r?`;`:`:`,o=so(),s=e=>Object.assign(Error(`not found: ${e}`),{code:`ENOENT`}),c=(e,t)=>{let n=t.colon||a,i=e.match(/\//)||r&&e.match(/\\/)?[``]:[...r?[process.cwd()]:[],...(t.path||process.env.PATH||``).split(n)],o=r?t.pathExt||process.env.PATHEXT||`.EXE;.CMD;.BAT;.COM`:``,s=r?o.split(n):[``];return r&&e.indexOf(`.`)!==-1&&s[0]!==``&&s.unshift(``),{pathEnv:i,pathExt:s,pathExtExe:o}},l=(e,t,n)=>{typeof t==`function`&&(n=t,t={}),t||(t={});let{pathEnv:r,pathExt:a,pathExtExe:l}=c(e,t),u=[],d=n=>new Promise((a,o)=>{if(n===r.length)return t.all&&u.length?a(u):o(s(e));let c=r[n],l=/^".*"$/.test(c)?c.slice(1,-1):c,d=i.join(l,e),p=!l&&/^\.[\\\/]/.test(e)?e.slice(0,2)+d:d;a(f(p,n,0))}),f=(e,n,r)=>new Promise((i,s)=>{if(r===a.length)return i(d(n+1));let c=a[r];o(e+c,{pathExt:l},(a,o)=>{if(!a&&o)if(t.all)u.push(e+c);else return i(e+c);return i(f(e,n,r+1))})});return n?d(0).then(e=>n(null,e),n):d(0)};n.exports=l,l.sync=(e,t)=>{t=t||{};let{pathEnv:n,pathExt:r,pathExtExe:a}=c(e,t),l=[];for(let s=0;s<n.length;s++){let c=n[s],u=/^".*"$/.test(c)?c.slice(1,-1):c,d=i.join(u,e),f=!u&&/^\.[\\\/]/.test(e)?e.slice(0,2)+d:d;for(let e=0;e<r.length;e++){let n=f+r[e];try{if(o.sync(n,{pathExt:a}))if(t.all)l.push(n);else return n}catch(e){}}}if(t.all&&l.length)return l;if(t.nothrow)return null;throw s(e)}})),lo=e(((exports,t)=>{let n=(e={})=>{let t=e.env||process.env;return(e.platform||process.platform)===`win32`?Object.keys(t).reverse().find(e=>e.toUpperCase()===`PATH`)||`Path`:`PATH`};t.exports=n,t.exports.default=n})),uo=e(((exports,n)=>{let r=t(`path`),i=co(),a=lo();function o(e,t){let n=e.options.env||process.env,o=process.cwd(),s=e.options.cwd!=null,c=s&&process.chdir!==void 0&&!process.chdir.disabled;if(c)try{process.chdir(e.options.cwd)}catch(e){}let l;try{l=i.sync(e.command,{path:n[a({env:n})],pathExt:t?r.delimiter:void 0})}catch(e){}finally{c&&process.chdir(o)}return l&&(l=r.resolve(s?e.options.cwd:``,l)),l}function s(e){return o(e)||o(e,!0)}n.exports=s})),fo=e(((exports,t)=>{let n=/([()\][%!^"`<>&|;, *?])/g;function r(e){return e=e.replace(n,`^$1`),e}function i(e,t){return e=`${e}`,e=e.replace(/(?=(\\+?)?)\1"/g,`$1$1\\"`),e=e.replace(/(?=(\\+?)?)\1$/,`$1$1`),e=`"${e}"`,e=e.replace(n,`^$1`),t&&(e=e.replace(n,`^$1`)),e}t.exports.command=r,t.exports.argument=i})),po=e(((exports,t)=>{t.exports=/^#!(.*)/})),mo=e(((exports,t)=>{let n=po();t.exports=(e=``)=>{let t=e.match(n);if(!t)return null;let[r,i]=t[0].replace(/#! ?/,``).split(` `),a=r.split(`/`).pop();return a===`env`?i:i?`${a} ${i}`:a}})),ho=e(((exports,n)=>{let r=t(`fs`),i=mo();function a(e){let t=Buffer.alloc(150),n;try{n=r.openSync(e,`r`),r.readSync(n,t,0,150,0),r.closeSync(n)}catch(e){}return i(t.toString())}n.exports=a})),go=e(((exports,n)=>{let r=t(`path`),i=uo(),a=fo(),o=ho(),s=process.platform===`win32`,c=/\.(?:com|exe)$/i,l=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function u(e){e.file=i(e);let t=e.file&&o(e.file);return t?(e.args.unshift(e.file),e.command=t,i(e)):e.file}function d(e){if(!s)return e;let t=u(e),n=!c.test(t);if(e.options.forceShell||n){let n=l.test(t);e.command=r.normalize(e.command),e.command=a.command(e.command),e.args=e.args.map(e=>a.argument(e,n)),e.args=[`/d`,`/s`,`/c`,`"${[e.command].concat(e.args).join(` `)}"`],e.command=process.env.comspec||`cmd.exe`,e.options.windowsVerbatimArguments=!0}return e}function f(e,t,n){t&&!Array.isArray(t)&&(n=t,t=null),t=t?t.slice(0):[],n=Object.assign({},n);let r={command:e,args:t,options:n,file:void 0,original:{command:e,args:t}};return n.shell?r:d(r)}n.exports=f})),_o=e(((exports,t)=>{let n=process.platform===`win32`;function r(e,t){return Object.assign(Error(`${t} ${e.command} ENOENT`),{code:`ENOENT`,errno:`ENOENT`,syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function i(e,t){if(!n)return;let r=e.emit;e.emit=function(n,i){if(n===`exit`){let n=a(i,t);if(n)return r.call(e,`error`,n)}return r.apply(e,arguments)}}function a(e,t){return n&&e===1&&!t.file?r(t.original,`spawn`):null}function o(e,t){return n&&e===1&&!t.file?r(t.original,`spawnSync`):null}t.exports={hookChildProcess:i,verifyENOENT:a,verifyENOENTSync:o,notFoundError:r}})),vo=n(e(((exports,n)=>{let r=t(`child_process`),i=go(),a=_o();function o(e,t,n){let o=i(e,t,n),s=r.spawn(o.command,o.args,o.options);return a.hookChildProcess(s,o),s}function s(e,t,n){let o=i(e,t,n),s=r.spawnSync(o.command,o.args,o.options);return s.error=s.error||a.verifyENOENTSync(s.status,o),s}n.exports=o,n.exports.spawn=o,n.exports.sync=s,n.exports._parse=i,n.exports._enoent=a}))(),1);function yo(e={}){let{env:t=process.env,platform:n=process.platform}=e;return n===`win32`?Object.keys(t).reverse().find(e=>e.toUpperCase()===`PATH`)||`Path`:`PATH`}de(x);function bo(e){return e instanceof URL?l(e):e}function xo(e){return{*[Symbol.iterator](){let t=i.resolve(bo(e)),n;for(;n!==t;)yield t,n=t,t=i.resolve(t,`..`)}}}const So=({cwd:e=u.cwd(),path:t=u.env[yo()],preferLocal:n=!0,execPath:r=u.execPath,addExecPath:a=!0}={})=>{let o=i.resolve(bo(e)),s=[],c=t.split(i.delimiter);return n&&Co(s,c,o),a&&wo(s,c,r,o),t===``||t===i.delimiter?`${s.join(i.delimiter)}${t}`:[...s,t].join(i.delimiter)},Co=(e,t,n)=>{for(let r of xo(n)){let n=i.join(r,`node_modules/.bin`);t.includes(n)||e.push(n)}},wo=(e,t,n,r)=>{let a=i.resolve(r,bo(n),`..`);t.includes(a)||e.push(a)},To=({env:e=u.env,...t}={})=>{e={...e};let n=yo({env:e});return t.path=e[n],e[n]=So(t),e},Eo=(e,t,n)=>{let r=n?No:Mo,i=e instanceof Do?{}:{cause:e};return new r(t,i)};var Do=class extends Error{};const Oo=(e,t)=>{Object.defineProperty(e.prototype,`name`,{value:t,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,Ao,{value:!0,writable:!1,enumerable:!1,configurable:!1})},ko=e=>jo(e)&&Ao in e,Ao=Symbol(`isExecaError`),jo=e=>Object.prototype.toString.call(e)===`[object Error]`;var Mo=class extends Error{};Oo(Mo,Mo.name);var No=class extends Error{};Oo(No,No.name);const Po=()=>{let e=Lo-Io+1;return Array.from({length:e},Fo)},Fo=(e,t)=>({name:`SIGRT${t+1}`,number:Io+t,action:`terminate`,description:`Application-specific signal (realtime)`,standard:`posix`}),Io=34,Lo=64,Ro=[{name:`SIGHUP`,number:1,action:`terminate`,description:`Terminal closed`,standard:`posix`},{name:`SIGINT`,number:2,action:`terminate`,description:`User interruption with CTRL-C`,standard:`ansi`},{name:`SIGQUIT`,number:3,action:`core`,description:`User interruption with CTRL-\\`,standard:`posix`},{name:`SIGILL`,number:4,action:`core`,description:`Invalid machine instruction`,standard:`ansi`},{name:`SIGTRAP`,number:5,action:`core`,description:`Debugger breakpoint`,standard:`posix`},{name:`SIGABRT`,number:6,action:`core`,description:`Aborted`,standard:`ansi`},{name:`SIGIOT`,number:6,action:`core`,description:`Aborted`,standard:`bsd`},{name:`SIGBUS`,number:7,action:`core`,description:`Bus error due to misaligned, non-existing address or paging error`,standard:`bsd`},{name:`SIGEMT`,number:7,action:`terminate`,description:`Command should be emulated but is not implemented`,standard:`other`},{name:`SIGFPE`,number:8,action:`core`,description:`Floating point arithmetic error`,standard:`ansi`},{name:`SIGKILL`,number:9,action:`terminate`,description:`Forced termination`,standard:`posix`,forced:!0},{name:`SIGUSR1`,number:10,action:`terminate`,description:`Application-specific signal`,standard:`posix`},{name:`SIGSEGV`,number:11,action:`core`,description:`Segmentation fault`,standard:`ansi`},{name:`SIGUSR2`,number:12,action:`terminate`,description:`Application-specific signal`,standard:`posix`},{name:`SIGPIPE`,number:13,action:`terminate`,description:`Broken pipe or socket`,standard:`posix`},{name:`SIGALRM`,number:14,action:`terminate`,description:`Timeout or timer`,standard:`posix`},{name:`SIGTERM`,number:15,action:`terminate`,description:`Termination`,standard:`ansi`},{name:`SIGSTKFLT`,number:16,action:`terminate`,description:`Stack is empty or overflowed`,standard:`other`},{name:`SIGCHLD`,number:17,action:`ignore`,description:`Child process terminated, paused or unpaused`,standard:`posix`},{name:`SIGCLD`,number:17,action:`ignore`,description:`Child process terminated, paused or unpaused`,standard:`other`},{name:`SIGCONT`,number:18,action:`unpause`,description:`Unpaused`,standard:`posix`,forced:!0},{name:`SIGSTOP`,number:19,action:`pause`,description:`Paused`,standard:`posix`,forced:!0},{name:`SIGTSTP`,number:20,action:`pause`,description:`Paused using CTRL-Z or "suspend"`,standard:`posix`},{name:`SIGTTIN`,number:21,action:`pause`,description:`Background process cannot read terminal input`,standard:`posix`},{name:`SIGBREAK`,number:21,action:`terminate`,description:`User interruption with CTRL-BREAK`,standard:`other`},{name:`SIGTTOU`,number:22,action:`pause`,description:`Background process cannot write to terminal output`,standard:`posix`},{name:`SIGURG`,number:23,action:`ignore`,description:`Socket received out-of-band data`,standard:`bsd`},{name:`SIGXCPU`,number:24,action:`core`,description:`Process timed out`,standard:`bsd`},{name:`SIGXFSZ`,number:25,action:`core`,description:`File too big`,standard:`bsd`},{name:`SIGVTALRM`,number:26,action:`terminate`,description:`Timeout or timer`,standard:`bsd`},{name:`SIGPROF`,number:27,action:`terminate`,description:`Timeout or timer`,standard:`bsd`},{name:`SIGWINCH`,number:28,action:`ignore`,description:`Terminal window size changed`,standard:`bsd`},{name:`SIGIO`,number:29,action:`terminate`,description:`I/O is available`,standard:`other`},{name:`SIGPOLL`,number:29,action:`terminate`,description:`Watched event`,standard:`other`},{name:`SIGINFO`,number:29,action:`ignore`,description:`Request for process information`,standard:`other`},{name:`SIGPWR`,number:30,action:`terminate`,description:`Device running out of power`,standard:`systemv`},{name:`SIGSYS`,number:31,action:`core`,description:`Invalid system call`,standard:`other`},{name:`SIGUNUSED`,number:31,action:`terminate`,description:`Invalid system call`,standard:`other`}],zo=()=>{let e=Po();return[...Ro,...e].map(Bo)},Bo=({name:e,number:t,description:n,action:r,forced:i=!1,standard:a})=>{let{signals:{[e]:o}}=g,s=o!==void 0;return{name:e,number:s?o:t,description:n,supported:s,action:r,forced:i,standard:a}},Vo=()=>{let e=zo();return Object.fromEntries(e.map(Ho))},Ho=({name:e,number:t,description:n,supported:r,action:i,forced:a,standard:o})=>[e,{name:e,number:t,description:n,supported:r,action:i,forced:a,standard:o}],Uo=Vo(),Wo=()=>{let e=zo(),t=Array.from({length:65},(t,n)=>Go(n,e));return Object.assign({},...t)},Go=(e,t)=>{let n=Ko(e,t);if(n===void 0)return{};let{name:r,description:i,supported:a,action:o,forced:s,standard:c}=n;return{[e]:{name:r,number:e,description:i,supported:a,action:o,forced:s,standard:c}}},Ko=(e,t)=>{let n=t.find(({name:t})=>g.signals[t]===e);return n===void 0?t.find(t=>t.number===e):n};Wo();const qo=e=>{let t="option `killSignal`";if(e===0)throw TypeError(`Invalid ${t}: 0 cannot be used.`);return Yo(e,t)},Jo=e=>e===0?e:Yo(e,"`subprocess.kill()`'s argument"),Yo=(e,t)=>{if(Number.isInteger(e))return Xo(e,t);if(typeof e==`string`)return Qo(e,t);throw TypeError(`Invalid ${t} ${String(e)}: it must be a string or an integer.\n${$o()}`)},Xo=(e,t)=>{if(Zo.has(e))return Zo.get(e);throw TypeError(`Invalid ${t} ${e}: this signal integer does not exist.\n${$o()}`)},Zo=(()=>new Map(Object.entries(g.signals).reverse().map(([e,t])=>[t,e])))(),Qo=(e,t)=>{if(e in g.signals)return e;throw e.toUpperCase()in g.signals?TypeError(`Invalid ${t} '${e}': please rename it to '${e.toUpperCase()}'.`):TypeError(`Invalid ${t} '${e}': this signal name does not exist.\n${$o()}`)},$o=()=>`Available signal names: ${es()}.
90
- Available signal numbers: ${ts()}.`,es=()=>Object.keys(g.signals).sort().map(e=>`'${e}'`).join(`, `),ts=()=>[...new Set(Object.values(g.signals).sort((e,t)=>e-t))].join(`, `),ns=e=>Uo[e].description,rs=e=>{if(e===!1)return e;if(e===!0)return os;if(!Number.isFinite(e)||e<0)throw TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e},os=1e3*5,ss=({kill:e,options:{forceKillAfterDelay:t,killSignal:n},onInternalError:r,context:i,controller:a},o,s)=>{let{signal:c,error:l}=cs(o,s,n);ls(l,r);let u=e(c);return us({kill:e,signal:c,forceKillAfterDelay:t,killSignal:n,killResult:u,context:i,controller:a}),u},cs=(e,t,n)=>{let[r=n,i]=jo(e)?[void 0,e]:[e,t];if(typeof r!=`string`&&!Number.isInteger(r))throw TypeError(`The first argument must be an error instance or a signal name string/integer: ${String(r)}`);if(i!==void 0&&!jo(i))throw TypeError(`The second argument is optional. If specified, it must be an error instance: ${i}`);return{signal:Jo(r),error:i}},ls=(e,t)=>{e!==void 0&&t.reject(e)},us=async({kill:e,signal:t,forceKillAfterDelay:n,killSignal:r,killResult:i,context:a,controller:o})=>{t===r&&i&&ds({kill:e,forceKillAfterDelay:n,context:a,controllerSignal:o.signal})},ds=async({kill:e,forceKillAfterDelay:t,context:n,controllerSignal:r})=>{if(t!==!1)try{await ge(t,void 0,{signal:r}),e(`SIGKILL`)&&(n.isForcefullyTerminated??=!0)}catch{}},fs=async(e,t)=>{e.aborted||await T(e,`abort`,{signal:t})},ps=({cancelSignal:e})=>{if(e!==void 0&&Object.prototype.toString.call(e)!==`[object AbortSignal]`)throw Error(`The \`cancelSignal\` option must be an AbortSignal: ${String(e)}`)},ms=({subprocess:e,cancelSignal:t,gracefulCancel:n,context:r,controller:i})=>t===void 0||n?[]:[hs(e,t,r,i)],hs=async(e,t,n,{signal:r})=>{throw await fs(t,r),n.terminationReason??=`cancel`,e.kill(),t.reason},gs=({methodName:e,isSubprocess:t,ipc:n,isConnected:r})=>{_s(e,t,n),vs(e,t,r)},_s=(e,t,n)=>{if(!n)throw Error(`${U(e,t)} can only be used if the \`ipc\` option is \`true\`.`)},vs=(e,t,n)=>{if(!n)throw Error(`${U(e,t)} cannot be used: the ${W(t)} has already exited or disconnected.`)},ys=e=>{throw Error(`${U(`getOneMessage`,e)} could not complete: the ${W(e)} exited or disconnected.`)},bs=e=>{throw Error(`${U(`sendMessage`,e)} failed: the ${W(e)} is sending a message too, instead of listening to incoming messages.
91
- This can be fixed by both sending a message and listening to incoming messages at the same time:
92
-
93
- const [receivedMessage] = await Promise.all([
94
- ${U(`getOneMessage`,e)},
95
- ${U(`sendMessage`,e,`message, {strict: true}`)},
96
- ]);`)},xs=(e,t)=>Error(`${U(`sendMessage`,t)} failed when sending an acknowledgment response to the ${W(t)}.`,{cause:e}),Ss=e=>{throw Error(`${U(`sendMessage`,e)} failed: the ${W(e)} is not listening to incoming messages.`)},Cs=e=>{throw Error(`${U(`sendMessage`,e)} failed: the ${W(e)} exited without listening to incoming messages.`)},ws=()=>Error(`\`cancelSignal\` aborted: the ${W(!0)} disconnected.`),Ts=()=>{throw Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")},Es=({error:e,methodName:t,isSubprocess:n})=>{if(e.code===`EPIPE`)throw Error(`${U(t,n)} cannot be used: the ${W(n)} is disconnecting.`,{cause:e})},Ds=({error:e,methodName:t,isSubprocess:n,message:r})=>{if(Os(e))throw Error(`${U(t,n)}'s argument type is invalid: the message cannot be serialized: ${String(r)}.`,{cause:e})},Os=({code:e,message:t})=>ks.has(e)||As.some(e=>t.includes(e)),ks=new Set([`ERR_MISSING_ARGS`,`ERR_INVALID_ARG_TYPE`]),As=[`could not be cloned`,`circular structure`,`call stack size exceeded`],U=(e,t,n=``)=>e===`cancelSignal`?"`cancelSignal`'s `controller.abort()`":`${js(t)}${e}(${n})`,js=e=>e?``:`subprocess.`,W=e=>e?`parent process`:`subprocess`,Ms=e=>{e.connected&&e.disconnect()},Ns=()=>{let e={},t=new Promise((t,n)=>{Object.assign(e,{resolve:t,reject:n})});return Object.assign(t,e)},Ps=(e,t=`stdin`)=>{let{options:n,fileDescriptors:r}=Is.get(e),i=Ls(r,t,!0),a=e.stdio[i];if(a===null)throw TypeError(Bs(i,t,n,!0));return a},Fs=(e,t=`stdout`)=>{let{options:n,fileDescriptors:r}=Is.get(e),i=Ls(r,t,!1),a=i===`all`?e.all:e.stdio[i];if(a==null)throw TypeError(Bs(i,t,n,!1));return a},Is=new WeakMap,Ls=(e,t,n)=>{let r=Rs(t,n);return zs(r,t,n,e),r},Rs=(e,t)=>{let n=sa(e);if(n!==void 0)return n;let{validOptions:r,defaultValue:i}=t?{validOptions:`"stdin"`,defaultValue:`stdin`}:{validOptions:`"stdout", "stderr", "all"`,defaultValue:`stdout`};throw TypeError(`"${Us(t)}" must not be "${e}".
97
- It must be ${r} or "fd3", "fd4" (and so on).
98
- It is optional and defaults to "${i}".`)},zs=(e,t,n,r)=>{let i=r[Hs(e)];if(i===void 0)throw TypeError(`"${Us(n)}" must not be ${t}. That file descriptor does not exist.
99
- Please set the "stdio" option to ensure that file descriptor exists.`);if(i.direction===`input`&&!n)throw TypeError(`"${Us(n)}" must not be ${t}. It must be a readable stream, not writable.`);if(i.direction!==`input`&&n)throw TypeError(`"${Us(n)}" must not be ${t}. It must be a writable stream, not readable.`)},Bs=(e,t,n,r)=>{if(e===`all`&&!n.all)return`The "all" option must be true to use "from: 'all'".`;let{optionName:i,optionValue:a}=Vs(e,n);return`The "${i}: ${Ws(a)}" option is incompatible with using "${Us(r)}: ${Ws(t)}".
100
- Please set this option with "pipe" instead.`},Vs=(e,{stdin:t,stdout:n,stderr:r,stdio:i})=>{let a=Hs(e);return a===0&&t!==void 0?{optionName:`stdin`,optionValue:t}:a===1&&n!==void 0?{optionName:`stdout`,optionValue:n}:a===2&&r!==void 0?{optionName:`stderr`,optionValue:r}:{optionName:`stdio[${a}]`,optionValue:i[a]}},Hs=e=>e===`all`?1:e,Us=e=>e?`to`:`from`,Ws=e=>typeof e==`string`?`'${e}'`:typeof e==`number`?`${e}`:`Stream`,Gs=(e,t,n)=>{let r=e.getMaxListeners();r===0||r===1/0||(e.setMaxListeners(r+t),ve(n,()=>{e.setMaxListeners(e.getMaxListeners()-t)}))},Ks=(e,t)=>{t&&qs(e)},qs=e=>{e.refCounted()},Js=(e,t)=>{t&&Ys(e)},Ys=e=>{e.unrefCounted()},Xs=(e,t)=>{t&&(Ys(e),Ys(e))},Zs=(e,t)=>{t&&(qs(e),qs(e))},Qs=async({anyProcess:e,channel:t,isSubprocess:n,ipcEmitter:r},i)=>{if(lc(i)||Ac(i))return;ec.has(e)||ec.set(e,[]);let a=ec.get(e);if(a.push(i),!(a.length>1))for(;a.length>0;){await _c(e,r,i),await me.yield();let o=await cc({wrappedMessage:a[0],anyProcess:e,channel:t,isSubprocess:n,ipcEmitter:r});a.shift(),r.emit(`message`,o),r.emit(`message:done`)}},$s=async({anyProcess:e,channel:t,isSubprocess:n,ipcEmitter:r,boundOnMessage:i})=>{Mc();let a=ec.get(e);for(;a?.length>0;)await T(r,`message:done`);e.removeListener(`message`,i),Zs(t,n),r.connected=!1,r.emit(`disconnect`)},ec=new WeakMap,tc=(e,t,n)=>{if(nc.has(e))return nc.get(e);let r=new _e;return r.connected=!0,nc.set(e,r),rc({ipcEmitter:r,anyProcess:e,channel:t,isSubprocess:n}),r},nc=new WeakMap,rc=({ipcEmitter:e,anyProcess:t,channel:n,isSubprocess:r})=>{let i=Qs.bind(void 0,{anyProcess:t,channel:n,isSubprocess:r,ipcEmitter:e});t.on(`message`,i),t.once(`disconnect`,$s.bind(void 0,{anyProcess:t,channel:n,isSubprocess:r,ipcEmitter:e,boundOnMessage:i})),Xs(n,r)},ic=e=>{let t=nc.get(e);return t===void 0?e.channel!==null:t.connected},ac=({anyProcess:e,channel:t,isSubprocess:n,message:r,strict:i})=>{if(!i)return r;let a=tc(e,t,n),o=yc(e,a);return{id:oc++,type:pc,message:r,hasListeners:o}};let oc=0n;const sc=(e,t)=>{if(!(t?.type!==pc||t.hasListeners))for(let{id:t}of e)t!==void 0&&dc[t].resolve({isDeadlock:!0,hasListeners:!1})},cc=async({wrappedMessage:e,anyProcess:t,channel:n,isSubprocess:r,ipcEmitter:i})=>{if(e?.type!==pc||!t.connected)return e;let{id:a,message:o}=e,s={id:a,type:mc,message:yc(t,i)};try{await xc({anyProcess:t,channel:n,isSubprocess:r,ipc:!0},s)}catch(e){i.emit(`strict:error`,e)}return o},lc=e=>{if(e?.type!==mc)return!1;let{id:t,message:n}=e;return dc[t]?.resolve({isDeadlock:!1,hasListeners:n}),!0},uc=async(e,t,n)=>{if(e?.type!==pc)return;let r=Ns();dc[e.id]=r;let i=new AbortController;try{let{isDeadlock:e,hasListeners:a}=await Promise.race([r,fc(t,n,i)]);e&&bs(n),a||Ss(n)}finally{i.abort(),delete dc[e.id]}},dc={},fc=async(e,t,{signal:n})=>{Gs(e,1,n),await T(e,`disconnect`,{signal:n}),Cs(t)},pc=`execa:ipc:request`,mc=`execa:ipc:response`,hc=(e,t,n)=>{vc.has(e)||vc.set(e,new Set);let r=vc.get(e),i=Ns(),a=n?t.id:void 0,o={onMessageSent:i,id:a};return r.add(o),{outgoingMessages:r,outgoingMessage:o}},gc=({outgoingMessages:e,outgoingMessage:t})=>{e.delete(t),t.onMessageSent.resolve()},_c=async(e,t,n)=>{for(;!yc(e,t)&&vc.get(e)?.size>0;){let t=[...vc.get(e)];sc(t,n),await Promise.all(t.map(({onMessageSent:e})=>e))}},vc=new WeakMap,yc=(e,t)=>t.listenerCount(`message`)>bc(e),bc=e=>Is.has(e)&&!fa(Is.get(e).options.buffer,`ipc`)?1:0,xc=({anyProcess:e,channel:t,isSubprocess:n,ipc:r},i,{strict:a=!1}={})=>{let o=`sendMessage`;return gs({methodName:o,isSubprocess:n,ipc:r,isConnected:e.connected}),Sc({anyProcess:e,channel:t,methodName:o,isSubprocess:n,message:i,strict:a})},Sc=async({anyProcess:e,channel:t,methodName:n,isSubprocess:r,message:i,strict:a})=>{let o=ac({anyProcess:e,channel:t,isSubprocess:r,message:i,strict:a}),s=hc(e,o,a);try{await Cc({anyProcess:e,methodName:n,isSubprocess:r,wrappedMessage:o,message:i})}catch(t){throw Ms(e),t}finally{gc(s)}},Cc=async({anyProcess:e,methodName:t,isSubprocess:n,wrappedMessage:r,message:i})=>{let a=wc(e);try{await Promise.all([uc(r,e,n),a(r)])}catch(e){throw Es({error:e,methodName:t,isSubprocess:n}),Ds({error:e,methodName:t,isSubprocess:n,message:i}),e}},wc=e=>{if(Tc.has(e))return Tc.get(e);let t=de(e.send.bind(e));return Tc.set(e,t),t},Tc=new WeakMap,Ec=(e,t)=>{let n=`cancelSignal`;return vs(n,!1,e.connected),Cc({anyProcess:e,methodName:n,isSubprocess:!1,wrappedMessage:{type:jc,message:t},message:t})},Dc=async({anyProcess:e,channel:t,isSubprocess:n,ipc:r})=>(await Oc({anyProcess:e,channel:t,isSubprocess:n,ipc:r}),Nc.signal),Oc=async({anyProcess:e,channel:t,isSubprocess:n,ipc:r})=>{if(!kc){if(kc=!0,!r){Ts();return}if(t===null){Mc();return}tc(e,t,n),await me.yield()}};let kc=!1;const Ac=e=>e?.type===jc?(Nc.abort(e.message),!0):!1,jc=`execa:ipc:cancel`,Mc=()=>{Nc.abort(ws())},Nc=new AbortController,Pc=({gracefulCancel:e,cancelSignal:t,ipc:n,serialization:r})=>{if(e){if(t===void 0)throw Error("The `cancelSignal` option must be defined when setting the `gracefulCancel` option.");if(!n)throw Error("The `ipc` option cannot be false when setting the `gracefulCancel` option.");if(r===`json`)throw Error("The `serialization` option cannot be 'json' when setting the `gracefulCancel` option.")}},Fc=({subprocess:e,cancelSignal:t,gracefulCancel:n,forceKillAfterDelay:r,context:i,controller:a})=>n?[Ic({subprocess:e,cancelSignal:t,forceKillAfterDelay:r,context:i,controller:a})]:[],Ic=async({subprocess:e,cancelSignal:t,forceKillAfterDelay:n,context:r,controller:{signal:i}})=>{await fs(t,i);let a=Lc(t);throw await Ec(e,a),ds({kill:e.kill,forceKillAfterDelay:n,context:r,controllerSignal:i}),r.terminationReason??=`gracefulCancel`,t.reason},Lc=({reason:e})=>{if(!(e instanceof DOMException))return e;let t=Error(e.message);return Object.defineProperty(t,`stack`,{value:e.stack,enumerable:!1,configurable:!0,writable:!0}),t},Rc=({timeout:e})=>{if(e!==void 0&&(!Number.isFinite(e)||e<0))throw TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)},zc=(e,t,n,r)=>t===0||t===void 0?[]:[Bc(e,t,n,r)],Bc=async(e,t,n,{signal:r})=>{throw await ge(t,void 0,{signal:r}),n.terminationReason??=`timeout`,e.kill(),new Do},Vc=({options:e})=>{if(e.node===!1)throw TypeError('The "node" option cannot be false with `execaNode()`.');return{options:{...e,node:!0}}},Hc=(e,t,{node:n=!1,nodePath:r=f,nodeOptions:a=d.filter(e=>!e.startsWith(`--inspect`)),cwd:o,execPath:s,...c})=>{if(s!==void 0)throw TypeError(`The "execPath" option has been removed. Please use the "nodePath" option instead.`);let l=Ci(r,`The "nodePath" option`),u=i.resolve(o,l),p={...c,nodePath:u,node:n,cwd:o};if(!n)return[e,t,p];if(i.basename(e,`.exe`)===`node`)throw TypeError(`When the "node" option is true, the first argument does not need to be "node".`);return[u,[...a,e,...t],{ipc:!0,...p,shell:!1}]},Uc=({ipcInput:e,ipc:t,serialization:n})=>{if(e!==void 0){if(!t)throw Error("The `ipcInput` option cannot be set unless the `ipc` option is `true`.");Wc[n](e)}},Wc={advanced:e=>{try{xe(e)}catch(e){throw Error("The `ipcInput` option is not serializable with a structured clone.",{cause:e})}},json:e=>{try{JSON.stringify(e)}catch(e){throw Error("The `ipcInput` option is not serializable with JSON.",{cause:e})}}},Gc=async(e,t)=>{t!==void 0&&await e.sendMessage(t)},Kc=({encoding:e})=>{if(Yc.has(e))return;let t=Xc(e);if(t!==void 0)throw TypeError(`Invalid option \`encoding: ${Qc(e)}\`.
101
- Please rename it to ${Qc(t)}.`);let n=[...Yc].map(e=>Qc(e)).join(`, `);throw TypeError(`Invalid option \`encoding: ${Qc(e)}\`.
102
- Please rename it to one of: ${n}.`)},qc=new Set([`utf8`,`utf16le`]),Jc=new Set([`buffer`,`hex`,`base64`,`base64url`,`latin1`,`ascii`]),Yc=new Set([...qc,...Jc]),Xc=e=>{if(e===null)return`buffer`;if(typeof e!=`string`)return;let t=e.toLowerCase();if(t in Zc)return Zc[t];if(Yc.has(t))return t},Zc={"utf-8":`utf8`,"utf-16le":`utf16le`,"ucs-2":`utf16le`,ucs2:`utf16le`,binary:`latin1`},Qc=e=>typeof e==`string`?`"${e}"`:String(e),$c=(e=el())=>{let t=Ci(e,`The "cwd" option`);return i.resolve(t)},el=()=>{try{return u.cwd()}catch(e){throw e.message=`The current directory does not exist.\n${e.message}`,e}},tl=(e,t)=>{if(t===el())return e;let n;try{n=ae(t)}catch(n){return`The "cwd" option is invalid: ${t}.\n${n.message}\n${e}`}return n.isDirectory()?e:`The "cwd" option is not a directory: ${t}.\n${e}`},nl=(e,t,n)=>{n.cwd=$c(n.cwd);let[r,a,o]=Hc(e,t,n),{command:s,args:c,options:l}=vo.default._parse(r,a,o),d=$i(l),f=rl(d);return Rc(f),Kc(f),Uc(f),ps(f),Pc(f),f.shell=Ei(f.shell),f.env=il(f),f.killSignal=qo(f.killSignal),f.forceKillAfterDelay=rs(f.forceKillAfterDelay),f.lines=f.lines.map((e,t)=>e&&!Jc.has(f.encoding)&&f.buffer[t]),u.platform===`win32`&&i.basename(s,`.exe`)===`cmd`&&c.unshift(`/q`),{file:s,commandArguments:c,options:f}},rl=({extendEnv:e=!0,preferLocal:t=!1,cwd:n,localDir:r=n,encoding:i=`utf8`,reject:a=!0,cleanup:o=!0,all:s=!1,windowsHide:c=!0,killSignal:l=`SIGTERM`,forceKillAfterDelay:u=!0,gracefulCancel:d=!1,ipcInput:f,ipc:p=f!==void 0||d,serialization:m=`advanced`,...h})=>({...h,extendEnv:e,preferLocal:t,cwd:n,localDirectory:r,encoding:i,reject:a,cleanup:o,all:s,windowsHide:c,killSignal:l,forceKillAfterDelay:u,gracefulCancel:d,ipcInput:f,ipc:p,serialization:m}),il=({env:e,extendEnv:t,preferLocal:n,node:r,localDirectory:i,nodePath:a})=>{let o=t?{...u.env,...e}:e;return n||r?To({env:o,cwd:i,execPath:a,preferLocal:n,addExecPath:r}):o},al=(e,t,n)=>n.shell&&t.length>0?[[e,...t].join(` `),[],n]:[e,t,n];function ol(e){if(typeof e==`string`)return sl(e);if(!(ArrayBuffer.isView(e)&&e.BYTES_PER_ELEMENT===1))throw Error(`Input must be a string or a Uint8Array`);return cl(e)}const sl=e=>e.at(-1)===ll?e.slice(0,e.at(-2)===dl?-2:-1):e,cl=e=>e.at(-1)===ul?e.subarray(0,e.at(-2)===fl?-2:-1):e,ll=`
103
- `,ul=`
104
- `.codePointAt(0),dl=`\r`,fl=`\r`.codePointAt(0);function pl(e,{checkOpen:t=!0}={}){return typeof e==`object`&&!!e&&(e.writable||e.readable||!t||e.writable===void 0&&e.readable===void 0)&&typeof e.pipe==`function`}function ml(e,{checkOpen:t=!0}={}){return pl(e,{checkOpen:t})&&(e.writable||!t)&&typeof e.write==`function`&&typeof e.end==`function`&&typeof e.writable==`boolean`&&typeof e.writableObjectMode==`boolean`&&typeof e.destroy==`function`&&typeof e.destroyed==`boolean`}function hl(e,{checkOpen:t=!0}={}){return pl(e,{checkOpen:t})&&(e.readable||!t)&&typeof e.read==`function`&&typeof e.readable==`boolean`&&typeof e.readableObjectMode==`boolean`&&typeof e.destroy==`function`&&typeof e.destroyed==`boolean`}function gl(e,t){return ml(e,t)&&hl(e,t)}const _l=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype);var vl=class{#t;#n;#r=!1;#e=void 0;constructor(e,t){this.#t=e,this.#n=t}next(){let e=()=>this.#s();return this.#e=this.#e?this.#e.then(e,e):e(),this.#e}return(e){let t=()=>this.#i(e);return this.#e?this.#e.then(t,t):t()}async#s(){if(this.#r)return{done:!0,value:void 0};let e;try{e=await this.#t.read()}catch(e){throw this.#e=void 0,this.#r=!0,this.#t.releaseLock(),e}return e.done&&(this.#e=void 0,this.#r=!0,this.#t.releaseLock()),e}async#i(e){if(this.#r)return{done:!0,value:e};if(this.#r=!0,!this.#n){let t=this.#t.cancel(e);return this.#t.releaseLock(),await t,{done:!0,value:e}}return this.#t.releaseLock(),{done:!0,value:e}}};const yl=Symbol();function bl(){return this[yl].next()}Object.defineProperty(bl,`name`,{value:`next`});function xl(e){return this[yl].return(e)}Object.defineProperty(xl,`name`,{value:`return`});const Sl=Object.create(_l,{next:{enumerable:!0,configurable:!0,writable:!0,value:bl},return:{enumerable:!0,configurable:!0,writable:!0,value:xl}});function Cl({preventCancel:e=!1}={}){let t=this.getReader(),n=new vl(t,e),r=Object.create(Sl);return r[yl]=n,r}const wl=e=>{if(hl(e,{checkOpen:!1})&&Ol.on!==void 0)return El(e);if(typeof e?.[Symbol.asyncIterator]==`function`)return e;if(Tl.call(e)===`[object ReadableStream]`)return Cl.call(e);throw TypeError(`The first argument must be a Readable, a ReadableStream, or an async iterable.`)},{toString:Tl}=Object.prototype,El=async function*(e){let t=new AbortController,n={};Dl(e,t,n);try{for await(let[n]of Ol.on(e,`data`,{signal:t.signal}))yield n}catch(e){if(n.error!==void 0)throw n.error;if(!t.signal.aborted)throw e}finally{e.destroy()}},Dl=async(e,t,n)=>{try{await Ol.finished(e,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(e){n.error=e}finally{t.abort()}},Ol={},kl=async(e,{init:t,convertChunk:n,getSize:r,truncateChunk:i,addChunk:a,getFinalChunk:o,finalize:s},{maxBuffer:c=1/0}={})=>{let l=wl(e),u=t();u.length=0;try{for await(let e of l){let t=Nl(e),o=n[t](e,u);jl({convertedChunk:o,state:u,getSize:r,truncateChunk:i,addChunk:a,maxBuffer:c})}return Al({state:u,convertChunk:n,getSize:r,truncateChunk:i,addChunk:a,getFinalChunk:o,maxBuffer:c}),s(u)}catch(e){let t=typeof e==`object`&&e?e:Error(e);throw t.bufferedData=s(u),t}},Al=({state:e,getSize:t,truncateChunk:n,addChunk:r,getFinalChunk:i,maxBuffer:a})=>{let o=i(e);o!==void 0&&jl({convertedChunk:o,state:e,getSize:t,truncateChunk:n,addChunk:r,maxBuffer:a})},jl=({convertedChunk:e,state:t,getSize:n,truncateChunk:r,addChunk:i,maxBuffer:a})=>{let o=n(e),s=t.length+o;if(s<=a){Ml(e,t,i,s);return}let c=r(e,a-t.length);throw c!==void 0&&Ml(c,t,i,a),new Fl},Ml=(e,t,n,r)=>{t.contents=n(e,t,r),t.length=r},Nl=e=>{let t=typeof e;if(t===`string`)return`string`;if(t!==`object`||e===null)return`others`;if(globalThis.Buffer?.isBuffer(e))return`buffer`;let n=Pl.call(e);return n===`[object ArrayBuffer]`?`arrayBuffer`:n===`[object DataView]`?`dataView`:Number.isInteger(e.byteLength)&&Number.isInteger(e.byteOffset)&&Pl.call(e.buffer)===`[object ArrayBuffer]`?`typedArray`:`others`},{toString:Pl}=Object.prototype;var Fl=class extends Error{name=`MaxBufferError`;constructor(){super(`maxBuffer exceeded`)}};const Il=e=>e,Ll=()=>void 0,Rl=({contents:e})=>e,zl=e=>{throw Error(`Streams in object mode are not supported: ${String(e)}`)},Bl=e=>e.length;async function Vl(e,t){return kl(e,Hl,t)}const Hl={init:()=>({contents:[]}),convertChunk:{string:Il,buffer:Il,arrayBuffer:Il,dataView:Il,typedArray:Il,others:Il},getSize:()=>1,truncateChunk:Ll,addChunk:(e,{contents:t})=>(t.push(e),t),getFinalChunk:Ll,finalize:Rl};async function Ul(e,t){return kl(e,ru,t)}const Wl=()=>({contents:new ArrayBuffer(0)}),Gl=e=>Kl.encode(e),Kl=new TextEncoder,ql=e=>new Uint8Array(e),Jl=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),Yl=(e,t)=>e.slice(0,t),Xl=(e,{contents:t,length:n},r)=>{let i=nu()?Ql(t,r):Zl(t,r);return new Uint8Array(i).set(e,n),i},Zl=(e,t)=>{if(t<=e.byteLength)return e;let n=new ArrayBuffer($l(t));return new Uint8Array(n).set(new Uint8Array(e),0),n},Ql=(e,t)=>{if(t<=e.maxByteLength)return e.resize(t),e;let n=new ArrayBuffer(t,{maxByteLength:$l(t)});return new Uint8Array(n).set(new Uint8Array(e),0),n},$l=e=>eu**Math.ceil(Math.log(e)/Math.log(eu)),eu=2,tu=({contents:e,length:t})=>nu()?e:e.slice(0,t),nu=()=>`resize`in ArrayBuffer.prototype,ru={init:Wl,convertChunk:{string:Gl,buffer:ql,arrayBuffer:ql,dataView:Jl,typedArray:Jl,others:zl},getSize:Bl,truncateChunk:Yl,addChunk:Xl,getFinalChunk:Ll,finalize:tu};async function iu(e,t){return kl(e,su,t)}const au=()=>({contents:``,textDecoder:new TextDecoder}),ou=(e,{textDecoder:t})=>t.decode(e,{stream:!0}),su={init:au,convertChunk:{string:Il,buffer:ou,arrayBuffer:ou,dataView:ou,typedArray:ou,others:zl},getSize:Bl,truncateChunk:(e,t)=>e.slice(0,t),addChunk:(e,{contents:t})=>t+e,getFinalChunk:({textDecoder:e})=>{let t=e.decode();return t===``?void 0:t},finalize:Rl},cu=({error:e,stream:t,readableObjectMode:n,lines:r,encoding:i,fdNumber:a})=>{if(!(e instanceof Fl))throw e;if(a===`all`)return e;let o=lu(n,r,i);throw e.maxBufferInfo={fdNumber:a,unit:o},t.destroy(),e},lu=(e,t,n)=>e?`objects`:t?`lines`:n===`buffer`?`bytes`:`characters`,uu=(e,t,n)=>{if(t.length!==n)return;let r=new Fl;throw r.maxBufferInfo={fdNumber:`ipc`},r},du=(e,t)=>{let{streamName:n,threshold:r,unit:i}=fu(e,t);return`Command's ${n} was larger than ${r} ${i}`},fu=(e,t)=>{if(e?.maxBufferInfo===void 0)return{streamName:`output`,threshold:t[1],unit:`bytes`};let{maxBufferInfo:{fdNumber:n,unit:r}}=e;delete e.maxBufferInfo;let i=fa(t,n);return n===`ipc`?{streamName:`IPC output`,threshold:i,unit:`messages`}:{streamName:Qi(n),threshold:i,unit:r}},pu=(e,t,n)=>e?.code===`ENOBUFS`&&t!==null&&t.some(e=>e!==null&&e.length>hu(n)),mu=(e,t,n)=>{if(!t)return e;let r=hu(n);return e.length>r?e.slice(0,r):e},hu=([,e])=>e,gu=({stdio:e,all:t,ipcOutput:n,originalError:r,signal:i,signalDescription:a,exitCode:o,escapedCommand:s,timedOut:c,isCanceled:l,isGracefullyCanceled:u,isMaxBuffer:d,isForcefullyTerminated:f,forceKillAfterDelay:p,killSignal:m,maxBuffer:h,timeout:g,cwd:_})=>{let v=r?.code,y=_u({originalError:r,timedOut:c,timeout:g,isMaxBuffer:d,maxBuffer:h,errorCode:v,signal:i,signalDescription:a,exitCode:o,isCanceled:l,isGracefullyCanceled:u,isForcefullyTerminated:f,forceKillAfterDelay:p,killSignal:m}),b=yu(r,_),x=b===void 0?``:`\n${b}`,S=`${y}: ${s}${x}`,C=t===void 0?[e[2],e[1]]:[t],w=[S,...C,...e.slice(3),n.map(e=>bu(e)).join(`
105
- `)].map(e=>xa(ol(xu(e)))).filter(Boolean).join(`
106
-
107
- `);return{originalMessage:b,shortMessage:S,message:w}},_u=({originalError:e,timedOut:t,timeout:n,isMaxBuffer:r,maxBuffer:i,errorCode:a,signal:o,signalDescription:s,exitCode:c,isCanceled:l,isGracefullyCanceled:u,isForcefullyTerminated:d,forceKillAfterDelay:f,killSignal:p})=>{let m=vu(d,f);return t?`Command timed out after ${n} milliseconds${m}`:u?o===void 0?`Command was gracefully canceled with exit code ${c}`:d?`Command was gracefully canceled${m}`:`Command was gracefully canceled with ${o} (${s})`:l?`Command was canceled${m}`:r?`${du(e,i)}${m}`:a===void 0?d?`Command was killed with ${p} (${ns(p)})${m}`:o===void 0?c===void 0?`Command failed`:`Command failed with exit code ${c}`:`Command was killed with ${o} (${s})`:`Command failed with ${a}${m}`},vu=(e,t)=>e?` and was forcefully terminated after ${t} milliseconds`:``,yu=(e,t)=>{if(e instanceof Do)return;let n=ko(e)?e.originalMessage:String(e?.message??e),r=xa(tl(n,t));return r===``?void 0:r},bu=e=>typeof e==`string`?e:ue(e),xu=e=>Array.isArray(e)?e.map(e=>ol(Su(e))).filter(Boolean).join(`
108
- `):Su(e),Su=e=>typeof e==`string`?e:V(e)?Pi(e):``,Cu=({command:e,escapedCommand:t,stdio:n,all:r,ipcOutput:i,options:{cwd:a},startTime:o})=>Du({command:e,escapedCommand:t,cwd:a,durationMs:ro(o),failed:!1,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isTerminated:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,exitCode:0,stdout:n[1],stderr:n[2],all:r,stdio:n,ipcOutput:i,pipedFrom:[]}),wu=({error:e,command:t,escapedCommand:n,fileDescriptors:r,options:i,startTime:a,isSync:o})=>Tu({error:e,command:t,escapedCommand:n,startTime:a,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,stdio:Array.from({length:r.length}),ipcOutput:[],options:i,isSync:o}),Tu=({error:e,command:t,escapedCommand:n,startTime:r,timedOut:i,isCanceled:a,isGracefullyCanceled:o,isMaxBuffer:s,isForcefullyTerminated:c,exitCode:l,signal:u,stdio:d,all:f,ipcOutput:p,options:{timeoutDuration:m,timeout:h=m,forceKillAfterDelay:g,killSignal:_,cwd:v,maxBuffer:y},isSync:b})=>{let{exitCode:x,signal:S,signalDescription:C}=Ou(l,u),{originalMessage:w,shortMessage:ee,message:te}=gu({stdio:d,all:f,ipcOutput:p,originalError:e,signal:S,signalDescription:C,exitCode:x,escapedCommand:n,timedOut:i,isCanceled:a,isGracefullyCanceled:o,isMaxBuffer:s,isForcefullyTerminated:c,forceKillAfterDelay:g,killSignal:_,maxBuffer:y,timeout:h,cwd:v}),ne=Eo(e,te,b);return Object.assign(ne,Eu({error:ne,command:t,escapedCommand:n,startTime:r,timedOut:i,isCanceled:a,isGracefullyCanceled:o,isMaxBuffer:s,isForcefullyTerminated:c,exitCode:x,signal:S,signalDescription:C,stdio:d,all:f,ipcOutput:p,cwd:v,originalMessage:w,shortMessage:ee})),ne},Eu=({error:e,command:t,escapedCommand:n,startTime:r,timedOut:i,isCanceled:a,isGracefullyCanceled:o,isMaxBuffer:s,isForcefullyTerminated:c,exitCode:l,signal:u,signalDescription:d,stdio:f,all:p,ipcOutput:m,cwd:h,originalMessage:g,shortMessage:_})=>Du({shortMessage:_,originalMessage:g,command:t,escapedCommand:n,cwd:h,durationMs:ro(r),failed:!0,timedOut:i,isCanceled:a,isGracefullyCanceled:o,isTerminated:u!==void 0,isMaxBuffer:s,isForcefullyTerminated:c,exitCode:l,signal:u,signalDescription:d,code:e.cause?.code,stdout:f[1],stderr:f[2],all:p,stdio:f,ipcOutput:m,pipedFrom:[]}),Du=e=>Object.fromEntries(Object.entries(e).filter(([,e])=>e!==void 0)),Ou=(e,t)=>{let n=e===null?void 0:e,r=t===null?void 0:t,i=r===void 0?void 0:ns(t);return{exitCode:n,signal:r,signalDescription:i}},ku=e=>Number.isFinite(e)?e:0;function Au(e){return{days:Math.trunc(e/864e5),hours:Math.trunc(e/36e5%24),minutes:Math.trunc(e/6e4%60),seconds:Math.trunc(e/1e3%60),milliseconds:Math.trunc(e%1e3),microseconds:Math.trunc(ku(e*1e3)%1e3),nanoseconds:Math.trunc(ku(e*1e6)%1e3)}}function ju(e){return{days:e/86400000n,hours:e/3600000n%24n,minutes:e/60000n%60n,seconds:e/1000n%60n,milliseconds:e%1000n,microseconds:0n,nanoseconds:0n}}function Mu(e){switch(typeof e){case`number`:if(Number.isFinite(e))return Au(e);break;case`bigint`:return ju(e)}throw TypeError(`Expected a finite number or bigint`)}const Nu=e=>e===0||e===0n,Pu=(e,t)=>t===1||t===1n?e:`${e}s`,Fu=24n*60n*60n*1000n;function Iu(e,t){let n=typeof e==`bigint`;if(!n&&!Number.isFinite(e))throw TypeError(`Expected a finite number or bigint`);t={...t};let r=e<0?`-`:``;e=e<0?-e:e,t.colonNotation&&(t.compact=!1,t.formatSubMilliseconds=!1,t.separateMilliseconds=!1,t.verbose=!1),t.compact&&(t.unitCount=1,t.secondsDecimalDigits=0,t.millisecondsDecimalDigits=0);let i=[],a=(e,t)=>{let n=Math.floor(e*10**t+1e-7);return(Math.round(n)/10**t).toFixed(t)},o=(e,n,r,a)=>{if(!((i.length===0||!t.colonNotation)&&Nu(e)&&!(t.colonNotation&&r===`m`))){if(a??=String(e),t.colonNotation){let e=a.includes(`.`)?a.split(`.`)[0].length:a.length,t=i.length>0?2:1;a=`0`.repeat(Math.max(0,t-e))+a}else a+=t.verbose?` `+Pu(n,e):r;i.push(a)}},s=Mu(e),c=BigInt(s.days);if(t.hideYearAndDays?o(BigInt(c)*24n+BigInt(s.hours),`hour`,`h`):(t.hideYear?o(c,`day`,`d`):(o(c/365n,`year`,`y`),o(c%365n,`day`,`d`)),o(Number(s.hours),`hour`,`h`)),o(Number(s.minutes),`minute`,`m`),!t.hideSeconds)if(t.separateMilliseconds||t.formatSubMilliseconds||!t.colonNotation&&e<1e3&&!t.subSecondsAsDecimals){let e=Number(s.seconds),n=Number(s.milliseconds),r=Number(s.microseconds),i=Number(s.nanoseconds);if(o(e,`second`,`s`),t.formatSubMilliseconds)o(n,`millisecond`,`ms`),o(r,`microsecond`,`µs`),o(i,`nanosecond`,`ns`);else{let e=n+r/1e3+i/1e6,a=typeof t.millisecondsDecimalDigits==`number`?t.millisecondsDecimalDigits:0,s=a?e.toFixed(a):e>=1?Math.round(e):Math.ceil(e);o(Number.parseFloat(s),`millisecond`,`ms`,s)}}else{let r=(n?Number(e%Fu):e)/1e3%60,i=typeof t.secondsDecimalDigits==`number`?t.secondsDecimalDigits:1,s=a(r,i),c=t.keepDecimalsOnWholeSeconds?s:s.replace(/\.0+$/,``);o(Number.parseFloat(c),`second`,`s`,c)}if(i.length===0)return r+`0`+(t.verbose?` milliseconds`:`ms`);let l=t.colonNotation?`:`:` `;return typeof t.unitCount==`number`&&(i=i.slice(0,Math.max(t.unitCount,1))),r+i.join(l)}const Lu=(e,t)=>{e.failed&&Ga({type:`error`,verboseMessage:e.shortMessage,verboseInfo:t,result:e})},Ru=(e,t)=>{pa(t)&&(Lu(e,t),zu(e,t))},zu=(e,t)=>{let n=`(done in ${Iu(e.durationMs)})`;Ga({type:`duration`,verboseMessage:n,verboseInfo:t,result:e})},Bu=(e,t,{reject:n})=>{if(Ru(e,t),e.failed&&n)throw e;return e},Vu=(e,t)=>Xu(e)?`asyncGenerator`:Zu(e)?`generator`:$u(e)?`fileUrl`:td(e)?`filePath`:cd(e)?`webStream`:pl(e,{checkOpen:!1})?`native`:V(e)?`uint8Array`:ud(e)?`asyncIterable`:dd(e)?`iterable`:ld(e)?Wu({transform:e},t):Qu(e)?Hu(e,t):`native`,Hu=(e,t)=>gl(e.transform,{checkOpen:!1})?Uu(e,t):ld(e.transform)?Wu(e,t):qu(e,t),Uu=(e,t)=>(Gu(e,t,`Duplex stream`),`duplex`),Wu=(e,t)=>(Gu(e,t,`web TransformStream`),`webTransform`),Gu=({final:e,binary:t,objectMode:n},r,i)=>{Ku(e,`${r}.final`,i),Ku(t,`${r}.binary`,i),Ju(n,`${r}.objectMode`)},Ku=(e,t,n)=>{if(e!==void 0)throw TypeError(`The \`${t}\` option can only be defined when using a generator, not a ${n}.`)},qu=({transform:e,final:t,binary:n,objectMode:r},i)=>{if(e!==void 0&&!Yu(e))throw TypeError(`The \`${i}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(gl(t,{checkOpen:!1}))throw TypeError(`The \`${i}.final\` option must not be a Duplex stream.`);if(ld(t))throw TypeError(`The \`${i}.final\` option must not be a web TransformStream.`);if(t!==void 0&&!Yu(t))throw TypeError(`The \`${i}.final\` option must be a generator.`);return Ju(n,`${i}.binary`),Ju(r,`${i}.objectMode`),Xu(e)||Xu(t)?`asyncGenerator`:`generator`},Ju=(e,t)=>{if(e!==void 0&&typeof e!=`boolean`)throw TypeError(`The \`${t}\` option must use a boolean.`)},Yu=e=>Xu(e)||Zu(e),Xu=e=>Object.prototype.toString.call(e)===`[object AsyncGeneratorFunction]`,Zu=e=>Object.prototype.toString.call(e)===`[object GeneratorFunction]`,Qu=e=>B(e)&&(e.transform!==void 0||e.final!==void 0),$u=e=>Object.prototype.toString.call(e)===`[object URL]`,ed=e=>$u(e)&&e.protocol!==`file:`,td=e=>B(e)&&Object.keys(e).length>0&&Object.keys(e).every(e=>nd.has(e))&&rd(e.file),nd=new Set([`file`,`append`]),rd=e=>typeof e==`string`,id=(e,t)=>e===`native`&&typeof t==`string`&&!ad.has(t),ad=new Set([`ipc`,`ignore`,`inherit`,`overlapped`,`pipe`]),od=e=>Object.prototype.toString.call(e)===`[object ReadableStream]`,sd=e=>Object.prototype.toString.call(e)===`[object WritableStream]`,cd=e=>od(e)||sd(e),ld=e=>od(e?.readable)&&sd(e?.writable),ud=e=>fd(e)&&typeof e[Symbol.asyncIterator]==`function`,dd=e=>fd(e)&&typeof e[Symbol.iterator]==`function`,fd=e=>typeof e==`object`&&!!e,pd=new Set([`generator`,`asyncGenerator`,`duplex`,`webTransform`]),md=new Set([`fileUrl`,`filePath`,`fileNumber`]),hd=new Set([`fileUrl`,`filePath`]),gd=new Set([...hd,`webStream`,`nodeStream`]),_d=new Set([`webTransform`,`duplex`]),vd={generator:`a generator`,asyncGenerator:`an async generator`,fileUrl:`a file URL`,filePath:`a file path string`,fileNumber:`a file descriptor number`,webStream:`a web stream`,nodeStream:`a Node.js stream`,webTransform:`a web TransformStream`,duplex:`a Duplex stream`,native:`any value`,iterable:`an iterable`,asyncIterable:`an async iterable`,string:`a string`,uint8Array:`a Uint8Array`},yd=(e,t,n,r)=>r===`output`?bd(e,t,n):xd(e,t,n),bd=(e,t,n)=>{let r=t!==0&&n[t-1].value.readableObjectMode;return{writableObjectMode:r,readableObjectMode:e??r}},xd=(e,t,n)=>{let r=t===0?e===!0:n[t-1].value.readableObjectMode,i=t!==n.length-1&&(e??r);return{writableObjectMode:r,readableObjectMode:i}},Sd=(e,t)=>{let n=e.findLast(({type:e})=>pd.has(e));return n===void 0?!1:t===`input`?n.value.writableObjectMode:n.value.readableObjectMode},Cd=(e,t,n,r)=>[...e.filter(({type:e})=>!pd.has(e)),...wd(e,t,n,r)],wd=(e,t,n,{encoding:r})=>{let i=e.filter(({type:e})=>pd.has(e)),a=Array.from({length:i.length});for(let[e,o]of Object.entries(i))a[e]=Td({stdioItem:o,index:Number(e),newTransforms:a,optionName:t,direction:n,encoding:r});return kd(a,n)},Td=({stdioItem:e,stdioItem:{type:t},index:n,newTransforms:r,optionName:i,direction:a,encoding:o})=>t===`duplex`?Ed({stdioItem:e,optionName:i}):t===`webTransform`?Dd({stdioItem:e,index:n,newTransforms:r,direction:a}):Od({stdioItem:e,index:n,newTransforms:r,direction:a,encoding:o}),Ed=({stdioItem:e,stdioItem:{value:{transform:t,transform:{writableObjectMode:n,readableObjectMode:r},objectMode:i=r}},optionName:a})=>{if(i&&!r)throw TypeError(`The \`${a}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!i&&r)throw TypeError(`The \`${a}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return{...e,value:{transform:t,writableObjectMode:n,readableObjectMode:r}}},Dd=({stdioItem:e,stdioItem:{value:t},index:n,newTransforms:r,direction:i})=>{let{transform:a,objectMode:o}=B(t)?t:{transform:t},{writableObjectMode:s,readableObjectMode:c}=yd(o,n,r,i);return{...e,value:{transform:a,writableObjectMode:s,readableObjectMode:c}}},Od=({stdioItem:e,stdioItem:{value:t},index:n,newTransforms:r,direction:i,encoding:a})=>{let{transform:o,final:s,binary:c=!1,preserveNewlines:l=!1,objectMode:u}=B(t)?t:{transform:t},d=c||Jc.has(a),{writableObjectMode:f,readableObjectMode:p}=yd(u,n,r,i);return{...e,value:{transform:o,final:s,binary:d,preserveNewlines:l,writableObjectMode:f,readableObjectMode:p}}},kd=(e,t)=>t===`input`?e.reverse():e,Ad=(e,t,n)=>{let r=e.map(e=>jd(e,t));if(r.includes(`input`)&&r.includes(`output`))throw TypeError(`The \`${n}\` option must not be an array of both readable and writable values.`);return r.find(Boolean)??Ld},jd=({type:e,value:t},n)=>Md[n]??Fd[e](t),Md=[`input`,`output`,`output`],Nd=()=>void 0,Pd=()=>`input`,Fd={generator:Nd,asyncGenerator:Nd,fileUrl:Nd,filePath:Nd,iterable:Pd,asyncIterable:Pd,uint8Array:Pd,webStream:e=>sd(e)?`output`:`input`,nodeStream(e){return hl(e,{checkOpen:!1})?ml(e,{checkOpen:!1})?void 0:`input`:`output`},webTransform:Nd,duplex:Nd,native(e){let t=Id(e);if(t!==void 0)return t;if(pl(e,{checkOpen:!1}))return Fd.nodeStream(e)}},Id=e=>{if([0,u.stdin].includes(e))return`input`;if([1,2,u.stdout,u.stderr].includes(e))return`output`},Ld=`output`,Rd=(e,t)=>t&&!e.includes(`ipc`)?[...e,`ipc`]:e,zd=({stdio:e,ipc:t,buffer:n,...r},i,a)=>{let o=Bd(e,r).map((e,t)=>Hd(e,t));return a?Ud(o,n,i):Rd(o,t)},Bd=(e,t)=>{if(e===void 0)return H.map(e=>t[e]);if(Vd(t))throw Error(`It's not possible to provide \`stdio\` in combination with one of ${H.map(e=>`\`${e}\``).join(`, `)}`);if(typeof e==`string`)return[e,e,e];if(!Array.isArray(e))throw TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof e}\``);let n=Math.max(e.length,H.length);return Array.from({length:n},(t,n)=>e[n])},Vd=e=>H.some(t=>e[t]!==void 0),Hd=(e,t)=>Array.isArray(e)?e.map(e=>Hd(e,t)):e==null?t>=H.length?`ignore`:`pipe`:e,Ud=(e,t,n)=>e.map((e,r)=>!t[r]&&r!==0&&!ma(n,r)&&Wd(e)?`ignore`:e),Wd=e=>e===`pipe`||Array.isArray(e)&&e.every(e=>e===`pipe`),Gd=({stdioItem:e,stdioItem:{type:t},isStdioArray:n,fdNumber:r,direction:i,isSync:a})=>!n||t!==`native`?e:a?Kd({stdioItem:e,fdNumber:r,direction:i}):Yd({stdioItem:e,fdNumber:r}),Kd=({stdioItem:e,stdioItem:{value:t,optionName:n},fdNumber:r,direction:i})=>{let a=qd({value:t,optionName:n,fdNumber:r,direction:i});if(a!==void 0)return a;if(pl(t,{checkOpen:!1}))throw TypeError(`The \`${n}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return e},qd=({value:e,optionName:t,fdNumber:n,direction:r})=>{let i=Jd(e,n);if(i!==void 0){if(r===`output`)return{type:`fileNumber`,value:i,optionName:t};if(v.isatty(i))throw TypeError(`The \`${t}: ${Ws(e)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:`uint8Array`,value:Ai(re(i)),optionName:t}}},Jd=(e,t)=>{if(e===`inherit`)return t;if(typeof e==`number`)return e;let n=Zi.indexOf(e);if(n!==-1)return n},Yd=({stdioItem:e,stdioItem:{value:t,optionName:n},fdNumber:r})=>t===`inherit`?{type:`nodeStream`,value:Xd(r,t,n),optionName:n}:typeof t==`number`?{type:`nodeStream`,value:Xd(t,t,n),optionName:n}:pl(t,{checkOpen:!1})?{type:`nodeStream`,value:t,optionName:n}:e,Xd=(e,t,n)=>{let r=Zi[e];if(r===void 0)throw TypeError(`The \`${n}: ${t}\` option is invalid: no such standard stream.`);return r},Zd=({input:e,inputFile:t},n)=>n===0?[...Qd(e),...ef(t)]:[],Qd=e=>e===void 0?[]:[{type:$d(e),value:e,optionName:`input`}],$d=e=>{if(hl(e,{checkOpen:!1}))return`nodeStream`;if(typeof e==`string`)return`string`;if(V(e))return`uint8Array`;throw Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},ef=e=>e===void 0?[]:[{...tf(e),optionName:`inputFile`}],tf=e=>{if($u(e))return{type:`fileUrl`,value:e};if(rd(e))return{type:`filePath`,value:{file:e}};throw Error("The `inputFile` option must be a file path string or a file URL.")},nf=e=>e.filter((t,n)=>e.every((e,r)=>t.value!==e.value||n>=r||t.type===`generator`||t.type===`asyncGenerator`)),rf=({stdioItem:{type:e,value:t,optionName:n},direction:r,fileDescriptors:i,isSync:a})=>{let o=af(i,e);if(o.length!==0){if(a){sf({otherStdioItems:o,type:e,value:t,optionName:n,direction:r});return}if(gd.has(e))return cf({otherStdioItems:o,type:e,value:t,optionName:n,direction:r});_d.has(e)&&uf({otherStdioItems:o,type:e,value:t,optionName:n})}},af=(e,t)=>e.flatMap(({direction:e,stdioItems:n})=>n.filter(e=>e.type===t).map((t=>({...t,direction:e})))),sf=({otherStdioItems:e,type:t,value:n,optionName:r,direction:i})=>{hd.has(t)&&cf({otherStdioItems:e,type:t,value:n,optionName:r,direction:i})},cf=({otherStdioItems:e,type:t,value:n,optionName:r,direction:i})=>{let a=e.filter(e=>lf(e,n));if(a.length===0)return;let o=a.find(e=>e.direction!==i);return df(o,r,t),i===`output`?a[0].stream:void 0},lf=({type:e,value:t},n)=>e===`filePath`?t.file===n.file:e===`fileUrl`?t.href===n.href:t===n,uf=({otherStdioItems:e,type:t,value:n,optionName:r})=>{let i=e.find(({value:{transform:e}})=>e===n.transform);df(i,r,t)},df=(e,t,n)=>{if(e!==void 0)throw TypeError(`The \`${e.optionName}\` and \`${t}\` options must not target ${vd[n]} that is the same.`)},ff=(e,t,n,r)=>{let i=zd(t,n,r).map((e,n)=>pf({stdioOption:e,fdNumber:n,options:t,isSync:r})),a=xf({initialFileDescriptors:i,addProperties:e,options:t,isSync:r});return t.stdio=a.map(({stdioItems:e})=>Tf(e)),a},pf=({stdioOption:e,fdNumber:t,options:n,isSync:r})=>{let i=Qi(t),{stdioItems:a,isStdioArray:o}=mf({stdioOption:e,fdNumber:t,options:n,optionName:i}),s=Ad(a,t,i),c=a.map(e=>Gd({stdioItem:e,isStdioArray:o,fdNumber:t,direction:s,isSync:r})),l=Cd(c,i,s,n),u=Sd(l,s);return bf(l,u),{direction:s,objectMode:u,stdioItems:l}},mf=({stdioOption:e,fdNumber:t,options:n,optionName:r})=>{let i=[...(Array.isArray(e)?e:[e]).map(e=>hf(e,r)),...Zd(n,t)],a=nf(i),o=a.length>1;return gf(a,o,r),vf(a),{stdioItems:a,isStdioArray:o}},hf=(e,t)=>({type:Vu(e,t),value:e,optionName:t}),gf=(e,t,n)=>{if(e.length===0)throw TypeError(`The \`${n}\` option must not be an empty array.`);if(t){for(let{value:t,optionName:n}of e)if(_f.has(t))throw Error(`The \`${n}\` option must not include \`${t}\`.`)}},_f=new Set([`ignore`,`ipc`]),vf=e=>{for(let t of e)yf(t)},yf=({type:e,value:t,optionName:n})=>{if(ed(t))throw TypeError(`The \`${n}: URL\` option must use the \`file:\` scheme.
109
- For example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if(id(e,t))throw TypeError(`The \`${n}: { file: '...' }\` option must be used instead of \`${n}: '...'\`.`)},bf=(e,t)=>{if(!t)return;let n=e.find(({type:e})=>md.has(e));if(n!==void 0)throw TypeError(`The \`${n.optionName}\` option cannot use both files and transforms in objectMode.`)},xf=({initialFileDescriptors:e,addProperties:t,options:n,isSync:r})=>{let i=[];try{for(let a of e)i.push(Sf({fileDescriptor:a,fileDescriptors:i,addProperties:t,options:n,isSync:r}));return i}catch(e){throw wf(i),e}},Sf=({fileDescriptor:{direction:e,objectMode:t,stdioItems:n},fileDescriptors:r,addProperties:i,options:a,isSync:o})=>{let s=n.map(t=>Cf({stdioItem:t,addProperties:i,direction:e,options:a,fileDescriptors:r,isSync:o}));return{direction:e,objectMode:t,stdioItems:s}},Cf=({stdioItem:e,addProperties:t,direction:n,options:r,fileDescriptors:i,isSync:a})=>{let o=rf({stdioItem:e,direction:n,fileDescriptors:i,isSync:a});return o===void 0?{...e,...t[n][e.type](e,r)}:{...e,stream:o}},wf=e=>{for(let{stdioItems:t}of e)for(let{stream:e}of t)e!==void 0&&!Xi(e)&&e.destroy()},Tf=e=>{if(e.length>1)return e.some(({value:e})=>e===`overlapped`)?`overlapped`:`pipe`;let[{type:t,value:n}]=e;return t===`native`?n:`pipe`},Ef=(e,t)=>ff(Af,e,t,!0),G=({type:e,optionName:t})=>{Of(t,vd[e])},Df=({optionName:e,value:t})=>((t===`ipc`||t===`overlapped`)&&Of(e,`"${t}"`),{}),Of=(e,t)=>{throw TypeError(`The \`${e}\` option cannot be ${t} with synchronous methods.`)},kf={generator(){},asyncGenerator:G,webStream:G,nodeStream:G,webTransform:G,duplex:G,asyncIterable:G,native:Df},Af={input:{...kf,fileUrl:({value:e})=>({contents:[Ai(re(e))]}),filePath:({value:{file:e}})=>({contents:[Ai(re(e))]}),fileNumber:G,iterable:({value:e})=>({contents:[...e]}),string:({value:e})=>({contents:[e]}),uint8Array:({value:e})=>({contents:[e]})},output:{...kf,fileUrl:({value:e})=>({path:e}),filePath:({value:{file:e,append:t}})=>({path:e,append:t}),fileNumber:({value:e})=>({path:e}),iterable:G,string:G,uint8Array:G}},jf=(e,{stripFinalNewline:t},n)=>Mf(t,n)&&e!==void 0&&!Array.isArray(e)?ol(e):e,Mf=(e,t)=>t===`all`?e[1]||e[2]:e[t],Nf=(e,t,n,r)=>e||n?void 0:If(t,r),Pf=(e,t,n)=>n?e.flatMap(e=>Ff(e,t)):Ff(e,t),Ff=(e,t)=>{let{transform:n,final:r}=If(t,{});return[...n(e),...r()]},If=(e,t)=>(t.previousChunks=``,{transform:Lf.bind(void 0,t,e),final:zf.bind(void 0,t)}),Lf=function*(e,t,n){if(typeof n!=`string`){yield n;return}let{previousChunks:r}=e,i=-1;for(let a=0;a<n.length;a+=1)if(n[a]===`
110
- `){let o=Rf(n,a,t,e),s=n.slice(i+1,a+1-o);r.length>0&&(s=Hf(r,s),r=``),yield s,i=a}i!==n.length-1&&(r=Hf(r,n.slice(i+1))),e.previousChunks=r},Rf=(e,t,n,r)=>n?0:(r.isWindowsNewline=t!==0&&e[t-1]===`\r`,r.isWindowsNewline?2:1),zf=function*({previousChunks:e}){e.length>0&&(yield e)},Bf=({binary:e,preserveNewlines:t,readableObjectMode:n,state:r})=>e||t||n?void 0:{transform:Vf.bind(void 0,r)},Vf=function*({isWindowsNewline:e=!1},t){let{unixNewline:n,windowsNewline:r,LF:i,concatBytes:a}=typeof t==`string`?Uf:Wf;if(t.at(-1)===i){yield t;return}yield a(t,e?r:n)},Hf=(e,t)=>`${e}${t}`,Uf={windowsNewline:`\r
111
- `,unixNewline:`
112
- `,LF:`
113
- `,concatBytes:Hf},Wf={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:(e,t)=>{let n=new Uint8Array(e.length+t.length);return n.set(e,0),n.set(t,e.length),n}},Gf=(e,t)=>e?void 0:Kf.bind(void 0,t),Kf=function*(e,t){if(typeof t!=`string`&&!V(t)&&!Oe.isBuffer(t))throw TypeError(`The \`${e}\` option's transform must use "objectMode: true" to receive as input: ${typeof t}.`);yield t},qf=(e,t)=>e?Jf.bind(void 0,t):Yf.bind(void 0,t),Jf=function*(e,t){Xf(e,t),yield t},Yf=function*(e,t){if(Xf(e,t),typeof t!=`string`&&!V(t))throw TypeError(`The \`${e}\` option's function must yield a string or an Uint8Array, not ${typeof t}.`);yield t},Xf=(e,t)=>{if(t==null)throw TypeError(`The \`${e}\` option's function must not call \`yield ${t}\`.
114
- Instead, \`yield\` should either be called with a value, or not be called at all. For example:
115
- if (condition) { yield value; }`)},Zf=(e,t,n)=>{if(n)return;if(e)return{transform:Qf.bind(void 0,new TextEncoder)};let r=new pe(t);return{transform:$f.bind(void 0,r),final:ep.bind(void 0,r)}},Qf=function*(e,t){Oe.isBuffer(t)?yield Ai(t):typeof t==`string`?yield e.encode(t):yield t},$f=function*(e,t){yield V(t)?e.write(t):t},ep=function*(e){let t=e.end();t!==``&&(yield t)},tp=ce(async(e,t,n,r)=>{t.currentIterable=e(...n);try{for await(let e of t.currentIterable)r.push(e)}finally{delete t.currentIterable}}),np=async function*(e,t,n){if(n===t.length){yield e;return}let{transform:r=op}=t[n];for await(let i of r(e))yield*np(i,t,n+1)},rp=async function*(e){for(let[t,{final:n}]of Object.entries(e))yield*ip(n,Number(t),e)},ip=async function*(e,t,n){if(e!==void 0)for await(let r of e())yield*np(r,n,t+1)},ap=ce(async({currentIterable:e},t)=>{if(e!==void 0){await(t?e.throw(t):e.return());return}if(t)throw t}),op=function*(e){yield e},sp=(e,t,n,r)=>{try{for(let r of e(...t))n.push(r);r()}catch(e){r(e)}},cp=(e,t)=>[...t.flatMap(t=>[...lp(t,e,0)]),...up(e)],lp=function*(e,t,n){if(n===t.length){yield e;return}let{transform:r=fp}=t[n];for(let i of r(e))yield*lp(i,t,n+1)},up=function*(e){for(let[t,{final:n}]of Object.entries(e))yield*dp(n,Number(t),e)},dp=function*(e,t,n){if(e!==void 0)for(let r of e())yield*lp(r,n,t+1)},fp=function*(e){yield e},pp=({value:e,value:{transform:t,final:n,writableObjectMode:r,readableObjectMode:i},optionName:a},{encoding:o})=>{let s={},c=hp(e,o,a),l=Xu(t),u=Xu(n),d=l?tp.bind(void 0,np,s):sp.bind(void 0,lp),f=l||u?tp.bind(void 0,rp,s):sp.bind(void 0,up),p=l||u?ap.bind(void 0,s):void 0;return{stream:new Te({writableObjectMode:r,writableHighWaterMark:De(r),readableObjectMode:i,readableHighWaterMark:De(i),transform(e,t,n){d([e,c,0],this,n)},flush(e){f([c],this,e)},destroy:p})}},mp=(e,t,n,r)=>{let i=t.filter(({type:e})=>e===`generator`),a=r?i.reverse():i;for(let{value:t,optionName:r}of a){let i=hp(t,n,r);e=cp(i,e)}return e},hp=({transform:e,final:t,binary:n,writableObjectMode:r,readableObjectMode:i,preserveNewlines:a},o,s)=>{let c={};return[{transform:Gf(r,s)},Zf(n,o,r),Nf(n,a,r,c),{transform:e,final:t},{transform:qf(i,s)},Bf({binary:n,preserveNewlines:a,readableObjectMode:i,state:c})].filter(Boolean)},gp=(e,t)=>{for(let n of _p(e))vp(e,n,t)},_p=e=>new Set(Object.entries(e).filter(([,{direction:e}])=>e===`input`).map(([e])=>Number(e))),vp=(e,t,n)=>{let{stdioItems:r}=e[t],i=r.filter(({contents:e})=>e!==void 0);if(i.length===0)return;if(t!==0){let[{type:e,optionName:t}]=i;throw TypeError(`Only the \`stdin\` option, not \`${t}\`, can be ${vd[e]} with synchronous methods.`)}let a=i.map(({contents:e})=>e).map(e=>yp(e,r));n.input=Li(a)},yp=(e,t)=>{let n=mp(e,t,`utf8`,!0);return bp(n),Li(n)},bp=e=>{let t=e.find(e=>typeof e!=`string`&&!V(e));if(t!==void 0)throw TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${t}.`)},xp=({stdioItems:e,encoding:t,verboseInfo:n,fdNumber:r})=>r!==`all`&&ma(n,r)&&!Jc.has(t)&&Sp(r)&&(e.some(({type:e,value:t})=>e===`native`&&Cp.has(t))||e.every(({type:e})=>pd.has(e))),Sp=e=>e===1||e===2,Cp=new Set([`pipe`,`overlapped`]),wp=async(e,t,n,r)=>{for await(let i of e)Ep(t)||Dp(i,n,r)},Tp=(e,t,n)=>{for(let r of e)Dp(r,t,n)},Ep=e=>e._readableState.pipes.length>0,Dp=(e,t,n)=>{let r=Ya(e);Ga({type:`output`,verboseMessage:r,fdNumber:t,verboseInfo:n})},Op=({fileDescriptors:e,syncResult:{output:t},options:n,isMaxBuffer:r,verboseInfo:i})=>{if(t===null)return{output:Array.from({length:3})};let a={},o=new Set([]);return{output:t.map((t,s)=>kp({result:t,fileDescriptors:e,fdNumber:s,state:a,outputFiles:o,isMaxBuffer:r,verboseInfo:i},n)),...a}},kp=({result:e,fileDescriptors:t,fdNumber:n,state:r,outputFiles:i,isMaxBuffer:a,verboseInfo:o},{buffer:s,encoding:c,lines:l,stripFinalNewline:u,maxBuffer:d})=>{if(e===null)return;let f=mu(e,a,d),p=Ai(f),{stdioItems:m,objectMode:h}=t[n],g=Ap([p],m,c,r),{serializedResult:_,finalResult:v=_}=jp({chunks:g,objectMode:h,encoding:c,lines:l,stripFinalNewline:u,fdNumber:n});Mp({serializedResult:_,fdNumber:n,state:r,verboseInfo:o,encoding:c,stdioItems:m,objectMode:h});let y=s[n]?v:void 0;try{return r.error===void 0&&Np(_,m,i),y}catch(e){return r.error=e,y}},Ap=(e,t,n,r)=>{try{return mp(e,t,n,!1)}catch(t){return r.error=t,e}},jp=({chunks:e,objectMode:t,encoding:n,lines:r,stripFinalNewline:i,fdNumber:a})=>{if(t)return{serializedResult:e};if(n===`buffer`)return{serializedResult:Li(e)};let o=Fi(e,n);return r[a]?{serializedResult:o,finalResult:Pf(o,!i[a],t)}:{serializedResult:o}},Mp=({serializedResult:e,fdNumber:t,state:n,verboseInfo:r,encoding:i,stdioItems:a,objectMode:o})=>{if(!xp({stdioItems:a,encoding:i,verboseInfo:r,fdNumber:t}))return;let s=Pf(e,!1,o);try{Tp(s,t,r)}catch(e){n.error??=e}},Np=(e,t,n)=>{for(let{path:r,append:i}of t.filter(({type:e})=>md.has(e))){let t=typeof r==`string`?r:r.toString();i||n.has(t)?ee(r,e):(n.add(t),oe(r,e))}},Pp=([,e,t],n)=>{if(n.all)return e===void 0?t:t===void 0?e:Array.isArray(e)?Array.isArray(t)?[...e,...t]:[...e,jf(t,n,`all`)]:Array.isArray(t)?[jf(e,n,`all`),...t]:V(e)&&V(t)?zi([e,t]):`${e}${t}`},Fp=async(e,t)=>{let[n,r]=await Ip(e);return t.isForcefullyTerminated??=!1,[n,r]},Ip=async e=>{let[t,n]=await Promise.allSettled([T(e,`spawn`),T(e,`exit`)]);return t.status===`rejected`?[]:n.status===`rejected`?Lp(e):n.value},Lp=async e=>{try{return await T(e,`exit`)}catch{return Lp(e)}},Rp=async e=>{let[t,n]=await e;if(!zp(t,n)&&Bp(t,n))throw new Do;return[t,n]},zp=(e,t)=>e===void 0&&t===void 0,Bp=(e,t)=>e!==0||t!==null,Vp=({error:e,status:t,signal:n,output:r},{maxBuffer:i})=>{let a=Hp(e,t,n),o=a?.code===`ETIMEDOUT`,s=pu(a,r,i);return{resultError:a,exitCode:t,signal:n,timedOut:o,isMaxBuffer:s}},Hp=(e,t,n)=>e===void 0?Bp(t,n)?new Do:void 0:e,Up=(e,t,n)=>{let{file:r,commandArguments:i,command:a,escapedCommand:o,startTime:s,verboseInfo:c,options:l,fileDescriptors:u}=Wp(e,t,n),d=Jp({file:r,commandArguments:i,options:l,command:a,escapedCommand:o,verboseInfo:c,fileDescriptors:u,startTime:s});return Bu(d,c,l)},Wp=(e,t,n)=>{let{command:r,escapedCommand:i,startTime:a,verboseInfo:o}=io(e,t,n),s=Gp(n),{file:c,commandArguments:l,options:u}=nl(e,t,s);Kp(u);let d=Ef(u,o);return{file:c,commandArguments:l,command:r,escapedCommand:i,startTime:a,verboseInfo:o,options:u,fileDescriptors:d}},Gp=e=>e.node&&!e.ipc?{...e,ipc:!1}:e,Kp=({ipc:e,ipcInput:t,detached:n,cancelSignal:r})=>{t&&qp(`ipcInput`),e&&qp(`ipc: true`),n&&qp(`detached: true`),r&&qp(`cancelSignal`)},qp=e=>{throw TypeError(`The "${e}" option cannot be used with synchronous methods.`)},Jp=({file:e,commandArguments:t,options:n,command:r,escapedCommand:i,verboseInfo:a,fileDescriptors:o,startTime:s})=>{let c=Yp({file:e,commandArguments:t,options:n,command:r,escapedCommand:i,fileDescriptors:o,startTime:s});if(c.failed)return c;let{resultError:l,exitCode:u,signal:d,timedOut:f,isMaxBuffer:p}=Vp(c,n),{output:m,error:h=l}=Op({fileDescriptors:o,syncResult:c,options:n,isMaxBuffer:p,verboseInfo:a}),g=m.map((e,t)=>jf(e,n,t)),_=jf(Pp(m,n),n,`all`);return Zp({error:h,exitCode:u,signal:d,timedOut:f,isMaxBuffer:p,stdio:g,all:_,options:n,command:r,escapedCommand:i,startTime:s})},Yp=({file:e,commandArguments:t,options:n,command:r,escapedCommand:i,fileDescriptors:a,startTime:o})=>{try{gp(a,n);let r=Xp(n);return w(...al(e,t,r))}catch(e){return wu({error:e,command:r,escapedCommand:i,fileDescriptors:a,options:n,startTime:o,isSync:!0})}},Xp=({encoding:e,maxBuffer:t,...n})=>({...n,encoding:`buffer`,maxBuffer:hu(t)}),Zp=({error:e,exitCode:t,signal:n,timedOut:r,isMaxBuffer:i,stdio:a,all:o,options:s,command:c,escapedCommand:l,startTime:u})=>e===void 0?Cu({command:c,escapedCommand:l,stdio:a,all:o,ipcOutput:[],options:s,startTime:u}):Tu({error:e,command:c,escapedCommand:l,timedOut:r,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:i,isForcefullyTerminated:!1,exitCode:t,signal:n,stdio:a,all:o,ipcOutput:[],options:s,startTime:u,isSync:!0}),Qp=({anyProcess:e,channel:t,isSubprocess:n,ipc:r},{reference:i=!0,filter:a}={})=>(gs({methodName:`getOneMessage`,isSubprocess:n,ipc:r,isConnected:ic(e)}),$p({anyProcess:e,channel:t,isSubprocess:n,filter:a,reference:i})),$p=async({anyProcess:e,channel:t,isSubprocess:n,filter:r,reference:i})=>{Ks(t,i);let a=tc(e,t,n),o=new AbortController;try{return await Promise.race([em(a,r,o),tm(a,n,o),nm(a,n,o)])}catch(t){throw Ms(e),t}finally{o.abort(),Js(t,i)}},em=async(e,t,{signal:n})=>{if(t===void 0){let[t]=await T(e,`message`,{signal:n});return t}for await(let[r]of ye(e,`message`,{signal:n}))if(t(r))return r},tm=async(e,t,{signal:n})=>{await T(e,`disconnect`,{signal:n}),ys(t)},nm=async(e,t,{signal:n})=>{let[r]=await T(e,`strict:error`,{signal:n});throw xs(r,t)},rm=({anyProcess:e,channel:t,isSubprocess:n,ipc:r},{reference:i=!0}={})=>im({anyProcess:e,channel:t,isSubprocess:n,ipc:r,shouldAwait:!n,reference:i}),im=({anyProcess:e,channel:t,isSubprocess:n,ipc:r,shouldAwait:i,reference:a})=>{gs({methodName:`getEachMessage`,isSubprocess:n,ipc:r,isConnected:ic(e)}),Ks(t,a);let o=tc(e,t,n),s=new AbortController,c={};return am(e,o,s),om({ipcEmitter:o,isSubprocess:n,controller:s,state:c}),sm({anyProcess:e,channel:t,ipcEmitter:o,isSubprocess:n,shouldAwait:i,controller:s,state:c,reference:a})},am=async(e,t,n)=>{try{await T(t,`disconnect`,{signal:n.signal}),n.abort()}catch{}},om=async({ipcEmitter:e,isSubprocess:t,controller:n,state:r})=>{try{let[i]=await T(e,`strict:error`,{signal:n.signal});r.error=xs(i,t),n.abort()}catch{}},sm=async function*({anyProcess:e,channel:t,ipcEmitter:n,isSubprocess:r,shouldAwait:i,controller:a,state:o,reference:s}){try{for await(let[e]of ye(n,`message`,{signal:a.signal}))cm(o),yield e}catch{cm(o)}finally{a.abort(),Js(t,s),r||Ms(e),i&&await e}},cm=({error:e})=>{if(e)throw e},lm=(e,{ipc:t})=>{Object.assign(e,dm(e,!1,t))},um=()=>{let e=u,t=u.channel!==void 0;return{...dm(e,!0,t),getCancelSignal:Dc.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:!0,ipc:t})}},dm=(e,t,n)=>({sendMessage:xc.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n}),getOneMessage:Qp.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n}),getEachMessage:rm.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n})}),fm=({error:e,command:t,escapedCommand:n,fileDescriptors:r,options:i,startTime:a,verboseInfo:o})=>{wf(r);let s=new b;pm(s,r),Object.assign(s,{readable:hm,writable:gm,duplex:_m});let c=wu({error:e,command:t,escapedCommand:n,fileDescriptors:r,options:i,startTime:a,isSync:!1}),l=vm(c,o,i);return{subprocess:s,promise:l}},pm=(e,t)=>{let n=mm(),r=mm(),i=mm(),a=Array.from({length:t.length-3},mm),o=mm(),s=[n,r,i,...a];Object.assign(e,{stdin:n,stdout:r,stderr:i,all:o,stdio:s})},mm=()=>{let e=new Ce;return e.end(),e},hm=()=>new we({read(){}}),gm=()=>new Ee({write(){}}),_m=()=>new Se({read(){},write(){}}),vm=async(e,t,n)=>Bu(e,t,n),ym=(e,t)=>ff(Sm,e,t,!1),bm=({type:e,optionName:t})=>{throw TypeError(`The \`${t}\` option cannot be ${vd[e]}.`)},xm={fileNumber:bm,generator:pp,asyncGenerator:pp,nodeStream:({value:e})=>({stream:e}),webTransform({value:{transform:e,writableObjectMode:t,readableObjectMode:n}}){let r=t||n;return{stream:Se.fromWeb(e,{objectMode:r})}},duplex:({value:{transform:e}})=>({stream:e}),native(){}},Sm={input:{...xm,fileUrl:({value:e})=>({stream:te(e)}),filePath:({value:{file:e}})=>({stream:te(e)}),webStream:({value:e})=>({stream:we.fromWeb(e)}),iterable:({value:e})=>({stream:we.from(e)}),asyncIterable:({value:e})=>({stream:we.from(e)}),string:({value:e})=>({stream:we.from(e)}),uint8Array:({value:e})=>({stream:we.from(Oe.from(e))})},output:{...xm,fileUrl:({value:e})=>({stream:ne(e)}),filePath:({value:{file:e,append:t}})=>({stream:ne(e,t?{flags:`a`}:{})}),webStream:({value:e})=>({stream:Ee.fromWeb(e)}),iterable:bm,asyncIterable:bm,string:bm,uint8Array:bm}};function Cm(e){if(!Array.isArray(e))throw TypeError(`Expected an array, got \`${typeof e}\`.`);for(let t of e)km(t);let t=e.some(({readableObjectMode:e})=>e),n=wm(e,t),r=new Tm({objectMode:t,writableHighWaterMark:n,readableHighWaterMark:n});for(let t of e)r.add(t);return r}const wm=(e,t)=>{if(e.length===0)return De(t);let n=e.filter(({readableObjectMode:e})=>e===t).map(({readableHighWaterMark:e})=>e);return Math.max(...n)};var Tm=class extends Ce{#streams=new Set([]);#ended=new Set([]);#aborted=new Set([]);#onFinished;#unpipeEvent=Symbol(`unpipe`);#streamPromises=new WeakMap;add(e){if(km(e),this.#streams.has(e))return;this.#streams.add(e),this.#onFinished??=Em(this,this.#streams,this.#unpipeEvent);let t=Am({passThroughStream:this,stream:e,streams:this.#streams,ended:this.#ended,aborted:this.#aborted,onFinished:this.#onFinished,unpipeEvent:this.#unpipeEvent});this.#streamPromises.set(e,t),e.pipe(this,{end:!1})}async remove(e){if(km(e),!this.#streams.has(e))return!1;let t=this.#streamPromises.get(e);return t===void 0?!1:(this.#streamPromises.delete(e),e.unpipe(this),await t,!0)}};const Em=async(e,t,n)=>{Bm(e,Vm);let r=new AbortController;try{await Promise.race([Dm(e,r),Om(e,t,n,r)])}finally{r.abort(),Bm(e,-Vm)}},Dm=async(e,{signal:t})=>{try{await E(e,{signal:t,cleanup:!0})}catch(t){throw Fm(e,t),t}},Om=async(e,t,n,{signal:r})=>{for await(let[i]of ye(e,`unpipe`,{signal:r}))t.has(i)&&i.emit(n)},km=e=>{if(typeof e?.pipe!=`function`)throw TypeError(`Expected a readable stream, got: \`${typeof e}\`.`)},Am=async({passThroughStream:e,stream:t,streams:n,ended:r,aborted:i,onFinished:a,unpipeEvent:o})=>{Bm(e,Hm);let s=new AbortController;try{await Promise.race([jm(a,t,s),Mm({passThroughStream:e,stream:t,streams:n,ended:r,aborted:i,controller:s}),Nm({stream:t,streams:n,ended:r,aborted:i,unpipeEvent:o,controller:s})])}finally{s.abort(),Bm(e,-Hm)}n.size>0&&n.size===r.size+i.size&&(r.size===0&&i.size>0?Lm(e):Pm(e))},jm=async(e,t,{signal:n})=>{try{await e,n.aborted||Lm(t)}catch(e){n.aborted||Fm(t,e)}},Mm=async({passThroughStream:e,stream:t,streams:n,ended:r,aborted:i,controller:{signal:a}})=>{try{await E(t,{signal:a,cleanup:!0,readable:!0,writable:!1}),n.has(t)&&r.add(t)}catch(r){if(a.aborted||!n.has(t))return;Im(r)?i.add(t):Rm(e,r)}},Nm=async({stream:e,streams:t,ended:n,aborted:r,unpipeEvent:i,controller:{signal:a}})=>{if(await T(e,i,{signal:a}),!e.readable)return T(a,`abort`,{signal:a});t.delete(e),n.delete(e),r.delete(e)},Pm=e=>{e.writable&&e.end()},Fm=(e,t)=>{Im(t)?Lm(e):Rm(e,t)},Im=e=>e?.code===`ERR_STREAM_PREMATURE_CLOSE`,Lm=e=>{(e.readable||e.writable)&&e.destroy()},Rm=(e,t)=>{e.destroyed||(e.once(`error`,zm),e.destroy(t))},zm=()=>{},Bm=(e,t)=>{let n=e.getMaxListeners();n!==0&&n!==1/0&&e.setMaxListeners(n+t)},Vm=2,Hm=1,Um=(e,t)=>{e.pipe(t),Wm(e,t),Km(e,t)},Wm=async(e,t)=>{if(!(Xi(e)||Xi(t))){try{await E(e,{cleanup:!0,readable:!0,writable:!1})}catch{}Gm(t)}},Gm=e=>{e.writable&&e.end()},Km=async(e,t)=>{if(!(Xi(e)||Xi(t))){try{await E(t,{cleanup:!0,readable:!1,writable:!0})}catch{}qm(e)}},qm=e=>{e.readable&&e.destroy()},Jm=(e,t,n)=>{let r=new Map;for(let[i,{stdioItems:a,direction:o}]of Object.entries(t)){for(let{stream:t}of a.filter(({type:e})=>pd.has(e)))Ym(e,t,o,i);for(let{stream:t}of a.filter(({type:e})=>!pd.has(e)))Zm({subprocess:e,stream:t,direction:o,fdNumber:i,pipeGroups:r,controller:n})}for(let[e,t]of r.entries()){let n=t.length===1?t[0]:Cm(t);Um(n,e)}},Ym=(e,t,n,r)=>{n===`output`?Um(e.stdio[r],t):Um(t,e.stdio[r]);let i=Xm[r];i!==void 0&&(e[i]=t),e.stdio[r]=t},Xm=[`stdin`,`stdout`,`stderr`],Zm=({subprocess:e,stream:t,direction:n,fdNumber:r,pipeGroups:i,controller:a})=>{if(t===void 0)return;Qm(t,a);let[o,s]=n===`output`?[t,e.stdio[r]]:[e.stdio[r],t],c=i.get(o)??[];i.set(o,[...c,s])},Qm=(e,{signal:t})=>{Xi(e)&&Gs(e,$m,t)},$m=2,eh=(e,{cleanup:t,detached:n},{signal:r})=>{if(!t||n)return;let i=Tn(()=>{e.kill()});ve(r,()=>{i()})},th=({source:e,sourcePromise:t,boundOptions:n,createNested:r},...i)=>{let a=no(),{destination:o,destinationStream:s,destinationError:c,from:l,unpipeSignal:u}=nh(n,r,i),{sourceStream:d,sourceError:f}=ah(e,l),{options:p,fileDescriptors:m}=Is.get(e);return{sourcePromise:t,sourceStream:d,sourceOptions:p,sourceError:f,destination:o,destinationStream:s,destinationError:c,unpipeSignal:u,fileDescriptors:m,startTime:a}},nh=(e,t,n)=>{try{let{destination:r,pipeOptions:{from:i,to:a,unpipeSignal:o}={}}=rh(e,t,...n),s=Ps(r,a);return{destination:r,destinationStream:s,from:i,unpipeSignal:o}}catch(e){return{destinationError:e}}},rh=(e,t,n,...r)=>{if(Array.isArray(n))return{destination:t(ih,e)(n,...r),pipeOptions:e};if(typeof n==`string`||n instanceof URL||Ti(n)){if(Object.keys(e).length>0)throw TypeError(`Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).`);let[i,a,o]=Di(n,...r);return{destination:t(ih)(i,a,o),pipeOptions:o}}if(Is.has(n)){if(Object.keys(e).length>0)throw TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:n,pipeOptions:r[0]}}throw TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${n}`)},ih=({options:e})=>({options:{...e,stdin:`pipe`,piped:!0}}),ah=(e,t)=>{try{return{sourceStream:Fs(e,t)}}catch(e){return{sourceError:e}}},oh=({sourceStream:e,sourceError:t,destinationStream:n,destinationError:r,fileDescriptors:i,sourceOptions:a,startTime:o})=>{let s=sh({sourceStream:e,sourceError:t,destinationStream:n,destinationError:r});if(s!==void 0)throw ch({error:s,fileDescriptors:i,sourceOptions:a,startTime:o})},sh=({sourceStream:e,sourceError:t,destinationStream:n,destinationError:r})=>{if(t!==void 0&&r!==void 0)return r;if(r!==void 0)return qm(e),r;if(t!==void 0)return Gm(n),t},ch=({error:e,fileDescriptors:t,sourceOptions:n,startTime:r})=>wu({error:e,command:lh,escapedCommand:lh,fileDescriptors:t,options:n,startTime:r,isSync:!1}),lh=`source.pipe(destination)`,uh=async e=>{let[{status:t,reason:n,value:r=n},{status:i,reason:a,value:o=a}]=await e;if(o.pipedFrom.includes(r)||o.pipedFrom.push(r),i===`rejected`)throw o;if(t===`rejected`)throw r;return o},dh=(e,t,n)=>{let r=hh.has(t)?ph(e,t):fh(e,t);return Gs(e,gh,n.signal),Gs(t,_h,n.signal),mh(t),r},fh=(e,t)=>{let n=Cm([e]);return Um(n,t),hh.set(t,n),n},ph=(e,t)=>{let n=hh.get(t);return n.add(e),n},mh=async e=>{try{await E(e,{cleanup:!0,readable:!1,writable:!0})}catch{}hh.delete(e)},hh=new WeakMap,gh=2,_h=1,vh=(e,t)=>e===void 0?[]:[yh(e,t)],yh=async(e,{sourceStream:t,mergedStream:n,fileDescriptors:r,sourceOptions:i,startTime:a})=>{throw await se(e,t),await n.remove(t),ch({error:Error("Pipe canceled by `unpipeSignal` option."),fileDescriptors:r,sourceOptions:i,startTime:a})},bh=(e,...t)=>{if(B(t[0]))return bh.bind(void 0,{...e,boundOptions:{...e.boundOptions,...t[0]}});let{destination:n,...r}=th(e,...t),i=xh({...r,destination:n});return i.pipe=bh.bind(void 0,{...e,source:n,sourcePromise:i,boundOptions:{}}),i},xh=async({sourcePromise:e,sourceStream:t,sourceOptions:n,sourceError:r,destination:i,destinationStream:a,destinationError:o,unpipeSignal:s,fileDescriptors:c,startTime:l})=>{let u=Sh(e,i);oh({sourceStream:t,sourceError:r,destinationStream:a,destinationError:o,fileDescriptors:c,sourceOptions:n,startTime:l});let d=new AbortController;try{let e=dh(t,a,d);return await Promise.race([uh(u),...vh(s,{sourceStream:t,mergedStream:e,sourceOptions:n,fileDescriptors:c,startTime:l})])}finally{d.abort()}},Sh=(e,t)=>Promise.allSettled([e,t]),Ch=({subprocessStdout:e,subprocess:t,binary:n,shouldEncode:r,encoding:i,preserveNewlines:a})=>{let o=new AbortController;return wh(t,o),Dh({stream:e,controller:o,binary:n,shouldEncode:!e.readableObjectMode&&r,encoding:i,shouldSplit:!e.readableObjectMode,preserveNewlines:a})},wh=async(e,t)=>{try{await e}catch{}finally{t.abort()}},Th=({stream:e,onStreamEnd:t,lines:n,encoding:r,stripFinalNewline:i,allMixed:a})=>{let o=new AbortController;Eh(t,o,e);let s=e.readableObjectMode&&!a;return Dh({stream:e,controller:o,binary:r===`buffer`,shouldEncode:!s,encoding:r,shouldSplit:!s&&n,preserveNewlines:!i})},Eh=async(e,t,n)=>{try{await e}catch{n.destroy()}finally{t.abort()}},Dh=({stream:e,controller:t,binary:n,shouldEncode:r,encoding:i,shouldSplit:a,preserveNewlines:o})=>{let s=ye(e,`data`,{signal:t.signal,highWaterMark:kh,highWatermark:kh});return Ah({onStdoutChunk:s,controller:t,binary:n,shouldEncode:r,encoding:i,shouldSplit:a,preserveNewlines:o})},Oh=De(!0),kh=Oh,Ah=async function*({onStdoutChunk:e,controller:t,binary:n,shouldEncode:r,encoding:i,shouldSplit:a,preserveNewlines:o}){let s=jh({binary:n,shouldEncode:r,encoding:i,shouldSplit:a,preserveNewlines:o});try{for await(let[t]of e)yield*lp(t,s,0)}catch(e){if(!t.signal.aborted)throw e}finally{yield*up(s)}},jh=({binary:e,shouldEncode:t,encoding:n,shouldSplit:r,preserveNewlines:i})=>[Zf(e,n,!t),Nf(e,i,!r,{})].filter(Boolean),Mh=async({stream:e,onStreamEnd:t,fdNumber:n,encoding:r,buffer:i,maxBuffer:a,lines:o,allMixed:s,stripFinalNewline:c,verboseInfo:l,streamInfo:u})=>{let d=Nh({stream:e,onStreamEnd:t,fdNumber:n,encoding:r,allMixed:s,verboseInfo:l,streamInfo:u});if(!i){await Promise.all([Ph(e),d]);return}let f=Mf(c,n),p=Th({stream:e,onStreamEnd:t,lines:o,encoding:r,stripFinalNewline:f,allMixed:s}),[m]=await Promise.all([Fh({stream:e,iterable:p,fdNumber:n,encoding:r,maxBuffer:a,lines:o}),d]);return m},Nh=async({stream:e,onStreamEnd:t,fdNumber:n,encoding:r,allMixed:i,verboseInfo:a,streamInfo:{fileDescriptors:o}})=>{if(!xp({stdioItems:o[n]?.stdioItems,encoding:r,verboseInfo:a,fdNumber:n}))return;let s=Th({stream:e,onStreamEnd:t,lines:!0,encoding:r,stripFinalNewline:!0,allMixed:i});await wp(s,e,n,a)},Ph=async e=>{await he(),e.readableFlowing===null&&e.resume()},Fh=async({stream:e,stream:{readableObjectMode:t},iterable:n,fdNumber:r,encoding:i,maxBuffer:a,lines:o})=>{try{return t||o?await Vl(n,{maxBuffer:a}):i===`buffer`?new Uint8Array(await Ul(n,{maxBuffer:a})):await iu(n,{maxBuffer:a})}catch(n){return Lh(cu({error:n,stream:e,readableObjectMode:t,lines:o,encoding:i,fdNumber:r}))}},Ih=async e=>{try{return await e}catch(e){return Lh(e)}},Lh=({bufferedData:e})=>ki(e)?new Uint8Array(e):e,Rh=async(e,t,n,{isSameDirection:r,stopOnExit:i=!1}={})=>{let a=zh(e,n),o=new AbortController;try{await Promise.race([...i?[n.exitPromise]:[],E(e,{cleanup:!0,signal:o.signal})])}catch(e){a.stdinCleanedUp||Hh(e,t,n,r)}finally{o.abort()}},zh=(e,{originalStreams:[t],subprocess:n})=>{let r={stdinCleanedUp:!1};return e===t&&Bh(e,n,r),r},Bh=(e,t,n)=>{let{_destroy:r}=e;e._destroy=(...i)=>{Vh(t,n),r.call(e,...i)}},Vh=({exitCode:e,signalCode:t},n)=>{(e!==null||t!==null)&&(n.stdinCleanedUp=!0)},Hh=(e,t,n,r)=>{if(!Uh(e,t,n,r))throw e},Uh=(e,t,n,r=!0)=>n.propagating?Kh(e)||Gh(e):(n.propagating=!0,Wh(n,t)===r?Kh(e):Gh(e)),Wh=({fileDescriptors:e},t)=>t!==`all`&&e[t].direction===`input`,Gh=e=>e?.code===`ERR_STREAM_PREMATURE_CLOSE`,Kh=e=>e?.code===`EPIPE`,qh=({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:a,verboseInfo:o,streamInfo:s})=>e.stdio.map((e,c)=>Jh({stream:e,fdNumber:c,encoding:t,buffer:n[c],maxBuffer:r[c],lines:i[c],allMixed:!1,stripFinalNewline:a,verboseInfo:o,streamInfo:s})),Jh=async({stream:e,fdNumber:t,encoding:n,buffer:r,maxBuffer:i,lines:a,allMixed:o,stripFinalNewline:s,verboseInfo:c,streamInfo:l})=>{if(!e)return;let u=Rh(e,t,l);if(Wh(l,t)){await u;return}let[d]=await Promise.all([Mh({stream:e,onStreamEnd:u,fdNumber:t,encoding:n,buffer:r,maxBuffer:i,lines:a,allMixed:o,stripFinalNewline:s,verboseInfo:c,streamInfo:l}),u]);return d},Yh=({stdout:e,stderr:t},{all:n})=>n&&(e||t)?Cm([e,t].filter(Boolean)):void 0,Xh=({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:a,verboseInfo:o,streamInfo:s})=>Jh({...Zh(e,n),fdNumber:`all`,encoding:t,maxBuffer:r[1]+r[2],lines:i[1]||i[2],allMixed:Qh(e),stripFinalNewline:a,verboseInfo:o,streamInfo:s}),Zh=({stdout:e,stderr:t,all:n},[,r,i])=>{let a=r||i;return a?r?i?{stream:n,buffer:a}:{stream:e,buffer:a}:{stream:t,buffer:a}:{stream:n,buffer:a}},Qh=({all:e,stdout:t,stderr:n})=>e&&t&&n&&t.readableObjectMode!==n.readableObjectMode,$h=e=>ma(e,`ipc`),eg=(e,t)=>{let n=Ya(e);Ga({type:`ipc`,verboseMessage:n,fdNumber:`ipc`,verboseInfo:t})},tg=async({subprocess:e,buffer:t,maxBuffer:n,ipc:r,ipcOutput:i,verboseInfo:a})=>{if(!r)return i;let o=$h(a),s=fa(t,`ipc`),c=fa(n,`ipc`);for await(let t of im({anyProcess:e,channel:e.channel,isSubprocess:!1,ipc:r,shouldAwait:!1,reference:!0}))s&&(uu(e,i,c),i.push(t)),o&&eg(t,a);return i},ng=async(e,t)=>(await Promise.allSettled([e]),t),rg=async({subprocess:e,options:{encoding:t,buffer:n,maxBuffer:r,lines:i,timeoutDuration:a,cancelSignal:o,gracefulCancel:s,forceKillAfterDelay:c,stripFinalNewline:l,ipc:u,ipcInput:d},context:f,verboseInfo:p,fileDescriptors:m,originalStreams:h,onInternalError:g,controller:_})=>{let v=Fp(e,f),y={originalStreams:h,fileDescriptors:m,subprocess:e,exitPromise:v,propagating:!1},b=qh({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:y}),x=Xh({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:y}),S=[],C=tg({subprocess:e,buffer:n,maxBuffer:r,ipc:u,ipcOutput:S,verboseInfo:p}),w=ig(h,e,y),ee=ag(m,y);try{return await Promise.race([Promise.all([{},Rp(v),Promise.all(b),x,C,Gc(e,d),...w,...ee]),g,og(e,_),...zc(e,a,f,_),...ms({subprocess:e,cancelSignal:o,gracefulCancel:s,context:f,controller:_}),...Fc({subprocess:e,cancelSignal:o,gracefulCancel:s,forceKillAfterDelay:c,context:f,controller:_})])}catch(e){return f.terminationReason??=`other`,Promise.all([{error:e},v,Promise.all(b.map(e=>Ih(e))),Ih(x),ng(C,S),Promise.allSettled(w),Promise.allSettled(ee)])}},ig=(e,t,n)=>e.map((e,r)=>e===t.stdio[r]?void 0:Rh(e,r,n)),ag=(e,t)=>e.flatMap(({stdioItems:e},n)=>e.filter(({value:e,stream:t=e})=>pl(t,{checkOpen:!1})&&!Xi(t)).map(({type:e,value:r,stream:i=r})=>Rh(i,n,t,{isSameDirection:pd.has(e),stopOnExit:e===`native`}))),og=async(e,{signal:t})=>{let[n]=await T(e,`error`,{signal:t});throw n},sg=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),cg=(e,t,n)=>{let r=e[n];r.has(t)||r.set(t,[]);let i=r.get(t),a=Ns();return i.push(a),{resolve:a.resolve.bind(a),promises:i}},lg=async({resolve:e,promises:t},n)=>{e();let[r]=await Promise.race([Promise.allSettled([!0,n]),Promise.all([!1,...t])]);return!r},ug=async e=>{if(e!==void 0)try{await fg(e)}catch{}},dg=async e=>{if(e!==void 0)try{await pg(e)}catch{}},fg=async e=>{await E(e,{cleanup:!0,readable:!1,writable:!0})},pg=async e=>{await E(e,{cleanup:!0,readable:!0,writable:!1})},mg=async(e,t)=>{if(await e,t)throw t},hg=(e,t,n)=>{n&&!Gh(n)?e.destroy(n):t&&e.destroy()},gg=({subprocess:e,concurrentStreams:t,encoding:n},{from:r,binary:i=!0,preserveNewlines:a=!0}={})=>{let o=i||Jc.has(n),{subprocessStdout:s,waitReadableDestroy:c}=_g(e,r,t),{readableEncoding:l,readableObjectMode:u,readableHighWaterMark:d}=vg(s,o),{read:f,onStdoutDataDone:p}=yg({subprocessStdout:s,subprocess:e,binary:o,encoding:n,preserveNewlines:a}),m=new we({read:f,destroy:ce(Sg.bind(void 0,{subprocessStdout:s,subprocess:e,waitReadableDestroy:c})),highWaterMark:d,objectMode:u,encoding:l});return xg({subprocessStdout:s,onStdoutDataDone:p,readable:m,subprocess:e}),m},_g=(e,t,n)=>{let r=Fs(e,t),i=cg(n,r,`readableDestroy`);return{subprocessStdout:r,waitReadableDestroy:i}},vg=({readableEncoding:e,readableObjectMode:t,readableHighWaterMark:n},r)=>r?{readableEncoding:e,readableObjectMode:t,readableHighWaterMark:n}:{readableEncoding:e,readableObjectMode:!0,readableHighWaterMark:Oh},yg=({subprocessStdout:e,subprocess:t,binary:n,encoding:r,preserveNewlines:i})=>{let a=Ns(),o=Ch({subprocessStdout:e,subprocess:t,binary:n,shouldEncode:!n,encoding:r,preserveNewlines:i});return{read(){bg(this,o,a)},onStdoutDataDone:a}},bg=async(e,t,n)=>{try{let{value:r,done:i}=await t.next();i?n.resolve():e.push(r)}catch{}},xg=async({subprocessStdout:e,onStdoutDataDone:t,readable:n,subprocess:r,subprocessStdin:i})=>{try{await pg(e),await r,await ug(i),await t,n.readable&&n.push(null)}catch(e){await ug(i),Cg(n,e)}},Sg=async({subprocessStdout:e,subprocess:t,waitReadableDestroy:n},r)=>{await lg(n,t)&&(Cg(e,r),await mg(t,r))},Cg=(e,t)=>{hg(e,e.readable,t)},wg=({subprocess:e,concurrentStreams:t},{to:n}={})=>{let{subprocessStdin:r,waitWritableFinal:i,waitWritableDestroy:a}=Tg(e,n,t),o=new Ee({...Eg(r,e,i),destroy:ce(Ag.bind(void 0,{subprocessStdin:r,subprocess:e,waitWritableFinal:i,waitWritableDestroy:a})),highWaterMark:r.writableHighWaterMark,objectMode:r.writableObjectMode});return kg(r,o),o},Tg=(e,t,n)=>{let r=Ps(e,t),i=cg(n,r,`writableFinal`),a=cg(n,r,`writableDestroy`);return{subprocessStdin:r,waitWritableFinal:i,waitWritableDestroy:a}},Eg=(e,t,n)=>({write:Dg.bind(void 0,e),final:ce(Og.bind(void 0,e,t,n))}),Dg=(e,t,n,r)=>{e.write(t,n)?r():e.once(`drain`,r)},Og=async(e,t,n)=>{await lg(n,t)&&(e.writable&&e.end(),await t)},kg=async(e,t,n)=>{try{await fg(e),t.writable&&t.end()}catch(e){await dg(n),jg(t,e)}},Ag=async({subprocessStdin:e,subprocess:t,waitWritableFinal:n,waitWritableDestroy:r},i)=>{await lg(n,t),await lg(r,t)&&(jg(e,i),await mg(t,i))},jg=(e,t)=>{hg(e,e.writable,t)},Mg=({subprocess:e,concurrentStreams:t,encoding:n},{from:r,to:i,binary:a=!0,preserveNewlines:o=!0}={})=>{let s=a||Jc.has(n),{subprocessStdout:c,waitReadableDestroy:l}=_g(e,r,t),{subprocessStdin:u,waitWritableFinal:d,waitWritableDestroy:f}=Tg(e,i,t),{readableEncoding:p,readableObjectMode:m,readableHighWaterMark:h}=vg(c,s),{read:g,onStdoutDataDone:_}=yg({subprocessStdout:c,subprocess:e,binary:s,encoding:n,preserveNewlines:o}),v=new Se({read:g,...Eg(u,e,d),destroy:ce(Ng.bind(void 0,{subprocessStdout:c,subprocessStdin:u,subprocess:e,waitReadableDestroy:l,waitWritableFinal:d,waitWritableDestroy:f})),readableHighWaterMark:h,writableHighWaterMark:u.writableHighWaterMark,readableObjectMode:m,writableObjectMode:u.writableObjectMode,encoding:p});return xg({subprocessStdout:c,onStdoutDataDone:_,readable:v,subprocess:e,subprocessStdin:u}),kg(u,v,c),v},Ng=async({subprocessStdout:e,subprocessStdin:t,subprocess:n,waitReadableDestroy:r,waitWritableFinal:i,waitWritableDestroy:a},o)=>{await Promise.all([Sg({subprocessStdout:e,subprocess:n,waitReadableDestroy:r},o),Ag({subprocessStdin:t,subprocess:n,waitWritableFinal:i,waitWritableDestroy:a},o)])},Pg=(e,t,{from:n,binary:r=!1,preserveNewlines:i=!1}={})=>{let a=r||Jc.has(t),o=Fs(e,n),s=Ch({subprocessStdout:o,subprocess:e,binary:a,shouldEncode:!0,encoding:t,preserveNewlines:i});return Fg(s,o,e)},Fg=async function*(e,t,n){try{yield*e}finally{t.readable&&t.destroy(),await n}},Ig=(e,{encoding:t})=>{let n=sg();e.readable=gg.bind(void 0,{subprocess:e,concurrentStreams:n,encoding:t}),e.writable=wg.bind(void 0,{subprocess:e,concurrentStreams:n}),e.duplex=Mg.bind(void 0,{subprocess:e,concurrentStreams:n,encoding:t}),e.iterable=Pg.bind(void 0,e,t),e[Symbol.asyncIterator]=Pg.bind(void 0,e,t,{})},Lg=(e,t)=>{for(let[n,r]of zg){let i=r.value.bind(t);Reflect.defineProperty(e,n,{...r,value:i})}},Rg=(async()=>{})().constructor.prototype,zg=[`then`,`catch`,`finally`].map(e=>[e,Reflect.getOwnPropertyDescriptor(Rg,e)]),Bg=(e,t,n,r)=>{let{file:i,commandArguments:a,command:o,escapedCommand:s,startTime:c,verboseInfo:l,options:u,fileDescriptors:d}=Vg(e,t,n),{subprocess:f,promise:p}=Ug({file:i,commandArguments:a,options:u,startTime:c,verboseInfo:l,command:o,escapedCommand:s,fileDescriptors:d});return f.pipe=bh.bind(void 0,{source:f,sourcePromise:p,boundOptions:{},createNested:r}),Lg(f,p),Is.set(f,{options:u,fileDescriptors:d}),f},Vg=(e,t,n)=>{let{command:r,escapedCommand:i,startTime:a,verboseInfo:o}=io(e,t,n),{file:s,commandArguments:c,options:l}=nl(e,t,n),u=Hg(l),d=ym(u,o);return{file:s,commandArguments:c,command:r,escapedCommand:i,startTime:a,verboseInfo:o,options:u,fileDescriptors:d}},Hg=({timeout:e,signal:t,...n})=>{if(t!==void 0)throw TypeError(`The "signal" option has been renamed to "cancelSignal" instead.`);return{...n,timeoutDuration:e}},Ug=({file:e,commandArguments:t,options:n,startTime:r,verboseInfo:i,command:a,escapedCommand:o,fileDescriptors:s})=>{let c;try{c=C(...al(e,t,n))}catch(e){return fm({error:e,command:a,escapedCommand:o,fileDescriptors:s,options:n,startTime:r,verboseInfo:i})}let l=new AbortController;be(1/0,l.signal);let u=[...c.stdio];Jm(c,s,l),eh(c,n,l);let d={},f=Ns();c.kill=ss.bind(void 0,{kill:c.kill.bind(c),options:n,onInternalError:f,context:d,controller:l}),c.all=Yh(c,n),Ig(c,n),lm(c,n);let p=Wg({subprocess:c,options:n,startTime:r,verboseInfo:i,fileDescriptors:s,originalStreams:u,command:a,escapedCommand:o,context:d,onInternalError:f,controller:l});return{subprocess:c,promise:p}},Wg=async({subprocess:e,options:t,startTime:n,verboseInfo:r,fileDescriptors:i,originalStreams:a,command:o,escapedCommand:s,context:c,onInternalError:l,controller:u})=>{let[d,[f,p],m,h,g]=await rg({subprocess:e,options:t,context:c,verboseInfo:r,fileDescriptors:i,originalStreams:a,onInternalError:l,controller:u});u.abort(),l.resolve();let _=m.map((e,n)=>jf(e,t,n)),v=jf(h,t,`all`),y=Gg({errorInfo:d,exitCode:f,signal:p,stdio:_,all:v,ipcOutput:g,context:c,options:t,command:o,escapedCommand:s,startTime:n});return Bu(y,r,t)},Gg=({errorInfo:e,exitCode:t,signal:n,stdio:r,all:i,ipcOutput:a,context:o,options:s,command:c,escapedCommand:l,startTime:u})=>`error`in e?Tu({error:e.error,command:c,escapedCommand:l,timedOut:o.terminationReason===`timeout`,isCanceled:o.terminationReason===`cancel`||o.terminationReason===`gracefulCancel`,isGracefullyCanceled:o.terminationReason===`gracefulCancel`,isMaxBuffer:e.error instanceof Fl,isForcefullyTerminated:o.isForcefullyTerminated,exitCode:t,signal:n,stdio:r,all:i,ipcOutput:a,options:s,startTime:u,isSync:!1}):Cu({command:c,escapedCommand:l,stdio:r,all:i,ipcOutput:a,options:s,startTime:u}),Kg=(e,t)=>{let n=Object.fromEntries(Object.entries(t).map(([t,n])=>[t,qg(t,e[t],n)]));return{...e,...n}},qg=(e,t,n)=>Jg.has(e)&&B(t)&&B(n)?{...t,...n}:n,Jg=new Set([`env`,...da]),Yg=(e,t,n,r)=>{let i=(e,t,r)=>Yg(e,t,n,r),a=(...a)=>Xg({mapArguments:e,deepOptions:n,boundOptions:t,setBoundExeca:r,createNested:i},...a);return r!==void 0&&r(a,i,t),a},Xg=({mapArguments:e,deepOptions:t={},boundOptions:n={},setBoundExeca:r,createNested:i},a,...o)=>{if(B(a))return i(e,Kg(n,a),r);let{file:s,commandArguments:c,options:l,isSync:u}=Zg({mapArguments:e,firstArgument:a,nextArguments:o,deepOptions:t,boundOptions:n});return u?Up(s,c,l):Bg(s,c,l,i)},Zg=({mapArguments:e,firstArgument:t,nextArguments:n,deepOptions:r,boundOptions:i})=>{let a=Vi(t)?Hi(t,n):[t,...n],[o,s,c]=Di(...a),l=Kg(Kg(r,i),c),{file:u=o,commandArguments:d=s,options:f=l,isSync:p=!1}=e({file:o,commandArguments:s,options:l});return{file:u,commandArguments:d,options:f,isSync:p}},Qg=({file:e,commandArguments:t})=>e_(e,t),$g=({file:e,commandArguments:t})=>({...e_(e,t),isSync:!0}),e_=(e,t)=>{if(t.length>0)throw TypeError(`The command and its arguments must be passed as a single string: ${e} ${t}.`);let[n,...r]=t_(e);return{file:n,commandArguments:r}},t_=e=>{if(typeof e!=`string`)throw TypeError(`The command must be a string: ${String(e)}.`);let t=e.trim();if(t===``)return[];let n=[];for(let e of t.split(n_)){let t=n.at(-1);t&&t.endsWith(`\\`)?n[n.length-1]=`${t.slice(0,-1)} ${e}`:n.push(e)}return n},n_=/ +/g,r_=(e,t,n)=>{e.sync=t(a_,n),e.s=e.sync},i_=({options:e})=>o_(e),a_=({options:e})=>({...o_(e),isSync:!0}),o_=e=>({options:{...s_(e),...e}}),s_=({input:e,inputFile:t,stdio:n})=>e===void 0&&t===void 0&&n===void 0?{stdin:`inherit`}:{},c_={preferLocal:!0},l_=Yg(()=>({}));Yg(()=>({isSync:!0})),Yg(Qg),Yg($g),Yg(Vc),Yg(i_,{},c_,r_);const{sendMessage:u_,getOneMessage:d_,getEachMessage:f_,getCancelSignal:p_}=um();var K=e(((exports,t)=>{let{FORCE_COLOR:n,NODE_DISABLE_COLORS:r,TERM:i}=process.env,a={enabled:!r&&i!==`dumb`&&n!==`0`,reset:c(0,0),bold:c(1,22),dim:c(2,22),italic:c(3,23),underline:c(4,24),inverse:c(7,27),hidden:c(8,28),strikethrough:c(9,29),black:c(30,39),red:c(31,39),green:c(32,39),yellow:c(33,39),blue:c(34,39),magenta:c(35,39),cyan:c(36,39),white:c(37,39),gray:c(90,39),grey:c(90,39),bgBlack:c(40,49),bgRed:c(41,49),bgGreen:c(42,49),bgYellow:c(43,49),bgBlue:c(44,49),bgMagenta:c(45,49),bgCyan:c(46,49),bgWhite:c(47,49)};function o(e,t){let n=0,r,i=``,a=``;for(;n<e.length;n++)r=e[n],i+=r.open,a+=r.close,t.includes(r.close)&&(t=t.replace(r.rgx,r.close+r.open));return i+t+a}function s(e,t){let n={has:e,keys:t};return n.reset=a.reset.bind(n),n.bold=a.bold.bind(n),n.dim=a.dim.bind(n),n.italic=a.italic.bind(n),n.underline=a.underline.bind(n),n.inverse=a.inverse.bind(n),n.hidden=a.hidden.bind(n),n.strikethrough=a.strikethrough.bind(n),n.black=a.black.bind(n),n.red=a.red.bind(n),n.green=a.green.bind(n),n.yellow=a.yellow.bind(n),n.blue=a.blue.bind(n),n.magenta=a.magenta.bind(n),n.cyan=a.cyan.bind(n),n.white=a.white.bind(n),n.gray=a.gray.bind(n),n.grey=a.grey.bind(n),n.bgBlack=a.bgBlack.bind(n),n.bgRed=a.bgRed.bind(n),n.bgGreen=a.bgGreen.bind(n),n.bgYellow=a.bgYellow.bind(n),n.bgBlue=a.bgBlue.bind(n),n.bgMagenta=a.bgMagenta.bind(n),n.bgCyan=a.bgCyan.bind(n),n.bgWhite=a.bgWhite.bind(n),n}function c(e,t){let n={open:`\x1b[${e}m`,close:`\x1b[${t}m`,rgx:RegExp(`\\x1b\\[${t}m`,`g`)};return function(t){return this!==void 0&&this.has!==void 0?(this.has.includes(e)||(this.has.push(e),this.keys.push(n)),t===void 0?this:a.enabled?o(this.keys,t+``):t+``):t===void 0?s([e],[n]):a.enabled?o([n],t+``):t+``}}t.exports=a})),m_=e(((exports,t)=>{t.exports=(e,t)=>{if(!(e.meta&&e.name!==`escape`)){if(e.ctrl){if(e.name===`a`)return`first`;if(e.name===`c`||e.name===`d`)return`abort`;if(e.name===`e`)return`last`;if(e.name===`g`)return`reset`}if(t){if(e.name===`j`)return`down`;if(e.name===`k`)return`up`}return e.name===`return`||e.name===`enter`?`submit`:e.name===`backspace`?`delete`:e.name===`delete`?`deleteForward`:e.name===`abort`?`abort`:e.name===`escape`?`exit`:e.name===`tab`?`next`:e.name===`pagedown`?`nextPage`:e.name===`pageup`?`prevPage`:e.name===`home`?`home`:e.name===`end`?`end`:e.name===`up`?`up`:e.name===`down`?`down`:e.name===`right`?`right`:e.name===`left`?`left`:!1}}})),h_=e(((exports,t)=>{t.exports=e=>{let t=[`[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)`,`(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))`].join(`|`),n=new RegExp(t,`g`);return typeof e==`string`?e.replace(n,``):e}})),q=e(((exports,t)=>{let n={to(e,t){return t?`[${t+1};${e+1}H`:`[${e+1}G`},move(e,t){let n=``;return e<0?n+=`[${-e}D`:e>0&&(n+=`[${e}C`),t<0?n+=`[${-t}A`:t>0&&(n+=`[${t}B`),n},up:(e=1)=>`[${e}A`,down:(e=1)=>`[${e}B`,forward:(e=1)=>`[${e}C`,backward:(e=1)=>`[${e}D`,nextLine:(e=1)=>`\x1B[E`.repeat(e),prevLine:(e=1)=>`\x1B[F`.repeat(e),left:`\x1B[G`,hide:`\x1B[?25l`,show:`\x1B[?25h`,save:`\x1B7`,restore:`\x1B8`};t.exports={cursor:n,scroll:{up:(e=1)=>`\x1B[S`.repeat(e),down:(e=1)=>`\x1B[T`.repeat(e)},erase:{screen:`\x1B[2J`,up:(e=1)=>`\x1B[1J`.repeat(e),down:(e=1)=>`\x1B[J`.repeat(e),line:`\x1B[2K`,lineEnd:`\x1B[K`,lineStart:`\x1B[1K`,lines(e){let t=``;for(let r=0;r<e;r++)t+=this.line+(r<e-1?n.up():``);return e&&(t+=n.left),t}},beep:`\x07`}})),g_=e(((exports,t)=>{function n(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(!n){if(Array.isArray(e)||(n=r(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var i=0,a=function(){};return{s:a,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:a}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
116
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,c;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,c=e},f:function(){try{!o&&n.return!=null&&n.return()}finally{if(s)throw c}}}}function r(e,t){if(e){if(typeof e==`string`)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return i(e,t)}}function i(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}let a=h_(),o=q(),s=o.erase,c=o.cursor,l=e=>[...a(e)].length;t.exports=function(e,t){if(!t)return s.line+c.to(0);let r=0,i=e.split(/\r?\n/);var a=n(i),o;try{for(a.s();!(o=a.n()).done;){let e=o.value;r+=1+Math.floor(Math.max(l(e)-1,0)/t)}}catch(e){a.e(e)}finally{a.f()}return s.lines(r)}})),__=e(((exports,t)=>{let n={arrowUp:`↑`,arrowDown:`↓`,arrowLeft:`←`,arrowRight:`→`,radioOn:`◉`,radioOff:`◯`,tick:`✔`,cross:`✖`,ellipsis:`…`,pointerSmall:`›`,line:`─`,pointer:`❯`},r={arrowUp:n.arrowUp,arrowDown:n.arrowDown,arrowLeft:n.arrowLeft,arrowRight:n.arrowRight,radioOn:`(*)`,radioOff:`( )`,tick:`√`,cross:`×`,ellipsis:`...`,pointerSmall:`»`,line:`─`,pointer:`>`};t.exports=process.platform===`win32`?r:n})),v_=e(((exports,t)=>{let n=K(),r=__(),i=Object.freeze({password:{scale:1,render:e=>`*`.repeat(e.length)},emoji:{scale:2,render:e=>`😃`.repeat(e.length)},invisible:{scale:0,render:e=>``},default:{scale:1,render:e=>`${e}`}}),a=e=>i[e]||i.default,o=Object.freeze({aborted:n.red(r.cross),done:n.green(r.tick),exited:n.yellow(r.cross),default:n.cyan(`?`)});t.exports={styles:i,render:a,symbols:o,symbol:(e,t,n)=>t?o.aborted:n?o.exited:e?o.done:o.default,delimiter:e=>n.gray(e?r.ellipsis:r.pointerSmall),item:(e,t)=>n.gray(e?t?r.pointerSmall:`+`:r.line)}})),y_=e(((exports,t)=>{let n=h_();t.exports=function(e,t){let r=String(n(e)||``).split(/\r?\n/);return t?r.map(e=>Math.ceil(e.length/t)).reduce((e,t)=>e+t):r.length}})),b_=e(((exports,t)=>{t.exports=(e,t={})=>{let n=Number.isSafeInteger(parseInt(t.margin))?Array(parseInt(t.margin)).fill(` `).join(``):t.margin||``,r=t.width;return(e||``).split(/\r?\n/g).map(e=>e.split(/\s+/g).reduce((e,t)=>(t.length+n.length>=r||e[e.length-1].length+t.length+1<r?e[e.length-1]+=` ${t}`:e.push(`${n}${t}`),e),[n]).join(`
117
- `)).join(`
118
- `)}})),x_=e(((exports,t)=>{t.exports=(e,t,n)=>{n=n||t;let r=Math.min(t-n,e-Math.floor(n/2));r<0&&(r=0);let i=Math.min(r+n,t);return{startIndex:r,endIndex:i}}})),J=e(((exports,t)=>{t.exports={action:m_(),clear:g_(),style:v_(),strip:h_(),figures:__(),lines:y_(),wrap:b_(),entriesToDisplay:x_()}})),Y=e(((exports,n)=>{let r=t(`readline`),i=J(),a=i.action,o=t(`events`),s=q(),c=s.beep,l=s.cursor,u=K();n.exports=class extends o{constructor(e={}){super(),this.firstRender=!0,this.in=e.stdin||process.stdin,this.out=e.stdout||process.stdout,this.onRender=(e.onRender||(()=>void 0)).bind(this);let t=r.createInterface({input:this.in,escapeCodeTimeout:50});r.emitKeypressEvents(this.in,t),this.in.isTTY&&this.in.setRawMode(!0);let n=[`SelectPrompt`,`MultiselectPrompt`].indexOf(this.constructor.name)>-1,i=(e,t)=>{let r=a(t,n);r===!1?this._&&this._(e,t):typeof this[r]==`function`?this[r](t):this.bell()};this.close=()=>{this.out.write(l.show),this.in.removeListener(`keypress`,i),this.in.isTTY&&this.in.setRawMode(!1),t.close(),this.emit(this.aborted?`abort`:this.exited?`exit`:`submit`,this.value),this.closed=!0},this.in.on(`keypress`,i)}fire(){this.emit(`state`,{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(c)}render(){this.onRender(u),this.firstRender&&(this.firstRender=!1)}}})),S_=e(((exports,t)=>{function n(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function r(e){return function(){var t=this,r=arguments;return new Promise(function(i,a){var o=e.apply(t,r);function s(e){n(o,i,a,s,c,`next`,e)}function c(e){n(o,i,a,s,c,`throw`,e)}s(void 0)})}}let i=K(),a=Y(),o=q(),s=o.erase,c=o.cursor,l=J(),u=l.style,d=l.clear,f=l.lines,p=l.figures;t.exports=class extends a{constructor(e={}){super(e),this.transform=u.render(e.style),this.scale=this.transform.scale,this.msg=e.message,this.initial=e.initial||``,this.validator=e.validate||(()=>!0),this.value=``,this.errorMsg=e.error||`Please Enter A Valid Value`,this.cursor=Number(!!this.initial),this.cursorOffset=0,this.clear=d(``,this.out.columns),this.render()}set value(e){!e&&this.initial?(this.placeholder=!0,this.rendered=i.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(e)),this._value=e,this.fire()}get value(){return this._value}reset(){this.value=``,this.cursor=Number(!!this.initial),this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write(`
119
- `),this.close()}validate(){var e=this;return r(function*(){let t=yield e.validator(e.value);typeof t==`string`&&(e.errorMsg=t,t=!1),e.error=!t})()}submit(){var e=this;return r(function*(){if(e.value=e.value||e.initial,e.cursorOffset=0,e.cursor=e.rendered.length,yield e.validate(),e.error){e.red=!0,e.fire(),e.render();return}e.done=!0,e.aborted=!1,e.fire(),e.render(),e.out.write(`
120
- `),e.close()})()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(e){this.placeholder||(this.cursor+=e,this.cursorOffset+=e)}_(e,t){let n=this.value.slice(0,this.cursor),r=this.value.slice(this.cursor);this.value=`${n}${e}${r}`,this.red=!1,this.cursor=this.placeholder?0:n.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let e=this.value.slice(0,this.cursor-1),t=this.value.slice(this.cursor);this.value=`${e}${t}`,this.red=!1,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let e=this.value.slice(0,this.cursor),t=this.value.slice(this.cursor+1);this.value=`${e}${t}`,this.red=!1,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length,this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render()}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(c.down(f(this.outputError,this.out.columns)-1)+d(this.outputError,this.out.columns)),this.out.write(d(this.outputText,this.out.columns))),super.render(),this.outputError=``,this.outputText=[u.symbol(this.done,this.aborted),i.bold(this.msg),u.delimiter(this.done),this.red?i.red(this.rendered):this.rendered].join(` `),this.error&&(this.outputError+=this.errorMsg.split(`
121
- `).reduce((e,t,n)=>e+`\n${n?` `:p.pointerSmall} ${i.red().italic(t)}`,``)),this.out.write(s.line+c.to(0)+this.outputText+c.save+this.outputError+c.restore+c.move(this.cursorOffset,0)))}}})),C_=e(((exports,t)=>{let n=K(),r=Y(),i=J(),a=i.style,o=i.clear,s=i.figures,c=i.wrap,l=i.entriesToDisplay,u=q(),d=u.cursor;t.exports=class extends r{constructor(e={}){super(e),this.msg=e.message,this.hint=e.hint||`- Use arrow-keys. Return to submit.`,this.warn=e.warn||`- This option is disabled`,this.cursor=e.initial||0,this.choices=e.choices.map((e,t)=>(typeof e==`string`&&(e={title:e,value:t}),{title:e&&(e.title||e.value||e),value:e&&(e.value===void 0?t:e.value),description:e&&e.description,selected:e&&e.selected,disabled:e&&e.disabled})),this.optionsPerPage=e.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=o(``,this.out.columns),this.render()}moveCursor(e){this.cursor=e,this.value=this.choices[e].value,this.fire()}reset(){this.moveCursor(0),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
122
- `),this.close()}submit(){this.selection.disabled?this.bell():(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
123
- `),this.close())}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){this.cursor===0?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render()}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(e,t){if(e===` `)return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(d.hide):this.out.write(o(this.outputText,this.out.columns)),super.render();let e=l(this.cursor,this.choices.length,this.optionsPerPage),t=e.startIndex,r=e.endIndex;if(this.outputText=[a.symbol(this.done,this.aborted),n.bold(this.msg),a.delimiter(!1),this.done?this.selection.title:this.selection.disabled?n.yellow(this.warn):n.gray(this.hint)].join(` `),!this.done){this.outputText+=`
124
- `;for(let e=t;e<r;e++){let i,a,o=``,l=this.choices[e];a=e===t&&t>0?s.arrowUp:e===r-1&&r<this.choices.length?s.arrowDown:` `,l.disabled?(i=this.cursor===e?n.gray().underline(l.title):n.strikethrough().gray(l.title),a=(this.cursor===e?n.bold().gray(s.pointer)+` `:` `)+a):(i=this.cursor===e?n.cyan().underline(l.title):l.title,a=(this.cursor===e?n.cyan(s.pointer)+` `:` `)+a,l.description&&this.cursor===e&&(o=` - ${l.description}`,(a.length+i.length+o.length>=this.out.columns||l.description.split(/\r?\n/).length>1)&&(o=`
125
- `+c(l.description,{margin:3,width:this.out.columns})))),this.outputText+=`${a} ${i}${n.gray(o)}\n`}}this.out.write(this.outputText)}}})),w_=e(((exports,t)=>{let n=K(),r=Y(),i=J(),a=i.style,o=i.clear,s=q(),c=s.cursor,l=s.erase;t.exports=class extends r{constructor(e={}){super(e),this.msg=e.message,this.value=!!e.initial,this.active=e.active||`on`,this.inactive=e.inactive||`off`,this.initialValue=this.value,this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
126
- `),this.close()}submit(){this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
127
- `),this.close()}deactivate(){if(this.value===!1)return this.bell();this.value=!1,this.render()}activate(){if(this.value===!0)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(e,t){if(e===` `)this.value=!this.value;else if(e===`1`)this.value=!0;else if(e===`0`)this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(c.hide):this.out.write(o(this.outputText,this.out.columns)),super.render(),this.outputText=[a.symbol(this.done,this.aborted),n.bold(this.msg),a.delimiter(this.done),this.value?this.inactive:n.cyan().underline(this.inactive),n.gray(`/`),this.value?n.cyan().underline(this.active):this.active].join(` `),this.out.write(l.line+c.to(0)+this.outputText))}}})),X=e(((exports,t)=>{t.exports=class e{constructor({token:e,date:t,parts:n,locales:r}){this.token=e,this.date=t||new Date,this.parts=n||[this],this.locales=r||{}}up(){}down(){}next(){let t=this.parts.indexOf(this);return this.parts.find((n,r)=>r>t&&n instanceof e)}setTo(e){}prev(){let t=[].concat(this.parts).reverse(),n=t.indexOf(this);return t.find((t,r)=>r>n&&t instanceof e)}toString(){return String(this.date)}}})),T_=e(((exports,t)=>{let n=X();t.exports=class extends n{constructor(e={}){super(e)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let e=this.date.getHours()>12?`pm`:`am`;return/\A/.test(this.token)?e.toUpperCase():e}}})),E_=e(((exports,t)=>{let n=X(),r=e=>(e%=10,e===1?`st`:e===2?`nd`:e===3?`rd`:`th`);t.exports=class extends n{constructor(e={}){super(e)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(e){this.date.setDate(parseInt(e.substr(-2)))}toString(){let e=this.date.getDate(),t=this.date.getDay();return this.token===`DD`?String(e).padStart(2,`0`):this.token===`Do`?e+r(e):this.token===`d`?t+1:this.token===`ddd`?this.locales.weekdaysShort[t]:this.token===`dddd`?this.locales.weekdays[t]:e}}})),D_=e(((exports,t)=>{let n=X();t.exports=class extends n{constructor(e={}){super(e)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(e){this.date.setHours(parseInt(e.substr(-2)))}toString(){let e=this.date.getHours();return/h/.test(this.token)&&(e=e%12||12),this.token.length>1?String(e).padStart(2,`0`):e}}})),O_=e(((exports,t)=>{let n=X();t.exports=class extends n{constructor(e={}){super(e)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(e){this.date.setMilliseconds(parseInt(e.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,`0`).substr(0,this.token.length)}}})),k_=e(((exports,t)=>{let n=X();t.exports=class extends n{constructor(e={}){super(e)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(e){this.date.setMinutes(parseInt(e.substr(-2)))}toString(){let e=this.date.getMinutes();return this.token.length>1?String(e).padStart(2,`0`):e}}})),A_=e(((exports,t)=>{let n=X();t.exports=class extends n{constructor(e={}){super(e)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(e){e=parseInt(e.substr(-2))-1,this.date.setMonth(e<0?0:e)}toString(){let e=this.date.getMonth(),t=this.token.length;return t===2?String(e+1).padStart(2,`0`):t===3?this.locales.monthsShort[e]:t===4?this.locales.months[e]:String(e+1)}}})),j_=e(((exports,t)=>{let n=X();t.exports=class extends n{constructor(e={}){super(e)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(e){this.date.setSeconds(parseInt(e.substr(-2)))}toString(){let e=this.date.getSeconds();return this.token.length>1?String(e).padStart(2,`0`):e}}})),M_=e(((exports,t)=>{let n=X();t.exports=class extends n{constructor(e={}){super(e)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(e){this.date.setFullYear(e.substr(-4))}toString(){let e=String(this.date.getFullYear()).padStart(4,`0`);return this.token.length===2?e.substr(-2):e}}})),N_=e(((exports,t)=>{t.exports={DatePart:X(),Meridiem:T_(),Day:E_(),Hours:D_(),Milliseconds:O_(),Minutes:k_(),Month:A_(),Seconds:j_(),Year:M_()}})),P_=e(((exports,t)=>{function n(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function r(e){return function(){var t=this,r=arguments;return new Promise(function(i,a){var o=e.apply(t,r);function s(e){n(o,i,a,s,c,`next`,e)}function c(e){n(o,i,a,s,c,`throw`,e)}s(void 0)})}}let i=K(),a=Y(),o=J(),s=o.style,c=o.clear,l=o.figures,u=q(),d=u.erase,f=u.cursor,p=N_(),m=p.DatePart,h=p.Meridiem,g=p.Day,_=p.Hours,v=p.Milliseconds,y=p.Minutes,b=p.Month,x=p.Seconds,S=p.Year,C=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g,w={1:({token:e})=>e.replace(/\\(.)/g,`$1`),2:e=>new g(e),3:e=>new b(e),4:e=>new S(e),5:e=>new h(e),6:e=>new _(e),7:e=>new y(e),8:e=>new x(e),9:e=>new v(e)},ee={months:`January,February,March,April,May,June,July,August,September,October,November,December`.split(`,`),monthsShort:`Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec`.split(`,`),weekdays:`Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday`.split(`,`),weekdaysShort:`Sun,Mon,Tue,Wed,Thu,Fri,Sat`.split(`,`)};t.exports=class extends a{constructor(e={}){super(e),this.msg=e.message,this.cursor=0,this.typed=``,this.locales=Object.assign(ee,e.locales),this._date=e.initial||new Date,this.errorMsg=e.error||`Please Enter A Valid Value`,this.validator=e.validate||(()=>!0),this.mask=e.mask||`YYYY-MM-DD HH:mm:ss`,this.clear=c(``,this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(e){e&&this._date.setTime(e.getTime())}set mask(e){let t;for(this.parts=[];t=C.exec(e);){let e=t.shift(),n=t.findIndex(e=>e!=null);this.parts.push(n in w?w[n]({token:t[n]||e,date:this.date,parts:this.parts,locales:this.locales}):t[n]||e)}let n=this.parts.reduce((e,t)=>(typeof t==`string`&&typeof e[e.length-1]==`string`?e[e.length-1]+=t:e.push(t),e),[]);this.parts.splice(0),this.parts.push(...n),this.reset()}moveCursor(e){this.typed=``,this.cursor=e,this.fire()}reset(){this.moveCursor(this.parts.findIndex(e=>e instanceof m)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
128
- `),this.close()}validate(){var e=this;return r(function*(){let t=yield e.validator(e.value);typeof t==`string`&&(e.errorMsg=t,t=!1),e.error=!t})()}submit(){var e=this;return r(function*(){if(yield e.validate(),e.error){e.color=`red`,e.fire(),e.render();return}e.done=!0,e.aborted=!1,e.fire(),e.render(),e.out.write(`
129
- `),e.close()})()}up(){this.typed=``,this.parts[this.cursor].up(),this.render()}down(){this.typed=``,this.parts[this.cursor].down(),this.render()}left(){let e=this.parts[this.cursor].prev();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render()}right(){let e=this.parts[this.cursor].next();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render()}next(){let e=this.parts[this.cursor].next();this.moveCursor(e?this.parts.indexOf(e):this.parts.findIndex(e=>e instanceof m)),this.render()}_(e){/\d/.test(e)&&(this.typed+=e,this.parts[this.cursor].setTo(this.typed),this.render())}render(){this.closed||(this.firstRender?this.out.write(f.hide):this.out.write(c(this.outputText,this.out.columns)),super.render(),this.outputText=[s.symbol(this.done,this.aborted),i.bold(this.msg),s.delimiter(!1),this.parts.reduce((e,t,n)=>e.concat(n===this.cursor&&!this.done?i.cyan().underline(t.toString()):t),[]).join(``)].join(` `),this.error&&(this.outputText+=this.errorMsg.split(`
130
- `).reduce((e,t,n)=>e+`\n${n?` `:l.pointerSmall} ${i.red().italic(t)}`,``)),this.out.write(d.line+f.to(0)+this.outputText))}}})),F_=e(((exports,t)=>{function n(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function r(e){return function(){var t=this,r=arguments;return new Promise(function(i,a){var o=e.apply(t,r);function s(e){n(o,i,a,s,c,`next`,e)}function c(e){n(o,i,a,s,c,`throw`,e)}s(void 0)})}}let i=K(),a=Y(),o=q(),s=o.cursor,c=o.erase,l=J(),u=l.style,d=l.figures,f=l.clear,p=l.lines,m=/[0-9]/,h=e=>e!==void 0,g=(e,t)=>{let n=Math.pow(10,t);return Math.round(e*n)/n};t.exports=class extends a{constructor(e={}){super(e),this.transform=u.render(e.style),this.msg=e.message,this.initial=h(e.initial)?e.initial:``,this.float=!!e.float,this.round=e.round||2,this.inc=e.increment||1,this.min=h(e.min)?e.min:-1/0,this.max=h(e.max)?e.max:1/0,this.errorMsg=e.error||`Please Enter A Valid Value`,this.validator=e.validate||(()=>!0),this.color=`cyan`,this.value=``,this.typed=``,this.lastHit=0,this.render()}set value(e){!e&&e!==0?(this.placeholder=!0,this.rendered=i.gray(this.transform.render(`${this.initial}`)),this._value=``):(this.placeholder=!1,this.rendered=this.transform.render(`${g(e,this.round)}`),this._value=g(e,this.round)),this.fire()}get value(){return this._value}parse(e){return this.float?parseFloat(e):parseInt(e)}valid(e){return e===`-`||e===`.`&&this.float||m.test(e)}reset(){this.typed=``,this.value=``,this.fire(),this.render()}exit(){this.abort()}abort(){let e=this.value;this.value=e===``?this.initial:e,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
131
- `),this.close()}validate(){var e=this;return r(function*(){let t=yield e.validator(e.value);typeof t==`string`&&(e.errorMsg=t,t=!1),e.error=!t})()}submit(){var e=this;return r(function*(){if(yield e.validate(),e.error){e.color=`red`,e.fire(),e.render();return}let t=e.value;e.value=t===``?e.initial:t,e.done=!0,e.aborted=!1,e.error=!1,e.fire(),e.render(),e.out.write(`
132
- `),e.close()})()}up(){if(this.typed=``,this.value===``&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color=`cyan`,this.fire(),this.render()}down(){if(this.typed=``,this.value===``&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color=`cyan`,this.fire(),this.render()}delete(){let e=this.value.toString();if(e.length===0)return this.bell();this.value=this.parse(e=e.slice(0,-1))||``,this.value!==``&&this.value<this.min&&(this.value=this.min),this.color=`cyan`,this.fire(),this.render()}next(){this.value=this.initial,this.fire(),this.render()}_(e,t){if(!this.valid(e))return this.bell();let n=Date.now();if(n-this.lastHit>1e3&&(this.typed=``),this.typed+=e,this.lastHit=n,this.color=`cyan`,e===`.`)return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.value<this.min&&(this.value=this.min),this.fire(),this.render()}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(s.down(p(this.outputError,this.out.columns)-1)+f(this.outputError,this.out.columns)),this.out.write(f(this.outputText,this.out.columns))),super.render(),this.outputError=``,this.outputText=[u.symbol(this.done,this.aborted),i.bold(this.msg),u.delimiter(this.done),!this.done||!this.done&&!this.placeholder?i[this.color]().underline(this.rendered):this.rendered].join(` `),this.error&&(this.outputError+=this.errorMsg.split(`
133
- `).reduce((e,t,n)=>e+`\n${n?` `:d.pointerSmall} ${i.red().italic(t)}`,``)),this.out.write(c.line+s.to(0)+this.outputText+s.save+this.outputError+s.restore))}}})),I_=e(((exports,t)=>{let n=K(),r=q(),i=r.cursor,a=Y(),o=J(),s=o.clear,c=o.figures,l=o.style,u=o.wrap,d=o.entriesToDisplay;t.exports=class extends a{constructor(e={}){super(e),this.msg=e.message,this.cursor=e.cursor||0,this.scrollIndex=e.cursor||0,this.hint=e.hint||``,this.warn=e.warn||`- This option is disabled -`,this.minSelected=e.min,this.showMinError=!1,this.maxChoices=e.max,this.instructions=e.instructions,this.optionsPerPage=e.optionsPerPage||10,this.value=e.choices.map((e,t)=>(typeof e==`string`&&(e={title:e,value:t}),{title:e&&(e.title||e.value||e),description:e&&e.description,value:e&&(e.value===void 0?t:e.value),selected:e&&e.selected,disabled:e&&e.disabled})),this.clear=s(``,this.out.columns),e.overrideRender||this.render()}reset(){this.value.map(e=>!e.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(e=>e.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
134
- `),this.close()}submit(){let e=this.value.filter(e=>e.selected);this.minSelected&&e.length<this.minSelected?(this.showMinError=!0,this.render()):(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
135
- `),this.close())}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.value.length,this.render()}up(){this.cursor===0?this.cursor=this.value.length-1:this.cursor--,this.render()}down(){this.cursor===this.value.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.value[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){let e=this.value[this.cursor];if(e.selected)e.selected=!1,this.render();else if(e.disabled||this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();else e.selected=!0,this.render()}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();let e=!this.value[this.cursor].selected;this.value.filter(e=>!e.disabled).forEach(t=>t.selected=e),this.render()}_(e,t){if(e===` `)this.handleSpaceToggle();else if(e===`a`)this.toggleAll();else return this.bell()}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions==`string`?this.instructions:`
136
- Instructions:
137
- ${c.arrowUp}/${c.arrowDown}: Highlight option\n ${c.arrowLeft}/${c.arrowRight}/[space]: Toggle selection\n`+(this.maxChoices===void 0?` a: Toggle all
138
- `:``)+` enter/return: Complete answer`:``}renderOption(e,t,r,i){let a=(t.selected?n.green(c.radioOn):c.radioOff)+` `+i+` `,o,s;return t.disabled?o=e===r?n.gray().underline(t.title):n.strikethrough().gray(t.title):(o=e===r?n.cyan().underline(t.title):t.title,e===r&&t.description&&(s=` - ${t.description}`,(a.length+o.length+s.length>=this.out.columns||t.description.split(/\r?\n/).length>1)&&(s=`
139
- `+u(t.description,{margin:a.length,width:this.out.columns})))),a+o+n.gray(s||``)}paginateOptions(e){if(e.length===0)return n.red(`No matches for this query.`);let t=d(this.cursor,e.length,this.optionsPerPage),r=t.startIndex,i=t.endIndex,a,o=[];for(let t=r;t<i;t++)a=t===r&&r>0?c.arrowUp:t===i-1&&i<e.length?c.arrowDown:` `,o.push(this.renderOption(this.cursor,e[t],t,a));return`
140
- `+o.join(`
141
- `)}renderOptions(e){return this.done?``:this.paginateOptions(e)}renderDoneOrInstructions(){if(this.done)return this.value.filter(e=>e.selected).map(e=>e.title).join(`, `);let e=[n.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&e.push(n.yellow(this.warn)),e.join(` `)}render(){if(this.closed)return;this.firstRender&&this.out.write(i.hide),super.render();let e=[l.symbol(this.done,this.aborted),n.bold(this.msg),l.delimiter(!1),this.renderDoneOrInstructions()].join(` `);this.showMinError&&(e+=n.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),e+=this.renderOptions(this.value),this.out.write(this.clear+e),this.clear=s(e,this.out.columns)}}})),L_=e(((exports,t)=>{function n(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function r(e){return function(){var t=this,r=arguments;return new Promise(function(i,a){var o=e.apply(t,r);function s(e){n(o,i,a,s,c,`next`,e)}function c(e){n(o,i,a,s,c,`throw`,e)}s(void 0)})}}let i=K(),a=Y(),o=q(),s=o.erase,c=o.cursor,l=J(),u=l.style,d=l.clear,f=l.figures,p=l.wrap,m=l.entriesToDisplay,h=(e,t)=>e[t]&&(e[t].value||e[t].title||e[t]),g=(e,t)=>e[t]&&(e[t].title||e[t].value||e[t]),_=(e,t)=>{let n=e.findIndex(e=>e.value===t||e.title===t);return n>-1?n:void 0};t.exports=class extends a{constructor(e={}){super(e),this.msg=e.message,this.suggest=e.suggest,this.choices=e.choices,this.initial=typeof e.initial==`number`?e.initial:_(e.choices,e.initial),this.select=this.initial||e.cursor||0,this.i18n={noMatches:e.noMatches||`no matches found`},this.fallback=e.fallback||this.initial,this.clearFirst=e.clearFirst||!1,this.suggestions=[],this.input=``,this.limit=e.limit||10,this.cursor=0,this.transform=u.render(e.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=d(``,this.out.columns),this.complete(this.render),this.render()}set fallback(e){this._fb=Number.isSafeInteger(parseInt(e))?parseInt(e):e}get fallback(){let e;return typeof this._fb==`number`?e=this.choices[this._fb]:typeof this._fb==`string`&&(e={title:this._fb}),e||this._fb||{title:this.i18n.noMatches}}moveSelect(e){this.select=e,this.suggestions.length>0?this.value=h(this.suggestions,e):this.value=this.fallback.value,this.fire()}complete(e){var t=this;return r(function*(){let n=t.completing=t.suggest(t.input,t.choices),r=yield n;if(t.completing!==n)return;t.suggestions=r.map((e,t,n)=>({title:g(n,t),value:h(n,t),description:e.description})),t.completing=!1;let i=Math.max(r.length-1,0);t.moveSelect(Math.min(i,t.select)),e&&e()})()}reset(){this.input=``,this.complete(()=>{this.moveSelect(this.initial===void 0?0:this.initial),this.render()}),this.render()}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
142
- `),this.close())}abort(){this.done=this.aborted=!0,this.exited=!1,this.fire(),this.render(),this.out.write(`
143
- `),this.close()}submit(){this.done=!0,this.aborted=this.exited=!1,this.fire(),this.render(),this.out.write(`
144
- `),this.close()}_(e,t){let n=this.input.slice(0,this.cursor),r=this.input.slice(this.cursor);this.input=`${n}${e}${r}`,this.cursor=n.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let e=this.input.slice(0,this.cursor-1),t=this.input.slice(this.cursor);this.input=`${e}${t}`,this.complete(this.render),--this.cursor,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let e=this.input.slice(0,this.cursor),t=this.input.slice(this.cursor+1);this.input=`${e}${t}`,this.complete(this.render),this.render()}first(){this.moveSelect(0),this.render()}last(){this.moveSelect(this.suggestions.length-1),this.render()}up(){this.select===0?this.moveSelect(this.suggestions.length-1):this.moveSelect(this.select-1),this.render()}down(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}next(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1)),this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0)),this.render()}left(){if(this.cursor<=0)return this.bell();--this.cursor,this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor+=1,this.render()}renderOption(e,t,n,r){let a,o=n?f.arrowUp:r?f.arrowDown:` `,s=t?i.cyan().underline(e.title):e.title;return o=(t?i.cyan(f.pointer)+` `:` `)+o,e.description&&(a=` - ${e.description}`,(o.length+s.length+a.length>=this.out.columns||e.description.split(/\r?\n/).length>1)&&(a=`
145
- `+p(e.description,{margin:3,width:this.out.columns}))),o+` `+s+i.gray(a||``)}render(){if(this.closed)return;this.firstRender?this.out.write(c.hide):this.out.write(d(this.outputText,this.out.columns)),super.render();let e=m(this.select,this.choices.length,this.limit),t=e.startIndex,n=e.endIndex;if(this.outputText=[u.symbol(this.done,this.aborted,this.exited),i.bold(this.msg),u.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(` `),!this.done){let e=this.suggestions.slice(t,n).map((e,r)=>this.renderOption(e,this.select===r+t,r===0&&t>0,r+t===n-1&&n<this.choices.length)).join(`
146
- `);this.outputText+=`
147
- `+(e||i.gray(this.fallback.title))}this.out.write(s.line+c.to(0)+this.outputText)}}})),R_=e(((exports,t)=>{let n=K(),r=q(),i=r.cursor,a=I_(),o=J(),s=o.clear,c=o.style,l=o.figures;t.exports=class extends a{constructor(e={}){e.overrideRender=!0,super(e),this.inputValue=``,this.clear=s(``,this.out.columns),this.filteredOptions=this.value,this.render()}last(){this.cursor=this.filteredOptions.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render()}up(){this.cursor===0?this.cursor=this.filteredOptions.length-1:this.cursor--,this.render()}down(){this.cursor===this.filteredOptions.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.filteredOptions[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions())}updateFilteredOptions(){let e=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(e=>this.inputValue?!!(typeof e.title==`string`&&e.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof e.value==`string`&&e.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);let t=this.filteredOptions.findIndex(t=>t===e);this.cursor=t<0?0:t,this.render()}handleSpaceToggle(){let e=this.filteredOptions[this.cursor];if(e.selected)e.selected=!1,this.render();else if(e.disabled||this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();else e.selected=!0,this.render()}handleInputChange(e){this.inputValue+=e,this.updateFilteredOptions()}_(e,t){e===` `?this.handleSpaceToggle():this.handleInputChange(e)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions==`string`?this.instructions:`
148
- Instructions:
149
- ${l.arrowUp}/${l.arrowDown}: Highlight option
150
- ${l.arrowLeft}/${l.arrowRight}/[space]: Toggle selection
151
- [a,b,c]/delete: Filter choices
152
- enter/return: Complete answer
153
- `:``}renderCurrentInput(){return`
154
- Filtered results for: ${this.inputValue?this.inputValue:n.gray(`Enter something to filter`)}\n`}renderOption(e,t,r){let i;return i=t.disabled?e===r?n.gray().underline(t.title):n.strikethrough().gray(t.title):e===r?n.cyan().underline(t.title):t.title,(t.selected?n.green(l.radioOn):l.radioOff)+` `+i}renderDoneOrInstructions(){if(this.done)return this.value.filter(e=>e.selected).map(e=>e.title).join(`, `);let e=[n.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&e.push(n.yellow(this.warn)),e.join(` `)}render(){if(this.closed)return;this.firstRender&&this.out.write(i.hide),super.render();let e=[c.symbol(this.done,this.aborted),n.bold(this.msg),c.delimiter(!1),this.renderDoneOrInstructions()].join(` `);this.showMinError&&(e+=n.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),e+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+e),this.clear=s(e,this.out.columns)}}})),z_=e(((exports,t)=>{let n=K(),r=Y(),i=J(),a=i.style,o=i.clear,s=q(),c=s.erase,l=s.cursor;t.exports=class extends r{constructor(e={}){super(e),this.msg=e.message,this.value=e.initial,this.initialValue=!!e.initial,this.yesMsg=e.yes||`yes`,this.yesOption=e.yesOption||`(Y/n)`,this.noMsg=e.no||`no`,this.noOption=e.noOption||`(y/N)`,this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
155
- `),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
156
- `),this.close()}_(e,t){return e.toLowerCase()===`y`?(this.value=!0,this.submit()):e.toLowerCase()===`n`?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(l.hide):this.out.write(o(this.outputText,this.out.columns)),super.render(),this.outputText=[a.symbol(this.done,this.aborted),n.bold(this.msg),a.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:n.gray(this.initialValue?this.yesOption:this.noOption)].join(` `),this.out.write(c.line+l.to(0)+this.outputText))}}})),B_=e(((exports,t)=>{t.exports={TextPrompt:S_(),SelectPrompt:C_(),TogglePrompt:w_(),DatePrompt:P_(),NumberPrompt:F_(),MultiselectPrompt:I_(),AutocompletePrompt:L_(),AutocompleteMultiselectPrompt:R_(),ConfirmPrompt:z_()}})),V_=e((exports=>{let t=exports,n=B_(),r=e=>e;function i(e,t,i={}){return new Promise((a,o)=>{let s=new n[e](t),c=i.onAbort||r,l=i.onSubmit||r,u=i.onExit||r;s.on(`state`,t.onState||r),s.on(`submit`,e=>a(l(e))),s.on(`exit`,e=>a(u(e))),s.on(`abort`,e=>o(c(e)))})}t.text=e=>i(`TextPrompt`,e),t.password=e=>(e.style=`password`,t.text(e)),t.invisible=e=>(e.style=`invisible`,t.text(e)),t.number=e=>i(`NumberPrompt`,e),t.date=e=>i(`DatePrompt`,e),t.confirm=e=>i(`ConfirmPrompt`,e),t.list=e=>{let t=e.separator||`,`;return i(`TextPrompt`,e,{onSubmit:e=>e.split(t).map(e=>e.trim())})},t.toggle=e=>i(`TogglePrompt`,e),t.select=e=>i(`SelectPrompt`,e),t.multiselect=e=>{e.choices=[].concat(e.choices||[]);let t=e=>e.filter(e=>e.selected).map(e=>e.value);return i(`MultiselectPrompt`,e,{onAbort:t,onSubmit:t})},t.autocompleteMultiselect=e=>{e.choices=[].concat(e.choices||[]);let t=e=>e.filter(e=>e.selected).map(e=>e.value);return i(`AutocompleteMultiselectPrompt`,e,{onAbort:t,onSubmit:t})};let a=(e,t)=>Promise.resolve(t.filter(t=>t.title.slice(0,e.length).toLowerCase()===e.toLowerCase()));t.autocomplete=e=>(e.suggest=e.suggest||a,e.choices=[].concat(e.choices||[]),i(`AutocompletePrompt`,e))})),H_=e(((exports,t)=>{function n(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function r(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]==null?{}:arguments[t];t%2?n(Object(r),!0).forEach(function(t){i(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(!n){if(Array.isArray(e)||(n=o(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
157
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,s=!1,c;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,c=e},f:function(){try{!a&&n.return!=null&&n.return()}finally{if(s)throw c}}}}function o(e,t){if(e){if(typeof e==`string`)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return s(e,t)}}function s(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function c(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function l(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var a=e.apply(t,n);function o(e){c(a,r,i,o,s,`next`,e)}function s(e){c(a,r,i,o,s,`throw`,e)}o(void 0)})}}let u=V_(),d=[`suggest`,`format`,`onState`,`validate`,`onRender`,`type`],f=()=>{};function p(){return m.apply(this,arguments)}function m(){return m=l(function*(e=[],{onSubmit:t=f,onCancel:n=f}={}){let i={},o=p._override||{};e=[].concat(e);let s,c,m,g,_,v,y=function(){var e=l(function*(e,t,n=!1){if(!(!n&&e.validate&&e.validate(t)!==!0))return e.format?yield e.format(t,i):t});return function(t,n){return e.apply(this,arguments)}}();var b=a(e),x;try{for(b.s();!(x=b.n()).done;){c=x.value;var S=c;if(g=S.name,_=S.type,typeof _==`function`&&(_=yield _(s,r({},i),c),c.type=_),_){for(let e in c){if(d.includes(e))continue;let t=c[e];c[e]=typeof t==`function`?yield t(s,r({},i),v):t}if(v=c,typeof c.message!=`string`)throw Error(`prompt message is required`);var C=c;if(g=C.name,_=C.type,u[_]===void 0)throw Error(`prompt type (${_}) is not defined`);if(o[c.name]!==void 0&&(s=yield y(c,o[c.name]),s!==void 0)){i[g]=s;continue}try{s=p._injected?h(p._injected,c.initial):yield u[_](c),i[g]=s=yield y(c,s,!0),m=yield t(c,s,i)}catch(e){m=!(yield n(c,i))}if(m)return i}}}catch(e){b.e(e)}finally{b.f()}return i}),m.apply(this,arguments)}function h(e,t){let n=e.shift();if(n instanceof Error)throw n;return n===void 0?t:n}function g(e){p._injected=(p._injected||[]).concat(e)}function _(e){p._override=Object.assign({},e)}t.exports=Object.assign(p,{prompt:p,prompts:u,inject:g,override:_})})),U_=e(((exports,t)=>{t.exports=(e,t)=>{if(!(e.meta&&e.name!==`escape`)){if(e.ctrl){if(e.name===`a`)return`first`;if(e.name===`c`||e.name===`d`)return`abort`;if(e.name===`e`)return`last`;if(e.name===`g`)return`reset`}if(t){if(e.name===`j`)return`down`;if(e.name===`k`)return`up`}return e.name===`return`||e.name===`enter`?`submit`:e.name===`backspace`?`delete`:e.name===`delete`?`deleteForward`:e.name===`abort`?`abort`:e.name===`escape`?`exit`:e.name===`tab`?`next`:e.name===`pagedown`?`nextPage`:e.name===`pageup`?`prevPage`:e.name===`home`?`home`:e.name===`end`?`end`:e.name===`up`?`up`:e.name===`down`?`down`:e.name===`right`?`right`:e.name===`left`?`left`:!1}}})),W_=e(((exports,t)=>{t.exports=e=>{let t=[`[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)`,`(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))`].join(`|`),n=new RegExp(t,`g`);return typeof e==`string`?e.replace(n,``):e}})),G_=e(((exports,t)=>{let n=W_(),{erase:r,cursor:i}=q(),a=e=>[...n(e)].length;t.exports=function(e,t){if(!t)return r.line+i.to(0);let n=0,o=e.split(/\r?\n/);for(let e of o)n+=1+Math.floor(Math.max(a(e)-1,0)/t);return r.lines(n)}})),K_=e(((exports,t)=>{let n={arrowUp:`↑`,arrowDown:`↓`,arrowLeft:`←`,arrowRight:`→`,radioOn:`◉`,radioOff:`◯`,tick:`✔`,cross:`✖`,ellipsis:`…`,pointerSmall:`›`,line:`─`,pointer:`❯`},r={arrowUp:n.arrowUp,arrowDown:n.arrowDown,arrowLeft:n.arrowLeft,arrowRight:n.arrowRight,radioOn:`(*)`,radioOff:`( )`,tick:`√`,cross:`×`,ellipsis:`...`,pointerSmall:`»`,line:`─`,pointer:`>`};t.exports=process.platform===`win32`?r:n})),q_=e(((exports,t)=>{let n=K(),r=K_(),i=Object.freeze({password:{scale:1,render:e=>`*`.repeat(e.length)},emoji:{scale:2,render:e=>`😃`.repeat(e.length)},invisible:{scale:0,render:e=>``},default:{scale:1,render:e=>`${e}`}}),a=e=>i[e]||i.default,o=Object.freeze({aborted:n.red(r.cross),done:n.green(r.tick),exited:n.yellow(r.cross),default:n.cyan(`?`)});t.exports={styles:i,render:a,symbols:o,symbol:(e,t,n)=>t?o.aborted:n?o.exited:e?o.done:o.default,delimiter:e=>n.gray(e?r.ellipsis:r.pointerSmall),item:(e,t)=>n.gray(e?t?r.pointerSmall:`+`:r.line)}})),J_=e(((exports,t)=>{let n=W_();t.exports=function(e,t){let r=String(n(e)||``).split(/\r?\n/);return t?r.map(e=>Math.ceil(e.length/t)).reduce((e,t)=>e+t):r.length}})),Y_=e(((exports,t)=>{t.exports=(e,t={})=>{let n=Number.isSafeInteger(parseInt(t.margin))?Array(parseInt(t.margin)).fill(` `).join(``):t.margin||``,r=t.width;return(e||``).split(/\r?\n/g).map(e=>e.split(/\s+/g).reduce((e,t)=>(t.length+n.length>=r||e[e.length-1].length+t.length+1<r?e[e.length-1]+=` ${t}`:e.push(`${n}${t}`),e),[n]).join(`
158
- `)).join(`
159
- `)}})),X_=e(((exports,t)=>{t.exports=(e,t,n)=>{n=n||t;let r=Math.min(t-n,e-Math.floor(n/2));r<0&&(r=0);let i=Math.min(r+n,t);return{startIndex:r,endIndex:i}}})),Z=e(((exports,t)=>{t.exports={action:U_(),clear:G_(),style:q_(),strip:W_(),figures:K_(),lines:J_(),wrap:Y_(),entriesToDisplay:X_()}})),Q=e(((exports,n)=>{let r=t(`readline`),{action:i}=Z(),a=t(`events`),{beep:o,cursor:s}=q(),c=K();n.exports=class extends a{constructor(e={}){super(),this.firstRender=!0,this.in=e.stdin||process.stdin,this.out=e.stdout||process.stdout,this.onRender=(e.onRender||(()=>void 0)).bind(this);let t=r.createInterface({input:this.in,escapeCodeTimeout:50});r.emitKeypressEvents(this.in,t),this.in.isTTY&&this.in.setRawMode(!0);let n=[`SelectPrompt`,`MultiselectPrompt`].indexOf(this.constructor.name)>-1,a=(e,t)=>{let r=i(t,n);r===!1?this._&&this._(e,t):typeof this[r]==`function`?this[r](t):this.bell()};this.close=()=>{this.out.write(s.show),this.in.removeListener(`keypress`,a),this.in.isTTY&&this.in.setRawMode(!1),t.close(),this.emit(this.aborted?`abort`:this.exited?`exit`:`submit`,this.value),this.closed=!0},this.in.on(`keypress`,a)}fire(){this.emit(`state`,{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(o)}render(){this.onRender(c),this.firstRender&&(this.firstRender=!1)}}})),Z_=e(((exports,t)=>{let n=K(),r=Q(),{erase:i,cursor:a}=q(),{style:o,clear:s,lines:c,figures:l}=Z();t.exports=class extends r{constructor(e={}){super(e),this.transform=o.render(e.style),this.scale=this.transform.scale,this.msg=e.message,this.initial=e.initial||``,this.validator=e.validate||(()=>!0),this.value=``,this.errorMsg=e.error||`Please Enter A Valid Value`,this.cursor=Number(!!this.initial),this.cursorOffset=0,this.clear=s(``,this.out.columns),this.render()}set value(e){!e&&this.initial?(this.placeholder=!0,this.rendered=n.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(e)),this._value=e,this.fire()}get value(){return this._value}reset(){this.value=``,this.cursor=Number(!!this.initial),this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write(`
160
- `),this.close()}async validate(){let e=await this.validator(this.value);typeof e==`string`&&(this.errorMsg=e,e=!1),this.error=!e}async submit(){if(this.value=this.value||this.initial,this.cursorOffset=0,this.cursor=this.rendered.length,await this.validate(),this.error){this.red=!0,this.fire(),this.render();return}this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
161
- `),this.close()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(e){this.placeholder||(this.cursor+=e,this.cursorOffset+=e)}_(e,t){let n=this.value.slice(0,this.cursor),r=this.value.slice(this.cursor);this.value=`${n}${e}${r}`,this.red=!1,this.cursor=this.placeholder?0:n.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let e=this.value.slice(0,this.cursor-1),t=this.value.slice(this.cursor);this.value=`${e}${t}`,this.red=!1,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let e=this.value.slice(0,this.cursor),t=this.value.slice(this.cursor+1);this.value=`${e}${t}`,this.red=!1,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length,this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render()}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(a.down(c(this.outputError,this.out.columns)-1)+s(this.outputError,this.out.columns)),this.out.write(s(this.outputText,this.out.columns))),super.render(),this.outputError=``,this.outputText=[o.symbol(this.done,this.aborted),n.bold(this.msg),o.delimiter(this.done),this.red?n.red(this.rendered):this.rendered].join(` `),this.error&&(this.outputError+=this.errorMsg.split(`
162
- `).reduce((e,t,r)=>e+`\n${r?` `:l.pointerSmall} ${n.red().italic(t)}`,``)),this.out.write(i.line+a.to(0)+this.outputText+a.save+this.outputError+a.restore+a.move(this.cursorOffset,0)))}}})),Q_=e(((exports,t)=>{let n=K(),r=Q(),{style:i,clear:a,figures:o,wrap:s,entriesToDisplay:c}=Z(),{cursor:l}=q();t.exports=class extends r{constructor(e={}){super(e),this.msg=e.message,this.hint=e.hint||`- Use arrow-keys. Return to submit.`,this.warn=e.warn||`- This option is disabled`,this.cursor=e.initial||0,this.choices=e.choices.map((e,t)=>(typeof e==`string`&&(e={title:e,value:t}),{title:e&&(e.title||e.value||e),value:e&&(e.value===void 0?t:e.value),description:e&&e.description,selected:e&&e.selected,disabled:e&&e.disabled})),this.optionsPerPage=e.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=a(``,this.out.columns),this.render()}moveCursor(e){this.cursor=e,this.value=this.choices[e].value,this.fire()}reset(){this.moveCursor(0),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
163
- `),this.close()}submit(){this.selection.disabled?this.bell():(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
164
- `),this.close())}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){this.cursor===0?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render()}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(e,t){if(e===` `)return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(l.hide):this.out.write(a(this.outputText,this.out.columns)),super.render();let{startIndex:e,endIndex:t}=c(this.cursor,this.choices.length,this.optionsPerPage);if(this.outputText=[i.symbol(this.done,this.aborted),n.bold(this.msg),i.delimiter(!1),this.done?this.selection.title:this.selection.disabled?n.yellow(this.warn):n.gray(this.hint)].join(` `),!this.done){this.outputText+=`
165
- `;for(let r=e;r<t;r++){let i,a,c=``,l=this.choices[r];a=r===e&&e>0?o.arrowUp:r===t-1&&t<this.choices.length?o.arrowDown:` `,l.disabled?(i=this.cursor===r?n.gray().underline(l.title):n.strikethrough().gray(l.title),a=(this.cursor===r?n.bold().gray(o.pointer)+` `:` `)+a):(i=this.cursor===r?n.cyan().underline(l.title):l.title,a=(this.cursor===r?n.cyan(o.pointer)+` `:` `)+a,l.description&&this.cursor===r&&(c=` - ${l.description}`,(a.length+i.length+c.length>=this.out.columns||l.description.split(/\r?\n/).length>1)&&(c=`
166
- `+s(l.description,{margin:3,width:this.out.columns})))),this.outputText+=`${a} ${i}${n.gray(c)}\n`}}this.out.write(this.outputText)}}})),$_=e(((exports,t)=>{let n=K(),r=Q(),{style:i,clear:a}=Z(),{cursor:o,erase:s}=q();t.exports=class extends r{constructor(e={}){super(e),this.msg=e.message,this.value=!!e.initial,this.active=e.active||`on`,this.inactive=e.inactive||`off`,this.initialValue=this.value,this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
167
- `),this.close()}submit(){this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
168
- `),this.close()}deactivate(){if(this.value===!1)return this.bell();this.value=!1,this.render()}activate(){if(this.value===!0)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(e,t){if(e===` `)this.value=!this.value;else if(e===`1`)this.value=!0;else if(e===`0`)this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(o.hide):this.out.write(a(this.outputText,this.out.columns)),super.render(),this.outputText=[i.symbol(this.done,this.aborted),n.bold(this.msg),i.delimiter(this.done),this.value?this.inactive:n.cyan().underline(this.inactive),n.gray(`/`),this.value?n.cyan().underline(this.active):this.active].join(` `),this.out.write(s.line+o.to(0)+this.outputText))}}})),$=e(((exports,t)=>{t.exports=class e{constructor({token:e,date:t,parts:n,locales:r}){this.token=e,this.date=t||new Date,this.parts=n||[this],this.locales=r||{}}up(){}down(){}next(){let t=this.parts.indexOf(this);return this.parts.find((n,r)=>r>t&&n instanceof e)}setTo(e){}prev(){let t=[].concat(this.parts).reverse(),n=t.indexOf(this);return t.find((t,r)=>r>n&&t instanceof e)}toString(){return String(this.date)}}})),ev=e(((exports,t)=>{let n=$();t.exports=class extends n{constructor(e={}){super(e)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let e=this.date.getHours()>12?`pm`:`am`;return/\A/.test(this.token)?e.toUpperCase():e}}})),tv=e(((exports,t)=>{let n=$(),r=e=>(e%=10,e===1?`st`:e===2?`nd`:e===3?`rd`:`th`);t.exports=class extends n{constructor(e={}){super(e)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(e){this.date.setDate(parseInt(e.substr(-2)))}toString(){let e=this.date.getDate(),t=this.date.getDay();return this.token===`DD`?String(e).padStart(2,`0`):this.token===`Do`?e+r(e):this.token===`d`?t+1:this.token===`ddd`?this.locales.weekdaysShort[t]:this.token===`dddd`?this.locales.weekdays[t]:e}}})),nv=e(((exports,t)=>{let n=$();t.exports=class extends n{constructor(e={}){super(e)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(e){this.date.setHours(parseInt(e.substr(-2)))}toString(){let e=this.date.getHours();return/h/.test(this.token)&&(e=e%12||12),this.token.length>1?String(e).padStart(2,`0`):e}}})),rv=e(((exports,t)=>{let n=$();t.exports=class extends n{constructor(e={}){super(e)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(e){this.date.setMilliseconds(parseInt(e.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,`0`).substr(0,this.token.length)}}})),iv=e(((exports,t)=>{let n=$();t.exports=class extends n{constructor(e={}){super(e)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(e){this.date.setMinutes(parseInt(e.substr(-2)))}toString(){let e=this.date.getMinutes();return this.token.length>1?String(e).padStart(2,`0`):e}}})),av=e(((exports,t)=>{let n=$();t.exports=class extends n{constructor(e={}){super(e)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(e){e=parseInt(e.substr(-2))-1,this.date.setMonth(e<0?0:e)}toString(){let e=this.date.getMonth(),t=this.token.length;return t===2?String(e+1).padStart(2,`0`):t===3?this.locales.monthsShort[e]:t===4?this.locales.months[e]:String(e+1)}}})),ov=e(((exports,t)=>{let n=$();t.exports=class extends n{constructor(e={}){super(e)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(e){this.date.setSeconds(parseInt(e.substr(-2)))}toString(){let e=this.date.getSeconds();return this.token.length>1?String(e).padStart(2,`0`):e}}})),sv=e(((exports,t)=>{let n=$();t.exports=class extends n{constructor(e={}){super(e)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(e){this.date.setFullYear(e.substr(-4))}toString(){let e=String(this.date.getFullYear()).padStart(4,`0`);return this.token.length===2?e.substr(-2):e}}})),cv=e(((exports,t)=>{t.exports={DatePart:$(),Meridiem:ev(),Day:tv(),Hours:nv(),Milliseconds:rv(),Minutes:iv(),Month:av(),Seconds:ov(),Year:sv()}})),lv=e(((exports,t)=>{let n=K(),r=Q(),{style:i,clear:a,figures:o}=Z(),{erase:s,cursor:c}=q(),{DatePart:l,Meridiem:u,Day:d,Hours:f,Milliseconds:p,Minutes:m,Month:h,Seconds:g,Year:_}=cv(),v=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g,y={1:({token:e})=>e.replace(/\\(.)/g,`$1`),2:e=>new d(e),3:e=>new h(e),4:e=>new _(e),5:e=>new u(e),6:e=>new f(e),7:e=>new m(e),8:e=>new g(e),9:e=>new p(e)},b={months:`January,February,March,April,May,June,July,August,September,October,November,December`.split(`,`),monthsShort:`Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec`.split(`,`),weekdays:`Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday`.split(`,`),weekdaysShort:`Sun,Mon,Tue,Wed,Thu,Fri,Sat`.split(`,`)};t.exports=class extends r{constructor(e={}){super(e),this.msg=e.message,this.cursor=0,this.typed=``,this.locales=Object.assign(b,e.locales),this._date=e.initial||new Date,this.errorMsg=e.error||`Please Enter A Valid Value`,this.validator=e.validate||(()=>!0),this.mask=e.mask||`YYYY-MM-DD HH:mm:ss`,this.clear=a(``,this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(e){e&&this._date.setTime(e.getTime())}set mask(e){let t;for(this.parts=[];t=v.exec(e);){let e=t.shift(),n=t.findIndex(e=>e!=null);this.parts.push(n in y?y[n]({token:t[n]||e,date:this.date,parts:this.parts,locales:this.locales}):t[n]||e)}let n=this.parts.reduce((e,t)=>(typeof t==`string`&&typeof e[e.length-1]==`string`?e[e.length-1]+=t:e.push(t),e),[]);this.parts.splice(0),this.parts.push(...n),this.reset()}moveCursor(e){this.typed=``,this.cursor=e,this.fire()}reset(){this.moveCursor(this.parts.findIndex(e=>e instanceof l)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
169
- `),this.close()}async validate(){let e=await this.validator(this.value);typeof e==`string`&&(this.errorMsg=e,e=!1),this.error=!e}async submit(){if(await this.validate(),this.error){this.color=`red`,this.fire(),this.render();return}this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
170
- `),this.close()}up(){this.typed=``,this.parts[this.cursor].up(),this.render()}down(){this.typed=``,this.parts[this.cursor].down(),this.render()}left(){let e=this.parts[this.cursor].prev();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render()}right(){let e=this.parts[this.cursor].next();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render()}next(){let e=this.parts[this.cursor].next();this.moveCursor(e?this.parts.indexOf(e):this.parts.findIndex(e=>e instanceof l)),this.render()}_(e){/\d/.test(e)&&(this.typed+=e,this.parts[this.cursor].setTo(this.typed),this.render())}render(){this.closed||(this.firstRender?this.out.write(c.hide):this.out.write(a(this.outputText,this.out.columns)),super.render(),this.outputText=[i.symbol(this.done,this.aborted),n.bold(this.msg),i.delimiter(!1),this.parts.reduce((e,t,r)=>e.concat(r===this.cursor&&!this.done?n.cyan().underline(t.toString()):t),[]).join(``)].join(` `),this.error&&(this.outputText+=this.errorMsg.split(`
171
- `).reduce((e,t,r)=>e+`\n${r?` `:o.pointerSmall} ${n.red().italic(t)}`,``)),this.out.write(s.line+c.to(0)+this.outputText))}}})),uv=e(((exports,t)=>{let n=K(),r=Q(),{cursor:i,erase:a}=q(),{style:o,figures:s,clear:c,lines:l}=Z(),u=/[0-9]/,d=e=>e!==void 0,f=(e,t)=>{let n=Math.pow(10,t);return Math.round(e*n)/n};t.exports=class extends r{constructor(e={}){super(e),this.transform=o.render(e.style),this.msg=e.message,this.initial=d(e.initial)?e.initial:``,this.float=!!e.float,this.round=e.round||2,this.inc=e.increment||1,this.min=d(e.min)?e.min:-1/0,this.max=d(e.max)?e.max:1/0,this.errorMsg=e.error||`Please Enter A Valid Value`,this.validator=e.validate||(()=>!0),this.color=`cyan`,this.value=``,this.typed=``,this.lastHit=0,this.render()}set value(e){!e&&e!==0?(this.placeholder=!0,this.rendered=n.gray(this.transform.render(`${this.initial}`)),this._value=``):(this.placeholder=!1,this.rendered=this.transform.render(`${f(e,this.round)}`),this._value=f(e,this.round)),this.fire()}get value(){return this._value}parse(e){return this.float?parseFloat(e):parseInt(e)}valid(e){return e===`-`||e===`.`&&this.float||u.test(e)}reset(){this.typed=``,this.value=``,this.fire(),this.render()}exit(){this.abort()}abort(){let e=this.value;this.value=e===``?this.initial:e,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
172
- `),this.close()}async validate(){let e=await this.validator(this.value);typeof e==`string`&&(this.errorMsg=e,e=!1),this.error=!e}async submit(){if(await this.validate(),this.error){this.color=`red`,this.fire(),this.render();return}let e=this.value;this.value=e===``?this.initial:e,this.done=!0,this.aborted=!1,this.error=!1,this.fire(),this.render(),this.out.write(`
173
- `),this.close()}up(){if(this.typed=``,this.value===``&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color=`cyan`,this.fire(),this.render()}down(){if(this.typed=``,this.value===``&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color=`cyan`,this.fire(),this.render()}delete(){let e=this.value.toString();if(e.length===0)return this.bell();this.value=this.parse(e=e.slice(0,-1))||``,this.value!==``&&this.value<this.min&&(this.value=this.min),this.color=`cyan`,this.fire(),this.render()}next(){this.value=this.initial,this.fire(),this.render()}_(e,t){if(!this.valid(e))return this.bell();let n=Date.now();if(n-this.lastHit>1e3&&(this.typed=``),this.typed+=e,this.lastHit=n,this.color=`cyan`,e===`.`)return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.value<this.min&&(this.value=this.min),this.fire(),this.render()}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(i.down(l(this.outputError,this.out.columns)-1)+c(this.outputError,this.out.columns)),this.out.write(c(this.outputText,this.out.columns))),super.render(),this.outputError=``,this.outputText=[o.symbol(this.done,this.aborted),n.bold(this.msg),o.delimiter(this.done),!this.done||!this.done&&!this.placeholder?n[this.color]().underline(this.rendered):this.rendered].join(` `),this.error&&(this.outputError+=this.errorMsg.split(`
174
- `).reduce((e,t,r)=>e+`\n${r?` `:s.pointerSmall} ${n.red().italic(t)}`,``)),this.out.write(a.line+i.to(0)+this.outputText+i.save+this.outputError+i.restore))}}})),dv=e(((exports,t)=>{let n=K(),{cursor:r}=q(),i=Q(),{clear:a,figures:o,style:s,wrap:c,entriesToDisplay:l}=Z();t.exports=class extends i{constructor(e={}){super(e),this.msg=e.message,this.cursor=e.cursor||0,this.scrollIndex=e.cursor||0,this.hint=e.hint||``,this.warn=e.warn||`- This option is disabled -`,this.minSelected=e.min,this.showMinError=!1,this.maxChoices=e.max,this.instructions=e.instructions,this.optionsPerPage=e.optionsPerPage||10,this.value=e.choices.map((e,t)=>(typeof e==`string`&&(e={title:e,value:t}),{title:e&&(e.title||e.value||e),description:e&&e.description,value:e&&(e.value===void 0?t:e.value),selected:e&&e.selected,disabled:e&&e.disabled})),this.clear=a(``,this.out.columns),e.overrideRender||this.render()}reset(){this.value.map(e=>!e.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(e=>e.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
175
- `),this.close()}submit(){let e=this.value.filter(e=>e.selected);this.minSelected&&e.length<this.minSelected?(this.showMinError=!0,this.render()):(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
176
- `),this.close())}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.value.length,this.render()}up(){this.cursor===0?this.cursor=this.value.length-1:this.cursor--,this.render()}down(){this.cursor===this.value.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.value[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){let e=this.value[this.cursor];if(e.selected)e.selected=!1,this.render();else if(e.disabled||this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();else e.selected=!0,this.render()}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();let e=!this.value[this.cursor].selected;this.value.filter(e=>!e.disabled).forEach(t=>t.selected=e),this.render()}_(e,t){if(e===` `)this.handleSpaceToggle();else if(e===`a`)this.toggleAll();else return this.bell()}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions==`string`?this.instructions:`
177
- Instructions:
178
- ${o.arrowUp}/${o.arrowDown}: Highlight option\n ${o.arrowLeft}/${o.arrowRight}/[space]: Toggle selection\n`+(this.maxChoices===void 0?` a: Toggle all
179
- `:``)+` enter/return: Complete answer`:``}renderOption(e,t,r,i){let a=(t.selected?n.green(o.radioOn):o.radioOff)+` `+i+` `,s,l;return t.disabled?s=e===r?n.gray().underline(t.title):n.strikethrough().gray(t.title):(s=e===r?n.cyan().underline(t.title):t.title,e===r&&t.description&&(l=` - ${t.description}`,(a.length+s.length+l.length>=this.out.columns||t.description.split(/\r?\n/).length>1)&&(l=`
180
- `+c(t.description,{margin:a.length,width:this.out.columns})))),a+s+n.gray(l||``)}paginateOptions(e){if(e.length===0)return n.red(`No matches for this query.`);let{startIndex:t,endIndex:r}=l(this.cursor,e.length,this.optionsPerPage),i,a=[];for(let n=t;n<r;n++)i=n===t&&t>0?o.arrowUp:n===r-1&&r<e.length?o.arrowDown:` `,a.push(this.renderOption(this.cursor,e[n],n,i));return`
181
- `+a.join(`
182
- `)}renderOptions(e){return this.done?``:this.paginateOptions(e)}renderDoneOrInstructions(){if(this.done)return this.value.filter(e=>e.selected).map(e=>e.title).join(`, `);let e=[n.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&e.push(n.yellow(this.warn)),e.join(` `)}render(){if(this.closed)return;this.firstRender&&this.out.write(r.hide),super.render();let e=[s.symbol(this.done,this.aborted),n.bold(this.msg),s.delimiter(!1),this.renderDoneOrInstructions()].join(` `);this.showMinError&&(e+=n.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),e+=this.renderOptions(this.value),this.out.write(this.clear+e),this.clear=a(e,this.out.columns)}}})),fv=e(((exports,t)=>{let n=K(),r=Q(),{erase:i,cursor:a}=q(),{style:o,clear:s,figures:c,wrap:l,entriesToDisplay:u}=Z(),d=(e,t)=>e[t]&&(e[t].value||e[t].title||e[t]),f=(e,t)=>e[t]&&(e[t].title||e[t].value||e[t]),p=(e,t)=>{let n=e.findIndex(e=>e.value===t||e.title===t);return n>-1?n:void 0};t.exports=class extends r{constructor(e={}){super(e),this.msg=e.message,this.suggest=e.suggest,this.choices=e.choices,this.initial=typeof e.initial==`number`?e.initial:p(e.choices,e.initial),this.select=this.initial||e.cursor||0,this.i18n={noMatches:e.noMatches||`no matches found`},this.fallback=e.fallback||this.initial,this.clearFirst=e.clearFirst||!1,this.suggestions=[],this.input=``,this.limit=e.limit||10,this.cursor=0,this.transform=o.render(e.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=s(``,this.out.columns),this.complete(this.render),this.render()}set fallback(e){this._fb=Number.isSafeInteger(parseInt(e))?parseInt(e):e}get fallback(){let e;return typeof this._fb==`number`?e=this.choices[this._fb]:typeof this._fb==`string`&&(e={title:this._fb}),e||this._fb||{title:this.i18n.noMatches}}moveSelect(e){this.select=e,this.suggestions.length>0?this.value=d(this.suggestions,e):this.value=this.fallback.value,this.fire()}async complete(e){let t=this.completing=this.suggest(this.input,this.choices),n=await t;if(this.completing!==t)return;this.suggestions=n.map((e,t,n)=>({title:f(n,t),value:d(n,t),description:e.description})),this.completing=!1;let r=Math.max(n.length-1,0);this.moveSelect(Math.min(r,this.select)),e&&e()}reset(){this.input=``,this.complete(()=>{this.moveSelect(this.initial===void 0?0:this.initial),this.render()}),this.render()}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
183
- `),this.close())}abort(){this.done=this.aborted=!0,this.exited=!1,this.fire(),this.render(),this.out.write(`
184
- `),this.close()}submit(){this.done=!0,this.aborted=this.exited=!1,this.fire(),this.render(),this.out.write(`
185
- `),this.close()}_(e,t){let n=this.input.slice(0,this.cursor),r=this.input.slice(this.cursor);this.input=`${n}${e}${r}`,this.cursor=n.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let e=this.input.slice(0,this.cursor-1),t=this.input.slice(this.cursor);this.input=`${e}${t}`,this.complete(this.render),--this.cursor,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let e=this.input.slice(0,this.cursor),t=this.input.slice(this.cursor+1);this.input=`${e}${t}`,this.complete(this.render),this.render()}first(){this.moveSelect(0),this.render()}last(){this.moveSelect(this.suggestions.length-1),this.render()}up(){this.select===0?this.moveSelect(this.suggestions.length-1):this.moveSelect(this.select-1),this.render()}down(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}next(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1)),this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0)),this.render()}left(){if(this.cursor<=0)return this.bell();--this.cursor,this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor+=1,this.render()}renderOption(e,t,r,i){let a,o=r?c.arrowUp:i?c.arrowDown:` `,s=t?n.cyan().underline(e.title):e.title;return o=(t?n.cyan(c.pointer)+` `:` `)+o,e.description&&(a=` - ${e.description}`,(o.length+s.length+a.length>=this.out.columns||e.description.split(/\r?\n/).length>1)&&(a=`
186
- `+l(e.description,{margin:3,width:this.out.columns}))),o+` `+s+n.gray(a||``)}render(){if(this.closed)return;this.firstRender?this.out.write(a.hide):this.out.write(s(this.outputText,this.out.columns)),super.render();let{startIndex:e,endIndex:t}=u(this.select,this.choices.length,this.limit);if(this.outputText=[o.symbol(this.done,this.aborted,this.exited),n.bold(this.msg),o.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(` `),!this.done){let r=this.suggestions.slice(e,t).map((n,r)=>this.renderOption(n,this.select===r+e,r===0&&e>0,r+e===t-1&&t<this.choices.length)).join(`
187
- `);this.outputText+=`
188
- `+(r||n.gray(this.fallback.title))}this.out.write(i.line+a.to(0)+this.outputText)}}})),pv=e(((exports,t)=>{let n=K(),{cursor:r}=q(),i=dv(),{clear:a,style:o,figures:s}=Z();t.exports=class extends i{constructor(e={}){e.overrideRender=!0,super(e),this.inputValue=``,this.clear=a(``,this.out.columns),this.filteredOptions=this.value,this.render()}last(){this.cursor=this.filteredOptions.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render()}up(){this.cursor===0?this.cursor=this.filteredOptions.length-1:this.cursor--,this.render()}down(){this.cursor===this.filteredOptions.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.filteredOptions[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions())}updateFilteredOptions(){let e=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(e=>this.inputValue?!!(typeof e.title==`string`&&e.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof e.value==`string`&&e.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);let t=this.filteredOptions.findIndex(t=>t===e);this.cursor=t<0?0:t,this.render()}handleSpaceToggle(){let e=this.filteredOptions[this.cursor];if(e.selected)e.selected=!1,this.render();else if(e.disabled||this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();else e.selected=!0,this.render()}handleInputChange(e){this.inputValue+=e,this.updateFilteredOptions()}_(e,t){e===` `?this.handleSpaceToggle():this.handleInputChange(e)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions==`string`?this.instructions:`
189
- Instructions:
190
- ${s.arrowUp}/${s.arrowDown}: Highlight option
191
- ${s.arrowLeft}/${s.arrowRight}/[space]: Toggle selection
192
- [a,b,c]/delete: Filter choices
193
- enter/return: Complete answer
194
- `:``}renderCurrentInput(){return`
195
- Filtered results for: ${this.inputValue?this.inputValue:n.gray(`Enter something to filter`)}\n`}renderOption(e,t,r){let i;return i=t.disabled?e===r?n.gray().underline(t.title):n.strikethrough().gray(t.title):e===r?n.cyan().underline(t.title):t.title,(t.selected?n.green(s.radioOn):s.radioOff)+` `+i}renderDoneOrInstructions(){if(this.done)return this.value.filter(e=>e.selected).map(e=>e.title).join(`, `);let e=[n.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&e.push(n.yellow(this.warn)),e.join(` `)}render(){if(this.closed)return;this.firstRender&&this.out.write(r.hide),super.render();let e=[o.symbol(this.done,this.aborted),n.bold(this.msg),o.delimiter(!1),this.renderDoneOrInstructions()].join(` `);this.showMinError&&(e+=n.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),e+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+e),this.clear=a(e,this.out.columns)}}})),mv=e(((exports,t)=>{let n=K(),r=Q(),{style:i,clear:a}=Z(),{erase:o,cursor:s}=q();t.exports=class extends r{constructor(e={}){super(e),this.msg=e.message,this.value=e.initial,this.initialValue=!!e.initial,this.yesMsg=e.yes||`yes`,this.yesOption=e.yesOption||`(Y/n)`,this.noMsg=e.no||`no`,this.noOption=e.noOption||`(y/N)`,this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
196
- `),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
197
- `),this.close()}_(e,t){return e.toLowerCase()===`y`?(this.value=!0,this.submit()):e.toLowerCase()===`n`?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(s.hide):this.out.write(a(this.outputText,this.out.columns)),super.render(),this.outputText=[i.symbol(this.done,this.aborted),n.bold(this.msg),i.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:n.gray(this.initialValue?this.yesOption:this.noOption)].join(` `),this.out.write(o.line+s.to(0)+this.outputText))}}})),hv=e(((exports,t)=>{t.exports={TextPrompt:Z_(),SelectPrompt:Q_(),TogglePrompt:$_(),DatePrompt:lv(),NumberPrompt:uv(),MultiselectPrompt:dv(),AutocompletePrompt:fv(),AutocompleteMultiselectPrompt:pv(),ConfirmPrompt:mv()}})),gv=e((exports=>{let t=exports,n=hv(),r=e=>e;function i(e,t,i={}){return new Promise((a,o)=>{let s=new n[e](t),c=i.onAbort||r,l=i.onSubmit||r,u=i.onExit||r;s.on(`state`,t.onState||r),s.on(`submit`,e=>a(l(e))),s.on(`exit`,e=>a(u(e))),s.on(`abort`,e=>o(c(e)))})}t.text=e=>i(`TextPrompt`,e),t.password=e=>(e.style=`password`,t.text(e)),t.invisible=e=>(e.style=`invisible`,t.text(e)),t.number=e=>i(`NumberPrompt`,e),t.date=e=>i(`DatePrompt`,e),t.confirm=e=>i(`ConfirmPrompt`,e),t.list=e=>{let t=e.separator||`,`;return i(`TextPrompt`,e,{onSubmit:e=>e.split(t).map(e=>e.trim())})},t.toggle=e=>i(`TogglePrompt`,e),t.select=e=>i(`SelectPrompt`,e),t.multiselect=e=>{e.choices=[].concat(e.choices||[]);let t=e=>e.filter(e=>e.selected).map(e=>e.value);return i(`MultiselectPrompt`,e,{onAbort:t,onSubmit:t})},t.autocompleteMultiselect=e=>{e.choices=[].concat(e.choices||[]);let t=e=>e.filter(e=>e.selected).map(e=>e.value);return i(`AutocompleteMultiselectPrompt`,e,{onAbort:t,onSubmit:t})};let a=(e,t)=>Promise.resolve(t.filter(t=>t.title.slice(0,e.length).toLowerCase()===e.toLowerCase()));t.autocomplete=e=>(e.suggest=e.suggest||a,e.choices=[].concat(e.choices||[]),i(`AutocompletePrompt`,e))})),_v=e(((exports,t)=>{let n=gv(),r=[`suggest`,`format`,`onState`,`validate`,`onRender`,`type`],i=()=>{};async function a(e=[],{onSubmit:t=i,onCancel:s=i}={}){let c={},l=a._override||{};e=[].concat(e);let u,d,f,p,m,h,g=async(e,t,n=!1)=>{if(!(!n&&e.validate&&e.validate(t)!==!0))return e.format?await e.format(t,c):t};for(d of e){if({name:p,type:m}=d,typeof m==`function`&&(m=await m(u,{...c},d),d.type=m),!m)continue;for(let e in d){if(r.includes(e))continue;let t=d[e];d[e]=typeof t==`function`?await t(u,{...c},h):t}if(h=d,typeof d.message!=`string`)throw Error(`prompt message is required`);if({name:p,type:m}=d,n[m]===void 0)throw Error(`prompt type (${m}) is not defined`);if(l[d.name]!==void 0&&(u=await g(d,l[d.name]),u!==void 0)){c[p]=u;continue}try{u=a._injected?o(a._injected,d.initial):await n[m](d),c[p]=u=await g(d,u,!0),f=await t(d,u,c)}catch(e){f=!await s(d,c)}if(f)return c}return c}function o(e,t){let n=e.shift();if(n instanceof Error)throw n;return n===void 0?t:n}function s(e){a._injected=(a._injected||[]).concat(e)}function c(e){a._override=Object.assign({},e)}t.exports=Object.assign(a,{prompt:a,prompts:n,inject:s,override:c})})),vv=n(e(((exports,t)=>{function n(e){e=(Array.isArray(e)?e:e.split(`.`)).map(Number);let t=0,n=process.versions.node.split(`.`).map(Number);for(;t<e.length;t++){if(n[t]>e[t])return!1;if(e[t]>n[t])return!0}return!1}t.exports=n(`8.6.0`)?H_():_v()}))(),1);function yv({vue:e,react:t}){let n=t&&e||!t&&!e?`base`:t?`react`:`vue`;return{eslintConfig:{extends:`@nice-move/eslint-config-${n}`},devDependencies:{[`@nice-move/eslint-config-${n}`]:z[`eslint-config-base`],eslint:z.eslint}}}const bv=`Add/Reset project dependencies`;function xv(e,t={}){return new Zt().config({pretty:!0}).source(`package.json`).onFail().onDone(async(n={})=>{let{devDependencies:r={},dependencies:i={}}=n,{ava:a=`ava`in r,commitlint:o=`commitlint`in r,eslint:s=`eslint`in r,garou:c=`garou`in r,prettier:l=`prettier`in r,react:u=`react`in i,stylelint:d=`stylelint`in r,syncpack:f=`syncpack`in r,typescript:p=`typescript`in r,vue:m=`vue`in i,tailwindcss:h=`tailwindcss`in i||`tailwindcss`in r,playwright:g,"@bring-it/sftp":_=`@bring-it/sftp`in r,"@bring-it/npm":v=`@bring-it/npm`in r,"best-shot":y=`best-shot`in r}=t,b=s||d||l||c,x=[b?`npm run lint:staged`:void 0,p?`npm run lint:type`:void 0,a?`npm test`:void 0].filter(Boolean).map((e,t,n)=>t===n-1?e:`${e} || exit 1`);return x.length>0&&await new F().onDone(()=>[`#!/bin/sh`,``,...x,``].join(`
198
- `)).output(`.githooks/pre-commit`),o&&await new F().onDone(()=>[`#!/bin/sh`,`npx --no-install nice-move lint commit`,``].join(`
199
-
200
- `)).output(`.githooks/commit-msg`),f&&await new F().onDone(()=>[`// @ts-check`,`import defineConfig from '@nice-move/syncpack-config/define.cjs';`,`export default defineConfig(import.meta.url, {});`,`// export { default } from '@nice-move/syncpack-config';`].join(`
201
-
202
- `)).output(`syncpack.config.mjs`),p&&await new Zt().config({pretty:!0}).onDone(()=>({extends:`@nice-move/tsconfig/base.json`,include:[`./`]})).output(`tsconfig.json`),Gr(...[n,e&&(b||a||o||g||p)?{scripts:{prepare:`nice-move git hooks`}}:void 0,c?{devDependencies:{garou:z.garou}}:void 0,p?{devDependencies:{typescript:z.typescript,"@nice-move/tsconfig":z.tsconfig},scripts:{"lint:type":`tsc --noEmit`}}:void 0,b||o?{devDependencies:{"@nice-move/cli":z.cli}}:void 0,b?{scripts:{"lint:staged":`nice-move lint staged`}}:void 0,a?{devDependencies:{ava:z.ava,...s?{"eslint-plugin-ava":z[`eslint-plugin-ava`]}:void 0},scripts:{prepublishOnly:n.private?void 0:x.join(` && `)||void 0,test:`ava --fail-fast`,snapshot:`ava --fail-fast -u`}}:void 0,s?yv({react:u,vue:m}):void 0,d?{devDependencies:{"@nice-move/stylelint-config":z[`stylelint-config`],stylelint:z.stylelint},stylelint:{extends:`@nice-move/stylelint-config`}}:void 0,f?{devDependencies:{"@nice-move/syncpack-config":z[`syncpack-config`],syncpack:z.syncpack},scripts:{"lint:version":`syncpack lint`,"version:pin":`syncpack fix-mismatches`}}:void 0,l?{devDependencies:{"@nice-move/prettier-config":z[`prettier-config`],prettier:z.prettier},prettier:`@nice-move/prettier-config`}:void 0,u?{dependencies:{react:z.react,"react-dom":z[`react-dom`]},peerDependencies:{"@types/react":z[`@types/react`]}}:void 0,m?{dependencies:{vue:z.vue}}:void 0,h?{dependencies:{tailwindcss:z.tailwindcss},devDependencies:{"prettier-plugin-tailwindcss":l?z[`prettier-plugin-tailwindcss`]:void 0}}:void 0,g?{scripts:{"pretest:e2e":`npm link @playwright/test`,"test:e2e":`playwright test`}}:void 0,_?{devDependencies:{"@bring-it/sftp":z[`@bring-it/sftp`]}}:void 0,v?{devDependencies:{"@bring-it/npm":z[`@bring-it/npm`]}}:void 0,y?{devDependencies:{"best-shot":z[`best-shot`]},"nice-move":{globals:{BEST_SHOT:`readonly`}},scripts:{build:`best-shot prod`}}:void 0].filter(Boolean))}).output().logger(bv).catch(console.warn)}function Sv(){let e=[`tailwindcss`,`react`,`vue`,`typescript`,`commitlint`,`eslint`,`stylelint`,`prettier`,`syncpack`,`garou`,`ava`,`playwright`,`@bring-it/sftp`,`@bring-it/npm`,`best-shot`],{dependencies:t={},devDependencies:n={}}=Cr();return{instructions:!1,optionsPerPage:20,message:bv,name:`Dependencies`,type:e=>e===!1?null:`multiselect`,choices:e.map(e=>({title:e,value:e,selected:e in t||e in n})),format:e=>{if(e.length>0)return t=>xv(t,Object.fromEntries(e.map(e=>[e,!0])))}}}const Cv=`Initialize as git repository`;function wv(){return l_(`git`,[`init`]).then(e=>(console.log($t(`√`),Cv),e),e=>{throw console.log(Qt(`×`),Cv),e})}function Tv({gitSupported:e,isRoot:t}){return{message:Cv,name:`GitInit`,initial:!0,type:n=>n===!1||!e||t?null:`confirm`,format(e){if(e===!0)return wv}}}var Ev=e(((exports,t)=>{t.exports=function(){return/^\s*([^<(]*?)\s*([<(]([^>)]*?)[>)])?\s*([<(]([^>)]*?)[>)])*\s*$/}})),Dv=n(e(((exports,t)=>{var n=Ev();t.exports=function(e){if(typeof e!=`string`)throw TypeError(`expected author to be a string`);if(!e||!/\w/.test(e))return{};var t=[].concat.apply([],n().exec(e)),r={};t[1]&&(r.name=t[1]);for(var i=2;i<t.length;i++){var a=t[i];i%2==0&&a&&t[i+1]&&(a.charAt(0)===`<`?(r.email=t[i+1],i++):a.charAt(0)===`(`&&(r.url=t[i+1],i++))}return r}}))(),1);function Ov(){return/(?<=^v?|\sv?)(?:(?:0|[1-9]\d{0,9}?)\.){2}(?:0|[1-9]\d{0,9})(?:-(?:--+)?(?:0|[1-9]\d*|\d*[a-z]+\d*)){0,100}(?=$| |\+|\.)(?:(?<=-\S+)(?:\.(?:--?|[\da-z-]*[a-z-]\d*|0|[1-9]\d*)){1,100}?)?(?!\.)(?:\+(?:[\da-z]\.?-?){1,100}?(?!\w))?(?!\+)/gi}var kv=n(e(((exports,n)=>{let{builtinModules:r}=t(`module`);var i=RegExp(`^(?:@([^/]+?)[/])?([^/]+?)$`),a=[`node_modules`,`favicon.ico`];function o(e){var t=[],n=[];if(e===null)return n.push(`name cannot be null`),s(t,n);if(e===void 0)return n.push(`name cannot be undefined`),s(t,n);if(typeof e!=`string`)return n.push(`name must be a string`),s(t,n);if(e.length||n.push(`name length must be greater than zero`),e.startsWith(`.`)&&n.push(`name cannot start with a period`),e.match(/^_/)&&n.push(`name cannot start with an underscore`),e.trim()!==e&&n.push(`name cannot contain leading or trailing spaces`),a.forEach(function(t){e.toLowerCase()===t&&n.push(t+` is not a valid package name`)}),r.includes(e.toLowerCase())&&t.push(e+` is a core module name`),e.length>214&&t.push(`name can no longer contain more than 214 characters`),e.toLowerCase()!==e&&t.push(`name can no longer contain capital letters`),/[~'!()*]/.test(e.split(`/`).slice(-1)[0])&&t.push(`name can no longer contain special characters ("~'!()*")`),encodeURIComponent(e)!==e){var o=e.match(i);if(o){var c=o[1],l=o[2];if(l.startsWith(`.`)&&n.push(`name cannot start with a period`),encodeURIComponent(c)===c&&encodeURIComponent(l)===l)return s(t,n)}n.push(`name can only contain URL-friendly characters`)}return s(t,n)}var s=function(e,t){var n={validForNewPackages:t.length===0&&e.length===0,validForOldPackages:t.length===0,warnings:e,errors:t};return n.warnings.length||delete n.warnings,n.errors.length||delete n.errors,n};n.exports=o}))(),1);const Av=Ov();function jv(e){return Array.isArray(e)&&e.length>0}async function Mv({cwd:e,pkg:{author:t,description:n,license:r,name:i,private:a,version:o,workspaces:c}={}}){return[{format:yr,initial:s(e).base,message:`package.json » name`,name:`name`,type:e=>e===!1||i?null:`text`,validate:e=>(0,kv.default)(yr(e)||``).validForNewPackages},{format:yr,initial:`0.0.0`,message:`package.json » version`,name:`version`,type:e=>e===!1||o?null:`text`,validate:e=>Av.test(yr(e)||``)},{format:yr,message:`package.json » description`,name:`description`,type:e=>e===!1||n?null:`text`},{active:`MIT`,format:e=>e?`MIT`:`UNLICENSED`,inactive:`UNLICENSED`,initial:!0,message:`package.json » license`,name:`license`,type:e=>e===!1||r?null:`toggle`},{type:e=>e===!1||(typeof t==`string`?t:t&&t.name)?null:`text`,format:Dv.default,initial:await xr(t),message:`package.json » author`,name:`author`},{active:`true`,inactive:`false`,initial:!1,message:`package.json » private`,name:`private`,format:e=>e===!1?void 0:e,type:e=>e===!1||a!==void 0?null:`toggle`},{active:`recommend`,inactive:`false`,initial:!1,message:`package.json » workspaces`,name:`workspaces`,format:e=>e?[`packages/*`,`tools/*`]:void 0,type:(e,t)=>e===!1||a===!1||t.private===!1||jv(c&&c.packages?c.packages:c)?null:`toggle`}]}function Nv(){return l_(`git`,[`--version`]).then(({stdout:e})=>!!e)}function Pv(){return l_(`git`,[`rev-parse`,`--git-dir`]).then(({stdout:e})=>e===`.git`).catch(()=>!1)}function Fv(){return l_(`git`,[`status`,`--short`]).then(({stdout:e})=>e.length>0)}async function Iv(){let e=await Nv(),t=e&&await Pv(),n=t?await Fv():!1,r=vr(),i=Cr(),a=process.cwd(),o={gitSupported:e,isRoot:t,isDirty:n,isEmpty:r,pkg:i,cwd:a},s=await Mv(o);return(0,vv.default)([{active:`do it`,inactive:`cancel`,message:n===!0?`Repository not clean`:`Workspace not empty`,name:`okay`,type:()=>r||n===!1?null:`toggle`},Tv(o),...s,Sv(o)],{onCancel(){throw Error(`cancel`)}}).then(({okay:e,...t})=>{if(e===!1)throw Error(`cancel`);return Object.entries(t)}).then(e=>{let t=s.map(({name:e})=>e),n=Object.fromEntries(e.filter(([e])=>t.includes(e)));return{...Object.fromEntries(e.filter(([e])=>!t.includes(e))),info:n,options:o}})}async function Lv(){let{Dependencies:e,GitInit:t,Install:n,info:r,options:{isRoot:i}={}}=await Iv();console.log(`-`.repeat(32));let a=[t,()=>xi(r),Si,kr,tn,()=>t||i?Er():void 0,()=>e?e(t||i):void 0,n].filter(e=>typeof e==`function`);for(let e of a){let t=await e();t&&t.catch&&t.catch(e=>{console.warn(e.message)})}}export{Lv as init};