@nice-move/cli 0.10.8 → 0.10.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.mjs CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import{createRequire as t}from"module";var e,n,s,i,r={8995:(t,e,n)=>{const s=n(32081),i=n(19015),r=n(95350);function o(t,e,n){const o=i(t,e,n),a=s.spawn(o.command,o.args,o.options);return r.hookChildProcess(a,o),a}t.exports=o,t.exports.spawn=o,t.exports.sync=function(t,e,n){const o=i(t,e,n),a=s.spawnSync(o.command,o.args,o.options);return a.error=a.error||r.verifyENOENTSync(a.status,o),a},t.exports._parse=i,t.exports._enoent=r},95350:t=>{const e="win32"===process.platform;function n(t,e){return Object.assign(new Error(`${e} ${t.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${e} ${t.command}`,path:t.command,spawnargs:t.args})}function s(t,s){return e&&1===t&&!s.file?n(s.original,"spawn"):null}t.exports={hookChildProcess:function(t,n){if(!e)return;const i=t.emit;t.emit=function(e,r){if("exit"===e){const e=s(r,n);if(e)return i.call(t,"error",e)}return i.apply(t,arguments)}},verifyENOENT:s,verifyENOENTSync:function(t,s){return e&&1===t&&!s.file?n(s.original,"spawnSync"):null},notFoundError:n}},19015:(t,e,n)=>{const s=n(71017),i=n(65358),r=n(16214),o=n(63106),a="win32"===process.platform,c=/\.(?:com|exe)$/i,l=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function h(t){if(!a)return t;const e=function(t){t.file=i(t);const e=t.file&&o(t.file);return e?(t.args.unshift(t.file),t.command=e,i(t)):t.file}(t),n=!c.test(e);if(t.options.forceShell||n){const n=l.test(e);t.command=s.normalize(t.command),t.command=r.command(t.command),t.args=t.args.map((t=>r.argument(t,n)));const i=[t.command].concat(t.args).join(" ");t.args=["/d","/s","/c",`"${i}"`],t.command=process.env.comspec||"cmd.exe",t.options.windowsVerbatimArguments=!0}return t}t.exports=function(t,e,n){e&&!Array.isArray(e)&&(n=e,e=null);const s={command:t,args:e=e?e.slice(0):[],options:n=Object.assign({},n),file:void 0,original:{command:t,args:e}};return n.shell?s:h(s)}},16214:t=>{const e=/([()\][%!^"`<>&|;, *?])/g;t.exports.command=function(t){return t=t.replace(e,"^$1")},t.exports.argument=function(t,n){return t=(t=`"${t=(t=(t=`${t}`).replace(/(\\*)"/g,'$1$1\\"')).replace(/(\\*)$/,"$1$1")}"`).replace(e,"^$1"),n&&(t=t.replace(e,"^$1")),t}},63106:(t,e,n)=>{const s=n(57147),i=n(14256);t.exports=function(t){const e=Buffer.alloc(150);let n;try{n=s.openSync(t,"r"),s.readSync(n,e,0,150,0),s.closeSync(n)}catch(t){}return i(e.toString())}},65358:(t,e,n)=>{const s=n(71017),i=n(89056),r=n(26569);function o(t,e){const n=t.options.env||process.env,o=process.cwd(),a=null!=t.options.cwd,c=a&&void 0!==process.chdir&&!process.chdir.disabled;if(c)try{process.chdir(t.options.cwd)}catch(t){}let l;try{l=i.sync(t.command,{path:n[r({env:n})],pathExt:e?s.delimiter:void 0})}catch(t){}finally{c&&process.chdir(o)}return l&&(l=s.resolve(a?t.options.cwd:"",l)),l}t.exports=function(t){return o(t)||o(t,!0)}},54337:(t,e,n)=>{const{PassThrough:s}=n(12781);t.exports=t=>{t={...t};const{array:e}=t;let{encoding:n}=t;const i="buffer"===n;let r=!1;e?r=!(n||i):n=n||"utf8",i&&(n=null);const o=new s({objectMode:r});n&&o.setEncoding(n);let a=0;const c=[];return o.on("data",(t=>{c.push(t),r?a=c.length:a+=t.length})),o.getBufferedValue=()=>e?c:i?Buffer.concat(c,a):c.join(""),o.getBufferedLength=()=>a,o}},22935:(t,e,n)=>{const{constants:s}=n(14300),i=n(12781),{promisify:r}=n(73837),o=n(54337),a=r(i.pipeline);class c extends Error{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}}async function l(t,e){if(!t)throw new Error("Expected a stream");e={maxBuffer:1/0,...e};const{maxBuffer:n}=e,i=o(e);return await new Promise(((e,r)=>{const o=t=>{t&&i.getBufferedLength()<=s.MAX_LENGTH&&(t.bufferedData=i.getBufferedValue()),r(t)};(async()=>{try{await a(t,i),e()}catch(t){o(t)}})(),i.on("data",(()=>{i.getBufferedLength()>n&&o(new c)}))})),i.getBufferedValue()}t.exports=l,t.exports.buffer=(t,e)=>l(t,{...e,encoding:"buffer"}),t.exports.array=(t,e)=>l(t,{...e,array:!0}),t.exports.MaxBufferError=c},5909:(t,e,n)=>{var s;n(57147);function i(t,e,n){if("function"==typeof e&&(n=e,e={}),!n){if("function"!=typeof Promise)throw new TypeError("callback not provided");return new Promise((function(n,s){i(t,e||{},(function(t,e){t?s(t):n(e)}))}))}s(t,e||{},(function(t,s){t&&("EACCES"===t.code||e&&e.ignoreErrors)&&(t=null,s=!1),n(t,s)}))}s="win32"===process.platform||global.TESTING_WINDOWS?n(90837):n(74703),t.exports=i,i.sync=function(t,e){try{return s.sync(t,e||{})}catch(t){if(e&&e.ignoreErrors||"EACCES"===t.code)return!1;throw t}}},74703:(t,e,n)=>{t.exports=i,i.sync=function(t,e){return r(s.statSync(t),e)};var s=n(57147);function i(t,e,n){s.stat(t,(function(t,s){n(t,!t&&r(s,e))}))}function r(t,e){return t.isFile()&&function(t,e){var n=t.mode,s=t.uid,i=t.gid,r=void 0!==e.uid?e.uid:process.getuid&&process.getuid(),o=void 0!==e.gid?e.gid:process.getgid&&process.getgid(),a=parseInt("100",8),c=parseInt("010",8),l=parseInt("001",8),h=a|c;return n&l||n&c&&i===o||n&a&&s===r||n&h&&0===r}(t,e)}},90837:(t,e,n)=>{t.exports=r,r.sync=function(t,e){return i(s.statSync(t),t,e)};var s=n(57147);function i(t,e,n){return!(!t.isSymbolicLink()&&!t.isFile())&&function(t,e){var n=void 0!==e.pathExt?e.pathExt:process.env.PATHEXT;if(!n)return!0;if(-1!==(n=n.split(";")).indexOf(""))return!0;for(var s=0;s<n.length;s++){var i=n[s].toLowerCase();if(i&&t.substr(-i.length).toLowerCase()===i)return!0}return!1}(e,n)}function r(t,e,n){s.stat(t,(function(s,r){n(s,!s&&i(r,t,e))}))}},90873:(t,e,n)=>{const{PassThrough:s}=n(12781);t.exports=function(){var t=[],e=new s({objectMode:!0});return e.setMaxListeners(0),e.add=n,e.isEmpty=function(){return 0==t.length},e.on("unpipe",i),Array.prototype.slice.call(arguments).forEach(n),e;function n(s){return Array.isArray(s)?(s.forEach(n),this):(t.push(s),s.once("end",i.bind(null,s)),s.once("error",e.emit.bind(e,"error")),s.pipe(e,{end:!1}),this)}function i(n){!(t=t.filter((function(t){return t!==n}))).length&&e.readable&&e.end()}}},26569:t=>{const e=(t={})=>{const e=t.env||process.env;return"win32"!==(t.platform||process.platform)?"PATH":Object.keys(e).reverse().find((t=>"PATH"===t.toUpperCase()))||"Path"};t.exports=e,t.exports.default=e},14256:(t,e,n)=>{const s=n(83882);t.exports=(t="")=>{const e=t.match(s);if(!e)return null;const[n,i]=e[0].replace(/#! ?/,"").split(" "),r=n.split("/").pop();return"env"===r?i:i?`${r} ${i}`:r}},83882:t=>{t.exports=/^#!(.*)/},90260:(t,e,n)=>{var s=global.process;const i=function(t){return t&&"object"==typeof t&&"function"==typeof t.removeListener&&"function"==typeof t.emit&&"function"==typeof t.reallyExit&&"function"==typeof t.listeners&&"function"==typeof t.kill&&"number"==typeof t.pid&&"function"==typeof t.on};if(i(s)){var r,o=n(39491),a=n(83261),c=/^win/i.test(s.platform),l=n(82361);"function"!=typeof l&&(l=l.EventEmitter),s.__signal_exit_emitter__?r=s.__signal_exit_emitter__:((r=s.__signal_exit_emitter__=new l).count=0,r.emitted={}),r.infinite||(r.setMaxListeners(1/0),r.infinite=!0),t.exports=function(t,e){if(!i(global.process))return function(){};o.equal(typeof t,"function","a callback must be provided for exit handler"),!1===f&&p();var n="exit";e&&e.alwaysLast&&(n="afterexit");return r.on(n,t),function(){r.removeListener(n,t),0===r.listeners("exit").length&&0===r.listeners("afterexit").length&&h()}};var h=function(){f&&i(global.process)&&(f=!1,a.forEach((function(t){try{s.removeListener(t,d[t])}catch(t){}})),s.emit=y,s.reallyExit=m,r.count-=1)};t.exports.unload=h;var u=function(t,e,n){r.emitted[t]||(r.emitted[t]=!0,r.emit(t,e,n))},d={};a.forEach((function(t){d[t]=function(){i(global.process)&&(s.listeners(t).length===r.count&&(h(),u("exit",null,t),u("afterexit",null,t),c&&"SIGHUP"===t&&(t="SIGINT"),s.kill(s.pid,t)))}})),t.exports.signals=function(){return a};var f=!1,p=function(){!f&&i(global.process)&&(f=!0,r.count+=1,a=a.filter((function(t){try{return s.on(t,d[t]),!0}catch(t){return!1}})),s.emit=b,s.reallyExit=g)};t.exports.load=p;var m=s.reallyExit,g=function(t){i(global.process)&&(s.exitCode=t||0,u("exit",s.exitCode,null),u("afterexit",s.exitCode,null),m.call(s,s.exitCode))},y=s.emit,b=function(t,e){if("exit"===t&&i(global.process)){void 0!==e&&(s.exitCode=e);var n=y.apply(this,arguments);return u("exit",s.exitCode,null),u("afterexit",s.exitCode,null),n}return y.apply(this,arguments)}}else t.exports=function(){return function(){}}},83261:t=>{t.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"],"win32"!==process.platform&&t.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),"linux"===process.platform&&t.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")},89056:(t,e,n)=>{const s="win32"===process.platform||"cygwin"===process.env.OSTYPE||"msys"===process.env.OSTYPE,i=n(71017),r=s?";":":",o=n(5909),a=t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),c=(t,e)=>{const n=e.colon||r,i=t.match(/\//)||s&&t.match(/\\/)?[""]:[...s?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(n)],o=s?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",a=s?o.split(n):[""];return s&&-1!==t.indexOf(".")&&""!==a[0]&&a.unshift(""),{pathEnv:i,pathExt:a,pathExtExe:o}},l=(t,e,n)=>{"function"==typeof e&&(n=e,e={}),e||(e={});const{pathEnv:s,pathExt:r,pathExtExe:l}=c(t,e),h=[],u=n=>new Promise(((r,o)=>{if(n===s.length)return e.all&&h.length?r(h):o(a(t));const c=s[n],l=/^".*"$/.test(c)?c.slice(1,-1):c,u=i.join(l,t),f=!l&&/^\.[\\\/]/.test(t)?t.slice(0,2)+u:u;r(d(f,n,0))})),d=(t,n,s)=>new Promise(((i,a)=>{if(s===r.length)return i(u(n+1));const c=r[s];o(t+c,{pathExt:l},((r,o)=>{if(!r&&o){if(!e.all)return i(t+c);h.push(t+c)}return i(d(t,n,s+1))}))}));return n?u(0).then((t=>n(null,t)),n):u(0)};t.exports=l,l.sync=(t,e)=>{e=e||{};const{pathEnv:n,pathExt:s,pathExtExe:r}=c(t,e),l=[];for(let a=0;a<n.length;a++){const c=n[a],h=/^".*"$/.test(c)?c.slice(1,-1):c,u=i.join(h,t),d=!h&&/^\.[\\\/]/.test(t)?t.slice(0,2)+u:u;for(let t=0;t<s.length;t++){const n=d+s[t];try{if(o.sync(n,{pathExt:r})){if(!e.all)return n;l.push(n)}}catch(t){}}}if(e.all&&l.length)return l;if(e.nothrow)return null;throw a(t)}},39491:e=>{e.exports=t(import.meta.url)("assert")},14300:e=>{e.exports=t(import.meta.url)("buffer")},32081:e=>{e.exports=t(import.meta.url)("child_process")},3906:e=>{e.exports=t(import.meta.url)("enquirer")},82361:e=>{e.exports=t(import.meta.url)("events")},57147:e=>{e.exports=t(import.meta.url)("fs")},87561:e=>{e.exports=t(import.meta.url)("node:fs")},93977:e=>{e.exports=t(import.meta.url)("node:fs/promises")},70612:e=>{e.exports=t(import.meta.url)("node:os")},49411:e=>{e.exports=t(import.meta.url)("node:path")},97742:e=>{e.exports=t(import.meta.url)("node:process")},25997:e=>{e.exports=t(import.meta.url)("node:tty")},22037:e=>{e.exports=t(import.meta.url)("os")},71017:e=>{e.exports=t(import.meta.url)("path")},12781:e=>{e.exports=t(import.meta.url)("stream")},76224:e=>{e.exports=t(import.meta.url)("tty")},73837:e=>{e.exports=t(import.meta.url)("util")},21192:(e,n,s)=>{s.d(n,{r:()=>Ct,cF:()=>Pt,PS:()=>_t});const i=t(import.meta.url)("node:buffer");var r=s(49411);const o=t(import.meta.url)("node:child_process");var a=s(97742),c=s(8995);const l=t(import.meta.url)("node:url");function h(t={}){const{env:e=process.env,platform:n=process.platform}=t;return"win32"!==n?"PATH":Object.keys(e).reverse().find((t=>"PATH"===t.toUpperCase()))||"Path"}function u({env:t=a.env,...e}={}){const n=h({env:t={...t}});return e.path=t[n],t[n]=function(t={}){const{cwd:e=a.cwd(),path:n=a.env[h()],execPath:s=a.execPath}=t;let i;const o=e instanceof URL?l.fileURLToPath(e):e;let c=r.resolve(o);const u=[];for(;i!==c;)u.push(r.join(c,"node_modules/.bin")),i=c,c=r.resolve(c,"..");return u.push(r.resolve(o,s,"..")),[...u,n].join(r.delimiter)}(e),t}const d=(t,e,n,s)=>{if("length"===n||"prototype"===n)return;if("arguments"===n||"caller"===n)return;const i=Object.getOwnPropertyDescriptor(t,n),r=Object.getOwnPropertyDescriptor(e,n);!f(i,r)&&s||Object.defineProperty(t,n,r)},f=function(t,e){return void 0===t||t.configurable||t.writable===e.writable&&t.enumerable===e.enumerable&&t.configurable===e.configurable&&(t.writable||t.value===e.value)},p=(t,e)=>{const n=Object.getPrototypeOf(e);n!==Object.getPrototypeOf(t)&&Object.setPrototypeOf(t,n)},m=(t,e)=>`/* Wrapped ${t}*/\n${e}`,g=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),y=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),b=(t,e,n)=>{const s=""===n?"":`with ${n.trim()}() `,i=m.bind(null,s,e.toString());Object.defineProperty(i,"name",y),Object.defineProperty(t,"toString",{...g,value:i})};const v=new WeakMap,w=(t,e={})=>{if("function"!=typeof t)throw new TypeError("Expected a function");let n,s=0;const i=t.displayName||t.name||"<anonymous>",r=function(...o){if(v.set(r,++s),1===s)n=t.apply(this,o),t=null;else if(!0===e.throw)throw new Error(`Function \`${i}\` can only be called once`);return n};return function(t,e,{ignoreNonConfigurable:n=!1}={}){const{name:s}=t;for(const s of Reflect.ownKeys(e))d(t,e,s,n);p(t,e),b(t,e,s)}(r,t),v.set(r,s),r};w.callCount=t=>{if(!v.has(t))throw new Error(`The given function \`${t.name}\` is not wrapped by the \`onetime\` package`);return v.get(t)};const O=w;var x=s(70612);const E=(t,e)=>({name:`SIGRT${e+1}`,number:j+e,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),j=34,S=64,C=[{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"}],_=()=>{const t=(()=>{const t=S-j+1;return Array.from({length:t},E)})();return[...C,...t].map(k)},k=({name:t,number:e,description:n,action:s,forced:i=!1,standard:r})=>{const{signals:{[t]:o}}=x.constants,a=void 0!==o;return{name:t,number:a?o:e,description:n,supported:a,action:s,forced:i,standard:r}},A=({name:t,number:e,description:n,supported:s,action:i,forced:r,standard:o})=>[t,{name:t,number:e,description:n,supported:s,action:i,forced:r,standard:o}],P=(()=>{const t=_();return Object.fromEntries(t.map(A))})(),$=(t,e)=>{const n=M(t,e);if(void 0===n)return{};const{name:s,description:i,supported:r,action:o,forced:a,standard:c}=n;return{[t]:{name:s,number:t,description:i,supported:r,action:o,forced:a,standard:c}}},M=(t,e)=>{const n=e.find((({name:e})=>x.constants.signals[e]===t));return void 0!==n?n:e.find((e=>e.number===t))},I=((()=>{const t=_(),e=S+1,n=Array.from({length:e},((e,n)=>$(n,t)));Object.assign({},...n)})(),({stdout:t,stderr:e,all:n,error:s,signal:i,exitCode:r,command:o,escapedCommand:a,timedOut:c,isCanceled:l,killed:h,parsed:{options:{timeout:u}}})=>{r=null===r?void 0:r;const d=void 0===(i=null===i?void 0:i)?void 0:P[i].description,f=(({timedOut:t,timeout:e,errorCode:n,signal:s,signalDescription:i,exitCode:r,isCanceled:o})=>t?`timed out after ${e} milliseconds`:o?"was canceled":void 0!==n?`failed with ${n}`:void 0!==s?`was killed with ${s} (${i})`:void 0!==r?`failed with exit code ${r}`:"failed")({timedOut:c,timeout:u,errorCode:s&&s.code,signal:i,signalDescription:d,exitCode:r,isCanceled:l}),p=`Command ${f}: ${o}`,m="[object Error]"===Object.prototype.toString.call(s),g=m?`${p}\n${s.message}`:p,y=[g,e,t].filter(Boolean).join("\n");return m?(s.originalMessage=s.message,s.message=y):s=new Error(y),s.shortMessage=g,s.command=o,s.escapedCommand=a,s.exitCode=r,s.signal=i,s.signalDescription=d,s.stdout=t,s.stderr=e,void 0!==n&&(s.all=n),"bufferedData"in s&&delete s.bufferedData,s.failed=!0,s.timedOut=Boolean(c),s.isCanceled=l,s.killed=h&&!c,s}),T=["stdin","stdout","stderr"],N=t=>{if(!t)return;const{stdio:e}=t;if(void 0===e)return T.map((e=>t[e]));if((t=>T.some((e=>void 0!==t[e])))(t))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${T.map((t=>`\`${t}\``)).join(", ")}`);if("string"==typeof e)return e;if(!Array.isArray(e))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof e}\``);const n=Math.max(e.length,T.length);return Array.from({length:n},((t,n)=>e[n]))};var L=s(90260);const F=(t,e="SIGTERM",n={})=>{const s=t(e);return G(t,e,n,s),s},G=(t,e,n,s)=>{if(!D(e,n,s))return;const i=R(n),r=setTimeout((()=>{t("SIGKILL")}),i);r.unref&&r.unref()},D=(t,{forceKillAfterTimeout:e},n)=>W(t)&&!1!==e&&n,W=t=>t===x.constants.signals.SIGTERM||"string"==typeof t&&"SIGTERM"===t.toUpperCase(),R=({forceKillAfterTimeout:t=!0})=>{if(!0===t)return 5e3;if(!Number.isFinite(t)||t<0)throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${t}\` (${typeof t})`);return t},U=(t,e)=>{t.kill()&&(e.isCanceled=!0)},B=(t,{timeout:e,killSignal:n="SIGTERM"},s)=>{if(0===e||void 0===e)return s;let i;const r=new Promise(((s,r)=>{i=setTimeout((()=>{((t,e,n)=>{t.kill(e),n(Object.assign(new Error("Timed out"),{timedOut:!0,signal:e}))})(t,n,r)}),e)})),o=s.finally((()=>{clearTimeout(i)}));return Promise.race([r,o])},H=({timeout:t})=>{if(void 0!==t&&(!Number.isFinite(t)||t<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${t}\` (${typeof t})`)},z=async(t,{cleanup:e,detached:n},s)=>{if(!e||n)return s;const i=L((()=>{t.kill()}));return s.finally((()=>{i()}))};var q=s(87561);function V(t){return null!==t&&"object"==typeof t&&"function"==typeof t.pipe}function K(t){return V(t)&&!1!==t.writable&&"function"==typeof t._write&&"object"==typeof t._writableState}const Y=(t,e,n)=>{if("string"==typeof n)return t[e].pipe((0,q.createWriteStream)(n)),t;if(K(n))return t[e].pipe(n),t;if(!(t=>t instanceof o.ChildProcess&&"function"==typeof t.then)(n))throw new TypeError("The second argument must be a string, a stream or an Execa child process.");if(!K(n.stdin))throw new TypeError("The target child process's stdin must be available.");return t[e].pipe(n.stdin),n},J=t=>{null!==t.stdout&&(t.pipeStdout=Y.bind(void 0,t,"stdout")),null!==t.stderr&&(t.pipeStderr=Y.bind(void 0,t,"stderr")),void 0!==t.all&&(t.pipeAll=Y.bind(void 0,t,"all"))};var Q=s(22935),X=s(90873);const Z=t=>{if(void 0!==t)throw new TypeError("The `input` and `inputFile` options cannot be both set.")},tt=t=>{const e=(({input:t,inputFile:e})=>"string"!=typeof e?t:(Z(t),(0,q.readFileSync)(e)))(t);if(V(e))throw new TypeError("The `input` option cannot be a stream in sync mode");return e},et=(t,e)=>{const n=(({input:t,inputFile:e})=>"string"!=typeof e?t:(Z(t),(0,q.createReadStream)(e)))(e);void 0!==n&&(V(n)?n.pipe(t.stdin):t.stdin.end(n))},nt=(t,{all:e})=>{if(!e||!t.stdout&&!t.stderr)return;const n=X();return t.stdout&&n.add(t.stdout),t.stderr&&n.add(t.stderr),n},st=async(t,e)=>{if(t&&void 0!==e){t.destroy();try{return await e}catch(t){return t.bufferedData}}},it=(t,{encoding:e,buffer:n,maxBuffer:s})=>{if(t&&n)return e?Q(t,{encoding:e,maxBuffer:s}):Q.buffer(t,{maxBuffer:s})},rt=async({stdout:t,stderr:e,all:n},{encoding:s,buffer:i,maxBuffer:r},o)=>{const a=it(t,{encoding:s,buffer:i,maxBuffer:r}),c=it(e,{encoding:s,buffer:i,maxBuffer:r}),l=it(n,{encoding:s,buffer:i,maxBuffer:2*r});try{return await Promise.all([o,a,c,l])}catch(s){return Promise.all([{error:s,signal:s.signal,timedOut:s.timedOut},st(t,a),st(e,c),st(n,l)])}},ot=(async()=>{})().constructor.prototype,at=["then","catch","finally"].map((t=>[t,Reflect.getOwnPropertyDescriptor(ot,t)])),ct=(t,e)=>{for(const[n,s]of at){const i="function"==typeof e?(...t)=>Reflect.apply(s.value,e(),t):s.value.bind(e);Reflect.defineProperty(t,n,{...s,value:i})}},lt=t=>new Promise(((e,n)=>{t.on("exit",((t,n)=>{e({exitCode:t,signal:n})})),t.on("error",(t=>{n(t)})),t.stdin&&t.stdin.on("error",(t=>{n(t)}))})),ht=(t,e=[])=>Array.isArray(e)?[t,...e]:[t],ut=/^[\w.-]+$/,dt=/"/g,ft=(t,e)=>ht(t,e).join(" "),pt=(t,e)=>ht(t,e).map((t=>(t=>"string"!=typeof t||ut.test(t)?t:`"${t.replace(dt,'\\"')}"`)(t))).join(" "),mt=/ +/g,gt=t=>{const e=[];for(const n of t.trim().split(mt)){const t=e[e.length-1];t&&t.endsWith("\\")?e[e.length-1]=`${t.slice(0,-1)} ${n}`:e.push(n)}return e},yt=t=>{const e=typeof t;if("string"===e)return t;if("number"===e)return String(t);if("object"===e&&null!==t&&!(t instanceof o.ChildProcess)&&"stdout"in t){const e=typeof t.stdout;if("string"===e)return t.stdout;if(i.Buffer.isBuffer(t.stdout))return t.stdout.toString();throw new TypeError(`Unexpected "${e}" stdout in template expression`)}throw new TypeError(`Unexpected "${e}" in template expression`)},bt=(t,e,n)=>n||0===t.length||0===e.length?[...t,...e]:[...t.slice(0,-1),`${t[t.length-1]}${e[0]}`,...e.slice(1)],vt=({templates:t,expressions:e,tokens:n,index:s,template:i})=>{const r=i??t.raw[s],o=r.split(mt).filter(Boolean),a=bt(n,o,r.startsWith(" "));if(s===e.length)return a;const c=e[s],l=Array.isArray(c)?c.map((t=>yt(t))):[yt(c)];return bt(a,l,r.endsWith(" "))},wt=(t,e)=>{let n=[];for(const[s,i]of t.entries())n=vt({templates:t,expressions:e,tokens:n,index:s,template:i});return n},Ot=(0,t(import.meta.url)("node:util").debuglog)("execa").enabled,xt=(t,e)=>String(t).padStart(e,"0"),Et=(t,{verbose:e})=>{e&&a.stderr.write(`[${(()=>{const t=new Date;return`${xt(t.getHours(),2)}:${xt(t.getMinutes(),2)}:${xt(t.getSeconds(),2)}.${xt(t.getMilliseconds(),3)}`})()}] ${t}\n`)},jt=(t,e,n={})=>{const s=c._parse(t,e,n);return t=s.command,e=s.args,(n={maxBuffer:1e8,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:(n=s.options).cwd||a.cwd(),execPath:a.execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,verbose:Ot,...n}).env=(({env:t,extendEnv:e,preferLocal:n,localDir:s,execPath:i})=>{const r=e?{...a.env,...t}:t;return n?u({env:r,cwd:s,execPath:i}):r})(n),n.stdio=N(n),"win32"===a.platform&&"cmd"===r.basename(t,".exe")&&e.unshift("/q"),{file:t,args:e,options:n,parsed:s}},St=(t,e,n)=>"string"==typeof e||i.Buffer.isBuffer(e)?t.stripFinalNewline?function(t){const e="string"==typeof t?"\n":"\n".charCodeAt(),n="string"==typeof t?"\r":"\r".charCodeAt();return t[t.length-1]===e&&(t=t.slice(0,-1)),t[t.length-1]===n&&(t=t.slice(0,-1)),t}(e):e:void 0===n?void 0:"";function Ct(t,e,n){const s=jt(t,e,n),i=ft(t,e),r=pt(t,e);let a;Et(r,s.options),H(s.options);try{a=o.spawn(s.file,s.args,s.options)}catch(t){const e=new o.ChildProcess,n=Promise.reject(I({error:t,stdout:"",stderr:"",all:"",command:i,escapedCommand:r,parsed:s,timedOut:!1,isCanceled:!1,killed:!1}));return ct(e,n),e}const c=lt(a),l=B(a,s.options,c),h=z(a,s.options,l),u={isCanceled:!1};a.kill=F.bind(null,a.kill.bind(a)),a.cancel=U.bind(null,a,u);const d=O((async()=>{const[{error:t,exitCode:e,signal:n,timedOut:o},c,l,d]=await rt(a,s.options,h),f=St(s.options,c),p=St(s.options,l),m=St(s.options,d);if(t||0!==e||null!==n){const c=I({error:t,exitCode:e,signal:n,stdout:f,stderr:p,all:m,command:i,escapedCommand:r,parsed:s,timedOut:o,isCanceled:u.isCanceled||!!s.options.signal&&s.options.signal.aborted,killed:a.killed});if(!s.options.reject)return c;throw c}return{command:i,escapedCommand:r,exitCode:0,stdout:f,stderr:p,all:m,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}}));return et(a,s.options),a.all=nt(a,s.options),J(a),ct(a,d),a}function _t(t,e,n){const s=jt(t,e,n),i=ft(t,e),r=pt(t,e);Et(r,s.options);const a=tt(s.options);let c;try{c=o.spawnSync(s.file,s.args,{...s.options,input:a})}catch(t){throw I({error:t,stdout:"",stderr:"",all:"",command:i,escapedCommand:r,parsed:s,timedOut:!1,isCanceled:!1,killed:!1})}const l=St(s.options,c.stdout,c.error),h=St(s.options,c.stderr,c.error);if(c.error||0!==c.status||null!==c.signal){const t=I({stdout:l,stderr:h,error:c.error,signal:c.signal,exitCode:c.status,command:i,escapedCommand:r,parsed:s,timedOut:c.error&&"ETIMEDOUT"===c.error.code,isCanceled:!1,killed:null!==c.signal});if(!s.options.reject)return t;throw t}return{command:i,escapedCommand:r,exitCode:0,stdout:l,stderr:h,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}}const kt=({input:t,inputFile:e,stdio:n})=>void 0===t&&void 0===e&&void 0===n?{stdin:"inherit"}:{},At=(t={})=>({preferLocal:!0,...kt(t),...t});(function t(e){function n(n,...s){if(!Array.isArray(n))return t({...e,...n});const[i,...r]=wt(n,s);return Ct(i,r,At(e))}return n.sync=(t,...n)=>{if(!Array.isArray(t))throw new TypeError("Please use $(options).sync`command` instead of $.sync(options)`command`.");const[s,...i]=wt(t,n);return _t(s,i,At(e))},n})();function Pt(t,e){const[n,...s]=gt(t);return Ct(n,s,e)}}},o={};function a(t){var e=o[t];if(void 0!==e)return e.exports;var n=o[t]={id:t,loaded:!1,exports:{}};return r[t].call(n.exports,n,n.exports,a),n.loaded=!0,n.exports}a.m=r,n=Object.getPrototypeOf?t=>Object.getPrototypeOf(t):t=>t.__proto__,a.t=function(t,s){if(1&s&&(t=this(t)),8&s)return t;if("object"==typeof t&&t){if(4&s&&t.__esModule)return t;if(16&s&&"function"==typeof t.then)return t}var i=Object.create(null);a.r(i);var r={};e=e||[null,n({}),n([]),n(n)];for(var o=2&s&&t;"object"==typeof o&&!~e.indexOf(o);o=n(o))Object.getOwnPropertyNames(o).forEach((e=>r[e]=()=>t[e]));return r.default=()=>t,a.d(i,r),i},a.d=(t,e)=>{for(var n in e)a.o(e,n)&&!a.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},a.f={},a.e=t=>Promise.all(Object.keys(a.f).reduce(((e,n)=>(a.f[n](t,e),e)),[])),a.u=t=>t+".mjs",a.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),a.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},a.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),s={442:0},i=t=>{var e,n,{ids:i,modules:r,runtime:o}=t,c=0;for(e in r)a.o(r,e)&&(a.m[e]=r[e]);for(o&&o(a);c<i.length;c++)n=i[c],a.o(s,n)&&s[n]&&s[n][0](),s[i[c]]=0},a.f.j=(t,e)=>{var n=a.o(s,t)?s[t]:void 0;if(0!==n)if(n)e.push(n[1]);else{var r=import("./"+a.u(t)).then(i,(e=>{throw 0!==s[t]&&(s[t]=void 0),e}));r=Promise.race([r,new Promise((e=>n=s[t]=[e]))]),e.push(n[1]=r)}},(()=>{var e={};a.r(e),a.d(e,{builder:()=>Ke,command:()=>He,description:()=>ze});var n={};a.r(n),a.d(n,{builder:()=>un,command:()=>hn});var s=a(57147),i=a(39491);const r={right:function(t,e){t=t.trim();const n=u.stringWidth(t);if(n<e)return" ".repeat(e-n)+t;return t},center:function(t,e){t=t.trim();const n=u.stringWidth(t);if(n>=e)return t;return" ".repeat(e-n>>1)+t}},o=1,c=3;class l{constructor(t){var e;this.width=t.width,this.wrap=null===(e=t.wrap)||void 0===e||e,this.rows=[]}span(...t){this.div(...t).span=!0}resetOutput(){this.rows=[]}div(...t){if(0===t.length&&this.div(""),this.wrap&&this.shouldApplyLayoutDSL(...t)&&"string"==typeof t[0])return this.applyLayoutDSL(t[0]);const e=t.map((t=>"string"==typeof t?this.colFromString(t):t));return this.rows.push(e),e}shouldApplyLayoutDSL(...t){return 1===t.length&&"string"==typeof t[0]&&/[\t\n]/.test(t[0])}applyLayoutDSL(t){const e=t.split("\n").map((t=>t.split("\t")));let n=0;return e.forEach((t=>{t.length>1&&u.stringWidth(t[0])>n&&(n=Math.min(Math.floor(.5*this.width),u.stringWidth(t[0])))})),e.forEach((t=>{this.div(...t.map(((e,s)=>({text:e.trim(),padding:this.measurePadding(e),width:0===s&&t.length>1?n:void 0}))))})),this.rows[this.rows.length-1]}colFromString(t){return{text:t,padding:this.measurePadding(t)}}measurePadding(t){const e=u.stripAnsi(t);return[0,e.match(/\s*$/)[0].length,0,e.match(/^\s*/)[0].length]}toString(){const t=[];return this.rows.forEach((e=>{this.rowToString(e,t)})),t.filter((t=>!t.hidden)).map((t=>t.text)).join("\n")}rowToString(t,e){return this.rasterize(t).forEach(((n,s)=>{let i="";n.forEach(((n,a)=>{const{width:l}=t[a],d=this.negatePadding(t[a]);let f=n;if(d>u.stringWidth(n)&&(f+=" ".repeat(d-u.stringWidth(n))),t[a].align&&"left"!==t[a].align&&this.wrap){f=(0,r[t[a].align])(f,d),u.stringWidth(f)<d&&(f+=" ".repeat((l||0)-u.stringWidth(f)-1))}const p=t[a].padding||[0,0,0,0];p[c]&&(i+=" ".repeat(p[c])),i+=h(t[a],f,"| "),i+=f,i+=h(t[a],f," |"),p[o]&&(i+=" ".repeat(p[o])),0===s&&e.length>0&&(i=this.renderInline(i,e[e.length-1]))})),e.push({text:i.replace(/ +$/,""),span:t.span})})),e}renderInline(t,e){const n=t.match(/^ */),s=n?n[0].length:0,i=e.text,r=u.stringWidth(i.trimRight());return e.span?this.wrap?s<r?t:(e.hidden=!0,i.trimRight()+" ".repeat(s-r)+t.trimLeft()):(e.hidden=!0,i+t):t}rasterize(t){const e=[],n=this.columnWidths(t);let s;return t.forEach(((t,i)=>{t.width=n[i],s=this.wrap?u.wrap(t.text,this.negatePadding(t),{hard:!0}).split("\n"):t.text.split("\n"),t.border&&(s.unshift("."+"-".repeat(this.negatePadding(t)+2)+"."),s.push("'"+"-".repeat(this.negatePadding(t)+2)+"'")),t.padding&&(s.unshift(...new Array(t.padding[0]||0).fill("")),s.push(...new Array(t.padding[2]||0).fill(""))),s.forEach(((t,n)=>{e[n]||e.push([]);const s=e[n];for(let t=0;t<i;t++)void 0===s[t]&&s.push("");s.push(t)}))})),e}negatePadding(t){let e=t.width||0;return t.padding&&(e-=(t.padding[c]||0)+(t.padding[o]||0)),t.border&&(e-=4),e}columnWidths(t){if(!this.wrap)return t.map((t=>t.width||u.stringWidth(t.text)));let e=t.length,n=this.width;const s=t.map((t=>{if(t.width)return e--,n-=t.width,t.width})),i=e?Math.floor(n/e):0;return s.map(((e,n)=>void 0===e?Math.max(i,function(t){const e=t.padding||[],n=1+(e[c]||0)+(e[o]||0);if(t.border)return n+4;return n}(t[n])):e))}}function h(t,e,n){return t.border?/[.']-+[.']/.test(e)?"":0!==e.trim().length?n:" ":""}let u;const d=new RegExp("\x1b(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)","g");function f(t){return t.replace(d,"")}function p(t,e){const[n,s]=t.match(d)||["",""];t=f(t);let i="";for(let n=0;n<t.length;n++)0!==n&&n%e==0&&(i+="\n"),i+=t.charAt(n);return n&&s&&(i=`${n}${i}${s}`),i}var m=a(71017);var g=a(73837);const y=t(import.meta.url)("url");function b(t){if(t!==t.toLowerCase()&&t!==t.toUpperCase()||(t=t.toLowerCase()),-1===t.indexOf("-")&&-1===t.indexOf("_"))return t;{let e="",n=!1;const s=t.match(/^-+/);for(let i=s?s[0].length:0;i<t.length;i++){let s=t.charAt(i);n&&(n=!1,s=s.toUpperCase()),0===i||"-"!==s&&"_"!==s?"-"!==s&&"_"!==s&&(e+=s):n=!0}return e}}function v(t,e){const n=t.toLowerCase();e=e||"-";let s="";for(let i=0;i<t.length;i++){const r=n.charAt(i),o=t.charAt(i);s+=r!==o&&i>0?`${e}${n.charAt(i)}`:o}return s}function w(t){return null!=t&&("number"==typeof t||(!!/^0x[0-9a-f]+$/i.test(t)||!/^0[^.]/.test(t)&&/^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(t)))}var O;let x;!function(t){t.BOOLEAN="boolean",t.STRING="string",t.NUMBER="number",t.ARRAY="array"}(O||(O={}));function E(t){return void 0!==t?t+1:1}function j(t){return"__proto__"===t?"___proto___":t}var S,C,_;const k=process&&process.env&&process.env.YARGS_MIN_NODE_VERSION?Number(process.env.YARGS_MIN_NODE_VERSION):12,A=null!==(C=null===(S=null===process||void 0===process?void 0:process.versions)||void 0===S?void 0:S.node)&&void 0!==C?C:null===(_=null===process||void 0===process?void 0:process.version)||void 0===_?void 0:_.slice(1);if(A){if(Number(A.match(/^([^.]+)/)[1])<k)throw Error(`yargs parser supports a minimum Node.js version of ${k}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`)}const P=process?process.env:{},$=new class{constructor(t){x=t}parse(t,e){const n=Object.assign({alias:void 0,array:void 0,boolean:void 0,config:void 0,configObjects:void 0,configuration:void 0,coerce:void 0,count:void 0,default:void 0,envPrefix:void 0,narg:void 0,normalize:void 0,string:void 0,number:void 0,__:void 0,key:void 0},e),s=function(t){if(Array.isArray(t))return t.map((t=>"string"!=typeof t?t+"":t));t=t.trim();let e=0,n=null,s=null,i=null;const r=[];for(let o=0;o<t.length;o++)n=s,s=t.charAt(o)," "!==s||i?(s===i?i=null:"'"!==s&&'"'!==s||i||(i=s),r[e]||(r[e]=""),r[e]+=s):" "!==n&&e++;return r}(t),i="string"==typeof t,r=function(t){const e=[],n=Object.create(null);let s=!0;Object.keys(t).forEach((function(n){e.push([].concat(t[n],n))}));for(;s;){s=!1;for(let t=0;t<e.length;t++)for(let n=t+1;n<e.length;n++){if(e[t].filter((function(t){return-1!==e[n].indexOf(t)})).length){e[t]=e[t].concat(e[n]),e.splice(n,1),s=!0;break}}}return e.forEach((function(t){const e=(t=t.filter((function(t,e,n){return n.indexOf(t)===e}))).pop();void 0!==e&&"string"==typeof e&&(n[e]=t)})),n}(Object.assign(Object.create(null),n.alias)),o=Object.assign({"boolean-negation":!0,"camel-case-expansion":!0,"combine-arrays":!1,"dot-notation":!0,"duplicate-arguments-array":!0,"flatten-duplicate-arrays":!0,"greedy-arrays":!0,"halt-at-non-option":!1,"nargs-eats-options":!1,"negation-prefix":"no-","parse-numbers":!0,"parse-positional-numbers":!0,"populate--":!1,"set-placeholder-key":!1,"short-option-groups":!0,"strip-aliased":!1,"strip-dashed":!1,"unknown-options-as-args":!1},n.configuration),a=Object.assign(Object.create(null),n.default),c=n.configObjects||[],l=n.envPrefix,h=o["populate--"],u=h?"--":"_",d=Object.create(null),f=Object.create(null),p=n.__||x.format,m={aliases:Object.create(null),arrays:Object.create(null),bools:Object.create(null),strings:Object.create(null),numbers:Object.create(null),counts:Object.create(null),normalize:Object.create(null),configs:Object.create(null),nargs:Object.create(null),coercions:Object.create(null),keys:[]},g=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/,y=new RegExp("^--"+o["negation-prefix"]+"(.+)");[].concat(n.array||[]).filter(Boolean).forEach((function(t){const e="object"==typeof t?t.key:t,n=Object.keys(t).map((function(t){return{boolean:"bools",string:"strings",number:"numbers"}[t]})).filter(Boolean).pop();n&&(m[n][e]=!0),m.arrays[e]=!0,m.keys.push(e)})),[].concat(n.boolean||[]).filter(Boolean).forEach((function(t){m.bools[t]=!0,m.keys.push(t)})),[].concat(n.string||[]).filter(Boolean).forEach((function(t){m.strings[t]=!0,m.keys.push(t)})),[].concat(n.number||[]).filter(Boolean).forEach((function(t){m.numbers[t]=!0,m.keys.push(t)})),[].concat(n.count||[]).filter(Boolean).forEach((function(t){m.counts[t]=!0,m.keys.push(t)})),[].concat(n.normalize||[]).filter(Boolean).forEach((function(t){m.normalize[t]=!0,m.keys.push(t)})),"object"==typeof n.narg&&Object.entries(n.narg).forEach((([t,e])=>{"number"==typeof e&&(m.nargs[t]=e,m.keys.push(t))})),"object"==typeof n.coerce&&Object.entries(n.coerce).forEach((([t,e])=>{"function"==typeof e&&(m.coercions[t]=e,m.keys.push(t))})),void 0!==n.config&&(Array.isArray(n.config)||"string"==typeof n.config?[].concat(n.config).filter(Boolean).forEach((function(t){m.configs[t]=!0})):"object"==typeof n.config&&Object.entries(n.config).forEach((([t,e])=>{"boolean"!=typeof e&&"function"!=typeof e||(m.configs[t]=e)}))),function(...t){t.forEach((function(t){Object.keys(t||{}).forEach((function(t){m.aliases[t]||(m.aliases[t]=[].concat(r[t]||[]),m.aliases[t].concat(t).forEach((function(e){if(/-/.test(e)&&o["camel-case-expansion"]){const n=b(e);n!==t&&-1===m.aliases[t].indexOf(n)&&(m.aliases[t].push(n),d[n]=!0)}})),m.aliases[t].concat(t).forEach((function(e){if(e.length>1&&/[A-Z]/.test(e)&&o["camel-case-expansion"]){const n=v(e,"-");n!==t&&-1===m.aliases[t].indexOf(n)&&(m.aliases[t].push(n),d[n]=!0)}})),m.aliases[t].forEach((function(e){m.aliases[e]=[t].concat(m.aliases[t].filter((function(t){return e!==t})))})))}))}))}(n.key,r,n.default,m.arrays),Object.keys(a).forEach((function(t){(m.aliases[t]||[]).forEach((function(e){a[e]=a[t]}))}));let S=null;Object.keys(m.counts).find((t=>R(t,m.arrays)?(S=Error(p("Invalid configuration: %s, opts.count excludes opts.array.",t)),!0):!!R(t,m.nargs)&&(S=Error(p("Invalid configuration: %s, opts.count excludes opts.narg.",t)),!0)));let C=[];const _=Object.assign(Object.create(null),{_:[]}),k={};for(let t=0;t<s.length;t++){const e=s[t],n=e.replace(/^-{3,}/,"---");let i,r,a,c,l,h;if("--"!==e&&/^-/.test(e)&&B(e))A(e);else{if(n.match(/^---+(=|$)/)){A(e);continue}if(e.match(/^--.+=/)||!o["short-option-groups"]&&e.match(/^-.+=/))c=e.match(/^--?([^=]+)=([\s\S]*)$/),null!==c&&Array.isArray(c)&&c.length>=3&&(R(c[1],m.arrays)?t=$(t,c[1],s,c[2]):!1!==R(c[1],m.nargs)?t=P(t,c[1],s,c[2]):M(c[1],c[2],!0));else if(e.match(y)&&o["boolean-negation"])c=e.match(y),null!==c&&Array.isArray(c)&&c.length>=2&&(r=c[1],M(r,!!R(r,m.arrays)&&[!1]));else if(e.match(/^--.+/)||!o["short-option-groups"]&&e.match(/^-[^-]+/))c=e.match(/^--?(.+)/),null!==c&&Array.isArray(c)&&c.length>=2&&(r=c[1],R(r,m.arrays)?t=$(t,r,s):!1!==R(r,m.nargs)?t=P(t,r,s):(l=s[t+1],void 0===l||l.match(/^-/)&&!l.match(g)||R(r,m.bools)||R(r,m.counts)?/^(true|false)$/.test(l)?(M(r,l),t++):M(r,H(r)):(M(r,l),t++)));else if(e.match(/^-.\..+=/))c=e.match(/^-([^=]+)=([\s\S]*)$/),null!==c&&Array.isArray(c)&&c.length>=3&&M(c[1],c[2]);else if(e.match(/^-.\..+/)&&!e.match(g))l=s[t+1],c=e.match(/^-(.\..+)/),null!==c&&Array.isArray(c)&&c.length>=2&&(r=c[1],void 0===l||l.match(/^-/)||R(r,m.bools)||R(r,m.counts)?M(r,H(r)):(M(r,l),t++));else if(e.match(/^-[^-]+/)&&!e.match(g)){a=e.slice(1,-1).split(""),i=!1;for(let n=0;n<a.length;n++){if(l=e.slice(n+2),a[n+1]&&"="===a[n+1]){h=e.slice(n+3),r=a[n],R(r,m.arrays)?t=$(t,r,s,h):!1!==R(r,m.nargs)?t=P(t,r,s,h):M(r,h),i=!0;break}if("-"!==l){if(/[A-Za-z]/.test(a[n])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(l)&&!1===R(l,m.bools)){M(a[n],l),i=!0;break}if(a[n+1]&&a[n+1].match(/\W/)){M(a[n],l),i=!0;break}M(a[n],H(a[n]))}else M(a[n],l)}r=e.slice(-1)[0],i||"-"===r||(R(r,m.arrays)?t=$(t,r,s):!1!==R(r,m.nargs)?t=P(t,r,s):(l=s[t+1],void 0===l||/^(-|--)[^-]/.test(l)&&!l.match(g)||R(r,m.bools)||R(r,m.counts)?/^(true|false)$/.test(l)?(M(r,l),t++):M(r,H(r)):(M(r,l),t++)))}else if(e.match(/^-[0-9]$/)&&e.match(g)&&R(e.slice(1),m.bools))r=e.slice(1),M(r,H(r));else{if("--"===e){C=s.slice(t+1);break}if(o["halt-at-non-option"]){C=s.slice(t);break}A(e)}}}function A(t){const e=N("_",t);"string"!=typeof e&&"number"!=typeof e||_._.push(e)}function P(t,e,n,s){let i,r=R(e,m.nargs);if(r="number"!=typeof r||isNaN(r)?1:r,0===r)return z(s)||(S=Error(p("Argument unexpected for: %s",e))),M(e,H(e)),t;let a=z(s)?0:1;if(o["nargs-eats-options"])n.length-(t+1)+a<r&&(S=Error(p("Not enough arguments following: %s",e))),a=r;else{for(i=t+1;i<n.length&&(!n[i].match(/^-[^0-9]/)||n[i].match(g)||B(n[i]));i++)a++;a<r&&(S=Error(p("Not enough arguments following: %s",e)))}let c=Math.min(a,r);for(!z(s)&&c>0&&(M(e,s),c--),i=t+1;i<c+t+1;i++)M(e,n[i]);return t+c}function $(t,e,n,s){let r=[],c=s||n[t+1];const l=R(e,m.nargs);if(R(e,m.bools)&&!/^(true|false)$/.test(c))r.push(!0);else if(z(c)||z(s)&&/^-/.test(c)&&!g.test(c)&&!B(c)){if(void 0!==a[e]){const t=a[e];r=Array.isArray(t)?t:[t]}}else{z(s)||r.push(T(e,s,!0));for(let s=t+1;s<n.length&&!(!o["greedy-arrays"]&&r.length>0||l&&"number"==typeof l&&r.length>=l)&&(c=n[s],!/^-/.test(c)||g.test(c)||B(c));s++)t=s,r.push(T(e,c,i))}return"number"==typeof l&&(l&&r.length<l||isNaN(l)&&0===r.length)&&(S=Error(p("Not enough arguments following: %s",e))),M(e,r),t}function M(t,e,n=i){if(/-/.test(t)&&o["camel-case-expansion"]){const e=t.split(".").map((function(t){return b(t)})).join(".");I(t,e)}const s=T(t,e,n),r=t.split(".");if(W(_,r,s),m.aliases[t]&&m.aliases[t].forEach((function(t){const e=t.split(".");W(_,e,s)})),r.length>1&&o["dot-notation"]&&(m.aliases[r[0]]||[]).forEach((function(e){let n=e.split(".");const i=[].concat(r);i.shift(),n=n.concat(i),(m.aliases[t]||[]).includes(n.join("."))||W(_,n,s)})),R(t,m.normalize)&&!R(t,m.arrays)){[t].concat(m.aliases[t]||[]).forEach((function(t){Object.defineProperty(k,t,{enumerable:!0,get:()=>e,set(t){e="string"==typeof t?x.normalize(t):t}})}))}}function I(t,e){m.aliases[t]&&m.aliases[t].length||(m.aliases[t]=[e],d[e]=!0),m.aliases[e]&&m.aliases[e].length||I(e,t)}function T(t,e,n){n&&(e=function(t){return"string"!=typeof t||"'"!==t[0]&&'"'!==t[0]||t[t.length-1]!==t[0]?t:t.substring(1,t.length-1)}(e)),(R(t,m.bools)||R(t,m.counts))&&"string"==typeof e&&(e="true"===e);let s=Array.isArray(e)?e.map((function(e){return N(t,e)})):N(t,e);return R(t,m.counts)&&(z(s)||"boolean"==typeof s)&&(s=E()),R(t,m.normalize)&&R(t,m.arrays)&&(s=Array.isArray(e)?e.map((t=>x.normalize(t))):x.normalize(e)),s}function N(t,e){if(!o["parse-positional-numbers"]&&"_"===t)return e;if(!R(t,m.strings)&&!R(t,m.bools)&&!Array.isArray(e)){(w(e)&&o["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${e}`)))||!z(e)&&R(t,m.numbers))&&(e=Number(e))}return e}function L(t,e){Object.keys(t).forEach((function(n){const s=t[n],i=e?e+"."+n:n;"object"==typeof s&&null!==s&&!Array.isArray(s)&&o["dot-notation"]?L(s,i):(!D(_,i.split("."))||R(i,m.arrays)&&o["combine-arrays"])&&M(i,s)}))}function F(t,e){if(void 0===l)return;const n="string"==typeof l?l:"",s=x.env();Object.keys(s).forEach((function(i){if(""===n||0===i.lastIndexOf(n,0)){const r=i.split("__").map((function(t,e){return 0===e&&(t=t.substring(n.length)),b(t)}));(e&&m.configs[r.join(".")]||!e)&&!D(t,r)&&M(r.join("."),s[i])}}))}function G(t,e,n,s=!1){Object.keys(n).forEach((function(i){D(t,i.split("."))||(W(t,i.split("."),n[i]),s&&(f[i]=!0),(e[i]||[]).forEach((function(e){D(t,e.split("."))||W(t,e.split("."),n[i])})))}))}function D(t,e){let n=t;o["dot-notation"]||(e=[e.join(".")]),e.slice(0,-1).forEach((function(t){n=n[t]||{}}));const s=e[e.length-1];return"object"==typeof n&&s in n}function W(t,e,n){let s=t;o["dot-notation"]||(e=[e.join(".")]),e.slice(0,-1).forEach((function(t){t=j(t),"object"==typeof s&&void 0===s[t]&&(s[t]={}),"object"!=typeof s[t]||Array.isArray(s[t])?(Array.isArray(s[t])?s[t].push({}):s[t]=[s[t],{}],s=s[t][s[t].length-1]):s=s[t]}));const i=j(e[e.length-1]),r=R(e.join("."),m.arrays),a=Array.isArray(n);let c=o["duplicate-arguments-array"];!c&&R(i,m.nargs)&&(c=!0,(!z(s[i])&&1===m.nargs[i]||Array.isArray(s[i])&&s[i].length===m.nargs[i])&&(s[i]=void 0)),n===E()?s[i]=E(s[i]):Array.isArray(s[i])?c&&r&&a?s[i]=o["flatten-duplicate-arrays"]?s[i].concat(n):(Array.isArray(s[i][0])?s[i]:[s[i]]).concat([n]):c||Boolean(r)!==Boolean(a)?s[i]=s[i].concat([n]):s[i]=n:void 0===s[i]&&r?s[i]=a?n:[n]:!c||void 0===s[i]||R(i,m.counts)||R(i,m.bools)?s[i]=n:s[i]=[s[i],n]}function R(t,e){const n=[].concat(m.aliases[t]||[],t),s=Object.keys(e),i=n.find((t=>s.includes(t)));return!!i&&e[i]}function U(t){const e=Object.keys(m);return[].concat(e.map((t=>m[t]))).some((function(e){return Array.isArray(e)?e.includes(t):e[t]}))}function B(t){return o["unknown-options-as-args"]&&function(t){if(t=t.replace(/^-{3,}/,"--"),t.match(g))return!1;if(function(t){if(t.match(g)||!t.match(/^-[^-]+/))return!1;let e,n=!0;const s=t.slice(1).split("");for(let i=0;i<s.length;i++){if(e=t.slice(i+2),!U(s[i])){n=!1;break}if(s[i+1]&&"="===s[i+1]||"-"===e||/[A-Za-z]/.test(s[i])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(e)||s[i+1]&&s[i+1].match(/\W/))break}return n}(t))return!1;return!function(t,...e){return[].concat(...e).some((function(e){const n=t.match(e);return n&&U(n[1])}))}(t,/^-+([^=]+?)=[\s\S]*$/,y,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}(t)}function H(t){return R(t,m.bools)||R(t,m.counts)||!(`${t}`in a)?(e=function(t){let e=O.BOOLEAN;return R(t,m.strings)?e=O.STRING:R(t,m.numbers)?e=O.NUMBER:R(t,m.bools)?e=O.BOOLEAN:R(t,m.arrays)&&(e=O.ARRAY),e}(t),{[O.BOOLEAN]:!0,[O.STRING]:"",[O.NUMBER]:void 0,[O.ARRAY]:[]}[e]):a[t];var e}function z(t){return void 0===t}return F(_,!0),F(_,!1),function(t){const e=Object.create(null);G(e,m.aliases,a),Object.keys(m.configs).forEach((function(n){const s=t[n]||e[n];if(s)try{let t=null;const e=x.resolve(x.cwd(),s),i=m.configs[n];if("function"==typeof i){try{t=i(e)}catch(e){t=e}if(t instanceof Error)return void(S=t)}else t=x.require(e);L(t)}catch(e){"PermissionDenied"===e.name?S=e:t[n]&&(S=Error(p("Invalid JSON config file: %s",s)))}}))}(_),void 0!==c&&c.forEach((function(t){L(t)})),G(_,m.aliases,a,!0),function(t){let e;const n=new Set;Object.keys(t).forEach((function(s){if(!n.has(s)&&(e=R(s,m.coercions),"function"==typeof e))try{const i=N(s,e(t[s]));[].concat(m.aliases[s]||[],s).forEach((e=>{n.add(e),t[e]=i}))}catch(t){S=t}}))}(_),o["set-placeholder-key"]&&function(t){m.keys.forEach((e=>{~e.indexOf(".")||void 0===t[e]&&(t[e]=void 0)}))}(_),Object.keys(m.counts).forEach((function(t){D(_,t.split("."))||M(t,0)})),h&&C.length&&(_[u]=[]),C.forEach((function(t){_[u].push(t)})),o["camel-case-expansion"]&&o["strip-dashed"]&&Object.keys(_).filter((t=>"--"!==t&&t.includes("-"))).forEach((t=>{delete _[t]})),o["strip-aliased"]&&[].concat(...Object.keys(r).map((t=>r[t]))).forEach((t=>{o["camel-case-expansion"]&&t.includes("-")&&delete _[t.split(".").map((t=>b(t))).join(".")],delete _[t]})),{aliases:Object.assign({},m.aliases),argv:Object.assign(k,_),configuration:o,defaulted:Object.assign({},f),error:S,newAliases:Object.assign({},d)}}}({cwd:process.cwd,env:()=>P,format:g.format,normalize:m.normalize,resolve:m.resolve,require:t=>{if("undefined"!=typeof require)return require(t);if(t.match(/\.json$/))return JSON.parse((0,s.readFileSync)(t,"utf8"));throw Error("only .json config files are supported in ESM")}}),M=function(t,e){return $.parse(t.slice(),e).argv};M.detailed=function(t,e){return $.parse(t.slice(),e)},M.camelCase=b,M.decamelize=v,M.looksLikeNumber=w;const I=M;function T(){return process.versions.electron&&!process.defaultApp?0:1}class N extends Error{constructor(t){super(t||"yargs error"),this.name="YError",Error.captureStackTrace&&Error.captureStackTrace(this,N)}}const L={fs:{readFileSync:s.readFileSync,writeFile:s.writeFile},format:g.format,resolve:m.resolve,exists:t=>{try{return(0,s.statSync)(t).isFile()}catch(t){return!1}}};let F;class G{constructor(t){t=t||{},this.directory=t.directory||"./locales",this.updateFiles="boolean"!=typeof t.updateFiles||t.updateFiles,this.locale=t.locale||"en",this.fallbackToLanguage="boolean"!=typeof t.fallbackToLanguage||t.fallbackToLanguage,this.cache=Object.create(null),this.writeQueue=[]}__(...t){if("string"!=typeof arguments[0])return this._taggedLiteral(arguments[0],...arguments);const e=t.shift();let n=function(){};return"function"==typeof t[t.length-1]&&(n=t.pop()),n=n||function(){},this.cache[this.locale]||this._readLocaleFile(),!this.cache[this.locale][e]&&this.updateFiles?(this.cache[this.locale][e]=e,this._enqueueWrite({directory:this.directory,locale:this.locale,cb:n})):n(),F.format.apply(F.format,[this.cache[this.locale][e]||e].concat(t))}__n(){const t=Array.prototype.slice.call(arguments),e=t.shift(),n=t.shift(),s=t.shift();let i=function(){};"function"==typeof t[t.length-1]&&(i=t.pop()),this.cache[this.locale]||this._readLocaleFile();let r=1===s?e:n;if(this.cache[this.locale][e]){r=this.cache[this.locale][e][1===s?"one":"other"]}!this.cache[this.locale][e]&&this.updateFiles?(this.cache[this.locale][e]={one:e,other:n},this._enqueueWrite({directory:this.directory,locale:this.locale,cb:i})):i();const o=[r];return~r.indexOf("%d")&&o.push(s),F.format.apply(F.format,o.concat(t))}setLocale(t){this.locale=t}getLocale(){return this.locale}updateLocale(t){this.cache[this.locale]||this._readLocaleFile();for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&(this.cache[this.locale][e]=t[e])}_taggedLiteral(t,...e){let n="";return t.forEach((function(t,s){const i=e[s+1];n+=t,void 0!==i&&(n+="%s")})),this.__.apply(this,[n].concat([].slice.call(e,1)))}_enqueueWrite(t){this.writeQueue.push(t),1===this.writeQueue.length&&this._processWriteQueue()}_processWriteQueue(){const t=this,e=this.writeQueue[0],n=e.directory,s=e.locale,i=e.cb,r=this._resolveLocaleFile(n,s),o=JSON.stringify(this.cache[s],null,2);F.fs.writeFile(r,o,"utf-8",(function(e){t.writeQueue.shift(),t.writeQueue.length>0&&t._processWriteQueue(),i(e)}))}_readLocaleFile(){let t={};const e=this._resolveLocaleFile(this.directory,this.locale);try{F.fs.readFileSync&&(t=JSON.parse(F.fs.readFileSync(e,"utf-8")))}catch(n){if(n instanceof SyntaxError&&(n.message="syntax error in "+e),"ENOENT"!==n.code)throw n;t={}}this.cache[this.locale]=t}_resolveLocaleFile(t,e){let n=F.resolve(t,"./",e+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(n)&&~e.lastIndexOf("_")){const s=F.resolve(t,"./",e.split("_")[0]+".json");this._fileExistsSync(s)&&(n=s)}return n}_fileExistsSync(t){return F.exists(t)}}const D=t=>function(t,e){F=e;const n=new G(t);return{__:n.__.bind(n),__n:n.__n.bind(n),setLocale:n.setLocale.bind(n),getLocale:n.getLocale.bind(n),updateLocale:n.updateLocale.bind(n),locale:n.locale}}(t,L),W="loading a directory of commands is not supported yet for ESM";let R;try{R=(0,y.fileURLToPath)(import.meta.url)}catch(t){R=process.cwd()}const U=R.substring(0,R.lastIndexOf("node_modules")),B={assert:{notStrictEqual:i.notStrictEqual,strictEqual:i.strictEqual},cliui:function(t){return function(t,e){return u=e,new l({width:(null==t?void 0:t.width)||("object"==typeof process&&process.stdout&&process.stdout.columns?process.stdout.columns:80),wrap:null==t?void 0:t.wrap})}(t,{stringWidth:t=>[...t].length,stripAnsi:f,wrap:p})},findUp:function(t,e){let n,i=(0,m.resolve)(".",t);for((0,s.statSync)(i).isDirectory()||(i=(0,m.dirname)(i));;){if(n=e(i,(0,s.readdirSync)(i)),n)return(0,m.resolve)(i,n);if(i=(0,m.dirname)(n=i),n===i)break}},getEnv:t=>process.env[t],inspect:g.inspect,getCallerFile:()=>{throw new N(W)},getProcessArgvBin:function(){return process.argv[T()]},mainFilename:U||process.cwd(),Parser:I,path:{basename:m.basename,dirname:m.dirname,extname:m.extname,relative:m.relative,resolve:m.resolve},process:{argv:()=>process.argv,cwd:process.cwd,emitWarning:(t,e)=>process.emitWarning(t,e),execPath:()=>process.execPath,exit:process.exit,nextTick:process.nextTick,stdColumns:void 0!==process.stdout.columns?process.stdout.columns:null},readFileSync:s.readFileSync,require:()=>{throw new N("require is not supported by ESM")},requireDirectory:()=>{throw new N(W)},stringWidth:t=>[...t].length,y18n:D({directory:(0,m.resolve)(R,"../../../locales"),updateFiles:!1})};function H(t,e,n,s){n.assert.notStrictEqual(t,e,s)}function z(t,e){e.assert.strictEqual(typeof t,"string")}function q(t){return Object.keys(t)}function V(t){return!!t&&!!t.then&&"function"==typeof t.then}function K(t){const e=t.replace(/\s{2,}/g," ").split(/\s+(?![^[]*]|[^<]*>)/),n=/\.*[\][<>]/g,s=e.shift();if(!s)throw new Error(`No command found in: ${t}`);const i={cmd:s.replace(n,""),demanded:[],optional:[]};return e.forEach(((t,s)=>{let r=!1;t=t.replace(/\s/g,""),/\.+[\]>]/.test(t)&&s===e.length-1&&(r=!0),/^\[/.test(t)?i.optional.push({cmd:t.replace(n,"").split("|"),variadic:r}):i.demanded.push({cmd:t.replace(n,"").split("|"),variadic:r})})),i}const Y=["first","second","third","fourth","fifth","sixth"];function J(t,e,n){try{let s=0;const[i,r,o]="object"==typeof t?[{demanded:[],optional:[]},t,e]:[K(`cmd ${t}`),e,n],a=[].slice.call(r);for(;a.length&&void 0===a[a.length-1];)a.pop();const c=o||a.length;if(c<i.demanded.length)throw new N(`Not enough arguments provided. Expected ${i.demanded.length} but received ${a.length}.`);const l=i.demanded.length+i.optional.length;if(c>l)throw new N(`Too many arguments provided. Expected max ${l} but received ${c}.`);i.demanded.forEach((t=>{const e=Q(a.shift());0===t.cmd.filter((t=>t===e||"*"===t)).length&&X(e,t.cmd,s),s+=1})),i.optional.forEach((t=>{if(0===a.length)return;const e=Q(a.shift());0===t.cmd.filter((t=>t===e||"*"===t)).length&&X(e,t.cmd,s),s+=1}))}catch(t){console.warn(t.stack)}}function Q(t){return Array.isArray(t)?"array":null===t?"null":typeof t}function X(t,e,n){throw new N(`Invalid ${Y[n]||"manyith"} argument. Expected ${e.join(" or ")} but received ${t}.`)}class Z{constructor(t){this.globalMiddleware=[],this.frozens=[],this.yargs=t}addMiddleware(t,e,n=!0,s=!1){if(J("<array|function> [boolean] [boolean] [boolean]",[t,e,n],arguments.length),Array.isArray(t)){for(let s=0;s<t.length;s++){if("function"!=typeof t[s])throw Error("middleware must be a function");const i=t[s];i.applyBeforeValidation=e,i.global=n}Array.prototype.push.apply(this.globalMiddleware,t)}else if("function"==typeof t){const i=t;i.applyBeforeValidation=e,i.global=n,i.mutates=s,this.globalMiddleware.push(t)}return this.yargs}addCoerceMiddleware(t,e){const n=this.yargs.getAliases();return this.globalMiddleware=this.globalMiddleware.filter((t=>{const s=[...n[e]||[],e];return!t.option||!s.includes(t.option)})),t.option=e,this.addMiddleware(t,!0,!0,!0)}getMiddleware(){return this.globalMiddleware}freeze(){this.frozens.push([...this.globalMiddleware])}unfreeze(){const t=this.frozens.pop();void 0!==t&&(this.globalMiddleware=t)}reset(){this.globalMiddleware=this.globalMiddleware.filter((t=>t.global))}}function tt(t,e,n,s){return n.reduce(((t,n)=>{if(n.applyBeforeValidation!==s)return t;if(n.mutates){if(n.applied)return t;n.applied=!0}if(V(t))return t.then((t=>Promise.all([t,n(t,e)]))).then((([t,e])=>Object.assign(t,e)));{const s=n(t,e);return V(s)?s.then((e=>Object.assign(t,e))):Object.assign(t,s)}}),t)}function et(t,e,n=(t=>{throw t})){try{const n="function"==typeof t?t():t;return V(n)?n.then((t=>e(t))):e(n)}catch(t){return n(t)}}const nt=/(^\*)|(^\$0)/;class st{constructor(t,e,n,s){this.requireCache=new Set,this.handlers={},this.aliasMap={},this.frozens=[],this.shim=s,this.usage=t,this.globalMiddleware=n,this.validation=e}addDirectory(t,e,n,s){"boolean"!=typeof(s=s||{}).recurse&&(s.recurse=!1),Array.isArray(s.extensions)||(s.extensions=["js"]);const i="function"==typeof s.visit?s.visit:t=>t;s.visit=(t,e,n)=>{const s=i(t,e,n);if(s){if(this.requireCache.has(e))return s;this.requireCache.add(e),this.addHandler(s)}return s},this.shim.requireDirectory({require:e,filename:n},t,s)}addHandler(t,e,n,s,i,r){let o=[];const a=function(t){return t?t.map((t=>(t.applyBeforeValidation=!1,t))):[]}(i);if(s=s||(()=>{}),Array.isArray(t))if(function(t){return t.every((t=>"string"==typeof t))}(t))[t,...o]=t;else for(const e of t)this.addHandler(e);else{if(function(t){return"object"==typeof t&&!Array.isArray(t)}(t)){let e=Array.isArray(t.command)||"string"==typeof t.command?t.command:this.moduleName(t);return t.aliases&&(e=[].concat(e).concat(t.aliases)),void this.addHandler(e,this.extractDesc(t),t.builder,t.handler,t.middlewares,t.deprecated)}if(it(n))return void this.addHandler([t].concat(o),e,n.builder,n.handler,n.middlewares,n.deprecated)}if("string"==typeof t){const i=K(t);o=o.map((t=>K(t).cmd));let c=!1;const l=[i.cmd].concat(o).filter((t=>!nt.test(t)||(c=!0,!1)));0===l.length&&c&&l.push("$0"),c&&(i.cmd=l[0],o=l.slice(1),t=t.replace(nt,i.cmd)),o.forEach((t=>{this.aliasMap[t]=i.cmd})),!1!==e&&this.usage.command(t,e,c,o,r),this.handlers[i.cmd]={original:t,description:e,handler:s,builder:n||{},middlewares:a,deprecated:r,demanded:i.demanded,optional:i.optional},c&&(this.defaultCommand=this.handlers[i.cmd])}}getCommandHandlers(){return this.handlers}getCommands(){return Object.keys(this.handlers).concat(Object.keys(this.aliasMap))}hasDefaultCommand(){return!!this.defaultCommand}runCommand(t,e,n,s,i,r){const o=this.handlers[t]||this.handlers[this.aliasMap[t]]||this.defaultCommand,a=e.getInternalMethods().getContext(),c=a.commands.slice(),l=!t;t&&(a.commands.push(t),a.fullCommands.push(o.original));const h=this.applyBuilderUpdateUsageAndParse(l,o,e,n.aliases,c,s,i,r);return V(h)?h.then((t=>this.applyMiddlewareAndGetResult(l,o,t.innerArgv,a,i,t.aliases,e))):this.applyMiddlewareAndGetResult(l,o,h.innerArgv,a,i,h.aliases,e)}applyBuilderUpdateUsageAndParse(t,e,n,s,i,r,o,a){const c=e.builder;let l=n;if(rt(c)){const h=c(n.getInternalMethods().reset(s),a);if(V(h))return h.then((s=>{var a;return l=(a=s)&&"function"==typeof a.getInternalMethods?s:n,this.parseAndUpdateUsage(t,e,l,i,r,o)}))}else(function(t){return"object"==typeof t})(c)&&(l=n.getInternalMethods().reset(s),Object.keys(e.builder).forEach((t=>{l.option(t,c[t])})));return this.parseAndUpdateUsage(t,e,l,i,r,o)}parseAndUpdateUsage(t,e,n,s,i,r){t&&n.getInternalMethods().getUsageInstance().unfreeze(!0),this.shouldUpdateUsage(n)&&n.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(s,e),e.description);const o=n.getInternalMethods().runYargsParserAndExecuteCommands(null,void 0,!0,i,r);return V(o)?o.then((t=>({aliases:n.parsed.aliases,innerArgv:t}))):{aliases:n.parsed.aliases,innerArgv:o}}shouldUpdateUsage(t){return!t.getInternalMethods().getUsageInstance().getUsageDisabled()&&0===t.getInternalMethods().getUsageInstance().getUsage().length}usageFromParentCommandsCommandHandler(t,e){const n=nt.test(e.original)?e.original.replace(nt,"").trim():e.original,s=t.filter((t=>!nt.test(t)));return s.push(n),`$0 ${s.join(" ")}`}handleValidationAndGetResult(t,e,n,s,i,r,o,a){if(!r.getInternalMethods().getHasOutput()){const e=r.getInternalMethods().runValidation(i,a,r.parsed.error,t);n=et(n,(t=>(e(t),t)))}if(e.handler&&!r.getInternalMethods().getHasOutput()){r.getInternalMethods().setHasOutput();const s=!!r.getOptions().configuration["populate--"];r.getInternalMethods().postProcess(n,s,!1,!1),n=et(n=tt(n,r,o,!1),(t=>{const n=e.handler(t);return V(n)?n.then((()=>t)):t})),t||r.getInternalMethods().getUsageInstance().cacheHelpMessage(),V(n)&&!r.getInternalMethods().hasParseCallback()&&n.catch((t=>{try{r.getInternalMethods().getUsageInstance().fail(null,t)}catch(t){}}))}return t||(s.commands.pop(),s.fullCommands.pop()),n}applyMiddlewareAndGetResult(t,e,n,s,i,r,o){let a={};if(i)return n;o.getInternalMethods().getHasOutput()||(a=this.populatePositionals(e,n,s,o));const c=this.globalMiddleware.getMiddleware().slice(0).concat(e.middlewares),l=tt(n,o,c,!0);return V(l)?l.then((n=>this.handleValidationAndGetResult(t,e,n,s,r,o,c,a))):this.handleValidationAndGetResult(t,e,l,s,r,o,c,a)}populatePositionals(t,e,n,s){e._=e._.slice(n.commands.length);const i=t.demanded.slice(0),r=t.optional.slice(0),o={};for(this.validation.positionalCount(i.length,e._.length);i.length;){const t=i.shift();this.populatePositional(t,e,o)}for(;r.length;){const t=r.shift();this.populatePositional(t,e,o)}return e._=n.commands.concat(e._.map((t=>""+t))),this.postProcessPositionals(e,o,this.cmdToParseOptions(t.original),s),o}populatePositional(t,e,n){const s=t.cmd[0];t.variadic?n[s]=e._.splice(0).map(String):e._.length&&(n[s]=[String(e._.shift())])}cmdToParseOptions(t){const e={array:[],default:{},alias:{},demand:{}},n=K(t);return n.demanded.forEach((t=>{const[n,...s]=t.cmd;t.variadic&&(e.array.push(n),e.default[n]=[]),e.alias[n]=s,e.demand[n]=!0})),n.optional.forEach((t=>{const[n,...s]=t.cmd;t.variadic&&(e.array.push(n),e.default[n]=[]),e.alias[n]=s})),e}postProcessPositionals(t,e,n,s){const i=Object.assign({},s.getOptions());i.default=Object.assign(n.default,i.default);for(const t of Object.keys(n.alias))i.alias[t]=(i.alias[t]||[]).concat(n.alias[t]);i.array=i.array.concat(n.array),i.config={};const r=[];if(Object.keys(e).forEach((t=>{e[t].map((e=>{i.configuration["unknown-options-as-args"]&&(i.key[t]=!0),r.push(`--${t}`),r.push(e)}))})),!r.length)return;const o=Object.assign({},i.configuration,{"populate--":!1}),a=this.shim.Parser.detailed(r,Object.assign({},i,{configuration:o}));if(a.error)s.getInternalMethods().getUsageInstance().fail(a.error.message,a.error);else{const n=Object.keys(e);Object.keys(e).forEach((t=>{n.push(...a.aliases[t])})),Object.keys(a.argv).forEach((i=>{n.includes(i)&&(e[i]||(e[i]=a.argv[i]),!this.isInConfigs(s,i)&&!this.isDefaulted(s,i)&&Object.prototype.hasOwnProperty.call(t,i)&&Object.prototype.hasOwnProperty.call(a.argv,i)&&(Array.isArray(t[i])||Array.isArray(a.argv[i]))?t[i]=[].concat(t[i],a.argv[i]):t[i]=a.argv[i])}))}}isDefaulted(t,e){const{default:n}=t.getOptions();return Object.prototype.hasOwnProperty.call(n,e)||Object.prototype.hasOwnProperty.call(n,this.shim.Parser.camelCase(e))}isInConfigs(t,e){const{configObjects:n}=t.getOptions();return n.some((t=>Object.prototype.hasOwnProperty.call(t,e)))||n.some((t=>Object.prototype.hasOwnProperty.call(t,this.shim.Parser.camelCase(e))))}runDefaultBuilderOn(t){if(!this.defaultCommand)return;if(this.shouldUpdateUsage(t)){const e=nt.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,"$0 ");t.getInternalMethods().getUsageInstance().usage(e,this.defaultCommand.description)}const e=this.defaultCommand.builder;if(rt(e))return e(t,!0);it(e)||Object.keys(e).forEach((n=>{t.option(n,e[n])}))}moduleName(t){const e=function(t){if("undefined"==typeof require)return null;for(let e,n=0,s=Object.keys(require.cache);n<s.length;n++)if(e=require.cache[s[n]],e.exports===t)return e;return null}(t);if(!e)throw new Error(`No command name given for module: ${this.shim.inspect(t)}`);return this.commandFromFilename(e.filename)}commandFromFilename(t){return this.shim.path.basename(t,this.shim.path.extname(t))}extractDesc({describe:t,description:e,desc:n}){for(const s of[t,e,n]){if("string"==typeof s||!1===s)return s;H(s,!0,this.shim)}return!1}freeze(){this.frozens.push({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand})}unfreeze(){const t=this.frozens.pop();H(t,void 0,this.shim),({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand}=t)}reset(){return this.handlers={},this.aliasMap={},this.defaultCommand=void 0,this.requireCache=new Set,this}}function it(t){return"object"==typeof t&&!!t.builder&&"function"==typeof t.handler}function rt(t){return"function"==typeof t}function ot(t={},e=(()=>!0)){const n={};return q(t).forEach((s=>{e(s,t[s])&&(n[s]=t[s])})),n}function at(t){"undefined"!=typeof process&&[process.stdout,process.stderr].forEach((e=>{const n=e;n._handle&&n.isTTY&&"function"==typeof n._handle.setBlocking&&n._handle.setBlocking(t)}))}function ct(t){return"boolean"==typeof t}function lt(t,e){const n=e.y18n.__,s={},i=[];s.failFn=function(t){i.push(t)};let r=null,o=null,a=!0;s.showHelpOnFail=function(e=!0,n){const[i,c]="string"==typeof e?[!0,e]:[e,n];return t.getInternalMethods().isGlobalContext()&&(o=c),r=c,a=i,s};let c=!1;s.fail=function(e,n){const l=t.getInternalMethods().getLoggerInstance();if(!i.length){if(t.getExitProcess()&&at(!0),!c){c=!0,a&&(t.showHelp("error"),l.error()),(e||n)&&l.error(e||n);const s=r||o;s&&((e||n)&&l.error(""),l.error(s))}if(n=n||new N(e),t.getExitProcess())return t.exit(1);if(t.getInternalMethods().hasParseCallback())return t.exit(1,n);throw n}for(let t=i.length-1;t>=0;--t){const r=i[t];if(ct(r)){if(n)throw n;if(e)throw Error(e)}else r(e,n,s)}};let l=[],h=!1;s.usage=(t,e)=>null===t?(h=!0,l=[],s):(h=!1,l.push([t,e||""]),s),s.getUsage=()=>l,s.getUsageDisabled=()=>h,s.getPositionalGroupName=()=>n("Positionals:");let u=[];s.example=(t,e)=>{u.push([t,e||""])};let d=[];s.command=function(t,e,n,s,i=!1){n&&(d=d.map((t=>(t[2]=!1,t)))),d.push([t,e||"",n,s,i])},s.getCommands=()=>d;let f={};s.describe=function(t,e){Array.isArray(t)?t.forEach((t=>{s.describe(t,e)})):"object"==typeof t?Object.keys(t).forEach((e=>{s.describe(e,t[e])})):f[t]=e},s.getDescriptions=()=>f;let p=[];s.epilog=t=>{p.push(t)};let m,g=!1;s.wrap=t=>{g=!0,m=t},s.getWrap=()=>e.getEnv("YARGS_DISABLE_WRAP")?null:(g||(m=function(){const t=80;return e.process.stdColumns?Math.min(t,e.process.stdColumns):t}(),g=!0),m);const y="__yargsString__:";function b(t,n,s){let i=0;return Array.isArray(t)||(t=Object.values(t).map((t=>[t]))),t.forEach((t=>{i=Math.max(e.stringWidth(s?`${s} ${dt(t[0])}`:dt(t[0]))+ut(t[0]),i)})),n&&(i=Math.min(i,parseInt((.5*n).toString(),10))),i}let v;function w(e){return t.getOptions().hiddenOptions.indexOf(e)<0||t.parsed.argv[t.getOptions().showHiddenOpt]}function O(t,e){let s=`[${n("default:")} `;if(void 0===t&&!e)return null;if(e)s+=e;else switch(typeof t){case"string":s+=`"${t}"`;break;case"object":s+=JSON.stringify(t);break;default:s+=t}return`${s}]`}s.deferY18nLookup=t=>y+t,s.help=function(){if(v)return v;!function(){const e=t.getDemandedOptions(),n=t.getOptions();(Object.keys(n.alias)||[]).forEach((i=>{n.alias[i].forEach((r=>{f[r]&&s.describe(i,f[r]),r in e&&t.demandOption(i,e[r]),n.boolean.includes(r)&&t.boolean(i),n.count.includes(r)&&t.count(i),n.string.includes(r)&&t.string(i),n.normalize.includes(r)&&t.normalize(i),n.array.includes(r)&&t.array(i),n.number.includes(r)&&t.number(i)}))}))}();const i=t.customScriptName?t.$0:e.path.basename(t.$0),r=t.getDemandedOptions(),o=t.getDemandedCommands(),a=t.getDeprecatedOptions(),c=t.getGroups(),m=t.getOptions();let g=[];g=g.concat(Object.keys(f)),g=g.concat(Object.keys(r)),g=g.concat(Object.keys(o)),g=g.concat(Object.keys(m.default)),g=g.filter(w),g=Object.keys(g.reduce(((t,e)=>("_"!==e&&(t[e]=!0),t)),{}));const x=s.getWrap(),E=e.cliui({width:x,wrap:!!x});if(!h)if(l.length)l.forEach((t=>{E.div({text:`${t[0].replace(/\$0/g,i)}`}),t[1]&&E.div({text:`${t[1]}`,padding:[1,0,0,0]})})),E.div();else if(d.length){let t=null;t=o._?`${i} <${n("command")}>\n`:`${i} [${n("command")}]\n`,E.div(`${t}`)}if(d.length>1||1===d.length&&!d[0][2]){E.div(n("Commands:"));const e=t.getInternalMethods().getContext(),s=e.commands.length?`${e.commands.join(" ")} `:"";!0===t.getInternalMethods().getParserConfiguration()["sort-commands"]&&(d=d.sort(((t,e)=>t[0].localeCompare(e[0]))));const r=i?`${i} `:"";d.forEach((t=>{const e=`${r}${s}${t[0].replace(/^\$0 ?/,"")}`;E.span({text:e,padding:[0,2,0,2],width:b(d,x,`${i}${s}`)+4},{text:t[1]});const o=[];t[2]&&o.push(`[${n("default")}]`),t[3]&&t[3].length&&o.push(`[${n("aliases:")} ${t[3].join(", ")}]`),t[4]&&("string"==typeof t[4]?o.push(`[${n("deprecated: %s",t[4])}]`):o.push(`[${n("deprecated")}]`)),o.length?E.div({text:o.join(" "),padding:[0,0,0,2],align:"right"}):E.div()})),E.div()}const j=(Object.keys(m.alias)||[]).concat(Object.keys(t.parsed.newAliases)||[]);g=g.filter((e=>!t.parsed.newAliases[e]&&j.every((t=>-1===(m.alias[t]||[]).indexOf(e)))));const S=n("Options:");c[S]||(c[S]=[]),function(t,e,n,s){let i=[],r=null;Object.keys(n).forEach((t=>{i=i.concat(n[t])})),t.forEach((t=>{r=[t].concat(e[t]),r.some((t=>-1!==i.indexOf(t)))||n[s].push(t)}))}(g,m.alias,c,S);const C=t=>/^--/.test(dt(t)),_=Object.keys(c).filter((t=>c[t].length>0)).map((t=>({groupName:t,normalizedKeys:c[t].filter(w).map((t=>{if(j.includes(t))return t;for(let e,n=0;void 0!==(e=j[n]);n++)if((m.alias[e]||[]).includes(t))return e;return t}))}))).filter((({normalizedKeys:t})=>t.length>0)).map((({groupName:t,normalizedKeys:e})=>{const n=e.reduce(((e,n)=>(e[n]=[n].concat(m.alias[n]||[]).map((e=>t===s.getPositionalGroupName()?e:(/^[0-9]$/.test(e)?m.boolean.includes(n)?"-":"--":e.length>1?"--":"-")+e)).sort(((t,e)=>C(t)===C(e)?0:C(t)?1:-1)).join(", "),e)),{});return{groupName:t,normalizedKeys:e,switches:n}}));if(_.filter((({groupName:t})=>t!==s.getPositionalGroupName())).some((({normalizedKeys:t,switches:e})=>!t.every((t=>C(e[t])))))&&_.filter((({groupName:t})=>t!==s.getPositionalGroupName())).forEach((({normalizedKeys:t,switches:e})=>{t.forEach((t=>{var n,s;C(e[t])&&(e[t]=(n=e[t],s="-x, ".length,ht(n)?{text:n.text,indentation:n.indentation+s}:{text:n,indentation:s}))}))})),_.forEach((({groupName:t,normalizedKeys:e,switches:i})=>{E.div(t),e.forEach((t=>{const e=i[t];let o=f[t]||"",c=null;o.includes(y)&&(o=n(o.substring(y.length))),m.boolean.includes(t)&&(c=`[${n("boolean")}]`),m.count.includes(t)&&(c=`[${n("count")}]`),m.string.includes(t)&&(c=`[${n("string")}]`),m.normalize.includes(t)&&(c=`[${n("string")}]`),m.array.includes(t)&&(c=`[${n("array")}]`),m.number.includes(t)&&(c=`[${n("number")}]`);const l=[t in a?(h=a[t],"string"==typeof h?`[${n("deprecated: %s",h)}]`:`[${n("deprecated")}]`):null,c,t in r?`[${n("required")}]`:null,m.choices&&m.choices[t]?`[${n("choices:")} ${s.stringifiedValues(m.choices[t])}]`:null,O(m.default[t],m.defaultDescription[t])].filter(Boolean).join(" ");var h;E.span({text:dt(e),padding:[0,2,0,2+ut(e)],width:b(i,x)+4},o),l?E.div({text:l,padding:[0,0,0,2],align:"right"}):E.div()})),E.div()})),u.length&&(E.div(n("Examples:")),u.forEach((t=>{t[0]=t[0].replace(/\$0/g,i)})),u.forEach((t=>{""===t[1]?E.div({text:t[0],padding:[0,2,0,2]}):E.div({text:t[0],padding:[0,2,0,2],width:b(u,x)+4},{text:t[1]})})),E.div()),p.length>0){const t=p.map((t=>t.replace(/\$0/g,i))).join("\n");E.div(`${t}\n`)}return E.toString().replace(/\s*$/,"")},s.cacheHelpMessage=function(){v=this.help()},s.clearCachedHelpMessage=function(){v=void 0},s.hasCachedHelpMessage=function(){return!!v},s.showHelp=e=>{const n=t.getInternalMethods().getLoggerInstance();e||(e="error");("function"==typeof e?e:n[e])(s.help())},s.functionDescription=t=>["(",t.name?e.Parser.decamelize(t.name,"-"):n("generated-value"),")"].join(""),s.stringifiedValues=function(t,e){let n="";const s=e||", ",i=[].concat(t);return t&&i.length?(i.forEach((t=>{n.length&&(n+=s),n+=JSON.stringify(t)})),n):n};let x=null;s.version=t=>{x=t},s.showVersion=e=>{const n=t.getInternalMethods().getLoggerInstance();e||(e="error");("function"==typeof e?e:n[e])(x)},s.reset=function(t){return r=null,c=!1,l=[],h=!1,p=[],u=[],d=[],f=ot(f,(e=>!t[e])),s};const E=[];return s.freeze=function(){E.push({failMessage:r,failureOutput:c,usages:l,usageDisabled:h,epilogs:p,examples:u,commands:d,descriptions:f})},s.unfreeze=function(t=!1){const e=E.pop();e&&(t?(f={...e.descriptions,...f},d=[...e.commands,...d],l=[...e.usages,...l],u=[...e.examples,...u],p=[...e.epilogs,...p]):({failMessage:r,failureOutput:c,usages:l,usageDisabled:h,epilogs:p,examples:u,commands:d,descriptions:f}=e))},s}function ht(t){return"object"==typeof t}function ut(t){return ht(t)?t.indentation:0}function dt(t){return ht(t)?t.text:t}class ft{constructor(t,e,n,s){var i,r,o;this.yargs=t,this.usage=e,this.command=n,this.shim=s,this.completionKey="get-yargs-completions",this.aliases=null,this.customCompletionFunction=null,this.indexAfterLastReset=0,this.zshShell=null!==(o=(null===(i=this.shim.getEnv("SHELL"))||void 0===i?void 0:i.includes("zsh"))||(null===(r=this.shim.getEnv("ZSH_NAME"))||void 0===r?void 0:r.includes("zsh")))&&void 0!==o&&o}defaultCompletion(t,e,n,s){const i=this.command.getCommandHandlers();for(let e=0,n=t.length;e<n;++e)if(i[t[e]]&&i[t[e]].builder){const n=i[t[e]].builder;if(rt(n)){this.indexAfterLastReset=e+1;const t=this.yargs.getInternalMethods().reset();return n(t,!0),t.argv}}const r=[];this.commandCompletions(r,t,n),this.optionCompletions(r,t,e,n),this.choicesFromOptionsCompletions(r,t,e,n),this.choicesFromPositionalsCompletions(r,t,e,n),s(null,r)}commandCompletions(t,e,n){const s=this.yargs.getInternalMethods().getContext().commands;n.match(/^-/)||s[s.length-1]===n||this.previousArgHasChoices(e)||this.usage.getCommands().forEach((n=>{const s=K(n[0]).cmd;if(-1===e.indexOf(s))if(this.zshShell){const e=n[1]||"";t.push(s.replace(/:/g,"\\:")+":"+e)}else t.push(s)}))}optionCompletions(t,e,n,s){if((s.match(/^-/)||""===s&&0===t.length)&&!this.previousArgHasChoices(e)){const n=this.yargs.getOptions(),i=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[];Object.keys(n.key).forEach((r=>{const o=!!n.configuration["boolean-negation"]&&n.boolean.includes(r);i.includes(r)||n.hiddenOptions.includes(r)||this.argsContainKey(e,r,o)||(this.completeOptionKey(r,t,s),o&&n.default[r]&&this.completeOptionKey(`no-${r}`,t,s))}))}}choicesFromOptionsCompletions(t,e,n,s){if(this.previousArgHasChoices(e)){const n=this.getPreviousArgChoices(e);n&&n.length>0&&t.push(...n.map((t=>t.replace(/:/g,"\\:"))))}}choicesFromPositionalsCompletions(t,e,n,s){if(""===s&&t.length>0&&this.previousArgHasChoices(e))return;const i=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[],r=Math.max(this.indexAfterLastReset,this.yargs.getInternalMethods().getContext().commands.length+1),o=i[n._.length-r-1];if(!o)return;const a=this.yargs.getOptions().choices[o]||[];for(const e of a)e.startsWith(s)&&t.push(e.replace(/:/g,"\\:"))}getPreviousArgChoices(t){if(t.length<1)return;let e=t[t.length-1],n="";if(!e.startsWith("-")&&t.length>1&&(n=e,e=t[t.length-2]),!e.startsWith("-"))return;const s=e.replace(/^-+/,""),i=this.yargs.getOptions(),r=[s,...this.yargs.getAliases()[s]||[]];let o;for(const t of r)if(Object.prototype.hasOwnProperty.call(i.key,t)&&Array.isArray(i.choices[t])){o=i.choices[t];break}return o?o.filter((t=>!n||t.startsWith(n))):void 0}previousArgHasChoices(t){const e=this.getPreviousArgChoices(t);return void 0!==e&&e.length>0}argsContainKey(t,e,n){const s=e=>-1!==t.indexOf((/^[^0-9]$/.test(e)?"-":"--")+e);if(s(e))return!0;if(n&&s(`no-${e}`))return!0;if(this.aliases)for(const t of this.aliases[e])if(s(t))return!0;return!1}completeOptionKey(t,e,n){const s=this.usage.getDescriptions(),i=!/^--/.test(n)&&(t=>/^[^0-9]$/.test(t))(t)?"-":"--";if(this.zshShell){const n=s[t]||"";e.push(i+`${t.replace(/:/g,"\\:")}:${n.replace("__yargsString__:","")}`)}else e.push(i+t)}customCompletion(t,e,n,s){if(H(this.customCompletionFunction,null,this.shim),this.customCompletionFunction.length<3){const t=this.customCompletionFunction(n,e);return V(t)?t.then((t=>{this.shim.process.nextTick((()=>{s(null,t)}))})).catch((t=>{this.shim.process.nextTick((()=>{s(t,void 0)}))})):s(null,t)}return function(t){return t.length>3}(this.customCompletionFunction)?this.customCompletionFunction(n,e,((i=s)=>this.defaultCompletion(t,e,n,i)),(t=>{s(null,t)})):this.customCompletionFunction(n,e,(t=>{s(null,t)}))}getCompletion(t,e){const n=t.length?t[t.length-1]:"",s=this.yargs.parse(t,!0),i=this.customCompletionFunction?s=>this.customCompletion(t,s,n,e):s=>this.defaultCompletion(t,s,n,e);return V(s)?s.then(i):i(s)}generateCompletionScript(t,e){let n=this.zshShell?'#compdef {{app_name}}\n###-begin-{{app_name}}-completions-###\n#\n# yargs command completion script\n#\n# Installation: {{app_path}} {{completion_command}} >> ~/.zshrc\n# or {{app_path}} {{completion_command}} >> ~/.zprofile on OSX.\n#\n_{{app_name}}_yargs_completions()\n{\n local reply\n local si=$IFS\n IFS=$\'\n\' reply=($(COMP_CWORD="$((CURRENT-1))" COMP_LINE="$BUFFER" COMP_POINT="$CURSOR" {{app_path}} --get-yargs-completions "${words[@]}"))\n IFS=$si\n _describe \'values\' reply\n}\ncompdef _{{app_name}}_yargs_completions {{app_name}}\n###-end-{{app_name}}-completions-###\n':'###-begin-{{app_name}}-completions-###\n#\n# yargs command completion script\n#\n# Installation: {{app_path}} {{completion_command}} >> ~/.bashrc\n# or {{app_path}} {{completion_command}} >> ~/.bash_profile on OSX.\n#\n_{{app_name}}_yargs_completions()\n{\n local cur_word args type_list\n\n cur_word="${COMP_WORDS[COMP_CWORD]}"\n args=("${COMP_WORDS[@]}")\n\n # ask yargs to generate completions.\n type_list=$({{app_path}} --get-yargs-completions "${args[@]}")\n\n COMPREPLY=( $(compgen -W "${type_list}" -- ${cur_word}) )\n\n # if no match was found, fall back to filename completion\n if [ ${#COMPREPLY[@]} -eq 0 ]; then\n COMPREPLY=()\n fi\n\n return 0\n}\ncomplete -o bashdefault -o default -F _{{app_name}}_yargs_completions {{app_name}}\n###-end-{{app_name}}-completions-###\n';const s=this.shim.path.basename(t);return t.match(/\.js$/)&&(t=`./${t}`),n=n.replace(/{{app_name}}/g,s),n=n.replace(/{{completion_command}}/g,e),n.replace(/{{app_path}}/g,t)}registerFunction(t){this.customCompletionFunction=t}setParsed(t){this.aliases=t.aliases}}function pt(t,e){if(0===t.length)return e.length;if(0===e.length)return t.length;const n=[];let s,i;for(s=0;s<=e.length;s++)n[s]=[s];for(i=0;i<=t.length;i++)n[0][i]=i;for(s=1;s<=e.length;s++)for(i=1;i<=t.length;i++)e.charAt(s-1)===t.charAt(i-1)?n[s][i]=n[s-1][i-1]:s>1&&i>1&&e.charAt(s-2)===t.charAt(i-1)&&e.charAt(s-1)===t.charAt(i-2)?n[s][i]=n[s-2][i-2]+1:n[s][i]=Math.min(n[s-1][i-1]+1,Math.min(n[s][i-1]+1,n[s-1][i]+1));return n[e.length][t.length]}const mt=["$0","--","_"];let gt,yt=[];function bt(t,e,n,s){gt=s;let i={};if(Object.prototype.hasOwnProperty.call(t,"extends")){if("string"!=typeof t.extends)return i;const s=/\.json|\..*rc$/.test(t.extends);let r=null;if(s)r=function(t,e){return gt.path.resolve(t,e)}(e,t.extends);else try{r=require.resolve(t.extends)}catch(e){return t}!function(t){if(yt.indexOf(t)>-1)throw new N(`Circular extended configurations: '${t}'.`)}(r),yt.push(r),i=s?JSON.parse(gt.readFileSync(r,"utf8")):require(t.extends),delete t.extends,i=bt(i,gt.path.dirname(r),n,gt)}return yt=[],n?vt(i,t):Object.assign({},i,t)}function vt(t,e){const n={};function s(t){return t&&"object"==typeof t&&!Array.isArray(t)}Object.assign(n,t);for(const i of Object.keys(e))s(e[i])&&s(n[i])?n[i]=vt(t[i],e[i]):n[i]=e[i];return n}var wt,Ot,xt,Et,jt,St,Ct,_t,kt,At,Pt,$t,Mt,It,Tt,Nt,Lt,Ft,Gt,Dt,Wt,Rt,Ut,Bt,Ht,zt,qt,Vt,Kt,Yt,Jt,Qt,Xt,Zt,te=function(t,e,n,s,i){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?i.call(t,n):i?i.value=n:e.set(t,n),n},ee=function(t,e,n,s){if("a"===n&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?s:"a"===n?s.call(t):s?s.value:e.get(t)};const ne=Symbol("copyDoubleDash"),se=Symbol("copyDoubleDash"),ie=Symbol("deleteFromParserHintObject"),re=Symbol("emitWarning"),oe=Symbol("freeze"),ae=Symbol("getDollarZero"),ce=Symbol("getParserConfiguration"),le=Symbol("guessLocale"),he=Symbol("guessVersion"),ue=Symbol("parsePositionalNumbers"),de=Symbol("pkgUp"),fe=Symbol("populateParserHintArray"),pe=Symbol("populateParserHintSingleValueDictionary"),me=Symbol("populateParserHintArrayDictionary"),ge=Symbol("populateParserHintDictionary"),ye=Symbol("sanitizeKey"),be=Symbol("setKey"),ve=Symbol("unfreeze"),we=Symbol("validateAsync"),Oe=Symbol("getCommandInstance"),xe=Symbol("getContext"),Ee=Symbol("getHasOutput"),je=Symbol("getLoggerInstance"),Se=Symbol("getParseContext"),Ce=Symbol("getUsageInstance"),_e=Symbol("getValidationInstance"),ke=Symbol("hasParseCallback"),Ae=Symbol("isGlobalContext"),Pe=Symbol("postProcess"),$e=Symbol("rebase"),Me=Symbol("reset"),Ie=Symbol("runYargsParserAndExecuteCommands"),Te=Symbol("runValidation"),Ne=Symbol("setHasOutput"),Le=Symbol("kTrackManuallySetKeys");class Fe{constructor(t=[],e,n,s){this.customScriptName=!1,this.parsed=!1,wt.set(this,void 0),Ot.set(this,void 0),xt.set(this,{commands:[],fullCommands:[]}),Et.set(this,null),jt.set(this,null),St.set(this,"show-hidden"),Ct.set(this,null),_t.set(this,!0),kt.set(this,{}),At.set(this,!0),Pt.set(this,[]),$t.set(this,void 0),Mt.set(this,{}),It.set(this,!1),Tt.set(this,null),Nt.set(this,!0),Lt.set(this,void 0),Ft.set(this,""),Gt.set(this,void 0),Dt.set(this,void 0),Wt.set(this,{}),Rt.set(this,null),Ut.set(this,null),Bt.set(this,{}),Ht.set(this,{}),zt.set(this,void 0),qt.set(this,!1),Vt.set(this,void 0),Kt.set(this,!1),Yt.set(this,!1),Jt.set(this,!1),Qt.set(this,void 0),Xt.set(this,null),Zt.set(this,void 0),te(this,Vt,s,"f"),te(this,zt,t,"f"),te(this,Ot,e,"f"),te(this,Dt,n,"f"),te(this,$t,new Z(this),"f"),this.$0=this[ae](),this[Me](),te(this,wt,ee(this,wt,"f"),"f"),te(this,Qt,ee(this,Qt,"f"),"f"),te(this,Zt,ee(this,Zt,"f"),"f"),te(this,Gt,ee(this,Gt,"f"),"f"),ee(this,Gt,"f").showHiddenOpt=ee(this,St,"f"),te(this,Lt,this[se](),"f")}addHelpOpt(t,e){return J("[string|boolean] [string]",[t,e],arguments.length),ee(this,Tt,"f")&&(this[ie](ee(this,Tt,"f")),te(this,Tt,null,"f")),!1===t&&void 0===e||(te(this,Tt,"string"==typeof t?t:"help","f"),this.boolean(ee(this,Tt,"f")),this.describe(ee(this,Tt,"f"),e||ee(this,Qt,"f").deferY18nLookup("Show help"))),this}help(t,e){return this.addHelpOpt(t,e)}addShowHiddenOpt(t,e){if(J("[string|boolean] [string]",[t,e],arguments.length),!1===t&&void 0===e)return this;const n="string"==typeof t?t:ee(this,St,"f");return this.boolean(n),this.describe(n,e||ee(this,Qt,"f").deferY18nLookup("Show hidden options")),ee(this,Gt,"f").showHiddenOpt=n,this}showHidden(t,e){return this.addShowHiddenOpt(t,e)}alias(t,e){return J("<object|string|array> [string|array]",[t,e],arguments.length),this[me](this.alias.bind(this),"alias",t,e),this}array(t){return J("<array|string>",[t],arguments.length),this[fe]("array",t),this[Le](t),this}boolean(t){return J("<array|string>",[t],arguments.length),this[fe]("boolean",t),this[Le](t),this}check(t,e){return J("<function> [boolean]",[t,e],arguments.length),this.middleware(((e,n)=>et((()=>t(e,n.getOptions())),(n=>(n?("string"==typeof n||n instanceof Error)&&ee(this,Qt,"f").fail(n.toString(),n):ee(this,Qt,"f").fail(ee(this,Vt,"f").y18n.__("Argument check failed: %s",t.toString())),e)),(t=>(ee(this,Qt,"f").fail(t.message?t.message:t.toString(),t),e)))),!1,e),this}choices(t,e){return J("<object|string|array> [string|array]",[t,e],arguments.length),this[me](this.choices.bind(this),"choices",t,e),this}coerce(t,e){if(J("<object|string|array> [function]",[t,e],arguments.length),Array.isArray(t)){if(!e)throw new N("coerce callback must be provided");for(const n of t)this.coerce(n,e);return this}if("object"==typeof t){for(const e of Object.keys(t))this.coerce(e,t[e]);return this}if(!e)throw new N("coerce callback must be provided");return ee(this,Gt,"f").key[t]=!0,ee(this,$t,"f").addCoerceMiddleware(((n,s)=>{let i;return Object.prototype.hasOwnProperty.call(n,t)?et((()=>(i=s.getAliases(),e(n[t]))),(e=>{n[t]=e;const r=s.getInternalMethods().getParserConfiguration()["strip-aliased"];if(i[t]&&!0!==r)for(const s of i[t])n[s]=e;return n}),(t=>{throw new N(t.message)})):n}),t),this}conflicts(t,e){return J("<string|object> [string|array]",[t,e],arguments.length),ee(this,Zt,"f").conflicts(t,e),this}config(t="config",e,n){return J("[object|string] [string|function] [function]",[t,e,n],arguments.length),"object"!=typeof t||Array.isArray(t)?("function"==typeof e&&(n=e,e=void 0),this.describe(t,e||ee(this,Qt,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(t)?t:[t]).forEach((t=>{ee(this,Gt,"f").config[t]=n||!0})),this):(t=bt(t,ee(this,Ot,"f"),this[ce]()["deep-merge-config"]||!1,ee(this,Vt,"f")),ee(this,Gt,"f").configObjects=(ee(this,Gt,"f").configObjects||[]).concat(t),this)}completion(t,e,n){return J("[string] [string|boolean|function] [function]",[t,e,n],arguments.length),"function"==typeof e&&(n=e,e=void 0),te(this,jt,t||ee(this,jt,"f")||"completion","f"),e||!1===e||(e="generate completion script"),this.command(ee(this,jt,"f"),e),n&&ee(this,Et,"f").registerFunction(n),this}command(t,e,n,s,i,r){return J("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[t,e,n,s,i,r],arguments.length),ee(this,wt,"f").addHandler(t,e,n,s,i,r),this}commands(t,e,n,s,i,r){return this.command(t,e,n,s,i,r)}commandDir(t,e){J("<string> [object]",[t,e],arguments.length);const n=ee(this,Dt,"f")||ee(this,Vt,"f").require;return ee(this,wt,"f").addDirectory(t,n,ee(this,Vt,"f").getCallerFile(),e),this}count(t){return J("<array|string>",[t],arguments.length),this[fe]("count",t),this[Le](t),this}default(t,e,n){return J("<object|string|array> [*] [string]",[t,e,n],arguments.length),n&&(z(t,ee(this,Vt,"f")),ee(this,Gt,"f").defaultDescription[t]=n),"function"==typeof e&&(z(t,ee(this,Vt,"f")),ee(this,Gt,"f").defaultDescription[t]||(ee(this,Gt,"f").defaultDescription[t]=ee(this,Qt,"f").functionDescription(e)),e=e.call()),this[pe](this.default.bind(this),"default",t,e),this}defaults(t,e,n){return this.default(t,e,n)}demandCommand(t=1,e,n,s){return J("[number] [number|string] [string|null|undefined] [string|null|undefined]",[t,e,n,s],arguments.length),"number"!=typeof e&&(n=e,e=1/0),this.global("_",!1),ee(this,Gt,"f").demandedCommands._={min:t,max:e,minMsg:n,maxMsg:s},this}demand(t,e,n){return Array.isArray(e)?(e.forEach((t=>{H(n,!0,ee(this,Vt,"f")),this.demandOption(t,n)})),e=1/0):"number"!=typeof e&&(n=e,e=1/0),"number"==typeof t?(H(n,!0,ee(this,Vt,"f")),this.demandCommand(t,e,n,n)):Array.isArray(t)?t.forEach((t=>{H(n,!0,ee(this,Vt,"f")),this.demandOption(t,n)})):"string"==typeof n?this.demandOption(t,n):!0!==n&&void 0!==n||this.demandOption(t),this}demandOption(t,e){return J("<object|string|array> [string]",[t,e],arguments.length),this[pe](this.demandOption.bind(this),"demandedOptions",t,e),this}deprecateOption(t,e){return J("<string> [string|boolean]",[t,e],arguments.length),ee(this,Gt,"f").deprecatedOptions[t]=e,this}describe(t,e){return J("<object|string|array> [string]",[t,e],arguments.length),this[be](t,!0),ee(this,Qt,"f").describe(t,e),this}detectLocale(t){return J("<boolean>",[t],arguments.length),te(this,_t,t,"f"),this}env(t){return J("[string|boolean]",[t],arguments.length),!1===t?delete ee(this,Gt,"f").envPrefix:ee(this,Gt,"f").envPrefix=t||"",this}epilogue(t){return J("<string>",[t],arguments.length),ee(this,Qt,"f").epilog(t),this}epilog(t){return this.epilogue(t)}example(t,e){return J("<string|array> [string]",[t,e],arguments.length),Array.isArray(t)?t.forEach((t=>this.example(...t))):ee(this,Qt,"f").example(t,e),this}exit(t,e){te(this,It,!0,"f"),te(this,Ct,e,"f"),ee(this,At,"f")&&ee(this,Vt,"f").process.exit(t)}exitProcess(t=!0){return J("[boolean]",[t],arguments.length),te(this,At,t,"f"),this}fail(t){if(J("<function|boolean>",[t],arguments.length),"boolean"==typeof t&&!1!==t)throw new N("Invalid first argument. Expected function or boolean 'false'");return ee(this,Qt,"f").failFn(t),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(t,e){return J("<array> [function]",[t,e],arguments.length),e?ee(this,Et,"f").getCompletion(t,e):new Promise(((e,n)=>{ee(this,Et,"f").getCompletion(t,((t,s)=>{t?n(t):e(s)}))}))}getDemandedOptions(){return J([],0),ee(this,Gt,"f").demandedOptions}getDemandedCommands(){return J([],0),ee(this,Gt,"f").demandedCommands}getDeprecatedOptions(){return J([],0),ee(this,Gt,"f").deprecatedOptions}getDetectLocale(){return ee(this,_t,"f")}getExitProcess(){return ee(this,At,"f")}getGroups(){return Object.assign({},ee(this,Mt,"f"),ee(this,Ht,"f"))}getHelp(){if(te(this,It,!0,"f"),!ee(this,Qt,"f").hasCachedHelpMessage()){if(!this.parsed){const t=this[Ie](ee(this,zt,"f"),void 0,void 0,0,!0);if(V(t))return t.then((()=>ee(this,Qt,"f").help()))}const t=ee(this,wt,"f").runDefaultBuilderOn(this);if(V(t))return t.then((()=>ee(this,Qt,"f").help()))}return Promise.resolve(ee(this,Qt,"f").help())}getOptions(){return ee(this,Gt,"f")}getStrict(){return ee(this,Kt,"f")}getStrictCommands(){return ee(this,Yt,"f")}getStrictOptions(){return ee(this,Jt,"f")}global(t,e){return J("<string|array> [boolean]",[t,e],arguments.length),t=[].concat(t),!1!==e?ee(this,Gt,"f").local=ee(this,Gt,"f").local.filter((e=>-1===t.indexOf(e))):t.forEach((t=>{ee(this,Gt,"f").local.includes(t)||ee(this,Gt,"f").local.push(t)})),this}group(t,e){J("<string|array> <string>",[t,e],arguments.length);const n=ee(this,Ht,"f")[e]||ee(this,Mt,"f")[e];ee(this,Ht,"f")[e]&&delete ee(this,Ht,"f")[e];const s={};return ee(this,Mt,"f")[e]=(n||[]).concat(t).filter((t=>!s[t]&&(s[t]=!0))),this}hide(t){return J("<string>",[t],arguments.length),ee(this,Gt,"f").hiddenOptions.push(t),this}implies(t,e){return J("<string|object> [number|string|array]",[t,e],arguments.length),ee(this,Zt,"f").implies(t,e),this}locale(t){return J("[string]",[t],arguments.length),void 0===t?(this[le](),ee(this,Vt,"f").y18n.getLocale()):(te(this,_t,!1,"f"),ee(this,Vt,"f").y18n.setLocale(t),this)}middleware(t,e,n){return ee(this,$t,"f").addMiddleware(t,!!e,n)}nargs(t,e){return J("<string|object|array> [number]",[t,e],arguments.length),this[pe](this.nargs.bind(this),"narg",t,e),this}normalize(t){return J("<array|string>",[t],arguments.length),this[fe]("normalize",t),this}number(t){return J("<array|string>",[t],arguments.length),this[fe]("number",t),this[Le](t),this}option(t,e){if(J("<string|object> [object]",[t,e],arguments.length),"object"==typeof t)Object.keys(t).forEach((e=>{this.options(e,t[e])}));else{"object"!=typeof e&&(e={}),this[Le](t),!ee(this,Xt,"f")||"version"!==t&&"version"!==(null==e?void 0:e.alias)||this[re](['"version" is a reserved word.',"Please do one of the following:",'- Disable version with `yargs.version(false)` if using "version" as an option',"- Use the built-in `yargs.version` method instead (if applicable)","- Use a different option key","https://yargs.js.org/docs/#api-reference-version"].join("\n"),void 0,"versionWarning"),ee(this,Gt,"f").key[t]=!0,e.alias&&this.alias(t,e.alias);const n=e.deprecate||e.deprecated;n&&this.deprecateOption(t,n);const s=e.demand||e.required||e.require;s&&this.demand(t,s),e.demandOption&&this.demandOption(t,"string"==typeof e.demandOption?e.demandOption:void 0),e.conflicts&&this.conflicts(t,e.conflicts),"default"in e&&this.default(t,e.default),void 0!==e.implies&&this.implies(t,e.implies),void 0!==e.nargs&&this.nargs(t,e.nargs),e.config&&this.config(t,e.configParser),e.normalize&&this.normalize(t),e.choices&&this.choices(t,e.choices),e.coerce&&this.coerce(t,e.coerce),e.group&&this.group(t,e.group),(e.boolean||"boolean"===e.type)&&(this.boolean(t),e.alias&&this.boolean(e.alias)),(e.array||"array"===e.type)&&(this.array(t),e.alias&&this.array(e.alias)),(e.number||"number"===e.type)&&(this.number(t),e.alias&&this.number(e.alias)),(e.string||"string"===e.type)&&(this.string(t),e.alias&&this.string(e.alias)),(e.count||"count"===e.type)&&this.count(t),"boolean"==typeof e.global&&this.global(t,e.global),e.defaultDescription&&(ee(this,Gt,"f").defaultDescription[t]=e.defaultDescription),e.skipValidation&&this.skipValidation(t);const i=e.describe||e.description||e.desc,r=ee(this,Qt,"f").getDescriptions();Object.prototype.hasOwnProperty.call(r,t)&&"string"!=typeof i||this.describe(t,i),e.hidden&&this.hide(t),e.requiresArg&&this.requiresArg(t)}return this}options(t,e){return this.option(t,e)}parse(t,e,n){J("[string|array] [function|boolean|object] [function]",[t,e,n],arguments.length),this[oe](),void 0===t&&(t=ee(this,zt,"f")),"object"==typeof e&&(te(this,Ut,e,"f"),e=n),"function"==typeof e&&(te(this,Rt,e,"f"),e=!1),e||te(this,zt,t,"f"),ee(this,Rt,"f")&&te(this,At,!1,"f");const s=this[Ie](t,!!e),i=this.parsed;return ee(this,Et,"f").setParsed(this.parsed),V(s)?s.then((t=>(ee(this,Rt,"f")&&ee(this,Rt,"f").call(this,ee(this,Ct,"f"),t,ee(this,Ft,"f")),t))).catch((t=>{throw ee(this,Rt,"f")&&ee(this,Rt,"f")(t,this.parsed.argv,ee(this,Ft,"f")),t})).finally((()=>{this[ve](),this.parsed=i})):(ee(this,Rt,"f")&&ee(this,Rt,"f").call(this,ee(this,Ct,"f"),s,ee(this,Ft,"f")),this[ve](),this.parsed=i,s)}parseAsync(t,e,n){const s=this.parse(t,e,n);return V(s)?s:Promise.resolve(s)}parseSync(t,e,n){const s=this.parse(t,e,n);if(V(s))throw new N(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return s}parserConfiguration(t){return J("<object>",[t],arguments.length),te(this,Wt,t,"f"),this}pkgConf(t,e){J("<string> [string]",[t,e],arguments.length);let n=null;const s=this[de](e||ee(this,Ot,"f"));return s[t]&&"object"==typeof s[t]&&(n=bt(s[t],e||ee(this,Ot,"f"),this[ce]()["deep-merge-config"]||!1,ee(this,Vt,"f")),ee(this,Gt,"f").configObjects=(ee(this,Gt,"f").configObjects||[]).concat(n)),this}positional(t,e){J("<string> <object>",[t,e],arguments.length);const n=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];e=ot(e,((t,e)=>!("type"===t&&!["string","number","boolean"].includes(e))&&n.includes(t)));const s=ee(this,xt,"f").fullCommands[ee(this,xt,"f").fullCommands.length-1],i=s?ee(this,wt,"f").cmdToParseOptions(s):{array:[],alias:{},default:{},demand:{}};return q(i).forEach((n=>{const s=i[n];Array.isArray(s)?-1!==s.indexOf(t)&&(e[n]=!0):s[t]&&!(n in e)&&(e[n]=s[t])})),this.group(t,ee(this,Qt,"f").getPositionalGroupName()),this.option(t,e)}recommendCommands(t=!0){return J("[boolean]",[t],arguments.length),te(this,qt,t,"f"),this}required(t,e,n){return this.demand(t,e,n)}require(t,e,n){return this.demand(t,e,n)}requiresArg(t){return J("<array|string|object> [number]",[t],arguments.length),"string"==typeof t&&ee(this,Gt,"f").narg[t]||this[pe](this.requiresArg.bind(this),"narg",t,NaN),this}showCompletionScript(t,e){return J("[string] [string]",[t,e],arguments.length),t=t||this.$0,ee(this,Lt,"f").log(ee(this,Et,"f").generateCompletionScript(t,e||ee(this,jt,"f")||"completion")),this}showHelp(t){if(J("[string|function]",[t],arguments.length),te(this,It,!0,"f"),!ee(this,Qt,"f").hasCachedHelpMessage()){if(!this.parsed){const e=this[Ie](ee(this,zt,"f"),void 0,void 0,0,!0);if(V(e))return e.then((()=>{ee(this,Qt,"f").showHelp(t)})),this}const e=ee(this,wt,"f").runDefaultBuilderOn(this);if(V(e))return e.then((()=>{ee(this,Qt,"f").showHelp(t)})),this}return ee(this,Qt,"f").showHelp(t),this}scriptName(t){return this.customScriptName=!0,this.$0=t,this}showHelpOnFail(t,e){return J("[boolean|string] [string]",[t,e],arguments.length),ee(this,Qt,"f").showHelpOnFail(t,e),this}showVersion(t){return J("[string|function]",[t],arguments.length),ee(this,Qt,"f").showVersion(t),this}skipValidation(t){return J("<array|string>",[t],arguments.length),this[fe]("skipValidation",t),this}strict(t){return J("[boolean]",[t],arguments.length),te(this,Kt,!1!==t,"f"),this}strictCommands(t){return J("[boolean]",[t],arguments.length),te(this,Yt,!1!==t,"f"),this}strictOptions(t){return J("[boolean]",[t],arguments.length),te(this,Jt,!1!==t,"f"),this}string(t){return J("<array|string>",[t],arguments.length),this[fe]("string",t),this[Le](t),this}terminalWidth(){return J([],0),ee(this,Vt,"f").process.stdColumns}updateLocale(t){return this.updateStrings(t)}updateStrings(t){return J("<object>",[t],arguments.length),te(this,_t,!1,"f"),ee(this,Vt,"f").y18n.updateLocale(t),this}usage(t,e,n,s){if(J("<string|null|undefined> [string|boolean] [function|object] [function]",[t,e,n,s],arguments.length),void 0!==e){if(H(t,null,ee(this,Vt,"f")),(t||"").match(/^\$0( |$)/))return this.command(t,e,n,s);throw new N(".usage() description must start with $0 if being used as alias for .command()")}return ee(this,Qt,"f").usage(t),this}version(t,e,n){const s="version";if(J("[boolean|string] [string] [string]",[t,e,n],arguments.length),ee(this,Xt,"f")&&(this[ie](ee(this,Xt,"f")),ee(this,Qt,"f").version(void 0),te(this,Xt,null,"f")),0===arguments.length)n=this[he](),t=s;else if(1===arguments.length){if(!1===t)return this;n=t,t=s}else 2===arguments.length&&(n=e,e=void 0);return te(this,Xt,"string"==typeof t?t:s,"f"),e=e||ee(this,Qt,"f").deferY18nLookup("Show version number"),ee(this,Qt,"f").version(n||void 0),this.boolean(ee(this,Xt,"f")),this.describe(ee(this,Xt,"f"),e),this}wrap(t){return J("<number|null|undefined>",[t],arguments.length),ee(this,Qt,"f").wrap(t),this}[(wt=new WeakMap,Ot=new WeakMap,xt=new WeakMap,Et=new WeakMap,jt=new WeakMap,St=new WeakMap,Ct=new WeakMap,_t=new WeakMap,kt=new WeakMap,At=new WeakMap,Pt=new WeakMap,$t=new WeakMap,Mt=new WeakMap,It=new WeakMap,Tt=new WeakMap,Nt=new WeakMap,Lt=new WeakMap,Ft=new WeakMap,Gt=new WeakMap,Dt=new WeakMap,Wt=new WeakMap,Rt=new WeakMap,Ut=new WeakMap,Bt=new WeakMap,Ht=new WeakMap,zt=new WeakMap,qt=new WeakMap,Vt=new WeakMap,Kt=new WeakMap,Yt=new WeakMap,Jt=new WeakMap,Qt=new WeakMap,Xt=new WeakMap,Zt=new WeakMap,ne)](t){if(!t._||!t["--"])return t;t._.push.apply(t._,t["--"]);try{delete t["--"]}catch(t){}return t}[se](){return{log:(...t)=>{this[ke]()||console.log(...t),te(this,It,!0,"f"),ee(this,Ft,"f").length&&te(this,Ft,ee(this,Ft,"f")+"\n","f"),te(this,Ft,ee(this,Ft,"f")+t.join(" "),"f")},error:(...t)=>{this[ke]()||console.error(...t),te(this,It,!0,"f"),ee(this,Ft,"f").length&&te(this,Ft,ee(this,Ft,"f")+"\n","f"),te(this,Ft,ee(this,Ft,"f")+t.join(" "),"f")}}}[ie](t){q(ee(this,Gt,"f")).forEach((e=>{if("configObjects"===e)return;const n=ee(this,Gt,"f")[e];Array.isArray(n)?n.includes(t)&&n.splice(n.indexOf(t),1):"object"==typeof n&&delete n[t]})),delete ee(this,Qt,"f").getDescriptions()[t]}[re](t,e,n){ee(this,kt,"f")[n]||(ee(this,Vt,"f").process.emitWarning(t,e),ee(this,kt,"f")[n]=!0)}[oe](){ee(this,Pt,"f").push({options:ee(this,Gt,"f"),configObjects:ee(this,Gt,"f").configObjects.slice(0),exitProcess:ee(this,At,"f"),groups:ee(this,Mt,"f"),strict:ee(this,Kt,"f"),strictCommands:ee(this,Yt,"f"),strictOptions:ee(this,Jt,"f"),completionCommand:ee(this,jt,"f"),output:ee(this,Ft,"f"),exitError:ee(this,Ct,"f"),hasOutput:ee(this,It,"f"),parsed:this.parsed,parseFn:ee(this,Rt,"f"),parseContext:ee(this,Ut,"f")}),ee(this,Qt,"f").freeze(),ee(this,Zt,"f").freeze(),ee(this,wt,"f").freeze(),ee(this,$t,"f").freeze()}[ae](){let t,e="";return t=/\b(node|iojs|electron)(\.exe)?$/.test(ee(this,Vt,"f").process.argv()[0])?ee(this,Vt,"f").process.argv().slice(1,2):ee(this,Vt,"f").process.argv().slice(0,1),e=t.map((t=>{const e=this[$e](ee(this,Ot,"f"),t);return t.match(/^(\/|([a-zA-Z]:)?\\)/)&&e.length<t.length?e:t})).join(" ").trim(),ee(this,Vt,"f").getEnv("_")&&ee(this,Vt,"f").getProcessArgvBin()===ee(this,Vt,"f").getEnv("_")&&(e=ee(this,Vt,"f").getEnv("_").replace(`${ee(this,Vt,"f").path.dirname(ee(this,Vt,"f").process.execPath())}/`,"")),e}[ce](){return ee(this,Wt,"f")}[le](){if(!ee(this,_t,"f"))return;const t=ee(this,Vt,"f").getEnv("LC_ALL")||ee(this,Vt,"f").getEnv("LC_MESSAGES")||ee(this,Vt,"f").getEnv("LANG")||ee(this,Vt,"f").getEnv("LANGUAGE")||"en_US";this.locale(t.replace(/[.:].*/,""))}[he](){return this[de]().version||"unknown"}[ue](t){const e=t["--"]?t["--"]:t._;for(let t,n=0;void 0!==(t=e[n]);n++)ee(this,Vt,"f").Parser.looksLikeNumber(t)&&Number.isSafeInteger(Math.floor(parseFloat(`${t}`)))&&(e[n]=Number(t));return t}[de](t){const e=t||"*";if(ee(this,Bt,"f")[e])return ee(this,Bt,"f")[e];let n={};try{let e=t||ee(this,Vt,"f").mainFilename;!t&&ee(this,Vt,"f").path.extname(e)&&(e=ee(this,Vt,"f").path.dirname(e));const s=ee(this,Vt,"f").findUp(e,((t,e)=>e.includes("package.json")?"package.json":void 0));H(s,void 0,ee(this,Vt,"f")),n=JSON.parse(ee(this,Vt,"f").readFileSync(s,"utf8"))}catch(t){}return ee(this,Bt,"f")[e]=n||{},ee(this,Bt,"f")[e]}[fe](t,e){(e=[].concat(e)).forEach((e=>{e=this[ye](e),ee(this,Gt,"f")[t].push(e)}))}[pe](t,e,n,s){this[ge](t,e,n,s,((t,e,n)=>{ee(this,Gt,"f")[t][e]=n}))}[me](t,e,n,s){this[ge](t,e,n,s,((t,e,n)=>{ee(this,Gt,"f")[t][e]=(ee(this,Gt,"f")[t][e]||[]).concat(n)}))}[ge](t,e,n,s,i){if(Array.isArray(n))n.forEach((e=>{t(e,s)}));else if((t=>"object"==typeof t)(n))for(const e of q(n))t(e,n[e]);else i(e,this[ye](n),s)}[ye](t){return"__proto__"===t?"___proto___":t}[be](t,e){return this[pe](this[be].bind(this),"key",t,e),this}[ve](){var t,e,n,s,i,r,o,a,c,l,h,u;const d=ee(this,Pt,"f").pop();let f;H(d,void 0,ee(this,Vt,"f")),t=this,e=this,n=this,s=this,i=this,r=this,o=this,a=this,c=this,l=this,h=this,u=this,({options:{set value(e){te(t,Gt,e,"f")}}.value,configObjects:f,exitProcess:{set value(t){te(e,At,t,"f")}}.value,groups:{set value(t){te(n,Mt,t,"f")}}.value,output:{set value(t){te(s,Ft,t,"f")}}.value,exitError:{set value(t){te(i,Ct,t,"f")}}.value,hasOutput:{set value(t){te(r,It,t,"f")}}.value,parsed:this.parsed,strict:{set value(t){te(o,Kt,t,"f")}}.value,strictCommands:{set value(t){te(a,Yt,t,"f")}}.value,strictOptions:{set value(t){te(c,Jt,t,"f")}}.value,completionCommand:{set value(t){te(l,jt,t,"f")}}.value,parseFn:{set value(t){te(h,Rt,t,"f")}}.value,parseContext:{set value(t){te(u,Ut,t,"f")}}.value}=d),ee(this,Gt,"f").configObjects=f,ee(this,Qt,"f").unfreeze(),ee(this,Zt,"f").unfreeze(),ee(this,wt,"f").unfreeze(),ee(this,$t,"f").unfreeze()}[we](t,e){return et(e,(e=>(t(e),e)))}getInternalMethods(){return{getCommandInstance:this[Oe].bind(this),getContext:this[xe].bind(this),getHasOutput:this[Ee].bind(this),getLoggerInstance:this[je].bind(this),getParseContext:this[Se].bind(this),getParserConfiguration:this[ce].bind(this),getUsageInstance:this[Ce].bind(this),getValidationInstance:this[_e].bind(this),hasParseCallback:this[ke].bind(this),isGlobalContext:this[Ae].bind(this),postProcess:this[Pe].bind(this),reset:this[Me].bind(this),runValidation:this[Te].bind(this),runYargsParserAndExecuteCommands:this[Ie].bind(this),setHasOutput:this[Ne].bind(this)}}[Oe](){return ee(this,wt,"f")}[xe](){return ee(this,xt,"f")}[Ee](){return ee(this,It,"f")}[je](){return ee(this,Lt,"f")}[Se](){return ee(this,Ut,"f")||{}}[Ce](){return ee(this,Qt,"f")}[_e](){return ee(this,Zt,"f")}[ke](){return!!ee(this,Rt,"f")}[Ae](){return ee(this,Nt,"f")}[Pe](t,e,n,s){if(n)return t;if(V(t))return t;e||(t=this[ne](t));return(this[ce]()["parse-positional-numbers"]||void 0===this[ce]()["parse-positional-numbers"])&&(t=this[ue](t)),s&&(t=tt(t,this,ee(this,$t,"f").getMiddleware(),!1)),t}[Me](t={}){te(this,Gt,ee(this,Gt,"f")||{},"f");const e={};e.local=ee(this,Gt,"f").local||[],e.configObjects=ee(this,Gt,"f").configObjects||[];const n={};e.local.forEach((e=>{n[e]=!0,(t[e]||[]).forEach((t=>{n[t]=!0}))})),Object.assign(ee(this,Ht,"f"),Object.keys(ee(this,Mt,"f")).reduce(((t,e)=>{const s=ee(this,Mt,"f")[e].filter((t=>!(t in n)));return s.length>0&&(t[e]=s),t}),{})),te(this,Mt,{},"f");return["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"].forEach((t=>{e[t]=(ee(this,Gt,"f")[t]||[]).filter((t=>!n[t]))})),["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"].forEach((t=>{e[t]=ot(ee(this,Gt,"f")[t],(t=>!n[t]))})),e.envPrefix=ee(this,Gt,"f").envPrefix,te(this,Gt,e,"f"),te(this,Qt,ee(this,Qt,"f")?ee(this,Qt,"f").reset(n):lt(this,ee(this,Vt,"f")),"f"),te(this,Zt,ee(this,Zt,"f")?ee(this,Zt,"f").reset(n):function(t,e,n){const s=n.y18n.__,i=n.y18n.__n,r={nonOptionCount:function(n){const s=t.getDemandedCommands(),r=n._.length+(n["--"]?n["--"].length:0)-t.getInternalMethods().getContext().commands.length;s._&&(r<s._.min||r>s._.max)&&(r<s._.min?void 0!==s._.minMsg?e.fail(s._.minMsg?s._.minMsg.replace(/\$0/g,r.toString()).replace(/\$1/,s._.min.toString()):null):e.fail(i("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",r,r.toString(),s._.min.toString())):r>s._.max&&(void 0!==s._.maxMsg?e.fail(s._.maxMsg?s._.maxMsg.replace(/\$0/g,r.toString()).replace(/\$1/,s._.max.toString()):null):e.fail(i("Too many non-option arguments: got %s, maximum of %s","Too many non-option arguments: got %s, maximum of %s",r,r.toString(),s._.max.toString()))))},positionalCount:function(t,n){n<t&&e.fail(i("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",n,n+"",t+""))},requiredArguments:function(t,n){let s=null;for(const e of Object.keys(n))Object.prototype.hasOwnProperty.call(t,e)&&void 0!==t[e]||(s=s||{},s[e]=n[e]);if(s){const t=[];for(const e of Object.keys(s)){const n=s[e];n&&t.indexOf(n)<0&&t.push(n)}const n=t.length?`\n${t.join("\n")}`:"";e.fail(i("Missing required argument: %s","Missing required arguments: %s",Object.keys(s).length,Object.keys(s).join(", ")+n))}},unknownArguments:function(n,s,o,a,c=!0){var l;const h=t.getInternalMethods().getCommandInstance().getCommands(),u=[],d=t.getInternalMethods().getContext();if(Object.keys(n).forEach((e=>{mt.includes(e)||Object.prototype.hasOwnProperty.call(o,e)||Object.prototype.hasOwnProperty.call(t.getInternalMethods().getParseContext(),e)||r.isValidAndSomeAliasIsNotNew(e,s)||u.push(e)})),c&&(d.commands.length>0||h.length>0||a)&&n._.slice(d.commands.length).forEach((t=>{h.includes(""+t)||u.push(""+t)})),c){const e=(null===(l=t.getDemandedCommands()._)||void 0===l?void 0:l.max)||0,s=d.commands.length+e;s<n._.length&&n._.slice(s).forEach((t=>{t=String(t),d.commands.includes(t)||u.includes(t)||u.push(t)}))}u.length&&e.fail(i("Unknown argument: %s","Unknown arguments: %s",u.length,u.map((t=>t.trim()?t:`"${t}"`)).join(", ")))},unknownCommands:function(n){const s=t.getInternalMethods().getCommandInstance().getCommands(),r=[],o=t.getInternalMethods().getContext();return(o.commands.length>0||s.length>0)&&n._.slice(o.commands.length).forEach((t=>{s.includes(""+t)||r.push(""+t)})),r.length>0&&(e.fail(i("Unknown command: %s","Unknown commands: %s",r.length,r.join(", "))),!0)},isValidAndSomeAliasIsNotNew:function(e,n){if(!Object.prototype.hasOwnProperty.call(n,e))return!1;const s=t.parsed.newAliases;return[e,...n[e]].some((t=>!Object.prototype.hasOwnProperty.call(s,t)||!s[e]))},limitedChoices:function(n){const i=t.getOptions(),r={};if(!Object.keys(i.choices).length)return;Object.keys(n).forEach((t=>{-1===mt.indexOf(t)&&Object.prototype.hasOwnProperty.call(i.choices,t)&&[].concat(n[t]).forEach((e=>{-1===i.choices[t].indexOf(e)&&void 0!==e&&(r[t]=(r[t]||[]).concat(e))}))}));const o=Object.keys(r);if(!o.length)return;let a=s("Invalid values:");o.forEach((t=>{a+=`\n ${s("Argument: %s, Given: %s, Choices: %s",t,e.stringifiedValues(r[t]),e.stringifiedValues(i.choices[t]))}`})),e.fail(a)}};let o={};function a(t,e){const n=Number(e);return"number"==typeof(e=isNaN(n)?e:n)?e=t._.length>=e:e.match(/^--no-.+/)?(e=e.match(/^--no-(.+)/)[1],e=!Object.prototype.hasOwnProperty.call(t,e)):e=Object.prototype.hasOwnProperty.call(t,e),e}r.implies=function(e,s){J("<string|object> [array|number|string]",[e,s],arguments.length),"object"==typeof e?Object.keys(e).forEach((t=>{r.implies(t,e[t])})):(t.global(e),o[e]||(o[e]=[]),Array.isArray(s)?s.forEach((t=>r.implies(e,t))):(H(s,void 0,n),o[e].push(s)))},r.getImplied=function(){return o},r.implications=function(t){const n=[];if(Object.keys(o).forEach((e=>{const s=e;(o[e]||[]).forEach((e=>{let i=s;const r=e;i=a(t,i),e=a(t,e),i&&!e&&n.push(` ${s} -> ${r}`)}))})),n.length){let t=`${s("Implications failed:")}\n`;n.forEach((e=>{t+=e})),e.fail(t)}};let c={};r.conflicts=function(e,n){J("<string|object> [array|string]",[e,n],arguments.length),"object"==typeof e?Object.keys(e).forEach((t=>{r.conflicts(t,e[t])})):(t.global(e),c[e]||(c[e]=[]),Array.isArray(n)?n.forEach((t=>r.conflicts(e,t))):c[e].push(n))},r.getConflicting=()=>c,r.conflicting=function(i){Object.keys(i).forEach((t=>{c[t]&&c[t].forEach((n=>{n&&void 0!==i[t]&&void 0!==i[n]&&e.fail(s("Arguments %s and %s are mutually exclusive",t,n))}))})),t.getInternalMethods().getParserConfiguration()["strip-dashed"]&&Object.keys(c).forEach((t=>{c[t].forEach((r=>{r&&void 0!==i[n.Parser.camelCase(t)]&&void 0!==i[n.Parser.camelCase(r)]&&e.fail(s("Arguments %s and %s are mutually exclusive",t,r))}))}))},r.recommendCommands=function(t,n){n=n.sort(((t,e)=>e.length-t.length));let i=null,r=1/0;for(let e,s=0;void 0!==(e=n[s]);s++){const n=pt(t,e);n<=3&&n<r&&(r=n,i=e)}i&&e.fail(s("Did you mean %s?",i))},r.reset=function(t){return o=ot(o,(e=>!t[e])),c=ot(c,(e=>!t[e])),r};const l=[];return r.freeze=function(){l.push({implied:o,conflicting:c})},r.unfreeze=function(){const t=l.pop();H(t,void 0,n),({implied:o,conflicting:c}=t)},r}(this,ee(this,Qt,"f"),ee(this,Vt,"f")),"f"),te(this,wt,ee(this,wt,"f")?ee(this,wt,"f").reset():function(t,e,n,s){return new st(t,e,n,s)}(ee(this,Qt,"f"),ee(this,Zt,"f"),ee(this,$t,"f"),ee(this,Vt,"f")),"f"),ee(this,Et,"f")||te(this,Et,function(t,e,n,s){return new ft(t,e,n,s)}(this,ee(this,Qt,"f"),ee(this,wt,"f"),ee(this,Vt,"f")),"f"),ee(this,$t,"f").reset(),te(this,jt,null,"f"),te(this,Ft,"","f"),te(this,Ct,null,"f"),te(this,It,!1,"f"),this.parsed=!1,this}[$e](t,e){return ee(this,Vt,"f").path.relative(t,e)}[Ie](t,e,n,s=0,i=!1){let r=!!n||i;t=t||ee(this,zt,"f"),ee(this,Gt,"f").__=ee(this,Vt,"f").y18n.__,ee(this,Gt,"f").configuration=this[ce]();const o=!!ee(this,Gt,"f").configuration["populate--"],a=Object.assign({},ee(this,Gt,"f").configuration,{"populate--":!0}),c=ee(this,Vt,"f").Parser.detailed(t,Object.assign({},ee(this,Gt,"f"),{configuration:{"parse-positional-numbers":!1,...a}})),l=Object.assign(c.argv,ee(this,Ut,"f"));let h;const u=c.aliases;let d=!1,f=!1;Object.keys(l).forEach((t=>{t===ee(this,Tt,"f")&&l[t]?d=!0:t===ee(this,Xt,"f")&&l[t]&&(f=!0)})),l.$0=this.$0,this.parsed=c,0===s&&ee(this,Qt,"f").clearCachedHelpMessage();try{if(this[le](),e)return this[Pe](l,o,!!n,!1);if(ee(this,Tt,"f")){[ee(this,Tt,"f")].concat(u[ee(this,Tt,"f")]||[]).filter((t=>t.length>1)).includes(""+l._[l._.length-1])&&(l._.pop(),d=!0)}te(this,Nt,!1,"f");const a=ee(this,wt,"f").getCommands(),p=ee(this,Et,"f").completionKey in l,m=d||p||i;if(l._.length){if(a.length){let t;for(let e,r=s||0;void 0!==l._[r];r++){if(e=String(l._[r]),a.includes(e)&&e!==ee(this,jt,"f")){const t=ee(this,wt,"f").runCommand(e,this,c,r+1,i,d||f||i);return this[Pe](t,o,!!n,!1)}if(!t&&e!==ee(this,jt,"f")){t=e;break}}!ee(this,wt,"f").hasDefaultCommand()&&ee(this,qt,"f")&&t&&!m&&ee(this,Zt,"f").recommendCommands(t,a)}ee(this,jt,"f")&&l._.includes(ee(this,jt,"f"))&&!p&&(ee(this,At,"f")&&at(!0),this.showCompletionScript(),this.exit(0))}if(ee(this,wt,"f").hasDefaultCommand()&&!m){const t=ee(this,wt,"f").runCommand(null,this,c,0,i,d||f||i);return this[Pe](t,o,!!n,!1)}if(p){ee(this,At,"f")&&at(!0);const e=(t=[].concat(t)).slice(t.indexOf(`--${ee(this,Et,"f").completionKey}`)+1);return ee(this,Et,"f").getCompletion(e,((t,e)=>{if(t)throw new N(t.message);(e||[]).forEach((t=>{ee(this,Lt,"f").log(t)})),this.exit(0)})),this[Pe](l,!o,!!n,!1)}if(ee(this,It,"f")||(d?(ee(this,At,"f")&&at(!0),r=!0,this.showHelp("log"),this.exit(0)):f&&(ee(this,At,"f")&&at(!0),r=!0,ee(this,Qt,"f").showVersion("log"),this.exit(0))),!r&&ee(this,Gt,"f").skipValidation.length>0&&(r=Object.keys(l).some((t=>ee(this,Gt,"f").skipValidation.indexOf(t)>=0&&!0===l[t]))),!r){if(c.error)throw new N(c.error.message);if(!p){const t=this[Te](u,{},c.error);n||(h=tt(l,this,ee(this,$t,"f").getMiddleware(),!0)),h=this[we](t,null!=h?h:l),V(h)&&!n&&(h=h.then((()=>tt(l,this,ee(this,$t,"f").getMiddleware(),!1))))}}}catch(t){if(!(t instanceof N))throw t;ee(this,Qt,"f").fail(t.message,t)}return this[Pe](null!=h?h:l,o,!!n,!0)}[Te](t,e,n,s){const i={...this.getDemandedOptions()};return r=>{if(n)throw new N(n.message);ee(this,Zt,"f").nonOptionCount(r),ee(this,Zt,"f").requiredArguments(r,i);let o=!1;ee(this,Yt,"f")&&(o=ee(this,Zt,"f").unknownCommands(r)),ee(this,Kt,"f")&&!o?ee(this,Zt,"f").unknownArguments(r,t,e,!!s):ee(this,Jt,"f")&&ee(this,Zt,"f").unknownArguments(r,t,{},!1,!1),ee(this,Zt,"f").limitedChoices(r),ee(this,Zt,"f").implications(r),ee(this,Zt,"f").conflicting(r)}}[Ne](){te(this,It,!0,"f")}[Le](t){if("string"==typeof t)ee(this,Gt,"f").key[t]=!0;else for(const e of t)ee(this,Gt,"f").key[e]=!0}}const Ge=(De=B,(t=[],e=De.process.cwd(),n)=>{const s=new Fe(t,e,n,De);return Object.defineProperty(s,"argv",{get:()=>s.parse(),enumerable:!0}),s.help(),s.version(),s});var De;const We=Ge;function Re(t,e){const n=t.startsWith(".")?(0,m.join)(e,t):t;return import(n)}function Ue(t,e){const{homepage:n,site:s=n,repository:i}=e,r=s&&s!==i,o=t.getInternalMethods(),a=(c=o.getCommandInstance().handlers,Object.keys(c).some((t=>t&&"$0"!==t)));var c;return 0===o.getUsageInstance().getUsage().length&&(a?t.usage("Usage: $0 <command>"):t.usage("Usage: $0")),a&&t.demandCommand(1,"Won't work without a command"),r&&t.epilogue(`Website: ${s}`),i&&t.epilogue(`Repository: ${i}`),t}var Be=a(21192);const He="git",ze="",qe=process.cwd();function Ve(){try{return function(){try{return Boolean((0,Be.PS)("git",["--version"],{cwd:qe}).stdout)}catch{throw new Error("git is not installed")}}()&&function(){try{return"true"===(0,Be.PS)("git",["rev-parse","--is-inside-work-tree"],{cwd:qe}).stdout}catch{throw new Error("not a git repository")}}()}catch(t){return console.error("Fail:",t.message),!1}}function Ke(t){t.command("hooks","Set .githooks as git.hooksPath",{},(()=>{Ve()&&(0,Be.r)("git",["config","core.hooksPath",".githooks"],{cwd:qe}).then((()=>{console.log("Done: set .githooks")})).catch((()=>{console.error("Fail:","setting hooks failed"),process.exitCode=1}))})),t.demandCommand(1,"Typing `hooks`")}const Ye=t(import.meta.url)("node:module"),Je=t(import.meta.url)("module"),Qe=process.cwd();const Xe=(0,Je.createRequire)(import.meta.url);function Ze(t,e=Qe){return t.startsWith(".")?(0,m.resolve)(e,t):(0,m.isAbsolute)(t)?t:Xe.resolve(t)}function tn(t){try{return(0,s.statSync)(Ze(t)),!0}catch{return!1}}function en(t,e={}){const n=function(t){try{const e=(0,s.readFileSync)(Ze(t),"utf8");return JSON.parse(e)}catch{return{}}}("./package.json");if(t){const{[t]:s=e}=n;return s}return n}var nn=a(93977),sn=a(49411);const rn={"body-leading-blank":[1,"always"],"body-max-line-length":[2,"always",100],"footer-leading-blank":[1,"always"],"footer-max-line-length":[2,"always",100],"header-max-length":[2,"always",100],"subject-case":[0],"subject-empty":[2,"never"],"subject-full-stop":[2,"never","."],"type-case":[2,"always","lower-case"],"type-empty":[2,"never"],"type-enum":[2,"always",["build","chore","ci","docs","feat","fix","perf","refactor","revert","style","test"]],"scope-case":[0],"body-case":[0],"header-case":[0]};function on(){return(0,nn.readFile)((0,sn.resolve)(process.cwd(),".git/COMMIT_EDITMSG"),"utf8")}function an(t){t.command("commit","Lint git commit message",{},(()=>{(async function(){const t=await on(),e=await Promise.all([a.e(402),a.e(600)]).then(a.t.bind(a,69402,19)).then((t=>t.default.default||t.default)),n=await a.e(600).then(a.t.bind(a,93794,19)).then((t=>t.default.default||t.default)),s=await e(t,rn);return{result:s,output:await n({results:[s]})}})().then((({result:t,output:e})=>{t.valid?console.log("Pass."):(console.log("Fail:"),console.log(e),process.exitCode=1)})).catch((t=>{console.error(t),process.exitCode=1}))}))}function cn({garou:t,stylelint:e,eslint:n,prettier:s}){const i=process.stdin.isTTY?" --color":"";return function(t){const e=Object.entries(t).map((([t,e])=>[t,e.filter(Boolean)])).filter((([t,e])=>e.length));return e.length>0?Object.fromEntries(e):void 0}({"*.{vue,html,htm,md}":[t&&"garou",s&&`prettier -w -u${i}`,e&&`stylelint --fix --custom-formatter=node_modules/stylelint-formatter-pretty${i}`,n&&`eslint --fix -f=pretty${i}`],"*.{ts,tsx,mts,cts}":[t&&"garou",s&&`prettier -w -u${i}`,n&&`eslint --fix -f=pretty${i}`],"*.{js,jsx,mjs,cjs,wxs,qs}":[t&&"garou",s&&`prettier -w -u${i}`,n&&`eslint --fix -f=pretty${i}`],"*.{c,sc,le,wx,q,tt,jx,ac}ss":[t&&"garou",s&&`prettier -w -u${i}`,e&&`stylelint --fix --custom-formatter=node_modules/stylelint-formatter-pretty${i}`],"*.{json,yml,yaml,svg}":[t&&"garou",s&&`prettier -w -u${i}`],"{*.{jsonc,webmanifest,editorconfig,toml},.{babel,npm}rc}":[s&&`prettier -w -u${i}`],"{*.jenkinsfile,{j,J}enkinsfile}":[s&&`prettier -w -u${i}`],"yarn.lock":[t&&"garou"]})}async function ln(){const{default:t}=await Promise.all([a.e(79),a.e(600)]).then(a.bind(a,71079));return t({allowEmpty:!0,concurrent:!0,config:cn(function(){const t=en("devDependencies");return{garou:"garou"in t,stylelint:"stylelint"in t,eslint:"eslint"in t,prettier:"prettier"in t}}()),cwd:process.cwd(),debug:!1,quiet:!1,relative:!1,shell:!1,stash:!0})}const hn="lint";function un(t){an(t),function(t){t.command("staged","Lint and format git staged files",{},(()=>{ln().then((t=>{process.exitCode=t?0:1})).catch((t=>{console.error(t),process.exitCode=1}))}))}(t),t.demandCommand(1,"Typing `commit` or `staged`")}process.on("SIGINT",(()=>{})),new class{constructor(t,e){this.root=e;const{bin:n,homepage:i,name:r="cheetor",repository:{url:o=""}={},version:a}="string"==typeof t?JSON.parse((0,s.readFileSync)(new URL(t,e))):t;this.homepage=i,this.repository=o.includes("github.com")?o.replace(/\.git$/,""):"";const c=We(process.argv.slice(2)).strict().alias("help","h").alias("version","v").hide("help").version(a).hide("version").detectLocale(!1),l=function(t,e){if("string"==typeof t||!t)return e;const n=Object.keys(t);return 1===n.length&&n[0]}(n,r);l&&c.scriptName(l),this.cli=Promise.resolve(c)}config(t){return this.cli=this.cli.then(t),this}command(...t){return this.cli=this.cli.then((e=>e.command(...t))),this}commandFrom(t){return this.cli=this.cli.then((async e=>{const n=await Re(t,this.root);return e.command(n)})),this}commandSafe(t){return this.cli=this.cli.then((e=>function(t,e){return Re(t,e).catch((t=>{if("ERR_MODULE_NOT_FOUND"===t.code&&t.message.endsWith(` imported from ${(0,y.fileURLToPath)(import.meta.url)}`))return!1;throw t}))}(t,this.root).then((t=>t&&t.command?e.command(t):e)))),this}commandSmart(t){return this.cli=this.cli.then((async e=>{const n=t();return n&&n.command?e.command(n):e})),this}website(t){return this.site=t,this}middleware(...t){return this.cli=this.cli.then((e=>e.middleware(...t))),this}setup(t){return this.cli.then((t=>Ue(t,this))).then((e=>"function"==typeof t?t(e.parse()):e.parse()))}}("../package.json",import.meta.url).website("https://www.npmjs.com/org/nice-move").command(n).command(e).commandSmart((function(){if(tn("svgo/package.json")&&tn("svgo-config/package.json"))return{command:"svgo",describe:"Run `svgo` to optimize `*.svg`",handler({_:[t,e="./"]}){const n=(0,Ye.createRequire)(import.meta.url);(0,Be.r)("svgo",["-r","-q","--pretty","--indent","2","--config",n.resolve("svgo-config"),"-f",e]).then((()=>{console.log("Done: calling svgo")})).catch((t=>{process.exitCode=1,console.error("Error:",t.message)}))}}})).setup()})();
2
+ import{createRequire as t}from"module";var e,n,s,i,r={8995:(t,e,n)=>{const s=n(32081),i=n(19015),r=n(95350);function o(t,e,n){const o=i(t,e,n),a=s.spawn(o.command,o.args,o.options);return r.hookChildProcess(a,o),a}t.exports=o,t.exports.spawn=o,t.exports.sync=function(t,e,n){const o=i(t,e,n),a=s.spawnSync(o.command,o.args,o.options);return a.error=a.error||r.verifyENOENTSync(a.status,o),a},t.exports._parse=i,t.exports._enoent=r},95350:t=>{const e="win32"===process.platform;function n(t,e){return Object.assign(new Error(`${e} ${t.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${e} ${t.command}`,path:t.command,spawnargs:t.args})}function s(t,s){return e&&1===t&&!s.file?n(s.original,"spawn"):null}t.exports={hookChildProcess:function(t,n){if(!e)return;const i=t.emit;t.emit=function(e,r){if("exit"===e){const e=s(r,n);if(e)return i.call(t,"error",e)}return i.apply(t,arguments)}},verifyENOENT:s,verifyENOENTSync:function(t,s){return e&&1===t&&!s.file?n(s.original,"spawnSync"):null},notFoundError:n}},19015:(t,e,n)=>{const s=n(71017),i=n(65358),r=n(16214),o=n(63106),a="win32"===process.platform,c=/\.(?:com|exe)$/i,l=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function h(t){if(!a)return t;const e=function(t){t.file=i(t);const e=t.file&&o(t.file);return e?(t.args.unshift(t.file),t.command=e,i(t)):t.file}(t),n=!c.test(e);if(t.options.forceShell||n){const n=l.test(e);t.command=s.normalize(t.command),t.command=r.command(t.command),t.args=t.args.map((t=>r.argument(t,n)));const i=[t.command].concat(t.args).join(" ");t.args=["/d","/s","/c",`"${i}"`],t.command=process.env.comspec||"cmd.exe",t.options.windowsVerbatimArguments=!0}return t}t.exports=function(t,e,n){e&&!Array.isArray(e)&&(n=e,e=null);const s={command:t,args:e=e?e.slice(0):[],options:n=Object.assign({},n),file:void 0,original:{command:t,args:e}};return n.shell?s:h(s)}},16214:t=>{const e=/([()\][%!^"`<>&|;, *?])/g;t.exports.command=function(t){return t=t.replace(e,"^$1")},t.exports.argument=function(t,n){return t=(t=`"${t=(t=(t=`${t}`).replace(/(\\*)"/g,'$1$1\\"')).replace(/(\\*)$/,"$1$1")}"`).replace(e,"^$1"),n&&(t=t.replace(e,"^$1")),t}},63106:(t,e,n)=>{const s=n(57147),i=n(14256);t.exports=function(t){const e=Buffer.alloc(150);let n;try{n=s.openSync(t,"r"),s.readSync(n,e,0,150,0),s.closeSync(n)}catch(t){}return i(e.toString())}},65358:(t,e,n)=>{const s=n(71017),i=n(89056),r=n(26569);function o(t,e){const n=t.options.env||process.env,o=process.cwd(),a=null!=t.options.cwd,c=a&&void 0!==process.chdir&&!process.chdir.disabled;if(c)try{process.chdir(t.options.cwd)}catch(t){}let l;try{l=i.sync(t.command,{path:n[r({env:n})],pathExt:e?s.delimiter:void 0})}catch(t){}finally{c&&process.chdir(o)}return l&&(l=s.resolve(a?t.options.cwd:"",l)),l}t.exports=function(t){return o(t)||o(t,!0)}},54337:(t,e,n)=>{const{PassThrough:s}=n(12781);t.exports=t=>{t={...t};const{array:e}=t;let{encoding:n}=t;const i="buffer"===n;let r=!1;e?r=!(n||i):n=n||"utf8",i&&(n=null);const o=new s({objectMode:r});n&&o.setEncoding(n);let a=0;const c=[];return o.on("data",(t=>{c.push(t),r?a=c.length:a+=t.length})),o.getBufferedValue=()=>e?c:i?Buffer.concat(c,a):c.join(""),o.getBufferedLength=()=>a,o}},22935:(t,e,n)=>{const{constants:s}=n(14300),i=n(12781),{promisify:r}=n(73837),o=n(54337),a=r(i.pipeline);class c extends Error{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}}async function l(t,e){if(!t)throw new Error("Expected a stream");e={maxBuffer:1/0,...e};const{maxBuffer:n}=e,i=o(e);return await new Promise(((e,r)=>{const o=t=>{t&&i.getBufferedLength()<=s.MAX_LENGTH&&(t.bufferedData=i.getBufferedValue()),r(t)};(async()=>{try{await a(t,i),e()}catch(t){o(t)}})(),i.on("data",(()=>{i.getBufferedLength()>n&&o(new c)}))})),i.getBufferedValue()}t.exports=l,t.exports.buffer=(t,e)=>l(t,{...e,encoding:"buffer"}),t.exports.array=(t,e)=>l(t,{...e,array:!0}),t.exports.MaxBufferError=c},5909:(t,e,n)=>{var s;n(57147);function i(t,e,n){if("function"==typeof e&&(n=e,e={}),!n){if("function"!=typeof Promise)throw new TypeError("callback not provided");return new Promise((function(n,s){i(t,e||{},(function(t,e){t?s(t):n(e)}))}))}s(t,e||{},(function(t,s){t&&("EACCES"===t.code||e&&e.ignoreErrors)&&(t=null,s=!1),n(t,s)}))}s="win32"===process.platform||global.TESTING_WINDOWS?n(90837):n(74703),t.exports=i,i.sync=function(t,e){try{return s.sync(t,e||{})}catch(t){if(e&&e.ignoreErrors||"EACCES"===t.code)return!1;throw t}}},74703:(t,e,n)=>{t.exports=i,i.sync=function(t,e){return r(s.statSync(t),e)};var s=n(57147);function i(t,e,n){s.stat(t,(function(t,s){n(t,!t&&r(s,e))}))}function r(t,e){return t.isFile()&&function(t,e){var n=t.mode,s=t.uid,i=t.gid,r=void 0!==e.uid?e.uid:process.getuid&&process.getuid(),o=void 0!==e.gid?e.gid:process.getgid&&process.getgid(),a=parseInt("100",8),c=parseInt("010",8),l=parseInt("001",8),h=a|c;return n&l||n&c&&i===o||n&a&&s===r||n&h&&0===r}(t,e)}},90837:(t,e,n)=>{t.exports=r,r.sync=function(t,e){return i(s.statSync(t),t,e)};var s=n(57147);function i(t,e,n){return!(!t.isSymbolicLink()&&!t.isFile())&&function(t,e){var n=void 0!==e.pathExt?e.pathExt:process.env.PATHEXT;if(!n)return!0;if(-1!==(n=n.split(";")).indexOf(""))return!0;for(var s=0;s<n.length;s++){var i=n[s].toLowerCase();if(i&&t.substr(-i.length).toLowerCase()===i)return!0}return!1}(e,n)}function r(t,e,n){s.stat(t,(function(s,r){n(s,!s&&i(r,t,e))}))}},90873:(t,e,n)=>{const{PassThrough:s}=n(12781);t.exports=function(){var t=[],e=new s({objectMode:!0});return e.setMaxListeners(0),e.add=n,e.isEmpty=function(){return 0==t.length},e.on("unpipe",i),Array.prototype.slice.call(arguments).forEach(n),e;function n(s){return Array.isArray(s)?(s.forEach(n),this):(t.push(s),s.once("end",i.bind(null,s)),s.once("error",e.emit.bind(e,"error")),s.pipe(e,{end:!1}),this)}function i(n){!(t=t.filter((function(t){return t!==n}))).length&&e.readable&&e.end()}}},26569:t=>{const e=(t={})=>{const e=t.env||process.env;return"win32"!==(t.platform||process.platform)?"PATH":Object.keys(e).reverse().find((t=>"PATH"===t.toUpperCase()))||"Path"};t.exports=e,t.exports.default=e},14256:(t,e,n)=>{const s=n(83882);t.exports=(t="")=>{const e=t.match(s);if(!e)return null;const[n,i]=e[0].replace(/#! ?/,"").split(" "),r=n.split("/").pop();return"env"===r?i:i?`${r} ${i}`:r}},83882:t=>{t.exports=/^#!(.*)/},90260:(t,e,n)=>{var s=global.process;const i=function(t){return t&&"object"==typeof t&&"function"==typeof t.removeListener&&"function"==typeof t.emit&&"function"==typeof t.reallyExit&&"function"==typeof t.listeners&&"function"==typeof t.kill&&"number"==typeof t.pid&&"function"==typeof t.on};if(i(s)){var r,o=n(39491),a=n(83261),c=/^win/i.test(s.platform),l=n(82361);"function"!=typeof l&&(l=l.EventEmitter),s.__signal_exit_emitter__?r=s.__signal_exit_emitter__:((r=s.__signal_exit_emitter__=new l).count=0,r.emitted={}),r.infinite||(r.setMaxListeners(1/0),r.infinite=!0),t.exports=function(t,e){if(!i(global.process))return function(){};o.equal(typeof t,"function","a callback must be provided for exit handler"),!1===f&&p();var n="exit";e&&e.alwaysLast&&(n="afterexit");return r.on(n,t),function(){r.removeListener(n,t),0===r.listeners("exit").length&&0===r.listeners("afterexit").length&&h()}};var h=function(){f&&i(global.process)&&(f=!1,a.forEach((function(t){try{s.removeListener(t,d[t])}catch(t){}})),s.emit=y,s.reallyExit=m,r.count-=1)};t.exports.unload=h;var u=function(t,e,n){r.emitted[t]||(r.emitted[t]=!0,r.emit(t,e,n))},d={};a.forEach((function(t){d[t]=function(){i(global.process)&&(s.listeners(t).length===r.count&&(h(),u("exit",null,t),u("afterexit",null,t),c&&"SIGHUP"===t&&(t="SIGINT"),s.kill(s.pid,t)))}})),t.exports.signals=function(){return a};var f=!1,p=function(){!f&&i(global.process)&&(f=!0,r.count+=1,a=a.filter((function(t){try{return s.on(t,d[t]),!0}catch(t){return!1}})),s.emit=b,s.reallyExit=g)};t.exports.load=p;var m=s.reallyExit,g=function(t){i(global.process)&&(s.exitCode=t||0,u("exit",s.exitCode,null),u("afterexit",s.exitCode,null),m.call(s,s.exitCode))},y=s.emit,b=function(t,e){if("exit"===t&&i(global.process)){void 0!==e&&(s.exitCode=e);var n=y.apply(this,arguments);return u("exit",s.exitCode,null),u("afterexit",s.exitCode,null),n}return y.apply(this,arguments)}}else t.exports=function(){return function(){}}},83261:t=>{t.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"],"win32"!==process.platform&&t.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),"linux"===process.platform&&t.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")},89056:(t,e,n)=>{const s="win32"===process.platform||"cygwin"===process.env.OSTYPE||"msys"===process.env.OSTYPE,i=n(71017),r=s?";":":",o=n(5909),a=t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),c=(t,e)=>{const n=e.colon||r,i=t.match(/\//)||s&&t.match(/\\/)?[""]:[...s?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(n)],o=s?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",a=s?o.split(n):[""];return s&&-1!==t.indexOf(".")&&""!==a[0]&&a.unshift(""),{pathEnv:i,pathExt:a,pathExtExe:o}},l=(t,e,n)=>{"function"==typeof e&&(n=e,e={}),e||(e={});const{pathEnv:s,pathExt:r,pathExtExe:l}=c(t,e),h=[],u=n=>new Promise(((r,o)=>{if(n===s.length)return e.all&&h.length?r(h):o(a(t));const c=s[n],l=/^".*"$/.test(c)?c.slice(1,-1):c,u=i.join(l,t),f=!l&&/^\.[\\\/]/.test(t)?t.slice(0,2)+u:u;r(d(f,n,0))})),d=(t,n,s)=>new Promise(((i,a)=>{if(s===r.length)return i(u(n+1));const c=r[s];o(t+c,{pathExt:l},((r,o)=>{if(!r&&o){if(!e.all)return i(t+c);h.push(t+c)}return i(d(t,n,s+1))}))}));return n?u(0).then((t=>n(null,t)),n):u(0)};t.exports=l,l.sync=(t,e)=>{e=e||{};const{pathEnv:n,pathExt:s,pathExtExe:r}=c(t,e),l=[];for(let a=0;a<n.length;a++){const c=n[a],h=/^".*"$/.test(c)?c.slice(1,-1):c,u=i.join(h,t),d=!h&&/^\.[\\\/]/.test(t)?t.slice(0,2)+u:u;for(let t=0;t<s.length;t++){const n=d+s[t];try{if(o.sync(n,{pathExt:r})){if(!e.all)return n;l.push(n)}}catch(t){}}}if(e.all&&l.length)return l;if(e.nothrow)return null;throw a(t)}},39491:e=>{e.exports=t(import.meta.url)("assert")},14300:e=>{e.exports=t(import.meta.url)("buffer")},32081:e=>{e.exports=t(import.meta.url)("child_process")},3906:e=>{e.exports=t(import.meta.url)("enquirer")},82361:e=>{e.exports=t(import.meta.url)("events")},57147:e=>{e.exports=t(import.meta.url)("fs")},87561:e=>{e.exports=t(import.meta.url)("node:fs")},93977:e=>{e.exports=t(import.meta.url)("node:fs/promises")},70612:e=>{e.exports=t(import.meta.url)("node:os")},49411:e=>{e.exports=t(import.meta.url)("node:path")},97742:e=>{e.exports=t(import.meta.url)("node:process")},25997:e=>{e.exports=t(import.meta.url)("node:tty")},22037:e=>{e.exports=t(import.meta.url)("os")},71017:e=>{e.exports=t(import.meta.url)("path")},12781:e=>{e.exports=t(import.meta.url)("stream")},76224:e=>{e.exports=t(import.meta.url)("tty")},73837:e=>{e.exports=t(import.meta.url)("util")},21192:(e,n,s)=>{s.d(n,{r:()=>St,cF:()=>At,PS:()=>Ct});const i=t(import.meta.url)("node:buffer");var r=s(49411);const o=t(import.meta.url)("node:child_process");var a=s(97742),c=s(8995);const l=t(import.meta.url)("node:url");function h(t={}){const{env:e=process.env,platform:n=process.platform}=t;return"win32"!==n?"PATH":Object.keys(e).reverse().find((t=>"PATH"===t.toUpperCase()))||"Path"}function u({env:t=a.env,...e}={}){const n=h({env:t={...t}});return e.path=t[n],t[n]=function(t={}){const{cwd:e=a.cwd(),path:n=a.env[h()],execPath:s=a.execPath}=t;let i;const o=e instanceof URL?l.fileURLToPath(e):e;let c=r.resolve(o);const u=[];for(;i!==c;)u.push(r.join(c,"node_modules/.bin")),i=c,c=r.resolve(c,"..");return u.push(r.resolve(o,s,"..")),[...u,n].join(r.delimiter)}(e),t}const d=(t,e,n,s)=>{if("length"===n||"prototype"===n)return;if("arguments"===n||"caller"===n)return;const i=Object.getOwnPropertyDescriptor(t,n),r=Object.getOwnPropertyDescriptor(e,n);!f(i,r)&&s||Object.defineProperty(t,n,r)},f=function(t,e){return void 0===t||t.configurable||t.writable===e.writable&&t.enumerable===e.enumerable&&t.configurable===e.configurable&&(t.writable||t.value===e.value)},p=(t,e)=>`/* Wrapped ${t}*/\n${e}`,m=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),g=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name");function y(t,e,{ignoreNonConfigurable:n=!1}={}){const{name:s}=t;for(const s of Reflect.ownKeys(e))d(t,e,s,n);return((t,e)=>{const n=Object.getPrototypeOf(e);n!==Object.getPrototypeOf(t)&&Object.setPrototypeOf(t,n)})(t,e),((t,e,n)=>{const s=""===n?"":`with ${n.trim()}() `,i=p.bind(null,s,e.toString());Object.defineProperty(i,"name",g),Object.defineProperty(t,"toString",{...m,value:i})})(t,e,s),t}const b=new WeakMap,v=(t,e={})=>{if("function"!=typeof t)throw new TypeError("Expected a function");let n,s=0;const i=t.displayName||t.name||"<anonymous>",r=function(...o){if(b.set(r,++s),1===s)n=t.apply(this,o),t=null;else if(!0===e.throw)throw new Error(`Function \`${i}\` can only be called once`);return n};return y(r,t),b.set(r,s),r};v.callCount=t=>{if(!b.has(t))throw new Error(`The given function \`${t.name}\` is not wrapped by the \`onetime\` package`);return b.get(t)};const w=v;var O=s(70612);const x=(t,e)=>({name:`SIGRT${e+1}`,number:E+e,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),E=34,j=64,S=[{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"}],C=()=>{const t=(()=>{const t=j-E+1;return Array.from({length:t},x)})();return[...S,...t].map(_)},_=({name:t,number:e,description:n,action:s,forced:i=!1,standard:r})=>{const{signals:{[t]:o}}=O.constants,a=void 0!==o;return{name:t,number:a?o:e,description:n,supported:a,action:s,forced:i,standard:r}},k=({name:t,number:e,description:n,supported:s,action:i,forced:r,standard:o})=>[t,{name:t,number:e,description:n,supported:s,action:i,forced:r,standard:o}],A=(()=>{const t=C();return Object.fromEntries(t.map(k))})(),P=(t,e)=>{const n=$(t,e);if(void 0===n)return{};const{name:s,description:i,supported:r,action:o,forced:a,standard:c}=n;return{[t]:{name:s,number:t,description:i,supported:r,action:o,forced:a,standard:c}}},$=(t,e)=>{const n=e.find((({name:e})=>O.constants.signals[e]===t));return void 0!==n?n:e.find((e=>e.number===t))},I=((()=>{const t=C(),e=j+1,n=Array.from({length:e},((e,n)=>P(n,t)));Object.assign({},...n)})(),({stdout:t,stderr:e,all:n,error:s,signal:i,exitCode:r,command:o,escapedCommand:a,timedOut:c,isCanceled:l,killed:h,parsed:{options:{timeout:u}}})=>{r=null===r?void 0:r;const d=void 0===(i=null===i?void 0:i)?void 0:A[i].description,f=(({timedOut:t,timeout:e,errorCode:n,signal:s,signalDescription:i,exitCode:r,isCanceled:o})=>t?`timed out after ${e} milliseconds`:o?"was canceled":void 0!==n?`failed with ${n}`:void 0!==s?`was killed with ${s} (${i})`:void 0!==r?`failed with exit code ${r}`:"failed")({timedOut:c,timeout:u,errorCode:s&&s.code,signal:i,signalDescription:d,exitCode:r,isCanceled:l}),p=`Command ${f}: ${o}`,m="[object Error]"===Object.prototype.toString.call(s),g=m?`${p}\n${s.message}`:p,y=[g,e,t].filter(Boolean).join("\n");return m?(s.originalMessage=s.message,s.message=y):s=new Error(y),s.shortMessage=g,s.command=o,s.escapedCommand=a,s.exitCode=r,s.signal=i,s.signalDescription=d,s.stdout=t,s.stderr=e,void 0!==n&&(s.all=n),"bufferedData"in s&&delete s.bufferedData,s.failed=!0,s.timedOut=Boolean(c),s.isCanceled=l,s.killed=h&&!c,s}),M=["stdin","stdout","stderr"],T=t=>{if(!t)return;const{stdio:e}=t;if(void 0===e)return M.map((e=>t[e]));if((t=>M.some((e=>void 0!==t[e])))(t))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${M.map((t=>`\`${t}\``)).join(", ")}`);if("string"==typeof e)return e;if(!Array.isArray(e))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof e}\``);const n=Math.max(e.length,M.length);return Array.from({length:n},((t,n)=>e[n]))};var N=s(90260);const L=(t,e="SIGTERM",n={})=>{const s=t(e);return F(t,e,n,s),s},F=(t,e,n,s)=>{if(!G(e,n,s))return;const i=W(n),r=setTimeout((()=>{t("SIGKILL")}),i);r.unref&&r.unref()},G=(t,{forceKillAfterTimeout:e},n)=>D(t)&&!1!==e&&n,D=t=>t===O.constants.signals.SIGTERM||"string"==typeof t&&"SIGTERM"===t.toUpperCase(),W=({forceKillAfterTimeout:t=!0})=>{if(!0===t)return 5e3;if(!Number.isFinite(t)||t<0)throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${t}\` (${typeof t})`);return t},U=(t,e)=>{t.kill()&&(e.isCanceled=!0)},R=(t,{timeout:e,killSignal:n="SIGTERM"},s)=>{if(0===e||void 0===e)return s;let i;const r=new Promise(((s,r)=>{i=setTimeout((()=>{((t,e,n)=>{t.kill(e),n(Object.assign(new Error("Timed out"),{timedOut:!0,signal:e}))})(t,n,r)}),e)})),o=s.finally((()=>{clearTimeout(i)}));return Promise.race([r,o])},B=({timeout:t})=>{if(void 0!==t&&(!Number.isFinite(t)||t<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${t}\` (${typeof t})`)},z=async(t,{cleanup:e,detached:n},s)=>{if(!e||n)return s;const i=N((()=>{t.kill()}));return s.finally((()=>{i()}))};var H=s(87561);function q(t){return null!==t&&"object"==typeof t&&"function"==typeof t.pipe}function V(t){return q(t)&&!1!==t.writable&&"function"==typeof t._write&&"object"==typeof t._writableState}const K=(t,e,n)=>{if("string"==typeof n)return t[e].pipe((0,H.createWriteStream)(n)),t;if(V(n))return t[e].pipe(n),t;if(!(t=>t instanceof o.ChildProcess&&"function"==typeof t.then)(n))throw new TypeError("The second argument must be a string, a stream or an Execa child process.");if(!V(n.stdin))throw new TypeError("The target child process's stdin must be available.");return t[e].pipe(n.stdin),n},Y=t=>{null!==t.stdout&&(t.pipeStdout=K.bind(void 0,t,"stdout")),null!==t.stderr&&(t.pipeStderr=K.bind(void 0,t,"stderr")),void 0!==t.all&&(t.pipeAll=K.bind(void 0,t,"all"))};var J=s(22935),Q=s(90873);const X=t=>{if(void 0!==t)throw new TypeError("The `input` and `inputFile` options cannot be both set.")},Z=t=>{const e=(({input:t,inputFile:e})=>"string"!=typeof e?t:(X(t),(0,H.readFileSync)(e)))(t);if(q(e))throw new TypeError("The `input` option cannot be a stream in sync mode");return e},tt=(t,e)=>{const n=(({input:t,inputFile:e})=>"string"!=typeof e?t:(X(t),(0,H.createReadStream)(e)))(e);void 0!==n&&(q(n)?n.pipe(t.stdin):t.stdin.end(n))},et=(t,{all:e})=>{if(!e||!t.stdout&&!t.stderr)return;const n=Q();return t.stdout&&n.add(t.stdout),t.stderr&&n.add(t.stderr),n},nt=async(t,e)=>{if(t&&void 0!==e){t.destroy();try{return await e}catch(t){return t.bufferedData}}},st=(t,{encoding:e,buffer:n,maxBuffer:s})=>{if(t&&n)return e?J(t,{encoding:e,maxBuffer:s}):J.buffer(t,{maxBuffer:s})},it=async({stdout:t,stderr:e,all:n},{encoding:s,buffer:i,maxBuffer:r},o)=>{const a=st(t,{encoding:s,buffer:i,maxBuffer:r}),c=st(e,{encoding:s,buffer:i,maxBuffer:r}),l=st(n,{encoding:s,buffer:i,maxBuffer:2*r});try{return await Promise.all([o,a,c,l])}catch(s){return Promise.all([{error:s,signal:s.signal,timedOut:s.timedOut},nt(t,a),nt(e,c),nt(n,l)])}},rt=(async()=>{})().constructor.prototype,ot=["then","catch","finally"].map((t=>[t,Reflect.getOwnPropertyDescriptor(rt,t)])),at=(t,e)=>{for(const[n,s]of ot){const i="function"==typeof e?(...t)=>Reflect.apply(s.value,e(),t):s.value.bind(e);Reflect.defineProperty(t,n,{...s,value:i})}},ct=t=>new Promise(((e,n)=>{t.on("exit",((t,n)=>{e({exitCode:t,signal:n})})),t.on("error",(t=>{n(t)})),t.stdin&&t.stdin.on("error",(t=>{n(t)}))})),lt=(t,e=[])=>Array.isArray(e)?[t,...e]:[t],ht=/^[\w.-]+$/,ut=/"/g,dt=(t,e)=>lt(t,e).join(" "),ft=(t,e)=>lt(t,e).map((t=>(t=>"string"!=typeof t||ht.test(t)?t:`"${t.replace(ut,'\\"')}"`)(t))).join(" "),pt=/ +/g,mt=t=>{const e=[];for(const n of t.trim().split(pt)){const t=e[e.length-1];t&&t.endsWith("\\")?e[e.length-1]=`${t.slice(0,-1)} ${n}`:e.push(n)}return e},gt=t=>{const e=typeof t;if("string"===e)return t;if("number"===e)return String(t);if("object"===e&&null!==t&&!(t instanceof o.ChildProcess)&&"stdout"in t){const e=typeof t.stdout;if("string"===e)return t.stdout;if(i.Buffer.isBuffer(t.stdout))return t.stdout.toString();throw new TypeError(`Unexpected "${e}" stdout in template expression`)}throw new TypeError(`Unexpected "${e}" in template expression`)},yt=(t,e,n)=>n||0===t.length||0===e.length?[...t,...e]:[...t.slice(0,-1),`${t[t.length-1]}${e[0]}`,...e.slice(1)],bt=({templates:t,expressions:e,tokens:n,index:s,template:i})=>{const r=i??t.raw[s],o=r.split(pt).filter(Boolean),a=yt(n,o,r.startsWith(" "));if(s===e.length)return a;const c=e[s],l=Array.isArray(c)?c.map((t=>gt(t))):[gt(c)];return yt(a,l,r.endsWith(" "))},vt=(t,e)=>{let n=[];for(const[s,i]of t.entries())n=bt({templates:t,expressions:e,tokens:n,index:s,template:i});return n},wt=(0,t(import.meta.url)("node:util").debuglog)("execa").enabled,Ot=(t,e)=>String(t).padStart(e,"0"),xt=(t,{verbose:e})=>{e&&a.stderr.write(`[${(()=>{const t=new Date;return`${Ot(t.getHours(),2)}:${Ot(t.getMinutes(),2)}:${Ot(t.getSeconds(),2)}.${Ot(t.getMilliseconds(),3)}`})()}] ${t}\n`)},Et=(t,e,n={})=>{const s=c._parse(t,e,n);return t=s.command,e=s.args,(n={maxBuffer:1e8,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:(n=s.options).cwd||a.cwd(),execPath:a.execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,verbose:wt,...n}).env=(({env:t,extendEnv:e,preferLocal:n,localDir:s,execPath:i})=>{const r=e?{...a.env,...t}:t;return n?u({env:r,cwd:s,execPath:i}):r})(n),n.stdio=T(n),"win32"===a.platform&&"cmd"===r.basename(t,".exe")&&e.unshift("/q"),{file:t,args:e,options:n,parsed:s}},jt=(t,e,n)=>"string"==typeof e||i.Buffer.isBuffer(e)?t.stripFinalNewline?function(t){const e="string"==typeof t?"\n":"\n".charCodeAt(),n="string"==typeof t?"\r":"\r".charCodeAt();return t[t.length-1]===e&&(t=t.slice(0,-1)),t[t.length-1]===n&&(t=t.slice(0,-1)),t}(e):e:void 0===n?void 0:"";function St(t,e,n){const s=Et(t,e,n),i=dt(t,e),r=ft(t,e);let a;xt(r,s.options),B(s.options);try{a=o.spawn(s.file,s.args,s.options)}catch(t){const e=new o.ChildProcess,n=Promise.reject(I({error:t,stdout:"",stderr:"",all:"",command:i,escapedCommand:r,parsed:s,timedOut:!1,isCanceled:!1,killed:!1}));return at(e,n),e}const c=ct(a),l=R(a,s.options,c),h=z(a,s.options,l),u={isCanceled:!1};a.kill=L.bind(null,a.kill.bind(a)),a.cancel=U.bind(null,a,u);const d=w((async()=>{const[{error:t,exitCode:e,signal:n,timedOut:o},c,l,d]=await it(a,s.options,h),f=jt(s.options,c),p=jt(s.options,l),m=jt(s.options,d);if(t||0!==e||null!==n){const c=I({error:t,exitCode:e,signal:n,stdout:f,stderr:p,all:m,command:i,escapedCommand:r,parsed:s,timedOut:o,isCanceled:u.isCanceled||!!s.options.signal&&s.options.signal.aborted,killed:a.killed});if(!s.options.reject)return c;throw c}return{command:i,escapedCommand:r,exitCode:0,stdout:f,stderr:p,all:m,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}}));return tt(a,s.options),a.all=et(a,s.options),Y(a),at(a,d),a}function Ct(t,e,n){const s=Et(t,e,n),i=dt(t,e),r=ft(t,e);xt(r,s.options);const a=Z(s.options);let c;try{c=o.spawnSync(s.file,s.args,{...s.options,input:a})}catch(t){throw I({error:t,stdout:"",stderr:"",all:"",command:i,escapedCommand:r,parsed:s,timedOut:!1,isCanceled:!1,killed:!1})}const l=jt(s.options,c.stdout,c.error),h=jt(s.options,c.stderr,c.error);if(c.error||0!==c.status||null!==c.signal){const t=I({stdout:l,stderr:h,error:c.error,signal:c.signal,exitCode:c.status,command:i,escapedCommand:r,parsed:s,timedOut:c.error&&"ETIMEDOUT"===c.error.code,isCanceled:!1,killed:null!==c.signal});if(!s.options.reject)return t;throw t}return{command:i,escapedCommand:r,exitCode:0,stdout:l,stderr:h,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}}const _t=({input:t,inputFile:e,stdio:n})=>void 0===t&&void 0===e&&void 0===n?{stdin:"inherit"}:{},kt=(t={})=>({preferLocal:!0,..._t(t),...t});(function t(e){function n(n,...s){if(!Array.isArray(n))return t({...e,...n});const[i,...r]=vt(n,s);return St(i,r,kt(e))}return n.sync=(t,...n)=>{if(!Array.isArray(t))throw new TypeError("Please use $(options).sync`command` instead of $.sync(options)`command`.");const[s,...i]=vt(t,n);return Ct(s,i,kt(e))},n})();function At(t,e){const[n,...s]=mt(t);return St(n,s,e)}}},o={};function a(t){var e=o[t];if(void 0!==e)return e.exports;var n=o[t]={id:t,loaded:!1,exports:{}};return r[t].call(n.exports,n,n.exports,a),n.loaded=!0,n.exports}a.m=r,n=Object.getPrototypeOf?t=>Object.getPrototypeOf(t):t=>t.__proto__,a.t=function(t,s){if(1&s&&(t=this(t)),8&s)return t;if("object"==typeof t&&t){if(4&s&&t.__esModule)return t;if(16&s&&"function"==typeof t.then)return t}var i=Object.create(null);a.r(i);var r={};e=e||[null,n({}),n([]),n(n)];for(var o=2&s&&t;"object"==typeof o&&!~e.indexOf(o);o=n(o))Object.getOwnPropertyNames(o).forEach((e=>r[e]=()=>t[e]));return r.default=()=>t,a.d(i,r),i},a.d=(t,e)=>{for(var n in e)a.o(e,n)&&!a.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},a.f={},a.e=t=>Promise.all(Object.keys(a.f).reduce(((e,n)=>(a.f[n](t,e),e)),[])),a.u=t=>t+".mjs",a.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),a.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},a.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),s={442:0},i=t=>{var e,n,{ids:i,modules:r,runtime:o}=t,c=0;for(e in r)a.o(r,e)&&(a.m[e]=r[e]);for(o&&o(a);c<i.length;c++)n=i[c],a.o(s,n)&&s[n]&&s[n][0](),s[i[c]]=0},a.f.j=(t,e)=>{var n=a.o(s,t)?s[t]:void 0;if(0!==n)if(n)e.push(n[1]);else{var r=import("./"+a.u(t)).then(i,(e=>{throw 0!==s[t]&&(s[t]=void 0),e}));r=Promise.race([r,new Promise((e=>n=s[t]=[e]))]),e.push(n[1]=r)}},(()=>{var e={};a.r(e),a.d(e,{builder:()=>Ke,command:()=>ze,description:()=>He});var n={};a.r(n),a.d(n,{builder:()=>un,command:()=>hn});var s=a(57147),i=a(39491);const r={right:function(t,e){t=t.trim();const n=l.stringWidth(t);if(n<e)return" ".repeat(e-n)+t;return t},center:function(t,e){t=t.trim();const n=l.stringWidth(t);if(n>=e)return t;return" ".repeat(e-n>>1)+t}};class o{constructor(t){var e;this.width=t.width,this.wrap=null===(e=t.wrap)||void 0===e||e,this.rows=[]}span(...t){this.div(...t).span=!0}resetOutput(){this.rows=[]}div(...t){if(0===t.length&&this.div(""),this.wrap&&this.shouldApplyLayoutDSL(...t)&&"string"==typeof t[0])return this.applyLayoutDSL(t[0]);const e=t.map((t=>"string"==typeof t?this.colFromString(t):t));return this.rows.push(e),e}shouldApplyLayoutDSL(...t){return 1===t.length&&"string"==typeof t[0]&&/[\t\n]/.test(t[0])}applyLayoutDSL(t){const e=t.split("\n").map((t=>t.split("\t")));let n=0;return e.forEach((t=>{t.length>1&&l.stringWidth(t[0])>n&&(n=Math.min(Math.floor(.5*this.width),l.stringWidth(t[0])))})),e.forEach((t=>{this.div(...t.map(((e,s)=>({text:e.trim(),padding:this.measurePadding(e),width:0===s&&t.length>1?n:void 0}))))})),this.rows[this.rows.length-1]}colFromString(t){return{text:t,padding:this.measurePadding(t)}}measurePadding(t){const e=l.stripAnsi(t);return[0,e.match(/\s*$/)[0].length,0,e.match(/^\s*/)[0].length]}toString(){const t=[];return this.rows.forEach((e=>{this.rowToString(e,t)})),t.filter((t=>!t.hidden)).map((t=>t.text)).join("\n")}rowToString(t,e){return this.rasterize(t).forEach(((n,s)=>{let i="";n.forEach(((n,o)=>{const{width:a}=t[o],h=this.negatePadding(t[o]);let u=n;if(h>l.stringWidth(n)&&(u+=" ".repeat(h-l.stringWidth(n))),t[o].align&&"left"!==t[o].align&&this.wrap){u=(0,r[t[o].align])(u,h),l.stringWidth(u)<h&&(u+=" ".repeat((a||0)-l.stringWidth(u)-1))}const d=t[o].padding||[0,0,0,0];d[3]&&(i+=" ".repeat(d[3])),i+=c(t[o],u,"| "),i+=u,i+=c(t[o],u," |"),d[1]&&(i+=" ".repeat(d[1])),0===s&&e.length>0&&(i=this.renderInline(i,e[e.length-1]))})),e.push({text:i.replace(/ +$/,""),span:t.span})})),e}renderInline(t,e){const n=t.match(/^ */),s=n?n[0].length:0,i=e.text,r=l.stringWidth(i.trimRight());return e.span?this.wrap?s<r?t:(e.hidden=!0,i.trimRight()+" ".repeat(s-r)+t.trimLeft()):(e.hidden=!0,i+t):t}rasterize(t){const e=[],n=this.columnWidths(t);let s;return t.forEach(((t,i)=>{t.width=n[i],s=this.wrap?l.wrap(t.text,this.negatePadding(t),{hard:!0}).split("\n"):t.text.split("\n"),t.border&&(s.unshift("."+"-".repeat(this.negatePadding(t)+2)+"."),s.push("'"+"-".repeat(this.negatePadding(t)+2)+"'")),t.padding&&(s.unshift(...new Array(t.padding[0]||0).fill("")),s.push(...new Array(t.padding[2]||0).fill(""))),s.forEach(((t,n)=>{e[n]||e.push([]);const s=e[n];for(let t=0;t<i;t++)void 0===s[t]&&s.push("");s.push(t)}))})),e}negatePadding(t){let e=t.width||0;return t.padding&&(e-=(t.padding[3]||0)+(t.padding[1]||0)),t.border&&(e-=4),e}columnWidths(t){if(!this.wrap)return t.map((t=>t.width||l.stringWidth(t.text)));let e=t.length,n=this.width;const s=t.map((t=>{if(t.width)return e--,n-=t.width,t.width})),i=e?Math.floor(n/e):0;return s.map(((e,n)=>void 0===e?Math.max(i,function(t){const e=t.padding||[],n=1+(e[3]||0)+(e[1]||0);if(t.border)return n+4;return n}(t[n])):e))}}function c(t,e,n){return t.border?/[.']-+[.']/.test(e)?"":0!==e.trim().length?n:" ":""}let l;const h=new RegExp("\x1b(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)","g");function u(t){return t.replace(h,"")}function d(t,e){const[n,s]=t.match(h)||["",""];t=u(t);let i="";for(let n=0;n<t.length;n++)0!==n&&n%e==0&&(i+="\n"),i+=t.charAt(n);return n&&s&&(i=`${n}${i}${s}`),i}var f=a(71017);var p=a(73837);const m=t(import.meta.url)("url");function g(t){if(t!==t.toLowerCase()&&t!==t.toUpperCase()||(t=t.toLowerCase()),-1===t.indexOf("-")&&-1===t.indexOf("_"))return t;{let e="",n=!1;const s=t.match(/^-+/);for(let i=s?s[0].length:0;i<t.length;i++){let s=t.charAt(i);n&&(n=!1,s=s.toUpperCase()),0===i||"-"!==s&&"_"!==s?"-"!==s&&"_"!==s&&(e+=s):n=!0}return e}}function y(t,e){const n=t.toLowerCase();e=e||"-";let s="";for(let i=0;i<t.length;i++){const r=n.charAt(i),o=t.charAt(i);s+=r!==o&&i>0?`${e}${n.charAt(i)}`:o}return s}function b(t){return null!=t&&("number"==typeof t||(!!/^0x[0-9a-f]+$/i.test(t)||!/^0[^.]/.test(t)&&/^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(t)))}var v;let w;!function(t){t.BOOLEAN="boolean",t.STRING="string",t.NUMBER="number",t.ARRAY="array"}(v||(v={}));function O(t){return void 0!==t?t+1:1}function x(t){return"__proto__"===t?"___proto___":t}var E,j,S;const C=process&&process.env&&process.env.YARGS_MIN_NODE_VERSION?Number(process.env.YARGS_MIN_NODE_VERSION):12,_=null!==(j=null===(E=null===process||void 0===process?void 0:process.versions)||void 0===E?void 0:E.node)&&void 0!==j?j:null===(S=null===process||void 0===process?void 0:process.version)||void 0===S?void 0:S.slice(1);if(_){if(Number(_.match(/^([^.]+)/)[1])<C)throw Error(`yargs parser supports a minimum Node.js version of ${C}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`)}const k=process?process.env:{},A=new class{constructor(t){w=t}parse(t,e){const n=Object.assign({alias:void 0,array:void 0,boolean:void 0,config:void 0,configObjects:void 0,configuration:void 0,coerce:void 0,count:void 0,default:void 0,envPrefix:void 0,narg:void 0,normalize:void 0,string:void 0,number:void 0,__:void 0,key:void 0},e),s=function(t){if(Array.isArray(t))return t.map((t=>"string"!=typeof t?t+"":t));t=t.trim();let e=0,n=null,s=null,i=null;const r=[];for(let o=0;o<t.length;o++)n=s,s=t.charAt(o)," "!==s||i?(s===i?i=null:"'"!==s&&'"'!==s||i||(i=s),r[e]||(r[e]=""),r[e]+=s):" "!==n&&e++;return r}(t),i="string"==typeof t,r=function(t){const e=[],n=Object.create(null);let s=!0;Object.keys(t).forEach((function(n){e.push([].concat(t[n],n))}));for(;s;){s=!1;for(let t=0;t<e.length;t++)for(let n=t+1;n<e.length;n++){if(e[t].filter((function(t){return-1!==e[n].indexOf(t)})).length){e[t]=e[t].concat(e[n]),e.splice(n,1),s=!0;break}}}return e.forEach((function(t){const e=(t=t.filter((function(t,e,n){return n.indexOf(t)===e}))).pop();void 0!==e&&"string"==typeof e&&(n[e]=t)})),n}(Object.assign(Object.create(null),n.alias)),o=Object.assign({"boolean-negation":!0,"camel-case-expansion":!0,"combine-arrays":!1,"dot-notation":!0,"duplicate-arguments-array":!0,"flatten-duplicate-arrays":!0,"greedy-arrays":!0,"halt-at-non-option":!1,"nargs-eats-options":!1,"negation-prefix":"no-","parse-numbers":!0,"parse-positional-numbers":!0,"populate--":!1,"set-placeholder-key":!1,"short-option-groups":!0,"strip-aliased":!1,"strip-dashed":!1,"unknown-options-as-args":!1},n.configuration),a=Object.assign(Object.create(null),n.default),c=n.configObjects||[],l=n.envPrefix,h=o["populate--"],u=h?"--":"_",d=Object.create(null),f=Object.create(null),p=n.__||w.format,m={aliases:Object.create(null),arrays:Object.create(null),bools:Object.create(null),strings:Object.create(null),numbers:Object.create(null),counts:Object.create(null),normalize:Object.create(null),configs:Object.create(null),nargs:Object.create(null),coercions:Object.create(null),keys:[]},E=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/,j=new RegExp("^--"+o["negation-prefix"]+"(.+)");[].concat(n.array||[]).filter(Boolean).forEach((function(t){const e="object"==typeof t?t.key:t,n=Object.keys(t).map((function(t){return{boolean:"bools",string:"strings",number:"numbers"}[t]})).filter(Boolean).pop();n&&(m[n][e]=!0),m.arrays[e]=!0,m.keys.push(e)})),[].concat(n.boolean||[]).filter(Boolean).forEach((function(t){m.bools[t]=!0,m.keys.push(t)})),[].concat(n.string||[]).filter(Boolean).forEach((function(t){m.strings[t]=!0,m.keys.push(t)})),[].concat(n.number||[]).filter(Boolean).forEach((function(t){m.numbers[t]=!0,m.keys.push(t)})),[].concat(n.count||[]).filter(Boolean).forEach((function(t){m.counts[t]=!0,m.keys.push(t)})),[].concat(n.normalize||[]).filter(Boolean).forEach((function(t){m.normalize[t]=!0,m.keys.push(t)})),"object"==typeof n.narg&&Object.entries(n.narg).forEach((([t,e])=>{"number"==typeof e&&(m.nargs[t]=e,m.keys.push(t))})),"object"==typeof n.coerce&&Object.entries(n.coerce).forEach((([t,e])=>{"function"==typeof e&&(m.coercions[t]=e,m.keys.push(t))})),void 0!==n.config&&(Array.isArray(n.config)||"string"==typeof n.config?[].concat(n.config).filter(Boolean).forEach((function(t){m.configs[t]=!0})):"object"==typeof n.config&&Object.entries(n.config).forEach((([t,e])=>{"boolean"!=typeof e&&"function"!=typeof e||(m.configs[t]=e)}))),function(...t){t.forEach((function(t){Object.keys(t||{}).forEach((function(t){m.aliases[t]||(m.aliases[t]=[].concat(r[t]||[]),m.aliases[t].concat(t).forEach((function(e){if(/-/.test(e)&&o["camel-case-expansion"]){const n=g(e);n!==t&&-1===m.aliases[t].indexOf(n)&&(m.aliases[t].push(n),d[n]=!0)}})),m.aliases[t].concat(t).forEach((function(e){if(e.length>1&&/[A-Z]/.test(e)&&o["camel-case-expansion"]){const n=y(e,"-");n!==t&&-1===m.aliases[t].indexOf(n)&&(m.aliases[t].push(n),d[n]=!0)}})),m.aliases[t].forEach((function(e){m.aliases[e]=[t].concat(m.aliases[t].filter((function(t){return e!==t})))})))}))}))}(n.key,r,n.default,m.arrays),Object.keys(a).forEach((function(t){(m.aliases[t]||[]).forEach((function(e){a[e]=a[t]}))}));let S=null;Object.keys(m.counts).find((t=>U(t,m.arrays)?(S=Error(p("Invalid configuration: %s, opts.count excludes opts.array.",t)),!0):!!U(t,m.nargs)&&(S=Error(p("Invalid configuration: %s, opts.count excludes opts.narg.",t)),!0)));let C=[];const _=Object.assign(Object.create(null),{_:[]}),k={};for(let t=0;t<s.length;t++){const e=s[t],n=e.replace(/^-{3,}/,"---");let i,r,a,c,l,h;if("--"!==e&&/^-/.test(e)&&B(e))A(e);else{if(n.match(/^---+(=|$)/)){A(e);continue}if(e.match(/^--.+=/)||!o["short-option-groups"]&&e.match(/^-.+=/))c=e.match(/^--?([^=]+)=([\s\S]*)$/),null!==c&&Array.isArray(c)&&c.length>=3&&(U(c[1],m.arrays)?t=$(t,c[1],s,c[2]):!1!==U(c[1],m.nargs)?t=P(t,c[1],s,c[2]):I(c[1],c[2],!0));else if(e.match(j)&&o["boolean-negation"])c=e.match(j),null!==c&&Array.isArray(c)&&c.length>=2&&(r=c[1],I(r,!!U(r,m.arrays)&&[!1]));else if(e.match(/^--.+/)||!o["short-option-groups"]&&e.match(/^-[^-]+/))c=e.match(/^--?(.+)/),null!==c&&Array.isArray(c)&&c.length>=2&&(r=c[1],U(r,m.arrays)?t=$(t,r,s):!1!==U(r,m.nargs)?t=P(t,r,s):(l=s[t+1],void 0===l||l.match(/^-/)&&!l.match(E)||U(r,m.bools)||U(r,m.counts)?/^(true|false)$/.test(l)?(I(r,l),t++):I(r,z(r)):(I(r,l),t++)));else if(e.match(/^-.\..+=/))c=e.match(/^-([^=]+)=([\s\S]*)$/),null!==c&&Array.isArray(c)&&c.length>=3&&I(c[1],c[2]);else if(e.match(/^-.\..+/)&&!e.match(E))l=s[t+1],c=e.match(/^-(.\..+)/),null!==c&&Array.isArray(c)&&c.length>=2&&(r=c[1],void 0===l||l.match(/^-/)||U(r,m.bools)||U(r,m.counts)?I(r,z(r)):(I(r,l),t++));else if(e.match(/^-[^-]+/)&&!e.match(E)){a=e.slice(1,-1).split(""),i=!1;for(let n=0;n<a.length;n++){if(l=e.slice(n+2),a[n+1]&&"="===a[n+1]){h=e.slice(n+3),r=a[n],U(r,m.arrays)?t=$(t,r,s,h):!1!==U(r,m.nargs)?t=P(t,r,s,h):I(r,h),i=!0;break}if("-"!==l){if(/[A-Za-z]/.test(a[n])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(l)&&!1===U(l,m.bools)){I(a[n],l),i=!0;break}if(a[n+1]&&a[n+1].match(/\W/)){I(a[n],l),i=!0;break}I(a[n],z(a[n]))}else I(a[n],l)}r=e.slice(-1)[0],i||"-"===r||(U(r,m.arrays)?t=$(t,r,s):!1!==U(r,m.nargs)?t=P(t,r,s):(l=s[t+1],void 0===l||/^(-|--)[^-]/.test(l)&&!l.match(E)||U(r,m.bools)||U(r,m.counts)?/^(true|false)$/.test(l)?(I(r,l),t++):I(r,z(r)):(I(r,l),t++)))}else if(e.match(/^-[0-9]$/)&&e.match(E)&&U(e.slice(1),m.bools))r=e.slice(1),I(r,z(r));else{if("--"===e){C=s.slice(t+1);break}if(o["halt-at-non-option"]){C=s.slice(t);break}A(e)}}}function A(t){const e=N("_",t);"string"!=typeof e&&"number"!=typeof e||_._.push(e)}function P(t,e,n,s){let i,r=U(e,m.nargs);if(r="number"!=typeof r||isNaN(r)?1:r,0===r)return H(s)||(S=Error(p("Argument unexpected for: %s",e))),I(e,z(e)),t;let a=H(s)?0:1;if(o["nargs-eats-options"])n.length-(t+1)+a<r&&(S=Error(p("Not enough arguments following: %s",e))),a=r;else{for(i=t+1;i<n.length&&(!n[i].match(/^-[^0-9]/)||n[i].match(E)||B(n[i]));i++)a++;a<r&&(S=Error(p("Not enough arguments following: %s",e)))}let c=Math.min(a,r);for(!H(s)&&c>0&&(I(e,s),c--),i=t+1;i<c+t+1;i++)I(e,n[i]);return t+c}function $(t,e,n,s){let r=[],c=s||n[t+1];const l=U(e,m.nargs);if(U(e,m.bools)&&!/^(true|false)$/.test(c))r.push(!0);else if(H(c)||H(s)&&/^-/.test(c)&&!E.test(c)&&!B(c)){if(void 0!==a[e]){const t=a[e];r=Array.isArray(t)?t:[t]}}else{H(s)||r.push(T(e,s,!0));for(let s=t+1;s<n.length&&!(!o["greedy-arrays"]&&r.length>0||l&&"number"==typeof l&&r.length>=l)&&(c=n[s],!/^-/.test(c)||E.test(c)||B(c));s++)t=s,r.push(T(e,c,i))}return"number"==typeof l&&(l&&r.length<l||isNaN(l)&&0===r.length)&&(S=Error(p("Not enough arguments following: %s",e))),I(e,r),t}function I(t,e,n=i){if(/-/.test(t)&&o["camel-case-expansion"]){const e=t.split(".").map((function(t){return g(t)})).join(".");M(t,e)}const s=T(t,e,n),r=t.split(".");if(W(_,r,s),m.aliases[t]&&m.aliases[t].forEach((function(t){const e=t.split(".");W(_,e,s)})),r.length>1&&o["dot-notation"]&&(m.aliases[r[0]]||[]).forEach((function(e){let n=e.split(".");const i=[].concat(r);i.shift(),n=n.concat(i),(m.aliases[t]||[]).includes(n.join("."))||W(_,n,s)})),U(t,m.normalize)&&!U(t,m.arrays)){[t].concat(m.aliases[t]||[]).forEach((function(t){Object.defineProperty(k,t,{enumerable:!0,get:()=>e,set(t){e="string"==typeof t?w.normalize(t):t}})}))}}function M(t,e){m.aliases[t]&&m.aliases[t].length||(m.aliases[t]=[e],d[e]=!0),m.aliases[e]&&m.aliases[e].length||M(e,t)}function T(t,e,n){n&&(e=function(t){return"string"!=typeof t||"'"!==t[0]&&'"'!==t[0]||t[t.length-1]!==t[0]?t:t.substring(1,t.length-1)}(e)),(U(t,m.bools)||U(t,m.counts))&&"string"==typeof e&&(e="true"===e);let s=Array.isArray(e)?e.map((function(e){return N(t,e)})):N(t,e);return U(t,m.counts)&&(H(s)||"boolean"==typeof s)&&(s=O()),U(t,m.normalize)&&U(t,m.arrays)&&(s=Array.isArray(e)?e.map((t=>w.normalize(t))):w.normalize(e)),s}function N(t,e){if(!o["parse-positional-numbers"]&&"_"===t)return e;if(!U(t,m.strings)&&!U(t,m.bools)&&!Array.isArray(e)){(b(e)&&o["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${e}`)))||!H(e)&&U(t,m.numbers))&&(e=Number(e))}return e}function L(t,e){Object.keys(t).forEach((function(n){const s=t[n],i=e?e+"."+n:n;"object"==typeof s&&null!==s&&!Array.isArray(s)&&o["dot-notation"]?L(s,i):(!D(_,i.split("."))||U(i,m.arrays)&&o["combine-arrays"])&&I(i,s)}))}function F(t,e){if(void 0===l)return;const n="string"==typeof l?l:"",s=w.env();Object.keys(s).forEach((function(i){if(""===n||0===i.lastIndexOf(n,0)){const r=i.split("__").map((function(t,e){return 0===e&&(t=t.substring(n.length)),g(t)}));(e&&m.configs[r.join(".")]||!e)&&!D(t,r)&&I(r.join("."),s[i])}}))}function G(t,e,n,s=!1){Object.keys(n).forEach((function(i){D(t,i.split("."))||(W(t,i.split("."),n[i]),s&&(f[i]=!0),(e[i]||[]).forEach((function(e){D(t,e.split("."))||W(t,e.split("."),n[i])})))}))}function D(t,e){let n=t;o["dot-notation"]||(e=[e.join(".")]),e.slice(0,-1).forEach((function(t){n=n[t]||{}}));const s=e[e.length-1];return"object"==typeof n&&s in n}function W(t,e,n){let s=t;o["dot-notation"]||(e=[e.join(".")]),e.slice(0,-1).forEach((function(t){t=x(t),"object"==typeof s&&void 0===s[t]&&(s[t]={}),"object"!=typeof s[t]||Array.isArray(s[t])?(Array.isArray(s[t])?s[t].push({}):s[t]=[s[t],{}],s=s[t][s[t].length-1]):s=s[t]}));const i=x(e[e.length-1]),r=U(e.join("."),m.arrays),a=Array.isArray(n);let c=o["duplicate-arguments-array"];!c&&U(i,m.nargs)&&(c=!0,(!H(s[i])&&1===m.nargs[i]||Array.isArray(s[i])&&s[i].length===m.nargs[i])&&(s[i]=void 0)),n===O()?s[i]=O(s[i]):Array.isArray(s[i])?c&&r&&a?s[i]=o["flatten-duplicate-arrays"]?s[i].concat(n):(Array.isArray(s[i][0])?s[i]:[s[i]]).concat([n]):c||Boolean(r)!==Boolean(a)?s[i]=s[i].concat([n]):s[i]=n:void 0===s[i]&&r?s[i]=a?n:[n]:!c||void 0===s[i]||U(i,m.counts)||U(i,m.bools)?s[i]=n:s[i]=[s[i],n]}function U(t,e){const n=[].concat(m.aliases[t]||[],t),s=Object.keys(e),i=n.find((t=>s.includes(t)));return!!i&&e[i]}function R(t){const e=Object.keys(m);return[].concat(e.map((t=>m[t]))).some((function(e){return Array.isArray(e)?e.includes(t):e[t]}))}function B(t){return o["unknown-options-as-args"]&&function(t){if(t=t.replace(/^-{3,}/,"--"),t.match(E))return!1;if(function(t){if(t.match(E)||!t.match(/^-[^-]+/))return!1;let e,n=!0;const s=t.slice(1).split("");for(let i=0;i<s.length;i++){if(e=t.slice(i+2),!R(s[i])){n=!1;break}if(s[i+1]&&"="===s[i+1]||"-"===e||/[A-Za-z]/.test(s[i])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(e)||s[i+1]&&s[i+1].match(/\W/))break}return n}(t))return!1;return!function(t,...e){return[].concat(...e).some((function(e){const n=t.match(e);return n&&R(n[1])}))}(t,/^-+([^=]+?)=[\s\S]*$/,j,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}(t)}function z(t){return U(t,m.bools)||U(t,m.counts)||!(`${t}`in a)?(e=function(t){let e=v.BOOLEAN;return U(t,m.strings)?e=v.STRING:U(t,m.numbers)?e=v.NUMBER:U(t,m.bools)?e=v.BOOLEAN:U(t,m.arrays)&&(e=v.ARRAY),e}(t),{[v.BOOLEAN]:!0,[v.STRING]:"",[v.NUMBER]:void 0,[v.ARRAY]:[]}[e]):a[t];var e}function H(t){return void 0===t}return F(_,!0),F(_,!1),function(t){const e=Object.create(null);G(e,m.aliases,a),Object.keys(m.configs).forEach((function(n){const s=t[n]||e[n];if(s)try{let t=null;const e=w.resolve(w.cwd(),s),i=m.configs[n];if("function"==typeof i){try{t=i(e)}catch(e){t=e}if(t instanceof Error)return void(S=t)}else t=w.require(e);L(t)}catch(e){"PermissionDenied"===e.name?S=e:t[n]&&(S=Error(p("Invalid JSON config file: %s",s)))}}))}(_),void 0!==c&&c.forEach((function(t){L(t)})),G(_,m.aliases,a,!0),function(t){let e;const n=new Set;Object.keys(t).forEach((function(s){if(!n.has(s)&&(e=U(s,m.coercions),"function"==typeof e))try{const i=N(s,e(t[s]));[].concat(m.aliases[s]||[],s).forEach((e=>{n.add(e),t[e]=i}))}catch(t){S=t}}))}(_),o["set-placeholder-key"]&&function(t){m.keys.forEach((e=>{~e.indexOf(".")||void 0===t[e]&&(t[e]=void 0)}))}(_),Object.keys(m.counts).forEach((function(t){D(_,t.split("."))||I(t,0)})),h&&C.length&&(_[u]=[]),C.forEach((function(t){_[u].push(t)})),o["camel-case-expansion"]&&o["strip-dashed"]&&Object.keys(_).filter((t=>"--"!==t&&t.includes("-"))).forEach((t=>{delete _[t]})),o["strip-aliased"]&&[].concat(...Object.keys(r).map((t=>r[t]))).forEach((t=>{o["camel-case-expansion"]&&t.includes("-")&&delete _[t.split(".").map((t=>g(t))).join(".")],delete _[t]})),{aliases:Object.assign({},m.aliases),argv:Object.assign(k,_),configuration:o,defaulted:Object.assign({},f),error:S,newAliases:Object.assign({},d)}}}({cwd:process.cwd,env:()=>k,format:p.format,normalize:f.normalize,resolve:f.resolve,require:t=>{if("undefined"!=typeof require)return require(t);if(t.match(/\.json$/))return JSON.parse((0,s.readFileSync)(t,"utf8"));throw Error("only .json config files are supported in ESM")}}),P=function(t,e){return A.parse(t.slice(),e).argv};P.detailed=function(t,e){return A.parse(t.slice(),e)},P.camelCase=g,P.decamelize=y,P.looksLikeNumber=b;const $=P;function I(){return process.versions.electron&&!process.defaultApp?0:1}class M extends Error{constructor(t){super(t||"yargs error"),this.name="YError",Error.captureStackTrace&&Error.captureStackTrace(this,M)}}const T={fs:{readFileSync:s.readFileSync,writeFile:s.writeFile},format:p.format,resolve:f.resolve,exists:t=>{try{return(0,s.statSync)(t).isFile()}catch(t){return!1}}};let N;class L{constructor(t){t=t||{},this.directory=t.directory||"./locales",this.updateFiles="boolean"!=typeof t.updateFiles||t.updateFiles,this.locale=t.locale||"en",this.fallbackToLanguage="boolean"!=typeof t.fallbackToLanguage||t.fallbackToLanguage,this.cache=Object.create(null),this.writeQueue=[]}__(...t){if("string"!=typeof arguments[0])return this._taggedLiteral(arguments[0],...arguments);const e=t.shift();let n=function(){};return"function"==typeof t[t.length-1]&&(n=t.pop()),n=n||function(){},this.cache[this.locale]||this._readLocaleFile(),!this.cache[this.locale][e]&&this.updateFiles?(this.cache[this.locale][e]=e,this._enqueueWrite({directory:this.directory,locale:this.locale,cb:n})):n(),N.format.apply(N.format,[this.cache[this.locale][e]||e].concat(t))}__n(){const t=Array.prototype.slice.call(arguments),e=t.shift(),n=t.shift(),s=t.shift();let i=function(){};"function"==typeof t[t.length-1]&&(i=t.pop()),this.cache[this.locale]||this._readLocaleFile();let r=1===s?e:n;if(this.cache[this.locale][e]){r=this.cache[this.locale][e][1===s?"one":"other"]}!this.cache[this.locale][e]&&this.updateFiles?(this.cache[this.locale][e]={one:e,other:n},this._enqueueWrite({directory:this.directory,locale:this.locale,cb:i})):i();const o=[r];return~r.indexOf("%d")&&o.push(s),N.format.apply(N.format,o.concat(t))}setLocale(t){this.locale=t}getLocale(){return this.locale}updateLocale(t){this.cache[this.locale]||this._readLocaleFile();for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&(this.cache[this.locale][e]=t[e])}_taggedLiteral(t,...e){let n="";return t.forEach((function(t,s){const i=e[s+1];n+=t,void 0!==i&&(n+="%s")})),this.__.apply(this,[n].concat([].slice.call(e,1)))}_enqueueWrite(t){this.writeQueue.push(t),1===this.writeQueue.length&&this._processWriteQueue()}_processWriteQueue(){const t=this,e=this.writeQueue[0],n=e.directory,s=e.locale,i=e.cb,r=this._resolveLocaleFile(n,s),o=JSON.stringify(this.cache[s],null,2);N.fs.writeFile(r,o,"utf-8",(function(e){t.writeQueue.shift(),t.writeQueue.length>0&&t._processWriteQueue(),i(e)}))}_readLocaleFile(){let t={};const e=this._resolveLocaleFile(this.directory,this.locale);try{N.fs.readFileSync&&(t=JSON.parse(N.fs.readFileSync(e,"utf-8")))}catch(n){if(n instanceof SyntaxError&&(n.message="syntax error in "+e),"ENOENT"!==n.code)throw n;t={}}this.cache[this.locale]=t}_resolveLocaleFile(t,e){let n=N.resolve(t,"./",e+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(n)&&~e.lastIndexOf("_")){const s=N.resolve(t,"./",e.split("_")[0]+".json");this._fileExistsSync(s)&&(n=s)}return n}_fileExistsSync(t){return N.exists(t)}}const F=t=>function(t,e){N=e;const n=new L(t);return{__:n.__.bind(n),__n:n.__n.bind(n),setLocale:n.setLocale.bind(n),getLocale:n.getLocale.bind(n),updateLocale:n.updateLocale.bind(n),locale:n.locale}}(t,T),G="loading a directory of commands is not supported yet for ESM";let D;try{D=(0,m.fileURLToPath)(import.meta.url)}catch(t){D=process.cwd()}const W=D.substring(0,D.lastIndexOf("node_modules")),U={assert:{notStrictEqual:i.notStrictEqual,strictEqual:i.strictEqual},cliui:function(t){return function(t,e){return l=e,new o({width:(null==t?void 0:t.width)||("object"==typeof process&&process.stdout&&process.stdout.columns?process.stdout.columns:80),wrap:null==t?void 0:t.wrap})}(t,{stringWidth:t=>[...t].length,stripAnsi:u,wrap:d})},findUp:function(t,e){let n,i=(0,f.resolve)(".",t);for((0,s.statSync)(i).isDirectory()||(i=(0,f.dirname)(i));;){if(n=e(i,(0,s.readdirSync)(i)),n)return(0,f.resolve)(i,n);if(i=(0,f.dirname)(n=i),n===i)break}},getEnv:t=>process.env[t],inspect:p.inspect,getCallerFile:()=>{throw new M(G)},getProcessArgvBin:function(){return process.argv[I()]},mainFilename:W||process.cwd(),Parser:$,path:{basename:f.basename,dirname:f.dirname,extname:f.extname,relative:f.relative,resolve:f.resolve},process:{argv:()=>process.argv,cwd:process.cwd,emitWarning:(t,e)=>process.emitWarning(t,e),execPath:()=>process.execPath,exit:process.exit,nextTick:process.nextTick,stdColumns:void 0!==process.stdout.columns?process.stdout.columns:null},readFileSync:s.readFileSync,require:()=>{throw new M("require is not supported by ESM")},requireDirectory:()=>{throw new M(G)},stringWidth:t=>[...t].length,y18n:F({directory:(0,f.resolve)(D,"../../../locales"),updateFiles:!1})};function R(t,e,n,s){n.assert.notStrictEqual(t,e,s)}function B(t,e){e.assert.strictEqual(typeof t,"string")}function z(t){return Object.keys(t)}function H(t){return!!t&&!!t.then&&"function"==typeof t.then}function q(t){const e=t.replace(/\s{2,}/g," ").split(/\s+(?![^[]*]|[^<]*>)/),n=/\.*[\][<>]/g,s=e.shift();if(!s)throw new Error(`No command found in: ${t}`);const i={cmd:s.replace(n,""),demanded:[],optional:[]};return e.forEach(((t,s)=>{let r=!1;t=t.replace(/\s/g,""),/\.+[\]>]/.test(t)&&s===e.length-1&&(r=!0),/^\[/.test(t)?i.optional.push({cmd:t.replace(n,"").split("|"),variadic:r}):i.demanded.push({cmd:t.replace(n,"").split("|"),variadic:r})})),i}const V=["first","second","third","fourth","fifth","sixth"];function K(t,e,n){try{let s=0;const[i,r,o]="object"==typeof t?[{demanded:[],optional:[]},t,e]:[q(`cmd ${t}`),e,n],a=[].slice.call(r);for(;a.length&&void 0===a[a.length-1];)a.pop();const c=o||a.length;if(c<i.demanded.length)throw new M(`Not enough arguments provided. Expected ${i.demanded.length} but received ${a.length}.`);const l=i.demanded.length+i.optional.length;if(c>l)throw new M(`Too many arguments provided. Expected max ${l} but received ${c}.`);i.demanded.forEach((t=>{const e=Y(a.shift());0===t.cmd.filter((t=>t===e||"*"===t)).length&&J(e,t.cmd,s),s+=1})),i.optional.forEach((t=>{if(0===a.length)return;const e=Y(a.shift());0===t.cmd.filter((t=>t===e||"*"===t)).length&&J(e,t.cmd,s),s+=1}))}catch(t){console.warn(t.stack)}}function Y(t){return Array.isArray(t)?"array":null===t?"null":typeof t}function J(t,e,n){throw new M(`Invalid ${V[n]||"manyith"} argument. Expected ${e.join(" or ")} but received ${t}.`)}class Q{constructor(t){this.globalMiddleware=[],this.frozens=[],this.yargs=t}addMiddleware(t,e,n=!0,s=!1){if(K("<array|function> [boolean] [boolean] [boolean]",[t,e,n],arguments.length),Array.isArray(t)){for(let s=0;s<t.length;s++){if("function"!=typeof t[s])throw Error("middleware must be a function");const i=t[s];i.applyBeforeValidation=e,i.global=n}Array.prototype.push.apply(this.globalMiddleware,t)}else if("function"==typeof t){const i=t;i.applyBeforeValidation=e,i.global=n,i.mutates=s,this.globalMiddleware.push(t)}return this.yargs}addCoerceMiddleware(t,e){const n=this.yargs.getAliases();return this.globalMiddleware=this.globalMiddleware.filter((t=>{const s=[...n[e]||[],e];return!t.option||!s.includes(t.option)})),t.option=e,this.addMiddleware(t,!0,!0,!0)}getMiddleware(){return this.globalMiddleware}freeze(){this.frozens.push([...this.globalMiddleware])}unfreeze(){const t=this.frozens.pop();void 0!==t&&(this.globalMiddleware=t)}reset(){this.globalMiddleware=this.globalMiddleware.filter((t=>t.global))}}function X(t,e,n,s){return n.reduce(((t,n)=>{if(n.applyBeforeValidation!==s)return t;if(n.mutates){if(n.applied)return t;n.applied=!0}if(H(t))return t.then((t=>Promise.all([t,n(t,e)]))).then((([t,e])=>Object.assign(t,e)));{const s=n(t,e);return H(s)?s.then((e=>Object.assign(t,e))):Object.assign(t,s)}}),t)}function Z(t,e,n=(t=>{throw t})){try{const n="function"==typeof t?t():t;return H(n)?n.then((t=>e(t))):e(n)}catch(t){return n(t)}}const tt=/(^\*)|(^\$0)/;class et{constructor(t,e,n,s){this.requireCache=new Set,this.handlers={},this.aliasMap={},this.frozens=[],this.shim=s,this.usage=t,this.globalMiddleware=n,this.validation=e}addDirectory(t,e,n,s){"boolean"!=typeof(s=s||{}).recurse&&(s.recurse=!1),Array.isArray(s.extensions)||(s.extensions=["js"]);const i="function"==typeof s.visit?s.visit:t=>t;s.visit=(t,e,n)=>{const s=i(t,e,n);if(s){if(this.requireCache.has(e))return s;this.requireCache.add(e),this.addHandler(s)}return s},this.shim.requireDirectory({require:e,filename:n},t,s)}addHandler(t,e,n,s,i,r){let o=[];const a=function(t){return t?t.map((t=>(t.applyBeforeValidation=!1,t))):[]}(i);if(s=s||(()=>{}),Array.isArray(t))if(function(t){return t.every((t=>"string"==typeof t))}(t))[t,...o]=t;else for(const e of t)this.addHandler(e);else{if(function(t){return"object"==typeof t&&!Array.isArray(t)}(t)){let e=Array.isArray(t.command)||"string"==typeof t.command?t.command:this.moduleName(t);return t.aliases&&(e=[].concat(e).concat(t.aliases)),void this.addHandler(e,this.extractDesc(t),t.builder,t.handler,t.middlewares,t.deprecated)}if(nt(n))return void this.addHandler([t].concat(o),e,n.builder,n.handler,n.middlewares,n.deprecated)}if("string"==typeof t){const i=q(t);o=o.map((t=>q(t).cmd));let c=!1;const l=[i.cmd].concat(o).filter((t=>!tt.test(t)||(c=!0,!1)));0===l.length&&c&&l.push("$0"),c&&(i.cmd=l[0],o=l.slice(1),t=t.replace(tt,i.cmd)),o.forEach((t=>{this.aliasMap[t]=i.cmd})),!1!==e&&this.usage.command(t,e,c,o,r),this.handlers[i.cmd]={original:t,description:e,handler:s,builder:n||{},middlewares:a,deprecated:r,demanded:i.demanded,optional:i.optional},c&&(this.defaultCommand=this.handlers[i.cmd])}}getCommandHandlers(){return this.handlers}getCommands(){return Object.keys(this.handlers).concat(Object.keys(this.aliasMap))}hasDefaultCommand(){return!!this.defaultCommand}runCommand(t,e,n,s,i,r){const o=this.handlers[t]||this.handlers[this.aliasMap[t]]||this.defaultCommand,a=e.getInternalMethods().getContext(),c=a.commands.slice(),l=!t;t&&(a.commands.push(t),a.fullCommands.push(o.original));const h=this.applyBuilderUpdateUsageAndParse(l,o,e,n.aliases,c,s,i,r);return H(h)?h.then((t=>this.applyMiddlewareAndGetResult(l,o,t.innerArgv,a,i,t.aliases,e))):this.applyMiddlewareAndGetResult(l,o,h.innerArgv,a,i,h.aliases,e)}applyBuilderUpdateUsageAndParse(t,e,n,s,i,r,o,a){const c=e.builder;let l=n;if(st(c)){n.getInternalMethods().getUsageInstance().freeze();const h=c(n.getInternalMethods().reset(s),a);if(H(h))return h.then((s=>{var a;return l=(a=s)&&"function"==typeof a.getInternalMethods?s:n,this.parseAndUpdateUsage(t,e,l,i,r,o)}))}else(function(t){return"object"==typeof t})(c)&&(n.getInternalMethods().getUsageInstance().freeze(),l=n.getInternalMethods().reset(s),Object.keys(e.builder).forEach((t=>{l.option(t,c[t])})));return this.parseAndUpdateUsage(t,e,l,i,r,o)}parseAndUpdateUsage(t,e,n,s,i,r){t&&n.getInternalMethods().getUsageInstance().unfreeze(!0),this.shouldUpdateUsage(n)&&n.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(s,e),e.description);const o=n.getInternalMethods().runYargsParserAndExecuteCommands(null,void 0,!0,i,r);return H(o)?o.then((t=>({aliases:n.parsed.aliases,innerArgv:t}))):{aliases:n.parsed.aliases,innerArgv:o}}shouldUpdateUsage(t){return!t.getInternalMethods().getUsageInstance().getUsageDisabled()&&0===t.getInternalMethods().getUsageInstance().getUsage().length}usageFromParentCommandsCommandHandler(t,e){const n=tt.test(e.original)?e.original.replace(tt,"").trim():e.original,s=t.filter((t=>!tt.test(t)));return s.push(n),`$0 ${s.join(" ")}`}handleValidationAndGetResult(t,e,n,s,i,r,o,a){if(!r.getInternalMethods().getHasOutput()){const e=r.getInternalMethods().runValidation(i,a,r.parsed.error,t);n=Z(n,(t=>(e(t),t)))}if(e.handler&&!r.getInternalMethods().getHasOutput()){r.getInternalMethods().setHasOutput();const s=!!r.getOptions().configuration["populate--"];r.getInternalMethods().postProcess(n,s,!1,!1),n=Z(n=X(n,r,o,!1),(t=>{const n=e.handler(t);return H(n)?n.then((()=>t)):t})),t||r.getInternalMethods().getUsageInstance().cacheHelpMessage(),H(n)&&!r.getInternalMethods().hasParseCallback()&&n.catch((t=>{try{r.getInternalMethods().getUsageInstance().fail(null,t)}catch(t){}}))}return t||(s.commands.pop(),s.fullCommands.pop()),n}applyMiddlewareAndGetResult(t,e,n,s,i,r,o){let a={};if(i)return n;o.getInternalMethods().getHasOutput()||(a=this.populatePositionals(e,n,s,o));const c=this.globalMiddleware.getMiddleware().slice(0).concat(e.middlewares),l=X(n,o,c,!0);return H(l)?l.then((n=>this.handleValidationAndGetResult(t,e,n,s,r,o,c,a))):this.handleValidationAndGetResult(t,e,l,s,r,o,c,a)}populatePositionals(t,e,n,s){e._=e._.slice(n.commands.length);const i=t.demanded.slice(0),r=t.optional.slice(0),o={};for(this.validation.positionalCount(i.length,e._.length);i.length;){const t=i.shift();this.populatePositional(t,e,o)}for(;r.length;){const t=r.shift();this.populatePositional(t,e,o)}return e._=n.commands.concat(e._.map((t=>""+t))),this.postProcessPositionals(e,o,this.cmdToParseOptions(t.original),s),o}populatePositional(t,e,n){const s=t.cmd[0];t.variadic?n[s]=e._.splice(0).map(String):e._.length&&(n[s]=[String(e._.shift())])}cmdToParseOptions(t){const e={array:[],default:{},alias:{},demand:{}},n=q(t);return n.demanded.forEach((t=>{const[n,...s]=t.cmd;t.variadic&&(e.array.push(n),e.default[n]=[]),e.alias[n]=s,e.demand[n]=!0})),n.optional.forEach((t=>{const[n,...s]=t.cmd;t.variadic&&(e.array.push(n),e.default[n]=[]),e.alias[n]=s})),e}postProcessPositionals(t,e,n,s){const i=Object.assign({},s.getOptions());i.default=Object.assign(n.default,i.default);for(const t of Object.keys(n.alias))i.alias[t]=(i.alias[t]||[]).concat(n.alias[t]);i.array=i.array.concat(n.array),i.config={};const r=[];if(Object.keys(e).forEach((t=>{e[t].map((e=>{i.configuration["unknown-options-as-args"]&&(i.key[t]=!0),r.push(`--${t}`),r.push(e)}))})),!r.length)return;const o=Object.assign({},i.configuration,{"populate--":!1}),a=this.shim.Parser.detailed(r,Object.assign({},i,{configuration:o}));if(a.error)s.getInternalMethods().getUsageInstance().fail(a.error.message,a.error);else{const n=Object.keys(e);Object.keys(e).forEach((t=>{n.push(...a.aliases[t])})),Object.keys(a.argv).forEach((i=>{n.includes(i)&&(e[i]||(e[i]=a.argv[i]),!this.isInConfigs(s,i)&&!this.isDefaulted(s,i)&&Object.prototype.hasOwnProperty.call(t,i)&&Object.prototype.hasOwnProperty.call(a.argv,i)&&(Array.isArray(t[i])||Array.isArray(a.argv[i]))?t[i]=[].concat(t[i],a.argv[i]):t[i]=a.argv[i])}))}}isDefaulted(t,e){const{default:n}=t.getOptions();return Object.prototype.hasOwnProperty.call(n,e)||Object.prototype.hasOwnProperty.call(n,this.shim.Parser.camelCase(e))}isInConfigs(t,e){const{configObjects:n}=t.getOptions();return n.some((t=>Object.prototype.hasOwnProperty.call(t,e)))||n.some((t=>Object.prototype.hasOwnProperty.call(t,this.shim.Parser.camelCase(e))))}runDefaultBuilderOn(t){if(!this.defaultCommand)return;if(this.shouldUpdateUsage(t)){const e=tt.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,"$0 ");t.getInternalMethods().getUsageInstance().usage(e,this.defaultCommand.description)}const e=this.defaultCommand.builder;if(st(e))return e(t,!0);nt(e)||Object.keys(e).forEach((n=>{t.option(n,e[n])}))}moduleName(t){const e=function(t){if("undefined"==typeof require)return null;for(let e,n=0,s=Object.keys(require.cache);n<s.length;n++)if(e=require.cache[s[n]],e.exports===t)return e;return null}(t);if(!e)throw new Error(`No command name given for module: ${this.shim.inspect(t)}`);return this.commandFromFilename(e.filename)}commandFromFilename(t){return this.shim.path.basename(t,this.shim.path.extname(t))}extractDesc({describe:t,description:e,desc:n}){for(const s of[t,e,n]){if("string"==typeof s||!1===s)return s;R(s,!0,this.shim)}return!1}freeze(){this.frozens.push({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand})}unfreeze(){const t=this.frozens.pop();R(t,void 0,this.shim),({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand}=t)}reset(){return this.handlers={},this.aliasMap={},this.defaultCommand=void 0,this.requireCache=new Set,this}}function nt(t){return"object"==typeof t&&!!t.builder&&"function"==typeof t.handler}function st(t){return"function"==typeof t}function it(t={},e=(()=>!0)){const n={};return z(t).forEach((s=>{e(s,t[s])&&(n[s]=t[s])})),n}function rt(t){"undefined"!=typeof process&&[process.stdout,process.stderr].forEach((e=>{const n=e;n._handle&&n.isTTY&&"function"==typeof n._handle.setBlocking&&n._handle.setBlocking(t)}))}function ot(t){return"boolean"==typeof t}function at(t,e){const n=e.y18n.__,s={},i=[];s.failFn=function(t){i.push(t)};let r=null,o=null,a=!0;s.showHelpOnFail=function(e=!0,n){const[i,c]="string"==typeof e?[!0,e]:[e,n];return t.getInternalMethods().isGlobalContext()&&(o=c),r=c,a=i,s};let c=!1;s.fail=function(e,n){const l=t.getInternalMethods().getLoggerInstance();if(!i.length){if(t.getExitProcess()&&rt(!0),!c){c=!0,a&&(t.showHelp("error"),l.error()),(e||n)&&l.error(e||n);const s=r||o;s&&((e||n)&&l.error(""),l.error(s))}if(n=n||new M(e),t.getExitProcess())return t.exit(1);if(t.getInternalMethods().hasParseCallback())return t.exit(1,n);throw n}for(let t=i.length-1;t>=0;--t){const r=i[t];if(ot(r)){if(n)throw n;if(e)throw Error(e)}else r(e,n,s)}};let l=[],h=!1;s.usage=(t,e)=>null===t?(h=!0,l=[],s):(h=!1,l.push([t,e||""]),s),s.getUsage=()=>l,s.getUsageDisabled=()=>h,s.getPositionalGroupName=()=>n("Positionals:");let u=[];s.example=(t,e)=>{u.push([t,e||""])};let d=[];s.command=function(t,e,n,s,i=!1){n&&(d=d.map((t=>(t[2]=!1,t)))),d.push([t,e||"",n,s,i])},s.getCommands=()=>d;let f={};s.describe=function(t,e){Array.isArray(t)?t.forEach((t=>{s.describe(t,e)})):"object"==typeof t?Object.keys(t).forEach((e=>{s.describe(e,t[e])})):f[t]=e},s.getDescriptions=()=>f;let p=[];s.epilog=t=>{p.push(t)};let m,g=!1;s.wrap=t=>{g=!0,m=t},s.getWrap=()=>e.getEnv("YARGS_DISABLE_WRAP")?null:(g||(m=function(){const t=80;return e.process.stdColumns?Math.min(t,e.process.stdColumns):t}(),g=!0),m);const y="__yargsString__:";function b(t,n,s){let i=0;return Array.isArray(t)||(t=Object.values(t).map((t=>[t]))),t.forEach((t=>{i=Math.max(e.stringWidth(s?`${s} ${ht(t[0])}`:ht(t[0]))+lt(t[0]),i)})),n&&(i=Math.min(i,parseInt((.5*n).toString(),10))),i}let v;function w(e){return t.getOptions().hiddenOptions.indexOf(e)<0||t.parsed.argv[t.getOptions().showHiddenOpt]}function O(t,e){let s=`[${n("default:")} `;if(void 0===t&&!e)return null;if(e)s+=e;else switch(typeof t){case"string":s+=`"${t}"`;break;case"object":s+=JSON.stringify(t);break;default:s+=t}return`${s}]`}s.deferY18nLookup=t=>y+t,s.help=function(){if(v)return v;!function(){const e=t.getDemandedOptions(),n=t.getOptions();(Object.keys(n.alias)||[]).forEach((i=>{n.alias[i].forEach((r=>{f[r]&&s.describe(i,f[r]),r in e&&t.demandOption(i,e[r]),n.boolean.includes(r)&&t.boolean(i),n.count.includes(r)&&t.count(i),n.string.includes(r)&&t.string(i),n.normalize.includes(r)&&t.normalize(i),n.array.includes(r)&&t.array(i),n.number.includes(r)&&t.number(i)}))}))}();const i=t.customScriptName?t.$0:e.path.basename(t.$0),r=t.getDemandedOptions(),o=t.getDemandedCommands(),a=t.getDeprecatedOptions(),c=t.getGroups(),m=t.getOptions();let g=[];g=g.concat(Object.keys(f)),g=g.concat(Object.keys(r)),g=g.concat(Object.keys(o)),g=g.concat(Object.keys(m.default)),g=g.filter(w),g=Object.keys(g.reduce(((t,e)=>("_"!==e&&(t[e]=!0),t)),{}));const x=s.getWrap(),E=e.cliui({width:x,wrap:!!x});if(!h)if(l.length)l.forEach((t=>{E.div({text:`${t[0].replace(/\$0/g,i)}`}),t[1]&&E.div({text:`${t[1]}`,padding:[1,0,0,0]})})),E.div();else if(d.length){let t=null;t=o._?`${i} <${n("command")}>\n`:`${i} [${n("command")}]\n`,E.div(`${t}`)}if(d.length>1||1===d.length&&!d[0][2]){E.div(n("Commands:"));const e=t.getInternalMethods().getContext(),s=e.commands.length?`${e.commands.join(" ")} `:"";!0===t.getInternalMethods().getParserConfiguration()["sort-commands"]&&(d=d.sort(((t,e)=>t[0].localeCompare(e[0]))));const r=i?`${i} `:"";d.forEach((t=>{const e=`${r}${s}${t[0].replace(/^\$0 ?/,"")}`;E.span({text:e,padding:[0,2,0,2],width:b(d,x,`${i}${s}`)+4},{text:t[1]});const o=[];t[2]&&o.push(`[${n("default")}]`),t[3]&&t[3].length&&o.push(`[${n("aliases:")} ${t[3].join(", ")}]`),t[4]&&("string"==typeof t[4]?o.push(`[${n("deprecated: %s",t[4])}]`):o.push(`[${n("deprecated")}]`)),o.length?E.div({text:o.join(" "),padding:[0,0,0,2],align:"right"}):E.div()})),E.div()}const j=(Object.keys(m.alias)||[]).concat(Object.keys(t.parsed.newAliases)||[]);g=g.filter((e=>!t.parsed.newAliases[e]&&j.every((t=>-1===(m.alias[t]||[]).indexOf(e)))));const S=n("Options:");c[S]||(c[S]=[]),function(t,e,n,s){let i=[],r=null;Object.keys(n).forEach((t=>{i=i.concat(n[t])})),t.forEach((t=>{r=[t].concat(e[t]),r.some((t=>-1!==i.indexOf(t)))||n[s].push(t)}))}(g,m.alias,c,S);const C=t=>/^--/.test(ht(t)),_=Object.keys(c).filter((t=>c[t].length>0)).map((t=>({groupName:t,normalizedKeys:c[t].filter(w).map((t=>{if(j.includes(t))return t;for(let e,n=0;void 0!==(e=j[n]);n++)if((m.alias[e]||[]).includes(t))return e;return t}))}))).filter((({normalizedKeys:t})=>t.length>0)).map((({groupName:t,normalizedKeys:e})=>{const n=e.reduce(((e,n)=>(e[n]=[n].concat(m.alias[n]||[]).map((e=>t===s.getPositionalGroupName()?e:(/^[0-9]$/.test(e)?m.boolean.includes(n)?"-":"--":e.length>1?"--":"-")+e)).sort(((t,e)=>C(t)===C(e)?0:C(t)?1:-1)).join(", "),e)),{});return{groupName:t,normalizedKeys:e,switches:n}}));if(_.filter((({groupName:t})=>t!==s.getPositionalGroupName())).some((({normalizedKeys:t,switches:e})=>!t.every((t=>C(e[t])))))&&_.filter((({groupName:t})=>t!==s.getPositionalGroupName())).forEach((({normalizedKeys:t,switches:e})=>{t.forEach((t=>{var n,s;C(e[t])&&(e[t]=(n=e[t],s=4,ct(n)?{text:n.text,indentation:n.indentation+s}:{text:n,indentation:s}))}))})),_.forEach((({groupName:e,normalizedKeys:i,switches:o})=>{E.div(e),i.forEach((e=>{const i=o[e];let c=f[e]||"",l=null;c.includes(y)&&(c=n(c.substring(16))),m.boolean.includes(e)&&(l=`[${n("boolean")}]`),m.count.includes(e)&&(l=`[${n("count")}]`),m.string.includes(e)&&(l=`[${n("string")}]`),m.normalize.includes(e)&&(l=`[${n("string")}]`),m.array.includes(e)&&(l=`[${n("array")}]`),m.number.includes(e)&&(l=`[${n("number")}]`);const h=[e in a?(u=a[e],"string"==typeof u?`[${n("deprecated: %s",u)}]`:`[${n("deprecated")}]`):null,l,e in r?`[${n("required")}]`:null,m.choices&&m.choices[e]?`[${n("choices:")} ${s.stringifiedValues(m.choices[e])}]`:null,O(m.default[e],m.defaultDescription[e])].filter(Boolean).join(" ");var u;E.span({text:ht(i),padding:[0,2,0,2+lt(i)],width:b(o,x)+4},c);const d=!0===t.getInternalMethods().getUsageConfiguration()["hide-types"];h&&!d?E.div({text:h,padding:[0,0,0,2],align:"right"}):E.div()})),E.div()})),u.length&&(E.div(n("Examples:")),u.forEach((t=>{t[0]=t[0].replace(/\$0/g,i)})),u.forEach((t=>{""===t[1]?E.div({text:t[0],padding:[0,2,0,2]}):E.div({text:t[0],padding:[0,2,0,2],width:b(u,x)+4},{text:t[1]})})),E.div()),p.length>0){const t=p.map((t=>t.replace(/\$0/g,i))).join("\n");E.div(`${t}\n`)}return E.toString().replace(/\s*$/,"")},s.cacheHelpMessage=function(){v=this.help()},s.clearCachedHelpMessage=function(){v=void 0},s.hasCachedHelpMessage=function(){return!!v},s.showHelp=e=>{const n=t.getInternalMethods().getLoggerInstance();e||(e="error");("function"==typeof e?e:n[e])(s.help())},s.functionDescription=t=>["(",t.name?e.Parser.decamelize(t.name,"-"):n("generated-value"),")"].join(""),s.stringifiedValues=function(t,e){let n="";const s=e||", ",i=[].concat(t);return t&&i.length?(i.forEach((t=>{n.length&&(n+=s),n+=JSON.stringify(t)})),n):n};let x=null;s.version=t=>{x=t},s.showVersion=e=>{const n=t.getInternalMethods().getLoggerInstance();e||(e="error");("function"==typeof e?e:n[e])(x)},s.reset=function(t){return r=null,c=!1,l=[],h=!1,p=[],u=[],d=[],f=it(f,(e=>!t[e])),s};const E=[];return s.freeze=function(){E.push({failMessage:r,failureOutput:c,usages:l,usageDisabled:h,epilogs:p,examples:u,commands:d,descriptions:f})},s.unfreeze=function(t=!1){const e=E.pop();e&&(t?(f={...e.descriptions,...f},d=[...e.commands,...d],l=[...e.usages,...l],u=[...e.examples,...u],p=[...e.epilogs,...p]):({failMessage:r,failureOutput:c,usages:l,usageDisabled:h,epilogs:p,examples:u,commands:d,descriptions:f}=e))},s}function ct(t){return"object"==typeof t}function lt(t){return ct(t)?t.indentation:0}function ht(t){return ct(t)?t.text:t}class ut{constructor(t,e,n,s){var i,r,o;this.yargs=t,this.usage=e,this.command=n,this.shim=s,this.completionKey="get-yargs-completions",this.aliases=null,this.customCompletionFunction=null,this.indexAfterLastReset=0,this.zshShell=null!==(o=(null===(i=this.shim.getEnv("SHELL"))||void 0===i?void 0:i.includes("zsh"))||(null===(r=this.shim.getEnv("ZSH_NAME"))||void 0===r?void 0:r.includes("zsh")))&&void 0!==o&&o}defaultCompletion(t,e,n,s){const i=this.command.getCommandHandlers();for(let e=0,n=t.length;e<n;++e)if(i[t[e]]&&i[t[e]].builder){const n=i[t[e]].builder;if(st(n)){this.indexAfterLastReset=e+1;const t=this.yargs.getInternalMethods().reset();return n(t,!0),t.argv}}const r=[];this.commandCompletions(r,t,n),this.optionCompletions(r,t,e,n),this.choicesFromOptionsCompletions(r,t,e,n),this.choicesFromPositionalsCompletions(r,t,e,n),s(null,r)}commandCompletions(t,e,n){const s=this.yargs.getInternalMethods().getContext().commands;n.match(/^-/)||s[s.length-1]===n||this.previousArgHasChoices(e)||this.usage.getCommands().forEach((n=>{const s=q(n[0]).cmd;if(-1===e.indexOf(s))if(this.zshShell){const e=n[1]||"";t.push(s.replace(/:/g,"\\:")+":"+e)}else t.push(s)}))}optionCompletions(t,e,n,s){if((s.match(/^-/)||""===s&&0===t.length)&&!this.previousArgHasChoices(e)){const n=this.yargs.getOptions(),i=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[];Object.keys(n.key).forEach((r=>{const o=!!n.configuration["boolean-negation"]&&n.boolean.includes(r);i.includes(r)||n.hiddenOptions.includes(r)||this.argsContainKey(e,r,o)||this.completeOptionKey(r,t,s,o&&!!n.default[r])}))}}choicesFromOptionsCompletions(t,e,n,s){if(this.previousArgHasChoices(e)){const n=this.getPreviousArgChoices(e);n&&n.length>0&&t.push(...n.map((t=>t.replace(/:/g,"\\:"))))}}choicesFromPositionalsCompletions(t,e,n,s){if(""===s&&t.length>0&&this.previousArgHasChoices(e))return;const i=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[],r=Math.max(this.indexAfterLastReset,this.yargs.getInternalMethods().getContext().commands.length+1),o=i[n._.length-r-1];if(!o)return;const a=this.yargs.getOptions().choices[o]||[];for(const e of a)e.startsWith(s)&&t.push(e.replace(/:/g,"\\:"))}getPreviousArgChoices(t){if(t.length<1)return;let e=t[t.length-1],n="";if(!e.startsWith("-")&&t.length>1&&(n=e,e=t[t.length-2]),!e.startsWith("-"))return;const s=e.replace(/^-+/,""),i=this.yargs.getOptions(),r=[s,...this.yargs.getAliases()[s]||[]];let o;for(const t of r)if(Object.prototype.hasOwnProperty.call(i.key,t)&&Array.isArray(i.choices[t])){o=i.choices[t];break}return o?o.filter((t=>!n||t.startsWith(n))):void 0}previousArgHasChoices(t){const e=this.getPreviousArgChoices(t);return void 0!==e&&e.length>0}argsContainKey(t,e,n){const s=e=>-1!==t.indexOf((/^[^0-9]$/.test(e)?"-":"--")+e);if(s(e))return!0;if(n&&s(`no-${e}`))return!0;if(this.aliases)for(const t of this.aliases[e])if(s(t))return!0;return!1}completeOptionKey(t,e,n,s){var i,r,o,a;let c=t;if(this.zshShell){const e=this.usage.getDescriptions(),n=null===(r=null===(i=null==this?void 0:this.aliases)||void 0===i?void 0:i[t])||void 0===r?void 0:r.find((t=>{const n=e[t];return"string"==typeof n&&n.length>0})),s=n?e[n]:void 0,l=null!==(a=null!==(o=e[t])&&void 0!==o?o:s)&&void 0!==a?a:"";c=`${t.replace(/:/g,"\\:")}:${l.replace("__yargsString__:","").replace(/(\r\n|\n|\r)/gm," ")}`}const l=!/^--/.test(n)&&(t=>/^[^0-9]$/.test(t))(t)?"-":"--";e.push(l+c),s&&e.push(l+"no-"+c)}customCompletion(t,e,n,s){if(R(this.customCompletionFunction,null,this.shim),this.customCompletionFunction.length<3){const t=this.customCompletionFunction(n,e);return H(t)?t.then((t=>{this.shim.process.nextTick((()=>{s(null,t)}))})).catch((t=>{this.shim.process.nextTick((()=>{s(t,void 0)}))})):s(null,t)}return function(t){return t.length>3}(this.customCompletionFunction)?this.customCompletionFunction(n,e,((i=s)=>this.defaultCompletion(t,e,n,i)),(t=>{s(null,t)})):this.customCompletionFunction(n,e,(t=>{s(null,t)}))}getCompletion(t,e){const n=t.length?t[t.length-1]:"",s=this.yargs.parse(t,!0),i=this.customCompletionFunction?s=>this.customCompletion(t,s,n,e):s=>this.defaultCompletion(t,s,n,e);return H(s)?s.then(i):i(s)}generateCompletionScript(t,e){let n=this.zshShell?'#compdef {{app_name}}\n###-begin-{{app_name}}-completions-###\n#\n# yargs command completion script\n#\n# Installation: {{app_path}} {{completion_command}} >> ~/.zshrc\n# or {{app_path}} {{completion_command}} >> ~/.zprofile on OSX.\n#\n_{{app_name}}_yargs_completions()\n{\n local reply\n local si=$IFS\n IFS=$\'\n\' reply=($(COMP_CWORD="$((CURRENT-1))" COMP_LINE="$BUFFER" COMP_POINT="$CURSOR" {{app_path}} --get-yargs-completions "${words[@]}"))\n IFS=$si\n _describe \'values\' reply\n}\ncompdef _{{app_name}}_yargs_completions {{app_name}}\n###-end-{{app_name}}-completions-###\n':'###-begin-{{app_name}}-completions-###\n#\n# yargs command completion script\n#\n# Installation: {{app_path}} {{completion_command}} >> ~/.bashrc\n# or {{app_path}} {{completion_command}} >> ~/.bash_profile on OSX.\n#\n_{{app_name}}_yargs_completions()\n{\n local cur_word args type_list\n\n cur_word="${COMP_WORDS[COMP_CWORD]}"\n args=("${COMP_WORDS[@]}")\n\n # ask yargs to generate completions.\n type_list=$({{app_path}} --get-yargs-completions "${args[@]}")\n\n COMPREPLY=( $(compgen -W "${type_list}" -- ${cur_word}) )\n\n # if no match was found, fall back to filename completion\n if [ ${#COMPREPLY[@]} -eq 0 ]; then\n COMPREPLY=()\n fi\n\n return 0\n}\ncomplete -o bashdefault -o default -F _{{app_name}}_yargs_completions {{app_name}}\n###-end-{{app_name}}-completions-###\n';const s=this.shim.path.basename(t);return t.match(/\.js$/)&&(t=`./${t}`),n=n.replace(/{{app_name}}/g,s),n=n.replace(/{{completion_command}}/g,e),n.replace(/{{app_path}}/g,t)}registerFunction(t){this.customCompletionFunction=t}setParsed(t){this.aliases=t.aliases}}function dt(t,e){if(0===t.length)return e.length;if(0===e.length)return t.length;const n=[];let s,i;for(s=0;s<=e.length;s++)n[s]=[s];for(i=0;i<=t.length;i++)n[0][i]=i;for(s=1;s<=e.length;s++)for(i=1;i<=t.length;i++)e.charAt(s-1)===t.charAt(i-1)?n[s][i]=n[s-1][i-1]:s>1&&i>1&&e.charAt(s-2)===t.charAt(i-1)&&e.charAt(s-1)===t.charAt(i-2)?n[s][i]=n[s-2][i-2]+1:n[s][i]=Math.min(n[s-1][i-1]+1,Math.min(n[s][i-1]+1,n[s-1][i]+1));return n[e.length][t.length]}const ft=["$0","--","_"];let pt,mt=[];function gt(t,e,n,s){pt=s;let i={};if(Object.prototype.hasOwnProperty.call(t,"extends")){if("string"!=typeof t.extends)return i;const s=/\.json|\..*rc$/.test(t.extends);let r=null;if(s)r=function(t,e){return pt.path.resolve(t,e)}(e,t.extends);else try{r=require.resolve(t.extends)}catch(e){return t}!function(t){if(mt.indexOf(t)>-1)throw new M(`Circular extended configurations: '${t}'.`)}(r),mt.push(r),i=s?JSON.parse(pt.readFileSync(r,"utf8")):require(t.extends),delete t.extends,i=gt(i,pt.path.dirname(r),n,pt)}return mt=[],n?yt(i,t):Object.assign({},i,t)}function yt(t,e){const n={};function s(t){return t&&"object"==typeof t&&!Array.isArray(t)}Object.assign(n,t);for(const i of Object.keys(e))s(e[i])&&s(n[i])?n[i]=yt(t[i],e[i]):n[i]=e[i];return n}var bt,vt,wt,Ot,xt,Et,jt,St,Ct,_t,kt,At,Pt,$t,It,Mt,Tt,Nt,Lt,Ft,Gt,Dt,Wt,Ut,Rt,Bt,zt,Ht,qt,Vt,Kt,Yt,Jt,Qt,Xt,Zt=function(t,e,n,s,i){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?i.call(t,n):i?i.value=n:e.set(t,n),n},te=function(t,e,n,s){if("a"===n&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?s:"a"===n?s.call(t):s?s.value:e.get(t)};const ee=Symbol("copyDoubleDash"),ne=Symbol("copyDoubleDash"),se=Symbol("deleteFromParserHintObject"),ie=Symbol("emitWarning"),re=Symbol("freeze"),oe=Symbol("getDollarZero"),ae=Symbol("getParserConfiguration"),ce=Symbol("getUsageConfiguration"),le=Symbol("guessLocale"),he=Symbol("guessVersion"),ue=Symbol("parsePositionalNumbers"),de=Symbol("pkgUp"),fe=Symbol("populateParserHintArray"),pe=Symbol("populateParserHintSingleValueDictionary"),me=Symbol("populateParserHintArrayDictionary"),ge=Symbol("populateParserHintDictionary"),ye=Symbol("sanitizeKey"),be=Symbol("setKey"),ve=Symbol("unfreeze"),we=Symbol("validateAsync"),Oe=Symbol("getCommandInstance"),xe=Symbol("getContext"),Ee=Symbol("getHasOutput"),je=Symbol("getLoggerInstance"),Se=Symbol("getParseContext"),Ce=Symbol("getUsageInstance"),_e=Symbol("getValidationInstance"),ke=Symbol("hasParseCallback"),Ae=Symbol("isGlobalContext"),Pe=Symbol("postProcess"),$e=Symbol("rebase"),Ie=Symbol("reset"),Me=Symbol("runYargsParserAndExecuteCommands"),Te=Symbol("runValidation"),Ne=Symbol("setHasOutput"),Le=Symbol("kTrackManuallySetKeys");class Fe{constructor(t=[],e,n,s){this.customScriptName=!1,this.parsed=!1,bt.set(this,void 0),vt.set(this,void 0),wt.set(this,{commands:[],fullCommands:[]}),Ot.set(this,null),xt.set(this,null),Et.set(this,"show-hidden"),jt.set(this,null),St.set(this,!0),Ct.set(this,{}),_t.set(this,!0),kt.set(this,[]),At.set(this,void 0),Pt.set(this,{}),$t.set(this,!1),It.set(this,null),Mt.set(this,!0),Tt.set(this,void 0),Nt.set(this,""),Lt.set(this,void 0),Ft.set(this,void 0),Gt.set(this,{}),Dt.set(this,null),Wt.set(this,null),Ut.set(this,{}),Rt.set(this,{}),Bt.set(this,void 0),zt.set(this,!1),Ht.set(this,void 0),qt.set(this,!1),Vt.set(this,!1),Kt.set(this,!1),Yt.set(this,void 0),Jt.set(this,{}),Qt.set(this,null),Xt.set(this,void 0),Zt(this,Ht,s,"f"),Zt(this,Bt,t,"f"),Zt(this,vt,e,"f"),Zt(this,Ft,n,"f"),Zt(this,At,new Q(this),"f"),this.$0=this[oe](),this[Ie](),Zt(this,bt,te(this,bt,"f"),"f"),Zt(this,Yt,te(this,Yt,"f"),"f"),Zt(this,Xt,te(this,Xt,"f"),"f"),Zt(this,Lt,te(this,Lt,"f"),"f"),te(this,Lt,"f").showHiddenOpt=te(this,Et,"f"),Zt(this,Tt,this[ne](),"f")}addHelpOpt(t,e){return K("[string|boolean] [string]",[t,e],arguments.length),te(this,It,"f")&&(this[se](te(this,It,"f")),Zt(this,It,null,"f")),!1===t&&void 0===e||(Zt(this,It,"string"==typeof t?t:"help","f"),this.boolean(te(this,It,"f")),this.describe(te(this,It,"f"),e||te(this,Yt,"f").deferY18nLookup("Show help"))),this}help(t,e){return this.addHelpOpt(t,e)}addShowHiddenOpt(t,e){if(K("[string|boolean] [string]",[t,e],arguments.length),!1===t&&void 0===e)return this;const n="string"==typeof t?t:te(this,Et,"f");return this.boolean(n),this.describe(n,e||te(this,Yt,"f").deferY18nLookup("Show hidden options")),te(this,Lt,"f").showHiddenOpt=n,this}showHidden(t,e){return this.addShowHiddenOpt(t,e)}alias(t,e){return K("<object|string|array> [string|array]",[t,e],arguments.length),this[me](this.alias.bind(this),"alias",t,e),this}array(t){return K("<array|string>",[t],arguments.length),this[fe]("array",t),this[Le](t),this}boolean(t){return K("<array|string>",[t],arguments.length),this[fe]("boolean",t),this[Le](t),this}check(t,e){return K("<function> [boolean]",[t,e],arguments.length),this.middleware(((e,n)=>Z((()=>t(e,n.getOptions())),(n=>(n?("string"==typeof n||n instanceof Error)&&te(this,Yt,"f").fail(n.toString(),n):te(this,Yt,"f").fail(te(this,Ht,"f").y18n.__("Argument check failed: %s",t.toString())),e)),(t=>(te(this,Yt,"f").fail(t.message?t.message:t.toString(),t),e)))),!1,e),this}choices(t,e){return K("<object|string|array> [string|array]",[t,e],arguments.length),this[me](this.choices.bind(this),"choices",t,e),this}coerce(t,e){if(K("<object|string|array> [function]",[t,e],arguments.length),Array.isArray(t)){if(!e)throw new M("coerce callback must be provided");for(const n of t)this.coerce(n,e);return this}if("object"==typeof t){for(const e of Object.keys(t))this.coerce(e,t[e]);return this}if(!e)throw new M("coerce callback must be provided");return te(this,Lt,"f").key[t]=!0,te(this,At,"f").addCoerceMiddleware(((n,s)=>{let i;return Object.prototype.hasOwnProperty.call(n,t)?Z((()=>(i=s.getAliases(),e(n[t]))),(e=>{n[t]=e;const r=s.getInternalMethods().getParserConfiguration()["strip-aliased"];if(i[t]&&!0!==r)for(const s of i[t])n[s]=e;return n}),(t=>{throw new M(t.message)})):n}),t),this}conflicts(t,e){return K("<string|object> [string|array]",[t,e],arguments.length),te(this,Xt,"f").conflicts(t,e),this}config(t="config",e,n){return K("[object|string] [string|function] [function]",[t,e,n],arguments.length),"object"!=typeof t||Array.isArray(t)?("function"==typeof e&&(n=e,e=void 0),this.describe(t,e||te(this,Yt,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(t)?t:[t]).forEach((t=>{te(this,Lt,"f").config[t]=n||!0})),this):(t=gt(t,te(this,vt,"f"),this[ae]()["deep-merge-config"]||!1,te(this,Ht,"f")),te(this,Lt,"f").configObjects=(te(this,Lt,"f").configObjects||[]).concat(t),this)}completion(t,e,n){return K("[string] [string|boolean|function] [function]",[t,e,n],arguments.length),"function"==typeof e&&(n=e,e=void 0),Zt(this,xt,t||te(this,xt,"f")||"completion","f"),e||!1===e||(e="generate completion script"),this.command(te(this,xt,"f"),e),n&&te(this,Ot,"f").registerFunction(n),this}command(t,e,n,s,i,r){return K("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[t,e,n,s,i,r],arguments.length),te(this,bt,"f").addHandler(t,e,n,s,i,r),this}commands(t,e,n,s,i,r){return this.command(t,e,n,s,i,r)}commandDir(t,e){K("<string> [object]",[t,e],arguments.length);const n=te(this,Ft,"f")||te(this,Ht,"f").require;return te(this,bt,"f").addDirectory(t,n,te(this,Ht,"f").getCallerFile(),e),this}count(t){return K("<array|string>",[t],arguments.length),this[fe]("count",t),this[Le](t),this}default(t,e,n){return K("<object|string|array> [*] [string]",[t,e,n],arguments.length),n&&(B(t,te(this,Ht,"f")),te(this,Lt,"f").defaultDescription[t]=n),"function"==typeof e&&(B(t,te(this,Ht,"f")),te(this,Lt,"f").defaultDescription[t]||(te(this,Lt,"f").defaultDescription[t]=te(this,Yt,"f").functionDescription(e)),e=e.call()),this[pe](this.default.bind(this),"default",t,e),this}defaults(t,e,n){return this.default(t,e,n)}demandCommand(t=1,e,n,s){return K("[number] [number|string] [string|null|undefined] [string|null|undefined]",[t,e,n,s],arguments.length),"number"!=typeof e&&(n=e,e=1/0),this.global("_",!1),te(this,Lt,"f").demandedCommands._={min:t,max:e,minMsg:n,maxMsg:s},this}demand(t,e,n){return Array.isArray(e)?(e.forEach((t=>{R(n,!0,te(this,Ht,"f")),this.demandOption(t,n)})),e=1/0):"number"!=typeof e&&(n=e,e=1/0),"number"==typeof t?(R(n,!0,te(this,Ht,"f")),this.demandCommand(t,e,n,n)):Array.isArray(t)?t.forEach((t=>{R(n,!0,te(this,Ht,"f")),this.demandOption(t,n)})):"string"==typeof n?this.demandOption(t,n):!0!==n&&void 0!==n||this.demandOption(t),this}demandOption(t,e){return K("<object|string|array> [string]",[t,e],arguments.length),this[pe](this.demandOption.bind(this),"demandedOptions",t,e),this}deprecateOption(t,e){return K("<string> [string|boolean]",[t,e],arguments.length),te(this,Lt,"f").deprecatedOptions[t]=e,this}describe(t,e){return K("<object|string|array> [string]",[t,e],arguments.length),this[be](t,!0),te(this,Yt,"f").describe(t,e),this}detectLocale(t){return K("<boolean>",[t],arguments.length),Zt(this,St,t,"f"),this}env(t){return K("[string|boolean]",[t],arguments.length),!1===t?delete te(this,Lt,"f").envPrefix:te(this,Lt,"f").envPrefix=t||"",this}epilogue(t){return K("<string>",[t],arguments.length),te(this,Yt,"f").epilog(t),this}epilog(t){return this.epilogue(t)}example(t,e){return K("<string|array> [string]",[t,e],arguments.length),Array.isArray(t)?t.forEach((t=>this.example(...t))):te(this,Yt,"f").example(t,e),this}exit(t,e){Zt(this,$t,!0,"f"),Zt(this,jt,e,"f"),te(this,_t,"f")&&te(this,Ht,"f").process.exit(t)}exitProcess(t=!0){return K("[boolean]",[t],arguments.length),Zt(this,_t,t,"f"),this}fail(t){if(K("<function|boolean>",[t],arguments.length),"boolean"==typeof t&&!1!==t)throw new M("Invalid first argument. Expected function or boolean 'false'");return te(this,Yt,"f").failFn(t),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(t,e){return K("<array> [function]",[t,e],arguments.length),e?te(this,Ot,"f").getCompletion(t,e):new Promise(((e,n)=>{te(this,Ot,"f").getCompletion(t,((t,s)=>{t?n(t):e(s)}))}))}getDemandedOptions(){return K([],0),te(this,Lt,"f").demandedOptions}getDemandedCommands(){return K([],0),te(this,Lt,"f").demandedCommands}getDeprecatedOptions(){return K([],0),te(this,Lt,"f").deprecatedOptions}getDetectLocale(){return te(this,St,"f")}getExitProcess(){return te(this,_t,"f")}getGroups(){return Object.assign({},te(this,Pt,"f"),te(this,Rt,"f"))}getHelp(){if(Zt(this,$t,!0,"f"),!te(this,Yt,"f").hasCachedHelpMessage()){if(!this.parsed){const t=this[Me](te(this,Bt,"f"),void 0,void 0,0,!0);if(H(t))return t.then((()=>te(this,Yt,"f").help()))}const t=te(this,bt,"f").runDefaultBuilderOn(this);if(H(t))return t.then((()=>te(this,Yt,"f").help()))}return Promise.resolve(te(this,Yt,"f").help())}getOptions(){return te(this,Lt,"f")}getStrict(){return te(this,qt,"f")}getStrictCommands(){return te(this,Vt,"f")}getStrictOptions(){return te(this,Kt,"f")}global(t,e){return K("<string|array> [boolean]",[t,e],arguments.length),t=[].concat(t),!1!==e?te(this,Lt,"f").local=te(this,Lt,"f").local.filter((e=>-1===t.indexOf(e))):t.forEach((t=>{te(this,Lt,"f").local.includes(t)||te(this,Lt,"f").local.push(t)})),this}group(t,e){K("<string|array> <string>",[t,e],arguments.length);const n=te(this,Rt,"f")[e]||te(this,Pt,"f")[e];te(this,Rt,"f")[e]&&delete te(this,Rt,"f")[e];const s={};return te(this,Pt,"f")[e]=(n||[]).concat(t).filter((t=>!s[t]&&(s[t]=!0))),this}hide(t){return K("<string>",[t],arguments.length),te(this,Lt,"f").hiddenOptions.push(t),this}implies(t,e){return K("<string|object> [number|string|array]",[t,e],arguments.length),te(this,Xt,"f").implies(t,e),this}locale(t){return K("[string]",[t],arguments.length),void 0===t?(this[le](),te(this,Ht,"f").y18n.getLocale()):(Zt(this,St,!1,"f"),te(this,Ht,"f").y18n.setLocale(t),this)}middleware(t,e,n){return te(this,At,"f").addMiddleware(t,!!e,n)}nargs(t,e){return K("<string|object|array> [number]",[t,e],arguments.length),this[pe](this.nargs.bind(this),"narg",t,e),this}normalize(t){return K("<array|string>",[t],arguments.length),this[fe]("normalize",t),this}number(t){return K("<array|string>",[t],arguments.length),this[fe]("number",t),this[Le](t),this}option(t,e){if(K("<string|object> [object]",[t,e],arguments.length),"object"==typeof t)Object.keys(t).forEach((e=>{this.options(e,t[e])}));else{"object"!=typeof e&&(e={}),this[Le](t),!te(this,Qt,"f")||"version"!==t&&"version"!==(null==e?void 0:e.alias)||this[ie](['"version" is a reserved word.',"Please do one of the following:",'- Disable version with `yargs.version(false)` if using "version" as an option',"- Use the built-in `yargs.version` method instead (if applicable)","- Use a different option key","https://yargs.js.org/docs/#api-reference-version"].join("\n"),void 0,"versionWarning"),te(this,Lt,"f").key[t]=!0,e.alias&&this.alias(t,e.alias);const n=e.deprecate||e.deprecated;n&&this.deprecateOption(t,n);const s=e.demand||e.required||e.require;s&&this.demand(t,s),e.demandOption&&this.demandOption(t,"string"==typeof e.demandOption?e.demandOption:void 0),e.conflicts&&this.conflicts(t,e.conflicts),"default"in e&&this.default(t,e.default),void 0!==e.implies&&this.implies(t,e.implies),void 0!==e.nargs&&this.nargs(t,e.nargs),e.config&&this.config(t,e.configParser),e.normalize&&this.normalize(t),e.choices&&this.choices(t,e.choices),e.coerce&&this.coerce(t,e.coerce),e.group&&this.group(t,e.group),(e.boolean||"boolean"===e.type)&&(this.boolean(t),e.alias&&this.boolean(e.alias)),(e.array||"array"===e.type)&&(this.array(t),e.alias&&this.array(e.alias)),(e.number||"number"===e.type)&&(this.number(t),e.alias&&this.number(e.alias)),(e.string||"string"===e.type)&&(this.string(t),e.alias&&this.string(e.alias)),(e.count||"count"===e.type)&&this.count(t),"boolean"==typeof e.global&&this.global(t,e.global),e.defaultDescription&&(te(this,Lt,"f").defaultDescription[t]=e.defaultDescription),e.skipValidation&&this.skipValidation(t);const i=e.describe||e.description||e.desc,r=te(this,Yt,"f").getDescriptions();Object.prototype.hasOwnProperty.call(r,t)&&"string"!=typeof i||this.describe(t,i),e.hidden&&this.hide(t),e.requiresArg&&this.requiresArg(t)}return this}options(t,e){return this.option(t,e)}parse(t,e,n){K("[string|array] [function|boolean|object] [function]",[t,e,n],arguments.length),this[re](),void 0===t&&(t=te(this,Bt,"f")),"object"==typeof e&&(Zt(this,Wt,e,"f"),e=n),"function"==typeof e&&(Zt(this,Dt,e,"f"),e=!1),e||Zt(this,Bt,t,"f"),te(this,Dt,"f")&&Zt(this,_t,!1,"f");const s=this[Me](t,!!e),i=this.parsed;return te(this,Ot,"f").setParsed(this.parsed),H(s)?s.then((t=>(te(this,Dt,"f")&&te(this,Dt,"f").call(this,te(this,jt,"f"),t,te(this,Nt,"f")),t))).catch((t=>{throw te(this,Dt,"f")&&te(this,Dt,"f")(t,this.parsed.argv,te(this,Nt,"f")),t})).finally((()=>{this[ve](),this.parsed=i})):(te(this,Dt,"f")&&te(this,Dt,"f").call(this,te(this,jt,"f"),s,te(this,Nt,"f")),this[ve](),this.parsed=i,s)}parseAsync(t,e,n){const s=this.parse(t,e,n);return H(s)?s:Promise.resolve(s)}parseSync(t,e,n){const s=this.parse(t,e,n);if(H(s))throw new M(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return s}parserConfiguration(t){return K("<object>",[t],arguments.length),Zt(this,Gt,t,"f"),this}pkgConf(t,e){K("<string> [string]",[t,e],arguments.length);let n=null;const s=this[de](e||te(this,vt,"f"));return s[t]&&"object"==typeof s[t]&&(n=gt(s[t],e||te(this,vt,"f"),this[ae]()["deep-merge-config"]||!1,te(this,Ht,"f")),te(this,Lt,"f").configObjects=(te(this,Lt,"f").configObjects||[]).concat(n)),this}positional(t,e){K("<string> <object>",[t,e],arguments.length);const n=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];e=it(e,((t,e)=>!("type"===t&&!["string","number","boolean"].includes(e))&&n.includes(t)));const s=te(this,wt,"f").fullCommands[te(this,wt,"f").fullCommands.length-1],i=s?te(this,bt,"f").cmdToParseOptions(s):{array:[],alias:{},default:{},demand:{}};return z(i).forEach((n=>{const s=i[n];Array.isArray(s)?-1!==s.indexOf(t)&&(e[n]=!0):s[t]&&!(n in e)&&(e[n]=s[t])})),this.group(t,te(this,Yt,"f").getPositionalGroupName()),this.option(t,e)}recommendCommands(t=!0){return K("[boolean]",[t],arguments.length),Zt(this,zt,t,"f"),this}required(t,e,n){return this.demand(t,e,n)}require(t,e,n){return this.demand(t,e,n)}requiresArg(t){return K("<array|string|object> [number]",[t],arguments.length),"string"==typeof t&&te(this,Lt,"f").narg[t]||this[pe](this.requiresArg.bind(this),"narg",t,NaN),this}showCompletionScript(t,e){return K("[string] [string]",[t,e],arguments.length),t=t||this.$0,te(this,Tt,"f").log(te(this,Ot,"f").generateCompletionScript(t,e||te(this,xt,"f")||"completion")),this}showHelp(t){if(K("[string|function]",[t],arguments.length),Zt(this,$t,!0,"f"),!te(this,Yt,"f").hasCachedHelpMessage()){if(!this.parsed){const e=this[Me](te(this,Bt,"f"),void 0,void 0,0,!0);if(H(e))return e.then((()=>{te(this,Yt,"f").showHelp(t)})),this}const e=te(this,bt,"f").runDefaultBuilderOn(this);if(H(e))return e.then((()=>{te(this,Yt,"f").showHelp(t)})),this}return te(this,Yt,"f").showHelp(t),this}scriptName(t){return this.customScriptName=!0,this.$0=t,this}showHelpOnFail(t,e){return K("[boolean|string] [string]",[t,e],arguments.length),te(this,Yt,"f").showHelpOnFail(t,e),this}showVersion(t){return K("[string|function]",[t],arguments.length),te(this,Yt,"f").showVersion(t),this}skipValidation(t){return K("<array|string>",[t],arguments.length),this[fe]("skipValidation",t),this}strict(t){return K("[boolean]",[t],arguments.length),Zt(this,qt,!1!==t,"f"),this}strictCommands(t){return K("[boolean]",[t],arguments.length),Zt(this,Vt,!1!==t,"f"),this}strictOptions(t){return K("[boolean]",[t],arguments.length),Zt(this,Kt,!1!==t,"f"),this}string(t){return K("<array|string>",[t],arguments.length),this[fe]("string",t),this[Le](t),this}terminalWidth(){return K([],0),te(this,Ht,"f").process.stdColumns}updateLocale(t){return this.updateStrings(t)}updateStrings(t){return K("<object>",[t],arguments.length),Zt(this,St,!1,"f"),te(this,Ht,"f").y18n.updateLocale(t),this}usage(t,e,n,s){if(K("<string|null|undefined> [string|boolean] [function|object] [function]",[t,e,n,s],arguments.length),void 0!==e){if(R(t,null,te(this,Ht,"f")),(t||"").match(/^\$0( |$)/))return this.command(t,e,n,s);throw new M(".usage() description must start with $0 if being used as alias for .command()")}return te(this,Yt,"f").usage(t),this}usageConfiguration(t){return K("<object>",[t],arguments.length),Zt(this,Jt,t,"f"),this}version(t,e,n){const s="version";if(K("[boolean|string] [string] [string]",[t,e,n],arguments.length),te(this,Qt,"f")&&(this[se](te(this,Qt,"f")),te(this,Yt,"f").version(void 0),Zt(this,Qt,null,"f")),0===arguments.length)n=this[he](),t=s;else if(1===arguments.length){if(!1===t)return this;n=t,t=s}else 2===arguments.length&&(n=e,e=void 0);return Zt(this,Qt,"string"==typeof t?t:s,"f"),e=e||te(this,Yt,"f").deferY18nLookup("Show version number"),te(this,Yt,"f").version(n||void 0),this.boolean(te(this,Qt,"f")),this.describe(te(this,Qt,"f"),e),this}wrap(t){return K("<number|null|undefined>",[t],arguments.length),te(this,Yt,"f").wrap(t),this}[(bt=new WeakMap,vt=new WeakMap,wt=new WeakMap,Ot=new WeakMap,xt=new WeakMap,Et=new WeakMap,jt=new WeakMap,St=new WeakMap,Ct=new WeakMap,_t=new WeakMap,kt=new WeakMap,At=new WeakMap,Pt=new WeakMap,$t=new WeakMap,It=new WeakMap,Mt=new WeakMap,Tt=new WeakMap,Nt=new WeakMap,Lt=new WeakMap,Ft=new WeakMap,Gt=new WeakMap,Dt=new WeakMap,Wt=new WeakMap,Ut=new WeakMap,Rt=new WeakMap,Bt=new WeakMap,zt=new WeakMap,Ht=new WeakMap,qt=new WeakMap,Vt=new WeakMap,Kt=new WeakMap,Yt=new WeakMap,Jt=new WeakMap,Qt=new WeakMap,Xt=new WeakMap,ee)](t){if(!t._||!t["--"])return t;t._.push.apply(t._,t["--"]);try{delete t["--"]}catch(t){}return t}[ne](){return{log:(...t)=>{this[ke]()||console.log(...t),Zt(this,$t,!0,"f"),te(this,Nt,"f").length&&Zt(this,Nt,te(this,Nt,"f")+"\n","f"),Zt(this,Nt,te(this,Nt,"f")+t.join(" "),"f")},error:(...t)=>{this[ke]()||console.error(...t),Zt(this,$t,!0,"f"),te(this,Nt,"f").length&&Zt(this,Nt,te(this,Nt,"f")+"\n","f"),Zt(this,Nt,te(this,Nt,"f")+t.join(" "),"f")}}}[se](t){z(te(this,Lt,"f")).forEach((e=>{if("configObjects"===e)return;const n=te(this,Lt,"f")[e];Array.isArray(n)?n.includes(t)&&n.splice(n.indexOf(t),1):"object"==typeof n&&delete n[t]})),delete te(this,Yt,"f").getDescriptions()[t]}[ie](t,e,n){te(this,Ct,"f")[n]||(te(this,Ht,"f").process.emitWarning(t,e),te(this,Ct,"f")[n]=!0)}[re](){te(this,kt,"f").push({options:te(this,Lt,"f"),configObjects:te(this,Lt,"f").configObjects.slice(0),exitProcess:te(this,_t,"f"),groups:te(this,Pt,"f"),strict:te(this,qt,"f"),strictCommands:te(this,Vt,"f"),strictOptions:te(this,Kt,"f"),completionCommand:te(this,xt,"f"),output:te(this,Nt,"f"),exitError:te(this,jt,"f"),hasOutput:te(this,$t,"f"),parsed:this.parsed,parseFn:te(this,Dt,"f"),parseContext:te(this,Wt,"f")}),te(this,Yt,"f").freeze(),te(this,Xt,"f").freeze(),te(this,bt,"f").freeze(),te(this,At,"f").freeze()}[oe](){let t,e="";return t=/\b(node|iojs|electron)(\.exe)?$/.test(te(this,Ht,"f").process.argv()[0])?te(this,Ht,"f").process.argv().slice(1,2):te(this,Ht,"f").process.argv().slice(0,1),e=t.map((t=>{const e=this[$e](te(this,vt,"f"),t);return t.match(/^(\/|([a-zA-Z]:)?\\)/)&&e.length<t.length?e:t})).join(" ").trim(),te(this,Ht,"f").getEnv("_")&&te(this,Ht,"f").getProcessArgvBin()===te(this,Ht,"f").getEnv("_")&&(e=te(this,Ht,"f").getEnv("_").replace(`${te(this,Ht,"f").path.dirname(te(this,Ht,"f").process.execPath())}/`,"")),e}[ae](){return te(this,Gt,"f")}[ce](){return te(this,Jt,"f")}[le](){if(!te(this,St,"f"))return;const t=te(this,Ht,"f").getEnv("LC_ALL")||te(this,Ht,"f").getEnv("LC_MESSAGES")||te(this,Ht,"f").getEnv("LANG")||te(this,Ht,"f").getEnv("LANGUAGE")||"en_US";this.locale(t.replace(/[.:].*/,""))}[he](){return this[de]().version||"unknown"}[ue](t){const e=t["--"]?t["--"]:t._;for(let t,n=0;void 0!==(t=e[n]);n++)te(this,Ht,"f").Parser.looksLikeNumber(t)&&Number.isSafeInteger(Math.floor(parseFloat(`${t}`)))&&(e[n]=Number(t));return t}[de](t){const e=t||"*";if(te(this,Ut,"f")[e])return te(this,Ut,"f")[e];let n={};try{let e=t||te(this,Ht,"f").mainFilename;!t&&te(this,Ht,"f").path.extname(e)&&(e=te(this,Ht,"f").path.dirname(e));const s=te(this,Ht,"f").findUp(e,((t,e)=>e.includes("package.json")?"package.json":void 0));R(s,void 0,te(this,Ht,"f")),n=JSON.parse(te(this,Ht,"f").readFileSync(s,"utf8"))}catch(t){}return te(this,Ut,"f")[e]=n||{},te(this,Ut,"f")[e]}[fe](t,e){(e=[].concat(e)).forEach((e=>{e=this[ye](e),te(this,Lt,"f")[t].push(e)}))}[pe](t,e,n,s){this[ge](t,e,n,s,((t,e,n)=>{te(this,Lt,"f")[t][e]=n}))}[me](t,e,n,s){this[ge](t,e,n,s,((t,e,n)=>{te(this,Lt,"f")[t][e]=(te(this,Lt,"f")[t][e]||[]).concat(n)}))}[ge](t,e,n,s,i){if(Array.isArray(n))n.forEach((e=>{t(e,s)}));else if((t=>"object"==typeof t)(n))for(const e of z(n))t(e,n[e]);else i(e,this[ye](n),s)}[ye](t){return"__proto__"===t?"___proto___":t}[be](t,e){return this[pe](this[be].bind(this),"key",t,e),this}[ve](){var t,e,n,s,i,r,o,a,c,l,h,u;const d=te(this,kt,"f").pop();let f;R(d,void 0,te(this,Ht,"f")),t=this,e=this,n=this,s=this,i=this,r=this,o=this,a=this,c=this,l=this,h=this,u=this,({options:{set value(e){Zt(t,Lt,e,"f")}}.value,configObjects:f,exitProcess:{set value(t){Zt(e,_t,t,"f")}}.value,groups:{set value(t){Zt(n,Pt,t,"f")}}.value,output:{set value(t){Zt(s,Nt,t,"f")}}.value,exitError:{set value(t){Zt(i,jt,t,"f")}}.value,hasOutput:{set value(t){Zt(r,$t,t,"f")}}.value,parsed:this.parsed,strict:{set value(t){Zt(o,qt,t,"f")}}.value,strictCommands:{set value(t){Zt(a,Vt,t,"f")}}.value,strictOptions:{set value(t){Zt(c,Kt,t,"f")}}.value,completionCommand:{set value(t){Zt(l,xt,t,"f")}}.value,parseFn:{set value(t){Zt(h,Dt,t,"f")}}.value,parseContext:{set value(t){Zt(u,Wt,t,"f")}}.value}=d),te(this,Lt,"f").configObjects=f,te(this,Yt,"f").unfreeze(),te(this,Xt,"f").unfreeze(),te(this,bt,"f").unfreeze(),te(this,At,"f").unfreeze()}[we](t,e){return Z(e,(e=>(t(e),e)))}getInternalMethods(){return{getCommandInstance:this[Oe].bind(this),getContext:this[xe].bind(this),getHasOutput:this[Ee].bind(this),getLoggerInstance:this[je].bind(this),getParseContext:this[Se].bind(this),getParserConfiguration:this[ae].bind(this),getUsageConfiguration:this[ce].bind(this),getUsageInstance:this[Ce].bind(this),getValidationInstance:this[_e].bind(this),hasParseCallback:this[ke].bind(this),isGlobalContext:this[Ae].bind(this),postProcess:this[Pe].bind(this),reset:this[Ie].bind(this),runValidation:this[Te].bind(this),runYargsParserAndExecuteCommands:this[Me].bind(this),setHasOutput:this[Ne].bind(this)}}[Oe](){return te(this,bt,"f")}[xe](){return te(this,wt,"f")}[Ee](){return te(this,$t,"f")}[je](){return te(this,Tt,"f")}[Se](){return te(this,Wt,"f")||{}}[Ce](){return te(this,Yt,"f")}[_e](){return te(this,Xt,"f")}[ke](){return!!te(this,Dt,"f")}[Ae](){return te(this,Mt,"f")}[Pe](t,e,n,s){if(n)return t;if(H(t))return t;e||(t=this[ee](t));return(this[ae]()["parse-positional-numbers"]||void 0===this[ae]()["parse-positional-numbers"])&&(t=this[ue](t)),s&&(t=X(t,this,te(this,At,"f").getMiddleware(),!1)),t}[Ie](t={}){Zt(this,Lt,te(this,Lt,"f")||{},"f");const e={};e.local=te(this,Lt,"f").local||[],e.configObjects=te(this,Lt,"f").configObjects||[];const n={};e.local.forEach((e=>{n[e]=!0,(t[e]||[]).forEach((t=>{n[t]=!0}))})),Object.assign(te(this,Rt,"f"),Object.keys(te(this,Pt,"f")).reduce(((t,e)=>{const s=te(this,Pt,"f")[e].filter((t=>!(t in n)));return s.length>0&&(t[e]=s),t}),{})),Zt(this,Pt,{},"f");return["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"].forEach((t=>{e[t]=(te(this,Lt,"f")[t]||[]).filter((t=>!n[t]))})),["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"].forEach((t=>{e[t]=it(te(this,Lt,"f")[t],(t=>!n[t]))})),e.envPrefix=te(this,Lt,"f").envPrefix,Zt(this,Lt,e,"f"),Zt(this,Yt,te(this,Yt,"f")?te(this,Yt,"f").reset(n):at(this,te(this,Ht,"f")),"f"),Zt(this,Xt,te(this,Xt,"f")?te(this,Xt,"f").reset(n):function(t,e,n){const s=n.y18n.__,i=n.y18n.__n,r={nonOptionCount:function(n){const s=t.getDemandedCommands(),r=n._.length+(n["--"]?n["--"].length:0)-t.getInternalMethods().getContext().commands.length;s._&&(r<s._.min||r>s._.max)&&(r<s._.min?void 0!==s._.minMsg?e.fail(s._.minMsg?s._.minMsg.replace(/\$0/g,r.toString()).replace(/\$1/,s._.min.toString()):null):e.fail(i("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",r,r.toString(),s._.min.toString())):r>s._.max&&(void 0!==s._.maxMsg?e.fail(s._.maxMsg?s._.maxMsg.replace(/\$0/g,r.toString()).replace(/\$1/,s._.max.toString()):null):e.fail(i("Too many non-option arguments: got %s, maximum of %s","Too many non-option arguments: got %s, maximum of %s",r,r.toString(),s._.max.toString()))))},positionalCount:function(t,n){n<t&&e.fail(i("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",n,n+"",t+""))},requiredArguments:function(t,n){let s=null;for(const e of Object.keys(n))Object.prototype.hasOwnProperty.call(t,e)&&void 0!==t[e]||(s=s||{},s[e]=n[e]);if(s){const t=[];for(const e of Object.keys(s)){const n=s[e];n&&t.indexOf(n)<0&&t.push(n)}const n=t.length?`\n${t.join("\n")}`:"";e.fail(i("Missing required argument: %s","Missing required arguments: %s",Object.keys(s).length,Object.keys(s).join(", ")+n))}},unknownArguments:function(n,s,o,a,c=!0){var l;const h=t.getInternalMethods().getCommandInstance().getCommands(),u=[],d=t.getInternalMethods().getContext();if(Object.keys(n).forEach((e=>{ft.includes(e)||Object.prototype.hasOwnProperty.call(o,e)||Object.prototype.hasOwnProperty.call(t.getInternalMethods().getParseContext(),e)||r.isValidAndSomeAliasIsNotNew(e,s)||u.push(e)})),c&&(d.commands.length>0||h.length>0||a)&&n._.slice(d.commands.length).forEach((t=>{h.includes(""+t)||u.push(""+t)})),c){const e=(null===(l=t.getDemandedCommands()._)||void 0===l?void 0:l.max)||0,s=d.commands.length+e;s<n._.length&&n._.slice(s).forEach((t=>{t=String(t),d.commands.includes(t)||u.includes(t)||u.push(t)}))}u.length&&e.fail(i("Unknown argument: %s","Unknown arguments: %s",u.length,u.map((t=>t.trim()?t:`"${t}"`)).join(", ")))},unknownCommands:function(n){const s=t.getInternalMethods().getCommandInstance().getCommands(),r=[],o=t.getInternalMethods().getContext();return(o.commands.length>0||s.length>0)&&n._.slice(o.commands.length).forEach((t=>{s.includes(""+t)||r.push(""+t)})),r.length>0&&(e.fail(i("Unknown command: %s","Unknown commands: %s",r.length,r.join(", "))),!0)},isValidAndSomeAliasIsNotNew:function(e,n){if(!Object.prototype.hasOwnProperty.call(n,e))return!1;const s=t.parsed.newAliases;return[e,...n[e]].some((t=>!Object.prototype.hasOwnProperty.call(s,t)||!s[e]))},limitedChoices:function(n){const i=t.getOptions(),r={};if(!Object.keys(i.choices).length)return;Object.keys(n).forEach((t=>{-1===ft.indexOf(t)&&Object.prototype.hasOwnProperty.call(i.choices,t)&&[].concat(n[t]).forEach((e=>{-1===i.choices[t].indexOf(e)&&void 0!==e&&(r[t]=(r[t]||[]).concat(e))}))}));const o=Object.keys(r);if(!o.length)return;let a=s("Invalid values:");o.forEach((t=>{a+=`\n ${s("Argument: %s, Given: %s, Choices: %s",t,e.stringifiedValues(r[t]),e.stringifiedValues(i.choices[t]))}`})),e.fail(a)}};let o={};function a(t,e){const n=Number(e);return"number"==typeof(e=isNaN(n)?e:n)?e=t._.length>=e:e.match(/^--no-.+/)?(e=e.match(/^--no-(.+)/)[1],e=!Object.prototype.hasOwnProperty.call(t,e)):e=Object.prototype.hasOwnProperty.call(t,e),e}r.implies=function(e,s){K("<string|object> [array|number|string]",[e,s],arguments.length),"object"==typeof e?Object.keys(e).forEach((t=>{r.implies(t,e[t])})):(t.global(e),o[e]||(o[e]=[]),Array.isArray(s)?s.forEach((t=>r.implies(e,t))):(R(s,void 0,n),o[e].push(s)))},r.getImplied=function(){return o},r.implications=function(t){const n=[];if(Object.keys(o).forEach((e=>{const s=e;(o[e]||[]).forEach((e=>{let i=s;const r=e;i=a(t,i),e=a(t,e),i&&!e&&n.push(` ${s} -> ${r}`)}))})),n.length){let t=`${s("Implications failed:")}\n`;n.forEach((e=>{t+=e})),e.fail(t)}};let c={};r.conflicts=function(e,n){K("<string|object> [array|string]",[e,n],arguments.length),"object"==typeof e?Object.keys(e).forEach((t=>{r.conflicts(t,e[t])})):(t.global(e),c[e]||(c[e]=[]),Array.isArray(n)?n.forEach((t=>r.conflicts(e,t))):c[e].push(n))},r.getConflicting=()=>c,r.conflicting=function(i){Object.keys(i).forEach((t=>{c[t]&&c[t].forEach((n=>{n&&void 0!==i[t]&&void 0!==i[n]&&e.fail(s("Arguments %s and %s are mutually exclusive",t,n))}))})),t.getInternalMethods().getParserConfiguration()["strip-dashed"]&&Object.keys(c).forEach((t=>{c[t].forEach((r=>{r&&void 0!==i[n.Parser.camelCase(t)]&&void 0!==i[n.Parser.camelCase(r)]&&e.fail(s("Arguments %s and %s are mutually exclusive",t,r))}))}))},r.recommendCommands=function(t,n){n=n.sort(((t,e)=>e.length-t.length));let i=null,r=1/0;for(let e,s=0;void 0!==(e=n[s]);s++){const n=dt(t,e);n<=3&&n<r&&(r=n,i=e)}i&&e.fail(s("Did you mean %s?",i))},r.reset=function(t){return o=it(o,(e=>!t[e])),c=it(c,(e=>!t[e])),r};const l=[];return r.freeze=function(){l.push({implied:o,conflicting:c})},r.unfreeze=function(){const t=l.pop();R(t,void 0,n),({implied:o,conflicting:c}=t)},r}(this,te(this,Yt,"f"),te(this,Ht,"f")),"f"),Zt(this,bt,te(this,bt,"f")?te(this,bt,"f").reset():function(t,e,n,s){return new et(t,e,n,s)}(te(this,Yt,"f"),te(this,Xt,"f"),te(this,At,"f"),te(this,Ht,"f")),"f"),te(this,Ot,"f")||Zt(this,Ot,function(t,e,n,s){return new ut(t,e,n,s)}(this,te(this,Yt,"f"),te(this,bt,"f"),te(this,Ht,"f")),"f"),te(this,At,"f").reset(),Zt(this,xt,null,"f"),Zt(this,Nt,"","f"),Zt(this,jt,null,"f"),Zt(this,$t,!1,"f"),this.parsed=!1,this}[$e](t,e){return te(this,Ht,"f").path.relative(t,e)}[Me](t,e,n,s=0,i=!1){let r=!!n||i;t=t||te(this,Bt,"f"),te(this,Lt,"f").__=te(this,Ht,"f").y18n.__,te(this,Lt,"f").configuration=this[ae]();const o=!!te(this,Lt,"f").configuration["populate--"],a=Object.assign({},te(this,Lt,"f").configuration,{"populate--":!0}),c=te(this,Ht,"f").Parser.detailed(t,Object.assign({},te(this,Lt,"f"),{configuration:{"parse-positional-numbers":!1,...a}})),l=Object.assign(c.argv,te(this,Wt,"f"));let h;const u=c.aliases;let d=!1,f=!1;Object.keys(l).forEach((t=>{t===te(this,It,"f")&&l[t]?d=!0:t===te(this,Qt,"f")&&l[t]&&(f=!0)})),l.$0=this.$0,this.parsed=c,0===s&&te(this,Yt,"f").clearCachedHelpMessage();try{if(this[le](),e)return this[Pe](l,o,!!n,!1);if(te(this,It,"f")){[te(this,It,"f")].concat(u[te(this,It,"f")]||[]).filter((t=>t.length>1)).includes(""+l._[l._.length-1])&&(l._.pop(),d=!0)}Zt(this,Mt,!1,"f");const a=te(this,bt,"f").getCommands(),p=te(this,Ot,"f").completionKey in l,m=d||p||i;if(l._.length){if(a.length){let t;for(let e,r=s||0;void 0!==l._[r];r++){if(e=String(l._[r]),a.includes(e)&&e!==te(this,xt,"f")){const t=te(this,bt,"f").runCommand(e,this,c,r+1,i,d||f||i);return this[Pe](t,o,!!n,!1)}if(!t&&e!==te(this,xt,"f")){t=e;break}}!te(this,bt,"f").hasDefaultCommand()&&te(this,zt,"f")&&t&&!m&&te(this,Xt,"f").recommendCommands(t,a)}te(this,xt,"f")&&l._.includes(te(this,xt,"f"))&&!p&&(te(this,_t,"f")&&rt(!0),this.showCompletionScript(),this.exit(0))}if(te(this,bt,"f").hasDefaultCommand()&&!m){const t=te(this,bt,"f").runCommand(null,this,c,0,i,d||f||i);return this[Pe](t,o,!!n,!1)}if(p){te(this,_t,"f")&&rt(!0);const e=(t=[].concat(t)).slice(t.indexOf(`--${te(this,Ot,"f").completionKey}`)+1);return te(this,Ot,"f").getCompletion(e,((t,e)=>{if(t)throw new M(t.message);(e||[]).forEach((t=>{te(this,Tt,"f").log(t)})),this.exit(0)})),this[Pe](l,!o,!!n,!1)}if(te(this,$t,"f")||(d?(te(this,_t,"f")&&rt(!0),r=!0,this.showHelp("log"),this.exit(0)):f&&(te(this,_t,"f")&&rt(!0),r=!0,te(this,Yt,"f").showVersion("log"),this.exit(0))),!r&&te(this,Lt,"f").skipValidation.length>0&&(r=Object.keys(l).some((t=>te(this,Lt,"f").skipValidation.indexOf(t)>=0&&!0===l[t]))),!r){if(c.error)throw new M(c.error.message);if(!p){const t=this[Te](u,{},c.error);n||(h=X(l,this,te(this,At,"f").getMiddleware(),!0)),h=this[we](t,null!=h?h:l),H(h)&&!n&&(h=h.then((()=>X(l,this,te(this,At,"f").getMiddleware(),!1))))}}}catch(t){if(!(t instanceof M))throw t;te(this,Yt,"f").fail(t.message,t)}return this[Pe](null!=h?h:l,o,!!n,!0)}[Te](t,e,n,s){const i={...this.getDemandedOptions()};return r=>{if(n)throw new M(n.message);te(this,Xt,"f").nonOptionCount(r),te(this,Xt,"f").requiredArguments(r,i);let o=!1;te(this,Vt,"f")&&(o=te(this,Xt,"f").unknownCommands(r)),te(this,qt,"f")&&!o?te(this,Xt,"f").unknownArguments(r,t,e,!!s):te(this,Kt,"f")&&te(this,Xt,"f").unknownArguments(r,t,{},!1,!1),te(this,Xt,"f").limitedChoices(r),te(this,Xt,"f").implications(r),te(this,Xt,"f").conflicting(r)}}[Ne](){Zt(this,$t,!0,"f")}[Le](t){if("string"==typeof t)te(this,Lt,"f").key[t]=!0;else for(const e of t)te(this,Lt,"f").key[e]=!0}}const Ge=(De=U,(t=[],e=De.process.cwd(),n)=>{const s=new Fe(t,e,n,De);return Object.defineProperty(s,"argv",{get:()=>s.parse(),enumerable:!0}),s.help(),s.version(),s});var De;const We=Ge;function Ue(t,e){const n=t.startsWith(".")?(0,f.join)(e,t):t;return import(n)}function Re(t,e){const{homepage:n,site:s=n,repository:i}=e,r=s&&s!==i,o=t.getInternalMethods(),a=(c=o.getCommandInstance().handlers,Object.keys(c).some((t=>t&&"$0"!==t)));var c;return 0===o.getUsageInstance().getUsage().length&&(a?t.usage("Usage: $0 <command>"):t.usage("Usage: $0")),a&&t.demandCommand(1,"Won't work without a command"),r&&t.epilogue(`Website: ${s}`),i&&t.epilogue(`Repository: ${i}`),t}var Be=a(21192);const ze="git",He="",qe=process.cwd();function Ve(){try{return function(){try{return Boolean((0,Be.PS)("git",["--version"],{cwd:qe}).stdout)}catch{throw new Error("git is not installed")}}()&&function(){try{return"true"===(0,Be.PS)("git",["rev-parse","--is-inside-work-tree"],{cwd:qe}).stdout}catch{throw new Error("not a git repository")}}()}catch(t){return console.error("Fail:",t.message),!1}}function Ke(t){t.command("hooks","Set .githooks as git.hooksPath",{},(()=>{Ve()&&(0,Be.r)("git",["config","core.hooksPath",".githooks"],{cwd:qe}).then((()=>{console.log("Done: set .githooks")})).catch((()=>{console.error("Fail:","setting hooks failed"),process.exitCode=1}))})),t.demandCommand(1,"Typing `hooks`")}const Ye=t(import.meta.url)("node:module"),Je=t(import.meta.url)("module"),Qe=process.cwd();const Xe=(0,Je.createRequire)(import.meta.url);function Ze(t,e=Qe){return t.startsWith(".")?(0,f.resolve)(e,t):(0,f.isAbsolute)(t)?t:Xe.resolve(t)}function tn(t){try{return(0,s.statSync)(Ze(t)),!0}catch{return!1}}function en(t,e={}){const n=function(t){try{const e=(0,s.readFileSync)(Ze(t),"utf8");return JSON.parse(e)}catch{return{}}}("./package.json");if(t){const{[t]:s=e}=n;return s}return n}var nn=a(93977),sn=a(49411);const rn={"body-leading-blank":[1,"always"],"body-max-line-length":[2,"always",100],"footer-leading-blank":[1,"always"],"footer-max-line-length":[2,"always",100],"header-max-length":[2,"always",100],"subject-case":[0],"subject-empty":[2,"never"],"subject-full-stop":[2,"never","."],"type-case":[2,"always","lower-case"],"type-empty":[2,"never"],"type-enum":[2,"always",["build","chore","ci","docs","feat","fix","perf","refactor","revert","style","test"]],"scope-case":[0],"body-case":[0],"header-case":[0]};function on(){return(0,nn.readFile)((0,sn.resolve)(process.cwd(),".git/COMMIT_EDITMSG"),"utf8")}function an(t){t.command("commit","Lint git commit message",{},(()=>{(async function(){const t=await on(),e=await Promise.all([a.e(402),a.e(600)]).then(a.t.bind(a,69402,19)).then((t=>t.default.default||t.default)),n=await a.e(600).then(a.t.bind(a,93794,19)).then((t=>t.default.default||t.default)),s=await e(t,rn);return{result:s,output:await n({results:[s]})}})().then((({result:t,output:e})=>{t.valid?console.log("Pass."):(console.log("Fail:"),console.log(e),process.exitCode=1)})).catch((t=>{console.error(t),process.exitCode=1}))}))}function cn({garou:t,stylelint:e,eslint:n,prettier:s}){const i=process.stdin.isTTY?" --color":"";return function(t){const e=Object.entries(t).map((([t,e])=>[t,e.filter(Boolean)])).filter((([t,e])=>e.length));return e.length>0?Object.fromEntries(e):void 0}({"*.{vue,html,htm,md}":[t&&"garou",s&&`prettier -w -u${i}`,e&&`stylelint --fix --custom-formatter=node_modules/stylelint-formatter-pretty${i}`,n&&`eslint --fix -f=pretty${i}`],"*.{ts,tsx,mts,cts}":[t&&"garou",s&&`prettier -w -u${i}`,n&&`eslint --fix -f=pretty${i}`],"*.{js,jsx,mjs,cjs,wxs,qs}":[t&&"garou",s&&`prettier -w -u${i}`,n&&`eslint --fix -f=pretty${i}`],"*.{c,sc,le,wx,q,tt,jx,ac}ss":[t&&"garou",s&&`prettier -w -u${i}`,e&&`stylelint --fix --custom-formatter=node_modules/stylelint-formatter-pretty${i}`],"*.{json,yml,yaml,svg}":[t&&"garou",s&&`prettier -w -u${i}`],"{*.{jsonc,webmanifest,editorconfig,toml},.{babel,npm}rc}":[s&&`prettier -w -u${i}`],"{*.jenkinsfile,{j,J}enkinsfile}":[s&&`prettier -w -u${i}`],"yarn.lock":[t&&"garou"]})}async function ln(){const{default:t}=await Promise.all([a.e(130),a.e(600)]).then(a.bind(a,48130));return t({allowEmpty:!0,concurrent:!0,config:cn(function(){const t=en("devDependencies");return{garou:"garou"in t,stylelint:"stylelint"in t,eslint:"eslint"in t,prettier:"prettier"in t}}()),cwd:process.cwd(),debug:!1,quiet:!1,relative:!1,shell:!1,stash:!0})}const hn="lint";function un(t){an(t),function(t){t.command("staged","Lint and format git staged files",{},(()=>{ln().then((t=>{process.exitCode=t?0:1})).catch((t=>{console.error(t),process.exitCode=1}))}))}(t),t.demandCommand(1,"Typing `commit` or `staged`")}process.on("SIGINT",(()=>{})),new class{constructor(t,e){this.root=e;const{bin:n,homepage:i,name:r="cheetor",repository:{url:o=""}={},version:a}="string"==typeof t?JSON.parse((0,s.readFileSync)(new URL(t,e))):t;this.homepage=i,this.repository=o.includes("github.com")?o.replace(/\.git$/,""):"";const c=We(process.argv.slice(2)).strict().alias("help","h").alias("version","v").hide("help").version(a).hide("version").detectLocale(!1),l=function(t,e){if("string"==typeof t||!t)return e;const n=Object.keys(t);return 1===n.length&&n[0]}(n,r);l&&c.scriptName(l),this.cli=Promise.resolve(c)}config(t){return this.cli=this.cli.then(t),this}command(...t){return this.cli=this.cli.then((e=>e.command(...t))),this}commandFrom(t){return this.cli=this.cli.then((async e=>{const n=await Ue(t,this.root);return e.command(n)})),this}commandSafe(t){return this.cli=this.cli.then((e=>function(t,e){return Ue(t,e).catch((t=>{if("ERR_MODULE_NOT_FOUND"===t.code&&t.message.endsWith(` imported from ${(0,m.fileURLToPath)(import.meta.url)}`))return!1;throw t}))}(t,this.root).then((t=>t&&t.command?e.command(t):e)))),this}commandSmart(t){return this.cli=this.cli.then((async e=>{const n=t();return n&&n.command?e.command(n):e})),this}website(t){return this.site=t,this}middleware(...t){return this.cli=this.cli.then((e=>e.middleware(...t))),this}setup(t){return this.cli.then((t=>Re(t,this))).then((e=>"function"==typeof t?t(e.parse()):e.parse()))}}("../package.json",import.meta.url).website("https://www.npmjs.com/org/nice-move").command(n).command(e).commandSmart((function(){if(tn("svgo/package.json")&&tn("svgo-config/package.json"))return{command:"svgo",describe:"Run `svgo` to optimize `*.svg`",handler({_:[t,e="./"]}){const n=(0,Ye.createRequire)(import.meta.url);(0,Be.r)("svgo",["-r","-q","--pretty","--indent","2","--config",n.resolve("svgo-config"),"-f",e]).then((()=>{console.log("Done: calling svgo")})).catch((t=>{process.exitCode=1,console.error("Error:",t.message)}))}}})).setup()})();