@tobylai/qmcli 0.0.7 → 0.0.9

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.
Files changed (2) hide show
  1. package/dist/qmcli.cjs +42 -42
  2. package/package.json +5 -3
package/dist/qmcli.cjs CHANGED
@@ -1,65 +1,65 @@
1
1
  #!/usr/bin/env node
2
- import{createRequire as g4}from"node:module";var b4=Object.create;var{getPrototypeOf:h4,defineProperty:f8,getOwnPropertyNames:m4}=Object;var d4=Object.prototype.hasOwnProperty;var GD=(D,_,u)=>{u=D!=null?b4(h4(D)):{};let F=_||!D||!D.__esModule?f8(u,"default",{value:D,enumerable:!0}):u;for(let B of m4(D))if(!d4.call(F,B))f8(F,B,{get:()=>D[B],enumerable:!0});return F};var N=(D,_)=>()=>(_||D((_={exports:{}}).exports,_),_.exports);var x=g4(import.meta.url);var S0=N((f4)=>{class X3 extends Error{constructor(D,_,u){super(u);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=_,this.exitCode=D,this.nestedError=void 0}}class c8 extends X3{constructor(D){super(1,"commander.invalidArgument",D);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}f4.CommanderError=X3;f4.InvalidArgumentError=c8});var G2=N((n4)=>{var{InvalidArgumentError:l4}=S0();class p8{constructor(D,_){switch(this.description=_||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,D[0]){case"<":this.required=!0,this._name=D.slice(1,-1);break;case"[":this.required=!1,this._name=D.slice(1,-1);break;default:this.required=!0,this._name=D;break}if(this._name.length>3&&this._name.slice(-3)==="...")this.variadic=!0,this._name=this._name.slice(0,-3)}name(){return this._name}_concatValue(D,_){if(_===this.defaultValue||!Array.isArray(_))return[D];return _.concat(D)}default(D,_){return this.defaultValue=D,this.defaultValueDescription=_,this}argParser(D){return this.parseArg=D,this}choices(D){return this.argChoices=D.slice(),this.parseArg=(_,u)=>{if(!this.argChoices.includes(_))throw new l4(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._concatValue(_,u);return _},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}}function i4(D){let _=D.name()+(D.variadic===!0?"...":"");return D.required?"<"+_+">":"["+_+"]"}n4.Argument=p8;n4.humanReadableArgName=i4});var Z3=N((o4)=>{var{humanReadableArgName:r4}=G2();class l8{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(D){this.helpWidth=this.helpWidth??D.helpWidth??80}visibleCommands(D){let _=D.commands.filter((F)=>!F._hidden),u=D._getHelpCommand();if(u&&!u._hidden)_.push(u);if(this.sortSubcommands)_.sort((F,B)=>{return F.name().localeCompare(B.name())});return _}compareOptions(D,_){let u=(F)=>{return F.short?F.short.replace(/^-/,""):F.long.replace(/^--/,"")};return u(D).localeCompare(u(_))}visibleOptions(D){let _=D.options.filter((F)=>!F.hidden),u=D._getHelpOption();if(u&&!u.hidden){let F=u.short&&D._findOption(u.short),B=u.long&&D._findOption(u.long);if(!F&&!B)_.push(u);else if(u.long&&!B)_.push(D.createOption(u.long,u.description));else if(u.short&&!F)_.push(D.createOption(u.short,u.description))}if(this.sortOptions)_.sort(this.compareOptions);return _}visibleGlobalOptions(D){if(!this.showGlobalOptions)return[];let _=[];for(let u=D.parent;u;u=u.parent){let F=u.options.filter((B)=>!B.hidden);_.push(...F)}if(this.sortOptions)_.sort(this.compareOptions);return _}visibleArguments(D){if(D._argsDescription)D.registeredArguments.forEach((_)=>{_.description=_.description||D._argsDescription[_.name()]||""});if(D.registeredArguments.find((_)=>_.description))return D.registeredArguments;return[]}subcommandTerm(D){let _=D.registeredArguments.map((u)=>r4(u)).join(" ");return D._name+(D._aliases[0]?"|"+D._aliases[0]:"")+(D.options.length?" [options]":"")+(_?" "+_:"")}optionTerm(D){return D.flags}argumentTerm(D){return D.name()}longestSubcommandTermLength(D,_){return _.visibleCommands(D).reduce((u,F)=>{return Math.max(u,this.displayWidth(_.styleSubcommandTerm(_.subcommandTerm(F))))},0)}longestOptionTermLength(D,_){return _.visibleOptions(D).reduce((u,F)=>{return Math.max(u,this.displayWidth(_.styleOptionTerm(_.optionTerm(F))))},0)}longestGlobalOptionTermLength(D,_){return _.visibleGlobalOptions(D).reduce((u,F)=>{return Math.max(u,this.displayWidth(_.styleOptionTerm(_.optionTerm(F))))},0)}longestArgumentTermLength(D,_){return _.visibleArguments(D).reduce((u,F)=>{return Math.max(u,this.displayWidth(_.styleArgumentTerm(_.argumentTerm(F))))},0)}commandUsage(D){let _=D._name;if(D._aliases[0])_=_+"|"+D._aliases[0];let u="";for(let F=D.parent;F;F=F.parent)u=F.name()+" "+u;return u+_+" "+D.usage()}commandDescription(D){return D.description()}subcommandDescription(D){return D.summary()||D.description()}optionDescription(D){let _=[];if(D.argChoices)_.push(`choices: ${D.argChoices.map((u)=>JSON.stringify(u)).join(", ")}`);if(D.defaultValue!==void 0){if(D.required||D.optional||D.isBoolean()&&typeof D.defaultValue==="boolean")_.push(`default: ${D.defaultValueDescription||JSON.stringify(D.defaultValue)}`)}if(D.presetArg!==void 0&&D.optional)_.push(`preset: ${JSON.stringify(D.presetArg)}`);if(D.envVar!==void 0)_.push(`env: ${D.envVar}`);if(_.length>0)return`${D.description} (${_.join(", ")})`;return D.description}argumentDescription(D){let _=[];if(D.argChoices)_.push(`choices: ${D.argChoices.map((u)=>JSON.stringify(u)).join(", ")}`);if(D.defaultValue!==void 0)_.push(`default: ${D.defaultValueDescription||JSON.stringify(D.defaultValue)}`);if(_.length>0){let u=`(${_.join(", ")})`;if(D.description)return`${D.description} ${u}`;return u}return D.description}formatHelp(D,_){let u=_.padWidth(D,_),F=_.helpWidth??80;function B(G,Z){return _.formatItem(G,u,Z,_)}let E=[`${_.styleTitle("Usage:")} ${_.styleUsage(_.commandUsage(D))}`,""],C=_.commandDescription(D);if(C.length>0)E=E.concat([_.boxWrap(_.styleCommandDescription(C),F),""]);let $=_.visibleArguments(D).map((G)=>{return B(_.styleArgumentTerm(_.argumentTerm(G)),_.styleArgumentDescription(_.argumentDescription(G)))});if($.length>0)E=E.concat([_.styleTitle("Arguments:"),...$,""]);let q=_.visibleOptions(D).map((G)=>{return B(_.styleOptionTerm(_.optionTerm(G)),_.styleOptionDescription(_.optionDescription(G)))});if(q.length>0)E=E.concat([_.styleTitle("Options:"),...q,""]);if(_.showGlobalOptions){let G=_.visibleGlobalOptions(D).map((Z)=>{return B(_.styleOptionTerm(_.optionTerm(Z)),_.styleOptionDescription(_.optionDescription(Z)))});if(G.length>0)E=E.concat([_.styleTitle("Global Options:"),...G,""])}let X=_.visibleCommands(D).map((G)=>{return B(_.styleSubcommandTerm(_.subcommandTerm(G)),_.styleSubcommandDescription(_.subcommandDescription(G)))});if(X.length>0)E=E.concat([_.styleTitle("Commands:"),...X,""]);return E.join(`
3
- `)}displayWidth(D){return i8(D).length}styleTitle(D){return D}styleUsage(D){return D.split(" ").map((_)=>{if(_==="[options]")return this.styleOptionText(_);if(_==="[command]")return this.styleSubcommandText(_);if(_[0]==="["||_[0]==="<")return this.styleArgumentText(_);return this.styleCommandText(_)}).join(" ")}styleCommandDescription(D){return this.styleDescriptionText(D)}styleOptionDescription(D){return this.styleDescriptionText(D)}styleSubcommandDescription(D){return this.styleDescriptionText(D)}styleArgumentDescription(D){return this.styleDescriptionText(D)}styleDescriptionText(D){return D}styleOptionTerm(D){return this.styleOptionText(D)}styleSubcommandTerm(D){return D.split(" ").map((_)=>{if(_==="[options]")return this.styleOptionText(_);if(_[0]==="["||_[0]==="<")return this.styleArgumentText(_);return this.styleSubcommandText(_)}).join(" ")}styleArgumentTerm(D){return this.styleArgumentText(D)}styleOptionText(D){return D}styleArgumentText(D){return D}styleSubcommandText(D){return D}styleCommandText(D){return D}padWidth(D,_){return Math.max(_.longestOptionTermLength(D,_),_.longestGlobalOptionTermLength(D,_),_.longestSubcommandTermLength(D,_),_.longestArgumentTermLength(D,_))}preformatted(D){return/\n[^\S\r\n]/.test(D)}formatItem(D,_,u,F){let E=" ".repeat(2);if(!u)return E+D;let C=D.padEnd(_+D.length-F.displayWidth(D)),$=2,X=(this.helpWidth??80)-_-$-2,G;if(X<this.minWidthToWrap||F.preformatted(u))G=u;else G=F.boxWrap(u,X).replace(/\n/g,`
2
+ var e4=Object.create;var{getPrototypeOf:D9,defineProperty:G1,getOwnPropertyNames:_9}=Object;var u9=Object.prototype.hasOwnProperty;var x=(D,_,u)=>{u=D!=null?e4(D9(D)):{};let F=_||!D||!D.__esModule?G1(u,"default",{value:D,enumerable:!0}):u;for(let B of _9(D))if(!u9.call(F,B))G1(F,B,{get:()=>D[B],enumerable:!0});return F};var N=(D,_)=>()=>(_||D((_={exports:{}}).exports,_),_.exports);var h0=N((I3)=>{class L3 extends Error{constructor(D,_,u){super(u);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=_,this.exitCode=D,this.nestedError=void 0}}class q1 extends L3{constructor(D){super(1,"commander.invalidArgument",D);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}I3.CommanderError=L3;I3.InvalidArgumentError=q1});var K2=N((R3)=>{var{InvalidArgumentError:F9}=h0();class X1{constructor(D,_){switch(this.description=_||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,D[0]){case"<":this.required=!0,this._name=D.slice(1,-1);break;case"[":this.required=!1,this._name=D.slice(1,-1);break;default:this.required=!0,this._name=D;break}if(this._name.length>3&&this._name.slice(-3)==="...")this.variadic=!0,this._name=this._name.slice(0,-3)}name(){return this._name}_concatValue(D,_){if(_===this.defaultValue||!Array.isArray(_))return[D];return _.concat(D)}default(D,_){return this.defaultValue=D,this.defaultValueDescription=_,this}argParser(D){return this.parseArg=D,this}choices(D){return this.argChoices=D.slice(),this.parseArg=(_,u)=>{if(!this.argChoices.includes(_))throw new F9(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._concatValue(_,u);return _},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}}function B9(D){let _=D.name()+(D.variadic===!0?"...":"");return D.required?"<"+_+">":"["+_+"]"}R3.Argument=X1;R3.humanReadableArgName=B9});var T3=N((N3)=>{var{humanReadableArgName:E9}=K2();class Z1{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(D){this.helpWidth=this.helpWidth??D.helpWidth??80}visibleCommands(D){let _=D.commands.filter((F)=>!F._hidden),u=D._getHelpCommand();if(u&&!u._hidden)_.push(u);if(this.sortSubcommands)_.sort((F,B)=>{return F.name().localeCompare(B.name())});return _}compareOptions(D,_){let u=(F)=>{return F.short?F.short.replace(/^-/,""):F.long.replace(/^--/,"")};return u(D).localeCompare(u(_))}visibleOptions(D){let _=D.options.filter((F)=>!F.hidden),u=D._getHelpOption();if(u&&!u.hidden){let F=u.short&&D._findOption(u.short),B=u.long&&D._findOption(u.long);if(!F&&!B)_.push(u);else if(u.long&&!B)_.push(D.createOption(u.long,u.description));else if(u.short&&!F)_.push(D.createOption(u.short,u.description))}if(this.sortOptions)_.sort(this.compareOptions);return _}visibleGlobalOptions(D){if(!this.showGlobalOptions)return[];let _=[];for(let u=D.parent;u;u=u.parent){let F=u.options.filter((B)=>!B.hidden);_.push(...F)}if(this.sortOptions)_.sort(this.compareOptions);return _}visibleArguments(D){if(D._argsDescription)D.registeredArguments.forEach((_)=>{_.description=_.description||D._argsDescription[_.name()]||""});if(D.registeredArguments.find((_)=>_.description))return D.registeredArguments;return[]}subcommandTerm(D){let _=D.registeredArguments.map((u)=>E9(u)).join(" ");return D._name+(D._aliases[0]?"|"+D._aliases[0]:"")+(D.options.length?" [options]":"")+(_?" "+_:"")}optionTerm(D){return D.flags}argumentTerm(D){return D.name()}longestSubcommandTermLength(D,_){return _.visibleCommands(D).reduce((u,F)=>{return Math.max(u,this.displayWidth(_.styleSubcommandTerm(_.subcommandTerm(F))))},0)}longestOptionTermLength(D,_){return _.visibleOptions(D).reduce((u,F)=>{return Math.max(u,this.displayWidth(_.styleOptionTerm(_.optionTerm(F))))},0)}longestGlobalOptionTermLength(D,_){return _.visibleGlobalOptions(D).reduce((u,F)=>{return Math.max(u,this.displayWidth(_.styleOptionTerm(_.optionTerm(F))))},0)}longestArgumentTermLength(D,_){return _.visibleArguments(D).reduce((u,F)=>{return Math.max(u,this.displayWidth(_.styleArgumentTerm(_.argumentTerm(F))))},0)}commandUsage(D){let _=D._name;if(D._aliases[0])_=_+"|"+D._aliases[0];let u="";for(let F=D.parent;F;F=F.parent)u=F.name()+" "+u;return u+_+" "+D.usage()}commandDescription(D){return D.description()}subcommandDescription(D){return D.summary()||D.description()}optionDescription(D){let _=[];if(D.argChoices)_.push(`choices: ${D.argChoices.map((u)=>JSON.stringify(u)).join(", ")}`);if(D.defaultValue!==void 0){if(D.required||D.optional||D.isBoolean()&&typeof D.defaultValue==="boolean")_.push(`default: ${D.defaultValueDescription||JSON.stringify(D.defaultValue)}`)}if(D.presetArg!==void 0&&D.optional)_.push(`preset: ${JSON.stringify(D.presetArg)}`);if(D.envVar!==void 0)_.push(`env: ${D.envVar}`);if(_.length>0)return`${D.description} (${_.join(", ")})`;return D.description}argumentDescription(D){let _=[];if(D.argChoices)_.push(`choices: ${D.argChoices.map((u)=>JSON.stringify(u)).join(", ")}`);if(D.defaultValue!==void 0)_.push(`default: ${D.defaultValueDescription||JSON.stringify(D.defaultValue)}`);if(_.length>0){let u=`(${_.join(", ")})`;if(D.description)return`${D.description} ${u}`;return u}return D.description}formatHelp(D,_){let u=_.padWidth(D,_),F=_.helpWidth??80;function B(G,Z){return _.formatItem(G,u,Z,_)}let E=[`${_.styleTitle("Usage:")} ${_.styleUsage(_.commandUsage(D))}`,""],C=_.commandDescription(D);if(C.length>0)E=E.concat([_.boxWrap(_.styleCommandDescription(C),F),""]);let $=_.visibleArguments(D).map((G)=>{return B(_.styleArgumentTerm(_.argumentTerm(G)),_.styleArgumentDescription(_.argumentDescription(G)))});if($.length>0)E=E.concat([_.styleTitle("Arguments:"),...$,""]);let q=_.visibleOptions(D).map((G)=>{return B(_.styleOptionTerm(_.optionTerm(G)),_.styleOptionDescription(_.optionDescription(G)))});if(q.length>0)E=E.concat([_.styleTitle("Options:"),...q,""]);if(_.showGlobalOptions){let G=_.visibleGlobalOptions(D).map((Z)=>{return B(_.styleOptionTerm(_.optionTerm(Z)),_.styleOptionDescription(_.optionDescription(Z)))});if(G.length>0)E=E.concat([_.styleTitle("Global Options:"),...G,""])}let X=_.visibleCommands(D).map((G)=>{return B(_.styleSubcommandTerm(_.subcommandTerm(G)),_.styleSubcommandDescription(_.subcommandDescription(G)))});if(X.length>0)E=E.concat([_.styleTitle("Commands:"),...X,""]);return E.join(`
3
+ `)}displayWidth(D){return J1(D).length}styleTitle(D){return D}styleUsage(D){return D.split(" ").map((_)=>{if(_==="[options]")return this.styleOptionText(_);if(_==="[command]")return this.styleSubcommandText(_);if(_[0]==="["||_[0]==="<")return this.styleArgumentText(_);return this.styleCommandText(_)}).join(" ")}styleCommandDescription(D){return this.styleDescriptionText(D)}styleOptionDescription(D){return this.styleDescriptionText(D)}styleSubcommandDescription(D){return this.styleDescriptionText(D)}styleArgumentDescription(D){return this.styleDescriptionText(D)}styleDescriptionText(D){return D}styleOptionTerm(D){return this.styleOptionText(D)}styleSubcommandTerm(D){return D.split(" ").map((_)=>{if(_==="[options]")return this.styleOptionText(_);if(_[0]==="["||_[0]==="<")return this.styleArgumentText(_);return this.styleSubcommandText(_)}).join(" ")}styleArgumentTerm(D){return this.styleArgumentText(D)}styleOptionText(D){return D}styleArgumentText(D){return D}styleSubcommandText(D){return D}styleCommandText(D){return D}padWidth(D,_){return Math.max(_.longestOptionTermLength(D,_),_.longestGlobalOptionTermLength(D,_),_.longestSubcommandTermLength(D,_),_.longestArgumentTermLength(D,_))}preformatted(D){return/\n[^\S\r\n]/.test(D)}formatItem(D,_,u,F){let E=" ".repeat(2);if(!u)return E+D;let C=D.padEnd(_+D.length-F.displayWidth(D)),$=2,X=(this.helpWidth??80)-_-$-2,G;if(X<this.minWidthToWrap||F.preformatted(u))G=u;else G=F.boxWrap(u,X).replace(/\n/g,`
4
4
  `+" ".repeat(_+$));return E+C+" ".repeat($)+G.replace(/\n/g,`
5
5
  ${E}`)}boxWrap(D,_){if(_<this.minWidthToWrap)return D;let u=D.split(/\r\n|\n/),F=/[\s]*[^\s]+/g,B=[];return u.forEach((E)=>{let C=E.match(F);if(C===null){B.push("");return}let $=[C.shift()],q=this.displayWidth($[0]);C.forEach((X)=>{let G=this.displayWidth(X);if(q+G<=_){$.push(X),q+=G;return}B.push($.join(""));let Z=X.trimStart();$=[Z],q=this.displayWidth(Z)}),B.push($.join(""))}),B.join(`
6
- `)}}function i8(D){let _=/\x1b\[\d*(;\d*)*m/g;return D.replace(_,"")}o4.Help=l8;o4.stripColor=i8});var J3=N((u9)=>{var{InvalidArgumentError:D9}=S0();class a8{constructor(D,_){this.flags=D,this.description=_||"",this.required=D.includes("<"),this.optional=D.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(D),this.mandatory=!1;let u=_9(D);if(this.short=u.shortFlag,this.long=u.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(D,_){return this.defaultValue=D,this.defaultValueDescription=_,this}preset(D){return this.presetArg=D,this}conflicts(D){return this.conflictsWith=this.conflictsWith.concat(D),this}implies(D){let _=D;if(typeof D==="string")_={[D]:!0};return this.implied=Object.assign(this.implied||{},_),this}env(D){return this.envVar=D,this}argParser(D){return this.parseArg=D,this}makeOptionMandatory(D=!0){return this.mandatory=!!D,this}hideHelp(D=!0){return this.hidden=!!D,this}_concatValue(D,_){if(_===this.defaultValue||!Array.isArray(_))return[D];return _.concat(D)}choices(D){return this.argChoices=D.slice(),this.parseArg=(_,u)=>{if(!this.argChoices.includes(_))throw new D9(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._concatValue(_,u);return _},this}name(){if(this.long)return this.long.replace(/^--/,"");return this.short.replace(/^-/,"")}attributeName(){if(this.negate)return n8(this.name().replace(/^no-/,""));return n8(this.name())}is(D){return this.short===D||this.long===D}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class s8{constructor(D){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,D.forEach((_)=>{if(_.negate)this.negativeOptions.set(_.attributeName(),_);else this.positiveOptions.set(_.attributeName(),_)}),this.negativeOptions.forEach((_,u)=>{if(this.positiveOptions.has(u))this.dualOptions.add(u)})}valueFromOption(D,_){let u=_.attributeName();if(!this.dualOptions.has(u))return!0;let F=this.negativeOptions.get(u).presetArg,B=F!==void 0?F:!1;return _.negate===(B===D)}}function n8(D){return D.split("-").reduce((_,u)=>{return _+u[0].toUpperCase()+u.slice(1)})}function _9(D){let _,u,F=/^-[^-]$/,B=/^--[^-]/,E=D.split(/[ |,]+/).concat("guard");if(F.test(E[0]))_=E.shift();if(B.test(E[0]))u=E.shift();if(!_&&F.test(E[0]))_=E.shift();if(!_&&B.test(E[0]))_=u,u=E.shift();if(E[0].startsWith("-")){let C=E[0],$=`option creation failed due to '${C}' in option flags '${D}'`;if(/^-[^-][^-]/.test(C))throw new Error(`${$}
6
+ `)}}function J1(D){let _=/\x1b\[\d*(;\d*)*m/g;return D.replace(_,"")}N3.Help=Z1;N3.stripColor=J1});var O3=N((j3)=>{var{InvalidArgumentError:C9}=h0();class K1{constructor(D,_){this.flags=D,this.description=_||"",this.required=D.includes("<"),this.optional=D.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(D),this.mandatory=!1;let u=$9(D);if(this.short=u.shortFlag,this.long=u.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(D,_){return this.defaultValue=D,this.defaultValueDescription=_,this}preset(D){return this.presetArg=D,this}conflicts(D){return this.conflictsWith=this.conflictsWith.concat(D),this}implies(D){let _=D;if(typeof D==="string")_={[D]:!0};return this.implied=Object.assign(this.implied||{},_),this}env(D){return this.envVar=D,this}argParser(D){return this.parseArg=D,this}makeOptionMandatory(D=!0){return this.mandatory=!!D,this}hideHelp(D=!0){return this.hidden=!!D,this}_concatValue(D,_){if(_===this.defaultValue||!Array.isArray(_))return[D];return _.concat(D)}choices(D){return this.argChoices=D.slice(),this.parseArg=(_,u)=>{if(!this.argChoices.includes(_))throw new C9(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._concatValue(_,u);return _},this}name(){if(this.long)return this.long.replace(/^--/,"");return this.short.replace(/^-/,"")}attributeName(){if(this.negate)return Q1(this.name().replace(/^no-/,""));return Q1(this.name())}is(D){return this.short===D||this.long===D}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class U1{constructor(D){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,D.forEach((_)=>{if(_.negate)this.negativeOptions.set(_.attributeName(),_);else this.positiveOptions.set(_.attributeName(),_)}),this.negativeOptions.forEach((_,u)=>{if(this.positiveOptions.has(u))this.dualOptions.add(u)})}valueFromOption(D,_){let u=_.attributeName();if(!this.dualOptions.has(u))return!0;let F=this.negativeOptions.get(u).presetArg,B=F!==void 0?F:!1;return _.negate===(B===D)}}function Q1(D){return D.split("-").reduce((_,u)=>{return _+u[0].toUpperCase()+u.slice(1)})}function $9(D){let _,u,F=/^-[^-]$/,B=/^--[^-]/,E=D.split(/[ |,]+/).concat("guard");if(F.test(E[0]))_=E.shift();if(B.test(E[0]))u=E.shift();if(!_&&F.test(E[0]))_=E.shift();if(!_&&B.test(E[0]))_=u,u=E.shift();if(E[0].startsWith("-")){let C=E[0],$=`option creation failed due to '${C}' in option flags '${D}'`;if(/^-[^-][^-]/.test(C))throw new Error(`${$}
7
7
  - a short flag is a single dash and a single character
8
8
  - either use a single dash and a single character (for a short flag)
9
9
  - or use a double dash for a long option (and can have two, like '--ws, --workspace')`);if(F.test(C))throw new Error(`${$}
10
10
  - too many short flags`);if(B.test(C))throw new Error(`${$}
11
11
  - too many long flags`);throw new Error(`${$}
12
- - unrecognised flag format`)}if(_===void 0&&u===void 0)throw new Error(`option creation failed due to no flags found in '${D}'.`);return{shortFlag:_,longFlag:u}}u9.Option=a8;u9.DualOptions=s8});var r8=N(($9)=>{function E9(D,_){if(Math.abs(D.length-_.length)>3)return Math.max(D.length,_.length);let u=[];for(let F=0;F<=D.length;F++)u[F]=[F];for(let F=0;F<=_.length;F++)u[0][F]=F;for(let F=1;F<=_.length;F++)for(let B=1;B<=D.length;B++){let E=1;if(D[B-1]===_[F-1])E=0;else E=1;if(u[B][F]=Math.min(u[B-1][F]+1,u[B][F-1]+1,u[B-1][F-1]+E),B>1&&F>1&&D[B-1]===_[F-2]&&D[B-2]===_[F-1])u[B][F]=Math.min(u[B][F],u[B-2][F-2]+1)}return u[D.length][_.length]}function C9(D,_){if(!_||_.length===0)return"";_=Array.from(new Set(_));let u=D.startsWith("--");if(u)D=D.slice(2),_=_.map((C)=>C.slice(2));let F=[],B=3,E=0.4;if(_.forEach((C)=>{if(C.length<=1)return;let $=E9(D,C),q=Math.max(D.length,C.length);if((q-$)/q>E){if($<B)B=$,F=[C];else if($===B)F.push(C)}}),F.sort((C,$)=>C.localeCompare($)),u)F=F.map((C)=>`--${C}`);if(F.length>1)return`
12
+ - unrecognised flag format`)}if(_===void 0&&u===void 0)throw new Error(`option creation failed due to no flags found in '${D}'.`);return{shortFlag:_,longFlag:u}}j3.Option=K1;j3.DualOptions=U1});var M1=N((H1)=>{function G9(D,_){if(Math.abs(D.length-_.length)>3)return Math.max(D.length,_.length);let u=[];for(let F=0;F<=D.length;F++)u[F]=[F];for(let F=0;F<=_.length;F++)u[0][F]=F;for(let F=1;F<=_.length;F++)for(let B=1;B<=D.length;B++){let E=1;if(D[B-1]===_[F-1])E=0;else E=1;if(u[B][F]=Math.min(u[B-1][F]+1,u[B][F-1]+1,u[B-1][F-1]+E),B>1&&F>1&&D[B-1]===_[F-2]&&D[B-2]===_[F-1])u[B][F]=Math.min(u[B][F],u[B-2][F-2]+1)}return u[D.length][_.length]}function q9(D,_){if(!_||_.length===0)return"";_=Array.from(new Set(_));let u=D.startsWith("--");if(u)D=D.slice(2),_=_.map((C)=>C.slice(2));let F=[],B=3,E=0.4;if(_.forEach((C)=>{if(C.length<=1)return;let $=G9(D,C),q=Math.max(D.length,C.length);if((q-$)/q>E){if($<B)B=$,F=[C];else if($===B)F.push(C)}}),F.sort((C,$)=>C.localeCompare($)),u)F=F.map((C)=>`--${C}`);if(F.length>1)return`
13
13
  (Did you mean one of ${F.join(", ")}?)`;if(F.length===1)return`
14
- (Did you mean ${F[0]}?)`;return""}$9.suggestSimilar=C9});var D1=N((U9)=>{var q9=x("node:events").EventEmitter,Q3=x("node:child_process"),wD=x("node:path"),q2=x("node:fs"),b=x("node:process"),{Argument:X9,humanReadableArgName:Z9}=G2(),{CommanderError:K3}=S0(),{Help:J9,stripColor:Q9}=Z3(),{Option:o8,DualOptions:K9}=J3(),{suggestSimilar:t8}=r8();class H3 extends q9{constructor(D){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=D||"",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:(_)=>b.stdout.write(_),writeErr:(_)=>b.stderr.write(_),outputError:(_,u)=>u(_),getOutHelpWidth:()=>b.stdout.isTTY?b.stdout.columns:void 0,getErrHelpWidth:()=>b.stderr.isTTY?b.stderr.columns:void 0,getOutHasColors:()=>U3()??(b.stdout.isTTY&&b.stdout.hasColors?.()),getErrHasColors:()=>U3()??(b.stderr.isTTY&&b.stderr.hasColors?.()),stripColor:(_)=>Q9(_)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={}}copyInheritedSettings(D){return this._outputConfiguration=D._outputConfiguration,this._helpOption=D._helpOption,this._helpCommand=D._helpCommand,this._helpConfiguration=D._helpConfiguration,this._exitCallback=D._exitCallback,this._storeOptionsAsProperties=D._storeOptionsAsProperties,this._combineFlagAndOptionalValue=D._combineFlagAndOptionalValue,this._allowExcessArguments=D._allowExcessArguments,this._enablePositionalOptions=D._enablePositionalOptions,this._showHelpAfterError=D._showHelpAfterError,this._showSuggestionAfterError=D._showSuggestionAfterError,this}_getCommandAndAncestors(){let D=[];for(let _=this;_;_=_.parent)D.push(_);return D}command(D,_,u){let F=_,B=u;if(typeof F==="object"&&F!==null)B=F,F=null;B=B||{};let[,E,C]=D.match(/([^ ]+) *(.*)/),$=this.createCommand(E);if(F)$.description(F),$._executableHandler=!0;if(B.isDefault)this._defaultCommandName=$._name;if($._hidden=!!(B.noHelp||B.hidden),$._executableFile=B.executableFile||null,C)$.arguments(C);if(this._registerCommand($),$.parent=this,$.copyInheritedSettings(this),F)return this;return $}createCommand(D){return new H3(D)}createHelp(){return Object.assign(new J9,this.configureHelp())}configureHelp(D){if(D===void 0)return this._helpConfiguration;return this._helpConfiguration=D,this}configureOutput(D){if(D===void 0)return this._outputConfiguration;return Object.assign(this._outputConfiguration,D),this}showHelpAfterError(D=!0){if(typeof D!=="string")D=!!D;return this._showHelpAfterError=D,this}showSuggestionAfterError(D=!0){return this._showSuggestionAfterError=!!D,this}addCommand(D,_){if(!D._name)throw new Error(`Command passed to .addCommand() must have a name
15
- - specify the name in Command constructor or using .name()`);if(_=_||{},_.isDefault)this._defaultCommandName=D._name;if(_.noHelp||_.hidden)D._hidden=!0;return this._registerCommand(D),D.parent=this,D._checkForBrokenPassThrough(),this}createArgument(D,_){return new X9(D,_)}argument(D,_,u,F){let B=this.createArgument(D,_);if(typeof u==="function")B.default(F).argParser(u);else B.default(u);return this.addArgument(B),this}arguments(D){return D.trim().split(/ +/).forEach((_)=>{this.argument(_)}),this}addArgument(D){let _=this.registeredArguments.slice(-1)[0];if(_&&_.variadic)throw new Error(`only the last argument can be variadic '${_.name()}'`);if(D.required&&D.defaultValue!==void 0&&D.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${D.name()}'`);return this.registeredArguments.push(D),this}helpCommand(D,_){if(typeof D==="boolean")return this._addImplicitHelpCommand=D,this;D=D??"help [command]";let[,u,F]=D.match(/([^ ]+) *(.*)/),B=_??"display help for command",E=this.createCommand(u);if(E.helpOption(!1),F)E.arguments(F);if(B)E.description(B);return this._addImplicitHelpCommand=!0,this._helpCommand=E,this}addHelpCommand(D,_){if(typeof D!=="object")return this.helpCommand(D,_),this;return this._addImplicitHelpCommand=!0,this._helpCommand=D,this}_getHelpCommand(){if(this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))){if(this._helpCommand===void 0)this.helpCommand(void 0,void 0);return this._helpCommand}return null}hook(D,_){let u=["preSubcommand","preAction","postAction"];if(!u.includes(D))throw new Error(`Unexpected value for event passed to hook : '${D}'.
16
- Expecting one of '${u.join("', '")}'`);if(this._lifeCycleHooks[D])this._lifeCycleHooks[D].push(_);else this._lifeCycleHooks[D]=[_];return this}exitOverride(D){if(D)this._exitCallback=D;else this._exitCallback=(_)=>{if(_.code!=="commander.executeSubCommandAsync")throw _};return this}_exit(D,_,u){if(this._exitCallback)this._exitCallback(new K3(D,_,u));b.exit(D)}action(D){let _=(u)=>{let F=this.registeredArguments.length,B=u.slice(0,F);if(this._storeOptionsAsProperties)B[F]=this;else B[F]=this.opts();return B.push(this),D.apply(this,B)};return this._actionHandler=_,this}createOption(D,_){return new o8(D,_)}_callParseArg(D,_,u,F){try{return D.parseArg(_,u)}catch(B){if(B.code==="commander.invalidArgument"){let E=`${F} ${B.message}`;this.error(E,{exitCode:B.exitCode,code:B.code})}throw B}}_registerOption(D){let _=D.short&&this._findOption(D.short)||D.long&&this._findOption(D.long);if(_){let u=D.long&&this._findOption(D.long)?D.long:D.short;throw new Error(`Cannot add option '${D.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${u}'
17
- - already used by option '${_.flags}'`)}this.options.push(D)}_registerCommand(D){let _=(F)=>{return[F.name()].concat(F.aliases())},u=_(D).find((F)=>this._findCommand(F));if(u){let F=_(this._findCommand(u)).join("|"),B=_(D).join("|");throw new Error(`cannot add command '${B}' as already have command '${F}'`)}this.commands.push(D)}addOption(D){this._registerOption(D);let _=D.name(),u=D.attributeName();if(D.negate){let B=D.long.replace(/^--no-/,"--");if(!this._findOption(B))this.setOptionValueWithSource(u,D.defaultValue===void 0?!0:D.defaultValue,"default")}else if(D.defaultValue!==void 0)this.setOptionValueWithSource(u,D.defaultValue,"default");let F=(B,E,C)=>{if(B==null&&D.presetArg!==void 0)B=D.presetArg;let $=this.getOptionValue(u);if(B!==null&&D.parseArg)B=this._callParseArg(D,B,$,E);else if(B!==null&&D.variadic)B=D._concatValue(B,$);if(B==null)if(D.negate)B=!1;else if(D.isBoolean()||D.optional)B=!0;else B="";this.setOptionValueWithSource(u,B,C)};if(this.on("option:"+_,(B)=>{let E=`error: option '${D.flags}' argument '${B}' is invalid.`;F(B,E,"cli")}),D.envVar)this.on("optionEnv:"+_,(B)=>{let E=`error: option '${D.flags}' value '${B}' from env '${D.envVar}' is invalid.`;F(B,E,"env")});return this}_optionEx(D,_,u,F,B){if(typeof _==="object"&&_ instanceof o8)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let E=this.createOption(_,u);if(E.makeOptionMandatory(!!D.mandatory),typeof F==="function")E.default(B).argParser(F);else if(F instanceof RegExp){let C=F;F=($,q)=>{let X=C.exec($);return X?X[0]:q},E.default(B).argParser(F)}else E.default(F);return this.addOption(E)}option(D,_,u,F){return this._optionEx({},D,_,u,F)}requiredOption(D,_,u,F){return this._optionEx({mandatory:!0},D,_,u,F)}combineFlagAndOptionalValue(D=!0){return this._combineFlagAndOptionalValue=!!D,this}allowUnknownOption(D=!0){return this._allowUnknownOption=!!D,this}allowExcessArguments(D=!0){return this._allowExcessArguments=!!D,this}enablePositionalOptions(D=!0){return this._enablePositionalOptions=!!D,this}passThroughOptions(D=!0){return this._passThroughOptions=!!D,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(D=!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=!!D,this}getOptionValue(D){if(this._storeOptionsAsProperties)return this[D];return this._optionValues[D]}setOptionValue(D,_){return this.setOptionValueWithSource(D,_,void 0)}setOptionValueWithSource(D,_,u){if(this._storeOptionsAsProperties)this[D]=_;else this._optionValues[D]=_;return this._optionValueSources[D]=u,this}getOptionValueSource(D){return this._optionValueSources[D]}getOptionValueSourceWithGlobals(D){let _;return this._getCommandAndAncestors().forEach((u)=>{if(u.getOptionValueSource(D)!==void 0)_=u.getOptionValueSource(D)}),_}_prepareUserArgs(D,_){if(D!==void 0&&!Array.isArray(D))throw new Error("first parameter to parse must be array or undefined");if(_=_||{},D===void 0&&_.from===void 0){if(b.versions?.electron)_.from="electron";let F=b.execArgv??[];if(F.includes("-e")||F.includes("--eval")||F.includes("-p")||F.includes("--print"))_.from="eval"}if(D===void 0)D=b.argv;this.rawArgs=D.slice();let u;switch(_.from){case void 0:case"node":this._scriptPath=D[1],u=D.slice(2);break;case"electron":if(b.defaultApp)this._scriptPath=D[1],u=D.slice(2);else u=D.slice(1);break;case"user":u=D.slice(0);break;case"eval":u=D.slice(1);break;default:throw new Error(`unexpected parse option { from: '${_.from}' }`)}if(!this._name&&this._scriptPath)this.nameFromFilename(this._scriptPath);return this._name=this._name||"program",u}parse(D,_){this._prepareForParse();let u=this._prepareUserArgs(D,_);return this._parseCommand([],u),this}async parseAsync(D,_){this._prepareForParse();let u=this._prepareUserArgs(D,_);return await this._parseCommand([],u),this}_prepareForParse(){if(this._savedState===null)this.saveStateBeforeParse();else 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.
18
- - 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(D,_,u){if(q2.existsSync(D))return;let F=_?`searched for local subcommand relative to directory '${_}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",B=`'${D}' does not exist
14
+ (Did you mean ${F[0]}?)`;return""}H1.suggestSimilar=q9});var L1=N((x3)=>{var X9=require("node:events").EventEmitter,P3=require("node:child_process"),yD=require("node:path"),U2=require("node:fs"),b=require("node:process"),{Argument:Z9,humanReadableArgName:J9}=K2(),{CommanderError:z3}=h0(),{Help:Q9,stripColor:K9}=T3(),{Option:W1,DualOptions:U9}=O3(),{suggestSimilar:A1}=M1();class w3 extends X9{constructor(D){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=D||"",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:(_)=>b.stdout.write(_),writeErr:(_)=>b.stderr.write(_),outputError:(_,u)=>u(_),getOutHelpWidth:()=>b.stdout.isTTY?b.stdout.columns:void 0,getErrHelpWidth:()=>b.stderr.isTTY?b.stderr.columns:void 0,getOutHasColors:()=>Y3()??(b.stdout.isTTY&&b.stdout.hasColors?.()),getErrHasColors:()=>Y3()??(b.stderr.isTTY&&b.stderr.hasColors?.()),stripColor:(_)=>K9(_)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={}}copyInheritedSettings(D){return this._outputConfiguration=D._outputConfiguration,this._helpOption=D._helpOption,this._helpCommand=D._helpCommand,this._helpConfiguration=D._helpConfiguration,this._exitCallback=D._exitCallback,this._storeOptionsAsProperties=D._storeOptionsAsProperties,this._combineFlagAndOptionalValue=D._combineFlagAndOptionalValue,this._allowExcessArguments=D._allowExcessArguments,this._enablePositionalOptions=D._enablePositionalOptions,this._showHelpAfterError=D._showHelpAfterError,this._showSuggestionAfterError=D._showSuggestionAfterError,this}_getCommandAndAncestors(){let D=[];for(let _=this;_;_=_.parent)D.push(_);return D}command(D,_,u){let F=_,B=u;if(typeof F==="object"&&F!==null)B=F,F=null;B=B||{};let[,E,C]=D.match(/([^ ]+) *(.*)/),$=this.createCommand(E);if(F)$.description(F),$._executableHandler=!0;if(B.isDefault)this._defaultCommandName=$._name;if($._hidden=!!(B.noHelp||B.hidden),$._executableFile=B.executableFile||null,C)$.arguments(C);if(this._registerCommand($),$.parent=this,$.copyInheritedSettings(this),F)return this;return $}createCommand(D){return new w3(D)}createHelp(){return Object.assign(new Q9,this.configureHelp())}configureHelp(D){if(D===void 0)return this._helpConfiguration;return this._helpConfiguration=D,this}configureOutput(D){if(D===void 0)return this._outputConfiguration;return Object.assign(this._outputConfiguration,D),this}showHelpAfterError(D=!0){if(typeof D!=="string")D=!!D;return this._showHelpAfterError=D,this}showSuggestionAfterError(D=!0){return this._showSuggestionAfterError=!!D,this}addCommand(D,_){if(!D._name)throw new Error(`Command passed to .addCommand() must have a name
15
+ - specify the name in Command constructor or using .name()`);if(_=_||{},_.isDefault)this._defaultCommandName=D._name;if(_.noHelp||_.hidden)D._hidden=!0;return this._registerCommand(D),D.parent=this,D._checkForBrokenPassThrough(),this}createArgument(D,_){return new Z9(D,_)}argument(D,_,u,F){let B=this.createArgument(D,_);if(typeof u==="function")B.default(F).argParser(u);else B.default(u);return this.addArgument(B),this}arguments(D){return D.trim().split(/ +/).forEach((_)=>{this.argument(_)}),this}addArgument(D){let _=this.registeredArguments.slice(-1)[0];if(_&&_.variadic)throw new Error(`only the last argument can be variadic '${_.name()}'`);if(D.required&&D.defaultValue!==void 0&&D.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${D.name()}'`);return this.registeredArguments.push(D),this}helpCommand(D,_){if(typeof D==="boolean")return this._addImplicitHelpCommand=D,this;D=D??"help [command]";let[,u,F]=D.match(/([^ ]+) *(.*)/),B=_??"display help for command",E=this.createCommand(u);if(E.helpOption(!1),F)E.arguments(F);if(B)E.description(B);return this._addImplicitHelpCommand=!0,this._helpCommand=E,this}addHelpCommand(D,_){if(typeof D!=="object")return this.helpCommand(D,_),this;return this._addImplicitHelpCommand=!0,this._helpCommand=D,this}_getHelpCommand(){if(this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))){if(this._helpCommand===void 0)this.helpCommand(void 0,void 0);return this._helpCommand}return null}hook(D,_){let u=["preSubcommand","preAction","postAction"];if(!u.includes(D))throw new Error(`Unexpected value for event passed to hook : '${D}'.
16
+ Expecting one of '${u.join("', '")}'`);if(this._lifeCycleHooks[D])this._lifeCycleHooks[D].push(_);else this._lifeCycleHooks[D]=[_];return this}exitOverride(D){if(D)this._exitCallback=D;else this._exitCallback=(_)=>{if(_.code!=="commander.executeSubCommandAsync")throw _};return this}_exit(D,_,u){if(this._exitCallback)this._exitCallback(new z3(D,_,u));b.exit(D)}action(D){let _=(u)=>{let F=this.registeredArguments.length,B=u.slice(0,F);if(this._storeOptionsAsProperties)B[F]=this;else B[F]=this.opts();return B.push(this),D.apply(this,B)};return this._actionHandler=_,this}createOption(D,_){return new W1(D,_)}_callParseArg(D,_,u,F){try{return D.parseArg(_,u)}catch(B){if(B.code==="commander.invalidArgument"){let E=`${F} ${B.message}`;this.error(E,{exitCode:B.exitCode,code:B.code})}throw B}}_registerOption(D){let _=D.short&&this._findOption(D.short)||D.long&&this._findOption(D.long);if(_){let u=D.long&&this._findOption(D.long)?D.long:D.short;throw new Error(`Cannot add option '${D.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${u}'
17
+ - already used by option '${_.flags}'`)}this.options.push(D)}_registerCommand(D){let _=(F)=>{return[F.name()].concat(F.aliases())},u=_(D).find((F)=>this._findCommand(F));if(u){let F=_(this._findCommand(u)).join("|"),B=_(D).join("|");throw new Error(`cannot add command '${B}' as already have command '${F}'`)}this.commands.push(D)}addOption(D){this._registerOption(D);let _=D.name(),u=D.attributeName();if(D.negate){let B=D.long.replace(/^--no-/,"--");if(!this._findOption(B))this.setOptionValueWithSource(u,D.defaultValue===void 0?!0:D.defaultValue,"default")}else if(D.defaultValue!==void 0)this.setOptionValueWithSource(u,D.defaultValue,"default");let F=(B,E,C)=>{if(B==null&&D.presetArg!==void 0)B=D.presetArg;let $=this.getOptionValue(u);if(B!==null&&D.parseArg)B=this._callParseArg(D,B,$,E);else if(B!==null&&D.variadic)B=D._concatValue(B,$);if(B==null)if(D.negate)B=!1;else if(D.isBoolean()||D.optional)B=!0;else B="";this.setOptionValueWithSource(u,B,C)};if(this.on("option:"+_,(B)=>{let E=`error: option '${D.flags}' argument '${B}' is invalid.`;F(B,E,"cli")}),D.envVar)this.on("optionEnv:"+_,(B)=>{let E=`error: option '${D.flags}' value '${B}' from env '${D.envVar}' is invalid.`;F(B,E,"env")});return this}_optionEx(D,_,u,F,B){if(typeof _==="object"&&_ instanceof W1)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let E=this.createOption(_,u);if(E.makeOptionMandatory(!!D.mandatory),typeof F==="function")E.default(B).argParser(F);else if(F instanceof RegExp){let C=F;F=($,q)=>{let X=C.exec($);return X?X[0]:q},E.default(B).argParser(F)}else E.default(F);return this.addOption(E)}option(D,_,u,F){return this._optionEx({},D,_,u,F)}requiredOption(D,_,u,F){return this._optionEx({mandatory:!0},D,_,u,F)}combineFlagAndOptionalValue(D=!0){return this._combineFlagAndOptionalValue=!!D,this}allowUnknownOption(D=!0){return this._allowUnknownOption=!!D,this}allowExcessArguments(D=!0){return this._allowExcessArguments=!!D,this}enablePositionalOptions(D=!0){return this._enablePositionalOptions=!!D,this}passThroughOptions(D=!0){return this._passThroughOptions=!!D,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(D=!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=!!D,this}getOptionValue(D){if(this._storeOptionsAsProperties)return this[D];return this._optionValues[D]}setOptionValue(D,_){return this.setOptionValueWithSource(D,_,void 0)}setOptionValueWithSource(D,_,u){if(this._storeOptionsAsProperties)this[D]=_;else this._optionValues[D]=_;return this._optionValueSources[D]=u,this}getOptionValueSource(D){return this._optionValueSources[D]}getOptionValueSourceWithGlobals(D){let _;return this._getCommandAndAncestors().forEach((u)=>{if(u.getOptionValueSource(D)!==void 0)_=u.getOptionValueSource(D)}),_}_prepareUserArgs(D,_){if(D!==void 0&&!Array.isArray(D))throw new Error("first parameter to parse must be array or undefined");if(_=_||{},D===void 0&&_.from===void 0){if(b.versions?.electron)_.from="electron";let F=b.execArgv??[];if(F.includes("-e")||F.includes("--eval")||F.includes("-p")||F.includes("--print"))_.from="eval"}if(D===void 0)D=b.argv;this.rawArgs=D.slice();let u;switch(_.from){case void 0:case"node":this._scriptPath=D[1],u=D.slice(2);break;case"electron":if(b.defaultApp)this._scriptPath=D[1],u=D.slice(2);else u=D.slice(1);break;case"user":u=D.slice(0);break;case"eval":u=D.slice(1);break;default:throw new Error(`unexpected parse option { from: '${_.from}' }`)}if(!this._name&&this._scriptPath)this.nameFromFilename(this._scriptPath);return this._name=this._name||"program",u}parse(D,_){this._prepareForParse();let u=this._prepareUserArgs(D,_);return this._parseCommand([],u),this}async parseAsync(D,_){this._prepareForParse();let u=this._prepareUserArgs(D,_);return await this._parseCommand([],u),this}_prepareForParse(){if(this._savedState===null)this.saveStateBeforeParse();else 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.
18
+ - 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(D,_,u){if(U2.existsSync(D))return;let F=_?`searched for local subcommand relative to directory '${_}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",B=`'${D}' does not exist
19
19
  - if '${u}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
20
20
  - if the default executable name is not suitable, use the executableFile option to supply a custom name or path
21
- - ${F}`;throw new Error(B)}_executeSubCommand(D,_){_=_.slice();let u=!1,F=[".js",".ts",".tsx",".mjs",".cjs"];function B(X,G){let Z=wD.resolve(X,G);if(q2.existsSync(Z))return Z;if(F.includes(wD.extname(G)))return;let J=F.find((K)=>q2.existsSync(`${Z}${K}`));if(J)return`${Z}${J}`;return}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let E=D._executableFile||`${this._name}-${D._name}`,C=this._executableDir||"";if(this._scriptPath){let X;try{X=q2.realpathSync(this._scriptPath)}catch{X=this._scriptPath}C=wD.resolve(wD.dirname(X),C)}if(C){let X=B(C,E);if(!X&&!D._executableFile&&this._scriptPath){let G=wD.basename(this._scriptPath,wD.extname(this._scriptPath));if(G!==this._name)X=B(C,`${G}-${D._name}`)}E=X||E}u=F.includes(wD.extname(E));let $;if(b.platform!=="win32")if(u)_.unshift(E),_=e8(b.execArgv).concat(_),$=Q3.spawn(b.argv[0],_,{stdio:"inherit"});else $=Q3.spawn(E,_,{stdio:"inherit"});else this._checkForMissingExecutable(E,C,D._name),_.unshift(E),_=e8(b.execArgv).concat(_),$=Q3.spawn(b.execPath,_,{stdio:"inherit"});if(!$.killed)["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((G)=>{b.on(G,()=>{if($.killed===!1&&$.exitCode===null)$.kill(G)})});let q=this._exitCallback;$.on("close",(X)=>{if(X=X??1,!q)b.exit(X);else q(new K3(X,"commander.executeSubCommandAsync","(close)"))}),$.on("error",(X)=>{if(X.code==="ENOENT")this._checkForMissingExecutable(E,C,D._name);else if(X.code==="EACCES")throw new Error(`'${E}' not executable`);if(!q)b.exit(1);else{let G=new K3(1,"commander.executeSubCommandAsync","(error)");G.nestedError=X,q(G)}}),this.runningCommand=$}_dispatchSubcommand(D,_,u){let F=this._findCommand(D);if(!F)this.help({error:!0});F._prepareForParse();let B;return B=this._chainOrCallSubCommandHook(B,F,"preSubcommand"),B=this._chainOrCall(B,()=>{if(F._executableHandler)this._executeSubCommand(F,_.concat(u));else return F._parseCommand(_,u)}),B}_dispatchHelpCommand(D){if(!D)this.help();let _=this._findCommand(D);if(_&&!_._executableHandler)_.help();return this._dispatchSubcommand(D,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){if(this.registeredArguments.forEach((D,_)=>{if(D.required&&this.args[_]==null)this.missingArgument(D.name())}),this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)return;if(this.args.length>this.registeredArguments.length)this._excessArguments(this.args)}_processArguments(){let D=(u,F,B)=>{let E=F;if(F!==null&&u.parseArg){let C=`error: command-argument value '${F}' is invalid for argument '${u.name()}'.`;E=this._callParseArg(u,F,B,C)}return E};this._checkNumberOfArguments();let _=[];this.registeredArguments.forEach((u,F)=>{let B=u.defaultValue;if(u.variadic){if(F<this.args.length){if(B=this.args.slice(F),u.parseArg)B=B.reduce((E,C)=>{return D(u,C,E)},u.defaultValue)}else if(B===void 0)B=[]}else if(F<this.args.length){if(B=this.args[F],u.parseArg)B=D(u,B,u.defaultValue)}_[F]=B}),this.processedArgs=_}_chainOrCall(D,_){if(D&&D.then&&typeof D.then==="function")return D.then(()=>_());return _()}_chainOrCallHooks(D,_){let u=D,F=[];if(this._getCommandAndAncestors().reverse().filter((B)=>B._lifeCycleHooks[_]!==void 0).forEach((B)=>{B._lifeCycleHooks[_].forEach((E)=>{F.push({hookedCommand:B,callback:E})})}),_==="postAction")F.reverse();return F.forEach((B)=>{u=this._chainOrCall(u,()=>{return B.callback(B.hookedCommand,this)})}),u}_chainOrCallSubCommandHook(D,_,u){let F=D;if(this._lifeCycleHooks[u]!==void 0)this._lifeCycleHooks[u].forEach((B)=>{F=this._chainOrCall(F,()=>{return B(this,_)})});return F}_parseCommand(D,_){let u=this.parseOptions(_);if(this._parseOptionsEnv(),this._parseOptionsImplied(),D=D.concat(u.operands),_=u.unknown,this.args=D.concat(_),D&&this._findCommand(D[0]))return this._dispatchSubcommand(D[0],D.slice(1),_);if(this._getHelpCommand()&&D[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(D[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(_),this._dispatchSubcommand(this._defaultCommandName,D,_);if(this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName)this.help({error:!0});this._outputHelpIfRequested(u.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let F=()=>{if(u.unknown.length>0)this.unknownOption(u.unknown[0])},B=`command:${this.name()}`;if(this._actionHandler){F(),this._processArguments();let E;if(E=this._chainOrCallHooks(E,"preAction"),E=this._chainOrCall(E,()=>this._actionHandler(this.processedArgs)),this.parent)E=this._chainOrCall(E,()=>{this.parent.emit(B,D,_)});return E=this._chainOrCallHooks(E,"postAction"),E}if(this.parent&&this.parent.listenerCount(B))F(),this._processArguments(),this.parent.emit(B,D,_);else if(D.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",D,_);if(this.listenerCount("command:*"))this.emit("command:*",D,_);else if(this.commands.length)this.unknownCommand();else F(),this._processArguments()}else if(this.commands.length)F(),this.help({error:!0});else F(),this._processArguments()}_findCommand(D){if(!D)return;return this.commands.find((_)=>_._name===D||_._aliases.includes(D))}_findOption(D){return this.options.find((_)=>_.is(D))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach((D)=>{D.options.forEach((_)=>{if(_.mandatory&&D.getOptionValue(_.attributeName())===void 0)D.missingMandatoryOptionValue(_)})})}_checkForConflictingLocalOptions(){let D=this.options.filter((u)=>{let F=u.attributeName();if(this.getOptionValue(F)===void 0)return!1;return this.getOptionValueSource(F)!=="default"});D.filter((u)=>u.conflictsWith.length>0).forEach((u)=>{let F=D.find((B)=>u.conflictsWith.includes(B.attributeName()));if(F)this._conflictingOption(u,F)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach((D)=>{D._checkForConflictingLocalOptions()})}parseOptions(D){let _=[],u=[],F=_,B=D.slice();function E($){return $.length>1&&$[0]==="-"}let C=null;while(B.length){let $=B.shift();if($==="--"){if(F===u)F.push($);F.push(...B);break}if(C&&!E($)){this.emit(`option:${C.name()}`,$);continue}if(C=null,E($)){let q=this._findOption($);if(q){if(q.required){let X=B.shift();if(X===void 0)this.optionMissingArgument(q);this.emit(`option:${q.name()}`,X)}else if(q.optional){let X=null;if(B.length>0&&!E(B[0]))X=B.shift();this.emit(`option:${q.name()}`,X)}else this.emit(`option:${q.name()}`);C=q.variadic?q:null;continue}}if($.length>2&&$[0]==="-"&&$[1]!=="-"){let q=this._findOption(`-${$[1]}`);if(q){if(q.required||q.optional&&this._combineFlagAndOptionalValue)this.emit(`option:${q.name()}`,$.slice(2));else this.emit(`option:${q.name()}`),B.unshift(`-${$.slice(2)}`);continue}}if(/^--[^=]+=/.test($)){let q=$.indexOf("="),X=this._findOption($.slice(0,q));if(X&&(X.required||X.optional)){this.emit(`option:${X.name()}`,$.slice(q+1));continue}}if(E($))F=u;if((this._enablePositionalOptions||this._passThroughOptions)&&_.length===0&&u.length===0){if(this._findCommand($)){if(_.push($),B.length>0)u.push(...B);break}else if(this._getHelpCommand()&&$===this._getHelpCommand().name()){if(_.push($),B.length>0)_.push(...B);break}else if(this._defaultCommandName){if(u.push($),B.length>0)u.push(...B);break}}if(this._passThroughOptions){if(F.push($),B.length>0)F.push(...B);break}F.push($)}return{operands:_,unknown:u}}opts(){if(this._storeOptionsAsProperties){let D={},_=this.options.length;for(let u=0;u<_;u++){let F=this.options[u].attributeName();D[F]=F===this._versionOptionName?this._version:this[F]}return D}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((D,_)=>Object.assign(D,_.opts()),{})}error(D,_){if(this._outputConfiguration.outputError(`${D}
21
+ - ${F}`;throw new Error(B)}_executeSubCommand(D,_){_=_.slice();let u=!1,F=[".js",".ts",".tsx",".mjs",".cjs"];function B(X,G){let Z=yD.resolve(X,G);if(U2.existsSync(Z))return Z;if(F.includes(yD.extname(G)))return;let J=F.find((K)=>U2.existsSync(`${Z}${K}`));if(J)return`${Z}${J}`;return}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let E=D._executableFile||`${this._name}-${D._name}`,C=this._executableDir||"";if(this._scriptPath){let X;try{X=U2.realpathSync(this._scriptPath)}catch{X=this._scriptPath}C=yD.resolve(yD.dirname(X),C)}if(C){let X=B(C,E);if(!X&&!D._executableFile&&this._scriptPath){let G=yD.basename(this._scriptPath,yD.extname(this._scriptPath));if(G!==this._name)X=B(C,`${G}-${D._name}`)}E=X||E}u=F.includes(yD.extname(E));let $;if(b.platform!=="win32")if(u)_.unshift(E),_=V1(b.execArgv).concat(_),$=P3.spawn(b.argv[0],_,{stdio:"inherit"});else $=P3.spawn(E,_,{stdio:"inherit"});else this._checkForMissingExecutable(E,C,D._name),_.unshift(E),_=V1(b.execArgv).concat(_),$=P3.spawn(b.execPath,_,{stdio:"inherit"});if(!$.killed)["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((G)=>{b.on(G,()=>{if($.killed===!1&&$.exitCode===null)$.kill(G)})});let q=this._exitCallback;$.on("close",(X)=>{if(X=X??1,!q)b.exit(X);else q(new z3(X,"commander.executeSubCommandAsync","(close)"))}),$.on("error",(X)=>{if(X.code==="ENOENT")this._checkForMissingExecutable(E,C,D._name);else if(X.code==="EACCES")throw new Error(`'${E}' not executable`);if(!q)b.exit(1);else{let G=new z3(1,"commander.executeSubCommandAsync","(error)");G.nestedError=X,q(G)}}),this.runningCommand=$}_dispatchSubcommand(D,_,u){let F=this._findCommand(D);if(!F)this.help({error:!0});F._prepareForParse();let B;return B=this._chainOrCallSubCommandHook(B,F,"preSubcommand"),B=this._chainOrCall(B,()=>{if(F._executableHandler)this._executeSubCommand(F,_.concat(u));else return F._parseCommand(_,u)}),B}_dispatchHelpCommand(D){if(!D)this.help();let _=this._findCommand(D);if(_&&!_._executableHandler)_.help();return this._dispatchSubcommand(D,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){if(this.registeredArguments.forEach((D,_)=>{if(D.required&&this.args[_]==null)this.missingArgument(D.name())}),this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)return;if(this.args.length>this.registeredArguments.length)this._excessArguments(this.args)}_processArguments(){let D=(u,F,B)=>{let E=F;if(F!==null&&u.parseArg){let C=`error: command-argument value '${F}' is invalid for argument '${u.name()}'.`;E=this._callParseArg(u,F,B,C)}return E};this._checkNumberOfArguments();let _=[];this.registeredArguments.forEach((u,F)=>{let B=u.defaultValue;if(u.variadic){if(F<this.args.length){if(B=this.args.slice(F),u.parseArg)B=B.reduce((E,C)=>{return D(u,C,E)},u.defaultValue)}else if(B===void 0)B=[]}else if(F<this.args.length){if(B=this.args[F],u.parseArg)B=D(u,B,u.defaultValue)}_[F]=B}),this.processedArgs=_}_chainOrCall(D,_){if(D&&D.then&&typeof D.then==="function")return D.then(()=>_());return _()}_chainOrCallHooks(D,_){let u=D,F=[];if(this._getCommandAndAncestors().reverse().filter((B)=>B._lifeCycleHooks[_]!==void 0).forEach((B)=>{B._lifeCycleHooks[_].forEach((E)=>{F.push({hookedCommand:B,callback:E})})}),_==="postAction")F.reverse();return F.forEach((B)=>{u=this._chainOrCall(u,()=>{return B.callback(B.hookedCommand,this)})}),u}_chainOrCallSubCommandHook(D,_,u){let F=D;if(this._lifeCycleHooks[u]!==void 0)this._lifeCycleHooks[u].forEach((B)=>{F=this._chainOrCall(F,()=>{return B(this,_)})});return F}_parseCommand(D,_){let u=this.parseOptions(_);if(this._parseOptionsEnv(),this._parseOptionsImplied(),D=D.concat(u.operands),_=u.unknown,this.args=D.concat(_),D&&this._findCommand(D[0]))return this._dispatchSubcommand(D[0],D.slice(1),_);if(this._getHelpCommand()&&D[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(D[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(_),this._dispatchSubcommand(this._defaultCommandName,D,_);if(this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName)this.help({error:!0});this._outputHelpIfRequested(u.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let F=()=>{if(u.unknown.length>0)this.unknownOption(u.unknown[0])},B=`command:${this.name()}`;if(this._actionHandler){F(),this._processArguments();let E;if(E=this._chainOrCallHooks(E,"preAction"),E=this._chainOrCall(E,()=>this._actionHandler(this.processedArgs)),this.parent)E=this._chainOrCall(E,()=>{this.parent.emit(B,D,_)});return E=this._chainOrCallHooks(E,"postAction"),E}if(this.parent&&this.parent.listenerCount(B))F(),this._processArguments(),this.parent.emit(B,D,_);else if(D.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",D,_);if(this.listenerCount("command:*"))this.emit("command:*",D,_);else if(this.commands.length)this.unknownCommand();else F(),this._processArguments()}else if(this.commands.length)F(),this.help({error:!0});else F(),this._processArguments()}_findCommand(D){if(!D)return;return this.commands.find((_)=>_._name===D||_._aliases.includes(D))}_findOption(D){return this.options.find((_)=>_.is(D))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach((D)=>{D.options.forEach((_)=>{if(_.mandatory&&D.getOptionValue(_.attributeName())===void 0)D.missingMandatoryOptionValue(_)})})}_checkForConflictingLocalOptions(){let D=this.options.filter((u)=>{let F=u.attributeName();if(this.getOptionValue(F)===void 0)return!1;return this.getOptionValueSource(F)!=="default"});D.filter((u)=>u.conflictsWith.length>0).forEach((u)=>{let F=D.find((B)=>u.conflictsWith.includes(B.attributeName()));if(F)this._conflictingOption(u,F)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach((D)=>{D._checkForConflictingLocalOptions()})}parseOptions(D){let _=[],u=[],F=_,B=D.slice();function E($){return $.length>1&&$[0]==="-"}let C=null;while(B.length){let $=B.shift();if($==="--"){if(F===u)F.push($);F.push(...B);break}if(C&&!E($)){this.emit(`option:${C.name()}`,$);continue}if(C=null,E($)){let q=this._findOption($);if(q){if(q.required){let X=B.shift();if(X===void 0)this.optionMissingArgument(q);this.emit(`option:${q.name()}`,X)}else if(q.optional){let X=null;if(B.length>0&&!E(B[0]))X=B.shift();this.emit(`option:${q.name()}`,X)}else this.emit(`option:${q.name()}`);C=q.variadic?q:null;continue}}if($.length>2&&$[0]==="-"&&$[1]!=="-"){let q=this._findOption(`-${$[1]}`);if(q){if(q.required||q.optional&&this._combineFlagAndOptionalValue)this.emit(`option:${q.name()}`,$.slice(2));else this.emit(`option:${q.name()}`),B.unshift(`-${$.slice(2)}`);continue}}if(/^--[^=]+=/.test($)){let q=$.indexOf("="),X=this._findOption($.slice(0,q));if(X&&(X.required||X.optional)){this.emit(`option:${X.name()}`,$.slice(q+1));continue}}if(E($))F=u;if((this._enablePositionalOptions||this._passThroughOptions)&&_.length===0&&u.length===0){if(this._findCommand($)){if(_.push($),B.length>0)u.push(...B);break}else if(this._getHelpCommand()&&$===this._getHelpCommand().name()){if(_.push($),B.length>0)_.push(...B);break}else if(this._defaultCommandName){if(u.push($),B.length>0)u.push(...B);break}}if(this._passThroughOptions){if(F.push($),B.length>0)F.push(...B);break}F.push($)}return{operands:_,unknown:u}}opts(){if(this._storeOptionsAsProperties){let D={},_=this.options.length;for(let u=0;u<_;u++){let F=this.options[u].attributeName();D[F]=F===this._versionOptionName?this._version:this[F]}return D}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((D,_)=>Object.assign(D,_.opts()),{})}error(D,_){if(this._outputConfiguration.outputError(`${D}
22
22
  `,this._outputConfiguration.writeErr),typeof this._showHelpAfterError==="string")this._outputConfiguration.writeErr(`${this._showHelpAfterError}
23
23
  `);else if(this._showHelpAfterError)this._outputConfiguration.writeErr(`
24
- `),this.outputHelp({error:!0});let u=_||{},F=u.exitCode||1,B=u.code||"commander.error";this._exit(F,B,D)}_parseOptionsEnv(){this.options.forEach((D)=>{if(D.envVar&&D.envVar in b.env){let _=D.attributeName();if(this.getOptionValue(_)===void 0||["default","config","env"].includes(this.getOptionValueSource(_)))if(D.required||D.optional)this.emit(`optionEnv:${D.name()}`,b.env[D.envVar]);else this.emit(`optionEnv:${D.name()}`)}})}_parseOptionsImplied(){let D=new K9(this.options),_=(u)=>{return this.getOptionValue(u)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(u))};this.options.filter((u)=>u.implied!==void 0&&_(u.attributeName())&&D.valueFromOption(this.getOptionValue(u.attributeName()),u)).forEach((u)=>{Object.keys(u.implied).filter((F)=>!_(F)).forEach((F)=>{this.setOptionValueWithSource(F,u.implied[F],"implied")})})}missingArgument(D){let _=`error: missing required argument '${D}'`;this.error(_,{code:"commander.missingArgument"})}optionMissingArgument(D){let _=`error: option '${D.flags}' argument missing`;this.error(_,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(D){let _=`error: required option '${D.flags}' not specified`;this.error(_,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(D,_){let u=(E)=>{let C=E.attributeName(),$=this.getOptionValue(C),q=this.options.find((G)=>G.negate&&C===G.attributeName()),X=this.options.find((G)=>!G.negate&&C===G.attributeName());if(q&&(q.presetArg===void 0&&$===!1||q.presetArg!==void 0&&$===q.presetArg))return q;return X||E},F=(E)=>{let C=u(E),$=C.attributeName();if(this.getOptionValueSource($)==="env")return`environment variable '${C.envVar}'`;return`option '${C.flags}'`},B=`error: ${F(D)} cannot be used with ${F(_)}`;this.error(B,{code:"commander.conflictingOption"})}unknownOption(D){if(this._allowUnknownOption)return;let _="";if(D.startsWith("--")&&this._showSuggestionAfterError){let F=[],B=this;do{let E=B.createHelp().visibleOptions(B).filter((C)=>C.long).map((C)=>C.long);F=F.concat(E),B=B.parent}while(B&&!B._enablePositionalOptions);_=t8(D,F)}let u=`error: unknown option '${D}'${_}`;this.error(u,{code:"commander.unknownOption"})}_excessArguments(D){if(this._allowExcessArguments)return;let _=this.registeredArguments.length,u=_===1?"":"s",B=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${_} argument${u} but got ${D.length}.`;this.error(B,{code:"commander.excessArguments"})}unknownCommand(){let D=this.args[0],_="";if(this._showSuggestionAfterError){let F=[];this.createHelp().visibleCommands(this).forEach((B)=>{if(F.push(B.name()),B.alias())F.push(B.alias())}),_=t8(D,F)}let u=`error: unknown command '${D}'${_}`;this.error(u,{code:"commander.unknownCommand"})}version(D,_,u){if(D===void 0)return this._version;this._version=D,_=_||"-V, --version",u=u||"output the version number";let F=this.createOption(_,u);return this._versionOptionName=F.attributeName(),this._registerOption(F),this.on("option:"+F.name(),()=>{this._outputConfiguration.writeOut(`${D}
25
- `),this._exit(0,"commander.version",D)}),this}description(D,_){if(D===void 0&&_===void 0)return this._description;if(this._description=D,_)this._argsDescription=_;return this}summary(D){if(D===void 0)return this._summary;return this._summary=D,this}alias(D){if(D===void 0)return this._aliases[0];let _=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler)_=this.commands[this.commands.length-1];if(D===_._name)throw new Error("Command alias can't be the same as its name");let u=this.parent?._findCommand(D);if(u){let F=[u.name()].concat(u.aliases()).join("|");throw new Error(`cannot add alias '${D}' to command '${this.name()}' as already have command '${F}'`)}return _._aliases.push(D),this}aliases(D){if(D===void 0)return this._aliases;return D.forEach((_)=>this.alias(_)),this}usage(D){if(D===void 0){if(this._usage)return this._usage;let _=this.registeredArguments.map((u)=>{return Z9(u)});return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?_:[]).join(" ")}return this._usage=D,this}name(D){if(D===void 0)return this._name;return this._name=D,this}nameFromFilename(D){return this._name=wD.basename(D,wD.extname(D)),this}executableDir(D){if(D===void 0)return this._executableDir;return this._executableDir=D,this}helpInformation(D){let _=this.createHelp(),u=this._getOutputContext(D);_.prepareContext({error:u.error,helpWidth:u.helpWidth,outputHasColors:u.hasColors});let F=_.formatHelp(this,_);if(u.hasColors)return F;return this._outputConfiguration.stripColor(F)}_getOutputContext(D){D=D||{};let _=!!D.error,u,F,B;if(_)u=(C)=>this._outputConfiguration.writeErr(C),F=this._outputConfiguration.getErrHasColors(),B=this._outputConfiguration.getErrHelpWidth();else u=(C)=>this._outputConfiguration.writeOut(C),F=this._outputConfiguration.getOutHasColors(),B=this._outputConfiguration.getOutHelpWidth();return{error:_,write:(C)=>{if(!F)C=this._outputConfiguration.stripColor(C);return u(C)},hasColors:F,helpWidth:B}}outputHelp(D){let _;if(typeof D==="function")_=D,D=void 0;let u=this._getOutputContext(D),F={error:u.error,write:u.write,command:this};this._getCommandAndAncestors().reverse().forEach((E)=>E.emit("beforeAllHelp",F)),this.emit("beforeHelp",F);let B=this.helpInformation({error:u.error});if(_){if(B=_(B),typeof B!=="string"&&!Buffer.isBuffer(B))throw new Error("outputHelp callback must return a string or a Buffer")}if(u.write(B),this._getHelpOption()?.long)this.emit(this._getHelpOption().long);this.emit("afterHelp",F),this._getCommandAndAncestors().forEach((E)=>E.emit("afterAllHelp",F))}helpOption(D,_){if(typeof D==="boolean"){if(D)this._helpOption=this._helpOption??void 0;else this._helpOption=null;return this}return D=D??"-h, --help",_=_??"display help for command",this._helpOption=this.createOption(D,_),this}_getHelpOption(){if(this._helpOption===void 0)this.helpOption(void 0,void 0);return this._helpOption}addHelpOption(D){return this._helpOption=D,this}help(D){this.outputHelp(D);let _=Number(b.exitCode??0);if(_===0&&D&&typeof D!=="function"&&D.error)_=1;this._exit(_,"commander.help","(outputHelp)")}addHelpText(D,_){let u=["beforeAll","before","after","afterAll"];if(!u.includes(D))throw new Error(`Unexpected value for position to addHelpText.
24
+ `),this.outputHelp({error:!0});let u=_||{},F=u.exitCode||1,B=u.code||"commander.error";this._exit(F,B,D)}_parseOptionsEnv(){this.options.forEach((D)=>{if(D.envVar&&D.envVar in b.env){let _=D.attributeName();if(this.getOptionValue(_)===void 0||["default","config","env"].includes(this.getOptionValueSource(_)))if(D.required||D.optional)this.emit(`optionEnv:${D.name()}`,b.env[D.envVar]);else this.emit(`optionEnv:${D.name()}`)}})}_parseOptionsImplied(){let D=new U9(this.options),_=(u)=>{return this.getOptionValue(u)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(u))};this.options.filter((u)=>u.implied!==void 0&&_(u.attributeName())&&D.valueFromOption(this.getOptionValue(u.attributeName()),u)).forEach((u)=>{Object.keys(u.implied).filter((F)=>!_(F)).forEach((F)=>{this.setOptionValueWithSource(F,u.implied[F],"implied")})})}missingArgument(D){let _=`error: missing required argument '${D}'`;this.error(_,{code:"commander.missingArgument"})}optionMissingArgument(D){let _=`error: option '${D.flags}' argument missing`;this.error(_,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(D){let _=`error: required option '${D.flags}' not specified`;this.error(_,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(D,_){let u=(E)=>{let C=E.attributeName(),$=this.getOptionValue(C),q=this.options.find((G)=>G.negate&&C===G.attributeName()),X=this.options.find((G)=>!G.negate&&C===G.attributeName());if(q&&(q.presetArg===void 0&&$===!1||q.presetArg!==void 0&&$===q.presetArg))return q;return X||E},F=(E)=>{let C=u(E),$=C.attributeName();if(this.getOptionValueSource($)==="env")return`environment variable '${C.envVar}'`;return`option '${C.flags}'`},B=`error: ${F(D)} cannot be used with ${F(_)}`;this.error(B,{code:"commander.conflictingOption"})}unknownOption(D){if(this._allowUnknownOption)return;let _="";if(D.startsWith("--")&&this._showSuggestionAfterError){let F=[],B=this;do{let E=B.createHelp().visibleOptions(B).filter((C)=>C.long).map((C)=>C.long);F=F.concat(E),B=B.parent}while(B&&!B._enablePositionalOptions);_=A1(D,F)}let u=`error: unknown option '${D}'${_}`;this.error(u,{code:"commander.unknownOption"})}_excessArguments(D){if(this._allowExcessArguments)return;let _=this.registeredArguments.length,u=_===1?"":"s",B=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${_} argument${u} but got ${D.length}.`;this.error(B,{code:"commander.excessArguments"})}unknownCommand(){let D=this.args[0],_="";if(this._showSuggestionAfterError){let F=[];this.createHelp().visibleCommands(this).forEach((B)=>{if(F.push(B.name()),B.alias())F.push(B.alias())}),_=A1(D,F)}let u=`error: unknown command '${D}'${_}`;this.error(u,{code:"commander.unknownCommand"})}version(D,_,u){if(D===void 0)return this._version;this._version=D,_=_||"-V, --version",u=u||"output the version number";let F=this.createOption(_,u);return this._versionOptionName=F.attributeName(),this._registerOption(F),this.on("option:"+F.name(),()=>{this._outputConfiguration.writeOut(`${D}
25
+ `),this._exit(0,"commander.version",D)}),this}description(D,_){if(D===void 0&&_===void 0)return this._description;if(this._description=D,_)this._argsDescription=_;return this}summary(D){if(D===void 0)return this._summary;return this._summary=D,this}alias(D){if(D===void 0)return this._aliases[0];let _=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler)_=this.commands[this.commands.length-1];if(D===_._name)throw new Error("Command alias can't be the same as its name");let u=this.parent?._findCommand(D);if(u){let F=[u.name()].concat(u.aliases()).join("|");throw new Error(`cannot add alias '${D}' to command '${this.name()}' as already have command '${F}'`)}return _._aliases.push(D),this}aliases(D){if(D===void 0)return this._aliases;return D.forEach((_)=>this.alias(_)),this}usage(D){if(D===void 0){if(this._usage)return this._usage;let _=this.registeredArguments.map((u)=>{return J9(u)});return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?_:[]).join(" ")}return this._usage=D,this}name(D){if(D===void 0)return this._name;return this._name=D,this}nameFromFilename(D){return this._name=yD.basename(D,yD.extname(D)),this}executableDir(D){if(D===void 0)return this._executableDir;return this._executableDir=D,this}helpInformation(D){let _=this.createHelp(),u=this._getOutputContext(D);_.prepareContext({error:u.error,helpWidth:u.helpWidth,outputHasColors:u.hasColors});let F=_.formatHelp(this,_);if(u.hasColors)return F;return this._outputConfiguration.stripColor(F)}_getOutputContext(D){D=D||{};let _=!!D.error,u,F,B;if(_)u=(C)=>this._outputConfiguration.writeErr(C),F=this._outputConfiguration.getErrHasColors(),B=this._outputConfiguration.getErrHelpWidth();else u=(C)=>this._outputConfiguration.writeOut(C),F=this._outputConfiguration.getOutHasColors(),B=this._outputConfiguration.getOutHelpWidth();return{error:_,write:(C)=>{if(!F)C=this._outputConfiguration.stripColor(C);return u(C)},hasColors:F,helpWidth:B}}outputHelp(D){let _;if(typeof D==="function")_=D,D=void 0;let u=this._getOutputContext(D),F={error:u.error,write:u.write,command:this};this._getCommandAndAncestors().reverse().forEach((E)=>E.emit("beforeAllHelp",F)),this.emit("beforeHelp",F);let B=this.helpInformation({error:u.error});if(_){if(B=_(B),typeof B!=="string"&&!Buffer.isBuffer(B))throw new Error("outputHelp callback must return a string or a Buffer")}if(u.write(B),this._getHelpOption()?.long)this.emit(this._getHelpOption().long);this.emit("afterHelp",F),this._getCommandAndAncestors().forEach((E)=>E.emit("afterAllHelp",F))}helpOption(D,_){if(typeof D==="boolean"){if(D)this._helpOption=this._helpOption??void 0;else this._helpOption=null;return this}return D=D??"-h, --help",_=_??"display help for command",this._helpOption=this.createOption(D,_),this}_getHelpOption(){if(this._helpOption===void 0)this.helpOption(void 0,void 0);return this._helpOption}addHelpOption(D){return this._helpOption=D,this}help(D){this.outputHelp(D);let _=Number(b.exitCode??0);if(_===0&&D&&typeof D!=="function"&&D.error)_=1;this._exit(_,"commander.help","(outputHelp)")}addHelpText(D,_){let u=["beforeAll","before","after","afterAll"];if(!u.includes(D))throw new Error(`Unexpected value for position to addHelpText.
26
26
  Expecting one of '${u.join("', '")}'`);let F=`${D}Help`;return this.on(F,(B)=>{let E;if(typeof _==="function")E=_({error:B.error,command:B.command});else E=_;if(E)B.write(`${E}
27
- `)}),this}_outputHelpIfRequested(D){let _=this._getHelpOption();if(_&&D.find((F)=>_.is(F)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function e8(D){return D.map((_)=>{if(!_.startsWith("--inspect"))return _;let u,F="127.0.0.1",B="9229",E;if((E=_.match(/^(--inspect(-brk)?)$/))!==null)u=E[1];else if((E=_.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null)if(u=E[1],/^\d+$/.test(E[3]))B=E[3];else F=E[3];else if((E=_.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null)u=E[1],F=E[3],B=E[4];if(u&&B!=="0")return`${u}=${F}:${parseInt(B)+1}`;return _})}function U3(){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;return}U9.Command=H3;U9.useColor=U3});var B1=N((V9)=>{var{Argument:_1}=G2(),{Command:M3}=D1(),{CommanderError:W9,InvalidArgumentError:u1}=S0(),{Help:A9}=Z3(),{Option:F1}=J3();V9.program=new M3;V9.createCommand=(D)=>new M3(D);V9.createOption=(D,_)=>new F1(D,_);V9.createArgument=(D,_)=>new _1(D,_);V9.Command=M3;V9.Option=F1;V9.Argument=_1;V9.Help=A9;V9.CommanderError=W9;V9.InvalidArgumentError=u1;V9.InvalidOptionArgumentError=u1});var v0=N((TE,X1)=>{var k9=x("node:tty"),v9=k9?.WriteStream?.prototype?.hasColors?.()??!1,w=(D,_)=>{if(!v9)return(B)=>B;let u=`\x1B[${D}m`,F=`\x1B[${_}m`;return(B)=>{let E=B+"",C=E.indexOf(F);if(C===-1)return u+E+F;let $=u,q=0;while(C!==-1)$+=E.slice(q,C)+u,q=C+F.length,C=E.indexOf(F,q);return $+=E.slice(q)+F,$}},Y={};Y.reset=w(0,0);Y.bold=w(1,22);Y.dim=w(2,22);Y.italic=w(3,23);Y.underline=w(4,24);Y.overline=w(53,55);Y.inverse=w(7,27);Y.hidden=w(8,28);Y.strikethrough=w(9,29);Y.black=w(30,39);Y.red=w(31,39);Y.green=w(32,39);Y.yellow=w(33,39);Y.blue=w(34,39);Y.magenta=w(35,39);Y.cyan=w(36,39);Y.white=w(37,39);Y.gray=w(90,39);Y.bgBlack=w(40,49);Y.bgRed=w(41,49);Y.bgGreen=w(42,49);Y.bgYellow=w(43,49);Y.bgBlue=w(44,49);Y.bgMagenta=w(45,49);Y.bgCyan=w(46,49);Y.bgWhite=w(47,49);Y.bgGray=w(100,49);Y.redBright=w(91,39);Y.greenBright=w(92,39);Y.yellowBright=w(93,39);Y.blueBright=w(94,39);Y.magentaBright=w(95,39);Y.cyanBright=w(96,39);Y.whiteBright=w(97,39);Y.bgRedBright=w(101,49);Y.bgGreenBright=w(102,49);Y.bgYellowBright=w(103,49);Y.bgBlueBright=w(104,49);Y.bgMagentaBright=w(105,49);Y.bgCyanBright=w(106,49);Y.bgWhiteBright=w(107,49);X1.exports=Y});var W1=N((iE,M1)=>{M1.exports=p9;function c9(D){let _={defaultWidth:0,output:process.stdout,tty:x("tty")};if(!D)return _;return Object.keys(_).forEach(function(u){if(!D[u])D[u]=_[u]}),D}function p9(D){let _=c9(D);if(_.output.getWindowSize)return _.output.getWindowSize()[0]||_.defaultWidth;if(_.tty.getWindowSize)return _.tty.getWindowSize()[1]||_.defaultWidth;if(_.output.columns)return _.output.columns;if(process.env.CLI_WIDTH){let u=parseInt(process.env.CLI_WIDTH,10);if(!isNaN(u)&&u!==0)return u}return _.defaultWidth}});var V1=N((nE,A1)=>{A1.exports=({onlyFirst:D=!1}={})=>{let _=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(_,D?void 0:"g")}});var T3=N((aE,L1)=>{var l9=V1();L1.exports=(D)=>typeof D==="string"?D.replace(l9(),""):D});var R1=N((sE,j3)=>{var I1=(D)=>{if(Number.isNaN(D))return!1;if(D>=4352&&(D<=4447||D===9001||D===9002||11904<=D&&D<=12871&&D!==12351||12880<=D&&D<=19903||19968<=D&&D<=42182||43360<=D&&D<=43388||44032<=D&&D<=55203||63744<=D&&D<=64255||65040<=D&&D<=65049||65072<=D&&D<=65131||65281<=D&&D<=65376||65504<=D&&D<=65510||110592<=D&&D<=110593||127488<=D&&D<=127569||131072<=D&&D<=262141))return!0;return!1};j3.exports=I1;j3.exports.default=I1});var T1=N((rE,N1)=>{N1.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\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\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])|\uD83C[\uDF3E\uDF73\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])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\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])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\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\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\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\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\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\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*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\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\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\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[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}});var x3=N((oE,O3)=>{var i9=T3(),n9=R1(),a9=T1(),j1=(D)=>{if(typeof D!=="string"||D.length===0)return 0;if(D=i9(D),D.length===0)return 0;D=D.replace(a9()," ");let _=0;for(let u=0;u<D.length;u++){let F=D.codePointAt(u);if(F<=31||F>=127&&F<=159)continue;if(F>=768&&F<=879)continue;if(F>65535)u++;_+=n9(F)?2:1}return _};O3.exports=j1;O3.exports.default=j1});var x1=N((tE,O1)=>{O1.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var P3=N((eE,z1)=>{var b0=x1(),P1={};for(let D of Object.keys(b0))P1[b0[D]]=D;var R={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};z1.exports=R;for(let D of Object.keys(R)){if(!("channels"in R[D]))throw new Error("missing channels property: "+D);if(!("labels"in R[D]))throw new Error("missing channel labels property: "+D);if(R[D].labels.length!==R[D].channels)throw new Error("channel and label counts mismatch: "+D);let{channels:_,labels:u}=R[D];delete R[D].channels,delete R[D].labels,Object.defineProperty(R[D],"channels",{value:_}),Object.defineProperty(R[D],"labels",{value:u})}R.rgb.hsl=function(D){let _=D[0]/255,u=D[1]/255,F=D[2]/255,B=Math.min(_,u,F),E=Math.max(_,u,F),C=E-B,$,q;if(E===B)$=0;else if(_===E)$=(u-F)/C;else if(u===E)$=2+(F-_)/C;else if(F===E)$=4+(_-u)/C;if($=Math.min($*60,360),$<0)$+=360;let X=(B+E)/2;if(E===B)q=0;else if(X<=0.5)q=C/(E+B);else q=C/(2-E-B);return[$,q*100,X*100]};R.rgb.hsv=function(D){let _,u,F,B,E,C=D[0]/255,$=D[1]/255,q=D[2]/255,X=Math.max(C,$,q),G=X-Math.min(C,$,q),Z=function(J){return(X-J)/6/G+0.5};if(G===0)B=0,E=0;else{if(E=G/X,_=Z(C),u=Z($),F=Z(q),C===X)B=F-u;else if($===X)B=0.3333333333333333+_-F;else if(q===X)B=0.6666666666666666+u-_;if(B<0)B+=1;else if(B>1)B-=1}return[B*360,E*100,X*100]};R.rgb.hwb=function(D){let _=D[0],u=D[1],F=D[2],B=R.rgb.hsl(D)[0],E=0.00392156862745098*Math.min(_,Math.min(u,F));return F=1-0.00392156862745098*Math.max(_,Math.max(u,F)),[B,E*100,F*100]};R.rgb.cmyk=function(D){let _=D[0]/255,u=D[1]/255,F=D[2]/255,B=Math.min(1-_,1-u,1-F),E=(1-_-B)/(1-B)||0,C=(1-u-B)/(1-B)||0,$=(1-F-B)/(1-B)||0;return[E*100,C*100,$*100,B*100]};function s9(D,_){return(D[0]-_[0])**2+(D[1]-_[1])**2+(D[2]-_[2])**2}R.rgb.keyword=function(D){let _=P1[D];if(_)return _;let u=1/0,F;for(let B of Object.keys(b0)){let E=b0[B],C=s9(D,E);if(C<u)u=C,F=B}return F};R.keyword.rgb=function(D){return b0[D]};R.rgb.xyz=function(D){let _=D[0]/255,u=D[1]/255,F=D[2]/255;_=_>0.04045?((_+0.055)/1.055)**2.4:_/12.92,u=u>0.04045?((u+0.055)/1.055)**2.4:u/12.92,F=F>0.04045?((F+0.055)/1.055)**2.4:F/12.92;let B=_*0.4124+u*0.3576+F*0.1805,E=_*0.2126+u*0.7152+F*0.0722,C=_*0.0193+u*0.1192+F*0.9505;return[B*100,E*100,C*100]};R.rgb.lab=function(D){let _=R.rgb.xyz(D),u=_[0],F=_[1],B=_[2];u/=95.047,F/=100,B/=108.883,u=u>0.008856?u**0.3333333333333333:7.787*u+0.13793103448275862,F=F>0.008856?F**0.3333333333333333:7.787*F+0.13793103448275862,B=B>0.008856?B**0.3333333333333333:7.787*B+0.13793103448275862;let E=116*F-16,C=500*(u-F),$=200*(F-B);return[E,C,$]};R.hsl.rgb=function(D){let _=D[0]/360,u=D[1]/100,F=D[2]/100,B,E,C;if(u===0)return C=F*255,[C,C,C];if(F<0.5)B=F*(1+u);else B=F+u-F*u;let $=2*F-B,q=[0,0,0];for(let X=0;X<3;X++){if(E=_+0.3333333333333333*-(X-1),E<0)E++;if(E>1)E--;if(6*E<1)C=$+(B-$)*6*E;else if(2*E<1)C=B;else if(3*E<2)C=$+(B-$)*(0.6666666666666666-E)*6;else C=$;q[X]=C*255}return q};R.hsl.hsv=function(D){let _=D[0],u=D[1]/100,F=D[2]/100,B=u,E=Math.max(F,0.01);F*=2,u*=F<=1?F:2-F,B*=E<=1?E:2-E;let C=(F+u)/2,$=F===0?2*B/(E+B):2*u/(F+u);return[_,$*100,C*100]};R.hsv.rgb=function(D){let _=D[0]/60,u=D[1]/100,F=D[2]/100,B=Math.floor(_)%6,E=_-Math.floor(_),C=255*F*(1-u),$=255*F*(1-u*E),q=255*F*(1-u*(1-E));switch(F*=255,B){case 0:return[F,q,C];case 1:return[$,F,C];case 2:return[C,F,q];case 3:return[C,$,F];case 4:return[q,C,F];case 5:return[F,C,$]}};R.hsv.hsl=function(D){let _=D[0],u=D[1]/100,F=D[2]/100,B=Math.max(F,0.01),E,C;C=(2-u)*F;let $=(2-u)*B;return E=u*B,E/=$<=1?$:2-$,E=E||0,C/=2,[_,E*100,C*100]};R.hwb.rgb=function(D){let _=D[0]/360,u=D[1]/100,F=D[2]/100,B=u+F,E;if(B>1)u/=B,F/=B;let C=Math.floor(6*_),$=1-F;if(E=6*_-C,(C&1)!==0)E=1-E;let q=u+E*($-u),X,G,Z;switch(C){default:case 6:case 0:X=$,G=q,Z=u;break;case 1:X=q,G=$,Z=u;break;case 2:X=u,G=$,Z=q;break;case 3:X=u,G=q,Z=$;break;case 4:X=q,G=u,Z=$;break;case 5:X=$,G=u,Z=q;break}return[X*255,G*255,Z*255]};R.cmyk.rgb=function(D){let _=D[0]/100,u=D[1]/100,F=D[2]/100,B=D[3]/100,E=1-Math.min(1,_*(1-B)+B),C=1-Math.min(1,u*(1-B)+B),$=1-Math.min(1,F*(1-B)+B);return[E*255,C*255,$*255]};R.xyz.rgb=function(D){let _=D[0]/100,u=D[1]/100,F=D[2]/100,B,E,C;return B=_*3.2406+u*-1.5372+F*-0.4986,E=_*-0.9689+u*1.8758+F*0.0415,C=_*0.0557+u*-0.204+F*1.057,B=B>0.0031308?1.055*B**0.4166666666666667-0.055:B*12.92,E=E>0.0031308?1.055*E**0.4166666666666667-0.055:E*12.92,C=C>0.0031308?1.055*C**0.4166666666666667-0.055:C*12.92,B=Math.min(Math.max(0,B),1),E=Math.min(Math.max(0,E),1),C=Math.min(Math.max(0,C),1),[B*255,E*255,C*255]};R.xyz.lab=function(D){let _=D[0],u=D[1],F=D[2];_/=95.047,u/=100,F/=108.883,_=_>0.008856?_**0.3333333333333333:7.787*_+0.13793103448275862,u=u>0.008856?u**0.3333333333333333:7.787*u+0.13793103448275862,F=F>0.008856?F**0.3333333333333333:7.787*F+0.13793103448275862;let B=116*u-16,E=500*(_-u),C=200*(u-F);return[B,E,C]};R.lab.xyz=function(D){let _=D[0],u=D[1],F=D[2],B,E,C;E=(_+16)/116,B=u/500+E,C=E-F/200;let $=E**3,q=B**3,X=C**3;return E=$>0.008856?$:(E-0.13793103448275862)/7.787,B=q>0.008856?q:(B-0.13793103448275862)/7.787,C=X>0.008856?X:(C-0.13793103448275862)/7.787,B*=95.047,E*=100,C*=108.883,[B,E,C]};R.lab.lch=function(D){let _=D[0],u=D[1],F=D[2],B;if(B=Math.atan2(F,u)*360/2/Math.PI,B<0)B+=360;let C=Math.sqrt(u*u+F*F);return[_,C,B]};R.lch.lab=function(D){let _=D[0],u=D[1],B=D[2]/360*2*Math.PI,E=u*Math.cos(B),C=u*Math.sin(B);return[_,E,C]};R.rgb.ansi16=function(D,_=null){let[u,F,B]=D,E=_===null?R.rgb.hsv(D)[2]:_;if(E=Math.round(E/50),E===0)return 30;let C=30+(Math.round(B/255)<<2|Math.round(F/255)<<1|Math.round(u/255));if(E===2)C+=60;return C};R.hsv.ansi16=function(D){return R.rgb.ansi16(R.hsv.rgb(D),D[2])};R.rgb.ansi256=function(D){let _=D[0],u=D[1],F=D[2];if(_===u&&u===F){if(_<8)return 16;if(_>248)return 231;return Math.round((_-8)/247*24)+232}return 16+36*Math.round(_/255*5)+6*Math.round(u/255*5)+Math.round(F/255*5)};R.ansi16.rgb=function(D){let _=D%10;if(_===0||_===7){if(D>50)_+=3.5;return _=_/10.5*255,[_,_,_]}let u=(~~(D>50)+1)*0.5,F=(_&1)*u*255,B=(_>>1&1)*u*255,E=(_>>2&1)*u*255;return[F,B,E]};R.ansi256.rgb=function(D){if(D>=232){let E=(D-232)*10+8;return[E,E,E]}D-=16;let _,u=Math.floor(D/36)/5*255,F=Math.floor((_=D%36)/6)/5*255,B=_%6/5*255;return[u,F,B]};R.rgb.hex=function(D){let u=(((Math.round(D[0])&255)<<16)+((Math.round(D[1])&255)<<8)+(Math.round(D[2])&255)).toString(16).toUpperCase();return"000000".substring(u.length)+u};R.hex.rgb=function(D){let _=D.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!_)return[0,0,0];let u=_[0];if(_[0].length===3)u=u.split("").map(($)=>{return $+$}).join("");let F=parseInt(u,16),B=F>>16&255,E=F>>8&255,C=F&255;return[B,E,C]};R.rgb.hcg=function(D){let _=D[0]/255,u=D[1]/255,F=D[2]/255,B=Math.max(Math.max(_,u),F),E=Math.min(Math.min(_,u),F),C=B-E,$,q;if(C<1)$=E/(1-C);else $=0;if(C<=0)q=0;else if(B===_)q=(u-F)/C%6;else if(B===u)q=2+(F-_)/C;else q=4+(_-u)/C;return q/=6,q%=1,[q*360,C*100,$*100]};R.hsl.hcg=function(D){let _=D[1]/100,u=D[2]/100,F=u<0.5?2*_*u:2*_*(1-u),B=0;if(F<1)B=(u-0.5*F)/(1-F);return[D[0],F*100,B*100]};R.hsv.hcg=function(D){let _=D[1]/100,u=D[2]/100,F=_*u,B=0;if(F<1)B=(u-F)/(1-F);return[D[0],F*100,B*100]};R.hcg.rgb=function(D){let _=D[0]/360,u=D[1]/100,F=D[2]/100;if(u===0)return[F*255,F*255,F*255];let B=[0,0,0],E=_%1*6,C=E%1,$=1-C,q=0;switch(Math.floor(E)){case 0:B[0]=1,B[1]=C,B[2]=0;break;case 1:B[0]=$,B[1]=1,B[2]=0;break;case 2:B[0]=0,B[1]=1,B[2]=C;break;case 3:B[0]=0,B[1]=$,B[2]=1;break;case 4:B[0]=C,B[1]=0,B[2]=1;break;default:B[0]=1,B[1]=0,B[2]=$}return q=(1-u)*F,[(u*B[0]+q)*255,(u*B[1]+q)*255,(u*B[2]+q)*255]};R.hcg.hsv=function(D){let _=D[1]/100,u=D[2]/100,F=_+u*(1-_),B=0;if(F>0)B=_/F;return[D[0],B*100,F*100]};R.hcg.hsl=function(D){let _=D[1]/100,F=D[2]/100*(1-_)+0.5*_,B=0;if(F>0&&F<0.5)B=_/(2*F);else if(F>=0.5&&F<1)B=_/(2*(1-F));return[D[0],B*100,F*100]};R.hcg.hwb=function(D){let _=D[1]/100,u=D[2]/100,F=_+u*(1-_);return[D[0],(F-_)*100,(1-F)*100]};R.hwb.hcg=function(D){let _=D[1]/100,F=1-D[2]/100,B=F-_,E=0;if(B<1)E=(F-B)/(1-B);return[D[0],B*100,E*100]};R.apple.rgb=function(D){return[D[0]/65535*255,D[1]/65535*255,D[2]/65535*255]};R.rgb.apple=function(D){return[D[0]/255*65535,D[1]/255*65535,D[2]/255*65535]};R.gray.rgb=function(D){return[D[0]/100*255,D[0]/100*255,D[0]/100*255]};R.gray.hsl=function(D){return[0,0,D[0]]};R.gray.hsv=R.gray.hsl;R.gray.hwb=function(D){return[0,100,D[0]]};R.gray.cmyk=function(D){return[0,0,0,D[0]]};R.gray.lab=function(D){return[D[0],0,0]};R.gray.hex=function(D){let _=Math.round(D[0]/100*255)&255,F=((_<<16)+(_<<8)+_).toString(16).toUpperCase();return"000000".substring(F.length)+F};R.rgb.gray=function(D){return[(D[0]+D[1]+D[2])/3/255*100]}});var w1=N((DC,Y1)=>{var J2=P3();function r9(){let D={},_=Object.keys(J2);for(let u=_.length,F=0;F<u;F++)D[_[F]]={distance:-1,parent:null};return D}function o9(D){let _=r9(),u=[D];_[D].distance=0;while(u.length){let F=u.pop(),B=Object.keys(J2[F]);for(let E=B.length,C=0;C<E;C++){let $=B[C],q=_[$];if(q.distance===-1)q.distance=_[F].distance+1,q.parent=F,u.unshift($)}}return _}function t9(D,_){return function(u){return _(D(u))}}function e9(D,_){let u=[_[D].parent,D],F=J2[_[D].parent][D],B=_[D].parent;while(_[B].parent)u.unshift(_[B].parent),F=t9(J2[_[B].parent][B],F),B=_[B].parent;return F.conversion=u,F}Y1.exports=function(D){let _=o9(D),u={},F=Object.keys(_);for(let B=F.length,E=0;E<B;E++){let C=F[E];if(_[C].parent===null)continue;u[C]=e9(C,_)}return u}});var y1=N((_C,S1)=>{var z3=P3(),D7=w1(),M0={},_7=Object.keys(z3);function u7(D){let _=function(...u){let F=u[0];if(F===void 0||F===null)return F;if(F.length>1)u=F;return D(u)};if("conversion"in D)_.conversion=D.conversion;return _}function F7(D){let _=function(...u){let F=u[0];if(F===void 0||F===null)return F;if(F.length>1)u=F;let B=D(u);if(typeof B==="object")for(let E=B.length,C=0;C<E;C++)B[C]=Math.round(B[C]);return B};if("conversion"in D)_.conversion=D.conversion;return _}_7.forEach((D)=>{M0[D]={},Object.defineProperty(M0[D],"channels",{value:z3[D].channels}),Object.defineProperty(M0[D],"labels",{value:z3[D].labels});let _=D7(D);Object.keys(_).forEach((F)=>{let B=_[F];M0[D][F]=F7(B),M0[D][F].raw=u7(B)})});S1.exports=M0});var d1=N((uC,m1)=>{var k1=(D,_)=>(...u)=>{return`\x1B[${D(...u)+_}m`},v1=(D,_)=>(...u)=>{let F=D(...u);return`\x1B[${38+_};5;${F}m`},b1=(D,_)=>(...u)=>{let F=D(...u);return`\x1B[${38+_};2;${F[0]};${F[1]};${F[2]}m`},Q2=(D)=>D,h1=(D,_,u)=>[D,_,u],W0=(D,_,u)=>{Object.defineProperty(D,_,{get:()=>{let F=u();return Object.defineProperty(D,_,{value:F,enumerable:!0,configurable:!0}),F},enumerable:!0,configurable:!0})},Y3,A0=(D,_,u,F)=>{if(Y3===void 0)Y3=y1();let B=F?10:0,E={};for(let[C,$]of Object.entries(Y3)){let q=C==="ansi16"?"ansi":C;if(C===_)E[q]=D(u,B);else if(typeof $==="object")E[q]=D($[_],B)}return E};function B7(){let D=new Map,_={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],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],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],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};_.color.gray=_.color.blackBright,_.bgColor.bgGray=_.bgColor.bgBlackBright,_.color.grey=_.color.blackBright,_.bgColor.bgGrey=_.bgColor.bgBlackBright;for(let[u,F]of Object.entries(_)){for(let[B,E]of Object.entries(F))_[B]={open:`\x1B[${E[0]}m`,close:`\x1B[${E[1]}m`},F[B]=_[B],D.set(E[0],E[1]);Object.defineProperty(_,u,{value:F,enumerable:!1})}return Object.defineProperty(_,"codes",{value:D,enumerable:!1}),_.color.close="\x1B[39m",_.bgColor.close="\x1B[49m",W0(_.color,"ansi",()=>A0(k1,"ansi16",Q2,!1)),W0(_.color,"ansi256",()=>A0(v1,"ansi256",Q2,!1)),W0(_.color,"ansi16m",()=>A0(b1,"rgb",h1,!1)),W0(_.bgColor,"ansi",()=>A0(k1,"ansi16",Q2,!0)),W0(_.bgColor,"ansi256",()=>A0(v1,"ansi256",Q2,!0)),W0(_.bgColor,"ansi16m",()=>A0(b1,"rgb",h1,!0)),_}Object.defineProperty(m1,"exports",{enumerable:!0,get:B7})});var c1=N((FC,f1)=>{var h0=x3(),E7=T3(),C7=d1(),S3=new Set(["\x1B","›"]),g1=(D)=>`${S3.values().next().value}[${D}m`,$7=(D)=>D.split(" ").map((_)=>h0(_)),w3=(D,_,u)=>{let F=[..._],B=!1,E=h0(E7(D[D.length-1]));for(let[C,$]of F.entries()){let q=h0($);if(E+q<=u)D[D.length-1]+=$;else D.push($),E=0;if(S3.has($))B=!0;else if(B&&$==="m"){B=!1;continue}if(B)continue;if(E+=q,E===u&&C<F.length-1)D.push(""),E=0}if(!E&&D[D.length-1].length>0&&D.length>1)D[D.length-2]+=D.pop()},G7=(D)=>{let _=D.split(" "),u=_.length;while(u>0){if(h0(_[u-1])>0)break;u--}if(u===_.length)return D;return _.slice(0,u).join(" ")+_.slice(u).join("")},q7=(D,_,u={})=>{if(u.trim!==!1&&D.trim()==="")return"";let F="",B="",E,C=$7(D),$=[""];for(let[q,X]of D.split(" ").entries()){if(u.trim!==!1)$[$.length-1]=$[$.length-1].trimLeft();let G=h0($[$.length-1]);if(q!==0){if(G>=_&&(u.wordWrap===!1||u.trim===!1))$.push(""),G=0;if(G>0||u.trim===!1)$[$.length-1]+=" ",G++}if(u.hard&&C[q]>_){let Z=_-G,J=1+Math.floor((C[q]-Z-1)/_);if(Math.floor((C[q]-1)/_)<J)$.push("");w3($,X,_);continue}if(G+C[q]>_&&G>0&&C[q]>0){if(u.wordWrap===!1&&G<_){w3($,X,_);continue}$.push("")}if(G+C[q]>_&&u.wordWrap===!1){w3($,X,_);continue}$[$.length-1]+=X}if(u.trim!==!1)$=$.map(G7);F=$.join(`
28
- `);for(let[q,X]of[...F].entries()){if(B+=X,S3.has(X)){let Z=parseFloat(/\d[^m]*/.exec(F.slice(q,q+4)));E=Z===39?null:Z}let G=C7.codes.get(Number(E));if(E&&G){if(F[q+1]===`
29
- `)B+=g1(G);else if(X===`
30
- `)B+=g1(E)}}return B};f1.exports=(D,_,u)=>{return String(D).normalize().replace(/\r\n/g,`
27
+ `)}),this}_outputHelpIfRequested(D){let _=this._getHelpOption();if(_&&D.find((F)=>_.is(F)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function V1(D){return D.map((_)=>{if(!_.startsWith("--inspect"))return _;let u,F="127.0.0.1",B="9229",E;if((E=_.match(/^(--inspect(-brk)?)$/))!==null)u=E[1];else if((E=_.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null)if(u=E[1],/^\d+$/.test(E[3]))B=E[3];else F=E[3];else if((E=_.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null)u=E[1],F=E[3],B=E[4];if(u&&B!=="0")return`${u}=${F}:${parseInt(B)+1}`;return _})}function Y3(){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;return}x3.Command=w3;x3.useColor=Y3});var T1=N((UD)=>{var{Argument:I1}=K2(),{Command:S3}=L1(),{CommanderError:H9,InvalidArgumentError:R1}=h0(),{Help:M9}=T3(),{Option:N1}=O3();UD.program=new S3;UD.createCommand=(D)=>new S3(D);UD.createOption=(D,_)=>new N1(D,_);UD.createArgument=(D,_)=>new I1(D,_);UD.Command=S3;UD.Option=N1;UD.Argument=I1;UD.Help=M9;UD.CommanderError=H9;UD.InvalidArgumentError=R1;UD.InvalidOptionArgumentError=R1});var g0=N((ZB,w1)=>{var A9=require("node:tty"),V9=A9?.WriteStream?.prototype?.hasColors?.()??!1,w=(D,_)=>{if(!V9)return(B)=>B;let u=`\x1B[${D}m`,F=`\x1B[${_}m`;return(B)=>{let E=B+"",C=E.indexOf(F);if(C===-1)return u+E+F;let $=u,q=0;while(C!==-1)$+=E.slice(q,C)+u,q=C+F.length,C=E.indexOf(F,q);return $+=E.slice(q)+F,$}},Y={};Y.reset=w(0,0);Y.bold=w(1,22);Y.dim=w(2,22);Y.italic=w(3,23);Y.underline=w(4,24);Y.overline=w(53,55);Y.inverse=w(7,27);Y.hidden=w(8,28);Y.strikethrough=w(9,29);Y.black=w(30,39);Y.red=w(31,39);Y.green=w(32,39);Y.yellow=w(33,39);Y.blue=w(34,39);Y.magenta=w(35,39);Y.cyan=w(36,39);Y.white=w(37,39);Y.gray=w(90,39);Y.bgBlack=w(40,49);Y.bgRed=w(41,49);Y.bgGreen=w(42,49);Y.bgYellow=w(43,49);Y.bgBlue=w(44,49);Y.bgMagenta=w(45,49);Y.bgCyan=w(46,49);Y.bgWhite=w(47,49);Y.bgGray=w(100,49);Y.redBright=w(91,39);Y.greenBright=w(92,39);Y.yellowBright=w(93,39);Y.blueBright=w(94,39);Y.magentaBright=w(95,39);Y.cyanBright=w(96,39);Y.whiteBright=w(97,39);Y.bgRedBright=w(101,49);Y.bgGreenBright=w(102,49);Y.bgYellowBright=w(103,49);Y.bgBlueBright=w(104,49);Y.bgMagentaBright=w(105,49);Y.bgCyanBright=w(106,49);Y.bgWhiteBright=w(107,49);w1.exports=Y});var h1=N((YB,b1)=>{b1.exports=P9;function O9(D){let _={defaultWidth:0,output:process.stdout,tty:require("tty")};if(!D)return _;return Object.keys(_).forEach(function(u){if(!D[u])D[u]=_[u]}),D}function P9(D){let _=O9(D);if(_.output.getWindowSize)return _.output.getWindowSize()[0]||_.defaultWidth;if(_.tty.getWindowSize)return _.tty.getWindowSize()[1]||_.defaultWidth;if(_.output.columns)return _.output.columns;if(process.env.CLI_WIDTH){let u=parseInt(process.env.CLI_WIDTH,10);if(!isNaN(u)&&u!==0)return u}return _.defaultWidth}});var d1=N((wB,m1)=>{m1.exports=({onlyFirst:D=!1}={})=>{let _=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(_,D?void 0:"g")}});var f3=N((xB,g1)=>{var z9=d1();g1.exports=(D)=>typeof D==="string"?D.replace(z9(),""):D});var c1=N((SB,c3)=>{var f1=(D)=>{if(Number.isNaN(D))return!1;if(D>=4352&&(D<=4447||D===9001||D===9002||11904<=D&&D<=12871&&D!==12351||12880<=D&&D<=19903||19968<=D&&D<=42182||43360<=D&&D<=43388||44032<=D&&D<=55203||63744<=D&&D<=64255||65040<=D&&D<=65049||65072<=D&&D<=65131||65281<=D&&D<=65376||65504<=D&&D<=65510||110592<=D&&D<=110593||127488<=D&&D<=127569||131072<=D&&D<=262141))return!0;return!1};c3.exports=f1;c3.exports.default=f1});var l1=N((yB,p1)=>{p1.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\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\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])|\uD83C[\uDF3E\uDF73\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])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\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])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\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\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\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\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\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\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*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\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\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\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[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}});var l3=N((kB,p3)=>{var Y9=f3(),w9=c1(),x9=l1(),i1=(D)=>{if(typeof D!=="string"||D.length===0)return 0;if(D=Y9(D),D.length===0)return 0;D=D.replace(x9()," ");let _=0;for(let u=0;u<D.length;u++){let F=D.codePointAt(u);if(F<=31||F>=127&&F<=159)continue;if(F>=768&&F<=879)continue;if(F>65535)u++;_+=w9(F)?2:1}return _};p3.exports=i1;p3.exports.default=i1});var a1=N((vB,n1)=>{n1.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var i3=N((bB,r1)=>{var f0=a1(),s1={};for(let D of Object.keys(f0))s1[f0[D]]=D;var R={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};r1.exports=R;for(let D of Object.keys(R)){if(!("channels"in R[D]))throw new Error("missing channels property: "+D);if(!("labels"in R[D]))throw new Error("missing channel labels property: "+D);if(R[D].labels.length!==R[D].channels)throw new Error("channel and label counts mismatch: "+D);let{channels:_,labels:u}=R[D];delete R[D].channels,delete R[D].labels,Object.defineProperty(R[D],"channels",{value:_}),Object.defineProperty(R[D],"labels",{value:u})}R.rgb.hsl=function(D){let _=D[0]/255,u=D[1]/255,F=D[2]/255,B=Math.min(_,u,F),E=Math.max(_,u,F),C=E-B,$,q;if(E===B)$=0;else if(_===E)$=(u-F)/C;else if(u===E)$=2+(F-_)/C;else if(F===E)$=4+(_-u)/C;if($=Math.min($*60,360),$<0)$+=360;let X=(B+E)/2;if(E===B)q=0;else if(X<=0.5)q=C/(E+B);else q=C/(2-E-B);return[$,q*100,X*100]};R.rgb.hsv=function(D){let _,u,F,B,E,C=D[0]/255,$=D[1]/255,q=D[2]/255,X=Math.max(C,$,q),G=X-Math.min(C,$,q),Z=function(J){return(X-J)/6/G+0.5};if(G===0)B=0,E=0;else{if(E=G/X,_=Z(C),u=Z($),F=Z(q),C===X)B=F-u;else if($===X)B=0.3333333333333333+_-F;else if(q===X)B=0.6666666666666666+u-_;if(B<0)B+=1;else if(B>1)B-=1}return[B*360,E*100,X*100]};R.rgb.hwb=function(D){let _=D[0],u=D[1],F=D[2],B=R.rgb.hsl(D)[0],E=0.00392156862745098*Math.min(_,Math.min(u,F));return F=1-0.00392156862745098*Math.max(_,Math.max(u,F)),[B,E*100,F*100]};R.rgb.cmyk=function(D){let _=D[0]/255,u=D[1]/255,F=D[2]/255,B=Math.min(1-_,1-u,1-F),E=(1-_-B)/(1-B)||0,C=(1-u-B)/(1-B)||0,$=(1-F-B)/(1-B)||0;return[E*100,C*100,$*100,B*100]};function S9(D,_){return(D[0]-_[0])**2+(D[1]-_[1])**2+(D[2]-_[2])**2}R.rgb.keyword=function(D){let _=s1[D];if(_)return _;let u=1/0,F;for(let B of Object.keys(f0)){let E=f0[B],C=S9(D,E);if(C<u)u=C,F=B}return F};R.keyword.rgb=function(D){return f0[D]};R.rgb.xyz=function(D){let _=D[0]/255,u=D[1]/255,F=D[2]/255;_=_>0.04045?((_+0.055)/1.055)**2.4:_/12.92,u=u>0.04045?((u+0.055)/1.055)**2.4:u/12.92,F=F>0.04045?((F+0.055)/1.055)**2.4:F/12.92;let B=_*0.4124+u*0.3576+F*0.1805,E=_*0.2126+u*0.7152+F*0.0722,C=_*0.0193+u*0.1192+F*0.9505;return[B*100,E*100,C*100]};R.rgb.lab=function(D){let _=R.rgb.xyz(D),u=_[0],F=_[1],B=_[2];u/=95.047,F/=100,B/=108.883,u=u>0.008856?u**0.3333333333333333:7.787*u+0.13793103448275862,F=F>0.008856?F**0.3333333333333333:7.787*F+0.13793103448275862,B=B>0.008856?B**0.3333333333333333:7.787*B+0.13793103448275862;let E=116*F-16,C=500*(u-F),$=200*(F-B);return[E,C,$]};R.hsl.rgb=function(D){let _=D[0]/360,u=D[1]/100,F=D[2]/100,B,E,C;if(u===0)return C=F*255,[C,C,C];if(F<0.5)B=F*(1+u);else B=F+u-F*u;let $=2*F-B,q=[0,0,0];for(let X=0;X<3;X++){if(E=_+0.3333333333333333*-(X-1),E<0)E++;if(E>1)E--;if(6*E<1)C=$+(B-$)*6*E;else if(2*E<1)C=B;else if(3*E<2)C=$+(B-$)*(0.6666666666666666-E)*6;else C=$;q[X]=C*255}return q};R.hsl.hsv=function(D){let _=D[0],u=D[1]/100,F=D[2]/100,B=u,E=Math.max(F,0.01);F*=2,u*=F<=1?F:2-F,B*=E<=1?E:2-E;let C=(F+u)/2,$=F===0?2*B/(E+B):2*u/(F+u);return[_,$*100,C*100]};R.hsv.rgb=function(D){let _=D[0]/60,u=D[1]/100,F=D[2]/100,B=Math.floor(_)%6,E=_-Math.floor(_),C=255*F*(1-u),$=255*F*(1-u*E),q=255*F*(1-u*(1-E));switch(F*=255,B){case 0:return[F,q,C];case 1:return[$,F,C];case 2:return[C,F,q];case 3:return[C,$,F];case 4:return[q,C,F];case 5:return[F,C,$]}};R.hsv.hsl=function(D){let _=D[0],u=D[1]/100,F=D[2]/100,B=Math.max(F,0.01),E,C;C=(2-u)*F;let $=(2-u)*B;return E=u*B,E/=$<=1?$:2-$,E=E||0,C/=2,[_,E*100,C*100]};R.hwb.rgb=function(D){let _=D[0]/360,u=D[1]/100,F=D[2]/100,B=u+F,E;if(B>1)u/=B,F/=B;let C=Math.floor(6*_),$=1-F;if(E=6*_-C,(C&1)!==0)E=1-E;let q=u+E*($-u),X,G,Z;switch(C){default:case 6:case 0:X=$,G=q,Z=u;break;case 1:X=q,G=$,Z=u;break;case 2:X=u,G=$,Z=q;break;case 3:X=u,G=q,Z=$;break;case 4:X=q,G=u,Z=$;break;case 5:X=$,G=u,Z=q;break}return[X*255,G*255,Z*255]};R.cmyk.rgb=function(D){let _=D[0]/100,u=D[1]/100,F=D[2]/100,B=D[3]/100,E=1-Math.min(1,_*(1-B)+B),C=1-Math.min(1,u*(1-B)+B),$=1-Math.min(1,F*(1-B)+B);return[E*255,C*255,$*255]};R.xyz.rgb=function(D){let _=D[0]/100,u=D[1]/100,F=D[2]/100,B,E,C;return B=_*3.2406+u*-1.5372+F*-0.4986,E=_*-0.9689+u*1.8758+F*0.0415,C=_*0.0557+u*-0.204+F*1.057,B=B>0.0031308?1.055*B**0.4166666666666667-0.055:B*12.92,E=E>0.0031308?1.055*E**0.4166666666666667-0.055:E*12.92,C=C>0.0031308?1.055*C**0.4166666666666667-0.055:C*12.92,B=Math.min(Math.max(0,B),1),E=Math.min(Math.max(0,E),1),C=Math.min(Math.max(0,C),1),[B*255,E*255,C*255]};R.xyz.lab=function(D){let _=D[0],u=D[1],F=D[2];_/=95.047,u/=100,F/=108.883,_=_>0.008856?_**0.3333333333333333:7.787*_+0.13793103448275862,u=u>0.008856?u**0.3333333333333333:7.787*u+0.13793103448275862,F=F>0.008856?F**0.3333333333333333:7.787*F+0.13793103448275862;let B=116*u-16,E=500*(_-u),C=200*(u-F);return[B,E,C]};R.lab.xyz=function(D){let _=D[0],u=D[1],F=D[2],B,E,C;E=(_+16)/116,B=u/500+E,C=E-F/200;let $=E**3,q=B**3,X=C**3;return E=$>0.008856?$:(E-0.13793103448275862)/7.787,B=q>0.008856?q:(B-0.13793103448275862)/7.787,C=X>0.008856?X:(C-0.13793103448275862)/7.787,B*=95.047,E*=100,C*=108.883,[B,E,C]};R.lab.lch=function(D){let _=D[0],u=D[1],F=D[2],B;if(B=Math.atan2(F,u)*360/2/Math.PI,B<0)B+=360;let C=Math.sqrt(u*u+F*F);return[_,C,B]};R.lch.lab=function(D){let _=D[0],u=D[1],B=D[2]/360*2*Math.PI,E=u*Math.cos(B),C=u*Math.sin(B);return[_,E,C]};R.rgb.ansi16=function(D,_=null){let[u,F,B]=D,E=_===null?R.rgb.hsv(D)[2]:_;if(E=Math.round(E/50),E===0)return 30;let C=30+(Math.round(B/255)<<2|Math.round(F/255)<<1|Math.round(u/255));if(E===2)C+=60;return C};R.hsv.ansi16=function(D){return R.rgb.ansi16(R.hsv.rgb(D),D[2])};R.rgb.ansi256=function(D){let _=D[0],u=D[1],F=D[2];if(_===u&&u===F){if(_<8)return 16;if(_>248)return 231;return Math.round((_-8)/247*24)+232}return 16+36*Math.round(_/255*5)+6*Math.round(u/255*5)+Math.round(F/255*5)};R.ansi16.rgb=function(D){let _=D%10;if(_===0||_===7){if(D>50)_+=3.5;return _=_/10.5*255,[_,_,_]}let u=(~~(D>50)+1)*0.5,F=(_&1)*u*255,B=(_>>1&1)*u*255,E=(_>>2&1)*u*255;return[F,B,E]};R.ansi256.rgb=function(D){if(D>=232){let E=(D-232)*10+8;return[E,E,E]}D-=16;let _,u=Math.floor(D/36)/5*255,F=Math.floor((_=D%36)/6)/5*255,B=_%6/5*255;return[u,F,B]};R.rgb.hex=function(D){let u=(((Math.round(D[0])&255)<<16)+((Math.round(D[1])&255)<<8)+(Math.round(D[2])&255)).toString(16).toUpperCase();return"000000".substring(u.length)+u};R.hex.rgb=function(D){let _=D.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!_)return[0,0,0];let u=_[0];if(_[0].length===3)u=u.split("").map(($)=>{return $+$}).join("");let F=parseInt(u,16),B=F>>16&255,E=F>>8&255,C=F&255;return[B,E,C]};R.rgb.hcg=function(D){let _=D[0]/255,u=D[1]/255,F=D[2]/255,B=Math.max(Math.max(_,u),F),E=Math.min(Math.min(_,u),F),C=B-E,$,q;if(C<1)$=E/(1-C);else $=0;if(C<=0)q=0;else if(B===_)q=(u-F)/C%6;else if(B===u)q=2+(F-_)/C;else q=4+(_-u)/C;return q/=6,q%=1,[q*360,C*100,$*100]};R.hsl.hcg=function(D){let _=D[1]/100,u=D[2]/100,F=u<0.5?2*_*u:2*_*(1-u),B=0;if(F<1)B=(u-0.5*F)/(1-F);return[D[0],F*100,B*100]};R.hsv.hcg=function(D){let _=D[1]/100,u=D[2]/100,F=_*u,B=0;if(F<1)B=(u-F)/(1-F);return[D[0],F*100,B*100]};R.hcg.rgb=function(D){let _=D[0]/360,u=D[1]/100,F=D[2]/100;if(u===0)return[F*255,F*255,F*255];let B=[0,0,0],E=_%1*6,C=E%1,$=1-C,q=0;switch(Math.floor(E)){case 0:B[0]=1,B[1]=C,B[2]=0;break;case 1:B[0]=$,B[1]=1,B[2]=0;break;case 2:B[0]=0,B[1]=1,B[2]=C;break;case 3:B[0]=0,B[1]=$,B[2]=1;break;case 4:B[0]=C,B[1]=0,B[2]=1;break;default:B[0]=1,B[1]=0,B[2]=$}return q=(1-u)*F,[(u*B[0]+q)*255,(u*B[1]+q)*255,(u*B[2]+q)*255]};R.hcg.hsv=function(D){let _=D[1]/100,u=D[2]/100,F=_+u*(1-_),B=0;if(F>0)B=_/F;return[D[0],B*100,F*100]};R.hcg.hsl=function(D){let _=D[1]/100,F=D[2]/100*(1-_)+0.5*_,B=0;if(F>0&&F<0.5)B=_/(2*F);else if(F>=0.5&&F<1)B=_/(2*(1-F));return[D[0],B*100,F*100]};R.hcg.hwb=function(D){let _=D[1]/100,u=D[2]/100,F=_+u*(1-_);return[D[0],(F-_)*100,(1-F)*100]};R.hwb.hcg=function(D){let _=D[1]/100,F=1-D[2]/100,B=F-_,E=0;if(B<1)E=(F-B)/(1-B);return[D[0],B*100,E*100]};R.apple.rgb=function(D){return[D[0]/65535*255,D[1]/65535*255,D[2]/65535*255]};R.rgb.apple=function(D){return[D[0]/255*65535,D[1]/255*65535,D[2]/255*65535]};R.gray.rgb=function(D){return[D[0]/100*255,D[0]/100*255,D[0]/100*255]};R.gray.hsl=function(D){return[0,0,D[0]]};R.gray.hsv=R.gray.hsl;R.gray.hwb=function(D){return[0,100,D[0]]};R.gray.cmyk=function(D){return[0,0,0,D[0]]};R.gray.lab=function(D){return[D[0],0,0]};R.gray.hex=function(D){let _=Math.round(D[0]/100*255)&255,F=((_<<16)+(_<<8)+_).toString(16).toUpperCase();return"000000".substring(F.length)+F};R.rgb.gray=function(D){return[(D[0]+D[1]+D[2])/3/255*100]}});var t1=N((hB,o1)=>{var A2=i3();function y9(){let D={},_=Object.keys(A2);for(let u=_.length,F=0;F<u;F++)D[_[F]]={distance:-1,parent:null};return D}function k9(D){let _=y9(),u=[D];_[D].distance=0;while(u.length){let F=u.pop(),B=Object.keys(A2[F]);for(let E=B.length,C=0;C<E;C++){let $=B[C],q=_[$];if(q.distance===-1)q.distance=_[F].distance+1,q.parent=F,u.unshift($)}}return _}function v9(D,_){return function(u){return _(D(u))}}function b9(D,_){let u=[_[D].parent,D],F=A2[_[D].parent][D],B=_[D].parent;while(_[B].parent)u.unshift(_[B].parent),F=v9(A2[_[B].parent][B],F),B=_[B].parent;return F.conversion=u,F}o1.exports=function(D){let _=k9(D),u={},F=Object.keys(_);for(let B=F.length,E=0;E<B;E++){let C=F[E];if(_[C].parent===null)continue;u[C]=b9(C,_)}return u}});var D_=N((mB,e1)=>{var n3=i3(),h9=t1(),L0={},m9=Object.keys(n3);function d9(D){let _=function(...u){let F=u[0];if(F===void 0||F===null)return F;if(F.length>1)u=F;return D(u)};if("conversion"in D)_.conversion=D.conversion;return _}function g9(D){let _=function(...u){let F=u[0];if(F===void 0||F===null)return F;if(F.length>1)u=F;let B=D(u);if(typeof B==="object")for(let E=B.length,C=0;C<E;C++)B[C]=Math.round(B[C]);return B};if("conversion"in D)_.conversion=D.conversion;return _}m9.forEach((D)=>{L0[D]={},Object.defineProperty(L0[D],"channels",{value:n3[D].channels}),Object.defineProperty(L0[D],"labels",{value:n3[D].labels});let _=h9(D);Object.keys(_).forEach((F)=>{let B=_[F];L0[D][F]=g9(B),L0[D][F].raw=d9(B)})});e1.exports=L0});var C_=N((dB,E_)=>{var __=(D,_)=>(...u)=>{return`\x1B[${D(...u)+_}m`},u_=(D,_)=>(...u)=>{let F=D(...u);return`\x1B[${38+_};5;${F}m`},F_=(D,_)=>(...u)=>{let F=D(...u);return`\x1B[${38+_};2;${F[0]};${F[1]};${F[2]}m`},V2=(D)=>D,B_=(D,_,u)=>[D,_,u],I0=(D,_,u)=>{Object.defineProperty(D,_,{get:()=>{let F=u();return Object.defineProperty(D,_,{value:F,enumerable:!0,configurable:!0}),F},enumerable:!0,configurable:!0})},a3,R0=(D,_,u,F)=>{if(a3===void 0)a3=D_();let B=F?10:0,E={};for(let[C,$]of Object.entries(a3)){let q=C==="ansi16"?"ansi":C;if(C===_)E[q]=D(u,B);else if(typeof $==="object")E[q]=D($[_],B)}return E};function f9(){let D=new Map,_={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],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],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],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};_.color.gray=_.color.blackBright,_.bgColor.bgGray=_.bgColor.bgBlackBright,_.color.grey=_.color.blackBright,_.bgColor.bgGrey=_.bgColor.bgBlackBright;for(let[u,F]of Object.entries(_)){for(let[B,E]of Object.entries(F))_[B]={open:`\x1B[${E[0]}m`,close:`\x1B[${E[1]}m`},F[B]=_[B],D.set(E[0],E[1]);Object.defineProperty(_,u,{value:F,enumerable:!1})}return Object.defineProperty(_,"codes",{value:D,enumerable:!1}),_.color.close="\x1B[39m",_.bgColor.close="\x1B[49m",I0(_.color,"ansi",()=>R0(__,"ansi16",V2,!1)),I0(_.color,"ansi256",()=>R0(u_,"ansi256",V2,!1)),I0(_.color,"ansi16m",()=>R0(F_,"rgb",B_,!1)),I0(_.bgColor,"ansi",()=>R0(__,"ansi16",V2,!0)),I0(_.bgColor,"ansi256",()=>R0(u_,"ansi256",V2,!0)),I0(_.bgColor,"ansi16m",()=>R0(F_,"rgb",B_,!0)),_}Object.defineProperty(E_,"exports",{enumerable:!0,get:f9})});var q_=N((gB,G_)=>{var c0=l3(),c9=f3(),p9=C_(),r3=new Set(["\x1B","›"]),$_=(D)=>`${r3.values().next().value}[${D}m`,l9=(D)=>D.split(" ").map((_)=>c0(_)),s3=(D,_,u)=>{let F=[..._],B=!1,E=c0(c9(D[D.length-1]));for(let[C,$]of F.entries()){let q=c0($);if(E+q<=u)D[D.length-1]+=$;else D.push($),E=0;if(r3.has($))B=!0;else if(B&&$==="m"){B=!1;continue}if(B)continue;if(E+=q,E===u&&C<F.length-1)D.push(""),E=0}if(!E&&D[D.length-1].length>0&&D.length>1)D[D.length-2]+=D.pop()},i9=(D)=>{let _=D.split(" "),u=_.length;while(u>0){if(c0(_[u-1])>0)break;u--}if(u===_.length)return D;return _.slice(0,u).join(" ")+_.slice(u).join("")},n9=(D,_,u={})=>{if(u.trim!==!1&&D.trim()==="")return"";let F="",B="",E,C=l9(D),$=[""];for(let[q,X]of D.split(" ").entries()){if(u.trim!==!1)$[$.length-1]=$[$.length-1].trimLeft();let G=c0($[$.length-1]);if(q!==0){if(G>=_&&(u.wordWrap===!1||u.trim===!1))$.push(""),G=0;if(G>0||u.trim===!1)$[$.length-1]+=" ",G++}if(u.hard&&C[q]>_){let Z=_-G,J=1+Math.floor((C[q]-Z-1)/_);if(Math.floor((C[q]-1)/_)<J)$.push("");s3($,X,_);continue}if(G+C[q]>_&&G>0&&C[q]>0){if(u.wordWrap===!1&&G<_){s3($,X,_);continue}$.push("")}if(G+C[q]>_&&u.wordWrap===!1){s3($,X,_);continue}$[$.length-1]+=X}if(u.trim!==!1)$=$.map(i9);F=$.join(`
28
+ `);for(let[q,X]of[...F].entries()){if(B+=X,r3.has(X)){let Z=parseFloat(/\d[^m]*/.exec(F.slice(q,q+4)));E=Z===39?null:Z}let G=p9.codes.get(Number(E));if(E&&G){if(F[q+1]===`
29
+ `)B+=$_(G);else if(X===`
30
+ `)B+=$_(E)}}return B};G_.exports=(D,_,u)=>{return String(D).normalize().replace(/\r\n/g,`
31
31
  `).split(`
32
- `).map((F)=>q7(F,_,u)).join(`
33
- `)}});var o1=N((KC,r1)=>{var J7=x("stream");class s1 extends J7{#u=null;constructor(D={}){super(D);this.writable=this.readable=!0,this.muted=!1,this.on("pipe",this._onpipe),this.replace=D.replace,this._prompt=D.prompt||null,this._hadControl=!1}#_(D,_){if(this._dest)return this._dest[D];if(this._src)return this._src[D];return _}#D(D,..._){if(typeof this._dest?.[D]==="function")this._dest[D](..._);if(typeof this._src?.[D]==="function")this._src[D](..._)}get isTTY(){if(this.#u!==null)return this.#u;return this.#_("isTTY",!1)}set isTTY(D){this.#u=D}get rows(){return this.#_("rows")}get columns(){return this.#_("columns")}mute(){this.muted=!0}unmute(){this.muted=!1}_onpipe(D){this._src=D}pipe(D,_){return this._dest=D,super.pipe(D,_)}pause(){if(this._src)return this._src.pause()}resume(){if(this._src)return this._src.resume()}write(D){if(this.muted){if(!this.replace)return!0;if(D.match(/^\u001b/)){if(D.indexOf(this._prompt)===0)D=D.slice(this._prompt.length),D=D.replace(/./g,this.replace),D=this._prompt+D;return this._hadControl=!0,this.emit("data",D)}else{if(this._prompt&&this._hadControl&&D.indexOf(this._prompt)===0)this._hadControl=!1,this.emit("data",this._prompt),D=D.slice(this._prompt.length);D=D.toString().replace(/./g,this.replace)}}this.emit("data",D)}end(D){if(this.muted)if(D&&this.replace)D=D.toString().replace(/./g,this.replace);else D=null;if(D)this.emit("data",D);this.emit("end")}destroy(...D){return this.#D("destroy",...D)}destroySoon(...D){return this.#D("destroySoon",...D)}close(...D){return this.#D("close",...D)}}r1.exports=s1});var m3=N((U7,h3)=>{var y=U7;U7.default=y;var h="\x1B[",g0="\x1B]",V0="\x07",H2=";",u_=process.env.TERM_PROGRAM==="Apple_Terminal";y.cursorTo=(D,_)=>{if(typeof D!=="number")throw new TypeError("The `x` argument is required");if(typeof _!=="number")return h+(D+1)+"G";return h+(_+1)+";"+(D+1)+"H"};y.cursorMove=(D,_)=>{if(typeof D!=="number")throw new TypeError("The `x` argument is required");let u="";if(D<0)u+=h+-D+"D";else if(D>0)u+=h+D+"C";if(_<0)u+=h+-_+"A";else if(_>0)u+=h+_+"B";return u};y.cursorUp=(D=1)=>h+D+"A";y.cursorDown=(D=1)=>h+D+"B";y.cursorForward=(D=1)=>h+D+"C";y.cursorBackward=(D=1)=>h+D+"D";y.cursorLeft=h+"G";y.cursorSavePosition=u_?"\x1B7":h+"s";y.cursorRestorePosition=u_?"\x1B8":h+"u";y.cursorGetPosition=h+"6n";y.cursorNextLine=h+"E";y.cursorPrevLine=h+"F";y.cursorHide=h+"?25l";y.cursorShow=h+"?25h";y.eraseLines=(D)=>{let _="";for(let u=0;u<D;u++)_+=y.eraseLine+(u<D-1?y.cursorUp():"");if(D)_+=y.cursorLeft;return _};y.eraseEndLine=h+"K";y.eraseStartLine=h+"1K";y.eraseLine=h+"2K";y.eraseDown=h+"J";y.eraseUp=h+"1J";y.eraseScreen=h+"2J";y.scrollUp=h+"S";y.scrollDown=h+"T";y.clearScreen="\x1Bc";y.clearTerminal=process.platform==="win32"?`${y.eraseScreen}${h}0f`:`${y.eraseScreen}${h}3J${h}H`;y.beep=V0;y.link=(D,_)=>{return[g0,"8",H2,H2,_,V0,D,g0,"8",H2,H2,V0].join("")};y.image=(D,_={})=>{let u=`${g0}1337;File=inline=1`;if(_.width)u+=`;width=${_.width}`;if(_.height)u+=`;height=${_.height}`;if(_.preserveAspectRatio===!1)u+=";preserveAspectRatio=0";return u+":"+D.toString("base64")+V0};y.iTerm={setCwd:(D=process.cwd())=>`${g0}50;CurrentDir=${D}${V0}`,annotation:(D,_={})=>{let u=`${g0}1337;`,F=typeof _.x!=="undefined",B=typeof _.y!=="undefined";if((F||B)&&!(F&&B&&typeof _.length!=="undefined"))throw new Error("`x`, `y` and `length` must be defined when `x` or `y` is defined");if(D=D.replace(/\|/g,""),u+=_.isHidden?"AddHiddenAnnotation=":"AddAnnotation=",_.length>0)u+=(F?[D,_.length,_.x,_.y]:[_.length,D]).join("|");else u+=D;return u+V0}}});var J_=N((G$,Z_)=>{var sD=x("constants"),O7=process.cwd,V2=null,x7=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){if(!V2)V2=O7.call(process);return V2};try{process.cwd()}catch(D){}if(typeof process.chdir==="function"){if(p3=process.chdir,process.chdir=function(D){V2=null,p3.call(process,D)},Object.setPrototypeOf)Object.setPrototypeOf(process.chdir,p3)}var p3;Z_.exports=P7;function P7(D){if(sD.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./))_(D);if(!D.lutimes)u(D);if(D.chown=E(D.chown),D.fchown=E(D.fchown),D.lchown=E(D.lchown),D.chmod=F(D.chmod),D.fchmod=F(D.fchmod),D.lchmod=F(D.lchmod),D.chownSync=C(D.chownSync),D.fchownSync=C(D.fchownSync),D.lchownSync=C(D.lchownSync),D.chmodSync=B(D.chmodSync),D.fchmodSync=B(D.fchmodSync),D.lchmodSync=B(D.lchmodSync),D.stat=$(D.stat),D.fstat=$(D.fstat),D.lstat=$(D.lstat),D.statSync=q(D.statSync),D.fstatSync=q(D.fstatSync),D.lstatSync=q(D.lstatSync),D.chmod&&!D.lchmod)D.lchmod=function(G,Z,J){if(J)process.nextTick(J)},D.lchmodSync=function(){};if(D.chown&&!D.lchown)D.lchown=function(G,Z,J,K){if(K)process.nextTick(K)},D.lchownSync=function(){};if(x7==="win32")D.rename=typeof D.rename!=="function"?D.rename:function(G){function Z(J,K,Q){var M=Date.now(),W=0;G(J,K,function V(L){if(L&&(L.code==="EACCES"||L.code==="EPERM"||L.code==="EBUSY")&&Date.now()-M<60000){if(setTimeout(function(){D.stat(K,function(T,S){if(T&&T.code==="ENOENT")G(J,K,V);else Q(L)})},W),W<100)W+=10;return}if(Q)Q(L)})}if(Object.setPrototypeOf)Object.setPrototypeOf(Z,G);return Z}(D.rename);D.read=typeof D.read!=="function"?D.read:function(G){function Z(J,K,Q,M,W,V){var L;if(V&&typeof V==="function"){var T=0;L=function(S,j,v){if(S&&S.code==="EAGAIN"&&T<10)return T++,G.call(D,J,K,Q,M,W,L);V.apply(this,arguments)}}return G.call(D,J,K,Q,M,W,L)}if(Object.setPrototypeOf)Object.setPrototypeOf(Z,G);return Z}(D.read),D.readSync=typeof D.readSync!=="function"?D.readSync:function(G){return function(Z,J,K,Q,M){var W=0;while(!0)try{return G.call(D,Z,J,K,Q,M)}catch(V){if(V.code==="EAGAIN"&&W<10){W++;continue}throw V}}}(D.readSync);function _(G){G.lchmod=function(Z,J,K){G.open(Z,sD.O_WRONLY|sD.O_SYMLINK,J,function(Q,M){if(Q){if(K)K(Q);return}G.fchmod(M,J,function(W){G.close(M,function(V){if(K)K(W||V)})})})},G.lchmodSync=function(Z,J){var K=G.openSync(Z,sD.O_WRONLY|sD.O_SYMLINK,J),Q=!0,M;try{M=G.fchmodSync(K,J),Q=!1}finally{if(Q)try{G.closeSync(K)}catch(W){}else G.closeSync(K)}return M}}function u(G){if(sD.hasOwnProperty("O_SYMLINK")&&G.futimes)G.lutimes=function(Z,J,K,Q){G.open(Z,sD.O_SYMLINK,function(M,W){if(M){if(Q)Q(M);return}G.futimes(W,J,K,function(V){G.close(W,function(L){if(Q)Q(V||L)})})})},G.lutimesSync=function(Z,J,K){var Q=G.openSync(Z,sD.O_SYMLINK),M,W=!0;try{M=G.futimesSync(Q,J,K),W=!1}finally{if(W)try{G.closeSync(Q)}catch(V){}else G.closeSync(Q)}return M};else if(G.futimes)G.lutimes=function(Z,J,K,Q){if(Q)process.nextTick(Q)},G.lutimesSync=function(){}}function F(G){if(!G)return G;return function(Z,J,K){return G.call(D,Z,J,function(Q){if(X(Q))Q=null;if(K)K.apply(this,arguments)})}}function B(G){if(!G)return G;return function(Z,J){try{return G.call(D,Z,J)}catch(K){if(!X(K))throw K}}}function E(G){if(!G)return G;return function(Z,J,K,Q){return G.call(D,Z,J,K,function(M){if(X(M))M=null;if(Q)Q.apply(this,arguments)})}}function C(G){if(!G)return G;return function(Z,J,K){try{return G.call(D,Z,J,K)}catch(Q){if(!X(Q))throw Q}}}function $(G){if(!G)return G;return function(Z,J,K){if(typeof J==="function")K=J,J=null;function Q(M,W){if(W){if(W.uid<0)W.uid+=4294967296;if(W.gid<0)W.gid+=4294967296}if(K)K.apply(this,arguments)}return J?G.call(D,Z,J,Q):G.call(D,Z,Q)}}function q(G){if(!G)return G;return function(Z,J){var K=J?G.call(D,Z,J):G.call(D,Z);if(K){if(K.uid<0)K.uid+=4294967296;if(K.gid<0)K.gid+=4294967296}return K}}function X(G){if(!G)return!0;if(G.code==="ENOSYS")return!0;var Z=!process.getuid||process.getuid()!==0;if(Z){if(G.code==="EINVAL"||G.code==="EPERM")return!0}return!1}}});var U_=N((q$,K_)=>{var Q_=x("stream").Stream;K_.exports=z7;function z7(D){return{ReadStream:_,WriteStream:u};function _(F,B){if(!(this instanceof _))return new _(F,B);Q_.call(this);var E=this;this.path=F,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,B=B||{};var C=Object.keys(B);for(var $=0,q=C.length;$<q;$++){var X=C[$];this[X]=B[X]}if(this.encoding)this.setEncoding(this.encoding);if(this.start!==void 0){if(typeof this.start!=="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!=="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){E._read()});return}D.open(this.path,this.flags,this.mode,function(G,Z){if(G){E.emit("error",G),E.readable=!1;return}E.fd=Z,E.emit("open",Z),E._read()})}function u(F,B){if(!(this instanceof u))return new u(F,B);Q_.call(this),this.path=F,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,B=B||{};var E=Object.keys(B);for(var C=0,$=E.length;C<$;C++){var q=E[C];this[q]=B[q]}if(this.start!==void 0){if(typeof this.start!=="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}if(this.busy=!1,this._queue=[],this.fd===null)this._open=D.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush()}}});var M_=N((X$,H_)=>{H_.exports=w7;var Y7=Object.getPrototypeOf||function(D){return D.__proto__};function w7(D){if(D===null||typeof D!=="object")return D;if(D instanceof Object)var _={__proto__:Y7(D)};else var _=Object.create(null);return Object.getOwnPropertyNames(D).forEach(function(u){Object.defineProperty(_,u,Object.getOwnPropertyDescriptor(D,u))}),_}});var L_=N((Z$,n3)=>{var a=x("fs"),S7=J_(),y7=U_(),k7=M_(),L2=x("util"),ED,R2;if(typeof Symbol==="function"&&typeof Symbol.for==="function")ED=Symbol.for("graceful-fs.queue"),R2=Symbol.for("graceful-fs.previous");else ED="___graceful-fs.queue",R2="___graceful-fs.previous";function v7(){}function V_(D,_){Object.defineProperty(D,ED,{get:function(){return _}})}var Z0=v7;if(L2.debuglog)Z0=L2.debuglog("gfs4");else if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))Z0=function(){var D=L2.format.apply(L2,arguments);D="GFS4: "+D.split(/\n/).join(`
34
- GFS4: `),console.error(D)};if(!a[ED]){if(W_=global[ED]||[],V_(a,W_),a.close=function(D){function _(u,F){return D.call(a,u,function(B){if(!B)A_();if(typeof F==="function")F.apply(this,arguments)})}return Object.defineProperty(_,R2,{value:D}),_}(a.close),a.closeSync=function(D){function _(u){D.apply(a,arguments),A_()}return Object.defineProperty(_,R2,{value:D}),_}(a.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))process.on("exit",function(){Z0(a[ED]),x("assert").equal(a[ED].length,0)})}var W_;if(!global[ED])V_(global,a[ED]);n3.exports=l3(k7(a));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!a.__patched)n3.exports=l3(a),a.__patched=!0;function l3(D){S7(D),D.gracefulify=l3,D.createReadStream=j,D.createWriteStream=v;var _=D.readFile;D.readFile=u;function u(A,z,P){if(typeof z==="function")P=z,z=null;return c(A,z,P);function c(t,uD,i,s){return _(t,uD,function(g){if(g&&(g.code==="EMFILE"||g.code==="ENFILE"))R0([c,[t,uD,i],g,s||Date.now(),Date.now()]);else if(typeof i==="function")i.apply(this,arguments)})}}var F=D.writeFile;D.writeFile=B;function B(A,z,P,c){if(typeof P==="function")c=P,P=null;return t(A,z,P,c);function t(uD,i,s,g,BD){return F(uD,i,s,function(p){if(p&&(p.code==="EMFILE"||p.code==="ENFILE"))R0([t,[uD,i,s,g],p,BD||Date.now(),Date.now()]);else if(typeof g==="function")g.apply(this,arguments)})}}var E=D.appendFile;if(E)D.appendFile=C;function C(A,z,P,c){if(typeof P==="function")c=P,P=null;return t(A,z,P,c);function t(uD,i,s,g,BD){return E(uD,i,s,function(p){if(p&&(p.code==="EMFILE"||p.code==="ENFILE"))R0([t,[uD,i,s,g],p,BD||Date.now(),Date.now()]);else if(typeof g==="function")g.apply(this,arguments)})}}var $=D.copyFile;if($)D.copyFile=q;function q(A,z,P,c){if(typeof P==="function")c=P,P=0;return t(A,z,P,c);function t(uD,i,s,g,BD){return $(uD,i,s,function(p){if(p&&(p.code==="EMFILE"||p.code==="ENFILE"))R0([t,[uD,i,s,g],p,BD||Date.now(),Date.now()]);else if(typeof g==="function")g.apply(this,arguments)})}}var X=D.readdir;D.readdir=Z;var G=/^v[0-5]\./;function Z(A,z,P){if(typeof z==="function")P=z,z=null;var c=G.test(process.version)?function uD(i,s,g,BD){return X(i,t(i,s,g,BD))}:function uD(i,s,g,BD){return X(i,s,t(i,s,g,BD))};return c(A,z,P);function t(uD,i,s,g){return function(BD,p){if(BD&&(BD.code==="EMFILE"||BD.code==="ENFILE"))R0([c,[uD,i,s],BD,g||Date.now(),Date.now()]);else{if(p&&p.sort)p.sort();if(typeof s==="function")s.call(this,BD,p)}}}}if(process.version.substr(0,4)==="v0.8"){var J=y7(D);V=J.ReadStream,T=J.WriteStream}var K=D.ReadStream;if(K)V.prototype=Object.create(K.prototype),V.prototype.open=L;var Q=D.WriteStream;if(Q)T.prototype=Object.create(Q.prototype),T.prototype.open=S;Object.defineProperty(D,"ReadStream",{get:function(){return V},set:function(A){V=A},enumerable:!0,configurable:!0}),Object.defineProperty(D,"WriteStream",{get:function(){return T},set:function(A){T=A},enumerable:!0,configurable:!0});var M=V;Object.defineProperty(D,"FileReadStream",{get:function(){return M},set:function(A){M=A},enumerable:!0,configurable:!0});var W=T;Object.defineProperty(D,"FileWriteStream",{get:function(){return W},set:function(A){W=A},enumerable:!0,configurable:!0});function V(A,z){if(this instanceof V)return K.apply(this,arguments),this;else return V.apply(Object.create(V.prototype),arguments)}function L(){var A=this;_D(A.path,A.flags,A.mode,function(z,P){if(z){if(A.autoClose)A.destroy();A.emit("error",z)}else A.fd=P,A.emit("open",P),A.read()})}function T(A,z){if(this instanceof T)return Q.apply(this,arguments),this;else return T.apply(Object.create(T.prototype),arguments)}function S(){var A=this;_D(A.path,A.flags,A.mode,function(z,P){if(z)A.destroy(),A.emit("error",z);else A.fd=P,A.emit("open",P)})}function j(A,z){return new D.ReadStream(A,z)}function v(A,z){return new D.WriteStream(A,z)}var DD=D.open;D.open=_D;function _D(A,z,P,c){if(typeof P==="function")c=P,P=null;return t(A,z,P,c);function t(uD,i,s,g,BD){return DD(uD,i,s,function(p,sB){if(p&&(p.code==="EMFILE"||p.code==="ENFILE"))R0([t,[uD,i,s,g],p,BD||Date.now(),Date.now()]);else if(typeof g==="function")g.apply(this,arguments)})}}return D}function R0(D){Z0("ENQUEUE",D[0].name,D[1]),a[ED].push(D),i3()}var I2;function A_(){var D=Date.now();for(var _=0;_<a[ED].length;++_)if(a[ED][_].length>2)a[ED][_][3]=D,a[ED][_][4]=D;i3()}function i3(){if(clearTimeout(I2),I2=void 0,a[ED].length===0)return;var D=a[ED].shift(),_=D[0],u=D[1],F=D[2],B=D[3],E=D[4];if(B===void 0)Z0("RETRY",_.name,u),_.apply(null,u);else if(Date.now()-B>=60000){Z0("TIMEOUT",_.name,u);var C=u.pop();if(typeof C==="function")C.call(null,F)}else{var $=Date.now()-E,q=Math.max(E-B,1),X=Math.min(q*1.2,100);if($>=X)Z0("RETRY",_.name,u),_.apply(null,u.concat([B]));else a[ED].push(D)}if(I2===void 0)I2=setTimeout(i3,0)}});var G6=N((kG,$6)=>{class C6{constructor(D,_,u){this.etaBufferLength=D||100,this.valueBuffer=[u],this.timeBuffer=[_],this.eta="0"}update(D,_,u){this.valueBuffer.push(_),this.timeBuffer.push(D),this.calculate(u-_)}getTime(){return this.eta}calculate(D){let _=this.valueBuffer.length,u=Math.min(this.etaBufferLength,_),F=this.valueBuffer[_-1]-this.valueBuffer[_-u],B=this.timeBuffer[_-1]-this.timeBuffer[_-u],E=F/B;this.valueBuffer=this.valueBuffer.slice(-this.etaBufferLength),this.timeBuffer=this.timeBuffer.slice(-this.etaBufferLength);let C=Math.ceil(D/E/1000);if(isNaN(C))this.eta="NULL";else if(!isFinite(C))this.eta="INF";else if(C>1e7)this.eta="INF";else if(C<0)this.eta=0;else this.eta=C}}$6.exports=C6});var C8=N((vG,X6)=>{var K0=x("readline");class q6{constructor(D){this.stream=D,this.linewrap=!0,this.dy=0}cursorSave(){if(!this.stream.isTTY)return;this.stream.write("\x1B7")}cursorRestore(){if(!this.stream.isTTY)return;this.stream.write("\x1B8")}cursor(D){if(!this.stream.isTTY)return;if(D)this.stream.write("\x1B[?25h");else this.stream.write("\x1B[?25l")}cursorTo(D=null,_=null){if(!this.stream.isTTY)return;K0.cursorTo(this.stream,D,_)}cursorRelative(D=null,_=null){if(!this.stream.isTTY)return;this.dy=this.dy+_,K0.moveCursor(this.stream,D,_)}cursorRelativeReset(){if(!this.stream.isTTY)return;K0.moveCursor(this.stream,0,-this.dy),K0.cursorTo(this.stream,0,null),this.dy=0}clearRight(){if(!this.stream.isTTY)return;K0.clearLine(this.stream,1)}clearLine(){if(!this.stream.isTTY)return;K0.clearLine(this.stream,0)}clearBottom(){if(!this.stream.isTTY)return;K0.clearScreenDown(this.stream)}newline(){this.stream.write(`
35
- `),this.dy++}write(D,_=!1){if(this.linewrap===!0&&_===!1)this.stream.write(D.substr(0,this.getWidth()));else this.stream.write(D)}lineWrapping(D){if(!this.stream.isTTY)return;if(this.linewrap=D,D)this.stream.write("\x1B[?7h");else this.stream.write("\x1B[?7l")}isTTY(){return this.stream.isTTY===!0}getWidth(){return this.stream.columns||(this.stream.isTTY?80:200)}}X6.exports=q6});var $8=N((bG,Z6)=>{Z6.exports=function D(_,u,F){if(u.autopadding!==!0)return _;function B(E,C){return(u.autopaddingChar+E).slice(-C)}switch(F){case"percentage":return B(_,3);default:return _}}});var G8=N((hG,J6)=>{J6.exports=function D(_,u){let F=Math.round(_*u.barsize),B=u.barsize-F;return u.barCompleteString.substr(0,F)+u.barGlue+u.barIncompleteString.substr(0,B)}});var q8=N((mG,Q6)=>{Q6.exports=function D(_,u,F){function B(C){if(F)return F*Math.round(C/F);else return C}function E(C){return(u.autopaddingChar+C).slice(-2)}if(_>3600)return E(Math.floor(_/3600))+"h"+E(B(_%3600/60))+"m";else if(_>60)return E(Math.floor(_/60))+"m"+E(B(_%60))+"s";else if(_>10)return E(B(_))+"s";else return E(_)+"s"}});var X8=N((dG,K6)=>{var qu=x3(),Xu=$8(),Zu=G8(),Ju=q8();K6.exports=function D(_,u,F){let B=_.format,E=_.formatTime||Ju,C=_.formatValue||Xu,$=_.formatBar||Zu,q=Math.floor(u.progress*100)+"",X=u.stopTime||Date.now(),G=Math.round((X-u.startTime)/1000),Z=Object.assign({},F,{bar:$(u.progress,_),percentage:C(q,_,"percentage"),total:C(u.total,_,"total"),value:C(u.value,_,"value"),eta:C(u.eta,_,"eta"),eta_formatted:E(u.eta,_,5),duration:C(G,_,"duration"),duration_formatted:E(G,_,1)});B=B.replace(/\{(\w+)\}/g,function(Q,M){if(typeof Z[M]!=="undefined")return Z[M];return Q});let J=Math.max(0,u.maxWidth-qu(B)-2),K=Math.floor(J/2);switch(_.align){case"right":B=J>0?" ".repeat(J)+B:B;break;case"center":B=K>0?" ".repeat(K)+B:B;break;case"left":default:break}return B}});var S2=N((gG,U6)=>{function m(D,_){if(typeof D==="undefined"||D===null)return _;else return D}U6.exports={parse:function D(_,u){let F={},B=Object.assign({},u,_);return F.throttleTime=1000/m(B.fps,10),F.stream=m(B.stream,process.stderr),F.terminal=m(B.terminal,null),F.clearOnComplete=m(B.clearOnComplete,!1),F.stopOnComplete=m(B.stopOnComplete,!1),F.barsize=m(B.barsize,40),F.align=m(B.align,"left"),F.hideCursor=m(B.hideCursor,!1),F.linewrap=m(B.linewrap,!1),F.barGlue=m(B.barGlue,""),F.barCompleteChar=m(B.barCompleteChar,"="),F.barIncompleteChar=m(B.barIncompleteChar,"-"),F.format=m(B.format,"progress [{bar}] {percentage}% | ETA: {eta}s | {value}/{total}"),F.formatTime=m(B.formatTime,null),F.formatValue=m(B.formatValue,null),F.formatBar=m(B.formatBar,null),F.etaBufferLength=m(B.etaBuffer,10),F.etaAsynchronousUpdate=m(B.etaAsynchronousUpdate,!1),F.progressCalculationRelative=m(B.progressCalculationRelative,!1),F.synchronousUpdate=m(B.synchronousUpdate,!0),F.noTTYOutput=m(B.noTTYOutput,!1),F.notTTYSchedule=m(B.notTTYSchedule,2000),F.emptyOnZero=m(B.emptyOnZero,!1),F.forceRedraw=m(B.forceRedraw,!1),F.autopadding=m(B.autopadding,!1),F.gracefulExit=m(B.gracefulExit,!1),F},assignDerivedOptions:function D(_){return _.barCompleteString=_.barCompleteChar.repeat(_.barsize+1),_.barIncompleteString=_.barIncompleteChar.repeat(_.barsize+1),_.autopaddingChar=_.autopadding?m(_.autopaddingChar," "):"",_}}});var Z8=N((fG,M6)=>{var H6=G6(),Qu=C8(),Ku=X8(),Uu=S2(),Hu=x("events");M6.exports=class D extends Hu{constructor(_){super();this.options=Uu.assignDerivedOptions(_),this.terminal=this.options.terminal?this.options.terminal:new Qu(this.options.stream),this.value=0,this.startValue=0,this.total=100,this.lastDrawnString=null,this.startTime=null,this.stopTime=null,this.lastRedraw=Date.now(),this.eta=new H6(this.options.etaBufferLength,0,0),this.payload={},this.isActive=!1,this.formatter=typeof this.options.format==="function"?this.options.format:Ku}render(_=!1){let u={progress:this.getProgress(),eta:this.eta.getTime(),startTime:this.startTime,stopTime:this.stopTime,total:this.total,value:this.value,maxWidth:this.terminal.getWidth()};if(this.options.etaAsynchronousUpdate)this.updateETA();let F=this.formatter(this.options,u,this.payload);if(_||this.options.forceRedraw||this.options.noTTYOutput&&!this.terminal.isTTY()||this.lastDrawnString!=F)this.emit("redraw-pre"),this.terminal.cursorTo(0,null),this.terminal.write(F),this.terminal.clearRight(),this.lastDrawnString=F,this.lastRedraw=Date.now(),this.emit("redraw-post")}start(_,u,F){this.value=u||0,this.total=typeof _!=="undefined"&&_>=0?_:100,this.startValue=u||0,this.payload=F||{},this.startTime=Date.now(),this.stopTime=null,this.lastDrawnString="",this.eta=new H6(this.options.etaBufferLength,this.startTime,this.value),this.isActive=!0,this.emit("start",_,u)}stop(){this.isActive=!1,this.stopTime=Date.now(),this.emit("stop",this.total,this.value)}update(_,u={}){if(typeof _==="number")this.value=_,this.eta.update(Date.now(),_,this.total);let F=(typeof _==="object"?_:u)||{};this.emit("update",this.total,this.value);for(let B in F)this.payload[B]=F[B];if(this.value>=this.getTotal()&&this.options.stopOnComplete)this.stop()}getProgress(){let _=this.value/this.total;if(this.options.progressCalculationRelative)_=(this.value-this.startValue)/(this.total-this.startValue);if(isNaN(_))_=this.options&&this.options.emptyOnZero?0:1;return _=Math.min(Math.max(_,0),1),_}increment(_=1,u={}){if(typeof _==="object")this.update(this.value+1,_);else this.update(this.value+_,u)}getTotal(){return this.total}setTotal(_){if(typeof _!=="undefined"&&_>=0)this.total=_}updateETA(){this.eta.update(Date.now(),this.value,this.total)}}});var A6=N((cG,W6)=>{var Mu=Z8(),Wu=S2();W6.exports=class D extends Mu{constructor(_,u){super(Wu.parse(_,u));if(this.timer=null,this.options.noTTYOutput&&this.terminal.isTTY()===!1)this.options.synchronousUpdate=!1;this.schedulingRate=this.terminal.isTTY()?this.options.throttleTime:this.options.notTTYSchedule,this.sigintCallback=null}render(){if(this.timer)clearTimeout(this.timer),this.timer=null;if(super.render(),this.options.noTTYOutput&&this.terminal.isTTY()===!1)this.terminal.newline();this.timer=setTimeout(this.render.bind(this),this.schedulingRate)}update(_,u){if(!this.timer)return;if(super.update(_,u),this.options.synchronousUpdate&&this.lastRedraw+this.options.throttleTime*2<Date.now())this.render()}start(_,u,F){if(this.options.noTTYOutput===!1&&this.terminal.isTTY()===!1)return;if(this.sigintCallback===null&&this.options.gracefulExit)this.sigintCallback=this.stop.bind(this),process.once("SIGINT",this.sigintCallback),process.once("SIGTERM",this.sigintCallback);if(this.terminal.cursorSave(),this.options.hideCursor===!0)this.terminal.cursor(!1);if(this.options.linewrap===!1)this.terminal.lineWrapping(!1);super.start(_,u,F),this.render()}stop(){if(!this.timer)return;if(this.sigintCallback)process.removeListener("SIGINT",this.sigintCallback),process.removeListener("SIGTERM",this.sigintCallback),this.sigintCallback=null;if(this.render(),super.stop(),clearTimeout(this.timer),this.timer=null,this.options.hideCursor===!0)this.terminal.cursor(!0);if(this.options.linewrap===!1)this.terminal.lineWrapping(!0);if(this.terminal.cursorRestore(),this.options.clearOnComplete)this.terminal.cursorTo(0,null),this.terminal.clearLine();else this.terminal.newline()}}});var L6=N((pG,V6)=>{var Au=C8(),Vu=Z8(),Lu=S2(),Iu=x("events");V6.exports=class D extends Iu{constructor(_,u){super();this.bars=[],this.options=Lu.parse(_,u),this.options.synchronousUpdate=!1,this.terminal=this.options.terminal?this.options.terminal:new Au(this.options.stream),this.timer=null,this.isActive=!1,this.schedulingRate=this.terminal.isTTY()?this.options.throttleTime:this.options.notTTYSchedule,this.loggingBuffer=[],this.sigintCallback=null}create(_,u,F,B={}){let E=new Vu(Object.assign({},this.options,{terminal:this.terminal},B));if(this.bars.push(E),this.options.noTTYOutput===!1&&this.terminal.isTTY()===!1)return E;if(this.sigintCallback===null&&this.options.gracefulExit)this.sigintCallback=this.stop.bind(this),process.once("SIGINT",this.sigintCallback),process.once("SIGTERM",this.sigintCallback);if(!this.isActive){if(this.options.hideCursor===!0)this.terminal.cursor(!1);if(this.options.linewrap===!1)this.terminal.lineWrapping(!1);this.timer=setTimeout(this.update.bind(this),this.schedulingRate)}return this.isActive=!0,E.start(_,u,F),this.emit("start"),E}remove(_){let u=this.bars.indexOf(_);if(u<0)return!1;return this.bars.splice(u,1),this.update(),this.terminal.newline(),this.terminal.clearBottom(),!0}update(){if(this.timer)clearTimeout(this.timer),this.timer=null;if(this.emit("update-pre"),this.terminal.cursorRelativeReset(),this.emit("redraw-pre"),this.loggingBuffer.length>0){this.terminal.clearLine();while(this.loggingBuffer.length>0)this.terminal.write(this.loggingBuffer.shift(),!0)}for(let _=0;_<this.bars.length;_++){if(_>0)this.terminal.newline();this.bars[_].render()}if(this.emit("redraw-post"),this.options.noTTYOutput&&this.terminal.isTTY()===!1)this.terminal.newline(),this.terminal.newline();if(this.timer=setTimeout(this.update.bind(this),this.schedulingRate),this.emit("update-post"),this.options.stopOnComplete&&!this.bars.find((_)=>_.isActive))this.stop()}stop(){if(clearTimeout(this.timer),this.timer=null,this.sigintCallback)process.removeListener("SIGINT",this.sigintCallback),process.removeListener("SIGTERM",this.sigintCallback),this.sigintCallback=null;if(this.isActive=!1,this.options.hideCursor===!0)this.terminal.cursor(!0);if(this.options.linewrap===!1)this.terminal.lineWrapping(!0);if(this.terminal.cursorRelativeReset(),this.emit("stop-pre-clear"),this.options.clearOnComplete)this.terminal.clearBottom();else{for(let _=0;_<this.bars.length;_++){if(_>0)this.terminal.newline();this.bars[_].render(),this.bars[_].stop()}this.terminal.newline()}this.emit("stop")}log(_){this.loggingBuffer.push(_)}}});var R6=N((lG,I6)=>{I6.exports={format:"progress [{bar}] {percentage}% | ETA: {eta}s | {value}/{total}",barCompleteChar:"=",barIncompleteChar:"-"}});var T6=N((iG,N6)=>{N6.exports={format:" {bar} {percentage}% | ETA: {eta}s | {value}/{total}",barCompleteChar:"█",barIncompleteChar:"░"}});var O6=N((nG,j6)=>{j6.exports={format:" \x1B[90m{bar}\x1B[0m {percentage}% | ETA: {eta}s | {value}/{total}",barCompleteChar:"█",barIncompleteChar:"░"}});var P6=N((aG,x6)=>{x6.exports={format:" {bar}■ {percentage}% | ETA: {eta}s | {value}/{total}",barCompleteChar:"■",barIncompleteChar:" "}});var Y6=N((sG,z6)=>{var Ru=R6(),Nu=T6(),Tu=O6(),ju=P6();z6.exports={legacy:Ru,shades_classic:Nu,shades_grey:Tu,rect:ju}});var y6=N((rG,S6)=>{var w6=A6(),Ou=L6(),xu=Y6(),Pu=X8(),zu=$8(),Yu=G8(),wu=q8();S6.exports={Bar:w6,SingleBar:w6,MultiBar:Ou,Presets:xu,Format:{Formatter:Pu,BarFormat:Yu,ValueFormat:zu,TimeFormat:wu}}});var Q8=N((uq,d6)=>{/*! arch. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var h6=x("child_process"),m6=x("fs"),vu=x("path");d6.exports=function D(){if(process.arch==="x64")return"x64";if(process.platform==="darwin"){var _=process.arch==="arm64",u=h6.execSync("sysctl -in sysctl.proc_translated",{encoding:"utf8"})===`1
36
- `;return _||u?"arm64":"x64"}if(process.platform==="win32"){var F=!1;try{F=!!(process.env.SYSTEMROOT&&m6.statSync(process.env.SYSTEMROOT))}catch($){}var B=F?process.env.SYSTEMROOT:"C:\\Windows",E=!1;try{E=!!m6.statSync(vu.join(B,"sysnative"))}catch($){}return E?"x64":"x86"}if(process.platform==="linux"){var C=h6.execSync("getconf LONG_BIT",{encoding:"utf8"});return C===`64
37
- `?"x64":"x86"}return"x86"}});var n6=N((Bq,i6)=>{function bu(D){return D&&D.__esModule&&Object.prototype.hasOwnProperty.call(D,"default")?D.default:D}var hu=new Int32Array([0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918000,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117]);function l6(D){if(Buffer.isBuffer(D))return D;if(typeof D==="number")return Buffer.alloc(D);else if(typeof D==="string")return Buffer.from(D);else throw new Error("input must be buffer, number, or string, received "+typeof D)}function mu(D){let _=l6(4);return _.writeInt32BE(D,0),_}function K8(D,_){if(D=l6(D),Buffer.isBuffer(_))_=_.readUInt32BE(0);let u=~~_^-1;for(var F=0;F<D.length;F++)u=hu[(u^D[F])&255]^u>>>8;return u^-1}function U8(){return mu(K8.apply(null,arguments))}U8.signed=function(){return K8.apply(null,arguments)};U8.unsigned=function(){return K8.apply(null,arguments)>>>0};var du=U8,gu=bu(du);i6.exports=gu});var Z5=N((su)=>{var a6=x("fs"),d2=x("stream").Transform,o6=x("stream").PassThrough,t6=x("zlib"),V8=x("util"),fu=x("events").EventEmitter,cu=x("events").errorMonitor,e6=n6();su.ZipFile=eD;su.dateToDosDateTime=X5;V8.inherits(eD,fu);function eD(){this.outputStream=new o6,this.entries=[],this.outputStreamCursor=0,this.ended=!1,this.allDone=!1,this.forceZip64Eocd=!1,this.errored=!1,this.on(cu,function(){this.errored=!0})}eD.prototype.addFile=function(D,_,u){var F=this;if(_=f2(_,!1),u==null)u={};if(g2(F))return;var B=new d(_,!1,u);F.entries.push(B),a6.stat(D,function(E,C){if(E)return F.emit("error",E);if(!C.isFile())return F.emit("error",new Error("not a file: "+D));if(B.uncompressedSize=C.size,u.mtime==null)B.setLastModDate(C.mtime);if(u.mode==null)B.setFileAttributesMode(C.mode);B.setFileDataPumpFunction(function(){var $=a6.createReadStream(D);B.state=d.FILE_DATA_IN_PROGRESS,$.on("error",function(q){F.emit("error",q)}),D5(F,B,$)}),tD(F)})};eD.prototype.addReadStream=function(D,_,u){this.addReadStreamLazy(_,u,function(F){F(null,D)})};eD.prototype.addReadStreamLazy=function(D,_,u){var F=this;if(typeof _==="function")u=_,_=null;if(_==null)_={};if(D=f2(D,!1),g2(F))return;var B=new d(D,!1,_);F.entries.push(B),B.setFileDataPumpFunction(function(){B.state=d.FILE_DATA_IN_PROGRESS,u(function(E,C){if(E)return F.emit("error",E);D5(F,B,C)})}),tD(F)};eD.prototype.addBuffer=function(D,_,u){var F=this;if(_=f2(_,!1),D.length>1073741823)throw new Error("buffer too large: "+D.length+" > 1073741823");if(u==null)u={};if(u.size!=null)throw new Error("options.size not allowed");if(g2(F))return;var B=new d(_,!1,u);if(B.uncompressedSize=D.length,B.crc32=e6.unsigned(D),B.crcAndFileSizeKnown=!0,F.entries.push(B),B.compressionLevel===0)E(D);else t6.deflateRaw(D,{level:B.compressionLevel},function(C,$){E($)});function E(C){B.compressedSize=C.length,B.setFileDataPumpFunction(function(){U0(F,C),U0(F,B.getDataDescriptor()),B.state=d.FILE_DATA_DONE,setImmediate(function(){tD(F)})}),tD(F)}};eD.prototype.addEmptyDirectory=function(D,_){var u=this;if(D=f2(D,!0),_==null)_={};if(_.size!=null)throw new Error("options.size not allowed");if(_.compress!=null)throw new Error("options.compress not allowed");if(_.compressionLevel!=null)throw new Error("options.compressionLevel not allowed");if(g2(u))return;var F=new d(D,!0,_);u.entries.push(F),F.setFileDataPumpFunction(function(){U0(u,F.getDataDescriptor()),F.state=d.FILE_DATA_DONE,tD(u)}),tD(u)};var pu=oD([80,75,5,6]);eD.prototype.end=function(D,_){if(typeof D==="function")_=D,D=null;if(D==null)D={};if(this.ended)return;if(this.ended=!0,this.errored)return;if(this.calculatedTotalSizeCallback=_,this.forceZip64Eocd=!!D.forceZip64Format,D.comment){if(typeof D.comment==="string")this.comment=au(D.comment);else this.comment=D.comment;if(this.comment.length>65535)throw new Error("comment is too large");if(s0(this.comment,pu))throw new Error("comment contains end of central directory record signature")}else this.comment=r0;tD(this)};function U0(D,_){D.outputStream.write(_),D.outputStreamCursor+=_.length}function D5(D,_,u){var F=new L8,B=new m2,E=_.compressionLevel!==0?new t6.DeflateRaw({level:_.compressionLevel}):new o6,C=new m2;u.pipe(F).pipe(B).pipe(E).pipe(C).pipe(D.outputStream,{end:!1}),C.on("end",function(){if(_.crc32=F.crc32,_.uncompressedSize==null)_.uncompressedSize=B.byteCount;else if(_.uncompressedSize!==B.byteCount)return D.emit("error",new Error("file data stream has unexpected number of bytes"));_.compressedSize=C.byteCount,D.outputStreamCursor+=_.compressedSize,U0(D,_.getDataDescriptor()),_.state=d.FILE_DATA_DONE,tD(D)})}function lu(D){if(D.compress!=null&&D.compressionLevel!=null){if(!!D.compress!==!!D.compressionLevel)throw new Error("conflicting settings for compress and compressionLevel")}if(D.compressionLevel!=null)return D.compressionLevel;if(D.compress===!1)return 0;return 6}function tD(D){if(D.allDone||D.errored)return;if(D.ended&&D.calculatedTotalSizeCallback!=null){var _=iu(D);if(_!=null)D.calculatedTotalSizeCallback(_),D.calculatedTotalSizeCallback=null}var u=F();function F(){for(var E=0;E<D.entries.length;E++){var C=D.entries[E];if(C.state<d.FILE_DATA_DONE)return C}return null}if(u!=null){if(u.state<d.READY_TO_PUMP_FILE_DATA)return;if(u.state===d.FILE_DATA_IN_PROGRESS)return;u.relativeOffsetOfLocalHeader=D.outputStreamCursor;var B=u.getLocalFileHeader();U0(D,B),u.doFileDataPump()}else if(D.ended)D.offsetOfStartOfCentralDirectory=D.outputStreamCursor,D.entries.forEach(function(E){var C=E.getCentralDirectoryRecord();U0(D,C)}),U0(D,nu(D)),D.outputStream.end(),D.allDone=!0}function iu(D){var _=0,u=0;for(var F=0;F<D.entries.length;F++){var B=D.entries[F];if(B.compressionLevel!==0)return-1;if(B.state>=d.READY_TO_PUMP_FILE_DATA){if(B.uncompressedSize==null)return-1}else if(B.uncompressedSize==null)return null;B.relativeOffsetOfLocalHeader=_;var E=B.useZip64Format();if(_+=_5+B.utf8FileName.length,_+=B.uncompressedSize,!B.crcAndFileSizeKnown)if(E)_+=G5;else _+=$5;if(u+=q5+B.utf8FileName.length+B.fileComment.length,!B.forceDosTimestamp)u+=M8;if(E)u+=W8}var C=0;if(D.forceZip64Eocd||D.entries.length>=65535||u>=65535||_>=4294967295)C+=b2+H8;return C+=h2+D.comment.length,_+u+C}function g2(D){if(D.ended)throw new Error("cannot add entries after calling end()");if(D.errored)return!0;return!1}var b2=56,H8=20,h2=22;function nu(D,_){var u=!1,F=D.entries.length;if(D.forceZip64Eocd||D.entries.length>=65535)F=65535,u=!0;var B=D.outputStreamCursor-D.offsetOfStartOfCentralDirectory,E=B;if(D.forceZip64Eocd||B>=4294967295)E=4294967295,u=!0;var C=D.offsetOfStartOfCentralDirectory;if(D.forceZip64Eocd||D.offsetOfStartOfCentralDirectory>=4294967295)C=4294967295,u=!0;if(_)if(u)return b2+H8+h2;else return h2;var $=XD(h2+D.comment.length);if($.writeUInt32LE(101010256,0),$.writeUInt16LE(0,4),$.writeUInt16LE(0,6),$.writeUInt16LE(F,8),$.writeUInt16LE(F,10),$.writeUInt32LE(E,12),$.writeUInt32LE(C,16),$.writeUInt16LE(D.comment.length,20),D.comment.copy($,22),!u)return $;var q=XD(b2);q.writeUInt32LE(101075792,0),AD(q,b2-12,4),q.writeUInt16LE(B5,12),q.writeUInt16LE(F5,14),q.writeUInt32LE(0,16),q.writeUInt32LE(0,20),AD(q,D.entries.length,24),AD(q,D.entries.length,32),AD(q,B,40),AD(q,D.offsetOfStartOfCentralDirectory,48);var X=XD(H8);return X.writeUInt32LE(117853008,0),X.writeUInt32LE(0,4),AD(X,D.outputStreamCursor,8),X.writeUInt32LE(1,16),Buffer.concat([q,X,$])}function f2(D,_){if(D==="")throw new Error("empty metadataPath");if(D=D.replace(/\\/g,"/"),/^[a-zA-Z]:/.test(D)||/^\//.test(D))throw new Error("absolute path: "+D);if(D.split("/").indexOf("..")!==-1)throw new Error("invalid relative path: "+D);var u=/\/$/.test(D);if(_){if(!u)D+="/"}else if(u)throw new Error("file path cannot end with '/': "+D);return D}var r0=XD(0);function d(D,_,u){if(this.utf8FileName=oD(D),this.utf8FileName.length>65535)throw new Error("utf8 file name too long. "+utf8FileName.length+" > 65535");if(this.isDirectory=_,this.state=d.WAITING_FOR_METADATA,this.setLastModDate(u.mtime!=null?u.mtime:new Date),this.forceDosTimestamp=!!u.forceDosTimestamp,u.mode!=null)this.setFileAttributesMode(u.mode);else this.setFileAttributesMode(_?16893:33204);if(_)this.crcAndFileSizeKnown=!0,this.crc32=0,this.uncompressedSize=0,this.compressedSize=0;else if(this.crcAndFileSizeKnown=!1,this.crc32=null,this.uncompressedSize=null,this.compressedSize=null,u.size!=null)this.uncompressedSize=u.size;if(_)this.compressionLevel=0;else this.compressionLevel=lu(u);if(this.forceZip64Format=!!u.forceZip64Format,u.fileComment){if(typeof u.fileComment==="string")this.fileComment=oD(u.fileComment,"utf-8");else this.fileComment=u.fileComment;if(this.fileComment.length>65535)throw new Error("fileComment is too large")}else this.fileComment=r0}d.WAITING_FOR_METADATA=0;d.READY_TO_PUMP_FILE_DATA=1;d.FILE_DATA_IN_PROGRESS=2;d.FILE_DATA_DONE=3;d.prototype.setLastModDate=function(D){this.mtime=D;var _=X5(D);this.lastModFileTime=_.time,this.lastModFileDate=_.date};d.prototype.setFileAttributesMode=function(D){if((D&65535)!==D)throw new Error("invalid mode. expected: 0 <= "+D+" <= 65535");this.externalFileAttributes=D<<16>>>0};d.prototype.setFileDataPumpFunction=function(D){this.doFileDataPump=D,this.state=d.READY_TO_PUMP_FILE_DATA};d.prototype.useZip64Format=function(){return this.forceZip64Format||this.uncompressedSize!=null&&this.uncompressedSize>4294967294||this.compressedSize!=null&&this.compressedSize>4294967294||this.relativeOffsetOfLocalHeader!=null&&this.relativeOffsetOfLocalHeader>4294967294};var _5=30,u5=20,F5=45,B5=831,E5=2048,C5=8;d.prototype.getLocalFileHeader=function(){var D=0,_=0,u=0;if(this.crcAndFileSizeKnown)D=this.crc32,_=this.compressedSize,u=this.uncompressedSize;var F=XD(_5),B=E5;if(!this.crcAndFileSizeKnown)B|=C5;return F.writeUInt32LE(67324752,0),F.writeUInt16LE(u5,4),F.writeUInt16LE(B,6),F.writeUInt16LE(this.getCompressionMethod(),8),F.writeUInt16LE(this.lastModFileTime,10),F.writeUInt16LE(this.lastModFileDate,12),F.writeUInt32LE(D,14),F.writeUInt32LE(_,18),F.writeUInt32LE(u,22),F.writeUInt16LE(this.utf8FileName.length,26),F.writeUInt16LE(0,28),Buffer.concat([F,this.utf8FileName])};var $5=16,G5=24;d.prototype.getDataDescriptor=function(){if(this.crcAndFileSizeKnown)return r0;if(!this.useZip64Format()){var D=XD($5);return D.writeUInt32LE(134695760,0),D.writeUInt32LE(this.crc32,4),D.writeUInt32LE(this.compressedSize,8),D.writeUInt32LE(this.uncompressedSize,12),D}else{var D=XD(G5);return D.writeUInt32LE(134695760,0),D.writeUInt32LE(this.crc32,4),AD(D,this.compressedSize,8),AD(D,this.uncompressedSize,16),D}};var q5=46,M8=9,W8=28;d.prototype.getCentralDirectoryRecord=function(){var D=XD(q5),_=E5;if(!this.crcAndFileSizeKnown)_|=C5;var u=r0;if(!this.forceDosTimestamp){u=XD(M8),u.writeUInt16LE(21589,0),u.writeUInt16LE(M8-4,2);var F=1,B=2;u.writeUInt8(F|B,4);var E=Math.floor(this.mtime.getTime()/1000);if(E<-2147483648)E=-2147483648;if(E>2147483647)E=2147483647;u.writeUInt32LE(E,5)}var C=this.compressedSize,$=this.uncompressedSize,q=this.relativeOffsetOfLocalHeader,X=u5,G=r0;if(this.useZip64Format())C=4294967295,$=4294967295,q=4294967295,X=F5,G=XD(W8),G.writeUInt16LE(1,0),G.writeUInt16LE(W8-4,2),AD(G,this.uncompressedSize,4),AD(G,this.compressedSize,12),AD(G,this.relativeOffsetOfLocalHeader,20);return D.writeUInt32LE(33639248,0),D.writeUInt16LE(B5,4),D.writeUInt16LE(X,6),D.writeUInt16LE(_,8),D.writeUInt16LE(this.getCompressionMethod(),10),D.writeUInt16LE(this.lastModFileTime,12),D.writeUInt16LE(this.lastModFileDate,14),D.writeUInt32LE(this.crc32,16),D.writeUInt32LE(C,20),D.writeUInt32LE($,24),D.writeUInt16LE(this.utf8FileName.length,28),D.writeUInt16LE(u.length+G.length,30),D.writeUInt16LE(this.fileComment.length,32),D.writeUInt16LE(0,34),D.writeUInt16LE(0,36),D.writeUInt32LE(this.externalFileAttributes,38),D.writeUInt32LE(q,42),Buffer.concat([D,this.utf8FileName,u,G,this.fileComment])};d.prototype.getCompressionMethod=function(){var D=0,_=8;return this.compressionLevel===0?D:_};var s6=new Date(1980,0,1),r6=new Date(2107,11,31,23,59,58);function X5(D){if(D<s6)D=s6;else if(D>r6)D=r6;var _=0;_|=D.getDate()&31,_|=(D.getMonth()+1&15)<<5,_|=(D.getFullYear()-1980&127)<<9;var u=0;return u|=Math.floor(D.getSeconds()/2),u|=(D.getMinutes()&63)<<5,u|=(D.getHours()&31)<<11,{date:_,time:u}}function AD(D,_,u){var F=Math.floor(_/4294967296),B=_%4294967296;D.writeUInt32LE(B,u),D.writeUInt32LE(F,u+4)}V8.inherits(m2,d2);function m2(D){d2.call(this,D),this.byteCount=0}m2.prototype._transform=function(D,_,u){this.byteCount+=D.length,u(null,D)};V8.inherits(L8,d2);function L8(D){d2.call(this,D),this.crc32=0}L8.prototype._transform=function(D,_,u){this.crc32=e6.unsigned(D,this.crc32),u(null,D)};var A8="\x00☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ";if(A8.length!==256)throw new Error("assertion failure");var v2=null;function au(D){if(/^[\x20-\x7e]*$/.test(D))return oD(D,"utf-8");if(v2==null){v2={};for(var _=0;_<A8.length;_++)v2[A8[_]]=_}var u=XD(D.length);for(var _=0;_<D.length;_++){var F=v2[D[_]];if(F==null)throw new Error("character not encodable in CP437: "+JSON.stringify(D[_]));u[_]=F}return u}function XD(D){XD=_;try{return XD(D)}catch(F){return XD=u,XD(D)}function _(F){return Buffer.allocUnsafe(F)}function u(F){return new Buffer(F)}}function oD(D,_){oD=u;try{return oD(D,_)}catch(B){return oD=F,oD(D,_)}function u(B,E){return Buffer.from(B,E)}function F(B,E){return new Buffer(B,E)}}function s0(D,_){s0=u;try{return s0(D,_)}catch(B){return s0=F,s0(D,_)}function u(B,E){return B.includes(E)}function F(B,E){for(var C=0;C<=B.length-E.length;C++)for(var $=0;;$++){if($===E.length)return!0;if(B[C+$]!==E[$])break}return!1}}});var c2=N((J5)=>{Object.defineProperty(J5,"__esModule",{value:!0});J5.unlink=tu;J5.mkdir=eu;J5.realpath=DF;J5.stat=_F;J5.lstat=uF;J5.chmod=FF;J5.readdir=BF;J5.access=EF;J5.rmdir=CF;J5.symlink=$F;J5.readlink=GF;var VD=x("fs"),LD=x("util");function tu(D){return LD.promisify(VD.unlink)(D)}function eu(D,_){return LD.promisify(VD.mkdir)(D,_)}function DF(D){return LD.promisify(VD.realpath)(D)}function _F(D){return LD.promisify(VD.stat)(D)}function uF(D){return LD.promisify(VD.lstat)(D)}function FF(D,_){return LD.promisify(VD.chmod)(D,_)}function BF(D){return LD.promisify(VD.readdir)(D)}function EF(D,_){return LD.promisify(VD.access)(D,_)}function CF(D){return LD.promisify(VD.rmdir)(D)}function $F(D,_,u){return LD.promisify(VD.symlink)(D,_,u)}function GF(D){return LD.promisify(VD.readlink)(D)}});var I8=N((A5)=>{Object.defineProperty(A5,"__esModule",{value:!0});A5.readdirp=K5;A5.getFileEntry=U5;A5.ensureFolder=H5;A5.pathExists=VF;A5.rimraf=M5;A5.isRootPath=W5;var p2=x("path"),ID=c2();async function K5(D){let _=[],u=await ID.readdir(D);for(let F of u){let B=p2.join(D,F),E=await U5(B);if(!E.isSymbolicLink&&E.type==="dir"){let C=await K5(B);if(C.length>0){_.push(...C);continue}}_.push(E)}return _}async function U5(D){let _=await ID.lstat(D),u=!1,F="file";if(_.isDirectory())F="dir";else if(_.isSymbolicLink()){if(u=!0,(await ID.stat(D)).isDirectory())F="dir"}return{path:D,isSymbolicLink:u,type:F,mtime:_.mtime,mode:_.mode}}async function H5(D){if(D===p2.dirname(D))return Promise.resolve();try{await Q5(D)}catch(_){if(_.code==="ENOENT")return await H5(p2.dirname(D)),Q5(D);return Promise.reject(_)}}async function VF(D){try{return await ID.access(D),!0}catch(_){return!1}}async function M5(D){if(W5(D))return Promise.reject(new Error(`Refuse to recursively delete root, path: "${D}"`));try{let _=await ID.lstat(D);if(_.isDirectory()&&!_.isSymbolicLink()){let u=await ID.readdir(D);await Promise.all(u.map((F)=>M5(p2.join(D,F)))),await ID.rmdir(D)}else{let u=_.mode;if(!(u&128))await ID.chmod(D,u|128);return ID.unlink(D)}}catch(_){if(_.code!=="ENOENT")throw _}}async function Q5(D){try{await ID.mkdir(D,511)}catch(_){if(_.code==="ENOENT")return Promise.reject(_);try{if(!(await ID.stat(D)).isDirectory())return Promise.reject(new Error(`"${D}" exists and is not a directory.`))}catch(u){throw _}}}var LF=65,IF=90,RF=97,NF=122,TF=58,jF=92,OF=47;function xF(D){return D>=LF&&D<=IF||D>=RF&&D<=NF}var PF="\\",zF="/";function W5(D){if(!D)return!1;if(D===PF||D===zF)return!0;if(process.platform==="win32"){if(D.length>3)return!1;return xF(D.charCodeAt(0))&&D.charCodeAt(1)===TF&&(D.length===2||D.charCodeAt(2)===jF||D.charCodeAt(2)===OF)}return!1}});var R8=N((I5)=>{Object.defineProperty(I5,"__esModule",{value:!0});I5.Cancelable=I5.CancellationToken=void 0;class V5{constructor(){this._isCancelled=!1,this._callbacks=new Set}get isCancelled(){return this._isCancelled}onCancelled(D){if(this.isCancelled)return D(),()=>{};return this._callbacks.add(D),()=>this._callbacks.delete(D)}cancel(){if(this._isCancelled)return;this._isCancelled=!0,this._callbacks.forEach((D)=>D()),this._callbacks.clear()}}I5.CancellationToken=V5;class L5{wrapError(D,_){if(_)return this.canceledError();return D}canceledError(){let D=new Error("Canceled");return D.name=D.message,D}}I5.Cancelable=L5});var T8=N((x5)=>{Object.defineProperty(x5,"__esModule",{value:!0});x5.Zip=void 0;var hF=Z5(),N5=x("fs"),N8=I8(),l2=x("path"),T5=c2(),j5=R8();class O5 extends j5.Cancelable{constructor(D){super();this.options=D,this.isPipe=!1,this.zipFiles=[],this.zipFolders=[]}addFile(D,_){let u=_;if(!u)u=l2.basename(D);this.zipFiles.push({path:D,metadataPath:u})}addFolder(D,_){this.zipFolders.push({path:D,metadataPath:_})}async archive(D){if(!D)return Promise.reject(new Error("zipPath must not be empty"));let _=new j5.CancellationToken;return this.token=_,this.isPipe=!1,await N8.ensureFolder(l2.dirname(D)),this.yazlFile=new hF.ZipFile,new Promise(async(u,F)=>{this.yazlFile.once("error",(E)=>{F(this.wrapError(E,_.isCancelled))});let B=this.yazlFile;if(!_.isCancelled)this.zipStream=N5.createWriteStream(D),this.zipStream.once("error",(E)=>{F(this.wrapError(E,_.isCancelled))}),this.zipStream.once("close",()=>{if(_.isCancelled)F(this.canceledError());else u(void 0)}),B.outputStream.once("error",(E)=>{F(this.wrapError(E,_.isCancelled))}),B.outputStream.pipe(this.zipStream),this.isPipe=!0;try{let E=this.zipFiles;for(let C of E){let $=await N8.getFileEntry(C.path);await this.addEntry(B,$,C,_)}if(this.zipFolders.length>0)await this.walkDir(this.zipFolders,_)}catch(E){F(this.wrapError(E,_.isCancelled));return}B.end()})}cancel(){if(this.token)this.token.cancel(),this.token=null;this.stopPipe(this.canceledError())}async addEntry(D,_,u,F){if(_.isSymbolicLink)if(this.followSymlink())if(_.type==="dir"){let B=await T5.realpath(u.path);await this.walkDir([{path:B,metadataPath:u.metadataPath}],F)}else D.addFile(u.path,u.metadataPath,this.getYazlOption());else await this.addSymlink(D,_,u.metadataPath);else if(_.type==="dir")D.addEmptyDirectory(u.metadataPath,{mtime:_.mtime,mode:_.mode});else await this.addFileStream(D,_,u.metadataPath,F)}addFileStream(D,_,u,F){return new Promise((B,E)=>{let C=N5.createReadStream(_.path);C.once("error",($)=>{let q=this.wrapError($,F.isCancelled);this.stopPipe(q),E(q)}),C.once("close",()=>{B()}),D.addReadStream(C,u,Object.assign(Object.assign({},this.getYazlOption()),{mode:_.mode,mtime:_.mtime}))})}async addSymlink(D,_,u){let F=await T5.readlink(_.path);D.addBuffer(Buffer.from(F),u,Object.assign(Object.assign({},this.getYazlOption()),{mtime:_.mtime,mode:_.mode}))}async walkDir(D,_){for(let u of D){if(_.isCancelled)return;let F=await N8.readdirp(u.path);if(F.length>0)for(let B of F){if(_.isCancelled)return;let E=l2.relative(u.path,B.path),C=u.metadataPath?l2.join(u.metadataPath,E):E;await this.addEntry(this.yazlFile,B,{path:B.path,metadataPath:C},_)}else if(u.metadataPath)this.yazlFile.addEmptyDirectory(u.metadataPath)}}stopPipe(D){if(this.isPipe)this.yazlFile.outputStream.unpipe(this.zipStream),this.zipStream.destroy(D),this.isPipe=!1}followSymlink(){let D=!1;if(this.options&&this.options.followSymlinks===!0)D=!0;return D}getYazlOption(){if(!this.options)return;if(typeof this.options.compressionLevel!=="number")return;return{compressionLevel:this.options.compressionLevel}}}x5.Zip=O5});var S5=N((Xq,w5)=>{w5.exports=i2;function i2(){this.pending=0,this.max=1/0,this.listeners=[],this.waiting=[],this.error=null}i2.prototype.go=function(D){if(this.pending<this.max)Y5(this,D);else this.waiting.push(D)};i2.prototype.wait=function(D){if(this.pending===0)D(this.error);else this.listeners.push(D)};i2.prototype.hold=function(){return z5(this)};function z5(D){D.pending+=1;var _=!1;return u;function u(B){if(_)throw new Error("callback called twice");if(_=!0,D.error=D.error||B,D.pending-=1,D.waiting.length>0&&D.pending<D.max)Y5(D,D.waiting.shift());else if(D.pending===0){var E=D.listeners;D.listeners=[],E.forEach(F)}}function F(B){B(D.error)}}function Y5(D,_){_(z5(D))}});var k5=N((cF)=>{var o0=x("fs"),n2=x("util"),j8=x("stream"),y5=j8.Readable,O8=j8.Writable,mF=j8.PassThrough,dF=S5(),a2=x("events").EventEmitter;cF.createFromBuffer=gF;cF.createFromFd=fF;cF.BufferSlicer=gD;cF.FdSlicer=dD;n2.inherits(dD,a2);function dD(D,_){_=_||{},a2.call(this),this.fd=D,this.pend=new dF,this.pend.max=1,this.refCount=0,this.autoClose=!!_.autoClose}dD.prototype.read=function(D,_,u,F,B){var E=this;E.pend.go(function(C){o0.read(E.fd,D,_,u,F,function($,q,X){C(),B($,q,X)})})};dD.prototype.write=function(D,_,u,F,B){var E=this;E.pend.go(function(C){o0.write(E.fd,D,_,u,F,function($,q,X){C(),B($,q,X)})})};dD.prototype.createReadStream=function(D){return new s2(this,D)};dD.prototype.createWriteStream=function(D){return new r2(this,D)};dD.prototype.ref=function(){this.refCount+=1};dD.prototype.unref=function(){var D=this;if(D.refCount-=1,D.refCount>0)return;if(D.refCount<0)throw new Error("invalid unref");if(D.autoClose)o0.close(D.fd,_);function _(u){if(u)D.emit("error",u);else D.emit("close")}};n2.inherits(s2,y5);function s2(D,_){_=_||{},y5.call(this,_),this.context=D,this.context.ref(),this.start=_.start||0,this.endOffset=_.end,this.pos=this.start,this.destroyed=!1}s2.prototype._read=function(D){var _=this;if(_.destroyed)return;var u=Math.min(_._readableState.highWaterMark,D);if(_.endOffset!=null)u=Math.min(u,_.endOffset-_.pos);if(u<=0){_.destroyed=!0,_.push(null),_.context.unref();return}_.context.pend.go(function(F){if(_.destroyed)return F();var B=Buffer.allocUnsafe(u);o0.read(_.context.fd,B,0,u,_.pos,function(E,C){if(E)_.destroy(E);else if(C===0)_.destroyed=!0,_.push(null),_.context.unref();else _.pos+=C,_.push(B.slice(0,C));F()})})};s2.prototype.destroy=function(D){if(this.destroyed)return;D=D||new Error("stream destroyed"),this.destroyed=!0,this.emit("error",D),this.context.unref()};n2.inherits(r2,O8);function r2(D,_){_=_||{},O8.call(this,_),this.context=D,this.context.ref(),this.start=_.start||0,this.endOffset=_.end==null?1/0:+_.end,this.bytesWritten=0,this.pos=this.start,this.destroyed=!1,this.on("finish",this.destroy.bind(this))}r2.prototype._write=function(D,_,u){var F=this;if(F.destroyed)return;if(F.pos+D.length>F.endOffset){var B=new Error("maximum file length exceeded");B.code="ETOOBIG",F.destroy(),u(B);return}F.context.pend.go(function(E){if(F.destroyed)return E();o0.write(F.context.fd,D,0,D.length,F.pos,function(C,$){if(C)F.destroy(),E(),u(C);else F.bytesWritten+=$,F.pos+=$,F.emit("progress"),E(),u()})})};r2.prototype.destroy=function(){if(this.destroyed)return;this.destroyed=!0,this.context.unref()};n2.inherits(gD,a2);function gD(D,_){a2.call(this),_=_||{},this.refCount=0,this.buffer=D,this.maxChunkSize=_.maxChunkSize||Number.MAX_SAFE_INTEGER}gD.prototype.read=function(D,_,u,F,B){if(!(0<=_&&_<=D.length))throw new RangeError("offset outside buffer: 0 <= "+_+" <= "+D.length);if(F<0)throw new RangeError("position is negative: "+F);if(_+u>D.length)u=D.length-_;if(F+u>this.buffer.length)u=this.buffer.length-F;if(u<=0){setImmediate(function(){B(null,0)});return}this.buffer.copy(D,_,F,F+u),setImmediate(function(){B(null,u)})};gD.prototype.write=function(D,_,u,F,B){D.copy(this.buffer,F,_,_+u),setImmediate(function(){B(null,u,D)})};gD.prototype.createReadStream=function(D){D=D||{};var _=new mF(D);_.destroyed=!1,_.start=D.start||0,_.endOffset=D.end,_.pos=_.endOffset||this.buffer.length;var u=this.buffer.slice(_.start,_.pos),F=0;while(!0){var B=F+this.maxChunkSize;if(B>=u.length){if(F<u.length)_.write(u.slice(F,u.length));break}_.write(u.slice(F,B)),F=B}return _.end(),_.destroy=function(){_.destroyed=!0},_};gD.prototype.createWriteStream=function(D){var _=this;D=D||{};var u=new O8(D);return u.start=D.start||0,u.endOffset=D.end==null?this.buffer.length:+D.end,u.bytesWritten=0,u.pos=u.start,u.destroyed=!1,u._write=function(F,B,E){if(u.destroyed)return;var C=u.pos+F.length;if(C>u.endOffset){var $=new Error("maximum file length exceeded");$.code="ETOOBIG",u.destroyed=!0,E($);return}F.copy(_.buffer,u.pos,0,F.length),u.bytesWritten+=F.length,u.pos=C,u.emit("progress"),E()},u.destroy=function(){u.destroyed=!0},u};gD.prototype.ref=function(){this.refCount+=1};gD.prototype.unref=function(){if(this.refCount-=1,this.refCount<0)throw new Error("invalid unref")};function gF(D,_){return new gD(D,_)}function fF(D,_){return new dD(D,_)}});var h5=N((Jq,b5)=>{var D0=x("buffer").Buffer,x8=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918000,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];if(typeof Int32Array!=="undefined")x8=new Int32Array(x8);function v5(D){if(D0.isBuffer(D))return D;var _=typeof D0.alloc==="function"&&typeof D0.from==="function";if(typeof D==="number")return _?D0.alloc(D):new D0(D);else if(typeof D==="string")return _?D0.from(D):new D0(D);else throw new Error("input must be buffer, number, or string, received "+typeof D)}function aF(D){var _=v5(4);return _.writeInt32BE(D,0),_}function P8(D,_){if(D=v5(D),D0.isBuffer(_))_=_.readUInt32BE(0);var u=~~_^-1;for(var F=0;F<D.length;F++)u=x8[(u^D[F])&255]^u>>>8;return u^-1}function z8(){return aF(P8.apply(null,arguments))}z8.signed=function(){return P8.apply(null,arguments)};z8.unsigned=function(){return P8.apply(null,arguments)>>>0};b5.exports=z8});var a5=N((_B)=>{var Y8=x("fs"),sF=x("zlib"),m5=k5(),rF=h5(),e2=x("util"),D3=x("events").EventEmitter,d5=x("stream").Transform,S8=x("stream").PassThrough,oF=x("stream").Writable;_B.open=tF;_B.fromFd=g5;_B.fromBuffer=eF;_B.fromRandomAccessReader=y8;_B.dosDateTimeToDate=p5;_B.getFileNameLowLevel=l5;_B.validateFileName=i5;_B.parseExtraFields=n5;_B.ZipFile=PD;_B.Entry=t0;_B.LocalFileHeader=c5;_B.RandomAccessReader=_0;function tF(D,_,u){if(typeof _==="function")u=_,_=null;if(_==null)_={};if(_.autoClose==null)_.autoClose=!0;if(_.lazyEntries==null)_.lazyEntries=!1;if(_.decodeStrings==null)_.decodeStrings=!0;if(_.validateEntrySizes==null)_.validateEntrySizes=!0;if(_.strictFileNames==null)_.strictFileNames=!1;if(u==null)u=t2;Y8.open(D,"r",function(F,B){if(F)return u(F);g5(B,_,function(E,C){if(E)Y8.close(B,t2);u(E,C)})})}function g5(D,_,u){if(typeof _==="function")u=_,_=null;if(_==null)_={};if(_.autoClose==null)_.autoClose=!1;if(_.lazyEntries==null)_.lazyEntries=!1;if(_.decodeStrings==null)_.decodeStrings=!0;if(_.validateEntrySizes==null)_.validateEntrySizes=!0;if(_.strictFileNames==null)_.strictFileNames=!1;if(u==null)u=t2;Y8.fstat(D,function(F,B){if(F)return u(F);var E=m5.createFromFd(D,{autoClose:!0});y8(E,B.size,_,u)})}function eF(D,_,u){if(typeof _==="function")u=_,_=null;if(_==null)_={};if(_.autoClose=!1,_.lazyEntries==null)_.lazyEntries=!1;if(_.decodeStrings==null)_.decodeStrings=!0;if(_.validateEntrySizes==null)_.validateEntrySizes=!0;if(_.strictFileNames==null)_.strictFileNames=!1;var F=m5.createFromBuffer(D,{maxChunkSize:65536});y8(F,D.length,_,u)}function y8(D,_,u,F){if(typeof u==="function")F=u,u=null;if(u==null)u={};if(u.autoClose==null)u.autoClose=!0;if(u.lazyEntries==null)u.lazyEntries=!1;if(u.decodeStrings==null)u.decodeStrings=!0;var B=!!u.decodeStrings;if(u.validateEntrySizes==null)u.validateEntrySizes=!0;if(u.strictFileNames==null)u.strictFileNames=!1;if(F==null)F=t2;if(typeof _!=="number")throw new Error("expected totalSize parameter to be a number");if(_>Number.MAX_SAFE_INTEGER)throw new Error("zip file too large. only file sizes up to 2^52 are supported due to JavaScript's Number type being an IEEE 754 double.");D.ref();var E=22,C=20,$=65535,q=Math.min(C+E+$,_),X=fD(q),G=_-X.length;z0(D,X,0,q,G,function(Z){if(Z)return F(Z);for(var J=q-E;J>=0;J-=1){if(X.readUInt32LE(J)!==101010256)continue;var K=X.subarray(J),Q=K.readUInt16LE(4),M=K.readUInt16LE(10),W=K.readUInt32LE(16),V=K.readUInt16LE(20),L=K.length-E;if(V!==L)return F(new Error("Invalid comment length. Expected: "+L+". Found: "+V+". Are there extra bytes at the end of the file? Or is the end of central dir signature `PK☺☻` in the comment?"));var T=B?o2(K.subarray(22),!1):K.subarray(22);if(J-C>=0&&X.readUInt32LE(J-C)===117853008){var S=X.subarray(J-C,J-C+C),j=P0(S,8),v=fD(56);return z0(D,v,0,v.length,j,function(DD){if(DD)return F(DD);if(v.readUInt32LE(0)!==101075792)return F(new Error("invalid zip64 end of central directory record signature"));if(Q=v.readUInt32LE(16),Q!==0)return F(new Error("multi-disk zip files are not supported: found disk number: "+Q));return M=P0(v,32),W=P0(v,48),F(null,new PD(D,W,_,M,T,u.autoClose,u.lazyEntries,B,u.validateEntrySizes,u.strictFileNames))})}if(Q!==0)return F(new Error("multi-disk zip files are not supported: found disk number: "+Q));return F(null,new PD(D,W,_,M,T,u.autoClose,u.lazyEntries,B,u.validateEntrySizes,u.strictFileNames))}F(new Error("End of central directory record signature not found. Either not a zip file, or file is truncated."))})}e2.inherits(PD,D3);function PD(D,_,u,F,B,E,C,$,q,X){var G=this;if(D3.call(G),G.reader=D,G.reader.on("error",function(Z){f5(G,Z)}),G.reader.once("close",function(){G.emit("close")}),G.readEntryCursor=_,G.fileSize=u,G.entryCount=F,G.comment=B,G.entriesRead=0,G.autoClose=!!E,G.lazyEntries=!!C,G.decodeStrings=!!$,G.validateEntrySizes=!!q,G.strictFileNames=!!X,G.isOpen=!0,G.emittedError=!1,!G.lazyEntries)G._readEntry()}PD.prototype.close=function(){if(!this.isOpen)return;this.isOpen=!1,this.reader.unref()};function xD(D,_){if(D.autoClose)D.close();f5(D,_)}function f5(D,_){if(D.emittedError)return;D.emittedError=!0,D.emit("error",_)}PD.prototype.readEntry=function(){if(!this.lazyEntries)throw new Error("readEntry() called without lazyEntries:true");this._readEntry()};PD.prototype._readEntry=function(){var D=this;if(D.entryCount===D.entriesRead){setImmediate(function(){if(D.autoClose)D.close();if(D.emittedError)return;D.emit("end")});return}if(D.emittedError)return;var _=fD(46);z0(D.reader,_,0,_.length,D.readEntryCursor,function(u){if(u)return xD(D,u);if(D.emittedError)return;var F=new t0,B=_.readUInt32LE(0);if(B!==33639248)return xD(D,new Error("invalid central directory file header signature: 0x"+B.toString(16)));if(F.versionMadeBy=_.readUInt16LE(4),F.versionNeededToExtract=_.readUInt16LE(6),F.generalPurposeBitFlag=_.readUInt16LE(8),F.compressionMethod=_.readUInt16LE(10),F.lastModFileTime=_.readUInt16LE(12),F.lastModFileDate=_.readUInt16LE(14),F.crc32=_.readUInt32LE(16),F.compressedSize=_.readUInt32LE(20),F.uncompressedSize=_.readUInt32LE(24),F.fileNameLength=_.readUInt16LE(28),F.extraFieldLength=_.readUInt16LE(30),F.fileCommentLength=_.readUInt16LE(32),F.internalFileAttributes=_.readUInt16LE(36),F.externalFileAttributes=_.readUInt32LE(38),F.relativeOffsetOfLocalHeader=_.readUInt32LE(42),F.generalPurposeBitFlag&64)return xD(D,new Error("strong encryption is not supported"));D.readEntryCursor+=46,_=fD(F.fileNameLength+F.extraFieldLength+F.fileCommentLength),z0(D.reader,_,0,_.length,D.readEntryCursor,function(E){if(E)return xD(D,E);if(D.emittedError)return;F.fileNameRaw=_.subarray(0,F.fileNameLength);var C=F.fileNameLength+F.extraFieldLength;F.extraFieldRaw=_.subarray(F.fileNameLength,C),F.fileCommentRaw=_.subarray(C,C+F.fileCommentLength);try{F.extraFields=n5(F.extraFieldRaw)}catch(M){return xD(D,M)}if(D.decodeStrings){var $=(F.generalPurposeBitFlag&2048)!==0;F.fileComment=o2(F.fileCommentRaw,$),F.fileName=l5(F.generalPurposeBitFlag,F.fileNameRaw,F.extraFields,D.strictFileNames);var q=i5(F.fileName);if(q!=null)return xD(D,new Error(q))}else F.fileComment=F.fileCommentRaw,F.fileName=F.fileNameRaw;F.comment=F.fileComment,D.readEntryCursor+=_.length,D.entriesRead+=1;for(var X=0;X<F.extraFields.length;X++){var G=F.extraFields[X];if(G.id!==1)continue;var Z=G.data,J=0;if(F.uncompressedSize===4294967295){if(J+8>Z.length)return xD(D,new Error("zip64 extended information extra field does not include uncompressed size"));F.uncompressedSize=P0(Z,J),J+=8}if(F.compressedSize===4294967295){if(J+8>Z.length)return xD(D,new Error("zip64 extended information extra field does not include compressed size"));F.compressedSize=P0(Z,J),J+=8}if(F.relativeOffsetOfLocalHeader===4294967295){if(J+8>Z.length)return xD(D,new Error("zip64 extended information extra field does not include relative header offset"));F.relativeOffsetOfLocalHeader=P0(Z,J),J+=8}break}if(D.validateEntrySizes&&F.compressionMethod===0){var K=F.uncompressedSize;if(F.isEncrypted())K+=12;if(F.compressedSize!==K){var Q="compressed/uncompressed size mismatch for stored file: "+F.compressedSize+" != "+F.uncompressedSize;return xD(D,new Error(Q))}}if(D.emit("entry",F),!D.lazyEntries)D._readEntry()})})};PD.prototype.openReadStream=function(D,_,u){var F=this,B=0,E=D.compressedSize;if(u==null)u=_,_=null;if(_==null)_={};else{if(_.decrypt!=null){if(!D.isEncrypted())throw new Error("options.decrypt can only be specified for encrypted entries");if(_.decrypt!==!1)throw new Error("invalid options.decrypt value: "+_.decrypt);if(D.isCompressed()){if(_.decompress!==!1)throw new Error("entry is encrypted and compressed, and options.decompress !== false")}}if(_.decompress!=null){if(!D.isCompressed())throw new Error("options.decompress can only be specified for compressed entries");if(!(_.decompress===!1||_.decompress===!0))throw new Error("invalid options.decompress value: "+_.decompress)}if(_.start!=null||_.end!=null){if(D.isCompressed()&&_.decompress!==!1)throw new Error("start/end range not allowed for compressed entry without options.decompress === false");if(D.isEncrypted()&&_.decrypt!==!1)throw new Error("start/end range not allowed for encrypted entry without options.decrypt === false")}if(_.start!=null){if(B=_.start,B<0)throw new Error("options.start < 0");if(B>D.compressedSize)throw new Error("options.start > entry.compressedSize")}if(_.end!=null){if(E=_.end,E<0)throw new Error("options.end < 0");if(E>D.compressedSize)throw new Error("options.end > entry.compressedSize");if(E<B)throw new Error("options.end < options.start")}}if(!F.isOpen)return u(new Error("closed"));if(D.isEncrypted()){if(_.decrypt!==!1)return u(new Error("entry is encrypted, and options.decrypt !== false"))}var C;if(D.compressionMethod===0)C=!1;else if(D.compressionMethod===8)C=_.decompress!=null?_.decompress:!0;else return u(new Error("unsupported compression method: "+D.compressionMethod));F.readLocalFileHeader(D,{minimal:!0},function($,q){if($)return u($);F.openReadStreamLowLevel(q.fileDataStart,D.compressedSize,B,E,C,D.uncompressedSize,u)})};PD.prototype.openReadStreamLowLevel=function(D,_,u,F,B,E,C){var $=this,q=D+_,X=$.reader.createReadStream({start:D+u,end:D+F}),G=X;if(B){var Z=!1,J=sF.createInflateRaw();if(X.on("error",function(K){setImmediate(function(){if(!Z)J.emit("error",K)})}),X.pipe(J),$.validateEntrySizes)G=new e0(E),J.on("error",function(K){setImmediate(function(){if(!Z)G.emit("error",K)})}),J.pipe(G);else G=J;w8(G,function(){if(Z=!0,J!==G)J.unpipe(G);X.unpipe(J),X.destroy()})}C(null,G)};PD.prototype.readLocalFileHeader=function(D,_,u){var F=this;if(u==null)u=_,_=null;if(_==null)_={};F.reader.ref();var B=fD(30);z0(F.reader,B,0,B.length,D.relativeOffsetOfLocalHeader,function(E){try{if(E)return u(E);var C=B.readUInt32LE(0);if(C!==67324752)return u(new Error("invalid local file header signature: 0x"+C.toString(16)));var $=B.readUInt16LE(26),q=B.readUInt16LE(28),X=D.relativeOffsetOfLocalHeader+30+$+q;if(X+D.compressedSize>F.fileSize)return u(new Error("file data overflows file bounds: "+X+" + "+D.compressedSize+" > "+F.fileSize));if(_.minimal)return u(null,{fileDataStart:X});var G=new c5;G.fileDataStart=X,G.versionNeededToExtract=B.readUInt16LE(4),G.generalPurposeBitFlag=B.readUInt16LE(6),G.compressionMethod=B.readUInt16LE(8),G.lastModFileTime=B.readUInt16LE(10),G.lastModFileDate=B.readUInt16LE(12),G.crc32=B.readUInt32LE(14),G.compressedSize=B.readUInt32LE(18),G.uncompressedSize=B.readUInt32LE(22),G.fileNameLength=$,G.extraFieldLength=q,B=fD($+q),F.reader.ref(),z0(F.reader,B,0,B.length,D.relativeOffsetOfLocalHeader+30,function(Z){try{if(Z)return u(Z);return G.fileName=B.subarray(0,$),G.extraField=B.subarray($),u(null,G)}finally{F.reader.unref()}})}finally{F.reader.unref()}})};function t0(){}t0.prototype.getLastModDate=function(D){if(D==null)D={};if(!D.forceDosFormat)for(var _=0;_<this.extraFields.length;_++){var u=this.extraFields[_];if(u.id===21589){var F=u.data;if(F.length<5)continue;var B=F[0],E=1;if(!(B&E))continue;var C=F.readInt32LE(1);return new Date(C*1000)}else if(u.id===10){var F=u.data,$=4;while($<F.length+4){var q=F.readUInt16LE($);$+=2;var X=F.readUInt16LE($);if($+=2,q!==1){$+=X;continue}if(X<8||$+X>F.length)break;var G=4294967296*F.readInt32LE($+4)+F.readUInt32LE($),Z=G/1e4-11644473600000;return new Date(Z)}}}return p5(this.lastModFileDate,this.lastModFileTime,D.timezone)};t0.prototype.isEncrypted=function(){return(this.generalPurposeBitFlag&1)!==0};t0.prototype.isCompressed=function(){return this.compressionMethod===8};function c5(){}function p5(D,_,u){var F=D&31,B=(D>>5&15)-1,E=(D>>9&127)+1980,C=0,$=(_&31)*2,q=_>>5&63,X=_>>11&31;if(u==null||u==="local")return new Date(E,B,F,X,q,$,C);else if(u==="UTC")return new Date(Date.UTC(E,B,F,X,q,$,C));else throw new Error("unrecognized options.timezone: "+options.timezone)}function l5(D,_,u,F){var B=null;for(var E=0;E<u.length;E++){var C=u[E];if(C.id===28789){if(C.data.length<6)continue;if(C.data.readUInt8(0)!==1)continue;var $=C.data.readUInt32LE(1);if(rF.unsigned(_)!==$)continue;B=o2(C.data.subarray(5),!0);break}}if(B==null){var q=(D&2048)!==0;B=o2(_,q)}if(!F)B=B.replace(/\\/g,"/");return B}function i5(D){if(D.indexOf("\\")!==-1)return"invalid characters in fileName: "+D;if(/^[a-zA-Z]:/.test(D)||/^\//.test(D))return"absolute path: "+D;if(D.split("/").indexOf("..")!==-1)return"invalid relative path: "+D;return null}function n5(D){var _=[],u=0;while(u<D.length-3){var F=D.readUInt16LE(u+0),B=D.readUInt16LE(u+2),E=u+4,C=E+B;if(C>D.length)throw new Error("extra field length exceeds extra field buffer size");var $=D.subarray(E,C);_.push({id:F,data:$}),u=C}return _}function z0(D,_,u,F,B,E){if(F===0)return setImmediate(function(){E(null,fD(0))});D.read(_,u,F,B,function(C,$){if(C)return E(C);if($<F)return E(new Error("unexpected EOF"));E()})}e2.inherits(e0,d5);function e0(D){d5.call(this),this.actualByteCount=0,this.expectedByteCount=D}e0.prototype._transform=function(D,_,u){if(this.actualByteCount+=D.length,this.actualByteCount>this.expectedByteCount){var F="too many bytes in the stream. expected "+this.expectedByteCount+". got at least "+this.actualByteCount;return u(new Error(F))}u(null,D)};e0.prototype._flush=function(D){if(this.actualByteCount<this.expectedByteCount){var _="not enough bytes in the stream. expected "+this.expectedByteCount+". got only "+this.actualByteCount;return D(new Error(_))}D()};e2.inherits(_0,D3);function _0(){D3.call(this),this.refCount=0}_0.prototype.ref=function(){this.refCount+=1};_0.prototype.unref=function(){var D=this;if(D.refCount-=1,D.refCount>0)return;if(D.refCount<0)throw new Error("invalid unref");D.close(_);function _(u){if(u)return D.emit("error",u);D.emit("close")}};_0.prototype.createReadStream=function(D){if(D==null)D={};var{start:_,end:u}=D;if(_===u){var F=new S8;return setImmediate(function(){F.end()}),F}var B=this._readStreamForRange(_,u),E=!1,C=new _3(this);B.on("error",function(q){setImmediate(function(){if(!E)C.emit("error",q)})}),w8(C,function(){B.unpipe(C),C.unref(),B.destroy()});var $=new e0(u-_);return C.on("error",function(q){setImmediate(function(){if(!E)$.emit("error",q)})}),w8($,function(){E=!0,C.unpipe($),C.destroy()}),B.pipe(C).pipe($)};_0.prototype._readStreamForRange=function(D,_){throw new Error("not implemented")};_0.prototype.read=function(D,_,u,F,B){var E=this.createReadStream({start:F,end:F+u}),C=new oF,$=0;C._write=function(q,X,G){q.copy(D,_+$,0,q.length),$+=q.length,G()},C.on("finish",B),E.on("error",function(q){B(q)}),E.pipe(C)};_0.prototype.close=function(D){setImmediate(D)};e2.inherits(_3,S8);function _3(D){S8.call(this),this.context=D,this.context.ref(),this.unreffedYet=!1}_3.prototype._flush=function(D){this.unref(),D()};_3.prototype.unref=function(D){if(this.unreffedYet)return;this.unreffedYet=!0,this.context.unref()};var DB="\x00☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ";function o2(D,_){if(_)return D.toString("utf8");else{var u="";for(var F=0;F<D.length;F++)u+=DB[D[F]];return u}}function P0(D,_){var u=D.readUInt32LE(_),F=D.readUInt32LE(_+4);return F*4294967296+u}var fD;if(typeof Buffer.allocUnsafe==="function")fD=function(D){return Buffer.allocUnsafe(D)};else fD=function(D){return new Buffer(D)};function w8(D,_){if(typeof D.destroy==="function")D._destroy=function(u,F){if(_(),F!=null)F(u)};else D.destroy=_}function t2(D){if(D)throw D}});var k8=N((D4)=>{Object.defineProperty(D4,"__esModule",{value:!0});D4.Unzip=void 0;var s5=a5(),u3=I8(),KB=x("fs"),D2=x("path"),F3=c2(),r5=R8();class o5{constructor(D){this._entryCount=D,this._isPrevented=!1}get entryName(){return this._entryName}set entryName(D){this._entryName=D}get entryCount(){return this._entryCount}get isPrevented(){return this._isPrevented}preventDefault(){this._isPrevented=!0}reset(){this._isPrevented=!1}}class t5{constructor(D,_,u){this._targetFolder=D,this._realTargetFolder=_,this.symlinkAsFileOnWindows=u,this._symlinkFileNames=[]}get decodeEntryFileName(){return this._decodeEntryFileName}set decodeEntryFileName(D){this._decodeEntryFileName=D}get targetFolder(){return this._targetFolder}get realTargetFolder(){return this._realTargetFolder}get symlinkFileNames(){return this._symlinkFileNames}getFilePath(){return D2.join(this.targetFolder,this.decodeEntryFileName)}async isOutsideTargetFolder(D){if(this.symlinkFileNames.length===0)return!1;if(process.platform==="win32"&&this.symlinkAsFileOnWindows)return!1;for(let _ of this.symlinkFileNames)if(D.includes(_)){if((await F3.realpath(D)).indexOf(this.realTargetFolder)!==0)return!0}return!1}}class e5 extends r5.Cancelable{constructor(D){super();this.options=D}async extract(D,_){let u=0,F=new r5.CancellationToken;if(this.token=F,this.isOverwrite())await u3.rimraf(_);if(F.isCancelled)return Promise.reject(this.canceledError());await u3.ensureFolder(_);let B=await F3.realpath(_),E=await this.openZip(D,F);return this.zipFile=E,E.readEntry(),new Promise((C,$)=>{let q=null,X=E.entryCount;if(E.once("error",(J)=>{this.closeZip(),$(this.wrapError(J,F.isCancelled))}),E.once("close",()=>{if(this.zipFile=null,q)$(this.wrapError(q,F.isCancelled));else if(F.isCancelled)$(this.canceledError());else if(X===0)C(void 0)}),F.isCancelled){this.closeZip();return}let G=new t5(_,B,this.symlinkToFile()),Z=new o5(X);E.on("entry",async(J)=>{let Q=J.fileName.toString("utf8").replace(/\\/g,"/"),M=s5.validateFileName(Q);if(M!=null){q=new Error(M),this.closeZip(),$(q);return}Z.entryName=Q,this.onEntryCallback(Z),G.decodeEntryFileName=Q;try{if(Z.isPrevented)Z.reset(),E.readEntry();else await this.handleEntry(E,J,G,F);if(u++,u===X)C()}catch(W){q=this.wrapError(W,F.isCancelled),this.closeZip(),$(q)}})})}cancel(){if(this.token)this.token.cancel(),this.token=null;this.closeZip()}closeZip(){if(this.zipFile)this.zipFile.close(),this.zipFile=null}openZip(D,_){return new Promise((u,F)=>{s5.open(D,{lazyEntries:!0,decodeStrings:!1},(B,E)=>{if(B)F(this.wrapError(B,_.isCancelled));else u(E)})})}async handleEntry(D,_,u,F){if(/\/$/.test(u.decodeEntryFileName))await u3.ensureFolder(u.getFilePath()),D.readEntry();else await this.extractEntry(D,_,u,F)}openZipFileStream(D,_,u){return new Promise((F,B)=>{D.openReadStream(_,(E,C)=>{if(E)B(this.wrapError(E,u.isCancelled));else F(C)})})}async extractEntry(D,_,u,F){let B=u.getFilePath(),E=D2.dirname(B);if(await u3.ensureFolder(E),await u.isOutsideTargetFolder(E)){let q=new Error(`Refuse to write file outside "${u.targetFolder}", file: "${B}"`);return q.name="AFWRITE",Promise.reject(q)}let $=await this.openZipFileStream(D,_,F);await this.writeEntryToFile($,_,u,F),D.readEntry()}async writeEntryToFile(D,_,u,F){let B;return F.onCancelled(()=>{if(B)D.unpipe(B),B.destroy(this.canceledError())}),new Promise(async(E,C)=>{try{let $=u.getFilePath(),q=this.modeFromEntry(_),X=(q&61440)===40960;if(D.once("error",(G)=>{C(this.wrapError(G,F.isCancelled))}),X)u.symlinkFileNames.push(u.decodeEntryFileName);if(X&&!this.symlinkToFile()){let G="";D.on("data",(Z)=>{if(Z instanceof String)G+=Z;else G+=Z.toString()}),D.once("end",()=>{this.createSymlink(G,$).then(E,C)})}else B=KB.createWriteStream($,{mode:q}),B.once("close",()=>E()),B.once("error",(G)=>{C(this.wrapError(G,F.isCancelled))}),D.pipe(B)}catch($){C(this.wrapError($,F.isCancelled))}})}modeFromEntry(D){let _=D.externalFileAttributes>>16||33188;return[448,56,7].map((u)=>_&u).reduce((u,F)=>u+F,_&61440)}async createSymlink(D,_){let u="file";if(process.platform==="win32")if(/\/$/.test(D))u="dir";else{let F=D;if(!D2.isAbsolute(D))F=D2.join(D2.dirname(_),D);try{if((await F3.stat(F)).isDirectory())u="dir"}catch(B){}}await F3.symlink(D,_,u)}isOverwrite(){if(this.options&&this.options.overwrite)return!0;return!1}onEntryCallback(D){if(this.options&&this.options.onEntry)this.options.onEntry(D)}symlinkToFile(){let D=!1;if(process.platform==="win32")if(this.options&&this.options.symlinkAsFileOnWindows===!1)D=!1;else D=!0;return D}}D4.Unzip=e5});var B4=N((RD)=>{var UB=RD&&RD.__createBinding||(Object.create?function(D,_,u,F){if(F===void 0)F=u;var B=Object.getOwnPropertyDescriptor(_,u);if(!B||("get"in B?!_.__esModule:B.writable||B.configurable))B={enumerable:!0,get:function(){return _[u]}};Object.defineProperty(D,F,B)}:function(D,_,u,F){if(F===void 0)F=u;D[F]=_[u]}),u4=RD&&RD.__exportStar||function(D,_){for(var u in D)if(u!=="default"&&!Object.prototype.hasOwnProperty.call(_,u))UB(_,D,u)};Object.defineProperty(RD,"__esModule",{value:!0});RD.archiveFile=MB;RD.archiveFolder=WB;RD.extract=AB;var F4=T8(),HB=k8();u4(T8(),RD);u4(k8(),RD);function MB(D,_,u){let F=new F4.Zip(u);return F.addFile(D),F.archive(_)}function WB(D,_,u){let F=new F4.Zip(u);return F.addFolder(D),F.archive(_)}function AB(D,_,u){return new HB.Unzip(u).extract(D,_)}});var E1=GD(B1(),1),{program:EE,createCommand:CE,createArgument:$E,createOption:GE,CommanderError:qE,InvalidArgumentError:XE,InvalidOptionArgumentError:ZE,Command:y0,Argument:JE,Option:QE,Help:KE}=E1.default;var X2=(D)=>D.name==="up"||D.name==="k"||D.ctrl&&D.name==="p",W3=(D)=>D.name==="down"||D.name==="j"||D.ctrl&&D.name==="n";var Z2=(D)=>D.name==="backspace",C1=(D)=>"123456789".includes(D.name),iD=(D)=>D.name==="enter"||D.name==="return";class A3 extends Error{name="AbortPromptError";message="Prompt was aborted";constructor(D){super();this.cause=D?.cause}}class V3 extends Error{name="CancelPromptError";message="Prompt was canceled"}class L3 extends Error{name="ExitPromptError"}class I3 extends Error{name="HookError"}class k0 extends Error{name="ValidationError"}import{AsyncResource as H1}from"node:async_hooks";import{AsyncLocalStorage as w9,AsyncResource as S9}from"node:async_hooks";var $1=new w9;function y9(D){return{rl:D,hooks:[],hooksCleanup:[],hooksEffect:[],index:0,handleChange(){}}}function G1(D,_){let u=y9(D);return $1.run(u,()=>{function F(B){u.handleChange=()=>{u.index=0,B()},u.handleChange()}return _(F)})}function C0(){let D=$1.getStore();if(!D)throw new I3("[Inquirer] Hook functions can only be called from within a prompt");return D}function R3(){return C0().rl}function N3(D){let _=(...u)=>{let F=C0(),B=!1,E=F.handleChange;F.handleChange=()=>{B=!0};let C=D(...u);if(B)E();return F.handleChange=E,C};return S9.bind(_)}function H0(D){let _=C0(),{index:u}=_,F={get(){return _.hooks[u]},set(E){_.hooks[u]=E},initialized:u in _.hooks},B=D(F);return _.index++,B}function q1(){C0().handleChange()}var $0={queue(D){let _=C0(),{index:u}=_;_.hooksEffect.push(()=>{_.hooksCleanup[u]?.();let F=D(R3());if(F!=null&&typeof F!=="function")throw new k0("useEffect return value must be a cleanup function or nothing.");_.hooksCleanup[u]=F})},run(){let D=C0();N3(()=>{D.hooksEffect.forEach((_)=>{_()}),D.hooksEffect.length=0})()},clearAll(){let D=C0();D.hooksCleanup.forEach((_)=>{_?.()}),D.hooksEffect.length=0,D.hooksCleanup.length=0}};function n(D){return H0((_)=>{let u=(B)=>{if(_.get()!==B)_.set(B),q1()};if(_.initialized)return[_.get(),u];let F=typeof D==="function"?D():D;return _.set(F),[F,u]})}function SD(D,_){H0((u)=>{let F=u.get();if(!Array.isArray(F)||_.some((E,C)=>!Object.is(E,F[C])))$0.queue(D);u.set(_)})}var KD=GD(v0(),1);import TD from"node:process";function b9(){if(TD.platform!=="win32")return TD.env.TERM!=="linux";return Boolean(TD.env.WT_SESSION)||Boolean(TD.env.TERMINUS_SUBLIME)||TD.env.ConEmuTask==="{cmd::Cmder}"||TD.env.TERM_PROGRAM==="Terminus-Sublime"||TD.env.TERM_PROGRAM==="vscode"||TD.env.TERM==="xterm-256color"||TD.env.TERM==="alacritty"||TD.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var Z1={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"█",squareDarkShade:"▓",squareMediumShade:"▒",squareLightShade:"░",squareTop:"▀",squareBottom:"▄",squareLeft:"▌",squareRight:"▐",squareCenter:"■",bullet:"●",dot:"․",ellipsis:"…",pointerSmall:"›",triangleUp:"▲",triangleUpSmall:"▴",triangleDown:"▼",triangleDownSmall:"▾",triangleLeftSmall:"◂",triangleRightSmall:"▸",home:"⌂",heart:"♥",musicNote:"♪",musicNoteBeamed:"♫",arrowUp:"↑",arrowDown:"↓",arrowLeft:"←",arrowRight:"→",arrowLeftRight:"↔",arrowUpDown:"↕",almostEqual:"≈",notEqual:"≠",lessOrEqual:"≤",greaterOrEqual:"≥",identical:"≡",infinity:"∞",subscriptZero:"₀",subscriptOne:"₁",subscriptTwo:"₂",subscriptThree:"₃",subscriptFour:"₄",subscriptFive:"₅",subscriptSix:"₆",subscriptSeven:"₇",subscriptEight:"₈",subscriptNine:"₉",oneHalf:"½",oneThird:"⅓",oneQuarter:"¼",oneFifth:"⅕",oneSixth:"⅙",oneEighth:"⅛",twoThirds:"⅔",twoFifths:"⅖",threeQuarters:"¾",threeFifths:"⅗",threeEighths:"⅜",fourFifths:"⅘",fiveSixths:"⅚",fiveEighths:"⅝",sevenEighths:"⅞",line:"─",lineBold:"━",lineDouble:"═",lineDashed0:"┄",lineDashed1:"┅",lineDashed2:"┈",lineDashed3:"┉",lineDashed4:"╌",lineDashed5:"╍",lineDashed6:"╴",lineDashed7:"╶",lineDashed8:"╸",lineDashed9:"╺",lineDashed10:"╼",lineDashed11:"╾",lineDashed12:"−",lineDashed13:"–",lineDashed14:"‐",lineDashed15:"⁃",lineVertical:"│",lineVerticalBold:"┃",lineVerticalDouble:"║",lineVerticalDashed0:"┆",lineVerticalDashed1:"┇",lineVerticalDashed2:"┊",lineVerticalDashed3:"┋",lineVerticalDashed4:"╎",lineVerticalDashed5:"╏",lineVerticalDashed6:"╵",lineVerticalDashed7:"╷",lineVerticalDashed8:"╹",lineVerticalDashed9:"╻",lineVerticalDashed10:"╽",lineVerticalDashed11:"╿",lineDownLeft:"┐",lineDownLeftArc:"╮",lineDownBoldLeftBold:"┓",lineDownBoldLeft:"┒",lineDownLeftBold:"┑",lineDownDoubleLeftDouble:"╗",lineDownDoubleLeft:"╖",lineDownLeftDouble:"╕",lineDownRight:"┌",lineDownRightArc:"╭",lineDownBoldRightBold:"┏",lineDownBoldRight:"┎",lineDownRightBold:"┍",lineDownDoubleRightDouble:"╔",lineDownDoubleRight:"╓",lineDownRightDouble:"╒",lineUpLeft:"┘",lineUpLeftArc:"╯",lineUpBoldLeftBold:"┛",lineUpBoldLeft:"┚",lineUpLeftBold:"┙",lineUpDoubleLeftDouble:"╝",lineUpDoubleLeft:"╜",lineUpLeftDouble:"╛",lineUpRight:"└",lineUpRightArc:"╰",lineUpBoldRightBold:"┗",lineUpBoldRight:"┖",lineUpRightBold:"┕",lineUpDoubleRightDouble:"╚",lineUpDoubleRight:"╙",lineUpRightDouble:"╘",lineUpDownLeft:"┤",lineUpBoldDownBoldLeftBold:"┫",lineUpBoldDownBoldLeft:"┨",lineUpDownLeftBold:"┥",lineUpBoldDownLeftBold:"┩",lineUpDownBoldLeftBold:"┪",lineUpDownBoldLeft:"┧",lineUpBoldDownLeft:"┦",lineUpDoubleDownDoubleLeftDouble:"╣",lineUpDoubleDownDoubleLeft:"╢",lineUpDownLeftDouble:"╡",lineUpDownRight:"├",lineUpBoldDownBoldRightBold:"┣",lineUpBoldDownBoldRight:"┠",lineUpDownRightBold:"┝",lineUpBoldDownRightBold:"┡",lineUpDownBoldRightBold:"┢",lineUpDownBoldRight:"┟",lineUpBoldDownRight:"┞",lineUpDoubleDownDoubleRightDouble:"╠",lineUpDoubleDownDoubleRight:"╟",lineUpDownRightDouble:"╞",lineDownLeftRight:"┬",lineDownBoldLeftBoldRightBold:"┳",lineDownLeftBoldRightBold:"┯",lineDownBoldLeftRight:"┰",lineDownBoldLeftBoldRight:"┱",lineDownBoldLeftRightBold:"┲",lineDownLeftRightBold:"┮",lineDownLeftBoldRight:"┭",lineDownDoubleLeftDoubleRightDouble:"╦",lineDownDoubleLeftRight:"╥",lineDownLeftDoubleRightDouble:"╤",lineUpLeftRight:"┴",lineUpBoldLeftBoldRightBold:"┻",lineUpLeftBoldRightBold:"┷",lineUpBoldLeftRight:"┸",lineUpBoldLeftBoldRight:"┹",lineUpBoldLeftRightBold:"┺",lineUpLeftRightBold:"┶",lineUpLeftBoldRight:"┵",lineUpDoubleLeftDoubleRightDouble:"╩",lineUpDoubleLeftRight:"╨",lineUpLeftDoubleRightDouble:"╧",lineUpDownLeftRight:"┼",lineUpBoldDownBoldLeftBoldRightBold:"╋",lineUpDownBoldLeftBoldRightBold:"╈",lineUpBoldDownLeftBoldRightBold:"╇",lineUpBoldDownBoldLeftRightBold:"╊",lineUpBoldDownBoldLeftBoldRight:"╉",lineUpBoldDownLeftRight:"╀",lineUpDownBoldLeftRight:"╁",lineUpDownLeftBoldRight:"┽",lineUpDownLeftRightBold:"┾",lineUpBoldDownBoldLeftRight:"╂",lineUpDownLeftBoldRightBold:"┿",lineUpBoldDownLeftBoldRight:"╃",lineUpBoldDownLeftRightBold:"╄",lineUpDownBoldLeftBoldRight:"╅",lineUpDownBoldLeftRightBold:"╆",lineUpDoubleDownDoubleLeftDoubleRightDouble:"╬",lineUpDoubleDownDoubleLeftRight:"╫",lineUpDownLeftDoubleRightDouble:"╪",lineCross:"╳",lineBackslash:"╲",lineSlash:"╱"},J1={tick:"✔",info:"ℹ",warning:"⚠",cross:"✘",squareSmall:"◻",squareSmallFilled:"◼",circle:"◯",circleFilled:"◉",circleDotted:"◌",circleDouble:"◎",circleCircle:"ⓞ",circleCross:"ⓧ",circlePipe:"Ⓘ",radioOn:"◉",radioOff:"◯",checkboxOn:"☒",checkboxOff:"☐",checkboxCircleOn:"ⓧ",checkboxCircleOff:"Ⓘ",pointer:"❯",triangleUpOutline:"△",triangleLeft:"◀",triangleRight:"▶",lozenge:"◆",lozengeOutline:"◇",hamburger:"☰",smiley:"㋡",mustache:"෴",star:"★",play:"▶",nodejs:"⬢",oneSeventh:"⅐",oneNinth:"⅑",oneTenth:"⅒"},h9={tick:"√",info:"i",warning:"‼",cross:"×",squareSmall:"□",squareSmallFilled:"■",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(○)",circleCross:"(×)",circlePipe:"(│)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[×]",checkboxOff:"[ ]",checkboxCircleOn:"(×)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"∆",triangleLeft:"◄",triangleRight:"►",lozenge:"♦",lozengeOutline:"◊",hamburger:"≡",smiley:"☺",mustache:"┌─┐",star:"✶",play:"►",nodejs:"♦",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},m9={...Z1,...J1},d9={...Z1,...h9},g9=b9(),f9=g9?m9:d9,nD=f9,OE=Object.entries(J1);var Q1={prefix:{idle:KD.default.blue("?"),done:KD.default.green(nD.tick)},spinner:{interval:80,frames:["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"].map((D)=>KD.default.yellow(D))},style:{answer:KD.default.cyan,message:KD.default.bold,error:(D)=>KD.default.red(`> ${D}`),defaultAnswer:(D)=>KD.default.dim(`(${D})`),help:KD.default.dim,highlight:KD.default.cyan,key:(D)=>KD.default.cyan(KD.default.bold(`<${D}>`))}};function K1(D){if(typeof D!=="object"||D===null)return!1;let _=D;while(Object.getPrototypeOf(_)!==null)_=Object.getPrototypeOf(_);return Object.getPrototypeOf(D)===_}function U1(...D){let _={};for(let u of D)for(let[F,B]of Object.entries(u)){let E=_[F];_[F]=K1(E)&&K1(B)?U1(E,B):B}return _}function HD(...D){let _=[Q1,...D.filter((u)=>u!=null)];return U1(..._)}function yD({status:D="idle",theme:_}){let[u,F]=n(!1),[B,E]=n(0),{prefix:C,spinner:$}=HD(_);if(SD(()=>{if(D==="loading"){let X,G=-1,Z=setTimeout(H1.bind(()=>{F(!0),X=setInterval(H1.bind(()=>{G=G+1,E(G%$.frames.length)}),$.interval)}),300);return()=>{clearTimeout(Z),clearInterval(X)}}else F(!1)},[D]),u)return $.frames[B];return typeof C==="string"?C:C[D==="loading"?"idle":D]??C.idle}function G0(D,_){return H0((u)=>{let F=u.get();if(!F||F.dependencies.length!==_.length||F.dependencies.some((B,E)=>B!==_[E])){let B=D();return u.set({value:B,dependencies:_}),B}return F.value})}function jD(D){return n({current:D})[0]}function kD(D){let _=jD(D);_.current=D,SD((u)=>{let F=!1,B=N3((E,C)=>{if(F)return;_.current(C,u)});return u.input.on("keypress",B),()=>{F=!0,u.input.removeListener("keypress",B)}},[])}var p1=GD(W1(),1),l1=GD(c1(),1);function m0(D,_){return D.split(`
38
- `).flatMap((u)=>l1.default(u,_,{trim:!1,hard:!0}).split(`
32
+ `).map((F)=>n9(F,_,u)).join(`
33
+ `)}});var M_=N((tB,H_)=>{var r9=require("stream");class U_ extends r9{#u=null;constructor(D={}){super(D);this.writable=this.readable=!0,this.muted=!1,this.on("pipe",this._onpipe),this.replace=D.replace,this._prompt=D.prompt||null,this._hadControl=!1}#_(D,_){if(this._dest)return this._dest[D];if(this._src)return this._src[D];return _}#D(D,..._){if(typeof this._dest?.[D]==="function")this._dest[D](..._);if(typeof this._src?.[D]==="function")this._src[D](..._)}get isTTY(){if(this.#u!==null)return this.#u;return this.#_("isTTY",!1)}set isTTY(D){this.#u=D}get rows(){return this.#_("rows")}get columns(){return this.#_("columns")}mute(){this.muted=!0}unmute(){this.muted=!1}_onpipe(D){this._src=D}pipe(D,_){return this._dest=D,super.pipe(D,_)}pause(){if(this._src)return this._src.pause()}resume(){if(this._src)return this._src.resume()}write(D){if(this.muted){if(!this.replace)return!0;if(D.match(/^\u001b/)){if(D.indexOf(this._prompt)===0)D=D.slice(this._prompt.length),D=D.replace(/./g,this.replace),D=this._prompt+D;return this._hadControl=!0,this.emit("data",D)}else{if(this._prompt&&this._hadControl&&D.indexOf(this._prompt)===0)this._hadControl=!1,this.emit("data",this._prompt),D=D.slice(this._prompt.length);D=D.toString().replace(/./g,this.replace)}}this.emit("data",D)}end(D){if(this.muted)if(D&&this.replace)D=D.toString().replace(/./g,this.replace);else D=null;if(D)this.emit("data",D);this.emit("end")}destroy(...D){return this.#D("destroy",...D)}destroySoon(...D){return this.#D("destroySoon",...D)}close(...D){return this.#D("close",...D)}}H_.exports=U_});var u8=N((BE,_8)=>{var y=_8.exports;_8.exports.default=y;var h="\x1B[",i0="\x1B]",N0="\x07",R2=";",I_=process.env.TERM_PROGRAM==="Apple_Terminal";y.cursorTo=(D,_)=>{if(typeof D!=="number")throw new TypeError("The `x` argument is required");if(typeof _!=="number")return h+(D+1)+"G";return h+(_+1)+";"+(D+1)+"H"};y.cursorMove=(D,_)=>{if(typeof D!=="number")throw new TypeError("The `x` argument is required");let u="";if(D<0)u+=h+-D+"D";else if(D>0)u+=h+D+"C";if(_<0)u+=h+-_+"A";else if(_>0)u+=h+_+"B";return u};y.cursorUp=(D=1)=>h+D+"A";y.cursorDown=(D=1)=>h+D+"B";y.cursorForward=(D=1)=>h+D+"C";y.cursorBackward=(D=1)=>h+D+"D";y.cursorLeft=h+"G";y.cursorSavePosition=I_?"\x1B7":h+"s";y.cursorRestorePosition=I_?"\x1B8":h+"u";y.cursorGetPosition=h+"6n";y.cursorNextLine=h+"E";y.cursorPrevLine=h+"F";y.cursorHide=h+"?25l";y.cursorShow=h+"?25h";y.eraseLines=(D)=>{let _="";for(let u=0;u<D;u++)_+=y.eraseLine+(u<D-1?y.cursorUp():"");if(D)_+=y.cursorLeft;return _};y.eraseEndLine=h+"K";y.eraseStartLine=h+"1K";y.eraseLine=h+"2K";y.eraseDown=h+"J";y.eraseUp=h+"1J";y.eraseScreen=h+"2J";y.scrollUp=h+"S";y.scrollDown=h+"T";y.clearScreen="\x1Bc";y.clearTerminal=process.platform==="win32"?`${y.eraseScreen}${h}0f`:`${y.eraseScreen}${h}3J${h}H`;y.beep=N0;y.link=(D,_)=>{return[i0,"8",R2,R2,_,N0,D,i0,"8",R2,R2,N0].join("")};y.image=(D,_={})=>{let u=`${i0}1337;File=inline=1`;if(_.width)u+=`;width=${_.width}`;if(_.height)u+=`;height=${_.height}`;if(_.preserveAspectRatio===!1)u+=";preserveAspectRatio=0";return u+":"+D.toString("base64")+N0};y.iTerm={setCwd:(D=process.cwd())=>`${i0}50;CurrentDir=${D}${N0}`,annotation:(D,_={})=>{let u=`${i0}1337;`,F=typeof _.x!=="undefined",B=typeof _.y!=="undefined";if((F||B)&&!(F&&B&&typeof _.length!=="undefined"))throw new Error("`x`, `y` and `length` must be defined when `x` or `y` is defined");if(D=D.replace(/\|/g,""),u+=_.isHidden?"AddHiddenAnnotation=":"AddAnnotation=",_.length>0)u+=(F?[D,_.length,_.x,_.y]:[_.length,D]).join("|");else u+=D;return u+N0}}});var y_=N((lE,S_)=>{var oD=require("constants"),$7=process.cwd,O2=null,G7=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){if(!O2)O2=$7.call(process);return O2};try{process.cwd()}catch(D){}if(typeof process.chdir==="function"){if($8=process.chdir,process.chdir=function(D){O2=null,$8.call(process,D)},Object.setPrototypeOf)Object.setPrototypeOf(process.chdir,$8)}var $8;S_.exports=q7;function q7(D){if(oD.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./))_(D);if(!D.lutimes)u(D);if(D.chown=E(D.chown),D.fchown=E(D.fchown),D.lchown=E(D.lchown),D.chmod=F(D.chmod),D.fchmod=F(D.fchmod),D.lchmod=F(D.lchmod),D.chownSync=C(D.chownSync),D.fchownSync=C(D.fchownSync),D.lchownSync=C(D.lchownSync),D.chmodSync=B(D.chmodSync),D.fchmodSync=B(D.fchmodSync),D.lchmodSync=B(D.lchmodSync),D.stat=$(D.stat),D.fstat=$(D.fstat),D.lstat=$(D.lstat),D.statSync=q(D.statSync),D.fstatSync=q(D.fstatSync),D.lstatSync=q(D.lstatSync),D.chmod&&!D.lchmod)D.lchmod=function(G,Z,J){if(J)process.nextTick(J)},D.lchmodSync=function(){};if(D.chown&&!D.lchown)D.lchown=function(G,Z,J,K){if(K)process.nextTick(K)},D.lchownSync=function(){};if(G7==="win32")D.rename=typeof D.rename!=="function"?D.rename:function(G){function Z(J,K,Q){var M=Date.now(),W=0;G(J,K,function V(L){if(L&&(L.code==="EACCES"||L.code==="EPERM"||L.code==="EBUSY")&&Date.now()-M<60000){if(setTimeout(function(){D.stat(K,function(T,S){if(T&&T.code==="ENOENT")G(J,K,V);else Q(L)})},W),W<100)W+=10;return}if(Q)Q(L)})}if(Object.setPrototypeOf)Object.setPrototypeOf(Z,G);return Z}(D.rename);D.read=typeof D.read!=="function"?D.read:function(G){function Z(J,K,Q,M,W,V){var L;if(V&&typeof V==="function"){var T=0;L=function(S,j,v){if(S&&S.code==="EAGAIN"&&T<10)return T++,G.call(D,J,K,Q,M,W,L);V.apply(this,arguments)}}return G.call(D,J,K,Q,M,W,L)}if(Object.setPrototypeOf)Object.setPrototypeOf(Z,G);return Z}(D.read),D.readSync=typeof D.readSync!=="function"?D.readSync:function(G){return function(Z,J,K,Q,M){var W=0;while(!0)try{return G.call(D,Z,J,K,Q,M)}catch(V){if(V.code==="EAGAIN"&&W<10){W++;continue}throw V}}}(D.readSync);function _(G){G.lchmod=function(Z,J,K){G.open(Z,oD.O_WRONLY|oD.O_SYMLINK,J,function(Q,M){if(Q){if(K)K(Q);return}G.fchmod(M,J,function(W){G.close(M,function(V){if(K)K(W||V)})})})},G.lchmodSync=function(Z,J){var K=G.openSync(Z,oD.O_WRONLY|oD.O_SYMLINK,J),Q=!0,M;try{M=G.fchmodSync(K,J),Q=!1}finally{if(Q)try{G.closeSync(K)}catch(W){}else G.closeSync(K)}return M}}function u(G){if(oD.hasOwnProperty("O_SYMLINK")&&G.futimes)G.lutimes=function(Z,J,K,Q){G.open(Z,oD.O_SYMLINK,function(M,W){if(M){if(Q)Q(M);return}G.futimes(W,J,K,function(V){G.close(W,function(L){if(Q)Q(V||L)})})})},G.lutimesSync=function(Z,J,K){var Q=G.openSync(Z,oD.O_SYMLINK),M,W=!0;try{M=G.futimesSync(Q,J,K),W=!1}finally{if(W)try{G.closeSync(Q)}catch(V){}else G.closeSync(Q)}return M};else if(G.futimes)G.lutimes=function(Z,J,K,Q){if(Q)process.nextTick(Q)},G.lutimesSync=function(){}}function F(G){if(!G)return G;return function(Z,J,K){return G.call(D,Z,J,function(Q){if(X(Q))Q=null;if(K)K.apply(this,arguments)})}}function B(G){if(!G)return G;return function(Z,J){try{return G.call(D,Z,J)}catch(K){if(!X(K))throw K}}}function E(G){if(!G)return G;return function(Z,J,K,Q){return G.call(D,Z,J,K,function(M){if(X(M))M=null;if(Q)Q.apply(this,arguments)})}}function C(G){if(!G)return G;return function(Z,J,K){try{return G.call(D,Z,J,K)}catch(Q){if(!X(Q))throw Q}}}function $(G){if(!G)return G;return function(Z,J,K){if(typeof J==="function")K=J,J=null;function Q(M,W){if(W){if(W.uid<0)W.uid+=4294967296;if(W.gid<0)W.gid+=4294967296}if(K)K.apply(this,arguments)}return J?G.call(D,Z,J,Q):G.call(D,Z,Q)}}function q(G){if(!G)return G;return function(Z,J){var K=J?G.call(D,Z,J):G.call(D,Z);if(K){if(K.uid<0)K.uid+=4294967296;if(K.gid<0)K.gid+=4294967296}return K}}function X(G){if(!G)return!0;if(G.code==="ENOSYS")return!0;var Z=!process.getuid||process.getuid()!==0;if(Z){if(G.code==="EINVAL"||G.code==="EPERM")return!0}return!1}}});var b_=N((iE,v_)=>{var k_=require("stream").Stream;v_.exports=X7;function X7(D){return{ReadStream:_,WriteStream:u};function _(F,B){if(!(this instanceof _))return new _(F,B);k_.call(this);var E=this;this.path=F,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,B=B||{};var C=Object.keys(B);for(var $=0,q=C.length;$<q;$++){var X=C[$];this[X]=B[X]}if(this.encoding)this.setEncoding(this.encoding);if(this.start!==void 0){if(typeof this.start!=="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!=="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){E._read()});return}D.open(this.path,this.flags,this.mode,function(G,Z){if(G){E.emit("error",G),E.readable=!1;return}E.fd=Z,E.emit("open",Z),E._read()})}function u(F,B){if(!(this instanceof u))return new u(F,B);k_.call(this),this.path=F,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,B=B||{};var E=Object.keys(B);for(var C=0,$=E.length;C<$;C++){var q=E[C];this[q]=B[q]}if(this.start!==void 0){if(typeof this.start!=="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}if(this.busy=!1,this._queue=[],this.fd===null)this._open=D.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush()}}});var m_=N((nE,h_)=>{h_.exports=J7;var Z7=Object.getPrototypeOf||function(D){return D.__proto__};function J7(D){if(D===null||typeof D!=="object")return D;if(D instanceof Object)var _={__proto__:Z7(D)};else var _=Object.create(null);return Object.getOwnPropertyNames(D).forEach(function(u){Object.defineProperty(_,u,Object.getOwnPropertyDescriptor(D,u))}),_}});var c_=N((aE,X8)=>{var a=require("fs"),Q7=y_(),K7=b_(),U7=m_(),P2=require("util"),ED,Y2;if(typeof Symbol==="function"&&typeof Symbol.for==="function")ED=Symbol.for("graceful-fs.queue"),Y2=Symbol.for("graceful-fs.previous");else ED="___graceful-fs.queue",Y2="___graceful-fs.previous";function H7(){}function f_(D,_){Object.defineProperty(D,ED,{get:function(){return _}})}var K0=H7;if(P2.debuglog)K0=P2.debuglog("gfs4");else if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))K0=function(){var D=P2.format.apply(P2,arguments);D="GFS4: "+D.split(/\n/).join(`
34
+ GFS4: `),console.error(D)};if(!a[ED]){if(d_=global[ED]||[],f_(a,d_),a.close=function(D){function _(u,F){return D.call(a,u,function(B){if(!B)g_();if(typeof F==="function")F.apply(this,arguments)})}return Object.defineProperty(_,Y2,{value:D}),_}(a.close),a.closeSync=function(D){function _(u){D.apply(a,arguments),g_()}return Object.defineProperty(_,Y2,{value:D}),_}(a.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))process.on("exit",function(){K0(a[ED]),require("assert").equal(a[ED].length,0)})}var d_;if(!global[ED])f_(global,a[ED]);X8.exports=G8(U7(a));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!a.__patched)X8.exports=G8(a),a.__patched=!0;function G8(D){Q7(D),D.gracefulify=G8,D.createReadStream=j,D.createWriteStream=v;var _=D.readFile;D.readFile=u;function u(A,z,P){if(typeof z==="function")P=z,z=null;return c(A,z,P);function c(t,uD,i,s){return _(t,uD,function(g){if(g&&(g.code==="EMFILE"||g.code==="ENFILE"))O0([c,[t,uD,i],g,s||Date.now(),Date.now()]);else if(typeof i==="function")i.apply(this,arguments)})}}var F=D.writeFile;D.writeFile=B;function B(A,z,P,c){if(typeof P==="function")c=P,P=null;return t(A,z,P,c);function t(uD,i,s,g,BD){return F(uD,i,s,function(p){if(p&&(p.code==="EMFILE"||p.code==="ENFILE"))O0([t,[uD,i,s,g],p,BD||Date.now(),Date.now()]);else if(typeof g==="function")g.apply(this,arguments)})}}var E=D.appendFile;if(E)D.appendFile=C;function C(A,z,P,c){if(typeof P==="function")c=P,P=null;return t(A,z,P,c);function t(uD,i,s,g,BD){return E(uD,i,s,function(p){if(p&&(p.code==="EMFILE"||p.code==="ENFILE"))O0([t,[uD,i,s,g],p,BD||Date.now(),Date.now()]);else if(typeof g==="function")g.apply(this,arguments)})}}var $=D.copyFile;if($)D.copyFile=q;function q(A,z,P,c){if(typeof P==="function")c=P,P=0;return t(A,z,P,c);function t(uD,i,s,g,BD){return $(uD,i,s,function(p){if(p&&(p.code==="EMFILE"||p.code==="ENFILE"))O0([t,[uD,i,s,g],p,BD||Date.now(),Date.now()]);else if(typeof g==="function")g.apply(this,arguments)})}}var X=D.readdir;D.readdir=Z;var G=/^v[0-5]\./;function Z(A,z,P){if(typeof z==="function")P=z,z=null;var c=G.test(process.version)?function uD(i,s,g,BD){return X(i,t(i,s,g,BD))}:function uD(i,s,g,BD){return X(i,s,t(i,s,g,BD))};return c(A,z,P);function t(uD,i,s,g){return function(BD,p){if(BD&&(BD.code==="EMFILE"||BD.code==="ENFILE"))O0([c,[uD,i,s],BD,g||Date.now(),Date.now()]);else{if(p&&p.sort)p.sort();if(typeof s==="function")s.call(this,BD,p)}}}}if(process.version.substr(0,4)==="v0.8"){var J=K7(D);V=J.ReadStream,T=J.WriteStream}var K=D.ReadStream;if(K)V.prototype=Object.create(K.prototype),V.prototype.open=L;var Q=D.WriteStream;if(Q)T.prototype=Object.create(Q.prototype),T.prototype.open=S;Object.defineProperty(D,"ReadStream",{get:function(){return V},set:function(A){V=A},enumerable:!0,configurable:!0}),Object.defineProperty(D,"WriteStream",{get:function(){return T},set:function(A){T=A},enumerable:!0,configurable:!0});var M=V;Object.defineProperty(D,"FileReadStream",{get:function(){return M},set:function(A){M=A},enumerable:!0,configurable:!0});var W=T;Object.defineProperty(D,"FileWriteStream",{get:function(){return W},set:function(A){W=A},enumerable:!0,configurable:!0});function V(A,z){if(this instanceof V)return K.apply(this,arguments),this;else return V.apply(Object.create(V.prototype),arguments)}function L(){var A=this;_D(A.path,A.flags,A.mode,function(z,P){if(z){if(A.autoClose)A.destroy();A.emit("error",z)}else A.fd=P,A.emit("open",P),A.read()})}function T(A,z){if(this instanceof T)return Q.apply(this,arguments),this;else return T.apply(Object.create(T.prototype),arguments)}function S(){var A=this;_D(A.path,A.flags,A.mode,function(z,P){if(z)A.destroy(),A.emit("error",z);else A.fd=P,A.emit("open",P)})}function j(A,z){return new D.ReadStream(A,z)}function v(A,z){return new D.WriteStream(A,z)}var DD=D.open;D.open=_D;function _D(A,z,P,c){if(typeof P==="function")c=P,P=null;return t(A,z,P,c);function t(uD,i,s,g,BD){return DD(uD,i,s,function(p,bF){if(p&&(p.code==="EMFILE"||p.code==="ENFILE"))O0([t,[uD,i,s,g],p,BD||Date.now(),Date.now()]);else if(typeof g==="function")g.apply(this,arguments)})}}return D}function O0(D){K0("ENQUEUE",D[0].name,D[1]),a[ED].push(D),q8()}var z2;function g_(){var D=Date.now();for(var _=0;_<a[ED].length;++_)if(a[ED][_].length>2)a[ED][_][3]=D,a[ED][_][4]=D;q8()}function q8(){if(clearTimeout(z2),z2=void 0,a[ED].length===0)return;var D=a[ED].shift(),_=D[0],u=D[1],F=D[2],B=D[3],E=D[4];if(B===void 0)K0("RETRY",_.name,u),_.apply(null,u);else if(Date.now()-B>=60000){K0("TIMEOUT",_.name,u);var C=u.pop();if(typeof C==="function")C.call(null,F)}else{var $=Date.now()-E,q=Math.max(E-B,1),X=Math.min(q*1.2,100);if($>=X)K0("RETRY",_.name,u),_.apply(null,u.concat([B]));else a[ED].push(D)}if(z2===void 0)z2=setTimeout(q8,0)}});var w6=N((u$,Y6)=>{class z6{constructor(D,_,u){this.etaBufferLength=D||100,this.valueBuffer=[u],this.timeBuffer=[_],this.eta="0"}update(D,_,u){this.valueBuffer.push(_),this.timeBuffer.push(D),this.calculate(u-_)}getTime(){return this.eta}calculate(D){let _=this.valueBuffer.length,u=Math.min(this.etaBufferLength,_),F=this.valueBuffer[_-1]-this.valueBuffer[_-u],B=this.timeBuffer[_-1]-this.timeBuffer[_-u],E=F/B;this.valueBuffer=this.valueBuffer.slice(-this.etaBufferLength),this.timeBuffer=this.timeBuffer.slice(-this.etaBufferLength);let C=Math.ceil(D/E/1000);if(isNaN(C))this.eta="NULL";else if(!isFinite(C))this.eta="INF";else if(C>1e7)this.eta="INF";else if(C<0)this.eta=0;else this.eta=C}}Y6.exports=z6});var T8=N((F$,S6)=>{var W0=require("readline");class x6{constructor(D){this.stream=D,this.linewrap=!0,this.dy=0}cursorSave(){if(!this.stream.isTTY)return;this.stream.write("\x1B7")}cursorRestore(){if(!this.stream.isTTY)return;this.stream.write("\x1B8")}cursor(D){if(!this.stream.isTTY)return;if(D)this.stream.write("\x1B[?25h");else this.stream.write("\x1B[?25l")}cursorTo(D=null,_=null){if(!this.stream.isTTY)return;W0.cursorTo(this.stream,D,_)}cursorRelative(D=null,_=null){if(!this.stream.isTTY)return;this.dy=this.dy+_,W0.moveCursor(this.stream,D,_)}cursorRelativeReset(){if(!this.stream.isTTY)return;W0.moveCursor(this.stream,0,-this.dy),W0.cursorTo(this.stream,0,null),this.dy=0}clearRight(){if(!this.stream.isTTY)return;W0.clearLine(this.stream,1)}clearLine(){if(!this.stream.isTTY)return;W0.clearLine(this.stream,0)}clearBottom(){if(!this.stream.isTTY)return;W0.clearScreenDown(this.stream)}newline(){this.stream.write(`
35
+ `),this.dy++}write(D,_=!1){if(this.linewrap===!0&&_===!1)this.stream.write(D.substr(0,this.getWidth()));else this.stream.write(D)}lineWrapping(D){if(!this.stream.isTTY)return;if(this.linewrap=D,D)this.stream.write("\x1B[?7h");else this.stream.write("\x1B[?7l")}isTTY(){return this.stream.isTTY===!0}getWidth(){return this.stream.columns||(this.stream.isTTY?80:200)}}S6.exports=x6});var j8=N((B$,y6)=>{y6.exports=function D(_,u,F){if(u.autopadding!==!0)return _;function B(E,C){return(u.autopaddingChar+E).slice(-C)}switch(F){case"percentage":return B(_,3);default:return _}}});var O8=N((E$,k6)=>{k6.exports=function D(_,u){let F=Math.round(_*u.barsize),B=u.barsize-F;return u.barCompleteString.substr(0,F)+u.barGlue+u.barIncompleteString.substr(0,B)}});var P8=N((C$,v6)=>{v6.exports=function D(_,u,F){function B(C){if(F)return F*Math.round(C/F);else return C}function E(C){return(u.autopaddingChar+C).slice(-2)}if(_>3600)return E(Math.floor(_/3600))+"h"+E(B(_%3600/60))+"m";else if(_>60)return E(Math.floor(_/60))+"m"+E(B(_%60))+"s";else if(_>10)return E(B(_))+"s";else return E(_)+"s"}});var z8=N(($$,b6)=>{var h7=l3(),m7=j8(),d7=O8(),g7=P8();b6.exports=function D(_,u,F){let B=_.format,E=_.formatTime||g7,C=_.formatValue||m7,$=_.formatBar||d7,q=Math.floor(u.progress*100)+"",X=u.stopTime||Date.now(),G=Math.round((X-u.startTime)/1000),Z=Object.assign({},F,{bar:$(u.progress,_),percentage:C(q,_,"percentage"),total:C(u.total,_,"total"),value:C(u.value,_,"value"),eta:C(u.eta,_,"eta"),eta_formatted:E(u.eta,_,5),duration:C(G,_,"duration"),duration_formatted:E(G,_,1)});B=B.replace(/\{(\w+)\}/g,function(Q,M){if(typeof Z[M]!=="undefined")return Z[M];return Q});let J=Math.max(0,u.maxWidth-h7(B)-2),K=Math.floor(J/2);switch(_.align){case"right":B=J>0?" ".repeat(J)+B:B;break;case"center":B=K>0?" ".repeat(K)+B:B;break;case"left":default:break}return B}});var g2=N((G$,h6)=>{function m(D,_){if(typeof D==="undefined"||D===null)return _;else return D}h6.exports={parse:function D(_,u){let F={},B=Object.assign({},u,_);return F.throttleTime=1000/m(B.fps,10),F.stream=m(B.stream,process.stderr),F.terminal=m(B.terminal,null),F.clearOnComplete=m(B.clearOnComplete,!1),F.stopOnComplete=m(B.stopOnComplete,!1),F.barsize=m(B.barsize,40),F.align=m(B.align,"left"),F.hideCursor=m(B.hideCursor,!1),F.linewrap=m(B.linewrap,!1),F.barGlue=m(B.barGlue,""),F.barCompleteChar=m(B.barCompleteChar,"="),F.barIncompleteChar=m(B.barIncompleteChar,"-"),F.format=m(B.format,"progress [{bar}] {percentage}% | ETA: {eta}s | {value}/{total}"),F.formatTime=m(B.formatTime,null),F.formatValue=m(B.formatValue,null),F.formatBar=m(B.formatBar,null),F.etaBufferLength=m(B.etaBuffer,10),F.etaAsynchronousUpdate=m(B.etaAsynchronousUpdate,!1),F.progressCalculationRelative=m(B.progressCalculationRelative,!1),F.synchronousUpdate=m(B.synchronousUpdate,!0),F.noTTYOutput=m(B.noTTYOutput,!1),F.notTTYSchedule=m(B.notTTYSchedule,2000),F.emptyOnZero=m(B.emptyOnZero,!1),F.forceRedraw=m(B.forceRedraw,!1),F.autopadding=m(B.autopadding,!1),F.gracefulExit=m(B.gracefulExit,!1),F},assignDerivedOptions:function D(_){return _.barCompleteString=_.barCompleteChar.repeat(_.barsize+1),_.barIncompleteString=_.barIncompleteChar.repeat(_.barsize+1),_.autopaddingChar=_.autopadding?m(_.autopaddingChar," "):"",_}}});var Y8=N((q$,d6)=>{var m6=w6(),f7=T8(),c7=z8(),p7=g2(),l7=require("events");d6.exports=class D extends l7{constructor(_){super();this.options=p7.assignDerivedOptions(_),this.terminal=this.options.terminal?this.options.terminal:new f7(this.options.stream),this.value=0,this.startValue=0,this.total=100,this.lastDrawnString=null,this.startTime=null,this.stopTime=null,this.lastRedraw=Date.now(),this.eta=new m6(this.options.etaBufferLength,0,0),this.payload={},this.isActive=!1,this.formatter=typeof this.options.format==="function"?this.options.format:c7}render(_=!1){let u={progress:this.getProgress(),eta:this.eta.getTime(),startTime:this.startTime,stopTime:this.stopTime,total:this.total,value:this.value,maxWidth:this.terminal.getWidth()};if(this.options.etaAsynchronousUpdate)this.updateETA();let F=this.formatter(this.options,u,this.payload);if(_||this.options.forceRedraw||this.options.noTTYOutput&&!this.terminal.isTTY()||this.lastDrawnString!=F)this.emit("redraw-pre"),this.terminal.cursorTo(0,null),this.terminal.write(F),this.terminal.clearRight(),this.lastDrawnString=F,this.lastRedraw=Date.now(),this.emit("redraw-post")}start(_,u,F){this.value=u||0,this.total=typeof _!=="undefined"&&_>=0?_:100,this.startValue=u||0,this.payload=F||{},this.startTime=Date.now(),this.stopTime=null,this.lastDrawnString="",this.eta=new m6(this.options.etaBufferLength,this.startTime,this.value),this.isActive=!0,this.emit("start",_,u)}stop(){this.isActive=!1,this.stopTime=Date.now(),this.emit("stop",this.total,this.value)}update(_,u={}){if(typeof _==="number")this.value=_,this.eta.update(Date.now(),_,this.total);let F=(typeof _==="object"?_:u)||{};this.emit("update",this.total,this.value);for(let B in F)this.payload[B]=F[B];if(this.value>=this.getTotal()&&this.options.stopOnComplete)this.stop()}getProgress(){let _=this.value/this.total;if(this.options.progressCalculationRelative)_=(this.value-this.startValue)/(this.total-this.startValue);if(isNaN(_))_=this.options&&this.options.emptyOnZero?0:1;return _=Math.min(Math.max(_,0),1),_}increment(_=1,u={}){if(typeof _==="object")this.update(this.value+1,_);else this.update(this.value+_,u)}getTotal(){return this.total}setTotal(_){if(typeof _!=="undefined"&&_>=0)this.total=_}updateETA(){this.eta.update(Date.now(),this.value,this.total)}}});var f6=N((X$,g6)=>{var i7=Y8(),n7=g2();g6.exports=class D extends i7{constructor(_,u){super(n7.parse(_,u));if(this.timer=null,this.options.noTTYOutput&&this.terminal.isTTY()===!1)this.options.synchronousUpdate=!1;this.schedulingRate=this.terminal.isTTY()?this.options.throttleTime:this.options.notTTYSchedule,this.sigintCallback=null}render(){if(this.timer)clearTimeout(this.timer),this.timer=null;if(super.render(),this.options.noTTYOutput&&this.terminal.isTTY()===!1)this.terminal.newline();this.timer=setTimeout(this.render.bind(this),this.schedulingRate)}update(_,u){if(!this.timer)return;if(super.update(_,u),this.options.synchronousUpdate&&this.lastRedraw+this.options.throttleTime*2<Date.now())this.render()}start(_,u,F){if(this.options.noTTYOutput===!1&&this.terminal.isTTY()===!1)return;if(this.sigintCallback===null&&this.options.gracefulExit)this.sigintCallback=this.stop.bind(this),process.once("SIGINT",this.sigintCallback),process.once("SIGTERM",this.sigintCallback);if(this.terminal.cursorSave(),this.options.hideCursor===!0)this.terminal.cursor(!1);if(this.options.linewrap===!1)this.terminal.lineWrapping(!1);super.start(_,u,F),this.render()}stop(){if(!this.timer)return;if(this.sigintCallback)process.removeListener("SIGINT",this.sigintCallback),process.removeListener("SIGTERM",this.sigintCallback),this.sigintCallback=null;if(this.render(),super.stop(),clearTimeout(this.timer),this.timer=null,this.options.hideCursor===!0)this.terminal.cursor(!0);if(this.options.linewrap===!1)this.terminal.lineWrapping(!0);if(this.terminal.cursorRestore(),this.options.clearOnComplete)this.terminal.cursorTo(0,null),this.terminal.clearLine();else this.terminal.newline()}}});var p6=N((Z$,c6)=>{var a7=T8(),s7=Y8(),r7=g2(),o7=require("events");c6.exports=class D extends o7{constructor(_,u){super();this.bars=[],this.options=r7.parse(_,u),this.options.synchronousUpdate=!1,this.terminal=this.options.terminal?this.options.terminal:new a7(this.options.stream),this.timer=null,this.isActive=!1,this.schedulingRate=this.terminal.isTTY()?this.options.throttleTime:this.options.notTTYSchedule,this.loggingBuffer=[],this.sigintCallback=null}create(_,u,F,B={}){let E=new s7(Object.assign({},this.options,{terminal:this.terminal},B));if(this.bars.push(E),this.options.noTTYOutput===!1&&this.terminal.isTTY()===!1)return E;if(this.sigintCallback===null&&this.options.gracefulExit)this.sigintCallback=this.stop.bind(this),process.once("SIGINT",this.sigintCallback),process.once("SIGTERM",this.sigintCallback);if(!this.isActive){if(this.options.hideCursor===!0)this.terminal.cursor(!1);if(this.options.linewrap===!1)this.terminal.lineWrapping(!1);this.timer=setTimeout(this.update.bind(this),this.schedulingRate)}return this.isActive=!0,E.start(_,u,F),this.emit("start"),E}remove(_){let u=this.bars.indexOf(_);if(u<0)return!1;return this.bars.splice(u,1),this.update(),this.terminal.newline(),this.terminal.clearBottom(),!0}update(){if(this.timer)clearTimeout(this.timer),this.timer=null;if(this.emit("update-pre"),this.terminal.cursorRelativeReset(),this.emit("redraw-pre"),this.loggingBuffer.length>0){this.terminal.clearLine();while(this.loggingBuffer.length>0)this.terminal.write(this.loggingBuffer.shift(),!0)}for(let _=0;_<this.bars.length;_++){if(_>0)this.terminal.newline();this.bars[_].render()}if(this.emit("redraw-post"),this.options.noTTYOutput&&this.terminal.isTTY()===!1)this.terminal.newline(),this.terminal.newline();if(this.timer=setTimeout(this.update.bind(this),this.schedulingRate),this.emit("update-post"),this.options.stopOnComplete&&!this.bars.find((_)=>_.isActive))this.stop()}stop(){if(clearTimeout(this.timer),this.timer=null,this.sigintCallback)process.removeListener("SIGINT",this.sigintCallback),process.removeListener("SIGTERM",this.sigintCallback),this.sigintCallback=null;if(this.isActive=!1,this.options.hideCursor===!0)this.terminal.cursor(!0);if(this.options.linewrap===!1)this.terminal.lineWrapping(!0);if(this.terminal.cursorRelativeReset(),this.emit("stop-pre-clear"),this.options.clearOnComplete)this.terminal.clearBottom();else{for(let _=0;_<this.bars.length;_++){if(_>0)this.terminal.newline();this.bars[_].render(),this.bars[_].stop()}this.terminal.newline()}this.emit("stop")}log(_){this.loggingBuffer.push(_)}}});var i6=N((J$,l6)=>{l6.exports={format:"progress [{bar}] {percentage}% | ETA: {eta}s | {value}/{total}",barCompleteChar:"=",barIncompleteChar:"-"}});var a6=N((Q$,n6)=>{n6.exports={format:" {bar} {percentage}% | ETA: {eta}s | {value}/{total}",barCompleteChar:"█",barIncompleteChar:"░"}});var r6=N((K$,s6)=>{s6.exports={format:" \x1B[90m{bar}\x1B[0m {percentage}% | ETA: {eta}s | {value}/{total}",barCompleteChar:"█",barIncompleteChar:"░"}});var t6=N((U$,o6)=>{o6.exports={format:" {bar}■ {percentage}% | ETA: {eta}s | {value}/{total}",barCompleteChar:"■",barIncompleteChar:" "}});var D5=N((H$,e6)=>{var t7=i6(),e7=a6(),Du=r6(),_u=t6();e6.exports={legacy:t7,shades_classic:e7,shades_grey:Du,rect:_u}});var F5=N((M$,u5)=>{var _5=f6(),uu=p6(),Fu=D5(),Bu=z8(),Eu=j8(),Cu=O8(),$u=P8();u5.exports={Bar:_5,SingleBar:_5,MultiBar:uu,Presets:Fu,Format:{Formatter:Bu,BarFormat:Cu,ValueFormat:Eu,TimeFormat:$u}}});var x8=N((R$,q5)=>{/*! arch. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var $5=require("child_process"),G5=require("fs"),Zu=require("path");q5.exports=function D(){if(process.arch==="x64")return"x64";if(process.platform==="darwin"){var _=process.arch==="arm64",u=$5.execSync("sysctl -in sysctl.proc_translated",{encoding:"utf8"})===`1
36
+ `;return _||u?"arm64":"x64"}if(process.platform==="win32"){var F=!1;try{F=!!(process.env.SYSTEMROOT&&G5.statSync(process.env.SYSTEMROOT))}catch($){}var B=F?process.env.SYSTEMROOT:"C:\\Windows",E=!1;try{E=!!G5.statSync(Zu.join(B,"sysnative"))}catch($){}return E?"x64":"x86"}if(process.platform==="linux"){var C=$5.execSync("getconf LONG_BIT",{encoding:"utf8"});return C===`64
37
+ `?"x64":"x86"}return"x86"}});var H5=N((T$,U5)=>{function Ju(D){return D&&D.__esModule&&Object.prototype.hasOwnProperty.call(D,"default")?D.default:D}var Qu=new Int32Array([0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918000,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117]);function K5(D){if(Buffer.isBuffer(D))return D;if(typeof D==="number")return Buffer.alloc(D);else if(typeof D==="string")return Buffer.from(D);else throw new Error("input must be buffer, number, or string, received "+typeof D)}function Ku(D){let _=K5(4);return _.writeInt32BE(D,0),_}function S8(D,_){if(D=K5(D),Buffer.isBuffer(_))_=_.readUInt32BE(0);let u=~~_^-1;for(var F=0;F<D.length;F++)u=Qu[(u^D[F])&255]^u>>>8;return u^-1}function y8(){return Ku(S8.apply(null,arguments))}y8.signed=function(){return S8.apply(null,arguments)};y8.unsigned=function(){return S8.apply(null,arguments)>>>0};var Uu=y8,Hu=Ju(Uu);U5.exports=Hu});var y5=N((g8)=>{var M5=require("fs"),a2=require("stream").Transform,V5=require("stream").PassThrough,L5=require("zlib"),m8=require("util"),Mu=require("events").EventEmitter,Wu=require("events").errorMonitor,I5=H5();g8.ZipFile=_0;g8.dateToDosDateTime=S5;m8.inherits(_0,Mu);function _0(){this.outputStream=new V5,this.entries=[],this.outputStreamCursor=0,this.ended=!1,this.allDone=!1,this.forceZip64Eocd=!1,this.errored=!1,this.on(Wu,function(){this.errored=!0})}_0.prototype.addFile=function(D,_,u){var F=this;if(_=r2(_,!1),u==null)u={};if(s2(F))return;var B=new d(_,!1,u);F.entries.push(B),M5.stat(D,function(E,C){if(E)return F.emit("error",E);if(!C.isFile())return F.emit("error",new Error("not a file: "+D));if(B.uncompressedSize=C.size,u.mtime==null)B.setLastModDate(C.mtime);if(u.mode==null)B.setFileAttributesMode(C.mode);B.setFileDataPumpFunction(function(){var $=M5.createReadStream(D);B.state=d.FILE_DATA_IN_PROGRESS,$.on("error",function(q){F.emit("error",q)}),R5(F,B,$)}),D0(F)})};_0.prototype.addReadStream=function(D,_,u){this.addReadStreamLazy(_,u,function(F){F(null,D)})};_0.prototype.addReadStreamLazy=function(D,_,u){var F=this;if(typeof _==="function")u=_,_=null;if(_==null)_={};if(D=r2(D,!1),s2(F))return;var B=new d(D,!1,_);F.entries.push(B),B.setFileDataPumpFunction(function(){B.state=d.FILE_DATA_IN_PROGRESS,u(function(E,C){if(E)return F.emit("error",E);R5(F,B,C)})}),D0(F)};_0.prototype.addBuffer=function(D,_,u){var F=this;if(_=r2(_,!1),D.length>1073741823)throw new Error("buffer too large: "+D.length+" > 1073741823");if(u==null)u={};if(u.size!=null)throw new Error("options.size not allowed");if(s2(F))return;var B=new d(_,!1,u);if(B.uncompressedSize=D.length,B.crc32=I5.unsigned(D),B.crcAndFileSizeKnown=!0,F.entries.push(B),B.compressionLevel===0)E(D);else L5.deflateRaw(D,{level:B.compressionLevel},function(C,$){E($)});function E(C){B.compressedSize=C.length,B.setFileDataPumpFunction(function(){A0(F,C),A0(F,B.getDataDescriptor()),B.state=d.FILE_DATA_DONE,setImmediate(function(){D0(F)})}),D0(F)}};_0.prototype.addEmptyDirectory=function(D,_){var u=this;if(D=r2(D,!0),_==null)_={};if(_.size!=null)throw new Error("options.size not allowed");if(_.compress!=null)throw new Error("options.compress not allowed");if(_.compressionLevel!=null)throw new Error("options.compressionLevel not allowed");if(s2(u))return;var F=new d(D,!0,_);u.entries.push(F),F.setFileDataPumpFunction(function(){A0(u,F.getDataDescriptor()),F.state=d.FILE_DATA_DONE,D0(u)}),D0(u)};var Au=eD([80,75,5,6]);_0.prototype.end=function(D,_){if(typeof D==="function")_=D,D=null;if(D==null)D={};if(this.ended)return;if(this.ended=!0,this.errored)return;if(this.calculatedTotalSizeCallback=_,this.forceZip64Eocd=!!D.forceZip64Format,D.comment){if(typeof D.comment==="string")this.comment=Ru(D.comment);else this.comment=D.comment;if(this.comment.length>65535)throw new Error("comment is too large");if(D2(this.comment,Au))throw new Error("comment contains end of central directory record signature")}else this.comment=_2;D0(this)};function A0(D,_){D.outputStream.write(_),D.outputStreamCursor+=_.length}function R5(D,_,u){var F=new d8,B=new n2,E=_.compressionLevel!==0?new L5.DeflateRaw({level:_.compressionLevel}):new V5,C=new n2;u.pipe(F).pipe(B).pipe(E).pipe(C).pipe(D.outputStream,{end:!1}),C.on("end",function(){if(_.crc32=F.crc32,_.uncompressedSize==null)_.uncompressedSize=B.byteCount;else if(_.uncompressedSize!==B.byteCount)return D.emit("error",new Error("file data stream has unexpected number of bytes"));_.compressedSize=C.byteCount,D.outputStreamCursor+=_.compressedSize,A0(D,_.getDataDescriptor()),_.state=d.FILE_DATA_DONE,D0(D)})}function Vu(D){if(D.compress!=null&&D.compressionLevel!=null){if(!!D.compress!==!!D.compressionLevel)throw new Error("conflicting settings for compress and compressionLevel")}if(D.compressionLevel!=null)return D.compressionLevel;if(D.compress===!1)return 0;return 6}function D0(D){if(D.allDone||D.errored)return;if(D.ended&&D.calculatedTotalSizeCallback!=null){var _=Lu(D);if(_!=null)D.calculatedTotalSizeCallback(_),D.calculatedTotalSizeCallback=null}var u=F();function F(){for(var E=0;E<D.entries.length;E++){var C=D.entries[E];if(C.state<d.FILE_DATA_DONE)return C}return null}if(u!=null){if(u.state<d.READY_TO_PUMP_FILE_DATA)return;if(u.state===d.FILE_DATA_IN_PROGRESS)return;u.relativeOffsetOfLocalHeader=D.outputStreamCursor;var B=u.getLocalFileHeader();A0(D,B),u.doFileDataPump()}else if(D.ended)D.offsetOfStartOfCentralDirectory=D.outputStreamCursor,D.entries.forEach(function(E){var C=E.getCentralDirectoryRecord();A0(D,C)}),A0(D,Iu(D)),D.outputStream.end(),D.allDone=!0}function Lu(D){var _=0,u=0;for(var F=0;F<D.entries.length;F++){var B=D.entries[F];if(B.compressionLevel!==0)return-1;if(B.state>=d.READY_TO_PUMP_FILE_DATA){if(B.uncompressedSize==null)return-1}else if(B.uncompressedSize==null)return null;B.relativeOffsetOfLocalHeader=_;var E=B.useZip64Format();if(_+=N5+B.utf8FileName.length,_+=B.uncompressedSize,!B.crcAndFileSizeKnown)if(E)_+=w5;else _+=Y5;if(u+=x5+B.utf8FileName.length+B.fileComment.length,!B.forceDosTimestamp)u+=v8;if(E)u+=b8}var C=0;if(D.forceZip64Eocd||D.entries.length>=65535||u>=65535||_>=4294967295)C+=l2+k8;return C+=i2+D.comment.length,_+u+C}function s2(D){if(D.ended)throw new Error("cannot add entries after calling end()");if(D.errored)return!0;return!1}var l2=56,k8=20,i2=22;function Iu(D,_){var u=!1,F=D.entries.length;if(D.forceZip64Eocd||D.entries.length>=65535)F=65535,u=!0;var B=D.outputStreamCursor-D.offsetOfStartOfCentralDirectory,E=B;if(D.forceZip64Eocd||B>=4294967295)E=4294967295,u=!0;var C=D.offsetOfStartOfCentralDirectory;if(D.forceZip64Eocd||D.offsetOfStartOfCentralDirectory>=4294967295)C=4294967295,u=!0;if(_)if(u)return l2+k8+i2;else return i2;var $=qD(i2+D.comment.length);if($.writeUInt32LE(101010256,0),$.writeUInt16LE(0,4),$.writeUInt16LE(0,6),$.writeUInt16LE(F,8),$.writeUInt16LE(F,10),$.writeUInt32LE(E,12),$.writeUInt32LE(C,16),$.writeUInt16LE(D.comment.length,20),D.comment.copy($,22),!u)return $;var q=qD(l2);q.writeUInt32LE(101075792,0),ID(q,l2-12,4),q.writeUInt16LE(O5,12),q.writeUInt16LE(j5,14),q.writeUInt32LE(0,16),q.writeUInt32LE(0,20),ID(q,D.entries.length,24),ID(q,D.entries.length,32),ID(q,B,40),ID(q,D.offsetOfStartOfCentralDirectory,48);var X=qD(k8);return X.writeUInt32LE(117853008,0),X.writeUInt32LE(0,4),ID(X,D.outputStreamCursor,8),X.writeUInt32LE(1,16),Buffer.concat([q,X,$])}function r2(D,_){if(D==="")throw new Error("empty metadataPath");if(D=D.replace(/\\/g,"/"),/^[a-zA-Z]:/.test(D)||/^\//.test(D))throw new Error("absolute path: "+D);if(D.split("/").indexOf("..")!==-1)throw new Error("invalid relative path: "+D);var u=/\/$/.test(D);if(_){if(!u)D+="/"}else if(u)throw new Error("file path cannot end with '/': "+D);return D}var _2=qD(0);function d(D,_,u){if(this.utf8FileName=eD(D),this.utf8FileName.length>65535)throw new Error("utf8 file name too long. "+utf8FileName.length+" > 65535");if(this.isDirectory=_,this.state=d.WAITING_FOR_METADATA,this.setLastModDate(u.mtime!=null?u.mtime:new Date),this.forceDosTimestamp=!!u.forceDosTimestamp,u.mode!=null)this.setFileAttributesMode(u.mode);else this.setFileAttributesMode(_?16893:33204);if(_)this.crcAndFileSizeKnown=!0,this.crc32=0,this.uncompressedSize=0,this.compressedSize=0;else if(this.crcAndFileSizeKnown=!1,this.crc32=null,this.uncompressedSize=null,this.compressedSize=null,u.size!=null)this.uncompressedSize=u.size;if(_)this.compressionLevel=0;else this.compressionLevel=Vu(u);if(this.forceZip64Format=!!u.forceZip64Format,u.fileComment){if(typeof u.fileComment==="string")this.fileComment=eD(u.fileComment,"utf-8");else this.fileComment=u.fileComment;if(this.fileComment.length>65535)throw new Error("fileComment is too large")}else this.fileComment=_2}d.WAITING_FOR_METADATA=0;d.READY_TO_PUMP_FILE_DATA=1;d.FILE_DATA_IN_PROGRESS=2;d.FILE_DATA_DONE=3;d.prototype.setLastModDate=function(D){this.mtime=D;var _=S5(D);this.lastModFileTime=_.time,this.lastModFileDate=_.date};d.prototype.setFileAttributesMode=function(D){if((D&65535)!==D)throw new Error("invalid mode. expected: 0 <= "+D+" <= 65535");this.externalFileAttributes=D<<16>>>0};d.prototype.setFileDataPumpFunction=function(D){this.doFileDataPump=D,this.state=d.READY_TO_PUMP_FILE_DATA};d.prototype.useZip64Format=function(){return this.forceZip64Format||this.uncompressedSize!=null&&this.uncompressedSize>4294967294||this.compressedSize!=null&&this.compressedSize>4294967294||this.relativeOffsetOfLocalHeader!=null&&this.relativeOffsetOfLocalHeader>4294967294};var N5=30,T5=20,j5=45,O5=831,P5=2048,z5=8;d.prototype.getLocalFileHeader=function(){var D=0,_=0,u=0;if(this.crcAndFileSizeKnown)D=this.crc32,_=this.compressedSize,u=this.uncompressedSize;var F=qD(N5),B=P5;if(!this.crcAndFileSizeKnown)B|=z5;return F.writeUInt32LE(67324752,0),F.writeUInt16LE(T5,4),F.writeUInt16LE(B,6),F.writeUInt16LE(this.getCompressionMethod(),8),F.writeUInt16LE(this.lastModFileTime,10),F.writeUInt16LE(this.lastModFileDate,12),F.writeUInt32LE(D,14),F.writeUInt32LE(_,18),F.writeUInt32LE(u,22),F.writeUInt16LE(this.utf8FileName.length,26),F.writeUInt16LE(0,28),Buffer.concat([F,this.utf8FileName])};var Y5=16,w5=24;d.prototype.getDataDescriptor=function(){if(this.crcAndFileSizeKnown)return _2;if(!this.useZip64Format()){var D=qD(Y5);return D.writeUInt32LE(134695760,0),D.writeUInt32LE(this.crc32,4),D.writeUInt32LE(this.compressedSize,8),D.writeUInt32LE(this.uncompressedSize,12),D}else{var D=qD(w5);return D.writeUInt32LE(134695760,0),D.writeUInt32LE(this.crc32,4),ID(D,this.compressedSize,8),ID(D,this.uncompressedSize,16),D}};var x5=46,v8=9,b8=28;d.prototype.getCentralDirectoryRecord=function(){var D=qD(x5),_=P5;if(!this.crcAndFileSizeKnown)_|=z5;var u=_2;if(!this.forceDosTimestamp){u=qD(v8),u.writeUInt16LE(21589,0),u.writeUInt16LE(v8-4,2);var F=1,B=2;u.writeUInt8(F|B,4);var E=Math.floor(this.mtime.getTime()/1000);if(E<-2147483648)E=-2147483648;if(E>2147483647)E=2147483647;u.writeUInt32LE(E,5)}var C=this.compressedSize,$=this.uncompressedSize,q=this.relativeOffsetOfLocalHeader,X=T5,G=_2;if(this.useZip64Format())C=4294967295,$=4294967295,q=4294967295,X=j5,G=qD(b8),G.writeUInt16LE(1,0),G.writeUInt16LE(b8-4,2),ID(G,this.uncompressedSize,4),ID(G,this.compressedSize,12),ID(G,this.relativeOffsetOfLocalHeader,20);return D.writeUInt32LE(33639248,0),D.writeUInt16LE(O5,4),D.writeUInt16LE(X,6),D.writeUInt16LE(_,8),D.writeUInt16LE(this.getCompressionMethod(),10),D.writeUInt16LE(this.lastModFileTime,12),D.writeUInt16LE(this.lastModFileDate,14),D.writeUInt32LE(this.crc32,16),D.writeUInt32LE(C,20),D.writeUInt32LE($,24),D.writeUInt16LE(this.utf8FileName.length,28),D.writeUInt16LE(u.length+G.length,30),D.writeUInt16LE(this.fileComment.length,32),D.writeUInt16LE(0,34),D.writeUInt16LE(0,36),D.writeUInt32LE(this.externalFileAttributes,38),D.writeUInt32LE(q,42),Buffer.concat([D,this.utf8FileName,u,G,this.fileComment])};d.prototype.getCompressionMethod=function(){var D=0,_=8;return this.compressionLevel===0?D:_};var W5=new Date(1980,0,1),A5=new Date(2107,11,31,23,59,58);function S5(D){if(D<W5)D=W5;else if(D>A5)D=A5;var _=0;_|=D.getDate()&31,_|=(D.getMonth()+1&15)<<5,_|=(D.getFullYear()-1980&127)<<9;var u=0;return u|=Math.floor(D.getSeconds()/2),u|=(D.getMinutes()&63)<<5,u|=(D.getHours()&31)<<11,{date:_,time:u}}function ID(D,_,u){var F=Math.floor(_/4294967296),B=_%4294967296;D.writeUInt32LE(B,u),D.writeUInt32LE(F,u+4)}m8.inherits(n2,a2);function n2(D){a2.call(this,D),this.byteCount=0}n2.prototype._transform=function(D,_,u){this.byteCount+=D.length,u(null,D)};m8.inherits(d8,a2);function d8(D){a2.call(this,D),this.crc32=0}d8.prototype._transform=function(D,_,u){this.crc32=I5.unsigned(D,this.crc32),u(null,D)};var h8="\x00☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ";if(h8.length!==256)throw new Error("assertion failure");var p2=null;function Ru(D){if(/^[\x20-\x7e]*$/.test(D))return eD(D,"utf-8");if(p2==null){p2={};for(var _=0;_<h8.length;_++)p2[h8[_]]=_}var u=qD(D.length);for(var _=0;_<D.length;_++){var F=p2[D[_]];if(F==null)throw new Error("character not encodable in CP437: "+JSON.stringify(D[_]));u[_]=F}return u}function qD(D){qD=_;try{return qD(D)}catch(F){return qD=u,qD(D)}function _(F){return Buffer.allocUnsafe(F)}function u(F){return new Buffer(F)}}function eD(D,_){eD=u;try{return eD(D,_)}catch(B){return eD=F,eD(D,_)}function u(B,E){return Buffer.from(B,E)}function F(B,E){return new Buffer(B,E)}}function D2(D,_){D2=u;try{return D2(D,_)}catch(B){return D2=F,D2(D,_)}function u(B,E){return B.includes(E)}function F(B,E){for(var C=0;C<=B.length-E.length;C++)for(var $=0;;$++){if($===E.length)return!0;if(B[C+$]!==E[$])break}return!1}}});var o2=N((QD)=>{Object.defineProperty(QD,"__esModule",{value:!0});QD.unlink=Nu;QD.mkdir=Tu;QD.realpath=ju;QD.stat=Ou;QD.lstat=Pu;QD.chmod=zu;QD.readdir=Yu;QD.access=wu;QD.rmdir=xu;QD.symlink=Su;QD.readlink=yu;var RD=require("fs"),ND=require("util");function Nu(D){return ND.promisify(RD.unlink)(D)}function Tu(D,_){return ND.promisify(RD.mkdir)(D,_)}function ju(D){return ND.promisify(RD.realpath)(D)}function Ou(D){return ND.promisify(RD.stat)(D)}function Pu(D){return ND.promisify(RD.lstat)(D)}function zu(D,_){return ND.promisify(RD.chmod)(D,_)}function Yu(D){return ND.promisify(RD.readdir)(D)}function wu(D,_){return ND.promisify(RD.access)(D,_)}function xu(D){return ND.promisify(RD.rmdir)(D)}function Su(D,_,u){return ND.promisify(RD.symlink)(D,_,u)}function yu(D){return ND.promisify(RD.readlink)(D)}});var f8=N((u0)=>{Object.defineProperty(u0,"__esModule",{value:!0});u0.readdirp=v5;u0.getFileEntry=b5;u0.ensureFolder=h5;u0.pathExists=ku;u0.rimraf=m5;u0.isRootPath=d5;var t2=require("path"),TD=o2();async function v5(D){let _=[],u=await TD.readdir(D);for(let F of u){let B=t2.join(D,F),E=await b5(B);if(!E.isSymbolicLink&&E.type==="dir"){let C=await v5(B);if(C.length>0){_.push(...C);continue}}_.push(E)}return _}async function b5(D){let _=await TD.lstat(D),u=!1,F="file";if(_.isDirectory())F="dir";else if(_.isSymbolicLink()){if(u=!0,(await TD.stat(D)).isDirectory())F="dir"}return{path:D,isSymbolicLink:u,type:F,mtime:_.mtime,mode:_.mode}}async function h5(D){if(D===t2.dirname(D))return Promise.resolve();try{await k5(D)}catch(_){if(_.code==="ENOENT")return await h5(t2.dirname(D)),k5(D);return Promise.reject(_)}}async function ku(D){try{return await TD.access(D),!0}catch(_){return!1}}async function m5(D){if(d5(D))return Promise.reject(new Error(`Refuse to recursively delete root, path: "${D}"`));try{let _=await TD.lstat(D);if(_.isDirectory()&&!_.isSymbolicLink()){let u=await TD.readdir(D);await Promise.all(u.map((F)=>m5(t2.join(D,F)))),await TD.rmdir(D)}else{let u=_.mode;if(!(u&128))await TD.chmod(D,u|128);return TD.unlink(D)}}catch(_){if(_.code!=="ENOENT")throw _}}async function k5(D){try{await TD.mkdir(D,511)}catch(_){if(_.code==="ENOENT")return Promise.reject(_);try{if(!(await TD.stat(D)).isDirectory())return Promise.reject(new Error(`"${D}" exists and is not a directory.`))}catch(u){throw _}}}var vu=65,bu=90,hu=97,mu=122,du=58,gu=92,fu=47;function cu(D){return D>=vu&&D<=bu||D>=hu&&D<=mu}var pu="\\",lu="/";function d5(D){if(!D)return!1;if(D===pu||D===lu)return!0;if(process.platform==="win32"){if(D.length>3)return!1;return cu(D.charCodeAt(0))&&D.charCodeAt(1)===du&&(D.length===2||D.charCodeAt(2)===gu||D.charCodeAt(2)===fu)}return!1}});var c8=N((S0)=>{Object.defineProperty(S0,"__esModule",{value:!0});S0.Cancelable=S0.CancellationToken=void 0;class g5{constructor(){this._isCancelled=!1,this._callbacks=new Set}get isCancelled(){return this._isCancelled}onCancelled(D){if(this.isCancelled)return D(),()=>{};return this._callbacks.add(D),()=>this._callbacks.delete(D)}cancel(){if(this._isCancelled)return;this._isCancelled=!0,this._callbacks.forEach((D)=>D()),this._callbacks.clear()}}S0.CancellationToken=g5;class f5{wrapError(D,_){if(_)return this.canceledError();return D}canceledError(){let D=new Error("Canceled");return D.name=D.message,D}}S0.Cancelable=f5});var l8=N((D3)=>{Object.defineProperty(D3,"__esModule",{value:!0});D3.Zip=void 0;var iu=y5(),c5=require("fs"),p8=f8(),e2=require("path"),p5=o2(),l5=c8();class i5 extends l5.Cancelable{constructor(D){super();this.options=D,this.isPipe=!1,this.zipFiles=[],this.zipFolders=[]}addFile(D,_){let u=_;if(!u)u=e2.basename(D);this.zipFiles.push({path:D,metadataPath:u})}addFolder(D,_){this.zipFolders.push({path:D,metadataPath:_})}async archive(D){if(!D)return Promise.reject(new Error("zipPath must not be empty"));let _=new l5.CancellationToken;return this.token=_,this.isPipe=!1,await p8.ensureFolder(e2.dirname(D)),this.yazlFile=new iu.ZipFile,new Promise(async(u,F)=>{this.yazlFile.once("error",(E)=>{F(this.wrapError(E,_.isCancelled))});let B=this.yazlFile;if(!_.isCancelled)this.zipStream=c5.createWriteStream(D),this.zipStream.once("error",(E)=>{F(this.wrapError(E,_.isCancelled))}),this.zipStream.once("close",()=>{if(_.isCancelled)F(this.canceledError());else u(void 0)}),B.outputStream.once("error",(E)=>{F(this.wrapError(E,_.isCancelled))}),B.outputStream.pipe(this.zipStream),this.isPipe=!0;try{let E=this.zipFiles;for(let C of E){let $=await p8.getFileEntry(C.path);await this.addEntry(B,$,C,_)}if(this.zipFolders.length>0)await this.walkDir(this.zipFolders,_)}catch(E){F(this.wrapError(E,_.isCancelled));return}B.end()})}cancel(){if(this.token)this.token.cancel(),this.token=null;this.stopPipe(this.canceledError())}async addEntry(D,_,u,F){if(_.isSymbolicLink)if(this.followSymlink())if(_.type==="dir"){let B=await p5.realpath(u.path);await this.walkDir([{path:B,metadataPath:u.metadataPath}],F)}else D.addFile(u.path,u.metadataPath,this.getYazlOption());else await this.addSymlink(D,_,u.metadataPath);else if(_.type==="dir")D.addEmptyDirectory(u.metadataPath,{mtime:_.mtime,mode:_.mode});else await this.addFileStream(D,_,u.metadataPath,F)}addFileStream(D,_,u,F){return new Promise((B,E)=>{let C=c5.createReadStream(_.path);C.once("error",($)=>{let q=this.wrapError($,F.isCancelled);this.stopPipe(q),E(q)}),C.once("close",()=>{B()}),D.addReadStream(C,u,Object.assign(Object.assign({},this.getYazlOption()),{mode:_.mode,mtime:_.mtime}))})}async addSymlink(D,_,u){let F=await p5.readlink(_.path);D.addBuffer(Buffer.from(F),u,Object.assign(Object.assign({},this.getYazlOption()),{mtime:_.mtime,mode:_.mode}))}async walkDir(D,_){for(let u of D){if(_.isCancelled)return;let F=await p8.readdirp(u.path);if(F.length>0)for(let B of F){if(_.isCancelled)return;let E=e2.relative(u.path,B.path),C=u.metadataPath?e2.join(u.metadataPath,E):E;await this.addEntry(this.yazlFile,B,{path:B.path,metadataPath:C},_)}else if(u.metadataPath)this.yazlFile.addEmptyDirectory(u.metadataPath)}}stopPipe(D){if(this.isPipe)this.yazlFile.outputStream.unpipe(this.zipStream),this.zipStream.destroy(D),this.isPipe=!1}followSymlink(){let D=!1;if(this.options&&this.options.followSymlinks===!0)D=!0;return D}getYazlOption(){if(!this.options)return;if(typeof this.options.compressionLevel!=="number")return;return{compressionLevel:this.options.compressionLevel}}}D3.Zip=i5});var r5=N((w$,s5)=>{s5.exports=_3;function _3(){this.pending=0,this.max=1/0,this.listeners=[],this.waiting=[],this.error=null}_3.prototype.go=function(D){if(this.pending<this.max)a5(this,D);else this.waiting.push(D)};_3.prototype.wait=function(D){if(this.pending===0)D(this.error);else this.listeners.push(D)};_3.prototype.hold=function(){return n5(this)};function n5(D){D.pending+=1;var _=!1;return u;function u(B){if(_)throw new Error("callback called twice");if(_=!0,D.error=D.error||B,D.pending-=1,D.waiting.length>0&&D.pending<D.max)a5(D,D.waiting.shift());else if(D.pending===0){var E=D.listeners;D.listeners=[],E.forEach(F)}}function F(B){B(D.error)}}function a5(D,_){_(n5(D))}});var t5=N((F2)=>{var u2=require("fs"),u3=require("util"),i8=require("stream"),o5=i8.Readable,n8=i8.Writable,nu=i8.PassThrough,au=r5(),F3=require("events").EventEmitter;F2.createFromBuffer=su;F2.createFromFd=ru;F2.BufferSlicer=cD;F2.FdSlicer=fD;u3.inherits(fD,F3);function fD(D,_){_=_||{},F3.call(this),this.fd=D,this.pend=new au,this.pend.max=1,this.refCount=0,this.autoClose=!!_.autoClose}fD.prototype.read=function(D,_,u,F,B){var E=this;E.pend.go(function(C){u2.read(E.fd,D,_,u,F,function($,q,X){C(),B($,q,X)})})};fD.prototype.write=function(D,_,u,F,B){var E=this;E.pend.go(function(C){u2.write(E.fd,D,_,u,F,function($,q,X){C(),B($,q,X)})})};fD.prototype.createReadStream=function(D){return new B3(this,D)};fD.prototype.createWriteStream=function(D){return new E3(this,D)};fD.prototype.ref=function(){this.refCount+=1};fD.prototype.unref=function(){var D=this;if(D.refCount-=1,D.refCount>0)return;if(D.refCount<0)throw new Error("invalid unref");if(D.autoClose)u2.close(D.fd,_);function _(u){if(u)D.emit("error",u);else D.emit("close")}};u3.inherits(B3,o5);function B3(D,_){_=_||{},o5.call(this,_),this.context=D,this.context.ref(),this.start=_.start||0,this.endOffset=_.end,this.pos=this.start,this.destroyed=!1}B3.prototype._read=function(D){var _=this;if(_.destroyed)return;var u=Math.min(_._readableState.highWaterMark,D);if(_.endOffset!=null)u=Math.min(u,_.endOffset-_.pos);if(u<=0){_.destroyed=!0,_.push(null),_.context.unref();return}_.context.pend.go(function(F){if(_.destroyed)return F();var B=Buffer.allocUnsafe(u);u2.read(_.context.fd,B,0,u,_.pos,function(E,C){if(E)_.destroy(E);else if(C===0)_.destroyed=!0,_.push(null),_.context.unref();else _.pos+=C,_.push(B.slice(0,C));F()})})};B3.prototype.destroy=function(D){if(this.destroyed)return;D=D||new Error("stream destroyed"),this.destroyed=!0,this.emit("error",D),this.context.unref()};u3.inherits(E3,n8);function E3(D,_){_=_||{},n8.call(this,_),this.context=D,this.context.ref(),this.start=_.start||0,this.endOffset=_.end==null?1/0:+_.end,this.bytesWritten=0,this.pos=this.start,this.destroyed=!1,this.on("finish",this.destroy.bind(this))}E3.prototype._write=function(D,_,u){var F=this;if(F.destroyed)return;if(F.pos+D.length>F.endOffset){var B=new Error("maximum file length exceeded");B.code="ETOOBIG",F.destroy(),u(B);return}F.context.pend.go(function(E){if(F.destroyed)return E();u2.write(F.context.fd,D,0,D.length,F.pos,function(C,$){if(C)F.destroy(),E(),u(C);else F.bytesWritten+=$,F.pos+=$,F.emit("progress"),E(),u()})})};E3.prototype.destroy=function(){if(this.destroyed)return;this.destroyed=!0,this.context.unref()};u3.inherits(cD,F3);function cD(D,_){F3.call(this),_=_||{},this.refCount=0,this.buffer=D,this.maxChunkSize=_.maxChunkSize||Number.MAX_SAFE_INTEGER}cD.prototype.read=function(D,_,u,F,B){if(!(0<=_&&_<=D.length))throw new RangeError("offset outside buffer: 0 <= "+_+" <= "+D.length);if(F<0)throw new RangeError("position is negative: "+F);if(_+u>D.length)u=D.length-_;if(F+u>this.buffer.length)u=this.buffer.length-F;if(u<=0){setImmediate(function(){B(null,0)});return}this.buffer.copy(D,_,F,F+u),setImmediate(function(){B(null,u)})};cD.prototype.write=function(D,_,u,F,B){D.copy(this.buffer,F,_,_+u),setImmediate(function(){B(null,u,D)})};cD.prototype.createReadStream=function(D){D=D||{};var _=new nu(D);_.destroyed=!1,_.start=D.start||0,_.endOffset=D.end,_.pos=_.endOffset||this.buffer.length;var u=this.buffer.slice(_.start,_.pos),F=0;while(!0){var B=F+this.maxChunkSize;if(B>=u.length){if(F<u.length)_.write(u.slice(F,u.length));break}_.write(u.slice(F,B)),F=B}return _.end(),_.destroy=function(){_.destroyed=!0},_};cD.prototype.createWriteStream=function(D){var _=this;D=D||{};var u=new n8(D);return u.start=D.start||0,u.endOffset=D.end==null?this.buffer.length:+D.end,u.bytesWritten=0,u.pos=u.start,u.destroyed=!1,u._write=function(F,B,E){if(u.destroyed)return;var C=u.pos+F.length;if(C>u.endOffset){var $=new Error("maximum file length exceeded");$.code="ETOOBIG",u.destroyed=!0,E($);return}F.copy(_.buffer,u.pos,0,F.length),u.bytesWritten+=F.length,u.pos=C,u.emit("progress"),E()},u.destroy=function(){u.destroyed=!0},u};cD.prototype.ref=function(){this.refCount+=1};cD.prototype.unref=function(){if(this.refCount-=1,this.refCount<0)throw new Error("invalid unref")};function su(D,_){return new cD(D,_)}function ru(D,_){return new fD(D,_)}});var _4=N((S$,D4)=>{var F0=require("buffer").Buffer,a8=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918000,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];if(typeof Int32Array!=="undefined")a8=new Int32Array(a8);function e5(D){if(F0.isBuffer(D))return D;var _=typeof F0.alloc==="function"&&typeof F0.from==="function";if(typeof D==="number")return _?F0.alloc(D):new F0(D);else if(typeof D==="string")return _?F0.from(D):new F0(D);else throw new Error("input must be buffer, number, or string, received "+typeof D)}function ou(D){var _=e5(4);return _.writeInt32BE(D,0),_}function s8(D,_){if(D=e5(D),F0.isBuffer(_))_=_.readUInt32BE(0);var u=~~_^-1;for(var F=0;F<D.length;F++)u=a8[(u^D[F])&255]^u>>>8;return u^-1}function r8(){return ou(s8.apply(null,arguments))}r8.signed=function(){return s8.apply(null,arguments)};r8.unsigned=function(){return s8.apply(null,arguments)>>>0};D4.exports=r8});var Z4=N((KD)=>{var o8=require("fs"),tu=require("zlib"),u4=t5(),eu=_4(),G3=require("util"),q3=require("events").EventEmitter,F4=require("stream").Transform,e8=require("stream").PassThrough,DF=require("stream").Writable;KD.open=_F;KD.fromFd=B4;KD.fromBuffer=uF;KD.fromRandomAccessReader=D1;KD.dosDateTimeToDate=$4;KD.getFileNameLowLevel=G4;KD.validateFileName=q4;KD.parseExtraFields=X4;KD.ZipFile=wD;KD.Entry=B2;KD.LocalFileHeader=C4;KD.RandomAccessReader=B0;function _F(D,_,u){if(typeof _==="function")u=_,_=null;if(_==null)_={};if(_.autoClose==null)_.autoClose=!0;if(_.lazyEntries==null)_.lazyEntries=!1;if(_.decodeStrings==null)_.decodeStrings=!0;if(_.validateEntrySizes==null)_.validateEntrySizes=!0;if(_.strictFileNames==null)_.strictFileNames=!1;if(u==null)u=$3;o8.open(D,"r",function(F,B){if(F)return u(F);B4(B,_,function(E,C){if(E)o8.close(B,$3);u(E,C)})})}function B4(D,_,u){if(typeof _==="function")u=_,_=null;if(_==null)_={};if(_.autoClose==null)_.autoClose=!1;if(_.lazyEntries==null)_.lazyEntries=!1;if(_.decodeStrings==null)_.decodeStrings=!0;if(_.validateEntrySizes==null)_.validateEntrySizes=!0;if(_.strictFileNames==null)_.strictFileNames=!1;if(u==null)u=$3;o8.fstat(D,function(F,B){if(F)return u(F);var E=u4.createFromFd(D,{autoClose:!0});D1(E,B.size,_,u)})}function uF(D,_,u){if(typeof _==="function")u=_,_=null;if(_==null)_={};if(_.autoClose=!1,_.lazyEntries==null)_.lazyEntries=!1;if(_.decodeStrings==null)_.decodeStrings=!0;if(_.validateEntrySizes==null)_.validateEntrySizes=!0;if(_.strictFileNames==null)_.strictFileNames=!1;var F=u4.createFromBuffer(D,{maxChunkSize:65536});D1(F,D.length,_,u)}function D1(D,_,u,F){if(typeof u==="function")F=u,u=null;if(u==null)u={};if(u.autoClose==null)u.autoClose=!0;if(u.lazyEntries==null)u.lazyEntries=!1;if(u.decodeStrings==null)u.decodeStrings=!0;var B=!!u.decodeStrings;if(u.validateEntrySizes==null)u.validateEntrySizes=!0;if(u.strictFileNames==null)u.strictFileNames=!1;if(F==null)F=$3;if(typeof _!=="number")throw new Error("expected totalSize parameter to be a number");if(_>Number.MAX_SAFE_INTEGER)throw new Error("zip file too large. only file sizes up to 2^52 are supported due to JavaScript's Number type being an IEEE 754 double.");D.ref();var E=22,C=20,$=65535,q=Math.min(C+E+$,_),X=pD(q),G=_-X.length;k0(D,X,0,q,G,function(Z){if(Z)return F(Z);for(var J=q-E;J>=0;J-=1){if(X.readUInt32LE(J)!==101010256)continue;var K=X.subarray(J),Q=K.readUInt16LE(4),M=K.readUInt16LE(10),W=K.readUInt32LE(16),V=K.readUInt16LE(20),L=K.length-E;if(V!==L)return F(new Error("Invalid comment length. Expected: "+L+". Found: "+V+". Are there extra bytes at the end of the file? Or is the end of central dir signature `PK☺☻` in the comment?"));var T=B?C3(K.subarray(22),!1):K.subarray(22);if(J-C>=0&&X.readUInt32LE(J-C)===117853008){var S=X.subarray(J-C,J-C+C),j=y0(S,8),v=pD(56);return k0(D,v,0,v.length,j,function(DD){if(DD)return F(DD);if(v.readUInt32LE(0)!==101075792)return F(new Error("invalid zip64 end of central directory record signature"));if(Q=v.readUInt32LE(16),Q!==0)return F(new Error("multi-disk zip files are not supported: found disk number: "+Q));return M=y0(v,32),W=y0(v,48),F(null,new wD(D,W,_,M,T,u.autoClose,u.lazyEntries,B,u.validateEntrySizes,u.strictFileNames))})}if(Q!==0)return F(new Error("multi-disk zip files are not supported: found disk number: "+Q));return F(null,new wD(D,W,_,M,T,u.autoClose,u.lazyEntries,B,u.validateEntrySizes,u.strictFileNames))}F(new Error("End of central directory record signature not found. Either not a zip file, or file is truncated."))})}G3.inherits(wD,q3);function wD(D,_,u,F,B,E,C,$,q,X){var G=this;if(q3.call(G),G.reader=D,G.reader.on("error",function(Z){E4(G,Z)}),G.reader.once("close",function(){G.emit("close")}),G.readEntryCursor=_,G.fileSize=u,G.entryCount=F,G.comment=B,G.entriesRead=0,G.autoClose=!!E,G.lazyEntries=!!C,G.decodeStrings=!!$,G.validateEntrySizes=!!q,G.strictFileNames=!!X,G.isOpen=!0,G.emittedError=!1,!G.lazyEntries)G._readEntry()}wD.prototype.close=function(){if(!this.isOpen)return;this.isOpen=!1,this.reader.unref()};function YD(D,_){if(D.autoClose)D.close();E4(D,_)}function E4(D,_){if(D.emittedError)return;D.emittedError=!0,D.emit("error",_)}wD.prototype.readEntry=function(){if(!this.lazyEntries)throw new Error("readEntry() called without lazyEntries:true");this._readEntry()};wD.prototype._readEntry=function(){var D=this;if(D.entryCount===D.entriesRead){setImmediate(function(){if(D.autoClose)D.close();if(D.emittedError)return;D.emit("end")});return}if(D.emittedError)return;var _=pD(46);k0(D.reader,_,0,_.length,D.readEntryCursor,function(u){if(u)return YD(D,u);if(D.emittedError)return;var F=new B2,B=_.readUInt32LE(0);if(B!==33639248)return YD(D,new Error("invalid central directory file header signature: 0x"+B.toString(16)));if(F.versionMadeBy=_.readUInt16LE(4),F.versionNeededToExtract=_.readUInt16LE(6),F.generalPurposeBitFlag=_.readUInt16LE(8),F.compressionMethod=_.readUInt16LE(10),F.lastModFileTime=_.readUInt16LE(12),F.lastModFileDate=_.readUInt16LE(14),F.crc32=_.readUInt32LE(16),F.compressedSize=_.readUInt32LE(20),F.uncompressedSize=_.readUInt32LE(24),F.fileNameLength=_.readUInt16LE(28),F.extraFieldLength=_.readUInt16LE(30),F.fileCommentLength=_.readUInt16LE(32),F.internalFileAttributes=_.readUInt16LE(36),F.externalFileAttributes=_.readUInt32LE(38),F.relativeOffsetOfLocalHeader=_.readUInt32LE(42),F.generalPurposeBitFlag&64)return YD(D,new Error("strong encryption is not supported"));D.readEntryCursor+=46,_=pD(F.fileNameLength+F.extraFieldLength+F.fileCommentLength),k0(D.reader,_,0,_.length,D.readEntryCursor,function(E){if(E)return YD(D,E);if(D.emittedError)return;F.fileNameRaw=_.subarray(0,F.fileNameLength);var C=F.fileNameLength+F.extraFieldLength;F.extraFieldRaw=_.subarray(F.fileNameLength,C),F.fileCommentRaw=_.subarray(C,C+F.fileCommentLength);try{F.extraFields=X4(F.extraFieldRaw)}catch(M){return YD(D,M)}if(D.decodeStrings){var $=(F.generalPurposeBitFlag&2048)!==0;F.fileComment=C3(F.fileCommentRaw,$),F.fileName=G4(F.generalPurposeBitFlag,F.fileNameRaw,F.extraFields,D.strictFileNames);var q=q4(F.fileName);if(q!=null)return YD(D,new Error(q))}else F.fileComment=F.fileCommentRaw,F.fileName=F.fileNameRaw;F.comment=F.fileComment,D.readEntryCursor+=_.length,D.entriesRead+=1;for(var X=0;X<F.extraFields.length;X++){var G=F.extraFields[X];if(G.id!==1)continue;var Z=G.data,J=0;if(F.uncompressedSize===4294967295){if(J+8>Z.length)return YD(D,new Error("zip64 extended information extra field does not include uncompressed size"));F.uncompressedSize=y0(Z,J),J+=8}if(F.compressedSize===4294967295){if(J+8>Z.length)return YD(D,new Error("zip64 extended information extra field does not include compressed size"));F.compressedSize=y0(Z,J),J+=8}if(F.relativeOffsetOfLocalHeader===4294967295){if(J+8>Z.length)return YD(D,new Error("zip64 extended information extra field does not include relative header offset"));F.relativeOffsetOfLocalHeader=y0(Z,J),J+=8}break}if(D.validateEntrySizes&&F.compressionMethod===0){var K=F.uncompressedSize;if(F.isEncrypted())K+=12;if(F.compressedSize!==K){var Q="compressed/uncompressed size mismatch for stored file: "+F.compressedSize+" != "+F.uncompressedSize;return YD(D,new Error(Q))}}if(D.emit("entry",F),!D.lazyEntries)D._readEntry()})})};wD.prototype.openReadStream=function(D,_,u){var F=this,B=0,E=D.compressedSize;if(u==null)u=_,_=null;if(_==null)_={};else{if(_.decrypt!=null){if(!D.isEncrypted())throw new Error("options.decrypt can only be specified for encrypted entries");if(_.decrypt!==!1)throw new Error("invalid options.decrypt value: "+_.decrypt);if(D.isCompressed()){if(_.decompress!==!1)throw new Error("entry is encrypted and compressed, and options.decompress !== false")}}if(_.decompress!=null){if(!D.isCompressed())throw new Error("options.decompress can only be specified for compressed entries");if(!(_.decompress===!1||_.decompress===!0))throw new Error("invalid options.decompress value: "+_.decompress)}if(_.start!=null||_.end!=null){if(D.isCompressed()&&_.decompress!==!1)throw new Error("start/end range not allowed for compressed entry without options.decompress === false");if(D.isEncrypted()&&_.decrypt!==!1)throw new Error("start/end range not allowed for encrypted entry without options.decrypt === false")}if(_.start!=null){if(B=_.start,B<0)throw new Error("options.start < 0");if(B>D.compressedSize)throw new Error("options.start > entry.compressedSize")}if(_.end!=null){if(E=_.end,E<0)throw new Error("options.end < 0");if(E>D.compressedSize)throw new Error("options.end > entry.compressedSize");if(E<B)throw new Error("options.end < options.start")}}if(!F.isOpen)return u(new Error("closed"));if(D.isEncrypted()){if(_.decrypt!==!1)return u(new Error("entry is encrypted, and options.decrypt !== false"))}var C;if(D.compressionMethod===0)C=!1;else if(D.compressionMethod===8)C=_.decompress!=null?_.decompress:!0;else return u(new Error("unsupported compression method: "+D.compressionMethod));F.readLocalFileHeader(D,{minimal:!0},function($,q){if($)return u($);F.openReadStreamLowLevel(q.fileDataStart,D.compressedSize,B,E,C,D.uncompressedSize,u)})};wD.prototype.openReadStreamLowLevel=function(D,_,u,F,B,E,C){var $=this,q=D+_,X=$.reader.createReadStream({start:D+u,end:D+F}),G=X;if(B){var Z=!1,J=tu.createInflateRaw();if(X.on("error",function(K){setImmediate(function(){if(!Z)J.emit("error",K)})}),X.pipe(J),$.validateEntrySizes)G=new E2(E),J.on("error",function(K){setImmediate(function(){if(!Z)G.emit("error",K)})}),J.pipe(G);else G=J;t8(G,function(){if(Z=!0,J!==G)J.unpipe(G);X.unpipe(J),X.destroy()})}C(null,G)};wD.prototype.readLocalFileHeader=function(D,_,u){var F=this;if(u==null)u=_,_=null;if(_==null)_={};F.reader.ref();var B=pD(30);k0(F.reader,B,0,B.length,D.relativeOffsetOfLocalHeader,function(E){try{if(E)return u(E);var C=B.readUInt32LE(0);if(C!==67324752)return u(new Error("invalid local file header signature: 0x"+C.toString(16)));var $=B.readUInt16LE(26),q=B.readUInt16LE(28),X=D.relativeOffsetOfLocalHeader+30+$+q;if(X+D.compressedSize>F.fileSize)return u(new Error("file data overflows file bounds: "+X+" + "+D.compressedSize+" > "+F.fileSize));if(_.minimal)return u(null,{fileDataStart:X});var G=new C4;G.fileDataStart=X,G.versionNeededToExtract=B.readUInt16LE(4),G.generalPurposeBitFlag=B.readUInt16LE(6),G.compressionMethod=B.readUInt16LE(8),G.lastModFileTime=B.readUInt16LE(10),G.lastModFileDate=B.readUInt16LE(12),G.crc32=B.readUInt32LE(14),G.compressedSize=B.readUInt32LE(18),G.uncompressedSize=B.readUInt32LE(22),G.fileNameLength=$,G.extraFieldLength=q,B=pD($+q),F.reader.ref(),k0(F.reader,B,0,B.length,D.relativeOffsetOfLocalHeader+30,function(Z){try{if(Z)return u(Z);return G.fileName=B.subarray(0,$),G.extraField=B.subarray($),u(null,G)}finally{F.reader.unref()}})}finally{F.reader.unref()}})};function B2(){}B2.prototype.getLastModDate=function(D){if(D==null)D={};if(!D.forceDosFormat)for(var _=0;_<this.extraFields.length;_++){var u=this.extraFields[_];if(u.id===21589){var F=u.data;if(F.length<5)continue;var B=F[0],E=1;if(!(B&E))continue;var C=F.readInt32LE(1);return new Date(C*1000)}else if(u.id===10){var F=u.data,$=4;while($<F.length+4){var q=F.readUInt16LE($);$+=2;var X=F.readUInt16LE($);if($+=2,q!==1){$+=X;continue}if(X<8||$+X>F.length)break;var G=4294967296*F.readInt32LE($+4)+F.readUInt32LE($),Z=G/1e4-11644473600000;return new Date(Z)}}}return $4(this.lastModFileDate,this.lastModFileTime,D.timezone)};B2.prototype.isEncrypted=function(){return(this.generalPurposeBitFlag&1)!==0};B2.prototype.isCompressed=function(){return this.compressionMethod===8};function C4(){}function $4(D,_,u){var F=D&31,B=(D>>5&15)-1,E=(D>>9&127)+1980,C=0,$=(_&31)*2,q=_>>5&63,X=_>>11&31;if(u==null||u==="local")return new Date(E,B,F,X,q,$,C);else if(u==="UTC")return new Date(Date.UTC(E,B,F,X,q,$,C));else throw new Error("unrecognized options.timezone: "+options.timezone)}function G4(D,_,u,F){var B=null;for(var E=0;E<u.length;E++){var C=u[E];if(C.id===28789){if(C.data.length<6)continue;if(C.data.readUInt8(0)!==1)continue;var $=C.data.readUInt32LE(1);if(eu.unsigned(_)!==$)continue;B=C3(C.data.subarray(5),!0);break}}if(B==null){var q=(D&2048)!==0;B=C3(_,q)}if(!F)B=B.replace(/\\/g,"/");return B}function q4(D){if(D.indexOf("\\")!==-1)return"invalid characters in fileName: "+D;if(/^[a-zA-Z]:/.test(D)||/^\//.test(D))return"absolute path: "+D;if(D.split("/").indexOf("..")!==-1)return"invalid relative path: "+D;return null}function X4(D){var _=[],u=0;while(u<D.length-3){var F=D.readUInt16LE(u+0),B=D.readUInt16LE(u+2),E=u+4,C=E+B;if(C>D.length)throw new Error("extra field length exceeds extra field buffer size");var $=D.subarray(E,C);_.push({id:F,data:$}),u=C}return _}function k0(D,_,u,F,B,E){if(F===0)return setImmediate(function(){E(null,pD(0))});D.read(_,u,F,B,function(C,$){if(C)return E(C);if($<F)return E(new Error("unexpected EOF"));E()})}G3.inherits(E2,F4);function E2(D){F4.call(this),this.actualByteCount=0,this.expectedByteCount=D}E2.prototype._transform=function(D,_,u){if(this.actualByteCount+=D.length,this.actualByteCount>this.expectedByteCount){var F="too many bytes in the stream. expected "+this.expectedByteCount+". got at least "+this.actualByteCount;return u(new Error(F))}u(null,D)};E2.prototype._flush=function(D){if(this.actualByteCount<this.expectedByteCount){var _="not enough bytes in the stream. expected "+this.expectedByteCount+". got only "+this.actualByteCount;return D(new Error(_))}D()};G3.inherits(B0,q3);function B0(){q3.call(this),this.refCount=0}B0.prototype.ref=function(){this.refCount+=1};B0.prototype.unref=function(){var D=this;if(D.refCount-=1,D.refCount>0)return;if(D.refCount<0)throw new Error("invalid unref");D.close(_);function _(u){if(u)return D.emit("error",u);D.emit("close")}};B0.prototype.createReadStream=function(D){if(D==null)D={};var{start:_,end:u}=D;if(_===u){var F=new e8;return setImmediate(function(){F.end()}),F}var B=this._readStreamForRange(_,u),E=!1,C=new X3(this);B.on("error",function(q){setImmediate(function(){if(!E)C.emit("error",q)})}),t8(C,function(){B.unpipe(C),C.unref(),B.destroy()});var $=new E2(u-_);return C.on("error",function(q){setImmediate(function(){if(!E)$.emit("error",q)})}),t8($,function(){E=!0,C.unpipe($),C.destroy()}),B.pipe(C).pipe($)};B0.prototype._readStreamForRange=function(D,_){throw new Error("not implemented")};B0.prototype.read=function(D,_,u,F,B){var E=this.createReadStream({start:F,end:F+u}),C=new DF,$=0;C._write=function(q,X,G){q.copy(D,_+$,0,q.length),$+=q.length,G()},C.on("finish",B),E.on("error",function(q){B(q)}),E.pipe(C)};B0.prototype.close=function(D){setImmediate(D)};G3.inherits(X3,e8);function X3(D){e8.call(this),this.context=D,this.context.ref(),this.unreffedYet=!1}X3.prototype._flush=function(D){this.unref(),D()};X3.prototype.unref=function(D){if(this.unreffedYet)return;this.unreffedYet=!0,this.context.unref()};var FF="\x00☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ";function C3(D,_){if(_)return D.toString("utf8");else{var u="";for(var F=0;F<D.length;F++)u+=FF[D[F]];return u}}function y0(D,_){var u=D.readUInt32LE(_),F=D.readUInt32LE(_+4);return F*4294967296+u}var pD;if(typeof Buffer.allocUnsafe==="function")pD=function(D){return Buffer.allocUnsafe(D)};else pD=function(D){return new Buffer(D)};function t8(D,_){if(typeof D.destroy==="function")D._destroy=function(u,F){if(_(),F!=null)F(u)};else D.destroy=_}function $3(D){if(D)throw D}});var _1=N((Q3)=>{Object.defineProperty(Q3,"__esModule",{value:!0});Q3.Unzip=void 0;var J4=Z4(),Z3=f8(),BF=require("fs"),C2=require("path"),J3=o2(),Q4=c8();class K4{constructor(D){this._entryCount=D,this._isPrevented=!1}get entryName(){return this._entryName}set entryName(D){this._entryName=D}get entryCount(){return this._entryCount}get isPrevented(){return this._isPrevented}preventDefault(){this._isPrevented=!0}reset(){this._isPrevented=!1}}class U4{constructor(D,_,u){this._targetFolder=D,this._realTargetFolder=_,this.symlinkAsFileOnWindows=u,this._symlinkFileNames=[]}get decodeEntryFileName(){return this._decodeEntryFileName}set decodeEntryFileName(D){this._decodeEntryFileName=D}get targetFolder(){return this._targetFolder}get realTargetFolder(){return this._realTargetFolder}get symlinkFileNames(){return this._symlinkFileNames}getFilePath(){return C2.join(this.targetFolder,this.decodeEntryFileName)}async isOutsideTargetFolder(D){if(this.symlinkFileNames.length===0)return!1;if(process.platform==="win32"&&this.symlinkAsFileOnWindows)return!1;for(let _ of this.symlinkFileNames)if(D.includes(_)){if((await J3.realpath(D)).indexOf(this.realTargetFolder)!==0)return!0}return!1}}class H4 extends Q4.Cancelable{constructor(D){super();this.options=D}async extract(D,_){let u=0,F=new Q4.CancellationToken;if(this.token=F,this.isOverwrite())await Z3.rimraf(_);if(F.isCancelled)return Promise.reject(this.canceledError());await Z3.ensureFolder(_);let B=await J3.realpath(_),E=await this.openZip(D,F);return this.zipFile=E,E.readEntry(),new Promise((C,$)=>{let q=null,X=E.entryCount;if(E.once("error",(J)=>{this.closeZip(),$(this.wrapError(J,F.isCancelled))}),E.once("close",()=>{if(this.zipFile=null,q)$(this.wrapError(q,F.isCancelled));else if(F.isCancelled)$(this.canceledError());else if(X===0)C(void 0)}),F.isCancelled){this.closeZip();return}let G=new U4(_,B,this.symlinkToFile()),Z=new K4(X);E.on("entry",async(J)=>{let Q=J.fileName.toString("utf8").replace(/\\/g,"/"),M=J4.validateFileName(Q);if(M!=null){q=new Error(M),this.closeZip(),$(q);return}Z.entryName=Q,this.onEntryCallback(Z),G.decodeEntryFileName=Q;try{if(Z.isPrevented)Z.reset(),E.readEntry();else await this.handleEntry(E,J,G,F);if(u++,u===X)C()}catch(W){q=this.wrapError(W,F.isCancelled),this.closeZip(),$(q)}})})}cancel(){if(this.token)this.token.cancel(),this.token=null;this.closeZip()}closeZip(){if(this.zipFile)this.zipFile.close(),this.zipFile=null}openZip(D,_){return new Promise((u,F)=>{J4.open(D,{lazyEntries:!0,decodeStrings:!1},(B,E)=>{if(B)F(this.wrapError(B,_.isCancelled));else u(E)})})}async handleEntry(D,_,u,F){if(/\/$/.test(u.decodeEntryFileName))await Z3.ensureFolder(u.getFilePath()),D.readEntry();else await this.extractEntry(D,_,u,F)}openZipFileStream(D,_,u){return new Promise((F,B)=>{D.openReadStream(_,(E,C)=>{if(E)B(this.wrapError(E,u.isCancelled));else F(C)})})}async extractEntry(D,_,u,F){let B=u.getFilePath(),E=C2.dirname(B);if(await Z3.ensureFolder(E),await u.isOutsideTargetFolder(E)){let q=new Error(`Refuse to write file outside "${u.targetFolder}", file: "${B}"`);return q.name="AFWRITE",Promise.reject(q)}let $=await this.openZipFileStream(D,_,F);await this.writeEntryToFile($,_,u,F),D.readEntry()}async writeEntryToFile(D,_,u,F){let B;return F.onCancelled(()=>{if(B)D.unpipe(B),B.destroy(this.canceledError())}),new Promise(async(E,C)=>{try{let $=u.getFilePath(),q=this.modeFromEntry(_),X=(q&61440)===40960;if(D.once("error",(G)=>{C(this.wrapError(G,F.isCancelled))}),X)u.symlinkFileNames.push(u.decodeEntryFileName);if(X&&!this.symlinkToFile()){let G="";D.on("data",(Z)=>{if(Z instanceof String)G+=Z;else G+=Z.toString()}),D.once("end",()=>{this.createSymlink(G,$).then(E,C)})}else B=BF.createWriteStream($,{mode:q}),B.once("close",()=>E()),B.once("error",(G)=>{C(this.wrapError(G,F.isCancelled))}),D.pipe(B)}catch($){C(this.wrapError($,F.isCancelled))}})}modeFromEntry(D){let _=D.externalFileAttributes>>16||33188;return[448,56,7].map((u)=>_&u).reduce((u,F)=>u+F,_&61440)}async createSymlink(D,_){let u="file";if(process.platform==="win32")if(/\/$/.test(D))u="dir";else{let F=D;if(!C2.isAbsolute(D))F=C2.join(C2.dirname(_),D);try{if((await J3.stat(F)).isDirectory())u="dir"}catch(B){}}await J3.symlink(D,_,u)}isOverwrite(){if(this.options&&this.options.overwrite)return!0;return!1}onEntryCallback(D){if(this.options&&this.options.onEntry)this.options.onEntry(D)}symlinkToFile(){let D=!1;if(process.platform==="win32")if(this.options&&this.options.symlinkAsFileOnWindows===!1)D=!1;else D=!0;return D}}Q3.Unzip=H4});var A4=N((jD)=>{var EF=jD&&jD.__createBinding||(Object.create?function(D,_,u,F){if(F===void 0)F=u;var B=Object.getOwnPropertyDescriptor(_,u);if(!B||("get"in B?!_.__esModule:B.writable||B.configurable))B={enumerable:!0,get:function(){return _[u]}};Object.defineProperty(D,F,B)}:function(D,_,u,F){if(F===void 0)F=u;D[F]=_[u]}),M4=jD&&jD.__exportStar||function(D,_){for(var u in D)if(u!=="default"&&!Object.prototype.hasOwnProperty.call(_,u))EF(_,D,u)};Object.defineProperty(jD,"__esModule",{value:!0});jD.archiveFile=$F;jD.archiveFolder=GF;jD.extract=qF;var W4=l8(),CF=_1();M4(l8(),jD);M4(_1(),jD);function $F(D,_,u){let F=new W4.Zip(u);return F.addFile(D),F.archive(_)}function GF(D,_,u){let F=new W4.Zip(u);return F.addFolder(D),F.archive(_)}function qF(D,_,u){return new CF.Unzip(u).extract(D,_)}});var j1=x(T1()),{program:iF,createCommand:nF,createArgument:aF,createOption:sF,CommanderError:rF,InvalidArgumentError:oF,InvalidOptionArgumentError:tF,Command:m0,Argument:eF,Option:DB,Help:_B}=j1.default;var H2=(D)=>D.name==="up"||D.name==="k"||D.ctrl&&D.name==="p",y3=(D)=>D.name==="down"||D.name==="j"||D.ctrl&&D.name==="n";var M2=(D)=>D.name==="backspace",O1=(D)=>"123456789".includes(D.name),aD=(D)=>D.name==="enter"||D.name==="return";class k3 extends Error{name="AbortPromptError";message="Prompt was aborted";constructor(D){super();this.cause=D?.cause}}class v3 extends Error{name="CancelPromptError";message="Prompt was canceled"}class b3 extends Error{name="ExitPromptError"}class h3 extends Error{name="HookError"}class d0 extends Error{name="ValidationError"}var g3=require("node:async_hooks");var W2=require("node:async_hooks");var P1=new W2.AsyncLocalStorage;function W9(D){return{rl:D,hooks:[],hooksCleanup:[],hooksEffect:[],index:0,handleChange(){}}}function z1(D,_){let u=W9(D);return P1.run(u,()=>{function F(B){u.handleChange=()=>{u.index=0,B()},u.handleChange()}return _(F)})}function q0(){let D=P1.getStore();if(!D)throw new h3("[Inquirer] Hook functions can only be called from within a prompt");return D}function m3(){return q0().rl}function d3(D){let _=(...u)=>{let F=q0(),B=!1,E=F.handleChange;F.handleChange=()=>{B=!0};let C=D(...u);if(B)E();return F.handleChange=E,C};return W2.AsyncResource.bind(_)}function V0(D){let _=q0(),{index:u}=_,F={get(){return _.hooks[u]},set(E){_.hooks[u]=E},initialized:u in _.hooks},B=D(F);return _.index++,B}function Y1(){q0().handleChange()}var X0={queue(D){let _=q0(),{index:u}=_;_.hooksEffect.push(()=>{_.hooksCleanup[u]?.();let F=D(m3());if(F!=null&&typeof F!=="function")throw new d0("useEffect return value must be a cleanup function or nothing.");_.hooksCleanup[u]=F})},run(){let D=q0();d3(()=>{D.hooksEffect.forEach((_)=>{_()}),D.hooksEffect.length=0})()},clearAll(){let D=q0();D.hooksCleanup.forEach((_)=>{_?.()}),D.hooksEffect.length=0,D.hooksCleanup.length=0}};function n(D){return V0((_)=>{let u=(B)=>{if(_.get()!==B)_.set(B),Y1()};if(_.initialized)return[_.get(),u];let F=typeof D==="function"?D():D;return _.set(F),[F,u]})}function kD(D,_){V0((u)=>{let F=u.get();if(!Array.isArray(F)||_.some((E,C)=>!Object.is(E,F[C])))X0.queue(D);u.set(_)})}var HD=x(g0());var WD=x(require("node:process"));function L9(){if(WD.default.platform!=="win32")return WD.default.env.TERM!=="linux";return Boolean(WD.default.env.WT_SESSION)||Boolean(WD.default.env.TERMINUS_SUBLIME)||WD.default.env.ConEmuTask==="{cmd::Cmder}"||WD.default.env.TERM_PROGRAM==="Terminus-Sublime"||WD.default.env.TERM_PROGRAM==="vscode"||WD.default.env.TERM==="xterm-256color"||WD.default.env.TERM==="alacritty"||WD.default.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var x1={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"█",squareDarkShade:"▓",squareMediumShade:"▒",squareLightShade:"░",squareTop:"▀",squareBottom:"▄",squareLeft:"▌",squareRight:"▐",squareCenter:"■",bullet:"●",dot:"․",ellipsis:"…",pointerSmall:"›",triangleUp:"▲",triangleUpSmall:"▴",triangleDown:"▼",triangleDownSmall:"▾",triangleLeftSmall:"◂",triangleRightSmall:"▸",home:"⌂",heart:"♥",musicNote:"♪",musicNoteBeamed:"♫",arrowUp:"↑",arrowDown:"↓",arrowLeft:"←",arrowRight:"→",arrowLeftRight:"↔",arrowUpDown:"↕",almostEqual:"≈",notEqual:"≠",lessOrEqual:"≤",greaterOrEqual:"≥",identical:"≡",infinity:"∞",subscriptZero:"₀",subscriptOne:"₁",subscriptTwo:"₂",subscriptThree:"₃",subscriptFour:"₄",subscriptFive:"₅",subscriptSix:"₆",subscriptSeven:"₇",subscriptEight:"₈",subscriptNine:"₉",oneHalf:"½",oneThird:"⅓",oneQuarter:"¼",oneFifth:"⅕",oneSixth:"⅙",oneEighth:"⅛",twoThirds:"⅔",twoFifths:"⅖",threeQuarters:"¾",threeFifths:"⅗",threeEighths:"⅜",fourFifths:"⅘",fiveSixths:"⅚",fiveEighths:"⅝",sevenEighths:"⅞",line:"─",lineBold:"━",lineDouble:"═",lineDashed0:"┄",lineDashed1:"┅",lineDashed2:"┈",lineDashed3:"┉",lineDashed4:"╌",lineDashed5:"╍",lineDashed6:"╴",lineDashed7:"╶",lineDashed8:"╸",lineDashed9:"╺",lineDashed10:"╼",lineDashed11:"╾",lineDashed12:"−",lineDashed13:"–",lineDashed14:"‐",lineDashed15:"⁃",lineVertical:"│",lineVerticalBold:"┃",lineVerticalDouble:"║",lineVerticalDashed0:"┆",lineVerticalDashed1:"┇",lineVerticalDashed2:"┊",lineVerticalDashed3:"┋",lineVerticalDashed4:"╎",lineVerticalDashed5:"╏",lineVerticalDashed6:"╵",lineVerticalDashed7:"╷",lineVerticalDashed8:"╹",lineVerticalDashed9:"╻",lineVerticalDashed10:"╽",lineVerticalDashed11:"╿",lineDownLeft:"┐",lineDownLeftArc:"╮",lineDownBoldLeftBold:"┓",lineDownBoldLeft:"┒",lineDownLeftBold:"┑",lineDownDoubleLeftDouble:"╗",lineDownDoubleLeft:"╖",lineDownLeftDouble:"╕",lineDownRight:"┌",lineDownRightArc:"╭",lineDownBoldRightBold:"┏",lineDownBoldRight:"┎",lineDownRightBold:"┍",lineDownDoubleRightDouble:"╔",lineDownDoubleRight:"╓",lineDownRightDouble:"╒",lineUpLeft:"┘",lineUpLeftArc:"╯",lineUpBoldLeftBold:"┛",lineUpBoldLeft:"┚",lineUpLeftBold:"┙",lineUpDoubleLeftDouble:"╝",lineUpDoubleLeft:"╜",lineUpLeftDouble:"╛",lineUpRight:"└",lineUpRightArc:"╰",lineUpBoldRightBold:"┗",lineUpBoldRight:"┖",lineUpRightBold:"┕",lineUpDoubleRightDouble:"╚",lineUpDoubleRight:"╙",lineUpRightDouble:"╘",lineUpDownLeft:"┤",lineUpBoldDownBoldLeftBold:"┫",lineUpBoldDownBoldLeft:"┨",lineUpDownLeftBold:"┥",lineUpBoldDownLeftBold:"┩",lineUpDownBoldLeftBold:"┪",lineUpDownBoldLeft:"┧",lineUpBoldDownLeft:"┦",lineUpDoubleDownDoubleLeftDouble:"╣",lineUpDoubleDownDoubleLeft:"╢",lineUpDownLeftDouble:"╡",lineUpDownRight:"├",lineUpBoldDownBoldRightBold:"┣",lineUpBoldDownBoldRight:"┠",lineUpDownRightBold:"┝",lineUpBoldDownRightBold:"┡",lineUpDownBoldRightBold:"┢",lineUpDownBoldRight:"┟",lineUpBoldDownRight:"┞",lineUpDoubleDownDoubleRightDouble:"╠",lineUpDoubleDownDoubleRight:"╟",lineUpDownRightDouble:"╞",lineDownLeftRight:"┬",lineDownBoldLeftBoldRightBold:"┳",lineDownLeftBoldRightBold:"┯",lineDownBoldLeftRight:"┰",lineDownBoldLeftBoldRight:"┱",lineDownBoldLeftRightBold:"┲",lineDownLeftRightBold:"┮",lineDownLeftBoldRight:"┭",lineDownDoubleLeftDoubleRightDouble:"╦",lineDownDoubleLeftRight:"╥",lineDownLeftDoubleRightDouble:"╤",lineUpLeftRight:"┴",lineUpBoldLeftBoldRightBold:"┻",lineUpLeftBoldRightBold:"┷",lineUpBoldLeftRight:"┸",lineUpBoldLeftBoldRight:"┹",lineUpBoldLeftRightBold:"┺",lineUpLeftRightBold:"┶",lineUpLeftBoldRight:"┵",lineUpDoubleLeftDoubleRightDouble:"╩",lineUpDoubleLeftRight:"╨",lineUpLeftDoubleRightDouble:"╧",lineUpDownLeftRight:"┼",lineUpBoldDownBoldLeftBoldRightBold:"╋",lineUpDownBoldLeftBoldRightBold:"╈",lineUpBoldDownLeftBoldRightBold:"╇",lineUpBoldDownBoldLeftRightBold:"╊",lineUpBoldDownBoldLeftBoldRight:"╉",lineUpBoldDownLeftRight:"╀",lineUpDownBoldLeftRight:"╁",lineUpDownLeftBoldRight:"┽",lineUpDownLeftRightBold:"┾",lineUpBoldDownBoldLeftRight:"╂",lineUpDownLeftBoldRightBold:"┿",lineUpBoldDownLeftBoldRight:"╃",lineUpBoldDownLeftRightBold:"╄",lineUpDownBoldLeftBoldRight:"╅",lineUpDownBoldLeftRightBold:"╆",lineUpDoubleDownDoubleLeftDoubleRightDouble:"╬",lineUpDoubleDownDoubleLeftRight:"╫",lineUpDownLeftDoubleRightDouble:"╪",lineCross:"╳",lineBackslash:"╲",lineSlash:"╱"},S1={tick:"✔",info:"ℹ",warning:"⚠",cross:"✘",squareSmall:"◻",squareSmallFilled:"◼",circle:"◯",circleFilled:"◉",circleDotted:"◌",circleDouble:"◎",circleCircle:"ⓞ",circleCross:"ⓧ",circlePipe:"Ⓘ",radioOn:"◉",radioOff:"◯",checkboxOn:"☒",checkboxOff:"☐",checkboxCircleOn:"ⓧ",checkboxCircleOff:"Ⓘ",pointer:"❯",triangleUpOutline:"△",triangleLeft:"◀",triangleRight:"▶",lozenge:"◆",lozengeOutline:"◇",hamburger:"☰",smiley:"㋡",mustache:"෴",star:"★",play:"▶",nodejs:"⬢",oneSeventh:"⅐",oneNinth:"⅑",oneTenth:"⅒"},I9={tick:"√",info:"i",warning:"‼",cross:"×",squareSmall:"□",squareSmallFilled:"■",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(○)",circleCross:"(×)",circlePipe:"(│)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[×]",checkboxOff:"[ ]",checkboxCircleOn:"(×)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"∆",triangleLeft:"◄",triangleRight:"►",lozenge:"♦",lozengeOutline:"◊",hamburger:"≡",smiley:"☺",mustache:"┌─┐",star:"✶",play:"►",nodejs:"♦",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},R9={...x1,...S1},N9={...x1,...I9},T9=L9(),j9=T9?R9:N9,sD=j9,JB=Object.entries(S1);var y1={prefix:{idle:HD.default.blue("?"),done:HD.default.green(sD.tick)},spinner:{interval:80,frames:["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"].map((D)=>HD.default.yellow(D))},style:{answer:HD.default.cyan,message:HD.default.bold,error:(D)=>HD.default.red(`> ${D}`),defaultAnswer:(D)=>HD.default.dim(`(${D})`),help:HD.default.dim,highlight:HD.default.cyan,key:(D)=>HD.default.cyan(HD.default.bold(`<${D}>`))}};function k1(D){if(typeof D!=="object"||D===null)return!1;let _=D;while(Object.getPrototypeOf(_)!==null)_=Object.getPrototypeOf(_);return Object.getPrototypeOf(D)===_}function v1(...D){let _={};for(let u of D)for(let[F,B]of Object.entries(u)){let E=_[F];_[F]=k1(E)&&k1(B)?v1(E,B):B}return _}function AD(...D){let _=[y1,...D.filter((u)=>u!=null)];return v1(..._)}function vD({status:D="idle",theme:_}){let[u,F]=n(!1),[B,E]=n(0),{prefix:C,spinner:$}=AD(_);if(kD(()=>{if(D==="loading"){let X,G=-1,Z=setTimeout(g3.AsyncResource.bind(()=>{F(!0),X=setInterval(g3.AsyncResource.bind(()=>{G=G+1,E(G%$.frames.length)}),$.interval)}),300);return()=>{clearTimeout(Z),clearInterval(X)}}else F(!1)},[D]),u)return $.frames[B];return typeof C==="string"?C:C[D==="loading"?"idle":D]??C.idle}function Z0(D,_){return V0((u)=>{let F=u.get();if(!F||F.dependencies.length!==_.length||F.dependencies.some((B,E)=>B!==_[E])){let B=D();return u.set({value:B,dependencies:_}),B}return F.value})}function PD(D){return n({current:D})[0]}function bD(D){let _=PD(D);_.current=D,kD((u)=>{let F=!1,B=d3((E,C)=>{if(F)return;_.current(C,u)});return u.input.on("keypress",B),()=>{F=!0,u.input.removeListener("keypress",B)}},[])}var X_=x(h1()),Z_=x(q_());function p0(D,_){return D.split(`
38
+ `).flatMap((u)=>Z_.default(u,_,{trim:!1,hard:!0}).split(`
39
39
  `).map((F)=>F.trimEnd())).join(`
40
- `)}function K2(){return p1.default({defaultWidth:80,output:R3().output})}function X7(D,_){return m0(D,_).split(`
41
- `)}function Z7(D,_){let u=_.length,F=(D%u+u)%u;return[..._.slice(F),..._.slice(0,F)]}function i1({items:D,width:_,renderItem:u,active:F,position:B,pageSize:E}){let C=D.map((Q,M)=>({item:Q,index:M,isActive:M===F})),$=Z7(F-B,C).slice(0,E),q=(Q)=>$[Q]==null?[]:X7(u($[Q]),_),X=Array.from({length:E}),G=q(B).slice(0,E),Z=B+G.length<=E?B:E-G.length;X.splice(Z,G.length,...G);let J=Z+G.length,K=B+1;while(J<E&&K<$.length){for(let Q of q(K))if(X[J++]=Q,J>=E)break;K++}J=Z-1,K=B-1;while(J>=0&&K>=0){for(let Q of q(K).reverse())if(X[J--]=Q,J<0)break;K--}return X.filter((Q)=>typeof Q==="string")}function n1({active:D,pageSize:_,total:u}){let F=Math.floor(_/2);if(u<=_||D<F)return D;if(D>=u-F)return D+_-u;return F}function a1({active:D,lastActive:_,total:u,pageSize:F,pointer:B}){if(u<=F)return D;if(_<D&&D-_<F)return Math.min(Math.floor(F/2),B+D-_);return B}function d0({items:D,active:_,renderItem:u,pageSize:F,loop:B=!0}){let E=jD({position:0,lastActive:0}),C=B?a1({active:_,lastActive:E.current.lastActive,total:D.length,pageSize:F,pointer:E.current.position}):n1({active:_,total:D.length,pageSize:F});return E.current.position=C,E.current.lastActive=_,i1({items:D,width:K2(),renderItem:u,active:_,position:C,pageSize:F}).join(`
42
- `)}var C_=GD(o1(),1);import*as E_ from"node:readline";import{AsyncResource as A7}from"node:async_hooks";var q0=[];q0.push("SIGHUP","SIGINT","SIGTERM");if(process.platform!=="win32")q0.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")q0.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var U2=(D)=>!!D&&typeof D==="object"&&typeof D.removeListener==="function"&&typeof D.emit==="function"&&typeof D.reallyExit==="function"&&typeof D.listeners==="function"&&typeof D.kill==="function"&&typeof D.pid==="number"&&typeof D.on==="function",y3=Symbol.for("signal-exit emitter"),k3=globalThis,Q7=Object.defineProperty.bind(Object);class t1{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(k3[y3])return k3[y3];Q7(k3,y3,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(D,_){this.listeners[D].push(_)}removeListener(D,_){let u=this.listeners[D],F=u.indexOf(_);if(F===-1)return;if(F===0&&u.length===1)u.length=0;else u.splice(F,1)}emit(D,_,u){if(this.emitted[D])return!1;this.emitted[D]=!0;let F=!1;for(let B of this.listeners[D])F=B(_,u)===!0||F;if(D==="exit")F=this.emit("afterExit",_,u)||F;return F}}class b3{}var K7=(D)=>{return{onExit(_,u){return D.onExit(_,u)},load(){return D.load()},unload(){return D.unload()}}};class e1 extends b3{onExit(){return()=>{}}load(){}unload(){}}class D_ extends b3{#u=v3.platform==="win32"?"SIGINT":"SIGHUP";#_=new t1;#D;#E;#C;#B={};#F=!1;constructor(D){super();this.#D=D,this.#B={};for(let _ of q0)this.#B[_]=()=>{let u=this.#D.listeners(_),{count:F}=this.#_,B=D;if(typeof B.__signal_exit_emitter__==="object"&&typeof B.__signal_exit_emitter__.count==="number")F+=B.__signal_exit_emitter__.count;if(u.length===F){this.unload();let E=this.#_.emit("exit",null,_),C=_==="SIGHUP"?this.#u:_;if(!E)D.kill(D.pid,C)}};this.#C=D.reallyExit,this.#E=D.emit}onExit(D,_){if(!U2(this.#D))return()=>{};if(this.#F===!1)this.load();let u=_?.alwaysLast?"afterExit":"exit";return this.#_.on(u,D),()=>{if(this.#_.removeListener(u,D),this.#_.listeners.exit.length===0&&this.#_.listeners.afterExit.length===0)this.unload()}}load(){if(this.#F)return;this.#F=!0,this.#_.count+=1;for(let D of q0)try{let _=this.#B[D];if(_)this.#D.on(D,_)}catch(_){}this.#D.emit=(D,..._)=>{return this.#G(D,..._)},this.#D.reallyExit=(D)=>{return this.#$(D)}}unload(){if(!this.#F)return;this.#F=!1,q0.forEach((D)=>{let _=this.#B[D];if(!_)throw new Error("Listener not defined for signal: "+D);try{this.#D.removeListener(D,_)}catch(u){}}),this.#D.emit=this.#E,this.#D.reallyExit=this.#C,this.#_.count-=1}#$(D){if(!U2(this.#D))return 0;return this.#D.exitCode=D||0,this.#_.emit("exit",this.#D.exitCode,null),this.#C.call(this.#D,this.#D.exitCode)}#G(D,..._){let u=this.#E;if(D==="exit"&&U2(this.#D)){if(typeof _[0]==="number")this.#D.exitCode=_[0];let F=u.call(this.#D,D,..._);return this.#_.emit("exit",this.#D.exitCode,null),F}else return u.call(this.#D,D,..._)}}var v3=globalThis.process,{onExit:__,load:MC,unload:WC}=K7(U2(v3)?new D_(v3):new e1);var aD=GD(m3(),1);import{stripVTControlCharacters as M7}from"node:util";var F_=(D)=>D.split(`
43
- `).length,W7=(D)=>D.split(`
44
- `).pop()??"";function B_(D){return D>0?aD.default.cursorDown(D):""}class M2{rl;height=0;extraLinesUnderPrompt=0;cursorPos;constructor(D){this.rl=D,this.rl=D,this.cursorPos=D.getCursorPos()}write(D){this.rl.output.unmute(),this.rl.output.write(D),this.rl.output.mute()}render(D,_=""){let u=W7(D),F=M7(u),B=F;if(this.rl.line.length>0)B=B.slice(0,-this.rl.line.length);this.rl.setPrompt(B),this.cursorPos=this.rl.getCursorPos();let E=K2();if(D=m0(D,E),_=m0(_,E),F.length%E===0)D+=`
40
+ `)}function L2(){return X_.default({defaultWidth:80,output:m3().output})}function a9(D,_){return p0(D,_).split(`
41
+ `)}function s9(D,_){let u=_.length,F=(D%u+u)%u;return[..._.slice(F),..._.slice(0,F)]}function J_({items:D,width:_,renderItem:u,active:F,position:B,pageSize:E}){let C=D.map((Q,M)=>({item:Q,index:M,isActive:M===F})),$=s9(F-B,C).slice(0,E),q=(Q)=>$[Q]==null?[]:a9(u($[Q]),_),X=Array.from({length:E}),G=q(B).slice(0,E),Z=B+G.length<=E?B:E-G.length;X.splice(Z,G.length,...G);let J=Z+G.length,K=B+1;while(J<E&&K<$.length){for(let Q of q(K))if(X[J++]=Q,J>=E)break;K++}J=Z-1,K=B-1;while(J>=0&&K>=0){for(let Q of q(K).reverse())if(X[J--]=Q,J<0)break;K--}return X.filter((Q)=>typeof Q==="string")}function Q_({active:D,pageSize:_,total:u}){let F=Math.floor(_/2);if(u<=_||D<F)return D;if(D>=u-F)return D+_-u;return F}function K_({active:D,lastActive:_,total:u,pageSize:F,pointer:B}){if(u<=F)return D;if(_<D&&D-_<F)return Math.min(Math.floor(F/2),B+D-_);return B}function l0({items:D,active:_,renderItem:u,pageSize:F,loop:B=!0}){let E=PD({position:0,lastActive:0}),C=B?K_({active:_,lastActive:E.current.lastActive,total:D.length,pageSize:F,pointer:E.current.position}):Q_({active:_,total:D.length,pageSize:F});return E.current.position=C,E.current.lastActive=_,J_({items:D,width:L2(),renderItem:u,active:_,position:C,pageSize:F}).join(`
42
+ `)}var j_=x(require("node:readline")),O_=require("node:async_hooks"),P_=x(M_());var J0=[];J0.push("SIGHUP","SIGINT","SIGTERM");if(process.platform!=="win32")J0.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")J0.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var I2=(D)=>!!D&&typeof D==="object"&&typeof D.removeListener==="function"&&typeof D.emit==="function"&&typeof D.reallyExit==="function"&&typeof D.listeners==="function"&&typeof D.kill==="function"&&typeof D.pid==="number"&&typeof D.on==="function",o3=Symbol.for("signal-exit emitter"),t3=globalThis,o9=Object.defineProperty.bind(Object);class W_{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(t3[o3])return t3[o3];o9(t3,o3,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(D,_){this.listeners[D].push(_)}removeListener(D,_){let u=this.listeners[D],F=u.indexOf(_);if(F===-1)return;if(F===0&&u.length===1)u.length=0;else u.splice(F,1)}emit(D,_,u){if(this.emitted[D])return!1;this.emitted[D]=!0;let F=!1;for(let B of this.listeners[D])F=B(_,u)===!0||F;if(D==="exit")F=this.emit("afterExit",_,u)||F;return F}}class D8{}var t9=(D)=>{return{onExit(_,u){return D.onExit(_,u)},load(){return D.load()},unload(){return D.unload()}}};class A_ extends D8{onExit(){return()=>{}}load(){}unload(){}}class V_ extends D8{#u=e3.platform==="win32"?"SIGINT":"SIGHUP";#_=new W_;#D;#E;#C;#B={};#F=!1;constructor(D){super();this.#D=D,this.#B={};for(let _ of J0)this.#B[_]=()=>{let u=this.#D.listeners(_),{count:F}=this.#_,B=D;if(typeof B.__signal_exit_emitter__==="object"&&typeof B.__signal_exit_emitter__.count==="number")F+=B.__signal_exit_emitter__.count;if(u.length===F){this.unload();let E=this.#_.emit("exit",null,_),C=_==="SIGHUP"?this.#u:_;if(!E)D.kill(D.pid,C)}};this.#C=D.reallyExit,this.#E=D.emit}onExit(D,_){if(!I2(this.#D))return()=>{};if(this.#F===!1)this.load();let u=_?.alwaysLast?"afterExit":"exit";return this.#_.on(u,D),()=>{if(this.#_.removeListener(u,D),this.#_.listeners.exit.length===0&&this.#_.listeners.afterExit.length===0)this.unload()}}load(){if(this.#F)return;this.#F=!0,this.#_.count+=1;for(let D of J0)try{let _=this.#B[D];if(_)this.#D.on(D,_)}catch(_){}this.#D.emit=(D,..._)=>{return this.#G(D,..._)},this.#D.reallyExit=(D)=>{return this.#$(D)}}unload(){if(!this.#F)return;this.#F=!1,J0.forEach((D)=>{let _=this.#B[D];if(!_)throw new Error("Listener not defined for signal: "+D);try{this.#D.removeListener(D,_)}catch(u){}}),this.#D.emit=this.#E,this.#D.reallyExit=this.#C,this.#_.count-=1}#$(D){if(!I2(this.#D))return 0;return this.#D.exitCode=D||0,this.#_.emit("exit",this.#D.exitCode,null),this.#C.call(this.#D,this.#D.exitCode)}#G(D,..._){let u=this.#E;if(D==="exit"&&I2(this.#D)){if(typeof _[0]==="number")this.#D.exitCode=_[0];let F=u.call(this.#D,D,..._);return this.#_.emit("exit",this.#D.exitCode,null),F}else return u.call(this.#D,D,..._)}}var e3=globalThis.process,{onExit:L_,load:_E,unload:uE}=t9(I2(e3)?new V_(e3):new A_);var T_=require("node:util"),rD=x(u8());var R_=(D)=>D.split(`
43
+ `).length,e9=(D)=>D.split(`
44
+ `).pop()??"";function N_(D){return D>0?rD.default.cursorDown(D):""}class N2{rl;height=0;extraLinesUnderPrompt=0;cursorPos;constructor(D){this.rl=D,this.rl=D,this.cursorPos=D.getCursorPos()}write(D){this.rl.output.unmute(),this.rl.output.write(D),this.rl.output.mute()}render(D,_=""){let u=e9(D),F=T_.stripVTControlCharacters(u),B=F;if(this.rl.line.length>0)B=B.slice(0,-this.rl.line.length);this.rl.setPrompt(B),this.cursorPos=this.rl.getCursorPos();let E=L2();if(D=p0(D,E),_=p0(_,E),F.length%E===0)D+=`
45
45
  `;let C=D+(_?`
46
- `+_:""),q=Math.floor(F.length/E)-this.cursorPos.rows+(_?F_(_):0);if(q>0)C+=aD.default.cursorUp(q);C+=aD.default.cursorTo(this.cursorPos.cols),this.write(B_(this.extraLinesUnderPrompt)+aD.default.eraseLines(this.height)+C),this.extraLinesUnderPrompt=q,this.height=F_(C)}checkCursorPos(){let D=this.rl.getCursorPos();if(D.cols!==this.cursorPos.cols)this.write(aD.default.cursorTo(D.cols)),this.cursorPos=D}done({clearContent:D}){this.rl.setPrompt("");let _=B_(this.extraLinesUnderPrompt);_+=D?aD.default.eraseLines(this.height):`
47
- `,_+=aD.default.cursorShow,this.write(_),this.rl.close()}}class d3 extends Promise{static withResolver(){let D,_;return{promise:new Promise((F,B)=>{D=F,_=B}),resolve:D,reject:_}}}function V7(){let D=Error.prepareStackTrace;try{let _=[];return Error.prepareStackTrace=(u,F)=>{let B=F.slice(1);return _=B,B},new Error().stack,_}finally{Error.prepareStackTrace=D}}function vD(D){let u=V7()[1]?.getFileName?.();return(B,E={})=>{let{input:C=process.stdin,signal:$}=E,q=new Set,X=new C_.default;X.pipe(E.output??process.stdout);let G=E_.createInterface({terminal:!0,input:C,output:X}),Z=new M2(G),{promise:J,resolve:K,reject:Q}=d3.withResolver(),M=()=>Q(new V3);if($){let V=()=>Q(new A3({cause:$.reason}));if($.aborted)return V(),Object.assign(J,{cancel:M});$.addEventListener("abort",V),q.add(()=>$.removeEventListener("abort",V))}q.add(__((V,L)=>{Q(new L3(`User force closed the prompt with ${V} ${L}`))}));let W=()=>Z.checkCursorPos();return G.input.on("keypress",W),q.add(()=>G.input.removeListener("keypress",W)),G1(G,(V)=>{let L=A7.bind(()=>$0.clearAll());return G.on("close",L),q.add(()=>G.removeListener("close",L)),V(()=>{try{let T=D(B,(v)=>{setImmediate(()=>K(v))});if(T===void 0)throw new Error(`Prompt functions must return a string.
48
- at ${u}`);let[S,j]=typeof T==="string"?[T]:T;Z.render(S,j),$0.run()}catch(T){Q(T)}}),Object.assign(J.then((T)=>{return $0.clearAll(),T},(T)=>{throw $0.clearAll(),T}).finally(()=>{q.forEach((T)=>T()),Z.done({clearContent:Boolean(E.clearPromptOnDone)}),X.end()}).then(()=>J),{cancel:M})})}}var $_=GD(v0(),1);class MD{separator=$_.default.dim(Array.from({length:15}).join(nD.line));type="separator";constructor(D){if(D)this.separator=D}static isSeparator(D){return Boolean(D&&typeof D==="object"&&"type"in D&&D.type==="separator")}}function G_(D,_){let u=_!==!1;if(/^(y|yes)/i.test(D))u=!0;else if(/^(n|no)/i.test(D))u=!1;return u}function q_(D){return D?"Yes":"No"}var X0=vD((D,_)=>{let{transformer:u=q_}=D,[F,B]=n("idle"),[E,C]=n(""),$=HD(D.theme),q=yD({status:F,theme:$});kD((J,K)=>{if(iD(J)){let Q=G_(E,D.default);C(u(Q)),B("done"),_(Q)}else if(J.name==="tab"){let Q=q_(!G_(E,D.default));K.clearLine(0),K.write(Q),C(Q)}else C(K.line)});let X=E,G="";if(F==="done")X=$.style.answer(E);else G=` ${$.style.defaultAnswer(D.default===!1?"y/N":"Y/n")}`;let Z=$.style.message(D.message,F);return`${q} ${Z}${G} ${X}`});var L7={validationFailureMode:"keep"},L0=vD((D,_)=>{let{required:u,validate:F=()=>!0}=D,B=HD(L7,D.theme),[E,C]=n("idle"),[$="",q]=n(D.default),[X,G]=n(),[Z,J]=n(""),K=yD({status:E,theme:B});kD(async(L,T)=>{if(E!=="idle")return;if(iD(L)){let S=Z||$;C("loading");let j=u&&!S?"You must provide a value":await F(S);if(j===!0)J(S),C("done"),_(S);else{if(B.validationFailureMode==="clear")J("");else T.write(Z);G(j||"You must provide a valid value"),C("idle")}}else if(Z2(L)&&!Z)q(void 0);else if(L.name==="tab"&&!Z)q(void 0),T.clearLine(0),T.write($),J($);else J(T.line),G(void 0)});let Q=B.style.message(D.message,E),M=Z;if(typeof D.transformer==="function")M=D.transformer(Z,{isFinal:E==="done"});else if(E==="done")M=B.style.answer(Z);let W;if($&&E!=="done"&&!Z)W=B.style.defaultAnswer($);let V="";if(X)V=B.style.error(X);return[[K,Q,W,M].filter((L)=>L!==void 0).join(" "),V]});var W2=GD(v0(),1);var I7={icon:{cursor:nD.pointer},style:{disabled:(D)=>W2.default.dim(`- ${D}`),searchTerm:(D)=>W2.default.cyan(D),description:(D)=>W2.default.cyan(D)},helpMode:"auto"};function g3(D){return!MD.isSeparator(D)&&!D.disabled}function R7(D){return D.map((_)=>{if(MD.isSeparator(_))return _;if(typeof _==="string")return{value:_,name:_,short:_,disabled:!1};let u=_.name??String(_.value);return{value:_.value,name:u,description:_.description,short:_.short??u,disabled:_.disabled??!1}})}var f3=vD((D,_)=>{let{pageSize:u=7,validate:F=()=>!0}=D,B=HD(I7,D.theme),E=jD(!0),[C,$]=n("loading"),[q,X]=n(""),[G,Z]=n([]),[J,K]=n(),Q=yD({status:C,theme:B}),M=G0(()=>{let A=G.findIndex(g3),z=G.findLastIndex(g3);return{first:A,last:z}},[G]),[W=M.first,V]=n();SD(()=>{let A=new AbortController;return $("loading"),K(void 0),(async()=>{try{let P=await D.source(q||void 0,{signal:A.signal});if(!A.signal.aborted)V(void 0),K(void 0),Z(R7(P)),$("idle")}catch(P){if(!A.signal.aborted&&P instanceof Error)K(P.message)}})(),()=>{A.abort()}},[q]);let L=G[W];kD(async(A,z)=>{if(iD(A))if(L){$("loading");let P=await F(L.value);if($("idle"),P===!0)$("done"),_(L.value);else if(L.name===q)K(P||"You must provide a valid value");else z.write(L.name),X(L.name)}else z.write(q);else if(A.name==="tab"&&L)z.clearLine(0),z.write(L.name),X(L.name);else if(C!=="loading"&&(A.name==="up"||A.name==="down")){if(z.clearLine(0),A.name==="up"&&W!==M.first||A.name==="down"&&W!==M.last){let P=A.name==="up"?-1:1,c=W;do c=(c+P+G.length)%G.length;while(!g3(G[c]));V(c)}}else X(z.line)});let T=B.style.message(D.message,C);if(W>0)E.current=!1;let S="";if(G.length>1&&(B.helpMode==="always"||B.helpMode==="auto"&&E.current))S=G.length>u?`
46
+ `+_:""),q=Math.floor(F.length/E)-this.cursorPos.rows+(_?R_(_):0);if(q>0)C+=rD.default.cursorUp(q);C+=rD.default.cursorTo(this.cursorPos.cols),this.write(N_(this.extraLinesUnderPrompt)+rD.default.eraseLines(this.height)+C),this.extraLinesUnderPrompt=q,this.height=R_(C)}checkCursorPos(){let D=this.rl.getCursorPos();if(D.cols!==this.cursorPos.cols)this.write(rD.default.cursorTo(D.cols)),this.cursorPos=D}done({clearContent:D}){this.rl.setPrompt("");let _=N_(this.extraLinesUnderPrompt);_+=D?rD.default.eraseLines(this.height):`
47
+ `,_+=rD.default.cursorShow,this.write(_),this.rl.close()}}class F8 extends Promise{static withResolver(){let D,_;return{promise:new Promise((F,B)=>{D=F,_=B}),resolve:D,reject:_}}}function D7(){let D=Error.prepareStackTrace;try{let _=[];return Error.prepareStackTrace=(u,F)=>{let B=F.slice(1);return _=B,B},new Error().stack,_}finally{Error.prepareStackTrace=D}}function hD(D){let u=D7()[1]?.getFileName?.();return(B,E={})=>{let{input:C=process.stdin,signal:$}=E,q=new Set,X=new P_.default;X.pipe(E.output??process.stdout);let G=j_.createInterface({terminal:!0,input:C,output:X}),Z=new N2(G),{promise:J,resolve:K,reject:Q}=F8.withResolver(),M=()=>Q(new v3);if($){let V=()=>Q(new k3({cause:$.reason}));if($.aborted)return V(),Object.assign(J,{cancel:M});$.addEventListener("abort",V),q.add(()=>$.removeEventListener("abort",V))}q.add(L_((V,L)=>{Q(new b3(`User force closed the prompt with ${V} ${L}`))}));let W=()=>Z.checkCursorPos();return G.input.on("keypress",W),q.add(()=>G.input.removeListener("keypress",W)),z1(G,(V)=>{let L=O_.AsyncResource.bind(()=>X0.clearAll());return G.on("close",L),q.add(()=>G.removeListener("close",L)),V(()=>{try{let T=D(B,(v)=>{setImmediate(()=>K(v))});if(T===void 0)throw new Error(`Prompt functions must return a string.
48
+ at ${u}`);let[S,j]=typeof T==="string"?[T]:T;Z.render(S,j),X0.run()}catch(T){Q(T)}}),Object.assign(J.then((T)=>{return X0.clearAll(),T},(T)=>{throw X0.clearAll(),T}).finally(()=>{q.forEach((T)=>T()),Z.done({clearContent:Boolean(E.clearPromptOnDone)}),X.end()}).then(()=>J),{cancel:M})})}}var z_=x(g0());class VD{separator=z_.default.dim(Array.from({length:15}).join(sD.line));type="separator";constructor(D){if(D)this.separator=D}static isSeparator(D){return Boolean(D&&typeof D==="object"&&"type"in D&&D.type==="separator")}}function Y_(D,_){let u=_!==!1;if(/^(y|yes)/i.test(D))u=!0;else if(/^(n|no)/i.test(D))u=!1;return u}function w_(D){return D?"Yes":"No"}var Q0=hD((D,_)=>{let{transformer:u=w_}=D,[F,B]=n("idle"),[E,C]=n(""),$=AD(D.theme),q=vD({status:F,theme:$});bD((J,K)=>{if(aD(J)){let Q=Y_(E,D.default);C(u(Q)),B("done"),_(Q)}else if(J.name==="tab"){let Q=w_(!Y_(E,D.default));K.clearLine(0),K.write(Q),C(Q)}else C(K.line)});let X=E,G="";if(F==="done")X=$.style.answer(E);else G=` ${$.style.defaultAnswer(D.default===!1?"y/N":"Y/n")}`;let Z=$.style.message(D.message,F);return`${q} ${Z}${G} ${X}`});var _7={validationFailureMode:"keep"},T0=hD((D,_)=>{let{required:u,validate:F=()=>!0}=D,B=AD(_7,D.theme),[E,C]=n("idle"),[$="",q]=n(D.default),[X,G]=n(),[Z,J]=n(""),K=vD({status:E,theme:B});bD(async(L,T)=>{if(E!=="idle")return;if(aD(L)){let S=Z||$;C("loading");let j=u&&!S?"You must provide a value":await F(S);if(j===!0)J(S),C("done"),_(S);else{if(B.validationFailureMode==="clear")J("");else T.write(Z);G(j||"You must provide a valid value"),C("idle")}}else if(M2(L)&&!Z)q(void 0);else if(L.name==="tab"&&!Z)q(void 0),T.clearLine(0),T.write($),J($);else J(T.line),G(void 0)});let Q=B.style.message(D.message,E),M=Z;if(typeof D.transformer==="function")M=D.transformer(Z,{isFinal:E==="done"});else if(E==="done")M=B.style.answer(Z);let W;if($&&E!=="done"&&!Z)W=B.style.defaultAnswer($);let V="";if(X)V=B.style.error(X);return[[K,Q,W,M].filter((L)=>L!==void 0).join(" "),V]});var T2=x(g0());var u7={icon:{cursor:sD.pointer},style:{disabled:(D)=>T2.default.dim(`- ${D}`),searchTerm:(D)=>T2.default.cyan(D),description:(D)=>T2.default.cyan(D)},helpMode:"auto"};function B8(D){return!VD.isSeparator(D)&&!D.disabled}function F7(D){return D.map((_)=>{if(VD.isSeparator(_))return _;if(typeof _==="string")return{value:_,name:_,short:_,disabled:!1};let u=_.name??String(_.value);return{value:_.value,name:u,description:_.description,short:_.short??u,disabled:_.disabled??!1}})}var E8=hD((D,_)=>{let{pageSize:u=7,validate:F=()=>!0}=D,B=AD(u7,D.theme),E=PD(!0),[C,$]=n("loading"),[q,X]=n(""),[G,Z]=n([]),[J,K]=n(),Q=vD({status:C,theme:B}),M=Z0(()=>{let A=G.findIndex(B8),z=G.findLastIndex(B8);return{first:A,last:z}},[G]),[W=M.first,V]=n();kD(()=>{let A=new AbortController;return $("loading"),K(void 0),(async()=>{try{let P=await D.source(q||void 0,{signal:A.signal});if(!A.signal.aborted)V(void 0),K(void 0),Z(F7(P)),$("idle")}catch(P){if(!A.signal.aborted&&P instanceof Error)K(P.message)}})(),()=>{A.abort()}},[q]);let L=G[W];bD(async(A,z)=>{if(aD(A))if(L){$("loading");let P=await F(L.value);if($("idle"),P===!0)$("done"),_(L.value);else if(L.name===q)K(P||"You must provide a valid value");else z.write(L.name),X(L.name)}else z.write(q);else if(A.name==="tab"&&L)z.clearLine(0),z.write(L.name),X(L.name);else if(C!=="loading"&&(A.name==="up"||A.name==="down")){if(z.clearLine(0),A.name==="up"&&W!==M.first||A.name==="down"&&W!==M.last){let P=A.name==="up"?-1:1,c=W;do c=(c+P+G.length)%G.length;while(!B8(G[c]));V(c)}}else X(z.line)});let T=B.style.message(D.message,C);if(W>0)E.current=!1;let S="";if(G.length>1&&(B.helpMode==="always"||B.helpMode==="auto"&&E.current))S=G.length>u?`
49
49
  ${B.style.help("(Use arrow keys to reveal more choices)")}`:`
50
- ${B.style.help("(Use arrow keys)")}`;let j=d0({items:G,active:W,renderItem({item:A,isActive:z}){if(MD.isSeparator(A))return` ${A.separator}`;if(A.disabled){let t=typeof A.disabled==="string"?A.disabled:"(disabled)";return B.style.disabled(`${A.name} ${t}`)}let P=z?B.style.highlight:(t)=>t,c=z?B.icon.cursor:" ";return P(`${c} ${A.name}`)},pageSize:u,loop:!1}),v;if(J)v=B.style.error(J);else if(G.length===0&&q!==""&&C==="idle")v=B.style.error("No results found");let DD;if(C==="done"&&L){let A=L.short;return`${Q} ${T} ${B.style.answer(A)}`}else DD=B.style.searchTerm(q);let _D=L?.description?`
51
- ${B.style.description(L.description)}`:"";return[[Q,T,DD].filter(Boolean).join(" "),`${v??j}${S}${_D}`]});var c3=GD(v0(),1);var X_=GD(m3(),1);var N7={icon:{cursor:nD.pointer},style:{disabled:(D)=>c3.default.dim(`- ${D}`),description:(D)=>c3.default.cyan(D)},helpMode:"auto"};function I0(D){return!MD.isSeparator(D)&&!D.disabled}function T7(D){return D.map((_)=>{if(MD.isSeparator(_))return _;if(typeof _==="string")return{value:_,name:_,short:_,disabled:!1};let u=_.name??String(_.value);return{value:_.value,name:u,description:_.description,short:_.short??u,disabled:_.disabled??!1}})}var qD=vD((D,_)=>{let{loop:u=!0,pageSize:F=7}=D,B=jD(!0),E=HD(N7,D.theme),[C,$]=n("idle"),q=yD({status:C,theme:E}),X=jD(),G=G0(()=>T7(D.choices),[D.choices]),Z=G0(()=>{let j=G.findIndex(I0),v=G.findLastIndex(I0);if(j===-1)throw new k0("[select prompt] No selectable choices. All choices are disabled.");return{first:j,last:v}},[G]),J=G0(()=>{if(!("default"in D))return-1;return G.findIndex((j)=>I0(j)&&j.value===D.default)},[D.default,G]),[K,Q]=n(J===-1?Z.first:J),M=G[K];kD((j,v)=>{if(clearTimeout(X.current),iD(j))$("done"),_(M.value);else if(X2(j)||W3(j)){if(v.clearLine(0),u||X2(j)&&K!==Z.first||W3(j)&&K!==Z.last){let DD=X2(j)?-1:1,_D=K;do _D=(_D+DD+G.length)%G.length;while(!I0(G[_D]));Q(_D)}}else if(C1(j)){v.clearLine(0);let DD=Number(j.name)-1,_D=G[DD];if(_D!=null&&I0(_D))Q(DD)}else if(Z2(j))v.clearLine(0);else{let DD=v.line.toLowerCase(),_D=G.findIndex((A)=>{if(MD.isSeparator(A)||!I0(A))return!1;return A.name.toLowerCase().startsWith(DD)});if(_D!==-1)Q(_D);X.current=setTimeout(()=>{v.clearLine(0)},700)}}),SD(()=>()=>{clearTimeout(X.current)},[]);let W=E.style.message(D.message,C),V="",L="";if(E.helpMode==="always"||E.helpMode==="auto"&&B.current)if(B.current=!1,G.length>F)L=`
52
- ${E.style.help("(Use arrow keys to reveal more choices)")}`;else V=E.style.help("(Use arrow keys)");let T=d0({items:G,active:K,renderItem({item:j,isActive:v}){if(MD.isSeparator(j))return` ${j.separator}`;if(j.disabled){let A=typeof j.disabled==="string"?j.disabled:"(disabled)";return E.style.disabled(`${j.name} ${A}`)}let DD=v?E.style.highlight:(A)=>A,_D=v?E.icon.cursor:" ";return DD(`${_D} ${j.name}`)},pageSize:F,loop:u});if(C==="done")return`${q} ${W} ${E.style.answer(M.short)}`;let S=M.description?`
50
+ ${B.style.help("(Use arrow keys)")}`;let j=l0({items:G,active:W,renderItem({item:A,isActive:z}){if(VD.isSeparator(A))return` ${A.separator}`;if(A.disabled){let t=typeof A.disabled==="string"?A.disabled:"(disabled)";return B.style.disabled(`${A.name} ${t}`)}let P=z?B.style.highlight:(t)=>t,c=z?B.icon.cursor:" ";return P(`${c} ${A.name}`)},pageSize:u,loop:!1}),v;if(J)v=B.style.error(J);else if(G.length===0&&q!==""&&C==="idle")v=B.style.error("No results found");let DD;if(C==="done"&&L){let A=L.short;return`${Q} ${T} ${B.style.answer(A)}`}else DD=B.style.searchTerm(q);let _D=L?.description?`
51
+ ${B.style.description(L.description)}`:"";return[[Q,T,DD].filter(Boolean).join(" "),`${v??j}${S}${_D}`]});var C8=x(g0());var x_=x(u8());var B7={icon:{cursor:sD.pointer},style:{disabled:(D)=>C8.default.dim(`- ${D}`),description:(D)=>C8.default.cyan(D)},helpMode:"auto"};function j0(D){return!VD.isSeparator(D)&&!D.disabled}function E7(D){return D.map((_)=>{if(VD.isSeparator(_))return _;if(typeof _==="string")return{value:_,name:_,short:_,disabled:!1};let u=_.name??String(_.value);return{value:_.value,name:u,description:_.description,short:_.short??u,disabled:_.disabled??!1}})}var GD=hD((D,_)=>{let{loop:u=!0,pageSize:F=7}=D,B=PD(!0),E=AD(B7,D.theme),[C,$]=n("idle"),q=vD({status:C,theme:E}),X=PD(),G=Z0(()=>E7(D.choices),[D.choices]),Z=Z0(()=>{let j=G.findIndex(j0),v=G.findLastIndex(j0);if(j===-1)throw new d0("[select prompt] No selectable choices. All choices are disabled.");return{first:j,last:v}},[G]),J=Z0(()=>{if(!("default"in D))return-1;return G.findIndex((j)=>j0(j)&&j.value===D.default)},[D.default,G]),[K,Q]=n(J===-1?Z.first:J),M=G[K];bD((j,v)=>{if(clearTimeout(X.current),aD(j))$("done"),_(M.value);else if(H2(j)||y3(j)){if(v.clearLine(0),u||H2(j)&&K!==Z.first||y3(j)&&K!==Z.last){let DD=H2(j)?-1:1,_D=K;do _D=(_D+DD+G.length)%G.length;while(!j0(G[_D]));Q(_D)}}else if(O1(j)){v.clearLine(0);let DD=Number(j.name)-1,_D=G[DD];if(_D!=null&&j0(_D))Q(DD)}else if(M2(j))v.clearLine(0);else{let DD=v.line.toLowerCase(),_D=G.findIndex((A)=>{if(VD.isSeparator(A)||!j0(A))return!1;return A.name.toLowerCase().startsWith(DD)});if(_D!==-1)Q(_D);X.current=setTimeout(()=>{v.clearLine(0)},700)}}),kD(()=>()=>{clearTimeout(X.current)},[]);let W=E.style.message(D.message,C),V="",L="";if(E.helpMode==="always"||E.helpMode==="auto"&&B.current)if(B.current=!1,G.length>F)L=`
52
+ ${E.style.help("(Use arrow keys to reveal more choices)")}`;else V=E.style.help("(Use arrow keys)");let T=l0({items:G,active:K,renderItem({item:j,isActive:v}){if(VD.isSeparator(j))return` ${j.separator}`;if(j.disabled){let A=typeof j.disabled==="string"?j.disabled:"(disabled)";return E.style.disabled(`${j.name} ${A}`)}let DD=v?E.style.highlight:(A)=>A,_D=v?E.icon.cursor:" ";return DD(`${_D} ${j.name}`)},pageSize:F,loop:u});if(C==="done")return`${q} ${W} ${E.style.answer(M.short)}`;let S=M.description?`
53
53
  ${E.style.description(M.description)}`:"";return`${[q,W,V].filter(Boolean).join(" ")}
54
- ${T}${L}${S}${X_.default.cursorHide}`});var A2={name:"@tobylai/qmcli",version:"0.0.7",description:"A quick minecraft launcher command-line interface",main:"dist/cli.js",type:"module",scripts:{dev:"npx tsx cli.ts",build:"bun bun-build.ts cjs",prepublishOnly:"npm run build"},keywords:["minecraft","cli"],author:"tobylai-toby",license:"MIT",dependencies:{"@inquirer/prompts":"^7.3.1",arch:"^3.0.0",chalk:"^5.4.1","cli-progress":"^3.12.0",commander:"^13.1.0",configstore:"^7.0.0",jssha:"^3.3.1","zip-lib":"^1.0.5"},devDependencies:{"@types/bun":"latest","@types/cli-progress":"^3.11.6","@types/configstore":"^6.0.2","@types/node":"^22.13.0",tsx:"^4.19.2"},bin:{qmcli:"dist/qmcli.cjs"},publishConfig:{registry:"https://registry.npmjs.org/",access:"public"},peerDependencies:{typescript:"^5.0.0"}};var l0=GD(L_(),1);import p0 from"node:path";import l7 from"node:os";import b7 from"os";import T2 from"path";var rD=b7.homedir(),{env:J0}=process,I_=J0.XDG_DATA_HOME||(rD?T2.join(rD,".local","share"):void 0),N2=J0.XDG_CONFIG_HOME||(rD?T2.join(rD,".config"):void 0),K$=J0.XDG_STATE_HOME||(rD?T2.join(rD,".local","state"):void 0),U$=J0.XDG_CACHE_HOME||(rD?T2.join(rD,".cache"):void 0),H$=J0.XDG_RUNTIME_DIR||void 0,h7=(J0.XDG_DATA_DIRS||"/usr/local/share/:/usr/share/").split(":");if(I_)h7.unshift(I_);var m7=(J0.XDG_CONFIG_DIRS||"/etc/xdg").split(":");if(N2)m7.unshift(N2);import c7 from"node:path";import k from"node:fs";import{promisify as CD}from"node:util";var bD=(D,_)=>{return function u(...F){return D.apply(void 0,F).catch(_)}},OD=(D,_)=>{return function u(...F){try{return D.apply(void 0,F)}catch(B){return _(B)}}};import R_ from"node:process";var N_=R_.getuid?!R_.getuid():!1,T_=1e4,ZD=()=>{return};var f0={isChangeErrorOk:(D)=>{if(!f0.isNodeError(D))return!1;let{code:_}=D;if(_==="ENOSYS")return!0;if(!N_&&(_==="EINVAL"||_==="EPERM"))return!0;return!1},isNodeError:(D)=>{return D instanceof Error},isRetriableError:(D)=>{if(!f0.isNodeError(D))return!1;let{code:_}=D;if(_==="EMFILE"||_==="ENFILE"||_==="EAGAIN"||_==="EBUSY"||_==="EACCESS"||_==="EACCES"||_==="EACCS"||_==="EPERM")return!0;return!1},onChangeError:(D)=>{if(!f0.isNodeError(D))throw D;if(f0.isChangeErrorOk(D))return;throw D}},e=f0;class j_{constructor(){this.interval=25,this.intervalId=void 0,this.limit=T_,this.queueActive=new Set,this.queueWaiting=new Set,this.init=()=>{if(this.intervalId)return;this.intervalId=setInterval(this.tick,this.interval)},this.reset=()=>{if(!this.intervalId)return;clearInterval(this.intervalId),delete this.intervalId},this.add=(D)=>{if(this.queueWaiting.add(D),this.queueActive.size<this.limit/2)this.tick();else this.init()},this.remove=(D)=>{this.queueWaiting.delete(D),this.queueActive.delete(D)},this.schedule=()=>{return new Promise((D)=>{let _=()=>this.remove(u),u=()=>D(_);this.add(u)})},this.tick=()=>{if(this.queueActive.size>=this.limit)return;if(!this.queueWaiting.size)return this.reset();for(let D of this.queueWaiting){if(this.queueActive.size>=this.limit)break;this.queueWaiting.delete(D),this.queueActive.add(D),D()}}}}var O_=new j_;var hD=(D,_)=>{return function u(F){return function B(...E){return O_.schedule().then((C)=>{let $=(X)=>{return C(),X},q=(X)=>{if(C(),Date.now()>=F)throw X;if(_(X)){let G=Math.round(100*Math.random());return new Promise((J)=>setTimeout(J,G)).then(()=>B.apply(void 0,E))}throw X};return D.apply(void 0,E).then($,q)})}}},mD=(D,_)=>{return function u(F){return function B(...E){try{return D.apply(void 0,E)}catch(C){if(Date.now()>F)throw C;if(_(C))return B.apply(void 0,E);throw C}}}};var d7={attempt:{chmod:bD(CD(k.chmod),e.onChangeError),chown:bD(CD(k.chown),e.onChangeError),close:bD(CD(k.close),ZD),fsync:bD(CD(k.fsync),ZD),mkdir:bD(CD(k.mkdir),ZD),realpath:bD(CD(k.realpath),ZD),stat:bD(CD(k.stat),ZD),unlink:bD(CD(k.unlink),ZD),chmodSync:OD(k.chmodSync,e.onChangeError),chownSync:OD(k.chownSync,e.onChangeError),closeSync:OD(k.closeSync,ZD),existsSync:OD(k.existsSync,ZD),fsyncSync:OD(k.fsync,ZD),mkdirSync:OD(k.mkdirSync,ZD),realpathSync:OD(k.realpathSync,ZD),statSync:OD(k.statSync,ZD),unlinkSync:OD(k.unlinkSync,ZD)},retry:{close:hD(CD(k.close),e.isRetriableError),fsync:hD(CD(k.fsync),e.isRetriableError),open:hD(CD(k.open),e.isRetriableError),readFile:hD(CD(k.readFile),e.isRetriableError),rename:hD(CD(k.rename),e.isRetriableError),stat:hD(CD(k.stat),e.isRetriableError),write:hD(CD(k.write),e.isRetriableError),writeFile:hD(CD(k.writeFile),e.isRetriableError),closeSync:mD(k.closeSync,e.isRetriableError),fsyncSync:mD(k.fsyncSync,e.isRetriableError),openSync:mD(k.openSync,e.isRetriableError),readFileSync:mD(k.readFileSync,e.isRetriableError),renameSync:mD(k.renameSync,e.isRetriableError),statSync:mD(k.statSync,e.isRetriableError),writeSync:mD(k.writeSync,e.isRetriableError),writeFileSync:mD(k.writeFileSync,e.isRetriableError)}},FD=d7;import x_ from"node:os";import a3 from"node:process";var P_="utf8",s3=438,z_=511;var Y_={},w_=x_.userInfo().uid,S_=x_.userInfo().gid;var y_=1000,k_=!!a3.getuid,v$=a3.getuid?!a3.getuid():!1,r3=128;var v_=(D)=>{return D instanceof Error&&"code"in D};var o3=(D)=>{return typeof D==="string"},j2=(D)=>{return D===void 0};import f7 from"node:path";import N0 from"node:process";import b_ from"node:process";var h_=b_.platform==="linux",O2=b_.platform==="win32";var t3=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];if(!O2)t3.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(h_)t3.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED");var m_=t3;class d_{constructor(){this.callbacks=new Set,this.exited=!1,this.exit=(D)=>{if(this.exited)return;this.exited=!0;for(let _ of this.callbacks)_();if(D)if(O2&&(D!=="SIGINT"&&D!=="SIGTERM"&&D!=="SIGKILL"))N0.kill(N0.pid,"SIGTERM");else N0.kill(N0.pid,D)},this.hook=()=>{N0.once("exit",()=>this.exit());for(let D of m_)try{N0.once(D,()=>this.exit(D))}catch{}},this.register=(D)=>{return this.callbacks.add(D),()=>{this.callbacks.delete(D)}},this.hook()}}var g_=new d_;var g7=g_.register,f_=g7;var JD={store:{},create:(D)=>{let _=`000000${Math.floor(Math.random()*16777215).toString(16)}`.slice(-6),u=Date.now().toString().slice(-10),F="tmp-",B=`.tmp-${u}${_}`;return`${D}${B}`},get:(D,_,u=!0)=>{let F=JD.truncate(_(D));if(F in JD.store)return JD.get(D,_,u);return JD.store[F]=u,[F,()=>delete JD.store[F]]},purge:(D)=>{if(!JD.store[D])return;delete JD.store[D],FD.attempt.unlink(D)},purgeSync:(D)=>{if(!JD.store[D])return;delete JD.store[D],FD.attempt.unlinkSync(D)},purgeSyncAll:()=>{for(let D in JD.store)JD.purgeSync(D)},truncate:(D)=>{let _=f7.basename(D);if(_.length<=r3)return D;let u=/^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(_);if(!u)return D;let F=_.length-r3;return`${D.slice(0,-_.length)}${u[1]}${u[2].slice(0,-F)}${u[3]}`}};f_(JD.purgeSyncAll);var c0=JD;function x2(D,_,u=Y_){if(o3(u))return x2(D,_,{encoding:u});let F=Date.now()+((u.timeout??y_)||-1),B=null,E=null,C=null;try{let $=FD.attempt.realpathSync(D),q=!!$;D=$||D,[E,B]=c0.get(D,u.tmpCreate||c0.create,u.tmpPurge!==!1);let X=k_&&j2(u.chown),G=j2(u.mode);if(q&&(X||G)){let Z=FD.attempt.statSync(D);if(Z){if(u={...u},X)u.chown={uid:Z.uid,gid:Z.gid};if(G)u.mode=Z.mode}}if(!q){let Z=c7.dirname(D);FD.attempt.mkdirSync(Z,{mode:z_,recursive:!0})}if(C=FD.retry.openSync(F)(E,"w",u.mode||s3),u.tmpCreated)u.tmpCreated(E);if(o3(_))FD.retry.writeSync(F)(C,_,0,u.encoding||P_);else if(!j2(_))FD.retry.writeSync(F)(C,_,0,_.length,0);if(u.fsync!==!1)if(u.fsyncWait!==!1)FD.retry.fsyncSync(F)(C);else FD.attempt.fsync(C);if(FD.retry.closeSync(F)(C),C=null,u.chown&&(u.chown.uid!==w_||u.chown.gid!==S_))FD.attempt.chownSync(E,u.chown.uid,u.chown.gid);if(u.mode&&u.mode!==s3)FD.attempt.chmodSync(E,u.mode);try{FD.retry.renameSync(F)(E,D)}catch(Z){if(!v_(Z))throw Z;if(Z.code!=="ENAMETOOLONG")throw Z;FD.retry.renameSync(F)(E,c0.truncate(D))}B(),E=null}finally{if(C)FD.attempt.closeSync(C);if(E)c0.purge(E)}}var Q0=(D)=>{let _=typeof D;return D!==null&&(_==="object"||_==="function")};var e3=new Set(["__proto__","prototype","constructor"]),p7=new Set("0123456789");function P2(D){let _=[],u="",F="start",B=!1;for(let E of D)switch(E){case"\\":{if(F==="index")throw new Error("Invalid character in an index");if(F==="indexEnd")throw new Error("Invalid character after an index");if(B)u+=E;F="property",B=!B;break}case".":{if(F==="index")throw new Error("Invalid character in an index");if(F==="indexEnd"){F="property";break}if(B){B=!1,u+=E;break}if(e3.has(u))return[];_.push(u),u="",F="property";break}case"[":{if(F==="index")throw new Error("Invalid character in an index");if(F==="indexEnd"){F="index";break}if(B){B=!1,u+=E;break}if(F==="property"){if(e3.has(u))return[];_.push(u),u=""}F="index";break}case"]":{if(F==="index"){_.push(Number.parseInt(u,10)),u="",F="indexEnd";break}if(F==="indexEnd")throw new Error("Invalid character after an index")}default:{if(F==="index"&&!p7.has(E))throw new Error("Invalid character in an index");if(F==="indexEnd")throw new Error("Invalid character after an index");if(F==="start")F="property";if(B)B=!1,u+="\\";u+=E}}if(B)u+="\\";switch(F){case"property":{if(e3.has(u))return[];_.push(u);break}case"index":throw new Error("Index was not closed");case"start":{_.push("");break}}return _}function D8(D,_){if(typeof _!=="number"&&Array.isArray(D)){let u=Number.parseInt(_,10);return Number.isInteger(u)&&D[u]===D[_]}return!1}function c_(D,_){if(D8(D,_))throw new Error("Cannot use string index")}function p_(D,_,u){if(!Q0(D)||typeof _!=="string")return u===void 0?D:u;let F=P2(_);if(F.length===0)return u;for(let B=0;B<F.length;B++){let E=F[B];if(D8(D,E))D=B===F.length-1?void 0:null;else D=D[E];if(D===void 0||D===null){if(B!==F.length-1)return u;break}}return D===void 0?u:D}function _8(D,_,u){if(!Q0(D)||typeof _!=="string")return D;let F=D,B=P2(_);for(let E=0;E<B.length;E++){let C=B[E];if(c_(D,C),E===B.length-1)D[C]=u;else if(!Q0(D[C]))D[C]=typeof B[E+1]==="number"?[]:{};D=D[C]}return F}function l_(D,_){if(!Q0(D)||typeof _!=="string")return!1;let u=P2(_);for(let F=0;F<u.length;F++){let B=u[F];if(c_(D,B),F===u.length-1)return delete D[B],!0;if(D=D[B],!Q0(D))return!1}}function i_(D,_){if(!Q0(D)||typeof _!=="string")return!1;let u=P2(_);if(u.length===0)return!1;for(let F of u){if(!Q0(D)||!(F in D)||D8(D,F))return!1;D=D[F]}return!0}function i7(D,_){let u=_?p0.join(D,"config.json"):p0.join("configstore",`${D}.json`),F=N2??l0.default.mkdtempSync(l0.default.realpathSync(l7.tmpdir())+p0.sep);return p0.join(F,u)}var n_="You don't have access to this file.",n7={mode:448,recursive:!0},a_={mode:384};class z2{constructor(D,_,u={}){if(this._path=u.configPath??i7(D,u.globalConfigPath),_)this.all={..._,...this.all}}get all(){try{return JSON.parse(l0.default.readFileSync(this._path,"utf8"))}catch(D){if(D.code==="ENOENT")return{};if(D.code==="EACCES")D.message=`${D.message}
55
- ${n_}
56
- `;if(D.name==="SyntaxError")return x2(this._path,"",a_),{};throw D}}set all(D){try{l0.default.mkdirSync(p0.dirname(this._path),n7),x2(this._path,JSON.stringify(D,void 0,"\t"),a_)}catch(_){if(_.code==="EACCES")_.message=`${_.message}
57
- ${n_}
58
- `;throw _}}get size(){return Object.keys(this.all||{}).length}get(D){return p_(this.all,D)}set(D,_){let u=this.all;if(arguments.length===1)for(let F of Object.keys(D))_8(u,F,D[F]);else _8(u,D,_);this.all=u}has(D){return i_(this.all,D)}delete(D){let _=this.all;l_(_,D),this.all=_}clear(){this.all={}}get path(){return this._path}}var r=new z2(A2.name,{users:[],mirror:"official",paths:["~/.minecraft"],lang:"en"});var s_=(D=0)=>(_)=>`\x1B[${_+D}m`,r_=(D=0)=>(_)=>`\x1B[${38+D};5;${_}m`,o_=(D=0)=>(_,u,F)=>`\x1B[${38+D};2;${_};${u};${F}m`,l={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]}},IG=Object.keys(l.modifier),a7=Object.keys(l.color),s7=Object.keys(l.bgColor),RG=[...a7,...s7];function r7(){let D=new Map;for(let[_,u]of Object.entries(l)){for(let[F,B]of Object.entries(u))l[F]={open:`\x1B[${B[0]}m`,close:`\x1B[${B[1]}m`},u[F]=l[F],D.set(B[0],B[1]);Object.defineProperty(l,_,{value:u,enumerable:!1})}return Object.defineProperty(l,"codes",{value:D,enumerable:!1}),l.color.close="\x1B[39m",l.bgColor.close="\x1B[49m",l.color.ansi=s_(),l.color.ansi256=r_(),l.color.ansi16m=o_(),l.bgColor.ansi=s_(10),l.bgColor.ansi256=r_(10),l.bgColor.ansi16m=o_(10),Object.defineProperties(l,{rgbToAnsi256:{value(_,u,F){if(_===u&&u===F){if(_<8)return 16;if(_>248)return 231;return Math.round((_-8)/247*24)+232}return 16+36*Math.round(_/255*5)+6*Math.round(u/255*5)+Math.round(F/255*5)},enumerable:!1},hexToRgb:{value(_){let u=/[a-f\d]{6}|[a-f\d]{3}/i.exec(_.toString(16));if(!u)return[0,0,0];let[F]=u;if(F.length===3)F=[...F].map((E)=>E+E).join("");let B=Number.parseInt(F,16);return[B>>16&255,B>>8&255,B&255]},enumerable:!1},hexToAnsi256:{value:(_)=>l.rgbToAnsi256(...l.hexToRgb(_)),enumerable:!1},ansi256ToAnsi:{value(_){if(_<8)return 30+_;if(_<16)return 90+(_-8);let u,F,B;if(_>=232)u=((_-232)*10+8)/255,F=u,B=u;else{_-=16;let $=_%36;u=Math.floor(_/36)/5,F=Math.floor($/6)/5,B=$%6/5}let E=Math.max(u,F,B)*2;if(E===0)return 30;let C=30+(Math.round(B)<<2|Math.round(F)<<1|Math.round(u));if(E===2)C+=60;return C},enumerable:!1},rgbToAnsi:{value:(_,u,F)=>l.ansi256ToAnsi(l.rgbToAnsi256(_,u,F)),enumerable:!1},hexToAnsi:{value:(_)=>l.ansi256ToAnsi(l.hexToAnsi256(_)),enumerable:!1}}),l}var o7=r7(),WD=o7;import u8 from"node:process";import t7 from"node:os";import t_ from"node:tty";function UD(D,_=globalThis.Deno?globalThis.Deno.args:u8.argv){let u=D.startsWith("-")?"":D.length===1?"-":"--",F=_.indexOf(u+D),B=_.indexOf("--");return F!==-1&&(B===-1||F<B)}var{env:o}=u8,Y2;if(UD("no-color")||UD("no-colors")||UD("color=false")||UD("color=never"))Y2=0;else if(UD("color")||UD("colors")||UD("color=true")||UD("color=always"))Y2=1;function e7(){if("FORCE_COLOR"in o){if(o.FORCE_COLOR==="true")return 1;if(o.FORCE_COLOR==="false")return 0;return o.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(o.FORCE_COLOR,10),3)}}function Du(D){if(D===0)return!1;return{level:D,hasBasic:!0,has256:D>=2,has16m:D>=3}}function _u(D,{streamIsTTY:_,sniffFlags:u=!0}={}){let F=e7();if(F!==void 0)Y2=F;let B=u?Y2:F;if(B===0)return 0;if(u){if(UD("color=16m")||UD("color=full")||UD("color=truecolor"))return 3;if(UD("color=256"))return 2}if("TF_BUILD"in o&&"AGENT_NAME"in o)return 1;if(D&&!_&&B===void 0)return 0;let E=B||0;if(o.TERM==="dumb")return E;if(u8.platform==="win32"){let C=t7.release().split(".");if(Number(C[0])>=10&&Number(C[2])>=10586)return Number(C[2])>=14931?3:2;return 1}if("CI"in o){if(["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some((C)=>(C in o)))return 3;if(["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some((C)=>(C in o))||o.CI_NAME==="codeship")return 1;return E}if("TEAMCITY_VERSION"in o)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(o.TEAMCITY_VERSION)?1:0;if(o.COLORTERM==="truecolor")return 3;if(o.TERM==="xterm-kitty")return 3;if("TERM_PROGRAM"in o){let C=Number.parseInt((o.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(o.TERM_PROGRAM){case"iTerm.app":return C>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(o.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(o.TERM))return 1;if("COLORTERM"in o)return 1;return E}function e_(D,_={}){let u=_u(D,{streamIsTTY:D&&D.isTTY,..._});return Du(u)}var uu={stdout:e_({isTTY:t_.isatty(1)}),stderr:e_({isTTY:t_.isatty(2)})},D6=uu;function _6(D,_,u){let F=D.indexOf(_);if(F===-1)return D;let B=_.length,E=0,C="";do C+=D.slice(E,F)+_+u,E=F+B,F=D.indexOf(_,E);while(F!==-1);return C+=D.slice(E),C}function u6(D,_,u,F){let B=0,E="";do{let C=D[F-1]==="\r";E+=D.slice(B,C?F-1:F)+_+(C?`\r
54
+ ${T}${L}${S}${x_.default.cursorHide}`});var j2={name:"@tobylai/qmcli",version:"0.0.9",description:"A quick minecraft launcher command-line interface",main:"dist/cli.js",type:"module",scripts:{dev:"bun cli.ts",build:"bun bun-build.ts cjs",buildexe:"bun bun-build.ts exe local",prepublishOnly:"bun run build",pub:"npm publish"},keywords:["minecraft","cli"],author:"tobylai-toby",license:"MIT",dependencies:{"@inquirer/prompts":"^7.3.1",arch:"^3.0.0",chalk:"^5.4.1","cli-progress":"^3.12.0",commander:"^13.1.0",configstore:"^7.0.0",jssha:"^3.3.1","zip-lib":"^1.0.5"},devDependencies:{"@types/bun":"latest","@types/cli-progress":"^3.11.6","@types/configstore":"^6.0.2","@types/node":"^22.13.0",tsx:"^4.19.2"},bin:{qmcli:"dist/qmcli.cjs"},publishConfig:{registry:"https://registry.npmjs.org/",access:"public"},peerDependencies:{typescript:"^5.0.0"}};var P0=x(require("node:path")),M6=x(require("node:os")),r0=x(c_());var l_=x(require("os")),n0=x(require("path")),tD=l_.default.homedir(),{env:U0}=process,p_=U0.XDG_DATA_HOME||(tD?n0.default.join(tD,".local","share"):void 0),w2=U0.XDG_CONFIG_HOME||(tD?n0.default.join(tD,".config"):void 0),sE=U0.XDG_STATE_HOME||(tD?n0.default.join(tD,".local","state"):void 0),rE=U0.XDG_CACHE_HOME||(tD?n0.default.join(tD,".cache"):void 0),oE=U0.XDG_RUNTIME_DIR||void 0,M7=(U0.XDG_DATA_DIRS||"/usr/local/share/:/usr/share/").split(":");if(p_)M7.unshift(p_);var W7=(U0.XDG_CONFIG_DIRS||"/etc/xdg").split(":");if(w2)W7.unshift(w2);var X6=x(require("node:path"));var k=x(require("node:fs")),CD=require("node:util");var mD=(D,_)=>{return function u(...F){return D.apply(void 0,F).catch(_)}},zD=(D,_)=>{return function u(...F){try{return D.apply(void 0,F)}catch(B){return _(B)}}};var Z8=x(require("node:process")),i_=Z8.default.getuid?!Z8.default.getuid():!1,n_=1e4,XD=()=>{return};var a0={isChangeErrorOk:(D)=>{if(!a0.isNodeError(D))return!1;let{code:_}=D;if(_==="ENOSYS")return!0;if(!i_&&(_==="EINVAL"||_==="EPERM"))return!0;return!1},isNodeError:(D)=>{return D instanceof Error},isRetriableError:(D)=>{if(!a0.isNodeError(D))return!1;let{code:_}=D;if(_==="EMFILE"||_==="ENFILE"||_==="EAGAIN"||_==="EBUSY"||_==="EACCESS"||_==="EACCES"||_==="EACCS"||_==="EPERM")return!0;return!1},onChangeError:(D)=>{if(!a0.isNodeError(D))throw D;if(a0.isChangeErrorOk(D))return;throw D}},e=a0;class a_{constructor(){this.interval=25,this.intervalId=void 0,this.limit=n_,this.queueActive=new Set,this.queueWaiting=new Set,this.init=()=>{if(this.intervalId)return;this.intervalId=setInterval(this.tick,this.interval)},this.reset=()=>{if(!this.intervalId)return;clearInterval(this.intervalId),delete this.intervalId},this.add=(D)=>{if(this.queueWaiting.add(D),this.queueActive.size<this.limit/2)this.tick();else this.init()},this.remove=(D)=>{this.queueWaiting.delete(D),this.queueActive.delete(D)},this.schedule=()=>{return new Promise((D)=>{let _=()=>this.remove(u),u=()=>D(_);this.add(u)})},this.tick=()=>{if(this.queueActive.size>=this.limit)return;if(!this.queueWaiting.size)return this.reset();for(let D of this.queueWaiting){if(this.queueActive.size>=this.limit)break;this.queueWaiting.delete(D),this.queueActive.add(D),D()}}}}var s_=new a_;var dD=(D,_)=>{return function u(F){return function B(...E){return s_.schedule().then((C)=>{let $=(X)=>{return C(),X},q=(X)=>{if(C(),Date.now()>=F)throw X;if(_(X)){let G=Math.round(100*Math.random());return new Promise((J)=>setTimeout(J,G)).then(()=>B.apply(void 0,E))}throw X};return D.apply(void 0,E).then($,q)})}}},gD=(D,_)=>{return function u(F){return function B(...E){try{return D.apply(void 0,E)}catch(C){if(Date.now()>F)throw C;if(_(C))return B.apply(void 0,E);throw C}}}};var A7={attempt:{chmod:mD(CD.promisify(k.default.chmod),e.onChangeError),chown:mD(CD.promisify(k.default.chown),e.onChangeError),close:mD(CD.promisify(k.default.close),XD),fsync:mD(CD.promisify(k.default.fsync),XD),mkdir:mD(CD.promisify(k.default.mkdir),XD),realpath:mD(CD.promisify(k.default.realpath),XD),stat:mD(CD.promisify(k.default.stat),XD),unlink:mD(CD.promisify(k.default.unlink),XD),chmodSync:zD(k.default.chmodSync,e.onChangeError),chownSync:zD(k.default.chownSync,e.onChangeError),closeSync:zD(k.default.closeSync,XD),existsSync:zD(k.default.existsSync,XD),fsyncSync:zD(k.default.fsync,XD),mkdirSync:zD(k.default.mkdirSync,XD),realpathSync:zD(k.default.realpathSync,XD),statSync:zD(k.default.statSync,XD),unlinkSync:zD(k.default.unlinkSync,XD)},retry:{close:dD(CD.promisify(k.default.close),e.isRetriableError),fsync:dD(CD.promisify(k.default.fsync),e.isRetriableError),open:dD(CD.promisify(k.default.open),e.isRetriableError),readFile:dD(CD.promisify(k.default.readFile),e.isRetriableError),rename:dD(CD.promisify(k.default.rename),e.isRetriableError),stat:dD(CD.promisify(k.default.stat),e.isRetriableError),write:dD(CD.promisify(k.default.write),e.isRetriableError),writeFile:dD(CD.promisify(k.default.writeFile),e.isRetriableError),closeSync:gD(k.default.closeSync,e.isRetriableError),fsyncSync:gD(k.default.fsyncSync,e.isRetriableError),openSync:gD(k.default.openSync,e.isRetriableError),readFileSync:gD(k.default.readFileSync,e.isRetriableError),renameSync:gD(k.default.renameSync,e.isRetriableError),statSync:gD(k.default.statSync,e.isRetriableError),writeSync:gD(k.default.writeSync,e.isRetriableError),writeFileSync:gD(k.default.writeFileSync,e.isRetriableError)}},FD=A7;var J8=x(require("node:os")),x2=x(require("node:process")),r_="utf8",Q8=438,o_=511;var t_={},e_=J8.default.userInfo().uid,D6=J8.default.userInfo().gid;var _6=1000,u6=!!x2.default.getuid,JC=x2.default.getuid?!x2.default.getuid():!1,K8=128;var F6=(D)=>{return D instanceof Error&&"code"in D};var U8=(D)=>{return typeof D==="string"},S2=(D)=>{return D===void 0};var q6=x(require("node:path"));var H0=x(require("node:process"));var H8=x(require("node:process")),B6=H8.default.platform==="linux",y2=H8.default.platform==="win32";var M8=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];if(!y2)M8.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(B6)M8.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED");var E6=M8;class C6{constructor(){this.callbacks=new Set,this.exited=!1,this.exit=(D)=>{if(this.exited)return;this.exited=!0;for(let _ of this.callbacks)_();if(D)if(y2&&(D!=="SIGINT"&&D!=="SIGTERM"&&D!=="SIGKILL"))H0.default.kill(H0.default.pid,"SIGTERM");else H0.default.kill(H0.default.pid,D)},this.hook=()=>{H0.default.once("exit",()=>this.exit());for(let D of E6)try{H0.default.once(D,()=>this.exit(D))}catch{}},this.register=(D)=>{return this.callbacks.add(D),()=>{this.callbacks.delete(D)}},this.hook()}}var $6=new C6;var V7=$6.register,G6=V7;var ZD={store:{},create:(D)=>{let _=`000000${Math.floor(Math.random()*16777215).toString(16)}`.slice(-6),u=Date.now().toString().slice(-10),F="tmp-",B=`.tmp-${u}${_}`;return`${D}${B}`},get:(D,_,u=!0)=>{let F=ZD.truncate(_(D));if(F in ZD.store)return ZD.get(D,_,u);return ZD.store[F]=u,[F,()=>delete ZD.store[F]]},purge:(D)=>{if(!ZD.store[D])return;delete ZD.store[D],FD.attempt.unlink(D)},purgeSync:(D)=>{if(!ZD.store[D])return;delete ZD.store[D],FD.attempt.unlinkSync(D)},purgeSyncAll:()=>{for(let D in ZD.store)ZD.purgeSync(D)},truncate:(D)=>{let _=q6.default.basename(D);if(_.length<=K8)return D;let u=/^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(_);if(!u)return D;let F=_.length-K8;return`${D.slice(0,-_.length)}${u[1]}${u[2].slice(0,-F)}${u[3]}`}};G6(ZD.purgeSyncAll);var s0=ZD;function k2(D,_,u=t_){if(U8(u))return k2(D,_,{encoding:u});let F=Date.now()+((u.timeout??_6)||-1),B=null,E=null,C=null;try{let $=FD.attempt.realpathSync(D),q=!!$;D=$||D,[E,B]=s0.get(D,u.tmpCreate||s0.create,u.tmpPurge!==!1);let X=u6&&S2(u.chown),G=S2(u.mode);if(q&&(X||G)){let Z=FD.attempt.statSync(D);if(Z){if(u={...u},X)u.chown={uid:Z.uid,gid:Z.gid};if(G)u.mode=Z.mode}}if(!q){let Z=X6.default.dirname(D);FD.attempt.mkdirSync(Z,{mode:o_,recursive:!0})}if(C=FD.retry.openSync(F)(E,"w",u.mode||Q8),u.tmpCreated)u.tmpCreated(E);if(U8(_))FD.retry.writeSync(F)(C,_,0,u.encoding||r_);else if(!S2(_))FD.retry.writeSync(F)(C,_,0,_.length,0);if(u.fsync!==!1)if(u.fsyncWait!==!1)FD.retry.fsyncSync(F)(C);else FD.attempt.fsync(C);if(FD.retry.closeSync(F)(C),C=null,u.chown&&(u.chown.uid!==e_||u.chown.gid!==D6))FD.attempt.chownSync(E,u.chown.uid,u.chown.gid);if(u.mode&&u.mode!==Q8)FD.attempt.chmodSync(E,u.mode);try{FD.retry.renameSync(F)(E,D)}catch(Z){if(!F6(Z))throw Z;if(Z.code!=="ENAMETOOLONG")throw Z;FD.retry.renameSync(F)(E,s0.truncate(D))}B(),E=null}finally{if(C)FD.attempt.closeSync(C);if(E)s0.purge(E)}}var M0=(D)=>{let _=typeof D;return D!==null&&(_==="object"||_==="function")};var W8=new Set(["__proto__","prototype","constructor"]),L7=new Set("0123456789");function v2(D){let _=[],u="",F="start",B=!1;for(let E of D)switch(E){case"\\":{if(F==="index")throw new Error("Invalid character in an index");if(F==="indexEnd")throw new Error("Invalid character after an index");if(B)u+=E;F="property",B=!B;break}case".":{if(F==="index")throw new Error("Invalid character in an index");if(F==="indexEnd"){F="property";break}if(B){B=!1,u+=E;break}if(W8.has(u))return[];_.push(u),u="",F="property";break}case"[":{if(F==="index")throw new Error("Invalid character in an index");if(F==="indexEnd"){F="index";break}if(B){B=!1,u+=E;break}if(F==="property"){if(W8.has(u))return[];_.push(u),u=""}F="index";break}case"]":{if(F==="index"){_.push(Number.parseInt(u,10)),u="",F="indexEnd";break}if(F==="indexEnd")throw new Error("Invalid character after an index")}default:{if(F==="index"&&!L7.has(E))throw new Error("Invalid character in an index");if(F==="indexEnd")throw new Error("Invalid character after an index");if(F==="start")F="property";if(B)B=!1,u+="\\";u+=E}}if(B)u+="\\";switch(F){case"property":{if(W8.has(u))return[];_.push(u);break}case"index":throw new Error("Index was not closed");case"start":{_.push("");break}}return _}function A8(D,_){if(typeof _!=="number"&&Array.isArray(D)){let u=Number.parseInt(_,10);return Number.isInteger(u)&&D[u]===D[_]}return!1}function Z6(D,_){if(A8(D,_))throw new Error("Cannot use string index")}function J6(D,_,u){if(!M0(D)||typeof _!=="string")return u===void 0?D:u;let F=v2(_);if(F.length===0)return u;for(let B=0;B<F.length;B++){let E=F[B];if(A8(D,E))D=B===F.length-1?void 0:null;else D=D[E];if(D===void 0||D===null){if(B!==F.length-1)return u;break}}return D===void 0?u:D}function V8(D,_,u){if(!M0(D)||typeof _!=="string")return D;let F=D,B=v2(_);for(let E=0;E<B.length;E++){let C=B[E];if(Z6(D,C),E===B.length-1)D[C]=u;else if(!M0(D[C]))D[C]=typeof B[E+1]==="number"?[]:{};D=D[C]}return F}function Q6(D,_){if(!M0(D)||typeof _!=="string")return!1;let u=v2(_);for(let F=0;F<u.length;F++){let B=u[F];if(Z6(D,B),F===u.length-1)return delete D[B],!0;if(D=D[B],!M0(D))return!1}}function K6(D,_){if(!M0(D)||typeof _!=="string")return!1;let u=v2(_);if(u.length===0)return!1;for(let F of u){if(!M0(D)||!(F in D)||A8(D,F))return!1;D=D[F]}return!0}function I7(D,_){let u=_?P0.default.join(D,"config.json"):P0.default.join("configstore",`${D}.json`),F=w2??r0.default.mkdtempSync(r0.default.realpathSync(M6.default.tmpdir())+P0.default.sep);return P0.default.join(F,u)}var U6="You don't have access to this file.",R7={mode:448,recursive:!0},H6={mode:384};class b2{constructor(D,_,u={}){if(this._path=u.configPath??I7(D,u.globalConfigPath),_)this.all={..._,...this.all}}get all(){try{return JSON.parse(r0.default.readFileSync(this._path,"utf8"))}catch(D){if(D.code==="ENOENT")return{};if(D.code==="EACCES")D.message=`${D.message}
55
+ ${U6}
56
+ `;if(D.name==="SyntaxError")return k2(this._path,"",H6),{};throw D}}set all(D){try{r0.default.mkdirSync(P0.default.dirname(this._path),R7),k2(this._path,JSON.stringify(D,void 0,"\t"),H6)}catch(_){if(_.code==="EACCES")_.message=`${_.message}
57
+ ${U6}
58
+ `;throw _}}get size(){return Object.keys(this.all||{}).length}get(D){return J6(this.all,D)}set(D,_){let u=this.all;if(arguments.length===1)for(let F of Object.keys(D))V8(u,F,D[F]);else V8(u,D,_);this.all=u}has(D){return K6(this.all,D)}delete(D){let _=this.all;Q6(_,D),this.all=_}clear(){this.all={}}get path(){return this._path}}var r=new b2(j2.name,{users:[],mirror:"official",paths:["~/.minecraft"],lang:"en"});var W6=(D=0)=>(_)=>`\x1B[${_+D}m`,A6=(D=0)=>(_)=>`\x1B[${38+D};5;${_}m`,V6=(D=0)=>(_,u,F)=>`\x1B[${38+D};2;${_};${u};${F}m`,l={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]}},iC=Object.keys(l.modifier),N7=Object.keys(l.color),T7=Object.keys(l.bgColor),nC=[...N7,...T7];function j7(){let D=new Map;for(let[_,u]of Object.entries(l)){for(let[F,B]of Object.entries(u))l[F]={open:`\x1B[${B[0]}m`,close:`\x1B[${B[1]}m`},u[F]=l[F],D.set(B[0],B[1]);Object.defineProperty(l,_,{value:u,enumerable:!1})}return Object.defineProperty(l,"codes",{value:D,enumerable:!1}),l.color.close="\x1B[39m",l.bgColor.close="\x1B[49m",l.color.ansi=W6(),l.color.ansi256=A6(),l.color.ansi16m=V6(),l.bgColor.ansi=W6(10),l.bgColor.ansi256=A6(10),l.bgColor.ansi16m=V6(10),Object.defineProperties(l,{rgbToAnsi256:{value(_,u,F){if(_===u&&u===F){if(_<8)return 16;if(_>248)return 231;return Math.round((_-8)/247*24)+232}return 16+36*Math.round(_/255*5)+6*Math.round(u/255*5)+Math.round(F/255*5)},enumerable:!1},hexToRgb:{value(_){let u=/[a-f\d]{6}|[a-f\d]{3}/i.exec(_.toString(16));if(!u)return[0,0,0];let[F]=u;if(F.length===3)F=[...F].map((E)=>E+E).join("");let B=Number.parseInt(F,16);return[B>>16&255,B>>8&255,B&255]},enumerable:!1},hexToAnsi256:{value:(_)=>l.rgbToAnsi256(...l.hexToRgb(_)),enumerable:!1},ansi256ToAnsi:{value(_){if(_<8)return 30+_;if(_<16)return 90+(_-8);let u,F,B;if(_>=232)u=((_-232)*10+8)/255,F=u,B=u;else{_-=16;let $=_%36;u=Math.floor(_/36)/5,F=Math.floor($/6)/5,B=$%6/5}let E=Math.max(u,F,B)*2;if(E===0)return 30;let C=30+(Math.round(B)<<2|Math.round(F)<<1|Math.round(u));if(E===2)C+=60;return C},enumerable:!1},rgbToAnsi:{value:(_,u,F)=>l.ansi256ToAnsi(l.rgbToAnsi256(_,u,F)),enumerable:!1},hexToAnsi:{value:(_)=>l.ansi256ToAnsi(l.hexToAnsi256(_)),enumerable:!1}}),l}var O7=j7(),LD=O7;var m2=x(require("node:process")),I6=x(require("node:os")),L8=x(require("node:tty"));function MD(D,_=globalThis.Deno?globalThis.Deno.args:m2.default.argv){let u=D.startsWith("-")?"":D.length===1?"-":"--",F=_.indexOf(u+D),B=_.indexOf("--");return F!==-1&&(B===-1||F<B)}var{env:o}=m2.default,h2;if(MD("no-color")||MD("no-colors")||MD("color=false")||MD("color=never"))h2=0;else if(MD("color")||MD("colors")||MD("color=true")||MD("color=always"))h2=1;function P7(){if("FORCE_COLOR"in o){if(o.FORCE_COLOR==="true")return 1;if(o.FORCE_COLOR==="false")return 0;return o.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(o.FORCE_COLOR,10),3)}}function z7(D){if(D===0)return!1;return{level:D,hasBasic:!0,has256:D>=2,has16m:D>=3}}function Y7(D,{streamIsTTY:_,sniffFlags:u=!0}={}){let F=P7();if(F!==void 0)h2=F;let B=u?h2:F;if(B===0)return 0;if(u){if(MD("color=16m")||MD("color=full")||MD("color=truecolor"))return 3;if(MD("color=256"))return 2}if("TF_BUILD"in o&&"AGENT_NAME"in o)return 1;if(D&&!_&&B===void 0)return 0;let E=B||0;if(o.TERM==="dumb")return E;if(m2.default.platform==="win32"){let C=I6.default.release().split(".");if(Number(C[0])>=10&&Number(C[2])>=10586)return Number(C[2])>=14931?3:2;return 1}if("CI"in o){if(["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some((C)=>(C in o)))return 3;if(["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some((C)=>(C in o))||o.CI_NAME==="codeship")return 1;return E}if("TEAMCITY_VERSION"in o)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(o.TEAMCITY_VERSION)?1:0;if(o.COLORTERM==="truecolor")return 3;if(o.TERM==="xterm-kitty")return 3;if("TERM_PROGRAM"in o){let C=Number.parseInt((o.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(o.TERM_PROGRAM){case"iTerm.app":return C>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(o.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(o.TERM))return 1;if("COLORTERM"in o)return 1;return E}function L6(D,_={}){let u=Y7(D,{streamIsTTY:D&&D.isTTY,..._});return z7(u)}var w7={stdout:L6({isTTY:L8.default.isatty(1)}),stderr:L6({isTTY:L8.default.isatty(2)})},R6=w7;function N6(D,_,u){let F=D.indexOf(_);if(F===-1)return D;let B=_.length,E=0,C="";do C+=D.slice(E,F)+_+u,E=F+B,F=D.indexOf(_,E);while(F!==-1);return C+=D.slice(E),C}function T6(D,_,u,F){let B=0,E="";do{let C=D[F-1]==="\r";E+=D.slice(B,C?F-1:F)+_+(C?`\r
59
59
  `:`
60
60
  `)+u,B=F+1,F=D.indexOf(`
61
- `,B)}while(F!==-1);return E+=D.slice(B),E}var{stdout:F6,stderr:B6}=D6,F8=Symbol("GENERATOR"),T0=Symbol("STYLER"),i0=Symbol("IS_EMPTY"),E6=["ansi","ansi","ansi256","ansi16m"],j0=Object.create(null),Fu=(D,_={})=>{if(_.level&&!(Number.isInteger(_.level)&&_.level>=0&&_.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let u=F6?F6.level:0;D.level=_.level===void 0?u:_.level};var Bu=(D)=>{let _=(...u)=>u.join(" ");return Fu(_,D),Object.setPrototypeOf(_,n0.prototype),_};function n0(D){return Bu(D)}Object.setPrototypeOf(n0.prototype,Function.prototype);for(let[D,_]of Object.entries(WD))j0[D]={get(){let u=w2(this,E8(_.open,_.close,this[T0]),this[i0]);return Object.defineProperty(this,D,{value:u}),u}};j0.visible={get(){let D=w2(this,this[T0],!0);return Object.defineProperty(this,"visible",{value:D}),D}};var B8=(D,_,u,...F)=>{if(D==="rgb"){if(_==="ansi16m")return WD[u].ansi16m(...F);if(_==="ansi256")return WD[u].ansi256(WD.rgbToAnsi256(...F));return WD[u].ansi(WD.rgbToAnsi(...F))}if(D==="hex")return B8("rgb",_,u,...WD.hexToRgb(...F));return WD[u][D](...F)},Eu=["rgb","hex","ansi256"];for(let D of Eu){j0[D]={get(){let{level:u}=this;return function(...F){let B=E8(B8(D,E6[u],"color",...F),WD.color.close,this[T0]);return w2(this,B,this[i0])}}};let _="bg"+D[0].toUpperCase()+D.slice(1);j0[_]={get(){let{level:u}=this;return function(...F){let B=E8(B8(D,E6[u],"bgColor",...F),WD.bgColor.close,this[T0]);return w2(this,B,this[i0])}}}}var Cu=Object.defineProperties(()=>{},{...j0,level:{enumerable:!0,get(){return this[F8].level},set(D){this[F8].level=D}}}),E8=(D,_,u)=>{let F,B;if(u===void 0)F=D,B=_;else F=u.openAll+D,B=_+u.closeAll;return{open:D,close:_,openAll:F,closeAll:B,parent:u}},w2=(D,_,u)=>{let F=(...B)=>$u(F,B.length===1?""+B[0]:B.join(" "));return Object.setPrototypeOf(F,Cu),F[F8]=D,F[T0]=_,F[i0]=u,F},$u=(D,_)=>{if(D.level<=0||!_)return D[i0]?"":_;let u=D[T0];if(u===void 0)return _;let{openAll:F,closeAll:B}=u;if(_.includes("\x1B"))while(u!==void 0)_=_6(_,u.close,u.open),u=u.parent;let E=_.indexOf(`
62
- `);if(E!==-1)_=u6(_,B,F,E);return F+_+B};Object.defineProperties(n0.prototype,j0);var Gu=n0(),SG=n0({level:B6?B6.level:0});var O=Gu;var v6=GD(y6(),1);import*as k6 from"fs";function Su(D){if(D<1024)return`${D} B`;else if(D<1048576)return`${(D/1024).toFixed(2)} KB`;else if(D<1073741824)return`${(D/1048576).toFixed(2)} MB`;else return`${(D/1073741824).toFixed(2)} GB`}class J8{maxParallel;queue;activeDownloads;progressBar;totalTasks=0;completedTasks=0;speedUpdateInterval;extra;downloadedSize=0;startTime=0;constructor(D,_){this.extra=_,this.maxParallel=D,this.queue=[],this.activeDownloads=new Map,this.startTime=Date.now(),this.progressBar=new v6.SingleBar({format(u,F,B){let E=u.barCompleteChar.repeat(B.finishedPercent*20)+u.barIncompleteChar.repeat((1-B.finishedPercent)*20);return`${B.title} | ${E} | ${(B.finishedPercent*100).toFixed(1)}% | ${B.completed}/${B.totalTasks} | ${B.speed}`+(_?.totalSize?` | tot:${Su(_?.totalSize)} | eta:${B.calcEta.toFixed(1)}s`:"")},barCompleteChar:"█",barIncompleteChar:"░",hideCursor:!0}),this.speedUpdateInterval=setInterval(()=>this.updateProgress(),100)}addTask(D){if(this.queue.push(D),this.totalTasks++,!this.progressBar.isActive)this.progressBar.start(this.totalTasks,0,{title:"Waiting...",speed:"0.00 B/s",completed:0,totalTasks:this.totalTasks,finishedPercent:0,calcEta:1/0});this.processQueue()}processQueue(){while(this.activeDownloads.size<this.maxParallel&&this.queue.length>0){let D=this.queue.shift();this.activeDownloads.set(D.filename,0),this.downloadFile(D)}}formatSpeed(D){let _=["B/s","KB/s","MB/s","GB/s"],u=D,F=0;while(u>=1024&&F<_.length-1)u/=1024,F++;return`${u.toFixed(2)} ${_[F]}`}updateProgress(D=!1){let _=Array.from(this.activeDownloads.keys()),u=this.downloadedSize/((Date.now()-this.startTime)/1000);this.progressBar.update(this.completedTasks,{title:D?O.green("Done"):_.length>0?`Downloading: (${_.length} active)`:"Preparing...",speed:this.formatSpeed(u),completed:this.completedTasks,totalTasks:this.totalTasks,finishedPercent:this.extra?.totalSize?this.downloadedSize/this.extra.totalSize:this.completedTasks/this.totalTasks,calcEta:this.extra?.totalSize?(this.extra.totalSize-this.downloadedSize)/u:0})}async downloadFile(D){try{let _=await fetch(D.url);if(!_.ok)throw new Error(`HTTP ${_.status}`);let u=k6.createWriteStream(D.filename);u.on("error",(C)=>{throw C});let F=_.body?.getReader();if(!F)throw new Error("No readable stream");let B=0,E=Date.now();while(!0){let{done:C,value:$}=await F.read();if(C)break;u.write($),B+=$.length,this.downloadedSize+=$.length;let q=(Date.now()-E)/1000+0.01;this.activeDownloads.set(D.filename,q>0?B/q:0)}u.end(),this.completedTasks++}catch(_){if((D.retries||20)>0)console.error(`♻️❌ ${D.filename}(retrying): ${_.message}`),await new Promise((u)=>setTimeout(u,3000)),this.queue.push({...D,retries:D.retries-1});else throw console.error(`❌⚙️ ${D.filename}(FAILED!): ${_.message}`),_}finally{this.activeDownloads.delete(D.filename),this.processQueue()}}async wait(){this.startTime=Date.now();while(this.activeDownloads.size>0||this.queue.length>0)await new Promise((D)=>setTimeout(D,100));this.updateProgress(!0),clearInterval(this.speedUpdateInterval),this.progressBar.stop()}}var y2={official:{launcher:"https://launcher.mojang.com",launchermeta:"https://launchermeta.mojang.com",pistonmeta:"https://piston-meta.mojang.com",resources:"http://resources.download.minecraft.net",libraries:"https://libraries.minecraft.net"},bmclapi:{launcher:"https://bmclapi2.bangbang93.com",launchermeta:"https://bmclapi2.bangbang93.com",pistonmeta:"https://bmclapi2.bangbang93.com",resources:"http://bmclapi2.bangbang93.com/assets",libraries:"https://bmclapi2.bangbang93.com/maven"}};function yu(D,_,u){return D.replace(y2.official[u],y2[_][u])}function O0(D){for(let _ of Object.keys(y2.official))if(D.startsWith(y2.official[_]))return yu(D,r.get("mirror"),_);return D}import*as f from"node:fs";import*as F0 from"node:path";var b6={selectedProfile:"(Default)",profiles:{"(Default)":{name:"(Default)"}},clientToken:"88888888-8888-8888-8888-888888888888"};var f6=GD(Q8(),1);import*as a0 from"node:os";import*as g6 from"node:path";function c6(D){if(!D||D.length===0||D.length>255)return!1;if(D==="."||D==="..")return!1;if(D.includes("/")||D.includes("\\"))return!1;if(/[<>:"|?*\u0000-\u001F]/gu.test(D))return!1;if(/\.\./gu.test(D))return!1;if(/[\s.]$/u.test(D))return!1;if(/[\p{C}]/gu.test(D))return!1;return/^[^\s.]/u.test(D)&&D.trim()===D}function QD(D){if(D.startsWith("~/"))return g6.join(a0.homedir(),D.slice(2));return D}function x0(){if(a0.platform()==="win32")return"windows";else if(a0.platform()==="darwin")return"osx";else return"linux"}function p6(){let D=f6.default();if(D==="x64")return"";else return"-"+D}function k2(D,_={}){for(let u of D){let F=!0;if(u.os){let B=u.os,E=_.os||{};if(B.name&&E.name!==B.name)F=!1;if(B.version){if(!new RegExp(B.version).test(E.version||""))F=!1}if(B.arch&&E.arch!==B.arch)F=!1}if(u.features){let B=u.features;for(let[E,C]of Object.entries(B))if(_[E]!==C){F=!1;break}}if(F)return u.action==="allow"}return!1}var z4=GD(B4(),1);function E4(D,_,u,F){let B,E,C,$=_||[0],q=(u=u||0)>>>3,X=F===-1?3:0;for(B=0;B<D.length;B+=1)C=B+q,E=C>>>2,$.length<=E&&$.push(0),$[E]|=D[B]<<8*(X+F*(C%4));return{value:$,binLen:8*D.length+u}}function w0(D,_,u){switch(_){case"UTF8":case"UTF16BE":case"UTF16LE":break;default:throw new Error("encoding must be UTF8, UTF16BE, or UTF16LE")}switch(D){case"HEX":return function(F,B,E){return function(C,$,q,X){let G,Z,J,K;if(C.length%2!=0)throw new Error("String of HEX type must be in byte increments");let Q=$||[0],M=(q=q||0)>>>3,W=X===-1?3:0;for(G=0;G<C.length;G+=2){if(Z=parseInt(C.substr(G,2),16),isNaN(Z))throw new Error("String of HEX type contains invalid characters");for(K=(G>>>1)+M,J=K>>>2;Q.length<=J;)Q.push(0);Q[J]|=Z<<8*(W+X*(K%4))}return{value:Q,binLen:4*C.length+q}}(F,B,E,u)};case"TEXT":return function(F,B,E){return function(C,$,q,X,G){let Z,J,K,Q,M,W,V,L,T=0,S=q||[0],j=(X=X||0)>>>3;if($==="UTF8")for(V=G===-1?3:0,K=0;K<C.length;K+=1)for(Z=C.charCodeAt(K),J=[],128>Z?J.push(Z):2048>Z?(J.push(192|Z>>>6),J.push(128|63&Z)):55296>Z||57344<=Z?J.push(224|Z>>>12,128|Z>>>6&63,128|63&Z):(K+=1,Z=65536+((1023&Z)<<10|1023&C.charCodeAt(K)),J.push(240|Z>>>18,128|Z>>>12&63,128|Z>>>6&63,128|63&Z)),Q=0;Q<J.length;Q+=1){for(W=T+j,M=W>>>2;S.length<=M;)S.push(0);S[M]|=J[Q]<<8*(V+G*(W%4)),T+=1}else for(V=G===-1?2:0,L=$==="UTF16LE"&&G!==1||$!=="UTF16LE"&&G===1,K=0;K<C.length;K+=1){for(Z=C.charCodeAt(K),L===!0&&(Q=255&Z,Z=Q<<8|Z>>>8),W=T+j,M=W>>>2;S.length<=M;)S.push(0);S[M]|=Z<<8*(V+G*(W%4)),T+=2}return{value:S,binLen:8*T+X}}(F,_,B,E,u)};case"B64":return function(F,B,E){return function(C,$,q,X){let G,Z,J,K,Q,M,W,V=0,L=$||[0],T=(q=q||0)>>>3,S=X===-1?3:0,j=C.indexOf("=");if(C.search(/^[a-zA-Z0-9=+/]+$/)===-1)throw new Error("Invalid character in base-64 string");if(C=C.replace(/=/g,""),j!==-1&&j<C.length)throw new Error("Invalid '=' found in base-64 string");for(Z=0;Z<C.length;Z+=4){for(Q=C.substr(Z,4),K=0,J=0;J<Q.length;J+=1)G="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(Q.charAt(J)),K|=G<<18-6*J;for(J=0;J<Q.length-1;J+=1){for(W=V+T,M=W>>>2;L.length<=M;)L.push(0);L[M]|=(K>>>16-8*J&255)<<8*(S+X*(W%4)),V+=1}}return{value:L,binLen:8*V+q}}(F,B,E,u)};case"BYTES":return function(F,B,E){return function(C,$,q,X){let G,Z,J,K,Q=$||[0],M=(q=q||0)>>>3,W=X===-1?3:0;for(Z=0;Z<C.length;Z+=1)G=C.charCodeAt(Z),K=Z+M,J=K>>>2,Q.length<=J&&Q.push(0),Q[J]|=G<<8*(W+X*(K%4));return{value:Q,binLen:8*C.length+q}}(F,B,E,u)};case"ARRAYBUFFER":try{new ArrayBuffer(0)}catch(F){throw new Error("ARRAYBUFFER not supported by this environment")}return function(F,B,E){return function(C,$,q,X){return E4(new Uint8Array(C),$,q,X)}(F,B,E,u)};case"UINT8ARRAY":try{new Uint8Array(0)}catch(F){throw new Error("UINT8ARRAY not supported by this environment")}return function(F,B,E){return E4(F,B,E,u)};default:throw new Error("format must be HEX, TEXT, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}}function C4(D,_,u,F){switch(D){case"HEX":return function(B){return function(E,C,$,q){let G,Z,J="",K=C/8,Q=$===-1?3:0;for(G=0;G<K;G+=1)Z=E[G>>>2]>>>8*(Q+$*(G%4)),J+="0123456789abcdef".charAt(Z>>>4&15)+"0123456789abcdef".charAt(15&Z);return q.outputUpper?J.toUpperCase():J}(B,_,u,F)};case"B64":return function(B){return function(E,C,$,q){let X,G,Z,J,K,Q="",M=C/8,W=$===-1?3:0;for(X=0;X<M;X+=3)for(J=X+1<M?E[X+1>>>2]:0,K=X+2<M?E[X+2>>>2]:0,Z=(E[X>>>2]>>>8*(W+$*(X%4))&255)<<16|(J>>>8*(W+$*((X+1)%4))&255)<<8|K>>>8*(W+$*((X+2)%4))&255,G=0;G<4;G+=1)Q+=8*X+6*G<=C?"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(Z>>>6*(3-G)&63):q.b64Pad;return Q}(B,_,u,F)};case"BYTES":return function(B){return function(E,C,$){let q,X,G="",Z=C/8,J=$===-1?3:0;for(q=0;q<Z;q+=1)X=E[q>>>2]>>>8*(J+$*(q%4))&255,G+=String.fromCharCode(X);return G}(B,_,u)};case"ARRAYBUFFER":try{new ArrayBuffer(0)}catch(B){throw new Error("ARRAYBUFFER not supported by this environment")}return function(B){return function(E,C,$){let q,X=C/8,G=new ArrayBuffer(X),Z=new Uint8Array(G),J=$===-1?3:0;for(q=0;q<X;q+=1)Z[q]=E[q>>>2]>>>8*(J+$*(q%4))&255;return G}(B,_,u)};case"UINT8ARRAY":try{new Uint8Array(0)}catch(B){throw new Error("UINT8ARRAY not supported by this environment")}return function(B){return function(E,C,$){let q,X=C/8,G=$===-1?3:0,Z=new Uint8Array(X);for(q=0;q<X;q+=1)Z[q]=E[q>>>2]>>>8*(G+$*(q%4))&255;return Z}(B,_,u)};default:throw new Error("format must be HEX, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}}var F2=4294967296,I=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],cD=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428],pD=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],B2="Chosen SHA variant is not supported",U4="Cannot set numRounds with MAC";function E3(D,_){let u,F,B=D.binLen>>>3,E=_.binLen>>>3,C=B<<3,$=4-B<<3;if(B%4!=0){for(u=0;u<E;u+=4)F=B+u>>>2,D.value[F]|=_.value[u>>>2]<<C,D.value.push(0),D.value[F+1]|=_.value[u>>>2]>>>$;return(D.value.length<<2)-4>=E+B&&D.value.pop(),{value:D.value,binLen:D.binLen+_.binLen}}return{value:D.value.concat(_.value),binLen:D.binLen+_.binLen}}function $4(D){let _={outputUpper:!1,b64Pad:"=",outputLen:-1},u=D||{};if(_.outputUpper=u.outputUpper||!1,u.b64Pad&&(_.b64Pad=u.b64Pad),u.outputLen){if(u.outputLen%8!=0)throw new Error("Output length must be a multiple of 8");_.outputLen=u.outputLen}else if(u.shakeLen){if(u.shakeLen%8!=0)throw new Error("Output length must be a multiple of 8");_.outputLen=u.shakeLen}if(typeof _.outputUpper!="boolean")throw new Error("Invalid outputUpper formatting option");if(typeof _.b64Pad!="string")throw new Error("Invalid b64Pad formatting option");return _}function u0(D,_,u,F){let B=D+" must include a value and format";if(!_){if(!F)throw new Error(B);return F}if(_.value===void 0||!_.format)throw new Error(B);return w0(_.format,_.encoding||"UTF8",u)(_.value)}class E2{constructor(D,_,u){let F=u||{};if(this.t=_,this.i=F.encoding||"UTF8",this.numRounds=F.numRounds||1,isNaN(this.numRounds)||this.numRounds!==parseInt(this.numRounds,10)||1>this.numRounds)throw new Error("numRounds must a integer >= 1");this.o=D,this.h=[],this.u=0,this.l=!1,this.A=0,this.H=!1,this.S=[],this.p=[]}update(D){let _,u=0,F=this.m>>>5,B=this.C(D,this.h,this.u),E=B.binLen,C=B.value,$=E>>>5;for(_=0;_<$;_+=F)u+this.m<=E&&(this.U=this.v(C.slice(_,_+F),this.U),u+=this.m);return this.A+=u,this.h=C.slice(u>>>5),this.u=E%this.m,this.l=!0,this}getHash(D,_){let u,F,B=this.R,E=$4(_);if(this.K){if(E.outputLen===-1)throw new Error("Output length must be specified in options");B=E.outputLen}let C=C4(D,B,this.T,E);if(this.H&&this.g)return C(this.g(E));for(F=this.F(this.h.slice(),this.u,this.A,this.L(this.U),B),u=1;u<this.numRounds;u+=1)this.K&&B%32!=0&&(F[F.length-1]&=16777215>>>24-B%32),F=this.F(F,B,0,this.B(this.o),B);return C(F)}setHMACKey(D,_,u){if(!this.M)throw new Error("Variant does not support HMAC");if(this.l)throw new Error("Cannot set MAC key after calling update");let F=w0(_,(u||{}).encoding||"UTF8",this.T);this.k(F(D))}k(D){let _=this.m>>>3,u=_/4-1,F;if(this.numRounds!==1)throw new Error(U4);if(this.H)throw new Error("MAC key already set");for(_<D.binLen/8&&(D.value=this.F(D.value,D.binLen,0,this.B(this.o),this.R));D.value.length<=u;)D.value.push(0);for(F=0;F<=u;F+=1)this.S[F]=909522486^D.value[F],this.p[F]=1549556828^D.value[F];this.U=this.v(this.S,this.U),this.A=this.m,this.H=!0}getHMAC(D,_){let u=$4(_);return C4(D,this.R,this.T,u)(this.Y())}Y(){let D;if(!this.H)throw new Error("Cannot call getHMAC without first setting MAC key");let _=this.F(this.h.slice(),this.u,this.A,this.L(this.U),this.R);return D=this.v(this.p,this.B(this.o)),D=this.F(_,this.R,this.m,D,this.R),D}}function Y0(D,_){return D<<_|D>>>32-_}function zD(D,_){return D>>>_|D<<32-_}function H4(D,_){return D>>>_}function G4(D,_,u){return D^_^u}function M4(D,_,u){return D&_^~D&u}function W4(D,_,u){return D&_^D&u^_&u}function VB(D){return zD(D,2)^zD(D,13)^zD(D,22)}function $D(D,_){let u=(65535&D)+(65535&_);return(65535&(D>>>16)+(_>>>16)+(u>>>16))<<16|65535&u}function LB(D,_,u,F){let B=(65535&D)+(65535&_)+(65535&u)+(65535&F);return(65535&(D>>>16)+(_>>>16)+(u>>>16)+(F>>>16)+(B>>>16))<<16|65535&B}function u2(D,_,u,F,B){let E=(65535&D)+(65535&_)+(65535&u)+(65535&F)+(65535&B);return(65535&(D>>>16)+(_>>>16)+(u>>>16)+(F>>>16)+(B>>>16)+(E>>>16))<<16|65535&E}function IB(D){return zD(D,7)^zD(D,18)^H4(D,3)}function RB(D){return zD(D,6)^zD(D,11)^zD(D,25)}function NB(D){return[1732584193,4023233417,2562383102,271733878,3285377520]}function A4(D,_){let u,F,B,E,C,$,q,X=[];for(u=_[0],F=_[1],B=_[2],E=_[3],C=_[4],q=0;q<80;q+=1)X[q]=q<16?D[q]:Y0(X[q-3]^X[q-8]^X[q-14]^X[q-16],1),$=q<20?u2(Y0(u,5),M4(F,B,E),C,1518500249,X[q]):q<40?u2(Y0(u,5),G4(F,B,E),C,1859775393,X[q]):q<60?u2(Y0(u,5),W4(F,B,E),C,2400959708,X[q]):u2(Y0(u,5),G4(F,B,E),C,3395469782,X[q]),C=E,E=B,B=Y0(F,30),F=u,u=$;return _[0]=$D(u,_[0]),_[1]=$D(F,_[1]),_[2]=$D(B,_[2]),_[3]=$D(E,_[3]),_[4]=$D(C,_[4]),_}function TB(D,_,u,F){let B,E=15+(_+65>>>9<<4),C=_+u;for(;D.length<=E;)D.push(0);for(D[_>>>5]|=128<<24-_%32,D[E]=4294967295&C,D[E-1]=C/F2|0,B=0;B<D.length;B+=16)F=A4(D.slice(B,B+16),F);return F}var jB=class extends E2{constructor(D,_,u){if(D!=="SHA-1")throw new Error(B2);super(D,_,u);let F=u||{};this.M=!0,this.g=this.Y,this.T=-1,this.C=w0(this.t,this.i,this.T),this.v=A4,this.L=function(B){return B.slice()},this.B=NB,this.F=TB,this.U=[1732584193,4023233417,2562383102,271733878,3285377520],this.m=512,this.R=160,this.K=!1,F.hmacKey&&this.k(u0("hmacKey",F.hmacKey,this.T))}};function q4(D){let _;return _=D=="SHA-224"?cD.slice():pD.slice(),_}function X4(D,_){let u,F,B,E,C,$,q,X,G,Z,J,K=[];for(u=_[0],F=_[1],B=_[2],E=_[3],C=_[4],$=_[5],q=_[6],X=_[7],J=0;J<64;J+=1)K[J]=J<16?D[J]:LB(zD(Q=K[J-2],17)^zD(Q,19)^H4(Q,10),K[J-7],IB(K[J-15]),K[J-16]),G=u2(X,RB(C),M4(C,$,q),I[J],K[J]),Z=$D(VB(u),W4(u,F,B)),X=q,q=$,$=C,C=$D(E,G),E=B,B=F,F=u,u=$D(G,Z);var Q;return _[0]=$D(u,_[0]),_[1]=$D(F,_[1]),_[2]=$D(B,_[2]),_[3]=$D(E,_[3]),_[4]=$D(C,_[4]),_[5]=$D($,_[5]),_[6]=$D(q,_[6]),_[7]=$D(X,_[7]),_}var OB=class extends E2{constructor(D,_,u){if(D!=="SHA-224"&&D!=="SHA-256")throw new Error(B2);super(D,_,u);let F=u||{};this.g=this.Y,this.M=!0,this.T=-1,this.C=w0(this.t,this.i,this.T),this.v=X4,this.L=function(B){return B.slice()},this.B=q4,this.F=function(B,E,C,$){return function(q,X,G,Z,J){let K,Q,M=15+(X+65>>>9<<4),W=X+G;for(;q.length<=M;)q.push(0);for(q[X>>>5]|=128<<24-X%32,q[M]=4294967295&W,q[M-1]=W/F2|0,K=0;K<q.length;K+=16)Z=X4(q.slice(K,K+16),Z);return Q=J==="SHA-224"?[Z[0],Z[1],Z[2],Z[3],Z[4],Z[5],Z[6]]:Z,Q}(B,E,C,$,D)},this.U=q4(D),this.m=512,this.R=D==="SHA-224"?224:256,this.K=!1,F.hmacKey&&this.k(u0("hmacKey",F.hmacKey,this.T))}};class U{constructor(D,_){this.N=D,this.I=_}}function Z4(D,_){let u;return _>32?(u=64-_,new U(D.I<<_|D.N>>>u,D.N<<_|D.I>>>u)):_!==0?(u=32-_,new U(D.N<<_|D.I>>>u,D.I<<_|D.N>>>u)):D}function YD(D,_){let u;return _<32?(u=32-_,new U(D.N>>>_|D.I<<u,D.I>>>_|D.N<<u)):(u=64-_,new U(D.I>>>_|D.N<<u,D.N>>>_|D.I<<u))}function V4(D,_){return new U(D.N>>>_,D.I>>>_|D.N<<32-_)}function xB(D,_,u){return new U(D.N&_.N^D.N&u.N^_.N&u.N,D.I&_.I^D.I&u.I^_.I&u.I)}function PB(D){let _=YD(D,28),u=YD(D,34),F=YD(D,39);return new U(_.N^u.N^F.N,_.I^u.I^F.I)}function ND(D,_){let u,F;u=(65535&D.I)+(65535&_.I),F=(D.I>>>16)+(_.I>>>16)+(u>>>16);let B=(65535&F)<<16|65535&u;return u=(65535&D.N)+(65535&_.N)+(F>>>16),F=(D.N>>>16)+(_.N>>>16)+(u>>>16),new U((65535&F)<<16|65535&u,B)}function zB(D,_,u,F){let B,E;B=(65535&D.I)+(65535&_.I)+(65535&u.I)+(65535&F.I),E=(D.I>>>16)+(_.I>>>16)+(u.I>>>16)+(F.I>>>16)+(B>>>16);let C=(65535&E)<<16|65535&B;return B=(65535&D.N)+(65535&_.N)+(65535&u.N)+(65535&F.N)+(E>>>16),E=(D.N>>>16)+(_.N>>>16)+(u.N>>>16)+(F.N>>>16)+(B>>>16),new U((65535&E)<<16|65535&B,C)}function YB(D,_,u,F,B){let E,C;E=(65535&D.I)+(65535&_.I)+(65535&u.I)+(65535&F.I)+(65535&B.I),C=(D.I>>>16)+(_.I>>>16)+(u.I>>>16)+(F.I>>>16)+(B.I>>>16)+(E>>>16);let $=(65535&C)<<16|65535&E;return E=(65535&D.N)+(65535&_.N)+(65535&u.N)+(65535&F.N)+(65535&B.N)+(C>>>16),C=(D.N>>>16)+(_.N>>>16)+(u.N>>>16)+(F.N>>>16)+(B.N>>>16)+(E>>>16),new U((65535&C)<<16|65535&E,$)}function _2(D,_){return new U(D.N^_.N,D.I^_.I)}function wB(D){let _=YD(D,19),u=YD(D,61),F=V4(D,6);return new U(_.N^u.N^F.N,_.I^u.I^F.I)}function SB(D){let _=YD(D,1),u=YD(D,8),F=V4(D,7);return new U(_.N^u.N^F.N,_.I^u.I^F.I)}function yB(D){let _=YD(D,14),u=YD(D,18),F=YD(D,41);return new U(_.N^u.N^F.N,_.I^u.I^F.I)}var kB=[new U(I[0],3609767458),new U(I[1],602891725),new U(I[2],3964484399),new U(I[3],2173295548),new U(I[4],4081628472),new U(I[5],3053834265),new U(I[6],2937671579),new U(I[7],3664609560),new U(I[8],2734883394),new U(I[9],1164996542),new U(I[10],1323610764),new U(I[11],3590304994),new U(I[12],4068182383),new U(I[13],991336113),new U(I[14],633803317),new U(I[15],3479774868),new U(I[16],2666613458),new U(I[17],944711139),new U(I[18],2341262773),new U(I[19],2007800933),new U(I[20],1495990901),new U(I[21],1856431235),new U(I[22],3175218132),new U(I[23],2198950837),new U(I[24],3999719339),new U(I[25],766784016),new U(I[26],2566594879),new U(I[27],3203337956),new U(I[28],1034457026),new U(I[29],2466948901),new U(I[30],3758326383),new U(I[31],168717936),new U(I[32],1188179964),new U(I[33],1546045734),new U(I[34],1522805485),new U(I[35],2643833823),new U(I[36],2343527390),new U(I[37],1014477480),new U(I[38],1206759142),new U(I[39],344077627),new U(I[40],1290863460),new U(I[41],3158454273),new U(I[42],3505952657),new U(I[43],106217008),new U(I[44],3606008344),new U(I[45],1432725776),new U(I[46],1467031594),new U(I[47],851169720),new U(I[48],3100823752),new U(I[49],1363258195),new U(I[50],3750685593),new U(I[51],3785050280),new U(I[52],3318307427),new U(I[53],3812723403),new U(I[54],2003034995),new U(I[55],3602036899),new U(I[56],1575990012),new U(I[57],1125592928),new U(I[58],2716904306),new U(I[59],442776044),new U(I[60],593698344),new U(I[61],3733110249),new U(I[62],2999351573),new U(I[63],3815920427),new U(3391569614,3928383900),new U(3515267271,566280711),new U(3940187606,3454069534),new U(4118630271,4000239992),new U(116418474,1914138554),new U(174292421,2731055270),new U(289380356,3203993006),new U(460393269,320620315),new U(685471733,587496836),new U(852142971,1086792851),new U(1017036298,365543100),new U(1126000580,2618297676),new U(1288033470,3409855158),new U(1501505948,4234509866),new U(1607167915,987167468),new U(1816402316,1246189591)];function J4(D){return D==="SHA-384"?[new U(3418070365,cD[0]),new U(1654270250,cD[1]),new U(2438529370,cD[2]),new U(355462360,cD[3]),new U(1731405415,cD[4]),new U(41048885895,cD[5]),new U(3675008525,cD[6]),new U(1203062813,cD[7])]:[new U(pD[0],4089235720),new U(pD[1],2227873595),new U(pD[2],4271175723),new U(pD[3],1595750129),new U(pD[4],2917565137),new U(pD[5],725511199),new U(pD[6],4215389547),new U(pD[7],327033209)]}function Q4(D,_){let u,F,B,E,C,$,q,X,G,Z,J,K,Q=[];for(u=_[0],F=_[1],B=_[2],E=_[3],C=_[4],$=_[5],q=_[6],X=_[7],J=0;J<80;J+=1)J<16?(K=2*J,Q[J]=new U(D[K],D[K+1])):Q[J]=zB(wB(Q[J-2]),Q[J-7],SB(Q[J-15]),Q[J-16]),G=YB(X,yB(C),(W=$,V=q,new U((M=C).N&W.N^~M.N&V.N,M.I&W.I^~M.I&V.I)),kB[J],Q[J]),Z=ND(PB(u),xB(u,F,B)),X=q,q=$,$=C,C=ND(E,G),E=B,B=F,F=u,u=ND(G,Z);var M,W,V;return _[0]=ND(u,_[0]),_[1]=ND(F,_[1]),_[2]=ND(B,_[2]),_[3]=ND(E,_[3]),_[4]=ND(C,_[4]),_[5]=ND($,_[5]),_[6]=ND(q,_[6]),_[7]=ND(X,_[7]),_}var vB=class extends E2{constructor(D,_,u){if(D!=="SHA-384"&&D!=="SHA-512")throw new Error(B2);super(D,_,u);let F=u||{};this.g=this.Y,this.M=!0,this.T=-1,this.C=w0(this.t,this.i,this.T),this.v=Q4,this.L=function(B){return B.slice()},this.B=J4,this.F=function(B,E,C,$){return function(q,X,G,Z,J){let K,Q,M=31+(X+129>>>10<<5),W=X+G;for(;q.length<=M;)q.push(0);for(q[X>>>5]|=128<<24-X%32,q[M]=4294967295&W,q[M-1]=W/F2|0,K=0;K<q.length;K+=32)Z=Q4(q.slice(K,K+32),Z);return Q=J==="SHA-384"?[Z[0].N,Z[0].I,Z[1].N,Z[1].I,Z[2].N,Z[2].I,Z[3].N,Z[3].I,Z[4].N,Z[4].I,Z[5].N,Z[5].I]:[Z[0].N,Z[0].I,Z[1].N,Z[1].I,Z[2].N,Z[2].I,Z[3].N,Z[3].I,Z[4].N,Z[4].I,Z[5].N,Z[5].I,Z[6].N,Z[6].I,Z[7].N,Z[7].I],Q}(B,E,C,$,D)},this.U=J4(D),this.m=1024,this.R=D==="SHA-384"?384:512,this.K=!1,F.hmacKey&&this.k(u0("hmacKey",F.hmacKey,this.T))}},bB=[new U(0,1),new U(0,32898),new U(2147483648,32906),new U(2147483648,2147516416),new U(0,32907),new U(0,2147483649),new U(2147483648,2147516545),new U(2147483648,32777),new U(0,138),new U(0,136),new U(0,2147516425),new U(0,2147483658),new U(0,2147516555),new U(2147483648,139),new U(2147483648,32905),new U(2147483648,32771),new U(2147483648,32770),new U(2147483648,128),new U(0,32778),new U(2147483648,2147483658),new U(2147483648,2147516545),new U(2147483648,32896),new U(0,2147483649),new U(2147483648,2147516424)],hB=[[0,36,3,41,18],[1,44,10,45,2],[62,6,43,15,61],[28,55,25,21,56],[27,20,39,8,14]];function b8(D){let _,u=[];for(_=0;_<5;_+=1)u[_]=[new U(0,0),new U(0,0),new U(0,0),new U(0,0),new U(0,0)];return u}function mB(D){let _,u=[];for(_=0;_<5;_+=1)u[_]=D[_].slice();return u}function B3(D,_){let u,F,B,E,C=[],$=[];if(D!==null)for(F=0;F<D.length;F+=2)_[(F>>>1)%5][(F>>>1)/5|0]=_2(_[(F>>>1)%5][(F>>>1)/5|0],new U(D[F+1],D[F]));for(u=0;u<24;u+=1){for(E=b8(),F=0;F<5;F+=1)C[F]=(q=_[F][0],X=_[F][1],G=_[F][2],Z=_[F][3],J=_[F][4],new U(q.N^X.N^G.N^Z.N^J.N,q.I^X.I^G.I^Z.I^J.I));for(F=0;F<5;F+=1)$[F]=_2(C[(F+4)%5],Z4(C[(F+1)%5],1));for(F=0;F<5;F+=1)for(B=0;B<5;B+=1)_[F][B]=_2(_[F][B],$[F]);for(F=0;F<5;F+=1)for(B=0;B<5;B+=1)E[B][(2*F+3*B)%5]=Z4(_[F][B],hB[F][B]);for(F=0;F<5;F+=1)for(B=0;B<5;B+=1)_[F][B]=_2(E[F][B],new U(~E[(F+1)%5][B].N&E[(F+2)%5][B].N,~E[(F+1)%5][B].I&E[(F+2)%5][B].I));_[0][0]=_2(_[0][0],bB[u])}var q,X,G,Z,J;return _}function L4(D){let _,u,F=0,B=[0,0],E=[4294967295&D,D/F2&2097151];for(_=6;_>=0;_--)u=E[_>>2]>>>8*_&255,u===0&&F===0||(B[F+1>>2]|=u<<8*(F+1),F+=1);return F=F!==0?F:1,B[0]|=F,{value:F+1>4?B:[B[0]],binLen:8+8*F}}function v8(D){return E3(L4(D.binLen),D)}function K4(D,_){let u,F=L4(_);F=E3(F,D);let B=_>>>2,E=(B-F.value.length%B)%B;for(u=0;u<E;u++)F.value.push(0);return F.value}var dB=class extends E2{constructor(D,_,u){let F=6,B=0;super(D,_,u);let E=u||{};if(this.numRounds!==1){if(E.kmacKey||E.hmacKey)throw new Error(U4);if(this.o==="CSHAKE128"||this.o==="CSHAKE256")throw new Error("Cannot set numRounds for CSHAKE variants")}switch(this.T=1,this.C=w0(this.t,this.i,this.T),this.v=B3,this.L=mB,this.B=b8,this.U=b8(),this.K=!1,D){case"SHA3-224":this.m=B=1152,this.R=224,this.M=!0,this.g=this.Y;break;case"SHA3-256":this.m=B=1088,this.R=256,this.M=!0,this.g=this.Y;break;case"SHA3-384":this.m=B=832,this.R=384,this.M=!0,this.g=this.Y;break;case"SHA3-512":this.m=B=576,this.R=512,this.M=!0,this.g=this.Y;break;case"SHAKE128":F=31,this.m=B=1344,this.R=-1,this.K=!0,this.M=!1,this.g=null;break;case"SHAKE256":F=31,this.m=B=1088,this.R=-1,this.K=!0,this.M=!1,this.g=null;break;case"KMAC128":F=4,this.m=B=1344,this.X(u),this.R=-1,this.K=!0,this.M=!1,this.g=this._;break;case"KMAC256":F=4,this.m=B=1088,this.X(u),this.R=-1,this.K=!0,this.M=!1,this.g=this._;break;case"CSHAKE128":this.m=B=1344,F=this.O(u),this.R=-1,this.K=!0,this.M=!1,this.g=null;break;case"CSHAKE256":this.m=B=1088,F=this.O(u),this.R=-1,this.K=!0,this.M=!1,this.g=null;break;default:throw new Error(B2)}this.F=function(C,$,q,X,G){return function(Z,J,K,Q,M,W,V){let L,T,S=0,j=[],v=M>>>5,DD=J>>>5;for(L=0;L<DD&&J>=M;L+=v)Q=B3(Z.slice(L,L+v),Q),J-=M;for(Z=Z.slice(L),J%=M;Z.length<v;)Z.push(0);for(L=J>>>3,Z[L>>2]^=W<<L%4*8,Z[v-1]^=2147483648,Q=B3(Z,Q);32*j.length<V&&(T=Q[S%5][S/5|0],j.push(T.I),!(32*j.length>=V));)j.push(T.N),S+=1,64*S%M==0&&(B3(null,Q),S=0);return j}(C,$,0,X,B,F,G)},E.hmacKey&&this.k(u0("hmacKey",E.hmacKey,this.T))}O(D,_){let u=function(B){let E=B||{};return{funcName:u0("funcName",E.funcName,1,{value:[],binLen:0}),customization:u0("Customization",E.customization,1,{value:[],binLen:0})}}(D||{});_&&(u.funcName=_);let F=E3(v8(u.funcName),v8(u.customization));if(u.customization.binLen!==0||u.funcName.binLen!==0){let B=K4(F,this.m>>>3);for(let E=0;E<B.length;E+=this.m>>>5)this.U=this.v(B.slice(E,E+(this.m>>>5)),this.U),this.A+=this.m;return 4}return 31}X(D){let _=function(F){let B=F||{};return{kmacKey:u0("kmacKey",B.kmacKey,1),funcName:{value:[1128353099],binLen:32},customization:u0("Customization",B.customization,1,{value:[],binLen:0})}}(D||{});this.O(D,_.funcName);let u=K4(v8(_.kmacKey),this.m>>>3);for(let F=0;F<u.length;F+=this.m>>>5)this.U=this.v(u.slice(F,F+(this.m>>>5)),this.U),this.A+=this.m;this.H=!0}_(D){let _=E3({value:this.h.slice(),binLen:this.u},function(u){let F,B,E=0,C=[0,0],$=[4294967295&u,u/F2&2097151];for(F=6;F>=0;F--)B=$[F>>2]>>>8*F&255,B===0&&E===0||(C[E>>2]|=B<<8*E,E+=1);return E=E!==0?E:1,C[E>>2]|=E<<8*E,{value:E+1>4?C:[C[0]],binLen:8+8*E}}(D.outputLen));return this.F(_.value,_.binLen,this.A,this.L(this.U),D.outputLen)}};class h8{constructor(D,_,u){if(D=="SHA-1")this.P=new jB(D,_,u);else if(D=="SHA-224"||D=="SHA-256")this.P=new OB(D,_,u);else if(D=="SHA-384"||D=="SHA-512")this.P=new vB(D,_,u);else{if(D!="SHA3-224"&&D!="SHA3-256"&&D!="SHA3-384"&&D!="SHA3-512"&&D!="SHAKE128"&&D!="SHAKE256"&&D!="CSHAKE128"&&D!="CSHAKE256"&&D!="KMAC128"&&D!="KMAC256")throw new Error(B2);this.P=new dB(D,_,u)}}update(D){return this.P.update(D),this}getHash(D,_){return this.P.getHash(D,_)}setHMACKey(D,_,u){this.P.setHMACKey(D,_,u)}getHMAC(D,_){return this.P.getHMAC(D,_)}}var G3=GD(Q8(),1);import{spawn as pB}from"node:child_process";import{release as d8}from"node:os";var I4=`<?xml version="1.0" encoding="UTF-8"?>
61
+ `,B)}while(F!==-1);return E+=D.slice(B),E}var{stdout:j6,stderr:O6}=R6,I8=Symbol("GENERATOR"),z0=Symbol("STYLER"),o0=Symbol("IS_EMPTY"),P6=["ansi","ansi","ansi256","ansi16m"],Y0=Object.create(null),x7=(D,_={})=>{if(_.level&&!(Number.isInteger(_.level)&&_.level>=0&&_.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let u=j6?j6.level:0;D.level=_.level===void 0?u:_.level};var S7=(D)=>{let _=(...u)=>u.join(" ");return x7(_,D),Object.setPrototypeOf(_,t0.prototype),_};function t0(D){return S7(D)}Object.setPrototypeOf(t0.prototype,Function.prototype);for(let[D,_]of Object.entries(LD))Y0[D]={get(){let u=d2(this,N8(_.open,_.close,this[z0]),this[o0]);return Object.defineProperty(this,D,{value:u}),u}};Y0.visible={get(){let D=d2(this,this[z0],!0);return Object.defineProperty(this,"visible",{value:D}),D}};var R8=(D,_,u,...F)=>{if(D==="rgb"){if(_==="ansi16m")return LD[u].ansi16m(...F);if(_==="ansi256")return LD[u].ansi256(LD.rgbToAnsi256(...F));return LD[u].ansi(LD.rgbToAnsi(...F))}if(D==="hex")return R8("rgb",_,u,...LD.hexToRgb(...F));return LD[u][D](...F)},y7=["rgb","hex","ansi256"];for(let D of y7){Y0[D]={get(){let{level:u}=this;return function(...F){let B=N8(R8(D,P6[u],"color",...F),LD.color.close,this[z0]);return d2(this,B,this[o0])}}};let _="bg"+D[0].toUpperCase()+D.slice(1);Y0[_]={get(){let{level:u}=this;return function(...F){let B=N8(R8(D,P6[u],"bgColor",...F),LD.bgColor.close,this[z0]);return d2(this,B,this[o0])}}}}var k7=Object.defineProperties(()=>{},{...Y0,level:{enumerable:!0,get(){return this[I8].level},set(D){this[I8].level=D}}}),N8=(D,_,u)=>{let F,B;if(u===void 0)F=D,B=_;else F=u.openAll+D,B=_+u.closeAll;return{open:D,close:_,openAll:F,closeAll:B,parent:u}},d2=(D,_,u)=>{let F=(...B)=>v7(F,B.length===1?""+B[0]:B.join(" "));return Object.setPrototypeOf(F,k7),F[I8]=D,F[z0]=_,F[o0]=u,F},v7=(D,_)=>{if(D.level<=0||!_)return D[o0]?"":_;let u=D[z0];if(u===void 0)return _;let{openAll:F,closeAll:B}=u;if(_.includes("\x1B"))while(u!==void 0)_=N6(_,u.close,u.open),u=u.parent;let E=_.indexOf(`
62
+ `);if(E!==-1)_=T6(_,B,F,E);return F+_+B};Object.defineProperties(t0.prototype,Y0);var b7=t0(),D$=t0({level:O6?O6.level:0});var O=b7;var B5=x(require("fs")),E5=x(F5());function Gu(D){if(D<1024)return`${D} B`;else if(D<1048576)return`${(D/1024).toFixed(2)} KB`;else if(D<1073741824)return`${(D/1048576).toFixed(2)} MB`;else return`${(D/1073741824).toFixed(2)} GB`}class w8{maxParallel;queue;activeDownloads;progressBar;totalTasks=0;completedTasks=0;speedUpdateInterval;extra;downloadedSize=0;startTime=0;constructor(D,_){this.extra=_,this.maxParallel=D,this.queue=[],this.activeDownloads=new Map,this.startTime=Date.now(),this.progressBar=new E5.SingleBar({format(u,F,B){let E=u.barCompleteChar.repeat(B.finishedPercent*20)+u.barIncompleteChar.repeat((1-B.finishedPercent)*20);return`${B.title} | ${E} | ${(B.finishedPercent*100).toFixed(1)}% | ${B.completed}/${B.totalTasks} | ${B.speed}`+(_?.totalSize?` | tot:${Gu(_?.totalSize)} | eta:${B.calcEta.toFixed(1)}s`:"")},barCompleteChar:"█",barIncompleteChar:"░",hideCursor:!0}),this.speedUpdateInterval=setInterval(()=>this.updateProgress(),100)}addTask(D){if(this.queue.push(D),this.totalTasks++,!this.progressBar.isActive)this.progressBar.start(this.totalTasks,0,{title:"Waiting...",speed:"0.00 B/s",completed:0,totalTasks:this.totalTasks,finishedPercent:0,calcEta:1/0});this.processQueue()}processQueue(){while(this.activeDownloads.size<this.maxParallel&&this.queue.length>0){let D=this.queue.shift();this.activeDownloads.set(D.filename,0),this.downloadFile(D)}}formatSpeed(D){let _=["B/s","KB/s","MB/s","GB/s"],u=D,F=0;while(u>=1024&&F<_.length-1)u/=1024,F++;return`${u.toFixed(2)} ${_[F]}`}updateProgress(D=!1){let _=Array.from(this.activeDownloads.keys()),u=this.downloadedSize/((Date.now()-this.startTime)/1000);this.progressBar.update(this.completedTasks,{title:D?O.green("Done"):_.length>0?`Downloading: (${_.length} active)`:"Preparing...",speed:this.formatSpeed(u),completed:this.completedTasks,totalTasks:this.totalTasks,finishedPercent:this.extra?.totalSize?this.downloadedSize/this.extra.totalSize:this.completedTasks/this.totalTasks,calcEta:this.extra?.totalSize?(this.extra.totalSize-this.downloadedSize)/u:0})}async downloadFile(D){try{let _=await fetch(D.url);if(!_.ok)throw new Error(`HTTP ${_.status}`);let u=B5.createWriteStream(D.filename);u.on("error",(C)=>{throw C});let F=_.body?.getReader();if(!F)throw new Error("No readable stream");let B=0,E=Date.now();while(!0){let{done:C,value:$}=await F.read();if(C)break;u.write($),B+=$.length,this.downloadedSize+=$.length;let q=(Date.now()-E)/1000+0.01;this.activeDownloads.set(D.filename,q>0?B/q:0)}u.end(),this.completedTasks++}catch(_){if((D.retries||20)>0)console.error(`♻️❌ ${D.filename}(retrying): ${_.message}`),await new Promise((u)=>setTimeout(u,3000)),this.queue.push({...D,retries:D.retries-1});else throw console.error(`❌⚙️ ${D.filename}(FAILED!): ${_.message}`),_}finally{this.activeDownloads.delete(D.filename),this.processQueue()}}async wait(){this.startTime=Date.now();while(this.activeDownloads.size>0||this.queue.length>0)await new Promise((D)=>setTimeout(D,100));this.updateProgress(!0),clearInterval(this.speedUpdateInterval),this.progressBar.stop()}}var f2={official:{launcher:"https://launcher.mojang.com",launchermeta:"https://launchermeta.mojang.com",pistonmeta:"https://piston-meta.mojang.com",resources:"http://resources.download.minecraft.net",libraries:"https://libraries.minecraft.net"},bmclapi:{launcher:"https://bmclapi2.bangbang93.com",launchermeta:"https://bmclapi2.bangbang93.com",pistonmeta:"https://bmclapi2.bangbang93.com",resources:"http://bmclapi2.bangbang93.com/assets",libraries:"https://bmclapi2.bangbang93.com/maven"}};function qu(D,_,u){return D.replace(f2.official[u],f2[_][u])}function w0(D){for(let _ of Object.keys(f2.official))if(D.startsWith(f2.official[_]))return qu(D,r.get("mirror"),_);return D}var f=x(require("node:fs")),C0=x(require("node:path"));var C5={selectedProfile:"(Default)",profiles:{"(Default)":{name:"(Default)"}},clientToken:"88888888-8888-8888-8888-888888888888"};var e0=x(require("node:os")),X5=x(require("node:path")),Z5=x(x8());function J5(D){if(!D||D.length===0||D.length>255)return!1;if(D==="."||D==="..")return!1;if(D.includes("/")||D.includes("\\"))return!1;if(/[<>:"|?*\u0000-\u001F]/gu.test(D))return!1;if(/\.\./gu.test(D))return!1;if(/[\s.]$/u.test(D))return!1;if(/[\p{C}]/gu.test(D))return!1;return/^[^\s.]/u.test(D)&&D.trim()===D}function JD(D){if(D.startsWith("~/"))return X5.join(e0.homedir(),D.slice(2));return D}function x0(){if(e0.platform()==="win32")return"windows";else if(e0.platform()==="darwin")return"osx";else return"linux"}function Q5(){let D=Z5.default();if(D==="x64")return"";else return"-"+D}function c2(D,_={}){for(let u of D){let F=!0;if(u.os){let B=u.os,E=_.os||{};if(B.name&&E.name!==B.name)F=!1;if(B.version){if(!new RegExp(B.version).test(E.version||""))F=!1}if(B.arch&&E.arch!==B.arch)F=!1}if(u.features){let B=u.features;for(let[E,C]of Object.entries(B))if(_[E]!==C){F=!1;break}}if(F)return u.action==="allow"}return!1}var i4=x(A4());function V4(D,_,u,F){let B,E,C,$=_||[0],q=(u=u||0)>>>3,X=F===-1?3:0;for(B=0;B<D.length;B+=1)C=B+q,E=C>>>2,$.length<=E&&$.push(0),$[E]|=D[B]<<8*(X+F*(C%4));return{value:$,binLen:8*D.length+u}}function b0(D,_,u){switch(_){case"UTF8":case"UTF16BE":case"UTF16LE":break;default:throw new Error("encoding must be UTF8, UTF16BE, or UTF16LE")}switch(D){case"HEX":return function(F,B,E){return function(C,$,q,X){let G,Z,J,K;if(C.length%2!=0)throw new Error("String of HEX type must be in byte increments");let Q=$||[0],M=(q=q||0)>>>3,W=X===-1?3:0;for(G=0;G<C.length;G+=2){if(Z=parseInt(C.substr(G,2),16),isNaN(Z))throw new Error("String of HEX type contains invalid characters");for(K=(G>>>1)+M,J=K>>>2;Q.length<=J;)Q.push(0);Q[J]|=Z<<8*(W+X*(K%4))}return{value:Q,binLen:4*C.length+q}}(F,B,E,u)};case"TEXT":return function(F,B,E){return function(C,$,q,X,G){let Z,J,K,Q,M,W,V,L,T=0,S=q||[0],j=(X=X||0)>>>3;if($==="UTF8")for(V=G===-1?3:0,K=0;K<C.length;K+=1)for(Z=C.charCodeAt(K),J=[],128>Z?J.push(Z):2048>Z?(J.push(192|Z>>>6),J.push(128|63&Z)):55296>Z||57344<=Z?J.push(224|Z>>>12,128|Z>>>6&63,128|63&Z):(K+=1,Z=65536+((1023&Z)<<10|1023&C.charCodeAt(K)),J.push(240|Z>>>18,128|Z>>>12&63,128|Z>>>6&63,128|63&Z)),Q=0;Q<J.length;Q+=1){for(W=T+j,M=W>>>2;S.length<=M;)S.push(0);S[M]|=J[Q]<<8*(V+G*(W%4)),T+=1}else for(V=G===-1?2:0,L=$==="UTF16LE"&&G!==1||$!=="UTF16LE"&&G===1,K=0;K<C.length;K+=1){for(Z=C.charCodeAt(K),L===!0&&(Q=255&Z,Z=Q<<8|Z>>>8),W=T+j,M=W>>>2;S.length<=M;)S.push(0);S[M]|=Z<<8*(V+G*(W%4)),T+=2}return{value:S,binLen:8*T+X}}(F,_,B,E,u)};case"B64":return function(F,B,E){return function(C,$,q,X){let G,Z,J,K,Q,M,W,V=0,L=$||[0],T=(q=q||0)>>>3,S=X===-1?3:0,j=C.indexOf("=");if(C.search(/^[a-zA-Z0-9=+/]+$/)===-1)throw new Error("Invalid character in base-64 string");if(C=C.replace(/=/g,""),j!==-1&&j<C.length)throw new Error("Invalid '=' found in base-64 string");for(Z=0;Z<C.length;Z+=4){for(Q=C.substr(Z,4),K=0,J=0;J<Q.length;J+=1)G="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(Q.charAt(J)),K|=G<<18-6*J;for(J=0;J<Q.length-1;J+=1){for(W=V+T,M=W>>>2;L.length<=M;)L.push(0);L[M]|=(K>>>16-8*J&255)<<8*(S+X*(W%4)),V+=1}}return{value:L,binLen:8*V+q}}(F,B,E,u)};case"BYTES":return function(F,B,E){return function(C,$,q,X){let G,Z,J,K,Q=$||[0],M=(q=q||0)>>>3,W=X===-1?3:0;for(Z=0;Z<C.length;Z+=1)G=C.charCodeAt(Z),K=Z+M,J=K>>>2,Q.length<=J&&Q.push(0),Q[J]|=G<<8*(W+X*(K%4));return{value:Q,binLen:8*C.length+q}}(F,B,E,u)};case"ARRAYBUFFER":try{new ArrayBuffer(0)}catch(F){throw new Error("ARRAYBUFFER not supported by this environment")}return function(F,B,E){return function(C,$,q,X){return V4(new Uint8Array(C),$,q,X)}(F,B,E,u)};case"UINT8ARRAY":try{new Uint8Array(0)}catch(F){throw new Error("UINT8ARRAY not supported by this environment")}return function(F,B,E){return V4(F,B,E,u)};default:throw new Error("format must be HEX, TEXT, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}}function L4(D,_,u,F){switch(D){case"HEX":return function(B){return function(E,C,$,q){let G,Z,J="",K=C/8,Q=$===-1?3:0;for(G=0;G<K;G+=1)Z=E[G>>>2]>>>8*(Q+$*(G%4)),J+="0123456789abcdef".charAt(Z>>>4&15)+"0123456789abcdef".charAt(15&Z);return q.outputUpper?J.toUpperCase():J}(B,_,u,F)};case"B64":return function(B){return function(E,C,$,q){let X,G,Z,J,K,Q="",M=C/8,W=$===-1?3:0;for(X=0;X<M;X+=3)for(J=X+1<M?E[X+1>>>2]:0,K=X+2<M?E[X+2>>>2]:0,Z=(E[X>>>2]>>>8*(W+$*(X%4))&255)<<16|(J>>>8*(W+$*((X+1)%4))&255)<<8|K>>>8*(W+$*((X+2)%4))&255,G=0;G<4;G+=1)Q+=8*X+6*G<=C?"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(Z>>>6*(3-G)&63):q.b64Pad;return Q}(B,_,u,F)};case"BYTES":return function(B){return function(E,C,$){let q,X,G="",Z=C/8,J=$===-1?3:0;for(q=0;q<Z;q+=1)X=E[q>>>2]>>>8*(J+$*(q%4))&255,G+=String.fromCharCode(X);return G}(B,_,u)};case"ARRAYBUFFER":try{new ArrayBuffer(0)}catch(B){throw new Error("ARRAYBUFFER not supported by this environment")}return function(B){return function(E,C,$){let q,X=C/8,G=new ArrayBuffer(X),Z=new Uint8Array(G),J=$===-1?3:0;for(q=0;q<X;q+=1)Z[q]=E[q>>>2]>>>8*(J+$*(q%4))&255;return G}(B,_,u)};case"UINT8ARRAY":try{new Uint8Array(0)}catch(B){throw new Error("UINT8ARRAY not supported by this environment")}return function(B){return function(E,C,$){let q,X=C/8,G=$===-1?3:0,Z=new Uint8Array(X);for(q=0;q<X;q+=1)Z[q]=E[q>>>2]>>>8*(G+$*(q%4))&255;return Z}(B,_,u)};default:throw new Error("format must be HEX, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}}var q2=4294967296,I=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],lD=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428],iD=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],X2="Chosen SHA variant is not supported",Y4="Cannot set numRounds with MAC";function U3(D,_){let u,F,B=D.binLen>>>3,E=_.binLen>>>3,C=B<<3,$=4-B<<3;if(B%4!=0){for(u=0;u<E;u+=4)F=B+u>>>2,D.value[F]|=_.value[u>>>2]<<C,D.value.push(0),D.value[F+1]|=_.value[u>>>2]>>>$;return(D.value.length<<2)-4>=E+B&&D.value.pop(),{value:D.value,binLen:D.binLen+_.binLen}}return{value:D.value.concat(_.value),binLen:D.binLen+_.binLen}}function I4(D){let _={outputUpper:!1,b64Pad:"=",outputLen:-1},u=D||{};if(_.outputUpper=u.outputUpper||!1,u.b64Pad&&(_.b64Pad=u.b64Pad),u.outputLen){if(u.outputLen%8!=0)throw new Error("Output length must be a multiple of 8");_.outputLen=u.outputLen}else if(u.shakeLen){if(u.shakeLen%8!=0)throw new Error("Output length must be a multiple of 8");_.outputLen=u.shakeLen}if(typeof _.outputUpper!="boolean")throw new Error("Invalid outputUpper formatting option");if(typeof _.b64Pad!="string")throw new Error("Invalid b64Pad formatting option");return _}function E0(D,_,u,F){let B=D+" must include a value and format";if(!_){if(!F)throw new Error(B);return F}if(_.value===void 0||!_.format)throw new Error(B);return b0(_.format,_.encoding||"UTF8",u)(_.value)}class Z2{constructor(D,_,u){let F=u||{};if(this.t=_,this.i=F.encoding||"UTF8",this.numRounds=F.numRounds||1,isNaN(this.numRounds)||this.numRounds!==parseInt(this.numRounds,10)||1>this.numRounds)throw new Error("numRounds must a integer >= 1");this.o=D,this.h=[],this.u=0,this.l=!1,this.A=0,this.H=!1,this.S=[],this.p=[]}update(D){let _,u=0,F=this.m>>>5,B=this.C(D,this.h,this.u),E=B.binLen,C=B.value,$=E>>>5;for(_=0;_<$;_+=F)u+this.m<=E&&(this.U=this.v(C.slice(_,_+F),this.U),u+=this.m);return this.A+=u,this.h=C.slice(u>>>5),this.u=E%this.m,this.l=!0,this}getHash(D,_){let u,F,B=this.R,E=I4(_);if(this.K){if(E.outputLen===-1)throw new Error("Output length must be specified in options");B=E.outputLen}let C=L4(D,B,this.T,E);if(this.H&&this.g)return C(this.g(E));for(F=this.F(this.h.slice(),this.u,this.A,this.L(this.U),B),u=1;u<this.numRounds;u+=1)this.K&&B%32!=0&&(F[F.length-1]&=16777215>>>24-B%32),F=this.F(F,B,0,this.B(this.o),B);return C(F)}setHMACKey(D,_,u){if(!this.M)throw new Error("Variant does not support HMAC");if(this.l)throw new Error("Cannot set MAC key after calling update");let F=b0(_,(u||{}).encoding||"UTF8",this.T);this.k(F(D))}k(D){let _=this.m>>>3,u=_/4-1,F;if(this.numRounds!==1)throw new Error(Y4);if(this.H)throw new Error("MAC key already set");for(_<D.binLen/8&&(D.value=this.F(D.value,D.binLen,0,this.B(this.o),this.R));D.value.length<=u;)D.value.push(0);for(F=0;F<=u;F+=1)this.S[F]=909522486^D.value[F],this.p[F]=1549556828^D.value[F];this.U=this.v(this.S,this.U),this.A=this.m,this.H=!0}getHMAC(D,_){let u=I4(_);return L4(D,this.R,this.T,u)(this.Y())}Y(){let D;if(!this.H)throw new Error("Cannot call getHMAC without first setting MAC key");let _=this.F(this.h.slice(),this.u,this.A,this.L(this.U),this.R);return D=this.v(this.p,this.B(this.o)),D=this.F(_,this.R,this.m,D,this.R),D}}function v0(D,_){return D<<_|D>>>32-_}function xD(D,_){return D>>>_|D<<32-_}function w4(D,_){return D>>>_}function R4(D,_,u){return D^_^u}function x4(D,_,u){return D&_^~D&u}function S4(D,_,u){return D&_^D&u^_&u}function XF(D){return xD(D,2)^xD(D,13)^xD(D,22)}function $D(D,_){let u=(65535&D)+(65535&_);return(65535&(D>>>16)+(_>>>16)+(u>>>16))<<16|65535&u}function ZF(D,_,u,F){let B=(65535&D)+(65535&_)+(65535&u)+(65535&F);return(65535&(D>>>16)+(_>>>16)+(u>>>16)+(F>>>16)+(B>>>16))<<16|65535&B}function G2(D,_,u,F,B){let E=(65535&D)+(65535&_)+(65535&u)+(65535&F)+(65535&B);return(65535&(D>>>16)+(_>>>16)+(u>>>16)+(F>>>16)+(B>>>16)+(E>>>16))<<16|65535&E}function JF(D){return xD(D,7)^xD(D,18)^w4(D,3)}function QF(D){return xD(D,6)^xD(D,11)^xD(D,25)}function KF(D){return[1732584193,4023233417,2562383102,271733878,3285377520]}function y4(D,_){let u,F,B,E,C,$,q,X=[];for(u=_[0],F=_[1],B=_[2],E=_[3],C=_[4],q=0;q<80;q+=1)X[q]=q<16?D[q]:v0(X[q-3]^X[q-8]^X[q-14]^X[q-16],1),$=q<20?G2(v0(u,5),x4(F,B,E),C,1518500249,X[q]):q<40?G2(v0(u,5),R4(F,B,E),C,1859775393,X[q]):q<60?G2(v0(u,5),S4(F,B,E),C,2400959708,X[q]):G2(v0(u,5),R4(F,B,E),C,3395469782,X[q]),C=E,E=B,B=v0(F,30),F=u,u=$;return _[0]=$D(u,_[0]),_[1]=$D(F,_[1]),_[2]=$D(B,_[2]),_[3]=$D(E,_[3]),_[4]=$D(C,_[4]),_}function UF(D,_,u,F){let B,E=15+(_+65>>>9<<4),C=_+u;for(;D.length<=E;)D.push(0);for(D[_>>>5]|=128<<24-_%32,D[E]=4294967295&C,D[E-1]=C/q2|0,B=0;B<D.length;B+=16)F=y4(D.slice(B,B+16),F);return F}var HF=class extends Z2{constructor(D,_,u){if(D!=="SHA-1")throw new Error(X2);super(D,_,u);let F=u||{};this.M=!0,this.g=this.Y,this.T=-1,this.C=b0(this.t,this.i,this.T),this.v=y4,this.L=function(B){return B.slice()},this.B=KF,this.F=UF,this.U=[1732584193,4023233417,2562383102,271733878,3285377520],this.m=512,this.R=160,this.K=!1,F.hmacKey&&this.k(E0("hmacKey",F.hmacKey,this.T))}};function N4(D){let _;return _=D=="SHA-224"?lD.slice():iD.slice(),_}function T4(D,_){let u,F,B,E,C,$,q,X,G,Z,J,K=[];for(u=_[0],F=_[1],B=_[2],E=_[3],C=_[4],$=_[5],q=_[6],X=_[7],J=0;J<64;J+=1)K[J]=J<16?D[J]:ZF(xD(Q=K[J-2],17)^xD(Q,19)^w4(Q,10),K[J-7],JF(K[J-15]),K[J-16]),G=G2(X,QF(C),x4(C,$,q),I[J],K[J]),Z=$D(XF(u),S4(u,F,B)),X=q,q=$,$=C,C=$D(E,G),E=B,B=F,F=u,u=$D(G,Z);var Q;return _[0]=$D(u,_[0]),_[1]=$D(F,_[1]),_[2]=$D(B,_[2]),_[3]=$D(E,_[3]),_[4]=$D(C,_[4]),_[5]=$D($,_[5]),_[6]=$D(q,_[6]),_[7]=$D(X,_[7]),_}var MF=class extends Z2{constructor(D,_,u){if(D!=="SHA-224"&&D!=="SHA-256")throw new Error(X2);super(D,_,u);let F=u||{};this.g=this.Y,this.M=!0,this.T=-1,this.C=b0(this.t,this.i,this.T),this.v=T4,this.L=function(B){return B.slice()},this.B=N4,this.F=function(B,E,C,$){return function(q,X,G,Z,J){let K,Q,M=15+(X+65>>>9<<4),W=X+G;for(;q.length<=M;)q.push(0);for(q[X>>>5]|=128<<24-X%32,q[M]=4294967295&W,q[M-1]=W/q2|0,K=0;K<q.length;K+=16)Z=T4(q.slice(K,K+16),Z);return Q=J==="SHA-224"?[Z[0],Z[1],Z[2],Z[3],Z[4],Z[5],Z[6]]:Z,Q}(B,E,C,$,D)},this.U=N4(D),this.m=512,this.R=D==="SHA-224"?224:256,this.K=!1,F.hmacKey&&this.k(E0("hmacKey",F.hmacKey,this.T))}};class U{constructor(D,_){this.N=D,this.I=_}}function j4(D,_){let u;return _>32?(u=64-_,new U(D.I<<_|D.N>>>u,D.N<<_|D.I>>>u)):_!==0?(u=32-_,new U(D.N<<_|D.I>>>u,D.I<<_|D.N>>>u)):D}function SD(D,_){let u;return _<32?(u=32-_,new U(D.N>>>_|D.I<<u,D.I>>>_|D.N<<u)):(u=64-_,new U(D.I>>>_|D.N<<u,D.N>>>_|D.I<<u))}function k4(D,_){return new U(D.N>>>_,D.I>>>_|D.N<<32-_)}function WF(D,_,u){return new U(D.N&_.N^D.N&u.N^_.N&u.N,D.I&_.I^D.I&u.I^_.I&u.I)}function AF(D){let _=SD(D,28),u=SD(D,34),F=SD(D,39);return new U(_.N^u.N^F.N,_.I^u.I^F.I)}function OD(D,_){let u,F;u=(65535&D.I)+(65535&_.I),F=(D.I>>>16)+(_.I>>>16)+(u>>>16);let B=(65535&F)<<16|65535&u;return u=(65535&D.N)+(65535&_.N)+(F>>>16),F=(D.N>>>16)+(_.N>>>16)+(u>>>16),new U((65535&F)<<16|65535&u,B)}function VF(D,_,u,F){let B,E;B=(65535&D.I)+(65535&_.I)+(65535&u.I)+(65535&F.I),E=(D.I>>>16)+(_.I>>>16)+(u.I>>>16)+(F.I>>>16)+(B>>>16);let C=(65535&E)<<16|65535&B;return B=(65535&D.N)+(65535&_.N)+(65535&u.N)+(65535&F.N)+(E>>>16),E=(D.N>>>16)+(_.N>>>16)+(u.N>>>16)+(F.N>>>16)+(B>>>16),new U((65535&E)<<16|65535&B,C)}function LF(D,_,u,F,B){let E,C;E=(65535&D.I)+(65535&_.I)+(65535&u.I)+(65535&F.I)+(65535&B.I),C=(D.I>>>16)+(_.I>>>16)+(u.I>>>16)+(F.I>>>16)+(B.I>>>16)+(E>>>16);let $=(65535&C)<<16|65535&E;return E=(65535&D.N)+(65535&_.N)+(65535&u.N)+(65535&F.N)+(65535&B.N)+(C>>>16),C=(D.N>>>16)+(_.N>>>16)+(u.N>>>16)+(F.N>>>16)+(B.N>>>16)+(E>>>16),new U((65535&C)<<16|65535&E,$)}function $2(D,_){return new U(D.N^_.N,D.I^_.I)}function IF(D){let _=SD(D,19),u=SD(D,61),F=k4(D,6);return new U(_.N^u.N^F.N,_.I^u.I^F.I)}function RF(D){let _=SD(D,1),u=SD(D,8),F=k4(D,7);return new U(_.N^u.N^F.N,_.I^u.I^F.I)}function NF(D){let _=SD(D,14),u=SD(D,18),F=SD(D,41);return new U(_.N^u.N^F.N,_.I^u.I^F.I)}var TF=[new U(I[0],3609767458),new U(I[1],602891725),new U(I[2],3964484399),new U(I[3],2173295548),new U(I[4],4081628472),new U(I[5],3053834265),new U(I[6],2937671579),new U(I[7],3664609560),new U(I[8],2734883394),new U(I[9],1164996542),new U(I[10],1323610764),new U(I[11],3590304994),new U(I[12],4068182383),new U(I[13],991336113),new U(I[14],633803317),new U(I[15],3479774868),new U(I[16],2666613458),new U(I[17],944711139),new U(I[18],2341262773),new U(I[19],2007800933),new U(I[20],1495990901),new U(I[21],1856431235),new U(I[22],3175218132),new U(I[23],2198950837),new U(I[24],3999719339),new U(I[25],766784016),new U(I[26],2566594879),new U(I[27],3203337956),new U(I[28],1034457026),new U(I[29],2466948901),new U(I[30],3758326383),new U(I[31],168717936),new U(I[32],1188179964),new U(I[33],1546045734),new U(I[34],1522805485),new U(I[35],2643833823),new U(I[36],2343527390),new U(I[37],1014477480),new U(I[38],1206759142),new U(I[39],344077627),new U(I[40],1290863460),new U(I[41],3158454273),new U(I[42],3505952657),new U(I[43],106217008),new U(I[44],3606008344),new U(I[45],1432725776),new U(I[46],1467031594),new U(I[47],851169720),new U(I[48],3100823752),new U(I[49],1363258195),new U(I[50],3750685593),new U(I[51],3785050280),new U(I[52],3318307427),new U(I[53],3812723403),new U(I[54],2003034995),new U(I[55],3602036899),new U(I[56],1575990012),new U(I[57],1125592928),new U(I[58],2716904306),new U(I[59],442776044),new U(I[60],593698344),new U(I[61],3733110249),new U(I[62],2999351573),new U(I[63],3815920427),new U(3391569614,3928383900),new U(3515267271,566280711),new U(3940187606,3454069534),new U(4118630271,4000239992),new U(116418474,1914138554),new U(174292421,2731055270),new U(289380356,3203993006),new U(460393269,320620315),new U(685471733,587496836),new U(852142971,1086792851),new U(1017036298,365543100),new U(1126000580,2618297676),new U(1288033470,3409855158),new U(1501505948,4234509866),new U(1607167915,987167468),new U(1816402316,1246189591)];function O4(D){return D==="SHA-384"?[new U(3418070365,lD[0]),new U(1654270250,lD[1]),new U(2438529370,lD[2]),new U(355462360,lD[3]),new U(1731405415,lD[4]),new U(41048885895,lD[5]),new U(3675008525,lD[6]),new U(1203062813,lD[7])]:[new U(iD[0],4089235720),new U(iD[1],2227873595),new U(iD[2],4271175723),new U(iD[3],1595750129),new U(iD[4],2917565137),new U(iD[5],725511199),new U(iD[6],4215389547),new U(iD[7],327033209)]}function P4(D,_){let u,F,B,E,C,$,q,X,G,Z,J,K,Q=[];for(u=_[0],F=_[1],B=_[2],E=_[3],C=_[4],$=_[5],q=_[6],X=_[7],J=0;J<80;J+=1)J<16?(K=2*J,Q[J]=new U(D[K],D[K+1])):Q[J]=VF(IF(Q[J-2]),Q[J-7],RF(Q[J-15]),Q[J-16]),G=LF(X,NF(C),(W=$,V=q,new U((M=C).N&W.N^~M.N&V.N,M.I&W.I^~M.I&V.I)),TF[J],Q[J]),Z=OD(AF(u),WF(u,F,B)),X=q,q=$,$=C,C=OD(E,G),E=B,B=F,F=u,u=OD(G,Z);var M,W,V;return _[0]=OD(u,_[0]),_[1]=OD(F,_[1]),_[2]=OD(B,_[2]),_[3]=OD(E,_[3]),_[4]=OD(C,_[4]),_[5]=OD($,_[5]),_[6]=OD(q,_[6]),_[7]=OD(X,_[7]),_}var jF=class extends Z2{constructor(D,_,u){if(D!=="SHA-384"&&D!=="SHA-512")throw new Error(X2);super(D,_,u);let F=u||{};this.g=this.Y,this.M=!0,this.T=-1,this.C=b0(this.t,this.i,this.T),this.v=P4,this.L=function(B){return B.slice()},this.B=O4,this.F=function(B,E,C,$){return function(q,X,G,Z,J){let K,Q,M=31+(X+129>>>10<<5),W=X+G;for(;q.length<=M;)q.push(0);for(q[X>>>5]|=128<<24-X%32,q[M]=4294967295&W,q[M-1]=W/q2|0,K=0;K<q.length;K+=32)Z=P4(q.slice(K,K+32),Z);return Q=J==="SHA-384"?[Z[0].N,Z[0].I,Z[1].N,Z[1].I,Z[2].N,Z[2].I,Z[3].N,Z[3].I,Z[4].N,Z[4].I,Z[5].N,Z[5].I]:[Z[0].N,Z[0].I,Z[1].N,Z[1].I,Z[2].N,Z[2].I,Z[3].N,Z[3].I,Z[4].N,Z[4].I,Z[5].N,Z[5].I,Z[6].N,Z[6].I,Z[7].N,Z[7].I],Q}(B,E,C,$,D)},this.U=O4(D),this.m=1024,this.R=D==="SHA-384"?384:512,this.K=!1,F.hmacKey&&this.k(E0("hmacKey",F.hmacKey,this.T))}},OF=[new U(0,1),new U(0,32898),new U(2147483648,32906),new U(2147483648,2147516416),new U(0,32907),new U(0,2147483649),new U(2147483648,2147516545),new U(2147483648,32777),new U(0,138),new U(0,136),new U(0,2147516425),new U(0,2147483658),new U(0,2147516555),new U(2147483648,139),new U(2147483648,32905),new U(2147483648,32771),new U(2147483648,32770),new U(2147483648,128),new U(0,32778),new U(2147483648,2147483658),new U(2147483648,2147516545),new U(2147483648,32896),new U(0,2147483649),new U(2147483648,2147516424)],PF=[[0,36,3,41,18],[1,44,10,45,2],[62,6,43,15,61],[28,55,25,21,56],[27,20,39,8,14]];function F1(D){let _,u=[];for(_=0;_<5;_+=1)u[_]=[new U(0,0),new U(0,0),new U(0,0),new U(0,0),new U(0,0)];return u}function zF(D){let _,u=[];for(_=0;_<5;_+=1)u[_]=D[_].slice();return u}function K3(D,_){let u,F,B,E,C=[],$=[];if(D!==null)for(F=0;F<D.length;F+=2)_[(F>>>1)%5][(F>>>1)/5|0]=$2(_[(F>>>1)%5][(F>>>1)/5|0],new U(D[F+1],D[F]));for(u=0;u<24;u+=1){for(E=F1(),F=0;F<5;F+=1)C[F]=(q=_[F][0],X=_[F][1],G=_[F][2],Z=_[F][3],J=_[F][4],new U(q.N^X.N^G.N^Z.N^J.N,q.I^X.I^G.I^Z.I^J.I));for(F=0;F<5;F+=1)$[F]=$2(C[(F+4)%5],j4(C[(F+1)%5],1));for(F=0;F<5;F+=1)for(B=0;B<5;B+=1)_[F][B]=$2(_[F][B],$[F]);for(F=0;F<5;F+=1)for(B=0;B<5;B+=1)E[B][(2*F+3*B)%5]=j4(_[F][B],PF[F][B]);for(F=0;F<5;F+=1)for(B=0;B<5;B+=1)_[F][B]=$2(E[F][B],new U(~E[(F+1)%5][B].N&E[(F+2)%5][B].N,~E[(F+1)%5][B].I&E[(F+2)%5][B].I));_[0][0]=$2(_[0][0],OF[u])}var q,X,G,Z,J;return _}function v4(D){let _,u,F=0,B=[0,0],E=[4294967295&D,D/q2&2097151];for(_=6;_>=0;_--)u=E[_>>2]>>>8*_&255,u===0&&F===0||(B[F+1>>2]|=u<<8*(F+1),F+=1);return F=F!==0?F:1,B[0]|=F,{value:F+1>4?B:[B[0]],binLen:8+8*F}}function u1(D){return U3(v4(D.binLen),D)}function z4(D,_){let u,F=v4(_);F=U3(F,D);let B=_>>>2,E=(B-F.value.length%B)%B;for(u=0;u<E;u++)F.value.push(0);return F.value}var YF=class extends Z2{constructor(D,_,u){let F=6,B=0;super(D,_,u);let E=u||{};if(this.numRounds!==1){if(E.kmacKey||E.hmacKey)throw new Error(Y4);if(this.o==="CSHAKE128"||this.o==="CSHAKE256")throw new Error("Cannot set numRounds for CSHAKE variants")}switch(this.T=1,this.C=b0(this.t,this.i,this.T),this.v=K3,this.L=zF,this.B=F1,this.U=F1(),this.K=!1,D){case"SHA3-224":this.m=B=1152,this.R=224,this.M=!0,this.g=this.Y;break;case"SHA3-256":this.m=B=1088,this.R=256,this.M=!0,this.g=this.Y;break;case"SHA3-384":this.m=B=832,this.R=384,this.M=!0,this.g=this.Y;break;case"SHA3-512":this.m=B=576,this.R=512,this.M=!0,this.g=this.Y;break;case"SHAKE128":F=31,this.m=B=1344,this.R=-1,this.K=!0,this.M=!1,this.g=null;break;case"SHAKE256":F=31,this.m=B=1088,this.R=-1,this.K=!0,this.M=!1,this.g=null;break;case"KMAC128":F=4,this.m=B=1344,this.X(u),this.R=-1,this.K=!0,this.M=!1,this.g=this._;break;case"KMAC256":F=4,this.m=B=1088,this.X(u),this.R=-1,this.K=!0,this.M=!1,this.g=this._;break;case"CSHAKE128":this.m=B=1344,F=this.O(u),this.R=-1,this.K=!0,this.M=!1,this.g=null;break;case"CSHAKE256":this.m=B=1088,F=this.O(u),this.R=-1,this.K=!0,this.M=!1,this.g=null;break;default:throw new Error(X2)}this.F=function(C,$,q,X,G){return function(Z,J,K,Q,M,W,V){let L,T,S=0,j=[],v=M>>>5,DD=J>>>5;for(L=0;L<DD&&J>=M;L+=v)Q=K3(Z.slice(L,L+v),Q),J-=M;for(Z=Z.slice(L),J%=M;Z.length<v;)Z.push(0);for(L=J>>>3,Z[L>>2]^=W<<L%4*8,Z[v-1]^=2147483648,Q=K3(Z,Q);32*j.length<V&&(T=Q[S%5][S/5|0],j.push(T.I),!(32*j.length>=V));)j.push(T.N),S+=1,64*S%M==0&&(K3(null,Q),S=0);return j}(C,$,0,X,B,F,G)},E.hmacKey&&this.k(E0("hmacKey",E.hmacKey,this.T))}O(D,_){let u=function(B){let E=B||{};return{funcName:E0("funcName",E.funcName,1,{value:[],binLen:0}),customization:E0("Customization",E.customization,1,{value:[],binLen:0})}}(D||{});_&&(u.funcName=_);let F=U3(u1(u.funcName),u1(u.customization));if(u.customization.binLen!==0||u.funcName.binLen!==0){let B=z4(F,this.m>>>3);for(let E=0;E<B.length;E+=this.m>>>5)this.U=this.v(B.slice(E,E+(this.m>>>5)),this.U),this.A+=this.m;return 4}return 31}X(D){let _=function(F){let B=F||{};return{kmacKey:E0("kmacKey",B.kmacKey,1),funcName:{value:[1128353099],binLen:32},customization:E0("Customization",B.customization,1,{value:[],binLen:0})}}(D||{});this.O(D,_.funcName);let u=z4(u1(_.kmacKey),this.m>>>3);for(let F=0;F<u.length;F+=this.m>>>5)this.U=this.v(u.slice(F,F+(this.m>>>5)),this.U),this.A+=this.m;this.H=!0}_(D){let _=U3({value:this.h.slice(),binLen:this.u},function(u){let F,B,E=0,C=[0,0],$=[4294967295&u,u/q2&2097151];for(F=6;F>=0;F--)B=$[F>>2]>>>8*F&255,B===0&&E===0||(C[E>>2]|=B<<8*E,E+=1);return E=E!==0?E:1,C[E>>2]|=E<<8*E,{value:E+1>4?C:[C[0]],binLen:8+8*E}}(D.outputLen));return this.F(_.value,_.binLen,this.A,this.L(this.U),D.outputLen)}};class B1{constructor(D,_,u){if(D=="SHA-1")this.P=new HF(D,_,u);else if(D=="SHA-224"||D=="SHA-256")this.P=new MF(D,_,u);else if(D=="SHA-384"||D=="SHA-512")this.P=new jF(D,_,u);else{if(D!="SHA3-224"&&D!="SHA3-256"&&D!="SHA3-384"&&D!="SHA3-512"&&D!="SHAKE128"&&D!="SHAKE256"&&D!="CSHAKE128"&&D!="CSHAKE256"&&D!="KMAC128"&&D!="KMAC256")throw new Error(X2);this.P=new YF(D,_,u)}}update(D){return this.P.update(D),this}getHash(D,_){return this.P.getHash(D,_)}setHMACKey(D,_,u){this.P.setHMACKey(D,_,u)}getHMAC(D,_){return this.P.getHMAC(D,_)}}var n4=require("node:child_process"),W3=x(x8()),A3=require("node:os");var b4=`<?xml version="1.0" encoding="UTF-8"?>
63
63
  <Configuration status="WARN">
64
64
  <Appenders>
65
65
  <Console name="SysOut" target="SYSTEM_OUT">
@@ -85,4 +85,4 @@ ${n_}
85
85
  <AppenderRef ref="File"/>
86
86
  </Root>
87
87
  </Loggers>
88
- </Configuration>`;import{createHash as gB}from"node:crypto";function R4(D){let _=r.get("users");_.push(D),r.set("users",_)}function N4(D){let _=r.get("users"),u=_.findIndex((F)=>F.uuid===D.uuid);if(u!==-1)_.splice(u,1),r.set("users",_)}function C3(){return r.get("users")}function T4(D){let _=gB("md5").update(`OfflinePlayer:${D}`,"utf8").digest();return _[6]=_[6]&15|48,_[8]=_[8]&63|128,_.subarray(0,4).toString("hex")+"-"+_.subarray(4,6).toString("hex")+"-"+_.subarray(6,8).toString("hex")+"-"+_.subarray(8,10).toString("hex")+"-"+_.subarray(10,16).toString("hex")}function j4(D){return/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(D)}var m8={lang_code:"en",lang_name:"English",app_desc:"A Quick Minecraft CLI Launcher",cmd_versions_desc:"manage minecraft versions",cmd_versions_add_desc:"add a minecraft version",cmd_versions_add_confirm_show_snapshots:"show snapshot (and old_alpha/old_beta) versions?",cmd_versions_fetching_versions:"fetching minecraft versions",cmd_versions_list_version_desc:"$1 type:$2 release:$3 update:$4",cmd_versions_add_select_version_prompt:"select a version",cmd_versions_enter_game_name_prompt:"enter game name:",select_mc_path_prompt:"select a minecraft path",select_mc_path_desc:"select the path which contains minecraft files and data","mctype.snapshot":"snapshot","mctype.old_alpha":"old_alpha","mctype.old_beta":"old_beta","mctype.release":"release",error_game_name_required:"game name is required",error_game_name_invalid:"game name is not a valid file name",error_game_name_exists:"game name $1 already exists",confirm_continue:"continue?",cmd_versions_list_desc:"list and manage minecraft versions (installed games)",cmd_versions_list_select_game_prompt:"versions (games) installed list:",cmd_versions_list_game_desc:"game name: $1 mc version: $2",cmd_versions_list_select_action_prompt:"select an action",cmd_versions_action_launch:"launch",cmd_versions_action_launch_desc:"launch the game",cmd_versions_action_edit:"edit",cmd_versions_action_edit_desc:"edit the game settings",cmd_versions_action_delete:"delete",cmd_versions_action_delete_desc:"delete the game",cmd_versions_action_edit_todo:"TODO",cmd_versions_action_delete_confirm:"Are you sure you want to delete $1?",cmd_versions_action_delete_start:"removing",cmd_versions_action_delete_finish:"removed",cmd_versions_action_delete_cancel:"canceled",cmd_settings_desc:"manage settings",cmd_settings_mirror_desc:"set mirror",cmd_settings_mirror_select_prompt:"select a mirror (current [$1])",cmd_settings_mirror_option_official:"(official) Minecraft Official",cmd_settings_mirror_option_official_desc:"Minecraft Official",cmd_settings_mirror_option_bmclapi:"(bmclapi) bangbang93 BMCLAPI",cmd_settings_mirror_option_bmclapi_desc:"BMCLAPI (by bangbang93.com)",cmd_settings_mirror_set_success:"set mirror to $1",cmd_settings_paths_desc:"manage minecraft paths",cmd_settings_paths_add_desc:"add a minecraft path",cmd_settings_paths_add_prompt:"enter a minecraft path",cmd_settings_paths_add_success:"added path $1",cmd_settings_paths_list_desc:"list and manage minecraft paths",cmd_settings_paths_list_select_prompt:"select a minecraft path",cmd_settings_paths_list_select_desc:"select the path which contains minecraft files and data",cmd_settings_paths_list_select_action_prompt:"select an action",cmd_settings_paths_list_action_info:"info",cmd_settings_paths_list_action_info_desc:"show info of the path",cmd_settings_paths_list_action_remove:"remove",cmd_settings_paths_list_action_remove_desc:"remove the path from the list",cmd_settings_paths_list_info_path:"path: $1",cmd_settings_paths_list_info_games:"games:",cmd_settings_paths_list_info_game_entry:"name:$1 | mc version:$2",cmd_settings_paths_list_action_remove_confirm:"Are you sure you want to remove $1 from the list?",cmd_settings_paths_list_action_remove_start:"removing",cmd_settings_paths_list_action_remove_finish:"removed",cmd_settings_paths_list_action_remove_cancel:"canceled",error_no_path_added:"no path added",error_path_required:"path is required",error_path_not_exist:"path does not exist",error_path_not_directory:"path is not a directory",error_path_already_added:"path already added",error_no_game_installed:"no game installed",cmd_settings_lang_desc:"modify language",cmd_settings_lang_select_prompt:"select a language [current:$1]",cmd_settings_lang_set_success:"set language to $1",cmd_users_desc:"add/manage users",cmd_users_add_desc:"add a user",cmd_users_add_select_type_prompt:"select a type",cmd_users_add_type_offline:"offline",cmd_users_add_type_offline_desc:"offline user",cmd_users_add_type_mojang:"mojang [todo]",cmd_users_add_type_mojang_desc:"mojang user [not implemented]",cmd_users_add_type_microsoft:"microsoft [todo]",cmd_users_add_type_microsoft_desc:"microsoft user [not implemented]",cmd_users_add_name_prompt:"enter a name",cmd_users_add_uuid_prompt:"enter a uuid",cmd_users_add_success:"add user $1 success",error_name_required:"name is required",error_name_invalid:"name is not valid, use name with 3-16 letters, numbers and underscores",error_uuid_invalid:"enter a unsigned 32 bit uuid, if you don't know what is a uuid, just leave it blank",cmd_users_list_desc:"list and manage users",cmd_users_list_select_user_prompt:"select a user",cmd_users_list_user_desc:"name:$1 uuid:$2 type:$3",cmd_users_list_select_action_prompt:"select an action",cmd_users_list_action_info:"info",cmd_users_list_action_info_desc:"check the info",cmd_users_list_action_delete:"delete",cmd_users_list_action_delete_desc:"delete the user",cmd_users_list_action_delete_confirm:"are you sure?",cmd_users_list_action_delete_success:"deleted!",cmd_users_list_action_delete_cancel:"canceled",cmd_users_list_info_name:"name: $1",cmd_users_list_info_uuid:"uuid: $1",cmd_users_list_info_type:"type: $1",error_no_users:"no users here",summary_info:"summary:",summary_game_name:"game name: $1",summary_version:"version: $1",summary_minecraft_path:"minecraft path: $1",operation_starting:"operation starting...",operation_completed:"operation completed.",operation_canceled:"operation canceled.",asset_hash_mismatch_redownload:"mismatch sha1 of $1, redownload",start_download:"start downloading",download_completed:"download completed",creating_neccessary_files:"creating neccessary files...",done:"Done!","user_type.offline":"offline","user_type.mojang":"mojang","user_type.microsoft":"microsoft",launch_precheck_no_users:"no users here, please add a user first",launch_user_select_prompt:"select a user",launch_user_select_user_desc:"uuid: $1 type: $2",launch_extracting_natives:"extracting natives...",launch_moving_files:"moving files...",launch_extracting_natives_done:"natives extracting done!",launch_starting:"starting minecraft..."};var O4={lang_code:"zh-CN",lang_name:"简体中文",app_desc:"一个快速的 Minecraft 命令行启动器",cmd_versions_desc:"管理 Minecraft 版本",cmd_versions_add_desc:"添加一个 Minecraft 版本",cmd_versions_add_confirm_show_snapshots:"是否显示快照(以及旧版 Alpha/Beta)版本?",cmd_versions_fetching_versions:"正在获取 Minecraft 版本",cmd_versions_list_version_desc:"$1 类型:$2 发布日期:$3 更新日期:$4",cmd_versions_add_select_version_prompt:"选择一个版本",cmd_versions_enter_game_name_prompt:"输入游戏名称:",select_mc_path_prompt:"选择一个 Minecraft 路径",select_mc_path_desc:"选择包含 Minecraft 文件和数据的路径","mctype.snapshot":"快照","mctype.old_alpha":"旧版 Alpha","mctype.old_beta":"旧版 Beta","mctype.release":"正式版",error_game_name_required:"游戏名称是必需的",error_game_name_invalid:"游戏名称不是一个有效的文件名",error_game_name_exists:"游戏名称 $1 已经存在",confirm_continue:"是否继续?",cmd_versions_list_desc:"列出并管理 Minecraft 版本(已安装的游戏)",cmd_versions_list_select_game_prompt:"已安装的游戏版本列表:",cmd_versions_list_game_desc:"游戏名称:$1 Minecraft 版本:$2",cmd_versions_list_select_action_prompt:"选择一个操作",cmd_versions_action_launch:"启动",cmd_versions_action_launch_desc:"启动游戏",cmd_versions_action_edit:"编辑",cmd_versions_action_edit_desc:"编辑游戏设置",cmd_versions_action_delete:"删除",cmd_versions_action_delete_desc:"删除游戏",cmd_versions_action_edit_todo:"待办",cmd_versions_action_delete_confirm:"你确定要删除 $1 吗?",cmd_versions_action_delete_start:"正在删除",cmd_versions_action_delete_finish:"已删除",cmd_versions_action_delete_cancel:"已取消",cmd_settings_desc:"管理设置",cmd_settings_mirror_desc:"设置镜像",cmd_settings_mirror_select_prompt:"选择一个镜像(当前 [$1])",cmd_settings_mirror_option_official:"(官方) Minecraft 官方",cmd_settings_mirror_option_official_desc:"Minecraft 官方",cmd_settings_mirror_option_bmclapi:"(bmclapi) bangbang93 BMCLAPI",cmd_settings_mirror_option_bmclapi_desc:"BMCLAPI(由 bangbang93.com 提供)",cmd_settings_mirror_set_success:"已将镜像设置为 $1",cmd_settings_paths_desc:"管理 Minecraft 路径",cmd_settings_paths_add_desc:"添加一个 Minecraft 路径",cmd_settings_paths_add_prompt:"输入一个 Minecraft 路径",cmd_settings_paths_add_success:"已添加路径 $1",cmd_settings_paths_list_desc:"列出并管理 Minecraft 路径",cmd_settings_paths_list_select_prompt:"选择一个 Minecraft 路径",cmd_settings_paths_list_select_desc:"选择包含 Minecraft 文件和数据的路径",cmd_settings_paths_list_select_action_prompt:"选择一个操作",cmd_settings_paths_list_action_info:"信息",cmd_settings_paths_list_action_info_desc:"显示路径信息",cmd_settings_paths_list_action_remove:"移除",cmd_settings_paths_list_action_remove_desc:"从列表中移除路径",cmd_settings_paths_list_info_path:"路径:$1",cmd_settings_paths_list_info_games:"游戏:",cmd_settings_paths_list_info_game_entry:"名称:$1 | Minecraft 版本:$2",cmd_settings_paths_list_action_remove_confirm:"你确定要从列表中移除 $1 吗?",cmd_settings_paths_list_action_remove_start:"正在移除",cmd_settings_paths_list_action_remove_finish:"已移除",cmd_settings_paths_list_action_remove_cancel:"已取消",error_no_path_added:"未添加任何路径",error_path_required:"路径是必需的",error_path_not_exist:"路径不存在",error_path_not_directory:"路径不是一个目录",error_path_already_added:"路径已添加",error_no_game_installed:"未安装任何游戏",cmd_settings_lang_desc:"修改语言",cmd_settings_lang_select_prompt:"选择语言 [当前:$1]",cmd_settings_lang_set_success:"已将语言设置为 $1",cmd_users_desc:"添加/管理用户",cmd_users_add_desc:"添加一个用户",cmd_users_add_select_type_prompt:"选择类型",cmd_users_add_type_offline:"离线",cmd_users_add_type_offline_desc:"离线用户",cmd_users_add_type_mojang:"Mojang [未实现]",cmd_users_add_type_mojang_desc:"Mojang 用户 [未实现]",cmd_users_add_type_microsoft:"Microsoft [未实现]",cmd_users_add_type_microsoft_desc:"Microsoft 用户 [未实现]",cmd_users_add_name_prompt:"输入一个名称",cmd_users_add_uuid_prompt:"输入一个 UUID",cmd_users_add_success:"添加用户 $1 成功",error_name_required:"名称是必需的",error_name_invalid:"名称无效,使用包含 3-16 个字母、数字和下划线的名称",error_uuid_invalid:"输入一个无符号的 32 位 UUID,如果你不知道什么是 UUID,只需留空即可",cmd_users_list_desc:"列出并管理用户",cmd_users_list_select_user_prompt:"选择一个用户",cmd_users_list_user_desc:"名称:$1 UUID:$2 类型:$3",cmd_users_list_select_action_prompt:"选择一个操作",cmd_users_list_action_info:"信息",cmd_users_list_action_info_desc:"查看信息",cmd_users_list_action_delete:"删除",cmd_users_list_action_delete_desc:"删除用户",cmd_users_list_action_delete_confirm:"你确定吗?",cmd_users_list_action_delete_success:"已删除!",cmd_users_list_action_delete_cancel:"已取消",cmd_users_list_info_name:"名称:$1",cmd_users_list_info_uuid:"UUID:$1",cmd_users_list_info_type:"类型:$1",error_no_users:"这里没有用户",summary_info:"概要:",summary_game_name:"游戏名称:$1",summary_version:"版本:$1",summary_minecraft_path:"Minecraft 路径:$1",operation_starting:"操作正在开始...",operation_completed:"操作已完成。",operation_canceled:"操作已取消。",asset_hash_mismatch_redownload:"$1 的 SHA1 不匹配,正在重新下载",start_download:"开始下载",download_completed:"下载完成",creating_neccessary_files:"正在创建必要的文件...",done:"完成!","user_type.offline":"离线","user_type.mojang":"Mojang","user_type.microsoft":"Microsoft",launch_precheck_no_users:"这里没有用户,请先添加一个用户",launch_user_select_prompt:"选择一个用户",launch_user_select_user_desc:"UUID:$1 类型:$2",launch_extracting_natives:"正在提取natives库文件...",launch_moving_files:"正在移动文件...",launch_extracting_natives_done:"natives库文件提取完成!",launch_starting:"正在启动 Minecraft..."};var $3={en:m8,"zh-CN":O4},x4=m8;function P4(D){x4=D}function H(D,..._){let u=x4[D]||D;for(let F=0;F<_.length;F++)u=u.replace(`$${F+1}`,_[F]);return u}async function Y4(){let D=O0("https://launchermeta.mojang.com/mc/game/version_manifest.json");return(await(await fetch(D)).json()).versions}function lD(D){if(!f.existsSync(D))f.mkdirSync(D,{recursive:!0})}async function lB(D,_,u){let{assets:F,assetIndex:B}=D,E=0,C=await(await fetch(O0(B.url))).json();lD(`${_}/assets/indexes`),lD(`${_}/assets/objects`),lD(`${_}/assets/virtual`),lD(`${_}/assets/skins`),f.writeFileSync(`${_}/assets/indexes/${B.id}.json`,JSON.stringify(C));let $=[],q=B.id==="legacy";for(let X in C.objects){let G=C.objects[X].hash,Z=O0(`https://resources.download.minecraft.net/${G.substring(0,2)}/${G}`),J=q?`${_}/assets/virtual/legacy/${X}`:`${_}/assets/objects/${G.substring(0,2)}/${G}`;if(f.existsSync(J)){let K=new Uint8Array(f.readFileSync(J));if(new h8("SHA-1","UINT8ARRAY").update(K).getHash("HEX")!==C.objects[X].hash)console.log(O.yellow(H("asset_hash_mismatch_redownload",X)))}lD(F0.dirname(J)),$.push({url:Z,filename:J,extra:{size:C.objects[X].size}}),E+=C.objects[X].size}return{tasks:$,totalSize:E}}async function w4(D,_,u){let F=`${_}/versions/${u}`;lD(F);let B=await(await fetch(D)).json();f.writeFileSync(`${F}/${u}.json`,JSON.stringify(B));let E=[],C=await lB(B,_,u),$=C.totalSize;E.push(...C.tasks);let{downloads:{client:q}}=B;E.push({url:q.url,filename:`${F}/${u}.jar`,extra:{size:q.size}}),$+=q.size,lD(`${_}/libraries`);for(let G of B.libraries){let{downloads:{artifact:Z}}=G;if(Z){let{path:J,url:K,size:Q}=Z;E.push({url:O0(K),filename:`${_}/libraries/${J}`,extra:{size:Q}}),$+=Q,lD(F0.dirname(`${_}/libraries/${J}`))}if(G.downloads.classifiers)for(let[J,K]of Object.entries(G.downloads.classifiers)){let{path:Q,url:M,size:W}=K;lD(F0.dirname(`${_}/libraries/${Q}`)),E.push({url:O0(M),filename:`${_}/libraries/${Q}`,extra:{size:W}}),$+=W}}E.sort((G,Z)=>Z.extra.size-G.extra.size),console.log(O.green(H("start_download")));let X=new J8(16,{totalSize:$});for(let G of E)X.addTask(G);if(await X.wait(),console.log(O.green(H("download_completed"))),console.log(O.cyan(H("creating_neccessary_files"))),!f.existsSync(`${_}/launcher_profiles.json`))f.writeFileSync(`${_}/launcher_profiles.json`,JSON.stringify(b6));console.log(O.green(H("done")))}async function g8(D){let _=`${D}/versions`,u=[];if(f.existsSync(_)){for(let F of f.readdirSync(_))if(f.existsSync(`${_}/${F}/${F}.json`))u.push(F)}return u}function iB(){if(x0()=="windows")return";";return":"}async function S4(D,_){let u=C3();if(u.length===0){console.log(O.red(H("launch_precheck_no_users")));return}let F=await qD({message:H("launcher_user_select_desc"),choices:u.map((Q)=>({value:Q,name:`${Q.name} (${H("user_type."+Q.type)})`,description:H("launch_user_select_user_desc",Q.uuid,H("user_type."+Q.type)),short:`${Q.name} (${H("user_type."+Q.type)})`}))});console.log(O.blue(H("launch_extracting_natives")));let B=x0(),E=p6(),C=JSON.parse(f.readFileSync(`${D}/versions/${_}/${_}.json`,{encoding:"utf-8"})),$=[],q=[],X=`${D}/versions/${_}/natives-${B}${E}`;for(let Q of C.libraries){if(Q.downloads.artifact){if(Q.downloads.artifact.path.includes(`natives-${B}`))$.push(Q.downloads.artifact.path);if(Q.rules&&k2(Q.rules,{os:{name:x0(),arch:G3.default(),version:d8()}}))q.push(`${D}/libraries/${Q.downloads.artifact.path}`);else if(!Q.rules)q.push(`${D}/libraries/${Q.downloads.artifact.path}`)}if(Q.downloads.classifiers){if(Q.downloads.classifiers[`natives-${B}`])$.push(Q.downloads.classifiers[`natives-${B}`].path)}if(E!=""){if(Q.downloads.artifact){if(Q.downloads.artifact.path.includes(`natives-${B}${E}`))$.push(Q.downloads.artifact.path)}if(Q.downloads.classifiers){if(Q.downloads.classifiers[`natives-${B}${E}`])$.push(Q.downloads.classifiers[`natives-${B}${E}`].path)}}}q.push(`${D}/versions/${_}/${_}.jar`),f.mkdirSync(`${X}/tmp`,{recursive:!0});for(let Q of $)await z4.default.extract(`${D}/libraries/${Q}`,`${X}/tmp`);console.log(O.blue(H("launch_moving_files"))),f.readdirSync(`${X}/tmp`,{withFileTypes:!0,recursive:!0}).forEach((Q)=>{if(Q.isFile()&&!Q.name.endsWith(".git")&&!Q.name.endsWith(".sha1")&&!Q.name.endsWith(".class"))f.copyFileSync(F0.join(Q.parentPath,Q.name),F0.join(X,Q.name))}),f.rmSync(`${X}/tmp`,{recursive:!0}),console.log(O.green(H("launch_extracting_natives_done")));let G=[],Z={version_name:C.id,version_type:"QMCLI 0.0.1",game_directory:D,assets_root:`${D}/assets`,assets_index_name:C.assets,natives_directory:X,launcher_name:"QMCLI",launcher_version:"0.0.1",classpath:`${q.join(iB())}`,resolution_width:"854",resolution_height:"480",auth_player_name:F.name,auth_uuid:F.uuid,auth_access_token:F.auth_access_token,user_properties:"{}",user_type:"msa"};G.push("-XX:+UnlockExperimentalVMOptions","-XX:+UseG1GC","-XX:G1NewSizePercent=20","-XX:G1ReservePercent=20","-XX:MaxGCPauseMillis=50","-XX:G1HeapRegionSize=32m","-XX:-UseAdaptiveSizePolicy","-XX:-OmitStackTraceInFastThrow","-XX:-DontCompileHugeMethods","-Dfml.ignoreInvalidMinecraftCertificates=true","-Dlog4j2.formatMsgNoLookups=true"),f.writeFileSync(`${D}/versions/${_}/log4j2-qmcli.xml`,I4,{encoding:"utf-8"}),G.push(C.logging.client.argument.replace("${path}",`${D}/versions/${_}/log4j2-qmcli.xml`)),G.push(`-Dminecraft.client.jar=${D}/versions/${_}/${_}.jar`);let J=(Q)=>{for(let M of Q)if(typeof M==="string"){let W=M;for(let[V,L]of Object.entries(Z))W=W.replace(`\${${V}}`,L);G.push(W)}else if(k2(M.rules,{os:{name:x0(),arch:G3.default(),version:d8()}})){let W=Array.isArray(M.value)?M.value.map((V)=>`${V}`).join(" "):`${M.value}`;for(let[V,L]of Object.entries(Z))W=W.replace(`\${${V}}`,L);G.push(W)}};if(C.arguments){J(C.arguments.jvm),G.push(C.mainClass);for(let Q of C.arguments.game)if(typeof Q==="string"){let M=Q;for(let[W,V]of Object.entries(Z))M=M.replace(`\${${W}}`,V);G.push(M)}else if(k2(Q.rules,{os:{name:x0(),arch:G3.default(),version:d8()},has_custom_resolution:!0})){let M=Array.isArray(Q.value)?Q.value.map((W)=>`${W}`).join("|$|"):`${Q.value}`;for(let[W,V]of Object.entries(Z))M=M.replace(`\${${W}}`,V);G.push(...M.split("|$|"))}}else if(C.minecraftArguments){J([{rules:[{action:"allow",os:{name:"osx"}}],value:["-XstartOnFirstThread"]},{rules:[{action:"allow",os:{name:"windows"}}],value:"-XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump"},{rules:[{action:"allow",os:{arch:"x86"}}],value:"-Xss1M"},"-Djava.library.path=${natives_directory}","-Djna.tmpdir=${natives_directory}","-Dorg.lwjgl.system.SharedLibraryExtractPath=${natives_directory}","-Dio.netty.native.workdir=${natives_directory}","-Dminecraft.launcher.brand=${launcher_name}","-Dminecraft.launcher.version=${launcher_version}","-cp","${classpath}"]),G.push(C.mainClass);let Q=C.minecraftArguments.split(" ");for(let M of Q)if(M.startsWith("${")){let W=M;for(let[V,L]of Object.entries(Z))W=W.replace(`\${${V}}`,L);G.push(W)}else G.push(M);G.push(...["--width",Z.resolution_width,"--height",Z.resolution_height])}if(F.type==="offline");let K="java "+G.map((Q)=>{if(Q.includes(" "))return`"${Q}"`;else return Q}).join(" ");console.log(O.green(H("launch_starting"))),pB("java",G,{stdio:"inherit",shell:!1,cwd:D})}function y4(D,_){f.rmSync(F0.join(D,"versions",_),{recursive:!0})}import*as E0 from"fs";import k4 from"path";var aB=$3[r.get("lang")];P4(aB);var B0=new y0;B0.name("qmcli").description(H("app_desc")).version(A2.version);var C2=new y0;C2.name("versions");C2.description(H("cmd_versions_desc"));C2.command("add").description(H("cmd_versions_add_desc")).action(async()=>{let D=await X0({message:H("cmd_versions_add_confirm_show_snapshots")});console.log(O.green(H("cmd_versions_fetching_versions")));let u=(await Y4()).filter(($)=>{if(D)return!0;else if($.type==="snapshot"||$.type==="old_beta"||$.type==="old_alpha")return!1;else return!0}).map(($)=>{return{value:$,name:`${$.id} (${H("mctype."+$.type)})`,description:H("cmd_versions_list_version_desc",$.id,H("mctype."+$.type),$.releaseTime,$.time),short:$.id}}),F=await f3({message:H("cmd_versions_add_select_version_prompt"),async source($){if(!$)return u;return u.filter((q)=>{return q.name?.toLowerCase().includes($.toLowerCase())})}}),B=await qD({message:H("select_mc_path_prompt"),choices:r.get("paths").map(($)=>{return{value:$,name:$,description:H("select_mc_path_desc"),short:$}})}),E=await L0({message:H("cmd_versions_enter_game_name_prompt"),default:F.id,validate($){if(!$)return H("error_game_name_required");if(!c6($))return H("error_game_name_invalid");if(E0.existsSync(k4.join(QD(B),"versions",$)))return H("error_game_name_exists",$);return!0}});if(console.log(O.green(H("summary_info"))),console.log(O.green(H("summary_game_name",E))),console.log(O.green(H("summary_version",F.id))),console.log(O.green(H("summary_minecraft_path",B))),!await X0({message:H("confirm_continue")})){console.log(O.red(H("operation_canceled")));return}console.log(O.green(H("operation_starting"))),await w4(F.url,QD(B),E),console.log(O.green(H("operation_completed")))});C2.command("list").description(H("cmd_versions_list_desc")).action(async()=>{let D=await qD({message:H("select_mc_path_prompt"),choices:r.get("paths").map((B)=>{return{value:B,name:B,description:H("select_mc_path_desc"),short:B}})}),_=await g8(QD(D));if(_.length===0){console.log(O.red(H("error_no_game_installed")));return}let u=await qD({message:H("cmd_versions_list_select_game_prompt"),choices:_.map((B)=>{let E=JSON.parse(E0.readFileSync(`${QD(D)}/versions/${B}/${B}.json`,"utf-8"));return{value:B,name:B,description:H("cmd_versions_list_game_desc",B,E.id),short:B}})}),F=await qD({message:H("cmd_versions_list_select_action_prompt"),choices:[{value:"launch",name:H("cmd_versions_action_launch"),description:H("cmd_versions_action_launch_desc")},{value:"edit",name:H("cmd_versions_action_edit"),description:H("cmd_versions_action_edit_desc")},{value:"delete",name:H("cmd_versions_action_delete"),description:H("cmd_versions_action_delete_desc")}]});if(F==="launch")console.log(O.green(H("operation_launching"))),await S4(QD(D),u);else if(F==="edit")console.log(O.yellow(H("cmd_versions_action_edit_todo")));else if(F==="delete")if(await X0({message:H("cmd_versions_action_delete_confirm",u),default:!1}))console.log(O.green(H("operation_starting"))),y4(QD(D),u),console.log(O.green(H("operation_completed")));else console.log(O.red(H("operation_canceled")))});B0.addCommand(C2);var $2=new y0;$2.name("settings").description(H("cmd_settings_desc"));$2.command("mirror").description(H("cmd_settings_mirror_desc")).action(async()=>{let D=await qD({message:H("cmd_settings_mirror_select_prompt",r.get("mirror")),default:r.get("mirror"),choices:[{value:"official",name:H("cmd_settings_mirror_option_official"),description:H("cmd_settings_mirror_option_official_desc")},{value:"bmclapi",name:H("cmd_settings_mirror_option_bmclapi"),description:H("cmd_settings_mirror_option_bmclapi_desc")}]});r.set("mirror",D),console.log(O.green(H("cmd_settings_mirror_set_success",D)))});var v4=$2.command("paths").description(H("cmd_settings_paths_desc"));v4.command("add").description(H("cmd_settings_paths_add_desc")).action(async()=>{let D=r.get("paths"),_=await L0({message:H("cmd_settings_paths_add_prompt"),validate(F){if(!F)return H("error_path_required");if(!E0.existsSync(QD(F)))return H("error_path_not_exist");if(!E0.statSync(QD(F)).isDirectory())return H("error_path_not_directory");if(D.includes(F)||D.includes(QD(F)))return H("error_path_already_added");return!0}}),u=k4.resolve(QD(_));D.push(u),r.set("paths",D),console.log(O.green(H("cmd_settings_paths_add_success",u)))});v4.command("list").description(H("cmd_settings_paths_list_desc")).action(async()=>{let D=r.get("paths");if(D.length===0){console.log(O.red(H("error_no_path_added")));return}let _=await qD({message:H("cmd_settings_paths_list_select_prompt"),choices:D.map((F)=>{return{value:F,name:F,description:H("cmd_settings_paths_list_select_desc"),short:F}})}),u=await qD({message:H("cmd_settings_paths_list_select_action_prompt"),choices:[{value:"info",name:H("cmd_settings_paths_list_action_info"),description:H("cmd_settings_paths_list_action_info_desc")},{value:"remove",name:H("cmd_settings_paths_list_action_remove"),description:H("cmd_settings_paths_list_action_remove_desc")}]});if(u==="info"){console.log(O.blue(H("cmd_settings_paths_list_info_path",_)));let F=await g8(QD(_));if(F.length===0){console.log(O.red(H("error_no_game_installed")));return}console.log(O.blue(H("cmd_settings_paths_list_info_games")));for(let B of F){let E=JSON.parse(E0.readFileSync(`${QD(_)}/versions/${B}/${B}.json`,"utf-8"));console.log(O.blue(H("cmd_settings_paths_list_info_game_entry",B,E.id)))}}else if(u==="remove")if(await X0({message:H("cmd_settings_paths_list_action_remove_confirm",_),default:!1}))console.log(O.green(H("operation_starting"))),r.set("paths",D.filter((B)=>B!==_)),console.log(O.green(H("operation_completed")));else console.log(O.red(H("operation_canceled")))});$2.command("lang").description(H("cmd_settings_lang_desc")).action(async()=>{let D=await qD({message:H("cmd_settings_lang_select_prompt",r.get("lang")),default:r.get("lang"),choices:Object.keys($3).map((_)=>{return{value:_,name:`${$3[_].lang_name} (${_})`,short:_}})});r.set("lang",D),console.log(O.green(H("cmd_settings_lang_set_success",D)))});B0.addCommand($2);var q3=new y0;q3.name("users").description(H("cmd_users_desc"));q3.command("add").description(H("cmd_users_add_desc")).action(async()=>{if(await qD({message:H("cmd_users_add_select_type_prompt"),choices:[{value:"offline",name:H("cmd_users_add_type_offline"),description:H("cmd_users_add_type_offline_desc")},{value:"microsoft",name:H("cmd_users_add_type_microsoft"),description:H("cmd_users_add_type_microsoft_desc")}]})==="offline"){let _=await L0({message:H("cmd_users_add_name_prompt"),validate(B){if(!B)return H("error_name_required");if(!/^[a-zA-Z0-9_]{3,16}$/.test(B))return H("error_name_invalid");return!0}}),u=await L0({message:H("cmd_users_add_uuid_prompt"),default:T4(_),validate(B){if(!j4(B))return H("error_uuid_invalid");return!0}});R4({name:_,uuid:u,type:"offline"}),console.log(O.green(H("cmd_users_add_success",_)))}});q3.command("list").description(H("cmd_users_list_desc")).action(async()=>{let D=C3();if(D.length===0){console.log(O.red(H("error_no_users")));return}let _=await qD({message:H("cmd_users_list_select_user_prompt"),choices:D.map((F)=>{return{value:F,name:`${F.name} (${F.type})`,description:H("cmd_users_list_user_desc",F.name,F.uuid,F.type),short:F.name}})}),u=await qD({message:H("cmd_users_list_select_action_prompt"),choices:[{value:"info",name:H("cmd_users_list_action_info"),description:H("cmd_users_list_action_info_desc")},{value:"delete",name:H("cmd_users_list_action_delete"),description:H("cmd_users_list_action_delete_desc")}]});if(u==="info")console.log(O.green(H("cmd_users_list_info_name",_.name))),console.log(O.green(H("cmd_users_list_info_uuid",_.uuid))),console.log(O.green(H("cmd_users_list_info_type",_.type)));else if(u==="delete")if(await X0({message:H("cmd_users_list_action_delete_confirm",_.name),default:!1}))N4(_),console.log(O.green(H("cmd_users_list_action_delete_success")));else console.log(O.red(H("cmd_users_list_action_delete_cancel")))});B0.addCommand(q3);if(B0.args.length===0&&B0.commands.length===0)B0.help();B0.parse();
88
+ </Configuration>`;var h4=require("node:crypto");function m4(D){let _=r.get("users");_.push(D),r.set("users",_)}function d4(D){let _=r.get("users"),u=_.findIndex((F)=>F.uuid===D.uuid);if(u!==-1)_.splice(u,1),r.set("users",_)}function H3(){return r.get("users")}function g4(D){let _=h4.createHash("md5").update(`OfflinePlayer:${D}`,"utf8").digest();return _[6]=_[6]&15|48,_[8]=_[8]&63|128,_.subarray(0,4).toString("hex")+"-"+_.subarray(4,6).toString("hex")+"-"+_.subarray(6,8).toString("hex")+"-"+_.subarray(8,10).toString("hex")+"-"+_.subarray(10,16).toString("hex")}function f4(D){return/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(D)}var E1={lang_code:"en",lang_name:"English",app_desc:"A Quick Minecraft CLI Launcher",cmd_versions_desc:"manage minecraft versions",cmd_versions_add_desc:"add a minecraft version",cmd_versions_add_confirm_show_snapshots:"show snapshot (and old_alpha/old_beta) versions?",cmd_versions_fetching_versions:"fetching minecraft versions",cmd_versions_list_version_desc:"$1 type:$2 release:$3 update:$4",cmd_versions_add_select_version_prompt:"select a version",cmd_versions_enter_game_name_prompt:"enter game name:",select_mc_path_prompt:"select a minecraft path",select_mc_path_desc:"select the path which contains minecraft files and data","mctype.snapshot":"snapshot","mctype.old_alpha":"old_alpha","mctype.old_beta":"old_beta","mctype.release":"release",error_game_name_required:"game name is required",error_game_name_invalid:"game name is not a valid file name",error_game_name_exists:"game name $1 already exists",confirm_continue:"continue?",cmd_versions_list_desc:"list and manage minecraft versions (installed games)",cmd_versions_list_select_game_prompt:"versions (games) installed list:",cmd_versions_list_game_desc:"game name: $1 mc version: $2",cmd_versions_list_select_action_prompt:"select an action",cmd_versions_action_launch:"launch",cmd_versions_action_launch_desc:"launch the game",cmd_versions_action_edit:"edit",cmd_versions_action_edit_desc:"edit the game settings",cmd_versions_action_delete:"delete",cmd_versions_action_delete_desc:"delete the game",cmd_versions_action_edit_todo:"TODO",cmd_versions_action_delete_confirm:"Are you sure you want to delete $1?",cmd_versions_action_delete_start:"removing",cmd_versions_action_delete_finish:"removed",cmd_versions_action_delete_cancel:"canceled",cmd_settings_desc:"manage settings",cmd_settings_mirror_desc:"set mirror",cmd_settings_mirror_select_prompt:"select a mirror (current [$1])",cmd_settings_mirror_option_official:"(official) Minecraft Official",cmd_settings_mirror_option_official_desc:"Minecraft Official",cmd_settings_mirror_option_bmclapi:"(bmclapi) bangbang93 BMCLAPI",cmd_settings_mirror_option_bmclapi_desc:"BMCLAPI (by bangbang93.com)",cmd_settings_mirror_set_success:"set mirror to $1",cmd_settings_paths_desc:"manage minecraft paths",cmd_settings_paths_add_desc:"add a minecraft path",cmd_settings_paths_add_prompt:"enter a minecraft path",cmd_settings_paths_add_success:"added path $1",cmd_settings_paths_list_desc:"list and manage minecraft paths",cmd_settings_paths_list_select_prompt:"select a minecraft path",cmd_settings_paths_list_select_desc:"select the path which contains minecraft files and data",cmd_settings_paths_list_select_action_prompt:"select an action",cmd_settings_paths_list_action_info:"info",cmd_settings_paths_list_action_info_desc:"show info of the path",cmd_settings_paths_list_action_remove:"remove",cmd_settings_paths_list_action_remove_desc:"remove the path from the list",cmd_settings_paths_list_info_path:"path: $1",cmd_settings_paths_list_info_games:"games:",cmd_settings_paths_list_info_game_entry:"name:$1 | mc version:$2",cmd_settings_paths_list_action_remove_confirm:"Are you sure you want to remove $1 from the list?",cmd_settings_paths_list_action_remove_start:"removing",cmd_settings_paths_list_action_remove_finish:"removed",cmd_settings_paths_list_action_remove_cancel:"canceled",error_no_path_added:"no path added",error_path_required:"path is required",error_path_not_exist:"path does not exist",error_path_not_directory:"path is not a directory",error_path_already_added:"path already added",error_no_game_installed:"no game installed",cmd_settings_lang_desc:"modify language",cmd_settings_lang_select_prompt:"select a language [current:$1]",cmd_settings_lang_set_success:"set language to $1",cmd_users_desc:"add/manage users",cmd_users_add_desc:"add a user",cmd_users_add_select_type_prompt:"select a type",cmd_users_add_type_offline:"offline",cmd_users_add_type_offline_desc:"offline user",cmd_users_add_type_mojang:"mojang [todo]",cmd_users_add_type_mojang_desc:"mojang user [not implemented]",cmd_users_add_type_microsoft:"microsoft [todo]",cmd_users_add_type_microsoft_desc:"microsoft user [not implemented]",cmd_users_add_name_prompt:"enter a name",cmd_users_add_uuid_prompt:"enter a uuid",cmd_users_add_success:"add user $1 success",error_name_required:"name is required",error_name_invalid:"name is not valid, use name with 3-16 letters, numbers and underscores",error_uuid_invalid:"enter a unsigned 32 bit uuid, if you don't know what is a uuid, just leave it blank",cmd_users_list_desc:"list and manage users",cmd_users_list_select_user_prompt:"select a user",cmd_users_list_user_desc:"name:$1 uuid:$2 type:$3",cmd_users_list_select_action_prompt:"select an action",cmd_users_list_action_info:"info",cmd_users_list_action_info_desc:"check the info",cmd_users_list_action_delete:"delete",cmd_users_list_action_delete_desc:"delete the user",cmd_users_list_action_delete_confirm:"are you sure?",cmd_users_list_action_delete_success:"deleted!",cmd_users_list_action_delete_cancel:"canceled",cmd_users_list_info_name:"name: $1",cmd_users_list_info_uuid:"uuid: $1",cmd_users_list_info_type:"type: $1",error_no_users:"no users here",summary_info:"summary:",summary_game_name:"game name: $1",summary_version:"version: $1",summary_minecraft_path:"minecraft path: $1",operation_starting:"operation starting...",operation_completed:"operation completed.",operation_canceled:"operation canceled.",asset_hash_mismatch_redownload:"mismatch sha1 of $1, redownload",start_download:"start downloading",download_completed:"download completed",creating_neccessary_files:"creating neccessary files...",done:"Done!","user_type.offline":"offline","user_type.mojang":"mojang","user_type.microsoft":"microsoft",launch_precheck_no_users:"no users here, please add a user first",launch_user_select_prompt:"select a user",launch_user_select_user_desc:"uuid: $1 type: $2",launch_extracting_natives:"extracting natives...",launch_moving_files:"moving files...",launch_extracting_natives_done:"natives extracting done!",launch_starting:"starting minecraft..."};var c4={lang_code:"zh-CN",lang_name:"简体中文",app_desc:"一个快速的 Minecraft 命令行启动器",cmd_versions_desc:"管理 Minecraft 版本",cmd_versions_add_desc:"添加一个 Minecraft 版本",cmd_versions_add_confirm_show_snapshots:"是否显示快照(以及旧版 Alpha/Beta)版本?",cmd_versions_fetching_versions:"正在获取 Minecraft 版本",cmd_versions_list_version_desc:"$1 类型:$2 发布日期:$3 更新日期:$4",cmd_versions_add_select_version_prompt:"选择一个版本",cmd_versions_enter_game_name_prompt:"输入游戏名称:",select_mc_path_prompt:"选择一个 Minecraft 路径",select_mc_path_desc:"选择包含 Minecraft 文件和数据的路径","mctype.snapshot":"快照","mctype.old_alpha":"旧版 Alpha","mctype.old_beta":"旧版 Beta","mctype.release":"正式版",error_game_name_required:"游戏名称是必需的",error_game_name_invalid:"游戏名称不是一个有效的文件名",error_game_name_exists:"游戏名称 $1 已经存在",confirm_continue:"是否继续?",cmd_versions_list_desc:"列出并管理 Minecraft 版本(已安装的游戏)",cmd_versions_list_select_game_prompt:"已安装的游戏版本列表:",cmd_versions_list_game_desc:"游戏名称:$1 Minecraft 版本:$2",cmd_versions_list_select_action_prompt:"选择一个操作",cmd_versions_action_launch:"启动",cmd_versions_action_launch_desc:"启动游戏",cmd_versions_action_edit:"编辑",cmd_versions_action_edit_desc:"编辑游戏设置",cmd_versions_action_delete:"删除",cmd_versions_action_delete_desc:"删除游戏",cmd_versions_action_edit_todo:"待办",cmd_versions_action_delete_confirm:"你确定要删除 $1 吗?",cmd_versions_action_delete_start:"正在删除",cmd_versions_action_delete_finish:"已删除",cmd_versions_action_delete_cancel:"已取消",cmd_settings_desc:"管理设置",cmd_settings_mirror_desc:"设置镜像",cmd_settings_mirror_select_prompt:"选择一个镜像(当前 [$1])",cmd_settings_mirror_option_official:"(官方) Minecraft 官方",cmd_settings_mirror_option_official_desc:"Minecraft 官方",cmd_settings_mirror_option_bmclapi:"(bmclapi) bangbang93 BMCLAPI",cmd_settings_mirror_option_bmclapi_desc:"BMCLAPI(由 bangbang93.com 提供)",cmd_settings_mirror_set_success:"已将镜像设置为 $1",cmd_settings_paths_desc:"管理 Minecraft 路径",cmd_settings_paths_add_desc:"添加一个 Minecraft 路径",cmd_settings_paths_add_prompt:"输入一个 Minecraft 路径",cmd_settings_paths_add_success:"已添加路径 $1",cmd_settings_paths_list_desc:"列出并管理 Minecraft 路径",cmd_settings_paths_list_select_prompt:"选择一个 Minecraft 路径",cmd_settings_paths_list_select_desc:"选择包含 Minecraft 文件和数据的路径",cmd_settings_paths_list_select_action_prompt:"选择一个操作",cmd_settings_paths_list_action_info:"信息",cmd_settings_paths_list_action_info_desc:"显示路径信息",cmd_settings_paths_list_action_remove:"移除",cmd_settings_paths_list_action_remove_desc:"从列表中移除路径",cmd_settings_paths_list_info_path:"路径:$1",cmd_settings_paths_list_info_games:"游戏:",cmd_settings_paths_list_info_game_entry:"名称:$1 | Minecraft 版本:$2",cmd_settings_paths_list_action_remove_confirm:"你确定要从列表中移除 $1 吗?",cmd_settings_paths_list_action_remove_start:"正在移除",cmd_settings_paths_list_action_remove_finish:"已移除",cmd_settings_paths_list_action_remove_cancel:"已取消",error_no_path_added:"未添加任何路径",error_path_required:"路径是必需的",error_path_not_exist:"路径不存在",error_path_not_directory:"路径不是一个目录",error_path_already_added:"路径已添加",error_no_game_installed:"未安装任何游戏",cmd_settings_lang_desc:"修改语言",cmd_settings_lang_select_prompt:"选择语言 [当前:$1]",cmd_settings_lang_set_success:"已将语言设置为 $1",cmd_users_desc:"添加/管理用户",cmd_users_add_desc:"添加一个用户",cmd_users_add_select_type_prompt:"选择类型",cmd_users_add_type_offline:"离线",cmd_users_add_type_offline_desc:"离线用户",cmd_users_add_type_mojang:"Mojang [未实现]",cmd_users_add_type_mojang_desc:"Mojang 用户 [未实现]",cmd_users_add_type_microsoft:"Microsoft [未实现]",cmd_users_add_type_microsoft_desc:"Microsoft 用户 [未实现]",cmd_users_add_name_prompt:"输入一个名称",cmd_users_add_uuid_prompt:"输入一个 UUID",cmd_users_add_success:"添加用户 $1 成功",error_name_required:"名称是必需的",error_name_invalid:"名称无效,使用包含 3-16 个字母、数字和下划线的名称",error_uuid_invalid:"输入一个无符号的 32 位 UUID,如果你不知道什么是 UUID,只需留空即可",cmd_users_list_desc:"列出并管理用户",cmd_users_list_select_user_prompt:"选择一个用户",cmd_users_list_user_desc:"名称:$1 UUID:$2 类型:$3",cmd_users_list_select_action_prompt:"选择一个操作",cmd_users_list_action_info:"信息",cmd_users_list_action_info_desc:"查看信息",cmd_users_list_action_delete:"删除",cmd_users_list_action_delete_desc:"删除用户",cmd_users_list_action_delete_confirm:"你确定吗?",cmd_users_list_action_delete_success:"已删除!",cmd_users_list_action_delete_cancel:"已取消",cmd_users_list_info_name:"名称:$1",cmd_users_list_info_uuid:"UUID:$1",cmd_users_list_info_type:"类型:$1",error_no_users:"这里没有用户",summary_info:"概要:",summary_game_name:"游戏名称:$1",summary_version:"版本:$1",summary_minecraft_path:"Minecraft 路径:$1",operation_starting:"操作正在开始...",operation_completed:"操作已完成。",operation_canceled:"操作已取消。",asset_hash_mismatch_redownload:"$1 的 SHA1 不匹配,正在重新下载",start_download:"开始下载",download_completed:"下载完成",creating_neccessary_files:"正在创建必要的文件...",done:"完成!","user_type.offline":"离线","user_type.mojang":"Mojang","user_type.microsoft":"Microsoft",launch_precheck_no_users:"这里没有用户,请先添加一个用户",launch_user_select_prompt:"选择一个用户",launch_user_select_user_desc:"UUID:$1 类型:$2",launch_extracting_natives:"正在提取natives库文件...",launch_moving_files:"正在移动文件...",launch_extracting_natives_done:"natives库文件提取完成!",launch_starting:"正在启动 Minecraft..."};var M3={en:E1,"zh-CN":c4},p4=E1;function l4(D){p4=D}function H(D,..._){let u=p4[D]||D;for(let F=0;F<_.length;F++)u=u.replace(`$${F+1}`,_[F]);return u}async function a4(){let D=w0("https://launchermeta.mojang.com/mc/game/version_manifest.json");return(await(await fetch(D)).json()).versions}function nD(D){if(!f.existsSync(D))f.mkdirSync(D,{recursive:!0})}async function SF(D,_,u){let{assets:F,assetIndex:B}=D,E=0,C=await(await fetch(w0(B.url))).json();nD(`${_}/assets/indexes`),nD(`${_}/assets/objects`),nD(`${_}/assets/virtual`),nD(`${_}/assets/skins`),f.writeFileSync(`${_}/assets/indexes/${B.id}.json`,JSON.stringify(C));let $=[],q=B.id==="legacy";for(let X in C.objects){let G=C.objects[X].hash,Z=w0(`https://resources.download.minecraft.net/${G.substring(0,2)}/${G}`),J=q?`${_}/assets/virtual/legacy/${X}`:`${_}/assets/objects/${G.substring(0,2)}/${G}`;if(f.existsSync(J)){let K=new Uint8Array(f.readFileSync(J));if(new B1("SHA-1","UINT8ARRAY").update(K).getHash("HEX")!==C.objects[X].hash)console.log(O.yellow(H("asset_hash_mismatch_redownload",X)))}nD(C0.dirname(J)),$.push({url:Z,filename:J,extra:{size:C.objects[X].size}}),E+=C.objects[X].size}return{tasks:$,totalSize:E}}async function s4(D,_,u){let F=`${_}/versions/${u}`;nD(F);let B=await(await fetch(D)).json();f.writeFileSync(`${F}/${u}.json`,JSON.stringify(B));let E=[],C=await SF(B,_,u),$=C.totalSize;E.push(...C.tasks);let{downloads:{client:q}}=B;E.push({url:q.url,filename:`${F}/${u}.jar`,extra:{size:q.size}}),$+=q.size,nD(`${_}/libraries`);for(let G of B.libraries){let{downloads:{artifact:Z}}=G;if(Z){let{path:J,url:K,size:Q}=Z;E.push({url:w0(K),filename:`${_}/libraries/${J}`,extra:{size:Q}}),$+=Q,nD(C0.dirname(`${_}/libraries/${J}`))}if(G.downloads.classifiers)for(let[J,K]of Object.entries(G.downloads.classifiers)){let{path:Q,url:M,size:W}=K;nD(C0.dirname(`${_}/libraries/${Q}`)),E.push({url:w0(M),filename:`${_}/libraries/${Q}`,extra:{size:W}}),$+=W}}E.sort((G,Z)=>Z.extra.size-G.extra.size),console.log(O.green(H("start_download")));let X=new w8(16,{totalSize:$});for(let G of E)X.addTask(G);if(await X.wait(),console.log(O.green(H("download_completed"))),console.log(O.cyan(H("creating_neccessary_files"))),!f.existsSync(`${_}/launcher_profiles.json`))f.writeFileSync(`${_}/launcher_profiles.json`,JSON.stringify(C5));console.log(O.green(H("done")))}async function C1(D){let _=`${D}/versions`,u=[];if(f.existsSync(_)){for(let F of f.readdirSync(_))if(f.existsSync(`${_}/${F}/${F}.json`))u.push(F)}return u}function yF(){if(x0()=="windows")return";";return":"}async function r4(D,_){let u=H3();if(u.length===0){console.log(O.red(H("launch_precheck_no_users")));return}let F=await GD({message:H("launcher_user_select_desc"),choices:u.map((Q)=>({value:Q,name:`${Q.name} (${H("user_type."+Q.type)})`,description:H("launch_user_select_user_desc",Q.uuid,H("user_type."+Q.type)),short:`${Q.name} (${H("user_type."+Q.type)})`}))});console.log(O.blue(H("launch_extracting_natives")));let B=x0(),E=Q5(),C=JSON.parse(f.readFileSync(`${D}/versions/${_}/${_}.json`,{encoding:"utf-8"})),$=[],q=[],X=`${D}/versions/${_}/natives-${B}${E}`;for(let Q of C.libraries){if(Q.downloads.artifact){if(Q.downloads.artifact.path.includes(`natives-${B}`))$.push(Q.downloads.artifact.path);if(Q.rules&&c2(Q.rules,{os:{name:x0(),arch:W3.default(),version:A3.release()}}))q.push(`${D}/libraries/${Q.downloads.artifact.path}`);else if(!Q.rules)q.push(`${D}/libraries/${Q.downloads.artifact.path}`)}if(Q.downloads.classifiers){if(Q.downloads.classifiers[`natives-${B}`])$.push(Q.downloads.classifiers[`natives-${B}`].path)}if(E!=""){if(Q.downloads.artifact){if(Q.downloads.artifact.path.includes(`natives-${B}${E}`))$.push(Q.downloads.artifact.path)}if(Q.downloads.classifiers){if(Q.downloads.classifiers[`natives-${B}${E}`])$.push(Q.downloads.classifiers[`natives-${B}${E}`].path)}}}q.push(`${D}/versions/${_}/${_}.jar`),f.mkdirSync(`${X}/tmp`,{recursive:!0});for(let Q of $)await i4.default.extract(`${D}/libraries/${Q}`,`${X}/tmp`);console.log(O.blue(H("launch_moving_files"))),f.readdirSync(`${X}/tmp`,{withFileTypes:!0,recursive:!0}).forEach((Q)=>{if(Q.isFile()&&!Q.name.endsWith(".git")&&!Q.name.endsWith(".sha1")&&!Q.name.endsWith(".class"))f.copyFileSync(C0.join(Q.parentPath,Q.name),C0.join(X,Q.name))}),f.rmSync(`${X}/tmp`,{recursive:!0}),console.log(O.green(H("launch_extracting_natives_done")));let G=[],Z={version_name:C.id,version_type:"QMCLI 0.0.1",game_directory:D,assets_root:`${D}/assets`,assets_index_name:C.assets,natives_directory:X,launcher_name:"QMCLI",launcher_version:"0.0.1",classpath:`${q.join(yF())}`,resolution_width:"854",resolution_height:"480",auth_player_name:F.name,auth_uuid:F.uuid,auth_access_token:F.auth_access_token,user_properties:"{}",user_type:"msa"};G.push("-XX:+UnlockExperimentalVMOptions","-XX:+UseG1GC","-XX:G1NewSizePercent=20","-XX:G1ReservePercent=20","-XX:MaxGCPauseMillis=50","-XX:G1HeapRegionSize=32m","-XX:-UseAdaptiveSizePolicy","-XX:-OmitStackTraceInFastThrow","-XX:-DontCompileHugeMethods","-Dfml.ignoreInvalidMinecraftCertificates=true","-Dlog4j2.formatMsgNoLookups=true"),f.writeFileSync(`${D}/versions/${_}/log4j2-qmcli.xml`,b4,{encoding:"utf-8"}),G.push(C.logging.client.argument.replace("${path}",`${D}/versions/${_}/log4j2-qmcli.xml`)),G.push(`-Dminecraft.client.jar=${D}/versions/${_}/${_}.jar`);let J=(Q)=>{for(let M of Q)if(typeof M==="string"){let W=M;for(let[V,L]of Object.entries(Z))W=W.replace(`\${${V}}`,L);G.push(W)}else if(c2(M.rules,{os:{name:x0(),arch:W3.default(),version:A3.release()}})){let W=Array.isArray(M.value)?M.value.map((V)=>`${V}`).join(" "):`${M.value}`;for(let[V,L]of Object.entries(Z))W=W.replace(`\${${V}}`,L);G.push(W)}};if(C.arguments){J(C.arguments.jvm),G.push(C.mainClass);for(let Q of C.arguments.game)if(typeof Q==="string"){let M=Q;for(let[W,V]of Object.entries(Z))M=M.replace(`\${${W}}`,V);G.push(M)}else if(c2(Q.rules,{os:{name:x0(),arch:W3.default(),version:A3.release()},has_custom_resolution:!0})){let M=Array.isArray(Q.value)?Q.value.map((W)=>`${W}`).join("|$|"):`${Q.value}`;for(let[W,V]of Object.entries(Z))M=M.replace(`\${${W}}`,V);G.push(...M.split("|$|"))}}else if(C.minecraftArguments){J([{rules:[{action:"allow",os:{name:"osx"}}],value:["-XstartOnFirstThread"]},{rules:[{action:"allow",os:{name:"windows"}}],value:"-XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump"},{rules:[{action:"allow",os:{arch:"x86"}}],value:"-Xss1M"},"-Djava.library.path=${natives_directory}","-Djna.tmpdir=${natives_directory}","-Dorg.lwjgl.system.SharedLibraryExtractPath=${natives_directory}","-Dio.netty.native.workdir=${natives_directory}","-Dminecraft.launcher.brand=${launcher_name}","-Dminecraft.launcher.version=${launcher_version}","-cp","${classpath}"]),G.push(C.mainClass);let Q=C.minecraftArguments.split(" ");for(let M of Q)if(M.startsWith("${")){let W=M;for(let[V,L]of Object.entries(Z))W=W.replace(`\${${V}}`,L);G.push(W)}else G.push(M);G.push(...["--width",Z.resolution_width,"--height",Z.resolution_height])}if(F.type==="offline");let K="java "+G.map((Q)=>{if(Q.includes(" "))return`"${Q}"`;else return Q}).join(" ");console.log(O.green(H("launch_starting"))),n4.spawn("java",G,{stdio:"inherit",shell:!1,cwd:D})}function o4(D,_){f.rmSync(C0.join(D,"versions",_),{recursive:!0})}var G0=x(require("fs"));var $1=x(require("path"));var vF=M3[r.get("lang")];l4(vF);var $0=new m0;$0.name("qmcli").description(H("app_desc")).version(j2.version);var J2=new m0;J2.name("versions");J2.description(H("cmd_versions_desc"));J2.command("add").description(H("cmd_versions_add_desc")).action(async()=>{let D=await Q0({message:H("cmd_versions_add_confirm_show_snapshots")});console.log(O.green(H("cmd_versions_fetching_versions")));let u=(await a4()).filter(($)=>{if(D)return!0;else if($.type==="snapshot"||$.type==="old_beta"||$.type==="old_alpha")return!1;else return!0}).map(($)=>{return{value:$,name:`${$.id} (${H("mctype."+$.type)})`,description:H("cmd_versions_list_version_desc",$.id,H("mctype."+$.type),$.releaseTime,$.time),short:$.id}}),F=await E8({message:H("cmd_versions_add_select_version_prompt"),async source($){if(!$)return u;return u.filter((q)=>{return q.name?.toLowerCase().includes($.toLowerCase())})}}),B=await GD({message:H("select_mc_path_prompt"),choices:r.get("paths").map(($)=>{return{value:$,name:$,description:H("select_mc_path_desc"),short:$}})}),E=await T0({message:H("cmd_versions_enter_game_name_prompt"),default:F.id,validate($){if(!$)return H("error_game_name_required");if(!J5($))return H("error_game_name_invalid");if(G0.existsSync($1.default.join(JD(B),"versions",$)))return H("error_game_name_exists",$);return!0}});if(console.log(O.green(H("summary_info"))),console.log(O.green(H("summary_game_name",E))),console.log(O.green(H("summary_version",F.id))),console.log(O.green(H("summary_minecraft_path",B))),!await Q0({message:H("confirm_continue")})){console.log(O.red(H("operation_canceled")));return}console.log(O.green(H("operation_starting"))),await s4(F.url,JD(B),E),console.log(O.green(H("operation_completed")))});J2.command("list").description(H("cmd_versions_list_desc")).action(async()=>{let D=await GD({message:H("select_mc_path_prompt"),choices:r.get("paths").map((B)=>{return{value:B,name:B,description:H("select_mc_path_desc"),short:B}})}),_=await C1(JD(D));if(_.length===0){console.log(O.red(H("error_no_game_installed")));return}let u=await GD({message:H("cmd_versions_list_select_game_prompt"),choices:_.map((B)=>{let E=JSON.parse(G0.readFileSync(`${JD(D)}/versions/${B}/${B}.json`,"utf-8"));return{value:B,name:B,description:H("cmd_versions_list_game_desc",B,E.id),short:B}})}),F=await GD({message:H("cmd_versions_list_select_action_prompt"),choices:[{value:"launch",name:H("cmd_versions_action_launch"),description:H("cmd_versions_action_launch_desc")},{value:"edit",name:H("cmd_versions_action_edit"),description:H("cmd_versions_action_edit_desc")},{value:"delete",name:H("cmd_versions_action_delete"),description:H("cmd_versions_action_delete_desc")}]});if(F==="launch")console.log(O.green(H("operation_launching"))),await r4(JD(D),u);else if(F==="edit")console.log(O.yellow(H("cmd_versions_action_edit_todo")));else if(F==="delete")if(await Q0({message:H("cmd_versions_action_delete_confirm",u),default:!1}))console.log(O.green(H("operation_starting"))),o4(JD(D),u),console.log(O.green(H("operation_completed")));else console.log(O.red(H("operation_canceled")))});$0.addCommand(J2);var Q2=new m0;Q2.name("settings").description(H("cmd_settings_desc"));Q2.command("mirror").description(H("cmd_settings_mirror_desc")).action(async()=>{let D=await GD({message:H("cmd_settings_mirror_select_prompt",r.get("mirror")),default:r.get("mirror"),choices:[{value:"official",name:H("cmd_settings_mirror_option_official"),description:H("cmd_settings_mirror_option_official_desc")},{value:"bmclapi",name:H("cmd_settings_mirror_option_bmclapi"),description:H("cmd_settings_mirror_option_bmclapi_desc")}]});r.set("mirror",D),console.log(O.green(H("cmd_settings_mirror_set_success",D)))});var t4=Q2.command("paths").description(H("cmd_settings_paths_desc"));t4.command("add").description(H("cmd_settings_paths_add_desc")).action(async()=>{let D=r.get("paths"),_=await T0({message:H("cmd_settings_paths_add_prompt"),validate(F){if(!F)return H("error_path_required");if(!G0.existsSync(JD(F)))return H("error_path_not_exist");if(!G0.statSync(JD(F)).isDirectory())return H("error_path_not_directory");if(D.includes(F)||D.includes(JD(F)))return H("error_path_already_added");return!0}}),u=$1.default.resolve(JD(_));D.push(u),r.set("paths",D),console.log(O.green(H("cmd_settings_paths_add_success",u)))});t4.command("list").description(H("cmd_settings_paths_list_desc")).action(async()=>{let D=r.get("paths");if(D.length===0){console.log(O.red(H("error_no_path_added")));return}let _=await GD({message:H("cmd_settings_paths_list_select_prompt"),choices:D.map((F)=>{return{value:F,name:F,description:H("cmd_settings_paths_list_select_desc"),short:F}})}),u=await GD({message:H("cmd_settings_paths_list_select_action_prompt"),choices:[{value:"info",name:H("cmd_settings_paths_list_action_info"),description:H("cmd_settings_paths_list_action_info_desc")},{value:"remove",name:H("cmd_settings_paths_list_action_remove"),description:H("cmd_settings_paths_list_action_remove_desc")}]});if(u==="info"){console.log(O.blue(H("cmd_settings_paths_list_info_path",_)));let F=await C1(JD(_));if(F.length===0){console.log(O.red(H("error_no_game_installed")));return}console.log(O.blue(H("cmd_settings_paths_list_info_games")));for(let B of F){let E=JSON.parse(G0.readFileSync(`${JD(_)}/versions/${B}/${B}.json`,"utf-8"));console.log(O.blue(H("cmd_settings_paths_list_info_game_entry",B,E.id)))}}else if(u==="remove")if(await Q0({message:H("cmd_settings_paths_list_action_remove_confirm",_),default:!1}))console.log(O.green(H("operation_starting"))),r.set("paths",D.filter((B)=>B!==_)),console.log(O.green(H("operation_completed")));else console.log(O.red(H("operation_canceled")))});Q2.command("lang").description(H("cmd_settings_lang_desc")).action(async()=>{let D=await GD({message:H("cmd_settings_lang_select_prompt",r.get("lang")),default:r.get("lang"),choices:Object.keys(M3).map((_)=>{return{value:_,name:`${M3[_].lang_name} (${_})`,short:_}})});r.set("lang",D),console.log(O.green(H("cmd_settings_lang_set_success",D)))});$0.addCommand(Q2);var V3=new m0;V3.name("users").description(H("cmd_users_desc"));V3.command("add").description(H("cmd_users_add_desc")).action(async()=>{if(await GD({message:H("cmd_users_add_select_type_prompt"),choices:[{value:"offline",name:H("cmd_users_add_type_offline"),description:H("cmd_users_add_type_offline_desc")},{value:"microsoft",name:H("cmd_users_add_type_microsoft"),description:H("cmd_users_add_type_microsoft_desc")}]})==="offline"){let _=await T0({message:H("cmd_users_add_name_prompt"),validate(B){if(!B)return H("error_name_required");if(!/^[a-zA-Z0-9_]{3,16}$/.test(B))return H("error_name_invalid");return!0}}),u=await T0({message:H("cmd_users_add_uuid_prompt"),default:g4(_),validate(B){if(!f4(B))return H("error_uuid_invalid");return!0}});m4({name:_,uuid:u,type:"offline"}),console.log(O.green(H("cmd_users_add_success",_)))}});V3.command("list").description(H("cmd_users_list_desc")).action(async()=>{let D=H3();if(D.length===0){console.log(O.red(H("error_no_users")));return}let _=await GD({message:H("cmd_users_list_select_user_prompt"),choices:D.map((F)=>{return{value:F,name:`${F.name} (${F.type})`,description:H("cmd_users_list_user_desc",F.name,F.uuid,F.type),short:F.name}})}),u=await GD({message:H("cmd_users_list_select_action_prompt"),choices:[{value:"info",name:H("cmd_users_list_action_info"),description:H("cmd_users_list_action_info_desc")},{value:"delete",name:H("cmd_users_list_action_delete"),description:H("cmd_users_list_action_delete_desc")}]});if(u==="info")console.log(O.green(H("cmd_users_list_info_name",_.name))),console.log(O.green(H("cmd_users_list_info_uuid",_.uuid))),console.log(O.green(H("cmd_users_list_info_type",_.type)));else if(u==="delete")if(await Q0({message:H("cmd_users_list_action_delete_confirm",_.name),default:!1}))d4(_),console.log(O.green(H("cmd_users_list_action_delete_success")));else console.log(O.red(H("cmd_users_list_action_delete_cancel")))});$0.addCommand(V3);if($0.args.length===0&&$0.commands.length===0)$0.help();$0.parse();