create-spree-app 0.2.2 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -5
- package/dist/index.js +185 -137
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,128 +1,146 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __createRequire } from "node:module";
|
|
3
3
|
const require = __createRequire(import.meta.url);
|
|
4
|
-
var
|
|
5
|
-
`)}displayWidth(e){return
|
|
4
|
+
var fp=Object.create;var Qo=Object.defineProperty;var hp=Object.getOwnPropertyDescriptor;var gp=Object.getOwnPropertyNames;var bp=Object.getPrototypeOf,Ep=Object.prototype.hasOwnProperty;var R=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var x=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Cp=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of gp(e))!Ep.call(t,o)&&o!==r&&Qo(t,o,{get:()=>e[o],enumerable:!(n=hp(e,o))||n.enumerable});return t};var ie=(t,e,r)=>(r=t!=null?fp(bp(t)):{},Cp(e||!t||!t.__esModule?Qo(r,"default",{value:t,enumerable:!0}):r,t));var Ue=x(jr=>{"use strict";var ut=class extends Error{constructor(e,r,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=r,this.exitCode=e,this.nestedError=void 0}},Lr=class extends ut{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};jr.CommanderError=ut;jr.InvalidArgumentError=Lr});var ct=x(Ur=>{"use strict";var{InvalidArgumentError:yp}=Ue(),Nr=class{constructor(e,r){switch(this.description=r||"",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,r){return r===this.defaultValue||!Array.isArray(r)?[e]:r.concat(e)}default(e,r){return this.defaultValue=e,this.defaultValueDescription=r,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(r,n)=>{if(!this.argChoices.includes(r))throw new yp(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(r,n):r},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function Sp(t){let e=t.name()+(t.variadic===!0?"...":"");return t.required?"<"+e+">":"["+e+"]"}Ur.Argument=Nr;Ur.humanReadableArgName=Sp});var Wr=x(Gr=>{"use strict";var{humanReadableArgName:Fp}=ct(),Vr=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 r=e.commands.filter(o=>!o._hidden),n=e._getHelpCommand();return n&&!n._hidden&&r.push(n),this.sortSubcommands&&r.sort((o,s)=>o.name().localeCompare(s.name())),r}compareOptions(e,r){let n=o=>o.short?o.short.replace(/^-/,""):o.long.replace(/^--/,"");return n(e).localeCompare(n(r))}visibleOptions(e){let r=e.options.filter(o=>!o.hidden),n=e._getHelpOption();if(n&&!n.hidden){let o=n.short&&e._findOption(n.short),s=n.long&&e._findOption(n.long);!o&&!s?r.push(n):n.long&&!s?r.push(e.createOption(n.long,n.description)):n.short&&!o&&r.push(e.createOption(n.short,n.description))}return this.sortOptions&&r.sort(this.compareOptions),r}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let r=[];for(let n=e.parent;n;n=n.parent){let o=n.options.filter(s=>!s.hidden);r.push(...o)}return this.sortOptions&&r.sort(this.compareOptions),r}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(r=>{r.description=r.description||e._argsDescription[r.name()]||""}),e.registeredArguments.find(r=>r.description)?e.registeredArguments:[]}subcommandTerm(e){let r=e.registeredArguments.map(n=>Fp(n)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(r?" "+r:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,r){return r.visibleCommands(e).reduce((n,o)=>Math.max(n,this.displayWidth(r.styleSubcommandTerm(r.subcommandTerm(o)))),0)}longestOptionTermLength(e,r){return r.visibleOptions(e).reduce((n,o)=>Math.max(n,this.displayWidth(r.styleOptionTerm(r.optionTerm(o)))),0)}longestGlobalOptionTermLength(e,r){return r.visibleGlobalOptions(e).reduce((n,o)=>Math.max(n,this.displayWidth(r.styleOptionTerm(r.optionTerm(o)))),0)}longestArgumentTermLength(e,r){return r.visibleArguments(e).reduce((n,o)=>Math.max(n,this.displayWidth(r.styleArgumentTerm(r.argumentTerm(o)))),0)}commandUsage(e){let r=e._name;e._aliases[0]&&(r=r+"|"+e._aliases[0]);let n="";for(let o=e.parent;o;o=o.parent)n=o.name()+" "+n;return n+r+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let r=[];return e.argChoices&&r.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&r.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&r.push(`env: ${e.envVar}`),r.length>0?`${e.description} (${r.join(", ")})`:e.description}argumentDescription(e){let r=[];if(e.argChoices&&r.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),r.length>0){let n=`(${r.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}formatHelp(e,r){let n=r.padWidth(e,r),o=r.helpWidth??80;function s(p,D){return r.formatItem(p,n,D,r)}let i=[`${r.styleTitle("Usage:")} ${r.styleUsage(r.commandUsage(e))}`,""],a=r.commandDescription(e);a.length>0&&(i=i.concat([r.boxWrap(r.styleCommandDescription(a),o),""]));let u=r.visibleArguments(e).map(p=>s(r.styleArgumentTerm(r.argumentTerm(p)),r.styleArgumentDescription(r.argumentDescription(p))));u.length>0&&(i=i.concat([r.styleTitle("Arguments:"),...u,""]));let c=r.visibleOptions(e).map(p=>s(r.styleOptionTerm(r.optionTerm(p)),r.styleOptionDescription(r.optionDescription(p))));if(c.length>0&&(i=i.concat([r.styleTitle("Options:"),...c,""])),r.showGlobalOptions){let p=r.visibleGlobalOptions(e).map(D=>s(r.styleOptionTerm(r.optionTerm(D)),r.styleOptionDescription(r.optionDescription(D))));p.length>0&&(i=i.concat([r.styleTitle("Global Options:"),...p,""]))}let l=r.visibleCommands(e).map(p=>s(r.styleSubcommandTerm(r.subcommandTerm(p)),r.styleSubcommandDescription(r.subcommandDescription(p))));return l.length>0&&(i=i.concat([r.styleTitle("Commands:"),...l,""])),i.join(`
|
|
5
|
+
`)}displayWidth(e){return ei(e).length}styleTitle(e){return e}styleUsage(e){return e.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r==="[command]"?this.styleSubcommandText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleCommandText(r)).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(r=>r==="[options]"?this.styleOptionText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleSubcommandText(r)).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,r){return Math.max(r.longestOptionTermLength(e,r),r.longestGlobalOptionTermLength(e,r),r.longestSubcommandTermLength(e,r),r.longestArgumentTermLength(e,r))}preformatted(e){return/\n[^\S\r\n]/.test(e)}formatItem(e,r,n,o){let i=" ".repeat(2);if(!n)return i+e;let a=e.padEnd(r+e.length-o.displayWidth(e)),u=2,l=(this.helpWidth??80)-r-u-2,p;return l<this.minWidthToWrap||o.preformatted(n)?p=n:p=o.boxWrap(n,l).replace(/\n/g,`
|
|
6
6
|
`+" ".repeat(r+u)),i+a+" ".repeat(u)+p.replace(/\n/g,`
|
|
7
|
-
${i}`)}boxWrap(e,r){if(r<this.minWidthToWrap)return e;let n=e.split(/\r\n|\n/),o=/[\s]*[^\s]+/g,s=[];return n.forEach(i=>{let a=i.match(o);if(a===null){s.push("");return}let u=[a.shift()],c=this.displayWidth(u[0]);a.forEach(l=>{let p=this.displayWidth(l);if(c+p<=r){u.push(l),c+=p;return}s.push(u.join(""));let
|
|
8
|
-
`)}};function
|
|
7
|
+
${i}`)}boxWrap(e,r){if(r<this.minWidthToWrap)return e;let n=e.split(/\r\n|\n/),o=/[\s]*[^\s]+/g,s=[];return n.forEach(i=>{let a=i.match(o);if(a===null){s.push("");return}let u=[a.shift()],c=this.displayWidth(u[0]);a.forEach(l=>{let p=this.displayWidth(l);if(c+p<=r){u.push(l),c+=p;return}s.push(u.join(""));let D=l.trimStart();u=[D],c=this.displayWidth(D)}),s.push(u.join(""))}),s.join(`
|
|
8
|
+
`)}};function ei(t){let e=/\x1b\[\d*(;\d*)*m/g;return t.replace(e,"")}Gr.Help=Vr;Gr.stripColor=ei});var Yr=x(qr=>{"use strict";var{InvalidArgumentError:wp}=Ue(),Hr=class{constructor(e,r){this.flags=e,this.description=r||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let n=xp(e);this.short=n.shortFlag,this.long=n.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(e,r){return this.defaultValue=e,this.defaultValueDescription=r,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let r=e;return typeof e=="string"&&(r={[e]:!0}),this.implied=Object.assign(this.implied||{},r),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,r){return r===this.defaultValue||!Array.isArray(r)?[e]:r.concat(e)}choices(e){return this.argChoices=e.slice(),this.parseArg=(r,n)=>{if(!this.argChoices.includes(r))throw new wp(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(r,n):r},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?ti(this.name().replace(/^no-/,"")):ti(this.name())}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},zr=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(r=>{r.negate?this.negativeOptions.set(r.attributeName(),r):this.positiveOptions.set(r.attributeName(),r)}),this.negativeOptions.forEach((r,n)=>{this.positiveOptions.has(n)&&this.dualOptions.add(n)})}valueFromOption(e,r){let n=r.attributeName();if(!this.dualOptions.has(n))return!0;let o=this.negativeOptions.get(n).presetArg,s=o!==void 0?o:!1;return r.negate===(s===e)}};function ti(t){return t.split("-").reduce((e,r)=>e+r[0].toUpperCase()+r.slice(1))}function xp(t){let e,r,n=/^-[^-]$/,o=/^--[^-]/,s=t.split(/[ |,]+/).concat("guard");if(n.test(s[0])&&(e=s.shift()),o.test(s[0])&&(r=s.shift()),!e&&n.test(s[0])&&(e=s.shift()),!e&&o.test(s[0])&&(e=r,r=s.shift()),s[0].startsWith("-")){let i=s[0],a=`option creation failed due to '${i}' in option flags '${t}'`;throw/^-[^-][^-]/.test(i)?new Error(`${a}
|
|
9
9
|
- a short flag is a single dash and a single character
|
|
10
10
|
- either use a single dash and a single character (for a short flag)
|
|
11
11
|
- or use a double dash for a long option (and can have two, like '--ws, --workspace')`):n.test(i)?new Error(`${a}
|
|
12
12
|
- too many short flags`):o.test(i)?new Error(`${a}
|
|
13
13
|
- too many long flags`):new Error(`${a}
|
|
14
|
-
- unrecognised flag format`)}if(e===void 0&&r===void 0)throw new Error(`option creation failed due to no flags found in '${t}'.`);return{shortFlag:e,longFlag:r}}
|
|
14
|
+
- unrecognised flag format`)}if(e===void 0&&r===void 0)throw new Error(`option creation failed due to no flags found in '${t}'.`);return{shortFlag:e,longFlag:r}}qr.Option=Hr;qr.DualOptions=zr});var ni=x(ri=>{"use strict";function Ap(t,e){if(Math.abs(t.length-e.length)>3)return Math.max(t.length,e.length);let r=[];for(let n=0;n<=t.length;n++)r[n]=[n];for(let n=0;n<=e.length;n++)r[0][n]=n;for(let n=1;n<=e.length;n++)for(let o=1;o<=t.length;o++){let s=1;t[o-1]===e[n-1]?s=0:s=1,r[o][n]=Math.min(r[o-1][n]+1,r[o][n-1]+1,r[o-1][n-1]+s),o>1&&n>1&&t[o-1]===e[n-2]&&t[o-2]===e[n-1]&&(r[o][n]=Math.min(r[o][n],r[o-2][n-2]+1))}return r[t.length][e.length]}function Op(t,e){if(!e||e.length===0)return"";e=Array.from(new Set(e));let r=t.startsWith("--");r&&(t=t.slice(2),e=e.map(i=>i.slice(2)));let n=[],o=3,s=.4;return e.forEach(i=>{if(i.length<=1)return;let a=Ap(t,i),u=Math.max(t.length,i.length);(u-a)/u>s&&(a<o?(o=a,n=[i]):a===o&&n.push(i))}),n.sort((i,a)=>i.localeCompare(a)),r&&(n=n.map(i=>`--${i}`)),n.length>1?`
|
|
15
15
|
(Did you mean one of ${n.join(", ")}?)`:n.length===1?`
|
|
16
|
-
(Did you mean ${n[0]}?)`:""}
|
|
17
|
-
- specify the name in Command constructor or using .name()`);return r=r||{},r.isDefault&&(this._defaultCommandName=e._name),(r.noHelp||r.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,r){return new
|
|
18
|
-
Expecting one of '${n.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(r):this._lifeCycleHooks[e]=[r],this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=r=>{if(r.code!=="commander.executeSubCommandAsync")throw r},this}_exit(e,r,n){this._exitCallback&&this._exitCallback(new
|
|
19
|
-
- already used by option '${r.flags}'`)}this.options.push(e)}_registerCommand(e){let r=o=>[o.name()].concat(o.aliases()),n=r(e).find(o=>this._findCommand(o));if(n){let o=r(this._findCommand(n)).join("|"),s=r(e).join("|");throw new Error(`cannot add command '${s}' as already have command '${o}'`)}this.commands.push(e)}addOption(e){this._registerOption(e);let r=e.name(),n=e.attributeName();if(e.negate){let s=e.long.replace(/^--no-/,"--");this._findOption(s)||this.setOptionValueWithSource(n,e.defaultValue===void 0?!0:e.defaultValue,"default")}else e.defaultValue!==void 0&&this.setOptionValueWithSource(n,e.defaultValue,"default");let o=(s,i,a)=>{s==null&&e.presetArg!==void 0&&(s=e.presetArg);let u=this.getOptionValue(n);s!==null&&e.parseArg?s=this._callParseArg(e,s,u,i):s!==null&&e.variadic&&(s=e._concatValue(s,u)),s==null&&(e.negate?s=!1:e.isBoolean()||e.optional?s=!0:s=""),this.setOptionValueWithSource(n,s,a)};return this.on("option:"+r,s=>{let i=`error: option '${e.flags}' argument '${s}' is invalid.`;o(s,i,"cli")}),e.envVar&&this.on("optionEnv:"+r,s=>{let i=`error: option '${e.flags}' value '${s}' from env '${e.envVar}' is invalid.`;o(s,i,"env")}),this}_optionEx(e,r,n,o,s){if(typeof r=="object"&&r instanceof
|
|
20
|
-
- 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,r,n){if(
|
|
16
|
+
(Did you mean ${n[0]}?)`:""}ri.suggestSimilar=Op});var ai=x(Qr=>{"use strict";var $p=R("events").EventEmitter,Kr=R("child_process"),Z=R("path"),lt=R("fs"),b=R("process"),{Argument:_p,humanReadableArgName:Bp}=ct(),{CommanderError:Jr}=Ue(),{Help:Tp,stripColor:vp}=Wr(),{Option:oi,DualOptions:Ip}=Yr(),{suggestSimilar:ii}=ni(),Xr=class t extends $p{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:r=>b.stdout.write(r),writeErr:r=>b.stderr.write(r),outputError:(r,n)=>n(r),getOutHelpWidth:()=>b.stdout.isTTY?b.stdout.columns:void 0,getErrHelpWidth:()=>b.stderr.isTTY?b.stderr.columns:void 0,getOutHasColors:()=>Zr()??(b.stdout.isTTY&&b.stdout.hasColors?.()),getErrHasColors:()=>Zr()??(b.stderr.isTTY&&b.stderr.hasColors?.()),stripColor:r=>vp(r)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={}}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 r=this;r;r=r.parent)e.push(r);return e}command(e,r,n){let o=r,s=n;typeof o=="object"&&o!==null&&(s=o,o=null),s=s||{};let[,i,a]=e.match(/([^ ]+) *(.*)/),u=this.createCommand(i);return o&&(u.description(o),u._executableHandler=!0),s.isDefault&&(this._defaultCommandName=u._name),u._hidden=!!(s.noHelp||s.hidden),u._executableFile=s.executableFile||null,a&&u.arguments(a),this._registerCommand(u),u.parent=this,u.copyInheritedSettings(this),o?this:u}createCommand(e){return new t(e)}createHelp(){return Object.assign(new Tp,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?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,r){if(!e._name)throw new Error(`Command passed to .addCommand() must have a name
|
|
17
|
+
- specify the name in Command constructor or using .name()`);return r=r||{},r.isDefault&&(this._defaultCommandName=e._name),(r.noHelp||r.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,r){return new _p(e,r)}argument(e,r,n,o){let s=this.createArgument(e,r);return typeof n=="function"?s.default(o).argParser(n):s.default(n),this.addArgument(s),this}arguments(e){return e.trim().split(/ +/).forEach(r=>{this.argument(r)}),this}addArgument(e){let r=this.registeredArguments.slice(-1)[0];if(r&&r.variadic)throw new Error(`only the last argument can be variadic '${r.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,r){if(typeof e=="boolean")return this._addImplicitHelpCommand=e,this;e=e??"help [command]";let[,n,o]=e.match(/([^ ]+) *(.*)/),s=r??"display help for command",i=this.createCommand(n);return i.helpOption(!1),o&&i.arguments(o),s&&i.description(s),this._addImplicitHelpCommand=!0,this._helpCommand=i,this}addHelpCommand(e,r){return typeof e!="object"?(this.helpCommand(e,r),this):(this._addImplicitHelpCommand=!0,this._helpCommand=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,r){let n=["preSubcommand","preAction","postAction"];if(!n.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'.
|
|
18
|
+
Expecting one of '${n.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(r):this._lifeCycleHooks[e]=[r],this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=r=>{if(r.code!=="commander.executeSubCommandAsync")throw r},this}_exit(e,r,n){this._exitCallback&&this._exitCallback(new Jr(e,r,n)),b.exit(e)}action(e){let r=n=>{let o=this.registeredArguments.length,s=n.slice(0,o);return this._storeOptionsAsProperties?s[o]=this:s[o]=this.opts(),s.push(this),e.apply(this,s)};return this._actionHandler=r,this}createOption(e,r){return new oi(e,r)}_callParseArg(e,r,n,o){try{return e.parseArg(r,n)}catch(s){if(s.code==="commander.invalidArgument"){let i=`${o} ${s.message}`;this.error(i,{exitCode:s.exitCode,code:s.code})}throw s}}_registerOption(e){let r=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(r){let n=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 '${n}'
|
|
19
|
+
- already used by option '${r.flags}'`)}this.options.push(e)}_registerCommand(e){let r=o=>[o.name()].concat(o.aliases()),n=r(e).find(o=>this._findCommand(o));if(n){let o=r(this._findCommand(n)).join("|"),s=r(e).join("|");throw new Error(`cannot add command '${s}' as already have command '${o}'`)}this.commands.push(e)}addOption(e){this._registerOption(e);let r=e.name(),n=e.attributeName();if(e.negate){let s=e.long.replace(/^--no-/,"--");this._findOption(s)||this.setOptionValueWithSource(n,e.defaultValue===void 0?!0:e.defaultValue,"default")}else e.defaultValue!==void 0&&this.setOptionValueWithSource(n,e.defaultValue,"default");let o=(s,i,a)=>{s==null&&e.presetArg!==void 0&&(s=e.presetArg);let u=this.getOptionValue(n);s!==null&&e.parseArg?s=this._callParseArg(e,s,u,i):s!==null&&e.variadic&&(s=e._concatValue(s,u)),s==null&&(e.negate?s=!1:e.isBoolean()||e.optional?s=!0:s=""),this.setOptionValueWithSource(n,s,a)};return this.on("option:"+r,s=>{let i=`error: option '${e.flags}' argument '${s}' is invalid.`;o(s,i,"cli")}),e.envVar&&this.on("optionEnv:"+r,s=>{let i=`error: option '${e.flags}' value '${s}' from env '${e.envVar}' is invalid.`;o(s,i,"env")}),this}_optionEx(e,r,n,o,s){if(typeof r=="object"&&r instanceof oi)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let i=this.createOption(r,n);if(i.makeOptionMandatory(!!e.mandatory),typeof o=="function")i.default(s).argParser(o);else if(o instanceof RegExp){let a=o;o=(u,c)=>{let l=a.exec(u);return l?l[0]:c},i.default(s).argParser(o)}else i.default(o);return this.addOption(i)}option(e,r,n,o){return this._optionEx({},e,r,n,o)}requiredOption(e,r,n,o){return this._optionEx({mandatory:!0},e,r,n,o)}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,r){return this.setOptionValueWithSource(e,r,void 0)}setOptionValueWithSource(e,r,n){return this._storeOptionsAsProperties?this[e]=r:this._optionValues[e]=r,this._optionValueSources[e]=n,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let r;return this._getCommandAndAncestors().forEach(n=>{n.getOptionValueSource(e)!==void 0&&(r=n.getOptionValueSource(e))}),r}_prepareUserArgs(e,r){if(e!==void 0&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");if(r=r||{},e===void 0&&r.from===void 0){b.versions?.electron&&(r.from="electron");let o=b.execArgv??[];(o.includes("-e")||o.includes("--eval")||o.includes("-p")||o.includes("--print"))&&(r.from="eval")}e===void 0&&(e=b.argv),this.rawArgs=e.slice();let n;switch(r.from){case void 0:case"node":this._scriptPath=e[1],n=e.slice(2);break;case"electron":b.defaultApp?(this._scriptPath=e[1],n=e.slice(2)):n=e.slice(1);break;case"user":n=e.slice(0);break;case"eval":n=e.slice(1);break;default:throw new Error(`unexpected parse option { from: '${r.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",n}parse(e,r){this._prepareForParse();let n=this._prepareUserArgs(e,r);return this._parseCommand([],n),this}async parseAsync(e,r){this._prepareForParse();let n=this._prepareUserArgs(e,r);return await this._parseCommand([],n),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.
|
|
20
|
+
- 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,r,n){if(lt.existsSync(e))return;let o=r?`searched for local subcommand relative to directory '${r}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",s=`'${e}' does not exist
|
|
21
21
|
- if '${n}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
|
|
22
22
|
- if the default executable name is not suitable, use the executableFile option to supply a custom name or path
|
|
23
|
-
- ${o}`;throw new Error(s)}_executeSubCommand(e,r){r=r.slice();let n=!1,o=[".js",".ts",".tsx",".mjs",".cjs"];function s(l,p){let
|
|
23
|
+
- ${o}`;throw new Error(s)}_executeSubCommand(e,r){r=r.slice();let n=!1,o=[".js",".ts",".tsx",".mjs",".cjs"];function s(l,p){let D=Z.resolve(l,p);if(lt.existsSync(D))return D;if(o.includes(Z.extname(p)))return;let m=o.find(f=>lt.existsSync(`${D}${f}`));if(m)return`${D}${m}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let i=e._executableFile||`${this._name}-${e._name}`,a=this._executableDir||"";if(this._scriptPath){let l;try{l=lt.realpathSync(this._scriptPath)}catch{l=this._scriptPath}a=Z.resolve(Z.dirname(l),a)}if(a){let l=s(a,i);if(!l&&!e._executableFile&&this._scriptPath){let p=Z.basename(this._scriptPath,Z.extname(this._scriptPath));p!==this._name&&(l=s(a,`${p}-${e._name}`))}i=l||i}n=o.includes(Z.extname(i));let u;b.platform!=="win32"?n?(r.unshift(i),r=si(b.execArgv).concat(r),u=Kr.spawn(b.argv[0],r,{stdio:"inherit"})):u=Kr.spawn(i,r,{stdio:"inherit"}):(this._checkForMissingExecutable(i,a,e._name),r.unshift(i),r=si(b.execArgv).concat(r),u=Kr.spawn(b.execPath,r,{stdio:"inherit"})),u.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(p=>{b.on(p,()=>{u.killed===!1&&u.exitCode===null&&u.kill(p)})});let c=this._exitCallback;u.on("close",l=>{l=l??1,c?c(new Jr(l,"commander.executeSubCommandAsync","(close)")):b.exit(l)}),u.on("error",l=>{if(l.code==="ENOENT")this._checkForMissingExecutable(i,a,e._name);else if(l.code==="EACCES")throw new Error(`'${i}' not executable`);if(!c)b.exit(1);else{let p=new Jr(1,"commander.executeSubCommandAsync","(error)");p.nestedError=l,c(p)}}),this.runningCommand=u}_dispatchSubcommand(e,r,n){let o=this._findCommand(e);o||this.help({error:!0}),o._prepareForParse();let s;return s=this._chainOrCallSubCommandHook(s,o,"preSubcommand"),s=this._chainOrCall(s,()=>{if(o._executableHandler)this._executeSubCommand(o,r.concat(n));else return o._parseCommand(r,n)}),s}_dispatchHelpCommand(e){e||this.help();let r=this._findCommand(e);return r&&!r._executableHandler&&r.help(),this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((e,r)=>{e.required&&this.args[r]==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=(n,o,s)=>{let i=o;if(o!==null&&n.parseArg){let a=`error: command-argument value '${o}' is invalid for argument '${n.name()}'.`;i=this._callParseArg(n,o,s,a)}return i};this._checkNumberOfArguments();let r=[];this.registeredArguments.forEach((n,o)=>{let s=n.defaultValue;n.variadic?o<this.args.length?(s=this.args.slice(o),n.parseArg&&(s=s.reduce((i,a)=>e(n,a,i),n.defaultValue))):s===void 0&&(s=[]):o<this.args.length&&(s=this.args[o],n.parseArg&&(s=e(n,s,n.defaultValue))),r[o]=s}),this.processedArgs=r}_chainOrCall(e,r){return e&&e.then&&typeof e.then=="function"?e.then(()=>r()):r()}_chainOrCallHooks(e,r){let n=e,o=[];return this._getCommandAndAncestors().reverse().filter(s=>s._lifeCycleHooks[r]!==void 0).forEach(s=>{s._lifeCycleHooks[r].forEach(i=>{o.push({hookedCommand:s,callback:i})})}),r==="postAction"&&o.reverse(),o.forEach(s=>{n=this._chainOrCall(n,()=>s.callback(s.hookedCommand,this))}),n}_chainOrCallSubCommandHook(e,r,n){let o=e;return this._lifeCycleHooks[n]!==void 0&&this._lifeCycleHooks[n].forEach(s=>{o=this._chainOrCall(o,()=>s(this,r))}),o}_parseCommand(e,r){let n=this.parseOptions(r);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(n.operands),r=n.unknown,this.args=e.concat(r),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),r);if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(r),this._dispatchSubcommand(this._defaultCommandName,e,r);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(n.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let o=()=>{n.unknown.length>0&&this.unknownOption(n.unknown[0])},s=`command:${this.name()}`;if(this._actionHandler){o(),this._processArguments();let i;return i=this._chainOrCallHooks(i,"preAction"),i=this._chainOrCall(i,()=>this._actionHandler(this.processedArgs)),this.parent&&(i=this._chainOrCall(i,()=>{this.parent.emit(s,e,r)})),i=this._chainOrCallHooks(i,"postAction"),i}if(this.parent&&this.parent.listenerCount(s))o(),this._processArguments(),this.parent.emit(s,e,r);else if(e.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",e,r);this.listenerCount("command:*")?this.emit("command:*",e,r):this.commands.length?this.unknownCommand():(o(),this._processArguments())}else this.commands.length?(o(),this.help({error:!0})):(o(),this._processArguments())}_findCommand(e){if(e)return this.commands.find(r=>r._name===e||r._aliases.includes(e))}_findOption(e){return this.options.find(r=>r.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(e=>{e.options.forEach(r=>{r.mandatory&&e.getOptionValue(r.attributeName())===void 0&&e.missingMandatoryOptionValue(r)})})}_checkForConflictingLocalOptions(){let e=this.options.filter(n=>{let o=n.attributeName();return this.getOptionValue(o)===void 0?!1:this.getOptionValueSource(o)!=="default"});e.filter(n=>n.conflictsWith.length>0).forEach(n=>{let o=e.find(s=>n.conflictsWith.includes(s.attributeName()));o&&this._conflictingOption(n,o)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(e=>{e._checkForConflictingLocalOptions()})}parseOptions(e){let r=[],n=[],o=r,s=e.slice();function i(u){return u.length>1&&u[0]==="-"}let a=null;for(;s.length;){let u=s.shift();if(u==="--"){o===n&&o.push(u),o.push(...s);break}if(a&&!i(u)){this.emit(`option:${a.name()}`,u);continue}if(a=null,i(u)){let c=this._findOption(u);if(c){if(c.required){let l=s.shift();l===void 0&&this.optionMissingArgument(c),this.emit(`option:${c.name()}`,l)}else if(c.optional){let l=null;s.length>0&&!i(s[0])&&(l=s.shift()),this.emit(`option:${c.name()}`,l)}else this.emit(`option:${c.name()}`);a=c.variadic?c:null;continue}}if(u.length>2&&u[0]==="-"&&u[1]!=="-"){let c=this._findOption(`-${u[1]}`);if(c){c.required||c.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${c.name()}`,u.slice(2)):(this.emit(`option:${c.name()}`),s.unshift(`-${u.slice(2)}`));continue}}if(/^--[^=]+=/.test(u)){let c=u.indexOf("="),l=this._findOption(u.slice(0,c));if(l&&(l.required||l.optional)){this.emit(`option:${l.name()}`,u.slice(c+1));continue}}if(i(u)&&(o=n),(this._enablePositionalOptions||this._passThroughOptions)&&r.length===0&&n.length===0){if(this._findCommand(u)){r.push(u),s.length>0&&n.push(...s);break}else if(this._getHelpCommand()&&u===this._getHelpCommand().name()){r.push(u),s.length>0&&r.push(...s);break}else if(this._defaultCommandName){n.push(u),s.length>0&&n.push(...s);break}}if(this._passThroughOptions){o.push(u),s.length>0&&o.push(...s);break}o.push(u)}return{operands:r,unknown:n}}opts(){if(this._storeOptionsAsProperties){let e={},r=this.options.length;for(let n=0;n<r;n++){let o=this.options[n].attributeName();e[o]=o===this._versionOptionName?this._version:this[o]}return e}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((e,r)=>Object.assign(e,r.opts()),{})}error(e,r){this._outputConfiguration.outputError(`${e}
|
|
24
24
|
`,this._outputConfiguration.writeErr),typeof this._showHelpAfterError=="string"?this._outputConfiguration.writeErr(`${this._showHelpAfterError}
|
|
25
25
|
`):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
|
|
26
|
-
`),this.outputHelp({error:!0}));let n=r||{},o=n.exitCode||1,s=n.code||"commander.error";this._exit(o,s,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in b.env){let r=e.attributeName();(this.getOptionValue(r)===void 0||["default","config","env"].includes(this.getOptionValueSource(r)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,b.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new
|
|
27
|
-
`),this._exit(0,"commander.version",e)}),this}description(e,r){return e===void 0&&r===void 0?this._description:(this._description=e,r&&(this._argsDescription=r),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let r=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(r=this.commands[this.commands.length-1]),e===r._name)throw new Error("Command alias can't be the same as its name");let n=this.parent?._findCommand(e);if(n){let o=[n.name()].concat(n.aliases()).join("|");throw new Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${o}'`)}return r._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(r=>this.alias(r)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let r=this.registeredArguments.map(n=>
|
|
26
|
+
`),this.outputHelp({error:!0}));let n=r||{},o=n.exitCode||1,s=n.code||"commander.error";this._exit(o,s,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in b.env){let r=e.attributeName();(this.getOptionValue(r)===void 0||["default","config","env"].includes(this.getOptionValueSource(r)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,b.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new Ip(this.options),r=n=>this.getOptionValue(n)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(n));this.options.filter(n=>n.implied!==void 0&&r(n.attributeName())&&e.valueFromOption(this.getOptionValue(n.attributeName()),n)).forEach(n=>{Object.keys(n.implied).filter(o=>!r(o)).forEach(o=>{this.setOptionValueWithSource(o,n.implied[o],"implied")})})}missingArgument(e){let r=`error: missing required argument '${e}'`;this.error(r,{code:"commander.missingArgument"})}optionMissingArgument(e){let r=`error: option '${e.flags}' argument missing`;this.error(r,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){let r=`error: required option '${e.flags}' not specified`;this.error(r,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,r){let n=i=>{let a=i.attributeName(),u=this.getOptionValue(a),c=this.options.find(p=>p.negate&&a===p.attributeName()),l=this.options.find(p=>!p.negate&&a===p.attributeName());return c&&(c.presetArg===void 0&&u===!1||c.presetArg!==void 0&&u===c.presetArg)?c:l||i},o=i=>{let a=n(i),u=a.attributeName();return this.getOptionValueSource(u)==="env"?`environment variable '${a.envVar}'`:`option '${a.flags}'`},s=`error: ${o(e)} cannot be used with ${o(r)}`;this.error(s,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let r="";if(e.startsWith("--")&&this._showSuggestionAfterError){let o=[],s=this;do{let i=s.createHelp().visibleOptions(s).filter(a=>a.long).map(a=>a.long);o=o.concat(i),s=s.parent}while(s&&!s._enablePositionalOptions);r=ii(e,o)}let n=`error: unknown option '${e}'${r}`;this.error(n,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;let r=this.registeredArguments.length,n=r===1?"":"s",s=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${r} argument${n} but got ${e.length}.`;this.error(s,{code:"commander.excessArguments"})}unknownCommand(){let e=this.args[0],r="";if(this._showSuggestionAfterError){let o=[];this.createHelp().visibleCommands(this).forEach(s=>{o.push(s.name()),s.alias()&&o.push(s.alias())}),r=ii(e,o)}let n=`error: unknown command '${e}'${r}`;this.error(n,{code:"commander.unknownCommand"})}version(e,r,n){if(e===void 0)return this._version;this._version=e,r=r||"-V, --version",n=n||"output the version number";let o=this.createOption(r,n);return this._versionOptionName=o.attributeName(),this._registerOption(o),this.on("option:"+o.name(),()=>{this._outputConfiguration.writeOut(`${e}
|
|
27
|
+
`),this._exit(0,"commander.version",e)}),this}description(e,r){return e===void 0&&r===void 0?this._description:(this._description=e,r&&(this._argsDescription=r),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let r=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(r=this.commands[this.commands.length-1]),e===r._name)throw new Error("Command alias can't be the same as its name");let n=this.parent?._findCommand(e);if(n){let o=[n.name()].concat(n.aliases()).join("|");throw new Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${o}'`)}return r._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(r=>this.alias(r)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let r=this.registeredArguments.map(n=>Bp(n));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?r:[]).join(" ")}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}nameFromFilename(e){return this._name=Z.basename(e,Z.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let r=this.createHelp(),n=this._getOutputContext(e);r.prepareContext({error:n.error,helpWidth:n.helpWidth,outputHasColors:n.hasColors});let o=r.formatHelp(this,r);return n.hasColors?o:this._outputConfiguration.stripColor(o)}_getOutputContext(e){e=e||{};let r=!!e.error,n,o,s;return r?(n=a=>this._outputConfiguration.writeErr(a),o=this._outputConfiguration.getErrHasColors(),s=this._outputConfiguration.getErrHelpWidth()):(n=a=>this._outputConfiguration.writeOut(a),o=this._outputConfiguration.getOutHasColors(),s=this._outputConfiguration.getOutHelpWidth()),{error:r,write:a=>(o||(a=this._outputConfiguration.stripColor(a)),n(a)),hasColors:o,helpWidth:s}}outputHelp(e){let r;typeof e=="function"&&(r=e,e=void 0);let n=this._getOutputContext(e),o={error:n.error,write:n.write,command:this};this._getCommandAndAncestors().reverse().forEach(i=>i.emit("beforeAllHelp",o)),this.emit("beforeHelp",o);let s=this.helpInformation({error:n.error});if(r&&(s=r(s),typeof s!="string"&&!Buffer.isBuffer(s)))throw new Error("outputHelp callback must return a string or a Buffer");n.write(s),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",o),this._getCommandAndAncestors().forEach(i=>i.emit("afterAllHelp",o))}helpOption(e,r){return typeof e=="boolean"?(e?this._helpOption=this._helpOption??void 0:this._helpOption=null,this):(e=e??"-h, --help",r=r??"display help for command",this._helpOption=this.createOption(e,r),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this}help(e){this.outputHelp(e);let r=Number(b.exitCode??0);r===0&&e&&typeof e!="function"&&e.error&&(r=1),this._exit(r,"commander.help","(outputHelp)")}addHelpText(e,r){let n=["beforeAll","before","after","afterAll"];if(!n.includes(e))throw new Error(`Unexpected value for position to addHelpText.
|
|
28
28
|
Expecting one of '${n.join("', '")}'`);let o=`${e}Help`;return this.on(o,s=>{let i;typeof r=="function"?i=r({error:s.error,command:s.command}):i=r,i&&s.write(`${i}
|
|
29
|
-
`)}),this}_outputHelpIfRequested(e){let r=this._getHelpOption();r&&e.find(o=>r.is(o))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function ai(t){return t.map(e=>{if(!e.startsWith("--inspect"))return e;let r,n="127.0.0.1",o="9229",s;return(s=e.match(/^(--inspect(-brk)?)$/))!==null?r=s[1]:(s=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=s[1],/^\d+$/.test(s[3])?o=s[3]:n=s[3]):(s=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=s[1],n=s[3],o=s[4]),r&&o!=="0"?`${r}=${n}:${parseInt(o)+1}`:e})}function Jr(){if(b.env.NO_COLOR||b.env.FORCE_COLOR==="0"||b.env.FORCE_COLOR==="false")return!1;if(b.env.FORCE_COLOR||b.env.CLICOLOR_FORCE!==void 0)return!0}Xr.Command=Kr;Xr.useColor=Jr});var di=x(L=>{"use strict";var{Argument:ci}=dt(),{Command:Zr}=ui(),{CommanderError:Pp,InvalidArgumentError:li}=Ue(),{Help:kp}=Vr(),{Option:pi}=zr();L.program=new Zr;L.createCommand=t=>new Zr(t);L.createOption=(t,e)=>new pi(t,e);L.createArgument=(t,e)=>new ci(t,e);L.Command=Zr;L.Option=pi;L.Argument=ci;L.Help=kp;L.CommanderError=Pp;L.InvalidArgumentError=li;L.InvalidOptionArgumentError=li});var en=x((Oy,fi)=>{"use strict";var Qr={to(t,e){return e?`\x1B[${e+1};${t+1}H`:`\x1B[${t+1}G`},move(t,e){let r="";return t<0?r+=`\x1B[${-t}D`:t>0&&(r+=`\x1B[${t}C`),e<0?r+=`\x1B[${-e}A`:e>0&&(r+=`\x1B[${e}B`),r},up:(t=1)=>`\x1B[${t}A`,down:(t=1)=>`\x1B[${t}B`,forward:(t=1)=>`\x1B[${t}C`,backward:(t=1)=>`\x1B[${t}D`,nextLine:(t=1)=>"\x1B[E".repeat(t),prevLine:(t=1)=>"\x1B[F".repeat(t),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},Lp={up:(t=1)=>"\x1B[S".repeat(t),down:(t=1)=>"\x1B[T".repeat(t)},jp={screen:"\x1B[2J",up:(t=1)=>"\x1B[1J".repeat(t),down:(t=1)=>"\x1B[J".repeat(t),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines(t){let e="";for(let r=0;r<t;r++)e+=this.line+(r<t-1?Qr.up():"");return t&&(e+=Qr.left),e}};fi.exports={cursor:Qr,scroll:Lp,erase:jp,beep:"\x07"}});var Ve=x((_y,tn)=>{"use strict";var ft=process||{},hi=ft.argv||[],mt=ft.env||{},Np=!(mt.NO_COLOR||hi.includes("--no-color"))&&(!!mt.FORCE_COLOR||hi.includes("--color")||ft.platform==="win32"||(ft.stdout||{}).isTTY&&mt.TERM!=="dumb"||!!mt.CI),Up=(t,e,r=t)=>n=>{let o=""+n,s=o.indexOf(e,t.length);return~s?t+Vp(o,e,r,s)+e:t+o+e},Vp=(t,e,r,n)=>{let o="",s=0;do o+=t.substring(s,n)+r,s=n+e.length,n=t.indexOf(e,s);while(~n);return o+t.substring(s)},gi=(t=Np)=>{let e=t?Up:()=>String;return{isColorSupported:t,reset:e("\x1B[0m","\x1B[0m"),bold:e("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:e("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:e("\x1B[3m","\x1B[23m"),underline:e("\x1B[4m","\x1B[24m"),inverse:e("\x1B[7m","\x1B[27m"),hidden:e("\x1B[8m","\x1B[28m"),strikethrough:e("\x1B[9m","\x1B[29m"),black:e("\x1B[30m","\x1B[39m"),red:e("\x1B[31m","\x1B[39m"),green:e("\x1B[32m","\x1B[39m"),yellow:e("\x1B[33m","\x1B[39m"),blue:e("\x1B[34m","\x1B[39m"),magenta:e("\x1B[35m","\x1B[39m"),cyan:e("\x1B[36m","\x1B[39m"),white:e("\x1B[37m","\x1B[39m"),gray:e("\x1B[90m","\x1B[39m"),bgBlack:e("\x1B[40m","\x1B[49m"),bgRed:e("\x1B[41m","\x1B[49m"),bgGreen:e("\x1B[42m","\x1B[49m"),bgYellow:e("\x1B[43m","\x1B[49m"),bgBlue:e("\x1B[44m","\x1B[49m"),bgMagenta:e("\x1B[45m","\x1B[49m"),bgCyan:e("\x1B[46m","\x1B[49m"),bgWhite:e("\x1B[47m","\x1B[49m"),blackBright:e("\x1B[90m","\x1B[39m"),redBright:e("\x1B[91m","\x1B[39m"),greenBright:e("\x1B[92m","\x1B[39m"),yellowBright:e("\x1B[93m","\x1B[39m"),blueBright:e("\x1B[94m","\x1B[39m"),magentaBright:e("\x1B[95m","\x1B[39m"),cyanBright:e("\x1B[96m","\x1B[39m"),whiteBright:e("\x1B[97m","\x1B[39m"),bgBlackBright:e("\x1B[100m","\x1B[49m"),bgRedBright:e("\x1B[101m","\x1B[49m"),bgGreenBright:e("\x1B[102m","\x1B[49m"),bgYellowBright:e("\x1B[103m","\x1B[49m"),bgBlueBright:e("\x1B[104m","\x1B[49m"),bgMagentaBright:e("\x1B[105m","\x1B[49m"),bgCyanBright:e("\x1B[106m","\x1B[49m"),bgWhiteBright:e("\x1B[107m","\x1B[49m")}};tn.exports=gi();tn.exports.createColors=gi});var Fs=x((RS,ws)=>{"use strict";ws.exports=Ss;Ss.sync=$D;var ys=M("fs");function _D(t,e){var r=e.pathExt!==void 0?e.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(var n=0;n<r.length;n++){var o=r[n].toLowerCase();if(o&&t.substr(-o.length).toLowerCase()===o)return!0}return!1}function Cs(t,e,r){return!t.isSymbolicLink()&&!t.isFile()?!1:_D(e,r)}function Ss(t,e,r){ys.stat(t,function(n,o){r(n,n?!1:Cs(o,t,e))})}function $D(t,e){return Cs(ys.statSync(t),t,e)}});var $s=x((MS,_s)=>{"use strict";_s.exports=As;As.sync=BD;var xs=M("fs");function As(t,e,r){xs.stat(t,function(n,o){r(n,n?!1:Os(o,e))})}function BD(t,e){return Os(xs.statSync(t),e)}function Os(t,e){return t.isFile()&&TD(t,e)}function TD(t,e){var r=t.mode,n=t.uid,o=t.gid,s=e.uid!==void 0?e.uid:process.getuid&&process.getuid(),i=e.gid!==void 0?e.gid:process.getgid&&process.getgid(),a=parseInt("100",8),u=parseInt("010",8),c=parseInt("001",8),l=a|u,p=r&c||r&u&&o===i||r&a&&n===s||r&l&&s===0;return p}});var Ts=x((kS,Bs)=>{"use strict";var PS=M("fs"),kt;process.platform==="win32"||global.TESTING_WINDOWS?kt=Fs():kt=$s();Bs.exports=$n;$n.sync=vD;function $n(t,e,r){if(typeof e=="function"&&(r=e,e={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(n,o){$n(t,e||{},function(s,i){s?o(s):n(i)})})}kt(t,e||{},function(n,o){n&&(n.code==="EACCES"||e&&e.ignoreErrors)&&(n=null,o=!1),r(n,o)})}function vD(t,e){try{return kt.sync(t,e||{})}catch(r){if(e&&e.ignoreErrors||r.code==="EACCES")return!1;throw r}}});var Ls=x((LS,ks)=>{"use strict";var _e=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",vs=M("path"),ID=_e?";":":",Is=Ts(),Rs=t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),Ms=(t,e)=>{let r=e.colon||ID,n=t.match(/\//)||_e&&t.match(/\\/)?[""]:[..._e?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(r)],o=_e?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",s=_e?o.split(r):[""];return _e&&t.indexOf(".")!==-1&&s[0]!==""&&s.unshift(""),{pathEnv:n,pathExt:s,pathExtExe:o}},Ps=(t,e,r)=>{typeof e=="function"&&(r=e,e={}),e||(e={});let{pathEnv:n,pathExt:o,pathExtExe:s}=Ms(t,e),i=[],a=c=>new Promise((l,p)=>{if(c===n.length)return e.all&&i.length?l(i):p(Rs(t));let d=n[c],m=/^".*"$/.test(d)?d.slice(1,-1):d,f=vs.join(m,t),g=!m&&/^\.[\\\/]/.test(t)?t.slice(0,2)+f:f;l(u(g,c,0))}),u=(c,l,p)=>new Promise((d,m)=>{if(p===o.length)return d(a(l+1));let f=o[p];Is(c+f,{pathExt:s},(g,S)=>{if(!g&&S)if(e.all)i.push(c+f);else return d(c+f);return d(u(c,l,p+1))})});return r?a(0).then(c=>r(null,c),r):a(0)},RD=(t,e)=>{e=e||{};let{pathEnv:r,pathExt:n,pathExtExe:o}=Ms(t,e),s=[];for(let i=0;i<r.length;i++){let a=r[i],u=/^".*"$/.test(a)?a.slice(1,-1):a,c=vs.join(u,t),l=!u&&/^\.[\\\/]/.test(t)?t.slice(0,2)+c:c;for(let p=0;p<n.length;p++){let d=l+n[p];try{if(Is.sync(d,{pathExt:o}))if(e.all)s.push(d);else return d}catch{}}}if(e.all&&s.length)return s;if(e.nothrow)return null;throw Rs(t)};ks.exports=Ps;Ps.sync=RD});var Ns=x((jS,Bn)=>{"use strict";var js=(t={})=>{let e=t.env||process.env;return(t.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"};Bn.exports=js;Bn.exports.default=js});var Ws=x((NS,Gs)=>{"use strict";var Us=M("path"),MD=Ls(),PD=Ns();function Vs(t,e){let r=t.options.env||process.env,n=process.cwd(),o=t.options.cwd!=null,s=o&&process.chdir!==void 0&&!process.chdir.disabled;if(s)try{process.chdir(t.options.cwd)}catch{}let i;try{i=MD.sync(t.command,{path:r[PD({env:r})],pathExt:e?Us.delimiter:void 0})}catch{}finally{s&&process.chdir(n)}return i&&(i=Us.resolve(o?t.options.cwd:"",i)),i}function kD(t){return Vs(t)||Vs(t,!0)}Gs.exports=kD});var Hs=x((US,vn)=>{"use strict";var Tn=/([()\][%!^"`<>&|;, *?])/g;function LD(t){return t=t.replace(Tn,"^$1"),t}function jD(t,e){return t=`${t}`,t=t.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),t=t.replace(/(?=(\\+?)?)\1$/,"$1$1"),t=`"${t}"`,t=t.replace(Tn,"^$1"),e&&(t=t.replace(Tn,"^$1")),t}vn.exports.command=LD;vn.exports.argument=jD});var qs=x((VS,zs)=>{"use strict";zs.exports=/^#!(.*)/});var Ks=x((GS,Ys)=>{"use strict";var ND=qs();Ys.exports=(t="")=>{let e=t.match(ND);if(!e)return null;let[r,n]=e[0].replace(/#! ?/,"").split(" "),o=r.split("/").pop();return o==="env"?n:n?`${o} ${n}`:o}});var Xs=x((WS,Js)=>{"use strict";var In=M("fs"),UD=Ks();function VD(t){let r=Buffer.alloc(150),n;try{n=In.openSync(t,"r"),In.readSync(n,r,0,150,0),In.closeSync(n)}catch{}return UD(r.toString())}Js.exports=VD});var ta=x((HS,ea)=>{"use strict";var GD=M("path"),Zs=Ws(),Qs=Hs(),WD=Xs(),HD=process.platform==="win32",zD=/\.(?:com|exe)$/i,qD=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function YD(t){t.file=Zs(t);let e=t.file&&WD(t.file);return e?(t.args.unshift(t.file),t.command=e,Zs(t)):t.file}function KD(t){if(!HD)return t;let e=YD(t),r=!zD.test(e);if(t.options.forceShell||r){let n=qD.test(e);t.command=GD.normalize(t.command),t.command=Qs.command(t.command),t.args=t.args.map(s=>Qs.argument(s,n));let o=[t.command].concat(t.args).join(" ");t.args=["/d","/s","/c",`"${o}"`],t.command=process.env.comspec||"cmd.exe",t.options.windowsVerbatimArguments=!0}return t}function JD(t,e,r){e&&!Array.isArray(e)&&(r=e,e=null),e=e?e.slice(0):[],r=Object.assign({},r);let n={command:t,args:e,options:r,file:void 0,original:{command:t,args:e}};return r.shell?n:KD(n)}ea.exports=JD});var oa=x((zS,na)=>{"use strict";var Rn=process.platform==="win32";function Mn(t,e){return Object.assign(new Error(`${e} ${t.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${e} ${t.command}`,path:t.command,spawnargs:t.args})}function XD(t,e){if(!Rn)return;let r=t.emit;t.emit=function(n,o){if(n==="exit"){let s=ra(o,e);if(s)return r.call(t,"error",s)}return r.apply(t,arguments)}}function ra(t,e){return Rn&&t===1&&!e.file?Mn(e.original,"spawn"):null}function ZD(t,e){return Rn&&t===1&&!e.file?Mn(e.original,"spawnSync"):null}na.exports={hookChildProcess:XD,verifyENOENT:ra,verifyENOENTSync:ZD,notFoundError:Mn}});var aa=x((qS,$e)=>{"use strict";var ia=M("child_process"),Pn=ta(),kn=oa();function sa(t,e,r){let n=Pn(t,e,r),o=ia.spawn(n.command,n.args,n.options);return kn.hookChildProcess(o,n),o}function QD(t,e,r){let n=Pn(t,e,r),o=ia.spawnSync(n.command,n.args,n.options);return o.error=o.error||kn.verifyENOENTSync(o.status,n),o}$e.exports=sa;$e.exports.spawn=sa;$e.exports.sync=QD;$e.exports._parse=Pn;$e.exports._enoent=kn});var Di=ie(di(),1),{program:hy,createCommand:gy,createArgument:by,createOption:Ey,CommanderError:yy,InvalidArgumentError:Cy,InvalidOptionArgumentError:Sy,Command:mi,Argument:wy,Option:Fy,Help:xy}=Di.default;import{stripVTControlCharacters as cn}from"util";var v=ie(en(),1),_i=ie(Ve(),1);import{stdin as Ai,stdout as Oi}from"process";import*as se from"readline";import bi from"readline";import{Writable as Gp}from"stream";function Wp({onlyFirst:t=!1}={}){let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(e,t?void 0:"g")}var Hp=Wp();function $i(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(Hp,"")}function Bi(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Ti={exports:{}};(function(t){var e={};t.exports=e,e.eastAsianWidth=function(n){var o=n.charCodeAt(0),s=n.length==2?n.charCodeAt(1):0,i=o;return 55296<=o&&o<=56319&&56320<=s&&s<=57343&&(o&=1023,s&=1023,i=o<<10|s,i+=65536),i==12288||65281<=i&&i<=65376||65504<=i&&i<=65510?"F":i==8361||65377<=i&&i<=65470||65474<=i&&i<=65479||65482<=i&&i<=65487||65490<=i&&i<=65495||65498<=i&&i<=65500||65512<=i&&i<=65518?"H":4352<=i&&i<=4447||4515<=i&&i<=4519||4602<=i&&i<=4607||9001<=i&&i<=9002||11904<=i&&i<=11929||11931<=i&&i<=12019||12032<=i&&i<=12245||12272<=i&&i<=12283||12289<=i&&i<=12350||12353<=i&&i<=12438||12441<=i&&i<=12543||12549<=i&&i<=12589||12593<=i&&i<=12686||12688<=i&&i<=12730||12736<=i&&i<=12771||12784<=i&&i<=12830||12832<=i&&i<=12871||12880<=i&&i<=13054||13056<=i&&i<=19903||19968<=i&&i<=42124||42128<=i&&i<=42182||43360<=i&&i<=43388||44032<=i&&i<=55203||55216<=i&&i<=55238||55243<=i&&i<=55291||63744<=i&&i<=64255||65040<=i&&i<=65049||65072<=i&&i<=65106||65108<=i&&i<=65126||65128<=i&&i<=65131||110592<=i&&i<=110593||127488<=i&&i<=127490||127504<=i&&i<=127546||127552<=i&&i<=127560||127568<=i&&i<=127569||131072<=i&&i<=194367||177984<=i&&i<=196605||196608<=i&&i<=262141?"W":32<=i&&i<=126||162<=i&&i<=163||165<=i&&i<=166||i==172||i==175||10214<=i&&i<=10221||10629<=i&&i<=10630?"Na":i==161||i==164||167<=i&&i<=168||i==170||173<=i&&i<=174||176<=i&&i<=180||182<=i&&i<=186||188<=i&&i<=191||i==198||i==208||215<=i&&i<=216||222<=i&&i<=225||i==230||232<=i&&i<=234||236<=i&&i<=237||i==240||242<=i&&i<=243||247<=i&&i<=250||i==252||i==254||i==257||i==273||i==275||i==283||294<=i&&i<=295||i==299||305<=i&&i<=307||i==312||319<=i&&i<=322||i==324||328<=i&&i<=331||i==333||338<=i&&i<=339||358<=i&&i<=359||i==363||i==462||i==464||i==466||i==468||i==470||i==472||i==474||i==476||i==593||i==609||i==708||i==711||713<=i&&i<=715||i==717||i==720||728<=i&&i<=731||i==733||i==735||768<=i&&i<=879||913<=i&&i<=929||931<=i&&i<=937||945<=i&&i<=961||963<=i&&i<=969||i==1025||1040<=i&&i<=1103||i==1105||i==8208||8211<=i&&i<=8214||8216<=i&&i<=8217||8220<=i&&i<=8221||8224<=i&&i<=8226||8228<=i&&i<=8231||i==8240||8242<=i&&i<=8243||i==8245||i==8251||i==8254||i==8308||i==8319||8321<=i&&i<=8324||i==8364||i==8451||i==8453||i==8457||i==8467||i==8470||8481<=i&&i<=8482||i==8486||i==8491||8531<=i&&i<=8532||8539<=i&&i<=8542||8544<=i&&i<=8555||8560<=i&&i<=8569||i==8585||8592<=i&&i<=8601||8632<=i&&i<=8633||i==8658||i==8660||i==8679||i==8704||8706<=i&&i<=8707||8711<=i&&i<=8712||i==8715||i==8719||i==8721||i==8725||i==8730||8733<=i&&i<=8736||i==8739||i==8741||8743<=i&&i<=8748||i==8750||8756<=i&&i<=8759||8764<=i&&i<=8765||i==8776||i==8780||i==8786||8800<=i&&i<=8801||8804<=i&&i<=8807||8810<=i&&i<=8811||8814<=i&&i<=8815||8834<=i&&i<=8835||8838<=i&&i<=8839||i==8853||i==8857||i==8869||i==8895||i==8978||9312<=i&&i<=9449||9451<=i&&i<=9547||9552<=i&&i<=9587||9600<=i&&i<=9615||9618<=i&&i<=9621||9632<=i&&i<=9633||9635<=i&&i<=9641||9650<=i&&i<=9651||9654<=i&&i<=9655||9660<=i&&i<=9661||9664<=i&&i<=9665||9670<=i&&i<=9672||i==9675||9678<=i&&i<=9681||9698<=i&&i<=9701||i==9711||9733<=i&&i<=9734||i==9737||9742<=i&&i<=9743||9748<=i&&i<=9749||i==9756||i==9758||i==9792||i==9794||9824<=i&&i<=9825||9827<=i&&i<=9829||9831<=i&&i<=9834||9836<=i&&i<=9837||i==9839||9886<=i&&i<=9887||9918<=i&&i<=9919||9924<=i&&i<=9933||9935<=i&&i<=9953||i==9955||9960<=i&&i<=9983||i==10045||i==10071||10102<=i&&i<=10111||11093<=i&&i<=11097||12872<=i&&i<=12879||57344<=i&&i<=63743||65024<=i&&i<=65039||i==65533||127232<=i&&i<=127242||127248<=i&&i<=127277||127280<=i&&i<=127337||127344<=i&&i<=127386||917760<=i&&i<=917999||983040<=i&&i<=1048573||1048576<=i&&i<=1114109?"A":"N"},e.characterLength=function(n){var o=this.eastAsianWidth(n);return o=="F"||o=="W"||o=="A"?2:1};function r(n){return n.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}e.length=function(n){for(var o=r(n),s=0,i=0;i<o.length;i++)s=s+this.characterLength(o[i]);return s},e.slice=function(n,o,s){textLen=e.length(n),o=o||0,s=s||1,o<0&&(o=textLen+o),s<0&&(s=textLen+s);for(var i="",a=0,u=r(n),c=0;c<u.length;c++){var l=u[c],p=e.length(l);if(a>=o-(p==2?1:0))if(a+p<=s)i+=l;else break;a+=p}return i}})(Ti);var zp=Ti.exports,qp=Bi(zp),Yp=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g},Kp=Bi(Yp);function Ge(t,e={}){if(typeof t!="string"||t.length===0||(e={ambiguousIsNarrow:!0,...e},t=$i(t),t.length===0))return 0;t=t.replace(Kp()," ");let r=e.ambiguousIsNarrow?1:2,n=0;for(let o of t){let s=o.codePointAt(0);if(!(s<=31||s>=127&&s<=159||s>=768&&s<=879))switch(qp.eastAsianWidth(o)){case"F":case"W":n+=2;break;case"A":n+=r;break;default:n+=1}}return n}var rn=10,Ei=(t=0)=>e=>`\x1B[${e+t}m`,yi=(t=0)=>e=>`\x1B[${38+t};5;${e}m`,Ci=(t=0)=>(e,r,n)=>`\x1B[${38+t};2;${e};${r};${n}m`,w={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(w.modifier);var Jp=Object.keys(w.color),Xp=Object.keys(w.bgColor);[...Jp,...Xp];function Zp(){let t=new Map;for(let[e,r]of Object.entries(w)){for(let[n,o]of Object.entries(r))w[n]={open:`\x1B[${o[0]}m`,close:`\x1B[${o[1]}m`},r[n]=w[n],t.set(o[0],o[1]);Object.defineProperty(w,e,{value:r,enumerable:!1})}return Object.defineProperty(w,"codes",{value:t,enumerable:!1}),w.color.close="\x1B[39m",w.bgColor.close="\x1B[49m",w.color.ansi=Ei(),w.color.ansi256=yi(),w.color.ansi16m=Ci(),w.bgColor.ansi=Ei(rn),w.bgColor.ansi256=yi(rn),w.bgColor.ansi16m=Ci(rn),Object.defineProperties(w,{rgbToAnsi256:{value:(e,r,n)=>e===r&&r===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5),enumerable:!1},hexToRgb:{value:e=>{let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!r)return[0,0,0];let[n]=r;n.length===3&&(n=[...n].map(s=>s+s).join(""));let o=Number.parseInt(n,16);return[o>>16&255,o>>8&255,o&255]},enumerable:!1},hexToAnsi256:{value:e=>w.rgbToAnsi256(...w.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value:e=>{if(e<8)return 30+e;if(e<16)return 90+(e-8);let r,n,o;if(e>=232)r=((e-232)*10+8)/255,n=r,o=r;else{e-=16;let a=e%36;r=Math.floor(e/36)/5,n=Math.floor(a/6)/5,o=a%6/5}let s=Math.max(r,n,o)*2;if(s===0)return 30;let i=30+(Math.round(o)<<2|Math.round(n)<<1|Math.round(r));return s===2&&(i+=60),i},enumerable:!1},rgbToAnsi:{value:(e,r,n)=>w.ansi256ToAnsi(w.rgbToAnsi256(e,r,n)),enumerable:!1},hexToAnsi:{value:e=>w.ansi256ToAnsi(w.hexToAnsi256(e)),enumerable:!1}}),w}var Qp=Zp(),Ct=new Set(["\x1B","\x9B"]),ed=39,sn="\x07",vi="[",td="]",Ii="m",an=`${td}8;;`,Si=t=>`${Ct.values().next().value}${vi}${t}${Ii}`,wi=t=>`${Ct.values().next().value}${an}${t}${sn}`,rd=t=>t.split(" ").map(e=>Ge(e)),nn=(t,e,r)=>{let n=[...e],o=!1,s=!1,i=Ge($i(t[t.length-1]));for(let[a,u]of n.entries()){let c=Ge(u);if(i+c<=r?t[t.length-1]+=u:(t.push(u),i=0),Ct.has(u)&&(o=!0,s=n.slice(a+1).join("").startsWith(an)),o){s?u===sn&&(o=!1,s=!1):u===Ii&&(o=!1);continue}i+=c,i===r&&a<n.length-1&&(t.push(""),i=0)}!i&&t[t.length-1].length>0&&t.length>1&&(t[t.length-2]+=t.pop())},nd=t=>{let e=t.split(" "),r=e.length;for(;r>0&&!(Ge(e[r-1])>0);)r--;return r===e.length?t:e.slice(0,r).join(" ")+e.slice(r).join("")},od=(t,e,r={})=>{if(r.trim!==!1&&t.trim()==="")return"";let n="",o,s,i=rd(t),a=[""];for(let[c,l]of t.split(" ").entries()){r.trim!==!1&&(a[a.length-1]=a[a.length-1].trimStart());let p=Ge(a[a.length-1]);if(c!==0&&(p>=e&&(r.wordWrap===!1||r.trim===!1)&&(a.push(""),p=0),(p>0||r.trim===!1)&&(a[a.length-1]+=" ",p++)),r.hard&&i[c]>e){let d=e-p,m=1+Math.floor((i[c]-d-1)/e);Math.floor((i[c]-1)/e)<m&&a.push(""),nn(a,l,e);continue}if(p+i[c]>e&&p>0&&i[c]>0){if(r.wordWrap===!1&&p<e){nn(a,l,e);continue}a.push("")}if(p+i[c]>e&&r.wordWrap===!1){nn(a,l,e);continue}a[a.length-1]+=l}r.trim!==!1&&(a=a.map(c=>nd(c)));let u=[...a.join(`
|
|
30
|
-
`)];for(let[c,l]of u.entries()){if(n+=l,
|
|
31
|
-
`?(s&&(n+=
|
|
32
|
-
`&&(o&&p&&(n+=
|
|
29
|
+
`)}),this}_outputHelpIfRequested(e){let r=this._getHelpOption();r&&e.find(o=>r.is(o))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function si(t){return t.map(e=>{if(!e.startsWith("--inspect"))return e;let r,n="127.0.0.1",o="9229",s;return(s=e.match(/^(--inspect(-brk)?)$/))!==null?r=s[1]:(s=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=s[1],/^\d+$/.test(s[3])?o=s[3]:n=s[3]):(s=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=s[1],n=s[3],o=s[4]),r&&o!=="0"?`${r}=${n}:${parseInt(o)+1}`:e})}function Zr(){if(b.env.NO_COLOR||b.env.FORCE_COLOR==="0"||b.env.FORCE_COLOR==="false")return!1;if(b.env.FORCE_COLOR||b.env.CLICOLOR_FORCE!==void 0)return!0}Qr.Command=Xr;Qr.useColor=Zr});var pi=x(k=>{"use strict";var{Argument:ui}=ct(),{Command:en}=ai(),{CommanderError:Rp,InvalidArgumentError:ci}=Ue(),{Help:Mp}=Wr(),{Option:li}=Yr();k.program=new en;k.createCommand=t=>new en(t);k.createOption=(t,e)=>new li(t,e);k.createArgument=(t,e)=>new ui(t,e);k.Command=en;k.Option=li;k.Argument=ui;k.Help=Mp;k.CommanderError=Rp;k.InvalidArgumentError=ci;k.InvalidOptionArgumentError=ci});var rn=x((FC,mi)=>{"use strict";var tn={to(t,e){return e?`\x1B[${e+1};${t+1}H`:`\x1B[${t+1}G`},move(t,e){let r="";return t<0?r+=`\x1B[${-t}D`:t>0&&(r+=`\x1B[${t}C`),e<0?r+=`\x1B[${-e}A`:e>0&&(r+=`\x1B[${e}B`),r},up:(t=1)=>`\x1B[${t}A`,down:(t=1)=>`\x1B[${t}B`,forward:(t=1)=>`\x1B[${t}C`,backward:(t=1)=>`\x1B[${t}D`,nextLine:(t=1)=>"\x1B[E".repeat(t),prevLine:(t=1)=>"\x1B[F".repeat(t),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},Pp={up:(t=1)=>"\x1B[S".repeat(t),down:(t=1)=>"\x1B[T".repeat(t)},kp={screen:"\x1B[2J",up:(t=1)=>"\x1B[1J".repeat(t),down:(t=1)=>"\x1B[J".repeat(t),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines(t){let e="";for(let r=0;r<t;r++)e+=this.line+(r<t-1?tn.up():"");return t&&(e+=tn.left),e}};mi.exports={cursor:tn,scroll:Pp,erase:kp,beep:"\x07"}});var Ve=x((wC,nn)=>{"use strict";var Dt=process||{},fi=Dt.argv||[],pt=Dt.env||{},Lp=!(pt.NO_COLOR||fi.includes("--no-color"))&&(!!pt.FORCE_COLOR||fi.includes("--color")||Dt.platform==="win32"||(Dt.stdout||{}).isTTY&&pt.TERM!=="dumb"||!!pt.CI),jp=(t,e,r=t)=>n=>{let o=""+n,s=o.indexOf(e,t.length);return~s?t+Np(o,e,r,s)+e:t+o+e},Np=(t,e,r,n)=>{let o="",s=0;do o+=t.substring(s,n)+r,s=n+e.length,n=t.indexOf(e,s);while(~n);return o+t.substring(s)},hi=(t=Lp)=>{let e=t?jp:()=>String;return{isColorSupported:t,reset:e("\x1B[0m","\x1B[0m"),bold:e("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:e("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:e("\x1B[3m","\x1B[23m"),underline:e("\x1B[4m","\x1B[24m"),inverse:e("\x1B[7m","\x1B[27m"),hidden:e("\x1B[8m","\x1B[28m"),strikethrough:e("\x1B[9m","\x1B[29m"),black:e("\x1B[30m","\x1B[39m"),red:e("\x1B[31m","\x1B[39m"),green:e("\x1B[32m","\x1B[39m"),yellow:e("\x1B[33m","\x1B[39m"),blue:e("\x1B[34m","\x1B[39m"),magenta:e("\x1B[35m","\x1B[39m"),cyan:e("\x1B[36m","\x1B[39m"),white:e("\x1B[37m","\x1B[39m"),gray:e("\x1B[90m","\x1B[39m"),bgBlack:e("\x1B[40m","\x1B[49m"),bgRed:e("\x1B[41m","\x1B[49m"),bgGreen:e("\x1B[42m","\x1B[49m"),bgYellow:e("\x1B[43m","\x1B[49m"),bgBlue:e("\x1B[44m","\x1B[49m"),bgMagenta:e("\x1B[45m","\x1B[49m"),bgCyan:e("\x1B[46m","\x1B[49m"),bgWhite:e("\x1B[47m","\x1B[49m"),blackBright:e("\x1B[90m","\x1B[39m"),redBright:e("\x1B[91m","\x1B[39m"),greenBright:e("\x1B[92m","\x1B[39m"),yellowBright:e("\x1B[93m","\x1B[39m"),blueBright:e("\x1B[94m","\x1B[39m"),magentaBright:e("\x1B[95m","\x1B[39m"),cyanBright:e("\x1B[96m","\x1B[39m"),whiteBright:e("\x1B[97m","\x1B[39m"),bgBlackBright:e("\x1B[100m","\x1B[49m"),bgRedBright:e("\x1B[101m","\x1B[49m"),bgGreenBright:e("\x1B[102m","\x1B[49m"),bgYellowBright:e("\x1B[103m","\x1B[49m"),bgBlueBright:e("\x1B[104m","\x1B[49m"),bgMagentaBright:e("\x1B[105m","\x1B[49m"),bgCyanBright:e("\x1B[106m","\x1B[49m"),bgWhiteBright:e("\x1B[107m","\x1B[49m")}};nn.exports=hi();nn.exports.createColors=hi});var ws=x((_S,Fs)=>{"use strict";Fs.exports=Ss;Ss.sync=Od;var Cs=R("fs");function Ad(t,e){var r=e.pathExt!==void 0?e.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(var n=0;n<r.length;n++){var o=r[n].toLowerCase();if(o&&t.substr(-o.length).toLowerCase()===o)return!0}return!1}function ys(t,e,r){return!t.isSymbolicLink()&&!t.isFile()?!1:Ad(e,r)}function Ss(t,e,r){Cs.stat(t,function(n,o){r(n,n?!1:ys(o,t,e))})}function Od(t,e){return ys(Cs.statSync(t),t,e)}});var _s=x((BS,$s)=>{"use strict";$s.exports=As;As.sync=$d;var xs=R("fs");function As(t,e,r){xs.stat(t,function(n,o){r(n,n?!1:Os(o,e))})}function $d(t,e){return Os(xs.statSync(t),e)}function Os(t,e){return t.isFile()&&_d(t,e)}function _d(t,e){var r=t.mode,n=t.uid,o=t.gid,s=e.uid!==void 0?e.uid:process.getuid&&process.getuid(),i=e.gid!==void 0?e.gid:process.getgid&&process.getgid(),a=parseInt("100",8),u=parseInt("010",8),c=parseInt("001",8),l=a|u,p=r&c||r&u&&o===i||r&a&&n===s||r&l&&s===0;return p}});var Ts=x((vS,Bs)=>{"use strict";var TS=R("fs"),Pt;process.platform==="win32"||global.TESTING_WINDOWS?Pt=ws():Pt=_s();Bs.exports=_n;_n.sync=Bd;function _n(t,e,r){if(typeof e=="function"&&(r=e,e={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(n,o){_n(t,e||{},function(s,i){s?o(s):n(i)})})}Pt(t,e||{},function(n,o){n&&(n.code==="EACCES"||e&&e.ignoreErrors)&&(n=null,o=!1),r(n,o)})}function Bd(t,e){try{return Pt.sync(t,e||{})}catch(r){if(e&&e.ignoreErrors||r.code==="EACCES")return!1;throw r}}});var Ls=x((IS,ks)=>{"use strict";var Oe=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",vs=R("path"),Td=Oe?";":":",Is=Ts(),Rs=t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),Ms=(t,e)=>{let r=e.colon||Td,n=t.match(/\//)||Oe&&t.match(/\\/)?[""]:[...Oe?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(r)],o=Oe?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",s=Oe?o.split(r):[""];return Oe&&t.indexOf(".")!==-1&&s[0]!==""&&s.unshift(""),{pathEnv:n,pathExt:s,pathExtExe:o}},Ps=(t,e,r)=>{typeof e=="function"&&(r=e,e={}),e||(e={});let{pathEnv:n,pathExt:o,pathExtExe:s}=Ms(t,e),i=[],a=c=>new Promise((l,p)=>{if(c===n.length)return e.all&&i.length?l(i):p(Rs(t));let D=n[c],m=/^".*"$/.test(D)?D.slice(1,-1):D,f=vs.join(m,t),g=!m&&/^\.[\\\/]/.test(t)?t.slice(0,2)+f:f;l(u(g,c,0))}),u=(c,l,p)=>new Promise((D,m)=>{if(p===o.length)return D(a(l+1));let f=o[p];Is(c+f,{pathExt:s},(g,S)=>{if(!g&&S)if(e.all)i.push(c+f);else return D(c+f);return D(u(c,l,p+1))})});return r?a(0).then(c=>r(null,c),r):a(0)},vd=(t,e)=>{e=e||{};let{pathEnv:r,pathExt:n,pathExtExe:o}=Ms(t,e),s=[];for(let i=0;i<r.length;i++){let a=r[i],u=/^".*"$/.test(a)?a.slice(1,-1):a,c=vs.join(u,t),l=!u&&/^\.[\\\/]/.test(t)?t.slice(0,2)+c:c;for(let p=0;p<n.length;p++){let D=l+n[p];try{if(Is.sync(D,{pathExt:o}))if(e.all)s.push(D);else return D}catch{}}}if(e.all&&s.length)return s;if(e.nothrow)return null;throw Rs(t)};ks.exports=Ps;Ps.sync=vd});var Ns=x((RS,Bn)=>{"use strict";var js=(t={})=>{let e=t.env||process.env;return(t.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"};Bn.exports=js;Bn.exports.default=js});var Ws=x((MS,Gs)=>{"use strict";var Us=R("path"),Id=Ls(),Rd=Ns();function Vs(t,e){let r=t.options.env||process.env,n=process.cwd(),o=t.options.cwd!=null,s=o&&process.chdir!==void 0&&!process.chdir.disabled;if(s)try{process.chdir(t.options.cwd)}catch{}let i;try{i=Id.sync(t.command,{path:r[Rd({env:r})],pathExt:e?Us.delimiter:void 0})}catch{}finally{s&&process.chdir(n)}return i&&(i=Us.resolve(o?t.options.cwd:"",i)),i}function Md(t){return Vs(t)||Vs(t,!0)}Gs.exports=Md});var Hs=x((PS,vn)=>{"use strict";var Tn=/([()\][%!^"`<>&|;, *?])/g;function Pd(t){return t=t.replace(Tn,"^$1"),t}function kd(t,e){return t=`${t}`,t=t.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),t=t.replace(/(?=(\\+?)?)\1$/,"$1$1"),t=`"${t}"`,t=t.replace(Tn,"^$1"),e&&(t=t.replace(Tn,"^$1")),t}vn.exports.command=Pd;vn.exports.argument=kd});var qs=x((kS,zs)=>{"use strict";zs.exports=/^#!(.*)/});var Ks=x((LS,Ys)=>{"use strict";var Ld=qs();Ys.exports=(t="")=>{let e=t.match(Ld);if(!e)return null;let[r,n]=e[0].replace(/#! ?/,"").split(" "),o=r.split("/").pop();return o==="env"?n:n?`${o} ${n}`:o}});var Xs=x((jS,Js)=>{"use strict";var In=R("fs"),jd=Ks();function Nd(t){let r=Buffer.alloc(150),n;try{n=In.openSync(t,"r"),In.readSync(n,r,0,150,0),In.closeSync(n)}catch{}return jd(r.toString())}Js.exports=Nd});var ta=x((NS,ea)=>{"use strict";var Ud=R("path"),Zs=Ws(),Qs=Hs(),Vd=Xs(),Gd=process.platform==="win32",Wd=/\.(?:com|exe)$/i,Hd=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function zd(t){t.file=Zs(t);let e=t.file&&Vd(t.file);return e?(t.args.unshift(t.file),t.command=e,Zs(t)):t.file}function qd(t){if(!Gd)return t;let e=zd(t),r=!Wd.test(e);if(t.options.forceShell||r){let n=Hd.test(e);t.command=Ud.normalize(t.command),t.command=Qs.command(t.command),t.args=t.args.map(s=>Qs.argument(s,n));let o=[t.command].concat(t.args).join(" ");t.args=["/d","/s","/c",`"${o}"`],t.command=process.env.comspec||"cmd.exe",t.options.windowsVerbatimArguments=!0}return t}function Yd(t,e,r){e&&!Array.isArray(e)&&(r=e,e=null),e=e?e.slice(0):[],r=Object.assign({},r);let n={command:t,args:e,options:r,file:void 0,original:{command:t,args:e}};return r.shell?n:qd(n)}ea.exports=Yd});var oa=x((US,na)=>{"use strict";var Rn=process.platform==="win32";function Mn(t,e){return Object.assign(new Error(`${e} ${t.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${e} ${t.command}`,path:t.command,spawnargs:t.args})}function Kd(t,e){if(!Rn)return;let r=t.emit;t.emit=function(n,o){if(n==="exit"){let s=ra(o,e);if(s)return r.call(t,"error",s)}return r.apply(t,arguments)}}function ra(t,e){return Rn&&t===1&&!e.file?Mn(e.original,"spawn"):null}function Jd(t,e){return Rn&&t===1&&!e.file?Mn(e.original,"spawnSync"):null}na.exports={hookChildProcess:Kd,verifyENOENT:ra,verifyENOENTSync:Jd,notFoundError:Mn}});var aa=x((VS,$e)=>{"use strict";var ia=R("child_process"),Pn=ta(),kn=oa();function sa(t,e,r){let n=Pn(t,e,r),o=ia.spawn(n.command,n.args,n.options);return kn.hookChildProcess(o,n),o}function Xd(t,e,r){let n=Pn(t,e,r),o=ia.spawnSync(n.command,n.args,n.options);return o.error=o.error||kn.verifyENOENTSync(o.status,n),o}$e.exports=sa;$e.exports.spawn=sa;$e.exports.sync=Xd;$e.exports._parse=Pn;$e.exports._enoent=kn});var Di=ie(pi(),1),{program:DC,createCommand:dC,createArgument:mC,createOption:fC,CommanderError:hC,InvalidArgumentError:gC,InvalidOptionArgumentError:bC,Command:di,Argument:EC,Option:CC,Help:yC}=Di.default;import{stripVTControlCharacters as pn}from"util";var v=ie(rn(),1),Oi=ie(Ve(),1);import{stdin as xi,stdout as Ai}from"process";import*as se from"readline";import gi from"readline";import{Writable as Up}from"stream";function Vp({onlyFirst:t=!1}={}){let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(e,t?void 0:"g")}var Gp=Vp();function $i(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(Gp,"")}function _i(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Bi={exports:{}};(function(t){var e={};t.exports=e,e.eastAsianWidth=function(n){var o=n.charCodeAt(0),s=n.length==2?n.charCodeAt(1):0,i=o;return 55296<=o&&o<=56319&&56320<=s&&s<=57343&&(o&=1023,s&=1023,i=o<<10|s,i+=65536),i==12288||65281<=i&&i<=65376||65504<=i&&i<=65510?"F":i==8361||65377<=i&&i<=65470||65474<=i&&i<=65479||65482<=i&&i<=65487||65490<=i&&i<=65495||65498<=i&&i<=65500||65512<=i&&i<=65518?"H":4352<=i&&i<=4447||4515<=i&&i<=4519||4602<=i&&i<=4607||9001<=i&&i<=9002||11904<=i&&i<=11929||11931<=i&&i<=12019||12032<=i&&i<=12245||12272<=i&&i<=12283||12289<=i&&i<=12350||12353<=i&&i<=12438||12441<=i&&i<=12543||12549<=i&&i<=12589||12593<=i&&i<=12686||12688<=i&&i<=12730||12736<=i&&i<=12771||12784<=i&&i<=12830||12832<=i&&i<=12871||12880<=i&&i<=13054||13056<=i&&i<=19903||19968<=i&&i<=42124||42128<=i&&i<=42182||43360<=i&&i<=43388||44032<=i&&i<=55203||55216<=i&&i<=55238||55243<=i&&i<=55291||63744<=i&&i<=64255||65040<=i&&i<=65049||65072<=i&&i<=65106||65108<=i&&i<=65126||65128<=i&&i<=65131||110592<=i&&i<=110593||127488<=i&&i<=127490||127504<=i&&i<=127546||127552<=i&&i<=127560||127568<=i&&i<=127569||131072<=i&&i<=194367||177984<=i&&i<=196605||196608<=i&&i<=262141?"W":32<=i&&i<=126||162<=i&&i<=163||165<=i&&i<=166||i==172||i==175||10214<=i&&i<=10221||10629<=i&&i<=10630?"Na":i==161||i==164||167<=i&&i<=168||i==170||173<=i&&i<=174||176<=i&&i<=180||182<=i&&i<=186||188<=i&&i<=191||i==198||i==208||215<=i&&i<=216||222<=i&&i<=225||i==230||232<=i&&i<=234||236<=i&&i<=237||i==240||242<=i&&i<=243||247<=i&&i<=250||i==252||i==254||i==257||i==273||i==275||i==283||294<=i&&i<=295||i==299||305<=i&&i<=307||i==312||319<=i&&i<=322||i==324||328<=i&&i<=331||i==333||338<=i&&i<=339||358<=i&&i<=359||i==363||i==462||i==464||i==466||i==468||i==470||i==472||i==474||i==476||i==593||i==609||i==708||i==711||713<=i&&i<=715||i==717||i==720||728<=i&&i<=731||i==733||i==735||768<=i&&i<=879||913<=i&&i<=929||931<=i&&i<=937||945<=i&&i<=961||963<=i&&i<=969||i==1025||1040<=i&&i<=1103||i==1105||i==8208||8211<=i&&i<=8214||8216<=i&&i<=8217||8220<=i&&i<=8221||8224<=i&&i<=8226||8228<=i&&i<=8231||i==8240||8242<=i&&i<=8243||i==8245||i==8251||i==8254||i==8308||i==8319||8321<=i&&i<=8324||i==8364||i==8451||i==8453||i==8457||i==8467||i==8470||8481<=i&&i<=8482||i==8486||i==8491||8531<=i&&i<=8532||8539<=i&&i<=8542||8544<=i&&i<=8555||8560<=i&&i<=8569||i==8585||8592<=i&&i<=8601||8632<=i&&i<=8633||i==8658||i==8660||i==8679||i==8704||8706<=i&&i<=8707||8711<=i&&i<=8712||i==8715||i==8719||i==8721||i==8725||i==8730||8733<=i&&i<=8736||i==8739||i==8741||8743<=i&&i<=8748||i==8750||8756<=i&&i<=8759||8764<=i&&i<=8765||i==8776||i==8780||i==8786||8800<=i&&i<=8801||8804<=i&&i<=8807||8810<=i&&i<=8811||8814<=i&&i<=8815||8834<=i&&i<=8835||8838<=i&&i<=8839||i==8853||i==8857||i==8869||i==8895||i==8978||9312<=i&&i<=9449||9451<=i&&i<=9547||9552<=i&&i<=9587||9600<=i&&i<=9615||9618<=i&&i<=9621||9632<=i&&i<=9633||9635<=i&&i<=9641||9650<=i&&i<=9651||9654<=i&&i<=9655||9660<=i&&i<=9661||9664<=i&&i<=9665||9670<=i&&i<=9672||i==9675||9678<=i&&i<=9681||9698<=i&&i<=9701||i==9711||9733<=i&&i<=9734||i==9737||9742<=i&&i<=9743||9748<=i&&i<=9749||i==9756||i==9758||i==9792||i==9794||9824<=i&&i<=9825||9827<=i&&i<=9829||9831<=i&&i<=9834||9836<=i&&i<=9837||i==9839||9886<=i&&i<=9887||9918<=i&&i<=9919||9924<=i&&i<=9933||9935<=i&&i<=9953||i==9955||9960<=i&&i<=9983||i==10045||i==10071||10102<=i&&i<=10111||11093<=i&&i<=11097||12872<=i&&i<=12879||57344<=i&&i<=63743||65024<=i&&i<=65039||i==65533||127232<=i&&i<=127242||127248<=i&&i<=127277||127280<=i&&i<=127337||127344<=i&&i<=127386||917760<=i&&i<=917999||983040<=i&&i<=1048573||1048576<=i&&i<=1114109?"A":"N"},e.characterLength=function(n){var o=this.eastAsianWidth(n);return o=="F"||o=="W"||o=="A"?2:1};function r(n){return n.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}e.length=function(n){for(var o=r(n),s=0,i=0;i<o.length;i++)s=s+this.characterLength(o[i]);return s},e.slice=function(n,o,s){textLen=e.length(n),o=o||0,s=s||1,o<0&&(o=textLen+o),s<0&&(s=textLen+s);for(var i="",a=0,u=r(n),c=0;c<u.length;c++){var l=u[c],p=e.length(l);if(a>=o-(p==2?1:0))if(a+p<=s)i+=l;else break;a+=p}return i}})(Bi);var Wp=Bi.exports,Hp=_i(Wp),zp=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g},qp=_i(zp);function Ge(t,e={}){if(typeof t!="string"||t.length===0||(e={ambiguousIsNarrow:!0,...e},t=$i(t),t.length===0))return 0;t=t.replace(qp()," ");let r=e.ambiguousIsNarrow?1:2,n=0;for(let o of t){let s=o.codePointAt(0);if(!(s<=31||s>=127&&s<=159||s>=768&&s<=879))switch(Hp.eastAsianWidth(o)){case"F":case"W":n+=2;break;case"A":n+=r;break;default:n+=1}}return n}var on=10,bi=(t=0)=>e=>`\x1B[${e+t}m`,Ei=(t=0)=>e=>`\x1B[${38+t};5;${e}m`,Ci=(t=0)=>(e,r,n)=>`\x1B[${38+t};2;${e};${r};${n}m`,F={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(F.modifier);var Yp=Object.keys(F.color),Kp=Object.keys(F.bgColor);[...Yp,...Kp];function Jp(){let t=new Map;for(let[e,r]of Object.entries(F)){for(let[n,o]of Object.entries(r))F[n]={open:`\x1B[${o[0]}m`,close:`\x1B[${o[1]}m`},r[n]=F[n],t.set(o[0],o[1]);Object.defineProperty(F,e,{value:r,enumerable:!1})}return Object.defineProperty(F,"codes",{value:t,enumerable:!1}),F.color.close="\x1B[39m",F.bgColor.close="\x1B[49m",F.color.ansi=bi(),F.color.ansi256=Ei(),F.color.ansi16m=Ci(),F.bgColor.ansi=bi(on),F.bgColor.ansi256=Ei(on),F.bgColor.ansi16m=Ci(on),Object.defineProperties(F,{rgbToAnsi256:{value:(e,r,n)=>e===r&&r===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5),enumerable:!1},hexToRgb:{value:e=>{let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!r)return[0,0,0];let[n]=r;n.length===3&&(n=[...n].map(s=>s+s).join(""));let o=Number.parseInt(n,16);return[o>>16&255,o>>8&255,o&255]},enumerable:!1},hexToAnsi256:{value:e=>F.rgbToAnsi256(...F.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value:e=>{if(e<8)return 30+e;if(e<16)return 90+(e-8);let r,n,o;if(e>=232)r=((e-232)*10+8)/255,n=r,o=r;else{e-=16;let a=e%36;r=Math.floor(e/36)/5,n=Math.floor(a/6)/5,o=a%6/5}let s=Math.max(r,n,o)*2;if(s===0)return 30;let i=30+(Math.round(o)<<2|Math.round(n)<<1|Math.round(r));return s===2&&(i+=60),i},enumerable:!1},rgbToAnsi:{value:(e,r,n)=>F.ansi256ToAnsi(F.rgbToAnsi256(e,r,n)),enumerable:!1},hexToAnsi:{value:e=>F.ansi256ToAnsi(F.hexToAnsi256(e)),enumerable:!1}}),F}var Xp=Jp(),bt=new Set(["\x1B","\x9B"]),Zp=39,un="\x07",Ti="[",Qp="]",vi="m",cn=`${Qp}8;;`,yi=t=>`${bt.values().next().value}${Ti}${t}${vi}`,Si=t=>`${bt.values().next().value}${cn}${t}${un}`,eD=t=>t.split(" ").map(e=>Ge(e)),sn=(t,e,r)=>{let n=[...e],o=!1,s=!1,i=Ge($i(t[t.length-1]));for(let[a,u]of n.entries()){let c=Ge(u);if(i+c<=r?t[t.length-1]+=u:(t.push(u),i=0),bt.has(u)&&(o=!0,s=n.slice(a+1).join("").startsWith(cn)),o){s?u===un&&(o=!1,s=!1):u===vi&&(o=!1);continue}i+=c,i===r&&a<n.length-1&&(t.push(""),i=0)}!i&&t[t.length-1].length>0&&t.length>1&&(t[t.length-2]+=t.pop())},tD=t=>{let e=t.split(" "),r=e.length;for(;r>0&&!(Ge(e[r-1])>0);)r--;return r===e.length?t:e.slice(0,r).join(" ")+e.slice(r).join("")},rD=(t,e,r={})=>{if(r.trim!==!1&&t.trim()==="")return"";let n="",o,s,i=eD(t),a=[""];for(let[c,l]of t.split(" ").entries()){r.trim!==!1&&(a[a.length-1]=a[a.length-1].trimStart());let p=Ge(a[a.length-1]);if(c!==0&&(p>=e&&(r.wordWrap===!1||r.trim===!1)&&(a.push(""),p=0),(p>0||r.trim===!1)&&(a[a.length-1]+=" ",p++)),r.hard&&i[c]>e){let D=e-p,m=1+Math.floor((i[c]-D-1)/e);Math.floor((i[c]-1)/e)<m&&a.push(""),sn(a,l,e);continue}if(p+i[c]>e&&p>0&&i[c]>0){if(r.wordWrap===!1&&p<e){sn(a,l,e);continue}a.push("")}if(p+i[c]>e&&r.wordWrap===!1){sn(a,l,e);continue}a[a.length-1]+=l}r.trim!==!1&&(a=a.map(c=>tD(c)));let u=[...a.join(`
|
|
30
|
+
`)];for(let[c,l]of u.entries()){if(n+=l,bt.has(l)){let{groups:D}=new RegExp(`(?:\\${Ti}(?<code>\\d+)m|\\${cn}(?<uri>.*)${un})`).exec(u.slice(c).join(""))||{groups:{}};if(D.code!==void 0){let m=Number.parseFloat(D.code);o=m===Zp?void 0:m}else D.uri!==void 0&&(s=D.uri.length===0?void 0:D.uri)}let p=Xp.codes.get(Number(o));u[c+1]===`
|
|
31
|
+
`?(s&&(n+=Si("")),o&&p&&(n+=yi(p))):l===`
|
|
32
|
+
`&&(o&&p&&(n+=yi(o)),s&&(n+=Si(s)))}return n};function Fi(t,e,r){return String(t).normalize().replace(/\r\n/g,`
|
|
33
33
|
`).split(`
|
|
34
|
-
`).map(n=>
|
|
35
|
-
`)}var
|
|
34
|
+
`).map(n=>rD(n,e,r)).join(`
|
|
35
|
+
`)}var nD=["up","down","left","right","space","enter","cancel"],mt={actions:new Set(nD),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["","cancel"],["escape","cancel"]])};function ln(t,e){if(typeof t=="string")return mt.aliases.get(t)===e;for(let r of t)if(r!==void 0&&ln(r,e))return!0;return!1}function oD(t,e){if(t===e)return;let r=t.split(`
|
|
36
36
|
`),n=e.split(`
|
|
37
|
-
`),o=[];for(let s=0;s<Math.max(r.length,n.length);s++)r[s]!==n[s]&&o.push(s);return o}var
|
|
38
|
-
`),
|
|
39
|
-
`).length-1;this.output.write(v.cursor.move(-999,e*-1))}render(){let e=Fi(this._render(this)??"",process.stdout.columns,{hard:!0});if(e!==this._prevFrame){if(this.state==="initial")this.output.write(v.cursor.hide);else{let r=
|
|
37
|
+
`),o=[];for(let s=0;s<Math.max(r.length,n.length);s++)r[s]!==n[s]&&o.push(s);return o}var iD=globalThis.process.platform.startsWith("win"),an=Symbol("clack:cancel");function De(t){return t===an}function dt(t,e){let r=t;r.isTTY&&r.setRawMode(e)}function Ii({input:t=xi,output:e=Ai,overwrite:r=!0,hideCursor:n=!0}={}){let o=se.createInterface({input:t,output:e,prompt:"",tabSize:1});se.emitKeypressEvents(t,o),t.isTTY&&t.setRawMode(!0);let s=(i,{name:a,sequence:u})=>{let c=String(i);if(ln([c,a,u],"cancel")){n&&e.write(v.cursor.show),process.exit(0);return}if(!r)return;se.moveCursor(e,a==="return"?0:-1,a==="return"?-1:0,()=>{se.clearLine(e,1,()=>{t.once("keypress",s)})})};return n&&e.write(v.cursor.hide),t.once("keypress",s),()=>{t.off("keypress",s),n&&e.write(v.cursor.show),t.isTTY&&!iD&&t.setRawMode(!1),o.terminal=!1,o.close()}}var sD=Object.defineProperty,aD=(t,e,r)=>e in t?sD(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,M=(t,e,r)=>(aD(t,typeof e!="symbol"?e+"":e,r),r),We=class{constructor(e,r=!0){M(this,"input"),M(this,"output"),M(this,"_abortSignal"),M(this,"rl"),M(this,"opts"),M(this,"_render"),M(this,"_track",!1),M(this,"_prevFrame",""),M(this,"_subscribers",new Map),M(this,"_cursor",0),M(this,"state","initial"),M(this,"error",""),M(this,"value");let{input:n=xi,output:o=Ai,render:s,signal:i,...a}=e;this.opts=a,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=s.bind(this),this._track=r,this._abortSignal=i,this.input=n,this.output=o}unsubscribe(){this._subscribers.clear()}setSubscriber(e,r){let n=this._subscribers.get(e)??[];n.push(r),this._subscribers.set(e,n)}on(e,r){this.setSubscriber(e,{cb:r})}once(e,r){this.setSubscriber(e,{cb:r,once:!0})}emit(e,...r){let n=this._subscribers.get(e)??[],o=[];for(let s of n)s.cb(...r),s.once&&o.push(()=>n.splice(n.indexOf(s),1));for(let s of o)s()}prompt(){return new Promise((e,r)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),e(an);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}let n=new Up;n._write=(o,s,i)=>{this._track&&(this.value=this.rl?.line.replace(/\t/g,""),this._cursor=this.rl?.cursor??0,this.emit("value",this.value)),i()},this.input.pipe(n),this.rl=gi.createInterface({input:this.input,output:n,tabSize:2,prompt:"",escapeCodeTimeout:50,terminal:!0}),gi.emitKeypressEvents(this.input,this.rl),this.rl.prompt(),this.opts.initialValue!==void 0&&this._track&&this.rl.write(this.opts.initialValue),this.input.on("keypress",this.onKeypress),dt(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(v.cursor.show),this.output.off("resize",this.render),dt(this.input,!1),e(this.value)}),this.once("cancel",()=>{this.output.write(v.cursor.show),this.output.off("resize",this.render),dt(this.input,!1),e(an)})})}onKeypress(e,r){if(this.state==="error"&&(this.state="active"),r?.name&&(!this._track&&mt.aliases.has(r.name)&&this.emit("cursor",mt.aliases.get(r.name)),mt.actions.has(r.name)&&this.emit("cursor",r.name)),e&&(e.toLowerCase()==="y"||e.toLowerCase()==="n")&&this.emit("confirm",e.toLowerCase()==="y"),e===" "&&this.opts.placeholder&&(this.value||(this.rl?.write(this.opts.placeholder),this.emit("value",this.opts.placeholder))),e&&this.emit("key",e.toLowerCase()),r?.name==="return"){if(!this.value&&this.opts.placeholder&&(this.rl?.write(this.opts.placeholder),this.emit("value",this.opts.placeholder)),this.opts.validate){let n=this.opts.validate(this.value);n&&(this.error=n instanceof Error?n.message:n,this.state="error",this.rl?.write(this.value))}this.state!=="error"&&(this.state="submit")}ln([e,r?.name,r?.sequence],"cancel")&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
|
|
38
|
+
`),dt(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let e=Fi(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
|
|
39
|
+
`).length-1;this.output.write(v.cursor.move(-999,e*-1))}render(){let e=Fi(this._render(this)??"",process.stdout.columns,{hard:!0});if(e!==this._prevFrame){if(this.state==="initial")this.output.write(v.cursor.hide);else{let r=oD(this._prevFrame,e);if(this.restoreCursor(),r&&r?.length===1){let n=r[0];this.output.write(v.cursor.move(0,n)),this.output.write(v.erase.lines(1));let o=e.split(`
|
|
40
40
|
`);this.output.write(o[n]),this._prevFrame=e,this.output.write(v.cursor.move(0,o.length-n-1));return}if(r&&r?.length>1){let n=r[0];this.output.write(v.cursor.move(0,n)),this.output.write(v.erase.down());let o=e.split(`
|
|
41
41
|
`).slice(n);this.output.write(o.join(`
|
|
42
|
-
`)),this._prevFrame=e;return}this.output.write(v.erase.down())}this.output.write(e),this.state==="initial"&&(this.state="active"),this._prevFrame=e}}},
|
|
43
|
-
${
|
|
44
|
-
`,r=t.placeholder?
|
|
45
|
-
${
|
|
46
|
-
${
|
|
47
|
-
`;case"submit":return`${e}${
|
|
48
|
-
${
|
|
49
|
-
${
|
|
50
|
-
`}}}).prompt();var
|
|
51
|
-
${
|
|
52
|
-
`,o=this.value?e:r;switch(this.state){case"submit":return`${n}${
|
|
53
|
-
${
|
|
54
|
-
${
|
|
55
|
-
`}}}).prompt()},
|
|
56
|
-
${
|
|
57
|
-
`;switch(this.state){case"submit":return`${r}${
|
|
58
|
-
${
|
|
59
|
-
${
|
|
60
|
-
${
|
|
61
|
-
`}}}).prompt()};var
|
|
42
|
+
`)),this._prevFrame=e;return}this.output.write(v.erase.down())}this.output.write(e),this.state==="initial"&&(this.state="active"),this._prevFrame=e}}},ft=class extends We{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(e){super(e,!1),this.value=!!e.initialValue,this.on("value",()=>{this.value=this._value}),this.on("confirm",r=>{this.output.write(v.cursor.move(0,-1)),this.value=r,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}};var uD;uD=new WeakMap;var cD=Object.defineProperty,lD=(t,e,r)=>e in t?cD(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,wi=(t,e,r)=>(lD(t,typeof e!="symbol"?e+"":e,r),r),ht=class extends We{constructor(e){super(e,!1),wi(this,"options"),wi(this,"cursor",0),this.options=e.options,this.cursor=this.options.findIndex(({value:r})=>r===e.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",r=>{switch(r){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break}this.changeValue()})}get _value(){return this.options[this.cursor]}changeValue(){this.value=this._value.value}};var gt=class extends We{get valueWithCursor(){if(this.state==="submit")return this.value;if(this.cursor>=this.value.length)return`${this.value}\u2588`;let e=this.value.slice(0,this.cursor),[r,...n]=this.value.slice(this.cursor);return`${e}${Oi.default.inverse(r)}${n.join("")}`}get cursor(){return this._cursor}constructor(e){super(e),this.on("finalize",()=>{this.value||(this.value=e.defaultValue)})}};var d=ie(Ve(),1),Et=ie(rn(),1);import N from"process";function pD(){return N.platform!=="win32"?N.env.TERM!=="linux":!!N.env.CI||!!N.env.WT_SESSION||!!N.env.TERMINUS_SUBLIME||N.env.ConEmuTask==="{cmd::Cmder}"||N.env.TERM_PROGRAM==="Terminus-Sublime"||N.env.TERM_PROGRAM==="vscode"||N.env.TERM==="xterm-256color"||N.env.TERM==="alacritty"||N.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var Dn=pD(),A=(t,e)=>Dn?t:e,DD=A("\u25C6","*"),Mi=A("\u25A0","x"),Pi=A("\u25B2","x"),Ct=A("\u25C7","o"),dD=A("\u250C","T"),y=A("\u2502","|"),Se=A("\u2514","\u2014"),dn=A("\u25CF",">"),mn=A("\u25CB"," "),kC=A("\u25FB","[\u2022]"),LC=A("\u25FC","[+]"),jC=A("\u25FB","[ ]"),NC=A("\u25AA","\u2022"),Ri=A("\u2500","-"),mD=A("\u256E","+"),fD=A("\u251C","+"),hD=A("\u256F","+"),gD=A("\u25CF","\u2022"),bD=A("\u25C6","*"),ED=A("\u25B2","!"),CD=A("\u25A0","x"),fn=t=>{switch(t){case"initial":case"active":return d.default.cyan(DD);case"cancel":return d.default.red(Mi);case"error":return d.default.yellow(Pi);case"submit":return d.default.green(Ct)}},yD=t=>{let{cursor:e,options:r,style:n}=t,o=t.maxItems??Number.POSITIVE_INFINITY,s=Math.max(process.stdout.rows-4,0),i=Math.min(s,Math.max(o,5)),a=0;e>=a+i-3?a=Math.max(Math.min(e-i+3,r.length-i),0):e<a+2&&(a=Math.max(e-2,0));let u=i<r.length&&a>0,c=i<r.length&&a+i<r.length;return r.slice(a,a+i).map((l,p,D)=>{let m=p===0&&u,f=p===D.length-1&&c;return m||f?d.default.dim("..."):n(l,p+a===e)})},ki=t=>new gt({validate:t.validate,placeholder:t.placeholder,defaultValue:t.defaultValue,initialValue:t.initialValue,render(){let e=`${d.default.gray(y)}
|
|
43
|
+
${fn(this.state)} ${t.message}
|
|
44
|
+
`,r=t.placeholder?d.default.inverse(t.placeholder[0])+d.default.dim(t.placeholder.slice(1)):d.default.inverse(d.default.hidden("_")),n=this.value?this.valueWithCursor:r;switch(this.state){case"error":return`${e.trim()}
|
|
45
|
+
${d.default.yellow(y)} ${n}
|
|
46
|
+
${d.default.yellow(Se)} ${d.default.yellow(this.error)}
|
|
47
|
+
`;case"submit":return`${e}${d.default.gray(y)} ${d.default.dim(this.value||t.placeholder)}`;case"cancel":return`${e}${d.default.gray(y)} ${d.default.strikethrough(d.default.dim(this.value??""))}${this.value?.trim()?`
|
|
48
|
+
${d.default.gray(y)}`:""}`;default:return`${e}${d.default.cyan(y)} ${n}
|
|
49
|
+
${d.default.cyan(Se)}
|
|
50
|
+
`}}}).prompt();var hn=t=>{let e=t.active??"Yes",r=t.inactive??"No";return new ft({active:e,inactive:r,initialValue:t.initialValue??!0,render(){let n=`${d.default.gray(y)}
|
|
51
|
+
${fn(this.state)} ${t.message}
|
|
52
|
+
`,o=this.value?e:r;switch(this.state){case"submit":return`${n}${d.default.gray(y)} ${d.default.dim(o)}`;case"cancel":return`${n}${d.default.gray(y)} ${d.default.strikethrough(d.default.dim(o))}
|
|
53
|
+
${d.default.gray(y)}`;default:return`${n}${d.default.cyan(y)} ${this.value?`${d.default.green(dn)} ${e}`:`${d.default.dim(mn)} ${d.default.dim(e)}`} ${d.default.dim("/")} ${this.value?`${d.default.dim(mn)} ${d.default.dim(r)}`:`${d.default.green(dn)} ${r}`}
|
|
54
|
+
${d.default.cyan(Se)}
|
|
55
|
+
`}}}).prompt()},Li=t=>{let e=(r,n)=>{let o=r.label??String(r.value);switch(n){case"selected":return`${d.default.dim(o)}`;case"active":return`${d.default.green(dn)} ${o} ${r.hint?d.default.dim(`(${r.hint})`):""}`;case"cancelled":return`${d.default.strikethrough(d.default.dim(o))}`;default:return`${d.default.dim(mn)} ${d.default.dim(o)}`}};return new ht({options:t.options,initialValue:t.initialValue,render(){let r=`${d.default.gray(y)}
|
|
56
|
+
${fn(this.state)} ${t.message}
|
|
57
|
+
`;switch(this.state){case"submit":return`${r}${d.default.gray(y)} ${e(this.options[this.cursor],"selected")}`;case"cancel":return`${r}${d.default.gray(y)} ${e(this.options[this.cursor],"cancelled")}
|
|
58
|
+
${d.default.gray(y)}`;default:return`${r}${d.default.cyan(y)} ${yD({cursor:this.cursor,options:this.options,maxItems:t.maxItems,style:(n,o)=>e(n,o?"active":"inactive")}).join(`
|
|
59
|
+
${d.default.cyan(y)} `)}
|
|
60
|
+
${d.default.cyan(Se)}
|
|
61
|
+
`}}}).prompt()};var ji=(t="",e="")=>{let r=`
|
|
62
62
|
${t}
|
|
63
63
|
`.split(`
|
|
64
|
-
`),n=
|
|
65
|
-
`);process.stdout.write(`${
|
|
66
|
-
${
|
|
64
|
+
`),n=pn(e).length,o=Math.max(r.reduce((i,a)=>{let u=pn(a);return u.length>i?u.length:i},0),n)+2,s=r.map(i=>`${d.default.gray(y)} ${d.default.dim(i)}${" ".repeat(o-pn(i).length)}${d.default.gray(y)}`).join(`
|
|
65
|
+
`);process.stdout.write(`${d.default.gray(y)}
|
|
66
|
+
${d.default.green(Ct)} ${d.default.reset(e)} ${d.default.gray(Ri.repeat(Math.max(o-n-1,1))+mD)}
|
|
67
67
|
${s}
|
|
68
|
-
${
|
|
69
|
-
`)},
|
|
68
|
+
${d.default.gray(fD+Ri.repeat(o+2)+hD)}
|
|
69
|
+
`)},U=(t="")=>{process.stdout.write(`${d.default.gray(Se)} ${d.default.red(t)}
|
|
70
70
|
|
|
71
|
-
`)},Ni=(t="")=>{process.stdout.write(`${
|
|
72
|
-
`)},Ui=(t="")=>{process.stdout.write(`${
|
|
73
|
-
${
|
|
71
|
+
`)},Ni=(t="")=>{process.stdout.write(`${d.default.gray(dD)} ${t}
|
|
72
|
+
`)},Ui=(t="")=>{process.stdout.write(`${d.default.gray(y)}
|
|
73
|
+
${d.default.gray(Se)} ${t}
|
|
74
74
|
|
|
75
|
-
`)},
|
|
76
|
-
`);r.push(`${e} ${n}`,...o.map(s=>`${
|
|
75
|
+
`)},z={message:(t="",{symbol:e=d.default.gray(y)}={})=>{let r=[`${d.default.gray(y)}`];if(t){let[n,...o]=t.split(`
|
|
76
|
+
`);r.push(`${e} ${n}`,...o.map(s=>`${d.default.gray(y)} ${s}`))}process.stdout.write(`${r.join(`
|
|
77
77
|
`)}
|
|
78
|
-
`)},info:t=>{
|
|
79
|
-
`);let
|
|
80
|
-
`);process.stdout.write(
|
|
81
|
-
`);let
|
|
82
|
-
`):process.stdout.write(`${
|
|
83
|
-
`),f(),o()};return{start
|
|
84
|
-
`?(i-=1,a+=1):c==="u"&&e[a+2]==="{"?a=e.indexOf("}",a+3):a+=
|
|
85
|
-
`]),
|
|
78
|
+
`)},info:t=>{z.message(t,{symbol:d.default.blue(gD)})},success:t=>{z.message(t,{symbol:d.default.green(bD)})},step:t=>{z.message(t,{symbol:d.default.green(Ct)})},warn:t=>{z.message(t,{symbol:d.default.yellow(ED)})},warning:t=>{z.warn(t)},error:t=>{z.message(t,{symbol:d.default.red(CD)})}},UC=`${d.default.gray(y)} `;var Vi=({indicator:t="dots"}={})=>{let e=Dn?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],r=Dn?80:120,n=process.env.CI==="true",o,s,i=!1,a="",u,c=performance.now(),l=C=>{let w=C>1?"Something went wrong":"Canceled";i&&T(w,C)},p=()=>l(2),D=()=>l(1),m=()=>{process.on("uncaughtExceptionMonitor",p),process.on("unhandledRejection",p),process.on("SIGINT",D),process.on("SIGTERM",D),process.on("exit",l)},f=()=>{process.removeListener("uncaughtExceptionMonitor",p),process.removeListener("unhandledRejection",p),process.removeListener("SIGINT",D),process.removeListener("SIGTERM",D),process.removeListener("exit",l)},g=()=>{if(u===void 0)return;n&&process.stdout.write(`
|
|
79
|
+
`);let C=u.split(`
|
|
80
|
+
`);process.stdout.write(Et.cursor.move(-999,C.length-1)),process.stdout.write(Et.erase.down(C.length))},S=C=>C.replace(/\.+$/,""),E=C=>{let w=(performance.now()-C)/1e3,_=Math.floor(w/60),I=Math.floor(w%60);return _>0?`[${_}m ${I}s]`:`[${I}s]`},$=(C="")=>{i=!0,o=Ii(),a=S(C),c=performance.now(),process.stdout.write(`${d.default.gray(y)}
|
|
81
|
+
`);let w=0,_=0;m(),s=setInterval(()=>{if(n&&a===u)return;g(),u=a;let I=d.default.magenta(e[w]);if(n)process.stdout.write(`${I} ${a}...`);else if(t==="timer")process.stdout.write(`${I} ${a} ${E(c)}`);else{let ne=".".repeat(Math.floor(_)).slice(0,3);process.stdout.write(`${I} ${a}${ne}`)}w=w+1<e.length?w+1:0,_=_<e.length?_+.125:0},r)},T=(C="",w=0)=>{i=!1,clearInterval(s),g();let _=w===0?d.default.green(Ct):w===1?d.default.red(Mi):d.default.red(Pi);a=S(C??a),t==="timer"?process.stdout.write(`${_} ${a} ${E(c)}
|
|
82
|
+
`):process.stdout.write(`${_} ${a}
|
|
83
|
+
`),f(),o()};return{start:$,stop:T,message:(C="")=>{a=S(C??a)}}};var Zo=ie(Ve(),1);import SD from"net";import FD from"os";var Ft=class extends Error{constructor(e){super(`${e} is locked`)}},Fe={old:new Set,young:new Set},wD=1e3*15,yt=1024,St=65535,He,xD=()=>{let t=FD.networkInterfaces(),e=new Set([void 0,"0.0.0.0"]);for(let r of Object.values(t))for(let n of r)e.add(n.address);return e},Gi=t=>new Promise((e,r)=>{let n=SD.createServer();n.unref(),n.on("error",r),n.listen(t,()=>{let{port:o}=n.address();n.close(()=>{e(o)})})}),Wi=async(t,e)=>{if(t.host||t.port===0)return Gi(t);for(let r of e)try{await Gi({port:t.port,host:r})}catch(n){if(!["EADDRNOTAVAIL","EINVAL"].includes(n.code))throw n}return t.port},AD=function*(t){t&&(yield*t),yield 0};async function bn(t){let e,r=new Set;if(t&&(t.port&&(e=typeof t.port=="number"?[t.port]:t.port),t.exclude)){let o=t.exclude;if(typeof o[Symbol.iterator]!="function")throw new TypeError("The `exclude` option must be an iterable.");for(let s of o){if(typeof s!="number")throw new TypeError("Each item in the `exclude` option must be a number corresponding to the port you want excluded.");if(!Number.isSafeInteger(s))throw new TypeError(`Number ${s} in the exclude option is not a safe integer and can't be used`)}r=new Set(o)}He===void 0&&(He=setTimeout(()=>{He=void 0,Fe.old=Fe.young,Fe.young=new Set},wD),He.unref&&He.unref());let n=xD();for(let o of AD(e))try{if(r.has(o))continue;let s=await Wi({...t,port:o},n);for(;Fe.old.has(s)||Fe.young.has(s);){if(o!==0)throw new Ft(o);s=await Wi({...t,port:o},n)}return Fe.young.add(s),s}catch(s){if(!["EADDRINUSE","EACCES"].includes(s.code)&&!(s instanceof Ft))throw s}throw new Error("No available ports found")}function Hi(t,e){if(!Number.isInteger(t)||!Number.isInteger(e))throw new TypeError("`from` and `to` must be integer numbers");if(t<yt||t>St)throw new RangeError(`'from' must be between ${yt} and ${St}`);if(e<yt||e>St)throw new RangeError(`'to' must be between ${yt} and ${St}`);if(t>e)throw new RangeError("`to` must be greater than or equal to `from`");return function*(n,o){for(let s=n;s<=o;s++)yield s}(t,e)}async function zi(t){let e=t.directory??await ki({message:"Where would you like to create your project?",placeholder:"./my-store",defaultValue:"./my-store",validate(s){if(!s)return"Please enter a directory"}});De(e)&&(U("Setup cancelled."),process.exit(0));let r;if(t.backendOnly!==void 0)r=t.backendOnly?"backend-only":"full-stack";else{let s=await Li({message:"What would you like to set up?",options:[{value:"full-stack",label:"Full-stack (Backend + Storefront)"},{value:"backend-only",label:"Backend only"}]});De(s)&&(U("Setup cancelled."),process.exit(0)),r=s}let n;if(t.noSampleData!==void 0)n=!t.noSampleData;else{let s=await hn({message:"Include sample data? (products, categories, images)",initialValue:!0});De(s)&&(U("Setup cancelled."),process.exit(0)),n=s}let o;if(t.noStart!==void 0)o=!t.noStart;else{let s=await hn({message:"Start services now? (requires Docker)",initialValue:!0});De(s)&&(U("Setup cancelled."),process.exit(0)),o=s}return{directory:e,mode:r,sampleData:n,start:o,packageManager:t.packageManager??"npm"}}var ye=ie(Ve(),1);import pe from"fs";import Ce from"path";function O(t){if(typeof t!="object"||t===null)return!1;let e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}import{fileURLToPath as OD}from"url";var we=(t,e)=>{let r=Cn($D(t));if(typeof r!="string")throw new TypeError(`${e} must be a string or a file URL: ${r}.`);return r},$D=t=>En(t)?t.toString():t,En=t=>typeof t!="string"&&t&&Object.getPrototypeOf(t)===String.prototype,Cn=t=>t instanceof URL?OD(t):t;var wt=(t,e=[],r={})=>{let n=we(t,"First argument"),[o,s]=O(e)?[[],e]:[e,r];if(!Array.isArray(o))throw new TypeError(`Second argument must be either an array of arguments or an options object: ${o}`);if(o.some(u=>typeof u=="object"&&u!==null))throw new TypeError(`Second argument must be an array of strings: ${o}`);let i=o.map(String),a=i.find(u=>u.includes("\0"));if(a!==void 0)throw new TypeError(`Arguments cannot contain null bytes ("\\0"): ${a}`);if(!O(s))throw new TypeError(`Last argument must be an options object: ${s}`);return[n,i,s]};import{ChildProcess as MD}from"child_process";import{StringDecoder as _D}from"string_decoder";var{toString:qi}=Object.prototype,Yi=t=>qi.call(t)==="[object ArrayBuffer]",B=t=>qi.call(t)==="[object Uint8Array]",Q=t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength),BD=new TextEncoder,Ki=t=>BD.encode(t),TD=new TextDecoder,xt=t=>TD.decode(t),Ji=(t,e)=>vD(t,e).join(""),vD=(t,e)=>{if(e==="utf8"&&t.every(s=>typeof s=="string"))return t;let r=new _D(e),n=t.map(s=>typeof s=="string"?Ki(s):s).map(s=>r.write(s)),o=r.end();return o===""?n:[...n,o]},ze=t=>t.length===1&&B(t[0])?t[0]:yn(ID(t)),ID=t=>t.map(e=>typeof e=="string"?Ki(e):e),yn=t=>{let e=new Uint8Array(RD(t)),r=0;for(let n of t)e.set(n,r),r+=n.length;return e},RD=t=>{let e=0;for(let r of t)e+=r.length;return e};var es=t=>Array.isArray(t)&&Array.isArray(t.raw),ts=(t,e)=>{let r=[];for(let[s,i]of t.entries())r=PD({templates:t,expressions:e,tokens:r,index:s,template:i});if(r.length===0)throw new TypeError("Template script must not be empty");let[n,...o]=r;return[n,o,{}]},PD=({templates:t,expressions:e,tokens:r,index:n,template:o})=>{if(o===void 0)throw new TypeError(`Invalid backslash sequence: ${t.raw[n]}`);let{nextTokens:s,leadingWhitespaces:i,trailingWhitespaces:a}=kD(o,t.raw[n]),u=Zi(r,s,i);if(n===e.length)return u;let c=e[n],l=Array.isArray(c)?c.map(p=>Qi(p)):[Qi(c)];return Zi(u,l,a)},kD=(t,e)=>{if(e.length===0)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};let r=[],n=0,o=Xi.has(e[0]);for(let i=0,a=0;i<t.length;i+=1,a+=1){let u=e[a];if(Xi.has(u))n!==i&&r.push(t.slice(n,i)),n=i+1;else if(u==="\\"){let c=e[a+1];c===`
|
|
84
|
+
`?(i-=1,a+=1):c==="u"&&e[a+2]==="{"?a=e.indexOf("}",a+3):a+=LD[c]??1}}let s=n===t.length;return s||r.push(t.slice(n)),{nextTokens:r,leadingWhitespaces:o,trailingWhitespaces:s}},Xi=new Set([" "," ","\r",`
|
|
85
|
+
`]),LD={x:3,u:5},Zi=(t,e,r)=>r||t.length===0||e.length===0?[...t,...e]:[...t.slice(0,-1),`${t.at(-1)}${e[0]}`,...e.slice(1)],Qi=t=>{let e=typeof t;if(e==="string")return t;if(e==="number")return String(t);if(O(t)&&("stdout"in t||"isMaxBuffer"in t))return jD(t);throw t instanceof MD||Object.prototype.toString.call(t)==="[object Promise]"?new TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}."):new TypeError(`Unexpected "${e}" in template expression`)},jD=({stdout:t})=>{if(typeof t=="string")return t;if(B(t))return xt(t);throw t===void 0?new TypeError(`Missing result.stdout in template expression. This is probably due to the previous subprocess' "stdout" option.`):new TypeError(`Unexpected "${typeof t}" stdout in template expression`)};import{spawnSync as Wg}from"child_process";import{debuglog as ND}from"util";import Sn from"process";var V=t=>At.includes(t),At=[Sn.stdin,Sn.stdout,Sn.stderr],L=["stdin","stdout","stderr"],Ot=t=>L[t]??`stdio[${t}]`;var ns=t=>{let e={...t};for(let r of xn)e[r]=Fn(t,r);return e},Fn=(t,e)=>{let r=Array.from({length:UD(t)+1}),n=VD(t[e],r,e);return qD(n,e)},UD=({stdio:t})=>Array.isArray(t)?Math.max(t.length,L.length):L.length,VD=(t,e,r)=>O(t)?GD(t,e,r):e.fill(t),GD=(t,e,r)=>{for(let n of Object.keys(t).sort(WD))for(let o of HD(n,r,e))e[o]=t[n];return e},WD=(t,e)=>rs(t)<rs(e)?1:-1,rs=t=>t==="stdout"||t==="stderr"?0:t==="all"?2:1,HD=(t,e,r)=>{if(t==="ipc")return[r.length-1];let n=wn(t);if(n===void 0||n===0)throw new TypeError(`"${e}.${t}" is invalid.
|
|
86
86
|
It must be "${e}.stdout", "${e}.stderr", "${e}.all", "${e}.ipc", or "${e}.fd3", "${e}.fd4" (and so on).`);if(n>=r.length)throw new TypeError(`"${e}.${t}" is invalid: that file descriptor does not exist.
|
|
87
|
-
Please set the "stdio" option to ensure that file descriptor exists.`);return n==="all"?[1,2]:[n]},
|
|
87
|
+
Please set the "stdio" option to ensure that file descriptor exists.`);return n==="all"?[1,2]:[n]},wn=t=>{if(t==="all")return t;if(L.includes(t))return L.indexOf(t);let e=zD.exec(t);if(e!==null)return Number(e[1])},zD=/^fd(\d+)$/,qD=(t,e)=>t.map(r=>r===void 0?KD[e]:r),YD=ND("execa").enabled?"full":"none",KD={lines:!1,buffer:!0,maxBuffer:1e3*1e3*100,verbose:YD,stripFinalNewline:!0},xn=["lines","buffer","maxBuffer","verbose","stripFinalNewline"],ee=(t,e)=>e==="ipc"?t.at(-1):t[e];var xe=({verbose:t},e)=>An(t,e)!=="none",Ae=({verbose:t},e)=>!["none","short"].includes(An(t,e)),os=({verbose:t},e)=>{let r=An(t,e);return $t(r)?r:void 0},An=(t,e)=>e===void 0?JD(t):ee(t,e),JD=t=>t.find(e=>$t(e))??_t.findLast(e=>t.includes(e)),$t=t=>typeof t=="function",_t=["none","short","full"];import{inspect as bd}from"util";import{platform as XD}from"process";import{stripVTControlCharacters as ZD}from"util";var is=(t,e)=>{let r=[t,...e],n=r.join(" "),o=r.map(s=>od(ss(s))).join(" ");return{command:n,escapedCommand:o}},qe=t=>ZD(t).split(`
|
|
88
88
|
`).map(e=>ss(e)).join(`
|
|
89
|
-
`),ss=t=>t.replaceAll(
|
|
89
|
+
`),ss=t=>t.replaceAll(td,e=>QD(e)),QD=t=>{let e=rd[t];if(e!==void 0)return e;let r=t.codePointAt(0),n=r.toString(16);return r<=nd?`\\u${n.padStart(4,"0")}`:`\\U${n}`},ed=()=>{try{return new RegExp("\\p{Separator}|\\p{Other}","gu")}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}},td=ed(),rd={" ":" ","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"},nd=65535,od=t=>id.test(t)?t:XD==="win32"?`"${t.replaceAll('"','""')}"`:`'${t.replaceAll("'","'\\''")}'`,id=/^[\w./-]+$/;import as from"process";function On(){let{env:t}=as,{TERM:e,TERM_PROGRAM:r}=t;return as.platform!=="win32"?e!=="linux":!!t.WT_SESSION||!!t.TERMINUS_SUBLIME||t.ConEmuTask==="{cmd::Cmder}"||r==="Terminus-Sublime"||r==="vscode"||e==="xterm-256color"||e==="alacritty"||e==="rxvt-unicode"||e==="rxvt-unicode-256color"||t.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var us={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"\u2588",squareDarkShade:"\u2593",squareMediumShade:"\u2592",squareLightShade:"\u2591",squareTop:"\u2580",squareBottom:"\u2584",squareLeft:"\u258C",squareRight:"\u2590",squareCenter:"\u25A0",bullet:"\u25CF",dot:"\u2024",ellipsis:"\u2026",pointerSmall:"\u203A",triangleUp:"\u25B2",triangleUpSmall:"\u25B4",triangleDown:"\u25BC",triangleDownSmall:"\u25BE",triangleLeftSmall:"\u25C2",triangleRightSmall:"\u25B8",home:"\u2302",heart:"\u2665",musicNote:"\u266A",musicNoteBeamed:"\u266B",arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",arrowLeftRight:"\u2194",arrowUpDown:"\u2195",almostEqual:"\u2248",notEqual:"\u2260",lessOrEqual:"\u2264",greaterOrEqual:"\u2265",identical:"\u2261",infinity:"\u221E",subscriptZero:"\u2080",subscriptOne:"\u2081",subscriptTwo:"\u2082",subscriptThree:"\u2083",subscriptFour:"\u2084",subscriptFive:"\u2085",subscriptSix:"\u2086",subscriptSeven:"\u2087",subscriptEight:"\u2088",subscriptNine:"\u2089",oneHalf:"\xBD",oneThird:"\u2153",oneQuarter:"\xBC",oneFifth:"\u2155",oneSixth:"\u2159",oneEighth:"\u215B",twoThirds:"\u2154",twoFifths:"\u2156",threeQuarters:"\xBE",threeFifths:"\u2157",threeEighths:"\u215C",fourFifths:"\u2158",fiveSixths:"\u215A",fiveEighths:"\u215D",sevenEighths:"\u215E",line:"\u2500",lineBold:"\u2501",lineDouble:"\u2550",lineDashed0:"\u2504",lineDashed1:"\u2505",lineDashed2:"\u2508",lineDashed3:"\u2509",lineDashed4:"\u254C",lineDashed5:"\u254D",lineDashed6:"\u2574",lineDashed7:"\u2576",lineDashed8:"\u2578",lineDashed9:"\u257A",lineDashed10:"\u257C",lineDashed11:"\u257E",lineDashed12:"\u2212",lineDashed13:"\u2013",lineDashed14:"\u2010",lineDashed15:"\u2043",lineVertical:"\u2502",lineVerticalBold:"\u2503",lineVerticalDouble:"\u2551",lineVerticalDashed0:"\u2506",lineVerticalDashed1:"\u2507",lineVerticalDashed2:"\u250A",lineVerticalDashed3:"\u250B",lineVerticalDashed4:"\u254E",lineVerticalDashed5:"\u254F",lineVerticalDashed6:"\u2575",lineVerticalDashed7:"\u2577",lineVerticalDashed8:"\u2579",lineVerticalDashed9:"\u257B",lineVerticalDashed10:"\u257D",lineVerticalDashed11:"\u257F",lineDownLeft:"\u2510",lineDownLeftArc:"\u256E",lineDownBoldLeftBold:"\u2513",lineDownBoldLeft:"\u2512",lineDownLeftBold:"\u2511",lineDownDoubleLeftDouble:"\u2557",lineDownDoubleLeft:"\u2556",lineDownLeftDouble:"\u2555",lineDownRight:"\u250C",lineDownRightArc:"\u256D",lineDownBoldRightBold:"\u250F",lineDownBoldRight:"\u250E",lineDownRightBold:"\u250D",lineDownDoubleRightDouble:"\u2554",lineDownDoubleRight:"\u2553",lineDownRightDouble:"\u2552",lineUpLeft:"\u2518",lineUpLeftArc:"\u256F",lineUpBoldLeftBold:"\u251B",lineUpBoldLeft:"\u251A",lineUpLeftBold:"\u2519",lineUpDoubleLeftDouble:"\u255D",lineUpDoubleLeft:"\u255C",lineUpLeftDouble:"\u255B",lineUpRight:"\u2514",lineUpRightArc:"\u2570",lineUpBoldRightBold:"\u2517",lineUpBoldRight:"\u2516",lineUpRightBold:"\u2515",lineUpDoubleRightDouble:"\u255A",lineUpDoubleRight:"\u2559",lineUpRightDouble:"\u2558",lineUpDownLeft:"\u2524",lineUpBoldDownBoldLeftBold:"\u252B",lineUpBoldDownBoldLeft:"\u2528",lineUpDownLeftBold:"\u2525",lineUpBoldDownLeftBold:"\u2529",lineUpDownBoldLeftBold:"\u252A",lineUpDownBoldLeft:"\u2527",lineUpBoldDownLeft:"\u2526",lineUpDoubleDownDoubleLeftDouble:"\u2563",lineUpDoubleDownDoubleLeft:"\u2562",lineUpDownLeftDouble:"\u2561",lineUpDownRight:"\u251C",lineUpBoldDownBoldRightBold:"\u2523",lineUpBoldDownBoldRight:"\u2520",lineUpDownRightBold:"\u251D",lineUpBoldDownRightBold:"\u2521",lineUpDownBoldRightBold:"\u2522",lineUpDownBoldRight:"\u251F",lineUpBoldDownRight:"\u251E",lineUpDoubleDownDoubleRightDouble:"\u2560",lineUpDoubleDownDoubleRight:"\u255F",lineUpDownRightDouble:"\u255E",lineDownLeftRight:"\u252C",lineDownBoldLeftBoldRightBold:"\u2533",lineDownLeftBoldRightBold:"\u252F",lineDownBoldLeftRight:"\u2530",lineDownBoldLeftBoldRight:"\u2531",lineDownBoldLeftRightBold:"\u2532",lineDownLeftRightBold:"\u252E",lineDownLeftBoldRight:"\u252D",lineDownDoubleLeftDoubleRightDouble:"\u2566",lineDownDoubleLeftRight:"\u2565",lineDownLeftDoubleRightDouble:"\u2564",lineUpLeftRight:"\u2534",lineUpBoldLeftBoldRightBold:"\u253B",lineUpLeftBoldRightBold:"\u2537",lineUpBoldLeftRight:"\u2538",lineUpBoldLeftBoldRight:"\u2539",lineUpBoldLeftRightBold:"\u253A",lineUpLeftRightBold:"\u2536",lineUpLeftBoldRight:"\u2535",lineUpDoubleLeftDoubleRightDouble:"\u2569",lineUpDoubleLeftRight:"\u2568",lineUpLeftDoubleRightDouble:"\u2567",lineUpDownLeftRight:"\u253C",lineUpBoldDownBoldLeftBoldRightBold:"\u254B",lineUpDownBoldLeftBoldRightBold:"\u2548",lineUpBoldDownLeftBoldRightBold:"\u2547",lineUpBoldDownBoldLeftRightBold:"\u254A",lineUpBoldDownBoldLeftBoldRight:"\u2549",lineUpBoldDownLeftRight:"\u2540",lineUpDownBoldLeftRight:"\u2541",lineUpDownLeftBoldRight:"\u253D",lineUpDownLeftRightBold:"\u253E",lineUpBoldDownBoldLeftRight:"\u2542",lineUpDownLeftBoldRightBold:"\u253F",lineUpBoldDownLeftBoldRight:"\u2543",lineUpBoldDownLeftRightBold:"\u2544",lineUpDownBoldLeftBoldRight:"\u2545",lineUpDownBoldLeftRightBold:"\u2546",lineUpDoubleDownDoubleLeftDoubleRightDouble:"\u256C",lineUpDoubleDownDoubleLeftRight:"\u256B",lineUpDownLeftDoubleRightDouble:"\u256A",lineCross:"\u2573",lineBackslash:"\u2572",lineSlash:"\u2571"},cs={tick:"\u2714",info:"\u2139",warning:"\u26A0",cross:"\u2718",squareSmall:"\u25FB",squareSmallFilled:"\u25FC",circle:"\u25EF",circleFilled:"\u25C9",circleDotted:"\u25CC",circleDouble:"\u25CE",circleCircle:"\u24DE",circleCross:"\u24E7",circlePipe:"\u24BE",radioOn:"\u25C9",radioOff:"\u25EF",checkboxOn:"\u2612",checkboxOff:"\u2610",checkboxCircleOn:"\u24E7",checkboxCircleOff:"\u24BE",pointer:"\u276F",triangleUpOutline:"\u25B3",triangleLeft:"\u25C0",triangleRight:"\u25B6",lozenge:"\u25C6",lozengeOutline:"\u25C7",hamburger:"\u2630",smiley:"\u32E1",mustache:"\u0DF4",star:"\u2605",play:"\u25B6",nodejs:"\u2B22",oneSeventh:"\u2150",oneNinth:"\u2151",oneTenth:"\u2152"},sd={tick:"\u221A",info:"i",warning:"\u203C",cross:"\xD7",squareSmall:"\u25A1",squareSmallFilled:"\u25A0",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(\u25CB)",circleCross:"(\xD7)",circlePipe:"(\u2502)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[\xD7]",checkboxOff:"[ ]",checkboxCircleOn:"(\xD7)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"\u2206",triangleLeft:"\u25C4",triangleRight:"\u25BA",lozenge:"\u2666",lozengeOutline:"\u25CA",hamburger:"\u2261",smiley:"\u263A",mustache:"\u250C\u2500\u2510",star:"\u2736",play:"\u25BA",nodejs:"\u2666",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},ad={...us,...cs},ud={...us,...sd},cd=On(),ld=cd?ad:ud,Bt=ld,Ey=Object.entries(cs);import pd from"tty";var Dd=pd?.WriteStream?.prototype?.hasColors?.()??!1,h=(t,e)=>{if(!Dd)return o=>o;let r=`\x1B[${t}m`,n=`\x1B[${e}m`;return o=>{let s=o+"",i=s.indexOf(n);if(i===-1)return r+s+n;let a=r,u=0,l=(e===22?n:"")+r;for(;i!==-1;)a+=s.slice(u,i)+l,u=i+n.length,i=s.indexOf(n,u);return a+=s.slice(u)+n,a}},Sy=h(0,0),ls=h(1,22),Fy=h(2,22),wy=h(3,23),xy=h(4,24),Ay=h(53,55),Oy=h(7,27),$y=h(8,28),_y=h(9,29),By=h(30,39),Ty=h(31,39),vy=h(32,39),Iy=h(33,39),Ry=h(34,39),My=h(35,39),Py=h(36,39),ky=h(37,39),Tt=h(90,39),Ly=h(40,49),jy=h(41,49),Ny=h(42,49),Uy=h(43,49),Vy=h(44,49),Gy=h(45,49),Wy=h(46,49),Hy=h(47,49),zy=h(100,49),ps=h(91,39),qy=h(92,39),Ds=h(93,39),Yy=h(94,39),Ky=h(95,39),Jy=h(96,39),Xy=h(97,39),Zy=h(101,49),Qy=h(102,49),eS=h(103,49),tS=h(104,49),rS=h(105,49),nS=h(106,49),oS=h(107,49);var fs=({type:t,message:e,timestamp:r,piped:n,commandId:o,result:{failed:s=!1}={},options:{reject:i=!0}})=>{let a=dd(r),u=md[t]({failed:s,reject:i,piped:n}),c=fd[t]({reject:i});return`${Tt(`[${a}]`)} ${Tt(`[${o}]`)} ${c(u)} ${c(e)}`},dd=t=>`${vt(t.getHours(),2)}:${vt(t.getMinutes(),2)}:${vt(t.getSeconds(),2)}.${vt(t.getMilliseconds(),3)}`,vt=(t,e)=>String(t).padStart(e,"0"),ds=({failed:t,reject:e})=>t?e?Bt.cross:Bt.warning:Bt.tick,md={command:({piped:t})=>t?"|":"$",output:()=>" ",ipc:()=>"*",error:ds,duration:ds},ms=t=>t,fd={command:()=>ls,output:()=>ms,ipc:()=>ms,error:({reject:t})=>t?ps:Ds,duration:()=>Tt};var hs=(t,e,r)=>{let n=os(e,r);return t.map(({verboseLine:o,verboseObject:s})=>hd(o,s,n)).filter(o=>o!==void 0).map(o=>gd(o)).join("")},hd=(t,e,r)=>{if(r===void 0)return t;let n=r(t,e);if(typeof n=="string")return n},gd=t=>t.endsWith(`
|
|
90
90
|
`)?t:`${t}
|
|
91
|
-
`;var q=({type:t,verboseMessage:e,fdNumber:r,verboseInfo:n,result:o})=>{let s=
|
|
92
|
-
`).map(r=>
|
|
93
|
-
${jn()}`)},
|
|
94
|
-
${jn()}`)},
|
|
95
|
-
${jn()}`)},jn=()=>`Available signal names: ${
|
|
96
|
-
Available signal numbers: ${
|
|
91
|
+
`;var q=({type:t,verboseMessage:e,fdNumber:r,verboseInfo:n,result:o})=>{let s=Ed({type:t,result:o,verboseInfo:n}),i=Cd(e,s),a=hs(i,n,r);a!==""&&console.warn(a.slice(0,-1))},Ed=({type:t,result:e,verboseInfo:{escapedCommand:r,commandId:n,rawOptions:{piped:o=!1,...s}}})=>({type:t,escapedCommand:r,commandId:`${n}`,timestamp:new Date,piped:o,result:e,options:s}),Cd=(t,e)=>t.split(`
|
|
92
|
+
`).map(r=>yd({...e,message:r})),yd=t=>({verboseLine:fs(t),verboseObject:t}),It=t=>{let e=typeof t=="string"?t:bd(t);return qe(e).replaceAll(" "," ".repeat(Sd))},Sd=2;var gs=(t,e)=>{xe(e)&&q({type:"command",verboseMessage:t,verboseInfo:e})};var bs=(t,e,r)=>{xd(t);let n=Fd(t);return{verbose:t,escapedCommand:e,commandId:n,rawOptions:r}},Fd=t=>xe({verbose:t})?wd++:void 0,wd=0n,xd=t=>{for(let e of t){if(e===!1)throw new TypeError(`The "verbose: false" option was renamed to "verbose: 'none'".`);if(e===!0)throw new TypeError(`The "verbose: true" option was renamed to "verbose: 'short'".`);if(!_t.includes(e)&&!$t(e)){let r=_t.map(n=>`'${n}'`).join(", ");throw new TypeError(`The "verbose" option must not be ${e}. Allowed values are: ${r} or a function.`)}}};import{hrtime as Es}from"process";var Rt=()=>Es.bigint(),$n=t=>Number(Es.bigint()-t)/1e6;var Mt=(t,e,r)=>{let n=Rt(),{command:o,escapedCommand:s}=is(t,e),i=Fn(r,"verbose"),a=bs(i,s,{...r});return gs(s,a),{command:o,escapedCommand:s,startTime:n,verboseInfo:a}};var bu=ie(aa(),1);import cf from"path";import gu from"process";import jt from"process";import de from"path";function kt(t={}){let{env:e=process.env,platform:r=process.platform}=t;return r!=="win32"?"PATH":Object.keys(e).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"}import{promisify as Zd}from"util";import{execFile as Qd,execFileSync as zS}from"child_process";import ua from"path";import{fileURLToPath as em}from"url";var KS=Zd(Qd);function Lt(t){return t instanceof URL?em(t):t}function ca(t){return{*[Symbol.iterator](){let e=ua.resolve(Lt(t)),r;for(;r!==e;)yield e,r=e,e=ua.resolve(e,"..")}}}var JS=10*1024*1024;var tm=({cwd:t=jt.cwd(),path:e=jt.env[kt()],preferLocal:r=!0,execPath:n=jt.execPath,addExecPath:o=!0}={})=>{let s=de.resolve(Lt(t)),i=[],a=e.split(de.delimiter);return r&&rm(i,a,s),o&&nm(i,a,n,s),e===""||e===de.delimiter?`${i.join(de.delimiter)}${e}`:[...i,e].join(de.delimiter)},rm=(t,e,r)=>{for(let n of ca(r)){let o=de.join(n,"node_modules/.bin");e.includes(o)||t.push(o)}},nm=(t,e,r,n)=>{let o=de.resolve(n,Lt(r),"..");e.includes(o)||t.push(o)},la=({env:t=jt.env,...e}={})=>{t={...t};let r=kt({env:t});return e.path=t[r],t[r]=tm(e),t};import{setTimeout as bm}from"timers/promises";var pa=(t,e,r)=>{let n=r?Ke:Ye,o=t instanceof G?{}:{cause:t};return new n(e,o)},G=class extends Error{},Da=(t,e)=>{Object.defineProperty(t.prototype,"name",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,ma,{value:!0,writable:!1,enumerable:!1,configurable:!1})},da=t=>Nt(t)&&ma in t,ma=Symbol("isExecaError"),Nt=t=>Object.prototype.toString.call(t)==="[object Error]",Ye=class extends Error{};Da(Ye,Ye.name);var Ke=class extends Error{};Da(Ke,Ke.name);import{constants as Je}from"os";import{constants as am}from"os";var fa=()=>{let t=ga-ha+1;return Array.from({length:t},om)},om=(t,e)=>({name:`SIGRT${e+1}`,number:ha+e,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),ha=34,ga=64;import{constants as im}from"os";var ba=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}];var Ln=()=>{let t=fa();return[...ba,...t].map(sm)},sm=({name:t,number:e,description:r,action:n,forced:o=!1,standard:s})=>{let{signals:{[t]:i}}=im,a=i!==void 0;return{name:t,number:a?i:e,description:r,supported:a,action:n,forced:o,standard:s}};var um=()=>{let t=Ln();return Object.fromEntries(t.map(cm))},cm=({name:t,number:e,description:r,supported:n,action:o,forced:s,standard:i})=>[t,{name:t,number:e,description:r,supported:n,action:o,forced:s,standard:i}],Ea=um(),lm=()=>{let t=Ln(),e=65,r=Array.from({length:e},(n,o)=>pm(o,t));return Object.assign({},...r)},pm=(t,e)=>{let r=Dm(t,e);if(r===void 0)return{};let{name:n,description:o,supported:s,action:i,forced:a,standard:u}=r;return{[t]:{name:n,number:t,description:o,supported:s,action:i,forced:a,standard:u}}},Dm=(t,e)=>{let r=e.find(({name:n})=>am.signals[n]===t);return r!==void 0?r:e.find(n=>n.number===t)},d0=lm();var ya=t=>{let e="option `killSignal`";if(t===0)throw new TypeError(`Invalid ${e}: 0 cannot be used.`);return Fa(t,e)},Sa=t=>t===0?t:Fa(t,"`subprocess.kill()`'s argument"),Fa=(t,e)=>{if(Number.isInteger(t))return dm(t,e);if(typeof t=="string")return fm(t,e);throw new TypeError(`Invalid ${e} ${String(t)}: it must be a string or an integer.
|
|
93
|
+
${jn()}`)},dm=(t,e)=>{if(Ca.has(t))return Ca.get(t);throw new TypeError(`Invalid ${e} ${t}: this signal integer does not exist.
|
|
94
|
+
${jn()}`)},mm=()=>new Map(Object.entries(Je.signals).reverse().map(([t,e])=>[e,t])),Ca=mm(),fm=(t,e)=>{if(t in Je.signals)return t;throw t.toUpperCase()in Je.signals?new TypeError(`Invalid ${e} '${t}': please rename it to '${t.toUpperCase()}'.`):new TypeError(`Invalid ${e} '${t}': this signal name does not exist.
|
|
95
|
+
${jn()}`)},jn=()=>`Available signal names: ${hm()}.
|
|
96
|
+
Available signal numbers: ${gm()}.`,hm=()=>Object.keys(Je.signals).sort().map(t=>`'${t}'`).join(", "),gm=()=>[...new Set(Object.values(Je.signals).sort((t,e)=>t-e))].join(", "),Ut=t=>Ea[t].description;var wa=t=>{if(t===!1)return t;if(t===!0)return Em;if(!Number.isFinite(t)||t<0)throw new TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${t}\` (${typeof t})`);return t},Em=1e3*5,xa=({kill:t,options:{forceKillAfterDelay:e,killSignal:r},onInternalError:n,context:o,controller:s},i,a)=>{let{signal:u,error:c}=Cm(i,a,r);ym(c,n);let l=t(u);return Sm({kill:t,signal:u,forceKillAfterDelay:e,killSignal:r,killResult:l,context:o,controller:s}),l},Cm=(t,e,r)=>{let[n=r,o]=Nt(t)?[void 0,t]:[t,e];if(typeof n!="string"&&!Number.isInteger(n))throw new TypeError(`The first argument must be an error instance or a signal name string/integer: ${String(n)}`);if(o!==void 0&&!Nt(o))throw new TypeError(`The second argument is optional. If specified, it must be an error instance: ${o}`);return{signal:Sa(n),error:o}},ym=(t,e)=>{t!==void 0&&e.reject(t)},Sm=async({kill:t,signal:e,forceKillAfterDelay:r,killSignal:n,killResult:o,context:s,controller:i})=>{e===n&&o&&Nn({kill:t,forceKillAfterDelay:r,context:s,controllerSignal:i.signal})},Nn=async({kill:t,forceKillAfterDelay:e,context:r,controllerSignal:n})=>{if(e!==!1)try{await bm(e,void 0,{signal:n}),t("SIGKILL")&&(r.isForcefullyTerminated??=!0)}catch{}};import{once as Fm}from"events";var Vt=async(t,e)=>{t.aborted||await Fm(t,"abort",{signal:e})};var Aa=({cancelSignal:t})=>{if(t!==void 0&&Object.prototype.toString.call(t)!=="[object AbortSignal]")throw new Error(`The \`cancelSignal\` option must be an AbortSignal: ${String(t)}`)},Oa=({subprocess:t,cancelSignal:e,gracefulCancel:r,context:n,controller:o})=>e===void 0||r?[]:[wm(t,e,n,o)],wm=async(t,e,r,{signal:n})=>{throw await Vt(e,n),r.terminationReason??="cancel",t.kill(),e.reason};import{scheduler as Hm}from"timers/promises";import{promisify as Vm}from"util";var _e=({methodName:t,isSubprocess:e,ipc:r,isConnected:n})=>{xm(t,e,r),Un(t,e,n)},xm=(t,e,r)=>{if(!r)throw new Error(`${W(t,e)} can only be used if the \`ipc\` option is \`true\`.`)},Un=(t,e,r)=>{if(!r)throw new Error(`${W(t,e)} cannot be used: the ${ae(e)} has already exited or disconnected.`)},$a=t=>{throw new Error(`${W("getOneMessage",t)} could not complete: the ${ae(t)} exited or disconnected.`)},_a=t=>{throw new Error(`${W("sendMessage",t)} failed: the ${ae(t)} is sending a message too, instead of listening to incoming messages.
|
|
97
97
|
This can be fixed by both sending a message and listening to incoming messages at the same time:
|
|
98
98
|
|
|
99
99
|
const [receivedMessage] = await Promise.all([
|
|
100
|
-
${
|
|
101
|
-
${
|
|
102
|
-
]);`)},
|
|
100
|
+
${W("getOneMessage",t)},
|
|
101
|
+
${W("sendMessage",t,"message, {strict: true}")},
|
|
102
|
+
]);`)},Gt=(t,e)=>new Error(`${W("sendMessage",e)} failed when sending an acknowledgment response to the ${ae(e)}.`,{cause:t}),Ba=t=>{throw new Error(`${W("sendMessage",t)} failed: the ${ae(t)} is not listening to incoming messages.`)},Ta=t=>{throw new Error(`${W("sendMessage",t)} failed: the ${ae(t)} exited without listening to incoming messages.`)},va=()=>new Error(`\`cancelSignal\` aborted: the ${ae(!0)} disconnected.`),Ia=()=>{throw new Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")},Ra=({error:t,methodName:e,isSubprocess:r})=>{if(t.code==="EPIPE")throw new Error(`${W(e,r)} cannot be used: the ${ae(r)} is disconnecting.`,{cause:t})},Ma=({error:t,methodName:e,isSubprocess:r,message:n})=>{if(Am(t))throw new Error(`${W(e,r)}'s argument type is invalid: the message cannot be serialized: ${String(n)}.`,{cause:t})},Am=({code:t,message:e})=>Om.has(t)||$m.some(r=>e.includes(r)),Om=new Set(["ERR_MISSING_ARGS","ERR_INVALID_ARG_TYPE"]),$m=["could not be cloned","circular structure","call stack size exceeded"],W=(t,e,r="")=>t==="cancelSignal"?"`cancelSignal`'s `controller.abort()`":`${_m(e)}${t}(${r})`,_m=t=>t?"":"subprocess.",ae=t=>t?"parent process":"subprocess",Be=t=>{t.connected&&t.disconnect()};var Y=()=>{let t={},e=new Promise((r,n)=>{Object.assign(t,{resolve:r,reject:n})});return Object.assign(e,t)};var Ht=(t,e="stdin")=>{let{options:n,fileDescriptors:o}=K.get(t),s=Pa(o,e,!0),i=t.stdio[s];if(i===null)throw new TypeError(ka(s,e,n,!0));return i},Te=(t,e="stdout")=>{let{options:n,fileDescriptors:o}=K.get(t),s=Pa(o,e,!1),i=s==="all"?t.all:t.stdio[s];if(i==null)throw new TypeError(ka(s,e,n,!1));return i},K=new WeakMap,Pa=(t,e,r)=>{let n=Bm(e,r);return Tm(n,e,r,t),n},Bm=(t,e)=>{let r=wn(t);if(r!==void 0)return r;let{validOptions:n,defaultValue:o}=e?{validOptions:'"stdin"',defaultValue:"stdin"}:{validOptions:'"stdout", "stderr", "all"',defaultValue:"stdout"};throw new TypeError(`"${Xe(e)}" must not be "${t}".
|
|
103
103
|
It must be ${n} or "fd3", "fd4" (and so on).
|
|
104
|
-
It is optional and defaults to "${o}".`)},
|
|
105
|
-
Please set the "stdio" option to ensure that file descriptor exists.`);if(o.direction==="input"&&!r)throw new TypeError(`"${
|
|
106
|
-
Please set this option with "pipe" instead.`},
|
|
107
|
-
Please rename it to ${
|
|
108
|
-
Please rename it to one of: ${r}.`)},
|
|
109
|
-
${t.message}`,t}},hu=(t,e)=>{if(e===fu())return t;let r;try{r=
|
|
104
|
+
It is optional and defaults to "${o}".`)},Tm=(t,e,r,n)=>{let o=n[La(t)];if(o===void 0)throw new TypeError(`"${Xe(r)}" must not be ${e}. That file descriptor does not exist.
|
|
105
|
+
Please set the "stdio" option to ensure that file descriptor exists.`);if(o.direction==="input"&&!r)throw new TypeError(`"${Xe(r)}" must not be ${e}. It must be a readable stream, not writable.`);if(o.direction!=="input"&&r)throw new TypeError(`"${Xe(r)}" must not be ${e}. It must be a writable stream, not readable.`)},ka=(t,e,r,n)=>{if(t==="all"&&!r.all)return`The "all" option must be true to use "from: 'all'".`;let{optionName:o,optionValue:s}=vm(t,r);return`The "${o}: ${Wt(s)}" option is incompatible with using "${Xe(n)}: ${Wt(e)}".
|
|
106
|
+
Please set this option with "pipe" instead.`},vm=(t,{stdin:e,stdout:r,stderr:n,stdio:o})=>{let s=La(t);return s===0&&e!==void 0?{optionName:"stdin",optionValue:e}:s===1&&r!==void 0?{optionName:"stdout",optionValue:r}:s===2&&n!==void 0?{optionName:"stderr",optionValue:n}:{optionName:`stdio[${s}]`,optionValue:o[s]}},La=t=>t==="all"?1:t,Xe=t=>t?"to":"from",Wt=t=>typeof t=="string"?`'${t}'`:typeof t=="number"?`${t}`:"Stream";import{once as Lm}from"events";import{addAbortListener as Im}from"events";var me=(t,e,r)=>{let n=t.getMaxListeners();n===0||n===Number.POSITIVE_INFINITY||(t.setMaxListeners(n+e),Im(r,()=>{t.setMaxListeners(t.getMaxListeners()-e)}))};import{EventEmitter as Pm}from"events";import{once as Rm}from"events";import{scheduler as Mm}from"timers/promises";var zt=(t,e)=>{e&&Vn(t)},Vn=t=>{t.refCounted()},qt=(t,e)=>{e&&Gn(t)},Gn=t=>{t.unrefCounted()},ja=(t,e)=>{e&&(Gn(t),Gn(t))},Na=(t,e)=>{e&&(Vn(t),Vn(t))};var Ua=async({anyProcess:t,channel:e,isSubprocess:r,ipcEmitter:n},o)=>{if(Wa(o)||za(o))return;Yt.has(t)||Yt.set(t,[]);let s=Yt.get(t);if(s.push(o),!(s.length>1))for(;s.length>0;){await Ha(t,n,o),await Mm.yield();let i=await Ga({wrappedMessage:s[0],anyProcess:t,channel:e,isSubprocess:r,ipcEmitter:n});s.shift(),n.emit("message",i),n.emit("message:done")}},Va=async({anyProcess:t,channel:e,isSubprocess:r,ipcEmitter:n,boundOnMessage:o})=>{Wn();let s=Yt.get(t);for(;s?.length>0;)await Rm(n,"message:done");t.removeListener("message",o),Na(e,r),n.connected=!1,n.emit("disconnect")},Yt=new WeakMap;var ue=(t,e,r)=>{if(Kt.has(t))return Kt.get(t);let n=new Pm;return n.connected=!0,Kt.set(t,n),km({ipcEmitter:n,anyProcess:t,channel:e,isSubprocess:r}),n},Kt=new WeakMap,km=({ipcEmitter:t,anyProcess:e,channel:r,isSubprocess:n})=>{let o=Ua.bind(void 0,{anyProcess:e,channel:r,isSubprocess:n,ipcEmitter:t});e.on("message",o),e.once("disconnect",Va.bind(void 0,{anyProcess:e,channel:r,isSubprocess:n,ipcEmitter:t,boundOnMessage:o})),ja(r,n)},Jt=t=>{let e=Kt.get(t);return e===void 0?t.channel!==null:e.connected};var qa=({anyProcess:t,channel:e,isSubprocess:r,message:n,strict:o})=>{if(!o)return n;let s=ue(t,e,r),i=Qt(t,s);return{id:jm++,type:Zt,message:n,hasListeners:i}},jm=0n,Ya=(t,e)=>{if(!(e?.type!==Zt||e.hasListeners))for(let{id:r}of t)r!==void 0&&Xt[r].resolve({isDeadlock:!0,hasListeners:!1})},Ga=async({wrappedMessage:t,anyProcess:e,channel:r,isSubprocess:n,ipcEmitter:o})=>{if(t?.type!==Zt||!e.connected)return t;let{id:s,message:i}=t,a={id:s,type:Ja,message:Qt(e,o)};try{await er({anyProcess:e,channel:r,isSubprocess:n,ipc:!0},a)}catch(u){o.emit("strict:error",u)}return i},Wa=t=>{if(t?.type!==Ja)return!1;let{id:e,message:r}=t;return Xt[e]?.resolve({isDeadlock:!1,hasListeners:r}),!0},Ka=async(t,e,r)=>{if(t?.type!==Zt)return;let n=Y();Xt[t.id]=n;let o=new AbortController;try{let{isDeadlock:s,hasListeners:i}=await Promise.race([n,Nm(e,r,o)]);s&&_a(r),i||Ba(r)}finally{o.abort(),delete Xt[t.id]}},Xt={},Nm=async(t,e,{signal:r})=>{me(t,1,r),await Lm(t,"disconnect",{signal:r}),Ta(e)},Zt="execa:ipc:request",Ja="execa:ipc:response";var Xa=(t,e,r)=>{Ze.has(t)||Ze.set(t,new Set);let n=Ze.get(t),o=Y(),s=r?e.id:void 0,i={onMessageSent:o,id:s};return n.add(i),{outgoingMessages:n,outgoingMessage:i}},Za=({outgoingMessages:t,outgoingMessage:e})=>{t.delete(e),e.onMessageSent.resolve()},Ha=async(t,e,r)=>{for(;!Qt(t,e)&&Ze.get(t)?.size>0;){let n=[...Ze.get(t)];Ya(n,r),await Promise.all(n.map(({onMessageSent:o})=>o))}},Ze=new WeakMap,Qt=(t,e)=>e.listenerCount("message")>Um(t),Um=t=>K.has(t)&&!ee(K.get(t).options.buffer,"ipc")?1:0;var er=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},o,{strict:s=!1}={})=>{let i="sendMessage";return _e({methodName:i,isSubprocess:r,ipc:n,isConnected:t.connected}),Gm({anyProcess:t,channel:e,methodName:i,isSubprocess:r,message:o,strict:s})},Gm=async({anyProcess:t,channel:e,methodName:r,isSubprocess:n,message:o,strict:s})=>{let i=qa({anyProcess:t,channel:e,isSubprocess:n,message:o,strict:s}),a=Xa(t,i,s);try{await zn({anyProcess:t,methodName:r,isSubprocess:n,wrappedMessage:i,message:o})}catch(u){throw Be(t),u}finally{Za(a)}},zn=async({anyProcess:t,methodName:e,isSubprocess:r,wrappedMessage:n,message:o})=>{let s=Wm(t);try{await Promise.all([Ka(n,t,r),s(n)])}catch(i){throw Ra({error:i,methodName:e,isSubprocess:r}),Ma({error:i,methodName:e,isSubprocess:r,message:o}),i}},Wm=t=>{if(Hn.has(t))return Hn.get(t);let e=Vm(t.send.bind(t));return Hn.set(t,e),e},Hn=new WeakMap;var eu=(t,e)=>{let r="cancelSignal";return Un(r,!1,t.connected),zn({anyProcess:t,methodName:r,isSubprocess:!1,wrappedMessage:{type:ru,message:e},message:e})},tu=async({anyProcess:t,channel:e,isSubprocess:r,ipc:n})=>(await zm({anyProcess:t,channel:e,isSubprocess:r,ipc:n}),qn.signal),zm=async({anyProcess:t,channel:e,isSubprocess:r,ipc:n})=>{if(!Qa){if(Qa=!0,!n){Ia();return}if(e===null){Wn();return}ue(t,e,r),await Hm.yield()}},Qa=!1,za=t=>t?.type!==ru?!1:(qn.abort(t.message),!0),ru="execa:ipc:cancel",Wn=()=>{qn.abort(va())},qn=new AbortController;var nu=({gracefulCancel:t,cancelSignal:e,ipc:r,serialization:n})=>{if(t){if(e===void 0)throw new Error("The `cancelSignal` option must be defined when setting the `gracefulCancel` option.");if(!r)throw new Error("The `ipc` option cannot be false when setting the `gracefulCancel` option.");if(n==="json")throw new Error("The `serialization` option cannot be 'json' when setting the `gracefulCancel` option.")}},ou=({subprocess:t,cancelSignal:e,gracefulCancel:r,forceKillAfterDelay:n,context:o,controller:s})=>r?[qm({subprocess:t,cancelSignal:e,forceKillAfterDelay:n,context:o,controller:s})]:[],qm=async({subprocess:t,cancelSignal:e,forceKillAfterDelay:r,context:n,controller:{signal:o}})=>{await Vt(e,o);let s=Ym(e);throw await eu(t,s),Nn({kill:t.kill,forceKillAfterDelay:r,context:n,controllerSignal:o}),n.terminationReason??="gracefulCancel",e.reason},Ym=({reason:t})=>{if(!(t instanceof DOMException))return t;let e=new Error(t.message);return Object.defineProperty(e,"stack",{value:t.stack,enumerable:!1,configurable:!0,writable:!0}),e};import{setTimeout as Km}from"timers/promises";var iu=({timeout:t})=>{if(t!==void 0&&(!Number.isFinite(t)||t<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${t}\` (${typeof t})`)},su=(t,e,r,n)=>e===0||e===void 0?[]:[Jm(t,e,r,n)],Jm=async(t,e,r,{signal:n})=>{throw await Km(e,void 0,{signal:n}),r.terminationReason??="timeout",t.kill(),new G};import{execPath as Xm,execArgv as Zm}from"process";import au from"path";var uu=({options:t})=>{if(t.node===!1)throw new TypeError('The "node" option cannot be false with `execaNode()`.');return{options:{...t,node:!0}}},cu=(t,e,{node:r=!1,nodePath:n=Xm,nodeOptions:o=Zm.filter(u=>!u.startsWith("--inspect")),cwd:s,execPath:i,...a})=>{if(i!==void 0)throw new TypeError('The "execPath" option has been removed. Please use the "nodePath" option instead.');let u=we(n,'The "nodePath" option'),c=au.resolve(s,u),l={...a,nodePath:c,node:r,cwd:s};if(!r)return[t,e,l];if(au.basename(t,".exe")==="node")throw new TypeError('When the "node" option is true, the first argument does not need to be "node".');return[c,[...o,t,...e],{ipc:!0,...l,shell:!1}]};import{serialize as Qm}from"v8";var lu=({ipcInput:t,ipc:e,serialization:r})=>{if(t!==void 0){if(!e)throw new Error("The `ipcInput` option cannot be set unless the `ipc` option is `true`.");rf[r](t)}},ef=t=>{try{Qm(t)}catch(e){throw new Error("The `ipcInput` option is not serializable with a structured clone.",{cause:e})}},tf=t=>{try{JSON.stringify(t)}catch(e){throw new Error("The `ipcInput` option is not serializable with JSON.",{cause:e})}},rf={advanced:ef,json:tf},pu=async(t,e)=>{e!==void 0&&await t.sendMessage(e)};var du=({encoding:t})=>{if(Yn.has(t))return;let e=of(t);if(e!==void 0)throw new TypeError(`Invalid option \`encoding: ${tr(t)}\`.
|
|
107
|
+
Please rename it to ${tr(e)}.`);let r=[...Yn].map(n=>tr(n)).join(", ");throw new TypeError(`Invalid option \`encoding: ${tr(t)}\`.
|
|
108
|
+
Please rename it to one of: ${r}.`)},nf=new Set(["utf8","utf16le"]),P=new Set(["buffer","hex","base64","base64url","latin1","ascii"]),Yn=new Set([...nf,...P]),of=t=>{if(t===null)return"buffer";if(typeof t!="string")return;let e=t.toLowerCase();if(e in Du)return Du[e];if(Yn.has(e))return e},Du={"utf-8":"utf8","utf-16le":"utf16le","ucs-2":"utf16le",ucs2:"utf16le",binary:"latin1"},tr=t=>typeof t=="string"?`"${t}"`:String(t);import{statSync as sf}from"fs";import af from"path";import uf from"process";var mu=(t=fu())=>{let e=we(t,'The "cwd" option');return af.resolve(e)},fu=()=>{try{return uf.cwd()}catch(t){throw t.message=`The current directory does not exist.
|
|
109
|
+
${t.message}`,t}},hu=(t,e)=>{if(e===fu())return t;let r;try{r=sf(e)}catch(n){return`The "cwd" option is invalid: ${e}.
|
|
110
110
|
${n.message}
|
|
111
111
|
${t}`}return r.isDirectory()?t:`The "cwd" option is not a directory: ${e}.
|
|
112
|
-
${t}`};var
|
|
113
|
-
`,
|
|
114
|
-
${
|
|
115
|
-
`)].map(oe=>
|
|
116
|
-
|
|
117
|
-
`);return{originalMessage:
|
|
118
|
-
`):ku(t),ku=t=>typeof t=="string"?t:B(t)?At(t):"";var Dr=({command:t,escapedCommand:e,stdio:r,all:n,ipcOutput:o,options:{cwd:s},startTime:i})=>ju({command:t,escapedCommand:e,cwd:s,durationMs:_n(i),failed:!1,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isTerminated:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,exitCode:0,stdout:r[1],stderr:r[2],all:n,stdio:r,ipcOutput:o,pipedFrom:[]}),Me=({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:o,startTime:s,isSync:i})=>ot({error:t,command:e,escapedCommand:r,startTime:s,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,stdio:Array.from({length:n.length}),ipcOutput:[],options:o,isSync:i}),ot=({error:t,command:e,escapedCommand:r,startTime:n,timedOut:o,isCanceled:s,isGracefullyCanceled:i,isMaxBuffer:a,isForcefullyTerminated:u,exitCode:c,signal:l,stdio:p,all:d,ipcOutput:m,options:{timeoutDuration:f,timeout:g=f,forceKillAfterDelay:S,killSignal:E,cwd:_,maxBuffer:T},isSync:y})=>{let{exitCode:F,signal:$,signalDescription:I}=eh(c,l),{originalMessage:ne,shortMessage:oe,message:Mr}=Lu({stdio:p,all:d,ipcOutput:m,originalError:t,signal:$,signalDescription:I,exitCode:F,escapedCommand:r,timedOut:o,isCanceled:s,isGracefullyCanceled:i,isMaxBuffer:a,isForcefullyTerminated:u,forceKillAfterDelay:S,killSignal:E,maxBuffer:T,timeout:g,cwd:_}),Ne=pa(t,Mr,y);return Object.assign(Ne,Qf({error:Ne,command:e,escapedCommand:r,startTime:n,timedOut:o,isCanceled:s,isGracefullyCanceled:i,isMaxBuffer:a,isForcefullyTerminated:u,exitCode:F,signal:$,signalDescription:I,stdio:p,all:d,ipcOutput:m,cwd:_,originalMessage:ne,shortMessage:oe})),Ne},Qf=({error:t,command:e,escapedCommand:r,startTime:n,timedOut:o,isCanceled:s,isGracefullyCanceled:i,isMaxBuffer:a,isForcefullyTerminated:u,exitCode:c,signal:l,signalDescription:p,stdio:d,all:m,ipcOutput:f,cwd:g,originalMessage:S,shortMessage:E})=>ju({shortMessage:E,originalMessage:S,command:e,escapedCommand:r,cwd:g,durationMs:_n(n),failed:!0,timedOut:o,isCanceled:s,isGracefullyCanceled:i,isTerminated:l!==void 0,isMaxBuffer:a,isForcefullyTerminated:u,exitCode:c,signal:l,signalDescription:p,code:t.cause?.code,stdout:d[1],stderr:d[2],all:m,stdio:d,ipcOutput:f,pipedFrom:[]}),ju=t=>Object.fromEntries(Object.entries(t).filter(([,e])=>e!==void 0)),eh=(t,e)=>{let r=t===null?void 0:t,n=e===null?void 0:e,o=n===void 0?void 0:Vt(e);return{exitCode:r,signal:n,signalDescription:o}};var Nu=t=>Number.isFinite(t)?t:0;function th(t){return{days:Math.trunc(t/864e5),hours:Math.trunc(t/36e5%24),minutes:Math.trunc(t/6e4%60),seconds:Math.trunc(t/1e3%60),milliseconds:Math.trunc(t%1e3),microseconds:Math.trunc(Nu(t*1e3)%1e3),nanoseconds:Math.trunc(Nu(t*1e6)%1e3)}}function rh(t){return{days:t/86400000n,hours:t/3600000n%24n,minutes:t/60000n%60n,seconds:t/1000n%60n,milliseconds:t%1000n,microseconds:0n,nanoseconds:0n}}function eo(t){switch(typeof t){case"number":{if(Number.isFinite(t))return th(t);break}case"bigint":return rh(t)}throw new TypeError("Expected a finite number or bigint")}var nh=t=>t===0||t===0n,oh=(t,e)=>e===1||e===1n?t:`${t}s`,ih=1e-7,sh=24n*60n*60n*1000n;function to(t,e){let r=typeof t=="bigint";if(!r&&!Number.isFinite(t))throw new TypeError("Expected a finite number or bigint");e={...e};let n=t<0?"-":"";t=t<0?-t:t,e.colonNotation&&(e.compact=!1,e.formatSubMilliseconds=!1,e.separateMilliseconds=!1,e.verbose=!1),e.compact&&(e.unitCount=1,e.secondsDecimalDigits=0,e.millisecondsDecimalDigits=0);let o=[],s=(l,p)=>{let d=Math.floor(l*10**p+ih);return(Math.round(d)/10**p).toFixed(p)},i=(l,p,d,m)=>{if(!((o.length===0||!e.colonNotation)&&nh(l)&&!(e.colonNotation&&d==="m"))){if(m??=String(l),e.colonNotation){let f=m.includes(".")?m.split(".")[0].length:m.length,g=o.length>0?2:1;m="0".repeat(Math.max(0,g-f))+m}else m+=e.verbose?" "+oh(p,l):d;o.push(m)}},a=eo(t),u=BigInt(a.days);if(e.hideYearAndDays?i(BigInt(u)*24n+BigInt(a.hours),"hour","h"):(e.hideYear?i(u,"day","d"):(i(u/365n,"year","y"),i(u%365n,"day","d")),i(Number(a.hours),"hour","h")),i(Number(a.minutes),"minute","m"),!e.hideSeconds)if(e.separateMilliseconds||e.formatSubMilliseconds||!e.colonNotation&&t<1e3&&!e.subSecondsAsDecimals){let l=Number(a.seconds),p=Number(a.milliseconds),d=Number(a.microseconds),m=Number(a.nanoseconds);if(i(l,"second","s"),e.formatSubMilliseconds)i(p,"millisecond","ms"),i(d,"microsecond","\xB5s"),i(m,"nanosecond","ns");else{let f=p+d/1e3+m/1e6,g=typeof e.millisecondsDecimalDigits=="number"?e.millisecondsDecimalDigits:0,S=f>=1?Math.round(f):Math.ceil(f),E=g?f.toFixed(g):S;i(Number.parseFloat(E),"millisecond","ms",E)}}else{let l=(r?Number(t%sh):t)/1e3%60,p=typeof e.secondsDecimalDigits=="number"?e.secondsDecimalDigits:1,d=s(l,p),m=e.keepDecimalsOnWholeSeconds?d:d.replace(/\.0+$/,"");i(Number.parseFloat(m),"second","s",m)}if(o.length===0)return n+"0"+(e.verbose?" milliseconds":"ms");let c=e.colonNotation?":":" ";return typeof e.unitCount=="number"&&(o=o.slice(0,Math.max(e.unitCount,1))),n+o.join(c)}var Uu=(t,e)=>{t.failed&&q({type:"error",verboseMessage:t.shortMessage,verboseInfo:e,result:t})};var Vu=(t,e)=>{Ae(e)&&(Uu(t,e),ah(t,e))},ah=(t,e)=>{let r=`(done in ${to(t.durationMs)})`;q({type:"duration",verboseMessage:r,verboseInfo:e,result:t})};var Pe=(t,e,{reject:r})=>{if(Vu(t,e),t.failed&&r)throw t;return t};import{readFileSync as fc}from"fs";var Hu=(t,e)=>ge(t)?"asyncGenerator":Yu(t)?"generator":mr(t)?"fileUrl":dh(t)?"filePath":fh(t)?"webStream":z(t,{checkOpen:!1})?"native":B(t)?"uint8Array":hh(t)?"asyncIterable":gh(t)?"iterable":oo(t)?zu({transform:t},e):ph(t)?uh(t,e):"native",uh=(t,e)=>Jn(t.transform,{checkOpen:!1})?ch(t,e):oo(t.transform)?zu(t,e):lh(t,e),ch=(t,e)=>(qu(t,e,"Duplex stream"),"duplex"),zu=(t,e)=>(qu(t,e,"web TransformStream"),"webTransform"),qu=({final:t,binary:e,objectMode:r},n,o)=>{Gu(t,`${n}.final`,o),Gu(e,`${n}.binary`,o),ro(r,`${n}.objectMode`)},Gu=(t,e,r)=>{if(t!==void 0)throw new TypeError(`The \`${e}\` option can only be defined when using a generator, not a ${r}.`)},lh=({transform:t,final:e,binary:r,objectMode:n},o)=>{if(t!==void 0&&!Wu(t))throw new TypeError(`The \`${o}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(Jn(e,{checkOpen:!1}))throw new TypeError(`The \`${o}.final\` option must not be a Duplex stream.`);if(oo(e))throw new TypeError(`The \`${o}.final\` option must not be a web TransformStream.`);if(e!==void 0&&!Wu(e))throw new TypeError(`The \`${o}.final\` option must be a generator.`);return ro(r,`${o}.binary`),ro(n,`${o}.objectMode`),ge(t)||ge(e)?"asyncGenerator":"generator"},ro=(t,e)=>{if(t!==void 0&&typeof t!="boolean")throw new TypeError(`The \`${e}\` option must use a boolean.`)},Wu=t=>ge(t)||Yu(t),ge=t=>Object.prototype.toString.call(t)==="[object AsyncGeneratorFunction]",Yu=t=>Object.prototype.toString.call(t)==="[object GeneratorFunction]",ph=t=>O(t)&&(t.transform!==void 0||t.final!==void 0),mr=t=>Object.prototype.toString.call(t)==="[object URL]",Ku=t=>mr(t)&&t.protocol!=="file:",dh=t=>O(t)&&Object.keys(t).length>0&&Object.keys(t).every(e=>Dh.has(e))&&no(t.file),Dh=new Set(["file","append"]),no=t=>typeof t=="string",Ju=(t,e)=>t==="native"&&typeof e=="string"&&!mh.has(e),mh=new Set(["ipc","ignore","inherit","overlapped","pipe"]),Xu=t=>Object.prototype.toString.call(t)==="[object ReadableStream]",fr=t=>Object.prototype.toString.call(t)==="[object WritableStream]",fh=t=>Xu(t)||fr(t),oo=t=>Xu(t?.readable)&&fr(t?.writable),hh=t=>Zu(t)&&typeof t[Symbol.asyncIterator]=="function",gh=t=>Zu(t)&&typeof t[Symbol.iterator]=="function",Zu=t=>typeof t=="object"&&t!==null,N=new Set(["generator","asyncGenerator","duplex","webTransform"]),hr=new Set(["fileUrl","filePath","fileNumber"]),io=new Set(["fileUrl","filePath"]),Qu=new Set([...io,"webStream","nodeStream"]),ec=new Set(["webTransform","duplex"]),le={generator:"a generator",asyncGenerator:"an async generator",fileUrl:"a file URL",filePath:"a file path string",fileNumber:"a file descriptor number",webStream:"a web stream",nodeStream:"a Node.js stream",webTransform:"a web TransformStream",duplex:"a Duplex stream",native:"any value",iterable:"an iterable",asyncIterable:"an async iterable",string:"a string",uint8Array:"a Uint8Array"};var so=(t,e,r,n)=>n==="output"?bh(t,e,r):Eh(t,e,r),bh=(t,e,r)=>{let n=e!==0&&r[e-1].value.readableObjectMode;return{writableObjectMode:n,readableObjectMode:t??n}},Eh=(t,e,r)=>{let n=e===0?t===!0:r[e-1].value.readableObjectMode,o=e!==r.length-1&&(t??n);return{writableObjectMode:n,readableObjectMode:o}},tc=(t,e)=>{let r=t.findLast(({type:n})=>N.has(n));return r===void 0?!1:e==="input"?r.value.writableObjectMode:r.value.readableObjectMode};var rc=(t,e,r,n)=>[...t.filter(({type:o})=>!N.has(o)),...yh(t,e,r,n)],yh=(t,e,r,{encoding:n})=>{let o=t.filter(({type:i})=>N.has(i)),s=Array.from({length:o.length});for(let[i,a]of Object.entries(o))s[i]=Ch({stdioItem:a,index:Number(i),newTransforms:s,optionName:e,direction:r,encoding:n});return xh(s,r)},Ch=({stdioItem:t,stdioItem:{type:e},index:r,newTransforms:n,optionName:o,direction:s,encoding:i})=>e==="duplex"?Sh({stdioItem:t,optionName:o}):e==="webTransform"?wh({stdioItem:t,index:r,newTransforms:n,direction:s}):Fh({stdioItem:t,index:r,newTransforms:n,direction:s,encoding:i}),Sh=({stdioItem:t,stdioItem:{value:{transform:e,transform:{writableObjectMode:r,readableObjectMode:n},objectMode:o=n}},optionName:s})=>{if(o&&!n)throw new TypeError(`The \`${s}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!o&&n)throw new TypeError(`The \`${s}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return{...t,value:{transform:e,writableObjectMode:r,readableObjectMode:n}}},wh=({stdioItem:t,stdioItem:{value:e},index:r,newTransforms:n,direction:o})=>{let{transform:s,objectMode:i}=O(e)?e:{transform:e},{writableObjectMode:a,readableObjectMode:u}=so(i,r,n,o);return{...t,value:{transform:s,writableObjectMode:a,readableObjectMode:u}}},Fh=({stdioItem:t,stdioItem:{value:e},index:r,newTransforms:n,direction:o,encoding:s})=>{let{transform:i,final:a,binary:u=!1,preserveNewlines:c=!1,objectMode:l}=O(e)?e:{transform:e},p=u||k.has(s),{writableObjectMode:d,readableObjectMode:m}=so(l,r,n,o);return{...t,value:{transform:i,final:a,binary:p,preserveNewlines:c,writableObjectMode:d,readableObjectMode:m}}},xh=(t,e)=>e==="input"?t.reverse():t;import ao from"process";var nc=(t,e,r)=>{let n=t.map(o=>Ah(o,e));if(n.includes("input")&&n.includes("output"))throw new TypeError(`The \`${r}\` option must not be an array of both readable and writable values.`);return n.find(Boolean)??$h},Ah=({type:t,value:e},r)=>Oh[r]??oc[t](e),Oh=["input","output","output"],ke=()=>{},uo=()=>"input",oc={generator:ke,asyncGenerator:ke,fileUrl:ke,filePath:ke,iterable:uo,asyncIterable:uo,uint8Array:uo,webStream:t=>fr(t)?"output":"input",nodeStream(t){return he(t,{checkOpen:!1})?Kn(t,{checkOpen:!1})?void 0:"input":"output"},webTransform:ke,duplex:ke,native(t){let e=_h(t);if(e!==void 0)return e;if(z(t,{checkOpen:!1}))return oc.nodeStream(t)}},_h=t=>{if([0,ao.stdin].includes(t))return"input";if([1,2,ao.stdout,ao.stderr].includes(t))return"output"},$h="output";var ic=(t,e)=>e&&!t.includes("ipc")?[...t,"ipc"]:t;var sc=({stdio:t,ipc:e,buffer:r,...n},o,s)=>{let i=Bh(t,n).map((a,u)=>ac(a,u));return s?vh(i,r,o):ic(i,e)},Bh=(t,e)=>{if(t===void 0)return j.map(n=>e[n]);if(Th(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${j.map(n=>`\`${n}\``).join(", ")}`);if(typeof t=="string")return[t,t,t];if(!Array.isArray(t))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);let r=Math.max(t.length,j.length);return Array.from({length:r},(n,o)=>t[o])},Th=t=>j.some(e=>t[e]!==void 0),ac=(t,e)=>Array.isArray(t)?t.map(r=>ac(r,e)):t??(e>=j.length?"ignore":"pipe"),vh=(t,e,r)=>t.map((n,o)=>!e[o]&&o!==0&&!Oe(r,o)&&Ih(n)?"ignore":n),Ih=t=>t==="pipe"||Array.isArray(t)&&t.every(e=>e==="pipe");import{readFileSync as Rh}from"fs";import Mh from"tty";var cc=({stdioItem:t,stdioItem:{type:e},isStdioArray:r,fdNumber:n,direction:o,isSync:s})=>!r||e!=="native"?t:s?Ph({stdioItem:t,fdNumber:n,direction:o}):jh({stdioItem:t,fdNumber:n}),Ph=({stdioItem:t,stdioItem:{value:e,optionName:r},fdNumber:n,direction:o})=>{let s=kh({value:e,optionName:r,fdNumber:n,direction:o});if(s!==void 0)return s;if(z(e,{checkOpen:!1}))throw new TypeError(`The \`${r}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return t},kh=({value:t,optionName:e,fdNumber:r,direction:n})=>{let o=Lh(t,r);if(o!==void 0){if(n==="output")return{type:"fileNumber",value:o,optionName:e};if(Mh.isatty(o))throw new TypeError(`The \`${e}: ${Ht(t)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:"uint8Array",value:Q(Rh(o)),optionName:e}}},Lh=(t,e)=>{if(t==="inherit")return e;if(typeof t=="number")return t;let r=Ot.indexOf(t);if(r!==-1)return r},jh=({stdioItem:t,stdioItem:{value:e,optionName:r},fdNumber:n})=>e==="inherit"?{type:"nodeStream",value:uc(n,e,r),optionName:r}:typeof e=="number"?{type:"nodeStream",value:uc(e,e,r),optionName:r}:z(e,{checkOpen:!1})?{type:"nodeStream",value:e,optionName:r}:t,uc=(t,e,r)=>{let n=Ot[t];if(n===void 0)throw new TypeError(`The \`${r}: ${e}\` option is invalid: no such standard stream.`);return n};var lc=({input:t,inputFile:e},r)=>r===0?[...Nh(t),...Vh(e)]:[],Nh=t=>t===void 0?[]:[{type:Uh(t),value:t,optionName:"input"}],Uh=t=>{if(he(t,{checkOpen:!1}))return"nodeStream";if(typeof t=="string")return"string";if(B(t))return"uint8Array";throw new Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},Vh=t=>t===void 0?[]:[{...Gh(t),optionName:"inputFile"}],Gh=t=>{if(mr(t))return{type:"fileUrl",value:t};if(no(t))return{type:"filePath",value:{file:t}};throw new Error("The `inputFile` option must be a file path string or a file URL.")};var pc=t=>t.filter((e,r)=>t.every((n,o)=>e.value!==n.value||r>=o||e.type==="generator"||e.type==="asyncGenerator")),dc=({stdioItem:{type:t,value:e,optionName:r},direction:n,fileDescriptors:o,isSync:s})=>{let i=Wh(o,t);if(i.length!==0){if(s){Hh({otherStdioItems:i,type:t,value:e,optionName:r,direction:n});return}if(Qu.has(t))return Dc({otherStdioItems:i,type:t,value:e,optionName:r,direction:n});ec.has(t)&&qh({otherStdioItems:i,type:t,value:e,optionName:r})}},Wh=(t,e)=>t.flatMap(({direction:r,stdioItems:n})=>n.filter(o=>o.type===e).map((o=>({...o,direction:r})))),Hh=({otherStdioItems:t,type:e,value:r,optionName:n,direction:o})=>{io.has(e)&&Dc({otherStdioItems:t,type:e,value:r,optionName:n,direction:o})},Dc=({otherStdioItems:t,type:e,value:r,optionName:n,direction:o})=>{let s=t.filter(a=>zh(a,r));if(s.length===0)return;let i=s.find(a=>a.direction!==o);return mc(i,n,e),o==="output"?s[0].stream:void 0},zh=({type:t,value:e},r)=>t==="filePath"?e.file===r.file:t==="fileUrl"?e.href===r.href:e===r,qh=({otherStdioItems:t,type:e,value:r,optionName:n})=>{let o=t.find(({value:{transform:s}})=>s===r.transform);mc(o,n,e)},mc=(t,e,r)=>{if(t!==void 0)throw new TypeError(`The \`${t.optionName}\` and \`${e}\` options must not target ${le[r]} that is the same.`)};var gr=(t,e,r,n)=>{let s=sc(e,r,n).map((a,u)=>Yh({stdioOption:a,fdNumber:u,options:e,isSync:n})),i=rg({initialFileDescriptors:s,addProperties:t,options:e,isSync:n});return e.stdio=i.map(({stdioItems:a})=>ig(a)),i},Yh=({stdioOption:t,fdNumber:e,options:r,isSync:n})=>{let o=_t(e),{stdioItems:s,isStdioArray:i}=Kh({stdioOption:t,fdNumber:e,options:r,optionName:o}),a=nc(s,e,o),u=s.map(p=>cc({stdioItem:p,isStdioArray:i,fdNumber:e,direction:a,isSync:n})),c=rc(u,o,a,r),l=tc(c,a);return tg(c,l),{direction:a,objectMode:l,stdioItems:c}},Kh=({stdioOption:t,fdNumber:e,options:r,optionName:n})=>{let s=[...(Array.isArray(t)?t:[t]).map(u=>Jh(u,n)),...lc(r,e)],i=pc(s),a=i.length>1;return Xh(i,a,n),Qh(i),{stdioItems:i,isStdioArray:a}},Jh=(t,e)=>({type:Hu(t,e),value:t,optionName:e}),Xh=(t,e,r)=>{if(t.length===0)throw new TypeError(`The \`${r}\` option must not be an empty array.`);if(e){for(let{value:n,optionName:o}of t)if(Zh.has(n))throw new Error(`The \`${o}\` option must not include \`${n}\`.`)}},Zh=new Set(["ignore","ipc"]),Qh=t=>{for(let e of t)eg(e)},eg=({type:t,value:e,optionName:r})=>{if(Ku(e))throw new TypeError(`The \`${r}: URL\` option must use the \`file:\` scheme.
|
|
119
|
-
For example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if(Ju(t,e))throw new TypeError(`The \`${r}: { file: '...' }\` option must be used instead of \`${r}: '...'\`.`)},
|
|
120
|
-
`){let i=
|
|
112
|
+
${t}`};var rr=(t,e,r)=>{r.cwd=mu(r.cwd);let[n,o,s]=cu(t,e,r),{command:i,args:a,options:u}=bu.default._parse(n,o,s),c=ns(u),l=lf(c);return iu(l),du(l),lu(l),Aa(l),nu(l),l.shell=Cn(l.shell),l.env=pf(l),l.killSignal=ya(l.killSignal),l.forceKillAfterDelay=wa(l.forceKillAfterDelay),l.lines=l.lines.map((p,D)=>p&&!P.has(l.encoding)&&l.buffer[D]),gu.platform==="win32"&&cf.basename(i,".exe")==="cmd"&&a.unshift("/q"),{file:i,commandArguments:a,options:l}},lf=({extendEnv:t=!0,preferLocal:e=!1,cwd:r,localDir:n=r,encoding:o="utf8",reject:s=!0,cleanup:i=!0,all:a=!1,windowsHide:u=!0,killSignal:c="SIGTERM",forceKillAfterDelay:l=!0,gracefulCancel:p=!1,ipcInput:D,ipc:m=D!==void 0||p,serialization:f="advanced",...g})=>({...g,extendEnv:t,preferLocal:e,cwd:r,localDirectory:n,encoding:o,reject:s,cleanup:i,all:a,windowsHide:u,killSignal:c,forceKillAfterDelay:l,gracefulCancel:p,ipcInput:D,ipc:m,serialization:f}),pf=({env:t,extendEnv:e,preferLocal:r,node:n,localDirectory:o,nodePath:s})=>{let i=e?{...gu.env,...t}:t;return r||n?la({env:i,cwd:o,execPath:s,preferLocal:r,addExecPath:n}):i};var nr=(t,e,r)=>r.shell&&e.length>0?[[t,...e].join(" "),[],r]:[t,e,r];import{inspect as Hf}from"util";function ve(t){if(typeof t=="string")return Df(t);if(!(ArrayBuffer.isView(t)&&t.BYTES_PER_ELEMENT===1))throw new Error("Input must be a string or a Uint8Array");return df(t)}var Df=t=>t.at(-1)===Eu?t.slice(0,t.at(-2)===Cu?-2:-1):t,df=t=>t.at(-1)===mf?t.subarray(0,t.at(-2)===ff?-2:-1):t,Eu=`
|
|
113
|
+
`,mf=Eu.codePointAt(0),Cu="\r",ff=Cu.codePointAt(0);import{on as Uf}from"events";import{finished as Vf}from"stream/promises";function H(t,{checkOpen:e=!0}={}){return t!==null&&typeof t=="object"&&(t.writable||t.readable||!e||t.writable===void 0&&t.readable===void 0)&&typeof t.pipe=="function"}function Kn(t,{checkOpen:e=!0}={}){return H(t,{checkOpen:e})&&(t.writable||!e)&&typeof t.write=="function"&&typeof t.end=="function"&&typeof t.writable=="boolean"&&typeof t.writableObjectMode=="boolean"&&typeof t.destroy=="function"&&typeof t.destroyed=="boolean"}function fe(t,{checkOpen:e=!0}={}){return H(t,{checkOpen:e})&&(t.readable||!e)&&typeof t.read=="function"&&typeof t.readable=="boolean"&&typeof t.readableObjectMode=="boolean"&&typeof t.destroy=="function"&&typeof t.destroyed=="boolean"}function Jn(t,e){return Kn(t,e)&&fe(t,e)}var hf=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype),Xn=class{#t;#r;#e=!1;#n=void 0;constructor(e,r){this.#t=e,this.#r=r}next(){let e=()=>this.#i();return this.#n=this.#n?this.#n.then(e,e):e(),this.#n}return(e){let r=()=>this.#o(e);return this.#n?this.#n.then(r,r):r()}async#i(){if(this.#e)return{done:!0,value:void 0};let e;try{e=await this.#t.read()}catch(r){throw this.#n=void 0,this.#e=!0,this.#t.releaseLock(),r}return e.done&&(this.#n=void 0,this.#e=!0,this.#t.releaseLock()),e}async#o(e){if(this.#e)return{done:!0,value:e};if(this.#e=!0,!this.#r){let r=this.#t.cancel(e);return this.#t.releaseLock(),await r,{done:!0,value:e}}return this.#t.releaseLock(),{done:!0,value:e}}},Zn=Symbol();function yu(){return this[Zn].next()}Object.defineProperty(yu,"name",{value:"next"});function Su(t){return this[Zn].return(t)}Object.defineProperty(Su,"name",{value:"return"});var gf=Object.create(hf,{next:{enumerable:!0,configurable:!0,writable:!0,value:yu},return:{enumerable:!0,configurable:!0,writable:!0,value:Su}});function Qn({preventCancel:t=!1}={}){let e=this.getReader(),r=new Xn(e,t),n=Object.create(gf);return n[Zn]=r,n}var Fu=t=>{if(fe(t,{checkOpen:!1})&&Qe.on!==void 0)return Ef(t);if(typeof t?.[Symbol.asyncIterator]=="function")return t;if(bf.call(t)==="[object ReadableStream]")return Qn.call(t);throw new TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.")},{toString:bf}=Object.prototype,Ef=async function*(t){let e=new AbortController,r={};Cf(t,e,r);try{for await(let[n]of Qe.on(t,"data",{signal:e.signal}))yield n}catch(n){if(r.error!==void 0)throw r.error;if(!e.signal.aborted)throw n}finally{t.destroy()}},Cf=async(t,e,r)=>{try{await Qe.finished(t,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(n){r.error=n}finally{e.abort()}},Qe={};var Ie=async(t,{init:e,convertChunk:r,getSize:n,truncateChunk:o,addChunk:s,getFinalChunk:i,finalize:a},{maxBuffer:u=Number.POSITIVE_INFINITY}={})=>{let c=Fu(t),l=e();l.length=0;try{for await(let p of c){let D=Sf(p),m=r[D](p,l);Au({convertedChunk:m,state:l,getSize:n,truncateChunk:o,addChunk:s,maxBuffer:u})}return yf({state:l,convertChunk:r,getSize:n,truncateChunk:o,addChunk:s,getFinalChunk:i,maxBuffer:u}),a(l)}catch(p){let D=typeof p=="object"&&p!==null?p:new Error(p);throw D.bufferedData=a(l),D}},yf=({state:t,getSize:e,truncateChunk:r,addChunk:n,getFinalChunk:o,maxBuffer:s})=>{let i=o(t);i!==void 0&&Au({convertedChunk:i,state:t,getSize:e,truncateChunk:r,addChunk:n,maxBuffer:s})},Au=({convertedChunk:t,state:e,getSize:r,truncateChunk:n,addChunk:o,maxBuffer:s})=>{let i=r(t),a=e.length+i;if(a<=s){wu(t,e,o,a);return}let u=n(t,s-e.length);throw u!==void 0&&wu(u,e,o,s),new J},wu=(t,e,r,n)=>{e.contents=r(t,e,n),e.length=n},Sf=t=>{let e=typeof t;if(e==="string")return"string";if(e!=="object"||t===null)return"others";if(globalThis.Buffer?.isBuffer(t))return"buffer";let r=xu.call(t);return r==="[object ArrayBuffer]"?"arrayBuffer":r==="[object DataView]"?"dataView":Number.isInteger(t.byteLength)&&Number.isInteger(t.byteOffset)&&xu.call(t.buffer)==="[object ArrayBuffer]"?"typedArray":"others"},{toString:xu}=Object.prototype,J=class extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}};var te=t=>t,et=()=>{},or=({contents:t})=>t,ir=t=>{throw new Error(`Streams in object mode are not supported: ${String(t)}`)},sr=t=>t.length;async function ar(t,e){return Ie(t,Af,e)}var Ff=()=>({contents:[]}),wf=()=>1,xf=(t,{contents:e})=>(e.push(t),e),Af={init:Ff,convertChunk:{string:te,buffer:te,arrayBuffer:te,dataView:te,typedArray:te,others:te},getSize:wf,truncateChunk:et,addChunk:xf,getFinalChunk:et,finalize:or};async function ur(t,e){return Ie(t,Mf,e)}var Of=()=>({contents:new ArrayBuffer(0)}),$f=t=>_f.encode(t),_f=new TextEncoder,Ou=t=>new Uint8Array(t),$u=t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength),Bf=(t,e)=>t.slice(0,e),Tf=(t,{contents:e,length:r},n)=>{let o=Tu()?If(e,n):vf(e,n);return new Uint8Array(o).set(t,r),o},vf=(t,e)=>{if(e<=t.byteLength)return t;let r=new ArrayBuffer(Bu(e));return new Uint8Array(r).set(new Uint8Array(t),0),r},If=(t,e)=>{if(e<=t.maxByteLength)return t.resize(e),t;let r=new ArrayBuffer(e,{maxByteLength:Bu(e)});return new Uint8Array(r).set(new Uint8Array(t),0),r},Bu=t=>_u**Math.ceil(Math.log(t)/Math.log(_u)),_u=2,Rf=({contents:t,length:e})=>Tu()?t:t.slice(0,e),Tu=()=>"resize"in ArrayBuffer.prototype,Mf={init:Of,convertChunk:{string:$f,buffer:Ou,arrayBuffer:Ou,dataView:$u,typedArray:$u,others:ir},getSize:sr,truncateChunk:Bf,addChunk:Tf,getFinalChunk:et,finalize:Rf};async function lr(t,e){return Ie(t,Nf,e)}var Pf=()=>({contents:"",textDecoder:new TextDecoder}),cr=(t,{textDecoder:e})=>e.decode(t,{stream:!0}),kf=(t,{contents:e})=>e+t,Lf=(t,e)=>t.slice(0,e),jf=({textDecoder:t})=>{let e=t.decode();return e===""?void 0:e},Nf={init:Pf,convertChunk:{string:te,buffer:cr,arrayBuffer:cr,dataView:cr,typedArray:cr,others:ir},getSize:sr,truncateChunk:Lf,addChunk:kf,getFinalChunk:jf,finalize:or};Object.assign(Qe,{on:Uf,finished:Vf});var vu=({error:t,stream:e,readableObjectMode:r,lines:n,encoding:o,fdNumber:s})=>{if(!(t instanceof J))throw t;if(s==="all")return t;let i=Gf(r,n,o);throw t.maxBufferInfo={fdNumber:s,unit:i},e.destroy(),t},Gf=(t,e,r)=>t?"objects":e?"lines":r==="buffer"?"bytes":"characters",Iu=(t,e,r)=>{if(e.length!==r)return;let n=new J;throw n.maxBufferInfo={fdNumber:"ipc"},n},Ru=(t,e)=>{let{streamName:r,threshold:n,unit:o}=Wf(t,e);return`Command's ${r} was larger than ${n} ${o}`},Wf=(t,e)=>{if(t?.maxBufferInfo===void 0)return{streamName:"output",threshold:e[1],unit:"bytes"};let{maxBufferInfo:{fdNumber:r,unit:n}}=t;delete t.maxBufferInfo;let o=ee(e,r);return r==="ipc"?{streamName:"IPC output",threshold:o,unit:"messages"}:{streamName:Ot(r),threshold:o,unit:n}},Mu=(t,e,r)=>t?.code==="ENOBUFS"&&e!==null&&e.some(n=>n!==null&&n.length>pr(r)),Pu=(t,e,r)=>{if(!e)return t;let n=pr(r);return t.length>n?t.slice(0,n):t},pr=([,t])=>t;var Lu=({stdio:t,all:e,ipcOutput:r,originalError:n,signal:o,signalDescription:s,exitCode:i,escapedCommand:a,timedOut:u,isCanceled:c,isGracefullyCanceled:l,isMaxBuffer:p,isForcefullyTerminated:D,forceKillAfterDelay:m,killSignal:f,maxBuffer:g,timeout:S,cwd:E})=>{let $=n?.code,T=zf({originalError:n,timedOut:u,timeout:S,isMaxBuffer:p,maxBuffer:g,errorCode:$,signal:o,signalDescription:s,exitCode:i,isCanceled:c,isGracefullyCanceled:l,isForcefullyTerminated:D,forceKillAfterDelay:m,killSignal:f}),C=Yf(n,E),w=C===void 0?"":`
|
|
114
|
+
${C}`,_=`${T}: ${a}${w}`,I=e===void 0?[t[2],t[1]]:[e],ne=[_,...I,...t.slice(3),r.map(oe=>Kf(oe)).join(`
|
|
115
|
+
`)].map(oe=>qe(ve(Jf(oe)))).filter(Boolean).join(`
|
|
116
|
+
|
|
117
|
+
`);return{originalMessage:C,shortMessage:_,message:ne}},zf=({originalError:t,timedOut:e,timeout:r,isMaxBuffer:n,maxBuffer:o,errorCode:s,signal:i,signalDescription:a,exitCode:u,isCanceled:c,isGracefullyCanceled:l,isForcefullyTerminated:p,forceKillAfterDelay:D,killSignal:m})=>{let f=qf(p,D);return e?`Command timed out after ${r} milliseconds${f}`:l?i===void 0?`Command was gracefully canceled with exit code ${u}`:p?`Command was gracefully canceled${f}`:`Command was gracefully canceled with ${i} (${a})`:c?`Command was canceled${f}`:n?`${Ru(t,o)}${f}`:s!==void 0?`Command failed with ${s}${f}`:p?`Command was killed with ${m} (${Ut(m)})${f}`:i!==void 0?`Command was killed with ${i} (${a})`:u!==void 0?`Command failed with exit code ${u}`:"Command failed"},qf=(t,e)=>t?` and was forcefully terminated after ${e} milliseconds`:"",Yf=(t,e)=>{if(t instanceof G)return;let r=da(t)?t.originalMessage:String(t?.message??t),n=qe(hu(r,e));return n===""?void 0:n},Kf=t=>typeof t=="string"?t:Hf(t),Jf=t=>Array.isArray(t)?t.map(e=>ve(ku(e))).filter(Boolean).join(`
|
|
118
|
+
`):ku(t),ku=t=>typeof t=="string"?t:B(t)?xt(t):"";var Dr=({command:t,escapedCommand:e,stdio:r,all:n,ipcOutput:o,options:{cwd:s},startTime:i})=>ju({command:t,escapedCommand:e,cwd:s,durationMs:$n(i),failed:!1,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isTerminated:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,exitCode:0,stdout:r[1],stderr:r[2],all:n,stdio:r,ipcOutput:o,pipedFrom:[]}),Re=({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:o,startTime:s,isSync:i})=>tt({error:t,command:e,escapedCommand:r,startTime:s,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,stdio:Array.from({length:n.length}),ipcOutput:[],options:o,isSync:i}),tt=({error:t,command:e,escapedCommand:r,startTime:n,timedOut:o,isCanceled:s,isGracefullyCanceled:i,isMaxBuffer:a,isForcefullyTerminated:u,exitCode:c,signal:l,stdio:p,all:D,ipcOutput:m,options:{timeoutDuration:f,timeout:g=f,forceKillAfterDelay:S,killSignal:E,cwd:$,maxBuffer:T},isSync:C})=>{let{exitCode:w,signal:_,signalDescription:I}=Zf(c,l),{originalMessage:ne,shortMessage:oe,message:kr}=Lu({stdio:p,all:D,ipcOutput:m,originalError:t,signal:_,signalDescription:I,exitCode:w,escapedCommand:r,timedOut:o,isCanceled:s,isGracefullyCanceled:i,isMaxBuffer:a,isForcefullyTerminated:u,forceKillAfterDelay:S,killSignal:E,maxBuffer:T,timeout:g,cwd:$}),Ne=pa(t,kr,C);return Object.assign(Ne,Xf({error:Ne,command:e,escapedCommand:r,startTime:n,timedOut:o,isCanceled:s,isGracefullyCanceled:i,isMaxBuffer:a,isForcefullyTerminated:u,exitCode:w,signal:_,signalDescription:I,stdio:p,all:D,ipcOutput:m,cwd:$,originalMessage:ne,shortMessage:oe})),Ne},Xf=({error:t,command:e,escapedCommand:r,startTime:n,timedOut:o,isCanceled:s,isGracefullyCanceled:i,isMaxBuffer:a,isForcefullyTerminated:u,exitCode:c,signal:l,signalDescription:p,stdio:D,all:m,ipcOutput:f,cwd:g,originalMessage:S,shortMessage:E})=>ju({shortMessage:E,originalMessage:S,command:e,escapedCommand:r,cwd:g,durationMs:$n(n),failed:!0,timedOut:o,isCanceled:s,isGracefullyCanceled:i,isTerminated:l!==void 0,isMaxBuffer:a,isForcefullyTerminated:u,exitCode:c,signal:l,signalDescription:p,code:t.cause?.code,stdout:D[1],stderr:D[2],all:m,stdio:D,ipcOutput:f,pipedFrom:[]}),ju=t=>Object.fromEntries(Object.entries(t).filter(([,e])=>e!==void 0)),Zf=(t,e)=>{let r=t===null?void 0:t,n=e===null?void 0:e,o=n===void 0?void 0:Ut(e);return{exitCode:r,signal:n,signalDescription:o}};var Nu=t=>Number.isFinite(t)?t:0;function Qf(t){return{days:Math.trunc(t/864e5),hours:Math.trunc(t/36e5%24),minutes:Math.trunc(t/6e4%60),seconds:Math.trunc(t/1e3%60),milliseconds:Math.trunc(t%1e3),microseconds:Math.trunc(Nu(t*1e3)%1e3),nanoseconds:Math.trunc(Nu(t*1e6)%1e3)}}function eh(t){return{days:t/86400000n,hours:t/3600000n%24n,minutes:t/60000n%60n,seconds:t/1000n%60n,milliseconds:t%1000n,microseconds:0n,nanoseconds:0n}}function eo(t){switch(typeof t){case"number":{if(Number.isFinite(t))return Qf(t);break}case"bigint":return eh(t)}throw new TypeError("Expected a finite number or bigint")}var th=t=>t===0||t===0n,rh=(t,e)=>e===1||e===1n?t:`${t}s`,nh=1e-7,oh=24n*60n*60n*1000n;function to(t,e){let r=typeof t=="bigint";if(!r&&!Number.isFinite(t))throw new TypeError("Expected a finite number or bigint");e={...e};let n=t<0?"-":"";t=t<0?-t:t,e.colonNotation&&(e.compact=!1,e.formatSubMilliseconds=!1,e.separateMilliseconds=!1,e.verbose=!1),e.compact&&(e.unitCount=1,e.secondsDecimalDigits=0,e.millisecondsDecimalDigits=0);let o=[],s=(l,p)=>{let D=Math.floor(l*10**p+nh);return(Math.round(D)/10**p).toFixed(p)},i=(l,p,D,m)=>{if(!((o.length===0||!e.colonNotation)&&th(l)&&!(e.colonNotation&&D==="m"))){if(m??=String(l),e.colonNotation){let f=m.includes(".")?m.split(".")[0].length:m.length,g=o.length>0?2:1;m="0".repeat(Math.max(0,g-f))+m}else m+=e.verbose?" "+rh(p,l):D;o.push(m)}},a=eo(t),u=BigInt(a.days);if(e.hideYearAndDays?i(BigInt(u)*24n+BigInt(a.hours),"hour","h"):(e.hideYear?i(u,"day","d"):(i(u/365n,"year","y"),i(u%365n,"day","d")),i(Number(a.hours),"hour","h")),i(Number(a.minutes),"minute","m"),!e.hideSeconds)if(e.separateMilliseconds||e.formatSubMilliseconds||!e.colonNotation&&t<1e3&&!e.subSecondsAsDecimals){let l=Number(a.seconds),p=Number(a.milliseconds),D=Number(a.microseconds),m=Number(a.nanoseconds);if(i(l,"second","s"),e.formatSubMilliseconds)i(p,"millisecond","ms"),i(D,"microsecond","\xB5s"),i(m,"nanosecond","ns");else{let f=p+D/1e3+m/1e6,g=typeof e.millisecondsDecimalDigits=="number"?e.millisecondsDecimalDigits:0,S=f>=1?Math.round(f):Math.ceil(f),E=g?f.toFixed(g):S;i(Number.parseFloat(E),"millisecond","ms",E)}}else{let l=(r?Number(t%oh):t)/1e3%60,p=typeof e.secondsDecimalDigits=="number"?e.secondsDecimalDigits:1,D=s(l,p),m=e.keepDecimalsOnWholeSeconds?D:D.replace(/\.0+$/,"");i(Number.parseFloat(m),"second","s",m)}if(o.length===0)return n+"0"+(e.verbose?" milliseconds":"ms");let c=e.colonNotation?":":" ";return typeof e.unitCount=="number"&&(o=o.slice(0,Math.max(e.unitCount,1))),n+o.join(c)}var Uu=(t,e)=>{t.failed&&q({type:"error",verboseMessage:t.shortMessage,verboseInfo:e,result:t})};var Vu=(t,e)=>{xe(e)&&(Uu(t,e),ih(t,e))},ih=(t,e)=>{let r=`(done in ${to(t.durationMs)})`;q({type:"duration",verboseMessage:r,verboseInfo:e,result:t})};var Me=(t,e,{reject:r})=>{if(Vu(t,e),t.failed&&r)throw t;return t};import{readFileSync as fc}from"fs";var Hu=(t,e)=>he(t)?"asyncGenerator":Yu(t)?"generator":dr(t)?"fileUrl":lh(t)?"filePath":dh(t)?"webStream":H(t,{checkOpen:!1})?"native":B(t)?"uint8Array":mh(t)?"asyncIterable":fh(t)?"iterable":oo(t)?zu({transform:t},e):ch(t)?sh(t,e):"native",sh=(t,e)=>Jn(t.transform,{checkOpen:!1})?ah(t,e):oo(t.transform)?zu(t,e):uh(t,e),ah=(t,e)=>(qu(t,e,"Duplex stream"),"duplex"),zu=(t,e)=>(qu(t,e,"web TransformStream"),"webTransform"),qu=({final:t,binary:e,objectMode:r},n,o)=>{Gu(t,`${n}.final`,o),Gu(e,`${n}.binary`,o),ro(r,`${n}.objectMode`)},Gu=(t,e,r)=>{if(t!==void 0)throw new TypeError(`The \`${e}\` option can only be defined when using a generator, not a ${r}.`)},uh=({transform:t,final:e,binary:r,objectMode:n},o)=>{if(t!==void 0&&!Wu(t))throw new TypeError(`The \`${o}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(Jn(e,{checkOpen:!1}))throw new TypeError(`The \`${o}.final\` option must not be a Duplex stream.`);if(oo(e))throw new TypeError(`The \`${o}.final\` option must not be a web TransformStream.`);if(e!==void 0&&!Wu(e))throw new TypeError(`The \`${o}.final\` option must be a generator.`);return ro(r,`${o}.binary`),ro(n,`${o}.objectMode`),he(t)||he(e)?"asyncGenerator":"generator"},ro=(t,e)=>{if(t!==void 0&&typeof t!="boolean")throw new TypeError(`The \`${e}\` option must use a boolean.`)},Wu=t=>he(t)||Yu(t),he=t=>Object.prototype.toString.call(t)==="[object AsyncGeneratorFunction]",Yu=t=>Object.prototype.toString.call(t)==="[object GeneratorFunction]",ch=t=>O(t)&&(t.transform!==void 0||t.final!==void 0),dr=t=>Object.prototype.toString.call(t)==="[object URL]",Ku=t=>dr(t)&&t.protocol!=="file:",lh=t=>O(t)&&Object.keys(t).length>0&&Object.keys(t).every(e=>ph.has(e))&&no(t.file),ph=new Set(["file","append"]),no=t=>typeof t=="string",Ju=(t,e)=>t==="native"&&typeof e=="string"&&!Dh.has(e),Dh=new Set(["ipc","ignore","inherit","overlapped","pipe"]),Xu=t=>Object.prototype.toString.call(t)==="[object ReadableStream]",mr=t=>Object.prototype.toString.call(t)==="[object WritableStream]",dh=t=>Xu(t)||mr(t),oo=t=>Xu(t?.readable)&&mr(t?.writable),mh=t=>Zu(t)&&typeof t[Symbol.asyncIterator]=="function",fh=t=>Zu(t)&&typeof t[Symbol.iterator]=="function",Zu=t=>typeof t=="object"&&t!==null,j=new Set(["generator","asyncGenerator","duplex","webTransform"]),fr=new Set(["fileUrl","filePath","fileNumber"]),io=new Set(["fileUrl","filePath"]),Qu=new Set([...io,"webStream","nodeStream"]),ec=new Set(["webTransform","duplex"]),ce={generator:"a generator",asyncGenerator:"an async generator",fileUrl:"a file URL",filePath:"a file path string",fileNumber:"a file descriptor number",webStream:"a web stream",nodeStream:"a Node.js stream",webTransform:"a web TransformStream",duplex:"a Duplex stream",native:"any value",iterable:"an iterable",asyncIterable:"an async iterable",string:"a string",uint8Array:"a Uint8Array"};var so=(t,e,r,n)=>n==="output"?hh(t,e,r):gh(t,e,r),hh=(t,e,r)=>{let n=e!==0&&r[e-1].value.readableObjectMode;return{writableObjectMode:n,readableObjectMode:t??n}},gh=(t,e,r)=>{let n=e===0?t===!0:r[e-1].value.readableObjectMode,o=e!==r.length-1&&(t??n);return{writableObjectMode:n,readableObjectMode:o}},tc=(t,e)=>{let r=t.findLast(({type:n})=>j.has(n));return r===void 0?!1:e==="input"?r.value.writableObjectMode:r.value.readableObjectMode};var rc=(t,e,r,n)=>[...t.filter(({type:o})=>!j.has(o)),...bh(t,e,r,n)],bh=(t,e,r,{encoding:n})=>{let o=t.filter(({type:i})=>j.has(i)),s=Array.from({length:o.length});for(let[i,a]of Object.entries(o))s[i]=Eh({stdioItem:a,index:Number(i),newTransforms:s,optionName:e,direction:r,encoding:n});return Fh(s,r)},Eh=({stdioItem:t,stdioItem:{type:e},index:r,newTransforms:n,optionName:o,direction:s,encoding:i})=>e==="duplex"?Ch({stdioItem:t,optionName:o}):e==="webTransform"?yh({stdioItem:t,index:r,newTransforms:n,direction:s}):Sh({stdioItem:t,index:r,newTransforms:n,direction:s,encoding:i}),Ch=({stdioItem:t,stdioItem:{value:{transform:e,transform:{writableObjectMode:r,readableObjectMode:n},objectMode:o=n}},optionName:s})=>{if(o&&!n)throw new TypeError(`The \`${s}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!o&&n)throw new TypeError(`The \`${s}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return{...t,value:{transform:e,writableObjectMode:r,readableObjectMode:n}}},yh=({stdioItem:t,stdioItem:{value:e},index:r,newTransforms:n,direction:o})=>{let{transform:s,objectMode:i}=O(e)?e:{transform:e},{writableObjectMode:a,readableObjectMode:u}=so(i,r,n,o);return{...t,value:{transform:s,writableObjectMode:a,readableObjectMode:u}}},Sh=({stdioItem:t,stdioItem:{value:e},index:r,newTransforms:n,direction:o,encoding:s})=>{let{transform:i,final:a,binary:u=!1,preserveNewlines:c=!1,objectMode:l}=O(e)?e:{transform:e},p=u||P.has(s),{writableObjectMode:D,readableObjectMode:m}=so(l,r,n,o);return{...t,value:{transform:i,final:a,binary:p,preserveNewlines:c,writableObjectMode:D,readableObjectMode:m}}},Fh=(t,e)=>e==="input"?t.reverse():t;import ao from"process";var nc=(t,e,r)=>{let n=t.map(o=>wh(o,e));if(n.includes("input")&&n.includes("output"))throw new TypeError(`The \`${r}\` option must not be an array of both readable and writable values.`);return n.find(Boolean)??Oh},wh=({type:t,value:e},r)=>xh[r]??oc[t](e),xh=["input","output","output"],Pe=()=>{},uo=()=>"input",oc={generator:Pe,asyncGenerator:Pe,fileUrl:Pe,filePath:Pe,iterable:uo,asyncIterable:uo,uint8Array:uo,webStream:t=>mr(t)?"output":"input",nodeStream(t){return fe(t,{checkOpen:!1})?Kn(t,{checkOpen:!1})?void 0:"input":"output"},webTransform:Pe,duplex:Pe,native(t){let e=Ah(t);if(e!==void 0)return e;if(H(t,{checkOpen:!1}))return oc.nodeStream(t)}},Ah=t=>{if([0,ao.stdin].includes(t))return"input";if([1,2,ao.stdout,ao.stderr].includes(t))return"output"},Oh="output";var ic=(t,e)=>e&&!t.includes("ipc")?[...t,"ipc"]:t;var sc=({stdio:t,ipc:e,buffer:r,...n},o,s)=>{let i=$h(t,n).map((a,u)=>ac(a,u));return s?Bh(i,r,o):ic(i,e)},$h=(t,e)=>{if(t===void 0)return L.map(n=>e[n]);if(_h(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${L.map(n=>`\`${n}\``).join(", ")}`);if(typeof t=="string")return[t,t,t];if(!Array.isArray(t))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);let r=Math.max(t.length,L.length);return Array.from({length:r},(n,o)=>t[o])},_h=t=>L.some(e=>t[e]!==void 0),ac=(t,e)=>Array.isArray(t)?t.map(r=>ac(r,e)):t??(e>=L.length?"ignore":"pipe"),Bh=(t,e,r)=>t.map((n,o)=>!e[o]&&o!==0&&!Ae(r,o)&&Th(n)?"ignore":n),Th=t=>t==="pipe"||Array.isArray(t)&&t.every(e=>e==="pipe");import{readFileSync as vh}from"fs";import Ih from"tty";var cc=({stdioItem:t,stdioItem:{type:e},isStdioArray:r,fdNumber:n,direction:o,isSync:s})=>!r||e!=="native"?t:s?Rh({stdioItem:t,fdNumber:n,direction:o}):kh({stdioItem:t,fdNumber:n}),Rh=({stdioItem:t,stdioItem:{value:e,optionName:r},fdNumber:n,direction:o})=>{let s=Mh({value:e,optionName:r,fdNumber:n,direction:o});if(s!==void 0)return s;if(H(e,{checkOpen:!1}))throw new TypeError(`The \`${r}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return t},Mh=({value:t,optionName:e,fdNumber:r,direction:n})=>{let o=Ph(t,r);if(o!==void 0){if(n==="output")return{type:"fileNumber",value:o,optionName:e};if(Ih.isatty(o))throw new TypeError(`The \`${e}: ${Wt(t)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:"uint8Array",value:Q(vh(o)),optionName:e}}},Ph=(t,e)=>{if(t==="inherit")return e;if(typeof t=="number")return t;let r=At.indexOf(t);if(r!==-1)return r},kh=({stdioItem:t,stdioItem:{value:e,optionName:r},fdNumber:n})=>e==="inherit"?{type:"nodeStream",value:uc(n,e,r),optionName:r}:typeof e=="number"?{type:"nodeStream",value:uc(e,e,r),optionName:r}:H(e,{checkOpen:!1})?{type:"nodeStream",value:e,optionName:r}:t,uc=(t,e,r)=>{let n=At[t];if(n===void 0)throw new TypeError(`The \`${r}: ${e}\` option is invalid: no such standard stream.`);return n};var lc=({input:t,inputFile:e},r)=>r===0?[...Lh(t),...Nh(e)]:[],Lh=t=>t===void 0?[]:[{type:jh(t),value:t,optionName:"input"}],jh=t=>{if(fe(t,{checkOpen:!1}))return"nodeStream";if(typeof t=="string")return"string";if(B(t))return"uint8Array";throw new Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},Nh=t=>t===void 0?[]:[{...Uh(t),optionName:"inputFile"}],Uh=t=>{if(dr(t))return{type:"fileUrl",value:t};if(no(t))return{type:"filePath",value:{file:t}};throw new Error("The `inputFile` option must be a file path string or a file URL.")};var pc=t=>t.filter((e,r)=>t.every((n,o)=>e.value!==n.value||r>=o||e.type==="generator"||e.type==="asyncGenerator")),Dc=({stdioItem:{type:t,value:e,optionName:r},direction:n,fileDescriptors:o,isSync:s})=>{let i=Vh(o,t);if(i.length!==0){if(s){Gh({otherStdioItems:i,type:t,value:e,optionName:r,direction:n});return}if(Qu.has(t))return dc({otherStdioItems:i,type:t,value:e,optionName:r,direction:n});ec.has(t)&&Hh({otherStdioItems:i,type:t,value:e,optionName:r})}},Vh=(t,e)=>t.flatMap(({direction:r,stdioItems:n})=>n.filter(o=>o.type===e).map((o=>({...o,direction:r})))),Gh=({otherStdioItems:t,type:e,value:r,optionName:n,direction:o})=>{io.has(e)&&dc({otherStdioItems:t,type:e,value:r,optionName:n,direction:o})},dc=({otherStdioItems:t,type:e,value:r,optionName:n,direction:o})=>{let s=t.filter(a=>Wh(a,r));if(s.length===0)return;let i=s.find(a=>a.direction!==o);return mc(i,n,e),o==="output"?s[0].stream:void 0},Wh=({type:t,value:e},r)=>t==="filePath"?e.file===r.file:t==="fileUrl"?e.href===r.href:e===r,Hh=({otherStdioItems:t,type:e,value:r,optionName:n})=>{let o=t.find(({value:{transform:s}})=>s===r.transform);mc(o,n,e)},mc=(t,e,r)=>{if(t!==void 0)throw new TypeError(`The \`${t.optionName}\` and \`${e}\` options must not target ${ce[r]} that is the same.`)};var hr=(t,e,r,n)=>{let s=sc(e,r,n).map((a,u)=>zh({stdioOption:a,fdNumber:u,options:e,isSync:n})),i=eg({initialFileDescriptors:s,addProperties:t,options:e,isSync:n});return e.stdio=i.map(({stdioItems:a})=>ng(a)),i},zh=({stdioOption:t,fdNumber:e,options:r,isSync:n})=>{let o=Ot(e),{stdioItems:s,isStdioArray:i}=qh({stdioOption:t,fdNumber:e,options:r,optionName:o}),a=nc(s,e,o),u=s.map(p=>cc({stdioItem:p,isStdioArray:i,fdNumber:e,direction:a,isSync:n})),c=rc(u,o,a,r),l=tc(c,a);return Qh(c,l),{direction:a,objectMode:l,stdioItems:c}},qh=({stdioOption:t,fdNumber:e,options:r,optionName:n})=>{let s=[...(Array.isArray(t)?t:[t]).map(u=>Yh(u,n)),...lc(r,e)],i=pc(s),a=i.length>1;return Kh(i,a,n),Xh(i),{stdioItems:i,isStdioArray:a}},Yh=(t,e)=>({type:Hu(t,e),value:t,optionName:e}),Kh=(t,e,r)=>{if(t.length===0)throw new TypeError(`The \`${r}\` option must not be an empty array.`);if(e){for(let{value:n,optionName:o}of t)if(Jh.has(n))throw new Error(`The \`${o}\` option must not include \`${n}\`.`)}},Jh=new Set(["ignore","ipc"]),Xh=t=>{for(let e of t)Zh(e)},Zh=({type:t,value:e,optionName:r})=>{if(Ku(e))throw new TypeError(`The \`${r}: URL\` option must use the \`file:\` scheme.
|
|
119
|
+
For example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if(Ju(t,e))throw new TypeError(`The \`${r}: { file: '...' }\` option must be used instead of \`${r}: '...'\`.`)},Qh=(t,e)=>{if(!e)return;let r=t.find(({type:n})=>fr.has(n));if(r!==void 0)throw new TypeError(`The \`${r.optionName}\` option cannot use both files and transforms in objectMode.`)},eg=({initialFileDescriptors:t,addProperties:e,options:r,isSync:n})=>{let o=[];try{for(let s of t)o.push(tg({fileDescriptor:s,fileDescriptors:o,addProperties:e,options:r,isSync:n}));return o}catch(s){throw co(o),s}},tg=({fileDescriptor:{direction:t,objectMode:e,stdioItems:r},fileDescriptors:n,addProperties:o,options:s,isSync:i})=>{let a=r.map(u=>rg({stdioItem:u,addProperties:o,direction:t,options:s,fileDescriptors:n,isSync:i}));return{direction:t,objectMode:e,stdioItems:a}},rg=({stdioItem:t,addProperties:e,direction:r,options:n,fileDescriptors:o,isSync:s})=>{let i=Dc({stdioItem:t,direction:r,fileDescriptors:o,isSync:s});return i!==void 0?{...t,stream:i}:{...t,...e[r][t.type](t,n)}},co=t=>{for(let{stdioItems:e}of t)for(let{stream:r}of e)r!==void 0&&!V(r)&&r.destroy()},ng=t=>{if(t.length>1)return t.some(({value:n})=>n==="overlapped")?"overlapped":"pipe";let[{type:e,value:r}]=t;return e==="native"?r:"pipe"};var gc=(t,e)=>hr(ig,t,e,!0),X=({type:t,optionName:e})=>{bc(e,ce[t])},og=({optionName:t,value:e})=>((e==="ipc"||e==="overlapped")&&bc(t,`"${e}"`),{}),bc=(t,e)=>{throw new TypeError(`The \`${t}\` option cannot be ${e} with synchronous methods.`)},hc={generator(){},asyncGenerator:X,webStream:X,nodeStream:X,webTransform:X,duplex:X,asyncIterable:X,native:og},ig={input:{...hc,fileUrl:({value:t})=>({contents:[Q(fc(t))]}),filePath:({value:{file:t}})=>({contents:[Q(fc(t))]}),fileNumber:X,iterable:({value:t})=>({contents:[...t]}),string:({value:t})=>({contents:[t]}),uint8Array:({value:t})=>({contents:[t]})},output:{...hc,fileUrl:({value:t})=>({path:t}),filePath:({value:{file:t,append:e}})=>({path:t,append:e}),fileNumber:({value:t})=>({path:t}),iterable:X,string:X,uint8Array:X}};var re=(t,{stripFinalNewline:e},r)=>lo(e,r)&&t!==void 0&&!Array.isArray(t)?ve(t):t,lo=(t,e)=>e==="all"?t[1]||t[2]:t[e];import{Transform as Ag,getDefaultHighWaterMark as _c}from"stream";var gr=(t,e,r,n)=>t||r?void 0:Cc(e,n),Do=(t,e,r)=>r?t.flatMap(n=>Ec(n,e)):Ec(t,e),Ec=(t,e)=>{let{transform:r,final:n}=Cc(e,{});return[...r(t),...n()]},Cc=(t,e)=>(e.previousChunks="",{transform:sg.bind(void 0,e,t),final:ug.bind(void 0,e)}),sg=function*(t,e,r){if(typeof r!="string"){yield r;return}let{previousChunks:n}=t,o=-1;for(let s=0;s<r.length;s+=1)if(r[s]===`
|
|
120
|
+
`){let i=ag(r,s,e,t),a=r.slice(o+1,s+1-i);n.length>0&&(a=po(n,a),n=""),yield a,o=s}o!==r.length-1&&(n=po(n,r.slice(o+1))),t.previousChunks=n},ag=(t,e,r,n)=>r?0:(n.isWindowsNewline=e!==0&&t[e-1]==="\r",n.isWindowsNewline?2:1),ug=function*({previousChunks:t}){t.length>0&&(yield t)},yc=({binary:t,preserveNewlines:e,readableObjectMode:r,state:n})=>t||e||r?void 0:{transform:cg.bind(void 0,n)},cg=function*({isWindowsNewline:t=!1},e){let{unixNewline:r,windowsNewline:n,LF:o,concatBytes:s}=typeof e=="string"?lg:Dg;if(e.at(-1)===o){yield e;return}yield s(e,t?n:r)},po=(t,e)=>`${t}${e}`,lg={windowsNewline:`\r
|
|
121
121
|
`,unixNewline:`
|
|
122
122
|
`,LF:`
|
|
123
|
-
`,concatBytes:po},
|
|
123
|
+
`,concatBytes:po},pg=(t,e)=>{let r=new Uint8Array(t.length+e.length);return r.set(t,0),r.set(e,t.length),r},Dg={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:pg};import{Buffer as dg}from"buffer";var Sc=(t,e)=>t?void 0:mg.bind(void 0,e),mg=function*(t,e){if(typeof e!="string"&&!B(e)&&!dg.isBuffer(e))throw new TypeError(`The \`${t}\` option's transform must use "objectMode: true" to receive as input: ${typeof e}.`);yield e},Fc=(t,e)=>t?fg.bind(void 0,e):hg.bind(void 0,e),fg=function*(t,e){wc(t,e),yield e},hg=function*(t,e){if(wc(t,e),typeof e!="string"&&!B(e))throw new TypeError(`The \`${t}\` option's function must yield a string or an Uint8Array, not ${typeof e}.`);yield e},wc=(t,e)=>{if(e==null)throw new TypeError(`The \`${t}\` option's function must not call \`yield ${e}\`.
|
|
124
124
|
Instead, \`yield\` should either be called with a value, or not be called at all. For example:
|
|
125
|
-
if (condition) { yield value; }`)};import{Buffer as Eg}from"buffer";import{StringDecoder as yg}from"string_decoder";var Er=(t,e,r)=>{if(r)return;if(t)return{transform:Cg.bind(void 0,new TextEncoder)};let n=new yg(e);return{transform:Sg.bind(void 0,n),final:wg.bind(void 0,n)}},Cg=function*(t,e){Eg.isBuffer(e)?yield Q(e):typeof e=="string"?yield t.encode(e):yield e},Sg=function*(t,e){yield B(e)?t.write(e):e},wg=function*(t){let e=t.end();e!==""&&(yield e)};import{callbackify as xc}from"util";var mo=xc(async(t,e,r,n)=>{e.currentIterable=t(...r);try{for await(let o of e.currentIterable)n.push(o)}finally{delete e.currentIterable}}),yr=async function*(t,e,r){if(r===e.length){yield t;return}let{transform:n=xg}=e[r];for await(let o of n(t))yield*yr(o,e,r+1)},Ac=async function*(t){for(let[e,{final:r}]of Object.entries(t))yield*Fg(r,Number(e),t)},Fg=async function*(t,e,r){if(t!==void 0)for await(let n of t())yield*yr(n,r,e+1)},Oc=xc(async({currentIterable:t},e)=>{if(t!==void 0){await(e?t.throw(e):t.return());return}if(e)throw e}),xg=function*(t){yield t};var fo=(t,e,r,n)=>{try{for(let o of t(...e))r.push(o);n()}catch(o){n(o)}},_c=(t,e)=>[...e.flatMap(r=>[...be(r,t,0)]),...it(t)],be=function*(t,e,r){if(r===e.length){yield t;return}let{transform:n=Og}=e[r];for(let o of n(t))yield*be(o,e,r+1)},it=function*(t){for(let[e,{final:r}]of Object.entries(t))yield*Ag(r,Number(e),t)},Ag=function*(t,e,r){if(t!==void 0)for(let n of t())yield*be(n,r,e+1)},Og=function*(t){yield t};var ho=({value:t,value:{transform:e,final:r,writableObjectMode:n,readableObjectMode:o},optionName:s},{encoding:i})=>{let a={},u=Bc(t,i,s),c=ge(e),l=ge(r),p=c?mo.bind(void 0,yr,a):fo.bind(void 0,be),d=c||l?mo.bind(void 0,Ac,a):fo.bind(void 0,it),m=c||l?Oc.bind(void 0,a):void 0;return{stream:new _g({writableObjectMode:n,writableHighWaterMark:$c(n),readableObjectMode:o,readableHighWaterMark:$c(o),transform(g,S,E){p([g,u,0],this,E)},flush(g){d([u],this,g)},destroy:m})}},Cr=(t,e,r,n)=>{let o=e.filter(({type:i})=>i==="generator"),s=n?o.reverse():o;for(let{value:i,optionName:a}of s){let u=Bc(i,r,a);t=_c(u,t)}return t},Bc=({transform:t,final:e,binary:r,writableObjectMode:n,readableObjectMode:o,preserveNewlines:s},i,a)=>{let u={};return[{transform:Sc(n,a)},Er(r,i,n),br(r,s,n,u),{transform:t,final:e},{transform:wc(o,a)},Cc({binary:r,preserveNewlines:s,readableObjectMode:o,state:u})].filter(Boolean)};var Tc=(t,e)=>{for(let r of $g(t))Bg(t,r,e)},$g=t=>new Set(Object.entries(t).filter(([,{direction:e}])=>e==="input").map(([e])=>Number(e))),Bg=(t,e,r)=>{let{stdioItems:n}=t[e],o=n.filter(({contents:a})=>a!==void 0);if(o.length===0)return;if(e!==0){let[{type:a,optionName:u}]=o;throw new TypeError(`Only the \`stdin\` option, not \`${u}\`, can be ${le[a]} with synchronous methods.`)}let i=o.map(({contents:a})=>a).map(a=>Tg(a,n));r.input=Ke(i)},Tg=(t,e)=>{let r=Cr(t,e,"utf8",!0);return vg(r),Ke(r)},vg=t=>{let e=t.find(r=>typeof r!="string"&&!B(r));if(e!==void 0)throw new TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${e}.`)};import{writeFileSync as Pg,appendFileSync as kg}from"fs";var Sr=({stdioItems:t,encoding:e,verboseInfo:r,fdNumber:n})=>n!=="all"&&Oe(r,n)&&!k.has(e)&&Ig(n)&&(t.some(({type:o,value:s})=>o==="native"&&Rg.has(s))||t.every(({type:o})=>N.has(o))),Ig=t=>t===1||t===2,Rg=new Set(["pipe","overlapped"]),vc=async(t,e,r,n)=>{for await(let o of t)Mg(e)||Rc(o,r,n)},Ic=(t,e,r)=>{for(let n of t)Rc(n,e,r)},Mg=t=>t._readableState.pipes.length>0,Rc=(t,e,r)=>{let n=Rt(t);q({type:"output",verboseMessage:n,fdNumber:e,verboseInfo:r})};var Mc=({fileDescriptors:t,syncResult:{output:e},options:r,isMaxBuffer:n,verboseInfo:o})=>{if(e===null)return{output:Array.from({length:3})};let s={},i=new Set([]);return{output:e.map((u,c)=>Lg({result:u,fileDescriptors:t,fdNumber:c,state:s,outputFiles:i,isMaxBuffer:n,verboseInfo:o},r)),...s}},Lg=({result:t,fileDescriptors:e,fdNumber:r,state:n,outputFiles:o,isMaxBuffer:s,verboseInfo:i},{buffer:a,encoding:u,lines:c,stripFinalNewline:l,maxBuffer:p})=>{if(t===null)return;let d=Pu(t,s,p),m=Q(d),{stdioItems:f,objectMode:g}=e[r],S=jg([m],f,u,n),{serializedResult:E,finalResult:_=E}=Ng({chunks:S,objectMode:g,encoding:u,lines:c,stripFinalNewline:l,fdNumber:r});Ug({serializedResult:E,fdNumber:r,state:n,verboseInfo:i,encoding:u,stdioItems:f,objectMode:g});let T=a[r]?_:void 0;try{return n.error===void 0&&Vg(E,f,o),T}catch(y){return n.error=y,T}},jg=(t,e,r,n)=>{try{return Cr(t,e,r,!1)}catch(o){return n.error=o,t}},Ng=({chunks:t,objectMode:e,encoding:r,lines:n,stripFinalNewline:o,fdNumber:s})=>{if(e)return{serializedResult:t};if(r==="buffer")return{serializedResult:Ke(t)};let i=Ji(t,r);return n[s]?{serializedResult:i,finalResult:Do(i,!o[s],e)}:{serializedResult:i}},Ug=({serializedResult:t,fdNumber:e,state:r,verboseInfo:n,encoding:o,stdioItems:s,objectMode:i})=>{if(!Sr({stdioItems:s,encoding:o,verboseInfo:n,fdNumber:e}))return;let a=Do(t,!1,i);try{Ic(a,e,n)}catch(u){r.error??=u}},Vg=(t,e,r)=>{for(let{path:n,append:o}of e.filter(({type:s})=>hr.has(s))){let s=typeof n=="string"?n:n.toString();o||r.has(s)?kg(n,t):(r.add(s),Pg(n,t))}};var Pc=([,t,e],r)=>{if(r.all)return t===void 0?e:e===void 0?t:Array.isArray(t)?Array.isArray(e)?[...t,...e]:[...t,re(e,r,"all")]:Array.isArray(e)?[re(t,r,"all"),...e]:B(t)&&B(e)?Cn([t,e]):`${t}${e}`};import{once as go}from"events";var kc=async(t,e)=>{let[r,n]=await Gg(t);return e.isForcefullyTerminated??=!1,[r,n]},Gg=async t=>{let[e,r]=await Promise.allSettled([go(t,"spawn"),go(t,"exit")]);return e.status==="rejected"?[]:r.status==="rejected"?Lc(t):r.value},Lc=async t=>{try{return await go(t,"exit")}catch{return Lc(t)}},jc=async t=>{let[e,r]=await t;if(!Wg(e,r)&&bo(e,r))throw new W;return[e,r]},Wg=(t,e)=>t===void 0&&e===void 0,bo=(t,e)=>t!==0||e!==null;var Nc=({error:t,status:e,signal:r,output:n},{maxBuffer:o})=>{let s=Hg(t,e,r),i=s?.code==="ETIMEDOUT",a=Mu(s,n,o);return{resultError:s,exitCode:e,signal:r,timedOut:i,isMaxBuffer:a}},Hg=(t,e,r)=>t!==void 0?t:bo(e,r)?new W:void 0;var Uc=(t,e,r)=>{let{file:n,commandArguments:o,command:s,escapedCommand:i,startTime:a,verboseInfo:u,options:c,fileDescriptors:l}=qg(t,e,r),p=Jg({file:n,commandArguments:o,options:c,command:s,escapedCommand:i,verboseInfo:u,fileDescriptors:l,startTime:a});return Pe(p,u,c)},qg=(t,e,r)=>{let{command:n,escapedCommand:o,startTime:s,verboseInfo:i}=Pt(t,e,r),a=Yg(r),{file:u,commandArguments:c,options:l}=nr(t,e,a);Kg(l);let p=gc(l,i);return{file:u,commandArguments:c,command:n,escapedCommand:o,startTime:s,verboseInfo:i,options:l,fileDescriptors:p}},Yg=t=>t.node&&!t.ipc?{...t,ipc:!1}:t,Kg=({ipc:t,ipcInput:e,detached:r,cancelSignal:n})=>{e&&wr("ipcInput"),t&&wr("ipc: true"),r&&wr("detached: true"),n&&wr("cancelSignal")},wr=t=>{throw new TypeError(`The "${t}" option cannot be used with synchronous methods.`)},Jg=({file:t,commandArguments:e,options:r,command:n,escapedCommand:o,verboseInfo:s,fileDescriptors:i,startTime:a})=>{let u=Xg({file:t,commandArguments:e,options:r,command:n,escapedCommand:o,fileDescriptors:i,startTime:a});if(u.failed)return u;let{resultError:c,exitCode:l,signal:p,timedOut:d,isMaxBuffer:m}=Nc(u,r),{output:f,error:g=c}=Mc({fileDescriptors:i,syncResult:u,options:r,isMaxBuffer:m,verboseInfo:s}),S=f.map((_,T)=>re(_,r,T)),E=re(Pc(f,r),r,"all");return Qg({error:g,exitCode:l,signal:p,timedOut:d,isMaxBuffer:m,stdio:S,all:E,options:r,command:n,escapedCommand:o,startTime:a})},Xg=({file:t,commandArguments:e,options:r,command:n,escapedCommand:o,fileDescriptors:s,startTime:i})=>{try{Tc(s,r);let a=Zg(r);return zg(...or(t,e,a))}catch(a){return Me({error:a,command:n,escapedCommand:o,fileDescriptors:s,options:r,startTime:i,isSync:!0})}},Zg=({encoding:t,maxBuffer:e,...r})=>({...r,encoding:"buffer",maxBuffer:dr(e)}),Qg=({error:t,exitCode:e,signal:r,timedOut:n,isMaxBuffer:o,stdio:s,all:i,options:a,command:u,escapedCommand:c,startTime:l})=>t===void 0?Dr({command:u,escapedCommand:c,stdio:s,all:i,ipcOutput:[],options:a,startTime:l}):ot({error:t,command:u,escapedCommand:c,timedOut:n,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:o,isForcefullyTerminated:!1,exitCode:e,signal:r,stdio:s,all:i,ipcOutput:[],options:a,startTime:l,isSync:!0});import{setMaxListeners as NE}from"events";import{spawn as UE}from"child_process";import zc from"process";import{once as Eo,on as eb}from"events";var Vc=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},{reference:o=!0,filter:s}={})=>(Be({methodName:"getOneMessage",isSubprocess:r,ipc:n,isConnected:Xt(t)}),tb({anyProcess:t,channel:e,isSubprocess:r,filter:s,reference:o})),tb=async({anyProcess:t,channel:e,isSubprocess:r,filter:n,reference:o})=>{qt(e,o);let s=ce(t,e,r),i=new AbortController;try{return await Promise.race([rb(s,n,i),nb(s,r,i),ob(s,r,i)])}catch(a){throw Te(t),a}finally{i.abort(),Yt(e,o)}},rb=async(t,e,{signal:r})=>{if(e===void 0){let[n]=await Eo(t,"message",{signal:r});return n}for await(let[n]of eb(t,"message",{signal:r}))if(e(n))return n},nb=async(t,e,{signal:r})=>{await Eo(t,"disconnect",{signal:r}),_a(e)},ob=async(t,e,{signal:r})=>{let[n]=await Eo(t,"strict:error",{signal:r});throw Wt(n,e)};import{once as Wc,on as ib}from"events";var Hc=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},{reference:o=!0}={})=>yo({anyProcess:t,channel:e,isSubprocess:r,ipc:n,shouldAwait:!r,reference:o}),yo=({anyProcess:t,channel:e,isSubprocess:r,ipc:n,shouldAwait:o,reference:s})=>{Be({methodName:"getEachMessage",isSubprocess:r,ipc:n,isConnected:Xt(t)}),qt(e,s);let i=ce(t,e,r),a=new AbortController,u={};return sb(t,i,a),ab({ipcEmitter:i,isSubprocess:r,controller:a,state:u}),ub({anyProcess:t,channel:e,ipcEmitter:i,isSubprocess:r,shouldAwait:o,controller:a,state:u,reference:s})},sb=async(t,e,r)=>{try{await Wc(e,"disconnect",{signal:r.signal}),r.abort()}catch{}},ab=async({ipcEmitter:t,isSubprocess:e,controller:r,state:n})=>{try{let[o]=await Wc(t,"strict:error",{signal:r.signal});n.error=Wt(o,e),r.abort()}catch{}},ub=async function*({anyProcess:t,channel:e,ipcEmitter:r,isSubprocess:n,shouldAwait:o,controller:s,state:i,reference:a}){try{for await(let[u]of ib(r,"message",{signal:s.signal}))Gc(i),yield u}catch{Gc(i)}finally{s.abort(),Yt(e,a),n||Te(t),o&&await t}},Gc=({error:t})=>{if(t)throw t};var qc=(t,{ipc:e})=>{Object.assign(t,Kc(t,!1,e))},Yc=()=>{let t=zc,e=!0,r=zc.channel!==void 0;return{...Kc(t,e,r),getCancelSignal:tu.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})}},Kc=(t,e,r)=>({sendMessage:tr.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getOneMessage:Vc.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getEachMessage:Hc.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})});import{ChildProcess as cb}from"child_process";import{PassThrough as lb,Readable as pb,Writable as db,Duplex as Db}from"stream";var Jc=({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:o,startTime:s,verboseInfo:i})=>{co(n);let a=new cb;mb(a,n),Object.assign(a,{readable:fb,writable:hb,duplex:gb});let u=Me({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:o,startTime:s,isSync:!1}),c=bb(u,i,o);return{subprocess:a,promise:c}},mb=(t,e)=>{let r=st(),n=st(),o=st(),s=Array.from({length:e.length-3},st),i=st(),a=[r,n,o,...s];Object.assign(t,{stdin:r,stdout:n,stderr:o,all:i,stdio:a})},st=()=>{let t=new lb;return t.end(),t},fb=()=>new pb({read(){}}),hb=()=>new db({write(){}}),gb=()=>new Db({read(){},write(){}}),bb=async(t,e,r)=>Pe(t,e,r);import{createReadStream as Xc,createWriteStream as Zc}from"fs";import{Buffer as Eb}from"buffer";import{Readable as at,Writable as yb,Duplex as Cb}from"stream";var el=(t,e)=>gr(Sb,t,e,!1),ut=({type:t,optionName:e})=>{throw new TypeError(`The \`${e}\` option cannot be ${le[t]}.`)},Qc={fileNumber:ut,generator:ho,asyncGenerator:ho,nodeStream:({value:t})=>({stream:t}),webTransform({value:{transform:t,writableObjectMode:e,readableObjectMode:r}}){let n=e||r;return{stream:Cb.fromWeb(t,{objectMode:n})}},duplex:({value:{transform:t}})=>({stream:t}),native(){}},Sb={input:{...Qc,fileUrl:({value:t})=>({stream:Xc(t)}),filePath:({value:{file:t}})=>({stream:Xc(t)}),webStream:({value:t})=>({stream:at.fromWeb(t)}),iterable:({value:t})=>({stream:at.from(t)}),asyncIterable:({value:t})=>({stream:at.from(t)}),string:({value:t})=>({stream:at.from(t)}),uint8Array:({value:t})=>({stream:at.from(Eb.from(t))})},output:{...Qc,fileUrl:({value:t})=>({stream:Zc(t)}),filePath:({value:{file:t,append:e}})=>({stream:Zc(t,e?{flags:"a"}:{})}),webStream:({value:t})=>({stream:yb.fromWeb(t)}),iterable:ut,asyncIterable:ut,string:ut,uint8Array:ut}};import{on as wb,once as tl}from"events";import{PassThrough as Fb,getDefaultHighWaterMark as xb}from"stream";import{finished as ol}from"stream/promises";function Ee(t){if(!Array.isArray(t))throw new TypeError(`Expected an array, got \`${typeof t}\`.`);for(let o of t)So(o);let e=t.some(({readableObjectMode:o})=>o),r=Ab(t,e),n=new Co({objectMode:e,writableHighWaterMark:r,readableHighWaterMark:r});for(let o of t)n.add(o);return n}var Ab=(t,e)=>{if(t.length===0)return xb(e);let r=t.filter(({readableObjectMode:n})=>n===e).map(({readableHighWaterMark:n})=>n);return Math.max(...r)},Co=class extends Fb{#t=new Set([]);#r=new Set([]);#e=new Set([]);#n;#i=Symbol("unpipe");#o=new WeakMap;add(e){if(So(e),this.#t.has(e))return;this.#t.add(e),this.#n??=Ob(this,this.#t,this.#i);let r=Bb({passThroughStream:this,stream:e,streams:this.#t,ended:this.#r,aborted:this.#e,onFinished:this.#n,unpipeEvent:this.#i});this.#o.set(e,r),e.pipe(this,{end:!1})}async remove(e){if(So(e),!this.#t.has(e))return!1;let r=this.#o.get(e);return r===void 0?!1:(this.#o.delete(e),e.unpipe(this),await r,!0)}},Ob=async(t,e,r)=>{Fr(t,rl);let n=new AbortController;try{await Promise.race([_b(t,n),$b(t,e,r,n)])}finally{n.abort(),Fr(t,-rl)}},_b=async(t,{signal:e})=>{try{await ol(t,{signal:e,cleanup:!0})}catch(r){throw il(t,r),r}},$b=async(t,e,r,{signal:n})=>{for await(let[o]of wb(t,"unpipe",{signal:n}))e.has(o)&&o.emit(r)},So=t=>{if(typeof t?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof t}\`.`)},Bb=async({passThroughStream:t,stream:e,streams:r,ended:n,aborted:o,onFinished:s,unpipeEvent:i})=>{Fr(t,nl);let a=new AbortController;try{await Promise.race([Tb(s,e,a),vb({passThroughStream:t,stream:e,streams:r,ended:n,aborted:o,controller:a}),Ib({stream:e,streams:r,ended:n,aborted:o,unpipeEvent:i,controller:a})])}finally{a.abort(),Fr(t,-nl)}r.size>0&&r.size===n.size+o.size&&(n.size===0&&o.size>0?wo(t):Rb(t))},Tb=async(t,e,{signal:r})=>{try{await t,r.aborted||wo(e)}catch(n){r.aborted||il(e,n)}},vb=async({passThroughStream:t,stream:e,streams:r,ended:n,aborted:o,controller:{signal:s}})=>{try{await ol(e,{signal:s,cleanup:!0,readable:!0,writable:!1}),r.has(e)&&n.add(e)}catch(i){if(s.aborted||!r.has(e))return;sl(i)?o.add(e):al(t,i)}},Ib=async({stream:t,streams:e,ended:r,aborted:n,unpipeEvent:o,controller:{signal:s}})=>{if(await tl(t,o,{signal:s}),!t.readable)return tl(s,"abort",{signal:s});e.delete(t),r.delete(t),n.delete(t)},Rb=t=>{t.writable&&t.end()},il=(t,e)=>{sl(e)?wo(t):al(t,e)},sl=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",wo=t=>{(t.readable||t.writable)&&t.destroy()},al=(t,e)=>{t.destroyed||(t.once("error",Mb),t.destroy(e))},Mb=()=>{},Fr=(t,e)=>{let r=t.getMaxListeners();r!==0&&r!==Number.POSITIVE_INFINITY&&t.setMaxListeners(r+e)},rl=2,nl=1;import{finished as ul}from"stream/promises";var Le=(t,e)=>{t.pipe(e),Pb(t,e),kb(t,e)},Pb=async(t,e)=>{if(!(G(t)||G(e))){try{await ul(t,{cleanup:!0,readable:!0,writable:!1})}catch{}Fo(e)}},Fo=t=>{t.writable&&t.end()},kb=async(t,e)=>{if(!(G(t)||G(e))){try{await ul(e,{cleanup:!0,readable:!1,writable:!0})}catch{}xo(t)}},xo=t=>{t.readable&&t.destroy()};var cl=(t,e,r)=>{let n=new Map;for(let[o,{stdioItems:s,direction:i}]of Object.entries(e)){for(let{stream:a}of s.filter(({type:u})=>N.has(u)))Lb(t,a,i,o);for(let{stream:a}of s.filter(({type:u})=>!N.has(u)))Nb({subprocess:t,stream:a,direction:i,fdNumber:o,pipeGroups:n,controller:r})}for(let[o,s]of n.entries()){let i=s.length===1?s[0]:Ee(s);Le(i,o)}},Lb=(t,e,r,n)=>{r==="output"?Le(t.stdio[n],e):Le(e,t.stdio[n]);let o=jb[n];o!==void 0&&(t[o]=e),t.stdio[n]=e},jb=["stdin","stdout","stderr"],Nb=({subprocess:t,stream:e,direction:r,fdNumber:n,pipeGroups:o,controller:s})=>{if(e===void 0)return;Ub(e,s);let[i,a]=r==="output"?[e,t.stdio[n]]:[t.stdio[n],e],u=o.get(i)??[];o.set(i,[...u,a])},Ub=(t,{signal:e})=>{G(t)&&fe(t,Vb,e)},Vb=2;import{addAbortListener as Hb}from"events";var ye=[];ye.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&ye.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&ye.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var xr=t=>!!t&&typeof t=="object"&&typeof t.removeListener=="function"&&typeof t.emit=="function"&&typeof t.reallyExit=="function"&&typeof t.listeners=="function"&&typeof t.kill=="function"&&typeof t.pid=="number"&&typeof t.on=="function",Ao=Symbol.for("signal-exit emitter"),Oo=globalThis,Gb=Object.defineProperty.bind(Object),_o=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(Oo[Ao])return Oo[Ao];Gb(Oo,Ao,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,r){this.listeners[e].push(r)}removeListener(e,r){let n=this.listeners[e],o=n.indexOf(r);o!==-1&&(o===0&&n.length===1?n.length=0:n.splice(o,1))}emit(e,r,n){if(this.emitted[e])return!1;this.emitted[e]=!0;let o=!1;for(let s of this.listeners[e])o=s(r,n)===!0||o;return e==="exit"&&(o=this.emit("afterExit",r,n)||o),o}},Ar=class{},Wb=t=>({onExit(e,r){return t.onExit(e,r)},load(){return t.load()},unload(){return t.unload()}}),$o=class extends Ar{onExit(){return()=>{}}load(){}unload(){}},Bo=class extends Ar{#t=To.platform==="win32"?"SIGINT":"SIGHUP";#r=new _o;#e;#n;#i;#o={};#s=!1;constructor(e){super(),this.#e=e,this.#o={};for(let r of ye)this.#o[r]=()=>{let n=this.#e.listeners(r),{count:o}=this.#r,s=e;if(typeof s.__signal_exit_emitter__=="object"&&typeof s.__signal_exit_emitter__.count=="number"&&(o+=s.__signal_exit_emitter__.count),n.length===o){this.unload();let i=this.#r.emit("exit",null,r),a=r==="SIGHUP"?this.#t:r;i||e.kill(e.pid,a)}};this.#i=e.reallyExit,this.#n=e.emit}onExit(e,r){if(!xr(this.#e))return()=>{};this.#s===!1&&this.load();let n=r?.alwaysLast?"afterExit":"exit";return this.#r.on(n,e),()=>{this.#r.removeListener(n,e),this.#r.listeners.exit.length===0&&this.#r.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#s){this.#s=!0,this.#r.count+=1;for(let e of ye)try{let r=this.#o[e];r&&this.#e.on(e,r)}catch{}this.#e.emit=(e,...r)=>this.#u(e,...r),this.#e.reallyExit=e=>this.#a(e)}}unload(){this.#s&&(this.#s=!1,ye.forEach(e=>{let r=this.#o[e];if(!r)throw new Error("Listener not defined for signal: "+e);try{this.#e.removeListener(e,r)}catch{}}),this.#e.emit=this.#n,this.#e.reallyExit=this.#i,this.#r.count-=1)}#a(e){return xr(this.#e)?(this.#e.exitCode=e||0,this.#r.emit("exit",this.#e.exitCode,null),this.#i.call(this.#e,this.#e.exitCode)):0}#u(e,...r){let n=this.#n;if(e==="exit"&&xr(this.#e)){typeof r[0]=="number"&&(this.#e.exitCode=r[0]);let o=n.call(this.#e,e,...r);return this.#r.emit("exit",this.#e.exitCode,null),o}else return n.call(this.#e,e,...r)}},To=globalThis.process,{onExit:ll,load:tA,unload:rA}=Wb(xr(To)?new Bo(To):new $o);var pl=(t,{cleanup:e,detached:r},{signal:n})=>{if(!e||r)return;let o=ll(()=>{t.kill()});Hb(n,()=>{o()})};var Dl=({source:t,sourcePromise:e,boundOptions:r,createNested:n},...o)=>{let s=Mt(),{destination:i,destinationStream:a,destinationError:u,from:c,unpipeSignal:l}=zb(r,n,o),{sourceStream:p,sourceError:d}=Yb(t,c),{options:m,fileDescriptors:f}=K.get(t);return{sourcePromise:e,sourceStream:p,sourceOptions:m,sourceError:d,destination:i,destinationStream:a,destinationError:u,unpipeSignal:l,fileDescriptors:f,startTime:s}},zb=(t,e,r)=>{try{let{destination:n,pipeOptions:{from:o,to:s,unpipeSignal:i}={}}=qb(t,e,...r),a=zt(n,s);return{destination:n,destinationStream:a,from:o,unpipeSignal:i}}catch(n){return{destinationError:n}}},qb=(t,e,r,...n)=>{if(Array.isArray(r))return{destination:e(dl,t)(r,...n),pipeOptions:t};if(typeof r=="string"||r instanceof URL||En(r)){if(Object.keys(t).length>0)throw new TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');let[o,s,i]=xt(r,...n);return{destination:e(dl)(o,s,i),pipeOptions:i}}if(K.has(r)){if(Object.keys(t).length>0)throw new TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:r,pipeOptions:n[0]}}throw new TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${r}`)},dl=({options:t})=>({options:{...t,stdin:"pipe",piped:!0}}),Yb=(t,e)=>{try{return{sourceStream:ve(t,e)}}catch(r){return{sourceError:r}}};var fl=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n,fileDescriptors:o,sourceOptions:s,startTime:i})=>{let a=Kb({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n});if(a!==void 0)throw vo({error:a,fileDescriptors:o,sourceOptions:s,startTime:i})},Kb=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n})=>{if(e!==void 0&&n!==void 0)return n;if(n!==void 0)return xo(t),n;if(e!==void 0)return Fo(r),e},vo=({error:t,fileDescriptors:e,sourceOptions:r,startTime:n})=>Me({error:t,command:ml,escapedCommand:ml,fileDescriptors:e,options:r,startTime:n,isSync:!1}),ml="source.pipe(destination)";var hl=async t=>{let[{status:e,reason:r,value:n=r},{status:o,reason:s,value:i=s}]=await t;if(i.pipedFrom.includes(n)||i.pipedFrom.push(n),o==="rejected")throw i;if(e==="rejected")throw n;return i};import{finished as Jb}from"stream/promises";var gl=(t,e,r)=>{let n=Or.has(e)?Zb(t,e):Xb(t,e);return fe(t,eE,r.signal),fe(e,tE,r.signal),Qb(e),n},Xb=(t,e)=>{let r=Ee([t]);return Le(r,e),Or.set(e,r),r},Zb=(t,e)=>{let r=Or.get(e);return r.add(t),r},Qb=async t=>{try{await Jb(t,{cleanup:!0,readable:!1,writable:!0})}catch{}Or.delete(t)},Or=new WeakMap,eE=2,tE=1;import{aborted as rE}from"util";var bl=(t,e)=>t===void 0?[]:[nE(t,e)],nE=async(t,{sourceStream:e,mergedStream:r,fileDescriptors:n,sourceOptions:o,startTime:s})=>{await rE(t,e),await r.remove(e);let i=new Error("Pipe canceled by `unpipeSignal` option.");throw vo({error:i,fileDescriptors:n,sourceOptions:o,startTime:s})};var _r=(t,...e)=>{if(O(e[0]))return _r.bind(void 0,{...t,boundOptions:{...t.boundOptions,...e[0]}});let{destination:r,...n}=Dl(t,...e),o=oE({...n,destination:r});return o.pipe=_r.bind(void 0,{...t,source:r,sourcePromise:o,boundOptions:{}}),o},oE=async({sourcePromise:t,sourceStream:e,sourceOptions:r,sourceError:n,destination:o,destinationStream:s,destinationError:i,unpipeSignal:a,fileDescriptors:u,startTime:c})=>{let l=iE(t,o);fl({sourceStream:e,sourceError:n,destinationStream:s,destinationError:i,fileDescriptors:u,sourceOptions:r,startTime:c});let p=new AbortController;try{let d=gl(e,s,p);return await Promise.race([hl(l),...bl(a,{sourceStream:e,mergedStream:d,sourceOptions:r,fileDescriptors:u,startTime:c})])}finally{p.abort()}},iE=(t,e)=>Promise.allSettled([t,e]);import{setImmediate as dE}from"timers/promises";import{on as sE}from"events";import{getDefaultHighWaterMark as aE}from"stream";var $r=({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:n,encoding:o,preserveNewlines:s})=>{let i=new AbortController;return uE(e,i),yl({stream:t,controller:i,binary:r,shouldEncode:!t.readableObjectMode&&n,encoding:o,shouldSplit:!t.readableObjectMode,preserveNewlines:s})},uE=async(t,e)=>{try{await t}catch{}finally{e.abort()}},Io=({stream:t,onStreamEnd:e,lines:r,encoding:n,stripFinalNewline:o,allMixed:s})=>{let i=new AbortController;cE(e,i,t);let a=t.readableObjectMode&&!s;return yl({stream:t,controller:i,binary:n==="buffer",shouldEncode:!a,encoding:n,shouldSplit:!a&&r,preserveNewlines:!o})},cE=async(t,e,r)=>{try{await t}catch{r.destroy()}finally{e.abort()}},yl=({stream:t,controller:e,binary:r,shouldEncode:n,encoding:o,shouldSplit:s,preserveNewlines:i})=>{let a=sE(t,"data",{signal:e.signal,highWaterMark:El,highWatermark:El});return lE({onStdoutChunk:a,controller:e,binary:r,shouldEncode:n,encoding:o,shouldSplit:s,preserveNewlines:i})},Ro=aE(!0),El=Ro,lE=async function*({onStdoutChunk:t,controller:e,binary:r,shouldEncode:n,encoding:o,shouldSplit:s,preserveNewlines:i}){let a=pE({binary:r,shouldEncode:n,encoding:o,shouldSplit:s,preserveNewlines:i});try{for await(let[u]of t)yield*be(u,a,0)}catch(u){if(!e.signal.aborted)throw u}finally{yield*it(a)}},pE=({binary:t,shouldEncode:e,encoding:r,shouldSplit:n,preserveNewlines:o})=>[Er(t,r,!e),br(t,o,!n,{})].filter(Boolean);var Cl=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,buffer:o,maxBuffer:s,lines:i,allMixed:a,stripFinalNewline:u,verboseInfo:c,streamInfo:l})=>{let p=DE({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,allMixed:a,verboseInfo:c,streamInfo:l});if(!o){await Promise.all([mE(t),p]);return}let d=lo(u,r),m=Io({stream:t,onStreamEnd:e,lines:i,encoding:n,stripFinalNewline:d,allMixed:a}),[f]=await Promise.all([fE({stream:t,iterable:m,fdNumber:r,encoding:n,maxBuffer:s,lines:i}),p]);return f},DE=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,allMixed:o,verboseInfo:s,streamInfo:{fileDescriptors:i}})=>{if(!Sr({stdioItems:i[r]?.stdioItems,encoding:n,verboseInfo:s,fdNumber:r}))return;let a=Io({stream:t,onStreamEnd:e,lines:!0,encoding:n,stripFinalNewline:!0,allMixed:o});await vc(a,t,r,s)},mE=async t=>{await dE(),t.readableFlowing===null&&t.resume()},fE=async({stream:t,stream:{readableObjectMode:e},iterable:r,fdNumber:n,encoding:o,maxBuffer:s,lines:i})=>{try{return e||i?await ur(r,{maxBuffer:s}):o==="buffer"?new Uint8Array(await cr(r,{maxBuffer:s})):await pr(r,{maxBuffer:s})}catch(a){return Sl(vu({error:a,stream:t,readableObjectMode:e,lines:i,encoding:o,fdNumber:n}))}},Mo=async t=>{try{return await t}catch(e){return Sl(e)}},Sl=({bufferedData:t})=>Yi(t)?new Uint8Array(t):t;import{finished as hE}from"stream/promises";var ct=async(t,e,r,{isSameDirection:n,stopOnExit:o=!1}={})=>{let s=gE(t,r),i=new AbortController;try{await Promise.race([...o?[r.exitPromise]:[],hE(t,{cleanup:!0,signal:i.signal})])}catch(a){s.stdinCleanedUp||yE(a,e,r,n)}finally{i.abort()}},gE=(t,{originalStreams:[e],subprocess:r})=>{let n={stdinCleanedUp:!1};return t===e&&bE(t,r,n),n},bE=(t,e,r)=>{let{_destroy:n}=t;t._destroy=(...o)=>{EE(e,r),n.call(t,...o)}},EE=({exitCode:t,signalCode:e},r)=>{(t!==null||e!==null)&&(r.stdinCleanedUp=!0)},yE=(t,e,r,n)=>{if(!CE(t,e,r,n))throw t},CE=(t,e,r,n=!0)=>r.propagating?wl(t)||Br(t):(r.propagating=!0,Po(r,e)===n?wl(t):Br(t)),Po=({fileDescriptors:t},e)=>e!=="all"&&t[e].direction==="input",Br=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",wl=t=>t?.code==="EPIPE";var Fl=({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:o,stripFinalNewline:s,verboseInfo:i,streamInfo:a})=>t.stdio.map((u,c)=>ko({stream:u,fdNumber:c,encoding:e,buffer:r[c],maxBuffer:n[c],lines:o[c],allMixed:!1,stripFinalNewline:s,verboseInfo:i,streamInfo:a})),ko=async({stream:t,fdNumber:e,encoding:r,buffer:n,maxBuffer:o,lines:s,allMixed:i,stripFinalNewline:a,verboseInfo:u,streamInfo:c})=>{if(!t)return;let l=ct(t,e,c);if(Po(c,e)){await l;return}let[p]=await Promise.all([Cl({stream:t,onStreamEnd:l,fdNumber:e,encoding:r,buffer:n,maxBuffer:o,lines:s,allMixed:i,stripFinalNewline:a,verboseInfo:u,streamInfo:c}),l]);return p};var xl=({stdout:t,stderr:e},{all:r})=>r&&(t||e)?Ee([t,e].filter(Boolean)):void 0,Al=({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:o,stripFinalNewline:s,verboseInfo:i,streamInfo:a})=>ko({...SE(t,r),fdNumber:"all",encoding:e,maxBuffer:n[1]+n[2],lines:o[1]||o[2],allMixed:wE(t),stripFinalNewline:s,verboseInfo:i,streamInfo:a}),SE=({stdout:t,stderr:e,all:r},[,n,o])=>{let s=n||o;return s?n?o?{stream:r,buffer:s}:{stream:t,buffer:s}:{stream:e,buffer:s}:{stream:r,buffer:s}},wE=({all:t,stdout:e,stderr:r})=>t&&e&&r&&e.readableObjectMode!==r.readableObjectMode;import{once as FE}from"events";var Ol=t=>Oe(t,"ipc"),_l=(t,e)=>{let r=Rt(t);q({type:"ipc",verboseMessage:r,fdNumber:"ipc",verboseInfo:e})};var $l=async({subprocess:t,buffer:e,maxBuffer:r,ipc:n,ipcOutput:o,verboseInfo:s})=>{if(!n)return o;let i=Ol(s),a=ee(e,"ipc"),u=ee(r,"ipc");for await(let c of yo({anyProcess:t,channel:t.channel,isSubprocess:!1,ipc:n,shouldAwait:!1,reference:!0}))a&&(Iu(t,o,u),o.push(c)),i&&_l(c,s);return o},Bl=async(t,e)=>(await Promise.allSettled([t]),e);var Tl=async({subprocess:t,options:{encoding:e,buffer:r,maxBuffer:n,lines:o,timeoutDuration:s,cancelSignal:i,gracefulCancel:a,forceKillAfterDelay:u,stripFinalNewline:c,ipc:l,ipcInput:p},context:d,verboseInfo:m,fileDescriptors:f,originalStreams:g,onInternalError:S,controller:E})=>{let _=kc(t,d),T={originalStreams:g,fileDescriptors:f,subprocess:t,exitPromise:_,propagating:!1},y=Fl({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:o,stripFinalNewline:c,verboseInfo:m,streamInfo:T}),F=Al({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:o,stripFinalNewline:c,verboseInfo:m,streamInfo:T}),$=[],I=$l({subprocess:t,buffer:r,maxBuffer:n,ipc:l,ipcOutput:$,verboseInfo:m}),ne=xE(g,t,T),oe=AE(f,T);try{return await Promise.race([Promise.all([{},jc(_),Promise.all(y),F,I,pu(t,p),...ne,...oe]),S,OE(t,E),...su(t,s,d,E),...Oa({subprocess:t,cancelSignal:i,gracefulCancel:a,context:d,controller:E}),...ou({subprocess:t,cancelSignal:i,gracefulCancel:a,forceKillAfterDelay:u,context:d,controller:E})])}catch(Mr){return d.terminationReason??="other",Promise.all([{error:Mr},_,Promise.all(y.map(Ne=>Mo(Ne))),Mo(F),Bl(I,$),Promise.allSettled(ne),Promise.allSettled(oe)])}},xE=(t,e,r)=>t.map((n,o)=>n===e.stdio[o]?void 0:ct(n,o,r)),AE=(t,e)=>t.flatMap(({stdioItems:r},n)=>r.filter(({value:o,stream:s=o})=>z(s,{checkOpen:!1})&&!G(s)).map(({type:o,value:s,stream:i=s})=>ct(i,n,e,{isSameDirection:N.has(o),stopOnExit:o==="native"}))),OE=async(t,{signal:e})=>{let[r]=await FE(t,"error",{signal:e});throw r};var vl=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),lt=(t,e,r)=>{let n=t[r];n.has(e)||n.set(e,[]);let o=n.get(e),s=Y();return o.push(s),{resolve:s.resolve.bind(s),promises:o}},je=async({resolve:t,promises:e},r)=>{t();let[n]=await Promise.race([Promise.allSettled([!0,r]),Promise.all([!1,...e])]);return!n};import{Readable as _E}from"stream";import{callbackify as $E}from"util";import{finished as Il}from"stream/promises";var Lo=async t=>{if(t!==void 0)try{await jo(t)}catch{}},Rl=async t=>{if(t!==void 0)try{await No(t)}catch{}},jo=async t=>{await Il(t,{cleanup:!0,readable:!1,writable:!0})},No=async t=>{await Il(t,{cleanup:!0,readable:!0,writable:!1})},Tr=async(t,e)=>{if(await t,e)throw e},vr=(t,e,r)=>{r&&!Br(r)?t.destroy(r):e&&t.destroy()};var Ml=({subprocess:t,concurrentStreams:e,encoding:r},{from:n,binary:o=!0,preserveNewlines:s=!0}={})=>{let i=o||k.has(r),{subprocessStdout:a,waitReadableDestroy:u}=Uo(t,n,e),{readableEncoding:c,readableObjectMode:l,readableHighWaterMark:p}=Vo(a,i),{read:d,onStdoutDataDone:m}=Go({subprocessStdout:a,subprocess:t,binary:i,encoding:r,preserveNewlines:s}),f=new _E({read:d,destroy:$E(Ho.bind(void 0,{subprocessStdout:a,subprocess:t,waitReadableDestroy:u})),highWaterMark:p,objectMode:l,encoding:c});return Wo({subprocessStdout:a,onStdoutDataDone:m,readable:f,subprocess:t}),f},Uo=(t,e,r)=>{let n=ve(t,e),o=lt(r,n,"readableDestroy");return{subprocessStdout:n,waitReadableDestroy:o}},Vo=({readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r},n)=>n?{readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r}:{readableEncoding:t,readableObjectMode:!0,readableHighWaterMark:Ro},Go=({subprocessStdout:t,subprocess:e,binary:r,encoding:n,preserveNewlines:o})=>{let s=Y(),i=$r({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:!r,encoding:n,preserveNewlines:o});return{read(){BE(this,i,s)},onStdoutDataDone:s}},BE=async(t,e,r)=>{try{let{value:n,done:o}=await e.next();o?r.resolve():t.push(n)}catch{}},Wo=async({subprocessStdout:t,onStdoutDataDone:e,readable:r,subprocess:n,subprocessStdin:o})=>{try{await No(t),await n,await Lo(o),await e,r.readable&&r.push(null)}catch(s){await Lo(o),Pl(r,s)}},Ho=async({subprocessStdout:t,subprocess:e,waitReadableDestroy:r},n)=>{await je(r,e)&&(Pl(t,n),await Tr(e,n))},Pl=(t,e)=>{vr(t,t.readable,e)};import{Writable as TE}from"stream";import{callbackify as kl}from"util";var Ll=({subprocess:t,concurrentStreams:e},{to:r}={})=>{let{subprocessStdin:n,waitWritableFinal:o,waitWritableDestroy:s}=zo(t,r,e),i=new TE({...qo(n,t,o),destroy:kl(Ko.bind(void 0,{subprocessStdin:n,subprocess:t,waitWritableFinal:o,waitWritableDestroy:s})),highWaterMark:n.writableHighWaterMark,objectMode:n.writableObjectMode});return Yo(n,i),i},zo=(t,e,r)=>{let n=zt(t,e),o=lt(r,n,"writableFinal"),s=lt(r,n,"writableDestroy");return{subprocessStdin:n,waitWritableFinal:o,waitWritableDestroy:s}},qo=(t,e,r)=>({write:vE.bind(void 0,t),final:kl(IE.bind(void 0,t,e,r))}),vE=(t,e,r,n)=>{t.write(e,r)?n():t.once("drain",n)},IE=async(t,e,r)=>{await je(r,e)&&(t.writable&&t.end(),await e)},Yo=async(t,e,r)=>{try{await jo(t),e.writable&&e.end()}catch(n){await Rl(r),jl(e,n)}},Ko=async({subprocessStdin:t,subprocess:e,waitWritableFinal:r,waitWritableDestroy:n},o)=>{await je(r,e),await je(n,e)&&(jl(t,o),await Tr(e,o))},jl=(t,e)=>{vr(t,t.writable,e)};import{Duplex as RE}from"stream";import{callbackify as ME}from"util";var Nl=({subprocess:t,concurrentStreams:e,encoding:r},{from:n,to:o,binary:s=!0,preserveNewlines:i=!0}={})=>{let a=s||k.has(r),{subprocessStdout:u,waitReadableDestroy:c}=Uo(t,n,e),{subprocessStdin:l,waitWritableFinal:p,waitWritableDestroy:d}=zo(t,o,e),{readableEncoding:m,readableObjectMode:f,readableHighWaterMark:g}=Vo(u,a),{read:S,onStdoutDataDone:E}=Go({subprocessStdout:u,subprocess:t,binary:a,encoding:r,preserveNewlines:i}),_=new RE({read:S,...qo(l,t,p),destroy:ME(PE.bind(void 0,{subprocessStdout:u,subprocessStdin:l,subprocess:t,waitReadableDestroy:c,waitWritableFinal:p,waitWritableDestroy:d})),readableHighWaterMark:g,writableHighWaterMark:l.writableHighWaterMark,readableObjectMode:f,writableObjectMode:l.writableObjectMode,encoding:m});return Wo({subprocessStdout:u,onStdoutDataDone:E,readable:_,subprocess:t,subprocessStdin:l}),Yo(l,_,u),_},PE=async({subprocessStdout:t,subprocessStdin:e,subprocess:r,waitReadableDestroy:n,waitWritableFinal:o,waitWritableDestroy:s},i)=>{await Promise.all([Ho({subprocessStdout:t,subprocess:r,waitReadableDestroy:n},i),Ko({subprocessStdin:e,subprocess:r,waitWritableFinal:o,waitWritableDestroy:s},i)])};var Jo=(t,e,{from:r,binary:n=!1,preserveNewlines:o=!1}={})=>{let s=n||k.has(e),i=ve(t,r),a=$r({subprocessStdout:i,subprocess:t,binary:s,shouldEncode:!0,encoding:e,preserveNewlines:o});return kE(a,i,t)},kE=async function*(t,e,r){try{yield*t}finally{e.readable&&e.destroy(),await r}};var Ul=(t,{encoding:e})=>{let r=vl();t.readable=Ml.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.writable=Ll.bind(void 0,{subprocess:t,concurrentStreams:r}),t.duplex=Nl.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.iterable=Jo.bind(void 0,t,e),t[Symbol.asyncIterator]=Jo.bind(void 0,t,e,{})};var Vl=(t,e)=>{for(let[r,n]of jE){let o=n.value.bind(e);Reflect.defineProperty(t,r,{...n,value:o})}},LE=(async()=>{})().constructor.prototype,jE=["then","catch","finally"].map(t=>[t,Reflect.getOwnPropertyDescriptor(LE,t)]);var Gl=(t,e,r,n)=>{let{file:o,commandArguments:s,command:i,escapedCommand:a,startTime:u,verboseInfo:c,options:l,fileDescriptors:p}=VE(t,e,r),{subprocess:d,promise:m}=WE({file:o,commandArguments:s,options:l,startTime:u,verboseInfo:c,command:i,escapedCommand:a,fileDescriptors:p});return d.pipe=_r.bind(void 0,{source:d,sourcePromise:m,boundOptions:{},createNested:n}),Vl(d,m),K.set(d,{options:l,fileDescriptors:p}),d},VE=(t,e,r)=>{let{command:n,escapedCommand:o,startTime:s,verboseInfo:i}=Pt(t,e,r),{file:a,commandArguments:u,options:c}=nr(t,e,r),l=GE(c),p=el(l,i);return{file:a,commandArguments:u,command:n,escapedCommand:o,startTime:s,verboseInfo:i,options:l,fileDescriptors:p}},GE=({timeout:t,signal:e,...r})=>{if(e!==void 0)throw new TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...r,timeoutDuration:t}},WE=({file:t,commandArguments:e,options:r,startTime:n,verboseInfo:o,command:s,escapedCommand:i,fileDescriptors:a})=>{let u;try{u=UE(...or(t,e,r))}catch(f){return Jc({error:f,command:s,escapedCommand:i,fileDescriptors:a,options:r,startTime:n,verboseInfo:o})}let c=new AbortController;NE(Number.POSITIVE_INFINITY,c.signal);let l=[...u.stdio];cl(u,a,c),pl(u,r,c);let p={},d=Y();u.kill=xa.bind(void 0,{kill:u.kill.bind(u),options:r,onInternalError:d,context:p,controller:c}),u.all=xl(u,r),Ul(u,r),qc(u,r);let m=HE({subprocess:u,options:r,startTime:n,verboseInfo:o,fileDescriptors:a,originalStreams:l,command:s,escapedCommand:i,context:p,onInternalError:d,controller:c});return{subprocess:u,promise:m}},HE=async({subprocess:t,options:e,startTime:r,verboseInfo:n,fileDescriptors:o,originalStreams:s,command:i,escapedCommand:a,context:u,onInternalError:c,controller:l})=>{let[p,[d,m],f,g,S]=await Tl({subprocess:t,options:e,context:u,verboseInfo:n,fileDescriptors:o,originalStreams:s,onInternalError:c,controller:l});l.abort(),c.resolve();let E=f.map((y,F)=>re(y,e,F)),_=re(g,e,"all"),T=zE({errorInfo:p,exitCode:d,signal:m,stdio:E,all:_,ipcOutput:S,context:u,options:e,command:i,escapedCommand:a,startTime:r});return Pe(T,n,e)},zE=({errorInfo:t,exitCode:e,signal:r,stdio:n,all:o,ipcOutput:s,context:i,options:a,command:u,escapedCommand:c,startTime:l})=>"error"in t?ot({error:t.error,command:u,escapedCommand:c,timedOut:i.terminationReason==="timeout",isCanceled:i.terminationReason==="cancel"||i.terminationReason==="gracefulCancel",isGracefullyCanceled:i.terminationReason==="gracefulCancel",isMaxBuffer:t.error instanceof J,isForcefullyTerminated:i.isForcefullyTerminated,exitCode:e,signal:r,stdio:n,all:o,ipcOutput:s,options:a,startTime:l,isSync:!1}):Dr({command:u,escapedCommand:c,stdio:n,all:o,ipcOutput:s,options:a,startTime:l});var Ir=(t,e)=>{let r=Object.fromEntries(Object.entries(e).map(([n,o])=>[n,qE(n,t[n],o)]));return{...t,...r}},qE=(t,e,r)=>YE.has(t)&&O(e)&&O(r)?{...e,...r}:r,YE=new Set(["env",...xn]);var pe=(t,e,r,n)=>{let o=(i,a,u)=>pe(i,a,r,u),s=(...i)=>KE({mapArguments:t,deepOptions:r,boundOptions:e,setBoundExeca:n,createNested:o},...i);return n!==void 0&&n(s,o,e),s},KE=({mapArguments:t,deepOptions:e={},boundOptions:r={},setBoundExeca:n,createNested:o},s,...i)=>{if(O(s))return o(t,Ir(r,s),n);let{file:a,commandArguments:u,options:c,isSync:l}=JE({mapArguments:t,firstArgument:s,nextArguments:i,deepOptions:e,boundOptions:r});return l?Uc(a,u,c):Gl(a,u,c,o)},JE=({mapArguments:t,firstArgument:e,nextArguments:r,deepOptions:n,boundOptions:o})=>{let s=es(e)?ts(e,r):[e,...r],[i,a,u]=xt(...s),c=Ir(Ir(n,o),u),{file:l=i,commandArguments:p=a,options:d=c,isSync:m=!1}=t({file:i,commandArguments:a,options:c});return{file:l,commandArguments:p,options:d,isSync:m}};var Wl=({file:t,commandArguments:e})=>zl(t,e),Hl=({file:t,commandArguments:e})=>({...zl(t,e),isSync:!0}),zl=(t,e)=>{if(e.length>0)throw new TypeError(`The command and its arguments must be passed as a single string: ${t} ${e}.`);let[r,...n]=XE(t);return{file:r,commandArguments:n}},XE=t=>{if(typeof t!="string")throw new TypeError(`The command must be a string: ${String(t)}.`);let e=t.trim();if(e==="")return[];let r=[];for(let n of e.split(ZE)){let o=r.at(-1);o&&o.endsWith("\\")?r[r.length-1]=`${o.slice(0,-1)} ${n}`:r.push(n)}return r},ZE=/ +/g;var ql=(t,e,r)=>{t.sync=e(QE,r),t.s=t.sync},Yl=({options:t})=>Kl(t),QE=({options:t})=>({...Kl(t),isSync:!0}),Kl=t=>({options:{...ey(t),...t}}),ey=({input:t,inputFile:e,stdio:r})=>t===void 0&&e===void 0&&r===void 0?{stdin:"inherit"}:{},Jl={preferLocal:!0};var Ce=pe(()=>({})),H8=pe(()=>({isSync:!0})),Xl=pe(Wl),z8=pe(Hl),q8=pe(uu),Y8=pe(Yl,{},Jl,ql),{sendMessage:K8,getOneMessage:J8,getEachMessage:X8,getCancelSignal:Z8}=Yc();import ty from"crypto";function Zl(){let t=process.env.npm_config_user_agent??"";return t.startsWith("yarn")?"yarn":t.startsWith("pnpm")?"pnpm":"npm"}async function Ql(){try{return await Xl("docker info",{stdio:"ignore"}),!0}catch{return!1}}function ep(){return ty.randomBytes(64).toString("hex")}function tp(t){return t==="yarn"?"yarn":`${t} install`}function rp(t){return`services:
|
|
125
|
+
if (condition) { yield value; }`)};import{Buffer as gg}from"buffer";import{StringDecoder as bg}from"string_decoder";var br=(t,e,r)=>{if(r)return;if(t)return{transform:Eg.bind(void 0,new TextEncoder)};let n=new bg(e);return{transform:Cg.bind(void 0,n),final:yg.bind(void 0,n)}},Eg=function*(t,e){gg.isBuffer(e)?yield Q(e):typeof e=="string"?yield t.encode(e):yield e},Cg=function*(t,e){yield B(e)?t.write(e):e},yg=function*(t){let e=t.end();e!==""&&(yield e)};import{callbackify as xc}from"util";var mo=xc(async(t,e,r,n)=>{e.currentIterable=t(...r);try{for await(let o of e.currentIterable)n.push(o)}finally{delete e.currentIterable}}),Er=async function*(t,e,r){if(r===e.length){yield t;return}let{transform:n=Fg}=e[r];for await(let o of n(t))yield*Er(o,e,r+1)},Ac=async function*(t){for(let[e,{final:r}]of Object.entries(t))yield*Sg(r,Number(e),t)},Sg=async function*(t,e,r){if(t!==void 0)for await(let n of t())yield*Er(n,r,e+1)},Oc=xc(async({currentIterable:t},e)=>{if(t!==void 0){await(e?t.throw(e):t.return());return}if(e)throw e}),Fg=function*(t){yield t};var fo=(t,e,r,n)=>{try{for(let o of t(...e))r.push(o);n()}catch(o){n(o)}},$c=(t,e)=>[...e.flatMap(r=>[...ge(r,t,0)]),...rt(t)],ge=function*(t,e,r){if(r===e.length){yield t;return}let{transform:n=xg}=e[r];for(let o of n(t))yield*ge(o,e,r+1)},rt=function*(t){for(let[e,{final:r}]of Object.entries(t))yield*wg(r,Number(e),t)},wg=function*(t,e,r){if(t!==void 0)for(let n of t())yield*ge(n,r,e+1)},xg=function*(t){yield t};var ho=({value:t,value:{transform:e,final:r,writableObjectMode:n,readableObjectMode:o},optionName:s},{encoding:i})=>{let a={},u=Bc(t,i,s),c=he(e),l=he(r),p=c?mo.bind(void 0,Er,a):fo.bind(void 0,ge),D=c||l?mo.bind(void 0,Ac,a):fo.bind(void 0,rt),m=c||l?Oc.bind(void 0,a):void 0;return{stream:new Ag({writableObjectMode:n,writableHighWaterMark:_c(n),readableObjectMode:o,readableHighWaterMark:_c(o),transform(g,S,E){p([g,u,0],this,E)},flush(g){D([u],this,g)},destroy:m})}},Cr=(t,e,r,n)=>{let o=e.filter(({type:i})=>i==="generator"),s=n?o.reverse():o;for(let{value:i,optionName:a}of s){let u=Bc(i,r,a);t=$c(u,t)}return t},Bc=({transform:t,final:e,binary:r,writableObjectMode:n,readableObjectMode:o,preserveNewlines:s},i,a)=>{let u={};return[{transform:Sc(n,a)},br(r,i,n),gr(r,s,n,u),{transform:t,final:e},{transform:Fc(o,a)},yc({binary:r,preserveNewlines:s,readableObjectMode:o,state:u})].filter(Boolean)};var Tc=(t,e)=>{for(let r of Og(t))$g(t,r,e)},Og=t=>new Set(Object.entries(t).filter(([,{direction:e}])=>e==="input").map(([e])=>Number(e))),$g=(t,e,r)=>{let{stdioItems:n}=t[e],o=n.filter(({contents:a})=>a!==void 0);if(o.length===0)return;if(e!==0){let[{type:a,optionName:u}]=o;throw new TypeError(`Only the \`stdin\` option, not \`${u}\`, can be ${ce[a]} with synchronous methods.`)}let i=o.map(({contents:a})=>a).map(a=>_g(a,n));r.input=ze(i)},_g=(t,e)=>{let r=Cr(t,e,"utf8",!0);return Bg(r),ze(r)},Bg=t=>{let e=t.find(r=>typeof r!="string"&&!B(r));if(e!==void 0)throw new TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${e}.`)};import{writeFileSync as Rg,appendFileSync as Mg}from"fs";var yr=({stdioItems:t,encoding:e,verboseInfo:r,fdNumber:n})=>n!=="all"&&Ae(r,n)&&!P.has(e)&&Tg(n)&&(t.some(({type:o,value:s})=>o==="native"&&vg.has(s))||t.every(({type:o})=>j.has(o))),Tg=t=>t===1||t===2,vg=new Set(["pipe","overlapped"]),vc=async(t,e,r,n)=>{for await(let o of t)Ig(e)||Rc(o,r,n)},Ic=(t,e,r)=>{for(let n of t)Rc(n,e,r)},Ig=t=>t._readableState.pipes.length>0,Rc=(t,e,r)=>{let n=It(t);q({type:"output",verboseMessage:n,fdNumber:e,verboseInfo:r})};var Mc=({fileDescriptors:t,syncResult:{output:e},options:r,isMaxBuffer:n,verboseInfo:o})=>{if(e===null)return{output:Array.from({length:3})};let s={},i=new Set([]);return{output:e.map((u,c)=>Pg({result:u,fileDescriptors:t,fdNumber:c,state:s,outputFiles:i,isMaxBuffer:n,verboseInfo:o},r)),...s}},Pg=({result:t,fileDescriptors:e,fdNumber:r,state:n,outputFiles:o,isMaxBuffer:s,verboseInfo:i},{buffer:a,encoding:u,lines:c,stripFinalNewline:l,maxBuffer:p})=>{if(t===null)return;let D=Pu(t,s,p),m=Q(D),{stdioItems:f,objectMode:g}=e[r],S=kg([m],f,u,n),{serializedResult:E,finalResult:$=E}=Lg({chunks:S,objectMode:g,encoding:u,lines:c,stripFinalNewline:l,fdNumber:r});jg({serializedResult:E,fdNumber:r,state:n,verboseInfo:i,encoding:u,stdioItems:f,objectMode:g});let T=a[r]?$:void 0;try{return n.error===void 0&&Ng(E,f,o),T}catch(C){return n.error=C,T}},kg=(t,e,r,n)=>{try{return Cr(t,e,r,!1)}catch(o){return n.error=o,t}},Lg=({chunks:t,objectMode:e,encoding:r,lines:n,stripFinalNewline:o,fdNumber:s})=>{if(e)return{serializedResult:t};if(r==="buffer")return{serializedResult:ze(t)};let i=Ji(t,r);return n[s]?{serializedResult:i,finalResult:Do(i,!o[s],e)}:{serializedResult:i}},jg=({serializedResult:t,fdNumber:e,state:r,verboseInfo:n,encoding:o,stdioItems:s,objectMode:i})=>{if(!yr({stdioItems:s,encoding:o,verboseInfo:n,fdNumber:e}))return;let a=Do(t,!1,i);try{Ic(a,e,n)}catch(u){r.error??=u}},Ng=(t,e,r)=>{for(let{path:n,append:o}of e.filter(({type:s})=>fr.has(s))){let s=typeof n=="string"?n:n.toString();o||r.has(s)?Mg(n,t):(r.add(s),Rg(n,t))}};var Pc=([,t,e],r)=>{if(r.all)return t===void 0?e:e===void 0?t:Array.isArray(t)?Array.isArray(e)?[...t,...e]:[...t,re(e,r,"all")]:Array.isArray(e)?[re(t,r,"all"),...e]:B(t)&&B(e)?yn([t,e]):`${t}${e}`};import{once as go}from"events";var kc=async(t,e)=>{let[r,n]=await Ug(t);return e.isForcefullyTerminated??=!1,[r,n]},Ug=async t=>{let[e,r]=await Promise.allSettled([go(t,"spawn"),go(t,"exit")]);return e.status==="rejected"?[]:r.status==="rejected"?Lc(t):r.value},Lc=async t=>{try{return await go(t,"exit")}catch{return Lc(t)}},jc=async t=>{let[e,r]=await t;if(!Vg(e,r)&&bo(e,r))throw new G;return[e,r]},Vg=(t,e)=>t===void 0&&e===void 0,bo=(t,e)=>t!==0||e!==null;var Nc=({error:t,status:e,signal:r,output:n},{maxBuffer:o})=>{let s=Gg(t,e,r),i=s?.code==="ETIMEDOUT",a=Mu(s,n,o);return{resultError:s,exitCode:e,signal:r,timedOut:i,isMaxBuffer:a}},Gg=(t,e,r)=>t!==void 0?t:bo(e,r)?new G:void 0;var Uc=(t,e,r)=>{let{file:n,commandArguments:o,command:s,escapedCommand:i,startTime:a,verboseInfo:u,options:c,fileDescriptors:l}=Hg(t,e,r),p=Yg({file:n,commandArguments:o,options:c,command:s,escapedCommand:i,verboseInfo:u,fileDescriptors:l,startTime:a});return Me(p,u,c)},Hg=(t,e,r)=>{let{command:n,escapedCommand:o,startTime:s,verboseInfo:i}=Mt(t,e,r),a=zg(r),{file:u,commandArguments:c,options:l}=rr(t,e,a);qg(l);let p=gc(l,i);return{file:u,commandArguments:c,command:n,escapedCommand:o,startTime:s,verboseInfo:i,options:l,fileDescriptors:p}},zg=t=>t.node&&!t.ipc?{...t,ipc:!1}:t,qg=({ipc:t,ipcInput:e,detached:r,cancelSignal:n})=>{e&&Sr("ipcInput"),t&&Sr("ipc: true"),r&&Sr("detached: true"),n&&Sr("cancelSignal")},Sr=t=>{throw new TypeError(`The "${t}" option cannot be used with synchronous methods.`)},Yg=({file:t,commandArguments:e,options:r,command:n,escapedCommand:o,verboseInfo:s,fileDescriptors:i,startTime:a})=>{let u=Kg({file:t,commandArguments:e,options:r,command:n,escapedCommand:o,fileDescriptors:i,startTime:a});if(u.failed)return u;let{resultError:c,exitCode:l,signal:p,timedOut:D,isMaxBuffer:m}=Nc(u,r),{output:f,error:g=c}=Mc({fileDescriptors:i,syncResult:u,options:r,isMaxBuffer:m,verboseInfo:s}),S=f.map(($,T)=>re($,r,T)),E=re(Pc(f,r),r,"all");return Xg({error:g,exitCode:l,signal:p,timedOut:D,isMaxBuffer:m,stdio:S,all:E,options:r,command:n,escapedCommand:o,startTime:a})},Kg=({file:t,commandArguments:e,options:r,command:n,escapedCommand:o,fileDescriptors:s,startTime:i})=>{try{Tc(s,r);let a=Jg(r);return Wg(...nr(t,e,a))}catch(a){return Re({error:a,command:n,escapedCommand:o,fileDescriptors:s,options:r,startTime:i,isSync:!0})}},Jg=({encoding:t,maxBuffer:e,...r})=>({...r,encoding:"buffer",maxBuffer:pr(e)}),Xg=({error:t,exitCode:e,signal:r,timedOut:n,isMaxBuffer:o,stdio:s,all:i,options:a,command:u,escapedCommand:c,startTime:l})=>t===void 0?Dr({command:u,escapedCommand:c,stdio:s,all:i,ipcOutput:[],options:a,startTime:l}):tt({error:t,command:u,escapedCommand:c,timedOut:n,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:o,isForcefullyTerminated:!1,exitCode:e,signal:r,stdio:s,all:i,ipcOutput:[],options:a,startTime:l,isSync:!0});import{setMaxListeners as LE}from"events";import{spawn as jE}from"child_process";import zc from"process";import{once as Eo,on as Zg}from"events";var Vc=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},{reference:o=!0,filter:s}={})=>(_e({methodName:"getOneMessage",isSubprocess:r,ipc:n,isConnected:Jt(t)}),Qg({anyProcess:t,channel:e,isSubprocess:r,filter:s,reference:o})),Qg=async({anyProcess:t,channel:e,isSubprocess:r,filter:n,reference:o})=>{zt(e,o);let s=ue(t,e,r),i=new AbortController;try{return await Promise.race([eb(s,n,i),tb(s,r,i),rb(s,r,i)])}catch(a){throw Be(t),a}finally{i.abort(),qt(e,o)}},eb=async(t,e,{signal:r})=>{if(e===void 0){let[n]=await Eo(t,"message",{signal:r});return n}for await(let[n]of Zg(t,"message",{signal:r}))if(e(n))return n},tb=async(t,e,{signal:r})=>{await Eo(t,"disconnect",{signal:r}),$a(e)},rb=async(t,e,{signal:r})=>{let[n]=await Eo(t,"strict:error",{signal:r});throw Gt(n,e)};import{once as Wc,on as nb}from"events";var Hc=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},{reference:o=!0}={})=>Co({anyProcess:t,channel:e,isSubprocess:r,ipc:n,shouldAwait:!r,reference:o}),Co=({anyProcess:t,channel:e,isSubprocess:r,ipc:n,shouldAwait:o,reference:s})=>{_e({methodName:"getEachMessage",isSubprocess:r,ipc:n,isConnected:Jt(t)}),zt(e,s);let i=ue(t,e,r),a=new AbortController,u={};return ob(t,i,a),ib({ipcEmitter:i,isSubprocess:r,controller:a,state:u}),sb({anyProcess:t,channel:e,ipcEmitter:i,isSubprocess:r,shouldAwait:o,controller:a,state:u,reference:s})},ob=async(t,e,r)=>{try{await Wc(e,"disconnect",{signal:r.signal}),r.abort()}catch{}},ib=async({ipcEmitter:t,isSubprocess:e,controller:r,state:n})=>{try{let[o]=await Wc(t,"strict:error",{signal:r.signal});n.error=Gt(o,e),r.abort()}catch{}},sb=async function*({anyProcess:t,channel:e,ipcEmitter:r,isSubprocess:n,shouldAwait:o,controller:s,state:i,reference:a}){try{for await(let[u]of nb(r,"message",{signal:s.signal}))Gc(i),yield u}catch{Gc(i)}finally{s.abort(),qt(e,a),n||Be(t),o&&await t}},Gc=({error:t})=>{if(t)throw t};var qc=(t,{ipc:e})=>{Object.assign(t,Kc(t,!1,e))},Yc=()=>{let t=zc,e=!0,r=zc.channel!==void 0;return{...Kc(t,e,r),getCancelSignal:tu.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})}},Kc=(t,e,r)=>({sendMessage:er.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getOneMessage:Vc.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getEachMessage:Hc.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})});import{ChildProcess as ab}from"child_process";import{PassThrough as ub,Readable as cb,Writable as lb,Duplex as pb}from"stream";var Jc=({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:o,startTime:s,verboseInfo:i})=>{co(n);let a=new ab;Db(a,n),Object.assign(a,{readable:db,writable:mb,duplex:fb});let u=Re({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:o,startTime:s,isSync:!1}),c=hb(u,i,o);return{subprocess:a,promise:c}},Db=(t,e)=>{let r=nt(),n=nt(),o=nt(),s=Array.from({length:e.length-3},nt),i=nt(),a=[r,n,o,...s];Object.assign(t,{stdin:r,stdout:n,stderr:o,all:i,stdio:a})},nt=()=>{let t=new ub;return t.end(),t},db=()=>new cb({read(){}}),mb=()=>new lb({write(){}}),fb=()=>new pb({read(){},write(){}}),hb=async(t,e,r)=>Me(t,e,r);import{createReadStream as Xc,createWriteStream as Zc}from"fs";import{Buffer as gb}from"buffer";import{Readable as ot,Writable as bb,Duplex as Eb}from"stream";var el=(t,e)=>hr(Cb,t,e,!1),it=({type:t,optionName:e})=>{throw new TypeError(`The \`${e}\` option cannot be ${ce[t]}.`)},Qc={fileNumber:it,generator:ho,asyncGenerator:ho,nodeStream:({value:t})=>({stream:t}),webTransform({value:{transform:t,writableObjectMode:e,readableObjectMode:r}}){let n=e||r;return{stream:Eb.fromWeb(t,{objectMode:n})}},duplex:({value:{transform:t}})=>({stream:t}),native(){}},Cb={input:{...Qc,fileUrl:({value:t})=>({stream:Xc(t)}),filePath:({value:{file:t}})=>({stream:Xc(t)}),webStream:({value:t})=>({stream:ot.fromWeb(t)}),iterable:({value:t})=>({stream:ot.from(t)}),asyncIterable:({value:t})=>({stream:ot.from(t)}),string:({value:t})=>({stream:ot.from(t)}),uint8Array:({value:t})=>({stream:ot.from(gb.from(t))})},output:{...Qc,fileUrl:({value:t})=>({stream:Zc(t)}),filePath:({value:{file:t,append:e}})=>({stream:Zc(t,e?{flags:"a"}:{})}),webStream:({value:t})=>({stream:bb.fromWeb(t)}),iterable:it,asyncIterable:it,string:it,uint8Array:it}};import{on as yb,once as tl}from"events";import{PassThrough as Sb,getDefaultHighWaterMark as Fb}from"stream";import{finished as ol}from"stream/promises";function be(t){if(!Array.isArray(t))throw new TypeError(`Expected an array, got \`${typeof t}\`.`);for(let o of t)So(o);let e=t.some(({readableObjectMode:o})=>o),r=wb(t,e),n=new yo({objectMode:e,writableHighWaterMark:r,readableHighWaterMark:r});for(let o of t)n.add(o);return n}var wb=(t,e)=>{if(t.length===0)return Fb(e);let r=t.filter(({readableObjectMode:n})=>n===e).map(({readableHighWaterMark:n})=>n);return Math.max(...r)},yo=class extends Sb{#t=new Set([]);#r=new Set([]);#e=new Set([]);#n;#i=Symbol("unpipe");#o=new WeakMap;add(e){if(So(e),this.#t.has(e))return;this.#t.add(e),this.#n??=xb(this,this.#t,this.#i);let r=$b({passThroughStream:this,stream:e,streams:this.#t,ended:this.#r,aborted:this.#e,onFinished:this.#n,unpipeEvent:this.#i});this.#o.set(e,r),e.pipe(this,{end:!1})}async remove(e){if(So(e),!this.#t.has(e))return!1;let r=this.#o.get(e);return r===void 0?!1:(this.#o.delete(e),e.unpipe(this),await r,!0)}},xb=async(t,e,r)=>{Fr(t,rl);let n=new AbortController;try{await Promise.race([Ab(t,n),Ob(t,e,r,n)])}finally{n.abort(),Fr(t,-rl)}},Ab=async(t,{signal:e})=>{try{await ol(t,{signal:e,cleanup:!0})}catch(r){throw il(t,r),r}},Ob=async(t,e,r,{signal:n})=>{for await(let[o]of yb(t,"unpipe",{signal:n}))e.has(o)&&o.emit(r)},So=t=>{if(typeof t?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof t}\`.`)},$b=async({passThroughStream:t,stream:e,streams:r,ended:n,aborted:o,onFinished:s,unpipeEvent:i})=>{Fr(t,nl);let a=new AbortController;try{await Promise.race([_b(s,e,a),Bb({passThroughStream:t,stream:e,streams:r,ended:n,aborted:o,controller:a}),Tb({stream:e,streams:r,ended:n,aborted:o,unpipeEvent:i,controller:a})])}finally{a.abort(),Fr(t,-nl)}r.size>0&&r.size===n.size+o.size&&(n.size===0&&o.size>0?Fo(t):vb(t))},_b=async(t,e,{signal:r})=>{try{await t,r.aborted||Fo(e)}catch(n){r.aborted||il(e,n)}},Bb=async({passThroughStream:t,stream:e,streams:r,ended:n,aborted:o,controller:{signal:s}})=>{try{await ol(e,{signal:s,cleanup:!0,readable:!0,writable:!1}),r.has(e)&&n.add(e)}catch(i){if(s.aborted||!r.has(e))return;sl(i)?o.add(e):al(t,i)}},Tb=async({stream:t,streams:e,ended:r,aborted:n,unpipeEvent:o,controller:{signal:s}})=>{if(await tl(t,o,{signal:s}),!t.readable)return tl(s,"abort",{signal:s});e.delete(t),r.delete(t),n.delete(t)},vb=t=>{t.writable&&t.end()},il=(t,e)=>{sl(e)?Fo(t):al(t,e)},sl=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",Fo=t=>{(t.readable||t.writable)&&t.destroy()},al=(t,e)=>{t.destroyed||(t.once("error",Ib),t.destroy(e))},Ib=()=>{},Fr=(t,e)=>{let r=t.getMaxListeners();r!==0&&r!==Number.POSITIVE_INFINITY&&t.setMaxListeners(r+e)},rl=2,nl=1;import{finished as ul}from"stream/promises";var ke=(t,e)=>{t.pipe(e),Rb(t,e),Mb(t,e)},Rb=async(t,e)=>{if(!(V(t)||V(e))){try{await ul(t,{cleanup:!0,readable:!0,writable:!1})}catch{}wo(e)}},wo=t=>{t.writable&&t.end()},Mb=async(t,e)=>{if(!(V(t)||V(e))){try{await ul(e,{cleanup:!0,readable:!1,writable:!0})}catch{}xo(t)}},xo=t=>{t.readable&&t.destroy()};var cl=(t,e,r)=>{let n=new Map;for(let[o,{stdioItems:s,direction:i}]of Object.entries(e)){for(let{stream:a}of s.filter(({type:u})=>j.has(u)))Pb(t,a,i,o);for(let{stream:a}of s.filter(({type:u})=>!j.has(u)))Lb({subprocess:t,stream:a,direction:i,fdNumber:o,pipeGroups:n,controller:r})}for(let[o,s]of n.entries()){let i=s.length===1?s[0]:be(s);ke(i,o)}},Pb=(t,e,r,n)=>{r==="output"?ke(t.stdio[n],e):ke(e,t.stdio[n]);let o=kb[n];o!==void 0&&(t[o]=e),t.stdio[n]=e},kb=["stdin","stdout","stderr"],Lb=({subprocess:t,stream:e,direction:r,fdNumber:n,pipeGroups:o,controller:s})=>{if(e===void 0)return;jb(e,s);let[i,a]=r==="output"?[e,t.stdio[n]]:[t.stdio[n],e],u=o.get(i)??[];o.set(i,[...u,a])},jb=(t,{signal:e})=>{V(t)&&me(t,Nb,e)},Nb=2;import{addAbortListener as Gb}from"events";var Ee=[];Ee.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&Ee.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&Ee.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var wr=t=>!!t&&typeof t=="object"&&typeof t.removeListener=="function"&&typeof t.emit=="function"&&typeof t.reallyExit=="function"&&typeof t.listeners=="function"&&typeof t.kill=="function"&&typeof t.pid=="number"&&typeof t.on=="function",Ao=Symbol.for("signal-exit emitter"),Oo=globalThis,Ub=Object.defineProperty.bind(Object),$o=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(Oo[Ao])return Oo[Ao];Ub(Oo,Ao,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,r){this.listeners[e].push(r)}removeListener(e,r){let n=this.listeners[e],o=n.indexOf(r);o!==-1&&(o===0&&n.length===1?n.length=0:n.splice(o,1))}emit(e,r,n){if(this.emitted[e])return!1;this.emitted[e]=!0;let o=!1;for(let s of this.listeners[e])o=s(r,n)===!0||o;return e==="exit"&&(o=this.emit("afterExit",r,n)||o),o}},xr=class{},Vb=t=>({onExit(e,r){return t.onExit(e,r)},load(){return t.load()},unload(){return t.unload()}}),_o=class extends xr{onExit(){return()=>{}}load(){}unload(){}},Bo=class extends xr{#t=To.platform==="win32"?"SIGINT":"SIGHUP";#r=new $o;#e;#n;#i;#o={};#s=!1;constructor(e){super(),this.#e=e,this.#o={};for(let r of Ee)this.#o[r]=()=>{let n=this.#e.listeners(r),{count:o}=this.#r,s=e;if(typeof s.__signal_exit_emitter__=="object"&&typeof s.__signal_exit_emitter__.count=="number"&&(o+=s.__signal_exit_emitter__.count),n.length===o){this.unload();let i=this.#r.emit("exit",null,r),a=r==="SIGHUP"?this.#t:r;i||e.kill(e.pid,a)}};this.#i=e.reallyExit,this.#n=e.emit}onExit(e,r){if(!wr(this.#e))return()=>{};this.#s===!1&&this.load();let n=r?.alwaysLast?"afterExit":"exit";return this.#r.on(n,e),()=>{this.#r.removeListener(n,e),this.#r.listeners.exit.length===0&&this.#r.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#s){this.#s=!0,this.#r.count+=1;for(let e of Ee)try{let r=this.#o[e];r&&this.#e.on(e,r)}catch{}this.#e.emit=(e,...r)=>this.#u(e,...r),this.#e.reallyExit=e=>this.#a(e)}}unload(){this.#s&&(this.#s=!1,Ee.forEach(e=>{let r=this.#o[e];if(!r)throw new Error("Listener not defined for signal: "+e);try{this.#e.removeListener(e,r)}catch{}}),this.#e.emit=this.#n,this.#e.reallyExit=this.#i,this.#r.count-=1)}#a(e){return wr(this.#e)?(this.#e.exitCode=e||0,this.#r.emit("exit",this.#e.exitCode,null),this.#i.call(this.#e,this.#e.exitCode)):0}#u(e,...r){let n=this.#n;if(e==="exit"&&wr(this.#e)){typeof r[0]=="number"&&(this.#e.exitCode=r[0]);let o=n.call(this.#e,e,...r);return this.#r.emit("exit",this.#e.exitCode,null),o}else return n.call(this.#e,e,...r)}},To=globalThis.process,{onExit:ll,load:J3,unload:X3}=Vb(wr(To)?new Bo(To):new _o);var pl=(t,{cleanup:e,detached:r},{signal:n})=>{if(!e||r)return;let o=ll(()=>{t.kill()});Gb(n,()=>{o()})};var dl=({source:t,sourcePromise:e,boundOptions:r,createNested:n},...o)=>{let s=Rt(),{destination:i,destinationStream:a,destinationError:u,from:c,unpipeSignal:l}=Wb(r,n,o),{sourceStream:p,sourceError:D}=zb(t,c),{options:m,fileDescriptors:f}=K.get(t);return{sourcePromise:e,sourceStream:p,sourceOptions:m,sourceError:D,destination:i,destinationStream:a,destinationError:u,unpipeSignal:l,fileDescriptors:f,startTime:s}},Wb=(t,e,r)=>{try{let{destination:n,pipeOptions:{from:o,to:s,unpipeSignal:i}={}}=Hb(t,e,...r),a=Ht(n,s);return{destination:n,destinationStream:a,from:o,unpipeSignal:i}}catch(n){return{destinationError:n}}},Hb=(t,e,r,...n)=>{if(Array.isArray(r))return{destination:e(Dl,t)(r,...n),pipeOptions:t};if(typeof r=="string"||r instanceof URL||En(r)){if(Object.keys(t).length>0)throw new TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');let[o,s,i]=wt(r,...n);return{destination:e(Dl)(o,s,i),pipeOptions:i}}if(K.has(r)){if(Object.keys(t).length>0)throw new TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:r,pipeOptions:n[0]}}throw new TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${r}`)},Dl=({options:t})=>({options:{...t,stdin:"pipe",piped:!0}}),zb=(t,e)=>{try{return{sourceStream:Te(t,e)}}catch(r){return{sourceError:r}}};var fl=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n,fileDescriptors:o,sourceOptions:s,startTime:i})=>{let a=qb({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n});if(a!==void 0)throw vo({error:a,fileDescriptors:o,sourceOptions:s,startTime:i})},qb=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n})=>{if(e!==void 0&&n!==void 0)return n;if(n!==void 0)return xo(t),n;if(e!==void 0)return wo(r),e},vo=({error:t,fileDescriptors:e,sourceOptions:r,startTime:n})=>Re({error:t,command:ml,escapedCommand:ml,fileDescriptors:e,options:r,startTime:n,isSync:!1}),ml="source.pipe(destination)";var hl=async t=>{let[{status:e,reason:r,value:n=r},{status:o,reason:s,value:i=s}]=await t;if(i.pipedFrom.includes(n)||i.pipedFrom.push(n),o==="rejected")throw i;if(e==="rejected")throw n;return i};import{finished as Yb}from"stream/promises";var gl=(t,e,r)=>{let n=Ar.has(e)?Jb(t,e):Kb(t,e);return me(t,Zb,r.signal),me(e,Qb,r.signal),Xb(e),n},Kb=(t,e)=>{let r=be([t]);return ke(r,e),Ar.set(e,r),r},Jb=(t,e)=>{let r=Ar.get(e);return r.add(t),r},Xb=async t=>{try{await Yb(t,{cleanup:!0,readable:!1,writable:!0})}catch{}Ar.delete(t)},Ar=new WeakMap,Zb=2,Qb=1;import{aborted as eE}from"util";var bl=(t,e)=>t===void 0?[]:[tE(t,e)],tE=async(t,{sourceStream:e,mergedStream:r,fileDescriptors:n,sourceOptions:o,startTime:s})=>{await eE(t,e),await r.remove(e);let i=new Error("Pipe canceled by `unpipeSignal` option.");throw vo({error:i,fileDescriptors:n,sourceOptions:o,startTime:s})};var Or=(t,...e)=>{if(O(e[0]))return Or.bind(void 0,{...t,boundOptions:{...t.boundOptions,...e[0]}});let{destination:r,...n}=dl(t,...e),o=rE({...n,destination:r});return o.pipe=Or.bind(void 0,{...t,source:r,sourcePromise:o,boundOptions:{}}),o},rE=async({sourcePromise:t,sourceStream:e,sourceOptions:r,sourceError:n,destination:o,destinationStream:s,destinationError:i,unpipeSignal:a,fileDescriptors:u,startTime:c})=>{let l=nE(t,o);fl({sourceStream:e,sourceError:n,destinationStream:s,destinationError:i,fileDescriptors:u,sourceOptions:r,startTime:c});let p=new AbortController;try{let D=gl(e,s,p);return await Promise.race([hl(l),...bl(a,{sourceStream:e,mergedStream:D,sourceOptions:r,fileDescriptors:u,startTime:c})])}finally{p.abort()}},nE=(t,e)=>Promise.allSettled([t,e]);import{setImmediate as lE}from"timers/promises";import{on as oE}from"events";import{getDefaultHighWaterMark as iE}from"stream";var $r=({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:n,encoding:o,preserveNewlines:s})=>{let i=new AbortController;return sE(e,i),Cl({stream:t,controller:i,binary:r,shouldEncode:!t.readableObjectMode&&n,encoding:o,shouldSplit:!t.readableObjectMode,preserveNewlines:s})},sE=async(t,e)=>{try{await t}catch{}finally{e.abort()}},Io=({stream:t,onStreamEnd:e,lines:r,encoding:n,stripFinalNewline:o,allMixed:s})=>{let i=new AbortController;aE(e,i,t);let a=t.readableObjectMode&&!s;return Cl({stream:t,controller:i,binary:n==="buffer",shouldEncode:!a,encoding:n,shouldSplit:!a&&r,preserveNewlines:!o})},aE=async(t,e,r)=>{try{await t}catch{r.destroy()}finally{e.abort()}},Cl=({stream:t,controller:e,binary:r,shouldEncode:n,encoding:o,shouldSplit:s,preserveNewlines:i})=>{let a=oE(t,"data",{signal:e.signal,highWaterMark:El,highWatermark:El});return uE({onStdoutChunk:a,controller:e,binary:r,shouldEncode:n,encoding:o,shouldSplit:s,preserveNewlines:i})},Ro=iE(!0),El=Ro,uE=async function*({onStdoutChunk:t,controller:e,binary:r,shouldEncode:n,encoding:o,shouldSplit:s,preserveNewlines:i}){let a=cE({binary:r,shouldEncode:n,encoding:o,shouldSplit:s,preserveNewlines:i});try{for await(let[u]of t)yield*ge(u,a,0)}catch(u){if(!e.signal.aborted)throw u}finally{yield*rt(a)}},cE=({binary:t,shouldEncode:e,encoding:r,shouldSplit:n,preserveNewlines:o})=>[br(t,r,!e),gr(t,o,!n,{})].filter(Boolean);var yl=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,buffer:o,maxBuffer:s,lines:i,allMixed:a,stripFinalNewline:u,verboseInfo:c,streamInfo:l})=>{let p=pE({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,allMixed:a,verboseInfo:c,streamInfo:l});if(!o){await Promise.all([DE(t),p]);return}let D=lo(u,r),m=Io({stream:t,onStreamEnd:e,lines:i,encoding:n,stripFinalNewline:D,allMixed:a}),[f]=await Promise.all([dE({stream:t,iterable:m,fdNumber:r,encoding:n,maxBuffer:s,lines:i}),p]);return f},pE=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,allMixed:o,verboseInfo:s,streamInfo:{fileDescriptors:i}})=>{if(!yr({stdioItems:i[r]?.stdioItems,encoding:n,verboseInfo:s,fdNumber:r}))return;let a=Io({stream:t,onStreamEnd:e,lines:!0,encoding:n,stripFinalNewline:!0,allMixed:o});await vc(a,t,r,s)},DE=async t=>{await lE(),t.readableFlowing===null&&t.resume()},dE=async({stream:t,stream:{readableObjectMode:e},iterable:r,fdNumber:n,encoding:o,maxBuffer:s,lines:i})=>{try{return e||i?await ar(r,{maxBuffer:s}):o==="buffer"?new Uint8Array(await ur(r,{maxBuffer:s})):await lr(r,{maxBuffer:s})}catch(a){return Sl(vu({error:a,stream:t,readableObjectMode:e,lines:i,encoding:o,fdNumber:n}))}},Mo=async t=>{try{return await t}catch(e){return Sl(e)}},Sl=({bufferedData:t})=>Yi(t)?new Uint8Array(t):t;import{finished as mE}from"stream/promises";var st=async(t,e,r,{isSameDirection:n,stopOnExit:o=!1}={})=>{let s=fE(t,r),i=new AbortController;try{await Promise.race([...o?[r.exitPromise]:[],mE(t,{cleanup:!0,signal:i.signal})])}catch(a){s.stdinCleanedUp||bE(a,e,r,n)}finally{i.abort()}},fE=(t,{originalStreams:[e],subprocess:r})=>{let n={stdinCleanedUp:!1};return t===e&&hE(t,r,n),n},hE=(t,e,r)=>{let{_destroy:n}=t;t._destroy=(...o)=>{gE(e,r),n.call(t,...o)}},gE=({exitCode:t,signalCode:e},r)=>{(t!==null||e!==null)&&(r.stdinCleanedUp=!0)},bE=(t,e,r,n)=>{if(!EE(t,e,r,n))throw t},EE=(t,e,r,n=!0)=>r.propagating?Fl(t)||_r(t):(r.propagating=!0,Po(r,e)===n?Fl(t):_r(t)),Po=({fileDescriptors:t},e)=>e!=="all"&&t[e].direction==="input",_r=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",Fl=t=>t?.code==="EPIPE";var wl=({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:o,stripFinalNewline:s,verboseInfo:i,streamInfo:a})=>t.stdio.map((u,c)=>ko({stream:u,fdNumber:c,encoding:e,buffer:r[c],maxBuffer:n[c],lines:o[c],allMixed:!1,stripFinalNewline:s,verboseInfo:i,streamInfo:a})),ko=async({stream:t,fdNumber:e,encoding:r,buffer:n,maxBuffer:o,lines:s,allMixed:i,stripFinalNewline:a,verboseInfo:u,streamInfo:c})=>{if(!t)return;let l=st(t,e,c);if(Po(c,e)){await l;return}let[p]=await Promise.all([yl({stream:t,onStreamEnd:l,fdNumber:e,encoding:r,buffer:n,maxBuffer:o,lines:s,allMixed:i,stripFinalNewline:a,verboseInfo:u,streamInfo:c}),l]);return p};var xl=({stdout:t,stderr:e},{all:r})=>r&&(t||e)?be([t,e].filter(Boolean)):void 0,Al=({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:o,stripFinalNewline:s,verboseInfo:i,streamInfo:a})=>ko({...CE(t,r),fdNumber:"all",encoding:e,maxBuffer:n[1]+n[2],lines:o[1]||o[2],allMixed:yE(t),stripFinalNewline:s,verboseInfo:i,streamInfo:a}),CE=({stdout:t,stderr:e,all:r},[,n,o])=>{let s=n||o;return s?n?o?{stream:r,buffer:s}:{stream:t,buffer:s}:{stream:e,buffer:s}:{stream:r,buffer:s}},yE=({all:t,stdout:e,stderr:r})=>t&&e&&r&&e.readableObjectMode!==r.readableObjectMode;import{once as SE}from"events";var Ol=t=>Ae(t,"ipc"),$l=(t,e)=>{let r=It(t);q({type:"ipc",verboseMessage:r,fdNumber:"ipc",verboseInfo:e})};var _l=async({subprocess:t,buffer:e,maxBuffer:r,ipc:n,ipcOutput:o,verboseInfo:s})=>{if(!n)return o;let i=Ol(s),a=ee(e,"ipc"),u=ee(r,"ipc");for await(let c of Co({anyProcess:t,channel:t.channel,isSubprocess:!1,ipc:n,shouldAwait:!1,reference:!0}))a&&(Iu(t,o,u),o.push(c)),i&&$l(c,s);return o},Bl=async(t,e)=>(await Promise.allSettled([t]),e);var Tl=async({subprocess:t,options:{encoding:e,buffer:r,maxBuffer:n,lines:o,timeoutDuration:s,cancelSignal:i,gracefulCancel:a,forceKillAfterDelay:u,stripFinalNewline:c,ipc:l,ipcInput:p},context:D,verboseInfo:m,fileDescriptors:f,originalStreams:g,onInternalError:S,controller:E})=>{let $=kc(t,D),T={originalStreams:g,fileDescriptors:f,subprocess:t,exitPromise:$,propagating:!1},C=wl({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:o,stripFinalNewline:c,verboseInfo:m,streamInfo:T}),w=Al({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:o,stripFinalNewline:c,verboseInfo:m,streamInfo:T}),_=[],I=_l({subprocess:t,buffer:r,maxBuffer:n,ipc:l,ipcOutput:_,verboseInfo:m}),ne=FE(g,t,T),oe=wE(f,T);try{return await Promise.race([Promise.all([{},jc($),Promise.all(C),w,I,pu(t,p),...ne,...oe]),S,xE(t,E),...su(t,s,D,E),...Oa({subprocess:t,cancelSignal:i,gracefulCancel:a,context:D,controller:E}),...ou({subprocess:t,cancelSignal:i,gracefulCancel:a,forceKillAfterDelay:u,context:D,controller:E})])}catch(kr){return D.terminationReason??="other",Promise.all([{error:kr},$,Promise.all(C.map(Ne=>Mo(Ne))),Mo(w),Bl(I,_),Promise.allSettled(ne),Promise.allSettled(oe)])}},FE=(t,e,r)=>t.map((n,o)=>n===e.stdio[o]?void 0:st(n,o,r)),wE=(t,e)=>t.flatMap(({stdioItems:r},n)=>r.filter(({value:o,stream:s=o})=>H(s,{checkOpen:!1})&&!V(s)).map(({type:o,value:s,stream:i=s})=>st(i,n,e,{isSameDirection:j.has(o),stopOnExit:o==="native"}))),xE=async(t,{signal:e})=>{let[r]=await SE(t,"error",{signal:e});throw r};var vl=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),at=(t,e,r)=>{let n=t[r];n.has(e)||n.set(e,[]);let o=n.get(e),s=Y();return o.push(s),{resolve:s.resolve.bind(s),promises:o}},Le=async({resolve:t,promises:e},r)=>{t();let[n]=await Promise.race([Promise.allSettled([!0,r]),Promise.all([!1,...e])]);return!n};import{Readable as AE}from"stream";import{callbackify as OE}from"util";import{finished as Il}from"stream/promises";var Lo=async t=>{if(t!==void 0)try{await jo(t)}catch{}},Rl=async t=>{if(t!==void 0)try{await No(t)}catch{}},jo=async t=>{await Il(t,{cleanup:!0,readable:!1,writable:!0})},No=async t=>{await Il(t,{cleanup:!0,readable:!0,writable:!1})},Br=async(t,e)=>{if(await t,e)throw e},Tr=(t,e,r)=>{r&&!_r(r)?t.destroy(r):e&&t.destroy()};var Ml=({subprocess:t,concurrentStreams:e,encoding:r},{from:n,binary:o=!0,preserveNewlines:s=!0}={})=>{let i=o||P.has(r),{subprocessStdout:a,waitReadableDestroy:u}=Uo(t,n,e),{readableEncoding:c,readableObjectMode:l,readableHighWaterMark:p}=Vo(a,i),{read:D,onStdoutDataDone:m}=Go({subprocessStdout:a,subprocess:t,binary:i,encoding:r,preserveNewlines:s}),f=new AE({read:D,destroy:OE(Ho.bind(void 0,{subprocessStdout:a,subprocess:t,waitReadableDestroy:u})),highWaterMark:p,objectMode:l,encoding:c});return Wo({subprocessStdout:a,onStdoutDataDone:m,readable:f,subprocess:t}),f},Uo=(t,e,r)=>{let n=Te(t,e),o=at(r,n,"readableDestroy");return{subprocessStdout:n,waitReadableDestroy:o}},Vo=({readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r},n)=>n?{readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r}:{readableEncoding:t,readableObjectMode:!0,readableHighWaterMark:Ro},Go=({subprocessStdout:t,subprocess:e,binary:r,encoding:n,preserveNewlines:o})=>{let s=Y(),i=$r({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:!r,encoding:n,preserveNewlines:o});return{read(){$E(this,i,s)},onStdoutDataDone:s}},$E=async(t,e,r)=>{try{let{value:n,done:o}=await e.next();o?r.resolve():t.push(n)}catch{}},Wo=async({subprocessStdout:t,onStdoutDataDone:e,readable:r,subprocess:n,subprocessStdin:o})=>{try{await No(t),await n,await Lo(o),await e,r.readable&&r.push(null)}catch(s){await Lo(o),Pl(r,s)}},Ho=async({subprocessStdout:t,subprocess:e,waitReadableDestroy:r},n)=>{await Le(r,e)&&(Pl(t,n),await Br(e,n))},Pl=(t,e)=>{Tr(t,t.readable,e)};import{Writable as _E}from"stream";import{callbackify as kl}from"util";var Ll=({subprocess:t,concurrentStreams:e},{to:r}={})=>{let{subprocessStdin:n,waitWritableFinal:o,waitWritableDestroy:s}=zo(t,r,e),i=new _E({...qo(n,t,o),destroy:kl(Ko.bind(void 0,{subprocessStdin:n,subprocess:t,waitWritableFinal:o,waitWritableDestroy:s})),highWaterMark:n.writableHighWaterMark,objectMode:n.writableObjectMode});return Yo(n,i),i},zo=(t,e,r)=>{let n=Ht(t,e),o=at(r,n,"writableFinal"),s=at(r,n,"writableDestroy");return{subprocessStdin:n,waitWritableFinal:o,waitWritableDestroy:s}},qo=(t,e,r)=>({write:BE.bind(void 0,t),final:kl(TE.bind(void 0,t,e,r))}),BE=(t,e,r,n)=>{t.write(e,r)?n():t.once("drain",n)},TE=async(t,e,r)=>{await Le(r,e)&&(t.writable&&t.end(),await e)},Yo=async(t,e,r)=>{try{await jo(t),e.writable&&e.end()}catch(n){await Rl(r),jl(e,n)}},Ko=async({subprocessStdin:t,subprocess:e,waitWritableFinal:r,waitWritableDestroy:n},o)=>{await Le(r,e),await Le(n,e)&&(jl(t,o),await Br(e,o))},jl=(t,e)=>{Tr(t,t.writable,e)};import{Duplex as vE}from"stream";import{callbackify as IE}from"util";var Nl=({subprocess:t,concurrentStreams:e,encoding:r},{from:n,to:o,binary:s=!0,preserveNewlines:i=!0}={})=>{let a=s||P.has(r),{subprocessStdout:u,waitReadableDestroy:c}=Uo(t,n,e),{subprocessStdin:l,waitWritableFinal:p,waitWritableDestroy:D}=zo(t,o,e),{readableEncoding:m,readableObjectMode:f,readableHighWaterMark:g}=Vo(u,a),{read:S,onStdoutDataDone:E}=Go({subprocessStdout:u,subprocess:t,binary:a,encoding:r,preserveNewlines:i}),$=new vE({read:S,...qo(l,t,p),destroy:IE(RE.bind(void 0,{subprocessStdout:u,subprocessStdin:l,subprocess:t,waitReadableDestroy:c,waitWritableFinal:p,waitWritableDestroy:D})),readableHighWaterMark:g,writableHighWaterMark:l.writableHighWaterMark,readableObjectMode:f,writableObjectMode:l.writableObjectMode,encoding:m});return Wo({subprocessStdout:u,onStdoutDataDone:E,readable:$,subprocess:t,subprocessStdin:l}),Yo(l,$,u),$},RE=async({subprocessStdout:t,subprocessStdin:e,subprocess:r,waitReadableDestroy:n,waitWritableFinal:o,waitWritableDestroy:s},i)=>{await Promise.all([Ho({subprocessStdout:t,subprocess:r,waitReadableDestroy:n},i),Ko({subprocessStdin:e,subprocess:r,waitWritableFinal:o,waitWritableDestroy:s},i)])};var Jo=(t,e,{from:r,binary:n=!1,preserveNewlines:o=!1}={})=>{let s=n||P.has(e),i=Te(t,r),a=$r({subprocessStdout:i,subprocess:t,binary:s,shouldEncode:!0,encoding:e,preserveNewlines:o});return ME(a,i,t)},ME=async function*(t,e,r){try{yield*t}finally{e.readable&&e.destroy(),await r}};var Ul=(t,{encoding:e})=>{let r=vl();t.readable=Ml.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.writable=Ll.bind(void 0,{subprocess:t,concurrentStreams:r}),t.duplex=Nl.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.iterable=Jo.bind(void 0,t,e),t[Symbol.asyncIterator]=Jo.bind(void 0,t,e,{})};var Vl=(t,e)=>{for(let[r,n]of kE){let o=n.value.bind(e);Reflect.defineProperty(t,r,{...n,value:o})}},PE=(async()=>{})().constructor.prototype,kE=["then","catch","finally"].map(t=>[t,Reflect.getOwnPropertyDescriptor(PE,t)]);var Gl=(t,e,r,n)=>{let{file:o,commandArguments:s,command:i,escapedCommand:a,startTime:u,verboseInfo:c,options:l,fileDescriptors:p}=NE(t,e,r),{subprocess:D,promise:m}=VE({file:o,commandArguments:s,options:l,startTime:u,verboseInfo:c,command:i,escapedCommand:a,fileDescriptors:p});return D.pipe=Or.bind(void 0,{source:D,sourcePromise:m,boundOptions:{},createNested:n}),Vl(D,m),K.set(D,{options:l,fileDescriptors:p}),D},NE=(t,e,r)=>{let{command:n,escapedCommand:o,startTime:s,verboseInfo:i}=Mt(t,e,r),{file:a,commandArguments:u,options:c}=rr(t,e,r),l=UE(c),p=el(l,i);return{file:a,commandArguments:u,command:n,escapedCommand:o,startTime:s,verboseInfo:i,options:l,fileDescriptors:p}},UE=({timeout:t,signal:e,...r})=>{if(e!==void 0)throw new TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...r,timeoutDuration:t}},VE=({file:t,commandArguments:e,options:r,startTime:n,verboseInfo:o,command:s,escapedCommand:i,fileDescriptors:a})=>{let u;try{u=jE(...nr(t,e,r))}catch(f){return Jc({error:f,command:s,escapedCommand:i,fileDescriptors:a,options:r,startTime:n,verboseInfo:o})}let c=new AbortController;LE(Number.POSITIVE_INFINITY,c.signal);let l=[...u.stdio];cl(u,a,c),pl(u,r,c);let p={},D=Y();u.kill=xa.bind(void 0,{kill:u.kill.bind(u),options:r,onInternalError:D,context:p,controller:c}),u.all=xl(u,r),Ul(u,r),qc(u,r);let m=GE({subprocess:u,options:r,startTime:n,verboseInfo:o,fileDescriptors:a,originalStreams:l,command:s,escapedCommand:i,context:p,onInternalError:D,controller:c});return{subprocess:u,promise:m}},GE=async({subprocess:t,options:e,startTime:r,verboseInfo:n,fileDescriptors:o,originalStreams:s,command:i,escapedCommand:a,context:u,onInternalError:c,controller:l})=>{let[p,[D,m],f,g,S]=await Tl({subprocess:t,options:e,context:u,verboseInfo:n,fileDescriptors:o,originalStreams:s,onInternalError:c,controller:l});l.abort(),c.resolve();let E=f.map((C,w)=>re(C,e,w)),$=re(g,e,"all"),T=WE({errorInfo:p,exitCode:D,signal:m,stdio:E,all:$,ipcOutput:S,context:u,options:e,command:i,escapedCommand:a,startTime:r});return Me(T,n,e)},WE=({errorInfo:t,exitCode:e,signal:r,stdio:n,all:o,ipcOutput:s,context:i,options:a,command:u,escapedCommand:c,startTime:l})=>"error"in t?tt({error:t.error,command:u,escapedCommand:c,timedOut:i.terminationReason==="timeout",isCanceled:i.terminationReason==="cancel"||i.terminationReason==="gracefulCancel",isGracefullyCanceled:i.terminationReason==="gracefulCancel",isMaxBuffer:t.error instanceof J,isForcefullyTerminated:i.isForcefullyTerminated,exitCode:e,signal:r,stdio:n,all:o,ipcOutput:s,options:a,startTime:l,isSync:!1}):Dr({command:u,escapedCommand:c,stdio:n,all:o,ipcOutput:s,options:a,startTime:l});var vr=(t,e)=>{let r=Object.fromEntries(Object.entries(e).map(([n,o])=>[n,HE(n,t[n],o)]));return{...t,...r}},HE=(t,e,r)=>zE.has(t)&&O(e)&&O(r)?{...e,...r}:r,zE=new Set(["env",...xn]);var le=(t,e,r,n)=>{let o=(i,a,u)=>le(i,a,r,u),s=(...i)=>qE({mapArguments:t,deepOptions:r,boundOptions:e,setBoundExeca:n,createNested:o},...i);return n!==void 0&&n(s,o,e),s},qE=({mapArguments:t,deepOptions:e={},boundOptions:r={},setBoundExeca:n,createNested:o},s,...i)=>{if(O(s))return o(t,vr(r,s),n);let{file:a,commandArguments:u,options:c,isSync:l}=YE({mapArguments:t,firstArgument:s,nextArguments:i,deepOptions:e,boundOptions:r});return l?Uc(a,u,c):Gl(a,u,c,o)},YE=({mapArguments:t,firstArgument:e,nextArguments:r,deepOptions:n,boundOptions:o})=>{let s=es(e)?ts(e,r):[e,...r],[i,a,u]=wt(...s),c=vr(vr(n,o),u),{file:l=i,commandArguments:p=a,options:D=c,isSync:m=!1}=t({file:i,commandArguments:a,options:c});return{file:l,commandArguments:p,options:D,isSync:m}};var Wl=({file:t,commandArguments:e})=>zl(t,e),Hl=({file:t,commandArguments:e})=>({...zl(t,e),isSync:!0}),zl=(t,e)=>{if(e.length>0)throw new TypeError(`The command and its arguments must be passed as a single string: ${t} ${e}.`);let[r,...n]=KE(t);return{file:r,commandArguments:n}},KE=t=>{if(typeof t!="string")throw new TypeError(`The command must be a string: ${String(t)}.`);let e=t.trim();if(e==="")return[];let r=[];for(let n of e.split(JE)){let o=r.at(-1);o&&o.endsWith("\\")?r[r.length-1]=`${o.slice(0,-1)} ${n}`:r.push(n)}return r},JE=/ +/g;var ql=(t,e,r)=>{t.sync=e(XE,r),t.s=t.sync},Yl=({options:t})=>Kl(t),XE=({options:t})=>({...Kl(t),isSync:!0}),Kl=t=>({options:{...ZE(t),...t}}),ZE=({input:t,inputFile:e,stdio:r})=>t===void 0&&e===void 0&&r===void 0?{stdin:"inherit"}:{},Jl={preferLocal:!0};var je=le(()=>({})),N8=le(()=>({isSync:!0})),Xl=le(Wl),U8=le(Hl),V8=le(uu),G8=le(Yl,{},Jl,ql),{sendMessage:W8,getOneMessage:H8,getEachMessage:z8,getCancelSignal:q8}=Yc();var Zl="ghcr.io/spree/spree",Ir="latest";var Ql="https://github.com/spree/storefront.git",Rr="spree@example.com",Mr="spree123";import QE from"crypto";function ep(){let t=process.env.npm_config_user_agent??"";return t.startsWith("yarn")?"yarn":t.startsWith("pnpm")?"pnpm":"npm"}async function tp(){try{return await Xl("docker info",{stdio:"ignore"}),!0}catch{return!1}}function rp(){return QE.randomBytes(64).toString("hex")}function Xo(t){return t==="yarn"?"yarn":`${t} install`}function np(t){return`x-app: &app
|
|
126
|
+
image: ${Zl}:${Ir}
|
|
127
|
+
depends_on:
|
|
128
|
+
postgres:
|
|
129
|
+
condition: service_healthy
|
|
130
|
+
redis:
|
|
131
|
+
condition: service_healthy
|
|
132
|
+
env_file: .env
|
|
133
|
+
environment: &app-env
|
|
134
|
+
DATABASE_URL: postgres://postgres@postgres:5432/spree
|
|
135
|
+
REDIS_URL: redis://redis:6379/0
|
|
136
|
+
SMTP_HOST: mailpit
|
|
137
|
+
SMTP_PORT: 1025
|
|
138
|
+
RAILS_ENV: production
|
|
139
|
+
RAILS_FORCE_SSL: "false"
|
|
140
|
+
RAILS_ASSUME_SSL: "false"
|
|
141
|
+
RAILS_LOG_TO_STDOUT: "true"
|
|
142
|
+
|
|
143
|
+
services:
|
|
126
144
|
postgres:
|
|
127
145
|
image: postgres:17-alpine
|
|
128
146
|
environment:
|
|
@@ -135,23 +153,26 @@ Instead, \`yield\` should either be called with a value, or not be called at all
|
|
|
135
153
|
timeout: 5s
|
|
136
154
|
retries: 5
|
|
137
155
|
|
|
156
|
+
redis:
|
|
157
|
+
image: redis:7-alpine
|
|
158
|
+
volumes:
|
|
159
|
+
- redis_data:/data
|
|
160
|
+
healthcheck:
|
|
161
|
+
test: redis-cli ping
|
|
162
|
+
interval: 5s
|
|
163
|
+
timeout: 5s
|
|
164
|
+
retries: 5
|
|
165
|
+
|
|
166
|
+
mailpit:
|
|
167
|
+
image: axllent/mailpit
|
|
168
|
+
ports:
|
|
169
|
+
- "8025:8025"
|
|
170
|
+
- "1025:1025"
|
|
171
|
+
|
|
138
172
|
web:
|
|
139
|
-
|
|
140
|
-
depends_on:
|
|
141
|
-
postgres:
|
|
142
|
-
condition: service_healthy
|
|
143
|
-
env_file: .env
|
|
144
|
-
environment:
|
|
145
|
-
DATABASE_URL: postgres://postgres@postgres:5432/spree_production
|
|
146
|
-
CACHE_DATABASE_URL: postgres://postgres@postgres:5432/spree_production_cache
|
|
147
|
-
QUEUE_DATABASE_URL: postgres://postgres@postgres:5432/spree_production_queue
|
|
148
|
-
CABLE_DATABASE_URL: postgres://postgres@postgres:5432/spree_production_cable
|
|
149
|
-
RAILS_ENV: production
|
|
150
|
-
RAILS_FORCE_SSL: "false"
|
|
151
|
-
RAILS_ASSUME_SSL: "false"
|
|
152
|
-
RAILS_LOG_TO_STDOUT: "true"
|
|
173
|
+
<<: *app
|
|
153
174
|
ports:
|
|
154
|
-
- "
|
|
175
|
+
- "\${SPREE_PORT:-3000}:3000"
|
|
155
176
|
healthcheck:
|
|
156
177
|
test: curl -f http://localhost:3000/up || exit 1
|
|
157
178
|
interval: 10s
|
|
@@ -160,29 +181,19 @@ Instead, \`yield\` should either be called with a value, or not be called at all
|
|
|
160
181
|
start_period: 30s
|
|
161
182
|
|
|
162
183
|
worker:
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
web:
|
|
166
|
-
condition: service_healthy
|
|
167
|
-
env_file: .env
|
|
168
|
-
environment:
|
|
169
|
-
DATABASE_URL: postgres://postgres@postgres:5432/spree_production
|
|
170
|
-
CACHE_DATABASE_URL: postgres://postgres@postgres:5432/spree_production_cache
|
|
171
|
-
QUEUE_DATABASE_URL: postgres://postgres@postgres:5432/spree_production_queue
|
|
172
|
-
CABLE_DATABASE_URL: postgres://postgres@postgres:5432/spree_production_cable
|
|
173
|
-
RAILS_ENV: production
|
|
174
|
-
RAILS_LOG_TO_STDOUT: "true"
|
|
175
|
-
command: bin/jobs
|
|
184
|
+
<<: *app
|
|
185
|
+
command: bundle exec sidekiq
|
|
176
186
|
|
|
177
187
|
volumes:
|
|
178
188
|
postgres_data:
|
|
179
|
-
|
|
189
|
+
redis_data:
|
|
190
|
+
`}function op(t,e){return`SECRET_KEY_BASE=${t}
|
|
180
191
|
SPREE_PORT=${e}
|
|
181
|
-
SPREE_VERSION_TAG=${
|
|
182
|
-
`}function
|
|
192
|
+
SPREE_VERSION_TAG=${Ir}
|
|
193
|
+
`}function ip(t,e){return`SPREE_API_URL=http://localhost:${t}
|
|
183
194
|
SPREE_PUBLISHABLE_KEY=${e??"pk_REPLACE_ME_AFTER_DOCKER_START"}
|
|
184
|
-
`}function
|
|
185
|
-
`}function
|
|
195
|
+
`}function sp(t){return JSON.stringify({name:t,private:!0,scripts:{dev:"spree dev",stop:"spree stop",down:"docker compose down",update:"spree update",logs:"spree logs","logs:worker":"spree logs worker",seed:"spree seed","load-sample-data":"spree sample-data",console:"spree console"},dependencies:{"@spree/cli":"2.0.0-beta.3"}},null,2)+`
|
|
196
|
+
`}function ap(t,e,r){let n=`# ${t}
|
|
186
197
|
|
|
187
198
|
A [Spree Commerce](https://spreecommerce.org) project.
|
|
188
199
|
|
|
@@ -195,15 +206,17 @@ A [Spree Commerce](https://spreecommerce.org) project.
|
|
|
195
206
|
### Start the backend
|
|
196
207
|
|
|
197
208
|
\`\`\`bash
|
|
198
|
-
|
|
209
|
+
cd ${t}
|
|
210
|
+
npx spree dev
|
|
199
211
|
\`\`\`
|
|
200
212
|
|
|
201
213
|
Wait for the services to be healthy, then open:
|
|
202
214
|
|
|
203
215
|
- **Admin Dashboard:** http://localhost:${r}/admin
|
|
204
|
-
- Email: \`${
|
|
205
|
-
- Password: \`${
|
|
216
|
+
- Email: \`${Rr}\`
|
|
217
|
+
- Password: \`${Mr}\`
|
|
206
218
|
- **Store API:** http://localhost:${r}/api/v3/store
|
|
219
|
+
- **Mailpit (email inbox):** http://localhost:8025
|
|
207
220
|
`;return e&&(n+=`
|
|
208
221
|
### Start the storefront
|
|
209
222
|
|
|
@@ -215,28 +228,63 @@ npm run dev
|
|
|
215
228
|
|
|
216
229
|
Open http://localhost:${3001}
|
|
217
230
|
`),n+=`
|
|
218
|
-
##
|
|
231
|
+
## Spree CLI
|
|
232
|
+
|
|
233
|
+
This project uses [\`@spree/cli\`](https://www.npmjs.com/package/@spree/cli) to manage the backend.
|
|
234
|
+
|
|
235
|
+
### Services
|
|
219
236
|
|
|
220
237
|
| Command | Description |
|
|
221
238
|
|---------|-------------|
|
|
222
|
-
| \`
|
|
223
|
-
| \`
|
|
224
|
-
| \`
|
|
225
|
-
| \`
|
|
226
|
-
| \`
|
|
227
|
-
| \`
|
|
228
|
-
|
|
229
|
-
|
|
239
|
+
| \`spree dev\` | Start backend services and stream logs |
|
|
240
|
+
| \`spree stop\` | Stop backend services |
|
|
241
|
+
| \`spree update\` | Pull latest Spree image and restart (runs migrations automatically) |
|
|
242
|
+
| \`spree logs\` | View web server logs |
|
|
243
|
+
| \`spree logs worker\` | View background jobs logs |
|
|
244
|
+
| \`spree console\` | Open Rails console |
|
|
245
|
+
|
|
246
|
+
### Data
|
|
247
|
+
|
|
248
|
+
| Command | Description |
|
|
249
|
+
|---------|-------------|
|
|
250
|
+
| \`spree seed\` | Seed the database |
|
|
251
|
+
| \`spree sample-data\` | Load sample products, categories, images |
|
|
252
|
+
|
|
253
|
+
### Users & API Keys
|
|
254
|
+
|
|
255
|
+
| Command | Description |
|
|
256
|
+
|---------|-------------|
|
|
257
|
+
| \`spree user create\` | Create an admin user |
|
|
258
|
+
| \`spree api-key create\` | Create a publishable or secret API key |
|
|
259
|
+
| \`spree api-key list\` | List all API keys |
|
|
260
|
+
| \`spree api-key revoke <token>\` | Revoke an API key |
|
|
261
|
+
|
|
262
|
+
### Other
|
|
263
|
+
|
|
264
|
+
| Command | Description |
|
|
265
|
+
|---------|-------------|
|
|
266
|
+
| \`docker compose down\` | Stop and remove all containers and volumes |
|
|
267
|
+
|
|
268
|
+
## Updating Spree
|
|
269
|
+
|
|
270
|
+
\`\`\`bash
|
|
271
|
+
spree update
|
|
272
|
+
\`\`\`
|
|
273
|
+
|
|
274
|
+
To pin a specific version, edit \`SPREE_VERSION_TAG\` in \`.env\`:
|
|
275
|
+
|
|
276
|
+
\`\`\`
|
|
277
|
+
SPREE_VERSION_TAG=5.4
|
|
278
|
+
\`\`\`
|
|
230
279
|
|
|
231
280
|
## Learn More
|
|
232
281
|
|
|
233
282
|
- [Spree Documentation](https://docs.spreecommerce.org)
|
|
234
283
|
- [Store API Reference](https://docs.spreecommerce.org/api-reference/store)
|
|
235
284
|
- [Spree GitHub](https://github.com/spree/spree)
|
|
236
|
-
`,n}function
|
|
285
|
+
`,n}function up(){return`node_modules/
|
|
237
286
|
.env
|
|
238
287
|
.env.local
|
|
239
288
|
.DS_Store
|
|
240
|
-
`}
|
|
241
|
-
`),"
|
|
242
|
-
`),"Project created!")}var ay=new mi().name("create-spree-app").description("Create a new Spree Commerce project").argument("[directory]","project directory").option("--backend-only","skip storefront setup").option("--no-sample-data","skip loading sample data").option("--no-start","do not start Docker services").option("--port <number>","port for the Spree backend",String(3e3)).option("--use-npm","use npm as package manager").option("--use-yarn","use yarn as package manager").option("--use-pnpm","use pnpm as package manager").action(async(t,e)=>{Ni(Qo.default.bold("Create Spree App"));let r=Zl();e.useNpm&&(r="npm"),e.useYarn&&(r="yarn"),e.usePnpm&&(r="pnpm");try{let n=await Hi({directory:t,backendOnly:e.backendOnly,noSampleData:e.sampleData===!1?!0:void 0,noStart:e.start===!1?!0:void 0,packageManager:r}),o=Number(e.port),s=await gn({port:o});s!==o&&ae.warn(`Port ${o} is in use, using port ${Qo.default.bold(String(s))} instead.`),await hp({...n,port:s}),Ui("Happy selling!")}catch(n){n instanceof Error&&n.message.includes("cancelled")&&(V("Setup cancelled."),process.exit(0)),V(n instanceof Error?n.message:"An unexpected error occurred."),process.exit(1)}});ay.parse();
|
|
289
|
+
`}import cp from"fs";import Pr from"path";async function lp(t){let e=Pr.join(t,"apps","storefront");await je("git",["clone","--depth","1",Ql,e],{stdio:"ignore"}),cp.rmSync(Pr.join(e,".git"),{recursive:!0,force:!0})}async function pp(t,e){let[r,...n]=Xo(e).split(" ");await je(r,n,{cwd:t,stdio:"ignore"})}async function Dp(t,e){let r=Pr.join(t,"apps","storefront"),[n,...o]=Xo(e).split(" ");await je(n,o,{cwd:r,stdio:"ignore"})}function dp(t,e,r){let n=Pr.join(t,"apps","storefront",".env.local");cp.writeFileSync(n,ip(e,r))}async function mp(t){let e=Ce.resolve(t.directory),r=Ce.basename(e),n=t.mode==="full-stack",{port:o}=t;t.start&&(await tp()||(U("Docker is not running. Please start Docker and try again, or use --no-start."),process.exit(1))),pe.existsSync(e)&&pe.readdirSync(e).length>0&&(U(`Directory ${ye.default.bold(t.directory)} is not empty.`),process.exit(1));let s=Vi();if(s.start("Creating project structure..."),pe.mkdirSync(e,{recursive:!0}),pe.writeFileSync(Ce.join(e,"docker-compose.yml"),np(o)),pe.writeFileSync(Ce.join(e,".env"),op(rp(),o)),pe.writeFileSync(Ce.join(e,"package.json"),sp(r)),pe.writeFileSync(Ce.join(e,"README.md"),ap(r,n,o)),pe.writeFileSync(Ce.join(e,".gitignore"),up()),s.stop("Project structure created."),s.start("Installing dependencies..."),await pp(e,t.packageManager),s.stop("Dependencies installed."),n&&(s.start("Downloading storefront template..."),await lp(e),s.stop("Storefront template downloaded."),dp(e,o),s.start("Installing storefront dependencies..."),await Dp(e,t.packageManager),s.stop("Storefront dependencies installed.")),t.start){let i=["spree","init"];t.sampleData||i.push("--no-sample-data"),await je("npx",i,{cwd:e,stdio:"inherit"}),n&&z.info(`${ye.default.bold("Storefront")}: ${ye.default.cyan(`cd ${r}/apps/storefront && npm run dev`)}`)}else tC(r,n,o)}function tC(t,e,r){let n=["",`${ye.default.bold("Next steps:")}`,` cd ${t}`," npx spree dev"];e&&n.push("",` ${ye.default.dim("# In another terminal:")}`,` cd ${t}/apps/storefront`," npm install"," npm run dev"),n.push("",`${ye.default.bold("Admin Dashboard")}`,` http://localhost:${r}/admin`,` Email: ${Rr}`,` Password: ${Mr}`),ji(n.join(`
|
|
290
|
+
`),"Project created!")}var nC=new di().name("create-spree-app").description("Create a new Spree Commerce project").argument("[directory]","project directory").option("--backend-only","skip storefront setup").option("--no-sample-data","skip loading sample data").option("--no-start","do not start Docker services").option("--port <number>","port for the Spree backend",String(3e3)).option("--use-npm","use npm as package manager").option("--use-yarn","use yarn as package manager").option("--use-pnpm","use pnpm as package manager").action(async(t,e)=>{Ni(Zo.default.bold("Create Spree App"));let r=ep();e.useNpm&&(r="npm"),e.useYarn&&(r="yarn"),e.usePnpm&&(r="pnpm");try{let n=await zi({directory:t,backendOnly:e.backendOnly,noSampleData:e.sampleData===!1?!0:void 0,noStart:e.start===!1?!0:void 0,packageManager:r}),o=Number(e.port),s=await bn({port:Hi(o,o+100)});s!==o&&z.warn(`Port ${o} is in use, using port ${Zo.default.bold(String(s))} instead.`),await mp({...n,port:s}),Ui("Happy selling!")}catch(n){n instanceof Error&&n.message.includes("cancelled")&&(U("Setup cancelled."),process.exit(0)),U(n instanceof Error?n.message:"An unexpected error occurred."),process.exit(1)}});nC.parse();
|