UNPKG

lemon-front

Version:

快速搭建前端项目的脚手架工具,基于vite+vue3+TypeScript+Element-plus

2 lines 621 kB
#!/usr/bin/env node "use strict";var e=require("node:events"),n=require("node:child_process"),t=require("node:path"),i=require("node:fs"),r=require("node:process"),o=require("node:constants"),a=require("node:stream"),s=require("node:util"),u=require("node:assert"),c=require("node:buffer"),l=require("node:tty"),p=require("node:os"),d=require("node:crypto"),f=require("node:http"),m=require("node:https"),h=require("node:url"),_=require("node:zlib"),D=require("node:readline"),g=require("node:async_hooks");function v(e){var n=Object.create(null);return e&&Object.keys(e).forEach(function(t){if("default"!==t){var i=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,i.get?i:{enumerable:!0,get:function(){return e[t]}})}}),n.default=e,Object.freeze(n)}var x=v(D);function b(e,n,t,i){return new(t||(t=Promise))(function(r,o){function a(e){try{u(i.next(e))}catch(e){o(e)}}function s(e){try{u(i.throw(e))}catch(e){o(e)}}function u(e){var n;e.done?r(e.value):(n=e.value,n instanceof t?n:new t(function(e){e(n)})).then(a,s)}u((i=i.apply(e,n||[])).next())})}"function"==typeof SuppressedError&&SuppressedError;var y="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function E(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var w,F,C={},T={},A={};function L(){if(w)return A;w=1;class e extends Error{constructor(e,n,t){super(t),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=n,this.exitCode=e,this.nestedError=void 0}}return A.CommanderError=e,A.InvalidArgumentError=class extends e{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}},A}function k(){if(F)return T;F=1;const{InvalidArgumentError:e}=L();return T.Argument=class{constructor(e,n){switch(this.description=n||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e}this._name.length>3&&"..."===this._name.slice(-3)&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(e,n){return n!==this.defaultValue&&Array.isArray(n)?n.concat(e):[e]}default(e,n){return this.defaultValue=e,this.defaultValueDescription=n,this}argParser(e){return this.parseArg=e,this}choices(n){return this.argChoices=n.slice(),this.parseArg=(n,t)=>{if(!this.argChoices.includes(n))throw new e(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(n,t):n},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}},T.humanReadableArgName=function(e){const n=e.name()+(!0===e.variadic?"...":"");return e.required?"<"+n+">":"["+n+"]"},T}var S,R={},O={};function B(){if(S)return O;S=1;const{humanReadableArgName:e}=k();function n(e){return e.replace(/\x1b\[\d*(;\d*)*m/g,"")}return O.Help=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80}visibleCommands(e){const n=e.commands.filter(e=>!e._hidden),t=e._getHelpCommand();return t&&!t._hidden&&n.push(t),this.sortSubcommands&&n.sort((e,n)=>e.name().localeCompare(n.name())),n}compareOptions(e,n){const t=e=>e.short?e.short.replace(/^-/,""):e.long.replace(/^--/,"");return t(e).localeCompare(t(n))}visibleOptions(e){const n=e.options.filter(e=>!e.hidden),t=e._getHelpOption();if(t&&!t.hidden){const i=t.short&&e._findOption(t.short),r=t.long&&e._findOption(t.long);i||r?t.long&&!r?n.push(e.createOption(t.long,t.description)):t.short&&!i&&n.push(e.createOption(t.short,t.description)):n.push(t)}return this.sortOptions&&n.sort(this.compareOptions),n}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];const n=[];for(let t=e.parent;t;t=t.parent){const e=t.options.filter(e=>!e.hidden);n.push(...e)}return this.sortOptions&&n.sort(this.compareOptions),n}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(n=>{n.description=n.description||e._argsDescription[n.name()]||""}),e.registeredArguments.find(e=>e.description)?e.registeredArguments:[]}subcommandTerm(n){const t=n.registeredArguments.map(n=>e(n)).join(" ");return n._name+(n._aliases[0]?"|"+n._aliases[0]:"")+(n.options.length?" [options]":"")+(t?" "+t:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,n){return n.visibleCommands(e).reduce((e,t)=>Math.max(e,this.displayWidth(n.styleSubcommandTerm(n.subcommandTerm(t)))),0)}longestOptionTermLength(e,n){return n.visibleOptions(e).reduce((e,t)=>Math.max(e,this.displayWidth(n.styleOptionTerm(n.optionTerm(t)))),0)}longestGlobalOptionTermLength(e,n){return n.visibleGlobalOptions(e).reduce((e,t)=>Math.max(e,this.displayWidth(n.styleOptionTerm(n.optionTerm(t)))),0)}longestArgumentTermLength(e,n){return n.visibleArguments(e).reduce((e,t)=>Math.max(e,this.displayWidth(n.styleArgumentTerm(n.argumentTerm(t)))),0)}commandUsage(e){let n=e._name;e._aliases[0]&&(n=n+"|"+e._aliases[0]);let t="";for(let n=e.parent;n;n=n.parent)t=n.name()+" "+t;return t+n+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){const n=[];if(e.argChoices&&n.push(`choices: ${e.argChoices.map(e=>JSON.stringify(e)).join(", ")}`),void 0!==e.defaultValue){(e.required||e.optional||e.isBoolean()&&"boolean"==typeof e.defaultValue)&&n.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`)}if(void 0!==e.presetArg&&e.optional&&n.push(`preset: ${JSON.stringify(e.presetArg)}`),void 0!==e.envVar&&n.push(`env: ${e.envVar}`),n.length>0){const t=`(${n.join(", ")})`;return e.description?`${e.description} ${t}`:t}return e.description}argumentDescription(e){const n=[];if(e.argChoices&&n.push(`choices: ${e.argChoices.map(e=>JSON.stringify(e)).join(", ")}`),void 0!==e.defaultValue&&n.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),n.length>0){const t=`(${n.join(", ")})`;return e.description?`${e.description} ${t}`:t}return e.description}formatItemList(e,n,t){return 0===n.length?[]:[t.styleTitle(e),...n,""]}groupItems(e,n,t){const i=new Map;return e.forEach(e=>{const n=t(e);i.has(n)||i.set(n,[])}),n.forEach(e=>{const n=t(e);i.has(n)||i.set(n,[]),i.get(n).push(e)}),i}formatHelp(e,n){const t=n.padWidth(e,n),i=n.helpWidth??80;function r(e,i){return n.formatItem(e,t,i,n)}let o=[`${n.styleTitle("Usage:")} ${n.styleUsage(n.commandUsage(e))}`,""];const a=n.commandDescription(e);a.length>0&&(o=o.concat([n.boxWrap(n.styleCommandDescription(a),i),""]));const s=n.visibleArguments(e).map(e=>r(n.styleArgumentTerm(n.argumentTerm(e)),n.styleArgumentDescription(n.argumentDescription(e))));o=o.concat(this.formatItemList("Arguments:",s,n));const u=this.groupItems(e.options,n.visibleOptions(e),e=>e.helpGroupHeading??"Options:");if(u.forEach((e,t)=>{const i=e.map(e=>r(n.styleOptionTerm(n.optionTerm(e)),n.styleOptionDescription(n.optionDescription(e))));o=o.concat(this.formatItemList(t,i,n))}),n.showGlobalOptions){const t=n.visibleGlobalOptions(e).map(e=>r(n.styleOptionTerm(n.optionTerm(e)),n.styleOptionDescription(n.optionDescription(e))));o=o.concat(this.formatItemList("Global Options:",t,n))}return this.groupItems(e.commands,n.visibleCommands(e),e=>e.helpGroup()||"Commands:").forEach((e,t)=>{const i=e.map(e=>r(n.styleSubcommandTerm(n.subcommandTerm(e)),n.styleSubcommandDescription(n.subcommandDescription(e))));o=o.concat(this.formatItemList(t,i,n))}),o.join("\n")}displayWidth(e){return n(e).length}styleTitle(e){return e}styleUsage(e){return e.split(" ").map(e=>"[options]"===e?this.styleOptionText(e):"[command]"===e?this.styleSubcommandText(e):"["===e[0]||"<"===e[0]?this.styleArgumentText(e):this.styleCommandText(e)).join(" ")}styleCommandDescription(e){return this.styleDescriptionText(e)}styleOptionDescription(e){return this.styleDescriptionText(e)}styleSubcommandDescription(e){return this.styleDescriptionText(e)}styleArgumentDescription(e){return this.styleDescriptionText(e)}styleDescriptionText(e){return e}styleOptionTerm(e){return this.styleOptionText(e)}styleSubcommandTerm(e){return e.split(" ").map(e=>"[options]"===e?this.styleOptionText(e):"["===e[0]||"<"===e[0]?this.styleArgumentText(e):this.styleSubcommandText(e)).join(" ")}styleArgumentTerm(e){return this.styleArgumentText(e)}styleOptionText(e){return e}styleArgumentText(e){return e}styleSubcommandText(e){return e}styleCommandText(e){return e}padWidth(e,n){return Math.max(n.longestOptionTermLength(e,n),n.longestGlobalOptionTermLength(e,n),n.longestSubcommandTermLength(e,n),n.longestArgumentTermLength(e,n))}preformatted(e){return/\n[^\S\r\n]/.test(e)}formatItem(e,n,t,i){const r=" ".repeat(2);if(!t)return r+e;const o=e.padEnd(n+e.length-i.displayWidth(e)),a=(this.helpWidth??80)-n-2-2;let s;if(a<this.minWidthToWrap||i.preformatted(t))s=t;else{s=i.boxWrap(t,a).replace(/\n/g,"\n"+" ".repeat(n+2))}return r+o+" ".repeat(2)+s.replace(/\n/g,`\n${r}`)}boxWrap(e,n){if(n<this.minWidthToWrap)return e;const t=e.split(/\r\n|\n/),i=/[\s]*[^\s]+/g,r=[];return t.forEach(e=>{const t=e.match(i);if(null===t)return void r.push("");let o=[t.shift()],a=this.displayWidth(o[0]);t.forEach(e=>{const t=this.displayWidth(e);if(a+t<=n)return o.push(e),void(a+=t);r.push(o.join(""));const i=e.trimStart();o=[i],a=this.displayWidth(i)}),r.push(o.join(""))}),r.join("\n")}},O.stripColor=n,O}var I,j={};function N(){if(I)return j;I=1;const{InvalidArgumentError:e}=L();function n(e){return e.split("-").reduce((e,n)=>e+n[0].toUpperCase()+n.slice(1))}return j.Option=class{constructor(e,n){this.flags=e,this.description=n||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;const t=function(e){let n,t;const i=/^-[^-]$/,r=/^--[^-]/,o=e.split(/[ |,]+/).concat("guard");i.test(o[0])&&(n=o.shift());r.test(o[0])&&(t=o.shift());!n&&i.test(o[0])&&(n=o.shift());!n&&r.test(o[0])&&(n=t,t=o.shift());if(o[0].startsWith("-")){const n=o[0],t=`option creation failed due to '${n}' in option flags '${e}'`;if(/^-[^-][^-]/.test(n))throw new Error(`${t}\n- a short flag is a single dash and a single character\n - either use a single dash and a single character (for a short flag)\n - or use a double dash for a long option (and can have two, like '--ws, --workspace')`);if(i.test(n))throw new Error(`${t}\n- too many short flags`);if(r.test(n))throw new Error(`${t}\n- too many long flags`);throw new Error(`${t}\n- unrecognised flag format`)}if(void 0===n&&void 0===t)throw new Error(`option creation failed due to no flags found in '${e}'.`);return{shortFlag:n,longFlag:t}}(e);this.short=t.shortFlag,this.long=t.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(e,n){return this.defaultValue=e,this.defaultValueDescription=n,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let n=e;return"string"==typeof e&&(n={[e]:!0}),this.implied=Object.assign(this.implied||{},n),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_concatValue(e,n){return n!==this.defaultValue&&Array.isArray(n)?n.concat(e):[e]}choices(n){return this.argChoices=n.slice(),this.parseArg=(n,t)=>{if(!this.argChoices.includes(n))throw new e(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(n,t):n},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?n(this.name().replace(/^no-/,"")):n(this.name())}helpGroup(e){return this.helpGroupHeading=e,this}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},j.DualOptions=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(e=>{e.negate?this.negativeOptions.set(e.attributeName(),e):this.positiveOptions.set(e.attributeName(),e)}),this.negativeOptions.forEach((e,n)=>{this.positiveOptions.has(n)&&this.dualOptions.add(n)})}valueFromOption(e,n){const t=n.attributeName();if(!this.dualOptions.has(t))return!0;const i=this.negativeOptions.get(t).presetArg,r=void 0!==i&&i;return n.negate===(r===e)}},j}var P,M,U,$={};function H(){if(P)return $;P=1;return $.suggestSimilar=function(e,n){if(!n||0===n.length)return"";n=Array.from(new Set(n));const t=e.startsWith("--");t&&(e=e.slice(2),n=n.map(e=>e.slice(2)));let i=[],r=3;return n.forEach(n=>{if(n.length<=1)return;const t=function(e,n){if(Math.abs(e.length-n.length)>3)return Math.max(e.length,n.length);const t=[];for(let n=0;n<=e.length;n++)t[n]=[n];for(let e=0;e<=n.length;e++)t[0][e]=e;for(let i=1;i<=n.length;i++)for(let r=1;r<=e.length;r++){let o=1;o=e[r-1]===n[i-1]?0:1,t[r][i]=Math.min(t[r-1][i]+1,t[r][i-1]+1,t[r-1][i-1]+o),r>1&&i>1&&e[r-1]===n[i-2]&&e[r-2]===n[i-1]&&(t[r][i]=Math.min(t[r][i],t[r-2][i-2]+1))}return t[e.length][n.length]}(e,n),o=Math.max(e.length,n.length);(o-t)/o>.4&&(t<r?(r=t,i=[n]):t===r&&i.push(n))}),i.sort((e,n)=>e.localeCompare(n)),t&&(i=i.map(e=>`--${e}`)),i.length>1?`\n(Did you mean one of ${i.join(", ")}?)`:1===i.length?`\n(Did you mean ${i[0]}?)`:""},$}var W=function(){if(U)return C;U=1;const{Argument:o}=k(),{Command:a}=function(){if(M)return R;M=1;const o=e.EventEmitter,a=n,s=t,u=i,c=r,{Argument:l,humanReadableArgName:p}=k(),{CommanderError:d}=L(),{Help:f,stripColor:m}=B(),{Option:h,DualOptions:_}=N(),{suggestSimilar:D}=H();class g extends o{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:e=>c.stdout.write(e),writeErr:e=>c.stderr.write(e),outputError:(e,n)=>n(e),getOutHelpWidth:()=>c.stdout.isTTY?c.stdout.columns:void 0,getErrHelpWidth:()=>c.stderr.isTTY?c.stderr.columns:void 0,getOutHasColors:()=>x()??(c.stdout.isTTY&&c.stdout.hasColors?.()),getErrHasColors:()=>x()??(c.stderr.isTTY&&c.stderr.hasColors?.()),stripColor:e=>m(e)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){const e=[];for(let n=this;n;n=n.parent)e.push(n);return e}command(e,n,t){let i=n,r=t;"object"==typeof i&&null!==i&&(r=i,i=null),r=r||{};const[,o,a]=e.match(/([^ ]+) *(.*)/),s=this.createCommand(o);return i&&(s.description(i),s._executableHandler=!0),r.isDefault&&(this._defaultCommandName=s._name),s._hidden=!(!r.noHelp&&!r.hidden),s._executableFile=r.executableFile||null,a&&s.arguments(a),this._registerCommand(s),s.parent=this,s.copyInheritedSettings(this),i?this:s}createCommand(e){return new g(e)}createHelp(){return Object.assign(new f,this.configureHelp())}configureHelp(e){return void 0===e?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return void 0===e?this._outputConfiguration:(this._outputConfiguration=Object.assign({},this._outputConfiguration,e),this)}showHelpAfterError(e=!0){return"string"!=typeof e&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,n){if(!e._name)throw new Error("Command passed to .addCommand() must have a name\n- specify the name in Command constructor or using .name()");return(n=n||{}).isDefault&&(this._defaultCommandName=e._name),(n.noHelp||n.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,n){return new l(e,n)}argument(e,n,t,i){const r=this.createArgument(e,n);return"function"==typeof t?r.default(i).argParser(t):r.default(t),this.addArgument(r),this}arguments(e){return e.trim().split(/ +/).forEach(e=>{this.argument(e)}),this}addArgument(e){const n=this.registeredArguments.slice(-1)[0];if(n&&n.variadic)throw new Error(`only the last argument can be variadic '${n.name()}'`);if(e.required&&void 0!==e.defaultValue&&void 0===e.parseArg)throw new Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}helpCommand(e,n){if("boolean"==typeof e)return this._addImplicitHelpCommand=e,e&&this._defaultCommandGroup&&this._initCommandGroup(this._getHelpCommand()),this;const t=e??"help [command]",[,i,r]=t.match(/([^ ]+) *(.*)/),o=n??"display help for command",a=this.createCommand(i);return a.helpOption(!1),r&&a.arguments(r),o&&a.description(o),this._addImplicitHelpCommand=!0,this._helpCommand=a,(e||n)&&this._initCommandGroup(a),this}addHelpCommand(e,n){return"object"!=typeof e?(this.helpCommand(e,n),this):(this._addImplicitHelpCommand=!0,this._helpCommand=e,this._initCommandGroup(e),this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(void 0===this._helpCommand&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(e,n){const t=["preSubcommand","preAction","postAction"];if(!t.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'.\nExpecting one of '${t.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(n):this._lifeCycleHooks[e]=[n],this}exitOverride(e){return this._exitCallback=e||(e=>{if("commander.executeSubCommandAsync"!==e.code)throw e}),this}_exit(e,n,t){this._exitCallback&&this._exitCallback(new d(e,n,t)),c.exit(e)}action(e){return this._actionHandler=n=>{const t=this.registeredArguments.length,i=n.slice(0,t);return this._storeOptionsAsProperties?i[t]=this:i[t]=this.opts(),i.push(this),e.apply(this,i)},this}createOption(e,n){return new h(e,n)}_callParseArg(e,n,t,i){try{return e.parseArg(n,t)}catch(e){if("commander.invalidArgument"===e.code){const n=`${i} ${e.message}`;this.error(n,{exitCode:e.exitCode,code:e.code})}throw e}}_registerOption(e){const n=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(n){const t=e.long&&this._findOption(e.long)?e.long:e.short;throw new Error(`Cannot add option '${e.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${t}'\n- already used by option '${n.flags}'`)}this._initOptionGroup(e),this.options.push(e)}_registerCommand(e){const n=e=>[e.name()].concat(e.aliases()),t=n(e).find(e=>this._findCommand(e));if(t){const i=n(this._findCommand(t)).join("|"),r=n(e).join("|");throw new Error(`cannot add command '${r}' as already have command '${i}'`)}this._initCommandGroup(e),this.commands.push(e)}addOption(e){this._registerOption(e);const n=e.name(),t=e.attributeName();if(e.negate){const n=e.long.replace(/^--no-/,"--");this._findOption(n)||this.setOptionValueWithSource(t,void 0===e.defaultValue||e.defaultValue,"default")}else void 0!==e.defaultValue&&this.setOptionValueWithSource(t,e.defaultValue,"default");const i=(n,i,r)=>{null==n&&void 0!==e.presetArg&&(n=e.presetArg);const o=this.getOptionValue(t);null!==n&&e.parseArg?n=this._callParseArg(e,n,o,i):null!==n&&e.variadic&&(n=e._concatValue(n,o)),null==n&&(n=!e.negate&&(!(!e.isBoolean()&&!e.optional)||"")),this.setOptionValueWithSource(t,n,r)};return this.on("option:"+n,n=>{const t=`error: option '${e.flags}' argument '${n}' is invalid.`;i(n,t,"cli")}),e.envVar&&this.on("optionEnv:"+n,n=>{const t=`error: option '${e.flags}' value '${n}' from env '${e.envVar}' is invalid.`;i(n,t,"env")}),this}_optionEx(e,n,t,i,r){if("object"==typeof n&&n instanceof h)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");const o=this.createOption(n,t);if(o.makeOptionMandatory(!!e.mandatory),"function"==typeof i)o.default(r).argParser(i);else if(i instanceof RegExp){const e=i;i=(n,t)=>{const i=e.exec(n);return i?i[0]:t},o.default(r).argParser(i)}else o.default(i);return this.addOption(o)}option(e,n,t,i){return this._optionEx({},e,n,t,i)}requiredOption(e,n,t,i){return this._optionEx({mandatory:!0},e,n,t,i)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){return this._passThroughOptions=!!e,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(e=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!e,this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,n){return this.setOptionValueWithSource(e,n,void 0)}setOptionValueWithSource(e,n,t){return this._storeOptionsAsProperties?this[e]=n:this._optionValues[e]=n,this._optionValueSources[e]=t,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let n;return this._getCommandAndAncestors().forEach(t=>{void 0!==t.getOptionValueSource(e)&&(n=t.getOptionValueSource(e))}),n}_prepareUserArgs(e,n){if(void 0!==e&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");if(n=n||{},void 0===e&&void 0===n.from){c.versions?.electron&&(n.from="electron");const e=c.execArgv??[];(e.includes("-e")||e.includes("--eval")||e.includes("-p")||e.includes("--print"))&&(n.from="eval")}let t;switch(void 0===e&&(e=c.argv),this.rawArgs=e.slice(),n.from){case void 0:case"node":this._scriptPath=e[1],t=e.slice(2);break;case"electron":c.defaultApp?(this._scriptPath=e[1],t=e.slice(2)):t=e.slice(1);break;case"user":t=e.slice(0);break;case"eval":t=e.slice(1);break;default:throw new Error(`unexpected parse option { from: '${n.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",t}parse(e,n){this._prepareForParse();const t=this._prepareUserArgs(e,n);return this._parseCommand([],t),this}async parseAsync(e,n){this._prepareForParse();const t=this._prepareUserArgs(e,n);return await this._parseCommand([],t),this}_prepareForParse(){null===this._savedState?this.saveStateBeforeParse():this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw new Error("Can not call parse again when storeOptionsAsProperties is true.\n- either make a new Command for each call to parse, or stop storing options as properties");this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(e,n,t){if(!u.existsSync(e))throw new Error(`'${e}' does not exist\n - if '${t}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead\n - if the default executable name is not suitable, use the executableFile option to supply a custom name or path\n - ${n?`searched for local subcommand relative to directory '${n}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory"}`)}_executeSubCommand(e,n){n=n.slice();let t=!1;const i=[".js",".ts",".tsx",".mjs",".cjs"];function r(e,n){const t=s.resolve(e,n);if(u.existsSync(t))return t;if(i.includes(s.extname(n)))return;const r=i.find(e=>u.existsSync(`${t}${e}`));return r?`${t}${r}`:void 0}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let o,l=e._executableFile||`${this._name}-${e._name}`,p=this._executableDir||"";if(this._scriptPath){let e;try{e=u.realpathSync(this._scriptPath)}catch{e=this._scriptPath}p=s.resolve(s.dirname(e),p)}if(p){let n=r(p,l);if(!n&&!e._executableFile&&this._scriptPath){const t=s.basename(this._scriptPath,s.extname(this._scriptPath));t!==this._name&&(n=r(p,`${t}-${e._name}`))}l=n||l}t=i.includes(s.extname(l)),"win32"!==c.platform?t?(n.unshift(l),n=v(c.execArgv).concat(n),o=a.spawn(c.argv[0],n,{stdio:"inherit"})):o=a.spawn(l,n,{stdio:"inherit"}):(this._checkForMissingExecutable(l,p,e._name),n.unshift(l),n=v(c.execArgv).concat(n),o=a.spawn(c.execPath,n,{stdio:"inherit"})),o.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(e=>{c.on(e,()=>{!1===o.killed&&null===o.exitCode&&o.kill(e)})});const f=this._exitCallback;o.on("close",e=>{e=e??1,f?f(new d(e,"commander.executeSubCommandAsync","(close)")):c.exit(e)}),o.on("error",n=>{if("ENOENT"===n.code)this._checkForMissingExecutable(l,p,e._name);else if("EACCES"===n.code)throw new Error(`'${l}' not executable`);if(f){const e=new d(1,"commander.executeSubCommandAsync","(error)");e.nestedError=n,f(e)}else c.exit(1)}),this.runningCommand=o}_dispatchSubcommand(e,n,t){const i=this._findCommand(e);let r;return i||this.help({error:!0}),i._prepareForParse(),r=this._chainOrCallSubCommandHook(r,i,"preSubcommand"),r=this._chainOrCall(r,()=>{if(!i._executableHandler)return i._parseCommand(n,t);this._executeSubCommand(i,n.concat(t))}),r}_dispatchHelpCommand(e){e||this.help();const n=this._findCommand(e);return n&&!n._executableHandler&&n.help(),this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((e,n)=>{e.required&&null==this.args[n]&&this.missingArgument(e.name())}),this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic||this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){const e=(e,n,t)=>{let i=n;if(null!==n&&e.parseArg){const r=`error: command-argument value '${n}' is invalid for argument '${e.name()}'.`;i=this._callParseArg(e,n,t,r)}return i};this._checkNumberOfArguments();const n=[];this.registeredArguments.forEach((t,i)=>{let r=t.defaultValue;t.variadic?i<this.args.length?(r=this.args.slice(i),t.parseArg&&(r=r.reduce((n,i)=>e(t,i,n),t.defaultValue))):void 0===r&&(r=[]):i<this.args.length&&(r=this.args[i],t.parseArg&&(r=e(t,r,t.defaultValue))),n[i]=r}),this.processedArgs=n}_chainOrCall(e,n){return e&&e.then&&"function"==typeof e.then?e.then(()=>n()):n()}_chainOrCallHooks(e,n){let t=e;const i=[];return this._getCommandAndAncestors().reverse().filter(e=>void 0!==e._lifeCycleHooks[n]).forEach(e=>{e._lifeCycleHooks[n].forEach(n=>{i.push({hookedCommand:e,callback:n})})}),"postAction"===n&&i.reverse(),i.forEach(e=>{t=this._chainOrCall(t,()=>e.callback(e.hookedCommand,this))}),t}_chainOrCallSubCommandHook(e,n,t){let i=e;return void 0!==this._lifeCycleHooks[t]&&this._lifeCycleHooks[t].forEach(e=>{i=this._chainOrCall(i,()=>e(this,n))}),i}_parseCommand(e,n){const t=this.parseOptions(n);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(t.operands),n=t.unknown,this.args=e.concat(n),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),n);if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(n),this._dispatchSubcommand(this._defaultCommandName,e,n);!this.commands.length||0!==this.args.length||this._actionHandler||this._defaultCommandName||this.help({error:!0}),this._outputHelpIfRequested(t.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();const i=()=>{t.unknown.length>0&&this.unknownOption(t.unknown[0])},r=`command:${this.name()}`;if(this._actionHandler){let t;return i(),this._processArguments(),t=this._chainOrCallHooks(t,"preAction"),t=this._chainOrCall(t,()=>this._actionHandler(this.processedArgs)),this.parent&&(t=this._chainOrCall(t,()=>{this.parent.emit(r,e,n)})),t=this._chainOrCallHooks(t,"postAction"),t}if(this.parent&&this.parent.listenerCount(r))i(),this._processArguments(),this.parent.emit(r,e,n);else if(e.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",e,n);this.listenerCount("command:*")?this.emit("command:*",e,n):this.commands.length?this.unknownCommand():(i(),this._processArguments())}else this.commands.length?(i(),this.help({error:!0})):(i(),this._processArguments())}_findCommand(e){if(e)return this.commands.find(n=>n._name===e||n._aliases.includes(e))}_findOption(e){return this.options.find(n=>n.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(e=>{e.options.forEach(n=>{n.mandatory&&void 0===e.getOptionValue(n.attributeName())&&e.missingMandatoryOptionValue(n)})})}_checkForConflictingLocalOptions(){const e=this.options.filter(e=>{const n=e.attributeName();return void 0!==this.getOptionValue(n)&&"default"!==this.getOptionValueSource(n)}),n=e.filter(e=>e.conflictsWith.length>0);n.forEach(n=>{const t=e.find(e=>n.conflictsWith.includes(e.attributeName()));t&&this._conflictingOption(n,t)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(e=>{e._checkForConflictingLocalOptions()})}parseOptions(e){const n=[],t=[];let i=n;const r=e.slice();function o(e){return e.length>1&&"-"===e[0]}const a=e=>!!/^-\d*\.?\d+(e[+-]?\d+)?$/.test(e)&&!this._getCommandAndAncestors().some(e=>e.options.map(e=>e.short).some(e=>/^-\d$/.test(e)));let s=null;for(;r.length;){const e=r.shift();if("--"===e){i===t&&i.push(e),i.push(...r);break}if(!s||o(e)&&!a(e)){if(s=null,o(e)){const n=this._findOption(e);if(n){if(n.required){const e=r.shift();void 0===e&&this.optionMissingArgument(n),this.emit(`option:${n.name()}`,e)}else if(n.optional){let e=null;r.length>0&&(!o(r[0])||a(r[0]))&&(e=r.shift()),this.emit(`option:${n.name()}`,e)}else this.emit(`option:${n.name()}`);s=n.variadic?n:null;continue}}if(e.length>2&&"-"===e[0]&&"-"!==e[1]){const n=this._findOption(`-${e[1]}`);if(n){n.required||n.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${n.name()}`,e.slice(2)):(this.emit(`option:${n.name()}`),r.unshift(`-${e.slice(2)}`));continue}}if(/^--[^=]+=/.test(e)){const n=e.indexOf("="),t=this._findOption(e.slice(0,n));if(t&&(t.required||t.optional)){this.emit(`option:${t.name()}`,e.slice(n+1));continue}}if(i!==n||!o(e)||0===this.commands.length&&a(e)||(i=t),(this._enablePositionalOptions||this._passThroughOptions)&&0===n.length&&0===t.length){if(this._findCommand(e)){n.push(e),r.length>0&&t.push(...r);break}if(this._getHelpCommand()&&e===this._getHelpCommand().name()){n.push(e),r.length>0&&n.push(...r);break}if(this._defaultCommandName){t.push(e),r.length>0&&t.push(...r);break}}if(this._passThroughOptions){i.push(e),r.length>0&&i.push(...r);break}i.push(e)}else this.emit(`option:${s.name()}`,e)}return{operands:n,unknown:t}}opts(){if(this._storeOptionsAsProperties){const e={},n=this.options.length;for(let t=0;t<n;t++){const n=this.options[t].attributeName();e[n]=n===this._versionOptionName?this._version:this[n]}return e}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((e,n)=>Object.assign(e,n.opts()),{})}error(e,n){this._outputConfiguration.outputError(`${e}\n`,this._outputConfiguration.writeErr),"string"==typeof this._showHelpAfterError?this._outputConfiguration.writeErr(`${this._showHelpAfterError}\n`):this._showHelpAfterError&&(this._outputConfiguration.writeErr("\n"),this.outputHelp({error:!0}));const t=n||{},i=t.exitCode||1,r=t.code||"commander.error";this._exit(i,r,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in c.env){const n=e.attributeName();(void 0===this.getOptionValue(n)||["default","config","env"].includes(this.getOptionValueSource(n)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,c.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){const e=new _(this.options),n=e=>void 0!==this.getOptionValue(e)&&!["default","implied"].includes(this.getOptionValueSource(e));this.options.filter(t=>void 0!==t.implied&&n(t.attributeName())&&e.valueFromOption(this.getOptionValue(t.attributeName()),t)).forEach(e=>{Object.keys(e.implied).filter(e=>!n(e)).forEach(n=>{this.setOptionValueWithSource(n,e.implied[n],"implied")})})}missingArgument(e){const n=`error: missing required argument '${e}'`;this.error(n,{code:"commander.missingArgument"})}optionMissingArgument(e){const n=`error: option '${e.flags}' argument missing`;this.error(n,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){const n=`error: required option '${e.flags}' not specified`;this.error(n,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,n){const t=e=>{const n=e.attributeName(),t=this.getOptionValue(n),i=this.options.find(e=>e.negate&&n===e.attributeName()),r=this.options.find(e=>!e.negate&&n===e.attributeName());return i&&(void 0===i.presetArg&&!1===t||void 0!==i.presetArg&&t===i.presetArg)?i:r||e},i=e=>{const n=t(e),i=n.attributeName();return"env"===this.getOptionValueSource(i)?`environment variable '${n.envVar}'`:`option '${n.flags}'`},r=`error: ${i(e)} cannot be used with ${i(n)}`;this.error(r,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let n="";if(e.startsWith("--")&&this._showSuggestionAfterError){let t=[],i=this;do{const e=i.createHelp().visibleOptions(i).filter(e=>e.long).map(e=>e.long);t=t.concat(e),i=i.parent}while(i&&!i._enablePositionalOptions);n=D(e,t)}const t=`error: unknown option '${e}'${n}`;this.error(t,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;const n=this.registeredArguments.length,t=1===n?"":"s",i=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${n} argument${t} but got ${e.length}.`;this.error(i,{code:"commander.excessArguments"})}unknownCommand(){const e=this.args[0];let n="";if(this._showSuggestionAfterError){const t=[];this.createHelp().visibleCommands(this).forEach(e=>{t.push(e.name()),e.alias()&&t.push(e.alias())}),n=D(e,t)}const t=`error: unknown command '${e}'${n}`;this.error(t,{code:"commander.unknownCommand"})}version(e,n,t){if(void 0===e)return this._version;this._version=e,n=n||"-V, --version",t=t||"output the version number";const i=this.createOption(n,t);return this._versionOptionName=i.attributeName(),this._registerOption(i),this.on("option:"+i.name(),()=>{this._outputConfiguration.writeOut(`${e}\n`),this._exit(0,"commander.version",e)}),this}description(e,n){return void 0===e&&void 0===n?this._description:(this._description=e,n&&(this._argsDescription=n),this)}summary(e){return void 0===e?this._summary:(this._summary=e,this)}alias(e){if(void 0===e)return this._aliases[0];let n=this;if(0!==this.commands.length&&this.commands[this.commands.length-1]._executableHandler&&(n=this.commands[this.commands.length-1]),e===n._name)throw new Error("Command alias can't be the same as its name");const t=this.parent?._findCommand(e);if(t){const n=[t.name()].concat(t.aliases()).join("|");throw new Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${n}'`)}return n._aliases.push(e),this}aliases(e){return void 0===e?this._aliases:(e.forEach(e=>this.alias(e)),this)}usage(e){if(void 0===e){if(this._usage)return this._usage;const e=this.registeredArguments.map(e=>p(e));return[].concat(this.options.length||null!==this._helpOption?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?e:[]).join(" ")}return this._usage=e,this}name(e){return void 0===e?this._name:(this._name=e,this)}helpGroup(e){return void 0===e?this._helpGroupHeading??"":(this._helpGroupHeading=e,this)}commandsGroup(e){return void 0===e?this._defaultCommandGroup??"":(this._defaultCommandGroup=e,this)}optionsGroup(e){return void 0===e?this._defaultOptionGroup??"":(this._defaultOptionGroup=e,this)}_initOptionGroup(e){this._defaultOptionGroup&&!e.helpGroupHeading&&e.helpGroup(this._defaultOptionGroup)}_initCommandGroup(e){this._defaultCommandGroup&&!e.helpGroup()&&e.helpGroup(this._defaultCommandGroup)}nameFromFilename(e){return this._name=s.basename(e,s.extname(e)),this}executableDir(e){return void 0===e?this._executableDir:(this._executableDir=e,this)}helpInformation(e){const n=this.createHelp(),t=this._getOutputContext(e);n.prepareContext({error:t.error,helpWidth:t.helpWidth,outputHasColors:t.hasColors});const i=n.formatHelp(this,n);return t.hasColors?i:this._outputConfiguration.stripColor(i)}_getOutputContext(e){const n=!!(e=e||{}).error;let t,i,r;return n?(t=e=>this._outputConfiguration.writeErr(e),i=this._outputConfiguration.getErrHasColors(),r=this._outputConfiguration.getErrHelpWidth()):(t=e=>this._outputConfiguration.writeOut(e),i=this._outputConfiguration.getOutHasColors(),r=this._outputConfiguration.getOutHelpWidth()),{error:n,write:e=>(i||(e=this._outputConfiguration.stripColor(e)),t(e)),hasColors:i,helpWidth:r}}outputHelp(e){let n;"function"==typeof e&&(n=e,e=void 0);const t=this._getOutputContext(e),i={error:t.error,write:t.write,command:this};this._getCommandAndAncestors().reverse().forEach(e=>e.emit("beforeAllHelp",i)),this.emit("beforeHelp",i);let r=this.helpInformation({error:t.error});if(n&&(r=n(r),"string"!=typeof r&&!Buffer.isBuffer(r)))throw new Error("outputHelp callback must return a string or a Buffer");t.write(r),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",i),this._getCommandAndAncestors().forEach(e=>e.emit("afterAllHelp",i))}helpOption(e,n){return"boolean"==typeof e?(e?(null===this._helpOption&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(e??"-h, --help",n??"display help for command"),(e||n)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return void 0===this._helpOption&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this._initOptionGroup(e),this}help(e){this.outputHelp(e);let n=Number(c.exitCode??0);0===n&&e&&"function"!=typeof e&&e.error&&(n=1),this._exit(n,"commander.help","(outputHelp)")}addHelpText(e,n){const t=["beforeAll","before","after","afterAll"];if(!t.includes(e))throw new Error(`Unexpected value for position to addHelpText.\nExpecting one of '${t.join("', '")}'`);const i=`${e}Help`;return this.on(i,e=>{let t;t="function"==typeof n?n({error:e.error,command:e.command}):n,t&&e.write(`${t}\n`)}),this}_outputHelpIfRequested(e){const n=this._getHelpOption();n&&e.find(e=>n.is(e))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}}function v(e){return e.map(e=>{if(!e.startsWith("--inspect"))return e;let n,t,i="127.0.0.1",r="9229";return null!==(t=e.match(/^(--inspect(-brk)?)$/))?n=t[1]:null!==(t=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))?(n=t[1],/^\d+$/.test(t[3])?r=t[3]:i=t[3]):null!==(t=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))&&(n=t[1],i=t[3],r=t[4]),n&&"0"!==r?`${n}=${i}:${parseInt(r)+1}`:e})}function x(){return!c.env.NO_COLOR&&"0"!==c.env.FORCE_COLOR&&"false"!==c.env.FORCE_COLOR&&(!(!c.env.FORCE_COLOR&&void 0===c.env.CLICOLOR_FORCE)||void 0)}return R.Command=g,R.useColor=x,R}(),{CommanderError:s,InvalidArgumentError:u}=L(),{Help:c}=B(),{Option:l}=N();return C.program=new a,C.createCommand=e=>new a(e),C.createOption=(e,n)=>new l(e,n),C.createArgument=(e,n)=>new o(e,n),C.Command=a,C.Option=l,C.Argument=o,C.Help=c,C.CommanderError=s,C.InvalidArgumentError=u,C.InvalidOptionArgumentError=u,C}(),z=E(W);const{program:q,createCommand:G,createArgument:V,createOption:K,CommanderError:J,InvalidArgumentError:Y,InvalidOptionArgumentError:X,Command:Z,Argument:Q,Option:ee,Help:ne}=z;var te,ie,re,oe,ae,se,ue,ce,le,pe,de="1.0.2",fe={},me={};function he(){return te||(te=1,me.fromCallback=function(e){return Object.defineProperty(function(...n){if("function"!=typeof n[n.length-1])return new Promise((t,i)=>{n.push((e,n)=>null!=e?i(e):t(n)),e.apply(this,n)});e.apply(this,n)},"name",{value:e.name})},me.fromPromise=function(e){return Object.defineProperty(function(...n){const t=n[n.length-1];if("function"!=typeof t)return e.apply(this,n);n.pop(),e.apply(this,n).then(e=>t(null,e),t)},"name",{value:e.name})}),me}function _e(){if(re)return ie;re=1;var e=o,n=process.cwd,t=null,i=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return t||(t=n.call(process)),t};try{process.cwd()}catch(e){}if("function"==typeof process.chdir){var r=process.chdir;process.chdir=function(e){t=null,r.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,r)}return ie=function(n){e.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&function(n){n.lchmod=function(t,i,r){n.open(t,e.O_WRONLY|e.O_SYMLINK,i,function(e,t){e?r&&r(e):n.fchmod(t,i,function(e){n.close(t,function(n){r&&r(e||n)})})})},n.lchmodSync=function(t,i){var r,o=n.openSync(t,e.O_WRONLY|e.O_SYMLINK,i),a=!0;try{r=n.fchmodSync(o,i),a=!1}finally{if(a)try{n.closeSync(o)}catch(e){}else n.closeSync(o)}return r}}(n);n.lutimes||function(n){e.hasOwnProperty("O_SYMLINK")&&n.futimes?(n.lutimes=function(t,i,r,o){n.open(t,e.O_SYMLINK,function(e,t){e?o&&o(e):n.futimes(t,i,r,function(e){n.close(t,function(n){o&&o(e||n)})})})},n.lutimesSync=function(t,i,r){var o,a=n.openSync(t,e.O_SYMLINK),s=!0;try{o=n.futimesSync(a,i,r),s=!1}finally{if(s)try{n.closeSync(a)}catch(e){}else n.closeSync(a)}return o}):n.futimes&&(n.lutimes=function(e,n,t,i){i&&process.nextTick(i)},n.lutimesSync=function(){})}(n);n.chown=o(n.chown),n.fchown=o(n.fchown),n.lchown=o(n.lchown),n.chmod=t(n.chmod),n.fchmod=t(n.fchmod),n.lchmod=t(n.lchmod),n.chownSync=a(n.chownSync),n.fchownSync=a(n.fchownSync),n.lchownSync=a(n.lchownSync),n.chmodSync=r(n.chmodSync),n.fchmodSync=r(n.fchmodSync),n.lchmodSync=r(n.lchmodSync),n.stat=s(n.stat),n.fstat=s(n.fstat),n.lstat=s(n.lstat),n.statSync=u(n.statSync),n.fstatSync=u(n.fstatSync),n.lstatSync=u(n.lstatSync),n.chmod&&!n.lchmod&&(n.lchmod=function(e,n,t){t&&process.nextTick(t)},n.lchmodSync=function(){});n.chown&&!n.lchown&&(n.lchown=function(e,n,t,i){i&&process.nextTick(i)},n.lchownSync=function(){});"win32"===i&&(n.rename="function"!=typeof n.rename?n.rename:function(e){function t(t,i,r){var o=Date.now(),a=0;e(t,i,function s(u){if(u&&("EACCES"===u.code||"EPERM"===u.code||"EBUSY"===u.code)&&Date.now()-o<6e4)return setTimeout(function(){n.stat(i,function(n,o){n&&"ENOENT"===n.code?e(t,i,s):r(u)})},a),void(a<100&&(a+=10));r&&r(u)})}return Object.setPrototypeOf&&Object.setPrototypeOf(t,e),t}(n.rename));function t(e){return e?function(t,i,r){return e.call(n,t,i,function(e){c(e)&&(e=null),r&&r.apply(this,arguments)})}:e}function r(e){return e?function(t,i){try{return e.call(n,t,i)}catch(e){if(!c(e))throw e}}:e}function o(e){return e?function(t,i,r,o){return e.call(n,t,i,r,function(e){c(e)&&(e=null),o&&o.apply(this,arguments)})}:e}function a(e){return e?function(t,i,r){try{return e.call(n,t,i,r)}catch(e){if(!c(e))throw e}}:e}function s(e){return e?function(t,i,r){function o(e,n){n&&(n.uid<0&&(n.uid+=4294967296),n.gid<0&&(n.gid+=4294967296)),r&&r.apply(this,arguments)}return"function"==typeof i&&(r=i,i=null),i?e.call(n,t,i,o):e.call(n,t,o)}:e}function u(e){return e?function(t,i){var r=i?e.call(n,t,i):e.call(n,t);return r&&(r.uid<0&&(r.uid+=4294967296),r.gid<0&&(r.gid+=4294967296)),r}:e}function c(e){return!e||("ENOSYS"===e.code||!(process.getuid&&0===process.getuid()||"EINVAL"!==e.code&&"EPERM"!==e.code))}n.read="function"!=typeof n.read?n.read:function(e){function t(t,i,r,o,a,s){var u;if(s&&"function"==typeof s){var c=0;u=function(l,p,d){if(l&&"EAGAIN"===l.code&&c<10)return c++,e.call(n,t,i,r,o,a,u);s.apply(this,arguments)}}return e.call(n,t,i,r,o,a,u)}return Object.setPrototypeOf&&Object.setPrototypeOf(t,e),t}(n.read),n.readSync="function"!=typeof n.readSync?n.readSync:(l=n.readSync,function(e,t,i,r,o){for(var a=0;;)try{return l.call(n,e,t,i,r,o)}catch(e){if("EAGAIN"===e.code&&a<10){a++;continue}throw e}});var l},ie}function De(){if(le)return ce;le=1;var e,n,t=i,r=_e(),o=function(){if(ae)return oe;ae=1;var e=a.Stream;return oe=function(n){return{ReadStream:function t(i,r){if(!(this instanceof t))return new t(i,r);e.call(this);var o=this;this.path=i,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,r=r||{};for(var a=Object.keys(r),s=0,u=a.length;s<u;s++){var c=a[s];this[c]=r[c]}if(this.encoding&&this.setEncoding(this.encoding),void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(void 0===this.end)this.end=1/0;else if("number"!=typeof this.end)throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}null===this.fd?n.open(this.path,this.flags,this.mode,function(e,n){if(e)return o.emit("error",e),void(o.readable=!1);o.fd=n,o.emit("open",n),o._read()}):process.nextTick(function(){o._read()})},WriteStream:function t(i,r){if(!(this instanceof t))return new t(i,r);e.call(this),this.path=i,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,r=r||{};for(var o=Object.keys(r),a=0,s=o.length;a<s;a++){var u=o[a];this[u]=r[u]}if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],null===this.fd&&(this._open=n.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}},oe}(),c=function(){if(ue)return se;ue=1,se=function(n){if(null===n||"object"!=typeof n)return n;if(n instanceof Object)var t={__proto__:e(n)};else t=Object.create(null);return Object.getOwnPropertyNames(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t};var e=Object.getPrototypeOf||function(e){return e.__proto__};return se}(),l=s;function p(n,t){Object.defineProperty(n,e,{get:function(){return t}})}"function"==typeof Symbol&&"function"==typeof Symbol.for?(e=Symbol.for("graceful-fs.queue"),n=Symbol.for("graceful-fs.previous")):(e="___graceful-fs.queue",n="___graceful-fs.previous");var d,f=function(){};if(l.debuglog?f=l.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(f=function(){var e=l.format.apply(l,arguments);e="GFS4: "+e.split(/\n/).join("\nGFS4: "),console.error(e)}),!t[e]){var m=y[e]||[];p(t,m),t.close=function(e){function i(n,i){return e.call(t,n,function(e){e||D(),"function"==typeof i&&i.apply(this,arguments)})}return Object.defineProperty(i,n,{value:e}),i}(t.close),t.closeSync=function(e){function i(n){e.apply(t,arguments),D()}return Object.defineProperty(i,n,{value:e}),i}(t.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){f(t[e]),u.equal(t[e].length,0)})}function h(e){r(e),e.gracefulify=h,e.createReadStream=function(n,t){return new e.ReadStream(n,t)},e.createWriteStream=function(n,t){return new e.WriteStream(n,t)};var n=e.readFile;e.readFile=function(e,t,i){"function"==typeof t&&(i=t,t=null);return function e(t,i,r,o){return n(t,i,function(n){!n||"EMFILE"!==n.code&&"ENFILE"!==n.code?"function"==typeof r&&r.apply(this,arguments):_([e,[t,i,r],n,o||Date.now(),Date.now()])})}(e,t,i)};var t=e.writeFile;e.writeFile=function(e,n,i,r){"function"==typeof i&&(r=i,i=null);return function e(n,i,r,o,a){return t(n,i,r,function(t){!t||"EMFILE"!==t.code&&"ENFILE"!==t.code?"function"==typeof o&&o.apply(this,arguments):_([e,[n,i,r,o],t,a||Date.now(),Date.now()])})}(e,n,i,r)};var i=e.appendFile;i&&(e.appendFile=function(e,n,t,r){"function"==typeof t&&(r=t,t=null);return function e(n,t,r,o,a){return i(n,t,r,function(i){!i||"EMFILE"!==i.code&&"ENFILE"!==i.code?"function"==typeof o&&o.apply(this,arguments):_([e,[n,t,r,o],i,a||Date.now(),Date.now()])})}(e,n,t,r)});var a=e.copyFile;a&&(e.copyFile=function(e,n,t,i){"function"==typeof t&&(i=t,t=0);return function e(n,t,i,r,o){return a(n,t,i,function(a){!a||"EMFILE"!==a.code&&"ENFILE"!==a.code?"func