create-somod
Version:
SOMOD Project creator
20 lines • 232 kB
JavaScript
var pb=Object.create;var io=Object.defineProperty;var db=Object.getOwnPropertyDescriptor;var gb=Object.getOwnPropertyNames;var mb=Object.getPrototypeOf,vb=Object.prototype.hasOwnProperty;var _b=(e,r)=>()=>(e&&(r=e(e=0)),r);var L=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),yb=(e,r)=>{for(var t in r)io(e,t,{get:r[t],enumerable:!0})},jf=(e,r,t,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let u of gb(r))!vb.call(e,u)&&u!==t&&io(e,u,{get:()=>r[u],enumerable:!(o=db(r,u))||o.enumerable});return e};var Qn=(e,r,t)=>(t=e!=null?pb(mb(e)):{},jf(r||!e||!e.__esModule?io(t,"default",{value:e,enumerable:!0}):t,e)),_n=e=>jf(io({},"__esModule",{value:!0}),e);var rn={};yb(rn,{__assign:()=>ms,__asyncDelegator:()=>kb,__asyncGenerator:()=>Rb,__asyncValues:()=>Lb,__await:()=>jt,__awaiter:()=>Sb,__classPrivateFieldGet:()=>qb,__classPrivateFieldIn:()=>Hb,__classPrivateFieldSet:()=>Bb,__createBinding:()=>_s,__decorate:()=>xb,__exportStar:()=>Cb,__extends:()=>wb,__generator:()=>Eb,__importDefault:()=>Db,__importStar:()=>Nb,__makeTemplateObject:()=>Pb,__metadata:()=>Ob,__param:()=>Ab,__read:()=>Uf,__rest:()=>bb,__spread:()=>Ib,__spreadArray:()=>Fb,__spreadArrays:()=>Tb,__values:()=>vs});function wb(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");gs(e,r);function t(){this.constructor=e}e.prototype=r===null?Object.create(r):(t.prototype=r.prototype,new t)}function bb(e,r){var t={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&r.indexOf(o)<0&&(t[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var u=0,o=Object.getOwnPropertySymbols(e);u<o.length;u++)r.indexOf(o[u])<0&&Object.prototype.propertyIsEnumerable.call(e,o[u])&&(t[o[u]]=e[o[u]]);return t}function xb(e,r,t,o){var u=arguments.length,a=u<3?r:o===null?o=Object.getOwnPropertyDescriptor(r,t):o,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,r,t,o);else for(var f=e.length-1;f>=0;f--)(l=e[f])&&(a=(u<3?l(a):u>3?l(r,t,a):l(r,t))||a);return u>3&&a&&Object.defineProperty(r,t,a),a}function Ab(e,r){return function(t,o){r(t,o,e)}}function Ob(e,r){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,r)}function Sb(e,r,t,o){function u(a){return a instanceof t?a:new t(function(l){l(a)})}return new(t||(t=Promise))(function(a,l){function f(y){try{g(o.next(y))}catch(w){l(w)}}function p(y){try{g(o.throw(y))}catch(w){l(w)}}function g(y){y.done?a(y.value):u(y.value).then(f,p)}g((o=o.apply(e,r||[])).next())})}function Eb(e,r){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},o,u,a,l;return l={next:f(0),throw:f(1),return:f(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function f(g){return function(y){return p([g,y])}}function p(g){if(o)throw new TypeError("Generator is already executing.");for(;t;)try{if(o=1,u&&(a=g[0]&2?u.return:g[0]?u.throw||((a=u.return)&&a.call(u),0):u.next)&&!(a=a.call(u,g[1])).done)return a;switch(u=0,a&&(g=[g[0]&2,a.value]),g[0]){case 0:case 1:a=g;break;case 4:return t.label++,{value:g[1],done:!1};case 5:t.label++,u=g[1],g=[0];continue;case 7:g=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(g[0]===6||g[0]===2)){t=0;continue}if(g[0]===3&&(!a||g[1]>a[0]&&g[1]<a[3])){t.label=g[1];break}if(g[0]===6&&t.label<a[1]){t.label=a[1],a=g;break}if(a&&t.label<a[2]){t.label=a[2],t.ops.push(g);break}a[2]&&t.ops.pop(),t.trys.pop();continue}g=r.call(e,t)}catch(y){g=[6,y],u=0}finally{o=a=0}if(g[0]&5)throw g[1];return{value:g[0]?g[1]:void 0,done:!0}}}function Cb(e,r){for(var t in e)t!=="default"&&!Object.prototype.hasOwnProperty.call(r,t)&&_s(r,e,t)}function vs(e){var r=typeof Symbol=="function"&&Symbol.iterator,t=r&&e[r],o=0;if(t)return t.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&o>=e.length&&(e=void 0),{value:e&&e[o++],done:!e}}};throw new TypeError(r?"Object is not iterable.":"Symbol.iterator is not defined.")}function Uf(e,r){var t=typeof Symbol=="function"&&e[Symbol.iterator];if(!t)return e;var o=t.call(e),u,a=[],l;try{for(;(r===void 0||r-- >0)&&!(u=o.next()).done;)a.push(u.value)}catch(f){l={error:f}}finally{try{u&&!u.done&&(t=o.return)&&t.call(o)}finally{if(l)throw l.error}}return a}function Ib(){for(var e=[],r=0;r<arguments.length;r++)e=e.concat(Uf(arguments[r]));return e}function Tb(){for(var e=0,r=0,t=arguments.length;r<t;r++)e+=arguments[r].length;for(var o=Array(e),u=0,r=0;r<t;r++)for(var a=arguments[r],l=0,f=a.length;l<f;l++,u++)o[u]=a[l];return o}function Fb(e,r,t){if(t||arguments.length===2)for(var o=0,u=r.length,a;o<u;o++)(a||!(o in r))&&(a||(a=Array.prototype.slice.call(r,0,o)),a[o]=r[o]);return e.concat(a||Array.prototype.slice.call(r))}function jt(e){return this instanceof jt?(this.v=e,this):new jt(e)}function Rb(e,r,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var o=t.apply(e,r||[]),u,a=[];return u={},l("next"),l("throw"),l("return"),u[Symbol.asyncIterator]=function(){return this},u;function l(A){o[A]&&(u[A]=function(S){return new Promise(function(C,R){a.push([A,S,C,R])>1||f(A,S)})})}function f(A,S){try{p(o[A](S))}catch(C){w(a[0][3],C)}}function p(A){A.value instanceof jt?Promise.resolve(A.value.v).then(g,y):w(a[0][2],A)}function g(A){f("next",A)}function y(A){f("throw",A)}function w(A,S){A(S),a.shift(),a.length&&f(a[0][0],a[0][1])}}function kb(e){var r,t;return r={},o("next"),o("throw",function(u){throw u}),o("return"),r[Symbol.iterator]=function(){return this},r;function o(u,a){r[u]=e[u]?function(l){return(t=!t)?{value:jt(e[u](l)),done:u==="return"}:a?a(l):l}:a}}function Lb(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=e[Symbol.asyncIterator],t;return r?r.call(e):(e=typeof vs=="function"?vs(e):e[Symbol.iterator](),t={},o("next"),o("throw"),o("return"),t[Symbol.asyncIterator]=function(){return this},t);function o(a){t[a]=e[a]&&function(l){return new Promise(function(f,p){l=e[a](l),u(f,p,l.done,l.value)})}}function u(a,l,f,p){Promise.resolve(p).then(function(g){a({value:g,done:f})},l)}}function Pb(e,r){return Object.defineProperty?Object.defineProperty(e,"raw",{value:r}):e.raw=r,e}function Nb(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var t in e)t!=="default"&&Object.prototype.hasOwnProperty.call(e,t)&&_s(r,e,t);return Mb(r,e),r}function Db(e){return e&&e.__esModule?e:{default:e}}function qb(e,r,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof r=="function"?e!==r||!o:!r.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(e):o?o.value:r.get(e)}function Bb(e,r,t,o,u){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!u)throw new TypeError("Private accessor was defined without a setter");if(typeof r=="function"?e!==r||!u:!r.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?u.call(e,t):u?u.value=t:r.set(e,t),t}function Hb(e,r){if(r===null||typeof r!="object"&&typeof r!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof e=="function"?r===e:e.has(r)}var gs,ms,_s,Mb,tn=_b(()=>{gs=function(e,r){return gs=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,o){t.__proto__=o}||function(t,o){for(var u in o)Object.prototype.hasOwnProperty.call(o,u)&&(t[u]=o[u])},gs(e,r)};ms=function(){return ms=Object.assign||function(r){for(var t,o=1,u=arguments.length;o<u;o++){t=arguments[o];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(r[a]=t[a])}return r},ms.apply(this,arguments)};_s=Object.create?function(e,r,t,o){o===void 0&&(o=t);var u=Object.getOwnPropertyDescriptor(r,t);(!u||("get"in u?!r.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(e,o,u)}:function(e,r,t,o){o===void 0&&(o=t),e[o]=r[t]};Mb=Object.create?function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}:function(e,r){e.default=r}});var Yf=L(Qr=>{"use strict";Object.defineProperty(Qr,"__esModule",{value:!0});Qr.childProcess=Qr.ChildProcessError=void 0;var ys=(tn(),_n(rn)),Wb=require("child_process"),uo=require("stream"),$b=function(e){ys.__extends(r,e);function r(t){var o=e.call(this)||this;return o.prefix="",o.lineSeparator="",o.firstChunkProcessed=!1,o.prefix=t,o.lineSeparator=process.platform==="win32"?`\r
`:`
`,o}return r.prototype._transform=function(t,o,u){this.firstChunkProcessed||(this.push(this.prefix),this.firstChunkProcessed=!0);var a=String(t),l=a.split(this.lineSeparator);this.push(l.join(this.lineSeparator+this.prefix)),u()},r}(uo.Transform),Gf=function(e){ys.__extends(r,e);function r(t,o){var u=this.constructor,a=e.call(this,"Child Process Failed. Run : ".concat(t))||this;return a._result=null,a._program=null,a._program=t,a._result=o,Object.setPrototypeOf(a,u.prototype),a}return Object.defineProperty(r.prototype,"result",{get:function(){return this._result},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"program",{get:function(){return this._program},enumerable:!1,configurable:!0}),r}(Error);Qr.ChildProcessError=Gf;var oo=function(e,r,t,o){var u=[];if(t.return=="on"||t.show=="error"){var a=new uo.PassThrough;a.on("data",function(l){u.push(l)}),e=e.pipe(a)}return t.show=="on"&&(o&&(e=e.pipe(new $b(o))),e.pipe(r)),u},jb=function(e,r,t,o,u,a){o===void 0&&(o={}),u===void 0&&(u={});var l={return:o.return||"off",show:o.show||"error"},f={return:u.return||"off",show:u.show||"error"};return new Promise(function(p,g){var y=(0,Wb.spawn)(r,t,{cwd:e,windowsHide:!0,env:process.env});process.stdin.pipe(y.stdin);var w={stdout:oo(y.stdout,process.stdout,l,a),stderr:oo(y.stderr,process.stderr,f,a)};y.on("error",function(A){g(A)}),y.on("exit",function(A){var S={},C=Buffer.concat(w.stdout).toString(),R=Buffer.concat(w.stderr).toString();S.stdout=l.return=="on"?C:void 0,S.stderr=f.return=="on"?R:void 0,A==0?p(S):(l.show=="error"&&C&&oo(uo.Readable.from(C),process.stdout,{return:"off",show:"on"},a),f.show=="error"&&R&&oo(uo.Readable.from(R),process.stderr,{return:"off",show:"on"},a),g(new Gf(ys.__spreadArray([r],t,!0).join(" "),S)))})})};Qr.childProcess=jb});var Ut=L(bs=>{var so=class extends Error{constructor(r,t,o){super(o),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=r,this.nestedError=void 0}},ws=class extends so{constructor(r){super(1,"commander.invalidArgument",r),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};bs.CommanderError=so;bs.InvalidArgumentError=ws});var ao=L(As=>{var{InvalidArgumentError:Ub}=Ut(),xs=class{constructor(r,t){switch(this.description=t||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,r[0]){case"<":this.required=!0,this._name=r.slice(1,-1);break;case"[":this.required=!1,this._name=r.slice(1,-1);break;default:this.required=!0,this._name=r;break}this._name.length>3&&this._name.slice(-3)==="..."&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(r,t){return t===this.defaultValue||!Array.isArray(t)?[r]:t.concat(r)}default(r,t){return this.defaultValue=r,this.defaultValueDescription=t,this}argParser(r){return this.parseArg=r,this}choices(r){return this.argChoices=r.slice(),this.parseArg=(t,o)=>{if(!this.argChoices.includes(t))throw new Ub(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(t,o):t},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function Gb(e){let r=e.name()+(e.variadic===!0?"...":"");return e.required?"<"+r+">":"["+r+"]"}As.Argument=xs;As.humanReadableArgName=Gb});var Ss=L(Vf=>{var{humanReadableArgName:Yb}=ao(),Os=class{constructor(){this.helpWidth=void 0,this.sortSubcommands=!1,this.sortOptions=!1}visibleCommands(r){let t=r.commands.filter(o=>!o._hidden);if(r._hasImplicitHelpCommand()){let[,o,u]=r._helpCommandnameAndArgs.match(/([^ ]+) *(.*)/),a=r.createCommand(o).helpOption(!1);a.description(r._helpCommandDescription),u&&a.arguments(u),t.push(a)}return this.sortSubcommands&&t.sort((o,u)=>o.name().localeCompare(u.name())),t}visibleOptions(r){let t=r.options.filter(a=>!a.hidden),o=r._hasHelpOption&&r._helpShortFlag&&!r._findOption(r._helpShortFlag),u=r._hasHelpOption&&!r._findOption(r._helpLongFlag);if(o||u){let a;o?u?a=r.createOption(r._helpFlags,r._helpDescription):a=r.createOption(r._helpShortFlag,r._helpDescription):a=r.createOption(r._helpLongFlag,r._helpDescription),t.push(a)}if(this.sortOptions){let a=l=>l.short?l.short.replace(/^-/,""):l.long.replace(/^--/,"");t.sort((l,f)=>a(l).localeCompare(a(f)))}return t}visibleArguments(r){return r._argsDescription&&r._args.forEach(t=>{t.description=t.description||r._argsDescription[t.name()]||""}),r._args.find(t=>t.description)?r._args:[]}subcommandTerm(r){let t=r._args.map(o=>Yb(o)).join(" ");return r._name+(r._aliases[0]?"|"+r._aliases[0]:"")+(r.options.length?" [options]":"")+(t?" "+t:"")}optionTerm(r){return r.flags}argumentTerm(r){return r.name()}longestSubcommandTermLength(r,t){return t.visibleCommands(r).reduce((o,u)=>Math.max(o,t.subcommandTerm(u).length),0)}longestOptionTermLength(r,t){return t.visibleOptions(r).reduce((o,u)=>Math.max(o,t.optionTerm(u).length),0)}longestArgumentTermLength(r,t){return t.visibleArguments(r).reduce((o,u)=>Math.max(o,t.argumentTerm(u).length),0)}commandUsage(r){let t=r._name;r._aliases[0]&&(t=t+"|"+r._aliases[0]);let o="";for(let u=r.parent;u;u=u.parent)o=u.name()+" "+o;return o+t+" "+r.usage()}commandDescription(r){return r.description()}subcommandDescription(r){return r.summary()||r.description()}optionDescription(r){let t=[];return r.argChoices&&t.push(`choices: ${r.argChoices.map(o=>JSON.stringify(o)).join(", ")}`),r.defaultValue!==void 0&&(r.required||r.optional||r.isBoolean()&&typeof r.defaultValue=="boolean")&&t.push(`default: ${r.defaultValueDescription||JSON.stringify(r.defaultValue)}`),r.presetArg!==void 0&&r.optional&&t.push(`preset: ${JSON.stringify(r.presetArg)}`),r.envVar!==void 0&&t.push(`env: ${r.envVar}`),t.length>0?`${r.description} (${t.join(", ")})`:r.description}argumentDescription(r){let t=[];if(r.argChoices&&t.push(`choices: ${r.argChoices.map(o=>JSON.stringify(o)).join(", ")}`),r.defaultValue!==void 0&&t.push(`default: ${r.defaultValueDescription||JSON.stringify(r.defaultValue)}`),t.length>0){let o=`(${t.join(", ")})`;return r.description?`${r.description} ${o}`:o}return r.description}formatHelp(r,t){let o=t.padWidth(r,t),u=t.helpWidth||80,a=2,l=2;function f(C,R){if(R){let D=`${C.padEnd(o+l)}${R}`;return t.wrap(D,u-a,o+l)}return C}function p(C){return C.join(`
`).replace(/^/gm," ".repeat(a))}let g=[`Usage: ${t.commandUsage(r)}`,""],y=t.commandDescription(r);y.length>0&&(g=g.concat([y,""]));let w=t.visibleArguments(r).map(C=>f(t.argumentTerm(C),t.argumentDescription(C)));w.length>0&&(g=g.concat(["Arguments:",p(w),""]));let A=t.visibleOptions(r).map(C=>f(t.optionTerm(C),t.optionDescription(C)));A.length>0&&(g=g.concat(["Options:",p(A),""]));let S=t.visibleCommands(r).map(C=>f(t.subcommandTerm(C),t.subcommandDescription(C)));return S.length>0&&(g=g.concat(["Commands:",p(S),""])),g.join(`
`)}padWidth(r,t){return Math.max(t.longestOptionTermLength(r,t),t.longestSubcommandTermLength(r,t),t.longestArgumentTermLength(r,t))}wrap(r,t,o,u=40){if(r.match(/[\n]\s+/))return r;let a=t-o;if(a<u)return r;let l=r.slice(0,o),f=r.slice(o),p=" ".repeat(o),g=new RegExp(".{1,"+(a-1)+"}([\\s\u200B]|$)|[^\\s\u200B]+?([\\s\u200B]|$)","g"),y=f.match(g)||[];return l+y.map((w,A)=>(w.slice(-1)===`
`&&(w=w.slice(0,w.length-1)),(A>0?p:"")+w.trimRight())).join(`
`)}};Vf.Help=Os});var Is=L(lo=>{var{InvalidArgumentError:Vb}=Ut(),Es=class{constructor(r,t){this.flags=r,this.description=t||"",this.required=r.includes("<"),this.optional=r.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(r),this.mandatory=!1;let o=Kf(r);this.short=o.shortFlag,this.long=o.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}default(r,t){return this.defaultValue=r,this.defaultValueDescription=t,this}preset(r){return this.presetArg=r,this}conflicts(r){return this.conflictsWith=this.conflictsWith.concat(r),this}implies(r){return this.implied=Object.assign(this.implied||{},r),this}env(r){return this.envVar=r,this}argParser(r){return this.parseArg=r,this}makeOptionMandatory(r=!0){return this.mandatory=!!r,this}hideHelp(r=!0){return this.hidden=!!r,this}_concatValue(r,t){return t===this.defaultValue||!Array.isArray(t)?[r]:t.concat(r)}choices(r){return this.argChoices=r.slice(),this.parseArg=(t,o)=>{if(!this.argChoices.includes(t))throw new Vb(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(t,o):t},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return Kb(this.name().replace(/^no-/,""))}is(r){return this.short===r||this.long===r}isBoolean(){return!this.required&&!this.optional&&!this.negate}},Cs=class{constructor(r){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,r.forEach(t=>{t.negate?this.negativeOptions.set(t.attributeName(),t):this.positiveOptions.set(t.attributeName(),t)}),this.negativeOptions.forEach((t,o)=>{this.positiveOptions.has(o)&&this.dualOptions.add(o)})}valueFromOption(r,t){let o=t.attributeName();if(!this.dualOptions.has(o))return!0;let u=this.negativeOptions.get(o).presetArg,a=u!==void 0?u:!1;return t.negate===(a===r)}};function Kb(e){return e.split("-").reduce((r,t)=>r+t[0].toUpperCase()+t.slice(1))}function Kf(e){let r,t,o=e.split(/[ |,]+/);return o.length>1&&!/^[[<]/.test(o[1])&&(r=o.shift()),t=o.shift(),!r&&/^-[^-]$/.test(t)&&(r=t,t=void 0),{shortFlag:r,longFlag:t}}lo.Option=Es;lo.splitOptionFlags=Kf;lo.DualOptions=Cs});var Jf=L(zf=>{function zb(e,r){if(Math.abs(e.length-r.length)>3)return Math.max(e.length,r.length);let t=[];for(let o=0;o<=e.length;o++)t[o]=[o];for(let o=0;o<=r.length;o++)t[0][o]=o;for(let o=1;o<=r.length;o++)for(let u=1;u<=e.length;u++){let a=1;e[u-1]===r[o-1]?a=0:a=1,t[u][o]=Math.min(t[u-1][o]+1,t[u][o-1]+1,t[u-1][o-1]+a),u>1&&o>1&&e[u-1]===r[o-2]&&e[u-2]===r[o-1]&&(t[u][o]=Math.min(t[u][o],t[u-2][o-2]+1))}return t[e.length][r.length]}function Jb(e,r){if(!r||r.length===0)return"";r=Array.from(new Set(r));let t=e.startsWith("--");t&&(e=e.slice(2),r=r.map(l=>l.slice(2)));let o=[],u=3,a=.4;return r.forEach(l=>{if(l.length<=1)return;let f=zb(e,l),p=Math.max(e.length,l.length);(p-f)/p>a&&(f<u?(u=f,o=[l]):f===u&&o.push(l))}),o.sort((l,f)=>l.localeCompare(f)),t&&(o=o.map(l=>`--${l}`)),o.length>1?`
(Did you mean one of ${o.join(", ")}?)`:o.length===1?`
(Did you mean ${o[0]}?)`:""}zf.suggestSimilar=Jb});var rh=L(nh=>{var Zb=require("events").EventEmitter,Ts=require("child_process"),Dn=require("path"),Fs=require("fs"),le=require("process"),{Argument:Xb,humanReadableArgName:Qb}=ao(),{CommanderError:Rs}=Ut(),{Help:ex}=Ss(),{Option:Zf,splitOptionFlags:nx,DualOptions:rx}=Is(),{suggestSimilar:Xf}=Jf(),ks=class e extends Zb{constructor(r){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!0,this._args=[],this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=r||"",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._outputConfiguration={writeOut:t=>le.stdout.write(t),writeErr:t=>le.stderr.write(t),getOutHelpWidth:()=>le.stdout.isTTY?le.stdout.columns:void 0,getErrHelpWidth:()=>le.stderr.isTTY?le.stderr.columns:void 0,outputError:(t,o)=>o(t)},this._hidden=!1,this._hasHelpOption=!0,this._helpFlags="-h, --help",this._helpDescription="display help for command",this._helpShortFlag="-h",this._helpLongFlag="--help",this._addImplicitHelpCommand=void 0,this._helpCommandName="help",this._helpCommandnameAndArgs="help [command]",this._helpCommandDescription="display help for command",this._helpConfiguration={}}copyInheritedSettings(r){return this._outputConfiguration=r._outputConfiguration,this._hasHelpOption=r._hasHelpOption,this._helpFlags=r._helpFlags,this._helpDescription=r._helpDescription,this._helpShortFlag=r._helpShortFlag,this._helpLongFlag=r._helpLongFlag,this._helpCommandName=r._helpCommandName,this._helpCommandnameAndArgs=r._helpCommandnameAndArgs,this._helpCommandDescription=r._helpCommandDescription,this._helpConfiguration=r._helpConfiguration,this._exitCallback=r._exitCallback,this._storeOptionsAsProperties=r._storeOptionsAsProperties,this._combineFlagAndOptionalValue=r._combineFlagAndOptionalValue,this._allowExcessArguments=r._allowExcessArguments,this._enablePositionalOptions=r._enablePositionalOptions,this._showHelpAfterError=r._showHelpAfterError,this._showSuggestionAfterError=r._showSuggestionAfterError,this}command(r,t,o){let u=t,a=o;typeof u=="object"&&u!==null&&(a=u,u=null),a=a||{};let[,l,f]=r.match(/([^ ]+) *(.*)/),p=this.createCommand(l);return u&&(p.description(u),p._executableHandler=!0),a.isDefault&&(this._defaultCommandName=p._name),p._hidden=!!(a.noHelp||a.hidden),p._executableFile=a.executableFile||null,f&&p.arguments(f),this.commands.push(p),p.parent=this,p.copyInheritedSettings(this),u?this:p}createCommand(r){return new e(r)}createHelp(){return Object.assign(new ex,this.configureHelp())}configureHelp(r){return r===void 0?this._helpConfiguration:(this._helpConfiguration=r,this)}configureOutput(r){return r===void 0?this._outputConfiguration:(Object.assign(this._outputConfiguration,r),this)}showHelpAfterError(r=!0){return typeof r!="string"&&(r=!!r),this._showHelpAfterError=r,this}showSuggestionAfterError(r=!0){return this._showSuggestionAfterError=!!r,this}addCommand(r,t){if(!r._name)throw new Error(`Command passed to .addCommand() must have a name
- specify the name in Command constructor or using .name()`);return t=t||{},t.isDefault&&(this._defaultCommandName=r._name),(t.noHelp||t.hidden)&&(r._hidden=!0),this.commands.push(r),r.parent=this,this}createArgument(r,t){return new Xb(r,t)}argument(r,t,o,u){let a=this.createArgument(r,t);return typeof o=="function"?a.default(u).argParser(o):a.default(o),this.addArgument(a),this}arguments(r){return r.split(/ +/).forEach(t=>{this.argument(t)}),this}addArgument(r){let t=this._args.slice(-1)[0];if(t&&t.variadic)throw new Error(`only the last argument can be variadic '${t.name()}'`);if(r.required&&r.defaultValue!==void 0&&r.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${r.name()}'`);return this._args.push(r),this}addHelpCommand(r,t){return r===!1?this._addImplicitHelpCommand=!1:(this._addImplicitHelpCommand=!0,typeof r=="string"&&(this._helpCommandName=r.split(" ")[0],this._helpCommandnameAndArgs=r),this._helpCommandDescription=t||this._helpCommandDescription),this}_hasImplicitHelpCommand(){return this._addImplicitHelpCommand===void 0?this.commands.length&&!this._actionHandler&&!this._findCommand("help"):this._addImplicitHelpCommand}hook(r,t){let o=["preSubcommand","preAction","postAction"];if(!o.includes(r))throw new Error(`Unexpected value for event passed to hook : '${r}'.
Expecting one of '${o.join("', '")}'`);return this._lifeCycleHooks[r]?this._lifeCycleHooks[r].push(t):this._lifeCycleHooks[r]=[t],this}exitOverride(r){return r?this._exitCallback=r:this._exitCallback=t=>{if(t.code!=="commander.executeSubCommandAsync")throw t},this}_exit(r,t,o){this._exitCallback&&this._exitCallback(new Rs(r,t,o)),le.exit(r)}action(r){let t=o=>{let u=this._args.length,a=o.slice(0,u);return this._storeOptionsAsProperties?a[u]=this:a[u]=this.opts(),a.push(this),r.apply(this,a)};return this._actionHandler=t,this}createOption(r,t){return new Zf(r,t)}addOption(r){let t=r.name(),o=r.attributeName();if(r.negate){let a=r.long.replace(/^--no-/,"--");this._findOption(a)||this.setOptionValueWithSource(o,r.defaultValue===void 0?!0:r.defaultValue,"default")}else r.defaultValue!==void 0&&this.setOptionValueWithSource(o,r.defaultValue,"default");this.options.push(r);let u=(a,l,f)=>{a==null&&r.presetArg!==void 0&&(a=r.presetArg);let p=this.getOptionValue(o);if(a!==null&&r.parseArg)try{a=r.parseArg(a,p)}catch(g){if(g.code==="commander.invalidArgument"){let y=`${l} ${g.message}`;this.error(y,{exitCode:g.exitCode,code:g.code})}throw g}else a!==null&&r.variadic&&(a=r._concatValue(a,p));a==null&&(r.negate?a=!1:r.isBoolean()||r.optional?a=!0:a=""),this.setOptionValueWithSource(o,a,f)};return this.on("option:"+t,a=>{let l=`error: option '${r.flags}' argument '${a}' is invalid.`;u(a,l,"cli")}),r.envVar&&this.on("optionEnv:"+t,a=>{let l=`error: option '${r.flags}' value '${a}' from env '${r.envVar}' is invalid.`;u(a,l,"env")}),this}_optionEx(r,t,o,u,a){if(typeof t=="object"&&t instanceof Zf)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let l=this.createOption(t,o);if(l.makeOptionMandatory(!!r.mandatory),typeof u=="function")l.default(a).argParser(u);else if(u instanceof RegExp){let f=u;u=(p,g)=>{let y=f.exec(p);return y?y[0]:g},l.default(a).argParser(u)}else l.default(u);return this.addOption(l)}option(r,t,o,u){return this._optionEx({},r,t,o,u)}requiredOption(r,t,o,u){return this._optionEx({mandatory:!0},r,t,o,u)}combineFlagAndOptionalValue(r=!0){return this._combineFlagAndOptionalValue=!!r,this}allowUnknownOption(r=!0){return this._allowUnknownOption=!!r,this}allowExcessArguments(r=!0){return this._allowExcessArguments=!!r,this}enablePositionalOptions(r=!0){return this._enablePositionalOptions=!!r,this}passThroughOptions(r=!0){if(this._passThroughOptions=!!r,this.parent&&r&&!this.parent._enablePositionalOptions)throw new Error("passThroughOptions can not be used without turning on enablePositionalOptions for parent command(s)");return this}storeOptionsAsProperties(r=!0){if(this._storeOptionsAsProperties=!!r,this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");return this}getOptionValue(r){return this._storeOptionsAsProperties?this[r]:this._optionValues[r]}setOptionValue(r,t){return this._storeOptionsAsProperties?this[r]=t:this._optionValues[r]=t,this}setOptionValueWithSource(r,t,o){return this.setOptionValue(r,t),this._optionValueSources[r]=o,this}getOptionValueSource(r){return this._optionValueSources[r]}_prepareUserArgs(r,t){if(r!==void 0&&!Array.isArray(r))throw new Error("first parameter to parse must be array or undefined");t=t||{},r===void 0&&(r=le.argv,le.versions&&le.versions.electron&&(t.from="electron")),this.rawArgs=r.slice();let o;switch(t.from){case void 0:case"node":this._scriptPath=r[1],o=r.slice(2);break;case"electron":le.defaultApp?(this._scriptPath=r[1],o=r.slice(2)):o=r.slice(1);break;case"user":o=r.slice(0);break;default:throw new Error(`unexpected parse option { from: '${t.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",o}parse(r,t){let o=this._prepareUserArgs(r,t);return this._parseCommand([],o),this}async parseAsync(r,t){let o=this._prepareUserArgs(r,t);return await this._parseCommand([],o),this}_executeSubCommand(r,t){t=t.slice();let o=!1,u=[".js",".ts",".tsx",".mjs",".cjs"];function a(y,w){let A=Dn.resolve(y,w);if(Fs.existsSync(A))return A;if(u.includes(Dn.extname(w)))return;let S=u.find(C=>Fs.existsSync(`${A}${C}`));if(S)return`${A}${S}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let l=r._executableFile||`${this._name}-${r._name}`,f=this._executableDir||"";if(this._scriptPath){let y;try{y=Fs.realpathSync(this._scriptPath)}catch{y=this._scriptPath}f=Dn.resolve(Dn.dirname(y),f)}if(f){let y=a(f,l);if(!y&&!r._executableFile&&this._scriptPath){let w=Dn.basename(this._scriptPath,Dn.extname(this._scriptPath));w!==this._name&&(y=a(f,`${w}-${r._name}`))}l=y||l}o=u.includes(Dn.extname(l));let p;le.platform!=="win32"?o?(t.unshift(l),t=eh(le.execArgv).concat(t),p=Ts.spawn(le.argv[0],t,{stdio:"inherit"})):p=Ts.spawn(l,t,{stdio:"inherit"}):(t.unshift(l),t=eh(le.execArgv).concat(t),p=Ts.spawn(le.execPath,t,{stdio:"inherit"})),p.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(w=>{le.on(w,()=>{p.killed===!1&&p.exitCode===null&&p.kill(w)})});let g=this._exitCallback;g?p.on("close",()=>{g(new Rs(le.exitCode||0,"commander.executeSubCommandAsync","(close)"))}):p.on("close",le.exit.bind(le)),p.on("error",y=>{if(y.code==="ENOENT"){let w=f?`searched for local subcommand relative to directory '${f}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",A=`'${l}' does not exist
- if '${r._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
- if the default executable name is not suitable, use the executableFile option to supply a custom name or path
- ${w}`;throw new Error(A)}else if(y.code==="EACCES")throw new Error(`'${l}' not executable`);if(!g)le.exit(1);else{let w=new Rs(1,"commander.executeSubCommandAsync","(error)");w.nestedError=y,g(w)}}),this.runningCommand=p}_dispatchSubcommand(r,t,o){let u=this._findCommand(r);u||this.help({error:!0});let a;return a=this._chainOrCallSubCommandHook(a,u,"preSubcommand"),a=this._chainOrCall(a,()=>{if(u._executableHandler)this._executeSubCommand(u,t.concat(o));else return u._parseCommand(t,o)}),a}_checkNumberOfArguments(){this._args.forEach((r,t)=>{r.required&&this.args[t]==null&&this.missingArgument(r.name())}),!(this._args.length>0&&this._args[this._args.length-1].variadic)&&this.args.length>this._args.length&&this._excessArguments(this.args)}_processArguments(){let r=(o,u,a)=>{let l=u;if(u!==null&&o.parseArg)try{l=o.parseArg(u,a)}catch(f){if(f.code==="commander.invalidArgument"){let p=`error: command-argument value '${u}' is invalid for argument '${o.name()}'. ${f.message}`;this.error(p,{exitCode:f.exitCode,code:f.code})}throw f}return l};this._checkNumberOfArguments();let t=[];this._args.forEach((o,u)=>{let a=o.defaultValue;o.variadic?u<this.args.length?(a=this.args.slice(u),o.parseArg&&(a=a.reduce((l,f)=>r(o,f,l),o.defaultValue))):a===void 0&&(a=[]):u<this.args.length&&(a=this.args[u],o.parseArg&&(a=r(o,a,o.defaultValue))),t[u]=a}),this.processedArgs=t}_chainOrCall(r,t){return r&&r.then&&typeof r.then=="function"?r.then(()=>t()):t()}_chainOrCallHooks(r,t){let o=r,u=[];return co(this).reverse().filter(a=>a._lifeCycleHooks[t]!==void 0).forEach(a=>{a._lifeCycleHooks[t].forEach(l=>{u.push({hookedCommand:a,callback:l})})}),t==="postAction"&&u.reverse(),u.forEach(a=>{o=this._chainOrCall(o,()=>a.callback(a.hookedCommand,this))}),o}_chainOrCallSubCommandHook(r,t,o){let u=r;return this._lifeCycleHooks[o]!==void 0&&this._lifeCycleHooks[o].forEach(a=>{u=this._chainOrCall(u,()=>a(this,t))}),u}_parseCommand(r,t){let o=this.parseOptions(t);if(this._parseOptionsEnv(),this._parseOptionsImplied(),r=r.concat(o.operands),t=o.unknown,this.args=r.concat(t),r&&this._findCommand(r[0]))return this._dispatchSubcommand(r[0],r.slice(1),t);if(this._hasImplicitHelpCommand()&&r[0]===this._helpCommandName)return r.length===1&&this.help(),this._dispatchSubcommand(r[1],[],[this._helpLongFlag]);if(this._defaultCommandName)return Qf(this,t),this._dispatchSubcommand(this._defaultCommandName,r,t);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),Qf(this,o.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let u=()=>{o.unknown.length>0&&this.unknownOption(o.unknown[0])},a=`command:${this.name()}`;if(this._actionHandler){u(),this._processArguments();let l;return l=this._chainOrCallHooks(l,"preAction"),l=this._chainOrCall(l,()=>this._actionHandler(this.processedArgs)),this.parent&&(l=this._chainOrCall(l,()=>{this.parent.emit(a,r,t)})),l=this._chainOrCallHooks(l,"postAction"),l}if(this.parent&&this.parent.listenerCount(a))u(),this._processArguments(),this.parent.emit(a,r,t);else if(r.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",r,t);this.listenerCount("command:*")?this.emit("command:*",r,t):this.commands.length?this.unknownCommand():(u(),this._processArguments())}else this.commands.length?(u(),this.help({error:!0})):(u(),this._processArguments())}_findCommand(r){if(r)return this.commands.find(t=>t._name===r||t._aliases.includes(r))}_findOption(r){return this.options.find(t=>t.is(r))}_checkForMissingMandatoryOptions(){for(let r=this;r;r=r.parent)r.options.forEach(t=>{t.mandatory&&r.getOptionValue(t.attributeName())===void 0&&r.missingMandatoryOptionValue(t)})}_checkForConflictingLocalOptions(){let r=this.options.filter(o=>{let u=o.attributeName();return this.getOptionValue(u)===void 0?!1:this.getOptionValueSource(u)!=="default"});r.filter(o=>o.conflictsWith.length>0).forEach(o=>{let u=r.find(a=>o.conflictsWith.includes(a.attributeName()));u&&this._conflictingOption(o,u)})}_checkForConflictingOptions(){for(let r=this;r;r=r.parent)r._checkForConflictingLocalOptions()}parseOptions(r){let t=[],o=[],u=t,a=r.slice();function l(p){return p.length>1&&p[0]==="-"}let f=null;for(;a.length;){let p=a.shift();if(p==="--"){u===o&&u.push(p),u.push(...a);break}if(f&&!l(p)){this.emit(`option:${f.name()}`,p);continue}if(f=null,l(p)){let g=this._findOption(p);if(g){if(g.required){let y=a.shift();y===void 0&&this.optionMissingArgument(g),this.emit(`option:${g.name()}`,y)}else if(g.optional){let y=null;a.length>0&&!l(a[0])&&(y=a.shift()),this.emit(`option:${g.name()}`,y)}else this.emit(`option:${g.name()}`);f=g.variadic?g:null;continue}}if(p.length>2&&p[0]==="-"&&p[1]!=="-"){let g=this._findOption(`-${p[1]}`);if(g){g.required||g.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${g.name()}`,p.slice(2)):(this.emit(`option:${g.name()}`),a.unshift(`-${p.slice(2)}`));continue}}if(/^--[^=]+=/.test(p)){let g=p.indexOf("="),y=this._findOption(p.slice(0,g));if(y&&(y.required||y.optional)){this.emit(`option:${y.name()}`,p.slice(g+1));continue}}if(l(p)&&(u=o),(this._enablePositionalOptions||this._passThroughOptions)&&t.length===0&&o.length===0){if(this._findCommand(p)){t.push(p),a.length>0&&o.push(...a);break}else if(p===this._helpCommandName&&this._hasImplicitHelpCommand()){t.push(p),a.length>0&&t.push(...a);break}else if(this._defaultCommandName){o.push(p),a.length>0&&o.push(...a);break}}if(this._passThroughOptions){u.push(p),a.length>0&&u.push(...a);break}u.push(p)}return{operands:t,unknown:o}}opts(){if(this._storeOptionsAsProperties){let r={},t=this.options.length;for(let o=0;o<t;o++){let u=this.options[o].attributeName();r[u]=u===this._versionOptionName?this._version:this[u]}return r}return this._optionValues}optsWithGlobals(){return co(this).reduce((r,t)=>Object.assign(r,t.opts()),{})}error(r,t){this._outputConfiguration.outputError(`${r}
`,this._outputConfiguration.writeErr),typeof this._showHelpAfterError=="string"?this._outputConfiguration.writeErr(`${this._showHelpAfterError}
`):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
`),this.outputHelp({error:!0}));let o=t||{},u=o.exitCode||1,a=o.code||"commander.error";this._exit(u,a,r)}_parseOptionsEnv(){this.options.forEach(r=>{if(r.envVar&&r.envVar in le.env){let t=r.attributeName();(this.getOptionValue(t)===void 0||["default","config","env"].includes(this.getOptionValueSource(t)))&&(r.required||r.optional?this.emit(`optionEnv:${r.name()}`,le.env[r.envVar]):this.emit(`optionEnv:${r.name()}`))}})}_parseOptionsImplied(){let r=new rx(this.options),t=o=>this.getOptionValue(o)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(o));this.options.filter(o=>o.implied!==void 0&&t(o.attributeName())&&r.valueFromOption(this.getOptionValue(o.attributeName()),o)).forEach(o=>{Object.keys(o.implied).filter(u=>!t(u)).forEach(u=>{this.setOptionValueWithSource(u,o.implied[u],"implied")})})}missingArgument(r){let t=`error: missing required argument '${r}'`;this.error(t,{code:"commander.missingArgument"})}optionMissingArgument(r){let t=`error: option '${r.flags}' argument missing`;this.error(t,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(r){let t=`error: required option '${r.flags}' not specified`;this.error(t,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(r,t){let o=l=>{let f=l.attributeName(),p=this.getOptionValue(f),g=this.options.find(w=>w.negate&&f===w.attributeName()),y=this.options.find(w=>!w.negate&&f===w.attributeName());return g&&(g.presetArg===void 0&&p===!1||g.presetArg!==void 0&&p===g.presetArg)?g:y||l},u=l=>{let f=o(l),p=f.attributeName();return this.getOptionValueSource(p)==="env"?`environment variable '${f.envVar}'`:`option '${f.flags}'`},a=`error: ${u(r)} cannot be used with ${u(t)}`;this.error(a,{code:"commander.conflictingOption"})}unknownOption(r){if(this._allowUnknownOption)return;let t="";if(r.startsWith("--")&&this._showSuggestionAfterError){let u=[],a=this;do{let l=a.createHelp().visibleOptions(a).filter(f=>f.long).map(f=>f.long);u=u.concat(l),a=a.parent}while(a&&!a._enablePositionalOptions);t=Xf(r,u)}let o=`error: unknown option '${r}'${t}`;this.error(o,{code:"commander.unknownOption"})}_excessArguments(r){if(this._allowExcessArguments)return;let t=this._args.length,o=t===1?"":"s",a=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${t} argument${o} but got ${r.length}.`;this.error(a,{code:"commander.excessArguments"})}unknownCommand(){let r=this.args[0],t="";if(this._showSuggestionAfterError){let u=[];this.createHelp().visibleCommands(this).forEach(a=>{u.push(a.name()),a.alias()&&u.push(a.alias())}),t=Xf(r,u)}let o=`error: unknown command '${r}'${t}`;this.error(o,{code:"commander.unknownCommand"})}version(r,t,o){if(r===void 0)return this._version;this._version=r,t=t||"-V, --version",o=o||"output the version number";let u=this.createOption(t,o);return this._versionOptionName=u.attributeName(),this.options.push(u),this.on("option:"+u.name(),()=>{this._outputConfiguration.writeOut(`${r}
`),this._exit(0,"commander.version",r)}),this}description(r,t){return r===void 0&&t===void 0?this._description:(this._description=r,t&&(this._argsDescription=t),this)}summary(r){return r===void 0?this._summary:(this._summary=r,this)}alias(r){if(r===void 0)return this._aliases[0];let t=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(t=this.commands[this.commands.length-1]),r===t._name)throw new Error("Command alias can't be the same as its name");return t._aliases.push(r),this}aliases(r){return r===void 0?this._aliases:(r.forEach(t=>this.alias(t)),this)}usage(r){if(r===void 0){if(this._usage)return this._usage;let t=this._args.map(o=>Qb(o));return[].concat(this.options.length||this._hasHelpOption?"[options]":[],this.commands.length?"[command]":[],this._args.length?t:[]).join(" ")}return this._usage=r,this}name(r){return r===void 0?this._name:(this._name=r,this)}nameFromFilename(r){return this._name=Dn.basename(r,Dn.extname(r)),this}executableDir(r){return r===void 0?this._executableDir:(this._executableDir=r,this)}helpInformation(r){let t=this.createHelp();return t.helpWidth===void 0&&(t.helpWidth=r&&r.error?this._outputConfiguration.getErrHelpWidth():this._outputConfiguration.getOutHelpWidth()),t.formatHelp(this,t)}_getHelpContext(r){r=r||{};let t={error:!!r.error},o;return t.error?o=u=>this._outputConfiguration.writeErr(u):o=u=>this._outputConfiguration.writeOut(u),t.write=r.write||o,t.command=this,t}outputHelp(r){let t;typeof r=="function"&&(t=r,r=void 0);let o=this._getHelpContext(r);co(this).reverse().forEach(a=>a.emit("beforeAllHelp",o)),this.emit("beforeHelp",o);let u=this.helpInformation(o);if(t&&(u=t(u),typeof u!="string"&&!Buffer.isBuffer(u)))throw new Error("outputHelp callback must return a string or a Buffer");o.write(u),this.emit(this._helpLongFlag),this.emit("afterHelp",o),co(this).forEach(a=>a.emit("afterAllHelp",o))}helpOption(r,t){if(typeof r=="boolean")return this._hasHelpOption=r,this;this._helpFlags=r||this._helpFlags,this._helpDescription=t||this._helpDescription;let o=nx(this._helpFlags);return this._helpShortFlag=o.shortFlag,this._helpLongFlag=o.longFlag,this}help(r){this.outputHelp(r);let t=le.exitCode||0;t===0&&r&&typeof r!="function"&&r.error&&(t=1),this._exit(t,"commander.help","(outputHelp)")}addHelpText(r,t){let o=["beforeAll","before","after","afterAll"];if(!o.includes(r))throw new Error(`Unexpected value for position to addHelpText.
Expecting one of '${o.join("', '")}'`);let u=`${r}Help`;return this.on(u,a=>{let l;typeof t=="function"?l=t({error:a.error,command:a.command}):l=t,l&&a.write(`${l}
`)}),this}};function Qf(e,r){e._hasHelpOption&&r.find(o=>o===e._helpLongFlag||o===e._helpShortFlag)&&(e.outputHelp(),e._exit(0,"commander.helpDisplayed","(outputHelp)"))}function eh(e){return e.map(r=>{if(!r.startsWith("--inspect"))return r;let t,o="127.0.0.1",u="9229",a;return(a=r.match(/^(--inspect(-brk)?)$/))!==null?t=a[1]:(a=r.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(t=a[1],/^\d+$/.test(a[3])?u=a[3]:o=a[3]):(a=r.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(t=a[1],o=a[3],u=a[4]),t&&u!=="0"?`${t}=${o}:${parseInt(u)+1}`:r})}function co(e){let r=[];for(let t=e;t;t=t.parent)r.push(t);return r}nh.Command=ks});var Ls=L((yn,oh)=>{var{Argument:tx}=ao(),{Command:th}=rh(),{CommanderError:ix,InvalidArgumentError:ih}=Ut(),{Help:ox}=Ss(),{Option:ux}=Is();yn=oh.exports=new th;yn.program=yn;yn.Argument=tx;yn.Command=th;yn.CommanderError=ix;yn.Help=ox;yn.InvalidArgumentError=ih;yn.InvalidOptionArgumentError=ih;yn.Option=ux});var sh=L((XS,uh)=>{"use strict";uh.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var Ps=L((QS,lh)=>{var Gt=sh(),ah={};for(let e of Object.keys(Gt))ah[Gt[e]]=e;var N={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};lh.exports=N;for(let e of Object.keys(N)){if(!("channels"in N[e]))throw new Error("missing channels property: "+e);if(!("labels"in N[e]))throw new Error("missing channel labels property: "+e);if(N[e].labels.length!==N[e].channels)throw new Error("channel and label counts mismatch: "+e);let{channels:r,labels:t}=N[e];delete N[e].channels,delete N[e].labels,Object.defineProperty(N[e],"channels",{value:r}),Object.defineProperty(N[e],"labels",{value:t})}N.rgb.hsl=function(e){let r=e[0]/255,t=e[1]/255,o=e[2]/255,u=Math.min(r,t,o),a=Math.max(r,t,o),l=a-u,f,p;a===u?f=0:r===a?f=(t-o)/l:t===a?f=2+(o-r)/l:o===a&&(f=4+(r-t)/l),f=Math.min(f*60,360),f<0&&(f+=360);let g=(u+a)/2;return a===u?p=0:g<=.5?p=l/(a+u):p=l/(2-a-u),[f,p*100,g*100]};N.rgb.hsv=function(e){let r,t,o,u,a,l=e[0]/255,f=e[1]/255,p=e[2]/255,g=Math.max(l,f,p),y=g-Math.min(l,f,p),w=function(A){return(g-A)/6/y+1/2};return y===0?(u=0,a=0):(a=y/g,r=w(l),t=w(f),o=w(p),l===g?u=o-t:f===g?u=1/3+r-o:p===g&&(u=2/3+t-r),u<0?u+=1:u>1&&(u-=1)),[u*360,a*100,g*100]};N.rgb.hwb=function(e){let r=e[0],t=e[1],o=e[2],u=N.rgb.hsl(e)[0],a=1/255*Math.min(r,Math.min(t,o));return o=1-1/255*Math.max(r,Math.max(t,o)),[u,a*100,o*100]};N.rgb.cmyk=function(e){let r=e[0]/255,t=e[1]/255,o=e[2]/255,u=Math.min(1-r,1-t,1-o),a=(1-r-u)/(1-u)||0,l=(1-t-u)/(1-u)||0,f=(1-o-u)/(1-u)||0;return[a*100,l*100,f*100,u*100]};function sx(e,r){return(e[0]-r[0])**2+(e[1]-r[1])**2+(e[2]-r[2])**2}N.rgb.keyword=function(e){let r=ah[e];if(r)return r;let t=1/0,o;for(let u of Object.keys(Gt)){let a=Gt[u],l=sx(e,a);l<t&&(t=l,o=u)}return o};N.keyword.rgb=function(e){return Gt[e]};N.rgb.xyz=function(e){let r=e[0]/255,t=e[1]/255,o=e[2]/255;r=r>.04045?((r+.055)/1.055)**2.4:r/12.92,t=t>.04045?((t+.055)/1.055)**2.4:t/12.92,o=o>.04045?((o+.055)/1.055)**2.4:o/12.92;let u=r*.4124+t*.3576+o*.1805,a=r*.2126+t*.7152+o*.0722,l=r*.0193+t*.1192+o*.9505;return[u*100,a*100,l*100]};N.rgb.lab=function(e){let r=N.rgb.xyz(e),t=r[0],o=r[1],u=r[2];t/=95.047,o/=100,u/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,o=o>.008856?o**(1/3):7.787*o+16/116,u=u>.008856?u**(1/3):7.787*u+16/116;let a=116*o-16,l=500*(t-o),f=200*(o-u);return[a,l,f]};N.hsl.rgb=function(e){let r=e[0]/360,t=e[1]/100,o=e[2]/100,u,a,l;if(t===0)return l=o*255,[l,l,l];o<.5?u=o*(1+t):u=o+t-o*t;let f=2*o-u,p=[0,0,0];for(let g=0;g<3;g++)a=r+1/3*-(g-1),a<0&&a++,a>1&&a--,6*a<1?l=f+(u-f)*6*a:2*a<1?l=u:3*a<2?l=f+(u-f)*(2/3-a)*6:l=f,p[g]=l*255;return p};N.hsl.hsv=function(e){let r=e[0],t=e[1]/100,o=e[2]/100,u=t,a=Math.max(o,.01);o*=2,t*=o<=1?o:2-o,u*=a<=1?a:2-a;let l=(o+t)/2,f=o===0?2*u/(a+u):2*t/(o+t);return[r,f*100,l*100]};N.hsv.rgb=function(e){let r=e[0]/60,t=e[1]/100,o=e[2]/100,u=Math.floor(r)%6,a=r-Math.floor(r),l=255*o*(1-t),f=255*o*(1-t*a),p=255*o*(1-t*(1-a));switch(o*=255,u){case 0:return[o,p,l];case 1:return[f,o,l];case 2:return[l,o,p];case 3:return[l,f,o];case 4:return[p,l,o];case 5:return[o,l,f]}};N.hsv.hsl=function(e){let r=e[0],t=e[1]/100,o=e[2]/100,u=Math.max(o,.01),a,l;l=(2-t)*o;let f=(2-t)*u;return a=t*u,a/=f<=1?f:2-f,a=a||0,l/=2,[r,a*100,l*100]};N.hwb.rgb=function(e){let r=e[0]/360,t=e[1]/100,o=e[2]/100,u=t+o,a;u>1&&(t/=u,o/=u);let l=Math.floor(6*r),f=1-o;a=6*r-l,(l&1)!==0&&(a=1-a);let p=t+a*(f-t),g,y,w;switch(l){default:case 6:case 0:g=f,y=p,w=t;break;case 1:g=p,y=f,w=t;break;case 2:g=t,y=f,w=p;break;case 3:g=t,y=p,w=f;break;case 4:g=p,y=t,w=f;break;case 5:g=f,y=t,w=p;break}return[g*255,y*255,w*255]};N.cmyk.rgb=function(e){let r=e[0]/100,t=e[1]/100,o=e[2]/100,u=e[3]/100,a=1-Math.min(1,r*(1-u)+u),l=1-Math.min(1,t*(1-u)+u),f=1-Math.min(1,o*(1-u)+u);return[a*255,l*255,f*255]};N.xyz.rgb=function(e){let r=e[0]/100,t=e[1]/100,o=e[2]/100,u,a,l;return u=r*3.2406+t*-1.5372+o*-.4986,a=r*-.9689+t*1.8758+o*.0