apiyaml
Version:
27 lines • 322 kB
JavaScript
#!/usr/bin/env node
"use strict";var rC=Object.create;var fa=Object.defineProperty;var iC=Object.getOwnPropertyDescriptor;var sC=Object.getOwnPropertyNames;var aC=Object.getPrototypeOf,oC=Object.prototype.hasOwnProperty;var C=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Zd=(t,e)=>{for(var n in e)fa(t,n,{get:e[n],enumerable:!0})},Yd=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of sC(e))!oC.call(t,a)&&a!==n&&fa(t,a,{get:()=>e[a],enumerable:!(i=iC(e,a))||i.enumerable});return t};var Ne=(t,e,n)=>(n=t!=null?rC(aC(t)):{},Yd(e||!t||!t.__esModule?fa(n,"default",{value:t,enumerable:!0}):n,t)),uC=t=>Yd(fa({},"__esModule",{value:!0}),t);var Ai=C(rl=>{var ha=class extends Error{constructor(e,n,i){super(i),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=n,this.exitCode=e,this.nestedError=void 0}},nl=class extends ha{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};rl.CommanderError=ha;rl.InvalidArgumentError=nl});var da=C(sl=>{var{InvalidArgumentError:lC}=Ai(),il=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;break}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)?[e]:n.concat(e)}default(e,n){return this.defaultValue=e,this.defaultValueDescription=n,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(n,i)=>{if(!this.argChoices.includes(n))throw new lC(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(n,i):n},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function cC(t){let e=t.name()+(t.variadic===!0?"...":"");return t.required?"<"+e+">":"["+e+"]"}sl.Argument=il;sl.humanReadableArgName=cC});var ul=C(ol=>{var{humanReadableArgName:fC}=da(),al=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){let n=e.commands.filter(a=>!a._hidden),i=e._getHelpCommand();return i&&!i._hidden&&n.push(i),this.sortSubcommands&&n.sort((a,o)=>a.name().localeCompare(o.name())),n}compareOptions(e,n){let i=a=>a.short?a.short.replace(/^-/,""):a.long.replace(/^--/,"");return i(e).localeCompare(i(n))}visibleOptions(e){let n=e.options.filter(a=>!a.hidden),i=e._getHelpOption();if(i&&!i.hidden){let a=i.short&&e._findOption(i.short),o=i.long&&e._findOption(i.long);!a&&!o?n.push(i):i.long&&!o?n.push(e.createOption(i.long,i.description)):i.short&&!a&&n.push(e.createOption(i.short,i.description))}return this.sortOptions&&n.sort(this.compareOptions),n}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let n=[];for(let i=e.parent;i;i=i.parent){let a=i.options.filter(o=>!o.hidden);n.push(...a)}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(n=>n.description)?e.registeredArguments:[]}subcommandTerm(e){let n=e.registeredArguments.map(i=>fC(i)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(n?" "+n:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,n){return n.visibleCommands(e).reduce((i,a)=>Math.max(i,this.displayWidth(n.styleSubcommandTerm(n.subcommandTerm(a)))),0)}longestOptionTermLength(e,n){return n.visibleOptions(e).reduce((i,a)=>Math.max(i,this.displayWidth(n.styleOptionTerm(n.optionTerm(a)))),0)}longestGlobalOptionTermLength(e,n){return n.visibleGlobalOptions(e).reduce((i,a)=>Math.max(i,this.displayWidth(n.styleOptionTerm(n.optionTerm(a)))),0)}longestArgumentTermLength(e,n){return n.visibleArguments(e).reduce((i,a)=>Math.max(i,this.displayWidth(n.styleArgumentTerm(n.argumentTerm(a)))),0)}commandUsage(e){let n=e._name;e._aliases[0]&&(n=n+"|"+e._aliases[0]);let i="";for(let a=e.parent;a;a=a.parent)i=a.name()+" "+i;return i+n+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let n=[];if(e.argChoices&&n.push(`choices: ${e.argChoices.map(i=>JSON.stringify(i)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&n.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&n.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&n.push(`env: ${e.envVar}`),n.length>0){let i=`(${n.join(", ")})`;return e.description?`${e.description} ${i}`:i}return e.description}argumentDescription(e){let n=[];if(e.argChoices&&n.push(`choices: ${e.argChoices.map(i=>JSON.stringify(i)).join(", ")}`),e.defaultValue!==void 0&&n.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),n.length>0){let i=`(${n.join(", ")})`;return e.description?`${e.description} ${i}`:i}return e.description}formatItemList(e,n,i){return n.length===0?[]:[i.styleTitle(e),...n,""]}groupItems(e,n,i){let a=new Map;return e.forEach(o=>{let l=i(o);a.has(l)||a.set(l,[])}),n.forEach(o=>{let l=i(o);a.has(l)||a.set(l,[]),a.get(l).push(o)}),a}formatHelp(e,n){let i=n.padWidth(e,n),a=n.helpWidth??80;function o(_,O){return n.formatItem(_,i,O,n)}let l=[`${n.styleTitle("Usage:")} ${n.styleUsage(n.commandUsage(e))}`,""],f=n.commandDescription(e);f.length>0&&(l=l.concat([n.boxWrap(n.styleCommandDescription(f),a),""]));let d=n.visibleArguments(e).map(_=>o(n.styleArgumentTerm(n.argumentTerm(_)),n.styleArgumentDescription(n.argumentDescription(_))));if(l=l.concat(this.formatItemList("Arguments:",d,n)),this.groupItems(e.options,n.visibleOptions(e),_=>_.helpGroupHeading??"Options:").forEach((_,O)=>{let T=_.map(L=>o(n.styleOptionTerm(n.optionTerm(L)),n.styleOptionDescription(n.optionDescription(L))));l=l.concat(this.formatItemList(O,T,n))}),n.showGlobalOptions){let _=n.visibleGlobalOptions(e).map(O=>o(n.styleOptionTerm(n.optionTerm(O)),n.styleOptionDescription(n.optionDescription(O))));l=l.concat(this.formatItemList("Global Options:",_,n))}return this.groupItems(e.commands,n.visibleCommands(e),_=>_.helpGroup()||"Commands:").forEach((_,O)=>{let T=_.map(L=>o(n.styleSubcommandTerm(n.subcommandTerm(L)),n.styleSubcommandDescription(n.subcommandDescription(L))));l=l.concat(this.formatItemList(O,T,n))}),l.join(`
`)}displayWidth(e){return Jd(e).length}styleTitle(e){return e}styleUsage(e){return e.split(" ").map(n=>n==="[options]"?this.styleOptionText(n):n==="[command]"?this.styleSubcommandText(n):n[0]==="["||n[0]==="<"?this.styleArgumentText(n):this.styleCommandText(n)).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(n=>n==="[options]"?this.styleOptionText(n):n[0]==="["||n[0]==="<"?this.styleArgumentText(n):this.styleSubcommandText(n)).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,i,a){let l=" ".repeat(2);if(!i)return l+e;let f=e.padEnd(n+e.length-a.displayWidth(e)),d=2,v=(this.helpWidth??80)-n-d-2,_;return v<this.minWidthToWrap||a.preformatted(i)?_=i:_=a.boxWrap(i,v).replace(/\n/g,`
`+" ".repeat(n+d)),l+f+" ".repeat(d)+_.replace(/\n/g,`
${l}`)}boxWrap(e,n){if(n<this.minWidthToWrap)return e;let i=e.split(/\r\n|\n/),a=/[\s]*[^\s]+/g,o=[];return i.forEach(l=>{let f=l.match(a);if(f===null){o.push("");return}let d=[f.shift()],m=this.displayWidth(d[0]);f.forEach(v=>{let _=this.displayWidth(v);if(m+_<=n){d.push(v),m+=_;return}o.push(d.join(""));let O=v.trimStart();d=[O],m=this.displayWidth(O)}),o.push(d.join(""))}),o.join(`
`)}};function Jd(t){let e=/\x1b\[\d*(;\d*)*m/g;return t.replace(e,"")}ol.Help=al;ol.stripColor=Jd});var hl=C(fl=>{var{InvalidArgumentError:hC}=Ai(),ll=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;let i=dC(e);this.short=i.shortFlag,this.long=i.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 typeof e=="string"&&(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)?[e]:n.concat(e)}choices(e){return this.argChoices=e.slice(),this.parseArg=(n,i)=>{if(!this.argChoices.includes(n))throw new hC(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(n,i):n},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?Qd(this.name().replace(/^no-/,"")):Qd(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}},cl=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(n=>{n.negate?this.negativeOptions.set(n.attributeName(),n):this.positiveOptions.set(n.attributeName(),n)}),this.negativeOptions.forEach((n,i)=>{this.positiveOptions.has(i)&&this.dualOptions.add(i)})}valueFromOption(e,n){let i=n.attributeName();if(!this.dualOptions.has(i))return!0;let a=this.negativeOptions.get(i).presetArg,o=a!==void 0?a:!1;return n.negate===(o===e)}};function Qd(t){return t.split("-").reduce((e,n)=>e+n[0].toUpperCase()+n.slice(1))}function dC(t){let e,n,i=/^-[^-]$/,a=/^--[^-]/,o=t.split(/[ |,]+/).concat("guard");if(i.test(o[0])&&(e=o.shift()),a.test(o[0])&&(n=o.shift()),!e&&i.test(o[0])&&(e=o.shift()),!e&&a.test(o[0])&&(e=n,n=o.shift()),o[0].startsWith("-")){let l=o[0],f=`option creation failed due to '${l}' in option flags '${t}'`;throw/^-[^-][^-]/.test(l)?new Error(`${f}
- a short flag is a single dash and a single character
- either use a single dash and a single character (for a short flag)
- or use a double dash for a long option (and can have two, like '--ws, --workspace')`):i.test(l)?new Error(`${f}
- too many short flags`):a.test(l)?new Error(`${f}
- too many long flags`):new Error(`${f}
- unrecognised flag format`)}if(e===void 0&&n===void 0)throw new Error(`option creation failed due to no flags found in '${t}'.`);return{shortFlag:e,longFlag:n}}fl.Option=ll;fl.DualOptions=cl});var ep=C(Xd=>{function pC(t,e){if(Math.abs(t.length-e.length)>3)return Math.max(t.length,e.length);let n=[];for(let i=0;i<=t.length;i++)n[i]=[i];for(let i=0;i<=e.length;i++)n[0][i]=i;for(let i=1;i<=e.length;i++)for(let a=1;a<=t.length;a++){let o=1;t[a-1]===e[i-1]?o=0:o=1,n[a][i]=Math.min(n[a-1][i]+1,n[a][i-1]+1,n[a-1][i-1]+o),a>1&&i>1&&t[a-1]===e[i-2]&&t[a-2]===e[i-1]&&(n[a][i]=Math.min(n[a][i],n[a-2][i-2]+1))}return n[t.length][e.length]}function mC(t,e){if(!e||e.length===0)return"";e=Array.from(new Set(e));let n=t.startsWith("--");n&&(t=t.slice(2),e=e.map(l=>l.slice(2)));let i=[],a=3,o=.4;return e.forEach(l=>{if(l.length<=1)return;let f=pC(t,l),d=Math.max(t.length,l.length);(d-f)/d>o&&(f<a?(a=f,i=[l]):f===a&&i.push(l))}),i.sort((l,f)=>l.localeCompare(f)),n&&(i=i.map(l=>`--${l}`)),i.length>1?`
(Did you mean one of ${i.join(", ")}?)`:i.length===1?`
(Did you mean ${i[0]}?)`:""}Xd.suggestSimilar=mC});var ip=C(yl=>{var gC=require("node:events").EventEmitter,dl=require("node:child_process"),Xt=require("node:path"),pa=require("node:fs"),de=require("node:process"),{Argument:yC,humanReadableArgName:_C}=da(),{CommanderError:pl}=Ai(),{Help:vC,stripColor:bC}=ul(),{Option:tp,DualOptions:wC}=hl(),{suggestSimilar:np}=ep(),ml=class t extends gC{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:n=>de.stdout.write(n),writeErr:n=>de.stderr.write(n),outputError:(n,i)=>i(n),getOutHelpWidth:()=>de.stdout.isTTY?de.stdout.columns:void 0,getErrHelpWidth:()=>de.stderr.isTTY?de.stderr.columns:void 0,getOutHasColors:()=>gl()??(de.stdout.isTTY&&de.stdout.hasColors?.()),getErrHasColors:()=>gl()??(de.stderr.isTTY&&de.stderr.hasColors?.()),stripColor:n=>bC(n)},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(){let e=[];for(let n=this;n;n=n.parent)e.push(n);return e}command(e,n,i){let a=n,o=i;typeof a=="object"&&a!==null&&(o=a,a=null),o=o||{};let[,l,f]=e.match(/([^ ]+) *(.*)/),d=this.createCommand(l);return a&&(d.description(a),d._executableHandler=!0),o.isDefault&&(this._defaultCommandName=d._name),d._hidden=!!(o.noHelp||o.hidden),d._executableFile=o.executableFile||null,f&&d.arguments(f),this._registerCommand(d),d.parent=this,d.copyInheritedSettings(this),a?this:d}createCommand(e){return new t(e)}createHelp(){return Object.assign(new vC,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(this._outputConfiguration=Object.assign({},this._outputConfiguration,e),this)}showHelpAfterError(e=!0){return typeof e!="string"&&(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
- specify the name in Command constructor or using .name()`);return n=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 yC(e,n)}argument(e,n,i,a){let o=this.createArgument(e,n);return typeof i=="function"?o.default(a).argParser(i):o.default(i),this.addArgument(o),this}arguments(e){return e.trim().split(/ +/).forEach(n=>{this.argument(n)}),this}addArgument(e){let 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&&e.defaultValue!==void 0&&e.parseArg===void 0)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(typeof e=="boolean")return this._addImplicitHelpCommand=e,e&&this._defaultCommandGroup&&this._initCommandGroup(this._getHelpCommand()),this;let i=e??"help [command]",[,a,o]=i.match(/([^ ]+) *(.*)/),l=n??"display help for command",f=this.createCommand(a);return f.helpOption(!1),o&&f.arguments(o),l&&f.description(l),this._addImplicitHelpCommand=!0,this._helpCommand=f,(e||n)&&this._initCommandGroup(f),this}addHelpCommand(e,n){return typeof e!="object"?(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"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(e,n){let i=["preSubcommand","preAction","postAction"];if(!i.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'.
Expecting one of '${i.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(n):this._lifeCycleHooks[e]=[n],this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=n=>{if(n.code!=="commander.executeSubCommandAsync")throw n},this}_exit(e,n,i){this._exitCallback&&this._exitCallback(new pl(e,n,i)),de.exit(e)}action(e){let n=i=>{let a=this.registeredArguments.length,o=i.slice(0,a);return this._storeOptionsAsProperties?o[a]=this:o[a]=this.opts(),o.push(this),e.apply(this,o)};return this._actionHandler=n,this}createOption(e,n){return new tp(e,n)}_callParseArg(e,n,i,a){try{return e.parseArg(n,i)}catch(o){if(o.code==="commander.invalidArgument"){let l=`${a} ${o.message}`;this.error(l,{exitCode:o.exitCode,code:o.code})}throw o}}_registerOption(e){let n=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(n){let i=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 '${i}'
- already used by option '${n.flags}'`)}this._initOptionGroup(e),this.options.push(e)}_registerCommand(e){let n=a=>[a.name()].concat(a.aliases()),i=n(e).find(a=>this._findCommand(a));if(i){let a=n(this._findCommand(i)).join("|"),o=n(e).join("|");throw new Error(`cannot add command '${o}' as already have command '${a}'`)}this._initCommandGroup(e),this.commands.push(e)}addOption(e){this._registerOption(e);let n=e.name(),i=e.attributeName();if(e.negate){let o=e.long.replace(/^--no-/,"--");this._findOption(o)||this.setOptionValueWithSource(i,e.defaultValue===void 0?!0:e.defaultValue,"default")}else e.defaultValue!==void 0&&this.setOptionValueWithSource(i,e.defaultValue,"default");let a=(o,l,f)=>{o==null&&e.presetArg!==void 0&&(o=e.presetArg);let d=this.getOptionValue(i);o!==null&&e.parseArg?o=this._callParseArg(e,o,d,l):o!==null&&e.variadic&&(o=e._concatValue(o,d)),o==null&&(e.negate?o=!1:e.isBoolean()||e.optional?o=!0:o=""),this.setOptionValueWithSource(i,o,f)};return this.on("option:"+n,o=>{let l=`error: option '${e.flags}' argument '${o}' is invalid.`;a(o,l,"cli")}),e.envVar&&this.on("optionEnv:"+n,o=>{let l=`error: option '${e.flags}' value '${o}' from env '${e.envVar}' is invalid.`;a(o,l,"env")}),this}_optionEx(e,n,i,a,o){if(typeof n=="object"&&n instanceof tp)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let l=this.createOption(n,i);if(l.makeOptionMandatory(!!e.mandatory),typeof a=="function")l.default(o).argParser(a);else if(a instanceof RegExp){let f=a;a=(d,m)=>{let v=f.exec(d);return v?v[0]:m},l.default(o).argParser(a)}else l.default(a);return this.addOption(l)}option(e,n,i,a){return this._optionEx({},e,n,i,a)}requiredOption(e,n,i,a){return this._optionEx({mandatory:!0},e,n,i,a)}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,i){return this._storeOptionsAsProperties?this[e]=n:this._optionValues[e]=n,this._optionValueSources[e]=i,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let n;return this._getCommandAndAncestors().forEach(i=>{i.getOptionValueSource(e)!==void 0&&(n=i.getOptionValueSource(e))}),n}_prepareUserArgs(e,n){if(e!==void 0&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");if(n=n||{},e===void 0&&n.from===void 0){de.versions?.electron&&(n.from="electron");let a=de.execArgv??[];(a.includes("-e")||a.includes("--eval")||a.includes("-p")||a.includes("--print"))&&(n.from="eval")}e===void 0&&(e=de.argv),this.rawArgs=e.slice();let i;switch(n.from){case void 0:case"node":this._scriptPath=e[1],i=e.slice(2);break;case"electron":de.defaultApp?(this._scriptPath=e[1],i=e.slice(2)):i=e.slice(1);break;case"user":i=e.slice(0);break;case"eval":i=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",i}parse(e,n){this._prepareForParse();let i=this._prepareUserArgs(e,n);return this._parseCommand([],i),this}async parseAsync(e,n){this._prepareForParse();let i=this._prepareUserArgs(e,n);return await this._parseCommand([],i),this}_prepareForParse(){this._savedState===null?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.
- 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,i){if(pa.existsSync(e))return;let a=n?`searched for local subcommand relative to directory '${n}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",o=`'${e}' does not exist
- if '${i}' 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
- ${a}`;throw new Error(o)}_executeSubCommand(e,n){n=n.slice();let i=!1,a=[".js",".ts",".tsx",".mjs",".cjs"];function o(v,_){let O=Xt.resolve(v,_);if(pa.existsSync(O))return O;if(a.includes(Xt.extname(_)))return;let T=a.find(L=>pa.existsSync(`${O}${L}`));if(T)return`${O}${T}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let l=e._executableFile||`${this._name}-${e._name}`,f=this._executableDir||"";if(this._scriptPath){let v;try{v=pa.realpathSync(this._scriptPath)}catch{v=this._scriptPath}f=Xt.resolve(Xt.dirname(v),f)}if(f){let v=o(f,l);if(!v&&!e._executableFile&&this._scriptPath){let _=Xt.basename(this._scriptPath,Xt.extname(this._scriptPath));_!==this._name&&(v=o(f,`${_}-${e._name}`))}l=v||l}i=a.includes(Xt.extname(l));let d;de.platform!=="win32"?i?(n.unshift(l),n=rp(de.execArgv).concat(n),d=dl.spawn(de.argv[0],n,{stdio:"inherit"})):d=dl.spawn(l,n,{stdio:"inherit"}):(this._checkForMissingExecutable(l,f,e._name),n.unshift(l),n=rp(de.execArgv).concat(n),d=dl.spawn(de.execPath,n,{stdio:"inherit"})),d.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(_=>{de.on(_,()=>{d.killed===!1&&d.exitCode===null&&d.kill(_)})});let m=this._exitCallback;d.on("close",v=>{v=v??1,m?m(new pl(v,"commander.executeSubCommandAsync","(close)")):de.exit(v)}),d.on("error",v=>{if(v.code==="ENOENT")this._checkForMissingExecutable(l,f,e._name);else if(v.code==="EACCES")throw new Error(`'${l}' not executable`);if(!m)de.exit(1);else{let _=new pl(1,"commander.executeSubCommandAsync","(error)");_.nestedError=v,m(_)}}),this.runningCommand=d}_dispatchSubcommand(e,n,i){let a=this._findCommand(e);a||this.help({error:!0}),a._prepareForParse();let o;return o=this._chainOrCallSubCommandHook(o,a,"preSubcommand"),o=this._chainOrCall(o,()=>{if(a._executableHandler)this._executeSubCommand(a,n.concat(i));else return a._parseCommand(n,i)}),o}_dispatchHelpCommand(e){e||this.help();let 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&&this.args[n]==null&&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(){let e=(i,a,o)=>{let l=a;if(a!==null&&i.parseArg){let f=`error: command-argument value '${a}' is invalid for argument '${i.name()}'.`;l=this._callParseArg(i,a,o,f)}return l};this._checkNumberOfArguments();let n=[];this.registeredArguments.forEach((i,a)=>{let o=i.defaultValue;i.variadic?a<this.args.length?(o=this.args.slice(a),i.parseArg&&(o=o.reduce((l,f)=>e(i,f,l),i.defaultValue))):o===void 0&&(o=[]):a<this.args.length&&(o=this.args[a],i.parseArg&&(o=e(i,o,i.defaultValue))),n[a]=o}),this.processedArgs=n}_chainOrCall(e,n){return e&&e.then&&typeof e.then=="function"?e.then(()=>n()):n()}_chainOrCallHooks(e,n){let i=e,a=[];return this._getCommandAndAncestors().reverse().filter(o=>o._lifeCycleHooks[n]!==void 0).forEach(o=>{o._lifeCycleHooks[n].forEach(l=>{a.push({hookedCommand:o,callback:l})})}),n==="postAction"&&a.reverse(),a.forEach(o=>{i=this._chainOrCall(i,()=>o.callback(o.hookedCommand,this))}),i}_chainOrCallSubCommandHook(e,n,i){let a=e;return this._lifeCycleHooks[i]!==void 0&&this._lifeCycleHooks[i].forEach(o=>{a=this._chainOrCall(a,()=>o(this,n))}),a}_parseCommand(e,n){let i=this.parseOptions(n);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(i.operands),n=i.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&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(i.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let a=()=>{i.unknown.length>0&&this.unknownOption(i.unknown[0])},o=`command:${this.name()}`;if(this._actionHandler){a(),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(o,e,n)})),l=this._chainOrCallHooks(l,"postAction"),l}if(this.parent&&this.parent.listenerCount(o))a(),this._processArguments(),this.parent.emit(o,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():(a(),this._processArguments())}else this.commands.length?(a(),this.help({error:!0})):(a(),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&&e.getOptionValue(n.attributeName())===void 0&&e.missingMandatoryOptionValue(n)})})}_checkForConflictingLocalOptions(){let e=this.options.filter(i=>{let a=i.attributeName();return this.getOptionValue(a)===void 0?!1:this.getOptionValueSource(a)!=="default"});e.filter(i=>i.conflictsWith.length>0).forEach(i=>{let a=e.find(o=>i.conflictsWith.includes(o.attributeName()));a&&this._conflictingOption(i,a)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(e=>{e._checkForConflictingLocalOptions()})}parseOptions(e){let n=[],i=[],a=n,o=e.slice();function l(m){return m.length>1&&m[0]==="-"}let f=m=>/^-\d*\.?\d+(e[+-]?\d+)?$/.test(m)?!this._getCommandAndAncestors().some(v=>v.options.map(_=>_.short).some(_=>/^-\d$/.test(_))):!1,d=null;for(;o.length;){let m=o.shift();if(m==="--"){a===i&&a.push(m),a.push(...o);break}if(d&&(!l(m)||f(m))){this.emit(`option:${d.name()}`,m);continue}if(d=null,l(m)){let v=this._findOption(m);if(v){if(v.required){let _=o.shift();_===void 0&&this.optionMissingArgument(v),this.emit(`option:${v.name()}`,_)}else if(v.optional){let _=null;o.length>0&&(!l(o[0])||f(o[0]))&&(_=o.shift()),this.emit(`option:${v.name()}`,_)}else this.emit(`option:${v.name()}`);d=v.variadic?v:null;continue}}if(m.length>2&&m[0]==="-"&&m[1]!=="-"){let v=this._findOption(`-${m[1]}`);if(v){v.required||v.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${v.name()}`,m.slice(2)):(this.emit(`option:${v.name()}`),o.unshift(`-${m.slice(2)}`));continue}}if(/^--[^=]+=/.test(m)){let v=m.indexOf("="),_=this._findOption(m.slice(0,v));if(_&&(_.required||_.optional)){this.emit(`option:${_.name()}`,m.slice(v+1));continue}}if(a===n&&l(m)&&!(this.commands.length===0&&f(m))&&(a=i),(this._enablePositionalOptions||this._passThroughOptions)&&n.length===0&&i.length===0){if(this._findCommand(m)){n.push(m),o.length>0&&i.push(...o);break}else if(this._getHelpCommand()&&m===this._getHelpCommand().name()){n.push(m),o.length>0&&n.push(...o);break}else if(this._defaultCommandName){i.push(m),o.length>0&&i.push(...o);break}}if(this._passThroughOptions){a.push(m),o.length>0&&a.push(...o);break}a.push(m)}return{operands:n,unknown:i}}opts(){if(this._storeOptionsAsProperties){let e={},n=this.options.length;for(let i=0;i<n;i++){let a=this.options[i].attributeName();e[a]=a===this._versionOptionName?this._version:this[a]}return e}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((e,n)=>Object.assign(e,n.opts()),{})}error(e,n){this._outputConfiguration.outputError(`${e}
`,this._outputConfiguration.writeErr),typeof this._showHelpAfterError=="string"?this._outputConfiguration.writeErr(`${this._showHelpAfterError}
`):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
`),this.outputHelp({error:!0}));let i=n||{},a=i.exitCode||1,o=i.code||"commander.error";this._exit(a,o,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in de.env){let n=e.attributeName();(this.getOptionValue(n)===void 0||["default","config","env"].includes(this.getOptionValueSource(n)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,de.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new wC(this.options),n=i=>this.getOptionValue(i)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(i));this.options.filter(i=>i.implied!==void 0&&n(i.attributeName())&&e.valueFromOption(this.getOptionValue(i.attributeName()),i)).forEach(i=>{Object.keys(i.implied).filter(a=>!n(a)).forEach(a=>{this.setOptionValueWithSource(a,i.implied[a],"implied")})})}missingArgument(e){let n=`error: missing required argument '${e}'`;this.error(n,{code:"commander.missingArgument"})}optionMissingArgument(e){let n=`error: option '${e.flags}' argument missing`;this.error(n,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){let n=`error: required option '${e.flags}' not specified`;this.error(n,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,n){let i=l=>{let f=l.attributeName(),d=this.getOptionValue(f),m=this.options.find(_=>_.negate&&f===_.attributeName()),v=this.options.find(_=>!_.negate&&f===_.attributeName());return m&&(m.presetArg===void 0&&d===!1||m.presetArg!==void 0&&d===m.presetArg)?m:v||l},a=l=>{let f=i(l),d=f.attributeName();return this.getOptionValueSource(d)==="env"?`environment variable '${f.envVar}'`:`option '${f.flags}'`},o=`error: ${a(e)} cannot be used with ${a(n)}`;this.error(o,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let n="";if(e.startsWith("--")&&this._showSuggestionAfterError){let a=[],o=this;do{let l=o.createHelp().visibleOptions(o).filter(f=>f.long).map(f=>f.long);a=a.concat(l),o=o.parent}while(o&&!o._enablePositionalOptions);n=np(e,a)}let i=`error: unknown option '${e}'${n}`;this.error(i,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;let n=this.registeredArguments.length,i=n===1?"":"s",o=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${n} argument${i} but got ${e.length}.`;this.error(o,{code:"commander.excessArguments"})}unknownCommand(){let e=this.args[0],n="";if(this._showSuggestionAfterError){let a=[];this.createHelp().visibleCommands(this).forEach(o=>{a.push(o.name()),o.alias()&&a.push(o.alias())}),n=np(e,a)}let i=`error: unknown command '${e}'${n}`;this.error(i,{code:"commander.unknownCommand"})}version(e,n,i){if(e===void 0)return this._version;this._version=e,n=n||"-V, --version",i=i||"output the version number";let a=this.createOption(n,i);return this._versionOptionName=a.attributeName(),this._registerOption(a),this.on("option:"+a.name(),()=>{this._outputConfiguration.writeOut(`${e}
`),this._exit(0,"commander.version",e)}),this}description(e,n){return e===void 0&&n===void 0?this._description:(this._description=e,n&&(this._argsDescription=n),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let n=this;if(this.commands.length!==0&&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");let i=this.parent?._findCommand(e);if(i){let a=[i.name()].concat(i.aliases()).join("|");throw new Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${a}'`)}return n._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(n=>this.alias(n)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let n=this.registeredArguments.map(i=>_C(i));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?n:[]).join(" ")}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}helpGroup(e){return e===void 0?this._helpGroupHeading??"":(this._helpGroupHeading=e,this)}commandsGroup(e){return e===void 0?this._defaultCommandGroup??"":(this._defaultCommandGroup=e,this)}optionsGroup(e){return e===void 0?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=Xt.basename(e,Xt.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let n=this.createHelp(),i=this._getOutputContext(e);n.prepareContext({error:i.error,helpWidth:i.helpWidth,outputHasColors:i.hasColors});let a=n.formatHelp(this,n);return i.hasColors?a:this._outputConfiguration.stripColor(a)}_getOutputContext(e){e=e||{};let n=!!e.error,i,a,o;return n?(i=f=>this._outputConfiguration.writeErr(f),a=this._outputConfiguration.getErrHasColors(),o=this._outputConfiguration.getErrHelpWidth()):(i=f=>this._outputConfiguration.writeOut(f),a=this._outputConfiguration.getOutHasColors(),o=this._outputConfiguration.getOutHelpWidth()),{error:n,write:f=>(a||(f=this._outputConfiguration.stripColor(f)),i(f)),hasColors:a,helpWidth:o}}outputHelp(e){let n;typeof e=="function"&&(n=e,e=void 0);let i=this._getOutputContext(e),a={error:i.error,write:i.write,command:this};this._getCommandAndAncestors().reverse().forEach(l=>l.emit("beforeAllHelp",a)),this.emit("beforeHelp",a);let o=this.helpInformation({error:i.error});if(n&&(o=n(o),typeof o!="string"&&!Buffer.isBuffer(o)))throw new Error("outputHelp callback must return a string or a Buffer");i.write(o),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",a),this._getCommandAndAncestors().forEach(l=>l.emit("afterAllHelp",a))}helpOption(e,n){return typeof e=="boolean"?(e?(this._helpOption===null&&(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 this._helpOption===void 0&&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(de.exitCode??0);n===0&&e&&typeof e!="function"&&e.error&&(n=1),this._exit(n,"commander.help","(outputHelp)")}addHelpText(e,n){let i=["beforeAll","before","after","afterAll"];if(!i.includes(e))throw new Error(`Unexpected value for position to addHelpText.
Expecting one of '${i.join("', '")}'`);let a=`${e}Help`;return this.on(a,o=>{let l;typeof n=="function"?l=n({error:o.error,command:o.command}):l=n,l&&o.write(`${l}
`)}),this}_outputHelpIfRequested(e){let n=this._getHelpOption();n&&e.find(a=>n.is(a))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function rp(t){return t.map(e=>{if(!e.startsWith("--inspect"))return e;let n,i="127.0.0.1",a="9229",o;return(o=e.match(/^(--inspect(-brk)?)$/))!==null?n=o[1]:(o=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(n=o[1],/^\d+$/.test(o[3])?a=o[3]:i=o[3]):(o=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(n=o[1],i=o[3],a=o[4]),n&&a!=="0"?`${n}=${i}:${parseInt(a)+1}`:e})}function gl(){if(de.env.NO_COLOR||de.env.FORCE_COLOR==="0"||de.env.FORCE_COLOR==="false")return!1;if(de.env.FORCE_COLOR||de.env.CLICOLOR_FORCE!==void 0)return!0}yl.Command=ml;yl.useColor=gl});var up=C(bt=>{var{Argument:sp}=da(),{Command:_l}=ip(),{CommanderError:OC,InvalidArgumentError:ap}=Ai(),{Help:SC}=ul(),{Option:op}=hl();bt.program=new _l;bt.createCommand=t=>new _l(t);bt.createOption=(t,e)=>new op(t,e);bt.createArgument=(t,e)=>new sp(t,e);bt.Command=_l;bt.Option=op;bt.Argument=sp;bt.Help=SC;bt.CommanderError=OC;bt.InvalidArgumentError=ap;bt.InvalidOptionArgumentError=ap});var Oa=C((Br,Ei)=>{(function(){var t,e="4.17.21",n=200,i="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",a="Expected a function",o="Invalid `variable` option passed into `_.template`",l="__lodash_hash_undefined__",f=500,d="__lodash_placeholder__",m=1,v=2,_=4,O=1,T=2,L=1,x=2,I=4,F=8,B=16,H=32,K=64,j=128,X=256,pe=512,V=30,ke="...",Lt=800,un=16,Ae=1,ys=2,d0=3,Pn=1/0,ln=9007199254740991,p0=17976931348623157e292,_s=NaN,qt=4294967295,m0=qt-1,g0=qt>>>1,y0=[["ary",j],["bind",L],["bindKey",x],["curry",F],["curryRight",B],["flip",pe],["partial",H],["partialRight",K],["rearg",X]],mr="[object Arguments]",vs="[object Array]",_0="[object AsyncFunction]",ri="[object Boolean]",ii="[object Date]",v0="[object DOMException]",bs="[object Error]",ws="[object Function]",_f="[object GeneratorFunction]",At="[object Map]",si="[object Number]",b0="[object Null]",Ut="[object Object]",vf="[object Promise]",w0="[object Proxy]",ai="[object RegExp]",Ct="[object Set]",oi="[object String]",Os="[object Symbol]",O0="[object Undefined]",ui="[object WeakMap]",S0="[object WeakSet]",li="[object ArrayBuffer]",gr="[object DataView]",Po="[object Float32Array]",Mo="[object Float64Array]",Ro="[object Int8Array]",Do="[object Int16Array]",Fo="[object Int32Array]",Bo="[object Uint8Array]",Vo="[object Uint8ClampedArray]",Wo="[object Uint16Array]",Uo="[object Uint32Array]",x0=/\b__p \+= '';/g,A0=/\b(__p \+=) '' \+/g,C0=/(__e\(.*?\)|\b__t\)) \+\n'';/g,bf=/&(?:amp|lt|gt|quot|#39);/g,wf=/[&<>"']/g,k0=RegExp(bf.source),T0=RegExp(wf.source),E0=/<%-([\s\S]+?)%>/g,N0=/<%([\s\S]+?)%>/g,Of=/<%=([\s\S]+?)%>/g,I0=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,$0=/^\w*$/,L0=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ho=/[\\^$.*+?()[\]{}|]/g,q0=RegExp(Ho.source),jo=/^\s+/,P0=/\s/,M0=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,R0=/\{\n\/\* \[wrapped with (.+)\] \*/,D0=/,? & /,F0=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,B0=/[()=,{}\[\]\/\s]/,V0=/\\(\\)?/g,W0=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Sf=/\w*$/,U0=/^[-+]0x[0-9a-f]+$/i,H0=/^0b[01]+$/i,j0=/^\[object .+?Constructor\]$/,K0=/^0o[0-7]+$/i,z0=/^(?:0|[1-9]\d*)$/,G0=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ss=/($^)/,Z0=/['\n\r\u2028\u2029\\]/g,xs="\\ud800-\\udfff",Y0="\\u0300-\\u036f",J0="\\ufe20-\\ufe2f",Q0="\\u20d0-\\u20ff",xf=Y0+J0+Q0,Af="\\u2700-\\u27bf",Cf="a-z\\xdf-\\xf6\\xf8-\\xff",X0="\\xac\\xb1\\xd7\\xf7",eb="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",tb="\\u2000-\\u206f",nb=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",kf="A-Z\\xc0-\\xd6\\xd8-\\xde",Tf="\\ufe0e\\ufe0f",Ef=X0+eb+tb+nb,Ko="['\u2019]",rb="["+xs+"]",Nf="["+Ef+"]",As="["+xf+"]",If="\\d+",ib="["+Af+"]",$f="["+Cf+"]",Lf="[^"+xs+Ef+If+Af+Cf+kf+"]",zo="\\ud83c[\\udffb-\\udfff]",sb="(?:"+As+"|"+zo+")",qf="[^"+xs+"]",Go="(?:\\ud83c[\\udde6-\\uddff]){2}",Zo="[\\ud800-\\udbff][\\udc00-\\udfff]",yr="["+kf+"]",Pf="\\u200d",Mf="(?:"+$f+"|"+Lf+")",ab="(?:"+yr+"|"+Lf+")",Rf="(?:"+Ko+"(?:d|ll|m|re|s|t|ve))?",Df="(?:"+Ko+"(?:D|LL|M|RE|S|T|VE))?",Ff=sb+"?",Bf="["+Tf+"]?",ob="(?:"+Pf+"(?:"+[qf,Go,Zo].join("|")+")"+Bf+Ff+")*",ub="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",lb="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Vf=Bf+Ff+ob,cb="(?:"+[ib,Go,Zo].join("|")+")"+Vf,fb="(?:"+[qf+As+"?",As,Go,Zo,rb].join("|")+")",hb=RegExp(Ko,"g"),db=RegExp(As,"g"),Yo=RegExp(zo+"(?="+zo+")|"+fb+Vf,"g"),pb=RegExp([yr+"?"+$f+"+"+Rf+"(?="+[Nf,yr,"$"].join("|")+")",ab+"+"+Df+"(?="+[Nf,yr+Mf,"$"].join("|")+")",yr+"?"+Mf+"+"+Rf,yr+"+"+Df,lb,ub,If,cb].join("|"),"g"),mb=RegExp("["+Pf+xs+xf+Tf+"]"),gb=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,yb=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],_b=-1,Oe={};Oe[Po]=Oe[Mo]=Oe[Ro]=Oe[Do]=Oe[Fo]=Oe[Bo]=Oe[Vo]=Oe[Wo]=Oe[Uo]=!0,Oe[mr]=Oe[vs]=Oe[li]=Oe[ri]=Oe[gr]=Oe[ii]=Oe[bs]=Oe[ws]=Oe[At]=Oe[si]=Oe[Ut]=Oe[ai]=Oe[Ct]=Oe[oi]=Oe[ui]=!1;var we={};we[mr]=we[vs]=we[li]=we[gr]=we[ri]=we[ii]=we[Po]=we[Mo]=we[Ro]=we[Do]=we[Fo]=we[At]=we[si]=we[Ut]=we[ai]=we[Ct]=we[oi]=we[Os]=we[Bo]=we[Vo]=we[Wo]=we[Uo]=!0,we[bs]=we[ws]=we[ui]=!1;var vb={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},bb={"&":"&","<":"<",">":">",'"':""","'":"'"},wb={"&":"&","<":"<",">":">",""":'"',"'":"'"},Ob={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Sb=parseFloat,xb=parseInt,Wf=typeof global=="object"&&global&&global.Object===Object&&global,Ab=typeof self=="object"&&self&&self.Object===Object&&self,Fe=Wf||Ab||Function("return this")(),Jo=typeof Br=="object"&&Br&&!Br.nodeType&&Br,Mn=Jo&&typeof Ei=="object"&&Ei&&!Ei.nodeType&&Ei,Uf=Mn&&Mn.exports===Jo,Qo=Uf&&Wf.process,ht=function(){try{var w=Mn&&Mn.require&&Mn.require("util").types;return w||Qo&&Qo.binding&&Qo.binding("util")}catch{}}(),Hf=ht&&ht.isArrayBuffer,jf=ht&&ht.isDate,Kf=ht&&ht.isMap,zf=ht&&ht.isRegExp,Gf=ht&&ht.isSet,Zf=ht&&ht.isTypedArray;function it(w,k,A){switch(A.length){case 0:return w.call(k);case 1:return w.call(k,A[0]);case 2:return w.call(k,A[0],A[1]);case 3:return w.call(k,A[0],A[1],A[2])}return w.apply(k,A)}function Cb(w,k,A,D){for(var ee=-1,he=w==null?0:w.length;++ee<he;){var Pe=w[ee];k(D,Pe,A(Pe),w)}return D}function dt(w,k){for(var A=-1,D=w==null?0:w.length;++A<D&&k(w[A],A,w)!==!1;);return w}function kb(w,k){for(var A=w==null?0:w.length;A--&&k(w[A],A,w)!==!1;);return w}function Yf(w,k){for(var A=-1,D=w==null?0:w.length;++A<D;)if(!k(w[A],A,w))return!1;return!0}function cn(w,k){for(var A=-1,D=w==null?0:w.length,ee=0,he=[];++A<D;){var Pe=w[A];k(Pe,A,w)&&(he[ee++]=Pe)}return he}function Cs(w,k){var A=w==null?0:w.length;return!!A&&_r(w,k,0)>-1}function Xo(w,k,A){for(var D=-1,ee=w==null?0:w.length;++D<ee;)if(A(k,w[D]))return!0;return!1}function Se(w,k){for(var A=-1,D=w==null?0:w.length,ee=Array(D);++A<D;)ee[A]=k(w[A],A,w);return ee}function fn(w,k){for(var A=-1,D=k.length,ee=w.length;++A<D;)w[ee+A]=k[A];return w}function eu(w,k,A,D){var ee=-1,he=w==null?0:w.length;for(D&&he&&(A=w[++ee]);++ee<he;)A=k(A,w[ee],ee,w);return A}function Tb(w,k,A,D){var ee=w==null?0:w.length;for(D&&ee&&(A=w[--ee]);ee--;)A=k(A,w[ee],ee,w);return A}function tu(w,k){for(var A=-1,D=w==null?0:w.length;++A<D;)if(k(w[A],A,w))return!0;return!1}var Eb=nu("length");function Nb(w){return w.split("")}function Ib(w){return w.match(F0)||[]}function Jf(w,k,A){var D;return A(w,function(ee,he,Pe){if(k(ee,he,Pe))return D=he,!1}),D}function ks(w,k,A,D){for(var ee=w.length,he=A+(D?1:-1);D?he--:++he<ee;)if(k(w[he],he,w))return he;return-1}function _r(w,k,A){return k===k?Ub(w,k,A):ks(w,Qf,A)}function $b(w,k,A,D){for(var ee=A-1,he=w.length;++ee<he;)if(D(w[ee],k))return ee;return-1}function Qf(w){return w!==w}function Xf(w,k){var A=w==null?0:w.length;return A?iu(w,k)/A:_s}function nu(w){return function(k){return k==null?t:k[w]}}function ru(w){return function(k){return w==null?t:w[k]}}function eh(w,k,A,D,ee){return ee(w,function(he,Pe,ve){A=D?(D=!1,he)