@nice-move/init 0.8.28 → 0.8.30

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,211 +0,0 @@
1
- import{n as e,r as t,t as n}from"./cli.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 ee}from"node:child_process";import{appendFileSync as te,createReadStream as ne,createWriteStream as re,readFileSync as ie,readdirSync as ae,statSync as oe,writeFileSync as se}from"node:fs";import{aborted as ce,callbackify as le,debuglog as ue,inspect as de,promisify as fe,stripVTControlCharacters as pe}from"node:util";import{StringDecoder as me}from"node:string_decoder";import{scheduler as he,setImmediate as ge,setTimeout as _e}from"node:timers/promises";import{EventEmitter as ve,addAbortListener as ye,on as be,once as w,setMaxListeners as xe}from"node:events";import{serialize as Se}from"node:v8";import{finished as T}from"node:stream/promises";import{Duplex as Ce,PassThrough as we,Readable as Te,Transform as Ee,Writable as De,getDefaultHighWaterMark as Oe}from"node:stream";import{Buffer as ke}from"node:buffer";var E=n((e=>{e.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})},e.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})}})),Ae=n(((t,n)=>{var r=e(`constants`),i=process.cwd,a=null,o=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return a||=i.call(process),a};try{process.cwd()}catch{}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{}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{}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`)}}})),je=n(((t,n)=>{var r=e(`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||={};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||={};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())}}})),Me=n(((e,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}})),Ne=n(((t,n)=>{var r=e(`fs`),i=Ae(),a=je(),o=Me(),s=e(`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;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]||(d(r,global[c]||[]),r.close=(function(e){function t(t,n){return e.call(r,t,function(e){e||g(),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),g()}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]),e(`assert`).equal(r[c].length,0)})),global[c]||d(global,r[c]),n.exports=p(o(r)),process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!r.__patched&&(n.exports=p(r),r.__patched=!0);function p(e){i(e),e.gracefulify=p,e.createReadStream=te,e.createWriteStream=ne;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`)?m([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`)?m([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`)?m([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`)?m([i,[e,t,n,r],o,a||Date.now(),Date.now()]):typeof r==`function`&&r.apply(this,arguments)})}}var d=e.readdir;e.readdir=h;var f=/^v[0-5]\./;function h(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`)?m([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=ee),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;ie(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 ee(){var e=this;ie(e.path,e.flags,e.mode,function(t,n){t?(e.destroy(),e.emit(`error`,t)):(e.fd=n,e.emit(`open`,n))})}function te(t,n){return new e.ReadStream(t,n)}function ne(t,n){return new e.WriteStream(t,n)}var re=e.open;e.open=ie;function ie(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 re(e,t,n,function(o,s){o&&(o.code===`EMFILE`||o.code===`ENFILE`)?m([i,[e,t,n,r],o,a||Date.now(),Date.now()]):typeof r==`function`&&r.apply(this,arguments)})}}return e}function m(e){f(`ENQUEUE`,e[0].name,e[1]),r[c].push(e),_()}var h;function g(){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);_()}function _(){if(clearTimeout(h),h=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);l>=Math.min(u*1.2,100)?(f(`RETRY`,t.name,n),t.apply(null,n.concat([a]))):r[c].push(e)}h===void 0&&(h=setTimeout(_,0))}}})),D=n((e=>{let t=E().fromCallback,n=Ne(),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(e,n),r.forEach(r=>{e[r]=t(n[r])}),e.exists=function(e,t){return typeof t==`function`?n.exists(e,t):new Promise(t=>n.exists(e,t))},e.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})})})},e.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})})})},e.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})})})},e.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`?e.realpath.native=t(n.realpath.native):process.emitWarning(`fs.realpath.native is not a function. Is fs being monkey-patched?`,`Warning`,`fs-extra-WARN0003`)})),Pe=n(((t,n)=>{let r=e(`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}}})),Fe=n(((e,t)=>{let n=D(),{checkPath:r}=Pe(),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}))})),O=n(((e,t)=>{let n=E().fromPromise,{makeDir:r,makeDirSync:i}=Fe(),a=n(r);t.exports={mkdirs:a,mkdirsSync:i,mkdirp:a,mkdirpSync:i,ensureDir:a,ensureDirSync:i}})),k=n(((e,t)=>{let n=E().fromPromise,r=D();function i(e){return r.access(e).then(()=>!0).catch(()=>!1)}t.exports={pathExists:n(i),pathExistsSync:r.existsSync}})),Ie=n(((e,t)=>{let n=D(),r=E().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}})),Le=n(((t,n)=>{let r=D(),i=e(`path`),a=E().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}})),Re=n(((e,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}})),ze=n(((t,n)=>{let r=D(),i=e(`path`),{mkdirs:a}=O(),{pathExists:o}=k(),{utimesMillis:s}=Ie(),c=Le(),{asyncIteratorConcurrentProcess:l}=Re();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})),Be=n(((t,n)=>{let r=Ne(),i=e(`path`),a=O().mkdirsSync,o=Ie().utimesMillisSync,s=Le();function c(e,t,n){typeof n==`function`&&(n={filter: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})),Ve=n(((e,t)=>{let n=E().fromPromise;t.exports={copy:n(ze()),copySync:Be()}})),He=n(((e,t)=>{let n=Ne(),r=E().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}})),Ue=n(((t,n)=>{let r=E().fromPromise,i=D(),a=e(`path`),o=O(),s=He(),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}})),We=n(((t,n)=>{let r=E().fromPromise,i=e(`path`),a=D(),o=O();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}})),Ge=n(((t,n)=>{let r=E().fromPromise,i=e(`path`),a=D(),o=O(),{pathExists:s}=k(),{areIdentical:c}=Le();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}})),Ke=n(((t,n)=>{let r=e(`path`),i=D(),{pathExists:a}=k(),o=E().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}})),qe=n(((e,t)=>{let n=D(),r=E().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}})),Je=n(((t,n)=>{let r=E().fromPromise,i=e(`path`),a=D(),{mkdirs:o,mkdirsSync:s}=O(),{symlinkPaths:c,symlinkPathsSync:l}=Ke(),{symlinkType:u,symlinkTypeSync:d}=qe(),{pathExists:f}=k(),{areIdentical:p}=Le();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()&&p(a.statSync(e),a.statSync(t)))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}})),Ye=n(((e,t)=>{let{createFile:n,createFileSync:r}=We(),{createLink:i,createLinkSync:a}=Ge(),{createSymlink:o,createSymlinkSync:s}=Je();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}})),Xe=n(((e,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}})),Ze=n(((t,n)=>{let r;try{r=Ne()}catch{r=e(`fs`)}let i=E(),{stringify:a,stripBom:o}=Xe();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}})),Qe=n(((e,t)=>{let n=Ze();t.exports={readJson:n.readFile,readJsonSync:n.readFileSync,writeJson:n.writeFile,writeJsonSync:n.writeFileSync}})),$e=n(((t,n)=>{let r=E().fromPromise,i=D(),a=e(`path`),o=O(),s=k().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}})),et=n(((e,t)=>{let{stringify:n}=Xe(),{outputFile:r}=$e();async function i(e,t,i={}){await r(e,n(t,i),i)}t.exports=i})),tt=n(((e,t)=>{let{stringify:n}=Xe(),{outputFileSync:r}=$e();function i(e,t,i){r(e,n(t,i),i)}t.exports=i})),nt=n(((e,t)=>{let n=E().fromPromise,r=Qe();r.outputJson=n(et()),r.outputJsonSync=tt(),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})),rt=n(((t,n)=>{let r=D(),i=e(`path`),{copy:a}=Ve(),{remove:o}=He(),{mkdirp:s}=O(),{pathExists:c}=k(),l=Le();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})),it=n(((t,n)=>{let r=Ne(),i=e(`path`),a=Ve().copySync,o=He().removeSync,s=O().mkdirpSync,c=Le();function l(e,t,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})),at=n(((e,t)=>{let n=E().fromPromise;t.exports={move:n(rt()),moveSync:it()}})),ot=t(n(((e,t)=>{t.exports={...D(),...Ve(),...Ue(),...Ye(),...nt(),...O(),...at(),...$e(),...k(),...He()}}))(),1);const st=(e=0)=>t=>`\u001B[${t+e}m`,ct=(e=0)=>t=>`\u001B[${38+e};5;${t}m`,lt=(e=0)=>(t,n,r)=>`\u001B[${38+e};2;${t};${n};${r}m`,A={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(A.modifier);const ut=Object.keys(A.color),dt=Object.keys(A.bgColor);[...ut,...dt];function ft(){let e=new Map;for(let[t,n]of Object.entries(A)){for(let[t,r]of Object.entries(n))A[t]={open:`\u001B[${r[0]}m`,close:`\u001B[${r[1]}m`},n[t]=A[t],e.set(r[0],r[1]);Object.defineProperty(A,t,{value:n,enumerable:!1})}return Object.defineProperty(A,`codes`,{value:e,enumerable:!1}),A.color.close=`\x1B[39m`,A.bgColor.close=`\x1B[49m`,A.color.ansi=st(),A.color.ansi256=ct(),A.color.ansi16m=lt(),A.bgColor.ansi=st(10),A.bgColor.ansi256=ct(10),A.bgColor.ansi16m=lt(10),Object.defineProperties(A,{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=>A.rgbToAnsi256(...A.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)=>A.ansi256ToAnsi(A.rgbToAnsi256(e,t,n)),enumerable:!1},hexToAnsi:{value:e=>A.ansi256ToAnsi(A.hexToAnsi256(e)),enumerable:!1}}),A}var j=ft();function M(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:N}=u;let pt;M(`no-color`)||M(`no-colors`)||M(`color=false`)||M(`color=never`)?pt=0:(M(`color`)||M(`colors`)||M(`color=true`)||M(`color=always`))&&(pt=1);function mt(){if(`FORCE_COLOR`in N)return N.FORCE_COLOR===`true`?1:N.FORCE_COLOR===`false`?0:N.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(N.FORCE_COLOR,10),3)}function ht(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function gt(e,{streamIsTTY:t,sniffFlags:n=!0}={}){let r=mt();r!==void 0&&(pt=r);let i=n?pt:r;if(i===0)return 0;if(n){if(M(`color=16m`)||M(`color=full`)||M(`color=truecolor`))return 3;if(M(`color=256`))return 2}if(`TF_BUILD`in N&&`AGENT_NAME`in N)return 1;if(e&&!t&&i===void 0)return 0;let a=i||0;if(N.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 N)return[`GITHUB_ACTIONS`,`GITEA_ACTIONS`,`CIRCLECI`].some(e=>e in N)?3:[`TRAVIS`,`APPVEYOR`,`GITLAB_CI`,`BUILDKITE`,`DRONE`].some(e=>e in N)||N.CI_NAME===`codeship`?1:a;if(`TEAMCITY_VERSION`in N)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(N.TEAMCITY_VERSION)?1:0;if(N.COLORTERM===`truecolor`||N.TERM===`xterm-kitty`||N.TERM===`xterm-ghostty`||N.TERM===`wezterm`)return 3;if(`TERM_PROGRAM`in N){let e=Number.parseInt((N.TERM_PROGRAM_VERSION||``).split(`.`)[0],10);switch(N.TERM_PROGRAM){case`iTerm.app`:return e>=3?3:2;case`Apple_Terminal`:return 2}}return/-256(color)?$/i.test(N.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(N.TERM)||`COLORTERM`in N?1:a}function _t(e,t={}){return ht(gt(e,{streamIsTTY:e&&e.isTTY,...t}))}var vt={stdout:_t({isTTY:v.isatty(1)}),stderr:_t({isTTY:v.isatty(2)})};function yt(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 bt(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:xt,stderr:St}=vt,Ct=Symbol(`GENERATOR`),wt=Symbol(`STYLER`),Tt=Symbol(`IS_EMPTY`),Et=[`ansi`,`ansi`,`ansi256`,`ansi16m`],Dt=Object.create(null),Ot=(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=xt?xt.level:0;e.level=t.level===void 0?n:t.level},kt=e=>{let t=(...e)=>e.join(` `);return Ot(t,e),Object.setPrototypeOf(t,At.prototype),t};function At(e){return kt(e)}Object.setPrototypeOf(At.prototype,Function.prototype);for(let[e,t]of Object.entries(j))Dt[e]={get(){let n=Pt(this,Nt(t.open,t.close,this[wt]),this[Tt]);return Object.defineProperty(this,e,{value:n}),n}};Dt.visible={get(){let e=Pt(this,this[wt],!0);return Object.defineProperty(this,`visible`,{value:e}),e}};const jt=(e,t,n,...r)=>e===`rgb`?t===`ansi16m`?j[n].ansi16m(...r):t===`ansi256`?j[n].ansi256(j.rgbToAnsi256(...r)):j[n].ansi(j.rgbToAnsi(...r)):e===`hex`?jt(`rgb`,t,n,...j.hexToRgb(...r)):j[n][e](...r);for(let e of[`rgb`,`hex`,`ansi256`]){Dt[e]={get(){let{level:t}=this;return function(...n){let r=Nt(jt(e,Et[t],`color`,...n),j.color.close,this[wt]);return Pt(this,r,this[Tt])}}};let t=`bg`+e[0].toUpperCase()+e.slice(1);Dt[t]={get(){let{level:t}=this;return function(...n){let r=Nt(jt(e,Et[t],`bgColor`,...n),j.bgColor.close,this[wt]);return Pt(this,r,this[Tt])}}}}const Mt=Object.defineProperties(()=>{},{...Dt,level:{enumerable:!0,get(){return this[Ct].level},set(e){this[Ct].level=e}}}),Nt=(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}},Pt=(e,t,n)=>{let r=(...e)=>Ft(r,e.length===1?``+e[0]:e.join(` `));return Object.setPrototypeOf(r,Mt),r[Ct]=e,r[wt]=t,r[Tt]=n,r},Ft=(e,t)=>{if(e.level<=0||!t)return e[Tt]?``:t;let n=e[wt];if(n===void 0)return t;let{openAll:r,closeAll:i}=n;if(t.includes(`\x1B`))for(;n!==void 0;)t=yt(t,n.close,n.open),n=n.parent;let a=t.indexOf(`
11
- `);return a!==-1&&(t=bt(t,i,r,a)),r+t+i};Object.defineProperties(At.prototype,Dt);const It=At();At({level:St?St.level:0});var Lt=It;const Rt=r(`${process.cwd()}/`);function zt(e){return e.startsWith(`file:`)?l(e):e}function Bt(e,t=process.cwd()){if(e.startsWith(`~`))return Rt.resolve(e.replace(/^~/,``));let n=zt(e);return a(n)?n:c(zt(t),n)}var Vt=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 Ht=new class{okay(...e){console.log(Lt.green(`✔`),...e)}fail(...e){console.log(Lt.red(`✘`),...e)}};function Ut({read:e,write:t}){return class extends Vt{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=Bt(t,n)}).then(()=>e(this.source)),this}output(e,n=this.root){return this.action=this.action.then(r=>{let i=Bt(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=>(Ht.okay(...e),t),t=>{throw Ht.fail(...e),t}),this}}}const{readFile:Wt,readJson:Gt,outputFile:Kt,outputJson:qt}=ot.default,Jt={spaces:2,replacer:null};function Yt(e){return Wt(e,{encoding:`utf8`})}function Xt(e,t){return Kt(e,t,{encoding:`utf8`})}function Zt(e,t,{pretty:n=!1}={}){return qt(e,t,n?Jt:void 0)}const P=Ut({read:Yt,write:Xt}),Qt=Ut({read:Gt,write:Zt});Ut({read:Yt,write:Zt}),Ut({read:Gt,write:Xt});const{cyan:F,red:$t,green:en}=Lt;var tn=`# 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 nn(){return new P().onDone(()=>tn).output(`.editorconfig`).logger(`Create/Overwrite`,F(`.editorconfig`)).catch(console.warn)}const rn=(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);!an(i,a)&&r||Object.defineProperty(e,n,a)},an=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)},on=(e,t)=>{let n=Object.getPrototypeOf(t);n!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,n)},sn=(e,t)=>`/* Wrapped ${e}*/\n${t}`,cn=Object.getOwnPropertyDescriptor(Function.prototype,`toString`),ln=Object.getOwnPropertyDescriptor(Function.prototype.toString,`name`),un=(e,t,n)=>{let r=n===``?``:`with ${n.trim()}() `,i=sn.bind(null,r,t.toString());Object.defineProperty(i,`name`,ln);let{writable:a,enumerable:o,configurable:s}=cn;Object.defineProperty(e,`toString`,{value:i,writable:a,enumerable:o,configurable:s})};function dn(e,t,{ignoreNonConfigurable:n=!1}={}){let{name:r}=e;for(let r of Reflect.ownKeys(t))rn(e,t,r,n);return on(e,t),un(e,t,r),e}const fn=new WeakMap,pn=(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(fn.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 dn(a,e),fn.set(a,r),a};pn.callCount=e=>{if(!fn.has(e))throw Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return fn.get(e)};var mn=pn;const hn=[];hn.push(`SIGHUP`,`SIGINT`,`SIGTERM`),process.platform!==`win32`&&hn.push(`SIGALRM`,`SIGABRT`,`SIGVTALRM`,`SIGXCPU`,`SIGXFSZ`,`SIGUSR2`,`SIGTRAP`,`SIGSYS`,`SIGQUIT`,`SIGIOT`),process.platform===`linux`&&hn.push(`SIGIO`,`SIGPOLL`,`SIGPWR`,`SIGSTKFLT`);const gn=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`,_n=Symbol.for(`signal-exit emitter`),vn=globalThis,yn=Object.defineProperty.bind(Object);var bn=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(vn[_n])return vn[_n];yn(vn,_n,{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}},xn=class{};const Sn=e=>({onExit(t,n){return e.onExit(t,n)},load(){return e.load()},unload(){return e.unload()}});var Cn=class extends xn{onExit(){return()=>{}}load(){}unload(){}},wn=class extends xn{#e=Tn.platform===`win32`?`SIGINT`:`SIGHUP`;#t=new bn;#n;#r;#i;#a={};#o=!1;constructor(e){super(),this.#n=e,this.#a={};for(let t of hn)this.#a[t]=()=>{let n=this.#n.listeners(t),{count:r}=this.#t,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.#t.emit(`exit`,null,t),r=t===`SIGHUP`?this.#e:t;n||e.kill(e.pid,r)}};this.#i=e.reallyExit,this.#r=e.emit}onExit(e,t){if(!gn(this.#n))return()=>{};this.#o===!1&&this.load();let n=t?.alwaysLast?`afterExit`:`exit`;return this.#t.on(n,e),()=>{this.#t.removeListener(n,e),this.#t.listeners.exit.length===0&&this.#t.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#o){this.#o=!0,this.#t.count+=1;for(let e of hn)try{let t=this.#a[e];t&&this.#n.on(e,t)}catch{}this.#n.emit=(e,...t)=>this.#c(e,...t),this.#n.reallyExit=e=>this.#s(e)}}unload(){this.#o&&(this.#o=!1,hn.forEach(e=>{let t=this.#a[e];if(!t)throw Error(`Listener not defined for signal: `+e);try{this.#n.removeListener(e,t)}catch{}}),this.#n.emit=this.#r,this.#n.reallyExit=this.#i,--this.#t.count)}#s(e){return gn(this.#n)?(this.#n.exitCode=e||0,this.#t.emit(`exit`,this.#n.exitCode,null),this.#i.call(this.#n,this.#n.exitCode)):0}#c(e,...t){let n=this.#r;if(e===`exit`&&gn(this.#n)){typeof t[0]==`number`&&(this.#n.exitCode=t[0]);let r=n.call(this.#n,e,...t);return this.#t.emit(`exit`,this.#n.exitCode,null),r}else return n.call(this.#n,e,...t)}};const Tn=globalThis.process,{onExit:En,load:Dn,unload:On}=Sn(gn(Tn)?new wn(Tn):new Cn),kn=u.stderr.isTTY?u.stderr:u.stdout.isTTY?u.stdout:void 0;var An=kn?mn(()=>{En(()=>{kn.write(`\x1B[?25h`)},{alwaysLast:!0})}):()=>{};let jn=!1;const Mn={};Mn.show=(e=u.stderr)=>{e.isTTY&&(jn=!1,e.write(`\x1B[?25h`))},Mn.hide=(e=u.stderr)=>{e.isTTY&&(An(),jn=!0,e.write(`\x1B[?25l`))},Mn.toggle=(e,t)=>{e!==void 0&&(jn=e),jn?Mn.show(t):Mn.hide(t)};var Nn=Mn,Pn={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:[`⠂`,`-`,`–`,`—`,`–`,`-`]},rollingLine:{interval:80,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(`.`)}};const Fn=v?.WriteStream?.prototype?.hasColors?.()??!1,I=(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}};I(0,0);const In=I(1,22);I(2,22),I(3,23),I(4,24),I(53,55),I(7,27),I(8,28),I(9,29),I(30,39);const Ln=I(31,39),Rn=I(32,39),zn=I(33,39),Bn=I(34,39);I(35,39),I(36,39),I(37,39);const Vn=I(90,39);I(40,49),I(41,49),I(42,49),I(43,49),I(44,49),I(45,49),I(46,49),I(47,49),I(100,49);const Hn=I(91,39);I(92,39);const Un=I(93,39);I(94,39),I(95,39),I(96,39),I(97,39),I(101,49),I(102,49),I(103,49),I(104,49),I(105,49),I(106,49),I(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{#e=0;start(){this.#e++,this.#e===1&&this.#t()}stop(){if(this.#e<=0)throw Error("`stop` called more times than `start`");this.#e--,this.#e===0&&this.#n()}#t(){u.platform===`win32`||!u.stdin.isTTY||(u.stdin.setRawMode(!0),u.stdin.on(`data`,this.#r),u.stdin.resume())}#n(){u.stdin.isTTY&&(u.stdin.off(`data`,this.#r),u.stdin.pause(),u.stdin.setRawMode(!1))}#r(e){e[0]===3&&u.emit(`SIGINT`)}},mr=class{#e=0;#t=!1;#n=0;#r=-1;#i=0;#a=0;#o;#s;#c;#l;#u;#d;#f;#p;#m;#h;#g;color;constructor(e){typeof e==`string`&&(e={text:e}),this.#o={color:`cyan`,stream:u.stderr,discardStdin:!0,hideCursor:!0,...e},this.color=this.#o.color,this.spinner=this.#o.spinner,this.#u=this.#o.interval,this.#c=this.#o.stream,this.#d=typeof this.#o.isEnabled==`boolean`?this.#o.isEnabled:fr({stream:this.#c}),this.#f=typeof this.#o.isSilent==`boolean`?this.#o.isSilent:!1,this.text=this.#o.text,this.prefixText=this.#o.prefixText,this.suffixText=this.#o.suffixText,this.indent=this.#o.indent,u.env.NODE_ENV===`test`&&(this._stream=this.#c,this._isEnabled=this.#d,Object.defineProperty(this,`_linesToClear`,{get(){return this.#e},set(e){this.#e=e}}),Object.defineProperty(this,`_frameIndex`,{get(){return this.#r}}),Object.defineProperty(this,`_lineCount`,{get(){return this.#n}}))}get indent(){return this.#p}set indent(e=0){if(!(e>=0&&Number.isInteger(e)))throw Error("The `indent` option must be an integer from 0 and up");this.#p=e,this.#x()}get interval(){return this.#u??this.#s.interval??100}get spinner(){return this.#s}set spinner(e){if(this.#r=-1,this.#u=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.#s=e}else if(!Wn())this.#s=Pn.line;else if(e===void 0)this.#s=Pn.dots;else if(e!==`default`&&Pn[e])this.#s=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.#m}set text(e=``){this.#m=e,this.#x()}get prefixText(){return this.#h}set prefixText(e=``){this.#h=e,this.#x()}get suffixText(){return this.#g}set suffixText(e=``){this.#g=e,this.#x()}get isSpinning(){return this.#l!==void 0}#_(e,t,n=!1){let r=typeof e==`function`?e():e;return typeof r==`string`&&r!==``?n?t+r:r+t:``}#v(e=this.#h,t=` `){return this.#_(e,t,!1)}#y(e=this.#g,t=` `){return this.#_(e,t,!0)}#b(e,t){let n=0;for(let r of Qn(e).split(`
25
- `))n+=Math.max(1,Math.ceil(dr(r)/t));return n}#x(){let e=this.#c.columns??80,t=typeof this.#h==`function`?``:this.#h,n=typeof this.#g==`function`?``:this.#g,r=typeof t==`string`&&t!==``?t+` `:``,i=typeof n==`string`&&n!==``?` `+n:``,a=` `.repeat(this.#p)+r+`-`+(typeof this.#m==`string`?` `+this.#m:``)+i;this.#n=this.#b(a,e)}get isEnabled(){return this.#d&&!this.#f}set isEnabled(e){if(typeof e!=`boolean`)throw TypeError("The `isEnabled` option must be a boolean");this.#d=e}get isSilent(){return this.#f}set isSilent(e){if(typeof e!=`boolean`)throw TypeError("The `isSilent` option must be a boolean");this.#f=e}frame(){let e=Date.now();(this.#r===-1||e-this.#i>=this.interval)&&(this.#r=++this.#r%this.#s.frames.length,this.#i=e);let{frames:t}=this.#s,n=t[this.#r];this.color&&(n=Lt[this.color](n));let r=this.#v(this.#h,` `),i=typeof this.text==`string`?` `+this.text:``,a=this.#y(this.#g,` `);return r+n+i+a}clear(){if(!this.#d||!this.#c.isTTY)return this;this.#c.cursorTo(0);for(let e=0;e<this.#e;e++)e>0&&this.#c.moveCursor(0,-1),this.#c.clearLine(1);return(this.#p||this.#a!==this.#p)&&this.#c.cursorTo(this.#p),this.#a=this.#p,this.#e=0,this}render(){if(!this.#d||this.#f)return this;this.clear();let e=this.frame(),t=this.#c.columns??80,n=this.#b(e,t),r=this.#c.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.#c.write(e),this.#e=this.#b(e,t),this}start(e){if(e&&(this.text=e),this.#f)return this;if(!this.#d){let e=` `.repeat(this.#p)+this.#v(this.#h,` `)+(this.text?`- ${this.text}`:``)+this.#y(this.#g,` `);return e.trim()!==``&&this.#c.write(e+`
28
- `),this}return this.isSpinning?this:(this.#o.hideCursor&&Nn.hide(this.#c),this.#o.discardStdin&&u.stdin.isTTY&&(this.#t=!0,pr.start()),this.render(),this.#l=setInterval(this.render.bind(this),this.interval),this)}stop(){return clearInterval(this.#l),this.#l=void 0,this.#r=0,this.#d&&(this.clear(),this.#o.hideCursor&&Nn.show(this.#c)),this.#o.discardStdin&&u.stdin.isTTY&&this.#t&&(pr.stop(),this.#t=!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.#f)return this;let t=e.prefixText??this.#h,n=this.#v(t,` `),r=e.symbol??` `,i=e.text??this.text,a=typeof i==`string`?(r?` `:``)+i:``,o=e.suffixText??this.#g,s=this.#y(o,` `),c=n+r+a+s+`
29
- `;return this.stop(),this.#c.write(c),this}};function hr(e){return new mr(e)}var gr=t(n(((e,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&&=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 ae(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(ie(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 P().onDone(()=>wr).output(`.gitattributes`).logger(`Create/Overwrite`,F(`.gitattributes`));let e=hr({text:"Downloading template from `gitignore.io`"}).start(),t=`Create/Overwrite ${F(`.gitignore`)}`;return new P().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:en(`√`),text:t})}).catch(n=>{e.stopAndPersist({symbol:$t(`×`),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 P().onDone(()=>n?Dr.replace(`{{year}}`,new Date().getFullYear()).replace(`{{holder}}`,e):Or).output(`LICENSE`).logger(`Create/Overwrite`,F(`LICENSE`)).catch(console.warn)}}const L={defaultMerge:Symbol(`deepmerge-ts: default merge`),skip:Symbol(`deepmerge-ts: skip`)};L.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||={});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=Jr(a,t,t.metaDataUpdater(n,{key:i,parents:e}));o!==L.skip&&(i===`__proto__`?Object.defineProperty(r,i,{value:o,configurable:!0,enumerable:!0,writable:!0}):r[i]=o)}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:L}}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===L.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===L.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===L.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===L.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===L.defaultMerge||t.useImplicitDefaultMerging&&r===void 0&&t.mergeFunctions.mergeOthers!==t.defaultMergeFunctions.mergeOthers?t.defaultMergeFunctions.mergeOthers(e):r}var R={"@bring-it/cli":`^0.11.1`,"@bring-it/npm":`^0.9.3`,"@cospaia/prettier-plugin-clojure":`^0.0.2`,"@vitest/ui":`^4.0.16`,eslint:`^9.39.1`,"find-workspaces":`^0.3.1`,garou:`^0.9.17`,postcss:`^8.5.6`,prettier:`~3.7.4`,"prettier-plugin-tailwindcss":`^0.7.2`,stylelint:`^16.26.1`,syncpack:`^13.0.4`,tsdown:`^0.18.4`,typescript:`~5.9.3`,vitest:`^4.0.16`,"@bring-it/sftp":`^0.7.1`,"@nice-move/init":`^0.8.28`,"@nice-move/syncpack-config":`^0.4.2`,"@playwright/test":`~1.56.1`,"@types/react":`~18.3.27`,react:`~18.3.1`,"react-dom":`~18.3.1`,tailwindcss:`^3.4.19`,vue:`~3.5.26`,yaml:`^2.8.2`,"@nice-move/eslint-config-base":`^0.13.16`,"@nice-move/stylelint-config":`^0.10.25`,"@nice-move/prettier-config":`^0.15.7`,"@nice-move/tsconfig":`^0.4.1`,"@nice-move/cli":`^0.11.29`,"@eslint/eslintrc":`^3.3.3`,"@eslint/js":`^9.39.2`,"@eslint/markdown":`^7.5.1`,"@types/node":`^24.10.4`,chalk:`^5.6.2`,"eslint-plugin-vue":`^10.6.2`,execa:`^9.6.1`,"fs-chain":`^10.0.0`,lodash:`^4.17.21`,settingz:`^0.2.0`,"sort-keys":`^6.0.0`,"typescript-eslint":`^8.51.0`,"eslint-plugin-react-hooks":`^5.2.0`,globals:`^17.0.0`,lts:`>=24.0.0 || ^22.18.0`},ei=n(((e,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=n(((e,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=t(n((e=>{let t=ei(),n=ti(),r=t(n);e.from=e=>{if(typeof e!=`number`)throw TypeError(`Expected a number`);return n[e]},e.all=new Proxy(r,{get(e,t){let n=e[t];if(n)return Number(n)}})}))(),1);const ri=fe(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}async function yi(){await vi()===`zh-CN`&&new P().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`,F(`.npmrc`)).catch(console.warn)}const bi=`package.json`;function xi(e){return new Qt().config({pretty:!0}).source(bi).onFail().onDone((t={})=>Gr({packageManager:R.packageManager,type:`module`,engines:{node:R.lts,pnpm:R.pnpm},publishConfig:e.private||t.private?void 0:{access:`public`,registry:`https://registry.npmjs.org/`}},t,e)).onDone(e=>(e.private===!0&&yi(),e)).output().logger(`Add project info to`,F(bi)).catch(console.warn)}async function Si(){let{name:e,description:t}=Cr();new P().source(`README.md`).onFail().onDone(n=>n||[`# ${e}`,t?`${t}.\n`:``].filter(Boolean).join(`
80
-
81
- `)).output().logger(`Create`,F(`README.md`)).catch(console.warn)}function z(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]=z(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(!z(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]`,B=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 me(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&&B(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];return qi(c,Array.isArray(l)?l.map(e=>Ji(e)):[Ji(l)],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(z(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(B(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],V=[`stdin`,`stdout`,`stderr`],Qi=e=>V[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});return la(na(e[t],n,t),t)},ta=({stdio:e})=>Array.isArray(e)?Math.max(e.length,V.length):V.length,na=(e,t,n)=>z(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(V.includes(e))return V.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:ue(`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];return{command:n.join(` `),escapedCommand:n.map(e=>Da(Sa(e))).join(` `)}},xa=e=>pe(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=Ha(qa(t,Ka({type:e,result:i,verboseInfo:r})),r,n);a!==``&&console.warn(a.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=>xa(typeof e==`string`?e:de(e)).replaceAll(` `,` `.repeat(Xa)),Xa=2,Za=(e,t)=>{pa(t)&&Ga({type:`command`,verboseMessage:e,verboseInfo:t})},Qa=(e,t,n)=>(to(e),{verbose:e,escapedCommand:t,commandId:$a(e),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=Qa(ea(n,`verbose`),a,{...n});return Za(a,o),{command:i,escapedCommand:a,startTime:r,verboseInfo:o}};var ao=n(((t,n)=>{n.exports=o,o.sync=s;var r=e(`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=n(((t,n)=>{n.exports=i,i.sync=a;var r=e(`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=n(((t,n)=>{e(`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=n(((t,n)=>{let r=process.platform===`win32`||process.env.OSTYPE===`cygwin`||process.env.OSTYPE===`msys`,i=e(`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||={};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);a(f(!l&&/^\.[\\\/]/.test(e)?e.slice(0,2)+d:d,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||={};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{}}}if(t.all&&l.length)return l;if(t.nothrow)return null;throw s(e)}})),lo=n(((e,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=n(((t,n)=>{let r=e(`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{}let l;try{l=i.sync(e.command,{path:n[a({env:n})],pathExt:t?r.delimiter:void 0})}catch{}finally{c&&process.chdir(o)}return l&&=r.resolve(s?e.options.cwd:``,l),l}function s(e){return o(e)||o(e,!0)}n.exports=s})),fo=n(((e,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=n(((e,t)=>{t.exports=/^#!(.*)/})),mo=n(((e,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=n(((t,n)=>{let r=e(`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{}return i(t.toString())}n.exports=a})),go=n(((t,n)=>{let r=e(`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=n(((e,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=t(n(((t,n)=>{let r=e(`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`}fe(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)=>new(n?No:Mo)(t,e instanceof Do?{}:{cause:e});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 is;if(!Number.isFinite(e)||e<0)throw TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e},is=1e3*5,as=({kill:e,options:{forceKillAfterDelay:t,killSignal:n},onInternalError:r,context:i,controller:a},o,s)=>{let{signal:c,error:l}=os(o,s,n);ss(l,r);let u=e(c);return cs({kill:e,signal:c,forceKillAfterDelay:t,killSignal:n,killResult:u,context:i,controller:a}),u},os=(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}},ss=(e,t)=>{e!==void 0&&t.reject(e)},cs=async({kill:e,signal:t,forceKillAfterDelay:n,killSignal:r,killResult:i,context:a,controller:o})=>{t===r&&i&&ls({kill:e,forceKillAfterDelay:n,context:a,controllerSignal:o.signal})},ls=async({kill:e,forceKillAfterDelay:t,context:n,controllerSignal:r})=>{if(t!==!1)try{await _e(t,void 0,{signal:r}),e(`SIGKILL`)&&(n.isForcefullyTerminated??=!0)}catch{}},us=async(e,t)=>{e.aborted||await w(e,`abort`,{signal:t})},ds=({cancelSignal:e})=>{if(e!==void 0&&Object.prototype.toString.call(e)!==`[object AbortSignal]`)throw Error(`The \`cancelSignal\` option must be an AbortSignal: ${String(e)}`)},fs=({subprocess:e,cancelSignal:t,gracefulCancel:n,context:r,controller:i})=>t===void 0||n?[]:[ps(e,t,r,i)],ps=async(e,t,n,{signal:r})=>{throw await us(t,r),n.terminationReason??=`cancel`,e.kill(),t.reason},ms=({methodName:e,isSubprocess:t,ipc:n,isConnected:r})=>{hs(e,t,n),gs(e,t,r)},hs=(e,t,n)=>{if(!n)throw Error(`${H(e,t)} can only be used if the \`ipc\` option is \`true\`.`)},gs=(e,t,n)=>{if(!n)throw Error(`${H(e,t)} cannot be used: the ${U(t)} has already exited or disconnected.`)},_s=e=>{throw Error(`${H(`getOneMessage`,e)} could not complete: the ${U(e)} exited or disconnected.`)},vs=e=>{throw Error(`${H(`sendMessage`,e)} failed: the ${U(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
- ${H(`getOneMessage`,e)},
95
- ${H(`sendMessage`,e,`message, {strict: true}`)},
96
- ]);`)},ys=(e,t)=>Error(`${H(`sendMessage`,t)} failed when sending an acknowledgment response to the ${U(t)}.`,{cause:e}),bs=e=>{throw Error(`${H(`sendMessage`,e)} failed: the ${U(e)} is not listening to incoming messages.`)},xs=e=>{throw Error(`${H(`sendMessage`,e)} failed: the ${U(e)} exited without listening to incoming messages.`)},Ss=()=>Error(`\`cancelSignal\` aborted: the ${U(!0)} disconnected.`),Cs=()=>{throw Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")},ws=({error:e,methodName:t,isSubprocess:n})=>{if(e.code===`EPIPE`)throw Error(`${H(t,n)} cannot be used: the ${U(n)} is disconnecting.`,{cause:e})},Ts=({error:e,methodName:t,isSubprocess:n,message:r})=>{if(Es(e))throw Error(`${H(t,n)}'s argument type is invalid: the message cannot be serialized: ${String(r)}.`,{cause:e})},Es=({code:e,message:t})=>Ds.has(e)||Os.some(e=>t.includes(e)),Ds=new Set([`ERR_MISSING_ARGS`,`ERR_INVALID_ARG_TYPE`]),Os=[`could not be cloned`,`circular structure`,`call stack size exceeded`],H=(e,t,n=``)=>e===`cancelSignal`?"`cancelSignal`'s `controller.abort()`":`${ks(t)}${e}(${n})`,ks=e=>e?``:`subprocess.`,U=e=>e?`parent process`:`subprocess`,As=e=>{e.connected&&e.disconnect()},js=()=>{let e={},t=new Promise((t,n)=>{Object.assign(e,{resolve:t,reject:n})});return Object.assign(t,e)},Ms=(e,t=`stdin`)=>{let{options:n,fileDescriptors:r}=Ps.get(e),i=Fs(r,t,!0),a=e.stdio[i];if(a===null)throw TypeError(Rs(i,t,n,!0));return a},Ns=(e,t=`stdout`)=>{let{options:n,fileDescriptors:r}=Ps.get(e),i=Fs(r,t,!1),a=i===`all`?e.all:e.stdio[i];if(a==null)throw TypeError(Rs(i,t,n,!1));return a},Ps=new WeakMap,Fs=(e,t,n)=>{let r=Is(t,n);return Ls(r,t,n,e),r},Is=(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(`"${Vs(t)}" must not be "${e}".
97
- It must be ${r} or "fd3", "fd4" (and so on).
98
- It is optional and defaults to "${i}".`)},Ls=(e,t,n,r)=>{let i=r[Bs(e)];if(i===void 0)throw TypeError(`"${Vs(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(`"${Vs(n)}" must not be ${t}. It must be a readable stream, not writable.`);if(i.direction!==`input`&&n)throw TypeError(`"${Vs(n)}" must not be ${t}. It must be a writable stream, not readable.`)},Rs=(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}=zs(e,n);return`The "${i}: ${Hs(a)}" option is incompatible with using "${Vs(r)}: ${Hs(t)}".
100
- Please set this option with "pipe" instead.`},zs=(e,{stdin:t,stdout:n,stderr:r,stdio:i})=>{let a=Bs(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]}},Bs=e=>e===`all`?1:e,Vs=e=>e?`to`:`from`,Hs=e=>typeof e==`string`?`'${e}'`:typeof e==`number`?`${e}`:`Stream`,Us=(e,t,n)=>{let r=e.getMaxListeners();r===0||r===1/0||(e.setMaxListeners(r+t),ye(n,()=>{e.setMaxListeners(e.getMaxListeners()-t)}))},Ws=(e,t)=>{t&&Gs(e)},Gs=e=>{e.refCounted()},Ks=(e,t)=>{t&&qs(e)},qs=e=>{e.unrefCounted()},Js=(e,t)=>{t&&(qs(e),qs(e))},Ys=(e,t)=>{t&&(Gs(e),Gs(e))},Xs=async({anyProcess:e,channel:t,isSubprocess:n,ipcEmitter:r},i)=>{if(sc(i)||Oc(i))return;Qs.has(e)||Qs.set(e,[]);let a=Qs.get(e);if(a.push(i),!(a.length>1))for(;a.length>0;){await hc(e,r,i),await he.yield();let o=await oc({wrappedMessage:a[0],anyProcess:e,channel:t,isSubprocess:n,ipcEmitter:r});a.shift(),r.emit(`message`,o),r.emit(`message:done`)}},Zs=async({anyProcess:e,channel:t,isSubprocess:n,ipcEmitter:r,boundOnMessage:i})=>{Ac();let a=Qs.get(e);for(;a?.length>0;)await w(r,`message:done`);e.removeListener(`message`,i),Ys(t,n),r.connected=!1,r.emit(`disconnect`)},Qs=new WeakMap,$s=(e,t,n)=>{if(ec.has(e))return ec.get(e);let r=new ve;return r.connected=!0,ec.set(e,r),tc({ipcEmitter:r,anyProcess:e,channel:t,isSubprocess:n}),r},ec=new WeakMap,tc=({ipcEmitter:e,anyProcess:t,channel:n,isSubprocess:r})=>{let i=Xs.bind(void 0,{anyProcess:t,channel:n,isSubprocess:r,ipcEmitter:e});t.on(`message`,i),t.once(`disconnect`,Zs.bind(void 0,{anyProcess:t,channel:n,isSubprocess:r,ipcEmitter:e,boundOnMessage:i})),Js(n,r)},nc=e=>{let t=ec.get(e);return t===void 0?e.channel!==null:t.connected},rc=({anyProcess:e,channel:t,isSubprocess:n,message:r,strict:i})=>{if(!i)return r;let a=_c(e,$s(e,t,n));return{id:ic++,type:dc,message:r,hasListeners:a}};let ic=0n;const ac=(e,t)=>{if(!(t?.type!==dc||t.hasListeners))for(let{id:t}of e)t!==void 0&&lc[t].resolve({isDeadlock:!0,hasListeners:!1})},oc=async({wrappedMessage:e,anyProcess:t,channel:n,isSubprocess:r,ipcEmitter:i})=>{if(e?.type!==dc||!t.connected)return e;let{id:a,message:o}=e,s={id:a,type:fc,message:_c(t,i)};try{await yc({anyProcess:t,channel:n,isSubprocess:r,ipc:!0},s)}catch(e){i.emit(`strict:error`,e)}return o},sc=e=>{if(e?.type!==fc)return!1;let{id:t,message:n}=e;return lc[t]?.resolve({isDeadlock:!1,hasListeners:n}),!0},cc=async(e,t,n)=>{if(e?.type!==dc)return;let r=js();lc[e.id]=r;let i=new AbortController;try{let{isDeadlock:e,hasListeners:a}=await Promise.race([r,uc(t,n,i)]);e&&vs(n),a||bs(n)}finally{i.abort(),delete lc[e.id]}},lc={},uc=async(e,t,{signal:n})=>{Us(e,1,n),await w(e,`disconnect`,{signal:n}),xs(t)},dc=`execa:ipc:request`,fc=`execa:ipc:response`,pc=(e,t,n)=>{gc.has(e)||gc.set(e,new Set);let r=gc.get(e),i={onMessageSent:js(),id:n?t.id:void 0};return r.add(i),{outgoingMessages:r,outgoingMessage:i}},mc=({outgoingMessages:e,outgoingMessage:t})=>{e.delete(t),t.onMessageSent.resolve()},hc=async(e,t,n)=>{for(;!_c(e,t)&&gc.get(e)?.size>0;){let t=[...gc.get(e)];ac(t,n),await Promise.all(t.map(({onMessageSent:e})=>e))}},gc=new WeakMap,_c=(e,t)=>t.listenerCount(`message`)>vc(e),vc=e=>Ps.has(e)&&!fa(Ps.get(e).options.buffer,`ipc`)?1:0,yc=({anyProcess:e,channel:t,isSubprocess:n,ipc:r},i,{strict:a=!1}={})=>{let o=`sendMessage`;return ms({methodName:o,isSubprocess:n,ipc:r,isConnected:e.connected}),bc({anyProcess:e,channel:t,methodName:o,isSubprocess:n,message:i,strict:a})},bc=async({anyProcess:e,channel:t,methodName:n,isSubprocess:r,message:i,strict:a})=>{let o=rc({anyProcess:e,channel:t,isSubprocess:r,message:i,strict:a}),s=pc(e,o,a);try{await xc({anyProcess:e,methodName:n,isSubprocess:r,wrappedMessage:o,message:i})}catch(t){throw As(e),t}finally{mc(s)}},xc=async({anyProcess:e,methodName:t,isSubprocess:n,wrappedMessage:r,message:i})=>{let a=Sc(e);try{await Promise.all([cc(r,e,n),a(r)])}catch(e){throw ws({error:e,methodName:t,isSubprocess:n}),Ts({error:e,methodName:t,isSubprocess:n,message:i}),e}},Sc=e=>{if(Cc.has(e))return Cc.get(e);let t=fe(e.send.bind(e));return Cc.set(e,t),t},Cc=new WeakMap,wc=(e,t)=>{let n=`cancelSignal`;return gs(n,!1,e.connected),xc({anyProcess:e,methodName:n,isSubprocess:!1,wrappedMessage:{type:kc,message:t},message:t})},Tc=async({anyProcess:e,channel:t,isSubprocess:n,ipc:r})=>(await Ec({anyProcess:e,channel:t,isSubprocess:n,ipc:r}),jc.signal),Ec=async({anyProcess:e,channel:t,isSubprocess:n,ipc:r})=>{if(!Dc){if(Dc=!0,!r){Cs();return}if(t===null){Ac();return}$s(e,t,n),await he.yield()}};let Dc=!1;const Oc=e=>e?.type===kc?(jc.abort(e.message),!0):!1,kc=`execa:ipc:cancel`,Ac=()=>{jc.abort(Ss())},jc=new AbortController,Mc=({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.")}},Nc=({subprocess:e,cancelSignal:t,gracefulCancel:n,forceKillAfterDelay:r,context:i,controller:a})=>n?[Pc({subprocess:e,cancelSignal:t,forceKillAfterDelay:r,context:i,controller:a})]:[],Pc=async({subprocess:e,cancelSignal:t,forceKillAfterDelay:n,context:r,controller:{signal:i}})=>{throw await us(t,i),await wc(e,Fc(t)),ls({kill:e.kill,forceKillAfterDelay:n,context:r,controllerSignal:i}),r.terminationReason??=`gracefulCancel`,t.reason},Fc=({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},Ic=({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})`)},Lc=(e,t,n,r)=>t===0||t===void 0?[]:[Rc(e,t,n,r)],Rc=async(e,t,n,{signal:r})=>{throw await _e(t,void 0,{signal:r}),n.terminationReason??=`timeout`,e.kill(),new Do},zc=({options:e})=>{if(e.node===!1)throw TypeError('The "node" option cannot be false with `execaNode()`.');return{options:{...e,node:!0}}},Bc=(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}]},Vc=({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`.");Hc[n](e)}},Hc={advanced:e=>{try{Se(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})}}},Uc=async(e,t)=>{t!==void 0&&await e.sendMessage(t)},Wc=({encoding:e})=>{if(qc.has(e))return;let t=Jc(e);if(t!==void 0)throw TypeError(`Invalid option \`encoding: ${Xc(e)}\`.
101
- Please rename it to ${Xc(t)}.`);let n=[...qc].map(e=>Xc(e)).join(`, `);throw TypeError(`Invalid option \`encoding: ${Xc(e)}\`.
102
- Please rename it to one of: ${n}.`)},Gc=new Set([`utf8`,`utf16le`]),Kc=new Set([`buffer`,`hex`,`base64`,`base64url`,`latin1`,`ascii`]),qc=new Set([...Gc,...Kc]),Jc=e=>{if(e===null)return`buffer`;if(typeof e!=`string`)return;let t=e.toLowerCase();if(t in Yc)return Yc[t];if(qc.has(t))return t},Yc={"utf-8":`utf8`,"utf-16le":`utf16le`,"ucs-2":`utf16le`,ucs2:`utf16le`,binary:`latin1`},Xc=e=>typeof e==`string`?`"${e}"`:String(e),Zc=(e=Qc())=>{let t=Ci(e,`The "cwd" option`);return i.resolve(t)},Qc=()=>{try{return u.cwd()}catch(e){throw e.message=`The current directory does not exist.\n${e.message}`,e}},$c=(e,t)=>{if(t===Qc())return e;let n;try{n=oe(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}`},el=(e,t,n)=>{n.cwd=Zc(n.cwd);let[r,a,o]=Bc(e,t,n),{command:s,args:c,options:l}=vo.default._parse(r,a,o),d=tl($i(l));return Ic(d),Wc(d),Vc(d),ds(d),Mc(d),d.shell=Ei(d.shell),d.env=nl(d),d.killSignal=qo(d.killSignal),d.forceKillAfterDelay=rs(d.forceKillAfterDelay),d.lines=d.lines.map((e,t)=>e&&!Kc.has(d.encoding)&&d.buffer[t]),u.platform===`win32`&&i.basename(s,`.exe`)===`cmd`&&c.unshift(`/q`),{file:s,commandArguments:c,options:d}},tl=({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}),nl=({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},rl=(e,t,n)=>n.shell&&t.length>0?[[e,...t].join(` `),[],n]:[e,t,n];function il(e){if(typeof e==`string`)return al(e);if(!(ArrayBuffer.isView(e)&&e.BYTES_PER_ELEMENT===1))throw Error(`Input must be a string or a Uint8Array`);return ol(e)}const al=e=>e.at(-1)===sl?e.slice(0,e.at(-2)===ll?-2:-1):e,ol=e=>e.at(-1)===cl?e.subarray(0,e.at(-2)===ul?-2:-1):e,sl=`
103
- `,cl=`
104
- `.codePointAt(0),ll=`\r`,ul=`\r`.codePointAt(0);function dl(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 fl(e,{checkOpen:t=!0}={}){return dl(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 pl(e,{checkOpen:t=!0}={}){return dl(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 ml(e,t){return fl(e,t)&&pl(e,t)}const hl=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype);var gl=class{#e;#t;#n=!1;#r=void 0;constructor(e,t){this.#e=e,this.#t=t}next(){let e=()=>this.#i();return this.#r=this.#r?this.#r.then(e,e):e(),this.#r}return(e){let t=()=>this.#a(e);return this.#r?this.#r.then(t,t):t()}async#i(){if(this.#n)return{done:!0,value:void 0};let e;try{e=await this.#e.read()}catch(e){throw this.#r=void 0,this.#n=!0,this.#e.releaseLock(),e}return e.done&&(this.#r=void 0,this.#n=!0,this.#e.releaseLock()),e}async#a(e){if(this.#n)return{done:!0,value:e};if(this.#n=!0,!this.#t){let t=this.#e.cancel(e);return this.#e.releaseLock(),await t,{done:!0,value:e}}return this.#e.releaseLock(),{done:!0,value:e}}};const _l=Symbol();function vl(){return this[_l].next()}Object.defineProperty(vl,`name`,{value:`next`});function yl(e){return this[_l].return(e)}Object.defineProperty(yl,`name`,{value:`return`});const bl=Object.create(hl,{next:{enumerable:!0,configurable:!0,writable:!0,value:vl},return:{enumerable:!0,configurable:!0,writable:!0,value:yl}});function xl({preventCancel:e=!1}={}){let t=new gl(this.getReader(),e),n=Object.create(bl);return n[_l]=t,n}const Sl=e=>{if(pl(e,{checkOpen:!1})&&El.on!==void 0)return wl(e);if(typeof e?.[Symbol.asyncIterator]==`function`)return e;if(Cl.call(e)===`[object ReadableStream]`)return xl.call(e);throw TypeError(`The first argument must be a Readable, a ReadableStream, or an async iterable.`)},{toString:Cl}=Object.prototype,wl=async function*(e){let t=new AbortController,n={};Tl(e,t,n);try{for await(let[n]of El.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()}},Tl=async(e,t,n)=>{try{await El.finished(e,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(e){n.error=e}finally{t.abort()}},El={},Dl=async(e,{init:t,convertChunk:n,getSize:r,truncateChunk:i,addChunk:a,getFinalChunk:o,finalize:s},{maxBuffer:c=1/0}={})=>{let l=Sl(e),u=t();u.length=0;try{for await(let e of l)kl({convertedChunk:n[jl(e)](e,u),state:u,getSize:r,truncateChunk:i,addChunk:a,maxBuffer:c});return Ol({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}},Ol=({state:e,getSize:t,truncateChunk:n,addChunk:r,getFinalChunk:i,maxBuffer:a})=>{let o=i(e);o!==void 0&&kl({convertedChunk:o,state:e,getSize:t,truncateChunk:n,addChunk:r,maxBuffer:a})},kl=({convertedChunk:e,state:t,getSize:n,truncateChunk:r,addChunk:i,maxBuffer:a})=>{let o=n(e),s=t.length+o;if(s<=a){Al(e,t,i,s);return}let c=r(e,a-t.length);throw c!==void 0&&Al(c,t,i,a),new Nl},Al=(e,t,n,r)=>{t.contents=n(e,t,r),t.length=r},jl=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=Ml.call(e);return n===`[object ArrayBuffer]`?`arrayBuffer`:n===`[object DataView]`?`dataView`:Number.isInteger(e.byteLength)&&Number.isInteger(e.byteOffset)&&Ml.call(e.buffer)===`[object ArrayBuffer]`?`typedArray`:`others`},{toString:Ml}=Object.prototype;var Nl=class extends Error{name=`MaxBufferError`;constructor(){super(`maxBuffer exceeded`)}};const Pl=e=>e,Fl=()=>void 0,Il=({contents:e})=>e,Ll=e=>{throw Error(`Streams in object mode are not supported: ${String(e)}`)},Rl=e=>e.length;async function zl(e,t){return Dl(e,Bl,t)}const Bl={init:()=>({contents:[]}),convertChunk:{string:Pl,buffer:Pl,arrayBuffer:Pl,dataView:Pl,typedArray:Pl,others:Pl},getSize:()=>1,truncateChunk:Fl,addChunk:(e,{contents:t})=>(t.push(e),t),getFinalChunk:Fl,finalize:Il};async function Vl(e,t){return Dl(e,tu,t)}const Hl=()=>({contents:new ArrayBuffer(0)}),Ul=e=>Wl.encode(e),Wl=new TextEncoder,Gl=e=>new Uint8Array(e),Kl=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),ql=(e,t)=>e.slice(0,t),Jl=(e,{contents:t,length:n},r)=>{let i=eu()?Xl(t,r):Yl(t,r);return new Uint8Array(i).set(e,n),i},Yl=(e,t)=>{if(t<=e.byteLength)return e;let n=new ArrayBuffer(Zl(t));return new Uint8Array(n).set(new Uint8Array(e),0),n},Xl=(e,t)=>{if(t<=e.maxByteLength)return e.resize(t),e;let n=new ArrayBuffer(t,{maxByteLength:Zl(t)});return new Uint8Array(n).set(new Uint8Array(e),0),n},Zl=e=>Ql**Math.ceil(Math.log(e)/Math.log(Ql)),Ql=2,$l=({contents:e,length:t})=>eu()?e:e.slice(0,t),eu=()=>`resize`in ArrayBuffer.prototype,tu={init:Hl,convertChunk:{string:Ul,buffer:Gl,arrayBuffer:Gl,dataView:Kl,typedArray:Kl,others:Ll},getSize:Rl,truncateChunk:ql,addChunk:Jl,getFinalChunk:Fl,finalize:$l};async function nu(e,t){return Dl(e,au,t)}const ru=()=>({contents:``,textDecoder:new TextDecoder}),iu=(e,{textDecoder:t})=>t.decode(e,{stream:!0}),au={init:ru,convertChunk:{string:Pl,buffer:iu,arrayBuffer:iu,dataView:iu,typedArray:iu,others:Ll},getSize:Rl,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:Il},ou=({error:e,stream:t,readableObjectMode:n,lines:r,encoding:i,fdNumber:a})=>{if(!(e instanceof Nl))throw e;if(a===`all`)return e;throw e.maxBufferInfo={fdNumber:a,unit:su(n,r,i)},t.destroy(),e},su=(e,t,n)=>e?`objects`:t?`lines`:n===`buffer`?`bytes`:`characters`,cu=(e,t,n)=>{if(t.length!==n)return;let r=new Nl;throw r.maxBufferInfo={fdNumber:`ipc`},r},lu=(e,t)=>{let{streamName:n,threshold:r,unit:i}=uu(e,t);return`Command's ${n} was larger than ${r} ${i}`},uu=(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}},du=(e,t,n)=>e?.code===`ENOBUFS`&&t!==null&&t.some(e=>e!==null&&e.length>pu(n)),fu=(e,t,n)=>{if(!t)return e;let r=pu(n);return e.length>r?e.slice(0,r):e},pu=([,e])=>e,mu=({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=hu({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=_u(r,_),x=`${y}: ${s}${b===void 0?``:`\n${b}`}`;return{originalMessage:b,shortMessage:x,message:[x,...t===void 0?[e[2],e[1]]:[t],...e.slice(3),n.map(e=>vu(e)).join(`
105
- `)].map(e=>xa(il(yu(e)))).filter(Boolean).join(`
106
-
107
- `)}},hu=({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=gu(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?`${lu(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}`},gu=(e,t)=>e?` and was forcefully terminated after ${t} milliseconds`:``,_u=(e,t)=>{if(e instanceof Do)return;let n=xa($c(ko(e)?e.originalMessage:String(e?.message??e),t));return n===``?void 0:n},vu=e=>typeof e==`string`?e:de(e),yu=e=>Array.isArray(e)?e.map(e=>il(bu(e))).filter(Boolean).join(`
108
- `):bu(e),bu=e=>typeof e==`string`?e:B(e)?Pi(e):``,xu=({command:e,escapedCommand:t,stdio:n,all:r,ipcOutput:i,options:{cwd:a},startTime:o})=>Tu({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:[]}),Su=({error:e,command:t,escapedCommand:n,fileDescriptors:r,options:i,startTime:a,isSync:o})=>Cu({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}),Cu=({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}=Eu(l,u),{originalMessage:ee,shortMessage:te,message:ne}=mu({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}),re=Eo(e,ne,b);return Object.assign(re,wu({error:re,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:ee,shortMessage:te})),re},wu=({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:_})=>Tu({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:[]}),Tu=e=>Object.fromEntries(Object.entries(e).filter(([,e])=>e!==void 0)),Eu=(e,t)=>{let n=e===null?void 0:e,r=t===null?void 0:t;return{exitCode:n,signal:r,signalDescription:r===void 0?void 0:ns(t)}},Du=e=>Number.isFinite(e)?e:0;function Ou(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(Du(e*1e3)%1e3),nanoseconds:Math.trunc(Du(e*1e6)%1e3)}}function ku(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 Au(e){switch(typeof e){case`number`:if(Number.isFinite(e))return Ou(e);break;case`bigint`:return ku(e)}throw TypeError(`Expected a finite number or bigint`)}const ju=e=>e===0||e===0n,Mu=(e,t)=>t===1||t===1n?e:`${e}s`,Nu=24n*60n*60n*1000n;function Pu(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)&&ju(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?` `+Mu(n,e):r;i.push(a)}},s=Au(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=a((n?Number(e%Nu):e)/1e3%60,typeof t.secondsDecimalDigits==`number`?t.secondsDecimalDigits:1),i=t.keepDecimalsOnWholeSeconds?r:r.replace(/\.0+$/,``);o(Number.parseFloat(i),`second`,`s`,i)}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 Fu=(e,t)=>{e.failed&&Ga({type:`error`,verboseMessage:e.shortMessage,verboseInfo:t,result:e})},Iu=(e,t)=>{pa(t)&&(Fu(e,t),Lu(e,t))},Lu=(e,t)=>{Ga({type:`duration`,verboseMessage:`(done in ${Pu(e.durationMs)})`,verboseInfo:t,result:e})},Ru=(e,t,{reject:n})=>{if(Iu(e,t),e.failed&&n)throw e;return e},zu=(e,t)=>Ju(e)?`asyncGenerator`:Yu(e)?`generator`:Zu(e)?`fileUrl`:$u(e)?`filePath`:od(e)?`webStream`:dl(e,{checkOpen:!1})?`native`:B(e)?`uint8Array`:cd(e)?`asyncIterable`:ld(e)?`iterable`:sd(e)?Hu({transform:e},t):Xu(e)?Bu(e,t):`native`,Bu=(e,t)=>ml(e.transform,{checkOpen:!1})?Vu(e,t):sd(e.transform)?Hu(e,t):Gu(e,t),Vu=(e,t)=>(Uu(e,t,`Duplex stream`),`duplex`),Hu=(e,t)=>(Uu(e,t,`web TransformStream`),`webTransform`),Uu=({final:e,binary:t,objectMode:n},r,i)=>{Wu(e,`${r}.final`,i),Wu(t,`${r}.binary`,i),Ku(n,`${r}.objectMode`)},Wu=(e,t,n)=>{if(e!==void 0)throw TypeError(`The \`${t}\` option can only be defined when using a generator, not a ${n}.`)},Gu=({transform:e,final:t,binary:n,objectMode:r},i)=>{if(e!==void 0&&!qu(e))throw TypeError(`The \`${i}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(ml(t,{checkOpen:!1}))throw TypeError(`The \`${i}.final\` option must not be a Duplex stream.`);if(sd(t))throw TypeError(`The \`${i}.final\` option must not be a web TransformStream.`);if(t!==void 0&&!qu(t))throw TypeError(`The \`${i}.final\` option must be a generator.`);return Ku(n,`${i}.binary`),Ku(r,`${i}.objectMode`),Ju(e)||Ju(t)?`asyncGenerator`:`generator`},Ku=(e,t)=>{if(e!==void 0&&typeof e!=`boolean`)throw TypeError(`The \`${t}\` option must use a boolean.`)},qu=e=>Ju(e)||Yu(e),Ju=e=>Object.prototype.toString.call(e)===`[object AsyncGeneratorFunction]`,Yu=e=>Object.prototype.toString.call(e)===`[object GeneratorFunction]`,Xu=e=>z(e)&&(e.transform!==void 0||e.final!==void 0),Zu=e=>Object.prototype.toString.call(e)===`[object URL]`,Qu=e=>Zu(e)&&e.protocol!==`file:`,$u=e=>z(e)&&Object.keys(e).length>0&&Object.keys(e).every(e=>ed.has(e))&&td(e.file),ed=new Set([`file`,`append`]),td=e=>typeof e==`string`,nd=(e,t)=>e===`native`&&typeof t==`string`&&!rd.has(t),rd=new Set([`ipc`,`ignore`,`inherit`,`overlapped`,`pipe`]),id=e=>Object.prototype.toString.call(e)===`[object ReadableStream]`,ad=e=>Object.prototype.toString.call(e)===`[object WritableStream]`,od=e=>id(e)||ad(e),sd=e=>id(e?.readable)&&ad(e?.writable),cd=e=>ud(e)&&typeof e[Symbol.asyncIterator]==`function`,ld=e=>ud(e)&&typeof e[Symbol.iterator]==`function`,ud=e=>typeof e==`object`&&!!e,dd=new Set([`generator`,`asyncGenerator`,`duplex`,`webTransform`]),fd=new Set([`fileUrl`,`filePath`,`fileNumber`]),pd=new Set([`fileUrl`,`filePath`]),md=new Set([...pd,`webStream`,`nodeStream`]),hd=new Set([`webTransform`,`duplex`]),gd={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`},_d=(e,t,n,r)=>r===`output`?vd(e,t,n):yd(e,t,n),vd=(e,t,n)=>{let r=t!==0&&n[t-1].value.readableObjectMode;return{writableObjectMode:r,readableObjectMode:e??r}},yd=(e,t,n)=>{let r=t===0?e===!0:n[t-1].value.readableObjectMode;return{writableObjectMode:r,readableObjectMode:t!==n.length-1&&(e??r)}},bd=(e,t)=>{let n=e.findLast(({type:e})=>dd.has(e));return n===void 0?!1:t===`input`?n.value.writableObjectMode:n.value.readableObjectMode},xd=(e,t,n,r)=>[...e.filter(({type:e})=>!dd.has(e)),...Sd(e,t,n,r)],Sd=(e,t,n,{encoding:r})=>{let i=e.filter(({type:e})=>dd.has(e)),a=Array.from({length:i.length});for(let[e,o]of Object.entries(i))a[e]=Cd({stdioItem:o,index:Number(e),newTransforms:a,optionName:t,direction:n,encoding:r});return Dd(a,n)},Cd=({stdioItem:e,stdioItem:{type:t},index:n,newTransforms:r,optionName:i,direction:a,encoding:o})=>t===`duplex`?wd({stdioItem:e,optionName:i}):t===`webTransform`?Td({stdioItem:e,index:n,newTransforms:r,direction:a}):Ed({stdioItem:e,index:n,newTransforms:r,direction:a,encoding:o}),wd=({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}}},Td=({stdioItem:e,stdioItem:{value:t},index:n,newTransforms:r,direction:i})=>{let{transform:a,objectMode:o}=z(t)?t:{transform:t},{writableObjectMode:s,readableObjectMode:c}=_d(o,n,r,i);return{...e,value:{transform:a,writableObjectMode:s,readableObjectMode:c}}},Ed=({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}=z(t)?t:{transform:t},d=c||Kc.has(a),{writableObjectMode:f,readableObjectMode:p}=_d(u,n,r,i);return{...e,value:{transform:o,final:s,binary:d,preserveNewlines:l,writableObjectMode:f,readableObjectMode:p}}},Dd=(e,t)=>t===`input`?e.reverse():e,Od=(e,t,n)=>{let r=e.map(e=>kd(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)??Fd},kd=({type:e,value:t},n)=>Ad[n]??Nd[e](t),Ad=[`input`,`output`,`output`],jd=()=>void 0,Md=()=>`input`,Nd={generator:jd,asyncGenerator:jd,fileUrl:jd,filePath:jd,iterable:Md,asyncIterable:Md,uint8Array:Md,webStream:e=>ad(e)?`output`:`input`,nodeStream(e){return pl(e,{checkOpen:!1})?fl(e,{checkOpen:!1})?void 0:`input`:`output`},webTransform:jd,duplex:jd,native(e){let t=Pd(e);if(t!==void 0)return t;if(dl(e,{checkOpen:!1}))return Nd.nodeStream(e)}},Pd=e=>{if([0,u.stdin].includes(e))return`input`;if([1,2,u.stdout,u.stderr].includes(e))return`output`},Fd=`output`,Id=(e,t)=>t&&!e.includes(`ipc`)?[...e,`ipc`]:e,Ld=({stdio:e,ipc:t,buffer:n,...r},i,a)=>{let o=Rd(e,r).map((e,t)=>Bd(e,t));return a?Vd(o,n,i):Id(o,t)},Rd=(e,t)=>{if(e===void 0)return V.map(e=>t[e]);if(zd(t))throw Error(`It's not possible to provide \`stdio\` in combination with one of ${V.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,V.length);return Array.from({length:n},(t,n)=>e[n])},zd=e=>V.some(t=>e[t]!==void 0),Bd=(e,t)=>Array.isArray(e)?e.map(e=>Bd(e,t)):e??(t>=V.length?`ignore`:`pipe`),Vd=(e,t,n)=>e.map((e,r)=>!t[r]&&r!==0&&!ma(n,r)&&Hd(e)?`ignore`:e),Hd=e=>e===`pipe`||Array.isArray(e)&&e.every(e=>e===`pipe`),Ud=({stdioItem:e,stdioItem:{type:t},isStdioArray:n,fdNumber:r,direction:i,isSync:a})=>!n||t!==`native`?e:a?Wd({stdioItem:e,fdNumber:r,direction:i}):qd({stdioItem:e,fdNumber:r}),Wd=({stdioItem:e,stdioItem:{value:t,optionName:n},fdNumber:r,direction:i})=>{let a=Gd({value:t,optionName:n,fdNumber:r,direction:i});if(a!==void 0)return a;if(dl(t,{checkOpen:!1}))throw TypeError(`The \`${n}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return e},Gd=({value:e,optionName:t,fdNumber:n,direction:r})=>{let i=Kd(e,n);if(i!==void 0){if(r===`output`)return{type:`fileNumber`,value:i,optionName:t};if(v.isatty(i))throw TypeError(`The \`${t}: ${Hs(e)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:`uint8Array`,value:Ai(ie(i)),optionName:t}}},Kd=(e,t)=>{if(e===`inherit`)return t;if(typeof e==`number`)return e;let n=Zi.indexOf(e);if(n!==-1)return n},qd=({stdioItem:e,stdioItem:{value:t,optionName:n},fdNumber:r})=>t===`inherit`?{type:`nodeStream`,value:Jd(r,t,n),optionName:n}:typeof t==`number`?{type:`nodeStream`,value:Jd(t,t,n),optionName:n}:dl(t,{checkOpen:!1})?{type:`nodeStream`,value:t,optionName:n}:e,Jd=(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},Yd=({input:e,inputFile:t},n)=>n===0?[...Xd(e),...Qd(t)]:[],Xd=e=>e===void 0?[]:[{type:Zd(e),value:e,optionName:`input`}],Zd=e=>{if(pl(e,{checkOpen:!1}))return`nodeStream`;if(typeof e==`string`)return`string`;if(B(e))return`uint8Array`;throw Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},Qd=e=>e===void 0?[]:[{...$d(e),optionName:`inputFile`}],$d=e=>{if(Zu(e))return{type:`fileUrl`,value:e};if(td(e))return{type:`filePath`,value:{file:e}};throw Error("The `inputFile` option must be a file path string or a file URL.")},ef=e=>e.filter((t,n)=>e.every((e,r)=>t.value!==e.value||n>=r||t.type===`generator`||t.type===`asyncGenerator`)),tf=({stdioItem:{type:e,value:t,optionName:n},direction:r,fileDescriptors:i,isSync:a})=>{let o=nf(i,e);if(o.length!==0){if(a){rf({otherStdioItems:o,type:e,value:t,optionName:n,direction:r});return}if(md.has(e))return af({otherStdioItems:o,type:e,value:t,optionName:n,direction:r});hd.has(e)&&sf({otherStdioItems:o,type:e,value:t,optionName:n})}},nf=(e,t)=>e.flatMap(({direction:e,stdioItems:n})=>n.filter(e=>e.type===t).map((t=>({...t,direction:e})))),rf=({otherStdioItems:e,type:t,value:n,optionName:r,direction:i})=>{pd.has(t)&&af({otherStdioItems:e,type:t,value:n,optionName:r,direction:i})},af=({otherStdioItems:e,type:t,value:n,optionName:r,direction:i})=>{let a=e.filter(e=>of(e,n));if(a.length!==0)return cf(a.find(e=>e.direction!==i),r,t),i===`output`?a[0].stream:void 0},of=({type:e,value:t},n)=>e===`filePath`?t.file===n.file:e===`fileUrl`?t.href===n.href:t===n,sf=({otherStdioItems:e,type:t,value:n,optionName:r})=>{cf(e.find(({value:{transform:e}})=>e===n.transform),r,t)},cf=(e,t,n)=>{if(e!==void 0)throw TypeError(`The \`${e.optionName}\` and \`${t}\` options must not target ${gd[n]} that is the same.`)},lf=(e,t,n,r)=>{let i=vf({initialFileDescriptors:Ld(t,n,r).map((e,n)=>uf({stdioOption:e,fdNumber:n,options:t,isSync:r})),addProperties:e,options:t,isSync:r});return t.stdio=i.map(({stdioItems:e})=>Sf(e)),i},uf=({stdioOption:e,fdNumber:t,options:n,isSync:r})=>{let i=Qi(t),{stdioItems:a,isStdioArray:o}=df({stdioOption:e,fdNumber:t,options:n,optionName:i}),s=Od(a,t,i),c=xd(a.map(e=>Ud({stdioItem:e,isStdioArray:o,fdNumber:t,direction:s,isSync:r})),i,s,n),l=bd(c,s);return _f(c,l),{direction:s,objectMode:l,stdioItems:c}},df=({stdioOption:e,fdNumber:t,options:n,optionName:r})=>{let i=ef([...(Array.isArray(e)?e:[e]).map(e=>ff(e,r)),...Yd(n,t)]),a=i.length>1;return pf(i,a,r),hf(i),{stdioItems:i,isStdioArray:a}},ff=(e,t)=>({type:zu(e,t),value:e,optionName:t}),pf=(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(mf.has(t))throw Error(`The \`${n}\` option must not include \`${t}\`.`)}},mf=new Set([`ignore`,`ipc`]),hf=e=>{for(let t of e)gf(t)},gf=({type:e,value:t,optionName:n})=>{if(Qu(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(nd(e,t))throw TypeError(`The \`${n}: { file: '...' }\` option must be used instead of \`${n}: '...'\`.`)},_f=(e,t)=>{if(!t)return;let n=e.find(({type:e})=>fd.has(e));if(n!==void 0)throw TypeError(`The \`${n.optionName}\` option cannot use both files and transforms in objectMode.`)},vf=({initialFileDescriptors:e,addProperties:t,options:n,isSync:r})=>{let i=[];try{for(let a of e)i.push(yf({fileDescriptor:a,fileDescriptors:i,addProperties:t,options:n,isSync:r}));return i}catch(e){throw xf(i),e}},yf=({fileDescriptor:{direction:e,objectMode:t,stdioItems:n},fileDescriptors:r,addProperties:i,options:a,isSync:o})=>({direction:e,objectMode:t,stdioItems:n.map(t=>bf({stdioItem:t,addProperties:i,direction:e,options:a,fileDescriptors:r,isSync:o}))}),bf=({stdioItem:e,addProperties:t,direction:n,options:r,fileDescriptors:i,isSync:a})=>{let o=tf({stdioItem:e,direction:n,fileDescriptors:i,isSync:a});return o===void 0?{...e,...t[n][e.type](e,r)}:{...e,stream:o}},xf=e=>{for(let{stdioItems:t}of e)for(let{stream:e}of t)e!==void 0&&!Xi(e)&&e.destroy()},Sf=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`},Cf=(e,t)=>lf(Df,e,t,!0),W=({type:e,optionName:t})=>{Tf(t,gd[e])},wf=({optionName:e,value:t})=>((t===`ipc`||t===`overlapped`)&&Tf(e,`"${t}"`),{}),Tf=(e,t)=>{throw TypeError(`The \`${e}\` option cannot be ${t} with synchronous methods.`)},Ef={generator(){},asyncGenerator:W,webStream:W,nodeStream:W,webTransform:W,duplex:W,asyncIterable:W,native:wf},Df={input:{...Ef,fileUrl:({value:e})=>({contents:[Ai(ie(e))]}),filePath:({value:{file:e}})=>({contents:[Ai(ie(e))]}),fileNumber:W,iterable:({value:e})=>({contents:[...e]}),string:({value:e})=>({contents:[e]}),uint8Array:({value:e})=>({contents:[e]})},output:{...Ef,fileUrl:({value:e})=>({path:e}),filePath:({value:{file:e,append:t}})=>({path:e,append:t}),fileNumber:({value:e})=>({path:e}),iterable:W,string:W,uint8Array:W}},Of=(e,{stripFinalNewline:t},n)=>kf(t,n)&&e!==void 0&&!Array.isArray(e)?il(e):e,kf=(e,t)=>t===`all`?e[1]||e[2]:e[t],Af=(e,t,n,r)=>e||n?void 0:Nf(t,r),jf=(e,t,n)=>n?e.flatMap(e=>Mf(e,t)):Mf(e,t),Mf=(e,t)=>{let{transform:n,final:r}=Nf(t,{});return[...n(e),...r()]},Nf=(e,t)=>(t.previousChunks=``,{transform:Pf.bind(void 0,t,e),final:If.bind(void 0,t)}),Pf=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=Ff(n,a,t,e),s=n.slice(i+1,a+1-o);r.length>0&&(s=zf(r,s),r=``),yield s,i=a}i!==n.length-1&&(r=zf(r,n.slice(i+1))),e.previousChunks=r},Ff=(e,t,n,r)=>n?0:(r.isWindowsNewline=t!==0&&e[t-1]===`\r`,r.isWindowsNewline?2:1),If=function*({previousChunks:e}){e.length>0&&(yield e)},Lf=({binary:e,preserveNewlines:t,readableObjectMode:n,state:r})=>e||t||n?void 0:{transform:Rf.bind(void 0,r)},Rf=function*({isWindowsNewline:e=!1},t){let{unixNewline:n,windowsNewline:r,LF:i,concatBytes:a}=typeof t==`string`?Bf:Vf;if(t.at(-1)===i){yield t;return}yield a(t,e?r:n)},zf=(e,t)=>`${e}${t}`,Bf={windowsNewline:`\r
111
- `,unixNewline:`
112
- `,LF:`
113
- `,concatBytes:zf},Vf={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}},Hf=(e,t)=>e?void 0:Uf.bind(void 0,t),Uf=function*(e,t){if(typeof t!=`string`&&!B(t)&&!ke.isBuffer(t))throw TypeError(`The \`${e}\` option's transform must use "objectMode: true" to receive as input: ${typeof t}.`);yield t},Wf=(e,t)=>e?Gf.bind(void 0,t):Kf.bind(void 0,t),Gf=function*(e,t){qf(e,t),yield t},Kf=function*(e,t){if(qf(e,t),typeof t!=`string`&&!B(t))throw TypeError(`The \`${e}\` option's function must yield a string or an Uint8Array, not ${typeof t}.`);yield t},qf=(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; }`)},Jf=(e,t,n)=>{if(n)return;if(e)return{transform:Yf.bind(void 0,new TextEncoder)};let r=new me(t);return{transform:Xf.bind(void 0,r),final:Zf.bind(void 0,r)}},Yf=function*(e,t){ke.isBuffer(t)?yield Ai(t):typeof t==`string`?yield e.encode(t):yield t},Xf=function*(e,t){yield B(t)?e.write(t):t},Zf=function*(e){let t=e.end();t!==``&&(yield t)},Qf=le(async(e,t,n,r)=>{t.currentIterable=e(...n);try{for await(let e of t.currentIterable)r.push(e)}finally{delete t.currentIterable}}),$f=async function*(e,t,n){if(n===t.length){yield e;return}let{transform:r=rp}=t[n];for await(let i of r(e))yield*$f(i,t,n+1)},ep=async function*(e){for(let[t,{final:n}]of Object.entries(e))yield*tp(n,Number(t),e)},tp=async function*(e,t,n){if(e!==void 0)for await(let r of e())yield*$f(r,n,t+1)},np=le(async({currentIterable:e},t)=>{if(e!==void 0){await(t?e.throw(t):e.return());return}if(t)throw t}),rp=function*(e){yield e},ip=(e,t,n,r)=>{try{for(let r of e(...t))n.push(r);r()}catch(e){r(e)}},ap=(e,t)=>[...t.flatMap(t=>[...op(t,e,0)]),...sp(e)],op=function*(e,t,n){if(n===t.length){yield e;return}let{transform:r=lp}=t[n];for(let i of r(e))yield*op(i,t,n+1)},sp=function*(e){for(let[t,{final:n}]of Object.entries(e))yield*cp(n,Number(t),e)},cp=function*(e,t,n){if(e!==void 0)for(let r of e())yield*op(r,n,t+1)},lp=function*(e){yield e},up=({value:e,value:{transform:t,final:n,writableObjectMode:r,readableObjectMode:i},optionName:a},{encoding:o})=>{let s={},c=fp(e,o,a),l=Ju(t),u=Ju(n),d=l?Qf.bind(void 0,$f,s):ip.bind(void 0,op),f=l||u?Qf.bind(void 0,ep,s):ip.bind(void 0,sp),p=l||u?np.bind(void 0,s):void 0;return{stream:new Ee({writableObjectMode:r,writableHighWaterMark:Oe(r),readableObjectMode:i,readableHighWaterMark:Oe(i),transform(e,t,n){d([e,c,0],this,n)},flush(e){f([c],this,e)},destroy:p})}},dp=(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)e=ap(fp(t,n,r),e);return e},fp=({transform:e,final:t,binary:n,writableObjectMode:r,readableObjectMode:i,preserveNewlines:a},o,s)=>{let c={};return[{transform:Hf(r,s)},Jf(n,o,r),Af(n,a,r,c),{transform:e,final:t},{transform:Wf(i,s)},Lf({binary:n,preserveNewlines:a,readableObjectMode:i,state:c})].filter(Boolean)},pp=(e,t)=>{for(let n of mp(e))hp(e,n,t)},mp=e=>new Set(Object.entries(e).filter(([,{direction:e}])=>e===`input`).map(([e])=>Number(e))),hp=(e,t,n)=>{let{stdioItems:r}=e[t],i=r.filter(({contents:e})=>e!==void 0);if(i.length!==0){if(t!==0){let[{type:e,optionName:t}]=i;throw TypeError(`Only the \`stdin\` option, not \`${t}\`, can be ${gd[e]} with synchronous methods.`)}n.input=Li(i.map(({contents:e})=>e).map(e=>gp(e,r)))}},gp=(e,t)=>{let n=dp(e,t,`utf8`,!0);return _p(n),Li(n)},_p=e=>{let t=e.find(e=>typeof e!=`string`&&!B(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}.`)},vp=({stdioItems:e,encoding:t,verboseInfo:n,fdNumber:r})=>r!==`all`&&ma(n,r)&&!Kc.has(t)&&yp(r)&&(e.some(({type:e,value:t})=>e===`native`&&bp.has(t))||e.every(({type:e})=>dd.has(e))),yp=e=>e===1||e===2,bp=new Set([`pipe`,`overlapped`]),xp=async(e,t,n,r)=>{for await(let i of e)Cp(t)||wp(i,n,r)},Sp=(e,t,n)=>{for(let r of e)wp(r,t,n)},Cp=e=>e._readableState.pipes.length>0,wp=(e,t,n)=>{Ga({type:`output`,verboseMessage:Ya(e),fdNumber:t,verboseInfo:n})},Tp=({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)=>Ep({result:t,fileDescriptors:e,fdNumber:s,state:a,outputFiles:o,isMaxBuffer:r,verboseInfo:i},n)),...a}},Ep=({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=Ai(fu(e,a,d)),{stdioItems:p,objectMode:m}=t[n],{serializedResult:h,finalResult:g=h}=Op({chunks:Dp([f],p,c,r),objectMode:m,encoding:c,lines:l,stripFinalNewline:u,fdNumber:n});kp({serializedResult:h,fdNumber:n,state:r,verboseInfo:o,encoding:c,stdioItems:p,objectMode:m});let _=s[n]?g:void 0;try{return r.error===void 0&&Ap(h,p,i),_}catch(e){return r.error=e,_}},Dp=(e,t,n,r)=>{try{return dp(e,t,n,!1)}catch(t){return r.error=t,e}},Op=({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:jf(o,!i[a],t)}:{serializedResult:o}},kp=({serializedResult:e,fdNumber:t,state:n,verboseInfo:r,encoding:i,stdioItems:a,objectMode:o})=>{if(!vp({stdioItems:a,encoding:i,verboseInfo:r,fdNumber:t}))return;let s=jf(e,!1,o);try{Sp(s,t,r)}catch(e){n.error??=e}},Ap=(e,t,n)=>{for(let{path:r,append:i}of t.filter(({type:e})=>fd.has(e))){let t=typeof r==`string`?r:r.toString();i||n.has(t)?te(r,e):(n.add(t),se(r,e))}},jp=([,e,t],n)=>{if(n.all)return e===void 0?t:t===void 0?e:Array.isArray(e)?Array.isArray(t)?[...e,...t]:[...e,Of(t,n,`all`)]:Array.isArray(t)?[Of(e,n,`all`),...t]:B(e)&&B(t)?zi([e,t]):`${e}${t}`},Mp=async(e,t)=>{let[n,r]=await Np(e);return t.isForcefullyTerminated??=!1,[n,r]},Np=async e=>{let[t,n]=await Promise.allSettled([w(e,`spawn`),w(e,`exit`)]);return t.status===`rejected`?[]:n.status===`rejected`?Pp(e):n.value},Pp=async e=>{try{return await w(e,`exit`)}catch{return Pp(e)}},Fp=async e=>{let[t,n]=await e;if(!Ip(t,n)&&Lp(t,n))throw new Do;return[t,n]},Ip=(e,t)=>e===void 0&&t===void 0,Lp=(e,t)=>e!==0||t!==null,Rp=({error:e,status:t,signal:n,output:r},{maxBuffer:i})=>{let a=zp(e,t,n);return{resultError:a,exitCode:t,signal:n,timedOut:a?.code===`ETIMEDOUT`,isMaxBuffer:du(a,r,i)}},zp=(e,t,n)=>e===void 0?Lp(t,n)?new Do:void 0:e,Bp=(e,t,n)=>{let{file:r,commandArguments:i,command:a,escapedCommand:o,startTime:s,verboseInfo:c,options:l,fileDescriptors:u}=Vp(e,t,n);return Ru(Gp({file:r,commandArguments:i,options:l,command:a,escapedCommand:o,verboseInfo:c,fileDescriptors:u,startTime:s}),c,l)},Vp=(e,t,n)=>{let{command:r,escapedCommand:i,startTime:a,verboseInfo:o}=io(e,t,n),{file:s,commandArguments:c,options:l}=el(e,t,Hp(n));return Up(l),{file:s,commandArguments:c,command:r,escapedCommand:i,startTime:a,verboseInfo:o,options:l,fileDescriptors:Cf(l,o)}},Hp=e=>e.node&&!e.ipc?{...e,ipc:!1}:e,Up=({ipc:e,ipcInput:t,detached:n,cancelSignal:r})=>{t&&Wp(`ipcInput`),e&&Wp(`ipc: true`),n&&Wp(`detached: true`),r&&Wp(`cancelSignal`)},Wp=e=>{throw TypeError(`The "${e}" option cannot be used with synchronous methods.`)},Gp=({file:e,commandArguments:t,options:n,command:r,escapedCommand:i,verboseInfo:a,fileDescriptors:o,startTime:s})=>{let c=Kp({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}=Rp(c,n),{output:m,error:h=l}=Tp({fileDescriptors:o,syncResult:c,options:n,isMaxBuffer:p,verboseInfo:a});return Jp({error:h,exitCode:u,signal:d,timedOut:f,isMaxBuffer:p,stdio:m.map((e,t)=>Of(e,n,t)),all:Of(jp(m,n),n,`all`),options:n,command:r,escapedCommand:i,startTime:s})},Kp=({file:e,commandArguments:t,options:n,command:r,escapedCommand:i,fileDescriptors:a,startTime:o})=>{try{return pp(a,n),ee(...rl(e,t,qp(n)))}catch(e){return Su({error:e,command:r,escapedCommand:i,fileDescriptors:a,options:n,startTime:o,isSync:!0})}},qp=({encoding:e,maxBuffer:t,...n})=>({...n,encoding:`buffer`,maxBuffer:pu(t)}),Jp=({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?xu({command:c,escapedCommand:l,stdio:a,all:o,ipcOutput:[],options:s,startTime:u}):Cu({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}),Yp=({anyProcess:e,channel:t,isSubprocess:n,ipc:r},{reference:i=!0,filter:a}={})=>(ms({methodName:`getOneMessage`,isSubprocess:n,ipc:r,isConnected:nc(e)}),Xp({anyProcess:e,channel:t,isSubprocess:n,filter:a,reference:i})),Xp=async({anyProcess:e,channel:t,isSubprocess:n,filter:r,reference:i})=>{Ws(t,i);let a=$s(e,t,n),o=new AbortController;try{return await Promise.race([Zp(a,r,o),Qp(a,n,o),$p(a,n,o)])}catch(t){throw As(e),t}finally{o.abort(),Ks(t,i)}},Zp=async(e,t,{signal:n})=>{if(t===void 0){let[t]=await w(e,`message`,{signal:n});return t}for await(let[r]of be(e,`message`,{signal:n}))if(t(r))return r},Qp=async(e,t,{signal:n})=>{await w(e,`disconnect`,{signal:n}),_s(t)},$p=async(e,t,{signal:n})=>{let[r]=await w(e,`strict:error`,{signal:n});throw ys(r,t)},em=({anyProcess:e,channel:t,isSubprocess:n,ipc:r},{reference:i=!0}={})=>tm({anyProcess:e,channel:t,isSubprocess:n,ipc:r,shouldAwait:!n,reference:i}),tm=({anyProcess:e,channel:t,isSubprocess:n,ipc:r,shouldAwait:i,reference:a})=>{ms({methodName:`getEachMessage`,isSubprocess:n,ipc:r,isConnected:nc(e)}),Ws(t,a);let o=$s(e,t,n),s=new AbortController,c={};return nm(e,o,s),rm({ipcEmitter:o,isSubprocess:n,controller:s,state:c}),im({anyProcess:e,channel:t,ipcEmitter:o,isSubprocess:n,shouldAwait:i,controller:s,state:c,reference:a})},nm=async(e,t,n)=>{try{await w(t,`disconnect`,{signal:n.signal}),n.abort()}catch{}},rm=async({ipcEmitter:e,isSubprocess:t,controller:n,state:r})=>{try{let[i]=await w(e,`strict:error`,{signal:n.signal});r.error=ys(i,t),n.abort()}catch{}},im=async function*({anyProcess:e,channel:t,ipcEmitter:n,isSubprocess:r,shouldAwait:i,controller:a,state:o,reference:s}){try{for await(let[e]of be(n,`message`,{signal:a.signal}))am(o),yield e}catch{am(o)}finally{a.abort(),Ks(t,s),r||As(e),i&&await e}},am=({error:e})=>{if(e)throw e},om=(e,{ipc:t})=>{Object.assign(e,cm(e,!1,t))},sm=()=>{let e=u,t=u.channel!==void 0;return{...cm(e,!0,t),getCancelSignal:Tc.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:!0,ipc:t})}},cm=(e,t,n)=>({sendMessage:yc.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n}),getOneMessage:Yp.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n}),getEachMessage:em.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n})}),lm=({error:e,command:t,escapedCommand:n,fileDescriptors:r,options:i,startTime:a,verboseInfo:o})=>{xf(r);let s=new b;return um(s,r),Object.assign(s,{readable:fm,writable:pm,duplex:mm}),{subprocess:s,promise:hm(Su({error:e,command:t,escapedCommand:n,fileDescriptors:r,options:i,startTime:a,isSync:!1}),o,i)}},um=(e,t)=>{let n=dm(),r=dm(),i=dm(),a=Array.from({length:t.length-3},dm),o=dm(),s=[n,r,i,...a];Object.assign(e,{stdin:n,stdout:r,stderr:i,all:o,stdio:s})},dm=()=>{let e=new we;return e.end(),e},fm=()=>new Te({read(){}}),pm=()=>new De({write(){}}),mm=()=>new Ce({read(){},write(){}}),hm=async(e,t,n)=>Ru(e,t,n),gm=(e,t)=>lf(ym,e,t,!1),_m=({type:e,optionName:t})=>{throw TypeError(`The \`${t}\` option cannot be ${gd[e]}.`)},vm={fileNumber:_m,generator:up,asyncGenerator:up,nodeStream:({value:e})=>({stream:e}),webTransform({value:{transform:e,writableObjectMode:t,readableObjectMode:n}}){let r=t||n;return{stream:Ce.fromWeb(e,{objectMode:r})}},duplex:({value:{transform:e}})=>({stream:e}),native(){}},ym={input:{...vm,fileUrl:({value:e})=>({stream:ne(e)}),filePath:({value:{file:e}})=>({stream:ne(e)}),webStream:({value:e})=>({stream:Te.fromWeb(e)}),iterable:({value:e})=>({stream:Te.from(e)}),asyncIterable:({value:e})=>({stream:Te.from(e)}),string:({value:e})=>({stream:Te.from(e)}),uint8Array:({value:e})=>({stream:Te.from(ke.from(e))})},output:{...vm,fileUrl:({value:e})=>({stream:re(e)}),filePath:({value:{file:e,append:t}})=>({stream:re(e,t?{flags:`a`}:{})}),webStream:({value:e})=>({stream:De.fromWeb(e)}),iterable:_m,asyncIterable:_m,string:_m,uint8Array:_m}};function bm(e){if(!Array.isArray(e))throw TypeError(`Expected an array, got \`${typeof e}\`.`);for(let t of e)Em(t);let t=e.some(({readableObjectMode:e})=>e),n=xm(e,t),r=new Sm({objectMode:t,writableHighWaterMark:n,readableHighWaterMark:n});for(let t of e)r.add(t);return r}const xm=(e,t)=>{if(e.length===0)return Oe(t);let n=e.filter(({readableObjectMode:e})=>e===t).map(({readableHighWaterMark:e})=>e);return Math.max(...n)};var Sm=class extends we{#e=new Set([]);#t=new Set([]);#n=new Set([]);#r;#i=Symbol(`unpipe`);#a=new WeakMap;add(e){if(Em(e),this.#e.has(e))return;this.#e.add(e),this.#r??=Cm(this,this.#e,this.#i);let t=Dm({passThroughStream:this,stream:e,streams:this.#e,ended:this.#t,aborted:this.#n,onFinished:this.#r,unpipeEvent:this.#i});this.#a.set(e,t),e.pipe(this,{end:!1})}async remove(e){if(Em(e),!this.#e.has(e))return!1;let t=this.#a.get(e);return t===void 0?!1:(this.#a.delete(e),e.unpipe(this),await t,!0)}};const Cm=async(e,t,n)=>{Lm(e,Rm);let r=new AbortController;try{await Promise.race([wm(e,r),Tm(e,t,n,r)])}finally{r.abort(),Lm(e,-Rm)}},wm=async(e,{signal:t})=>{try{await T(e,{signal:t,cleanup:!0})}catch(t){throw Mm(e,t),t}},Tm=async(e,t,n,{signal:r})=>{for await(let[i]of be(e,`unpipe`,{signal:r}))t.has(i)&&i.emit(n)},Em=e=>{if(typeof e?.pipe!=`function`)throw TypeError(`Expected a readable stream, got: \`${typeof e}\`.`)},Dm=async({passThroughStream:e,stream:t,streams:n,ended:r,aborted:i,onFinished:a,unpipeEvent:o})=>{Lm(e,zm);let s=new AbortController;try{await Promise.race([Om(a,t,s),km({passThroughStream:e,stream:t,streams:n,ended:r,aborted:i,controller:s}),Am({stream:t,streams:n,ended:r,aborted:i,unpipeEvent:o,controller:s})])}finally{s.abort(),Lm(e,-zm)}n.size>0&&n.size===r.size+i.size&&(r.size===0&&i.size>0?Pm(e):jm(e))},Om=async(e,t,{signal:n})=>{try{await e,n.aborted||Pm(t)}catch(e){n.aborted||Mm(t,e)}},km=async({passThroughStream:e,stream:t,streams:n,ended:r,aborted:i,controller:{signal:a}})=>{try{await T(t,{signal:a,cleanup:!0,readable:!0,writable:!1}),n.has(t)&&r.add(t)}catch(r){if(a.aborted||!n.has(t))return;Nm(r)?i.add(t):Fm(e,r)}},Am=async({stream:e,streams:t,ended:n,aborted:r,unpipeEvent:i,controller:{signal:a}})=>{if(await w(e,i,{signal:a}),!e.readable)return w(a,`abort`,{signal:a});t.delete(e),n.delete(e),r.delete(e)},jm=e=>{e.writable&&e.end()},Mm=(e,t)=>{Nm(t)?Pm(e):Fm(e,t)},Nm=e=>e?.code===`ERR_STREAM_PREMATURE_CLOSE`,Pm=e=>{(e.readable||e.writable)&&e.destroy()},Fm=(e,t)=>{e.destroyed||(e.once(`error`,Im),e.destroy(t))},Im=()=>{},Lm=(e,t)=>{let n=e.getMaxListeners();n!==0&&n!==1/0&&e.setMaxListeners(n+t)},Rm=2,zm=1,Bm=(e,t)=>{e.pipe(t),Vm(e,t),Um(e,t)},Vm=async(e,t)=>{if(!(Xi(e)||Xi(t))){try{await T(e,{cleanup:!0,readable:!0,writable:!1})}catch{}Hm(t)}},Hm=e=>{e.writable&&e.end()},Um=async(e,t)=>{if(!(Xi(e)||Xi(t))){try{await T(t,{cleanup:!0,readable:!1,writable:!0})}catch{}Wm(e)}},Wm=e=>{e.readable&&e.destroy()},Gm=(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})=>dd.has(e)))Km(e,t,o,i);for(let{stream:t}of a.filter(({type:e})=>!dd.has(e)))Jm({subprocess:e,stream:t,direction:o,fdNumber:i,pipeGroups:r,controller:n})}for(let[e,t]of r.entries())Bm(t.length===1?t[0]:bm(t),e)},Km=(e,t,n,r)=>{n===`output`?Bm(e.stdio[r],t):Bm(t,e.stdio[r]);let i=qm[r];i!==void 0&&(e[i]=t),e.stdio[r]=t},qm=[`stdin`,`stdout`,`stderr`],Jm=({subprocess:e,stream:t,direction:n,fdNumber:r,pipeGroups:i,controller:a})=>{if(t===void 0)return;Ym(t,a);let[o,s]=n===`output`?[t,e.stdio[r]]:[e.stdio[r],t],c=i.get(o)??[];i.set(o,[...c,s])},Ym=(e,{signal:t})=>{Xi(e)&&Us(e,Xm,t)},Xm=2,Zm=(e,{cleanup:t,detached:n},{signal:r})=>{if(!t||n)return;let i=En(()=>{e.kill()});ye(r,()=>{i()})},Qm=({source:e,sourcePromise:t,boundOptions:n,createNested:r},...i)=>{let a=no(),{destination:o,destinationStream:s,destinationError:c,from:l,unpipeSignal:u}=$m(n,r,i),{sourceStream:d,sourceError:f}=nh(e,l),{options:p,fileDescriptors:m}=Ps.get(e);return{sourcePromise:t,sourceStream:d,sourceOptions:p,sourceError:f,destination:o,destinationStream:s,destinationError:c,unpipeSignal:u,fileDescriptors:m,startTime:a}},$m=(e,t,n)=>{try{let{destination:r,pipeOptions:{from:i,to:a,unpipeSignal:o}={}}=eh(e,t,...n);return{destination:r,destinationStream:Ms(r,a),from:i,unpipeSignal:o}}catch(e){return{destinationError:e}}},eh=(e,t,n,...r)=>{if(Array.isArray(n))return{destination:t(th,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(th)(i,a,o),pipeOptions:o}}if(Ps.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}`)},th=({options:e})=>({options:{...e,stdin:`pipe`,piped:!0}}),nh=(e,t)=>{try{return{sourceStream:Ns(e,t)}}catch(e){return{sourceError:e}}},rh=({sourceStream:e,sourceError:t,destinationStream:n,destinationError:r,fileDescriptors:i,sourceOptions:a,startTime:o})=>{let s=ih({sourceStream:e,sourceError:t,destinationStream:n,destinationError:r});if(s!==void 0)throw ah({error:s,fileDescriptors:i,sourceOptions:a,startTime:o})},ih=({sourceStream:e,sourceError:t,destinationStream:n,destinationError:r})=>{if(t!==void 0&&r!==void 0)return r;if(r!==void 0)return Wm(e),r;if(t!==void 0)return Hm(n),t},ah=({error:e,fileDescriptors:t,sourceOptions:n,startTime:r})=>Su({error:e,command:oh,escapedCommand:oh,fileDescriptors:t,options:n,startTime:r,isSync:!1}),oh=`source.pipe(destination)`,sh=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},ch=(e,t,n)=>{let r=fh.has(t)?uh(e,t):lh(e,t);return Us(e,ph,n.signal),Us(t,mh,n.signal),dh(t),r},lh=(e,t)=>{let n=bm([e]);return Bm(n,t),fh.set(t,n),n},uh=(e,t)=>{let n=fh.get(t);return n.add(e),n},dh=async e=>{try{await T(e,{cleanup:!0,readable:!1,writable:!0})}catch{}fh.delete(e)},fh=new WeakMap,ph=2,mh=1,hh=(e,t)=>e===void 0?[]:[gh(e,t)],gh=async(e,{sourceStream:t,mergedStream:n,fileDescriptors:r,sourceOptions:i,startTime:a})=>{throw await ce(e,t),await n.remove(t),ah({error:Error("Pipe canceled by `unpipeSignal` option."),fileDescriptors:r,sourceOptions:i,startTime:a})},_h=(e,...t)=>{if(z(t[0]))return _h.bind(void 0,{...e,boundOptions:{...e.boundOptions,...t[0]}});let{destination:n,...r}=Qm(e,...t),i=vh({...r,destination:n});return i.pipe=_h.bind(void 0,{...e,source:n,sourcePromise:i,boundOptions:{}}),i},vh=async({sourcePromise:e,sourceStream:t,sourceOptions:n,sourceError:r,destination:i,destinationStream:a,destinationError:o,unpipeSignal:s,fileDescriptors:c,startTime:l})=>{let u=yh(e,i);rh({sourceStream:t,sourceError:r,destinationStream:a,destinationError:o,fileDescriptors:c,sourceOptions:n,startTime:l});let d=new AbortController;try{let e=ch(t,a,d);return await Promise.race([sh(u),...hh(s,{sourceStream:t,mergedStream:e,sourceOptions:n,fileDescriptors:c,startTime:l})])}finally{d.abort()}},yh=(e,t)=>Promise.allSettled([e,t]),bh=({subprocessStdout:e,subprocess:t,binary:n,shouldEncode:r,encoding:i,preserveNewlines:a})=>{let o=new AbortController;return xh(t,o),wh({stream:e,controller:o,binary:n,shouldEncode:!e.readableObjectMode&&r,encoding:i,shouldSplit:!e.readableObjectMode,preserveNewlines:a})},xh=async(e,t)=>{try{await e}catch{}finally{t.abort()}},Sh=({stream:e,onStreamEnd:t,lines:n,encoding:r,stripFinalNewline:i,allMixed:a})=>{let o=new AbortController;Ch(t,o,e);let s=e.readableObjectMode&&!a;return wh({stream:e,controller:o,binary:r===`buffer`,shouldEncode:!s,encoding:r,shouldSplit:!s&&n,preserveNewlines:!i})},Ch=async(e,t,n)=>{try{await e}catch{n.destroy()}finally{t.abort()}},wh=({stream:e,controller:t,binary:n,shouldEncode:r,encoding:i,shouldSplit:a,preserveNewlines:o})=>Dh({onStdoutChunk:be(e,`data`,{signal:t.signal,highWaterMark:Eh,highWatermark:Eh}),controller:t,binary:n,shouldEncode:r,encoding:i,shouldSplit:a,preserveNewlines:o}),Th=Oe(!0),Eh=Th,Dh=async function*({onStdoutChunk:e,controller:t,binary:n,shouldEncode:r,encoding:i,shouldSplit:a,preserveNewlines:o}){let s=Oh({binary:n,shouldEncode:r,encoding:i,shouldSplit:a,preserveNewlines:o});try{for await(let[t]of e)yield*op(t,s,0)}catch(e){if(!t.signal.aborted)throw e}finally{yield*sp(s)}},Oh=({binary:e,shouldEncode:t,encoding:n,shouldSplit:r,preserveNewlines:i})=>[Jf(e,n,!t),Af(e,i,!r,{})].filter(Boolean),kh=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=Ah({stream:e,onStreamEnd:t,fdNumber:n,encoding:r,allMixed:s,verboseInfo:l,streamInfo:u});if(!i){await Promise.all([jh(e),d]);return}let f=Sh({stream:e,onStreamEnd:t,lines:o,encoding:r,stripFinalNewline:kf(c,n),allMixed:s}),[p]=await Promise.all([Mh({stream:e,iterable:f,fdNumber:n,encoding:r,maxBuffer:a,lines:o}),d]);return p},Ah=async({stream:e,onStreamEnd:t,fdNumber:n,encoding:r,allMixed:i,verboseInfo:a,streamInfo:{fileDescriptors:o}})=>{vp({stdioItems:o[n]?.stdioItems,encoding:r,verboseInfo:a,fdNumber:n})&&await xp(Sh({stream:e,onStreamEnd:t,lines:!0,encoding:r,stripFinalNewline:!0,allMixed:i}),e,n,a)},jh=async e=>{await ge(),e.readableFlowing===null&&e.resume()},Mh=async({stream:e,stream:{readableObjectMode:t},iterable:n,fdNumber:r,encoding:i,maxBuffer:a,lines:o})=>{try{return t||o?await zl(n,{maxBuffer:a}):i===`buffer`?new Uint8Array(await Vl(n,{maxBuffer:a})):await nu(n,{maxBuffer:a})}catch(n){return Ph(ou({error:n,stream:e,readableObjectMode:t,lines:o,encoding:i,fdNumber:r}))}},Nh=async e=>{try{return await e}catch(e){return Ph(e)}},Ph=({bufferedData:e})=>ki(e)?new Uint8Array(e):e,Fh=async(e,t,n,{isSameDirection:r,stopOnExit:i=!1}={})=>{let a=Ih(e,n),o=new AbortController;try{await Promise.race([...i?[n.exitPromise]:[],T(e,{cleanup:!0,signal:o.signal})])}catch(e){a.stdinCleanedUp||zh(e,t,n,r)}finally{o.abort()}},Ih=(e,{originalStreams:[t],subprocess:n})=>{let r={stdinCleanedUp:!1};return e===t&&Lh(e,n,r),r},Lh=(e,t,n)=>{let{_destroy:r}=e;e._destroy=(...i)=>{Rh(t,n),r.call(e,...i)}},Rh=({exitCode:e,signalCode:t},n)=>{(e!==null||t!==null)&&(n.stdinCleanedUp=!0)},zh=(e,t,n,r)=>{if(!Bh(e,t,n,r))throw e},Bh=(e,t,n,r=!0)=>n.propagating?Uh(e)||Hh(e):(n.propagating=!0,Vh(n,t)===r?Uh(e):Hh(e)),Vh=({fileDescriptors:e},t)=>t!==`all`&&e[t].direction===`input`,Hh=e=>e?.code===`ERR_STREAM_PREMATURE_CLOSE`,Uh=e=>e?.code===`EPIPE`,Wh=({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:a,verboseInfo:o,streamInfo:s})=>e.stdio.map((e,c)=>Gh({stream:e,fdNumber:c,encoding:t,buffer:n[c],maxBuffer:r[c],lines:i[c],allMixed:!1,stripFinalNewline:a,verboseInfo:o,streamInfo:s})),Gh=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=Fh(e,t,l);if(Vh(l,t)){await u;return}let[d]=await Promise.all([kh({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},Kh=({stdout:e,stderr:t},{all:n})=>n&&(e||t)?bm([e,t].filter(Boolean)):void 0,qh=({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:a,verboseInfo:o,streamInfo:s})=>Gh({...Jh(e,n),fdNumber:`all`,encoding:t,maxBuffer:r[1]+r[2],lines:i[1]||i[2],allMixed:Yh(e),stripFinalNewline:a,verboseInfo:o,streamInfo:s}),Jh=({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}},Yh=({all:e,stdout:t,stderr:n})=>e&&t&&n&&t.readableObjectMode!==n.readableObjectMode,Xh=e=>ma(e,`ipc`),Zh=(e,t)=>{Ga({type:`ipc`,verboseMessage:Ya(e),fdNumber:`ipc`,verboseInfo:t})},Qh=async({subprocess:e,buffer:t,maxBuffer:n,ipc:r,ipcOutput:i,verboseInfo:a})=>{if(!r)return i;let o=Xh(a),s=fa(t,`ipc`),c=fa(n,`ipc`);for await(let t of tm({anyProcess:e,channel:e.channel,isSubprocess:!1,ipc:r,shouldAwait:!1,reference:!0}))s&&(cu(e,i,c),i.push(t)),o&&Zh(t,a);return i},$h=async(e,t)=>(await Promise.allSettled([e]),t),eg=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=Mp(e,f),y={originalStreams:h,fileDescriptors:m,subprocess:e,exitPromise:v,propagating:!1},b=Wh({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:y}),x=qh({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:y}),S=[],C=Qh({subprocess:e,buffer:n,maxBuffer:r,ipc:u,ipcOutput:S,verboseInfo:p}),ee=tg(h,e,y),te=ng(m,y);try{return await Promise.race([Promise.all([{},Fp(v),Promise.all(b),x,C,Uc(e,d),...ee,...te]),g,rg(e,_),...Lc(e,a,f,_),...fs({subprocess:e,cancelSignal:o,gracefulCancel:s,context:f,controller:_}),...Nc({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=>Nh(e))),Nh(x),$h(C,S),Promise.allSettled(ee),Promise.allSettled(te)])}},tg=(e,t,n)=>e.map((e,r)=>e===t.stdio[r]?void 0:Fh(e,r,n)),ng=(e,t)=>e.flatMap(({stdioItems:e},n)=>e.filter(({value:e,stream:t=e})=>dl(t,{checkOpen:!1})&&!Xi(t)).map(({type:e,value:r,stream:i=r})=>Fh(i,n,t,{isSameDirection:dd.has(e),stopOnExit:e===`native`}))),rg=async(e,{signal:t})=>{let[n]=await w(e,`error`,{signal:t});throw n},ig=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),ag=(e,t,n)=>{let r=e[n];r.has(t)||r.set(t,[]);let i=r.get(t),a=js();return i.push(a),{resolve:a.resolve.bind(a),promises:i}},og=async({resolve:e,promises:t},n)=>{e();let[r]=await Promise.race([Promise.allSettled([!0,n]),Promise.all([!1,...t])]);return!r},sg=async e=>{if(e!==void 0)try{await lg(e)}catch{}},cg=async e=>{if(e!==void 0)try{await ug(e)}catch{}},lg=async e=>{await T(e,{cleanup:!0,readable:!1,writable:!0})},ug=async e=>{await T(e,{cleanup:!0,readable:!0,writable:!1})},dg=async(e,t)=>{if(await e,t)throw t},fg=(e,t,n)=>{n&&!Hh(n)?e.destroy(n):t&&e.destroy()},pg=({subprocess:e,concurrentStreams:t,encoding:n},{from:r,binary:i=!0,preserveNewlines:a=!0}={})=>{let o=i||Kc.has(n),{subprocessStdout:s,waitReadableDestroy:c}=mg(e,r,t),{readableEncoding:l,readableObjectMode:u,readableHighWaterMark:d}=hg(s,o),{read:f,onStdoutDataDone:p}=gg({subprocessStdout:s,subprocess:e,binary:o,encoding:n,preserveNewlines:a}),m=new Te({read:f,destroy:le(yg.bind(void 0,{subprocessStdout:s,subprocess:e,waitReadableDestroy:c})),highWaterMark:d,objectMode:u,encoding:l});return vg({subprocessStdout:s,onStdoutDataDone:p,readable:m,subprocess:e}),m},mg=(e,t,n)=>{let r=Ns(e,t);return{subprocessStdout:r,waitReadableDestroy:ag(n,r,`readableDestroy`)}},hg=({readableEncoding:e,readableObjectMode:t,readableHighWaterMark:n},r)=>r?{readableEncoding:e,readableObjectMode:t,readableHighWaterMark:n}:{readableEncoding:e,readableObjectMode:!0,readableHighWaterMark:Th},gg=({subprocessStdout:e,subprocess:t,binary:n,encoding:r,preserveNewlines:i})=>{let a=js(),o=bh({subprocessStdout:e,subprocess:t,binary:n,shouldEncode:!n,encoding:r,preserveNewlines:i});return{read(){_g(this,o,a)},onStdoutDataDone:a}},_g=async(e,t,n)=>{try{let{value:r,done:i}=await t.next();i?n.resolve():e.push(r)}catch{}},vg=async({subprocessStdout:e,onStdoutDataDone:t,readable:n,subprocess:r,subprocessStdin:i})=>{try{await ug(e),await r,await sg(i),await t,n.readable&&n.push(null)}catch(e){await sg(i),bg(n,e)}},yg=async({subprocessStdout:e,subprocess:t,waitReadableDestroy:n},r)=>{await og(n,t)&&(bg(e,r),await dg(t,r))},bg=(e,t)=>{fg(e,e.readable,t)},xg=({subprocess:e,concurrentStreams:t},{to:n}={})=>{let{subprocessStdin:r,waitWritableFinal:i,waitWritableDestroy:a}=Sg(e,n,t),o=new De({...Cg(r,e,i),destroy:le(Dg.bind(void 0,{subprocessStdin:r,subprocess:e,waitWritableFinal:i,waitWritableDestroy:a})),highWaterMark:r.writableHighWaterMark,objectMode:r.writableObjectMode});return Eg(r,o),o},Sg=(e,t,n)=>{let r=Ms(e,t);return{subprocessStdin:r,waitWritableFinal:ag(n,r,`writableFinal`),waitWritableDestroy:ag(n,r,`writableDestroy`)}},Cg=(e,t,n)=>({write:wg.bind(void 0,e),final:le(Tg.bind(void 0,e,t,n))}),wg=(e,t,n,r)=>{e.write(t,n)?r():e.once(`drain`,r)},Tg=async(e,t,n)=>{await og(n,t)&&(e.writable&&e.end(),await t)},Eg=async(e,t,n)=>{try{await lg(e),t.writable&&t.end()}catch(e){await cg(n),Og(t,e)}},Dg=async({subprocessStdin:e,subprocess:t,waitWritableFinal:n,waitWritableDestroy:r},i)=>{await og(n,t),await og(r,t)&&(Og(e,i),await dg(t,i))},Og=(e,t)=>{fg(e,e.writable,t)},kg=({subprocess:e,concurrentStreams:t,encoding:n},{from:r,to:i,binary:a=!0,preserveNewlines:o=!0}={})=>{let s=a||Kc.has(n),{subprocessStdout:c,waitReadableDestroy:l}=mg(e,r,t),{subprocessStdin:u,waitWritableFinal:d,waitWritableDestroy:f}=Sg(e,i,t),{readableEncoding:p,readableObjectMode:m,readableHighWaterMark:h}=hg(c,s),{read:g,onStdoutDataDone:_}=gg({subprocessStdout:c,subprocess:e,binary:s,encoding:n,preserveNewlines:o}),v=new Ce({read:g,...Cg(u,e,d),destroy:le(Ag.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 vg({subprocessStdout:c,onStdoutDataDone:_,readable:v,subprocess:e,subprocessStdin:u}),Eg(u,v,c),v},Ag=async({subprocessStdout:e,subprocessStdin:t,subprocess:n,waitReadableDestroy:r,waitWritableFinal:i,waitWritableDestroy:a},o)=>{await Promise.all([yg({subprocessStdout:e,subprocess:n,waitReadableDestroy:r},o),Dg({subprocessStdin:t,subprocess:n,waitWritableFinal:i,waitWritableDestroy:a},o)])},jg=(e,t,{from:n,binary:r=!1,preserveNewlines:i=!1}={})=>{let a=r||Kc.has(t),o=Ns(e,n);return Mg(bh({subprocessStdout:o,subprocess:e,binary:a,shouldEncode:!0,encoding:t,preserveNewlines:i}),o,e)},Mg=async function*(e,t,n){try{yield*e}finally{t.readable&&t.destroy(),await n}},Ng=(e,{encoding:t})=>{let n=ig();e.readable=pg.bind(void 0,{subprocess:e,concurrentStreams:n,encoding:t}),e.writable=xg.bind(void 0,{subprocess:e,concurrentStreams:n}),e.duplex=kg.bind(void 0,{subprocess:e,concurrentStreams:n,encoding:t}),e.iterable=jg.bind(void 0,e,t),e[Symbol.asyncIterator]=jg.bind(void 0,e,t,{})},Pg=(e,t)=>{for(let[n,r]of Ig){let i=r.value.bind(t);Reflect.defineProperty(e,n,{...r,value:i})}},Fg=(async()=>{})().constructor.prototype,Ig=[`then`,`catch`,`finally`].map(e=>[e,Reflect.getOwnPropertyDescriptor(Fg,e)]),Lg=(e,t,n,r)=>{let{file:i,commandArguments:a,command:o,escapedCommand:s,startTime:c,verboseInfo:l,options:u,fileDescriptors:d}=Rg(e,t,n),{subprocess:f,promise:p}=Bg({file:i,commandArguments:a,options:u,startTime:c,verboseInfo:l,command:o,escapedCommand:s,fileDescriptors:d});return f.pipe=_h.bind(void 0,{source:f,sourcePromise:p,boundOptions:{},createNested:r}),Pg(f,p),Ps.set(f,{options:u,fileDescriptors:d}),f},Rg=(e,t,n)=>{let{command:r,escapedCommand:i,startTime:a,verboseInfo:o}=io(e,t,n),{file:s,commandArguments:c,options:l}=el(e,t,n),u=zg(l);return{file:s,commandArguments:c,command:r,escapedCommand:i,startTime:a,verboseInfo:o,options:u,fileDescriptors:gm(u,o)}},zg=({timeout:e,signal:t,...n})=>{if(t!==void 0)throw TypeError(`The "signal" option has been renamed to "cancelSignal" instead.`);return{...n,timeoutDuration:e}},Bg=({file:e,commandArguments:t,options:n,startTime:r,verboseInfo:i,command:a,escapedCommand:o,fileDescriptors:s})=>{let c;try{c=C(...rl(e,t,n))}catch(e){return lm({error:e,command:a,escapedCommand:o,fileDescriptors:s,options:n,startTime:r,verboseInfo:i})}let l=new AbortController;xe(1/0,l.signal);let u=[...c.stdio];Gm(c,s,l),Zm(c,n,l);let d={},f=js();c.kill=as.bind(void 0,{kill:c.kill.bind(c),options:n,onInternalError:f,context:d,controller:l}),c.all=Kh(c,n),Ng(c,n),om(c,n);let p=Vg({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}},Vg=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 eg({subprocess:e,options:t,context:c,verboseInfo:r,fileDescriptors:i,originalStreams:a,onInternalError:l,controller:u});return u.abort(),l.resolve(),Ru(Hg({errorInfo:d,exitCode:f,signal:p,stdio:m.map((e,n)=>Of(e,t,n)),all:Of(h,t,`all`),ipcOutput:g,context:c,options:t,command:o,escapedCommand:s,startTime:n}),r,t)},Hg=({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?Cu({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 Nl,isForcefullyTerminated:o.isForcefullyTerminated,exitCode:t,signal:n,stdio:r,all:i,ipcOutput:a,options:s,startTime:u,isSync:!1}):xu({command:c,escapedCommand:l,stdio:r,all:i,ipcOutput:a,options:s,startTime:u}),Ug=(e,t)=>{let n=Object.fromEntries(Object.entries(t).map(([t,n])=>[t,Wg(t,e[t],n)]));return{...e,...n}},Wg=(e,t,n)=>Gg.has(e)&&z(t)&&z(n)?{...t,...n}:n,Gg=new Set([`env`,...da]),G=(e,t,n,r)=>{let i=(e,t,r)=>G(e,t,n,r),a=(...a)=>Kg({mapArguments:e,deepOptions:n,boundOptions:t,setBoundExeca:r,createNested:i},...a);return r!==void 0&&r(a,i,t),a},Kg=({mapArguments:e,deepOptions:t={},boundOptions:n={},setBoundExeca:r,createNested:i},a,...o)=>{if(z(a))return i(e,Ug(n,a),r);let{file:s,commandArguments:c,options:l,isSync:u}=qg({mapArguments:e,firstArgument:a,nextArguments:o,deepOptions:t,boundOptions:n});return u?Bp(s,c,l):Lg(s,c,l,i)},qg=({mapArguments:e,firstArgument:t,nextArguments:n,deepOptions:r,boundOptions:i})=>{let[a,o,s]=Di(...Vi(t)?Hi(t,n):[t,...n]),c=Ug(Ug(r,i),s),{file:l=a,commandArguments:u=o,options:d=c,isSync:f=!1}=e({file:a,commandArguments:o,options:c});return{file:l,commandArguments:u,options:d,isSync:f}},Jg=({file:e,commandArguments:t})=>Xg(e,t),Yg=({file:e,commandArguments:t})=>({...Xg(e,t),isSync:!0}),Xg=(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]=Zg(e);return{file:n,commandArguments:r}},Zg=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(Qg)){let t=n.at(-1);t&&t.endsWith(`\\`)?n[n.length-1]=`${t.slice(0,-1)} ${e}`:n.push(e)}return n},Qg=/ +/g,$g=(e,t,n)=>{e.sync=t(t_,n),e.s=e.sync},e_=({options:e})=>n_(e),t_=({options:e})=>({...n_(e),isSync:!0}),n_=e=>({options:{...r_(e),...e}}),r_=({input:e,inputFile:t,stdio:n})=>e===void 0&&t===void 0&&n===void 0?{stdin:`inherit`}:{},i_={preferLocal:!0},a_=G(()=>({}));G(()=>({isSync:!0})),G(Jg),G(Yg),G(zc),G(e_,{},i_,$g);const{sendMessage:o_,getOneMessage:s_,getEachMessage:c_,getCancelSignal:l_}=sm();var K=n(((e,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})),u_=n(((e,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}}})),d_=n(((e,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=n(((e,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`}})),f_=n(((e,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=d_(),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;var i=n(e.split(/\r?\n/)),a;try{for(i.s();!(a=i.n()).done;){let e=a.value;r+=1+Math.floor(Math.max(l(e)-1,0)/t)}}catch(e){i.e(e)}finally{i.f()}return s.lines(r)}})),p_=n(((e,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})),m_=n(((e,t)=>{let n=K(),r=p_(),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)}})),h_=n(((e,t)=>{let n=d_();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}})),g_=n(((e,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
- `)}})),__=n(((e,t)=>{t.exports=(e,t,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=n(((e,t)=>{t.exports={action:u_(),clear:f_(),style:m_(),strip:d_(),figures:p_(),lines:h_(),wrap:g_(),entriesToDisplay:__()}})),Y=n(((t,n)=>{let r=e(`readline`),i=J().action,a=e(`events`),o=q(),s=o.beep,c=o.cursor,l=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(c.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(s)}render(){this.onRender(l),this.firstRender&&=!1}}})),v_=n(((e,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);this.value=`${n}${e}${this.value.slice(this.cursor)}`,this.red=!1,this.cursor=this.placeholder?0:n.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();this.value=`${this.value.slice(0,this.cursor-1)}${this.value.slice(this.cursor)}`,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();this.value=`${this.value.slice(0,this.cursor)}${this.value.slice(this.cursor+1)}`,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)))}}})),y_=n(((e,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().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(u.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)}}})),b_=n(((e,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=n(((e,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)}}})),x_=n(((e,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}}})),S_=n(((e,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}}})),C_=n(((e,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}}})),w_=n(((e,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)}}})),T_=n(((e,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}}})),E_=n(((e,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)}}})),D_=n(((e,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}}})),O_=n(((e,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}}})),k_=n(((e,t)=>{t.exports={DatePart:X(),Meridiem:x_(),Day:S_(),Hours:C_(),Milliseconds:w_(),Minutes:T_(),Month:E_(),Seconds:D_(),Year:O_()}})),A_=n(((e,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=k_(),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,ee={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)},te={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(te,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 ee?ee[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))}}})),j_=n(((e,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=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))}}})),M_=n(((e,t)=>{let n=K(),r=q().cursor,i=Y(),a=J(),o=a.clear,s=a.figures,c=a.style,l=a.wrap,u=a.entriesToDisplay;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=o(``,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
- ${s.arrowUp}/${s.arrowDown}: Highlight option\n ${s.arrowLeft}/${s.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(s.radioOn):s.radioOff)+` `+i+` `,o,c;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&&(c=` - ${t.description}`,(a.length+o.length+c.length>=this.out.columns||t.description.split(/\r?\n/).length>1)&&(c=`
139
- `+l(t.description,{margin:a.length,width:this.out.columns})))),a+o+n.gray(c||``)}paginateOptions(e){if(e.length===0)return n.red(`No matches for this query.`);let t=u(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?s.arrowUp:t===i-1&&i<e.length?s.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(r.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.`),!1),e+=this.renderOptions(this.value),this.out.write(this.clear+e),this.clear=o(e,this.out.columns)}}})),N_=n(((e,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);this.input=`${n}${e}${this.input.slice(this.cursor)}`,this.cursor=n.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();this.input=`${this.input.slice(0,this.cursor-1)}${this.input.slice(this.cursor)}`,this.complete(this.render),--this.cursor,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.input=`${this.input.slice(0,this.cursor)}${this.input.slice(this.cursor+1)}`,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)}}})),P_=n(((e,t)=>{let n=K(),r=q().cursor,i=M_(),a=J(),o=a.clear,s=a.style,c=a.figures;t.exports=class extends i{constructor(e={}){e.overrideRender=!0,super(e),this.inputValue=``,this.clear=o(``,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
- ${c.arrowUp}/${c.arrowDown}: Highlight option
150
- ${c.arrowLeft}/${c.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(c.radioOn):c.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=[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.`),!1),e+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+e),this.clear=o(e,this.out.columns)}}})),F_=n(((e,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))}}})),I_=n(((e,t)=>{t.exports={TextPrompt:v_(),SelectPrompt:y_(),TogglePrompt:b_(),DatePrompt:A_(),NumberPrompt:j_(),MultiselectPrompt:M_(),AutocompletePrompt:N_(),AutocompleteMultiselectPrompt:P_(),ConfirmPrompt:F_()}})),L_=n((e=>{let t=e,n=I_(),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))})),R_=n(((e,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=L_(),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{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:_})})),z_=n(((e,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}}})),B_=n(((e,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}})),V_=n(((e,t)=>{let n=B_(),{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)}})),H_=n(((e,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})),U_=n(((e,t)=>{let n=K(),r=H_(),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)}})),W_=n(((e,t)=>{let n=B_();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}})),G_=n(((e,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
- `)}})),K_=n(((e,t)=>{t.exports=(e,t,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=n(((e,t)=>{t.exports={action:z_(),clear:V_(),style:U_(),strip:B_(),figures:H_(),lines:W_(),wrap:G_(),entriesToDisplay:K_()}})),Q=n(((t,n)=>{let r=e(`readline`),{action:i}=Z(),a=e(`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&&=!1}}})),q_=n(((e,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);this.value=`${n}${e}${this.value.slice(this.cursor)}`,this.red=!1,this.cursor=this.placeholder?0:n.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();this.value=`${this.value.slice(0,this.cursor-1)}${this.value.slice(this.cursor)}`,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();this.value=`${this.value.slice(0,this.cursor)}${this.value.slice(this.cursor+1)}`,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)))}}})),J_=n(((e,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)}}})),Y_=n(((e,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))}}})),$=n(((e,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)}}})),X_=n(((e,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}}})),Z_=n(((e,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}}})),Q_=n(((e,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}}})),$_=n(((e,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)}}})),ev=n(((e,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}}})),tv=n(((e,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)}}})),nv=n(((e,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}}})),rv=n(((e,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}}})),iv=n(((e,t)=>{t.exports={DatePart:$(),Meridiem:X_(),Day:Z_(),Hours:Q_(),Milliseconds:$_(),Minutes:ev(),Month:tv(),Seconds:nv(),Year:rv()}})),av=n(((e,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:_}=iv(),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))}}})),ov=n(((e,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=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))}}})),sv=n(((e,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.`),!1),e+=this.renderOptions(this.value),this.out.write(this.clear+e),this.clear=a(e,this.out.columns)}}})),cv=n(((e,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);this.input=`${n}${e}${this.input.slice(this.cursor)}`,this.cursor=n.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();this.input=`${this.input.slice(0,this.cursor-1)}${this.input.slice(this.cursor)}`,this.complete(this.render),--this.cursor,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.input=`${this.input.slice(0,this.cursor)}${this.input.slice(this.cursor+1)}`,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)}}})),lv=n(((e,t)=>{let n=K(),{cursor:r}=q(),i=sv(),{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.`),!1),e+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+e),this.clear=a(e,this.out.columns)}}})),uv=n(((e,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))}}})),dv=n(((e,t)=>{t.exports={TextPrompt:q_(),SelectPrompt:J_(),TogglePrompt:Y_(),DatePrompt:av(),NumberPrompt:ov(),MultiselectPrompt:sv(),AutocompletePrompt:cv(),AutocompleteMultiselectPrompt:lv(),ConfirmPrompt:uv()}})),fv=n((e=>{let t=e,n=dv(),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))})),pv=n(((e,t)=>{let n=fv(),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){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{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})})),mv=t(n(((e,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`)?R_():pv()}))(),1);function hv({vue:e,react:t}){return{devDependencies:{[`@nice-move/eslint-config-${t&&e||!t&&!e?`base`:t?`react`:`vue`}`]:R[`eslint-config-base`],eslint:R.eslint},script:{"lint:eslint":`eslint . --quiet --fix --concurrency=auto`}}}const gv=`Add/Reset project dependencies`;function _v(e,t={}){return new Qt().config({pretty:!0}).source(`package.json`).onFail().onDone(async(e={})=>{let{devDependencies:n={},dependencies:r={}}=e,{ava:i=`ava`in n,commitlint:a=`commitlint`in n,eslint:o=`eslint`in n,garou:s=`garou`in n,prettier:c=`prettier`in n,react:l=`react`in r,stylelint:u=`stylelint`in n,syncpack:d=`syncpack`in n,typescript:f=`typescript`in n,vue:p=`vue`in r,tailwindcss:m=`tailwindcss`in r||`tailwindcss`in n,playwright:h,"@bring-it/sftp":g=`@bring-it/sftp`in n,"@bring-it/npm":_=`@bring-it/npm`in n,"best-shot":v=`best-shot`in n}=t,y=o||u||c||s,b=[y?`pnpm run lint:staged`:void 0,f?`pnpm run lint:type`:void 0,i?`pnpm test`:void 0].filter(Boolean).map((e,t,n)=>t===n-1?e:`${e} || exit 1`);return b.length>0&&await new P().onDone(()=>[`#!/bin/sh`,``,...b,``].join(`
198
- `)).output(`.githooks/pre-commit`),a&&await new P().onDone(()=>[`#!/bin/sh`,`pnpm exec nice-move lint commit`,``].join(`
199
-
200
- `)).output(`.githooks/commit-msg`),o&&await new P().onDone(()=>[l?`import config from '@nice-move/eslint-config-react';`:p?`import config from '@nice-move/eslint-config-vue';`:`import config from '@nice-move/eslint-config-base';`,`export default [config];`,``].join(`
201
-
202
- `)).output(`eslint.config.mjs`),d&&await new P().onDone(()=>[`// @ts-check`,`// import defineConfig from '@nice-move/syncpack-config/define.mjs';`,`// export default defineConfig(import.meta.url, {});`,`export { default } from '@nice-move/syncpack-config';`].join(`
203
-
204
- `)).output(`syncpack.config.mjs`),f&&await new Qt().config({pretty:!0}).onDone(()=>({extends:l?`@nice-move/tsconfig/react.json`:p?`@nice-move/tsconfig/vue.json`:`@nice-move/tsconfig/base.json`,compilerOptions:{noEmit:!0}})).output(`tsconfig.json`),Gr(...[e,{scripts:{prepare:`nice-move git hooks`}},s?{devDependencies:{garou:R.garou}}:void 0,f?{devDependencies:{typescript:R.typescript,"@nice-move/tsconfig":R.tsconfig},scripts:{"lint:type":`tsc -p tsconfig.json`}}:void 0,y||a?{devDependencies:{"@nice-move/cli":R.cli}}:void 0,y?{scripts:{"lint:staged":`nice-move lint staged`}}:void 0,i?{devDependencies:{ava:R.ava,...o?{"eslint-plugin-ava":R[`eslint-plugin-ava`]}:void 0},scripts:{prepublishOnly:e.private?void 0:b.join(` && `)||void 0,test:`ava --fail-fast`,snapshot:`ava --fail-fast -u`}}:void 0,o?hv({react:l,vue:p}):void 0,u?{devDependencies:{"@nice-move/stylelint-config":R[`stylelint-config`],stylelint:R.stylelint},stylelint:{extends:`@nice-move/stylelint-config`}}:void 0,d?{devDependencies:{"@nice-move/syncpack-config":R[`syncpack-config`],syncpack:R.syncpack},scripts:{"lint:version":`syncpack lint`,"version:pin":`syncpack fix-mismatches`}}:void 0,c?{devDependencies:{"@nice-move/prettier-config":R[`prettier-config`],prettier:R.prettier},prettier:`@nice-move/prettier-config`}:void 0,l?{dependencies:{react:R.react,"react-dom":R[`react-dom`]},devDependencies:{"@types/react":R[`@types/react`],"@types/react-dom":R[`@types/react-dom`]}}:void 0,p?{dependencies:{vue:R.vue}}:void 0,m?{dependencies:{tailwindcss:R.tailwindcss},devDependencies:{"prettier-plugin-tailwindcss":c?R[`prettier-plugin-tailwindcss`]:void 0}}:void 0,h?{scripts:{"pretest:e2e":`pnpm link @playwright/test`,"test:e2e":`playwright test`}}:void 0,g?{devDependencies:{"@bring-it/sftp":R[`@bring-it/sftp`]}}:void 0,_?{devDependencies:{"@bring-it/npm":R[`@bring-it/npm`]}}:void 0,v?{devDependencies:{"best-shot":R[`best-shot`]},"nice-move":{globals:{BEST_SHOT:`readonly`}},scripts:{build:`best-shot prod`}}:void 0].filter(Boolean))}).output().logger(gv).catch(console.warn)}function vv(){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:gv,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=>_v(t,Object.fromEntries(e.map(e=>[e,!0])))}}}const yv=`Initialize as git repository`;function bv(){return a_(`git`,[`init`]).then(e=>(console.log(en(`√`),yv),e),e=>{throw console.log($t(`×`),yv),e})}function xv({gitSupported:e,isRoot:t}){return{message:yv,name:`GitInit`,initial:!0,type:n=>n===!1||!e||t?null:`confirm`,format(e){if(e===!0)return bv}}}
205
- /*!
206
- * author-regex <https://github.com/jonschlinkert/author-regex>
207
- *
208
- * Copyright (c) 2014, 2017, Jon Schlinkert.
209
- * Released under the MIT License.
210
- */
211
- var Sv=n(((e,t)=>{t.exports=function(){return/^\s*([^<(]*?)\s*([<(]([^>)]*?)[>)])?\s*([<(]([^>)]*?)[>)])*\s*$/}})),Cv=t(n(((e,t)=>{var n=Sv();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 wv(){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 Tv=t(n(((t,n)=>{let{builtinModules:r}=e(`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.startsWith(`-`)&&n.push(`name cannot start with a hyphen`),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 Ev=wv();function Dv(e){return Array.isArray(e)&&e.length>0}async function Ov({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,Tv.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=>Ev.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:Cv.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||Dv(c&&c.packages?c.packages:c)?null:`toggle`}]}function kv(){return a_(`git`,[`--version`]).then(({stdout:e})=>!!e)}function Av(){return a_(`git`,[`rev-parse`,`--git-dir`]).then(({stdout:e})=>e===`.git`).catch(()=>!1)}function jv(){return a_(`git`,[`status`,`--short`]).then(({stdout:e})=>e.length>0)}async function Mv(){let e=await kv(),t=e&&await Av(),n=t?await jv():!1,r=vr(),i={gitSupported:e,isRoot:t,isDirty:n,isEmpty:r,pkg:Cr(),cwd:process.cwd()},a=await Ov(i);return(0,mv.default)([{active:`do it`,inactive:`cancel`,message:n===!0?`Repository not clean`:`Workspace not empty`,name:`okay`,type:()=>r||n===!1?null:`toggle`},xv(i),...a,vv(i)],{onCancel(){throw Error(`cancel`)}}).then(({okay:e,...t})=>{if(e===!1)throw Error(`cancel`);return Object.entries(t)}).then(e=>{let t=a.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:i}})}async function Nv(){let{Dependencies:e,GitInit:t,info:n,options:{isRoot:r}={}}=await Mv();console.log(`-`.repeat(32));let i=[t,()=>xi(n),Si,kr,nn,()=>t||r?Er():void 0,()=>e?e(t||r):void 0].filter(e=>typeof e==`function`);for(let e of i){let t=await e();t&&t.catch&&t.catch(e=>{console.warn(e.message)})}}export{Nv as init};