siteon 1.4.2 → 1.5.4

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/index.js +425 -239
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1,73 +1,74 @@
1
1
  #!/usr/bin/env node
2
- import{createRequire as hE}from"node:module";var zE=Object.create;var{getPrototypeOf:rE,defineProperty:eu,getOwnPropertyNames:LE}=Object;var ME=Object.prototype.hasOwnProperty;var TD=(D,u,F)=>{F=D!=null?zE(rE(D)):{};let E=u||!D||!D.__esModule?eu(F,"default",{value:D,enumerable:!0}):F;for(let B of LE(D))if(!ME.call(E,B))eu(E,B,{get:()=>D[B],enumerable:!0});return E};var U=(D,u)=>()=>(u||D((u={exports:{}}).exports,u),u.exports);var a=hE(import.meta.url);var ID=U((RE)=>{class oD extends Error{constructor(D,u,F){super(F);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=u,this.exitCode=D,this.nestedError=void 0}}class D0 extends oD{constructor(D){super(1,"commander.invalidArgument",D);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}RE.CommanderError=oD;RE.InvalidArgumentError=D0});var KD=U((WE)=>{var{InvalidArgumentError:IE}=ID();class u0{constructor(D,u){switch(this.description=u||"",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,u){if(u===this.defaultValue||!Array.isArray(u))return[D];return u.concat(D)}default(D,u){return this.defaultValue=D,this.defaultValueDescription=u,this}argParser(D){return this.parseArg=D,this}choices(D){return this.argChoices=D.slice(),this.parseArg=(u,F)=>{if(!this.argChoices.includes(u))throw new IE(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._concatValue(u,F);return u},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}}function HE(D){let u=D.name()+(D.variadic===!0?"...":"");return D.required?"<"+u+">":"["+u+"]"}WE.Argument=u0;WE.humanReadableArgName=HE});var eD=U((XE)=>{var{humanReadableArgName:QE}=KD();class F0{constructor(){this.helpWidth=void 0,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}visibleCommands(D){let u=D.commands.filter((E)=>!E._hidden),F=D._getHelpCommand();if(F&&!F._hidden)u.push(F);if(this.sortSubcommands)u.sort((E,B)=>{return E.name().localeCompare(B.name())});return u}compareOptions(D,u){let F=(E)=>{return E.short?E.short.replace(/^-/,""):E.long.replace(/^--/,"")};return F(D).localeCompare(F(u))}visibleOptions(D){let u=D.options.filter((E)=>!E.hidden),F=D._getHelpOption();if(F&&!F.hidden){let E=F.short&&D._findOption(F.short),B=F.long&&D._findOption(F.long);if(!E&&!B)u.push(F);else if(F.long&&!B)u.push(D.createOption(F.long,F.description));else if(F.short&&!E)u.push(D.createOption(F.short,F.description))}if(this.sortOptions)u.sort(this.compareOptions);return u}visibleGlobalOptions(D){if(!this.showGlobalOptions)return[];let u=[];for(let F=D.parent;F;F=F.parent){let E=F.options.filter((B)=>!B.hidden);u.push(...E)}if(this.sortOptions)u.sort(this.compareOptions);return u}visibleArguments(D){if(D._argsDescription)D.registeredArguments.forEach((u)=>{u.description=u.description||D._argsDescription[u.name()]||""});if(D.registeredArguments.find((u)=>u.description))return D.registeredArguments;return[]}subcommandTerm(D){let u=D.registeredArguments.map((F)=>QE(F)).join(" ");return D._name+(D._aliases[0]?"|"+D._aliases[0]:"")+(D.options.length?" [options]":"")+(u?" "+u:"")}optionTerm(D){return D.flags}argumentTerm(D){return D.name()}longestSubcommandTermLength(D,u){return u.visibleCommands(D).reduce((F,E)=>{return Math.max(F,u.subcommandTerm(E).length)},0)}longestOptionTermLength(D,u){return u.visibleOptions(D).reduce((F,E)=>{return Math.max(F,u.optionTerm(E).length)},0)}longestGlobalOptionTermLength(D,u){return u.visibleGlobalOptions(D).reduce((F,E)=>{return Math.max(F,u.optionTerm(E).length)},0)}longestArgumentTermLength(D,u){return u.visibleArguments(D).reduce((F,E)=>{return Math.max(F,u.argumentTerm(E).length)},0)}commandUsage(D){let u=D._name;if(D._aliases[0])u=u+"|"+D._aliases[0];let F="";for(let E=D.parent;E;E=E.parent)F=E.name()+" "+F;return F+u+" "+D.usage()}commandDescription(D){return D.description()}subcommandDescription(D){return D.summary()||D.description()}optionDescription(D){let u=[];if(D.argChoices)u.push(`choices: ${D.argChoices.map((F)=>JSON.stringify(F)).join(", ")}`);if(D.defaultValue!==void 0){if(D.required||D.optional||D.isBoolean()&&typeof D.defaultValue==="boolean")u.push(`default: ${D.defaultValueDescription||JSON.stringify(D.defaultValue)}`)}if(D.presetArg!==void 0&&D.optional)u.push(`preset: ${JSON.stringify(D.presetArg)}`);if(D.envVar!==void 0)u.push(`env: ${D.envVar}`);if(u.length>0)return`${D.description} (${u.join(", ")})`;return D.description}argumentDescription(D){let u=[];if(D.argChoices)u.push(`choices: ${D.argChoices.map((F)=>JSON.stringify(F)).join(", ")}`);if(D.defaultValue!==void 0)u.push(`default: ${D.defaultValueDescription||JSON.stringify(D.defaultValue)}`);if(u.length>0){let F=`(${u.join(", ")})`;if(D.description)return`${D.description} ${F}`;return F}return D.description}formatHelp(D,u){let F=u.padWidth(D,u),E=u.helpWidth||80,B=2,_=2;function A(z,L){if(L){let R=`${z.padEnd(F+2)}${L}`;return u.wrap(R,E-2,F+2)}return z}function C(z){return z.join(`
3
- `).replace(/^/gm," ".repeat(2))}let $=[`Usage: ${u.commandUsage(D)}`,""],w=u.commandDescription(D);if(w.length>0)$=$.concat([u.wrap(w,E,0),""]);let S=u.visibleArguments(D).map((z)=>{return A(u.argumentTerm(z),u.argumentDescription(z))});if(S.length>0)$=$.concat(["Arguments:",C(S),""]);let q=u.visibleOptions(D).map((z)=>{return A(u.optionTerm(z),u.optionDescription(z))});if(q.length>0)$=$.concat(["Options:",C(q),""]);if(this.showGlobalOptions){let z=u.visibleGlobalOptions(D).map((L)=>{return A(u.optionTerm(L),u.optionDescription(L))});if(z.length>0)$=$.concat(["Global Options:",C(z),""])}let M=u.visibleCommands(D).map((z)=>{return A(u.subcommandTerm(z),u.subcommandDescription(z))});if(M.length>0)$=$.concat(["Commands:",C(M),""]);return $.join(`
2
+ import{createRequire as UE}from"node:module";var zE=Object.create;var{getPrototypeOf:LE,defineProperty:D0,getOwnPropertyNames:SE}=Object;var TE=Object.prototype.hasOwnProperty;var RD=(D,u,F)=>{F=D!=null?zE(LE(D)):{};let E=u||!D||!D.__esModule?D0(F,"default",{value:D,enumerable:!0}):F;for(let B of SE(D))if(!TE.call(E,B))D0(E,B,{get:()=>D[B],enumerable:!0});return E};var U=(D,u)=>()=>(u||D((u={exports:{}}).exports,u),u.exports);var a=UE(import.meta.url);var HD=U((hE)=>{class eD extends Error{constructor(D,u,F){super(F);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=u,this.exitCode=D,this.nestedError=void 0}}class u0 extends eD{constructor(D){super(1,"commander.invalidArgument",D);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}hE.CommanderError=eD;hE.InvalidArgumentError=u0});var yD=U((GE)=>{var{InvalidArgumentError:WE}=HD();class F0{constructor(D,u){switch(this.description=u||"",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,u){if(u===this.defaultValue||!Array.isArray(u))return[D];return u.concat(D)}default(D,u){return this.defaultValue=D,this.defaultValueDescription=u,this}argParser(D){return this.parseArg=D,this}choices(D){return this.argChoices=D.slice(),this.parseArg=(u,F)=>{if(!this.argChoices.includes(u))throw new WE(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._concatValue(u,F);return u},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}}function ZE(D){let u=D.name()+(D.variadic===!0?"...":"");return D.required?"<"+u+">":"["+u+"]"}GE.Argument=F0;GE.humanReadableArgName=ZE});var Du=U((JE)=>{var{humanReadableArgName:YE}=yD();class E0{constructor(){this.helpWidth=void 0,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}visibleCommands(D){let u=D.commands.filter((E)=>!E._hidden),F=D._getHelpCommand();if(F&&!F._hidden)u.push(F);if(this.sortSubcommands)u.sort((E,B)=>{return E.name().localeCompare(B.name())});return u}compareOptions(D,u){let F=(E)=>{return E.short?E.short.replace(/^-/,""):E.long.replace(/^--/,"")};return F(D).localeCompare(F(u))}visibleOptions(D){let u=D.options.filter((E)=>!E.hidden),F=D._getHelpOption();if(F&&!F.hidden){let E=F.short&&D._findOption(F.short),B=F.long&&D._findOption(F.long);if(!E&&!B)u.push(F);else if(F.long&&!B)u.push(D.createOption(F.long,F.description));else if(F.short&&!E)u.push(D.createOption(F.short,F.description))}if(this.sortOptions)u.sort(this.compareOptions);return u}visibleGlobalOptions(D){if(!this.showGlobalOptions)return[];let u=[];for(let F=D.parent;F;F=F.parent){let E=F.options.filter((B)=>!B.hidden);u.push(...E)}if(this.sortOptions)u.sort(this.compareOptions);return u}visibleArguments(D){if(D._argsDescription)D.registeredArguments.forEach((u)=>{u.description=u.description||D._argsDescription[u.name()]||""});if(D.registeredArguments.find((u)=>u.description))return D.registeredArguments;return[]}subcommandTerm(D){let u=D.registeredArguments.map((F)=>YE(F)).join(" ");return D._name+(D._aliases[0]?"|"+D._aliases[0]:"")+(D.options.length?" [options]":"")+(u?" "+u:"")}optionTerm(D){return D.flags}argumentTerm(D){return D.name()}longestSubcommandTermLength(D,u){return u.visibleCommands(D).reduce((F,E)=>{return Math.max(F,u.subcommandTerm(E).length)},0)}longestOptionTermLength(D,u){return u.visibleOptions(D).reduce((F,E)=>{return Math.max(F,u.optionTerm(E).length)},0)}longestGlobalOptionTermLength(D,u){return u.visibleGlobalOptions(D).reduce((F,E)=>{return Math.max(F,u.optionTerm(E).length)},0)}longestArgumentTermLength(D,u){return u.visibleArguments(D).reduce((F,E)=>{return Math.max(F,u.argumentTerm(E).length)},0)}commandUsage(D){let u=D._name;if(D._aliases[0])u=u+"|"+D._aliases[0];let F="";for(let E=D.parent;E;E=E.parent)F=E.name()+" "+F;return F+u+" "+D.usage()}commandDescription(D){return D.description()}subcommandDescription(D){return D.summary()||D.description()}optionDescription(D){let u=[];if(D.argChoices)u.push(`choices: ${D.argChoices.map((F)=>JSON.stringify(F)).join(", ")}`);if(D.defaultValue!==void 0){if(D.required||D.optional||D.isBoolean()&&typeof D.defaultValue==="boolean")u.push(`default: ${D.defaultValueDescription||JSON.stringify(D.defaultValue)}`)}if(D.presetArg!==void 0&&D.optional)u.push(`preset: ${JSON.stringify(D.presetArg)}`);if(D.envVar!==void 0)u.push(`env: ${D.envVar}`);if(u.length>0)return`${D.description} (${u.join(", ")})`;return D.description}argumentDescription(D){let u=[];if(D.argChoices)u.push(`choices: ${D.argChoices.map((F)=>JSON.stringify(F)).join(", ")}`);if(D.defaultValue!==void 0)u.push(`default: ${D.defaultValueDescription||JSON.stringify(D.defaultValue)}`);if(u.length>0){let F=`(${u.join(", ")})`;if(D.description)return`${D.description} ${F}`;return F}return D.description}formatHelp(D,u){let F=u.padWidth(D,u),E=u.helpWidth||80,B=2,_=2;function A(q,I){if(I){let T=`${q.padEnd(F+2)}${I}`;return u.wrap(T,E-2,F+2)}return q}function C(q){return q.join(`
3
+ `).replace(/^/gm," ".repeat(2))}let $=[`Usage: ${u.commandUsage(D)}`,""],w=u.commandDescription(D);if(w.length>0)$=$.concat([u.wrap(w,E,0),""]);let r=u.visibleArguments(D).map((q)=>{return A(u.argumentTerm(q),u.argumentDescription(q))});if(r.length>0)$=$.concat(["Arguments:",C(r),""]);let M=u.visibleOptions(D).map((q)=>{return A(u.optionTerm(q),u.optionDescription(q))});if(M.length>0)$=$.concat(["Options:",C(M),""]);if(this.showGlobalOptions){let q=u.visibleGlobalOptions(D).map((I)=>{return A(u.optionTerm(I),u.optionDescription(I))});if(q.length>0)$=$.concat(["Global Options:",C(q),""])}let L=u.visibleCommands(D).map((q)=>{return A(u.subcommandTerm(q),u.subcommandDescription(q))});if(L.length>0)$=$.concat(["Commands:",C(L),""]);return $.join(`
4
4
  `)}padWidth(D,u){return Math.max(u.longestOptionTermLength(D,u),u.longestGlobalOptionTermLength(D,u),u.longestSubcommandTermLength(D,u),u.longestArgumentTermLength(D,u))}wrap(D,u,F,E=40){let _=new RegExp(`[\\n][${" \\f\\t\\v   -    \uFEFF"}]+`);if(D.match(_))return D;let A=u-F;if(A<E)return D;let C=D.slice(0,F),$=D.slice(F).replace(`\r
5
5
  `,`
6
- `),w=" ".repeat(F),q=`\\s${"​"}`,M=new RegExp(`
7
- |.{1,${A-1}}([${q}]|$)|[^${q}]+?([${q}]|$)`,"g"),z=$.match(M)||[];return C+z.map((L,R)=>{if(L===`
8
- `)return"";return(R>0?w:"")+L.trimEnd()}).join(`
9
- `)}}XE.Help=F0});var Du=U((KE)=>{var{InvalidArgumentError:JE}=ID();class E0{constructor(D,u){this.flags=D,this.description=u||"",this.required=D.includes("<"),this.optional=D.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(D),this.mandatory=!1;let F=VE(D);if(this.short=F.shortFlag,this.long=F.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,u){return this.defaultValue=D,this.defaultValueDescription=u,this}preset(D){return this.presetArg=D,this}conflicts(D){return this.conflictsWith=this.conflictsWith.concat(D),this}implies(D){let u=D;if(typeof D==="string")u={[D]:!0};return this.implied=Object.assign(this.implied||{},u),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,u){if(u===this.defaultValue||!Array.isArray(u))return[D];return u.concat(D)}choices(D){return this.argChoices=D.slice(),this.parseArg=(u,F)=>{if(!this.argChoices.includes(u))throw new JE(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._concatValue(u,F);return u},this}name(){if(this.long)return this.long.replace(/^--/,"");return this.short.replace(/^-/,"")}attributeName(){return jE(this.name().replace(/^no-/,""))}is(D){return this.short===D||this.long===D}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class B0{constructor(D){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,D.forEach((u)=>{if(u.negate)this.negativeOptions.set(u.attributeName(),u);else this.positiveOptions.set(u.attributeName(),u)}),this.negativeOptions.forEach((u,F)=>{if(this.positiveOptions.has(F))this.dualOptions.add(F)})}valueFromOption(D,u){let F=u.attributeName();if(!this.dualOptions.has(F))return!0;let E=this.negativeOptions.get(F).presetArg,B=E!==void 0?E:!1;return u.negate===(B===D)}}function jE(D){return D.split("-").reduce((u,F)=>{return u+F[0].toUpperCase()+F.slice(1)})}function VE(D){let u,F,E=D.split(/[ |,]+/);if(E.length>1&&!/^[[<]/.test(E[1]))u=E.shift();if(F=E.shift(),!u&&/^-[^-]$/.test(F))u=F,F=void 0;return{shortFlag:u,longFlag:F}}KE.Option=E0;KE.DualOptions=B0});var _0=U((tE)=>{function PE(D,u){if(Math.abs(D.length-u.length)>3)return Math.max(D.length,u.length);let F=[];for(let E=0;E<=D.length;E++)F[E]=[E];for(let E=0;E<=u.length;E++)F[0][E]=E;for(let E=1;E<=u.length;E++)for(let B=1;B<=D.length;B++){let _=1;if(D[B-1]===u[E-1])_=0;else _=1;if(F[B][E]=Math.min(F[B-1][E]+1,F[B][E-1]+1,F[B-1][E-1]+_),B>1&&E>1&&D[B-1]===u[E-2]&&D[B-2]===u[E-1])F[B][E]=Math.min(F[B][E],F[B-2][E-2]+1)}return F[D.length][u.length]}function OE(D,u){if(!u||u.length===0)return"";u=Array.from(new Set(u));let F=D.startsWith("--");if(F)D=D.slice(2),u=u.map((A)=>A.slice(2));let E=[],B=3,_=0.4;if(u.forEach((A)=>{if(A.length<=1)return;let C=PE(D,A),$=Math.max(D.length,A.length);if(($-C)/$>_){if(C<B)B=C,E=[A];else if(C===B)E.push(A)}}),E.sort((A,C)=>A.localeCompare(C)),F)E=E.map((A)=>`--${A}`);if(E.length>1)return`
6
+ `),w=" ".repeat(F),M=`\\s${"​"}`,L=new RegExp(`
7
+ |.{1,${A-1}}([${M}]|$)|[^${M}]+?([${M}]|$)`,"g"),q=$.match(L)||[];return C+q.map((I,T)=>{if(I===`
8
+ `)return"";return(T>0?w:"")+I.trimEnd()}).join(`
9
+ `)}}JE.Help=E0});var uu=U((bE)=>{var{InvalidArgumentError:VE}=HD();class B0{constructor(D,u){this.flags=D,this.description=u||"",this.required=D.includes("<"),this.optional=D.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(D),this.mandatory=!1;let F=yE(D);if(this.short=F.shortFlag,this.long=F.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,u){return this.defaultValue=D,this.defaultValueDescription=u,this}preset(D){return this.presetArg=D,this}conflicts(D){return this.conflictsWith=this.conflictsWith.concat(D),this}implies(D){let u=D;if(typeof D==="string")u={[D]:!0};return this.implied=Object.assign(this.implied||{},u),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,u){if(u===this.defaultValue||!Array.isArray(u))return[D];return u.concat(D)}choices(D){return this.argChoices=D.slice(),this.parseArg=(u,F)=>{if(!this.argChoices.includes(u))throw new VE(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._concatValue(u,F);return u},this}name(){if(this.long)return this.long.replace(/^--/,"");return this.short.replace(/^-/,"")}attributeName(){return KE(this.name().replace(/^no-/,""))}is(D){return this.short===D||this.long===D}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class _0{constructor(D){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,D.forEach((u)=>{if(u.negate)this.negativeOptions.set(u.attributeName(),u);else this.positiveOptions.set(u.attributeName(),u)}),this.negativeOptions.forEach((u,F)=>{if(this.positiveOptions.has(F))this.dualOptions.add(F)})}valueFromOption(D,u){let F=u.attributeName();if(!this.dualOptions.has(F))return!0;let E=this.negativeOptions.get(F).presetArg,B=E!==void 0?E:!1;return u.negate===(B===D)}}function KE(D){return D.split("-").reduce((u,F)=>{return u+F[0].toUpperCase()+F.slice(1)})}function yE(D){let u,F,E=D.split(/[ |,]+/);if(E.length>1&&!/^[[<]/.test(E[1]))u=E.shift();if(F=E.shift(),!u&&/^-[^-]$/.test(F))u=F,F=void 0;return{shortFlag:u,longFlag:F}}bE.Option=B0;bE.DualOptions=_0});var C0=U((xE)=>{function OE(D,u){if(Math.abs(D.length-u.length)>3)return Math.max(D.length,u.length);let F=[];for(let E=0;E<=D.length;E++)F[E]=[E];for(let E=0;E<=u.length;E++)F[0][E]=E;for(let E=1;E<=u.length;E++)for(let B=1;B<=D.length;B++){let _=1;if(D[B-1]===u[E-1])_=0;else _=1;if(F[B][E]=Math.min(F[B-1][E]+1,F[B][E-1]+1,F[B-1][E-1]+_),B>1&&E>1&&D[B-1]===u[E-2]&&D[B-2]===u[E-1])F[B][E]=Math.min(F[B][E],F[B-2][E-2]+1)}return F[D.length][u.length]}function NE(D,u){if(!u||u.length===0)return"";u=Array.from(new Set(u));let F=D.startsWith("--");if(F)D=D.slice(2),u=u.map((A)=>A.slice(2));let E=[],B=3,_=0.4;if(u.forEach((A)=>{if(A.length<=1)return;let C=OE(D,A),$=Math.max(D.length,A.length);if(($-C)/$>_){if(C<B)B=C,E=[A];else if(C===B)E.push(A)}}),E.sort((A,C)=>A.localeCompare(C)),F)E=E.map((A)=>`--${A}`);if(E.length>1)return`
10
10
  (Did you mean one of ${E.join(", ")}?)`;if(E.length===1)return`
11
- (Did you mean ${E[0]}?)`;return""}tE.suggestSimilar=OE});var w0=U((sE)=>{var xE=a("node:events").EventEmitter,uu=a("node:child_process"),c=a("node:path"),Fu=a("node:fs"),V=a("node:process"),{Argument:vE,humanReadableArgName:fE}=KD(),{CommanderError:Eu}=ID(),{Help:kE}=eD(),{Option:C0,DualOptions:gE}=Du(),{suggestSimilar:A0}=_0();class Bu extends xE{constructor(D){super();this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!0,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._outputConfiguration={writeOut:(u)=>V.stdout.write(u),writeErr:(u)=>V.stderr.write(u),getOutHelpWidth:()=>V.stdout.isTTY?V.stdout.columns:void 0,getErrHelpWidth:()=>V.stderr.isTTY?V.stderr.columns:void 0,outputError:(u,F)=>F(u)},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 u=this;u;u=u.parent)D.push(u);return D}command(D,u,F){let E=u,B=F;if(typeof E==="object"&&E!==null)B=E,E=null;B=B||{};let[,_,A]=D.match(/([^ ]+) *(.*)/),C=this.createCommand(_);if(E)C.description(E),C._executableHandler=!0;if(B.isDefault)this._defaultCommandName=C._name;if(C._hidden=!!(B.noHelp||B.hidden),C._executableFile=B.executableFile||null,A)C.arguments(A);if(this._registerCommand(C),C.parent=this,C.copyInheritedSettings(this),E)return this;return C}createCommand(D){return new Bu(D)}createHelp(){return Object.assign(new kE,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,u){if(!D._name)throw Error(`Command passed to .addCommand() must have a name
12
- - specify the name in Command constructor or using .name()`);if(u=u||{},u.isDefault)this._defaultCommandName=D._name;if(u.noHelp||u.hidden)D._hidden=!0;return this._registerCommand(D),D.parent=this,D._checkForBrokenPassThrough(),this}createArgument(D,u){return new vE(D,u)}argument(D,u,F,E){let B=this.createArgument(D,u);if(typeof F==="function")B.default(E).argParser(F);else B.default(F);return this.addArgument(B),this}arguments(D){return D.trim().split(/ +/).forEach((u)=>{this.argument(u)}),this}addArgument(D){let u=this.registeredArguments.slice(-1)[0];if(u&&u.variadic)throw Error(`only the last argument can be variadic '${u.name()}'`);if(D.required&&D.defaultValue!==void 0&&D.parseArg===void 0)throw Error(`a default value for a required argument is never used: '${D.name()}'`);return this.registeredArguments.push(D),this}helpCommand(D,u){if(typeof D==="boolean")return this._addImplicitHelpCommand=D,this;D=D??"help [command]";let[,F,E]=D.match(/([^ ]+) *(.*)/),B=u??"display help for command",_=this.createCommand(F);if(_.helpOption(!1),E)_.arguments(E);if(B)_.description(B);return this._addImplicitHelpCommand=!0,this._helpCommand=_,this}addHelpCommand(D,u){if(typeof D!=="object")return this.helpCommand(D,u),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,u){let F=["preSubcommand","preAction","postAction"];if(!F.includes(D))throw Error(`Unexpected value for event passed to hook : '${D}'.
13
- Expecting one of '${F.join("', '")}'`);if(this._lifeCycleHooks[D])this._lifeCycleHooks[D].push(u);else this._lifeCycleHooks[D]=[u];return this}exitOverride(D){if(D)this._exitCallback=D;else this._exitCallback=(u)=>{if(u.code!=="commander.executeSubCommandAsync")throw u};return this}_exit(D,u,F){if(this._exitCallback)this._exitCallback(new Eu(D,u,F));V.exit(D)}action(D){let u=(F)=>{let E=this.registeredArguments.length,B=F.slice(0,E);if(this._storeOptionsAsProperties)B[E]=this;else B[E]=this.opts();return B.push(this),D.apply(this,B)};return this._actionHandler=u,this}createOption(D,u){return new C0(D,u)}_callParseArg(D,u,F,E){try{return D.parseArg(u,F)}catch(B){if(B.code==="commander.invalidArgument"){let _=`${E} ${B.message}`;this.error(_,{exitCode:B.exitCode,code:B.code})}throw B}}_registerOption(D){let u=D.short&&this._findOption(D.short)||D.long&&this._findOption(D.long);if(u){let F=D.long&&this._findOption(D.long)?D.long:D.short;throw Error(`Cannot add option '${D.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${F}'
14
- - already used by option '${u.flags}'`)}this.options.push(D)}_registerCommand(D){let u=(E)=>{return[E.name()].concat(E.aliases())},F=u(D).find((E)=>this._findCommand(E));if(F){let E=u(this._findCommand(F)).join("|"),B=u(D).join("|");throw Error(`cannot add command '${B}' as already have command '${E}'`)}this.commands.push(D)}addOption(D){this._registerOption(D);let u=D.name(),F=D.attributeName();if(D.negate){let B=D.long.replace(/^--no-/,"--");if(!this._findOption(B))this.setOptionValueWithSource(F,D.defaultValue===void 0?!0:D.defaultValue,"default")}else if(D.defaultValue!==void 0)this.setOptionValueWithSource(F,D.defaultValue,"default");let E=(B,_,A)=>{if(B==null&&D.presetArg!==void 0)B=D.presetArg;let C=this.getOptionValue(F);if(B!==null&&D.parseArg)B=this._callParseArg(D,B,C,_);else if(B!==null&&D.variadic)B=D._concatValue(B,C);if(B==null)if(D.negate)B=!1;else if(D.isBoolean()||D.optional)B=!0;else B="";this.setOptionValueWithSource(F,B,A)};if(this.on("option:"+u,(B)=>{let _=`error: option '${D.flags}' argument '${B}' is invalid.`;E(B,_,"cli")}),D.envVar)this.on("optionEnv:"+u,(B)=>{let _=`error: option '${D.flags}' value '${B}' from env '${D.envVar}' is invalid.`;E(B,_,"env")});return this}_optionEx(D,u,F,E,B){if(typeof u==="object"&&u instanceof C0)throw Error("To add an Option object use addOption() instead of option() or requiredOption()");let _=this.createOption(u,F);if(_.makeOptionMandatory(!!D.mandatory),typeof E==="function")_.default(B).argParser(E);else if(E instanceof RegExp){let A=E;E=(C,$)=>{let w=A.exec(C);return w?w[0]:$},_.default(B).argParser(E)}else _.default(E);return this.addOption(_)}option(D,u,F,E){return this._optionEx({},D,u,F,E)}requiredOption(D,u,F,E){return this._optionEx({mandatory:!0},D,u,F,E)}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 Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(D=!0){if(this.options.length)throw Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw 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,u){return this.setOptionValueWithSource(D,u,void 0)}setOptionValueWithSource(D,u,F){if(this._storeOptionsAsProperties)this[D]=u;else this._optionValues[D]=u;return this._optionValueSources[D]=F,this}getOptionValueSource(D){return this._optionValueSources[D]}getOptionValueSourceWithGlobals(D){let u;return this._getCommandAndAncestors().forEach((F)=>{if(F.getOptionValueSource(D)!==void 0)u=F.getOptionValueSource(D)}),u}_prepareUserArgs(D,u){if(D!==void 0&&!Array.isArray(D))throw Error("first parameter to parse must be array or undefined");if(u=u||{},D===void 0&&u.from===void 0){if(V.versions?.electron)u.from="electron";let E=V.execArgv??[];if(E.includes("-e")||E.includes("--eval")||E.includes("-p")||E.includes("--print"))u.from="eval"}if(D===void 0)D=V.argv;this.rawArgs=D.slice();let F;switch(u.from){case void 0:case"node":this._scriptPath=D[1],F=D.slice(2);break;case"electron":if(V.defaultApp)this._scriptPath=D[1],F=D.slice(2);else F=D.slice(1);break;case"user":F=D.slice(0);break;case"eval":F=D.slice(1);break;default:throw Error(`unexpected parse option { from: '${u.from}' }`)}if(!this._name&&this._scriptPath)this.nameFromFilename(this._scriptPath);return this._name=this._name||"program",F}parse(D,u){let F=this._prepareUserArgs(D,u);return this._parseCommand([],F),this}async parseAsync(D,u){let F=this._prepareUserArgs(D,u);return await this._parseCommand([],F),this}_executeSubCommand(D,u){u=u.slice();let F=!1,E=[".js",".ts",".tsx",".mjs",".cjs"];function B(w,S){let q=c.resolve(w,S);if(Fu.existsSync(q))return q;if(E.includes(c.extname(S)))return;let M=E.find((z)=>Fu.existsSync(`${q}${z}`));if(M)return`${q}${M}`;return}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let _=D._executableFile||`${this._name}-${D._name}`,A=this._executableDir||"";if(this._scriptPath){let w;try{w=Fu.realpathSync(this._scriptPath)}catch(S){w=this._scriptPath}A=c.resolve(c.dirname(w),A)}if(A){let w=B(A,_);if(!w&&!D._executableFile&&this._scriptPath){let S=c.basename(this._scriptPath,c.extname(this._scriptPath));if(S!==this._name)w=B(A,`${S}-${D._name}`)}_=w||_}F=E.includes(c.extname(_));let C;if(V.platform!=="win32")if(F)u.unshift(_),u=$0(V.execArgv).concat(u),C=uu.spawn(V.argv[0],u,{stdio:"inherit"});else C=uu.spawn(_,u,{stdio:"inherit"});else u.unshift(_),u=$0(V.execArgv).concat(u),C=uu.spawn(V.execPath,u,{stdio:"inherit"});if(!C.killed)["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((S)=>{V.on(S,()=>{if(C.killed===!1&&C.exitCode===null)C.kill(S)})});let $=this._exitCallback;C.on("close",(w)=>{if(w=w??1,!$)V.exit(w);else $(new Eu(w,"commander.executeSubCommandAsync","(close)"))}),C.on("error",(w)=>{if(w.code==="ENOENT"){let S=A?`searched for local subcommand relative to directory '${A}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",q=`'${_}' does not exist
11
+ (Did you mean ${E[0]}?)`;return""}xE.suggestSimilar=NE});var r0=U((mE)=>{var vE=a("node:events").EventEmitter,Fu=a("node:child_process"),c=a("node:path"),Eu=a("node:fs"),V=a("node:process"),{Argument:kE,humanReadableArgName:sE}=yD(),{CommanderError:Bu}=HD(),{Help:gE}=Du(),{Option:A0,DualOptions:dE}=uu(),{suggestSimilar:$0}=C0();class _u extends vE{constructor(D){super();this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!0,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._outputConfiguration={writeOut:(u)=>V.stdout.write(u),writeErr:(u)=>V.stderr.write(u),getOutHelpWidth:()=>V.stdout.isTTY?V.stdout.columns:void 0,getErrHelpWidth:()=>V.stderr.isTTY?V.stderr.columns:void 0,outputError:(u,F)=>F(u)},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 u=this;u;u=u.parent)D.push(u);return D}command(D,u,F){let E=u,B=F;if(typeof E==="object"&&E!==null)B=E,E=null;B=B||{};let[,_,A]=D.match(/([^ ]+) *(.*)/),C=this.createCommand(_);if(E)C.description(E),C._executableHandler=!0;if(B.isDefault)this._defaultCommandName=C._name;if(C._hidden=!!(B.noHelp||B.hidden),C._executableFile=B.executableFile||null,A)C.arguments(A);if(this._registerCommand(C),C.parent=this,C.copyInheritedSettings(this),E)return this;return C}createCommand(D){return new _u(D)}createHelp(){return Object.assign(new gE,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,u){if(!D._name)throw Error(`Command passed to .addCommand() must have a name
12
+ - specify the name in Command constructor or using .name()`);if(u=u||{},u.isDefault)this._defaultCommandName=D._name;if(u.noHelp||u.hidden)D._hidden=!0;return this._registerCommand(D),D.parent=this,D._checkForBrokenPassThrough(),this}createArgument(D,u){return new kE(D,u)}argument(D,u,F,E){let B=this.createArgument(D,u);if(typeof F==="function")B.default(E).argParser(F);else B.default(F);return this.addArgument(B),this}arguments(D){return D.trim().split(/ +/).forEach((u)=>{this.argument(u)}),this}addArgument(D){let u=this.registeredArguments.slice(-1)[0];if(u&&u.variadic)throw Error(`only the last argument can be variadic '${u.name()}'`);if(D.required&&D.defaultValue!==void 0&&D.parseArg===void 0)throw Error(`a default value for a required argument is never used: '${D.name()}'`);return this.registeredArguments.push(D),this}helpCommand(D,u){if(typeof D==="boolean")return this._addImplicitHelpCommand=D,this;D=D??"help [command]";let[,F,E]=D.match(/([^ ]+) *(.*)/),B=u??"display help for command",_=this.createCommand(F);if(_.helpOption(!1),E)_.arguments(E);if(B)_.description(B);return this._addImplicitHelpCommand=!0,this._helpCommand=_,this}addHelpCommand(D,u){if(typeof D!=="object")return this.helpCommand(D,u),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,u){let F=["preSubcommand","preAction","postAction"];if(!F.includes(D))throw Error(`Unexpected value for event passed to hook : '${D}'.
13
+ Expecting one of '${F.join("', '")}'`);if(this._lifeCycleHooks[D])this._lifeCycleHooks[D].push(u);else this._lifeCycleHooks[D]=[u];return this}exitOverride(D){if(D)this._exitCallback=D;else this._exitCallback=(u)=>{if(u.code!=="commander.executeSubCommandAsync")throw u};return this}_exit(D,u,F){if(this._exitCallback)this._exitCallback(new Bu(D,u,F));V.exit(D)}action(D){let u=(F)=>{let E=this.registeredArguments.length,B=F.slice(0,E);if(this._storeOptionsAsProperties)B[E]=this;else B[E]=this.opts();return B.push(this),D.apply(this,B)};return this._actionHandler=u,this}createOption(D,u){return new A0(D,u)}_callParseArg(D,u,F,E){try{return D.parseArg(u,F)}catch(B){if(B.code==="commander.invalidArgument"){let _=`${E} ${B.message}`;this.error(_,{exitCode:B.exitCode,code:B.code})}throw B}}_registerOption(D){let u=D.short&&this._findOption(D.short)||D.long&&this._findOption(D.long);if(u){let F=D.long&&this._findOption(D.long)?D.long:D.short;throw Error(`Cannot add option '${D.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${F}'
14
+ - already used by option '${u.flags}'`)}this.options.push(D)}_registerCommand(D){let u=(E)=>{return[E.name()].concat(E.aliases())},F=u(D).find((E)=>this._findCommand(E));if(F){let E=u(this._findCommand(F)).join("|"),B=u(D).join("|");throw Error(`cannot add command '${B}' as already have command '${E}'`)}this.commands.push(D)}addOption(D){this._registerOption(D);let u=D.name(),F=D.attributeName();if(D.negate){let B=D.long.replace(/^--no-/,"--");if(!this._findOption(B))this.setOptionValueWithSource(F,D.defaultValue===void 0?!0:D.defaultValue,"default")}else if(D.defaultValue!==void 0)this.setOptionValueWithSource(F,D.defaultValue,"default");let E=(B,_,A)=>{if(B==null&&D.presetArg!==void 0)B=D.presetArg;let C=this.getOptionValue(F);if(B!==null&&D.parseArg)B=this._callParseArg(D,B,C,_);else if(B!==null&&D.variadic)B=D._concatValue(B,C);if(B==null)if(D.negate)B=!1;else if(D.isBoolean()||D.optional)B=!0;else B="";this.setOptionValueWithSource(F,B,A)};if(this.on("option:"+u,(B)=>{let _=`error: option '${D.flags}' argument '${B}' is invalid.`;E(B,_,"cli")}),D.envVar)this.on("optionEnv:"+u,(B)=>{let _=`error: option '${D.flags}' value '${B}' from env '${D.envVar}' is invalid.`;E(B,_,"env")});return this}_optionEx(D,u,F,E,B){if(typeof u==="object"&&u instanceof A0)throw Error("To add an Option object use addOption() instead of option() or requiredOption()");let _=this.createOption(u,F);if(_.makeOptionMandatory(!!D.mandatory),typeof E==="function")_.default(B).argParser(E);else if(E instanceof RegExp){let A=E;E=(C,$)=>{let w=A.exec(C);return w?w[0]:$},_.default(B).argParser(E)}else _.default(E);return this.addOption(_)}option(D,u,F,E){return this._optionEx({},D,u,F,E)}requiredOption(D,u,F,E){return this._optionEx({mandatory:!0},D,u,F,E)}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 Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(D=!0){if(this.options.length)throw Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw 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,u){return this.setOptionValueWithSource(D,u,void 0)}setOptionValueWithSource(D,u,F){if(this._storeOptionsAsProperties)this[D]=u;else this._optionValues[D]=u;return this._optionValueSources[D]=F,this}getOptionValueSource(D){return this._optionValueSources[D]}getOptionValueSourceWithGlobals(D){let u;return this._getCommandAndAncestors().forEach((F)=>{if(F.getOptionValueSource(D)!==void 0)u=F.getOptionValueSource(D)}),u}_prepareUserArgs(D,u){if(D!==void 0&&!Array.isArray(D))throw Error("first parameter to parse must be array or undefined");if(u=u||{},D===void 0&&u.from===void 0){if(V.versions?.electron)u.from="electron";let E=V.execArgv??[];if(E.includes("-e")||E.includes("--eval")||E.includes("-p")||E.includes("--print"))u.from="eval"}if(D===void 0)D=V.argv;this.rawArgs=D.slice();let F;switch(u.from){case void 0:case"node":this._scriptPath=D[1],F=D.slice(2);break;case"electron":if(V.defaultApp)this._scriptPath=D[1],F=D.slice(2);else F=D.slice(1);break;case"user":F=D.slice(0);break;case"eval":F=D.slice(1);break;default:throw Error(`unexpected parse option { from: '${u.from}' }`)}if(!this._name&&this._scriptPath)this.nameFromFilename(this._scriptPath);return this._name=this._name||"program",F}parse(D,u){let F=this._prepareUserArgs(D,u);return this._parseCommand([],F),this}async parseAsync(D,u){let F=this._prepareUserArgs(D,u);return await this._parseCommand([],F),this}_executeSubCommand(D,u){u=u.slice();let F=!1,E=[".js",".ts",".tsx",".mjs",".cjs"];function B(w,r){let M=c.resolve(w,r);if(Eu.existsSync(M))return M;if(E.includes(c.extname(r)))return;let L=E.find((q)=>Eu.existsSync(`${M}${q}`));if(L)return`${M}${L}`;return}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let _=D._executableFile||`${this._name}-${D._name}`,A=this._executableDir||"";if(this._scriptPath){let w;try{w=Eu.realpathSync(this._scriptPath)}catch(r){w=this._scriptPath}A=c.resolve(c.dirname(w),A)}if(A){let w=B(A,_);if(!w&&!D._executableFile&&this._scriptPath){let r=c.basename(this._scriptPath,c.extname(this._scriptPath));if(r!==this._name)w=B(A,`${r}-${D._name}`)}_=w||_}F=E.includes(c.extname(_));let C;if(V.platform!=="win32")if(F)u.unshift(_),u=w0(V.execArgv).concat(u),C=Fu.spawn(V.argv[0],u,{stdio:"inherit"});else C=Fu.spawn(_,u,{stdio:"inherit"});else u.unshift(_),u=w0(V.execArgv).concat(u),C=Fu.spawn(V.execPath,u,{stdio:"inherit"});if(!C.killed)["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((r)=>{V.on(r,()=>{if(C.killed===!1&&C.exitCode===null)C.kill(r)})});let $=this._exitCallback;C.on("close",(w)=>{if(w=w??1,!$)V.exit(w);else $(new Bu(w,"commander.executeSubCommandAsync","(close)"))}),C.on("error",(w)=>{if(w.code==="ENOENT"){let r=A?`searched for local subcommand relative to directory '${A}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",M=`'${_}' does not exist
15
15
  - if '${D._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
16
16
  - if the default executable name is not suitable, use the executableFile option to supply a custom name or path
17
- - ${S}`;throw Error(q)}else if(w.code==="EACCES")throw Error(`'${_}' not executable`);if(!$)V.exit(1);else{let S=new Eu(1,"commander.executeSubCommandAsync","(error)");S.nestedError=w,$(S)}}),this.runningCommand=C}_dispatchSubcommand(D,u,F){let E=this._findCommand(D);if(!E)this.help({error:!0});let B;return B=this._chainOrCallSubCommandHook(B,E,"preSubcommand"),B=this._chainOrCall(B,()=>{if(E._executableHandler)this._executeSubCommand(E,u.concat(F));else return E._parseCommand(u,F)}),B}_dispatchHelpCommand(D){if(!D)this.help();let u=this._findCommand(D);if(u&&!u._executableHandler)u.help();return this._dispatchSubcommand(D,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){if(this.registeredArguments.forEach((D,u)=>{if(D.required&&this.args[u]==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=(F,E,B)=>{let _=E;if(E!==null&&F.parseArg){let A=`error: command-argument value '${E}' is invalid for argument '${F.name()}'.`;_=this._callParseArg(F,E,B,A)}return _};this._checkNumberOfArguments();let u=[];this.registeredArguments.forEach((F,E)=>{let B=F.defaultValue;if(F.variadic){if(E<this.args.length){if(B=this.args.slice(E),F.parseArg)B=B.reduce((_,A)=>{return D(F,A,_)},F.defaultValue)}else if(B===void 0)B=[]}else if(E<this.args.length){if(B=this.args[E],F.parseArg)B=D(F,B,F.defaultValue)}u[E]=B}),this.processedArgs=u}_chainOrCall(D,u){if(D&&D.then&&typeof D.then==="function")return D.then(()=>u());return u()}_chainOrCallHooks(D,u){let F=D,E=[];if(this._getCommandAndAncestors().reverse().filter((B)=>B._lifeCycleHooks[u]!==void 0).forEach((B)=>{B._lifeCycleHooks[u].forEach((_)=>{E.push({hookedCommand:B,callback:_})})}),u==="postAction")E.reverse();return E.forEach((B)=>{F=this._chainOrCall(F,()=>{return B.callback(B.hookedCommand,this)})}),F}_chainOrCallSubCommandHook(D,u,F){let E=D;if(this._lifeCycleHooks[F]!==void 0)this._lifeCycleHooks[F].forEach((B)=>{E=this._chainOrCall(E,()=>{return B(this,u)})});return E}_parseCommand(D,u){let F=this.parseOptions(u);if(this._parseOptionsEnv(),this._parseOptionsImplied(),D=D.concat(F.operands),u=F.unknown,this.args=D.concat(u),D&&this._findCommand(D[0]))return this._dispatchSubcommand(D[0],D.slice(1),u);if(this._getHelpCommand()&&D[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(D[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(u),this._dispatchSubcommand(this._defaultCommandName,D,u);if(this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName)this.help({error:!0});this._outputHelpIfRequested(F.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let E=()=>{if(F.unknown.length>0)this.unknownOption(F.unknown[0])},B=`command:${this.name()}`;if(this._actionHandler){E(),this._processArguments();let _;if(_=this._chainOrCallHooks(_,"preAction"),_=this._chainOrCall(_,()=>this._actionHandler(this.processedArgs)),this.parent)_=this._chainOrCall(_,()=>{this.parent.emit(B,D,u)});return _=this._chainOrCallHooks(_,"postAction"),_}if(this.parent&&this.parent.listenerCount(B))E(),this._processArguments(),this.parent.emit(B,D,u);else if(D.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",D,u);if(this.listenerCount("command:*"))this.emit("command:*",D,u);else if(this.commands.length)this.unknownCommand();else E(),this._processArguments()}else if(this.commands.length)E(),this.help({error:!0});else E(),this._processArguments()}_findCommand(D){if(!D)return;return this.commands.find((u)=>u._name===D||u._aliases.includes(D))}_findOption(D){return this.options.find((u)=>u.is(D))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach((D)=>{D.options.forEach((u)=>{if(u.mandatory&&D.getOptionValue(u.attributeName())===void 0)D.missingMandatoryOptionValue(u)})})}_checkForConflictingLocalOptions(){let D=this.options.filter((F)=>{let E=F.attributeName();if(this.getOptionValue(E)===void 0)return!1;return this.getOptionValueSource(E)!=="default"});D.filter((F)=>F.conflictsWith.length>0).forEach((F)=>{let E=D.find((B)=>F.conflictsWith.includes(B.attributeName()));if(E)this._conflictingOption(F,E)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach((D)=>{D._checkForConflictingLocalOptions()})}parseOptions(D){let u=[],F=[],E=u,B=D.slice();function _(C){return C.length>1&&C[0]==="-"}let A=null;while(B.length){let C=B.shift();if(C==="--"){if(E===F)E.push(C);E.push(...B);break}if(A&&!_(C)){this.emit(`option:${A.name()}`,C);continue}if(A=null,_(C)){let $=this._findOption(C);if($){if($.required){let w=B.shift();if(w===void 0)this.optionMissingArgument($);this.emit(`option:${$.name()}`,w)}else if($.optional){let w=null;if(B.length>0&&!_(B[0]))w=B.shift();this.emit(`option:${$.name()}`,w)}else this.emit(`option:${$.name()}`);A=$.variadic?$:null;continue}}if(C.length>2&&C[0]==="-"&&C[1]!=="-"){let $=this._findOption(`-${C[1]}`);if($){if($.required||$.optional&&this._combineFlagAndOptionalValue)this.emit(`option:${$.name()}`,C.slice(2));else this.emit(`option:${$.name()}`),B.unshift(`-${C.slice(2)}`);continue}}if(/^--[^=]+=/.test(C)){let $=C.indexOf("="),w=this._findOption(C.slice(0,$));if(w&&(w.required||w.optional)){this.emit(`option:${w.name()}`,C.slice($+1));continue}}if(_(C))E=F;if((this._enablePositionalOptions||this._passThroughOptions)&&u.length===0&&F.length===0){if(this._findCommand(C)){if(u.push(C),B.length>0)F.push(...B);break}else if(this._getHelpCommand()&&C===this._getHelpCommand().name()){if(u.push(C),B.length>0)u.push(...B);break}else if(this._defaultCommandName){if(F.push(C),B.length>0)F.push(...B);break}}if(this._passThroughOptions){if(E.push(C),B.length>0)E.push(...B);break}E.push(C)}return{operands:u,unknown:F}}opts(){if(this._storeOptionsAsProperties){let D={},u=this.options.length;for(let F=0;F<u;F++){let E=this.options[F].attributeName();D[E]=E===this._versionOptionName?this._version:this[E]}return D}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((D,u)=>Object.assign(D,u.opts()),{})}error(D,u){if(this._outputConfiguration.outputError(`${D}
17
+ - ${r}`;throw Error(M)}else if(w.code==="EACCES")throw Error(`'${_}' not executable`);if(!$)V.exit(1);else{let r=new Bu(1,"commander.executeSubCommandAsync","(error)");r.nestedError=w,$(r)}}),this.runningCommand=C}_dispatchSubcommand(D,u,F){let E=this._findCommand(D);if(!E)this.help({error:!0});let B;return B=this._chainOrCallSubCommandHook(B,E,"preSubcommand"),B=this._chainOrCall(B,()=>{if(E._executableHandler)this._executeSubCommand(E,u.concat(F));else return E._parseCommand(u,F)}),B}_dispatchHelpCommand(D){if(!D)this.help();let u=this._findCommand(D);if(u&&!u._executableHandler)u.help();return this._dispatchSubcommand(D,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){if(this.registeredArguments.forEach((D,u)=>{if(D.required&&this.args[u]==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=(F,E,B)=>{let _=E;if(E!==null&&F.parseArg){let A=`error: command-argument value '${E}' is invalid for argument '${F.name()}'.`;_=this._callParseArg(F,E,B,A)}return _};this._checkNumberOfArguments();let u=[];this.registeredArguments.forEach((F,E)=>{let B=F.defaultValue;if(F.variadic){if(E<this.args.length){if(B=this.args.slice(E),F.parseArg)B=B.reduce((_,A)=>{return D(F,A,_)},F.defaultValue)}else if(B===void 0)B=[]}else if(E<this.args.length){if(B=this.args[E],F.parseArg)B=D(F,B,F.defaultValue)}u[E]=B}),this.processedArgs=u}_chainOrCall(D,u){if(D&&D.then&&typeof D.then==="function")return D.then(()=>u());return u()}_chainOrCallHooks(D,u){let F=D,E=[];if(this._getCommandAndAncestors().reverse().filter((B)=>B._lifeCycleHooks[u]!==void 0).forEach((B)=>{B._lifeCycleHooks[u].forEach((_)=>{E.push({hookedCommand:B,callback:_})})}),u==="postAction")E.reverse();return E.forEach((B)=>{F=this._chainOrCall(F,()=>{return B.callback(B.hookedCommand,this)})}),F}_chainOrCallSubCommandHook(D,u,F){let E=D;if(this._lifeCycleHooks[F]!==void 0)this._lifeCycleHooks[F].forEach((B)=>{E=this._chainOrCall(E,()=>{return B(this,u)})});return E}_parseCommand(D,u){let F=this.parseOptions(u);if(this._parseOptionsEnv(),this._parseOptionsImplied(),D=D.concat(F.operands),u=F.unknown,this.args=D.concat(u),D&&this._findCommand(D[0]))return this._dispatchSubcommand(D[0],D.slice(1),u);if(this._getHelpCommand()&&D[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(D[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(u),this._dispatchSubcommand(this._defaultCommandName,D,u);if(this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName)this.help({error:!0});this._outputHelpIfRequested(F.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let E=()=>{if(F.unknown.length>0)this.unknownOption(F.unknown[0])},B=`command:${this.name()}`;if(this._actionHandler){E(),this._processArguments();let _;if(_=this._chainOrCallHooks(_,"preAction"),_=this._chainOrCall(_,()=>this._actionHandler(this.processedArgs)),this.parent)_=this._chainOrCall(_,()=>{this.parent.emit(B,D,u)});return _=this._chainOrCallHooks(_,"postAction"),_}if(this.parent&&this.parent.listenerCount(B))E(),this._processArguments(),this.parent.emit(B,D,u);else if(D.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",D,u);if(this.listenerCount("command:*"))this.emit("command:*",D,u);else if(this.commands.length)this.unknownCommand();else E(),this._processArguments()}else if(this.commands.length)E(),this.help({error:!0});else E(),this._processArguments()}_findCommand(D){if(!D)return;return this.commands.find((u)=>u._name===D||u._aliases.includes(D))}_findOption(D){return this.options.find((u)=>u.is(D))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach((D)=>{D.options.forEach((u)=>{if(u.mandatory&&D.getOptionValue(u.attributeName())===void 0)D.missingMandatoryOptionValue(u)})})}_checkForConflictingLocalOptions(){let D=this.options.filter((F)=>{let E=F.attributeName();if(this.getOptionValue(E)===void 0)return!1;return this.getOptionValueSource(E)!=="default"});D.filter((F)=>F.conflictsWith.length>0).forEach((F)=>{let E=D.find((B)=>F.conflictsWith.includes(B.attributeName()));if(E)this._conflictingOption(F,E)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach((D)=>{D._checkForConflictingLocalOptions()})}parseOptions(D){let u=[],F=[],E=u,B=D.slice();function _(C){return C.length>1&&C[0]==="-"}let A=null;while(B.length){let C=B.shift();if(C==="--"){if(E===F)E.push(C);E.push(...B);break}if(A&&!_(C)){this.emit(`option:${A.name()}`,C);continue}if(A=null,_(C)){let $=this._findOption(C);if($){if($.required){let w=B.shift();if(w===void 0)this.optionMissingArgument($);this.emit(`option:${$.name()}`,w)}else if($.optional){let w=null;if(B.length>0&&!_(B[0]))w=B.shift();this.emit(`option:${$.name()}`,w)}else this.emit(`option:${$.name()}`);A=$.variadic?$:null;continue}}if(C.length>2&&C[0]==="-"&&C[1]!=="-"){let $=this._findOption(`-${C[1]}`);if($){if($.required||$.optional&&this._combineFlagAndOptionalValue)this.emit(`option:${$.name()}`,C.slice(2));else this.emit(`option:${$.name()}`),B.unshift(`-${C.slice(2)}`);continue}}if(/^--[^=]+=/.test(C)){let $=C.indexOf("="),w=this._findOption(C.slice(0,$));if(w&&(w.required||w.optional)){this.emit(`option:${w.name()}`,C.slice($+1));continue}}if(_(C))E=F;if((this._enablePositionalOptions||this._passThroughOptions)&&u.length===0&&F.length===0){if(this._findCommand(C)){if(u.push(C),B.length>0)F.push(...B);break}else if(this._getHelpCommand()&&C===this._getHelpCommand().name()){if(u.push(C),B.length>0)u.push(...B);break}else if(this._defaultCommandName){if(F.push(C),B.length>0)F.push(...B);break}}if(this._passThroughOptions){if(E.push(C),B.length>0)E.push(...B);break}E.push(C)}return{operands:u,unknown:F}}opts(){if(this._storeOptionsAsProperties){let D={},u=this.options.length;for(let F=0;F<u;F++){let E=this.options[F].attributeName();D[E]=E===this._versionOptionName?this._version:this[E]}return D}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((D,u)=>Object.assign(D,u.opts()),{})}error(D,u){if(this._outputConfiguration.outputError(`${D}
18
18
  `,this._outputConfiguration.writeErr),typeof this._showHelpAfterError==="string")this._outputConfiguration.writeErr(`${this._showHelpAfterError}
19
19
  `);else if(this._showHelpAfterError)this._outputConfiguration.writeErr(`
20
- `),this.outputHelp({error:!0});let F=u||{},E=F.exitCode||1,B=F.code||"commander.error";this._exit(E,B,D)}_parseOptionsEnv(){this.options.forEach((D)=>{if(D.envVar&&D.envVar in V.env){let u=D.attributeName();if(this.getOptionValue(u)===void 0||["default","config","env"].includes(this.getOptionValueSource(u)))if(D.required||D.optional)this.emit(`optionEnv:${D.name()}`,V.env[D.envVar]);else this.emit(`optionEnv:${D.name()}`)}})}_parseOptionsImplied(){let D=new gE(this.options),u=(F)=>{return this.getOptionValue(F)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(F))};this.options.filter((F)=>F.implied!==void 0&&u(F.attributeName())&&D.valueFromOption(this.getOptionValue(F.attributeName()),F)).forEach((F)=>{Object.keys(F.implied).filter((E)=>!u(E)).forEach((E)=>{this.setOptionValueWithSource(E,F.implied[E],"implied")})})}missingArgument(D){let u=`error: missing required argument '${D}'`;this.error(u,{code:"commander.missingArgument"})}optionMissingArgument(D){let u=`error: option '${D.flags}' argument missing`;this.error(u,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(D){let u=`error: required option '${D.flags}' not specified`;this.error(u,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(D,u){let F=(_)=>{let A=_.attributeName(),C=this.getOptionValue(A),$=this.options.find((S)=>S.negate&&A===S.attributeName()),w=this.options.find((S)=>!S.negate&&A===S.attributeName());if($&&($.presetArg===void 0&&C===!1||$.presetArg!==void 0&&C===$.presetArg))return $;return w||_},E=(_)=>{let A=F(_),C=A.attributeName();if(this.getOptionValueSource(C)==="env")return`environment variable '${A.envVar}'`;return`option '${A.flags}'`},B=`error: ${E(D)} cannot be used with ${E(u)}`;this.error(B,{code:"commander.conflictingOption"})}unknownOption(D){if(this._allowUnknownOption)return;let u="";if(D.startsWith("--")&&this._showSuggestionAfterError){let E=[],B=this;do{let _=B.createHelp().visibleOptions(B).filter((A)=>A.long).map((A)=>A.long);E=E.concat(_),B=B.parent}while(B&&!B._enablePositionalOptions);u=A0(D,E)}let F=`error: unknown option '${D}'${u}`;this.error(F,{code:"commander.unknownOption"})}_excessArguments(D){if(this._allowExcessArguments)return;let u=this.registeredArguments.length,F=u===1?"":"s",B=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${u} argument${F} but got ${D.length}.`;this.error(B,{code:"commander.excessArguments"})}unknownCommand(){let D=this.args[0],u="";if(this._showSuggestionAfterError){let E=[];this.createHelp().visibleCommands(this).forEach((B)=>{if(E.push(B.name()),B.alias())E.push(B.alias())}),u=A0(D,E)}let F=`error: unknown command '${D}'${u}`;this.error(F,{code:"commander.unknownCommand"})}version(D,u,F){if(D===void 0)return this._version;this._version=D,u=u||"-V, --version",F=F||"output the version number";let E=this.createOption(u,F);return this._versionOptionName=E.attributeName(),this._registerOption(E),this.on("option:"+E.name(),()=>{this._outputConfiguration.writeOut(`${D}
21
- `),this._exit(0,"commander.version",D)}),this}description(D,u){if(D===void 0&&u===void 0)return this._description;if(this._description=D,u)this._argsDescription=u;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 u=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler)u=this.commands[this.commands.length-1];if(D===u._name)throw Error("Command alias can't be the same as its name");let F=this.parent?._findCommand(D);if(F){let E=[F.name()].concat(F.aliases()).join("|");throw Error(`cannot add alias '${D}' to command '${this.name()}' as already have command '${E}'`)}return u._aliases.push(D),this}aliases(D){if(D===void 0)return this._aliases;return D.forEach((u)=>this.alias(u)),this}usage(D){if(D===void 0){if(this._usage)return this._usage;let u=this.registeredArguments.map((F)=>{return fE(F)});return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?u:[]).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=c.basename(D,c.extname(D)),this}executableDir(D){if(D===void 0)return this._executableDir;return this._executableDir=D,this}helpInformation(D){let u=this.createHelp();if(u.helpWidth===void 0)u.helpWidth=D&&D.error?this._outputConfiguration.getErrHelpWidth():this._outputConfiguration.getOutHelpWidth();return u.formatHelp(this,u)}_getHelpContext(D){D=D||{};let u={error:!!D.error},F;if(u.error)F=(E)=>this._outputConfiguration.writeErr(E);else F=(E)=>this._outputConfiguration.writeOut(E);return u.write=D.write||F,u.command=this,u}outputHelp(D){let u;if(typeof D==="function")u=D,D=void 0;let F=this._getHelpContext(D);this._getCommandAndAncestors().reverse().forEach((B)=>B.emit("beforeAllHelp",F)),this.emit("beforeHelp",F);let E=this.helpInformation(F);if(u){if(E=u(E),typeof E!=="string"&&!Buffer.isBuffer(E))throw Error("outputHelp callback must return a string or a Buffer")}if(F.write(E),this._getHelpOption()?.long)this.emit(this._getHelpOption().long);this.emit("afterHelp",F),this._getCommandAndAncestors().forEach((B)=>B.emit("afterAllHelp",F))}helpOption(D,u){if(typeof D==="boolean"){if(D)this._helpOption=this._helpOption??void 0;else this._helpOption=null;return this}return D=D??"-h, --help",u=u??"display help for command",this._helpOption=this.createOption(D,u),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 u=V.exitCode||0;if(u===0&&D&&typeof D!=="function"&&D.error)u=1;this._exit(u,"commander.help","(outputHelp)")}addHelpText(D,u){let F=["beforeAll","before","after","afterAll"];if(!F.includes(D))throw Error(`Unexpected value for position to addHelpText.
20
+ `),this.outputHelp({error:!0});let F=u||{},E=F.exitCode||1,B=F.code||"commander.error";this._exit(E,B,D)}_parseOptionsEnv(){this.options.forEach((D)=>{if(D.envVar&&D.envVar in V.env){let u=D.attributeName();if(this.getOptionValue(u)===void 0||["default","config","env"].includes(this.getOptionValueSource(u)))if(D.required||D.optional)this.emit(`optionEnv:${D.name()}`,V.env[D.envVar]);else this.emit(`optionEnv:${D.name()}`)}})}_parseOptionsImplied(){let D=new dE(this.options),u=(F)=>{return this.getOptionValue(F)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(F))};this.options.filter((F)=>F.implied!==void 0&&u(F.attributeName())&&D.valueFromOption(this.getOptionValue(F.attributeName()),F)).forEach((F)=>{Object.keys(F.implied).filter((E)=>!u(E)).forEach((E)=>{this.setOptionValueWithSource(E,F.implied[E],"implied")})})}missingArgument(D){let u=`error: missing required argument '${D}'`;this.error(u,{code:"commander.missingArgument"})}optionMissingArgument(D){let u=`error: option '${D.flags}' argument missing`;this.error(u,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(D){let u=`error: required option '${D.flags}' not specified`;this.error(u,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(D,u){let F=(_)=>{let A=_.attributeName(),C=this.getOptionValue(A),$=this.options.find((r)=>r.negate&&A===r.attributeName()),w=this.options.find((r)=>!r.negate&&A===r.attributeName());if($&&($.presetArg===void 0&&C===!1||$.presetArg!==void 0&&C===$.presetArg))return $;return w||_},E=(_)=>{let A=F(_),C=A.attributeName();if(this.getOptionValueSource(C)==="env")return`environment variable '${A.envVar}'`;return`option '${A.flags}'`},B=`error: ${E(D)} cannot be used with ${E(u)}`;this.error(B,{code:"commander.conflictingOption"})}unknownOption(D){if(this._allowUnknownOption)return;let u="";if(D.startsWith("--")&&this._showSuggestionAfterError){let E=[],B=this;do{let _=B.createHelp().visibleOptions(B).filter((A)=>A.long).map((A)=>A.long);E=E.concat(_),B=B.parent}while(B&&!B._enablePositionalOptions);u=$0(D,E)}let F=`error: unknown option '${D}'${u}`;this.error(F,{code:"commander.unknownOption"})}_excessArguments(D){if(this._allowExcessArguments)return;let u=this.registeredArguments.length,F=u===1?"":"s",B=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${u} argument${F} but got ${D.length}.`;this.error(B,{code:"commander.excessArguments"})}unknownCommand(){let D=this.args[0],u="";if(this._showSuggestionAfterError){let E=[];this.createHelp().visibleCommands(this).forEach((B)=>{if(E.push(B.name()),B.alias())E.push(B.alias())}),u=$0(D,E)}let F=`error: unknown command '${D}'${u}`;this.error(F,{code:"commander.unknownCommand"})}version(D,u,F){if(D===void 0)return this._version;this._version=D,u=u||"-V, --version",F=F||"output the version number";let E=this.createOption(u,F);return this._versionOptionName=E.attributeName(),this._registerOption(E),this.on("option:"+E.name(),()=>{this._outputConfiguration.writeOut(`${D}
21
+ `),this._exit(0,"commander.version",D)}),this}description(D,u){if(D===void 0&&u===void 0)return this._description;if(this._description=D,u)this._argsDescription=u;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 u=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler)u=this.commands[this.commands.length-1];if(D===u._name)throw Error("Command alias can't be the same as its name");let F=this.parent?._findCommand(D);if(F){let E=[F.name()].concat(F.aliases()).join("|");throw Error(`cannot add alias '${D}' to command '${this.name()}' as already have command '${E}'`)}return u._aliases.push(D),this}aliases(D){if(D===void 0)return this._aliases;return D.forEach((u)=>this.alias(u)),this}usage(D){if(D===void 0){if(this._usage)return this._usage;let u=this.registeredArguments.map((F)=>{return sE(F)});return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?u:[]).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=c.basename(D,c.extname(D)),this}executableDir(D){if(D===void 0)return this._executableDir;return this._executableDir=D,this}helpInformation(D){let u=this.createHelp();if(u.helpWidth===void 0)u.helpWidth=D&&D.error?this._outputConfiguration.getErrHelpWidth():this._outputConfiguration.getOutHelpWidth();return u.formatHelp(this,u)}_getHelpContext(D){D=D||{};let u={error:!!D.error},F;if(u.error)F=(E)=>this._outputConfiguration.writeErr(E);else F=(E)=>this._outputConfiguration.writeOut(E);return u.write=D.write||F,u.command=this,u}outputHelp(D){let u;if(typeof D==="function")u=D,D=void 0;let F=this._getHelpContext(D);this._getCommandAndAncestors().reverse().forEach((B)=>B.emit("beforeAllHelp",F)),this.emit("beforeHelp",F);let E=this.helpInformation(F);if(u){if(E=u(E),typeof E!=="string"&&!Buffer.isBuffer(E))throw Error("outputHelp callback must return a string or a Buffer")}if(F.write(E),this._getHelpOption()?.long)this.emit(this._getHelpOption().long);this.emit("afterHelp",F),this._getCommandAndAncestors().forEach((B)=>B.emit("afterAllHelp",F))}helpOption(D,u){if(typeof D==="boolean"){if(D)this._helpOption=this._helpOption??void 0;else this._helpOption=null;return this}return D=D??"-h, --help",u=u??"display help for command",this._helpOption=this.createOption(D,u),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 u=V.exitCode||0;if(u===0&&D&&typeof D!=="function"&&D.error)u=1;this._exit(u,"commander.help","(outputHelp)")}addHelpText(D,u){let F=["beforeAll","before","after","afterAll"];if(!F.includes(D))throw Error(`Unexpected value for position to addHelpText.
22
22
  Expecting one of '${F.join("', '")}'`);let E=`${D}Help`;return this.on(E,(B)=>{let _;if(typeof u==="function")_=u({error:B.error,command:B.command});else _=u;if(_)B.write(`${_}
23
- `)}),this}_outputHelpIfRequested(D){let u=this._getHelpOption();if(u&&D.find((E)=>u.is(E)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function $0(D){return D.map((u)=>{if(!u.startsWith("--inspect"))return u;let F,E="127.0.0.1",B="9229",_;if((_=u.match(/^(--inspect(-brk)?)$/))!==null)F=_[1];else if((_=u.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null)if(F=_[1],/^\d+$/.test(_[3]))B=_[3];else E=_[3];else if((_=u.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null)F=_[1],E=_[3],B=_[4];if(F&&B!=="0")return`${F}=${E}:${parseInt(B)+1}`;return u})}sE.Command=Bu});var r0=U((nE)=>{var{Argument:S0}=KD(),{Command:_u}=w0(),{CommanderError:dE,InvalidArgumentError:q0}=ID(),{Help:iE}=eD(),{Option:z0}=Du();nE.program=new _u;nE.createCommand=(D)=>new _u(D);nE.createOption=(D,u)=>new z0(D,u);nE.createArgument=(D,u)=>new S0(D,u);nE.Command=_u;nE.Option=z0;nE.Argument=S0;nE.Help=iE;nE.CommanderError=dE;nE.InvalidArgumentError=q0;nE.InvalidOptionArgumentError=q0});var t0=U((nB,V1)=>{V1.exports={dots:{interval:80,frames:["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"]},dots2:{interval:80,frames:["⣾","⣽","⣻","⢿","⡿","⣟","⣯","⣷"]},dots3:{interval:80,frames:["⠋","⠙","⠚","⠞","⠖","⠦","⠴","⠲","⠳","⠓"]},dots4:{interval:80,frames:["⠄","⠆","⠇","⠋","⠙","⠸","⠰","⠠","⠰","⠸","⠙","⠋","⠇","⠆"]},dots5:{interval:80,frames:["⠋","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋"]},dots6:{interval:80,frames:["⠁","⠉","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠤","⠄","⠄","⠤","⠴","⠲","⠒","⠂","⠂","⠒","⠚","⠙","⠉","⠁"]},dots7:{interval:80,frames:["⠈","⠉","⠋","⠓","⠒","⠐","⠐","⠒","⠖","⠦","⠤","⠠","⠠","⠤","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋","⠉","⠈"]},dots8:{interval:80,frames:["⠁","⠁","⠉","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠤","⠄","⠄","⠤","⠠","⠠","⠤","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋","⠉","⠈","⠈"]},dots9:{interval:80,frames:["⢹","⢺","⢼","⣸","⣇","⡧","⡗","⡏"]},dots10:{interval:80,frames:["⢄","⢂","⢁","⡁","⡈","⡐","⡠"]},dots11:{interval:100,frames:["⠁","⠂","⠄","⡀","⢀","⠠","⠐","⠈"]},dots12:{interval:80,frames:["⢀⠀","⡀⠀","⠄⠀","⢂⠀","⡂⠀","⠅⠀","⢃⠀","⡃⠀","⠍⠀","⢋⠀","⡋⠀","⠍⠁","⢋⠁","⡋⠁","⠍⠉","⠋⠉","⠋⠉","⠉⠙","⠉⠙","⠉⠩","⠈⢙","⠈⡙","⢈⠩","⡀⢙","⠄⡙","⢂⠩","⡂⢘","⠅⡘","⢃⠨","⡃⢐","⠍⡐","⢋⠠","⡋⢀","⠍⡁","⢋⠁","⡋⠁","⠍⠉","⠋⠉","⠋⠉","⠉⠙","⠉⠙","⠉⠩","⠈⢙","⠈⡙","⠈⠩","⠀⢙","⠀⡙","⠀⠩","⠀⢘","⠀⡘","⠀⠨","⠀⢐","⠀⡐","⠀⠠","⠀⢀","⠀⡀"]},dots13:{interval:80,frames:["⣼","⣹","⢻","⠿","⡟","⣏","⣧","⣶"]},dots8Bit:{interval:80,frames:["⠀","⠁","⠂","⠃","⠄","⠅","⠆","⠇","⡀","⡁","⡂","⡃","⡄","⡅","⡆","⡇","⠈","⠉","⠊","⠋","⠌","⠍","⠎","⠏","⡈","⡉","⡊","⡋","⡌","⡍","⡎","⡏","⠐","⠑","⠒","⠓","⠔","⠕","⠖","⠗","⡐","⡑","⡒","⡓","⡔","⡕","⡖","⡗","⠘","⠙","⠚","⠛","⠜","⠝","⠞","⠟","⡘","⡙","⡚","⡛","⡜","⡝","⡞","⡟","⠠","⠡","⠢","⠣","⠤","⠥","⠦","⠧","⡠","⡡","⡢","⡣","⡤","⡥","⡦","⡧","⠨","⠩","⠪","⠫","⠬","⠭","⠮","⠯","⡨","⡩","⡪","⡫","⡬","⡭","⡮","⡯","⠰","⠱","⠲","⠳","⠴","⠵","⠶","⠷","⡰","⡱","⡲","⡳","⡴","⡵","⡶","⡷","⠸","⠹","⠺","⠻","⠼","⠽","⠾","⠿","⡸","⡹","⡺","⡻","⡼","⡽","⡾","⡿","⢀","⢁","⢂","⢃","⢄","⢅","⢆","⢇","⣀","⣁","⣂","⣃","⣄","⣅","⣆","⣇","⢈","⢉","⢊","⢋","⢌","⢍","⢎","⢏","⣈","⣉","⣊","⣋","⣌","⣍","⣎","⣏","⢐","⢑","⢒","⢓","⢔","⢕","⢖","⢗","⣐","⣑","⣒","⣓","⣔","⣕","⣖","⣗","⢘","⢙","⢚","⢛","⢜","⢝","⢞","⢟","⣘","⣙","⣚","⣛","⣜","⣝","⣞","⣟","⢠","⢡","⢢","⢣","⢤","⢥","⢦","⢧","⣠","⣡","⣢","⣣","⣤","⣥","⣦","⣧","⢨","⢩","⢪","⢫","⢬","⢭","⢮","⢯","⣨","⣩","⣪","⣫","⣬","⣭","⣮","⣯","⢰","⢱","⢲","⢳","⢴","⢵","⢶","⢷","⣰","⣱","⣲","⣳","⣴","⣵","⣶","⣷","⢸","⢹","⢺","⢻","⢼","⢽","⢾","⢿","⣸","⣹","⣺","⣻","⣼","⣽","⣾","⣿"]},sand:{interval:80,frames:["⠁","⠂","⠄","⡀","⡈","⡐","⡠","⣀","⣁","⣂","⣄","⣌","⣔","⣤","⣥","⣦","⣮","⣶","⣷","⣿","⡿","⠿","⢟","⠟","⡛","⠛","⠫","⢋","⠋","⠍","⡉","⠉","⠑","⠡","⢁"]},line:{interval:130,frames:["-","\\","|","/"]},line2:{interval:100,frames:["⠂","-","–","—","–","-"]},pipe:{interval:100,frames:["┤","┘","┴","└","├","┌","┬","┐"]},simpleDots:{interval:400,frames:[". ",".. ","..."," "]},simpleDotsScrolling:{interval:200,frames:[". ",".. ","..."," .."," ."," "]},star:{interval:70,frames:["✶","✸","✹","✺","✹","✷"]},star2:{interval:80,frames:["+","x","*"]},flip:{interval:70,frames:["_","_","_","-","`","`","'","´","-","_","_","_"]},hamburger:{interval:100,frames:["☱","☲","☴"]},growVertical:{interval:120,frames:["▁","▃","▄","▅","▆","▇","▆","▅","▄","▃"]},growHorizontal:{interval:120,frames:["▏","▎","▍","▌","▋","▊","▉","▊","▋","▌","▍","▎"]},balloon:{interval:140,frames:[" ",".","o","O","@","*"," "]},balloon2:{interval:120,frames:[".","o","O","°","O","o","."]},noise:{interval:100,frames:["▓","▒","░"]},bounce:{interval:120,frames:["⠁","⠂","⠄","⠂"]},boxBounce:{interval:120,frames:["▖","▘","▝","▗"]},boxBounce2:{interval:100,frames:["▌","▀","▐","▄"]},triangle:{interval:50,frames:["◢","◣","◤","◥"]},binary:{interval:80,frames:["010010","001100","100101","111010","111101","010111","101011","111000","110011","110101"]},arc:{interval:100,frames:["◜","◠","◝","◞","◡","◟"]},circle:{interval:120,frames:["◡","⊙","◠"]},squareCorners:{interval:180,frames:["◰","◳","◲","◱"]},circleQuarters:{interval:120,frames:["◴","◷","◶","◵"]},circleHalves:{interval:50,frames:["◐","◓","◑","◒"]},squish:{interval:100,frames:["╫","╪"]},toggle:{interval:250,frames:["⊶","⊷"]},toggle2:{interval:80,frames:["▫","▪"]},toggle3:{interval:120,frames:["□","■"]},toggle4:{interval:100,frames:["■","□","▪","▫"]},toggle5:{interval:100,frames:["▮","▯"]},toggle6:{interval:300,frames:["ဝ","၀"]},toggle7:{interval:80,frames:["⦾","⦿"]},toggle8:{interval:100,frames:["◍","◌"]},toggle9:{interval:100,frames:["◉","◎"]},toggle10:{interval:100,frames:["㊂","㊀","㊁"]},toggle11:{interval:50,frames:["⧇","⧆"]},toggle12:{interval:120,frames:["☗","☖"]},toggle13:{interval:80,frames:["=","*","-"]},arrow:{interval:100,frames:["←","↖","↑","↗","→","↘","↓","↙"]},arrow2:{interval:80,frames:["⬆️ ","↗️ ","➡️ ","↘️ ","⬇️ ","↙️ ","⬅️ ","↖️ "]},arrow3:{interval:120,frames:["▹▹▹▹▹","▸▹▹▹▹","▹▸▹▹▹","▹▹▸▹▹","▹▹▹▸▹","▹▹▹▹▸"]},bouncingBar:{interval:80,frames:["[ ]","[= ]","[== ]","[=== ]","[====]","[ ===]","[ ==]","[ =]","[ ]","[ =]","[ ==]","[ ===]","[====]","[=== ]","[== ]","[= ]"]},bouncingBall:{interval:80,frames:["( ● )","( ● )","( ● )","( ● )","( ●)","( ● )","( ● )","( ● )","( ● )","(● )"]},smiley:{interval:200,frames:["😄 ","😝 "]},monkey:{interval:300,frames:["🙈 ","🙈 ","🙉 ","🙊 "]},hearts:{interval:100,frames:["💛 ","💙 ","💜 ","💚 ","❤️ "]},clock:{interval:100,frames:["🕛 ","🕐 ","🕑 ","🕒 ","🕓 ","🕔 ","🕕 ","🕖 ","🕗 ","🕘 ","🕙 ","🕚 "]},earth:{interval:180,frames:["🌍 ","🌎 ","🌏 "]},material:{interval:17,frames:["█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","███▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","████▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁","███████▁▁▁▁▁▁▁▁▁▁▁▁▁","████████▁▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","██████████▁▁▁▁▁▁▁▁▁▁","███████████▁▁▁▁▁▁▁▁▁","█████████████▁▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁▁██████████████▁▁▁▁","▁▁▁██████████████▁▁▁","▁▁▁▁█████████████▁▁▁","▁▁▁▁██████████████▁▁","▁▁▁▁██████████████▁▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁▁██████████████","▁▁▁▁▁▁██████████████","▁▁▁▁▁▁▁█████████████","▁▁▁▁▁▁▁█████████████","▁▁▁▁▁▁▁▁████████████","▁▁▁▁▁▁▁▁████████████","▁▁▁▁▁▁▁▁▁███████████","▁▁▁▁▁▁▁▁▁███████████","▁▁▁▁▁▁▁▁▁▁██████████","▁▁▁▁▁▁▁▁▁▁██████████","▁▁▁▁▁▁▁▁▁▁▁▁████████","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁██████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","███▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","████▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","█████▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","█████▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","██████▁▁▁▁▁▁▁▁▁▁▁▁▁█","████████▁▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","███████████▁▁▁▁▁▁▁▁▁","████████████▁▁▁▁▁▁▁▁","████████████▁▁▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁▁▁█████████████▁▁▁▁","▁▁▁▁▁████████████▁▁▁","▁▁▁▁▁████████████▁▁▁","▁▁▁▁▁▁███████████▁▁▁","▁▁▁▁▁▁▁▁█████████▁▁▁","▁▁▁▁▁▁▁▁█████████▁▁▁","▁▁▁▁▁▁▁▁▁█████████▁▁","▁▁▁▁▁▁▁▁▁█████████▁▁","▁▁▁▁▁▁▁▁▁▁█████████▁","▁▁▁▁▁▁▁▁▁▁▁████████▁","▁▁▁▁▁▁▁▁▁▁▁████████▁","▁▁▁▁▁▁▁▁▁▁▁▁███████▁","▁▁▁▁▁▁▁▁▁▁▁▁███████▁","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁"]},moon:{interval:80,frames:["🌑 ","🌒 ","🌓 ","🌔 ","🌕 ","🌖 ","🌗 ","🌘 "]},runner:{interval:140,frames:["🚶 ","🏃 "]},pong:{interval:80,frames:["▐⠂ ▌","▐⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂▌","▐ ⠠▌","▐ ⡀▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐⠠ ▌"]},shark:{interval:120,frames:["▐|\\____________▌","▐_|\\___________▌","▐__|\\__________▌","▐___|\\_________▌","▐____|\\________▌","▐_____|\\_______▌","▐______|\\______▌","▐_______|\\_____▌","▐________|\\____▌","▐_________|\\___▌","▐__________|\\__▌","▐___________|\\_▌","▐____________|\\▌","▐____________/|▌","▐___________/|_▌","▐__________/|__▌","▐_________/|___▌","▐________/|____▌","▐_______/|_____▌","▐______/|______▌","▐_____/|_______▌","▐____/|________▌","▐___/|_________▌","▐__/|__________▌","▐_/|___________▌","▐/|____________▌"]},dqpb:{interval:100,frames:["d","q","p","b"]},weather:{interval:100,frames:["☀️ ","☀️ ","☀️ ","🌤 ","⛅️ ","🌥 ","☁️ ","🌧 ","🌨 ","🌧 ","🌨 ","🌧 ","🌨 ","⛈ ","🌨 ","🌧 ","🌨 ","☁️ ","🌥 ","⛅️ ","🌤 ","☀️ ","☀️ "]},christmas:{interval:400,frames:["🌲","🎄"]},grenade:{interval:80,frames:["، ","′ "," ´ "," ‾ "," ⸌"," ⸊"," |"," ⁎"," ⁕"," ෴ "," ⁓"," "," "," "]},point:{interval:125,frames:["∙∙∙","●∙∙","∙●∙","∙∙●","∙∙∙"]},layer:{interval:150,frames:["-","=","≡"]},betaWave:{interval:80,frames:["ρββββββ","βρβββββ","ββρββββ","βββρβββ","ββββρββ","βββββρβ","ββββββρ"]},fingerDance:{interval:160,frames:["🤘 ","🤟 ","🖖 ","✋ ","🤚 ","👆 "]},fistBump:{interval:80,frames:["🤜    🤛 ","🤜    🤛 ","🤜    🤛 "," 🤜  🤛  ","  🤜🤛   "," 🤜✨🤛   ","🤜 ✨ 🤛  "]},soccerHeader:{interval:80,frames:[" 🧑⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 "]},mindblown:{interval:160,frames:["😐 ","😐 ","😮 ","😮 ","😦 ","😦 ","😧 ","😧 ","🤯 ","💥 ","✨ ","  ","  ","  "]},speaker:{interval:160,frames:["🔈 ","🔉 ","🔊 ","🔉 "]},orangePulse:{interval:100,frames:["🔸 ","🔶 ","🟠 ","🟠 ","🔶 "]},bluePulse:{interval:100,frames:["🔹 ","🔷 ","🔵 ","🔵 ","🔷 "]},orangeBluePulse:{interval:100,frames:["🔸 ","🔶 ","🟠 ","🟠 ","🔶 ","🔹 ","🔷 ","🔵 ","🔵 ","🔷 "]},timeTravel:{interval:100,frames:["🕛 ","🕚 ","🕙 ","🕘 ","🕗 ","🕖 ","🕕 ","🕔 ","🕓 ","🕒 ","🕑 ","🕐 "]},aesthetic:{interval:80,frames:["▰▱▱▱▱▱▱","▰▰▱▱▱▱▱","▰▰▰▱▱▱▱","▰▰▰▰▱▱▱","▰▰▰▰▰▱▱","▰▰▰▰▰▰▱","▰▰▰▰▰▰▰","▰▱▱▱▱▱▱"]},dwarfFortress:{interval:80,frames:[" ██████£££ ","☺██████£££ ","☺██████£££ ","☺▓█████£££ ","☺▓█████£££ ","☺▒█████£££ ","☺▒█████£££ ","☺░█████£££ ","☺░█████£££ ","☺ █████£££ "," ☺█████£££ "," ☺█████£££ "," ☺▓████£££ "," ☺▓████£££ "," ☺▒████£££ "," ☺▒████£££ "," ☺░████£££ "," ☺░████£££ "," ☺ ████£££ "," ☺████£££ "," ☺████£££ "," ☺▓███£££ "," ☺▓███£££ "," ☺▒███£££ "," ☺▒███£££ "," ☺░███£££ "," ☺░███£££ "," ☺ ███£££ "," ☺███£££ "," ☺███£££ "," ☺▓██£££ "," ☺▓██£££ "," ☺▒██£££ "," ☺▒██£££ "," ☺░██£££ "," ☺░██£££ "," ☺ ██£££ "," ☺██£££ "," ☺██£££ "," ☺▓█£££ "," ☺▓█£££ "," ☺▒█£££ "," ☺▒█£££ "," ☺░█£££ "," ☺░█£££ "," ☺ █£££ "," ☺█£££ "," ☺█£££ "," ☺▓£££ "," ☺▓£££ "," ☺▒£££ "," ☺▒£££ "," ☺░£££ "," ☺░£££ "," ☺ £££ "," ☺£££ "," ☺£££ "," ☺▓££ "," ☺▓££ "," ☺▒££ "," ☺▒££ "," ☺░££ "," ☺░££ "," ☺ ££ "," ☺££ "," ☺££ "," ☺▓£ "," ☺▓£ "," ☺▒£ "," ☺▒£ "," ☺░£ "," ☺░£ "," ☺ £ "," ☺£ "," ☺£ "," ☺▓ "," ☺▓ "," ☺▒ "," ☺▒ "," ☺░ "," ☺░ "," ☺ "," ☺ &"," ☺ ☼&"," ☺ ☼ &"," ☺☼ &"," ☺☼ & "," ‼ & "," ☺ & "," ‼ & "," ☺ & "," ‼ & "," ☺ & ","‼ & "," & "," & "," & ░ "," & ▒ "," & ▓ "," & £ "," & ░£ "," & ▒£ "," & ▓£ "," & ££ "," & ░££ "," & ▒££ ","& ▓££ ","& £££ "," ░£££ "," ▒£££ "," ▓£££ "," █£££ "," ░█£££ "," ▒█£££ "," ▓█£££ "," ██£££ "," ░██£££ "," ▒██£££ "," ▓██£££ "," ███£££ "," ░███£££ "," ▒███£££ "," ▓███£££ "," ████£££ "," ░████£££ "," ▒████£££ "," ▓████£££ "," █████£££ "," ░█████£££ "," ▒█████£££ "," ▓█████£££ "," ██████£££ "," ██████£££ "]}}});var hu=U((pB,x0)=>{var xD=Object.assign({},t0()),N0=Object.keys(xD);Object.defineProperty(xD,"random",{get(){let D=Math.floor(Math.random()*N0.length),u=N0[D];return xD[u]}});x0.exports=xD});var m0=U((S_,s0)=>{s0.exports=()=>{return/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g}});var BF=U((V_,QD)=>{var s1=typeof process<"u"&&process.env.TERM_PROGRAM==="Hyper",m1=typeof process<"u"&&process.platform==="win32",uF=typeof process<"u"&&process.platform==="linux",Xu={ballotDisabled:"☒",ballotOff:"☐",ballotOn:"☑",bullet:"•",bulletWhite:"◦",fullBlock:"█",heart:"❤",identicalTo:"≡",line:"─",mark:"※",middot:"·",minus:"-",multiplication:"×",obelus:"÷",pencilDownRight:"✎",pencilRight:"✏",pencilUpRight:"✐",percent:"%",pilcrow2:"❡",pilcrow:"¶",plusMinus:"±",question:"?",section:"§",starsOff:"☆",starsOn:"★",upDownArrow:"↕"},FF=Object.assign({},Xu,{check:"√",cross:"×",ellipsisLarge:"...",ellipsis:"...",info:"i",questionSmall:"?",pointer:">",pointerSmall:"»",radioOff:"( )",radioOn:"(*)",warning:"‼"}),EF=Object.assign({},Xu,{ballotCross:"✘",check:"✔",cross:"✖",ellipsisLarge:"⋯",ellipsis:"…",info:"ℹ",questionFull:"?",questionSmall:"﹖",pointer:uF?"▸":"❯",pointerSmall:uF?"‣":"›",radioOff:"◯",radioOn:"◉",warning:"⚠"});QD.exports=m1&&!s1?FF:EF;Reflect.defineProperty(QD.exports,"common",{enumerable:!1,value:Xu});Reflect.defineProperty(QD.exports,"windows",{enumerable:!1,value:FF});Reflect.defineProperty(QD.exports,"other",{enumerable:!1,value:EF})});var fD=U((K_,Yu)=>{var d1=(D)=>D!==null&&typeof D==="object"&&!Array.isArray(D),i1=/[\u001b\u009b][[\]#;?()]*(?:(?:(?:[^\W_]*;?[^\W_]*)\u0007)|(?:(?:[0-9]{1,4}(;[0-9]{0,4})*)?[~0-9=<>cf-nqrtyA-PRZ]))/g,n1=()=>{if(typeof process<"u")return process.env.FORCE_COLOR!=="0";return!1},_F=()=>{let D={enabled:n1(),visible:!0,styles:{},keys:{}},u=(_)=>{let A=_.open=`\x1B[${_.codes[0]}m`,C=_.close=`\x1B[${_.codes[1]}m`,$=_.regex=new RegExp(`\\u001b\\[${_.codes[1]}m`,"g");return _.wrap=(w,S)=>{if(w.includes(C))w=w.replace($,C+A);let q=A+w+C;return S?q.replace(/\r*\n/g,`${C}$&${A}`):q},_},F=(_,A,C)=>{return typeof _==="function"?_(A):_.wrap(A,C)},E=(_,A)=>{if(_===""||_==null)return"";if(D.enabled===!1)return _;if(D.visible===!1)return"";let C=""+_,$=C.includes(`
24
- `),w=A.length;if(w>0&&A.includes("unstyle"))A=[...new Set(["unstyle",...A])].reverse();while(w-- >0)C=F(D.styles[A[w]],C,$);return C},B=(_,A,C)=>{D.styles[_]=u({name:_,codes:A}),(D.keys[C]||(D.keys[C]=[])).push(_),Reflect.defineProperty(D,_,{configurable:!0,enumerable:!0,set(w){D.alias(_,w)},get(){let w=(S)=>E(S,w.stack);return Reflect.setPrototypeOf(w,D),w.stack=this.stack?this.stack.concat(_):[_],w}})};return B("reset",[0,0],"modifier"),B("bold",[1,22],"modifier"),B("dim",[2,22],"modifier"),B("italic",[3,23],"modifier"),B("underline",[4,24],"modifier"),B("inverse",[7,27],"modifier"),B("hidden",[8,28],"modifier"),B("strikethrough",[9,29],"modifier"),B("black",[30,39],"color"),B("red",[31,39],"color"),B("green",[32,39],"color"),B("yellow",[33,39],"color"),B("blue",[34,39],"color"),B("magenta",[35,39],"color"),B("cyan",[36,39],"color"),B("white",[37,39],"color"),B("gray",[90,39],"color"),B("grey",[90,39],"color"),B("bgBlack",[40,49],"bg"),B("bgRed",[41,49],"bg"),B("bgGreen",[42,49],"bg"),B("bgYellow",[43,49],"bg"),B("bgBlue",[44,49],"bg"),B("bgMagenta",[45,49],"bg"),B("bgCyan",[46,49],"bg"),B("bgWhite",[47,49],"bg"),B("blackBright",[90,39],"bright"),B("redBright",[91,39],"bright"),B("greenBright",[92,39],"bright"),B("yellowBright",[93,39],"bright"),B("blueBright",[94,39],"bright"),B("magentaBright",[95,39],"bright"),B("cyanBright",[96,39],"bright"),B("whiteBright",[97,39],"bright"),B("bgBlackBright",[100,49],"bgBright"),B("bgRedBright",[101,49],"bgBright"),B("bgGreenBright",[102,49],"bgBright"),B("bgYellowBright",[103,49],"bgBright"),B("bgBlueBright",[104,49],"bgBright"),B("bgMagentaBright",[105,49],"bgBright"),B("bgCyanBright",[106,49],"bgBright"),B("bgWhiteBright",[107,49],"bgBright"),D.ansiRegex=i1,D.hasColor=D.hasAnsi=(_)=>{return D.ansiRegex.lastIndex=0,typeof _==="string"&&_!==""&&D.ansiRegex.test(_)},D.alias=(_,A)=>{let C=typeof A==="string"?D[A]:A;if(typeof C!=="function")throw TypeError("Expected alias to be the name of an existing color (string) or a function");if(!C.stack)Reflect.defineProperty(C,"name",{value:_}),D.styles[_]=C,C.stack=[_];Reflect.defineProperty(D,_,{configurable:!0,enumerable:!0,set($){D.alias(_,$)},get(){let $=(w)=>E(w,$.stack);return Reflect.setPrototypeOf($,D),$.stack=this.stack?this.stack.concat(C.stack):C.stack,$}})},D.theme=(_)=>{if(!d1(_))throw TypeError("Expected theme to be an object");for(let A of Object.keys(_))D.alias(A,_[A]);return D},D.alias("unstyle",(_)=>{if(typeof _==="string"&&_!=="")return D.ansiRegex.lastIndex=0,_.replace(D.ansiRegex,"");return""}),D.alias("noop",(_)=>_),D.none=D.clear=D.noop,D.stripColor=D.unstyle,D.symbols=BF(),D.define=B,D};Yu.exports=_F();Yu.exports.create=_F});var O=U((l1)=>{var p1=Object.prototype.toString,g=fD(),CF=!1,XD=new Set,AF={yellow:"blue",cyan:"red",green:"magenta",black:"white",blue:"yellow",red:"cyan",magenta:"green",white:"black"};l1.longest=(D,u)=>{return D.reduce((F,E)=>Math.max(F,u?E[u].length:E.length),0)};l1.hasColor=(D)=>!!D&&g.hasColor(D);var kD=l1.isObject=(D)=>{return D!==null&&typeof D==="object"&&!Array.isArray(D)};l1.nativeType=(D)=>{return p1.call(D).slice(8,-1).toLowerCase().replace(/\s/g,"")};l1.isAsyncFn=(D)=>{return l1.nativeType(D)==="asyncfunction"};l1.isPrimitive=(D)=>{return D!=null&&typeof D!=="object"&&typeof D!=="function"};l1.resolve=(D,u,...F)=>{if(typeof u==="function")return u.call(D,...F);return u};l1.scrollDown=(D=[])=>[...D.slice(1),D[0]];l1.scrollUp=(D=[])=>[D.pop(),...D];l1.reorder=(D=[])=>{let u=D.slice();return u.sort((F,E)=>{if(F.index>E.index)return 1;if(F.index<E.index)return-1;return 0}),u};l1.swap=(D,u,F)=>{let E=D.length,B=F===E?0:F<0?E-1:F,_=D[u];D[u]=D[B],D[B]=_};l1.width=(D,u=80)=>{let F=D&&D.columns?D.columns:u;if(D&&typeof D.getWindowSize==="function")F=D.getWindowSize()[0];if(process.platform==="win32")return F-1;return F};l1.height=(D,u=20)=>{let F=D&&D.rows?D.rows:u;if(D&&typeof D.getWindowSize==="function")F=D.getWindowSize()[1];return F};l1.wordWrap=(D,u={})=>{if(!D)return D;if(typeof u==="number")u={width:u};let{indent:F="",newline:E=`
25
- `+F,width:B=80}=u,_=(E+F).match(/[^\S\n]/g)||[];B-=_.length;let A=`.{1,${B}}([\\s\\u200B]+|$)|[^\\s\\u200B]+?([\\s\\u200B]+|$)`,C=D.trim(),$=new RegExp(A,"g"),w=C.match($)||[];if(w=w.map((S)=>S.replace(/\n$/,"")),u.padEnd)w=w.map((S)=>S.padEnd(B," "));if(u.padStart)w=w.map((S)=>S.padStart(B," "));return F+w.join(E)};l1.unmute=(D)=>{let u=D.stack.find((E)=>g.keys.color.includes(E));if(u)return g[u];if(D.stack.find((E)=>E.slice(2)==="bg"))return g[u.slice(2)];return(E)=>E};l1.pascal=(D)=>D?D[0].toUpperCase()+D.slice(1):"";l1.inverse=(D)=>{if(!D||!D.stack)return D;let u=D.stack.find((E)=>g.keys.color.includes(E));if(u){let E=g["bg"+l1.pascal(u)];return E?E.black:D}let F=D.stack.find((E)=>E.slice(0,2)==="bg");if(F)return g[F.slice(2).toLowerCase()]||D;return g.none};l1.complement=(D)=>{if(!D||!D.stack)return D;let u=D.stack.find((E)=>g.keys.color.includes(E)),F=D.stack.find((E)=>E.slice(0,2)==="bg");if(u&&!F)return g[AF[u]||u];if(F){let E=F.slice(2).toLowerCase(),B=AF[E];if(!B)return D;return g["bg"+l1.pascal(B)]||D}return g.none};l1.meridiem=(D)=>{let u=D.getHours(),F=D.getMinutes(),E=u>=12?"pm":"am";u=u%12;let B=u===0?12:u,_=F<10?"0"+F:F;return B+":"+_+" "+E};l1.set=(D={},u="",F)=>{return u.split(".").reduce((E,B,_,A)=>{let C=A.length-1>_?E[B]||{}:F;if(!l1.isObject(C)&&_<A.length-1)C={};return E[B]=C},D)};l1.get=(D={},u="",F)=>{let E=D[u]==null?u.split(".").reduce((B,_)=>B&&B[_],D):D[u];return E==null?F:E};l1.mixin=(D,u)=>{if(!kD(D))return u;if(!kD(u))return D;for(let F of Object.keys(u)){let E=Object.getOwnPropertyDescriptor(u,F);if(hasOwnProperty.call(E,"value"))if(hasOwnProperty.call(D,F)&&kD(E.value)){let B=Object.getOwnPropertyDescriptor(D,F);if(kD(B.value)&&B.value!==E.value)D[F]=l1.merge({},D[F],u[F]);else Reflect.defineProperty(D,F,E)}else Reflect.defineProperty(D,F,E);else Reflect.defineProperty(D,F,E)}return D};l1.merge=(...D)=>{let u={};for(let F of D)l1.mixin(u,F);return u};l1.mixinEmitter=(D,u)=>{let F=u.constructor.prototype;for(let E of Object.keys(F)){let B=F[E];if(typeof B==="function")l1.define(D,E,B.bind(u));else l1.define(D,E,B)}};var gD=(D,u)=>{if(CF)return;if(CF=!0,XD.forEach((F)=>F()),D===!0)process.exit(128+u)},$F=gD.bind(null,!0,15),wF=gD.bind(null,!0,2);l1.onExit=(D)=>{if(XD.size===0)process.once("SIGTERM",$F),process.once("SIGINT",wF),process.once("exit",gD);return XD.add(D),()=>{if(XD.delete(D),XD.size===0)process.off("SIGTERM",$F),process.off("SIGINT",wF),process.off("exit",gD)}};l1.define=(D,u,F)=>{Reflect.defineProperty(D,u,{value:F})};l1.defineExport=(D,u,F)=>{let E;Reflect.defineProperty(D,u,{enumerable:!0,configurable:!0,set(B){E=B},get(){return E?E():F()}})}});var LF=U((y_,rF)=>{rF.exports=({onlyFirst:D=!1}={})=>{let u=["[\\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(u,D?void 0:"g")}});var uD=U((P_,MF)=>{var T8=LF();MF.exports=(D)=>typeof D==="string"?D.replace(T8(),""):D});var hF=U((I8)=>{I8.ctrl={a:"first",b:"backward",c:"cancel",d:"deleteForward",e:"last",f:"forward",g:"reset",i:"tab",k:"cutForward",l:"reset",n:"newItem",m:"cancel",j:"submit",p:"search",r:"remove",s:"save",u:"undo",w:"cutLeft",x:"toggleCursor",v:"paste"};I8.shift={up:"shiftUp",down:"shiftDown",left:"shiftLeft",right:"shiftRight",tab:"prev"};I8.fn={up:"pageUp",down:"pageDown",left:"pageLeft",right:"pageRight",delete:"deleteForward"};I8.option={b:"backward",f:"forward",d:"cutRight",left:"cutLeft",up:"altUp",down:"altDown"};I8.keys={pageup:"pageUp",pagedown:"pageDown",home:"home",end:"end",cancel:"cancel",delete:"deleteForward",backspace:"delete",down:"down",enter:"submit",escape:"cancel",left:"left",space:"space",number:"number",return:"submit",right:"right",tab:"next",up:"up"}});var UF=U((t_,RF)=>{RF.exports=class{_queue=[];_executing=!1;_jobRunner=null;constructor(u){this._jobRunner=u}enqueue=(...u)=>{this._queue.push(u),this._dequeue()};destroy(){this._queue.length=0,this._jobRunner=null}_dequeue(){if(this._executing||!this._queue.length)return;this._executing=!0,this._jobRunner(...this._queue.shift()),setTimeout(()=>{this._executing=!1,this._dequeue()})}}});var ju=U((N_,IF)=>{var TF=a("readline"),X8=hF(),Y8=UF(),J8=/^(?:\x1b)([a-zA-Z0-9])$/,j8=/^(?:\x1b+)(O|N|\[|\[\[)(?:(\d+)(?:;(\d+))?([~^$])|(?:1;)?(\d+)?([a-zA-Z]))/,V8={OP:"f1",OQ:"f2",OR:"f3",OS:"f4","[11~":"f1","[12~":"f2","[13~":"f3","[14~":"f4","[[A":"f1","[[B":"f2","[[C":"f3","[[D":"f4","[[E":"f5","[15~":"f5","[17~":"f6","[18~":"f7","[19~":"f8","[20~":"f9","[21~":"f10","[23~":"f11","[24~":"f12","[A":"up","[B":"down","[C":"right","[D":"left","[E":"clear","[F":"end","[H":"home",OA:"up",OB:"down",OC:"right",OD:"left",OE:"clear",OF:"end",OH:"home","[1~":"home","[2~":"insert","[3~":"delete","[4~":"end","[5~":"pageup","[6~":"pagedown","[[5~":"pageup","[[6~":"pagedown","[7~":"home","[8~":"end","[a":"up","[b":"down","[c":"right","[d":"left","[e":"clear","[2$":"insert","[3$":"delete","[5$":"pageup","[6$":"pagedown","[7$":"home","[8$":"end",Oa:"up",Ob:"down",Oc:"right",Od:"left",Oe:"clear","[2^":"insert","[3^":"delete","[5^":"pageup","[6^":"pagedown","[7^":"home","[8^":"end","[Z":"tab"};function K8(D){return["[a","[b","[c","[d","[e","[2$","[3$","[5$","[6$","[7$","[8$","[Z"].includes(D)}function b8(D){return["Oa","Ob","Oc","Od","Oe","[2^","[3^","[5^","[6^","[7^","[8^"].includes(D)}var sD=(D="",u={})=>{let F,E={name:u.name,ctrl:!1,meta:!1,shift:!1,option:!1,sequence:D,raw:D,...u};if(Buffer.isBuffer(D))if(D[0]>127&&D[1]===void 0)D[0]-=128,D="\x1B"+String(D);else D=String(D);else if(D!==void 0&&typeof D!=="string")D=String(D);else if(!D)D=E.sequence||"";if(E.sequence=E.sequence||D||E.name,D==="\r")E.raw=void 0,E.name="return";else if(D===`
26
- `)E.name="enter";else if(D==="\t")E.name="tab";else if(D==="\b"||D===""||D==="\x1B"||D==="\x1B\b")E.name="backspace",E.meta=D.charAt(0)==="\x1B";else if(D==="\x1B"||D==="\x1B\x1B")E.name="escape",E.meta=D.length===2;else if(D===" "||D==="\x1B ")E.name="space",E.meta=D.length===2;else if(D<="\x1A")E.name=String.fromCharCode(D.charCodeAt(0)+97-1),E.ctrl=!0;else if(D.length===1&&D>="0"&&D<="9")E.name="number";else if(D.length===1&&D>="a"&&D<="z")E.name=D;else if(D.length===1&&D>="A"&&D<="Z")E.name=D.toLowerCase(),E.shift=!0;else if(F=J8.exec(D))E.meta=!0,E.shift=/^[A-Z]$/.test(F[1]);else if(F=j8.exec(D)){let B=[...D];if(B[0]==="\x1B"&&B[1]==="\x1B")E.option=!0;let _=[F[1],F[2],F[4],F[6]].filter(Boolean).join(""),A=(F[3]||F[5]||1)-1;E.ctrl=!!(A&4),E.meta=!!(A&10),E.shift=!!(A&1),E.code=_,E.name=V8[_],E.shift=K8(_)||E.shift,E.ctrl=b8(_)||E.ctrl}return E};sD.listen=(D={},u)=>{let{stdin:F}=D;if(!F||F!==process.stdin&&!F.isTTY)throw Error("Invalid stream passed");let E=TF.createInterface({terminal:!0,input:F});TF.emitKeypressEvents(F,E);let B=new Y8((C,$)=>u(C,sD(C,$),E)),_=F.isRaw;if(F.isTTY)F.setRawMode(!0);return F.on("keypress",B.enqueue),E.resume(),()=>{if(F.isTTY)F.setRawMode(_);F.removeListener("keypress",B.enqueue),B.destroy(),E.pause(),E.close()}};sD.action=(D,u,F)=>{let E={...X8,...F};if(u.ctrl)return u.action=E.ctrl[u.name],u;if(u.option&&E.option)return u.action=E.option[u.name],u;if(u.shift)return u.action=E.shift[u.name],u;return u.action=E.keys[u.name],u};IF.exports=sD});var WF=U((x_,HF)=>{HF.exports=(D)=>{D.timers=D.timers||{};let u=D.options.timers;if(!u)return;for(let F of Object.keys(u)){let E=u[F];if(typeof E==="number")E={interval:E};y8(D,F,E)}};function y8(D,u,F={}){let E=D.timers[u]={name:u,start:Date.now(),ms:0,tick:0},B=F.interval||120;E.frames=F.frames||[],E.loading=!0;let _=setInterval(()=>{E.ms=Date.now()-E.start,E.tick++,D.render()},B);return E.stop=()=>{E.loading=!1,clearInterval(_)},Reflect.defineProperty(E,"interval",{value:_}),D.once("close",()=>E.stop()),E.stop}});var QF=U((v_,GF)=>{var{define:P8,width:O8}=O();class ZF{constructor(D){let u=D.options;P8(this,"_prompt",D),this.type=D.type,this.name=D.name,this.message="",this.header="",this.footer="",this.error="",this.hint="",this.input="",this.cursor=0,this.index=0,this.lines=0,this.tick=0,this.prompt="",this.buffer="",this.width=O8(u.stdout||process.stdout),Object.assign(this,u),this.name=this.name||this.message,this.message=this.message||this.name,this.symbols=D.symbols,this.styles=D.styles,this.required=new Set,this.cancelled=!1,this.submitted=!1}clone(){let D={...this};return D.status=this.status,D.buffer=Buffer.from(D.buffer),delete D.clone,D}set color(D){this._color=D}get color(){let D=this.prompt.styles;if(this.cancelled)return D.cancelled;if(this.submitted)return D.submitted;let u=this._color||D[this.status];return typeof u==="function"?u:D.pending}set loading(D){this._loading=D}get loading(){if(typeof this._loading==="boolean")return this._loading;if(this.loadingChoices)return"choices";return!1}get status(){if(this.cancelled)return"cancelled";if(this.submitted)return"submitted";return"pending"}}GF.exports=ZF});var YF=U((f_,XF)=>{var Vu=O(),P=fD(),Ku={default:P.noop,noop:P.noop,set inverse(D){this._inverse=D},get inverse(){return this._inverse||Vu.inverse(this.primary)},set complement(D){this._complement=D},get complement(){return this._complement||Vu.complement(this.primary)},primary:P.cyan,success:P.green,danger:P.magenta,strong:P.bold,warning:P.yellow,muted:P.dim,disabled:P.gray,dark:P.dim.gray,underline:P.underline,set info(D){this._info=D},get info(){return this._info||this.primary},set em(D){this._em=D},get em(){return this._em||this.primary.underline},set heading(D){this._heading=D},get heading(){return this._heading||this.muted.underline},set pending(D){this._pending=D},get pending(){return this._pending||this.primary},set submitted(D){this._submitted=D},get submitted(){return this._submitted||this.success},set cancelled(D){this._cancelled=D},get cancelled(){return this._cancelled||this.danger},set typing(D){this._typing=D},get typing(){return this._typing||this.dim},set placeholder(D){this._placeholder=D},get placeholder(){return this._placeholder||this.primary.dim},set highlight(D){this._highlight=D},get highlight(){return this._highlight||this.inverse}};Ku.merge=(D={})=>{if(D.styles&&typeof D.styles.enabled==="boolean")P.enabled=D.styles.enabled;if(D.styles&&typeof D.styles.visible==="boolean")P.visible=D.styles.visible;let u=Vu.merge({},Ku,D.styles);delete u.merge;for(let F of Object.keys(P))if(!hasOwnProperty.call(u,F))Reflect.defineProperty(u,F,{get:()=>P[F]});for(let F of Object.keys(P.styles))if(!hasOwnProperty.call(u,F))Reflect.defineProperty(u,F,{get:()=>P[F]});return u};XF.exports=Ku});var jF=U((k_,JF)=>{var bu=process.platform==="win32",o=fD(),t8=O(),yu={...o.symbols,upDownDoubleArrow:"⇕",upDownDoubleArrow2:"⬍",upDownArrow:"↕",asterisk:"*",asterism:"⁂",bulletWhite:"◦",electricArrow:"⌁",ellipsisLarge:"⋯",ellipsisSmall:"…",fullBlock:"█",identicalTo:"≡",indicator:o.symbols.check,leftAngle:"‹",mark:"※",minus:"−",multiplication:"×",obelus:"÷",percent:"%",pilcrow:"¶",pilcrow2:"❡",pencilUpRight:"✐",pencilDownRight:"✎",pencilRight:"✏",plus:"+",plusMinus:"±",pointRight:"☞",rightAngle:"›",section:"§",hexagon:{off:"⬡",on:"⬢",disabled:"⬢"},ballot:{on:"☑",off:"☐",disabled:"☒"},stars:{on:"★",off:"☆",disabled:"☆"},folder:{on:"▼",off:"▶",disabled:"▶"},prefix:{pending:o.symbols.question,submitted:o.symbols.check,cancelled:o.symbols.cross},separator:{pending:o.symbols.pointerSmall,submitted:o.symbols.middot,cancelled:o.symbols.middot},radio:{off:bu?"( )":"◯",on:bu?"(*)":"◉",disabled:bu?"(|)":"Ⓘ"},numbers:["⓪","①","②","③","④","⑤","⑥","⑦","⑧","⑨","⑩","⑪","⑫","⑬","⑭","⑮","⑯","⑰","⑱","⑲","⑳","㉑","㉒","㉓","㉔","㉕","㉖","㉗","㉘","㉙","㉚","㉛","㉜","㉝","㉞","㉟","㊱","㊲","㊳","㊴","㊵","㊶","㊷","㊸","㊹","㊺","㊻","㊼","㊽","㊾","㊿"]};yu.merge=(D)=>{let u=t8.merge({},o.symbols,yu,D.symbols);return delete u.merge,u};JF.exports=yu});var KF=U((g_,VF)=>{var N8=YF(),x8=jF(),v8=O();VF.exports=(D)=>{D.options=v8.merge({},D.options.theme,D.options),D.symbols=x8.merge(D.options),D.styles=N8.merge(D.options)}});var OF=U((yF,PF)=>{var bF=process.env.TERM_PROGRAM==="Apple_Terminal",f8=uD(),Pu=O(),i=PF.exports=yF,Ou=!1,FD=i.code={bell:"\x07",beep:"\x07",beginning:"\x1B[G",down:"\x1B[J",esc:"\x1B[",getPosition:"\x1B[6n",hide:"\x1B[?25l",line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",restorePosition:"\x1B["+(bF?"8":"u"),savePosition:"\x1B["+(bF?"7":"s"),screen:"\x1B[2J",show:"\x1B[?25h",up:"\x1B[1J"},wD=i.cursor={get hidden(){return Ou},hide(){return Ou=!0,FD.hide},show(){return Ou=!1,FD.show},forward:(D=1)=>`\x1B[${D}C`,backward:(D=1)=>`\x1B[${D}D`,nextLine:(D=1)=>"\x1B[E".repeat(D),prevLine:(D=1)=>"\x1B[F".repeat(D),up:(D=1)=>D?`\x1B[${D}A`:"",down:(D=1)=>D?`\x1B[${D}B`:"",right:(D=1)=>D?`\x1B[${D}C`:"",left:(D=1)=>D?`\x1B[${D}D`:"",to(D,u){return u?`\x1B[${u+1};${D+1}H`:`\x1B[${D+1}G`},move(D=0,u=0){let F="";return F+=D<0?wD.left(-D):D>0?wD.right(D):"",F+=u<0?wD.up(-u):u>0?wD.down(u):"",F},strLen(D){var u=0,F=D.length,E=-1;for(var B=0;B<F;B++)if(E=D.charCodeAt(B),E>=0&&E<=128)u+=1;else u+=2;return u},restore(D={}){let{after:u,cursor:F,initial:E,input:B,prompt:_,size:A,value:C}=D;if(E=Pu.isPrimitive(E)?String(E):"",B=Pu.isPrimitive(B)?String(B):"",C=Pu.isPrimitive(C)?String(C):"",A){let $=i.cursor.up(A)+i.cursor.to(this.strLen(_)),w=B.length-F;if(w>0)$+=i.cursor.left(w);return $}if(C||u){let $=!B&&!!E?-this.strLen(E):-this.strLen(B)+F;if(u)$-=this.strLen(u);if(B===""&&E&&!_.includes(E))$+=this.strLen(E);return i.cursor.move($)}}},tu=i.erase={screen:FD.screen,up:FD.up,down:FD.down,line:FD.line,lineEnd:FD.lineEnd,lineStart:FD.lineStart,lines(D){let u="";for(let F=0;F<D;F++)u+=i.erase.line+(F<D-1?i.cursor.up(1):"");if(D)u+=i.code.beginning;return u}};i.clear=(D="",u=process.stdout.columns)=>{if(!u)return tu.line+wD.to(0);let F=(_)=>[...f8(_)].length,E=D.split(/\r?\n/),B=0;for(let _ of E)B+=1+Math.floor(Math.max(F(_)-1,0)/u);return(tu.line+wD.prevLine()).repeat(B-1)+tu.line+wD.to(0)}});var hD=U((s_,NF)=>{var k8=a("events"),tF=uD(),Nu=ju(),g8=WF(),s8=QF(),m8=KF(),N=O(),SD=OF();class xu extends k8{constructor(D={}){super();this.name=D.name,this.type=D.type,this.options=D,m8(this),g8(this),this.state=new s8(this),this.initial=[D.initial,D.default].find((u)=>u!=null),this.stdout=D.stdout||process.stdout,this.stdin=D.stdin||process.stdin,this.scale=D.scale||1,this.term=this.options.term||process.env.TERM_PROGRAM,this.margin=i8(this.options.margin),this.setMaxListeners(0),d8(this)}async keypress(D,u={}){this.keypressed=!0;let F=Nu.action(D,Nu(D,u),this.options.actions);this.state.keypress=F,this.emit("keypress",D,F),this.emit("state",this.state.clone());let E=this.options[F.action]||this[F.action]||this.dispatch;if(typeof E==="function")return await E.call(this,D,F);this.alert()}alert(){if(delete this.state.alert,this.options.show===!1)this.emit("alert");else this.stdout.write(SD.code.beep)}cursorHide(){this.stdout.write(SD.cursor.hide());let D=N.onExit(()=>this.cursorShow());this.on("close",()=>{this.cursorShow(),D()})}cursorShow(){this.stdout.write(SD.cursor.show())}write(D){if(!D)return;if(this.stdout&&this.state.show!==!1)this.stdout.write(D);this.state.buffer+=D}clear(D=0){let u=this.state.buffer;if(this.state.buffer="",!u&&!D||this.options.show===!1)return;this.stdout.write(SD.cursor.down(D)+SD.clear(u,this.width))}restore(){if(this.state.closed||this.options.show===!1)return;let{prompt:D,after:u,rest:F}=this.sections(),{cursor:E,initial:B="",input:_="",value:A=""}=this,C=this.state.size=F.length,$={after:u,cursor:E,initial:B,input:_,prompt:D,size:C,value:A},w=SD.cursor.restore($);if(w)this.stdout.write(w)}sections(){let{buffer:D,input:u,prompt:F}=this.state;F=tF(F);let E=tF(D),B=E.indexOf(F),_=E.slice(0,B),C=E.slice(B).split(`
27
- `),$=C[0],w=C[C.length-1],q=(F+(u?" "+u:"")).length,M=q<$.length?$.slice(q+1):"";return{header:_,prompt:$,after:M,rest:C.slice(1),last:w}}async submit(){if(this.state.submitted=!0,this.state.validating=!0,this.options.onSubmit)await this.options.onSubmit.call(this,this.name,this.value,this);let D=this.state.error||await this.validate(this.value,this.state);if(D!==!0){let u=`
23
+ `)}),this}_outputHelpIfRequested(D){let u=this._getHelpOption();if(u&&D.find((E)=>u.is(E)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function w0(D){return D.map((u)=>{if(!u.startsWith("--inspect"))return u;let F,E="127.0.0.1",B="9229",_;if((_=u.match(/^(--inspect(-brk)?)$/))!==null)F=_[1];else if((_=u.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null)if(F=_[1],/^\d+$/.test(_[3]))B=_[3];else E=_[3];else if((_=u.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null)F=_[1],E=_[3],B=_[4];if(F&&B!=="0")return`${F}=${E}:${parseInt(B)+1}`;return u})}mE.Command=_u});var z0=U((lE)=>{var{Argument:M0}=yD(),{Command:Cu}=r0(),{CommanderError:nE,InvalidArgumentError:q0}=HD(),{Help:pE}=Du(),{Option:I0}=uu();lE.program=new Cu;lE.createCommand=(D)=>new Cu(D);lE.createOption=(D,u)=>new I0(D,u);lE.createArgument=(D,u)=>new M0(D,u);lE.Command=Cu;lE.Option=I0;lE.Argument=M0;lE.Help=pE;lE.CommanderError=nE;lE.InvalidArgumentError=q0;lE.InvalidOptionArgumentError=q0});var N0=U((lB,y1)=>{y1.exports={dots:{interval:80,frames:["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"]},dots2:{interval:80,frames:["⣾","⣽","⣻","⢿","⡿","⣟","⣯","⣷"]},dots3:{interval:80,frames:["⠋","⠙","⠚","⠞","⠖","⠦","⠴","⠲","⠳","⠓"]},dots4:{interval:80,frames:["⠄","⠆","⠇","⠋","⠙","⠸","⠰","⠠","⠰","⠸","⠙","⠋","⠇","⠆"]},dots5:{interval:80,frames:["⠋","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋"]},dots6:{interval:80,frames:["⠁","⠉","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠤","⠄","⠄","⠤","⠴","⠲","⠒","⠂","⠂","⠒","⠚","⠙","⠉","⠁"]},dots7:{interval:80,frames:["⠈","⠉","⠋","⠓","⠒","⠐","⠐","⠒","⠖","⠦","⠤","⠠","⠠","⠤","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋","⠉","⠈"]},dots8:{interval:80,frames:["⠁","⠁","⠉","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠤","⠄","⠄","⠤","⠠","⠠","⠤","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋","⠉","⠈","⠈"]},dots9:{interval:80,frames:["⢹","⢺","⢼","⣸","⣇","⡧","⡗","⡏"]},dots10:{interval:80,frames:["⢄","⢂","⢁","⡁","⡈","⡐","⡠"]},dots11:{interval:100,frames:["⠁","⠂","⠄","⡀","⢀","⠠","⠐","⠈"]},dots12:{interval:80,frames:["⢀⠀","⡀⠀","⠄⠀","⢂⠀","⡂⠀","⠅⠀","⢃⠀","⡃⠀","⠍⠀","⢋⠀","⡋⠀","⠍⠁","⢋⠁","⡋⠁","⠍⠉","⠋⠉","⠋⠉","⠉⠙","⠉⠙","⠉⠩","⠈⢙","⠈⡙","⢈⠩","⡀⢙","⠄⡙","⢂⠩","⡂⢘","⠅⡘","⢃⠨","⡃⢐","⠍⡐","⢋⠠","⡋⢀","⠍⡁","⢋⠁","⡋⠁","⠍⠉","⠋⠉","⠋⠉","⠉⠙","⠉⠙","⠉⠩","⠈⢙","⠈⡙","⠈⠩","⠀⢙","⠀⡙","⠀⠩","⠀⢘","⠀⡘","⠀⠨","⠀⢐","⠀⡐","⠀⠠","⠀⢀","⠀⡀"]},dots13:{interval:80,frames:["⣼","⣹","⢻","⠿","⡟","⣏","⣧","⣶"]},dots8Bit:{interval:80,frames:["⠀","⠁","⠂","⠃","⠄","⠅","⠆","⠇","⡀","⡁","⡂","⡃","⡄","⡅","⡆","⡇","⠈","⠉","⠊","⠋","⠌","⠍","⠎","⠏","⡈","⡉","⡊","⡋","⡌","⡍","⡎","⡏","⠐","⠑","⠒","⠓","⠔","⠕","⠖","⠗","⡐","⡑","⡒","⡓","⡔","⡕","⡖","⡗","⠘","⠙","⠚","⠛","⠜","⠝","⠞","⠟","⡘","⡙","⡚","⡛","⡜","⡝","⡞","⡟","⠠","⠡","⠢","⠣","⠤","⠥","⠦","⠧","⡠","⡡","⡢","⡣","⡤","⡥","⡦","⡧","⠨","⠩","⠪","⠫","⠬","⠭","⠮","⠯","⡨","⡩","⡪","⡫","⡬","⡭","⡮","⡯","⠰","⠱","⠲","⠳","⠴","⠵","⠶","⠷","⡰","⡱","⡲","⡳","⡴","⡵","⡶","⡷","⠸","⠹","⠺","⠻","⠼","⠽","⠾","⠿","⡸","⡹","⡺","⡻","⡼","⡽","⡾","⡿","⢀","⢁","⢂","⢃","⢄","⢅","⢆","⢇","⣀","⣁","⣂","⣃","⣄","⣅","⣆","⣇","⢈","⢉","⢊","⢋","⢌","⢍","⢎","⢏","⣈","⣉","⣊","⣋","⣌","⣍","⣎","⣏","⢐","⢑","⢒","⢓","⢔","⢕","⢖","⢗","⣐","⣑","⣒","⣓","⣔","⣕","⣖","⣗","⢘","⢙","⢚","⢛","⢜","⢝","⢞","⢟","⣘","⣙","⣚","⣛","⣜","⣝","⣞","⣟","⢠","⢡","⢢","⢣","⢤","⢥","⢦","⢧","⣠","⣡","⣢","⣣","⣤","⣥","⣦","⣧","⢨","⢩","⢪","⢫","⢬","⢭","⢮","⢯","⣨","⣩","⣪","⣫","⣬","⣭","⣮","⣯","⢰","⢱","⢲","⢳","⢴","⢵","⢶","⢷","⣰","⣱","⣲","⣳","⣴","⣵","⣶","⣷","⢸","⢹","⢺","⢻","⢼","⢽","⢾","⢿","⣸","⣹","⣺","⣻","⣼","⣽","⣾","⣿"]},sand:{interval:80,frames:["⠁","⠂","⠄","⡀","⡈","⡐","⡠","⣀","⣁","⣂","⣄","⣌","⣔","⣤","⣥","⣦","⣮","⣶","⣷","⣿","⡿","⠿","⢟","⠟","⡛","⠛","⠫","⢋","⠋","⠍","⡉","⠉","⠑","⠡","⢁"]},line:{interval:130,frames:["-","\\","|","/"]},line2:{interval:100,frames:["⠂","-","–","—","–","-"]},pipe:{interval:100,frames:["┤","┘","┴","└","├","┌","┬","┐"]},simpleDots:{interval:400,frames:[". ",".. ","..."," "]},simpleDotsScrolling:{interval:200,frames:[". ",".. ","..."," .."," ."," "]},star:{interval:70,frames:["✶","✸","✹","✺","✹","✷"]},star2:{interval:80,frames:["+","x","*"]},flip:{interval:70,frames:["_","_","_","-","`","`","'","´","-","_","_","_"]},hamburger:{interval:100,frames:["☱","☲","☴"]},growVertical:{interval:120,frames:["▁","▃","▄","▅","▆","▇","▆","▅","▄","▃"]},growHorizontal:{interval:120,frames:["▏","▎","▍","▌","▋","▊","▉","▊","▋","▌","▍","▎"]},balloon:{interval:140,frames:[" ",".","o","O","@","*"," "]},balloon2:{interval:120,frames:[".","o","O","°","O","o","."]},noise:{interval:100,frames:["▓","▒","░"]},bounce:{interval:120,frames:["⠁","⠂","⠄","⠂"]},boxBounce:{interval:120,frames:["▖","▘","▝","▗"]},boxBounce2:{interval:100,frames:["▌","▀","▐","▄"]},triangle:{interval:50,frames:["◢","◣","◤","◥"]},binary:{interval:80,frames:["010010","001100","100101","111010","111101","010111","101011","111000","110011","110101"]},arc:{interval:100,frames:["◜","◠","◝","◞","◡","◟"]},circle:{interval:120,frames:["◡","⊙","◠"]},squareCorners:{interval:180,frames:["◰","◳","◲","◱"]},circleQuarters:{interval:120,frames:["◴","◷","◶","◵"]},circleHalves:{interval:50,frames:["◐","◓","◑","◒"]},squish:{interval:100,frames:["╫","╪"]},toggle:{interval:250,frames:["⊶","⊷"]},toggle2:{interval:80,frames:["▫","▪"]},toggle3:{interval:120,frames:["□","■"]},toggle4:{interval:100,frames:["■","□","▪","▫"]},toggle5:{interval:100,frames:["▮","▯"]},toggle6:{interval:300,frames:["ဝ","၀"]},toggle7:{interval:80,frames:["⦾","⦿"]},toggle8:{interval:100,frames:["◍","◌"]},toggle9:{interval:100,frames:["◉","◎"]},toggle10:{interval:100,frames:["㊂","㊀","㊁"]},toggle11:{interval:50,frames:["⧇","⧆"]},toggle12:{interval:120,frames:["☗","☖"]},toggle13:{interval:80,frames:["=","*","-"]},arrow:{interval:100,frames:["←","↖","↑","↗","→","↘","↓","↙"]},arrow2:{interval:80,frames:["⬆️ ","↗️ ","➡️ ","↘️ ","⬇️ ","↙️ ","⬅️ ","↖️ "]},arrow3:{interval:120,frames:["▹▹▹▹▹","▸▹▹▹▹","▹▸▹▹▹","▹▹▸▹▹","▹▹▹▸▹","▹▹▹▹▸"]},bouncingBar:{interval:80,frames:["[ ]","[= ]","[== ]","[=== ]","[====]","[ ===]","[ ==]","[ =]","[ ]","[ =]","[ ==]","[ ===]","[====]","[=== ]","[== ]","[= ]"]},bouncingBall:{interval:80,frames:["( ● )","( ● )","( ● )","( ● )","( ●)","( ● )","( ● )","( ● )","( ● )","(● )"]},smiley:{interval:200,frames:["😄 ","😝 "]},monkey:{interval:300,frames:["🙈 ","🙈 ","🙉 ","🙊 "]},hearts:{interval:100,frames:["💛 ","💙 ","💜 ","💚 ","❤️ "]},clock:{interval:100,frames:["🕛 ","🕐 ","🕑 ","🕒 ","🕓 ","🕔 ","🕕 ","🕖 ","🕗 ","🕘 ","🕙 ","🕚 "]},earth:{interval:180,frames:["🌍 ","🌎 ","🌏 "]},material:{interval:17,frames:["█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","███▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","████▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁","███████▁▁▁▁▁▁▁▁▁▁▁▁▁","████████▁▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","██████████▁▁▁▁▁▁▁▁▁▁","███████████▁▁▁▁▁▁▁▁▁","█████████████▁▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁▁██████████████▁▁▁▁","▁▁▁██████████████▁▁▁","▁▁▁▁█████████████▁▁▁","▁▁▁▁██████████████▁▁","▁▁▁▁██████████████▁▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁▁██████████████","▁▁▁▁▁▁██████████████","▁▁▁▁▁▁▁█████████████","▁▁▁▁▁▁▁█████████████","▁▁▁▁▁▁▁▁████████████","▁▁▁▁▁▁▁▁████████████","▁▁▁▁▁▁▁▁▁███████████","▁▁▁▁▁▁▁▁▁███████████","▁▁▁▁▁▁▁▁▁▁██████████","▁▁▁▁▁▁▁▁▁▁██████████","▁▁▁▁▁▁▁▁▁▁▁▁████████","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁██████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","███▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","████▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","█████▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","█████▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","██████▁▁▁▁▁▁▁▁▁▁▁▁▁█","████████▁▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","███████████▁▁▁▁▁▁▁▁▁","████████████▁▁▁▁▁▁▁▁","████████████▁▁▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁▁▁█████████████▁▁▁▁","▁▁▁▁▁████████████▁▁▁","▁▁▁▁▁████████████▁▁▁","▁▁▁▁▁▁███████████▁▁▁","▁▁▁▁▁▁▁▁█████████▁▁▁","▁▁▁▁▁▁▁▁█████████▁▁▁","▁▁▁▁▁▁▁▁▁█████████▁▁","▁▁▁▁▁▁▁▁▁█████████▁▁","▁▁▁▁▁▁▁▁▁▁█████████▁","▁▁▁▁▁▁▁▁▁▁▁████████▁","▁▁▁▁▁▁▁▁▁▁▁████████▁","▁▁▁▁▁▁▁▁▁▁▁▁███████▁","▁▁▁▁▁▁▁▁▁▁▁▁███████▁","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁"]},moon:{interval:80,frames:["🌑 ","🌒 ","🌓 ","🌔 ","🌕 ","🌖 ","🌗 ","🌘 "]},runner:{interval:140,frames:["🚶 ","🏃 "]},pong:{interval:80,frames:["▐⠂ ▌","▐⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂▌","▐ ⠠▌","▐ ⡀▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐⠠ ▌"]},shark:{interval:120,frames:["▐|\\____________▌","▐_|\\___________▌","▐__|\\__________▌","▐___|\\_________▌","▐____|\\________▌","▐_____|\\_______▌","▐______|\\______▌","▐_______|\\_____▌","▐________|\\____▌","▐_________|\\___▌","▐__________|\\__▌","▐___________|\\_▌","▐____________|\\▌","▐____________/|▌","▐___________/|_▌","▐__________/|__▌","▐_________/|___▌","▐________/|____▌","▐_______/|_____▌","▐______/|______▌","▐_____/|_______▌","▐____/|________▌","▐___/|_________▌","▐__/|__________▌","▐_/|___________▌","▐/|____________▌"]},dqpb:{interval:100,frames:["d","q","p","b"]},weather:{interval:100,frames:["☀️ ","☀️ ","☀️ ","🌤 ","⛅️ ","🌥 ","☁️ ","🌧 ","🌨 ","🌧 ","🌨 ","🌧 ","🌨 ","⛈ ","🌨 ","🌧 ","🌨 ","☁️ ","🌥 ","⛅️ ","🌤 ","☀️ ","☀️ "]},christmas:{interval:400,frames:["🌲","🎄"]},grenade:{interval:80,frames:["، ","′ "," ´ "," ‾ "," ⸌"," ⸊"," |"," ⁎"," ⁕"," ෴ "," ⁓"," "," "," "]},point:{interval:125,frames:["∙∙∙","●∙∙","∙●∙","∙∙●","∙∙∙"]},layer:{interval:150,frames:["-","=","≡"]},betaWave:{interval:80,frames:["ρββββββ","βρβββββ","ββρββββ","βββρβββ","ββββρββ","βββββρβ","ββββββρ"]},fingerDance:{interval:160,frames:["🤘 ","🤟 ","🖖 ","✋ ","🤚 ","👆 "]},fistBump:{interval:80,frames:["🤜    🤛 ","🤜    🤛 ","🤜    🤛 "," 🤜  🤛  ","  🤜🤛   "," 🤜✨🤛   ","🤜 ✨ 🤛  "]},soccerHeader:{interval:80,frames:[" 🧑⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 "]},mindblown:{interval:160,frames:["😐 ","😐 ","😮 ","😮 ","😦 ","😦 ","😧 ","😧 ","🤯 ","💥 ","✨ ","  ","  ","  "]},speaker:{interval:160,frames:["🔈 ","🔉 ","🔊 ","🔉 "]},orangePulse:{interval:100,frames:["🔸 ","🔶 ","🟠 ","🟠 ","🔶 "]},bluePulse:{interval:100,frames:["🔹 ","🔷 ","🔵 ","🔵 ","🔷 "]},orangeBluePulse:{interval:100,frames:["🔸 ","🔶 ","🟠 ","🟠 ","🔶 ","🔹 ","🔷 ","🔵 ","🔵 ","🔷 "]},timeTravel:{interval:100,frames:["🕛 ","🕚 ","🕙 ","🕘 ","🕗 ","🕖 ","🕕 ","🕔 ","🕓 ","🕒 ","🕑 ","🕐 "]},aesthetic:{interval:80,frames:["▰▱▱▱▱▱▱","▰▰▱▱▱▱▱","▰▰▰▱▱▱▱","▰▰▰▰▱▱▱","▰▰▰▰▰▱▱","▰▰▰▰▰▰▱","▰▰▰▰▰▰▰","▰▱▱▱▱▱▱"]},dwarfFortress:{interval:80,frames:[" ██████£££ ","☺██████£££ ","☺██████£££ ","☺▓█████£££ ","☺▓█████£££ ","☺▒█████£££ ","☺▒█████£££ ","☺░█████£££ ","☺░█████£££ ","☺ █████£££ "," ☺█████£££ "," ☺█████£££ "," ☺▓████£££ "," ☺▓████£££ "," ☺▒████£££ "," ☺▒████£££ "," ☺░████£££ "," ☺░████£££ "," ☺ ████£££ "," ☺████£££ "," ☺████£££ "," ☺▓███£££ "," ☺▓███£££ "," ☺▒███£££ "," ☺▒███£££ "," ☺░███£££ "," ☺░███£££ "," ☺ ███£££ "," ☺███£££ "," ☺███£££ "," ☺▓██£££ "," ☺▓██£££ "," ☺▒██£££ "," ☺▒██£££ "," ☺░██£££ "," ☺░██£££ "," ☺ ██£££ "," ☺██£££ "," ☺██£££ "," ☺▓█£££ "," ☺▓█£££ "," ☺▒█£££ "," ☺▒█£££ "," ☺░█£££ "," ☺░█£££ "," ☺ █£££ "," ☺█£££ "," ☺█£££ "," ☺▓£££ "," ☺▓£££ "," ☺▒£££ "," ☺▒£££ "," ☺░£££ "," ☺░£££ "," ☺ £££ "," ☺£££ "," ☺£££ "," ☺▓££ "," ☺▓££ "," ☺▒££ "," ☺▒££ "," ☺░££ "," ☺░££ "," ☺ ££ "," ☺££ "," ☺££ "," ☺▓£ "," ☺▓£ "," ☺▒£ "," ☺▒£ "," ☺░£ "," ☺░£ "," ☺ £ "," ☺£ "," ☺£ "," ☺▓ "," ☺▓ "," ☺▒ "," ☺▒ "," ☺░ "," ☺░ "," ☺ "," ☺ &"," ☺ ☼&"," ☺ ☼ &"," ☺☼ &"," ☺☼ & "," ‼ & "," ☺ & "," ‼ & "," ☺ & "," ‼ & "," ☺ & ","‼ & "," & "," & "," & ░ "," & ▒ "," & ▓ "," & £ "," & ░£ "," & ▒£ "," & ▓£ "," & ££ "," & ░££ "," & ▒££ ","& ▓££ ","& £££ "," ░£££ "," ▒£££ "," ▓£££ "," █£££ "," ░█£££ "," ▒█£££ "," ▓█£££ "," ██£££ "," ░██£££ "," ▒██£££ "," ▓██£££ "," ███£££ "," ░███£££ "," ▒███£££ "," ▓███£££ "," ████£££ "," ░████£££ "," ▒████£££ "," ▓████£££ "," █████£££ "," ░█████£££ "," ▒█████£££ "," ▓█████£££ "," ██████£££ "," ██████£££ "]}}});var Tu=U((aB,f0)=>{var fD=Object.assign({},N0()),x0=Object.keys(fD);Object.defineProperty(fD,"random",{get(){let D=Math.floor(Math.random()*x0.length),u=x0[D];return fD[u]}});f0.exports=fD});var m0=U((q_,d0)=>{d0.exports=()=>{return/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g}});var _F=U((y_,XD)=>{var m1=typeof process<"u"&&process.env.TERM_PROGRAM==="Hyper",i1=typeof process<"u"&&process.platform==="win32",FF=typeof process<"u"&&process.platform==="linux",Yu={ballotDisabled:"☒",ballotOff:"☐",ballotOn:"☑",bullet:"•",bulletWhite:"◦",fullBlock:"█",heart:"❤",identicalTo:"≡",line:"─",mark:"※",middot:"·",minus:"-",multiplication:"×",obelus:"÷",pencilDownRight:"✎",pencilRight:"✏",pencilUpRight:"✐",percent:"%",pilcrow2:"❡",pilcrow:"¶",plusMinus:"±",question:"?",section:"§",starsOff:"☆",starsOn:"★",upDownArrow:"↕"},EF=Object.assign({},Yu,{check:"√",cross:"×",ellipsisLarge:"...",ellipsis:"...",info:"i",questionSmall:"?",pointer:">",pointerSmall:"»",radioOff:"( )",radioOn:"(*)",warning:"‼"}),BF=Object.assign({},Yu,{ballotCross:"✘",check:"✔",cross:"✖",ellipsisLarge:"⋯",ellipsis:"…",info:"ℹ",questionFull:"?",questionSmall:"﹖",pointer:FF?"▸":"❯",pointerSmall:FF?"‣":"›",radioOff:"◯",radioOn:"◉",warning:"⚠"});XD.exports=i1&&!m1?EF:BF;Reflect.defineProperty(XD.exports,"common",{enumerable:!1,value:Yu});Reflect.defineProperty(XD.exports,"windows",{enumerable:!1,value:EF});Reflect.defineProperty(XD.exports,"other",{enumerable:!1,value:BF})});var kD=U((b_,Ju)=>{var n1=(D)=>D!==null&&typeof D==="object"&&!Array.isArray(D),p1=/[\u001b\u009b][[\]#;?()]*(?:(?:(?:[^\W_]*;?[^\W_]*)\u0007)|(?:(?:[0-9]{1,4}(;[0-9]{0,4})*)?[~0-9=<>cf-nqrtyA-PRZ]))/g,l1=()=>{if(typeof process<"u")return process.env.FORCE_COLOR!=="0";return!1},CF=()=>{let D={enabled:l1(),visible:!0,styles:{},keys:{}},u=(_)=>{let A=_.open=`\x1B[${_.codes[0]}m`,C=_.close=`\x1B[${_.codes[1]}m`,$=_.regex=new RegExp(`\\u001b\\[${_.codes[1]}m`,"g");return _.wrap=(w,r)=>{if(w.includes(C))w=w.replace($,C+A);let M=A+w+C;return r?M.replace(/\r*\n/g,`${C}$&${A}`):M},_},F=(_,A,C)=>{return typeof _==="function"?_(A):_.wrap(A,C)},E=(_,A)=>{if(_===""||_==null)return"";if(D.enabled===!1)return _;if(D.visible===!1)return"";let C=""+_,$=C.includes(`
24
+ `),w=A.length;if(w>0&&A.includes("unstyle"))A=[...new Set(["unstyle",...A])].reverse();while(w-- >0)C=F(D.styles[A[w]],C,$);return C},B=(_,A,C)=>{D.styles[_]=u({name:_,codes:A}),(D.keys[C]||(D.keys[C]=[])).push(_),Reflect.defineProperty(D,_,{configurable:!0,enumerable:!0,set(w){D.alias(_,w)},get(){let w=(r)=>E(r,w.stack);return Reflect.setPrototypeOf(w,D),w.stack=this.stack?this.stack.concat(_):[_],w}})};return B("reset",[0,0],"modifier"),B("bold",[1,22],"modifier"),B("dim",[2,22],"modifier"),B("italic",[3,23],"modifier"),B("underline",[4,24],"modifier"),B("inverse",[7,27],"modifier"),B("hidden",[8,28],"modifier"),B("strikethrough",[9,29],"modifier"),B("black",[30,39],"color"),B("red",[31,39],"color"),B("green",[32,39],"color"),B("yellow",[33,39],"color"),B("blue",[34,39],"color"),B("magenta",[35,39],"color"),B("cyan",[36,39],"color"),B("white",[37,39],"color"),B("gray",[90,39],"color"),B("grey",[90,39],"color"),B("bgBlack",[40,49],"bg"),B("bgRed",[41,49],"bg"),B("bgGreen",[42,49],"bg"),B("bgYellow",[43,49],"bg"),B("bgBlue",[44,49],"bg"),B("bgMagenta",[45,49],"bg"),B("bgCyan",[46,49],"bg"),B("bgWhite",[47,49],"bg"),B("blackBright",[90,39],"bright"),B("redBright",[91,39],"bright"),B("greenBright",[92,39],"bright"),B("yellowBright",[93,39],"bright"),B("blueBright",[94,39],"bright"),B("magentaBright",[95,39],"bright"),B("cyanBright",[96,39],"bright"),B("whiteBright",[97,39],"bright"),B("bgBlackBright",[100,49],"bgBright"),B("bgRedBright",[101,49],"bgBright"),B("bgGreenBright",[102,49],"bgBright"),B("bgYellowBright",[103,49],"bgBright"),B("bgBlueBright",[104,49],"bgBright"),B("bgMagentaBright",[105,49],"bgBright"),B("bgCyanBright",[106,49],"bgBright"),B("bgWhiteBright",[107,49],"bgBright"),D.ansiRegex=p1,D.hasColor=D.hasAnsi=(_)=>{return D.ansiRegex.lastIndex=0,typeof _==="string"&&_!==""&&D.ansiRegex.test(_)},D.alias=(_,A)=>{let C=typeof A==="string"?D[A]:A;if(typeof C!=="function")throw TypeError("Expected alias to be the name of an existing color (string) or a function");if(!C.stack)Reflect.defineProperty(C,"name",{value:_}),D.styles[_]=C,C.stack=[_];Reflect.defineProperty(D,_,{configurable:!0,enumerable:!0,set($){D.alias(_,$)},get(){let $=(w)=>E(w,$.stack);return Reflect.setPrototypeOf($,D),$.stack=this.stack?this.stack.concat(C.stack):C.stack,$}})},D.theme=(_)=>{if(!n1(_))throw TypeError("Expected theme to be an object");for(let A of Object.keys(_))D.alias(A,_[A]);return D},D.alias("unstyle",(_)=>{if(typeof _==="string"&&_!=="")return D.ansiRegex.lastIndex=0,_.replace(D.ansiRegex,"");return""}),D.alias("noop",(_)=>_),D.none=D.clear=D.noop,D.stripColor=D.unstyle,D.symbols=_F(),D.define=B,D};Ju.exports=CF();Ju.exports.create=CF});var O=U((c1)=>{var a1=Object.prototype.toString,s=kD(),AF=!1,YD=new Set,$F={yellow:"blue",cyan:"red",green:"magenta",black:"white",blue:"yellow",red:"cyan",magenta:"green",white:"black"};c1.longest=(D,u)=>{return D.reduce((F,E)=>Math.max(F,u?E[u].length:E.length),0)};c1.hasColor=(D)=>!!D&&s.hasColor(D);var sD=c1.isObject=(D)=>{return D!==null&&typeof D==="object"&&!Array.isArray(D)};c1.nativeType=(D)=>{return a1.call(D).slice(8,-1).toLowerCase().replace(/\s/g,"")};c1.isAsyncFn=(D)=>{return c1.nativeType(D)==="asyncfunction"};c1.isPrimitive=(D)=>{return D!=null&&typeof D!=="object"&&typeof D!=="function"};c1.resolve=(D,u,...F)=>{if(typeof u==="function")return u.call(D,...F);return u};c1.scrollDown=(D=[])=>[...D.slice(1),D[0]];c1.scrollUp=(D=[])=>[D.pop(),...D];c1.reorder=(D=[])=>{let u=D.slice();return u.sort((F,E)=>{if(F.index>E.index)return 1;if(F.index<E.index)return-1;return 0}),u};c1.swap=(D,u,F)=>{let E=D.length,B=F===E?0:F<0?E-1:F,_=D[u];D[u]=D[B],D[B]=_};c1.width=(D,u=80)=>{let F=D&&D.columns?D.columns:u;if(D&&typeof D.getWindowSize==="function")F=D.getWindowSize()[0];if(process.platform==="win32")return F-1;return F};c1.height=(D,u=20)=>{let F=D&&D.rows?D.rows:u;if(D&&typeof D.getWindowSize==="function")F=D.getWindowSize()[1];return F};c1.wordWrap=(D,u={})=>{if(!D)return D;if(typeof u==="number")u={width:u};let{indent:F="",newline:E=`
25
+ `+F,width:B=80}=u,_=(E+F).match(/[^\S\n]/g)||[];B-=_.length;let A=`.{1,${B}}([\\s\\u200B]+|$)|[^\\s\\u200B]+?([\\s\\u200B]+|$)`,C=D.trim(),$=new RegExp(A,"g"),w=C.match($)||[];if(w=w.map((r)=>r.replace(/\n$/,"")),u.padEnd)w=w.map((r)=>r.padEnd(B," "));if(u.padStart)w=w.map((r)=>r.padStart(B," "));return F+w.join(E)};c1.unmute=(D)=>{let u=D.stack.find((E)=>s.keys.color.includes(E));if(u)return s[u];if(D.stack.find((E)=>E.slice(2)==="bg"))return s[u.slice(2)];return(E)=>E};c1.pascal=(D)=>D?D[0].toUpperCase()+D.slice(1):"";c1.inverse=(D)=>{if(!D||!D.stack)return D;let u=D.stack.find((E)=>s.keys.color.includes(E));if(u){let E=s["bg"+c1.pascal(u)];return E?E.black:D}let F=D.stack.find((E)=>E.slice(0,2)==="bg");if(F)return s[F.slice(2).toLowerCase()]||D;return s.none};c1.complement=(D)=>{if(!D||!D.stack)return D;let u=D.stack.find((E)=>s.keys.color.includes(E)),F=D.stack.find((E)=>E.slice(0,2)==="bg");if(u&&!F)return s[$F[u]||u];if(F){let E=F.slice(2).toLowerCase(),B=$F[E];if(!B)return D;return s["bg"+c1.pascal(B)]||D}return s.none};c1.meridiem=(D)=>{let u=D.getHours(),F=D.getMinutes(),E=u>=12?"pm":"am";u=u%12;let B=u===0?12:u,_=F<10?"0"+F:F;return B+":"+_+" "+E};c1.set=(D={},u="",F)=>{return u.split(".").reduce((E,B,_,A)=>{let C=A.length-1>_?E[B]||{}:F;if(!c1.isObject(C)&&_<A.length-1)C={};return E[B]=C},D)};c1.get=(D={},u="",F)=>{let E=D[u]==null?u.split(".").reduce((B,_)=>B&&B[_],D):D[u];return E==null?F:E};c1.mixin=(D,u)=>{if(!sD(D))return u;if(!sD(u))return D;for(let F of Object.keys(u)){let E=Object.getOwnPropertyDescriptor(u,F);if(hasOwnProperty.call(E,"value"))if(hasOwnProperty.call(D,F)&&sD(E.value)){let B=Object.getOwnPropertyDescriptor(D,F);if(sD(B.value)&&B.value!==E.value)D[F]=c1.merge({},D[F],u[F]);else Reflect.defineProperty(D,F,E)}else Reflect.defineProperty(D,F,E);else Reflect.defineProperty(D,F,E)}return D};c1.merge=(...D)=>{let u={};for(let F of D)c1.mixin(u,F);return u};c1.mixinEmitter=(D,u)=>{let F=u.constructor.prototype;for(let E of Object.keys(F)){let B=F[E];if(typeof B==="function")c1.define(D,E,B.bind(u));else c1.define(D,E,B)}};var gD=(D,u)=>{if(AF)return;if(AF=!0,YD.forEach((F)=>F()),D===!0)process.exit(128+u)},wF=gD.bind(null,!0,15),rF=gD.bind(null,!0,2);c1.onExit=(D)=>{if(YD.size===0)process.once("SIGTERM",wF),process.once("SIGINT",rF),process.once("exit",gD);return YD.add(D),()=>{if(YD.delete(D),YD.size===0)process.off("SIGTERM",wF),process.off("SIGINT",rF),process.off("exit",gD)}};c1.define=(D,u,F)=>{Reflect.defineProperty(D,u,{value:F})};c1.defineExport=(D,u,F)=>{let E;Reflect.defineProperty(D,u,{enumerable:!0,configurable:!0,set(B){E=B},get(){return E?E():F()}})}});var LF=U((P_,zF)=>{zF.exports=({onlyFirst:D=!1}={})=>{let u=["[\\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(u,D?void 0:"g")}});var uD=U((O_,SF)=>{var H8=LF();SF.exports=(D)=>typeof D==="string"?D.replace(H8(),""):D});var TF=U((W8)=>{W8.ctrl={a:"first",b:"backward",c:"cancel",d:"deleteForward",e:"last",f:"forward",g:"reset",i:"tab",k:"cutForward",l:"reset",n:"newItem",m:"cancel",j:"submit",p:"search",r:"remove",s:"save",u:"undo",w:"cutLeft",x:"toggleCursor",v:"paste"};W8.shift={up:"shiftUp",down:"shiftDown",left:"shiftLeft",right:"shiftRight",tab:"prev"};W8.fn={up:"pageUp",down:"pageDown",left:"pageLeft",right:"pageRight",delete:"deleteForward"};W8.option={b:"backward",f:"forward",d:"cutRight",left:"cutLeft",up:"altUp",down:"altDown"};W8.keys={pageup:"pageUp",pagedown:"pageDown",home:"home",end:"end",cancel:"cancel",delete:"deleteForward",backspace:"delete",down:"down",enter:"submit",escape:"cancel",left:"left",space:"space",number:"number",return:"submit",right:"right",tab:"next",up:"up"}});var hF=U((x_,UF)=>{UF.exports=class{_queue=[];_executing=!1;_jobRunner=null;constructor(u){this._jobRunner=u}enqueue=(...u)=>{this._queue.push(u),this._dequeue()};destroy(){this._queue.length=0,this._jobRunner=null}_dequeue(){if(this._executing||!this._queue.length)return;this._executing=!0,this._jobRunner(...this._queue.shift()),setTimeout(()=>{this._executing=!1,this._dequeue()})}}});var Vu=U((f_,HF)=>{var RF=a("readline"),J8=TF(),j8=hF(),V8=/^(?:\x1b)([a-zA-Z0-9])$/,K8=/^(?:\x1b+)(O|N|\[|\[\[)(?:(\d+)(?:;(\d+))?([~^$])|(?:1;)?(\d+)?([a-zA-Z]))/,y8={OP:"f1",OQ:"f2",OR:"f3",OS:"f4","[11~":"f1","[12~":"f2","[13~":"f3","[14~":"f4","[[A":"f1","[[B":"f2","[[C":"f3","[[D":"f4","[[E":"f5","[15~":"f5","[17~":"f6","[18~":"f7","[19~":"f8","[20~":"f9","[21~":"f10","[23~":"f11","[24~":"f12","[A":"up","[B":"down","[C":"right","[D":"left","[E":"clear","[F":"end","[H":"home",OA:"up",OB:"down",OC:"right",OD:"left",OE:"clear",OF:"end",OH:"home","[1~":"home","[2~":"insert","[3~":"delete","[4~":"end","[5~":"pageup","[6~":"pagedown","[[5~":"pageup","[[6~":"pagedown","[7~":"home","[8~":"end","[a":"up","[b":"down","[c":"right","[d":"left","[e":"clear","[2$":"insert","[3$":"delete","[5$":"pageup","[6$":"pagedown","[7$":"home","[8$":"end",Oa:"up",Ob:"down",Oc:"right",Od:"left",Oe:"clear","[2^":"insert","[3^":"delete","[5^":"pageup","[6^":"pagedown","[7^":"home","[8^":"end","[Z":"tab"};function b8(D){return["[a","[b","[c","[d","[e","[2$","[3$","[5$","[6$","[7$","[8$","[Z"].includes(D)}function t8(D){return["Oa","Ob","Oc","Od","Oe","[2^","[3^","[5^","[6^","[7^","[8^"].includes(D)}var dD=(D="",u={})=>{let F,E={name:u.name,ctrl:!1,meta:!1,shift:!1,option:!1,sequence:D,raw:D,...u};if(Buffer.isBuffer(D))if(D[0]>127&&D[1]===void 0)D[0]-=128,D="\x1B"+String(D);else D=String(D);else if(D!==void 0&&typeof D!=="string")D=String(D);else if(!D)D=E.sequence||"";if(E.sequence=E.sequence||D||E.name,D==="\r")E.raw=void 0,E.name="return";else if(D===`
26
+ `)E.name="enter";else if(D==="\t")E.name="tab";else if(D==="\b"||D===""||D==="\x1B"||D==="\x1B\b")E.name="backspace",E.meta=D.charAt(0)==="\x1B";else if(D==="\x1B"||D==="\x1B\x1B")E.name="escape",E.meta=D.length===2;else if(D===" "||D==="\x1B ")E.name="space",E.meta=D.length===2;else if(D<="\x1A")E.name=String.fromCharCode(D.charCodeAt(0)+97-1),E.ctrl=!0;else if(D.length===1&&D>="0"&&D<="9")E.name="number";else if(D.length===1&&D>="a"&&D<="z")E.name=D;else if(D.length===1&&D>="A"&&D<="Z")E.name=D.toLowerCase(),E.shift=!0;else if(F=V8.exec(D))E.meta=!0,E.shift=/^[A-Z]$/.test(F[1]);else if(F=K8.exec(D)){let B=[...D];if(B[0]==="\x1B"&&B[1]==="\x1B")E.option=!0;let _=[F[1],F[2],F[4],F[6]].filter(Boolean).join(""),A=(F[3]||F[5]||1)-1;E.ctrl=!!(A&4),E.meta=!!(A&10),E.shift=!!(A&1),E.code=_,E.name=y8[_],E.shift=b8(_)||E.shift,E.ctrl=t8(_)||E.ctrl}return E};dD.listen=(D={},u)=>{let{stdin:F}=D;if(!F||F!==process.stdin&&!F.isTTY)throw Error("Invalid stream passed");let E=RF.createInterface({terminal:!0,input:F});RF.emitKeypressEvents(F,E);let B=new j8((C,$)=>u(C,dD(C,$),E)),_=F.isRaw;if(F.isTTY)F.setRawMode(!0);return F.on("keypress",B.enqueue),E.resume(),()=>{if(F.isTTY)F.setRawMode(_);F.removeListener("keypress",B.enqueue),B.destroy(),E.pause(),E.close()}};dD.action=(D,u,F)=>{let E={...J8,...F};if(u.ctrl)return u.action=E.ctrl[u.name],u;if(u.option&&E.option)return u.action=E.option[u.name],u;if(u.shift)return u.action=E.shift[u.name],u;return u.action=E.keys[u.name],u};HF.exports=dD});var ZF=U((v_,WF)=>{WF.exports=(D)=>{D.timers=D.timers||{};let u=D.options.timers;if(!u)return;for(let F of Object.keys(u)){let E=u[F];if(typeof E==="number")E={interval:E};P8(D,F,E)}};function P8(D,u,F={}){let E=D.timers[u]={name:u,start:Date.now(),ms:0,tick:0},B=F.interval||120;E.frames=F.frames||[],E.loading=!0;let _=setInterval(()=>{E.ms=Date.now()-E.start,E.tick++,D.render()},B);return E.stop=()=>{E.loading=!1,clearInterval(_)},Reflect.defineProperty(E,"interval",{value:_}),D.once("close",()=>E.stop()),E.stop}});var XF=U((k_,QF)=>{var{define:O8,width:N8}=O();class GF{constructor(D){let u=D.options;O8(this,"_prompt",D),this.type=D.type,this.name=D.name,this.message="",this.header="",this.footer="",this.error="",this.hint="",this.input="",this.cursor=0,this.index=0,this.lines=0,this.tick=0,this.prompt="",this.buffer="",this.width=N8(u.stdout||process.stdout),Object.assign(this,u),this.name=this.name||this.message,this.message=this.message||this.name,this.symbols=D.symbols,this.styles=D.styles,this.required=new Set,this.cancelled=!1,this.submitted=!1}clone(){let D={...this};return D.status=this.status,D.buffer=Buffer.from(D.buffer),delete D.clone,D}set color(D){this._color=D}get color(){let D=this.prompt.styles;if(this.cancelled)return D.cancelled;if(this.submitted)return D.submitted;let u=this._color||D[this.status];return typeof u==="function"?u:D.pending}set loading(D){this._loading=D}get loading(){if(typeof this._loading==="boolean")return this._loading;if(this.loadingChoices)return"choices";return!1}get status(){if(this.cancelled)return"cancelled";if(this.submitted)return"submitted";return"pending"}}QF.exports=GF});var JF=U((s_,YF)=>{var Ku=O(),P=kD(),yu={default:P.noop,noop:P.noop,set inverse(D){this._inverse=D},get inverse(){return this._inverse||Ku.inverse(this.primary)},set complement(D){this._complement=D},get complement(){return this._complement||Ku.complement(this.primary)},primary:P.cyan,success:P.green,danger:P.magenta,strong:P.bold,warning:P.yellow,muted:P.dim,disabled:P.gray,dark:P.dim.gray,underline:P.underline,set info(D){this._info=D},get info(){return this._info||this.primary},set em(D){this._em=D},get em(){return this._em||this.primary.underline},set heading(D){this._heading=D},get heading(){return this._heading||this.muted.underline},set pending(D){this._pending=D},get pending(){return this._pending||this.primary},set submitted(D){this._submitted=D},get submitted(){return this._submitted||this.success},set cancelled(D){this._cancelled=D},get cancelled(){return this._cancelled||this.danger},set typing(D){this._typing=D},get typing(){return this._typing||this.dim},set placeholder(D){this._placeholder=D},get placeholder(){return this._placeholder||this.primary.dim},set highlight(D){this._highlight=D},get highlight(){return this._highlight||this.inverse}};yu.merge=(D={})=>{if(D.styles&&typeof D.styles.enabled==="boolean")P.enabled=D.styles.enabled;if(D.styles&&typeof D.styles.visible==="boolean")P.visible=D.styles.visible;let u=Ku.merge({},yu,D.styles);delete u.merge;for(let F of Object.keys(P))if(!hasOwnProperty.call(u,F))Reflect.defineProperty(u,F,{get:()=>P[F]});for(let F of Object.keys(P.styles))if(!hasOwnProperty.call(u,F))Reflect.defineProperty(u,F,{get:()=>P[F]});return u};YF.exports=yu});var VF=U((g_,jF)=>{var bu=process.platform==="win32",o=kD(),x8=O(),tu={...o.symbols,upDownDoubleArrow:"⇕",upDownDoubleArrow2:"⬍",upDownArrow:"↕",asterisk:"*",asterism:"⁂",bulletWhite:"◦",electricArrow:"⌁",ellipsisLarge:"⋯",ellipsisSmall:"…",fullBlock:"█",identicalTo:"≡",indicator:o.symbols.check,leftAngle:"‹",mark:"※",minus:"−",multiplication:"×",obelus:"÷",percent:"%",pilcrow:"¶",pilcrow2:"❡",pencilUpRight:"✐",pencilDownRight:"✎",pencilRight:"✏",plus:"+",plusMinus:"±",pointRight:"☞",rightAngle:"›",section:"§",hexagon:{off:"⬡",on:"⬢",disabled:"⬢"},ballot:{on:"☑",off:"☐",disabled:"☒"},stars:{on:"★",off:"☆",disabled:"☆"},folder:{on:"▼",off:"▶",disabled:"▶"},prefix:{pending:o.symbols.question,submitted:o.symbols.check,cancelled:o.symbols.cross},separator:{pending:o.symbols.pointerSmall,submitted:o.symbols.middot,cancelled:o.symbols.middot},radio:{off:bu?"( )":"◯",on:bu?"(*)":"◉",disabled:bu?"(|)":"Ⓘ"},numbers:["⓪","①","②","③","④","⑤","⑥","⑦","⑧","⑨","⑩","⑪","⑫","⑬","⑭","⑮","⑯","⑰","⑱","⑲","⑳","㉑","㉒","㉓","㉔","㉕","㉖","㉗","㉘","㉙","㉚","㉛","㉜","㉝","㉞","㉟","㊱","㊲","㊳","㊴","㊵","㊶","㊷","㊸","㊹","㊺","㊻","㊼","㊽","㊾","㊿"]};tu.merge=(D)=>{let u=x8.merge({},o.symbols,tu,D.symbols);return delete u.merge,u};jF.exports=tu});var yF=U((d_,KF)=>{var f8=JF(),v8=VF(),k8=O();KF.exports=(D)=>{D.options=k8.merge({},D.options.theme,D.options),D.symbols=v8.merge(D.options),D.styles=f8.merge(D.options)}});var OF=U((tF,PF)=>{var bF=process.env.TERM_PROGRAM==="Apple_Terminal",s8=uD(),Pu=O(),i=PF.exports=tF,Ou=!1,FD=i.code={bell:"\x07",beep:"\x07",beginning:"\x1B[G",down:"\x1B[J",esc:"\x1B[",getPosition:"\x1B[6n",hide:"\x1B[?25l",line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",restorePosition:"\x1B["+(bF?"8":"u"),savePosition:"\x1B["+(bF?"7":"s"),screen:"\x1B[2J",show:"\x1B[?25h",up:"\x1B[1J"},wD=i.cursor={get hidden(){return Ou},hide(){return Ou=!0,FD.hide},show(){return Ou=!1,FD.show},forward:(D=1)=>`\x1B[${D}C`,backward:(D=1)=>`\x1B[${D}D`,nextLine:(D=1)=>"\x1B[E".repeat(D),prevLine:(D=1)=>"\x1B[F".repeat(D),up:(D=1)=>D?`\x1B[${D}A`:"",down:(D=1)=>D?`\x1B[${D}B`:"",right:(D=1)=>D?`\x1B[${D}C`:"",left:(D=1)=>D?`\x1B[${D}D`:"",to(D,u){return u?`\x1B[${u+1};${D+1}H`:`\x1B[${D+1}G`},move(D=0,u=0){let F="";return F+=D<0?wD.left(-D):D>0?wD.right(D):"",F+=u<0?wD.up(-u):u>0?wD.down(u):"",F},strLen(D){var u=0,F=D.length,E=-1;for(var B=0;B<F;B++)if(E=D.charCodeAt(B),E>=0&&E<=128)u+=1;else u+=2;return u},restore(D={}){let{after:u,cursor:F,initial:E,input:B,prompt:_,size:A,value:C}=D;if(E=Pu.isPrimitive(E)?String(E):"",B=Pu.isPrimitive(B)?String(B):"",C=Pu.isPrimitive(C)?String(C):"",A){let $=i.cursor.up(A)+i.cursor.to(this.strLen(_)),w=B.length-F;if(w>0)$+=i.cursor.left(w);return $}if(C||u){let $=!B&&!!E?-this.strLen(E):-this.strLen(B)+F;if(u)$-=this.strLen(u);if(B===""&&E&&!_.includes(E))$+=this.strLen(E);return i.cursor.move($)}}},Nu=i.erase={screen:FD.screen,up:FD.up,down:FD.down,line:FD.line,lineEnd:FD.lineEnd,lineStart:FD.lineStart,lines(D){let u="";for(let F=0;F<D;F++)u+=i.erase.line+(F<D-1?i.cursor.up(1):"");if(D)u+=i.code.beginning;return u}};i.clear=(D="",u=process.stdout.columns)=>{if(!u)return Nu.line+wD.to(0);let F=(_)=>[...s8(_)].length,E=D.split(/\r?\n/),B=0;for(let _ of E)B+=1+Math.floor(Math.max(F(_)-1,0)/u);return(Nu.line+wD.prevLine()).repeat(B-1)+Nu.line+wD.to(0)}});var TD=U((m_,xF)=>{var g8=a("events"),NF=uD(),xu=Vu(),d8=ZF(),m8=XF(),i8=yF(),N=O(),rD=OF();class fu extends g8{constructor(D={}){super();this.name=D.name,this.type=D.type,this.options=D,i8(this),d8(this),this.state=new m8(this),this.initial=[D.initial,D.default].find((u)=>u!=null),this.stdout=D.stdout||process.stdout,this.stdin=D.stdin||process.stdin,this.scale=D.scale||1,this.term=this.options.term||process.env.TERM_PROGRAM,this.margin=p8(this.options.margin),this.setMaxListeners(0),n8(this)}async keypress(D,u={}){this.keypressed=!0;let F=xu.action(D,xu(D,u),this.options.actions);this.state.keypress=F,this.emit("keypress",D,F),this.emit("state",this.state.clone());let E=this.options[F.action]||this[F.action]||this.dispatch;if(typeof E==="function")return await E.call(this,D,F);this.alert()}alert(){if(delete this.state.alert,this.options.show===!1)this.emit("alert");else this.stdout.write(rD.code.beep)}cursorHide(){this.stdout.write(rD.cursor.hide());let D=N.onExit(()=>this.cursorShow());this.on("close",()=>{this.cursorShow(),D()})}cursorShow(){this.stdout.write(rD.cursor.show())}write(D){if(!D)return;if(this.stdout&&this.state.show!==!1)this.stdout.write(D);this.state.buffer+=D}clear(D=0){let u=this.state.buffer;if(this.state.buffer="",!u&&!D||this.options.show===!1)return;this.stdout.write(rD.cursor.down(D)+rD.clear(u,this.width))}restore(){if(this.state.closed||this.options.show===!1)return;let{prompt:D,after:u,rest:F}=this.sections(),{cursor:E,initial:B="",input:_="",value:A=""}=this,C=this.state.size=F.length,$={after:u,cursor:E,initial:B,input:_,prompt:D,size:C,value:A},w=rD.cursor.restore($);if(w)this.stdout.write(w)}sections(){let{buffer:D,input:u,prompt:F}=this.state;F=NF(F);let E=NF(D),B=E.indexOf(F),_=E.slice(0,B),C=E.slice(B).split(`
27
+ `),$=C[0],w=C[C.length-1],M=(F+(u?" "+u:"")).length,L=M<$.length?$.slice(M+1):"";return{header:_,prompt:$,after:L,rest:C.slice(1),last:w}}async submit(){if(this.state.submitted=!0,this.state.validating=!0,this.options.onSubmit)await this.options.onSubmit.call(this,this.name,this.value,this);let D=this.state.error||await this.validate(this.value,this.state);if(D!==!0){let u=`
28
28
  `+this.symbols.pointer+" ";if(typeof D==="string")u+=D.trim();else u+="Invalid input";this.state.error=`
29
- `+this.styles.danger(u),this.state.submitted=!1,await this.render(),await this.alert(),this.state.validating=!1,this.state.error=void 0;return}this.state.validating=!1,await this.render(),await this.close(),this.value=await this.result(this.value),this.emit("submit",this.value)}async cancel(D){if(this.state.cancelled=this.state.submitted=!0,await this.render(),await this.close(),typeof this.options.onCancel==="function")await this.options.onCancel.call(this,this.name,this.value,this);this.emit("cancel",await this.error(D))}async close(){this.state.closed=!0;try{let D=this.sections(),u=Math.ceil(D.prompt.length/this.width);if(D.rest)this.write(SD.cursor.down(D.rest.length));this.write(`
30
- `.repeat(u))}catch(D){}this.emit("close")}start(){if(!this.stop&&this.options.show!==!1)this.stop=Nu.listen(this,this.keypress.bind(this)),this.once("close",this.stop),this.emit("start",this)}async skip(){if(this.skipped=this.options.skip===!0,typeof this.options.skip==="function")this.skipped=await this.options.skip.call(this,this.name,this.value);return this.skipped}async initialize(){let{format:D,options:u,result:F}=this;if(this.format=()=>D.call(this,this.value),this.result=()=>F.call(this,this.value),typeof u.initial==="function")this.initial=await u.initial.call(this,this);if(typeof u.onRun==="function")await u.onRun.call(this,this);if(typeof u.onSubmit==="function"){let E=u.onSubmit.bind(this),B=this.submit.bind(this);delete this.options.onSubmit,this.submit=async()=>{return await E(this.name,this.value,this),B()}}await this.start(),await this.render()}render(){throw Error("expected prompt to have a custom render method")}run(){return new Promise(async(D,u)=>{if(this.once("submit",D),this.once("cancel",u),await this.skip())return this.render=()=>{},this.submit();await this.initialize(),this.emit("run")})}async element(D,u,F){let{options:E,state:B,symbols:_,timers:A}=this,C=A&&A[D];B.timer=C;let $=E[D]||B[D]||_[D],w=u&&u[D]!=null?u[D]:await $;if(w==="")return w;let S=await this.resolve(w,B,u,F);if(!S&&u&&u[D])return this.resolve($,B,u,F);return S}async prefix(){let D=await this.element("prefix")||this.symbols,u=this.timers&&this.timers.prefix,F=this.state;if(F.timer=u,N.isObject(D))D=D[F.status]||D.pending;if(!N.hasColor(D))return(this.styles[F.status]||this.styles.pending)(D);return D}async message(){let D=await this.element("message");if(!N.hasColor(D))return this.styles.strong(D);return D}async separator(){let D=await this.element("separator")||this.symbols,u=this.timers&&this.timers.separator,F=this.state;F.timer=u;let E=D[F.status]||D.pending||F.separator,B=await this.resolve(E,F);if(N.isObject(B))B=B[F.status]||B.pending;if(!N.hasColor(B))return this.styles.muted(B);return B}async pointer(D,u){let F=await this.element("pointer",D,u);if(typeof F==="string"&&N.hasColor(F))return F;if(F){let E=this.styles,B=this.index===u,_=B?E.primary:($)=>$,A=await this.resolve(F[B?"on":"off"]||F,this.state),C=!N.hasColor(A)?_(A):A;return B?C:" ".repeat(A.length)}}async indicator(D,u){let F=await this.element("indicator",D,u);if(typeof F==="string"&&N.hasColor(F))return F;if(F){let E=this.styles,B=D.enabled===!0,_=B?E.success:E.dark,A=F[B?"on":"off"]||F;return!N.hasColor(A)?_(A):A}return""}body(){return null}footer(){if(this.state.status==="pending")return this.element("footer")}header(){if(this.state.status==="pending")return this.element("header")}async hint(){if(this.state.status==="pending"&&!this.isValue(this.state.input)){let D=await this.element("hint");if(!N.hasColor(D))return this.styles.muted(D);return D}}error(D){return!this.state.submitted?D||this.state.error:""}format(D){return D}result(D){return D}validate(D){if(this.options.required===!0)return this.isValue(D);return!0}isValue(D){return D!=null&&D!==""}resolve(D,...u){return N.resolve(this,D,...u)}get base(){return xu.prototype}get style(){return this.styles[this.state.status]}get height(){return this.options.rows||N.height(this.stdout,25)}get width(){return this.options.columns||N.width(this.stdout,80)}get size(){return{width:this.width,height:this.height}}set cursor(D){this.state.cursor=D}get cursor(){return this.state.cursor}set input(D){this.state.input=D}get input(){return this.state.input}set value(D){this.state.value=D}get value(){let{input:D,value:u}=this.state,F=[u,D].find(this.isValue.bind(this));return this.isValue(F)?F:this.initial}static get prompt(){return(D)=>new this(D).run()}}function d8(D){let u=(B)=>{return D[B]===void 0||typeof D[B]==="function"},F=["actions","choices","initial","margin","roles","styles","symbols","theme","timers","value"],E=["body","footer","error","header","hint","indicator","message","prefix","separator","skip"];for(let B of Object.keys(D.options)){if(F.includes(B))continue;if(/^on[A-Z]/.test(B))continue;let _=D.options[B];if(typeof _==="function"&&u(B)){if(!E.includes(B))D[B]=_.bind(D)}else if(typeof D[B]!=="function")D[B]=_}}function i8(D){if(typeof D==="number")D=[D,D,D,D];let u=[].concat(D||[]),F=(B)=>B%2===0?`
31
- `:" ",E=[];for(let B=0;B<4;B++){let _=F(B);if(u[B])E.push(_.repeat(u[B]));else E.push("")}return E}NF.exports=xu});var fF=U((m_,vF)=>{var n8=O(),xF={default(D,u){return u},checkbox(D,u){throw Error("checkbox role is not implemented yet")},editable(D,u){throw Error("editable role is not implemented yet")},expandable(D,u){throw Error("expandable role is not implemented yet")},heading(D,u){return u.disabled="",u.indicator=[u.indicator," "].find((F)=>F!=null),u.message=u.message||"",u},input(D,u){throw Error("input role is not implemented yet")},option(D,u){return xF.default(D,u)},radio(D,u){throw Error("radio role is not implemented yet")},separator(D,u){return u.disabled="",u.indicator=[u.indicator," "].find((F)=>F!=null),u.message=u.message||D.symbols.line.repeat(5),u},spacer(D,u){return u}};vF.exports=(D,u={})=>{let F=n8.merge({},xF,u.roles);return F[D]||F.default}});var YD=U((d_,mF)=>{var p8=uD(),l8=hD(),a8=fF(),mD=O(),{reorder:vu,scrollUp:c8,scrollDown:o8,isObject:kF,swap:e8}=mD;class sF extends l8{constructor(D){super(D);this.cursorHide(),this.maxSelected=D.maxSelected||1/0,this.multiple=D.multiple||!1,this.initial=D.initial||0,this.delay=D.delay||0,this.longest=0,this.num=""}async initialize(){if(typeof this.options.initial==="function")this.initial=await this.options.initial.call(this);await this.reset(!0),await super.initialize()}async reset(){let{choices:D,initial:u,autofocus:F,suggest:E}=this.options;if(this.state._choices=[],this.state.choices=[],this.choices=await Promise.all(await this.toChoices(D)),this.choices.forEach((B)=>B.enabled=!1),typeof E!=="function"&&this.selectable.length===0)throw Error("At least one choice must be selectable");if(kF(u))u=Object.keys(u);if(Array.isArray(u)){if(F!=null)this.index=this.findIndex(F);u.forEach((B)=>this.enable(this.find(B))),await this.render()}else{if(F!=null)u=F;if(typeof u==="string")u=this.findIndex(u);if(typeof u==="number"&&u>-1)this.index=Math.max(0,Math.min(u,this.choices.length)),this.enable(this.find(this.index))}if(this.isDisabled(this.focused))await this.down()}async toChoices(D,u){this.state.loadingChoices=!0;let F=[],E=0,B=async(_,A)=>{if(typeof _==="function")_=await _.call(this);if(_ instanceof Promise)_=await _;for(let C=0;C<_.length;C++){let $=_[C]=await this.toChoice(_[C],E++,A);if(F.push($),$.choices)await B($.choices,$)}return F};return B(D,u).then((_)=>{return this.state.loadingChoices=!1,_})}async toChoice(D,u,F){if(typeof D==="function")D=await D.call(this,this);if(D instanceof Promise)D=await D;if(typeof D==="string")D={name:D};if(D.normalized)return D;D.normalized=!0;let E=D.value;if(D=a8(D.role,this.options)(this,D),typeof D.disabled==="string"&&!D.hint)D.hint=D.disabled,D.disabled=!0;if(D.disabled===!0&&D.hint==null)D.hint="(disabled)";if(D.index!=null)return D;if(D.name=D.name||D.key||D.title||D.value||D.message,D.message=D.message||D.name||"",D.value=[D.value,D.name].find(this.isValue.bind(this)),D.input="",D.index=u,D.cursor=0,mD.define(D,"parent",F),D.level=F?F.level+1:1,D.indent==null)D.indent=F?F.indent+" ":D.indent||"";if(D.path=F?F.path+"."+D.name:D.name,D.enabled=!!(this.multiple&&!this.isDisabled(D)&&(D.enabled||this.isSelected(D))),!this.isDisabled(D))this.longest=Math.max(this.longest,p8(D.message).length);let _={...D};if(D.reset=(A=_.input,C=_.value)=>{for(let $ of Object.keys(_))D[$]=_[$];D.input=A,D.value=C},E==null&&typeof D.initial==="function")D.input=await D.initial.call(this,this.state,D,u);return D}async onChoice(D,u){if(this.emit("choice",D,u,this),typeof D.onChoice==="function")await D.onChoice.call(this,this.state,D,u)}async addChoice(D,u,F){let E=await this.toChoice(D,u,F);return this.choices.push(E),this.index=this.choices.length-1,this.limit=this.choices.length,E}async newItem(D,u,F){let E={name:"New choice name?",editable:!0,newChoice:!0,...D},B=await this.addChoice(E,u,F);return B.updateChoice=()=>{delete B.newChoice,B.name=B.message=B.input,B.input="",B.cursor=0},this.render()}indent(D){if(D.indent==null)return D.level>1?" ".repeat(D.level-1):"";return D.indent}dispatch(D,u){if(this.multiple&&this[u.name])return this[u.name]();this.alert()}focus(D,u){if(typeof u!=="boolean")u=D.enabled;if(u&&!D.enabled&&this.selected.length>=this.maxSelected)return this.alert();return this.index=D.index,D.enabled=u&&!this.isDisabled(D),D}space(){if(!this.multiple)return this.alert();if(!this.focused)return;return this.toggle(this.focused),this.render()}a(){if(this.maxSelected<this.choices.length)return this.alert();let D=this.selectable.every((u)=>u.enabled);return this.choices.forEach((u)=>u.enabled=!D),this.render()}i(){if(this.choices.length-this.selected.length>this.maxSelected)return this.alert();return this.choices.forEach((D)=>D.enabled=!D.enabled),this.render()}g(){if(!this.choices.some((u)=>!!u.parent))return this.a();let D=this.focused;return this.toggle(D.parent&&!D.choices?D.parent:D),this.render()}toggle(D,u){if(!D.enabled&&this.selected.length>=this.maxSelected)return this.alert();if(typeof u!=="boolean")u=!D.enabled;if(D.enabled=u,D.choices)D.choices.forEach((E)=>this.toggle(E,u));let F=D.parent;while(F){let E=F.choices.filter((B)=>this.isDisabled(B));F.enabled=E.every((B)=>B.enabled===!0),F=F.parent}return gF(this,this.choices),this.emit("toggle",D,this),D}enable(D){if(this.selected.length>=this.maxSelected)return this.alert();return D.enabled=!this.isDisabled(D),D.choices&&D.choices.forEach(this.enable.bind(this)),D}disable(D){return D.enabled=!1,D.choices&&D.choices.forEach(this.disable.bind(this)),D}number(D){this.num+=D;let u=(F)=>{let E=Number(F);if(E>this.choices.length-1)return this.alert();let B=this.focused,_=this.choices.find((A)=>E===A.index);if(!_.enabled&&this.selected.length>=this.maxSelected)return this.alert();if(this.visible.indexOf(_)===-1){let A=vu(this.choices),C=A.indexOf(_);if(B.index>C){let $=A.slice(C,C+this.limit),w=A.filter((S)=>!$.includes(S));this.choices=$.concat(w)}else{let $=C-this.limit+1;this.choices=A.slice($).concat(A.slice(0,$))}}return this.index=this.choices.indexOf(_),this.toggle(this.focused),this.render()};return clearTimeout(this.numberTimeout),new Promise((F)=>{let E=this.choices.length,B=this.num,_=(A=!1,C)=>{if(clearTimeout(this.numberTimeout),A)C=u(B);this.num="",F(C)};if(B==="0"||B.length===1&&Number(B+"0")>E)return _(!0);if(Number(B)>E)return _(!1,this.alert());this.numberTimeout=setTimeout(()=>_(!0),this.delay)})}home(){return this.choices=vu(this.choices),this.index=0,this.render()}end(){let D=this.choices.length-this.limit,u=vu(this.choices);return this.choices=u.slice(D).concat(u.slice(0,D)),this.index=this.limit-1,this.render()}first(){return this.index=0,this.render()}last(){return this.index=this.visible.length-1,this.render()}prev(){if(this.visible.length<=1)return this.alert();return this.up()}next(){if(this.visible.length<=1)return this.alert();return this.down()}right(){if(this.cursor>=this.input.length)return this.alert();return this.cursor++,this.render()}left(){if(this.cursor<=0)return this.alert();return this.cursor--,this.render()}up(){let D=this.choices.length,u=this.visible.length,F=this.index;if(this.options.scroll===!1&&F===0)return this.alert();if(D>u&&F===0)return this.scrollUp();if(this.index=(F-1%D+D)%D,this.isDisabled()&&!this.allChoicesAreDisabled())return this.up();return this.render()}down(){let D=this.choices.length,u=this.visible.length,F=this.index;if(this.options.scroll===!1&&F===u-1)return this.alert();if(D>u&&F===u-1)return this.scrollDown();if(this.index=(F+1)%D,this.isDisabled()&&!this.allChoicesAreDisabled())return this.down();return this.render()}scrollUp(D=0){if(this.choices=c8(this.choices),this.index=D,this.isDisabled())return this.up();return this.render()}scrollDown(D=this.visible.length-1){if(this.choices=o8(this.choices),this.index=D,this.isDisabled())return this.down();return this.render()}async shiftUp(){if(this.options.sort===!0){this.sorting=!0,this.swap(this.index-1),await this.up(),this.sorting=!1;return}return this.scrollUp(this.index)}async shiftDown(){if(this.options.sort===!0){this.sorting=!0,this.swap(this.index+1),await this.down(),this.sorting=!1;return}return this.scrollDown(this.index)}pageUp(){if(this.visible.length<=1)return this.alert();if(this.limit=Math.max(this.limit-1,0),this.index=Math.min(this.limit-1,this.index),this._limit=this.limit,this.isDisabled())return this.up();return this.render()}pageDown(){if(this.visible.length>=this.choices.length)return this.alert();if(this.index=Math.max(0,this.index),this.limit=Math.min(this.limit+1,this.choices.length),this._limit=this.limit,this.isDisabled())return this.down();return this.render()}swap(D){e8(this.choices,this.index,D)}allChoicesAreDisabled(D=this.choices){return D.every((u)=>this.isDisabled(u))}isDisabled(D=this.focused){if(D&&["disabled","collapsed","hidden","completing","readonly"].some((F)=>D[F]===!0))return!0;return D&&D.role==="heading"}isEnabled(D=this.focused){if(Array.isArray(D))return D.every((u)=>this.isEnabled(u));if(D.choices){let u=D.choices.filter((F)=>!this.isDisabled(F));return D.enabled&&u.every((F)=>this.isEnabled(F))}return D.enabled&&!this.isDisabled(D)}isChoice(D,u){return D.name===u||D.index===Number(u)}isSelected(D){if(Array.isArray(this.initial))return this.initial.some((u)=>this.isChoice(D,u));return this.isChoice(D,this.initial)}map(D=[],u="value"){return[].concat(D||[]).reduce((F,E)=>{return F[E]=this.find(E,u),F},{})}filter(D,u){let E=typeof D==="function"?D:(A,C)=>[A.name,C].includes(D),_=(this.options.multiple?this.state._choices:this.choices).filter(E);if(u)return _.map((A)=>A[u]);return _}find(D,u){if(kF(D))return u?D[u]:D;let E=typeof D==="function"?D:(_,A)=>[_.name,A].includes(D),B=this.choices.find(E);if(B)return u?B[u]:B}findIndex(D){return this.choices.indexOf(this.find(D))}async submit(){let D=this.focused;if(!D)return this.alert();if(D.newChoice){if(!D.input)return this.alert();return D.updateChoice(),this.render()}if(this.choices.some((_)=>_.newChoice))return this.alert();let{reorder:u,sort:F}=this.options,E=this.multiple===!0,B=this.selected;if(B===void 0)return this.alert();if(Array.isArray(B)&&u!==!1&&F!==!0)B=mD.reorder(B);return this.value=E?B.map((_)=>_.name):B.name,super.submit()}set choices(D=[]){this.state._choices=this.state._choices||[],this.state.choices=D;for(let u of D)if(!this.state._choices.some((F)=>F.name===u.name))this.state._choices.push(u);if(!this._initial&&this.options.initial){this._initial=!0;let u=this.initial;if(typeof u==="string"||typeof u==="number"){let F=this.find(u);if(F)this.initial=F.index,this.focus(F,!0)}}}get choices(){return gF(this,this.state.choices||[])}set visible(D){this.state.visible=D}get visible(){return(this.state.visible||this.choices).slice(0,this.limit)}set limit(D){this.state.limit=D}get limit(){let{state:D,options:u,choices:F}=this,E=D.limit||this._limit||u.limit||F.length;return Math.min(E,this.height)}set value(D){super.value=D}get value(){if(typeof super.value!=="string"&&super.value===this.initial)return this.input;return super.value}set index(D){this.state.index=D}get index(){return Math.max(0,this.state?this.state.index:0)}get enabled(){return this.filter(this.isEnabled.bind(this))}get focused(){let D=this.choices[this.index];if(D&&this.state.submitted&&this.multiple!==!0)D.enabled=!0;return D}get selectable(){return this.choices.filter((D)=>!this.isDisabled(D))}get selected(){return this.multiple?this.enabled:this.focused}}function gF(D,u){if(u instanceof Promise)return u;if(typeof u==="function"){if(mD.isAsyncFn(u))return u;u=u.call(D,D)}for(let F of u){if(Array.isArray(F.choices)){let E=F.choices.filter((B)=>!D.isDisabled(B));F.enabled=E.every((B)=>B.enabled===!0)}if(D.isDisabled(F)===!0)delete F.enabled}return u}mF.exports=sF});var ED=U((i_,iF)=>{var D6=YD(),fu=O();class dF extends D6{constructor(D){super(D);this.emptyError=this.options.emptyError||"No items were selected"}async dispatch(D,u){if(this.multiple)return this[u.name]?await this[u.name](D,u):await super.dispatch(D,u);this.alert()}separator(){if(this.options.separator)return super.separator();let D=this.styles.muted(this.symbols.ellipsis);return this.state.submitted?super.separator():D}pointer(D,u){return!this.multiple||this.options.pointer?super.pointer(D,u):""}indicator(D,u){return this.multiple?super.indicator(D,u):""}choiceMessage(D,u){let F=this.resolve(D.message,this.state,D,u);if(D.role==="heading"&&!fu.hasColor(F))F=this.styles.strong(F);return this.resolve(F,this.state,D,u)}choiceSeparator(){return":"}async renderChoice(D,u){await this.onChoice(D,u);let F=this.index===u,E=await this.pointer(D,u),B=await this.indicator(D,u)+(D.pad||""),_=await this.resolve(D.hint,this.state,D,u);if(_&&!fu.hasColor(_))_=this.styles.muted(_);let A=this.indent(D),C=await this.choiceMessage(D,u),$=()=>[this.margin[3],A+E+B,C,this.margin[1],_].filter(Boolean).join(" ");if(D.role==="heading")return $();if(D.disabled){if(!fu.hasColor(C))C=this.styles.disabled(C);return $()}if(F)C=this.styles.em(C);return $()}async renderChoices(){if(this.state.loading==="choices")return this.styles.warning("Loading choices");if(this.state.submitted)return"";let D=this.visible.map(async(B,_)=>await this.renderChoice(B,_)),u=await Promise.all(D);if(!u.length)u.push(this.styles.danger("No matching choices"));let F=this.margin[0]+u.join(`
29
+ `+this.styles.danger(u),this.state.submitted=!1,await this.render(),await this.alert(),this.state.validating=!1,this.state.error=void 0;return}this.state.validating=!1,await this.render(),await this.close(),this.value=await this.result(this.value),this.emit("submit",this.value)}async cancel(D){if(this.state.cancelled=this.state.submitted=!0,await this.render(),await this.close(),typeof this.options.onCancel==="function")await this.options.onCancel.call(this,this.name,this.value,this);this.emit("cancel",await this.error(D))}async close(){this.state.closed=!0;try{let D=this.sections(),u=Math.ceil(D.prompt.length/this.width);if(D.rest)this.write(rD.cursor.down(D.rest.length));this.write(`
30
+ `.repeat(u))}catch(D){}this.emit("close")}start(){if(!this.stop&&this.options.show!==!1)this.stop=xu.listen(this,this.keypress.bind(this)),this.once("close",this.stop),this.emit("start",this)}async skip(){if(this.skipped=this.options.skip===!0,typeof this.options.skip==="function")this.skipped=await this.options.skip.call(this,this.name,this.value);return this.skipped}async initialize(){let{format:D,options:u,result:F}=this;if(this.format=()=>D.call(this,this.value),this.result=()=>F.call(this,this.value),typeof u.initial==="function")this.initial=await u.initial.call(this,this);if(typeof u.onRun==="function")await u.onRun.call(this,this);if(typeof u.onSubmit==="function"){let E=u.onSubmit.bind(this),B=this.submit.bind(this);delete this.options.onSubmit,this.submit=async()=>{return await E(this.name,this.value,this),B()}}await this.start(),await this.render()}render(){throw Error("expected prompt to have a custom render method")}run(){return new Promise(async(D,u)=>{if(this.once("submit",D),this.once("cancel",u),await this.skip())return this.render=()=>{},this.submit();await this.initialize(),this.emit("run")})}async element(D,u,F){let{options:E,state:B,symbols:_,timers:A}=this,C=A&&A[D];B.timer=C;let $=E[D]||B[D]||_[D],w=u&&u[D]!=null?u[D]:await $;if(w==="")return w;let r=await this.resolve(w,B,u,F);if(!r&&u&&u[D])return this.resolve($,B,u,F);return r}async prefix(){let D=await this.element("prefix")||this.symbols,u=this.timers&&this.timers.prefix,F=this.state;if(F.timer=u,N.isObject(D))D=D[F.status]||D.pending;if(!N.hasColor(D))return(this.styles[F.status]||this.styles.pending)(D);return D}async message(){let D=await this.element("message");if(!N.hasColor(D))return this.styles.strong(D);return D}async separator(){let D=await this.element("separator")||this.symbols,u=this.timers&&this.timers.separator,F=this.state;F.timer=u;let E=D[F.status]||D.pending||F.separator,B=await this.resolve(E,F);if(N.isObject(B))B=B[F.status]||B.pending;if(!N.hasColor(B))return this.styles.muted(B);return B}async pointer(D,u){let F=await this.element("pointer",D,u);if(typeof F==="string"&&N.hasColor(F))return F;if(F){let E=this.styles,B=this.index===u,_=B?E.primary:($)=>$,A=await this.resolve(F[B?"on":"off"]||F,this.state),C=!N.hasColor(A)?_(A):A;return B?C:" ".repeat(A.length)}}async indicator(D,u){let F=await this.element("indicator",D,u);if(typeof F==="string"&&N.hasColor(F))return F;if(F){let E=this.styles,B=D.enabled===!0,_=B?E.success:E.dark,A=F[B?"on":"off"]||F;return!N.hasColor(A)?_(A):A}return""}body(){return null}footer(){if(this.state.status==="pending")return this.element("footer")}header(){if(this.state.status==="pending")return this.element("header")}async hint(){if(this.state.status==="pending"&&!this.isValue(this.state.input)){let D=await this.element("hint");if(!N.hasColor(D))return this.styles.muted(D);return D}}error(D){return!this.state.submitted?D||this.state.error:""}format(D){return D}result(D){return D}validate(D){if(this.options.required===!0)return this.isValue(D);return!0}isValue(D){return D!=null&&D!==""}resolve(D,...u){return N.resolve(this,D,...u)}get base(){return fu.prototype}get style(){return this.styles[this.state.status]}get height(){return this.options.rows||N.height(this.stdout,25)}get width(){return this.options.columns||N.width(this.stdout,80)}get size(){return{width:this.width,height:this.height}}set cursor(D){this.state.cursor=D}get cursor(){return this.state.cursor}set input(D){this.state.input=D}get input(){return this.state.input}set value(D){this.state.value=D}get value(){let{input:D,value:u}=this.state,F=[u,D].find(this.isValue.bind(this));return this.isValue(F)?F:this.initial}static get prompt(){return(D)=>new this(D).run()}}function n8(D){let u=(B)=>{return D[B]===void 0||typeof D[B]==="function"},F=["actions","choices","initial","margin","roles","styles","symbols","theme","timers","value"],E=["body","footer","error","header","hint","indicator","message","prefix","separator","skip"];for(let B of Object.keys(D.options)){if(F.includes(B))continue;if(/^on[A-Z]/.test(B))continue;let _=D.options[B];if(typeof _==="function"&&u(B)){if(!E.includes(B))D[B]=_.bind(D)}else if(typeof D[B]!=="function")D[B]=_}}function p8(D){if(typeof D==="number")D=[D,D,D,D];let u=[].concat(D||[]),F=(B)=>B%2===0?`
31
+ `:" ",E=[];for(let B=0;B<4;B++){let _=F(B);if(u[B])E.push(_.repeat(u[B]));else E.push("")}return E}xF.exports=fu});var kF=U((i_,vF)=>{var l8=O(),fF={default(D,u){return u},checkbox(D,u){throw Error("checkbox role is not implemented yet")},editable(D,u){throw Error("editable role is not implemented yet")},expandable(D,u){throw Error("expandable role is not implemented yet")},heading(D,u){return u.disabled="",u.indicator=[u.indicator," "].find((F)=>F!=null),u.message=u.message||"",u},input(D,u){throw Error("input role is not implemented yet")},option(D,u){return fF.default(D,u)},radio(D,u){throw Error("radio role is not implemented yet")},separator(D,u){return u.disabled="",u.indicator=[u.indicator," "].find((F)=>F!=null),u.message=u.message||D.symbols.line.repeat(5),u},spacer(D,u){return u}};vF.exports=(D,u={})=>{let F=l8.merge({},fF,u.roles);return F[D]||F.default}});var JD=U((n_,mF)=>{var a8=uD(),c8=TD(),o8=kF(),mD=O(),{reorder:vu,scrollUp:e8,scrollDown:D6,isObject:sF,swap:u6}=mD;class dF extends c8{constructor(D){super(D);this.cursorHide(),this.maxSelected=D.maxSelected||1/0,this.multiple=D.multiple||!1,this.initial=D.initial||0,this.delay=D.delay||0,this.longest=0,this.num=""}async initialize(){if(typeof this.options.initial==="function")this.initial=await this.options.initial.call(this);await this.reset(!0),await super.initialize()}async reset(){let{choices:D,initial:u,autofocus:F,suggest:E}=this.options;if(this.state._choices=[],this.state.choices=[],this.choices=await Promise.all(await this.toChoices(D)),this.choices.forEach((B)=>B.enabled=!1),typeof E!=="function"&&this.selectable.length===0)throw Error("At least one choice must be selectable");if(sF(u))u=Object.keys(u);if(Array.isArray(u)){if(F!=null)this.index=this.findIndex(F);u.forEach((B)=>this.enable(this.find(B))),await this.render()}else{if(F!=null)u=F;if(typeof u==="string")u=this.findIndex(u);if(typeof u==="number"&&u>-1)this.index=Math.max(0,Math.min(u,this.choices.length)),this.enable(this.find(this.index))}if(this.isDisabled(this.focused))await this.down()}async toChoices(D,u){this.state.loadingChoices=!0;let F=[],E=0,B=async(_,A)=>{if(typeof _==="function")_=await _.call(this);if(_ instanceof Promise)_=await _;for(let C=0;C<_.length;C++){let $=_[C]=await this.toChoice(_[C],E++,A);if(F.push($),$.choices)await B($.choices,$)}return F};return B(D,u).then((_)=>{return this.state.loadingChoices=!1,_})}async toChoice(D,u,F){if(typeof D==="function")D=await D.call(this,this);if(D instanceof Promise)D=await D;if(typeof D==="string")D={name:D};if(D.normalized)return D;D.normalized=!0;let E=D.value;if(D=o8(D.role,this.options)(this,D),typeof D.disabled==="string"&&!D.hint)D.hint=D.disabled,D.disabled=!0;if(D.disabled===!0&&D.hint==null)D.hint="(disabled)";if(D.index!=null)return D;if(D.name=D.name||D.key||D.title||D.value||D.message,D.message=D.message||D.name||"",D.value=[D.value,D.name].find(this.isValue.bind(this)),D.input="",D.index=u,D.cursor=0,mD.define(D,"parent",F),D.level=F?F.level+1:1,D.indent==null)D.indent=F?F.indent+" ":D.indent||"";if(D.path=F?F.path+"."+D.name:D.name,D.enabled=!!(this.multiple&&!this.isDisabled(D)&&(D.enabled||this.isSelected(D))),!this.isDisabled(D))this.longest=Math.max(this.longest,a8(D.message).length);let _={...D};if(D.reset=(A=_.input,C=_.value)=>{for(let $ of Object.keys(_))D[$]=_[$];D.input=A,D.value=C},E==null&&typeof D.initial==="function")D.input=await D.initial.call(this,this.state,D,u);return D}async onChoice(D,u){if(this.emit("choice",D,u,this),typeof D.onChoice==="function")await D.onChoice.call(this,this.state,D,u)}async addChoice(D,u,F){let E=await this.toChoice(D,u,F);return this.choices.push(E),this.index=this.choices.length-1,this.limit=this.choices.length,E}async newItem(D,u,F){let E={name:"New choice name?",editable:!0,newChoice:!0,...D},B=await this.addChoice(E,u,F);return B.updateChoice=()=>{delete B.newChoice,B.name=B.message=B.input,B.input="",B.cursor=0},this.render()}indent(D){if(D.indent==null)return D.level>1?" ".repeat(D.level-1):"";return D.indent}dispatch(D,u){if(this.multiple&&this[u.name])return this[u.name]();this.alert()}focus(D,u){if(typeof u!=="boolean")u=D.enabled;if(u&&!D.enabled&&this.selected.length>=this.maxSelected)return this.alert();return this.index=D.index,D.enabled=u&&!this.isDisabled(D),D}space(){if(!this.multiple)return this.alert();if(!this.focused)return;return this.toggle(this.focused),this.render()}a(){if(this.maxSelected<this.choices.length)return this.alert();let D=this.selectable.every((u)=>u.enabled);return this.choices.forEach((u)=>u.enabled=!D),this.render()}i(){if(this.choices.length-this.selected.length>this.maxSelected)return this.alert();return this.choices.forEach((D)=>D.enabled=!D.enabled),this.render()}g(){if(!this.choices.some((u)=>!!u.parent))return this.a();let D=this.focused;return this.toggle(D.parent&&!D.choices?D.parent:D),this.render()}toggle(D,u){if(!D.enabled&&this.selected.length>=this.maxSelected)return this.alert();if(typeof u!=="boolean")u=!D.enabled;if(D.enabled=u,D.choices)D.choices.forEach((E)=>this.toggle(E,u));let F=D.parent;while(F){let E=F.choices.filter((B)=>this.isDisabled(B));F.enabled=E.every((B)=>B.enabled===!0),F=F.parent}return gF(this,this.choices),this.emit("toggle",D,this),D}enable(D){if(this.selected.length>=this.maxSelected)return this.alert();return D.enabled=!this.isDisabled(D),D.choices&&D.choices.forEach(this.enable.bind(this)),D}disable(D){return D.enabled=!1,D.choices&&D.choices.forEach(this.disable.bind(this)),D}number(D){this.num+=D;let u=(F)=>{let E=Number(F);if(E>this.choices.length-1)return this.alert();let B=this.focused,_=this.choices.find((A)=>E===A.index);if(!_.enabled&&this.selected.length>=this.maxSelected)return this.alert();if(this.visible.indexOf(_)===-1){let A=vu(this.choices),C=A.indexOf(_);if(B.index>C){let $=A.slice(C,C+this.limit),w=A.filter((r)=>!$.includes(r));this.choices=$.concat(w)}else{let $=C-this.limit+1;this.choices=A.slice($).concat(A.slice(0,$))}}return this.index=this.choices.indexOf(_),this.toggle(this.focused),this.render()};return clearTimeout(this.numberTimeout),new Promise((F)=>{let E=this.choices.length,B=this.num,_=(A=!1,C)=>{if(clearTimeout(this.numberTimeout),A)C=u(B);this.num="",F(C)};if(B==="0"||B.length===1&&Number(B+"0")>E)return _(!0);if(Number(B)>E)return _(!1,this.alert());this.numberTimeout=setTimeout(()=>_(!0),this.delay)})}home(){return this.choices=vu(this.choices),this.index=0,this.render()}end(){let D=this.choices.length-this.limit,u=vu(this.choices);return this.choices=u.slice(D).concat(u.slice(0,D)),this.index=this.limit-1,this.render()}first(){return this.index=0,this.render()}last(){return this.index=this.visible.length-1,this.render()}prev(){if(this.visible.length<=1)return this.alert();return this.up()}next(){if(this.visible.length<=1)return this.alert();return this.down()}right(){if(this.cursor>=this.input.length)return this.alert();return this.cursor++,this.render()}left(){if(this.cursor<=0)return this.alert();return this.cursor--,this.render()}up(){let D=this.choices.length,u=this.visible.length,F=this.index;if(this.options.scroll===!1&&F===0)return this.alert();if(D>u&&F===0)return this.scrollUp();if(this.index=(F-1%D+D)%D,this.isDisabled()&&!this.allChoicesAreDisabled())return this.up();return this.render()}down(){let D=this.choices.length,u=this.visible.length,F=this.index;if(this.options.scroll===!1&&F===u-1)return this.alert();if(D>u&&F===u-1)return this.scrollDown();if(this.index=(F+1)%D,this.isDisabled()&&!this.allChoicesAreDisabled())return this.down();return this.render()}scrollUp(D=0){if(this.choices=e8(this.choices),this.index=D,this.isDisabled())return this.up();return this.render()}scrollDown(D=this.visible.length-1){if(this.choices=D6(this.choices),this.index=D,this.isDisabled())return this.down();return this.render()}async shiftUp(){if(this.options.sort===!0){this.sorting=!0,this.swap(this.index-1),await this.up(),this.sorting=!1;return}return this.scrollUp(this.index)}async shiftDown(){if(this.options.sort===!0){this.sorting=!0,this.swap(this.index+1),await this.down(),this.sorting=!1;return}return this.scrollDown(this.index)}pageUp(){if(this.visible.length<=1)return this.alert();if(this.limit=Math.max(this.limit-1,0),this.index=Math.min(this.limit-1,this.index),this._limit=this.limit,this.isDisabled())return this.up();return this.render()}pageDown(){if(this.visible.length>=this.choices.length)return this.alert();if(this.index=Math.max(0,this.index),this.limit=Math.min(this.limit+1,this.choices.length),this._limit=this.limit,this.isDisabled())return this.down();return this.render()}swap(D){u6(this.choices,this.index,D)}allChoicesAreDisabled(D=this.choices){return D.every((u)=>this.isDisabled(u))}isDisabled(D=this.focused){if(D&&["disabled","collapsed","hidden","completing","readonly"].some((F)=>D[F]===!0))return!0;return D&&D.role==="heading"}isEnabled(D=this.focused){if(Array.isArray(D))return D.every((u)=>this.isEnabled(u));if(D.choices){let u=D.choices.filter((F)=>!this.isDisabled(F));return D.enabled&&u.every((F)=>this.isEnabled(F))}return D.enabled&&!this.isDisabled(D)}isChoice(D,u){return D.name===u||D.index===Number(u)}isSelected(D){if(Array.isArray(this.initial))return this.initial.some((u)=>this.isChoice(D,u));return this.isChoice(D,this.initial)}map(D=[],u="value"){return[].concat(D||[]).reduce((F,E)=>{return F[E]=this.find(E,u),F},{})}filter(D,u){let E=typeof D==="function"?D:(A,C)=>[A.name,C].includes(D),_=(this.options.multiple?this.state._choices:this.choices).filter(E);if(u)return _.map((A)=>A[u]);return _}find(D,u){if(sF(D))return u?D[u]:D;let E=typeof D==="function"?D:(_,A)=>[_.name,A].includes(D),B=this.choices.find(E);if(B)return u?B[u]:B}findIndex(D){return this.choices.indexOf(this.find(D))}async submit(){let D=this.focused;if(!D)return this.alert();if(D.newChoice){if(!D.input)return this.alert();return D.updateChoice(),this.render()}if(this.choices.some((_)=>_.newChoice))return this.alert();let{reorder:u,sort:F}=this.options,E=this.multiple===!0,B=this.selected;if(B===void 0)return this.alert();if(Array.isArray(B)&&u!==!1&&F!==!0)B=mD.reorder(B);return this.value=E?B.map((_)=>_.name):B.name,super.submit()}set choices(D=[]){this.state._choices=this.state._choices||[],this.state.choices=D;for(let u of D)if(!this.state._choices.some((F)=>F.name===u.name))this.state._choices.push(u);if(!this._initial&&this.options.initial){this._initial=!0;let u=this.initial;if(typeof u==="string"||typeof u==="number"){let F=this.find(u);if(F)this.initial=F.index,this.focus(F,!0)}}}get choices(){return gF(this,this.state.choices||[])}set visible(D){this.state.visible=D}get visible(){return(this.state.visible||this.choices).slice(0,this.limit)}set limit(D){this.state.limit=D}get limit(){let{state:D,options:u,choices:F}=this,E=D.limit||this._limit||u.limit||F.length;return Math.min(E,this.height)}set value(D){super.value=D}get value(){if(typeof super.value!=="string"&&super.value===this.initial)return this.input;return super.value}set index(D){this.state.index=D}get index(){return Math.max(0,this.state?this.state.index:0)}get enabled(){return this.filter(this.isEnabled.bind(this))}get focused(){let D=this.choices[this.index];if(D&&this.state.submitted&&this.multiple!==!0)D.enabled=!0;return D}get selectable(){return this.choices.filter((D)=>!this.isDisabled(D))}get selected(){return this.multiple?this.enabled:this.focused}}function gF(D,u){if(u instanceof Promise)return u;if(typeof u==="function"){if(mD.isAsyncFn(u))return u;u=u.call(D,D)}for(let F of u){if(Array.isArray(F.choices)){let E=F.choices.filter((B)=>!D.isDisabled(B));F.enabled=E.every((B)=>B.enabled===!0)}if(D.isDisabled(F)===!0)delete F.enabled}return u}mF.exports=dF});var ED=U((p_,nF)=>{var F6=JD(),ku=O();class iF extends F6{constructor(D){super(D);this.emptyError=this.options.emptyError||"No items were selected"}async dispatch(D,u){if(this.multiple)return this[u.name]?await this[u.name](D,u):await super.dispatch(D,u);this.alert()}separator(){if(this.options.separator)return super.separator();let D=this.styles.muted(this.symbols.ellipsis);return this.state.submitted?super.separator():D}pointer(D,u){return!this.multiple||this.options.pointer?super.pointer(D,u):""}indicator(D,u){return this.multiple?super.indicator(D,u):""}choiceMessage(D,u){let F=this.resolve(D.message,this.state,D,u);if(D.role==="heading"&&!ku.hasColor(F))F=this.styles.strong(F);return this.resolve(F,this.state,D,u)}choiceSeparator(){return":"}async renderChoice(D,u){await this.onChoice(D,u);let F=this.index===u,E=await this.pointer(D,u),B=await this.indicator(D,u)+(D.pad||""),_=await this.resolve(D.hint,this.state,D,u);if(_&&!ku.hasColor(_))_=this.styles.muted(_);let A=this.indent(D),C=await this.choiceMessage(D,u),$=()=>[this.margin[3],A+E+B,C,this.margin[1],_].filter(Boolean).join(" ");if(D.role==="heading")return $();if(D.disabled){if(!ku.hasColor(C))C=this.styles.disabled(C);return $()}if(F)C=this.styles.em(C);return $()}async renderChoices(){if(this.state.loading==="choices")return this.styles.warning("Loading choices");if(this.state.submitted)return"";let D=this.visible.map(async(B,_)=>await this.renderChoice(B,_)),u=await Promise.all(D);if(!u.length)u.push(this.styles.danger("No matching choices"));let F=this.margin[0]+u.join(`
32
32
  `),E;if(this.options.choicesHeader)E=await this.resolve(this.options.choicesHeader,this.state);return[E,F].filter(Boolean).join(`
33
- `)}format(){if(!this.state.submitted||this.state.cancelled)return"";if(Array.isArray(this.selected))return this.selected.map((D)=>this.styles.primary(D.name)).join(", ");return this.styles.primary(this.selected.name)}async render(){let{submitted:D,size:u}=this.state,F="",E=await this.header(),B=await this.prefix(),_=await this.separator(),A=await this.message();if(this.options.promptLine!==!1)F=[B,A,_,""].join(" "),this.state.prompt=F;let C=await this.format(),$=await this.error()||await this.hint(),w=await this.renderChoices(),S=await this.footer();if(C)F+=C;if($&&!F.includes($))F+=" "+$;if(D&&!C&&!w.trim()&&this.multiple&&this.emptyError!=null)F+=this.styles.danger(this.emptyError);this.clear(u),this.write([E,F,w,S].filter(Boolean).join(`
34
- `)),this.write(this.margin[2]),this.restore()}}iF.exports=dF});var lF=U((n_,pF)=>{var u6=ED(),F6=(D,u)=>{let F=D?new RegExp(D,"ig"):/$^/;return(E)=>{return D?E.replace(F,(B)=>u(B)):E}};class nF extends u6{constructor(D){super(D);this.cursorShow()}moveCursor(D){this.state.cursor+=D}dispatch(D){return this.append(D)}space(D){return this.options.multiple?super.space(D):this.append(D)}append(D){let{cursor:u,input:F}=this.state;return this.input=F.slice(0,u)+D+F.slice(u),this.moveCursor(1),this.complete()}delete(){let{cursor:D,input:u}=this.state;if(!u)return this.alert();return this.input=u.slice(0,D-1)+u.slice(D),this.moveCursor(-1),this.complete()}deleteForward(){let{cursor:D,input:u}=this.state;if(u[D]===void 0)return this.alert();return this.input=`${u}`.slice(0,D)+`${u}`.slice(D+1),this.complete()}number(D){return this.append(D)}async complete(){this.completing=!0,this.choices=await this.suggest(this.input,this.state._choices),this.state.limit=void 0,this.index=Math.min(Math.max(this.visible.length-1,0),this.index),await this.render(),this.completing=!1}suggest(D=this.input,u=this.state._choices){if(typeof this.options.suggest==="function")return this.options.suggest.call(this,D,u);let F=D.toLowerCase();return u.filter((E)=>E.message.toLowerCase().includes(F))}pointer(){return""}format(){if(!this.focused)return this.input;if(this.options.multiple&&this.state.submitted)return this.selected.map((D)=>this.styles.primary(D.message)).join(", ");if(this.state.submitted){let D=this.value=this.input=this.focused.value;return this.styles.primary(D)}return this.input}async render(){if(this.state.status!=="pending")return super.render();let D=this.options.highlight||this.styles.complement,u=(B,_)=>{if(!B)return B;if(D.stack)return D(B);return D.call(this,B)},F=F6(this.input,u),E=this.choices;this.choices=E.map((B)=>({...B,message:F(B.message)})),await super.render(),this.choices=E}submit(){if(this.options.multiple)this.value=this.selected.map((D)=>D.name);return super.submit()}}pF.exports=nF});var gu=U((p_,aF)=>{var ku=O();aF.exports=(D,u={})=>{D.cursorHide();let{input:F="",initial:E="",pos:B,showCursor:_=!0,color:A}=u,C=A||D.styles.placeholder,$=ku.inverse(D.styles.primary),w=(R)=>$(D.styles.black(R)),S=F,q=" ",M=w(q);if(D.blink&&D.blink.off===!0)w=(R)=>R,M="";if(_&&B===0&&E===""&&F==="")return w(q);if(_&&B===0&&(F===E||F===""))return w(E[0])+C(E.slice(1));E=ku.isPrimitive(E)?`${E}`:"",F=ku.isPrimitive(F)?`${F}`:"";let z=E&&E.startsWith(F)&&E!==F,L=z?w(E[F.length]):M;if(B!==F.length&&_===!0)S=F.slice(0,B)+w(F[B])+F.slice(B+1),L="";if(_===!1)L="";if(z){let R=D.styles.unstyle(S+L);return S+L+C(E.slice(R.length))}return S+L}});var dD=U((l_,oF)=>{var E6=uD(),B6=ED(),_6=gu();class cF extends B6{constructor(D){super({...D,multiple:!0});this.type="form",this.initial=this.options.initial,this.align=[this.options.align,"right"].find((u)=>u!=null),this.emptyError="",this.values={}}async reset(D){if(await super.reset(),D===!0)this._index=this.index;return this.index=this._index,this.values={},this.choices.forEach((u)=>u.reset&&u.reset()),this.render()}dispatch(D){return!!D&&this.append(D)}append(D){let u=this.focused;if(!u)return this.alert();let{cursor:F,input:E}=u;return u.value=u.input=E.slice(0,F)+D+E.slice(F),u.cursor++,this.render()}delete(){let D=this.focused;if(!D||D.cursor<=0)return this.alert();let{cursor:u,input:F}=D;return D.value=D.input=F.slice(0,u-1)+F.slice(u),D.cursor--,this.render()}deleteForward(){let D=this.focused;if(!D)return this.alert();let{cursor:u,input:F}=D;if(F[u]===void 0)return this.alert();let E=`${F}`.slice(0,u)+`${F}`.slice(u+1);return D.value=D.input=E,this.render()}right(){let D=this.focused;if(!D)return this.alert();if(D.cursor>=D.input.length)return this.alert();return D.cursor++,this.render()}left(){let D=this.focused;if(!D)return this.alert();if(D.cursor<=0)return this.alert();return D.cursor--,this.render()}space(D,u){return this.dispatch(D,u)}number(D,u){return this.dispatch(D,u)}next(){let D=this.focused;if(!D)return this.alert();let{initial:u,input:F}=D;if(u&&u.startsWith(F)&&F!==u)return D.value=D.input=u,D.cursor=D.value.length,this.render();return super.next()}prev(){let D=this.focused;if(!D)return this.alert();if(D.cursor===0)return super.prev();return D.value=D.input="",D.cursor=0,this.render()}separator(){return""}format(D){return!this.state.submitted?super.format(D):""}pointer(){return""}indicator(D){return D.input?"⦿":"⊙"}async choiceSeparator(D,u){let F=await this.resolve(D.separator,this.state,D,u)||":";return F?" "+this.styles.disabled(F):""}async renderChoice(D,u){await this.onChoice(D,u);let{state:F,styles:E}=this,{cursor:B,initial:_="",name:A,input:C=""}=D,{muted:$,submitted:w,primary:S,danger:q}=E,M=this.index===u,z=D.validate||(()=>!0),L=await this.choiceSeparator(D,u),R=D.message;if(this.align==="right")R=R.padStart(this.longest+1," ");if(this.align==="left")R=R.padEnd(this.longest+1," ");let I=this.values[A]=C||_,h=C?"success":"dark";if(await z.call(D,I,this.state)!==!0)h="danger";let H=E[h],T=H(await this.indicator(D,u))+(D.pad||""),W=this.indent(D),J=()=>[W,T,R+L,C].filter(Boolean).join(" ");if(F.submitted)return R=E6(R),C=w(C),J();if(D.format)C=await D.format.call(this,C,D,u);else{let G=this.styles.muted;C=_6(this,{input:C,initial:_,pos:B,showCursor:M,color:G})}if(!this.isValue(C))C=this.styles.muted(this.symbols.ellipsis);if(D.result)this.values[A]=await D.result.call(this,I,D,u);if(M)R=S(R);if(D.error)C+=(C?" ":"")+q(D.error.trim());else if(D.hint)C+=(C?" ":"")+$(D.hint.trim());return J()}async submit(){return this.value=this.values,super.base.submit.call(this)}}oF.exports=cF});var su=U((a_,D2)=>{var C6=dD(),A6=()=>{throw Error("expected prompt to have a custom authenticate method")},eF=(D=A6)=>{class u extends C6{constructor(F){super(F)}async submit(){this.value=await D.call(this,this.values,this.state),super.base.submit.call(this)}static create(F){return eF(F)}}return u};D2.exports=eF()});var E2=U((c_,F2)=>{var $6=su();function w6(D,u){if(D.username===this.options.username&&D.password===this.options.password)return!0;return!1}var u2=(D=w6)=>{let u=[{name:"username",message:"username"},{name:"password",message:"password",format(E){if(this.options.showPassword)return E;return(this.state.submitted?this.styles.primary:this.styles.muted)(this.symbols.asterisk.repeat(E.length))}}];class F extends $6.create(D){constructor(E){super({...E,choices:u})}static create(E){return u2(E)}}return F};F2.exports=u2()});var iD=U((o_,_2)=>{var S6=hD(),{isPrimitive:q6,hasColor:z6}=O();class B2 extends S6{constructor(D){super(D);this.cursorHide()}async initialize(){let D=await this.resolve(this.initial,this.state);this.input=await this.cast(D),await super.initialize()}dispatch(D){if(!this.isValue(D))return this.alert();return this.input=D,this.submit()}format(D){let{styles:u,state:F}=this;return!F.submitted?u.primary(D):u.success(D)}cast(D){return this.isTrue(D)}isTrue(D){return/^[ty1]/i.test(D)}isFalse(D){return/^[fn0]/i.test(D)}isValue(D){return q6(D)&&(this.isTrue(D)||this.isFalse(D))}async hint(){if(this.state.status==="pending"){let D=await this.element("hint");if(!z6(D))return this.styles.muted(D);return D}}async render(){let{input:D,size:u}=this.state,F=await this.prefix(),E=await this.separator(),B=await this.message(),_=this.styles.muted(this.default),A=[F,B,_,E].filter(Boolean).join(" ");this.state.prompt=A;let C=await this.header(),$=this.value=this.cast(D),w=await this.format($),S=await this.error()||await this.hint(),q=await this.footer();if(S&&!A.includes(S))w+=" "+S;A+=" "+w,this.clear(u),this.write([C,A,q].filter(Boolean).join(`
35
- `)),this.restore()}set value(D){super.value=D}get value(){return this.cast(super.value)}}_2.exports=B2});var $2=U((e_,A2)=>{var r6=iD();class C2 extends r6{constructor(D){super(D);this.default=this.options.default||(this.initial?"(Y/n)":"(y/N)")}}A2.exports=C2});var q2=U((DC,S2)=>{var L6=ED(),M6=dD(),RD=M6.prototype;class w2 extends L6{constructor(D){super({...D,multiple:!0});this.align=[this.options.align,"left"].find((u)=>u!=null),this.emptyError="",this.values={}}dispatch(D,u){let F=this.focused,E=F.parent||{};if(!F.editable&&!E.editable){if(D==="a"||D==="i")return super[D]()}return RD.dispatch.call(this,D,u)}append(D,u){return RD.append.call(this,D,u)}delete(D,u){return RD.delete.call(this,D,u)}space(D){return this.focused.editable?this.append(D):super.space()}number(D){return this.focused.editable?this.append(D):super.number(D)}next(){return this.focused.editable?RD.next.call(this):super.next()}prev(){return this.focused.editable?RD.prev.call(this):super.prev()}async indicator(D,u){let F=D.indicator||"",E=D.editable?F:super.indicator(D,u);return await this.resolve(E,this.state,D,u)||""}indent(D){return D.role==="heading"?"":D.editable?" ":" "}async renderChoice(D,u){if(D.indent="",D.editable)return RD.renderChoice.call(this,D,u);return super.renderChoice(D,u)}error(){return""}footer(){return this.state.error}async validate(){let D=!0;for(let u of this.choices){if(typeof u.validate!=="function")continue;if(u.role==="heading")continue;let F=u.parent?this.value[u.parent.name]:this.value;if(u.editable)F=u.value===u.name?u.initial||"":u.value;else if(!this.isDisabled(u))F=u.enabled===!0;if(D=await u.validate(F,this.state),D!==!0)break}if(D!==!0)this.state.error=typeof D==="string"?D:"Invalid Input";return D}submit(){if(this.focused.newChoice===!0)return super.submit();if(this.choices.some((D)=>D.newChoice))return this.alert();this.value={};for(let D of this.choices){let u=D.parent?this.value[D.parent.name]:this.value;if(D.role==="heading"){this.value[D.name]={};continue}if(D.editable)u[D.name]=D.value===D.name?D.initial||"":D.value;else if(!this.isDisabled(D))u[D.name]=D.enabled===!0}return this.base.submit.call(this)}}S2.exports=w2});var qD=U((uC,r2)=>{var h6=hD(),R6=ju(),U6=gu(),{isPrimitive:T6}=O();class z2 extends h6{constructor(D){super(D);if(this.initial=T6(this.initial)?String(this.initial):"",this.initial)this.cursorHide();this.state.prevCursor=0,this.state.clipboard=[],this.keypressTimeout=this.options.keypressTimeout!==void 0?this.options.keypressTimeout:null}async keypress(D,u=D?R6(D,{}):{}){let F=Date.now(),E=F-this.lastKeypress;this.lastKeypress=F;let B=u.name==="return"||u.name==="enter",_=this.state.prevKeypress,A;if(this.state.prevKeypress=u,this.keypressTimeout!=null&&B){if(E<this.keypressTimeout)return this.submit();this.state.multilineBuffer=this.state.multilineBuffer||"",this.state.multilineBuffer+=D,A=!0,_=null}if(A||this.options.multiline&&B){if(!_||_.name!=="return")return this.append(`
36
- `,u)}return super.keypress(D,u)}moveCursor(D){this.cursor+=D}reset(){return this.input=this.value="",this.cursor=0,this.render()}dispatch(D,u){if(!D||u.ctrl||u.code)return this.alert();this.append(D)}append(D){let{cursor:u,input:F}=this.state;this.input=`${F}`.slice(0,u)+D+`${F}`.slice(u),this.moveCursor(String(D).length),this.render()}insert(D){this.append(D)}delete(){let{cursor:D,input:u}=this.state;if(D<=0)return this.alert();this.input=`${u}`.slice(0,D-1)+`${u}`.slice(D),this.moveCursor(-1),this.render()}deleteForward(){let{cursor:D,input:u}=this.state;if(u[D]===void 0)return this.alert();this.input=`${u}`.slice(0,D)+`${u}`.slice(D+1),this.render()}cutForward(){let D=this.cursor;if(this.input.length<=D)return this.alert();this.state.clipboard.push(this.input.slice(D)),this.input=this.input.slice(0,D),this.render()}cutLeft(){let D=this.cursor;if(D===0)return this.alert();let u=this.input.slice(0,D),F=this.input.slice(D),E=u.split(" ");this.state.clipboard.push(E.pop()),this.input=E.join(" "),this.cursor=this.input.length,this.input+=F,this.render()}paste(){if(!this.state.clipboard.length)return this.alert();this.insert(this.state.clipboard.pop()),this.render()}toggleCursor(){if(this.state.prevCursor)this.cursor=this.state.prevCursor,this.state.prevCursor=0;else this.state.prevCursor=this.cursor,this.cursor=0;this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.input.length-1,this.render()}next(){let D=this.initial!=null?String(this.initial):"";if(!D||!D.startsWith(this.input))return this.alert();this.input=this.initial,this.cursor=this.initial.length,this.render()}prev(){if(!this.input)return this.alert();this.reset()}backward(){return this.left()}forward(){return this.right()}right(){if(this.cursor>=this.input.length)return this.alert();return this.moveCursor(1),this.render()}left(){if(this.cursor<=0)return this.alert();return this.moveCursor(-1),this.render()}isValue(D){return!!D}async format(D=this.value){let u=await this.resolve(this.initial,this.state);if(!this.state.submitted)return U6(this,{input:D,initial:u,pos:this.cursor});return this.styles.submitted(D||u)}async render(){let D=this.state.size,u=await this.prefix(),F=await this.separator(),E=await this.message(),B=[u,E,F].filter(Boolean).join(" ");this.state.prompt=B;let _=await this.header(),A=await this.format(),C=await this.error()||await this.hint(),$=await this.footer();if(C&&!A.includes(C))A+=" "+C;B+=" "+A,this.clear(D),this.write([_,B,$].filter(Boolean).join(`
37
- `)),this.restore()}}r2.exports=z2});var M2=U((FC,L2)=>{var I6=(D)=>D.filter((u,F)=>D.lastIndexOf(u)===F),nD=(D)=>I6(D).filter(Boolean);L2.exports=(D,u={},F="")=>{let{past:E=[],present:B=""}=u,_,A;switch(D){case"prev":case"undo":return _=E.slice(0,E.length-1),A=E[E.length-1]||"",{past:nD([F,..._]),present:A};case"next":case"redo":return _=E.slice(1),A=E[0]||"",{past:nD([..._,F]),present:A};case"save":return{past:nD([...E,F]),present:""};case"remove":if(A=nD(E.filter((C)=>C!==F)),B="",A.length)B=A.pop();return{past:A,present:B};default:throw Error(`Invalid action: "${D}"`)}}});var mu=U((EC,U2)=>{var H6=qD(),h2=M2();class R2 extends H6{constructor(D){super(D);let u=this.options.history;if(u&&u.store){let F=u.values||this.initial;this.autosave=!!u.autosave,this.store=u.store,this.data=this.store.get("values")||{past:[],present:F},this.initial=this.data.present||this.data.past[this.data.past.length-1]}}completion(D){if(!this.store)return this.alert();if(this.data=h2(D,this.data,this.input),!this.data.present)return this.alert();return this.input=this.data.present,this.cursor=this.input.length,this.render()}altUp(){return this.completion("prev")}altDown(){return this.completion("next")}prev(){return this.save(),super.prev()}save(){if(!this.store)return;this.data=h2("save",this.data,this.input),this.store.set("values",this.data)}submit(){if(this.store&&this.autosave===!0)this.save();return super.submit()}}U2.exports=R2});var H2=U((BC,I2)=>{var W6=qD();class T2 extends W6{format(){return""}}I2.exports=T2});var G2=U((_C,Z2)=>{var Z6=qD();class W2 extends Z6{constructor(D={}){super(D);this.sep=this.options.separator||/, */,this.initial=D.initial||""}split(D=this.value){return D?String(D).split(this.sep):[]}format(){let D=this.state.submitted?this.styles.primary:(u)=>u;return this.list.map(D).join(", ")}async submit(D){let u=this.state.error||await this.validate(this.list,this.state);if(u!==!0)return this.state.error=u,super.submit();return this.value=this.list,super.submit()}get list(){return this.split()}}Z2.exports=W2});var Y2=U((CC,X2)=>{var G6=ED();class Q2 extends G6{constructor(D){super({...D,multiple:!0})}}X2.exports=Q2});var du=U((AC,j2)=>{var Q6=qD();class J2 extends Q6{constructor(D={}){super({style:"number",...D});this.min=this.isValue(D.min)?this.toNumber(D.min):-1/0,this.max=this.isValue(D.max)?this.toNumber(D.max):1/0,this.delay=D.delay!=null?D.delay:1000,this.float=D.float!==!1,this.round=D.round===!0||D.float===!1,this.major=D.major||10,this.minor=D.minor||1,this.initial=D.initial!=null?D.initial:"",this.input=String(this.initial),this.cursor=this.input.length,this.cursorShow()}append(D){if(!/[-+.]/.test(D)||D==="."&&this.input.includes("."))return this.alert("invalid number");return super.append(D)}number(D){return super.append(D)}next(){if(this.input&&this.input!==this.initial)return this.alert();if(!this.isValue(this.initial))return this.alert();return this.input=this.initial,this.cursor=String(this.initial).length,this.render()}up(D){let u=D||this.minor,F=this.toNumber(this.input);if(F>this.max+u)return this.alert();return this.input=`${F+u}`,this.render()}down(D){let u=D||this.minor,F=this.toNumber(this.input);if(F<this.min-u)return this.alert();return this.input=`${F-u}`,this.render()}shiftDown(){return this.down(this.major)}shiftUp(){return this.up(this.major)}format(D=this.input){if(typeof this.options.format==="function")return this.options.format.call(this,D);return this.styles.info(D)}toNumber(D=""){return this.float?+D:Math.round(+D)}isValue(D){return/^[-+]?[0-9]+((\.)|(\.[0-9]+))?$/.test(D)}submit(){let D=[this.input,this.initial].find((u)=>this.isValue(u));return this.value=this.toNumber(D||0),super.submit()}}j2.exports=J2});var b2=U(($C,K2)=>{var X6=qD();class V2 extends X6{constructor(D){super(D);this.cursorShow()}format(D=this.input){if(!this.keypressed)return"";return(this.state.submitted?this.styles.primary:this.styles.muted)(this.symbols.asterisk.repeat(D.length))}}K2.exports=V2});var t2=U((wC,O2)=>{var Y6=uD(),J6=YD(),y2=O();class P2 extends J6{constructor(D={}){super(D);this.widths=[].concat(D.messageWidth||50),this.align=[].concat(D.align||"left"),this.linebreak=D.linebreak||!1,this.edgeLength=D.edgeLength||3,this.newline=D.newline||`
33
+ `)}format(){if(!this.state.submitted||this.state.cancelled)return"";if(Array.isArray(this.selected))return this.selected.map((D)=>this.styles.primary(D.name)).join(", ");return this.styles.primary(this.selected.name)}async render(){let{submitted:D,size:u}=this.state,F="",E=await this.header(),B=await this.prefix(),_=await this.separator(),A=await this.message();if(this.options.promptLine!==!1)F=[B,A,_,""].join(" "),this.state.prompt=F;let C=await this.format(),$=await this.error()||await this.hint(),w=await this.renderChoices(),r=await this.footer();if(C)F+=C;if($&&!F.includes($))F+=" "+$;if(D&&!C&&!w.trim()&&this.multiple&&this.emptyError!=null)F+=this.styles.danger(this.emptyError);this.clear(u),this.write([E,F,w,r].filter(Boolean).join(`
34
+ `)),this.write(this.margin[2]),this.restore()}}nF.exports=iF});var aF=U((l_,lF)=>{var E6=ED(),B6=(D,u)=>{let F=D?new RegExp(D,"ig"):/$^/;return(E)=>{return D?E.replace(F,(B)=>u(B)):E}};class pF extends E6{constructor(D){super(D);this.cursorShow()}moveCursor(D){this.state.cursor+=D}dispatch(D){return this.append(D)}space(D){return this.options.multiple?super.space(D):this.append(D)}append(D){let{cursor:u,input:F}=this.state;return this.input=F.slice(0,u)+D+F.slice(u),this.moveCursor(1),this.complete()}delete(){let{cursor:D,input:u}=this.state;if(!u)return this.alert();return this.input=u.slice(0,D-1)+u.slice(D),this.moveCursor(-1),this.complete()}deleteForward(){let{cursor:D,input:u}=this.state;if(u[D]===void 0)return this.alert();return this.input=`${u}`.slice(0,D)+`${u}`.slice(D+1),this.complete()}number(D){return this.append(D)}async complete(){this.completing=!0,this.choices=await this.suggest(this.input,this.state._choices),this.state.limit=void 0,this.index=Math.min(Math.max(this.visible.length-1,0),this.index),await this.render(),this.completing=!1}suggest(D=this.input,u=this.state._choices){if(typeof this.options.suggest==="function")return this.options.suggest.call(this,D,u);let F=D.toLowerCase();return u.filter((E)=>E.message.toLowerCase().includes(F))}pointer(){return""}format(){if(!this.focused)return this.input;if(this.options.multiple&&this.state.submitted)return this.selected.map((D)=>this.styles.primary(D.message)).join(", ");if(this.state.submitted){let D=this.value=this.input=this.focused.value;return this.styles.primary(D)}return this.input}async render(){if(this.state.status!=="pending")return super.render();let D=this.options.highlight||this.styles.complement,u=(B,_)=>{if(!B)return B;if(D.stack)return D(B);return D.call(this,B)},F=B6(this.input,u),E=this.choices;this.choices=E.map((B)=>({...B,message:F(B.message)})),await super.render(),this.choices=E}submit(){if(this.options.multiple)this.value=this.selected.map((D)=>D.name);return super.submit()}}lF.exports=pF});var gu=U((a_,cF)=>{var su=O();cF.exports=(D,u={})=>{D.cursorHide();let{input:F="",initial:E="",pos:B,showCursor:_=!0,color:A}=u,C=A||D.styles.placeholder,$=su.inverse(D.styles.primary),w=(T)=>$(D.styles.black(T)),r=F,M=" ",L=w(M);if(D.blink&&D.blink.off===!0)w=(T)=>T,L="";if(_&&B===0&&E===""&&F==="")return w(M);if(_&&B===0&&(F===E||F===""))return w(E[0])+C(E.slice(1));E=su.isPrimitive(E)?`${E}`:"",F=su.isPrimitive(F)?`${F}`:"";let q=E&&E.startsWith(F)&&E!==F,I=q?w(E[F.length]):L;if(B!==F.length&&_===!0)r=F.slice(0,B)+w(F[B])+F.slice(B+1),I="";if(_===!1)I="";if(q){let T=D.styles.unstyle(r+I);return r+I+C(E.slice(T.length))}return r+I}});var iD=U((c_,eF)=>{var _6=uD(),C6=ED(),A6=gu();class oF extends C6{constructor(D){super({...D,multiple:!0});this.type="form",this.initial=this.options.initial,this.align=[this.options.align,"right"].find((u)=>u!=null),this.emptyError="",this.values={}}async reset(D){if(await super.reset(),D===!0)this._index=this.index;return this.index=this._index,this.values={},this.choices.forEach((u)=>u.reset&&u.reset()),this.render()}dispatch(D){return!!D&&this.append(D)}append(D){let u=this.focused;if(!u)return this.alert();let{cursor:F,input:E}=u;return u.value=u.input=E.slice(0,F)+D+E.slice(F),u.cursor++,this.render()}delete(){let D=this.focused;if(!D||D.cursor<=0)return this.alert();let{cursor:u,input:F}=D;return D.value=D.input=F.slice(0,u-1)+F.slice(u),D.cursor--,this.render()}deleteForward(){let D=this.focused;if(!D)return this.alert();let{cursor:u,input:F}=D;if(F[u]===void 0)return this.alert();let E=`${F}`.slice(0,u)+`${F}`.slice(u+1);return D.value=D.input=E,this.render()}right(){let D=this.focused;if(!D)return this.alert();if(D.cursor>=D.input.length)return this.alert();return D.cursor++,this.render()}left(){let D=this.focused;if(!D)return this.alert();if(D.cursor<=0)return this.alert();return D.cursor--,this.render()}space(D,u){return this.dispatch(D,u)}number(D,u){return this.dispatch(D,u)}next(){let D=this.focused;if(!D)return this.alert();let{initial:u,input:F}=D;if(u&&u.startsWith(F)&&F!==u)return D.value=D.input=u,D.cursor=D.value.length,this.render();return super.next()}prev(){let D=this.focused;if(!D)return this.alert();if(D.cursor===0)return super.prev();return D.value=D.input="",D.cursor=0,this.render()}separator(){return""}format(D){return!this.state.submitted?super.format(D):""}pointer(){return""}indicator(D){return D.input?"⦿":"⊙"}async choiceSeparator(D,u){let F=await this.resolve(D.separator,this.state,D,u)||":";return F?" "+this.styles.disabled(F):""}async renderChoice(D,u){await this.onChoice(D,u);let{state:F,styles:E}=this,{cursor:B,initial:_="",name:A,input:C=""}=D,{muted:$,submitted:w,primary:r,danger:M}=E,L=this.index===u,q=D.validate||(()=>!0),I=await this.choiceSeparator(D,u),T=D.message;if(this.align==="right")T=T.padStart(this.longest+1," ");if(this.align==="left")T=T.padEnd(this.longest+1," ");let R=this.values[A]=C||_,S=C?"success":"dark";if(await q.call(D,R,this.state)!==!0)S="danger";let H=E[S],h=H(await this.indicator(D,u))+(D.pad||""),W=this.indent(D),J=()=>[W,h,T+I,C].filter(Boolean).join(" ");if(F.submitted)return T=_6(T),C=w(C),J();if(D.format)C=await D.format.call(this,C,D,u);else{let G=this.styles.muted;C=A6(this,{input:C,initial:_,pos:B,showCursor:L,color:G})}if(!this.isValue(C))C=this.styles.muted(this.symbols.ellipsis);if(D.result)this.values[A]=await D.result.call(this,R,D,u);if(L)T=r(T);if(D.error)C+=(C?" ":"")+M(D.error.trim());else if(D.hint)C+=(C?" ":"")+$(D.hint.trim());return J()}async submit(){return this.value=this.values,super.base.submit.call(this)}}eF.exports=oF});var du=U((o_,u2)=>{var $6=iD(),w6=()=>{throw Error("expected prompt to have a custom authenticate method")},D2=(D=w6)=>{class u extends $6{constructor(F){super(F)}async submit(){this.value=await D.call(this,this.values,this.state),super.base.submit.call(this)}static create(F){return D2(F)}}return u};u2.exports=D2()});var B2=U((e_,E2)=>{var r6=du();function M6(D,u){if(D.username===this.options.username&&D.password===this.options.password)return!0;return!1}var F2=(D=M6)=>{let u=[{name:"username",message:"username"},{name:"password",message:"password",format(E){if(this.options.showPassword)return E;return(this.state.submitted?this.styles.primary:this.styles.muted)(this.symbols.asterisk.repeat(E.length))}}];class F extends r6.create(D){constructor(E){super({...E,choices:u})}static create(E){return F2(E)}}return F};E2.exports=F2()});var nD=U((DC,C2)=>{var q6=TD(),{isPrimitive:I6,hasColor:z6}=O();class _2 extends q6{constructor(D){super(D);this.cursorHide()}async initialize(){let D=await this.resolve(this.initial,this.state);this.input=await this.cast(D),await super.initialize()}dispatch(D){if(!this.isValue(D))return this.alert();return this.input=D,this.submit()}format(D){let{styles:u,state:F}=this;return!F.submitted?u.primary(D):u.success(D)}cast(D){return this.isTrue(D)}isTrue(D){return/^[ty1]/i.test(D)}isFalse(D){return/^[fn0]/i.test(D)}isValue(D){return I6(D)&&(this.isTrue(D)||this.isFalse(D))}async hint(){if(this.state.status==="pending"){let D=await this.element("hint");if(!z6(D))return this.styles.muted(D);return D}}async render(){let{input:D,size:u}=this.state,F=await this.prefix(),E=await this.separator(),B=await this.message(),_=this.styles.muted(this.default),A=[F,B,_,E].filter(Boolean).join(" ");this.state.prompt=A;let C=await this.header(),$=this.value=this.cast(D),w=await this.format($),r=await this.error()||await this.hint(),M=await this.footer();if(r&&!A.includes(r))w+=" "+r;A+=" "+w,this.clear(u),this.write([C,A,M].filter(Boolean).join(`
35
+ `)),this.restore()}set value(D){super.value=D}get value(){return this.cast(super.value)}}C2.exports=_2});var w2=U((uC,$2)=>{var L6=nD();class A2 extends L6{constructor(D){super(D);this.default=this.options.default||(this.initial?"(Y/n)":"(y/N)")}}$2.exports=A2});var q2=U((FC,M2)=>{var S6=ED(),T6=iD(),UD=T6.prototype;class r2 extends S6{constructor(D){super({...D,multiple:!0});this.align=[this.options.align,"left"].find((u)=>u!=null),this.emptyError="",this.values={}}dispatch(D,u){let F=this.focused,E=F.parent||{};if(!F.editable&&!E.editable){if(D==="a"||D==="i")return super[D]()}return UD.dispatch.call(this,D,u)}append(D,u){return UD.append.call(this,D,u)}delete(D,u){return UD.delete.call(this,D,u)}space(D){return this.focused.editable?this.append(D):super.space()}number(D){return this.focused.editable?this.append(D):super.number(D)}next(){return this.focused.editable?UD.next.call(this):super.next()}prev(){return this.focused.editable?UD.prev.call(this):super.prev()}async indicator(D,u){let F=D.indicator||"",E=D.editable?F:super.indicator(D,u);return await this.resolve(E,this.state,D,u)||""}indent(D){return D.role==="heading"?"":D.editable?" ":" "}async renderChoice(D,u){if(D.indent="",D.editable)return UD.renderChoice.call(this,D,u);return super.renderChoice(D,u)}error(){return""}footer(){return this.state.error}async validate(){let D=!0;for(let u of this.choices){if(typeof u.validate!=="function")continue;if(u.role==="heading")continue;let F=u.parent?this.value[u.parent.name]:this.value;if(u.editable)F=u.value===u.name?u.initial||"":u.value;else if(!this.isDisabled(u))F=u.enabled===!0;if(D=await u.validate(F,this.state),D!==!0)break}if(D!==!0)this.state.error=typeof D==="string"?D:"Invalid Input";return D}submit(){if(this.focused.newChoice===!0)return super.submit();if(this.choices.some((D)=>D.newChoice))return this.alert();this.value={};for(let D of this.choices){let u=D.parent?this.value[D.parent.name]:this.value;if(D.role==="heading"){this.value[D.name]={};continue}if(D.editable)u[D.name]=D.value===D.name?D.initial||"":D.value;else if(!this.isDisabled(D))u[D.name]=D.enabled===!0}return this.base.submit.call(this)}}M2.exports=r2});var MD=U((EC,z2)=>{var U6=TD(),h6=Vu(),R6=gu(),{isPrimitive:H6}=O();class I2 extends U6{constructor(D){super(D);if(this.initial=H6(this.initial)?String(this.initial):"",this.initial)this.cursorHide();this.state.prevCursor=0,this.state.clipboard=[],this.keypressTimeout=this.options.keypressTimeout!==void 0?this.options.keypressTimeout:null}async keypress(D,u=D?h6(D,{}):{}){let F=Date.now(),E=F-this.lastKeypress;this.lastKeypress=F;let B=u.name==="return"||u.name==="enter",_=this.state.prevKeypress,A;if(this.state.prevKeypress=u,this.keypressTimeout!=null&&B){if(E<this.keypressTimeout)return this.submit();this.state.multilineBuffer=this.state.multilineBuffer||"",this.state.multilineBuffer+=D,A=!0,_=null}if(A||this.options.multiline&&B){if(!_||_.name!=="return")return this.append(`
36
+ `,u)}return super.keypress(D,u)}moveCursor(D){this.cursor+=D}reset(){return this.input=this.value="",this.cursor=0,this.render()}dispatch(D,u){if(!D||u.ctrl||u.code)return this.alert();this.append(D)}append(D){let{cursor:u,input:F}=this.state;this.input=`${F}`.slice(0,u)+D+`${F}`.slice(u),this.moveCursor(String(D).length),this.render()}insert(D){this.append(D)}delete(){let{cursor:D,input:u}=this.state;if(D<=0)return this.alert();this.input=`${u}`.slice(0,D-1)+`${u}`.slice(D),this.moveCursor(-1),this.render()}deleteForward(){let{cursor:D,input:u}=this.state;if(u[D]===void 0)return this.alert();this.input=`${u}`.slice(0,D)+`${u}`.slice(D+1),this.render()}cutForward(){let D=this.cursor;if(this.input.length<=D)return this.alert();this.state.clipboard.push(this.input.slice(D)),this.input=this.input.slice(0,D),this.render()}cutLeft(){let D=this.cursor;if(D===0)return this.alert();let u=this.input.slice(0,D),F=this.input.slice(D),E=u.split(" ");this.state.clipboard.push(E.pop()),this.input=E.join(" "),this.cursor=this.input.length,this.input+=F,this.render()}paste(){if(!this.state.clipboard.length)return this.alert();this.insert(this.state.clipboard.pop()),this.render()}toggleCursor(){if(this.state.prevCursor)this.cursor=this.state.prevCursor,this.state.prevCursor=0;else this.state.prevCursor=this.cursor,this.cursor=0;this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.input.length-1,this.render()}next(){let D=this.initial!=null?String(this.initial):"";if(!D||!D.startsWith(this.input))return this.alert();this.input=this.initial,this.cursor=this.initial.length,this.render()}prev(){if(!this.input)return this.alert();this.reset()}backward(){return this.left()}forward(){return this.right()}right(){if(this.cursor>=this.input.length)return this.alert();return this.moveCursor(1),this.render()}left(){if(this.cursor<=0)return this.alert();return this.moveCursor(-1),this.render()}isValue(D){return!!D}async format(D=this.value){let u=await this.resolve(this.initial,this.state);if(!this.state.submitted)return R6(this,{input:D,initial:u,pos:this.cursor});return this.styles.submitted(D||u)}async render(){let D=this.state.size,u=await this.prefix(),F=await this.separator(),E=await this.message(),B=[u,E,F].filter(Boolean).join(" ");this.state.prompt=B;let _=await this.header(),A=await this.format(),C=await this.error()||await this.hint(),$=await this.footer();if(C&&!A.includes(C))A+=" "+C;B+=" "+A,this.clear(D),this.write([_,B,$].filter(Boolean).join(`
37
+ `)),this.restore()}}z2.exports=I2});var S2=U((BC,L2)=>{var W6=(D)=>D.filter((u,F)=>D.lastIndexOf(u)===F),pD=(D)=>W6(D).filter(Boolean);L2.exports=(D,u={},F="")=>{let{past:E=[],present:B=""}=u,_,A;switch(D){case"prev":case"undo":return _=E.slice(0,E.length-1),A=E[E.length-1]||"",{past:pD([F,..._]),present:A};case"next":case"redo":return _=E.slice(1),A=E[0]||"",{past:pD([..._,F]),present:A};case"save":return{past:pD([...E,F]),present:""};case"remove":if(A=pD(E.filter((C)=>C!==F)),B="",A.length)B=A.pop();return{past:A,present:B};default:throw Error(`Invalid action: "${D}"`)}}});var mu=U((_C,h2)=>{var Z6=MD(),T2=S2();class U2 extends Z6{constructor(D){super(D);let u=this.options.history;if(u&&u.store){let F=u.values||this.initial;this.autosave=!!u.autosave,this.store=u.store,this.data=this.store.get("values")||{past:[],present:F},this.initial=this.data.present||this.data.past[this.data.past.length-1]}}completion(D){if(!this.store)return this.alert();if(this.data=T2(D,this.data,this.input),!this.data.present)return this.alert();return this.input=this.data.present,this.cursor=this.input.length,this.render()}altUp(){return this.completion("prev")}altDown(){return this.completion("next")}prev(){return this.save(),super.prev()}save(){if(!this.store)return;this.data=T2("save",this.data,this.input),this.store.set("values",this.data)}submit(){if(this.store&&this.autosave===!0)this.save();return super.submit()}}h2.exports=U2});var W2=U((CC,H2)=>{var G6=MD();class R2 extends G6{format(){return""}}H2.exports=R2});var Q2=U((AC,G2)=>{var Q6=MD();class Z2 extends Q6{constructor(D={}){super(D);this.sep=this.options.separator||/, */,this.initial=D.initial||""}split(D=this.value){return D?String(D).split(this.sep):[]}format(){let D=this.state.submitted?this.styles.primary:(u)=>u;return this.list.map(D).join(", ")}async submit(D){let u=this.state.error||await this.validate(this.list,this.state);if(u!==!0)return this.state.error=u,super.submit();return this.value=this.list,super.submit()}get list(){return this.split()}}G2.exports=Z2});var J2=U(($C,Y2)=>{var X6=ED();class X2 extends X6{constructor(D){super({...D,multiple:!0})}}Y2.exports=X2});var iu=U((wC,V2)=>{var Y6=MD();class j2 extends Y6{constructor(D={}){super({style:"number",...D});this.min=this.isValue(D.min)?this.toNumber(D.min):-1/0,this.max=this.isValue(D.max)?this.toNumber(D.max):1/0,this.delay=D.delay!=null?D.delay:1000,this.float=D.float!==!1,this.round=D.round===!0||D.float===!1,this.major=D.major||10,this.minor=D.minor||1,this.initial=D.initial!=null?D.initial:"",this.input=String(this.initial),this.cursor=this.input.length,this.cursorShow()}append(D){if(!/[-+.]/.test(D)||D==="."&&this.input.includes("."))return this.alert("invalid number");return super.append(D)}number(D){return super.append(D)}next(){if(this.input&&this.input!==this.initial)return this.alert();if(!this.isValue(this.initial))return this.alert();return this.input=this.initial,this.cursor=String(this.initial).length,this.render()}up(D){let u=D||this.minor,F=this.toNumber(this.input);if(F>this.max+u)return this.alert();return this.input=`${F+u}`,this.render()}down(D){let u=D||this.minor,F=this.toNumber(this.input);if(F<this.min-u)return this.alert();return this.input=`${F-u}`,this.render()}shiftDown(){return this.down(this.major)}shiftUp(){return this.up(this.major)}format(D=this.input){if(typeof this.options.format==="function")return this.options.format.call(this,D);return this.styles.info(D)}toNumber(D=""){return this.float?+D:Math.round(+D)}isValue(D){return/^[-+]?[0-9]+((\.)|(\.[0-9]+))?$/.test(D)}submit(){let D=[this.input,this.initial].find((u)=>this.isValue(u));return this.value=this.toNumber(D||0),super.submit()}}V2.exports=j2});var b2=U((rC,y2)=>{var J6=MD();class K2 extends J6{constructor(D){super(D);this.cursorShow()}format(D=this.input){if(!this.keypressed)return"";return(this.state.submitted?this.styles.primary:this.styles.muted)(this.symbols.asterisk.repeat(D.length))}}y2.exports=K2});var N2=U((MC,O2)=>{var j6=uD(),V6=JD(),t2=O();class P2 extends V6{constructor(D={}){super(D);this.widths=[].concat(D.messageWidth||50),this.align=[].concat(D.align||"left"),this.linebreak=D.linebreak||!1,this.edgeLength=D.edgeLength||3,this.newline=D.newline||`
38
38
  `;let u=D.startNumber||1;if(typeof this.scale==="number")this.scaleKey=!1,this.scale=Array(this.scale).fill(0).map((F,E)=>({name:E+u}))}async reset(){return this.tableized=!1,await super.reset(),this.render()}tableize(){if(this.tableized===!0)return;this.tableized=!0;let D=0;for(let u of this.choices){D=Math.max(D,u.message.length),u.scaleIndex=u.initial||2,u.scale=[];for(let F=0;F<this.scale.length;F++)u.scale.push({index:F})}this.widths[0]=Math.min(this.widths[0],D+3)}async dispatch(D,u){if(this.multiple)return this[u.name]?await this[u.name](D,u):await super.dispatch(D,u);this.alert()}heading(D,u,F){return this.styles.strong(D)}separator(){return this.styles.muted(this.symbols.ellipsis)}right(){let D=this.focused;if(D.scaleIndex>=this.scale.length-1)return this.alert();return D.scaleIndex++,this.render()}left(){let D=this.focused;if(D.scaleIndex<=0)return this.alert();return D.scaleIndex--,this.render()}indent(){return""}format(){if(this.state.submitted)return this.choices.map((u)=>this.styles.info(u.index)).join(", ");return""}pointer(){return""}renderScaleKey(){if(this.scaleKey===!1)return"";if(this.state.submitted)return"";return["",...this.scale.map((F)=>` ${F.name} - ${F.message}`)].map((F)=>this.styles.muted(F)).join(`
39
- `)}renderScaleHeading(D){let u=this.scale.map((C)=>C.name);if(typeof this.options.renderScaleHeading==="function")u=this.options.renderScaleHeading.call(this,D);let F=this.scaleLength-u.join("").length,E=Math.round(F/(u.length-1)),_=u.map((C)=>this.styles.strong(C)).join(" ".repeat(E)),A=" ".repeat(this.widths[0]);return this.margin[3]+A+this.margin[1]+_}scaleIndicator(D,u,F){if(typeof this.options.scaleIndicator==="function")return this.options.scaleIndicator.call(this,D,u,F);let E=D.scaleIndex===u.index;if(u.disabled)return this.styles.hint(this.symbols.radio.disabled);if(E)return this.styles.success(this.symbols.radio.on);return this.symbols.radio.off}renderScale(D,u){let F=D.scale.map((B)=>this.scaleIndicator(D,B,u)),E=this.term==="Hyper"?"":" ";return F.join(E+this.symbols.line.repeat(this.edgeLength))}async renderChoice(D,u){await this.onChoice(D,u);let F=this.index===u,E=await this.pointer(D,u),B=await D.hint;if(B&&!y2.hasColor(B))B=this.styles.muted(B);let _=(z)=>this.margin[3]+z.replace(/\s+$/,"").padEnd(this.widths[0]," "),A=this.newline,C=this.indent(D),$=await this.resolve(D.message,this.state,D,u),w=await this.renderScale(D,u),S=this.margin[1]+this.margin[3];this.scaleLength=Y6(w).length,this.widths[0]=Math.min(this.widths[0],this.width-this.scaleLength-S.length);let M=y2.wordWrap($,{width:this.widths[0],newline:A}).split(`
40
- `).map((z)=>_(z)+this.margin[1]);if(F)w=this.styles.info(w),M=M.map((z)=>this.styles.info(z));if(M[0]+=w,this.linebreak)M.push("");return[C+E,M.join(`
39
+ `)}renderScaleHeading(D){let u=this.scale.map((C)=>C.name);if(typeof this.options.renderScaleHeading==="function")u=this.options.renderScaleHeading.call(this,D);let F=this.scaleLength-u.join("").length,E=Math.round(F/(u.length-1)),_=u.map((C)=>this.styles.strong(C)).join(" ".repeat(E)),A=" ".repeat(this.widths[0]);return this.margin[3]+A+this.margin[1]+_}scaleIndicator(D,u,F){if(typeof this.options.scaleIndicator==="function")return this.options.scaleIndicator.call(this,D,u,F);let E=D.scaleIndex===u.index;if(u.disabled)return this.styles.hint(this.symbols.radio.disabled);if(E)return this.styles.success(this.symbols.radio.on);return this.symbols.radio.off}renderScale(D,u){let F=D.scale.map((B)=>this.scaleIndicator(D,B,u)),E=this.term==="Hyper"?"":" ";return F.join(E+this.symbols.line.repeat(this.edgeLength))}async renderChoice(D,u){await this.onChoice(D,u);let F=this.index===u,E=await this.pointer(D,u),B=await D.hint;if(B&&!t2.hasColor(B))B=this.styles.muted(B);let _=(q)=>this.margin[3]+q.replace(/\s+$/,"").padEnd(this.widths[0]," "),A=this.newline,C=this.indent(D),$=await this.resolve(D.message,this.state,D,u),w=await this.renderScale(D,u),r=this.margin[1]+this.margin[3];this.scaleLength=j6(w).length,this.widths[0]=Math.min(this.widths[0],this.width-this.scaleLength-r.length);let L=t2.wordWrap($,{width:this.widths[0],newline:A}).split(`
40
+ `).map((q)=>_(q)+this.margin[1]);if(F)w=this.styles.info(w),L=L.map((q)=>this.styles.info(q));if(L[0]+=w,this.linebreak)L.push("");return[C+E,L.join(`
41
41
  `)].filter(Boolean)}async renderChoices(){if(this.state.submitted)return"";this.tableize();let D=this.visible.map(async(E,B)=>await this.renderChoice(E,B)),u=await Promise.all(D),F=await this.renderScaleHeading();return this.margin[0]+[F,...u.map((E)=>E.join(" "))].join(`
42
- `)}async render(){let{submitted:D,size:u}=this.state,F=await this.prefix(),E=await this.separator(),B=await this.message(),_="";if(this.options.promptLine!==!1)_=[F,B,E,""].join(" "),this.state.prompt=_;let A=await this.header(),C=await this.format(),$=await this.renderScaleKey(),w=await this.error()||await this.hint(),S=await this.renderChoices(),q=await this.footer(),M=this.emptyError;if(C)_+=C;if(w&&!_.includes(w))_+=" "+w;if(D&&!C&&!S.trim()&&this.multiple&&M!=null)_+=this.styles.danger(M);if(this.clear(u),this.write([A,_,$,S,q].filter(Boolean).join(`
43
- `)),!this.state.submitted)this.write(this.margin[2]);this.restore()}submit(){this.value={};for(let D of this.choices)this.value[D.name]=D.scaleIndex;return this.base.submit.call(this)}}O2.exports=P2});var f2=U((SC,v2)=>{var N2=uD(),j6=(D="")=>{return typeof D==="string"?D.replace(/^['"]|['"]$/g,""):""};class x2{constructor(D){this.name=D.key,this.field=D.field||{},this.value=j6(D.initial||this.field.initial||""),this.message=D.message||this.name,this.cursor=0,this.input="",this.lines=[]}}var V6=async(D={},u={},F=(E)=>E)=>{let E=new Set,B=D.fields||[],_=D.template,A=[],C=[],$=[],w=1;if(typeof _==="function")_=await _();let S=-1,q=()=>_[++S],M=()=>_[S+1],z=(L)=>{L.line=w,A.push(L)};z({type:"bos",value:""});while(S<_.length-1){let L=q();if(/^[^\S\n ]$/.test(L)){z({type:"text",value:L});continue}if(L===`
44
- `){z({type:"newline",value:L}),w++;continue}if(L==="\\"){L+=q(),z({type:"text",value:L});continue}if((L==="$"||L==="#"||L==="{")&&M()==="{"){let I=q();L+=I;let h={type:"template",open:L,inner:"",close:"",value:L},H;while(H=q()){if(H==="}"){if(M()==="}")H+=q();h.value+=H,h.close=H;break}if(H===":")h.initial="",h.key=h.inner;else if(h.initial!==void 0)h.initial+=H;h.value+=H,h.inner+=H}if(h.template=h.open+(h.initial||h.inner)+h.close,h.key=h.key||h.inner,hasOwnProperty.call(u,h.key))h.initial=u[h.key];h=F(h),z(h),$.push(h.key),E.add(h.key);let T=C.find((W)=>W.name===h.key);if(h.field=B.find((W)=>W.name===h.key),!T)T=new x2(h),C.push(T);T.lines.push(h.line-1);continue}let R=A[A.length-1];if(R.type==="text"&&R.line===w)R.value+=L;else z({type:"text",value:L})}return z({type:"eos",value:""}),{input:_,tabstops:A,unique:E,keys:$,items:C}};v2.exports=async(D)=>{let u=D.options,F=new Set(u.required===!0?[]:u.required||[]),E={...u.values,...u.initial},{tabstops:B,items:_,keys:A}=await V6(u,E),C=iu("result",D,u),$=iu("format",D,u),w=iu("validate",D,u,!0),S=D.isValue.bind(D);return async(q={},M=!1)=>{let z=0;q.required=F,q.items=_,q.keys=A,q.output="";let L=async(H,T,W,J)=>{let G=await w(H,T,W,J);if(G===!1)return"Invalid field "+W.name;return G};for(let H of B){let{value:T,key:W}=H;if(H.type!=="template"){if(T)q.output+=T;continue}if(H.type==="template"){let J=_.find((y)=>y.name===W);if(u.required===!0)q.required.add(J.name);let G=[J.input,q.values[J.value],J.value,T].find(S),j=(J.field||{}).message||H.inner;if(M){let y=await L(q.values[W],q,J,z);if(y&&typeof y==="string"||y===!1){q.invalid.set(W,y);continue}q.invalid.delete(W);let Z=await C(q.values[W],q,J,z);q.output+=N2(Z);continue}J.placeholder=!1;let x=T;if(T=await $(T,q,J,z),G!==T)q.values[W]=G,T=D.styles.typing(G),q.missing.delete(j);else if(q.values[W]=void 0,G=`<${j}>`,T=D.styles.primary(G),J.placeholder=!0,q.required.has(W))q.missing.add(j);if(q.missing.has(j)&&q.validating)T=D.styles.warning(G);if(q.invalid.has(W)&&q.validating)T=D.styles.danger(G);if(z===q.index)if(x!==T)T=D.styles.underline(T);else T=D.styles.heading(N2(T));z++}if(T)q.output+=T}let R=q.output.split(`
45
- `).map((H)=>" "+H),I=_.length,h=0;for(let H of _){if(q.invalid.has(H.name))H.lines.forEach((T)=>{if(R[T][0]!==" ")return;R[T]=q.styles.danger(q.symbols.bullet)+R[T].slice(1)});if(D.isValue(q.values[H.name]))h++}return q.completed=(h/I*100).toFixed(0),q.output=R.join(`
46
- `),q.output}};function iu(D,u,F,E){return(B,_,A,C)=>{if(typeof A.field[D]==="function")return A.field[D].call(u,B,_,A,C);return[E,B].find(($)=>u.isValue($))}}});var s2=U((qC,g2)=>{var K6=uD(),b6=f2(),y6=hD();class k2 extends y6{constructor(D){super(D);this.cursorHide(),this.reset(!0)}async initialize(){this.interpolate=await b6(this),await super.initialize()}async reset(D){if(this.state.keys=[],this.state.invalid=new Map,this.state.missing=new Set,this.state.completed=0,this.state.values={},D!==!0)await this.initialize(),await this.render()}moveCursor(D){let u=this.getItem();this.cursor+=D,u.cursor+=D}dispatch(D,u){if(!u.code&&!u.ctrl&&D!=null&&this.getItem()){this.append(D,u);return}this.alert()}append(D,u){let F=this.getItem(),E=F.input.slice(0,this.cursor),B=F.input.slice(this.cursor);this.input=F.input=`${E}${D}${B}`,this.moveCursor(1),this.render()}delete(){let D=this.getItem();if(this.cursor<=0||!D.input)return this.alert();let u=D.input.slice(this.cursor),F=D.input.slice(0,this.cursor-1);this.input=D.input=`${F}${u}`,this.moveCursor(-1),this.render()}increment(D){return D>=this.state.keys.length-1?0:D+1}decrement(D){return D<=0?this.state.keys.length-1:D-1}first(){this.state.index=0,this.render()}last(){this.state.index=this.state.keys.length-1,this.render()}right(){if(this.cursor>=this.input.length)return this.alert();this.moveCursor(1),this.render()}left(){if(this.cursor<=0)return this.alert();this.moveCursor(-1),this.render()}prev(){this.state.index=this.decrement(this.state.index),this.getItem(),this.render()}next(){this.state.index=this.increment(this.state.index),this.getItem(),this.render()}up(){this.prev()}down(){this.next()}format(D){let u=this.state.completed<100?this.styles.warning:this.styles.success;if(this.state.submitted===!0&&this.state.completed!==100)u=this.styles.danger;return u(`${this.state.completed}% completed`)}async render(){let{index:D,keys:u=[],submitted:F,size:E}=this.state,B=[this.options.newline,`
47
- `].find((h)=>h!=null),_=await this.prefix(),A=await this.separator(),C=await this.message(),$=[_,C,A].filter(Boolean).join(" ");this.state.prompt=$;let w=await this.header(),S=await this.error()||"",q=await this.hint()||"",M=F?"":await this.interpolate(this.state),z=this.state.key=u[D]||"",L=await this.format(z),R=await this.footer();if(L)$+=" "+L;if(q&&!L&&this.state.completed===0)$+=" "+q;this.clear(E);let I=[w,$,M,R,S.trim()];this.write(I.filter(Boolean).join(B)),this.restore()}getItem(D){let{items:u,keys:F,index:E}=this.state,B=u.find((_)=>_.name===F[E]);if(B&&B.input!=null)this.input=B.input,this.cursor=B.cursor;return B}async submit(){if(typeof this.interpolate!=="function")await this.initialize();await this.interpolate(this.state,!0);let{invalid:D,missing:u,output:F,values:E}=this.state;if(D.size){let A="";for(let[C,$]of D)A+=`Invalid ${C}: ${$}
48
- `;return this.state.error=A,super.submit()}if(u.size)return this.state.error="Required: "+[...u.keys()].join(", "),super.submit();let _=K6(F).split(`
42
+ `)}async render(){let{submitted:D,size:u}=this.state,F=await this.prefix(),E=await this.separator(),B=await this.message(),_="";if(this.options.promptLine!==!1)_=[F,B,E,""].join(" "),this.state.prompt=_;let A=await this.header(),C=await this.format(),$=await this.renderScaleKey(),w=await this.error()||await this.hint(),r=await this.renderChoices(),M=await this.footer(),L=this.emptyError;if(C)_+=C;if(w&&!_.includes(w))_+=" "+w;if(D&&!C&&!r.trim()&&this.multiple&&L!=null)_+=this.styles.danger(L);if(this.clear(u),this.write([A,_,$,r,M].filter(Boolean).join(`
43
+ `)),!this.state.submitted)this.write(this.margin[2]);this.restore()}submit(){this.value={};for(let D of this.choices)this.value[D.name]=D.scaleIndex;return this.base.submit.call(this)}}O2.exports=P2});var k2=U((qC,v2)=>{var x2=uD(),K6=(D="")=>{return typeof D==="string"?D.replace(/^['"]|['"]$/g,""):""};class f2{constructor(D){this.name=D.key,this.field=D.field||{},this.value=K6(D.initial||this.field.initial||""),this.message=D.message||this.name,this.cursor=0,this.input="",this.lines=[]}}var y6=async(D={},u={},F=(E)=>E)=>{let E=new Set,B=D.fields||[],_=D.template,A=[],C=[],$=[],w=1;if(typeof _==="function")_=await _();let r=-1,M=()=>_[++r],L=()=>_[r+1],q=(I)=>{I.line=w,A.push(I)};q({type:"bos",value:""});while(r<_.length-1){let I=M();if(/^[^\S\n ]$/.test(I)){q({type:"text",value:I});continue}if(I===`
44
+ `){q({type:"newline",value:I}),w++;continue}if(I==="\\"){I+=M(),q({type:"text",value:I});continue}if((I==="$"||I==="#"||I==="{")&&L()==="{"){let R=M();I+=R;let S={type:"template",open:I,inner:"",close:"",value:I},H;while(H=M()){if(H==="}"){if(L()==="}")H+=M();S.value+=H,S.close=H;break}if(H===":")S.initial="",S.key=S.inner;else if(S.initial!==void 0)S.initial+=H;S.value+=H,S.inner+=H}if(S.template=S.open+(S.initial||S.inner)+S.close,S.key=S.key||S.inner,hasOwnProperty.call(u,S.key))S.initial=u[S.key];S=F(S),q(S),$.push(S.key),E.add(S.key);let h=C.find((W)=>W.name===S.key);if(S.field=B.find((W)=>W.name===S.key),!h)h=new f2(S),C.push(h);h.lines.push(S.line-1);continue}let T=A[A.length-1];if(T.type==="text"&&T.line===w)T.value+=I;else q({type:"text",value:I})}return q({type:"eos",value:""}),{input:_,tabstops:A,unique:E,keys:$,items:C}};v2.exports=async(D)=>{let u=D.options,F=new Set(u.required===!0?[]:u.required||[]),E={...u.values,...u.initial},{tabstops:B,items:_,keys:A}=await y6(u,E),C=nu("result",D,u),$=nu("format",D,u),w=nu("validate",D,u,!0),r=D.isValue.bind(D);return async(M={},L=!1)=>{let q=0;M.required=F,M.items=_,M.keys=A,M.output="";let I=async(H,h,W,J)=>{let G=await w(H,h,W,J);if(G===!1)return"Invalid field "+W.name;return G};for(let H of B){let{value:h,key:W}=H;if(H.type!=="template"){if(h)M.output+=h;continue}if(H.type==="template"){let J=_.find((b)=>b.name===W);if(u.required===!0)M.required.add(J.name);let G=[J.input,M.values[J.value],J.value,h].find(r),j=(J.field||{}).message||H.inner;if(L){let b=await I(M.values[W],M,J,q);if(b&&typeof b==="string"||b===!1){M.invalid.set(W,b);continue}M.invalid.delete(W);let Z=await C(M.values[W],M,J,q);M.output+=x2(Z);continue}J.placeholder=!1;let x=h;if(h=await $(h,M,J,q),G!==h)M.values[W]=G,h=D.styles.typing(G),M.missing.delete(j);else if(M.values[W]=void 0,G=`<${j}>`,h=D.styles.primary(G),J.placeholder=!0,M.required.has(W))M.missing.add(j);if(M.missing.has(j)&&M.validating)h=D.styles.warning(G);if(M.invalid.has(W)&&M.validating)h=D.styles.danger(G);if(q===M.index)if(x!==h)h=D.styles.underline(h);else h=D.styles.heading(x2(h));q++}if(h)M.output+=h}let T=M.output.split(`
45
+ `).map((H)=>" "+H),R=_.length,S=0;for(let H of _){if(M.invalid.has(H.name))H.lines.forEach((h)=>{if(T[h][0]!==" ")return;T[h]=M.styles.danger(M.symbols.bullet)+T[h].slice(1)});if(D.isValue(M.values[H.name]))S++}return M.completed=(S/R*100).toFixed(0),M.output=T.join(`
46
+ `),M.output}};function nu(D,u,F,E){return(B,_,A,C)=>{if(typeof A.field[D]==="function")return A.field[D].call(u,B,_,A,C);return[E,B].find(($)=>u.isValue($))}}});var d2=U((IC,g2)=>{var b6=uD(),t6=k2(),P6=TD();class s2 extends P6{constructor(D){super(D);this.cursorHide(),this.reset(!0)}async initialize(){this.interpolate=await t6(this),await super.initialize()}async reset(D){if(this.state.keys=[],this.state.invalid=new Map,this.state.missing=new Set,this.state.completed=0,this.state.values={},D!==!0)await this.initialize(),await this.render()}moveCursor(D){let u=this.getItem();this.cursor+=D,u.cursor+=D}dispatch(D,u){if(!u.code&&!u.ctrl&&D!=null&&this.getItem()){this.append(D,u);return}this.alert()}append(D,u){let F=this.getItem(),E=F.input.slice(0,this.cursor),B=F.input.slice(this.cursor);this.input=F.input=`${E}${D}${B}`,this.moveCursor(1),this.render()}delete(){let D=this.getItem();if(this.cursor<=0||!D.input)return this.alert();let u=D.input.slice(this.cursor),F=D.input.slice(0,this.cursor-1);this.input=D.input=`${F}${u}`,this.moveCursor(-1),this.render()}increment(D){return D>=this.state.keys.length-1?0:D+1}decrement(D){return D<=0?this.state.keys.length-1:D-1}first(){this.state.index=0,this.render()}last(){this.state.index=this.state.keys.length-1,this.render()}right(){if(this.cursor>=this.input.length)return this.alert();this.moveCursor(1),this.render()}left(){if(this.cursor<=0)return this.alert();this.moveCursor(-1),this.render()}prev(){this.state.index=this.decrement(this.state.index),this.getItem(),this.render()}next(){this.state.index=this.increment(this.state.index),this.getItem(),this.render()}up(){this.prev()}down(){this.next()}format(D){let u=this.state.completed<100?this.styles.warning:this.styles.success;if(this.state.submitted===!0&&this.state.completed!==100)u=this.styles.danger;return u(`${this.state.completed}% completed`)}async render(){let{index:D,keys:u=[],submitted:F,size:E}=this.state,B=[this.options.newline,`
47
+ `].find((S)=>S!=null),_=await this.prefix(),A=await this.separator(),C=await this.message(),$=[_,C,A].filter(Boolean).join(" ");this.state.prompt=$;let w=await this.header(),r=await this.error()||"",M=await this.hint()||"",L=F?"":await this.interpolate(this.state),q=this.state.key=u[D]||"",I=await this.format(q),T=await this.footer();if(I)$+=" "+I;if(M&&!I&&this.state.completed===0)$+=" "+M;this.clear(E);let R=[w,$,L,T,r.trim()];this.write(R.filter(Boolean).join(B)),this.restore()}getItem(D){let{items:u,keys:F,index:E}=this.state,B=u.find((_)=>_.name===F[E]);if(B&&B.input!=null)this.input=B.input,this.cursor=B.cursor;return B}async submit(){if(typeof this.interpolate!=="function")await this.initialize();await this.interpolate(this.state,!0);let{invalid:D,missing:u,output:F,values:E}=this.state;if(D.size){let A="";for(let[C,$]of D)A+=`Invalid ${C}: ${$}
48
+ `;return this.state.error=A,super.submit()}if(u.size)return this.state.error="Required: "+[...u.keys()].join(", "),super.submit();let _=b6(F).split(`
49
49
  `).map((A)=>A.slice(1)).join(`
50
- `);return this.value={values:E,result:_},super.submit()}}g2.exports=k2});var i2=U((zC,d2)=>{var P6=ED();class m2 extends P6{constructor(D){super({...D,reorder:!1,sort:!0,multiple:!0});this.state.hint=[this.options.hint,"(Use <shift>+<up/down> to sort)"].find(this.isValue.bind(this))}indicator(){return""}async renderChoice(D,u){let F=await super.renderChoice(D,u),E=this.symbols.identicalTo+" ",B=this.index===u&&this.sorting?this.styles.muted(E):" ";if(this.options.drag===!1)B="";if(this.options.numbered===!0)return B+`${u+1} - `+F;return B+F}get selected(){return this.choices}submit(){return this.value=this.choices.map((D)=>D.value),super.submit()}}d2.exports=m2});var l2=U((rC,p2)=>{var O6=YD();class n2 extends O6{constructor(D={}){super(D);if(this.emptyError=D.emptyError||"No items were selected",this.term=process.env.TERM_PROGRAM,!this.options.header){let u=["","4 - Strongly Agree","3 - Agree","2 - Neutral","1 - Disagree","0 - Strongly Disagree",""];u=u.map((F)=>this.styles.muted(F)),this.state.header=u.join(`
51
- `)}}async toChoices(...D){if(this.createdScales)return!1;this.createdScales=!0;let u=await super.toChoices(...D);for(let F of u)F.scale=t6(5,this.options),F.scaleIdx=2;return u}dispatch(){this.alert()}space(){let D=this.focused,u=D.scale[D.scaleIdx],F=u.selected;return D.scale.forEach((E)=>E.selected=!1),u.selected=!F,this.render()}indicator(){return""}pointer(){return""}separator(){return this.styles.muted(this.symbols.ellipsis)}right(){let D=this.focused;if(D.scaleIdx>=D.scale.length-1)return this.alert();return D.scaleIdx++,this.render()}left(){let D=this.focused;if(D.scaleIdx<=0)return this.alert();return D.scaleIdx--,this.render()}indent(){return" "}async renderChoice(D,u){await this.onChoice(D,u);let F=this.index===u,E=this.term==="Hyper",B=!E?8:9,_=!E?" ":"",A=this.symbols.line.repeat(B),C=" ".repeat(B+(E?0:1)),$=(H)=>(H?this.styles.success("◉"):"◯")+_,w=u+1+".",S=F?this.styles.heading:this.styles.noop,q=await this.resolve(D.message,this.state,D,u),M=this.indent(D),z=M+D.scale.map((H,T)=>$(T===D.scaleIdx)).join(A),L=(H)=>H===D.scaleIdx?S(H):H,R=M+D.scale.map((H,T)=>L(T)).join(C),I=()=>[w,q].filter(Boolean).join(" "),h=()=>[I(),z,R," "].filter(Boolean).join(`
52
- `);if(F)z=this.styles.cyan(z),R=this.styles.cyan(R);return h()}async renderChoices(){if(this.state.submitted)return"";let D=this.visible.map(async(F,E)=>await this.renderChoice(F,E)),u=await Promise.all(D);if(!u.length)u.push(this.styles.danger("No matching choices"));return u.join(`
53
- `)}format(){if(this.state.submitted)return this.choices.map((u)=>this.styles.info(u.scaleIdx)).join(", ");return""}async render(){let{submitted:D,size:u}=this.state,F=await this.prefix(),E=await this.separator(),B=await this.message(),_=[F,B,E].filter(Boolean).join(" ");this.state.prompt=_;let A=await this.header(),C=await this.format(),$=await this.error()||await this.hint(),w=await this.renderChoices(),S=await this.footer();if(C||!$)_+=" "+C;if($&&!_.includes($))_+=" "+$;if(D&&!C&&!w&&this.multiple&&this.type!=="form")_+=this.styles.danger(this.emptyError);this.clear(u),this.write([_,A,w,S].filter(Boolean).join(`
54
- `)),this.restore()}submit(){this.value={};for(let D of this.choices)this.value[D.name]=D.scaleIdx;return this.base.submit.call(this)}}function t6(D,u={}){if(Array.isArray(u.scale))return u.scale.map((E)=>({...E}));let F=[];for(let E=1;E<D+1;E++)F.push({i:E,selected:!1});return F}p2.exports=n2});var o2=U((LC,c2)=>{var N6=iD();class a2 extends N6{async initialize(){await super.initialize(),this.value=this.initial=this.resolve(this.options.initial),this.disabled=this.options.disabled||"no",this.enabled=this.options.enabled||"yes",await this.render()}reset(){this.value=this.initial,this.render()}delete(){this.alert()}toggle(){this.value=!this.value,this.render()}enable(){if(this.value===!0)return this.alert();this.value=!0,this.render()}disable(){if(this.value===!1)return this.alert();this.value=!1,this.render()}up(){this.toggle()}down(){this.toggle()}right(){this.toggle()}left(){this.toggle()}next(){this.toggle()}prev(){this.toggle()}dispatch(D="",u){switch(D.toLowerCase()){case" ":return this.toggle();case"1":case"y":case"t":return this.enable();case"0":case"n":case"f":return this.disable();default:return this.alert()}}format(){let D=(F)=>this.styles.primary.underline(F);return[this.value?this.disabled:D(this.disabled),this.value?D(this.enabled):this.enabled].join(this.styles.muted(" / "))}async render(){let{size:D}=this.state,u=await this.header(),F=await this.prefix(),E=await this.separator(),B=await this.message(),_=await this.format(),A=await this.error()||await this.hint(),C=await this.footer(),$=[F,B,E,_].join(" ");if(this.state.prompt=$,A&&!$.includes(A))$+=" "+A;this.clear(D),this.write([u,$,C].filter(Boolean).join(`
55
- `)),this.write(this.margin[2]),this.restore()}}c2.exports=a2});var u3=U((MC,D3)=>{var x6=ED();class e2 extends x6{constructor(D){super(D);if(typeof this.options.correctChoice!=="number"||this.options.correctChoice<0)throw Error("Please specify the index of the correct answer from the list of choices")}async toChoices(D,u){let F=await super.toChoices(D,u);if(F.length<2)throw Error("Please give at least two choices to the user");if(this.options.correctChoice>F.length)throw Error("Please specify the index of the correct answer from the list of choices");return F}check(D){return D.index===this.options.correctChoice}async result(D){return{selectedAnswer:D,correctAnswer:this.options.choices[this.options.correctChoice].value,correct:await this.check(this.state)}}}D3.exports=e2});var E3=U((nu)=>{var F3=O(),b=(D,u)=>{F3.defineExport(nu,D,u),F3.defineExport(nu,D.toLowerCase(),u)};b("AutoComplete",()=>lF());b("BasicAuth",()=>E2());b("Confirm",()=>$2());b("Editable",()=>q2());b("Form",()=>dD());b("Input",()=>mu());b("Invisible",()=>H2());b("List",()=>G2());b("MultiSelect",()=>Y2());b("Numeral",()=>du());b("Password",()=>b2());b("Scale",()=>t2());b("Select",()=>ED());b("Snippet",()=>s2());b("Sort",()=>i2());b("Survey",()=>l2());b("Text",()=>mu());b("Toggle",()=>o2());b("Quiz",()=>u3())});var _3=U((RC,B3)=>{B3.exports={ArrayPrompt:YD(),AuthPrompt:su(),BooleanPrompt:iD(),NumberPrompt:du(),StringPrompt:qD()}});var $3=U((UC,A3)=>{var C3=a("assert"),lu=a("events"),BD=O();class l extends lu{constructor(D,u){super();this.options=BD.merge({},D),this.answers={...u}}register(D,u){if(BD.isObject(D)){for(let E of Object.keys(D))this.register(E,D[E]);return this}C3.equal(typeof u,"function","expected a function");let F=D.toLowerCase();if(u.prototype instanceof this.Prompt)this.prompts[F]=u;else this.prompts[F]=u(this.Prompt,this);return this}async prompt(D=[]){for(let u of[].concat(D))try{if(typeof u==="function")u=await u.call(this);await this.ask(BD.merge({},this.options,u))}catch(F){return Promise.reject(F)}return this.answers}async ask(D){if(typeof D==="function")D=await D.call(this);let u=BD.merge({},this.options,D),{type:F,name:E}=D,{set:B,get:_}=BD;if(typeof F==="function")F=await F.call(this,D,this.answers);if(!F)return this.answers[E];if(F==="number")F="numeral";C3(this.prompts[F],`Prompt "${F}" is not registered`);let A=new this.prompts[F](u),C=_(this.answers,E);if(A.state.answers=this.answers,A.enquirer=this,E)A.on("submit",(w)=>{this.emit("answer",E,w,A),B(this.answers,E,w)});let $=A.emit.bind(A);if(A.emit=(...w)=>{return this.emit.call(this,...w),$(...w)},this.emit("prompt",A,this),u.autofill&&C!=null){if(A.value=A.input=C,u.autofill==="show")await A.submit()}else C=A.value=await A.run();return C}use(D){return D.call(this,this),this}set Prompt(D){this._Prompt=D}get Prompt(){return this._Prompt||this.constructor.Prompt}get prompts(){return this.constructor.prompts}static set Prompt(D){this._Prompt=D}static get Prompt(){return this._Prompt||hD()}static get prompts(){return E3()}static get types(){return _3()}static get prompt(){let D=(u,...F)=>{let E=new this(...F),B=E.emit.bind(E);return E.emit=(..._)=>{return D.emit(..._),B(..._)},E.prompt(u)};return BD.mixinEmitter(D,new lu),D}}BD.mixinEmitter(l,new lu);var pu=l.prompts;for(let D of Object.keys(pu)){let u=D.toLowerCase(),F=(E)=>new pu[D](E).run();if(l.prompt[u]=F,l[u]=F,!l[D])Reflect.defineProperty(l,D,{get:()=>pu[D]})}var JD=(D)=>{BD.defineExport(l,D,()=>l.types[D])};JD("ArrayPrompt");JD("AuthPrompt");JD("BooleanPrompt");JD("NumberPrompt");JD("StringPrompt");A3.exports=l});var L0=TD(r0(),1),{program:$B,createCommand:wB,createArgument:SB,createOption:qB,CommanderError:zB,InvalidArgumentError:rB,InvalidOptionArgumentError:LB,Command:M0,Argument:MB,Option:hB,Help:RB}=L0.default;var h0=(D=0)=>(u)=>`\x1B[${u+D}m`,R0=(D=0)=>(u)=>`\x1B[${38+D};5;${u}m`,U0=(D=0)=>(u,F,E)=>`\x1B[${38+D};2;${u};${F};${E}m`,Q={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]}},TB=Object.keys(Q.modifier),_1=Object.keys(Q.color),C1=Object.keys(Q.bgColor),IB=[..._1,...C1];function A1(){let D=new Map;for(let[u,F]of Object.entries(Q)){for(let[E,B]of Object.entries(F))Q[E]={open:`\x1B[${B[0]}m`,close:`\x1B[${B[1]}m`},F[E]=Q[E],D.set(B[0],B[1]);Object.defineProperty(Q,u,{value:F,enumerable:!1})}return Object.defineProperty(Q,"codes",{value:D,enumerable:!1}),Q.color.close="\x1B[39m",Q.bgColor.close="\x1B[49m",Q.color.ansi=h0(),Q.color.ansi256=R0(),Q.color.ansi16m=U0(),Q.bgColor.ansi=h0(10),Q.bgColor.ansi256=R0(10),Q.bgColor.ansi16m=U0(10),Object.defineProperties(Q,{rgbToAnsi256:{value(u,F,E){if(u===F&&F===E){if(u<8)return 16;if(u>248)return 231;return Math.round((u-8)/247*24)+232}return 16+36*Math.round(u/255*5)+6*Math.round(F/255*5)+Math.round(E/255*5)},enumerable:!1},hexToRgb:{value(u){let F=/[a-f\d]{6}|[a-f\d]{3}/i.exec(u.toString(16));if(!F)return[0,0,0];let[E]=F;if(E.length===3)E=[...E].map((_)=>_+_).join("");let B=Number.parseInt(E,16);return[B>>16&255,B>>8&255,B&255]},enumerable:!1},hexToAnsi256:{value:(u)=>Q.rgbToAnsi256(...Q.hexToRgb(u)),enumerable:!1},ansi256ToAnsi:{value(u){if(u<8)return 30+u;if(u<16)return 90+(u-8);let F,E,B;if(u>=232)F=((u-232)*10+8)/255,E=F,B=F;else{u-=16;let C=u%36;F=Math.floor(u/36)/5,E=Math.floor(C/6)/5,B=C%6/5}let _=Math.max(F,E,B)*2;if(_===0)return 30;let A=30+(Math.round(B)<<2|Math.round(E)<<1|Math.round(F));if(_===2)A+=60;return A},enumerable:!1},rgbToAnsi:{value:(u,F,E)=>Q.ansi256ToAnsi(Q.rgbToAnsi256(u,F,E)),enumerable:!1},hexToAnsi:{value:(u)=>Q.ansi256ToAnsi(Q.hexToAnsi256(u)),enumerable:!1}}),Q}var $1=A1(),m=$1;import Cu from"node:process";import w1 from"node:os";import T0 from"node:tty";function k(D,u=globalThis.Deno?globalThis.Deno.args:Cu.argv){let F=D.startsWith("-")?"":D.length===1?"-":"--",E=u.indexOf(F+D),B=u.indexOf("--");return E!==-1&&(B===-1||E<B)}var{env:X}=Cu,bD;if(k("no-color")||k("no-colors")||k("color=false")||k("color=never"))bD=0;else if(k("color")||k("colors")||k("color=true")||k("color=always"))bD=1;function S1(){if("FORCE_COLOR"in X){if(X.FORCE_COLOR==="true")return 1;if(X.FORCE_COLOR==="false")return 0;return X.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(X.FORCE_COLOR,10),3)}}function q1(D){if(D===0)return!1;return{level:D,hasBasic:!0,has256:D>=2,has16m:D>=3}}function z1(D,{streamIsTTY:u,sniffFlags:F=!0}={}){let E=S1();if(E!==void 0)bD=E;let B=F?bD:E;if(B===0)return 0;if(F){if(k("color=16m")||k("color=full")||k("color=truecolor"))return 3;if(k("color=256"))return 2}if("TF_BUILD"in X&&"AGENT_NAME"in X)return 1;if(D&&!u&&B===void 0)return 0;let _=B||0;if(X.TERM==="dumb")return _;if(Cu.platform==="win32"){let A=w1.release().split(".");if(Number(A[0])>=10&&Number(A[2])>=10586)return Number(A[2])>=14931?3:2;return 1}if("CI"in X){if(["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some((A)=>(A in X)))return 3;if(["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some((A)=>(A in X))||X.CI_NAME==="codeship")return 1;return _}if("TEAMCITY_VERSION"in X)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(X.TEAMCITY_VERSION)?1:0;if(X.COLORTERM==="truecolor")return 3;if(X.TERM==="xterm-kitty")return 3;if(X.TERM==="xterm-ghostty")return 3;if(X.TERM==="wezterm")return 3;if("TERM_PROGRAM"in X){let A=Number.parseInt((X.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(X.TERM_PROGRAM){case"iTerm.app":return A>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(X.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(X.TERM))return 1;if("COLORTERM"in X)return 1;return _}function I0(D,u={}){let F=z1(D,{streamIsTTY:D&&D.isTTY,...u});return q1(F)}var r1={stdout:I0({isTTY:T0.isatty(1)}),stderr:I0({isTTY:T0.isatty(2)})},H0=r1;function W0(D,u,F){let E=D.indexOf(u);if(E===-1)return D;let B=u.length,_=0,A="";do A+=D.slice(_,E)+u+F,_=E+B,E=D.indexOf(u,_);while(E!==-1);return A+=D.slice(_),A}function Z0(D,u,F,E){let B=0,_="";do{let A=D[E-1]==="\r";_+=D.slice(B,A?E-1:E)+u+(A?`\r
50
+ `);return this.value={values:E,result:_},super.submit()}}g2.exports=s2});var n2=U((zC,i2)=>{var O6=ED();class m2 extends O6{constructor(D){super({...D,reorder:!1,sort:!0,multiple:!0});this.state.hint=[this.options.hint,"(Use <shift>+<up/down> to sort)"].find(this.isValue.bind(this))}indicator(){return""}async renderChoice(D,u){let F=await super.renderChoice(D,u),E=this.symbols.identicalTo+" ",B=this.index===u&&this.sorting?this.styles.muted(E):" ";if(this.options.drag===!1)B="";if(this.options.numbered===!0)return B+`${u+1} - `+F;return B+F}get selected(){return this.choices}submit(){return this.value=this.choices.map((D)=>D.value),super.submit()}}i2.exports=m2});var a2=U((LC,l2)=>{var N6=JD();class p2 extends N6{constructor(D={}){super(D);if(this.emptyError=D.emptyError||"No items were selected",this.term=process.env.TERM_PROGRAM,!this.options.header){let u=["","4 - Strongly Agree","3 - Agree","2 - Neutral","1 - Disagree","0 - Strongly Disagree",""];u=u.map((F)=>this.styles.muted(F)),this.state.header=u.join(`
51
+ `)}}async toChoices(...D){if(this.createdScales)return!1;this.createdScales=!0;let u=await super.toChoices(...D);for(let F of u)F.scale=x6(5,this.options),F.scaleIdx=2;return u}dispatch(){this.alert()}space(){let D=this.focused,u=D.scale[D.scaleIdx],F=u.selected;return D.scale.forEach((E)=>E.selected=!1),u.selected=!F,this.render()}indicator(){return""}pointer(){return""}separator(){return this.styles.muted(this.symbols.ellipsis)}right(){let D=this.focused;if(D.scaleIdx>=D.scale.length-1)return this.alert();return D.scaleIdx++,this.render()}left(){let D=this.focused;if(D.scaleIdx<=0)return this.alert();return D.scaleIdx--,this.render()}indent(){return" "}async renderChoice(D,u){await this.onChoice(D,u);let F=this.index===u,E=this.term==="Hyper",B=!E?8:9,_=!E?" ":"",A=this.symbols.line.repeat(B),C=" ".repeat(B+(E?0:1)),$=(H)=>(H?this.styles.success("◉"):"◯")+_,w=u+1+".",r=F?this.styles.heading:this.styles.noop,M=await this.resolve(D.message,this.state,D,u),L=this.indent(D),q=L+D.scale.map((H,h)=>$(h===D.scaleIdx)).join(A),I=(H)=>H===D.scaleIdx?r(H):H,T=L+D.scale.map((H,h)=>I(h)).join(C),R=()=>[w,M].filter(Boolean).join(" "),S=()=>[R(),q,T," "].filter(Boolean).join(`
52
+ `);if(F)q=this.styles.cyan(q),T=this.styles.cyan(T);return S()}async renderChoices(){if(this.state.submitted)return"";let D=this.visible.map(async(F,E)=>await this.renderChoice(F,E)),u=await Promise.all(D);if(!u.length)u.push(this.styles.danger("No matching choices"));return u.join(`
53
+ `)}format(){if(this.state.submitted)return this.choices.map((u)=>this.styles.info(u.scaleIdx)).join(", ");return""}async render(){let{submitted:D,size:u}=this.state,F=await this.prefix(),E=await this.separator(),B=await this.message(),_=[F,B,E].filter(Boolean).join(" ");this.state.prompt=_;let A=await this.header(),C=await this.format(),$=await this.error()||await this.hint(),w=await this.renderChoices(),r=await this.footer();if(C||!$)_+=" "+C;if($&&!_.includes($))_+=" "+$;if(D&&!C&&!w&&this.multiple&&this.type!=="form")_+=this.styles.danger(this.emptyError);this.clear(u),this.write([_,A,w,r].filter(Boolean).join(`
54
+ `)),this.restore()}submit(){this.value={};for(let D of this.choices)this.value[D.name]=D.scaleIdx;return this.base.submit.call(this)}}function x6(D,u={}){if(Array.isArray(u.scale))return u.scale.map((E)=>({...E}));let F=[];for(let E=1;E<D+1;E++)F.push({i:E,selected:!1});return F}l2.exports=p2});var e2=U((SC,o2)=>{var f6=nD();class c2 extends f6{async initialize(){await super.initialize(),this.value=this.initial=this.resolve(this.options.initial),this.disabled=this.options.disabled||"no",this.enabled=this.options.enabled||"yes",await this.render()}reset(){this.value=this.initial,this.render()}delete(){this.alert()}toggle(){this.value=!this.value,this.render()}enable(){if(this.value===!0)return this.alert();this.value=!0,this.render()}disable(){if(this.value===!1)return this.alert();this.value=!1,this.render()}up(){this.toggle()}down(){this.toggle()}right(){this.toggle()}left(){this.toggle()}next(){this.toggle()}prev(){this.toggle()}dispatch(D="",u){switch(D.toLowerCase()){case" ":return this.toggle();case"1":case"y":case"t":return this.enable();case"0":case"n":case"f":return this.disable();default:return this.alert()}}format(){let D=(F)=>this.styles.primary.underline(F);return[this.value?this.disabled:D(this.disabled),this.value?D(this.enabled):this.enabled].join(this.styles.muted(" / "))}async render(){let{size:D}=this.state,u=await this.header(),F=await this.prefix(),E=await this.separator(),B=await this.message(),_=await this.format(),A=await this.error()||await this.hint(),C=await this.footer(),$=[F,B,E,_].join(" ");if(this.state.prompt=$,A&&!$.includes(A))$+=" "+A;this.clear(D),this.write([u,$,C].filter(Boolean).join(`
55
+ `)),this.write(this.margin[2]),this.restore()}}o2.exports=c2});var F3=U((TC,u3)=>{var v6=ED();class D3 extends v6{constructor(D){super(D);if(typeof this.options.correctChoice!=="number"||this.options.correctChoice<0)throw Error("Please specify the index of the correct answer from the list of choices")}async toChoices(D,u){let F=await super.toChoices(D,u);if(F.length<2)throw Error("Please give at least two choices to the user");if(this.options.correctChoice>F.length)throw Error("Please specify the index of the correct answer from the list of choices");return F}check(D){return D.index===this.options.correctChoice}async result(D){return{selectedAnswer:D,correctAnswer:this.options.choices[this.options.correctChoice].value,correct:await this.check(this.state)}}}u3.exports=D3});var B3=U((pu)=>{var E3=O(),y=(D,u)=>{E3.defineExport(pu,D,u),E3.defineExport(pu,D.toLowerCase(),u)};y("AutoComplete",()=>aF());y("BasicAuth",()=>B2());y("Confirm",()=>w2());y("Editable",()=>q2());y("Form",()=>iD());y("Input",()=>mu());y("Invisible",()=>W2());y("List",()=>Q2());y("MultiSelect",()=>J2());y("Numeral",()=>iu());y("Password",()=>b2());y("Scale",()=>N2());y("Select",()=>ED());y("Snippet",()=>d2());y("Sort",()=>n2());y("Survey",()=>a2());y("Text",()=>mu());y("Toggle",()=>e2());y("Quiz",()=>F3())});var C3=U((hC,_3)=>{_3.exports={ArrayPrompt:JD(),AuthPrompt:du(),BooleanPrompt:nD(),NumberPrompt:iu(),StringPrompt:MD()}});var w3=U((RC,$3)=>{var A3=a("assert"),au=a("events"),BD=O();class l extends au{constructor(D,u){super();this.options=BD.merge({},D),this.answers={...u}}register(D,u){if(BD.isObject(D)){for(let E of Object.keys(D))this.register(E,D[E]);return this}A3.equal(typeof u,"function","expected a function");let F=D.toLowerCase();if(u.prototype instanceof this.Prompt)this.prompts[F]=u;else this.prompts[F]=u(this.Prompt,this);return this}async prompt(D=[]){for(let u of[].concat(D))try{if(typeof u==="function")u=await u.call(this);await this.ask(BD.merge({},this.options,u))}catch(F){return Promise.reject(F)}return this.answers}async ask(D){if(typeof D==="function")D=await D.call(this);let u=BD.merge({},this.options,D),{type:F,name:E}=D,{set:B,get:_}=BD;if(typeof F==="function")F=await F.call(this,D,this.answers);if(!F)return this.answers[E];if(F==="number")F="numeral";A3(this.prompts[F],`Prompt "${F}" is not registered`);let A=new this.prompts[F](u),C=_(this.answers,E);if(A.state.answers=this.answers,A.enquirer=this,E)A.on("submit",(w)=>{this.emit("answer",E,w,A),B(this.answers,E,w)});let $=A.emit.bind(A);if(A.emit=(...w)=>{return this.emit.call(this,...w),$(...w)},this.emit("prompt",A,this),u.autofill&&C!=null){if(A.value=A.input=C,u.autofill==="show")await A.submit()}else C=A.value=await A.run();return C}use(D){return D.call(this,this),this}set Prompt(D){this._Prompt=D}get Prompt(){return this._Prompt||this.constructor.Prompt}get prompts(){return this.constructor.prompts}static set Prompt(D){this._Prompt=D}static get Prompt(){return this._Prompt||TD()}static get prompts(){return B3()}static get types(){return C3()}static get prompt(){let D=(u,...F)=>{let E=new this(...F),B=E.emit.bind(E);return E.emit=(..._)=>{return D.emit(..._),B(..._)},E.prompt(u)};return BD.mixinEmitter(D,new au),D}}BD.mixinEmitter(l,new au);var lu=l.prompts;for(let D of Object.keys(lu)){let u=D.toLowerCase(),F=(E)=>new lu[D](E).run();if(l.prompt[u]=F,l[u]=F,!l[D])Reflect.defineProperty(l,D,{get:()=>lu[D]})}var jD=(D)=>{BD.defineExport(l,D,()=>l.types[D])};jD("ArrayPrompt");jD("AuthPrompt");jD("BooleanPrompt");jD("NumberPrompt");jD("StringPrompt");$3.exports=l});var L0=RD(z0(),1),{program:rB,createCommand:MB,createArgument:qB,createOption:IB,CommanderError:zB,InvalidArgumentError:LB,InvalidOptionArgumentError:SB,Command:S0,Argument:TB,Option:UB,Help:hB}=L0.default;var T0=(D=0)=>(u)=>`\x1B[${u+D}m`,U0=(D=0)=>(u)=>`\x1B[${38+D};5;${u}m`,h0=(D=0)=>(u,F,E)=>`\x1B[${38+D};2;${u};${F};${E}m`,X={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]}},HB=Object.keys(X.modifier),A1=Object.keys(X.color),$1=Object.keys(X.bgColor),WB=[...A1,...$1];function w1(){let D=new Map;for(let[u,F]of Object.entries(X)){for(let[E,B]of Object.entries(F))X[E]={open:`\x1B[${B[0]}m`,close:`\x1B[${B[1]}m`},F[E]=X[E],D.set(B[0],B[1]);Object.defineProperty(X,u,{value:F,enumerable:!1})}return Object.defineProperty(X,"codes",{value:D,enumerable:!1}),X.color.close="\x1B[39m",X.bgColor.close="\x1B[49m",X.color.ansi=T0(),X.color.ansi256=U0(),X.color.ansi16m=h0(),X.bgColor.ansi=T0(10),X.bgColor.ansi256=U0(10),X.bgColor.ansi16m=h0(10),Object.defineProperties(X,{rgbToAnsi256:{value(u,F,E){if(u===F&&F===E){if(u<8)return 16;if(u>248)return 231;return Math.round((u-8)/247*24)+232}return 16+36*Math.round(u/255*5)+6*Math.round(F/255*5)+Math.round(E/255*5)},enumerable:!1},hexToRgb:{value(u){let F=/[a-f\d]{6}|[a-f\d]{3}/i.exec(u.toString(16));if(!F)return[0,0,0];let[E]=F;if(E.length===3)E=[...E].map((_)=>_+_).join("");let B=Number.parseInt(E,16);return[B>>16&255,B>>8&255,B&255]},enumerable:!1},hexToAnsi256:{value:(u)=>X.rgbToAnsi256(...X.hexToRgb(u)),enumerable:!1},ansi256ToAnsi:{value(u){if(u<8)return 30+u;if(u<16)return 90+(u-8);let F,E,B;if(u>=232)F=((u-232)*10+8)/255,E=F,B=F;else{u-=16;let C=u%36;F=Math.floor(u/36)/5,E=Math.floor(C/6)/5,B=C%6/5}let _=Math.max(F,E,B)*2;if(_===0)return 30;let A=30+(Math.round(B)<<2|Math.round(E)<<1|Math.round(F));if(_===2)A+=60;return A},enumerable:!1},rgbToAnsi:{value:(u,F,E)=>X.ansi256ToAnsi(X.rgbToAnsi256(u,F,E)),enumerable:!1},hexToAnsi:{value:(u)=>X.ansi256ToAnsi(X.hexToAnsi256(u)),enumerable:!1}}),X}var r1=w1(),d=r1;import Au from"node:process";import M1 from"node:os";import R0 from"node:tty";function k(D,u=globalThis.Deno?globalThis.Deno.args:Au.argv){let F=D.startsWith("-")?"":D.length===1?"-":"--",E=u.indexOf(F+D),B=u.indexOf("--");return E!==-1&&(B===-1||E<B)}var{env:Y}=Au,bD;if(k("no-color")||k("no-colors")||k("color=false")||k("color=never"))bD=0;else if(k("color")||k("colors")||k("color=true")||k("color=always"))bD=1;function q1(){if("FORCE_COLOR"in Y){if(Y.FORCE_COLOR==="true")return 1;if(Y.FORCE_COLOR==="false")return 0;return Y.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(Y.FORCE_COLOR,10),3)}}function I1(D){if(D===0)return!1;return{level:D,hasBasic:!0,has256:D>=2,has16m:D>=3}}function z1(D,{streamIsTTY:u,sniffFlags:F=!0}={}){let E=q1();if(E!==void 0)bD=E;let B=F?bD:E;if(B===0)return 0;if(F){if(k("color=16m")||k("color=full")||k("color=truecolor"))return 3;if(k("color=256"))return 2}if("TF_BUILD"in Y&&"AGENT_NAME"in Y)return 1;if(D&&!u&&B===void 0)return 0;let _=B||0;if(Y.TERM==="dumb")return _;if(Au.platform==="win32"){let A=M1.release().split(".");if(Number(A[0])>=10&&Number(A[2])>=10586)return Number(A[2])>=14931?3:2;return 1}if("CI"in Y){if(["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some((A)=>(A in Y)))return 3;if(["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some((A)=>(A in Y))||Y.CI_NAME==="codeship")return 1;return _}if("TEAMCITY_VERSION"in Y)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Y.TEAMCITY_VERSION)?1:0;if(Y.COLORTERM==="truecolor")return 3;if(Y.TERM==="xterm-kitty")return 3;if(Y.TERM==="xterm-ghostty")return 3;if(Y.TERM==="wezterm")return 3;if("TERM_PROGRAM"in Y){let A=Number.parseInt((Y.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Y.TERM_PROGRAM){case"iTerm.app":return A>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(Y.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Y.TERM))return 1;if("COLORTERM"in Y)return 1;return _}function H0(D,u={}){let F=z1(D,{streamIsTTY:D&&D.isTTY,...u});return I1(F)}var L1={stdout:H0({isTTY:R0.isatty(1)}),stderr:H0({isTTY:R0.isatty(2)})},W0=L1;function Z0(D,u,F){let E=D.indexOf(u);if(E===-1)return D;let B=u.length,_=0,A="";do A+=D.slice(_,E)+u+F,_=E+B,E=D.indexOf(u,_);while(E!==-1);return A+=D.slice(_),A}function G0(D,u,F,E){let B=0,_="";do{let A=D[E-1]==="\r";_+=D.slice(B,A?E-1:E)+u+(A?`\r
56
56
  `:`
57
57
  `)+F,B=E+1,E=D.indexOf(`
58
- `,B)}while(E!==-1);return _+=D.slice(B),_}var{stdout:G0,stderr:Q0}=H0,Au=Symbol("GENERATOR"),rD=Symbol("STYLER"),HD=Symbol("IS_EMPTY"),X0=["ansi","ansi","ansi256","ansi16m"],LD=Object.create(null),L1=(D,u={})=>{if(u.level&&!(Number.isInteger(u.level)&&u.level>=0&&u.level<=3))throw Error("The `level` option should be an integer from 0 to 3");let F=G0?G0.level:0;D.level=u.level===void 0?F:u.level};var M1=(D)=>{let u=(...F)=>F.join(" ");return L1(u,D),Object.setPrototypeOf(u,WD.prototype),u};function WD(D){return M1(D)}Object.setPrototypeOf(WD.prototype,Function.prototype);for(let[D,u]of Object.entries(m))LD[D]={get(){let F=yD(this,wu(u.open,u.close,this[rD]),this[HD]);return Object.defineProperty(this,D,{value:F}),F}};LD.visible={get(){let D=yD(this,this[rD],!0);return Object.defineProperty(this,"visible",{value:D}),D}};var $u=(D,u,F,...E)=>{if(D==="rgb"){if(u==="ansi16m")return m[F].ansi16m(...E);if(u==="ansi256")return m[F].ansi256(m.rgbToAnsi256(...E));return m[F].ansi(m.rgbToAnsi(...E))}if(D==="hex")return $u("rgb",u,F,...m.hexToRgb(...E));return m[F][D](...E)},h1=["rgb","hex","ansi256"];for(let D of h1){LD[D]={get(){let{level:F}=this;return function(...E){let B=wu($u(D,X0[F],"color",...E),m.color.close,this[rD]);return yD(this,B,this[HD])}}};let u="bg"+D[0].toUpperCase()+D.slice(1);LD[u]={get(){let{level:F}=this;return function(...E){let B=wu($u(D,X0[F],"bgColor",...E),m.bgColor.close,this[rD]);return yD(this,B,this[HD])}}}}var R1=Object.defineProperties(()=>{},{...LD,level:{enumerable:!0,get(){return this[Au].level},set(D){this[Au].level=D}}}),wu=(D,u,F)=>{let E,B;if(F===void 0)E=D,B=u;else E=F.openAll+D,B=u+F.closeAll;return{open:D,close:u,openAll:E,closeAll:B,parent:F}},yD=(D,u,F)=>{let E=(...B)=>U1(E,B.length===1?""+B[0]:B.join(" "));return Object.setPrototypeOf(E,R1),E[Au]=D,E[rD]=u,E[HD]=F,E},U1=(D,u)=>{if(D.level<=0||!u)return D[HD]?"":u;let F=D[rD];if(F===void 0)return u;let{openAll:E,closeAll:B}=F;if(u.includes("\x1B"))while(F!==void 0)u=W0(u,F.close,F.open),F=F.parent;let _=u.indexOf(`
59
- `);if(_!==-1)u=Z0(u,B,E,_);return E+u+B};Object.defineProperties(WD.prototype,LD);var T1=WD(),VB=WD({level:Q0?Q0.level:0});var r=T1;import vD from"node:process";import O0 from"node:process";import tD from"node:process";var I1=(D,u,F,E)=>{if(F==="length"||F==="prototype")return;if(F==="arguments"||F==="caller")return;let B=Object.getOwnPropertyDescriptor(D,F),_=Object.getOwnPropertyDescriptor(u,F);if(!H1(B,_)&&E)return;Object.defineProperty(D,F,_)},H1=function(D,u){return D===void 0||D.configurable||D.writable===u.writable&&D.enumerable===u.enumerable&&D.configurable===u.configurable&&(D.writable||D.value===u.value)},W1=(D,u)=>{let F=Object.getPrototypeOf(u);if(F===Object.getPrototypeOf(D))return;Object.setPrototypeOf(D,F)},Z1=(D,u)=>`/* Wrapped ${D}*/
60
- ${u}`,G1=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),Q1=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),X1=(D,u,F)=>{let E=F===""?"":`with ${F.trim()}() `,B=Z1.bind(null,E,u.toString());Object.defineProperty(B,"name",Q1);let{writable:_,enumerable:A,configurable:C}=G1;Object.defineProperty(D,"toString",{value:B,writable:_,enumerable:A,configurable:C})};function Su(D,u,{ignoreNonConfigurable:F=!1}={}){let{name:E}=D;for(let B of Reflect.ownKeys(u))I1(D,u,B,F);return W1(D,u),X1(D,u,E),D}var PD=new WeakMap,Y0=(D,u={})=>{if(typeof D!=="function")throw TypeError("Expected a function");let F,E=0,B=D.displayName||D.name||"<anonymous>",_=function(...A){if(PD.set(_,++E),E===1)F=D.apply(this,A),D=void 0;else if(u.throw===!0)throw Error(`Function \`${B}\` can only be called once`);return F};return Su(_,D),PD.set(_,E),_};Y0.callCount=(D)=>{if(!PD.has(D))throw Error(`The given function \`${D.name}\` is not wrapped by the \`onetime\` package`);return PD.get(D)};var J0=Y0;var $D=[];$D.push("SIGHUP","SIGINT","SIGTERM");if(process.platform!=="win32")$D.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")$D.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var OD=(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",qu=Symbol.for("signal-exit emitter"),zu=globalThis,Y1=Object.defineProperty.bind(Object);class j0{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(zu[qu])return zu[qu];Y1(zu,qu,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(D,u){this.listeners[D].push(u)}removeListener(D,u){let F=this.listeners[D],E=F.indexOf(u);if(E===-1)return;if(E===0&&F.length===1)F.length=0;else F.splice(E,1)}emit(D,u,F){if(this.emitted[D])return!1;this.emitted[D]=!0;let E=!1;for(let B of this.listeners[D])E=B(u,F)===!0||E;if(D==="exit")E=this.emit("afterExit",u,F)||E;return E}}class Lu{}var J1=(D)=>{return{onExit(u,F){return D.onExit(u,F)},load(){return D.load()},unload(){return D.unload()}}};class V0 extends Lu{onExit(){return()=>{}}load(){}unload(){}}class K0 extends Lu{#C=ru.platform==="win32"?"SIGINT":"SIGHUP";#F=new j0;#D;#B;#z;#u={};#_=!1;constructor(D){super();this.#D=D,this.#u={};for(let u of $D)this.#u[u]=()=>{let F=this.#D.listeners(u),{count:E}=this.#F,B=D;if(typeof B.__signal_exit_emitter__==="object"&&typeof B.__signal_exit_emitter__.count==="number")E+=B.__signal_exit_emitter__.count;if(F.length===E){this.unload();let _=this.#F.emit("exit",null,u),A=u==="SIGHUP"?this.#C:u;if(!_)D.kill(D.pid,A)}};this.#z=D.reallyExit,this.#B=D.emit}onExit(D,u){if(!OD(this.#D))return()=>{};if(this.#_===!1)this.load();let F=u?.alwaysLast?"afterExit":"exit";return this.#F.on(F,D),()=>{if(this.#F.removeListener(F,D),this.#F.listeners.exit.length===0&&this.#F.listeners.afterExit.length===0)this.unload()}}load(){if(this.#_)return;this.#_=!0,this.#F.count+=1;for(let D of $D)try{let u=this.#u[D];if(u)this.#D.on(D,u)}catch(u){}this.#D.emit=(D,...u)=>{return this.#r(D,...u)},this.#D.reallyExit=(D)=>{return this.#E(D)}}unload(){if(!this.#_)return;this.#_=!1,$D.forEach((D)=>{let u=this.#u[D];if(!u)throw Error("Listener not defined for signal: "+D);try{this.#D.removeListener(D,u)}catch(F){}}),this.#D.emit=this.#B,this.#D.reallyExit=this.#z,this.#F.count-=1}#E(D){if(!OD(this.#D))return 0;return this.#D.exitCode=D||0,this.#F.emit("exit",this.#D.exitCode,null),this.#z.call(this.#D,this.#D.exitCode)}#r(D,...u){let F=this.#B;if(D==="exit"&&OD(this.#D)){if(typeof u[0]==="number")this.#D.exitCode=u[0];let E=F.call(this.#D,D,...u);return this.#F.emit("exit",this.#D.exitCode,null),E}else return F.call(this.#D,D,...u)}}var ru=globalThis.process,{onExit:b0,load:NB,unload:xB}=J1(OD(ru)?new K0(ru):new V0);var y0=tD.stderr.isTTY?tD.stderr:tD.stdout.isTTY?tD.stdout:void 0,j1=y0?J0(()=>{b0(()=>{y0.write("\x1B[?25h")},{alwaysLast:!0})}):()=>{},P0=j1;var ND=!1,MD={};MD.show=(D=O0.stderr)=>{if(!D.isTTY)return;ND=!1,D.write("\x1B[?25h")};MD.hide=(D=O0.stderr)=>{if(!D.isTTY)return;P0(),ND=!0,D.write("\x1B[?25l")};MD.toggle=(D,u)=>{if(D!==void 0)ND=D;if(ND)MD.show(u);else MD.hide(u)};var Mu=MD;var GD=TD(hu(),1);import d from"node:process";function Ru(){if(d.platform!=="win32")return d.env.TERM!=="linux";return Boolean(d.env.CI)||Boolean(d.env.WT_SESSION)||Boolean(d.env.TERMINUS_SUBLIME)||d.env.ConEmuTask==="{cmd::Cmder}"||d.env.TERM_PROGRAM==="Terminus-Sublime"||d.env.TERM_PROGRAM==="vscode"||d.env.TERM==="xterm-256color"||d.env.TERM==="alacritty"||d.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var K1={info:r.blue("ℹ"),success:r.green("✔"),warning:r.yellow("⚠"),error:r.red("✖")},b1={info:r.blue("i"),success:r.green("√"),warning:r.yellow("‼"),error:r.red("×")},y1=Ru()?K1:b1,ZD=y1;function Uu({onlyFirst:D=!1}={}){return new RegExp("(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]",D?void 0:"g")}var P1=Uu();function Tu(D){if(typeof D!=="string")throw TypeError(`Expected a \`string\`, got \`${typeof D}\``);return D.replace(P1,"")}function Iu({onlyFirst:D=!1}={}){return new RegExp("(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]",D?void 0:"g")}var O1=Iu();function Hu(D){if(typeof D!=="string")throw TypeError(`Expected a \`string\`, got \`${typeof D}\``);return D.replace(O1,"")}function v0(D){return D===161||D===164||D===167||D===168||D===170||D===173||D===174||D>=176&&D<=180||D>=182&&D<=186||D>=188&&D<=191||D===198||D===208||D===215||D===216||D>=222&&D<=225||D===230||D>=232&&D<=234||D===236||D===237||D===240||D===242||D===243||D>=247&&D<=250||D===252||D===254||D===257||D===273||D===275||D===283||D===294||D===295||D===299||D>=305&&D<=307||D===312||D>=319&&D<=322||D===324||D>=328&&D<=331||D===333||D===338||D===339||D===358||D===359||D===363||D===462||D===464||D===466||D===468||D===470||D===472||D===474||D===476||D===593||D===609||D===708||D===711||D>=713&&D<=715||D===717||D===720||D>=728&&D<=731||D===733||D===735||D>=768&&D<=879||D>=913&&D<=929||D>=931&&D<=937||D>=945&&D<=961||D>=963&&D<=969||D===1025||D>=1040&&D<=1103||D===1105||D===8208||D>=8211&&D<=8214||D===8216||D===8217||D===8220||D===8221||D>=8224&&D<=8226||D>=8228&&D<=8231||D===8240||D===8242||D===8243||D===8245||D===8251||D===8254||D===8308||D===8319||D>=8321&&D<=8324||D===8364||D===8451||D===8453||D===8457||D===8467||D===8470||D===8481||D===8482||D===8486||D===8491||D===8531||D===8532||D>=8539&&D<=8542||D>=8544&&D<=8555||D>=8560&&D<=8569||D===8585||D>=8592&&D<=8601||D===8632||D===8633||D===8658||D===8660||D===8679||D===8704||D===8706||D===8707||D===8711||D===8712||D===8715||D===8719||D===8721||D===8725||D===8730||D>=8733&&D<=8736||D===8739||D===8741||D>=8743&&D<=8748||D===8750||D>=8756&&D<=8759||D===8764||D===8765||D===8776||D===8780||D===8786||D===8800||D===8801||D>=8804&&D<=8807||D===8810||D===8811||D===8814||D===8815||D===8834||D===8835||D===8838||D===8839||D===8853||D===8857||D===8869||D===8895||D===8978||D>=9312&&D<=9449||D>=9451&&D<=9547||D>=9552&&D<=9587||D>=9600&&D<=9615||D>=9618&&D<=9621||D===9632||D===9633||D>=9635&&D<=9641||D===9650||D===9651||D===9654||D===9655||D===9660||D===9661||D===9664||D===9665||D>=9670&&D<=9672||D===9675||D>=9678&&D<=9681||D>=9698&&D<=9701||D===9711||D===9733||D===9734||D===9737||D===9742||D===9743||D===9756||D===9758||D===9792||D===9794||D===9824||D===9825||D>=9827&&D<=9829||D>=9831&&D<=9834||D===9836||D===9837||D===9839||D===9886||D===9887||D===9919||D>=9926&&D<=9933||D>=9935&&D<=9939||D>=9941&&D<=9953||D===9955||D===9960||D===9961||D>=9963&&D<=9969||D===9972||D>=9974&&D<=9977||D===9979||D===9980||D===9982||D===9983||D===10045||D>=10102&&D<=10111||D>=11094&&D<=11097||D>=12872&&D<=12879||D>=57344&&D<=63743||D>=65024&&D<=65039||D===65533||D>=127232&&D<=127242||D>=127248&&D<=127277||D>=127280&&D<=127337||D>=127344&&D<=127373||D===127375||D===127376||D>=127387&&D<=127404||D>=917760&&D<=917999||D>=983040&&D<=1048573||D>=1048576&&D<=1114109}function f0(D){return D===12288||D>=65281&&D<=65376||D>=65504&&D<=65510}function k0(D){return D>=4352&&D<=4447||D===8986||D===8987||D===9001||D===9002||D>=9193&&D<=9196||D===9200||D===9203||D===9725||D===9726||D===9748||D===9749||D>=9776&&D<=9783||D>=9800&&D<=9811||D===9855||D>=9866&&D<=9871||D===9875||D===9889||D===9898||D===9899||D===9917||D===9918||D===9924||D===9925||D===9934||D===9940||D===9962||D===9970||D===9971||D===9973||D===9978||D===9981||D===9989||D===9994||D===9995||D===10024||D===10060||D===10062||D>=10067&&D<=10069||D===10071||D>=10133&&D<=10135||D===10160||D===10175||D===11035||D===11036||D===11088||D===11093||D>=11904&&D<=11929||D>=11931&&D<=12019||D>=12032&&D<=12245||D>=12272&&D<=12287||D>=12289&&D<=12350||D>=12353&&D<=12438||D>=12441&&D<=12543||D>=12549&&D<=12591||D>=12593&&D<=12686||D>=12688&&D<=12773||D>=12783&&D<=12830||D>=12832&&D<=12871||D>=12880&&D<=42124||D>=42128&&D<=42182||D>=43360&&D<=43388||D>=44032&&D<=55203||D>=63744&&D<=64255||D>=65040&&D<=65049||D>=65072&&D<=65106||D>=65108&&D<=65126||D>=65128&&D<=65131||D>=94176&&D<=94180||D>=94192&&D<=94198||D>=94208&&D<=101589||D>=101631&&D<=101662||D>=101760&&D<=101874||D>=110576&&D<=110579||D>=110581&&D<=110587||D===110589||D===110590||D>=110592&&D<=110882||D===110898||D>=110928&&D<=110930||D===110933||D>=110948&&D<=110951||D>=110960&&D<=111355||D>=119552&&D<=119638||D>=119648&&D<=119670||D===126980||D===127183||D===127374||D>=127377&&D<=127386||D>=127488&&D<=127490||D>=127504&&D<=127547||D>=127552&&D<=127560||D===127568||D===127569||D>=127584&&D<=127589||D>=127744&&D<=127776||D>=127789&&D<=127797||D>=127799&&D<=127868||D>=127870&&D<=127891||D>=127904&&D<=127946||D>=127951&&D<=127955||D>=127968&&D<=127984||D===127988||D>=127992&&D<=128062||D===128064||D>=128066&&D<=128252||D>=128255&&D<=128317||D>=128331&&D<=128334||D>=128336&&D<=128359||D===128378||D===128405||D===128406||D===128420||D>=128507&&D<=128591||D>=128640&&D<=128709||D===128716||D>=128720&&D<=128722||D>=128725&&D<=128728||D>=128732&&D<=128735||D===128747||D===128748||D>=128756&&D<=128764||D>=128992&&D<=129003||D===129008||D>=129292&&D<=129338||D>=129340&&D<=129349||D>=129351&&D<=129535||D>=129648&&D<=129660||D>=129664&&D<=129674||D>=129678&&D<=129734||D===129736||D>=129741&&D<=129756||D>=129759&&D<=129770||D>=129775&&D<=129784||D>=131072&&D<=196605||D>=196608&&D<=262141}function t1(D){if(!Number.isSafeInteger(D))throw TypeError(`Expected a code point, got \`${typeof D}\`.`)}function g0(D,{ambiguousAsWide:u=!1}={}){if(t1(D),f0(D)||k0(D)||u&&v0(D))return 2;return 1}var d0=TD(m0(),1),N1=new Intl.Segmenter,x1=/^\p{Default_Ignorable_Code_Point}$/u;function Wu(D,u={}){if(typeof D!=="string"||D.length===0)return 0;let{ambiguousIsNarrow:F=!0,countAnsiEscapeCodes:E=!1}=u;if(!E)D=Hu(D);if(D.length===0)return 0;let B=0,_={ambiguousAsWide:!F};for(let{segment:A}of N1.segment(D)){let C=A.codePointAt(0);if(C<=31||C>=127&&C<=159)continue;if(C>=8203&&C<=8207||C===65279)continue;if(C>=768&&C<=879||C>=6832&&C<=6911||C>=7616&&C<=7679||C>=8400&&C<=8447||C>=65056&&C<=65071)continue;if(C>=55296&&C<=57343)continue;if(C>=65024&&C<=65039)continue;if(x1.test(A))continue;if(d0.default().test(A)){B+=2;continue}B+=g0(C,_)}return B}function Zu({stream:D=process.stdout}={}){return Boolean(D&&D.isTTY&&process.env.TERM!=="dumb"&&!("CI"in process.env))}import i0 from"node:process";function Gu(){let{env:D}=i0,{TERM:u,TERM_PROGRAM:F}=D;if(i0.platform!=="win32")return u!=="linux";return Boolean(D.WT_SESSION)||Boolean(D.TERMINUS_SUBLIME)||D.ConEmuTask==="{cmd::Cmder}"||F==="Terminus-Sublime"||F==="vscode"||u==="xterm-256color"||u==="alacritty"||u==="rxvt-unicode"||u==="rxvt-unicode-256color"||D.TERMINAL_EMULATOR==="JetBrains-JediTerm"}import n from"node:process";var v1=3;class n0{#C=0;start(){if(this.#C++,this.#C===1)this.#F()}stop(){if(this.#C<=0)throw Error("`stop` called more times than `start`");if(this.#C--,this.#C===0)this.#D()}#F(){if(n.platform==="win32"||!n.stdin.isTTY)return;n.stdin.setRawMode(!0),n.stdin.on("data",this.#B),n.stdin.resume()}#D(){if(!n.stdin.isTTY)return;n.stdin.off("data",this.#B),n.stdin.pause(),n.stdin.setRawMode(!1)}#B(D){if(D[0]===v1)n.emit("SIGINT")}}var f1=new n0,Qu=f1;var k1=TD(hu(),1);class p0{#C=0;#F=!1;#D=0;#B=-1;#z=0;#u;#_;#E;#r;#M;#w;#S;#q;#h;#A;#$;color;constructor(D){if(typeof D==="string")D={text:D};if(this.#u={color:"cyan",stream:vD.stderr,discardStdin:!0,hideCursor:!0,...D},this.color=this.#u.color,this.spinner=this.#u.spinner,this.#M=this.#u.interval,this.#E=this.#u.stream,this.#w=typeof this.#u.isEnabled==="boolean"?this.#u.isEnabled:Zu({stream:this.#E}),this.#S=typeof this.#u.isSilent==="boolean"?this.#u.isSilent:!1,this.text=this.#u.text,this.prefixText=this.#u.prefixText,this.suffixText=this.#u.suffixText,this.indent=this.#u.indent,vD.env.NODE_ENV==="test")this._stream=this.#E,this._isEnabled=this.#w,Object.defineProperty(this,"_linesToClear",{get(){return this.#C},set(u){this.#C=u}}),Object.defineProperty(this,"_frameIndex",{get(){return this.#B}}),Object.defineProperty(this,"_lineCount",{get(){return this.#D}})}get indent(){return this.#q}set indent(D=0){if(!(D>=0&&Number.isInteger(D)))throw Error("The `indent` option must be an integer from 0 and up");this.#q=D,this.#L()}get interval(){return this.#M??this.#_.interval??100}get spinner(){return this.#_}set spinner(D){if(this.#B=-1,this.#M=void 0,typeof D==="object"){if(D.frames===void 0)throw Error("The given spinner must have a `frames` property");this.#_=D}else if(!Gu())this.#_=GD.default.line;else if(D===void 0)this.#_=GD.default.dots;else if(D!=="default"&&GD.default[D])this.#_=GD.default[D];else throw Error(`There is no built-in spinner named '${D}'. See https://github.com/sindresorhus/cli-spinners/blob/main/spinners.json for a full list.`)}get text(){return this.#h}set text(D=""){this.#h=D,this.#L()}get prefixText(){return this.#A}set prefixText(D=""){this.#A=D,this.#L()}get suffixText(){return this.#$}set suffixText(D=""){this.#$=D,this.#L()}get isSpinning(){return this.#r!==void 0}#R(D=this.#A,u=" "){if(typeof D==="string"&&D!=="")return D+u;if(typeof D==="function")return D()+u;return""}#U(D=this.#$,u=" "){if(typeof D==="string"&&D!=="")return u+D;if(typeof D==="function")return u+D();return""}#L(){let D=this.#E.columns??80,u=this.#R(this.#A,"-"),F=this.#U(this.#$,"-"),E=" ".repeat(this.#q)+u+"--"+this.#h+"--"+F;this.#D=0;for(let B of Tu(E).split(`
61
- `))this.#D+=Math.max(1,Math.ceil(Wu(B,{countAnsiEscapeCodes:!0})/D))}get isEnabled(){return this.#w&&!this.#S}set isEnabled(D){if(typeof D!=="boolean")throw TypeError("The `isEnabled` option must be a boolean");this.#w=D}get isSilent(){return this.#S}set isSilent(D){if(typeof D!=="boolean")throw TypeError("The `isSilent` option must be a boolean");this.#S=D}frame(){let D=Date.now();if(this.#B===-1||D-this.#z>=this.interval)this.#B=++this.#B%this.#_.frames.length,this.#z=D;let{frames:u}=this.#_,F=u[this.#B];if(this.color)F=r[this.color](F);let E=typeof this.#A==="string"&&this.#A!==""?this.#A+" ":"",B=typeof this.text==="string"?" "+this.text:"",_=typeof this.#$==="string"&&this.#$!==""?" "+this.#$:"";return E+F+B+_}clear(){if(!this.#w||!this.#E.isTTY)return this;this.#E.cursorTo(0);for(let D=0;D<this.#C;D++){if(D>0)this.#E.moveCursor(0,-1);this.#E.clearLine(1)}if(this.#q||this.lastIndent!==this.#q)this.#E.cursorTo(this.#q);return this.lastIndent=this.#q,this.#C=0,this}render(){if(this.#S)return this;return this.clear(),this.#E.write(this.frame()),this.#C=this.#D,this}start(D){if(D)this.text=D;if(this.#S)return this;if(!this.#w){if(this.text)this.#E.write(`- ${this.text}
62
- `);return this}if(this.isSpinning)return this;if(this.#u.hideCursor)Mu.hide(this.#E);if(this.#u.discardStdin&&vD.stdin.isTTY)this.#F=!0,Qu.start();return this.render(),this.#r=setInterval(this.render.bind(this),this.interval),this}stop(){if(!this.#w)return this;if(clearInterval(this.#r),this.#r=void 0,this.#B=0,this.clear(),this.#u.hideCursor)Mu.show(this.#E);if(this.#u.discardStdin&&vD.stdin.isTTY&&this.#F)Qu.stop(),this.#F=!1;return this}succeed(D){return this.stopAndPersist({symbol:ZD.success,text:D})}fail(D){return this.stopAndPersist({symbol:ZD.error,text:D})}warn(D){return this.stopAndPersist({symbol:ZD.warning,text:D})}info(D){return this.stopAndPersist({symbol:ZD.info,text:D})}stopAndPersist(D={}){if(this.#S)return this;let u=D.prefixText??this.#A,F=this.#R(u," "),E=D.symbol??" ",B=D.text??this.text,A=typeof B==="string"?(E?" ":"")+B:"",C=D.suffixText??this.#$,$=this.#U(C," "),w=F+E+A+$+`
63
- `;return this.stop(),this.#E.write(w),this}}function p(D){return new p0(D)}import SE from"path";async function l0(D,u){let F=await fetch("https://api.compitcom.in/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:D,password:u})});if(!F.ok)throw Error("Invalid credentials");return(await F.json()).data.accessToken}async function g1(D){let u=await fetch("https://api.compitcom.in/api/auth/me",{headers:{Authorization:`Bearer ${D}`}});if(!u.ok)throw Error("Failed to fetch user data");return(await u.json()).data}async function a0(D,u){let F=await fetch(`https://api.compitcom.in/api/workspace/${u}/field-forms/forms?pageSize=100&sortBy=createdAt&sortDirection=desc`,{headers:{Authorization:`Bearer ${D}`}});if(!F.ok)throw Error("Failed to fetch forms");return(await F.json()).items.filter((B)=>B.isActive)}async function c0(D,u,F){let E=await fetch(`https://api.compitcom.in/api/workspace/${u}/field-forms/forms/${F}`,{headers:{Authorization:`Bearer ${D}`}});if(!E.ok)throw Error(`Failed to fetch form details for ${F}`);return await E.json()}async function o0(D){return(await g1(D)).workspaces.filter((F)=>F.role==="ADMIN"&&!F.isFrozen)}async function e0(D,u){let F=await fetch(`https://api.compitcom.in/api/workspace/${u}/public-forms`,{headers:{Authorization:`Bearer ${D}`}});if(!F.ok)throw Error("Failed to fetch public forms");return await F.json()}async function DF(D,u,F){let E=await fetch(`https://api.compitcom.in/api/workspace/${u}/public-forms/${F}`,{headers:{Authorization:`Bearer ${D}`}});if(!E.ok)throw Error(`Failed to fetch public form details for ${F}`);return await E.json()}var w3=TD($3(),1),{prompt:v}=w3.default;async function S3(){return v([{type:"input",name:"email",message:"Enter your email:",validate:(D)=>D.includes("@")?!0:"Please enter a valid email"},{type:"password",name:"password",message:"Enter your password:",validate:(D)=>D.length>0?!0:"Password is required"}])}async function q3(D){return(await v({type:"select",name:"workspaceId",message:"Select a workspace:",choices:D.map((F)=>({name:F.id,message:F.name}))})).workspaceId}async function z3(D){return(await v({type:"input",name:"outputDir",message:"Where should Siteon files be created?",initial:D})).outputDir}async function r3(){return(await v({type:"select",name:"projectType",message:"What type of project is this?",choices:[{name:"framework",message:"Framework (React, Next.js, Vue, Vite, etc.)"},{name:"static",message:"Static (Vanilla HTML/CSS/JS)"}]})).projectType}async function L3(){return(await v({type:"select",name:"framework",message:"Which framework are you using?",choices:[{name:"next",message:"Next.js"},{name:"vite",message:"Vite"},{name:"react",message:"React (Create React App)"},{name:"vue",message:"Vue"},{name:"other",message:"Other"}]})).framework}async function M3(){return(await v({type:"select",name:"language",message:"TypeScript or JavaScript?",choices:[{name:"typescript",message:"TypeScript"},{name:"javascript",message:"JavaScript"}]})).language}async function h3(){return(await v({type:"select",name:"httpClient",message:"Which HTTP client do you want to use?",choices:[{name:"fetch",message:"Fetch (native)"},{name:"axios",message:"Axios"}]})).httpClient}async function R3(){return(await v({type:"select",name:"envVarLocation",message:"Where should configuration variables be stored?",choices:[{name:"env",message:"Environment variables (.env file)"},{name:"config",message:"Config file (siteon/config)"}]})).envVarLocation}async function U3(){return(await v({type:"select",name:"useReactCache",message:"Do you want to use React's cache function for caching? (requires React 18+)",choices:[{name:"no",message:"No"},{name:"yes",message:"Yes"}]})).useReactCache==="yes"}async function T3(D){let u=await v({type:"select",name:"selectionType",message:"Which forms do you want to include?",choices:[{name:"all",message:"All forms"},{name:"select",message:"Select specific forms"},{name:"none",message:"None (skip forms)"}]});if(u.selectionType==="none")return[];if(u.selectionType==="all")return D.map((E)=>E.id);return(await v({type:"multiselect",name:"selectedForms",message:"Select forms to include (space to select, enter to confirm):",choices:D.map((E)=>({name:E.id,message:`${E.name} (${E.slug}) - ${E._count.fields} fields`}))})).selectedForms}async function I3(D){if(D.length===0)return[];let u=await v({type:"select",name:"selectionType",message:`Found ${D.length} public form(s). Which public forms do you want to include?`,choices:[{name:"all",message:"All public forms"},{name:"select",message:"Select specific public forms"},{name:"none",message:"None (skip public forms)"}]});if(u.selectionType==="none")return[];if(u.selectionType==="all")return D.map((E)=>E.id);return(await v({type:"multiselect",name:"selectedForms",message:"Select public forms to include (space to select, enter to confirm):",choices:D.map((E)=>({name:E.id,message:`${E.name} (${E.slug})`}))})).selectedForms}import s from"fs";import jD from"path";function H3(D){let u=jD.join(D,"src");if(s.existsSync(u)&&s.statSync(u).isDirectory())return"src";return"."}function v6(D){if(!s.existsSync(D))s.mkdirSync(D,{recursive:!0})}function t(D,u){let F=jD.dirname(D);v6(F),s.writeFileSync(D,u,"utf-8")}function W3(D){return s.existsSync(D)}function pD(D){try{let u=s.readFileSync(D,"utf-8");return JSON.parse(u)}catch{return null}}function Z3(D,u){let F=u.split(`
64
- `).filter((E)=>E.trim()&&!E.trim().startsWith("#")).map((E)=>{let[B,..._]=E.split("=");return{key:B.trim(),line:E.trim()}});if(s.existsSync(D)){let B=s.readFileSync(D,"utf-8").split(`
58
+ `,B)}while(E!==-1);return _+=D.slice(B),_}var{stdout:Q0,stderr:X0}=W0,$u=Symbol("GENERATOR"),zD=Symbol("STYLER"),WD=Symbol("IS_EMPTY"),Y0=["ansi","ansi","ansi256","ansi16m"],LD=Object.create(null),S1=(D,u={})=>{if(u.level&&!(Number.isInteger(u.level)&&u.level>=0&&u.level<=3))throw Error("The `level` option should be an integer from 0 to 3");let F=Q0?Q0.level:0;D.level=u.level===void 0?F:u.level};var T1=(D)=>{let u=(...F)=>F.join(" ");return S1(u,D),Object.setPrototypeOf(u,ZD.prototype),u};function ZD(D){return T1(D)}Object.setPrototypeOf(ZD.prototype,Function.prototype);for(let[D,u]of Object.entries(d))LD[D]={get(){let F=tD(this,ru(u.open,u.close,this[zD]),this[WD]);return Object.defineProperty(this,D,{value:F}),F}};LD.visible={get(){let D=tD(this,this[zD],!0);return Object.defineProperty(this,"visible",{value:D}),D}};var wu=(D,u,F,...E)=>{if(D==="rgb"){if(u==="ansi16m")return d[F].ansi16m(...E);if(u==="ansi256")return d[F].ansi256(d.rgbToAnsi256(...E));return d[F].ansi(d.rgbToAnsi(...E))}if(D==="hex")return wu("rgb",u,F,...d.hexToRgb(...E));return d[F][D](...E)},U1=["rgb","hex","ansi256"];for(let D of U1){LD[D]={get(){let{level:F}=this;return function(...E){let B=ru(wu(D,Y0[F],"color",...E),d.color.close,this[zD]);return tD(this,B,this[WD])}}};let u="bg"+D[0].toUpperCase()+D.slice(1);LD[u]={get(){let{level:F}=this;return function(...E){let B=ru(wu(D,Y0[F],"bgColor",...E),d.bgColor.close,this[zD]);return tD(this,B,this[WD])}}}}var h1=Object.defineProperties(()=>{},{...LD,level:{enumerable:!0,get(){return this[$u].level},set(D){this[$u].level=D}}}),ru=(D,u,F)=>{let E,B;if(F===void 0)E=D,B=u;else E=F.openAll+D,B=u+F.closeAll;return{open:D,close:u,openAll:E,closeAll:B,parent:F}},tD=(D,u,F)=>{let E=(...B)=>R1(E,B.length===1?""+B[0]:B.join(" "));return Object.setPrototypeOf(E,h1),E[$u]=D,E[zD]=u,E[WD]=F,E},R1=(D,u)=>{if(D.level<=0||!u)return D[WD]?"":u;let F=D[zD];if(F===void 0)return u;let{openAll:E,closeAll:B}=F;if(u.includes("\x1B"))while(F!==void 0)u=Z0(u,F.close,F.open),F=F.parent;let _=u.indexOf(`
59
+ `);if(_!==-1)u=G0(u,B,E,_);return E+u+B};Object.defineProperties(ZD.prototype,LD);var H1=ZD(),yB=ZD({level:X0?X0.level:0});var z=H1;import vD from"node:process";import O0 from"node:process";import ND from"node:process";var W1=(D,u,F,E)=>{if(F==="length"||F==="prototype")return;if(F==="arguments"||F==="caller")return;let B=Object.getOwnPropertyDescriptor(D,F),_=Object.getOwnPropertyDescriptor(u,F);if(!Z1(B,_)&&E)return;Object.defineProperty(D,F,_)},Z1=function(D,u){return D===void 0||D.configurable||D.writable===u.writable&&D.enumerable===u.enumerable&&D.configurable===u.configurable&&(D.writable||D.value===u.value)},G1=(D,u)=>{let F=Object.getPrototypeOf(u);if(F===Object.getPrototypeOf(D))return;Object.setPrototypeOf(D,F)},Q1=(D,u)=>`/* Wrapped ${D}*/
60
+ ${u}`,X1=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),Y1=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),J1=(D,u,F)=>{let E=F===""?"":`with ${F.trim()}() `,B=Q1.bind(null,E,u.toString());Object.defineProperty(B,"name",Y1);let{writable:_,enumerable:A,configurable:C}=X1;Object.defineProperty(D,"toString",{value:B,writable:_,enumerable:A,configurable:C})};function Mu(D,u,{ignoreNonConfigurable:F=!1}={}){let{name:E}=D;for(let B of Reflect.ownKeys(u))W1(D,u,B,F);return G1(D,u),J1(D,u,E),D}var PD=new WeakMap,J0=(D,u={})=>{if(typeof D!=="function")throw TypeError("Expected a function");let F,E=0,B=D.displayName||D.name||"<anonymous>",_=function(...A){if(PD.set(_,++E),E===1)F=D.apply(this,A),D=void 0;else if(u.throw===!0)throw Error(`Function \`${B}\` can only be called once`);return F};return Mu(_,D),PD.set(_,E),_};J0.callCount=(D)=>{if(!PD.has(D))throw Error(`The given function \`${D.name}\` is not wrapped by the \`onetime\` package`);return PD.get(D)};var j0=J0;var $D=[];$D.push("SIGHUP","SIGINT","SIGTERM");if(process.platform!=="win32")$D.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")$D.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var OD=(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",qu=Symbol.for("signal-exit emitter"),Iu=globalThis,j1=Object.defineProperty.bind(Object);class V0{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(Iu[qu])return Iu[qu];j1(Iu,qu,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(D,u){this.listeners[D].push(u)}removeListener(D,u){let F=this.listeners[D],E=F.indexOf(u);if(E===-1)return;if(E===0&&F.length===1)F.length=0;else F.splice(E,1)}emit(D,u,F){if(this.emitted[D])return!1;this.emitted[D]=!0;let E=!1;for(let B of this.listeners[D])E=B(u,F)===!0||E;if(D==="exit")E=this.emit("afterExit",u,F)||E;return E}}class Lu{}var V1=(D)=>{return{onExit(u,F){return D.onExit(u,F)},load(){return D.load()},unload(){return D.unload()}}};class K0 extends Lu{onExit(){return()=>{}}load(){}unload(){}}class y0 extends Lu{#C=zu.platform==="win32"?"SIGINT":"SIGHUP";#F=new V0;#D;#B;#q;#u={};#_=!1;constructor(D){super();this.#D=D,this.#u={};for(let u of $D)this.#u[u]=()=>{let F=this.#D.listeners(u),{count:E}=this.#F,B=D;if(typeof B.__signal_exit_emitter__==="object"&&typeof B.__signal_exit_emitter__.count==="number")E+=B.__signal_exit_emitter__.count;if(F.length===E){this.unload();let _=this.#F.emit("exit",null,u),A=u==="SIGHUP"?this.#C:u;if(!_)D.kill(D.pid,A)}};this.#q=D.reallyExit,this.#B=D.emit}onExit(D,u){if(!OD(this.#D))return()=>{};if(this.#_===!1)this.load();let F=u?.alwaysLast?"afterExit":"exit";return this.#F.on(F,D),()=>{if(this.#F.removeListener(F,D),this.#F.listeners.exit.length===0&&this.#F.listeners.afterExit.length===0)this.unload()}}load(){if(this.#_)return;this.#_=!0,this.#F.count+=1;for(let D of $D)try{let u=this.#u[D];if(u)this.#D.on(D,u)}catch(u){}this.#D.emit=(D,...u)=>{return this.#I(D,...u)},this.#D.reallyExit=(D)=>{return this.#E(D)}}unload(){if(!this.#_)return;this.#_=!1,$D.forEach((D)=>{let u=this.#u[D];if(!u)throw Error("Listener not defined for signal: "+D);try{this.#D.removeListener(D,u)}catch(F){}}),this.#D.emit=this.#B,this.#D.reallyExit=this.#q,this.#F.count-=1}#E(D){if(!OD(this.#D))return 0;return this.#D.exitCode=D||0,this.#F.emit("exit",this.#D.exitCode,null),this.#q.call(this.#D,this.#D.exitCode)}#I(D,...u){let F=this.#B;if(D==="exit"&&OD(this.#D)){if(typeof u[0]==="number")this.#D.exitCode=u[0];let E=F.call(this.#D,D,...u);return this.#F.emit("exit",this.#D.exitCode,null),E}else return F.call(this.#D,D,...u)}}var zu=globalThis.process,{onExit:b0,load:fB,unload:vB}=V1(OD(zu)?new y0(zu):new K0);var t0=ND.stderr.isTTY?ND.stderr:ND.stdout.isTTY?ND.stdout:void 0,K1=t0?j0(()=>{b0(()=>{t0.write("\x1B[?25h")},{alwaysLast:!0})}):()=>{},P0=K1;var xD=!1,SD={};SD.show=(D=O0.stderr)=>{if(!D.isTTY)return;xD=!1,D.write("\x1B[?25h")};SD.hide=(D=O0.stderr)=>{if(!D.isTTY)return;P0(),xD=!0,D.write("\x1B[?25l")};SD.toggle=(D,u)=>{if(D!==void 0)xD=D;if(xD)SD.show(u);else SD.hide(u)};var Su=SD;var QD=RD(Tu(),1);import m from"node:process";function Uu(){if(m.platform!=="win32")return m.env.TERM!=="linux";return Boolean(m.env.CI)||Boolean(m.env.WT_SESSION)||Boolean(m.env.TERMINUS_SUBLIME)||m.env.ConEmuTask==="{cmd::Cmder}"||m.env.TERM_PROGRAM==="Terminus-Sublime"||m.env.TERM_PROGRAM==="vscode"||m.env.TERM==="xterm-256color"||m.env.TERM==="alacritty"||m.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var b1={info:z.blue("ℹ"),success:z.green("✔"),warning:z.yellow("⚠"),error:z.red("✖")},t1={info:z.blue("i"),success:z.green("√"),warning:z.yellow("‼"),error:z.red("×")},P1=Uu()?b1:t1,GD=P1;function hu({onlyFirst:D=!1}={}){return new RegExp("(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]",D?void 0:"g")}var O1=hu();function Ru(D){if(typeof D!=="string")throw TypeError(`Expected a \`string\`, got \`${typeof D}\``);return D.replace(O1,"")}function Hu({onlyFirst:D=!1}={}){return new RegExp("(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]",D?void 0:"g")}var N1=Hu();function Wu(D){if(typeof D!=="string")throw TypeError(`Expected a \`string\`, got \`${typeof D}\``);return D.replace(N1,"")}function v0(D){return D===161||D===164||D===167||D===168||D===170||D===173||D===174||D>=176&&D<=180||D>=182&&D<=186||D>=188&&D<=191||D===198||D===208||D===215||D===216||D>=222&&D<=225||D===230||D>=232&&D<=234||D===236||D===237||D===240||D===242||D===243||D>=247&&D<=250||D===252||D===254||D===257||D===273||D===275||D===283||D===294||D===295||D===299||D>=305&&D<=307||D===312||D>=319&&D<=322||D===324||D>=328&&D<=331||D===333||D===338||D===339||D===358||D===359||D===363||D===462||D===464||D===466||D===468||D===470||D===472||D===474||D===476||D===593||D===609||D===708||D===711||D>=713&&D<=715||D===717||D===720||D>=728&&D<=731||D===733||D===735||D>=768&&D<=879||D>=913&&D<=929||D>=931&&D<=937||D>=945&&D<=961||D>=963&&D<=969||D===1025||D>=1040&&D<=1103||D===1105||D===8208||D>=8211&&D<=8214||D===8216||D===8217||D===8220||D===8221||D>=8224&&D<=8226||D>=8228&&D<=8231||D===8240||D===8242||D===8243||D===8245||D===8251||D===8254||D===8308||D===8319||D>=8321&&D<=8324||D===8364||D===8451||D===8453||D===8457||D===8467||D===8470||D===8481||D===8482||D===8486||D===8491||D===8531||D===8532||D>=8539&&D<=8542||D>=8544&&D<=8555||D>=8560&&D<=8569||D===8585||D>=8592&&D<=8601||D===8632||D===8633||D===8658||D===8660||D===8679||D===8704||D===8706||D===8707||D===8711||D===8712||D===8715||D===8719||D===8721||D===8725||D===8730||D>=8733&&D<=8736||D===8739||D===8741||D>=8743&&D<=8748||D===8750||D>=8756&&D<=8759||D===8764||D===8765||D===8776||D===8780||D===8786||D===8800||D===8801||D>=8804&&D<=8807||D===8810||D===8811||D===8814||D===8815||D===8834||D===8835||D===8838||D===8839||D===8853||D===8857||D===8869||D===8895||D===8978||D>=9312&&D<=9449||D>=9451&&D<=9547||D>=9552&&D<=9587||D>=9600&&D<=9615||D>=9618&&D<=9621||D===9632||D===9633||D>=9635&&D<=9641||D===9650||D===9651||D===9654||D===9655||D===9660||D===9661||D===9664||D===9665||D>=9670&&D<=9672||D===9675||D>=9678&&D<=9681||D>=9698&&D<=9701||D===9711||D===9733||D===9734||D===9737||D===9742||D===9743||D===9756||D===9758||D===9792||D===9794||D===9824||D===9825||D>=9827&&D<=9829||D>=9831&&D<=9834||D===9836||D===9837||D===9839||D===9886||D===9887||D===9919||D>=9926&&D<=9933||D>=9935&&D<=9939||D>=9941&&D<=9953||D===9955||D===9960||D===9961||D>=9963&&D<=9969||D===9972||D>=9974&&D<=9977||D===9979||D===9980||D===9982||D===9983||D===10045||D>=10102&&D<=10111||D>=11094&&D<=11097||D>=12872&&D<=12879||D>=57344&&D<=63743||D>=65024&&D<=65039||D===65533||D>=127232&&D<=127242||D>=127248&&D<=127277||D>=127280&&D<=127337||D>=127344&&D<=127373||D===127375||D===127376||D>=127387&&D<=127404||D>=917760&&D<=917999||D>=983040&&D<=1048573||D>=1048576&&D<=1114109}function k0(D){return D===12288||D>=65281&&D<=65376||D>=65504&&D<=65510}function s0(D){return D>=4352&&D<=4447||D===8986||D===8987||D===9001||D===9002||D>=9193&&D<=9196||D===9200||D===9203||D===9725||D===9726||D===9748||D===9749||D>=9776&&D<=9783||D>=9800&&D<=9811||D===9855||D>=9866&&D<=9871||D===9875||D===9889||D===9898||D===9899||D===9917||D===9918||D===9924||D===9925||D===9934||D===9940||D===9962||D===9970||D===9971||D===9973||D===9978||D===9981||D===9989||D===9994||D===9995||D===10024||D===10060||D===10062||D>=10067&&D<=10069||D===10071||D>=10133&&D<=10135||D===10160||D===10175||D===11035||D===11036||D===11088||D===11093||D>=11904&&D<=11929||D>=11931&&D<=12019||D>=12032&&D<=12245||D>=12272&&D<=12287||D>=12289&&D<=12350||D>=12353&&D<=12438||D>=12441&&D<=12543||D>=12549&&D<=12591||D>=12593&&D<=12686||D>=12688&&D<=12773||D>=12783&&D<=12830||D>=12832&&D<=12871||D>=12880&&D<=42124||D>=42128&&D<=42182||D>=43360&&D<=43388||D>=44032&&D<=55203||D>=63744&&D<=64255||D>=65040&&D<=65049||D>=65072&&D<=65106||D>=65108&&D<=65126||D>=65128&&D<=65131||D>=94176&&D<=94180||D>=94192&&D<=94198||D>=94208&&D<=101589||D>=101631&&D<=101662||D>=101760&&D<=101874||D>=110576&&D<=110579||D>=110581&&D<=110587||D===110589||D===110590||D>=110592&&D<=110882||D===110898||D>=110928&&D<=110930||D===110933||D>=110948&&D<=110951||D>=110960&&D<=111355||D>=119552&&D<=119638||D>=119648&&D<=119670||D===126980||D===127183||D===127374||D>=127377&&D<=127386||D>=127488&&D<=127490||D>=127504&&D<=127547||D>=127552&&D<=127560||D===127568||D===127569||D>=127584&&D<=127589||D>=127744&&D<=127776||D>=127789&&D<=127797||D>=127799&&D<=127868||D>=127870&&D<=127891||D>=127904&&D<=127946||D>=127951&&D<=127955||D>=127968&&D<=127984||D===127988||D>=127992&&D<=128062||D===128064||D>=128066&&D<=128252||D>=128255&&D<=128317||D>=128331&&D<=128334||D>=128336&&D<=128359||D===128378||D===128405||D===128406||D===128420||D>=128507&&D<=128591||D>=128640&&D<=128709||D===128716||D>=128720&&D<=128722||D>=128725&&D<=128728||D>=128732&&D<=128735||D===128747||D===128748||D>=128756&&D<=128764||D>=128992&&D<=129003||D===129008||D>=129292&&D<=129338||D>=129340&&D<=129349||D>=129351&&D<=129535||D>=129648&&D<=129660||D>=129664&&D<=129674||D>=129678&&D<=129734||D===129736||D>=129741&&D<=129756||D>=129759&&D<=129770||D>=129775&&D<=129784||D>=131072&&D<=196605||D>=196608&&D<=262141}function x1(D){if(!Number.isSafeInteger(D))throw TypeError(`Expected a code point, got \`${typeof D}\`.`)}function g0(D,{ambiguousAsWide:u=!1}={}){if(x1(D),k0(D)||s0(D)||u&&v0(D))return 2;return 1}var i0=RD(m0(),1),f1=new Intl.Segmenter,v1=/^\p{Default_Ignorable_Code_Point}$/u;function Zu(D,u={}){if(typeof D!=="string"||D.length===0)return 0;let{ambiguousIsNarrow:F=!0,countAnsiEscapeCodes:E=!1}=u;if(!E)D=Wu(D);if(D.length===0)return 0;let B=0,_={ambiguousAsWide:!F};for(let{segment:A}of f1.segment(D)){let C=A.codePointAt(0);if(C<=31||C>=127&&C<=159)continue;if(C>=8203&&C<=8207||C===65279)continue;if(C>=768&&C<=879||C>=6832&&C<=6911||C>=7616&&C<=7679||C>=8400&&C<=8447||C>=65056&&C<=65071)continue;if(C>=55296&&C<=57343)continue;if(C>=65024&&C<=65039)continue;if(v1.test(A))continue;if(i0.default().test(A)){B+=2;continue}B+=g0(C,_)}return B}function Gu({stream:D=process.stdout}={}){return Boolean(D&&D.isTTY&&process.env.TERM!=="dumb"&&!("CI"in process.env))}import n0 from"node:process";function Qu(){let{env:D}=n0,{TERM:u,TERM_PROGRAM:F}=D;if(n0.platform!=="win32")return u!=="linux";return Boolean(D.WT_SESSION)||Boolean(D.TERMINUS_SUBLIME)||D.ConEmuTask==="{cmd::Cmder}"||F==="Terminus-Sublime"||F==="vscode"||u==="xterm-256color"||u==="alacritty"||u==="rxvt-unicode"||u==="rxvt-unicode-256color"||D.TERMINAL_EMULATOR==="JetBrains-JediTerm"}import n from"node:process";var k1=3;class p0{#C=0;start(){if(this.#C++,this.#C===1)this.#F()}stop(){if(this.#C<=0)throw Error("`stop` called more times than `start`");if(this.#C--,this.#C===0)this.#D()}#F(){if(n.platform==="win32"||!n.stdin.isTTY)return;n.stdin.setRawMode(!0),n.stdin.on("data",this.#B),n.stdin.resume()}#D(){if(!n.stdin.isTTY)return;n.stdin.off("data",this.#B),n.stdin.pause(),n.stdin.setRawMode(!1)}#B(D){if(D[0]===k1)n.emit("SIGINT")}}var s1=new p0,Xu=s1;var g1=RD(Tu(),1);class l0{#C=0;#F=!1;#D=0;#B=-1;#q=0;#u;#_;#E;#I;#L;#w;#r;#M;#S;#A;#$;color;constructor(D){if(typeof D==="string")D={text:D};if(this.#u={color:"cyan",stream:vD.stderr,discardStdin:!0,hideCursor:!0,...D},this.color=this.#u.color,this.spinner=this.#u.spinner,this.#L=this.#u.interval,this.#E=this.#u.stream,this.#w=typeof this.#u.isEnabled==="boolean"?this.#u.isEnabled:Gu({stream:this.#E}),this.#r=typeof this.#u.isSilent==="boolean"?this.#u.isSilent:!1,this.text=this.#u.text,this.prefixText=this.#u.prefixText,this.suffixText=this.#u.suffixText,this.indent=this.#u.indent,vD.env.NODE_ENV==="test")this._stream=this.#E,this._isEnabled=this.#w,Object.defineProperty(this,"_linesToClear",{get(){return this.#C},set(u){this.#C=u}}),Object.defineProperty(this,"_frameIndex",{get(){return this.#B}}),Object.defineProperty(this,"_lineCount",{get(){return this.#D}})}get indent(){return this.#M}set indent(D=0){if(!(D>=0&&Number.isInteger(D)))throw Error("The `indent` option must be an integer from 0 and up");this.#M=D,this.#z()}get interval(){return this.#L??this.#_.interval??100}get spinner(){return this.#_}set spinner(D){if(this.#B=-1,this.#L=void 0,typeof D==="object"){if(D.frames===void 0)throw Error("The given spinner must have a `frames` property");this.#_=D}else if(!Qu())this.#_=QD.default.line;else if(D===void 0)this.#_=QD.default.dots;else if(D!=="default"&&QD.default[D])this.#_=QD.default[D];else throw Error(`There is no built-in spinner named '${D}'. See https://github.com/sindresorhus/cli-spinners/blob/main/spinners.json for a full list.`)}get text(){return this.#S}set text(D=""){this.#S=D,this.#z()}get prefixText(){return this.#A}set prefixText(D=""){this.#A=D,this.#z()}get suffixText(){return this.#$}set suffixText(D=""){this.#$=D,this.#z()}get isSpinning(){return this.#I!==void 0}#T(D=this.#A,u=" "){if(typeof D==="string"&&D!=="")return D+u;if(typeof D==="function")return D()+u;return""}#U(D=this.#$,u=" "){if(typeof D==="string"&&D!=="")return u+D;if(typeof D==="function")return u+D();return""}#z(){let D=this.#E.columns??80,u=this.#T(this.#A,"-"),F=this.#U(this.#$,"-"),E=" ".repeat(this.#M)+u+"--"+this.#S+"--"+F;this.#D=0;for(let B of Ru(E).split(`
61
+ `))this.#D+=Math.max(1,Math.ceil(Zu(B,{countAnsiEscapeCodes:!0})/D))}get isEnabled(){return this.#w&&!this.#r}set isEnabled(D){if(typeof D!=="boolean")throw TypeError("The `isEnabled` option must be a boolean");this.#w=D}get isSilent(){return this.#r}set isSilent(D){if(typeof D!=="boolean")throw TypeError("The `isSilent` option must be a boolean");this.#r=D}frame(){let D=Date.now();if(this.#B===-1||D-this.#q>=this.interval)this.#B=++this.#B%this.#_.frames.length,this.#q=D;let{frames:u}=this.#_,F=u[this.#B];if(this.color)F=z[this.color](F);let E=typeof this.#A==="string"&&this.#A!==""?this.#A+" ":"",B=typeof this.text==="string"?" "+this.text:"",_=typeof this.#$==="string"&&this.#$!==""?" "+this.#$:"";return E+F+B+_}clear(){if(!this.#w||!this.#E.isTTY)return this;this.#E.cursorTo(0);for(let D=0;D<this.#C;D++){if(D>0)this.#E.moveCursor(0,-1);this.#E.clearLine(1)}if(this.#M||this.lastIndent!==this.#M)this.#E.cursorTo(this.#M);return this.lastIndent=this.#M,this.#C=0,this}render(){if(this.#r)return this;return this.clear(),this.#E.write(this.frame()),this.#C=this.#D,this}start(D){if(D)this.text=D;if(this.#r)return this;if(!this.#w){if(this.text)this.#E.write(`- ${this.text}
62
+ `);return this}if(this.isSpinning)return this;if(this.#u.hideCursor)Su.hide(this.#E);if(this.#u.discardStdin&&vD.stdin.isTTY)this.#F=!0,Xu.start();return this.render(),this.#I=setInterval(this.render.bind(this),this.interval),this}stop(){if(!this.#w)return this;if(clearInterval(this.#I),this.#I=void 0,this.#B=0,this.clear(),this.#u.hideCursor)Su.show(this.#E);if(this.#u.discardStdin&&vD.stdin.isTTY&&this.#F)Xu.stop(),this.#F=!1;return this}succeed(D){return this.stopAndPersist({symbol:GD.success,text:D})}fail(D){return this.stopAndPersist({symbol:GD.error,text:D})}warn(D){return this.stopAndPersist({symbol:GD.warning,text:D})}info(D){return this.stopAndPersist({symbol:GD.info,text:D})}stopAndPersist(D={}){if(this.#r)return this;let u=D.prefixText??this.#A,F=this.#T(u," "),E=D.symbol??" ",B=D.text??this.text,A=typeof B==="string"?(E?" ":"")+B:"",C=D.suffixText??this.#$,$=this.#U(C," "),w=F+E+A+$+`
63
+ `;return this.stop(),this.#E.write(w),this}}function p(D){return new l0(D)}import qE from"path";async function a0(D,u){let F=await fetch("https://api.compitcom.in/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:D,password:u})});if(!F.ok)throw Error("Invalid credentials");return(await F.json()).data.accessToken}async function d1(D){let u=await fetch("https://api.compitcom.in/api/auth/me",{headers:{Authorization:`Bearer ${D}`}});if(!u.ok)throw Error("Failed to fetch user data");return(await u.json()).data}async function c0(D,u){let F=await fetch(`https://api.compitcom.in/api/workspace/${u}/field-forms/forms?pageSize=100&sortBy=createdAt&sortDirection=desc`,{headers:{Authorization:`Bearer ${D}`}});if(!F.ok)throw Error("Failed to fetch forms");return(await F.json()).items.filter((B)=>B.isActive)}async function o0(D,u,F){let E=await fetch(`https://api.compitcom.in/api/workspace/${u}/field-forms/forms/${F}`,{headers:{Authorization:`Bearer ${D}`}});if(!E.ok)throw Error(`Failed to fetch form details for ${F}`);return await E.json()}async function e0(D){return(await d1(D)).workspaces.filter((F)=>F.role==="ADMIN"&&!F.isFrozen)}async function DF(D,u){let F=await fetch(`https://api.compitcom.in/api/workspace/${u}/public-forms`,{headers:{Authorization:`Bearer ${D}`}});if(!F.ok)throw Error("Failed to fetch public forms");return await F.json()}async function uF(D,u,F){let E=await fetch(`https://api.compitcom.in/api/workspace/${u}/public-forms/${F}`,{headers:{Authorization:`Bearer ${D}`}});if(!E.ok)throw Error(`Failed to fetch public form details for ${F}`);return await E.json()}var r3=RD(w3(),1),{prompt:f}=r3.default;async function M3(){return f([{type:"input",name:"email",message:"Enter your email:",validate:(D)=>D.includes("@")?!0:"Please enter a valid email"},{type:"password",name:"password",message:"Enter your password:",validate:(D)=>D.length>0?!0:"Password is required"}])}async function q3(D){return(await f({type:"select",name:"workspaceId",message:"Select a workspace:",choices:D.map((F)=>({name:F.id,message:F.name}))})).workspaceId}async function I3(D){return(await f({type:"input",name:"outputDir",message:"Where should Siteon files be created?",initial:D})).outputDir}async function z3(){return(await f({type:"select",name:"projectType",message:"What type of project is this?",choices:[{name:"framework",message:"Framework (React, Next.js, Vue, Vite, etc.)"},{name:"static",message:"Static (Vanilla HTML/CSS/JS)"}]})).projectType}async function L3(){return(await f({type:"select",name:"framework",message:"Which framework are you using?",choices:[{name:"next",message:"Next.js"},{name:"vite",message:"Vite"},{name:"react",message:"React (Create React App)"},{name:"vue",message:"Vue"},{name:"other",message:"Other"}]})).framework}async function S3(){return(await f({type:"select",name:"language",message:"TypeScript or JavaScript?",choices:[{name:"typescript",message:"TypeScript"},{name:"javascript",message:"JavaScript"}]})).language}async function T3(){return(await f({type:"select",name:"httpClient",message:"Which HTTP client do you want to use?",choices:[{name:"fetch",message:"Fetch (native)"},{name:"axios",message:"Axios"}]})).httpClient}async function U3(){return(await f({type:"select",name:"envVarLocation",message:"Where should configuration variables be stored?",choices:[{name:"env",message:"Environment variables (.env file)"},{name:"config",message:"Config file (siteon/config)"}]})).envVarLocation}async function h3(){return(await f({type:"select",name:"useReactCache",message:"Do you want to use React's cache function for caching? (requires React 18+)",choices:[{name:"no",message:"No"},{name:"yes",message:"Yes"}]})).useReactCache==="yes"}async function R3(D){let u=await f({type:"select",name:"selectionType",message:"Which forms do you want to include?",choices:[{name:"all",message:"All forms"},{name:"select",message:"Select specific forms"},{name:"none",message:"None (skip forms)"}]});if(u.selectionType==="none")return[];if(u.selectionType==="all")return D.map((E)=>E.id);return(await f({type:"multiselect",name:"selectedForms",message:"Select forms to include (space to select, enter to confirm):",choices:D.map((E)=>({name:E.id,message:`${E.name} (${E.slug}) - ${E._count.fields} fields`}))})).selectedForms}async function H3(D){if(D.length===0)return[];let u=await f({type:"select",name:"selectionType",message:`Found ${D.length} public form(s). Which public forms do you want to include?`,choices:[{name:"all",message:"All public forms"},{name:"select",message:"Select specific public forms"},{name:"none",message:"None (skip public forms)"}]});if(u.selectionType==="none")return[];if(u.selectionType==="all")return D.map((E)=>E.id);return(await f({type:"multiselect",name:"selectedForms",message:"Select public forms to include (space to select, enter to confirm):",choices:D.map((E)=>({name:E.id,message:`${E.name} (${E.slug})`}))})).selectedForms}import g from"fs";import VD from"path";function W3(D){let u=VD.join(D,"src");if(g.existsSync(u)&&g.statSync(u).isDirectory())return"src";return"."}function k6(D){if(!g.existsSync(D))g.mkdirSync(D,{recursive:!0})}function t(D,u){let F=VD.dirname(D);k6(F),g.writeFileSync(D,u,"utf-8")}function qD(D){return g.existsSync(D)}function lD(D){try{let u=g.readFileSync(D,"utf-8");return JSON.parse(u)}catch{return null}}function Z3(D,u){let F=u.split(`
64
+ `).filter((E)=>E.trim()&&!E.trim().startsWith("#")).map((E)=>{let[B,..._]=E.split("=");return{key:B.trim(),line:E.trim()}});if(g.existsSync(D)){let B=g.readFileSync(D,"utf-8").split(`
65
65
  `),_=new Set(B.filter((C)=>C.trim()&&!C.trim().startsWith("#")).map((C)=>{let[$]=C.split("=");return $.trim()})),A=F.filter((C)=>!_.has(C.key));if(A.length>0){let C=`
66
66
  # Siteon Configuration
67
67
  `+A.map(($)=>$.line).join(`
68
68
  `)+`
69
- `;s.appendFileSync(D,C)}}else s.writeFileSync(D,u,"utf-8")}function e(D){return D.split(/[-_\s]+/).map((u)=>u.charAt(0).toUpperCase()+u.slice(1).toLowerCase()).join("")}function f6(D){let u=e(D);return u.charAt(0).toLowerCase()+u.slice(1)}function f(D){if(!/[-_\s]/.test(D)&&/^[a-z]/.test(D))return D;return f6(D)}function _D(D){return D.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase()}function G3(D){let u=jD.join(D,"package.json"),F=pD(u);if(!F)return null;let E={...F.dependencies,...F.devDependencies};if("next"in E)return"next";if("react"in E)return"react";if("vite"in E)return"vite";if("vue"in E)return"vue";return null}function Q3(D){let u=jD.join(D,"tsconfig.json");return s.existsSync(u)}function X3(D){let u=jD.join(D,"package.json"),F=pD(u);if(!F)return!1;return"axios"in{...F.dependencies}}import{spawn as k6}from"child_process";import UD from"fs";import VD from"path";function au(D){if(UD.existsSync(VD.join(D,"bun.lockb"))||UD.existsSync(VD.join(D,"bun.lock")))return"bun";if(UD.existsSync(VD.join(D,"pnpm-lock.yaml")))return"pnpm";if(UD.existsSync(VD.join(D,"yarn.lock")))return"yarn";return"npm"}function g6(D){let u=VD.join(D,"package.json"),F=new Set;if(UD.existsSync(u))try{let E=JSON.parse(UD.readFileSync(u,"utf-8"));if(E.dependencies)Object.keys(E.dependencies).forEach((B)=>F.add(B));if(E.devDependencies)Object.keys(E.devDependencies).forEach((B)=>F.add(B))}catch{}return F}async function Y3(D,u){let F=g6(D),E=u.filter((A)=>!F.has(A));if(E.length===0)return;let B=au(D),_=B==="yarn"?"add":B==="bun"?"add":"install";return new Promise((A,C)=>{let $=k6(B,[_,...E],{cwd:D,stdio:"inherit",shell:!0});$.on("close",(w)=>{if(w===0)A();else C(Error("Failed to install dependencies"))}),$.on("error",C)})}function J3(D){if(D==="axios")return["axios"];return[]}import Y from"path";import CE from"fs";function lD(D){switch(D){case"next":return"NEXT_PUBLIC_";case"vite":case"vue":return"VITE_";case"react":return"REACT_APP_";default:return""}}function j3(D,u,F,E,B=!1){let _=lD(u),A=u==="vite"||u==="vue",C=`import type { ResponseType, QueryParams, DefaultParams } from './types';
69
+ `;g.appendFileSync(D,C)}}else g.writeFileSync(D,u,"utf-8")}function e(D){return D.split(/[-_\s]+/).map((u)=>u.charAt(0).toUpperCase()+u.slice(1).toLowerCase()).join("")}function s6(D){let u=e(D);return u.charAt(0).toLowerCase()+u.slice(1)}function v(D){if(!/[-_\s]/.test(D)&&/^[a-z]/.test(D))return D;return s6(D)}function _D(D){return D.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase()}function G3(D){let u=VD.join(D,"package.json"),F=lD(u);if(!F)return null;let E={...F.dependencies,...F.devDependencies};if("next"in E)return"next";if("react"in E)return"react";if("vite"in E)return"vite";if("vue"in E)return"vue";return null}function Q3(D){let u=VD.join(D,"tsconfig.json");return g.existsSync(u)}function X3(D){let u=VD.join(D,"package.json"),F=lD(u);if(!F)return!1;return"axios"in{...F.dependencies}}import{spawn as g6}from"child_process";import hD from"fs";import KD from"path";function cu(D){if(hD.existsSync(KD.join(D,"bun.lockb"))||hD.existsSync(KD.join(D,"bun.lock")))return"bun";if(hD.existsSync(KD.join(D,"pnpm-lock.yaml")))return"pnpm";if(hD.existsSync(KD.join(D,"yarn.lock")))return"yarn";return"npm"}function d6(D){let u=KD.join(D,"package.json"),F=new Set;if(hD.existsSync(u))try{let E=JSON.parse(hD.readFileSync(u,"utf-8"));if(E.dependencies)Object.keys(E.dependencies).forEach((B)=>F.add(B));if(E.devDependencies)Object.keys(E.devDependencies).forEach((B)=>F.add(B))}catch{}return F}async function Y3(D,u){let F=d6(D),E=u.filter((A)=>!F.has(A));if(E.length===0)return;let B=cu(D),_=B==="yarn"?"add":B==="bun"?"add":"install";return new Promise((A,C)=>{let $=g6(B,[_,...E],{cwd:D,stdio:"inherit",shell:!0});$.on("close",(w)=>{if(w===0)A();else C(Error("Failed to install dependencies"))}),$.on("error",C)})}function J3(D){if(D==="axios")return["axios"];return[]}import Q from"path";import $E from"fs";function aD(D){switch(D){case"next":return"NEXT_PUBLIC_";case"vite":case"vue":return"VITE_";case"react":return"REACT_APP_";default:return""}}function j3(D,u,F,E,B=!1){let _=aD(u),A=u==="vite"||u==="vue",C=`import type { ResponseType, QueryParams, DefaultParams, MediaType } from './types';
70
70
  `;if(E==="axios")C+=`import axios from 'axios';
71
+ `;if(B)C+=`import { cache } from 'react';
71
72
  `;if(F==="env")C+=`
72
73
  // Configuration (from environment variables)
73
74
  export const SITEON_BASE_URL = ${A?`import.meta.env.${_}SITEON_BASE_URL`:`process.env.${_}SITEON_BASE_URL`} || 'https://api.compitcom.in';
@@ -132,6 +133,25 @@ export async function submitPublicForm(formSlug: string, formData: FormData): Pr
132
133
  }
133
134
  );
134
135
  }
136
+
137
+ // Get Media Functions
138
+ export const getMediaById = ${B?"cache(":""}async (mediaId: string): Promise<MediaType | null> => {
139
+ try {
140
+ const { data } = await axiosInstance.get<MediaType>(
141
+ \`/api/public/media/\${workspaceId}/\${mediaId}\`
142
+ );
143
+ return data;
144
+ } catch {
145
+ return null;
146
+ }
147
+ }${B?")":""};
148
+
149
+ export async function getMediaByIds(mediaIds: string[]): Promise<MediaType[]> {
150
+ const results = await Promise.all(
151
+ mediaIds.map((id) => getMediaById(id))
152
+ );
153
+ return results.filter((media): media is MediaType => media !== null);
154
+ }
135
155
  `;else C+=`// Get Metadata Function
136
156
  export function getMetaData<T, TFields extends string = string>(
137
157
  formSlug: string,
@@ -188,11 +208,36 @@ export async function submitPublicForm(formSlug: string, formData: FormData): Pr
188
208
  throw new Error(\`HTTP error! status: \${response.status}\`);
189
209
  }
190
210
  }
191
- `;return C}function V3(D,u){let F=lD(u);return`# Siteon Configuration
211
+
212
+ // Get Media Functions
213
+ export const getMediaById = ${B?"cache(":""}async (mediaId: string): Promise<MediaType | null> => {
214
+ try {
215
+ const response = await fetch(
216
+ \`\${baseUrl}/api/public/media/\${workspaceId}/\${mediaId}\`
217
+ );
218
+
219
+ if (!response.ok) {
220
+ return null;
221
+ }
222
+
223
+ return response.json();
224
+ } catch {
225
+ return null;
226
+ }
227
+ }${B?")":""};
228
+
229
+ export async function getMediaByIds(mediaIds: string[]): Promise<MediaType[]> {
230
+ const results = await Promise.all(
231
+ mediaIds.map((id) => getMediaById(id))
232
+ );
233
+ return results.filter((media): media is MediaType => media !== null);
234
+ }
235
+ `;return C}function V3(D,u){let F=aD(u);return`# Siteon Configuration
192
236
  ${F}SITEON_BASE_URL=https://api.compitcom.in
193
237
  ${F}SITEON_WORKSPACE_ID=${D}
194
- `}function K3(D,u,F,E,B=!1){let _=lD(u),A=u==="vite"||u==="vue",C="";if(E==="axios")C+=`
238
+ `}function K3(D,u,F,E,B=!1){let _=aD(u),A=u==="vite"||u==="vue",C="";if(E==="axios")C+=`
195
239
  import axios from 'axios';
240
+ `;if(B)C+=`import { cache } from 'react';
196
241
  `;if(F==="env")C+=`// Configuration (from environment variables)
197
242
  export const SITEON_BASE_URL = ${A?`import.meta.env.${_}SITEON_BASE_URL`:`process.env.${_}SITEON_BASE_URL`} || 'https://api.compitcom.in';
198
243
 
@@ -312,6 +357,34 @@ export async function submitPublicForm(formSlug, formData) {
312
357
  }
313
358
  );
314
359
  }
360
+
361
+ /**
362
+ * Gets media by ID
363
+ * @param {string} mediaId - The ID of the media to fetch
364
+ * @returns {Promise<MediaType|null>}
365
+ */
366
+ export const getMediaById = ${B?"cache(":""}async (mediaId) => {
367
+ try {
368
+ const { data } = await axiosInstance.get(
369
+ \`/api/public/media/\${workspaceId}/\${mediaId}\`
370
+ );
371
+ return data;
372
+ } catch {
373
+ return null;
374
+ }
375
+ }${B?")":""};
376
+
377
+ /**
378
+ * Gets multiple media by IDs
379
+ * @param {string[]} mediaIds - Array of media IDs to fetch
380
+ * @returns {Promise<MediaType[]>}
381
+ */
382
+ export async function getMediaByIds(mediaIds) {
383
+ const results = await Promise.all(
384
+ mediaIds.map((id) => getMediaById(id))
385
+ );
386
+ return results.filter((media) => media !== null);
387
+ }
315
388
  `;else C+=`/**
316
389
  * @typedef {Object} PaginationType
317
390
  * @property {number} page
@@ -424,7 +497,40 @@ export async function submitPublicForm(formSlug, formData) {
424
497
  throw new Error(\`HTTP error! status: \${response.status}\`);
425
498
  }
426
499
  }
427
- `;return C}function b3(D){return`
500
+
501
+ /**
502
+ * Gets media by ID
503
+ * @param {string} mediaId - The ID of the media to fetch
504
+ * @returns {Promise<MediaType|null>}
505
+ */
506
+ export const getMediaById = ${B?"cache(":""}async (mediaId) => {
507
+ try {
508
+ const response = await fetch(
509
+ \`\${baseUrl}/api/public/media/\${workspaceId}/\${mediaId}\`
510
+ );
511
+
512
+ if (!response.ok) {
513
+ return null;
514
+ }
515
+
516
+ return response.json();
517
+ } catch {
518
+ return null;
519
+ }
520
+ }${B?")":""};
521
+
522
+ /**
523
+ * Gets multiple media by IDs
524
+ * @param {string[]} mediaIds - Array of media IDs to fetch
525
+ * @returns {Promise<MediaType[]>}
526
+ */
527
+ export async function getMediaByIds(mediaIds) {
528
+ const results = await Promise.all(
529
+ mediaIds.map((id) => getMediaById(id))
530
+ );
531
+ return results.filter((media) => media !== null);
532
+ }
533
+ `;return C}function y3(D){return`
428
534
  // Configuration
429
535
  export const SITEON_BASE_URL = 'https://api.compitcom.in';
430
536
  export const SITEON_WORKSPACE_ID = '${D}';
@@ -577,7 +683,7 @@ export async function submitPublicForm(formSlug, formData) {
577
683
  throw new Error(\`HTTP error! status: \${response.status}\`);
578
684
  }
579
685
  }
580
- `}function y3(){return`export type PaginationType = {
686
+ `}function b3(){return`export type PaginationType = {
581
687
  page: number;
582
688
  pageSize: number;
583
689
  total: number;
@@ -657,7 +763,7 @@ export type DefaultParams = {
657
763
  defaultPageSize?: number;
658
764
  resolveRelations?: boolean;
659
765
  };
660
- `}function P3(){return`/**
766
+ `}function t3(){return`/**
661
767
  * @typedef {Object} PaginationType
662
768
  * @property {number} page
663
769
  * @property {number} pageSize
@@ -695,13 +801,13 @@ export type DefaultParams = {
695
801
  */
696
802
 
697
803
  export { };
698
- `}import O3 from"fs";function t3(D){let u=new Set;if(!O3.existsSync(D))return u;try{let F=O3.readFileSync(D,"utf-8"),E=/export\s+\*\s+from\s+['"]\.\/([^'"]+)['"]/g,B;while((B=E.exec(F))!==null)u.add(B[1])}catch{}return u}function N3(D,u){let F=new Set(D);return u.forEach((E)=>F.add(E)),Array.from(F).sort()}function x3(D,u){let F=D.map((_)=>{return _D(_.slug)}),E=F;if(u){let _=t3(u);E=N3(_,F)}return`
804
+ `}import P3 from"fs";function O3(D){let u=new Set;if(!P3.existsSync(D))return u;try{let F=P3.readFileSync(D,"utf-8"),E=/export\s+\*\s+from\s+['"]\.\/([^'"]+)['"]/g,B;while((B=E.exec(F))!==null)u.add(B[1])}catch{}return u}function N3(D,u){let F=new Set(D);return u.forEach((E)=>F.add(E)),Array.from(F).sort()}function x3(D,u){let F=D.map((_)=>{return _D(_.slug)}),E=F;if(u){let _=O3(u);E=N3(_,F)}return`
699
805
  ${E.map((_)=>`export * from './${_}';`).join(`
700
806
  `)}
701
- `}function v3(D,u){let F=D.map((_)=>{return _D(_.slug)}),E=F;if(u){let _=t3(u);E=N3(_,F)}return`
807
+ `}function f3(D,u){let F=D.map((_)=>{return _D(_.slug)}),E=F;if(u){let _=O3(u);E=N3(_,F)}return`
702
808
  ${E.map((_)=>`export * from './${_}.js';`).join(`
703
809
  `)}
704
- `}function f3(D=!1,u=!1){let F=`
810
+ `}function v3(D=!1,u=!1){let F=`
705
811
  export * from './types';
706
812
 
707
813
  // Re-export core functions
@@ -712,23 +818,18 @@ export {
712
818
  baseUrl,
713
819
  getMetaData,
714
820
  submitPublicForm,
821
+ getMediaById,
822
+ getMediaByIds,
715
823
  } from './siteon';
716
824
 
717
825
  // Re-export media functions`;if(u)F+=`
718
826
  export {
719
- getMediaById,
720
- getMediaByIds,
721
827
  useSiteOnMedia,
722
828
  useSiteOnMedias,
723
829
  } from './media';
724
830
 
725
831
  // Re-export SiteOnImage component
726
832
  export { default as SiteOnImage } from './siteon-image';
727
- `;else F+=`
728
- export {
729
- getMediaById,
730
- getMediaByIds,
731
- } from './media';
732
833
  `;if(F+=`
733
834
  // Re-export all forms
734
835
  export * from './forms';
@@ -743,43 +844,38 @@ export {
743
844
  baseUrl,
744
845
  getMetaData,
745
846
  submitPublicForm,
847
+ getMediaById,
848
+ getMediaByIds,
746
849
  } from './siteon.js';
747
850
 
748
851
  // Re-export media functions`;if(u)F+=`
749
852
  export {
750
- getMediaById,
751
- getMediaByIds,
752
853
  useSiteOnMedia,
753
854
  useSiteOnMedias,
754
855
  } from './media.js';
755
856
 
756
857
  // Re-export SiteOnImage component
757
858
  export { default as SiteOnImage } from './siteon-image.jsx';
758
- `;else F+=`
759
- export {
760
- getMediaById,
761
- getMediaByIds,
762
- } from './media.js';
763
859
  `;if(F+=`
764
860
  // Re-export all forms
765
861
  export * from './forms/index.js';
766
862
  `,D)F+=`
767
863
  // Re-export all public forms
768
864
  export * from './public-forms/index.js';
769
- `;return F}function g3(D){let{type:u,properties:F}=D;switch(u){case"text":case"email":case"textarea":case"url":case"richtext":case"date":case"time":case"datetime":return"string";case"int":case"float":return"number";case"select":case"radio":if(F.options&&F.options.length>0)return F.options.map((B)=>`'${B}'`).join(" | ");return"string";case"checkbox":if(F.options&&F.options.length>0)return`(${F.options.map((B)=>`'${B}'`).join(" | ")})[]`;return"string[]";case"media":case"image":case"video":return"string[]";case"relation":if(F.isArray)return"string[]";return"string";case"repeator":return`{ value: ${s6(F)} }[]`;default:return"unknown"}}function s6(D){switch(D.childType){case"text":case"email":case"textarea":case"url":case"richtext":case"date":case"time":case"datetime":return"string";case"int":case"float":return"number";case"media":case"image":case"video":return"string[]";default:return"string"}}function s3(D){let{type:u,properties:F}=D;switch(u){case"text":case"email":case"textarea":case"url":case"richtext":case"date":case"time":case"datetime":return"string";case"int":case"float":return"number";case"select":case"radio":if(F.options&&F.options.length>0)return F.options.map((E)=>`"${E}"`).join("|");return"string";case"checkbox":return"string[]";case"media":case"image":case"video":return"string[]";case"relation":return F.isArray?"any[]":"any";case"repeator":return"Array<{value: *}>";default:return"*"}}function m3(D,u,F){let E=e(D.name),B=E.endsWith("s")?E.slice(0,-1):E,_=D.slug,C=D.fields.map((I)=>I.slug).map((I)=>`'${I}'`).join(" | "),$=D.fields.filter((I)=>I.type==="relation"),w=new Map,S=[];$.forEach((I)=>{if(I.relationTargetForm&&I.relationTargetFormId){let h=e(I.relationTargetForm.name);if(F?.some((T)=>T.id===I.relationTargetFormId)){if(!w.has(I.relationTargetFormId)){let T=_D(I.relationTargetForm.slug);w.set(I.relationTargetFormId,`import type { ${h}DataType } from './${T}'`)}}else{let T=`${h}DataType`;S.push(`// Inline type for ${h} (not in selected forms)
770
- type ${T} = any;`)}}});let q=Array.from(w.values()),M=D.fields.find((I)=>I.slug==="slug"||I.slug.endsWith("-slug")),z=M?M.slug:"slug",L="";if(u)L+=`import { cache } from 'react';
771
- `;if(L+=`import { getMetaData } from '../siteon';
865
+ `;return F}function s3(D){let{type:u,properties:F}=D;switch(u){case"text":case"email":case"textarea":case"url":case"richtext":case"date":case"time":case"datetime":return"string";case"int":case"float":return"number";case"select":case"radio":if(F.options&&F.options.length>0)return F.options.map((B)=>`'${B}'`).join(" | ");return"string";case"checkbox":if(F.options&&F.options.length>0)return`(${F.options.map((B)=>`'${B}'`).join(" | ")})[]`;return"string[]";case"media":case"image":case"video":return"string[]";case"relation":if(F.isArray)return"string[]";return"string";case"repeator":return`{ value: ${m6(F)} }[]`;default:return"unknown"}}function m6(D){switch(D.childType){case"text":case"email":case"textarea":case"url":case"richtext":case"date":case"time":case"datetime":return"string";case"int":case"float":return"number";case"media":case"image":case"video":return"string[]";default:return"string"}}function g3(D){let{type:u,properties:F}=D;switch(u){case"text":case"email":case"textarea":case"url":case"richtext":case"date":case"time":case"datetime":return"string";case"int":case"float":return"number";case"select":case"radio":if(F.options&&F.options.length>0)return F.options.map((E)=>`"${E}"`).join("|");return"string";case"checkbox":return"string[]";case"media":case"image":case"video":return"string[]";case"relation":return F.isArray?"any[]":"any";case"repeator":return"Array<{value: *}>";default:return"*"}}function d3(D,u,F){let E=e(D.slug),B=E.endsWith("s")?E.slice(0,-1):E,_=D.slug,C=D.fields.map((R)=>R.slug).map((R)=>`'${R}'`).join(" | "),$=D.fields.filter((R)=>R.type==="relation"),w=new Map,r=[];$.forEach((R)=>{if(R.relationTargetForm&&R.relationTargetFormId){let S=e(R.relationTargetForm.slug);if(F?.some((h)=>h.id===R.relationTargetFormId)){if(!w.has(R.relationTargetFormId)){let h=_D(R.relationTargetForm.slug);w.set(R.relationTargetFormId,`import type { ${S}DataType } from './${h}'`)}}else{let h=`${S}DataType`;r.push(`// Inline type for ${S} (not in selected forms)
866
+ type ${h} = any;`)}}});let M=Array.from(w.values()),L=D.fields.find((R)=>R.slug==="slug"||R.slug.endsWith("-slug")),q=L?L.slug:"slug",I="";if(u)I+=`import { cache } from 'react';
867
+ `;if(I+=`import { getMetaData } from '../siteon';
772
868
  import type { ResponseDataType } from '../types';
773
- `,q.length>0)L+=q.join(`;
869
+ `,M.length>0)I+=M.join(`;
774
870
  `)+`;
775
- `;if(L+=`
776
- `,S.length>0)L+=S.join(`
871
+ `;if(I+=`
872
+ `,r.length>0)I+=r.join(`
777
873
 
778
874
  `)+`
779
875
 
780
- `;let R=D.fields.map((I)=>{let h=I.slug,T=/[^a-zA-Z0-9_$]/.test(h)?`"${h}"`:h,W=!I.isRequired?"?":"";if(I.type==="relation"&&I.relationTargetForm){let G=`${e(I.relationTargetForm.name)}DataType`;if(I.properties.isArray)return` ${T}${W}: string[] | (${G} & { id: string })[];`;else return` ${T}${W}: string | (${G} & { id: string });`}else{let J=g3(I);return` ${T}${W}: ${J};`}}).join(`
781
- `);if(L+=`export type ${E}DataType = {
782
- ${R}
876
+ `;let T=D.fields.map((R)=>{let S=R.slug,h=/[^a-zA-Z0-9_$]/.test(S)?`"${S}"`:S,W=!R.isRequired?"?":"";if(R.type==="relation"&&R.relationTargetForm){let G=`${e(R.relationTargetForm.slug)}DataType`;if(R.properties.isArray)return` ${h}${W}: string[] | (${G} & { id: string })[];`;else return` ${h}${W}: string | (${G} & { id: string });`}else{let J=s3(R);return` ${h}${W}: ${J};`}}).join(`
877
+ `);if(I+=`export type ${E}DataType = {
878
+ ${T}
783
879
  };
784
880
 
785
881
  export type ${E}Fields = ${C};
@@ -787,27 +883,27 @@ export type ${E}Fields = ${C};
787
883
  export type ${E}Type = ResponseDataType<${E}DataType>;
788
884
 
789
885
  export const getAll${E} = getMetaData<${E}DataType, ${E}Fields>('${_}');
790
- `,M)if(u)L+=`
886
+ `,L)if(u)I+=`
791
887
  export const get${B}BySlug = cache(async (slug: string, resolveRelations?: boolean) => {
792
888
  const { data } = await getAll${E}({
793
889
  page: 1,
794
890
  pageSize: 1,
795
- filters: { 'data.${z}': { equals: slug } },
891
+ filters: { 'data.${q}': { equals: slug } },
796
892
  resolveRelations,
797
893
  });
798
894
  return data.length > 0 ? data[0] : null;
799
895
  });
800
- `;else L+=`
896
+ `;else I+=`
801
897
  export async function get${B}BySlug(slug: string, resolveRelations?: boolean) {
802
898
  const { data } = await getAll${E}({
803
899
  page: 1,
804
900
  pageSize: 1,
805
- filters: { 'data.${z}': { equals: slug } },
901
+ filters: { 'data.${q}': { equals: slug } },
806
902
  resolveRelations,
807
903
  });
808
904
  return data.length > 0 ? data[0] : null;
809
905
  }
810
- `;if(u)L+=`
906
+ `;if(u)I+=`
811
907
  export const get${B}ById = cache(async (id: string, resolveRelations?: boolean) => {
812
908
  const { data } = await getAll${E}({
813
909
  page: 1,
@@ -817,7 +913,7 @@ export const get${B}ById = cache(async (id: string, resolveRelations?: boolean)
817
913
  });
818
914
  return data.length > 0 ? data[0] : null;
819
915
  });
820
- `;else L+=`
916
+ `;else I+=`
821
917
  export async function get${B}ById(id: string, resolveRelations?: boolean) {
822
918
  const { data } = await getAll${E}({
823
919
  page: 1,
@@ -827,9 +923,9 @@ export async function get${B}ById(id: string, resolveRelations?: boolean) {
827
923
  });
828
924
  return data.length > 0 ? data[0] : null;
829
925
  }
830
- `;return L}function cu(D,u,F){let E=e(D.name),B=E.endsWith("s")?E.slice(0,-1):E,_=D.slug,A=D.fields.map((q)=>q.slug),C=D.fields.map((q)=>{let M=q.slug,z=s3(q),L=!q.isRequired?"[":"",R=!q.isRequired?"]":"";return` * @property {${z}} ${L}${M}${R}`}).join(`
831
- `),$=D.fields.find((q)=>q.slug==="slug"||q.slug.endsWith("-slug")),w=$?$.slug:"slug",S="";if(u)S+=`import { cache } from 'react';
832
- `;if(S+=`import { getMetaData } from '../siteon.js';
926
+ `;return I}function ou(D,u,F){let E=e(D.slug),B=E.endsWith("s")?E.slice(0,-1):E,_=D.slug,A=D.fields.map((M)=>M.slug),C=D.fields.map((M)=>{let L=M.slug,q=g3(M),I=!M.isRequired?"[":"",T=!M.isRequired?"]":"";return` * @property {${q}} ${I}${L}${T}`}).join(`
927
+ `),$=D.fields.find((M)=>M.slug==="slug"||M.slug.endsWith("-slug")),w=$?$.slug:"slug",r="";if(u)r+=`import { cache } from 'react';
928
+ `;if(r+=`import { getMetaData } from '../siteon.js';
833
929
 
834
930
  /**
835
931
  * @typedef {Object} ${E}DataType
@@ -839,7 +935,7 @@ ${C}
839
935
  /** @typedef {import('../types.js').ResponseDataType<${E}DataType>} ${E}Type */
840
936
 
841
937
  /**
842
- * @typedef {'id' | 'order' | 'submittedAt' | 'updatedAt' | ${A.map((q)=>`'data.${q}'`).join(" | ")}} ${E}FilterField
938
+ * @typedef {'id' | 'order' | 'submittedAt' | 'updatedAt' | ${A.map((M)=>`'data.${M}'`).join(" | ")}} ${E}FilterField
843
939
  */
844
940
 
845
941
  /**
@@ -882,7 +978,7 @@ ${C}
882
978
  * @type {(params?: ${E}QueryParams) => Promise<import('../types.js').ResponseType<${E}DataType>>}
883
979
  */
884
980
  export const getAll${E} = getMetaData('${_}');
885
- `,$)if(u)S+=`
981
+ `,$)if(u)r+=`
886
982
  /**
887
983
  * @param {string} slug
888
984
  * @param {boolean} [resolveRelations]
@@ -897,7 +993,7 @@ export const get${B}BySlug = cache(async (slug, resolveRelations) => {
897
993
  });
898
994
  return data.length > 0 ? data[0] : null;
899
995
  });
900
- `;else S+=`
996
+ `;else r+=`
901
997
  /**
902
998
  * @param {string} slug
903
999
  * @param {boolean} [resolveRelations]
@@ -912,7 +1008,7 @@ export async function get${B}BySlug(slug, resolveRelations) {
912
1008
  });
913
1009
  return data.length > 0 ? data[0] : null;
914
1010
  }
915
- `;if(u)S+=`
1011
+ `;if(u)r+=`
916
1012
  /**
917
1013
  * @param {string} id
918
1014
  * @param {boolean} [resolveRelations]
@@ -927,7 +1023,7 @@ export const get${B}ById = cache(async (id, resolveRelations) => {
927
1023
  });
928
1024
  return data.length > 0 ? data[0] : null;
929
1025
  });
930
- `;else S+=`
1026
+ `;else r+=`
931
1027
  /**
932
1028
  * @param {string} id
933
1029
  * @param {boolean} [resolveRelations]
@@ -942,8 +1038,8 @@ export async function get${B}ById(id, resolveRelations) {
942
1038
  });
943
1039
  return data.length > 0 ? data[0] : null;
944
1040
  }
945
- `;return S}function d3(D,u){return cu(D,!1,u)}import i3 from"fs";function l3(D,u=" | "){switch(D.type){case"TEXT":case"EMAIL":case"TEXTAREA":case"PHONE":return"string";case"NUMBER":return"number";case"SELECT":try{let F=JSON.parse(D.options||"[]");if(F.length>0)return F.map((E)=>`'${E}'`).join(u)}catch{}return"string";case"MULTI_SELECT":try{let F=JSON.parse(D.options||"[]");if(F.length>0)return`(${F.map((E)=>`'${E}'`).join(u)})[]`}catch{}return"string[]";case"FILE":if(D.maxFileCount&&D.maxFileCount>1)return"File[]";return"File";default:return"string"}}function n3(D){return l3(D," | ")}function p3(D){return l3(D,"|")}function a3(D){let u=e(D.name),F=D.fields.filter((C)=>C.type!=="FILE"),E=D.fields.filter((C)=>C.type==="FILE"),B=F.map((C)=>{let $=f(C.key),w=n3(C),S=!C.required?"?":"";return` ${$}${S}: ${w};`}).join(`
946
- `),_=E.map((C)=>{let $=f(C.key),w=n3(C),S=!C.required?"?":"";return` ${$}${S}: ${w};`}).join(`
1041
+ `;return r}function m3(D,u){return ou(D,!1,u)}import i3 from"fs";function l3(D,u=" | "){switch(D.type){case"TEXT":case"EMAIL":case"TEXTAREA":case"PHONE":return"string";case"NUMBER":return"number";case"SELECT":try{let F=JSON.parse(D.options||"[]");if(F.length>0)return F.map((E)=>`'${E}'`).join(u)}catch{}return"string";case"MULTI_SELECT":try{let F=JSON.parse(D.options||"[]");if(F.length>0)return`(${F.map((E)=>`'${E}'`).join(u)})[]`}catch{}return"string[]";case"FILE":if(D.maxFileCount&&D.maxFileCount>1)return"File[]";return"File";default:return"string"}}function n3(D){return l3(D," | ")}function p3(D){return l3(D,"|")}function a3(D){let u=e(D.slug),F=D.fields.filter((C)=>C.type!=="FILE"),E=D.fields.filter((C)=>C.type==="FILE"),B=F.map((C)=>{let $=v(C.key),w=n3(C),r=!C.required?"?":"";return` ${$}${r}: ${w};`}).join(`
1042
+ `),_=E.map((C)=>{let $=v(C.key),w=n3(C),r=!C.required?"?":"";return` ${$}${r}: ${w};`}).join(`
947
1043
  `),A=`import { submitPublicForm } from '../siteon';
948
1044
 
949
1045
  `;if(B)A+=`export type ${u}FormData = {
@@ -959,10 +1055,10 @@ ${_}
959
1055
  message: string;
960
1056
  };
961
1057
 
962
- `,A+=m6(D,u),A+=d6(D,u,F,E),A}function m6(D,u){let F=D.fields.filter((A)=>A.type!=="FILE"),E=D.fields.filter((A)=>A.type==="FILE"),B="";if(F.length>0&&E.length>0)B=`formData: ${u}FormData, files: ${u}Files`;else if(F.length>0)B=`formData: ${u}FormData`;else if(E.length>0)B=`files: ${u}Files`;let _=`export function validate${u}(${B}): ${u}ValidationError[] {
1058
+ `,A+=i6(D,u),A+=n6(D,u,F,E),A}function i6(D,u){let F=D.fields.filter((A)=>A.type!=="FILE"),E=D.fields.filter((A)=>A.type==="FILE"),B="";if(F.length>0&&E.length>0)B=`formData: ${u}FormData, files: ${u}Files`;else if(F.length>0)B=`formData: ${u}FormData`;else if(E.length>0)B=`files: ${u}Files`;let _=`export function validate${u}(${B}): ${u}ValidationError[] {
963
1059
  const errors: ${u}ValidationError[] = [];
964
1060
 
965
- `;for(let A of F){let C=f(A.key);if(A.required)if(A.type==="MULTI_SELECT")_+=` if (!formData.${C} || formData.${C}.length === 0) {
1061
+ `;for(let A of F){let C=v(A.key);if(A.required)if(A.type==="MULTI_SELECT")_+=` if (!formData.${C} || formData.${C}.length === 0) {
966
1062
  errors.push({ field: '${C}', message: '${A.label} is required' });
967
1063
  }
968
1064
 
@@ -970,11 +1066,11 @@ ${_}
970
1066
  errors.push({ field: '${C}', message: '${A.label} is required' });
971
1067
  }
972
1068
 
973
- `;if(A.type==="SELECT")try{let $=JSON.parse(A.options||"[]");if($.length>0){let w=$.map((S)=>`'${S}'`).join(", ");_+=` if (formData.${C} && ![${w}].includes(formData.${C})) {
1069
+ `;if(A.type==="SELECT")try{let $=JSON.parse(A.options||"[]");if($.length>0){let w=$.map((r)=>`'${r}'`).join(", ");_+=` if (formData.${C} && ![${w}].includes(formData.${C})) {
974
1070
  errors.push({ field: '${C}', message: '${A.label} must be one of the valid options' });
975
1071
  }
976
1072
 
977
- `}}catch{}if(A.type==="MULTI_SELECT")try{let $=JSON.parse(A.options||"[]");if($.length>0){let w=$.map((S)=>`'${S}'`).join(", ");_+=` if (formData.${C} && !formData.${C}.every((v) => [${w}].includes(v))) {
1073
+ `}}catch{}if(A.type==="MULTI_SELECT")try{let $=JSON.parse(A.options||"[]");if($.length>0){let w=$.map((r)=>`'${r}'`).join(", ");_+=` if (formData.${C} && !formData.${C}.every((v) => [${w}].includes(v))) {
978
1074
  errors.push({ field: '${C}', message: '${A.label} must contain only valid options' });
979
1075
  }
980
1076
 
@@ -986,7 +1082,7 @@ ${_}
986
1082
  errors.push({ field: '${C}', message: '${A.label} must be a valid phone number' });
987
1083
  }
988
1084
 
989
- `}for(let A of E){let C=f(A.key),$=A.maxFileCount||1,w=A.maxFileSizeBytes;if(A.required)if($>1)_+=` if (!files.${C} || files.${C}.length === 0) {
1085
+ `}for(let A of E){let C=v(A.key),$=A.maxFileCount||1,w=A.maxFileSizeBytes;if(A.required)if($>1)_+=` if (!files.${C} || files.${C}.length === 0) {
990
1086
  errors.push({ field: '${C}', message: '${A.label} is required' });
991
1087
  }
992
1088
 
@@ -998,23 +1094,23 @@ ${_}
998
1094
  errors.push({ field: '${C}', message: '${A.label} cannot have more than ${$} files' });
999
1095
  }
1000
1096
 
1001
- `;if(w){let S=Math.round(w/1048576*100)/100;if($>1)_+=` if (files.${C}) {
1097
+ `;if(w){let r=Math.round(w/1048576*100)/100;if($>1)_+=` if (files.${C}) {
1002
1098
  for (const file of files.${C}) {
1003
1099
  if (file.size > ${w}) {
1004
- errors.push({ field: '${C}', message: 'Each file in ${A.label} must be less than ${S}MB' });
1100
+ errors.push({ field: '${C}', message: 'Each file in ${A.label} must be less than ${r}MB' });
1005
1101
  break;
1006
1102
  }
1007
1103
  }
1008
1104
  }
1009
1105
 
1010
1106
  `;else _+=` if (files.${C} && files.${C}.size > ${w}) {
1011
- errors.push({ field: '${C}', message: '${A.label} must be less than ${S}MB' });
1107
+ errors.push({ field: '${C}', message: '${A.label} must be less than ${r}MB' });
1012
1108
  }
1013
1109
 
1014
1110
  `}}return _+=` return errors;
1015
1111
  }
1016
1112
 
1017
- `,_}function d6(D,u,F,E){let B="";if(F.length>0&&E.length>0)B=`formData: ${u}FormData, files: ${u}Files`;else if(F.length>0)B=`formData: ${u}FormData`;else if(E.length>0)B=`files: ${u}Files`;let _=`export async function submit${u}(${B}): Promise<void> {
1113
+ `,_}function n6(D,u,F,E){let B="";if(F.length>0&&E.length>0)B=`formData: ${u}FormData, files: ${u}Files`;else if(F.length>0)B=`formData: ${u}FormData`;else if(E.length>0)B=`files: ${u}Files`;let _=`export async function submit${u}(${B}): Promise<void> {
1018
1114
  // Validate before submitting
1019
1115
  const errors = validate${u}(${F.length>0&&E.length>0?"formData, files":F.length>0?"formData":"files"});
1020
1116
  if (errors.length > 0) {
@@ -1023,7 +1119,7 @@ ${_}
1023
1119
 
1024
1120
  const form = new FormData();
1025
1121
 
1026
- `;for(let A of F){let C=f(A.key),$=A.key;if(A.required)if(A.type==="MULTI_SELECT")_+=` for (const value of formData.${C}) {
1122
+ `;for(let A of F){let C=v(A.key),$=A.key;if(A.required)if(A.type==="MULTI_SELECT")_+=` for (const value of formData.${C}) {
1027
1123
  form.append('${$}', value);
1028
1124
  }
1029
1125
  `;else if(A.type==="NUMBER")_+=` form.append('${$}', String(formData.${C}));
@@ -1039,7 +1135,7 @@ ${_}
1039
1135
  `;else _+=` if (formData.${C}) {
1040
1136
  form.append('${$}', formData.${C});
1041
1137
  }
1042
- `}for(let A of E){let C=f(A.key),$=A.key;if((A.maxFileCount||1)>1)if(A.required)_+=` for (const file of files.${C}) {
1138
+ `}for(let A of E){let C=v(A.key),$=A.key;if((A.maxFileCount||1)>1)if(A.required)_+=` for (const file of files.${C}) {
1043
1139
  form.append('${$}', file);
1044
1140
  }
1045
1141
  `;else _+=` if (files.${C}) {
@@ -1054,8 +1150,8 @@ ${_}
1054
1150
  `}return _+=`
1055
1151
  await submitPublicForm('${D.slug}', form);
1056
1152
  }
1057
- `,_}function c3(D){let u=e(D.name),F=D.fields.filter((C)=>C.type!=="FILE"),E=D.fields.filter((C)=>C.type==="FILE"),B=F.map((C)=>{let $=f(C.key),w=p3(C),S=!C.required?"[":"",q=!C.required?"]":"";return` * @property {${w}} ${S}${$}${q}`}).join(`
1058
- `),_=E.map((C)=>{let $=f(C.key),w=p3(C),S=!C.required?"[":"",q=!C.required?"]":"";return` * @property {${w}} ${S}${$}${q}`}).join(`
1153
+ `,_}function c3(D){let u=e(D.slug),F=D.fields.filter((C)=>C.type!=="FILE"),E=D.fields.filter((C)=>C.type==="FILE"),B=F.map((C)=>{let $=v(C.key),w=p3(C),r=!C.required?"[":"",M=!C.required?"]":"";return` * @property {${w}} ${r}${$}${M}`}).join(`
1154
+ `),_=E.map((C)=>{let $=v(C.key),w=p3(C),r=!C.required?"[":"",M=!C.required?"]":"";return` * @property {${w}} ${r}${$}${M}`}).join(`
1059
1155
  `),A=`import { submitPublicForm } from '../siteon.js';
1060
1156
 
1061
1157
  `;if(B)A+=`/**
@@ -1074,7 +1170,7 @@ ${_}
1074
1170
  * @property {string} message
1075
1171
  */
1076
1172
 
1077
- `,A+=i6(D,u),A+=n6(D,u,F,E),A}function i6(D,u){let F=D.fields.filter((C)=>C.type!=="FILE"),E=D.fields.filter((C)=>C.type==="FILE"),B="";if(F.length>0&&E.length>0)B="formData, files";else if(F.length>0)B="formData";else if(E.length>0)B="files";let _="";if(F.length>0)_+=` * @param {${u}FormData} formData
1173
+ `,A+=p6(D,u),A+=l6(D,u,F,E),A}function p6(D,u){let F=D.fields.filter((C)=>C.type!=="FILE"),E=D.fields.filter((C)=>C.type==="FILE"),B="";if(F.length>0&&E.length>0)B="formData, files";else if(F.length>0)B="formData";else if(E.length>0)B="files";let _="";if(F.length>0)_+=` * @param {${u}FormData} formData
1078
1174
  `;if(E.length>0)_+=` * @param {${u}Files} files
1079
1175
  `;let A=`/**
1080
1176
  * Validates ${u} form data
@@ -1083,7 +1179,7 @@ ${_} * @returns {${u}ValidationError[]}
1083
1179
  export function validate${u}(${B}) {
1084
1180
  const errors = [];
1085
1181
 
1086
- `;for(let C of F){let $=f(C.key);if(C.required)if(C.type==="MULTI_SELECT")A+=` if (!formData.${$} || formData.${$}.length === 0) {
1182
+ `;for(let C of F){let $=v(C.key);if(C.required)if(C.type==="MULTI_SELECT")A+=` if (!formData.${$} || formData.${$}.length === 0) {
1087
1183
  errors.push({ field: '${$}', message: '${C.label} is required' });
1088
1184
  }
1089
1185
 
@@ -1091,11 +1187,11 @@ export function validate${u}(${B}) {
1091
1187
  errors.push({ field: '${$}', message: '${C.label} is required' });
1092
1188
  }
1093
1189
 
1094
- `;if(C.type==="SELECT")try{let w=JSON.parse(C.options||"[]");if(w.length>0){let S=w.map((q)=>`'${q}'`).join(", ");A+=` if (formData.${$} && ![${S}].includes(formData.${$})) {
1190
+ `;if(C.type==="SELECT")try{let w=JSON.parse(C.options||"[]");if(w.length>0){let r=w.map((M)=>`'${M}'`).join(", ");A+=` if (formData.${$} && ![${r}].includes(formData.${$})) {
1095
1191
  errors.push({ field: '${$}', message: '${C.label} must be one of the valid options' });
1096
1192
  }
1097
1193
 
1098
- `}}catch{}if(C.type==="MULTI_SELECT")try{let w=JSON.parse(C.options||"[]");if(w.length>0){let S=w.map((q)=>`'${q}'`).join(", ");A+=` if (formData.${$} && !formData.${$}.every((v) => [${S}].includes(v))) {
1194
+ `}}catch{}if(C.type==="MULTI_SELECT")try{let w=JSON.parse(C.options||"[]");if(w.length>0){let r=w.map((M)=>`'${M}'`).join(", ");A+=` if (formData.${$} && !formData.${$}.every((v) => [${r}].includes(v))) {
1099
1195
  errors.push({ field: '${$}', message: '${C.label} must contain only valid options' });
1100
1196
  }
1101
1197
 
@@ -1107,7 +1203,7 @@ export function validate${u}(${B}) {
1107
1203
  errors.push({ field: '${$}', message: '${C.label} must be a valid phone number' });
1108
1204
  }
1109
1205
 
1110
- `}for(let C of E){let $=f(C.key),w=C.maxFileCount||1,S=C.maxFileSizeBytes;if(C.required)if(w>1)A+=` if (!files.${$} || files.${$}.length === 0) {
1206
+ `}for(let C of E){let $=v(C.key),w=C.maxFileCount||1,r=C.maxFileSizeBytes;if(C.required)if(w>1)A+=` if (!files.${$} || files.${$}.length === 0) {
1111
1207
  errors.push({ field: '${$}', message: '${C.label} is required' });
1112
1208
  }
1113
1209
 
@@ -1119,23 +1215,23 @@ export function validate${u}(${B}) {
1119
1215
  errors.push({ field: '${$}', message: '${C.label} cannot have more than ${w} files' });
1120
1216
  }
1121
1217
 
1122
- `;if(S){let q=Math.round(S/1048576*100)/100;if(w>1)A+=` if (files.${$}) {
1218
+ `;if(r){let M=Math.round(r/1048576*100)/100;if(w>1)A+=` if (files.${$}) {
1123
1219
  for (const file of files.${$}) {
1124
- if (file.size > ${S}) {
1125
- errors.push({ field: '${$}', message: 'Each file in ${C.label} must be less than ${q}MB' });
1220
+ if (file.size > ${r}) {
1221
+ errors.push({ field: '${$}', message: 'Each file in ${C.label} must be less than ${M}MB' });
1126
1222
  break;
1127
1223
  }
1128
1224
  }
1129
1225
  }
1130
1226
 
1131
- `;else A+=` if (files.${$} && files.${$}.size > ${S}) {
1132
- errors.push({ field: '${$}', message: '${C.label} must be less than ${q}MB' });
1227
+ `;else A+=` if (files.${$} && files.${$}.size > ${r}) {
1228
+ errors.push({ field: '${$}', message: '${C.label} must be less than ${M}MB' });
1133
1229
  }
1134
1230
 
1135
1231
  `}}return A+=` return errors;
1136
1232
  }
1137
1233
 
1138
- `,A}function n6(D,u,F,E){let B="",_="";if(F.length>0&&E.length>0)B="formData, files",_=` * @param {${u}FormData} formData
1234
+ `,A}function l6(D,u,F,E){let B="",_="";if(F.length>0&&E.length>0)B="formData, files",_=` * @param {${u}FormData} formData
1139
1235
  * @param {${u}Files} files
1140
1236
  `;else if(F.length>0)B="formData",_=` * @param {${u}FormData} formData
1141
1237
  `;else if(E.length>0)B="files",_=` * @param {${u}Files} files
@@ -1152,7 +1248,7 @@ export async function submit${u}(${B}) {
1152
1248
 
1153
1249
  const form = new FormData();
1154
1250
 
1155
- `;for(let C of F){let $=f(C.key),w=C.key;if(C.required)if(C.type==="MULTI_SELECT")A+=` for (const value of formData.${$}) {
1251
+ `;for(let C of F){let $=v(C.key),w=C.key;if(C.required)if(C.type==="MULTI_SELECT")A+=` for (const value of formData.${$}) {
1156
1252
  form.append('${w}', value);
1157
1253
  }
1158
1254
  `;else if(C.type==="NUMBER")A+=` form.append('${w}', String(formData.${$}));
@@ -1168,7 +1264,7 @@ export async function submit${u}(${B}) {
1168
1264
  `;else A+=` if (formData.${$}) {
1169
1265
  form.append('${w}', formData.${$});
1170
1266
  }
1171
- `}for(let C of E){let $=f(C.key),w=C.key;if((C.maxFileCount||1)>1)if(C.required)A+=` for (const file of files.${$}) {
1267
+ `}for(let C of E){let $=v(C.key),w=C.key;if((C.maxFileCount||1)>1)if(C.required)A+=` for (const file of files.${$}) {
1172
1268
  form.append('${w}', file);
1173
1269
  }
1174
1270
  `;else A+=` if (files.${$}) {
@@ -1189,51 +1285,14 @@ ${E.map((_)=>`export * from './${_}';`).join(`
1189
1285
  `}function uE(D,u){let F=D.map((_)=>_.slug),E=F;if(u){let _=o3(u);E=e3(_,F)}return`
1190
1286
  ${E.map((_)=>`export * from './${_}.js';`).join(`
1191
1287
  `)}
1192
- `}function FE(D){let{httpClient:u,framework:F,useReactCache:E,hasReactQuery:B}=D,_=F==="next"||F==="react",A="";if(E||_){let C=[];if(E)C.push("cache");if(_&&!B)C.push("useState","useEffect");if(C.length>0)A+=`import { ${C.join(", ")} } from 'react';
1193
- `}if(_&&B)A+=`import { useQuery, useQueries } from '@tanstack/react-query';
1194
- `;if(A+=`import type { MediaType } from './types';
1195
- `,u==="axios")A+=`import { axiosInstance, workspaceId } from './siteon';
1288
+ `}function FE(D){let{framework:u,hasReactQuery:F}=D,E=u==="next"||u==="react",B=u==="next",_="";if(B&&E)_+=`"use client"
1196
1289
 
1197
- `;else A+=`import { baseUrl, workspaceId } from './siteon';
1290
+ `;if(E&&!F)_+=`import { useState, useEffect } from 'react';
1291
+ `;if(E&&F)_+=`import { useQuery, useQueries } from '@tanstack/react-query';
1292
+ `;if(_+=`import type { MediaType } from './types';
1293
+ `,_+=`import { getMediaById, getMediaByIds } from './siteon';
1198
1294
 
1199
- `;if(u==="axios")A+=`// Get Media Functions
1200
- export const getMediaById = ${E?"cache(":""}async (mediaId: string): Promise<MediaType | null> => {
1201
- try {
1202
- const { data } = await axiosInstance.get<MediaType>(
1203
- \`/api/public/media/\${workspaceId}/\${mediaId}\`
1204
- );
1205
- return data;
1206
- } catch {
1207
- return null;
1208
- }
1209
- }${E?")":""};
1210
-
1211
- `;else A+=`// Get Media Functions
1212
- export const getMediaById = ${E?"cache(":""}async (mediaId: string): Promise<MediaType | null> => {
1213
- try {
1214
- const response = await fetch(
1215
- \`\${baseUrl}/api/public/media/\${workspaceId}/\${mediaId}\`
1216
- );
1217
-
1218
- if (!response.ok) {
1219
- return null;
1220
- }
1221
-
1222
- return response.json();
1223
- } catch {
1224
- return null;
1225
- }
1226
- }${E?")":""};
1227
-
1228
- `;if(A+=`export async function getMediaByIds(mediaIds: string[]): Promise<MediaType[]> {
1229
- const results = await Promise.all(
1230
- mediaIds.map((id) => getMediaById(id))
1231
- );
1232
- return results.filter((media): media is MediaType => media !== null);
1233
- }
1234
- `,_)if(A+=`
1235
- // React Hooks for Media
1236
- `,B)A+=`export function useSiteOnMedia(image: string) {
1295
+ `,E)if(F)_+=`export function useSiteOnMedia(image: string) {
1237
1296
  return useQuery({
1238
1297
  queryKey: ['siteon-image', image],
1239
1298
  queryFn: () => getMediaById(image),
@@ -1248,7 +1307,7 @@ export function useSiteOnMedias(images: string[]) {
1248
1307
  })),
1249
1308
  });
1250
1309
  }
1251
- `;else A+=`export function useSiteOnMedia(mediaId: string) {
1310
+ `;else _+=`export function useSiteOnMedia(mediaId: string) {
1252
1311
  const [isLoading, setIsLoading] = useState(true);
1253
1312
  const [data, setData] = useState<MediaType | null>(null);
1254
1313
 
@@ -1273,50 +1332,13 @@ export function useSiteOnMedias(mediaIds: string[]) {
1273
1332
 
1274
1333
  return { isLoading, images };
1275
1334
  }
1276
- `;return A}function EE(D){let{httpClient:u,framework:F,useReactCache:E,hasReactQuery:B}=D,_=F==="next"||F==="react",A="";if(E||_){let C=[];if(E)C.push("cache");if(_&&!B)C.push("useState","useEffect");if(C.length>0)A+=`import { ${C.join(", ")} } from 'react';
1277
- `}if(_&&B)A+=`import { useQuery, useQueries } from '@tanstack/react-query';
1278
- `;if(u==="axios")A+=`import { axiosInstance, workspaceId } from './siteon.js';
1335
+ `;return _}function EE(D){let{framework:u,hasReactQuery:F}=D,E=u==="next"||u==="react",B=u==="next",_="";if(B&&E)_+=`"use client"
1279
1336
 
1280
- `;else A+=`import { baseUrl, workspaceId } from './siteon.js';
1337
+ `;if(E&&!F)_+=`import { useState, useEffect } from 'react';
1338
+ `;if(E&&F)_+=`import { useQuery, useQueries } from '@tanstack/react-query';
1339
+ `;if(_+=`import { getMediaById, getMediaByIds } from './siteon.js';
1281
1340
 
1282
- `;if(u==="axios")A+=`// Get Media Functions
1283
- export const getMediaById = ${E?"cache(":""}async (mediaId) => {
1284
- try {
1285
- const { data } = await axiosInstance.get(
1286
- \`/api/public/media/\${workspaceId}/\${mediaId}\`
1287
- );
1288
- return data;
1289
- } catch {
1290
- return null;
1291
- }
1292
- }${E?")":""};
1293
-
1294
- `;else A+=`// Get Media Functions
1295
- export const getMediaById = ${E?"cache(":""}async (mediaId) => {
1296
- try {
1297
- const response = await fetch(
1298
- \`\${baseUrl}/api/public/media/\${workspaceId}/\${mediaId}\`
1299
- );
1300
-
1301
- if (!response.ok) {
1302
- return null;
1303
- }
1304
-
1305
- return response.json();
1306
- } catch {
1307
- return null;
1308
- }
1309
- }${E?")":""};
1310
-
1311
- `;if(A+=`export async function getMediaByIds(mediaIds) {
1312
- const results = await Promise.all(
1313
- mediaIds.map((id) => getMediaById(id))
1314
- );
1315
- return results.filter((media) => media !== null);
1316
- }
1317
- `,_)if(A+=`
1318
- // React Hooks for Media
1319
- `,B)A+=`export function useSiteOnMedia(image) {
1341
+ `,E)if(F)_+=`export function useSiteOnMedia(image) {
1320
1342
  return useQuery({
1321
1343
  queryKey: ['siteon-image', image],
1322
1344
  queryFn: () => getMediaById(image),
@@ -1331,7 +1353,7 @@ export function useSiteOnMedias(images) {
1331
1353
  })),
1332
1354
  });
1333
1355
  }
1334
- `;else A+=`export function useSiteOnMedia(mediaId) {
1356
+ `;else _+=`export function useSiteOnMedia(mediaId) {
1335
1357
  const [isLoading, setIsLoading] = useState(true);
1336
1358
  const [data, setData] = useState(null);
1337
1359
 
@@ -1356,7 +1378,9 @@ export function useSiteOnMedias(mediaIds) {
1356
1378
 
1357
1379
  return { isLoading, images };
1358
1380
  }
1359
- `;return A}function BE(D){if(D==="next")return`import Image, { ImageProps } from "next/image";
1381
+ `;return _}function BE(D){if(D==="next")return`"use client"
1382
+
1383
+ import Image, { ImageProps } from "next/image";
1360
1384
  import { useSiteOnMedia } from "./media";
1361
1385
 
1362
1386
  interface DynamicImageProps extends Omit<ImageProps, 'src' | 'alt'> {
@@ -1391,7 +1415,9 @@ export default function SiteOnImage({
1391
1415
  />
1392
1416
  );
1393
1417
  }
1394
- `;return`import { ImgHTMLAttributes } from "react";
1418
+ `;return`"use client"
1419
+
1420
+ import { ImgHTMLAttributes } from "react";
1395
1421
  import { useSiteOnMedia } from "./media";
1396
1422
 
1397
1423
  interface DynamicImageProps extends Omit<ImgHTMLAttributes<HTMLImageElement>, 'src' | 'alt'> {
@@ -1429,7 +1455,9 @@ export default function SiteOnImage({
1429
1455
  />
1430
1456
  );
1431
1457
  }
1432
- `}function _E(D){if(D==="next")return`import Image from "next/image";
1458
+ `}function _E(D){if(D==="next")return`"use client"
1459
+
1460
+ import Image from "next/image";
1433
1461
  import { useSiteOnMedia } from "./media.js";
1434
1462
 
1435
1463
  export default function SiteOnImage({
@@ -1457,7 +1485,9 @@ export default function SiteOnImage({
1457
1485
  />
1458
1486
  );
1459
1487
  }
1460
- `;return`import { useSiteOnMedia } from "./media.js";
1488
+ `;return`"use client"
1489
+
1490
+ import { useSiteOnMedia } from "./media.js";
1461
1491
 
1462
1492
  export default function SiteOnImage({
1463
1493
  mediaId,
@@ -1487,43 +1517,199 @@ export default function SiteOnImage({
1487
1517
  />
1488
1518
  );
1489
1519
  }
1490
- `}function AE(D){let u=Y.join(D,"package.json");if(!CE.existsSync(u))return!1;try{let F=JSON.parse(CE.readFileSync(u,"utf-8"));return"@tanstack/react-query"in{...F.dependencies,...F.devDependencies}}catch{return!1}}function $E(D,u){let{workspaceId:F,outputDir:E,projectType:B,language:_,httpClient:A,framework:C,envVarLocation:$,useReactCache:w,selectedForms:S,selectedPublicForms:q}=u,M=Y.join(D,E,"siteon"),z=Y.join(M,"forms"),L=Y.join(M,"public-forms"),R=[],I=B==="static"?"js":_==="typescript"?"ts":"js";if(B==="static")p6(M,u,R,I);else if(_==="typescript")l6(M,u,R);else a6(M,u,R);for(let j of S){let x=`${_D(j.slug)}.${I}`,y=Y.join(z,x),Z;if(B==="static")Z=d3(j,S);else if(_==="typescript")Z=m3(j,w,S);else Z=cu(j,w,S);t(y,Z),R.push(y)}let h=Y.join(z,`index.${I}`),H=_==="typescript"?x3(S,h):v3(S,h);if(t(h,H),R.push(h),q&&q.length>0){for(let y of q){let Z=`${_D(y.slug)}.${I}`,K=Y.join(L,Z),DD=_==="typescript"?a3(y):c3(y);t(K,DD),R.push(K)}let j=Y.join(L,`index.${I}`),x=_==="typescript"?DE(q,j):uE(q,j);t(j,x),R.push(j)}let T=B==="framework"&&(C==="next"||C==="react"),W=Y.join(M,`index.${I}`),J=_==="typescript"?f3(q?.length>0,T):k3(q?.length>0,T);t(W,J),R.push(W);let G={workspaceId:F,baseUrl:"https://api.compitcom.in",outputDir:E,projectType:B,language:B!=="static"?_:void 0,httpClient:B!=="static"?A:void 0,framework:B!=="static"?C:void 0,envVarLocation:B!=="static"?$:void 0,useReactCache:B!=="static"?w:void 0,forms:S.map((j)=>j.slug),publicForms:q?.map((j)=>j.slug)||[],createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()},zD=Y.join(D,"siteon.config.json");if(t(zD,JSON.stringify(G,null,2)),R.push(zD),B==="framework"&&$==="env"){let j=V3(F,C),x=Y.join(D,".env");Z3(x,j),R.push(x)}return{filesCreated:R,config:G}}function p6(D,u,F,E){let{workspaceId:B}=u,_=Y.join(D,`siteon.${E}`);t(_,b3(B)),F.push(_);let A=Y.join(D,`types.${E}`);t(A,P3()),F.push(A)}function l6(D,u,F){let{workspaceId:E,httpClient:B,framework:_,envVarLocation:A,useReactCache:C}=u,$=_==="next"||_==="react",w=Y.join(D,"siteon.ts");t(w,j3(E,_,A,B,C)),F.push(w);let S=Y.join(D,"types.ts");t(S,y3()),F.push(S);let q=Y.join(D,"media.ts"),M=AE(Y.dirname(Y.dirname(D)));if(t(q,FE({httpClient:B,framework:_,useReactCache:C,hasReactQuery:M})),F.push(q),$){let z=Y.join(D,"siteon-image.tsx");t(z,BE(_)),F.push(z)}}function a6(D,u,F){let{workspaceId:E,httpClient:B,framework:_,envVarLocation:A,useReactCache:C}=u,$=_==="next"||_==="react",w=Y.join(D,"siteon.js");t(w,K3(E,_,A,B,C)),F.push(w);let S=Y.join(D,"media.js"),q=AE(Y.dirname(Y.dirname(D)));if(t(S,EE({httpClient:B,framework:_,useReactCache:C,hasReactQuery:q})),F.push(S),$){let M=Y.join(D,"siteon-image.jsx");t(M,_E(_)),F.push(M)}}var wE={name:"siteon-registry",version:"1.4.2",description:"CLI tool to generate type-safe API clients for Siteon workspaces",type:"module",scripts:{build:"bun build src/index.ts --outdir dist --target node --format esm --minify && bun postbuild.js",dev:"bun --watch src/index.ts"},keywords:["siteon","cli","forms","api-client"],author:"Compitcom",license:"PRIVATE",repository:{type:"git",url:"git+https://github.com/compitcom/siteon-registry.git"},dependencies:{chalk:"^5.3.0",commander:"^12.1.0",enquirer:"^2.4.1",ora:"^8.0.1"},devDependencies:{"@types/bun":"^1.1.0","@types/node":"^20.11.0",typescript:"^5.3.3"},engines:{node:">=18"}};function aD(){return wE.version}async function qE(){o6(aD());let D=process.cwd(),u=SE.join(D,"siteon.config.json"),F=W3(u)?pD(u):null;if(F){if(console.log(r.yellow("\uD83D\uDCCB Found existing siteon.config.json")),console.log(r.gray(` Workspace ID: ${F.workspaceId}`)),console.log(r.gray(` Output Dir: ${F.outputDir}`)),console.log(r.gray(` Project Type: ${F.projectType}`)),console.log(r.gray(` Forms: ${F.forms.join(", ")}`)),F.publicForms&&F.publicForms.length>0)console.log(r.gray(` Public Forms: ${F.publicForms.join(", ")}`));console.log("")}try{let{email:E,password:B}=await S3(),_=p("Authenticating...").start(),A;try{A=await l0(E,B),_.succeed("Authenticated successfully")}catch(Z){_.fail("Authentication failed"),console.error(r.red(`
1491
- Invalid credentials. Please try again.`)),process.exit(1)}let C=p("Fetching workspaces...").start(),$;try{let Z=await o0(A);if(Z.length===0)C.fail("No workspaces found"),console.error(r.red(`
1492
- ✖ No workspaces found where you have ADMIN access.`)),process.exit(1);if(C.succeed(`Found ${Z.length} workspace(s)`),F?.workspaceId&&Z.some((K)=>K.id===F.workspaceId)){let K=Z.find((DD)=>DD.id===F.workspaceId);console.log(r.gray(` Using workspace from existing config: ${K?.name}`)),$=F.workspaceId}else if(Z.length===1)$=Z[0].id,console.log(r.gray(` Auto-selected workspace: ${Z[0].name}`));else console.log(r.gray(`
1520
+ `}function CE(D){if(D==="next")return`import Image, { ImageProps } from "next/image";
1521
+ import { getMediaById } from "./siteon";
1522
+
1523
+ interface DynamicImageServerProps extends Omit<ImageProps, 'src' | 'alt'> {
1524
+ mediaId: string;
1525
+ alt?: string;
1526
+ fallbackSrc?: string;
1527
+ }
1528
+
1529
+ export default async function SiteOnImageServer({
1530
+ mediaId,
1531
+ alt,
1532
+ fallbackSrc,
1533
+ ...imageProps
1534
+ }: DynamicImageServerProps) {
1535
+ let data = null;
1536
+ let error = null;
1537
+
1538
+ try {
1539
+ data = await getMediaById(mediaId);
1540
+ } catch (err) {
1541
+ error = err;
1542
+ }
1543
+
1544
+ if (error && !fallbackSrc) {
1545
+ return (
1546
+ <div style={{ width: "100%", height: "100%", backgroundColor: "#f0f0f0" }}>
1547
+ <p style={{ color: "#999", textAlign: "center", padding: "16px" }}>
1548
+ Failed to load image
1549
+ </p>
1550
+ </div>
1551
+ );
1552
+ }
1553
+
1554
+ return (
1555
+ <Image
1556
+ src={data?.url || fallbackSrc || ""}
1557
+ alt={alt || data?.name || "Image"}
1558
+ {...imageProps}
1559
+ />
1560
+ );
1561
+ }
1562
+ `;return`import { ImgHTMLAttributes } from "react";
1563
+ import { getMediaById } from "./siteon";
1564
+
1565
+ interface DynamicImageServerProps
1566
+ extends Omit<ImgHTMLAttributes<HTMLImageElement>, 'src' | 'alt'> {
1567
+ mediaId: string;
1568
+ alt?: string;
1569
+ fallbackSrc?: string;
1570
+ }
1571
+
1572
+ export default async function SiteOnImageServer({
1573
+ mediaId,
1574
+ alt,
1575
+ fallbackSrc = "/placeholder.jpg",
1576
+ ...imgProps
1577
+ }: DynamicImageServerProps) {
1578
+ let data = null;
1579
+ let error = null;
1580
+
1581
+ try {
1582
+ data = await getMediaById(mediaId);
1583
+ } catch (err) {
1584
+ error = err;
1585
+ }
1586
+
1587
+ if (error && !fallbackSrc) {
1588
+ return (
1589
+ <div style={{ width: "100%", height: "100%", backgroundColor: "#f0f0f0" }}>
1590
+ <p style={{ color: "#999", textAlign: "center", padding: "16px" }}>
1591
+ Failed to load image
1592
+ </p>
1593
+ </div>
1594
+ );
1595
+ }
1596
+
1597
+ return (
1598
+ <img
1599
+ src={data?.url || fallbackSrc}
1600
+ alt={alt || data?.name || "Image"}
1601
+ {...imgProps}
1602
+ />
1603
+ );
1604
+ }
1605
+ `}function AE(D){if(D==="next")return`import Image from "next/image";
1606
+ import { getMediaById } from "./siteon.js";
1607
+
1608
+ export default async function SiteOnImageServer({
1609
+ mediaId,
1610
+ alt,
1611
+ fallbackSrc,
1612
+ ...imageProps
1613
+ }) {
1614
+ let data = null;
1615
+ let error = null;
1616
+
1617
+ try {
1618
+ data = await getMediaById(mediaId);
1619
+ } catch (err) {
1620
+ error = err;
1621
+ }
1622
+
1623
+ if (error && !fallbackSrc) {
1624
+ return (
1625
+ <div style={{ width: "100%", height: "100%", backgroundColor: "#f0f0f0" }}>
1626
+ <p style={{ color: "#999", textAlign: "center", padding: "16px" }}>
1627
+ Failed to load image
1628
+ </p>
1629
+ </div>
1630
+ );
1631
+ }
1632
+
1633
+ return (
1634
+ <Image
1635
+ src={data?.url || fallbackSrc || ""}
1636
+ alt={alt || data?.name || "Image"}
1637
+ {...imageProps}
1638
+ />
1639
+ );
1640
+ }
1641
+ `;return`import { getMediaById } from "./siteon.js";
1642
+
1643
+ export default async function SiteOnImageServer({
1644
+ mediaId,
1645
+ alt,
1646
+ fallbackSrc = "/placeholder.jpg",
1647
+ ...imgProps
1648
+ }) {
1649
+ let data = null;
1650
+ let error = null;
1651
+
1652
+ try {
1653
+ data = await getMediaById(mediaId);
1654
+ } catch (err) {
1655
+ error = err;
1656
+ }
1657
+
1658
+ if (error && !fallbackSrc) {
1659
+ return (
1660
+ <div style={{ width: "100%", height: "100%", backgroundColor: "#f0f0f0" }}>
1661
+ <p style={{ color: "#999", textAlign: "center", padding: "16px" }}>
1662
+ Failed to load image
1663
+ </p>
1664
+ </div>
1665
+ );
1666
+ }
1667
+
1668
+ return (
1669
+ <img
1670
+ src={data?.url || fallbackSrc}
1671
+ alt={alt || data?.name || "Image"}
1672
+ {...imgProps}
1673
+ />
1674
+ );
1675
+ }
1676
+ `}function wE(D){let u=Q.join(D,"package.json");if(!$E.existsSync(u))return!1;try{let F=JSON.parse($E.readFileSync(u,"utf-8"));return"@tanstack/react-query"in{...F.dependencies,...F.devDependencies}}catch{return!1}}function rE(D,u){let{workspaceId:F,outputDir:E,projectType:B,language:_,httpClient:A,framework:C,envVarLocation:$,useReactCache:w,selectedForms:r,selectedPublicForms:M}=u,L=Q.join(D,E,"siteon"),q=Q.join(L,"forms"),I=Q.join(L,"public-forms"),T=[],R=B==="static"?"js":_==="typescript"?"ts":"js";if(B==="static")a6(L,u,T,R);else if(_==="typescript")c6(L,u,T);else o6(L,u,T);for(let j of r){let x=`${_D(j.slug)}.${R}`,b=Q.join(q,x),Z;if(B==="static")Z=m3(j,r);else if(_==="typescript")Z=d3(j,w,r);else Z=ou(j,w,r);t(b,Z),T.push(b)}let S=Q.join(q,`index.${R}`),H=_==="typescript"?x3(r,S):f3(r,S);if(t(S,H),T.push(S),M&&M.length>0){for(let b of M){let Z=`${_D(b.slug)}.${R}`,K=Q.join(I,Z),DD=_==="typescript"?a3(b):c3(b);t(K,DD),T.push(K)}let j=Q.join(I,`index.${R}`),x=_==="typescript"?DE(M,j):uE(M,j);t(j,x),T.push(j)}let h=B==="framework"&&(C==="next"||C==="react"),W=Q.join(L,`index.${R}`),J=_==="typescript"?v3(M?.length>0,h):k3(M?.length>0,h);t(W,J),T.push(W);let G={workspaceId:F,baseUrl:"https://api.compitcom.in",outputDir:E,projectType:B,language:B!=="static"?_:void 0,httpClient:B!=="static"?A:void 0,framework:B!=="static"?C:void 0,envVarLocation:B!=="static"?$:void 0,useReactCache:B!=="static"?w:void 0,forms:r.map((j)=>j.slug),publicForms:M?.map((j)=>j.slug)||[],createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()},ID=Q.join(D,"siteon.config.json");if(t(ID,JSON.stringify(G,null,2)),T.push(ID),B==="framework"&&$==="env"){let j=V3(F,C),x=Q.join(D,".env");Z3(x,j),T.push(x)}return{filesCreated:T,config:G}}function a6(D,u,F,E){let{workspaceId:B}=u,_=Q.join(D,`siteon.${E}`);t(_,y3(B)),F.push(_);let A=Q.join(D,`types.${E}`);t(A,t3()),F.push(A)}function c6(D,u,F){let{workspaceId:E,httpClient:B,framework:_,envVarLocation:A,useReactCache:C}=u,$=_==="next"||_==="react",w=Q.join(D,"siteon.ts");t(w,j3(E,_,A,B,C)),F.push(w);let r=Q.join(D,"types.ts");if(t(r,b3()),F.push(r),$){let M=Q.join(D,"media.ts"),L=wE(Q.dirname(Q.dirname(D)));t(M,FE({httpClient:B,framework:_,useReactCache:C,hasReactQuery:L})),F.push(M);let q=Q.join(D,"siteon-image.tsx");if(!qD(q))t(q,BE(_)),F.push(q);let I=Q.join(D,"siteon-image-server.tsx");if(!qD(I))t(I,CE(_)),F.push(I)}}function o6(D,u,F){let{workspaceId:E,httpClient:B,framework:_,envVarLocation:A,useReactCache:C}=u,$=_==="next"||_==="react",w=Q.join(D,"siteon.js");if(t(w,K3(E,_,A,B,C)),F.push(w),$){let r=Q.join(D,"media.js"),M=wE(Q.dirname(Q.dirname(D)));t(r,EE({httpClient:B,framework:_,useReactCache:C,hasReactQuery:M})),F.push(r);let L=Q.join(D,"siteon-image.jsx");if(!qD(L))t(L,_E(_)),F.push(L);let q=Q.join(D,"siteon-image-server.jsx");if(!qD(q))t(q,AE(_)),F.push(q)}}var ME={name:"siteon-registry",version:"1.5.4",description:"CLI tool to generate type-safe API clients for Siteon workspaces",type:"module",scripts:{build:"bun build src/index.ts --outdir dist --target node --format esm --minify && bun postbuild.js",dev:"bun --watch src/index.ts"},keywords:["siteon","cli","forms","api-client"],author:"Compitcom",license:"PRIVATE",repository:{type:"git",url:"git+https://github.com/compitcom/siteon-registry.git"},dependencies:{chalk:"^5.3.0",commander:"^12.1.0",enquirer:"^2.4.1",ora:"^8.0.1"},devDependencies:{"@types/bun":"^1.1.0","@types/node":"^20.11.0",typescript:"^5.3.3"},engines:{node:">=18"}};function cD(){return ME.version}async function IE(){DB(cD());let D=process.cwd(),u=qE.join(D,"siteon.config.json"),F=qD(u)?lD(u):null;if(F){if(console.log(z.yellow("\uD83D\uDCCB Found existing siteon.config.json")),console.log(z.gray(` Workspace ID: ${F.workspaceId}`)),console.log(z.gray(` Output Dir: ${F.outputDir}`)),console.log(z.gray(` Project Type: ${F.projectType}`)),console.log(z.gray(` Forms: ${F.forms.join(", ")}`)),F.publicForms&&F.publicForms.length>0)console.log(z.gray(` Public Forms: ${F.publicForms.join(", ")}`));console.log("")}try{let{email:E,password:B}=await M3(),_=p("Authenticating...").start(),A;try{A=await a0(E,B),_.succeed("Authenticated successfully")}catch(Z){_.fail("Authentication failed"),console.error(z.red(`
1677
+ ✖ Invalid credentials. Please try again.`)),process.exit(1)}let C=p("Fetching workspaces...").start(),$;try{let Z=await e0(A);if(Z.length===0)C.fail("No workspaces found"),console.error(z.red(`
1678
+ ✖ No workspaces found where you have ADMIN access.`)),process.exit(1);if(C.succeed(`Found ${Z.length} workspace(s)`),F?.workspaceId&&Z.some((K)=>K.id===F.workspaceId)){let K=Z.find((DD)=>DD.id===F.workspaceId);console.log(z.gray(` Using workspace from existing config: ${K?.name}`)),$=F.workspaceId}else if(Z.length===1)$=Z[0].id,console.log(z.gray(` Auto-selected workspace: ${Z[0].name}`));else console.log(z.gray(`
1493
1679
  \uD83D\uDCCB Workspace Selection
1494
- `)),$=await q3(Z)}catch(Z){C.fail("Failed to fetch workspaces"),console.error(r.red(`
1495
- ✖ ${Z.message}`)),process.exit(1)}let w,S,q,M,z,L,R=!1;if(F)w=F.outputDir,S=F.projectType,q=F.language||"javascript",M=F.httpClient||"fetch",z=F.framework||"other",L=F.envVarLocation||"config",R=F.useReactCache??z==="next",console.log(r.gray(`
1680
+ `)),$=await q3(Z)}catch(Z){C.fail("Failed to fetch workspaces"),console.error(z.red(`
1681
+ ✖ ${Z.message}`)),process.exit(1)}let w,r,M,L,q,I,T=!1;if(F)w=F.outputDir,r=F.projectType,M=F.language||"javascript",L=F.httpClient||"fetch",q=F.framework||"other",I=F.envVarLocation||"config",T=F.useReactCache??q==="next",console.log(z.gray(`
1496
1682
  \uD83D\uDCCB Using existing configuration
1497
- `));else{console.log(r.gray(`
1683
+ `));else{console.log(z.gray(`
1498
1684
  \uD83D\uDCCB Configuration
1499
- `));let Z=H3(D);if(w=await z3(Z),S=await r3(),q="javascript",M="fetch",z="other",L="config",R=!1,S==="framework"){let K=G3(D),DD=Q3(D);if(K)z=K,console.log(r.gray(` Auto-detected framework: ${z}`));else z=await L3();if(DD)q="typescript",console.log(r.gray(" Auto-detected TypeScript"));else q=await M3();if(X3(D))M="axios",console.log(r.gray(" Auto-detected axios"));else M=await h3();if(L=await R3(),z==="next")R=!0,console.log(r.gray(" Auto-enabled cache mode for Next.js"));else if(z==="react"||z==="vite")R=await U3()}}let I=p("Fetching forms...").start(),h=await a0(A,$);if(h.length===0)I.fail("No active forms found"),console.error(r.red(`
1500
- ✖ No active forms found in this workspace.`)),process.exit(1);I.succeed(`Found ${h.length} active form(s)`),console.log(r.gray(`
1685
+ `));let Z=W3(D);if(w=await I3(Z),r=await z3(),M="javascript",L="fetch",q="other",I="config",T=!1,r==="framework"){let K=G3(D),DD=Q3(D);if(K)q=K,console.log(z.gray(` Auto-detected framework: ${q}`));else q=await L3();if(DD)M="typescript",console.log(z.gray(" Auto-detected TypeScript"));else M=await S3();if(X3(D))L="axios",console.log(z.gray(" Auto-detected axios"));else L=await T3();if(I=await U3(),q==="next")T=!0,console.log(z.gray(" Auto-enabled cache mode for Next.js"));else if(q==="react"||q==="vite")T=await h3()}}let R=p("Fetching forms...").start(),S=await c0(A,$);if(S.length===0)R.fail("No active forms found"),console.error(z.red(`
1686
+ ✖ No active forms found in this workspace.`)),process.exit(1);R.succeed(`Found ${S.length} active form(s)`),console.log(z.gray(`
1501
1687
  \uD83D\uDCDD Form Selection
1502
- `));let H=await T3(h),T=p("Fetching form details...").start(),W=[];for(let Z of H){let K=await c0(A,$,Z);W.push(K)}T.succeed(`Fetched details for ${W.length} form(s)`);let J=p("Fetching public forms...").start(),G=[];try{let Z=await e0(A,$);if(J.succeed(`Found ${Z.length} public form(s)`),Z.length>0){console.log(r.gray(`
1688
+ `));let H=await R3(S),h=p("Fetching form details...").start(),W=[];for(let Z of H){let K=await o0(A,$,Z);W.push(K)}h.succeed(`Fetched details for ${W.length} form(s)`);let J=p("Fetching public forms...").start(),G=[];try{let Z=await DF(A,$);if(J.succeed(`Found ${Z.length} public form(s)`),Z.length>0){console.log(z.gray(`
1503
1689
  \uD83D\uDCDD Public Form Selection
1504
- `));let K=await I3(Z);if(K.length>0){let DD=p("Fetching public form details...").start();for(let AD of K){let cD=await DF(A,$,AD);G.push(cD)}DD.succeed(`Fetched details for ${G.length} public form(s)`)}}}catch(Z){J.warn("Could not fetch public forms")}if(S==="framework"){let Z=J3(M);if(Z.length>0){console.log(r.gray(`
1690
+ `));let K=await H3(Z);if(K.length>0){let DD=p("Fetching public form details...").start();for(let AD of K){let oD=await uF(A,$,AD);G.push(oD)}DD.succeed(`Fetched details for ${G.length} public form(s)`)}}}catch(Z){J.warn("Could not fetch public forms")}if(r==="framework"){let Z=J3(L);if(Z.length>0){console.log(z.gray(`
1505
1691
  \uD83D\uDCE6 Dependencies
1506
- `));let K=p(`Installing dependencies: ${Z.join(", ")}...`).start();try{await Y3(D,Z),K.succeed("Dependencies installed")}catch(DD){K.warn("Could not install dependencies automatically");let AD=au(D),cD=AD==="yarn"?"add":AD==="bun"?"add":AD==="pnpm"?"add":"install";console.log(r.yellow(`
1507
- ⚠ Please install manually: ${AD} ${cD} ${Z.join(" ")}`))}}}console.log(r.gray(`
1692
+ `));let K=p(`Installing dependencies: ${Z.join(", ")}...`).start();try{await Y3(D,Z),K.succeed("Dependencies installed")}catch(DD){K.warn("Could not install dependencies automatically");let AD=cu(D),oD=AD==="yarn"?"add":AD==="bun"?"add":AD==="pnpm"?"add":"install";console.log(z.yellow(`
1693
+ ⚠ Please install manually: ${AD} ${oD} ${Z.join(" ")}`))}}}console.log(z.gray(`
1508
1694
  \uD83D\uDCC1 Generating files
1509
- `));let zD=p("Generating files...").start(),j={workspaceId:$,email:E,password:B,outputDir:w,projectType:S,language:q,httpClient:M,framework:z,envVarLocation:L,useReactCache:R,selectedForms:W,selectedPublicForms:G},{filesCreated:x}=$E(D,j);zD.succeed(`Generated ${x.length} file(s)`),console.log(r.bold.green(`
1695
+ `));let ID=p("Generating files...").start(),j={workspaceId:$,email:E,password:B,outputDir:w,projectType:r,language:M,httpClient:L,framework:q,envVarLocation:I,useReactCache:T,selectedForms:W,selectedPublicForms:G},{filesCreated:x}=rE(D,j);ID.succeed(`Generated ${x.length} file(s)`),console.log(z.bold.green(`
1510
1696
  ✅ Siteon initialized successfully!
1511
- `)),console.log(r.cyan("╔════════════════════════════════════════╗")),console.log(r.cyan("║ FILES CREATED ║")),console.log(r.cyan("╚════════════════════════════════════════╝"));for(let Z of x.slice(0,10)){let K=SE.relative(D,Z);console.log(r.gray(` ✓ ${K}`))}if(x.length>10)console.log(r.gray(` ✓ ... and ${x.length-10} more files`));if(console.log(r.cyan(`
1512
- ╔════════════════════════════════════════╗`)),console.log(r.cyan("║ CONFIGURATION SAVED ║")),console.log(r.cyan("╚════════════════════════════════════════╝")),console.log(r.gray(" \uD83D\uDCC4 siteon.config.json")),S==="framework"&&L==="env")console.log(r.yellow(`
1513
- ⚠ Environment variables added to .env file`)),console.log(r.gray(" Make sure to add .env to your .gitignore"));console.log(r.cyan(`
1514
- ╔════════════════════════════════════════╗`)),console.log(r.cyan("║ USAGE EXAMPLE ║")),console.log(r.cyan("╚════════════════════════════════════════╝"));let y=w==="."?"./siteon":`./${w}/siteon`;if(W.length>0||G.length>0)if(q==="typescript"){if(W.length>0)console.log(r.gray(`
1515
- // Fetching data from forms:`)),console.log(r.yellow(` import { getAll${CD(W[0].name)} } from '${y}';`)),console.log(r.yellow(` const data = await getAll${CD(W[0].name)}();`));if(G.length>0)console.log(r.gray(`
1516
- // Submitting public forms:`)),console.log(r.yellow(` import { submit${CD(G[0].name)} } from '${y}';`)),console.log(r.yellow(` await submit${CD(G[0].name)}(formData, files);`))}else{if(W.length>0)console.log(r.gray(`
1517
- // Fetching data from forms:`)),console.log(r.yellow(` import { getAll${CD(W[0].name)} } from '${y}/index.js';`)),console.log(r.yellow(` const data = await getAll${CD(W[0].name)}();`));if(G.length>0)console.log(r.gray(`
1518
- // Submitting public forms:`)),console.log(r.yellow(` import { submit${CD(G[0].name)} } from '${y}/index.js';`)),console.log(r.yellow(` await submit${CD(G[0].name)}(formData, files);`))}console.log(r.gray(`
1519
- `)),console.log(r.bold.green(`\uD83C\uDF89 Ready to use! Happy coding!
1520
- `))}catch(E){console.error(r.red(`
1521
- ✖ Error: ${E.message}`)),process.exit(1)}}function CD(D){return D.split(/[-_\s]+/).map((u)=>u.charAt(0).toUpperCase()+u.slice(1).toLowerCase()).join("")}function o6(D){console.clear(),console.log(r.cyanBright(`
1697
+ `)),console.log(z.cyan("╔════════════════════════════════════════╗")),console.log(z.cyan("║ FILES CREATED ║")),console.log(z.cyan("╚════════════════════════════════════════╝"));for(let Z of x.slice(0,10)){let K=qE.relative(D,Z);console.log(z.gray(` ✓ ${K}`))}if(x.length>10)console.log(z.gray(` ✓ ... and ${x.length-10} more files`));if(console.log(z.cyan(`
1698
+ ╔════════════════════════════════════════╗`)),console.log(z.cyan("║ CONFIGURATION SAVED ║")),console.log(z.cyan("╚════════════════════════════════════════╝")),console.log(z.gray(" \uD83D\uDCC4 siteon.config.json")),r==="framework"&&I==="env")console.log(z.yellow(`
1699
+ ⚠ Environment variables added to .env file`)),console.log(z.gray(" Make sure to add .env to your .gitignore"));console.log(z.cyan(`
1700
+ ╔════════════════════════════════════════╗`)),console.log(z.cyan("║ USAGE EXAMPLE ║")),console.log(z.cyan("╚════════════════════════════════════════╝"));let b=w==="."?"./siteon":`./${w}/siteon`;if(W.length>0||G.length>0)if(M==="typescript"){if(W.length>0)console.log(z.gray(`
1701
+ // Fetching data from forms:`)),console.log(z.yellow(` import { getAll${CD(W[0].slug)} } from '${b}';`)),console.log(z.yellow(` const data = await getAll${CD(W[0].slug)}();`));if(G.length>0)console.log(z.gray(`
1702
+ // Submitting public forms:`)),console.log(z.yellow(` import { submit${CD(G[0].slug)} } from '${b}';`)),console.log(z.yellow(` await submit${CD(G[0].slug)}(formData, files);`))}else{if(W.length>0)console.log(z.gray(`
1703
+ // Fetching data from forms:`)),console.log(z.yellow(` import { getAll${CD(W[0].slug)} } from '${b}/index.js';`)),console.log(z.yellow(` const data = await getAll${CD(W[0].slug)}();`));if(G.length>0)console.log(z.gray(`
1704
+ // Submitting public forms:`)),console.log(z.yellow(` import { submit${CD(G[0].slug)} } from '${b}/index.js';`)),console.log(z.yellow(` await submit${CD(G[0].slug)}(formData, files);`))}console.log(z.gray(`
1705
+ `)),console.log(z.bold.green(`\uD83C\uDF89 Ready to use! Happy coding!
1706
+ `))}catch(E){console.error(z.red(`
1707
+ ✖ Error: ${E.message}`)),process.exit(1)}}function CD(D){return D.split(/[-_\s]+/).map((u)=>u.charAt(0).toUpperCase()+u.slice(1).toLowerCase()).join("")}function DB(D){console.clear(),console.log(z.cyanBright(`
1522
1708
  ███████╗██╗████████╗███████╗ ██████╗ ███╗ ██╗
1523
1709
  ██╔════╝██║╚══██╔══╝██╔════╝██╔═══██╗████╗ ██║
1524
1710
  ███████╗██║ ██║ █████╗ ██║ ██║██╔██╗ ██║
1525
1711
  ╚════██║██║ ██║ ██╔══╝ ██║ ██║██║╚██╗██║
1526
1712
  ███████║██║ ██║ ███████╗╚██████╔╝██║ ╚████║
1527
1713
  ╚══════╝╚═╝ ╚═╝ ╚══════╝ ╚═════╝ ╚═╝ ╚═══╝
1528
- `)),console.log(r.gray(`Initialize Siteon in your project (v${D})
1529
- `))}var ou=new M0;ou.name("siteon").description("CLI tool to generate type-safe API clients for Siteon workspaces").version(aD());ou.command("init").description("Initialize Siteon in your project").action(qE);ou.parse();
1714
+ `)),console.log(z.gray(`Initialize Siteon in your project (v${D})
1715
+ `))}var eu=new S0;eu.name("siteon").description("CLI tool to generate type-safe API clients for Siteon workspaces").version(cD());eu.command("init").description("Initialize Siteon in your project").action(IE);eu.parse();